var ov=Object.defineProperty;var av=(i,e,t)=>e in i?ov(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var Cn=(i,e,t)=>(av(i,typeof e!="symbol"?e+"":e,t),t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))s(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function t(n){const r={};return n.integrity&&(r.integrity=n.integrity),n.referrerPolicy&&(r.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?r.credentials="include":n.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(n){if(n.ep)return;n.ep=!0;const r=t(n);fetch(n.href,r)}})();function Qd(i,e){const t=Object.create(null),s=i.split(",");for(let n=0;n!!t[n.toLowerCase()]:n=>!!t[n]}function Qn(i){if(Ye(i)){const e={};for(let t=0;t{if(t){const s=t.split(cv);s.length>1&&(e[s[0].trim()]=s[1].trim())}}),e}function xi(i){let e="";if(Kt(i))e=i;else if(Ye(i))for(let t=0;tKt(i)?i:i==null?"":Ye(i)||Gt(i)&&(i.toString===t0||!Je(i.toString))?JSON.stringify(i,Z2,2):String(i),Z2=(i,e)=>e&&e.__v_isRef?Z2(i,e.value):zo(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[s,n])=>(t[`${s} =>`]=n,t),{})}:$2(e)?{[`Set(${e.size})`]:[...e.values()]}:Gt(e)&&!Ye(e)&&!i0(e)?String(e):e,Ot={},Uo=[],Xs=()=>{},pv=()=>!1,gv=/^on[^a-z]/,ju=i=>gv.test(i),jd=i=>i.startsWith("onUpdate:"),mi=Object.assign,Kd=(i,e)=>{const t=i.indexOf(e);t>-1&&i.splice(t,1)},mv=Object.prototype.hasOwnProperty,ut=(i,e)=>mv.call(i,e),Ye=Array.isArray,zo=i=>Ku(i)==="[object Map]",$2=i=>Ku(i)==="[object Set]",Je=i=>typeof i=="function",Kt=i=>typeof i=="string",Jd=i=>typeof i=="symbol",Gt=i=>i!==null&&typeof i=="object",e0=i=>Gt(i)&&Je(i.then)&&Je(i.catch),t0=Object.prototype.toString,Ku=i=>t0.call(i),bv=i=>Ku(i).slice(8,-1),i0=i=>Ku(i)==="[object Object]",qd=i=>Kt(i)&&i!=="NaN"&&i[0]!=="-"&&""+parseInt(i,10)===i,Dc=Qd(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ju=i=>{const e=Object.create(null);return t=>e[t]||(e[t]=i(t))},yv=/-(\w)/g,bn=Ju(i=>i.replace(yv,(e,t)=>t?t.toUpperCase():"")),vv=/\B([A-Z])/g,yo=Ju(i=>i.replace(vv,"-$1").toLowerCase()),qu=Ju(i=>i.charAt(0).toUpperCase()+i.slice(1)),Hh=Ju(i=>i?`on${qu(i)}`:""),dl=(i,e)=>!Object.is(i,e),Uh=(i,e)=>{for(let t=0;t{Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value:t})},Sv=i=>{const e=parseFloat(i);return isNaN(e)?i:e},Av=i=>{const e=Kt(i)?Number(i):NaN;return isNaN(e)?i:e};let Yp;const xv=()=>Yp||(Yp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});let Os;class wv{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=Os,!e&&Os&&(this.index=(Os.scopes||(Os.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=Os;try{return Os=this,e()}finally{Os=t}}}on(){Os=this}off(){Os=this.parent}stop(e){if(this._active){let t,s;for(t=0,s=this.effects.length;t{const e=new Set(i);return e.w=0,e.n=0,e},s0=i=>(i.w&Mr)>0,n0=i=>(i.n&Mr)>0,_v=({deps:i})=>{if(i.length)for(let e=0;e{const{deps:e}=i;if(e.length){let t=0;for(let s=0;s{(h==="length"||h>=l)&&a.push(u)})}else switch(t!==void 0&&a.push(o.get(t)),e){case"add":Ye(i)?qd(t)&&a.push(o.get("length")):(a.push(o.get(ro)),zo(i)&&a.push(o.get(Vf)));break;case"delete":Ye(i)||(a.push(o.get(ro)),zo(i)&&a.push(o.get(Vf)));break;case"set":zo(i)&&a.push(o.get(ro));break}if(a.length===1)a[0]&&Gf(a[0]);else{const l=[];for(const u of a)u&&l.push(...u);Gf(Zd(l))}}function Gf(i,e){const t=Ye(i)?i:[...i];for(const s of t)s.computed&&Xp(s);for(const s of t)s.computed||Xp(s)}function Xp(i,e){(i!==Us||i.allowRecurse)&&(i.scheduler?i.scheduler():i.run())}function Cv(i,e){var t;return(t=tu.get(i))===null||t===void 0?void 0:t.get(e)}const Tv=Qd("__proto__,__v_isRef,__isVue"),a0=new Set(Object.getOwnPropertyNames(Symbol).filter(i=>i!=="arguments"&&i!=="caller").map(i=>Symbol[i]).filter(Jd)),Lv=e1(),Bv=e1(!1,!0),Iv=e1(!0),jp=Rv();function Rv(){const i={};return["includes","indexOf","lastIndexOf"].forEach(e=>{i[e]=function(...t){const s=at(this);for(let r=0,o=this.length;r{i[e]=function(...t){ga();const s=at(this)[e].apply(this,t);return ma(),s}}),i}function Nv(i){const e=at(this);return is(e,"has",i),e.hasOwnProperty(i)}function e1(i=!1,e=!1){return function(s,n,r){if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return e;if(n==="__v_raw"&&r===(i?e?Jv:f0:e?h0:u0).get(s))return s;const o=Ye(s);if(!i){if(o&&ut(jp,n))return Reflect.get(jp,n,r);if(n==="hasOwnProperty")return Nv}const a=Reflect.get(s,n,r);return(Jd(n)?a0.has(n):Tv(n))||(i||is(s,"get",n),e)?a:ai(a)?o&&qd(n)?a:a.value:Gt(a)?i?d0(a):Ht(a):a}}const kv=l0(),Dv=l0(!0);function l0(i=!1){return function(t,s,n,r){let o=t[s];if(qo(o)&&ai(o)&&!ai(n))return!1;if(!i&&(!iu(n)&&!qo(n)&&(o=at(o),n=at(n)),!Ye(t)&&ai(o)&&!ai(n)))return o.value=n,!0;const a=Ye(t)&&qd(s)?Number(s)i,Zu=i=>Reflect.getPrototypeOf(i);function lc(i,e,t=!1,s=!1){i=i.__v_raw;const n=at(i),r=at(e);t||(e!==r&&is(n,"get",e),is(n,"get",r));const{has:o}=Zu(n),a=s?t1:t?n1:pl;if(o.call(n,e))return a(i.get(e));if(o.call(n,r))return a(i.get(r));i!==n&&i.get(e)}function cc(i,e=!1){const t=this.__v_raw,s=at(t),n=at(i);return e||(i!==n&&is(s,"has",i),is(s,"has",n)),i===n?t.has(i):t.has(i)||t.has(n)}function uc(i,e=!1){return i=i.__v_raw,!e&&is(at(i),"iterate",ro),Reflect.get(i,"size",i)}function Kp(i){i=at(i);const e=at(this);return Zu(e).has.call(e,i)||(e.add(i),jn(e,"add",i,i)),this}function Jp(i,e){e=at(e);const t=at(this),{has:s,get:n}=Zu(t);let r=s.call(t,i);r||(i=at(i),r=s.call(t,i));const o=n.call(t,i);return t.set(i,e),r?dl(e,o)&&jn(t,"set",i,e):jn(t,"add",i,e),this}function qp(i){const e=at(this),{has:t,get:s}=Zu(e);let n=t.call(e,i);n||(i=at(i),n=t.call(e,i)),s&&s.call(e,i);const r=e.delete(i);return n&&jn(e,"delete",i,void 0),r}function Zp(){const i=at(this),e=i.size!==0,t=i.clear();return e&&jn(i,"clear",void 0,void 0),t}function hc(i,e){return function(s,n){const r=this,o=r.__v_raw,a=at(o),l=e?t1:i?n1:pl;return!i&&is(a,"iterate",ro),o.forEach((u,h)=>s.call(n,l(u),l(h),r))}}function fc(i,e,t){return function(...s){const n=this.__v_raw,r=at(n),o=zo(r),a=i==="entries"||i===Symbol.iterator&&o,l=i==="keys"&&o,u=n[i](...s),h=t?t1:e?n1:pl;return!e&&is(r,"iterate",l?Vf:ro),{next(){const{value:c,done:f}=u.next();return f?{value:c,done:f}:{value:a?[h(c[0]),h(c[1])]:h(c),done:f}},[Symbol.iterator](){return this}}}}function rr(i){return function(...e){return i==="delete"?!1:this}}function Uv(){const i={get(r){return lc(this,r)},get size(){return uc(this)},has:cc,add:Kp,set:Jp,delete:qp,clear:Zp,forEach:hc(!1,!1)},e={get(r){return lc(this,r,!1,!0)},get size(){return uc(this)},has:cc,add:Kp,set:Jp,delete:qp,clear:Zp,forEach:hc(!1,!0)},t={get(r){return lc(this,r,!0)},get size(){return uc(this,!0)},has(r){return cc.call(this,r,!0)},add:rr("add"),set:rr("set"),delete:rr("delete"),clear:rr("clear"),forEach:hc(!0,!1)},s={get(r){return lc(this,r,!0,!0)},get size(){return uc(this,!0)},has(r){return cc.call(this,r,!0)},add:rr("add"),set:rr("set"),delete:rr("delete"),clear:rr("clear"),forEach:hc(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(r=>{i[r]=fc(r,!1,!1),t[r]=fc(r,!0,!1),e[r]=fc(r,!1,!0),s[r]=fc(r,!0,!0)}),[i,t,e,s]}const[zv,Wv,Yv,Qv]=Uv();function i1(i,e){const t=e?i?Qv:Yv:i?Wv:zv;return(s,n,r)=>n==="__v_isReactive"?!i:n==="__v_isReadonly"?i:n==="__v_raw"?s:Reflect.get(ut(t,n)&&n in s?t:s,n,r)}const Xv={get:i1(!1,!1)},jv={get:i1(!1,!0)},Kv={get:i1(!0,!1)},u0=new WeakMap,h0=new WeakMap,f0=new WeakMap,Jv=new WeakMap;function qv(i){switch(i){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Zv(i){return i.__v_skip||!Object.isExtensible(i)?0:qv(bv(i))}function Ht(i){return qo(i)?i:s1(i,!1,c0,Xv,u0)}function $v(i){return s1(i,!1,Hv,jv,h0)}function d0(i){return s1(i,!0,Gv,Kv,f0)}function s1(i,e,t,s,n){if(!Gt(i)||i.__v_raw&&!(e&&i.__v_isReactive))return i;const r=n.get(i);if(r)return r;const o=Zv(i);if(o===0)return i;const a=new Proxy(i,o===2?s:t);return n.set(i,a),a}function Wo(i){return qo(i)?Wo(i.__v_raw):!!(i&&i.__v_isReactive)}function qo(i){return!!(i&&i.__v_isReadonly)}function iu(i){return!!(i&&i.__v_isShallow)}function p0(i){return Wo(i)||qo(i)}function at(i){const e=i&&i.__v_raw;return e?at(e):i}function g0(i){return eu(i,"__v_skip",!0),i}const pl=i=>Gt(i)?Ht(i):i,n1=i=>Gt(i)?d0(i):i;function m0(i){wr&&Us&&(i=at(i),o0(i.dep||(i.dep=Zd())))}function b0(i,e){i=at(i);const t=i.dep;t&&Gf(t)}function ai(i){return!!(i&&i.__v_isRef===!0)}function dt(i){return y0(i,!1)}function e5(i){return y0(i,!0)}function y0(i,e){return ai(i)?i:new t5(i,e)}class t5{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:at(e),this._value=t?e:pl(e)}get value(){return m0(this),this._value}set value(e){const t=this.__v_isShallow||iu(e)||qo(e);e=t?e:at(e),dl(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:pl(e),b0(this))}}function ls(i){return ai(i)?i.value:i}const i5={get:(i,e,t)=>ls(Reflect.get(i,e,t)),set:(i,e,t,s)=>{const n=i[e];return ai(n)&&!ai(t)?(n.value=t,!0):Reflect.set(i,e,t,s)}};function v0(i){return Wo(i)?i:new Proxy(i,i5)}function AI(i){const e=Ye(i)?new Array(i.length):{};for(const t in i)e[t]=n5(i,t);return e}class s5{constructor(e,t,s){this._object=e,this._key=t,this._defaultValue=s,this.__v_isRef=!0}get value(){const e=this._object[this._key];return e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return Cv(at(this._object),this._key)}}function n5(i,e,t){const s=i[e];return ai(s)?s:new s5(i,e,t)}var S0;class r5{constructor(e,t,s,n){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this[S0]=!1,this._dirty=!0,this.effect=new $d(e,()=>{this._dirty||(this._dirty=!0,b0(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!n,this.__v_isReadonly=s}get value(){const e=at(this);return m0(e),(e._dirty||!e._cacheable)&&(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}S0="__v_isReadonly";function o5(i,e,t=!1){let s,n;const r=Je(i);return r?(s=i,n=Xs):(s=i.get,n=i.set),new r5(s,n,r||!n,t)}function Er(i,e,t,s){let n;try{n=s?i(...s):i()}catch(r){$u(r,e,t)}return n}function Es(i,e,t,s){if(Je(i)){const r=Er(i,e,t,s);return r&&e0(r)&&r.catch(o=>{$u(o,e,t)}),r}const n=[];for(let r=0;r>>1;ml(Ti[s])dn&&Ti.splice(e,1)}function u5(i){Ye(i)?Yo.push(...i):(!Dn||!Dn.includes(i,i.allowRecurse?Jr+1:Jr))&&Yo.push(i),x0()}function $p(i,e=gl?dn+1:0){for(;eml(t)-ml(s)),Jr=0;Jri.id==null?1/0:i.id,h5=(i,e)=>{const t=ml(i)-ml(e);if(t===0){if(i.pre&&!e.pre)return-1;if(e.pre&&!i.pre)return 1}return t};function E0(i){Hf=!1,gl=!0,Ti.sort(h5);const e=Xs;try{for(dn=0;dnKt(d)?d.trim():d)),c&&(n=t.map(Sv))}let a,l=s[a=Hh(e)]||s[a=Hh(bn(e))];!l&&r&&(l=s[a=Hh(yo(e))]),l&&Es(l,i,6,n);const u=s[a+"Once"];if(u){if(!i.emitted)i.emitted={};else if(i.emitted[a])return;i.emitted[a]=!0,Es(u,i,6,n)}}function P0(i,e,t=!1){const s=e.emitsCache,n=s.get(i);if(n!==void 0)return n;const r=i.emits;let o={},a=!1;if(!Je(i)){const l=u=>{const h=P0(u,e,!0);h&&(a=!0,mi(o,h))};!t&&e.mixins.length&&e.mixins.forEach(l),i.extends&&l(i.extends),i.mixins&&i.mixins.forEach(l)}return!r&&!a?(Gt(i)&&s.set(i,null),null):(Ye(r)?r.forEach(l=>o[l]=null):mi(o,r),Gt(i)&&s.set(i,o),o)}function eh(i,e){return!i||!ju(e)?!1:(e=e.slice(2).replace(/Once$/,""),ut(i,e[0].toLowerCase()+e.slice(1))||ut(i,yo(e))||ut(i,e))}let Ei=null,th=null;function su(i){const e=Ei;return Ei=i,th=i&&i.type.__scopeId||null,e}function d5(i){th=i}function p5(){th=null}function Oc(i,e=Ei,t){if(!e||i._n)return i;const s=(...n)=>{s._d&&hg(-1);const r=su(e);let o;try{o=i(...n)}finally{su(r),s._d&&hg(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function zh(i){const{type:e,vnode:t,proxy:s,withProxy:n,props:r,propsOptions:[o],slots:a,attrs:l,emit:u,render:h,renderCache:c,data:f,setupState:d,ctx:p,inheritAttrs:g}=i;let m,b;const y=su(i);try{if(t.shapeFlag&4){const S=n||s;m=un(h.call(S,S,c,r,d,f,p)),b=l}else{const S=e;m=un(S.length>1?S(r,{attrs:l,slots:a,emit:u}):S(r,null)),b=e.props?l:g5(l)}}catch(S){el.length=0,$u(S,i,1),m=ee(Ps)}let v=m;if(b&&g!==!1){const S=Object.keys(b),{shapeFlag:A}=v;S.length&&A&7&&(o&&S.some(jd)&&(b=m5(b,o)),v=Cr(v,b))}return t.dirs&&(v=Cr(v),v.dirs=v.dirs?v.dirs.concat(t.dirs):t.dirs),t.transition&&(v.transition=t.transition),m=v,su(y),m}const g5=i=>{let e;for(const t in i)(t==="class"||t==="style"||ju(t))&&((e||(e={}))[t]=i[t]);return e},m5=(i,e)=>{const t={};for(const s in i)(!jd(s)||!(s.slice(9)in e))&&(t[s]=i[s]);return t};function b5(i,e,t){const{props:s,children:n,component:r}=i,{props:o,children:a,patchFlag:l}=e,u=r.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&l>=0){if(l&1024)return!0;if(l&16)return s?eg(s,o,u):!!o;if(l&8){const h=e.dynamicProps;for(let c=0;ci.__isSuspense;function S5(i,e){e&&e.pendingBranch?Ye(i)?e.effects.push(...i):e.effects.push(i):u5(i)}function oo(i,e){if(Jt){let t=Jt.provides;const s=Jt.parent&&Jt.parent.provides;s===t&&(t=Jt.provides=Object.create(s)),t[i]=e}}function Xi(i,e,t=!1){const s=Jt||Ei;if(s){const n=s.parent==null?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides;if(n&&i in n)return n[i];if(arguments.length>1)return t&&Je(e)?e.call(s.proxy):e}}function A5(i,e){return a1(i,null,e)}const dc={};function Vt(i,e,t){return a1(i,e,t)}function a1(i,e,{immediate:t,deep:s,flush:n,onTrack:r,onTrigger:o}=Ot){const a=Pv()===(Jt==null?void 0:Jt.scope)?Jt:null;let l,u=!1,h=!1;if(ai(i)?(l=()=>i.value,u=iu(i)):Wo(i)?(l=()=>i,s=!0):Ye(i)?(h=!0,u=i.some(v=>Wo(v)||iu(v)),l=()=>i.map(v=>{if(ai(v))return v.value;if(Wo(v))return io(v);if(Je(v))return Er(v,a,2)})):Je(i)?e?l=()=>Er(i,a,2):l=()=>{if(!(a&&a.isUnmounted))return c&&c(),Es(i,a,3,[f])}:l=Xs,e&&s){const v=l;l=()=>io(v())}let c,f=v=>{c=b.onStop=()=>{Er(v,a,4)}},d;if(Sl)if(f=Xs,e?t&&Es(e,a,3,[l(),h?[]:void 0,f]):l(),n==="sync"){const v=uS();d=v.__watcherHandles||(v.__watcherHandles=[])}else return Xs;let p=h?new Array(i.length).fill(dc):dc;const g=()=>{if(b.active)if(e){const v=b.run();(s||u||(h?v.some((S,A)=>dl(S,p[A])):dl(v,p)))&&(c&&c(),Es(e,a,3,[v,p===dc?void 0:h&&p[0]===dc?[]:p,f]),p=v)}else b.run()};g.allowRecurse=!!e;let m;n==="sync"?m=g:n==="post"?m=()=>$i(g,a&&a.suspense):(g.pre=!0,a&&(g.id=a.uid),m=()=>o1(g));const b=new $d(l,m);e?t?g():p=b.run():n==="post"?$i(b.run.bind(b),a&&a.suspense):b.run();const y=()=>{b.stop(),a&&a.scope&&Kd(a.scope.effects,b)};return d&&d.push(y),y}function x5(i,e,t){const s=this.proxy,n=Kt(i)?i.includes(".")?_0(s,i):()=>s[i]:i.bind(s,s);let r;Je(e)?r=e:(r=e.handler,t=e);const o=Jt;ta(this);const a=a1(n,r.bind(s),t);return o?ta(o):ao(),a}function _0(i,e){const t=e.split(".");return()=>{let s=i;for(let n=0;n{io(t,e)});else if(i0(i))for(const t in i)io(i[t],e);return i}function M0(){const i={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Cs(()=>{i.isMounted=!0}),ba(()=>{i.isUnmounting=!0}),i}const ds=[Function,Array],w5={name:"BaseTransition",props:{mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ds,onEnter:ds,onAfterEnter:ds,onEnterCancelled:ds,onBeforeLeave:ds,onLeave:ds,onAfterLeave:ds,onLeaveCancelled:ds,onBeforeAppear:ds,onAppear:ds,onAfterAppear:ds,onAppearCancelled:ds},setup(i,{slots:e}){const t=Js(),s=M0();let n;return()=>{const r=e.default&&l1(e.default(),!0);if(!r||!r.length)return;let o=r[0];if(r.length>1){for(const g of r)if(g.type!==Ps){o=g;break}}const a=at(i),{mode:l}=a;if(s.isLeaving)return Wh(o);const u=tg(o);if(!u)return Wh(o);const h=bl(u,a,s,t);yl(u,h);const c=t.subTree,f=c&&tg(c);let d=!1;const{getTransitionKey:p}=u.type;if(p){const g=p();n===void 0?n=g:g!==n&&(n=g,d=!0)}if(f&&f.type!==Ps&&(!qr(u,f)||d)){const g=bl(f,a,s,t);if(yl(f,g),l==="out-in")return s.isLeaving=!0,g.afterLeave=()=>{s.isLeaving=!1,t.update.active!==!1&&t.update()},Wh(o);l==="in-out"&&u.type!==Ps&&(g.delayLeave=(m,b,y)=>{const v=T0(s,f);v[String(f.key)]=f,m._leaveCb=()=>{b(),m._leaveCb=void 0,delete h.delayedLeave},h.delayedLeave=y})}return o}}},C0=w5;function T0(i,e){const{leavingVNodes:t}=i;let s=t.get(e.type);return s||(s=Object.create(null),t.set(e.type,s)),s}function bl(i,e,t,s){const{appear:n,mode:r,persisted:o=!1,onBeforeEnter:a,onEnter:l,onAfterEnter:u,onEnterCancelled:h,onBeforeLeave:c,onLeave:f,onAfterLeave:d,onLeaveCancelled:p,onBeforeAppear:g,onAppear:m,onAfterAppear:b,onAppearCancelled:y}=e,v=String(i.key),S=T0(t,i),A=(M,_)=>{M&&Es(M,s,9,_)},P=(M,_)=>{const T=_[1];A(M,_),Ye(M)?M.every(D=>D.length<=1)&&T():M.length<=1&&T()},x={mode:r,persisted:o,beforeEnter(M){let _=a;if(!t.isMounted)if(n)_=g||a;else return;M._leaveCb&&M._leaveCb(!0);const T=S[v];T&&qr(i,T)&&T.el._leaveCb&&T.el._leaveCb(),A(_,[M])},enter(M){let _=l,T=u,D=h;if(!t.isMounted)if(n)_=m||l,T=b||u,D=y||h;else return;let C=!1;const L=M._enterCb=E=>{C||(C=!0,E?A(D,[M]):A(T,[M]),x.delayedLeave&&x.delayedLeave(),M._enterCb=void 0)};_?P(_,[M,L]):L()},leave(M,_){const T=String(i.key);if(M._enterCb&&M._enterCb(!0),t.isUnmounting)return _();A(c,[M]);let D=!1;const C=M._leaveCb=L=>{D||(D=!0,_(),L?A(p,[M]):A(d,[M]),M._leaveCb=void 0,S[T]===i&&delete S[T])};S[T]=i,f?P(f,[M,C]):C()},clone(M){return bl(M,e,t,s)}};return x}function Wh(i){if(ih(i))return i=Cr(i),i.children=null,i}function tg(i){return ih(i)?i.children?i.children[0]:void 0:i}function yl(i,e){i.shapeFlag&6&&i.component?yl(i.component.subTree,e):i.shapeFlag&128?(i.ssContent.transition=e.clone(i.ssContent),i.ssFallback.transition=e.clone(i.ssFallback)):i.transition=e}function l1(i,e=!1,t){let s=[],n=0;for(let r=0;r1)for(let r=0;r!!i.type.__asyncLoader,ih=i=>i.type.__isKeepAlive;function vo(i,e){L0(i,"a",e)}function Rr(i,e){L0(i,"da",e)}function L0(i,e,t=Jt){const s=i.__wdc||(i.__wdc=()=>{let n=t;for(;n;){if(n.isDeactivated)return;n=n.parent}return i()});if(sh(e,s,t),t){let n=t.parent;for(;n&&n.parent;)ih(n.parent.vnode)&&E5(s,e,t,n),n=n.parent}}function E5(i,e,t,s){const n=sh(e,i,s,!0);Nr(()=>{Kd(s[e],n)},t)}function sh(i,e,t=Jt,s=!1){if(t){const n=t[i]||(t[i]=[]),r=e.__weh||(e.__weh=(...o)=>{if(t.isUnmounted)return;ga(),ta(t);const a=Es(e,t,i,o);return ao(),ma(),a});return s?n.unshift(r):n.push(r),r}}const $n=i=>(e,t=Jt)=>(!Sl||i==="sp")&&sh(i,(...s)=>e(...s),t),c1=$n("bm"),Cs=$n("m"),P5=$n("bu"),B0=$n("u"),ba=$n("bum"),Nr=$n("um"),_5=$n("sp"),M5=$n("rtg"),C5=$n("rtc");function T5(i,e=Jt){sh("ec",i,e)}function nh(i,e){const t=Ei;if(t===null)return i;const s=ah(t)||t.proxy,n=i.dirs||(i.dirs=[]);for(let r=0;re(o,a,void 0,r&&r[a]));else{const o=Object.keys(i);n=new Array(o.length);for(let a=0,l=o.length;aea(e)?!(e.type===Ps||e.type===oi&&!R0(e.children)):!0)?i:null}const zf=i=>i?Y0(i)?ah(i)||i.proxy:zf(i.parent):null,Za=mi(Object.create(null),{$:i=>i,$el:i=>i.vnode.el,$data:i=>i.data,$props:i=>i.props,$attrs:i=>i.attrs,$slots:i=>i.slots,$refs:i=>i.refs,$parent:i=>zf(i.parent),$root:i=>zf(i.root),$emit:i=>i.emit,$options:i=>f1(i),$forceUpdate:i=>i.f||(i.f=()=>o1(i.update)),$nextTick:i=>i.n||(i.n=yn.bind(i.proxy)),$watch:i=>x5.bind(i)}),Yh=(i,e)=>i!==Ot&&!i.__isScriptSetup&&ut(i,e),I5={get({_:i},e){const{ctx:t,setupState:s,data:n,props:r,accessCache:o,type:a,appContext:l}=i;let u;if(e[0]!=="$"){const d=o[e];if(d!==void 0)switch(d){case 1:return s[e];case 2:return n[e];case 4:return t[e];case 3:return r[e]}else{if(Yh(s,e))return o[e]=1,s[e];if(n!==Ot&&ut(n,e))return o[e]=2,n[e];if((u=i.propsOptions[0])&&ut(u,e))return o[e]=3,r[e];if(t!==Ot&&ut(t,e))return o[e]=4,t[e];Wf&&(o[e]=0)}}const h=Za[e];let c,f;if(h)return e==="$attrs"&&is(i,"get",e),h(i);if((c=a.__cssModules)&&(c=c[e]))return c;if(t!==Ot&&ut(t,e))return o[e]=4,t[e];if(f=l.config.globalProperties,ut(f,e))return f[e]},set({_:i},e,t){const{data:s,setupState:n,ctx:r}=i;return Yh(n,e)?(n[e]=t,!0):s!==Ot&&ut(s,e)?(s[e]=t,!0):ut(i.props,e)||e[0]==="$"&&e.slice(1)in i?!1:(r[e]=t,!0)},has({_:{data:i,setupState:e,accessCache:t,ctx:s,appContext:n,propsOptions:r}},o){let a;return!!t[o]||i!==Ot&&ut(i,o)||Yh(e,o)||(a=r[0])&&ut(a,o)||ut(s,o)||ut(Za,o)||ut(n.config.globalProperties,o)},defineProperty(i,e,t){return t.get!=null?i._.accessCache[e]=0:ut(t,"value")&&this.set(i,e,t.value,null),Reflect.defineProperty(i,e,t)}};let Wf=!0;function R5(i){const e=f1(i),t=i.proxy,s=i.ctx;Wf=!1,e.beforeCreate&&ng(e.beforeCreate,i,"bc");const{data:n,computed:r,methods:o,watch:a,provide:l,inject:u,created:h,beforeMount:c,mounted:f,beforeUpdate:d,updated:p,activated:g,deactivated:m,beforeDestroy:b,beforeUnmount:y,destroyed:v,unmounted:S,render:A,renderTracked:P,renderTriggered:x,errorCaptured:M,serverPrefetch:_,expose:T,inheritAttrs:D,components:C,directives:L,filters:E}=e;if(u&&N5(u,s,null,i.appContext.config.unwrapInjectedRef),o)for(const H in o){const Z=o[H];Je(Z)&&(s[H]=Z.bind(t))}if(n){const H=n.call(t,t);Gt(H)&&(i.data=Ht(H))}if(Wf=!0,r)for(const H in r){const Z=r[H],J=Je(Z)?Z.bind(t,t):Je(Z.get)?Z.get.bind(t,t):Xs,le=!Je(Z)&&Je(Z.set)?Z.set.bind(t):Xs,X=Ft({get:J,set:le});Object.defineProperty(s,H,{enumerable:!0,configurable:!0,get:()=>X.value,set:O=>X.value=O})}if(a)for(const H in a)N0(a[H],s,t,H);if(l){const H=Je(l)?l.call(t):l;Reflect.ownKeys(H).forEach(Z=>{oo(Z,H[Z])})}h&&ng(h,i,"c");function Q(H,Z){Ye(Z)?Z.forEach(J=>H(J.bind(t))):Z&&H(Z.bind(t))}if(Q(c1,c),Q(Cs,f),Q(P5,d),Q(B0,p),Q(vo,g),Q(Rr,m),Q(T5,M),Q(C5,P),Q(M5,x),Q(ba,y),Q(Nr,S),Q(_5,_),Ye(T))if(T.length){const H=i.exposed||(i.exposed={});T.forEach(Z=>{Object.defineProperty(H,Z,{get:()=>t[Z],set:J=>t[Z]=J})})}else i.exposed||(i.exposed={});A&&i.render===Xs&&(i.render=A),D!=null&&(i.inheritAttrs=D),C&&(i.components=C),L&&(i.directives=L)}function N5(i,e,t=Xs,s=!1){Ye(i)&&(i=Yf(i));for(const n in i){const r=i[n];let o;Gt(r)?"default"in r?o=Xi(r.from||n,r.default,!0):o=Xi(r.from||n):o=Xi(r),ai(o)&&s?Object.defineProperty(e,n,{enumerable:!0,configurable:!0,get:()=>o.value,set:a=>o.value=a}):e[n]=o}}function ng(i,e,t){Es(Ye(i)?i.map(s=>s.bind(e.proxy)):i.bind(e.proxy),e,t)}function N0(i,e,t,s){const n=s.includes(".")?_0(t,s):()=>t[s];if(Kt(i)){const r=e[i];Je(r)&&Vt(n,r)}else if(Je(i))Vt(n,i.bind(t));else if(Gt(i))if(Ye(i))i.forEach(r=>N0(r,e,t,s));else{const r=Je(i.handler)?i.handler.bind(t):e[i.handler];Je(r)&&Vt(n,r,i)}}function f1(i){const e=i.type,{mixins:t,extends:s}=e,{mixins:n,optionsCache:r,config:{optionMergeStrategies:o}}=i.appContext,a=r.get(e);let l;return a?l=a:!n.length&&!t&&!s?l=e:(l={},n.length&&n.forEach(u=>nu(l,u,o,!0)),nu(l,e,o)),Gt(e)&&r.set(e,l),l}function nu(i,e,t,s=!1){const{mixins:n,extends:r}=e;r&&nu(i,r,t,!0),n&&n.forEach(o=>nu(i,o,t,!0));for(const o in e)if(!(s&&o==="expose")){const a=k5[o]||t&&t[o];i[o]=a?a(i[o],e[o]):e[o]}return i}const k5={data:rg,props:Qr,emits:Qr,methods:Qr,computed:Qr,beforeCreate:Gi,created:Gi,beforeMount:Gi,mounted:Gi,beforeUpdate:Gi,updated:Gi,beforeDestroy:Gi,beforeUnmount:Gi,destroyed:Gi,unmounted:Gi,activated:Gi,deactivated:Gi,errorCaptured:Gi,serverPrefetch:Gi,components:Qr,directives:Qr,watch:O5,provide:rg,inject:D5};function rg(i,e){return e?i?function(){return mi(Je(i)?i.call(this,this):i,Je(e)?e.call(this,this):e)}:e:i}function D5(i,e){return Qr(Yf(i),Yf(e))}function Yf(i){if(Ye(i)){const e={};for(let t=0;t0)&&!(o&16)){if(o&8){const h=i.vnode.dynamicProps;for(let c=0;c{l=!0;const[f,d]=D0(c,e,!0);mi(o,f),d&&a.push(...d)};!t&&e.mixins.length&&e.mixins.forEach(h),i.extends&&h(i.extends),i.mixins&&i.mixins.forEach(h)}if(!r&&!l)return Gt(i)&&s.set(i,Uo),Uo;if(Ye(r))for(let h=0;h-1,d[1]=g<0||p-1||ut(d,"default"))&&a.push(c)}}}const u=[o,a];return Gt(i)&&s.set(i,u),u}function og(i){return i[0]!=="$"}function ag(i){const e=i&&i.toString().match(/^\s*(function|class) (\w+)/);return e?e[2]:i===null?"null":""}function lg(i,e){return ag(i)===ag(e)}function cg(i,e){return Ye(e)?e.findIndex(t=>lg(t,i)):Je(e)&&lg(e,i)?0:-1}const O0=i=>i[0]==="_"||i==="$stable",d1=i=>Ye(i)?i.map(un):[un(i)],G5=(i,e,t)=>{if(e._n)return e;const s=Oc((...n)=>d1(e(...n)),t);return s._c=!1,s},F0=(i,e,t)=>{const s=i._ctx;for(const n in i){if(O0(n))continue;const r=i[n];if(Je(r))e[n]=G5(n,r,s);else if(r!=null){const o=d1(r);e[n]=()=>o}}},V0=(i,e)=>{const t=d1(e);i.slots.default=()=>t},H5=(i,e)=>{if(i.vnode.shapeFlag&32){const t=e._;t?(i.slots=at(e),eu(e,"_",t)):F0(e,i.slots={})}else i.slots={},e&&V0(i,e);eu(i.slots,oh,1)},U5=(i,e,t)=>{const{vnode:s,slots:n}=i;let r=!0,o=Ot;if(s.shapeFlag&32){const a=e._;a?t&&a===1?r=!1:(mi(n,e),!t&&a===1&&delete n._):(r=!e.$stable,F0(e,n)),o=e}else e&&(V0(i,e),o={default:1});if(r)for(const a in n)!O0(a)&&!(a in o)&&delete n[a]};function G0(){return{app:null,config:{isNativeTag:pv,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let z5=0;function W5(i,e){return function(s,n=null){Je(s)||(s=Object.assign({},s)),n!=null&&!Gt(n)&&(n=null);const r=G0(),o=new Set;let a=!1;const l=r.app={_uid:z5++,_component:s,_props:n,_container:null,_context:r,_instance:null,version:hS,get config(){return r.config},set config(u){},use(u,...h){return o.has(u)||(u&&Je(u.install)?(o.add(u),u.install(l,...h)):Je(u)&&(o.add(u),u(l,...h))),l},mixin(u){return r.mixins.includes(u)||r.mixins.push(u),l},component(u,h){return h?(r.components[u]=h,l):r.components[u]},directive(u,h){return h?(r.directives[u]=h,l):r.directives[u]},mount(u,h,c){if(!a){const f=ee(s,n);return f.appContext=r,h&&e?e(f,u):i(f,u,c),a=!0,l._container=u,u.__vue_app__=l,ah(f.component)||f.component.proxy}},unmount(){a&&(i(null,l._container),delete l._container.__vue_app__)},provide(u,h){return r.provides[u]=h,l}};return l}}function Xf(i,e,t,s,n=!1){if(Ye(i)){i.forEach((f,d)=>Xf(f,e&&(Ye(e)?e[d]:e),t,s,n));return}if(qa(s)&&!n)return;const r=s.shapeFlag&4?ah(s.component)||s.component.proxy:s.el,o=n?null:r,{i:a,r:l}=i,u=e&&e.r,h=a.refs===Ot?a.refs={}:a.refs,c=a.setupState;if(u!=null&&u!==l&&(Kt(u)?(h[u]=null,ut(c,u)&&(c[u]=null)):ai(u)&&(u.value=null)),Je(l))Er(l,a,12,[o,h]);else{const f=Kt(l),d=ai(l);if(f||d){const p=()=>{if(i.f){const g=f?ut(c,l)?c[l]:h[l]:l.value;n?Ye(g)&&Kd(g,r):Ye(g)?g.includes(r)||g.push(r):f?(h[l]=[r],ut(c,l)&&(c[l]=h[l])):(l.value=[r],i.k&&(h[i.k]=l.value))}else f?(h[l]=o,ut(c,l)&&(c[l]=o)):d&&(l.value=o,i.k&&(h[i.k]=o))};o?(p.id=-1,$i(p,t)):p()}}}const $i=S5;function Y5(i){return Q5(i)}function Q5(i,e){const t=xv();t.__VUE__=!0;const{insert:s,remove:n,patchProp:r,createElement:o,createText:a,createComment:l,setText:u,setElementText:h,parentNode:c,nextSibling:f,setScopeId:d=Xs,insertStaticContent:p}=i,g=(V,z,w,U=null,G=null,R=null,N=!1,F=null,q=!!z.dynamicChildren)=>{if(V===z)return;V&&!qr(V,z)&&(U=he(V),O(V,G,R,!0),V=null),z.patchFlag===-2&&(q=!1,z.dynamicChildren=null);const{type:j,ref:K,shapeFlag:ae}=z;switch(j){case rh:m(V,z,w,U);break;case Ps:b(V,z,w,U);break;case Qh:V==null&&y(z,w,U,N);break;case oi:C(V,z,w,U,G,R,N,F,q);break;default:ae&1?A(V,z,w,U,G,R,N,F,q):ae&6?L(V,z,w,U,G,R,N,F,q):(ae&64||ae&128)&&j.process(V,z,w,U,G,R,N,F,q,be)}K!=null&&G&&Xf(K,V&&V.ref,R,z||V,!z)},m=(V,z,w,U)=>{if(V==null)s(z.el=a(z.children),w,U);else{const G=z.el=V.el;z.children!==V.children&&u(G,z.children)}},b=(V,z,w,U)=>{V==null?s(z.el=l(z.children||""),w,U):z.el=V.el},y=(V,z,w,U)=>{[V.el,V.anchor]=p(V.children,z,w,U,V.el,V.anchor)},v=({el:V,anchor:z},w,U)=>{let G;for(;V&&V!==z;)G=f(V),s(V,w,U),V=G;s(z,w,U)},S=({el:V,anchor:z})=>{let w;for(;V&&V!==z;)w=f(V),n(V),V=w;n(z)},A=(V,z,w,U,G,R,N,F,q)=>{N=N||z.type==="svg",V==null?P(z,w,U,G,R,N,F,q):_(V,z,G,R,N,F,q)},P=(V,z,w,U,G,R,N,F)=>{let q,j;const{type:K,props:ae,shapeFlag:$,transition:ne,dirs:ye}=V;if(q=V.el=o(V.type,R,ae&&ae.is,ae),$&8?h(q,V.children):$&16&&M(V.children,q,null,U,G,R&&K!=="foreignObject",N,F),ye&&Gr(V,null,U,"created"),x(q,V,V.scopeId,N,U),ae){for(const ce in ae)ce!=="value"&&!Dc(ce)&&r(q,ce,null,ae[ce],R,V.children,U,G,se);"value"in ae&&r(q,"value",null,ae.value),(j=ae.onVnodeBeforeMount)&&tn(j,U,V)}ye&&Gr(V,null,U,"beforeMount");const Te=(!G||G&&!G.pendingBranch)&&ne&&!ne.persisted;Te&&ne.beforeEnter(q),s(q,z,w),((j=ae&&ae.onVnodeMounted)||Te||ye)&&$i(()=>{j&&tn(j,U,V),Te&&ne.enter(q),ye&&Gr(V,null,U,"mounted")},G)},x=(V,z,w,U,G)=>{if(w&&d(V,w),U)for(let R=0;R{for(let j=q;j{const F=z.el=V.el;let{patchFlag:q,dynamicChildren:j,dirs:K}=z;q|=V.patchFlag&16;const ae=V.props||Ot,$=z.props||Ot;let ne;w&&Hr(w,!1),(ne=$.onVnodeBeforeUpdate)&&tn(ne,w,z,V),K&&Gr(z,V,w,"beforeUpdate"),w&&Hr(w,!0);const ye=G&&z.type!=="foreignObject";if(j?T(V.dynamicChildren,j,F,w,U,ye,R):N||Z(V,z,F,null,w,U,ye,R,!1),q>0){if(q&16)D(F,z,ae,$,w,U,G);else if(q&2&&ae.class!==$.class&&r(F,"class",null,$.class,G),q&4&&r(F,"style",ae.style,$.style,G),q&8){const Te=z.dynamicProps;for(let ce=0;ce{ne&&tn(ne,w,z,V),K&&Gr(z,V,w,"updated")},U)},T=(V,z,w,U,G,R,N)=>{for(let F=0;F{if(w!==U){if(w!==Ot)for(const F in w)!Dc(F)&&!(F in U)&&r(V,F,w[F],null,N,z.children,G,R,se);for(const F in U){if(Dc(F))continue;const q=U[F],j=w[F];q!==j&&F!=="value"&&r(V,F,j,q,N,z.children,G,R,se)}"value"in U&&r(V,"value",w.value,U.value)}},C=(V,z,w,U,G,R,N,F,q)=>{const j=z.el=V?V.el:a(""),K=z.anchor=V?V.anchor:a("");let{patchFlag:ae,dynamicChildren:$,slotScopeIds:ne}=z;ne&&(F=F?F.concat(ne):ne),V==null?(s(j,w,U),s(K,w,U),M(z.children,w,K,G,R,N,F,q)):ae>0&&ae&64&&$&&V.dynamicChildren?(T(V.dynamicChildren,$,w,G,R,N,F),(z.key!=null||G&&z===G.subTree)&&p1(V,z,!0)):Z(V,z,w,K,G,R,N,F,q)},L=(V,z,w,U,G,R,N,F,q)=>{z.slotScopeIds=F,V==null?z.shapeFlag&512?G.ctx.activate(z,w,U,N,q):E(z,w,U,G,R,N,q):k(V,z,q)},E=(V,z,w,U,G,R,N)=>{const F=V.component=iS(V,U,G);if(ih(V)&&(F.ctx.renderer=be),sS(F),F.asyncDep){if(G&&G.registerDep(F,Q),!V.el){const q=F.subTree=ee(Ps);b(null,q,z,w)}return}Q(F,V,z,w,G,R,N)},k=(V,z,w)=>{const U=z.component=V.component;if(b5(V,z,w))if(U.asyncDep&&!U.asyncResolved){H(U,z,w);return}else U.next=z,c5(U.update),U.update();else z.el=V.el,U.vnode=z},Q=(V,z,w,U,G,R,N)=>{const F=()=>{if(V.isMounted){let{next:K,bu:ae,u:$,parent:ne,vnode:ye}=V,Te=K,ce;Hr(V,!1),K?(K.el=ye.el,H(V,K,N)):K=ye,ae&&Uh(ae),(ce=K.props&&K.props.onVnodeBeforeUpdate)&&tn(ce,ne,K,ye),Hr(V,!0);const we=zh(V),Re=V.subTree;V.subTree=we,g(Re,we,c(Re.el),he(Re),V,G,R),K.el=we.el,Te===null&&y5(V,we.el),$&&$i($,G),(ce=K.props&&K.props.onVnodeUpdated)&&$i(()=>tn(ce,ne,K,ye),G)}else{let K;const{el:ae,props:$}=z,{bm:ne,m:ye,parent:Te}=V,ce=qa(z);if(Hr(V,!1),ne&&Uh(ne),!ce&&(K=$&&$.onVnodeBeforeMount)&&tn(K,Te,z),Hr(V,!0),ae&&ve){const we=()=>{V.subTree=zh(V),ve(ae,V.subTree,V,G,null)};ce?z.type.__asyncLoader().then(()=>!V.isUnmounted&&we()):we()}else{const we=V.subTree=zh(V);g(null,we,w,U,V,G,R),z.el=we.el}if(ye&&$i(ye,G),!ce&&(K=$&&$.onVnodeMounted)){const we=z;$i(()=>tn(K,Te,we),G)}(z.shapeFlag&256||Te&&qa(Te.vnode)&&Te.vnode.shapeFlag&256)&&V.a&&$i(V.a,G),V.isMounted=!0,z=w=U=null}},q=V.effect=new $d(F,()=>o1(j),V.scope),j=V.update=()=>q.run();j.id=V.uid,Hr(V,!0),j()},H=(V,z,w)=>{z.component=V;const U=V.vnode.props;V.vnode=z,V.next=null,V5(V,z.props,U,w),U5(V,z.children,w),ga(),$p(),ma()},Z=(V,z,w,U,G,R,N,F,q=!1)=>{const j=V&&V.children,K=V?V.shapeFlag:0,ae=z.children,{patchFlag:$,shapeFlag:ne}=z;if($>0){if($&128){le(j,ae,w,U,G,R,N,F,q);return}else if($&256){J(j,ae,w,U,G,R,N,F,q);return}}ne&8?(K&16&&se(j,G,R),ae!==j&&h(w,ae)):K&16?ne&16?le(j,ae,w,U,G,R,N,F,q):se(j,G,R,!0):(K&8&&h(w,""),ne&16&&M(ae,w,U,G,R,N,F,q))},J=(V,z,w,U,G,R,N,F,q)=>{V=V||Uo,z=z||Uo;const j=V.length,K=z.length,ae=Math.min(j,K);let $;for($=0;$K?se(V,G,R,!0,!1,ae):M(z,w,U,G,R,N,F,q,ae)},le=(V,z,w,U,G,R,N,F,q)=>{let j=0;const K=z.length;let ae=V.length-1,$=K-1;for(;j<=ae&&j<=$;){const ne=V[j],ye=z[j]=q?dr(z[j]):un(z[j]);if(qr(ne,ye))g(ne,ye,w,null,G,R,N,F,q);else break;j++}for(;j<=ae&&j<=$;){const ne=V[ae],ye=z[$]=q?dr(z[$]):un(z[$]);if(qr(ne,ye))g(ne,ye,w,null,G,R,N,F,q);else break;ae--,$--}if(j>ae){if(j<=$){const ne=$+1,ye=ne$)for(;j<=ae;)O(V[j],G,R,!0),j++;else{const ne=j,ye=j,Te=new Map;for(j=ye;j<=$;j++){const gt=z[j]=q?dr(z[j]):un(z[j]);gt.key!=null&&Te.set(gt.key,j)}let ce,we=0;const Re=$-ye+1;let He=!1,wt=0;const We=new Array(Re);for(j=0;j=Re){O(gt,G,R,!0);continue}let Rt;if(gt.key!=null)Rt=Te.get(gt.key);else for(ce=ye;ce<=$;ce++)if(We[ce-ye]===0&&qr(gt,z[ce])){Rt=ce;break}Rt===void 0?O(gt,G,R,!0):(We[Rt-ye]=j+1,Rt>=wt?wt=Rt:He=!0,g(gt,z[Rt],w,null,G,R,N,F,q),we++)}const _t=He?X5(We):Uo;for(ce=_t.length-1,j=Re-1;j>=0;j--){const gt=ye+j,Rt=z[gt],Is=gt+1{const{el:R,type:N,transition:F,children:q,shapeFlag:j}=V;if(j&6){X(V.component.subTree,z,w,U);return}if(j&128){V.suspense.move(z,w,U);return}if(j&64){N.move(V,z,w,be);return}if(N===oi){s(R,z,w);for(let ae=0;aeF.enter(R),G);else{const{leave:ae,delayLeave:$,afterLeave:ne}=F,ye=()=>s(R,z,w),Te=()=>{ae(R,()=>{ye(),ne&&ne()})};$?$(R,ye,Te):Te()}else s(R,z,w)},O=(V,z,w,U=!1,G=!1)=>{const{type:R,props:N,ref:F,children:q,dynamicChildren:j,shapeFlag:K,patchFlag:ae,dirs:$}=V;if(F!=null&&Xf(F,null,w,V,!0),K&256){z.ctx.deactivate(V);return}const ne=K&1&&$,ye=!qa(V);let Te;if(ye&&(Te=N&&N.onVnodeBeforeUnmount)&&tn(Te,z,V),K&6)W(V.component,w,U);else{if(K&128){V.suspense.unmount(w,U);return}ne&&Gr(V,null,z,"beforeUnmount"),K&64?V.type.remove(V,z,w,G,be,U):j&&(R!==oi||ae>0&&ae&64)?se(j,z,w,!1,!0):(R===oi&&ae&384||!G&&K&16)&&se(q,z,w),U&&fe(V)}(ye&&(Te=N&&N.onVnodeUnmounted)||ne)&&$i(()=>{Te&&tn(Te,z,V),ne&&Gr(V,null,z,"unmounted")},w)},fe=V=>{const{type:z,el:w,anchor:U,transition:G}=V;if(z===oi){de(w,U);return}if(z===Qh){S(V);return}const R=()=>{n(w),G&&!G.persisted&&G.afterLeave&&G.afterLeave()};if(V.shapeFlag&1&&G&&!G.persisted){const{leave:N,delayLeave:F}=G,q=()=>N(w,R);F?F(V.el,R,q):q()}else R()},de=(V,z)=>{let w;for(;V!==z;)w=f(V),n(V),V=w;n(z)},W=(V,z,w)=>{const{bum:U,scope:G,update:R,subTree:N,um:F}=V;U&&Uh(U),G.stop(),R&&(R.active=!1,O(N,V,z,w)),F&&$i(F,z),$i(()=>{V.isUnmounted=!0},z),z&&z.pendingBranch&&!z.isUnmounted&&V.asyncDep&&!V.asyncResolved&&V.suspenseId===z.pendingId&&(z.deps--,z.deps===0&&z.resolve())},se=(V,z,w,U=!1,G=!1,R=0)=>{for(let N=R;NV.shapeFlag&6?he(V.component.subTree):V.shapeFlag&128?V.suspense.next():f(V.anchor||V.el),oe=(V,z,w)=>{V==null?z._vnode&&O(z._vnode,null,null,!0):g(z._vnode||null,V,z,null,null,null,w),$p(),w0(),z._vnode=V},be={p:g,um:O,m:X,r:fe,mt:E,mc:M,pc:Z,pbc:T,n:he,o:i};let Me,ve;return e&&([Me,ve]=e(be)),{render:oe,hydrate:Me,createApp:W5(oe,Me)}}function Hr({effect:i,update:e},t){i.allowRecurse=e.allowRecurse=t}function p1(i,e,t=!1){const s=i.children,n=e.children;if(Ye(s)&&Ye(n))for(let r=0;r>1,i[t[a]]0&&(e[s]=t[r-1]),t[r]=s)}}for(r=t.length,o=t[r-1];r-- >0;)t[r]=o,o=e[o];return t}const j5=i=>i.__isTeleport,$a=i=>i&&(i.disabled||i.disabled===""),ug=i=>typeof SVGElement<"u"&&i instanceof SVGElement,jf=(i,e)=>{const t=i&&i.to;return Kt(t)?e?e(t):null:t},K5={__isTeleport:!0,process(i,e,t,s,n,r,o,a,l,u){const{mc:h,pc:c,pbc:f,o:{insert:d,querySelector:p,createText:g,createComment:m}}=u,b=$a(e.props);let{shapeFlag:y,children:v,dynamicChildren:S}=e;if(i==null){const A=e.el=g(""),P=e.anchor=g("");d(A,t,s),d(P,t,s);const x=e.target=jf(e.props,p),M=e.targetAnchor=g("");x&&(d(M,x),o=o||ug(x));const _=(T,D)=>{y&16&&h(v,T,D,n,r,o,a,l)};b?_(t,P):x&&_(x,M)}else{e.el=i.el;const A=e.anchor=i.anchor,P=e.target=i.target,x=e.targetAnchor=i.targetAnchor,M=$a(i.props),_=M?t:P,T=M?A:x;if(o=o||ug(P),S?(f(i.dynamicChildren,S,_,n,r,o,a),p1(i,e,!0)):l||c(i,e,_,T,n,r,o,a,!1),b)M||pc(e,t,A,u,1);else if((e.props&&e.props.to)!==(i.props&&i.props.to)){const D=e.target=jf(e.props,p);D&&pc(e,D,null,u,0)}else M&&pc(e,P,x,u,1)}U0(e)},remove(i,e,t,s,{um:n,o:{remove:r}},o){const{shapeFlag:a,children:l,anchor:u,targetAnchor:h,target:c,props:f}=i;if(c&&r(h),(o||!$a(f))&&(r(u),a&16))for(let d=0;d0?Ws||Uo:null,q5(),vl>0&&Ws&&Ws.push(i),i}function ps(i,e,t,s,n,r){return z0(Pr(i,e,t,s,n,r,!0))}function $o(i,e,t,s,n){return z0(ee(i,e,t,s,n,!0))}function ea(i){return i?i.__v_isVNode===!0:!1}function qr(i,e){return i.type===e.type&&i.key===e.key}const oh="__vInternal",W0=({key:i})=>i!=null?i:null,Fc=({ref:i,ref_key:e,ref_for:t})=>i!=null?Kt(i)||ai(i)||Je(i)?{i:Ei,r:i,k:e,f:!!t}:i:null;function Pr(i,e=null,t=null,s=0,n=null,r=i===oi?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:i,props:e,key:e&&W0(e),ref:e&&Fc(e),scopeId:th,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:s,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:Ei};return a?(g1(l,t),r&128&&i.normalize(l)):t&&(l.shapeFlag|=Kt(t)?8:16),vl>0&&!o&&Ws&&(l.patchFlag>0||r&6)&&l.patchFlag!==32&&Ws.push(l),l}const ee=Z5;function Z5(i,e=null,t=null,s=0,n=null,r=!1){if((!i||i===I0)&&(i=Ps),ea(i)){const a=Cr(i,e,!0);return t&&g1(a,t),vl>0&&!r&&Ws&&(a.shapeFlag&6?Ws[Ws.indexOf(i)]=a:Ws.push(a)),a.patchFlag|=-2,a}if(lS(i)&&(i=i.__vccOpts),e){e=$5(e);let{class:a,style:l}=e;a&&!Kt(a)&&(e.class=xi(a)),Gt(l)&&(p0(l)&&!Ye(l)&&(l=mi({},l)),e.style=Qn(l))}const o=Kt(i)?1:v5(i)?128:j5(i)?64:Gt(i)?4:Je(i)?2:0;return Pr(i,e,t,s,n,o,r,!0)}function $5(i){return i?p0(i)||oh in i?mi({},i):i:null}function Cr(i,e,t=!1){const{props:s,ref:n,patchFlag:r,children:o}=i,a=e?Kn(s||{},e):s;return{__v_isVNode:!0,__v_skip:!0,type:i.type,props:a,key:a&&W0(a),ref:e&&e.ref?t&&n?Ye(n)?n.concat(Fc(e)):[n,Fc(e)]:Fc(e):n,scopeId:i.scopeId,slotScopeIds:i.slotScopeIds,children:o,target:i.target,targetAnchor:i.targetAnchor,staticCount:i.staticCount,shapeFlag:i.shapeFlag,patchFlag:e&&i.type!==oi?r===-1?16:r|16:r,dynamicProps:i.dynamicProps,dynamicChildren:i.dynamicChildren,appContext:i.appContext,dirs:i.dirs,transition:i.transition,component:i.component,suspense:i.suspense,ssContent:i.ssContent&&Cr(i.ssContent),ssFallback:i.ssFallback&&Cr(i.ssFallback),el:i.el,anchor:i.anchor,ctx:i.ctx,ce:i.ce}}function ya(i=" ",e=0){return ee(rh,null,i,e)}function fr(i="",e=!1){return e?(fi(),$o(Ps,null,i)):ee(Ps,null,i)}function un(i){return i==null||typeof i=="boolean"?ee(Ps):Ye(i)?ee(oi,null,i.slice()):typeof i=="object"?dr(i):ee(rh,null,String(i))}function dr(i){return i.el===null&&i.patchFlag!==-1||i.memo?i:Cr(i)}function g1(i,e){let t=0;const{shapeFlag:s}=i;if(e==null)e=null;else if(Ye(e))t=16;else if(typeof e=="object")if(s&65){const n=e.default;n&&(n._c&&(n._d=!1),g1(i,n()),n._c&&(n._d=!0));return}else{t=32;const n=e._;!n&&!(oh in e)?e._ctx=Ei:n===3&&Ei&&(Ei.slots._===1?e._=1:(e._=2,i.patchFlag|=1024))}else Je(e)?(e={default:e,_ctx:Ei},t=32):(e=String(e),s&64?(t=16,e=[ya(e)]):t=8);i.children=e,i.shapeFlag|=t}function Kn(...i){const e={};for(let t=0;tJt||Ei,ta=i=>{Jt=i,i.scope.on()},ao=()=>{Jt&&Jt.scope.off(),Jt=null};function Y0(i){return i.vnode.shapeFlag&4}let Sl=!1;function sS(i,e=!1){Sl=e;const{props:t,children:s}=i.vnode,n=Y0(i);F5(i,t,n,e),H5(i,s);const r=n?nS(i,e):void 0;return Sl=!1,r}function nS(i,e){const t=i.type;i.accessCache=Object.create(null),i.proxy=g0(new Proxy(i.ctx,I5));const{setup:s}=t;if(s){const n=i.setupContext=s.length>1?oS(i):null;ta(i),ga();const r=Er(s,i,0,[i.props,n]);if(ma(),ao(),e0(r)){if(r.then(ao,ao),e)return r.then(o=>{fg(i,o,e)}).catch(o=>{$u(o,i,0)});i.asyncDep=r}else fg(i,r,e)}else Q0(i,e)}function fg(i,e,t){Je(e)?i.type.__ssrInlineRender?i.ssrRender=e:i.render=e:Gt(e)&&(i.setupState=v0(e)),Q0(i,t)}let dg;function Q0(i,e,t){const s=i.type;if(!i.render){if(!e&&dg&&!s.render){const n=s.template||f1(i).template;if(n){const{isCustomElement:r,compilerOptions:o}=i.appContext.config,{delimiters:a,compilerOptions:l}=s,u=mi(mi({isCustomElement:r,delimiters:a},o),l);s.render=dg(n,u)}}i.render=s.render||Xs}ta(i),ga(),R5(i),ma(),ao()}function rS(i){return new Proxy(i.attrs,{get(e,t){return is(i,"get","$attrs"),e[t]}})}function oS(i){const e=s=>{i.exposed=s||{}};let t;return{get attrs(){return t||(t=rS(i))},slots:i.slots,emit:i.emit,expose:e}}function ah(i){if(i.exposed)return i.exposeProxy||(i.exposeProxy=new Proxy(v0(g0(i.exposed)),{get(e,t){if(t in e)return e[t];if(t in Za)return Za[t](i)},has(e,t){return t in e||t in Za}}))}function aS(i,e=!0){return Je(i)?i.displayName||i.name:i.name||e&&i.__name}function lS(i){return Je(i)&&"__vccOpts"in i}const Ft=(i,e)=>o5(i,e,Sl);function lh(i,e,t){const s=arguments.length;return s===2?Gt(e)&&!Ye(e)?ea(e)?ee(i,null,[e]):ee(i,e):ee(i,null,e):(s>3?t=Array.prototype.slice.call(arguments,2):s===3&&ea(t)&&(t=[t]),ee(i,e,t))}const cS=Symbol(""),uS=()=>Xi(cS),hS="3.2.47",fS="http://www.w3.org/2000/svg",Zr=typeof document<"u"?document:null,pg=Zr&&Zr.createElement("template"),dS={insert:(i,e,t)=>{e.insertBefore(i,t||null)},remove:i=>{const e=i.parentNode;e&&e.removeChild(i)},createElement:(i,e,t,s)=>{const n=e?Zr.createElementNS(fS,i):Zr.createElement(i,t?{is:t}:void 0);return i==="select"&&s&&s.multiple!=null&&n.setAttribute("multiple",s.multiple),n},createText:i=>Zr.createTextNode(i),createComment:i=>Zr.createComment(i),setText:(i,e)=>{i.nodeValue=e},setElementText:(i,e)=>{i.textContent=e},parentNode:i=>i.parentNode,nextSibling:i=>i.nextSibling,querySelector:i=>Zr.querySelector(i),setScopeId(i,e){i.setAttribute(e,"")},insertStaticContent(i,e,t,s,n,r){const o=t?t.previousSibling:e.lastChild;if(n&&(n===r||n.nextSibling))for(;e.insertBefore(n.cloneNode(!0),t),!(n===r||!(n=n.nextSibling)););else{pg.innerHTML=s?`${i}`:i;const a=pg.content;if(s){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}};function pS(i,e,t){const s=i._vtc;s&&(e=(e?[e,...s]:[...s]).join(" ")),e==null?i.removeAttribute("class"):t?i.setAttribute("class",e):i.className=e}function gS(i,e,t){const s=i.style,n=Kt(t);if(t&&!n){if(e&&!Kt(e))for(const r in e)t[r]==null&&Kf(s,r,"");for(const r in t)Kf(s,r,t[r])}else{const r=s.display;n?e!==t&&(s.cssText=t):e&&i.removeAttribute("style"),"_vod"in i&&(s.display=r)}}const gg=/\s*!important$/;function Kf(i,e,t){if(Ye(t))t.forEach(s=>Kf(i,e,s));else if(t==null&&(t=""),e.startsWith("--"))i.setProperty(e,t);else{const s=mS(i,e);gg.test(t)?i.setProperty(yo(s),t.replace(gg,""),"important"):i[s]=t}}const mg=["Webkit","Moz","ms"],Xh={};function mS(i,e){const t=Xh[e];if(t)return t;let s=bn(e);if(s!=="filter"&&s in i)return Xh[e]=s;s=qu(s);for(let n=0;njh||(wS.then(()=>jh=0),jh=Date.now());function PS(i,e){const t=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=t.attached)return;Es(_S(s,t.value),e,5,[s])};return t.value=i,t.attached=ES(),t}function _S(i,e){if(Ye(e)){const t=i.stopImmediatePropagation;return i.stopImmediatePropagation=()=>{t.call(i),i._stopped=!0},e.map(s=>n=>!n._stopped&&s&&s(n))}else return e}const vg=/^on[a-z]/,MS=(i,e,t,s,n=!1,r,o,a,l)=>{e==="class"?pS(i,s,n):e==="style"?gS(i,t,s):ju(e)?jd(e)||AS(i,e,t,s,o):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):CS(i,e,s,n))?yS(i,e,s,r,o,a,l):(e==="true-value"?i._trueValue=s:e==="false-value"&&(i._falseValue=s),bS(i,e,s,n))};function CS(i,e,t,s){return s?!!(e==="innerHTML"||e==="textContent"||e in i&&vg.test(e)&&Je(t)):e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&i.tagName==="INPUT"||e==="type"&&i.tagName==="TEXTAREA"||vg.test(e)&&Kt(t)?!1:e in i}const or="transition",Ca="animation",va=(i,{slots:e})=>lh(C0,j0(i),e);va.displayName="Transition";const X0={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},TS=va.props=mi({},C0.props,X0),Ur=(i,e=[])=>{Ye(i)?i.forEach(t=>t(...e)):i&&i(...e)},Sg=i=>i?Ye(i)?i.some(e=>e.length>1):i.length>1:!1;function j0(i){const e={};for(const C in i)C in X0||(e[C]=i[C]);if(i.css===!1)return e;const{name:t="v",type:s,duration:n,enterFromClass:r=`${t}-enter-from`,enterActiveClass:o=`${t}-enter-active`,enterToClass:a=`${t}-enter-to`,appearFromClass:l=r,appearActiveClass:u=o,appearToClass:h=a,leaveFromClass:c=`${t}-leave-from`,leaveActiveClass:f=`${t}-leave-active`,leaveToClass:d=`${t}-leave-to`}=i,p=LS(n),g=p&&p[0],m=p&&p[1],{onBeforeEnter:b,onEnter:y,onEnterCancelled:v,onLeave:S,onLeaveCancelled:A,onBeforeAppear:P=b,onAppear:x=y,onAppearCancelled:M=v}=e,_=(C,L,E)=>{ur(C,L?h:a),ur(C,L?u:o),E&&E()},T=(C,L)=>{C._isLeaving=!1,ur(C,c),ur(C,d),ur(C,f),L&&L()},D=C=>(L,E)=>{const k=C?x:y,Q=()=>_(L,C,E);Ur(k,[L,Q]),Ag(()=>{ur(L,C?l:r),In(L,C?h:a),Sg(k)||xg(L,s,g,Q)})};return mi(e,{onBeforeEnter(C){Ur(b,[C]),In(C,r),In(C,o)},onBeforeAppear(C){Ur(P,[C]),In(C,l),In(C,u)},onEnter:D(!1),onAppear:D(!0),onLeave(C,L){C._isLeaving=!0;const E=()=>T(C,L);In(C,c),J0(),In(C,f),Ag(()=>{C._isLeaving&&(ur(C,c),In(C,d),Sg(S)||xg(C,s,m,E))}),Ur(S,[C,E])},onEnterCancelled(C){_(C,!1),Ur(v,[C])},onAppearCancelled(C){_(C,!0),Ur(M,[C])},onLeaveCancelled(C){T(C),Ur(A,[C])}})}function LS(i){if(i==null)return null;if(Gt(i))return[Kh(i.enter),Kh(i.leave)];{const e=Kh(i);return[e,e]}}function Kh(i){return Av(i)}function In(i,e){e.split(/\s+/).forEach(t=>t&&i.classList.add(t)),(i._vtc||(i._vtc=new Set)).add(e)}function ur(i,e){e.split(/\s+/).forEach(s=>s&&i.classList.remove(s));const{_vtc:t}=i;t&&(t.delete(e),t.size||(i._vtc=void 0))}function Ag(i){requestAnimationFrame(()=>{requestAnimationFrame(i)})}let BS=0;function xg(i,e,t,s){const n=i._endId=++BS,r=()=>{n===i._endId&&s()};if(t)return setTimeout(r,t);const{type:o,timeout:a,propCount:l}=K0(i,e);if(!o)return s();const u=o+"end";let h=0;const c=()=>{i.removeEventListener(u,f),r()},f=d=>{d.target===i&&++h>=l&&c()};setTimeout(()=>{h(t[p]||"").split(", "),n=s(`${or}Delay`),r=s(`${or}Duration`),o=wg(n,r),a=s(`${Ca}Delay`),l=s(`${Ca}Duration`),u=wg(a,l);let h=null,c=0,f=0;e===or?o>0&&(h=or,c=o,f=r.length):e===Ca?u>0&&(h=Ca,c=u,f=l.length):(c=Math.max(o,u),h=c>0?o>u?or:Ca:null,f=h?h===or?r.length:l.length:0);const d=h===or&&/\b(transform|all)(,|$)/.test(s(`${or}Property`).toString());return{type:h,timeout:c,propCount:f,hasTransform:d}}function wg(i,e){for(;i.lengthEg(t)+Eg(i[s])))}function Eg(i){return Number(i.slice(0,-1).replace(",","."))*1e3}function J0(){return document.body.offsetHeight}const q0=new WeakMap,Z0=new WeakMap,$0={name:"TransitionGroup",props:mi({},TS,{tag:String,moveClass:String}),setup(i,{slots:e}){const t=Js(),s=M0();let n,r;return B0(()=>{if(!n.length)return;const o=i.moveClass||`${i.name||"v"}-move`;if(!OS(n[0].el,t.vnode.el,o))return;n.forEach(NS),n.forEach(kS);const a=n.filter(DS);J0(),a.forEach(l=>{const u=l.el,h=u.style;In(u,o),h.transform=h.webkitTransform=h.transitionDuration="";const c=u._moveCb=f=>{f&&f.target!==u||(!f||/transform$/.test(f.propertyName))&&(u.removeEventListener("transitionend",c),u._moveCb=null,ur(u,o))};u.addEventListener("transitionend",c)})}),()=>{const o=at(i),a=j0(o);let l=o.tag||oi;n=r,r=e.default?l1(e.default()):[];for(let u=0;udelete i.mode;$0.props;const RS=$0;function NS(i){const e=i.el;e._moveCb&&e._moveCb(),e._enterCb&&e._enterCb()}function kS(i){Z0.set(i,i.el.getBoundingClientRect())}function DS(i){const e=q0.get(i),t=Z0.get(i),s=e.left-t.left,n=e.top-t.top;if(s||n){const r=i.el.style;return r.transform=r.webkitTransform=`translate(${s}px,${n}px)`,r.transitionDuration="0s",i}}function OS(i,e,t){const s=i.cloneNode();i._vtc&&i._vtc.forEach(o=>{o.split(/\s+/).forEach(a=>a&&s.classList.remove(a))}),t.split(/\s+/).forEach(o=>o&&s.classList.add(o)),s.style.display="none";const n=e.nodeType===1?e:e.parentNode;n.appendChild(s);const{hasTransform:r}=K0(s);return n.removeChild(s),r}const FS={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},wI=(i,e)=>t=>{if(!("key"in t))return;const s=yo(t.key);if(e.some(n=>n===s||FS[n]===s))return i(t)},ch={beforeMount(i,{value:e},{transition:t}){i._vod=i.style.display==="none"?"":i.style.display,t&&e?t.beforeEnter(i):Ta(i,e)},mounted(i,{value:e},{transition:t}){t&&e&&t.enter(i)},updated(i,{value:e,oldValue:t},{transition:s}){!e!=!t&&(s?e?(s.beforeEnter(i),Ta(i,!0),s.enter(i)):s.leave(i,()=>{Ta(i,!1)}):Ta(i,e))},beforeUnmount(i,{value:e}){Ta(i,e)}};function Ta(i,e){i.style.display=e?i._vod:"none"}const VS=mi({patchProp:MS},dS);let Pg;function GS(){return Pg||(Pg=Y5(VS))}const e3=(...i)=>{const e=GS().createApp(...i),{mount:t}=e;return e.mount=s=>{const n=HS(s);if(!n)return;const r=e._component;!Je(r)&&!r.render&&!r.template&&(r.template=n.innerHTML),n.innerHTML="";const o=t(n,!1,n instanceof SVGElement);return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),o},e};function HS(i){return Kt(i)?document.querySelector(i):i}/*! * vue-router v4.1.6 * (c) 2022 Eduardo San Martin Morote * @license MIT */const ko=typeof window<"u";function US(i){return i.__esModule||i[Symbol.toStringTag]==="Module"}const At=Object.assign;function Jh(i,e){const t={};for(const s in e){const n=e[s];t[s]=js(n)?n.map(i):i(n)}return t}const tl=()=>{},js=Array.isArray,zS=/\/$/,WS=i=>i.replace(zS,"");function qh(i,e,t="/"){let s,n={},r="",o="";const a=e.indexOf("#");let l=e.indexOf("?");return a=0&&(l=-1),l>-1&&(s=e.slice(0,l),r=e.slice(l+1,a>-1?a:e.length),n=i(r)),a>-1&&(s=s||e.slice(0,a),o=e.slice(a,e.length)),s=jS(s!=null?s:e,t),{fullPath:s+(r&&"?")+r+o,path:s,query:n,hash:o}}function YS(i,e){const t=e.query?i(e.query):"";return e.path+(t&&"?")+t+(e.hash||"")}function _g(i,e){return!e||!i.toLowerCase().startsWith(e.toLowerCase())?i:i.slice(e.length)||"/"}function QS(i,e,t){const s=e.matched.length-1,n=t.matched.length-1;return s>-1&&s===n&&ia(e.matched[s],t.matched[n])&&t3(e.params,t.params)&&i(e.query)===i(t.query)&&e.hash===t.hash}function ia(i,e){return(i.aliasOf||i)===(e.aliasOf||e)}function t3(i,e){if(Object.keys(i).length!==Object.keys(e).length)return!1;for(const t in i)if(!XS(i[t],e[t]))return!1;return!0}function XS(i,e){return js(i)?Mg(i,e):js(e)?Mg(e,i):i===e}function Mg(i,e){return js(e)?i.length===e.length&&i.every((t,s)=>t===e[s]):i.length===1&&i[0]===e}function jS(i,e){if(i.startsWith("/"))return i;if(!i)return e;const t=e.split("/"),s=i.split("/");let n=t.length-1,r,o;for(r=0;r1&&n--;else break;return t.slice(0,n).join("/")+"/"+s.slice(r-(r===s.length?1:0)).join("/")}var Al;(function(i){i.pop="pop",i.push="push"})(Al||(Al={}));var il;(function(i){i.back="back",i.forward="forward",i.unknown=""})(il||(il={}));function KS(i){if(!i)if(ko){const e=document.querySelector("base");i=e&&e.getAttribute("href")||"/",i=i.replace(/^\w+:\/\/[^\/]+/,"")}else i="/";return i[0]!=="/"&&i[0]!=="#"&&(i="/"+i),WS(i)}const JS=/^[^#]+#/;function qS(i,e){return i.replace(JS,"#")+e}function ZS(i,e){const t=document.documentElement.getBoundingClientRect(),s=i.getBoundingClientRect();return{behavior:e.behavior,left:s.left-t.left-(e.left||0),top:s.top-t.top-(e.top||0)}}const uh=()=>({left:window.pageXOffset,top:window.pageYOffset});function $S(i){let e;if("el"in i){const t=i.el,s=typeof t=="string"&&t.startsWith("#"),n=typeof t=="string"?s?document.getElementById(t.slice(1)):document.querySelector(t):t;if(!n)return;e=ZS(n,i)}else e=i;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.pageXOffset,e.top!=null?e.top:window.pageYOffset)}function Cg(i,e){return(history.state?history.state.position-e:-1)+i}const Jf=new Map;function eA(i,e){Jf.set(i,e)}function tA(i){const e=Jf.get(i);return Jf.delete(i),e}let iA=()=>location.protocol+"//"+location.host;function i3(i,e){const{pathname:t,search:s,hash:n}=e,r=i.indexOf("#");if(r>-1){let a=n.includes(i.slice(r))?i.slice(r).length:1,l=n.slice(a);return l[0]!=="/"&&(l="/"+l),_g(l,"")}return _g(t,i)+s+n}function sA(i,e,t,s){let n=[],r=[],o=null;const a=({state:f})=>{const d=i3(i,location),p=t.value,g=e.value;let m=0;if(f){if(t.value=d,e.value=f,o&&o===p){o=null;return}m=g?f.position-g.position:0}else s(d);n.forEach(b=>{b(t.value,p,{delta:m,type:Al.pop,direction:m?m>0?il.forward:il.back:il.unknown})})};function l(){o=t.value}function u(f){n.push(f);const d=()=>{const p=n.indexOf(f);p>-1&&n.splice(p,1)};return r.push(d),d}function h(){const{history:f}=window;f.state&&f.replaceState(At({},f.state,{scroll:uh()}),"")}function c(){for(const f of r)f();r=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",h)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",h),{pauseListeners:l,listen:u,destroy:c}}function Tg(i,e,t,s=!1,n=!1){return{back:i,current:e,forward:t,replaced:s,position:window.history.length,scroll:n?uh():null}}function nA(i){const{history:e,location:t}=window,s={value:i3(i,t)},n={value:e.state};n.value||r(s.value,{back:null,current:s.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function r(l,u,h){const c=i.indexOf("#"),f=c>-1?(t.host&&document.querySelector("base")?i:i.slice(c))+l:iA()+i+l;try{e[h?"replaceState":"pushState"](u,"",f),n.value=u}catch(d){console.error(d),t[h?"replace":"assign"](f)}}function o(l,u){const h=At({},e.state,Tg(n.value.back,l,n.value.forward,!0),u,{position:n.value.position});r(l,h,!0),s.value=l}function a(l,u){const h=At({},n.value,e.state,{forward:l,scroll:uh()});r(h.current,h,!0);const c=At({},Tg(s.value,l,null),{position:h.position+1},u);r(l,c,!1),s.value=l}return{location:s,state:n,push:a,replace:o}}function rA(i){i=KS(i);const e=nA(i),t=sA(i,e.state,e.location,e.replace);function s(r,o=!0){o||t.pauseListeners(),history.go(r)}const n=At({location:"",base:i,go:s,createHref:qS.bind(null,i)},e,t);return Object.defineProperty(n,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(n,"state",{enumerable:!0,get:()=>e.state.value}),n}function EI(i){return i=location.host?i||location.pathname+location.search:"",i.includes("#")||(i+="#"),rA(i)}function oA(i){return typeof i=="string"||i&&typeof i=="object"}function s3(i){return typeof i=="string"||typeof i=="symbol"}const ar={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},n3=Symbol("");var Lg;(function(i){i[i.aborted=4]="aborted",i[i.cancelled=8]="cancelled",i[i.duplicated=16]="duplicated"})(Lg||(Lg={}));function sa(i,e){return At(new Error,{type:i,[n3]:!0},e)}function Tn(i,e){return i instanceof Error&&n3 in i&&(e==null||!!(i.type&e))}const Bg="[^/]+?",aA={sensitive:!1,strict:!1,start:!0,end:!0},lA=/[.+*?^${}()[\]/\\]/g;function cA(i,e){const t=At({},aA,e),s=[];let n=t.start?"^":"";const r=[];for(const u of i){const h=u.length?[]:[90];t.strict&&!u.length&&(n+="/");for(let c=0;ce.length?e.length===1&&e[0]===40+40?1:-1:0}function hA(i,e){let t=0;const s=i.score,n=e.score;for(;t0&&e[e.length-1]<0}const fA={type:0,value:""},dA=/[a-zA-Z0-9_]/;function pA(i){if(!i)return[[]];if(i==="/")return[[fA]];if(!i.startsWith("/"))throw new Error(`Invalid path "${i}"`);function e(d){throw new Error(`ERR (${t})/"${u}": ${d}`)}let t=0,s=t;const n=[];let r;function o(){r&&n.push(r),r=[]}let a=0,l,u="",h="";function c(){u&&(t===0?r.push({type:0,value:u}):t===1||t===2||t===3?(r.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),r.push({type:1,value:u,regexp:h,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),u="")}function f(){u+=l}for(;a{o(y)}:tl}function o(h){if(s3(h)){const c=s.get(h);c&&(s.delete(h),t.splice(t.indexOf(c),1),c.children.forEach(o),c.alias.forEach(o))}else{const c=t.indexOf(h);c>-1&&(t.splice(c,1),h.record.name&&s.delete(h.record.name),h.children.forEach(o),h.alias.forEach(o))}}function a(){return t}function l(h){let c=0;for(;c=0&&(h.record.path!==t[c].record.path||!r3(h,t[c]));)c++;t.splice(c,0,h),h.record.name&&!Ng(h)&&s.set(h.record.name,h)}function u(h,c){let f,d={},p,g;if("name"in h&&h.name){if(f=s.get(h.name),!f)throw sa(1,{location:h});g=f.record.name,d=At(Rg(c.params,f.keys.filter(y=>!y.optional).map(y=>y.name)),h.params&&Rg(h.params,f.keys.map(y=>y.name))),p=f.stringify(d)}else if("path"in h)p=h.path,f=t.find(y=>y.re.test(p)),f&&(d=f.parse(p),g=f.record.name);else{if(f=c.name?s.get(c.name):t.find(y=>y.re.test(c.path)),!f)throw sa(1,{location:h,currentLocation:c});g=f.record.name,d=At({},c.params,h.params),p=f.stringify(d)}const m=[];let b=f;for(;b;)m.unshift(b.record),b=b.parent;return{name:g,path:p,params:d,matched:m,meta:vA(m)}}return i.forEach(h=>r(h)),{addRoute:r,resolve:u,removeRoute:o,getRoutes:a,getRecordMatcher:n}}function Rg(i,e){const t={};for(const s of e)s in i&&(t[s]=i[s]);return t}function bA(i){return{path:i.path,redirect:i.redirect,name:i.name,meta:i.meta||{},aliasOf:void 0,beforeEnter:i.beforeEnter,props:yA(i),children:i.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in i?i.components||null:i.component&&{default:i.component}}}function yA(i){const e={},t=i.props||!1;if("component"in i)e.default=t;else for(const s in i.components)e[s]=typeof t=="boolean"?t:t[s];return e}function Ng(i){for(;i;){if(i.record.aliasOf)return!0;i=i.parent}return!1}function vA(i){return i.reduce((e,t)=>At(e,t.meta),{})}function kg(i,e){const t={};for(const s in i)t[s]=s in e?e[s]:i[s];return t}function r3(i,e){return e.children.some(t=>t===i||r3(i,t))}const o3=/#/g,SA=/&/g,AA=/\//g,xA=/=/g,wA=/\?/g,a3=/\+/g,EA=/%5B/g,PA=/%5D/g,l3=/%5E/g,_A=/%60/g,c3=/%7B/g,MA=/%7C/g,u3=/%7D/g,CA=/%20/g;function m1(i){return encodeURI(""+i).replace(MA,"|").replace(EA,"[").replace(PA,"]")}function TA(i){return m1(i).replace(c3,"{").replace(u3,"}").replace(l3,"^")}function qf(i){return m1(i).replace(a3,"%2B").replace(CA,"+").replace(o3,"%23").replace(SA,"%26").replace(_A,"`").replace(c3,"{").replace(u3,"}").replace(l3,"^")}function LA(i){return qf(i).replace(xA,"%3D")}function BA(i){return m1(i).replace(o3,"%23").replace(wA,"%3F")}function IA(i){return i==null?"":BA(i).replace(AA,"%2F")}function ru(i){try{return decodeURIComponent(""+i)}catch(e){}return""+i}function RA(i){const e={};if(i===""||i==="?")return e;const s=(i[0]==="?"?i.slice(1):i).split("&");for(let n=0;nr&&qf(r)):[s&&qf(s)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+t,r!=null&&(e+="="+r))})}return e}function NA(i){const e={};for(const t in i){const s=i[t];s!==void 0&&(e[t]=js(s)?s.map(n=>n==null?null:""+n):s==null?s:""+s)}return e}const kA=Symbol(""),Og=Symbol(""),b1=Symbol(""),y1=Symbol(""),Zf=Symbol("");function La(){let i=[];function e(s){return i.push(s),()=>{const n=i.indexOf(s);n>-1&&i.splice(n,1)}}function t(){i=[]}return{add:e,list:()=>i,reset:t}}function pr(i,e,t,s,n){const r=s&&(s.enterCallbacks[n]=s.enterCallbacks[n]||[]);return()=>new Promise((o,a)=>{const l=c=>{c===!1?a(sa(4,{from:t,to:e})):c instanceof Error?a(c):oA(c)?a(sa(2,{from:e,to:c})):(r&&s.enterCallbacks[n]===r&&typeof c=="function"&&r.push(c),o())},u=i.call(s&&s.instances[n],e,t,l);let h=Promise.resolve(u);i.length<3&&(h=h.then(l)),h.catch(c=>a(c))})}function Zh(i,e,t,s){const n=[];for(const r of i)for(const o in r.components){let a=r.components[o];if(!(e!=="beforeRouteEnter"&&!r.instances[o]))if(DA(a)){const u=(a.__vccOpts||a)[e];u&&n.push(pr(u,t,s,r,o))}else{let l=a();n.push(()=>l.then(u=>{if(!u)return Promise.reject(new Error(`Couldn't resolve component "${o}" at "${r.path}"`));const h=US(u)?u.default:u;r.components[o]=h;const f=(h.__vccOpts||h)[e];return f&&pr(f,t,s,r,o)()}))}}return n}function DA(i){return typeof i=="object"||"displayName"in i||"props"in i||"__vccOpts"in i}function Fg(i){const e=Xi(b1),t=Xi(y1),s=Ft(()=>e.resolve(ls(i.to))),n=Ft(()=>{const{matched:l}=s.value,{length:u}=l,h=l[u-1],c=t.matched;if(!h||!c.length)return-1;const f=c.findIndex(ia.bind(null,h));if(f>-1)return f;const d=Vg(l[u-2]);return u>1&&Vg(h)===d&&c[c.length-1].path!==d?c.findIndex(ia.bind(null,l[u-2])):f}),r=Ft(()=>n.value>-1&&GA(t.params,s.value.params)),o=Ft(()=>n.value>-1&&n.value===t.matched.length-1&&t3(t.params,s.value.params));function a(l={}){return VA(l)?e[ls(i.replace)?"replace":"push"](ls(i.to)).catch(tl):Promise.resolve()}return{route:s,href:Ft(()=>s.value.href),isActive:r,isExactActive:o,navigate:a}}const OA=xt({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Fg,setup(i,{slots:e}){const t=Ht(Fg(i)),{options:s}=Xi(b1),n=Ft(()=>({[Gg(i.activeClass,s.linkActiveClass,"router-link-active")]:t.isActive,[Gg(i.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:t.isExactActive}));return()=>{const r=e.default&&e.default(t);return i.custom?r:lh("a",{"aria-current":t.isExactActive?i.ariaCurrentValue:null,href:t.href,onClick:t.navigate,class:n.value},r)}}}),FA=OA;function VA(i){if(!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)&&!i.defaultPrevented&&!(i.button!==void 0&&i.button!==0)){if(i.currentTarget&&i.currentTarget.getAttribute){const e=i.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return i.preventDefault&&i.preventDefault(),!0}}function GA(i,e){for(const t in e){const s=e[t],n=i[t];if(typeof s=="string"){if(s!==n)return!1}else if(!js(n)||n.length!==s.length||s.some((r,o)=>r!==n[o]))return!1}return!0}function Vg(i){return i?i.aliasOf?i.aliasOf.path:i.path:""}const Gg=(i,e,t)=>i!=null?i:e!=null?e:t,HA=xt({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(i,{attrs:e,slots:t}){const s=Xi(Zf),n=Ft(()=>i.route||s.value),r=Xi(Og,0),o=Ft(()=>{let u=ls(r);const{matched:h}=n.value;let c;for(;(c=h[u])&&!c.components;)u++;return u}),a=Ft(()=>n.value.matched[o.value]);oo(Og,Ft(()=>o.value+1)),oo(kA,a),oo(Zf,n);const l=dt();return Vt(()=>[l.value,a.value,i.name],([u,h,c],[f,d,p])=>{h&&(h.instances[c]=u,d&&d!==h&&u&&u===f&&(h.leaveGuards.size||(h.leaveGuards=d.leaveGuards),h.updateGuards.size||(h.updateGuards=d.updateGuards))),u&&h&&(!d||!ia(h,d)||!f)&&(h.enterCallbacks[c]||[]).forEach(g=>g(u))},{flush:"post"}),()=>{const u=n.value,h=i.name,c=a.value,f=c&&c.components[h];if(!f)return Hg(t.default,{Component:f,route:u});const d=c.props[h],p=d?d===!0?u.params:typeof d=="function"?d(u):d:null,m=lh(f,At({},p,e,{onVnodeUnmounted:b=>{b.component.isUnmounted&&(c.instances[h]=null)},ref:l}));return Hg(t.default,{Component:m,route:u})||m}}});function Hg(i,e){if(!i)return null;const t=i(e);return t.length===1?t[0]:t}const UA=HA;function PI(i){const e=mA(i.routes,i),t=i.parseQuery||RA,s=i.stringifyQuery||Dg,n=i.history,r=La(),o=La(),a=La(),l=e5(ar);let u=ar;ko&&i.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const h=Jh.bind(null,W=>""+W),c=Jh.bind(null,IA),f=Jh.bind(null,ru);function d(W,se){let he,oe;return s3(W)?(he=e.getRecordMatcher(W),oe=se):oe=W,e.addRoute(oe,he)}function p(W){const se=e.getRecordMatcher(W);se&&e.removeRoute(se)}function g(){return e.getRoutes().map(W=>W.record)}function m(W){return!!e.getRecordMatcher(W)}function b(W,se){if(se=At({},se||l.value),typeof W=="string"){const V=qh(t,W,se.path),z=e.resolve({path:V.path},se),w=n.createHref(V.fullPath);return At(V,z,{params:f(z.params),hash:ru(V.hash),redirectedFrom:void 0,href:w})}let he;if("path"in W)he=At({},W,{path:qh(t,W.path,se.path).path});else{const V=At({},W.params);for(const z in V)V[z]==null&&delete V[z];he=At({},W,{params:c(W.params)}),se.params=c(se.params)}const oe=e.resolve(he,se),be=W.hash||"";oe.params=h(f(oe.params));const Me=YS(s,At({},W,{hash:TA(be),path:oe.path})),ve=n.createHref(Me);return At({fullPath:Me,hash:be,query:s===Dg?NA(W.query):W.query||{}},oe,{redirectedFrom:void 0,href:ve})}function y(W){return typeof W=="string"?qh(t,W,l.value.path):At({},W)}function v(W,se){if(u!==W)return sa(8,{from:se,to:W})}function S(W){return x(W)}function A(W){return S(At(y(W),{replace:!0}))}function P(W){const se=W.matched[W.matched.length-1];if(se&&se.redirect){const{redirect:he}=se;let oe=typeof he=="function"?he(W):he;return typeof oe=="string"&&(oe=oe.includes("?")||oe.includes("#")?oe=y(oe):{path:oe},oe.params={}),At({query:W.query,hash:W.hash,params:"path"in oe?{}:W.params},oe)}}function x(W,se){const he=u=b(W),oe=l.value,be=W.state,Me=W.force,ve=W.replace===!0,V=P(he);if(V)return x(At(y(V),{state:typeof V=="object"?At({},be,V.state):be,force:Me,replace:ve}),se||he);const z=he;z.redirectedFrom=se;let w;return!Me&&QS(s,oe,he)&&(w=sa(16,{to:z,from:oe}),le(oe,oe,!0,!1)),(w?Promise.resolve(w):_(z,oe)).catch(U=>Tn(U)?Tn(U,2)?U:J(U):H(U,z,oe)).then(U=>{if(U){if(Tn(U,2))return x(At({replace:ve},y(U.to),{state:typeof U.to=="object"?At({},be,U.to.state):be,force:Me}),se||z)}else U=D(z,oe,!0,ve,be);return T(z,oe,U),U})}function M(W,se){const he=v(W,se);return he?Promise.reject(he):Promise.resolve()}function _(W,se){let he;const[oe,be,Me]=zA(W,se);he=Zh(oe.reverse(),"beforeRouteLeave",W,se);for(const V of oe)V.leaveGuards.forEach(z=>{he.push(pr(z,W,se))});const ve=M.bind(null,W,se);return he.push(ve),Mo(he).then(()=>{he=[];for(const V of r.list())he.push(pr(V,W,se));return he.push(ve),Mo(he)}).then(()=>{he=Zh(be,"beforeRouteUpdate",W,se);for(const V of be)V.updateGuards.forEach(z=>{he.push(pr(z,W,se))});return he.push(ve),Mo(he)}).then(()=>{he=[];for(const V of W.matched)if(V.beforeEnter&&!se.matched.includes(V))if(js(V.beforeEnter))for(const z of V.beforeEnter)he.push(pr(z,W,se));else he.push(pr(V.beforeEnter,W,se));return he.push(ve),Mo(he)}).then(()=>(W.matched.forEach(V=>V.enterCallbacks={}),he=Zh(Me,"beforeRouteEnter",W,se),he.push(ve),Mo(he))).then(()=>{he=[];for(const V of o.list())he.push(pr(V,W,se));return he.push(ve),Mo(he)}).catch(V=>Tn(V,8)?V:Promise.reject(V))}function T(W,se,he){for(const oe of a.list())oe(W,se,he)}function D(W,se,he,oe,be){const Me=v(W,se);if(Me)return Me;const ve=se===ar,V=ko?history.state:{};he&&(oe||ve?n.replace(W.fullPath,At({scroll:ve&&V&&V.scroll},be)):n.push(W.fullPath,be)),l.value=W,le(W,se,he,ve),J()}let C;function L(){C||(C=n.listen((W,se,he)=>{if(!de.listening)return;const oe=b(W),be=P(oe);if(be){x(At(be,{replace:!0}),oe).catch(tl);return}u=oe;const Me=l.value;ko&&eA(Cg(Me.fullPath,he.delta),uh()),_(oe,Me).catch(ve=>Tn(ve,12)?ve:Tn(ve,2)?(x(ve.to,oe).then(V=>{Tn(V,20)&&!he.delta&&he.type===Al.pop&&n.go(-1,!1)}).catch(tl),Promise.reject()):(he.delta&&n.go(-he.delta,!1),H(ve,oe,Me))).then(ve=>{ve=ve||D(oe,Me,!1),ve&&(he.delta&&!Tn(ve,8)?n.go(-he.delta,!1):he.type===Al.pop&&Tn(ve,20)&&n.go(-1,!1)),T(oe,Me,ve)}).catch(tl)}))}let E=La(),k=La(),Q;function H(W,se,he){J(W);const oe=k.list();return oe.length?oe.forEach(be=>be(W,se,he)):console.error(W),Promise.reject(W)}function Z(){return Q&&l.value!==ar?Promise.resolve():new Promise((W,se)=>{E.add([W,se])})}function J(W){return Q||(Q=!W,L(),E.list().forEach(([se,he])=>W?he(W):se()),E.reset()),W}function le(W,se,he,oe){const{scrollBehavior:be}=i;if(!ko||!be)return Promise.resolve();const Me=!he&&tA(Cg(W.fullPath,0))||(oe||!he)&&history.state&&history.state.scroll||null;return yn().then(()=>be(W,se,Me)).then(ve=>ve&&$S(ve)).catch(ve=>H(ve,W,se))}const X=W=>n.go(W);let O;const fe=new Set,de={currentRoute:l,listening:!0,addRoute:d,removeRoute:p,hasRoute:m,getRoutes:g,resolve:b,options:i,push:S,replace:A,go:X,back:()=>X(-1),forward:()=>X(1),beforeEach:r.add,beforeResolve:o.add,afterEach:a.add,onError:k.add,isReady:Z,install(W){const se=this;W.component("RouterLink",FA),W.component("RouterView",UA),W.config.globalProperties.$router=se,Object.defineProperty(W.config.globalProperties,"$route",{enumerable:!0,get:()=>ls(l)}),ko&&!O&&l.value===ar&&(O=!0,S(n.location).catch(be=>{}));const he={};for(const be in ar)he[be]=Ft(()=>l.value[be]);W.provide(b1,se),W.provide(y1,Ht(he)),W.provide(Zf,l);const oe=W.unmount;fe.add(W),W.unmount=function(){fe.delete(W),fe.size<1&&(u=ar,C&&C(),C=null,l.value=ar,O=!1,Q=!1),oe()}}};return de}function Mo(i){return i.reduce((e,t)=>e.then(()=>t()),Promise.resolve())}function zA(i,e){const t=[],s=[],n=[],r=Math.max(e.matched.length,i.matched.length);for(let o=0;oia(u,a))?s.push(a):t.push(a));const l=i.matched[o];l&&(e.matched.find(u=>ia(u,l))||n.push(l))}return[t,s,n]}function _I(){return Xi(y1)}const Jn=i=>i!=null,$f=i=>typeof i=="function",hh=i=>i!==null&&typeof i=="object",WA=i=>hh(i)&&$f(i.then)&&$f(i.catch),h3=i=>typeof i=="number"||/^\d+(\.\d+)?$/.test(i),YA=()=>fh?/ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()):!1;function QA(){}const Sn=Object.assign,fh=typeof window<"u";function Ug(i,e){const t=e.split(".");let s=i;return t.forEach(n=>{var r;s=hh(s)&&(r=s[n])!=null?r:""}),s}function XA(i,e,t){return e.reduce((s,n)=>((!t||i[n]!==void 0)&&(s[n]=i[n]),s),{})}const MI=(i,e)=>JSON.stringify(i)===JSON.stringify(e),CI=i=>Array.isArray(i)?i:[i],ou=null,ni=[Number,String],Ys={type:Boolean,default:!0},TI=i=>({type:i,required:!0}),LI=()=>({type:Array,default:()=>[]}),jA=i=>({type:Number,default:i}),ed=i=>({type:ni,default:i}),si=i=>({type:String,default:i});var So=typeof window<"u";function td(i){return So?requestAnimationFrame(i):-1}function BI(i){So&&cancelAnimationFrame(i)}function zg(i){td(()=>td(i))}var KA=i=>i===window,Wg=(i,e)=>({top:0,left:0,right:i,bottom:e,width:i,height:e}),au=i=>{const e=ls(i);if(KA(e)){const t=e.innerWidth,s=e.innerHeight;return Wg(t,s)}return e!=null&&e.getBoundingClientRect?e.getBoundingClientRect():Wg(0,0)};function II(i){const e=Xi(i,null);if(e){const t=Js(),{link:s,unlink:n,internalChildren:r}=e;s(t),Nr(()=>n(t));const o=Ft(()=>r.indexOf(t));return{parent:e,index:o}}return{parent:null,index:dt(-1)}}function JA(i){const e=[],t=s=>{Array.isArray(s)&&s.forEach(n=>{var r;ea(n)&&(e.push(n),(r=n.component)!=null&&r.subTree&&(e.push(n.component.subTree),t(n.component.subTree.children)),n.children&&t(n.children))})};return t(i),e}var Yg=(i,e)=>{const t=i.indexOf(e);return t===-1?i.findIndex(s=>e.key!==void 0&&e.key!==null&&s.type===e.type&&s.key===e.key):t};function qA(i,e,t){const s=JA(i.subTree.children);t.sort((r,o)=>Yg(s,r.vnode)-Yg(s,o.vnode));const n=t.map(r=>r.proxy);e.sort((r,o)=>{const a=n.indexOf(r),l=n.indexOf(o);return a-l})}function RI(i){const e=Ht([]),t=Ht([]),s=Js();return{children:e,linkChildren:r=>{oo(i,Object.assign({link:l=>{l.proxy&&(t.push(l),e.push(l.proxy),qA(s,e,t))},unlink:l=>{const u=t.indexOf(l);e.splice(u,1),t.splice(u,1)},children:e,internalChildren:t},r))}}}function v1(i){let e;Cs(()=>{i(),yn(()=>{e=!0})}),vo(()=>{e&&i()})}function dh(i,e,t={}){if(!So)return;const{target:s=window,passive:n=!1,capture:r=!1}=t;let o=!1,a;const l=c=>{if(o)return;const f=ls(c);f&&!a&&(f.addEventListener(i,e,{capture:r,passive:n}),a=!0)},u=c=>{if(o)return;const f=ls(c);f&&a&&(f.removeEventListener(i,e,r),a=!1)};Nr(()=>u(s)),Rr(()=>u(s)),v1(()=>l(s));let h;return ai(s)&&(h=Vt(s,(c,f)=>{u(f),l(c)})),()=>{h==null||h(),u(s),o=!0}}function NI(i,e,t={}){if(!So)return;const{eventName:s="click"}=t;dh(s,r=>{(Array.isArray(i)?i:[i]).every(l=>{const u=ls(l);return u&&!u.contains(r.target)})&&e(r)},{target:document})}var gc,$h;function ZA(){if(!gc&&(gc=dt(0),$h=dt(0),So)){const i=()=>{gc.value=window.innerWidth,$h.value=window.innerHeight};i(),window.addEventListener("resize",i,{passive:!0}),window.addEventListener("orientationchange",i,{passive:!0})}return{width:gc,height:$h}}var $A=/scroll|auto|overlay/i,f3=So?window:void 0;function e6(i){return i.tagName!=="HTML"&&i.tagName!=="BODY"&&i.nodeType===1}function d3(i,e=f3){let t=i;for(;t&&t!==e&&e6(t);){const{overflowY:s}=window.getComputedStyle(t);if($A.test(s))return t;t=t.parentNode}return e}function kI(i,e=f3){const t=dt();return Cs(()=>{i.value&&(t.value=d3(i.value,e))}),t}var mc;function t6(){if(!mc&&(mc=dt("visible"),So)){const i=()=>{mc.value=document.hidden?"hidden":"visible"};i(),window.addEventListener("visibilitychange",i)}return mc}var i6=Symbol("van-field");function DI(i){const e=Xi(i6,null);e&&!e.customValue.value&&(e.customValue.value=i,Vt(i,()=>{e.resetValidation(),e.validateWithTrigger("onChange")}))}function s6(i){const e="scrollTop"in i?i.scrollTop:i.pageYOffset;return Math.max(e,0)}function Qg(i,e){"scrollTop"in i?i.scrollTop=e:i.scrollTo(i.scrollX,e)}function p3(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0}function n6(i){Qg(window,i),Qg(document.body,i)}function OI(i,e){if(i===window)return 0;const t=e?s6(e):p3();return au(i).top+t}const r6=YA();function FI(){r6&&n6(p3())}const o6=i=>i.stopPropagation();function S1(i,e){(typeof i.cancelable!="boolean"||i.cancelable)&&i.preventDefault(),e&&o6(i)}function VI(i){const e=ls(i);if(!e)return!1;const t=window.getComputedStyle(e),s=t.display==="none",n=e.offsetParent===null&&t.position!=="fixed";return s||n}const{width:g3,height:m3}=ZA();function as(i){if(Jn(i))return h3(i)?`${i}px`:String(i)}function A1(i){if(Jn(i)){if(Array.isArray(i))return{width:as(i[0]),height:as(i[1])};const e=as(i);return{width:e,height:e}}}function b3(i){const e={};return i!==void 0&&(e.zIndex=+i),e}let ef;function a6(){if(!ef){const i=document.documentElement,e=i.style.fontSize||window.getComputedStyle(i).fontSize;ef=parseFloat(e)}return ef}function l6(i){return i=i.replace(/rem/g,""),+i*a6()}function c6(i){return i=i.replace(/vw/g,""),+i*g3.value/100}function u6(i){return i=i.replace(/vh/g,""),+i*m3.value/100}function GI(i){if(typeof i=="number")return i;if(fh){if(i.includes("rem"))return l6(i);if(i.includes("vw"))return c6(i);if(i.includes("vh"))return u6(i)}return parseFloat(i)}const h6=/-(\w)/g,y3=i=>i.replace(h6,(e,t)=>t.toUpperCase()),f6=i=>i.replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^-/,""),HI=(i,e,t)=>Math.min(Math.max(i,e),t);function Xg(i,e,t){const s=i.indexOf(e);return s===-1?i:e==="-"&&s!==0?i.slice(0,s):i.slice(0,s+1)+i.slice(s).replace(t,"")}function UI(i,e=!0,t=!0){e?i=Xg(i,".",/\./g):i=i.split(".")[0],t?i=Xg(i,"-",/-/g):i=i.replace(/-/,"");const s=e?/[^-0-9.]/g:/[^-0-9]/g;return i.replace(s,"")}function zI(i,e){return Math.round((i+e)*1e10)/1e10}const{hasOwnProperty:d6}=Object.prototype;function p6(i,e,t){const s=e[t];Jn(s)&&(!d6.call(i,t)||!hh(s)?i[t]=s:i[t]=v3(Object(i[t]),s))}function v3(i,e){return Object.keys(e).forEach(t=>{p6(i,e,t)}),i}var g6={name:"姓名",tel:"电话",save:"保存",confirm:"确认",cancel:"取消",delete:"删除",loading:"加载中...",noCoupon:"暂无优惠券",nameEmpty:"请填写姓名",addContact:"添加联系人",telInvalid:"请填写正确的电话",vanCalendar:{end:"结束",start:"开始",title:"日期选择",weekdays:["日","一","二","三","四","五","六"],monthTitle:(i,e)=>`${i}年${e}月`,rangePrompt:i=>`最多选择 ${i} 天`},vanCascader:{select:"请选择"},vanPagination:{prev:"上一页",next:"下一页"},vanPullRefresh:{pulling:"下拉即可刷新...",loosing:"释放即可刷新..."},vanSubmitBar:{label:"合计:"},vanCoupon:{unlimited:"无门槛",discount:i=>`${i}折`,condition:i=>`满${i}元可用`},vanCouponCell:{title:"优惠券",count:i=>`${i}张可用`},vanCouponList:{exchange:"兑换",close:"不使用",enable:"可用",disabled:"不可用",placeholder:"输入优惠码"},vanAddressEdit:{area:"地区",areaEmpty:"请选择地区",addressEmpty:"请填写详细地址",addressDetail:"详细地址",defaultAddress:"设为默认收货地址"},vanAddressList:{add:"新增地址"}};const jg=dt("zh-CN"),Kg=Ht({"zh-CN":g6}),m6={messages(){return Kg[jg.value]},use(i,e){jg.value=i,this.add({[i]:e})},add(i={}){v3(Kg,i)}};var b6=m6;function y6(i){const e=y3(i)+".";return(t,...s)=>{const n=b6.messages(),r=Ug(n,e+t)||Ug(n,t);return $f(r)?r(...s):r}}function id(i,e){return e?typeof e=="string"?` ${i}--${e}`:Array.isArray(e)?e.reduce((t,s)=>t+id(i,s),""):Object.keys(e).reduce((t,s)=>t+(e[s]?id(i,s):""),""):""}function v6(i){return(e,t)=>(e&&typeof e!="string"&&(t=e,e=""),e=e?`${i}__${e}`:i,`${e}${id(e,t)}`)}function ji(i){const e=`van-${i}`;return[e,v6(e),y6(e)]}const Sa="van-hairline",WI=`${Sa}--top`,YI=`${Sa}--left`,S6=`${Sa}--bottom`,A6=`${Sa}--surround`,QI=`${Sa}--top-bottom`,XI=`${Sa}-unset--top-bottom`,sd="van-haptics-feedback",jI=Symbol("van-form");function x6(i,{args:e=[],done:t,canceled:s}){if(i){const n=i.apply(null,e);WA(n)?n.then(r=>{r?t():s&&s()}).catch(QA):n?t():s&&s()}else t()}function ns(i){return i.install=e=>{const{name:t}=i;t&&(e.component(t,i),e.component(y3(`-${t}`),i))},i}const S3=Symbol();function A3(i){const e=Xi(S3,null);e&&Vt(e,t=>{t&&i()})}const w6=(i,e)=>{const t=dt(),s=()=>{t.value=au(i).height};return Cs(()=>{if(yn(s),e)for(let n=1;n<=3;n++)setTimeout(s,100*n)}),A3(()=>yn(s)),Vt([g3,m3],s),t};function E6(i,e){const t=w6(i,!0);return s=>ee("div",{class:e("placeholder"),style:{height:t.value?`${t.value}px`:void 0}},[s()])}function x1(i){const e=Js();e&&Sn(e.proxy,i)}const P6={to:[String,Object],url:String,replace:Boolean};function _6({to:i,url:e,replace:t,$router:s}){i&&s?s[t?"replace":"push"](i):e&&(t?location.replace(e):location.href=e)}function M6(){const i=Js().proxy;return()=>_6(i)}const[C6,Jg]=ji("badge"),T6={dot:Boolean,max:ni,tag:si("div"),color:String,offset:Array,content:ni,showZero:Ys,position:si("top-right")};var L6=xt({name:C6,props:T6,setup(i,{slots:e}){const t=()=>{if(e.content)return!0;const{content:a,showZero:l}=i;return Jn(a)&&a!==""&&(l||a!==0&&a!=="0")},s=()=>{const{dot:a,max:l,content:u}=i;if(!a&&t())return e.content?e.content():Jn(l)&&h3(u)&&+u>+l?`${l}+`:u},n=a=>a.startsWith("-")?a.replace("-",""):`-${a}`,r=Ft(()=>{const a={background:i.color};if(i.offset){const[l,u]=i.offset,{position:h}=i,[c,f]=h.split("-");e.default?(typeof u=="number"?a[c]=as(c==="top"?u:-u):a[c]=c==="top"?as(u):n(u),typeof l=="number"?a[f]=as(f==="left"?l:-l):a[f]=f==="left"?as(l):n(l)):(a.marginTop=as(u),a.marginLeft=as(l))}return a}),o=()=>{if(t()||i.dot)return ee("div",{class:Jg([i.position,{dot:i.dot,fixed:!!e.default}]),style:r.value},[s()])};return()=>{if(e.default){const{tag:a}=i;return ee(a,{class:Jg("wrapper")},{default:()=>[e.default(),o()]})}return o()}}});const B6=ns(L6);let x3=2e3;const I6=()=>++x3,R6=i=>{x3=i},[w3,N6]=ji("config-provider"),E3=Symbol(w3),k6={tag:si("div"),theme:si("light"),zIndex:Number,themeVars:Object,themeVarsDark:Object,themeVarsLight:Object,iconPrefix:String};function D6(i){const e={};return Object.keys(i).forEach(t=>{e[`--van-${f6(t)}`]=i[t]}),e}xt({name:w3,props:k6,setup(i,{slots:e}){const t=Ft(()=>D6(Sn({},i.themeVars,i.theme==="dark"?i.themeVarsDark:i.themeVarsLight)));if(fh){const s=()=>{document.documentElement.classList.add(`van-theme-${i.theme}`)},n=(r=i.theme)=>{document.documentElement.classList.remove(`van-theme-${r}`)};Vt(()=>i.theme,(r,o)=>{o&&n(o),s()},{immediate:!0}),vo(s),Rr(n),ba(n)}return oo(E3,i),A5(()=>{i.zIndex!==void 0&&R6(i.zIndex)}),()=>ee(i.tag,{class:N6(),style:t.value},{default:()=>{var s;return[(s=e.default)==null?void 0:s.call(e)]}})}});const[O6,qg]=ji("icon"),F6=i=>i==null?void 0:i.includes("/"),V6={dot:Boolean,tag:si("i"),name:String,size:ni,badge:ni,color:String,badgeProps:Object,classPrefix:String};var G6=xt({name:O6,props:V6,setup(i,{slots:e}){const t=Xi(E3,null),s=Ft(()=>i.classPrefix||(t==null?void 0:t.iconPrefix)||qg());return()=>{const{tag:n,dot:r,name:o,size:a,badge:l,color:u}=i,h=F6(o);return ee(B6,Kn({dot:r,tag:n,class:[s.value,h?"":`${s.value}-${o}`],style:{color:u,fontSize:as(a)},content:l},i.badgeProps),{default:()=>{var c;return[(c=e.default)==null?void 0:c.call(e),h&&ee("img",{class:qg("image"),src:o},null)]}})}}});const Tr=ns(G6),[H6,sl]=ji("loading"),U6=Array(12).fill(null).map((i,e)=>ee("i",{class:sl("line",String(e+1))},null)),z6=ee("svg",{class:sl("circular"),viewBox:"25 25 50 50"},[ee("circle",{cx:"50",cy:"50",r:"20",fill:"none"},null)]),W6={size:ni,type:si("circular"),color:String,vertical:Boolean,textSize:ni,textColor:String};var Y6=xt({name:H6,props:W6,setup(i,{slots:e}){const t=Ft(()=>Sn({color:i.color},A1(i.size))),s=()=>{const r=i.type==="spinner"?U6:z6;return ee("span",{class:sl("spinner",i.type),style:t.value},[e.icon?e.icon():r])},n=()=>{var r;if(e.default)return ee("span",{class:sl("text"),style:{fontSize:as(i.textSize),color:(r=i.textColor)!=null?r:i.color}},[e.default()])};return()=>{const{type:r,vertical:o}=i;return ee("div",{class:sl([r,{vertical:o}]),"aria-live":"polite","aria-busy":!0},[s(),n()])}}});const P3=ns(Y6),[Q6,Co]=ji("button"),X6=Sn({},P6,{tag:si("button"),text:String,icon:String,type:si("default"),size:si("normal"),color:String,block:Boolean,plain:Boolean,round:Boolean,square:Boolean,loading:Boolean,hairline:Boolean,disabled:Boolean,iconPrefix:String,nativeType:si("button"),loadingSize:ni,loadingText:String,loadingType:String,iconPosition:si("left")});var j6=xt({name:Q6,props:X6,emits:["click"],setup(i,{emit:e,slots:t}){const s=M6(),n=()=>t.loading?t.loading():ee(P3,{size:i.loadingSize,type:i.loadingType,class:Co("loading")},null),r=()=>{if(i.loading)return n();if(t.icon)return ee("div",{class:Co("icon")},[t.icon()]);if(i.icon)return ee(Tr,{name:i.icon,class:Co("icon"),classPrefix:i.iconPrefix},null)},o=()=>{let u;if(i.loading?u=i.loadingText:u=t.default?t.default():i.text,u)return ee("span",{class:Co("text")},[u])},a=()=>{const{color:u,plain:h}=i;if(u){const c={color:h?u:"white"};return h||(c.background=u),u.includes("gradient")?c.border=0:c.borderColor=u,c}},l=u=>{i.loading?S1(u):i.disabled||(e("click",u),s())};return()=>{const{tag:u,type:h,size:c,block:f,round:d,plain:p,square:g,loading:m,disabled:b,hairline:y,nativeType:v,iconPosition:S}=i,A=[Co([h,c,{plain:p,block:f,round:d,square:g,loading:m,disabled:b,hairline:y}]),{[A6]:y}];return ee(u,{type:v,class:A,style:a(),disabled:b,onClick:l},{default:()=>[ee("div",{class:Co("content")},[S==="left"&&r(),o(),S==="right"&&r()])]})}}});const _3=ns(j6),M3={show:Boolean,zIndex:ni,overlay:Ys,duration:ni,teleport:[String,Object],lockScroll:Ys,lazyRender:Ys,beforeClose:Function,overlayStyle:Object,overlayClass:ou,transitionAppear:Boolean,closeOnClickOverlay:Ys},KI=Object.keys(M3);function K6(i,e){return i>e?"horizontal":e>i?"vertical":""}function J6(){const i=dt(0),e=dt(0),t=dt(0),s=dt(0),n=dt(0),r=dt(0),o=dt(""),a=()=>o.value==="vertical",l=()=>o.value==="horizontal",u=()=>{t.value=0,s.value=0,n.value=0,r.value=0,o.value=""};return{move:f=>{const d=f.touches[0];t.value=(d.clientX<0?0:d.clientX)-i.value,s.value=d.clientY-e.value,n.value=Math.abs(t.value),r.value=Math.abs(s.value);const p=10;(!o.value||n.value{u(),i.value=f.touches[0].clientX,e.value=f.touches[0].clientY},reset:u,startX:i,startY:e,deltaX:t,deltaY:s,offsetX:n,offsetY:r,direction:o,isVertical:a,isHorizontal:l}}let Ba=0;const Zg="van-overflow-hidden";function q6(i,e){const t=J6(),s="01",n="10",r=h=>{t.move(h);const c=t.deltaY.value>0?n:s,f=d3(h.target,i.value),{scrollHeight:d,offsetHeight:p,scrollTop:g}=f;let m="11";g===0?m=p>=d?"00":"01":g+p>=d&&(m="10"),m!=="11"&&t.isVertical()&&!(parseInt(m,2)&parseInt(c,2))&&S1(h,!0)},o=()=>{document.addEventListener("touchstart",t.start),document.addEventListener("touchmove",r,{passive:!1}),Ba||document.body.classList.add(Zg),Ba++},a=()=>{Ba&&(document.removeEventListener("touchstart",t.start),document.removeEventListener("touchmove",r),Ba--,Ba||document.body.classList.remove(Zg))},l=()=>e()&&o(),u=()=>e()&&a();v1(l),Rr(u),ba(u),Vt(e,h=>{h?o():a()})}function C3(i){const e=dt(!1);return Vt(i,t=>{t&&(e.value=t)},{immediate:!0}),t=>()=>e.value?t():null}const[Z6,$6]=ji("overlay"),e8={show:Boolean,zIndex:ni,duration:ni,className:ou,lockScroll:Ys,lazyRender:Ys,customStyle:Object};var t8=xt({name:Z6,props:e8,setup(i,{slots:e}){const t=dt(),s=C3(()=>i.show||!i.lazyRender),n=o=>{i.lockScroll&&S1(o,!0)},r=s(()=>{var o;const a=Sn(b3(i.zIndex),i.customStyle);return Jn(i.duration)&&(a.animationDuration=`${i.duration}s`),nh(ee("div",{ref:t,style:a,class:[$6(),i.className]},[(o=e.default)==null?void 0:o.call(e)]),[[ch,i.show]])});return dh("touchmove",n,{target:t}),()=>ee(va,{name:"van-fade",appear:!0},{default:r})}});const i8=ns(t8),s8=Sn({},M3,{round:Boolean,position:si("center"),closeIcon:si("cross"),closeable:Boolean,transition:String,iconPrefix:String,closeOnPopstate:Boolean,closeIconPosition:si("top-right"),safeAreaInsetTop:Boolean,safeAreaInsetBottom:Boolean}),[n8,$g]=ji("popup");var r8=xt({name:n8,inheritAttrs:!1,props:s8,emits:["open","close","opened","closed","keydown","update:show","clickOverlay","clickCloseIcon"],setup(i,{emit:e,attrs:t,slots:s}){let n,r;const o=dt(),a=dt(),l=C3(()=>i.show||!i.lazyRender),u=Ft(()=>{const A={zIndex:o.value};if(Jn(i.duration)){const P=i.position==="center"?"animationDuration":"transitionDuration";A[P]=`${i.duration}s`}return A}),h=()=>{n||(n=!0,o.value=i.zIndex!==void 0?+i.zIndex:I6(),e("open"))},c=()=>{n&&x6(i.beforeClose,{done(){n=!1,e("close"),e("update:show",!1)}})},f=A=>{e("clickOverlay",A),i.closeOnClickOverlay&&c()},d=()=>{if(i.overlay)return ee(i8,{show:i.show,class:i.overlayClass,zIndex:o.value,duration:i.duration,customStyle:i.overlayStyle,role:i.closeOnClickOverlay?"button":void 0,tabindex:i.closeOnClickOverlay?0:void 0,onClick:f},{default:s["overlay-content"]})},p=A=>{e("clickCloseIcon",A),c()},g=()=>{if(i.closeable)return ee(Tr,{role:"button",tabindex:0,name:i.closeIcon,class:[$g("close-icon",i.closeIconPosition),sd],classPrefix:i.iconPrefix,onClick:p},null)},m=()=>e("opened"),b=()=>e("closed"),y=A=>e("keydown",A),v=l(()=>{var A;const{round:P,position:x,safeAreaInsetTop:M,safeAreaInsetBottom:_}=i;return nh(ee("div",Kn({ref:a,style:u.value,role:"dialog",tabindex:0,class:[$g({round:P,[x]:x}),{"van-safe-area-top":M,"van-safe-area-bottom":_}],onKeydown:y},t),[(A=s.default)==null?void 0:A.call(s),g()]),[[ch,i.show]])}),S=()=>{const{position:A,transition:P,transitionAppear:x}=i,M=A==="center"?"van-fade":`van-popup-slide-${A}`;return ee(va,{name:P||M,appear:x,onAfterEnter:m,onAfterLeave:b},{default:v})};return Vt(()=>i.show,A=>{A&&!n&&(h(),t.tabindex===0&&yn(()=>{var P;(P=a.value)==null||P.focus()})),!A&&n&&(n=!1,e("close"))}),x1({popupRef:a}),q6(a,()=>i.show&&i.lockScroll),dh("popstate",()=>{i.closeOnPopstate&&(c(),r=!1)}),Cs(()=>{i.show&&h()}),vo(()=>{r&&(e("update:show",!0),r=!1)}),Rr(()=>{i.show&&i.teleport&&(c(),r=!0)}),oo(S3,()=>i.show),()=>i.teleport?ee(H0,{to:i.teleport},{default:()=>[d(),S()]}):ee(oi,null,[d(),S()])}});const T3=ns(r8);let o8=0;function a8(){const i=Js(),{name:e="unknown"}=(i==null?void 0:i.type)||{};return`${e}-${++o8}`}let Ia=0;function l8(i){i?(Ia||document.body.classList.add("van-toast--unclickable"),Ia++):Ia&&(Ia--,Ia||document.body.classList.remove("van-toast--unclickable"))}const[c8,To]=ji("toast"),u8=["show","overlay","teleport","transition","overlayClass","overlayStyle","closeOnClickOverlay"],h8={icon:String,show:Boolean,type:si("text"),overlay:Boolean,message:ni,iconSize:ni,duration:jA(2e3),position:si("middle"),teleport:[String,Object],wordBreak:String,className:ou,iconPrefix:String,transition:si("van-fade"),loadingType:String,forbidClick:Boolean,overlayClass:ou,overlayStyle:Object,closeOnClick:Boolean,closeOnClickOverlay:Boolean};var L3=xt({name:c8,props:h8,emits:["update:show"],setup(i,{emit:e,slots:t}){let s,n=!1;const r=()=>{const c=i.show&&i.forbidClick;n!==c&&(n=c,l8(n))},o=c=>e("update:show",c),a=()=>{i.closeOnClick&&o(!1)},l=()=>clearTimeout(s),u=()=>{const{icon:c,type:f,iconSize:d,iconPrefix:p,loadingType:g}=i;if(c||f==="success"||f==="fail")return ee(Tr,{name:c||f,size:d,class:To("icon"),classPrefix:p},null);if(f==="loading")return ee(P3,{class:To("loading"),size:d,type:g},null)},h=()=>{const{type:c,message:f}=i;if(t.message)return ee("div",{class:To("text")},[t.message()]);if(Jn(f)&&f!=="")return c==="html"?ee("div",{key:0,class:To("text"),innerHTML:String(f)},null):ee("div",{class:To("text")},[f])};return Vt(()=>[i.show,i.forbidClick],r),Vt(()=>[i.show,i.type,i.message,i.duration],()=>{l(),i.show&&i.duration>0&&(s=setTimeout(()=>{o(!1)},i.duration))}),Cs(r),Nr(r),()=>ee(T3,Kn({class:[To([i.position,i.wordBreak==="normal"?"break-normal":i.wordBreak,{[i.type]:!i.icon}]),i.className],lockScroll:!1,onClick:a,onClosed:l,"onUpdate:show":o},XA(i,u8)),{default:()=>[u(),h()]})}});function f8(){const i=Ht({show:!1}),e=n=>{i.show=n},t=n=>{Sn(i,n,{transitionAppear:!0}),e(!0)},s=()=>e(!1);return x1({open:t,close:s,toggle:e}),{open:t,close:s,state:i,toggle:e}}function d8(i){const e=e3(i),t=document.createElement("div");return document.body.appendChild(t),{instance:e.mount(t),unmount(){e.unmount(),document.body.removeChild(t)}}}const p8={icon:"",type:"text",message:"",className:"",overlay:!1,onClose:void 0,onOpened:void 0,duration:2e3,teleport:"body",iconSize:void 0,iconPrefix:void 0,position:"middle",transition:"van-fade",forbidClick:!1,loadingType:void 0,overlayClass:"",overlayStyle:void 0,closeOnClick:!1,closeOnClickOverlay:!1};let br=[],g8=!1,em=Sn({},p8);const m8=new Map;function B3(i){return hh(i)?i:{message:i}}function b8(){const{instance:i,unmount:e}=d8({setup(){const t=dt(""),{open:s,state:n,close:r,toggle:o}=f8(),a=()=>{},l=()=>ee(L3,Kn(n,{onClosed:a,"onUpdate:show":o}),null);return Vt(t,u=>{n.message=u}),Js().render=l,{open:s,close:r,message:t}}});return i}function y8(){if(!br.length||g8){const i=b8();br.push(i)}return br[br.length-1]}function nl(i={}){if(!fh)return{};const e=y8(),t=B3(i);return e.open(Sn({},em,m8.get(t.type||em.type),t)),e}const v8=i=>e=>nl(Sn({type:i},B3(e))),S8=v8("loading"),I3=i=>{br.length&&(i?(br.forEach(e=>{e.close()}),br=[]):br[0].close())};ns(L3);const[A8,bc]=ji("empty"),x8={image:si("default"),imageSize:[Number,String,Array],description:String};var w8=xt({name:A8,props:x8,setup(i,{slots:e}){const t=()=>{const b=e.description?e.description():i.description;if(b)return ee("p",{class:bc("description")},[b])},s=()=>{if(e.default)return ee("div",{class:bc("bottom")},[e.default()])},n=a8(),r=b=>`${n}-${b}`,o=b=>`url(#${r(b)})`,a=(b,y,v)=>ee("stop",{"stop-color":b,offset:`${y}%`,"stop-opacity":v},null),l=(b,y)=>[a(b,0),a(y,100)],u=b=>[ee("defs",null,[ee("radialGradient",{id:r(b),cx:"50%",cy:"54%",fx:"50%",fy:"54%",r:"297%",gradientTransform:"matrix(-.16 0 0 -.33 .58 .72)"},[a("#EBEDF0",0),a("#F2F3F5",100,.3)])]),ee("ellipse",{fill:o(b),opacity:".8",cx:"80",cy:"140",rx:"46",ry:"8"},null)],h=()=>[ee("defs",null,[ee("linearGradient",{id:r("a"),x1:"64%",y1:"100%",x2:"64%"},[a("#FFF",0,.5),a("#F2F3F5",100)])]),ee("g",{opacity:".8"},[ee("path",{d:"M36 131V53H16v20H2v58h34z",fill:o("a")},null),ee("path",{d:"M123 15h22v14h9v77h-31V15z",fill:o("a")},null)])],c=()=>[ee("defs",null,[ee("linearGradient",{id:r("b"),x1:"64%",y1:"97%",x2:"64%",y2:"0%"},[a("#F2F3F5",0,.3),a("#F2F3F5",100)])]),ee("g",{opacity:".8"},[ee("path",{d:"M87 6c3 0 7 3 8 6a8 8 0 1 1-1 16H80a7 7 0 0 1-8-6c0-4 3-7 6-7 0-5 4-9 9-9Z",fill:o("b")},null),ee("path",{d:"M19 23c2 0 3 1 4 3 2 0 4 2 4 4a4 4 0 0 1-4 3v1h-7v-1l-1 1c-2 0-3-2-3-4 0-1 1-3 3-3 0-2 2-4 4-4Z",fill:o("b")},null)])],f=()=>ee("svg",{viewBox:"0 0 160 160"},[ee("defs",null,[ee("linearGradient",{id:r(1),x1:"64%",y1:"100%",x2:"64%"},[a("#FFF",0,.5),a("#F2F3F5",100)]),ee("linearGradient",{id:r(2),x1:"50%",x2:"50%",y2:"84%"},[a("#EBEDF0",0),a("#DCDEE0",100,0)]),ee("linearGradient",{id:r(3),x1:"100%",x2:"100%",y2:"100%"},[l("#EAEDF0","#DCDEE0")]),ee("radialGradient",{id:r(4),cx:"50%",cy:"0%",fx:"50%",fy:"0%",r:"100%",gradientTransform:"matrix(0 1 -.54 0 .5 -.5)"},[a("#EBEDF0",0),a("#FFF",100,0)])]),ee("g",{fill:"none"},[h(),ee("path",{fill:o(4),d:"M0 139h160v21H0z"},null),ee("path",{d:"M80 54a7 7 0 0 1 3 13v27l-2 2h-2a2 2 0 0 1-2-2V67a7 7 0 0 1 3-13z",fill:o(2)},null),ee("g",{opacity:".6","stroke-linecap":"round","stroke-width":"7"},[ee("path",{d:"M64 47a19 19 0 0 0-5 13c0 5 2 10 5 13",stroke:o(3)},null),ee("path",{d:"M53 36a34 34 0 0 0 0 48",stroke:o(3)},null),ee("path",{d:"M95 73a19 19 0 0 0 6-13c0-5-2-9-6-13",stroke:o(3)},null),ee("path",{d:"M106 84a34 34 0 0 0 0-48",stroke:o(3)},null)]),ee("g",{transform:"translate(31 105)"},[ee("rect",{fill:"#EBEDF0",width:"98",height:"34",rx:"2"},null),ee("rect",{fill:"#FFF",x:"9",y:"8",width:"80",height:"18",rx:"1.1"},null),ee("rect",{fill:"#EBEDF0",x:"15",y:"12",width:"18",height:"6",rx:"1.1"},null)])])]),d=()=>ee("svg",{viewBox:"0 0 160 160"},[ee("defs",null,[ee("linearGradient",{x1:"50%",x2:"50%",y2:"100%",id:r(5)},[l("#F2F3F5","#DCDEE0")]),ee("linearGradient",{x1:"95%",y1:"48%",x2:"5.5%",y2:"51%",id:r(6)},[l("#EAEDF1","#DCDEE0")]),ee("linearGradient",{y1:"45%",x2:"100%",y2:"54%",id:r(7)},[l("#EAEDF1","#DCDEE0")])]),h(),c(),ee("g",{transform:"translate(36 50)",fill:"none"},[ee("g",{transform:"translate(8)"},[ee("rect",{fill:"#EBEDF0",opacity:".6",x:"38",y:"13",width:"36",height:"53",rx:"2"},null),ee("rect",{fill:o(5),width:"64",height:"66",rx:"2"},null),ee("rect",{fill:"#FFF",x:"6",y:"6",width:"52",height:"55",rx:"1"},null),ee("g",{transform:"translate(15 17)",fill:o(6)},[ee("rect",{width:"34",height:"6",rx:"1"},null),ee("path",{d:"M0 14h34v6H0z"},null),ee("rect",{y:"28",width:"34",height:"6",rx:"1"},null)])]),ee("rect",{fill:o(7),y:"61",width:"88",height:"28",rx:"1"},null),ee("rect",{fill:"#F7F8FA",x:"29",y:"72",width:"30",height:"6",rx:"1"},null)])]),p=()=>ee("svg",{viewBox:"0 0 160 160"},[ee("defs",null,[ee("linearGradient",{x1:"50%",x2:"50%",y2:"100%",id:r(8)},[l("#EAEDF1","#DCDEE0")])]),h(),c(),u("c"),ee("path",{d:"m59 60 21 21 21-21h3l9 9v3L92 93l21 21v3l-9 9h-3l-21-21-21 21h-3l-9-9v-3l21-21-21-21v-3l9-9h3Z",fill:o(8)},null)]),g=()=>ee("svg",{viewBox:"0 0 160 160"},[ee("defs",null,[ee("linearGradient",{x1:"50%",y1:"100%",x2:"50%",id:r(9)},[l("#EEE","#D8D8D8")]),ee("linearGradient",{x1:"100%",y1:"50%",y2:"50%",id:r(10)},[l("#F2F3F5","#DCDEE0")]),ee("linearGradient",{x1:"50%",x2:"50%",y2:"100%",id:r(11)},[l("#F2F3F5","#DCDEE0")]),ee("linearGradient",{x1:"50%",x2:"50%",y2:"100%",id:r(12)},[l("#FFF","#F7F8FA")])]),h(),c(),u("d"),ee("g",{transform:"rotate(-45 113 -4)",fill:"none"},[ee("rect",{fill:o(9),x:"24",y:"52.8",width:"5.8",height:"19",rx:"1"},null),ee("rect",{fill:o(10),x:"22.1",y:"67.3",width:"9.9",height:"28",rx:"1"},null),ee("circle",{stroke:o(11),"stroke-width":"8",cx:"27",cy:"27",r:"27"},null),ee("circle",{fill:o(12),cx:"27",cy:"27",r:"16"},null),ee("path",{d:"M37 7c-8 0-15 5-16 12",stroke:o(11),"stroke-width":"3",opacity:".5","stroke-linecap":"round",transform:"rotate(45 29 13)"},null)])]),m=()=>{var b;if(e.image)return e.image();const y={error:p,search:g,network:f,default:d};return((b=y[i.image])==null?void 0:b.call(y))||ee("img",{src:i.image},null)};return()=>ee("div",{class:bc()},[ee("div",{class:bc("image"),style:A1(i.imageSize)},[m()]),t(),s()])}});const R3=ns(w8),[E8,Ln]=ji("nav-bar"),P8={title:String,fixed:Boolean,zIndex:ni,border:Ys,leftText:String,rightText:String,leftArrow:Boolean,placeholder:Boolean,safeAreaInsetTop:Boolean,clickable:Ys};var _8=xt({name:E8,props:P8,emits:["clickLeft","clickRight"],setup(i,{emit:e,slots:t}){const s=dt(),n=E6(s,Ln),r=h=>e("clickLeft",h),o=h=>e("clickRight",h),a=()=>t.left?t.left():[i.leftArrow&&ee(Tr,{class:Ln("arrow"),name:"arrow-left"},null),i.leftText&&ee("span",{class:Ln("text")},[i.leftText])],l=()=>t.right?t.right():ee("span",{class:Ln("text")},[i.rightText]),u=()=>{const{title:h,fixed:c,border:f,zIndex:d}=i,p=b3(d),g=i.leftArrow||i.leftText||t.left,m=i.rightText||t.right;return ee("div",{ref:s,style:p,class:[Ln({fixed:c}),{[S6]:f,"van-safe-area-top":i.safeAreaInsetTop}]},[ee("div",{class:Ln("content")},[g&&ee("div",{class:[Ln("left"),i.clickable?sd:""],onClick:r},[a()]),ee("div",{class:[Ln("title"),"van-ellipsis"]},[t.title?t.title():h]),m&&ee("div",{class:[Ln("right"),i.clickable?sd:""],onClick:o},[l()])])])};return()=>i.fixed&&i.placeholder?n(u):u()}});const M8=ns(_8),[C8,Ra]=ji("notice-bar"),T8={text:String,mode:String,color:String,delay:ed(1),speed:ed(60),leftIcon:String,wrapable:Boolean,background:String,scrollable:{type:Boolean,default:null}};var L8=xt({name:C8,props:T8,emits:["close","replay"],setup(i,{emit:e,slots:t}){let s=0,n=0,r;const o=dt(),a=dt(),l=Ht({show:!0,offset:0,duration:0}),u=()=>{if(t["left-icon"])return t["left-icon"]();if(i.leftIcon)return ee(Tr,{class:Ra("left-icon"),name:i.leftIcon},null)},h=()=>{if(i.mode==="closeable")return"cross";if(i.mode==="link")return"arrow"},c=m=>{i.mode==="closeable"&&(l.show=!1,e("close",m))},f=()=>{if(t["right-icon"])return t["right-icon"]();const m=h();if(m)return ee(Tr,{name:m,class:Ra("right-icon"),onClick:c},null)},d=()=>{l.offset=s,l.duration=0,td(()=>{zg(()=>{l.offset=-n,l.duration=(n+s)/+i.speed,e("replay")})})},p=()=>{const m=i.scrollable===!1&&!i.wrapable,b={transform:l.offset?`translateX(${l.offset}px)`:"",transitionDuration:`${l.duration}s`};return ee("div",{ref:o,role:"marquee",class:Ra("wrap")},[ee("div",{ref:a,style:b,class:[Ra("content"),{"van-ellipsis":m}],onTransitionend:d},[t.default?t.default():i.text])])},g=()=>{const{delay:m,speed:b,scrollable:y}=i,v=Jn(m)?+m*1e3:0;s=0,n=0,l.offset=0,l.duration=0,clearTimeout(r),r=setTimeout(()=>{if(!o.value||!a.value||y===!1)return;const S=au(o).width,A=au(a).width;(y||A>S)&&zg(()=>{s=S,n=A,l.offset=-n,l.duration=n/+b})},v)};return A3(g),v1(g),dh("pageshow",g),x1({reset:g}),Vt(()=>[i.text,i.scrollable],g),()=>{const{color:m,wrapable:b,background:y}=i;return nh(ee("div",{role:"alert",class:Ra({wrapable:b}),style:{color:m,background:y}},[u(),p(),f()]),[[ch,l.show]])}}});const JI=ns(L8),[B8,I8]=ji("skeleton-title"),R8={round:Boolean,titleWidth:ni};var N8=xt({name:B8,props:R8,setup(i){return()=>ee("h3",{class:I8([{round:i.round}]),style:{width:as(i.titleWidth)}},null)}});const k8=ns(N8);var D8=k8;const[O8,F8]=ji("skeleton-avatar"),V8={avatarSize:ni,avatarShape:si("round")};var G8=xt({name:O8,props:V8,setup(i){return()=>ee("div",{class:F8([i.avatarShape]),style:A1(i.avatarSize)},null)}});const H8=ns(G8);var U8=H8;const w1="100%",z8={round:Boolean,rowWidth:{type:ni,default:w1}},[W8,Y8]=ji("skeleton-paragraph");var Q8=xt({name:W8,props:z8,setup(i){return()=>ee("div",{class:Y8([{round:i.round}]),style:{width:i.rowWidth}},null)}});const X8=ns(Q8);var j8=X8;const[K8,tm]=ji("skeleton"),J8="60%",q8={row:ed(0),round:Boolean,title:Boolean,titleWidth:ni,avatar:Boolean,avatarSize:ni,avatarShape:si("round"),loading:Ys,animate:Ys,rowWidth:{type:[Number,String,Array],default:w1}};var Z8=xt({name:K8,inheritAttrs:!1,props:q8,setup(i,{slots:e,attrs:t}){const s=()=>{if(i.avatar)return ee(U8,{avatarShape:i.avatarShape,avatarSize:i.avatarSize},null)},n=()=>{if(i.title)return ee(D8,{round:i.round,titleWidth:i.titleWidth},null)},r=l=>{const{rowWidth:u}=i;return u===w1&&l===+i.row-1?J8:Array.isArray(u)?u[l]:u},o=()=>Array(+i.row).fill("").map((l,u)=>ee(j8,{key:u,round:i.round,rowWidth:as(r(u))},null)),a=()=>e.template?e.template():ee(oi,null,[s(),ee("div",{class:tm("content")},[n(),o()])]);return()=>{var l;return i.loading?ee("div",Kn({class:tm({animate:i.animate,round:i.round})},t),[a()]):(l=e.default)==null?void 0:l.call(e)}}});const qI=ns(Z8),jt=Ht({status:"init",user:{},platformType:"STUDENT",platformApi:"/api-student",proxy:"",isApp:!1}),ZI=i=>{Object.assign(jt,i)},$I=i=>{jt.status="login",jt.user=i||{}},ph=()=>{const i=navigator.userAgent;return{trident:i.indexOf("Trident")>-1,presto:i.indexOf("Presto")>-1,webKit:i.indexOf("AppleWebKit")>-1,gecko:i.indexOf("Gecko")>-1&&i.indexOf("KHTML")==-1,mobile:!!i.match(/AppleWebKit.*Mobile.*/),ios:!!i.match(/Mac OS X/)||/(iPhone|iPad|iPod|iOS)/i.test(i),android:i.indexOf("Android")>-1||i.indexOf("Adr")>-1,iPhone:i.indexOf("ORCHESTRAAPPI")>-1,isApp:i.includes("DAYAAPPA")||i.includes("DAYAAPPI")||i.includes("COLEXIUAPPA")||i.includes("COLEXIUAPPI")||i.includes("ORCHESTRAAPPI")||i.includes("ORCHESTRAAPPA"),isTeacher:i.indexOf("ORCHESTRATEACHER")>-1||i.includes("COLEXIUTEACHER"),isStudent:i.indexOf("ORCHESTRASTUDENT")>-1||i.includes("COLEXIUSTUDENT"),isSchool:i.indexOf("ORCHESTRASCHOOL")>-1,iPad:i.indexOf("iPad")>-1,webApp:i.indexOf("Safari")==-1,weixin:i.indexOf("MicroMessenger")>-1,alipay:i.indexOf("AlipayClient")>-1,huawei:!!i.match(/huawei/i)||!!i.match(/honor/i),xiaomi:!!i.match(/mi\s/i)||!!i.match(/redmi/i)||!!i.match(/mix/i)}},$8=()=>""+Date.now()+Math.floor(Math.random()*1e6),N3="AUTHORIZATION",eR=i=>{sessionStorage.setItem(N3,i)},e7=()=>sessionStorage.getItem(N3)||"",tR=(i,e)=>{if(!i||!e)return;const t=window.GYM||{};t[i]=e,window.GYM=t},k3="BEHAVIORID",iR=i=>{localStorage.setItem(k3,i)},sR=()=>localStorage.getItem(k3),D3="CAMPID",nR=i=>{sessionStorage.setItem(D3,i)},rR=()=>sessionStorage.getItem(D3),oR=(i,e)=>{if(isNaN(i))return"00:00";let t=Math.floor(i/60/60%24),s=Math.floor(i/60%60),n=Math.floor(i%60);return e==="cn"?`${t>0?t.toString().padStart(2,"0")+"时":""}${s.toString().padStart(2,"0")}分${n.toString().padStart(2,"0")}秒`:`${t>0?t.toString().padStart(2,"0")+":":""}${s.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`},t7=window.postMessage;window.postMessage=i=>{t7(i,"*")};const lu=()=>{},mn={},gh=ph();gh.isApp&&window.addEventListener("message",i=>{var e,t;try{const s=i.data?typeof i.data=="object"?i.data:JSON.parse(i.data):{},n=((e=s.content)==null?void 0:e.uuid)||s.uuid;try{s.content&&(s.content=JSON.parse(s.content))}catch(a){}if(console.log("h5_接受_api:",s==null?void 0:s.api),!n){const a=Object.keys(mn).filter(l=>l.indexOf(s.api)===0);for(const l of a){const u=mn[l]||lu;typeof u=="function"&&u(s),Array.isArray(u)&&u.forEach(h=>{typeof h=="function"&&h(s)})}return}const r=((t=s.content)==null?void 0:t.uuid)||s.uuid||s.api+s.uuid,o=mn[r]||lu;typeof o=="function"&&o(s)}catch(s){console.error("通信消息解析错误",s)}});var Y2,Q2,X2,j2,K2,J2;const i7=window.DAYA||((Q2=(Y2=window.webkit)==null?void 0:Y2.messageHandlers)==null?void 0:Q2.DAYA)||window.COLEXIU||((j2=(X2=window.webkit)==null?void 0:X2.messageHandlers)==null?void 0:j2.COLEXIU)||window.ORCHESTRA||((J2=(K2=window.webkit)==null?void 0:K2.messageHandlers)==null?void 0:J2.ORCHESTRA),qs=(i,e)=>{if(gh.isApp){const t=$8();mn[t]=e||lu,i.content=i.content?{...i.content,uuid:t}:{uuid:t},i7.postMessage(JSON.stringify(i)),console.log("h5_请求_api:",i.api)}},O3=(i,e)=>{if(gh.isApp){const t=i;mn[t]||(mn[t]=[]),mn[t].push(e||lu)}},F3=(i,e)=>{if(gh.isApp){const t=i;if(Array.isArray(mn[t])){const s=mn[t].indexOf(e);mn[t].splice(s,1)}}},rs=i=>new Promise(e=>{qs(i,t=>e(t))}),s7=()=>jt.isApp?rs({api:"isWiredHeadsetOn"}):Promise.resolve({}),aR=()=>jt.isApp?rs({api:"isSpecialShapedScreen"}):Promise.resolve({}),n7=()=>{qs({api:"startSoundCheck"})},r7=i=>{O3("sendResult",i)},o7=i=>{F3("sendResult",i)},a7=()=>{qs({api:"endSoundCheck"})},l7=i=>jt.isApp?rs({api:"startEvaluating",content:i}):Promise.resolve({}),c7=i=>jt.isApp?rs({api:"endEvaluating",content:i}):Promise.resolve({}),u7=()=>{qs({api:"cancelEvaluating"})},h7=()=>jt.isApp?rs({api:"startRecording"}):Promise.resolve({}),f7=()=>jt.isApp?rs({api:"stopRecording"}):Promise.resolve({}),V3=i=>jt.isApp?rs({api:"proxyServiceMessage",content:i}):Promise.resolve({}),lR=()=>jt.isApp?rs({api:"videoUpdate"}):Promise.resolve({}),cR=i=>jt.isApp?rs({api:"shareAchievements",content:i}):Promise.resolve({}),d7=i=>jt.isApp?rs({api:"openWebView",content:i}):Promise.resolve({}),uR=()=>jt.isApp?rs({api:"openCamera"}):Promise.resolve({}),hR=()=>jt.isApp?rs({api:"closeCamera"}):Promise.resolve({}),fR=()=>{qs({api:"setStatusBarVisibility",content:{isVisibility:0}})},p7=i=>jt.isApp?rs({api:"cloudToggleFollow",content:{state:i}}):Promise.resolve({}),im=(i,e=!0)=>{e?O3("cloudFollowTime",i):F3("cloudFollowTime",i)},g7=()=>{qs({api:"back"})},dR=()=>{qs({api:"cloudLoading",content:{show:!1,type:"fullscreen"}})},pR=()=>{qs({api:"cloudDestroy"})},gR=()=>{qs({api:"setEventTracking",content:{type:"klx_xiaokuAI"}})},mR=i=>jt.isApp?rs({api:"savePicture",content:i}):Promise.resolve({}),bR=i=>{qs({api:"setCache",content:i})},yR=xt({name:"The-error",setup(i,e){return()=>ee("div",null,[ee(M8,{leftArrow:!0,onClickLeft:()=>{g7()}},null),ee(R3,{image:"error",description:"网络开小差,请稍后重试"},{default:()=>[ee(_3,{type:"primary",size:"small",onClick:()=>history.go(0)},{default:()=>[ya("重新加载")]})]})])}}),G3="%[a-f0-9]{2}",sm=new RegExp("("+G3+")|([^%]+?)","gi"),nm=new RegExp("("+G3+")+","gi");function nd(i,e){try{return[decodeURIComponent(i.join(""))]}catch(n){}if(i.length===1)return i;e=e||1;const t=i.slice(0,e),s=i.slice(e);return Array.prototype.concat.call([],nd(t),nd(s))}function m7(i){try{return decodeURIComponent(i)}catch(e){let t=i.match(sm)||[];for(let s=1;si==null,A7=i=>encodeURIComponent(i).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),rd=Symbol("encodeFragmentIdentifier");function x7(i){switch(i.arrayFormat){case"index":return e=>(t,s)=>{const n=t.length;return s===void 0||i.skipNull&&s===null||i.skipEmptyString&&s===""?t:s===null?[...t,[$t(e,i),"[",n,"]"].join("")]:[...t,[$t(e,i),"[",$t(n,i),"]=",$t(s,i)].join("")]};case"bracket":return e=>(t,s)=>s===void 0||i.skipNull&&s===null||i.skipEmptyString&&s===""?t:s===null?[...t,[$t(e,i),"[]"].join("")]:[...t,[$t(e,i),"[]=",$t(s,i)].join("")];case"colon-list-separator":return e=>(t,s)=>s===void 0||i.skipNull&&s===null||i.skipEmptyString&&s===""?t:s===null?[...t,[$t(e,i),":list="].join("")]:[...t,[$t(e,i),":list=",$t(s,i)].join("")];case"comma":case"separator":case"bracket-separator":{const e=i.arrayFormat==="bracket-separator"?"[]=":"=";return t=>(s,n)=>n===void 0||i.skipNull&&n===null||i.skipEmptyString&&n===""?s:(n=n===null?"":n,s.length===0?[[$t(t,i),e,$t(n,i)].join("")]:[[s,$t(n,i)].join(i.arrayFormatSeparator)])}default:return e=>(t,s)=>s===void 0||i.skipNull&&s===null||i.skipEmptyString&&s===""?t:s===null?[...t,$t(e,i)]:[...t,[$t(e,i),"=",$t(s,i)].join("")]}}function w7(i){let e;switch(i.arrayFormat){case"index":return(t,s,n)=>{if(e=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),!e){n[t]=s;return}n[t]===void 0&&(n[t]={}),n[t][e[1]]=s};case"bracket":return(t,s,n)=>{if(e=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),!e){n[t]=s;return}if(n[t]===void 0){n[t]=[s];return}n[t]=[...n[t],s]};case"colon-list-separator":return(t,s,n)=>{if(e=/(:list)$/.exec(t),t=t.replace(/:list$/,""),!e){n[t]=s;return}if(n[t]===void 0){n[t]=[s];return}n[t]=[...n[t],s]};case"comma":case"separator":return(t,s,n)=>{const r=typeof s=="string"&&s.includes(i.arrayFormatSeparator),o=typeof s=="string"&&!r&&On(s,i).includes(i.arrayFormatSeparator);s=o?On(s,i):s;const a=r||o?s.split(i.arrayFormatSeparator).map(l=>On(l,i)):s===null?s:On(s,i);n[t]=a};case"bracket-separator":return(t,s,n)=>{const r=/(\[])$/.test(t);if(t=t.replace(/\[]$/,""),!r){n[t]=s&&On(s,i);return}const o=s===null?[]:s.split(i.arrayFormatSeparator).map(a=>On(a,i));if(n[t]===void 0){n[t]=o;return}n[t]=[...n[t],...o]};default:return(t,s,n)=>{if(n[t]===void 0){n[t]=s;return}n[t]=[...[n[t]].flat(),s]}}}function U3(i){if(typeof i!="string"||i.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function $t(i,e){return e.encode?e.strict?A7(i):encodeURIComponent(i):i}function On(i,e){return e.decode?y7(i):i}function z3(i){return Array.isArray(i)?i.sort():typeof i=="object"?z3(Object.keys(i)).sort((e,t)=>Number(e)-Number(t)).map(e=>i[e]):i}function W3(i){const e=i.indexOf("#");return e!==-1&&(i=i.slice(0,e)),i}function E7(i){let e="";const t=i.indexOf("#");return t!==-1&&(e=i.slice(t)),e}function rm(i,e){return e.parseNumbers&&!Number.isNaN(Number(i))&&typeof i=="string"&&i.trim()!==""?i=Number(i):e.parseBooleans&&i!==null&&(i.toLowerCase()==="true"||i.toLowerCase()==="false")&&(i=i.toLowerCase()==="true"),i}function E1(i){i=W3(i);const e=i.indexOf("?");return e===-1?"":i.slice(e+1)}function P1(i,e){e={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...e},U3(e.arrayFormatSeparator);const t=w7(e),s=Object.create(null);if(typeof i!="string"||(i=i.trim().replace(/^[?#&]/,""),!i))return s;for(const n of i.split("&")){if(n==="")continue;const r=e.decode?n.replace(/\+/g," "):n;let[o,a]=H3(r,"=");o===void 0&&(o=r),a=a===void 0?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?a:On(a,e),t(On(o,e),a,s)}for(const[n,r]of Object.entries(s))if(typeof r=="object"&&r!==null)for(const[o,a]of Object.entries(r))r[o]=rm(a,e);else s[n]=rm(r,e);return e.sort===!1?s:(e.sort===!0?Object.keys(s).sort():Object.keys(s).sort(e.sort)).reduce((n,r)=>{const o=s[r];return o&&typeof o=="object"&&!Array.isArray(o)?n[r]=z3(o):n[r]=o,n},Object.create(null))}function Y3(i,e){if(!i)return"";e={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...e},U3(e.arrayFormatSeparator);const t=o=>e.skipNull&&S7(i[o])||e.skipEmptyString&&i[o]==="",s=x7(e),n={};for(const[o,a]of Object.entries(i))t(o)||(n[o]=a);const r=Object.keys(n);return e.sort!==!1&&r.sort(e.sort),r.map(o=>{const a=i[o];return a===void 0?"":a===null?$t(o,e):Array.isArray(a)?a.length===0&&e.arrayFormat==="bracket-separator"?$t(o,e)+"[]":a.reduce(s(o),[]).join("&"):$t(o,e)+"="+$t(a,e)}).filter(o=>o.length>0).join("&")}function Q3(i,e){var n,r;e={decode:!0,...e};let[t,s]=H3(i,"#");return t===void 0&&(t=i),{url:(r=(n=t==null?void 0:t.split("?"))==null?void 0:n[0])!=null?r:"",query:P1(E1(i),e),...e&&e.parseFragmentIdentifier&&s?{fragmentIdentifier:On(s,e)}:{}}}function X3(i,e){e={encode:!0,strict:!0,[rd]:!0,...e};const t=W3(i.url).split("?")[0]||"",s=E1(i.url),n={...P1(s,{sort:!1}),...i.query};let r=Y3(n,e);r&&(r=`?${r}`);let o=E7(i.url);if(i.fragmentIdentifier){const a=new URL(t);a.hash=i.fragmentIdentifier,o=e[rd]?a.hash:`#${i.fragmentIdentifier}`}return`${t}${r}${o}`}function j3(i,e,t){t={parseFragmentIdentifier:!0,[rd]:!1,...t};const{url:s,query:n,fragmentIdentifier:r}=Q3(i,t);return X3({url:s,query:v7(n,e),fragmentIdentifier:r},t)}function P7(i,e,t){const s=Array.isArray(e)?n=>!e.includes(n):(n,r)=>!e(n,r);return j3(i,s,t)}const xl=Object.freeze(Object.defineProperty({__proto__:null,exclude:P7,extract:E1,parse:P1,parseUrl:Q3,pick:j3,stringify:Y3,stringifyUrl:X3},Symbol.toStringTag,{value:"Module"})),vR=()=>{let i={};try{i={...xl.parse(location.search),...xl.parse(location.hash.split("?")[1])}}catch(e){}return{...i}};var vt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function K3(i){if(i.__esModule)return i;var e=i.default;if(typeof e=="function"){var t=function s(){if(this instanceof s){var n=[null];n.push.apply(n,arguments);var r=Function.bind.apply(e,n);return new r}return e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(s){var n=Object.getOwnPropertyDescriptor(i,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return i[s]}})}),t}var _7=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),s=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(s)!=="[object Symbol]")return!1;var n=42;e[t]=n;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var r=Object.getOwnPropertySymbols(e);if(r.length!==1||r[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==n||o.enumerable!==!0)return!1}return!0},om=typeof Symbol<"u"&&Symbol,M7=_7,C7=function(){return typeof om!="function"||typeof Symbol!="function"||typeof om("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:M7()},T7="Function.prototype.bind called on incompatible ",tf=Array.prototype.slice,L7=Object.prototype.toString,B7="[object Function]",I7=function(e){var t=this;if(typeof t!="function"||L7.call(t)!==B7)throw new TypeError(T7+t);for(var s=tf.call(arguments,1),n,r=function(){if(this instanceof n){var h=t.apply(this,s.concat(tf.call(arguments)));return Object(h)===h?h:this}else return t.apply(e,s.concat(tf.call(arguments)))},o=Math.max(0,t.length-s.length),a=[],l=0;l"u"?tt:hn(Uint8Array),co={"%AggregateError%":typeof AggregateError>"u"?tt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?tt:ArrayBuffer,"%ArrayIteratorPrototype%":Lo?hn([][Symbol.iterator]()):tt,"%AsyncFromSyncIteratorPrototype%":tt,"%AsyncFunction%":Do,"%AsyncGenerator%":Do,"%AsyncGeneratorFunction%":Do,"%AsyncIteratorPrototype%":Do,"%Atomics%":typeof Atomics>"u"?tt:Atomics,"%BigInt%":typeof BigInt>"u"?tt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?tt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?tt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?tt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?tt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?tt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?tt:FinalizationRegistry,"%Function%":J3,"%GeneratorFunction%":Do,"%Int8Array%":typeof Int8Array>"u"?tt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?tt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?tt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Lo?hn(hn([][Symbol.iterator]())):tt,"%JSON%":typeof JSON=="object"?JSON:tt,"%Map%":typeof Map>"u"?tt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Lo?tt:hn(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?tt:Promise,"%Proxy%":typeof Proxy>"u"?tt:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?tt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?tt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Lo?tt:hn(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?tt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Lo?hn(""[Symbol.iterator]()):tt,"%Symbol%":Lo?Symbol:tt,"%SyntaxError%":na,"%ThrowTypeError%":D7,"%TypedArray%":O7,"%TypeError%":Qo,"%Uint8Array%":typeof Uint8Array>"u"?tt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?tt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?tt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?tt:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?tt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?tt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?tt:WeakSet};try{null.error}catch(i){var F7=hn(hn(i));co["%Error.prototype%"]=F7}var V7=function i(e){var t;if(e==="%AsyncFunction%")t=sf("async function () {}");else if(e==="%GeneratorFunction%")t=sf("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=sf("async function* () {}");else if(e==="%AsyncGenerator%"){var s=i("%AsyncGeneratorFunction%");s&&(t=s.prototype)}else if(e==="%AsyncIteratorPrototype%"){var n=i("%AsyncGenerator%");n&&(t=hn(n.prototype))}return co[e]=t,t},am={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Ol=_1,cu=k7,G7=Ol.call(Function.call,Array.prototype.concat),H7=Ol.call(Function.apply,Array.prototype.splice),lm=Ol.call(Function.call,String.prototype.replace),uu=Ol.call(Function.call,String.prototype.slice),U7=Ol.call(Function.call,RegExp.prototype.exec),z7=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,W7=/\\(\\)?/g,Y7=function(e){var t=uu(e,0,1),s=uu(e,-1);if(t==="%"&&s!=="%")throw new na("invalid intrinsic syntax, expected closing `%`");if(s==="%"&&t!=="%")throw new na("invalid intrinsic syntax, expected opening `%`");var n=[];return lm(e,z7,function(r,o,a,l){n[n.length]=a?lm(l,W7,"$1"):o||r}),n},Q7=function(e,t){var s=e,n;if(cu(am,s)&&(n=am[s],s="%"+n[0]+"%"),cu(co,s)){var r=co[s];if(r===Do&&(r=V7(s)),typeof r>"u"&&!t)throw new Qo("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:s,value:r}}throw new na("intrinsic "+e+" does not exist!")},M1=function(e,t){if(typeof e!="string"||e.length===0)throw new Qo("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Qo('"allowMissing" argument must be a boolean');if(U7(/^%?[^%]*%?$/,e)===null)throw new na("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var s=Y7(e),n=s.length>0?s[0]:"",r=Q7("%"+n+"%",t),o=r.name,a=r.value,l=!1,u=r.alias;u&&(n=u[0],H7(s,G7([0,1],u)));for(var h=1,c=!0;h=s.length){var g=lo(a,f);c=!!g,c&&"get"in g&&!("originalValue"in g.get)?a=g.get:a=a[f]}else c=cu(a,f),a=a[f];c&&!l&&(co[o]=a)}}return a},od={},X7={get exports(){return od},set exports(i){od=i}};(function(i){var e=_1,t=M1,s=t("%Function.prototype.apply%"),n=t("%Function.prototype.call%"),r=t("%Reflect.apply%",!0)||e.call(n,s),o=t("%Object.getOwnPropertyDescriptor%",!0),a=t("%Object.defineProperty%",!0),l=t("%Math.max%");if(a)try{a({},"a",{value:1})}catch(h){a=null}i.exports=function(c){var f=r(e,n,arguments);if(o&&a){var d=o(f,"length");d.configurable&&a(f,"length",{value:1+l(0,c.length-(arguments.length-1))})}return f};var u=function(){return r(e,s,arguments)};a?a(i.exports,"apply",{value:u}):i.exports.apply=u})(X7);var q3=M1,Z3=od,j7=Z3(q3("String.prototype.indexOf")),K7=function(e,t){var s=q3(e,!!t);return typeof s=="function"&&j7(e,".prototype.")>-1?Z3(s):s};const J7={},q7=Object.freeze(Object.defineProperty({__proto__:null,default:J7},Symbol.toStringTag,{value:"Module"})),Z7=K3(q7);var C1=typeof Map=="function"&&Map.prototype,rf=Object.getOwnPropertyDescriptor&&C1?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,hu=C1&&rf&&typeof rf.get=="function"?rf.get:null,cm=C1&&Map.prototype.forEach,T1=typeof Set=="function"&&Set.prototype,of=Object.getOwnPropertyDescriptor&&T1?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,fu=T1&&of&&typeof of.get=="function"?of.get:null,um=T1&&Set.prototype.forEach,$7=typeof WeakMap=="function"&&WeakMap.prototype,rl=$7?WeakMap.prototype.has:null,ex=typeof WeakSet=="function"&&WeakSet.prototype,ol=ex?WeakSet.prototype.has:null,tx=typeof WeakRef=="function"&&WeakRef.prototype,hm=tx?WeakRef.prototype.deref:null,ix=Boolean.prototype.valueOf,sx=Object.prototype.toString,nx=Function.prototype.toString,rx=String.prototype.match,L1=String.prototype.slice,yr=String.prototype.replace,ox=String.prototype.toUpperCase,fm=String.prototype.toLowerCase,$3=RegExp.prototype.test,dm=Array.prototype.concat,fn=Array.prototype.join,ax=Array.prototype.slice,pm=Math.floor,ad=typeof BigInt=="function"?BigInt.prototype.valueOf:null,af=Object.getOwnPropertySymbols,ld=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ra=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Bi=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ra||"symbol")?Symbol.toStringTag:null,eb=Object.prototype.propertyIsEnumerable,gm=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(i){return i.__proto__}:null);function mm(i,e){if(i===1/0||i===-1/0||i!==i||i&&i>-1e3&&i<1e3||$3.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof i=="number"){var s=i<0?-pm(-i):pm(i);if(s!==i){var n=String(s),r=L1.call(e,n.length+1);return yr.call(n,t,"$&_")+"."+yr.call(yr.call(r,/([0-9]{3})/g,"$&_"),/_$/,"")}}return yr.call(e,t,"$&_")}var cd=Z7,bm=cd.custom,ym=ib(bm)?bm:null,lx=function i(e,t,s,n){var r=t||{};if(gr(r,"quoteStyle")&&r.quoteStyle!=="single"&&r.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(gr(r,"maxStringLength")&&(typeof r.maxStringLength=="number"?r.maxStringLength<0&&r.maxStringLength!==1/0:r.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=gr(r,"customInspect")?r.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(gr(r,"indent")&&r.indent!==null&&r.indent!==" "&&!(parseInt(r.indent,10)===r.indent&&r.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(gr(r,"numericSeparator")&&typeof r.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=r.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return nb(e,r);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return a?mm(e,l):l}if(typeof e=="bigint"){var u=String(e)+"n";return a?mm(e,u):u}var h=typeof r.depth>"u"?5:r.depth;if(typeof s>"u"&&(s=0),s>=h&&h>0&&typeof e=="object")return ud(e)?"[Array]":"[Object]";var c=_x(r,s);if(typeof n>"u")n=[];else if(sb(n,e)>=0)return"[Circular]";function f(L,E,k){if(E&&(n=ax.call(n),n.push(E)),k){var Q={depth:r.depth};return gr(r,"quoteStyle")&&(Q.quoteStyle=r.quoteStyle),i(L,Q,s+1,n)}return i(L,r,s+1,n)}if(typeof e=="function"&&!vm(e)){var d=bx(e),p=yc(e,f);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(p.length>0?" { "+fn.call(p,", ")+" }":"")}if(ib(e)){var g=ra?yr.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):ld.call(e);return typeof e=="object"&&!ra?Na(g):g}if(wx(e)){for(var m="<"+fm.call(String(e.nodeName)),b=e.attributes||[],y=0;y",m}if(ud(e)){if(e.length===0)return"[]";var v=yc(e,f);return c&&!Px(v)?"["+hd(v,c)+"]":"[ "+fn.call(v,", ")+" ]"}if(hx(e)){var S=yc(e,f);return!("cause"in Error.prototype)&&"cause"in e&&!eb.call(e,"cause")?"{ ["+String(e)+"] "+fn.call(dm.call("[cause]: "+f(e.cause),S),", ")+" }":S.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+fn.call(S,", ")+" }"}if(typeof e=="object"&&o){if(ym&&typeof e[ym]=="function"&&cd)return cd(e,{depth:h-s});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(yx(e)){var A=[];return cm&&cm.call(e,function(L,E){A.push(f(E,e,!0)+" => "+f(L,e))}),Sm("Map",hu.call(e),A,c)}if(Ax(e)){var P=[];return um&&um.call(e,function(L){P.push(f(L,e))}),Sm("Set",fu.call(e),P,c)}if(vx(e))return lf("WeakMap");if(xx(e))return lf("WeakSet");if(Sx(e))return lf("WeakRef");if(dx(e))return Na(f(Number(e)));if(gx(e))return Na(f(ad.call(e)));if(px(e))return Na(ix.call(e));if(fx(e))return Na(f(String(e)));if(!ux(e)&&!vm(e)){var x=yc(e,f),M=gm?gm(e)===Object.prototype:e instanceof Object||e.constructor===Object,_=e instanceof Object?"":"null prototype",T=!M&&Bi&&Object(e)===e&&Bi in e?L1.call(kr(e),8,-1):_?"Object":"",D=M||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",C=D+(T||_?"["+fn.call(dm.call([],T||[],_||[]),": ")+"] ":"");return x.length===0?C+"{}":c?C+"{"+hd(x,c)+"}":C+"{ "+fn.call(x,", ")+" }"}return String(e)};function tb(i,e,t){var s=(t.quoteStyle||e)==="double"?'"':"'";return s+i+s}function cx(i){return yr.call(String(i),/"/g,""")}function ud(i){return kr(i)==="[object Array]"&&(!Bi||!(typeof i=="object"&&Bi in i))}function ux(i){return kr(i)==="[object Date]"&&(!Bi||!(typeof i=="object"&&Bi in i))}function vm(i){return kr(i)==="[object RegExp]"&&(!Bi||!(typeof i=="object"&&Bi in i))}function hx(i){return kr(i)==="[object Error]"&&(!Bi||!(typeof i=="object"&&Bi in i))}function fx(i){return kr(i)==="[object String]"&&(!Bi||!(typeof i=="object"&&Bi in i))}function dx(i){return kr(i)==="[object Number]"&&(!Bi||!(typeof i=="object"&&Bi in i))}function px(i){return kr(i)==="[object Boolean]"&&(!Bi||!(typeof i=="object"&&Bi in i))}function ib(i){if(ra)return i&&typeof i=="object"&&i instanceof Symbol;if(typeof i=="symbol")return!0;if(!i||typeof i!="object"||!ld)return!1;try{return ld.call(i),!0}catch(e){}return!1}function gx(i){if(!i||typeof i!="object"||!ad)return!1;try{return ad.call(i),!0}catch(e){}return!1}var mx=Object.prototype.hasOwnProperty||function(i){return i in this};function gr(i,e){return mx.call(i,e)}function kr(i){return sx.call(i)}function bx(i){if(i.name)return i.name;var e=rx.call(nx.call(i),/^function\s*([\w$]+)/);return e?e[1]:null}function sb(i,e){if(i.indexOf)return i.indexOf(e);for(var t=0,s=i.length;te.maxStringLength){var t=i.length-e.maxStringLength,s="... "+t+" more character"+(t>1?"s":"");return nb(L1.call(i,0,e.maxStringLength),e)+s}var n=yr.call(yr.call(i,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Ex);return tb(n,"single",e)}function Ex(i){var e=i.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+ox.call(e.toString(16))}function Na(i){return"Object("+i+")"}function lf(i){return i+" { ? }"}function Sm(i,e,t,s){var n=s?hd(t,s):fn.call(t,", ");return i+" ("+e+") {"+n+"}"}function Px(i){for(var e=0;e=0)return!1;return!0}function _x(i,e){var t;if(i.indent===" ")t=" ";else if(typeof i.indent=="number"&&i.indent>0)t=fn.call(Array(i.indent+1)," ");else return null;return{base:t,prev:fn.call(Array(e+1),t)}}function hd(i,e){if(i.length===0)return"";var t=` `+e.prev+e.base;return t+fn.call(i,","+t)+` `+e.prev}function yc(i,e){var t=ud(i),s=[];if(t){s.length=i.length;for(var n=0;n1;){var t=e.pop(),s=t.obj[t.prop];if($r(s)){for(var n=[],r=0;r=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||r===Hx.RFC1738&&(u===40||u===41)){a+=o.charAt(l);continue}if(u<128){a=a+sn[u];continue}if(u<2048){a=a+(sn[192|u>>6]+sn[128|u&63]);continue}if(u<55296||u>=57344){a=a+(sn[224|u>>12]+sn[128|u>>6&63]+sn[128|u&63]);continue}l+=1,u=65536+((u&1023)<<10|o.charCodeAt(l)&1023),a+=sn[240|u>>18]+sn[128|u>>12&63]+sn[128|u>>6&63]+sn[128|u&63]}return a},Xx=function(e){for(var t=[{obj:{o:e},prop:"o"}],s=[],n=0;n"u"&&(v=0)}if(typeof l=="function"?b=l(t,b):b instanceof Date?b=c(b):s==="comma"&&Fn(b)&&(b=Vc.maybeMap(b,function(Q){return Q instanceof Date?c(Q):Q})),b===null){if(r)return a&&!p?a(t,_i.encoder,g,"key",f):t;b=""}if(tw(b)||Vc.isBuffer(b)){if(a){var P=p?t:a(t,_i.encoder,g,"key",f);return[d(P)+"="+d(a(b,_i.encoder,g,"value",f))]}return[d(t)+"="+d(String(b))]}var x=[];if(typeof b>"u")return x;var M;if(s==="comma"&&Fn(b))p&&a&&(b=Vc.maybeMap(b,a)),M=[{value:b.length>0?b.join(",")||null:void 0}];else if(Fn(l))M=l;else{var _=Object.keys(b);M=u?_.sort(u):_}for(var T=n&&Fn(b)&&b.length===1?t+"[]":t,D=0;D"u"?_i.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:_i.charsetSentinel,delimiter:typeof e.delimiter>"u"?_i.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:_i.encode,encoder:typeof e.encoder=="function"?e.encoder:_i.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:_i.encodeValuesOnly,filter:r,format:s,formatter:n,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:_i.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:_i.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:_i.strictNullHandling}},nw=function(i,e){var t=i,s=sw(e),n,r;typeof s.filter=="function"?(r=s.filter,t=r("",t)):Fn(s.filter)&&(r=s.filter,n=r);var o=[];if(typeof t!="object"||t===null)return"";var a;e&&e.arrayFormat in Am?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var l=Am[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=l==="comma"&&e&&e.commaRoundTrip;n||(n=Object.keys(t)),s.sort&&n.sort(s.sort);for(var h=ab(),c=0;c0?p+d:""},oa=ob,fd=Object.prototype.hasOwnProperty,rw=Array.isArray,hi={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:oa.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},ow=function(i){return i.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},cb=function(i,e){return i&&typeof i=="string"&&e.comma&&i.indexOf(",")>-1?i.split(","):i},aw="utf8=%26%2310003%3B",lw="utf8=%E2%9C%93",cw=function(e,t){var s={},n=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,r=t.parameterLimit===1/0?void 0:t.parameterLimit,o=n.split(t.delimiter,r),a=-1,l,u=t.charset;if(t.charsetSentinel)for(l=0;l-1&&(p=rw(p)?[p]:p),fd.call(s,d)?s[d]=oa.combine(s[d],p):s[d]=p}return s},uw=function(i,e,t,s){for(var n=s?e:cb(e,t),r=i.length-1;r>=0;--r){var o,a=i[r];if(a==="[]"&&t.parseArrays)o=[].concat(n);else{o=t.plainObjects?Object.create(null):{};var l=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,u=parseInt(l,10);!t.parseArrays&&l===""?o={0:n}:!isNaN(u)&&a!==l&&String(u)===l&&u>=0&&t.parseArrays&&u<=t.arrayLimit?(o=[],o[u]=n):l!=="__proto__"&&(o[l]=n)}n=o}return n},hw=function(e,t,s,n){if(e){var r=s.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,l=s.depth>0&&o.exec(r),u=l?r.slice(0,l.index):r,h=[];if(u){if(!s.plainObjects&&fd.call(Object.prototype,u)&&!s.allowPrototypes)return;h.push(u)}for(var c=0;s.depth>0&&(l=a.exec(r))!==null&&c"u"?hi.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?hi.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:hi.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:hi.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:hi.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:hi.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:hi.comma,decoder:typeof e.decoder=="function"?e.decoder:hi.decoder,delimiter:typeof e.delimiter=="string"||oa.isRegExp(e.delimiter)?e.delimiter:hi.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:hi.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:hi.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:hi.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:hi.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:hi.strictNullHandling}},dw=function(i,e){var t=fw(e);if(i===""||i===null||typeof i>"u")return t.plainObjects?Object.create(null):{};for(var s=typeof i=="string"?cw(i,t):i,n=t.plainObjects?Object.create(null):{},r=Object.keys(s),o=0;o-1};function Fl(i){if(typeof i!="string"&&(i=String(i)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(i)||i==="")throw new TypeError('Invalid character in header field name: "'+i+'"');return i.toLowerCase()}function N1(i){return typeof i!="string"&&(i=String(i)),i}function k1(i){var e={next:function(){var t=i.shift();return{done:t===void 0,value:t}}};return es.iterable&&(e[Symbol.iterator]=function(){return e}),e}function li(i){this.map={},i instanceof li?i.forEach(function(e,t){this.append(t,e)},this):Array.isArray(i)?i.forEach(function(e){this.append(e[0],e[1])},this):i&&Object.getOwnPropertyNames(i).forEach(function(e){this.append(e,i[e])},this)}li.prototype.append=function(i,e){i=Fl(i),e=N1(e);var t=this.map[i];this.map[i]=t?t+", "+e:e};li.prototype.delete=function(i){delete this.map[Fl(i)]};li.prototype.get=function(i){return i=Fl(i),this.has(i)?this.map[i]:null};li.prototype.has=function(i){return this.map.hasOwnProperty(Fl(i))};li.prototype.set=function(i,e){this.map[Fl(i)]=N1(e)};li.prototype.forEach=function(i,e){for(var t in this.map)this.map.hasOwnProperty(t)&&i.call(e,this.map[t],t,this)};li.prototype.keys=function(){var i=[];return this.forEach(function(e,t){i.push(t)}),k1(i)};li.prototype.values=function(){var i=[];return this.forEach(function(e){i.push(e)}),k1(i)};li.prototype.entries=function(){var i=[];return this.forEach(function(e,t){i.push([t,e])}),k1(i)};es.iterable&&(li.prototype[Symbol.iterator]=li.prototype.entries);function ff(i){if(i.bodyUsed)return Promise.reject(new TypeError("Already read"));i.bodyUsed=!0}function hb(i){return new Promise(function(e,t){i.onload=function(){e(i.result)},i.onerror=function(){t(i.error)}})}function Sw(i){var e=new FileReader,t=hb(e);return e.readAsArrayBuffer(i),t}function Aw(i){var e=new FileReader,t=hb(e);return e.readAsText(i),t}function xw(i){for(var e=new Uint8Array(i),t=new Array(e.length),s=0;s-1?e:i}function fo(i,e){if(!(this instanceof fo))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e=e||{};var t=e.body;if(i instanceof fo){if(i.bodyUsed)throw new TypeError("Already read");this.url=i.url,this.credentials=i.credentials,e.headers||(this.headers=new li(i.headers)),this.method=i.method,this.mode=i.mode,this.signal=i.signal,!t&&i._bodyInit!=null&&(t=i._bodyInit,i.bodyUsed=!0)}else this.url=String(i);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new li(e.headers)),this.method=Ew(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&t)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(t),(this.method==="GET"||this.method==="HEAD")&&(e.cache==="no-store"||e.cache==="no-cache")){var s=/([?&])_=[^&]*/;if(s.test(this.url))this.url=this.url.replace(s,"$1_="+new Date().getTime());else{var n=/\?/;this.url+=(n.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}fo.prototype.clone=function(){return new fo(this,{body:this._bodyInit})};function Pw(i){var e=new FormData;return i.trim().split("&").forEach(function(t){if(t){var s=t.split("="),n=s.shift().replace(/\+/g," "),r=s.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(r))}}),e}function _w(i){var e=new li,t=i.replace(/\r?\n[\t ]+/g," ");return t.split("\r").map(function(s){return s.indexOf(` `)===0?s.substr(1,s.length):s}).forEach(function(s){var n=s.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();e.append(r,o)}}),e}fb.call(fo.prototype);function vn(i,e){if(!(this instanceof vn))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=e.status===void 0?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText===void 0?"":""+e.statusText,this.headers=new li(e.headers),this.url=e.url||"",this._initBody(i)}fb.call(vn.prototype);vn.prototype.clone=function(){return new vn(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new li(this.headers),url:this.url})};vn.error=function(){var i=new vn(null,{status:0,statusText:""});return i.type="error",i};var Mw=[301,302,303,307,308];vn.redirect=function(i,e){if(Mw.indexOf(e)===-1)throw new RangeError("Invalid status code");return new vn(null,{status:e,headers:{location:i}})};var eo=Ci.DOMException;try{new eo}catch(i){eo=function(e,t){this.message=e,this.name=t;var s=Error(e);this.stack=s.stack},eo.prototype=Object.create(Error.prototype),eo.prototype.constructor=eo}function db(i,e){return new Promise(function(t,s){var n=new fo(i,e);if(n.signal&&n.signal.aborted)return s(new eo("Aborted","AbortError"));var r=new XMLHttpRequest;function o(){r.abort()}r.onload=function(){var l={status:r.status,statusText:r.statusText,headers:_w(r.getAllResponseHeaders()||"")};l.url="responseURL"in r?r.responseURL:l.headers.get("X-Request-URL");var u="response"in r?r.response:r.responseText;setTimeout(function(){t(new vn(u,l))},0)},r.onerror=function(){setTimeout(function(){s(new TypeError("Network request failed"))},0)},r.ontimeout=function(){setTimeout(function(){s(new TypeError("Network request failed"))},0)},r.onabort=function(){setTimeout(function(){s(new eo("Aborted","AbortError"))},0)};function a(l){try{return l===""&&Ci.location.href?Ci.location.href:l}catch(u){return l}}r.open(n.method,a(n.url),!0),n.credentials==="include"?r.withCredentials=!0:n.credentials==="omit"&&(r.withCredentials=!1),"responseType"in r&&(es.blob?r.responseType="blob":es.arrayBuffer&&n.headers.get("Content-Type")&&n.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(r.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof li)?Object.getOwnPropertyNames(e.headers).forEach(function(l){r.setRequestHeader(l,N1(e.headers[l]))}):n.headers.forEach(function(l,u){r.setRequestHeader(u,l)}),n.signal&&(n.signal.addEventListener("abort",o),r.onreadystatechange=function(){r.readyState===4&&n.signal.removeEventListener("abort",o)}),r.send(typeof n._bodyInit>"u"?null:n._bodyInit)})}db.polyfill=!0;Ci.fetch||(Ci.fetch=db,Ci.Headers=li,Ci.Request=fo,Ci.Response=vn);self.fetch.bind(self);function Em(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);e&&(s=s.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),t.push.apply(t,s)}return t}function ts(i){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(i){return!1}}function Gc(i,e,t){return gb()?Gc=Reflect.construct:Gc=function(n,r,o){var a=[null];a.push.apply(a,r);var l=Function.bind.apply(n,a),u=new l;return o&&El(u,o.prototype),u},Gc.apply(null,arguments)}function Tw(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function du(i){var e=typeof Map=="function"?new Map:void 0;return du=function(s){if(s===null||!Tw(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(s))return e.get(s);e.set(s,n)}function n(){return Gc(s,arguments,wl(this).constructor)}return n.prototype=Object.create(s.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),El(n,s)},du(i)}function Lw(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Bw(i,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Lw(i)}function mb(i){var e=gb();return function(){var s=wl(i),n;if(e){var r=wl(this).constructor;n=Reflect.construct(s,arguments,r)}else n=s.apply(this,arguments);return Bw(this,n)}}function pn(i){return Iw(i)||Rw(i)||Nw(i)||kw()}function Iw(i){if(Array.isArray(i))return dd(i)}function Rw(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function Nw(i,e){if(i){if(typeof i=="string")return dd(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return dd(i,e)}}function dd(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,s=new Array(e);t1&&arguments[1]!==void 0?arguments[1]:{global:!1,core:!1,defaultInstance:!1},n=!1,r=!1,o=!1;if(typeof s=="number"?(process&&process.env,n=!0,r=!1):_r(s)==="object"&&s&&(r=s.global||!1,n=s.core||!1,o=s.defaultInstance||!1),r){i.globalMiddlewares.splice(i.globalMiddlewares.length-i.defaultGlobalMiddlewaresLength,0,t);return}if(n){i.coreMiddlewares.splice(i.coreMiddlewares.length-i.defaultCoreMiddlewaresLength,0,t);return}if(o){this.defaultMiddlewares.push(t);return}this.middlewares.push(t)}},{key:"execute",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,s=Dw([].concat(pn(this.middlewares),pn(this.defaultMiddlewares),pn(i.globalMiddlewares),pn(i.coreMiddlewares)));return s(t)}}]),i}();Ks.globalMiddlewares=[];Ks.defaultGlobalMiddlewaresLength=0;Ks.coreMiddlewares=[];Ks.defaultCoreMiddlewaresLength=0;var Ow=function(){function i(e){Vl(this,i),this.cache=new Map,this.timer={},this.extendOptions(e)}return D1(i,[{key:"extendOptions",value:function(t){this.maxCache=t.maxCache||0}},{key:"get",value:function(t){return this.cache.get(JSON.stringify(t))}},{key:"set",value:function(t,s){var n=this,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:6e4;if(this.maxCache>0&&this.cache.size>=this.maxCache){var o=pn(this.cache.keys())[0];this.cache.delete(o),this.timer[o]&&clearTimeout(this.timer[o])}var a=JSON.stringify(t);this.cache.set(a,s),r>0&&(this.timer[a]=setTimeout(function(){n.cache.delete(a),delete n.timer[a]},r))}},{key:"delete",value:function(t){var s=JSON.stringify(t);return delete this.timer[s],this.cache.delete(s)}},{key:"clear",value:function(){return this.timer={},this.cache.clear()}}]),i}(),bb=function(i){pb(t,i);var e=mb(t);function t(s,n){var r,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"RequestError";return Vl(this,t),r=e.call(this,s),r.name="RequestError",r.request=n,r.type=o,r}return t}(du(Error)),Ya=function(i){pb(t,i);var e=mb(t);function t(s,n,r,o){var a,l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"ResponseError";return Vl(this,t),a=e.call(this,n||s.statusText),a.name="ResponseError",a.data=r,a.response=s,a.request=o,a.type=l,a}return t}(du(Error));function Fw(i){return new Promise(function(e,t){var s=new FileReader;s.onload=function(){e(s.result)},s.onerror=t,s.readAsText(i,"GBK")})}function _m(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;try{return JSON.parse(i)}catch(n){if(e)throw new Ya(t,"JSON.parse fail",i,s,"ParseError")}return i}function Vw(i,e,t){return new Promise(function(s,n){setTimeout(function(){n(new bb(e||"timeout of ".concat(i,"ms exceeded"),t,"Timeout"))},i)})}function Mm(i){return new Promise(function(e,t){i.cancelToken&&i.cancelToken.promise.then(function(s){t(s)})})}var Gw=Object.prototype.toString;function yb(){var i;return typeof process<"u"&&Gw.call(process)==="[object process]"&&(i="NODE"),typeof XMLHttpRequest<"u"&&(i="BROWSER"),i}function pd(i){return _r(i)==="object"&&Object.prototype.toString.call(i)==="[object Array]"}function vb(i){return typeof URLSearchParams<"u"&&i instanceof URLSearchParams}function Hw(i){return _r(i)==="object"&&Object.prototype.toString.call(i)==="[object Date]"}function Cm(i){return i!==null&&_r(i)==="object"}function Tm(i,e){if(i)if(_r(i)!=="object"&&(i=[i]),pd(i))for(var t=0;t1&&arguments[1]!==void 0?arguments[1]:{},s=t.prefix,n=t.suffix;return s&&(e="".concat(s).concat(e)),n&&(e="".concat(e).concat(n)),{url:e,options:t}};function zw(i,e){var t=e.method,s=t===void 0?"get":t;return s.toLowerCase()==="get"}function Ww(i,e){if(!i)return e();var t=i.req;t=t===void 0?{}:t;var s=t.options,n=s===void 0?{}:s,r=t.url,o=r===void 0?"":r,a=i.cache,l=i.responseInterceptors,u=n.timeout,h=u===void 0?0:u,c=n.timeoutMessage,f=n.__umiRequestCoreType__,d=f===void 0?"normal":f,p=n.useCache,g=p===void 0?!1:p,m=n.method,b=m===void 0?"get":m,y=n.params,v=n.ttl,S=n.validateCache,A=S===void 0?zw:S;if(d!=="normal")return process&&process.env,e();var P=fetch;if(!P)throw new Error("Global fetch not exist!");var x=yb()==="BROWSER",M=A(o,n)&&g&&x;if(M){var _=a.get({url:o,params:y,method:b});if(_)return _=_.clone(),_.useCache=!0,i.res=_,e()}var T;return h>0?T=Promise.race([Mm(n),P(o,n),Vw(h,c,i.req)]):T=Promise.race([Mm(n),P(o,n)]),l.forEach(function(D){T=T.then(function(C){var L=typeof C.clone=="function"?C.clone():C;return D(L,n)})}),T.then(function(D){if(M&&D.status===200){var C=D.clone();C.useCache=!0,a.set({url:o,params:y,method:b},C,v)}return i.res=D,e()})}function Yw(i,e){var t;return e().then(function(){if(i){var s=i.res,n=s===void 0?{}:s,r=i.req,o=r===void 0?{}:r,a=o||{},l=a.options;l=l===void 0?{}:l;var u=l.responseType,h=u===void 0?"json":u,c=l.charset,f=c===void 0?"utf8":c;l.getResponse;var d=l.throwErrIfParseFail,p=d===void 0?!1:d,g=l.parseResponse,m=g===void 0?!0:g;if(m&&!(!n||!n.clone)){if(t=yb()==="BROWSER"?n.clone():n,t.useCache=n.useCache||!1,f==="gbk")try{return n.blob().then(Fw).then(function(b){return _m(b,!1,t,o)})}catch(b){throw new Ya(t,b.message,null,o,"ParseError")}else if(h==="json")return n.text().then(function(b){return _m(b,p,t,o)});try{return n[h]()}catch(b){throw new Ya(t,"responseType not support",null,o,"ParseError")}}}}).then(function(s){if(i){i.res;var n=i.req,r=n===void 0?{}:n,o=r||{},a=o.options;a=a===void 0?{}:a;var l=a.getResponse,u=l===void 0?!1:l;if(t){if(t.status>=200&&t.status<300){if(u){i.res={data:s,response:t};return}i.res=s;return}throw new Ya(t,"http error",s,r,"HttpError")}}}).catch(function(s){if(s instanceof bb||s instanceof Ya)throw s;var n=i.req,r=i.res;throw s.request=s.request||n,s.response=s.response||r,s.type=s.type||s.name,s.data=s.data||void 0,s})}function Qw(i,e){if(!i)return e();var t=i.req;t=t===void 0?{}:t;var s=t.options,n=s===void 0?{}:s,r=n.method,o=r===void 0?"get":r;if(["post","put","patch","delete"].indexOf(o.toLowerCase())===-1)return e();var a=n.requestType,l=a===void 0?"json":a,u=n.data;if(u){var h=Object.prototype.toString.call(u);h==="[object Object]"||h==="[object Array]"?l==="json"?(n.headers=ts({Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},n.headers),n.body=JSON.stringify(u)):l==="form"&&(n.headers=ts({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},n.headers),n.body=gd(u)):(n.headers=ts({Accept:"application/json"},n.headers),n.body=u)}return i.req.options=n,e()}function Xw(i,e){var t,s;if(i)if(e)t=e(i);else if(vb(i))t=i.toString();else if(pd(i))s=[],Tm(i,function(r){r===null||typeof r>"u"?s.push(r):s.push(Cm(r)?JSON.stringify(r):r)}),t=gd(s);else{s={},Tm(i,function(r,o){var a=r;r===null||typeof r>"u"?s[o]=r:Hw(r)?a=r.toISOString():pd(r)?a=r:Cm(r)&&(a=JSON.stringify(r)),s[o]=a});var n=gd(s);t=n}return t}function jw(i,e){if(!i)return e();var t=i.req;t=t===void 0?{}:t;var s=t.options,n=s===void 0?{}:s,r=n.paramsSerializer,o=n.params,a=i.req;a=a===void 0?{}:a;var l=a.url,u=l===void 0?"":l;n.method=n.method?n.method.toUpperCase():"GET",n.credentials=n.credentials||"same-origin";var h=Xw(o,r);if(i.req.originUrl=u,h){var c=u.indexOf("?")!==-1?"&":"?";i.req.url="".concat(u).concat(c).concat(h)}return i.req.options=n,e()}var Ab=[Qw,jw,Yw],xb=[Ww];Ks.globalMiddlewares=Ab;Ks.defaultGlobalMiddlewaresLength=Ab.length;Ks.coreMiddlewares=xb;Ks.defaultCoreMiddlewaresLength=xb.length;var ll=function(){function i(e){Vl(this,i),this.onion=new Ks([]),this.fetchIndex=0,this.mapCache=new Ow(e),this.initOptions=e,this.instanceRequestInterceptors=[],this.instanceResponseInterceptors=[]}return D1(i,[{key:"use",value:function(t){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{global:!1,core:!1};return this.onion.use(t,s),this}},{key:"extendOptions",value:function(t){this.initOptions=Sb(this.initOptions,t),this.mapCache.extendOptions(t)}},{key:"dealRequestInterceptors",value:function(t){var s=function(o,a){return o.then(function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return t.req.url=l.url||t.req.url,t.req.options=l.options||t.req.options,a(t.req.url,t.req.options)})},n=[].concat(pn(i.requestInterceptors),pn(this.instanceRequestInterceptors));return n.reduce(s,Promise.resolve()).then(function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return t.req.url=r.url||t.req.url,t.req.options=r.options||t.req.options,Promise.resolve()})}},{key:"request",value:function(t,s){var n=this,r=this.onion,o={req:{url:t,options:ts(ts({},s),{},{url:t})},res:null,cache:this.mapCache,responseInterceptors:[].concat(pn(i.responseInterceptors),pn(this.instanceResponseInterceptors))};if(typeof t!="string")throw new Error("url MUST be a string");return new Promise(function(a,l){n.dealRequestInterceptors(o).then(function(){return r.execute(o)}).then(function(){a(o.res)}).catch(function(u){var h=o.req.options.errorHandler;if(h)try{var c=h(u);a(c)}catch(f){l(f)}else l(u)})})}}],[{key:"requestUse",value:function(t){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{global:!0};if(typeof t!="function")throw new TypeError("Interceptor must be function!");s.global?i.requestInterceptors.push(t):this.instanceRequestInterceptors.push(t)}},{key:"responseUse",value:function(t){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{global:!0};if(typeof t!="function")throw new TypeError("Interceptor must be function!");s.global?i.responseInterceptors.push(t):this.instanceResponseInterceptors.push(t)}}]),i}();ll.requestInterceptors=[Uw];ll.responseInterceptors=[];function mh(i){this.message=i}mh.prototype.toString=function(){return this.message?"Cancel: ".concat(this.message):"Cancel"};mh.prototype.__CANCEL__=!0;function pu(i){if(typeof i!="function")throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(n){e=n});var t=this;i(function(n){t.reason||(t.reason=new mh(n),e(t.reason))})}pu.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};pu.source=function(){var e,t=new pu(function(n){e=n});return{token:t,cancel:e}};function Kw(i){return!!(i&&i.__CANCEL__)}var O1=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=new ll(e),s=function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=Sb(t.initOptions,a);return t.request(o,l)};s.use=t.use.bind(t),s.fetchIndex=t.fetchIndex,s.interceptors={request:{use:ll.requestUse.bind(t)},response:{use:ll.responseUse.bind(t)}};var n=["get","post","delete","put","patch","head","options","rpc"];return n.forEach(function(r){s[r]=function(o,a){return s(o,ts(ts({},a),{},{method:r}))}}),s.Cancel=mh,s.CancelToken=pu,s.isCancel=Kw,s.extendOptions=t.extendOptions.bind(t),s.middlewares={instance:t.onion.middlewares,defaultInstance:t.onion.defaultMiddlewares,global:Ks.globalMiddlewares,core:Ks.coreMiddlewares},s},Jw=function(e){return O1(e)};O1({parseResponse:!1});O1({});var gu={},qw={get exports(){return gu},set exports(i){gu=i}};(function(i,e){var t=9007199254740991,s="[object Arguments]",n="[object Function]",r="[object GeneratorFunction]",o="[object Map]",a="[object Object]",l="[object Promise]",u="[object Set]",h="[object WeakMap]",c="[object DataView]",f=/[\\^$.*+?()[\]{}|]/g,d=/^\[object .+?Constructor\]$/,p=typeof vt=="object"&&vt&&vt.Object===Object&&vt,g=typeof self=="object"&&self&&self.Object===Object&&self,m=p||g||Function("return this")(),b=e&&!e.nodeType&&e,y=b&&!0&&i&&!i.nodeType&&i,v=y&&y.exports===b;function S(ce,we){return ce==null?void 0:ce[we]}function A(ce){var we=!1;if(ce!=null&&typeof ce.toString!="function")try{we=!!(ce+"")}catch(Re){}return we}function P(ce,we){return function(Re){return ce(we(Re))}}var x=Function.prototype,M=Object.prototype,_=m["__core-js_shared__"],T=function(){var ce=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||"");return ce?"Symbol(src)_1."+ce:""}(),D=x.toString,C=M.hasOwnProperty,L=M.toString,E=RegExp("^"+D.call(C).replace(f,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),k=v?m.Buffer:void 0,Q=M.propertyIsEnumerable,H=k?k.isBuffer:void 0,Z=P(Object.keys,Object),J=V(m,"DataView"),le=V(m,"Map"),X=V(m,"Promise"),O=V(m,"Set"),fe=V(m,"WeakMap"),de=!Q.call({valueOf:1},"valueOf"),W=G(J),se=G(le),he=G(X),oe=G(O),be=G(fe);function Me(ce){return L.call(ce)}function ve(ce){if(!ne(ce)||w(ce))return!1;var we=ae(ce)||A(ce)?E:d;return we.test(G(ce))}function V(ce,we){var Re=S(ce,we);return ve(Re)?Re:void 0}var z=Me;(J&&z(new J(new ArrayBuffer(1)))!=c||le&&z(new le)!=o||X&&z(X.resolve())!=l||O&&z(new O)!=u||fe&&z(new fe)!=h)&&(z=function(ce){var we=L.call(ce),Re=we==a?ce.constructor:void 0,He=Re?G(Re):void 0;if(He)switch(He){case W:return c;case se:return o;case he:return l;case oe:return u;case be:return h}return we});function w(ce){return!!T&&T in ce}function U(ce){var we=ce&&ce.constructor,Re=typeof we=="function"&&we.prototype||M;return ce===Re}function G(ce){if(ce!=null){try{return D.call(ce)}catch(we){}try{return ce+""}catch(we){}}return""}function R(ce){return q(ce)&&C.call(ce,"callee")&&(!Q.call(ce,"callee")||L.call(ce)==s)}var N=Array.isArray;function F(ce){return ce!=null&&$(ce.length)&&!ae(ce)}function q(ce){return ye(ce)&&F(ce)}var j=H||Te;function K(ce){if(F(ce)&&(N(ce)||typeof ce=="string"||typeof ce.splice=="function"||j(ce)||R(ce)))return!ce.length;var we=z(ce);if(we==o||we==u)return!ce.size;if(de||U(ce))return!Z(ce).length;for(var Re in ce)if(C.call(ce,Re))return!1;return!0}function ae(ce){var we=ne(ce)?L.call(ce):"";return we==n||we==r}function $(ce){return typeof ce=="number"&&ce>-1&&ce%1==0&&ce<=t}function ne(ce){var we=typeof ce;return!!ce&&(we=="object"||we=="function")}function ye(ce){return!!ce&&typeof ce=="object"}function Te(){return!1}i.exports=K})(qw,gu);var Zw="[object Object]";function $w(i){var e=!1;if(i!=null&&typeof i.toString!="function")try{e=!!(i+"")}catch(t){}return e}function eE(i,e){return function(t){return i(e(t))}}var tE=Function.prototype,wb=Object.prototype,Eb=tE.toString,iE=wb.hasOwnProperty,sE=Eb.call(Object),nE=wb.toString,rE=eE(Object.getPrototypeOf,Object);function oE(i){return!!i&&typeof i=="object"}function aE(i){if(!oE(i)||nE.call(i)!=Zw||$w(i))return!1;var e=rE(i);if(e===null)return!0;var t=iE.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Eb.call(t)==sE}var lE=aE,mu={},cE={get exports(){return mu},set exports(i){mu=i}};(function(i,e){var t=200,s="Expected a function",n="__lodash_hash_undefined__",r=1,o=2,a=1/0,l=9007199254740991,u="[object Arguments]",h="[object Array]",c="[object Boolean]",f="[object Date]",d="[object Error]",p="[object Function]",g="[object GeneratorFunction]",m="[object Map]",b="[object Number]",y="[object Object]",v="[object Promise]",S="[object RegExp]",A="[object Set]",P="[object String]",x="[object Symbol]",M="[object WeakMap]",_="[object ArrayBuffer]",T="[object DataView]",D="[object Float32Array]",C="[object Float64Array]",L="[object Int8Array]",E="[object Int16Array]",k="[object Int32Array]",Q="[object Uint8Array]",H="[object Uint8ClampedArray]",Z="[object Uint16Array]",J="[object Uint32Array]",le=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,X=/^\w*$/,O=/^\./,fe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,de=/[\\^$.*+?()[\]{}|]/g,W=/\\(\\)?/g,se=/^\[object .+?Constructor\]$/,he=/^(?:0|[1-9]\d*)$/,oe={};oe[D]=oe[C]=oe[L]=oe[E]=oe[k]=oe[Q]=oe[H]=oe[Z]=oe[J]=!0,oe[u]=oe[h]=oe[_]=oe[c]=oe[T]=oe[f]=oe[d]=oe[p]=oe[m]=oe[b]=oe[y]=oe[S]=oe[A]=oe[P]=oe[M]=!1;var be=typeof vt=="object"&&vt&&vt.Object===Object&&vt,Me=typeof self=="object"&&self&&self.Object===Object&&self,ve=be||Me||Function("return this")(),V=e&&!e.nodeType&&e,z=V&&!0&&i&&!i.nodeType&&i,w=z&&z.exports===V,U=w&&be.process,G=function(){try{return U&&U.binding("util")}catch(I){}}(),R=G&&G.isTypedArray;function N(I,Y){for(var me=-1,xe=I?I.length:0;++me-1}function gy(I,Y){var me=this.__data__,xe=ec(me,I);return xe<0?me.push([I,Y]):me[xe][1]=Y,this}wn.prototype.clear=hy,wn.prototype.delete=fy,wn.prototype.get=dy,wn.prototype.has=py,wn.prototype.set=gy;function En(I){var Y=-1,me=I?I.length:0;for(this.clear();++YEt))return!1;var ci=Fe.get(I);if(ci&&Fe.get(Y))return ci==Y;var Oi=-1,qi=!0,ui=Qe&r?new $l:void 0;for(Fe.set(I,Y),Fe.set(Y,I);++Oi-1&&I%1==0&&I-1&&I%1==0&&I<=l}function _o(I){var Y=typeof I;return!!I&&(Y=="object"||Y=="function")}function nc(I){return!!I&&typeof I=="object"}function Gh(I){return typeof I=="symbol"||nc(I)&>.call(I)==x}var zp=R?K(R):Oy;function ev(I){return I==null?"":zy(I)}function tv(I,Y,me){var xe=I==null?void 0:Np(I,Y);return xe===void 0?me:xe}function iv(I,Y){return I!=null&&jy(I,Y,Ry)}function rc(I){return Up(I)?Cy(I):Vy(I)}function sv(I,Y,me){var xe=_n(I)||zp(I);if(Y=Fy(Y),me==null)if(xe||_o(I)){var Qe=I.constructor;xe?me=_n(I)?new Qe:[]:me=Fh(Qe)?Ty(ir(I)):{}}else me={};return(xe?N:By)(I,function(Fe,ht,Et){return Y(me,Fe,ht,Et)}),me}function nv(I){return I}function rv(I){return ic(I)?q(sc(I)):Uy(I)}i.exports=sv})(cE,mu);const uE=gu,Bm=lE,hE=mu;var Im=function i(e,{cleanKeys:t=[],cleanValues:s=[],emptyArrays:n=!0,emptyObjects:r=!0,emptyStrings:o=!0,NaNValues:a=!1,nullValues:l=!0,undefinedValues:u=!0}={}){return hE(e,(h,c,f)=>{if(!t.includes(f)&&((Array.isArray(c)||Bm(c))&&(c=i(c,{NaNValues:a,cleanKeys:t,cleanValues:s,emptyArrays:n,emptyObjects:r,emptyStrings:o,nullValues:l,undefinedValues:u})),!s.includes(c)&&!(r&&Bm(c)&&uE(c))&&!(n&&Array.isArray(c)&&!c.length)&&!(o&&c==="")&&!(a&&Number.isNaN(c))&&!(l&&c===null)&&!(u&&c===void 0))){if(Array.isArray(h))return h.push(c);h[f]=c}})};const fE=()=>({"/sysMusicScoreCategories/queryTree":"/eduMusicScore/queryTree","/sysMusicScoreAccompaniment/queryPage":xl.parse(location.search).platform?"/sysMusicScoreAccompaniment/queryPage":"/eduMusicScore/queryPage","/sysMusicScoreAccompaniment/queryPageLimit":"/eduMusicScore/queryPageLimit","/sysMusicScoreAccompaniment/querySubjectIds":"/eduMusicScore/querySubjectIds"}),Rm=fE(),dE=ph(),Pb=Jw({requestType:"form",timeout:1e4});Pb.interceptors.request.use((i,e)=>{const t=jt.proxy+jt.platformApi;jt.platformType==="WEB"&&Rm[i]&&(i=Rm[i]);const s=e7(),n={};return s&&(n.Authorization=s),{url:t+i,options:{...e,params:Im(e.params),data:Im(e.data),headers:{...e.headers,...n}}}},{global:!1});Pb.interceptors.response.use(async(i,e)=>{if(i.status>299||i.status<200){const s=i.statusText+", 状态码"+i.status;throw nl(s),new Error(s)}const t=await i.clone().json();if(t.code!==200&&t.errCode!==0){const s=t.msg||t.message||"处理失败,请重试";throw t.code===403||t.code===401||nl(s),t.code===403&&(dE.isApp?qs({api:"login"}):(jt.status="error",nl("登录过期"))),new Error(s)}return t},{global:!1});var md={},pE={get exports(){return md},set exports(i){md=i}};(function(i,e){(function(t,s){i.exports=s()})(vt,function(){var t=1e3,s=6e4,n=36e5,r="millisecond",o="second",a="minute",l="hour",u="day",h="week",c="month",f="quarter",d="year",p="date",g="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(L){var E=["th","st","nd","rd"],k=L%100;return"["+L+(E[(k-20)%10]||E[k]||E[0])+"]"}},v=function(L,E,k){var Q=String(L);return!Q||Q.length>=E?L:""+Array(E+1-Q.length).join(k)+L},S={s:v,z:function(L){var E=-L.utcOffset(),k=Math.abs(E),Q=Math.floor(k/60),H=k%60;return(E<=0?"+":"-")+v(Q,2,"0")+":"+v(H,2,"0")},m:function L(E,k){if(E.date()1)return L(J[0])}else{var le=E.name;P[le]=E,H=le}return!Q&&H&&(A=H),H||!Q&&A},_=function(L,E){if(x(L))return L.clone();var k=typeof E=="object"?E:{};return k.date=L,k.args=arguments,new D(k)},T=S;T.l=M,T.i=x,T.w=function(L,E){return _(L,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var D=function(){function L(k){this.$L=M(k.locale,null,!0),this.parse(k)}var E=L.prototype;return E.parse=function(k){this.$d=function(Q){var H=Q.date,Z=Q.utc;if(H===null)return new Date(NaN);if(T.u(H))return new Date;if(H instanceof Date)return new Date(H);if(typeof H=="string"&&!/Z$/i.test(H)){var J=H.match(m);if(J){var le=J[2]-1||0,X=(J[7]||"0").substring(0,3);return Z?new Date(Date.UTC(J[1],le,J[3]||1,J[4]||0,J[5]||0,J[6]||0,X)):new Date(J[1],le,J[3]||1,J[4]||0,J[5]||0,J[6]||0,X)}}return new Date(H)}(k),this.$x=k.x||{},this.init()},E.init=function(){var k=this.$d;this.$y=k.getFullYear(),this.$M=k.getMonth(),this.$D=k.getDate(),this.$W=k.getDay(),this.$H=k.getHours(),this.$m=k.getMinutes(),this.$s=k.getSeconds(),this.$ms=k.getMilliseconds()},E.$utils=function(){return T},E.isValid=function(){return this.$d.toString()!==g},E.isSame=function(k,Q){var H=_(k);return this.startOf(Q)<=H&&H<=this.endOf(Q)},E.isAfter=function(k,Q){return _(k)=0&&c<=1){if(f._volume=c,f._muted)return f;f.usingWebAudio&&f.masterGain.gain.setValueAtTime(c,t.ctx.currentTime);for(var d=0;d=0;f--)c._howls[f].unload();return c.usingWebAudio&&c.ctx&&typeof c.ctx.close<"u"&&(c.ctx.close(),c.ctx=null,h()),c},codecs:function(c){return(this||t)._codecs[c.replace(/^x-/,"")]},_setup:function(){var c=this||t;if(c.state=c.ctx&&c.ctx.state||"suspended",c._autoSuspend(),!c.usingWebAudio)if(typeof Audio<"u")try{var f=new Audio;typeof f.oncanplaythrough>"u"&&(c._canPlayEvent="canplay")}catch(d){c.noAudio=!0}else c.noAudio=!0;try{var f=new Audio;f.muted&&(c.noAudio=!0)}catch(d){}return c.noAudio||c._setupCodecs(),c},_setupCodecs:function(){var c=this||t,f=null;try{f=typeof Audio<"u"?new Audio:null}catch(S){return c}if(!f||typeof f.canPlayType!="function")return c;var d=f.canPlayType("audio/mpeg;").replace(/^no$/,""),p=c._navigator?c._navigator.userAgent:"",g=p.match(/OPR\/([0-6].)/g),m=g&&parseInt(g[0].split("/")[1],10)<33,b=p.indexOf("Safari")!==-1&&p.indexOf("Chrome")===-1,y=p.match(/Version\/(.*?) /),v=b&&y&&parseInt(y[1],10)<15;return c._codecs={mp3:!!(!m&&(d||f.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!d,opus:!!f.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!f.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!f.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(f.canPlayType('audio/wav; codecs="1"')||f.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!f.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!f.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(f.canPlayType("audio/x-m4a;")||f.canPlayType("audio/m4a;")||f.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(f.canPlayType("audio/x-m4b;")||f.canPlayType("audio/m4b;")||f.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(f.canPlayType("audio/x-mp4;")||f.canPlayType("audio/mp4;")||f.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!v&&f.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!v&&f.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!f.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(f.canPlayType("audio/x-flac;")||f.canPlayType("audio/flac;")).replace(/^no$/,"")},c},_unlockAudio:function(){var c=this||t;if(!(c._audioUnlocked||!c.ctx)){c._audioUnlocked=!1,c.autoUnlock=!1,!c._mobileUnloaded&&c.ctx.sampleRate!==44100&&(c._mobileUnloaded=!0,c.unload()),c._scratchBuffer=c.ctx.createBuffer(1,1,22050);var f=function(d){for(;c._html5AudioPool.length"u"?v.noteOn(0):v.start(0),typeof c.ctx.resume=="function"&&c.ctx.resume(),v.onended=function(){v.disconnect(0),c._audioUnlocked=!0,document.removeEventListener("touchstart",f,!0),document.removeEventListener("touchend",f,!0),document.removeEventListener("click",f,!0),document.removeEventListener("keydown",f,!0);for(var S=0;S"u"||!t.usingWebAudio)){for(var f=0;f"u"||!t.usingWebAudio))return c.state==="running"&&c.ctx.state!=="interrupted"&&c._suspendTimer?(clearTimeout(c._suspendTimer),c._suspendTimer=null):c.state==="suspended"||c.state==="running"&&c.ctx.state==="interrupted"?(c.ctx.resume().then(function(){c.state="running";for(var f=0;f"u"&&(c="__default",!d._playLock)){for(var g=0,m=0;m0?b._seek:d._sprite[c][0]/1e3),S=Math.max(0,(d._sprite[c][0]+d._sprite[c][1])/1e3-v),A=S*1e3/Math.abs(b._rate),P=d._sprite[c][0]/1e3,x=(d._sprite[c][0]+d._sprite[c][1])/1e3;b._sprite=c,b._ended=!1;var M=function(){b._paused=!1,b._seek=v,b._start=P,b._stop=x,b._loop=!!(b._loop||d._sprite[c][2])};if(v>=x){d._ended(b);return}var _=b._node;if(d._webAudio){var T=function(){d._playLock=!1,M(),d._refreshBuffer(b);var E=b._muted||d._muted?0:b._volume;_.gain.setValueAtTime(E,t.ctx.currentTime),b._playStart=t.ctx.currentTime,typeof _.bufferSource.start>"u"?b._loop?_.bufferSource.noteGrainOn(0,v,86400):_.bufferSource.noteGrainOn(0,v,S):b._loop?_.bufferSource.start(0,v,86400):_.bufferSource.start(0,v,S),A!==1/0&&(d._endTimers[b._id]=setTimeout(d._ended.bind(d,b),A)),f||setTimeout(function(){d._emit("play",b._id),d._loadQueue()},0)};t.state==="running"&&t.ctx.state!=="interrupted"?T():(d._playLock=!0,d.once("resume",T),d._clearTimer(b._id))}else{var D=function(){_.currentTime=v,_.muted=b._muted||d._muted||t._muted||_.muted,_.volume=b._volume*t.volume(),_.playbackRate=b._rate;try{var E=_.play();if(E&&typeof Promise<"u"&&(E instanceof Promise||typeof E.then=="function")?(d._playLock=!0,M(),E.then(function(){d._playLock=!1,_._unlocked=!0,f?d._loadQueue():d._emit("play",b._id)}).catch(function(){d._playLock=!1,d._emit("playerror",b._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),b._ended=!0,b._paused=!0})):f||(d._playLock=!1,M(),d._emit("play",b._id)),_.playbackRate=b._rate,_.paused){d._emit("playerror",b._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");return}c!=="__default"||b._loop?d._endTimers[b._id]=setTimeout(d._ended.bind(d,b),A):(d._endTimers[b._id]=function(){d._ended(b),_.removeEventListener("ended",d._endTimers[b._id],!1)},_.addEventListener("ended",d._endTimers[b._id],!1))}catch(k){d._emit("playerror",b._id,k)}};_.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(_.src=d._src,_.load());var C=window&&window.ejecta||!_.readyState&&t._navigator.isCocoonJS;if(_.readyState>=3||C)D();else{d._playLock=!0,d._state="loading";var L=function(){d._state="loaded",D(),_.removeEventListener(t._canPlayEvent,L,!1)};_.addEventListener(t._canPlayEvent,L,!1),d._clearTimer(b._id)}}return b._id},pause:function(c){var f=this;if(f._state!=="loaded"||f._playLock)return f._queue.push({event:"pause",action:function(){f.pause(c)}}),f;for(var d=f._getSoundIds(c),p=0;p"u"?g._node.bufferSource.noteOff(0):g._node.bufferSource.stop(0),f._cleanBuffer(g._node)}else(!isNaN(g._node.duration)||g._node.duration===1/0)&&g._node.pause();arguments[1]||f._emit("pause",g?g._id:null)}return f},stop:function(c,f){var d=this;if(d._state!=="loaded"||d._playLock)return d._queue.push({event:"stop",action:function(){d.stop(c)}}),d;for(var p=d._getSoundIds(c),g=0;g"u"?m._node.bufferSource.noteOff(0):m._node.bufferSource.stop(0),d._cleanBuffer(m._node)):(!isNaN(m._node.duration)||m._node.duration===1/0)&&(m._node.currentTime=m._start||0,m._node.pause(),m._node.duration===1/0&&d._clearSound(m._node))),f||d._emit("stop",m._id))}return d},mute:function(c,f){var d=this;if(d._state!=="loaded"||d._playLock)return d._queue.push({event:"mute",action:function(){d.mute(c,f)}}),d;if(typeof f>"u")if(typeof c=="boolean")d._muted=c;else return d._muted;for(var p=d._getSoundIds(f),g=0;g"u"){var g=c._getSoundIds(),m=g.indexOf(f[0]);m>=0?p=parseInt(f[0],10):d=parseFloat(f[0])}else f.length>=2&&(d=parseFloat(f[0]),p=parseInt(f[1],10));var b;if(typeof d<"u"&&d>=0&&d<=1){if(c._state!=="loaded"||c._playLock)return c._queue.push({event:"volume",action:function(){c.volume.apply(c,f)}}),c;typeof p>"u"&&(c._volume=d),p=c._getSoundIds(p);for(var y=0;y"u")}}return g},_startFadeInterval:function(c,f,d,p,g,m){var b=this,y=f,v=d-f,S=Math.abs(v/.01),A=Math.max(4,S>0?p/S:p),P=Date.now();c._fadeTo=d,c._interval=setInterval(function(){var x=(Date.now()-P)/p;P=Date.now(),y+=v*x,y=Math.round(y*100)/100,v<0?y=Math.max(d,y):y=Math.min(d,y),b._webAudio?c._volume=y:b.volume(y,c._id,!0),m&&(b._volume=y),(df&&y>=d)&&(clearInterval(c._interval),c._interval=null,c._fadeTo=null,b.volume(d,c._id),b._emit("fade",c._id))},A)},_stopFade:function(c){var f=this,d=f._soundById(c);return d&&d._interval&&(f._webAudio&&d._node.gain.cancelScheduledValues(t.ctx.currentTime),clearInterval(d._interval),d._interval=null,f.volume(d._fadeTo,c),d._fadeTo=null,f._emit("fade",c)),f},loop:function(){var c=this,f=arguments,d,p,g;if(f.length===0)return c._loop;if(f.length===1)if(typeof f[0]=="boolean")d=f[0],c._loop=d;else return g=c._soundById(parseInt(f[0],10)),g?g._loop:!1;else f.length===2&&(d=f[0],p=parseInt(f[1],10));for(var m=c._getSoundIds(p),b=0;b=0?p=parseInt(f[0],10):d=parseFloat(f[0])}else f.length===2&&(d=parseFloat(f[0]),p=parseInt(f[1],10));var b;if(typeof d=="number"){if(c._state!=="loaded"||c._playLock)return c._queue.push({event:"rate",action:function(){c.rate.apply(c,f)}}),c;typeof p>"u"&&(c._rate=d),p=c._getSoundIds(p);for(var y=0;y=0?p=parseInt(f[0],10):c._sounds.length&&(p=c._sounds[0]._id,d=parseFloat(f[0]))}else f.length===2&&(d=parseFloat(f[0]),p=parseInt(f[1],10));if(typeof p>"u")return 0;if(typeof d=="number"&&(c._state!=="loaded"||c._playLock))return c._queue.push({event:"seek",action:function(){c.seek.apply(c,f)}}),c;var b=c._soundById(p);if(b)if(typeof d=="number"&&d>=0){var y=c.playing(p);y&&c.pause(p,!0),b._seek=d,b._ended=!1,c._clearTimer(p),!c._webAudio&&b._node&&!isNaN(b._node.duration)&&(b._node.currentTime=d);var v=function(){y&&c.play(p,!0),c._emit("seek",p)};if(y&&!c._webAudio){var S=function(){c._playLock?setTimeout(S,0):v()};setTimeout(S,0)}else v()}else if(c._webAudio){var A=c.playing(p)?t.ctx.currentTime-b._playStart:0,P=b._rateSeek?b._rateSeek-b._seek:0;return b._seek+(P+A*Math.abs(b._rate))}else return b._node.currentTime;return c},playing:function(c){var f=this;if(typeof c=="number"){var d=f._soundById(c);return d?!d._paused:!1}for(var p=0;p=0&&t._howls.splice(p,1);var g=!0;for(d=0;d=0){g=!1;break}return r&&g&&delete r[c._src],t.noAudio=!1,c._state="unloaded",c._sounds=[],c=null,null},on:function(c,f,d,p){var g=this,m=g["_on"+c];return typeof f=="function"&&m.push(p?{id:d,fn:f,once:p}:{id:d,fn:f}),g},off:function(c,f,d){var p=this,g=p["_on"+c],m=0;if(typeof f=="number"&&(d=f,f=null),f||d)for(m=0;m=0;m--)(!g[m].id||g[m].id===f||c==="load")&&(setTimeout(function(b){b.call(this,f,d)}.bind(p,g[m].fn),0),g[m].once&&p.off(c,g[m].fn,g[m].id));return p._loadQueue(c),p},_loadQueue:function(c){var f=this;if(f._queue.length>0){var d=f._queue[0];d.event===c&&(f._queue.shift(),f._loadQueue()),c||d.action()}return f},_ended:function(c){var f=this,d=c._sprite;if(!f._webAudio&&c._node&&!c._node.paused&&!c._node.ended&&c._node.currentTime=0;p--){if(d<=f)return;c._sounds[p]._ended&&(c._webAudio&&c._sounds[p]._node&&c._sounds[p]._node.disconnect(0),c._sounds.splice(p,1),d--)}}},_getSoundIds:function(c){var f=this;if(typeof c>"u"){for(var d=[],p=0;p=0;if(t._scratchBuffer&&c.bufferSource&&(c.bufferSource.onended=null,c.bufferSource.disconnect(0),d))try{c.bufferSource.buffer=t._scratchBuffer}catch(p){}return c.bufferSource=null,f},_clearSound:function(c){var f=/MSIE |Trident\//.test(t._navigator&&t._navigator.userAgent);f||(c.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var n=function(c){this._parent=c,this.init()};n.prototype={init:function(){var c=this,f=c._parent;return c._muted=f._muted,c._loop=f._loop,c._volume=f._volume,c._rate=f._rate,c._seek=0,c._paused=!0,c._ended=!0,c._sprite="__default",c._id=++t._counter,f._sounds.push(c),c.create(),c},create:function(){var c=this,f=c._parent,d=t._muted||c._muted||c._parent._muted?0:c._volume;return f._webAudio?(c._node=typeof t.ctx.createGain>"u"?t.ctx.createGainNode():t.ctx.createGain(),c._node.gain.setValueAtTime(d,t.ctx.currentTime),c._node.paused=!0,c._node.connect(t.masterGain)):t.noAudio||(c._node=t._obtainHtml5Audio(),c._errorFn=c._errorListener.bind(c),c._node.addEventListener("error",c._errorFn,!1),c._loadFn=c._loadListener.bind(c),c._node.addEventListener(t._canPlayEvent,c._loadFn,!1),c._endFn=c._endListener.bind(c),c._node.addEventListener("ended",c._endFn,!1),c._node.src=f._src,c._node.preload=f._preload===!0?"auto":f._preload,c._node.volume=d*t.volume(),c._node.load()),c},reset:function(){var c=this,f=c._parent;return c._muted=f._muted,c._loop=f._loop,c._volume=f._volume,c._rate=f._rate,c._seek=0,c._rateSeek=0,c._paused=!0,c._ended=!0,c._sprite="__default",c._id=++t._counter,c},_errorListener:function(){var c=this;c._parent._emit("loaderror",c._id,c._node.error?c._node.error.code:0),c._node.removeEventListener("error",c._errorFn,!1)},_loadListener:function(){var c=this,f=c._parent;f._duration=Math.ceil(c._node.duration*10)/10,Object.keys(f._sprite).length===0&&(f._sprite={__default:[0,f._duration*1e3]}),f._state!=="loaded"&&(f._state="loaded",f._emit("load"),f._loadQueue()),c._node.removeEventListener(t._canPlayEvent,c._loadFn,!1)},_endListener:function(){var c=this,f=c._parent;f._duration===1/0&&(f._duration=Math.ceil(c._node.duration*10)/10,f._sprite.__default[1]===1/0&&(f._sprite.__default[1]=f._duration*1e3),f._ended(c)),c._node.removeEventListener("ended",c._endFn,!1)}};var r={},o=function(c){var f=c._src;if(r[f]){c._duration=r[f].duration,u(c);return}if(/^data:[^;]+;base64,/.test(f)){for(var d=atob(f.split(",")[1]),p=new Uint8Array(d.length),g=0;g0?(r[f._src]=g,u(f,g)):d()};typeof Promise<"u"&&t.ctx.decodeAudioData.length===1?t.ctx.decodeAudioData(c).then(p).catch(d):t.ctx.decodeAudioData(c,p,d)},u=function(c,f){f&&!c._duration&&(c._duration=f.duration),Object.keys(c._sprite).length===0&&(c._sprite={__default:[0,c._duration*1e3]}),c._state!=="loaded"&&(c._state="loaded",c._emit("load"),c._loadQueue())},h=function(){if(t.usingWebAudio){try{typeof AudioContext<"u"?t.ctx=new AudioContext:typeof webkitAudioContext<"u"?t.ctx=new webkitAudioContext:t.usingWebAudio=!1}catch(g){t.usingWebAudio=!1}t.ctx||(t.usingWebAudio=!1);var c=/iP(hone|od|ad)/.test(t._navigator&&t._navigator.platform),f=t._navigator&&t._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),d=f?parseInt(f[1],10):null;if(c&&d&&d<9){var p=/safari/.test(t._navigator&&t._navigator.userAgent.toLowerCase());t._navigator&&!p&&(t.usingWebAudio=!1)}t.usingWebAudio&&(t.masterGain=typeof t.ctx.createGain>"u"?t.ctx.createGainNode():t.ctx.createGain(),t.masterGain.gain.setValueAtTime(t._muted?0:t._volume,t.ctx.currentTime),t.masterGain.connect(t.ctx.destination)),t._setup()}};i.Howler=t,i.Howl=s,typeof vt<"u"?(vt.HowlerGlobal=e,vt.Howler=t,vt.Howl=s,vt.Sound=n):typeof window<"u"&&(window.HowlerGlobal=e,window.Howler=t,window.Howl=s,window.Sound=n)})();/*! * Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported. * * howler.js v2.2.3 * howlerjs.com * * (c) 2013-2020, James Simpson of GoldFire Studios * goldfirestudios.com * * MIT License */(function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(t){var s=this;if(!s.ctx||!s.ctx.listener)return s;for(var n=s._howls.length-1;n>=0;n--)s._howls[n].stereo(t);return s},HowlerGlobal.prototype.pos=function(t,s,n){var r=this;if(!r.ctx||!r.ctx.listener)return r;if(s=typeof s!="number"?r._pos[1]:s,n=typeof n!="number"?r._pos[2]:n,typeof t=="number")r._pos=[t,s,n],typeof r.ctx.listener.positionX<"u"?(r.ctx.listener.positionX.setTargetAtTime(r._pos[0],Howler.ctx.currentTime,.1),r.ctx.listener.positionY.setTargetAtTime(r._pos[1],Howler.ctx.currentTime,.1),r.ctx.listener.positionZ.setTargetAtTime(r._pos[2],Howler.ctx.currentTime,.1)):r.ctx.listener.setPosition(r._pos[0],r._pos[1],r._pos[2]);else return r._pos;return r},HowlerGlobal.prototype.orientation=function(t,s,n,r,o,a){var l=this;if(!l.ctx||!l.ctx.listener)return l;var u=l._orientation;if(s=typeof s!="number"?u[1]:s,n=typeof n!="number"?u[2]:n,r=typeof r!="number"?u[3]:r,o=typeof o!="number"?u[4]:o,a=typeof a!="number"?u[5]:a,typeof t=="number")l._orientation=[t,s,n,r,o,a],typeof l.ctx.listener.forwardX<"u"?(l.ctx.listener.forwardX.setTargetAtTime(t,Howler.ctx.currentTime,.1),l.ctx.listener.forwardY.setTargetAtTime(s,Howler.ctx.currentTime,.1),l.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),l.ctx.listener.upX.setTargetAtTime(r,Howler.ctx.currentTime,.1),l.ctx.listener.upY.setTargetAtTime(o,Howler.ctx.currentTime,.1),l.ctx.listener.upZ.setTargetAtTime(a,Howler.ctx.currentTime,.1)):l.ctx.listener.setOrientation(t,s,n,r,o,a);else return u;return l},Howl.prototype.init=function(t){return function(s){var n=this;return n._orientation=s.orientation||[1,0,0],n._stereo=s.stereo||null,n._pos=s.pos||null,n._pannerAttr={coneInnerAngle:typeof s.coneInnerAngle<"u"?s.coneInnerAngle:360,coneOuterAngle:typeof s.coneOuterAngle<"u"?s.coneOuterAngle:360,coneOuterGain:typeof s.coneOuterGain<"u"?s.coneOuterGain:0,distanceModel:typeof s.distanceModel<"u"?s.distanceModel:"inverse",maxDistance:typeof s.maxDistance<"u"?s.maxDistance:1e4,panningModel:typeof s.panningModel<"u"?s.panningModel:"HRTF",refDistance:typeof s.refDistance<"u"?s.refDistance:1,rolloffFactor:typeof s.rolloffFactor<"u"?s.rolloffFactor:1},n._onstereo=s.onstereo?[{fn:s.onstereo}]:[],n._onpos=s.onpos?[{fn:s.onpos}]:[],n._onorientation=s.onorientation?[{fn:s.onorientation}]:[],t.call(this,s)}}(Howl.prototype.init),Howl.prototype.stereo=function(t,s){var n=this;if(!n._webAudio)return n;if(n._state!=="loaded")return n._queue.push({event:"stereo",action:function(){n.stereo(t,s)}}),n;var r=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof s>"u")if(typeof t=="number")n._stereo=t,n._pos=[t,0,0];else return n._stereo;for(var o=n._getSoundIds(s),a=0;a"u")if(typeof t=="number")o._pos=[t,s,n];else return o._pos;for(var a=o._getSoundIds(r),l=0;l"u")if(typeof t=="number")o._orientation=[t,s,n];else return o._orientation;for(var a=o._getSoundIds(r),l=0;l"u"&&(n.pannerAttr||(n.pannerAttr={coneInnerAngle:n.coneInnerAngle,coneOuterAngle:n.coneOuterAngle,coneOuterGain:n.coneOuterGain,distanceModel:n.distanceModel,maxDistance:n.maxDistance,refDistance:n.refDistance,rolloffFactor:n.rolloffFactor,panningModel:n.panningModel}),t._pannerAttr={coneInnerAngle:typeof n.pannerAttr.coneInnerAngle<"u"?n.pannerAttr.coneInnerAngle:t._coneInnerAngle,coneOuterAngle:typeof n.pannerAttr.coneOuterAngle<"u"?n.pannerAttr.coneOuterAngle:t._coneOuterAngle,coneOuterGain:typeof n.pannerAttr.coneOuterGain<"u"?n.pannerAttr.coneOuterGain:t._coneOuterGain,distanceModel:typeof n.pannerAttr.distanceModel<"u"?n.pannerAttr.distanceModel:t._distanceModel,maxDistance:typeof n.pannerAttr.maxDistance<"u"?n.pannerAttr.maxDistance:t._maxDistance,refDistance:typeof n.pannerAttr.refDistance<"u"?n.pannerAttr.refDistance:t._refDistance,rolloffFactor:typeof n.pannerAttr.rolloffFactor<"u"?n.pannerAttr.rolloffFactor:t._rolloffFactor,panningModel:typeof n.pannerAttr.panningModel<"u"?n.pannerAttr.panningModel:t._panningModel});else return o=t._soundById(parseInt(s[0],10)),o?o._pannerAttr:t._pannerAttr;else s.length===2&&(n=s[0],r=parseInt(s[1],10));for(var a=t._getSoundIds(r),l=0;l{if(!kt.lineShow)return;const i=document.querySelector("#cursorImg-0");i&&(kt.activeMetro.isRestFlag?i.classList.remove("lineHide"):i.classList.add("lineHide"))};Vt(()=>kt.lineShow,()=>{const i=document.querySelector("#cursorImg-0");if(i){const e=Ce.times[Ce.activeNoteIndex];kt.lineShow&&!e.isRestFlag?i.classList.add("lineHide"):i.classList.remove("lineHide")}});class SR{constructor(e){Cn(this,"playType","tick");Cn(this,"source",null);Cn(this,"source1",null);Cn(this,"source2",null);Cn(this,"sound",e=>{e=xE(e);let t=-1,s=-1;for(let n=0;n=r)t=n,s=r;else break}if(t>-1&&kt.activeIndex!==t){kt.activeIndex=t,kt.activeMetro=this.getStep(s),this.playAudio(),kt.isClick=!1,vE();return}kt.isClick=!1});Cn(this,"playAudio",()=>{var e;kt.initPlayerState&&(this.source=((e=kt.activeMetro)==null?void 0:e.index)===0?this.source1:this.source2,this.source.volume(kt.disable?0:.4),this.source.play())});Cn(this,"loadAudio1",()=>new Pl.Howl({src:bu.tick}));Cn(this,"loadAudio2",()=>new Pl.Howl({src:bu.tock}))}init(e){this.calculation(e),kt.activeList=[]}initPlayer(){this.source1||(this.source1=this.loadAudio1()),this.source2||(this.source2=this.loadAudio2()),kt.initPlayerState=!0}selectPlay(){}getStep(e){for(let t=0;tr.time===e);if(n)return n}return{}}calculation(e){var o,a,l,u,h,c,f,d,p,g,m,b,y,v;const t=[];let s=-1;for(let S=0;S-1&&P!=s){const M={measureNumberXML:P,measureNumberIndex:x,numerator:((f=(c=(h=A==null?void 0:A.noteElement)==null?void 0:h.sourceMeasure)==null?void 0:c.ActiveTimeSignature)==null?void 0:f.numerator)||0,start:A.measures[0].time,end:A.measures[A.measures.length-1].endtime,time:A.measures[A.measures.length-1].endtime-A.measures[0].time,stave_x:((b=(m=(g=(p=(d=A==null?void 0:A.noteElement)==null?void 0:d.sourceMeasure)==null?void 0:p.verticalMeasureList)==null?void 0:g[0])==null?void 0:m.stave)==null?void 0:b.x)||0,end_x:((y=A==null?void 0:A.stave)==null?void 0:y.end_x)||0||0,stepList:[],svgs:[],isRestFlag:A.isRestFlag};if([121].includes(Ce.subjectId)){const _=e.filter(T=>{var D,C;return((C=(D=T==null?void 0:T.noteElement)==null?void 0:D.sourceMeasure)==null?void 0:C.measureListIndex)==x});A.measures=_,M.start=A.measures[0].time,M.end=A.measures[A.measures.length-1].endtime,M.time=A.measures[A.measures.length-1].endtime-A.measures[0].time;try{const T=A.noteElement.sourceMeasure.verticalMeasureList.reduce((C,L)=>(C.push(...L.vfVoices[1].tickables),C),[]),D=[];M.svgs=T.map(C=>{const L=C.getBoundingBox().x;if(!D.includes(L)&&C.duration!=="w")return D.push(L),C._start_x=L,C}).filter(Boolean).sort((C,L)=>C._start_x-L._start_x)}catch(T){console.log(T)}M.stepList=AE(A.measures,M)}else M.stepList=SE(A.measures,M);t.push(M),s=P}}let n=[];const r=[];try{for(let S=0;S-1?`${C} + ${M}%`:`${C}px + ${M}%`:`${M}%`,A.stepList[_]=D}r[S].push({index:_,time:T,left:(D==null?void 0:D.indexOf("%"))>-1?`calc(${D})`:D,measureNumberXML:A.measureNumberXML,isRestFlag:A.isRestFlag})}}}catch(S){console.log(S)}kt.metroList=n,kt.metroMeasure=r,kt.activeMetro=((v=r[0])==null?void 0:v[0])||{}}}function SE(i,e){var a,l,u,h,c,f,d,p,g,m,b,y,v,S,A,P,x,M,_,T,D,C,L,E,k,Q,H,Z,J,le,X,O,fe,de,W,se,he,oe,be,Me,ve,V,z,w,U;const s=i.reduce((G,R)=>(G+=R._noteLength,G),0)/e.numerator;if(i.length===1){const G=i[0].svgElement;if(G&&!G.isRest()){const R=((c=(h=(u=(l=(a=G==null?void 0:G.attrs)==null?void 0:a.el)==null?void 0:l.parentElement)==null?void 0:u.parentElement)==null?void 0:h.getBoundingClientRect)==null?void 0:c.call(h))||{x:0,right:0};let N=((p=(d=(f=G==null?void 0:G.attrs)==null?void 0:f.el)==null?void 0:d.getBoundingClientRect)==null?void 0:p.call(d))||{x:0},F=Math.abs(R.right-N.x)/e.numerator,q=[];for(let j=0;j=1){n-=s;const q=((C=(D=(T=(_=(M=(x=R==null?void 0:R.svgElement)==null?void 0:x.attrs)==null?void 0:M.el)==null?void 0:_.parentElement)==null?void 0:T.parentElement)==null?void 0:D.getBoundingClientRect)==null?void 0:C.call(D))||{x:0};if(r.length>0){let $=((H=(Q=(k=(E=(L=r[0])==null?void 0:L.svgElement)==null?void 0:E.attrs)==null?void 0:k.el)==null?void 0:Q.getBoundingClientRect)==null?void 0:H.call(Q))||{x:0},ne=$.x-q.x;if(r[0]._noteLength/s>=1){const ye=((O=(X=(le=(J=(Z=i[r[0].index+1])==null?void 0:Z.svgElement)==null?void 0:J.attrs)==null?void 0:le.el)==null?void 0:X.getBoundingClientRect)==null?void 0:O.call(X))||{x:q.right},Te=Math.abs($.x-ye.x)/2;ne=$.x-q.x+Te}o.push(ne)}else{let ne=(((se=(W=(de=(fe=R==null?void 0:R.svgElement)==null?void 0:fe.attrs)==null?void 0:de.el)==null?void 0:W.getBoundingClientRect)==null?void 0:se.call(W))||{x:0}).x-q.x;o.push(ne)}r=[];let j=((Me=(be=(oe=(he=R==null?void 0:R.svgElement)==null?void 0:he.attrs)==null?void 0:oe.el)==null?void 0:be.getBoundingClientRect)==null?void 0:Me.call(be))||{x:0},K=j.x-q.x,ae=0;if(F>1){const $=((U=(w=(z=(V=(ve=i[G+1])==null?void 0:ve.svgElement)==null?void 0:V.attrs)==null?void 0:z.el)==null?void 0:w.getBoundingClientRect)==null?void 0:U.call(w))||{x:q.right};ae=Math.abs(j.x-$.x)/F}for(let $=1;$Number.EPSILON&&n>0&&r.push(R)}return o=o.reduce((G,R)=>(G.includes(R)?G.push(void 0):G.push(R),G),[]),o}function AE(i,e){var a,l,u,h,c,f,d,p,g,m,b,y,v,S,A,P,x,M,_;const t=e.time/e.numerator,s=((d=(f=(c=(h=(u=(l=(a=i[0])==null?void 0:a.svgElement)==null?void 0:l.attrs)==null?void 0:u.el)==null?void 0:h.parentElement)==null?void 0:c.parentElement)==null?void 0:f.getBoundingClientRect)==null?void 0:d.call(f))||{x:0};if(i.length===1){const T=e.svgs[0];let D=((m=(g=(p=T==null?void 0:T.attrs)==null?void 0:p.el)==null?void 0:g.getBoundingClientRect)==null?void 0:m.call(g))||{x:0};return T&&!T.isRest()?[D.x-s.x]:[]}let n=0,r=[],o=[];for(let T=0;Tt){n-=t;let k=E.x-s.x;r.length>0&&(L=(A=(S=e.svgs[r[0]._index])==null?void 0:S.attrs)==null?void 0:A.el,E=((P=L==null?void 0:L.getBoundingClientRect)==null?void 0:P.call(L))||{x:0},k=E.x-s.x),o.push(k),r=[]}else r.push(D);if(Math.abs(n-t)<.001){let k=E.x-s.x;r.length>0&&(L=(M=(x=e.svgs[r[0]._index])==null?void 0:x.attrs)==null?void 0:M.el,E=((_=L==null?void 0:L.getBoundingClientRect)==null?void 0:_.call(L))||{x:0},k=E.x-s.x),o.push(k),n=0,r=[]}}return o=o.reduce((T,D)=>(T.includes(D)?T.push(void 0):T.push(D),T),[]),o}function xE(i){return Ac.huawei||Ac.xiaomi?i+=.125:Ac.android?i+=.11:Ac.ios&&(i+=.01),i}var _b=(i=>(i[i.BASE=0]="BASE",i[i.ENSEMBLE=1]="ENSEMBLE",i))(_b||{}),Mb={locks:{},zIndex:2e3,enableRipple:!0};Ht(Mb);const uo=Ht(Mb),Ts=i=>typeof i=="string",wE=i=>typeof i=="boolean",Cb=i=>typeof i=="number",EE=i=>Object.prototype.toString.call(i)==="[object Object]",AR=i=>typeof i=="function",F1=i=>Array.isArray(i),PE=i=>i?/^(http)|(\.*\/)/.test(i):!1,Xo=i=>i==null?0:Ts(i)?(i=parseFloat(i),i=Number.isNaN(i)?0:i,i):wE(i)?Number(i):i,Tb=()=>typeof window<"u",xR=i=>i.replace(/-(\w)/g,(e,t)=>t.toUpperCase());function Nm(){var{innerWidth:i,innerHeight:e}=window;return i>e?{vMin:e,vMax:i}:{vMin:i,vMax:e}}var Lb=i=>Ts(i)&&i.endsWith("rem"),_E=i=>Ts(i)&&i.endsWith("px")||Cb(i),ME=i=>Ts(i)&&i.endsWith("%"),Bb=i=>Ts(i)&&i.endsWith("vw"),Ib=i=>Ts(i)&&i.endsWith("vh"),Rb=i=>Ts(i)&&i.endsWith("vmin"),Nb=i=>Ts(i)&&i.endsWith("vmax"),CE=i=>Ts(i)&&i.startsWith("calc("),TE=i=>Ts(i)&&i.startsWith("var("),LE=i=>{if(Cb(i))return i;if(_E(i))return+i.replace("px","");if(Bb(i))return+i.replace("vw","")*window.innerWidth/100;if(Ib(i))return+i.replace("vh","")*window.innerHeight/100;if(Lb(i)){var e=+i.replace("rem",""),t=window.getComputedStyle(document.documentElement).fontSize;return e*parseFloat(t)}return Rb(i)?Nm().vMin:Nb(i)?Nm().vMax:Ts(i)?Xo(i):0},kb=i=>{if(i!=null)return ME(i)||Bb(i)||Ib(i)||Lb(i)||CE(i)||TE(i)||Rb(i)||Nb(i)?i:LE(i)+"px"},BE=function(i,e){if(e===void 0&&(e=1),i!=null){var t=kb(i),s=t.match(/(vh|%|rem|px|vw)$/)[0];return""+parseFloat(t)*e+s}};function wR(){var i=typeof window<"u";return i&&"ontouchstart"in window}function Db(i){let e=!1;Cs(()=>{i(),yn(()=>{e=!0})}),vo(()=>{e&&i()})}function km(i,e,t,s={}){if(!Tb())return;const{passive:n=!1,capture:r=!1}=s;let o=!1,a=!1;const l=f=>{if(o||a)return;const d=ls(f);d&&(d.addEventListener(e,t,{passive:n,capture:r}),o=!0)},u=f=>{if(!o||a)return;const d=ls(f);d&&(d.removeEventListener(e,t,{capture:r}),o=!1)};let h;ai(i)&&(h=Vt(()=>i.value,(f,d)=>{u(d),l(f)}));const c=()=>{h==null||h(),u(i),a=!0};return Db(()=>{l(i)}),ba(()=>{u(i)}),Rr(()=>{u(i)}),c}var IE=globalThis&&globalThis.__rest||function(i,e){var t={};for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&e.indexOf(s)<0&&(t[s]=i[s]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,s=Object.getOwnPropertySymbols(i);nt.indexOf(o)),parentProvider:r,bindParent:u=>{Cs(()=>{yn().then(()=>{s(o,u)})}),ba(()=>{yn().then(()=>{n(o,u)})})}}}function Dm(i,e,t,s,n,r,o){try{var a=i[r](o),l=a.value}catch(u){t(u);return}a.done?e(l):Promise.resolve(l).then(s,n)}function Om(i){return function(){var e=this,t=arguments;return new Promise(function(s,n){var r=i.apply(e,t);function o(l){Dm(r,s,n,o,a,"next",l)}function a(l){Dm(r,s,n,o,a,"throw",l)}o(void 0)})}}function vd(){return vd=Object.assign?Object.assign.bind():function(i){for(var e=1;e(t[s]=i[s],t),{}):i[e]}function NE(i){var e=e3(i),t=document.createElement("div");return document.body.appendChild(t),{instance:e.mount(t),unmount(){e.unmount(),document.body.removeChild(t)}}}function kE(i,e,t){e===void 0&&(e={}),t===void 0&&(t={});var s={setup(){return()=>lh(i,vd({},e,t))}},{unmount:n}=NE(s);return{unmountInstance:n}}function PR(){var i=dt(""),e=function(){var n=Om(function*(r,o,a){if(!F1(r)||!r.length)return!0;var l=yield Promise.all(r.map(u=>u(o,a)));return!l.some(u=>u!==!0?(i.value=String(u),!0):!1)});return function(o,a,l){return n.apply(this,arguments)}}(),t=()=>{i.value=""},s=function(){var n=Om(function*(r,o,a,l,u){r.includes(o)&&(yield e(a,l,u))&&(i.value="")});return function(o,a,l,u,h){return n.apply(this,arguments)}}();return{errorMessage:i,validate:e,resetValidation:t,validateWithTrigger:s}}function _R(i){Tb()&&(km(window,"hashchange",i),km(window,"popstate",i))}function DE(){var i=dt(!1);return vo(()=>{i.value=!1}),Rr(()=>{i.value=!0}),{disabled:i}}function bh(i){var e="var",t=e+"-"+i,s=r=>r?r[0]==="$"?r.replace("$",e):r.startsWith("--")?""+t+r:t+"__"+r:t,n=function(){for(var r=arguments.length,o=new Array(r),a=0;a{if(F1(l)){var[u,h,c=null]=l;return u?h:c}return l})};return{n:s,classes:n}}function vr(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),s=1;sn(...t));if(i)return i(...t)}function Oo(i){return{type:[Function,Array],default:i}}function Ob(){var i=Object.keys(uo.locks).length;i<=0?document.body.classList.remove("var--lock"):document.body.classList.add("var--lock")}function wc(i){uo.locks[i]=1,Ob()}function Ec(i){delete uo.locks[i],Ob()}function OE(i,e){var{uid:t}=Js();e&&Vt(e,s=>{s===!1?Ec(t):s===!0&&i()===!0&&wc(t)}),Vt(i,s=>{e&&e()===!1||(s===!0?wc(t):Ec(t))}),c1(()=>{e&&e()===!1||i()===!0&&wc(t)}),Nr(()=>{e&&e()===!1||i()===!0&&Ec(t)}),vo(()=>{e&&e()===!1||i()===!0&&wc(t)}),Rr(()=>{e&&e()===!1||i()===!0&&Ec(t)})}function FE(i,e){var t=dt(uo.zIndex);return Vt(i,s=>{s&&(uo.zIndex+=e,t.value=uo.zIndex)},{immediate:!0}),{zIndex:t}}var VE={name:{type:String},size:{type:[Number,String]},color:{type:String},namespace:{type:String,default:"var-icon"},transition:{type:[Number,String],default:0},animationClass:{type:String},onClick:Oo()};function Fm(i,e,t,s,n,r,o){try{var a=i[r](o),l=a.value}catch(u){t(u);return}a.done?e(l):Promise.resolve(l).then(s,n)}function GE(i){return function(){var e=this,t=arguments;return new Promise(function(s,n){var r=i.apply(e,t);function o(l){Fm(r,s,n,o,a,"next",l)}function a(l){Fm(r,s,n,o,a,"throw",l)}o(void 0)})}}var{n:HE,classes:UE}=bh("icon");function zE(i,e){return fi(),$o(B5(i.isURL(i.name)?"img":"i"),{class:xi(i.classes(i.n(),[i.namespace!==i.n(),i.namespace],i.namespace+"--set",[i.isURL(i.name),i.n("image"),i.namespace+"-"+i.nextName],[i.animateInProgress,i.animationClass==null?i.n("--shrinking"):i.animationClass])),style:Qn({color:i.color,"transition-duration":i.toNumber(i.transition)+"ms",width:i.isURL(i.name)?i.toSizeUnit(i.size):null,height:i.isURL(i.name)?i.toSizeUnit(i.size):null,fontSize:i.toSizeUnit(i.size)}),src:i.isURL(i.name)?i.nextName:null,onClick:i.onClick},null,8,["class","style","src","onClick"])}var Fb=xt({name:"VarIcon",props:VE,setup(i){var e=dt(""),t=dt(!1),s=function(){var n=GE(function*(r,o){var{transition:a}=i;if(o==null||Xo(a)===0){e.value=r;return}t.value=!0,yield yn(),setTimeout(()=>{o!=null&&(e.value=r),t.value=!1},Xo(a))});return function(o,a){return n.apply(this,arguments)}}();return Vt(()=>i.name,s,{immediate:!0}),{n:HE,classes:UE,nextName:e,animateInProgress:t,isURL:PE,toNumber:Xo,toSizeUnit:kb}}});Fb.render=zE;const Hc=Fb;Hc.install=function(i){i.component(Hc.name,Hc)};function WE(i){return["circle","wave","cube","rect","disappear"].includes(i)}function YE(i){return["normal","mini","small","large"].includes(i)}var Qa={type:{type:String,default:"circle",validator:WE},radius:{type:[String,Number]},size:{type:String,default:"normal",validator:YE},color:{type:String},description:{type:String},loading:{type:Boolean,default:!1}},{n:QE,classes:XE}=bh("loading"),jE=i=>(d5(""),i=i(),p5(),i),KE=jE(()=>Pr("svg",{viewBox:"25 25 50 50"},[Pr("circle",{cx:"50",cy:"50",r:"20",fill:"none"})],-1)),JE=[KE];function qE(i,e){return fi(),ps("div",{class:xi(i.n())},[i.$slots.default?(fi(),ps("div",{key:0,class:xi(i.classes(i.n("content"),[i.loading,i.n("content--active")]))},[Zo(i.$slots,"default"),i.loading?(fi(),ps("div",{key:0,class:xi(i.n("content-mask"))},null,2)):fr("v-if",!0)],2)):fr("v-if",!0),i.isShow?(fi(),ps("div",{key:1,class:xi(i.classes(i.n("$--box"),i.n("body"),[i.$slots.default,i.n("inside")]))},[i.type==="circle"?(fi(),ps("div",{key:0,class:xi(i.n("circle"))},[Pr("span",{class:xi(i.classes(i.n("circle-block"),i.n("circle-block--"+i.size))),style:Qn({width:i.multiplySizeUnit(i.radius,2),height:i.multiplySizeUnit(i.radius,2),color:i.color})},JE,6)],2)):fr("v-if",!0),(fi(!0),ps(oi,null,sg(i.loadingTypeDict,(t,s)=>(fi(),ps(oi,{key:s},[i.type===s?(fi(),ps("div",{key:0,class:xi(i.classes(i.n(s),i.n(s+"--"+i.size)))},[(fi(!0),ps(oi,null,sg(t,n=>(fi(),ps("div",{key:n+s,style:Qn({backgroundColor:i.color}),class:xi(i.classes(i.n(s+"-item"),i.n(s+"-item--"+i.size)))},null,6))),128))],2)):fr("v-if",!0)],64))),128)),i.$slots.description||i.description?(fi(),ps("div",{key:1,class:xi(i.classes(i.n("description"),i.n("description--"+i.size))),style:Qn({color:i.color})},[Zo(i.$slots,"description",{},()=>[ya(Xd(i.description),1)])],6)):fr("v-if",!0)],2)):fr("v-if",!0)],2)}var Vb=xt({name:"VarLoading",props:Qa,setup(i,e){var{slots:t}=e,s={wave:5,cube:4,rect:8,disappear:3},n=Ft(()=>vr(t.default)?i.loading:!0);return{n:QE,classes:XE,multiplySizeUnit:BE,loadingTypeDict:s,isShow:n}}});Vb.render=qE;const Uc=Vb;Uc.install=function(i){i.component(Uc.name,Uc)};function Sd(){return Sd=Object.assign?Object.assign.bind():function(i){for(var e=1;e[ya(Xd(i.content),1)])],2),Pr("div",{class:xi(i.n("action"))},[i.iconName?(fi(),$o(t,{key:0,name:i.iconName},null,8,["name"])):fr("v-if",!0),i.type==="loading"?(fi(),$o(s,{key:1,type:i.loadingType,size:i.loadingSize,color:i.loadingColor,radius:i.loadingRadius},null,8,["type","size","color","radius"])):fr("v-if",!0),Zo(i.$slots,"action")],2)],6)],6)),[[ch,i.show]])}var Hb=xt({name:"VarSnackbarCore",components:{VarLoading:Uc,VarIcon:Hc},props:Gb,setup(i){var e=dt(null),{zIndex:t}=FE(()=>i.show,1);OE(()=>i.show,()=>i.lockScroll);var s=Ft(()=>i.type==="loading"||i.forbidClick),n=Ft(()=>i.type?i9[i.type]:""),r=()=>{e.value=setTimeout(()=>{i.type!=="loading"&&vr(i["onUpdate:show"],!1)},i.duration)};return Vt(()=>i.show,o=>{o?(vr(i.onOpen),r()):o===!1&&(clearTimeout(e.value),vr(i.onClose))}),Vt(()=>i._update,()=>{clearTimeout(e.value),r()}),Db(()=>{i.show&&(vr(i.onOpen),r())}),{SNACKBAR_TYPE:V1,n:e9,classes:t9,zIndex:t,iconName:n,isForbidClick:s}}});Hb.render=s9;const Ub=Hb;var{n:n9}=bh("snackbar");function r9(i,e){var t=Uf("var-snackbar-core");return fi(),$o(H0,{to:i.teleport,disabled:i.disabled},[ee(va,{name:i.n()+"-fade",onAfterEnter:i.onOpened,onAfterLeave:i.onClosed},{default:Oc(()=>[ee(t,Kn(i.$props,{class:i.n("transition")}),{action:Oc(()=>[Zo(i.$slots,"action")]),default:Oc(()=>[Zo(i.$slots,"default",{},()=>[ya(Xd(i.content),1)])]),_:3},16,["class"])]),_:3},8,["name","onAfterEnter","onAfterLeave"])],8,["to","disabled"])}var zb=xt({name:"VarSnackbar",components:{VarSnackbarCore:Ub},props:Gb,setup(){var{disabled:i}=DE();return{n:n9,disabled:i}}});zb.render=r9;const jo=zb;function _l(){return _l=Object.assign?Object.assign.bind():function(i){for(var e=1;e{},onOpened:()=>{},onClose:()=>{},onClosed:()=>{}},_s=Ht([]),G1=Yb,a9={name:"var-snackbar-fade",tag:"div",class:"var-transition-group"},l9={setup(){return()=>{var i=_s.map(e=>{var{id:t,reactiveSnackOptions:s,_update:n}=e,r=document.querySelector(".var-transition-group");s.forbidClick||s.type==="loading"?r.classList.add("var-pointer-auto"):r.classList.remove("var-pointer-auto"),aa&&(s.position="top");var o=aa?"relative":"absolute",a=_l({position:o},p9(s.position));return ee(Ub,Kn(s,{key:t,style:a,"data-id":t,_update:n,show:s.show,"onUpdate:show":l=>s.show=l}),null)});return ee(RS,Kn(a9,{style:{zIndex:uo.zIndex},onAfterEnter:c9,onAfterLeave:u9}),o9(i)?i:{default:()=>[i]})}}},qn=function(i){var e=f9(i),t=Ht(_l({},G1,e));t.show=!0,Ad||(Ad=!0,Wb=kE(l9).unmountInstance);var{length:s}=_s,n={id:Vm++,reactiveSnackOptions:t};if(s===0||aa)h9(n);else{var r="update-"+Vm;d9(t,r)}return{clear(){!aa&&_s.length?_s[0].reactiveSnackOptions.show=!1:t.show=!1}}};V1.forEach(i=>{qn[i]=e=>(EE(e)?e.type=i:e={content:e,type:i},qn(e))});qn.install=function(i){i.component(jo.name,jo)};qn.allowMultiple=function(i){i===void 0&&(i=!1),i!==aa&&(_s.forEach(e=>{e.reactiveSnackOptions.show=!1}),aa=i)};qn.clear=function(){_s.forEach(i=>{i.reactiveSnackOptions.show=!1})};qn.setDefaultOptions=function(i){G1=i};qn.resetDefaultOptions=function(){G1=Yb};qn.Component=jo;function c9(i){var e=i.getAttribute("data-id"),t=_s.find(s=>s.id===Xo(e));t&&vr(t.reactiveSnackOptions.onOpened)}function u9(i){i.parentElement&&i.parentElement.classList.remove("var-pointer-auto");var e=i.getAttribute("data-id"),t=_s.find(n=>n.id===Xo(e));t&&(t.animationEnd=!0,vr(t.reactiveSnackOptions.onClosed));var s=_s.every(n=>n.animationEnd);s&&(vr(Wb),_s=Ht([]),Ad=!1)}function h9(i){_s.push(i)}function f9(i){return i===void 0&&(i={}),Ts(i)?{content:i}:i}function d9(i,e){var[t]=_s;t.reactiveSnackOptions=_l({},t.reactiveSnackOptions,i),t._update=e}function p9(i){return i===void 0&&(i="top"),i==="bottom"?{[i]:"5%"}:{top:i==="top"?"5%":"45%"}}jo.install=function(i){i.component(jo.name,jo)};const Qb=qn,g9=""+new URL("5-d8bfbf51.png",import.meta.url).href,m9=""+new URL("4-cfa387c7.png",import.meta.url).href,b9=""+new URL("3-d02c685a.png",import.meta.url).href,y9=""+new URL("2-5c4c2ef5.png",import.meta.url).href,v9=""+new URL("1-a0d5037d.png",import.meta.url).href,S9=""+new URL("clx5-b3331931.svg",import.meta.url).href,A9=""+new URL("clx4-7a8a1657.svg",import.meta.url).href,x9=""+new URL("clx3-82262a8a.svg",import.meta.url).href,w9=""+new URL("clx2-99f2ced3.svg",import.meta.url).href,E9=""+new URL("clx1-3d063166.svg",import.meta.url).href,P9="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAACQCAMAAABOB0IDAAADAFBMVEUAAAADBBoCBhMBChQACBYABhUABhUACBYACBYDDhgABxUCCRcABxYACBYACBYABxUACBYACBYACBcABxbc4ODk5uUABxYACBbT2drKzc4ABxYACBXm6Ofo6ejR1tbP0tTn6OiiqKvN09SIkpcjOUW6wsWLmp/j5eUVIjDQ1dZ9h424vLzj5eUHHCm/x8lodn5NW2Q7TV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aryEFbHcH3ri0BxaP/gKdEB7KYrDIcgAAAABJRU5ErkJggg==",Pc={good:P9,bad:_9,perfect:M9,great:C9},Gm=[{icon:Pc.bad,text:"bad",color:"#EE4C6A"},{icon:Pc.good,text:"good",color:"#FF958B"},{icon:Pc.great,text:"great",color:"#FF8E5A"},{icon:Pc.perfect,text:"perfect",color:"#516AFF"}],T9=[{img:g9,tips:"你的演奏不太好,再练一练吧~",mome:"敢于尝试",clxImg:S9,clxtip:"你的演奏不太好,音准和完整性还需加强,再练一练吧~",clxmome:"敢于尝试"},{img:m9,tips:"你的演奏还不熟练,加紧训练才能有好成绩哦~",mome:"还要加油哦~",clxImg:A9,clxtip:"你的演奏还不熟练,音准和完整性还需加强,加紧训练才能有好成绩哦~",clxmome:"还要加油哦~"},{img:b9,tips:"你的演奏还不流畅,科学的练习才能更完美哦~",mome:"突破自我",clxImg:x9,clxtip:"你的演奏还不流畅,音准和节奏还需加强,科学的练习才能更完美哦~",clxmome:"突破自我"},{img:y9,tips:"你的演奏还不错,继续加油吧,离完美就差一步啦~",mome:"崭露头角",clxImg:w9,clxtip:"你的演奏还不错,继续加油吧,加强音准,离完美就差一步啦~",clxmome:"崭露头角"},{img:v9,tips:"你的演奏完美无缺,继续努力吧~",mome:"你很棒",clxImg:E9,clxtip:"你的演奏非常不错,音准的把握和节奏稍有瑕疵,完整性把握的很好~",clxmome:"你很棒"}],L9=i=>{if(!i&&typeof i!="number")return{};let e=0;return i>20&&i<=40?e=1:i>40&&i<=60?e=2:i>60&&i<=80?e=3:i>80&&(e=4),{...T9[e],leve:e}},B9=i=>{if(!i&&typeof i!="number")return{};let e=0;return i>=40&&i<70?e=1:i>=70&&i<90?e=2:i>=90&&(e=3),e},Ke=Ht({contentData:{},rendered:!1,earphone:!1,soundEffect:!1,soundEffectFrequency:0,checkStep:0,checkEnd:!1,earphoneMode:!1,soundEffectMode:!1,websocketState:!1,startBegin:!1,backtime:0,evaluatings:{},resultData:{},resulstMode:!1,isComplete:!1}),I9=()=>{Ce.modeType==="evaluating"?jb():W1(),Ce.modeType=Ce.modeType==="evaluating"?"practise":"evaluating",Ce.modeType!=="evaluating"&&(Ke.rendered=!1)},R9=i=>{const t=(Date.now()-Ke.backtime-i*1e3)/1e3;console.log("真正播放延迟",t/1e3),setTimeout(async()=>{await V3({header:{commond:"audioPlayStart",type:"SOUND_COMPARE"},body:{offsetTime:t<0?0:t}}),Ke.backtime=0},220)},N9=async()=>{var e;const i=await s7();return((e=i==null?void 0:i.content)==null?void 0:e.checkIsWired)||!1},k9=()=>{n7()},MR=()=>{a7()},CR=async i=>{Ke.contentData=i,Ke.websocketState=!0},Hm=async()=>{if(Ke.checkEnd=!1,Ke.checkStep===0){const i=await N9();Ke.checkStep=1,i?Hm():Ke.earphoneMode=!0;return}if(Ke.checkStep===1){Ke.checkStep=10,Ce.setting.soundEffect?(Ke.soundEffectMode=!0,k9()):Hm();return}Ke.checkStep===10&&(Ke.checkEnd=!0,Ke.checkStep=0)},D9=(i,e=!0)=>{Ke.evaluatings[i.measureRenderIndex]={...i,leve:B9(i.score),show:e}},Um=i=>{if(i!=null&&i.content){console.log("🚀 ~ 评测返回:",i);const{header:e,body:t}=i.content;e.commond==="checking"&&(Ke.soundEffectFrequency=t.frequency),(e==null?void 0:e.commond)==="measureScore"&&D9(t),(e==null?void 0:e.commond)==="overall"&&(Ke.resulstMode=!0,Ke.resultData={...t,...L9(t.score)},I3())}},TR=async()=>{Ke.isComplete=!1,Ke.startBegin=!0,Ke.evaluatings={},Ke.resultData={},Ke.backtime=Date.now(),Y1();try{console.log("🚀 ~ content:",Ke.contentData,JSON.stringify(Ke.contentData))}catch(t){}const i=await l7(Ke.contentData);if((i==null?void 0:i.api)!=="startEvaluating"){Qb.error("请在APP端进行评测"),Ke.startBegin=!1;return}if(h7(),!await vh("play")){Ke.startBegin=!1,jb();return}},Xb=(i=!1)=>{console.log("触发结束"),!(!Ke.startBegin||Ce.modeType!=="evaluating")&&(Ke.startBegin=!1,f7(),c7({musicScoreId:Ce.examSongId}),S8({message:"评分中",duration:0,forbidClick:!0}),Ke.isComplete=i)},O9=()=>{Xb(),W1()},jb=()=>{Ke.evaluatings={},I3(),V3({header:{commond:"recordCancel",type:"SOUND_COMPARE",status:200}}),u7(),W1()},LR=(i="recordId")=>{var e;d7({url:location.origin+location.pathname+"report-share.html?id="+((e=Ke.resultData)==null?void 0:e[i])||"",orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0})},BR=xt({name:"evaluating",setup(){const i=t6();return Vt(i,e=>{e=="hidden"&&Ke.startBegin&&O9()}),Cs(()=>{Ke.resultData={},Ke.evaluatings={},Ke.soundEffectFrequency=0,Ke.checkStep=0,Ke.rendered=!0,r7(Um),Ce.isSelectMeasureMode||Sh()}),Nr(()=>{o7(Um)}),()=>ee("div",null,null)}}),F9="_popup_1838h_1",V9="_dots_1838h_6",G9="_dot_1838h_6",H9="_active_1838h_20",U9="_one_1838h_23",ka={popup:F9,dots:V9,dot:G9,active:H9,one:U9},Dt=Ht({list:[],len:0,tickEnd:!1,beatLengthInMilliseconds:0,state:"",source1:"",source2:"",index:0,show:!1}),z9=(i,e)=>new Promise(t=>{setTimeout(()=>{if(Dt.tickEnd){t(i);return}Dt.index++,e&&e.play(),t(i)},Dt.beatLengthInMilliseconds)}),IR=(i,e)=>{Dt.state="",Dt.beatLengthInMilliseconds=i,Dt.len=e},W9=async()=>{Dt.show=!0,Dt.tickEnd=!1,Dt.state!=="ok"&&(Dt.source1=new Pl.Howl({src:bu.tick}),Dt.source2=new Pl.Howl({src:bu.tock}),Dt.state="ok"),Dt.index=0;for(let i=0;i<=Dt.len;i++){if(Dt.tickEnd)return!1;const e=i===0?Dt.source1:i===Dt.len?null:Dt.source2;await z9(i,e)}return Dt.show=!1,!0},RR=xt({name:"metronome",setup(){const i=()=>{Dt.tickEnd=!0};return()=>ee(T3,{class:ka.popup,show:Dt.show,"onUpdate:show":e=>Dt.show=e,closeable:!0,onClickCloseIcon:i},{default:()=>[ee("div",{class:ka.dots},[Array(Dt.len).fill(0).map((e,t)=>ee("div",{class:[ka.dot,Dt.index>t&&ka.active,Dt.index>t&&t===0&&ka.one]},null))])]})}}),Y9="_audioList_1s1qf_1",Q9={audioList:Y9},gi=Ht({songEle:null,backgroundEle:null}),H1=i=>{var e,t,s,n;i==="play"?((e=gi.songEle)==null||e.play(),(t=gi.backgroundEle)==null||t.play()):i==="paused"&&((s=gi.songEle)==null||s.pause(),(n=gi.backgroundEle)==null||n.pause())},X9=i=>{gi.songEle&&(gi.songEle.playbackRate=i),gi.backgroundEle&&(gi.backgroundEle.playbackRate=i)},Kb=()=>{var i,e;return((i=gi.songEle)==null?void 0:i.currentTime)||((e=gi.backgroundEle)==null?void 0:e.currentTime)||0},j9=()=>{var i,e;return((i=gi.songEle)==null?void 0:i.duration)||((e=gi.backgroundEle)==null?void 0:e.duration)||0},Jb=i=>{gi.songEle&&(gi.songEle.currentTime=i),gi.backgroundEle&&(gi.backgroundEle.currentTime=i)},NR=xt({name:"audio-list",setup(){const i=Ft(()=>Ce.playSource==="music");return()=>ee("div",{class:Q9.audioList},[ee("audio",{muted:!i.value,preload:"auto",ref:e=>{Ce.music&&(gi.songEle=e)},src:Ce.music,onLoadedmetadata:$9,onPlay:eP,onTimeupdate:tP,onEnded:z1},null),ee("audio",{muted:i.value,preload:"auto",ref:e=>{Ce.accompany&&(gi.backgroundEle=e)},src:Ce.accompany},null)])}}),wi=Ht({list:[],index:0,start:!1,rendered:!1}),K9=(i=!0)=>{Ce.modeType=Ce.modeType==="follow"?"practise":"follow",i||(wi.start=!1,U1(!1))},J9=dt(0),q9=dt(0),_c=dt(0),U1=async(i=!0)=>{if(await p7(i?"start":"end"),i)_c.value=Date.now();else{const e=Date.now()-_c.value;_c.value!==0&&e>0&&(_c.value=0)}},qb=()=>{Ce.times.forEach(i=>{const e=document.querySelector(`div[data-vf=vf${i.id}]`);e&&(e.classList.remove("error"),e.classList.remove("success"))})},kR=async()=>{if(!jt.isApp){Qb({content:"请在APP端使用",type:"warning"});return}qb(),wi.start=!0,wi.index=0,wi.list=[],Y1(),await U1(!0),e4()},DR=()=>{wi.start=!1,U1(!1),wi.index=0},Zb=()=>{Q1(Ce.times[wi.index])},$b=()=>{const i=Ce.times[wi.index];return i.frequency<=0?(wi.index=wi.index+1,Zb(),$b()):(J9.value=i.frequency,{id:i.id,min:i.frequency-i.prevFrequency*.1,max:i.frequency+i.nextFrequency*.1})};let Mc=!1;const zm=i=>{var t;const e=(t=i==null?void 0:i.content)==null?void 0:t.frequency;q9.value=e,wi.list.push(e)},e4=()=>{let i=Date.now();requestAnimationFrame(()=>{if(Date.now()-i<16.6){if(!wi.start)return;Z9()}e4()})},Z9=()=>{if(Mc)return;Mc=!0;const i=$b();for(let e=0;ei.min&&t{const t=document.querySelector(`div[data-vf=vf${i.id}]`);t&&(e?(t.classList.remove("error"),t.classList.add("success")):(t.classList.remove("success"),t.classList.add("error")))},OR=xt({name:"follow",setup(){return Cs(()=>{im(zm),console.log("进入跟练模式")}),Nr(()=>{im(zm,!1),qb(),console.log("退出跟练模式")}),()=>ee("div",null,null)}}),FR="musicscoresetting",Pe=Ht({appName:"",musicRenderType:"staff",musicRendered:!1,detailId:"",xmlUrl:"",subjectId:0,categoriesId:0,categoriesName:"",enableEvaluation:!0,enableNotation:!1,examSongId:"",examSongName:"",extConfigJson:{},isOpenMetronome:!1,isShowFingering:!1,music:"",accompany:"",midiUrl:"",parentCategoriesId:0,playMode:"MP3",speed:0,originSpeed:0,track:"",partIndex:0,needTick:!1,osmd:null,isSpecialBookCategory:!1,playState:"paused",playEnd:!1,playSource:"music",playProgress:0,activeNoteIndex:0,activeMeasureIndex:0,sectionStatus:!1,section:[],sectionToast:null,sectionBoundingBoxs:[],isOpenPrepare:!1,sectionFirst:null,times:[],modeType:"practise",setting:{soundEffect:!0,eyeProtection:!1,camera:!1,cameraOpacity:70,repeatAutoPlay:!0,displayFingering:!0,displayCursor:!0,frequency:442,evaluationDifficulty:"ADVANCED",saveToAlbum:!1,enableAccompaniment:!1,reactionTimeMs:0},fixtime:0,fingeringInfo:{},scrollContainer:"musicAndSelection",isPercussion:!1,repeatedBeats:0,partListNames:[],gradual:[],gradualVersion:_b.BASE,gradualTimes:null,multitrack:0,zoom:.8,isSelectMeasureMode:!1}),$9=i=>{},xd=()=>{if(Pe.playState!=="play"){console.log("结束播放");return}let i=Date.now();requestAnimationFrame(()=>{Date.now()-i<16.7?(Ym(),xd()):setTimeout(()=>{Ym(),xd()},16.7)})},eP=()=>{if(console.log("开始播放"),Pe.playEnd=!1,xd(),Pe.modeType==="evaluating"){let i=Kb();Pe.isSelectMeasureMode&&(i=i-Pe.section[0].time),R9(i)}},tP=i=>{},iP=()=>{!Pe.setting.repeatAutoPlay||Pe.modeType!=="practise"||(yh(0,!0),t4(),setTimeout(()=>{vh("play")},1e3))},z1=()=>{Pe.playEnd=!0,Pe.playState="paused",H1(Pe.playState),Xb(!0),iP()},Ym=()=>{var s;const i=Kb(),e=j9();Pe.playProgress=i/e*100;let t=nP(i);if(t){if(Pe.sectionStatus&&Pe.section.length===2){const n=Pe.sectionFirst?Pe.sectionFirst:Pe.section[0],r=Pe.section[1];if(t.MeasureNumberXMLr.MeasureNumberXML){if(console.log("选段播放结束"),Pe.modeType==="evaluating"&&Pe.isSelectMeasureMode){z1();return}t=n,Jb(n.time)}}Q1(t)}(s=kt.metro)==null||s.sound(i)},yh=(i,e=!1)=>{const t=Pe.times[i];let s=t.time;e&&(s=0),t&&(Jb(s),Q1(t))},vh=async i=>(Pe.playState=i||(Pe.playState==="paused"?"play":"paused"),Pe.playState==="play"&&Pe.needTick&&!await W9()?(Pe.playState="paused",!1):(Pe.playState=="play"&&Pe.sectionStatus&&Pe.section.length<2&&Sh(),H1(Pe.playState),!0)),W1=()=>{Pe.playState="paused",H1(Pe.playState)},Y1=()=>{if(Pe.sectionStatus&&Pe.section.length===2){Pe.section=X1(Pe.section);return}yh(0,!0)},sP=i=>{try{Pe.osmd.cursor.reset()}catch(e){}for(let e=0;e{const e=i.i;if(Pe.activeNoteIndex===i.i)return;const t=Pe.osmd;let s=Pe.activeNoteIndex;if(Pe.activeNoteIndex=e,Pe.activeMeasureIndex=i.MeasureNumberXML,s&&e-s===1)t.cursor.next();else if(s&&e-s>0)for(;e-s>0;)s++,t.cursor.next();else sP(e);t4()},nP=i=>{const e=Pe.times,t=Pe.times.length;if(i>e[t-1].endtime+2){z1();return}let s=null;for(let n=Pe.activeNoteIndex;n=r.time)(!o||r.time!=o.time)&&(s=r);else break}return s},VR=()=>{Y1()},GR=i=>{Pe.speed=i;const e=i/Pe.originSpeed;console.log("🚀 ~ playbackRate:",i,Pe.originSpeed),X9(e)},Sh=()=>{var i;Pe.sectionStatus=!1,Pe.section=[],(i=Pe.sectionToast)==null||i.close(),Pe.sectionToast=null},HR=()=>{if(Pe.sectionStatus){Sh();return}Pe.sectionStatus=!0,Pe.sectionStatus&&vh("paused"),Pe.sectionToast=nl({message:"请选择开始小节",duration:0,position:"top",className:"selectionToast"})},X1=i=>{var a,l;if(!i.length)return[];const e=i.sort((u,h)=>u.time-h.time),t=(a=e[0])==null?void 0:a.MeasureNumberXML,s=(l=e.last())==null?void 0:l.MeasureNumberXML,n=Pe.times.filter(u=>t===u.MeasureNumberXML)||[],r=Pe.times.filter(u=>s===u.MeasureNumberXML)||[];if(!n.length||!r.length)return Sh(),[];e[0]=n[0],e[1]=r.last();let o=e[0].i;if(Pe.isOpenPrepare){const u=e[0].MeasureNumberXML;Pe.sectionFirst=Pe.times.find(h=>u-h.MeasureNumberXML===1),o=Pe.sectionFirst?Pe.sectionFirst.i:o}return yh(o,o===0),e},rP=i=>{var e;!Pe.sectionStatus||Pe.section.length>1||(Pe.section.length!==2&&i&&(Pe.section.push(i),Pe.section.length===2&&(Pe.section=X1(Pe.section),(e=Pe.sectionToast)==null||e.close(),Pe.sectionToast=null)),Pe.section.length===1&&Pe.sectionToast&&(Pe.sectionToast.message="请选择结束小节"))},UR=i=>{!Array.isArray(i)||i.length!==2||(Pe.sectionStatus=!0,Pe.section=X1(i))};let Qm=0;const t4=()=>{const i=document.getElementById("cursorImg-0"),e=document.getElementById(Pe.scrollContainer);!i||!e||Qm===i.offsetTop||(Qm=i.offsetTop,i.offsetTop>50?e.scrollTo({top:i.offsetTop-25,behavior:"smooth"}):e.scrollTo({top:0,behavior:"smooth"}))},zR=()=>Pe.examSongName.indexOf("节奏练习")>-1,WR=()=>{Pe.modeType==="evaluating"?I9():Pe.modeType==="practise"?vh("paused"):Pe.modeType==="follow"&&K9(!1)},Ce=Pe;class oP{static ajax(e,t=9e3){let s;const n=e.indexOf(".mxl")>-1?"text/plain; charset=x-user-defined":"application/xml";if(XMLHttpRequest)s=new XMLHttpRequest;else if(ActiveXObject)s=new ActiveXObject("Microsoft.XMLHTTP");else return Promise.reject(new Error("XMLHttp not supported."));return s.timeout=t,new Promise((r,o)=>{s.onreadystatechange=()=>{s.readyState===XMLHttpRequest.DONE&&(s.status===200||s.status===0&&s.responseText?r(s.responseText):o(new Error("Could not retrieve requested URL "+s.status)))},s.ontimeout=a=>{o(new Error("Server request Timeout"))},s.overrideMimeType(n),s.open("GET",e,!0),s.send()})}}const Hi=class{constructor(i=0,e=1,t=0,s=!0){this.numerator=0,this.denominator=1,this.wholeValue=0,this.numerator=i,this.denominator=e,this.wholeValue=t,s&&this.simplify(),this.setRealValue()}static max(i,e){return i.RealValue>e.RealValue?i:e}static Equal(i,e){return i.wholeValue===e.wholeValue&&i.Denominator===e.Denominator&&i.Numerator===e.Numerator}static createFromFraction(i){return new Hi(i.numerator,i.denominator,i.wholeValue,!1)}static plus(i,e){const t=i.clone();return t.Add(e),t}static minus(i,e){const t=i.clone();return t.Sub(e),t}static multiply(i,e){return new Hi((i.wholeValue*i.denominator+i.numerator)*(e.wholeValue*e.denominator+e.numerator),i.denominator*e.denominator)}static greatestCommonDenominator(i,e){if(i===0)return e;if(e===1)return 1;for(;Math.abs(e)>1e-8;)i>e?i-=e:e-=i;return Math.round(i)}toString(){let i=this.numerator+"/"+this.denominator;return this.wholeValue!==0&&(i=this.wholeValue+" "+i),i}clone(){return new Hi(this.numerator,this.denominator,this.wholeValue,!1)}get Numerator(){return this.numerator}set Numerator(i){this.numerator!==i&&(this.numerator=i,this.simplify(),this.setRealValue())}get Denominator(){return this.denominator}set Denominator(i){this.denominator!==i&&(this.denominator=i,this.numerator!==0&&this.simplify(),this.setRealValue())}get WholeValue(){return this.wholeValue}set WholeValue(i){this.wholeValue!==i&&(this.wholeValue=i,this.setRealValue())}GetExpandedNumerator(){return this.wholeValue*this.denominator+this.numerator}calculateNumberOfNeededDots(){let i=1,e=2;const t=this.GetExpandedNumerator();for(;ei;)e.Numerator++;if(this.numerator>this.denominator){const t=new Hi(this.numerator-1,this.denominator,this.wholeValue);for(;t.Denominator>i;)t.Numerator--;if(t.DenominatorHi.maximumAllowedNumber){const t=this.denominator/Hi.maximumAllowedNumber;this.numerator=Math.round(this.numerator/t),this.denominator=Math.round(this.denominator/t)}if(this.numerator>Hi.maximumAllowedNumber){const t=this.numerator/Hi.maximumAllowedNumber;this.numerator=Math.round(this.numerator/t),this.denominator=Math.round(this.denominator/t)}}isOnBeat(i){const e=this.distanceFromBeat(i);return Math.abs(e)(i[i.Above=0]="Above",i[i.Below=1]="Below",i[i.Left=2]="Left",i[i.Right=3]="Right",i[i.NotYetDefined=4]="NotYetDefined",i[i.AboveOrBelow=5]="AboveOrBelow",i))(ue||{});const Rn=class extends er{constructor(i,e,t,s,n,r,o=""){super(e),super.parentMeasure=s,this.NumberXml=r,this.dynamicType=i,this.label=o,this.staffNumber=t,this.activeInstantaneousDynamic=n,this.startVolume=1,this.endVolume=1,this.setStartAndEndVolume(),o!==""&&this.setType()}setStartAndEndVolume(){this.activeInstantaneousDynamic&&(this.dynamicType===0&&(this.startVolume=this.activeInstantaneousDynamic.Volume,this.endVolume=this.activeInstantaneousDynamic.Volume*1.2),this.dynamicType===1&&(this.startVolume=this.activeInstantaneousDynamic.Volume,this.endVolume=this.activeInstantaneousDynamic.Volume*.8))}get DynamicType(){return this.dynamicType}set DynamicType(i){this.dynamicType=i}get StartMultiExpression(){return this.startMultiExpression}set StartMultiExpression(i){this.startMultiExpression=i}get EndMultiExpression(){return this.endMultiExpression}set EndMultiExpression(i){this.endMultiExpression=i}get Placement(){return this.placement}set Placement(i){this.placement=i}get StartVolume(){return this.startVolume}set StartVolume(i){this.startVolume=i}get EndVolume(){return this.endVolume}set EndVolume(i){this.endVolume=i}get StaffNumber(){return this.staffNumber}set StaffNumber(i){this.staffNumber=i}get Label(){return this.label}set Label(i){this.label=i,this.setType()}static isInputStringContinuousDynamic(i){return i?Rn.isStringInStringList(Rn.listContinuousDynamicIncreasing,i)||Rn.isStringInStringList(Rn.listContinuousDynamicDecreasing,i):!1}getInterpolatedDynamic(i){const e=this.StartMultiExpression.AbsoluteTimestamp;let t;if(this.EndMultiExpression?t=this.EndMultiExpression.AbsoluteTimestamp:t=re.plus(this.startMultiExpression.SourceMeasureParent.AbsoluteTimestamp,this.startMultiExpression.SourceMeasureParent.Duration),i.lt(e))return-1;if(t.lt(i))return-2;const s=re.minus(i,e).RealValue/re.minus(t,e).RealValue;return Math.max(0,Math.min(99.9,this.startVolume+(this.endVolume-this.startVolume)*s))}isWedge(){return!this.label}setType(){Rn.isStringInStringList(Rn.listContinuousDynamicIncreasing,this.label)?this.dynamicType=0:Rn.isStringInStringList(Rn.listContinuousDynamicDecreasing,this.label)&&(this.dynamicType=1)}};let xs=Rn;xs.listContinuousDynamicIncreasing=["crescendo","cresc","cresc.","cres."];xs.listContinuousDynamicDecreasing=["decrescendo","decresc","decr.","diminuendo","dim.","dim"];var ms=(i=>(i[i.crescendo=0]="crescendo",i[i.diminuendo=1]="diminuendo",i))(ms||{}),Xr=(i=>(i[i.p=0]="p",i[i.f=1]="f",i[i.s=2]="s",i[i.z=3]="z",i[i.m=4]="m",i[i.r=5]="r",i))(Xr||{});class pi{constructor(e,t){this.message=e,t&&(this.message+=" "+t.toString())}}class zn{constructor(e){this.message=e}}class aP{constructor(e){this.message=e}}var ge={},lP={get exports(){return ge},set exports(i){ge=i}};(function(i){(function(e,t){i.exports?i.exports=t():e.log=t()})(vt,function(){var e=function(){},t="undefined",s=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"];function r(g,m){var b=g[m];if(typeof b.bind=="function")return b.bind(g);try{return Function.prototype.bind.call(b,g)}catch(y){return function(){return Function.prototype.apply.apply(b,[g,arguments])}}}function o(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function a(g){return g==="debug"&&(g="log"),typeof console===t?!1:g==="trace"&&s?o:console[g]!==void 0?r(console,g):console.log!==void 0?r(console,"log"):e}function l(g,m){for(var b=0;b=0&&_<=y.levels.SILENT){if(v=_,T!==!1&&A(_),l.call(y,_,g),typeof console===t&&_"u"}i.isUndefined=a;function l(c){return Object.prototype.toString.call(c)==="[object String]"}i.isString=l;function u(c){return a(c)||!o(c)?function(f,d){return f=0;r--)if(s(i[r],e))return r;return-1}Ri.lastIndexOf=cP;function uP(i,e,t){return j1(i,e,t)>=0}Ri.contains=uP;function hP(i,e,t){var s=j1(i,e,t);return s<0?!1:(i.splice(s,1),!0)}Ri.remove=hP;function fP(i,e,t){for(var s=t||Ah.defaultEquals,n=i.length,r=0,o=0;o=i.length||t<0||t>=i.length)return!1;var s=i[e];return i[e]=i[t],i[t]=s,!0}Ri.swap=gP;function mP(i){return"["+i.toString()+"]"}Ri.toString=mP;function bP(i,e){for(var t=0,s=i;te.size())return!1;var t=!0;return this.forEach(function(s){return e.contains(s)?!0:(t=!1,!1)}),t},i.prototype.remove=function(e){return this.contains(e)?(this.dictionary.remove(e),!0):!1},i.prototype.forEach=function(e){this.dictionary.forEach(function(t,s){return e(s)})},i.prototype.toArray=function(){return this.dictionary.values()},i.prototype.isEmpty=function(){return this.dictionary.isEmpty()},i.prototype.size=function(){return this.dictionary.size()},i.prototype.clear=function(){this.dictionary.clear()},i.prototype.toString=function(){return AP.toString(this.toArray())},i}();xh.default=wP;Object.defineProperty(K1,"__esModule",{value:!0});var df=us,EP=Dr,PP=xh,_P=function(){function i(e){this.toStrF=e||df.defaultToString,this.dictionary=new EP.default(this.toStrF),this.nElements=0}return i.prototype.add=function(e,t){if(t===void 0&&(t=1),df.isUndefined(e)||t<=0)return!1;if(this.contains(e))this.dictionary.getValue(e).copies+=t;else{var s={value:e,copies:t};this.dictionary.setValue(e,s)}return this.nElements+=t,!0},i.prototype.count=function(e){return this.contains(e)?this.dictionary.getValue(e).copies:0},i.prototype.contains=function(e){return this.dictionary.containsKey(e)},i.prototype.remove=function(e,t){if(t===void 0&&(t=1),df.isUndefined(e)||t<=0)return!1;if(this.contains(e)){var s=this.dictionary.getValue(e);return t>s.copies?this.nElements-=s.copies:this.nElements-=t,s.copies-=t,s.copies<=0&&this.dictionary.remove(e),!0}else return!1},i.prototype.toArray=function(){for(var e=[],t=this.dictionary.values(),s=0,n=t;sthis.nElements||zr.isUndefined(e))return!1;var s=this.createNode(e);if(this.nElements===0||this.lastNode===null)this.firstNode=s,this.lastNode=s;else if(t===this.nElements)this.lastNode.next=s,this.lastNode=s;else if(t===0)s.next=this.firstNode,this.firstNode=s;else{var n=this.nodeAtIndex(t-1);if(n===null)return!1;s.next=n.next,n.next=s}return this.nElements++,!0},i.prototype.first=function(){if(this.firstNode!==null)return this.firstNode.element},i.prototype.last=function(){if(this.lastNode!==null)return this.lastNode.element},i.prototype.elementAtIndex=function(e){var t=this.nodeAtIndex(e);if(t!==null)return t.element},i.prototype.indexOf=function(e,t){var s=t||zr.defaultEquals;if(zr.isUndefined(e))return-1;for(var n=this.firstNode,r=0;n!==null;){if(s(n.element,e))return r;r++,n=n.next}return-1},i.prototype.contains=function(e,t){return this.indexOf(e,t)>=0},i.prototype.remove=function(e,t){var s=t||zr.defaultEquals;if(this.nElements<1||zr.isUndefined(e))return!1;for(var n=null,r=this.firstNode;r!==null;){if(s(r.element,e))return n===null?(this.firstNode=r.next,r===this.lastNode&&(this.lastNode=null)):r===this.lastNode?(this.lastNode=n,n.next=r.next,r.next=null):(n.next=r.next,r.next=null),this.nElements--,!0;n=r,r=r.next}return!1},i.prototype.clear=function(){this.firstNode=null,this.lastNode=null,this.nElements=0},i.prototype.equals=function(e,t){var s=t||zr.defaultEquals;return!(e instanceof i)||this.size()!==e.size()?!1:this.equalsAux(this.firstNode,e.firstNode,s)},i.prototype.equalsAux=function(e,t,s){for(;e!==null&&t!==null;){if(!s(e.element,t.element))return!1;e=e.next,t=t.next}return!0},i.prototype.removeElementAtIndex=function(e){if(!(e<0||e>=this.nElements||this.firstNode===null||this.lastNode===null)){var t;if(this.nElements===1)t=this.firstNode.element,this.firstNode=null,this.lastNode=null;else{var s=this.nodeAtIndex(e-1);s===null?(t=this.firstNode.element,this.firstNode=this.firstNode.next):s.next===this.lastNode&&(t=this.lastNode.element,this.lastNode=s),s!==null&&s.next!==null&&(t=s.next.element,s.next=s.next.next)}return this.nElements--,t}},i.prototype.forEach=function(e){for(var t=this.firstNode;t!==null&&e(t.element)!==!1;)t=t.next},i.prototype.reverse=function(){for(var e=null,t=this.firstNode,s=null;t!==null;)s=t.next,t.next=e,e=t,t=s;s=this.firstNode,this.firstNode=this.lastNode,this.lastNode=s},i.prototype.toArray=function(){for(var e=[],t=this.firstNode;t!==null;)e.push(t.element),t=t.next;return e},i.prototype.size=function(){return this.nElements},i.prototype.isEmpty=function(){return this.nElements<=0},i.prototype.toString=function(){return MP.toString(this.toArray())},i.prototype.nodeAtIndex=function(e){if(e<0||e>=this.nElements)return null;if(e===this.nElements-1)return this.lastNode;for(var t=this.firstNode,s=0;s0&&(e=e.rightCh);return e},i.prototype.transplant=function(e,t){e.parent===null?this.root=t:e===e.parent.leftCh?e.parent.leftCh=t:e.parent.rightCh=t,t!==null&&(t.parent=e.parent)},i.prototype.removeNode=function(e){if(e.leftCh===null)this.transplant(e,e.rightCh);else if(e.rightCh===null)this.transplant(e,e.leftCh);else{var t=this.minimumAux(e.rightCh);t.parent!==e&&(this.transplant(t,t.rightCh),t.rightCh=e.rightCh,t.rightCh.parent=t),this.transplant(e,t),t.leftCh=e.leftCh,t.leftCh.parent=t}},i.prototype.inorderTraversalAux=function(e,t,s){e===null||s.stop||(this.inorderTraversalAux(e.leftCh,t,s),!s.stop&&(s.stop=t(e.element)===!1,!s.stop&&this.inorderTraversalAux(e.rightCh,t,s)))},i.prototype.levelTraversalAux=function(e,t){var s=new BP.default;for(e!==null&&s.enqueue(e),e=s.dequeue()||null;e!=null;){if(t(e.element)===!1)return;e.leftCh!==null&&s.enqueue(e.leftCh),e.rightCh!==null&&s.enqueue(e.rightCh),e=s.dequeue()||null}},i.prototype.preorderTraversalAux=function(e,t,s){e===null||s.stop||(s.stop=t(e.element)===!1,!s.stop&&(this.preorderTraversalAux(e.leftCh,t,s),!s.stop&&this.preorderTraversalAux(e.rightCh,t,s)))},i.prototype.postorderTraversalAux=function(e,t,s){e===null||s.stop||(this.postorderTraversalAux(e.leftCh,t,s),!s.stop&&(this.postorderTraversalAux(e.rightCh,t,s),!s.stop&&(s.stop=t(e.element)===!1)))},i.prototype.minimumAux=function(e){for(;e!=null&&e.leftCh!==null;)e=e.leftCh;return e},i.prototype.maximumAux=function(e){for(;e!=null&&e.rightCh!==null;)e=e.rightCh;return e},i.prototype.heightAux=function(e){return e===null?-1:Math.max(this.heightAux(e.leftCh),this.heightAux(e.rightCh))+1},i.prototype.insertNode=function(e){for(var t=null,s=this.root;s!==null;){var n=this.compare(e.element,s.element);if(n===0)return null;n<0?(t=s,s=s.leftCh):(t=s,s=s.rightCh)}return e.parent=t,t===null?this.root=e:this.compare(e.element,t.element)<0?t.leftCh=e:t.rightCh=e,e},i.prototype.createNode=function(e){return{element:e,leftCh:null,rightCh:null,parent:null}},i}();wh.default=IP;var RP=vt&&vt.__extends||function(){var i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])};return function(e,t){i(e,t);function s(){this.constructor=e}e.prototype=t===null?Object.create(t):(s.prototype=t.prototype,new s)}}();Object.defineProperty(J1,"__esModule",{value:!0});var NP=wh,kP=function(i){RP(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e}(NP.default);J1.default=kP;var Ph={};Object.defineProperty(Ph,"__esModule",{value:!0});var gf=us,Cc=Ri,DP=function(){function i(e){this.data=[],this.compare=e||gf.defaultCompare}return i.prototype.leftChildIndex=function(e){return 2*e+1},i.prototype.rightChildIndex=function(e){return 2*e+2},i.prototype.parentIndex=function(e){return Math.floor((e-1)/2)},i.prototype.minIndex=function(e,t){return t>=this.data.length?e>=this.data.length?-1:e:this.compare(this.data[e],this.data[t])<=0?e:t},i.prototype.siftUp=function(e){for(var t=this.parentIndex(e);e>0&&this.compare(this.data[t],this.data[e])>0;)Cc.swap(this.data,t,e),e=t,t=this.parentIndex(e)},i.prototype.siftDown=function(e){for(var t=this.minIndex(this.leftChildIndex(e),this.rightChildIndex(e));t>=0&&this.compare(this.data[e],this.data[t])>0;)Cc.swap(this.data,t,e),e=t,t=this.minIndex(this.leftChildIndex(e),this.rightChildIndex(e))},i.prototype.peek=function(){if(this.data.length>0)return this.data[0]},i.prototype.add=function(e){return gf.isUndefined(e)?!1:(this.data.push(e),this.siftUp(this.data.length-1),!0)},i.prototype.removeRoot=function(){if(this.data.length>0){var e=this.data[0];return this.data[0]=this.data[this.data.length-1],this.data.splice(this.data.length-1,1),this.data.length>0&&this.siftDown(0),e}},i.prototype.contains=function(e){var t=gf.compareToEquals(this.compare);return Cc.contains(this.data,e,t)},i.prototype.size=function(){return this.data.length},i.prototype.isEmpty=function(){return this.data.length<=0},i.prototype.clear=function(){this.data.length=0},i.prototype.forEach=function(e){Cc.forEach(this.data,e)},i}();Ph.default=DP;var q1={},OP=vt&&vt.__extends||function(){var i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])};return function(e,t){i(e,t);function s(){this.constructor=e}e.prototype=t===null?Object.create(t):(s.prototype=t.prototype,new s)}}();Object.defineProperty(q1,"__esModule",{value:!0});var FP=Dr,Bo=us,VP=function(){function i(e,t){this.key=e,this.value=t}return i.prototype.unlink=function(){this.prev.next=this.next,this.next.prev=this.prev},i}(),Xm=function(){function i(){this.key=null,this.value=null}return i.prototype.unlink=function(){this.prev.next=this.next,this.next.prev=this.prev},i}();function GP(i){return!i.next}var HP=function(i){OP(e,i);function e(t){var s=i.call(this,t)||this;return s.head=new Xm,s.tail=new Xm,s.head.next=s.tail,s.tail.prev=s.head,s}return e.prototype.appendToTail=function(t){var s=this.tail.prev;s.next=t,t.prev=s,t.next=this.tail,this.tail.prev=t},e.prototype.getLinkedDictionaryPair=function(t){if(!Bo.isUndefined(t)){var s="$"+this.toStr(t),n=this.table[s];return n}},e.prototype.getValue=function(t){var s=this.getLinkedDictionaryPair(t);if(!Bo.isUndefined(s))return s.value},e.prototype.remove=function(t){var s=this.getLinkedDictionaryPair(t);if(!Bo.isUndefined(s))return i.prototype.remove.call(this,t),s.unlink(),s.value},e.prototype.clear=function(){i.prototype.clear.call(this),this.head.next=this.tail,this.tail.prev=this.head},e.prototype.replace=function(t,s){var n="$"+this.toStr(s.key);s.next=t.next,s.prev=t.prev,this.remove(t.key),s.prev.next=s,s.next.prev=s,this.table[n]=s,++this.nElements},e.prototype.setValue=function(t,s){if(!(Bo.isUndefined(t)||Bo.isUndefined(s))){var n=this.getLinkedDictionaryPair(t),r=new VP(t,s),o="$"+this.toStr(t);if(Bo.isUndefined(n)){this.appendToTail(r),this.table[o]=r,++this.nElements;return}else return this.replace(n,r),n.value}},e.prototype.keys=function(){var t=[];return this.forEach(function(s,n){t.push(s)}),t},e.prototype.values=function(){var t=[];return this.forEach(function(s,n){t.push(n)}),t},e.prototype.forEach=function(t){for(var s=this.head.next;!GP(s);){var n=t(s.key,s.value);if(n===!1)return;s=s.next}},e}(FP.default);q1.default=HP;var Z1={};Object.defineProperty(Z1,"__esModule",{value:!0});var lr=us,UP=Dr,mf=Ri,zP=function(){function i(e,t,s){s===void 0&&(s=!1),this.dict=new UP.default(e),this.equalsF=t||lr.defaultEquals,this.allowDuplicate=s}return i.prototype.getValue=function(e){var t=this.dict.getValue(e);return lr.isUndefined(t)?[]:mf.copy(t)},i.prototype.setValue=function(e,t){if(lr.isUndefined(e)||lr.isUndefined(t))return!1;var s=this.dict.getValue(e);return lr.isUndefined(s)?(this.dict.setValue(e,[t]),!0):!this.allowDuplicate&&mf.contains(s,t,this.equalsF)?!1:(s.push(t),!0)},i.prototype.remove=function(e,t){if(lr.isUndefined(t)){var s=this.dict.remove(e);return!lr.isUndefined(s)}var n=this.dict.getValue(e);return!lr.isUndefined(n)&&mf.remove(n,t,this.equalsF)?(n.length===0&&this.dict.remove(e),!0):!1},i.prototype.keys=function(){return this.dict.keys()},i.prototype.values=function(){for(var e=this.dict.values(),t=[],s=0,n=e;s-1&&this.insertIdIntoRoot(t,s);for(var n in this.nodes)if(this.nodes.hasOwnProperty(n)){var r=this.findNodeId(n,e);r>-1&&this.insertIdIntoNode(n,t,r)}},i.prototype.insertIdAfterId=function(e,t){var s=this.findRootId(e);s>-1&&this.insertIdIntoRoot(t,s+1);for(var n in this.nodes)if(this.nodes.hasOwnProperty(n)){var r=this.findNodeId(n,e);r>-1&&this.insertIdIntoNode(n,t,r+1)}},i.prototype.insertIdIntoId=function(e,t){this.nodeInsertAtEnd(e,t),this.nodes[t]=[]},i.prototype.insertIdIntoRoot=function(e,t){if(t===void 0)this.rootInsertAtEnd(e);else if(t<0){var s=this.rootIds.length;this.rootIds.splice(t+s+1,0,e)}else this.rootIds.splice(t,0,e);this.nodes[e]=this.nodes[e]||[]},i.prototype.insertIdIntoNode=function(e,t,s){if(this.nodes[e]=this.nodes[e]||[],this.nodes[t]=this.nodes[t]||[],s===void 0)this.nodeInsertAtEnd(e,t);else if(s<0){var n=this.nodes[e].length;this.nodes[e].splice(s+n+1,0,t)}else this.nodes[e].splice(s,0,t)},i.prototype.moveId=function(e,t,s){var n=e,r=this.findRootId(n);this.nodes[t];for(var o in this.nodes)if(this.nodes.hasOwnProperty(o)){this.findNodeId(o,t);break}var a=t,l=this.findRootId(a);this.nodes[t];for(var o in this.nodes)if(this.nodes.hasOwnProperty(o)){this.findNodeId(o,t);break}if(r>-1)if(l>-1)switch(this.rootDelete(r),l>r&&l--,s){case Qt.BEFORE:this.insertIdIntoRoot(n,l);break;case Qt.AFTER:this.insertIdIntoRoot(n,l+1);break;case Qt.INSIDE_AT_START:this.nodeInsertAtStart(a,n);break;case Qt.INSIDE_AT_END:this.nodeInsertAtEnd(a,n);break}else{this.rootDelete(r);for(var o in this.nodes)if(this.nodes.hasOwnProperty(o)){var u=this.findNodeId(o,a);if(u>-1){switch(s){case Qt.BEFORE:this.insertIdIntoNode(o,n,u);break;case Qt.AFTER:this.insertIdIntoNode(o,n,u+1);break;case Qt.INSIDE_AT_START:this.nodeInsertAtStart(a,n);break;case Qt.INSIDE_AT_END:this.nodeInsertAtEnd(a,n);break}break}}}else if(l>-1){for(var o in this.nodes)if(this.nodes.hasOwnProperty(o)){var u=this.findNodeId(o,n);if(u>-1){this.nodeDeleteAtIndex(o,u);break}}switch(s){case Qt.BEFORE:this.insertIdIntoRoot(n,l);break;case Qt.AFTER:this.insertIdIntoRoot(n,l+1);break;case Qt.INSIDE_AT_START:this.nodeInsertAtStart(a,n);break;case Qt.INSIDE_AT_END:this.nodeInsertAtEnd(a,n);break}}else{for(var o in this.nodes)if(this.nodes.hasOwnProperty(o)){var u=this.findNodeId(o,n);if(u>-1){this.nodeDeleteAtIndex(o,u);break}}for(var o in this.nodes)if(this.nodes.hasOwnProperty(o)){var u=this.findNodeId(o,a);if(u>-1){switch(s){case Qt.BEFORE:this.insertIdIntoNode(o,n,u);break;case Qt.AFTER:this.insertIdIntoNode(o,n,u+1);break;case Qt.INSIDE_AT_START:this.nodeInsertAtStart(a,n);break;case Qt.INSIDE_AT_END:this.nodeInsertAtEnd(a,n);break}break}}}},i.prototype.swapArrayElements=function(e,t,s){var n=e[t];return e[t]=e[s],e[s]=n,e},i.prototype.rootDeleteId=function(e){var t=this.findRootId(e);t>-1&&this.rootDelete(t)},i.prototype.nodeAndSubNodesDelete=function(e){for(var t=[],s=0;s(i[i.pppppp=0]="pppppp",i[i.ppppp=1]="ppppp",i[i.pppp=2]="pppp",i[i.ppp=3]="ppp",i[i.pp=4]="pp",i[i.p=5]="p",i[i.mp=6]="mp",i[i.mf=7]="mf",i[i.f=8]="f",i[i.ff=9]="ff",i[i.fff=10]="fff",i[i.ffff=11]="ffff",i[i.fffff=12]="fffff",i[i.ffffff=13]="ffffff",i[i.sf=14]="sf",i[i.sff=15]="sff",i[i.sfp=16]="sfp",i[i.sfpp=17]="sfpp",i[i.fp=18]="fp",i[i.rf=19]="rf",i[i.rfz=20]="rfz",i[i.sfz=21]="sfz",i[i.sffz=22]="sffz",i[i.fz=23]="fz",i[i.other=24]="other",i))(ip||{});Zn.staticConstructor();class Un{constructor(e,t){e instanceof xs?this.continuousDynamicExpression=e:e instanceof Zn&&(this.instantaneousDynamicExpression=e),this.staffNumber=t}static Compare(e,t){return e.parMultiExpression().AbsoluteTimestamp.CompareTo(t.parMultiExpression().AbsoluteTimestamp)}parMultiExpression(){if(this.continuousDynamicExpression)return this.continuousDynamicExpression.StartMultiExpression;if(this.instantaneousDynamicExpression)return this.instantaneousDynamicExpression.ParentMultiExpression}}class sp{constructor(e){this.printObject=!0,this.parent=e}get Parent(){return this.parent}set Parent(e){this.parent=e}get PrintObject(){return this.printObject}set PrintObject(e){this.printObject=e}}class Li extends sp{constructor(e,t){super(void 0),this.rhythm=e,this.numerator=e.Numerator,this.denominator=e.Denominator,this.symbolEnum=t}get Rhythm(){return this.rhythm}set Rhythm(e){this.rhythm=e}get SymbolEnum(){return this.symbolEnum}set SymbolEnum(e){this.symbolEnum=e}clone(){return new Li(this.rhythm.clone(),this.symbolEnum)}OperatorEquals(e){const t=this;return t===e?!0:!t||!e?!1:t.numerator===e.numerator&&t.denominator===e.denominator}OperatorNotEqual(e){return this!==e}ToString(){return"Rhythm: "+this.rhythm.toString()}}var ws=(i=>(i[i.NONE=0]="NONE",i[i.COMMON=1]="COMMON",i[i.CUT=2]="CUT",i))(ws||{});class la{constructor(e,t,s){this.currentMeasureIndex=0,this.currentPartIndex=0,this.currentVoiceEntryIndex=-1,this.currentDynamicEntryIndex=0,this.currentTempoEntryIndex=0,this.currentDynamicChangingExpressions=[],this.repetitionIterationCountDictKeys=[],this.repetitionIterationCountDictValues=[],this.currentRepetition=void 0,this.endReached=!1,this.frontReached=!1,this.currentTimeStamp=new re(0,1),this.currentEnrolledMeasureTimestamp=new re(0,1),this.currentRelativeInMeasureTimestamp=new re(0,1),this.currentVerticalContainerInMeasureTimestamp=new re(0,1),this.jumpResponsibleRepetition=void 0,this.activeDynamicExpressions=[];try{this.frontReached=!0,this.musicSheet=e,this.currentBpm=e.userStartTempoInBPM,this.currentVoiceEntries=void 0,this.frontReached=!1;for(const n of this.musicSheet.Repetitions)this.setRepetitionIterationCount(n,1);for(let n=0;n=this.JumpResponsibleRepetition.StartIndex&&n.EndIndex<=this.JumpResponsibleRepetition.EndIndex&&this.resetRepetitionIterationCount(n)}}handleRepetitionsAtMeasureEnd(){for(let e=0,t=this.currentMeasure.LastRepetitionInstructions.length;e-1&&this.getRepetitionIterationCount(n)=this.JumpResponsibleRepetition.StartIndex&&n.EndIndex<=this.JumpResponsibleRepetition.EndIndex&&this.resetRepetitionIterationCount(n),this.repetitionIterationCountDictKeys.contains(n))){const r=n.getForwardJumpTargetForIteration(this.getRepetitionIterationCount(n));if(r>=0){this.currentMeasureIndex=r,this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex],this.currentVoiceEntryIndex=-1,this.jumpResponsibleRepetition=n,this.forwardJumpOccurred=!0;return}r===-2&&(this.endReached=!0)}}}this.currentMeasureIndex++,this.JumpResponsibleRepetition!==void 0&&this.currentMeasureIndex>this.JumpResponsibleRepetition.EndIndex&&(this.jumpResponsibleRepetition=void 0)}doBackJump(e){this.currentMeasureIndex=e.getBackwardJumpTarget(),this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex],this.currentVoiceEntryIndex=-1,this.incrementRepetitionIterationCount(e),this.jumpResponsibleRepetition=e,this.backJumpOccurred=!0}activateCurrentRhythmInstructions(){if(this.currentMeasure!==void 0&&this.currentMeasure.FirstInstructionsStaffEntries.length>0&&this.currentMeasure.FirstInstructionsStaffEntries[0]!==void 0){const e=this.currentMeasure.FirstInstructionsStaffEntries[0].Instructions;for(let t=0,s=e.length;t0&&(this.currentDynamicEntryIndex>=e.length||e[this.currentDynamicEntryIndex].parMultiExpression().AbsoluteTimestamp.gte(this.CurrentSourceTimestamp));)this.currentDynamicEntryIndex--;for(;this.currentDynamicEntryIndex0&&(this.currentTempoEntryIndex>=t.length||t[this.currentTempoEntryIndex].AbsoluteTimestamp.gte(this.CurrentSourceTimestamp));)this.currentTempoEntryIndex--;for(;this.currentTempoEntryIndex=0&&this.currentVoiceEntryIndex=0&&this.currentMeasureIndex0){if(!e)return!0;for(let s=0,n=t.length;st&&(this.openSheetMusicDisplay.Sheet.SelectionStart=this.openSheetMusicDisplay.Sheet.SourceMeasures[t].AbsoluteTimestamp),this.openSheetMusicDisplay.Sheet&&this.openSheetMusicDisplay.Sheet.SourceMeasures.length>s){const r=this.openSheetMusicDisplay.Sheet.SourceMeasures[s];this.openSheetMusicDisplay.Sheet.SelectionEnd=re.plus(r.AbsoluteTimestamp,r.Duration)}this.iterator=this.manager.getIterator()}getStaffEntryFromVoiceEntry(e){const t=e.ParentSourceStaffEntry.VerticalContainerParent.ParentMeasure.measureListIndex,s=e.ParentSourceStaffEntry.ParentStaff.idInMusicSheet;return this.graphic.findGraphicalStaffEntryFromMeasureList(s,t,e.ParentSourceStaffEntry)}updateWithTimestamp(e){const t=this.manager.absoluteEnrolledToSheetTimestamp(e),s=this.graphic.calculateXPositionFromTimestamp(t),n=s[0],r=s[1];this.updateCurrentPageFromSystem(r);const o=s[2];if(!o)return;const a=Math.max(o.parentMeasure.MeasureNumber,1);let l;for(const f of this.graphic.MeasureList[a-1])if(f){l=f;break}const u=this.graphic.calculateCursorPoints(n,r),h=u[0].y,c=u[1].y-h;if(l){if(this.updateWidthAndStyle(l.PositionAndShape,n,h,c),this.openSheetMusicDisplay.FollowCursor){const f=this.cursorElement.getBoundingClientRect().top;this.cursorElement.scrollIntoView({behavior:f<1e3?"smooth":"auto",block:"center"})}this.cursorElement.style.display=""}}update(){if(this.hidden||this.hidden===void 0||this.hidden===null)return;this.updateCurrentPage();const e=this.Iterator,t=e.CurrentVisibleVoiceEntries();if(e.EndReached||!e.CurrentVoiceEntries||t.length===0)return;let s=0,n=0,r=0,o;if(e.CurrentMeasure.isReducedToMultiRest){const h=this.graphic.findGraphicalMeasure(e.CurrentMeasureIndex,0),c=h.parentSourceMeasure.multipleRestMeasures,d=e.CurrentMeasure.multipleRestMeasureNumber/(c+1),p=h.PositionAndShape.Size.width-h.beginInstructionsWidth;s=h.PositionAndShape.AbsolutePosition.x+h.beginInstructionsWidth+d*p,o=h.ParentMusicSystem}else{const c=t.map(f=>this.getStaffEntryFromVoiceEntry(f)).sort((f,d)=>{var p,g,m,b;return((g=(p=f==null?void 0:f.PositionAndShape)==null?void 0:p.AbsolutePosition)==null?void 0:g.x)<=((b=(m=d==null?void 0:d.PositionAndShape)==null?void 0:m.AbsolutePosition)==null?void 0:b.x)?-1:1})[0];c&&(s=c.PositionAndShape.AbsolutePosition.x,o=c.parentMeasure.ParentMusicSystem)}if(!o)return;n=o.PositionAndShape.AbsolutePosition.y+o.StaffLines[0].PositionAndShape.RelativePosition.y;const a=o.StaffLines[o.StaffLines.length-1];r=o.PositionAndShape.AbsolutePosition.y+a.PositionAndShape.RelativePosition.y+a.StaffHeight-n;const u=this.graphic.findGraphicalMeasure(e.CurrentMeasureIndex,0).PositionAndShape;if(this.updateWidthAndStyle(u,s,n,r),this.openSheetMusicDisplay.FollowCursor&&this.cursorOptions.follow)if(this.openSheetMusicDisplay.EngravingRules.RenderSingleHorizontalStaffline)this.cursorElement.scrollIntoView({behavior:"smooth",inline:"center"});else{const h=this.cursorElement.getBoundingClientRect().top;this.cursorElement.scrollIntoView({behavior:h<1e3?"smooth":"auto",block:"center"})}this.cursorElement.style.display=""}updateWidthAndStyle(e,t,s,n){var l;const r=this.cursorElement;let o=0,a=n;switch(this.cursorOptions.type){case 1:r.style.top=s*10*this.openSheetMusicDisplay.zoom+"px",r.style.left=(t-1.5)*10*this.openSheetMusicDisplay.zoom+"px",a=n*10*this.openSheetMusicDisplay.zoom,r.height=a,r.style.height=a+"px",o=5*this.openSheetMusicDisplay.zoom;break;case 2:r.style.top=(s-2.5)*10*this.openSheetMusicDisplay.zoom+"px",r.style.left=t*10*this.openSheetMusicDisplay.zoom+"px",a=1.5*10*this.openSheetMusicDisplay.zoom,r.height=a,r.style.height=a+"px",o=5*this.openSheetMusicDisplay.zoom;break;case 3:r.style.top=e.AbsolutePosition.y*10*this.openSheetMusicDisplay.zoom+"px",r.style.left=e.AbsolutePosition.x*10*this.openSheetMusicDisplay.zoom+"px",a=n*10*this.openSheetMusicDisplay.zoom,r.height=a,r.style.height=a+"px",o=e.Size.width*10*this.openSheetMusicDisplay.zoom;break;case 4:r.style.top=e.AbsolutePosition.y*10*this.openSheetMusicDisplay.zoom+"px",r.style.left=e.AbsolutePosition.x*10*this.openSheetMusicDisplay.zoom+"px",a=n*10*this.openSheetMusicDisplay.zoom,r.height=a,r.style.height=a+"px",o=(t-e.AbsolutePosition.x)*10*this.openSheetMusicDisplay.zoom;break;default:r.style.top=s*10*this.openSheetMusicDisplay.zoom+"px",r.style.left=(t-1.5)*10*this.openSheetMusicDisplay.zoom+"px",a=n*10*this.openSheetMusicDisplay.zoom,r.height=a,r.style.height=a+"px",o=3*10*this.openSheetMusicDisplay.zoom;break}(l=window.GYM)!=null&&l.multitrack&&(r.height=a+24,r.style.height=a+24+"px"),o!==r.width&&(r.width=o,this.updateStyle(o,this.cursorOptions))}hide(){this.cursorElement.style.display="none",this.hidden=!0}next(){this.Iterator.moveToNextVisibleVoiceEntry(!1),this.update()}reset(){this.resetIterator();const e=this.manager.getIterator(this.graphic.ParentMusicSheet.SelectionStart);this.updateWithTimestamp(e.CurrentEnrolledTimestamp)}updateStyle(e,t=void 0){t!==void 0&&(this.cursorOptions=t);const s=document.createElement("canvas");s.width=this.cursorElement.width,s.height=1;const n=s.getContext("2d");n.globalAlpha=this.cursorOptions.alpha;const r=n.createLinearGradient(0,0,this.cursorElement.width,0);switch(this.cursorOptions.type){case 1:case 2:case 3:case 4:r.addColorStop(1,this.cursorOptions.color);break;default:r.addColorStop(0,"white"),r.addColorStop(.2,this.cursorOptions.color),r.addColorStop(.8,this.cursorOptions.color),r.addColorStop(1,"white");break}n.fillStyle=r,n.fillRect(0,0,e,1),this.cursorElement.src=s.toDataURL("image/png")}get Iterator(){return this.iterator}get Hidden(){return this.hidden}VoicesUnderCursor(e){return this.Iterator.CurrentVisibleVoiceEntries(e)}NotesUnderCursor(e){const t=this.VoicesUnderCursor(e),s=[];return t.forEach(n=>{s.push.apply(s,n.Notes)}),s}GNotesUnderCursor(e){const t=this.VoicesUnderCursor(e),s=[];return t.forEach(n=>{s.push(...n.Notes.map(r=>this.rules.GNote(r)))}),s}updateCurrentPage(){const e=this.Iterator.currentTimeStamp;for(const t of this.graphic.MusicPages)if(t.MusicSystems.last().GetSystemsLastTimeStamp().gt(e)){const n=t.PageNumber;return n!==this.currentPageNumber&&(this.container.removeChild(this.cursorElement),this.container=document.getElementById(this.rules.DYContainerId+n),this.container.appendChild(this.cursorElement)),this.currentPageNumber=n}return 1}updateCurrentPageFromSystem(e){if(e!=null&&e.Parent){const t=e.Parent.PageNumber;return t!==this.currentPageNumber&&(this.container.removeChild(this.cursorElement),this.container=document.getElementById(this.rules.DYContainerId+t),this.container.appendChild(this.cursorElement)),this.currentPageNumber=t}return 1}}class te{constructor(e=0,t=0){this.x=0,this.y=0,this.x=e,this.y=t}static get Empty(){return new te}static pointsAreEqual(e,t){return e.x===t.x&&e.y===t.y}ToString(){return"["+this.x+", "+this.y+"]"}}class Ss{constructor(e=0,t=0){this.width=e,this.height=t}}class ys{constructor(e,t,s,n){this.x=0,this.y=0,this.width=0,this.height=0,this.x=e,this.y=t,this.width=s,this.height=n}static createFromLocationAndSize(e,t){return new ys(e.x,e.y,t.width,t.height)}get Location(){return new te(this.x,this.y)}get Size(){return new Ss(this.width,this.height)}}class y_{isInstanceOfClass(e){let t=this.constructor.prototype;for(;t;){if(e===t.constructor.name)return!0;t=t.__proto__}return!1}}class yi extends y_{get PositionAndShape(){return this.boundingBox}set PositionAndShape(e){this.boundingBox=e}}class i4 extends yi{constructor(e){super(),this.parentStaffLine=e;const t=e.PositionAndShape;this.boundingBox=new Ut(this,t),this.boundingBox.BorderRight=6,this.boundingBox.BorderBottom=4.5,this.boundingBox.BorderLeft=-1.5,this.boundingBox.BorderTop=-1.5}}class yu extends yi{}let Ut=class{constructor(e=void 0,t=void 0,s=!1){this.isSymbol=!1,this.relativePositionHasBeenSet=!1,this.xBordersHaveBeenSet=!1,this.yBordersHaveBeenSet=!1,this.absolutePosition=new te,this.relativePosition=new te,this.size=new Ss,this.marginSize=new Ss,this.upperLeftCorner=new te,this.upperLeftMarginCorner=new te,this.borderLeft=0,this.borderRight=0,this.borderTop=0,this.borderBottom=0,this.borderMarginLeft=0,this.borderMarginRight=0,this.borderMarginTop=0,this.borderMarginBottom=0,this.childElements=[],this.parent=t,this.dataObject=e,this.isSymbol=s,this.xBordersHaveBeenSet=!1,this.yBordersHaveBeenSet=!1,t&&(this.Parent=t)}get RelativePositionHasBeenSet(){return this.relativePositionHasBeenSet}get XBordersHaveBeenSet(){return this.xBordersHaveBeenSet}set XBordersHaveBeenSet(e){this.xBordersHaveBeenSet=e}get YBordersHaveBeenSet(){return this.yBordersHaveBeenSet}set YBordersHaveBeenSet(e){this.yBordersHaveBeenSet=e}get AbsolutePosition(){return this.absolutePosition}set AbsolutePosition(e){this.absolutePosition=e}get RelativePosition(){return this.relativePosition}set RelativePosition(e){this.relativePosition=e,this.relativePositionHasBeenSet=!0}get Size(){return this.size}set Size(e){this.size=e}get MarginSize(){return this.marginSize}get UpperLeftCorner(){return this.upperLeftCorner}get UpperLeftMarginCorner(){return this.upperLeftMarginCorner}get BorderLeft(){return this.borderLeft}set BorderLeft(e){this.borderLeft=e,this.calculateRectangle()}get BorderRight(){return this.borderRight}set BorderRight(e){this.borderRight=e,this.calculateRectangle()}get BorderTop(){return this.borderTop}set BorderTop(e){this.borderTop=e,this.calculateRectangle()}get BorderBottom(){return this.borderBottom}set BorderBottom(e){this.borderBottom=e,this.calculateRectangle()}get BorderMarginLeft(){return this.borderMarginLeft>this.borderLeft?this.borderLeft:this.borderMarginLeft}set BorderMarginLeft(e){this.borderMarginLeft=e,this.calculateMarginRectangle()}get BorderMarginRight(){return this.borderMarginRightthis.borderTop?this.borderTop:this.borderMarginTop}set BorderMarginTop(e){this.borderMarginTop=e,this.calculateMarginRectangle()}get BorderMarginBottom(){return this.borderMarginBottom-1&&this.parent.ChildElements.splice(o,1)}this.parent=e,((s=(t=this.parent)==null?void 0:t.ChildElements)==null?void 0:s.indexOf(this))>-1?ge.error("BoundingBox of "+this.dataObject.constructor.name+" already in children list of "+this.parent.dataObject.constructor.name+"'s BoundingBox"):(r=(n=this.parent)==null?void 0:n.ChildElements)==null||r.push(this)}get DataObject(){return this.dataObject}get Center(){return new te(this.RelativePosition.x+(this.BorderMarginRight+this.BorderMarginLeft),this.RelativePosition.y+(this.BorderMarginBottom+this.BorderMarginTop))}setAbsolutePositionFromParent(){this.parent?(this.absolutePosition.x=this.parent.AbsolutePosition.x+this.relativePosition.x,this.absolutePosition.y=this.parent.AbsolutePosition.y+this.relativePosition.y):this.absolutePosition=this.relativePosition}calculateAbsolutePosition(){this.absolutePosition.x=this.relativePosition.x,this.absolutePosition.y=this.relativePosition.y;let e=this.parent;for(;e;)this.absolutePosition.x+=e.relativePosition.x,this.absolutePosition.y+=e.relativePosition.y,e=e.parent}calculateAbsolutePositionsRecursiveWithoutTopelement(){this.absolutePosition.x=0,this.absolutePosition.y=0;for(let e=0,t=this.ChildElements.length;e.001;break;case 2:case 3:n=this.relativePosition.y,e.calculateMarginPositionAlongDirection(this,t),r=Math.abs(n-this.relativePosition.y)>.001;break;default:throw new zn("direction")}while(r)}collisionDetection(e){const t=Math.min(this.AbsolutePosition.x+this.borderRight,e.absolutePosition.x+e.borderRight)-Math.max(this.AbsolutePosition.x+this.borderLeft,e.absolutePosition.x+e.borderLeft),s=Math.min(this.AbsolutePosition.y+this.borderBottom,e.absolutePosition.y+e.borderBottom)-Math.max(this.AbsolutePosition.y+this.borderTop,e.absolutePosition.y+e.borderTop);return t>0&&s>0}liesInsideBorders(e){const t=this.AbsolutePosition.x+this.borderLeft<=e.absolutePosition.x+e.borderLeft&&e.absolutePosition.x+e.borderLeft<=this.AbsolutePosition.x+this.borderRight,s=this.AbsolutePosition.x+this.borderLeft<=e.absolutePosition.x+e.borderRight&&e.absolutePosition.x+e.borderRight<=this.AbsolutePosition.x+this.borderRight;if(t&&s){const n=this.AbsolutePosition.y+this.borderTop<=e.absolutePosition.y+e.borderTop&&e.absolutePosition.y+e.borderTop<=this.AbsolutePosition.y+this.borderBottom,r=this.AbsolutePosition.y+this.borderTop<=e.absolutePosition.y+e.borderBottom&&e.absolutePosition.y+e.borderBottom<=this.AbsolutePosition.y+this.borderBottom;if(n&&r)return!0}return!1}pointLiesInsideBorders(e){return this.AbsolutePosition.x+this.borderLeft<=e.x&&e.x<=this.AbsolutePosition.x+this.borderRight&&this.AbsolutePosition.y+this.borderTop<=e.y&&e.y<=this.AbsolutePosition.y+this.borderBottom}marginCollisionDetection(e){const t=Math.min(this.AbsolutePosition.x+this.borderMarginRight,e.absolutePosition.x+e.borderMarginRight)-Math.max(this.AbsolutePosition.x+this.borderMarginLeft,e.absolutePosition.x+e.borderMarginLeft),s=Math.min(this.AbsolutePosition.y+this.borderMarginBottom,e.absolutePosition.y+e.borderMarginBottom)-Math.max(this.AbsolutePosition.y+this.borderMarginTop,e.absolutePosition.y+e.borderMarginTop);return t>0&&s>0}liesInsideMargins(e){const t=this.AbsolutePosition.x+this.borderMarginLeft<=e.absolutePosition.x+e.borderMarginLeft&&e.absolutePosition.x+e.borderMarginLeft<=this.AbsolutePosition.x+this.borderMarginRight,s=this.AbsolutePosition.x+this.borderMarginLeft<=e.absolutePosition.x+e.borderMarginRight&&e.absolutePosition.x+e.borderMarginRight<=this.AbsolutePosition.x+this.borderMarginRight;if(t&&s){const n=this.AbsolutePosition.y+this.borderMarginTop<=e.absolutePosition.y+e.borderMarginTop&&e.absolutePosition.y+e.borderMarginTop<=this.AbsolutePosition.y+this.borderMarginBottom,r=this.AbsolutePosition.y+this.borderMarginTop<=e.absolutePosition.y+e.borderMarginBottom&&e.absolutePosition.y+e.borderMarginBottom<=this.AbsolutePosition.y+this.borderMarginBottom;if(n&&r)return!0}return!1}pointLiesInsideMargins(e){return this.AbsolutePosition.x+this.borderMarginLeft<=e.x&&e.x<=this.AbsolutePosition.x+this.borderMarginRight&&this.AbsolutePosition.y+this.borderMarginTop<=e.y&&e.y<=this.AbsolutePosition.y+this.borderMarginBottom}computeNonOverlappingPosition(e,t,s){this.RelativePosition=new te(s.x,s.y),this.setAbsolutePositionFromParent();let n=0,r=!1;do switch(t){case 0:case 1:n=this.relativePosition.x,e.calculatePositionAlongDirection(this,t),r=Math.abs(n-this.relativePosition.x)>1e-4;break;case 2:case 3:n=this.relativePosition.y,e.calculatePositionAlongDirection(this,t),r=Math.abs(n-this.relativePosition.y)>1e-4;break;default:throw new zn("direction")}while(r)}getClickedObjectOfType(e){const t=this.dataObject;if(this.pointLiesInsideBorders(e)&&t)return t;for(let s=0,n=this.childElements.length;s(i[i.Left=0]="Left",i[i.Right=1]="Right",i[i.Up=2]="Up",i[i.Down=3]="Down",i))(s4||{});class wd extends yi{constructor(e){super(),this.musicSystems=[],this.labels=[],this.parent=e,this.boundingBox=new Ut(this,void 0)}get MusicSystems(){return this.musicSystems}set MusicSystems(e){this.musicSystems=e}get Labels(){return this.labels}set Labels(e){this.labels=e}get Parent(){return this.parent}set Parent(e){this.parent=e}get PageNumber(){return this.pageNumber}set PageNumber(e){this.pageNumber=e}setMusicPageAbsolutePosition(e,t){return new te(0,0)}}var n4=(i=>(i[i.Down=0]="Down",i[i.Right=1]="Right",i[i.RightDown=2]="RightDown",i))(n4||{}),Oe=(i=>(i[i.LeftTop=0]="LeftTop",i[i.LeftCenter=1]="LeftCenter",i[i.LeftBottom=2]="LeftBottom",i[i.CenterTop=3]="CenterTop",i[i.CenterCenter=4]="CenterCenter",i[i.CenterBottom=5]="CenterBottom",i[i.RightTop=6]="RightTop",i[i.RightCenter=7]="RightCenter",i[i.RightBottom=8]="RightBottom",i))(Oe||{});class bf{static IsLeft(e){return e===0||e===1||e===2}static IsCenterAligned(e){return e===3||e===4||e===5}static IsRight(e){return e===6||e===7||e===8}}var Wt=(i=>(i[i.Regular=0]="Regular",i[i.Bold=1]="Bold",i[i.Italic=2]="Italic",i[i.BoldItalic=3]="BoldItalic",i[i.Underlined=4]="Underlined",i))(Wt||{}),Ed=(i=>(i[i.TimesNewRoman=0]="TimesNewRoman",i[i.Kokila=1]="Kokila",i[i.Gonville=2]="Gonville",i))(Ed||{});const v_={0:"Times New Roman",1:"Kokila",2:"Gonville"};var Xa=(i=>(i.SIMPLE="",i.HAMMERON="H",i.PULLOFF="P",i.SLIDE="S",i.TAPPING="T",i))(Xa||{});const Tc={"-2":[4,12,23],"-7":[13],"-9":[6]};var Le=(i=>(i[i.C=0]="C",i[i.D=2]="D",i[i.E=4]="E",i[i.F=5]="F",i[i.G=7]="G",i[i.A=9]="A",i[i.B=11]="B",i))(Le||{}),ke=(i=>(i[i.SHARP=0]="SHARP",i[i.FLAT=1]="FLAT",i[i.NONE=2]="NONE",i[i.NATURAL=3]="NATURAL",i[i.DOUBLESHARP=4]="DOUBLESHARP",i[i.DOUBLEFLAT=5]="DOUBLEFLAT",i[i.TRIPLESHARP=6]="TRIPLESHARP",i[i.TRIPLEFLAT=7]="TRIPLEFLAT",i[i.QUARTERTONESHARP=8]="QUARTERTONESHARP",i[i.QUARTERTONEFLAT=9]="QUARTERTONEFLAT",i[i.SLASHFLAT=10]="SLASHFLAT",i[i.THREEQUARTERSSHARP=11]="THREEQUARTERSSHARP",i[i.THREEQUARTERSFLAT=12]="THREEQUARTERSFLAT",i[i.SLASHQUARTERSHARP=13]="SLASHQUARTERSHARP",i[i.SLASHSHARP=14]="SLASHSHARP",i[i.DOUBLESLASHFLAT=15]="DOUBLESLASHFLAT",i[i.SORI=16]="SORI",i[i.KORON=17]="KORON",i))(ke||{});const je=class{constructor(i,e,t,s=void 0){this.accidental=2,this.fundamentalNote=i,this.octave=e,this.accidental=t,this.accidentalXml=s,this.halfTone=i+(e+je.octXmlDiff)*12+je.HalfTonesFromAccidental(t),this.frequency=je.calcFrequency(this),this.nextFrequency=je.calcFrequency(this,"next"),this.prevFrequency=je.calcFrequency(this,"prev")}static getNoteEnumString(i){switch(i){case 0:return"C";case 2:return"D";case 4:return"E";case 5:return"F";case 7:return"G";case 9:return"A";case 11:return"B";default:return""}}static lineShiftFromNoteEnum(i,e){if(e===0)return[i,0];const t=je.pitchEnumValues,s=t.indexOf(i);let n=0,r=(s+e)%t.length;return s+e>t.length-1&&(n=1),r<0&&(r=t.length+r,n=-1),[t[r],n]}static CalculateTransposedHalfTone(i,e){const t=i.fundamentalNote+i.AccidentalHalfTones+e;return je.WrapAroundCheck(t,12)}static WrapAroundCheck(i,e){let t=0;for(;i<0;)i+=e,t--;for(;i>=e;)i-=e,t++;return{overflow:t,halftone:i}}static calcFrequency(i,e){let t=0,s;if(i instanceof je){const a=i;t=a.octave-1,s=a.fundamentalNote-9+a.AccidentalHalfTones}else typeof i=="number"&&(s=i-57);const n=window.DYSubjectId;let r=0;window.DYEnvironment==="COLEXIU"&&(Tc[12]=[120]);for(const a in Tc)if(Object.prototype.hasOwnProperty.call(Tc,a)&&Tc[a].includes(n)){r=parseFloat(a);break}let o=s+r;return e==="next"&&o++,e==="prev"&&o--,442*Math.pow(2,t)*Math.pow(2,o/12)}static calcFractionalKey(i){return Math.log(i/440)/Math.LN10*je.halftoneFactor+57}static fromFrequency(i){const e=je.calcFractionalKey(i)+.5,t=Math.floor(e/12)-je.octXmlDiff,s=Math.floor(e)%12;let n=s,r=2;return this.pitchEnumValues.indexOf(n)===-1&&(n=s-1,r=0),new je(n,t,r)}static fromHalftone(i){const e=Math.floor(i/12)-je.octXmlDiff,t=i%12;let s=t,n=2;return this.pitchEnumValues.indexOf(s)===-1&&(s=t-1,n=0),new je(s,e,n)}static ceiling(i){i=i%12;let e=i;return this.pitchEnumValues.indexOf(e)===-1&&(e=i+1),e}static floor(i){i=i%12;let e=i;return this.pitchEnumValues.indexOf(e)===-1&&(e=i-1),e}static HalfTonesFromAccidental(i){switch(i){case 2:return 0;case 0:return 1;case 1:return-1;case 3:return 0;case 4:return 2;case 5:return-2;case 6:return 3;case 7:return-3;case 8:return .5;case 9:return-.5;case 10:return-.51;case 11:return 1.5;case 12:return-1.5;case 13:return .0013;case 14:return .0014;case 15:return-.0015;case 16:return .0016;case 17:return .0017;default:throw new Error("Unhandled AccidentalEnum value")}}static AccidentalFromHalfTones(i){switch(i){case 0:return 2;case 1:return 0;case-1:return 1;case 2:return 4;case-2:return 5;case 3:return 6;case-3:return 7;case .5:return 8;case-.5:return 9;case 1.5:return 11;case-1.5:return 12;default:return i>0&&i<1?8:i<0&&i>-1?9:8}}static accidentalVexflow(i){let e;switch(i){case 3:e="n";break;case 1:e="b";break;case 0:e="#";break;case 4:e="##";break;case 6:e="###";break;case 5:e="bb";break;case 7:e="bbs";break;case 8:e="+";break;case 9:e="d";break;case 10:e="bs";break;case 11:e="++";break;case 12:e="db";break;case 13:e="+-";break;case 14:e="++-";break;case 15:e="bss";break;case 16:e="o";break;case 17:e="k";break}return e}get AccidentalHalfTones(){return je.HalfTonesFromAccidental(this.accidental)}get Octave(){return this.octave}get FundamentalNote(){return this.fundamentalNote}get Accidental(){return this.accidental}get AccidentalXml(){return this.accidentalXml}get Frequency(){return this.frequency}static get OctaveXmlDifference(){return je.octXmlDiff}getHalfTone(){return this.halfTone}getTransposedPitch(i){if(i>12)throw new Error("rewrite this method to handle bigger octave changes or don't use is with bigger octave changes!");return i>0?this.getHigherPitchByTransposeFactor(i):i<0?this.getLowerPitchByTransposeFactor(-i):this}DoEnharmonicChange(){switch(this.accidental){case 1:case 5:this.fundamentalNote=this.getPreviousFundamentalNote(this.fundamentalNote),this.accidental=je.AccidentalFromHalfTones(this.halfTone-(this.fundamentalNote+(this.octave+je.octXmlDiff)*12));break;case 0:case 4:this.fundamentalNote=this.getNextFundamentalNote(this.fundamentalNote),this.accidental=je.AccidentalFromHalfTones(this.halfTone-(this.fundamentalNote+(this.octave+je.octXmlDiff)*12));break;default:return}}ToString(){let i=je.accidentalVexflow(this.accidental);return i||(i=""),"Key: "+je.getNoteEnumString(this.fundamentalNote)+i+", Note: "+this.fundamentalNote+", octave: "+this.octave.toString()}OperatorEquals(i){const e=this;return!e||!i?!1:e.FundamentalNote===i.FundamentalNote&&e.Octave===i.Octave&&e.Accidental===i.Accidental}OperatorNotEqual(i){return this!==i}OperatorFundamentalGreaterThan(i){const e=this;return e.Octave===i.Octave?e.FundamentalNote>i.FundamentalNote:e.Octave>i.Octave}OperatorFundamentalLessThan(i){const e=this;return e.Octave===i.Octave?e.FundamentalNoteje.pitchEnumValues.length-1?(s=je.pitchEnumValues[e+i-je.pitchEnumValues.length],t++):s=je.pitchEnumValues[e+i],new je(s,t,2)}getLowerPitchByTransposeFactor(i){const e=je.pitchEnumValues.indexOf(this.fundamentalNote);let t=this.octave,s;return e-i<0?(s=je.pitchEnumValues[je.pitchEnumValues.length+e-i],t--):s=je.pitchEnumValues[e-i],new je(s,t,2)}getNextFundamentalNote(i){let e=je.pitchEnumValues.indexOf(i);return e=(e+1)%je.pitchEnumValues.length,je.pitchEnumValues[e]}getPreviousFundamentalNote(i){const e=je.pitchEnumValues.indexOf(i);return e>0?je.pitchEnumValues[e-1]:je.pitchEnumValues[je.pitchEnumValues.length-1]}};let pt=je;pt.pitchEnumValues=[0,2,4,5,7,9,11];pt.halftoneFactor=12/(Math.LN2/Math.LN10);pt.octXmlDiff=3;class Lc{constructor(e,t){this.staffEntries=[],this.absoluteTimestamp=t,this.staffEntries=new Array(e)}get Index(){return this.index}set Index(e){this.index=e}get AbsoluteTimestamp(){return this.absoluteTimestamp}get StaffEntries(){return this.staffEntries}set StaffEntries(e){this.staffEntries=e}static compareByTimestamp(e,t){const s=e.absoluteTimestamp.RealValue,n=t.absoluteTimestamp.RealValue;return sn?1:0}getFirstNonNullStaffEntry(){for(let e=0,t=this.staffEntries.length;e(i[i.BaseWritingColor=0]="BaseWritingColor",i[i.FollowingCursor=1]="FollowingCursor",i[i.AlternativeFollowingCursor=2]="AlternativeFollowingCursor",i[i.PlaybackCursor=3]="PlaybackCursor",i[i.Highlighted=4]="Highlighted",i[i.ErrorUnderlay=5]="ErrorUnderlay",i[i.Selected=6]="Selected",i[i.SelectionSymbol=7]="SelectionSymbol",i[i.DebugColor1=8]="DebugColor1",i[i.DebugColor2=9]="DebugColor2",i[i.DebugColor3=10]="DebugColor3",i[i.SplitScreenDivision=11]="SplitScreenDivision",i[i.GreyTransparentOverlay=12]="GreyTransparentOverlay",i[i.MarkedArea1=13]="MarkedArea1",i[i.MarkedArea2=14]="MarkedArea2",i[i.MarkedArea3=15]="MarkedArea3",i[i.MarkedArea4=16]="MarkedArea4",i[i.MarkedArea5=17]="MarkedArea5",i[i.MarkedArea6=18]="MarkedArea6",i[i.MarkedArea7=19]="MarkedArea7",i[i.MarkedArea8=20]="MarkedArea8",i[i.MarkedArea9=21]="MarkedArea9",i[i.MarkedArea10=22]="MarkedArea10",i[i.Comment1=23]="Comment1",i[i.Comment2=24]="Comment2",i[i.Comment3=25]="Comment3",i[i.Comment4=26]="Comment4",i[i.Comment5=27]="Comment5",i[i.Comment6=28]="Comment6",i[i.Comment7=29]="Comment7",i[i.Comment8=30]="Comment8",i[i.Comment9=31]="Comment9",i[i.Comment10=32]="Comment10",i))(Vo||{});const lt=new cs;lt.setValue(0,"Thistle");lt.setValue(1,"Aqua");lt.setValue(2,"Azure");lt.setValue(3,"Bisque");lt.setValue(4,"CadetBlue");lt.setValue(5,"DarkBlue");lt.setValue(6,"DarkGoldenRod");lt.setValue(7,"BlanchedAlmond");lt.setValue(8,"Chartreuse");lt.setValue(9,"DarkGreen");lt.setValue(10,"DarkOrange");lt.setValue(11,"FireBrick");lt.setValue(12,"DarkSalmon");lt.setValue(13,"DarkSeaGreen");lt.setValue(14,"DarkOrchid");lt.setValue(15,"Aquamarine");lt.setValue(16,"DarkKhaki");lt.setValue(17,"ForestGreen");lt.setValue(18,"AliceBlue");lt.setValue(19,"DeepPink");lt.setValue(20,"Coral");lt.setValue(21,"DarkOliveGreen");lt.setValue(22,"Chocolate");lt.setValue(23,"DodgerBlue");lt.setValue(24,"Blue");lt.setValue(25,"Beige");lt.setValue(26,"Crimson");lt.setValue(27,"Fuchsia");lt.setValue(28,"Brown");lt.setValue(29,"BlanchedAlmond");lt.setValue(30,"CornflowerBlue");lt.setValue(31,"Cornsilk");lt.setValue(32,"DarkGrey");var Xt=(i=>(i[i.Background=0]="Background",i[i.Highlight=1]="Highlight",i[i.MeasureError=2]="MeasureError",i[i.SelectionSymbol=3]="SelectionSymbol",i[i.Cursor=4]="Cursor",i[i.PSI_Debug=5]="PSI_Debug",i[i.Notes=6]="Notes",i[i.Comment=7]="Comment",i[i.Debug_above=8]="Debug_above",i))(Xt||{}),r4=(i=>(i[i.Normal=0]="Normal",i[i.Selected=1]="Selected",i[i.Follow_Confirmed=2]="Follow_Confirmed",i[i.QFeedback_NotFound=3]="QFeedback_NotFound",i[i.QFeedback_OK=4]="QFeedback_OK",i[i.QFeedback_Perfect=5]="QFeedback_Perfect",i[i.Debug1=6]="Debug1",i[i.Debug2=7]="Debug2",i[i.Debug3=8]="Debug3",i))(r4||{}),Pd=(i=>(i.C="#d82c6b",i.D="#F89D15",i.E="#FFE21A",i.F="#4dbd5c",i.G="#009D96",i.A="#43469d",i.B="#76429c",i.Rest="#000000",i))(Pd||{});class Qs{constructor(e,t,s=0,n=Vo.BaseWritingColor,r=void 0){this.start=e,this.end=t,this.width=s,this.styleId=n,this.colorHex=r}get Start(){return this.start}set Start(e){this.start=e}get End(){return this.end}set End(e){this.end=e}get Width(){return this.width}set Width(e){this.width=e}}class nt extends sp{constructor(e=0,t=0,s=2){super(void 0),this.clefType=0,this.line=2,this.octaveOffset=0,this.line=s,this.clefType=e,this.octaveOffset=t,this.calcParameters()}static getDefaultClefFromMidiInstrument(e){switch(e){case 0:return new nt(1,0,4);case 33:return new nt(1,0,4);case 34:return new nt(1,0,4);case 35:return new nt(1,0,4);case 36:return new nt(1,0,4);case 37:return new nt(1,0,4);case 38:return new nt(1,0,4);case 39:return new nt(1,0,4);case 43:return new nt(1,0,4);default:return new nt(0,0,2)}}static getAllPossibleClefs(){const e=[];for(let t=0;t<=2;t++){const s=new nt(0,t,2);e.push(s)}for(let t=-2;t<=0;t++){const s=new nt(1,t,4);e.push(s)}return e}static isSupportedClef(e){switch(e){case 0:case 1:case 2:case 3:case 4:return!0;default:return!1}}get ClefType(){return this.clefType}set ClefType(e){this.clefType=e}get Line(){return this.line}set Line(e){this.line=e}get OctaveOffset(){return this.octaveOffset}set OctaveOffset(e){this.octaveOffset=e}get ClefPitch(){return this.clefPitch}set ClefPitch(e){this.clefPitch=e}get ReferenceCyPosition(){return this.referenceCyPosition}set ReferenceCyPosition(e){this.referenceCyPosition=e}Equals(e){return this===e?!0:!this||!e?!1:this.clefPitch===e.clefPitch&&this.Line===e.Line}NotEqual(e){return!this.Equals(e)}ToString(){return"ClefType: "+this.clefType}calcParameters(){switch(this.clefType){case 0:this.clefPitch=new pt(Le.G,1+this.octaveOffset,ke.NONE),this.referenceCyPosition=5-this.line+2;break;case 1:this.clefPitch=new pt(Le.F,0+this.octaveOffset,ke.NONE),this.referenceCyPosition=5-this.line+1.5;break;case 2:this.clefPitch=new pt(Le.C,1+this.octaveOffset,ke.NONE),this.referenceCyPosition=5-this.line;break;case 3:this.clefPitch=new pt(Le.C,2,ke.NONE),this.referenceCyPosition=2;break;case 4:this.clefPitch=new pt(Le.G,0,ke.NONE),this.referenceCyPosition=0;break;default:throw new zn("clefType")}}}var Lt=(i=>(i[i.G=0]="G",i[i.F=1]="F",i[i.C=2]="C",i[i.percussion=3]="percussion",i[i.TAB=4]="TAB",i))(Lt||{}),Ee=(i=>(i[i.None=-1]="None",i[i.Acoustic_Grand_Piano=0]="Acoustic_Grand_Piano",i[i.Bright_Acoustic_Piano=1]="Bright_Acoustic_Piano",i[i.Electric_Grand_Piano=2]="Electric_Grand_Piano",i[i.Honky_tonk_Piano=3]="Honky_tonk_Piano",i[i.Electric_Piano_1=4]="Electric_Piano_1",i[i.Electric_Piano_2=5]="Electric_Piano_2",i[i.Harpsichord=6]="Harpsichord",i[i.Clavinet=7]="Clavinet",i[i.Celesta=8]="Celesta",i[i.Glockenspiel=9]="Glockenspiel",i[i.Music_Box=10]="Music_Box",i[i.Vibraphone=11]="Vibraphone",i[i.Marimba=12]="Marimba",i[i.Xylophone=13]="Xylophone",i[i.Tubular_Bells=14]="Tubular_Bells",i[i.Dulcimer=15]="Dulcimer",i[i.Drawbar_Organ=16]="Drawbar_Organ",i[i.Percussive_Organ=17]="Percussive_Organ",i[i.Rock_Organ=18]="Rock_Organ",i[i.Church_Organ=19]="Church_Organ",i[i.Reed_Organ=20]="Reed_Organ",i[i.Accordion=21]="Accordion",i[i.Harmonica=22]="Harmonica",i[i.Tango_Accordion=23]="Tango_Accordion",i[i.Acoustic_Guitar_nylon=24]="Acoustic_Guitar_nylon",i[i.Acoustic_Guitar_steel=25]="Acoustic_Guitar_steel",i[i.Electric_Guitar_jazz=26]="Electric_Guitar_jazz",i[i.Electric_Guitar_clean=27]="Electric_Guitar_clean",i[i.Electric_Guitar_muted=28]="Electric_Guitar_muted",i[i.Overdriven_Guitar=29]="Overdriven_Guitar",i[i.Distortion_Guitar=30]="Distortion_Guitar",i[i.Guitar_harmonics=31]="Guitar_harmonics",i[i.Acoustic_Bass=32]="Acoustic_Bass",i[i.Electric_Bass_finger=33]="Electric_Bass_finger",i[i.Electric_Bass_pick=34]="Electric_Bass_pick",i[i.Fretless_Bass=35]="Fretless_Bass",i[i.Slap_Bass_1=36]="Slap_Bass_1",i[i.Slap_Bass_2=37]="Slap_Bass_2",i[i.Synth_Bass_1=38]="Synth_Bass_1",i[i.Synth_Bass_2=39]="Synth_Bass_2",i[i.Violin=40]="Violin",i[i.Viola=41]="Viola",i[i.Cello=42]="Cello",i[i.Contrabass=43]="Contrabass",i[i.Tremolo_Strings=44]="Tremolo_Strings",i[i.Pizzicato_Strings=45]="Pizzicato_Strings",i[i.Orchestral_Harp=46]="Orchestral_Harp",i[i.Timpani=47]="Timpani",i[i.String_Ensemble_1=48]="String_Ensemble_1",i[i.String_Ensemble_2=49]="String_Ensemble_2",i[i.Synth_Strings_1=50]="Synth_Strings_1",i[i.Synth_Strings_2=51]="Synth_Strings_2",i[i.Choir_Aahs=52]="Choir_Aahs",i[i.Voice_Oohs=53]="Voice_Oohs",i[i.Synth_Voice=54]="Synth_Voice",i[i.Orchestra_Hit=55]="Orchestra_Hit",i[i.Trumpet=56]="Trumpet",i[i.Trombone=57]="Trombone",i[i.Tuba=58]="Tuba",i[i.Muted_Trumpet=59]="Muted_Trumpet",i[i.French_Horn=60]="French_Horn",i[i.Brass_Section=61]="Brass_Section",i[i.Synth_Brass_1=62]="Synth_Brass_1",i[i.Synth_Brass_2=63]="Synth_Brass_2",i[i.Soprano_Sax=64]="Soprano_Sax",i[i.Alto_Sax=65]="Alto_Sax",i[i.Tenor_Sax=66]="Tenor_Sax",i[i.Baritone_Sax=67]="Baritone_Sax",i[i.Oboe=68]="Oboe",i[i.English_Horn=69]="English_Horn",i[i.Bassoon=70]="Bassoon",i[i.Clarinet=71]="Clarinet",i[i.Piccolo=72]="Piccolo",i[i.Flute=73]="Flute",i[i.Recorder=74]="Recorder",i[i.Pan_Flute=75]="Pan_Flute",i[i.Blown_Bottle=76]="Blown_Bottle",i[i.Shakuhachi=77]="Shakuhachi",i[i.Whistle=78]="Whistle",i[i.Ocarina=79]="Ocarina",i[i.Lead_1_square=80]="Lead_1_square",i[i.Lead_2_sawtooth=81]="Lead_2_sawtooth",i[i.Lead_3_calliope=82]="Lead_3_calliope",i[i.Lead_4_chiff=83]="Lead_4_chiff",i[i.Lead_5_charang=84]="Lead_5_charang",i[i.Lead_6_voice=85]="Lead_6_voice",i[i.Lead_7_fifths=86]="Lead_7_fifths",i[i.Lead_8_bass_lead=87]="Lead_8_bass_lead",i[i.Pad_1_new_age=88]="Pad_1_new_age",i[i.Pad_2_warm=89]="Pad_2_warm",i[i.Pad_3_polysynth=90]="Pad_3_polysynth",i[i.Pad_4_choir=91]="Pad_4_choir",i[i.Pad_5_bowed=92]="Pad_5_bowed",i[i.Pad_6_metallic=93]="Pad_6_metallic",i[i.Pad_7_halo=94]="Pad_7_halo",i[i.Pad_8_sweep=95]="Pad_8_sweep",i[i.FX_1_rain=96]="FX_1_rain",i[i.FX_2_soundtrack=97]="FX_2_soundtrack",i[i.FX_3_crystal=98]="FX_3_crystal",i[i.FX_4_atmosphere=99]="FX_4_atmosphere",i[i.FX_5_brightness=100]="FX_5_brightness",i[i.FX_6_goblins=101]="FX_6_goblins",i[i.FX_7_echoes=102]="FX_7_echoes",i[i.FX_8_scifi=103]="FX_8_scifi",i[i.Sitar=104]="Sitar",i[i.Banjo=105]="Banjo",i[i.Shamisen=106]="Shamisen",i[i.Koto=107]="Koto",i[i.Kalimba=108]="Kalimba",i[i.Bag_pipe=109]="Bag_pipe",i[i.Fiddle=110]="Fiddle",i[i.Shanai=111]="Shanai",i[i.Tinkle_Bell=112]="Tinkle_Bell",i[i.Agogo=113]="Agogo",i[i.Steel_Drums=114]="Steel_Drums",i[i.Woodblock=115]="Woodblock",i[i.Taiko_Drum=116]="Taiko_Drum",i[i.Melodic_Tom=117]="Melodic_Tom",i[i.Synth_Drum=118]="Synth_Drum",i[i.Reverse_Cymbal=119]="Reverse_Cymbal",i[i.Guitar_Fret_Noise=120]="Guitar_Fret_Noise",i[i.Breath_Noise=121]="Breath_Noise",i[i.Seashore=122]="Seashore",i[i.Bird_Tweet=123]="Bird_Tweet",i[i.Telephone_Ring=124]="Telephone_Ring",i[i.Helicopter=125]="Helicopter",i[i.Applause=126]="Applause",i[i.Gunshot=127]="Gunshot",i[i.euphonium=128]="euphonium",i[i.AltoClarinetInEb=200]="AltoClarinetInEb",i[i.TrumpetInBb=201]="TrumpetInBb",i[i.BaritoneSaxophone=202]="BaritoneSaxophone",i[i.TenorSaxophone=203]="TenorSaxophone",i[i.ClarinetInEb=204]="ClarinetInEb",i[i.Euphonium=205]="Euphonium",i[i.Alto_Clarinet=206]="Alto_Clarinet",i[i.Bass_Clarinet=207]="Bass_Clarinet",i[i.Bass_Trombone=208]="Bass_Trombone",i[i.clarinet_in_bb=209]="clarinet_in_bb",i[i.clarinet_in_eb=210]="clarinet_in_eb",i[i.Percussion=135]="Percussion",i))(Ee||{});const ja=class extends sp{constructor(i=void 0,e=0,t=0){super(i),this.isTransposedBy=0,this.Key=e,this.keyTypeOriginal=e,this.mode=t,this.alteratedNotes=this.calcAlteratedNotes()}static copy(i){const e=new ja(i.parent,i.Key,i.Mode);return e.keyTypeOriginal=i.keyTypeOriginal,e}static getAllPossibleMajorKeyInstructions(){const i=[];for(let e=-7;e<7;e++){const t=new ja(void 0,e,0);i.push(t)}return i}get Key(){return this.keyType}set Key(i){this.keyType=i,this.alteratedNotes=this.calcAlteratedNotes()}get Mode(){return this.mode}set Mode(i){this.mode=i}get AlteratedNotes(){return this.alteratedNotes}calcAlteratedNotes(){const i=[];if(this.keyType>0)for(let e=0;e=0}getAlterationForPitch(i){return this.keyType>0&&this.alteratedNotes.indexOf(i.FundamentalNote)<=this.keyType?ke.SHARP:this.keyType<0&&this.alteratedNotes.indexOf(i.FundamentalNote)<=Math.abs(this.keyType)?ke.FLAT:ke.NONE}ToString(){return"Key: "+this.keyType+this.mode}OperatorEquals(i){const e=this;return e===i?!0:!e||!i?!1:e.Key===i.Key&&e.Mode===i.Mode}OperatorNotEqual(i){return!this.OperatorEquals(i)}};let ii=ja;ii.sharpPositionList=[Le.F,Le.C,Le.G,Le.D,Le.A,Le.E,Le.B];ii.flatPositionList=[Le.B,Le.E,Le.A,Le.D,Le.G,Le.C,Le.F];var Sr=(i=>(i[i.major=0]="major",i[i.minor=1]="minor",i[i.none=2]="none",i[i.dorian=3]="dorian",i[i.phrygian=4]="phrygian",i[i.lydian=5]="lydian",i[i.mixolydian=6]="mixolydian",i[i.aeolian=7]="aeolian",i[i.ionian=8]="ionian",i[i.locrian=9]="locrian",i))(Sr||{});Array.prototype.last||Object.defineProperty(Array.prototype,"last",{enumerable:!1,value:function(){return this[this.length-1]}});Array.prototype.clear||Object.defineProperty(Array.prototype,"clear",{enumerable:!1,value:function(){this.length=0}});Array.prototype.contains||Object.defineProperty(Array.prototype,"contains",{enumerable:!1,value:function(i){return this.indexOf(i)!==-1}});class Wn{static contains2(e,t){for(let s=0;s{var s,n,r,o;return((n=(s=t.sourceNote.Pitch)==null?void 0:s.getHalfTone())!=null?n:0)-((o=(r=e.sourceNote.Pitch)==null?void 0:r.getHalfTone())!=null?o:0)}),this.notes}sortForVexflow(){return this.notes.sort((e,t)=>{var s,n,r;return((n=(s=e.sourceNote.Pitch)==null?void 0:s.getHalfTone())!=null?n:0)-((r=t.sourceNote.Pitch.getHalfTone())!=null?r:0)}),this.notes}color(){}}class a4{constructor(e,t){this.musicPages=[],this.measureList=[],this.verticalGraphicalStaffEntryContainers=[],this.cursors=[],this.leadSheet=!1,this.musicSheet=e,this.numberOfStaves=this.musicSheet.Staves.length,this.calculator=t,this.calculator.initialize(this)}get ParentMusicSheet(){return this.musicSheet}get GetCalculator(){return this.calculator}get JianpuKeySignature(){return this.jianpuKeySignature}set JianpuKeySignature(e){this.jianpuKeySignature=e}get MusicPages(){return this.musicPages}set MusicPages(e){this.musicPages=e}get MeasureList(){return this.measureList}set MeasureList(e){this.measureList=e}get VerticalGraphicalStaffEntryContainers(){return this.verticalGraphicalStaffEntryContainers}set VerticalGraphicalStaffEntryContainers(e){this.verticalGraphicalStaffEntryContainers=e}get Title(){return this.title}set Title(e){this.title=e}get Subtitle(){return this.subtitle}set Subtitle(e){this.subtitle=e}get Composer(){return this.composer}set Composer(e){this.composer=e}get Lyricist(){return this.lyricist}set Lyricist(e){this.lyricist=e}get Cursors(){return this.cursors}get SelectionStartSymbol(){return this.selectionStartSymbol}get SelectionEndSymbol(){return this.selectionEndSymbol}get MinAllowedSystemWidth(){return this.minAllowedSystemWidth}set MinAllowedSystemWidth(e){this.minAllowedSystemWidth=e}get NumberOfStaves(){return this.numberOfStaves}get LeadSheet(){return this.leadSheet}set LeadSheet(e){this.leadSheet=e}static transformRelativeToAbsolutePosition(e){for(let t=0;t=0;s--){const n=this.measureList[s][t];if(n)return n}}findGraphicalStaffEntryFromMeasureList(e,t,s){for(let n=t;n0)return o.staffEntries[0]}}getFirstVisibleMeasuresListFromIndices(e,t){const s=[],n=this.measureList[0].length;for(let r=e;r<=t;r++)for(let o=0;o=0;t--){if(this.verticalGraphicalStaffEntryContainers[t].AbsoluteTimestamp.lt(e)){const s=new Lc(this.numberOfStaves,e);return this.verticalGraphicalStaffEntryContainers.splice(t+1,0,s),s}if(this.verticalGraphicalStaffEntryContainers[t].AbsoluteTimestamp.Equals(e))return this.verticalGraphicalStaffEntryContainers[t]}}GetVerticalContainerFromTimestamp(e,t=0){const s=Wn.binarySearch(this.verticalGraphicalStaffEntryContainers,new Lc(0,e),Lc.compareByTimestamp,t);if(s>=0)return this.verticalGraphicalStaffEntryContainers[s]}GetInterpolatedIndexInVerticalContainers(e){const t=this.verticalGraphicalStaffEntryContainers;let s=0,n=t.length-1,r,o;if(e.lte(t[t.length-1].AbsoluteTimestamp)){for(;n-s>1;){const h=Math.floor((n+s)/2);if(t[s].AbsoluteTimestamp.Equals(e)){n=s;break}else if(t[n].AbsoluteTimestamp.Equals(e)){s=n;break}else{if(t[h].AbsoluteTimestamp.Equals(e))return this.verticalGraphicalStaffEntryContainers.indexOf(t[h]);e.lt(t[h].AbsoluteTimestamp)?n=h:s=h}}if(s===n)return this.verticalGraphicalStaffEntryContainers.indexOf(t[s]);r=t[s].AbsoluteTimestamp,o=t[n].AbsoluteTimestamp}else r=t[t.length-1].AbsoluteTimestamp,o=re.plus(this.getLongestStaffEntryDuration(t.length-1),r),n=t.length;const a=o.RealValue-r.RealValue,l=o.RealValue-e.RealValue,u=n-l/a;return Math.min(u,this.verticalGraphicalStaffEntryContainers.length)}getVisibleStavesIndicesFromSourceMeasure(e){const t=[],s=[];for(let n=0,r=e.length;n{var s;return((s=t.parentStaffEntry)==null?void 0:s.relInMeasureTimestamp)!==void 0})}GetNearestNote(e,t){const s=this.GetNearestVoiceEntry(e);if(!s)return;let n,r=Number.MAX_SAFE_INTEGER;for(const o of s.notes){const a=o.PositionAndShape.AbsolutePosition.y,l=Math.abs(o.PositionAndShape.AbsolutePosition.x-e.x),u=Math.abs(a-e.y);l+uo.PositionAndShape.RelativePosition.x&&(s=o):s=o)}}catch(n){ge.info("GraphicalMusicSheet.getStaffEntry",n)}return s}GetPreviousVisibleContainerIndex(e){for(let t=e-1;t>=0;t--){const s=this.verticalGraphicalStaffEntryContainers[t].StaffEntries;for(let n=0,r=s.length;n=0;r--)if(s=this.getStaffEntry(r),s)if(t){if(s.sourceStaffEntry.ParentStaff.ParentInstrument.Visible)return s}else return s}findClosestRightStaffEntry(e,t){let s;const n=Math.max(0,Math.ceil(e));for(let r=n;r{};B.L=(i,e)=>{if(!e)return;const t=Array.prototype.slice.call(e).join(" ");window.console.log(i+": "+t)};B.MakeException=i=>class extends Error{constructor(t,s){super(t),this.name=i,this.message=t,this.data=s}};class S_{constructor(e,t){this.code=e,this.message=t}toString(){return"[RuntimeError] "+this.code+":"+this.message}}B.RuntimeError=S_;B.RERR=B.RuntimeError;B.Merge=(i,e)=>{for(const t in e)i[t]=e[t];return i};B.Min=Math.min;B.Max=Math.max;B.forEach=(i,e)=>{for(let t=0;ti%e>=e/2?parseInt(i/e,10)*e+e:parseInt(i/e,10)*e;B.MidLine=(i,e)=>{let t=e+(i-e)/2;return t%2>0&&(t=B.RoundN(t*10,5)/10),t};B.SortAndUnique=(i,e,t)=>{if(i.length>1){const s=[];let n;i.sort(e);for(let r=0;r{let t=i.length;for(;t--;)if(i[t]===e)return!0;return!1};B.getCanvasContext=i=>{if(!i)throw new B.RERR("BadArgument","Invalid canvas selector: "+i);const e=document.getElementById(i);if(!(e&&e.getContext))throw new B.RERR("UnsupportedBrowserError","This browser does not support HTML5 Canvas");return e.getContext("2d")};B.drawDot=(i,e,t,s="#55")=>{i.save(),i.setFillStyle(s),i.beginPath(),i.arc(e,t,3,0,Math.PI*2,!0),i.closePath(),i.fill(),i.restore()};B.BM=(i,e)=>{const t=new Date().getTime();e();const s=new Date().getTime()-t;B.L(i+s+"ms")};B.StackTrace=()=>new Error().stack;B.W=(...i)=>{const e=i.join(" ");window.console.log("Warning: ",e,B.StackTrace())};B.Prefix=i=>B.Prefix.prefix+i;B.Prefix.prefix="vf-";class Xe{static GCD(e,t){if(typeof e!="number"||typeof t!="number")throw new B.RERR("BadArgument",`Invalid numbers: ${e}, ${t}`);let s;for(;t!==0;)s=t,t=e%t,e=s;return e}static LCM(e,t){return e*t/Xe.GCD(e,t)}static LCMM(e){if(e.length===0)return 0;if(e.length===1)return e[0];if(e.length===2)return Xe.LCM(e[0],e[1]);{const t=e[0];return e.shift(),Xe.LCM(t,Xe.LCMM(e))}}constructor(e,t){this.set(e,t)}set(e,t){return this.numerator=e===void 0?1:e,this.denominator=t===void 0?1:t,this}value(){return this.numerator/this.denominator}simplify(){let e=this.numerator,t=this.denominator;const s=Xe.GCD(e,t);return e/=s,t/=s,t<0&&(t=-t,e=-e),this.set(e,t)}add(e,t){let s,n;e instanceof Xe?(s=e.numerator,n=e.denominator):(e!==void 0?s=e:s=0,t!==void 0?n=t:n=1);const r=Xe.LCM(this.denominator,n),o=r/this.denominator,a=r/n,l=this.numerator*o+s*a;return this.set(l,r)}subtract(e,t){let s,n;e instanceof Xe?(s=e.numerator,n=e.denominator):(e!==void 0?s=e:s=0,t!==void 0?n=t:n=1);const r=Xe.LCM(this.denominator,n),o=r/this.denominator,a=r/n,l=this.numerator*o-s*a;return this.set(l,r)}multiply(e,t){let s,n;return e instanceof Xe?(s=e.numerator,n=e.denominator):(e!==void 0?s=e:s=1,t!==void 0?n=t:n=1),this.set(this.numerator*s,this.denominator*n)}divide(e,t){let s,n;return e instanceof Xe?(s=e.numerator,n=e.denominator):(e!==void 0?s=e:s=1,t!==void 0?n=t:n=1),this.set(this.numerator*n,this.denominator*s)}equals(e){const t=Xe.__compareA.copy(e).simplify(),s=Xe.__compareB.copy(this).simplify();return t.numerator===s.numerator&&t.denominator===s.denominator}greaterThan(e){const t=Xe.__compareB.copy(this);return t.subtract(e),t.numerator>0}greaterThanEquals(e){const t=Xe.__compareB.copy(this);return t.subtract(e),t.numerator>=0}lessThan(e){return!this.greaterThanEquals(e)}lessThanEquals(e){return!this.greaterThan(e)}clone(){return new Xe(this.numerator,this.denominator)}copy(e){return typeof e=="number"?this.set(e||0,1):this.set(e.numerator,e.denominator)}quotient(){return Math.floor(this.numerator/this.denominator)}fraction(){return this.numerator%this.denominator}abs(){return this.denominator=Math.abs(this.denominator),this.numerator=Math.abs(this.numerator),this}toString(){return this.numerator+"/"+this.denominator}toSimplifiedString(){return Xe.__tmp.copy(this).simplify().toString()}toMixedString(){let e="";const t=this.quotient(),s=Xe.__tmp.copy(this);return t<0?s.abs().fraction():s.fraction(),t!==0?(e+=t,s.numerator!==0&&(e+=" "+s.toSimplifiedString())):s.numerator===0?e="0":e=s.toSimplifiedString(),e}parse(e){const t=e.split("/"),s=parseInt(t[0],10),n=t[1]?parseInt(t[1],10):1;return this.set(s,n)}}Xe.__compareA=new Xe;Xe.__compareB=new Xe;Xe.__tmp=new Xe;const A_=B.MakeException("RegistryError");function jm(i,e,t,s,n){i[e][t]||(i[e][t]={}),i[e][t][s]=n}class gn{static get INDEXES(){return["type"]}constructor(){this.clear()}static enableDefaultRegistry(e){gn.defaultRegistry=e}static getDefaultRegistry(){return gn.defaultRegistry}static disableDefaultRegistry(){gn.defaultRegistry=null}clear(){return this.index={id:{},type:{},class:{}},this}updateIndex({id:e,name:t,value:s,oldValue:n}){const r=this.getElementById(e);n!==null&&this.index[t][n]&&delete this.index[t][n][e],s!==null&&jm(this.index,t,s,r.getAttribute("id"),r)}register(e,t){if(t=t||e.getAttribute("id"),!t)throw new A_("Can't add element without `id` attribute to registry",e);return e.setAttribute("id",t),jm(this.index,"id",t,t,e),gn.INDEXES.forEach(s=>{this.updateIndex({id:t,name:s,value:e.getAttribute(s),oldValue:null})}),e.onRegister(this),this}getElementById(e){return this.index.id[e]?this.index.id[e][e]:null}getElementsByAttribute(e,t){const s=this.index[e];return s&&s[t]?Object.keys(s[t]).map(n=>s[t][n]):[]}getElementsByType(e){return this.getElementsByAttribute("type",e)}getElementsByClass(e){return this.getElementsByAttribute("class",e)}onUpdate({id:e,name:t,value:s,oldValue:n}){function r(o,a){return o.filter(l=>l===a).length>0}return r(gn.INDEXES.concat(["id","class"]),t)?(this.updateIndex({id:e,name:t,value:s,oldValue:n}),this):this}}gn.defaultRegistry=null;let qt=class _d{static newID(){return"auto"+_d.ID++}constructor({type:e}={}){this.attrs={id:_d.newID(),el:null,type:e||"Base",classes:{}},this.boundingBox=null,this.context=null,this.rendered=!1,gn.getDefaultRegistry()&&gn.getDefaultRegistry().register(this)}setStyle(e){return this.style=e,this}getStyle(){return this.style}applyStyle(e=this.context,t=this.getStyle()){return t?(e.save(),t.shadowColor&&e.setShadowColor(t.shadowColor),t.shadowBlur&&e.setShadowBlur(t.shadowBlur),t.fillStyle&&e.setFillStyle(t.fillStyle),t.strokeStyle&&e.setStrokeStyle(t.strokeStyle),t.lineWidth&&e.setLineWidth(t.lineWidth),this):this}restoreStyle(e=this.context,t=this.getStyle()){return t?(e.restore(),this):this}drawWithStyle(){this.checkContext(),this.applyStyle(),this.draw(),this.restoreStyle()}hasClass(e){return this.attrs.classes[e]===!0}addClass(e){return this.attrs.classes[e]=!0,this.registry&&this.registry.onUpdate({id:this.getAttribute("id"),name:"class",value:e,oldValue:null}),this}removeClass(e){return delete this.attrs.classes[e],this.registry&&this.registry.onUpdate({id:this.getAttribute("id"),name:"class",value:null,oldValue:e}),this}onRegister(e){return this.registry=e,this}isRendered(){return this.rendered}setRendered(e=!0){return this.rendered=e,this}getAttributes(){return this.attrs}getAttribute(e){return this.attrs[e]}setAttribute(e,t){const s=this.attrs.id,n=this.attrs[e];return this.attrs[e]=t,this.registry&&this.registry.onUpdate({id:s,name:e,value:t,oldValue:n}),this}getContext(){return this.context}setContext(e){return this.context=e,this}getBoundingBox(){return this.boundingBox}checkContext(){if(!this.context)throw new B.RERR("NoContext","No rendering context attached to instance");return this.context}};qt.ID=1e3;class x_{constructor(e,t,s,n){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN,this.addPoint(e,t),this.addPoint(s,n)}width(){return this.x2-this.x1}height(){return this.y2-this.y1}addPoint(e,t){e!=null&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),ethis.x2&&(this.x2=e)),t!=null&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))}addX(e){this.addPoint(e,null)}addY(e){this.addPoint(null,e)}addQuadraticCurve(e,t,s,n,r,o){const a=e+.6666666666666666*(s-e),l=t+2/3*(n-t),u=a+1/3*(r-e),h=l+1/3*(o-t);this.addBezierCurve(e,t,a,l,u,h,r,o)}addBezierCurve(e,t,s,n,r,o,a,l){const u=[e,t],h=[s,n],c=[r,o],f=[a,l];let d;this.addPoint(u[0],u[1]),this.addPoint(f[0],f[1]);const p=(g,m)=>Math.pow(1-g,3)*u[m]+3*Math.pow(1-g,2)*g*h[m]+3*(1-g)*Math.pow(g,2)*c[m]+Math.pow(g,3)*f[m];for(d=0;d<=1;d++){const g=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],b=3*h[d]-3*u[d];if(m===0){if(g===0)continue;const A=-b/g;0{if(!i)throw new B.RERR("BadArgument","Invalid clef: "+i);const e=ie.clefProperties.values[i];if(!e)throw new B.RERR("BadArgument","Invalid clef: "+i);return e};ie.clefProperties.values={treble:{line_shift:0},bass:{line_shift:6},tenor:{line_shift:4},alto:{line_shift:3},soprano:{line_shift:1},percussion:{line_shift:0},"mezzo-soprano":{line_shift:2},"baritone-c":{line_shift:5},"baritone-f":{line_shift:5},subbass:{line_shift:7},french:{line_shift:-1}};ie.keyProperties=(i,e,t)=>{e===void 0&&(e="treble");const s={octave_shift:0};typeof t=="object"&&B.Merge(s,t);const n=i.split("/");if(n.length<2)throw new B.RERR("BadArguments",`Key must have note + octave and an optional glyph: ${i}`);const r=n[0].toUpperCase(),o=ie.keyProperties.note_values[r];if(!o)throw new B.RERR("BadArguments","Invalid key name: "+r);o.octave&&(n[1]=o.octave);let a=parseInt(n[1],10);a+=-1*s.octave_shift;let u=(a*7-4*7+o.index)/2;u+=ie.clefProperties(e).line_shift;let h=0;u<=0&&u*2%2===0&&(h=1),u>=6&&u*2%2===0&&(h=-1);const c=typeof o.int_val<"u"?a*12+o.int_val:null,f=o.code,d=o.shift_right;let p={};if(n.length>2&&n[2]){const g=n[2].toUpperCase();p=ie.keyProperties.customNoteHeads[g]||{}}return{key:r,octave:a,line:u,int_value:c,accidental:o.accidental,code:f,stroke:h,shift_right:d,displaced:!1,...p}};ie.keyProperties.note_values={C:{index:0,int_val:0,accidental:null},CN:{index:0,int_val:0,accidental:"n"},"C#":{index:0,int_val:1,accidental:"#"},"C##":{index:0,int_val:2,accidental:"##"},CB:{index:0,int_val:-1,accidental:"b"},CBB:{index:0,int_val:-2,accidental:"bb"},D:{index:1,int_val:2,accidental:null},DN:{index:1,int_val:2,accidental:"n"},"D#":{index:1,int_val:3,accidental:"#"},"D##":{index:1,int_val:4,accidental:"##"},DB:{index:1,int_val:1,accidental:"b"},DBB:{index:1,int_val:0,accidental:"bb"},E:{index:2,int_val:4,accidental:null},EN:{index:2,int_val:4,accidental:"n"},"E#":{index:2,int_val:5,accidental:"#"},"E##":{index:2,int_val:6,accidental:"##"},EB:{index:2,int_val:3,accidental:"b"},EBB:{index:2,int_val:2,accidental:"bb"},F:{index:3,int_val:5,accidental:null},FN:{index:3,int_val:5,accidental:"n"},"F#":{index:3,int_val:6,accidental:"#"},"F##":{index:3,int_val:7,accidental:"##"},FB:{index:3,int_val:4,accidental:"b"},FBB:{index:3,int_val:3,accidental:"bb"},G:{index:4,int_val:7,accidental:null},GN:{index:4,int_val:7,accidental:"n"},"G#":{index:4,int_val:8,accidental:"#"},"G##":{index:4,int_val:9,accidental:"##"},GB:{index:4,int_val:6,accidental:"b"},GBB:{index:4,int_val:5,accidental:"bb"},A:{index:5,int_val:9,accidental:null},AN:{index:5,int_val:9,accidental:"n"},"A#":{index:5,int_val:10,accidental:"#"},"A##":{index:5,int_val:11,accidental:"##"},AB:{index:5,int_val:8,accidental:"b"},ABB:{index:5,int_val:7,accidental:"bb"},B:{index:6,int_val:11,accidental:null},BN:{index:6,int_val:11,accidental:"n"},"B#":{index:6,int_val:12,accidental:"#"},"B##":{index:6,int_val:13,accidental:"##"},BB:{index:6,int_val:10,accidental:"b"},BBB:{index:6,int_val:9,accidental:"bb"},R:{index:6,int_val:9,rest:!0},X:{index:6,accidental:"",octave:4,code:"v3e",shift_right:5.5}};ie.keyProperties.customNoteHeads={D0:{code:"v27",shift_right:0,stem_up_x_offset:0,stem_down_x_offset:0,stem_up_y_offset:-1,stem_down_y_offset:0},D1:{code:"v2d",shift_right:-.5},D2:{code:"v22",shift_right:-.5},D3:{code:"v70",shift_right:-.5},T0:{code:"v49",shift_right:-2,stem_up_y_offset:-4,stem_down_y_offset:4},T1:{code:"v93",shift_right:.5,stem_up_y_offset:-4,stem_down_y_offset:4},T2:{code:"v40",shift_right:.5,stem_up_y_offset:-4,stem_down_y_offset:4},T3:{code:"v7d",shift_right:.5,stem_up_y_offset:-4,stem_down_y_offset:4},X0:{code:"v92",stem_up_x_offset:-2,stem_down_x_offset:0,stem_up_y_offset:4,stem_down_y_offset:4},X1:{code:"v95",shift_right:-.5,stem_up_y_offset:4,stem_down_y_offset:4},X2:{code:"v3e",shift_right:.5,stem_up_y_offset:4,stem_down_y_offset:4},X3:{code:"v3b",shift_right:0,stem_up_x_offset:-1.2,stem_down_x_offset:0,stem_up_y_offset:-1,stem_down_y_offset:2},S1:{code:"vd3",shift_right:0},S2:{code:"vd2",shift_right:0},R1:{code:"vd5",shift_right:0},R2:{code:"vd4",shift_right:0}};ie.integerToNote=i=>{if(typeof i>"u")throw new B.RERR("BadArguments","Undefined integer for integerToNote");if(i<-2)throw new B.RERR("BadArguments",`integerToNote requires integer > -2: ${i}`);const e=ie.integerToNote.table[i];if(!e)throw new B.RERR("BadArguments",`Unknown note value for integer: ${i}`);return e};ie.integerToNote.table={0:"C",1:"C#",2:"D",3:"D#",4:"E",5:"F",6:"F#",7:"G",8:"G#",9:"A",10:"A#",11:"B"};ie.tabToGlyph=(i,e=1)=>{let t=null,s=0,n=0;if(i.toString().toUpperCase()==="X"){const r=new De("v7f",ie.DEFAULT_TABLATURE_FONT_SCALE).getMetrics();t="v7f",s=r.width,n=-r.height/2}else s=ie.textWidth(i.toString());return{text:i,code:t,getWidth:()=>s*e,shift_y:n}};ie.textWidth=i=>7*i.toString().length;ie.articulationCodes=i=>ie.articulationCodes.articulations[i];ie.articulationCodes.articulations={"a.":{code:"v23",between_lines:!0},av:{code:"v28",between_lines:!0},"a>":{code:"v42",between_lines:!0},"a-":{code:"v25",between_lines:!0},"a^":{code:"va",between_lines:!1},"a+":{code:"v8b",between_lines:!1},ao:{code:"v94",between_lines:!1},ah:{code:"vb9",between_lines:!1},"a@a":{code:"v43",between_lines:!1},"a@u":{code:"v5b",between_lines:!1},"a|":{code:"v75",between_lines:!1},am:{code:"v97",between_lines:!1},"a,":{code:"vb3",between_lines:!1}};ie.accidentalCodes=i=>ie.accidentalCodes.accidentals[i];ie.accidentalCodes.accidentals={"#":{code:"v18",parenRightPaddingAdjustment:-1},"##":{code:"v7f",parenRightPaddingAdjustment:-1},b:{code:"v44",parenRightPaddingAdjustment:-2},bb:{code:"v26",parenRightPaddingAdjustment:-2},n:{code:"v4e",parenRightPaddingAdjustment:-1},"{":{code:"v9c",parenRightPaddingAdjustment:-1},"}":{code:"v84",parenRightPaddingAdjustment:-1},db:{code:"v9e",parenRightPaddingAdjustment:-1},d:{code:"vab",parenRightPaddingAdjustment:0},bbs:{code:"v90",parenRightPaddingAdjustment:-1},"++":{code:"v51",parenRightPaddingAdjustment:-1},"+":{code:"v78",parenRightPaddingAdjustment:-1},"+-":{code:"v8d",parenRightPaddingAdjustment:-1},"++-":{code:"v7a",parenRightPaddingAdjustment:-1},bs:{code:"vb7",parenRightPaddingAdjustment:-1},bss:{code:"v39",parenRightPaddingAdjustment:-1},o:{code:"vd0",parenRightPaddingAdjustment:-1},k:{code:"vd1",parenRightPaddingAdjustment:-1},ashs:{code:"vd6",parenRightPaddingAdjustment:-1},afhf:{code:"vd7",parenRightPaddingAdjustment:-1}};ie.accidentalColumnsTable={1:{a:[1],b:[1]},2:{a:[1,2]},3:{a:[1,3,2],b:[1,2,1],second_on_bottom:[1,2,3]},4:{a:[1,3,4,2],b:[1,2,3,1],spaced_out_tetrachord:[1,2,1,2]},5:{a:[1,3,5,4,2],b:[1,2,4,3,1],spaced_out_pentachord:[1,2,3,2,1],very_spaced_out_pentachord:[1,2,1,2,1]},6:{a:[1,3,5,6,4,2],b:[1,2,4,5,3,1],spaced_out_hexachord:[1,3,2,1,3,2],very_spaced_out_hexachord:[1,2,1,2,1,2]}};ie.ornamentCodes=i=>ie.ornamentCodes.ornaments[i];ie.ornamentCodes.ornaments={mordent:{code:"v1e"},mordent_inverted:{code:"v45"},turn:{code:"v72"},turn_inverted:{code:"v33"},tr:{code:"v1f"},upprall:{code:"v60"},downprall:{code:"vb4"},prallup:{code:"v6d"},pralldown:{code:"v2c"},upmordent:{code:"v29"},downmordent:{code:"v68"},lineprall:{code:"v20"},prallprall:{code:"v86"}};ie.keySignature=i=>{const e=ie.keySignature.keySpecs[i];if(!e)throw new B.RERR("BadKeySignature",`Bad key signature spec: '${i}'`);if(!e.acc)return[];const t=ie.keySignature.accidentalList(e.acc),s=[];for(let n=0;n({b:[2,.5,2.5,1,3,1.5,3.5],"#":[0,1.5,-.5,1,2.5,.5,2]})[i];ie.parseNoteDurationString=i=>{if(typeof i!="string")return null;const t=/(\d*\/?\d+|[a-z])(d*)([nrhms]|$)/.exec(i);if(!t)return null;const s=t[1],n=t[2].length;let r=t[3];return r.length===0&&(r="n"),{duration:s,dots:n,type:r}};ie.parseNoteStruct=i=>{const e=i.duration,t=ie.parseNoteDurationString(e);if(!t)return null;let s=ie.durationToTicks(t.duration);if(s==null)return null;let n=i.type;const r=[];if(n){if(!ie.getGlyphProps.validTypes[n])return null}else n=t.type||"n",i.keys!==void 0&&i.keys.forEach((l,u)=>{const h=l.split("/");h&&h.length===3&&(r[u]=h[2])});const o=i.dots?i.dots:t.dots;if(typeof o!="number")return null;let a=s;for(let l=0;l{const e=ie.durationAliases[i];if(e!==void 0&&(i=e),ie.durationToTicks.durations[i]===void 0)throw new B.RERR("BadArguments",`The provided duration is not valid: ${i}`);return i};ie.durationToFraction=i=>new Xe().parse(ie.sanitizeDuration(i));ie.durationToNumber=i=>ie.durationToFraction(i).value();ie.durationToTicks=i=>{i=ie.sanitizeDuration(i);const e=ie.durationToTicks.durations[i];return e===void 0?null:e};ie.durationToTicks.durations={"1/2":ie.RESOLUTION*2,1:ie.RESOLUTION/1,2:ie.RESOLUTION/2,4:ie.RESOLUTION/4,8:ie.RESOLUTION/8,16:ie.RESOLUTION/16,32:ie.RESOLUTION/32,64:ie.RESOLUTION/64,128:ie.RESOLUTION/128,256:ie.RESOLUTION/256};ie.durationAliases={w:"1",h:"2",q:"4",b:"256"};ie.getGlyphProps=(i,e)=>{i=ie.sanitizeDuration(i);const t=ie.getGlyphProps.duration_codes[i];if(t===void 0)return null;e||(e="n");let s=t.type[e];if(s===void 0){const n=ie.keyProperties.customNoteHeads[e.toUpperCase()];if(n===void 0)return null;s={code_head:n.code,...n}}return{...t.common,...s}};ie.getGlyphProps.validTypes={n:{name:"note"},r:{name:"rest"},h:{name:"harmonic"},m:{name:"muted"},s:{name:"slash"}};ie.getGlyphProps.duration_codes={"1/2":{common:{getWidth(i=ie.DEFAULT_NOTATION_FONT_SCALE){return new De(this.code_head||"v53",i).getMetrics().width},stem:!1,stem_offset:0,flag:!1,stem_up_extension:-ie.STEM_HEIGHT,stem_down_extension:-ie.STEM_HEIGHT,tabnote_stem_up_extension:-ie.STEM_HEIGHT,tabnote_stem_down_extension:-ie.STEM_HEIGHT,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"v53"},h:{code_head:"v59"},m:{code_head:"vf",stem_offset:0},r:{code_head:"v31",rest:!0,position:"B/5",dot_shiftY:.5},s:{getWidth:()=>ie.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},1:{common:{getWidth(i=ie.DEFAULT_NOTATION_FONT_SCALE){return new De(this.code_head||"v1d",i).getMetrics().width},stem:!1,stem_offset:0,flag:!1,stem_up_extension:-ie.STEM_HEIGHT,stem_down_extension:-ie.STEM_HEIGHT,tabnote_stem_up_extension:-ie.STEM_HEIGHT,tabnote_stem_down_extension:-ie.STEM_HEIGHT,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"v1d"},h:{code_head:"v46"},m:{code_head:"v92",stem_offset:-3},r:{code_head:"v5c",rest:!0,position:"D/5",dot_shiftY:.5},s:{getWidth:()=>ie.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},2:{common:{getWidth(i=ie.DEFAULT_NOTATION_FONT_SCALE){return new De(this.code_head||"v81",i).getMetrics().width},stem:!0,stem_offset:0,flag:!1,stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"v81"},h:{code_head:"v2d"},m:{code_head:"v95",stem_offset:-3},r:{code_head:"vc",stem:!1,rest:!0,position:"B/4",dot_shiftY:-.5},s:{getWidth:()=>ie.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},4:{common:{getWidth(i=ie.DEFAULT_NOTATION_FONT_SCALE){return new De(this.code_head||"vb",i).getMetrics().width},stem:!0,stem_offset:0,flag:!1,stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e",stem_offset:-3},r:{code_head:"v7c",stem:!1,rest:!0,position:"B/4",dot_shiftY:-.5,line_above:1.5,line_below:1.5},s:{getWidth:()=>ie.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},8:{common:{getWidth(i=ie.DEFAULT_NOTATION_FONT_SCALE){return new De(this.code_head||"vb",i).getMetrics().width},stem:!0,stem_offset:0,flag:!0,beam_count:1,code_flag_upstem:"v54",code_flag_downstem:"v9a",stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"va5",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-.5,line_above:1,line_below:1},s:{getWidth:()=>ie.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},16:{common:{beam_count:2,getWidth(i=ie.DEFAULT_NOTATION_FONT_SCALE){return new De(this.code_head||"vb",i).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"v3f",code_flag_downstem:"v8f",stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"v3c",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-.5,line_above:1,line_below:2},s:{getWidth:()=>ie.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},32:{common:{beam_count:3,getWidth(i=ie.DEFAULT_NOTATION_FONT_SCALE){return new De(this.code_head||"vb",i).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"v47",code_flag_downstem:"v2a",stem_up_extension:9,stem_down_extension:9,tabnote_stem_up_extension:8,tabnote_stem_down_extension:5,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"v55",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-1.5,line_above:2,line_below:2},s:{getWidth:()=>ie.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},64:{common:{beam_count:4,getWidth(i=ie.DEFAULT_NOTATION_FONT_SCALE){return new De(this.code_head||"vb",i).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"va9",code_flag_downstem:"v58",stem_up_extension:13,stem_down_extension:13,tabnote_stem_up_extension:12,tabnote_stem_down_extension:9,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"v38",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-1.5,line_above:2,line_below:3},s:{getWidth:()=>ie.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},128:{common:{beam_count:5,getWidth(i=ie.DEFAULT_NOTATION_FONT_SCALE){return new De(this.code_head||"vb",i).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"v9b",code_flag_downstem:"v30",stem_up_extension:22,stem_down_extension:22,tabnote_stem_up_extension:21,tabnote_stem_down_extension:18,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"vaa",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:1.5,line_above:3,line_below:3},s:{getWidth:()=>ie.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}}};ie.smufl={};ie.smufl.to_code_points={bracketTop:"v1b",bracketBottom:"v10",barlineTick:"v6f",segno:"v8c",coda:"v4d",gClef:"v83",cClef:"vad",fClef:"v79",unpitchedPercussionClef1:"v59","6stringTabClef":"v2f",timeSig0:"v0",timeSig1:"v1",timeSig2:"v2",timeSig3:"v3",timeSig4:"v4",timeSig5:"v5",timeSig6:"v6",timeSig7:"v7",timeSig8:"v8",timeSig9:"v9",timeSigCommon:"v41",timeSigCutCommon:"vb6",noteheadDoubleWhole:"v53",noteheadWhole:"v1d",noteheadHalf:"v81",noteheadBlack:"vb",noteheadXWhole:"v92",noteheadXHalf:"v95",noteheadXBlack:"v3e",noteheadCircleX:"v3b",noteheadTriangleUpWhole:"v49",noteheadTriangleUpHalf:"v93",noteheadTriangleUpBlack:"v40",noteheadDiamondWhole:"v46",noteheadDiamondHalf:"v2d",noteheadDiamondBlack:"v22",augmentationDot:"v23",tremolo1:"v74",flag8thUp:"v54",flag8thDown:"v9a",flag16thUp:"v3f",flag16thDown:"v8f",flag32ndUp:"v47",flag32ndDown:"v2a",flag64thUp:"va9",flag64thDown:"v58",flag128thUp:"v9b",flag128thDown:"v30",accidentalFlat:"v44",accidentalNatural:"v4e",accidentalSharp:"v18",accidentalDoubleSharp:"v7f",accidentalDoubleFlat:"v26",accidentalParensLeft:"v9c",accidentalParensRight:"v84",accidentalQuarterToneFlatStein:"vab",accidentalThreeQuarterTonesFlatZimmermann:"v9e",accidentalQuarterToneSharpStein:"v78",accidentalThreeQuarterTonesSharpStein:"v51",accidentalBuyukMucennebFlat:"v39",accidentalBakiyeFlat:"vb7",accidentalKomaSharp:"v51",accidentalKucukMucennebSharp:"v8d",accidentalKoron:"vd1",accidentalSori:"vd0",articAccentAbove:"v42",articAccentBelow:"v42",articTenutoAbove:"v25",articTenutoBelow:"v25",articStaccatoAbove:"v23",articStaccatoBelow:"v23",articStaccatissimoAbove:"v28",articMarcatoAbove:"va",fermataAbove:"v43",fermataBelow:"v5b",breathMarkComma:"v6c",breathMarkUpbow:"v8a",caesura:"v34",caesuraCurved:"v4b",restMaxima:"v59",restDoubleWhole:"v31",restWhole:"v5c",restHalf:"vc",restQuarter:"v7c",rest8th:"va5",rest16th:"v3c",rest32nd:"v55",rest64th:"v38",rest128th:"vaa",dynamicPiano:"vbf",dynamicMezzo:"v62",dynamicForte:"vba",dynamicRinforzando:"vba",dynamicSforzando:"v4a",dynamicZ:"v80",ornamentTrill:"v1f",ornamentTurn:"v72",ornamentTurnSlash:"v33",ornamentMordent:"v45",ornamentMordentInverted:"v1e",ornamentTremblement:"v86",ornamentPrecompAppoggTrill:"v20",ornamentPrecompSlideTrillDAnglebert:"v60",ornamentPrecompSlideTrillBach:"v29",ornamentPrecompTrillSuffixDandrieu:"v6d",ornamentPrecompDoubleCadenceUpperPrefix:"vb4",ornamentPrecompDoubleCadenceUpperPrefixTurn:"v68",ornamentPrecompTrillLowerSuffix:"v2c",stringsDownBow:"v94",stringsUpBow:"v75",stringsHarmonic:"vb9",pluckedSnapPizzicatoAbove:"v94",pluckedLeftHandPizzicato:"v8b",keyboardPedalPed:"v36",keyboardPedalUp:"v5d",pictChokeCymbal:"vb3",wiggleArpeggiatoUp:"va3",arrowheadBlackUp:"vc3",arrowheadBlackDown:"v52"};ie.TIME4_4={num_beats:4,beat_value:4,resolution:ie.RESOLUTION};class Ko{static get WIDTH(){return 600}static get HEIGHT(){return 400}static get CANVAS_BROWSER_SIZE_LIMIT(){return 32767}static SanitizeCanvasDims(e,t){return Math.max(e,t)>this.CANVAS_BROWSER_SIZE_LIMIT&&(B.W("Canvas dimensions exceed browser limit. Cropping to "+this.CANVAS_BROWSER_SIZE_LIMIT),e>this.CANVAS_BROWSER_SIZE_LIMIT&&(e=this.CANVAS_BROWSER_SIZE_LIMIT),t>this.CANVAS_BROWSER_SIZE_LIMIT&&(t=this.CANVAS_BROWSER_SIZE_LIMIT)),[e,t]}constructor(e){this.vexFlowCanvasContext=e,e.canvas?this.canvas=e.canvas:this.canvas={width:Ko.WIDTH,height:Ko.HEIGHT}}clear(){this.vexFlowCanvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}openGroup(){}closeGroup(){}add(){}setFont(e,t,s){return this.vexFlowCanvasContext.font=(s||"")+" "+t+"pt "+e,this}setRawFont(e){return this.vexFlowCanvasContext.font=e,this}setFillStyle(e){return this.vexFlowCanvasContext.fillStyle=e,this}setBackgroundFillStyle(e){return this.background_fillStyle=e,this}setStrokeStyle(e){return this.vexFlowCanvasContext.strokeStyle=e,this}setShadowColor(e){return this.vexFlowCanvasContext.shadowColor=e,this}setShadowBlur(e){return this.vexFlowCanvasContext.shadowBlur=e,this}setLineWidth(e){return this.vexFlowCanvasContext.lineWidth=e,this}setLineCap(e){return this.vexFlowCanvasContext.lineCap=e,this}setLineDash(e){return this.vexFlowCanvasContext.lineDash=e,this}scale(e,t){return this.vexFlowCanvasContext.scale(parseFloat(e),parseFloat(t))}resize(e,t){return[e,t]=this.SanitizeCanvasDims(parseInt(e,10),parseInt(t,10)),this.vexFlowCanvasContext.resize(e,t)}rect(e,t,s,n){return this.vexFlowCanvasContext.rect(e,t,s,n)}fillRect(e,t,s,n){return this.vexFlowCanvasContext.fillRect(e,t,s,n)}clearRect(e,t,s,n){return this.vexFlowCanvasContext.clearRect(e,t,s,n)}beginPath(){return this.vexFlowCanvasContext.beginPath()}moveTo(e,t){return this.vexFlowCanvasContext.moveTo(e,t)}lineTo(e,t){return this.vexFlowCanvasContext.lineTo(e,t)}bezierCurveTo(e,t,s,n,r,o){return this.vexFlowCanvasContext.bezierCurveTo(e,t,s,n,r,o)}quadraticCurveTo(e,t,s,n){return this.vexFlowCanvasContext.quadraticCurveTo(e,t,s,n)}arc(e,t,s,n,r,o){return this.vexFlowCanvasContext.arc(e,t,s,n,r,o)}glow(){return this.vexFlowCanvasContext.glow()}fill(){return this.vexFlowCanvasContext.fill()}stroke(){return this.vexFlowCanvasContext.stroke()}closePath(){return this.vexFlowCanvasContext.closePath()}measureText(e){return this.vexFlowCanvasContext.measureText(e)}fillText(e,t,s){return this.vexFlowCanvasContext.fillText(e,t,s)}save(){return this.vexFlowCanvasContext.save()}restore(){return this.vexFlowCanvasContext.restore()}}class w_{constructor(e){this.element=e,this.paper=Raphael(e),this.path="",this.pen={x:0,y:0},this.lineWidth=1,this.state={scale:{x:1,y:1},font_family:"Arial",font_size:8,font_weight:800},this.attributes={"stroke-width":.3,fill:"black",stroke:"black",font:"10pt Arial"},this.background_attributes={"stroke-width":0,fill:"white",stroke:"white",font:"10pt Arial"},this.shadow_attributes={width:0,color:"black"},this.state_stack=[]}openGroup(){}closeGroup(){}add(){}setFont(e,t,s){return this.state.font_family=e,this.state.font_size=t,this.state.font_weight=s,this.attributes.font=(this.state.font_weight||"")+" "+this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this}setRawFont(e){return this.attributes.font=e,this}setFillStyle(e){return this.attributes.fill=e,this}setBackgroundFillStyle(e){return this.background_attributes.fill=e,this.background_attributes.stroke=e,this}setStrokeStyle(e){return this.attributes.stroke=e,this}setShadowColor(e){return this.shadow_attributes.color=e,this}setShadowBlur(e){return this.shadow_attributes.width=e,this}setLineWidth(e){this.attributes["stroke-width"]=e,this.lineWidth=e}setLineDash(){return this}setLineCap(){return this}scale(e,t){return this.state.scale={x:e,y:t},this.attributes.transform="S"+e+","+t+",0,0",this.attributes.scale=e+","+t+",0,0",this.attributes.font=this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this.background_attributes.transform="S"+e+","+t+",0,0",this.background_attributes.font=this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this}clear(){this.paper.clear()}resize(e,t){return this.element.style.width=e,this.paper.setSize(e,t),this}setViewBox(e){this.paper.canvas.setAttribute("viewBox",e)}rect(e,t,s,n){return n<0&&(t+=n,n=-n),this.paper.rect(e,t,s-.5,n-.5).attr(this.attributes).attr("fill","none").attr("stroke-width",this.lineWidth),this}fillRect(e,t,s,n){return n<0&&(t+=n,n=-n),this.paper.rect(e,t,s-.5,n-.5).attr(this.attributes),this}clearRect(e,t,s,n){return n<0&&(t+=n,n=-n),this.paper.rect(e,t,s-.5,n-.5).attr(this.background_attributes),this}beginPath(){return this.path="",this.pen.x=0,this.pen.y=0,this}moveTo(e,t){return this.path+="M"+e+","+t,this.pen.x=e,this.pen.y=t,this}lineTo(e,t){return this.path+="L"+e+","+t,this.pen.x=e,this.pen.y=t,this}bezierCurveTo(e,t,s,n,r,o){return this.path+="C"+e+","+t+","+s+","+n+","+r+","+o,this.pen.x=r,this.pen.y=o,this}quadraticCurveTo(e,t,s,n){return this.path+="Q"+e+","+t+","+s+","+n,this.pen.x=s,this.pen.y=n,this}arc(e,t,s,n,r,o){function a(u){for(;u<0;)u+=Math.PI*2;for(;u>Math.PI*2;)u-=Math.PI*2;return u}if(n=a(n),r=a(r),n>r){const u=n;n=r,r=u,o=!o}const l=r-n;return l>Math.PI?(this.arcHelper(e,t,s,n,n+l/2,o),this.arcHelper(e,t,s,n+l/2,r,o)):this.arcHelper(e,t,s,n,r,o),this}arcHelper(e,t,s,n,r,o){const a=e+s*Math.cos(n),l=t+s*Math.sin(n),u=e+s*Math.cos(r),h=t+s*Math.sin(r);let c=0,f=0;o?(f=1,r-nMath.PI&&(c=1),this.path+="M"+a+","+l+",A"+s+","+s+",0,"+c+","+f+","+u+","+h+"M"+this.pen.x+","+this.pen.y}glow(){const e=this.paper.set();if(this.shadow_attributes.width>0){const t=this.shadow_attributes,s=t.width/2;for(let n=1;n<=s;n++)e.push(this.paper.path(this.path).attr({stroke:t.color,"stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(t.width/s*n).toFixed(3),opacity:+((t.opacity||.3)/s).toFixed(3),transform:this.attributes.transform,scale:this.attributes.scale}))}return e}fill(){const e=this.paper.path(this.path).attr(this.attributes).attr("stroke-width",0);return this.glow(e),this}stroke(){const e=this.lineWidth*(this.state.scale.x+this.state.scale.y)/2,t=this.paper.path(this.path).attr(this.attributes).attr("fill","none").attr("stroke-width",e);return this.glow(t),this}closePath(){return this.path+="Z",this}measureText(e){const t=this.paper.text(0,0,e).attr(this.attributes).attr("fill","none").attr("stroke","none"),s=t.getBBox();return t.remove(),{width:s.width,height:s.height}}fillText(e,t,s){return this.paper.text(t+this.measureText(e).width/2,s-this.state.font_size/(2.25*this.state.scale.y),e).attr(this.attributes),this}save(){return this.state_stack.push({state:{font_family:this.state.font_family},attributes:{font:this.attributes.font,fill:this.attributes.fill,stroke:this.attributes.stroke,"stroke-width":this.attributes["stroke-width"]},shadow_attributes:{width:this.shadow_attributes.width,color:this.shadow_attributes.color}}),this}restore(){const e=this.state_stack.pop();return this.state.font_family=e.state.font_family,this.attributes.font=e.attributes.font,this.attributes.fill=e.attributes.fill,this.attributes.stroke=e.attributes.stroke,this.attributes["stroke-width"]=e.attributes["stroke-width"],this.shadow_attributes.width=e.shadow_attributes.width,this.shadow_attributes.color=e.shadow_attributes.color,this}}const Md={path:{x:!0,y:!0,width:!0,height:!0},rect:{},text:{width:!0,height:!0}};{const i={"font-family":!0,"font-weight":!0,"font-style":!0,"font-size":!0};B.Merge(Md.rect,i),B.Merge(Md.path,i)}class E_{constructor(e){this.element=e,this.svgNS="http://www.w3.org/2000/svg";const t=this.create("svg");this.element.appendChild(t),this.svg=t,this.groups=[this.svg],this.parent=this.svg,this.path="",this.pen={x:NaN,y:NaN},this.lineWidth=1,this.state={scale:{x:1,y:1},"font-family":"Arial","font-size":"8pt","font-weight":"normal"},this.attributes={"stroke-width":.3,fill:"black",stroke:"black","stroke-dasharray":"none","font-family":"Arial","font-size":"10pt","font-weight":"normal","font-style":"normal"},this.background_attributes={"stroke-width":0,fill:"white",stroke:"white","stroke-dasharray":"none","font-family":"Arial","font-size":"10pt","font-weight":"normal","font-style":"normal"},this.shadow_attributes={width:0,color:"black"},this.state_stack=[],this.iePolyfill()}create(e){return document.createElementNS(this.svgNS,e)}openGroup(e,t,s){const n=this.create("g");return this.groups.push(n),this.parent.appendChild(n),this.parent=n,e&&n.setAttribute("class",B.Prefix(e)),t&&n.setAttribute("id",B.Prefix(t)),s&&s.pointerBBox&&n.setAttribute("pointer-events","bounding-box"),n}closeGroup(){this.groups.pop(),this.parent=this.groups[this.groups.length-1]}add(e){this.parent.appendChild(e)}iePolyfill(){typeof navigator<"u"&&(this.ie=/MSIE 9/i.test(navigator.userAgent)||/MSIE 10/i.test(navigator.userAgent)||/rv:11\.0/i.test(navigator.userAgent)||/Trident/i.test(navigator.userAgent))}setFont(e,t,s){let n=!1,r=!1,o="normal";typeof s=="string"&&(s.indexOf("italic")!==-1&&(s=s.replace(/italic/g,""),r=!0),s.indexOf("bold")!==-1&&(s=s.replace(/bold/g,""),n=!0),s=s.replace(/ /g,"")),s=n?"bold":s,s=typeof s>"u"||s===""?"normal":s,o=r?"italic":o;const a={"font-family":e,"font-size":t+"pt","font-weight":s,"font-style":o};return this.fontSize=Number(t),B.Merge(this.attributes,a),B.Merge(this.state,a),this}setRawFont(e){e=e.trim();const t=e.split(" ");return this.attributes["font-family"]=t[1],this.state["font-family"]=t[1],this.attributes["font-size"]=t[0],this.state["font-size"]=t[0],this.fontSize=Number(t[0].match(/\d+/)),this}setFillStyle(e){return this.attributes.fill=e,this}setBackgroundFillStyle(e){return this.background_attributes.fill=e,this.background_attributes.stroke=e,this}setStrokeStyle(e){return this.attributes.stroke=e,this}setShadowColor(e){return this.shadow_attributes.color=e,this}setShadowBlur(e){return this.shadow_attributes.width=e,this}setLineWidth(e){this.attributes["stroke-width"]=e,this.lineWidth=e}setLineDash(e){if(Object.prototype.toString.call(e)==="[object Array]")return e=e.join(", "),this.attributes["stroke-dasharray"]=e,this;throw new B.RERR("ArgumentError","lineDash must be an array of integers.")}setLineCap(e){return this.attributes["stroke-linecap"]=e,this}resize(e,t){this.width=e,this.height=t,this.element.style.width=e;const s={width:e,height:t};return this.applyAttributes(this.svg,s),this.scale(this.state.scale.x,this.state.scale.y),this}scale(e,t){this.state.scale={x:e,y:t};const s=this.width/e,n=this.height/t;return this.setViewBox(0,0,s,n),this}setViewBox(...e){if(e.length===1){const[t]=e;this.svg.setAttribute("viewBox",t)}else{const[t,s,n,r]=e,o=t+" "+s+" "+n+" "+r;this.svg.setAttribute("viewBox",o)}}applyAttributes(e,t){const s=Md[e.nodeName];return Object.keys(t).forEach(n=>{var r;s&&s[n]||!n||!t[n]||n==="d"&&((r=t[n])==null?void 0:r.indexOf("NaN"))>-1||e.setAttributeNS(null,n,t[n])}),e}clear(){for(;this.svg.lastChild;)this.svg.removeChild(this.svg.lastChild);this.scale(this.state.scale.x,this.state.scale.y)}rect(e,t,s,n,r){n<0&&(t+=n,n*=-1);const o=this.create("rect");return typeof r>"u"&&(r={fill:"none","stroke-width":this.lineWidth,stroke:"black"}),B.Merge(r,{x:e,y:t,width:s,height:n}),this.applyAttributes(o,r),this.add(o),this}fillRect(e,t,s,n){return n<0&&(t+=n,n*=-1),this.rect(e,t,s,n,this.attributes),this}clearRect(e,t,s,n){return this.rect(e,t,s,n,this.background_attributes),this}beginPath(){return this.path="",this.pen.x=NaN,this.pen.y=NaN,this}moveTo(e,t){return this.path+="M"+e+" "+t,this.pen.x=e,this.pen.y=t,this}lineTo(e,t){return this.path+="L"+e+" "+t,this.pen.x=e,this.pen.y=t,this}bezierCurveTo(e,t,s,n,r,o){return this.path+="C"+e+" "+t+","+s+" "+n+","+r+" "+o,this.pen.x=r,this.pen.y=o,this}quadraticCurveTo(e,t,s,n){return this.path+="Q"+e+" "+t+","+s+" "+n,this.pen.x=s,this.pen.y=n,this}arc(e,t,s,n,r,o){function a(u){for(;u<0;)u+=Math.PI*2;for(;u>Math.PI*2;)u-=Math.PI*2;return u}if(n=a(n),r=a(r),n>r){const u=n;n=r,r=u,o=!o}const l=r-n;return l>Math.PI?(this.arcHelper(e,t,s,n,n+l/2,o),this.arcHelper(e,t,s,n+l/2,r,o)):this.arcHelper(e,t,s,n,r,o),this}arcHelper(e,t,s,n,r,o){const a=e+s*Math.cos(n),l=t+s*Math.sin(n),u=e+s*Math.cos(r),h=t+s*Math.sin(r);let c=0,f=0;o?(f=1,r-nMath.PI&&(c=1),this.path+="M"+a+" "+l+" A"+s+" "+s+" 0 "+c+" "+f+" "+u+" "+h,!isNaN(this.pen.x)&&!isNaN(this.pen.y)&&(this.peth+="M"+this.pen.x+" "+this.pen.y)}closePath(){return this.path+="Z",this}glow(){if(this.shadow_attributes.width>0){const e=this.shadow_attributes,t=e.width/2;for(let s=1;s<=t;s++){const n={stroke:e.color,"stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(e.width*.4/t*s).toFixed(3),opacity:+((e.opacity||.3)/t).toFixed(3)},r=this.create("path");n.d=this.path,this.applyAttributes(r,n),this.add(r)}}return this}fill(e){this.glow();const t=this.create("path");let s=e;return typeof e>"u"?(e={},B.Merge(e,this.attributes),e.stroke="none",s=e):(s=e,B.Merge(s,this.attributes),e.class&&(s.class=e.class),e.id&&(s.id=e.id)),e.d=this.path,this.applyAttributes(t,e),this.add(t),this}stroke(e=void 0){this.glow();const t=this.create("path"),s={};return B.Merge(s,this.attributes),e&&B.Merge(s,e),s.fill="none",s["stroke-width"]=this.lineWidth,s.d=this.path,this.applyAttributes(t,s),this.add(t),this}measureText(e){const t=this.create("text");if(typeof t.getBBox!="function")return{x:0,y:0,width:0,height:0};t.textContent=e,this.applyAttributes(t,this.attributes),this.svg.appendChild(t);let s=t.getBBox();return this.ie&&e!==""&&this.attributes["font-style"]==="italic"&&(s=this.ieMeasureTextFix(s,e)),this.svg.removeChild(t),s}ieMeasureTextFix(e){const t=Number(this.fontSize),s=1.196,n=1.9598,r=s*t+n,o=e.width-r,a=e.height-1.5;return{x:e.x,y:e.y,width:o,height:a}}fillText(e,t,s){if(!e||e.length<=0)return;const n={};B.Merge(n,this.attributes),n.stroke="none",n.x=t,n.y=s;const r=this.create("text");r.textContent=e,this.applyAttributes(r,n),this.add(r)}save(){return this.state_stack.push({state:{"font-family":this.state["font-family"],"font-weight":this.state["font-weight"],"font-style":this.state["font-style"],"font-size":this.state["font-size"],scale:this.state.scale},attributes:{"font-family":this.attributes["font-family"],"font-weight":this.attributes["font-weight"],"font-style":this.attributes["font-style"],"font-size":this.attributes["font-size"],fill:this.attributes.fill,stroke:this.attributes.stroke,"stroke-width":this.attributes["stroke-width"],"stroke-dasharray":this.attributes["stroke-dasharray"]},shadow_attributes:{width:this.shadow_attributes.width,color:this.shadow_attributes.color},lineWidth:this.lineWidth}),this}restore(){const e=this.state_stack.pop();return this.state["font-family"]=e.state["font-family"],this.state["font-weight"]=e.state["font-weight"],this.state["font-style"]=e.state["font-style"],this.state["font-size"]=e.state["font-size"],this.state.scale=e.state.scale,this.attributes["font-family"]=e.attributes["font-family"],this.attributes["font-weight"]=e.attributes["font-weight"],this.attributes["font-style"]=e.attributes["font-style"],this.attributes["font-size"]=e.attributes["font-size"],this.attributes.fill=e.attributes.fill,this.attributes.stroke=e.attributes.stroke,this.attributes["stroke-width"]=e.attributes["stroke-width"],this.attributes["stroke-dasharray"]=e.attributes["stroke-dasharray"],this.shadow_attributes.width=e.shadow_attributes.width,this.shadow_attributes.color=e.shadow_attributes.color,this.lineWidth=e.lineWidth,this}}let Jm=null;class yt{static get Backends(){return{CANVAS:1,RAPHAEL:2,SVG:3,VML:4}}static get LineEndType(){return{NONE:1,UP:2,DOWN:3}}static get USE_CANVAS_PROXY(){return!1}static get lastContext(){return Jm}static set lastContext(e){Jm=e}static buildContext(e,t,s,n,r){const o=new yt(e,t);s&&n&&o.resize(s,n),r||(r="#FFF");const a=o.getContext();return a.setBackgroundFillStyle(r),yt.lastContext=a,a}static getCanvasContext(e,t,s,n){return yt.buildContext(e,yt.Backends.CANVAS,t,s,n)}static getRaphaelContext(e,t,s,n){return yt.buildContext(e,yt.Backends.RAPHAEL,t,s,n)}static getSVGContext(e,t,s,n){return yt.buildContext(e,yt.Backends.SVG,t,s,n)}static bolsterCanvasContext(e){if(yt.USE_CANVAS_PROXY)return new Ko(e);const t=["clear","setFont","setRawFont","setFillStyle","setBackgroundFillStyle","setStrokeStyle","setShadowColor","setShadowBlur","setLineWidth","setLineCap","setLineDash","openGroup","closeGroup","getGroup"];return e.vexFlowCanvasContext=e,t.forEach(s=>{e[s]=e[s]||Ko.prototype[s]}),e}static drawDashedLine(e,t,s,n,r,o){e.beginPath();const a=n-t,l=r-s,u=Math.atan2(l,a);let h=t,c=s;e.moveTo(t,s);let f=0,d=!0;for(;!((a<0?h<=n:h>=n)&&(l<0?c<=r:c>=r));){const p=o[f++%o.length],g=h+Math.cos(u)*p;h=a<0?Math.max(n,g):Math.min(n,g);const m=c+Math.sin(u)*p;c=l<0?Math.max(r,m):Math.min(r,m),d?e.lineTo(h,c):e.moveTo(h,c),d=!d}e.closePath(),e.stroke()}constructor(e,t){if(this.elementId=e,!this.elementId)throw new B.RERR("BadArgument","Invalid id for renderer.");if(this.element=document.getElementById(e),this.element||(this.element=e),this.ctx=null,this.paper=null,this.backend=t,this.backend===yt.Backends.CANVAS){if(!this.element.getContext)throw new B.RERR("BadElement",`Can't get canvas context from element: ${e}`);this.ctx=yt.bolsterCanvasContext(this.element.getContext("2d"))}else if(this.backend===yt.Backends.RAPHAEL)this.ctx=new w_(this.element);else if(this.backend===yt.Backends.SVG)this.ctx=new E_(this.element);else throw new B.RERR("InvalidBackend",`No support for backend: ${this.backend}`)}resize(e,t){if(this.backend===yt.Backends.CANVAS){if(!this.element.getContext)throw new B.RERR("BadElement",`Can't get canvas context from element: ${this.elementId}`);[e,t]=Ko.SanitizeCanvasDims(e,t);const s=window.devicePixelRatio||1;this.element.width=e*s,this.element.height=t*s,this.element.style.width=e+"px",this.element.style.height=t+"px",this.ctx=yt.bolsterCanvasContext(this.element.getContext("2d")),this.ctx.scale(s,s)}else this.ctx.resize(e,t);return this}getContext(){return this.ctx}}function P_(...i){Be.DEBUG&&B.L("Vex.Flow.Stem",i)}class Be extends qt{static get CATEGORY(){return"stem"}static get UP(){return 1}static get DOWN(){return-1}static get WIDTH(){return ie.STEM_WIDTH}static get HEIGHT(){return ie.STEM_HEIGHT}constructor(e={}){super(),this.setAttribute("type","Stem"),this.x_begin=e.x_begin||0,this.x_end=e.x_end||0,this.y_top=e.y_top||0,this.y_bottom=e.y_bottom||0,this.stem_extension=e.stem_extension||0,this.stem_direction=e.stem_direction||0,this.hide=e.hide||!1,this.isStemlet=e.isStemlet||!1,this.stemletHeight=e.stemletHeight||0,this.resetHeight=0,this.renderHeightAdjustment=0,this.setOptions(e)}setResetHeight(e){this.resetHeight=e}setOptions(e){this.stem_up_y_offset=e.stem_up_y_offset||0,this.stem_down_y_offset=e.stem_down_y_offset||0}setNoteHeadXBounds(e,t){return this.x_begin=e,this.x_end=t,this}setDirection(e){this.stem_direction=e}setExtension(e){this.stem_extension=e}getExtension(){return this.stem_extension}setYBounds(e,t){this.y_top=e,this.y_bottom=t}getCategory(){return Be.CATEGORY}getHeight(){const e=this.stem_direction===Be.UP?this.stem_up_y_offset:this.stem_down_y_offset;return(this.y_bottom-this.y_top)*this.stem_direction+(Be.HEIGHT-e+this.stem_extension)*this.stem_direction}getBoundingBox(){throw new B.RERR("NotImplemented","getBoundingBox() not implemented.")}getExtents(){const e=this.stem_direction===Be.UP,t=[this.y_top,this.y_bottom],s=Be.HEIGHT+this.stem_extension,n=(e?Math.min:Math.max)(...t),r=(e?Math.max:Math.min)(...t);return{topY:n+s*-this.stem_direction+this.resetHeight*-this.stem_direction,baseY:r}}setVisibility(e){return this.hide=!e,this}setStemlet(e,t){return this.isStemlet=e,this.stemletHeight=t,this}draw(){if(this.setRendered(),this.hide)return;const e=this.checkContext();let t,s;const n=this.stem_direction;n===Be.DOWN?(t=this.x_begin,s=this.y_top+this.stem_down_y_offset):(t=this.x_end,s=this.y_bottom-this.stem_up_y_offset);const r=this.getHeight();P_("Rendering stem - ","Top Y: ",this.y_top,"Bottom Y: ",this.y_bottom);const o=this.isStemlet?r-this.stemletHeight*this.stem_direction:0;if(e.save(),this.applyStyle(e),e.beginPath(),e.setLineWidth(Be.WIDTH),e.moveTo(t,s-o),e.lineTo(t,s-r-this.renderHeightAdjustment*n-this.resetHeight*n),e.svg){const a={class:B.Prefix("stem")};this.id&&(a.id=this.id),e.stroke(a)}else e.stroke();this.restoreStyle(e),e.restore()}}let Su=class Nn extends qt{static get LOCATION_TOP(){return 1}static get LOCATION_BOTTOM(){return-1}static get NESTING_OFFSET(){return 15}constructor(e,t){if(super(),this.setAttribute("type","Tuplet"),!e||!e.length)throw new B.RuntimeError("BadArguments","No notes provided for tuplet.");this.options=B.Merge({},t),this.notes=e,this.num_notes="num_notes"in this.options?this.options.num_notes:e.length,this.options.beats_occupied&&this.beatsOccupiedDeprecationWarning(),this.notes_occupied=this.options.notes_occupied||this.options.beats_occupied||2,"bracketed"in this.options?this.bracketed=this.options.bracketed:this.bracketed=e.some(s=>s.beam===null),this.ratioed="ratioed"in this.options?this.options.ratioed:Math.abs(this.notes_occupied-this.num_notes)>1,this.point=28,this.y_pos=16,this.x_pos=100,this.width=200,this.location=this.options.location||Nn.LOCATION_TOP,Ms.AlignRestsToNotes(e,!0,!0),this.resolveGlyphs(),this.attach()}attach(){for(let e=0;e=1;)this.numerator_glyphs.unshift(new De("v"+e%10,this.point)),e=parseInt(e/10,10);for(this.denom_glyphs=[],e=this.notes_occupied;e>=1;)this.denom_glyphs.unshift(new De("v"+e%10,this.point)),e=parseInt(e/10,10)}getNestedTupletCount(){const e=this.location,t=this.notes[0];let s=r(t,e),n=r(t,e);function r(o,a){return o.tupletStack.filter(l=>l.location===a).length}return this.notes.forEach(o=>{const a=r(o,e);s=a>s?a:s,n=an&&(n=o)}}return n+e+t}draw(){this.checkContext(),this.setRendered();const e=this.notes[0],t=this.notes[this.notes.length-1];this.bracketed?(this.x_pos=e.getTieLeftX()-5,this.width=t.getTieRightX()-this.x_pos+5):(this.x_pos=e.getStemX(),this.width=t.getStemX()-this.x_pos),this.y_pos=this.getYPosition();const s=(l,u)=>l+u.getMetrics().width;let n=this.numerator_glyphs.reduce(s,0);this.ratioed&&(n=this.denom_glyphs.reduce(s,n),n+=this.point*.32);const o=this.x_pos+this.width/2-n/2;if(this.bracketed){const l=this.width/2-n/2-5;l>0&&(this.context.fillRect(this.x_pos,this.y_pos,l,1),this.context.fillRect(this.x_pos+this.width/2+n/2+5,this.y_pos,l,1),this.context.fillRect(this.x_pos,this.y_pos+(this.location===Nn.LOCATION_BOTTOM),1,this.location*10),this.context.fillRect(this.x_pos+this.width,this.y_pos+(this.location===Nn.LOCATION_BOTTOM),1,this.location*10))}let a=0;if(this.numerator_glyphs.forEach(l=>{l.render(this.context,o+a,this.y_pos+this.point/3-2),a+=l.getMetrics().width}),this.ratioed){const l=o+a+this.point*.16,u=this.point*.06;this.context.beginPath(),this.context.arc(l,this.y_pos-this.point*.08,u,0,Math.PI*2,!0),this.context.closePath(),this.context.fill(),this.context.beginPath(),this.context.arc(l,this.y_pos+this.point*.12,u,0,Math.PI*2,!0),this.context.closePath(),this.context.fill(),a+=this.point*.32,this.denom_glyphs.forEach(h=>{h.render(this.context,o+a,this.y_pos+this.point/3-2),a+=h.getMetrics().width})}}};function qm(i){let e=0;return i.forEach(t=>{t.keyProps&&t.keyProps.forEach(s=>{e+=s.line-3})}),e>=0?Be.DOWN:Be.UP}const __=(i,e)=>{const t=i.getStemExtents().topY,s=i.getStemX(),n=e.getStemExtents().topY,r=e.getStemX();return(n-t)/(r-s)},yf="L",M_="R",Zm="B";let Ml=class Cd extends qt{static getDefaultBeamGroups(e){(!e||e==="c")&&(e="4/4");const s={"1/2":["1/2"],"2/2":["1/2"],"3/2":["1/2"],"4/2":["1/2"],"1/4":["1/4"],"2/4":["1/4"],"3/4":["1/4"],"4/4":["1/4"],"1/8":["1/8"],"2/8":["2/8"],"3/8":["3/8"],"4/8":["2/8"],"1/16":["1/16"],"2/16":["2/16"],"3/16":["3/16"],"4/16":["2/16"]}[e];if(s===void 0){const n=parseInt(e.split("/")[0],10),r=parseInt(e.split("/")[1],10);if(n%3===0)return[new Xe(3,r)];if(r>4)return[new Xe(2,r)];if(r<=4)return[new Xe(1,r)]}else return s.map(n=>new Xe().parse(n));return[new Xe(1,4)]}static applyAndGetBeams(e,t,s){return Cd.generateBeams(e.getTickables(),{groups:s,stem_direction:t})}static generateBeams(e,t){t||(t={}),(!t.groups||!t.groups.length)&&(t.groups=[new Xe(2,8)]);const s=t.groups.map(S=>{if(!S.multiply)throw new B.RuntimeError("InvalidBeamGroups","The beam groups must be an array of Vex.Flow.Fractions");return S.clone().multiply(ie.RESOLUTION,1)}),n=e;let r=0,o=[],a=[];function l(S){return S.reduce((A,P)=>P.getTicks().clone().add(A),new Xe(0,1))}function u(){s.length-1>r?r+=1:r=0}function h(){let S=[];n.forEach(A=>{if(S=[],A.shouldIgnoreTicks()){o.push(a),a=S;return}a.push(A);const P=s[r].clone(),x=l(a),M=ie.durationToNumber(A.duration)<8;M&&A.tuplet&&(P.numerator*=2),x.greaterThan(P)?(M||S.push(a.pop()),o.push(a),a=S,u()):x.equals(P)&&(o.push(a),a=S,u())}),a.length>0&&o.push(a)}function c(){return o.filter(S=>{if(S.length>1){let A=!0;return S.forEach(P=>{P.getIntrinsicTicks()>=ie.durationToTicks("4")&&(A=!1)}),A}return!1})}function f(){const S=[];o.forEach(A=>{let P=[];A.forEach((x,M,_)=>{const T=M===0||M===_.length-1,D=_[M-1],C=!t.beam_rests&&x.isRest(),L=t.beam_rests&&t.beam_middle_only&&x.isRest()&&T;let E=!1;if(t.maintain_stem_directions&&D&&!x.isRest()&&!D.isRest()){const H=D.getStemDirection();E=x.getStemDirection()!==H}const k=parseInt(x.duration,10)<8;C||L||E||k?(P.length>0&&S.push(P),P=E?[x]:[]):P.push(x)}),P.length>0&&S.push(P)}),o=S}function d(){o.forEach(S=>{let A;if(t.maintain_stem_directions){const P=p(S);A=P?P.getStemDirection():Be.UP}else t.stem_direction?A=t.stem_direction:A=qm(S);g(S,A)})}function p(S){for(let A=0;A{P.setStemDirection(A)})}function m(){const S=[];return o.forEach(A=>{let P=null;A.forEach(x=>{x.tuplet&&P!==x.tuplet&&(P=x.tuplet,S.push(P))})}),S}h(),f(),d();const b=c(),y=m(),v=[];return b.forEach(S=>{const A=new Cd(S);t.show_stemlets&&(A.render_options.show_stemlets=!0),t.secondary_breaks&&(A.render_options.secondary_break_ticks=ie.durationToTicks(t.secondary_breaks)),t.flat_beams===!0&&(A.render_options.flat_beams=!0,A.render_options.flat_beam_offset=t.flat_beam_offset),v.push(A)}),y.forEach(S=>{const A=S.notes[0].stem_direction===Be.DOWN?Su.LOCATION_BOTTOM:Su.LOCATION_TOP;S.setTupletLocation(A);let P=!1;for(let x=0;x=ie.durationToTicks("4"))throw new B.RuntimeError("BadArguments","Beams can only be applied to notes shorter than a quarter note.");let s,n;for(this.stem_direction=Be.UP,s=0;sa+l.stem_direction,0)>-1?Be.UP:Be.DOWN),s=0;ss.getGlyph().beam_count).reduce((s,n)=>n>s?n:s)}breakSecondaryAt(e){return this.break_on_indices=e,this}getSlopeY(e,t,s,n){return s+(e-t)*n}calculateSlope(){const{notes:e,stem_direction:t,render_options:{max_slope:s,min_slope:n,slope_iterations:r,slope_cost:o}}=this,a=e[0],l=__(a,e[e.length-1]),u=(s-n)/r;let h=Number.MAX_VALUE,c=0,f=0;for(let d=n;d<=s;d+=u){let p=0,g=0;for(let v=1;vm)&&(u=m,a=Math.min(...g.getYs()),l=g.getBeamCount())}let h=o/e.length;const c=s*1.5,f=n+l*c,d=a+f*-t;t===Be.DOWN&&hd&&(h=a-f),r+this.render_options.flat_beam_offset_per_beam>0?t===Be.DOWN&&h>r&&!this.render_options.flat_beams?this.render_options.flat_beam_offset=h:t===Be.UP&&h0){let n=this.render_options.flat_beam_offset;this.render_options.flat_beam_offset_per_beam&&(n+=this.render_options.flat_beam_offset_per_beam*this.getBeamCount());let r=this.notes[0].note_heads[0].y;const o=this.stem_direction>0?Math.min:Math.max;for(const a of this.notes)for(const l of a.note_heads)r=o(r,l.y);s=r+n*-this.stem_direction}return s}applyStemExtensions(){const{notes:e,slope:t,y_shift:s,stem_direction:n,beam_count:r,render_options:{show_stemlets:o,stemlet_extension:a,beam_width:l}}=this,u=e[0],h=this.getBeamYToDraw(),c=u.getStemX();for(let f=0;f=8&&(d=this.break_on_indices.indexOf(h)!==-1,this.render_options.secondary_break_ticks&&l>=this.render_options.secondary_break_ticks&&(l=0,d=!0));const p=c.getIntrinsicTicks(){e.getStem()&&(this.context.openGroup("stem",e.getAttribute("id")+"-stem"),e.getStem().setContext(this.context).draw(),this.context.closeGroup())},this)}drawBeamLines(){this.checkContext();const e=["4","8","16","32","64"],t=this.notes[0];let s=this.getBeamYToDraw();const n=t.getStemX(),r=this.render_options.beam_width*this.stem_direction,o={};for(const a of this.notes)o[a.getAttribute("id")]=0;for(let a=0;a{e.getStave()||e.setStave(this.stave)}),this.preFormatted=!0,this)}draw(e=this.context,t=this.stave){this.setRendered();let s=null;for(let n=0;n0&&s){const o=r.getBoundingBox();o&&s.mergeWith(o)}r.setContext(e),r.drawWithStyle()}this.boundingBox=s}};function $m(i,e,t,s,n){if(e!==$e.type.BOLD_DOUBLE_LEFT&&e!==$e.type.BOLD_DOUBLE_RIGHT)throw new B.RERR("InvalidConnector","A REPEAT_BEGIN or REPEAT_END type must be provided.");let r=3,o=3.5;const a=2;e===$e.type.BOLD_DOUBLE_RIGHT&&(r=-5,o=3),i.fillRect(t+r,s,1,n-s),i.fillRect(t-a,s,o,n-s)}class $e extends qt{static get type(){return{SINGLE_RIGHT:0,SINGLE_LEFT:1,SINGLE:1,DOUBLE:2,BRACE:3,BRACKET:4,BOLD_DOUBLE_LEFT:5,BOLD_DOUBLE_RIGHT:6,THIN_DOUBLE:7,NONE:8}}static get typeString(){return{singleRight:$e.type.SINGLE_RIGHT,singleLeft:$e.type.SINGLE_LEFT,single:$e.type.SINGLE,double:$e.type.DOUBLE,brace:$e.type.BRACE,bracket:$e.type.BRACKET,boldDoubleLeft:$e.type.BOLD_DOUBLE_LEFT,boldDoubleRight:$e.type.BOLD_DOUBLE_RIGHT,thinDouble:$e.type.THIN_DOUBLE,none:$e.type.NONE}}constructor(e,t){super(),this.setAttribute("type","StaveConnector"),this.thickness=ie.STAVE_LINE_THICKNESS,this.width=3,this.top_stave=e,this.bottom_stave=t,this.type=$e.type.DOUBLE,this.font={family:"times",size:16,weight:"normal"},this.x_shift=0,this.texts=[]}setType(e){return e=typeof e=="string"?$e.typeString[e]:e,e>=$e.type.SINGLE_RIGHT&&e<=$e.type.NONE&&(this.type=e),this}setText(e,t){return this.texts.push({content:e,options:B.Merge({shift_x:0,shift_y:0},t)}),this}setFont(e){B.Merge(this.font,e)}setXShift(e){if(typeof e!="number")throw B.RERR("InvalidType","x_shift must be a Number");return this.x_shift=e,this}draw(){const e=this.checkContext();this.setRendered();let t=this.top_stave.getYForLine(0),s=this.bottom_stave.getYForLine(this.bottom_stave.getNumLines()-1)+this.thickness,n=this.width,r=this.top_stave.getX();(this.type===$e.type.SINGLE_RIGHT||this.type===$e.type.BOLD_DOUBLE_RIGHT||this.type===$e.type.THIN_DOUBLE)&&(r=this.top_stave.getX()+this.top_stave.width);let a=s-t;switch(this.type){case $e.type.SINGLE:n=1;break;case $e.type.SINGLE_LEFT:n=1;break;case $e.type.SINGLE_RIGHT:n=1;break;case $e.type.DOUBLE:r-=this.width+2;break;case $e.type.BRACE:{n=12;const l=this.top_stave.getX()-2+this.x_shift,u=t,h=l,c=s,f=l-n,d=u+a/2,p=f-.9*n,g=u+.2*a,m=l+1.1*n,b=d-.135*a,y=m,v=d+.135*a,S=p,A=c-.2*a,P=f-n,x=A,M=l+.4*n,_=d+.135*a,T=M,D=d-.135*a,C=P,L=g;e.beginPath(),e.moveTo(l,u),e.bezierCurveTo(p,g,m,b,f,d),e.bezierCurveTo(y,v,S,A,h,c),e.bezierCurveTo(P,x,M,_,f,d),e.bezierCurveTo(T,D,C,L,l,u),e.fill(),e.stroke();break}case $e.type.BRACKET:t-=4,s+=4,a=s-t,De.renderGlyph(e,r-5,t-3,40,"v1b",!0),De.renderGlyph(e,r-5,s+3,40,"v10",!0),r-=this.width+2;break;case $e.type.BOLD_DOUBLE_LEFT:$m(e,this.type,r+this.x_shift,t,s);break;case $e.type.BOLD_DOUBLE_RIGHT:$m(e,this.type,r,t,s);break;case $e.type.THIN_DOUBLE:n=1;break;case $e.type.NONE:break;default:throw new B.RERR("InvalidType",`The provided StaveConnector.type (${this.type}) is invalid`)}this.type!==$e.type.BRACE&&this.type!==$e.type.BOLD_DOUBLE_LEFT&&this.type!==$e.type.BOLD_DOUBLE_RIGHT&&this.type!==$e.type.NONE&&e.fillRect(r,t,n,a),this.type===$e.type.THIN_DOUBLE&&e.fillRect(r-3,t,n,a),e.save(),e.lineWidth=2,e.setFont(this.font.family,this.font.size,this.font.weight);for(let l=0;l0){const m=g.space.deviation,b=m>=0?"+":"";e.setFillStyle("red"),e.fillText(b+Math.round(m),a+t.getXShift(),s-10)}e.restore()}constructor(e){if(super(),this.setAttribute("type","Note"),!e)throw new B.RuntimeError("BadArguments","Note must have valid initialization data to identify duration and type.");const t=ie.parseNoteStruct(e);if(!t)throw new B.RuntimeError("BadArguments",`Invalid note initialization object: ${JSON.stringify(e)}`);if(this.duration=t.duration,this.dots=t.dots,this.noteType=t.type,this.customTypes=t.customTypes,this.DYMusicScoreType=e.DYMusicScoreType,e.duration_override?this.setDuration(e.duration_override):this.setIntrinsicTicks(t.ticks),this.modifiers=[],this.glyph=ie.getGlyphProps(this.duration,this.noteType),this.customGlyphs=this.customTypes.map(s=>ie.getGlyphProps(this.duration,s)),this.positions&&(typeof this.positions!="object"||!this.positions.length))throw new B.RuntimeError("BadArguments","Note keys must be array type.");this.playNote=null,this.tickContext=null,this.modifierContext=null,this.ignore_ticks=!1,this.width=0,this.extraLeftPx=0,this.extraRightPx=0,this.x_shift=0,this.left_modPx=0,this.right_modPx=0,this.voice=null,this.preFormatted=!1,this.ys=[],e.align_center&&this.setCenterAlignment(e.align_center),this.stave=null,this.render_options={annotation_spacing:5,stave_padding:Ii.STAVEPADDING}}getPlayNote(){return this.playNote}setPlayNote(e){return this.playNote=e,this}isRest(){return!1}addStroke(e,t){return t.setNote(this),t.setIndex(e),this.modifiers.push(t),this.setPreFormatted(!1),this}getStave(){return this.stave}setStave(e){return this.stave=e,this.setYs([e.getYForLine(0)]),this.context=this.stave.context,this}getCategory(){return Ii.CATEGORY}setContext(e){return this.context=e,this}getExtraLeftPx(){return this.extraLeftPx}getExtraRightPx(){return this.extraRightPx}setExtraLeftPx(e){return this.extraLeftPx=e,this}setExtraRightPx(e){return this.extraRightPx=e,this}shouldIgnoreTicks(){return this.ignore_ticks}getLineNumber(){return 0}getLineForRest(){return 0}getGlyph(){return this.glyph}getGlyphWidth(){return this.glyph.getWidth?this.glyph.getWidth(this.render_options.glyph_font_scale):15}setYs(e){return this.ys=e,this}getYs(){if(this.ys.length===0)throw new B.RERR("NoYValues","No Y-values calculated for this note.");return this.ys}getYForTopText(e){if(!this.stave)throw new B.RERR("NoStave","No stave attached to this note.");return this.stave.getYForTopText(e)}getBoundingBox(){return null}getVoice(){if(!this.voice)throw new B.RERR("NoVoice","Note has no voice.");return this.voice}setVoice(e){return this.voice=e,this.preFormatted=!1,this}getTickContext(){return this.tickContext}setTickContext(e){return this.tickContext=e,this.preFormatted=!1,this}getDuration(){return this.duration}isDotted(){return this.dots>0}hasStem(){return!1}getDots(){return this.dots}getNoteType(){return this.noteType}setBeam(){return this}setModifierContext(e){return this.modifierContext=e,this}addModifier(e,t=0){return e.setNote(this),e.setIndex(t),this.modifiers.push(e),this.setPreFormatted(!1),this}getModifierStartXY(){if(!this.preFormatted)throw new B.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");return{x:this.getAbsoluteX(),y:this.ys[0]}}getMetrics(){if(!this.preFormatted)throw new B.RERR("UnformattedNote","Can't call getMetrics on an unformatted note.");let e=0,t=0;this.modifierContext!=null&&(e=this.modifierContext.state.left_shift,t=this.modifierContext.state.right_shift);const s=this.getWidth();return{width:s,noteWidth:s-e-t-this.extraLeftPx-this.extraRightPx,left_shift:this.x_shift,modLeftPx:e,modRightPx:t,extraLeftPx:this.extraLeftPx,extraRightPx:this.extraRightPx}}setWidth(e){this.width=e}getWidth(){if(!this.preFormatted)throw new B.RERR("UnformattedNote","Can't call GetWidth on an unformatted note.");return this.width+(this.modifierContext?this.modifierContext.getWidth():0)}setXShift(e){return this.x_shift=e,this}getXShift(){return this.x_shift}getX(){if(!this.tickContext)throw new B.RERR("NoTickContext","Note needs a TickContext assigned for an X-Value");return this.tickContext.getX()+this.x_shift}getAbsoluteX(){if(!this.tickContext)throw new B.RERR("NoTickContext","Note needs a TickContext assigned for an X-Value");let e=this.tickContext.getX();return this.stave&&(e+=this.stave.getNoteStartX()+this.render_options.stave_padding),this.isCenterAligned()&&(this.DYMusicScoreType==="jianpu"||(e+=this.getCenterXShift())),e}setPreFormatted(e){if(this.preFormatted=e,this.preFormatted){const t=this.tickContext.getExtraPx();this.left_modPx=Math.max(this.left_modPx,t.left),this.right_modPx=Math.max(this.right_modPx,t.right)}}}function C_(...i){xa.DEBUG&&B.L("Vex.Flow.NoteHead",i)}function T_(i,e,t,s,n,r){const o=ie.SLASH_NOTEHEAD_WIDTH;i.save(),i.setLineWidth(ie.STEM_WIDTH);let a=!1;if(ie.durationToNumber(e)>2&&(a=!0),a||(t-=ie.STEM_WIDTH/2*n),i.beginPath(),i.moveTo(t,s+r),i.lineTo(t,s+1),i.lineTo(t+o,s-r),i.lineTo(t+o,s),i.lineTo(t,s+r),i.closePath(),a?i.fill():i.stroke(),ie.durationToFraction(e).equals(.5)){const l=[-3,-1,o+1,o+3];for(let u=0;u{const a=o.getTickContext();o.setStave(t.stave),a.setXOffset(r)})}}class Lr extends Ne{static get CATEGORY(){return"dots"}static format(e,t){const s=t.right_shift,n=1;if(!e||e.length===0)return!1;const r=[],o={};for(let d=0;dp.line-d.line);let a=s,l=0,u=null,h=null,c=null,f=0;for(let d=0;dl?a:l,u=b,h=g}return t.right_shift+=l,!0}constructor(){super(),this.setAttribute("type","Dot"),this.note=null,this.index=null,this.position=Ne.Position.RIGHT,this.radius=2,this.setWidth(5),this.dot_shiftY=0}getCategory(){return Lr.CATEGORY}setNote(e){this.note=e,this.note.getCategory()==="gracenotes"&&(this.radius*=.5,this.setWidth(3))}setDotShiftY(e){return this.dot_shiftY=e,this}draw(){if(this.checkContext(),this.setRendered(),!this.note||this.index===null)throw new B.RERR("NoAttachedNote","Can't draw dot without a note and index.");const e=this.note.stave.options.spacing_between_lines_px,t=this.note.getModifierStartXY(this.position,this.index,{forceFlagRight:!0});this.note.getCategory()==="tabnotes"&&(t.y=this.note.getStemExtents().baseY+1);const s=t.x+this.x_shift+this.width-this.radius,n=t.y+this.y_shift+this.dot_shiftY*e,r=this.context;r.beginPath(),r.arc(s,n,this.radius,0,Math.PI*2,!1),r.fill()}}function L_(...i){Bt.DEBUG&&B.L("Vex.Flow.StaveNote",i)}const B_=i=>Be.WIDTH/(2*-i.getStemDirection()),I_=(i,e)=>e===(i.getStemDirection()===Be.UP?i.keyProps.length-1:0);function cr(i,e,t){const s=(e.isrest?0:1)*t;i.line+=s,i.maxLine+=s,i.minLine+=s,i.note.setKeyLine(0,i.note.getKeyLine(0)+s)}function R_(i,e,t){const s=i.line-B.MidLine(e.minLine,t.maxLine);i.note.setKeyLine(0,i.note.getKeyLine(0)-s),i.line-=s,i.maxLine-=s,i.minLine-=s}class Bt extends np{static get CATEGORY(){return"stavenotes"}static get STEM_UP(){return Be.UP}static get STEM_DOWN(){return Be.DOWN}static get DEFAULT_LEDGER_LINE_OFFSET(){return 3}static renderVibrato(e,t,s,n){let{width:r,height:o,wave_width:a,wave_girth:l,wave_height:u,stem_direction:h}=n;const c=Math.floor(r/a);let f=o/(c/2)*h;f==0&&(h=1,f=.3),e.beginPath(),e.moveTo(t,s+l);for(let d=0;d2?s[1]:null;let l=r>2?s[2]:s[1];r===2&&o.stemDirection===-1&&l.stemDirection===1&&(o=s[1],l=s[0]);const u=Math.max(o.voice_shift,l.voice_shift);let h=0,c;if(r===2){const f=o.stemDirection===l.stemDirection?0:.5;if(o.stemDirection===l.stemDirection&&o.minLine<=l.maxLine&&(o.isrest||(c=Math.abs(o.line-(l.maxLine+.5)),c=Math.max(c,o.stemMin),o.minLine=o.line-c,o.note.setStemLength(c*10))),o.minLine<=l.maxLine+f)if(o.isrest)cr(o,l,1);else if(l.isrest)cr(l,o,-1);else{h=u;const d=Math.abs(o.line-l.line);let p=0,g=0;o.note.duration==="h"?p++:o.note.duration==="w"&&g++,l.note.duration==="h"?p++:l.note.duration==="w"&&g++;let m=p===1||g===1||o.note.dots!==l.note.dots;if(n&&(m=m||g===2),d===0&&m){if(l.note.setXShift(h),o.note.dots>0){let b=0;for(const y of o.note.modifiers)if(y instanceof Lr&&(b++,y.setYShift(-10*(l.maxLine-o.line+1)),b===o.note.dots))break}}else d<1&&d>0?l.note.setXShift(h):o.note.voice!==l.note.voice&&o.stemDirection===l.stemDirection&&(o.line>l.line?o.stemDirection===1?l.note.renderFlag=!1:o.note.renderFlag=!1:l.line>o.line?l.stemDirection===1?o.note.renderFlag=!1:l.note.renderFlag=!1:l.stemDirection===1&&(l.stemDirection=-1,l.note.setStemDirection(-1)))}return!0}if(a!==null&&a.minLinet.postFormat()),!0):!1}constructor(e){if(super(e),this.setAttribute("type","StaveNote"),this.keys=e.keys,this.clef=e.clef,this.octave_shift=e.octave_shift,this.beam=null,this.vibrato=null,this.slideNote=null,this.glyph=ie.getGlyphProps(this.duration,this.noteType),!this.glyph)throw new B.RuntimeError("BadArguments",`Invalid note initialization data (No glyph found): ${JSON.stringify(e)}`);this.displaced=!1,this.dot_shiftY=0,this.addDotsCount=0,this.keyProps=[],this.use_default_head_x=!1,this.note_heads=[],this.modifiers=[],B.Merge(this.render_options,{glyph_font_scale:e.glyph_font_scale||ie.DEFAULT_NOTATION_FONT_SCALE,stroke_px:e.stroke_px||Bt.DEFAULT_LEDGER_LINE_OFFSET}),this.calculateKeyProps(),this.buildStem(),e.auto_stem?this.autoStem():this.setStemDirection(e.stem_direction),this.reset(),this.buildFlag()}reset(){super.reset();const e=this.note_heads.map(t=>t.getStyle());this.buildNoteHeads(),this.note_heads.forEach((t,s)=>t.setStyle(e[s])),this.stave&&this.note_heads.forEach(t=>t.setStave(this.stave)),this.calcExtraPx()}setBeam(e){return this.beam=e,this.calcExtraPx(),this}setVibrato(e){this.vibrato=e}setSlideNote(e){this.slideNote=e}getCategory(){return Bt.CATEGORY}buildStem(){this.setStem(new Be({hide:!!this.isRest()})),this.stem.id=B.Prefix(`${this.getAttribute("id")}-stem`)}buildNoteHeads(){this.note_heads=[];const e=this.getStemDirection(),t=this.getKeys();let s=null,n=null,r=!1,o,a,l;e===Be.UP?(o=0,a=t.length,l=1):e===Be.DOWN&&(o=t.length-1,a=-1,l=-1);for(let u=o;u!==a;u+=l){const h=this.keyProps[u],c=h.line;s===null?s=c:(n=Math.abs(s-c),n===0||n===.5?r=!r:(r=!1,this.use_default_head_x=!0)),s=c;const f=new xa({duration:this.duration,note_type:this.noteType,displaced:r,stem_direction:e,custom_glyph_code:h.code,glyph_font_scale:this.render_options.glyph_font_scale,x_shift:h.shift_right,stem_up_x_offset:h.stem_up_x_offset,stem_down_x_offset:h.stem_down_x_offset,line:h.line});this.note_heads[u]=f}}autoStem(){this.minLine=this.keyProps[0].line,this.maxLine=this.keyProps[this.keyProps.length-1].line;const e=3,s=(this.minLine+this.maxLine)/20&&(this.keyProps[t-1].displaced=!0)),e=o,this.keyProps.push(r)}e=-1/0,this.keyProps.forEach(t=>{t.linet.line-s.line)}getBoundingBox(){if(!this.preFormatted)throw new B.RERR("UnformattedNote","Can't call getBoundingBox on an unformatted note.");const{width:e,modLeftPx:t,extraLeftPx:s}=this.getMetrics(),n=this.getAbsoluteX()-t-s;let r=0,o=0;const a=this.getStave().getSpacingBetweenLines()/2,l=a*2;if(this.isRest()){const u=this.ys[0],h=ie.durationToFraction(this.duration);h.equals(1)||h.equals(2)?(r=u-a,o=u+a):(r=u-this.glyph.line_above*l,o=u+this.glyph.line_below*l)}else if(this.glyph.stem){const u=this.getStemExtents();u.baseY+=a*this.stem_direction,r=Math.min(u.topY,u.baseY),o=Math.max(u.topY,u.baseY)}else{r=null,o=null;for(let u=0;ut&&(t=n):n1}hasStem(){return this.glyph.stem}hasFlag(){return super.hasFlag()&&!this.isRest()&&this.renderFlag}getStemX(){return this.noteType==="r"?this.getCenterGlyphX():super.getStemX()+B_(this)}getYForTopText(e){const t=this.getStemExtents();return Math.min(this.stave.getYForTopText(e),t.topY-this.render_options.annotation_spacing*(e+1))}getYForBottomText(e){const t=this.getStemExtents();return Math.max(this.stave.getYForTopText(e),t.baseY+this.render_options.annotation_spacing*e)}setStave(e){super.setStave(e);const t=this.note_heads.map(s=>(s.setStave(e),s.getY()));if(this.setYs(t),this.stem){const{y_top:s,y_bottom:n}=this.getNoteHeadBounds();this.stem.setYBounds(s,n)}return this}getKeys(){return this.keys}getKeyProps(){return this.keyProps}isDisplaced(){return this.displaced}setNoteDisplaced(e){return this.displaced=e,this}getTieRightX(){let e=this.getAbsoluteX();return e+=this.getGlyphWidth()+this.x_shift+this.extraRightPx,this.modifierContext&&(e+=this.modifierContext.getExtraRightPx()),e}getTieLeftX(){let e=this.getAbsoluteX();return e+=this.x_shift-this.extraLeftPx,e}getLineForRest(){let e=this.keyProps[0].line;if(this.keyProps.length>1){const t=this.keyProps[this.keyProps.length-1].line,s=Math.max(e,t),n=Math.min(e,t);e=B.MidLine(s,n)}return e}getModifierStartXY(e,t,s){if(s=s||{},!this.preFormatted)throw new B.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");if(this.ys.length===0)throw new B.RERR("NoYValues","No Y-Values calculated for this note.");const{ABOVE:n,BELOW:r,LEFT:o,RIGHT:a}=Ne.Position;let l=0;return e===o?l=-1*2:e===a?(l=this.getGlyphWidth()+this.x_shift+2,this.stem_direction===Be.UP&&this.hasFlag()&&(s.forceFlagRight||I_(this,t))&&(l+=this.flag.getMetrics().width)):(e===r||e===n)&&(l=this.getGlyphWidth()/2),{x:this.getAbsoluteX()+l,y:this.ys[t]}}setStyle(e){super.setStyle(e),this.note_heads.forEach(t=>t.setStyle(e)),this.stem&&this.stem.setStyle(e)}setStemStyle(e){this.stem&&this.getStem().setStyle(e)}getStemStyle(){return this.stem.getStyle()}setLedgerLineStyle(e){this.ledgerLineStyle=e}getLedgerLineStyle(){return this.ledgerLineStyle}setFlagStyle(e){this.flagStyle=e}getFlagStyle(){return this.flagStyle}setKeyStyle(e,t){return this.note_heads[e].setStyle(t),this}setKeyLine(e,t){return this.keyProps[e].line=t,this.reset(),this}getKeyLine(e){return this.keyProps[e].line}addToModifierContext(e){this.setModifierContext(e);for(let t=0;t{const f=c.getLine(),d=c.getY();(e===null||dt)&&(t=d),n===null&&c.isDisplaced()&&(n=c.getAbsoluteX()),s===null&&!c.isDisplaced()&&(s=c.getAbsoluteX()),r=f>r?f:r,o=f{let A;S&&v?A=g-s:v?A=p-s:A=d-s;const P=v&&S?o:r;n.beginPath(),n.moveTo(A,y),n.lineTo(A+P,y),n.stroke()},b={...e.getStyle()||{},...this.getLedgerLineStyle()||{}};this.applyStyle(n,b);for(let y=6;y<=a;++y){const v=p!==null&&y<=h,S=d!==null&&y<=u;m(e.getYForNote(y),v,S)}for(let y=0;y>=l;--y){const v=p!==null&&y>=f,S=d!==null&&y>=c;m(e.getYForNote(y),v,S)}this.restoreStyle(n,b)}drawVibrato(){if(this.vibrato){const e=this.context,t=this.vibrato.getNoteHeadEndX()+2;let{y_bottom:s}=this.vibrato.getNoteHeadBounds(),{y_top:n}=this.getNoteHeadBounds();const r=s6.5||c<-.5)&&(h=h+(c>6.5?(c-6.5)*10:(c+.5)*10))}s.openGroup("flag",null,{pointerBBox:!0}),this.applyStyle(s,this.getFlagStyle()||!1),this.flag.render(s,u,h),this.restoreStyle(s,this.getFlagStyle()||!1),s.closeGroup()}}drawNoteHeads(){this.note_heads.forEach(e=>{this.context.openGroup("notehead",null,{pointerBBox:!0});try{if(this.isRest()&&this.duration==="w"){const t=this.stave.options.line_config.filter(n=>n.visible).length;this.keyProps[0].line===4&&t<5&&e.setY(e.getY()+10),t===1&&e.setLine(3)}}catch(t){}e.setContext(this.context).draw(),this.context.closeGroup()})}drawStem(e){if(!this.context)throw new B.RERR("NoCanvasContext","Can't draw without a canvas context.");e&&this.setStem(new Be(e)),this.stem.id=B.Prefix(`${this.getAttribute("id")}-stem`),this.stem&&(this.context.openGroup("stem",null,{pointerBBox:!0}),this.stem.setContext(this.context).draw(),this.context.closeGroup())}draw(){if(!this.context)throw new B.RERR("NoCanvasContext","Can't draw without a canvas context.");if(!this.stave)throw new B.RERR("NoStave","Can't draw without a stave.");if(this.ys.length===0)throw new B.RERR("NoYValues","Can't draw note without Y values.");const e=this.stave.getLines();if(e===2||e===3||e===4)for(let n=0;nn.setX(t)),this.stem){let n=this.getStemX();const r=this.keyProps[0].line;(r>6.5||r<-.5)&&(this.beam||(this.stem.renderHeightAdjustment=r>6.5?(r-6.5)*10:Math.abs(r+.5)*10)),this.stem.setNoteHeadXBounds(n,n)}L_("Rendering ",this.isChord()?"chord :":"note :",this.keys),this.drawLedgerLines(),this.applyStyle(),this.setAttribute("el",this.context.openGroup("stavenote",this.getAttribute("id"))),this.context.openGroup("note",null,{pointerBBox:!0}),s&&this.drawStem(),this.drawNoteHeads(),this.drawFlag(),this.context.closeGroup(),this.drawModifiers(),this.context.closeGroup(),this.restoreStyle(),this.setRendered()}}class Hl extends Ne{static get CATEGORY(){return"frethandfinger"}static format(e,t){const{left_shift:s,right_shift:n}=t,r=1;if(!e||e.length===0)return!1;const o=[];let a=null,l=0,u=0;for(let m=0;mb.line-m.line);let h=0,c=0,f=0,d=0,p=null,g=null;for(let m=0;mf?b:f):v===Ne.Position.RIGHT&&(S.setXShift(c),b=u+M,d=b>d?b:d),p=A,g=y}return t.left_shift+=f,t.right_shift+=d,!0}constructor(e){super(),this.setAttribute("type","FretHandFinger"),this.note=null,this.index=null,this.finger=e,this.width=7,this.position=Ne.Position.LEFT,this.x_shift=0,this.y_shift=0,this.x_offset=0,this.y_offset=0,this.font={family:"sans-serif",size:9,weight:"bold"}}getCategory(){return Hl.CATEGORY}setFretHandFinger(e){return this.finger=e,this}setOffsetX(e){return this.x_offset=e,this}setOffsetY(e){return this.y_offset=e,this}draw(){if(this.checkContext(),!this.note||this.index==null)throw new B.RERR("NoAttachedNote","Can't draw string number without a note and index.");this.setRendered();const e=this.context,t=this.note.getModifierStartXY(this.position,this.index);let s=t.x+this.x_shift+this.x_offset,n=t.y+this.y_shift+this.y_offset+5;switch(this.position){case Ne.Position.ABOVE:s-=4,n-=12;break;case Ne.Position.BELOW:s-=2,n+=10;break;case Ne.Position.LEFT:s-=this.width;break;case Ne.Position.RIGHT:s+=1;break;default:throw new B.RERR("InvalidPostion",`The position ${this.position} does not exist`)}e.save(),e.setFont(this.font.family,this.font.size,this.font.weight),e.fillText(""+this.finger,s,n),e.restore()}}class Ct{static get NUM_TONES(){return 12}static get roots(){return["c","d","e","f","g","a","b"]}static get root_values(){return[0,2,4,5,7,9,11]}static get root_indices(){return{c:0,d:1,e:2,f:3,g:4,a:5,b:6}}static get canonical_notes(){return["c","c#","d","d#","e","f","f#","g","g#","a","a#","b"]}static get diatonic_intervals(){return["unison","m2","M2","m3","M3","p4","dim5","p5","m6","M6","b7","M7","octave"]}static get diatonic_accidentals(){return{unison:{note:0,accidental:0},m2:{note:1,accidental:-1},M2:{note:1,accidental:0},m3:{note:2,accidental:-1},M3:{note:2,accidental:0},p4:{note:3,accidental:0},dim5:{note:4,accidental:-1},p5:{note:4,accidental:0},m6:{note:5,accidental:-1},M6:{note:5,accidental:0},b7:{note:6,accidental:-1},M7:{note:6,accidental:0},octave:{note:7,accidental:0}}}static get intervals(){return{u:0,unison:0,m2:1,b2:1,min2:1,S:1,H:1,2:2,M2:2,maj2:2,T:2,W:2,m3:3,b3:3,min3:3,M3:4,3:4,maj3:4,4:5,p4:5,"#4":6,b5:6,aug4:6,dim5:6,5:7,p5:7,"#5":8,b6:8,aug5:8,6:9,M6:9,maj6:9,b7:10,m7:10,min7:10,dom7:10,M7:11,maj7:11,8:12,octave:12}}static get scales(){return{major:[2,2,1,2,2,2,1],dorian:[2,1,2,2,2,1,2],mixolydian:[2,2,1,2,2,1,2],minor:[2,1,2,2,1,2,2]}}static get scaleTypes(){return{M:Ct.scales.major,m:Ct.scales.minor}}static get accidentals(){return["bb","b","n","#","##"]}static get noteValues(){return{c:{root_index:0,int_val:0},cn:{root_index:0,int_val:0},"c#":{root_index:0,int_val:1},"c##":{root_index:0,int_val:2},cb:{root_index:0,int_val:11},cbb:{root_index:0,int_val:10},d:{root_index:1,int_val:2},dn:{root_index:1,int_val:2},"d#":{root_index:1,int_val:3},"d##":{root_index:1,int_val:4},db:{root_index:1,int_val:1},dbb:{root_index:1,int_val:0},e:{root_index:2,int_val:4},en:{root_index:2,int_val:4},"e#":{root_index:2,int_val:5},"e##":{root_index:2,int_val:6},eb:{root_index:2,int_val:3},ebb:{root_index:2,int_val:2},f:{root_index:3,int_val:5},fn:{root_index:3,int_val:5},"f#":{root_index:3,int_val:6},"f##":{root_index:3,int_val:7},fb:{root_index:3,int_val:4},fbb:{root_index:3,int_val:3},g:{root_index:4,int_val:7},gn:{root_index:4,int_val:7},"g#":{root_index:4,int_val:8},"g##":{root_index:4,int_val:9},gb:{root_index:4,int_val:6},gbb:{root_index:4,int_val:5},a:{root_index:5,int_val:9},an:{root_index:5,int_val:9},"a#":{root_index:5,int_val:10},"a##":{root_index:5,int_val:11},ab:{root_index:5,int_val:8},abb:{root_index:5,int_val:7},b:{root_index:6,int_val:11},bn:{root_index:6,int_val:11},"b#":{root_index:6,int_val:0},"b##":{root_index:6,int_val:1},bb:{root_index:6,int_val:10},bbb:{root_index:6,int_val:9}}}isValidNoteValue(e){return!(e==null||e<0||e>=Ct.NUM_TONES)}isValidIntervalValue(e){return this.isValidNoteValue(e)}getNoteParts(e){if(!e||e.length<1)throw new B.RERR("BadArguments","Invalid note name: "+e);if(e.length>3)throw new B.RERR("BadArguments","Invalid note name: "+e);const t=e.toLowerCase(),n=/^([cdefgab])(b|bb|n|#|##)?$/.exec(t);if(n!=null){const r=n[1],o=n[2];return{root:r,accidental:o}}else throw new B.RERR("BadArguments","Invalid note name: "+e)}getKeyParts(e){if(!e||e.length<1)throw new B.RERR("BadArguments","Invalid key: "+e);const t=e.toLowerCase(),n=/^([cdefgab])(b|#)?(mel|harm|m|M)?$/.exec(t);if(n!=null){const r=n[1],o=n[2];let a=n[3];return a||(a="M"),{root:r,accidental:o,type:a}}else throw new B.RERR("BadArguments",`Invalid key: ${e}`)}getNoteValue(e){const t=Ct.noteValues[e];if(t==null)throw new B.RERR("BadArguments",`Invalid note name: ${e}`);return t.int_val}getIntervalValue(e){const t=Ct.intervals[e];if(t==null)throw new B.RERR("BadArguments",`Invalid interval name: ${e}`);return t}getCanonicalNoteName(e){if(!this.isValidNoteValue(e))throw new B.RERR("BadArguments",`Invalid note value: ${e}`);return Ct.canonical_notes[e]}getCanonicalIntervalName(e){if(!this.isValidIntervalValue(e))throw new B.RERR("BadArguments",`Invalid interval value: ${e}`);return Ct.diatonic_intervals[e]}getRelativeNoteValue(e,t,s){if(s==null&&(s=1),s!==1&&s!==-1)throw new B.RERR("BadArguments",`Invalid direction: ${s}`);let n=(e+s*t)%Ct.NUM_TONES;return n<0&&(n+=Ct.NUM_TONES),n}getRelativeNoteName(e,t){const s=this.getNoteParts(e),n=this.getNoteValue(s.root);let r=t-n;if(Math.abs(r)>Ct.NUM_TONES-3){let a=1;r>0&&(a=-1);const l=(t+1+(n+1))%Ct.NUM_TONES*a;if(Math.abs(l)>2)throw new B.RERR("BadArguments",`Notes not related: ${e}, ${t})`);r=l}if(Math.abs(r)>2)throw new B.RERR("BadArguments",`Notes not related: ${e}, ${t})`);let o=s.root;if(r>0)for(let a=1;a<=r;++a)o+="#";else if(r<0)for(let a=-1;a>=r;--a)o+="b";return o}getScaleTones(e,t){const s=[e];let n=e;for(let r=0;ri.getMetrics().width;class go extends Ne{static get CATEGORY(){return"accidentals"}static format(e,t){const n=t.left_shift+1,r=3;if(!e||e.length===0)return;const o=[];let a=null,l=0,u;for(let y=0;yv.line-y.line);const h=[];let c=0,f=null;for(let y=0;yc?v.shift:c,f=v.line}let d=0;for(let y=0;yh[S+E],x=E=>E.map(P),M=(E,k)=>{const[Q,H]=x([E,k]).map(Z=>Z.line);return Q-H},_=(...E)=>E.map(x).every(k=>!this.checkCollision(...k)),T=A-S+1;let D=this.checkCollision(h[S],h[A])?"a":"b";switch(T){case 3:D==="a"&&M(1,2)===.5&&M(0,1)!==.5&&(D="second_on_bottom");break;case 4:_([0,2],[1,3])&&(D="spaced_out_tetrachord");break;case 5:D==="b"&&_([1,3])&&(D="spaced_out_pentachord",_([0,2],[2,4])&&(D="very_spaced_out_pentachord"));break;case 6:_([0,3],[1,4],[2,5])&&(D="spaced_out_hexachord"),_([0,2],[2,4],[1,3],[3,5])&&(D="very_spaced_out_hexachord");break}let C,L;if(T>=7){let E=2,k=!0;for(;k===!0;){k=!1;for(let Q=0;Q+EL?d:L}else for(C=y;C<=A;C++)L=ie.accidentalColumnsTable[T][D][C-y],h[C].column=L,d=d>L?d:L;y=A}const p=[],g=[];for(let y=0;y<=d;y++)p[y]=0,g[y]=0;p[0]=c+n,g[0]=c+n,h.forEach(y=>{y.width>p[y.column]&&(p[y.column]=y.width)});for(let y=1;y{let v=0;const S=b+y.numAcc;for(b;b0?(n=t.flatLine||t.dblSharpLine?2.5:3,e.dblSharpLine&&(s-=.5)):(n=e.flatLine||e.dblSharpLine?2.5:3,t.dblSharpLine&&(s-=.5));const r=Math.abs(s){const l=new Xe(0,1);a.getTickables().forEach(h=>{if(h.shouldIgnoreTicks())return;const c=n[l.value()];c?c.push(h):(s.push(l.value()),n[l.value()]=[h]),l.add(h.getTicks())})});const r=new Ct;t||(t="C");const o=r.createScaleMap(t);s.forEach(a=>{const l=n[a],u=[],h=c=>{c.isRest()||c.shouldIgnoreTicks()||(c.keys.forEach((f,d)=>{const p=r.getNoteParts(f.split("/")[0]),g=p.accidental||"n",m=p.root+g,b=o[p.root]===m,y=u.indexOf(m)>-1;if(!b||b&&y){o[p.root]=m;const v=new go(g);c.addAccidental(d,v),u.push(m)}}),c.getModifiers().forEach(f=>{f.getCategory()==="gracenotegroups"&&f.getGraceNotes().forEach(h)}))};l.forEach(h)})}constructor(e=null){if(super(),this.setAttribute("type","Accidental"),Bc("New accidental: ",e),this.note=null,this.index=null,this.type=e,this.position=Ne.Position.LEFT,this.render_options={font_scale:38,stroke_px:3,parenLeftPadding:2,parenRightPadding:2},this.accidental=ie.accidentalCodes(this.type),!this.accidental)throw new B.RERR("ArgumentError",`Unknown accidental type: ${e}`);this.cautionary=!1,this.parenLeft=null,this.parenRight=null,this.reset()}reset(){const e=this.render_options.font_scale;this.glyph=new De(this.accidental.code,e),this.glyph.setOriginX(1),this.cautionary&&(this.parenLeft=new De(ie.accidentalCodes("{").code,e),this.parenRight=new De(ie.accidentalCodes("}").code,e),this.parenLeft.setOriginX(1),this.parenRight.setOriginX(1))}getCategory(){return go.CATEGORY}getWidth(){const e=this.cautionary?Da(this.parenLeft)+Da(this.parenRight)+this.render_options.parenLeftPadding+this.render_options.parenRightPadding:0;return Da(this.glyph)+e}setNote(e){if(!e)throw new B.RERR("ArgumentError",`Bad note value: ${e}`);this.note=e,this.note.getCategory()==="gracenotes"&&(this.render_options.font_scale=25,this.reset())}setAsCautionary(){return this.cautionary=!0,this.render_options.font_scale=28,this.reset(),this}draw(){const{context:e,type:t,position:s,note:n,index:r,cautionary:o,x_shift:a,y_shift:l,glyph:u,parenLeft:h,parenRight:c,render_options:{parenLeftPadding:f,parenRightPadding:d}}=this;if(this.checkContext(),!(n&&r!=null))throw new B.RERR("NoAttachedNote","Can't draw accidental without a note and index.");const p=n.getModifierStartXY(s,r);let g=p.x+a;const m=p.y+l;Bc("Rendering: ",t,g,m),o?(c.render(e,g,m),g-=Da(c),g-=d,g-=this.accidental.parenRightPaddingAdjustment,u.render(e,g,m),g-=Da(u),g-=f,h.render(e,g,m)):u.render(e,g,m),this.setRendered()}}let rp=class c4 extends Ne{static get CATEGORY(){return"notesubgroup"}static format(e,t){if(!e||e.length===0)return!1;let s=0;for(let n=0;n{t.ignore_ticks=!1}),this.width=0,this.preFormatted=!1,this.formatter=new Ms,this.voice=new Gs({num_beats:4,beat_value:4,resolution:ie.RESOLUTION}).setStrict(!1),this.voice.addTickables(this.subNotes),this}getCategory(){return c4.CATEGORY}preFormat(){this.preFormatted||(this.formatter.joinVoices([this.voice]).format([this.voice],0),this.setWidth(this.formatter.getMinTotalWidth()),this.preFormatted=!0)}setNote(e){this.note=e}setWidth(e){this.width=e}getWidth(){return this.width}draw(){this.checkContext();const e=this.getNote();if(!(e&&this.index!==null))throw new B.RuntimeError("NoAttachedNote","Can't draw notes without a parent note and parent note index.");this.setRendered(),this.alignSubNotesWithNote(this.subNotes,e),this.subNotes.forEach(t=>t.setContext(this.context).drawWithStyle())}};class Mh extends qt{constructor(e,t){super(),this.setAttribute("type","StaveTie"),this.notes=e,this.context=null,this.text=t,this.direction=null,this.render_options={cp1:8,cp2:12,text_shift_x:0,first_x_shift:0,last_x_shift:0,y_shift:7,tie_spacing:0,font:{family:"Arial",size:15,style:""}},this.font=this.render_options.font,this.setNotes(e)}setFont(e){return this.font=e,this}setDirection(e){return this.direction=e,this}setNotes(e){if(!e.first_note&&!e.last_note)throw new B.RuntimeError("BadArguments","Tie needs to have either first_note or last_note set.");if(e.first_indices||(e.first_indices=[0]),e.last_indices||(e.last_indices=[0]),e.first_indices.length!==e.last_indices.length)throw new B.RuntimeError("BadArguments","Tied notes must have similar index sizes");return this.first_note=e.first_note,this.first_indices=e.first_indices,this.last_note=e.last_note,this.last_indices=e.last_indices,this}isPartial(){return!this.first_note||!this.last_note}renderTie(e){if(e.first_ys.length===0||e.last_ys.length===0)throw new B.RERR("BadArguments","No Y-values to render");const t=this.context;let s=this.render_options.cp1,n=this.render_options.cp2;Math.abs(e.last_x_px-e.first_x_px)<10&&(s=2,n=8);const r=this.render_options.first_x_shift,o=this.render_options.last_x_shift,a=this.render_options.y_shift*e.direction;for(let l=0;lf&&Math.abs(h-f)<10?-6:0;if(this.first_note&&this.first_note.DYMusicScoreType==="jianpu"){if(this.getAttribute("type")==="TabTie")continue;h1){const t=new Ml(e);t.render_options.beam_width=3,t.render_options.partial_beam_length=4,this.beams.push(t)}return this}setNote(e){this.note=e}setWidth(e){this.width=e}getWidth(){return this.width}getGraceNotes(){return this.grace_notes}draw(){this.checkContext();const e=this.getNote();if(N_("Drawing grace note group for:",e),!(e&&this.index!==null))throw new B.RuntimeError("NoAttachedNote","Can't draw grace note without a parent note and parent note index.");if(this.setRendered(),this.alignSubNotesWithNote(this.getGraceNotes(),e),this.grace_notes.forEach(t=>{t.setContext(this.context).draw()}),this.beams.forEach(t=>{t.setContext(this.context).draw()}),this.show_slur){const t=this.getNote().getCategory()===Bt.CATEGORY,s=t?Mh:ca;this.slur=new s({last_note:this.grace_notes[0],first_note:e,first_indices:[0],last_indices:[0]}),this.slur.render_options.cp2=12,this.slur.render_options.y_shift=(t?7:5)+this.render_options.slur_y_shift,this.slur.setContext(this.context).draw()}}}class Si extends Ne{static get CATEGORY(){return"strokes"}static get Type(){return{BRUSH_DOWN:1,BRUSH_UP:2,ROLL_DOWN:3,ROLL_UP:4,RASQUEDO_DOWN:5,RASQUEDO_UP:6,ARPEGGIO_DIRECTIONLESS:7}}static format(e,t){const s=t.left_shift,n=0;if(!e||e.length===0)return this;const r=e.map(l=>{const u=l.getNote();if(u instanceof Bt){const{line:h,displaced:c}=u.getKeyProps()[l.getIndex()],f=c?u.getExtraLeftPx():0;return{line:h,shift:f,stroke:l}}else{const{str:h}=u.getPositions()[l.getIndex()];return{line:h,shift:0,stroke:l}}}),o=s,a=r.reduce((l,{stroke:u,shift:h})=>(u.setXShift(o+h),Math.max(u.getWidth()+n,l)),0);return t.left_shift+=a,!0}constructor(e,t){super(),this.setAttribute("type","Stroke"),this.note=null,this.options=B.Merge({},t),this.all_voices="all_voices"in this.options?this.options.all_voices:!0,this.note_end=null,this.index=null,this.type=e,this.position=Ne.Position.LEFT,this.render_options={font_scale:38,stroke_px:3,stroke_spacing:10},this.font={family:"serif",size:10,weight:"bold italic"},this.setXShift(0),this.setWidth(10)}getCategory(){return Si.CATEGORY}getPosition(){return this.position}addEndNote(e){return this.note_end=e,this}draw(){if(this.checkContext(),this.setRendered(),!(this.note&&this.index!=null))throw new B.RERR("NoAttachedNote","Can't draw stroke without a note and index.");const e=this.note.getModifierStartXY(this.position,this.index);let t=this.note.getYs(),s=e.y,n=e.y;const r=e.x-5,o=this.note.stave.options.spacing_between_lines_px,a=this.getModifierContext().getModifiers(this.note.getCategory());for(let d=0;dA.line-S.line);let g=0,m=0,b=0,y=null,v=null;for(h=0;hm?S:m):d===Ne.Position.RIGHT&&(c.setXShift(g),S+=x,b=S>b?S:b),y=A,v=f}return t.left_shift+=m,t.right_shift+=b,!0}constructor(e){super(),this.setAttribute("type","StringNumber"),this.note=null,this.last_note=null,this.index=null,this.string_number=e,this.setWidth(20),this.position=Ne.Position.ABOVE,this.x_shift=0,this.y_shift=0,this.x_offset=0,this.y_offset=0,this.dashed=!0,this.leg=yt.LineEndType.NONE,this.radius=8,this.font={family:"sans-serif",size:10,weight:"bold"}}getCategory(){return Ul.CATEGORY}getNote(){return this.note}setNote(e){return this.note=e,this}getIndex(){return this.index}setIndex(e){return this.index=e,this}setLineEndType(e){return e>=yt.LineEndType.NONE&&e<=yt.LineEndType.DOWN&&(this.leg=e),this}setStringNumber(e){return this.string_number=e,this}setOffsetX(e){return this.x_offset=e,this}setOffsetY(e){return this.y_offset=e,this}setLastNote(e){return this.last_note=e,this}setDashed(e){return this.dashed=e,this}draw(){const e=this.checkContext();if(!(this.note&&this.index!=null))throw new B.RERR("NoAttachedNote","Can't draw string number without a note and index.");this.setRendered();const t=this.note.stave.options.spacing_between_lines_px,s=this.note.getModifierStartXY(this.position,this.index);let n=s.x+this.x_shift+this.x_offset,r=s.y+this.y_shift+this.y_offset;switch(this.position){case Ne.Position.ABOVE:case Ne.Position.BELOW:{const a=this.note.getStemExtents();let l=a.topY,u=a.baseY+2;this.note.stem_direction===Bt.STEM_DOWN&&(l=a.baseY,u=a.topY-2),this.position===Ne.Position.ABOVE?r=this.note.hasStem()?l-t*1.75:s.y-t*1.75:r=this.note.hasStem()?u+t*1.5:s.y+t*1.75,r+=this.y_shift+this.y_offset;break}case Ne.Position.LEFT:n-=this.radius/2+5;break;case Ne.Position.RIGHT:n+=this.radius/2+6;break;default:throw new B.RERR("InvalidPosition",`The position ${this.position} is invalid`)}e.save(),e.beginPath(),e.arc(n,r,this.radius,0,Math.PI*2,!1),e.lineWidth=1.5,e.stroke(),e.setFont(this.font.family,this.font.size,this.font.weight);const o=n-e.measureText(this.string_number).width/2;if(e.fillText(""+this.string_number,o,r+4.5),this.last_note!=null){const a=this.last_note.getStemX()-this.note.getX()+5;e.strokeStyle="#000000",e.lineCap="round",e.lineWidth=.6,this.dashed?yt.drawDashedLine(e,n+10,r,n+a,r,[3,3]):yt.drawDashedLine(e,n+10,r,n+a,r,[3,0]);let l,u;switch(this.leg){case yt.LineEndType.UP:l=-10,u=this.dashed?[3,3]:[3,0],yt.drawDashedLine(e,n+a,r,n+a,r+l,u);break;case yt.LineEndType.DOWN:l=10,u=this.dashed?[3,3]:[3,0],yt.drawDashedLine(e,n+a,r,n+a,r+l,u);break}}e.restore()}}function k_(...i){zl.DEBUG&&B.L("Vex.Flow.Articulation",i)}const{ABOVE:so,BELOW:Ka}=Ne.Position,u4=(i,e)=>i(e/.5)*.5,op=(i,e)=>e===so?i<=5:i>=1,h4=(i,e)=>op(i,e)?e===so?Math.ceil:Math.floor:Math.round,D_=(i,e,t,s)=>{const n=u4(h4(e,t),e),r=i&&op(n,t),o=n%1===0;return r&&o?n+.5*-s:n},ap=i=>{const e=i.getCategory();return e==="stavenotes"||e==="gracenotes"},f4=i=>{const e=i.getCategory();return e==="tabnotes"||e==="numberednotes"},O_=(i,e)=>{const t=i.getStave(),s=i.getStemDirection(),{topY:n,baseY:r}=i.getStemExtents();if(ap(i))return i.hasStem()?s===Be.UP?n:r:Math.min(...i.getYs());if(f4(i))return i.hasStem()&&s===Be.UP?n:t.getYForTopText(e);throw new B.RERR("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")},F_=(i,e)=>{const t=i.getStave(),s=i.getStemDirection(),{topY:n,baseY:r}=i.getStemExtents();if(ap(i))return i.hasStem()?s===Be.UP?r:n:Math.max(...i.getYs());if(f4(i))return i.hasStem()?s===Be.UP?t.getYForBottomText(e):n:t.getYForBottomText(e);throw new B.RERR("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")},V_=(i,e)=>{const t=e===so&&i.getStemDirection()===Be.UP||e===Ka&&i.getStemDirection()===Be.DOWN;return ap(i)?i.hasStem()&&t?.5:1:i.hasStem()&&t?1:0};let zl=class Wc extends Ne{static get CATEGORY(){return"articulations"}static get INITIAL_OFFSET(){return-.5}static format(e,t){if(!e||e.length===0)return!1;const s=l=>l.getPosition()===so,n=l=>l.getPosition()===Ka,r=.5,o=(l,u,h)=>u4(h4(u,h),l.glyph.getMetrics().height/10+r);e.filter(s).forEach(l=>{l.setTextLine(t.top_text_line),t.top_text_line+=o(l,t.top_text_line,so)}),e.filter(n).forEach(l=>{l.setTextLine(t.text_line),t.text_line+=o(l,t.text_line,Ka)});const a=e.map(l=>l.getWidth()).reduce((l,u)=>Math.max(u,l));return t.left_shift+=a/2,t.right_shift+=a/2,!0}static easyScoreHook({articulations:e},t,s){if(!e)return;const n={staccato:"a.",tenuto:"a-"};e.split(",").map(r=>r.trim().split(".")).map(([r,o])=>{const a={type:n[r]};return o&&(a.position=Ne.PositionString[o]),s.getFactory().Articulation(a)}).map(r=>t.addModifier(0,r))}constructor(e){if(super(),this.setAttribute("type","Articulation"),this.note=null,this.index=null,this.type=e,this.position=Ka,this.render_options={font_scale:38},this.articulation=ie.articulationCodes(this.type),!this.articulation)throw new B.RERR("ArgumentError",`Articulation not found: ${this.type}`);this.glyph=new De(this.articulation.code,this.render_options.font_scale),this.setWidth(this.glyph.getMetrics().width)}getCategory(){return Wc.CATEGORY}draw(){const{note:e,index:t,position:s,glyph:n,articulation:{between_lines:r},text_line:o,context:a}=this;if(this.checkContext(),!e||t==null)throw new B.RERR("NoAttachedNote","Can't draw Articulation without a note and index.");this.setRendered();const l=e.getStave(),u=l.getSpacingBetweenLines(),h=e.getCategory()==="tabnotes",{x:c}=e.getModifierStartXY(s,t),f=!r||h,d=V_(e,s);let p={[so]:()=>{n.setOrigin(.5,1);const g=O_(e,o)-(o+d)*u+(this.y_shift||0);return f?Math.min(l.getYForTopText(Wc.INITIAL_OFFSET),g):g},[Ka]:()=>{n.setOrigin(.5,0);const g=F_(e,o)+(o+d)*u;return f?Math.max(l.getYForBottomText(Wc.INITIAL_OFFSET),g):g}}[s]();if(!h){const g=s===so?-1:1,m=h?e.positions[t].str:e.getKeyProps()[t].line,y=(e.getYs()[t]-p)/u+m,v=D_(r,y,s,g);op(v,s)&&n.setOrigin(.5,.5),p+=Math.abs(v-y)*u*g}k_(`Rendering articulation at (x: ${c}, y: ${p})`),n.render(a,c,p)}};class ua extends l4{static getNextContext(e){const t=e.tContexts,s=t.indexOf(e);return t[s+1]}constructor(){super(),this.setAttribute("type","TickContext"),this.currentTick=new Xe(0,1),this.maxTicks=new Xe(0,1),this.minTicks=null,this.padding=3,this.x=0,this.xBase=0,this.xOffset=0,this.tickables=[],this.notePx=0,this.extraLeftPx=0,this.extraRightPx=0,this.tContexts=[]}getX(){return this.x}setX(e){return this.x=e,this.xBase=e,this.xOffset=0,this}getXBase(){return this.xBase}setXBase(e){this.xBase=e,this.x=e+this.xOffset}getXOffset(){return this.xOffset}setXOffset(e){this.xOffset=e,this.x=this.xBase+e}getWidth(){return this.width+this.padding*2}setPadding(e){return this.padding=e,this}getMaxTicks(){return this.maxTicks}getMinTicks(){return this.minTicks}getTickables(){return this.tickables}getCenterAlignedTickables(){return this.tickables.filter(e=>e.isCenterAligned())}getMetrics(){const{width:e,notePx:t,extraLeftPx:s,extraRightPx:n}=this;return{width:e,notePx:t,extraLeftPx:s,extraRightPx:n}}getCurrentTick(){return this.currentTick}setCurrentTick(e){this.currentTick=e,this.preFormatted=!1}getExtraPx(){let e=0,t=0,s=0,n=0;for(let r=0;r0&&n--;for(let l=0;l{e2("Preformatting ModifierContext: ",e.CATEGORY),e.format(this.getModifiers(e.CATEGORY),this.state,this)}),this.width=this.state.left_shift+this.state.right_shift,this.preFormatted=!0)}postFormat(){this.postFormatted||this.POSTFORMAT.forEach(e=>{e2("Postformatting ModifierContext: ",e.CATEGORY),e.postFormat(this.getModifiers(e.CATEGORY),this)})}}function U_(...i){Ms.DEBUG&&B.L("Vex.Flow.Formatter",i)}function d4(i,e){var s,n;const t=i[e+1];return t&&((s=t==null?void 0:t.keys)!=null&&s.includes("b/4"))||(n=t==null?void 0:t.keys)!=null&&n.includes("r/4")?d4(i,e+1):t}function t2(i,e,t){if(!i||!i.length)throw new B.RERR("BadArgument","No voices to format");const s=i[0].getTotalTicks(),n=i.reduce((l,u)=>{if(!u.getTotalTicks().equals(s))throw new B.RERR("TickMismatch","Voices should have same total note duration in ticks.");if(u.getMode()===Gs.Mode.STRICT&&!u.isComplete())throw new B.RERR("IncompleteVoice","Voice does not have enough notes.");return Math.max(l,Xe.LCM(l,u.getResolutionMultiplier()))},1),r={},o=[],a=[];return i.forEach(l=>{const u=new Xe(0,n);l.getTickables().forEach(h=>{const c=u.numerator;if(!r[c]){const f=new e;a.push(f),r[c]=f}t(h,r[c]),o.push(c),u.add(h.getTicks())})}),{map:r,array:a,list:B.SortAndUnique(o,(l,u)=>l-u,(l,u)=>l===u),resolutionMultiplier:n}}class Ms{static SimpleFormat(e,t=0,{paddingBetween:s=10}={}){e.reduce((n,r)=>{r.addToModifierContext(new Cl);const o=new ua().addTickable(r).preFormat(),a=o.getExtraPx();return o.setX(n+a.left),n+o.getWidth()+a.right+s},t)}static plotDebugging(e,t,s,n,r){const o=s+Ii.STAVEPADDING,a=t.contextGaps;function l(u,h,c){e.beginPath(),e.setStrokeStyle(c),e.setFillStyle(c),e.setLineWidth(1),e.fillRect(u,n,h-u,r-n)}e.save(),e.setFont("Arial",8,""),a.gaps.forEach(u=>{l(o+u.x1,o+u.x2,"#aaa"),e.fillText(Math.round(u.x2-u.x1),o+u.x1,r+12)}),e.fillText(Math.round(a.total)+"px",o-20,r+12),e.setFillStyle("red"),e.fillText("Loss: "+t.lossHistory.map(u=>Math.round(u)),o-20,r+22),e.restore()}static FormatAndDraw(e,t,s,n){const r={auto_beam:!1,align_rests:!1};typeof n=="object"?B.Merge(r,n):typeof n=="boolean"&&(r.auto_beam=n);const o=new Gs(ie.TIME4_4).setMode(Gs.Mode.SOFT).addTickables(s),a=r.auto_beam?Ml.applyAndGetBeams(o):[];return new Ms().joinVoices([o],{align_rests:r.align_rests}).formatToStave([o],t,{align_rests:r.align_rests,stave:t}),o.setStave(t).draw(e,t),a.forEach(l=>l.setContext(e).draw()),o.getBoundingBox()}static FormatAndDrawTab(e,t,s,n,r,o,a){const l={auto_beam:o,align_rests:!1};typeof a=="object"?B.Merge(l,a):typeof a=="boolean"&&(l.auto_beam=a);const u=new Gs(ie.TIME4_4).setMode(Gs.Mode.SOFT).addTickables(r),h=new Gs(ie.TIME4_4).setMode(Gs.Mode.SOFT).addTickables(n),c=l.auto_beam?Ml.applyAndGetBeams(u):[];new Ms().joinVoices([u],{align_rests:l.align_rests}).joinVoices([h]).formatToStave([u,h],s,{align_rests:l.align_rests}),u.draw(e,s),h.draw(e,t),c.forEach(f=>f.setContext(e).draw()),new $e(s,t).setContext(e).draw()}static AlignRestsToNotes(e,t,s){return e.forEach((n,r)=>{if(n instanceof Bt&&n.isRest()){if(n.tuplet&&!s)return;if(["va5","v3c"].includes(n.glyph.code_head)){const o=n.glyph.code_head==="va5"?10:14,a=e[r-1],l=d4(e,r);let u=!1;if(a&&l&&a.beam&&l.beam&&(u=a.beam.notes.includes(l)),u){n.setKeyLine(0,3);let h=[...a.beam.notes,...l.beam.notes];n.beam&&n.beam.notes&&h.push(...n.beam.notes),h=Array.from(new Set(h));for(let c=0;c0){const p=f<1.5?Math.abs(f-1.5)*o:0;d.setResetHeight(p)}else{const p=f>4.5?Math.abs(f-4.5)*o:0;d.setResetHeight(p)}}}}}}),this}constructor(){this.minTotalWidth=0,this.hasMinTotalWidth=!1,this.totalTicks=new Xe(0,1),this.tickContexts=null,this.modiferContexts=null,this.contextGaps={total:0,gaps:[]},this.voices=[]}alignRests(e,t){if(!e||!e.length)throw new B.RERR("BadArgument","No voices to format rests");e.forEach(s=>Ms.AlignRestsToNotes(s.getTickables(),t))}preCalculateMinTotalWidth(e){if(this.hasMinTotalWidth)return this.minTotalWidth;if(!this.tickContexts){if(!e)throw new B.RERR("BadArgument","'voices' required to run preCalculateMinTotalWidth");this.createTickContexts(e)}const{list:t,map:s}=this.tickContexts;return this.minTotalWidth=t.map(n=>{const r=s[n];return r.preFormat(),r.getWidth()}).reduce((n,r)=>n+r,0),this.hasMinTotalWidth=!0,this.minTotalWidth}getMinTotalWidth(){if(!this.hasMinTotalWidth)throw new B.RERR("NoMinTotalWidth","Call 'preCalculateMinTotalWidth' or 'preFormat' before calling 'getMinTotalWidth'");return this.minTotalWidth}createModifierContexts(e){const t=t2(e,Cl,(s,n)=>s.addToModifierContext(n));return this.modiferContexts=t,t}createTickContexts(e){const t=t2(e,ua,(s,n)=>n.addTickable(s));return t.array.forEach(s=>{s.tContexts=t.array}),this.totalTicks=e[0].getTicksUsed().clone(),this.tickContexts=t,t}preFormat(e=0,t,s,n){const r=this.tickContexts,{list:o,map:a,resolutionMultiplier:l}=r;s&&n&&s.forEach(g=>g.setStave(n).preFormat());let u=0,h=0;const c=e/2;if(this.minTotalWidth=0,o.forEach(g=>{const m=a[g];t&&m.setContext(t),m.preFormat();const b=m.getWidth();this.minTotalWidth+=b;const y=m.getMetrics();u=u+h+y.extraLeftPx,m.setX(u),h=b-y.extraLeftPx}),this.minTotalWidth=u+h,this.hasMinTotalWidth=!0,e<=0)return;const d=(e-this.minTotalWidth)/(this.totalTicks.value()*l);let p=0;o.forEach((g,m)=>{const b=o[m-1]||0,y=a[g],v=(g-b)*d;p+=v,y.setX(y.getX()+p),y.getCenterAlignedTickables().forEach(S=>{S.center_x_shift=c-y.getX()})}),o.length!==1&&(this.justifyWidth=e,this.lossHistory=[],this.evaluate())}evaluate(){const e=this.justifyWidth;this.contextGaps={total:0,gaps:[]},this.tickContexts.list.forEach((r,o)=>{if(o===0)return;const a=this.tickContexts.list[o-1],l=this.tickContexts.map[a],u=this.tickContexts.map[r],h=l.getMetrics(),c=l.getX()+h.width,f=u.getX(),d=f-c;this.contextGaps.total+=d,this.contextGaps.gaps.push({x1:c,x2:f}),u.getFormatterMetrics().freedom.left=d,l.getFormatterMetrics().freedom.right=d});const t=this.durationStats={};function s(r,o){const a=t[r];a===void 0?t[r]={mean:o,count:1}:(a.count+=1,a.mean=(a.mean+o)/2)}this.voices.forEach(r=>{r.getTickables().forEach((o,a,l)=>{const u=o.getTicks().clone().simplify().toString(),h=o.getMetrics(),c=o.getFormatterMetrics(),f=o.getX()+h.noteWidth+h.modRightPx+h.extraRightPx;let d=0;if(a{r.getTickables().forEach(o=>{const a=o.getTicks().clone().simplify().toString(),l=o.getFormatterMetrics();l.iterations+=1,l.space.deviation=l.space.used-t[a].mean,l.duration=a,l.space.mean=t[a].mean,n+=Math.pow(t[a].mean,2)})}),this.totalCost=Math.sqrt(n),this.lossHistory.push(this.totalCost),this}tune(){const e=n=>n.reduce((r,o)=>r+o);function t(n,r,o,a){n.setX(n.getX()+a),n.getFormatterMetrics().freedom.left+=a,n.getFormatterMetrics().freedom.right-=a,r&&(r.getFormatterMetrics().freedom.right+=a),o&&(o.getFormatterMetrics().freedom.left-=a)}let s=0;return this.tickContexts.list.forEach((n,r,o)=>{const a=this.tickContexts.map[n],l=r>0?this.tickContexts.map[o[r-1]]:null,u=rf.getFormatterMetrics().space.deviation));h>0?s=-Math.min(a.getFormatterMetrics().freedom.right,Math.abs(h)):h<0&&(u?s=Math.min(u.getFormatterMetrics().freedom.right,Math.abs(h)):s=0);const c=Math.min(5,Math.abs(s));s=s>0?c:-c}),this.evaluate()}postFormat(){const e=t=>t.list.forEach(s=>t.map[s].postFormat());return e(this.modiferContexts),e(this.tickContexts),this}joinVoices(e){return this.createModifierContexts(e),this.hasMinTotalWidth=!1,this}format(e,t,s){const n={align_rests:!1,context:null,stave:null};return B.Merge(n,s),this.voices=e,this.alignRests(e,n.align_rests),this.createTickContexts(e),this.preFormat(t,n.context,e,n.stave),this}formatToStave(e,t,s){const n=t.getNoteEndX()-t.getNoteStartX()-10;U_("Formatting voices to width: ",n);const r={context:t.getContext()};return B.Merge(r,s),this.format(e,n,r)}}class st extends qt{static get Position(){return{LEFT:1,RIGHT:2,ABOVE:3,BELOW:4,BEGIN:5,END:6}}constructor(){super(),this.setAttribute("type","StaveModifier"),this.padding=10,this.position=st.Position.ABOVE,this.layoutMetrics=null}getPosition(){return this.position}setPosition(e){return this.position=e,this}getStave(){return this.stave}setStave(e){return this.stave=e,this}getWidth(){return this.width}setWidth(e){return this.width=e,this}getX(){return this.x}setX(e){return this.x=e,this}getCategory(){return""}makeSpacer(e){return{getContext(){return!0},setStave(){},renderToStave(){},getMetrics(){return{width:e}}}}placeGlyphOnLine(e,t,s){e.setYShift(t.getYForLine(s)-t.getYForGlyphs())}getPadding(e){return e!==void 0&&e<2?0:this.padding}setPadding(e){return this.padding=e,this}setLayoutMetrics(e){return this.layoutMetrics=e,this}getLayoutMetrics(){return this.layoutMetrics}}class ct extends st{static get CATEGORY(){return"barlines"}static get type(){return{SINGLE:1,DOUBLE:2,END:3,REPEAT_BEGIN:4,REPEAT_END:5,REPEAT_BOTH:6,NONE:7}}static get typeString(){return{single:ct.type.SINGLE,double:ct.type.DOUBLE,end:ct.type.END,repeatBegin:ct.type.REPEAT_BEGIN,repeatEnd:ct.type.REPEAT_END,repeatBoth:ct.type.REPEAT_BOTH,none:ct.type.NONE}}constructor(e){super(),this.setAttribute("type","Barline"),this.thickness=ie.STAVE_LINE_THICKNESS;const t=ct.type;this.widths={},this.widths[t.SINGLE]=5,this.widths[t.DOUBLE]=5,this.widths[t.END]=5,this.widths[t.REPEAT_BEGIN]=5,this.widths[t.REPEAT_END]=5,this.widths[t.REPEAT_BOTH]=5,this.widths[t.NONE]=5,this.paddings={},this.paddings[t.SINGLE]=0,this.paddings[t.DOUBLE]=0,this.paddings[t.END]=0,this.paddings[t.REPEAT_BEGIN]=15,this.paddings[t.REPEAT_END]=15,this.paddings[t.REPEAT_BOTH]=15,this.paddings[t.NONE]=0,this.layoutMetricsMap={},this.layoutMetricsMap[t.SINGLE]={xMin:0,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[t.DOUBLE]={xMin:-3,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[t.END]={xMin:-5,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[t.REPEAT_END]={xMin:-10,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[t.REPEAT_BEGIN]={xMin:-2,xMax:10,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[t.REPEAT_BOTH]={xMin:-10,xMax:10,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[t.NONE]={xMin:0,xMax:0,paddingLeft:5,paddingRight:5},this.setPosition(st.Position.BEGIN),this.setType(e)}getCategory(){return ct.CATEGORY}getType(){return this.type}setType(e){return this.type=typeof e=="string"?ct.typeString[e]:e,this.setWidth(this.widths[this.type]),this.setPadding(this.paddings[this.type]),this.setLayoutMetrics(this.layoutMetricsMap[this.type]),this}draw(e){switch(e.checkContext(),this.setRendered(),this.type){case ct.type.SINGLE:this.drawVerticalBar(e,this.x,!1);break;case ct.type.DOUBLE:this.drawVerticalBar(e,this.x,!0);break;case ct.type.END:this.drawVerticalEndBar(e,this.x);break;case ct.type.REPEAT_BEGIN:this.drawRepeatBar(e,this.x,!0),e.getX()!==this.x&&this.drawVerticalBar(e,e.getX());break;case ct.type.REPEAT_END:this.drawRepeatBar(e,this.x,!1);break;case ct.type.REPEAT_BOTH:this.drawRepeatBar(e,this.x,!1),this.drawRepeatBar(e,this.x,!0);break}}drawVerticalBar(e,t,s){e.checkContext();const n=e.getTopLineTopY(),r=e.getBottomLineBottomY();s&&e.context.fillRect(t-3,n,1,r-n),e.context.fillRect(t,n,1,r-n)}drawVerticalEndBar(e,t){e.checkContext();const s=e.getTopLineTopY(),n=e.getBottomLineBottomY();e.context.fillRect(t-5,s,1,n-s),e.context.fillRect(t-2,s,3,n-s)}drawRepeatBar(e,t,s){e.checkContext();const n=e.getTopLineTopY(),r=e.getBottomLineBottomY();let o=3;s||(o=-5),e.context.fillRect(t+o,n,1,r-n),e.context.fillRect(t-2,n,3,r-n);const a=2;s?o+=4:o-=4;const l=t+o+a/2;let u=(e.getNumLines()-1)*e.getSpacingBetweenLines();u=u/2-e.getSpacingBetweenLines()/2;let h=n+u+a/2;e.context.beginPath(),e.context.arc(l,h,a,0,Math.PI*2,!1),e.context.fill(),h+=e.getSpacingBetweenLines(),e.context.beginPath(),e.context.arc(l,h,a,0,Math.PI*2,!1),e.context.fill()}}let Td=class Ui extends st{static get CATEGORY(){return"repetitions"}static get type(){return{NONE:1,CODA_LEFT:2,CODA_RIGHT:3,SEGNO_LEFT:4,SEGNO_RIGHT:5,DC:6,DC_AL_CODA:7,DC_AL_FINE:8,DS:9,DS_AL_CODA:10,DS_AL_FINE:11,FINE:12,TO_CODA:13}}constructor(e,t,s){super(),this.setAttribute("type","Repetition"),this.symbol_type=e,this.x=t,this.x_shift=0,this.y_shift=s,this.font={family:"times",size:12,weight:"bold italic"}}getCategory(){return Ui.CATEGORY}setShiftX(e){return this.x_shift=e,this}setShiftY(e){return this.y_shift=e,this}setX(e){return this.x=e,this}draw(e,t){switch(this.setRendered(),this.symbol_type){case Ui.type.CODA_RIGHT:this.drawCodaFixed(e,t+e.width);break;case Ui.type.CODA_LEFT:this.drawSymbolText(e,t,"Coda",!1);break;case Ui.type.SEGNO_LEFT:this.drawSignoFixed(e,t);break;case Ui.type.SEGNO_RIGHT:this.drawSignoFixed(e,t+e.width);break;case Ui.type.DC:this.drawSymbolText(e,t,"D.C.",!1);break;case Ui.type.DC_AL_CODA:this.drawSymbolText(e,t,"D.C. al Coda",!0);break;case Ui.type.DC_AL_FINE:this.drawSymbolText(e,t,"D.C. al Fine",!1);break;case Ui.type.DS:this.drawSymbolText(e,t,"D.S.",!1);break;case Ui.type.DS_AL_CODA:this.drawSymbolText(e,t,"D.S. al Coda",!0);break;case Ui.type.DS_AL_FINE:this.drawSymbolText(e,t,"D.S. al Fine",!1);break;case Ui.type.FINE:this.drawSymbolText(e,t,"Fine",!1);break;case Ui.type.TO_CODA:this.drawSymbolText(e,t,"To Coda",!0);break}return this}drawCodaFixed(e,t){const s=e.getYForTopText(e.options.num_lines)+this.y_shift;return De.renderGlyph(e.context,this.x+t+this.x_shift,s+25,40,"v4d",!0),this}drawSignoFixed(e,t){const s=e.getYForTopText(e.options.num_lines)+this.y_shift;return De.renderGlyph(e.context,this.x+t+this.x_shift,s+25,30,"v8c",!0),this}drawSymbolText(e,t,s,n){const r=e.checkContext();r.save(),r.setFont(this.font.family,this.font.size,this.font.weight);let o=0+this.x_shift,a=t+this.x_shift;this.symbol_type===Ui.type.CODA_LEFT?(o=this.x+e.options.vertical_bar_width,a=o+r.measureText(s).width+12):(this.x_shift=-(o+r.measureText(s).width+12+e.options.vertical_bar_width+12),o=this.x+this.x_shift+e.options.vertical_bar_width,a=o+r.measureText(s).width+12);const l=e.getYForTopText(e.options.num_lines)+this.y_shift+25;return n&&De.renderGlyph(r,a,l,40,"v4d",!0),r.fillText(s,o,l+5),r.restore(),this}};class lp extends st{static get CATEGORY(){return"stavesection"}constructor(e,t,s){super(),this.setAttribute("type","StaveSection"),this.setWidth(16),this.section=e,this.x=t,this.shift_x=0,this.shift_y=s,this.font={family:"sans-serif",size:12,weight:"bold"}}getCategory(){return lp.CATEGORY}setStaveSection(e){return this.section=e,this}setShiftX(e){return this.shift_x=e,this}setShiftY(e){return this.shift_y=e,this}draw(e,t){const s=e.checkContext();this.setRendered(),s.save(),s.lineWidth=2,s.setFont(this.font.family,this.font.size,this.font.weight);const n=s.measureText(""+this.section),r=n.width,o=n.height;let a=r+6;a<18&&(a=18);const l=o,u=e.getYForTopText(3)+this.shift_y;let h=this.x+t;return s.beginPath(),s.lineWidth=2,s.rect(h,u+o/4,a,l),s.stroke(),h+=(a-r)/2,s.fillText(""+this.section,h,u+16),s.restore(),this}}class Ch extends st{static get CATEGORY(){return"stavetempo"}constructor(e,t,s){super(),this.setAttribute("type","StaveTempo"),this.tempo=e,this.position=Ne.Position.ABOVE,this.x=t,this.shift_x=10,this.shift_y=s,this.font={family:"times",size:14,weight:"bold"},this.render_options={glyph_font_scale:30}}getCategory(){return Ch.CATEGORY}setTempo(e){return this.tempo=e,this}setShiftX(e){return this.shift_x=e,this}setShiftY(e){return this.shift_y=e,this}draw(e,t){const s=e.checkContext();this.setRendered();const n=this.render_options,r=n.glyph_font_scale/38,o=this.tempo.name,a=this.tempo.duration,l=this.tempo.dots,u=this.tempo.bpm,h=this.font;let c=this.x+this.shift_x+t;const f=e.getYForTopText(1)+this.shift_y;if(s.save(),s.openGroup("stavetempo",null,{}),o&&(s.setFont(h.family,h.size,h.weight),s.fillText(o,c,f),c+=s.measureText(o).width),a&&u){s.setFont(h.family,h.size,"normal"),o&&(c+=s.measureText(" ").width,s.fillText("(",c,f),c+=s.measureText("(").width);const d=ie.getGlyphProps(a);if(c+=3*r,De.renderGlyph(s,c,f,n.glyph_font_scale,d.code_head),c+=d.getWidth()*r,d.stem){let p=30;d.beam_count&&(p+=3*(d.beam_count-1)),p*=r;const g=f-p;s.fillRect(c-r,g,r,p),d.flag&&(De.renderGlyph(s,c,g,n.glyph_font_scale,d.code_flag_upstem),l||(c+=6*r))}for(let p=0;p=e.line?l.above:l.below)}this.placeGlyphOnLine(n,this.stave,e.line),this.glyphs.push(n);const o=this.xPositions[this.xPositions.length-1],a=n.getMetrics().width+r;this.xPositions.push(o+a),this.width+=a}cancelKey(e){return this.formatted=!1,this.cancelKeySpec=e,this}convertToCancelAccList(e){const t=ie.keySignature(e),s=this.accList.length>0&&t.length>0&&t[0].type!==this.accList[0].type,n=s?t.length:t.length-this.accList.length;if(n<1)return;const r=[];for(let o=0;o0?e[0].type:null;let s;if(this.cancelKeySpec&&(s=this.convertToCancelAccList(this.cancelKeySpec)),this.alterKeySpec&&this.convertToAlterAccList(this.alterKeySpec),this.accList.length>0){const n=(this.position===st.Position.END?this.stave.endClef:this.stave.clef)||this.stave.clef;s&&this.convertAccLines(n,s.type,s.accList),this.convertAccLines(n,t,e);for(let r=0;r0){this.stave.context.openGroup("keysignature");for(let e=0;e{const e=i.split("/").filter(t=>t!=="");if(e.length!==2)throw new B.RERR("BadTimeSignature",`Invalid time spec: ${i}. Must be in the form "/"`);e.forEach(t=>{if(isNaN(Number(t)))throw new B.RERR("BadTimeSignature",`Invalid time spec: ${i}. Must contain two valid numbers.`)})};class Br extends st{static get CATEGORY(){return"timesignatures"}static get glyphs(){return{C:{code:"v41",point:40,line:2},"C|":{code:"vb6",point:40,line:2}}}constructor(e=null,t=15,s=!0){if(super(),this.setAttribute("type","TimeSignature"),this.validate_args=s,e===null)return;const n=t;this.point=40,this.topLine=2,this.bottomLine=4,this.setPosition(st.Position.BEGIN),this.setTimeSig(e),this.setWidth(this.timeSig.glyph.getMetrics().width),this.setPadding(n)}getCategory(){return Br.CATEGORY}parseTimeSpec(e){if(e==="C"||e==="C|"){const{line:n,code:r,point:o}=Br.glyphs[e];return{line:n,num:!1,glyph:new De(r,o)}}this.validate_args&&W_(e);const[t,s]=e.split("/").map(n=>n.split(""));return{num:!0,glyph:this.makeTimeSignatureGlyph(t,s)}}makeTimeSignatureGlyph(e,t){const s=new De("v0",this.point);s.topGlyphs=[],s.botGlyphs=[];let n=0;for(let c=0;cr?n:r,a=s.getMetrics().x_min;s.getMetrics=()=>({x_min:a,x_max:a+o,width:o});const l=(o-n)/2,u=(o-r)/2,h=this;return s.renderToStave=function(f){let d=f+l;for(let p=0;pt.visible).filter(Boolean).length}getOptions(){return this.options}setNoteStartX(e){this.formatted||this.format(),this.setStartX(e);const t=this.modifiers[0];return t.setX(this.start_x-t.getWidth()),this}setStartX(e){this.start_x=e}getNoteStartX(){return this.formatted||this.format(),this.start_x}getNoteEndX(){return this.formatted||this.format(),this.end_x}getTieStartX(){return this.start_x}getTieEndX(){return this.x+this.width}getX(){return this.x}getNumLines(){return this.options.num_lines}setNumLines(e){return this.options.num_lines=parseInt(e,10),this.resetLines(),this}setY(e){return this.y=e,this}getTopLineTopY(){return this.getYForLine(0)-ie.STAVE_LINE_THICKNESS/2}getBottomLineBottomY(){return this.getLines()===2?this.getYForLine(6)+ie.STAVE_LINE_THICKNESS/2:this.getYForLine(this.getNumLines()-1)+ie.STAVE_LINE_THICKNESS/2}setX(e){const t=e-this.x;this.formatted=!1,this.x=e,this.start_x+=t,this.end_x+=t;for(let s=0;ss.getWidth()&&(t-=s.getWidth()),t}setRepetitionTypeLeft(e,t){return this.modifiers.push(new Td(e,this.x,t)),this}setRepetitionTypeRight(e,t){return this.modifiers.push(new Td(e,this.x,t)),this}setVoltaType(e,t,s){if(e===2)vi.type===2&&vi.stave.modifiers.push(new As(vi.type,vi.number_t,vi.x,vi.y)),vi={stave:this,type:e,number_t:t,MeasureNumber:this.MeasureNumber,y:s,x:this.x};else if(e===4){let n=this.MeasureNumber-vi.MeasureNumber,r=Math.max(vi.y,s);for(let o=0;o<=n;o++)vf[vi.MeasureNumber+o]={type:o===0?2:o===n?4:0,number_t:t,y:r};vi={}}else this.modifiers.push(new As(e,t,this.x,s));return this}drawVolta(){let e=vf[this.MeasureNumber];e&&(this.modifiers.push(new As(e.type,e.number_t,this.x,e.y)),delete vf[this.MeasureNumber]),vi.type&&vi.MeasureNumber==this.MeasureNumber&&(this.modifiers.push(new As(vi.type,vi.number_t,this.x,vi.y)),vi={})}setSection(e,t,s=0,n=12){const r=new lp(e,this.x+s,t);return r.font.size=n,this.modifiers.push(r),this}setTempo(e,t){return this.modifiers.push(new Ch(e,this.x,t)),this}setText(e,t,s){let n=new cp(e,t,s);return n.setFont({family:"Arial",size:14,weight:"normal"}),this.modifiers.push(n),this}getHeight(){return this.height}getSpacingBetweenLines(){return this.options.spacing_between_lines_px}getBoundingBox(){return new po(this.x,this.y,this.width,this.getBottomY()-this.y)}getBottomY(){const e=this.options,t=e.spacing_between_lines_px;return this.getYForLine(e.num_lines)+e.space_below_staff_ln*t}getBottomLineY(){return this.getYForLine(this.options.num_lines)}getYForLine(e){const t=this.options,s=t.spacing_between_lines_px,n=t.space_above_staff_ln;return this.y+e*s+n*s}getLineForY(e){const t=this.options,s=t.spacing_between_lines_px,n=t.space_above_staff_ln;return(e-this.y)/s-n}getYForTopText(e){const t=e||0;return this.getYForLine(-t-this.options.top_text_position)}getYForBottomText(e){const t=e||0;return this.getYForLine(this.options.bottom_text_position+t)}getYForNote(e){const t=this.options,s=t.spacing_between_lines_px,n=t.space_above_staff_ln;return this.y+n*s+5*s-e*s}getYForGlyphs(){return this.getYForLine(3)}addModifier(e,t,s){return t!==void 0&&e.setPosition(t),s&&(this.timeSignature.numerator=s.numerator,this.timeSignature.denominator=s.denominator),e.setStave(this),this.formatted=!1,this.modifiers.push(e),this}addEndModifier(e){return this.addModifier(e,st.Position.END),this}setBegBarType(e){const{SINGLE:t,REPEAT_BEGIN:s,NONE:n}=ct.type;return(e===t||e===s||e===n)&&(this.modifiers[0].setType(e),this.formatted=!1),this}setEndBarType(e){return e!==ct.type.REPEAT_BEGIN&&(this.modifiers[1].setType(e),this.formatted=!1),this}setClef(e,t,s,n){n===void 0&&(n=st.Position.BEGIN),n===st.Position.END?this.endClef=e:this.clef=e;const r=this.getModifiers(n,zs.CATEGORY);return r.length===0?this.addClef(e,t,s,n):r[0].setType(e,t,s),this}setEndClef(e,t,s){return this.setClef(e,t,s,st.Position.END),this}setKeySignature(e,t,s){this.options.keySignature=e,s===void 0&&(s=st.Position.BEGIN);const n=this.getModifiers(s,mo.CATEGORY);return n.length===0?this.options.DYMusicScoreType!=="jianpu"&&this.addKeySignature(e,t,s):n[0].setKeySig(e,t),this}setEndKeySignature(e,t){return this.setKeySignature(e,t,st.Position.END),this}setTimeSignature(e,t,s){s===void 0&&(s=st.Position.BEGIN);const n=this.getModifiers(s,Br.CATEGORY);return n.length===0?this.addTimeSignature(e,t,s):n[0].setTimeSig(e),this}setEndTimeSignature(e,t){return this.setTimeSignature(e,t,st.Position.END),this}addKeySignature(e,t,s){return s===void 0&&(s=st.Position.BEGIN),this.addModifier(new mo(e,t).setPosition(s),s),this}addClef(e,t,s,n){return n===void 0||n===st.Position.BEGIN?this.clef=e:n===st.Position.END&&(this.endClef=e),this.addModifier(new zs(e,t,s),n),this}addEndClef(e,t,s){return this.addClef(e,t,s,st.Position.END),this}addTimeSignature(e,t,s){return this.addModifier(new Br(e,t),s),this}addEndTimeSignature(e,t){return this.addTimeSignature(e,t,st.Position.END),this}addTrebleGlyph(){return this.addClef("treble"),this}getModifiers(e,t){return e===void 0&&t===void 0?this.modifiers:this.modifiers.filter(s=>(e===void 0||e===s.getPosition())&&(t===void 0||t===s.getCategory()))}sortByCategory(e,t){for(let s=e.length-1;s>=0;s--)for(let n=0;nt[e[n+1].getCategory()]){const r=e[n];e[n]=e[n+1],e[n+1]=r}}format(){const e=this.modifiers[0],t=this.modifiers[1],s=this.getModifiers(st.Position.BEGIN),n=this.getModifiers(st.Position.END);this.sortByCategory(s,{barlines:0,clefs:1,keysignatures:2,timesignatures:3}),this.sortByCategory(n,{timesignatures:0,keysignatures:1,barlines:2,clefs:3}),s.length>1&&e.getType()===ct.type.REPEAT_BEGIN&&(s.push(s.splice(0,1)[0]),s.splice(0,0,new ct(ct.type.SINGLE))),n.indexOf(t)>0&&n.splice(0,0,new ct(ct.type.NONE));let r,o,a,l=0,u=this.x;for(let f=0;f{o.includes(l)?a.visible=!0:a.visible=!1})}for(let o=0;othis.drawStaveTempo()),this.measure>0){this.context.save(),this.context.setFont(this.font.family,this.font.size,this.font.weight);const o=this.context.measureText(""+this.measure).width;n=this.getYForTopText(0)+3,this.context.fillText(""+this.measure,this.x-o/2,n),this.context.restore()}return this}drawStaveTempo(){if(!this.staveTempos.length)return;const e=document.querySelector(`#${this.attrs.id}`);if(!e)return;const t=e.parentElement.getBBox(),s=this.getYForLine(0),n=e.parentElement.parentElement.querySelectorAll(".vf-curve");if(n.length){const r=this.x+this.staveTempos[0].shift_x+this.getModifierXShift(0),o=this.getYForTopText(1)+t.y-s+5;n.forEach(a=>{const l=a.getBBox();l.x-10r&&l.y-10o&&(t.y=l.y+5)})}for(let r=0;r=0&&this.timeSignature.numerator){let e=40,t=0;this.MeasureNumber<2&&(e=70,t=-72),this.setText(`${this.timeSignature.numerator}`,1,{justification:1,shift_x:e,shift_y:t-13}),this.setText("ᅳ",1,{justification:1,shift_x:e+3,shift_y:t-2}),this.setText(`${this.timeSignature.denominator}`,1,{justification:1,shift_x:e,shift_y:t+8})}}drawVertical(e,t){this.drawVerticalFixed(this.x+e,t)}drawVerticalFixed(e,t){this.checkContext();const s=this.getYForLine(0),n=this.getYForLine(this.options.num_lines-1);t&&this.context.fillRect(e-3,s,1,n-s+1),this.context.fillRect(e,s,1,n-s+1)}drawVerticalBar(e){this.drawVerticalBarFixed(this.x+e,!1)}drawVerticalBarFixed(e){this.checkContext();const t=this.getYForLine(0),s=this.getYForLine(this.options.num_lines-1);this.context.fillRect(e,t,1,s-t+1)}getConfigForLines(){return this.options.line_config}setConfigForLine(e,t){if(e>=this.options.num_lines||e<0)throw new B.RERR("StaveConfigError","The line number must be within the range of the number of lines in the Stave.");if(t.visible===void 0)throw new B.RERR("StaveConfigError","The line configuration object is missing the 'visible' property.");if(typeof t.visible!="boolean")throw new B.RERR("StaveConfigError","The line configuration objects 'visible' property must be true or false.");return this.options.line_config[e]=t,this}setConfigForLines(e){if(e.length!==this.options.num_lines)throw new B.RERR("StaveConfigError","The length of the lines configuration array must match the number of lines in the Stave");for(const t in e)e[t]||(e[t]=this.options.line_config[t]),B.Merge(this.options.line_config[t],e[t]);return this.options.line_config=e,this}}class p4 extends Yl{constructor(e,t,s,n){const r={spacing_between_lines_px:13,num_lines:6,top_text_position:1};B.Merge(r,n),super(e,t,s,r),this.setAttribute("type","TabStave")}getYForGlyphs(){return this.getYForLine(2.5)}addTabGlyph(){return this.addClef("tab"),this}}function Y_(i,e){const t=[];let s=[];for(let n=1;n<=i;n++)e.indexOf(n)>-1?(t.push(s),s=[]):s.push(n);return s.length>0&&t.push(s),t}function Q_(i,e,t,s){const n=s!==1,r=s!==-1,o=t.getSpacingBetweenLines(),a=t.getNumLines(),l=[];return e.forEach(u=>{const h=u.indexOf(a)>-1,c=u.indexOf(1)>-1;if(n&&c||r&&h)return;u.length===1&&u.push(u[0]);const f=[];u.forEach((d,p,g)=>{const m=d===1,b=d===a;let y=t.getYForLine(d-1);p===0&&!m?y-=o/2-1:p===g.length-1&&!b&&(y+=o/2-1),f.push(y),s===1&&m?f.push(i-2):s===-1&&b&&f.push(i+2)}),l.push(f.sort((d,p)=>d-p))}),l}let up=class g4 extends np{static get CATEGORY(){return"tabnotes"}constructor(e,t){if(super(e),this.setAttribute("type","TabNote"),this.ghost=!1,this.positions=e.positions,B.Merge(this.render_options,{glyph_font_scale:ie.DEFAULT_TABLATURE_FONT_SCALE,draw_stem:t,draw_dots:t,draw_stem_through_stave:!1,y_shift:0,scale:1,font:"10pt Arial"}),this.glyph=ie.getGlyphProps(this.duration,this.noteType),!this.glyph)throw new B.RuntimeError("BadArguments",`Invalid note initialization data (No glyph found): ${JSON.stringify(e)}`);this.buildStem(),e.stem_direction?this.setStemDirection(e.stem_direction):this.setStemDirection(Be.UP),this.ghost=!1,this.updateWidth()}reset(){this.stave&&this.setStave(this.stave)}getCategory(){return g4.CATEGORY}setGhost(e){return this.ghost=e,this.updateWidth(),this}hasStem(){return this.render_options.draw_stem}getStemExtension(){const e=this.getGlyph();return this.stem_extension_override!=null?this.stem_extension_override:e?this.getStemDirection()===1?e.tabnote_stem_up_extension:e.tabnote_stem_down_extension:0}addDot(){const e=new Lr;return this.dots+=1,this.addModifier(e,0)}updateWidth(){this.glyphs=[],this.width=0;for(let e=0;ethis.width}setStave(e){super.setStave(e),this.context=e.context;let t;if(this.context){const n=this.context;for(this.width=0,t=0;tr.width),this.width=Math.max(r.getWidth(),this.width)}this.glyph.getWidth=()=>this.width}const s=this.positions.map(({str:n})=>e.getYForLine(n-1));return this.setYs(s),this.stem&&this.stem.setYBounds(this.getStemY(),this.getStemY()),this}getPositions(){return this.positions}addToModifierContext(e){this.setModifierContext(e);for(let t=0;t{e.getCategory()==="dots"&&!this.render_options.draw_dots||(e.setContext(this.context),e.drawWithStyle())})}drawStemThrough(){const e=this.getStemX(),t=this.getStemY(),s=this.context,n=this.render_options.draw_stem_through_stave;if(this.render_options.draw_stem&&n){const o=this.stave.getNumLines(),a=this.positions.map(h=>h.str),l=Y_(o,a),u=Q_(t,l,this.getStave(),this.getStemDirection());s.save(),s.setLineWidth(Be.WIDTH),u.forEach(h=>{h.length!==0&&(s.beginPath(),s.moveTo(e,h[0]),s.lineTo(e,h[h.length-1]),s.stroke(),s.closePath())}),s.restore()}}drawPositions(){const e=this.context,t=this.getAbsoluteX(),s=this.ys;for(let n=0;nparseInt(n,10)?ln.SLIDE_DOWN:ln.SLIDE_UP}this.slide_direction=t,this.render_options.cp1=11,this.render_options.cp2=14,this.render_options.y_shift=.5,this.setFont({font:"Times",size:10,style:"bold italic"}),this.setNotes(e)}renderTie(e){if(e.first_ys.length===0||e.last_ys.length===0)throw new B.RERR("BadArguments","No Y-values to render");const t=this.context,s=e.first_x_px,n=e.first_ys,r=e.last_x_px,o=this.slide_direction;if(o!==ln.SLIDE_UP&&o!==ln.SLIDE_DOWN)throw new B.RERR("BadSlide","Invalid slide direction");for(let a=0;athis.numStrings)throw new B.RERR("BadArguments",`String number must be between 1 and ${this.numStrings}:${e}`);return this.tuningValues[t-1]}getValueForFret(e,t){const s=this.getValueForString(t),n=parseInt(e,10);if(n<0)throw new B.RERR("BadArguments","Fret number must be 0 or higher: "+e);return s+n}getNoteForFret(e,t){const s=this.getValueForFret(e,t),n=Math.floor(s/12),r=s%12;return ie.integerToNote(r)+"/"+n}}class K_{constructor(e){this.music=new Ct,this.setKey(e)}setKey(e){return this.key=e,this.reset(),this}getKey(){return this.key}reset(){if(this.keyParts=this.music.getKeyParts(this.key),this.keyString=this.keyParts.root,this.keyParts.accidental&&(this.keyString+=this.keyParts.accidental),!Ct.scaleTypes[this.keyParts.type])throw new B.RERR("BadArguments",`Unsupported key type: ${this.key}`);this.scale=this.music.getScaleTones(this.music.getNoteValue(this.keyString),Ct.scaleTypes[this.keyParts.type]),this.scaleMap={},this.scaleMapByValue={},this.originalScaleMapByValue={};const t=Ct.root_indices[this.keyParts.root];for(let s=0;s{const s=fa.GLYPHS[t];if(!s)throw new B.RERR("Invalid dynamics character: "+t);const n=this.render_options.glyph_font_size,r=new De(s.code,n);this.glyphs.push(r),e+=s.width}),this.setWidth(e),this.preFormatted=!0,this}draw(){this.setRendered();const e=this.getAbsoluteX(),t=this.stave.getYForLine(this.line+-3);s2("Rendering Dynamics: ",this.sequence);let s=e;this.glyphs.forEach((n,r)=>{const o=this.sequence[r];n.render(this.context,s,t),s+=fa.GLYPHS[o].width})}}function n2(i,e,t,s,n,r,o){i.beginPath(),i.moveTo(e,t),i.lineTo(s,n),i.lineTo(r,o),i.lineTo(e,t),i.closePath(),i.fill()}function J_(i,e,t,s){const n=s.draw_start_arrow&&s.draw_end_arrow,r=e.x,o=e.y,a=t.x,l=t.y,u=Math.sqrt((a-r)*(a-r)+(l-o)*(l-o)),h=(u-s.arrowhead_length/3)/u;let c,f,d,p;s.draw_end_arrow||n?(c=Math.round(r+(a-r)*h),f=Math.round(o+(l-o)*h)):(c=a,f=l),s.draw_start_arrow||n?(d=r+(a-r)*(1-h),p=o+(l-o)*(1-h)):(d=r,p=o),s.color&&(i.setStrokeStyle(s.color),i.setFillStyle(s.color)),i.beginPath(),i.moveTo(d,p),i.lineTo(c,f),i.stroke(),i.closePath();const g=Math.atan2(l-o,a-r),m=Math.abs(s.arrowhead_length/Math.cos(s.arrowhead_angle));let b,y,v,S,A,P;(s.draw_end_arrow||n)&&(b=g+Math.PI+s.arrowhead_angle,v=a+Math.cos(b)*m,S=l+Math.sin(b)*m,y=g+Math.PI-s.arrowhead_angle,A=a+Math.cos(y)*m,P=l+Math.sin(y)*m,n2(i,v,S,a,l,A,P)),(s.draw_start_arrow||n)&&(b=g+s.arrowhead_angle,v=r+Math.cos(b)*m,S=o+Math.sin(b)*m,y=g-s.arrowhead_angle,A=r+Math.cos(y)*m,P=o+Math.sin(y)*m,n2(i,v,S,r,o,A,P))}class cn extends qt{static get TextVerticalPosition(){return{TOP:1,BOTTOM:2}}static get TextJustification(){return{LEFT:1,CENTER:2,RIGHT:3}}constructor(e){super(),this.setAttribute("type","StaveLine"),this.notes=e,this.text="",this.font={family:"Arial",size:10,weight:""},this.render_options={padding_left:4,padding_right:3,line_width:1,line_dash:null,rounded_end:!0,color:null,draw_start_arrow:!1,draw_end_arrow:!1,arrowhead_length:10,arrowhead_angle:Math.PI/8,text_position_vertical:cn.TextVerticalPosition.TOP,text_justification:cn.TextJustification.CENTER},this.setNotes(e)}setFont(e){return this.font=e,this}setText(e){return this.text=e,this}setNotes(e){if(!e.first_note&&!e.last_note)throw new B.RuntimeError("BadArguments","Notes needs to have either first_note or last_note set.");if(e.first_indices||(e.first_indices=[0]),e.last_indices||(e.last_indices=[0]),e.first_indices.length!==e.last_indices.length)throw new B.RuntimeError("BadArguments","Connected notes must have similar index sizes");return this.first_note=e.first_note,this.first_indices=e.first_indices,this.last_note=e.last_note,this.last_indices=e.last_indices,this}applyLineStyle(){const e=this.checkContext(),t=this.render_options;t.line_dash&&e.setLineDash(t.line_dash),t.line_width&&e.setLineWidth(t.line_width),t.rounded_end?e.setLineCap("round"):e.setLineCap("square")}applyFontStyle(){const e=this.checkContext();this.font&&e.setFont(this.font.family,this.font.size,this.font.weight),this.render_options.color&&(e.setStrokeStyle(this.render_options.color),e.setFillStyle(this.render_options.color))}draw(){const e=this.checkContext();this.setRendered();const t=this.first_note,s=this.last_note,n=this.render_options;e.save(),this.applyLineStyle();let r,o;this.first_indices.forEach((f,d)=>{const p=this.last_indices[d];r=t.getModifierStartXY(2,f),o=s.getModifierStartXY(1,p);const g=r.y>o.y;r.x+=t.getMetrics().modRightPx+n.padding_left,o.x-=s.getMetrics().modLeftPx+n.padding_right;const m=t.getGlyph().getWidth();t.getKeyProps()[f].displaced&&t.getStemDirection()===1&&(r.x+=m+n.padding_left),s.getKeyProps()[p].displaced&&s.getStemDirection()===-1&&(o.x-=m+n.padding_right),r.y+=g?-3:1,o.y+=g?2:0,J_(e,r,o,this.render_options)}),e.restore();const a=e.measureText(this.text).width,l=n.text_justification;let u=0;l===cn.TextJustification.LEFT?u=r.x:l===cn.TextJustification.CENTER?u=(o.x-r.x)/2+r.x-a/2:l===cn.TextJustification.RIGHT&&(u=o.x-a);let h;const c=n.text_position_vertical;return c===cn.TextVerticalPosition.TOP?h=t.getStave().getYForTopText():c===cn.TextVerticalPosition.BOTTOM&&(h=t.getStave().getYForBottomText(ie.TEXT_HEIGHT_OFFSET_HACK)),e.save(),this.applyFontStyle(),e.fillText(this.text,u,h),e.restore(),this}}function q_(...i){it.DEBUG&&B.L("Vex.Flow.PedalMarking",i)}function Af(i,e,t,s,n){const r=it.GLYPHS[i];new De(r.code,n).render(e,t+r.x_shift,s+r.y_shift)}class it extends qt{static get GLYPHS(){return{pedal_depress:{code:"v36",x_shift:-10,y_shift:0},pedal_release:{code:"v5d",x_shift:-2,y_shift:3}}}static get Styles(){return{TEXT:1,BRACKET:2,MIXED:3,MIXED_OPEN_END:4,BRACKET_OPEN_BEGIN:5,BRACKET_OPEN_END:6,BRACKET_OPEN_BOTH:7}}static get StylesString(){return{text:it.Styles.TEXT,bracket:it.Styles.BRACKET,mixed:it.Styles.MIXED,mixed_open_end:it.Styles.MIXED_OPEN_END,bracket_open_begin:it.Styles.BRACKET_OPEN_BEGIN,bracket_open_end:it.Styles.BRACKET_OPEN_END,bracket_open_both:it.Styles.BRACKET_OPEN_BOTH}}static createSustain(e){return new it(e)}static createSostenuto(e){const t=new it(e);return t.setStyle(it.Styles.MIXED),t.setCustomText("Sost. Ped."),t}static createUnaCorda(e){const t=new it(e);return t.setStyle(it.Styles.TEXT),t.setCustomText("una corda","tre corda"),t}constructor(e){super(),this.setAttribute("type","PedalMarking"),this.EndsStave=!1,this.ChangeBegin=!1,this.ChangeEnd=!1,this.notes=e,this.style=it.TEXT,this.line=0,this.custom_depress_text="",this.custom_release_text="",this.font={family:"Times New Roman",size:12,weight:"italic bold"},this.render_options={bracket_height:10,text_margin_right:6,bracket_line_width:1,glyph_point_size:40,color:"black"}}setEndStave(e){if(this.endStave=e,this.endStaveAddedWidth=0,this.startMargin=0,this.endMargin=0,Array.isArray(this.endStave.modifiers))for(let t=0;t3)throw new B.RERR("InvalidParameter","The style must be one found in PedalMarking.Styles");return this.style=e,this}setLine(e){return this.line=e,this}drawBracketed(){const e=this.context;let t=!1,s,n;const r=this;this.notes.forEach((o,a,l)=>{t=!t;let u=0;if(o?u=o.getNoteHeadBeginX():u=this.endStave.end_x+this.endStaveAddedWidth,this.EndsStave)t?this.ChangeBegin&&(u=o.getAbsoluteX()):(o?this.ChangeEnd?u=o.getAbsoluteX():u=o.getStave().end_x+this.endStaveAddedWidth-r.render_options.text_margin_right:u=this.endStave.end_x+this.endStaveAddedWidth-r.render_options.text_margin_right,this.endMargin=-r.render_options.text_margin_right);else if(o)if(t)this.ChangeBegin&&(u=o.getAbsoluteX());else switch(r.style){case it.Styles.BRACKET_OPEN_END:case it.Styles.BRACKET_OPEN_BOTH:case it.Styles.MIXED_OPEN_END:u=o.getNoteHeadEndX();break;default:this.ChangeEnd?u=o.getAbsoluteX():(u=o.getNoteHeadBeginX()-r.render_options.text_margin_right,this.startMargin=-r.render_options.text_margin_right);break}let h=this.endStave;o&&(h=o.getStave());let c=h.getYForBottomText(r.line+3);n&&n>c&&(c=n);const f=l[a+1]===o,d=l[a-1]===o;let p=0;if(t)if(p=d?5:0,(r.style===it.Styles.MIXED||r.style===it.Styles.MIXED_OPEN_END)&&!d)if(r.custom_depress_text){const g=e.measureText(r.custom_depress_text).width;e.fillText(r.custom_depress_text,u-g/2,c),p=g/2+r.render_options.text_margin_right}else Af("pedal_depress",e,u,c,r.render_options.glyph_point_size),p=20+r.render_options.text_margin_right;else e.beginPath(),r.style===it.Styles.BRACKET_OPEN_BEGIN||r.style===it.Styles.BRACKET_OPEN_BOTH?e.moveTo(u+p,c):(this.ChangeBegin&&(u+=5),e.moveTo(u,c-r.render_options.bracket_height),this.ChangeBegin&&(u+=5),e.lineTo(u+p,c)),e.stroke(),e.closePath();else p=f&&!this.EndsStave?-5:0,e.beginPath(),e.moveTo(s,n),e.lineTo(u+p,c),r.style!==it.Styles.BRACKET_OPEN_END&&r.style!==it.Styles.MIXED_OPEN_END&&r.style!==it.Styles.BRACKET_OPEN_BOTH&&(this.ChangeEnd&&(u+=5),e.lineTo(u,c-r.render_options.bracket_height)),e.stroke(),e.closePath();s=u+p,n=c})}drawText(){const e=this.context;let t=!1;const s=this,n=s.render_options.glyph_point_size;this.notes.forEach(r=>{t=!t;const o=r.getStave(),a=r.getAbsoluteX(),l=o.getYForBottomText(s.line+3);let u=0;t?s.custom_depress_text?(u=e.measureText(s.custom_depress_text).width,e.fillText(s.custom_depress_text,a-u/2,l)):Af("pedal_depress",e,a,l,n):s.custom_release_text?(u=e.measureText(s.custom_release_text).width,e.fillText(s.custom_release_text,a-u/2,l)):Af("pedal_release",e,a,l,n)})}draw(){const e=this.checkContext();this.setRendered(),e.save(),e.setStrokeStyle(this.render_options.color),e.setFillStyle(this.render_options.color),e.setFont(this.font.family,this.font.size,this.font.weight),q_("Rendering Pedal Marking"),this.style===it.Styles.BRACKET||this.style===it.Styles.MIXED||this.style===it.Styles.MIXED_OPEN_END||this.style===it.Styles.BRACKET_OPEN_BEGIN||this.style===it.Styles.BRACKET_OPEN_END||this.style===it.Styles.BRACKET_OPEN_BOTH?(e.setLineWidth(this.render_options.bracket_line_width),this.drawBracketed()):this.style===it.Styles.TEXT&&this.drawText(),e.restore()}}function Z_(...i){bs.DEBUG&&B.L("Vex.Flow.TextBracket",i)}class bs extends qt{static get Positions(){return{TOP:1,BOTTOM:-1}}static get PositionString(){return{top:bs.Positions.TOP,bottom:bs.Positions.BOTTOM}}constructor({start:e,stop:t,text:s="",superscript:n="",position:r=bs.Positions.TOP}){super(),this.setAttribute("type","TextBracket"),this.start=e,this.stop=t,this.text=s,this.superscript=n,this.position=typeof r=="string"?bs.PositionString[r]:r,this.line=1,this.font={family:"Serif",size:15,weight:"italic"},this.render_options={dashed:!0,dash:[5],color:"black",line_width:1,show_bracket:!0,bracket_height:8,underline_superscript:!0}}applyStyle(e){return e.setFont(this.font.family,this.font.size,this.font.weight),e.setStrokeStyle(this.render_options.color),e.setFillStyle(this.render_options.color),e.setLineWidth(this.render_options.line_width),this}setDashed(e,t){return this.render_options.dashed=e,t&&(this.render_options.dash=t),this}setFont(e){return this.font={...this.font,...e},this}setLine(e){return this.line=e,this}draw(){const e=this.context;this.setRendered();let t=0;switch(this.position){case bs.Positions.TOP:t=this.start.getStave().getYForTopText(this.line);break;case bs.Positions.BOTTOM:t=this.start.getStave().getYForBottomText(this.line+ie.TEXT_HEIGHT_OFFSET_HACK);break;default:throw new B.RERR("InvalidPosition",`The position ${this.position} is invalid`)}const s={x:this.start.getAbsoluteX(),y:t},n={x:this.stop.getAbsoluteX(),y:t};Z_("Rendering TextBracket: start:",s,"stop:",n,"y:",t);const r=this.render_options.bracket_height*this.position;e.save(),this.applyStyle(e),e.fillText(this.text,s.x,s.y);const o=e.measureText(this.text).width,a=e.measureText("M").width,l=s.y-a/2.5;e.setFont(this.font.family,this.font.size/1.4,this.font.weight),e.fillText(this.superscript,s.x+o+1,l);const u=e.measureText(this.superscript).width,h=e.measureText("M").width;let c=s.x,f=l;const d=n.x+this.stop.getGlyph().getWidth();this.position===bs.Positions.TOP?(c+=o+u+5,f-=h/2.7):this.position===bs.Positions.BOTTOM&&(f+=h/2.7,c+=o+2,this.render_options.underline_superscript||(c+=u)),this.render_options.dashed?(yt.drawDashedLine(e,c,f,d,f,this.render_options.dash),this.render_options.show_bracket&&yt.drawDashedLine(e,d,f+1*this.position,d,f+r,this.render_options.dash)):(e.beginPath(),e.moveTo(c,f),e.lineTo(d,f),this.render_options.show_bracket&&e.lineTo(d,f+r),e.stroke(),e.closePath()),e.restore()}}function $_(...i){dp.DEBUG&&B.L("Vex.Flow.BarNote",i)}class dp extends Ii{constructor(e=ct.type.SINGLE){super({duration:"b"}),this.setAttribute("type","BarNote"),this.metrics={widths:{}};const t=ct.type;this.metrics.widths={[t.SINGLE]:8,[t.DOUBLE]:12,[t.END]:15,[t.REPEAT_BEGIN]:14,[t.REPEAT_END]:14,[t.REPEAT_BOTH]:18,[t.NONE]:0},this.ignore_ticks=!0,this.setType(e)}getType(){return this.type}setType(e){return this.type=typeof e=="string"?ct.typeString[e]:e,this.setWidth(this.metrics.widths[this.type]),this}getBoundingBox(){return super.getBoundingBox()}addToModifierContext(){return this}preFormat(){return this.setPreFormatted(!0),this}draw(){if(this.checkContext(),!this.stave)throw new B.RERR("NoStave","Can't draw without a stave.");$_("Rendering bar line at: ",this.getAbsoluteX());const e=new ct(this.type);e.setX(this.getAbsoluteX()),e.draw(this.stave),this.setRendered()}}class v4 extends np{constructor(e){if(!e)throw new B.RuntimeError("BadArguments","Ghost note must have valid initialization data to identify duration.");let t;if(typeof e=="string")t={duration:e};else if(typeof e=="object")t=e;else throw new B.RuntimeError("BadArguments","Ghost note must have valid initialization data to identify duration.");super(t),this.setAttribute("type","GhostNote"),this.setWidth(0)}isRest(){return!0}setStave(e){super.setStave(e)}addToModifierContext(){return this}preFormat(){return this.setPreFormatted(!0),this}draw(){if(!this.stave)throw new B.RERR("NoStave","Can't draw without a stave.");this.setRendered();for(let e=0;e0||t===!0;return t&&!(r>0)&&(this.pos=n),a?this.matchSuccess():this.matchFail(n),{success:a,results:s,numMatches:r}}expectZeroOrMore(e){return this.expectOneOrMore(e,!0)}expect(e){iM("Evaluating rules:",e);let t;if(!e)throw new r2("Invalid Rule: "+e,e);const s=e.bind(this.grammar)();if(s.token)t=this.matchToken(s.token,s.noSpace===!0),t.success&&(this.pos+=t.incrementPos);else if(s.expect)s.oneOrMore?t=this.expectOneOrMore(s):s.zeroOrMore?t=this.expectZeroOrMore(s):t=this.expectOne(s);else throw new r2("Bad grammar! No `token` or `expect` property",s);return t.matches=[],t.results&&t.results.forEach(n=>t.matches.push(Yc(n))),s.run&&t.success&&s.run(t),t}}function rn(...i){gp.DEBUG&&B.L("Vex.Flow.EasyScore",i)}const sM=B.MakeException("EasyScoreError");class nM{constructor(e){this.builder=e}begin(){return this.LINE}LINE(){return{expect:[this.PIECE,this.PIECES,this.EOL]}}PIECE(){return{expect:[this.CHORDORNOTE,this.PARAMS],run:()=>this.builder.commitPiece()}}PIECES(){return{expect:[this.COMMA,this.PIECE],zeroOrMore:!0}}PARAMS(){return{expect:[this.DURATION,this.TYPE,this.DOTS,this.OPTS]}}CHORDORNOTE(){return{expect:[this.CHORD,this.SINGLENOTE],or:!0}}CHORD(){return{expect:[this.LPAREN,this.NOTES,this.RPAREN],run:e=>this.builder.addChord(e.matches[1])}}NOTES(){return{expect:[this.NOTE],oneOrMore:!0}}NOTE(){return{expect:[this.NOTENAME,this.ACCIDENTAL,this.OCTAVE]}}SINGLENOTE(){return{expect:[this.NOTENAME,this.ACCIDENTAL,this.OCTAVE],run:e=>this.builder.addSingleNote(e.matches[0],e.matches[1],e.matches[2])}}ACCIDENTAL(){return{expect:[this.ACCIDENTALS],maybe:!0}}DOTS(){return{expect:[this.DOT],zeroOrMore:!0,run:e=>this.builder.setNoteDots(e.matches[0])}}TYPE(){return{expect:[this.SLASH,this.MAYBESLASH,this.TYPES],maybe:!0,run:e=>this.builder.setNoteType(e.matches[2])}}DURATION(){return{expect:[this.SLASH,this.DURATIONS],maybe:!0,run:e=>this.builder.setNoteDuration(e.matches[1])}}OPTS(){return{expect:[this.LBRACKET,this.KEYVAL,this.KEYVALS,this.RBRACKET],maybe:!0}}KEYVALS(){return{expect:[this.COMMA,this.KEYVAL],zeroOrMore:!0}}KEYVAL(){const e=t=>t.slice(1,-1);return{expect:[this.KEY,this.EQUALS,this.VAL],run:t=>this.builder.addNoteOption(t.matches[0],e(t.matches[2]))}}VAL(){return{expect:[this.SVAL,this.DVAL],or:!0}}KEY(){return{token:"[a-zA-Z][a-zA-Z0-9]*"}}DVAL(){return{token:'["][^"]*["]'}}SVAL(){return{token:"['][^']*[']"}}NOTENAME(){return{token:"[a-gA-G]"}}OCTAVE(){return{token:"[0-9]+"}}ACCIDENTALS(){return{token:"bbs|bb|bss|bs|b|db|d|##|#|n|\\+\\+-|\\+-|\\+\\+|\\+|k|o"}}DURATIONS(){return{token:"[0-9whq]+"}}TYPES(){return{token:"[rRsSxX]"}}LPAREN(){return{token:"[(]"}}RPAREN(){return{token:"[)]"}}COMMA(){return{token:"[,]"}}DOT(){return{token:"[.]"}}SLASH(){return{token:"[/]"}}MAYBESLASH(){return{token:"[/]?"}}EQUALS(){return{token:"[=]"}}LBRACKET(){return{token:"\\["}}RBRACKET(){return{token:"\\]"}}EOL(){return{token:"$"}}}class rM{constructor(e){this.factory=e,this.commitHooks=[],this.reset()}reset(e={}){this.options={stem:"auto",clef:"treble"},this.elements={notes:[],accidentals:[]},this.rollingDuration="8",this.resetPiece(),Object.assign(this.options,e)}getFactory(){return this.factory}getElements(){return this.elements}addCommitHook(e){this.commitHooks.push(e)}resetPiece(){rn("resetPiece"),this.piece={chord:[],duration:this.rollingDuration,dots:0,type:void 0,options:{}}}setNoteDots(e){rn("setNoteDots:",e),e&&(this.piece.dots=e.length)}setNoteDuration(e){rn("setNoteDuration:",e),this.rollingDuration=this.piece.duration=e||this.rollingDuration}setNoteType(e){rn("setNoteType:",e),e&&(this.piece.type=e)}addNoteOption(e,t){rn("addNoteOption: key:",e,"value:",t),this.piece.options[e]=t}addNote(e,t,s){rn("addNote:",e,t,s),this.piece.chord.push({key:e,accid:t,octave:s})}addSingleNote(e,t,s){rn("addSingleNote:",e,t,s),this.addNote(e,t,s)}addChord(e){rn("startChord"),typeof e[0]!="object"?this.addSingleNote(e[0]):e.forEach(t=>{t&&this.addNote(...t)}),rn("endChord")}commitPiece(){rn("commitPiece");const{factory:e}=this;if(!e)return;const t={...this.options,...this.piece.options},{stem:s,clef:n}=t,r=s.toLowerCase()==="auto",o=!r&&s.toLowerCase()==="up"?Bt.STEM_UP:Bt.STEM_DOWN,{chord:a,duration:l,dots:u,type:h}=this.piece,c=a.map(p=>p.key+"/"+p.octave),f=e.StaveNote({keys:c,duration:l,dots:u,type:h,clef:n,auto_stem:r});r||f.setStemDirection(o);const d=a.map(p=>p.accid||null);d.forEach((p,g)=>{p&&f.addAccidental(g,e.Accidental({type:p}))});for(let p=0;pp(t,f,this)),this.elements.notes.push(f),this.elements.accidentals.concat(d),this.resetPiece()}}function oM({id:i},e){i!==void 0&&e.setAttribute("id",i)}function aM(i,e){if(!i.class)return;const t=/\s*,\s*/;i.class.split(t).forEach(s=>e.addClass(s))}class gp{constructor(e={}){this.setOptions(e),this.defaults={clef:"treble",time:"4/4",stem:"auto"}}set(e){return Object.assign(this.defaults,e),this}setOptions(e){return this.options={factory:null,builder:null,commitHooks:[oM,aM,zl.easyScoreHook],throwOnError:!1,...e},this.factory=this.options.factory,this.builder=this.options.builder||new rM(this.factory),this.grammar=new nM(this.builder),this.parser=new pp(this.grammar),this.options.commitHooks.forEach(t=>this.addCommitHook(t)),this}setContext(e){return this.factory&&this.factory.setContext(e),this}parse(e,t={}){this.builder.reset(t);const s=this.parser.parse(e);if(!s.success&&this.options.throwOnError)throw new sM("Error parsing line: "+e,s);return s}beam(e,t={}){return this.factory.Beam({notes:e,options:t}),e}tuplet(e,t={}){return this.factory.Tuplet({notes:e,options:t}),e}notes(e,t={}){return t={clef:this.defaults.clef,stem:this.defaults.stem,...t},this.parse(e,t),this.builder.getElements().notes}voice(e,t){return t={time:this.defaults.time,...t},this.factory.Voice(t).addTickables(e)}addCommitHook(e){return this.builder.addCommitHook(e)}}function Fo(){return{notes:[],finish:!1,total:0,staveId:""}}let xu=null,Go="C",Fi=Fo(),Ic="",Io="",Vi="";class Vs extends Bt{static get CATEGORY(){return"numberednotes"}static accidentalAndKey(e){switch(e){case"G":return{4:"#"};case"D":return{1:"#",4:"#"};case"A":return{1:"#",4:"#",5:"#"};case"E":return{1:"#",2:"#",4:"#",5:"#"};case"B":return{1:"#",2:"#",4:"#",5:"#",6:"#"};case"F#":return{1:"#",2:"#",3:"#",4:"#",5:"#",6:"#"};case"C#":return{1:"#",2:"#",3:"#",4:"#",5:"#",6:"#",7:"#"};case"F":return{7:"b"};case"Bb":return{7:"b",3:"b"};case"Eb":return{7:"b",3:"b",6:"b"};case"Ab":return{7:"b",2:"b",3:"b",6:"b"};case"Db":return{7:"b",2:"b",3:"b",5:"b",6:"b"};case"Gb":return{7:"b",1:"b",2:"b",3:"b",5:"b",6:"b"};case"Cb":return{7:"b",1:"b",2:"b",3:"b",4:"b",5:"b",6:"b"};default:return{}}}static accidentalMap(e){switch(e){case"C":return"";case"F":case"Bb":case"Eb":case"Ab":case"Db":case"Gb":case"Cb":return{bb:"b",b:"",n:"#","#":"##"};default:return{b:"bb",n:"b","#":"","##":"#"}}}static get noteLift(){switch(Go){case"G":return["7"];case"D":return["7","3"];case"A":return["7","3","6"];case"E":return["2","6","3","7"];case"B":return["5","2","6","3","7"];case"F#":return["1","5","2","6","3","7"];case"C#":return["4","1","5","2","6","3","7"];case"F":return["4"];case"Bb":return["1","4"];case"Eb":return["5","1","4"];case"Ab":return["2","5","1","4"];case"Db":return["6","2","5","1","4"];case"Gb":return["3","6","2","5","1","4"];case"Cb":return["7","3","6","2","5","1","4"]}}static get longDurationLine(){return{1:3,2:1,6:2}}static get numberedDurationLine(){return{8:1,16:2,32:3,64:4,128:5}}static get durationTime(){return{8:6144,4:4096}}constructor(e){super(e),this.setAttribute("type","NumberedNote"),Go=e.keyString,this.ornament=!!e.ornament,this.line=0,this.keys=e.keys||[],this.fontSize=20,this.offset_x=0,this.offset_y=0,this.note_tones=[],this.duration_lines=0,this.long_duration_lines=0,this.note_size=e.note_size||16;const t=ie.sanitizeDuration(this.duration);var s=Vs.numberedDurationLine[t.toString()];if(s&&(this.duration_lines=s),s=Vs.longDurationLine[t.toString()],s&&(this.long_duration_lines=s),!xu){var n="__$text_wraper$$__";let o=document.createElement("canvas");o.id=n,document.body.append(o);const a=document.getElementById(n),l=a.getContext("2d");l.font="Arial 22px";var r=l.measureText("5");xu=r.width+2,document.body.removeChild(a)}}getCategory(){return Vs.CATEGORY}setKeySignature(e){this.keySignature=e}preFormat(){this.preFormatted||(this.modifierContext&&this.modifierContext.preFormat(),this.setWidth(this.full_width),this.setPreFormatted(!0))}filterNote(){if(window&&window.sett&&window.sett.keySignature||!this.keys||!this.keys.length)return;const e=Vs.accidentalMap(Go);if(!e)return;const t=Vs.noteLift;if(!t)return;var s=this.keys[0].split("/"),n=s[0];n==="b"&&(n="R"),n=n.replace(new RegExp("#","g"),""),n=n.replace(new RegExp("n","g"),""),n.length>1&&(n=n.replace(new RegExp("b","g"),""));const r=mr.numberedNotationMapping[n.toUpperCase()];if(t.includes(r))for(let o=0;o{switch(s.getAttribute("type")){case"Accidental":s.render_options.font_scale=this.note_width*1.4,s.x_shift=2,s.y_shift=this.unit_height/2,this.ornament&&(s.render_options.font_scale=this.note_width,s.x_shift=14,s.y_shift=-10);break;case"Stroke":s.x_shift=-1*e,s.y_shift=1*this.unit_height;break;case"Dot":s.x_shift=t*this.duration_dot_width+7,s.y_shift=1*this.unit_height,t++;break;case"Ornament":s.y_shift=-3;break;default:s.y_shift=1*this.unit_height}s.reset&&s.reset(),e+=s.getWidth()/2})}handleDeleteDot(){for(let e=0;eo),s=t.length?t[0]/t[1]:0;if(this.ornament)return;if(s===0)return this.long_duration_lines=this.intrinsicTicks/e-1,this.long_duration_lines>=Io&&(this.long_duration_lines=Io-1),Ic==8&&(this.long_duration_lines=0,Io==3&&this.draw_dot(this.context,this.bottom_x+25,this.bottom_y-30,this.dot_width),Io==6&&(this.draw_dot(this.context,this.bottom_x+25,this.bottom_y-30,this.dot_width),new De("v0",40).render(this.context,this.bottom_x+40,this.top_y),this.draw_dot(this.context,this.bottom_x+65,this.bottom_y-30,this.dot_width))),Fi=Fo();let n={lines:this.duration_lines,duration:s,id:this.attrs.id,x:this.x-this.duration_line_space/2-this.left_width,y:this.y,width:this.full_width};s>e*2&&(this.long_duration_lines=parseInt(s/e)-1,this.handleDeleteDot()),Vi&&(n.x+=this.note_width),Fi.notes.push(n);let r=Fi.notes.reduce((o,a)=>o+a.duration,0);r=parseInt(r),r>e&&(r-=e),r>e-10&&ra.lines===0).length&&(this.drawDurationLoneLine(),Fi=Fo()))}draw(){if(this.checkContext(),!this.stave)throw new B.RERR("NoStave","Can't draw without a stave.");let e=this.context;e.save(),e.setFont("Arial",this.note_height,"normal"),this.setAttribute("el",e.openGroup("stavenote",this.getAttribute("id"))),e.openGroup("note",null,{pointerBBox:!0});let t=this.getAbsoluteX()+2.5;this.x=t;let s=this.stave.getYForLine(2)+this.note_height/2;this.y=s,this.buildToneHeads(),this.preFormatModifier(),this.applyStyle(),this.note_tones.forEach(n=>{n.draw(e)}),e.openGroup("modifier",null,{pointerBBox:!0}),this.drawModifiers(),e.closeGroup(),e.closeGroup(),e.closeGroup(),this.calcGroup(),Fi.staveId=this.stave.attrs.id,this.drawDurationLine(e,{}),this.drawLongDurationLines(e),this.restoreStyle(),this.setRendered(),this.ornament?Vi?Vi=Object.assign(Vi,{lines:this.duration_lines,id:this.attrs.id,x:this.x-this.duration_line_space/2-this.left_width,width:this.full_width}):Vi={lines:this.duration_lines,id:this.attrs.id,x:this.x-this.duration_line_space/2-this.left_width,width:this.full_width}:Vi=""}drawDurationLoneLine(e,t){e=e||this.context;let s=t||this.y+this.duration_line_space;for(let n=0;n<5;n++){let r=[],o=0;for(let a=0;an)r.push(l),o++;else{if(r.length>1){let u=r.length-1;s=r[0].y+this.duration_line_space,e.rect(r[0].x,s+n*3,r[u].x-r[0].x+r[u].width,.5)}r=[],o=a+1}}if(r.length>1){let a=r.length-1;s=r[0].y+this.duration_line_space,e.rect(r[0].x,s+n*3,r[a].x-r[0].x+r[a].width,.5)}}}draw_dot(e,t,s,n){e.openGroup("numbered-note-dot"),e.beginPath(),e.arc(t,s,n,0,2*Math.PI),e.closePath(),e.fill(),e.closeGroup()}drawDurationLine(e,t){var s=this.attrs.id+"-lines";e.openGroup("numbered_note_lines",s);var n,r;if(this.duration_lines>0){const l=this.duration_line_space;var o=this.full_width;if(t&&t.width&&(o=t.width),o<0&&(o=this.note_width),!t||typeof t.startX>"u"?n=this.x-l/2-this.left_width:n=t.startX,!t||typeof t.startY>"u"?r=this.y+this.duration_line_space:r=t.startY,Fi.finish&&(this.drawDurationLoneLine(e,r),Fi=Fo()),this.ornament?(n+=12,r-=22,o=15,Vi&&(n-=10,o+=10)):Vi&&(n+=this.note_width,o-=this.note_width),o>0){for(var a=0;aa.getAttribute("type")==="Accidental"),o=this.modifiers.findIndex(a=>a.getAttribute("type")==="Accidental");n&&o>-1?this.modifiers[o].accidental.code=n==="#"?"v18":"v44":this.modifiers.splice(o,1)}}catch(n){console.log("🚀 ~ error",n)}}this.setYs(e)}getFullWidth(){return this.full_width}getFullHeight(){return this.full_height}getLine(){return this.keyProps[0].line}get full_width(){return this.note_width+this.left_width+this.right_width+this.long_duration_line_width}get long_duration_line_width(){return(this.long_duration_width+this.long_duration_space)*this.long_duration_lines}get full_height(){return this.bottom_y-this.top_y}get note_width(){return this.note_size||0}get note_dot_width(){return 6}get note_height(){return this.unit_height}get unit_height(){return this.note_size||0}get note_x(){return this.x||0}get top_x(){return this.x||0}get top_y(){var e=this;return(this.y||0)-(e.note_tones.map(s=>(s.td+s.bd)*(e.dot_space+e.dot_width)).reduce((s,n)=>s+n,0)+this.note_height*this.note_tones.length-this.unit_height-this.note_tones[0].bd*(e.dot_space+e.dot_width)+(this.note_tones.length-1)*this.head_space)}get bottom_x(){return this.x||0}get bottom_y(){return(this.y||0)+this.unit_height+this.duration_lines*(this.duration_line_height+this.duration_line_space)+this.note_tones[0].meta.bd*(this.dot_width+this.dot_space)}get left_width(){return this.modifiers_width}get right_width(){return this.full_duration_dot_width}get duration_dot_width(){return 6}get full_duration_dot_width(){return this.duration_dot_width*this.getModifiersByCategory(Lr.CATEGORY).length}getModifiersByCategory(e){var t=[];return this.modifiers.forEach(s=>{s.getCategory()===e&&t.push(s)}),t}get head_space(){return 6}get duration_line_height(){return 2}get duration_line_space(){return 4}get dot_width(){return 2}get dot_space(){return 2}get long_duration_space(){return 10}get long_duration_width(){return 20}getWidth(){return this.full_width}get modifiers_width(){let e=0;return this.modifiers.forEach(t=>{e+=t.getWidth()}),e}}class mr{static get numberedNotationMapping(){let e=Go;switch(window&&window.sett&&window.sett.keySignature&&(e="C"),e){case"A":return{C:"3",D:"4",E:"5",F:"6",G:"7",A:"1",B:"2",R:"0",min:2.5,max:5.5};case"B":return{C:"2",D:"3",E:"4",F:"5",G:"6",A:"7",B:"1",R:"0",min:-.5,max:2.5};case"D":return{C:"7",D:"1",E:"2",F:"3",G:"4",A:"5",B:"6",R:"0",min:.5,max:3.5};case"E":return{C:"6",D:"7",E:"1",F:"2",G:"3",A:"4",B:"5",R:"0",min:1,max:4};case"F":return{C:"5",D:"6",E:"7",F:"1",G:"2",A:"3",B:"4",R:"0",min:1.5,max:4.5};case"G":case"Gb":return{C:"4",D:"5",E:"6",F:"7",G:"1",A:"2",B:"3",R:"0",min:2,max:5};case"Eb":return{C:"6",D:"7",E:"1",F:"2",G:"3",A:"4",B:"5",R:"0",min:1,max:4};case"D#":case"Db":return{C:"7",D:"1",E:"2",F:"3",G:"4",A:"5",B:"6",R:"0",min:.5,max:3.5};case"F#":return{C:"5",D:"6",E:"7",F:"1",G:"2",A:"3",B:"4",R:"0",min:1.5,max:4.5};case"Ab":case"G#":return{C:"3",D:"4",E:"5",F:"6",G:"7",A:"1",B:"2",R:"0",min:-1,max:2};case"Bb":case"A#":return{C:"2",D:"3",E:"4",F:"5",G:"6",A:"7",B:"1",R:"0",min:-.5,max:2.5};case"C#":case"Cb":default:return{C:"1",D:"2",E:"3",F:"4",G:"5",A:"6",B:"7",R:"0",min:0,max:3}}}tone_to_numbered_key(){var e=this.key.split("/"),t=e[0];t==="b"&&(t="R"),t=t.replace(new RegExp("#","g"),""),t=t.replace(new RegExp("n","g"),""),t.length>1&&(t=t.replace(new RegExp("b","g"),""));let s=0,n=0;this.note.stave&&this.note.stave.options&&this.note.stave.options.keySignature&&(Go=this.note.stave.options.keySignature);const r=this.note.getLine();return rmr.numberedNotationMapping.max&&(n=Math.ceil((r-mr.numberedNotationMapping.max)/3.5)),t.toUpperCase()==="R"&&(s=0,n=0),{key:mr.numberedNotationMapping[t.toUpperCase()],td:n,bd:s}}constructor(e){this.key=e.key,this.x=e.x||0,this.y=e.y||0,this.idx=e.idx||0,this.note=e.note||0,this.meta=this.tone_to_numbered_key(),this.noteSize=e.noteSize||16,this.td=this.meta.td,this.bd=this.meta.bd}draw(e){let t=this.y;e.openGroup("numbered-note-head");var s=this.x+(this.note.ornament?-2:0);let n=t-this.note.unit_height-this.note.dot_space-(this.note.ornament?-4:2);for(let o=0;o1&&(a-=this.note.duration_line_space),t+=a}this.draw_dot(e,s+xu,t,this.note.dot_width),t+=this.note.dot_width+this.note.dot_space}e.closeGroup()}get height(){return this.note.note_height+(this.meta.bd+this.meta.td)*(this.note.dot_width+this.note.dot_space)}draw_dot(e,t,s,n){e.openGroup("numbered-note-dot"),e.beginPath(),e.arc(t,s,n,0,2*Math.PI),e.closePath(),e.fill(),e.closeGroup()}}function lM(...i){Ql.DEBUG&&B.L("Vex.Flow.Factory",i)}const cM=B.MakeException("FactoryError");function Yt(i={},e){const t=e.options;return i=Object.assign(e,i),i.options=Object.assign(t,i.options),i}class Ql{constructor(e){lM("New factory: ",e);const t={stave:{space:10},renderer:{context:null,elementId:"",backend:yt.Backends.SVG,width:500,height:200,background:"#FFF"},font:{face:"Arial",point:10,style:""}};this.options=t,this.setOptions(e)}static newFromElementId(e,t=500,s=200){return new Ql({renderer:{elementId:e,width:t,height:s}})}reset(){this.renderQ=[],this.systems=[],this.staves=[],this.voices=[],this.stave=null}getOptions(){return this.options}setOptions(e){for(const t of["stave","renderer","font"])Object.assign(this.options[t],e[t]);(this.options.renderer.elementId!==null||this.options.renderer.context)&&this.initRenderer(),this.reset()}initRenderer(){const{elementId:e,backend:t,width:s,height:n,background:r}=this.options.renderer;if(e==="")throw new cM("HTML DOM element not set in Factory");this.context=yt.buildContext(e,t,s,n,r)}getContext(){return this.context}setContext(e){return this.context=e,this}getStave(){return this.stave}getVoices(){return this.voices}space(e){return this.options.stave.space*e}Stave(e){e=Yt(e,{x:0,y:0,width:this.options.renderer.width-this.space(1),options:{spacing_between_lines_px:this.options.stave.space}});const t=new Yl(e.x,e.y,e.width,e.options);return this.staves.push(t),t.setContext(this.context),this.stave=t,t}TabStave(e){e=Yt(e,{x:0,y:0,width:this.options.renderer.width-this.space(1),options:{spacing_between_lines_px:this.options.stave.space*1.3}});const t=new p4(e.x,e.y,e.width,e.options);return this.staves.push(t),t.setContext(this.context),this.stave=t,t}StaveNote(e){const t=new Bt(e);return this.stave&&t.setStave(this.stave),t.setContext(this.context),this.renderQ.push(t),t}GhostNote(e){const t=new v4(e);return this.stave&&t.setStave(this.stave),t.setContext(this.context),this.renderQ.push(t),t}TextNote(e){const t=new Hs(e);return this.stave&&t.setStave(this.stave),t.setContext(this.context),this.renderQ.push(t),t}NumberedNote(e){const t=new Vs(e);return this.stave&&t.setStave(this.stave),t.setContext(this.context),this.renderQ.push(t),t}BarNote(e){e=Yt(e,{type:"single",options:{}});const t=new dp(e.type);return this.stave&&t.setStave(this.stave),t.setContext(this.context),this.renderQ.push(t),t}ClefNote(e){e=Yt(e,{type:"treble",options:{size:"default"}});const t=new Th(e.type,e.options.size,e.options.annotation);return this.stave&&t.setStave(this.stave),t.setContext(this.context),this.renderQ.push(t),t}TimeSigNote(e){e=Yt(e,{time:"4/4",options:{}});const t=new y4(e.time);return this.stave&&t.setStave(this.stave),t.setContext(this.context),this.renderQ.push(t),t}KeySigNote(e){const t=new b4(e.key,e.cancelKey,e.alterKey);return this.stave&&t.setStave(this.stave),t.setContext(this.context),this.renderQ.push(t),t}TabNote(e){const t=new up(e);return this.stave&&t.setStave(this.stave),t.setContext(this.context),this.renderQ.push(t),t}GraceNote(e){const t=new ho(e);return this.stave&&t.setStave(this.stave),t.setContext(this.context),t}GraceNoteGroup(e){const t=new wa(e.notes,e.slur);return t.setContext(this.context),t}Accidental(e){e=Yt(e,{type:null,options:{}});const t=new go(e.type);return t.setContext(this.context),t}Annotation(e){e=Yt(e,{text:"p",vJustify:"below",hJustify:"center",fontFamily:"Times",fontSize:14,fontWeight:"bold italic",options:{}});const t=new Tt(e.text);return t.setJustification(e.hJustify),t.setVerticalJustification(e.vJustify),t.setFont(e.fontFamily,e.fontSize,e.fontWeight),t.setContext(this.context),t}Articulation(e){e=Yt(e,{type:"a.",position:"above",options:{}});const t=new zl(e.type);return t.setPosition(e.position),t.setContext(this.context),t}TextDynamics(e){e=Yt(e,{text:"p",duration:"q",dots:0,line:0,options:{}});const t=new fa({text:e.text,line:e.line,duration:e.duration,dots:e.dots});return this.stave&&t.setStave(this.stave),t.setContext(this.context),this.renderQ.push(t),t}Fingering(e){e=Yt(e,{number:"0",position:"left",options:{}});const t=new Hl(e.number);return t.setPosition(e.position),t.setContext(this.context),t}StringNumber(e){e=Yt(e,{number:"0",position:"left",options:{}});const t=new Ul(e.number);return t.setPosition(e.position),t.setContext(this.context),t}TickContext(){return new ua().setContext(this.context)}ModifierContext(){return new Cl}MultiMeasureRest(e){const t=new m4(e.number_of_measures,e);return t.setContext(this.context),this.renderQ.push(t),t}Voice(e){e=Yt(e,{time:"4/4",options:{}});const t=new Gs(e.time);return this.voices.push(t),t}StaveConnector(e){e=Yt(e,{top_stave:null,bottom_stave:null,type:"double",options:{}});const t=new $e(e.top_stave,e.bottom_stave);return t.setType(e.type).setContext(this.context),this.renderQ.push(t),t}Formatter(){return new Ms}Tuplet(e){e=Yt(e,{notes:[],options:{}});const t=new Su(e.notes,e.options).setContext(this.context);return this.renderQ.push(t),t}Beam(e){e=Yt(e,{notes:[],options:{autoStem:!1,secondaryBeamBreaks:[]}});const t=new Ml(e.notes,e.options.autoStem).setContext(this.context);return t.breakSecondaryAt(e.options.secondaryBeamBreaks),this.renderQ.push(t),t}Curve(e){e=Yt(e,{from:null,to:null,options:{}});const t=new Fs(e.from,e.to,e.options).setContext(this.context);return this.renderQ.push(t),t}StaveTie(e){e=Yt(e,{from:null,to:null,first_indices:[0],last_indices:[0],text:null,options:{direction:void 0}});const t=new Mh({first_note:e.from,last_note:e.to,first_indices:e.first_indices,last_indices:e.last_indices},e.text);return e.options.direction&&t.setDirection(e.options.direction),t.setContext(this.context),this.renderQ.push(t),t}StaveLine(e){e=Yt(e,{from:null,to:null,first_indices:[0],last_indices:[0],options:{}});const t=new cn({first_note:e.from,last_note:e.to,first_indices:e.first_indices,last_indices:e.last_indices});return e.options.text&&t.setText(e.options.text),e.options.font&&t.setFont(e.options.font),t.setContext(this.context),this.renderQ.push(t),t}VibratoBracket(e){e=Yt(e,{from:null,to:null,options:{harsh:!1}});const t=new hp({start:e.from,stop:e.to});return e.options.line&&t.setLine(e.options.line),e.options.harsh&&t.setHarsh(e.options.harsh),t.setContext(this.context),this.renderQ.push(t),t}TextBracket(e){e=Yt(e,{from:null,to:null,text:"",options:{superscript:"",position:1}});const t=new bs({start:e.from,stop:e.to,text:e.text,superscript:e.options.superscript,position:e.options.position});return e.options.line&&t.setLine(e.options.line),e.options.font&&t.setFont(e.options.font),t.setContext(this.context),this.renderQ.push(t),t}System(e={}){e.factory=this;const t=new A4(e).setContext(this.context);return this.systems.push(t),t}EasyScore(e={}){return e.factory=this,new gp(e)}PedalMarking(e={}){e=Yt(e,{notes:[],options:{style:"mixed"}});const t=new it(e.notes);return t.setStyle(it.StylesString[e.options.style]),t.setContext(this.context),this.renderQ.push(t),t}NoteSubGroup(e={}){e=Yt(e,{notes:[],options:{}});const t=new rp(e.notes);return t.setContext(this.context),t}draw(){this.systems.forEach(e=>e.setContext(this.context).format()),this.staves.forEach(e=>e.setContext(this.context).draw()),this.voices.forEach(e=>e.setContext(this.context).draw()),this.renderQ.forEach(e=>{e.isRendered()||e.setContext(this.context).draw()}),this.systems.forEach(e=>e.setContext(this.context).draw()),this.reset()}}function o2(i,e){const t=e.options;return i=Object.assign(e,i),i.options=Object.assign(t,i.options),i}class A4 extends qt{constructor(e={}){super(),this.setAttribute("type","System"),this.setOptions(e),this.parts=[]}setOptions(e={}){this.options=o2(e,{x:10,y:10,width:500,connector:null,spaceBetweenStaves:12,factory:null,debugFormatter:!1,formatIterations:0,options:{}}),this.factory=this.options.factory||new Ql({renderer:{el:null}})}setContext(e){return super.setContext(e),this.factory.setContext(e),this}addConnector(e="double"){return this.connector=this.factory.StaveConnector({top_stave:this.parts[0].stave,bottom_stave:this.parts[this.parts.length-1].stave,type:e}),this.connector}addStave(e){return e=o2(e,{stave:null,voices:[],spaceAbove:0,spaceBelow:0,debugNoteMetrics:!1,options:{left_bar:!1}}),e.stave||(e.stave=this.factory.Stave({x:this.options.x,y:this.options.y,width:this.options.width,options:e.options})),e.voices.forEach(t=>t.setContext(this.context).setStave(e.stave).getTickables().forEach(s=>s.setStave(e.stave))),this.parts.push(e),e.stave}format(){const e=new Ms;this.formatter=e;let t=this.options.y,s=0,n=[];const r=[];this.parts.forEach(a=>{t=t+a.stave.space(a.spaceAbove),a.stave.setY(t),e.joinVoices(a.voices),t=t+a.stave.space(a.spaceBelow),t=t+a.stave.space(this.options.spaceBetweenStaves),a.debugNoteMetrics&&(r.push({y:t,voice:a.voices[0]}),t+=15),n=n.concat(a.voices),s=Math.max(s,a.stave.getNoteStartX())}),this.parts.forEach(a=>a.stave.setNoteStartX(s));const o=this.options.width-(s-this.options.x)-Ii.STAVEPADDING;e.format(n,o);for(let a=0;a{t.voice.getTickables().forEach(s=>Ii.plotMetrics(e,s,t.y))})}}B.Flow=ie;B.Flow.Element=qt;B.Flow.Fraction=Xe;B.Flow.Renderer=yt;B.Flow.Formatter=Ms;B.Flow.Music=Ct;B.Flow.Glyph=De;B.Flow.Stave=Yl;B.Flow.StaveNote=Bt;B.Flow.StaveModifier=st;B.Flow.StaveTempo=Ch;B.Flow.Voice=Gs;B.Flow.Accidental=go;B.Flow.Beam=Ml;B.Flow.StaveTie=Mh;B.Flow.TabStave=p4;B.Flow.TabNote=up;B.Flow.Bend=zi;B.Flow.Vibrato=ha;B.Flow.VibratoBracket=hp;B.Flow.Note=Ii;B.Flow.ModifierContext=Cl;B.Flow.MultiMeasureRest=m4;B.Flow.TickContext=ua;B.Flow.Articulation=zl;B.Flow.Annotation=Tt;B.Flow.Barline=ct;B.Flow.NoteHead=xa;B.Flow.StaveConnector=$e;B.Flow.ClefNote=Th;B.Flow.KeySignature=mo;B.Flow.KeySigNote=b4;B.Flow.TimeSignature=Br;B.Flow.TimeSigNote=y4;B.Flow.Stem=Be;B.Flow.TabTie=ca;B.Flow.Clef=zs;B.Flow.Dot=Lr;B.Flow.Modifier=Ne;B.Flow.TabSlide=ln;B.Flow.Tuplet=Su;B.Flow.GraceNote=ho;B.Flow.GraceTabNote=fp;B.Flow.Tuning=Au;B.Flow.KeyManager=K_;B.Flow.StaveHairpin=cl;B.Flow.BoundingBox=po;B.Flow.Stroke=Si;B.Flow.TextNote=Hs;B.Flow.Curve=Fs;B.Flow.TextDynamics=fa;B.Flow.StaveLine=cn;B.Flow.Ornament=Wl;B.Flow.PedalMarking=it;B.Flow.TextBracket=bs;B.Flow.FretHandFinger=Hl;B.Flow.Repetition=Td;B.Flow.BarNote=dp;B.Flow.GhostNote=v4;B.Flow.NoteSubGroup=rp;B.Flow.GraceNoteGroup=wa;B.Flow.Tremolo=to;B.Flow.StringNumber=Ul;B.Flow.Crescendo=S4;B.Flow.Volta=As;B.Flow.Font=zc;B.Flow.System=A4;B.Flow.Factory=Ql;B.Flow.Parser=pp;B.Flow.EasyScore=gp;B.Flow.Registry=gn;var Ge=(i=>(i[i.SingleThin=0]="SingleThin",i[i.DoubleThin=1]="DoubleThin",i[i.ThinBold=2]="ThinBold",i[i.BoldThinDots=3]="BoldThinDots",i[i.DotsThinBold=4]="DotsThinBold",i[i.DotsBoldBoldDots=5]="DotsBoldBoldDots",i[i.None=6]="None",i[i.Dotted=7]="Dotted",i[i.Dashed=8]="Dashed",i[i.Bold=9]="Bold",i[i.BoldThin=10]="BoldThin",i[i.DoubleBold=11]="DoubleBold",i[i.Tick=12]="Tick",i[i.Short=13]="Short",i))(Ge||{});class uM{static xmlBarlineStyleToSystemLinesEnum(e){return e==="regular"?0:e==="dotted"?7:e==="dashed"?8:e==="heavy"?9:e==="light-light"?1:e==="light-heavy"?2:e==="heavy-light"?10:e==="heavy-heavy"?11:e==="tick"?12:e==="short"?13:e==="none"?6:0}}class Tl{constructor(){this.matrix=[];for(let e=0;e<2;e++){this.matrix[e]=[];for(let t=0;t<2;t++)this.matrix[e][t]=0}}static getRotationMatrix(e){const t=new Tl,s=Math.cos(e),n=Math.sin(e);return t.matrix[0][0]=s,t.matrix[0][1]=-n,t.matrix[1][0]=n,t.matrix[1][1]=s,t}scalarMultiplication(e){for(let t=0;t<2;t++)for(let s=0;s<2;s++)this.matrix[t][s]*=e}getTransposeMatrix(){const e=new Tl;for(let t=0;t<2;t++)for(let s=0;s<2;s++)e.matrix[t][s]=this.matrix[s][t];return e}vectorMultiplication(e){const t=new te;return t.x=e.x*this.matrix[0][0]+e.y*this.matrix[0][1],t.y=e.x*this.matrix[1][0]+e.y*this.matrix[1][1],t}}class hM{constructor(){this.measureErrors={},this.errors=[],this.tempErrors=[]}finalizeMeasure(e){let t=this.measureErrors[e];t||(t=[]),this.measureErrors[e]=t.concat(this.tempErrors),this.tempErrors=[]}pushMeasureError(e){this.tempErrors.push(e)}push(e){this.errors.push(e)}}class fM{constructor(e,t=7){this.parentVoiceEntry=e,this.type=t,this.notes=[]}addNote(e){this.notes.push(e),e.Arpeggio=this}}var vs=(i=>(i[i.BRUSH_DOWN=1]="BRUSH_DOWN",i[i.BRUSH_UP=2]="BRUSH_UP",i[i.ROLL_DOWN=3]="ROLL_DOWN",i[i.ROLL_UP=4]="ROLL_UP",i[i.RASQUEDO_DOWN=5]="RASQUEDO_DOWN",i[i.RASQUEDO_UP=6]="RASQUEDO_UP",i[i.ARPEGGIO_DIRECTIONLESS=7]="ARPEGGIO_DIRECTIONLESS",i))(vs||{});class dM{constructor(e=1,t=0){this.notes=[],this.extendedNoteList=[],this.BeamNumberOffsetToXML=0,this.BeamNumber=e,this.BeamNumberOffsetToXML=t}get Notes(){return this.notes}set Notes(e){this.notes=e}get ExtendedNoteList(){return this.extendedNoteList}set ExtendedNoteList(e){this.extendedNoteList=e}addNoteToBeam(e){e&&(e.NoteBeam=this,this.notes.push(e),this.extendedNoteList.push(e))}}class mp{constructor(e,t){this.voiceEntries=[],this.volume=1,this.parent=e,this.visible=!0,this.audible=!0,this.following=!0,this.voiceId=t,this.uniqueVoiceId="I:"+this.parent.Id+" V: "+this.voiceId}get VoiceEntries(){return this.voiceEntries}get Parent(){return this.parent}get Visible(){return this.visible}set Visible(e){this.visible=e}get Audible(){return this.audible}set Audible(e){this.audible=e}get Following(){return this.following}set Following(e){this.following=e}get Solo(){return this.solo}set Solo(e){this.solo=e}get VoiceId(){return this.voiceId}get Volume(){return this.volume}set Volume(e){this.volume=e}toString(){return this.uniqueVoiceId}}class Jo extends mp{constructor(e,t,s){super(e,t),this.master=s}get Master(){return this.master}}class bp{constructor(e,t,s=void 0){this.sourceNote=e,this.setShapeFromXml(t,s)}setShapeFromXml(e,t=void 0){this.shape=bp.ShapeTypeXmlToShape(e);let s=t;s===void 0&&(this.sourceNote?s=this.sourceNote.Length.Denominator>2:(ge.warn("notehead: sourceNote and filledXmlAttribute undefined."),s=!0)),this.filled=s}get SourceNote(){return this.sourceNote}get Shape(){return this.shape}get Filled(){return this.filled}static ShapeTypeXmlToShape(e){switch(e.toLowerCase()){case"normal":return 2;case"x":return 7;case"slash":return 4;case"diamond":return 1;case"square":return 5;case"la":return 5;case"do":case"triangle":return 6;case"rectangle":return 3;case"circle-x":return 0;default:return ge.info("unsupported/unhandled xml notehead '"+e+"'. Using normal notehead."),2}}}var ti=(i=>(i[i.CIRCLEX=0]="CIRCLEX",i[i.DIAMOND=1]="DIAMOND",i[i.NORMAL=2]="NORMAL",i[i.RECTANGLE=3]="RECTANGLE",i[i.SLASH=4]="SLASH",i[i.SQUARE=5]="SQUARE",i[i.TRIANGLE=6]="TRIANGLE",i[i.X=7]="X",i))(ti||{});class ze{static translateText(e,t){if(!this.defaultTextTranslation)return t}}var yp=(i=>(i[i.UNDEFINED=0]="UNDEFINED",i[i._1024th=1]="_1024th",i[i._512th=2]="_512th",i[i._256th=3]="_256th",i[i._128th=4]="_128th",i[i._64th=5]="_64th",i[i._32nd=6]="_32nd",i[i._16th=7]="_16th",i[i.EIGTH=8]="EIGTH",i[i.QUARTER=9]="QUARTER",i[i.HALF=10]="HALF",i[i.WHOLE=11]="WHOLE",i[i.BREVE=12]="BREVE",i[i.LONG=13]="LONG",i[i.MAXIMA=14]="MAXIMA",i))(yp||{});class da{static NoteTypeToString(e){return this.NoteTypeXmlValues[e]}static StringToNoteType(e){const t=this.NoteTypeXmlValues.indexOf(e);return t!==-1?t:0}static getNoteDurationFromType(e){switch(e){case"1024th":return new re(1,1024);case"512th":return new re(1,512);case"256th":return new re(1,256);case"128th":return new re(1,128);case"64th":return new re(1,64);case"32th":case"32nd":return new re(1,32);case"16th":return new re(1,16);case"eighth":return new re(1,8);case"quarter":return new re(1,4);case"half":return new re(1,2);case"whole":return new re(1,1);case"breve":return new re(2,1);case"long":return new re(4,1);case"maxima":return new re(8,1);default:{const t=ze.translateText("ReaderErrorMessages/NoteDurationError","Invalid note duration.");throw new pi(t)}}}}da.NoteTypeXmlValues=["","1024th","512th","256th","128th","64th","32nd","16th","eigth","quarter","half","whole","breve","long","maxima"];class pM{constructor(e){this.placement=ue.Above,this.accidentalAbove=ke.NONE,this.accidentalBelow=ke.NONE,this.ornament=e}get GetOrnament(){return this.ornament}get AccidentalAbove(){return this.accidentalAbove}set AccidentalAbove(e){this.accidentalAbove=e}get AccidentalBelow(){return this.accidentalBelow}set AccidentalBelow(e){this.accidentalBelow=e}}var Mi=(i=>(i[i.Trill=0]="Trill",i[i.Turn=1]="Turn",i[i.InvertedTurn=2]="InvertedTurn",i[i.DelayedTurn=3]="DelayedTurn",i[i.DelayedInvertedTurn=4]="DelayedInvertedTurn",i[i.Mordent=5]="Mordent",i[i.InvertedMordent=6]="InvertedMordent",i))(Mi||{});class Qc{constructor(e,t,s){this.staffEntries=[],this.comments=[],this.timestamp=t,this.staffEntries=new Array(s),this.parentMeasure=e}$get$(e){return this.staffEntries[e]}$set$(e,t){this.staffEntries[e]=t}get Timestamp(){return this.timestamp}set Timestamp(e){this.timestamp=e}get StaffEntries(){return this.staffEntries}set StaffEntries(e){this.staffEntries=e}get Comments(){return this.comments}set Comments(e){this.comments=e}get ParentMeasure(){return this.parentMeasure}set ParentMeasure(e){this.parentMeasure=e}getAbsoluteTimestamp(){return re.plus(this.timestamp,this.parentMeasure.AbsoluteTimestamp)}}class di{constructor(e,t){this.voiceEntries=[],this.instructions=[],this.chordSymbolContainers=[],this.verticalContainerParent=e,this.parentStaff=t}get ParentStaff(){return this.parentStaff}get VerticalContainerParent(){return this.verticalContainerParent}get Timestamp(){if(this.VerticalContainerParent)return this.VerticalContainerParent.Timestamp}get AbsoluteTimestamp(){if(this.VerticalContainerParent)return re.plus(this.VerticalContainerParent.ParentMeasure.AbsoluteTimestamp,this.VerticalContainerParent.Timestamp)}get VoiceEntries(){return this.voiceEntries}set VoiceEntries(e){this.voiceEntries=e}get Link(){return this.staffEntryLink}set Link(e){this.staffEntryLink=e}get Instructions(){return this.instructions}set Instructions(e){this.instructions=e}get ChordContainers(){return this.chordSymbolContainers}set ChordContainers(e){this.chordSymbolContainers=e}removeAllInstructionsOfTypeClefInstruction(){let e=0,t=0;for(;e0)return!0;return!1}hasTie(){for(let e=0,t=this.VoiceEntries.length;et.parentRepetition.StartIndex)return-1}if(e.alignment===0&&t.alignment===0){if(e.parentRepetition.EndIndext.parentRepetition.EndIndex)return-1}}return 0}}class qe{constructor(e,t,s=1,n=void 0,r=void 0){this.endingIndices=void 0,this.measureIndex=e,r&&(this.endingIndices=r.slice()),this.type=t,this.alignment=s,this.parentRepetition=n}CompareTo(e){const t=e;if(this.measureIndex>t.measureIndex)return 1;if(this.measureIndex(i[i.StartLine=0]="StartLine",i[i.ForwardJump=1]="ForwardJump",i[i.BackJumpLine=2]="BackJumpLine",i[i.Ending=3]="Ending",i[i.DaCapo=4]="DaCapo",i[i.DalSegno=5]="DalSegno",i[i.Fine=6]="Fine",i[i.ToCoda=7]="ToCoda",i[i.DalSegnoAlFine=8]="DalSegnoAlFine",i[i.DaCapoAlFine=9]="DaCapoAlFine",i[i.DalSegnoAlCoda=10]="DalSegnoAlCoda",i[i.DaCapoAlCoda=11]="DaCapoAlCoda",i[i.Coda=12]="Coda",i[i.Segno=13]="Segno",i[i.None=14]="None",i))(Se||{}),mt=(i=>(i[i.Begin=0]="Begin",i[i.End=1]="End",i))(mt||{});let Bn=null;class gM{constructor(e,t){this.printNewSystemXml=!1,this.printNewPageXml=!1,this.IsSystemStartMeasure=!1,this.hasLyrics=!1,this.hasMoodExpressions=!1,this.allRests=!1,this.isReducedToMultiRest=!1,this.multipleRestMeasureNumber=0,this.staffLinkedExpressions=[],this.tempoExpressions=[],this.verticalSourceStaffEntryContainers=[],this.graphicalMeasureErrors=[],this.firstRepetitionInstructions=[],this.lastRepetitionInstructions=[],this.metronomeNoteIndex=0,this.completeNumberOfStaves=e,this.implicitMeasure=!1,this.hasEndLine=!1,this.endingBarStyleXml="",this.endingBarStyleEnum=Ge.SingleThin,this.firstInstructionsStaffEntries=new Array(e),this.lastInstructionsStaffEntries=new Array(e),this.rules=t,this.TempoInBPM=0;for(let s=0;s1)return e[this.measureListIndex-1]}get Rules(){return this.rules}get VerticalMeasureList(){return this.verticalMeasureList}set VerticalMeasureList(e){this.verticalMeasureList=e}get TempoInBPM(){return this.tempoInBPM}set TempoInBPM(e){this.tempoInBPM=e}findOrCreateStaffEntry(e,t,s){let n,r;for(const a of this.verticalSourceStaffEntryContainers)if(a.Timestamp.Equals(e)){r=a;break}if(r)return r.StaffEntries[t]?n=r.StaffEntries[t]:(n=new di(r,s),r.StaffEntries[t]=n),{createdNewContainer:!1,staffEntry:n};const o=this.verticalSourceStaffEntryContainers[this.verticalSourceStaffEntryContainers.length-1];if(this.verticalSourceStaffEntryContainers.length===0||o.Timestamp.lt(e)){const a=new Qc(this,e.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.push(a),n=new di(a,s),a.StaffEntries[t]=n}else for(let a=this.verticalSourceStaffEntryContainers.length-1;a>=0;a--){if(this.verticalSourceStaffEntryContainers[a].Timestamp.lt(e)){const l=new Qc(this,e.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.splice(a+1,0,l),n=new di(l,s),l.StaffEntries[t]=n;break}if(a===0){const l=new Qc(this,e.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.splice(a,0,l),n=new di(l,s),l.StaffEntries[t]=n;break}}return{createdNewContainer:!0,staffEntry:n}}findOrCreateVoiceEntry(e,t){let s,n=!1;for(const r of e.VoiceEntries)if(r.ParentVoice===t){s=r;break}return s||(s=new Bh(e.Timestamp,t,e),n=!0),{createdVoiceEntry:n,voiceEntry:s}}getPreviousSourceStaffEntryFromIndex(e,t){for(let s=t-1;s>=0;s--)if(this.verticalSourceStaffEntryContainers[s][e])return this.verticalSourceStaffEntryContainers[s][e]}getVerticalContainerIndexByTimestamp(e){for(let t=0,s=this.VerticalSourceStaffEntryContainers.length;t=0;c--){const f=this.verticalSourceStaffEntryContainers[c][a+l];if(f!==void 0&&f.hasTie()&&o.lt(re.plus(f.Timestamp,f.calculateMaxNoteLength()))){o=re.plus(f.Timestamp,f.calculateMaxNoteLength());break}}}}n.push(o)}for(let r=0,o=n.length;r0)return!0}return!1}beginsWithLineRepetition(){for(let e=0,t=this.FirstRepetitionInstructions.length;e=0&&(t=this.verticalSourceStaffEntryContainers[s].StaffEntries[e],!t);s--);return t}canBeReducedToMultiRest(){var s,n,r,o,a,l;let e=!0,t=!1;for(const u of this.verticalSourceStaffEntryContainers)if(u){for(const h of u.StaffEntries)if(!(!h||!h.ParentStaff.ParentInstrument.Visible)){if(h.ChordContainers.length>0||(h.ParentStaff.hasLyrics&&(t=!0),this.firstRepetitionInstructions.length>0||this.lastRepetitionInstructions.length>0))return!1;for(const c of h.VoiceEntries){for(const f of c.Notes)if(!f.isRest()){e=!1;break}if(!e)break}}}if(!e||t||this.hasMoodExpressions||this.tempoExpressions.length>0)return!1;for(const u of this.staffLinkedExpressions)if(u.length>0)return!1;for(const u of this.lastInstructionsStaffEntries)for(let h=0,c=u==null?void 0:u.Instructions.length;h=0;t--)for(let s=0;s(i[i.Fingering=0]="Fingering",i[i.String=1]="String",i))(Bd||{});class vM{}class Lh{constructor(e,t){this.parentEntry=e,this.parentNote=t,this.ParentNote.PlaybackNote=this,this.Length=this.ParentNote.Length,t.Pitch!==void 0?this.ParentNote.ParentStaff.ParentInstrument.MidiInstrumentId===Ee.Percussion?this.MidiKey=Lh.noteToMidiDrumKey(t):this.MidiKey=t.Pitch.getHalfTone()+12:this.MidiKey=0}setLength(){this.ParentNote.NoteTie!==void 0&&this.ParentNote.NoteTie.StartNote===this.ParentNote&&(this.Length=this.ParentNote.NoteTie.Duration)}get ParentEntry(){return this.parentEntry}get ParentNote(){return this.parentNote}static noteToMidiDrumKey(e){var n;const t=e.Pitch.getHalfTone()-12,s=(n=e.Notehead)==null?void 0:n.Shape;switch(e.Pitch.Octave){case 1:switch(e.Pitch.FundamentalNote){case Le.D:switch(s){default:return 44}case Le.E:switch(s){default:return 35}case Le.F:switch(s){default:return 36}case Le.G:switch(s){default:return 41}case Le.A:switch(s){default:return 43}case Le.B:switch(s){case ti.TRIANGLE:return 54;default:return 47}default:return t}case 2:switch(e.Pitch.FundamentalNote){case Le.C:switch(s){case ti.X:return 37;default:return 38}case Le.D:switch(s){case ti.X:return 59;default:return 48}case Le.E:switch(s){case ti.X:return 42;case ti.CIRCLEX:return 46;case ti.TRIANGLE:return 56;default:return 50}case Le.F:switch(s){case ti.DIAMOND:return 53;default:return 51}case Le.G:switch(s){case ti.CIRCLEX:case ti.DIAMOND:return 46;default:return 42}case Le.A:switch(s){default:return 49}case Le.B:switch(s){default:return 57}default:return t}case 3:switch(e.Pitch.FundamentalNote){case Le.C:switch(s){case ti.CIRCLEX:return 52;default:return 55}default:return t}default:return t}}}class SM{constructor(e){this.notes=[],this.TimestampShift=new re,this.parentVoiceEntry=e;for(const t of e.Notes)this.Notes.push(new Lh(this,t))}get ParentVoiceEntry(){return this.parentVoiceEntry}get Notes(){return this.notes}get Length(){if(this.Notes.length>0)return this.Notes[0].Length}set Length(e){for(const t of this.Notes)t.Length=e}get HasNotes(){return this.Notes.length>0}}class Bh{constructor(e,t,s,n=!0,r=!1,o=!1,a=!1){if(this.notes=[],this.graceVoiceEntriesBefore=[],this.graceVoiceEntriesAfter=[],this.articulations=[],this.playbackEntries=[],this.technicalInstructions=[],this.lyricsEntries=new cs,this.wantedStemDirection=-1,this.stemDirectionXml=-1,this.stemDirection=-1,this.timestamp=e,this.parentVoice=t,this.parentSourceStaffEntry=s,this.isGrace=r,this.graceAfterMainNote=!1,this.graceNoteSlash=o,this.graceSlur=a,r||t.VoiceEntries.push(this),n&&s!==void 0){const l=s.VoiceEntries;l.indexOf(this)===-1&&l.push(this)}this.mainPlaybackEntry=new SM(this),this.PlaybackEntries.push(this.mainPlaybackEntry)}get ParentSourceStaffEntry(){return this.parentSourceStaffEntry}get ParentVoice(){return this.parentVoice}get Timestamp(){return this.timestamp}set Timestamp(e){this.timestamp=e}get Notes(){return this.notes}addNote(e){this.notes.push(e),!e.isRest()&&(e.NoteTie===void 0||e.NoteTie.StartNote===e)&&this.MainPlaybackEntry.Notes.push(new Lh(this.MainPlaybackEntry,e))}get GraceVoiceEntriesBefore(){return this.graceVoiceEntriesBefore}set GraceVoiceEntriesBefore(e){this.graceVoiceEntriesBefore=e;for(const t of this.graceVoiceEntriesBefore)t.parentSourceStaffEntry=this.ParentSourceStaffEntry}get GraceVoiceEntriesAfter(){return this.graceVoiceEntriesAfter}set GraceVoiceEntriesAfter(e){this.graceVoiceEntriesAfter=e;for(const t of this.graceVoiceEntriesAfter)t.parentSourceStaffEntry=this.ParentSourceStaffEntry}get IsGrace(){return this.isGrace}set IsGrace(e){this.isGrace=e}get GraceAfterMainNote(){return this.graceAfterMainNote}set GraceAfterMainNote(e){this.graceAfterMainNote=e}get GraceNoteSlash(){return this.graceNoteSlash}set GraceNoteSlash(e){this.graceNoteSlash=e}get GraceSlur(){return this.graceSlur}set GraceSlur(e){this.graceSlur=e}get Articulations(){return this.articulations}get PlaybackEntries(){return this.playbackEntries}get Fermata(){return this.fermata}get MainPlaybackEntry(){return this.mainPlaybackEntry}set MainPlaybackEntry(e){this.mainPlaybackEntry=e}removeMainPlaybackEntry(){this.mainPlaybackEntry!==void 0&&this.removePlaybackEntry(this.mainPlaybackEntry)}removePlaybackEntry(e){this.mainPlaybackEntry===e&&(this.mainPlaybackEntry=void 0);const t=this.playbackEntries.indexOf(e);t>-1&&this.playbackEntries.splice(t,1)}get TechnicalInstructions(){return this.technicalInstructions}get LyricsEntries(){return this.lyricsEntries}get Arpeggio(){return this.arpeggio}set Arpeggio(e){this.arpeggio=e}get OrnamentContainer(){return this.ornamentContainer}set OrnamentContainer(e){this.ornamentContainer=e}set WantedStemDirection(e){this.wantedStemDirection=e}get WantedStemDirection(){return this.wantedStemDirection}set StemDirectionXml(e){this.stemDirectionXml=e}get StemDirectionXml(){return this.stemDirectionXml}set StemDirection(e){this.stemDirection=e}get StemDirection(){return this.stemDirection}get StemColorXml(){return this.stemColorXml}set StemColorXml(e){this.stemColorXml=e}get StemColor(){return this.stemColor}set StemColor(e){this.stemColor=e}get VolumeModifier(){return this.volumeModifier}set VolumeModifier(e){this.volumeModifier=e}get DurationModifier(){return this.durationModifier}set DurationModifier(e){this.durationModifier=e}hasArticulation(e){for(const t of this.articulations)if(t.Equals(e))return!0;return!1}static isSupportedArticulation(e){switch(e){case 0:case 1:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 26:case 24:return!0;default:return!1}}hasTie(){for(let e=0,t=this.Notes.length;e0)return!0;return!1}isStaccato(){for(const e of this.Articulations)if(e.articulationEnum===5)return!0;return!1}isAccent(){for(const e of this.Articulations)if(e.articulationEnum===0||e.articulationEnum===1)return!0;return!1}getVerseNumberForLyricEntry(e){let t=1;return this.lyricsEntries.forEach((s,n)=>{e===n&&(t=s)}),t}}var et=(i=>(i[i.accent=0]="accent",i[i.strongaccent=1]="strongaccent",i[i.marcatoup=2]="marcatoup",i[i.marcatodown=3]="marcatodown",i[i.invertedstrongaccent=4]="invertedstrongaccent",i[i.staccato=5]="staccato",i[i.staccatissimo=6]="staccatissimo",i[i.spiccato=7]="spiccato",i[i.tenuto=8]="tenuto",i[i.fermata=9]="fermata",i[i.invertedfermata=10]="invertedfermata",i[i.breathmark=11]="breathmark",i[i.caesura=12]="caesura",i[i.lefthandpizzicato=13]="lefthandpizzicato",i[i.naturalharmonic=14]="naturalharmonic",i[i.snappizzicato=15]="snappizzicato",i[i.upbow=16]="upbow",i[i.downbow=17]="downbow",i[i.scoop=18]="scoop",i[i.plop=19]="plop",i[i.doit=20]="doit",i[i.falloff=21]="falloff",i[i.stress=22]="stress",i[i.unstress=23]="unstress",i[i.detachedlegato=24]="detachedlegato",i[i.otherarticulation=25]="otherarticulation",i[i.bend=26]="bend",i))(et||{}),rt=(i=>(i[i.Undefined=-1]="Undefined",i[i.Up=0]="Up",i[i.Down=1]="Down",i[i.None=2]="None",i[i.Double=3]="Double",i))(rt||{}),bo=(i=>(i[i.MeasureBegin=0]="MeasureBegin",i[i.MeasureEnd=1]="MeasureEnd",i))(bo||{});class ei extends yu{constructor(e,t,s,n,r=void 0){super(),this.label=e,this.boundingBox=new Ut(this,r),this.label.fontHeight=t,this.label.textAlignment=s,this.rules=n,this.rules.MpatMode&&this.label.text==="TRIO"&&(this.label.fontFamily="Arial")}get Label(){return this.label}toString(){return`${this.label.text} (${this.boundingBox.RelativePosition.x},${this.boundingBox.RelativePosition.y})`}setLabelPositionAndShapeBorders(){var a,l;if(this.Label.text.trim()==="")return;this.TextLines=[];const e=(l=(a=this.rules)==null?void 0:a.LabelMarginBorderFactor)!=null?l:.1,t=this.Label.text.split(/[\n\r]+/g),s=t.length;let n=0;for(let u=0;u0&&this.TextLines.length>1&&(r+=this.rules.SpacingBetweenTextLines*s/10);const o=this.PositionAndShape;switch(this.Label.textAlignment){case Oe.CenterBottom:o.BorderTop=-r,o.BorderLeft=-n/2,o.BorderBottom=0,o.BorderRight=n/2;break;case Oe.CenterCenter:o.BorderTop=-r/2,o.BorderLeft=-n/2,o.BorderBottom=r/2,o.BorderRight=n/2;break;case Oe.CenterTop:o.BorderTop=0,o.BorderLeft=-n/2,o.BorderBottom=r,o.BorderRight=n/2;break;case Oe.LeftBottom:o.BorderTop=-r,o.BorderLeft=0,o.BorderBottom=0,o.BorderRight=n;break;case Oe.LeftCenter:o.BorderTop=-r/2,o.BorderLeft=0,o.BorderBottom=r/2,o.BorderRight=n;break;case Oe.LeftTop:o.BorderTop=0,o.BorderLeft=0,o.BorderBottom=r,o.BorderRight=n;break;case Oe.RightBottom:o.BorderTop=-r,o.BorderLeft=-n,o.BorderBottom=0,o.BorderRight=0;break;case Oe.RightCenter:o.BorderTop=-r/2,o.BorderLeft=-n,o.BorderBottom=r/2,o.BorderRight=0;break;case Oe.RightTop:o.BorderTop=0,o.BorderLeft=-n,o.BorderBottom=r,o.BorderRight=0;break}o.BorderMarginTop=o.BorderTop-r*e,o.BorderMarginLeft=o.BorderLeft-r*e,o.BorderMarginBottom=o.BorderBottom+r*e,o.BorderMarginRight=o.BorderRight+r*e}}class ft{constructor(e="",t=Oe.CenterBottom,s=void 0,n=!0){this.IsCreditLabel=!1,this.text=e,this.print=n,this.textAlignment=t,this.font=s,this.fontFamily=void 0}set font(e){this.fontEnumValue=e,this.fontFamily=v_[e]}get font(){return this.fontEnumValue}ToString(){return this.text}}const Id={Grava:40,Largo:46,Lento:52,Adagio:56,Larghetto:60,Andante:66,Anderato:69,Andantino:69,Moderato:88,Allegretto:108,"Allegro Moderato":108,Allegro:132,Vivace:152,Vivo:160,Vivacissimo:168,Presto:184,Prestissimo:208},AM=["纯律","纯律结束"],xM=["跳过下一个","b","#","§","º","X"],x4=["poco rit.","rall.","rit.","accel.","molto rit.","molto rall","lentando","poco accel.","calando"],w4="结束范围速度",wM="a tempo",EM=[w4],E4="速度 ",P4="仅文本速度 ";function Ar(i){return i.indexOf(E4)===0}function wu(i){return i.indexOf(P4)===0}function PM(i){return i.replace(P4,"").replace(E4,"")}function _M(i){return x4.includes(i)}function vp(i){return[...Object.keys(Id),...AM,...EM,...xM].map(e=>e.trim().toLocaleUpperCase()).includes(i.toLocaleUpperCase().trim())}function l2(i){return[Oe.CenterTop,Oe.RightTop].includes(i)}var Yi=(i=>(i[i.Unused_first_Symbol=0]="Unused_first_Symbol",i[i.BLACK_HEAD=1]="BLACK_HEAD",i[i.UPWARDS_TAIL=2]="UPWARDS_TAIL",i[i.DOWNWARDS_TAIL=3]="DOWNWARDS_TAIL",i[i.UPWARDS_DOUBLE_TAIL=4]="UPWARDS_DOUBLE_TAIL",i[i.DOWNWARDS_DOUBLE_TAIL=5]="DOWNWARDS_DOUBLE_TAIL",i[i.UPWARDS_TRIPLE_TAIL=6]="UPWARDS_TRIPLE_TAIL",i[i.DOWNWARDS_TRIPLE_TAIL=7]="DOWNWARDS_TRIPLE_TAIL",i[i.UPWARDS_QUAD_TAIL=8]="UPWARDS_QUAD_TAIL",i[i.DOWNWARDS_QUAD_TAIL=9]="DOWNWARDS_QUAD_TAIL",i[i.ROUND_HEAD=10]="ROUND_HEAD",i[i.WHITE_HEAD=11]="WHITE_HEAD",i[i.G_CLEF=12]="G_CLEF",i[i.F_CLEF=13]="F_CLEF",i[i.C_CLEF=14]="C_CLEF",i[i.BREVE=15]="BREVE",i[i.BREVE_REST=16]="BREVE_REST",i[i.COMMON_TIME=17]="COMMON_TIME",i[i.CUT_TIME=18]="CUT_TIME",i[i.WHOLE_REST=19]="WHOLE_REST",i[i.HALF_REST=20]="HALF_REST",i[i.QUARTER_REST=21]="QUARTER_REST",i[i.EIGHTH_REST=22]="EIGHTH_REST",i[i.SIXTEENTH_REST=23]="SIXTEENTH_REST",i[i.THIRTYSECOND_REST=24]="THIRTYSECOND_REST",i[i.SIXTYFOURTH_REST=25]="SIXTYFOURTH_REST",i[i.FLAT=26]="FLAT",i[i.SHARP=27]="SHARP",i[i.NATURAL=28]="NATURAL",i[i.DOUBLE_FLAT=29]="DOUBLE_FLAT",i[i.DOUBLE_SHARP=30]="DOUBLE_SHARP",i[i.ZERO=31]="ZERO",i[i.ONE=32]="ONE",i[i.TWO=33]="TWO",i[i.THREE=34]="THREE",i[i.FOUR=35]="FOUR",i[i.FIVE=36]="FIVE",i[i.SIX=37]="SIX",i[i.SEVEN=38]="SEVEN",i[i.EIGHT=39]="EIGHT",i[i.NINE=40]="NINE",i[i.DOT=41]="DOT",i[i.FERMATA=42]="FERMATA",i[i.INVERTED_FERMATA=43]="INVERTED_FERMATA",i[i.SPICCATO=44]="SPICCATO",i[i.TENUTO=45]="TENUTO",i[i.MARCATO=46]="MARCATO",i[i.MARCATISSIMO=47]="MARCATISSIMO",i[i.INVERTED_MARCATISSIMO=48]="INVERTED_MARCATISSIMO",i[i.P=49]="P",i[i.F=50]="F",i[i.S=51]="S",i[i.Z=52]="Z",i[i.M=53]="M",i[i.R=54]="R",i[i.SEGNO=55]="SEGNO",i[i.CODA=56]="CODA",i[i.DRUM_CLEF=57]="DRUM_CLEF",i[i.G_CLEF_SUB8=58]="G_CLEF_SUB8",i[i.G_CLEF_SUPER8=59]="G_CLEF_SUPER8",i[i.G_CLEF_SUB15=60]="G_CLEF_SUB15",i[i.G_CLEF_SUPER15=61]="G_CLEF_SUPER15",i[i.F_CLEF_SUB8=62]="F_CLEF_SUB8",i[i.F_CLEF_SUPER8=63]="F_CLEF_SUPER8",i[i.F_CLEF_SUB15=64]="F_CLEF_SUB15",i[i.F_CLEF_SUPER15=65]="F_CLEF_SUPER15",i[i.DOWN_BOW=66]="DOWN_BOW",i[i.MORDENT=67]="MORDENT",i[i.INVERTED_MORDENT=68]="INVERTED_MORDENT",i[i.TURN=69]="TURN",i[i.INVERTED_TURN=70]="INVERTED_TURN",i[i.LEFTHAND_PIZZICATO=71]="LEFTHAND_PIZZICATO",i[i.RELEASE_PED=72]="RELEASE_PED",i[i.ENGAGE_PED=73]="ENGAGE_PED",i[i.VA8=74]="VA8",i[i.VB8=75]="VB8",i[i.TRILL=76]="TRILL",i[i.MA15=77]="MA15",i[i.MB15=78]="MB15",i[i.HIGH=79]="HIGH",i[i.PLAY=80]="PLAY",i[i.MIC=81]="MIC",i[i.SNAP_PIZZICATO=82]="SNAP_PIZZICATO",i[i.NATURAL_HARMONIC=83]="NATURAL_HARMONIC",i[i.EditPen=84]="EditPen",i[i.PEDAL_BRACKET=85]="PEDAL_BRACKET",i[i.PEDAL_MIXED=86]="PEDAL_MIXED",i[i.PEDAL_SYMBOL=87]="PEDAL_SYMBOL",i))(Yi||{}),Xc=(i=>(i[i.Normal=0]="Normal",i[i.Disabled=1]="Disabled",i[i.Selected=2]="Selected",i[i.Clickable=3]="Clickable",i[i.PlaybackSymbols=4]="PlaybackSymbols",i[i.FollowSymbols=5]="FollowSymbols",i[i.QFeedbackNotFound=6]="QFeedbackNotFound",i[i.QFeedbackOk=7]="QFeedbackOk",i[i.QFeedbackPerfect=8]="QFeedbackPerfect",i[i.Debug1=9]="Debug1",i[i.Debug2=10]="Debug2",i[i.Debug3=11]="Debug3",i))(Xc||{}),jc=(i=>(i[i.Following=0]="Following",i[i.Midi=1]="Midi",i[i.Manual=2]="Manual",i))(jc||{});class c2{}class MM{constructor(e,t){this.drawableBoundingBoxElement="None",this.skyLineVisible=!1,this.bottomLineVisible=!1,this.phonicScoreMode=jc.Manual,this.textMeasurer=e,this.splitScreenLineColor=-1,this.drawingParameters=t,this.rules=t.Rules}set Mode(e){this.phonicScoreMode=e}drawSheet(e){if(this.graphicalMusicSheet=e,this.rules=e.ParentMusicSheet.Rules,this.drawSplitScreenLine(),this.drawingParameters.drawCursors)for(const s of e.Cursors){if(!s)continue;const n=new Ut(s);n.AbsolutePosition=s.Start,n.BorderBottom=s.End.y-s.Start.y,n.BorderRight=s.Width/2,n.BorderLeft=-s.Width/2,this.isVisible(n)&&this.drawLineAsVerticalRectangle(s,Xt.Cursor)}this.drawingParameters.drawScrollIndicator&&this.drawScrollIndicator();const t=Math.min(this.graphicalMusicSheet.MusicPages.length,this.rules.MaxPageToDrawNumber);for(let s=0;sX[0]).filter(Boolean))||[],J=[];let le=!1;for(let X=0;XX.x-O.x))==null?void 0:A[0])==null?void 0:P.measure;break}}}catch(Q){console.log("🚀 ~ error",Q)}let E=0;L?E=((x=L.stave)==null?void 0:x.end_x)||0:E=((M=s.sourceNote.SourceMeasure.VerticalMeasureList[0])==null?void 0:M.getVFStave()).end_x;const k=0;r.ScreenPosition.x=E,r.ScreenPosition.y=D===0?(e.PositionAndShape.Parent.AbsolutePosition.y-3-k)*10:D*10}const l=["C","G","D","A","E","B","F#","C#","G#","F","Bb","Eb","Ab","Db","Gb","Cb","Fb","D#","A#","E#"];l.includes(n.text)&&(r.ScreenPosition.y=(e.PositionAndShape.Parent.AbsolutePosition.y+e.PositionAndShape.Parent.BorderTop+e.PositionAndShape.Parent.BorderMarginTop)*10),["play","listen"].includes(n.text.toLocaleLowerCase())&&n.textAlignment===Oe.LeftBottom&&(r.ScreenPosition.y=(e.PositionAndShape.Parent.AbsolutePosition.y-1+e.PositionAndShape.Parent.BorderBottom)*10),["ffp","p-f","sfzp","szf"].includes(n.text)&&(n.fontStyle=3,n.text==="sfzp"&&(n.fontHeight=2.3)),(n.text=="R"||n.text=="L")&&(r.ScreenPosition.x+=5),(n.text==="r"||n.text==="l")&&(r.ScreenPosition.x+=6);const h=e.PositionAndShape.Size.width/2*10;if(o.x-h0&&(l2(e.Label.textAlignment)||[Oe.CenterBottom].includes(e.Label.textAlignment))){let D=-1,C=!1;for(const L of(a==null?void 0:a.AbstractExpressions)||[])if(L.Label===e?D=(_=L==null?void 0:L.parentMeasure)==null?void 0:_.measureListIndex:(T=L.expression)!=null&&T.TempoInBpm&&(C=L.expression.TempoInBpm>0),C&&D>-1){r.ScreenPosition.y-=4*10;break}}this.rules.DYMusicScoreType==="jianpu"?isNaN(parseInt(e.Label.text,10))&&this.renderLabel(e,t,r):this.renderLabel(e,t,r)}calculateLabel(e){const t=new c2,s=e.Label,n=new Ut(this);n.AbsolutePosition.x=e.PositionAndShape.AbsolutePosition.x,n.AbsolutePosition.y=e.PositionAndShape.AbsolutePosition.y||e.PositionAndShape.Parent.AbsolutePosition.y,t.ScreenPosition=this.applyScreenTransformation(n.AbsolutePosition),t.FontHeightInPixel=this.calculatePixelDistance(s.fontHeight);const r=this.calculatePixelDistance(e.PositionAndShape.Size.width);switch(t.BitmapWidth=Math.ceil(r),t.BitmapHeight=e.TextLines?Math.ceil(t.FontHeightInPixel*(.2+e.TextLines.length)):10,s.textAlignment){case Oe.LeftTop:t.ScreenPosition.x-=t.BitmapWidth/2,t.ScreenPosition.y+=t.BitmapHeight*1.5;break;case Oe.LeftCenter:t.ScreenPosition.y-=t.BitmapHeight/2;break;case Oe.LeftBottom:t.ScreenPosition.y-=t.BitmapHeight;break;case Oe.CenterTop:t.ScreenPosition.x-=t.BitmapWidth/2;break;case Oe.CenterCenter:t.ScreenPosition.x-=t.BitmapWidth/2,t.ScreenPosition.y-=t.BitmapHeight/2;break;case Oe.CenterBottom:t.ScreenPosition.x-=t.BitmapWidth/2,t.ScreenPosition.y-=t.BitmapHeight;break;case Oe.RightTop:t.ScreenPosition.x-=t.BitmapWidth;break;case Oe.RightCenter:t.ScreenPosition.x-=t.BitmapWidth,t.ScreenPosition.y-=t.BitmapHeight/2;break;case Oe.RightBottom:t.ScreenPosition.x-=t.BitmapWidth,t.ScreenPosition.y-=t.BitmapHeight;break;default:throw new zn("")}return t}applyScreenTransformations(e){const t=[];for(const s of e)t.push(this.applyScreenTransformation(s));return t}drawSplitScreenLine(){}renderRectangle(e,t,s,n=void 0,r=1){throw new Error("not implemented")}drawScrollIndicator(){}drawSelectionStartSymbol(e){}drawSelectionEndSymbol(e){}renderLabel(e,t,s){throw new Error("not implemented")}renderSystemToScreen(e,t,s){}drawSkyLine(e){}drawBottomLine(e){}drawInstrumentBrace(e,t){}drawGroupBracket(e,t){}isVisible(e){return!0}drawMusicSystem(e){const t=this.getSystemAbsBoundingRect(e),s=this.getSytemBoundingBoxInPixels(t);this.drawMusicSystemComponents(e,s,t)}getSytemBoundingBoxInPixels(e){const t=this.applyScreenTransformationForRect(e);return t.x=Math.round(t.x),t.y=Math.round(t.y),t}getSystemAbsBoundingRect(e){const t=e.PositionAndShape.BoundingRectangle;return new ys(e.PositionAndShape.AbsolutePosition.x+e.PositionAndShape.BorderLeft-1,e.PositionAndShape.AbsolutePosition.y+e.PositionAndShape.BorderTop-1,t.width+6,t.height+2)}drawMusicSystemComponents(e,t,s){const n=this.graphicalMusicSheet.SelectionStartSymbol,r=this.graphicalMusicSheet.SelectionEndSymbol;this.drawingParameters.drawSelectionStartSymbol&&n!==void 0&&this.isVisible(n.PositionAndShape)&&this.drawSelectionStartSymbol(n),this.drawingParameters.drawSelectionEndSymbol&&r!==void 0&&this.isVisible(r.PositionAndShape)&&this.drawSelectionEndSymbol(r);for(const l of e.StaffLines)this.drawStaffLine(l),this.rules.RenderLyrics&&(l.LyricsDashes.length>0&&this.drawDashes(l.LyricsDashes),l.LyricLines.length>0&&this.drawLyricLines(l.LyricLines,l));for(const l of e.SystemLines)this.drawSystemLineObject(l);if(e.Parent===e.Parent.Parent.MusicPages[0])for(const l of e.Labels)l.SVGNode=this.drawLabel(l,Xt.Notes);const o=this.graphicalMusicSheet.ParentMusicSheet.Instruments,a=o.filter(l=>l.Visible).length;for(const l of e.InstrumentBrackets)this.drawInstrumentBrace(l,e);if(o.length>0)if(a>1)for(const l of e.GroupBrackets)this.drawGroupBracket(l,e);else for(const l of e.GroupBrackets)l.Visible=!1;if(!this.leadSheet)for(const l of e.MeasureNumberLabels)l.SVGNode=this.drawLabel(l,Xt.Notes);for(const l of e.StaffLines)this.drawStaffLineSymbols(l);this.drawingParameters.drawMarkedAreas&&this.drawMarkedAreas(e)}activateSystemRendering(e,t,s,n){return!0}drawSystemLineObject(e){}drawStaffLine(e){for(const t of e.Measures)this.drawMeasure(t);this.rules.RenderLyrics&&e.LyricsDashes.length>0&&this.drawDashes(e.LyricsDashes),this.drawOctaveShifts(e),this.drawPedals(e),this.drawWavyLines(e),this.drawExpressions(e),this.skyLineVisible&&this.drawSkyLine(e),this.bottomLineVisible&&this.drawBottomLine(e)}drawLyricLines(e,t){t.LyricLines.forEach(s=>{s.Start.y+=t.PositionAndShape.AbsolutePosition.y,s.End.y+=t.PositionAndShape.AbsolutePosition.y,s.Start.x+=t.PositionAndShape.AbsolutePosition.x,s.End.x+=t.PositionAndShape.AbsolutePosition.x,this.drawGraphicalLine(s,this.rules.LyricUnderscoreLineWidth)})}drawExpressions(e){}drawGraphicalLine(e,t,s="black"){return this.drawLine(e.Start,e.End,s,t)}drawLine(e,t,s="#FF0000FF",n){}drawDashes(e){e.forEach(t=>t.SVGNode=this.drawLabel(t,Xt.Notes))}drawOctaveShifts(e){}drawStaffLines(e){if(e.StaffLines){const t=e.PositionAndShape.AbsolutePosition;for(let s=0;s<5;s++)this.drawLineAsHorizontalRectangleWithOffset(e.StaffLines[s],t,Xt.Notes)}}drawSymbol(e,t,s,n=1,r=Xt.Notes){}get leadSheet(){return this.graphicalMusicSheet.LeadSheet}set leadSheet(e){this.graphicalMusicSheet.LeadSheet=e}drawPage(e){if(this.isVisible(e.PositionAndShape)){for(const t of e.MusicSystems)this.isVisible(t.PositionAndShape)&&this.drawMusicSystem(t);if(e===e.Parent.MusicPages[0])for(const t of e.Labels)t.SVGNode=this.drawLabel(t,Xt.Notes);this.drawableBoundingBoxElement&&this.drawBoundingBoxes(e.PositionAndShape,0,this.drawableBoundingBoxElement)}}drawBoundingBoxes(e,t=0,s="all"){const n=e.DataObject.constructor.name;let r=!1;s==="all"&&(r=!0),(r||n===s)&&this.drawBoundingBox(e,void 0,!0,n,t),t++,e.ChildElements.forEach(o=>this.drawBoundingBoxes(o,t,s))}drawBoundingBox(e,t=void 0,s=!1,n=void 0,r=0){let o=new ys(e.AbsolutePosition.x+e.BorderMarginLeft,e.AbsolutePosition.y+e.BorderMarginTop,e.BorderMarginRight-e.BorderMarginLeft,e.BorderMarginBottom-e.BorderMarginTop);s&&(this.drawLineAsHorizontalRectangle(new Qs(new te(e.AbsolutePosition.x-1,e.AbsolutePosition.y),new te(e.AbsolutePosition.x+1,e.AbsolutePosition.y),.1,Vo.BaseWritingColor,t),r-1),this.drawLineAsVerticalRectangle(new Qs(new te(e.AbsolutePosition.x,e.AbsolutePosition.y-1),new te(e.AbsolutePosition.x,e.AbsolutePosition.y+1),.1,Vo.BaseWritingColor,t),r-1)),o=this.applyScreenTransformationForRect(o);const a=this.renderRectangle(o,Xt.Background,r,t,.5);if(n){const l=new ft(n),u=new c2;u.BitmapWidth=o.width,u.BitmapHeight=o.height,u.FontHeightInPixel=o.height,u.ScreenPosition=new te(o.x,o.y+12),this.renderLabel(new ei(l,.8,Oe.CenterCenter,this.rules),r,u)}return a}drawMarkedAreas(e){for(const t of e.GraphicalMarkedAreas)t&&(t.systemRectangle&&this.drawRectangle(t.systemRectangle,Xt.Background),t.settings&&(t.settings.SVGNode=this.drawLabel(t.settings,Xt.Comment)),t.labelRectangle&&this.drawRectangle(t.labelRectangle,Xt.Background),t.label&&(t.label.SVGNode=this.drawLabel(t.label,Xt.Comment)))}drawStaffLineSymbols(e){const t=e.ParentStaff.ParentInstrument,s=e.PositionAndShape.AbsolutePosition.x,n=e.PositionAndShape.AbsolutePosition.y+2,r=e.PositionAndShape.BorderRight;t.highlight&&this.drawingParameters.drawHighlights&&this.drawLineAsHorizontalRectangle(new Qs(new te(s,n),new te(s+r,n),4,Vo.Highlighted),Xt.Highlight);let o=Xc.Disabled,a=Yi.PLAY,l=this.drawingParameters.drawActivitySymbols;switch(this.phonicScoreMode){case jc.Midi:a=Yi.PLAY,this.midiPlaybackAvailable&&e.ParentStaff.audible&&(o=Xc.PlaybackSymbols);break;case jc.Following:a=Yi.MIC,e.ParentStaff.following&&(o=Xc.FollowSymbols);break;default:l=!1;break}if(l){const u=new te(s+r+2,n);this.drawSymbol(a,o,u)}if(this.drawingParameters.drawErrors)for(const u of e.Measures){const h=u.PositionAndShape,c=h.AbsolutePosition.x,f=h.AbsolutePosition.y+2;u.hasError&&this.graphicalMusicSheet.ParentMusicSheet.DrawErroneousMeasures&&this.drawLineAsHorizontalRectangle(new Qs(new te(c,f),new te(c+h.BorderRight,f),4,Vo.ErrorUnderlay),Xt.MeasureError)}}}class _4{constructor(e){this.fontSize=20,this.fontSizeStandard=this.fontSize;const t=document.createElement("canvas");this.context=t.getContext("2d"),this.rules=e}computeTextWidthToHeightRatio(e,t,s,n=void 0,r=this.fontSize){return this.context.font=ot.font(r,s,t,this.rules,n),this.context.measureText(e).width/r}setFontSize(e=this.fontSizeStandard){return this.fontSize=e,e}}class Ih extends yi{constructor(e,t,s){super(),this.expression=t,this.parentMeasure=s,this.boundingBox=new Ut(this,e.PositionAndShape),this.parentStaffLine=e,this.parentStaffLine.AbstractExpressions.push(this),this.rules=e.ParentMusicSystem.rules}get Label(){return this.label}get ParentStaffLine(){return this.parentStaffLine}get SourceExpression(){return this.expression}get Placement(){return this.expression.Placement}}class Rd extends Ih{constructor(e,t){super(t.PositionAndShape.Parent.DataObject,e,e.parentMeasure),this.label=t}get GraphicalLabel(){return this.label}updateSkyBottomLine(){}}class M4 extends Ih{constructor(e,t,s){super(t,e,s.parentSourceMeasure),this.mInstantaneousDynamicExpression=e,this.mMeasure=s}updateSkyBottomLine(){const e=this.parentStaffLine.SkyBottomLineCalculator,t=this.PositionAndShape.RelativePosition.x+this.PositionAndShape.BorderMarginLeft,s=this.PositionAndShape.RelativePosition.x+this.PositionAndShape.BorderMarginRight;let n=0;switch(this.Placement){case ue.Above:n=this.PositionAndShape.RelativePosition.y+this.PositionAndShape.BorderMarginTop,e.updateSkyLineInRange(t,s,n);break;case ue.Below:n=this.PositionAndShape.RelativePosition.y+this.PositionAndShape.BorderMarginBottom,e.updateBottomLineInRange(t,s,n);break;default:ge.error("Placement for GraphicalInstantaneousDynamicExpression is unknown")}}}class Sp extends Ih{constructor(e,t,s){super(t,e,s),this.lines=[],this.isSplittedPart=!1,this.notToBeRemoved=!1}get StartMeasure(){return this.startMeasure}set StartMeasure(e){this.startMeasure=e}get EndMeasure(){return this.endMeasure}set EndMeasure(e){this.endMeasure=e}get EndStaffLine(){return this.endMeasure?this.endMeasure.ParentStaffLine:void 0}get IsSplittedPart(){return this.isSplittedPart}set IsSplittedPart(e){this.isSplittedPart=e}get IsVerbal(){return this.ContinuousDynamic.Label&&this.ContinuousDynamic.Label.length>0}get NotToBeRemoved(){return this.notToBeRemoved}set NotToBeRemoved(e){this.notToBeRemoved=e}get Lines(){return this.lines}get ContinuousDynamic(){return this.SourceExpression}updateSkyBottomLine(){var n;const e=this.parentStaffLine.SkyBottomLineCalculator,t=this.IsVerbal?this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginLeft:0,s=this.IsVerbal?this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginRight:0;switch(!this.IsVerbal&&this.lines.length<2&&ge.warn("Not enough lines for SkyBottomLine calculation"),this.IsVerbal||this.ContinuousDynamic.DynamicType!==ms.crescendo&&this.ContinuousDynamic.DynamicType!==ms.diminuendo&&ge.warn("GraphicalContinuousDynamicExpression.updateSkyBottomLine(): unhandled continuous dynamic type. start measure: "+((n=this.startMeasure)==null?void 0:n.MeasureNumber)),this.Placement){case ue.Above:if(!this.IsVerbal)this.ContinuousDynamic.DynamicType===ms.crescendo?e.updateSkyLineWithWedge(this.lines[0].Start,this.lines[0].End):this.ContinuousDynamic.DynamicType===ms.diminuendo&&e.updateSkyLineWithWedge(this.lines[0].End,this.lines[0].Start);else{const r=this.label.PositionAndShape.BorderMarginTop+this.label.PositionAndShape.RelativePosition.y;e.updateSkyLineInRange(t,s,r)}break;case ue.Below:if(!this.IsVerbal)this.ContinuousDynamic.DynamicType===ms.crescendo?e.updateBottomLineWithWedge(this.lines[1].Start,this.lines[1].End):this.ContinuousDynamic.DynamicType===ms.diminuendo&&e.updateBottomLineWithWedge(this.lines[1].End,this.lines[1].Start);else{const r=this.label.PositionAndShape.BorderMarginBottom+this.label.PositionAndShape.RelativePosition.y;e.updateBottomLineInRange(t,s,r)}break;default:ge.error("Placement for GraphicalContinuousDynamicExpression is unknown")}}createCrescendoLines(e,t,s,n=this.rules.WedgeOpeningLength,r=this.rules.WedgeLineWidth){const o=new te(e,s),a=new te(t,s-n/2),l=new te(t,s+n/2);this.addWedgeLines(o,a,l,r)}createFirstHalfCrescendoLines(e,t,s,n=this.rules.WedgeMeasureEndOpeningLength,r=this.rules.WedgeLineWidth){const o=new te(e,s),a=new te(t,s-n/2),l=new te(t,s+n/2);this.addWedgeLines(o,a,l,r)}createSecondHalfCrescendoLines(e,t,s,n=this.rules.WedgeMeasureBeginOpeningLength,r=this.rules.WedgeOpeningLength,o=this.rules.WedgeLineWidth){const a=new te(e,s-n/2),l=new te(e,s+n/2),u=new te(t,s-r/2),h=new te(t,s+r/2);this.addDoubleLines(a,u,l,h,o)}recalculateCrescendoLines(e,t,s){const n=Math.abs(this.lines[0].Start.y-this.lines[1].Start.y)>1e-4;this.lines.clear(),n?this.createSecondHalfCrescendoLines(e,t,s):this.isSplittedPart?this.createFirstHalfCrescendoLines(e,t,s):this.createCrescendoLines(e,t,s)}createDiminuendoLines(e,t,s,n=this.rules.WedgeOpeningLength,r=this.rules.WedgeLineWidth){const o=new te(e,s-n/2),a=new te(e,s+n/2),l=new te(t,s);this.addWedgeLines(l,o,a,r)}createFirstHalfDiminuendoLines(e,t,s,n=this.rules.WedgeOpeningLength,r=this.rules.WedgeMeasureEndOpeningLength,o=this.rules.WedgeLineWidth){const a=new te(e,s-n/2),l=new te(e,s+n/2),u=new te(t,s-r/2),h=new te(t,s+r/2);this.addDoubleLines(a,u,l,h,o)}createSecondHalfDiminuendoLines(e,t,s,n=this.rules.WedgeMeasureBeginOpeningLength,r=this.rules.WedgeLineWidth){const o=new te(e,s-n/2),a=new te(e,s+n/2),l=new te(t,s);this.addWedgeLines(l,o,a,r)}recalculateDiminuendoLines(e,t,s){const n=Math.abs(this.lines[0].End.y-this.lines[1].End.y)>1e-4;this.lines.clear(),n?this.createFirstHalfDiminuendoLines(e,t,s):this.isSplittedPart?this.createSecondHalfDiminuendoLines(e,t,s):this.createDiminuendoLines(e,t,s)}calcPsi(){if(this.IsVerbal){this.PositionAndShape.calculateBoundingBox();return}this.PositionAndShape.RelativePosition=this.lines[0].Start,this.PositionAndShape.BorderMarginTop=this.lines[0].End.y-this.lines[0].Start.y,this.PositionAndShape.BorderMarginBottom=this.lines[1].End.y-this.lines[1].Start.y,this.PositionAndShape.Center.y=(this.PositionAndShape.BorderMarginTop+this.PositionAndShape.BorderMarginBottom)/2,this.ContinuousDynamic.DynamicType===ms.crescendo?(this.PositionAndShape.BorderMarginLeft=0,this.PositionAndShape.BorderMarginRight=this.lines[0].End.x-this.lines[0].Start.x):(this.PositionAndShape.BorderMarginLeft=this.lines[0].End.x-this.lines[0].Start.x,this.PositionAndShape.BorderMarginRight=0)}cleanUp(){this.lines.clear()}shiftYPosition(e){this.IsVerbal?(this.PositionAndShape.RelativePosition.y+=e,this.PositionAndShape.calculateBoundingBox()):(this.lines[0].Start.y+=e,this.lines[0].End.y+=e,this.lines[1].End.y+=e)}squeeze(e){this.IsVerbal||Math.abs(this.lines[0].End.x-this.lines[0].Start.x)0?this.lines[0].Start.x+=e:(this.lines[0].End.x+=e,this.lines[1].End.x+=e):e<0?this.lines[0].Start.x+=e:(this.lines[0].End.x+=e,this.lines[1].End.x+=e),this.calcPsi())}addWedgeLines(e,t,s,n){const r=new Qs(e,t,n),o=new Qs(e,s,n);this.lines.push(r),this.lines.push(o)}addDoubleLines(e,t,s,n,r){const o=new Qs(e,t,r),a=new Qs(s,n,r);this.lines.push(o),this.lines.push(a)}}class ul extends Ih{constructor(e,t,s,n,r=void 0){super(e,new er(s),n),this.label=t,this.sourceMultiExpression=r}updateSkyBottomLine(){const e=this.parentStaffLine.SkyBottomLineCalculator,t=this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginLeft,s=this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginRight;switch(this.Placement){case ue.Above:const n=this.label.PositionAndShape.BorderMarginTop+this.label.PositionAndShape.RelativePosition.y;e.updateSkyLineInRange(t,s,n);break;case ue.Below:const r=this.label.PositionAndShape.BorderMarginBottom+this.label.PositionAndShape.RelativePosition.y;e.updateBottomLineInRange(t,s,r);break;default:ge.error("Placement for GraphicalUnknownExpression is unknown")}}}const Ve=10;class CM extends MM{constructor(e=new I4){super(new _4(e.Rules),e),this.backends=[],this.zoom=1,this.pageIdx=0,this.getDotId=(t,s)=>s?String(t.Label.PositionAndShape.RelativePosition[s]):String(t.Label.PositionAndShape.RelativePosition.x)+String(t.Label.PositionAndShape.RelativePosition.y),this.hasDot=(t,s,n,r)=>{const o=s||Object.values(r);for(const a of o){if(n)return t.x===a.x&&t.y===a.y;if(t.x===a.x)return!0}return!1}}get Zoom(){return this.zoom}get Backends(){return this.backends}initializeBackendForPage(e){this.backend=this.backends[e.PageNumber-1]}drawSheet(e){var t,s,n;this.rules.DefaultVexFlowNoteFont==="gonville"&&(B.Flow.DEFAULT_FONT_STACK=[(t=B.Flow.Fonts)==null?void 0:t.Gonville,(s=B.Flow.Fonts)==null?void 0:s.Bravura,(n=B.Flow.Fonts)==null?void 0:n.Custom]),B.Flow.STAVE_LINE_THICKNESS=this.rules.StaffLineWidth*Ve,B.Flow.STEM_WIDTH=this.rules.StemWidth*Ve,B.Flow.DEFAULT_NOTATION_FONT_SCALE=this.rules.VexFlowDefaultNotationFontScale,B.Flow.DEFAULT_TAB_FONT_SCALE=this.rules.VexFlowDefaultTabFontScale,this.pageIdx=0;for(const r of e.MusicPages){if(r.PageNumber>this.rules.MaxPageToDrawNumber)break;const o=this.backends[this.pageIdx];o.graphicalMusicPage=r,o.scale(this.zoom),this.pageIdx+=1}this.pageIdx=0,this.backend=this.backends[0],super.drawSheet(e)}drawPage(e){e&&(this.backend=this.backends[e.PageNumber-1],super.drawPage(e),this.pageIdx+=1)}clear(){for(const e of this.backends)e.clear()}setZoom(e){this.zoom=e}calculatePixelDistance(e){return e*Ve}drawStaffLine(e){const t=this.backend.getContext().openGroup();t&&t.classList.add("staffline"),super.drawStaffLine(e);const s=e.PositionAndShape.AbsolutePosition;this.rules.RenderSlurs&&this.drawSlurs(e,s),this.backend.getContext().closeGroup()}drawSlurs(e,t){var n,r,o,a;const s=(n=window.GYM)==null?void 0:n.vfcurveItem;for(let l=0;l(c.index?c.index===l:!0)&&c.MeasureNumberXML==u.staffEntries[u.staffEntries.length-1].parentMeasure.MeasureNumber);h&&(u.bezierEndControlPt.y+=(r=h==null?void 0:h.bezierEndControlPt)!=null&&r.y?h.bezierEndControlPt.y:0,u.bezierEndPt.y+=(o=h==null?void 0:h.bezierEndPt)!=null&&o.y?h.bezierEndPt.y:0,u.bezierStartControlPt.y+=(a=h==null?void 0:h.bezierStartControlPt)!=null&&a.y?h.bezierStartControlPt.y:0)}catch(h){console.log(h)}this.drawSlur(u,t)}}}drawSlur(e,t){const s=[];let n,r,o,a;this.rules.DYMusicScoreType==="jianpu"?((e.placement>0||e.bezierStartPt.y>0)&&(e.bezierStartPt.y=-.8,e.bezierStartControlPt.y=-2.5),n=new te(e.bezierStartPt.x+t.x,e.bezierStartPt.y+t.y),r=new te(e.bezierStartControlPt.x+t.x,e.bezierStartControlPt.y+t.y),o=new te(e.bezierEndControlPt.x+t.x,e.bezierStartControlPt.y+t.y),a=new te(e.bezierEndPt.x+t.x,e.bezierStartPt.y+t.y)):(n=new te(e.bezierStartPt.x+t.x,e.bezierStartPt.y+t.y),r=new te(e.bezierStartControlPt.x+t.x,e.bezierStartControlPt.y+t.y),o=new te(e.bezierEndControlPt.x+t.x,e.bezierEndControlPt.y+t.y),a=new te(e.bezierEndPt.x+t.x,e.bezierEndPt.y+t.y)),s.push(this.applyScreenTransformation(n)),s.push(this.applyScreenTransformation(r)),s.push(this.applyScreenTransformation(o)),s.push(this.applyScreenTransformation(a)),e.placement===ue.Above?(n.y-=.05,r.y-=.3,o.y-=.3,a.y-=.05):(n.y+=.05,r.y+=.3,o.y+=.3,a.y+=.05),s.push(this.applyScreenTransformation(n)),s.push(this.applyScreenTransformation(r)),s.push(this.applyScreenTransformation(o)),s.push(this.applyScreenTransformation(a)),e.SVGElement=this.backend.renderCurve(s)}drawMeasure(e){e.setAbsoluteCoordinates(e.PositionAndShape.AbsolutePosition.x*Ve,e.PositionAndShape.AbsolutePosition.y*Ve);const t=this.backend.getContext();try{e.draw(t)}catch(s){ge.warn("VexFlowMusicSheetDrawer.drawMeasure",s)}for(const s of e.staffEntries)this.drawStaffEntry(s)}drawLine(e,t,s="#FF0000FF",n=.2){return e=this.applyScreenTransformation(e),t=this.applyScreenTransformation(t),this.backend.renderLine(e,t,s,n*Ve)}DrawOverlayLine(e,t,s,n="#FF0000FF",r=.2){if(!s.PageNumber||s.PageNumber>this.backends.length||s.PageNumber<1){console.log("VexFlowMusicSheetDrawer.drawOverlayLine: invalid page number / music page number doesn't correspond to an existing backend.");return}const o=s.PageNumber-1,a=this.backends[o];return e=this.applyScreenTransformation(e),t=this.applyScreenTransformation(t),a.renderLine(e,t,n,r*Ve)}drawSkyLine(e){const t=e.PositionAndShape.AbsolutePosition,s=e.PositionAndShape.Size.width;this.drawSampledLine(e.SkyLine,t,s)}drawBottomLine(e){const t=new te(e.PositionAndShape.AbsolutePosition.x,e.PositionAndShape.AbsolutePosition.y),s=e.PositionAndShape.Size.width;this.drawSampledLine(e.BottomLine,t,s,"#0000FFFF")}drawSampledLine(e,t,s,n="#FF0000FF"){const r=[];let o=0;for(let l=0;l0){const l=this.rules.SamplingUnit;let u=new te(a.x,a.y),h=new te(r[0]/l+a.x,a.y);this.drawLine(u,h,n);let c,f;e[0]>=0&&(c=new te(r[0]/l+a.x,a.y),f=new te(r[0]/l+a.x,a.y+e[r[0]]),this.drawLine(c,f,n));for(let d=1;d0)for(const t of e.FingeringEntries)t.SVGNode=this.drawLabel(t,Xt.Notes);if(e.graphicalChordContainers!==void 0&&e.graphicalChordContainers.length>0)for(const t of e.graphicalChordContainers){const s=t.GraphicalLabel;s.SVGNode=this.drawLabel(s,Xt.Notes)}this.rules.RenderLyrics&&e.LyricsEntries.length>0&&this.drawLyrics(e.LyricsEntries,Xt.Notes)}drawLyrics(e,t){e.forEach(s=>{const n=s.GraphicalLabel;n.SVGNode=this.drawLabel(n,t)})}drawInstrumentBrace(e,t){e.draw(this.backend.getContext())}drawGroupBracket(e,t){e.draw(this.backend.getContext())}drawOctaveShifts(e){for(const t of e.OctaveShifts)if(t){const s=t,n=this.backend.getContext(),r=s.getTextBracket();r.setContext(n);try{r.draw()}catch(o){ge.warn(o)}}}drawPedals(e){for(const t of e.Pedals)if(t){const s=t,n=this.backend.getContext(),r=s.getPedalMarking();r.setContext(n),r.draw()}}drawWavyLines(e){for(const t of e.WavyLines)if(t){const s=t,n=this.backend.getContext(),r=s.getVibratoBracket();r.setContext(n),r.draw()}}getMaxExpressionsYAndDots(e){var l,u;const t=[];let s=0;for(const h of e.measures)t.push(h.measureNumber);const n={},r={},o={};for(const h of e.AbstractExpressions)if(h instanceof ul&&t.includes(h.parentMeasure.MeasureNumber)){const c=this.getDotId(h),f=this.getDotId(h,"x");r[c]||(r[c]=[]),o[f]||(o[f]=[]),this.hasDot(h.Label.PositionAndShape.RelativePosition,r[c],!0)||(r[c].push(h.Label.PositionAndShape.RelativePosition),o[f].push(h.Label.PositionAndShape.RelativePosition)),n[c]=h.Label.PositionAndShape.RelativePosition}let a=0;for(const h of e.AbstractExpressions){const c=(l=h.parentMeasure)==null?void 0:l.MeasureNumber;if(h instanceof ul&&t.includes(c)){const f=(u=h.parentMeasure.verticalMeasureList[0])==null?void 0:u.stave,d=(f==null?void 0:f.end_x)-(f==null?void 0:f.x),p=this.getDotId(h,"x");if((o[p]||[]).length===1&&a!==c){const g=h.Label.PositionAndShape.AbsolutePosition.y;s=s===0?g:Math.min(s,g)}(o[p]||[]).length!==1&&d/101){let s=Math.min(...e.Lines.map(n=>n.Start.x));e.Lines[0].Start.x=s,e.Lines[1].Start.x=s,[e.Lines[0].Start.y,e.Lines[1].Start.y]=[e.Lines[1].Start.y,e.Lines[0].Start.y],e.Lines[0].End.y+=this.rules.WedgeOpeningLength/2,e.Lines[1].End.y+=this.rules.WedgeOpeningLength}}catch(s){}const t=this.backend.getContext();t.openGroup("lineGroup");for(const s of e.Lines){const n=new te(e.ParentStaffLine.PositionAndShape.AbsolutePosition.x+s.Start.x,e.ParentStaffLine.PositionAndShape.AbsolutePosition.y+s.Start.y),r=new te(e.ParentStaffLine.PositionAndShape.AbsolutePosition.x+s.End.x,e.ParentStaffLine.PositionAndShape.AbsolutePosition.y+s.End.y);this.drawLine(n,r,"black",s.Width)}t.closeGroup()}}renderLabel(e,t,s){return this._renderLabel(e,s)}_renderLabel(e,t){var u;if(!e.Label.print)return;const s=e.Label.fontHeight*Ve,{font:n}=e.Label;let r;this.rules.ColoringEnabled&&(r=e.Label.colorDefault,e.Label.color&&(r=e.Label.color.toString()),r||(r=this.rules.DefaultColorLabel));let{fontStyle:o,fontFamily:a}=e.Label;o||(o=this.rules.DefaultFontStyle),a||(a=this.rules.DefaultFontFamily);let l;for(let h=0;h<((u=e.TextLines)==null?void 0:u.length);h++){const c=e.TextLines[h],f=this.calculatePixelDistance(c.xOffset),d=new te(t.ScreenPosition.x+f,t.ScreenPosition.y),p=this.backend.renderText(s,o,n,c.text,t.FontHeightInPixel,d,r,e.Label.fontFamily);l?l.appendChild(p):l=p,t.ScreenPosition.y=t.ScreenPosition.y+t.FontHeightInPixel,e.TextLines.length>1&&(t.ScreenPosition.y+=this.rules.SpacingBetweenTextLines)}return l}renderRectangle(e,t,s,n,r){return this.backend.renderRectangle(e,s,n,r)}applyScreenTransformation(e){return new te(e.x*Ve,e.y*Ve)}applyScreenTransformationForRect(e){return new ys(e.x*Ve,e.y*Ve,e.width*Ve,e.height*Ve)}}const _e=B.Flow,Zi=class{static durations(i,e){const t=[],s=i.clone();for(;s.RealValue>0;){const n=s.RealValue;if(n>=2)t.push("1/2"),s.Sub(new re(2,1));else if(n>=1)t.push("w"),s.Sub(new re(1,1));else if(n<1&&n>=.5){if(e&&n>.5)return["w"];t.push("h"),s.Sub(new re(1,2))}else if(n<.5&&n>=.25){if(e&&n>.25)return["h"];t.push("q"),s.Sub(new re(1,4))}else if(n<.25&&n>=.125){if(e&&n>.125)return["q"];t.push("8"),s.Sub(new re(1,8))}else if(n<.125&&n>=.0625){if(e&&n>.0625)return["8"];t.push("16"),s.Sub(new re(1,16))}else if(n<.0625&&n>=.03125){if(e&&n>.03125)return["16"];t.push("32"),s.Sub(new re(1,32))}else if(n<.03125&&n>=.015625){if(e&&n>.015625)return["32"];t.push("64"),s.Sub(new re(1,64))}else{if(e)return["64"];t.push("128"),s.Sub(new re(1,128))}}return t}static pitch(i,e,t,s=void 0,n=void 0){let r=n;n===void 0&&(r=3),e&&n===void 0&&(r=0,t.ClefType===Lt.F&&(r=2),t.ClefType===Lt.C&&(r=2));const o=Le[i.FundamentalNote].toLowerCase(),a=pt.accidentalVexflow(i.Accidental),l=i.Octave-t.OctaveOffset+r;let u="";return s&&(u=this.NoteHeadCode(s)),[o+"n/"+l+u,a,t]}static restToNotePitch(i,e){let t=i.Octave;switch(e){case Lt.C:case Lt.F:{t+=2;break}case Lt.G:}return new pt(i.FundamentalNote,t,ke.NONE)}static NoteHeadCode(i){const e="/",t=i.Filled?"2":"1";switch(i.Shape){case ti.NORMAL:return"";case ti.DIAMOND:return e+"D"+t;case ti.TRIANGLE:return e+"T"+t;case ti.X:return e+"X"+t;case ti.CIRCLEX:return e+"X3";case ti.RECTANGLE:return e+"R"+t;case ti.SQUARE:return e+"S"+t;case ti.SLASH:return"";default:return""}}static GhostNotes(i){const e=[],t=Zi.durations(i,!1);for(const s of t)e.push(new _e.GhostNote({duration:s}));return e}static StaveNote(i){var M,_,T,D,C,L,E,k,Q,H,Z,J,le,X;i.sortForVexflow();const e=i.notes,t=i.parentStaffEntry.parentMeasure.parentSourceMeasure.Rules,s=e[0];let n=[],r;const o=[],a=s.graphicalNoteLength,l=s.sourceNote.NoteTuplet!==void 0;let u=Zi.durations(a,l)[0];s.sourceNote.TypeLength!==void 0&&s.sourceNote.TypeLength!==a&&s.sourceNote.TypeLength.RealValue!==0&&(u=Zi.durations(s.sourceNote.TypeLength,l)[0],s.numberOfDots=s.sourceNote.DotsXml);let h,c=s.numberOfDots,f=!1,d=0,p=!1,g=!1,m;for(const O of e){if(c=1&&he.length-1>=Me+1&&(oe=(C=(D=he[Me-1])==null?void 0:D.graphicalVoiceEntries[0])==null?void 0:C.parentVoiceEntry,be=(E=(L=he[Me+1])==null?void 0:L.graphicalVoiceEntries[0])==null?void 0:E.parentVoiceEntry,oe&&be)){const ve=oe.Notes[0],V=be.Notes[0];if((k=ve.NoteBeam)!=null&&k.Notes.includes(V)&&V.ParentStaffEntry.ParentStaff.StafflineCount!==1){const z=oe.Notes.last().Pitch,w=O.Clef(),U=Zi.pitch(Zi.restToNotePitch(z.getTransposedPitch(-2),w.ClefType),!1,w);z.FundamentalNote===4&&(n=[U[0]])}}}}if(a.RealValue===O.sourceNote.SourceMeasure.ActiveTimeSignature.RealValue&&(n=t.DYMusicScoreType==="staff"?["d/5"]:["R/5"],u="w",c=0,f=!0,d=t.WholeRestXShiftVexflow*Ve),[...O.sourceNote.ParentStaff.Voices].filter(se=>(se==null?void 0:se.VoiceId)!=1).length){const se=O.parentVoiceEntry.parentStaffEntry.graphicalVoiceEntries,he=O.parentVoiceEntry.parentVoiceEntry.ParentVoice.VoiceId;let oe,be;for(const Me of se)for(const ve of Me.notes){if(ve===O||ve.sourceNote.isRest()||!ve.sourceNote.PrintObject){O.lineShift=-2;continue}const V=ve.parentVoiceEntry.parentVoiceEntry.WantedStemDirection,z=he===1||he===5,w=z?1:-1,G=ve.sourceNote.Pitch.getHalfTone(),R=w===1&&G>oe,N=w===-1&&G0){let Me=3;const ve=O.Clef();switch(ve.ClefType){case Lt.F:Me=5;break;case Lt.C:Me=4;break}m=pt.fromHalftone(oe),n=[Zi.pitch(m,!0,ve,void 0,Me)[0]]}}break}O.sourceNote.Notehead&&O.sourceNote.Notehead.Shape===ti.SLASH&&(p=!0);const fe=O.vfpitch;if((H=(Q=fe[2])==null?void 0:Q.Parent)!=null&&H.Instructions)for(let de=0,W=fe[2].Parent.Instructions.length;dei.notes[fe].staffLine=O),(t.LedgerLineWidth||t.LedgerLineStrokeStyle)&&(b.ledgerLineStyle||(b.ledgerLineStyle={}),t.LedgerLineWidth&&(b.ledgerLineStyle.lineWidth=t.LedgerLineWidth),t.LedgerLineStrokeStyle&&(b.ledgerLineStyle.strokeStyle=t.LedgerLineStrokeStyle)),t.ColoringEnabled){const O=t.DefaultColorStem;let fe=i.parentVoiceEntry.StemColor;!fe&&O&&(fe=O);const de={fillStyle:fe,strokeStyle:fe};fe&&(b.setStemStyle(de),b.flag&&t.ColorFlags&&b.setFlagStyle(de))}if(b.x_shift=d,i.parentVoiceEntry.IsGrace&&i.notes[0].sourceNote.NoteBeam&&(i.parentVoiceEntry.WantedStemDirection=i.notes[0].sourceNote.NoteBeam.Notes[0].ParentVoiceEntry.WantedStemDirection),i.parentVoiceEntry){let O=i.parentVoiceEntry.WantedStemDirection;const fe=((le=window.GYM)==null?void 0:le.stemDirectionNote)||[],de=fe==null?void 0:fe.find(W=>W.id===i.notes[0].sourceNote.NoteToGraphicalNoteObjectId);switch(de&&typeof(de==null?void 0:de.direction)=="number"&&(O=de.direction),O){case rt.Up:b.setStemDirection(_e.Stem.UP),i.parentVoiceEntry.StemDirection=rt.Up;break;case rt.Down:b.setStemDirection(_e.Stem.DOWN),i.parentVoiceEntry.StemDirection=rt.Down;break}}for(let O=0,fe=e.length;O0&&W==="single"){const se=new _e.Tremolo(de);se.extra_stroke_scale=t.TremoloStrokeScale,se.y_spacing_scale=t.TremoloYSpacingScale,b&&b.duration==="w"&&b.stem.setExtension(-9),b.addModifier(O,se)}if(de>0&&W==="start"&&this.noteTremoloList.push(b),de>0&&W==="stop"){this.noteTremoloList.push(b);const se=new _e.Tremolo(de,[...this.noteTremoloList]);se.extra_stroke_scale=1.2,se.y_spacing_scale=1.2,se.x_shift=-30,b.addModifier(O,se),this.noteTremoloList=[]}this.glissandoList.length&&(b.setVibrato(this.glissandoList[0].vfnote[0]),this.glissandoList=[]),e[O].sourceNote.glissandoType==="start"&&this.glissandoList.push(e[O])}if(this.slideNote){try{b.setSlideNote(this.slideNote)}catch(O){console.error(O)}this.slideNote=null}if(i.notes[0].sourceNote.slideType==="start"&&(this.slideNote=b),v.Length.RealValue===.25&&v.Notehead&&v.Notehead.Filled===!1){const O=b.getKeyProps();for(let fe=0;fe1){let O=b.getKeyProps().filter(de=>!de.code&&de.line>3);!((X=window.GYM)==null?void 0:X.stemDirectionNote)&&O.length===n.length&&b.setStemDirection(-1)}t.DYMusicScoreType==="jianpu"&&window&&window.sett&&window.sett.keySignature&&b.addAccidental(0,new _e.Accidental("#"));try{const O=["b","#","§","º","X"],fe={b:"b","#":"#","§":"n",º:"bb",X:"##"};for(const de of e){const W=de.sourceNote.voiceEntry.Timestamp;for(const se of de.sourceNote.SourceMeasure.StaffLinkedExpressions)for(const he of se){const oe=re.Equal(W,he.Timestamp),Me=he.EntriesList.map(ve=>ve.label).filter(ve=>O.includes(ve)).map(ve=>fe[ve]);if(oe){for(const ve of Me)ve&&b.addAnnotation(0,new _e.Annotation(ve));break}}}}catch(O){}return b}static generateArticulations(i,e,t){var s,n,r,o,a,l;if(!(!i||i.getAttribute("type")==="GhostNote"))for(const u of e){let h=_e.Modifier.Position.ABOVE;i.getStemDirection()===_e.Stem.UP&&(h=_e.Modifier.Position.BELOW);let c;const f=u.articulationEnum;switch(t.ArticulationPlacementFromXML&&(u.placement===ue.Above?h=_e.Modifier.Position.ABOVE:u.placement===ue.Below&&(h=_e.Modifier.Position.BELOW)),f){case et.accent:{c=new _e.Articulation("a>");break}case et.downbow:{c=new _e.Articulation("am"),u.placement===void 0&&(h=_e.Modifier.Position.ABOVE);break}case et.fermata:{c=new _e.Articulation("a@a"),h=_e.Modifier.Position.ABOVE;break}case et.marcatodown:{c=new _e.Articulation("a|");break}case et.marcatoup:{c=new _e.Articulation("a^");break}case et.invertedfermata:{c=new _e.Articulation("a@u"),h=_e.Modifier.Position.BELOW;break}case et.lefthandpizzicato:{c=new _e.Articulation("a+");break}case et.naturalharmonic:{c=new _e.Articulation("ah");break}case et.snappizzicato:{c=new _e.Articulation("ao");break}case et.staccatissimo:{c=new _e.Articulation("av");break}case et.staccato:{c=new _e.Articulation("a.");break}case et.tenuto:{c=new _e.Articulation("a-");break}case et.upbow:{c=new _e.Articulation("a|"),u.placement===void 0&&(h=_e.Modifier.Position.ABOVE);break}case et.strongaccent:{c=new _e.Articulation("a^");break}}c&&(!i.hasStem()&&!i.isRest()&&f==et.accent&&i.getLineNumber()>=3&&(h=_e.Modifier.Position.ABOVE,(n=(s=i==null?void 0:i.modifiers)==null?void 0:s.filter(g=>["TREMOLO"].includes(g.getCategory().toLocaleUpperCase())))!=null&&n.length&&c.setYShift(-16)),f===et.strongaccent&&(h=_e.Modifier.Position.ABOVE,(r=window.GYM)!=null&&r.customArtPosition&&(i.getStemDirection()===1?h=_e.Modifier.Position.ABOVE:(h=_e.Modifier.Position.BELOW,c=new _e.Articulation("a|")))),(o=window.GYM)!=null&&o.customAccentItem&&f===et.accent&&(h=_e.Modifier.Position.ABOVE),(a=window.GYM)!=null&&a.customLefthandpizzicatoItem&&(f===et.lefthandpizzicato||f===et.naturalharmonic)&&(h=_e.Modifier.Position.ABOVE),f===et.tenuto&&i.getDuration()==="w"&&((l=window.GYM)!=null&&l.customTenutoItem)&&(h=_e.Modifier.Position.ABOVE),c.setPosition(h),i.addModifier(0,c))}}static generateOrnaments(i,e){let t=_e.Modifier.Position.ABOVE;e.placement===ue.Below&&(t=_e.Modifier.Position.BELOW);let s;switch(e.GetOrnament){case Mi.DelayedInvertedTurn:{s=new _e.Ornament("turn_inverted"),s.setDelayed(!0);break}case Mi.DelayedTurn:{s=new _e.Ornament("turn"),s.setDelayed(!0);break}case Mi.InvertedMordent:{s=new _e.Ornament("mordent"),s.setDelayed(!1);break}case Mi.InvertedTurn:{s=new _e.Ornament("turn_inverted"),s.setDelayed(!1);break}case Mi.Mordent:{s=new _e.Ornament("mordent_inverted"),s.setDelayed(!1);break}case Mi.Trill:{s=new _e.Ornament("tr"),s.setDelayed(!1);break}case Mi.Turn:{s=new _e.Ornament("turn"),s.setDelayed(!1);break}default:{ge.warn("unhandled OrnamentEnum type: "+e.GetOrnament);return}}s&&(e.AccidentalBelow!==ke.NONE&&s.setLowerAccidental(pt.accidentalVexflow(e.AccidentalBelow)),e.AccidentalAbove!==ke.NONE&&s.setUpperAccidental(pt.accidentalVexflow(e.AccidentalAbove)),s.setPosition(t),i.addModifier(0,s))}static StrokeTypeFromArpeggioType(i){switch(i){case vs.ARPEGGIO_DIRECTIONLESS:return _e.Stroke.Type.ARPEGGIO_DIRECTIONLESS;case vs.BRUSH_DOWN:return _e.Stroke.Type.BRUSH_UP;case vs.BRUSH_UP:return _e.Stroke.Type.BRUSH_DOWN;case vs.RASQUEDO_DOWN:return _e.Stroke.Type.RASQUEDO_UP;case vs.RASQUEDO_UP:return _e.Stroke.Type.RASQUEDO_DOWN;case vs.ROLL_DOWN:return _e.Stroke.Type.ROLL_UP;case vs.ROLL_UP:return _e.Stroke.Type.ROLL_DOWN;default:return _e.Stroke.Type.ARPEGGIO_DIRECTIONLESS}}static CreateTabNote(i){const e=[],t=i.notes.reverse(),s=[],n=i.notes[0].graphicalNoteLength,r=i.notes[0].sourceNote.NoteTuplet!==void 0;let o=Zi.durations(n,r)[0],a=0;for(const u of i.notes){const h=u.sourceNote,c={str:h.StringNumberTab,fret:h.FretNumber};e.push(c),h.BendArray&&h.BendArray.forEach(function(f){let d;const p=f.bendalter-c.fret;p>1?d="Full":p===1?d="1/2":d="1/4",f.direction==="up"?s.push({type:_e.Bend.UP,text:d,width:10}):s.push({type:_e.Bend.DOWN,text:d,width:10})}),a(i[i.VA8=0]="VA8",i[i.VB8=1]="VB8",i[i.MA15=2]="MA15",i[i.MB15=3]="MB15",i[i.NONE=4]="NONE",i))(Qi||{});class Rh extends er{constructor(e,t,s,n){super(t),this.label=e,this.staffNumber=s,this.parentMultiTempoExpression=n}get Label(){return this.label}set Label(e){this.label=e}get Placement(){return this.placement}set Placement(e){this.placement=e}get StaffNumber(){return this.staffNumber}set StaffNumber(e){this.staffNumber=e}get ParentMultiTempoExpression(){return this.parentMultiTempoExpression}static isStringInStringList(e,t){for(const s of e)if(Rh.stringContainsSeparatedWord(t.toLowerCase().trim(),s.toLowerCase().trim()))return!0;return!1}static stringContainsSeparatedWord(e,t){return e===t||e.indexOf(" "+t)!==-1||e.indexOf(t+" ")!==-1}}const Ae=class extends Rh{constructor(i,e,t,s,n,r=!1){super(i,e,t,n),this.setTempoAndTempoType(s)}static getDefaultValueForTempoType(i){switch(i){case 1:return 20;case 2:return 30;case 3:return 48;case 4:return 52;case 5:return 63;case 6:return 70;case 7:return 75;case 8:return 88;case 9:return 92;case 10:return 96;case 11:return 106;case 12:return 112;case 13:return 118;case 14:return 130;case 15:return 140;case 16:return 155;case 17:return 170;case 18:return 184;case 19:return 200;default:throw new zn("tempoEnum")}}static isInputStringInstantaneousTempo(i){return i?Ae.isStringInStringList(Ae.listInstantaneousTempoLarghissimo,i)||Ae.isStringInStringList(Ae.listInstantaneousTempoGrave,i)||Ae.isStringInStringList(Ae.listInstantaneousTempoLento,i)||Ae.isStringInStringList(Ae.listInstantaneousTempoLargo,i)||Ae.isStringInStringList(Ae.listInstantaneousTempoLarghetto,i)||Ae.isStringInStringList(Ae.listInstantaneousTempoAdagio,i)||Ae.isStringInStringList(Ae.listInstantaneousTempoAdagietto,i)||Ae.isStringInStringList(Ae.listInstantaneousTempoAndanteModerato,i)||Ae.isStringInStringList(Ae.listInstantaneousTempoAndante,i)||Ae.isStringInStringList(Ae.listInstantaneousTempoAndantino,i)||Ae.isStringInStringList(Ae.listInstantaneousTempoModerato,i)||Ae.isStringInStringList(Ae.listInstantaneousTempoAllegretto,i)||Ae.isStringInStringList(Ae.listInstantaneousTempoAllegroModerato,i)||Ae.isStringInStringList(Ae.listInstantaneousTempoAllegro,i)||Ae.isStringInStringList(Ae.listInstantaneousTempoVivace,i)||Ae.isStringInStringList(Ae.listInstantaneousTempoVivacissimo,i)||Ae.isStringInStringList(Ae.listInstantaneousTempoAllegrissimo,i)||Ae.isStringInStringList(Ae.listInstantaneousTempoPresto,i)||Ae.isStringInStringList(Ae.listInstantaneousTempoPrestissimo,i)||Ae.isStringInStringList(Ae.listInstantaneousTempoChangesGeneral,i):!1}get Label(){return this.label}set Label(i){this.label=i}get Placement(){return this.placement}set Placement(i){this.placement=i}get StaffNumber(){return this.staffNumber}set StaffNumber(i){this.staffNumber=i}get Enum(){return this.tempoEnum}get TempoInBpm(){return this.tempoInBpm}set TempoInBpm(i){this.tempoInBpm=i}get ParentMultiTempoExpression(){return this.parentMultiTempoExpression}getAbsoluteTimestamp(){return re.plus(this.ParentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.ParentMultiTempoExpression.Timestamp)}getAbsoluteFloatTimestamp(){return re.plus(this.ParentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.ParentMultiTempoExpression.Timestamp).RealValue}setTempoAndTempoType(i){if(!this.label){this.tempoInBpm=i,this.tempoEnum=23;return}if(Ae.isStringInStringList(Ae.listInstantaneousTempoLarghissimo,this.label)){i===0&&(i=Ae.getDefaultValueForTempoType(1)),this.tempoInBpm=i,this.tempoEnum=1;return}if(Ae.isStringInStringList(Ae.listInstantaneousTempoGrave,this.label)){i===0&&(i=Ae.getDefaultValueForTempoType(2)),this.tempoInBpm=i,this.tempoEnum=2;return}if(Ae.isStringInStringList(Ae.listInstantaneousTempoLento,this.label)){i===0&&(i=Ae.getDefaultValueForTempoType(3)),this.tempoInBpm=i,this.tempoEnum=3;return}if(Ae.isStringInStringList(Ae.listInstantaneousTempoLargo,this.label)){i===0&&(i=Ae.getDefaultValueForTempoType(4)),this.tempoInBpm=i,this.tempoEnum=4;return}if(Ae.isStringInStringList(Ae.listInstantaneousTempoLarghetto,this.label)){i===0&&(i=Ae.getDefaultValueForTempoType(5)),this.tempoInBpm=i,this.tempoEnum=5;return}if(Ae.isStringInStringList(Ae.listInstantaneousTempoAdagio,this.label)){i===0&&(i=Ae.getDefaultValueForTempoType(6)),this.tempoInBpm=i,this.tempoEnum=6;return}if(Ae.isStringInStringList(Ae.listInstantaneousTempoAdagietto,this.label)){i===0&&(i=Ae.getDefaultValueForTempoType(7)),this.tempoInBpm=i,this.tempoEnum=7;return}if(Ae.isStringInStringList(Ae.listInstantaneousTempoAndanteModerato,this.label)){i===0&&(i=Ae.getDefaultValueForTempoType(8)),this.tempoInBpm=i,this.tempoEnum=8;return}if(Ae.isStringInStringList(Ae.listInstantaneousTempoAndante,this.label)){i===0&&(i=Ae.getDefaultValueForTempoType(9)),this.tempoInBpm=i,this.tempoEnum=9;return}if(Ae.isStringInStringList(Ae.listInstantaneousTempoAndantino,this.label)){i===0&&(i=Ae.getDefaultValueForTempoType(10)),this.tempoInBpm=i,this.tempoEnum=10;return}if(Ae.isStringInStringList(Ae.listInstantaneousTempoModerato,this.label)){i===0&&(i=Ae.getDefaultValueForTempoType(11)),this.tempoInBpm=i,this.tempoEnum=11;return}if(Ae.isStringInStringList(Ae.listInstantaneousTempoAllegretto,this.label)){i===0&&(i=Ae.getDefaultValueForTempoType(12)),this.tempoInBpm=i,this.tempoEnum=12;return}if(Ae.isStringInStringList(Ae.listInstantaneousTempoAllegroModerato,this.label)){i===0&&(i=Ae.getDefaultValueForTempoType(13)),this.tempoInBpm=i,this.tempoEnum=13;return}if(Ae.isStringInStringList(Ae.listInstantaneousTempoAllegro,this.label)){i===0&&(i=Ae.getDefaultValueForTempoType(14)),this.tempoInBpm=i,this.tempoEnum=14;return}if(Ae.isStringInStringList(Ae.listInstantaneousTempoVivace,this.label)){i===0&&(i=Ae.getDefaultValueForTempoType(15)),this.tempoInBpm=i,this.tempoEnum=15;return}if(Ae.isStringInStringList(Ae.listInstantaneousTempoVivacissimo,this.label)){i===0&&(i=Ae.getDefaultValueForTempoType(16)),this.tempoInBpm=i,this.tempoEnum=16;return}if(Ae.isStringInStringList(Ae.listInstantaneousTempoAllegrissimo,this.label)){i===0&&(i=Ae.getDefaultValueForTempoType(17)),this.tempoInBpm=i,this.tempoEnum=17;return}if(Ae.isStringInStringList(Ae.listInstantaneousTempoPresto,this.label)){i===0&&(i=Ae.getDefaultValueForTempoType(18)),this.tempoInBpm=i,this.tempoEnum=18;return}if(Ae.isStringInStringList(Ae.listInstantaneousTempoPrestissimo,this.label)){i===0&&(i=Ae.getDefaultValueForTempoType(19)),this.tempoInBpm=i,this.tempoEnum=19;return}if(Ae.isStringInStringList(Ae.listInstantaneousTempoAddons,this.label)){this.tempoInBpm=0,this.tempoEnum=21;return}if(Ae.isStringInStringList(Ae.listInstantaneousTempoChangesGeneral,this.label)){this.tempoInBpm=0,this.tempoEnum=22;return}}};let bt=Ae;bt.listInstantaneousTempoLarghissimo=["Larghissimo","Sehr breit","very, very slow"];bt.listInstantaneousTempoGrave=["Grave","Schwer","slow and solemn"];bt.listInstantaneousTempoLento=["Lento","Lent","Langsam","slowly"];bt.listInstantaneousTempoLargo=["Largo","Breit","broadly"];bt.listInstantaneousTempoLarghetto=["Larghetto","Etwas breit","rather broadly"];bt.listInstantaneousTempoAdagio=["Adagio","Langsam","Ruhig","slow and stately"];bt.listInstantaneousTempoAdagietto=["Adagietto","Ziemlich ruhig","Ziemlich langsam","rather slow"];bt.listInstantaneousTempoAndanteModerato=["Andante moderato"];bt.listInstantaneousTempoAndante=["Andante","Gehend","Schreitend","at a walking pace"];bt.listInstantaneousTempoAndantino=["Andantino"];bt.listInstantaneousTempoModerato=["Moderato","Mäßig","Mod�r�","moderately"];bt.listInstantaneousTempoAllegretto=["Allegretto","fast"];bt.listInstantaneousTempoAllegroModerato=["Allegro moderato"];bt.listInstantaneousTempoAllegro=["Allegro","Rapide","Vite","Rasch","Schnell","Fr�hlich"];bt.listInstantaneousTempoVivace=["Vivace","Lebhaft","Lebendig","lively and fast"];bt.listInstantaneousTempoVivacissimo=["Vivacissimo","Sehr lebhaft","Sehr lebendig"];bt.listInstantaneousTempoAllegrissimo=["Allegrissimo","very fast"];bt.listInstantaneousTempoPresto=["Presto","Sehr schnell","Geschwind"];bt.listInstantaneousTempoPrestissimo=["Prestissimo","äußerst schnell"];bt.listInstantaneousTempoChangesGeneral=["tempo primo","a tempo","tempo i","rubato","doppio movimento"];bt.listInstantaneousTempoAddons=["assai","amoroso","cantabile","con brio","con dolore","con espressione","con fuoco","con moto","con spirito","spiritoso","espressivo","giocoso","giusto","grazioso","lesto","lugubre","maestoso","ma non troppo","marcato","molto","morendo","mosso","non tanto","piu","un poco","poco","quasi","risoluto","scherzando","sostenuto","teneramente","tempo giusto","tranquillo","sehr","lieblich","liebevoll","mit Leidenschaft","mit Liebe","amourös","gesanglich","mit Schwung","mit Feuer","mit Schmerz","mit Ausdruck","mit Bewegung","geistvoll","ausdrucksvoll","freudig","verspielt","angemessen","graziös","mit Grazie","flink","behände","traurig","klagend","majestätisch","aber nicht zu sehr","markant","gemäßigt","viel","sehr","ersterbend","bewegt","nicht zu sehr","mehr","ein wenig","gleichsam","entschlossen","zupackend","heiter","nachdrücklich","getragen","gewichtig","zart","zärtlich","im angemessenen Zeitmaß","ruhig","ein wenig","alla marcia","ad libitum","alla breve"];var Nh=(i=>(i[i.none=0]="none",i[i.larghissimo=1]="larghissimo",i[i.grave=2]="grave",i[i.lento=3]="lento",i[i.largo=4]="largo",i[i.larghetto=5]="larghetto",i[i.adagio=6]="adagio",i[i.adagietto=7]="adagietto",i[i.andanteModerato=8]="andanteModerato",i[i.andante=9]="andante",i[i.andantino=10]="andantino",i[i.moderato=11]="moderato",i[i.allegretto=12]="allegretto",i[i.allegroModerato=13]="allegroModerato",i[i.allegro=14]="allegro",i[i.vivace=15]="vivace",i[i.vivacissimo=16]="vivacissimo",i[i.allegrissimo=17]="allegrissimo",i[i.presto=18]="presto",i[i.prestissimo=19]="prestissimo",i[i.lastRealTempo=20]="lastRealTempo",i[i.addon=21]="addon",i[i.changes=22]="changes",i[i.metronomeMark=23]="metronomeMark",i))(Nh||{});const pe=class extends er{constructor(i,e,t){super(e),this.label=i,this.staffNumber=t,this.setMoodType()}static isInputStringMood(i){return i?pe.isStringInStringList(pe.listMoodAffettuoso,i)||pe.isStringInStringList(pe.listMoodAgitato,i)||pe.isStringInStringList(pe.listMoodAnimato,i)||pe.isStringInStringList(pe.listMoodAppassionato,i)||pe.isStringInStringList(pe.listMoodBrillante,i)||pe.isStringInStringList(pe.listMoodCantabile,i)||pe.isStringInStringList(pe.listMoodDolce,i)||pe.isStringInStringList(pe.listMoodEnergico,i)||pe.isStringInStringList(pe.listMoodEroico,i)||pe.isStringInStringList(pe.listMoodEspressivo,i)||pe.isStringInStringList(pe.listMoodFurioso,i)||pe.isStringInStringList(pe.listMoodGiocoso,i)||pe.isStringInStringList(pe.listMoodGioioso,i)||pe.isStringInStringList(pe.listMoodGrandioso,i)||pe.isStringInStringList(pe.listMoodGrazioso,i)||pe.isStringInStringList(pe.listMoodLacrimoso,i)||pe.isStringInStringList(pe.listMoodLeggiero,i)||pe.isStringInStringList(pe.listMoodMaestoso,i)||pe.isStringInStringList(pe.listMoodMalinconico,i)||pe.isStringInStringList(pe.listMoodMarcato,i)||pe.isStringInStringList(pe.listMoodMarziale,i)||pe.isStringInStringList(pe.listMoodMesto,i)||pe.isStringInStringList(pe.listMoodMorendo,i)||pe.isStringInStringList(pe.listMoodNobilmente,i)||pe.isStringInStringList(pe.listMoodPatetico,i)||pe.isStringInStringList(pe.listMoodPesante,i)||pe.isStringInStringList(pe.listMoodSaltando,i)||pe.isStringInStringList(pe.listMoodSautille,i)||pe.isStringInStringList(pe.listMoodScherzando,i)||pe.isStringInStringList(pe.listMoodSostenuto,i)||pe.isStringInStringList(pe.listMoodSpiccato,i)||pe.isStringInStringList(pe.listMoodTenerezza,i)||pe.isStringInStringList(pe.listMoodTranquillamente,i)||pe.isStringInStringList(pe.listMoodTrionfante,i):!1}get Label(){return this.label}set Label(i){this.label=i}get Mood(){return this.moodType}set Mood(i){this.moodType=i}get StaffNumber(){return this.staffNumber}set StaffNumber(i){this.staffNumber=i}get Placement(){return this.placement}set Placement(i){this.placement=i}setMoodType(){pe.isStringInStringList(pe.listMoodAffettuoso,this.label)?this.moodType=0:pe.isStringInStringList(pe.listMoodAgitato,this.label)?this.moodType=1:pe.isStringInStringList(pe.listMoodAnimato,this.label)?this.moodType=3:pe.isStringInStringList(pe.listMoodAppassionato,this.label)?this.moodType=2:pe.isStringInStringList(pe.listMoodBrillante,this.label)?this.moodType=4:pe.isStringInStringList(pe.listMoodCantabile,this.label)?this.moodType=5:pe.isStringInStringList(pe.listMoodDolce,this.label)?this.moodType=6:pe.isStringInStringList(pe.listMoodEnergico,this.label)?this.moodType=7:pe.isStringInStringList(pe.listMoodEroico,this.label)?this.moodType=8:pe.isStringInStringList(pe.listMoodEspressivo,this.label)?this.moodType=9:pe.isStringInStringList(pe.listMoodFurioso,this.label)?this.moodType=10:pe.isStringInStringList(pe.listMoodGiocoso,this.label)?this.moodType=11:pe.isStringInStringList(pe.listMoodGioioso,this.label)?this.moodType=12:pe.isStringInStringList(pe.listMoodGrandioso,this.label)?this.moodType=14:pe.isStringInStringList(pe.listMoodGrazioso,this.label)?this.moodType=15:pe.isStringInStringList(pe.listMoodLacrimoso,this.label)?this.moodType=13:pe.isStringInStringList(pe.listMoodLeggiero,this.label)?this.moodType=16:pe.isStringInStringList(pe.listMoodMaestoso,this.label)?this.moodType=17:pe.isStringInStringList(pe.listMoodMalinconico,this.label)?this.moodType=18:pe.isStringInStringList(pe.listMoodMarcato,this.label)?this.moodType=19:pe.isStringInStringList(pe.listMoodMarziale,this.label)?this.moodType=20:pe.isStringInStringList(pe.listMoodMesto,this.label)?this.moodType=21:pe.isStringInStringList(pe.listMoodMorendo,this.label)?this.moodType=22:pe.isStringInStringList(pe.listMoodNobilmente,this.label)?this.moodType=23:pe.isStringInStringList(pe.listMoodPatetico,this.label)?this.moodType=24:pe.isStringInStringList(pe.listMoodPesante,this.label)?this.moodType=25:pe.isStringInStringList(pe.listMoodSaltando,this.label)?this.moodType=27:pe.isStringInStringList(pe.listMoodSautille,this.label)?this.moodType=26:pe.isStringInStringList(pe.listMoodScherzando,this.label)?this.moodType=28:pe.isStringInStringList(pe.listMoodSostenuto,this.label)?this.moodType=29:pe.isStringInStringList(pe.listMoodSpiccato,this.label)?this.moodType=30:pe.isStringInStringList(pe.listMoodTenerezza,this.label)?this.moodType=31:pe.isStringInStringList(pe.listMoodTranquillamente,this.label)?this.moodType=32:pe.isStringInStringList(pe.listMoodTrionfante,this.label)&&(this.moodType=33)}};let Ze=pe;Ze.listMoodAffettuoso=["affettuoso"];Ze.listMoodAgitato=["agitato"];Ze.listMoodAppassionato=["appassionato"];Ze.listMoodAnimato=["animato","lively"];Ze.listMoodBrillante=["brillante"];Ze.listMoodCantabile=["cantabile"];Ze.listMoodDolce=["dolce"];Ze.listMoodEnergico=["energico"];Ze.listMoodEroico=["eroico"];Ze.listMoodEspressivo=["espressivo"];Ze.listMoodFurioso=["furioso"];Ze.listMoodGiocoso=["giocoso"];Ze.listMoodGioioso=["gioioso"];Ze.listMoodLacrimoso=["lacrimoso"];Ze.listMoodGrandioso=["grandioso"];Ze.listMoodGrazioso=["grazioso"];Ze.listMoodLeggiero=["leggiero"];Ze.listMoodMaestoso=["maestoso"];Ze.listMoodMalinconico=["malinconico"];Ze.listMoodMarcato=["marcato"];Ze.listMoodMarziale=["marziale"];Ze.listMoodMesto=["mesto"];Ze.listMoodMorendo=["morendo"];Ze.listMoodNobilmente=["nobilmente"];Ze.listMoodPatetico=["patetico"];Ze.listMoodPesante=["pesante"];Ze.listMoodSautille=["sautille"];Ze.listMoodSaltando=["saltando"];Ze.listMoodScherzando=["scherzando"];Ze.listMoodSostenuto=["sostenuto"];Ze.listMoodSpiccato=["spiccato"];Ze.listMoodTenerezza=["tenerezza"];Ze.listMoodTranquillamente=["tranquillamente"];Ze.listMoodTrionfante=["trionfante"];class Ho extends er{constructor(e,t,s,n){super(t),this.label=e,this.staffNumber=n,s===void 0&&(s=Oe.LeftBottom),this.textAlignment=s}get Label(){return this.label}get Placement(){return this.placement}set Placement(e){this.placement=e}get StaffNumber(){return this.staffNumber}set StaffNumber(e){this.staffNumber=e}get TextAlignment(){return this.textAlignment}}class TM{constructor(e,t){this.unknownList=[],this.moodList=[],this.expressions=[],this.sourceMeasure=e,this.timestamp=t}get SourceMeasureParent(){return this.sourceMeasure}set SourceMeasureParent(e){this.sourceMeasure=e}get StaffNumber(){return this.staffNumber}set StaffNumber(e){this.staffNumber=e}get Timestamp(){return this.timestamp}set Timestamp(e){this.timestamp=e}get AbsoluteTimestamp(){return re.plus(this.timestamp,this.sourceMeasure.AbsoluteTimestamp)}get InstantaneousDynamic(){return this.instantaneousDynamic}set InstantaneousDynamic(e){this.instantaneousDynamic=e}get EndingContinuousDynamic(){return this.endingContinuousDynamic}set EndingContinuousDynamic(e){this.endingContinuousDynamic=e}get StartingContinuousDynamic(){return this.startingContinuousDynamic}set StartingContinuousDynamic(e){this.startingContinuousDynamic=e}get MoodList(){return this.moodList}get UnknownList(){return this.unknownList}get EntriesList(){return this.expressions}get OctaveShiftStart(){return this.octaveShiftStart}set OctaveShiftStart(e){this.octaveShiftStart=e}get OctaveShiftEnd(){return this.octaveShiftEnd}set OctaveShiftEnd(e){this.octaveShiftEnd=e}get CombinedExpressionsText(){return this.combinedExpressionsText}set CombinedExpressionsText(e){this.combinedExpressionsText=e}getPlacementOfFirstEntry(){let e=ue.Above;return this.expressions.length>0&&(this.expressions[0].expression instanceof Zn?e=this.expressions[0].expression.Placement:this.expressions[0].expression instanceof xs?e=this.expressions[0].expression.Placement:this.expressions[0].expression instanceof Ze?e=this.expressions[0].expression.Placement:this.expressions[0].expression instanceof Ho&&(e=this.expressions[0].expression.Placement)),e}getFontstyleOfFirstEntry(){var t;let e=Wt.Regular;return this.expressions.length>0&&(this.expressions[0].expression instanceof xs||this.expressions[0].expression instanceof Ze?e=Wt.Italic:this.expressions[0].expression instanceof Ho&&(e=(t=this.expressions[0].expression.fontStyle)!=null?t:Wt.Regular)),e}addExpression(e,t){e instanceof Zn?(this.instantaneousDynamic&&this.removeExpressionFromEntryList(this.InstantaneousDynamic),this.instantaneousDynamic=e,this.instantaneousDynamic.ParentMultiExpression=this):e instanceof xs?this.startingContinuousDynamic=e:e instanceof Ze?this.moodList.push(e):e instanceof Ho&&this.unknownList.push(e),this.addExpressionToEntryList(e,t)}CompareTo(e){return this.Timestamp.RealValue>e.Timestamp.RealValue?1:this.Timestamp.RealValue=5&&i<=12}get TempoType(){return this.tempoType}set TempoType(i){this.tempoType=i}get StartTempo(){return this.startTempo}set StartTempo(i){this.startTempo=i}get EndTempo(){return this.endTempo}set EndTempo(i){this.endTempo=i}get AbsoluteEndTimestamp(){return this.absoluteEndTimestamp}set AbsoluteEndTimestamp(i){this.absoluteEndTimestamp=i}get AbsoluteTimestamp(){return this.ParentMultiTempoExpression.AbsoluteTimestamp}getAbsoluteFloatTimestamp(){return this.ParentMultiTempoExpression.AbsoluteTimestamp.RealValue}getInterpolatedTempo(i){const e=re.plus(this.parentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.parentMultiTempoExpression.Timestamp);if(i.lt(e))return-1;if(this.absoluteEndTimestamp.lt(i))return-2;const t=re.minus(i,e).RealValue/re.minus(this.absoluteEndTimestamp,e).RealValue;return Math.max(0,Math.min(250,this.startTempo+(this.endTempo-this.startTempo)*t))}setTempoType(){kn.isStringInStringList(kn.listContinuousTempoFaster,this.label)?this.tempoType=0:kn.isStringInStringList(kn.listContinuousTempoSlower,this.label)&&(this.tempoType=9)}};let Xn=kn;Xn.listContinuousTempoFaster=["accelerando","piu mosso","poco piu","stretto"];Xn.listContinuousTempoSlower=["poco meno","meno mosso","piu lento","rallentando","ritardando","ritenuto","ritard.","ritard","riten.","riten"];class BM{constructor(e,t){this.expressions=[],this.sourceMeasure=e,this.timestamp=t}get Timestamp(){return this.timestamp}get AbsoluteTimestamp(){return re.plus(this.sourceMeasure.AbsoluteTimestamp,this.timestamp)}get SourceMeasureParent(){return this.sourceMeasure}set SourceMeasureParent(e){this.sourceMeasure=e}get InstantaneousTempo(){return this.instantaneousTempo}get ContinuousTempo(){return this.continuousTempo}get EntriesList(){return this.expressions}get CombinedExpressionsText(){return this.combinedExpressionsText}set CombinedExpressionsText(e){this.combinedExpressionsText=e}getPlacementOfFirstEntry(){let e=ue.Above;return this.expressions.length>0&&(this.expressions[0].Expression instanceof bt?e=this.expressions[0].Expression.Placement:this.expressions[0].Expression instanceof Xn&&(e=this.expressions[0].Expression.Placement)),e}getFontstyleOfFirstEntry(){let e=Wt.Regular;return this.expressions[0].Expression instanceof bt?e=Wt.Bold:this.expressions[0].Expression instanceof Xn&&(e=Wt.Italic),e}addExpression(e,t){if(this.checkIfAlreadyExists(e))return;e instanceof bt?this.instantaneousTempo=e:e instanceof Xn&&(this.continuousTempo=e);const s=new IM;s.prefix=t,s.Expression=e,s.label=e.Label,this.expressions.push(s)}CompareTo(e){return this.Timestamp.RealValue>e.Timestamp.RealValue?1:this.Timestamp.RealValue0){if(this.rules.MaxSystemToDrawNumber===this.musicSystems.length)return this.finalizeCurrentSystem(this.measureList[this.measureList.length-1],!this.rules.StretchLastSystemLine,!1),this.musicSystems;this.finalizeCurrentAndCreateNewSystem(this.measureList[this.measureList.length-1],!this.rules.StretchLastSystemLine,!1)}return this.musicSystems}calculateSystemYLayout(){for(const e of this.musicSystems)this.optimizeDistanceBetweenStaffLines(e);this.calculateMusicSystemsRelativePositions()}setMeasureWidth(e,t,s,n){for(let r=0,o=e.length;r0&&(a.beginInstructionsWidth=s),n>0&&(a.endInstructionsWidth=n)}}finalizeCurrentAndCreateNewSystem(e,t=!1,s=!0,n=!1){this.finalizeCurrentSystem(e,t,s,n),this.currentSystemParams=new Eu,e!==void 0&&this.measureListIndex=1){const t=this.currentSystemParams.currentSystem.GraphicalMeasures[this.currentSystemParams.currentSystem.GraphicalMeasures.length-1];let s=0;const n=e[e.length-1];n.endLine===Ge.DotsBoldBoldDots&&(n.endLine=Ge.DotsThinBold,s=t[0].getLineWidth(Ge.DotsBoldBoldDots)/2-t[0].getLineWidth(Ge.DotsThinBold)),this.currentSystemParams.currentSystemFixWidth-=s;for(let r=0,o=t.length;r1){o=!0;break}}let a=0;for(let l=0;l=0&&this.measureList[P]){const M=(v=this.measureList[P][0])==null?void 0:v.parentSourceMeasure;M!=null&&M.ImplicitMeasure&&(M!=null&&M.RhythmPrinted)&&(S=!1)}S&&(t.addRhythmAtBegin(u),t.parentSourceMeasure.RhythmPrinted=u,d=!0)}return(c||f||d)&&(o+=t.beginInstructionsWidth,d&&(o+=this.rules.RhythmRightMargin)),o}addInstructionsAtMeasureEnd(e,t,s){if(!e||!e.Instructions||e.Instructions.length===0)return 0;for(let n=0,r=e.Instructions.length;n0&&(this.currentSystemParams.systemMeasures.push({beginLine:Ge.None,endLine:Ge.None}),this.currentSystemParams.currentWidth+=n,this.currentSystemParams.currentSystemFixWidth+=n)}addExtraInstructionMeasure(e,t,s){const n=this.currentSystemParams.currentSystem,r=Ue.symbolFactory.createExtraGraphicalMeasure(n.StaffLines[e]);t&&r.addKeyAtBegin(t,this.activeKeys[e],this.activeClefs[e]),s!==void 0&&s.PrintObject&&r.addRhythmAtBegin(s),r.PositionAndShape.BorderLeft=0,r.PositionAndShape.BorderTop=0,r.PositionAndShape.BorderBottom=this.rules.StaffHeight;const o=this.rules.MeasureLeftMargin+r.beginInstructionsWidth+this.rules.MeasureRightMargin;return r.PositionAndShape.BorderRight=o,n.StaffLines[e].Measures.push(r),o}addStaveMeasuresToSystem(e){if(e[0]){const t=[];for(let n=0;n1){const a=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,e.measureListIndex+e.multipleRestMeasures-1);e=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[a]}}finally{}const t=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures,s=t[this.measureListIndex];let n=!1;return s.allRests&&(n=(o=(r=t[this.measureListIndex+s.multipleRestMeasures-1])==null?void 0:r.endsWithLineRepetition)==null?void 0:o.call(r)),this.nextMeasureBeginsLineRepetition()&&this.thisMeasureEndsLineRepetition()?Ge.DotsBoldBoldDots:this.thisMeasureEndsLineRepetition()||n?Ge.DotsThinBold:this.nextMeasureHasKeyInstructionChange()||this.thisMeasureEndsWordRepetition()||this.nextMeasureBeginsWordRepetition()?Ge.DoubleThin:e&&e.endingBarStyleEnum!==void 0?e.endingBarStyleEnum:Ge.SingleThin}getLineWidth(e,t,s){let n=e.getLineWidth(t);return t===Ge.DotsBoldBoldDots&&(n/=2),s&&t===Ge.BoldThinDots&&(n+=this.rules.DistanceBetweenLastInstructionAndRepetitionBarline),n}previousMeasureEndsLineRepetition(){if(this.measureListIndex===0)return!1;for(let e=0,t=this.measureList[this.measureListIndex-1].length;e=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length||!this.measureList[e])return!1;for(let t=0,s=this.measureList[e].length;t=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length||e>this.measureList.length-1)return!1;for(let t=0,s=this.measureList[e].length;t1)for(let a=1;ar&&(r=h)}for(let a=0;athis.rules.PageHeight-this.rules.PageBottomMargin&&(n++,n<=4&&console.log(`warning: could not fit a single system on page ${e.PageNumber} and measure number ${s.GraphicalMeasures[0][0].MeasureNumber}. The PageFormat may be too small for this sheet." Will not give further warnings for all pages, only total.`))}else{const l=this.musicSystems[a-1],u=l.StaffLines[l.StaffLines.length-1],h=u.PositionAndShape;let c=this.findRequiredDistanceWithSkyBottomLine(l,s);c=Math.max(r,c),c+=this.rules.MinSkyBottomDistBetweenSystems,((o=window==null?void 0:window.appName)==null?void 0:o.toLocaleUpperCase())==="GYM"&&(c=c<16?16:c);const f=this.hasExpressionCounts(s);f.TempoCount>0&&this.rules.MetronomeMarksDrawn&&(c+=2),f.OtherCount>0&&this.rules.MetronomeMarksDrawn&&(c+=2),c=Math.max(c,this.rules.MinimumDistanceBetweenSystems+u.StaffHeight);const d=t+h.RelativePosition.y+c,p=d+s.PositionAndShape.BorderMarginBottom;if(!(this.rules.NewPageAtXMLNewPageAttribute&&l.breaksPage)&&p0&&console.log(`total amount of pages that couldn't fit a single music system: ${n} of ${e.PageNumber}`)}findRequiredDistanceWithSkyBottomLine(e,t){const s=e.StaffLines[e.StaffLines.length-1],n=t.StaffLines[0],r=s.BottomLine,o=n.SkyLine,a=s.PositionAndShape,l=n.PositionAndShape,u=1/this.rules.SamplingUnit;let h=0;for(let c=0;c=o.length)break;const p=Math.max(0,d-6),g=Math.min(o.length-1,d+6);let m=0;for(let y=p;y<=g;y++)m=Math.min(m,o[y]);const b=f-m;h=Math.max(b,h)}return h===0&&(h=a.BorderBottom-l.BorderTop),h}}class Eu{constructor(){this.systemMeasures=[],this.systemMeasureIndex=0,this.currentWidth=0,this.currentSystemFixWidth=0,this.currentSystemVarWidth=0,this.maxLabelLength=0}IsSystemStartMeasure(){return this.systemMeasureIndex===0}}class NM{constructor(e,t,s){this.getOpenOctaveShift=e,this.getAbsoluteStartTimestamp=t,this.getAbsoluteEndTimestamp=s}}class kM{constructor(){this.keySignatureNoteAlterationsDict=new cs,this.currentAlterationsComparedToKeyInstructionList=[],this.currentInMeasureNoteAlterationsDict=new cs}get ActiveKeyInstruction(){return this.activeKeyInstruction}set ActiveKeyInstruction(e){this.activeKeyInstruction=e,this.reactOnKeyInstructionChange()}doCalculationsAtEndOfMeasure(){this.currentInMeasureNoteAlterationsDict.clear(),this.currentAlterationsComparedToKeyInstructionList.clear();for(const e of this.keySignatureNoteAlterationsDict.keys())this.currentInMeasureNoteAlterationsDict.setValue(e,this.keySignatureNoteAlterationsDict.getValue(e))}checkAccidental(e,t){if(!t)return;const s=t.FundamentalNote+t.Octave*12,n=this.currentAlterationsComparedToKeyInstructionList.indexOf(s)>=0;if(this.currentInMeasureNoteAlterationsDict.containsKey(s)){if(n&&this.currentAlterationsComparedToKeyInstructionList.splice(this.currentAlterationsComparedToKeyInstructionList.indexOf(s),1),this.currentInMeasureNoteAlterationsDict.getValue(s)!==t.AccidentalHalfTones){this.keySignatureNoteAlterationsDict.containsKey(s)&&this.keySignatureNoteAlterationsDict.getValue(s)!==t.AccidentalHalfTones?(this.currentAlterationsComparedToKeyInstructionList.push(s),this.currentInMeasureNoteAlterationsDict.setValue(s,t.AccidentalHalfTones)):t.Accidental!==ke.NONE&&this.currentInMeasureNoteAlterationsDict.remove(s);const r=this.currentInMeasureNoteAlterationsDict.getValue(s);if(t.Accidental===ke.NONE&&(Math.abs(r)===.5?t=new pt(t.FundamentalNote,t.Octave,ke.NONE):t=new pt(t.FundamentalNote,t.Octave,ke.NATURAL)),this.isAlterAmbiguousAccidental(t.Accidental)&&!t.AccidentalXml)return;Ue.symbolFactory.addGraphicalAccidental(e,t)}}else if(t.Accidental!==ke.NONE){if(n||this.currentAlterationsComparedToKeyInstructionList.push(s),this.currentInMeasureNoteAlterationsDict.setValue(s,t.AccidentalHalfTones),this.isAlterAmbiguousAccidental(t.Accidental)&&!t.AccidentalXml)return;Ue.symbolFactory.addGraphicalAccidental(e,t)}else n&&(t=new pt(t.FundamentalNote,t.Octave,ke.NATURAL),this.currentAlterationsComparedToKeyInstructionList.splice(this.currentAlterationsComparedToKeyInstructionList.indexOf(s),1),Ue.symbolFactory.addGraphicalAccidental(e,t))}isAlterAmbiguousAccidental(e){return e===ke.SLASHFLAT||e===ke.QUARTERTONEFLAT}reactOnKeyInstructionChange(){const e=this.activeKeyInstruction.AlteratedNotes;let t;this.activeKeyInstruction.Key>0?t=ke.SHARP:t=ke.FLAT,this.keySignatureNoteAlterationsDict.clear(),this.currentAlterationsComparedToKeyInstructionList.length=0;for(let s=-9;s<9;s++)for(let n=0;n0?(s=h-1,e.push({startIndex:t,endIndex:s}),t=h):d.HasEndLine&&this.rules.NewPartAndSystemAfterFinalBarline&&(s=h,e.push({startIndex:t,endIndex:s}),t=h+1)}t0?Number(C):6,A===C||S+_>g&&A%2===0?(r.push(A),S=M,A=1):A++}else S>g?(r.push(A),S=M,A=1):A++;M>g?T=P+1:T=Math.ceil(T),y===T?v+=1:(n.push(v),y=T,v=1)}n.push(v),r.push(A),r=r.filter(Boolean),console.log(r,n)}return this.buildPreparedMusicSystems(r)}buildPreparedMusicSystems(e){let t=!1;this.currentSystemParams=new Eu,this.currentSystemParams.currentSystem=this.initMusicSystem();for(let s=0,n=this.measureList.length;s0&&this.rules.RenderMultipleRestMeasures){c.isReducedToMultiRest=!0,c.multipleRestMeasureNumber=1;const d=c.multipleRestMeasures-1;u+=d;for(let p=1;p<=d;p++){const g=e.SourceMeasures[c.MeasureNumber-1+p];g.multipleRestMeasureNumber=p+1,g.isReducedToMultiRest=!0,t.push([void 0])}}}if(this.rules.AutoGenerateMutipleRestMeasuresFromRestMeasures&&this.rules.RenderMultipleRestMeasures){let u,h=0;for(let c=0,f=e.SourceMeasures.length;c0){u.isReducedToMultiRest=!0,u.multipleRestMeasureNumber=1,h++,d.multipleRestMeasureNumber=h,d.isReducedToMultiRest=!0;for(let p=0;p1){u.multipleRestMeasures=h;const p=this.createGraphicalMeasuresForSourceMeasure(u,s,r,a,n);t[u.measureListIndex]=p,h=0,u=void 0}else h=0,u=void 0}if(h>1){u.multipleRestMeasures=h,u.isReducedToMultiRest=!0;const c=this.createGraphicalMeasuresForSourceMeasure(u,s,r,a,n);t[u.measureListIndex]=c,h=0,u=void 0}}const l=n.map(u=>u.ClefType===Lt.percussion);this.handleStaffEntries(l),this.calculateVerticalContainersList(),this.setIndicesToVerticalGraphicalContainers()}calculate(){this.musicSystems=[],this.clearSystemsAndMeasures(),this.clearRecreatedObjects(),this.createGraphicalTies(),this.calculateSheetLabelBoundingBoxes(),this.calculateXLayout(this.graphicalMusicSheet,this.maxInstrNameLabelLength()),this.graphicalMusicSheet.MusicPages.length=0,this.calculateMusicSystems(),a4.transformRelativeToAbsolutePosition(this.graphicalMusicSheet)}calculateXLayout(e,t){let s=0;const n=this.rules.MaxInstructionsConstValue;if(this.graphicalMusicSheet.MeasureList.length>0){let r=this.graphicalMusicSheet.MeasureList[0],o=this.calculateMeasureXLayout(r);o=this.calculateMeasureWidthFromStaffEntries(r,o),Ue.setMeasuresMinStaffEntriesWidth(r,o),s=o*1.2+t+n;for(let a=1;a0)return;const o=t.Measures[r];(o.MeasureNumber===0||o.MeasureNumber===1)&&(s=o.MeasureNumber),o!==t.Measures[0]&&this.rules.MeasureNumberLabelXOffset?n=this.rules.MeasureNumberLabelXOffset:n=0;const a=this.rules.UseXMLMeasureNumbers&&o.MeasureNumber===1&&o.parentSourceMeasure.getPrintedMeasureNumber()!==1;((o.MeasureNumber===s||o.MeasureNumber>=s+this.rules.MeasureNumberLabelOffset)&&!o.parentSourceMeasure.ImplicitMeasure||a)&&((o.MeasureNumber!==1||o.MeasureNumber===1&&o!==t.Measures[0]||a)&&this.calculateSingleMeasureNumberPlacement(o,t,e,n),s=o.MeasureNumber)}}calculateSingleMeasureNumberPlacement(e,t,s,n=0){const r=e.parentSourceMeasure.getPrintedMeasureNumber().toString(),o=new ft(r),a=new ei(o,this.rules.MeasureNumberLabelHeight,Oe.LeftBottom,this.rules),l=t.SkyBottomLineCalculator;a.setLabelPositionAndShapeBorders(),a.PositionAndShape.Parent=s.PositionAndShape;const u=t.PositionAndShape.RelativePosition.x+e.PositionAndShape.RelativePosition.x-a.PositionAndShape.BorderMarginLeft+n;let h,c=u,f=u-a.PositionAndShape.BorderLeft+a.PositionAndShape.BorderRight;c-=t.PositionAndShape.RelativePosition.x,f-=t.PositionAndShape.RelativePosition.x;const d=c+.5,p=f-.5,g=l.getSkyLineMinInRange(d,p);if(e===t.Measures[0]){let m=0;if(s.GroupBrackets.length>0)for(const b of s.GroupBrackets)m=Math.min(m,b.PositionAndShape.BorderTop);h=Math.min(g,m)}else h=g;h=Math.min(0,h),a.PositionAndShape.RelativePosition=new te(u,h),s.MeasureNumberLabels.push(a)}calculateMeasureNumberSkyline(e){const t=e.StaffLines[0];for(const s of e.MeasureNumberLabels){let n=s.PositionAndShape.RelativePosition.x,r=n-s.PositionAndShape.BorderLeft+s.PositionAndShape.BorderRight;n-=t.PositionAndShape.RelativePosition.x,r-=t.PositionAndShape.RelativePosition.x,t.SkyBottomLineCalculator.updateSkyLineInRange(n,r,s.PositionAndShape.RelativePosition.y+s.PositionAndShape.BorderMarginTop)}}layoutGraphicalTie(e,t,s){throw new Error(this.abstractNotImplementedErrorMessage)}calculateSingleStaffLineLyricsPosition(e,t){let s=0,n=this.rules.StaffHeight;const r=[],o=e.SkyBottomLineCalculator;let a=e.Measures.length;for(let u=0;u0){r.push(p),s=Math.max(s,p.LyricsEntries.length);const g=p.PositionAndShape.RelativePosition.x+c.x;let m=Number.MAX_VALUE,b=Number.MIN_VALUE;for(let v=0;v0){const u=e.PositionAndShape.Size.width;let h=r[0].PositionAndShape.RelativePosition.x+r[0].PositionAndShape.BorderMarginLeft+r[0].parentMeasure.PositionAndShape.RelativePosition.x;h=h>u?u:h,o.updateBottomLineInRange(h,u,l)}return r}calculateLyricsExtendsAndDashes(e){for(let t=0,s=e.length;t0||e.UnknownList.length>0){let l="";for(let d=0,p=e.EntriesList.length;de.length-1&&(ge.debug("minimum measure to draw index out of range. resetting min measure index to limit."),this.rules.MinMeasureToDrawIndex=e.length-1);const t=[];for(let o=this.rules.MinMeasureToDrawIndex,a=e.length;o0)&&(n=s.getSkyLineMinInRange(c,f));let d=0;a===0?(d+=this.rules.ChordSymbolYOffset,d+=.1):d+=this.rules.ChordSymbolYPadding,d*=-1;const p=l.GraphicalLabel;p.PositionAndShape.RelativePosition.y=n+d,p.setLabelPositionAndShapeBorders(),p.PositionAndShape.calculateBoundingBox(),s.updateSkyLineInRange(c,f,n+p.PositionAndShape.BorderMarginTop)}}}}calculateAlignedChordSymbolsOffset(e,t){let s=Number.MAX_SAFE_INTEGER;for(const n of e)for(const r of n.graphicalChordContainers){const o=n.PositionAndShape,a=r.PositionAndShape,l=a.BorderMarginLeft+o.AbsolutePosition.x,u=a.BorderMarginRight+o.AbsolutePosition.x;s=Math.min(s,t.getSkyLineMinInRange(l,u))}return s}layoutMeasureWithWholeRest(e,t,s){}layoutBeams(e){}layoutArticulationMarks(e,t,s){}layoutOrnament(e,t,s){}calculateRestNotePlacementWithinGraphicalBeam(e,t,s,n,r){}calculateTupletNumbers(){}calculateSlurs(){}calculateDynamicExpressionsForMultiExpression(e,t,s){}calculateGraphicalVerbalContinuousDynamic(e,t){const s=e.Label,n=t.x+s.PositionAndShape.BorderMarginLeft,r=t.x+s.PositionAndShape.BorderMarginRight,o=e.ContinuousDynamic.Placement,l=e.ParentStaffLine.SkyBottomLineCalculator;let u;o===ue.Below?(u=l.getBottomLineMaxInRange(n,r),s.PositionAndShape.RelativePosition=new te(t.x,u-s.PositionAndShape.BorderMarginTop)):(u=l.getSkyLineMinInRange(n,r),s.PositionAndShape.RelativePosition=new te(t.x,u-s.PositionAndShape.BorderMarginBottom))}calculateGraphicalContinuousDynamic(e,t){var E,k,Q;const s=e.ParentStaffLine.ParentStaff.idInMusicSheet,n=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(e.ContinuousDynamic.EndMultiExpression.SourceMeasureParent,s);if(!n){ge.warn("MusicSheetCalculator.calculateGraphicalContinuousDynamic: No endMeasure found");return}e.EndMeasure=n;const r=e.ParentStaffLine,o=n.ParentStaffLine,a=o&&r===o;let l=!1;o?l=o==null?void 0:o.isPartOfMultiStaffInstrument():r&&(l=r==null?void 0:r.isPartOfMultiStaffInstrument());const u=re.createFromFraction(e.ContinuousDynamic.EndMultiExpression.AbsoluteTimestamp),h=this.graphicalMusicSheet.GetVerticalContainerFromTimestamp(u),c=h.getFirstNonNullStaffEntry().parentMeasure,f=c.PositionAndShape.AbsolutePosition.x+c.PositionAndShape.BorderRight;let d=new re(0,0,0);for(const H of h.StaffEntries){const Z=(E=H==null?void 0:H.sourceStaffEntry)==null?void 0:E.calculateMaxNoteLength();Z!=null&&Z.gt(d)&&(d=Z)}const p=this.getRelativePositionInStaffLineFromTimestamp(u,s,o,l,0),g=re.plus(u,d),m=this.getRelativePositionInStaffLineFromTimestamp(g,s,o,l,0);m.x>p.x&&m.xv){const le=y.StaffLines[H].PositionAndShape.RelativePosition.y-r.PositionAndShape.RelativePosition.y-this.rules.StaffHeight;C=this.rules.StaffHeight+le/2}else C=this.rules.WedgePlacementBelowY;C-=this.rules.WedgeOpeningLength/2,a||(L=C);let Z=S.getBottomLineMaxInRange(M,T);if(Z>C&&(C=Z),vL&&(L=Z),L+=this.rules.WedgeOpeningLength/2,L+=this.rules.WedgeVerticalMargin),C+=this.rules.WedgeOpeningLength/2,C+=this.rules.WedgeVerticalMargin}else if(A===ue.Above){if(r.ParentStaff.ParentInstrument.Staves.length===1)C=this.rules.WedgePlacementAboveY;else{let Z=0;v>0&&(Z=v-1);const J=y.StaffLines[Z];C=-(r.PositionAndShape.RelativePosition.y-J.PositionAndShape.RelativePosition.y-this.rules.StaffHeight)/2}C+=this.rules.WedgeOpeningLength/2,a||(L=C);let H=S.getSkyLineMinInRange(M,T);if(H1&&v>0){const Z=r.findClosestStaffEntry(M),J=r.findClosestStaffEntry(T);Z&&J&&Z.parentVerticalContainer}a||(H=o.SkyBottomLineCalculator.getSkyLineMinInRange(_,D),H-c/2?l=-c/2:l=u-e.PositionAndShape.BorderMarginBottom}else l=u-e.PositionAndShape.BorderMarginBottom;e.PositionAndShape.RelativePosition=new te(t.x,l)}else if(e.Placement===ue.Below){const u=a.getBottomLineMaxInRange(r,o),h=n.ParentStaff.ParentInstrument.Staves[n.ParentStaff.ParentInstrument.Staves.length-1];if(n.isPartOfMultiStaffInstrument()&&n.ParentStaff!==h){const f=n.ParentMusicSystem.StaffLines[n.ParentMusicSystem.StaffLines.indexOf(n)+1].PositionAndShape.RelativePosition.y-n.PositionAndShape.RelativePosition.y-this.rules.StaffHeight,d=e.PositionAndShape.BorderMarginBottom;u+de.PositionAndShape.Size.width&&(f=e.PositionAndShape.Size.width-this.rules.MeasureRightMargin,c=f-u.PositionAndShape.MarginSize.width,t.x=c-u.PositionAndShape.BorderMarginLeft);let d;const p=e.SkyBottomLineCalculator;return r===ue.Below?d=p.getBottomLineMaxInRange(c,f):d=p.getSkyLineMinInRange(c,f),u.PositionAndShape.RelativePosition=new te(t.x,d),r===ue.Below?p.updateBottomLineInRange(c,f,u.PositionAndShape.BorderMarginBottom+d):p.updateSkyLineInRange(c,f,u.PositionAndShape.BorderMarginTop+d),u}calculateTempoExpressionsForMultiTempoExpression(e,t,s,n){xf={};const r=re.plus(e.AbsoluteTimestamp,t.Timestamp),o=this.graphicalMusicSheet.MeasureList[s];let a=new te;if(t.ContinuousTempo||t.InstantaneousTempo){if(this.rules.MinMeasureToDrawIndex>0||!o[0])return;let l=o[0].ParentStaffLine,u=o[0].PositionAndShape.RelativePosition.x,h=0;for(let c=0;c0){l=o[c].ParentStaffLine,u=o[c].PositionAndShape.RelativePosition.x,h=c;break}if(a=this.getRelativePositionInStaffLineFromTimestamp(r,h,l,l.isPartOfMultiStaffInstrument(),u),t.EntriesList.length>0&&t.EntriesList[0].Expression instanceof bt){const c=t.EntriesList[0].Expression;if(c.Placement=ue.Above,l.Measures[0].staffEntries.length>0&&Math.abs(a.x-l.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x)===0&&l.ParentMusicSystem===this.musicSystems[0]){const f=l.Measures[0].FirstInstructionStaffEntry;if(f){const d=f.GraphicalInstructions.last();a.x=d.PositionAndShape.RelativePosition.x}this.rules.CompactMode&&(a.x=l.PositionAndShape.RelativePosition.x+l.Measures[0].PositionAndShape.RelativePosition.x)}}for(const c of t.EntriesList){let f=Oe.CenterBottom;this.rules.CompactMode&&(f=Oe.LeftBottom);const d=this.calculateLabel(l,a,c.label,t.getFontstyleOfFirstEntry(),c.Expression.Placement,this.rules.UnknownTextHeight,f);if(c.Expression instanceof bt){for(const g of l.AbstractExpressions)g instanceof Rd&&(g.SourceExpression.Label,c.Expression.Label);new Rd(c.Expression,d).ParentStaffLine||ge.warn("Adding staffline didn't work"),c.Expression.Enum===Nh.metronomeMark&&(xf[s]=c.Expression)}else c.Expression instanceof Xn;if(n===e.TempoExpressions.length-1)for(const p of Object.values(xf))this.createMetronomeMark(p,s)}}}createMetronomeMark(e,t){throw new Error(this.abstractNotImplementedErrorMessage)}graphicalMeasureCreatedCalculations(e){}clearSystemsAndMeasures(){for(let e=0,t=this.graphicalMusicSheet.MusicPages.length;e-1&&f.PositionAndShape.ChildElements.splice(d,1),f.FirstInstructionStaffEntry=void 0,f.beginInstructionsWidth=0}if(f.LastInstructionStaffEntry){const d=f.PositionAndShape.ChildElements.indexOf(f.LastInstructionStaffEntry.PositionAndShape);d>-1&&f.PositionAndShape.ChildElements.splice(d,1),f.LastInstructionStaffEntry=void 0,f.endInstructionsWidth=0}}u.Measures=[],u.PositionAndShape.ChildElements=[]}o.StaffLines.length=0,o.PositionAndShape.ChildElements=[]}s.MusicSystems=[],s.PositionAndShape.ChildElements=[]}this.graphicalMusicSheet.MusicPages=[]}handleVoiceEntry(e,t,s,n,r,o,a,l,u,h=void 0,c=void 0){e.StemDirectionXml!==rt.Undefined&&this.rules.SetWantedStemDirectionByXml&&e.StemDirectionXml!==void 0?e.WantedStemDirection=e.StemDirectionXml:this.calculateStemDirectionFromVoices(e);const f=t.findOrCreateGraphicalVoiceEntry(e);f.octaveShiftValue=l;const d=t.tabStaffEntry;let p;d&&(p=d.findOrCreateGraphicalVoiceEntry(e));for(let g=0,m=e.Notes.length;g-1)continue;let y;if(e.IsGrace?y=Ue.symbolFactory.createGraceNote(b,f,r,this.rules,l):(y=Ue.symbolFactory.createNote(b,f,r,l,this.rules,void 0),Ue.stafflineNoteCalculator.trackNote(y)),b.Pitch&&this.checkNoteForAccidental(y,s,r,l),this.resetYPositionForLeadSheet(y.PositionAndShape),t.addGraphicalNoteToListAtCorrectYPosition(f,y),y.PositionAndShape.calculateBoundingBox(),this.leadSheet||(b.NoteBeam!==void 0&&b.PrintObject&&this.handleBeam(y,b.NoteBeam,a),b.NoteTuplet!==void 0&&b.PrintObject&&this.handleTuplet(y,b.NoteTuplet,o)),p){const v=Ue.symbolFactory.createNote(b,p,r,l,this.rules,void 0);d.addGraphicalNoteToListAtCorrectYPosition(p,v),v.PositionAndShape.calculateBoundingBox(),this.leadSheet||b.NoteTuplet&&this.handleTuplet(v,b.NoteTuplet,o)}}return e.Articulations.length>0&&this.handleVoiceEntryArticulations(e.Articulations,e,t),e.TechnicalInstructions.length>0&&this.handleVoiceEntryTechnicalInstructions(e.TechnicalInstructions,e,t),e.LyricsEntries.size()>0&&this.handleVoiceEntryLyrics(e,t,n),e.OrnamentContainer&&this.handleVoiceEntryOrnaments(e.OrnamentContainer,e,t),l}resetYPositionForLeadSheet(e){this.leadSheet&&(e.RelativePosition=new te(e.RelativePosition.x,0))}layoutVoiceEntries(e,t){if(e.PositionAndShape.RelativePosition=new te(0,0),!this.leadSheet)for(const s of e.graphicalVoiceEntries){const n=s.notes;if(n.length===0)continue;const r=n[0].sourceNote.ParentVoiceEntry,o=n[0].sourceNote.Pitch!==void 0;this.layoutVoiceEntry(r,n,e,o)}}maxInstrNameLabelLength(){var t;let e=0;for(const s of this.graphicalMusicSheet.ParentMusicSheet.Instruments)if((t=s.NameLabel)!=null&&t.print&&s.Voices.length>0&&s.Voices[0].Visible){let n=s.NameLabel;this.rules.RenderPartNames||(n=new ft("",n.textAlignment,n.font));const r=new ei(n,this.rules.InstrumentLabelTextHeight,Oe.LeftCenter,this.rules);r.setLabelPositionAndShapeBorders(),e=Math.max(e,r.PositionAndShape.MarginSize.width)}return this.rules.RenderPartNames?e:0}calculateSheetLabelBoundingBoxes(){var n;const e=this.graphicalMusicSheet.ParentMusicSheet,t=this.rules.DefaultColorTitle;if(e.Title!==void 0&&this.rules.RenderTitle){const r=new ei(e.Title,this.rules.SheetTitleHeight,Oe.CenterBottom,this.rules);r.Label.IsCreditLabel=!0,r.Label.colorDefault=t,this.graphicalMusicSheet.Title=r,r.setLabelPositionAndShapeBorders()}else this.rules.RenderTitle||(this.graphicalMusicSheet.Title=void 0);if(e.Subtitle!==void 0&&this.rules.RenderSubtitle){const r=new ei(e.Subtitle,this.rules.SheetSubtitleHeight,Oe.CenterCenter,this.rules);r.Label.IsCreditLabel=!0,r.Label.colorDefault=t,this.graphicalMusicSheet.Subtitle=r,r.setLabelPositionAndShapeBorders()}else this.rules.RenderSubtitle||(this.graphicalMusicSheet.Subtitle=void 0);if(e.Composer!==void 0&&this.rules.RenderComposer){const r=new ei(e.Composer,this.rules.SheetComposerHeight,Oe.RightCenter,this.rules);r.Label.IsCreditLabel=!0,r.Label.colorDefault=t,this.graphicalMusicSheet.Composer=r,r.setLabelPositionAndShapeBorders()}else this.rules.RenderComposer||(this.graphicalMusicSheet.Composer=void 0);if(e.Lyricist!==void 0&&this.rules.RenderLyricist){const r=new ei(e.Lyricist,this.rules.SheetAuthorHeight,Oe.LeftCenter,this.rules);r.Label.IsCreditLabel=!0,r.Label.colorDefault=t,this.graphicalMusicSheet.Lyricist=r,r.setLabelPositionAndShapeBorders()}else this.rules.RenderLyricist||(this.graphicalMusicSheet.Lyricist=void 0);const s=(n=this.graphicalMusicSheet.musicSheet.sourceMeasures)==null?void 0:n[0];if(s&&s.FirstInstructionsStaffEntries.length>0){const r=s.FirstInstructionsStaffEntries[0];let o,a;for(let l=0,u=r.Instructions.length;l0&&h.graphicalVoiceEntries[0].notes.length===1){const c=h.graphicalVoiceEntries[0].notes[0];!c.sourceNote.Pitch&&new re(1,2).lt(c.sourceNote.Length)&&this.layoutMeasureWithWholeRest(c,h,u)}}}}}}optimizeRestNotePlacement(e,t){if(e.graphicalVoiceEntries.length===0)return;const s=e.graphicalVoiceEntries[0].notes;if(s.length===0)return;const n=s[0],r=n.sourceNote.isRest();if(e.graphicalVoiceEntries.length===2){let o=!1;const a=e.graphicalVoiceEntries[1].notes;a.length>0&&(o=a[0].sourceNote.isRest()),r&&o?this.calculateTwoRestNotesPlacementWithCollisionDetection(e):(r||o)&&this.calculateRestNotePlacementWithCollisionDetectionFromGraphicalNote(e)}else if(r&&e!==t.staffEntries[0]&&e!==t.staffEntries[t.staffEntries.length-1]){const o=t.staffEntries.indexOf(e),a=t.staffEntries[o-1],l=t.staffEntries[o+1];if(a.graphicalVoiceEntries.length===1){const u=a.graphicalVoiceEntries[0].notes[0];if(u.sourceNote.NoteBeam!==void 0&&l.graphicalVoiceEntries.length===1){const h=l.graphicalVoiceEntries[0].notes[0];h.sourceNote.NoteBeam!==void 0&&u.sourceNote.NoteBeam===h.sourceNote.NoteBeam&&(this.calculateRestNotePlacementWithinGraphicalBeam(e,n,u,l,h),e.PositionAndShape.calculateBoundingBox())}}}}getRelativePositionInStaffLineFromTimestamp(e,t,s,n,r=0){let o=new te,a,l;const u=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length,h=this.graphicalMusicSheet.GetInterpolatedIndexInVerticalContainers(e),c=Math.min(Math.floor(h),u-1),f=Math.min(Math.ceil(h),u-1);if(c<0||t<0)return o;if(a=this.getFirstLeftNotNullStaffEntryFromContainer(c,t,n),l=this.getFirstRightNotNullStaffEntryFromContainer(f,t,n),a&&l){let d=a.parentMeasure.PositionAndShape.RelativePosition.x;r>0&&(d=r);let p=a.PositionAndShape.RelativePosition.x+d,g=l.PositionAndShape.RelativePosition.x+l.parentMeasure.PositionAndShape.RelativePosition.x;r>0&&(g=l.PositionAndShape.RelativePosition.x+d);let m=0;if(a!==l){const b=a.getAbsoluteTimestamp(),y=l.getAbsoluteTimestamp();m=re.minus(e,b).RealValue/re.minus(y,b).RealValue}a.parentMeasure.ParentStaffLine!==l.parentMeasure.ParentStaffLine&&(a.parentMeasure.ParentStaffLine===s?g=s.PositionAndShape.Size.width:p=s.PositionAndShape.RelativePosition.x),o=new te(p+(g-p)*m,0)}return o}getRelativeXPositionFromTimestamp(e){const t=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length,s=this.graphicalMusicSheet.GetInterpolatedIndexInVerticalContainers(e),n=Math.max(0,Math.min(Math.round(s),t-1)),r=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[n].getFirstNonNullStaffEntry();return r.PositionAndShape.RelativePosition.x+r.parentMeasure.PositionAndShape.RelativePosition.x}calculatePageLabels(e){var o;this.rules.RenderSingleHorizontalStaffline&&(e.PositionAndShape.BorderRight=e.PositionAndShape.Size.width,e.PositionAndShape.calculateBoundingBox(),this.graphicalMusicSheet.ParentMusicSheet.pageWidth=e.PositionAndShape.Size.width);let t=10;if(e.MusicSystems.length>0){const a=e.MusicSystems[0];t=a.PositionAndShape.RelativePosition.y+a.PositionAndShape.BorderTop}if(this.graphicalMusicSheet.Title){const a=this.graphicalMusicSheet.Title;a.PositionAndShape.Parent=e.PositionAndShape;const l=new te;l.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth/2,l.y=this.rules.TitleTopDistance+this.rules.SheetTitleHeight,a.PositionAndShape.RelativePosition=l,e.Labels.push(a)}if(this.graphicalMusicSheet.Subtitle){const a=this.graphicalMusicSheet.Subtitle;a.PositionAndShape.Parent=e.PositionAndShape;const l=new te;l.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth/2,l.y=this.rules.TitleTopDistance+this.rules.SheetTitleHeight+this.rules.SheetMinimumDistanceBetweenTitleAndSubtitle,a.PositionAndShape.RelativePosition=l,e.Labels.push(a)}const s=this.graphicalMusicSheet.Composer;let n;if(s){s.PositionAndShape.Parent=e.PositionAndShape,s.setLabelPositionAndShapeBorders();const a=new te;a.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth-this.rules.PageRightMargin,a.y=t,a.y-=this.rules.SystemComposerDistance;const l=(o=s.TextLines)==null?void 0:o.length;l>1&&(a.y-=s.PositionAndShape.BorderBottom*(l-1)/l),n=a.y,s.PositionAndShape.RelativePosition=a,e.Labels.push(s)}const r=this.graphicalMusicSheet.Lyricist;if(r){r.PositionAndShape.Parent=e.PositionAndShape,r.setLabelPositionAndShapeBorders();const a=new te;a.x=this.rules.PageLeftMargin,a.y=t,a.y+=r.PositionAndShape.BorderBottom,a.y=Math.min(a.y,n!=null?n:Number.MAX_SAFE_INTEGER),r.PositionAndShape.RelativePosition=a,e.Labels.push(r)}}createGraphicalTies(){for(let e=0;e=0&&this.staffEntriesWithGraphicalTies.push(r)}r=a}}setTieDirections(e){if(!e)return;const t=e.ties;if(t.length>1){let s;for(const n of t){const r=n.Notes[0];(!s||r.Pitch.getHalfTone()>s.Pitch.getHalfTone())&&(s=r)}for(const n of t)n.TieDirection===ue.NotYetDefined&&(n.Notes[0]===s?n.TieDirection=ue.Above:n.TieDirection=ue.Below)}}createAccidentalCalculators(){const e=[],t=this.graphicalMusicSheet.ParentMusicSheet.getFirstSourceMeasure();if(t)for(let s=0;s1)return;c=Ue.symbolFactory.createGraphicalMeasure(e,h)}if(c.hasError=e.getErrorInMeasure(l),e.FirstInstructionsStaffEntries[l])for(let v=0,S=e.FirstInstructionsStaffEntries[l].Instructions.length;v0){const M=S.Instructions[0];Ue.symbolFactory.createInStaffClef(A,M)}this.rules.RenderChordSymbols&&((y=S.ChordContainers)==null?void 0:y.length)>0&&(S.ParentStaff.ParentInstrument.HasChordSymbols=!0,Ue.symbolFactory.createChordSymbols(S,A,n.ActiveKeyInstruction,this.graphicalMusicSheet.ParentMusicSheet.Transpose))}}if(n.doCalculationsAtEndOfMeasure(),e.LastInstructionsStaffEntries[l]){const v=e.LastInstructionsStaffEntries[l];for(let S=0,A=v.Instructions.length;S=1&&c.staffEntries.length===0){const v=new di(new Qc(c.parentSourceMeasure,c.parentSourceMeasure.AbsoluteTimestamp,c.parentSourceMeasure.CompleteNumberOfStaves),h),S=new Bh(new re(0,1),h.Voices[0],v),A=new vu(S,v,re.createFromFraction(e.Duration),void 0,e);A.PrintObject=this.rules.FillEmptyMeasuresWithWholeRest===xp.YesVisible,S.addNote(A);const P=Ue.symbolFactory.createStaffEntry(v,c);c.addGraphicalStaffEntry(P),P.relInMeasureTimestamp=S.Timestamp;const x=Ue.symbolFactory.createVoiceEntry(S,P);P.graphicalVoiceEntries.push(x);const M=Ue.symbolFactory.createNote(A,x,new nt,Qi.NONE,void 0);Ue.stafflineNoteCalculator.trackNote(M),x.notes.push(M)}c.hasOnlyRests=!0;for(const v of c.staffEntries)if(c.hasOnlyRests=v.hasOnlyRests(),!c.hasOnlyRests)break;return c}checkNoteForAccidental(e,t,s,n){let r=e.sourceNote.Pitch;const o=e.parentVoiceEntry.parentStaffEntry.parentMeasure.getTransposedHalftones();o!==0&&e.sourceNote.ParentStaffEntry.ParentStaff.ParentInstrument.MidiInstrumentId!==Ee.Percussion&&(r=e.Transpose(t.ActiveKeyInstruction,s,o,n),e.sourceNote.TransposedPitch=r),e.sourceNote.halfTone=r.getHalfTone(),t.checkAccidental(e,r)}handleStaffEntries(e){for(let t=0,s=this.graphicalMusicSheet.MeasureList.length;t0&&l.graphicalVoiceEntries[0].notes.length>0&&(this.layoutVoiceEntries(l,r),this.layoutStaffEntry(l));this.graphicalMeasureCreatedCalculations(a)}}}}calculateSkyBottomLines(){for(const e of this.musicSystems)for(const t of e.StaffLines)t.SkyBottomLineCalculator.calculateLines()}calculateExpressionAlignements(){}calculateStaffEntryArticulationMarks(){for(let e=0,t=this.musicSystems.length;e0&&this.layoutArticulationMarks(g.Articulations,g,f)}}}}}}calculateOrnaments(){for(let e=0,t=this.musicSystems.length;e0&&n.LyricVersesNumbers.sort()}for(let t=0,s=this.musicSystems.length;t=0&&(n=t.GraphicalLyricsEntries[s+1]),!n)return;const r=e.StaffEntryParent.parentMeasure.ParentStaffLine,o=n.StaffEntryParent.parentMeasure.ParentStaffLine,a=e.StaffEntryParent,l=n.StaffEntryParent;if(e.StaffEntryParent.parentMeasure.ParentStaffLine===n.StaffEntryParent.parentMeasure.ParentStaffLine){const u=a.parentMeasure.PositionAndShape.RelativePosition.x+a.PositionAndShape.RelativePosition.x+e.GraphicalLabel.PositionAndShape.RelativePosition.x+e.GraphicalLabel.PositionAndShape.BorderMarginRight,h=l.parentMeasure.PositionAndShape.RelativePosition.x+l.PositionAndShape.RelativePosition.x+e.GraphicalLabel.PositionAndShape.RelativePosition.x+n.GraphicalLabel.PositionAndShape.BorderMarginLeft,c=e.GraphicalLabel.PositionAndShape.RelativePosition.y;let f=1;h-u>this.rules.MinimumDistanceBetweenDashes*3&&(f=Math.floor((h-u)/this.rules.MinimumDistanceBetweenDashes)-1),f===1?this.calculateSingleDashForLyricWord(r,u,h,c):this.calculateDashes(r,u,h,c)}else{const u=a.parentMeasure.PositionAndShape.RelativePosition.x+a.PositionAndShape.RelativePosition.x+e.GraphicalLabel.PositionAndShape.BorderMarginRight,h=r.Measures[r.Measures.length-1],c=h.PositionAndShape.RelativePosition.x+h.PositionAndShape.Size.width;let f=e.GraphicalLabel.PositionAndShape.RelativePosition.y;if(this.calculateDashes(r,u,c,f),o&&o.Measures[0]&&l.parentMeasure.ParentStaffLine&&!(l===l.parentMeasure.staffEntries[0]&&l.parentMeasure===l.parentMeasure.ParentStaffLine.Measures[0])){const d=o.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x,p=l.parentMeasure.PositionAndShape.RelativePosition.x+l.PositionAndShape.RelativePosition.x+n.GraphicalLabel.PositionAndShape.BorderMarginLeft;f=n.GraphicalLabel.PositionAndShape.RelativePosition.y,this.calculateDashes(o,d,p,f)}}}calculateDashes(e,t,s,n){let r=s-t;if(rt;)r=this.calculateRightAndLeftDashesForLyricWord(e,t,s,n),t+=a,s-=a,l++;r>a*2&&this.calculateSingleDashForLyricWord(e,t,s,n)}}calculateSingleDashForLyricWord(e,t,s,n){const r=new ft("-"),o=new ei(r,this.rules.LyricsHeight,Oe.CenterBottom,this.rules);o.setLabelPositionAndShapeBorders(),e.LyricsDashes.push(o),this.staffLinesWithLyricWords.indexOf(e)===-1&&this.staffLinesWithLyricWords.push(e),o.PositionAndShape.Parent=e.PositionAndShape;const a=new te(t+(s-t)/2,n);o.PositionAndShape.RelativePosition=a}calculateLyricExtend(e){let t=e.GraphicalLabel.PositionAndShape.RelativePosition.y;const s=e.StaffEntryParent,n=s.parentMeasure.ParentStaffLine;let r,o;const a=s.parentMeasure.ParentStaff.idInMusicSheet;for(let l=s.parentVerticalContainer.Index+1;l0)break;r=u,o=r.parentMeasure.ParentStaffLine,o||(o=s.parentMeasure.ParentStaffLine)}}if(!(!r||!o))if(n===o&&r.parentMeasure.ParentStaffLine){const l=s.parentMeasure.PositionAndShape.RelativePosition.x+s.PositionAndShape.RelativePosition.x+e.GraphicalLabel.PositionAndShape.BorderMarginRight,u=r.parentMeasure.PositionAndShape.RelativePosition.x+r.PositionAndShape.RelativePosition.x+r.PositionAndShape.BorderMarginRight;t-=e.GraphicalLabel.PositionAndShape.Size.height/4,this.calculateSingleLyricWordWithUnderscore(n,l,u,t)}else{const l=n.Measures[n.Measures.length-1].PositionAndShape,u=s.parentMeasure.PositionAndShape.RelativePosition.x+s.PositionAndShape.RelativePosition.x+e.GraphicalLabel.PositionAndShape.BorderMarginRight,h=l.RelativePosition.x+l.Size.width;if(t-=e.GraphicalLabel.PositionAndShape.Size.height/4,this.calculateSingleLyricWordWithUnderscore(n,u,h,t),!r)return;if(r.parentMeasure.ParentStaffLine&&r.parentMeasure.staffEntries&&!(r===r.parentMeasure.staffEntries[0]&&r.parentMeasure===r.parentMeasure.ParentStaffLine.Measures[0])){const c=o.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x,f=r.parentMeasure.PositionAndShape.RelativePosition.x+r.PositionAndShape.RelativePosition.x+r.PositionAndShape.BorderMarginRight;this.calculateSingleLyricWordWithUnderscore(o,c,f,t)}}}calculateSingleLyricWordWithUnderscore(e,t,s,n){const r=new te(t,n),o=new te(s,n),a=new Qs(r,o,this.rules.LyricUnderscoreLineWidth);e.LyricLines.push(a),this.staffLinesWithLyricWords.indexOf(e)===-1&&this.staffLinesWithLyricWords.push(e)}calculateRightAndLeftDashesForLyricWord(e,t,s,n){const r=new ft("-"),o=new ei(r,this.rules.LyricsHeight,Oe.CenterBottom,this.rules);o.setLabelPositionAndShapeBorders(),e.LyricsDashes.push(o),this.staffLinesWithLyricWords.indexOf(e)===-1&&this.staffLinesWithLyricWords.push(e),o.PositionAndShape.Parent=e.PositionAndShape;const a=new te(t,n);o.PositionAndShape.RelativePosition=a;const l=new ft("-"),u=new ei(l,this.rules.LyricsHeight,Oe.CenterBottom,this.rules);u.setLabelPositionAndShapeBorders(),e.LyricsDashes.push(u),u.PositionAndShape.Parent=e.PositionAndShape;const h=new te(s,n);return u.PositionAndShape.RelativePosition=h,u.PositionAndShape.RelativePosition.x-o.PositionAndShape.RelativePosition.x}calculateDynamicExpressions(){const e=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,this.rules.MaxMeasureToDrawIndex),t=Math.min(this.rules.MinMeasureToDrawIndex,this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length);for(let s=t;s<=e;s++){const n=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[s];this.dynamicExpressionMap.clear();for(let r=0;r=0;o--)if((r=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[o])!=null&&r.StaffEntries[t])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[o].StaffEntries[t]}getFirstRightNotNullStaffEntryFromContainer(e,t,s){var n,r;if((n=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[e])!=null&&n.StaffEntries[t])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[e].StaffEntries[t];for(let o=e+1;o0||t.StaffLinkedExpressions[s][n].UnknownList.length>0)&&this.calculateMoodAndUnknownExpression(t.StaffLinkedExpressions[s][n],e,s)}}calculateStemDirectionFromVoices(e){if(e.ParentSourceStaffEntry.Link!==void 0)if(e===e.ParentSourceStaffEntry.VoiceEntries[0]){e.WantedStemDirection=rt.Up;return}else{e.WantedStemDirection=rt.Down;return}else e.ParentVoice instanceof Jo?e.WantedStemDirection=rt.Down:e.ParentSourceStaffEntry.VoiceEntries.length>1&&(e.WantedStemDirection=rt.Up)}setBeamNotesWantedStemDirections(e){if(!(e.Notes.length>0))return;const t=e.Notes[0].NoteBeam;if(t){for(const s of t.Notes)if(s.ParentVoiceEntry.WantedStemDirection!==rt.Undefined&&s.ParentVoiceEntry.ParentSourceStaffEntry.ParentStaff.Id===e.ParentSourceStaffEntry.ParentStaff.Id){e.WantedStemDirection=s.ParentVoiceEntry.WantedStemDirection;break}}}}class T4{constructor(e,t,s,n,r){this.rootPitch=e,this.chordKind=t,this.bassPitch=s,this.degrees=n,this.rules=r}get RootPitch(){return this.rootPitch}get ChordKind(){return this.chordKind}get BassPitch(){return this.bassPitch}get ChordDegrees(){return this.degrees}static calculateChordText(e,t,s){let n=e.RootPitch;if(Ue.transposeCalculator&&(n=Ue.transposeCalculator.transposePitch(e.RootPitch,s,t)),e.ChordKind===31)return e.getTextFromChordKindEnum(e.ChordKind);let r=pt.getNoteEnumString(n.FundamentalNote);n.Accidental!==ke.NONE&&(r+=this.getTextForAccidental(n.Accidental));const o={adds:[],alts:[],subs:[]};for(const h of e.ChordDegrees)if(h){let c="";switch(h.alteration!==ke.NONE&&(c+=this.getTextForAccidental(h.alteration)),c+=h.value,h.text){case 0:o.adds.push(c);break;case 1:o.alts.push(c);break;case 2:o.subs.push(c);break}}let a=e.getTextFromChordKindEnum(e.ChordKind);const l=["adds","alts","subs"],u=e.rules.CustomChords;for(const h of u){if(h.chordKind!==e.chordKind)continue;let c=!0;for(const f of l){for(const d of h.degrees[f]||[])if(o[f].indexOf(d)<0){c=!1;break}if(!c)break}if(c){for(const f of l)for(const d of h.degrees[f]||[])o[f].splice(o[f].indexOf(d),1);a=h.alternateName}}if(r+=a,o.adds.length>0&&(r+="("+o.adds.join(",")+")"),o.alts.length>0&&(r+="(alt "+o.alts.join(",")+")"),o.subs.length>0&&(r+="(omit "+o.subs.join(",")+")"),e.BassPitch){let h=e.BassPitch;Ue.transposeCalculator&&(h=Ue.transposeCalculator.transposePitch(e.BassPitch,s,t)),r+="/",r+=pt.getNoteEnumString(h.FundamentalNote),r+=this.getTextForAccidental(h.Accidental)}return r}static getTextForAccidental(e){let t="";switch(e){case ke.DOUBLEFLAT:t+="bb";break;case ke.FLAT:t+="b";break;case ke.SHARP:t+="#";break;case ke.DOUBLESHARP:t+="x";break}return t}getTextFromChordKindEnum(e){var t;return(t=this.rules.ChordSymbolLabelTexts.getValue(e))!=null?t:""}}class OM{constructor(e,t,s){this.value=e,this.alteration=t,this.text=s}}class Pu{constructor(e,t,s){this.alternateName=e,this.chordKind=t,this.degrees=s}static createCustomChord(e,t,s){return new Pu(e,t,s)}static renameCustomChord(e,t,s){for(const n of s)n.alternateName===e&&(n.alternateName=t)}}var L4=(i=>(i[i.add=0]="add",i[i.alter=1]="alter",i[i.subtract=2]="subtract",i))(L4||{}),St=(i=>(i[i.major=0]="major",i[i.minor=1]="minor",i[i.augmented=2]="augmented",i[i.diminished=3]="diminished",i[i.dominant=4]="dominant",i[i.majorseventh=5]="majorseventh",i[i.minorseventh=6]="minorseventh",i[i.diminishedseventh=7]="diminishedseventh",i[i.augmentedseventh=8]="augmentedseventh",i[i.halfdiminished=9]="halfdiminished",i[i.majorminor=10]="majorminor",i[i.majorsixth=11]="majorsixth",i[i.minorsixth=12]="minorsixth",i[i.dominantninth=13]="dominantninth",i[i.majorninth=14]="majorninth",i[i.minorninth=15]="minorninth",i[i.dominant11th=16]="dominant11th",i[i.major11th=17]="major11th",i[i.minor11th=18]="minor11th",i[i.dominant13th=19]="dominant13th",i[i.major13th=20]="major13th",i[i.minor13th=21]="minor13th",i[i.suspendedsecond=22]="suspendedsecond",i[i.suspendedfourth=23]="suspendedfourth",i[i.Neapolitan=24]="Neapolitan",i[i.Italian=25]="Italian",i[i.French=26]="French",i[i.German=27]="German",i[i.pedal=28]="pedal",i[i.power=29]="power",i[i.Tristan=30]="Tristan",i[i.none=31]="none",i))(St||{});class B4 extends yi{constructor(e,t,s,n=void 0){super(),this.DrawnAccidental=ke.NONE,this.lineShift=0,this.sourceNote=e,this.parentVoiceEntry=t,this.PositionAndShape=new Ut(this,t.PositionAndShape),n?this.graphicalNoteLength=n:this.graphicalNoteLength=e.Length,this.numberOfDots=this.calculateNumberOfNeededDots(this.graphicalNoteLength),this.rules=s,this.rules.addGraphicalNoteToNoteMap(e,this)}Transpose(e,t,s,n){let r=this.sourceNote.Pitch;return Ue.transposeCalculator&&(r=Ue.transposeCalculator.transposePitch(this.sourceNote.Pitch,e,s)),r}calculateNumberOfNeededDots(e){return!this.sourceNote||!this.sourceNote.NoteTuplet?e.calculateNumberOfNeededDots():0}get ParentMusicPage(){return this.parentVoiceEntry.parentStaffEntry.parentMeasure.ParentMusicSystem.Parent}static FromNote(e,t){return t.NoteToGraphicalNoteMap.getValue(e.NoteToGraphicalNoteObjectId)}}const gs=class{constructor(){this.DYSlursStartingAtSameStaffEntryYOffset=0,this.DYMinNoteWidth=0,this.DYWorkId=0,this.DYWorkSpecial=!1,this.DYContainerId="osmdCanvasPage",this.DYSVGContainerId="osmdSvgPage",this.DYMusicScoreType="staff",this.NoteDistances=[1,1,1.3,1.6,2,2.5,3,4],this.NoteDistancesScalingFactors=[1,2,4,8,16,32,64,128],this.DurationDistanceDict={},this.DurationScalingDistanceDict={},this.NoteToGraphicalNoteMapObjectCount=0,this.PlayAlreadyStartedNotesFromCursorPosition=!1,this.PlaybackSkipNotesSafetyInterval=.02,this.UseDefaultVoiceInteractionListener=!0,this.loadDefaultValues()}loadDefaultValues(){this.SamplingUnit=gs.unit*3,this.MpatMode=!0,this.SheetTitleHeight=4,this.SheetSubtitleHeight=2,this.SheetMinimumDistanceBetweenTitleAndSubtitle=1,this.SheetComposerHeight=2,this.SheetAuthorHeight=2,this.CompactMode=!1,this.PagePlacementEnum=n4.Down,this.PageHeight=100001,this.PageTopMargin=5,this.PageTopMarginNarrow=0,this.PageBottomMargin=5,this.PageLeftMargin=5,this.PageRightMargin=5,this.TitleTopDistance=5,this.TitleBottomDistance=1,this.StaffDistance=7,this.BetweenStaffDistance=5,this.MinimumStaffLineDistance=4,this.MinSkyBottomDistBetweenStaves=1,this.StaffHeight=4,this.TabStaffInterlineHeight=1.1111,this.BetweenStaffLinesDistance=gs.unit,this.SystemLeftMargin=0,this.SystemRightMargin=0,this.SystemLabelsRightMargin=2,this.SystemComposerDistance=2,this.InstrumentLabelTextHeight=2,this.MinimumDistanceBetweenSystems=7,this.MinSkyBottomDistBetweenSystems=5,this.LastSystemMaxScalingFactor=1.4,this.AutoBeamNotes=!1,this.AutoBeamOptions={beam_middle_rests_only:!1,beam_rests:!1,maintain_stem_directions:!1},this.AutoBeamTabs=!1,this.BeamWidth=gs.unit/2,this.BeamSpaceWidth=gs.unit/3,this.BeamForwardLength=1.25*gs.unit,this.FlatBeams=!1,this.FlatBeamOffset=20,this.FlatBeamOffsetPerBeam=10,this.ClefLeftMargin=.5,this.ClefRightMargin=.75,this.PercussionOneLineCutoff=3,this.PercussionForceVoicesOneLineCutoff=1,this.PercussionUseXMLDisplayStep=!0,this.PercussionXMLDisplayStepNoteValueShift=0,this.PercussionOneLineXMLDisplayStepOctaveOffset=0,this.BetweenKeySymbolsDistance=.2,this.KeyRightMargin=.75,this.RhythmRightMargin=1.25,this.ShowRhythmAgainAfterPartEndOrFinalBarline=!0,this.NewPartAndSystemAfterFinalBarline=!1,this.InStaffClefScalingFactor=.8,this.DistanceBetweenNaturalAndSymbolWhenCancelling=.4,this.NoteHelperLinesOffset=.25,this.MeasureLeftMargin=.7,this.MeasureRightMargin=0,this.DistanceBetweenLastInstructionAndRepetitionBarline=1,this.ArpeggioDistance=.6,this.StaccatoShorteningFactor=2,this.IdealStemLength=3,this.StemNoteHeadBorderYOffset=.2,this.StemMargin=.2,this.StemMinLength=2.5,this.StemMaxLength=4.5,this.BeamSlopeMaxAngle=10,this.StemMinAllowedDistanceBetweenNoteHeadAndBeamLine=1,this.SetWantedStemDirectionByXml=!0,this.GraceNoteScalingFactor=.6,this.GraceNoteXOffset=.2,this.WedgeOpeningLength=1.2,this.WedgeMeasureEndOpeningLength=.75,this.WedgeMeasureBeginOpeningLength=.75,this.WedgePlacementAboveY=-1.5,this.WedgePlacementBelowY=1.5,this.WedgeHorizontalMargin=.6,this.WedgeVerticalMargin=.5,this.DistanceOffsetBetweenTwoHorizontallyCrossedWedges=.3,this.WedgeMinLength=2,this.WedgeEndDistanceBetweenTimestampsFactor=1.75,this.DistanceBetweenAdjacentDynamics=.75,this.TempoChangeMeasureValidity=4,this.TempoContinousFactor=.7,this.StaccatoScalingFactor=.8,this.BetweenDotsDistance=.8,this.OrnamentAccidentalScalingFactor=.65,this.ChordSymbolTextHeight=2,this.ChordSymbolTextAlignment=Oe.LeftBottom,this.ChordSymbolRelativeXOffset=-1,this.ChordSymbolXSpacing=1,this.ChordOverlapAllowedIntoNextMeasure=0,this.ChordSymbolYOffset=.1,this.ChordSymbolYPadding=0,this.ChordSymbolYAlignment=!0,this.ChordSymbolYAlignmentScope="staffline",this.ChordSymbolLabelTexts=new cs,this.resetChordSymbolLabelTexts(this.ChordSymbolLabelTexts),this.CustomChords=[],this.resetChordNames(),this.RepetitionSymbolsYOffset=0,this.RehearsalMarkXOffsetDefault=10,this.RehearsalMarkXOffset=0,this.RehearsalMarkXOffsetSystemStartMeasure=-20,this.RehearsalMarkYOffsetDefault=-15,this.RehearsalMarkYOffset=0,this.RehearsalMarkFontSize=10,this.MeasureNumberLabelHeight=1.5*gs.unit,this.MeasureNumberLabelOffset=2,this.MeasureNumberLabelXOffset=-.5,this.TupletsRatioed=!1,this.TupletsBracketed=!1,this.TripletsBracketed=!1,this.TupletNumberLabelHeight=1.5*gs.unit,this.TupletNumberYOffset=.5,this.LabelMarginBorderFactor=.1,this.TupletVerticalLineLength=.5,this.TupletNumbersInTabs=!1,this.SlurPlacementFromXML=!0,this.BezierCurveStepSize=1e3,this.calculateCurveParametersArrays(),this.TieGhostObjectWidth=.75,this.TieYPositionOffsetFactor=.3,this.MinimumNeededXspaceForTieGhostObject=1,this.TieHeightMinimum=.28,this.TieHeightMaximum=1.2,this.TieHeightInterpolationK=.0288,this.TieHeightInterpolationD=.136,this.SlurNoteHeadYOffset=.5,this.SlurStemXOffset=.3,this.SlurSlopeMaxAngle=15,this.SlurTangentMinAngle=30,this.SlurTangentMaxAngle=80,this.SlurHeightFactor=1,this.SlurHeightFlattenLongSlursFactorByWidth=.24,this.SlurHeightFlattenLongSlursFactorByAngle=.36,this.SlurHeightFlattenLongSlursCutoffAngle=47,this.SlurHeightFlattenLongSlursCutoffWidth=16,this.SlursStartingAtSameStaffEntryYOffset=.8,this.SlurMaximumYControlPointDistance=void 0,this.RepetitionEndingLabelHeight=2,this.RepetitionEndingLabelXOffset=.5,this.RepetitionEndingLabelYOffset=.3,this.RepetitionEndingLineYLowerOffset=.5,this.RepetitionEndingLineYUpperOffset=.3,this.VoltaOffset=2.5,this.LyricsAlignmentStandard=Oe.LeftBottom,this.LyricsHeight=2,this.LyricsYOffsetToStaffHeight=0,this.VerticalBetweenLyricsDistance=.5,this.HorizontalBetweenLyricsDistance=.2,this.BetweenSyllableMaximumDistance=10,this.BetweenSyllableMinimumDistance=.5,this.LyricOverlapAllowedIntoNextMeasure=3.4,this.MinimumDistanceBetweenDashes=10,this.MaximumLyricsElongationFactor=2.5,this.InstantaneousTempoTextHeight=2.3,this.ContinuousDynamicTextHeight=2.3,this.MoodTextHeight=2.3,this.UnknownTextHeight=2,this.ContinuousTempoTextHeight=2.3,this.DynamicExpressionMaxDistance=2,this.DynamicExpressionSpacer=.5,this.VexFlowDefaultNotationFontScale=39,this.VexFlowDefaultTabFontScale=39,this.TremoloStrokeScale=1,this.TremoloYSpacingScale=1,this.StemWidth=.15,this.StaffLineWidth=.1,this.StaffLineColor=void 0,this.LedgerLineWidth=1,this.LedgerLineStrokeStyle=void 0,this.LedgerLineColorDefault="#000000",this.WedgeLineWidth=.12,this.TupletLineWidth=.12,this.LyricUnderscoreLineWidth=.12,this.SystemThinLineWidth=.12,this.SystemBoldLineWidth=gs.unit/2,this.SystemRepetitionEndingLineWidth=.12,this.SystemDotWidth=gs.unit/2,this.DistanceBetweenVerticalSystemLines=.35,this.DistanceBetweenDotAndLine=.7,this.RepeatEndStartPadding=2,this.OctaveShiftLineWidth=.12,this.OctaveShiftVerticalLineLength=gs.unit,this.GraceLineWidth=this.StaffLineWidth*this.GraceNoteScalingFactor,this.MultipleRestMeasureDefaultWidth=4,this.MinimumCrossedBeamDifferenceMargin=1e-4,this.SheetMaximumWidth=32767,this.VoiceSpacingMultiplierVexflow=.85,this.VoiceSpacingAddendVexflow=3,this.PickupMeasureWidthMultiplier=1,this.DisplacedNoteMargin=.1,this.MinNoteDistance=2,this.SubMeasureXSpacingThreshold=35,this.MeasureDynamicsMaxScalingFactor=2.5,this.WholeRestXShiftVexflow=-1.5,this.MetronomeMarksDrawn=!0,this.MetronomeMarkXShift=-6,this.MetronomeMarkYShift=-.5,this.SoftmaxFactorVexFlow=15,this.StaggerSameWholeNotes=!0,this.AlignRests=hl.Never,this.RestCollisionYPadding=0,this.FillEmptyMeasuresWithWholeRest=xp.No,this.ArpeggiosGoAcrossVoices=!1,this.RenderArpeggios=!0,this.RenderSlurs=!0,this.ColoringMode=Yn.XML,this.ColoringEnabled=!0,this.ColorStemsLikeNoteheads=!1,this.ColorBeams=!0,this.ColorFlags=!0,this.applyDefaultColorMusic("#000000"),this.DefaultColorCursor="#33e02f",this.DefaultFontFamily="Times New Roman",this.DefaultFontStyle=Wt.Regular,this.DefaultVexFlowNoteFont="gonville",this.MaxMeasureToDrawIndex=Number.MAX_VALUE,this.MinMeasureToDrawIndex=0,this.MaxSystemToDrawNumber=Number.MAX_VALUE,this.MaxPageToDrawNumber=Number.MAX_VALUE,this.RenderComposer=!0,this.RenderTitle=!0,this.RenderSubtitle=!0,this.RenderLyricist=!0,this.RenderPartNames=!0,this.RenderPartAbbreviations=!0,this.RenderFingerings=!0,this.RenderMeasureNumbers=!0,this.RenderMeasureNumbersOnlyAtSystemStart=!1,this.UseXMLMeasureNumbers=!0,this.RenderLyrics=!0,this.RenderChordSymbols=!0,this.RenderMultipleRestMeasures=!0,this.AutoGenerateMutipleRestMeasuresFromRestMeasures=!0,this.RenderRehearsalMarks=!0,this.RenderClefsAtBeginningOfStaffline=!0,this.RenderKeySignatures=!0,this.RenderTimeSignatures=!0,this.ArticulationPlacementFromXML=!0,this.FingeringPosition=ue.AboveOrBelow,this.FingeringPositionFromXML=!0,this.FingeringPositionGrace=ue.Left,this.FingeringInsideStafflines=!1,this.FingeringLabelFontHeight=1.7,this.FingeringOffsetX=0,this.FingeringOffsetY=0,this.FingeringPaddingY=-.2,this.FingeringTextSize=1.5,this.RenderStringNumbersClassical=!0,this.StringNumberOffsetY=0,this.NewSystemAtXMLNewSystemAttribute=!1,this.NewPageAtXMLNewPageAttribute=!1,this.RestoreCursorAfterRerender=!0,this.StretchLastSystemLine=!1,gs.FixStafflineBoundingBox=!1,this.PageFormat=Ai.UndefinedPageFormat,this.PageBackgroundColor=void 0,this.PerformanceMode=!1,this.RenderSingleHorizontalStaffline=!1,this.SpacingBetweenTextLines=0,this.NoteToGraphicalNoteMap=new cs,this.NoteToGraphicalNoteMapObjectCount=0;try{this.MaxInstructionsConstValue=this.ClefLeftMargin+this.ClefRightMargin+this.KeyRightMargin+this.RhythmRightMargin+11}catch(i){ge.info("EngravingRules()",i)}this.MpatMode&&(this.NewPartAndSystemAfterFinalBarline=!0)}applyDefaultColorMusic(i){this.DefaultColorMusic=i,this.DefaultColorNotehead=this.DefaultColorMusic,this.DefaultColorRest=this.DefaultColorNotehead,this.DefaultColorStem=this.DefaultColorNotehead,this.DefaultColorLabel=this.DefaultColorNotehead,this.DefaultColorTitle=this.DefaultColorNotehead,this.LedgerLineColorDefault=this.DefaultColorNotehead}addGraphicalNoteToNoteMap(i,e){i.NoteToGraphicalNoteObjectId=this.NoteToGraphicalNoteMapObjectCount,this.NoteToGraphicalNoteMap.setValue(i.NoteToGraphicalNoteObjectId,e),this.NoteToGraphicalNoteMapObjectCount++}GNote(i){return B4.FromNote(i,this)}clearMusicSheetObjects(){this.NoteToGraphicalNoteMap=new cs,this.NoteToGraphicalNoteMapObjectCount=0}setChordSymbolLabelText(i,e){this.ChordSymbolLabelTexts.setValue(i,e)}resetChordSymbolLabelTexts(i){return i.setValue(St.minor,"m"),i.setValue(St.augmented,"aug"),i.setValue(St.diminished,"dim"),i.setValue(St.dominant,"7"),i.setValue(St.majorseventh,"maj7"),i.setValue(St.minorseventh,"m7"),i.setValue(St.diminishedseventh,"dim7"),i.setValue(St.augmentedseventh,"aug7"),i.setValue(St.halfdiminished,"m7b5"),i.setValue(St.majorminor,"m(maj7)"),i.setValue(St.majorsixth,"maj6"),i.setValue(St.minorsixth,"m6"),i.setValue(St.dominantninth,"9"),i.setValue(St.majorninth,"maj9"),i.setValue(St.minorninth,"m9"),i.setValue(St.dominant11th,"11"),i.setValue(St.major11th,"maj11"),i.setValue(St.minor11th,"m11"),i.setValue(St.dominant13th,"13"),i.setValue(St.major13th,"maj13"),i.setValue(St.minor13th,"m13"),i.setValue(St.suspendedsecond,"sus2"),i.setValue(St.suspendedfourth,"sus4"),i.setValue(St.power,"5"),i.setValue(St.none,"N.C."),i}addChordName(i,e,t,s,n){if(St[e]!==void 0){const r={adds:t,alts:s,subs:n};this.CustomChords.push(Pu.createCustomChord(i,St[e],r))}}renameChord(i,e){Pu.renameCustomChord(i,e,this.CustomChords)}resetChordNames(){this.addChordName("alt","major",["#5","b9","#9"],["b5"],[]),this.addChordName("7alt","dominant",["#5","b9","#9"],["b5"],[]),this.addChordName("7sus4","dominant",["4"],[],["3"]),this.addChordName("7sus4","suspendedfourth",["7"],[],[]),this.addChordName("9sus4","dominantninth",["4"],[],["3"]),this.addChordName("9sus4","suspendedfourth",["9"],[],[]),this.addChordName("11sus4","dominant11th",["4"],[],["3"]),this.addChordName("11sus4","suspendedfourth",["11"],[],[]),this.addChordName("13sus4","dominant13th",["4"],[],["3"]),this.addChordName("13sus4","suspendedfourth",["13"],[],[]),this.addChordName("7sus2","dominant",["2"],[],["3"]),this.addChordName("7sus2","suspendedsecond",["7"],[],[]),this.addChordName("m7b5","minorseventh",[],["b5"],[]),this.addChordName("9sus2","dominantninth",["2"],[],["3"]),this.addChordName("9sus2","suspendedsecond",["9"],[],[]),this.addChordName("11sus2","dominant11th",["2"],[],["3"]),this.addChordName("11sus2","suspendedsecond",["11"],[],[]),this.addChordName("13sus2","dominant13th",["2"],[],["3"]),this.addChordName("13sus2","suspendedsecond",["13"],[],[]),this.addChordName("m(maj9)","majorminor",["9"],[],[]),this.addChordName("m(maj11)","majorminor",["11"],[],[]),this.addChordName("m(maj13)","majorminor",["13"],[],[]),this.addChordName("69","majorsixth",["9"],[],[]),this.addChordName("mi69","minorsixth",["9"],[],[])}calculateCurveParametersArrays(){this.TPower3=new Array(this.BezierCurveStepSize),this.OneMinusTPower3=new Array(this.BezierCurveStepSize),this.FactorOne=new Array(this.BezierCurveStepSize),this.FactorTwo=new Array(this.BezierCurveStepSize);for(let i=0;i(i[i.XML=0]="XML",i[i.AutoColoring=1]="AutoColoring",i[i.CustomColorSet=2]="CustomColorSet",i))(Yn||{}),Ap=(i=>(i.allon="allon",i.compact="compact",i.compacttight="compacttight",i.default="default",i.leadsheet="leadsheet",i.preview="preview",i.thumbnail="thumbnail",i))(Ap||{});class I4{constructor(e="default"){this.rules=new Ir,this.drawCursors=!0,this.drawTitle=!0,this.drawSubtitle=!0,this.drawLyricist=!0,this.drawComposer=!0,this.drawCredits=!0,this.drawPartNames=!0,this.fingeringPosition=ue.Left,this.drawHiddenNotes=!1,this.DrawingParametersEnum=e}set DrawingParametersEnum(e){switch(this.drawingParametersEnum=e,e){case"allon":this.setForAllOn();break;case"thumbnail":this.setForThumbnail();break;case"leadsheet":this.setForLeadsheet();break;case"compact":this.setForCompactMode();break;case"compacttight":this.setForCompactTightMode();break;case"default":default:this.setForDefault()}}get DrawingParametersEnum(){return this.drawingParametersEnum}setForAllOn(){this.drawHighlights=!0,this.drawErrors=!0,this.drawSelectionStartSymbol=!0,this.drawSelectionEndSymbol=!0,this.drawCursors=!0,this.drawActivitySymbols=!0,this.drawScrollIndicator=!0,this.drawAnnotations=!0,this.drawComments=!0,this.drawMarkedAreas=!0,this.DrawTitle=!0,this.DrawSubtitle=!0,this.DrawComposer=!0,this.DrawLyricist=!0,this.drawCredits=!0,this.DrawPartNames=!0,this.drawHiddenNotes=!0,this.rules.CompactMode=!1}setForDefault(){this.rules.loadDefaultValues(),this.setForAllOn(),this.drawHiddenNotes=!1}setForThumbnail(){this.drawHighlights=!1,this.drawErrors=!1,this.drawSelectionStartSymbol=!1,this.drawSelectionStartSymbol=!1,this.drawCursors=!1,this.drawActivitySymbols=!1,this.drawScrollIndicator=!1,this.drawAnnotations=!0,this.drawComments=!0,this.drawMarkedAreas=!0,this.drawHiddenNotes=!1}setForCompactMode(){this.rules.CompactMode=!0,this.DrawCredits=!1,this.drawHiddenNotes=!1}setForCompactTightMode(){this.setForCompactMode(),this.DrawPartNames=!1,this.rules.VoiceSpacingMultiplierVexflow=.65,this.rules.VoiceSpacingAddendVexflow=2,this.rules.MinSkyBottomDistBetweenStaves=1,this.rules.MinSkyBottomDistBetweenSystems=1,this.rules.BetweenStaffDistance=2.5,this.rules.StaffDistance=3.5,this.rules.MinimumDistanceBetweenSystems=1,this.rules.PageBottomMargin=0,this.rules.PageLeftMargin=2,this.rules.PageRightMargin=2}setForLeadsheet(){this.drawHighlights=!1,this.drawErrors=!1,this.drawSelectionStartSymbol=!0,this.drawSelectionEndSymbol=!0,this.drawCursors=!0,this.drawActivitySymbols=!1,this.drawScrollIndicator=!0,this.drawAnnotations=!0,this.drawComments=!0,this.drawMarkedAreas=!0}get DrawCredits(){return this.drawCredits}set DrawCredits(e){this.drawCredits=e,this.DrawComposer=e,this.DrawTitle=e,this.DrawSubtitle=e,this.DrawLyricist=e}get DrawTitle(){return this.drawTitle}set DrawTitle(e){this.drawTitle=e,this.rules.RenderTitle=e,e||(this.DrawSubtitle=!1)}get DrawSubtitle(){return this.drawSubtitle}set DrawSubtitle(e){this.drawSubtitle=e,this.rules.RenderSubtitle=e,e&&(this.DrawTitle=!0)}get DrawComposer(){return this.drawComposer}set DrawComposer(e){this.drawComposer=e,this.rules.RenderComposer=e}get DrawLyricist(){return this.drawLyricist}set DrawLyricist(e){this.drawLyricist=e,this.rules.RenderLyricist=e}get DrawPartNames(){return this.drawPartNames}set DrawPartNames(e){this.drawPartNames=e,this.rules.RenderPartNames=e,this.rules.RenderPartNames||(this.rules.RenderPartAbbreviations=!1)}get FingeringPosition(){return this.fingeringPosition}set FingeringPosition(e){this.fingeringPosition=e,this.rules.FingeringPosition=e}get Rules(){return this.rules}set Rules(e){this.rules=e}}var hl=(i=>(i[i.Never=0]="Never",i[i.Always=1]="Always",i[i.Auto=2]="Auto",i))(hl||{}),xp=(i=>(i[i.No=0]="No",i[i.YesVisible=1]="YesVisible",i[i.YesInvisible=2]="YesInvisible",i))(xp||{}),no=(i=>(i[i.SVG=0]="SVG",i[i.Canvas=1]="Canvas",i))(no||{});class u2{static OSMDOptionsStandard(){return{autoResize:!0,backend:"svg",drawingParameters:Ap.default}}static BackendTypeFromString(e){return e&&e.toLowerCase()==="canvas"?1:0}}class Ll{constructor(e){if(this.hasAttributes=!1,!e)throw new Error("IXmlElement: expected Element, got undefined");this.elem=e,this.name=e.nodeName.toLowerCase(),e.hasAttributes()&&(this.hasAttributes=!0,this.firstAttribute=e.attributes[0]),this.hasElements=e.hasChildNodes(),e.childNodes.length===1&&e.childNodes[0].nodeType===Node.TEXT_NODE?this.value=e.childNodes[0].nodeValue:this.value=""}attribute(e){return this.elem.attributes.getNamedItem(e)}attributes(){if(!this.attrs){const e=this.elem.attributes,t=[];for(let s=0;s0?this.Voices[0].Visible:!1}set Visible(e){for(let t=0,s=this.Voices.length;t-1&&this.parent.MusicSystems.splice(t,1)}this.parent=e,this.boundingBox.Parent=e.PositionAndShape}get NextSystem(){const e=this.Parent.MusicSystems.indexOf(this);return e!==this.Parent.MusicSystems.length?this.Parent.MusicSystems[e+1]:void 0}get StaffLines(){return this.staffLines}get GraphicalMeasures(){return this.graphicalMeasures}get MeasureNumberLabels(){return this.measureNumberLabels}get Labels(){return this.labels.values()}get ObjectsToRedraw(){return this.objectsToRedraw}get InstrumentBrackets(){return this.instrumentBrackets}get GroupBrackets(){return this.groupBrackets}get GraphicalMarkedAreas(){return this.graphicalMarkedAreas}get SystemLines(){return this.systemLines}get Id(){return this.id}createSystemLeftLine(e,t,s){let n=-e/2;s&&(n=this.maxLabelLength+t-e/2);const r=this.staffLines[0].Measures[0];let o;this.staffLines.length>1&&(o=this.staffLines[this.staffLines.length-1].Measures[0]);const a=this.createSystemLine(n,e,Ge.SingleThin,bo.MeasureBegin,this,r,o);this.SystemLines.push(a),a.PositionAndShape.RelativePosition=new te(n,0),a.PositionAndShape.BorderLeft=0,a.PositionAndShape.BorderRight=e,a.PositionAndShape.BorderTop=0,a.PositionAndShape.BorderBottom=this.boundingBox.Size.height,this.createLinesForSystemLine(a)}createVerticalLineForMeasure(e,t,s,n,r,o){const a=o.ParentStaffLine,l=new te(a.PositionAndShape.RelativePosition.x,a.PositionAndShape.RelativePosition.y),u=a.ParentStaff.ParentInstrument.Staves;if(a.ParentStaff===u[0]){let h;u.length>1&&(h=this.getBottomStaffLine(a).Measures[r]);const c=this.createSystemLine(e,t,s,n,this,o,h),f=l.x+e;c.PositionAndShape.RelativePosition=new te(f,0),c.PositionAndShape.BorderLeft=0,c.PositionAndShape.BorderRight=t,this.SystemLines.push(c)}}setYPositionsToVerticalLineObjectsAndCreateLines(e){}calculateBorders(e){}alignBeginInstructions(){}GetLeftBorderAbsoluteXPosition(){return this.StaffLines[0].PositionAndShape.AbsolutePosition.x+this.StaffLines[0].Measures[0].beginInstructionsWidth}GetRightBorderAbsoluteXPosition(){return this.StaffLines[0].PositionAndShape.AbsolutePosition.x+this.StaffLines[0].StaffLines[0].End.x}AddGraphicalMeasures(e){for(let t=0,s=e.length;t1){let o,a;for(let l=0,u=this.staffLines.length;lthis.maxLabelLength&&(this.maxLabelLength=h.PositionAndShape.Size.width,t=r)}this.updateMusicSystemStaffLineXPosition(t)}setMusicSystemLabelsYPosition(){this.labels.forEach((e,t)=>{let s=0,n=0;for(let r=0;r0&&(t.PositionAndShape.RelativePosition=new te(0,s/n+2))})}checkStaffEntriesForStaffEntryLink(){let e=!1,t=!1;for(let s=0;s=0;s--){if(t=e.InstrumentalGroups[s],t instanceof Nd){if(t.Visible===!0)return t;continue}return this.findLastVisibleInstrumentInInstrumentalGroup(t)}}updateMusicSystemStaffLineXPosition(e){for(let t=0,s=this.StaffLines.length;t1}isVisible(){return this.ParentStaff.ParentInstrument.Visible}getGraphicalMeasureDurationFromStaffEntries(){let e=new re(0,1);const t=[];for(let s=0,n=this.staffEntries.length;s0&&o.Add(l.notes[0].graphicalNoteLength);e.lt(o)&&(e=re.createFromFraction(o))}return e}addGraphicalStaffEntry(e){this.staffEntries.push(e)}addGraphicalStaffEntryAtTimestamp(e){if(e)if(this.staffEntries.length===0||this.staffEntries[this.staffEntries.length-1].relInMeasureTimestamp.lt(e.relInMeasureTimestamp))this.staffEntries.push(e);else for(let t=this.staffEntries.length-1;t>=0;t--){if(this.staffEntries[t].relInMeasureTimestamp.lt(e.relInMeasureTimestamp)){this.staffEntries.splice(t+1,0,e);break}t===0&&this.staffEntries.splice(t,0,e)}}isPianoRightHand(){return this.isUpperStaffOfInstrument()}isPianoLeftHand(){return this.isLowerStaffOfInstrument()}isUpperStaffOfInstrument(){return this.parentStaff.ParentInstrument.Staves.length===1?!0:this.ParentStaff===this.parentStaff.ParentInstrument.Staves[0]}isLowerStaffOfInstrument(){return this.parentStaff.ParentInstrument.Staves.length===1?!1:this.ParentStaff===this.ParentStaff.ParentInstrument.Staves.last()}beginsWithLineRepetition(){const e=this.parentSourceMeasure;return e?e.beginsWithLineRepetition():!1}endsWithLineRepetition(){const e=this.parentSourceMeasure;return e?e.endsWithLineRepetition():!1}beginsWithWordRepetition(){const e=this.parentSourceMeasure;return e?e.beginsWithWordRepetition():!1}endsWithWordRepetition(){const e=this.parentSourceMeasure;return e?e.endsWithWordRepetition():!1}getTransposedHalftones(){return this.parentStaff.ParentInstrument.GetMusicSheet.Transpose+this.parentStaff.ParentInstrument.Transpose}}class k4 extends o4{constructor(e,t){super(e,t)}applyBordersFromVexflow(){const e=this.vfStaveNote;if(!e.getNoteHeadBeginX)return;const t=e.getBoundingBox(),s=e.getNoteHeadBeginX()-t.x;this.PositionAndShape.RelativePosition.y=t.y/Ve,this.PositionAndShape.BorderTop=0,this.PositionAndShape.BorderBottom=t.h/Ve,this.PositionAndShape.BorderLeft=-(s+e.width/2)/Ve,this.PositionAndShape.BorderRight=(t.w-s)/Ve}set vfStaveNote(e){this.mVexFlowStaveNote=e}get vfStaveNote(){return this.mVexFlowStaveNote}color(){var f;const e=this.rules.DefaultColorNotehead,t=this.rules.DefaultColorRest,s=this.rules.DefaultColorStem,n="#00000000";let r,o;const a=this.vfStaveNote;for(let d=0;dl.symbol_type===t))return;const a=new Ie.Repetition(t,n,-this.rules.RepetitionSymbolsYOffset);this.stave.addModifier(a,s);return}this.addVolta(e)}addVolta(e){var s;let t=Ie.Volta.type.BEGIN;if(e.type===Se.Ending){switch(e.alignment){case mt.Begin:this.parentSourceMeasure.endsRepetitionEnding()?t=Ie.Volta.type.BEGIN_END:t=Ie.Volta.type.BEGIN;break;case mt.End:if(this.parentSourceMeasure.beginsRepetitionEnding())return;t=Ie.Volta.type.END;break}const n=this.ParentStaffLine.SkyBottomLineCalculator,r=this.PositionAndShape.AbsolutePosition.x+this.PositionAndShape.BorderMarginLeft+.4,o=Math.max(this.PositionAndShape.AbsolutePosition.x+this.PositionAndShape.BorderMarginRight,r+.4),a=n.getSkyLineMinInRange(r,o)-2;let l=-6.1+this.rules.VoltaOffset,u=this.rules.VoltaOffset;if(a0){ge.trace(`Ghost Found in between (measure ${this.MeasureNumber})`);const c=this.createGhostGves(h);s.splice(o,0,...c),o+=c.length}}else{const h=re.minus(l,this.parentSourceMeasure.AbsoluteTimestamp);if(h.RealValue>0){ge.trace(`Ghost Found at start (measure ${this.MeasureNumber})`);const c=this.createGhostGves(h);s.splice(0,0,...c),o+=c.length}}t=u}const n=re.plus(this.parentSourceMeasure.AbsoluteTimestamp,this.parentSourceMeasure.Duration),r=re.minus(n,t);if(r.RealValue>0){ge.trace(`Ghost Found at end (measure ${this.MeasureNumber})`);const o=this.createGhostGves(r);s=s.concat(o)}return s}createGhostGves(e){const t=ot.GhostNotes(e),s=[];for(const n of t){const r=new k4(void 0,void 0);r.vfStaveNote=n,s.push(r)}return s}handleBeam(e,t){const s=e.sourceNote.ParentVoiceEntry.ParentVoice.VoiceId;let n=this.beams[s];n||(n=this.beams[s]=[]);let r;for(const a of n)a[0]===t&&(r=a);r||(r=[t,[]],n.push(r));const o=e.parentVoiceEntry;r[1].indexOf(o)<0&&r[1].push(o)}handleTuplet(e,t){const s=e.sourceNote.ParentVoiceEntry.ParentVoice.VoiceId;t=e.sourceNote.NoteTuplet;let n=this.tuplets[s];n||(n=this.tuplets[s]=[]);let r;for(const a of n)a[0]===t&&(r=a);r||(r=[t,[]],n.push(r));const o=e.parentVoiceEntry;r[1].indexOf(o)<0&&r[1].push(o)}finalizeBeams(){this.vfbeams={};const e=[];for(const t in this.beams)if(this.beams.hasOwnProperty(t)){let s=this.vfbeams[t];s||(s=this.vfbeams[t]=[]);for(const n of this.beams[t]){let r=!1;for(const d of n[0].Notes)if(d.Length.RealValue>=new re(1,4).RealValue&&(!d.TypeLength||d.TypeLength.RealValue>.125)){r=!0;break}if(r){ge.debug("Beam between note >= quarter, likely tremolo, currently unsupported. continuing.");continue}const o=[],a=n[0],l=n[1];let u=!0;for(const d of l)d.parentVoiceEntry.ParentVoice===a.Notes[0].ParentVoiceEntry.ParentVoice&&(u=d.parentVoiceEntry.WantedStemDirection===rt.Undefined);let h=!1,c;const f=[];for(const d of l){const p=d.vfStaveNote;p&&(o.push(p),e.push(p)),d.parentVoiceEntry.IsGrace&&(h=!0),d.parentVoiceEntry.StemColor&&this.rules.ColoringEnabled&&f.push(d.parentVoiceEntry.StemColor)}if(o.length>1){const d=new Ie.Beam(o,u);if(h&&(d.render_options.beam_width=3,d.render_options.partial_beam_length=4),f.length>=2&&this.rules.ColorBeams){c=f[0];for(const p of f)if(p!==c){c=void 0;break}d.setStyle({fillStyle:c,strokeStyle:c})}this.rules.FlatBeams&&(d.render_options.flat_beams=!0,d.render_options.flat_beam_offset=this.rules.FlatBeamOffset,d.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),s.push(d)}else ge.debug("Warning! Beam with no notes!")}}this.rules.AutoBeamNotes&&this.autoBeamNotes(e)}autoBeamNotes(e){if(!this.rules.AutoBeamTabs&&this.isTabMeasure)return;let t=[],s=[],n,r=[];this.autoTupletVfBeams=[];const o=[];this.autoVfBeams=[];let a=this.parentSourceMeasure.ActiveTimeSignature;a||(a=this.parentSourceMeasure.Duration);for(const h of this.staffEntries)for(const c of h.graphicalVoiceEntries){const f=c.vfStaveNote,d=c.notes[0],p=h.relInMeasureTimestamp.isOnBeat(a),g=s.length>=2,m=d.sourceNote.Length.RealValue-new re(1,4).RealValue>-re.FloatInaccuracyTolerance,b=c.parentVoiceEntry.IsGrace||m||e.contains(f);if(b||p){if(g){for(const v of s)t.push(v);o.push(t.slice()),t=[]}if(s=[],b)continue}const y=c.notes[0].sourceNote.NoteTuplet;if(y){let v=!1;for(const S of y.Notes){for(const A of S)if(A.NoteTypeXml>=yp.QUARTER||A.ParentVoiceEntry.IsGrace||A.isRest()&&!this.rules.AutoBeamOptions.beam_rests){v=!0;break}if(v)break}if(!n)n=y;else if(n!==y){if(r.length>1){const S=new Ie.Beam(r,!0);this.rules.FlatBeams&&(S.render_options.flat_beams=!0,S.render_options.flat_beam_offset=this.rules.FlatBeamOffset,S.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoTupletVfBeams.push(S)}r=[],n=y}v||r.push(f);continue}else n=void 0;s.push(f)}if(r.length>=2){const h=new Ie.Beam(r,!0);this.rules.FlatBeams&&(h.render_options.flat_beams=!0,h.render_options.flat_beam_offset=this.rules.FlatBeamOffset,h.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoTupletVfBeams.push(h)}if(s.length>=2){for(const h of s)t.push(h);o.push(t)}const l=this.rules.AutoBeamOptions,u={beam_middle_only:l.beam_middle_rests_only,beam_rests:l.beam_rests,maintain_stem_directions:l.maintain_stem_directions};if(l.groups&&l.groups.length){const h=[];for(const c of l.groups)h.push(new Ie.Fraction(c[0],c[1]));u.groups=h}for(const h of o){const c=Ie.Beam.generateBeams(h,u);for(const f of c)this.rules.FlatBeams&&(f.render_options.flat_beams=!0,f.render_options.flat_beam_offset=this.rules.FlatBeamOffset,f.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoVfBeams.push(f)}}finalizeTuplets(){this.vftuplets={};for(const e in this.tuplets)if(this.tuplets.hasOwnProperty(e)){let t=this.vftuplets[e];t||(t=this.vftuplets[e]=[]);for(const s of this.tuplets[e]){const n=[],r=s[1];for(const o of r)n.push(o.vfStaveNote);if(n.length>1){const o=s[0],a=o.Notes[0][0].NormalNotes,l=o.Bracket||o.TupletLabelNumber===3&&this.rules.TripletsBracketed||o.TupletLabelNumber!==3&&this.rules.TupletsBracketed;let u=Ie.Tuplet.LOCATION_TOP;o.tupletLabelNumberPlacement===ue.Below&&(u=Ie.Tuplet.LOCATION_BOTTOM),t.push(new Ie.Tuplet(n,{bracketed:l,location:u,notes_occupied:a,num_notes:o.TupletLabelNumber,ratioed:this.rules.TupletsRatioed}))}else ge.debug("Warning! Tuplet with no notes! Trying to ignore, but this is a serious problem.")}}}layoutStaffEntry(e){}graphicalMeasureCreatedCalculations(){let e,t=[];const s=[];for(const r of this.staffEntries){e=!1,t=[];for(const o of r.graphicalVoiceEntries){if(o.parentVoiceEntry.IsGrace){t.push(o),s.push(o),e||(e=o.parentVoiceEntry.GraceSlur);continue}if(o.vfStaveNote=ot.StaveNote(o),t.length>0){const a=[];for(let u=0;u0&&(h.GraceSlash=!1);const c=ot.StaveNote(h);h.vfStaveNote=c,a.push(c)}const l=new Ie.GraceNoteGroup(a,e);o.vfStaveNote.addModifier(0,l),t=[]}}}if(t.length>0)for(const r of t)r.vfStaveNote=ot.StaveNote(r),r.parentVoiceEntry.GraceAfterMainNote=!0;this.finalizeBeams(),this.finalizeTuplets();const n=this.getVoicesWithinMeasure();if(this.rules.RenderFingerings)for(const r of this.staffEntries)r.setModifierXOffsets();for(const r of n){if(!r)continue;this.vfVoices[r.VoiceId]=new Ie.Voice({beat_value:this.parentSourceMeasure.Duration.Denominator,num_beats:this.parentSourceMeasure.Duration.Numerator,resolution:Ie.RESOLUTION}).setMode(Ie.Voice.Mode.SOFT);const o=this.getRestFilledVexFlowStaveNotesPerVoice(r);for(const a of o){if(a.parentVoiceEntry&&a.parentVoiceEntry.IsGrace&&!a.parentVoiceEntry.GraceAfterMainNote)continue;const l=a;if(l.vfStaveNote.ticks.denominator===0)continue;if(a.notes.length===0||!a.notes[0]||!a.notes[0].sourceNote.PrintObject){this.vfVoices[r.VoiceId].addTickable(l.vfStaveNote);continue}const u=l.parentStaffEntry;if(u&&u.vfClefBefore){const h=new zM([u.vfClefBefore]);l.vfStaveNote.getCategory&&l.vfStaveNote.getCategory()==="stavenotes"&&l.vfStaveNote.addModifier(0,h)}a.parentVoiceEntry&&this.rules.RenderFingerings&&((this.rules.FingeringPosition===ue.Left||this.rules.FingeringPosition===ue.Right)&&this.createFingerings(a),this.createStringNumber(a)),this.createArpeggio(a),this.vfVoices[r.VoiceId].addTickable(l.vfStaveNote)}}this.setStemDirectionFromVexFlow();for(const r of s)this.createFingerings(r),this.createStringNumber(r),this.createArpeggio(r);this.createArticulations(),this.createOrnaments()}createArpeggio(e){if(e.parentVoiceEntry&&e.parentVoiceEntry.Arpeggio){const t=e.parentVoiceEntry.Arpeggio;if(e.notes&&e.notes.length>1){const s=ot.StrokeTypeFromArpeggioType(t.type),n=new Ie.Stroke(s,{all_voices:this.rules.ArpeggiosGoAcrossVoices});this.rules.RenderArpeggios&&e.vfStaveNote.addStroke(0,n)}else ge.debug(`[OSMD] arpeggio in measure ${this.MeasureNumber} could not be drawn. voice entry had less than two notes, arpeggio is likely between voice entries, not currently supported in Vexflow.`)}}setStemDirectionFromVexFlow(){for(const e of this.staffEntries)for(const t of e.graphicalVoiceEntries)for(const s of t.notes){const n=s.vfnote;if(!n||!n[0])continue;switch(n[0].getStemDirection()){case Ie.Stem.UP:t.parentVoiceEntry.StemDirection=rt.Up;break;case Ie.Stem.DOWN:t.parentVoiceEntry.StemDirection=rt.Down;break}}}createArticulations(){for(let e=0,t=this.staffEntries.length;e1||e.parentStaffEntry.graphicalVoiceEntries.length>1?u=Ie.StaveModifier.Position.LEFT:c.idInMusicSheet===0?(u=Ie.StaveModifier.Position.ABOVE,a=ue.Above):(u=Ie.StaveModifier.Position.BELOW,a=ue.Below)}const h=new Ie.FretHandFinger(o.value);if(h.setPosition(u),h.setOffsetX(l),a===ue.Above||a===ue.Below){const c=a===ue.Above?-1:1,f=a===ue.Above?n:s-1-n;if(this.rules.FingeringInsideStafflines&&s>1){const d=h.getWidth()/2,p=s*2.5;h.setOffsetY(c*(f+p)*d)}else if(!this.rules.FingeringInsideStafflines){const d=new Ie.StringNumber(o.value);d.radius=0,d.setPosition(u),d.setOffsetY(c*f*d.getWidth()*2/3),t.vfStaveNote.addModifier(n,d);continue}}t.vfStaveNote.addModifier(n,h)}}createStringNumber(e){if(!this.rules.RenderStringNumbersClassical)return;const t=e;e.notes.forEach((s,n)=>{const r=s.sourceNote.StringInstruction;if(r){let o=r.value;switch(o){case"1":o="I";break;case"2":o="II";break;case"3":o="III";break;case"4":o="IV";break;case"5":o="V";break;case"6":o="VI";break}const a=new Ie.StringNumber(o);a.radius=0;const l=-this.rules.StringNumberOffsetY;e.notes.length>1||e.parentStaffEntry.graphicalVoiceEntries.length>1?(a.setOffsetX(s.baseStringNumberXOffset*13),a.setPosition(Ie.Modifier.Position.RIGHT)):a.setPosition(Ie.Modifier.Position.ABOVE),a.setOffsetY(l),t.vfStaveNote.addModifier(n,a)}})}lineTo(e,t){const s=new Ie.StaveConnector(e.getVFStave(),this.stave);s.setType(t),this.connectors.push(s)}getVFStave(){return this.stave}updateInstructionWidth(){let e=0,t=0;const s=this.stave.getModifiers();for(const n of s)n.getPosition()===5?e+=n.getWidth()+n.getPadding(void 0):n.getPosition()===6&&(t+=n.getWidth()+n.getPadding(void 0));this.beginInstructionsWidth=(e!=null?e:0)/Ve,this.endInstructionsWidth=(t!=null?t:0)/Ve}addStaveTie(e,t){this.vfTies.push(e),t.vfTie=e}}class WM extends yi{constructor(e,t=void 0,s=void 0){super(),this.graphicalChordContainers=[],this.tabStaffEntry=void 0,this.MaxAccidentals=0,this.graphicalInstructions=[],this.ties=[],this.graphicalTies=[],this.lyricsEntries=[],this.parentMeasure=e,this.graphicalVoiceEntries=[],this.sourceStaffEntry=t,s?(this.staffEntryParent=s,this.parentVerticalContainer=s.parentVerticalContainer,this.PositionAndShape=new Ut(this,s.PositionAndShape)):this.PositionAndShape=new Ut(this,e.PositionAndShape),t&&(this.relInMeasureTimestamp=t.Timestamp),this.FingeringEntries=[]}get GraphicalInstructions(){return this.graphicalInstructions}get GraphicalTies(){return this.graphicalTies}get LyricsEntries(){return this.lyricsEntries}set LyricsEntries(e){this.lyricsEntries=e}getAbsoluteTimestamp(){const e=this.parentMeasure.parentSourceMeasure.AbsoluteTimestamp.clone();return this.relInMeasureTimestamp&&e.Add(this.relInMeasureTimestamp),e}findTieGraphicalNoteFromNote(e){var s;const t=((s=window.GYM)==null?void 0:s.graceCustom)||!1;for(const n of this.graphicalVoiceEntries)for(const r of n.notes){const o=r.sourceNote;if(t){if(e.NoteToGraphicalNoteObjectId==o.NoteToGraphicalNoteObjectId)return r}else if(!o.isRest()&&o.Pitch.FundamentalNote===e.Pitch.FundamentalNote&&o.Pitch.Octave===e.Pitch.Octave&&o.getAbsoluteTimestamp().Equals(e.getAbsoluteTimestamp()))return r}}findEndTieGraphicalNoteFromNoteWithStartingSlur(e,t){if(e){for(const s of this.graphicalVoiceEntries)if(s.parentVoiceEntry===e.ParentVoiceEntry)for(const n of s.notes){const r=n.sourceNote;if(r.NoteTie&&r.NoteSlurs.indexOf(t)!==-1)return n}}}findGraphicalNoteFromGraceNote(e){if(e){for(const t of this.graphicalVoiceEntries)if(t.parentVoiceEntry===e.ParentVoiceEntry){for(const s of t.notes)if(s.sourceNote===e)return s}}}findGraphicalNoteFromNote(e){if(e){for(const t of this.graphicalVoiceEntries)if(t.parentVoiceEntry===e.ParentVoiceEntry){for(const s of t.notes)if(s.sourceNote===e&&this.getAbsoluteTimestamp().Equals(e.getAbsoluteTimestamp()))return s}}}getGraphicalNoteDurationFromVoice(e){for(const t of this.graphicalVoiceEntries)if(t.parentVoiceEntry.ParentVoice===e)return t.notes[0].graphicalNoteLength;return new re(0,1)}findVoiceEntryGraphicalNotes(e){for(const t of this.graphicalVoiceEntries)if(t.parentVoiceEntry===e)return t.notes}isVoiceEntryPartOfLinkedVoiceEntry(e){if(this.sourceStaffEntry.Link)for(let t=0,s=this.sourceStaffEntry.Link.LinkStaffEntries.length;t0&&(e=n)}return e}findStaffEntryMaxNoteLength(){let e=new re(0,1);for(const t of this.graphicalVoiceEntries)for(const s of t.notes){const n=s.graphicalNoteLength;e.lt(n)&&n.GetExpandedNumerator()>0&&(e=n)}return e}findOrCreateGraphicalVoiceEntry(e){for(const s of this.graphicalVoiceEntries)if(s.parentVoiceEntry===e)return s;const t=Ue.symbolFactory.createVoiceEntry(e,this);return this.graphicalVoiceEntries.push(t),t}findOrCreateGraphicalVoiceEntryFromGraphicalNote(e){for(const s of this.graphicalVoiceEntries)if(s===e.parentVoiceEntry)return s;const t=Ue.symbolFactory.createVoiceEntry(e.sourceNote.ParentVoiceEntry,this);return this.graphicalVoiceEntries.push(t),t}addGraphicalNoteToListAtCorrectYPosition(e,t){const s=e.notes;if(s.length===0||t.PositionAndShape.RelativePosition.y=0;n--){if(s[n].PositionAndShape.RelativePosition.y>t.PositionAndShape.RelativePosition.y){s.splice(n+1,0,t);break}if(n===0){s.splice(0,0,t);break}}}hasOnlyRests(){for(const t of this.graphicalVoiceEntries)for(const s of t.notes)if(!s.sourceNote.isRest())return!1;return!0}getSkylineMin(){var n;const e=(n=this.parentMeasure)==null?void 0:n.ParentStaffLine.SkyBottomLineCalculator;if(!e)return;const[t,s]=this.getAbsoluteStartAndEnd();return e.getSkyLineMinInRange(t,s)}getHighestYAtEntry(){return this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.y+this.getSkylineMin()}getLowestYAtEntry(){return this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.y+this.getBottomlineMax()}getBottomlineMax(){var n;const e=(n=this.parentMeasure)==null?void 0:n.ParentStaffLine.SkyBottomLineCalculator;if(!e)return;const[t,s]=this.getAbsoluteStartAndEnd();return e.getBottomLineMaxInRange(t,s)}getAbsoluteStartAndEnd(){let e=this.PositionAndShape.AbsolutePosition.x;e-=this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.x;const t=e+this.PositionAndShape.Size.width;return[e,t]}}const YM=B.Flow;class QM extends WM{constructor(e,t,s){super(e,t,s)}calculateXPosition(){const e=this.parentMeasure.getVFStave();let t=0;for(const s of this.graphicalVoiceEntries)if(s.vfStaveNote){if(s.vfStaveNote.setStave(e),e&&e.getLines&&e.getLines()===1&&s.vfStaveNote.getStemDirection()<0&&(s.vfStaveNote.setStemDirection(YM.Stem.UP),s.parentVoiceEntry.StemDirection=rt.Up),!s.vfStaveNote.preFormatted)continue;s.applyBordersFromVexflow(),this.parentMeasure.ParentStaff.isTab?this.PositionAndShape.RelativePosition.x=(s.vfStaveNote.getAbsoluteX()+s.vfStaveNote.glyph.getWidth())/Ve:this.PositionAndShape.RelativePosition.x=s.vfStaveNote.getBoundingBox().getX()/Ve;const n=s.notes[0].sourceNote;n.isRest()&&n.Length.RealValue===this.parentMeasure.parentSourceMeasure.ActiveTimeSignature.RealValue&&(this.PositionAndShape.RelativePosition.x+=this.parentMeasure.parentSourceMeasure.Rules.WholeRestXShiftVexflow-.1,s.PositionAndShape.BorderLeft=-.7,s.PositionAndShape.BorderRight=.7),s.PositionAndShape.BorderLeftr.staffLine),s=this.calculateModifierXOffsets(t,1),n=this.calculateModifierXOffsets(t,.5);e.forEach((r,o)=>{r.baseFingeringXOffset=n[o],r.baseStringNumberXOffset=s[o]})}calculateModifierXOffsets(e,t){const s=[];for(let n=0;n=0;a--){if(Math.abs(e[n]-e[a])<=t&&r===s[a]){r++,o=!0;break}o=!1}s.push(r)}return s}}class _u extends B4{constructor(e,t,s,n=Qi.NONE,r,o=void 0){if(super(e,t,r,o),this.clef=s,this.octaveShift=n,e.Pitch){const a=e.isRest()?e.Pitch:Kc.getPitchFromOctaveShift(e.Pitch,n);this.vfpitch=ot.pitch(a,e.isRest(),this.clef,this.sourceNote.Notehead),this.vfpitch[1]=void 0}}setAccidental(e){const t=this.drawPitch(e);this.vfpitch=ot.pitch(t,this.sourceNote.isRest(),this.clef,this.sourceNote.Notehead),this.DrawnAccidental=t.Accidental}drawPitch(e){return Kc.getPitchFromOctaveShift(e,this.octaveShift)}Transpose(e,t,s,n){const r=super.Transpose(e,t,s,n),o=Kc.getPitchFromOctaveShift(r,this.octaveShift);return this.vfpitch=ot.pitch(o,this.sourceNote.isRest(),this.clef,this.sourceNote.Notehead),this.vfpitch[1]=void 0,o}setIndex(e,t){this.vfnote=[e,t],this.vfnoteIndex=t}notehead(e=void 0){let t=e;t||(t=this.vfnote[0]);const s=t.note_heads;return s&&s.length>this.vfnoteIndex&&s[this.vfnoteIndex]?t.note_heads[this.vfnoteIndex]:{line:0}}Clef(){return this.clef}getSVGId(){if(this.vfnote)return this.vfnote[0].getAttribute("id")}getSVGGElement(){if(this.vfnote)return this.vfnote[0].getAttribute("el")}getStemSVG(){return document.getElementById("vf-"+this.getSVGId()+"-stem")}getBeamSVGs(){const e=[];for(let t=0;;t++){const s=document.getElementById(`vf-${this.getSVGId()}-beam${t}`);if(!s)break;e.push(s)}return e}}class XM extends yi{constructor(e,t,s,n,r,o){super(),this.chordSymbolContainer=e,this.boundingBox=new Ut(this,t),this.rules=o,this.calculateLabel(s,r,n)}get GetChordSymbolContainer(){return this.chordSymbolContainer}get GraphicalLabel(){return this.graphicalLabel}calculateLabel(e,t,s){const n=T4.calculateChordText(this.chordSymbolContainer,t,s);this.graphicalLabel=new ei(new ft(n),e,this.rules.ChordSymbolTextAlignment,this.rules,this.boundingBox),this.graphicalLabel.PositionAndShape.RelativePosition=new te(this.rules.ChordSymbolRelativeXOffset,0),this.graphicalLabel.Label.colorDefault=this.rules.DefaultColorChordSymbol}}const Oa=B.Flow;class jM extends pa{constructor(e,t=void 0,s=void 0){super(e,t,s),this.isTabMeasure=!0}resetLayout(){var t;const e=(t=this.ParentStaff.StafflineCount)!=null?t:6;this.stave=new Oa.TabStave(0,0,0,{space_above_staff_ln:0,space_below_staff_ln:0,num_lines:e}),this.updateInstructionWidth()}graphicalMeasureCreatedCalculations(){for(let t=0,s=this.staffEntries.length;t1){const a=ot.StrokeTypeFromArpeggioType(o.type),l=new Oa.Stroke(a,{all_voices:this.rules.ArpeggiosGoAcrossVoices});this.rules.RenderArpeggios&&r.vfStaveNote.addStroke(0,l)}else ge.debug(`[OSMD] arpeggio in measure ${this.MeasureNumber} could not be drawn. voice entry had less than two notes, arpeggio is likely between voice entries, not currently supported in Vexflow.`)}this.vfVoices[t.VoiceId].addTickable(r.vfStaveNote)}}}}class KM extends yi{constructor(e,t){super(),this.measures=[],this.staffLines=new Array(5),this.octaveShifts=[],this.lyricLines=[],this.lyricsDashes=[],this.abstractExpressions=[],this.graphicalSlurs=[],this.Pedals=[],this.WavyLines=[],this.parentMusicSystem=e,this.parentStaff=t,this.boundingBox=new Ut(this,e.PositionAndShape),this.skyBottomLine=Ue.symbolFactory.createSkyBottomLineCalculator(this),this.staffHeight=this.parentMusicSystem.rules.StaffHeight,this.topLineOffset=0,this.bottomLineOffset=4,this.calculateStaffLineOffsets()}calculateStaffLineOffsets(){if(this.ParentStaff.isTab)switch(this.ParentStaff.StafflineCount){case 5:this.staffHeight=this.bottomLineOffset=this.ParentStaff.ParentInstrument.GetMusicSheet.Rules.TabStaffInterlineHeight*6;break;default:this.staffHeight=this.bottomLineOffset=this.ParentStaff.ParentInstrument.GetMusicSheet.Rules.TabStaffInterlineHeight*this.ParentStaff.StafflineCount;break}else switch(this.ParentStaff.StafflineCount){case 4:this.bottomLineOffset=1;break;case 3:this.topLineOffset=1,this.bottomLineOffset=1;break;case 2:this.topLineOffset=2,this.bottomLineOffset=1;break;case 1:this.topLineOffset=2,this.bottomLineOffset=2;break}}get Measures(){return this.measures}set Measures(e){this.measures=e}get StaffLines(){return this.staffLines}set StaffLines(e){this.staffLines=e}get Index(){return this.parentMusicSystem.StaffLines.indexOf(this)}get NextStaffLine(){const e=this.Index;return e!==this.parentMusicSystem.StaffLines.length?this.parentMusicSystem.StaffLines[e+1]:void 0}get LyricLines(){return this.lyricLines}get AbstractExpressions(){return this.abstractExpressions}set AbstractExpressions(e){this.abstractExpressions=e}set LyricLines(e){this.lyricLines=e}get LyricsDashes(){return this.lyricsDashes}set LyricsDashes(e){this.lyricsDashes=e}get ParentMusicSystem(){return this.parentMusicSystem}set ParentMusicSystem(e){this.parentMusicSystem=e}get ParentStaff(){return this.parentStaff}set ParentStaff(e){this.parentStaff=e}get SkyBottomLineCalculator(){return this.skyBottomLine}get SkyLine(){return this.skyBottomLine.SkyLine}get BottomLine(){return this.skyBottomLine.BottomLine}get OctaveShifts(){return this.octaveShifts}set OctaveShifts(e){this.octaveShifts=e}get StaffHeight(){return this.staffHeight}get TopLineOffset(){return this.topLineOffset}get BottomLineOffset(){return this.bottomLineOffset}get GraphicalSlurs(){return this.graphicalSlurs}addSlurToStaffline(e){this.graphicalSlurs.push(e)}addActivitySymbolClickArea(){const e=new i4(this),t=this.PositionAndShape;e.PositionAndShape.RelativePosition=new te(t.RelativePosition.x+t.BorderRight+.5,t.RelativePosition.y+.5),e.PositionAndShape.Parent=this.parentMusicSystem.PositionAndShape}isPartOfMultiStaffInstrument(){return this.parentStaff.ParentInstrument.Staves.length>1}findClosestStaffEntry(e){let t;for(let s=0,n=this.Measures.length;s0){const l=a.map(f=>f.PositionAndShape.Center.y),u=Math.max(...l),h=((r=window.GYM)==null?void 0:r.noNeedContinuousDynamic)||!1,c=((o=window.GYM)==null?void 0:o.noNeedGraphicalContinuousDynamic)||!1;for(let f=0;f0?a[f-1]:void 0;if(g){const b=this.getOverlap(d.PositionAndShape,g.PositionAndShape);d.squeeze(-(b.x+this.rules.DynamicExpressionSpacer))}if(m){const b=this.getOverlap(m.PositionAndShape,d.PositionAndShape);d.squeeze(b.x+this.rules.DynamicExpressionSpacer)}}}}}getDistance(e,t){const s=e.RelativePosition.x+e.BorderMarginRight,n=t.RelativePosition.x+t.BorderMarginLeft,r=e.RelativePosition.y+e.BorderMarginBottom,o=t.RelativePosition.y+t.BorderMarginTop;return new te(n-s,o-r)}getOverlap(e,t){return new te(e.RelativePosition.x+e.BorderMarginRight-(t.RelativePosition.x+t.BorderMarginLeft),e.RelativePosition.y+e.BorderMarginBottom-(t.RelativePosition.y+t.BorderMarginTop))}}class qM extends KM{constructor(e,t){super(e,t),this.slursInVFStaffLine=[],this.alignmentManager=new JM(this)}get SlursInVFStaffLine(){return this.slursInVFStaffLine}addVFSlurToVFStaffline(e){this.slursInVFStaffLine.push(e)}get AlignmentManager(){return this.alignmentManager}}const ZM=B.Flow;class $M extends pa{constructor(e,t=void 0,s=void 0){super(e,t,s),this.minimumStaffEntriesWidth=-1,s?this.rules=s.ParentMusicSystem.rules:t&&(this.rules=t.Rules),this.resetLayout(),this.multiRestElement=new ZM.MultiMeasureRest(t.multipleRestMeasures,{})}draw(e){var r,o,a,l,u;const t=e.openGroup();(r=t==null?void 0:t.classList)==null||r.add("vf-measure");const s=e.openGroup();(o=s==null?void 0:s.classList)==null||o.add("vf-stave"),s==null||s.setAttribute("id",(l=(a=this.stave)==null?void 0:a.attrs)==null?void 0:l.id),this.stave.setContext(e).draw(),e.closeGroup();const n=e.openGroup();(u=n==null?void 0:n.classList)==null||u.add("vf-voices"),this.multiRestElement.setStave(this.stave),this.multiRestElement.setContext(e),this.multiRestElement.draw(),e.closeGroup();for(const h of this.connectors)h.setContext(e).draw();return e.closeGroup(),t}format(){}getVoicesWithinMeasure(){return[]}getGraphicalVoiceEntriesPerVoice(e){return[]}getRestFilledVexFlowStaveNotesPerVoice(e){return[]}handleBeam(e,t){}handleTuplet(e,t){}finalizeBeams(){}finalizeTuplets(){}layoutStaffEntry(e){}graphicalMeasureCreatedCalculations(){}createArticulations(){}createOrnaments(){}createFingerings(e){}getVFStave(){return this.stave}}const eC=B.Flow;class O4{getInnerElement(){return this.inner}getCanvas(){return this.canvas}getRenderElement(){let e=this.canvas;return this.getVexflowBackendType()===eC.Renderer.Backends.CANVAS&&(e=this.inner),e}getRenderer(){return this.renderer}removeAllChildrenFromContainer(e){for(;e.children.length!==0;)e.removeChild(e.children.item(0))}removeFromContainer(e){const t=this.getRenderElement();for(let s=0;s \r<`)),r.download="opensheetmusicdisplay_download.svg",r.innerHTML=window.location.href+"/download",document.body.appendChild(r)}}class iC extends M4{constructor(e,t,s){super(e,t,s);const n=new ft(this.Expression);this.label=new ei(n,this.rules.ContinuousDynamicTextHeight,Oe.CenterCenter,this.rules,this.PositionAndShape),this.label.Label.fontStyle=Wt.BoldItalic,this.label.setLabelPositionAndShapeBorders(),this.PositionAndShape.calculateBoundingBox()}get InstantaneousDynamic(){return this.mInstantaneousDynamicExpression}get Expression(){return ip[this.mInstantaneousDynamicExpression.DynEnum]}}class sC extends yi{constructor(e,t){super(),this.getOctaveShift=e,this.setSymbol(),this.PositionAndShape=new Ut(this,t)}setSymbol(){switch(this.getOctaveShift.Type){case Qi.VA8:this.octaveSymbol=Yi.VA8;break;case Qi.VB8:this.octaveSymbol=Yi.VB8;break;case Qi.MA15:this.octaveSymbol=Yi.MA15;break;case Qi.MB15:this.octaveSymbol=Yi.MB15;break;default:throw new zn("")}}}const Fa=B.Flow;class d2 extends sC{constructor(e,t){switch(super(e,t),e.Type){case Qi.VA8:this.position=Fa.TextBracket.Positions.TOP,this.supscript="va",this.text="8";break;case Qi.MA15:this.position=Fa.TextBracket.Positions.TOP,this.supscript="ma",this.text="15";break;case Qi.VB8:this.position=Fa.TextBracket.Positions.BOTTOM,this.supscript="vb",this.text="8";break;case Qi.MB15:this.position=Fa.TextBracket.Positions.BOTTOM,this.supscript="mb",this.text="15";break;default:ge.error("Unknown or NONE octaveshift. This should not be called!");break}}setStartNote(e){for(const t of e.graphicalVoiceEntries){const s=t;if(s!=null&&s.vfStaveNote)return this.startNote=s.vfStaveNote,!0}return!1}setEndNote(e){for(const t of e.graphicalVoiceEntries){const s=t;if(s!=null&&s.vfStaveNote)return this.endNote=s.vfStaveNote,!0}return!1}getTextBracket(){return new Fa.TextBracket({position:this.position,start:this.startNote,stop:this.endNote,superscript:this.supscript,text:this.text})}}class Bl{constructor(e){this.staffPitchListMapping=new cs,this.baseLineNote=Le.B,this.baseLineOctave=1,this.rules=e}trackNote(e){if(!(e instanceof _u)||e.Clef().ClefType!==Lt.percussion||e.sourceNote.isRest()||this.rules.PercussionOneLineCutoff===0||this.rules.PercussionForceVoicesOneLineCutoff===-1)return;const t=e.parentVoiceEntry.parentStaffEntry.sourceStaffEntry.ParentStaff.idInMusicSheet;let s;this.staffPitchListMapping.containsKey(t)||this.staffPitchListMapping.setValue(t,new Array),s=this.staffPitchListMapping.getValue(t);const n=e.sourceNote.Pitch;Bl.findOrInsert(s,n)}static PitchIndexOf(e,t,s=0){if(s>e.length-1)return-1;for(let n=s;nthis.rules.PercussionOneLineCutoff&&!n)return e;const r=e,o=e.sourceNote.Pitch;let a=this.baseLineNote,l=this.baseLineOctave;if(this.rules.PercussionUseXMLDisplayStep&&e.sourceNote.displayStepUnpitched!==void 0&&(a=e.sourceNote.displayStepUnpitched,l=e.sourceNote.displayOctaveUnpitched+this.rules.PercussionOneLineXMLDisplayStepOctaveOffset),s.length<=this.rules.PercussionForceVoicesOneLineCutoff)r.setAccidental(new pt(a,l,o.Accidental));else{const u=Bl.PitchIndexOf(s,o);if(u>-1){const h=Math.ceil(s.length/2);if(!this.rules.PercussionUseXMLDisplayStep)if(u>=h)switch(l=2,(u-h)%5){case 1:a=Le.E;break;case 2:a=Le.G;break;case 3:a=Le.B;break;case 4:a=Le.D,l=3;break;default:a=Le.C;break}else switch(u%5){case 1:a=Le.F;break;case 2:a=Le.D;break;case 3:a=Le.B,l=0;break;case 4:a=Le.G,l=0;break;default:a=Le.A;break}const c=new pt(a,l,o.Accidental);r.setAccidental(c);const f=r.parentVoiceEntry.parentVoiceEntry;!this.rules.SetWantedStemDirectionByXml&&f.Notes.length<2&&(c.Octave>this.baseLineOctave||c.FundamentalNote===this.baseLineNote&&c.Octave===this.baseLineOctave?r.parentVoiceEntry.parentVoiceEntry.WantedStemDirection=rt.Up:r.parentVoiceEntry.parentVoiceEntry.WantedStemDirection=rt.Down)}}return r}getStafflineUniquePositionCount(e){return this.staffPitchListMapping.containsKey(e)?this.staffPitchListMapping.getValue(e).length:0}}class V4{constructor(e){this.mStaffLineParent=e,this.mRules=e.ParentMusicSystem.rules}calculateLines(){const e=Math.max(Math.ceil(this.StaffLineParent.PositionAndShape.Size.width*this.SamplingUnit),1);this.mSkyLine=[],this.mBottomLine=[];const t=new F4(this.StaffLineParent.ParentMusicSystem.rules);for(const o of this.StaffLineParent.Measures){o.PositionAndShape.calculateAbsolutePositionsRecursive(0,0);const a=o.getVFStave();let l=a.getWidth();if(!(l>0)&&!o.IsExtraGraphicalMeasure&&(ge.warn("SkyBottomLineCalculator: width not > 0 in measure "+o.MeasureNumber),l=50),!(l>=50)&&o.IsExtraGraphicalMeasure)continue;t.initializeHeadless(l);const u=t.getContext(),h=t.getCanvas();l=h.width;const c=h.height;this.mRules.DYMusicScoreType==="jianpu"?a.setY(a.y-50):a.setY(a.y+100);const f=a.getWidth();a.setWidth(l),o.format(),a.setWidth(f);try{o.draw(u)}catch(y){ge.warn("SkyBottomLineCalculator.calculateLines.draw",y)}const d=u.getImageData(0,0,l,c),p=4,g=Math.max(Math.ceil(o.PositionAndShape.Size.width*this.mRules.SamplingUnit),1),m=new Array(g),b=new Array(g);for(let y=0;y0){m[y]=v;break}}for(let v=c;v>0;v--){const A=v*l*p+y*p;if(d.data[A+3]>0){b[y]=v;break}}}for(let y=0;y(o-Math.max(...this.mSkyLine))/Ve+this.StaffLineParent.TopLineOffset),this.mBottomLine=this.mBottomLine.map(o=>(o-Math.min(...this.mBottomLine))/Ve+this.StaffLineParent.BottomLineOffset)}findPreviousValidNumber(e,t){for(let s=e;s>=0;s--)if(!isNaN(t[s]))return t[s];return 0}findNextValidNumber(e,t){if(e>=t.length)return t[e-1];for(let s=e;s=this.BottomLine.length&&(s=this.BottomLine.length-1),n<0&&(n=0),n>=this.BottomLine.length&&(n=this.BottomLine.length),this.SkyLine[s]=e.y;for(let o=s+1;o=this.BottomLine.length&&(s=this.BottomLine.length-1),n<0&&(n=0),n>=this.BottomLine.length&&(n=this.BottomLine.length),this.BottomLine[s]=e.y;for(let o=s+1;oe)}setBottomLineWithValue(e){this.BottomLine.forEach(t=>e)}getLeftIndexForPointX(e,t){const s=Math.floor(e*this.SamplingUnit);return s<0?0:s>=t?t-1:s}getRightIndexForPointX(e,t){const s=Math.ceil(e*this.SamplingUnit);return s<0?0:s>=t?t-1:s}updateStaffLineBorders(){this.mStaffLineParent.PositionAndShape.BorderTop=this.getSkyLineMin(),this.mStaffLineParent.PositionAndShape.BorderMarginTop=this.getSkyLineMin(),this.mStaffLineParent.PositionAndShape.BorderBottom=this.getBottomLineMax(),this.mStaffLineParent.PositionAndShape.BorderMarginBottom=this.getBottomLineMax()}getSkyLineMin(){return Math.min(...this.SkyLine.filter(e=>!isNaN(e)))}getSkyLineMinAtPoint(e){const t=Math.round(e*this.SamplingUnit);return this.mSkyLine[t]}getSkyLineMinInRange(e,t){return this.getMinInRange(this.SkyLine,e,t)}getBottomLineMax(){return Math.max(...this.BottomLine.filter(e=>!isNaN(e)))}getBottomLineMaxAtPoint(e){const t=Math.round(e*this.SamplingUnit);return this.mBottomLine[t]}getBottomLineMaxInRange(e,t){return this.getMaxInRange(this.BottomLine,e,t)}getBottomLineMaxInBoundingBox(e){const t=Math.floor(e.AbsolutePosition.x+e.BorderLeft),s=Math.ceil(e.AbsolutePosition.x+e.BorderRight);return this.getMaxInRange(this.mBottomLine,t,s)}updateWithBoundingBoxRecursively(e){if(e.ChildElements&&e.ChildElements.length>0)for(const t of e.ChildElements)this.updateWithBoundingBoxRecursively(t);else{const t=e.BorderTop+e.AbsolutePosition.y,s=e.BorderBottom+e.AbsolutePosition.y;if(t<0){const n=Math.floor(e.AbsolutePosition.x+e.BorderLeft),r=Math.ceil(e.AbsolutePosition.x+e.BorderRight);this.updateInRange(this.mSkyLine,n,r,t)}else if(s>this.StaffLineParent.StaffHeight){const n=Math.floor(e.AbsolutePosition.x+e.BorderLeft),r=Math.ceil(e.AbsolutePosition.x+e.BorderRight);this.updateInRange(this.mBottomLine,n,r,s)}}}updateInRange(e,t=0,s=e.length,n=0){if(t=Math.floor(t*this.SamplingUnit),s=Math.ceil(s*this.SamplingUnit),se.length&&(s=e.length);for(let r=t;rMath.abs(e[r])?n:e[r]}setInRange(e,t=0,s=e.length,n=0){if(t=Math.floor(t*this.SamplingUnit),s=Math.ceil(s*this.SamplingUnit),se.length&&(s=e.length);for(let r=t;r=e.length&&(t=e.length-1),s<0&&(s=0),s>=e.length&&(s=e.length),t>=0&&s<=e.length)return Math.min(...e.slice(t,s+1))}getMaxInRange(e,t,s){if(t=Math.floor(t*this.SamplingUnit),s=Math.ceil(s*this.SamplingUnit),!e)return Number.MIN_VALUE;if(t<0&&(t=0),t>=e.length&&(t=e.length-1),s<0&&(s=0),s>=e.length&&(s=e.length),t>=0&&s<=e.length)return Math.max(...e.slice(t,s+1))}get SamplingUnit(){return this.mRules.SamplingUnit}get StaffLineParent(){return this.mStaffLineParent}get SkyLine(){return this.mSkyLine}get BottomLine(){return this.mBottomLine}}var Dd={},nC={get exports(){return Dd},set exports(i){Dd=i}};/*! * d-path-parser - v1.0.0 * by Massimo Artizzu (MaxArt2501) * * https://github.com/MaxArt2501/d-path-parser * * Licensed under the MIT License * See LICENSE for details */(function(i,e){(function(t,s){i.exports=s()})(vt,function(){return function(s){for(var n={command:/\s*([achlmqstvz])/gi,number:/\s*([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/gi,comma:/\s*(?:(,)|\s)/g,flag:/\s*([01])/g},r={number:function(g){return+d("number",g)},"coordinate pair":function(g){var m=d("number",g);if(m===null&&!g)return null;d("comma");var b=d("number",!0);return{x:+m,y:+b}},"arc definition":function(g){var m=r["coordinate pair"](g);if(!m&&!g)return null;d("comma");var b=+d("number",!0);d("comma",!0);var y=!!+d("flag",!0);d("comma");var v=!!+d("flag",!0);d("comma");var S=r["coordinate pair"](!0);return{radii:m,rotation:b,large:y,clockwise:v,end:S}}},o=0,a=[];ot.bottom)switch(e.tagName.toLowerCase()){case"g":for(const f of e.children)this.recursiveUpdate(f,t,s,n);break;case"circle":case"rect":case"line":case"path":let h=Math.floor((r.x-s.x)/Ve*this.mRules.SamplingUnit);const c=h+Math.ceil(r.width/Ve*this.mRules.SamplingUnit);if(e.parentElement.classList.contains("vf-beams")&&e.hasAttribute("d")){const f=Dd(e.getAttribute("d"));if(f.length===5){const d=f[0],p=f[3],g=(p.end.y-d.end.y)/(p.end.x-d.end.x);let m=d.end.y/Ve;for(h;h<=c;h++)mu[h]&&(u[h]=m),m+=g/this.mRules.SamplingUnit}}else for(h;h<=c;h++)ou[h]&&(u[h]=a);break}}calculateLinesForMeasure(e,t){var P,x,M;const s=t.getBBox(),n=Math.max(Math.round(e.PositionAndShape.Size.width*this.mRules.SamplingUnit),1),r=s.height/Ve,a=t.getElementsByClassName("vf-stave")[0].getBBox();let l=(a==null?void 0:a.height)/Ve,u=(a==null?void 0:a.y)/Ve;const h=e.getVFStave();let c=((P=h.options)!=null&&P.num_lines?h.options.num_lines:5)-1,f=-1,d=0;const p=[c];for(const _ of(x=h.options)==null?void 0:x.line_config)_.visible?(f===-1&&(f=d),p.push(d)):c--,d++;const g=p.pop();f===-1&&(f=0),c=g-f;const m=(M=h.options)==null?void 0:M.spacing_between_lines_px,b=c*m/Ve;l-b>.2&&(l=b,u=f*m/Ve);const y=u+l,v=new Array(n).fill(u),S=new Array(n).fill(y),A=[v,S];if(r>l)for(const _ of t.children)this.recursiveUpdate(_,{top:u,bottom:y},s,[v,S]);return A}calculateLines(){this.mSkyLine=[],this.mBottomLine=[];const e=document.createElement("div");document.body.append(e);const t=new kd(this.mRules);t.initialize(e,1,"0");const s=t.getContext(),n=s.openGroup();n.classList.add("staffline");for(const r of this.StaffLineParent.Measures){r.PositionAndShape.calculateAbsolutePositionsRecursive(0,0),r.setAbsoluteCoordinates(r.PositionAndShape.AbsolutePosition.x*Ve,r.PositionAndShape.AbsolutePosition.y*Ve);const o=r.draw(s),[a,l]=this.calculateLinesForMeasure(r,o);this.mSkyLine.push(...a),this.mBottomLine.push(...l)}s.closeGroup();for(const r of n.getElementsByClassName("vf-ties"))for(const o of r.childNodes)if(o.nodeName.toLowerCase()==="path"){const a=o.getBBox();let l=Math.floor(a.x/Ve*this.mRules.SamplingUnit);const u=l+Math.ceil(a.width/Ve*this.mRules.SamplingUnit),h=a.y/Ve,c=a.height/Ve+h;for(l;l<=u;l++)hthis.mBottomLine[l]&&(this.mBottomLine[l]=c)}t.clear(),e.remove()}}const oC=B.Flow;class aC{constructor(){this.hasBBox=!1,document.createElementNS("http://www.w3.org/2000/svg","g").getBBox!==void 0&&(this.hasBBox=!0)}createMusicSystem(e,t){return new HM(e,t)}createStaffLine(e,t){return new qM(e,t)}createSkyBottomLineCalculator(e){return e.ParentMusicSystem.rules.PerformanceMode&&this.hasBBox?new rC(e):new V4(e)}createGraphicalMeasure(e,t,s=!1){return new pa(t,e,void 0)}createMultiRestMeasure(e,t,s){return new $M(t,e,s)}createTabStaffMeasure(e,t){return new jM(t,e)}createExtraGraphicalMeasure(e){const t=new pa(e.ParentStaff,void 0,e);return t.IsExtraGraphicalMeasure=!0,t.ExtraGraphicalMeasurePreviousMeasure=e.Measures.last(),t}createStaffEntry(e,t){return new QM(t,e,void 0)}createVoiceEntry(e,t){return new k4(e,t)}createNote(e,t,s,n=Qi.NONE,r,o=void 0){return new _u(e,t,s,n,r,o)}createGraceNote(e,t,s,n,r=Qi.NONE){return new _u(e,t,s,r,n)}addGraphicalAccidental(e,t){e.setAccidental(t)}addFermataAtTiedEndNote(e,t){}createInStaffClef(e,t){const s=e,n=ot.Clef(t,"small");s.vfClefBefore=new oC.ClefNote(n.type,n.size,n.annotation)}createChordSymbols(e,t,s,n){const r=t.parentMeasure.parentSourceMeasure.Rules;let o=0;const a=r.ChordSymbolXSpacing;for(const l of e.ChordContainers){const u=new XM(l,t.PositionAndShape,r.ChordSymbolTextHeight,s,n,t.parentMeasure.parentSourceMeasure.Rules),h=u.GraphicalLabel;h.PositionAndShape.RelativePosition.y-=r.ChordSymbolYOffset,h.PositionAndShape.RelativePosition.x+=o,h.setLabelPositionAndShapeBorders(),u.PositionAndShape.calculateBoundingBox(),t.graphicalChordContainers.push(u),o+=h.PositionAndShape.Size.width+a}}createGraphicalTechnicalInstruction(e,t){}}class lC{constructor(e,t=void 0,s=void 0){this.tie=e,this.startNote=t,this.endNote=s}get SVGElement(){return this.vfTie.getAttribute("el")}get GetTie(){return this.tie}get StartNote(){return this.startNote}get Tie(){return this.tie}set StartNote(e){this.startNote=e}get EndNote(){return this.endNote}set EndNote(e){this.endNote=e}}class Wr{constructor(e,t,s,n){this.lyricsEntry=e,this.graphicalStaffEntry=t;const r=t.parentMeasure.parentSourceMeasure.Rules.LyricsAlignmentStandard;e.Text.length>=4&&e.Parent.Notes[0].Length.Denominator>4&&Oe.LeftBottom;const o=new ft(e.Text);this.graphicalLabel=new ei(o,s,r,this.graphicalStaffEntry.parentMeasure.parentSourceMeasure.Rules,t.PositionAndShape),this.graphicalLabel.PositionAndShape.RelativePosition=new te(0,n),r===Oe.LeftBottom&&(this.graphicalLabel.PositionAndShape.RelativePosition.x-=1)}get LyricsEntry(){return this.lyricsEntry}get ParentLyricWord(){return this.graphicalLyricWord}set ParentLyricWord(e){this.graphicalLyricWord=e}get GraphicalLabel(){return this.graphicalLabel}set GraphicalLabel(e){this.graphicalLabel=e}get StaffEntryParent(){return this.graphicalStaffEntry}set StaffEntryParent(e){this.graphicalStaffEntry=e}}class cC{constructor(e){this.graphicalLyricsEntries=[],this.lyricWord=e,this.initialize()}get GetLyricWord(){return this.lyricWord}get GraphicalLyricsEntries(){return this.graphicalLyricsEntries}set GraphicalLyricsEntries(e){this.graphicalLyricsEntries=e}isFilled(){for(let e=0;e=Nt.bezierCurveStepSize?new te:new te(Nt.oneMinusTPow3[e]*this.bezierStartPt.x+Nt.bezierFactorOne[e]*this.bezierStartControlPt.x+Nt.bezierFactorTwo[e]*this.bezierEndControlPt.x+Nt.tPow3[e]*this.bezierEndPt.x,Nt.oneMinusTPow3[e]*this.bezierStartPt.y+Nt.bezierFactorOne[e]*this.bezierStartControlPt.y+Nt.bezierFactorTwo[e]*this.bezierEndControlPt.y+Nt.tPow3[e]*this.bezierEndPt.y)}};let G4=Nt;G4.bezierCurveStepSize=1e3;const jr=class extends G4{constructor(i,e){super(),this.staffEntries=[],this.slur=i,this.rules=e}static Compare(i,e){if(i.staffEntries.length<1)return-1;if(e.staffEntries.length<1)return 1;const t=re.minus(i.staffEntries[i.staffEntries.length-1].getAbsoluteTimestamp(),i.staffEntries[0].getAbsoluteTimestamp()),s=re.minus(e.staffEntries[e.staffEntries.length-1].getAbsoluteTimestamp(),e.staffEntries[0].getAbsoluteTimestamp());return t.RealValue>s.RealValue?1:s.RealValue>t.RealValue?-1:0}calculateCurve(i){const e=this.staffEntries[0],t=this.staffEntries[this.staffEntries.length-1];let s=e.findGraphicalNoteFromNote(this.slur.StartNote);!s&&this.graceStart&&(s=e.findGraphicalNoteFromGraceNote(this.slur.StartNote)),s||(s=e.findEndTieGraphicalNoteFromNoteWithStartingSlur(this.slur.StartNote,this.slur));let n=t.findGraphicalNoteFromNote(this.slur.EndNote);!n&&this.graceEnd&&(n=t.findGraphicalNoteFromGraceNote(this.slur.EndNote));const r=e.parentMeasure.ParentStaffLine,o=r.SkyBottomLineCalculator;this.calculatePlacement(o,r);const a=this.calculateStartAndEnd(s,n,r,i,o),l=a.startX,u=a.endX;let h=a.startY,c=a.endY;const f=i.SlurTangentMinAngle,d=i.SlurTangentMaxAngle;let p;if(this.placement===ue.Above){h-=i.SlurNoteHeadYOffset,c-=i.SlurNoteHeadYOffset;const g=new te(this.staffEntries[0].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[0].PositionAndShape.RelativePosition.x,h);s?g.x+=this.staffEntries[0].PositionAndShape.BorderRight:g.x=this.staffEntries[0].parentMeasure.beginInstructionsWidth,this.graceStart&&(g.x+=t.PositionAndShape.RelativePosition.x);const m=new te(this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].PositionAndShape.RelativePosition.x,c);if(n?m.x+=this.staffEntries[this.staffEntries.length-1].PositionAndShape.BorderLeft:m.x=this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.Size.width,this.graceEnd&&(m.x+=t.staffEntryParent.PositionAndShape.RelativePosition.x),p=this.calculateTopPoints(g,m,r,o),p.length===0){const se=new te((m.x-g.x)/2+g.x,(m.y-g.y)/2+g.y);p.push(se)}const b=Math.atan((c-h)/(u-l)),y=new te(0,0);let v=new te(u-l,-(c-h));const S=Tl.getRotationMatrix(b),A=S.getTransposeMatrix();v=S.vectorMultiplication(v);const P=this.calculateTranslatedAndRotatedPointListAbove(p,l,h,S);let x=this.calculateMaxLeftSlope(P,y,v),M=this.calculateMaxRightSlope(P,y,v);const _=y.y-y.x*x,T=v.y-v.x*M,D=new te;let C=!1;Math.abs(Math.abs(x)-Math.abs(M))<1e-4?(D.x=v.x/2,D.y=0,C=!0):(D.x=(T-_)/(x-M),D.y=x*D.x+_);const L=this.calculateHeightWidthRatio(v.x,P);let E=0,k=0;if(Math.abs(L)>.001){const se=Math.abs(x/(L*2)),he=Math.abs(x);E=Math.max(0,he*(Math.min(10,se-1)/10)),x-=E;const oe=Math.abs(M/(L*2)),be=Math.abs(M);k=Math.max(0,be*(Math.min(10,oe-1)/10)),M+=k}let Q=f,H=-f;if(!C){const se=this.calculateAngles(f,x,M,d);Q=se.startAngle,H=se.endAngle}const Z=this.calculateControlPoints(v.x,Q,H,P,L,h,c);let J=Z.startControlPoint,le=Z.endControlPoint;J=A.vectorMultiplication(J),J.x+=l,J.y=-J.y+h,le=A.vectorMultiplication(le),le.x+=l,le.y=-le.y+h,this.bezierStartPt=new te(l,h-E),this.bezierStartControlPt=new te(J.x,J.y-E),this.bezierEndControlPt=new te(le.x,le.y-k),this.bezierEndPt=new te(u,c-k);const X=r.SkyLine.length,O=o.getLeftIndexForPointX(this.bezierStartPt.x,X),fe=o.getLeftIndexForPointX(this.bezierEndPt.x,X),de=this.bezierEndPt.x-this.bezierStartPt.x,W=o.SamplingUnit;for(let se=O;se=O&&(r.SkyLine[be]=Math.min(r.SkyLine[be],oe.y)),be++,be.001){const se=Math.abs(x/(L*2)),he=Math.abs(x);E=Math.max(0,he*(Math.min(10,se-1)/10)),x-=E;const oe=Math.abs(M/(L*2)),be=Math.abs(M);k=Math.max(0,be*(Math.min(10,oe-1)/10)),M+=k}let Q=f,H=-f;if(!C){const se=this.calculateAngles(f,x,M,d);Q=se.startAngle,H=se.endAngle}const Z=this.calculateControlPoints(v.x,Q,H,P,L,h,c);let J=Z.startControlPoint,le=Z.endControlPoint;J=A.vectorMultiplication(J),J.x+=l,J.y+=h,le=A.vectorMultiplication(le),le.x+=l,le.y+=h,this.bezierStartPt=new te(l,h+E),this.bezierStartControlPt=new te(J.x,J.y+E),this.bezierEndControlPt=new te(le.x,le.y+k),this.bezierEndPt=new te(u,c+k);const X=r.BottomLine.length,O=o.getLeftIndexForPointX(this.bezierStartPt.x,X),fe=o.getLeftIndexForPointX(this.bezierEndPt.x,X),de=this.bezierEndPt.x-this.bezierStartPt.x,W=o.SamplingUnit;for(let se=O;se=O&&(r.BottomLine[be]=Math.max(r.BottomLine[be],oe.y)),be++,be0){this.placement=ue.Above;return}const t=this.staffEntries[0],s=this.staffEntries[this.staffEntries.length-1],n=t.graphicalVoiceEntries[0].parentVoiceEntry.StemDirection,r=s.graphicalVoiceEntries[0].parentVoiceEntry.StemDirection;if(n===r)this.placement=n===rt.Up?ue.Below:ue.Above;else{let o=t.PositionAndShape.BorderLeft+t.PositionAndShape.RelativePosition.x+t.parentMeasure.PositionAndShape.RelativePosition.x,a=s.PositionAndShape.BorderRight+s.PositionAndShape.RelativePosition.x+s.parentMeasure.PositionAndShape.RelativePosition.x;this.graceStart&&(o+=s.PositionAndShape.RelativePosition.x),this.graceEnd&&(a+=s.staffEntryParent.PositionAndShape.RelativePosition.x);const l=i.getSkyLineMinInRange(o,a)*-1;i.getBottomLineMaxInRange(o,a)-e.StaffHeight>l?this.placement=ue.Above:this.placement=ue.Below}}calculateTopPoints(i,e,t,s){const n=[];let r=s.getRightIndexForPointX(i.x,t.SkyLine.length),o=s.getLeftIndexForPointX(e.x,t.SkyLine.length);r<0&&(r=0),o>=t.SkyLine.length&&(o=t.SkyLine.length-1);for(let a=r;a=t.BottomLine.length&&(o=t.BottomLine.length-1);for(let a=r;au&&i>h&&(l+=i/70*this.rules.SlurHeightFlattenLongSlursFactorByWidth,l*=1+e/30*this.rules.SlurHeightFlattenLongSlursFactorByAngle,a/=l);const c=Math.min(.5,Math.max(.1,1.7*e/80*a*Math.pow(Math.max(n,.05),.4))),f=Math.min(.5,Math.max(.1,1.7*-t/80*a*Math.pow(Math.max(n,.05),.4))),d=new te;d.x=i*c*Math.cos(e*jr.degreesToRadiansFactor),d.y=i*c*Math.sin(e*jr.degreesToRadiansFactor);const p=new te;p.x=i-i*f*Math.cos(t*jr.degreesToRadiansFactor),p.y=-(i*f*Math.sin(t*jr.degreesToRadiansFactor));let g=d.y-p.y;for(;this.rules.SlurMaximumYControlPointDistance&&Math.abs(g)>this.rules.SlurMaximumYControlPointDistance;)g<0?(d.y+=1,p.y-=1):(d.y-=1,p.y+=1),g=d.y-p.y;return{startControlPoint:d,endControlPoint:p}}calculateAngles(i,e,t,s){let r=Math.atan(e)/jr.degreesToRadiansFactor;e>0?r+=20:r-=20;let o=Math.atan(t)/jr.degreesToRadiansFactor;t<0?o-=20:o+=20;const a=Math.min(Math.max(i,r),s),l=Math.max(Math.min(-i,o),-s);return{startAngle:a,endAngle:l}}};let Jc=jr;Jc.degreesToRadiansFactor=Math.PI/180;class uC extends yi{constructor(e,t){super(),this.getPedal=e,this.setSymbol(),this.PositionAndShape=new Ut(this,t)}setSymbol(){!this.getPedal.IsLine&&this.getPedal.IsSign?this.pedalSymbol=Yi.PEDAL_SYMBOL:this.getPedal.IsLine&&this.getPedal.IsSign?this.pedalSymbol=Yi.PEDAL_MIXED:this.pedalSymbol=Yi.PEDAL_BRACKET}}class Ef extends uC{constructor(e,t,s=!1,n=!1){switch(super(e,t),this.vfStyle=B.Flow.PedalMarking.Styles.BRACKET,this.ChangeBegin=!1,this.ChangeEnd=!1,this.line=-3,this.EndSymbolPositionAndShape=void 0,this.ChangeBegin=e.ChangeBegin,this.ChangeEnd=e.ChangeEnd,this.pedalSymbol){case Yi.PEDAL_SYMBOL:this.vfStyle=B.Flow.PedalMarking.Styles.TEXT,this.EndSymbolPositionAndShape=new Ut(this,t);break;case Yi.PEDAL_MIXED:s&&n?this.vfStyle=B.Flow.PedalMarking.Styles.BRACKET_OPEN_BOTH:s?this.vfStyle=B.Flow.PedalMarking.Styles.BRACKET_OPEN_BEGIN:n?this.vfStyle=B.Flow.PedalMarking.Styles.MIXED_OPEN_END:this.vfStyle=B.Flow.PedalMarking.Styles.MIXED;break;case Yi.PEDAL_BRACKET:default:s&&n?this.vfStyle=B.Flow.PedalMarking.Styles.BRACKET_OPEN_BOTH:s?this.vfStyle=B.Flow.PedalMarking.Styles.BRACKET_OPEN_BEGIN:n?this.vfStyle=B.Flow.PedalMarking.Styles.BRACKET_OPEN_END:this.vfStyle=B.Flow.PedalMarking.Styles.BRACKET;break}}setStartNote(e){if(!e)return!1;for(const t of e.graphicalVoiceEntries){const s=t;if(s!=null&&s.vfStaveNote)return this.startNote=s.vfStaveNote,this.startVfVoiceEntry=s,!0}return!1}setEndNote(e){if(!e)return!1;for(const t of e.graphicalVoiceEntries){const s=t;if(s!=null&&s.vfStaveNote)return this.endNote=s.vfStaveNote,this.endVfVoiceEntry=s,!0}return!1}setEndMeasure(e){this.endMeasure=e}CalculateBoundingBox(){}setLine(e){this.line=e}getPedalMarking(){var t,s,n,r;const e=new B.Flow.PedalMarking([this.startNote,this.endNote]);return this.endMeasure&&e.setEndStave(this.endMeasure.getVFStave()),e.setStyle(this.vfStyle),e.setLine(this.line),e.setCustomText(this.DepressText,this.ReleaseText),(((t=this.endVfVoiceEntry)==null?void 0:t.parentStaffEntry)===((r=(n=(s=this.endVfVoiceEntry)==null?void 0:s.parentStaffEntry)==null?void 0:n.parentMeasure)==null?void 0:r.staffEntries.last())||!this.endVfVoiceEntry)&&(e.EndsStave=!0),e.ChangeBegin=this.ChangeBegin,e.ChangeEnd=this.ChangeEnd,e}}class hC extends yi{constructor(e,t){super(),this.getWavyLine=e,this.PositionAndShape=new Ut(this,t)}}class p2 extends hC{constructor(e,t,s=!1){super(e,t),this.line=1,this.isVibrato=!1,this.toEndOfStopStave=!1,this.isVibrato=s}get ToEndOfStopStave(){return this.toEndOfStopStave}setStartNote(e){for(const t of e.graphicalVoiceEntries){const s=t;if(s!=null&&s.vfStaveNote)return this.startNote=s.vfStaveNote,this.startVfVoiceEntry=s,!0}return!1}setEndNote(e){for(const t of e.graphicalVoiceEntries){const s=t;if(s!=null&&s.vfStaveNote){this.endNote=s.vfStaveNote,this.endVfVoiceEntry=s;const n=this.endVfVoiceEntry.parentStaffEntry.parentMeasure.staffEntries,r=n[n.length-1];return this.toEndOfStopStave=r===this.endVfVoiceEntry.parentStaffEntry,!0}}return!1}CalculateBoundingBox(){const e=this.getVibratoBracket();this.boundingBox.Size.height=e.render_options.wave_height*.2}getVibratoBracket(){const e=new B.Flow.VibratoBracket({start:this.startNote,stop:this.endNote,toEndOfStopStave:this.toEndOfStopStave});return e.setLine(this.line),this.isVibrato?e.render_options.vibrato_width=20:e.render_options.wave_girth=4,e}}const Yr=B.Flow;class Pf extends Ue{constructor(e){var t,s,n,r,o,a,l,u;super(),this.beamsNeedUpdate=!1,this.isFirstZero=!1,this.rules=e,Ue.symbolFactory=new aC,Ue.TextMeasurer=new _4(this.rules),Ue.stafflineNoteCalculator=new Bl(this.rules),((t=this.rules.DefaultVexFlowNoteFont)==null?void 0:t.toLowerCase())==="gonville"?B.Flow.DEFAULT_FONT_STACK=[(s=B.Flow.Fonts)==null?void 0:s.Gonville,(n=B.Flow.Fonts)==null?void 0:n.Bravura,(r=B.Flow.Fonts)==null?void 0:r.Custom]:((o=this.rules.DefaultVexFlowNoteFont)==null?void 0:o.toLowerCase())==="petaluma"&&(B.Flow.DEFAULT_FONT_STACK=[(a=B.Flow.Fonts)==null?void 0:a.Petaluma,(l=B.Flow.Fonts)==null?void 0:l.Gonville,(u=B.Flow.Fonts)==null?void 0:u.Bravura])}clearRecreatedObjects(){super.clearRecreatedObjects(),Ue.stafflineNoteCalculator=new Bl(this.rules);for(const e of this.graphicalMusicSheet.MeasureList)for(const t of e)t==null||t.clean()}formatMeasures(){for(const e of this.graphicalMusicSheet.MeasureList){if(!e||!e[0])continue;e[0].format();for(const s of e){for(const n of s.staffEntries)n.calculateXPosition();s.finalizeBeams()}}this.beamsNeedUpdate=!1}calculateMeasureXLayout(e){const t=[];for(const h of e)h&&t.push(h);if(t.length===0)return 0;e=t;const s=[],n=new Yr.Formatter({softmaxFactor:this.rules.SoftmaxFactorVexFlow});let r=e[0].staffEntries.length,o=1;for(const h of e){if(!h)continue;let c=0;for(const p of h.staffEntries)c+=p.setMaxAccidentals();h.parentSourceMeasure.ImplicitMeasure&&(r=Math.max(h.staffEntries.length,r),o=Math.max(h.staffEntries.length+c,o));const f=h.vfVoices,d=[];for(const p in f)f.hasOwnProperty(p)&&(d.push(f[p]),s.push(f[p]));if(d.length===0){ge.debug("Found a measure with no voices. Continuing anyway.",f);continue}n.joinVoices(d)}let a=12;const l=e[0].parentSourceMeasure,u=.3;if(s.length>0){a=n.preCalculateMinTotalWidth(s)/Ve*this.rules.VoiceSpacingMultiplierVexflow+this.rules.VoiceSpacingAddendVexflow+r*u,l!=null&&l.ImplicitMeasure&&(a=l.Duration.RealValue/l.ActiveTimeSignature.RealValue*a,r>1&&(a+=o*u*1.5),a*=this.rules.PickupMeasureWidthMultiplier),Ue.setMeasuresMinStaffEntriesWidth(e,a);const h=(f,d)=>{n.formatToStave(s,d.getVFStave())},c=(f,d)=>{n.formatToStave(s,d.getVFStave(),{align_rests:!0,context:void 0})};for(const f of e){if(this.rules.AlignRests===hl.Never)f.formatVoices=h;else if(this.rules.AlignRests===hl.Always)f.formatVoices=c;else if(this.rules.AlignRests===hl.Auto){let d=!1;for(const p of f.staffEntries){let g=0,m=0;for(const b of p.graphicalVoiceEntries)if(b.parentVoiceEntry.IsGrace||b&&b.notes&&b.notes[0]&&b.notes[0].sourceNote&&b.notes[0].sourceNote.PrintObject&&g++,b&&b.notes&&b.notes[0]&&b.notes[0].sourceNote&&b.notes[0].sourceNote.isRest()&&b.notes[0].sourceNote.PrintObject&&m++,g>1&&m>=1){d=!0;break}if(d)break}d?f.formatVoices=c:f.formatVoices=h}if(f===e[0]){const d=f;d.formatVoices(a*Ve,d)}}}for(const h of e)if(h)for(const c of h.staffEntries)c.calculateXPosition();for(const h of e){if(!h)continue;const c=h.vfVoices,f=[];for(const d in c)c.hasOwnProperty(d)&&f.push(c[d]);if(f.length===0){ge.debug("Found a measure with no voices. Continuing anyway.",c);continue}n.joinVoices(f)}return a}calculateElongationFactor(e,t,s,n,r,o,a,l){let u=r,h=0;for(const c of e){const f=c.GraphicalLabel.Label.textAlignment;let d=a,p=l;if(c instanceof Wr&&c.ParentLyricWord){c.LyricsEntry.SyllableIndex>0&&(d=this.rules.BetweenSyllableMinimumDistance,bf.IsCenterAligned(f)&&(d+=1));const C=c.ParentLyricWord.GetLyricWord.Syllables;C.length>1&&c.LyricsEntry.SyllableIndex4&&(T*=1.1)}}else s[h]&&(T=v/S);M=Math.max(_,T),u=Math.max(u,M);let D=Math.max(v-S||0,0);s[h]&&(D+=s[h].cumulativeOverlap),s[h]={cumulativeOverlap:D,extend:c instanceof Wr?c.LyricsEntry.extend:!1,labelWidth:m,measureNumber:o,sourceNoteDuration:c instanceof Wr?c.LyricsEntry&&c.LyricsEntry.Parent.Notes[0].Length:!1,text:c instanceof Wr?c.LyricsEntry.Text:c.GraphicalLabel.Label.text,xPosition:y},h++}return u}calculateElongationFactorFromStaffEntries(e,t,s,n){let r=s;const o={},a={};for(const l of e)l.LyricsEntries.length>0&&(r=this.calculateElongationFactor(l.LyricsEntries,l,o,t,r,n,this.rules.HorizontalBetweenLyricsDistance,this.rules.LyricOverlapAllowedIntoNextMeasure)),l.graphicalChordContainers.length>0&&(r=this.calculateElongationFactor(l.graphicalChordContainers,l,a,t,r,n,this.rules.ChordSymbolXSpacing,this.rules.ChordOverlapAllowedIntoNextMeasure));return r}calculateMeasureWidthFromStaffEntries(e,t){var o;let s=1;if(!((o=window.GYM)==null?void 0:o.multitrack))for(const a of e)!a||a.staffEntries.length===0||(s=this.calculateElongationFactorFromStaffEntries(a.staffEntries,t,s,a.MeasureNumber),s=1);return s=Math.min(s,this.rules.MaximumLyricsElongationFactor),t*s}createGraphicalTie(e,t,s,n,r){return new lC(e,n,r)}updateStaffLineBorders(e){e.SkyBottomLineCalculator.updateStaffLineBorders()}graphicalMeasureCreatedCalculations(e){e.rules=this.rules,e.graphicalMeasureCreatedCalculations()}layoutVoiceEntry(e,t,s,n){for(let r=0;r=2&&(o=n.vfnote[0],a=n.vfnote[1]);let l,u=0;if(r&&r.vfnote&&r.vfnote.length>=2&&(l=r.vfnote[0],u=r.vfnote[1]),t){if(o){const m=new Yr.StaveTie({first_indices:[a],first_note:o}),b=n.parentVoiceEntry.parentStaffEntry.parentMeasure;if(l){l.getDuration()==="w"&&((c=(h=l.keyProps)==null?void 0:h[0])==null?void 0:c.line)>=3&&l.setStemDirection(-1);let y=((f=window.GYM)==null?void 0:f.tieDirection)||0;Math.abs(y)===1&&(((p=(d=l.keyProps)==null?void 0:d[0])==null?void 0:p.line)>=3?l.setStemDirection(-y):l.setStemDirection(y)),m==null||m.setDirection(l.getStemDirection())}if(b.vfTies.length>0){const y=b.vfTies[0].direction;m==null||m.setDirection(y?-y:1)}b.addStaveTie(m,e)}if(l){const m=new Yr.StaveTie({last_indices:[u],last_note:l}),b=r.parentVoiceEntry.parentStaffEntry.parentMeasure;if(b.vfTies.length>0){const y=b.vfTies[0].direction;m==null||m.setDirection(y?-y:1)}b.addStaveTie(m,e)}}else if(o||l){let m;if(s)if(e.Tie.Type==="S"){const v=e.StartNote.sourceNote,S=e.EndNote.sourceNote;let A=1;v.FretNumber>S.FretNumber&&(A=-1),m=new Yr.TabSlide({first_indices:[a],first_note:o,last_indices:[u],last_note:l},A)}else m=new Yr.TabTie({first_indices:[a],first_note:o,last_indices:[u],last_note:l},e.Tie.Type);else{m=new Yr.StaveTie({first_indices:[a],first_note:o,last_indices:[u],last_note:l});const v=e.Tie.getTieDirection(n.sourceNote);v===ue.Below?m.setDirection(1):v===ue.Above&&m.setDirection(-1);try{Math.abs((o==null?void 0:o.getTieRightX())-(l==null?void 0:l.getTieLeftX()))<10&&(m.render_options.first_x_shift=-3,m.render_options.last_x_shift=3)}catch(S){console.log(S)}}const b=r.parentVoiceEntry.parentStaffEntry.parentMeasure,y=((g=window.GYM)==null?void 0:g.graceCustom)||!1;y&&m.setDirection(y.direction),b.addStaveTie(m,e)}}calculateDynamicExpressionsForMultiExpression(e,t,s){if(tthis.rules.MaxMeasureToDrawIndex)return;const n=e.AbsoluteTimestamp,r=this.graphicalMusicSheet.MeasureList[t],o=r[s].ParentStaffLine,a=r[s];if(!o)return;const l=this.getRelativePositionInStaffLineFromTimestamp(n,s,o,o==null?void 0:o.isPartOfMultiStaffInstrument());if(l.x<=0&&(l.x=a.beginInstructionsWidth+this.rules.RhythmRightMargin),e.InstantaneousDynamic){const u=new iC(e.InstantaneousDynamic,o,a);this.calculateGraphicalInstantaneousDynamicExpression(u,l,n),this.dynamicExpressionMap.set(n.RealValue,u.PositionAndShape)}if(e.StartingContinuousDynamic){const u=e.StartingContinuousDynamic,h=new D4(e.StartingContinuousDynamic,o,a.parentSourceMeasure);if(h.StartMeasure=a,!h.IsVerbal&&u.EndMultiExpression)try{this.calculateGraphicalContinuousDynamic(h,l),h.updateSkyBottomLine()}catch(c){}else h.IsVerbal?this.calculateGraphicalVerbalContinuousDynamic(h,l):ge.warn("This continuous dynamic is not covered. measure"+e.SourceMeasureParent.MeasureNumber)}}createMetronomeMark(e,t){var y,v,S,A,P,x,M,_,T;const s=Math.max(e.ParentMultiTempoExpression.SourceMeasureParent.MeasureNumber-1,0),n=t||s,r=Math.max(e.StaffNumber-1,0),o=this.graphicalMusicSheet.MeasureList[n][r].getVFStave();let a="q";if(e.beatUnit){const D=da.getNoteDurationFromType(e.beatUnit);a=ot.durations(D,!1)[0]}let l=this.rules.MetronomeMarkYShift,u=!1;const h=[];if(e.parentMeasure){for(const D of e.parentMeasure.StaffLinkedExpressions)for(const C of D)C&&C instanceof Ho&&h.push(C);for(const D of e.parentMeasure.TempoExpressions){const C=((y=D.InstantaneousTempo)==null?void 0:y.Enum)===Nh.metronomeMark;if(!e.beatUnit&&D.InstantaneousTempo.beatUnit){const L=da.getNoteDurationFromType(e.beatUnit);a=ot.durations(L,!1)[0]}if(D.getPlacementOfFirstEntry()===ue.Above&&!C){u=!0;break}}}u&&(l-=1.4);const c=(v=this.graphicalMusicSheet.MeasureList[0][0].ParentStaffLine)==null?void 0:v.SkyLine;let f=e.TempoInBpm,d="",p="",g="";for(const D of this.graphicalMusicSheet.MeasureList[n][r].parentSourceMeasure.TempoExpressions){if(p=D.CombinedExpressionsText,vp(D.CombinedExpressionsText)){d=D.CombinedExpressionsText;break}if(Ar(D.CombinedExpressionsText)||wu(D.CombinedExpressionsText)){d=PM(D.CombinedExpressionsText),f=D.sourceMeasure.TempoInBPM,Ar(D.CombinedExpressionsText)&&(g=a);break}}const m={bpm:e.TempoInBpm,dots:e.dotted,duration:a,name:d};d&&(m.bpm=f/(m.dots?1.5:1),Ar(p)?m.duration=g:(f===Id[d]||!Id[d])&&(m.duration=""));const b=((A=(S=this.graphicalMusicSheet.MeasureList[n][r].vfVoices)==null?void 0:S[1])==null?void 0:A.boundingBox.y)||0;if(this.rules.MetronomeMarksDrawn){if(c){const E=((x=(P=this.graphicalMusicSheet.MeasureList[0])==null?void 0:P[r])==null?void 0:x.ParentStaffLine).Measures.map(k=>k.MeasureNumber-1);if(b&&E.includes(n)&&(Ar(p)||wu(p))){const k=c.slice(0,9);let Q=Math.min(...k);Q=Q<0?Q-1:Q,l+=Q}E.includes(n)&&h.length?c[0]=Math.min(c[0],-4.5+l-4):c[0]=Math.min(c[0],-4.5+l)}o.options.line_config.reduce((L,E)=>(E.visible&&L++,L),0)<5&&(l-=2),o.setTempo(m,l*Ve);let C=0;try{const L=(T=(_=(M=this.graphicalMusicSheet.MeasureList[n][r])==null?void 0:M.vfVoices)==null?void 0:_[1])==null?void 0:T.getTickables();C+=L[e.parentMeasure.metronomeNoteIndex].getBoundingBox().getX()-o.getNoteStartX()}catch(L){}o.getModifiers()[o.getModifiers().length-1].setShiftX(C)}}calculateRehearsalMark(e){var f,d,p,g,m;const t=e.rehearsalExpression;if(!this.isFirstZero&&e.MeasureNumber===0&&(this.isFirstZero=!0),!t)return;const s=this.graphicalMusicSheet.MeasureList[0][0].MeasureNumber,n=Math.max(e.measureListIndex+1-s,0),r=0,o=(f=this.graphicalMusicSheet.MeasureList[n][r])==null?void 0:f.getVFStave();if(!o)return;const a=-this.rules.RehearsalMarkYOffsetDefault-this.rules.RehearsalMarkYOffset;let l=this.rules.RehearsalMarkXOffsetDefault+this.rules.RehearsalMarkXOffset;e.IsSystemStartMeasure&&(l+=this.rules.RehearsalMarkXOffsetSystemStartMeasure);const u=this.rules.RehearsalMarkFontSize,h=o.getModifiers(),c=h.find(b=>b.getCategory().toLocaleLowerCase()==="repetitions");if(c&&c.setShiftY(c.y_shift-10),this.isFirstZero?o.setSection(e.MeasureNumberXML+1+"",a,l,u):o.setSection(t.label,a,l,u),(d=this.graphicalMusicSheet.MeasureList[n][r])!=null&&d.ParentStaffLine.AbstractExpressions){const b=h.find(y=>y.getCategory().toLocaleLowerCase()==="stavesection");for(let y of((m=(g=(p=e==null?void 0:e.VerticalMeasureList)==null?void 0:p[0])==null?void 0:g.ParentStaffLine)==null?void 0:m.AbstractExpressions)||[])y instanceof ul&&(b&&(y.Label.PositionAndShape.RelativePosition.y-=.5),c&&(y.Label.PositionAndShape.RelativePosition.y-=1.7))}}calculateSingleOctaveShift(e,t,s,n){var p;const r=t.OctaveShiftStart,o=r.ParentStartMultiExpression.Timestamp,a=(p=r.ParentEndMultiExpression)==null?void 0:p.Timestamp,l=this.rules.MinMeasureToDrawIndex,u=this.rules.MaxMeasureToDrawIndex;let h=this.graphicalMusicSheet.MeasureList[s][n].ParentStaffLine;h||(h=this.graphicalMusicSheet.MeasureList[l][n].ParentStaffLine);let c;r.ParentEndMultiExpression?c=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(r.ParentEndMultiExpression.SourceMeasureParent,n):c=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(n,!0),c.MeasureNumber>u+1&&(c=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(n,!0));let f;if(r.ParentEndMultiExpression?f=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(r.ParentStartMultiExpression.SourceMeasureParent,n):f=this.graphicalMusicSheet.MeasureList[l][n],f.MeasureNumberu||c.parentSourceMeasure.measureListIndexu)return;let d=c.ParentStaffLine;if(d||(d=h),c&&h&&d){const g=new d2(r,h.PositionAndShape);if(!g.startNote){let y;for(const v of f.staffEntries)if(v){y=v;break}if(!y||(g.setStartNote(y),!g.startNote))return}if(!g.endNote){let y;for(let v=c.staffEntries.length-1;v>=0;v++)if(c.staffEntries[v]){y=c.staffEntries[v];break}if(g.setEndNote(y),!g.endNote)return}let m=f.findGraphicalStaffEntryFromTimestamp(o);m||(m=f.staffEntries[0]);let b=c.findGraphicalStaffEntryFromTimestamp(a);if(b||(b=c.staffEntries[c.staffEntries.length-1]),g.setStartNote(m),d!==h){g.endsOnDifferentStaffLine=!0;let y=h.Measures[h.Measures.length-1];y===void 0&&(y=c);const v=y.staffEntries[y.staffEntries.length-1];g.setEndNote(v);const S=d.ParentMusicSystem.Id-h.ParentMusicSystem.Id;if(S>0)for(let A=h.ParentMusicSystem.Id;Au+1&&(c=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(n,!0));let f;if(r.ParentEndMultiExpression?f=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(r.ParentStartMultiExpression.SourceMeasureParent,n):(f=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(r.ParentStartMultiExpression.SourceMeasureParent,n),f||(f=this.graphicalMusicSheet.MeasureList[l][n])),f.MeasureNumberu||c.parentSourceMeasure.measureListIndexu)return;let d=c.ParentStaffLine;if(d||(d=h),c&&h&&d){let g=!1;h!==d&&(g=!0);const m=new Ef(r,h.PositionAndShape,!1,g);let b=f.findGraphicalStaffEntryFromTimestamp(o);b||(b=f.staffEntries[0]);let y=c.findGraphicalStaffEntryFromTimestamp(a);if(y||(y=c.staffEntries[c.staffEntries.length-1]),!m.setStartNote(b))return;if(d!==h)if(m.pedalSymbol===Yi.PEDAL_SYMBOL){m.setEndNote(y),m.setEndMeasure(c),m.ReleaseText=" ",m.CalculateBoundingBox(),this.calculatePedalSkyBottomLine(m.startVfVoiceEntry,m.endVfVoiceEntry,m,h);const v=d.Measures[0],S=new Ef(r,v.PositionAndShape),A=v.staffEntries[0];if(!S.setStartNote(A))return;S.setEndNote(y),m.setEndMeasure(c),d.Pedals.push(S),S.CalculateBoundingBox(),S.DepressText=" ",this.calculatePedalSkyBottomLine(S.startVfVoiceEntry,S.endVfVoiceEntry,S,d)}else{let v=h.Measures[h.Measures.length-1];v===void 0&&(v=c);const S=v.staffEntries[v.staffEntries.length-1];m.setEndNote(S),m.setEndMeasure(c),m.ChangeEnd=!1;const A=d.ParentMusicSystem.Id-h.ParentMusicSystem.Id;if(A>0){let P=1;for(let x=h.ParentMusicSystem.Id;xu+1&&(c=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(n,!0));let f;if(r.ParentEndMultiExpression?f=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(r.ParentStartMultiExpression.SourceMeasureParent,n):f=this.graphicalMusicSheet.MeasureList[l][n],f.MeasureNumberu||c.parentSourceMeasure.measureListIndexu)return;let d=c.ParentStaffLine;if(d||(d=h),c&&h&&d){const m=new p2(r,h.PositionAndShape,f.ParentStaff.isTab);let b=f.findGraphicalStaffEntryFromTimestamp(o);b||(b=f.staffEntries[0]);let y=c.findGraphicalStaffEntryFromTimestamp(a);if(y||(y=c.staffEntries[c.staffEntries.length-1]),m.setStartNote(b),d!==h){let v=h.Measures[h.Measures.length-1];v===void 0&&(v=c);const S=v.staffEntries[v.staffEntries.length-1];if(m.setEndNote(S),d.ParentMusicSystem.Id-h.ParentMusicSystem.Id>0)for(let P=h.ParentMusicSystem.Id;Pc){const v=c;c=h,h=v}n.SkyBottomLineCalculator.updateBottomLineInRange(h,c,f+b)}for(const b of n.Pedals){const y=b,v=y.getPedalMarking(),S=v.line+3+(n.StaffLines.length-1);if(f>S){const A=v.render_options.text_margin_right/10;let P=y.startVfVoiceEntry.PositionAndShape.AbsolutePosition.x-A,x;y.setLine(f-3-(n.StaffLines.length-1));let M=(p=y.endVfVoiceEntry)==null?void 0:p.PositionAndShape;if(M||(M=y.endMeasure.PositionAndShape),y.EndSymbolPositionAndShape){const _=a.render_options.glyph_point_size/20;x=P+3.4;const T=M.AbsolutePosition.x-A,D=T+1.5;n.SkyBottomLineCalculator.updateBottomLineInRange(P,x,f+_),n.SkyBottomLineCalculator.updateBottomLineInRange(T,D,f+_)}else{const _=v.render_options.bracket_height/10;if(v.EndsStave)x=M.AbsolutePosition.x+M.Size.width-A;else switch(a.style){case o.BRACKET_OPEN_END:case o.BRACKET_OPEN_BOTH:case o.MIXED_OPEN_END:x=M.AbsolutePosition.x+M.BorderRight-A;break;default:x=M.AbsolutePosition.x+M.BorderLeft-A;break}const T=(m=(g=y.endVfVoiceEntry)==null?void 0:g.parentStaffEntry)==null?void 0:m.vfClefBefore;if(T){const D=T.getWidth()/10;x+=D}if(P>x){const D=P;P=x,x=D}n.SkyBottomLineCalculator.updateBottomLineInRange(P,x,f+_)}}}}calculateOctaveShiftSkyBottomLine(e,t,s,n){if(!t){ge.warn("octaveshift: no endStaffEntry");return}let r=e.PositionAndShape.Size.width,o=t.PositionAndShape.Size.width;e.hasOnlyRests()?r=-r:r/=2,t.hasOnlyRests()?o*=2:o/=2,e===t&&(o*=2);const a=e.PositionAndShape.AbsolutePosition.x-r,l=t.PositionAndShape.AbsolutePosition.x+o;s.PositionAndShape.Size.width=a-l;const u=s.getTextBracket(),h=u.font.size/10;if(u.position===Yr.TextBracket.Positions.TOP){const c=Math.ceil(n.SkyBottomLineCalculator.getSkyLineMinInRange(a,l));if(c===1/0)return;u.start.getStave().options.top_text_position=Math.abs(c),n.SkyBottomLineCalculator.updateSkyLineInRange(a,l,c-h*2)}else{const c=n.SkyBottomLineCalculator.getBottomLineMaxInRange(a,l);if(c===1/0)return;u.start.getStave().options.bottom_text_position=c,e.parentMeasure!==t.parentMeasure&&(u.stop.getStave().options.bottom_text_position=c),n.SkyBottomLineCalculator.updateBottomLineInRange(a,l,c+h*1.5)}}calculateWordRepetitionInstruction(e,t){let s;const n=this.graphicalMusicSheet.MeasureList[t];for(let r=0,o=n.length;r{s.updateSkyBottomLine()})}catch(s){}}handleTiedGraphicalNote(e,t,s,n,r,o,a,l){}handleBeam(e,t,s){e.parentVoiceEntry.parentStaffEntry.parentMeasure.handleBeam(e,t)}handleVoiceEntryLyrics(e,t,s){e.LyricsEntries.forEach((n,r)=>{const o=new Wr(r,t,this.rules.LyricsHeight,this.rules.StaffHeight);if(t.LyricsEntries.push(o),o.GraphicalLabel.setLabelPositionAndShapeBorders(),r.Word){const l=r.Word.Syllables.indexOf(r);let u=s.indexOf(r.Word);if(u===-1&&(s.push(r.Word),u=s.indexOf(r.Word)),this.graphicalLyricWords.length===0||u>this.graphicalLyricWords.length-1){const h=new cC(r.Word);o.ParentLyricWord=h,h.GraphicalLyricsEntries[l]=o,this.graphicalLyricWords.push(h)}else{const h=this.graphicalLyricWords[u];o.ParentLyricWord=h,h.GraphicalLyricsEntries[l]=o,h.isFilled()&&(s.splice(u,1),this.graphicalLyricWords.splice(this.graphicalLyricWords.indexOf(h),1))}}})}handleVoiceEntryOrnaments(e,t,s){}handleVoiceEntryArticulations(e,t,s){}handleVoiceEntryTechnicalInstructions(e,t,s){}handleTuplet(e,t,s){e.parentVoiceEntry.parentStaffEntry.parentMeasure.handleTuplet(e,t)}findIndexGraphicalSlurFromSlur(e,t){for(let s=0;s=0){const c=n[h];c.staffEntries.indexOf(o)===-1&&c.staffEntries.push(o),n.splice(h,1)}}}for(const a of n)a.staffEntries.indexOf(o)===-1&&a.staffEntries.push(o)}}for(const t of this.musicSystems)for(const s of t.StaffLines){const n=s.GraphicalSlurs.sort(Jc.Compare);for(const r of n)r.slur.isCrossed()||r.calculateCurve(this.rules)}}}class fC{constructor(e){this.musicSheet=e}reInit(){this.init()}init(){this.parts=this.musicSheet.Repetitions.slice(),this.sheetStart=this.musicSheet.SelectionStart=new re(0,1),this.sheetEnd=this.musicSheet.SelectionEnd=this.musicSheet.SheetEndTimestamp,this.calcMapping()}getCurrentRepetitionTimestampTransform(e){let t;for(let s=this.timestamps.length-1;s>=0;s--)if(t=this.timestamps[s],e.gte(t.from))return t;return this.timestamps[0]}absoluteEnrolledToSheetTimestamp(e){if(this.timestamps.length===0)return e;const t=this.getCurrentRepetitionTimestampTransform(e);return re.plus(e,re.minus(t.to,t.from))}get Parts(){return this.parts}get MusicSheet(){return this.musicSheet}getIterator(e){return e?new la(this.musicSheet,e,void 0):new la(this.musicSheet,this.musicSheet.SelectionStart,this.musicSheet.SelectionEnd)}setSelectionStart(e){this.musicSheet.SelectionStart=e,this.musicSheet.SelectionEnd=void 0}setSelectionRange(e,t){this.musicSheet.SelectionStart=e!=null?e:this.sheetStart,this.musicSheet.SelectionEnd=t!=null?t:this.sheetEnd}calcMapping(){this.timestamps=[];const e=this.getIterator();let t=e.CurrentRepetition,s=new g2(e.CurrentEnrolledTimestamp.clone(),e.CurrentSourceTimestamp.clone(),void 0,0);for(this.timestamps.push(s);!e.EndReached;){if(e.JumpOccurred||t!==e.CurrentRepetition){if(t=e.CurrentRepetition,e.backJumpOccurred){const n=e.JumpResponsibleRepetition;s.nextBackJump=e.CurrentEnrolledTimestamp,s.curRepetition=n,s.curRepetitionIteration=e.CurrentJumpResponsibleRepetitionIterationBeforeJump;for(let r=this.timestamps.length-2;r>=0&&!(n.AbsoluteTimestamp.gt(this.timestamps[r].to)||this.timestamps[r].curRepetition);r--)this.timestamps[r].nextBackJump=s.nextBackJump,this.timestamps[r].curRepetition=n,this.timestamps[r].curRepetitionIteration=s.curRepetitionIteration}s=new g2(e.CurrentEnrolledTimestamp.clone(),e.CurrentSourceTimestamp.clone(),void 0,0),this.timestamps.push(s)}e.moveToNext()}}}class g2{constructor(e,t,s,n){this.from=e,this.to=t,this.curRepetition=s,this.curRepetitionIteration=n,this.nextBackJump=void 0,this.nextForwardJump=void 0}}class H4{constructor(e){this.enrolledTimestamps=[],this.visible=!0,this.musicSheet=e}get Visible(){return this.visible}set Visible(e){this.visible=e}getFirstSourceMeasure(){return this.musicSheet.SourceMeasures[this.startIndex]}getLastSourceMeasure(){return this.musicSheet.SourceMeasures[this.endIndex]}}class m2 extends H4{constructor(e,t,s){super(e),this.musicSheet=e,this.startIndex=t,this.endIndex=s}get MeasuresCount(){return this.endIndex-this.startIndex+1}get StartIndex(){return this.startIndex}get EndIndex(){return this.endIndex}get ParentRepetition(){return this.parentRepetition}set ParentRepetition(e){this.parentRepetition=e}get AbsoluteTimestamp(){return re.createFromFraction(this.musicSheet.SourceMeasures[this.startIndex].AbsoluteTimestamp)}setStartIndex(e){this.startIndex=e}setEndIndex(e){this.endIndex=e}}class Mu extends H4{constructor(e,t=!1){super(e),this.backwardJumpInstructions=[],this.endingParts=[],this.endingIndexDict={},this.userNumberOfRepetitions=0,this.visibles=[],this.fromWords=!1,this.repetitonIterationOrder=[],this.numberOfEndings=1,this.musicSheet2=e,this.virtualOverallRepetition=t}get BackwardJumpInstructions(){return this.backwardJumpInstructions}get EndingIndexDict(){return this.endingIndexDict}get EndingParts(){return this.endingParts}get Visibles(){return this.visibles}set Visibles(e){this.visibles=e}get DefaultNumberOfRepetitions(){let e=2;return this.virtualOverallRepetition&&(e=1),Math.max(e,Object.keys(this.endingIndexDict).length,this.checkRepetitionForMultipleLyricVerses())}get UserNumberOfRepetitions(){return this.userNumberOfRepetitions}set UserNumberOfRepetitions(e){this.userNumberOfRepetitions=e,this.repetitonIterationOrder=[];const t=this.userNumberOfRepetitions-this.NumberOfEndings;for(let s=1;s<=this.userNumberOfRepetitions;s++)s<=t?this.repetitonIterationOrder.push(1):this.repetitonIterationOrder.push(s-t)}getForwardJumpTargetForIteration(e){const t=this.repetitonIterationOrder[e-1];return this.endingIndexDict[t]?this.endingIndexDict[t].part.StartIndex:-1}getBackwardJumpTarget(){return this.startMarker.measureIndex}setEndingsStartIndex(e,t){const s=new b2(new m2(this.musicSheet2,t,t));this.endingParts.push(s);for(const n of e)try{this.endingIndexDict[n]=s,s.endingIndices.push(n),this.numberOfEndings0&&(n=1),r.Add(new re(n,t)),r}}class U4{constructor(){this.idString="random idString, not initialized",this.sourceMeasures=[],this.repetitions=[],this.dynListStaves=[],this.timestampSortedDynamicExpressionsList=[],this.timestampSortedTempoExpressionsList=[],this.instrumentalGroups=[],this.instruments=[],this.musicPartManager=void 0,this.musicSheetErrors=new hM,this.staves=[],this.playbackDataDict=new cs,this.transpose=0,this.defaultStartTempoInBpm=0,this.drawErroneousMeasures=!1,this.hasBeenOpenedForTheFirstTime=!1,this.currentEnrolledPosition=new re(0,1),this.soundTempos=new Map,this.playbackSettings=new wp,this.playbackSettings.rhythm=new re(4,4,0,!1),this.userStartTempoInBPM=100,this.pageWidth=120,this.MusicPartManager=new fC(this),this.hasBPMInfo=!1}get SoundTempos(){return this.soundTempos}set SoundTempos(e){this.soundTempos=e}static getIndexFromStaff(e){return e.idInMusicSheet}get CurrentKeyInstruction(){return this.currentKeyInstruction}set CurrentKeyInstruction(e){this.currentKeyInstruction=e}get SourceMeasures(){return this.sourceMeasures}set SourceMeasures(e){this.sourceMeasures=e}get Repetitions(){return this.repetitions}set Repetitions(e){this.repetitions=e}get DynListStaves(){return this.dynListStaves}get TimestampSortedTempoExpressionsList(){return this.timestampSortedTempoExpressionsList}get TimestampSortedDynamicExpressionsList(){return this.timestampSortedDynamicExpressionsList}get InstrumentalGroups(){return this.instrumentalGroups}get Parts(){return this.instruments}get Instruments(){return this.instruments}get SheetPlaybackSetting(){return this.playbackSettings}set SheetPlaybackSetting(e){this.playbackSettings=e}get DrawErroneousMeasures(){return this.drawErroneousMeasures}set DrawErroneousMeasures(e){this.drawErroneousMeasures=e}get HasBeenOpenedForTheFirstTime(){return this.hasBeenOpenedForTheFirstTime}set HasBeenOpenedForTheFirstTime(e){this.hasBeenOpenedForTheFirstTime=e}InitializeStartTempoInBPM(e){this.playbackSettings.BeatsPerMinute=e,this.userStartTempoInBPM=e}get DefaultStartTempoInBpm(){return this.defaultStartTempoInBpm}set DefaultStartTempoInBpm(e){this.defaultStartTempoInBpm=e,this.InitializeStartTempoInBPM(e)}get Path(){return this.path}set Path(e){this.path=e}get Staves(){return this.staves}get TitleString(){return this.title?this.title.text:""}set TitleString(e){this.Title=new ft(e)}get SubtitleString(){return this.subtitle?this.subtitle.text:""}set SubtitleString(e){this.Subtitle=new ft(e)}get ComposerString(){return this.composer?this.composer.text:""}set ComposerString(e){this.Composer=new ft(e)}get LyricistString(){return this.lyricist?this.lyricist.text:""}set LyricistString(e){this.Lyricist=new ft(e)}get Title(){return this.title}set Title(e){this.title=e}get Subtitle(){return this.subtitle}set Subtitle(e){this.subtitle=e}get Composer(){return this.composer}set Composer(e){this.composer=e}get Lyricist(){return this.lyricist}set Lyricist(e){this.lyricist=e}get Rules(){return this.rules||(ge.debug("warning: sheet.Rules was undefined. Creating new EngravingRules."),this.rules=new Ir),this.rules}set Rules(e){this.rules=e}get SheetErrors(){return this.musicSheetErrors}get PlaybackDataDict(){return this.playbackDataDict}get SelectionStart(){return this.selectionStart}set SelectionStart(e){this.selectionStart=e.clone(),this.currentEnrolledPosition=e.clone()}get SelectionEnd(){return this.selectionEnd}set SelectionEnd(e){this.selectionEnd=e}set HasBPMInfo(e){this.hasBPMInfo=e}get HasBPMInfo(){return this.hasBPMInfo}addMeasure(e){this.sourceMeasures.push(e),e.measureListIndex=this.sourceMeasures.length-1}checkForInstrumentWithNoVoice(){for(let e=0,t=this.instruments.length;e0){const e=this.TimestampSortedTempoExpressionsList[0];if(e.InstantaneousTempo)return e.InstantaneousTempo.TempoInBpm;if(e.ContinuousTempo)return e.ContinuousTempo.StartTempo}return this.userStartTempoInBPM}get Errors(){return this.musicSheetErrors.measureErrors}get FirstMeasureNumber(){try{return this.getFirstSourceMeasure().MeasureNumber}catch(e){return ge.info("MusicSheet.FirstMeasureNumber: ",e),0}}get LastMeasureNumber(){try{return this.getLastSourceMeasure().MeasureNumber}catch(e){return ge.info("MusicSheet.LastMeasureNumber: ",e),0}}get CurrentEnrolledPosition(){return this.currentEnrolledPosition.clone()}set CurrentEnrolledPosition(e){this.currentEnrolledPosition=e.clone()}get Transpose(){return this.transpose}set Transpose(e){this.transpose=e}get FullNameString(){return this.ComposerString+" "+this.TitleString}get IdString(){return this.idString}set IdString(e){this.idString=e}getEnrolledSelectionStartTimeStampWorkaround(){const e=this.MusicPartManager.getIterator(this.SelectionStart);return re.createFromFraction(e.CurrentEnrolledTimestamp)}get SheetEndTimestamp(){const e=this.getLastSourceMeasure();return re.plus(e.AbsoluteTimestamp,e.Duration)}getSourceMeasureFromTimeStamp(e){for(let t=0,s=this.sourceMeasures.length;t0&&n.Voices[0].Visible&&e.push(n)}return e}}U4.defaultTitle="[no title given]";class dC{constructor(){this.syllables=[]}get Syllables(){return this.syllables}containsVoiceEntry(e){for(let t=0,s=this.Syllables.length;t=0&&(this.syllableIndex=r)}get Text(){return this.text}set Text(e){this.text=e}get Word(){return this.word}get Parent(){return this.parent}set Parent(e){this.parent=e}get VerseNumber(){return this.verseNumber}get SyllableIndex(){return this.syllableIndex}}class pC{constructor(e){this.openLyricWords={},this.musicSheet=e}addLyricEntry(e,t){var s,n;if(e){const r=e;for(let o=0,a=r.length;o0)for(let S=b;S1&&(d=parseInt(m[1],10))}catch(m){const b=ze.translateText("ReaderErrorMessages/LyricVerseNumberError","Invalid lyric verse number");this.musicSheet.SheetErrors.pushMeasureError(b);continue}}let g;if(u==="single"||u==="end"){if(this.openLyricWords[d]){this.currentLyricWord=this.openLyricWords[d];const m=this.currentLyricWord.Syllables.length;g=new Va(c,d,this.currentLyricWord,t,m),this.currentLyricWord.Syllables.push(g),delete this.openLyricWords[d],this.currentLyricWord=void 0}else g=new Va(c,d,void 0,t);g.extend=l.element("extend")!==void 0}else if(u==="begin")this.openLyricWords[d]&&(delete this.openLyricWords[d],this.currentLyricWord=void 0),this.currentLyricWord=new dC,this.openLyricWords[d]=this.currentLyricWord,g=new Va(c,d,this.currentLyricWord,t,0),this.currentLyricWord.Syllables.push(g);else if(u==="middle")if(this.openLyricWords[d]){this.currentLyricWord=this.openLyricWords[d];const m=this.currentLyricWord.Syllables.length;g=new Va(c,d,this.currentLyricWord,t,m),this.currentLyricWord.Syllables.push(g)}else g=new Va(c,d,void 0,t);g&&(t.LyricsEntries[d]||(t.LyricsEntries.setValue(d,g),(n=(s=t.ParentSourceStaffEntry)==null?void 0:s.VerticalContainerParent)!=null&&n.ParentMeasure&&(t.ParentSourceStaffEntry.VerticalContainerParent.ParentMeasure.hasLyrics=!0)),t.ParentVoice.Parent.LyricVersesNumbers[d]||t.ParentVoice.Parent.LyricVersesNumbers.push(d))}}}catch(u){const h=ze.translateText("ReaderErrorMessages/LyricError","Error while reading lyric entry.");this.musicSheet.SheetErrors.pushMeasureError(h);continue}}t.ParentVoice.Parent.LyricVersesNumbers=t.ParentVoice.Parent.LyricVersesNumbers.filter((o,a,l)=>l.indexOf(o)===a)}}}class Ga{constructor(e,t){this.articulationEnum=e,this.placement=t}Equals(e){return e.articulationEnum===this.articulationEnum&&e.placement===this.placement}}class gC{constructor(e){this.rules=e}getAccEnumFromString(e){switch(e){case"sharp":return ke.SHARP;case"flat":return ke.FLAT;case"natural":return ke.NATURAL;case"double-sharp":case"sharp-sharp":return ke.DOUBLESHARP;case"double-flat":case"flat-flat":return ke.DOUBLEFLAT;case"triple-sharp":return ke.TRIPLESHARP;case"triple-flat":return ke.TRIPLEFLAT;case"quarter-sharp":return ke.QUARTERTONESHARP;case"quarter-flat":return ke.QUARTERTONEFLAT;case"three-quarters-sharp":return ke.THREEQUARTERSSHARP;case"three-quarters-flat":return ke.THREEQUARTERSFLAT;case"slash-quarter-sharp":return ke.SLASHQUARTERSHARP;case"slash-sharp":return ke.SLASHSHARP;case"double-slash-flat":return ke.DOUBLESLASHFLAT;case"sori":return ke.SORI;case"koron":return ke.KORON;default:return ke.NONE}}addArticulationExpression(e,t){var s,n;if(e!==void 0&&e.elements().length>0){const r=e.elements();for(let o=0,a=r.length;o0&&t.Articulations[0].articulationEnum!==et.staccato&&t.Articulations.splice(0,0,d),u==="strongaccent"){const p=(n=l==null?void 0:l.attribute("type"))==null?void 0:n.value;p==="up"?d.articulationEnum=et.marcatoup:p==="down"&&(d.articulationEnum=et.marcatodown)}if(u==="detachedlegato"){const p=new Ga(et.staccato,c),g=new Ga(et.tenuto,c);t.Articulations.push(p,g)}if(!t.hasArticulation(d))switch(t.Articulations.push(d),d.articulationEnum){case et.staccato:case et.staccatissimo:t.DurationModifier=d;break;case et.accent:case et.strongaccent:t.VolumeModifier=d;break;default:break}}}catch(h){const c="Invalid note articulation.";ge.debug("addArticulationExpression",c,h);return}}}}addFermata(e,t){var r;let s=et.fermata;e.attributes().length>0&&e.attribute("type")&&e.attribute("type").value==="inverted"&&(s=et.invertedfermata);let n=ue.Above;((r=e.attribute("placement"))==null?void 0:r.value)==="below"&&(n=ue.Below),t.Articulations.push(new Ga(s,n))}addTechnicalArticulations(e,t,s){var a,l;const n={bend:et.bend,"down-bow":et.downbow,"open-string":et.naturalharmonic,"snap-pizzicato":et.snappizzicato,stopped:et.lefthandpizzicato,"up-bow":et.upbow};for(const u in n){if(!n.hasOwnProperty(u))continue;const h=n[u],c=e.element(u);if(c){let f;((a=c.attribute("placement"))==null?void 0:a.value)==="above"&&(f=ue.Above),((l=c.attribute("placement"))==null?void 0:l.value)==="below"&&(f=ue.Below);const d=new Ga(h,f);t.hasArticulation(d)||t.Articulations.push(d)}}const r=e.element("fingering");if(r){const u=this.createTechnicalInstruction(r,s);u.type=Bd.Fingering,s.Fingering=u,t.TechnicalInstructions.push(u)}const o=e.element("string");if(o){const u=this.createTechnicalInstruction(o,s);u.type=Bd.String,s.StringInstruction=u,t.TechnicalInstructions.push(u)}}createTechnicalInstruction(e,t){const s=new vM;s.sourceNote=t,s.value=e.value;const n=e.attribute("placement");return this.rules.FingeringPositionFromXML&&(s.placement=this.getPlacement(n)),s}getPlacement(e,t=ue.NotYetDefined){if(t!==ue.NotYetDefined)return t;if(e)switch(e.value){case"above":return ue.Above;case"below":return ue.Below;case"left":return ue.Left;case"right":return ue.Right;default:return ue.NotYetDefined}else return ue.NotYetDefined}addOrnament(e,t){if(e){let s;const n={"delayed-inverted-turn":Mi.DelayedInvertedTurn,"delayed-turn":Mi.DelayedTurn,"inverted-mordent":Mi.InvertedMordent,"inverted-turn":Mi.InvertedTurn,mordent:Mi.Mordent,"trill-mark":Mi.Trill,turn:Mi.Turn};for(const r in n){if(!n.hasOwnProperty(r))continue;const o=e.element(r);if(o){s=new pM(n[r]);const a=o.attribute("placement");a&&a.value==="below"&&(s.placement=ue.Below)}}if(s){const r=e.elements("accidental-mark");if(r){let o=ue.Below,a=ke.NONE;const l=r;for(let u=0,h=l.length;u0&&(this.currentVoiceEntry.GraceVoiceEntriesBefore=this.graceVoiceEntriesTempList,this.graceVoiceEntriesTempList=[]))}finalizeReadingMeasure(){this.graceVoiceEntriesTempList.length>0&&this.currentNormalVoiceEntry!==void 0&&this.currentNormalVoiceEntry.GraceVoiceEntriesAfter.concat(this.graceVoiceEntriesTempList),this.graceVoiceEntriesTempList=[],this.pluginManager.processVoiceMeasureReadPlugins(this.currMeasureVoiceEntries,this.activeKey,this.activeRhythm),this.currMeasureVoiceEntries.length=0,this.openBeams.length>1&&this.handleOpenBeam()}read(e,t,s,n,r,o,a,l,u,h,c,f,d,p,g,m,b,y,v,S,A,P,x){this.currentStaffEntry=a,this.currentMeasure=l;try{this.currentNote=o?this.addRestNote(e.element("rest"),t,n,r,d,p,v):this.addSingleNote(e,t,n,s,r,c,f,d,p,g,m,b,y,v,A,P,x),this.currentNote.DotsXml=S;const M=e.elements("lyric");this.lyricsReader!==void 0&&M&&(this.lyricsReader.addLyricEntry(M,this.currentVoiceEntry),this.voice.Parent.HasLyrics=!0);let _=!1;const T=e.element("notations");if(T){this.articulationReader&&this.readArticulations(T,this.currentVoiceEntry,this.currentNote);const D=T.elements("slur");this.slurReader!==void 0&&D.length>0&&!this.currentNote.ParentVoiceEntry.IsGrace&&this.slurReader.addSlur(D,this.currentNote);const C=T.elements("tuplet");C.length>0&&(this.openTupletNumber=this.addTuplet(e,C),_=!0);const L=T.element("arpeggiate");if(L!==void 0){let H;if(this.currentVoiceEntry.Arpeggio)H=this.currentVoiceEntry.Arpeggio;else{let Z=!1;for(const J of this.currentStaffEntry.VoiceEntries)if(J.Arpeggio){Z=!0,H=J.Arpeggio;break}if(!Z){let J=vs.ARPEGGIO_DIRECTIONLESS;const le=L.attribute("direction");if(le)switch(le.value){case"up":J=vs.ROLL_UP;break;case"down":J=vs.ROLL_DOWN;break;default:J=vs.ARPEGGIO_DIRECTIONLESS}H=new fM(this.currentVoiceEntry,J),this.currentVoiceEntry.Arpeggio=H}}H.addNote(this.currentNote)}const E=T.elements("tied");E.length>0&&this.addTie(E,u,h,Xa.SIMPLE);const k=T.elements("slide");k.length>0&&this.addTie(k,u,h,Xa.SLIDE);const Q=T.element("technical");if(Q){const H=Q.elements("hammer-on");H.length>0&&this.addTie(H,u,h,Xa.HAMMERON);const Z=Q.elements("pull-off");Z.length>0&&this.addTie(Z,u,h,Xa.PULLOFF)}}e.element("time-modification")!==void 0&&!_&&this.handleTimeModificationNode(e)}catch(M){ge.warn(M);const _=ze.translateText("ReaderErrorMessages/NoteError","Ignored erroneous Note.");this.musicSheet.SheetErrors.pushMeasureError(_),this.musicSheet.SheetErrors.pushMeasureError(M)}return this.currentNote}checkForStaffEntryLink(e,t,s,n){const r=new bM(this.currentVoiceEntry);r.LinkStaffEntries.push(s),s.Link=r;const o=this.currentVoiceEntry.Timestamp.clone(),a=n.getVerticalContainerByTimestamp(o);return s=a.StaffEntries[e],s||(s=new di(a,t),a.StaffEntries[e]=s),s.VoiceEntries.push(this.currentVoiceEntry),r.LinkStaffEntries.push(s),s.Link=r,s}checkForOpenBeam(){this.openBeams.length>0&&this.currentNote&&this.handleOpenBeam()}checkOpenTies(){const e=this.openTieDict;for(const t in e)if(e.hasOwnProperty(t)){const s=e[t];re.plus(s.StartNote.ParentStaffEntry.Timestamp,s.Duration).lt(s.StartNote.SourceMeasure.Duration)&&delete e[t]}}hasVoiceEntry(){return this.currentVoiceEntry!==void 0}readArticulations(e,t,s){const n=e.element("articulations");n&&this.articulationReader.addArticulationExpression(n,t);const r=e.element("fermata");r&&this.articulationReader.addFermata(r,t);const o=e.element("technical");o&&this.articulationReader.addTechnicalArticulations(o,t,s);const a=e.element("ornaments");a&&this.articulationReader.addOrnament(a,t)}addSingleNote(e,t,s,n,r,o,a,l,u,h,c,f,d,p,g,m,b){let y=0,v,S=ke.NONE,A=Le.C,P=Le.C,x=0,M=0,_,T,D;const C=e.elements();for(let le=0,X=C.length;le0&&this.openBeams.last().ExtendedNoteList.push(p),p}addNoteInfo(e,t,s,n,r,o,a,l,u){e.NoteTypeXml=t,e.PrintObject=s,e.IsCueNote=n,e.NormalNotes=r,e.displayStepUnpitched=o,e.displayOctaveUnpitched=a,e.NoteheadColorXml=l,e.NoteheadColor=l}createBeam(e,t){var s;try{const n=e.element("beam");let r;if(n!==void 0&&n.hasAttributes&&(r=n.attribute("number")),r){let o=parseInt(r.value,10);const a=e.elements("beam"),l=a[0].value;a&&(l==="begin"?(o===((s=this.openBeams.last())==null?void 0:s.BeamNumber)?(this.beamNumberOffset++,o+=this.beamNumberOffset):this.openBeams.last()&&this.handleOpenBeam(),this.openBeams.push(new dM(o,this.beamNumberOffset))):o+=this.beamNumberOffset);let u=!1;if(!(o>0&&o<=this.openBeams.length)||!this.openBeams[o-1]){ge.debug("[OSMD] invalid beamnumber");return}for(let h=0,c=this.openBeams[o-1].Notes.length;h1){let n=e.element("time-modification");n&&(n=n.element("actual-notes"));const r=t;for(let o=0,a=r.length;o1&&this.openTupletNumber--),this.tupletDict[c]=d;const g=[];g.push(this.currentNote),d.Notes.push(g),d.Fractions.push(this.getTupletNoteDurationFromType(e)),this.currentNote.NoteTuplet=d,this.openTupletNumber=c}else if(h.value==="stop"){let c=1;l.attribute("number")&&(c=parseInt(l.attribute("number").value,10));const f=this.tupletDict[c];if(f){const d=l.attribute("placement");d&&(d.value==="below"?f.tupletLabelNumberPlacement=ue.Below:f.tupletLabelNumberPlacement=ue.Above,f.PlacementFromXml=!0);const p=[];if(p.push(this.currentNote),f.Notes.push(p),!f.PlacementFromXml){let g=!1;for(const m of f.Notes){for(const b of m)if(!b.isRest()){b.StemDirectionXml===rt.Down?f.tupletLabelNumberPlacement=ue.Below:f.tupletLabelNumberPlacement=ue.Above,g=!0;break}if(g)break}}f.Fractions.push(this.getTupletNoteDurationFromType(e)),this.currentNote.NoteTuplet=f,delete this.tupletDict[c],Object.keys(this.tupletDict).length===0?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--}}}}}else if(t[0]){const n=t[0];if(n.hasAttributes){const r=n.attribute("type").value;let o=1;n.attribute("number")&&(o=parseInt(n.attribute("number").value,10));const a=isNaN(o),l=n.attribute("bracket");if(l&&l.value==="yes"&&(s=!0),r==="start"){let u=0,h=e.element("time-modification");if(h&&(h=h.element("actual-notes")),h&&(u=parseInt(h.value,10),isNaN(u))){const p=ze.translateText("ReaderErrorMessages/TupletNoteDurationError","Invalid tuplet note duration.");throw this.musicSheet.SheetErrors.pushMeasureError(p),new pi(p)}a&&(this.openTupletNumber++,o=this.openTupletNumber);let c=this.tupletDict[o];c||(c=this.tupletDict[o]=new a2(u,s),c.tupletLabelNumberPlacement=ue.Above);const f=n.attribute("placement");f&&(f.value==="below"?c.tupletLabelNumberPlacement=ue.Below:c.tupletLabelNumberPlacement=ue.Above,c.PlacementFromXml=!0);const d=[];d.push(this.currentNote),c.Notes.push(d),c.Fractions.push(this.getTupletNoteDurationFromType(e)),this.currentNote.NoteTuplet=c,this.openTupletNumber=o}else if(r==="stop"){a&&(o=this.openTupletNumber);const u=this.tupletDict[this.openTupletNumber];if(u){const h=n.attribute("placement");h&&(h.value==="below"?u.tupletLabelNumberPlacement=ue.Below:u.tupletLabelNumberPlacement=ue.Above,u.PlacementFromXml=!0);const c=[];if(c.push(this.currentNote),u.Notes.push(c),!u.PlacementFromXml){let f=!1;for(const d of u.Notes){for(const p of d)if(!p.isRest()){p.StemDirectionXml===rt.Down?u.tupletLabelNumberPlacement=ue.Below:u.tupletLabelNumberPlacement=ue.Above,f=!0;break}if(f)break}}u.Fractions.push(this.getTupletNoteDurationFromType(e)),this.currentNote.NoteTuplet=u,Object.keys(this.tupletDict).length===0?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--,delete this.tupletDict[o]}}}}return this.openTupletNumber}handleTimeModificationNode(e){if(this.tupletDict[this.openTupletNumber])try{const t=this.tupletDict[this.openTupletNumber],s=Wn.last(t.Notes),n=s[0].ParentVoiceEntry;let r;n.Timestamp.Equals(this.currentVoiceEntry.Timestamp)?r=s:(r=[],t.Notes.push(r),t.Fractions.push(this.getTupletNoteDurationFromType(e))),r.push(this.currentNote),this.currentNote.NoteTuplet=t}catch(t){const s=ze.translateText("ReaderErrorMessages/TupletNumberError","Invalid tuplet number.");throw this.musicSheet.SheetErrors.pushMeasureError(s),t}else if(this.currentVoiceEntry.Notes.length>0){const t=this.currentVoiceEntry.Notes[0];if(t.NoteTuplet){const s=t.NoteTuplet;Wn.last(s.Notes).push(this.currentNote),this.currentNote.NoteTuplet=s}}}addTie(e,t,s,n){if(e){if(e.length===1){const r=e[0];if(r!==void 0&&r.attributes()){const o=this.getTieDirection(r),a=r.attribute("type").value;try{if(a==="start"){const l=this.findCurrentNoteInTieDict(this.currentNote);l<0&&delete this.openTieDict[l];const u=this.getNextAvailableNumberForTie(),h=new yM(this.currentNote,n);this.openTieDict[u]=h,h.TieNumber=u,h.TieDirection=o}else if(a==="stop"){const l=this.findCurrentNoteInTieDict(this.currentNote),u=this.openTieDict[l];u&&(u.AddNote(this.currentNote),delete this.openTieDict[l])}}catch(l){const u=ze.translateText("ReaderErrorMessages/TieError","Error while reading tie.");this.musicSheet.SheetErrors.pushMeasureError(u)}}}else if(e.length===2){const r=this.findCurrentNoteInTieDict(this.currentNote);if(r>=0){const o=this.openTieDict[r];o.AddNote(this.currentNote);for(const a of e)if(a.attribute("type").value==="start"){const u=this.getTieDirection(a);o.NoteIndexToTieDirection[o.Notes.length-1]=u}}}}}getTieDirection(e){let t=ue.NotYetDefined;const s=e.attribute("placement");s&&(s.value==="above"?t=ue.Above:s.value==="below"&&(t=ue.Below));const n=e.attribute("orientation");return n&&(n.value==="over"?t=ue.Above:n.value==="under"&&(t=ue.Below)),t}getNextAvailableNumberForTie(){const e=Object.keys(this.openTieDict);if(e.length===0)return 1;e.sort((t,s)=>+t-+s);for(let t=0;t0?n.RealValue>0?(u=re.multiply(re.minus(n,r),u),this.directionTimestamp=re.plus(u,n)):this.directionTimestamp=re.createFromFraction(u):this.offsetDivisions<0&&(n.RealValue>0?(u=re.multiply(re.minus(n,r),u),this.directionTimestamp=re.minus(n,u)):this.directionTimestamp=re.createFromFraction(u));const h=e.attribute("placement");if(h)try{const c=h.value;c==="below"?this.placement=ue.Below:c==="above"&&(this.placement=ue.Above)}catch(c){const f=ze.translateText("ReaderErrorMessages/ExpressionPlacementError","Invalid expression placement -> set to default.");ge.debug("ExpressionReader.readExpressionParameters",f,c),this.musicSheet.SheetErrors.pushMeasureError(f),this.placement=ue.Below}if(this.placement===ue.NotYetDefined)try{const c=e.element("direction-type");if(c){const f=c.element("dynamics");if(f){const m=f.attribute("default-y");m&&this.readExpressionPlacement(m,"read dynamics y pos")}const d=c.element("wedge");if(d){const m=d.attribute("default-y");m&&this.readExpressionPlacement(m,"read wedge y pos")}const p=c.element("words");if(p){const m=p.attribute("default-y");m&&this.readExpressionPlacement(m,"read words y pos")}const g=c.element("rehearsal");if(g){const m=g.attribute("default-y");m&&this.readExpressionPlacement(m,"read rehearsal pos")}}}catch(c){const f=ze.translateText("ReaderErrorMessages/ExpressionPlacementError","Invalid expression placement -> set to default.");ge.debug("ExpressionReader.readExpressionParameters",f,c),this.musicSheet.SheetErrors.pushMeasureError(f),this.placement=ue.Below}this.placement===ue.NotYetDefined&&(t.Staves.length>1?this.placement=ue.Below:t.HasLyrics?this.placement=ue.Above:this.placement=ue.Below)}read(e,t,s,n=void 0,r=0){let o=!1,a=!1;const l=e.element("sound");if(l){const c=l.attribute("tempo"),f=l.attribute("dynamics");if(c){const d=c.value.match(/^(\d+)(\.\d+)?$/);(d==null?void 0:d.length)>0?this.soundTempo=Math.round(Number.parseFloat(c.value)):(ge.info("invalid xml tempo: "+c.value),this.soundTempo=100),t.TempoInBPM=this.soundTempo,this.musicSheet.DefaultStartTempoInBpm===0&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),this.musicSheet.HasBPMInfo=!0,o=!0}if(f){const d=f.value.match(/\d+/);this.soundDynamic=d!==void 0?parseInt(d[0],10):100,a=!0}}const u=e.element("direction-type");if(!u)return;let h=u.element("metronome");if(h){t.metronomeNoteIndex=r;const c=h.element("beat-unit"),f=h.element("beat-unit-dot")!==void 0,d=h.element("per-minute");if(c!==void 0&&d){h.hasAttributes&&h.attribute("default-x")!==void 0&&(this.directionTimestamp=re.createFromFraction(s));const g=parseFloat(d.value);this.createNewTempoExpressionIfNeeded(t);const m=new bt(void 0,this.placement,this.staffNumber,g,this.currentMultiTempoExpression,!0);m.parentMeasure=t,this.soundTempo=g,t.TempoInBPM=this.soundTempo*(f?1.5:1),this.musicSheet.DefaultStartTempoInBpm===0&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),t.MeasureNumberXML===1&&this.musicSheet.SourceMeasures.length===0&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),this.musicSheet.HasBPMInfo=!0,m.dotted=f,m.beatUnit=c.value,this.currentMultiTempoExpression.addExpression(m,""),this.currentMultiTempoExpression.CombinedExpressionsText="test"}return}if(h=u.element("dynamics"),h){const c=e.element("notations")!==void 0;this.interpretInstantaneousDynamics(h,t,s,c);return}if(h=u.element("words"),h){const c=u.elements("words");let f="";for(const d of c)f+=d.value;if(h.value=f,o||Ar(h.value)||wu(h.value)){this.createNewTempoExpressionIfNeeded(t),this.currentMultiTempoExpression.CombinedExpressionsText=h.value,(Ar(h.value)||wu(h.value))&&(h.value=void 0);const d=new bt(h.value,this.placement,this.staffNumber,this.soundTempo,this.currentMultiTempoExpression);this.currentMultiTempoExpression.addExpression(d,"")}else a||this.interpretWords(h,t,s);return}if(h=u.element("wedge"),h){this.interpretWedge(h,t,n,t.MeasureNumber);return}if(h=u.element("rehearsal"),h){this.interpretRehearsalMark(h,t,s,t.MeasureNumber);return}}closeOpenExpressions(e,t){for(const s of this.openContinuousDynamicExpressions)this.createNewMultiExpressionIfNeeded(e,s.NumberXml,t),this.closeOpenContinuousDynamic(s,e,t);this.openContinuousTempoExpression&&this.closeOpenContinuousTempo(re.plus(e.AbsoluteTimestamp,t))}addOctaveShift(e,t,s){var a;let n=1;const r=e.element("staff");if(r)try{n=parseInt(r.value,10)}catch(l){const u=ze.translateText("ReaderErrorMessages/OctaveShiftStaffError","Invalid octave shift staff number -> set to default");this.musicSheet.SheetErrors.pushMeasureError(u),n=1,ge.debug("ExpressionReader.addOctaveShift",u,l)}const o=e.element("direction-type");if(o){const l=o.element("octave-shift"),u=this.readPlacement(e);if(l!==void 0&&l.hasAttributes)try{const h=this.readNumber(l);if(l.attribute("size")){const c=parseInt(l.attribute("size").value,10);let f=0;c===8?f=1:c===15&&(f=2);let d=(a=l.attribute("type"))==null?void 0:a.value;if(d||(u===ue.Above?d="down":u===ue.Below&&(d="up")),d==="up"||d==="down"){const p=new Kc(d,f);p.StaffNumber=n,this.getMultiExpression=this.createNewMultiExpressionIfNeeded(t,h),this.getMultiExpression.OctaveShiftStart=p,p.ParentStartMultiExpression=this.getMultiExpression,this.openOctaveShift=p}else if(d==="stop"){if(this.openOctaveShift){this.getMultiExpression=this.createNewMultiExpressionIfNeeded(t,this.openOctaveShift.numberXml,s);const p=this.getMultiExpression;p.OctaveShiftEnd=this.openOctaveShift,this.openOctaveShift.ParentEndMultiExpression=this.getMultiExpression,this.openOctaveShift=void 0}}else d||ge.debug("octave-shift missing type in xml")}}catch(h){const c=ze.translateText("ReaderErrorMessages/OctaveShiftError","Error while reading octave shift.");this.musicSheet.SheetErrors.pushMeasureError(c),ge.debug("ExpressionReader.addOctaveShift",c,h)}}}addPedalMarking(e,t,s){var r,o,a,l;const n=e.element("direction-type");if(n){const u=n.element("pedal");if(u!==void 0&&u.hasAttributes){let h=!1,c=!1;try{switch(((r=u.attribute("line"))==null?void 0:r.value)==="yes"?c=!0:((o=u.attribute("line"))==null?void 0:o.value)==="no"&&(c=!1,h=!0),((a=u.attribute("sign"))==null?void 0:a.value)==="yes"?h=!0:((l=u.attribute("sign"))==null?void 0:l.value)==="no"&&(h=!1,c=!0),u.attribute("type").value){case"start":this.openPedal&&this.openPedal.IsLine&&this.endOpenPedal(t),this.createNewMultiExpressionIfNeeded(t,-1),this.openPedal=new v2(c,h),this.getMultiExpression.PedalStart=this.openPedal,this.openPedal.ParentStartMultiExpression=this.getMultiExpression;break;case"stop":this.openPedal&&this.endOpenPedal(t);break;case"change":this.openPedal&&this.openPedal.IsLine&&(this.openPedal.ChangeEnd=!0,this.createNewMultiExpressionIfNeeded(t,-1),this.getMultiExpression.PedalEnd=this.openPedal,this.openPedal.ParentEndMultiExpression=this.getMultiExpression,this.createNewMultiExpressionIfNeeded(t,-1),this.openPedal=new v2(c,h),this.openPedal.ChangeBegin=!0,this.getMultiExpression.PedalStart=this.openPedal,this.openPedal.ParentStartMultiExpression=this.getMultiExpression);break;case"continue":break;default:break}}catch(f){const d=ze.translateText("ReaderErrorMessages/PedalError","Error while reading pedal.");this.musicSheet.SheetErrors.pushMeasureError(d),ge.debug("ExpressionReader.addPedalMarking",d,f)}}}}endOpenPedal(e){this.createNewMultiExpressionIfNeeded(e,-1),this.getMultiExpression.PedalEnd=this.openPedal,this.openPedal.ParentEndMultiExpression=this.getMultiExpression,this.openPedal=void 0}addWavyLine(e,t,s,n){if(e&&e.hasAttributes)try{switch(e.attribute("type").value){case"start":this.createNewMultiExpressionIfNeeded(t,-1),this.openWavyLine=new yC(this.placement),this.getMultiExpression.WavyLineStart=this.openWavyLine,this.openWavyLine.ParentStartMultiExpression=this.getMultiExpression;break;case"stop":this.openWavyLine&&(this.createNewMultiExpressionIfNeeded(t,-1,s),this.getMultiExpression.WavyLineEnd=this.openWavyLine,this.openWavyLine.ParentEndMultiExpression=this.getMultiExpression,this.openWavyLine=void 0);break;case"continue":break;default:break}}catch(r){const o=ze.translateText("ReaderErrorMessages/WavyLineError","Error while reading wavy-line.");this.musicSheet.SheetErrors.pushMeasureError(o),ge.debug("ExpressionReader.addWavyLine",o,r)}}initialize(){this.placement=ue.NotYetDefined,this.soundTempo=0,this.soundDynamic=0,this.offsetDivisions=0}readPlacement(e){var s;const t=(s=e.attribute("placement"))==null?void 0:s.value;return t==="above"?ue.Above:t==="below"?ue.Below:ue.NotYetDefined}readExpressionPlacement(e,t){try{const s=parseInt(e.value,10);s<0?this.placement=ue.Below:s>0&&(this.placement=ue.Above)}catch(s){ge.debug("ExpressionReader.readExpressionParameters",t,s)}}interpretInstantaneousDynamics(e,t,s,n){if(e.hasElements){e.hasAttributes&&e.attribute("default-x")&&(this.directionTimestamp=re.createFromFraction(s));const r=this.readNumber(e);let o=e.elements()[0].name;if(o==="other-dynamics"&&(o=e.elements()[0].value),o){n?this.createNewMultiExpressionIfNeeded(t,r,re.createFromFraction(s)):this.createNewMultiExpressionIfNeeded(t,r);const a=new Zn(o,this.soundDynamic,this.placement,this.staffNumber,t);a.InMeasureTimestamp=s.clone(),this.getMultiExpression.addExpression(a,""),this.initialize(),this.activeInstantaneousDynamic?this.activeInstantaneousDynamic.DynEnum=a.DynEnum:this.activeInstantaneousDynamic=new Zn(o,0,ue.NotYetDefined,1,t)}}}interpretWords(e,t,s){const n=e.value;let r;const o=e.attribute("font-style");if(o&&o.value==="italic"&&(r=Wt.Italic),n.length>0){if(e.hasAttributes&&e.attribute("default-x")&&(this.directionTimestamp=re.createFromFraction(s)),this.checkIfWordsNodeIsRepetitionInstruction(n))return;this.fillMultiOrTempoExpression(n,t,s,r),this.initialize()}}readNumber(e){var n;let t=1;const s=(n=e.attribute("number"))==null?void 0:n.value;return s&&(t=Number.parseInt(s,10)),t}interpretWedge(e,t,s,n){var o,a;e!==void 0&&e.hasAttributes&&e.attribute("default-x")&&(this.directionTimestamp=re.createFromFraction(s));const r=this.readNumber(e);((a=(o=e.attribute("type"))==null?void 0:o.value)==null?void 0:a.toLowerCase())==="stop"?this.createNewMultiExpressionIfNeeded(t,r,s):this.createNewMultiExpressionIfNeeded(t,r),this.addWedge(e,t,s),this.initialize()}interpretRehearsalMark(e,t,s,n){t.rehearsalExpression=new RM(e.value,this.placement)}createNewMultiExpressionIfNeeded(e,t,s=void 0){s||(s=this.directionTimestamp);let n=this.getMultiExpression;return(!n||n&&(n.SourceMeasureParent!==e||n.numberXml!==t||n.SourceMeasureParent===e&&n.Timestamp!==s))&&(this.getMultiExpression=n=new TM(e,re.createFromFraction(s)),e.StaffLinkedExpressions[this.globalStaffIndex].push(n)),n}createNewTempoExpressionIfNeeded(e){(!this.currentMultiTempoExpression||this.currentMultiTempoExpression.SourceMeasureParent!==e||this.currentMultiTempoExpression.Timestamp!==this.directionTimestamp)&&(this.currentMultiTempoExpression=new BM(e,re.createFromFraction(this.directionTimestamp)),e.TempoExpressions.push(this.currentMultiTempoExpression))}addWedge(e,t,s){if(e!==void 0&&e.hasAttributes){const n=this.readNumber(e),r=e.attribute("type").value.toLowerCase();try{if(r==="crescendo"||r==="diminuendo"){const o=new xs(ms[r],this.placement,this.staffNumber,t,this.activeInstantaneousDynamic,n);this.openContinuousDynamicExpressions.push(o);let a=this.getMultiExpression;a||(a=this.createNewMultiExpressionIfNeeded(t,n)),a.StartingContinuousDynamic=o,o.StartMultiExpression=a,this.activeInstantaneousDynamic!==void 0&&this.activeInstantaneousDynamic.StaffNumber===o.StaffNumber&&(this.activeInstantaneousDynamic=void 0)}else if(r==="stop")for(const o of this.openContinuousDynamicExpressions)o.NumberXml===n&&o.NumberXml===n&&this.closeOpenContinuousDynamic(o,t,s)}catch(o){const a="ReaderErrorMessages/WedgeError, Error while reading Crescendo / Diminuendo.";this.musicSheet.SheetErrors.pushMeasureError(a),ge.debug("ExpressionReader.addWedge",a,o)}}}fillMultiOrTempoExpression(e,t,s,n){if(!e)return;const r=e.trim();this.createExpressionFromString("",r,t,s,e,n)}createExpressionFromString(e,t,s,n,r,o){if(bt.isInputStringInstantaneousTempo(t)||Xn.isInputStringContinuousTempo(t)){if(s.TempoExpressions.length>0)for(let h=0,c=s.TempoExpressions.length;h0)for(let h=0,c=s.TempoExpressions.length;h0&&!this.hasDigit(t)&&this.globalStaffIndex>0){if(f.EntriesList[0].label.indexOf(t)>=0)return!1;break}}let l=Oe.CenterBottom;this.musicSheet.Rules.CompactMode&&(l=Oe.LeftBottom);const u=new Ho(t,this.placement,l,this.staffNumber);return u.fontStyle=o,a.addExpression(u,e),!1}closeOpenContinuousDynamic(e,t,s){if(!e)return;const n=e.NumberXml;e.EndMultiExpression=this.createNewMultiExpressionIfNeeded(t,n,s),e.StartMultiExpression.EndingContinuousDynamic=e,this.openContinuousDynamicExpressions=this.openContinuousDynamicExpressions.filter(r=>r!==e)}closeOpenContinuousTempo(e){this.openContinuousTempoExpression.AbsoluteEndTimestamp=e,this.openContinuousTempoExpression=void 0}checkIfWordsNodeIsRepetitionInstruction(e){return e=e.trim().toLowerCase(),e==="coda"||e==="tocoda"||e==="to coda"||e==="fine"||e==="d.c."||e==="dacapo"||e==="da capo"||e==="d.s."||e==="dalsegno"||e==="dal segno"||e==="d.c. al fine"||e==="d.s. al fine"||e==="d.c. al coda"||e==="d.s. al coda"}hasDigit(e){return/\d/.test(e)}}class SC{constructor(){}get StartNote(){return this.startNote}set StartNote(e){this.startNote=e}get EndNote(){return this.endNote}set EndNote(e){this.endNote=e}startNoteHasMoreStartingSlurs(){if(!this.startNote)return!1;for(let e=0,t=this.startNote.NoteSlurs.length;e0){const n=s.attribute("type").value;let r=1;try{s.attribute("number")&&(r=parseInt(s.attribute("number").value,10))}catch(u){ge.debug("VoiceGenerator.addSlur number: ",u)}let o=ue.NotYetDefined;const a=s.attribute("placement");a&&a.value&&(a.value==="above"?o=ue.Above:a.value==="below"&&(o=ue.Below));const l=s.attribute("orientation");if(l&&l.value&&(l.value==="over"?o=ue.Above:l.value==="under"&&(o=ue.Below)),n==="start"){let u=this.openSlurDict[r];u||(u=new SC,this.openSlurDict[r]=u),u.StartNote=t,u.PlacementXml=o}else if(n==="stop"){const u=this.openSlurDict[r];u&&(u.EndNote=t,t.checkForDoubleSlur(u)||(t.NoteSlurs.push(u),u.StartNote.NoteSlurs.push(u)),delete this.openSlurDict[r])}}}}catch(s){const n=ze.translateText("ReaderErrorMessages/SlurError","Error while reading slur.");this.musicSheet.SheetErrors.pushMeasureError(n)}}}class xC{constructor(e,t,s,n){this.voiceGeneratorsDict={},this.staffMainVoiceGeneratorDict={},this.divisions=0,this.currentClefNumber=1,this.currentXmlMeasureIndex=0,this.activeKeyHasBeenInitialized=!1,this.abstractInstructions=[],this.openChordSymbolContainers=[],this.soundTempos=new Map,this.xmlNotes=[],this.repetitionInstructionReader=t,this.xmlMeasureList=s,this.musicSheet=n.GetMusicSheet,this.instrument=n,this.activeClefs=new Array(n.Staves.length),this.activeClefsHaveBeenInitialized=new Array(n.Staves.length);for(let r=0;r=this.xmlMeasureList.length)return!1;this.currentMeasure=e,this.followingMultirestMeasures=Math.max(this.followingMultirestMeasures-1,0),this.inSourceMeasureInstrumentIndex=this.musicSheet.getGlobalStaffIndexOfFirstStaff(this.instrument),this.repetitionInstructionReader&&this.repetitionInstructionReader.prepareReadingMeasure(e,this.currentXmlMeasureIndex);let n=new re(0,1),r=new re(0,1),o=!1;this.maxTieNoteFraction=new re(0,1);let a=!1;const l=[];try{const v=this.xmlMeasureList[this.currentXmlMeasureIndex],S=v.elements();if(e.Rules.UseXMLMeasureNumbers&&!Number.isInteger(e.MeasureNumberXML)){const P=parseInt((u=v.attribute("number"))==null?void 0:u.value,10);Number.isInteger(P)&&(e.MeasureNumberXML=P)}let A;for(let P=0;P0&&(A=S[P-1]),x.name==="print"){const M=x.attribute("new-system");(M==null?void 0:M.value)==="yes"&&(e.printNewSystemXml=!0);const _=x.attribute("new-page");(_==null?void 0:_.value)==="yes"&&(e.printNewPageXml=!0)}else if(x.name==="note"){x.element("grace")||(this.xmlNotes.push(x),l.push(x));let M=!0;((h=x.attribute("print-object"))==null?void 0:h.value)==="no"&&(M=!1);let _=1;this.instrument.Staves.length>1&&x.element("staff")&&(_=parseInt(x.element("staff").value,10),isNaN(_)&&(ge.debug("InstrumentReader.readNextXmlMeasure.get staff number"),_=1)),this.currentStaff=this.instrument.Staves[_-1];const T=x.element("chord")!==void 0;if(x.element("voice")){const F=parseInt(x.element("voice").value,10);this.currentVoiceGenerator=this.getOrCreateVoiceGenerator(F,_-1)}else(!T||!this.currentVoiceGenerator)&&(this.currentVoiceGenerator=this.getOrCreateVoiceGenerator(1,_-1));let D=0,C=new re(0,1),L=2,E,k=!1;if(x.element("duration")){if(D=parseInt(x.element("duration").value,10),isNaN(D)){const F=ze.translateText("ReaderErrorMessages/NoteDurationError","Invalid Note Duration.");this.musicSheet.SheetErrors.pushMeasureError(F),ge.debug("InstrumentReader.readNextXmlMeasure",F);continue}else if(C=new re(D,4*this.divisions),D===0?C=this.getNoteDurationFromTypeNode(x):E=this.getNoteDurationFromTypeNode(x),x.element("time-modification")){C=this.getNoteDurationForTuplet(x);const F=x.element("time-modification");F!=null&&F.element("normal-notes")&&(L=parseInt(F.element("normal-notes").value,10)),k=!0}}const Q=x.element("rest")!==void 0,H=x.element("notations"),Z=x.element("grace")!==void 0||D===0||T&&a;let J=!1,le=!1;if(Z){const F=x.element("duration"),q=x.element("grace");q&&q.attributes()&&q.attribute("slash")&&q.attribute("slash").value==="yes"&&(J=!0),F||(C=this.getNoteDurationFromTypeNode(x));const j=x.element("notations");j&&j.element("slur")&&(le=!0)}let X=!1;x.element("cue")&&(X=!0);const fe=x.element("type");let de=yp.UNDEFINED;if(fe){const F=fe.attribute("size");(F==null?void 0:F.value)==="cue"&&(X=!0),de=da.StringToNoteType(fe.value)}let W=rt.Undefined,se;const he=x.element("stem");if(he){switch(he.value){case"down":W=rt.Down;break;case"up":W=rt.Up;break;case"double":W=rt.Double;break;case"none":W=rt.None;break;default:W=rt.Undefined}const F=he.attribute("color");F&&(se=this.parseXmlColor(F.value))}let oe=0,be="",Me="",ve="";if(H){const F=H.element("ornaments");if(F){const $=F.element("tremolo");if($){const ye=$.attribute("type");if(be=ye.value,ye){const Te=parseInt($.value,10);Te>0&&(oe=Te),(ye.value==="start"||ye.value==="stop")&&(C=new re(parseInt(x.element("duration").value,10),4*this.divisions))}}const ne=F.elements("wavy-line");if(ne!==void 0)for(const ye of ne){const Te=this.expressionReaders[this.readExpressionStaffNumber(x)-1];Te&&(Te.readExpressionParameters(ye,this.instrument,this.divisions,n,r,this.currentMeasure.MeasureNumber,!1),Te.addWavyLine(ye,this.currentMeasure,n,r))}}H.elements("glissando").find($=>$.attribute("type").value==="start")&&(Me="start"),H.elements("slide").find($=>$.attribute("type").value==="start")&&(ve="start")}let V;const z=x.element("notehead");if(z){const F=z.attribute("color");F&&(V=this.parseXmlColor(F.value))}let w;const U=x.attribute("color");U&&(w=this.parseXmlColor(U.value),V||(V=w),se||(se=w));let G=n.clone();T&&(G=r.clone()),this.currentStaffEntry=this.currentMeasure.findOrCreateStaffEntry(G,this.inSourceMeasureInstrumentIndex+_-1,this.currentStaff).staffEntry,(!this.currentVoiceGenerator.hasVoiceEntry()||!T&&!Z&&!a||Z&&!a||Z&&!T||!Z&&a)&&this.currentVoiceGenerator.createVoiceEntry(G,this.currentStaffEntry,this.activeKey,this.ActiveRhythm,Z,J,le),!Z&&!T&&(r=n.clone(),n.Add(C)),T&&this.currentStaffEntry!==void 0&&this.currentStaffEntry.ParentStaff!==this.currentStaff&&(this.currentStaffEntry=this.currentVoiceGenerator.checkForStaffEntryLink(this.inSourceMeasureInstrumentIndex+_-1,this.currentStaff,this.currentStaffEntry,this.currentMeasure));const R=this.currentStaffEntry!==void 0&&this.currentStaffEntry.Timestamp!==void 0&&this.currentStaffEntry.Timestamp.Equals(new re(0,1))&&!this.currentStaffEntry.hasNotes();this.saveAbstractInstructionList(this.instrument.Staves.length,R),this.openChordSymbolContainers.length!==0&&(this.currentStaffEntry.ChordContainers=this.openChordSymbolContainers,this.openChordSymbolContainers=[]),this.activeRhythm,!k&&!Z&&(C=new re(D,4*this.divisions));const N=x.elements("dot").length;if(this.currentVoiceGenerator.read(x,C,E,de,L,Q,this.currentStaffEntry,this.currentMeasure,t,this.maxTieNoteFraction,T,s,M,X,Z,W,oe,se,V,N,be,Me,ve),H!==void 0&&H.element("dynamics")){const F=this.expressionReaders[this.readExpressionStaffNumber(x)-1];F&&(F.readExpressionParameters(x,this.instrument,this.divisions,n,r,this.currentMeasure.MeasureNumber,!1),F.read(x,this.currentMeasure,r,void 0,l.length))}a=Z}else if(x.name==="attributes"){const M=x.element("divisions");if(M&&(this.divisions=parseInt(M.value,10),isNaN(this.divisions))){const D=ze.translateText("ReaderErrorMessages/DivisionError","Invalid divisions value at Instrument: ");if(ge.debug("InstrumentReader.readNextXmlMeasure",D),this.divisions=this.readDivisionsFromNotes(),this.divisions>0)this.musicSheet.SheetErrors.push(D+this.instrument.Name);else throw o=!0,new pi(D+this.instrument.Name)}if(!x.element("divisions")&&this.divisions===0&&this.currentXmlMeasureIndex===0){const D=ze.translateText("ReaderErrorMessages/DivisionError","Invalid divisions value at Instrument: ");if(this.divisions=this.readDivisionsFromNotes(),this.divisions>0)this.musicSheet.SheetErrors.push(D+this.instrument.Name);else throw o=!0,new pi(D+this.instrument.Name)}this.addAbstractInstruction(x,s,A,n.clone()),n.Equals(new re(0,1))&&this.isAttributesNodeAtBeginOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex],x)&&this.saveAbstractInstructionList(this.instrument.Staves.length,!0),this.isAttributesNodeAtEndOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex],x)&&this.saveClefInstructionAtEndOfMeasure();const _=x.elements("staff-details");for(const D of _){const C=D.element("staff-lines");if(C){let L=1;const E=D.attribute("number");E&&(L=parseInt(E.value,10)),this.instrument.Staves[L-1].StafflineCount=parseInt(C.value,10)}}const T=x.element("measure-style");if(T){const D=T.element("multiple-rest");if(D){const C=D.value;let L=0;try{L=Number.parseInt(C,10),e.multipleRestMeasures!==void 0&&L!==e.multipleRestMeasures?e.multipleRestMeasures=0:(e.multipleRestMeasures=L,this.currentMultirestStartMeasure=e,this.followingMultirestMeasures=L+1)}catch(E){console.log("multirest parse error: "+E)}}}}else if(x.name==="forward"){const M=parseInt(x.element("duration").value,10);n.Add(new re(M,4*this.divisions))}else if(x.name==="backup"){const M=parseInt(x.element("duration").value,10);n.Sub(new re(M,4*this.divisions)),n.IsNegative()&&(n=new re(0,1)),r.Sub(new re(M,4*this.divisions)),r.IsNegative()&&(r=new re(0,1))}else if(x.name==="direction"){const M=x.elements("direction-type"),_=x.element("direction-type");let T=Math.min(1,n.RealValue);this.activeRhythm!==void 0&&this.activeRhythm.Rhythm&&(T/=this.activeRhythm.Rhythm.RealValue);let D=!1;if(this.repetitionInstructionReader&&(D=this.repetitionInstructionReader.handleRepetitionInstructionsFromWordsOrSymbols(_,T)),!D){let C=this.expressionReaders[0];const L=this.readExpressionStaffNumber(x)-1;if(LQ==null?void 0:Q.toLocaleLowerCase()).includes((c=E.value)==null?void 0:c.toLocaleLowerCase())&&(this.currentGradualChangeMeasure=this.currentMeasure,this.currentMeasure.speedInfo={startWord:(f=E.value)==null?void 0:f.toLocaleLowerCase(),startXmlNoteIndex:l.length,endXmlNoteIndex:0,resetXmlNoteIndex:0,startMeasureListIndex:this.currentXmlMeasureIndex,endMeasureListIndex:0,resetMeasureListIndex:0},this.xmlNotes=[]),E.value.startsWith(w4)&&((d=this.currentGradualChangeMeasure)!=null&&d.speedInfo)&&(this.currentGradualChangeMeasure.speedInfo={...this.currentGradualChangeMeasure.speedInfo,endXmlNoteIndex:this.xmlNotes.length,endMeasureListIndex:this.currentXmlMeasureIndex}),((p=E.value)==null?void 0:p.toLocaleLowerCase())==="a tempo".toLocaleLowerCase()&&((g=this.currentGradualChangeMeasure)!=null&&g.speedInfo))){const{endXmlNoteIndex:Q,resetXmlNoteIndex:H,endMeasureListIndex:Z}=this.currentGradualChangeMeasure.speedInfo;H===0&&(this.currentGradualChangeMeasure.speedInfo={...this.currentGradualChangeMeasure.speedInfo,endXmlNoteIndex:Q||this.xmlNotes.length,endMeasureListIndex:Z||this.currentXmlMeasureIndex,resetXmlNoteIndex:this.xmlNotes.length,resetMeasureListIndex:this.currentXmlMeasureIndex}),this.xmlNotes=[]}if(M.find(k=>k.element("metronome"))&&((m=this.currentGradualChangeMeasure)!=null&&m.speedInfo)){const{endXmlNoteIndex:k,resetXmlNoteIndex:Q,endMeasureListIndex:H}=this.currentGradualChangeMeasure.speedInfo;Q===0&&(this.currentGradualChangeMeasure.speedInfo={...this.currentGradualChangeMeasure.speedInfo,endXmlNoteIndex:k||this.xmlNotes.length,endMeasureListIndex:H||this.currentXmlMeasureIndex,resetXmlNoteIndex:this.xmlNotes.length,resetMeasureListIndex:this.currentXmlMeasureIndex}),this.xmlNotes=[]}C.readExpressionParameters(x,this.instrument,this.divisions,n,r,this.currentMeasure.MeasureNumber,!1),C.read(x,this.currentMeasure,n,r.clone(),l.length)}}}else if(x.name==="barline"){this.repetitionInstructionReader&&this.repetitionInstructionReader.handleLineRepetitionInstructions(x)&&(this.currentMeasure.HasEndLine=!0);const M=x.attribute("location");if(P===S.length-1||M&&M.value==="right"){const T=(b=x.element("bar-style"))==null?void 0:b.value;if(T&&(this.currentMeasure.endingBarStyleXml=T,this.currentMeasure.endingBarStyleEnum=uM.xmlBarlineStyleToSystemLinesEnum(T),(y=this.currentGradualChangeMeasure)!=null&&y.speedInfo)){const{endXmlNoteIndex:D,resetXmlNoteIndex:C,endMeasureListIndex:L}=this.currentGradualChangeMeasure.speedInfo;C===0&&(this.currentGradualChangeMeasure.speedInfo={...this.currentGradualChangeMeasure.speedInfo,endXmlNoteIndex:D||this.xmlNotes.length,endMeasureListIndex:L||this.currentXmlMeasureIndex,resetXmlNoteIndex:this.xmlNotes.length,resetMeasureListIndex:this.currentXmlMeasureIndex}),this.currentGradualChangeMeasure=void 0,this.xmlNotes=[]}}}else if(x.name==="sound")try{if(x.attribute("tempo")){const M=parseFloat(x.attribute("tempo").value);x.element("offset")&&(this.soundTempos.has(this.currentXmlMeasureIndex)||this.soundTempos.set(this.currentXmlMeasureIndex,[]),this.soundTempos.get(this.currentXmlMeasureIndex).push(M)),this.currentXmlMeasureIndex===0&&(this.musicSheet.DefaultStartTempoInBpm=M,this.musicSheet.HasBPMInfo=!0)}}catch(M){ge.debug("InstrumentReader.readTempoInstruction",M)}else x.name==="harmony"&&this.openChordSymbolContainers.push(bC.readChordSymbol(x,this.musicSheet,this.activeKey))}for(const P in this.voiceGeneratorsDict)this.voiceGeneratorsDict.hasOwnProperty(P)&&this.voiceGeneratorsDict[P].checkForOpenBeam();if(this.currentXmlMeasureIndex===this.xmlMeasureList.length-1){for(let P=0;P{this.voiceGeneratorsDict[P].finalizeReadingMeasure()}),this.musicSheet.HasBPMInfo?e.TempoInBPM===0&&this.previousMeasure&&(this.currentMeasure.TempoInBPM=this.previousMeasure.TempoInBPM):this.currentMeasure.TempoInBPM=120,this.currentMeasure.TempoInBPM||(this.currentMeasure.TempoInBPM=this.musicSheet.DefaultStartTempoInBpm)}catch(v){if(o)throw new pi(v.Message);const S=ze.translateText("ReaderErrorMessages/MeasureError","Error while reading Measure.");this.musicSheet.SheetErrors.pushMeasureError(S),ge.debug("InstrumentReader.readNextXmlMeasure",S,v)}return this.previousMeasure=this.currentMeasure,this.currentXmlMeasureIndex+=1,!0}parseXmlColor(e){if(e)return e.length===7?e:e.length===9?"#"+e.substr(3):void 0}doCalculationsAfterDurationHasBeenSet(){for(const e in this.voiceGeneratorsDict)this.voiceGeneratorsDict.hasOwnProperty(e)&&this.voiceGeneratorsDict[e].checkOpenTies()}getOrCreateVoiceGenerator(e,t){const s=this.instrument.Staves[t];let n=this.voiceGeneratorsDict[e];if(n)s.Voices.indexOf(n.GetVoice)===-1&&s.Voices.push(n.GetVoice);else{const r=this.staffMainVoiceGeneratorDict[t];r?(n=new y2(this.pluginManager,s,e,this.slurReader,r.GetVoice),s.Voices.push(n.GetVoice),this.voiceGeneratorsDict[e]=n):(n=new y2(this.pluginManager,s,e,this.slurReader),s.Voices.push(n.GetVoice),this.voiceGeneratorsDict[e]=n,this.staffMainVoiceGeneratorDict[t]=n)}return n}createExpressionGenerators(e){this.expressionReaders=new Array(e);for(let t=0;t0?t=this.musicSheet.SourceMeasures[0]:t=this.currentMeasure;const s=new nt(Lt.G,0,2);let n;t.FirstInstructionsStaffEntries[e]?(n=t.FirstInstructionsStaffEntries[e],n.removeFirstInstructionOfTypeClefInstruction()):(n=new di(void 0,void 0),t.FirstInstructionsStaffEntries[e]=n),s.Parent=n,n.Instructions.splice(0,0,s)}createDefaultKeyInstruction(){let e;this.musicSheet.SourceMeasures.length>0?e=this.musicSheet.SourceMeasures[0]:e=this.currentMeasure;const t=new ii(void 0,0,Sr.major);for(let s=this.inSourceMeasureInstrumentIndex;s0&&s[n-1].name==="backup")return!0;let r=-1;for(let o=0;o0||r<0}isAttributesNodeAtEndOfMeasure(e,t){const s=e.elements().slice();let n=0;for(let o=0;or}getNoteDurationFromTypeNode(e){const t=e.element("type");if(t){const s=t.value;return da.getNoteDurationFromType(s)}return new re(0,4*this.divisions)}addAbstractInstruction(e,t,s,n){if(e.element("divisions")&&e.elements().length===1)return;const r=e.element("transpose");if(r){const l=r.element("chromatic");l&&(this.instrument.PlaybackTranspose=parseInt(l.value,10))}const o=e.elements("clef");let a;if(o.length>0)for(let l=0,u=o.length;l using default clef line."),this.musicSheet.SheetErrors.pushMeasureError(a),f=2,ge.debug("InstrumentReader.addAbstractInstruction",a,v)}const m=h.element("sign");if(m)try{c=Lt[m.value],nt.isSupportedClef(c)||(a=ze.translateText("ReaderErrorMessages/ClefError","Unsupported clef found -> using default clef."),this.musicSheet.SheetErrors.pushMeasureError(a),c=Lt.G,f=2),c===Lt.TAB&&(p=-1)}catch(v){a=ze.translateText("ReaderErrorMessages/ClefError","Invalid clef found -> using default clef."),this.musicSheet.SheetErrors.pushMeasureError(a),c=Lt.G,f=2,ge.debug("InstrumentReader.addAbstractInstruction",a,v)}const b=h.element("clef-octave-change");if(b)try{p=parseInt(b.value,10)}catch(v){a=ze.translateText("ReaderErrorMessages/ClefOctaveError","Invalid clef octave found -> using default clef octave."),this.musicSheet.SheetErrors.pushMeasureError(a),p=0}if(h.hasAttributes&&h.attribute("number"))try{d=parseInt(h.attribute("number").value,10),d>this.currentClefNumber&&(d=this.currentClefNumber),this.currentClefNumber=d+1}catch(v){a=ze.translateText("ReaderErrorMessages/ClefError","Invalid clef found -> using default clef."),this.musicSheet.SheetErrors.pushMeasureError(a),d=1,this.currentClefNumber=d+1}const y=new nt(c,p,f);this.abstractInstructions.push([d,y,n])}if(e.element("key")!==void 0&&this.instrument.MidiInstrumentId!==Ee.Percussion){let l=0;const u=e.element("key").element("fifths");if(u)try{l=parseInt(u.value,10)}catch(d){a=ze.translateText("ReaderErrorMessages/KeyError","Invalid key found -> set to default."),this.musicSheet.SheetErrors.pushMeasureError(a),l=0,ge.debug("InstrumentReader.addAbstractInstruction",a,d)}let h=Sr.none,c=e.element("key");if(c&&(c=c.element("mode")),c)try{h=Sr[c.value]}catch(d){a=ze.translateText("ReaderErrorMessages/KeyError","Invalid key found -> set to default."),this.musicSheet.SheetErrors.pushMeasureError(a),h=Sr.major,ge.debug("InstrumentReader.addAbstractInstruction",a,d)}const f=new ii(void 0,l,h);this.abstractInstructions.push([1,f,n])}if(e.element("time")){const l=e.element("time");let u=ws.NONE,h=!0;if(l!==void 0&&l.hasAttributes){const b=l.attribute("symbol");b&&(b.value==="common"?u=ws.COMMON:b.value==="cut"&&(u=ws.CUT));const y=l.attribute("print-object");y&&y.value==="no"&&(h=!1)}let c=0,f=0;const d=l&&l.element("senza-misura")!==void 0,p=e.elements("time"),g=[],m=[];for(let b=0,y=p.length;b0&&m!==void 0&&g.length===m.length){const y=g.length,v=new Array(y);let S=0;for(let A=0;A set to default."),this.musicSheet.SheetErrors.pushMeasureError(a),c=4,f=4,ge.debug("InstrumentReader.addAbstractInstruction",a,y)}const b=new Li(new re(c,f,0,!1),u);b.PrintObject=h,this.abstractInstructions.push([1,b,n])}}}saveAbstractInstructionList(e,t){for(let s=this.abstractInstructions.length-1;s>=0;s--){const n=this.abstractInstructions[s],r=n[0],o=n[1],a=n[2];if(o instanceof nt){const l=o;if(this.currentXmlMeasureIndex===0||r<=this.activeClefs.length&&l!==this.activeClefs[r-1])if(!t&&this.currentStaffEntry!==void 0&&!this.currentStaffEntry.hasNotes()&&r-1===this.instrument.Staves.indexOf(this.currentStaffEntry.ParentStaff)){const u=l,h=this.currentStaffEntry;if(a&&Math.abs(a.RealValue-h.Timestamp.RealValue)>.01)continue;u.Parent=h,h.removeFirstInstructionOfTypeClefInstruction(),h.Instructions.push(u),this.activeClefs[r-1]=l,this.abstractInstructions.splice(s,1)}else if(t){if(a.RealValue!==0)continue;let u;if(this.currentMeasure){const h=l,c=this.inSourceMeasureInstrumentIndex+r-1,f=this.currentMeasure.FirstInstructionsStaffEntries[c];if(this.currentXmlMeasureIndex===0)if(!f)u=new di(void 0,void 0),this.currentMeasure.FirstInstructionsStaffEntries[c]=u,h.Parent=u,u.Instructions.push(h),this.activeClefsHaveBeenInitialized[r-1]=!0;else if(this.currentMeasure.FirstInstructionsStaffEntries[c]!==void 0&&!(f.Instructions[0]instanceof nt))u=f,h.Parent=u,u.removeFirstInstructionOfTypeClefInstruction(),u.Instructions.splice(0,0,h),this.activeClefsHaveBeenInitialized[r-1]=!0;else{const d=new di(void 0,void 0);this.currentMeasure.LastInstructionsStaffEntries[c]=d,h.Parent=d,d.Instructions.push(h)}else if(this.activeClefsHaveBeenInitialized[r-1]){let d=this.previousMeasure;this.followingMultirestMeasures>0&&this.currentMeasure.Rules.RenderMultipleRestMeasures&&(d=this.currentMultirestStartMeasure);const p=new di(void 0,void 0);d.LastInstructionsStaffEntries[c]=p,h.Parent=p,p.Instructions.push(h)}else{const d=this.musicSheet.SourceMeasures[0];d.FirstInstructionsStaffEntries[c]?(u=d.FirstInstructionsStaffEntries[c],u.removeFirstInstructionOfTypeClefInstruction()):u=new di(void 0,void 0),h.Parent=u,u.Instructions.splice(0,0,h),this.activeClefsHaveBeenInitialized[r-1]=!0}this.activeClefs[r-1]=l,this.abstractInstructions.splice(s,1)}}else{let u;const h=this.activeRhythm.Rhythm;h.RealValue>0&&a.RealValue/h.RealValue>.9&&(this.currentMeasure.LastInstructionsStaffEntries[r-1]||(this.currentMeasure.LastInstructionsStaffEntries[r-1]=new di(void 0,this.instrument.Staves[r-1])),u=this.currentMeasure.LastInstructionsStaffEntries[r-1]),u&&(l.Parent=u,u.Instructions.push(l),this.activeClefs[r-1]=l,this.abstractInstructions.splice(s,1))}else r<=this.activeClefs.length&&l===this.activeClefs[r-1]&&this.abstractInstructions.splice(s,1)}if(o instanceof ii){const l=o;if(!this.activeKey||this.activeKey.Key!==l.Key){this.activeKey=l,this.abstractInstructions.splice(s,1);let u;if(this.activeKeyHasBeenInitialized?u=this.currentMeasure:(this.activeKeyHasBeenInitialized=!0,this.currentXmlMeasureIndex>0?u=this.musicSheet.SourceMeasures[0]:u=this.currentMeasure),u)for(let h=this.inSourceMeasureInstrumentIndex;h=0;e--){const t=this.abstractInstructions[e][0],s=this.abstractInstructions[e][1];if(s instanceof nt){const n=s;if(!this.activeClefs[t-1]||n.ClefType!==this.activeClefs[t-1].ClefType||n.ClefType===this.activeClefs[t-1].ClefType&&n.Line!==this.activeClefs[t-1].Line){const r=new di(void 0,void 0);this.currentMeasure.LastInstructionsStaffEntries[this.inSourceMeasureInstrumentIndex+t-1]=r;const o=n;o.Parent=r,r.Instructions.push(o),this.activeClefs[t-1]=n,this.abstractInstructions.splice(e,1)}}}}getNoteDurationForTuplet(e){let t=new re(0,1);const s=this.getNoteDurationFromTypeNode(e);if(e.element("time-modification")){const n=e.element("time-modification");if(n&&n.element("actual-notes")!==void 0&&n.element("normal-notes")){const r=n.element("actual-notes"),o=n.element("normal-notes");if(r!==void 0&&o){const a=parseInt(r.value,10),l=parseInt(o.value,10);t=new re(l*s.Numerator,a*s.Denominator)}}}return t}readExpressionStaffNumber(e){let t=1;if(e.element("staff")){const s=e.element("staff");if(s)try{t=parseInt(s.value,10)}catch(n){const r=ze.translateText("ReaderErrorMessages/ExpressionStaffError","Invalid Expression staff number -> set to default.");this.musicSheet.SheetErrors.pushMeasureError(r),t=1,ge.debug("InstrumentReader.readExpressionStaffNumber",r,n)}}return t}readDivisionsFromNotes(){let e=0,t=this.currentXmlMeasureIndex,s=!1;for(;!s;){const n=this.xmlMeasureList[t].elements();for(let r=0,o=n.length;r0){s=!0;break}}if(e===0&&(t++,t===this.xmlMeasureList.length)){const r=ze.translateText("ReaderErrorMEssages/DivisionsError","Invalid divisions value at Instrument: ");throw new pi(r+this.instrument.Name)}}return e}}const Ja=class{constructor(i){this.parentInstrument=i,this.fixedKey=-1,this.name=this.parseMidiInstrument(this.parentInstrument.Name),this.midiInstrumentID=Ja.midiInstrument[this.name],this.volume=1}get ParentInstrument(){return this.parentInstrument}static isPianoInstrument(i){return i===Ee.Acoustic_Grand_Piano||i===Ee.Bright_Acoustic_Piano||i===Ee.Electric_Grand_Piano||i===Ee.Electric_Piano_1||i===Ee.Electric_Piano_2}setMidiInstrument(i){this.midiInstrumentID=Ja.midiInstrument[this.parseMidiInstrument(i)]}parseMidiInstrument(i){try{if(i){let e=i.toLowerCase().trim();e=e.replace(/\s+/g,"_");for(const t in Ja.midiInstrument)if(e.indexOf(t)!==-1)return t}if(this.parentInstrument.Name){let e=this.parentInstrument.Name.toLowerCase().trim();e=e.replace(/\s+/g,"_");for(const t in Ja.midiInstrument)if(e.indexOf(t)!==-1)return t}}catch(e){ge.error("Error parsing MIDI Instrument. Default to Grand Piano.")}return"unnamed"}};let Od=Ja;Od.midiInstrument={alto_saxophone:Ee.Alto_Sax,baritone_saxophone:Ee.Baritone_Sax,horn_in_f:Ee.French_Horn,english_horn:Ee.English_Horn,euphonium:Ee.Euphonium,clarinet_in_bb:Ee.clarinet_in_bb,clarinet_in_eb:Ee.clarinet_in_eb,clarinet:Ee.Clarinet,alto_clarinet:Ee.Alto_Clarinet,bass_clarinet:Ee.Bass_Clarinet,bassoon:Ee.Bassoon,bass_trombone:Ee.Bass_Trombone,alt:Ee.Synth_Voice,alto:Ee.Synth_Voice,banjo:Ee.Banjo,bariton:Ee.Synth_Voice,baritone:Ee.Synth_Voice,bass:Ee.Synth_Voice,blockflöte:Ee.Recorder,brass:Ee.Trombone,bratsche:Ee.Viola,cello:Ee.Cello,contrabass:Ee.Contrabass,drums:Ee.Percussion,flute:Ee.Flute,flöte:Ee.Flute,frenchhorn:Ee.French_Horn,gitarre:Ee.Acoustic_Guitar_nylon,guitar:Ee.Acoustic_Guitar_nylon,harfe:Ee.Orchestral_Harp,harp:Ee.Orchestral_Harp,klarinette:Ee.Clarinet,klavier:Ee.Acoustic_Grand_Piano,kontrabass:Ee.Contrabass,oboe:Ee.Oboe,organ:Ee.Church_Organ,orgel:Ee.Church_Organ,orgue:Ee.Church_Organ,percussion:Ee.Synth_Drum,小军鼓:Ee.Synth_Drum,snare_drum:Ee.Synth_Drum,bass_drum:Ee.Synth_Drum,side_drum:Ee.Synth_Drum,piano:Ee.Acoustic_Grand_Piano,piccolo:Ee.Piccolo,posaune:Ee.Trombone,recorder:Ee.Recorder,sax:Ee.Tenor_Sax,schlagwerk:Ee.Percussion,schlagzeug:Ee.Percussion,sopran:Ee.Synth_Voice,steeldrum:Ee.Steel_Drums,streicher:Ee.String_Ensemble_1,strings:Ee.String_Ensemble_1,tenor:Ee.Synth_Voice,tpt:Ee.Trumpet,trombone:Ee.Trombone,trompete:Ee.Trumpet,trumpet:Ee.Trumpet,tuba:Ee.Tuba,unnamed:Ee.Acoustic_Grand_Piano,viola:Ee.Viola,violin:Ee.Violin,"violon-c":Ee.Cello,"violon.":Ee.Violin,voice:Ee.Synth_Voice,woodblock:Ee.Woodblock,alto_clarinet_in_eb:Ee.AltoClarinetInEb,trumpet_in_bb:Ee.TrumpetInBb,tenor_saxophone:Ee.TenorSaxophone};class Pt{static StringContainsSeparatedWord(e,t,s=!1){return new RegExp("( |^)"+t+"([ .]|$)",s?"i":void 0).test(e)}}class wC{set MusicSheet(e){this.musicSheet=e,this.xmlMeasureList=new Array(this.musicSheet.Instruments.length),this.repetitionInstructions=[]}prepareReadingMeasure(e,t){this.currentMeasureIndex=t}handleLineRepetitionInstructions(e){let t=!1;if(e.elements().length>0){let s="",n=!1,r="",o="",a="";const l=[],u=e.element("bar-style");u&&(a=u.value),e.attributes().length>0&&e.attribute("location")?s=e.attribute("location").value:s="right";const h=e.elements();for(let c=0,f=h.length;c0)if(s==="left"){if(o==="start"){const c=new qe(this.currentMeasureIndex,Se.Ending,mt.Begin,void 0,l);this.addInstruction(this.repetitionInstructions,c)}if(r==="forward"){const c=new qe(this.currentMeasureIndex,Se.StartLine);this.addInstruction(this.repetitionInstructions,c)}}else{if(o==="stop"){const c=new qe(this.currentMeasureIndex,Se.Ending,mt.End,void 0,l);this.addInstruction(this.repetitionInstructions,c)}if(r==="backward"){const c=new qe(this.currentMeasureIndex,Se.BackJumpLine);this.addInstruction(this.repetitionInstructions,c)}}}return t}handleRepetitionInstructionsFromWordsOrSymbols(e,t){const s=e.element("words"),n=this.currentMeasureIndex;if(s){const r="d\\s?\\.s\\.",o=s.value.trim().toLowerCase();if(Pt.StringContainsSeparatedWord(o,r+" al fine",!0)){const l=new qe(n,Se.DalSegnoAlFine);return this.addInstruction(this.repetitionInstructions,l),!0}if(Pt.StringContainsSeparatedWord(o,r+" al coda",!0)){const l=new qe(n,Se.DalSegnoAlCoda);return this.addInstruction(this.repetitionInstructions,l),!0}const a="d\\.\\s?c\\.";if(Pt.StringContainsSeparatedWord(o,a+" al fine",!0)){const l=new qe(n,Se.DaCapoAlFine);return this.addInstruction(this.repetitionInstructions,l),!0}if(Pt.StringContainsSeparatedWord(o,a+" al coda",!0)){const l=new qe(n,Se.DaCapoAlCoda);return this.addInstruction(this.repetitionInstructions,l),!0}if(Pt.StringContainsSeparatedWord(o,a)||Pt.StringContainsSeparatedWord(o,"da\\s?capo",!0)){const l=new qe(n,Se.DaCapo);return this.addInstruction(this.repetitionInstructions,l),!0}if(Pt.StringContainsSeparatedWord(o,r,!0)||Pt.StringContainsSeparatedWord(o,"dal\\s?segno",!0)){let l;return Pt.StringContainsSeparatedWord(o,"al\\s?coda",!0)?l=new qe(n,Se.DalSegnoAlCoda):l=new qe(n,Se.DalSegno),this.addInstruction(this.repetitionInstructions,l),!0}if(Pt.StringContainsSeparatedWord(o,"to\\s?coda",!0)||Pt.StringContainsSeparatedWord(o,"a (la )?coda",!0)){const l=new qe(n,Se.ToCoda);return this.addInstruction(this.repetitionInstructions,l),!0}if(Pt.StringContainsSeparatedWord(o,"fine",!0)){const l=new qe(n,Se.Fine);return this.addInstruction(this.repetitionInstructions,l),!0}if(Pt.StringContainsSeparatedWord(o,"coda",!0)){const l=new qe(n,Se.Coda);return this.addInstruction(this.repetitionInstructions,l),!0}if(Pt.StringContainsSeparatedWord(o,"segno",!0)){const l=new qe(n,Se.Segno);return this.addInstruction(this.repetitionInstructions,l),!0}}else if(e.element("segno")){const r=new qe(n,Se.Segno);return this.addInstruction(this.repetitionInstructions,r),!0}else if(e.element("coda")){const r=new qe(n,Se.Coda);return this.addInstruction(this.repetitionInstructions,r),!0}return!1}removeRedundantInstructions(){let e=0,t=0,s=0,n=0;for(let r=0;r0&&this.findInstructionInPreviousMeasure(r,o.measureIndex,Se.ToCoda)&&(o.type=Se.None),t===0&&s===0&&(o.type=Se.ToCoda,o.alignment=mt.End,o.measureIndex--);break;case Se.Segno:if(e-n>0){let a=!1;for(let l=0,u=this.repetitionInstructions.length;l0?h.type=Se.DalSegnoAlCoda:h.type=Se.DalSegno,o.type=Se.None,a=!0;break;case Se.DalSegno:case Se.DalSegnoAlFine:case Se.DalSegnoAlCoda:o.type=Se.None,a=!0;break}if(a)break}if(a)break;s-t>0?o.type=Se.DalSegnoAlCoda:o.type=Se.DalSegno,o.alignment=mt.End,o.measureIndex--}break}if(this.backwardSearchForPreviousIdenticalInstruction(r,o)||o.type===Se.None)this.repetitionInstructions.splice(r,1),r--;else switch(o.type){case Se.Fine:break;case Se.ToCoda:s++;break;case Se.Coda:t++;break;case Se.Segno:e++;break;case Se.DalSegnoAlFine:case Se.DalSegnoAlCoda:n++;break}}this.repetitionInstructions.sort(Ld.Compare)}findInstructionInPreviousMeasure(e,t,s){for(let n=e-1;n>=0;n--){const r=this.repetitionInstructions[n];if(t-r.measureIndex===1&&r.type===s)return!0}return!1}backwardSearchForPreviousIdenticalInstruction(e,t){for(let s=e-1;s>=0;s--)if(this.repetitionInstructions[s].equals(t))return!0;return!1}addInstruction(e,t){let s=!0;for(let n=0,r=e.length;n0;)try{const a=this.openRepetitions.last();if(a.RepetitonUnderConstruction.FromWords){if(a.WaitingForCoda){let l=a.RepetitonUnderConstruction.BackwardJumpInstructions.last().measureIndex+1;l>=this.musicSheet.SourceMeasures.length&&(l=-1),a.RepetitonUnderConstruction.setEndingStartIndex(2,l)}else if(a.RepetitonUnderConstruction.BackwardJumpInstructions.length===0){this.openRepetitions.splice(this.openRepetitions.length-1,1);continue}}else if(a.RepetitonUnderConstruction.BackwardJumpInstructions.length===0){const l=s.length-1,u=new qe(l,Se.BackJumpLine,mt.End,a.RepetitonUnderConstruction);a.RepetitonUnderConstruction.BackwardJumpInstructions.push(u),s[l].LastRepetitionInstructions.push(u)}this.finalizeRepetition(this.openRepetitions.last())}catch(a){try{const l=this.openRepetitions.last().RepetitonUnderConstruction;for(const u of this.repetitionInstructions)u.parentRepetition===l&&(u.parentRepetition=void 0);this.openRepetitions.splice(this.openRepetitions.length-1,1)}catch(l){ge.error("RepetitionCalculator: calculateRepetitions2",l)}}let n=!1;const r=0,o=this.musicSheet.SourceMeasures.length-1;for(const a of this.musicSheet.Repetitions)if(a.StartIndex===r&&a.EndIndex===o){n=!0;break}if(!n){const a=new Mu(this.musicSheet,!0);a.FromWords=!0,a.startMarker=new qe(r,Se.StartLine),a.startMarker.parentRepetition=a,this.musicSheet.SourceMeasures[r].FirstRepetitionInstructions.push(a.startMarker),a.endMarker=new qe(o,Se.BackJumpLine),a.endMarker.parentRepetition=a,a.BackwardJumpInstructions.push(a.endMarker),a.UserNumberOfRepetitions=a.DefaultNumberOfRepetitions,this.musicSheet.Repetitions.push(a)}for(let a=0,l=this.musicSheet.SourceMeasures.length;a1&&u.FirstRepetitionInstructions.sort(Ld.Compare),u.LastRepetitionInstructions.length>1&&u.LastRepetitionInstructions.sort(Ld.Compare)}}handleRepetitionInstructions(e){let t;switch(e.type){case Se.StartLine:t=this.createNewRepetition(this.currentMeasureIndex),e.parentRepetition=t.RepetitonUnderConstruction,t.RepetitonUnderConstruction.FromWords=!1,t.RepetitonUnderConstruction.startMarker=e,this.currentMeasure.FirstRepetitionInstructions.push(e);break;case Se.BackJumpLine:t=this.getOrCreateCurrentRepetition2(!1),e.parentRepetition=t.RepetitonUnderConstruction,t.RepetitonUnderConstruction.BackwardJumpInstructions.push(e),this.currentMeasure.LastRepetitionInstructions.push(e),t.RepetitonUnderConstruction.EndingParts.length===0&&this.finalizeRepetition(t);break;case Se.Ending:if(t=this.getOrCreateCurrentRepetition(),e.parentRepetition=t.RepetitonUnderConstruction,e.endingIndices.contains(1)&&e.alignment===mt.Begin){if(t.RepetitonUnderConstruction.BackwardJumpInstructions.length>0||t.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)){t=void 0;for(let n=this.openRepetitions.length-1;n>=0;n--){const r=this.openRepetitions[n];if(r.RepetitonUnderConstruction.BackwardJumpInstructions.length===0)for(t=r;this.openRepetitions.length-1>n;){const o=this.openRepetitions.last();this.finalizeRepetition(o)}}t===void 0&&(t=this.createNewRepetition(0),t.RepetitonUnderConstruction.startMarker=new qe(0,Se.None))}t.RepetitonUnderConstruction.forwardJumpInstruction===void 0&&(t.RepetitonUnderConstruction.forwardJumpInstruction=new qe(this.currentMeasureIndex-1,Se.ForwardJump,mt.End,t.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[this.currentMeasureIndex-1].LastRepetitionInstructions.push(t.RepetitonUnderConstruction.forwardJumpInstruction))}if(e.alignment===mt.Begin)t.RepetitonUnderConstruction.setEndingsStartIndex(e.endingIndices,this.currentMeasureIndex),this.currentMeasure.FirstRepetitionInstructions.push(e);else for(let n=0,r=e.endingIndices.length;n0&&Math.abs(t.RepetitonUnderConstruction.BackwardJumpInstructions.last().measureIndex-this.currentMeasureIndex)<=1||this.openRepetitions.length&&this.openRepetitions.find(n=>n.RepetitonUnderConstruction.startMarker.type===Se.StartLine).RepetitonUnderConstruction.StartIndex===this.currentMeasureIndex)break;t=this.createNewRepetition(this.currentMeasureIndex),e.parentRepetition=t.RepetitonUnderConstruction,t.RepetitonUnderConstruction.FromWords=!0,t.SegnoFound=!0,t.RepetitonUnderConstruction.startMarker=e,this.currentMeasure.FirstRepetitionInstructions.push(e);break;case Se.Fine:if(this.openRepetitions.length===0||(t=this.getCurrentRepetition(!0),t===void 0))break;e.parentRepetition=t.RepetitonUnderConstruction,t.RepetitonUnderConstruction.FromWords=!0,t.RepetitonUnderConstruction.forwardJumpInstruction===void 0?(t.FineFound=!0,t.RepetitonUnderConstruction.forwardJumpInstruction=e,t.RepetitonUnderConstruction.setEndingStartIndex(2,-2),this.currentMeasure.LastRepetitionInstructions.push(e)):this.currentMeasure.LastRepetitionInstructions.push(new qe(this.currentMeasureIndex,Se.Fine,mt.End,void 0));break;case Se.ToCoda:if(this.openRepetitions.length===0||(t=this.getCurrentRepetition(!0),t===void 0))break;t.RepetitonUnderConstruction.forwardJumpInstruction===void 0&&(e.parentRepetition=t.RepetitonUnderConstruction,t.RepetitonUnderConstruction.FromWords=!0,t.ToCodaFound=!0,t.RepetitonUnderConstruction.forwardJumpInstruction=e,this.currentMeasure.LastRepetitionInstructions.push(e));break;case Se.Coda:if(this.openRepetitions.length===0)break;t=this.getOrCreateCurrentRepetition2(!0),e.parentRepetition=t.RepetitonUnderConstruction,t.WaitingForCoda?(t.CodaFound=!0,t.RepetitonUnderConstruction.setEndingStartIndex(2,this.currentMeasureIndex),this.currentMeasure.LastRepetitionInstructions.push(e),this.finalizeRepetition(t),this.currentMeasureIndex>0&&(this.musicSheet.SourceMeasures[this.currentMeasureIndex-1].printNewSystemXml=!0)):t.ToCodaFound||(t.RepetitonUnderConstruction.BackwardJumpInstructions.length===0?(t.ToCodaFound=!0,t.RepetitonUnderConstruction.forwardJumpInstruction=new qe(this.currentMeasureIndex,Se.ToCoda,mt.End,t.RepetitonUnderConstruction),this.currentMeasure.LastRepetitionInstructions.push(t.RepetitonUnderConstruction.forwardJumpInstruction)):this.currentMeasure.LastRepetitionInstructions.push(new qe(this.currentMeasureIndex,Se.Coda,mt.Begin,void 0)));break;case Se.DaCapo:t=this.getOrCreateCurrentRepetition(),t.RepetitonUnderConstruction.BackwardJumpInstructions.length>0&&this.finalizeRepetition(t),t.RepetitonUnderConstruction.StartIndex!==0&&(t=this.createNewRepetition(0)),e.parentRepetition=t.RepetitonUnderConstruction,t.RepetitonUnderConstruction.FromWords=!0,t.RepetitonUnderConstruction.startMarker=new qe(0,Se.None,mt.Begin,t.RepetitonUnderConstruction),t.RepetitonUnderConstruction.BackwardJumpInstructions.push(e),this.currentMeasure.LastRepetitionInstructions.push(e),t.RepetitonUnderConstruction.EndingParts.length===0&&this.finalizeRepetition(t);break;case Se.DalSegno:if(t=this.getOrCreateCurrentRepetition2(!0),t.RepetitonUnderConstruction.BackwardJumpInstructions.length>0&&(this.finalizeRepetition(t),t=this.createNewRepetition(0),t.RepetitonUnderConstruction.FromWords=!0,t.RepetitonUnderConstruction.startMarker=new qe(0,Se.None,mt.Begin,t.RepetitonUnderConstruction)),e.parentRepetition=t.RepetitonUnderConstruction,!t.SegnoFound){const n=this.findInstructionInMainListBackwards(Se.Segno,e.measureIndex);n>=0&&(t.SegnoFound=!0,t.RepetitonUnderConstruction.startMarker=new qe(n,Se.Segno,mt.Begin,t.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[n].FirstRepetitionInstructions.splice(0,0,t.RepetitonUnderConstruction.startMarker))}t.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)&&t.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),t.RepetitonUnderConstruction.BackwardJumpInstructions.push(e),this.currentMeasure.LastRepetitionInstructions.push(e);break;case Se.DalSegnoAlFine:if(this.openRepetitions.length===0)break;if(t=this.getOrCreateCurrentRepetition2(!0),e.parentRepetition=t.RepetitonUnderConstruction,!t.SegnoFound){const n=this.findInstructionInMainListBackwards(Se.Segno,e.measureIndex);n>=0&&(t.SegnoFound=!0,t.RepetitonUnderConstruction.startMarker=new qe(n,Se.Segno,mt.Begin,t.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[n].FirstRepetitionInstructions.splice(0,0,t.RepetitonUnderConstruction.startMarker))}if(!t.FineFound){const n=this.findInstructionInMainListBackwards(Se.Fine,e.measureIndex);n>=0&&(t.FineFound=!0,t.RepetitonUnderConstruction.forwardJumpInstruction=new qe(n,Se.Fine,mt.Begin,t.RepetitonUnderConstruction),t.RepetitonUnderConstruction.setEndingStartIndex(2,-2),this.musicSheet.SourceMeasures[n].LastRepetitionInstructions.splice(0,0,t.RepetitonUnderConstruction.forwardJumpInstruction))}t.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)||t.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),t.RepetitonUnderConstruction.BackwardJumpInstructions.push(e),this.currentMeasure.LastRepetitionInstructions.push(e);break;case Se.DaCapoAlFine:if(t=this.getOrCreateCurrentRepetition(),t.RepetitonUnderConstruction.BackwardJumpInstructions.length>0&&(this.finalizeRepetition(t),t=this.createNewRepetition(0)),t.RepetitonUnderConstruction.startMarker!==void 0&&t.RepetitonUnderConstruction.StartIndex!==0&&(t=this.createNewRepetition(0)),t.RepetitonUnderConstruction.startMarker=new qe(0,Se.None,mt.Begin,t.RepetitonUnderConstruction),t.RepetitonUnderConstruction.FromWords=!0,e.parentRepetition=t.RepetitonUnderConstruction,!t.FineFound){const n=this.findInstructionInMainListBackwards(Se.Fine,e.measureIndex);n>=0&&(t.FineFound=!0,t.RepetitonUnderConstruction.forwardJumpInstruction=new qe(n,Se.Fine,mt.Begin,t.RepetitonUnderConstruction),t.RepetitonUnderConstruction.setEndingStartIndex(2,-2),this.musicSheet.SourceMeasures[n].LastRepetitionInstructions.splice(0,0,t.RepetitonUnderConstruction.forwardJumpInstruction))}t.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)||t.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),t.RepetitonUnderConstruction.BackwardJumpInstructions.push(e),this.currentMeasure.LastRepetitionInstructions.push(e);break;case Se.DalSegnoAlCoda:if(this.openRepetitions.length===0)break;if(t=this.getOrCreateCurrentRepetition2(!0),e.parentRepetition=t.RepetitonUnderConstruction,!t.SegnoFound){const n=this.findInstructionInMainListBackwards(Se.Segno,e.measureIndex);n>=0&&(t.SegnoFound=!0,t.RepetitonUnderConstruction.startMarker=new qe(n,Se.Segno,mt.Begin,t.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[n].FirstRepetitionInstructions.splice(0,0,t.RepetitonUnderConstruction.startMarker))}if(!t.ToCodaFound){const n=this.findInstructionInMainListBackwards(Se.ToCoda,e.measureIndex);if(n>=0)t.RepetitonUnderConstruction.forwardJumpInstruction=new qe(n,Se.ToCoda,mt.Begin,t.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[n].LastRepetitionInstructions.splice(0,0,t.RepetitonUnderConstruction.forwardJumpInstruction),t.ToCodaFound=!0;else{const r=this.findInstructionInMainListBackwards(Se.Coda,e.measureIndex);r>=0&&(t.RepetitonUnderConstruction.forwardJumpInstruction=new qe(r,Se.ToCoda,mt.Begin,t.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[r].LastRepetitionInstructions.splice(0,0,t.RepetitonUnderConstruction.forwardJumpInstruction),t.ToCodaFound=!0)}}t.ToCodaFound&&(t.WaitingForCoda=!0),t.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)||t.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),t.RepetitonUnderConstruction.BackwardJumpInstructions.push(e),this.currentMeasure.LastRepetitionInstructions.push(e);break;case Se.DaCapoAlCoda:if(t=this.getOrCreateCurrentRepetition(),t.RepetitonUnderConstruction.BackwardJumpInstructions.length>0?(this.finalizeRepetition(t),t=this.createNewRepetition(0)):t.RepetitonUnderConstruction.EndingParts.length===0&&(this.finalizeRepetition(t),t=this.createNewRepetition(0)),t.RepetitonUnderConstruction.startMarker!==void 0&&t.RepetitonUnderConstruction.StartIndex!==0&&(t=this.createNewRepetition(0)),t.RepetitonUnderConstruction.startMarker=new qe(0,Se.None,mt.Begin,t.RepetitonUnderConstruction),t.RepetitonUnderConstruction.FromWords=!0,e.parentRepetition=t.RepetitonUnderConstruction,!t.ToCodaFound){const n=this.findInstructionInMainListBackwards(Se.ToCoda,e.measureIndex);if(n>=0)t.RepetitonUnderConstruction.forwardJumpInstruction=new qe(n,Se.ToCoda,mt.Begin,t.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[n].LastRepetitionInstructions.splice(0,0,t.RepetitonUnderConstruction.forwardJumpInstruction),t.ToCodaFound=!0;else{const r=this.findInstructionInMainListBackwards(Se.Coda,e.measureIndex);r>=0&&(t.RepetitonUnderConstruction.forwardJumpInstruction=new qe(r,Se.ToCoda,mt.Begin,t.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[r].LastRepetitionInstructions.splice(0,0,t.RepetitonUnderConstruction.forwardJumpInstruction),t.ToCodaFound=!0)}}t.ToCodaFound&&(t.WaitingForCoda=!0),t.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)||t.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),t.RepetitonUnderConstruction.BackwardJumpInstructions.push(e),this.currentMeasure.LastRepetitionInstructions.push(e);break;case Se.None:break;default:throw new zn("currentRepetitionInstruction")}return!0}findInstructionInMainListBackwards(e,t){for(let s=this.repetitionInstructions.length-1;s>=0;s--){const n=this.repetitionInstructions[s];if(n.measureIndex<=t&&n.type===e)return n.measureIndex}return-1}finalizeRepetition(e){const t=e.RepetitonUnderConstruction;if(t.BackwardJumpInstructions.length>0){let s=!0;const n=this.getLastFinalizedRepetition();if(n!==void 0&&t.coversIdenticalMeasures(n)){if(t.NumberOfEndings>n.NumberOfEndings){const r=this.musicSheet.Repetitions.indexOf(n,0);r>-1&&this.musicSheet.Repetitions.splice(r,1),n.removeFromRepetitionInstructions(),this.musicSheet.Repetitions.push(t)}s=!1,t.removeFromRepetitionInstructions()}else this.musicSheet.Repetitions.push(t);s&&(t.startMarker.type===Se.None&&this.musicSheet.SourceMeasures[t.StartIndex].FirstRepetitionInstructions.push(t.startMarker),t.UserNumberOfRepetitions=t.DefaultNumberOfRepetitions)}this.openRepetitions.splice(this.openRepetitions.length-1,1)}getCurrentRepetition(e){let t;for(let s=this.openRepetitions.length-1;s>=0;s--)if(this.openRepetitions[s].RepetitonUnderConstruction.FromWords===e){for(t=this.openRepetitions[s];s0)return this.openRepetitions.last();const e=this.createNewRepetition(0);return e.RepetitonUnderConstruction.startMarker=new qe(0,Se.None,mt.Begin,e.RepetitonUnderConstruction),e}getOrCreateCurrentRepetition2(e){let t;if(this.openRepetitions.length&&this.openRepetitions.last().RepetitonUnderConstruction.EndingParts.length<2){for(let n=this.openRepetitions.length-1;n>=0;n--)if(t=this.openRepetitions[n],t.RepetitonUnderConstruction.FromWords===e){for(;n0){const s=this.openRepetitions.last(),n=s.RepetitonUnderConstruction;if(n.BackwardJumpInstructions.length>0){const r=Object.keys(n.EndingIndexDict);(r.length===0||n.EndingIndexDict[r[r.length-1]].part.EndIndex>=0)&&this.finalizeRepetition(s)}}const t=new PC(this.musicSheet);return this.lastRepetitionCommonPartStartIndex=e,this.openRepetitions.push(t),t}getLastFinalizedRepetition(){if(this.musicSheet.Repetitions.length>0)return this.musicSheet.Repetitions.last()}}class PC{constructor(e){this.RepetitonUnderConstruction=new Mu(e)}}class S2{static createRepetitionInstructionReader(){return new wC}static createRepetitionCalculator(){return new EC}}class _C{constructor(){this.voiceMeasureReadPlugins=[]}addVoiceMeasureReadPlugin(e){this.voiceMeasureReadPlugins.push(e)}processVoiceMeasureReadPlugins(e,t,s){for(const n of this.voiceMeasureReadPlugins)try{n.measureReadCalculations(e,t,s)}catch(r){ge.info("VoiceGenerator.addSingleNote: ",r)}}}class Ep{constructor(e=void 0,t=new Ir){this.completeNumberOfStaves=0,this.pluginManager=new _C,e?this.afterSheetReadingModules=e:this.afterSheetReadingModules=[],this.repetitionInstructionReader=S2.createRepetitionInstructionReader(),this.repetitionCalculator=S2.createRepetitionCalculator(),this.rules=t}get PluginManager(){return this.pluginManager}get CompleteNumberOfStaves(){return this.completeNumberOfStaves}static doCalculationsAfterDurationHasBeenSet(e){for(const t of e)t.doCalculationsAfterDurationHasBeenSet()}createMusicSheet(e,t){try{return this._createMusicSheet(e,t)}catch(s){ge.error("MusicSheetReader.CreateMusicSheet",s);return}}_removeFromArray(e,t){const s=e.indexOf(t);s!==-1&&e.splice(s,1)}trimString(e){return e.replace(/^\s+|\s+$/g,"")}_lastElement(e){return e[e.length-1]}_createMusicSheet(e,t){var c;const s=[];let n=0;if(this.musicSheet=new U4,this.musicSheet.Path=t,this.musicSheet.Rules=this.rules,!e)throw new pi("Undefined root element");this.pushSheetLabels(e,t);const r=e.element("part-list");if(!r)throw new pi("Undefined partListNode");const o=e.elements("part"),a=r.elements();this.initializeReading(a,o,s);let l=!0;this.currentFraction=new re(0,1);let u=!1,h=e.element("identification");for(h&&(h=h.element("encoding")),h&&(h=h.element("software")),h!==void 0&&h.value==="Guitar Pro 5"&&(u=!0);l;){this.currentMeasure!==void 0&&this.currentMeasure.HasEndLine&&this.rules.NewPartAndSystemAfterFinalBarline&&(n=0),this.currentMeasure=new gM(this.completeNumberOfStaves,this.musicSheet.Rules);for(const f of s)try{l=l&&f.readNextXmlMeasure(this.currentMeasure,this.currentFraction,u)}catch(d){const p=ze.translateText("ReaderErrorMessages/InstrumentError","Error while reading instruments.");throw new pi(p,d)}l&&(this.musicSheet.addMeasure(this.currentMeasure),this.checkIfRhythmInstructionsAreSetAndEqual(s),this.checkSourceMeasureForNullEntries(),n=this.setSourceMeasureDuration(s,n),Ep.doCalculationsAfterDurationHasBeenSet(s),this.currentMeasure.AbsoluteTimestamp=this.currentFraction.clone(),this.musicSheet.SheetErrors.finalizeMeasure(this.currentMeasure.MeasureNumber),this.currentFraction.Add(this.currentMeasure.Duration),this.previousMeasure=this.currentMeasure,this.musicSheet.SoundTempos=(c=s[0])==null?void 0:c.SoundTempos)}this.repetitionInstructionReader&&(this.repetitionInstructionReader.removeRedundantInstructions(),this.repetitionCalculator&&this.repetitionCalculator.calculateRepetitions(this.musicSheet,this.repetitionInstructionReader.repetitionInstructions)),this.musicSheet.DefaultStartTempoInBpm===0&&(this.musicSheet.DefaultStartTempoInBpm=100),this.musicSheet.checkForInstrumentWithNoVoice(),this.musicSheet.fillStaffList();for(let f=0,d=this.afterSheetReadingModules.length;fs){if(this.areRhythmInstructionsMixed(t)&&a.SymbolEnum!==ws.NONE)continue;s=a.Rhythm.RealValue,n=t.indexOf(a)}}if(t.length>0&&t.lengthe.Denominator){const s=t.Denominator/e.Denominator;e.expand(s)}}checkIfMeasureIsImplicit(e,t){return!this.previousMeasure&&e.lt(t)?!0:this.previousMeasure?re.plus(this.previousMeasure.Duration,e).Equals(t):!1}allInstrumentsHaveSameDuration(e,t){let s=0;for(let n=0,r=e.length;n=0;e--)for(let t=this.currentMeasure.VerticalSourceStaffEntryContainers[e].StaffEntries.length-1;t>=0;t--){const s=this.currentMeasure.VerticalSourceStaffEntryContainers[e].StaffEntries[t];if(s)for(let n=s.VoiceEntries.length-1;n>=0;n--){const r=s.VoiceEntries[n];r.Notes.length===0&&(this._removeFromArray(r.ParentVoice.VoiceEntries,r),this._removeFromArray(s.VoiceEntries,r))}s!==void 0&&s.VoiceEntries.length===0&&(this.currentMeasure.VerticalSourceStaffEntryContainers[e].StaffEntries[t]=void 0)}for(let e=this.currentMeasure.VerticalSourceStaffEntryContainers.length-1;e>=0;e--){let t=0;for(let s=0,n=this.currentMeasure.VerticalSourceStaffEntryContainers[e].StaffEntries.length;st){if(!this.musicSheet.Title){const v=p.attribute("font-size").value,S=parseFloat(v);s0&&h.MidiInstrumentId!==Ee.Percussion&&(g.midiInstrumentID=Math.max(0,parseInt(v.value,10)-1));else if(v.name==="midi-unpitched")g.fixedKey=Math.max(0,parseInt(v.value,10));else if(v.name==="volume")try{const S=parseFloat(v.value);g.volume=S/127}catch(S){ge.debug("ExpressionReader.readExpressionParameters","read volume",S)}else if(v.name==="pan")try{const S=parseFloat(v.value);g.pan=S/64}catch(S){ge.debug("ExpressionReader.readExpressionParameters","read pan",S)}}catch(S){ge.info("MusicSheetReader.createInstrumentGroups midi settings: ",S)}}}}catch(g){ge.info("MusicSheetReader.createInstrumentGroups: ",g)}}if(h.SubInstruments.length===0){const f=new Od(h);h.SubInstruments.push(f)}s[u]=h,n?(n.InstrumentalGroups.push(h),this.musicSheet.Instruments.push(h)):(this.musicSheet.InstrumentalGroups.push(h),this.musicSheet.Instruments.push(h))}else if(l.name==="part-group"&&l.attribute("type").value==="start"){const u=new R4("group",this.musicSheet,n);n?n.InstrumentalGroups.push(u):this.musicSheet.InstrumentalGroups.push(u),n=u}else if(l.name==="part-group"&&l.attribute("type").value==="stop"&&n){if(n.InstrumentalGroups.length===1){const u=n.InstrumentalGroups[0];n.Parent?(n.Parent.InstrumentalGroups.push(u),this._removeFromArray(n.Parent.InstrumentalGroups,n)):(this.musicSheet.InstrumentalGroups.push(u),this._removeFromArray(this.musicSheet.InstrumentalGroups,n))}n=n.Parent}}}catch(r){const o=ze.translateText("ReaderErrorMessages/InstrumentError","Error while reading Instruments");throw new pi(o,r)}for(let r=0,o=this.musicSheet.Instruments.length;r0){const r=n[0];if(r){let o=r.element("attributes");o&&(o=o.element("staves")),o?t+=parseInt(o.value,10):t++}}}if(isNaN(t)||t<=0){const s=ze.translateText("ReaderErrorMessages/StaffError","Invalid number of staves.");throw new pi(s)}return t}getInstrumentNumberOfStavesFromXml(e){let t=0;const s=e.element("measure");if(s){const n=s.element("attributes");let r;n&&(r=n.element("staves")),!n||!r?t=1:t=parseInt(r.value,10)}if(isNaN(t)||t<=0){const n=ze.translateText("ReaderErrorMessages/StaffError","Invalid number of Staves.");throw new pi(n)}return t}}function xr(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Cu={},MC={get exports(){return Cu},set exports(i){Cu=i}};/*! JSZip v3.7.1 - A JavaScript class for generating and reading zip files (c) 2009-2016 Stuart Knightley Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown. JSZip uses the library pako released under the MIT license : https://github.com/nodeca/pako/blob/master/LICENSE */(function(i,e){(function(t){i.exports=t()})(function(){return function t(s,n,r){function o(u,h){if(!n[u]){if(!s[u]){var c=typeof xr=="function"&&xr;if(!h&&c)return c(u,!0);if(a)return a(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var d=n[u]={exports:{}};s[u][0].call(d.exports,function(p){var g=s[u][1][p];return o(g||p)},d,d.exports,t,s,n,r)}return n[u].exports}for(var a=typeof xr=="function"&&xr,l=0;l>2,d=(3&u)<<4|h>>4,p=1>6:64,g=2>4,h=(15&f)<<4|(d=a.indexOf(l.charAt(g++)))>>2,c=(3&d)<<6|(p=a.indexOf(l.charAt(g++))),y[m++]=u,d!==64&&(y[m++]=h),p!==64&&(y[m++]=c);return y}},{"./support":30,"./utils":32}],2:[function(t,s,n){var r=t("./external"),o=t("./stream/DataWorker"),a=t("./stream/Crc32Probe"),l=t("./stream/DataLengthProbe");function u(h,c,f,d,p){this.compressedSize=h,this.uncompressedSize=c,this.crc32=f,this.compression=d,this.compressedContent=p}u.prototype={getContentWorker:function(){var h=new o(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),c=this;return h.on("end",function(){if(this.streamInfo.data_length!==c.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),h},getCompressedWorker:function(){return new o(r.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},u.createWorkerFrom=function(h,c,f){return h.pipe(new a).pipe(new l("uncompressedSize")).pipe(c.compressWorker(f)).pipe(new l("compressedSize")).withStreamInfo("compression",c)},s.exports=u},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,s,n){var r=t("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(o){return new r("STORE compression")},uncompressWorker:function(){return new r("STORE decompression")}},n.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,s,n){var r=t("./utils"),o=function(){for(var a,l=[],u=0;u<256;u++){a=u;for(var h=0;h<8;h++)a=1&a?3988292384^a>>>1:a>>>1;l[u]=a}return l}();s.exports=function(a,l){return a!==void 0&&a.length?r.getTypeOf(a)!=="string"?function(u,h,c,f){var d=o,p=f+c;u^=-1;for(var g=f;g>>8^d[255&(u^h[g])];return-1^u}(0|l,a,a.length,0):function(u,h,c,f){var d=o,p=f+c;u^=-1;for(var g=f;g>>8^d[255&(u^h.charCodeAt(g))];return-1^u}(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(t,s,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(t,s,n){var r=null;r=typeof Promise<"u"?Promise:t("lie"),s.exports={Promise:r}},{lie:37}],7:[function(t,s,n){var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=t("pako"),a=t("./utils"),l=t("./stream/GenericWorker"),u=r?"uint8array":"array";function h(c,f){l.call(this,"FlateWorker/"+c),this._pako=null,this._pakoAction=c,this._pakoOptions=f,this.meta={}}n.magic="\b\0",a.inherits(h,l),h.prototype.processChunk=function(c){this.meta=c.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(u,c.data),!1)},h.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var c=this;this._pako.onData=function(f){c.push({data:f,meta:c.meta})}},n.compressWorker=function(c){return new h("Deflate",c)},n.uncompressWorker=function(){return new h("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,s,n){function r(d,p){var g,m="";for(g=0;g>>=8;return m}function o(d,p,g,m,b,y){var v,S,A=d.file,P=d.compression,x=y!==u.utf8encode,M=a.transformTo("string",y(A.name)),_=a.transformTo("string",u.utf8encode(A.name)),T=A.comment,D=a.transformTo("string",y(T)),C=a.transformTo("string",u.utf8encode(T)),L=_.length!==A.name.length,E=C.length!==T.length,k="",Q="",H="",Z=A.dir,J=A.date,le={crc32:0,compressedSize:0,uncompressedSize:0};p&&!g||(le.crc32=d.crc32,le.compressedSize=d.compressedSize,le.uncompressedSize=d.uncompressedSize);var X=0;p&&(X|=8),x||!L&&!E||(X|=2048);var O=0,fe=0;Z&&(O|=16),b==="UNIX"?(fe=798,O|=function(W,se){var he=W;return W||(he=se?16893:33204),(65535&he)<<16}(A.unixPermissions,Z)):(fe=20,O|=function(W){return 63&(W||0)}(A.dosPermissions)),v=J.getUTCHours(),v<<=6,v|=J.getUTCMinutes(),v<<=5,v|=J.getUTCSeconds()/2,S=J.getUTCFullYear()-1980,S<<=4,S|=J.getUTCMonth()+1,S<<=5,S|=J.getUTCDate(),L&&(Q=r(1,1)+r(h(M),4)+_,k+="up"+r(Q.length,2)+Q),E&&(H=r(1,1)+r(h(D),4)+C,k+="uc"+r(H.length,2)+H);var de="";return de+=` \0`,de+=r(X,2),de+=P.magic,de+=r(v,2),de+=r(S,2),de+=r(le.crc32,4),de+=r(le.compressedSize,4),de+=r(le.uncompressedSize,4),de+=r(M.length,2),de+=r(k.length,2),{fileRecord:c.LOCAL_FILE_HEADER+de+M+k,dirRecord:c.CENTRAL_FILE_HEADER+r(fe,2)+de+r(D.length,2)+"\0\0\0\0"+r(O,4)+r(m,4)+M+k+D}}var a=t("../utils"),l=t("../stream/GenericWorker"),u=t("../utf8"),h=t("../crc32"),c=t("../signature");function f(d,p,g,m){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=g,this.encodeFileName=m,this.streamFiles=d,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(f,l),f.prototype.push=function(d){var p=d.meta.percent||0,g=this.entriesCount,m=this._sources.length;this.accumulate?this.contentBuffer.push(d):(this.bytesWritten+=d.data.length,l.prototype.push.call(this,{data:d.data,meta:{currentFile:this.currentFile,percent:g?(p+100*(g-m-1))/g:100}}))},f.prototype.openedSource=function(d){this.currentSourceOffset=this.bytesWritten,this.currentFile=d.file.name;var p=this.streamFiles&&!d.file.dir;if(p){var g=o(d,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:g.fileRecord,meta:{percent:0}})}else this.accumulate=!0},f.prototype.closedSource=function(d){this.accumulate=!1;var p=this.streamFiles&&!d.file.dir,g=o(d,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(g.dirRecord),p)this.push({data:function(m){return c.DATA_DESCRIPTOR+r(m.crc32,4)+r(m.compressedSize,4)+r(m.uncompressedSize,4)}(d),meta:{percent:100}});else for(this.push({data:g.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},f.prototype.flush=function(){for(var d=this.bytesWritten,p=0;p=this.index;l--)u=(u<<8)+this.byteAt(l);return this.index+=a,u},readString:function(a){return r.transformTo("string",this.readData(a))},readData:function(a){},lastIndexOfSignature:function(a){},readAndCheckSignature:function(a){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},s.exports=o},{"../utils":32}],19:[function(t,s,n){var r=t("./Uint8ArrayReader");function o(a){r.call(this,a)}t("../utils").inherits(o,r),o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},s.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,s,n){var r=t("./DataReader");function o(a){r.call(this,a)}t("../utils").inherits(o,r),o.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},o.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},o.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},s.exports=o},{"../utils":32,"./DataReader":18}],21:[function(t,s,n){var r=t("./ArrayReader");function o(a){r.call(this,a)}t("../utils").inherits(o,r),o.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},s.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(t,s,n){var r=t("../utils"),o=t("../support"),a=t("./ArrayReader"),l=t("./StringReader"),u=t("./NodeBufferReader"),h=t("./Uint8ArrayReader");s.exports=function(c){var f=r.getTypeOf(c);return r.checkSupport(f),f!=="string"||o.uint8array?f==="nodebuffer"?new u(c):o.uint8array?new h(r.transformTo("uint8array",c)):new a(r.transformTo("array",c)):new l(c)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,s,n){n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,s,n){var r=t("./GenericWorker"),o=t("../utils");function a(l){r.call(this,"ConvertWorker to "+l),this.destType=l}o.inherits(a,r),a.prototype.processChunk=function(l){this.push({data:o.transformTo(this.destType,l.data),meta:l.meta})},s.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(t,s,n){var r=t("./GenericWorker"),o=t("../crc32");function a(){r.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(a,r),a.prototype.processChunk=function(l){this.streamInfo.crc32=o(l.data,this.streamInfo.crc32||0),this.push(l)},s.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,s,n){var r=t("../utils"),o=t("./GenericWorker");function a(l){o.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}r.inherits(a,o),a.prototype.processChunk=function(l){if(l){var u=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=u+l.data.length}o.prototype.processChunk.call(this,l)},s.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(t,s,n){var r=t("../utils"),o=t("./GenericWorker");function a(l){o.call(this,"DataWorker");var u=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(h){u.dataIsReady=!0,u.data=h,u.max=h&&h.length||0,u.type=r.getTypeOf(h),u.isPaused||u._tickAndRepeat()},function(h){u.error(h)})}r.inherits(a,o),a.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,u=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,u);break;case"uint8array":l=this.data.subarray(this.index,u);break;case"array":case"nodebuffer":l=this.data.slice(this.index,u)}return this.index=u,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},s.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(t,s,n){function r(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,a){return this._listeners[o].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,a){if(this._listeners[o])for(var l=0;l "+o:o}},s.exports=r},{}],29:[function(t,s,n){var r=t("../utils"),o=t("./ConvertWorker"),a=t("./GenericWorker"),l=t("../base64"),u=t("../support"),h=t("../external"),c=null;if(u.nodestream)try{c=t("../nodejs/NodejsStreamOutputAdapter")}catch(p){}function f(p,g){return new h.Promise(function(m,b){var y=[],v=p._internalType,S=p._outputType,A=p._mimeType;p.on("data",function(P,x){y.push(P),g&&g(x)}).on("error",function(P){y=[],b(P)}).on("end",function(){try{var P=function(x,M,_){switch(x){case"blob":return r.newBlob(r.transformTo("arraybuffer",M),_);case"base64":return l.encode(M);default:return r.transformTo(x,M)}}(S,function(x,M){var _,T=0,D=null,C=0;for(_=0;_"u")n.blob=!1;else{var r=new ArrayBuffer(0);try{n.blob=new Blob([r],{type:"application/zip"}).size===0}catch(a){try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(r),n.blob=o.getBlob("application/zip").size===0}catch(l){n.blob=!1}}}try{n.nodestream=!!t("readable-stream").Readable}catch(a){n.nodestream=!1}},{"readable-stream":16}],31:[function(t,s,n){for(var r=t("./utils"),o=t("./support"),a=t("./nodejsUtils"),l=t("./stream/GenericWorker"),u=new Array(256),h=0;h<256;h++)u[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;u[254]=u[254]=1;function c(){l.call(this,"utf-8 decode"),this.leftOver=null}function f(){l.call(this,"utf-8 encode")}n.utf8encode=function(d){return o.nodebuffer?a.newBufferFrom(d,"utf-8"):function(p){var g,m,b,y,v,S=p.length,A=0;for(y=0;y>>6:(m<65536?g[v++]=224|m>>>12:(g[v++]=240|m>>>18,g[v++]=128|m>>>12&63),g[v++]=128|m>>>6&63),g[v++]=128|63&m);return g}(d)},n.utf8decode=function(d){return o.nodebuffer?r.transformTo("nodebuffer",d).toString("utf-8"):function(p){var g,m,b,y,v=p.length,S=new Array(2*v);for(g=m=0;g>10&1023,S[m++]=56320|1023&b)}return S.length!==m&&(S.subarray?S=S.subarray(0,m):S.length=m),r.applyFromCharCode(S)}(d=r.transformTo(o.uint8array?"uint8array":"array",d))},r.inherits(c,l),c.prototype.processChunk=function(d){var p=r.transformTo(o.uint8array?"uint8array":"array",d.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var g=p;(p=new Uint8Array(g.length+this.leftOver.length)).set(this.leftOver,0),p.set(g,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var m=function(y,v){var S;for((v=v||y.length)>y.length&&(v=y.length),S=v-1;0<=S&&(192&y[S])==128;)S--;return S<0||S===0?v:S+u[y[S]]>v?S:v}(p),b=p;m!==p.length&&(o.uint8array?(b=p.subarray(0,m),this.leftOver=p.subarray(m,p.length)):(b=p.slice(0,m),this.leftOver=p.slice(m,p.length))),this.push({data:n.utf8decode(b),meta:d.meta})},c.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=c,r.inherits(f,l),f.prototype.processChunk=function(d){this.push({data:n.utf8encode(d.data),meta:d.meta})},n.Utf8EncodeWorker=f},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,s,n){var r=t("./support"),o=t("./base64"),a=t("./nodejsUtils"),l=t("set-immediate-shim"),u=t("./external");function h(m){return m}function c(m,b){for(var y=0;y>8;this.dir=!!(16&this.externalFileAttributes),d==0&&(this.dosPermissions=63&this.externalFileAttributes),d==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(d){if(this.extraFields[1]){var p=r(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=p.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=p.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=p.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=p.readInt(4))}},readExtraFields:function(d){var p,g,m,b=d.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});d.index+4>>6:(d<65536?f[m++]=224|d>>>12:(f[m++]=240|d>>>18,f[m++]=128|d>>>12&63),f[m++]=128|d>>>6&63),f[m++]=128|63&d);return f},n.buf2binstring=function(c){return h(c,c.length)},n.binstring2buf=function(c){for(var f=new r.Buf8(c.length),d=0,p=f.length;d>10&1023,y[p++]=56320|1023&g)}return h(y,p)},n.utf8border=function(c,f){var d;for((f=f||c.length)>c.length&&(f=c.length),d=f-1;0<=d&&(192&c[d])==128;)d--;return d<0||d===0?f:d+l[c[d]]>f?d:f}},{"./common":41}],43:[function(t,s,n){s.exports=function(r,o,a,l){for(var u=65535&r|0,h=r>>>16&65535|0,c=0;a!==0;){for(a-=c=2e3>>1:o>>>1;a[l]=o}return a}();s.exports=function(o,a,l,u){var h=r,c=u+l;o^=-1;for(var f=u;f>>8^h[255&(o^a[f])];return-1^o}},{}],46:[function(t,s,n){var r,o=t("../utils/common"),a=t("./trees"),l=t("./adler32"),u=t("./crc32"),h=t("./messages"),c=0,f=4,d=0,p=-2,g=-1,m=4,b=2,y=8,v=9,S=286,A=30,P=19,x=2*S+1,M=15,_=3,T=258,D=T+_+1,C=42,L=113,E=1,k=2,Q=3,H=4;function Z(w,U){return w.msg=h[U],U}function J(w){return(w<<1)-(4w.avail_out&&(G=w.avail_out),G!==0&&(o.arraySet(w.output,U.pending_buf,U.pending_out,G,w.next_out),w.next_out+=G,U.pending_out+=G,w.total_out+=G,w.avail_out-=G,U.pending-=G,U.pending===0&&(U.pending_out=0))}function O(w,U){a._tr_flush_block(w,0<=w.block_start?w.block_start:-1,w.strstart-w.block_start,U),w.block_start=w.strstart,X(w.strm)}function fe(w,U){w.pending_buf[w.pending++]=U}function de(w,U){w.pending_buf[w.pending++]=U>>>8&255,w.pending_buf[w.pending++]=255&U}function W(w,U){var G,R,N=w.max_chain_length,F=w.strstart,q=w.prev_length,j=w.nice_match,K=w.strstart>w.w_size-D?w.strstart-(w.w_size-D):0,ae=w.window,$=w.w_mask,ne=w.prev,ye=w.strstart+T,Te=ae[F+q-1],ce=ae[F+q];w.prev_length>=w.good_match&&(N>>=2),j>w.lookahead&&(j=w.lookahead);do if(ae[(G=U)+q]===ce&&ae[G+q-1]===Te&&ae[G]===ae[F]&&ae[++G]===ae[F+1]){F+=2,G++;do;while(ae[++F]===ae[++G]&&ae[++F]===ae[++G]&&ae[++F]===ae[++G]&&ae[++F]===ae[++G]&&ae[++F]===ae[++G]&&ae[++F]===ae[++G]&&ae[++F]===ae[++G]&&ae[++F]===ae[++G]&&FK&&--N!=0);return q<=w.lookahead?q:w.lookahead}function se(w){var U,G,R,N,F,q,j,K,ae,$,ne=w.w_size;do{if(N=w.window_size-w.lookahead-w.strstart,w.strstart>=ne+(ne-D)){for(o.arraySet(w.window,w.window,ne,ne,0),w.match_start-=ne,w.strstart-=ne,w.block_start-=ne,U=G=w.hash_size;R=w.head[--U],w.head[U]=ne<=R?R-ne:0,--G;);for(U=G=ne;R=w.prev[--U],w.prev[U]=ne<=R?R-ne:0,--G;);N+=ne}if(w.strm.avail_in===0)break;if(q=w.strm,j=w.window,K=w.strstart+w.lookahead,ae=N,$=void 0,$=q.avail_in,ae<$&&($=ae),G=$===0?0:(q.avail_in-=$,o.arraySet(j,q.input,q.next_in,$,K),q.state.wrap===1?q.adler=l(q.adler,j,$,K):q.state.wrap===2&&(q.adler=u(q.adler,j,$,K)),q.next_in+=$,q.total_in+=$,$),w.lookahead+=G,w.lookahead+w.insert>=_)for(F=w.strstart-w.insert,w.ins_h=w.window[F],w.ins_h=(w.ins_h<=_&&(w.ins_h=(w.ins_h<=_)if(R=a._tr_tally(w,w.strstart-w.match_start,w.match_length-_),w.lookahead-=w.match_length,w.match_length<=w.max_lazy_match&&w.lookahead>=_){for(w.match_length--;w.strstart++,w.ins_h=(w.ins_h<=_&&(w.ins_h=(w.ins_h<=_&&w.match_length<=w.prev_length){for(N=w.strstart+w.lookahead-_,R=a._tr_tally(w,w.strstart-1-w.prev_match,w.prev_length-_),w.lookahead-=w.prev_length-1,w.prev_length-=2;++w.strstart<=N&&(w.ins_h=(w.ins_h<w.pending_buf_size-5&&(G=w.pending_buf_size-5);;){if(w.lookahead<=1){if(se(w),w.lookahead===0&&U===c)return E;if(w.lookahead===0)break}w.strstart+=w.lookahead,w.lookahead=0;var R=w.block_start+G;if((w.strstart===0||w.strstart>=R)&&(w.lookahead=w.strstart-R,w.strstart=R,O(w,!1),w.strm.avail_out===0)||w.strstart-w.block_start>=w.w_size-D&&(O(w,!1),w.strm.avail_out===0))return E}return w.insert=0,U===f?(O(w,!0),w.strm.avail_out===0?Q:H):(w.strstart>w.block_start&&(O(w,!1),w.strm.avail_out),E)}),new be(4,4,8,4,he),new be(4,5,16,8,he),new be(4,6,32,32,he),new be(4,4,16,16,oe),new be(8,16,32,32,oe),new be(8,16,128,128,oe),new be(8,32,128,256,oe),new be(32,128,258,1024,oe),new be(32,258,258,4096,oe)],n.deflateInit=function(w,U){return z(w,U,y,15,8,0)},n.deflateInit2=z,n.deflateReset=V,n.deflateResetKeep=ve,n.deflateSetHeader=function(w,U){return w&&w.state?w.state.wrap!==2?p:(w.state.gzhead=U,d):p},n.deflate=function(w,U){var G,R,N,F;if(!w||!w.state||5>8&255),fe(R,R.gzhead.time>>16&255),fe(R,R.gzhead.time>>24&255),fe(R,R.level===9?2:2<=R.strategy||R.level<2?4:0),fe(R,255&R.gzhead.os),R.gzhead.extra&&R.gzhead.extra.length&&(fe(R,255&R.gzhead.extra.length),fe(R,R.gzhead.extra.length>>8&255)),R.gzhead.hcrc&&(w.adler=u(w.adler,R.pending_buf,R.pending,0)),R.gzindex=0,R.status=69):(fe(R,0),fe(R,0),fe(R,0),fe(R,0),fe(R,0),fe(R,R.level===9?2:2<=R.strategy||R.level<2?4:0),fe(R,3),R.status=L);else{var q=y+(R.w_bits-8<<4)<<8;q|=(2<=R.strategy||R.level<2?0:R.level<6?1:R.level===6?2:3)<<6,R.strstart!==0&&(q|=32),q+=31-q%31,R.status=L,de(R,q),R.strstart!==0&&(de(R,w.adler>>>16),de(R,65535&w.adler)),w.adler=1}if(R.status===69)if(R.gzhead.extra){for(N=R.pending;R.gzindex<(65535&R.gzhead.extra.length)&&(R.pending!==R.pending_buf_size||(R.gzhead.hcrc&&R.pending>N&&(w.adler=u(w.adler,R.pending_buf,R.pending-N,N)),X(w),N=R.pending,R.pending!==R.pending_buf_size));)fe(R,255&R.gzhead.extra[R.gzindex]),R.gzindex++;R.gzhead.hcrc&&R.pending>N&&(w.adler=u(w.adler,R.pending_buf,R.pending-N,N)),R.gzindex===R.gzhead.extra.length&&(R.gzindex=0,R.status=73)}else R.status=73;if(R.status===73)if(R.gzhead.name){N=R.pending;do{if(R.pending===R.pending_buf_size&&(R.gzhead.hcrc&&R.pending>N&&(w.adler=u(w.adler,R.pending_buf,R.pending-N,N)),X(w),N=R.pending,R.pending===R.pending_buf_size)){F=1;break}F=R.gzindexN&&(w.adler=u(w.adler,R.pending_buf,R.pending-N,N)),F===0&&(R.gzindex=0,R.status=91)}else R.status=91;if(R.status===91)if(R.gzhead.comment){N=R.pending;do{if(R.pending===R.pending_buf_size&&(R.gzhead.hcrc&&R.pending>N&&(w.adler=u(w.adler,R.pending_buf,R.pending-N,N)),X(w),N=R.pending,R.pending===R.pending_buf_size)){F=1;break}F=R.gzindexN&&(w.adler=u(w.adler,R.pending_buf,R.pending-N,N)),F===0&&(R.status=103)}else R.status=103;if(R.status===103&&(R.gzhead.hcrc?(R.pending+2>R.pending_buf_size&&X(w),R.pending+2<=R.pending_buf_size&&(fe(R,255&w.adler),fe(R,w.adler>>8&255),w.adler=0,R.status=L)):R.status=L),R.pending!==0){if(X(w),w.avail_out===0)return R.last_flush=-1,d}else if(w.avail_in===0&&J(U)<=J(G)&&U!==f)return Z(w,-5);if(R.status===666&&w.avail_in!==0)return Z(w,-5);if(w.avail_in!==0||R.lookahead!==0||U!==c&&R.status!==666){var j=R.strategy===2?function(K,ae){for(var $;;){if(K.lookahead===0&&(se(K),K.lookahead===0)){if(ae===c)return E;break}if(K.match_length=0,$=a._tr_tally(K,0,K.window[K.strstart]),K.lookahead--,K.strstart++,$&&(O(K,!1),K.strm.avail_out===0))return E}return K.insert=0,ae===f?(O(K,!0),K.strm.avail_out===0?Q:H):K.last_lit&&(O(K,!1),K.strm.avail_out===0)?E:k}(R,U):R.strategy===3?function(K,ae){for(var $,ne,ye,Te,ce=K.window;;){if(K.lookahead<=T){if(se(K),K.lookahead<=T&&ae===c)return E;if(K.lookahead===0)break}if(K.match_length=0,K.lookahead>=_&&0K.lookahead&&(K.match_length=K.lookahead)}if(K.match_length>=_?($=a._tr_tally(K,1,K.match_length-_),K.lookahead-=K.match_length,K.strstart+=K.match_length,K.match_length=0):($=a._tr_tally(K,0,K.window[K.strstart]),K.lookahead--,K.strstart++),$&&(O(K,!1),K.strm.avail_out===0))return E}return K.insert=0,ae===f?(O(K,!0),K.strm.avail_out===0?Q:H):K.last_lit&&(O(K,!1),K.strm.avail_out===0)?E:k}(R,U):r[R.level].func(R,U);if(j!==Q&&j!==H||(R.status=666),j===E||j===Q)return w.avail_out===0&&(R.last_flush=-1),d;if(j===k&&(U===1?a._tr_align(R):U!==5&&(a._tr_stored_block(R,0,0,!1),U===3&&(le(R.head),R.lookahead===0&&(R.strstart=0,R.block_start=0,R.insert=0))),X(w),w.avail_out===0))return R.last_flush=-1,d}return U!==f?d:R.wrap<=0?1:(R.wrap===2?(fe(R,255&w.adler),fe(R,w.adler>>8&255),fe(R,w.adler>>16&255),fe(R,w.adler>>24&255),fe(R,255&w.total_in),fe(R,w.total_in>>8&255),fe(R,w.total_in>>16&255),fe(R,w.total_in>>24&255)):(de(R,w.adler>>>16),de(R,65535&w.adler)),X(w),0=G.w_size&&(F===0&&(le(G.head),G.strstart=0,G.block_start=0,G.insert=0),ae=new o.Buf8(G.w_size),o.arraySet(ae,U,$-G.w_size,G.w_size,0),U=ae,$=G.w_size),q=w.avail_in,j=w.next_in,K=w.input,w.avail_in=$,w.next_in=0,w.input=U,se(G);G.lookahead>=_;){for(R=G.strstart,N=G.lookahead-(_-1);G.ins_h=(G.ins_h<>>=_=M>>>24,v-=_,(_=M>>>16&255)===0)k[h++]=65535&M;else{if(!(16&_)){if(!(64&_)){M=S[(65535&M)+(y&(1<<_)-1)];continue t}if(32&_){a.mode=12;break e}r.msg="invalid literal/length code",a.mode=30;break e}T=65535&M,(_&=15)&&(v<_&&(y+=E[l++]<>>=_,v-=_),v<15&&(y+=E[l++]<>>=_=M>>>24,v-=_,!(16&(_=M>>>16&255))){if(!(64&_)){M=A[(65535&M)+(y&(1<<_)-1)];continue i}r.msg="invalid distance code",a.mode=30;break e}if(D=65535&M,v<(_&=15)&&(y+=E[l++]<>>=_,v-=_,(_=h-c)>3,y&=(1<<(v-=T<<3))-1,r.next_in=l,r.next_out=h,r.avail_in=l>>24&255)+(C>>>8&65280)+((65280&C)<<8)+((255&C)<<24)}function y(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function v(C){var L;return C&&C.state?(L=C.state,C.total_in=C.total_out=L.total=0,C.msg="",L.wrap&&(C.adler=1&L.wrap),L.mode=p,L.last=0,L.havedict=0,L.dmax=32768,L.head=null,L.hold=0,L.bits=0,L.lencode=L.lendyn=new r.Buf32(g),L.distcode=L.distdyn=new r.Buf32(m),L.sane=1,L.back=-1,f):d}function S(C){var L;return C&&C.state?((L=C.state).wsize=0,L.whave=0,L.wnext=0,v(C)):d}function A(C,L){var E,k;return C&&C.state?(k=C.state,L<0?(E=0,L=-L):(E=1+(L>>4),L<48&&(L&=15)),L&&(L<8||15=H.wsize?(r.arraySet(H.window,L,E-H.wsize,H.wsize,0),H.wnext=0,H.whave=H.wsize):(k<(Q=H.wsize-H.wnext)&&(Q=k),r.arraySet(H.window,L,E-k,Q,H.wnext),(k-=Q)?(r.arraySet(H.window,L,E-k,k,0),H.wnext=k,H.whave=H.wsize):(H.wnext+=Q,H.wnext===H.wsize&&(H.wnext=0),H.whave>>8&255,E.check=a(E.check,F,2,0),O=X=0,E.mode=2;break}if(E.flags=0,E.head&&(E.head.done=!1),!(1&E.wrap)||(((255&X)<<8)+(X>>8))%31){C.msg="incorrect header check",E.mode=30;break}if((15&X)!=8){C.msg="unknown compression method",E.mode=30;break}if(O-=4,w=8+(15&(X>>>=4)),E.wbits===0)E.wbits=w;else if(w>E.wbits){C.msg="invalid window size",E.mode=30;break}E.dmax=1<>8&1),512&E.flags&&(F[0]=255&X,F[1]=X>>>8&255,E.check=a(E.check,F,2,0)),O=X=0,E.mode=3;case 3:for(;O<32;){if(J===0)break e;J--,X+=k[H++]<>>8&255,F[2]=X>>>16&255,F[3]=X>>>24&255,E.check=a(E.check,F,4,0)),O=X=0,E.mode=4;case 4:for(;O<16;){if(J===0)break e;J--,X+=k[H++]<>8),512&E.flags&&(F[0]=255&X,F[1]=X>>>8&255,E.check=a(E.check,F,2,0)),O=X=0,E.mode=5;case 5:if(1024&E.flags){for(;O<16;){if(J===0)break e;J--,X+=k[H++]<>>8&255,E.check=a(E.check,F,2,0)),O=X=0}else E.head&&(E.head.extra=null);E.mode=6;case 6:if(1024&E.flags&&(J<(W=E.length)&&(W=J),W&&(E.head&&(w=E.head.extra_len-E.length,E.head.extra||(E.head.extra=new Array(E.head.extra_len)),r.arraySet(E.head.extra,k,H,W,w)),512&E.flags&&(E.check=a(E.check,k,W,H)),J-=W,H+=W,E.length-=W),E.length))break e;E.length=0,E.mode=7;case 7:if(2048&E.flags){if(J===0)break e;for(W=0;w=k[H+W++],E.head&&w&&E.length<65536&&(E.head.name+=String.fromCharCode(w)),w&&W>9&1,E.head.done=!0),C.adler=E.check=0,E.mode=12;break;case 10:for(;O<32;){if(J===0)break e;J--,X+=k[H++]<>>=7&O,O-=7&O,E.mode=27;break}for(;O<3;){if(J===0)break e;J--,X+=k[H++]<>>=1)){case 0:E.mode=14;break;case 1:if(T(E),E.mode=20,L!==6)break;X>>>=2,O-=2;break e;case 2:E.mode=17;break;case 3:C.msg="invalid block type",E.mode=30}X>>>=2,O-=2;break;case 14:for(X>>>=7&O,O-=7&O;O<32;){if(J===0)break e;J--,X+=k[H++]<>>16^65535)){C.msg="invalid stored block lengths",E.mode=30;break}if(E.length=65535&X,O=X=0,E.mode=15,L===6)break e;case 15:E.mode=16;case 16:if(W=E.length){if(J>>=5,O-=5,E.ndist=1+(31&X),X>>>=5,O-=5,E.ncode=4+(15&X),X>>>=4,O-=4,286>>=3,O-=3}for(;E.have<19;)E.lens[q[E.have++]]=0;if(E.lencode=E.lendyn,E.lenbits=7,G={bits:E.lenbits},U=u(0,E.lens,0,19,E.lencode,0,E.work,G),E.lenbits=G.bits,U){C.msg="invalid code lengths set",E.mode=30;break}E.have=0,E.mode=19;case 19:for(;E.have>>16&255,Me=65535&N,!((oe=N>>>24)<=O);){if(J===0)break e;J--,X+=k[H++]<>>=oe,O-=oe,E.lens[E.have++]=Me;else{if(Me===16){for(R=oe+2;O>>=oe,O-=oe,E.have===0){C.msg="invalid bit length repeat",E.mode=30;break}w=E.lens[E.have-1],W=3+(3&X),X>>>=2,O-=2}else if(Me===17){for(R=oe+3;O>>=oe)),X>>>=3,O-=3}else{for(R=oe+7;O>>=oe)),X>>>=7,O-=7}if(E.have+W>E.nlen+E.ndist){C.msg="invalid bit length repeat",E.mode=30;break}for(;W--;)E.lens[E.have++]=w}}if(E.mode===30)break;if(E.lens[256]===0){C.msg="invalid code -- missing end-of-block",E.mode=30;break}if(E.lenbits=9,G={bits:E.lenbits},U=u(h,E.lens,0,E.nlen,E.lencode,0,E.work,G),E.lenbits=G.bits,U){C.msg="invalid literal/lengths set",E.mode=30;break}if(E.distbits=6,E.distcode=E.distdyn,G={bits:E.distbits},U=u(c,E.lens,E.nlen,E.ndist,E.distcode,0,E.work,G),E.distbits=G.bits,U){C.msg="invalid distances set",E.mode=30;break}if(E.mode=20,L===6)break e;case 20:E.mode=21;case 21:if(6<=J&&258<=le){C.next_out=Z,C.avail_out=le,C.next_in=H,C.avail_in=J,E.hold=X,E.bits=O,l(C,de),Z=C.next_out,Q=C.output,le=C.avail_out,H=C.next_in,k=C.input,J=C.avail_in,X=E.hold,O=E.bits,E.mode===12&&(E.back=-1);break}for(E.back=0;be=(N=E.lencode[X&(1<>>16&255,Me=65535&N,!((oe=N>>>24)<=O);){if(J===0)break e;J--,X+=k[H++]<>ve)])>>>16&255,Me=65535&N,!(ve+(oe=N>>>24)<=O);){if(J===0)break e;J--,X+=k[H++]<>>=ve,O-=ve,E.back+=ve}if(X>>>=oe,O-=oe,E.back+=oe,E.length=Me,be===0){E.mode=26;break}if(32&be){E.back=-1,E.mode=12;break}if(64&be){C.msg="invalid literal/length code",E.mode=30;break}E.extra=15&be,E.mode=22;case 22:if(E.extra){for(R=E.extra;O>>=E.extra,O-=E.extra,E.back+=E.extra}E.was=E.length,E.mode=23;case 23:for(;be=(N=E.distcode[X&(1<>>16&255,Me=65535&N,!((oe=N>>>24)<=O);){if(J===0)break e;J--,X+=k[H++]<>ve)])>>>16&255,Me=65535&N,!(ve+(oe=N>>>24)<=O);){if(J===0)break e;J--,X+=k[H++]<>>=ve,O-=ve,E.back+=ve}if(X>>>=oe,O-=oe,E.back+=oe,64&be){C.msg="invalid distance code",E.mode=30;break}E.offset=Me,E.extra=15&be,E.mode=24;case 24:if(E.extra){for(R=E.extra;O>>=E.extra,O-=E.extra,E.back+=E.extra}if(E.offset>E.dmax){C.msg="invalid distance too far back",E.mode=30;break}E.mode=25;case 25:if(le===0)break e;if(W=de-le,E.offset>W){if((W=E.offset-W)>E.whave&&E.sane){C.msg="invalid distance too far back",E.mode=30;break}se=W>E.wnext?(W-=E.wnext,E.wsize-W):E.wnext-W,W>E.length&&(W=E.length),he=E.window}else he=Q,se=Z-E.offset,W=E.length;for(lex?(_=se[he+m[L]],O[fe+m[L]]):(_=96,0),y=1<>Z)+(v-=y)]=M<<24|_<<16|T|0,v!==0;);for(y=1<>=1;if(y!==0?(X&=y-1,X+=y):X=0,L++,--de[C]==0){if(C===k)break;C=c[f+m[L]]}if(Q>>7)]}function fe(N,F){N.pending_buf[N.pending++]=255&F,N.pending_buf[N.pending++]=F>>>8&255}function de(N,F,q){N.bi_valid>b-q?(N.bi_buf|=F<>b-N.bi_valid,N.bi_valid+=q-b):(N.bi_buf|=F<>>=1,q<<=1,0<--F;);return q>>>1}function he(N,F,q){var j,K,ae=new Array(m+1),$=0;for(j=1;j<=m;j++)ae[j]=$=$+q[j-1]<<1;for(K=0;K<=F;K++){var ne=N[2*K+1];ne!==0&&(N[2*K]=se(ae[ne]++,ne))}}function oe(N){var F;for(F=0;F>1;1<=q;q--)ve(N,ae,q);for(K=ye;q=N.heap[1],N.heap[1]=N.heap[N.heap_len--],ve(N,ae,1),j=N.heap[1],N.heap[--N.heap_max]=q,N.heap[--N.heap_max]=j,ae[2*K]=ae[2*q]+ae[2*j],N.depth[K]=(N.depth[q]>=N.depth[j]?N.depth[q]:N.depth[j])+1,ae[2*q+1]=ae[2*j+1]=K,N.heap[1]=K++,ve(N,ae,1),2<=N.heap_len;);N.heap[--N.heap_max]=N.heap[1],function(ce,we){var Re,He,wt,We,_t,gt,Rt=we.dyn_tree,Is=we.max_code,Rs=we.stat_desc.static_tree,ir=we.stat_desc.has_stree,Zs=we.stat_desc.extra_bits,An=we.stat_desc.extra_base,Ni=we.stat_desc.max_length,Ki=0;for(We=0;We<=m;We++)ce.bl_count[We]=0;for(Rt[2*ce.heap[ce.heap_max]+1]=0,Re=ce.heap_max+1;Re>=7;K>>=1)if(1&Te&&ne.dyn_ltree[2*ye]!==0)return o;if(ne.dyn_ltree[18]!==0||ne.dyn_ltree[20]!==0||ne.dyn_ltree[26]!==0)return a;for(ye=32;ye>>3,(ae=N.static_len+3+7>>>3)<=K&&(K=ae)):K=ae=q+5,q+4<=K&&F!==-1?R(N,F,q,j):N.strategy===4||ae===K?(de(N,2+(j?1:0),3),V(N,D,C)):(de(N,4+(j?1:0),3),function(ne,ye,Te,ce){var we;for(de(ne,ye-257,5),de(ne,Te-1,5),de(ne,ce-4,4),we=0;we>>8&255,N.pending_buf[N.d_buf+2*N.last_lit+1]=255&F,N.pending_buf[N.l_buf+N.last_lit]=255&q,N.last_lit++,F===0?N.dyn_ltree[2*q]++:(N.matches++,F--,N.dyn_ltree[2*(E[q]+c+1)]++,N.dyn_dtree[2*O(F)]++),N.last_lit===N.lit_bufsize-1},n._tr_align=function(N){de(N,2,3),W(N,v,D),function(F){F.bi_valid===16?(fe(F,F.bi_buf),F.bi_buf=0,F.bi_valid=0):8<=F.bi_valid&&(F.pending_buf[F.pending++]=255&F.bi_buf,F.bi_buf>>=8,F.bi_valid-=8)}(N)}},{"../utils/common":41}],53:[function(t,s,n){s.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,s,n){s.exports=typeof setImmediate=="function"?setImmediate:function(){var r=[].slice.apply(arguments);r.splice(1,0,0),setTimeout.apply(null,r)}},{}]},{},[10])(10)})})(MC);class CC{static MXLtoIXmlElement(e){const t=new Cu;return t.loadAsync(e).then(r=>t.file("META-INF/container.xml").async("text"),r=>{throw r}).then(r=>{const l=new DOMParser().parseFromString(r,"text/xml").getElementsByTagName("rootfile")[0].getAttribute("full-path");return t.file(l).async("text")},r=>{throw r}).then(r=>{const a=new DOMParser().parseFromString(r,"text/xml"),l=new Ll(a.documentElement);return Promise.resolve(l)},r=>{throw r}).then(r=>r,r=>{throw new Error("extractSheetFromMxl: "+r.message)})}static MXLtoXMLstring(e){const t=new Cu;return t.loadAsync(e).then(s=>t.file("META-INF/container.xml").async("text"),s=>{throw ge.error(s),s}).then(s=>{const o=new DOMParser().parseFromString(s,"text/xml").getElementsByTagName("rootfile")[0].getAttribute("full-path");return t.file(o).async("text")},s=>{throw s})}}class Pp{calculate(e){const t=new la(e);for(;!t.EndReached;){const s=t.CurrentEnrolledTimestamp,n=t.CurrentAudibleVoiceEntries();for(const r of n)this.handleVoiceEntry(e,r,s);t.moveToNext()}}handleVoiceEntry(e,t,s){if(t.IsGrace)return;const n=t.ParentVoice;let r;e.PlaybackDataDict.containsKey(n)?r=e.PlaybackDataDict.getValue(n):(r=[],e.PlaybackDataDict.setValue(n,r));for(const o of t.PlaybackEntries)if(o.HasNotes){for(const l of o.Notes)l.setLength();const a=re.plus(s,o.TimestampShift);Pp.addEntrySorted(r,o,a)}}static addEntrySorted(e,t,s){if(e.length===0)e.push({enrolledTimestamp:s,playbackEntry:t});else for(let n=e.length-1;n>=0;n--){const r=e[n];if(s.RealValue>r.enrolledTimestamp.RealValue)if(n===e.length-1){e.push({enrolledTimestamp:s,playbackEntry:t});break}else{e.splice(n+1,0,{enrolledTimestamp:s,playbackEntry:t});break}}}}class Tu{constructor(e,t,s,n){this.psi=new Ut(void 0),this.displaySizeInPixel=e,this.RelativeDisplaySize=t,this.RelativeDisplayPosition=s,this.WidthInUnits=n}static createWithRelativeDefaults(e,t){return new Tu(e,new Ss(1,1),new te(0,0),t)}static createWithDefaults(){return new Tu(new Ss(1,1),new Ss(1,1),new te(0,0),1)}get UpperLeftPositionInUnits(){return this.psi.AbsolutePosition}set UpperLeftPositionInUnits(e){this.psi.AbsolutePosition=e}get DisplaySizeInPixel(){return this.displaySizeInPixel}set DisplaySizeInPixel(e){this.displaySizeInPixel=e,this.regionSizeInPixel=new Ss(this.displaySizeInPixel.width*this.relativeRegionSize.width,this.displaySizeInPixel.height*this.relativeRegionSize.height),this.recalculateDependentVariables()}get RelativeDisplaySize(){return this.relativeRegionSize}set RelativeDisplaySize(e){this.relativeRegionSize=e,this.regionSizeInPixel=new Ss(this.displaySizeInPixel.width*this.relativeRegionSize.width,this.displaySizeInPixel.height*this.relativeRegionSize.height),this.recalculateDependentVariables()}get RegionSizeInPixel(){return this.regionSizeInPixel}get WidthInUnits(){return this.psi.BorderRight}set WidthInUnits(e){this.psi.BorderRight=e,this.recalculateDependentVariables()}get ViewRegionInUnits(){return new Ss(this.psi.BorderRight,this.psi.BorderBottom)}isVisible(e,t){const s=this.psi.collisionDetection(e);return this.psi.liesInsideBorders(e),s}isInsideDisplayArea(e,t){return this.RelativeDisplayPosition.x<=e&&e<=this.RelativeDisplayPosition.x+this.RelativeDisplaySize.width&&this.RelativeDisplayPosition.y<=t&&t<=this.RelativeDisplayPosition.y+this.RelativeDisplaySize.height}transformToUnitCoordinates(e){return new te(this.UpperLeftPositionInUnits.x+this.ViewRegionInUnits.width*((e.x-this.RelativeDisplayPosition.x)/this.RelativeDisplaySize.width),this.UpperLeftPositionInUnits.y+this.ViewRegionInUnits.height*((e.y-this.RelativeDisplayPosition.y)/this.RelativeDisplaySize.height))}transformLengthXToUnitCoordinates(e){return e/this.horizontalUnitToPixelRatio}transformLengthYToUnitCoordinates(e){return e/this.verticalUnitToPixelRatio}recalculateDependentVariables(){const e=this.regionSizeInPixel.width/this.regionSizeInPixel.height;this.psi.BorderBottom=this.psi.BorderRight/e,this.horizontalUnitToPixelRatio=this.regionSizeInPixel.width/this.ViewRegionInUnits.width,this.verticalUnitToPixelRatio=this.regionSizeInPixel.height/this.ViewRegionInUnits.height}}class TC{constructor(e){this.aspectRatio=1,this.zoomViews=[],this.mouseZoomMode=!1,this.autoScrollY=!0,this.displayInteractionManager=e,this.displayInteractionManager.addListener(this),this.offsetXMin=Number.MIN_VALUE,this.offsetYMin=Number.MIN_VALUE,this.rangeXMin=1,this.rangeYMin=1,this.offsetXMax=Number.MAX_VALUE,this.offsetYMax=Number.MAX_VALUE,this.rangeXMax=1e9,this.rangeYMax=1e9,this.XScrollingEnabled=!1,this.YScrollingEnabled=!0}positionTouched(e,t){if(!this.convertToUnitsReady())return;const s=this.getPositionInUnits(e,t);this.unitPosTouched(s,e,t)}get TouchActive(){return this.displayInteractionManager.TouchActive}get TouchMoving(){return this.displayInteractionManager.TouchMoving}positionDoubleTouched(e,t){if(!this.convertToUnitsReady())return;const s=this.getPositionInUnits(e,t);this.unitPosDoubleTouched(s,e,t)}get UsesManuallyControlledZoomMode(){return this.usesManuallyControlledZoomMode}set UsesManuallyControlledZoomMode(e){this.usesManuallyControlledZoomMode=e}mouseDown(e,t,s=!1){if(!this.convertToUnitsReady())return;this.selectScrollControllerY(!1),this.lastRangeX=Math.max(1,this.RangeX),this.lastRangeY=Math.max(1,this.RangeY),this.lastOffsetX=this.OffsetX,this.lastOffsetY=this.OffsetY;const n=this.getPositionInUnits(e,t);this.unitPosTouchDown(n,e,t),this.usesManuallyControlledZoomMode||(s?this.mouseZoomMode=!0:this.mouseZoomMode=!1)}mouseUp(e,t){const s=this.getPositionInUnits(e,t);this.unitPosTouchUp(s,e,t)}mouseMove(e,t,s,n){this.mouseZoomMode?(Math.abs(s-0)>1e-8&&(this.RangeX=Math.abs(this.lastRangeX/(1+s))),!this.lockRanges&&Math.abs(n-0)>1e-8&&(this.RangeY=Math.abs(this.lastRangeY/(1-n)))):(Math.abs(s-0)>1e-8&&(this.OffsetX=this.lastOffsetX-s*this.RangeX),Math.abs(n-0)>1e-8&&(this.OffsetY=this.lastOffsetY-n*this.RangeY));const r=this.getPositionInUnits(e,t);this.unitPosMove(r,e,t)}zoom(e){this.RangeX=Math.abs(this.lastRangeX/e)}addZoomView(e){this.zoomViews.push(e)}get OffsetX(){return this.offsetX}set OffsetX(e){this.offsetX=Math.min(this.offsetXMax,Math.max(this.offsetXMin,e));for(const t of this.zoomViews)t.viewportXChanged(this.offsetX,this.RangeX)}get OffsetY(){return this.offsetY}set OffsetY(e){this.offsetY=e,this.offsetY>this.offsetYMax?this.offsetY=this.offsetYMax:this.offsetY(i[i.SingleTouch=0]="SingleTouch",i[i.DoubleTouch=1]="DoubleTouch",i[i.TouchUp=2]="TouchUp",i[i.TouchDown=3]="TouchDown",i[i.Move=4]="Move",i))(Wi||{});class LC{constructor(e){this.renderingManager=e}userDisplayInteraction(e,t,s){var n,r;switch(s){case Wi.TouchDown:case Wi.SingleTouch:case Wi.DoubleTouch:{const o=this.renderingManager.GraphicalMusicSheet.GetNearestVoiceEntry(t);o&&o.parentStaffEntry.parentVerticalContainer!==void 0&&((n=o.notes[0])==null?void 0:n.sourceNote.Pitch)!==void 0&&((r=this.renderingManager.PlaybackManager)==null||r.playVoiceEntry(o.parentVoiceEntry));break}}}}class BC extends TC{constructor(e,t){super(e),this.mainViewingRegion=Tu.createWithDefaults(),this.tryAgainToRenderCount=0,this.yOffsetMouseDown=Number.MIN_VALUE,this.unlockCursorDistancePixel=50,this.relativeTopPosition=.06,this.internalPreviewImageScale=3,this.listeners=[],this.LockDisplayToCursor=!0,this.ZoomActive=!1,this.rules=t,this.addZoomView(this),this.lockRanges=!0,this.TopBarHeightInPixel=70,this.BottomBarHeightInPixel=0,this.rules.UseDefaultVoiceInteractionListener&&this.listeners.push(new LC(this))}addListener(e){this.listeners.push(e)}get Listeners(){return this.listeners}convertToUnitsReady(){return this.graphicalMusicSheet!==void 0}unitPosTouched(e,t,s){if(!this.SingleTouchDisabled){const n=new te(t,s);this.handleUserDisplayInteraction(n,e,Wi.SingleTouch)}}unitPosDoubleTouched(e,t,s){if(!this.DoubleTouchDisabled){const n=new te(t,s);this.handleUserDisplayInteraction(n,e,Wi.DoubleTouch)}}unitPosTouchDown(e,t,s){const n=new te(t,s);this.handleUserDisplayInteraction(n,e,Wi.TouchDown),this.yOffsetMouseDown=e.y}unitPosTouchUp(e,t,s){const n=new te(t,s);this.handleUserDisplayInteraction(n,e,Wi.TouchUp),this.displayInteractionManager.WasZoomGestureActive===!1&&this.unlockFromCursorIfNecessary(e),this.yOffsetMouseDown=Number.MIN_VALUE}unitPosMove(e,t,s){const n=new te(t,s);this.handleUserDisplayInteraction(n,e,Wi.Move),this.unlockFromCursorIfNecessary(e)}get MainViewingRegion(){return this.mainViewingRegion}setMusicSheet(e){this.graphicalMusicSheet=e,this.adaptDisplayLimitsToSheet(),this.setYOffset(0,!0)}viewportXChanged(e,t){this.graphicalMusicSheet!==void 0&&this.horizontalViewportChanged(e,t)}viewportYChanged(e,t){this.graphicalMusicSheet!==void 0&&(this.yOffsetMouseDown<=Number.MIN_VALUE+.5&&(this.yOffsetMouseDown=e),this.verticalViewportChanged(e,t))}displaySizeChanged(e,t){super.viewSizeChanged(e,t),!(Math.abs(e-0)<1e-7||Math.abs(t-0)<1e-7)&&(this.graphicalMusicSheet!==void 0&&this.graphicalMusicSheet.EnforceRedrawOfMusicSystems(),this.mainViewingRegion.DisplaySizeInPixel=new Ss(e,t),this.adaptDisplayLimitsToSheet())}calcDisplayYPosition(e){return e.PositionAndShape.AbsolutePosition.y+e.PositionAndShape.BorderMarginTop-this.topBarHeightInUnits()-this.relativeTopPosition*this.heightWithoutTopBottomBarsInUnits()}yPositionForLastSystem(e){return e.PositionAndShape.AbsolutePosition.y+e.PositionAndShape.BorderMarginBottom-this.topBarHeightInUnits()-(1-this.relativeTopPosition)*this.heightWithoutTopBottomBarsInUnits()}scorePositionChanged(e,t,s,n,r,o){const a=this.calcDisplayYPosition(n);this.setYPosition(a,o)}setXPosition(e,t){this.LockDisplayToCursor&&this.setXOffset(e,t)}setYPosition(e,t){this.LockDisplayToCursor&&this.setYOffset(e,t)}get DrawingParameters(){return this.musicSheetDrawer.drawingParameters}topBarHeightInUnits(){return this.mainViewingRegion.transformLengthYToUnitCoordinates(this.TopBarHeightInPixel)}bottomBarHeightInUnits(){return this.mainViewingRegion.transformLengthYToUnitCoordinates(this.BottomBarHeightInPixel)}heightWithoutTopBottomBarsInUnits(){return this.mainViewingRegion.ViewRegionInUnits.height-this.topBarHeightInUnits()-this.bottomBarHeightInUnits()}activePositionToBottomBarHeight(){return(this.mainViewingRegion.ViewRegionInUnits.height-this.topBarHeightInUnits()-this.bottomBarHeightInUnits())*(1-2*this.relativeTopPosition)}getClickPosition(e,t){return this.mainViewingRegion.transformToUnitCoordinates(new te(e,t))}graphicalObjectIsVisible(e){return this.mainViewingRegion.isVisible(e,!1)}adaptDisplayLimitsToSheet(){if(this.graphicalMusicSheet===void 0||this.graphicalMusicSheet.MusicPages.length===0||this.graphicalMusicSheet.MusicPages[0].MusicSystems.length===0)return;this.offsetXMin=0,this.rangeXMin=this.graphicalMusicSheet.MinAllowedSystemWidth,this.rangeXMax=300,this.offsetYMin=-.3*this.RangeY;const e=this.graphicalMusicSheet.MusicPages.last().PositionAndShape;this.offsetYMax=Math.max(0,e.BorderMarginBottom-.7*this.RangeY),this.OffsetY>this.offsetYMax&&this.setYOffset(this.offsetYMax,!0)}horizontalViewportChanged(e,t){this.mainViewingRegion.WidthInUnits!==t&&(this.mainViewingRegion.WidthInUnits=t)}verticalViewportChanged(e,t){this.mainViewingRegion.UpperLeftPositionInUnits=new te(this.mainViewingRegion.UpperLeftPositionInUnits.x,e)}unlockFromCursorIfNecessary(e){if(this.LockDisplayToCursor===!1||this.ZoomActive||this.displayInteractionManager.ZoomGestureActive||this.displayInteractionManager.WasZoomGestureActive)return;Math.abs((e.y-this.yOffsetMouseDown)*this.mainViewingRegion.RegionSizeInPixel.height/this.mainViewingRegion.ViewRegionInUnits.height)>this.unlockCursorDistancePixel&&(this.LockDisplayToCursor=!1)}getPositionInUnits(e,t){return this.mainViewingRegion.transformToUnitCoordinates(new te(e,t))}handleUserDisplayInteraction(e,t,s){switch(s){case Wi.TouchDown:case Wi.SingleTouch:case Wi.DoubleTouch:{const n=this.graphicalMusicSheet.GetNearestVoiceEntry(t);if(n){const r=new CustomEvent("note-click",{detail:{...n,setAvtivePlay:()=>{var o,a;if(n.parentStaffEntry.parentVerticalContainer!==void 0){const l=n.parentStaffEntry.parentVerticalContainer.AbsoluteTimestamp;this.setStartPosition(l),((o=n.notes[0])==null?void 0:o.sourceNote.Pitch)!==void 0&&(console.log("playback clicked note",n.parentVoiceEntry),(a=this.PlaybackManager)==null||a.playVoiceEntry(n.parentVoiceEntry))}}}});window.dispatchEvent(r)}}case Wi.TouchUp:case Wi.TouchDown:case Wi.Move:for(const n of this.listeners)n.userDisplayInteraction(e,t,s);break;default:throw new Error("type")}}setStartPosition(e){var t;this.graphicalMusicSheet!==void 0&&(this.graphicalMusicSheet.ParentMusicSheet.SelectionStart=e,(t=this.PlaybackManager)==null||t.reset())}get GraphicalMusicSheet(){return this.graphicalMusicSheet}}class IC extends BC{mouseMove(e,t,s,n){const r=this.getPositionInUnits(e,t);this.unitPosMove(r,e,t)}}class RC{constructor(){this.listeners=[],this.zoomGestureActive=!1,this.touchCount=0,this.touchActive=!1,this.touchMoving=!1,this.displayWidth=1,this.displayHeight=1,this.displayDpi=96,this.maxNumerOfFingers=2,this.movementThreshInch=.075,this.interactionWasZoomGesture=!1}addListener(e){this.listeners.push(e)}get ZoomGestureActive(){return this.zoomGestureActive}get WasZoomGestureActive(){return this.interactionWasZoomGesture}displaySizeChanged(e,t){this.displayWidth=e,this.displayHeight=t;for(const s of this.listeners)s.displaySizeChanged(this.displayWidth,this.displayHeight)}Dispose(){this.dispose()}Initialize(){this.initialize()}get DisplayDpi(){return this.displayDpi}get TouchActive(){return this.touchActive}get TouchMoving(){return this.touchMoving}touchDown(e,t,s){this.interactionWasZoomGesture=!1;const n=e/this.displayWidth,r=t/this.displayHeight;this.lastRelPosX=n,this.lastRelPosY=r,this.lastPixelX=e,this.lastPixelY=t,this.touchActive=!0,this.touchMoving=!1,this.touchCount=Math.min(this.touchCount+1,this.maxNumerOfFingers);for(const o of this.listeners)o.mouseDown(n,r,!s)}move(e,t){if(this.touchActive&&!this.zoomGestureActive){const s=e/this.displayWidth,n=t/this.displayHeight,r=s-this.lastRelPosX,o=n-this.lastRelPosY;this.touchMoving=!0;for(const a of this.listeners)a.mouseMove(s,n,r,o)}}zoomGestureStarted(){this.zoomGestureActive=!0}zoomGestureCompleted(){this.zoomGestureActive=!1,this.interactionWasZoomGesture=!0}zoomGestureMove(e){this.zoomGestureActive&&this.listeners.forEach(function(t){t.zoom(e)})}touchUp(e,t){this.touchActive=!1,this.touchMoving=!1,this.touchCount=Math.max(0,this.touchCount-1);const s=e/this.displayWidth,n=t/this.displayHeight;for(const r of this.listeners)r.mouseUp(s,n)}click(e,t){if(!this.mouseDidMove(this.lastPixelX,e,this.lastPixelY,t)&&!this.ZoomGestureActive){const s=e/this.displayWidth,n=t/this.displayHeight;for(const r of this.listeners)r.positionTouched(s,n)}}doubleClick(e,t){if(!this.mouseDidMove(this.lastPixelX,e,this.lastPixelY,t)&&!this.ZoomGestureActive){const s=e/this.displayWidth,n=t/this.displayHeight;for(const r of this.listeners)r.positionDoubleTouched(s,n)}}mouseDidMove(e,t,s,n){const r=Math.abs(e-t)/this.displayDpi,o=Math.abs(s-n)/this.displayDpi;return r>this.movementThreshInch||o>this.movementThreshInch}}class Lu extends RC{constructor(e){super(),this.fullOffsetLeft=0,this.fullOffsetTop=0,this.fullScrollTop=0,this.fullScrollLeft=0,this.parentScrollMap=new Map,this.scrollCallbackMap=new Map,this.timeout=void 0,this.resizeObserver=void 0,this.EventCallbackMap=new cs,this.DOUBLE_CLICK_WINDOW=200,this.lastClick=0,this.osmdSheetMusicContainer=e,this.listenForInteractions()}get FullOffsetTop(){return this.fullOffsetTop}get FullScrollTop(){return this.fullScrollTop}get FullOffsetLeft(){return this.fullOffsetLeft}get FullScrollLeft(){return this.fullScrollLeft}static resizeCallback(e,t){clearTimeout(t.timeout),t.timeout=setTimeout(()=>{t.fullOffsetLeft=0,t.fullOffsetTop=0;let s=t.osmdSheetMusicContainer;for(;s;)t.fullOffsetLeft+=s.offsetLeft,t.fullOffsetTop+=s.offsetTop,s=s.offsetParent;t.resizeEventListener(),t.deregisterScrollOffsets(),t.registerScrollOffsets()},500)}registerScrollOffsets(){let e=this.osmdSheetMusicContainer;this.fullScrollTop=0,this.fullScrollLeft=0;const t=this;for(;e&&e!==document.documentElement;){if(this.parentScrollMap.set(e,[e.scrollTop,e.scrollLeft]),this.fullScrollLeft+=e.scrollLeft,this.fullScrollTop+=e.scrollTop,e.scrollHeight>e.clientHeight){const s=function(n){const r=t.parentScrollMap.get(this),o=r[0],a=r[1];t.fullScrollTop=t.fullScrollTop-o+this.scrollTop,t.fullScrollLeft=t.fullScrollLeft-a+this.scrollLeft,t.parentScrollMap.set(this,[this.scrollTop,this.scrollLeft])};this.scrollCallbackMap.set(e,s),e.addEventListener("scroll",s)}e=e.parentElement}}deregisterScrollOffsets(){for(const e of this.scrollCallbackMap.keys())e.removeEventListener("scroll",this.scrollCallbackMap.get(e));this.scrollCallbackMap.clear()}initialize(){this.fullOffsetLeft=0,this.fullOffsetTop=0;let e=this.osmdSheetMusicContainer;const t=[],s=this;for(window.ResizeObserver&&(this.resizeObserver=new ResizeObserver(n=>{Lu.resizeCallback(n,s)}));e;)this.fullOffsetLeft+=e.offsetLeft,this.fullOffsetTop+=e.offsetTop,this.resizeObserver?this.resizeObserver.observe(e):t.push(e),e=e.offsetParent;if(this.resizeObserver)this.disposeResizeListener=()=>{s.resizeObserver.disconnect(),s.resizeObserver=void 0};else{let n=()=>{Lu.resizeCallback(t,s)};window.addEventListener("resize",n),this.disposeResizeListener=()=>{window.removeEventListener("resize",n),n=void 0}}s.registerScrollOffsets()}dispose(){this.disposeResizeListener();for(const e of this.EventCallbackMap.keys()){const t=this.EventCallbackMap.getValue(e);t[0].removeEventListener(e,t[1])}this.EventCallbackMap.clear(),this.deregisterScrollOffsets(),this.scrollCallbackMap.clear(),this.parentScrollMap.clear()}isTouch(){if("ontouchstart"in window||window.DocumentTouch)return!0;if(!window.matchMedia)return!1;const t=["(",["-webkit-","-moz-","-o-","-ms-"].join("touch-enabled),("),"heartz",")"].join("");return window.matchMedia(t).matches}get downEventName(){return this.isTouch()?"touchstart":"mousedown"}get moveEventName(){return this.isTouch()?"touchmove":"mousemove"}listenForInteractions(){const e=this.downEventListener.bind(this),t=this.touchEndEventListener.bind(this),s=this.moveEventListener.bind(this);this.osmdSheetMusicContainer.addEventListener("mousedown",e),this.osmdSheetMusicContainer.addEventListener("touchend",t),document.addEventListener(this.moveEventName,s),this.EventCallbackMap.setValue("mousedown",[this.osmdSheetMusicContainer,e]),this.EventCallbackMap.setValue("touchend",[this.osmdSheetMusicContainer,t]),this.EventCallbackMap.setValue(this.moveEventName,[document,s])}downEventListener(e){const t=new Date().getTime(),s=t-this.lastClick;clearTimeout(this.clickTimeout);let n=0,r=0;this.isTouch()&&e instanceof TouchEvent?(n=e.touches[0].pageX,r=e.touches[0].pageY):e instanceof MouseEvent&&(n=e.pageX,r=e.pageY);const o=this.getOffsetCoordinates(n,r);if(s0)this.doubleClick(o.x,o.y);else{const a=this;this.clickTimeout=setTimeout(function(){clearTimeout(this.clickTimeout),a.isTouch()?a.touchDown(o.x,o.y,void 0):a.click(o.x,o.y)},this.DOUBLE_CLICK_WINDOW)}this.lastClick=t}moveEventListener(e){let t=0,s=0;if(this.isTouch()&&e instanceof TouchEvent){let r;e.touches&&e.touches.length>0?r=e.touches[0]:e.changedTouches&&e.changedTouches.length>0&&(r=e.changedTouches[0]),t=r==null?void 0:r.clientX,s=r==null?void 0:r.clientY}else e instanceof MouseEvent&&(t=e.clientX,s=e.clientY);const n=this.getOffsetCoordinates(t,s);this.move(n.x,n.y)}touchEndEventListener(e){let t;e.touches&&e.touches.length>0?t=e.touches[0]:e.changedTouches&&e.changedTouches.length>0&&(t=e.changedTouches[0]);const s=this.getOffsetCoordinates(t==null?void 0:t.pageX,t==null?void 0:t.pageY);this.touchUp(s.x,s.y)}resizeEventListener(){this.displaySizeChanged(this.osmdSheetMusicContainer.clientWidth,this.osmdSheetMusicContainer.clientHeight)}getOffsetCoordinates(e,t){const s=e-this.fullOffsetLeft+this.fullScrollLeft,n=t-this.fullOffsetTop+this.fullScrollTop;return new te(s,n)}}class Bu{static fillDynamicsList(e,t,s){for(let n=0;n=0&&s[l].push(new Un(a.InstantaneousDynamic,l))}if(a.StartingContinuousDynamic!==void 0){s[n].push(new Un(a.StartingContinuousDynamic,a.StaffNumber));const l=this.getOtherStaffIndexIfLinkedStavesAreDetected(e,n,a.StartingContinuousDynamic.Placement);l>=0&&s[l].push(new Un(a.StartingContinuousDynamic,l))}}}}static getOtherStaffIndexIfLinkedStavesAreDetected(e,t,s){const n=e.getStaffFromIndex(t),r=n.ParentInstrument.Staves.indexOf(n),o=n.ParentInstrument.Staves.length;return o>1&&r===0&&s===ue.Below?t+1:o>1&&r===1&&s===ue.Above?t-1:-1}static fillDynamicExpressions(e){const t=e.DynListStaves,s=e.getCompleteNumberOfStaves(),n=e.TimestampSortedDynamicExpressionsList;for(let r=0;r{e(this.processStringXml(s))},s=>{ge.error(new Error("[OSMD] Invalid MXL file: "+s)),t(new Error("[OSMD] Invalid MXL file: "+s))})}processStringXml(i){const e=new DOMParser;if(i.substr(0,3)==="")return ge.debug("[OSMD] UTF with BOM detected, truncate first three bytes and pass along: "+i),e.parseFromString(i.substr(3),"application/xml");if(i.substr(0,6).includes("{t.isMxl(c)?t.processMxl(c,a,l):a(t.processStringXml(c))},c=>{throw l(c),c});else{const c=new Error("[OSMD] osmd.load(string): Could not process string. Did not find {e.init(this.sheet.MusicPartManager,this.graphic)}),this.renderingManager.setMusicSheet(this.graphic),this.interactionManager.Initialize()}render(){var e;if(!this.graphic)throw new Error("OpenSheetMusicDisplay: Before rendering a music sheet, please load a MusicXML file");(e=this.drawer)==null||e.clear();let i=this.container.offsetWidth;this.rules.RenderSingleHorizontalStaffline&&(i=this.rules.SheetMaximumWidth),this.sheet.pageWidth=i/this.zoom/10,this.renderingManager.MainViewingRegion.WidthInUnits=this.sheet.pageWidth,this.rules.PageFormat&&!this.rules.PageFormat.IsUndefined?(this.rules.PageHeight=this.sheet.pageWidth/this.rules.PageFormat.aspectRatio,ge.debug("[OSMD] PageHeight: "+this.rules.PageHeight)):(ge.debug("[OSMD] endless/undefined pageformat, id: "+this.rules.PageFormat.idString),this.rules.PageHeight=100001),this.graphic.reCalculate(),this.drawingParameters.drawCursors&&(this.graphic.Cursors.length=0),this.createOrRefreshRenderBackend(),this.needBackendUpdate=!1,this.drawer.setZoom(this.zoom),this.drawer.drawSheet(this.graphic),this.enableOrDisableCursors(this.drawingParameters.drawCursors),this.drawingParameters.drawCursors&&this.cursors.forEach(t=>{t.update()}),this.zoomUpdated=!1,this.interactionManager.displaySizeChanged(this.container.clientWidth,this.container.clientHeight)}createOrRefreshRenderBackend(){this.drawer&&this.drawer.Backends&&(this.drawer.Backends[0]&&this.drawer.Backends[0].removeAllChildrenFromContainer(this.container),this.drawer.Backends.clear()),this.drawingParameters.Rules=this.rules,this.drawer=new CM(this.drawingParameters),this.drawer.drawableBoundingBoxElement=this.DrawBoundingBox,this.drawer.bottomLineVisible=this.drawBottomLine,this.drawer.skyLineVisible=this.drawSkyLine;let i=this.container.offsetWidth;this.rules.RenderSingleHorizontalStaffline&&(i=this.graphic.MusicPages[0].PositionAndShape.Size.width*10*this.zoom);let e;const t=32767;for(const s of this.graphic.MusicPages){if(s.PageNumber>this.rules.MaxPageToDrawNumber)break;const n=this.createBackend(this.backendType,s),r=" exceeds CanvasBackend limit of 32767. Cutting off score.";n.getOSMDBackendType()===no.Canvas&&i>t&&(ge.warn("[OSMD] Warning: width of "+i+r),i=t),this.rules.PageFormat&&!this.rules.PageFormat.IsUndefined?e=i/this.rules.PageFormat.aspectRatio:(e=s.PositionAndShape.Size.height,e+=this.rules.PageBottomMargin,e+=this.rules.CompactMode?this.rules.PageTopMarginNarrow:this.rules.PageTopMargin,this.rules.RenderTitle&&(e+=this.rules.TitleTopDistance),e*=this.zoom*10),n.getOSMDBackendType()===no.Canvas&&e>t&&(ge.warn("[OSMD] Warning: height of "+e+r),e=Math.min(e,t)),n.resize(i,e),n.clear(),this.drawer.Backends.push(n),this.graphic.drawer=this.drawer}}exportSVG(){var i;for(const e of(i=this.drawer)==null?void 0:i.Backends)e instanceof kd&&e.export()}IsReadyToRender(){return this.graphic!==void 0}clear(){var i;(i=this.drawer)==null||i.clear(),this.reset()}dispose(){this.disposeResizeListener&&this.disposeResizeListener(),this.InteractionManager&&this.InteractionManager.Dispose()}setOptions(i){if(this.rules||(this.rules=new Ir),this.drawingParameters||(this.drawingParameters=new I4,this.drawingParameters.Rules=this.rules),i==null){ge.warn(`warning: osmd.setOptions() called without an options parameter, has no effect. example usage: osmd.setOptions({drawCredits: false, drawPartNames: false})`);return}this.OnXMLRead=function(n){return n},i.onXMLRead&&(this.OnXMLRead=i.onXMLRead),i.drawingParameters&&(this.drawingParameters.DrawingParametersEnum=Ap[i.drawingParameters.toLowerCase()]);let t=!this.drawer||!this.drawer.Backends||this.drawer.Backends.length<1;if(i.backend!==void 0){const n=u2.BackendTypeFromString(i.backend);t=t||this.backendType!==n,this.backendType=n}this.needBackendUpdate=t,i.autoBeam!==void 0&&(this.rules.AutoBeamNotes=i.autoBeam);const s=i.autoBeamOptions;if(s&&(s.maintain_stem_directions===void 0&&(s.maintain_stem_directions=!1),this.rules.AutoBeamOptions=s,s.groups&&s.groups.length)){for(const n of s.groups)if(n.length!==2)throw new Error("Each fraction in autoBeamOptions.groups must be of length 2, e.g. [3,4] for beaming three fourths")}i.percussionOneLineCutoff!==void 0&&(this.rules.PercussionOneLineCutoff=i.percussionOneLineCutoff),this.rules.PercussionOneLineCutoff!==0&&i.percussionForceVoicesOneLineCutoff!==void 0&&(this.rules.PercussionForceVoicesOneLineCutoff=i.percussionForceVoicesOneLineCutoff),i.alignRests!==void 0&&(this.rules.AlignRests=i.alignRests),i.coloringMode!==void 0&&this.setColoringMode(i),i.coloringEnabled!==void 0&&(this.rules.ColoringEnabled=i.coloringEnabled),i.colorStemsLikeNoteheads!==void 0&&(this.rules.ColorStemsLikeNoteheads=i.colorStemsLikeNoteheads),i.disableCursor&&(this.drawingParameters.drawCursors=!1),i.drawHiddenNotes&&(this.drawingParameters.drawHiddenNotes=!0),i.drawCredits!==void 0&&(this.drawingParameters.DrawCredits=i.drawCredits),i.drawComposer!==void 0&&(this.drawingParameters.DrawComposer=i.drawComposer),i.drawTitle!==void 0&&(this.drawingParameters.DrawTitle=i.drawTitle),i.drawSubtitle!==void 0&&(this.drawingParameters.DrawSubtitle=i.drawSubtitle),i.drawLyricist!==void 0&&(this.drawingParameters.DrawLyricist=i.drawLyricist),i.drawMetronomeMarks!==void 0&&(this.rules.MetronomeMarksDrawn=i.drawMetronomeMarks),i.drawPartNames!==void 0&&(this.drawingParameters.DrawPartNames=i.drawPartNames,i.drawPartAbbreviations||(this.rules.RenderPartAbbreviations=i.drawPartNames)),i.drawPartAbbreviations!==void 0&&(this.rules.RenderPartAbbreviations=i.drawPartAbbreviations),i.drawFingerings===!1&&(this.rules.RenderFingerings=!1),i.drawMeasureNumbers!==void 0&&(this.rules.RenderMeasureNumbers=i.drawMeasureNumbers),i.drawMeasureNumbersOnlyAtSystemStart&&(this.rules.RenderMeasureNumbersOnlyAtSystemStart=i.drawMeasureNumbersOnlyAtSystemStart),i.drawLyrics!==void 0&&(this.rules.RenderLyrics=i.drawLyrics),i.drawTimeSignatures!==void 0&&(this.rules.RenderTimeSignatures=i.drawTimeSignatures),i.drawSlurs!==void 0&&(this.rules.RenderSlurs=i.drawSlurs),i.measureNumberInterval!==void 0&&(this.rules.MeasureNumberLabelOffset=i.measureNumberInterval),i.useXMLMeasureNumbers!==void 0&&(this.rules.UseXMLMeasureNumbers=i.useXMLMeasureNumbers),i.fingeringPosition!==void 0&&(this.rules.FingeringPosition=er.PlacementEnumFromString(i.fingeringPosition)),i.fingeringInsideStafflines!==void 0&&(this.rules.FingeringInsideStafflines=i.fingeringInsideStafflines),i.newSystemFromXML!==void 0&&(this.rules.NewSystemAtXMLNewSystemAttribute=i.newSystemFromXML),i.newPageFromXML!==void 0&&(this.rules.NewPageAtXMLNewPageAttribute=i.newPageFromXML),i.fillEmptyMeasuresWithWholeRest!==void 0&&(this.rules.FillEmptyMeasuresWithWholeRest=i.fillEmptyMeasuresWithWholeRest),i.followCursor!==void 0&&(this.FollowCursor=i.followCursor),i.setWantedStemDirectionByXml!==void 0&&(this.rules.SetWantedStemDirectionByXml=i.setWantedStemDirectionByXml),i.darkMode?(this.rules.applyDefaultColorMusic("#FFFFFF"),this.rules.PageBackgroundColor="#000000"):i.darkMode===!1&&(this.rules.applyDefaultColorMusic("#000000"),this.rules.PageBackgroundColor=void 0),i.defaultColorMusic&&this.rules.applyDefaultColorMusic(i.defaultColorMusic),i.defaultColorNotehead&&(this.rules.DefaultColorNotehead=i.defaultColorNotehead),i.defaultColorRest&&(this.rules.DefaultColorRest=i.defaultColorRest),i.defaultColorStem&&(this.rules.DefaultColorStem=i.defaultColorStem),i.defaultColorLabel&&(this.rules.DefaultColorLabel=i.defaultColorLabel),i.defaultColorTitle&&(this.rules.DefaultColorTitle=i.defaultColorTitle),i.defaultFontFamily&&(this.rules.DefaultFontFamily=i.defaultFontFamily),i.defaultFontStyle&&(this.rules.DefaultFontStyle=i.defaultFontStyle),i.drawUpToMeasureNumber&&(this.rules.MaxMeasureToDrawIndex=i.drawUpToMeasureNumber-1),i.drawFromMeasureNumber&&(this.rules.MinMeasureToDrawIndex=i.drawFromMeasureNumber-1),i.drawUpToPageNumber&&(this.rules.MaxPageToDrawNumber=i.drawUpToPageNumber),i.drawUpToSystemNumber&&(this.rules.MaxSystemToDrawNumber=i.drawUpToSystemNumber),i.tupletsRatioed&&(this.rules.TupletsRatioed=!0),i.tupletsBracketed&&(this.rules.TupletsBracketed=!0),i.tripletsBracketed&&(this.rules.TripletsBracketed=!0),i.autoResize?(this.resizeHandlerAttached||this.autoResize(),this.autoResizeEnabled=!0):i.autoResize===!1&&(this.autoResizeEnabled=!1),i.pageFormat!==void 0&&this.setPageFormat(i.pageFormat),i.pageBackgroundColor!==void 0&&(this.rules.PageBackgroundColor=i.pageBackgroundColor),i.performanceMode!==void 0&&(this.rules.PerformanceMode=i.performanceMode),i.renderSingleHorizontalStaffline!==void 0&&(this.rules.RenderSingleHorizontalStaffline=i.renderSingleHorizontalStaffline),i.spacingFactorSoftmax!==void 0&&(this.rules.SoftmaxFactorVexFlow=i.spacingFactorSoftmax),i.spacingBetweenTextLines!==void 0&&(this.rules.SpacingBetweenTextLines=i.spacingBetweenTextLines),i.stretchLastSystemLine!==void 0&&(this.rules.StretchLastSystemLine=i.stretchLastSystemLine),i.autoGenerateMutipleRestMeasuresFromRestMeasures!==void 0&&(this.rules.AutoGenerateMutipleRestMeasuresFromRestMeasures=i.autoGenerateMutipleRestMeasuresFromRestMeasures),i.cursorsOptions!==void 0?this.cursorsOptions=i.cursorsOptions:this.cursorsOptions=[{type:0,color:this.EngravingRules.DefaultColorCursor,alpha:.5,follow:!0}]}setColoringMode(i){if(i.coloringMode===Yn.XML){this.rules.ColoringMode=Yn.XML;return}const e=[Le.C,Le.D,Le.E,Le.F,Le.G,Le.A,Le.B,-1];let t;if(i.coloringMode===Yn.CustomColorSet){if(!i.coloringSetCustom||i.coloringSetCustom.length!==8)throw new Error("Invalid amount of colors: With coloringModes.customColorSet, you have to provide a coloringSetCustom parameter with 8 strings (C to B, rest note).");for(const n of i.coloringSetCustom)if(!/^\#[0-9a-fA-F]{6}$/.test(n))throw new Error(`One of the color strings in options.coloringSetCustom was not a valid HTML Hex color: `+n);t=i.coloringSetCustom}else if(i.coloringMode===Yn.AutoColoring){t=[];const n=Object.keys(Pd);for(let r=0;r{i.hide()}),this.sheet=void 0,this.graphic=void 0,this.zoom=1}autoResize(){const i=this;this.handleResize(()=>{},()=>{var e;((e=this.graphic)==null?void 0:e.GetCalculator)instanceof Pf&&(this.graphic.GetCalculator.beamsNeedUpdate=!0),i.IsReadyToRender()&&i.render()})}handleResize(i,e){let t,s;const r=this;function o(){r.AutoResizeEnabled&&(t=new Date().getTime(),s||(i(),t=new Date().getTime(),s=window.setTimeout(a,200)))}function a(){s=void 0,window.clearTimeout(s),new Date().getTime()-t<200?s=window.setTimeout(a,200):e()}window.attachEvent?window.attachEvent("onresize",o):window.addEventListener("resize",o),this.disposeResizeListener=()=>{window.detachEvent?window.detachEvent("onresize",o):window.removeEventListener("resize",o),this.resizeHandlerAttached=!1},this.resizeHandlerAttached=!0,window.setTimeout(i,0),window.setTimeout(e,1)}enableOrDisableCursors(i){var e,t,s,n,r,o;if(this.drawingParameters.drawCursors=i,i){for(let a=0;a{a.hide()})}createBackend(i,e){let t;return i===void 0||i===no.SVG?t=new kd(this.rules):t=new F4(this.rules),t.graphicalMusicPage=e,t.initialize(this.container,this.zoom),t.getContext().setFillStyle(this.rules.DefaultColorMusic),t.getContext().setStrokeStyle(this.rules.DefaultColorMusic),t}static StringToPageFormat(i){let e=Ai.UndefinedPageFormat;if(i.match("^[0-9]+x[0-9]+$")){const t=i.split("x"),s=Number.parseInt(t[0],10),n=Number.parseInt(t[1],10);s>0&&s<32768&&n>0&&n<32768&&(e=new Ai(s,n,`customPageFormat${i}`))}return i=i.replace(" ","_"),i=i.replace("Landscape","L"),i=i.replace("Portrait","P"),qc.PageFormatStandards.hasOwnProperty(i)&&(e=qc.PageFormatStandards[i]),e}setPageFormat(i){const e=qc.StringToPageFormat(i);this.needBackendUpdate=!e.Equals(this.rules.PageFormat),this.rules.PageFormat=e}setCustomPageFormat(i,e){if(i>0&&e>0){const t=new Ai(i,e);this.rules.PageFormat=t}}set DrawSkyLine(i){this.drawSkyLine=i,this.drawer&&(this.drawer.skyLineVisible=i)}get DrawSkyLine(){return this.drawer.skyLineVisible}set DrawBottomLine(i){this.drawBottomLine=i,this.drawer&&(this.drawer.bottomLineVisible=i)}get DrawBottomLine(){return this.drawer.bottomLineVisible}set DrawBoundingBox(i){this.setDrawBoundingBox(i,!0)}get DrawBoundingBox(){return this.drawBoundingBox}setDrawBoundingBox(i,e=!1){this.drawBoundingBox=i,this.drawer&&(this.drawer.drawableBoundingBoxElement=i),e&&this.render()}get AutoResizeEnabled(){return this.autoResizeEnabled}set AutoResizeEnabled(i){this.autoResizeEnabled=i}get Zoom(){return this.zoom}set Zoom(i){var e;this.zoom=i,this.zoomUpdated=!0,((e=this.graphic)==null?void 0:e.GetCalculator)instanceof Pf&&(this.graphic.GetCalculator.beamsNeedUpdate=this.zoomUpdated)}set FollowCursor(i){this.followCursor=i}get FollowCursor(){return this.followCursor}set TransposeCalculator(i){Ue.transposeCalculator=i}get TransposeCalculator(){return Ue.transposeCalculator}get Sheet(){return this.sheet}get Drawer(){return this.drawer}get GraphicSheet(){return this.graphic}get DrawingParameters(){return this.drawingParameters}get EngravingRules(){return this.rules}get InteractionManager(){return this.interactionManager}get Version(){return this.version}};let z4=qc;z4.PageFormatStandards={A3_L:new Ai(420,297,"A3_L"),A3_P:new Ai(297,420,"A3_P"),A4_L:new Ai(297,210,"A4_L"),A4_P:new Ai(210,297,"A4_P"),A5_L:new Ai(210,148,"A5_L"),A5_P:new Ai(148,210,"A5_P"),A6_L:new Ai(148,105,"A6_L"),A6_P:new Ai(105,148,"A6_P"),Endless:Ai.UndefinedPageFormat,Letter_L:new Ai(279.4,215.9,"Letter_L"),Letter_P:new Ai(215.9,279.4,"Letter_P")};var Fd={},NC={get exports(){return Fd},set exports(i){Fd=i}},Iu={},kC={get exports(){return Iu},set exports(i){Iu=i}},Ls={},It={};It.__esModule=!0;It.extend=W4;It.indexOf=GC;It.escapeExpression=HC;It.isEmpty=UC;It.createFrame=zC;It.blockParams=WC;It.appendContextPath=YC;var DC={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},OC=/[&<>"'`=]/g,FC=/[&<>"'`=]/;function VC(i){return DC[i]}function W4(i){for(var e=1;e0?(r.ids&&(r.ids=[r.name]),s.helpers.each(n,r)):o(this);if(r.data&&r.ids){var l=t.createFrame(r.data);l.contextPath=t.appendContextPath(r.data.contextPath,r.name),r={data:l}}return a(n,r)})},i.exports=e.default})(XC,Ru);var Nu={},jC={get exports(){return Nu},set exports(i){Nu=i}};(function(i,e){e.__esModule=!0;function t(o){return o&&o.__esModule?o:{default:o}}var s=It,n=ss,r=t(n);e.default=function(o){o.registerHelper("each",function(a,l){if(!l)throw new r.default("Must pass iterator to #each");var u=l.fn,h=l.inverse,c=0,f="",d=void 0,p=void 0;l.data&&l.ids&&(p=s.appendContextPath(l.data.contextPath,l.ids[0])+"."),s.isFunction(a)&&(a=a.call(this)),l.data&&(d=s.createFrame(l.data));function g(S,A,P){d&&(d.key=S,d.index=A,d.first=A===0,d.last=!!P,p&&(d.contextPath=p+S)),f=f+u(a[S],{data:d,blockParams:s.blockParams([a[S],S],[p+S,null])})}if(a&&typeof a=="object")if(s.isArray(a))for(var m=a.length;c=0?r=o:r=parseInt(r,10)}return r},log:function(r){if(r=s.lookupLevel(r),typeof console<"u"&&s.lookupLevel(s.level)<=r){var o=s.methodMap[r];console[o]||(o="log");for(var a=arguments.length,l=Array(a>1?a-1:0),u=1;u= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};Ls.REVISION_CHANGES=VT;var Mf="[object Object]";function Gd(i,e,t){this.helpers=i||{},this.partials=e||{},this.decorators=t||{},IT.registerDefaultHelpers(this),RT.registerDefaultDecorators(this)}Gd.prototype={constructor:Gd,logger:Uu.default,log:Uu.default.log,registerHelper:function(e,t){if(Kr.toString.call(e)===Mf){if(t)throw new _f.default("Arg not supported with multiple helpers");Kr.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if(Kr.toString.call(e)===Mf)Kr.extend(this.partials,e);else{if(typeof t>"u")throw new _f.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=t}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,t){if(Kr.toString.call(e)===Mf){if(t)throw new _f.default("Arg not supported with multiple decorators");Kr.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function(){kT.resetLoggedProperties()}};var GT=Uu.default.log;Ls.log=GT;Ls.createFrame=Kr.createFrame;Ls.logger=Uu.default;var zu={},HT={get exports(){return zu},set exports(i){zu=i}};(function(i,e){e.__esModule=!0;function t(s){this.string=s}t.prototype.toString=t.prototype.toHTML=function(){return""+this.string},e.default=t,i.exports=e.default})(HT,zu);var Or={},Tp={};Tp.__esModule=!0;Tp.wrapHelper=UT;function UT(i,e){if(typeof i!="function")return i;var t=function(){var n=arguments[arguments.length-1];return arguments[arguments.length-1]=e(n),i.apply(this,arguments)};return t}Or.__esModule=!0;Or.checkRevision=jT;Or.template=KT;Or.wrapProgram=Zc;Or.resolvePartial=JT;Or.invokePartial=qT;Or.noop=X4;function zT(i){return i&&i.__esModule?i:{default:i}}function WT(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t]);return e.default=i,e}var YT=It,Vn=WT(YT),QT=ss,Gn=zT(QT),Hn=Ls,w2=Xl,XT=Tp,E2=Ea;function jT(i){var e=i&&i[0]||1,t=Hn.COMPILER_REVISION;if(!(e>=Hn.LAST_COMPATIBLE_COMPILER_REVISION&&e<=Hn.COMPILER_REVISION))if(e"u"&&(this.lexer.yylloc={});var m=this.lexer.yylloc;c.push(m);var b=this.lexer.options&&this.lexer.options.ranges;typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);function y(){var L;return L=l.lexer.lex()||1,typeof L!="number"&&(L=l.symbols_[L]||L),L}for(var v,S,A,P,x={},M,_,T,D;;){if(S=u[u.length-1],this.defaultActions[S]?A=this.defaultActions[S]:((v===null||typeof v>"u")&&(v=y()),A=f[S]&&f[S][v]),typeof A>"u"||!A.length||!A[0]){var C="";{D=[];for(M in f[S])this.terminals_[M]&&M>2&&D.push("'"+this.terminals_[M]+"'");this.lexer.showPosition?C="Parse error on line "+(p+1)+`: `+this.lexer.showPosition()+` Expecting `+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":C="Parse error on line "+(p+1)+": Unexpected "+(v==1?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(C,{text:this.lexer.match,token:this.terminals_[v]||v,line:this.lexer.yylineno,loc:m,expected:D})}}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+S+", token: "+v);switch(A[0]){case 1:u.push(v),h.push(this.lexer.yytext),c.push(this.lexer.yylloc),u.push(A[1]),v=null,g=this.lexer.yyleng,d=this.lexer.yytext,p=this.lexer.yylineno,m=this.lexer.yylloc;break;case 2:if(_=this.productions_[A[1]][1],x.$=h[h.length-_],x._$={first_line:c[c.length-(_||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(_||1)].first_column,last_column:c[c.length-1].last_column},b&&(x._$.range=[c[c.length-(_||1)].range[0],c[c.length-1].range[1]]),P=this.performAction.call(x,d,g,p,this.yy,A[1],h,c),typeof P<"u")return P;_&&(u=u.slice(0,-1*_*2),h=h.slice(0,-1*_),c=c.slice(0,-1*_)),u.push(this.productions_[A[1]][0]),h.push(x.$),c.push(x._$),T=f[u[u.length-2]][u[u.length-1]],u.push(T);break;case 3:return!0}}return!0}},n=function(){var o={EOF:1,parseError:function(l,u){if(this.yy.parser)this.yy.parser.parseError(l,u);else throw new Error(l)},setInput:function(l){return this._input=l,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var u=l.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},unput:function(l){var u=l.length,h=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u-1),this.offset-=u;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===c.length?this.yylloc.first_column:0)+c[c.length-h.length].length-h[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-u]),this},more:function(){return this._more=!0,this},less:function(l){this.unput(this.match.slice(l))},pastInput:function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var l=this.pastInput(),u=new Array(l.length+1).join("-");return l+this.upcomingInput()+` `+u+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,u,h,c,f;this._more||(this.yytext="",this.match="");for(var d=this._currentRules(),p=0;pu[0].length)&&(u=h,c=p,!this.options.flex)));p++);return u?(f=u[0].match(/(?:\r\n?|\n).*/g),f&&(this.yylineno+=f.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:f?f[f.length-1].length-f[f.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+u[0].length},this.yytext+=u[0],this.match+=u[0],this.matches=u,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(u[0].length),this.matched+=u[0],l=this.performAction.call(this,this.yy,this,d[c],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l||void 0):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var l=this.next();return typeof l<"u"?l:this.lex()},begin:function(l){this.conditionStack.push(l)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(l){this.begin(l)}};return o.options={},o.performAction=function(l,u,h,c){function f(d,p){return u.yytext=u.yytext.substring(d,u.yyleng-p+d)}switch(h){case 0:if(u.yytext.slice(-2)==="\\\\"?(f(0,1),this.begin("mu")):u.yytext.slice(-1)==="\\"?(f(0,1),this.begin("emu")):this.begin("mu"),u.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(f(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(u.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return u.yytext=f(1,2).replace(/\\"/g,'"'),80;case 32:return u.yytext=f(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return u.yytext=u.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},o.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],o.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},o}();s.lexer=n;function r(){this.yy={}}return r.prototype=s,s.Parser=r,new r}();e.default=t,i.exports=e.default})(sL,Wu);var Yu={},nL={get exports(){return Yu},set exports(i){Yu=i}},kl={},rL={get exports(){return kl},set exports(i){kl=i}};(function(i,e){e.__esModule=!0;function t(u){return u&&u.__esModule?u:{default:u}}var s=ss,n=t(s);function r(){this.parents=[]}r.prototype={constructor:r,mutating:!1,acceptKey:function(h,c){var f=this.accept(h[c]);if(this.mutating){if(f&&!r.prototype[f.type])throw new n.default('Unexpected node type "'+f.type+'" found when accepting '+c+" on "+h.type);h[c]=f}},acceptRequired:function(h,c){if(this.acceptKey(h,c),!h[c])throw new n.default(h.type+" requires "+c)},acceptArray:function(h){for(var c=0,f=h.length;c0)throw new Lp.default("Invalid path: "+s,{loc:t});l===".."&&r++}else n.push(l)}return{type:"PathExpression",data:i,depth:r,parts:n,original:s,loc:t}}function dL(i,e,t,s,n,r){var o=s.charAt(3)||s.charAt(2),a=o!=="{"&&o!=="&",l=/\*/.test(s);return{type:l?"Decorator":"MustacheStatement",path:i,params:e,hash:t,escaped:a,strip:n,loc:this.locInfo(r)}}function pL(i,e,t,s){Bp(i,t),s=this.locInfo(s);var n={type:"Program",body:e,strip:{},loc:s};return{type:"BlockStatement",path:i.path,params:i.params,hash:i.hash,program:n,openStrip:{},inverseStrip:{},closeStrip:{},loc:s}}function gL(i,e,t,s,n,r){s&&s.path&&Bp(i,s);var o=/\*/.test(i.open);e.blockParams=i.blockParams;var a=void 0,l=void 0;if(t){if(o)throw new Lp.default("Unexpected inverse block on decorator",t);t.chain&&(t.program.body[0].closeStrip=s.strip),l=t.strip,a=t.program}return n&&(n=a,a=e,e=n),{type:o?"DecoratorBlock":"BlockStatement",path:i.path,params:i.params,hash:i.hash,program:e,inverse:a,openStrip:i.strip,inverseStrip:l,closeStrip:s&&s.strip,loc:this.locInfo(r)}}function mL(i,e){if(!e&&i.length){var t=i[0].loc,s=i[i.length-1].loc;t&&s&&(e={source:t.source,start:{line:t.start.line,column:t.start.column},end:{line:s.end.line,column:s.end.column}})}return{type:"Program",body:i,strip:{},loc:e}}function bL(i,e,t,s){return Bp(i,t),{type:"PartialBlockStatement",name:i.path,params:i.params,hash:i.hash,program:e,openStrip:i.strip,closeStrip:t&&t.strip,loc:this.locInfo(s)}}jl.__esModule=!0;jl.parseWithoutProcessing=J4;jl.parse=PL;function yL(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t]);return e.default=i,e}function K4(i){return i&&i.__esModule?i:{default:i}}var vL=Wu,Hd=K4(vL),SL=Yu,AL=K4(SL),xL=Bs,wL=yL(xL),EL=It;jl.parser=Hd.default;var $c={};EL.extend($c,wL);function J4(i,e){if(i.type==="Program")return i;Hd.default.yy=$c,$c.locInfo=function(s){return new $c.SourceLocation(e&&e.srcName,s)};var t=Hd.default.parse(i);return t}function PL(i,e){var t=J4(i,e),s=new AL.default(e);return s.accept(t)}var Kl={};Kl.__esModule=!0;Kl.Compiler=Ud;Kl.precompile=TL;Kl.compile=LL;function q4(i){return i&&i.__esModule?i:{default:i}}var _L=ss,fl=q4(_L),Dl=It,ML=Nl,Ha=q4(ML),CL=[].slice;function Ud(){}Ud.prototype={compiler:Ud,equals:function(e){var t=this.opcodes.length;if(e.opcodes.length!==t)return!1;for(var s=0;s1)throw new fl.default("Unsupported number of partial arguments: "+s.length,e);s.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):s.push({type:"PathExpression",parts:[],depth:0}));var n=e.name.original,r=e.name.type==="SubExpression";r&&this.accept(e.name),this.setupFullMustacheParams(e,t,void 0,!0);var o=e.indent||"";this.options.preventIndent&&o&&(this.opcode("appendContent",o),o=""),this.opcode("invokePartial",r,n,o),this.opcode("append")},PartialBlockStatement:function(e){this.PartialStatement(e)},MustacheStatement:function(e){this.SubExpression(e),e.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(e){this.DecoratorBlock(e)},ContentStatement:function(e){e.value&&this.opcode("appendContent",e.value)},CommentStatement:function(){},SubExpression:function(e){P2(e);var t=this.classifySexpr(e);t==="simple"?this.simpleSexpr(e):t==="helper"?this.helperSexpr(e):this.ambiguousSexpr(e)},ambiguousSexpr:function(e,t,s){var n=e.path,r=n.parts[0],o=t!=null||s!=null;this.opcode("getContext",n.depth),this.opcode("pushProgram",t),this.opcode("pushProgram",s),n.strict=!0,this.accept(n),this.opcode("invokeAmbiguous",r,o)},simpleSexpr:function(e){var t=e.path;t.strict=!0,this.accept(t),this.opcode("resolvePossibleLambda")},helperSexpr:function(e,t,s){var n=this.setupFullMustacheParams(e,t,s),r=e.path,o=r.parts[0];if(this.options.knownHelpers[o])this.opcode("invokeKnownHelper",n.length,o);else{if(this.options.knownHelpersOnly)throw new fl.default("You specified knownHelpersOnly, but used the unknown helper "+o,e);r.strict=!0,r.falsy=!0,this.accept(r),this.opcode("invokeHelper",n.length,r.original,Ha.default.helpers.simpleId(r))}},PathExpression:function(e){this.addDepth(e.depth),this.opcode("getContext",e.depth);var t=e.parts[0],s=Ha.default.helpers.scopedId(e),n=!e.depth&&!s&&this.blockParamIndex(t);n?this.opcode("lookupBlockParam",n,e.parts):t?e.data?(this.options.data=!0,this.opcode("lookupData",e.depth,e.parts,e.strict)):this.opcode("lookupOnContext",e.parts,e.falsy,e.strict,s):this.opcode("pushContext")},StringLiteral:function(e){this.opcode("pushString",e.value)},NumberLiteral:function(e){this.opcode("pushLiteral",e.value)},BooleanLiteral:function(e){this.opcode("pushLiteral",e.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(e){var t=e.pairs,s=0,n=t.length;for(this.opcode("pushHash");s=0)return[t,r]}}};function TL(i,e,t){if(i==null||typeof i!="string"&&i.type!=="Program")throw new fl.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+i);e=e||{},"data"in e||(e.data=!0),e.compat&&(e.useDepths=!0);var s=t.parse(i,e),n=new t.Compiler().compile(s,e);return new t.JavaScriptCompiler().compile(n,e)}function LL(i,e,t){if(e===void 0&&(e={}),i==null||typeof i!="string"&&i.type!=="Program")throw new fl.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+i);e=Dl.extend({},e),"data"in e||(e.data=!0),e.compat&&(e.useDepths=!0);var s=void 0;function n(){var o=t.parse(i,e),a=new t.Compiler().compile(o,e),l=new t.JavaScriptCompiler().compile(a,e,void 0,!0);return t.template(l)}function r(o,a){return s||(s=n()),s.call(this,o,a)}return r._setup=function(o){return s||(s=n()),s._setup(o)},r._child=function(o,a,l,u){return s||(s=n()),s._child(o,a,l,u)},r}function Z4(i,e){if(i===e)return!0;if(Dl.isArray(i)&&Dl.isArray(e)&&i.length===e.length){for(var t=0;t>1;return l?-u:u}return Rc.encode=function(l){var u="",h,c=r(l);do h=c&s,c>>>=e,c>0&&(h|=n),u+=i.encode(h);while(c>0);return u},Rc.decode=function(l,u,h){var c=l.length,f=0,d=0,p,g;do{if(u>=c)throw new Error("Expected more digits in base 64 VLQ value.");if(g=i.decode(l.charCodeAt(u++)),g===-1)throw new Error("Invalid base64 digit: "+l.charAt(u-1));p=!!(g&n),g&=s,f=f+(g<=0;D--)_=M[D],_==="."?M.splice(D,1):_===".."?T++:T>0&&(_===""?(M.splice(D+1,T),T=0):(M.splice(D,2),T--));return A=M.join("/"),A===""&&(A=x?"/":"."),P?(P.path=A,r(P)):A}i.normalize=o;function a(S,A){S===""&&(S="."),A===""&&(A=".");var P=n(A),x=n(S);if(x&&(S=x.path||"/"),P&&!P.scheme)return x&&(P.scheme=x.scheme),r(P);if(P||A.match(s))return A;if(x&&!x.host&&!x.path)return x.host=A,r(x);var M=A.charAt(0)==="/"?A:o(S.replace(/\/+$/,"")+"/"+A);return x?(x.path=M,r(x)):M}i.join=a,i.isAbsolute=function(S){return S.charAt(0)==="/"||t.test(S)};function l(S,A){S===""&&(S="."),S=S.replace(/\/$/,"");for(var P=0;A.indexOf(S+"/")!==0;){var x=S.lastIndexOf("/");if(x<0||(S=S.slice(0,x),S.match(/^([^\/]+:\/)?\/*$/)))return A;++P}return Array(P+1).join("../")+A.substr(S.length+1)}i.relative=l;var u=function(){var S=Object.create(null);return!("__proto__"in S)}();function h(S){return S}function c(S){return d(S)?"$"+S:S}i.toSetString=u?h:c;function f(S){return d(S)?S.slice(1):S}i.fromSetString=u?h:f;function d(S){if(!S)return!1;var A=S.length;if(A<9||S.charCodeAt(A-1)!==95||S.charCodeAt(A-2)!==95||S.charCodeAt(A-3)!==111||S.charCodeAt(A-4)!==116||S.charCodeAt(A-5)!==111||S.charCodeAt(A-6)!==114||S.charCodeAt(A-7)!==112||S.charCodeAt(A-8)!==95||S.charCodeAt(A-9)!==95)return!1;for(var P=A-10;P>=0;P--)if(S.charCodeAt(P)!==36)return!1;return!0}function p(S,A,P){var x=m(S.source,A.source);return x!==0||(x=S.originalLine-A.originalLine,x!==0)||(x=S.originalColumn-A.originalColumn,x!==0||P)||(x=S.generatedColumn-A.generatedColumn,x!==0)||(x=S.generatedLine-A.generatedLine,x!==0)?x:m(S.name,A.name)}i.compareByOriginalPositions=p;function g(S,A,P){var x=S.generatedLine-A.generatedLine;return x!==0||(x=S.generatedColumn-A.generatedColumn,x!==0||P)||(x=m(S.source,A.source),x!==0)||(x=S.originalLine-A.originalLine,x!==0)||(x=S.originalColumn-A.originalColumn,x!==0)?x:m(S.name,A.name)}i.compareByGeneratedPositionsDeflated=g;function m(S,A){return S===A?0:S===null?1:A===null?-1:S>A?1:-1}function b(S,A){var P=S.generatedLine-A.generatedLine;return P!==0||(P=S.generatedColumn-A.generatedColumn,P!==0)||(P=m(S.source,A.source),P!==0)||(P=S.originalLine-A.originalLine,P!==0)||(P=S.originalColumn-A.originalColumn,P!==0)?P:m(S.name,A.name)}i.compareByGeneratedPositionsInflated=b;function y(S){return JSON.parse(S.replace(/^\)]}'[^\n]*\n/,""))}i.parseSourceMapInput=y;function v(S,A,P){if(A=A||"",S&&(S[S.length-1]!=="/"&&A[0]!=="/"&&(S+="/"),A=S+A),P){var x=n(P);if(!x)throw new Error("sourceMapURL could not be parsed");if(x.path){var M=x.path.lastIndexOf("/");M>=0&&(x.path=x.path.substring(0,M+1))}A=a(r(x),A)}return o(A)}i.computeSourceURL=v}(Tf)),Tf}var Lf={},T2;function ey(){if(T2)return Lf;T2=1;var i=Jl(),e=Object.prototype.hasOwnProperty,t=typeof Map<"u";function s(){this._array=[],this._set=t?new Map:Object.create(null)}return s.fromArray=function(r,o){for(var a=new s,l=0,u=r.length;l=0)return o}else{var a=i.toSetString(r);if(e.call(this._set,a))return this._set[a]}throw new Error('"'+r+'" is not in the set.')},s.prototype.at=function(r){if(r>=0&&rr||o==r&&l>=a||i.compareByGeneratedPositionsInflated(s,n)<=0}function t(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}return t.prototype.unsortedForEach=function(n,r){this._array.forEach(n,r)},t.prototype.add=function(n){e(this._last,n)?(this._last=n,this._array.push(n)):(this._sorted=!1,this._array.push(n))},t.prototype.toArray=function(){return this._sorted||(this._array.sort(i.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},Bf.MappingList=t,Bf}var B2;function ty(){if(B2)return Cf;B2=1;var i=$4(),e=Jl(),t=ey().ArraySet,s=NL().MappingList;function n(r){r||(r={}),this._file=e.getArg(r,"file",null),this._sourceRoot=e.getArg(r,"sourceRoot",null),this._skipValidation=e.getArg(r,"skipValidation",!1),this._sources=new t,this._names=new t,this._mappings=new s,this._sourcesContents=null}return n.prototype._version=3,n.fromSourceMap=function(o){var a=o.sourceRoot,l=new n({file:o.file,sourceRoot:a});return o.eachMapping(function(u){var h={generated:{line:u.generatedLine,column:u.generatedColumn}};u.source!=null&&(h.source=u.source,a!=null&&(h.source=e.relative(a,h.source)),h.original={line:u.originalLine,column:u.originalColumn},u.name!=null&&(h.name=u.name)),l.addMapping(h)}),o.sources.forEach(function(u){var h=u;a!==null&&(h=e.relative(a,u)),l._sources.has(h)||l._sources.add(h);var c=o.sourceContentFor(u);c!=null&&l.setSourceContent(u,c)}),l},n.prototype.addMapping=function(o){var a=e.getArg(o,"generated"),l=e.getArg(o,"original",null),u=e.getArg(o,"source",null),h=e.getArg(o,"name",null);this._skipValidation||this._validateMapping(a,l,u,h),u!=null&&(u=String(u),this._sources.has(u)||this._sources.add(u)),h!=null&&(h=String(h),this._names.has(h)||this._names.add(h)),this._mappings.add({generatedLine:a.line,generatedColumn:a.column,originalLine:l!=null&&l.line,originalColumn:l!=null&&l.column,source:u,name:h})},n.prototype.setSourceContent=function(o,a){var l=o;this._sourceRoot!=null&&(l=e.relative(this._sourceRoot,l)),a!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[e.toSetString(l)]=a):this._sourcesContents&&(delete this._sourcesContents[e.toSetString(l)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},n.prototype.applySourceMap=function(o,a,l){var u=a;if(a==null){if(o.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);u=o.file}var h=this._sourceRoot;h!=null&&(u=e.relative(h,u));var c=new t,f=new t;this._mappings.unsortedForEach(function(d){if(d.source===u&&d.originalLine!=null){var p=o.originalPositionFor({line:d.originalLine,column:d.originalColumn});p.source!=null&&(d.source=p.source,l!=null&&(d.source=e.join(l,d.source)),h!=null&&(d.source=e.relative(h,d.source)),d.originalLine=p.line,d.originalColumn=p.column,p.name!=null&&(d.name=p.name))}var g=d.source;g!=null&&!c.has(g)&&c.add(g);var m=d.name;m!=null&&!f.has(m)&&f.add(m)},this),this._sources=c,this._names=f,o.sources.forEach(function(d){var p=o.sourceContentFor(d);p!=null&&(l!=null&&(d=e.join(l,d)),h!=null&&(d=e.relative(h,d)),this.setSourceContent(d,p))},this)},n.prototype._validateMapping=function(o,a,l,u){if(a&&typeof a.line!="number"&&typeof a.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(o&&"line"in o&&"column"in o&&o.line>0&&o.column>=0&&!a&&!l&&!u)){if(o&&"line"in o&&"column"in o&&a&&"line"in a&&"column"in a&&o.line>0&&o.column>=0&&a.line>0&&a.column>=0&&l)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:o,source:l,original:a,name:u}))}},n.prototype._serializeMappings=function(){for(var o=0,a=1,l=0,u=0,h=0,c=0,f="",d,p,g,m,b=this._mappings.toArray(),y=0,v=b.length;y0){if(!e.compareByGeneratedPositionsInflated(p,b[y-1]))continue;d+=","}d+=i.encode(p.generatedColumn-o),o=p.generatedColumn,p.source!=null&&(m=this._sources.indexOf(p.source),d+=i.encode(m-c),c=m,d+=i.encode(p.originalLine-1-u),u=p.originalLine-1,d+=i.encode(p.originalColumn-l),l=p.originalColumn,p.name!=null&&(g=this._names.indexOf(p.name),d+=i.encode(g-h),h=g)),f+=d}return f},n.prototype._generateSourcesContent=function(o,a){return o.map(function(l){if(!this._sourcesContents)return null;a!=null&&(l=e.relative(a,l));var u=e.toSetString(l);return Object.prototype.hasOwnProperty.call(this._sourcesContents,u)?this._sourcesContents[u]:null},this)},n.prototype.toJSON=function(){var o={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(o.file=this._file),this._sourceRoot!=null&&(o.sourceRoot=this._sourceRoot),this._sourcesContents&&(o.sourcesContent=this._generateSourcesContent(o.sources,o.sourceRoot)),o},n.prototype.toString=function(){return JSON.stringify(this.toJSON())},Cf.SourceMapGenerator=n,Cf}var za={},If={},I2;function kL(){return I2||(I2=1,function(i){i.GREATEST_LOWER_BOUND=1,i.LEAST_UPPER_BOUND=2;function e(t,s,n,r,o,a){var l=Math.floor((s-t)/2)+t,u=o(n,r[l],!0);return u===0?l:u>0?s-l>1?e(l,s,n,r,o,a):a==i.LEAST_UPPER_BOUND?s1?e(t,l,n,r,o,a):a==i.LEAST_UPPER_BOUND?l:t<0?-1:t}i.search=function(s,n,r,o){if(n.length===0)return-1;var a=e(-1,n.length,s,n,r,o||i.GREATEST_LOWER_BOUND);if(a<0)return-1;for(;a-1>=0&&r(n[a],n[a-1],!0)===0;)--a;return a}}(If)),If}var Rf={},R2;function DL(){if(R2)return Rf;R2=1;function i(s,n,r){var o=s[n];s[n]=s[r],s[r]=o}function e(s,n){return Math.round(s+Math.random()*(n-s))}function t(s,n,r,o){if(r=0){var g=this._originalMappings[p];if(h.column===void 0)for(var m=g.originalLine;g&&g.originalLine===m;)d.push({line:i.getArg(g,"generatedLine",null),column:i.getArg(g,"generatedColumn",null),lastColumn:i.getArg(g,"lastGeneratedColumn",null)}),g=this._originalMappings[++p];else for(var b=g.originalColumn;g&&g.originalLine===c&&g.originalColumn==b;)d.push({line:i.getArg(g,"generatedLine",null),column:i.getArg(g,"generatedColumn",null),lastColumn:i.getArg(g,"lastGeneratedColumn",null)}),g=this._originalMappings[++p]}return d},za.SourceMapConsumer=r;function o(u,h){var c=u;typeof u=="string"&&(c=i.parseSourceMapInput(u));var f=i.getArg(c,"version"),d=i.getArg(c,"sources"),p=i.getArg(c,"names",[]),g=i.getArg(c,"sourceRoot",null),m=i.getArg(c,"sourcesContent",null),b=i.getArg(c,"mappings"),y=i.getArg(c,"file",null);if(f!=this._version)throw new Error("Unsupported version: "+f);g&&(g=i.normalize(g)),d=d.map(String).map(i.normalize).map(function(v){return g&&i.isAbsolute(g)&&i.isAbsolute(v)?i.relative(g,v):v}),this._names=t.fromArray(p.map(String),!0),this._sources=t.fromArray(d,!0),this._absoluteSources=this._sources.toArray().map(function(v){return i.computeSourceURL(g,v,h)}),this.sourceRoot=g,this.sourcesContent=m,this._mappings=b,this._sourceMapURL=h,this.file=y}o.prototype=Object.create(r.prototype),o.prototype.consumer=r,o.prototype._findSourceIndex=function(u){var h=u;if(this.sourceRoot!=null&&(h=i.relative(this.sourceRoot,h)),this._sources.has(h))return this._sources.indexOf(h);var c;for(c=0;c1&&(M.source=m+T[1],m+=T[1],M.originalLine=p+T[2],p=M.originalLine,M.originalLine+=1,M.originalColumn=g+T[3],g=M.originalColumn,T.length>4&&(M.name=b+T[4],b+=T[4])),x.push(M),typeof M.originalLine=="number"&&P.push(M)}n(x,i.compareByGeneratedPositionsDeflated),this.__generatedMappings=x,n(P,i.compareByOriginalPositions),this.__originalMappings=P},o.prototype._findMapping=function(h,c,f,d,p,g){if(h[f]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+h[f]);if(h[d]<0)throw new TypeError("Column must be greater than or equal to 0, got "+h[d]);return e.search(h,c,p,g)},o.prototype.computeColumnSpans=function(){for(var h=0;h=0){var d=this._generatedMappings[f];if(d.generatedLine===c.generatedLine){var p=i.getArg(d,"source",null);p!==null&&(p=this._sources.at(p),p=i.computeSourceURL(this.sourceRoot,p,this._sourceMapURL));var g=i.getArg(d,"name",null);return g!==null&&(g=this._names.at(g)),{source:p,line:i.getArg(d,"originalLine",null),column:i.getArg(d,"originalColumn",null),name:g}}}return{source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(h){return h==null}):!1},o.prototype.sourceContentFor=function(h,c){if(!this.sourcesContent)return null;var f=this._findSourceIndex(h);if(f>=0)return this.sourcesContent[f];var d=h;this.sourceRoot!=null&&(d=i.relative(this.sourceRoot,d));var p;if(this.sourceRoot!=null&&(p=i.urlParse(this.sourceRoot))){var g=d.replace(/^file:\/\//,"");if(p.scheme=="file"&&this._sources.has(g))return this.sourcesContent[this._sources.indexOf(g)];if((!p.path||p.path=="/")&&this._sources.has("/"+d))return this.sourcesContent[this._sources.indexOf("/"+d)]}if(c)return null;throw new Error('"'+d+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(h){var c=i.getArg(h,"source");if(c=this._findSourceIndex(c),c<0)return{line:null,column:null,lastColumn:null};var f={source:c,originalLine:i.getArg(h,"line"),originalColumn:i.getArg(h,"column")},d=this._findMapping(f,this._originalMappings,"originalLine","originalColumn",i.compareByOriginalPositions,i.getArg(h,"bias",r.GREATEST_LOWER_BOUND));if(d>=0){var p=this._originalMappings[d];if(p.source===f.source)return{line:i.getArg(p,"generatedLine",null),column:i.getArg(p,"generatedColumn",null),lastColumn:i.getArg(p,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},za.BasicSourceMapConsumer=o;function l(u,h){var c=u;typeof u=="string"&&(c=i.parseSourceMapInput(u));var f=i.getArg(c,"version"),d=i.getArg(c,"sections");if(f!=this._version)throw new Error("Unsupported version: "+f);this._sources=new t,this._names=new t;var p={line:-1,column:0};this._sections=d.map(function(g){if(g.url)throw new Error("Support for url field in sections not implemented.");var m=i.getArg(g,"offset"),b=i.getArg(m,"line"),y=i.getArg(m,"column");if(b=0;l--)this.prepend(a[l]);else if(a[n]||typeof a=="string")this.children.unshift(a);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+a);return this},r.prototype.walk=function(a){for(var l,u=0,h=this.children.length;u0){for(l=[],u=0;u0&&(g+=", "+m.join(", "));var b=0;Object.keys(this.aliases).forEach(function(S){var A=p.aliases[S];A.children&&A.referenceCount>1&&(g+=", alias"+ ++b+"="+S,A.children[0]="alias"+b)}),this.lookupPropertyFunctionIsUsed&&(g+=", "+this.lookupPropertyFunctionVarDeclaration());var y=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&y.push("blockParams"),this.useDepths&&y.push("depths");var v=this.mergeSource(g);return d?(y.push(v),Function.apply(this,y)):this.source.wrap(["function(",y.join(","),`) { `,v,"}"])},mergeSource:function(d){var p=this.environment.isSimple,g=!this.forceBuffer,m=void 0,b=void 0,y=void 0,v=void 0;return this.source.each(function(S){S.appendToBuffer?(y?S.prepend(" + "):y=S,v=S):(y&&(b?y.prepend("buffer += "):m=!0,v.add(";"),y=v=void 0),b=!0,p||(g=!1))}),g?y?(y.prepend("return "),v.add(";")):b||this.source.push('return "";'):(d+=", buffer = "+(m?"":this.initializeBuffer()),y?(y.prepend("return buffer + "),v.add(";")):this.source.push("return buffer;")),d&&this.source.prepend("var "+d.substring(2)+(m?"":`; `)),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return` lookupProperty = container.lookupProperty || function(parent, propertyName) { if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { return parent[propertyName]; } return undefined } `.trim()},blockValue:function(d){var p=this.aliasable("container.hooks.blockHelperMissing"),g=[this.contextName(0)];this.setupHelperArgs(d,0,g);var m=this.popStack();g.splice(1,0,m),this.push(this.source.functionCall(p,"call",g))},ambiguousBlockValue:function(){var d=this.aliasable("container.hooks.blockHelperMissing"),p=[this.contextName(0)];this.setupHelperArgs("",0,p,!0),this.flushInline();var g=this.topStack();p.splice(1,0,g),this.pushSource(["if (!",this.lastHelper,") { ",g," = ",this.source.functionCall(d,"call",p),"}"])},appendContent:function(d){this.pendingContent?d=this.pendingContent+d:this.pendingLocation=this.source.currentLocation,this.pendingContent=d},append:function(){if(this.isInline())this.replaceStack(function(p){return[" != null ? ",p,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var d=this.popStack();this.pushSource(["if (",d," != null) { ",this.appendToBuffer(d,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(d){this.lastContext=d},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(d,p,g,m){var b=0;!m&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(d[b++])):this.pushContext(),this.resolvePath("context",d,b,p,g)},lookupBlockParam:function(d,p){this.useBlockParams=!0,this.push(["blockParams[",d[0],"][",d[1],"]"]),this.resolvePath("context",p,1)},lookupData:function(d,p,g){d?this.pushStackLiteral("container.data(data, "+d+")"):this.pushStackLiteral("data"),this.resolvePath("data",p,0,!0,g)},resolvePath:function(d,p,g,m,b){var y=this;if(this.options.strict||this.options.assumeObjects){this.push(c(this.options.strict&&b,this,p,d));return}for(var v=p.length;gthis.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var d=this.inlineStack;this.inlineStack=[];for(var p=0,g=d.length;pi!==null&&i.isSecureContext,HL=i=>i===null?null:i.hasOwnProperty("AudioBuffer")?i.AudioBuffer:null,UL=i=>i===null?null:i.hasOwnProperty("AudioContext")?i.AudioContext:i.hasOwnProperty("webkitAudioContext")?i.webkitAudioContext:null,zL=i=>i===null?null:i.hasOwnProperty("AudioWorkletNode")?i.AudioWorkletNode:null,WL=i=>i===null?null:i.hasOwnProperty("OfflineAudioContext")?i.OfflineAudioContext:i.hasOwnProperty("webkitOfflineAudioContext")?i.webkitOfflineAudioContext:null,YL=()=>typeof window>"u"?null:window,ql=YL();WL(ql);UL(ql);zL(ql);HL(ql);GL(ql);var O2={},QL={get exports(){return O2},set exports(i){O2=i}},zd={},XL={get exports(){return zd},set exports(i){zd=i}};function jL(i){return i>64&&i<91?i-65:i>96&&i<123?i-71:i>47&&i<58?i+4:i===43?62:i===47?63:0}function KL(i,e){for(var t=i.replace(/[^A-Za-z0-9\+\/]/g,""),s=t.length,n=e?Math.ceil((s*3+1>>2)/e)*e:s*3+1>>2,r=new Uint8Array(n),o,a,l=0,u=0,h=0;h>>(16>>>o&24)&255;l=0}return r}var JL={decode:KL},qL=function(i,e){return new Promise(function(t,s){var n=new XMLHttpRequest;e&&(n.responseType=e),n.open("GET",i),n.onload=function(){n.status===200?t(n.response):s(Error(n.statusText))},n.onerror=function(){s(Error("Network Error"))},n.send()})};(function(i){var e=JL,t=qL;function s(x){return function(M){return typeof M=="string"&&x.test(M)}}function n(x,M){return typeof x=="string"?x+M:typeof x=="function"?x(M):M}function r(x,M,_,T){var D=o(M)?a:l(M)?u:h(M)?c:f(M)?d:p(M)?g:m(M)?b:y(M)?v:S(M)?A:null,C=_||{};return D?D(x,M,C):T?Promise.resolve(T):Promise.reject("Source not valid ("+M+")")}r.fetch=t;function o(x){return x instanceof ArrayBuffer}function a(x,M,_){return new Promise(function(T,D){x.decodeAudioData(M,function(C){T(C)},function(){D("Can't decode audio data ("+M.slice(0,30)+"...)")})})}var l=s(/\.(mp3|wav|ogg)(\?.*)?$/i);function u(x,M,_){var T=n(_.from,M);return r(x,r.fetch(T,"arraybuffer"),_)}function h(x){return x&&typeof x.then=="function"}function c(x,M,_){return M.then(function(T){return r(x,T,_)})}var f=Array.isArray;function d(x,M,_){return Promise.all(M.map(function(T){return r(x,T,_,T)}))}function p(x){return x&&typeof x=="object"}function g(x,M,_){var T={},D=Object.keys(M).map(function(C){if(_.only&&_.only.indexOf(C)===-1)return null;var L=M[C];return r(x,L,_,L).then(function(E){T[C]=E})});return Promise.all(D).then(function(){return T})}var m=s(/\.json(\?.*)?$/i);function b(x,M,_){var T=n(_.from,M);return r(x,r.fetch(T,"text").then(JSON.parse),_)}var y=s(/^data:audio/);function v(x,M,_){var T=M.indexOf(",");return r(x,e.decode(M.slice(T+1)).buffer,_)}var S=s(/\.js(\?.*)?$/i);function A(x,M,_){var T=n(_.from,M);return r(x,r.fetch(T,"text").then(P),_)}function P(x){var M=x.indexOf("MIDI.Soundfont.");if(M<0)throw Error("Invalid MIDI.js Soundfont format");M=x.indexOf("=",M)+2;var _=x.lastIndexOf(",");return JSON.parse(x.slice(M,_)+"}")}i.exports&&(i.exports=r),typeof window<"u"&&(window.loadAudio=r)})(XL);var Wd={},ZL={get exports(){return Wd},set exports(i){Wd=i}},$L=eB;function eB(i){var e=i.createGain(),t=e._voltage=sB(i),s=Ro(t),n=Ro(t),r=Ro(t);return e._startAmount=Ro(n),e._endAmount=Ro(r),e._multiplier=Ro(s),e._multiplier.connect(e),e._startAmount.connect(e),e._endAmount.connect(e),e.value=s.gain,e.startValue=n.gain,e.endValue=r.gain,e.startValue.value=0,e.endValue.value=0,Object.defineProperties(e,tB),e}var tB={attack:{value:0,writable:!0},decay:{value:0,writable:!0},sustain:{value:1,writable:!0},release:{value:0,writable:!0},getReleaseDuration:{value:function(){return this.release}},start:{value:function(i){var e=this._multiplier.gain,t=this._startAmount.gain,s=this._endAmount.gain;this._voltage.start(i),this._decayFrom=this._decayFrom=i+this.attack,this._startedAt=i;var n=this.sustain;e.cancelScheduledValues(i),t.cancelScheduledValues(i),s.cancelScheduledValues(i),s.setValueAtTime(0,i),this.attack?(e.setValueAtTime(0,i),e.linearRampToValueAtTime(1,i+this.attack),t.setValueAtTime(1,i),t.linearRampToValueAtTime(0,i+this.attack)):(e.setValueAtTime(1,i),t.setValueAtTime(0,i)),this.decay&&e.setTargetAtTime(n,this._decayFrom,F2(this.decay))}},stop:{value:function(i,e){e&&(i=i-this.release);var t=i+this.release;if(this.release){var s=this._multiplier.gain,n=this._startAmount.gain,r=this._endAmount.gain;s.cancelScheduledValues(i),n.cancelScheduledValues(i),r.cancelScheduledValues(i);var o=F2(this.release);if(this.attack&&i=e&&(u=e),u}var rB=$L,oB={},aB={gain:1,attack:.01,decay:.1,sustain:.9,release:.3,loop:!1,cents:0,loopStart:0,loopEnd:0};function lB(i,e,t){var s=!1,n=0,r={},o=i.createGain();o.gain.value=1;var a=Object.assign({},aB,t),l={context:i,out:o,opts:a};return e instanceof AudioBuffer?l.buffer=e:l.buffers=e,l.start=function(c,f,d){if(l.buffer&&c!==null)return l.start(null,c,f);var p=c?l.buffers[c]:l.buffer;if(p){if(!s){console.warn("SamplePlayer not connected to any node.");return}}else{console.warn("Buffer "+c+" not found.");return}var g=d||oB;f=Math.max(i.currentTime,f||0),l.emit("start",f,c,g);var m=h(c,p,g);return m.id=u(c,m),m.env.start(f),m.source.start(f),l.emit("started",f,m.id,m),g.duration&&m.stop(f+g.duration),m},l.play=function(c,f,d){return l.start(c,f,d)},l.stop=function(c,f){var d;return f=f||Object.keys(r),f.map(function(p){return d=r[p],d?(d.stop(c),d.id):null})},l.connect=function(c){return s=!0,o.connect(c),l},l.emit=function(c,f,d,p){l.onevent&&l.onevent(c,f,d,p);var g=l["on"+c];g&&g(f,d,p)},l;function u(c,f){return f.id=n++,r[f.id]=f,f.source.onended=function(){var d=i.currentTime;f.source.disconnect(),f.env.disconnect(),f.disconnect(),l.emit("ended",d,f.id,f)},f.id}function h(c,f,d){var p=i.createGain();return p.gain.value=0,p.connect(o),p.env=uB(i,d,a),p.env.connect(p.gain),p.source=i.createBufferSource(),p.source.buffer=f,p.source.connect(p),p.source.loop=d.loop||a.loop,p.source.playbackRate.value=hB(d.cents||a.cents),p.source.loopStart=d.loopStart||a.loopStart,p.source.loopEnd=d.loopEnd||a.loopEnd,p.stop=function(g){var m=g||i.currentTime;l.emit("stop",m,c);var b=p.env.stop(m);p.source.stop(b)},p}}function V2(i){return typeof i=="number"}var cB=["attack","decay","sustain","release"];function uB(i,e,t){var s=rB(i),n=e.adsr||t.adsr;return cB.forEach(function(r,o){n?s[r]=n[o]:s[r]=e[r]||t[r]}),s.value.value=V2(e.gain)?e.gain:V2(t.gain)?t.gain:1,s}function hB(i){return i?Math.pow(2,i/1200):1}var fB=lB,dB=function(i){return i.on=function(e,t){if(arguments.length===1&&typeof e=="function")return i.on("event",e);var s="on"+e,n=i[s];return i[s]=n?pB(n,t):t,i},i};function pB(i,e){return function(t,s,n,r){i(t,s,n,r),e(t,s,n,r)}}var iy=/^([a-gA-G])(#{1,}|b{1,}|x{1,}|)(-?\d*)\s*(.*)\s*$/;function gB(){return iy}var mB=[0,2,4,5,7,9,11];function sy(i,e,t){if(typeof i!="string")return null;var s=iy.exec(i);if(!s||!e&&s[4])return null;var n={letter:s[1].toUpperCase(),acc:s[2].replace(/x/g,"##")};return n.pc=n.letter+n.acc,n.step=(n.letter.charCodeAt(0)+3)%7,n.alt=n.acc[0]==="b"?-n.acc.length:n.acc.length,n.chroma=mB[n.step]+n.alt,s[3]&&(n.oct=+s[3],n.midi=n.chroma+12*(n.oct+1),n.freq=ny(n.midi,t)),e&&(n.tonicOf=s[4]),n}function ny(i,e){return Math.pow(2,(i-69)/12)*(e||440)}var ry={parse:sy,regex:gB,midiToFreq:ny},bB=["letter","acc","pc","step","alt","chroma","oct","midi","freq"];bB.forEach(function(i){ry[i]=function(e){var t=sy(e);return t&&typeof t[i]<"u"?t[i]:null}});var yB=ry,vB=yB,SB=function(i){return i!==null&&i!==[]&&i>=0&&i<129},AB=function(i){return SB(i)?+i:vB.midi(i)},xB=function(i){if(i.buffers){var e=i.opts.map,t=typeof e=="function"?e:AB,s=function(r){return r?t(r)||r:null};i.buffers=wB(i.buffers,s);var n=i.start;i.start=function(r,o,a){var l=s(r),u=l%1;return u&&(l=Math.floor(l),a=Object.assign(a||{},{cents:Math.floor(u*100)})),n(l,o,a)}}return i};function wB(i,e){return Object.keys(i).reduce(function(t,s){return t[e(s)]=i[s],t},{})}var EB=Array.isArray,PB=function(i){return i&&typeof i=="object"},_B={},MB=function(i){return i.schedule=function(e,t){var s=i.context.currentTime,n=e"u"?null:i.step?ly(i.step,i.alt,i.oct):i<0||i>6?null:kB.charAt(i)+DB(e)+OB(t)}function cy(i){if((Ip(i)||BB(i))&&i>=0&&i<128)return+i;var e=tr(i);return e&&IB(e.midi)?e.midi:null}function FB(i,e){var t=cy(i);return t===null?null:oy(t,e)}function VB(i){return(tr(i)||{}).letter}function GB(i){return(tr(i)||{}).acc}function HB(i){return(tr(i)||{}).pc}function UB(i){return(tr(i)||{}).step}function zB(i){return(tr(i)||{}).alt}function WB(i){return(tr(i)||{}).chroma}function YB(i){return(tr(i)||{}).oct}const QB=Object.freeze(Object.defineProperty({__proto__:null,acc:GB,alt:zB,build:ly,chroma:WB,freq:FB,letter:VB,midi:cy,oct:YB,parse:tr,pc:HB,regex:RB,step:UB},Symbol.toStringTag,{value:"Module"})),XB=K3(QB);var kf,H2;function jB(){if(H2)return kf;H2=1;var i=XB;function e(n,r){if(console.warn("new Soundfont() is deprected"),console.log("Please use Soundfont.instrument() instead of new Soundfont().instrument()"),!(this instanceof e))return new e(n);this.nameToUrl=r||e.nameToUrl,this.ctx=n,this.instruments={},this.promises=[]}e.prototype.onready=function(n){console.warn("deprecated API"),console.log("Please use Promise.all(Soundfont.instrument(), Soundfont.instrument()).then() instead of new Soundfont().onready()"),Promise.all(this.promises).then(n)},e.prototype.instrument=function(n,r){console.warn("new Soundfont().instrument() is deprecated."),console.log("Please use Soundfont.instrument() instead.");var o=this.ctx;if(n=n||"default",n in this.instruments)return this.instruments[n];var a={name:n,play:s(o,r)};if(this.instruments[n]=a,n!=="default"){var l=e.instrument(o,n,r).then(function(u){return a.play=u.play,a});this.promises.push(l),a.onready=function(u){console.warn("onready is deprecated. Use Soundfont.instrument().then()"),l.then(u)}}else a.onready=function(u){console.warn("onready is deprecated. Use Soundfont.instrument().then()"),u()};return a};function t(n,r,o){return console.warn("Soundfont.loadBuffers is deprecate."),console.log("Use Soundfont.instrument(..) and get buffers properties from the result."),e.instrument(n,r,o).then(function(a){return a.buffers})}e.loadBuffers=t;function s(n,r){return r=r||{},function(o,a,l,u){console.warn("The oscillator player is deprecated."),console.log("Starting with version 0.9.0 you will have to wait until the soundfont is loaded to play sounds.");var h=o>0&&o<129?+o:i.midi(o),c=h?i.midiToFreq(h,440):null;if(c){l=l||.2,u=u||{};var f=u.destination||r.destination||n.destination,d=u.vcoType||r.vcoType||"sine",p=u.gain||r.gain||.4,g=n.createOscillator();g.type=d,g.frequency.value=c;var m=n.createGain();return m.gain.value=p,g.connect(m),m.connect(f),g.start(a),l>0&&g.stop(a+l),g}}}return e.noteToMidi=i.midi,kf=e,kf}(function(i){var e=zd,t=Wd;function s(a,l,u){if(arguments.length===1)return function(p,g){return s(a,p,g)};var h=u||{},c=h.isSoundfontURL||n,f=h.nameToUrl||r,d=c(l)?l:f(l,h.soundfont,h.format);return e(a,d,{only:h.only||h.notes}).then(function(p){var g=t(a,p,h).connect(h.destination?h.destination:a.destination);return g.url=d,g.name=l,g})}function n(a){return/\.js(\?.*)?$/i.test(a)}function r(a,l,u){return u=u==="ogg"?u:"mp3",l=l==="FluidR3_GM"?l:"MusyngKite","https://gleitz.github.io/midi-js-soundfonts/"+l+"/"+a+"-"+u+".js"}var o=jB();o.instrument=s,o.nameToUrl=r,i.exports&&(i.exports=o),typeof window<"u"&&(window.Soundfont=o)})(QL);Le.C,Le.D,Le.E,Le.F,Le.G,Le.A,Le.B;const U2={"rall.":1.333333333,"poco rit.":1.333333333,"rit.":1.333333333,"molto rit.":1.333333333,"molto rall":1.333333333,molto:1.333333333,lentando:1.333333333,allargando:1.333333333,morendo:1.333333333,"accel.":.8,calando:2,"poco accel.":.8,"gradually slowing":1.333333333,slowing:1.333333333,slow:1.333333333,slowly:1.333333333,faster:1.333333333},KB=ph();bd.extend(mE);const JB=i=>{const e=$B(Ce.osmd);let t=e.numerator||0,s=e.denominator||4;const n=e.beatUnit||"quarter";return Ce.isOpenMetronome?60/i*Rp(n)*(t/s):0},kc=i=>Math.ceil(i*1e6)/1e6,qB=i=>{var s,n;const e=((s=i.parentStaffEntry)==null?void 0:s.voiceEntries)||[],t=[];for(const r of e)if((n=r.lyricsEntries)!=null&&n.table){const o=Object.values(r.lyricsEntries.table);for(const a of o)t.push(a==null?void 0:a.value.text)}return t},ZB=(i,e)=>{var t,s;if(i&&U2[(t=i.startWord)==null?void 0:t.toLocaleLowerCase()]){const n=Math.max(i.endXmlNoteIndex,3),r=[],o=e,a=e/U2[(s=i.startWord)==null?void 0:s.toLocaleLowerCase()];for(let l=0;l{let e=i;const t=i.split(":");return t.length===1?e=`00:${t[0]}:00`:t.length===2&&(e=`00:${t[0]}:${t[1]}`),`1970-01-01 00:${e}0`},$B=i=>{var t;if(i){const{Duration:s,TempoInBPM:n,ActiveTimeSignature:r,TempoExpressions:o}=(t=i.GraphicSheet.MeasureList[0][0])==null?void 0:t.parentSourceMeasure;if(s){let a="quarter";for(const u of o)a=u.InstantaneousTempo.beatUnit||"quarter";return{...uy(r),TempoInBPM:n,beatUnit:a}}}return{...new re,TempoInBPM:90,beatUnit:"quarter"}};function uy(i,e){return i}function Rp(i){let e=4;switch(i){case"1024th":e=1024;break;case"512th":e=512;break;case"256th":e=256;break;case"128th":e=128;break;case"64th":e=64;break;case"32nd":e=32;break;case"16th":e=16;break;case"eighth":e=8;break;case"quarter":e=4;break;case"half":e=2;break;case"whole":e=1;break;case"breve":e=.5;break;case"long":e=.25;break;case"maxima":e=.125;break}return e}function Df(i,e,t){return t/Rp(i)*e}const Of=(i,e,t)=>{let s=0;if(e){for(let n=0;n0){let n=0;const r=Array.from(t.childNodes).filter(a=>a.nodeName==="note"),o=r[r.length-1];if(s>=r.length&&o){t.insertBefore(i,t.childNodes[Array.from(t.childNodes).indexOf(o)]);return}for(let a=0;a{if(i){const e=i.toLocaleLowerCase(),t="d\\s?\\.s\\.",s="d\\.\\s?c\\.";return e==="@"||Pt.StringContainsSeparatedWord(e,t+" al fine",!0)||Pt.StringContainsSeparatedWord(e,t+" al coda",!0)||Pt.StringContainsSeparatedWord(e,s+" al fine",!0)||Pt.StringContainsSeparatedWord(e,s+" al coda",!0)||Pt.StringContainsSeparatedWord(e,s)||Pt.StringContainsSeparatedWord(e,"da\\s?capo",!0)||Pt.StringContainsSeparatedWord(e,t,!0)||Pt.StringContainsSeparatedWord(e,"dal\\s?segno",!0)||Pt.StringContainsSeparatedWord(e,"al\\s?coda",!0)||Pt.StringContainsSeparatedWord(e,"to\\s?coda",!0)||Pt.StringContainsSeparatedWord(e,"a (la )?coda",!0)||Pt.StringContainsSeparatedWord(e,"fine",!0)||Pt.StringContainsSeparatedWord(e,"coda",!0)||Pt.StringContainsSeparatedWord(e,"segno",!0)}return!1},tI=(i,e)=>{var d,p,g,m,b,y,v,S,A;if(!i)return"";const t=Ce.examSongId,s=new DOMParser().parseFromString(i,"text/xml"),n=((p=(d=s.getElementsByTagName("part-list"))==null?void 0:d[0])==null?void 0:p.getElementsByTagName("score-part"))||[],r=Array.from(n).map(P=>{var x;return((x=P.getElementsByTagName("part-name"))==null?void 0:x[0].textContent)||""}),o=s.getElementsByTagName("part"),a=[...(g=o[0])==null?void 0:g.getElementsByTagName("measure")],l=[...(m=o[0])==null?void 0:m.getElementsByTagName("metronome")],u=[...(b=o[0])==null?void 0:b.getElementsByTagName("words")],h=[...(y=o[0])==null?void 0:y.getElementsByTagName("coda")],c=[...(v=o[0])==null?void 0:v.getElementsByTagName("rehearsal")];((A=(S=r[0])==null?void 0:S.toLocaleUpperCase)==null?void 0:A.call(S))==="COMMON"&&(e++,r.shift());const f=n[e];if(Ce.partListNames=r,f){const P=f.getAttribute("id");Array.from(o).forEach(x=>{var M,_,T,D,C;if(x&&x.getAttribute("id")!==P)(M=x.parentNode)==null||M.removeChild(x);else if(x&&x.getAttribute("id")!=="P1"){const L={};for(let E=0;E{var J;const k=(J=E.parentElement)==null?void 0:J.parentElement,Q=k==null?void 0:k.parentElement,H=[...(Q==null?void 0:Q.childNodes)||[]],Z=k?H.indexOf(k):-1;if(Q&&Z>-1){const le=a.indexOf(Q),X=x.getElementsByTagName("measure")[le];Of(k,Q,X)}}),u.forEach(E=>{var Q;let k=E.textContent||"";if(k=["cresc."].includes(k)?"":k,(vp(k)||Ar(k)||_M(k)||eI(k)||wM)&&k){const H=(Q=E.parentElement)==null?void 0:Q.parentElement,Z=H==null?void 0:H.parentElement,J=[...(Z==null?void 0:Z.childNodes)||[]],le=H?J.indexOf(H):-1;if(H&&Z&&le>-1){const X=a.indexOf(Z),O=x.getElementsByTagName("measure")[X];Array.from((O==null?void 0:O.getElementsByTagName("words"))||[]).reduce((W,se)=>{var he;return(he=se.textContent)!=null&&he.includes(k)&&W++,W},0)===0&&(["12280"].includes(t)?O==null||O.insertBefore(H.cloneNode(!0),O==null?void 0:O.childNodes[le]):Of(H,Z,O))}}}),h.forEach(E=>{var J;const k=(J=E.parentElement)==null?void 0:J.parentElement,Q=k==null?void 0:k.parentElement,H=[...(Q==null?void 0:Q.childNodes)||[]],Z=k?H.indexOf(k):-1;if(k&&Q&&Z>-1){const le=a.indexOf(Q),X=x.getElementsByTagName("measure")[le];["12280"].includes(t)?X==null||X.insertBefore(k.cloneNode(!0),X==null?void 0:X.childNodes[Z]):Of(k,Q,X)}}),c.forEach(E=>{var H,Z;const k=(H=E.parentElement)==null?void 0:H.parentElement,Q=k==null?void 0:k.parentElement;if(Q){const J=a.indexOf(Q);(Z=x.getElementsByTagName("measure")[J])==null||Z.appendChild(k.cloneNode(!0))}})}else u.forEach(L=>{var k,Q,H;const E=L.textContent||"";if(Ar(E)&&E){const Z=(Q=(k=L.parentElement)==null?void 0:k.parentElement)==null?void 0:Q.parentElement;if(Z&&Z.firstElementChild&&Z.firstElementChild!==L){const J=(H=L.parentElement)==null?void 0:H.parentElement,le=Z.firstElementChild;Z.insertBefore(J,le)}}});if(x&&x.getAttribute("id")===P){const L=x.getElementsByTagName("barline"),E=(D=L[L.length-1])==null?void 0:D.parentElement;if(((C=E==null?void 0:E.lastElementChild)==null?void 0:C.tagName)!=="barline"){const k=(E==null?void 0:E.children)||[];for(let Q of k)if(Q.tagName==="barline"){E==null||E.appendChild(Q);break}}}}),Array.from(n).forEach(x=>{var M;x&&x.getAttribute("id")!==P&&((M=x.parentNode)==null||M.removeChild(x))})}return new XMLSerializer().serializeToString(iI(s))},iI=i=>{var s,n,r,o;if(!i)return i;const e=i.querySelectorAll("grace");if(!e.length)return i;const t=a=>a.querySelector("grace")?t(a==null?void 0:a.nextElementSibling):a;for(let a of e){const l=(s=a.parentElement)==null?void 0:s.querySelector("notations");if(l&&l.querySelectorAll("slur").length>1){let u=t((n=a.parentElement)==null?void 0:n.nextElementSibling);if(u&&u.querySelectorAll("slur").length>0){const h=Array.from(((r=u.querySelector("notations"))==null?void 0:r.children)||[]).map(f=>f.getAttribute("number")),c=l.querySelectorAll("slur");for(let f of c)h.includes(f.getAttribute("number"))||(o=u.querySelector("notations"))==null||o.appendChild(f)}}}return i},sI=i=>{var r,o;if(!i)return"";const e=new DOMParser().parseFromString(i,"text/xml"),t=Array.from(e.getElementsByTagName("measure"));let s=-1,n=-1;for(const a of t){s===-1&&a.getElementsByTagName("beats").length&&(s=parseInt(a.getElementsByTagName("beats")[0].textContent||"4")),n===-1&&a.getElementsByTagName("beat-type").length&&(n=parseInt(a.getElementsByTagName("beat-type")[0].textContent||"4"));const l=parseInt(((r=a.getElementsByTagName("divisions")[0])==null?void 0:r.textContent)||"256");if(a.getElementsByTagName("note").length===0){const u=(o=a.getElementsByTagName("forward")[0])==null?void 0:o.getElementsByTagName("duration")[0];u&&(u.textContent="0"),a.innerHTML=a.innerHTML+` ${l*s} 1 whole `}}return new XMLSerializer().serializeToString(e)},XR=i=>{var C,L,E,k,Q,H,Z,J,le,X,O,fe,de,W,se,he,oe,be,Me,ve,V,z,w,U,G,R,N,F,q,j,K,ae;const e=(C=Ce.examSongId)==null?void 0:C.toString();Ce.partIndex+"";let t=KB.huawei?.08:0;const s=[],n=[],r=[],{originSpeed:o}=Ce,a=($,ne)=>{var we,Re,He,wt,We,_t;return["906"].includes(e)?((we=ne.measures[0])==null?void 0:we.realKey)||$:["782","784"].includes(e)&&[14,16,30,32].includes((Re=ne.firstVerticalMeasure)==null?void 0:Re.measureNumber)?((He=s[s.length-1])==null?void 0:He.realKey)||$:["900","901","640","641","739","740","800","801","773","774","869","872","714","715"].includes(e)&&(((wt=ne.firstVerticalMeasure)==null?void 0:wt.measureNumber)===3||((We=ne.firstVerticalMeasure)==null?void 0:We.measureNumber)===9)&&((_t=ne.measures[0])==null?void 0:_t.realKey)||$};if(!i.cursor)return[];const l=i.cursor.Iterator;console.time("音符跑完时间");let u=0,h=0,c=[],f=[],d=0,p=0,g=0,m="quarter",b,y,v=0,S=0,A=0;const P=[];Ce.gradualTimes&&console.log("合奏速度",Ce.gradual,Ce.gradualTimes);let x=l.currentTimeStamp.RealValue;const M=[];let _=!1,T=0;for(;!l.EndReached;){const $=(L=l.CurrentVoiceEntries)!=null&&L[0]?[(E=l.CurrentVoiceEntries)==null?void 0:E[0]]:[];let ne=[];Ce.multitrack>0?ne=[...l.CurrentVoiceEntries]:ne=[...l.CurrentVoiceEntries].filter(we=>{var Re;return we&&((Re=we==null?void 0:we.ParentVoice)==null?void 0:Re.VoiceId)!=1});let ye=0,Te=!1,ce=!1;if(ne.length&&!_){Te=!0;let we=[...l.CurrentVoiceEntries].reduce((Re,He)=>(Re.push(...He.Notes),Re),[]);if(we=we.sort((Re,He)=>{var wt,We;return((wt=Re==null?void 0:Re.length)==null?void 0:wt.realValue)-((We=He==null?void 0:He.length)==null?void 0:We.realValue)}),ye=((Q=(k=we==null?void 0:we[0])==null?void 0:k.length)==null?void 0:Q.realValue)||0,Ce.multitrack>0&&ne.length===2){const Re=((Z=(H=we[0])==null?void 0:H.length)==null?void 0:Z.realValue)||0;T=(((le=(J=we[we.length-1])==null?void 0:J.length)==null?void 0:le.realValue)||0)-Re,_=T!==0}}(X=P[P.length-1])!=null&&X.isDouble&&!ne.length&&(ce=!0),Ce.multitrack>0&&!Te&&_&&(Te=!0,ye=T,_=!1,T=0),M.push(l.currentTimeStamp.realValue-x),x=l.currentTimeStamp.realValue;for(const we of $){let Re=we.notes[0];if(Re.IsGraceNote&&(Re=Re.parentStaffEntry.voiceEntries.find(wt=>!wt.isGrace).notes[0]),Re.fixedKey=Re.ParentVoiceEntry.ParentVoice.Parent.SubInstruments[0].fixedKey||0,(O=Re==null?void 0:Re.voiceEntry)!=null&&O.isGrace){Te=!0;let He=[...l.currentVoiceEntries].reduce((wt,We)=>(wt.push(...We.notes),wt),[]);He=He.sort((wt,We)=>{var _t,gt;return((_t=We==null?void 0:We.length)==null?void 0:_t.realValue)-((gt=wt==null?void 0:wt.length)==null?void 0:gt.realValue)}),ye=ye!=0?Math.min((de=(fe=He==null?void 0:He[0])==null?void 0:fe.length)==null?void 0:de.realValue,ye):(se=(W=He==null?void 0:He[0])==null?void 0:W.length)==null?void 0:se.realValue}Ce.multitrack>0&&ye>Re.length.realValue&&(ye=Re.length.realValue),P.push({note:Re,iterator:{...l},currentTime:ye,isDouble:Te,isMutileSubject:ce})}l.moveToNextVisibleVoiceEntry(!1)}for(let{note:$,iterator:ne,currentTime:ye,isDouble:Te,isMutileSubject:ce}of P){if($){if(h===0&&r.push($.sourceMeasure),h===0&&Ce.isSpecialBookCategory)for(const os of(he=$.sourceMeasure)==null?void 0:he.TempoExpressions)(oe=os==null?void 0:os.InstantaneousTempo)!=null&&oe.beatUnit&&(m=os.InstantaneousTempo.beatUnit);let we=$.sourceMeasure.tempoInBPM;const{metronomeNoteIndex:Re}=ne.currentMeasure;Re!==0&&Re>h&&(we=((be=s[s.length-1])==null?void 0:be.speed)||100);const He=[(Me=$.sourceMeasure.verticalMeasureList)==null?void 0:Me[0]],{realValue:wt}=ne.currentTimeStamp,{RealValue:We,Denominator:_t}=uy(ne.currentMeasure.activeTimeSignature,ne.currentMeasure.duration);let{wholeValue:gt,numerator:Rt,denominator:Is,realValue:Rs}=$.length;Te&&ye>0&&ye!=Rs&&(console.log(`小节 ${$.sourceMeasure.MeasureNumberXML} 替换: noteLength: ${Rs}, 最小: ${ye}`),Rs=ye);let ir=p,Zs=(Ce.isSpecialBookCategory?we:o)||1;u===0&&(t+=JB(Zs),Ce.fixtime=t,console.log("🚀 ~ fixtime:",t,Zs));let An=0,Ni=(Ce.isSpecialBookCategory?we:o)||1;y=ne.currentMeasure.speedInfo||y,b=((ve=i.Sheet.SoundTempos)==null?void 0:ve.get($.sourceMeasure.measureListIndex))||b,(!b||b.length<2)&&(b=ZB(y,Ni));const Ki=ne.currentMeasure.measureListIndex;if(Ce.gradualTimes&&Object.keys(Ce.gradualTimes).length>0){const os=Ce.gradual.find((ki,Di)=>{var ks;const ri=Ce.gradual[Di+1];return ki[0].measureIndex<=Ki&&((ks=ki[1])==null?void 0:ks.measureIndex)>=Ki&&(!ri||(ri==null?void 0:ri[0].measureIndex)!==Ki)}),[Ji,Zt]=os||[];if(Ji&&Zt){const ki=Zt.measureIndex-Ji.measureIndex,Di=Ji.closedMeasureIndex==Ki&&h>=Ji.noteInMeasureIndex,ri=Zt.closedMeasureIndex===Ki&&h0)){const os=b[0]-(b[1]-b[0]),{resetXmlNoteIndex:Ji,endXmlNoteIndex:Zt}=y,ki=Zt;let Di=(b[b.length-1]-os)/ki;if(Di=$.DotsXml?Di/1.5:Di,vv&&(Ni=(V=s[u-1])==null?void 0:V.speed);Zs=(Ce.isSpecialBookCategory?Df(m,Ni,ne.currentMeasure.activeTimeSignature.Denominator):o)||1;const ri=!(vv);v++,ri&&(v=0,y=void 0,b=void 0,f=[])}const Pa=Rs;let $s=An||Math.min(We,Rs)*Rp(m)*(60/Zs);const xo=We*_t*(60/Zs);p+=$s,g+=$s;let wo=$s+ir;const Eo=$.fixedKey||0,en=(w=(z=He[0])==null?void 0:z.vfVoices["1"])==null?void 0:w.tickables[h];if(s.length&&s[s.length-1].relativeTime===ir)continue;if(u===0){let os=0;(((G=(U=$.sourceMeasure.verticalMeasureList)==null?void 0:U[0])==null?void 0:G.staffEntries)||[]).forEach(Zt=>{var ki,Di,ri,ks,Ds,xn;(xn=(Ds=(ks=(ri=(Di=(ki=Zt==null?void 0:Zt.sourceStaffEntry)==null?void 0:ki.voiceEntries)==null?void 0:Di[0])==null?void 0:ri.notes)==null?void 0:ks[0])==null?void 0:Ds.length)!=null&&xn.realValue&&(os+=Zt.sourceStaffEntry.voiceEntries[0].notes[0].length.realValue)}),os0&&(t+=d)}let Zl=(R=He[0])==null?void 0:R.stave;!Zl&&$.isRestFlag&&s.length,$.sourceMeasure.multipleRestMeasures&&(S=$.sourceMeasure.multipleRestMeasures,A=0),A$.relativeTime-ne.relativeTime).map(($,ne)=>({...$,i:ne}));console.timeEnd("音符跑完时间");try{i.cursor.reset()}catch($){}return Ce.activeMeasureIndex=D[0].MeasureNumberXML,D},jR=i=>{let e=i,t;if(i.noteElement.tie&&i.noteElement.tie.StartNote&&(t=i.noteElement.tie.StartNote),e&&t&&t!==e.noteElement){for(const s of Ce.times)if(t===s.noteElement)return s}return e},nI="_selectionContainer_1lvx1_1",rI="_position_1lvx1_7",oI="_staveBox_1lvx1_10",aI="_leftStaveBox_1lvx1_13",lI="_rightStaveBox_1lvx1_27",cI="_centerStaveBox_1lvx1_41",uI="_prepareStaveBox_1lvx1_66",hI="_disable_1lvx1_69",fI="_line_1lvx1_72",dI="_scoreItem_1lvx1_82",pI="_dotWrap_1lvx1_119",gI="_noteFollow_1lvx1_134",Pi={selectionContainer:nI,position:rI,staveBox:oI,leftStaveBox:aI,rightStaveBox:lI,centerStaveBox:cI,prepareStaveBox:uI,disable:hI,line:fI,scoreItem:dI,dotWrap:pI,noteFollow:gI},mI=xt({name:"selection",setup(){const i=Ht({notes:[],staves:[]}),e=()=>{var h,c,f,d,p,g,m,b,y,v,S,A;const n=((h=document.getElementById("musicAndSelection"))==null?void 0:h.getBoundingClientRect())||{x:0,y:0},r=n.x||0,o=n.y||0,a=Ce.times,l=[],u=[];for(let P=0;PT.MeasureNumberXML===x.MeasureNumberXML-1);_!=null&&_.staveBox&&(M.staveBox={left:_.staveBox.left,top:_.staveBox.top,width:_.staveBox.width},i.staves.push(M),u.push(x.MeasureNumberXML))}}}},t=Ft(()=>Ce.sectionStatus||Ce.modeType!=="practise"),s=Ft(()=>n=>{if(Ce.sectionStatus){if(Ce.section.length===1&&n.MeasureNumberXML==Ce.section[0].MeasureNumberXML)return Pi.leftStaveBox;if(Ce.section.length===2){if(Ce.sectionFirst&&n.MeasureNumberXML===Ce.sectionFirst.MeasureNumberXML)return Pi.prepareStaveBox;if(n.MeasureNumberXML>=Ce.section[0].MeasureNumberXML&&n.MeasureNumberXML<=Ce.section[1].MeasureNumberXML)return n.MeasureNumberXML==Ce.section[0].MeasureNumberXML&&n.MeasureNumberXML==Ce.section[1].MeasureNumberXML?Pi.centerStaveBox:n.MeasureNumberXML==Ce.section[0].MeasureNumberXML?Pi.leftStaveBox:n.MeasureNumberXML==Ce.section[1].MeasureNumberXML?Pi.rightStaveBox:Pi.staveBox}}else if(Ce.activeMeasureIndex==n.MeasureNumberXML)return Pi.staveBox});return Cs(()=>{e()}),()=>ee("div",{id:"selectionBox",class:Pi.selectionContainer,onClick:n=>n.stopPropagation()},[i.staves.map(n=>{var o;const r=Ke.evaluatings[n.measureListIndex];return ee(oi,null,[n.staveBox&&ee("div",{class:[Pi.position,s.value(n),r?`scoreItemLeve${r.leve}`:""],style:n.staveBox,onClick:()=>rP(n)},[!n.isRestFlag&&kt.lineShow&&n.MeasureNumberXML===((o=kt.activeMetro)==null?void 0:o.measureNumberXML)&&ee("div",{class:Pi.line,style:{left:kt.activeMetro.left}},null),!!n.multipleRestMeasures&&Ce.activeMeasureIndex==n.MeasureNumberXML&&ee("div",{class:Pi.dotWrap},[n.multipleRestMeasures]),ee(va,{name:"centerTop",onAfterEnter:()=>{r.show=!1}},{default:()=>{var a,l;return[(r==null?void 0:r.show)&&ee("div",{class:Pi.scoreItem,style:{color:((a=Gm[r.leve])==null?void 0:a.color)||""}},[ee("img",{src:(l=Gm[r.leve])==null?void 0:l.icon},null),ee("span",null,[r.score])])]}})])])}),i.notes.map(n=>ee("div",{class:[Pi.position,t.value&&Pi.disable,Pi.note],style:n.bbox,onClick:()=>yh(n.index)},[ee("div",{class:Pi.noteFollow,"data-vf":"vf"+n.id},[ee(Tr,{name:"success"},null),ee(Tr,{name:"cross"},null)])]))])}});const bI="musicRenderType",No=Ht({showSelection:!1,isRenderLoading:!0,score:""}),KR=()=>{var t;const i=document.querySelector("#osmdSvgPage1"),e=document.getElementById("osmdCanvasPage1");if(i&&e){let s=i==null?void 0:i.getAttribute("width");if(s=isNaN(Number(s))?0:Number(s),s){const n=e.offsetWidth/s;(t=document.getElementById("musicAndSelection"))==null||t.style.setProperty("--music-zoom",n+"")}}},JR=()=>{const i=xl.parse(location.search),e=xl.stringify({...i,_t:Date.now()});location.search="?"+e},qR=xt({name:"music-score",emits:["rendered"],setup(i,{emit:e}){const t=()=>{const r=sessionStorage.getItem(bI);Ce.musicRenderType=["staff","firstTone","fixedTone"].includes(r)?r:"staff"},s=async()=>{const r=await fetch(Ce.xmlUrl).then(a=>a.text()),o=sI(r);No.score=tI(o,Ce.partIndex)},n=async()=>{const r=document.getElementById("musicAndSelection");if(!r||!No.score)return;const o=new z4(r,{drawTitle:!1,drawSubtitle:!1,autoResize:!1,followCursor:!1,drawPartNames:!1,drawComposer:!1});o.EngravingRules.PageRightMargin=2,o.EngravingRules.PageTopMargin=3,o.EngravingRules.PageLeftMargin=2,o.EngravingRules.PageBottomMargin=2,o.EngravingRules.DYMusicScoreType=Ce.musicRenderType==="staff"?"staff":"jianpu",Ce.musicRenderType==="fixedTone"&&(window.sett={keySignature:!0}),await o.load(No.score),o.zoom=Ce.zoom,o.render(),e("rendered",o),No.showSelection=!0};return c1(async()=>{t(),await s(),await n(),No.isRenderLoading=!1}),()=>ee("div",{id:"musicAndSelection"},[No.showSelection&&ee(mI,null,null)])}}),yI="modulepreload",vI=function(i,e){return new URL(i,e).href},W2={},on=function(e,t,s){if(!t||t.length===0)return e();const n=document.getElementsByTagName("link");return Promise.all(t.map(r=>{if(r=vI(r,s),r in W2)return;W2[r]=!0;const o=r.endsWith(".css"),a=o?'[rel="stylesheet"]':"";if(!!s)for(let h=n.length-1;h>=0;h--){const c=n[h];if(c.href===r&&(!o||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${r}"]${a}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":yI,o||(u.as="script",u.crossOrigin=""),u.href=r,document.head.appendChild(u),o)return new Promise((h,c)=>{u.addEventListener("load",h),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>e())},an={flute:{59:[27,26,25,15,24,22,17,20],60:[27,26,25,15,24,22,17,20],61:[27,26,25,15,24,22,17,21],62:[27,26,25,15,24,22,17],63:[27,26,25,15,24,22,17,19],64:[27,26,25,15,24,22,19],65:[27,26,25,15,24,19],66:[27,26,25,15,17,19],67:[27,26,25,15,19],68:[27,26,25,15,18,19],69:[27,26,15,19],70:[[27,14,19],[27,24,15,19]],71:[27,15,19],72:[27,19],73:[19],74:[26,25,24,22,17,15],75:[26,25,24,22,17,19,15],76:[27,26,25,15,24,22,19],77:[27,26,25,15,24,19],78:[27,26,25,15,17,19],79:[27,26,25,15,19],80:[27,26,25,15,18,19],81:[27,26,15,19],82:[[27,14,19],[27,24,15,19]],83:[27,15,19],84:[27,19],85:[19],86:[26,25,15,19],87:[27,26,25,15,24,22,17,18,19],88:[27,26,15,24,22,19],89:[27,25,24,15,19],90:[27,25,17,15,19],91:[27,26,25,19],92:[26,25,18,19],93:[26,24,15,19],94:[23,24,15,19],95:[27,25,15,16],96:[27,26,25,18,24,19]},clarinet:{52:[[3,4,6,8,9,11,14,18,20],[3,4,6,8,9,11,14,20]],53:[[3,4,6,8,9,11,12,20],[3,4,6,8,9,11,18,20]],54:[[3,4,6,8,9,11,13,18,20],[3,4,6,8,9,11,13,20],[3,4,6,8,9,11,15]],55:[3,4,6,8,9,11,20],56:[3,4,6,8,9,11,16,20],57:[3,4,6,8,9,20],58:[3,4,6,8,20],59:[[3,4,6,9,20],[3,4,6,8,10,20]],60:[3,4,6,20],61:[3,4,6,7,20],62:[3,4,20],63:[[3,4,20,24],[3,4,5,20],[3,8,20]],64:[3,20],65:[20],66:[[3],[20,23,24]],67:[],68:[2],69:[1],70:[1,19],71:[[3,4,6,8,9,11,14,18,19,20],[3,4,6,8,9,11,14,19,20]],72:[[3,4,6,8,9,11,12,19,20],[3,4,6,8,9,11,18,19,20]],73:[[3,4,6,8,9,11,13,19,20],[3,4,6,8,9,11,13,18,19,20],[3,4,6,8,9,11,15,19,20]],74:[3,4,6,8,9,11,19,20],75:[3,4,6,8,9,11,16,19,20],76:[3,4,6,8,9,19,20],77:[3,4,6,8,19,20],78:[[3,4,6,9,19,20],[3,4,6,8,10,19,20]],79:[3,4,6,19,20],80:[3,4,6,7,19,20],81:[3,4,19,20],82:[[3,4,19,20,24],[3,4,5,19,20],[3,4,8,19,20]],83:[3,19,20],84:[19,20],85:[4,6,8,9,19,20],86:[4,6,8,16,19,20],87:[[4,6,8,10,16,19,20],[4,6,9,16,19,20]],88:[4,6,16,19,20],89:[4,6,7,16,19,20]},trumpet:{0:[1,2,3],54:[4,5,6],55:[4,2,6],56:[1,5,6],57:[4,5,3],58:[4,2,3],59:[1,5,3],60:[1,2,3],61:[4,5,6],62:[4,2,6],63:[1,5,6],64:[4,5,3],65:[4,2,3],66:[1,5,3],67:[1,2,3],68:[1,5,6],69:[4,5,3],70:[4,2,3],71:[1,5,3],72:[1,2,3],73:[4,5,3],74:[4,2,3],75:[1,5,3],76:[1,2,3],77:[4,2,3],78:[1,4,3],79:[1,2,3],80:[1,5,6],81:[4,5,3],82:[4,2,3],83:[1,5,3],84:[1,2,3]},horn:{53:[1],54:[2],55:[],56:[2,3],57:[1,2],58:[1],59:[2],60:[],61:[1,2],62:[1],63:[2],64:[],65:[1],66:[2],67:[],68:[0,2,3],69:[0,1,2],70:[0,1],71:[0,2],72:[0],73:[0,2,3],74:[0,1,2],75:[0,1],76:[0,2],77:[0],78:[0,2],79:[0],80:[0,2,3],81:[0,1,2],82:[0,1],83:[0,2],84:[0]},"up-bass-horn":{0:[1,2,3],40:[4,5,6],41:[4,2,6],42:[1,5,6],43:[4,5,3],44:[4,2,3],45:[1,5,3],46:[1,2,3],47:[4,5,6],48:[4,2,6],49:[1,5,6],50:[4,5,3],51:[4,2,3],52:[1,5,3],53:[1,2,3],54:[1,5,6],55:[4,5,3],56:[4,2,3],57:[1,5,3],58:[1,2,3],59:[4,5,3],60:[4,2,3],61:[1,5,3],62:[1,2,3],63:[4,2,3],64:[1,5,3],65:[1,2,3],66:[1,5,6],67:[4,5,3],68:[4,2,3],69:[1,5,3],70:[1,2,3]},trombone:{0:[1],40:[22],41:[11],42:[5],43:[4],44:[3],45:[2],46:[1],47:[22],48:[11],49:[5],50:[4],51:[3],52:[2],53:[1],54:[5],55:[4],56:[3],57:[2],58:[1],59:[4],60:[3],61:[2],62:[1],63:[3],64:[2],65:[1],66:[5],67:[4],68:[3],69:[2],70:[1]},saxophone:{58:[2,4,5,13,17,18,19,23],59:[2,4,5,11,17,18,19,23],60:[2,4,5,17,18,19,23],61:[2,4,5,12,17,18,19,23],62:[2,4,5,17,18,19],63:[2,4,5,17,18,19,22],64:[2,4,5,17,18],65:[2,4,5,17],66:[[2,4,5,18],[2,4,5,17,21]],67:[2,4,5],68:[2,4,5,10],69:[2,4],70:[[2,4,16],[2,17],[2,3]],71:[2],72:[[4],[2,15]],73:[],74:[2,4,5,6,17,18,19],75:[2,4,5,6,17,18,19,22],76:[2,4,5,6,17,18],77:[2,4,5,6,17],78:[[2,4,5,6,18],[2,4,5,6,17,21]],79:[2,4,5,6],80:[2,4,5,6,10],81:[2,4,6],82:[[2,4,6,16],[2,6,17],[2,3,6]],83:[2,6],84:[[4,6],[2,6,15]],85:[6],86:[6,9],87:[6,7,8],88:[6,8,9,14],89:[[6,7,8,9,14],[1,4,6]]},tuba:{0:[1,2,3],28:[4,5,6],29:[4,2,6],30:[1,5,6],31:[4,5,3],32:[4,2,3],33:[4,2,6],34:[1,2,3],35:[4,5,6],36:[4,2,6],37:[1,5,6],38:[4,5,3],39:[4,2,3],40:[1,5,3],41:[1,2,3],42:[1,5,6],43:[4,5,3],44:[4,2,3],45:[1,5,3],46:[1,2,3],47:[4,5,3],48:[4,2,3],49:[1,5,3],50:[1,2,3],51:[4,2,3],52:[1,5,3],53:[1,2,3],54:[1,5,6],55:[4,5,3],56:[4,2,3],57:[1,5,3],58:[1,2,3]},piccolo:{72:[11,2,33,4,5,6,7,8],73:[11,2,33,4,5,6,7,88],74:[11,2,33,4,5,6,7],75:[11,2,33,4,5,6,77],76:[11,2,33,4,5,6],77:[11,2,33,4,5,7,8],78:[11,2,33,4,6,7],79:[11,2,33,4],80:[11,2,33,5,6,77],81:[11,2,33],82:[[11,2,4,5],[11,3,4,5]],83:[[11,2],[11,33,4]],84:[11,33],85:[[2,33],[11]],86:[33],87:[33,4,5,6,77],88:[1,2,33,4,5,6],89:[1,2,33,4,5,77],90:[1,2,33,4,6],91:[1,2,33,4],92:[1,2,33,5],93:[1,2,33],94:[1,2,33,5,6,77],95:[1,2,33,5,6],96:[1,2,5,6],97:[1,2,3,4,5,77,88],98:[1,2,4,5,77,8]},"small-drum":{0:["active","active-left","active-right"],64:["left","right"]}},ZR=(i,e)=>e==="GYM"?i:e==="COLEXIU"?{Flute:2,Clarinet:4,Trombone:14,Tuba:17,Trumpet:12,Horn:13,AltoSaxophone:6,TenorSaxophone:6,Saxophone:6,UpBassHorn:15,Melodica:137,HulusiFlute:136,PanFlute:135,Ocarina:134,Recorder:120,Ukulele:130,Mouthorgan:140,Piano:150}[i]:e==="ORCHESTRA"?{1:23,2:2,3:5,4:4,5:12,6:14,7:13,8:15,9:17}[i]:0,$R=i=>{switch(i){case 2:return{name:"flute",direction:"transverse",height:"1.6rem"};case 4:return{name:"clarinet",direction:"vertical",width:"3rem"};case 5:case 6:return{name:"saxophone",direction:"vertical",width:"4.34rem"};case 12:return{name:"trumpet",direction:"transverse",height:"1.6rem"};case 13:return{name:"horn",direction:"vertical",width:"4.98rem"};case 14:return{name:"trombone",direction:"transverse",height:"1.6rem"};case 15:return{name:"up-bass-horn",direction:"vertical",width:"4.34rem"};case 17:return{name:"tuba",direction:"vertical",width:"4.34rem"};case 120:return{name:"piccolo",direction:"vertical",width:"3rem"};default:return{}}},eN=async i=>{switch(i){case"flute":return{json:(await on(()=>import("./index-7f22768f.js"),[],import.meta.url)).default,relationship:an.flute,height:"60px",styles:{}};case"clarinet":return{json:(await on(()=>import("./index-2499965c.js"),[],import.meta.url)).default,relationship:an.clarinet,styles:{marginLeft:".4rem",marginRight:".7rem"}};case"trumpet":return{json:(await on(()=>import("./index-f01bef28.js"),[],import.meta.url)).default,relationship:an.trumpet};case"horn":return{json:(await on(()=>import("./index-20c025d3.js"),[],import.meta.url)).default,relationship:an.horn,height:"212px",width:"252px"};case"tuba":return{json:(await on(()=>import("./index-902205b3.js"),[],import.meta.url)).default,relationship:an.tuba};case"piccolo":return{json:(await on(()=>import("./index-3b5fe9c5.js"),[],import.meta.url)).default,relationship:an.piccolo};case"up-bass-horn":return{json:(await on(()=>import("./index-ad5b3309.js"),[],import.meta.url)).default,relationship:an["up-bass-horn"]};case"trombone":return{json:(await on(()=>import("./index-514ebf48.js"),[],import.meta.url)).default,relationship:an.trombone};case"saxophone":return{json:(await on(()=>import("./index-5f35fb88.js"),[],import.meta.url)).default,relationship:an.saxophone,styles:{marginLeft:".2rem",marginRight:".3rem"}};case"small-drum":return{json:(await on(()=>import("./index-f45b4b54.js"),[],import.meta.url)).default,relationship:an["up-bass-horn"],width:"180px"};default:return null}},tN=xt({name:"notfund",render(){return ee(R3,{image:"error",description:this.$route.path+" 路径不存在"},{default:()=>[ee(_3,{type:"primary",onClick:()=>this.$router.replace("/")},{default:()=>[ya("返回首页")]})]})}});export{ps as $,yn as A,XI as B,ns as C,kI as D,B0 as E,Cs as F,au as G,sd as H,VI as I,as as J,Pb as K,P3 as L,vR as M,c1 as N,eR as O,iR as P,nR as Q,jt as R,UA as S,yR as T,oi as U,$I as V,$8 as W,uo as X,wR as Y,bh as Z,fi as _,HI as a,fR as a$,xi as a0,xR as a1,AR as a2,Oo as a3,Hc as a4,kb as a5,Uf as a6,xI as a7,nh as a8,Zo as a9,MR as aA,LR as aB,I9 as aC,lR as aD,V3 as aE,CR as aF,jR as aG,NI as aH,_3 as aI,GR as aJ,uR as aK,hR as aL,ea as aM,pR as aN,qs as aO,_I as aP,sR as aQ,rR as aR,HR as aS,vh as aT,kt as aU,VR as aV,B6 as aW,g7 as aX,nl as aY,T3 as aZ,oR as a_,Pr as aa,fr as ab,Qn as ac,vr as ad,Xd as ae,$o as af,Oc as ag,va as ah,ER as ai,Js as aj,Uc as ak,PR as al,BE as am,ya as an,Ce as ao,Ht as ap,Tr as aq,Ke as ar,xl as as,cR as at,Qb as au,ph as av,Hm as aw,TR as ax,O9 as ay,JI as az,LI as b,FR as b$,KR as b0,ba as b1,qI as b2,qR as b3,NR as b4,BR as b5,aR as b6,ZR as b7,zR as b8,$R as b9,WA as bA,$f as bB,ou as bC,a8 as bD,oo as bE,jI as bF,CI as bG,UI as bH,i6 as bI,FI as bJ,E6 as bK,P6 as bL,M6 as bM,M3 as bN,KI as bO,wI as bP,QA as bQ,YI as bR,WI as bS,x6 as bT,fh as bU,d8 as bV,f8 as bW,rs as bX,bR as bY,UR as bZ,d7 as b_,tR as ba,XR as bb,SR as bc,PI as bd,EI as be,tN as bf,ZI as bg,e3 as bh,S8 as bi,mR as bj,I3 as bk,bI as bl,JR as bm,WR as bn,K9 as bo,Kb as bp,kR as bq,DR as br,gR as bs,RR as bt,OR as bu,IR as bv,dR as bw,p3 as bx,n6 as by,hh as bz,ji as c,DI as c0,vt as c1,td as c2,s6 as c3,Qg as c4,P5 as c5,Rr as c6,v1 as c7,b3 as c8,g3 as c9,m3 as ca,t6 as cb,vo as cc,A3 as cd,zg as ce,QI as cf,OI as cg,_6 as ch,Xi as ci,ch as cj,jA as ck,BI as cl,A1 as cm,S6 as cn,o6 as co,zI as cp,FE as cq,DE as cr,OE as cs,_R as ct,H0 as cu,eN as cv,AI as cw,D9 as cx,xt as d,Sn as e,II as f,x1 as g,dh as h,Jn as i,ee as j,RI as k,XA as l,TI as m,ni as n,ed as o,S1 as p,si as q,dt as r,Ft as s,Ys as t,J6 as u,GI as v,A5 as w,Vt as x,MI as y,Kn as z};