var K=Object.defineProperty,J=Object.defineProperties;var Z=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var ee=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable;var W=(i,t,n)=>t in i?K(i,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[t]=n,T=(i,t)=>{for(var n in t||(t={}))ee.call(t,n)&&W(i,n,t[n]);if(P)for(var n of P(t))te.call(t,n)&&W(i,n,t[n]);return i},k=(i,t)=>J(i,Z(t));import{h as ae,i as v,d as V,t as le,b as e,j as a,F as L,w as se,k as M,o as oe,f as ne,e as ue,g as re}from"./base.40eeba89.js";import"./lib-flexible.08f197e6.js";import{u as $,G,a as A,B as ie,P as Y,T as ce,b as de,s as N,E as pe,M as Ae,r as U,c as X,g as me,d as ve,e as fe,f as he,h as Fe,i as ge,j as ye,o as Ce}from"./index.e7c117c1.js";import{s as O}from"./index.module.3f9d5eb1.js";import{h as Ee,N as m,c as x}from"./index.21f4eec9.js";import{s as Se}from"./state.6c6bbefd.js";import{w as we}from"./wx_bg.fc243df2.js";import{S as xe}from"./index.943c3b9f.js";import"./index.34d5d7f8.js";import"./music.b35eb5be.js";import"./index.025018fb.js";import"./index.76b00dac.js";function Ve(){import("data:text/javascript,")}const Ne="_musicSheet_wp4zc_1",_e="_btn_wp4zc_8",Ie="_btnCont_wp4zc_15",be="_popup_wp4zc_21";var Be={musicSheet:Ne,btn:_e,btnCont:Ie,popup:be};const De="_header_15pat_1",Te="_center_15pat_4",Oe="_info_15pat_20",Le="_demos_15pat_29",Re="_maininfo_15pat_52",ke="_line_15pat_103",Me="_back_15pat_117",Ge="_btns_15pat_124",He="_pop_15pat_130",qe="_close_15pat_166",Pe="_trybtn_15pat_187";var F={header:De,center:Te,info:Oe,demos:Le,maininfo:Re,line:ke,back:Me,btns:Ge,pop:He,close:qe,try:"_try_15pat_181",trybtn:Pe},We="./assets/explain.9e197a0a.svg",Ye="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAAHeq0ewAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAC6ADAAQAAAABAAAACwAAAACBvloGAAABH0lEQVQYGW1Ru0oDURA9s27EQrETEbv8g3+RSgub7IoELASF7CYGbbYQFHLjB4gI2WAT8LPEWjCd7Hjm3t1VwWnmdeacmXsFo3SMSi9iqF4CuodgRRGLj7K+YqvbAbLkru4hYrAD69CY6Ckgz1gu1wR5ck+qK1/wDUJmC4ngyonBA9o8J/410vg2qd4wne9DRDFKrqFYl0aVxQfqDIl8FAYmXHk6wSvc4ijC+GTa8isODRShqjJ4RGlHgOd/whZvkXVgfO8c2Q05d3XzQdgkdZ7FGoIVDnrb9QLp089xNU3jTHKze4yi+ArPao08mdUnNDD6X0qWIe/f8PDbFmFMKh9/lOwtXJnFxHcguuLACz/t3OT8oOqAlzoOnTHfsNo35fxqh9SRnu4AAAAASUVORK5CYII=";const j=ae(),z=$(),h=v("pitch"),_=v(!1),Q=v(!1);var Ue=V({name:"ColexiuReportHeader",props:{detail:{type:Object},record:{type:Object},className:{type:String}},emits:["activeChange"],setup(i,{emit:t,expose:n}){return n({autoShow:()=>{localStorage.getItem("explain-view")!="1"&&(_.value=!0,setTimeout(()=>{_.value=!1,localStorage.setItem("explain-view","1")},5e3))}}),()=>{var y,b;const{detail:g,record:o}=le(i),E=()=>{var B,D;const{origin:r}=location;let I=r+"/student/#/music-detail";I+=`?id=${(D=(B=o.value)==null?void 0:B.musicalNotesPlayStats)==null?void 0:D.examSongId}`;const w={url:I,action:z.action||"h5",pageTag:z.pageTag||1},R=encodeURIComponent(JSON.stringify(w));/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)?window.location.href=`ColexiuStudent://linkUrl=${R}`:/(Android)/i.test(navigator.userAgent)?(w.url=encodeURIComponent(w.url),window.location.href=`colexiustudent://html:8888/SplashActivity?url=${encodeURIComponent(JSON.stringify(w))}`):ce("\u8BF7\u7528\u624B\u673A\u6216\u79FB\u52A8\u8BBE\u5907\u6253\u5F00")},S=()=>{j.weixin?Q.value=!0:(E(),j.isApp||setTimeout(()=>{location.href=location.origin+"/student/#/download"},3e3))};return e("header",{class:[F.header,F.className]},[e("div",{class:F.info},[o.value&&((y=o.value)==null?void 0:y.heardLevel)?e(G,{class:F.center,columnNum:5},{default:()=>[e(A,{class:"van-hairline--right"},{text:()=>e("span",null,[a("\u96BE\u5EA6")]),icon:()=>{var r;return e("span",null,[Ee[(r=o.value)==null?void 0:r.heardLevel]])}}),e(A,{class:"van-hairline--right"},{text:()=>e("span",null,[a("\u8BC4\u6D4B\u5206\u6570")]),icon:()=>{var r;return e("span",null,[(r=o.value)==null?void 0:r.score,a("\u5206")])}}),e(A,{class:"van-hairline--right",onClick:()=>{h.value="pitch",t("activeChange","pitch")}},{text:()=>e("span",{class:["switch",{active:h.value==="pitch"}]},[a("\u97F3\u51C6")]),icon:()=>{var r;return e("span",{style:{color:"#2DC7AA"}},[(r=o.value)==null?void 0:r.intonation,a("\u5206")])}}),e(A,{class:"van-hairline--right",onClick:()=>{h.value="rhythm",t("activeChange","rhythm")}},{text:()=>e("span",{class:["switch",{active:h.value==="rhythm"}]},[a("\u8282\u594F")]),icon:()=>{var r;return e("span",{style:{color:"#FF4E19"}},[(r=o.value)==null?void 0:r.cadence,a("\u5206")])}}),e(A,{onClick:()=>{h.value="completion",t("activeChange","completion")}},{text:()=>e("span",{class:["switch",{active:h.value==="completion"}]},[a("\u65F6\u503C")]),icon:()=>{var r;return e("span",{style:{color:"#FFC459"}},[(r=o.value)==null?void 0:r.integrity,a("\u5206")])}})]}):null,e(G,{columnNum:3,class:F.btns},{default:()=>[e(A,{onClick:()=>_.value=!0},{text:()=>e("span",null,[a("\u91CA\u4E49")]),icon:()=>e("img",{src:We},null)})]})]),(b=o.value)!=null&&b.score?e("div",{class:F.try},[e(ie,{class:F.trybtn,onClick:S},{default:()=>[a("\u6211\u6765\u8BD5\u4E00\u8BD5")]})]):null,o.value?e("div",{class:F.demos},[h.value==="pitch"&&e(L,null,[e("div",null,[e(m,{fill:"#FFAB25",shadow:!0,x:-3,y:0},null),e("span",null,[a("\u97F3\u9AD8\u4E86")])]),e("div",null,[e(m,{fill:"#FFAB25",shadow:!0,x:-1,y:-2},null),e("span",null,[a("\u97F3\u4F4E\u4E86")])])]),Se.isPercussion?null:e(L,null,[h.value==="rhythm"&&e(L,null,[e("div",null,[e(m,{fill:"#FF4444",shadow:!0,x:0},null),e("span",null,[a("\u8282\u594F\u5FEB\u4E86")])]),e("div",null,[e(m,{fill:"#FF4444",shadow:!0,x:-3,y:-2},null),e("span",null,[a("\u8282\u594F\u6162\u4E86")])])]),h.value==="completion"&&e("div",null,[e(m,{fill:"#CC75FF"},null),e("span",null,[a("\u65F6\u503C\u4E0D\u8DB3")])])])]):null,e(Y,{show:Q.value,position:"top",style:{background:"none"}},{default:()=>[e("img",{src:we,style:{width:"80%",display:"block",margin:"auto"}},null)]}),e(Y,{teleport:"body",show:_.value,class:F.pop,style:{width:"60vw"},onClickOverlay:()=>_.value=!1},{default:()=>[e("div",{class:F.close,onClick:()=>_.value=!1},[e("img",{src:Ye},null)]),e("h2",null,[a("\u56FE\u6807\u91CA\u4E49")]),e(G,{columnNum:2,class:F.btns,border:!1},{default:()=>[e(A,null,{text:()=>e("span",null,[a("\u7EFF\u8272\u97F3\u7B26\uFF1A\u6F14\u594F\u6B63\u786E")]),icon:()=>e(m,{fill:"#01C1B5"},null)}),e(A,null,{text:()=>e("span",null,[a("\u7EA2\u8272\u97F3\u7B26\uFF1A\u9519\u97F3")]),icon:()=>e(m,{fill:"#FF4444"},null)}),e(A,null,{text:()=>e("span",null,[a("\u97F3\u7B26\u91CD\u5F71(\u7EA2\u8272\u5728\u524D)\uFF1A\u8282\u594F\u8FC7\u5FEB")]),icon:()=>e(m,{fill:"#FF4444",shadow:!0,x:0},null)}),e(A,null,{text:()=>e("span",null,[a("\u97F3\u7B26\u91CD\u5F71(\u7EA2\u8272\u5728\u540E)\uFF1A\u8282\u594F\u6162\u4E86")]),icon:()=>e(m,{fill:"#FF4444",shadow:!0,x:-3,y:-2},null)}),e(A,null,{text:()=>e("span",null,[a("\u97F3\u7B26\u91CD\u5F71(\u9EC4\u8272\u5728\u4E0A)\uFF1A\u97F3\u9AD8\u4E86")]),icon:()=>e(m,{fill:"#FFAB25",shadow:!0,x:-3,y:0},null)}),e(A,null,{text:()=>e("span",null,[a("\u97F3\u7B26\u91CD\u5F71(\u9EC4\u8272\u5728\u4E0B)\uFF1A\u97F3\u4F4E\u4E86")]),icon:()=>e(m,{fill:"#FFAB25",shadow:!0,x:-1,y:-2},null)}),e(A,null,{text:()=>e("span",null,[a("\u7D2B\u8272\u97F3\u7B26\uFF1A\u5B8C\u6574\u5EA6\u4E0D\u8DB3")]),icon:()=>e(m,{fill:"#CC75FF"},null)}),e(A,null,{text:()=>e("span",null,[a("\u7070\u8272\u97F3\u7B26\uFF1A\u672A\u6F14\u594F")]),icon:()=>e(m,{fill:"#AEAEAE"},null)})]})]})])}}});const H=$(),Xe=async(i,t)=>{const n=await Fe(i);let p=v("");const g=ge(n);p.value=ye(g.parsedXML,{title:t.musicSheetName});const o=Number(H["part-index"])||0;return p.value=Ce(p.value,o),p},je=i=>{const t=v("loading"),n=v({}),p=v({});return oe(async()=>{var g;t.value="loading";try{const o=await U.get("/sysMusicRecord/getLastEvaluationMusicalNotesPlayStats",{params:{recordId:H.id}});if(!o.data){t.value="error";return}p.value=o.data,console.log(p.value);const E=await U.get(`/music/sheet/detail/${(g=p.value)==null?void 0:g.musicalNotesPlayStats.examSongId}`);n.value=E.data,N.partIndex=o.data.partIndex||0,t.value="success"}catch(o){t.value="error",console.log(o)}}),[t,n,p]};var ze=V({name:"Colexiu",setup(){const i=v(),t=v(!0),n=v(!1),p=v(""),g=v([]),o=v([]),[E,S,y]=je(H.id);se(E,async()=>{if(E.value==="success"&&S.value.xmlFileUrl){const l=await Xe(S.value.xmlFileUrl,S.value);p.value=l.value}}),de();const b=l=>{switch(l){case"CADENCE_FAST":return"translateX(2px)";case"CADENCE_SLOW":return"translateX(-2px)";case"INTONATION_HIGH":return"translateY(-2px)";case"INTONATION_LOW":return"translateY(2px)";default:return""}},r=()=>{const l=["RIGHT","WRONG","CADENCE_WRONG"];return h.value==="pitch"?l.push("CADENCE_FAST","CADENCE_SLOW"):h.value==="rhythm"?l.push("INTONATION_HIGH","INTONATION_LOW"):h.value==="completion"&&l.push("INTEGRITY_WRONG"),y.value.musicalNotesPlayStats.notesData.filter(c=>l.includes(c.musicalErrorType))},I=()=>{R(),t.value=!1;for(const l of r()){const c=o.value[l.musicalNotesIndex];setTimeout(()=>{if(g.value.includes(c.id))return;g.value.push(c.id);const s=document.getElementById("vf-"+c.id),u=document.getElementById("vf-"+c.id+"-stem"),d=l.musicalErrorType,C=["INTONATION_HIGH","INTONATION_LOW","CADENCE_FAST","CADENCE_SLOW"].includes(d);if(u==null||u.classList.add(x[d]),s==null||s.classList.add(x[d]),s&&C){u==null||u.classList.remove(x[d]),u==null||u.classList.add(x.RIGHT),s==null||s.classList.remove(x[d]),s==null||s.classList.add(x.RIGHT);const f=s.querySelector(".vf-notehead").cloneNode(!0);f.style.transform=b(d),s.style.opacity=".7",u&&(u.style.opacity=".7"),f.id="vf-"+c.id+"-copy",f==null||f.classList.add(x[d]),osmd==null||osmd.container.querySelector("svg").insertAdjacentElement("afterbegin",f)}},300)}},w=l=>{if(!l)return;const c=l.classList.values();for(const s of c)(s==null?void 0:s.indexOf("vf-"))!==0&&l.classList.remove(s)},R=()=>{for(const l of g.value){w(document.getElementById("vf-"+l)),w(document.getElementById("vf-"+l+"-stem"));const c="vf-"+l+"-copy",s=document.getElementById(c);s&&s.remove()}g.value=[]},B=l=>{var s;t.value=!1,(s=i.value)==null||s.autoShow(),setTimeout(()=>{var u;for(const d of Array.from(document.querySelectorAll(".vf-beam")))(u=d.querySelector("path"))==null||u.setAttribute("fill","#aeaeae")}),X.osmd=l,o.value=me(X.osmd),I();const c=(u,d,C=!0)=>{const f=fe(u);N.evaluatings=k(T({},N.evaluatings),{[f.measureIndex]:k(T(T({},f),he(d.score)),{score:d.score,dontTransition:C})})};if(y.value.userMeasureScore){for(const u in y.value.userMeasureScore)if(Object.prototype.hasOwnProperty.call(y.value.userMeasureScore,u)){const d=y.value.userMeasureScore[u];for(const C of o.value)if(d.measureRenderIndex==C.noteElement.sourceMeasure.MeasureNumberXML-1)if(!C.noteElement.tie)c(C,d);else for(const f of C.noteElement.tie.notes){const q=ve(f);!q||c(q,d,f!==C.noteElement.tie.StartNote)}}}},D=()=>{n.value=!0,t.value=!1};return()=>{const l=t.value||E.value==="loading",c=n.value||E.value==="error";return e("div",{class:[O.container,M.sett.eyeProtection&&"eyeProtection",M.sett.camera&&"openCamera"]},[e(Ue,{className:O.header,detail:S.value,record:y,ref:i,style:{paddingLeft:N.isSpecialShapedScreen?N.notchHeight/2+"px":"auto"},onActiveChange:()=>I()},null),e("div",{id:"colexiu-detail-music-sheet",class:[O.musicSheet,Be.musicSheet],style:{paddingLeft:N.isSpecialShapedScreen?N.notchHeight/2+"px":"auto"}},[l&&!c&&e(xe,{class:O.skeleton,rowWidth:"80%",title:!0,row:3},null),c&&e(pe,null,null),p.value&&e(L,null,[e("h3",{style:{fontSize:"24px",fontWeight:"normal",textAlign:"center",padding:"0 10px",marginTop:"36px",marginBottom:"0px",marginLeft:"auto"},class:"van-ellipsis"},[S.value.musicSheetName]),e(Ae,{score:p.value,showSection:!0,opotions:{drawTitle:!1,drawComposer:!1,drawLyricist:!1,drawMetronomeMarks:!0,drawMeasureNumbers:!0,autoResize:!1},EngravingRules:{DefaultColorNotehead:"#aeaeae",DefaultColorRest:"#aeaeae",DefaultColorMusic:"#aeaeae",DefaultColorStem:"#aeaeae",DefaultColorChordSymbol:"#aeaeae",DefaultColorLabel:"#aeaeae",DYMusicScoreType:M.sett.type},onRerender:B,onRenderError:D},null)])])])}}});document.body.style.setProperty("--osdm-zoom",""+ne());ue();re(ze).mount("#app");export{Ve as __vite_legacy_guard};