@modelcontextprotocol/server-sheet-music 1.2.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mcp-app.html +27 -27
- package/dist/server.js +41 -37
- package/package.json +1 -1
package/dist/mcp-app.html
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
|
|
44
44
|
`)}o.write("payload.value = newResult;"),o.write("return payload;");const m=o.compile();return(k,x)=>m(l,k,x)};let i;const c=Rt,u=!mc.jitless,g=u&&ru.value,d=t.catchall;let p;e._zod.parse=(l,o)=>{p??(p=n.value);const h=l.value;return c(h)?u&&g&&(o==null?void 0:o.async)===!1&&o.jitless!==!0?(i||(i=r(t.shape)),l=i(l,o),d?qc([],h,l,o,p,e):l):a(l,o):(l.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),l)}});function si(e,t,a,n){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const r=e.filter(i=>!xt(i));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:a,errors:e.map(i=>i.issues.map(c=>ht(c,n,ut())))}),t)}const Bc=X("$ZodUnion",(e,t)=>{Me.init(e,t),ke(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),ke(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),ke(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),ke(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${r.map(i=>da(i.source)).join("|")})$`)}});const a=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(r,i)=>{if(a)return n(r,i);let c=!1;const u=[];for(const f of t.options){const g=f._zod.run({value:r.value,issues:[]},i);if(g instanceof Promise)u.push(g),c=!0;else{if(g.issues.length===0)return g;u.push(g)}}return c?Promise.all(u).then(f=>si(f,r,e,i)):si(u,r,e,i)}}),Uh=X("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Bc.init(e,t);const a=e._zod.parse;ke(e._zod,"propValues",()=>{const r={};for(const i of t.options){const c=i._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const[u,f]of Object.entries(c)){r[u]||(r[u]=new Set);for(const g of f)r[u].add(g)}}return r});const n=ar(()=>{var c;const r=t.options,i=new Map;for(const u of r){const f=(c=u._zod.propValues)==null?void 0:c[t.discriminator];if(!f||f.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(const g of f){if(i.has(g))throw new Error(`Duplicate discriminator value "${String(g)}"`);i.set(g,u)}}return i});e._zod.parse=(r,i)=>{const c=r.value;if(!Rt(c))return r.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),r;const u=n.value.get(c==null?void 0:c[t.discriminator]);return u?u._zod.run(r,i):t.unionFallback?a(r,i):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),r)}}),jh=X("$ZodIntersection",(e,t)=>{Me.init(e,t),e._zod.parse=(a,n)=>{const r=a.value,i=t.left._zod.run({value:r,issues:[]},n),c=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||c instanceof Promise?Promise.all([i,c]).then(([f,g])=>oi(a,f,g)):oi(a,i,c)}});function ca(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Tt(e)&&Tt(t)){const a=Object.keys(t),n=Object.keys(e).filter(i=>a.indexOf(i)!==-1),r={...e,...t};for(const i of n){const c=ca(e[i],t[i]);if(!c.valid)return{valid:!1,mergeErrorPath:[i,...c.mergeErrorPath]};r[i]=c.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const a=[];for(let n=0;n<e.length;n++){const r=e[n],i=t[n],c=ca(r,i);if(!c.valid)return{valid:!1,mergeErrorPath:[n,...c.mergeErrorPath]};a.push(c.data)}return{valid:!0,data:a}}return{valid:!1,mergeErrorPath:[]}}function oi(e,t,a){const n=new Map;let r;for(const u of t.issues)if(u.code==="unrecognized_keys"){r??(r=u);for(const f of u.keys)n.has(f)||n.set(f,{}),n.get(f).l=!0}else e.issues.push(u);for(const u of a.issues)if(u.code==="unrecognized_keys")for(const f of u.keys)n.has(f)||n.set(f,{}),n.get(f).r=!0;else e.issues.push(u);const i=[...n].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(i.length&&r&&e.issues.push({...r,keys:i}),xt(e))return e;const c=ca(t.value,a.value);if(!c.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`);return e.value=c.data,e}const Yh=X("$ZodRecord",(e,t)=>{Me.init(e,t),e._zod.parse=(a,n)=>{const r=a.value;if(!Tt(r))return a.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),a;const i=[],c=t.keyType._zod.values;if(c){a.value={};const u=new Set;for(const g of c)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){u.add(typeof g=="number"?g.toString():g);const d=t.valueType._zod.run({value:r[g],issues:[]},n);d instanceof Promise?i.push(d.then(p=>{p.issues.length&&a.issues.push(...Ct(g,p.issues)),a.value[g]=p.value})):(d.issues.length&&a.issues.push(...Ct(g,d.issues)),a.value[g]=d.value)}let f;for(const g in r)u.has(g)||(f=f??[],f.push(g));f&&f.length>0&&a.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:f})}else{a.value={};for(const u of Reflect.ownKeys(r)){if(u==="__proto__")continue;let f=t.keyType._zod.run({value:u,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&Ac.test(u)&&f.issues.length&&f.issues.some(p=>p.code==="invalid_type"&&p.expected==="number")){const p=t.keyType._zod.run({value:Number(u),issues:[]},n);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(f=p)}if(f.issues.length){t.mode==="loose"?a.value[u]=r[u]:a.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(p=>ht(p,n,ut())),input:u,path:[u],inst:e});continue}const d=t.valueType._zod.run({value:r[u],issues:[]},n);d instanceof Promise?i.push(d.then(p=>{p.issues.length&&a.issues.push(...Ct(u,p.issues)),a.value[f.value]=p.value})):(d.issues.length&&a.issues.push(...Ct(u,d.issues)),a.value[f.value]=d.value)}}return i.length?Promise.all(i).then(()=>a):a}}),Wh=X("$ZodEnum",(e,t)=>{Me.init(e,t);const a=bc(t.entries),n=new Set(a);e._zod.values=n,e._zod.pattern=new RegExp(`^(${a.filter(r=>nu.has(typeof r)).map(r=>typeof r=="string"?Et(r):r.toString()).join("|")})$`),e._zod.parse=(r,i)=>{const c=r.value;return n.has(c)||r.issues.push({code:"invalid_value",values:a,input:c,inst:e}),r}}),Vh=X("$ZodLiteral",(e,t)=>{if(Me.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const a=new Set(t.values);e._zod.values=a,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Et(n):n?Et(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,r)=>{const i=n.value;return a.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}}),Xh=X("$ZodTransform",(e,t)=>{Me.init(e,t),e._zod.parse=(a,n)=>{if(n.direction==="backward")throw new vc(e.constructor.name);const r=t.transform(a.value,a);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(c=>(a.value=c,a));if(r instanceof Promise)throw new St;return a.value=r,a}});function ci(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Lc=X("$ZodOptional",(e,t)=>{Me.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ke(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ke(e._zod,"pattern",()=>{const a=t.innerType._zod.pattern;return a?new RegExp(`^(${da(a.source)})?$`):void 0}),e._zod.parse=(a,n)=>{if(t.innerType._zod.optin==="optional"){const r=t.innerType._zod.run(a,n);return r instanceof Promise?r.then(i=>ci(i,a.value)):ci(r,a.value)}return a.value===void 0?a:t.innerType._zod.run(a,n)}}),Kh=X("$ZodExactOptional",(e,t)=>{Lc.init(e,t),ke(e._zod,"values",()=>t.innerType._zod.values),ke(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(a,n)=>t.innerType._zod.run(a,n)}),Jh=X("$ZodNullable",(e,t)=>{Me.init(e,t),ke(e._zod,"optin",()=>t.innerType._zod.optin),ke(e._zod,"optout",()=>t.innerType._zod.optout),ke(e._zod,"pattern",()=>{const a=t.innerType._zod.pattern;return a?new RegExp(`^(${da(a.source)}|null)$`):void 0}),ke(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(a,n)=>a.value===null?a:t.innerType._zod.run(a,n)}),Qh=X("$ZodDefault",(e,t)=>{Me.init(e,t),e._zod.optin="optional",ke(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(a,n)=>{if(n.direction==="backward")return t.innerType._zod.run(a,n);if(a.value===void 0)return a.value=t.defaultValue,a;const r=t.innerType._zod.run(a,n);return r instanceof Promise?r.then(i=>li(i,t)):li(r,t)}});function li(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const ef=X("$ZodPrefault",(e,t)=>{Me.init(e,t),e._zod.optin="optional",ke(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(a,n)=>(n.direction==="backward"||a.value===void 0&&(a.value=t.defaultValue),t.innerType._zod.run(a,n))}),tf=X("$ZodNonOptional",(e,t)=>{Me.init(e,t),ke(e._zod,"values",()=>{const a=t.innerType._zod.values;return a?new Set([...a].filter(n=>n!==void 0)):void 0}),e._zod.parse=(a,n)=>{const r=t.innerType._zod.run(a,n);return r instanceof Promise?r.then(i=>ui(i,e)):ui(r,e)}});function ui(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const rf=X("$ZodCatch",(e,t)=>{Me.init(e,t),ke(e._zod,"optin",()=>t.innerType._zod.optin),ke(e._zod,"optout",()=>t.innerType._zod.optout),ke(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(a,n)=>{if(n.direction==="backward")return t.innerType._zod.run(a,n);const r=t.innerType._zod.run(a,n);return r instanceof Promise?r.then(i=>(a.value=i.value,i.issues.length&&(a.value=t.catchValue({...a,error:{issues:i.issues.map(c=>ht(c,n,ut()))},input:a.value}),a.issues=[]),a)):(a.value=r.value,r.issues.length&&(a.value=t.catchValue({...a,error:{issues:r.issues.map(i=>ht(i,n,ut()))},input:a.value}),a.issues=[]),a)}}),nf=X("$ZodPipe",(e,t)=>{Me.init(e,t),ke(e._zod,"values",()=>t.in._zod.values),ke(e._zod,"optin",()=>t.in._zod.optin),ke(e._zod,"optout",()=>t.out._zod.optout),ke(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(a,n)=>{if(n.direction==="backward"){const i=t.out._zod.run(a,n);return i instanceof Promise?i.then(c=>Wt(c,t.in,n)):Wt(i,t.in,n)}const r=t.in._zod.run(a,n);return r instanceof Promise?r.then(i=>Wt(i,t.out,n)):Wt(r,t.out,n)}});function Wt(e,t,a){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},a)}const af=X("$ZodReadonly",(e,t)=>{Me.init(e,t),ke(e._zod,"propValues",()=>t.innerType._zod.propValues),ke(e._zod,"values",()=>t.innerType._zod.values),ke(e._zod,"optin",()=>{var a,n;return(n=(a=t.innerType)==null?void 0:a._zod)==null?void 0:n.optin}),ke(e._zod,"optout",()=>{var a,n;return(n=(a=t.innerType)==null?void 0:a._zod)==null?void 0:n.optout}),e._zod.parse=(a,n)=>{if(n.direction==="backward")return t.innerType._zod.run(a,n);const r=t.innerType._zod.run(a,n);return r instanceof Promise?r.then(hi):hi(r)}});function hi(e){return e.value=Object.freeze(e.value),e}const sf=X("$ZodCustom",(e,t)=>{We.init(e,t),Me.init(e,t),e._zod.parse=(a,n)=>a,e._zod.check=a=>{const n=a.value,r=t.fn(n);if(r instanceof Promise)return r.then(i=>fi(i,a,n,e));fi(r,a,n,e)}});function fi(e,t,a,n){if(!e){const r={code:"custom",input:a,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(r.params=n._zod.def.params),t.issues.push(qt(r))}}var di;class of{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...a){const n=a[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const a=this._map.get(t);return a&&typeof a=="object"&&"id"in a&&this._idmap.delete(a.id),this._map.delete(t),this}get(t){const a=t._zod.parent;if(a){const n={...this.get(a)??{}};delete n.id;const r={...n,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function cf(){return new of}(di=globalThis).__zod_globalRegistry??(di.__zod_globalRegistry=cf());const It=globalThis.__zod_globalRegistry;function lf(e,t){return new e({type:"string",...se(t)})}function uf(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...se(t)})}function pi(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...se(t)})}function hf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...se(t)})}function ff(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...se(t)})}function df(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...se(t)})}function pf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...se(t)})}function gf(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...se(t)})}function vf(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...se(t)})}function mf(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...se(t)})}function bf(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...se(t)})}function yf(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...se(t)})}function wf(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...se(t)})}function _f(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...se(t)})}function kf(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...se(t)})}function xf(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...se(t)})}function Cf(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...se(t)})}function Sf(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...se(t)})}function Tf(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...se(t)})}function Ef(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...se(t)})}function Af(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...se(t)})}function Mf(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...se(t)})}function Nf(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...se(t)})}function Pf(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...se(t)})}function zf(e,t){return new e({type:"string",format:"date",check:"string_format",...se(t)})}function If(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...se(t)})}function Rf(e,t){return new e({type:"string",format:"duration",check:"string_format",...se(t)})}function qf(e,t){return new e({type:"number",checks:[],...se(t)})}function Bf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...se(t)})}function Lf(e,t){return new e({type:"boolean",...se(t)})}function Of(e,t){return new e({type:"undefined",...se(t)})}function Df(e,t){return new e({type:"null",...se(t)})}function Ff(e){return new e({type:"unknown"})}function Hf(e,t){return new e({type:"never",...se(t)})}function gi(e,t){return new Nc({check:"less_than",...se(t),value:e,inclusive:!1})}function gr(e,t){return new Nc({check:"less_than",...se(t),value:e,inclusive:!0})}function vi(e,t){return new Pc({check:"greater_than",...se(t),value:e,inclusive:!1})}function vr(e,t){return new Pc({check:"greater_than",...se(t),value:e,inclusive:!0})}function mi(e,t){return new Ku({check:"multiple_of",...se(t),value:e})}function Oc(e,t){return new Qu({check:"max_length",...se(t),maximum:e})}function er(e,t){return new eh({check:"min_length",...se(t),minimum:e})}function Dc(e,t){return new th({check:"length_equals",...se(t),length:e})}function $f(e,t){return new rh({check:"string_format",format:"regex",...se(t),pattern:e})}function Zf(e){return new nh({check:"string_format",format:"lowercase",...se(e)})}function Gf(e){return new ah({check:"string_format",format:"uppercase",...se(e)})}function Uf(e,t){return new ih({check:"string_format",format:"includes",...se(t),includes:e})}function jf(e,t){return new sh({check:"string_format",format:"starts_with",...se(t),prefix:e})}function Yf(e,t){return new oh({check:"string_format",format:"ends_with",...se(t),suffix:e})}function Mt(e){return new ch({check:"overwrite",tx:e})}function Wf(e){return Mt(t=>t.normalize(e))}function Vf(){return Mt(e=>e.trim())}function Xf(){return Mt(e=>e.toLowerCase())}function Kf(){return Mt(e=>e.toUpperCase())}function Jf(){return Mt(e=>tu(e))}function Qf(e,t,a){return new e({type:"array",element:t,...se(a)})}function e1(e,t,a){const n=se(a);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function t1(e,t,a){return new e({type:"custom",check:"custom",fn:t,...se(a)})}function r1(e){const t=n1(a=>(a.addIssue=n=>{if(typeof n=="string")a.issues.push(qt(n,a.value,t._zod.def));else{const r=n;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=a.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),a.issues.push(qt(r))}},e(a.value,a)));return t}function n1(e,t){const a=new We({check:"custom",...se(t)});return a._zod.check=e,a}function Fc(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??It,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function Le(e,t,a={path:[],schemaPath:[]}){var d,p;var n;const r=e._zod.def,i=t.seen.get(e);if(i)return i.count++,a.schemaPath.includes(e)&&(i.cycle=a.path),i.schema;const c={schema:{},count:1,cycle:void 0,path:a.path};t.seen.set(e,c);const u=(p=(d=e._zod).toJSONSchema)==null?void 0:p.call(d);if(u)c.schema=u;else{const l={...a,schemaPath:[...a.schemaPath,e],path:a.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,c.schema,l);else{const h=c.schema,s=t.processors[r.type];if(!s)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);s(e,t,h,l)}const o=e._zod.parent;o&&(c.ref||(c.ref=o),Le(o,t,l),t.seen.get(o).isParent=!0)}const f=t.metadataRegistry.get(e);return f&&Object.assign(c.schema,f),t.io==="input"&&je(e)&&(delete c.schema.examples,delete c.schema.default),t.io==="input"&&c.schema._prefault&&((n=c.schema).default??(n.default=c.schema._prefault)),delete c.schema._prefault,t.seen.get(e).schema}function Hc(e,t){var c,u,f,g;const a=e.seen.get(t);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const d of e.seen.entries()){const p=(c=e.metadataRegistry.get(d[0]))==null?void 0:c.id;if(p){const l=n.get(p);if(l&&l!==d[0])throw new Error(`Duplicate schema id "${p}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(p,d[0])}}const r=d=>{var s;const p=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const v=(s=e.external.registry.get(d[0]))==null?void 0:s.id,y=e.external.uri??(_=>_);if(v)return{ref:y(v)};const m=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=m,{defId:m,ref:`${y("__shared")}#/${p}/${m}`}}if(d[1]===a)return{ref:"#"};const o=`#/${p}/`,h=d[1].schema.id??`__schema${e.counter++}`;return{defId:h,ref:o+h}},i=d=>{if(d[1].schema.$ref)return;const p=d[1],{ref:l,defId:o}=r(d);p.def={...p.schema},o&&(p.defId=o);const h=p.schema;for(const s in h)delete h[s];h.$ref=l};if(e.cycles==="throw")for(const d of e.seen.entries()){const p=d[1];if(p.cycle)throw new Error(`Cycle detected: #/${(u=p.cycle)==null?void 0:u.join("/")}/<root>
|
|
45
45
|
|
|
46
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const p=d[1];if(t===d[0]){i(d);continue}if(e.external){const o=(f=e.external.registry.get(d[0]))==null?void 0:f.id;if(t!==d[0]&&o){i(d);continue}}if((g=e.metadataRegistry.get(d[0]))==null?void 0:g.id){i(d);continue}if(p.cycle){i(d);continue}if(p.count>1&&e.reused==="ref"){i(d);continue}}}function $c(e,t){var c,u,f;const a=e.seen.get(t);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=g=>{const d=e.seen.get(g);if(d.ref===null)return;const p=d.def??d.schema,l={...p},o=d.ref;if(d.ref=null,o){n(o);const s=e.seen.get(o),v=s.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(v)):Object.assign(p,v),Object.assign(p,l),g._zod.parent===o)for(const m in p)m==="$ref"||m==="allOf"||m in l||delete p[m];if(v.$ref)for(const m in p)m==="$ref"||m==="allOf"||m in s.def&&JSON.stringify(p[m])===JSON.stringify(s.def[m])&&delete p[m]}const h=g._zod.parent;if(h&&h!==o){n(h);const s=e.seen.get(h);if(s!=null&&s.schema.$ref&&(p.$ref=s.schema.$ref,s.def))for(const v in p)v==="$ref"||v==="allOf"||v in s.def&&JSON.stringify(p[v])===JSON.stringify(s.def[v])&&delete p[v]}e.override({zodSchema:g,jsonSchema:p,path:d.path??[]})};for(const g of[...e.seen.entries()].reverse())n(g[0]);const r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,(c=e.external)!=null&&c.uri){const g=(u=e.external.registry.get(t))==null?void 0:u.id;if(!g)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(g)}Object.assign(r,a.def??a.schema);const i=((f=e.external)==null?void 0:f.defs)??{};for(const g of e.seen.entries()){const d=g[1];d.def&&d.defId&&(i[d.defId]=d.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?r.$defs=i:r.definitions=i);try{const g=JSON.parse(JSON.stringify(r));return Object.defineProperty(g,"~standard",{value:{...t["~standard"],jsonSchema:{input:tr(t,"input",e.processors),output:tr(t,"output",e.processors)}},enumerable:!1,writable:!1}),g}catch{throw new Error("Error converting schema to JSON.")}}function je(e,t){const a=t??{seen:new Set};if(a.seen.has(e))return!1;a.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return je(n.element,a);if(n.type==="set")return je(n.valueType,a);if(n.type==="lazy")return je(n.getter(),a);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return je(n.innerType,a);if(n.type==="intersection")return je(n.left,a)||je(n.right,a);if(n.type==="record"||n.type==="map")return je(n.keyType,a)||je(n.valueType,a);if(n.type==="pipe")return je(n.in,a)||je(n.out,a);if(n.type==="object"){for(const r in n.shape)if(je(n.shape[r],a))return!0;return!1}if(n.type==="union"){for(const r of n.options)if(je(r,a))return!0;return!1}if(n.type==="tuple"){for(const r of n.items)if(je(r,a))return!0;return!!(n.rest&&je(n.rest,a))}return!1}const a1=(e,t={})=>a=>{const n=Fc({...a,processors:t});return Le(e,n),Hc(n,e),$c(n,e)},tr=(e,t,a={})=>n=>{const{libraryOptions:r,target:i}=n??{},c=Fc({...r??{},target:i,io:t,processors:a});return Le(e,c),Hc(c,e),$c(c,e)},i1={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},s1=(e,t,a,n)=>{const r=a;r.type="string";const{minimum:i,maximum:c,format:u,patterns:f,contentEncoding:g}=e._zod.bag;if(typeof i=="number"&&(r.minLength=i),typeof c=="number"&&(r.maxLength=c),u&&(r.format=i1[u]??u,r.format===""&&delete r.format,u==="time"&&delete r.format),g&&(r.contentEncoding=g),f&&f.size>0){const d=[...f];d.length===1?r.pattern=d[0].source:d.length>1&&(r.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},o1=(e,t,a,n)=>{const r=a,{minimum:i,maximum:c,format:u,multipleOf:f,exclusiveMaximum:g,exclusiveMinimum:d}=e._zod.bag;typeof u=="string"&&u.includes("int")?r.type="integer":r.type="number",typeof d=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.minimum=d,r.exclusiveMinimum=!0):r.exclusiveMinimum=d),typeof i=="number"&&(r.minimum=i,typeof d=="number"&&t.target!=="draft-04"&&(d>=i?delete r.minimum:delete r.exclusiveMinimum)),typeof g=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.maximum=g,r.exclusiveMaximum=!0):r.exclusiveMaximum=g),typeof c=="number"&&(r.maximum=c,typeof g=="number"&&t.target!=="draft-04"&&(g<=c?delete r.maximum:delete r.exclusiveMaximum)),typeof f=="number"&&(r.multipleOf=f)},c1=(e,t,a,n)=>{a.type="boolean"},l1=(e,t,a,n)=>{t.target==="openapi-3.0"?(a.type="string",a.nullable=!0,a.enum=[null]):a.type="null"},u1=(e,t,a,n)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},h1=(e,t,a,n)=>{a.not={}},f1=(e,t,a,n)=>{},d1=(e,t,a,n)=>{const r=e._zod.def,i=bc(r.entries);i.every(c=>typeof c=="number")&&(a.type="number"),i.every(c=>typeof c=="string")&&(a.type="string"),a.enum=i},p1=(e,t,a,n)=>{const r=e._zod.def,i=[];for(const c of r.values)if(c===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof c=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(c))}else i.push(c);if(i.length!==0)if(i.length===1){const c=i[0];a.type=c===null?"null":typeof c,t.target==="draft-04"||t.target==="openapi-3.0"?a.enum=[c]:a.const=c}else i.every(c=>typeof c=="number")&&(a.type="number"),i.every(c=>typeof c=="string")&&(a.type="string"),i.every(c=>typeof c=="boolean")&&(a.type="boolean"),i.every(c=>c===null)&&(a.type="null"),a.enum=i},g1=(e,t,a,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},v1=(e,t,a,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},m1=(e,t,a,n)=>{const r=a,i=e._zod.def,{minimum:c,maximum:u}=e._zod.bag;typeof c=="number"&&(r.minItems=c),typeof u=="number"&&(r.maxItems=u),r.type="array",r.items=Le(i.element,t,{...n,path:[...n.path,"items"]})},b1=(e,t,a,n)=>{var g;const r=a,i=e._zod.def;r.type="object",r.properties={};const c=i.shape;for(const d in c)r.properties[d]=Le(c[d],t,{...n,path:[...n.path,"properties",d]});const u=new Set(Object.keys(c)),f=new Set([...u].filter(d=>{const p=i.shape[d]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));f.size>0&&(r.required=Array.from(f)),((g=i.catchall)==null?void 0:g._zod.def.type)==="never"?r.additionalProperties=!1:i.catchall?i.catchall&&(r.additionalProperties=Le(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},y1=(e,t,a,n)=>{const r=e._zod.def,i=r.inclusive===!1,c=r.options.map((u,f)=>Le(u,t,{...n,path:[...n.path,i?"oneOf":"anyOf",f]}));i?a.oneOf=c:a.anyOf=c},w1=(e,t,a,n)=>{const r=e._zod.def,i=Le(r.left,t,{...n,path:[...n.path,"allOf",0]}),c=Le(r.right,t,{...n,path:[...n.path,"allOf",1]}),u=g=>"allOf"in g&&Object.keys(g).length===1,f=[...u(i)?i.allOf:[i],...u(c)?c.allOf:[c]];a.allOf=f},_1=(e,t,a,n)=>{const r=a,i=e._zod.def;r.type="object";const c=i.keyType,u=c._zod.bag,f=u==null?void 0:u.patterns;if(i.mode==="loose"&&f&&f.size>0){const d=Le(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});r.patternProperties={};for(const p of f)r.patternProperties[p.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(r.propertyNames=Le(i.keyType,t,{...n,path:[...n.path,"propertyNames"]})),r.additionalProperties=Le(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]});const g=c._zod.values;if(g){const d=[...g].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(r.required=d)}},k1=(e,t,a,n)=>{const r=e._zod.def,i=Le(r.innerType,t,n),c=t.seen.get(e);t.target==="openapi-3.0"?(c.ref=r.innerType,a.nullable=!0):a.anyOf=[i,{type:"null"}]},x1=(e,t,a,n)=>{const r=e._zod.def;Le(r.innerType,t,n);const i=t.seen.get(e);i.ref=r.innerType},C1=(e,t,a,n)=>{const r=e._zod.def;Le(r.innerType,t,n);const i=t.seen.get(e);i.ref=r.innerType,a.default=JSON.parse(JSON.stringify(r.defaultValue))},S1=(e,t,a,n)=>{const r=e._zod.def;Le(r.innerType,t,n);const i=t.seen.get(e);i.ref=r.innerType,t.io==="input"&&(a._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},T1=(e,t,a,n)=>{const r=e._zod.def;Le(r.innerType,t,n);const i=t.seen.get(e);i.ref=r.innerType;let c;try{c=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}a.default=c},E1=(e,t,a,n)=>{const r=e._zod.def,i=t.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;Le(i,t,n);const c=t.seen.get(e);c.ref=i},A1=(e,t,a,n)=>{const r=e._zod.def;Le(r.innerType,t,n);const i=t.seen.get(e);i.ref=r.innerType,a.readOnly=!0},Zc=(e,t,a,n)=>{const r=e._zod.def;Le(r.innerType,t,n);const i=t.seen.get(e);i.ref=r.innerType};function ba(e){return!!e._zod}function Gc(e,t){return ba(e)?Cc(e,t):e.safeParse(t)}function M1(e){var a,n;if(!e)return;let t;if(ba(e)?t=(n=(a=e._zod)==null?void 0:a.def)==null?void 0:n.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function N1(e){var r;if(ba(e)){const c=(r=e._zod)==null?void 0:r.def;if(c){if(c.value!==void 0)return c.value;if(Array.isArray(c.values)&&c.values.length>0)return c.values[0]}}const a=e._def;if(a){if(a.value!==void 0)return a.value;if(Array.isArray(a.values)&&a.values.length>0)return a.values[0]}const n=e.value;if(n!==void 0)return n}const P1=X("ZodISODateTime",(e,t)=>{kh.init(e,t),Ie.init(e,t)});function Uc(e){return Pf(P1,e)}const z1=X("ZodISODate",(e,t)=>{xh.init(e,t),Ie.init(e,t)});function I1(e){return zf(z1,e)}const R1=X("ZodISOTime",(e,t)=>{Ch.init(e,t),Ie.init(e,t)});function q1(e){return If(R1,e)}const B1=X("ZodISODuration",(e,t)=>{Sh.init(e,t),Ie.init(e,t)});function L1(e){return Rf(B1,e)}const O1=(e,t)=>{kc.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:a=>pu(e,a)},flatten:{value:a=>du(e,a)},addIssue:{value:a=>{e.issues.push(a),e.message=JSON.stringify(e.issues,oa,2)}},addIssues:{value:a=>{e.issues.push(...a),e.message=JSON.stringify(e.issues,oa,2)}},isEmpty:{get(){return e.issues.length===0}}})},Qe=X("ZodError",O1,{Parent:Error}),D1=ga(Qe),F1=va(Qe),H1=ir(Qe),$1=sr(Qe),Z1=vu(Qe),G1=mu(Qe),U1=bu(Qe),j1=yu(Qe),Y1=wu(Qe),W1=_u(Qe),V1=ku(Qe),X1=xu(Qe),Ne=X("ZodType",(e,t)=>(Me.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:tr(e,"input"),output:tr(e,"output")}}),e.toJSONSchema=a1(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...a)=>e.clone(ft(t,{checks:[...t.checks??[],...a.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(a,n)=>dt(e,a,n),e.brand=()=>e,e.register=((a,n)=>(a.add(e,n),e)),e.parse=(a,n)=>D1(e,a,n,{callee:e.parse}),e.safeParse=(a,n)=>H1(e,a,n),e.parseAsync=async(a,n)=>F1(e,a,n,{callee:e.parseAsync}),e.safeParseAsync=async(a,n)=>$1(e,a,n),e.spa=e.safeParseAsync,e.encode=(a,n)=>Z1(e,a,n),e.decode=(a,n)=>G1(e,a,n),e.encodeAsync=async(a,n)=>U1(e,a,n),e.decodeAsync=async(a,n)=>j1(e,a,n),e.safeEncode=(a,n)=>Y1(e,a,n),e.safeDecode=(a,n)=>W1(e,a,n),e.safeEncodeAsync=async(a,n)=>V1(e,a,n),e.safeDecodeAsync=async(a,n)=>X1(e,a,n),e.refine=(a,n)=>e.check($d(a,n)),e.superRefine=a=>e.check(Zd(a)),e.overwrite=a=>e.check(Mt(a)),e.optional=()=>Be(e),e.exactOptional=()=>Md(e),e.nullable=()=>wi(e),e.nullish=()=>Be(wi(e)),e.nonoptional=a=>qd(e,a),e.array=()=>fe(e),e.or=a=>ye([e,a]),e.and=a=>ya(e,a),e.transform=a=>ha(e,Jc(a)),e.default=a=>zd(e,a),e.prefault=a=>Rd(e,a),e.catch=a=>Ld(e,a),e.pipe=a=>ha(e,a),e.readonly=()=>Fd(e),e.describe=a=>{const n=e.clone();return It.add(n,{description:a}),n},Object.defineProperty(e,"description",{get(){var a;return(a=It.get(e))==null?void 0:a.description},configurable:!0}),e.meta=(...a)=>{if(a.length===0)return It.get(e);const n=e.clone();return It.add(n,a[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=a=>a(e),e)),jc=X("_ZodString",(e,t)=>{ma.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,r,i)=>s1(e,n,r);const a=e._zod.bag;e.format=a.format??null,e.minLength=a.minimum??null,e.maxLength=a.maximum??null,e.regex=(...n)=>e.check($f(...n)),e.includes=(...n)=>e.check(Uf(...n)),e.startsWith=(...n)=>e.check(jf(...n)),e.endsWith=(...n)=>e.check(Yf(...n)),e.min=(...n)=>e.check(er(...n)),e.max=(...n)=>e.check(Oc(...n)),e.length=(...n)=>e.check(Dc(...n)),e.nonempty=(...n)=>e.check(er(1,...n)),e.lowercase=n=>e.check(Zf(n)),e.uppercase=n=>e.check(Gf(n)),e.trim=()=>e.check(Vf()),e.normalize=(...n)=>e.check(Wf(...n)),e.toLowerCase=()=>e.check(Xf()),e.toUpperCase=()=>e.check(Kf()),e.slugify=()=>e.check(Jf())}),K1=X("ZodString",(e,t)=>{ma.init(e,t),jc.init(e,t),e.email=a=>e.check(uf(J1,a)),e.url=a=>e.check(gf(Q1,a)),e.jwt=a=>e.check(Nf(pd,a)),e.emoji=a=>e.check(vf(ed,a)),e.guid=a=>e.check(pi(bi,a)),e.uuid=a=>e.check(hf(Vt,a)),e.uuidv4=a=>e.check(ff(Vt,a)),e.uuidv6=a=>e.check(df(Vt,a)),e.uuidv7=a=>e.check(pf(Vt,a)),e.nanoid=a=>e.check(mf(td,a)),e.guid=a=>e.check(pi(bi,a)),e.cuid=a=>e.check(bf(rd,a)),e.cuid2=a=>e.check(yf(nd,a)),e.ulid=a=>e.check(wf(ad,a)),e.base64=a=>e.check(Ef(hd,a)),e.base64url=a=>e.check(Af(fd,a)),e.xid=a=>e.check(_f(id,a)),e.ksuid=a=>e.check(kf(sd,a)),e.ipv4=a=>e.check(xf(od,a)),e.ipv6=a=>e.check(Cf(cd,a)),e.cidrv4=a=>e.check(Sf(ld,a)),e.cidrv6=a=>e.check(Tf(ud,a)),e.e164=a=>e.check(Mf(dd,a)),e.datetime=a=>e.check(Uc(a)),e.date=a=>e.check(I1(a)),e.time=a=>e.check(q1(a)),e.duration=a=>e.check(L1(a))});function U(e){return lf(K1,e)}const Ie=X("ZodStringFormat",(e,t)=>{Pe.init(e,t),jc.init(e,t)}),J1=X("ZodEmail",(e,t)=>{dh.init(e,t),Ie.init(e,t)}),bi=X("ZodGUID",(e,t)=>{hh.init(e,t),Ie.init(e,t)}),Vt=X("ZodUUID",(e,t)=>{fh.init(e,t),Ie.init(e,t)}),Q1=X("ZodURL",(e,t)=>{ph.init(e,t),Ie.init(e,t)}),ed=X("ZodEmoji",(e,t)=>{gh.init(e,t),Ie.init(e,t)}),td=X("ZodNanoID",(e,t)=>{vh.init(e,t),Ie.init(e,t)}),rd=X("ZodCUID",(e,t)=>{mh.init(e,t),Ie.init(e,t)}),nd=X("ZodCUID2",(e,t)=>{bh.init(e,t),Ie.init(e,t)}),ad=X("ZodULID",(e,t)=>{yh.init(e,t),Ie.init(e,t)}),id=X("ZodXID",(e,t)=>{wh.init(e,t),Ie.init(e,t)}),sd=X("ZodKSUID",(e,t)=>{_h.init(e,t),Ie.init(e,t)}),od=X("ZodIPv4",(e,t)=>{Th.init(e,t),Ie.init(e,t)}),cd=X("ZodIPv6",(e,t)=>{Eh.init(e,t),Ie.init(e,t)}),ld=X("ZodCIDRv4",(e,t)=>{Ah.init(e,t),Ie.init(e,t)}),ud=X("ZodCIDRv6",(e,t)=>{Mh.init(e,t),Ie.init(e,t)}),hd=X("ZodBase64",(e,t)=>{Nh.init(e,t),Ie.init(e,t)}),fd=X("ZodBase64URL",(e,t)=>{zh.init(e,t),Ie.init(e,t)}),dd=X("ZodE164",(e,t)=>{Ih.init(e,t),Ie.init(e,t)}),pd=X("ZodJWT",(e,t)=>{qh.init(e,t),Ie.init(e,t)}),Yc=X("ZodNumber",(e,t)=>{Ic.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,r,i)=>o1(e,n,r),e.gt=(n,r)=>e.check(vi(n,r)),e.gte=(n,r)=>e.check(vr(n,r)),e.min=(n,r)=>e.check(vr(n,r)),e.lt=(n,r)=>e.check(gi(n,r)),e.lte=(n,r)=>e.check(gr(n,r)),e.max=(n,r)=>e.check(gr(n,r)),e.int=n=>e.check(yi(n)),e.safe=n=>e.check(yi(n)),e.positive=n=>e.check(vi(0,n)),e.nonnegative=n=>e.check(vr(0,n)),e.negative=n=>e.check(gi(0,n)),e.nonpositive=n=>e.check(gr(0,n)),e.multipleOf=(n,r)=>e.check(mi(n,r)),e.step=(n,r)=>e.check(mi(n,r)),e.finite=()=>e;const a=e._zod.bag;e.minValue=Math.max(a.minimum??Number.NEGATIVE_INFINITY,a.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(a.maximum??Number.POSITIVE_INFINITY,a.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(a.format??"").includes("int")||Number.isSafeInteger(a.multipleOf??.5),e.isFinite=!0,e.format=a.format??null});function me(e){return qf(Yc,e)}const gd=X("ZodNumberFormat",(e,t)=>{Bh.init(e,t),Yc.init(e,t)});function yi(e){return Bf(gd,e)}const vd=X("ZodBoolean",(e,t)=>{Lh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>c1(e,a,n)});function Ae(e){return Lf(vd,e)}const md=X("ZodUndefined",(e,t)=>{Oh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>u1(e,a)});function la(e){return Of(md,e)}const bd=X("ZodNull",(e,t)=>{Dh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>l1(e,a,n)});function Wc(e){return Df(bd,e)}const yd=X("ZodUnknown",(e,t)=>{Fh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>f1()});function Te(){return Ff(yd)}const wd=X("ZodNever",(e,t)=>{Hh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>h1(e,a,n)});function _d(e){return Hf(wd,e)}const kd=X("ZodArray",(e,t)=>{$h.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>m1(e,a,n,r),e.element=t.element,e.min=(a,n)=>e.check(er(a,n)),e.nonempty=a=>e.check(er(1,a)),e.max=(a,n)=>e.check(Oc(a,n)),e.length=(a,n)=>e.check(Dc(a,n)),e.unwrap=()=>e.element});function fe(e,t){return Qf(kd,e,t)}const Vc=X("ZodObject",(e,t)=>{Gh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>b1(e,a,n,r),ke(e,"shape",()=>t.shape),e.keyof=()=>Ke(Object.keys(e._zod.def.shape)),e.catchall=a=>e.clone({...e._zod.def,catchall:a}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Te()}),e.loose=()=>e.clone({...e._zod.def,catchall:Te()}),e.strict=()=>e.clone({...e._zod.def,catchall:_d()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=a=>cu(e,a),e.safeExtend=a=>lu(e,a),e.merge=a=>uu(e,a),e.pick=a=>su(e,a),e.omit=a=>ou(e,a),e.partial=(...a)=>hu(Qc,e,a[0]),e.required=(...a)=>fu(el,e,a[0])});function Y(e,t){const a={type:"object",shape:e??{},...se(t)};return new Vc(a)}function Ye(e,t){return new Vc({type:"object",shape:e,catchall:Te(),...se(t)})}const Xc=X("ZodUnion",(e,t)=>{Bc.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>y1(e,a,n,r),e.options=t.options});function ye(e,t){return new Xc({type:"union",options:e,...se(t)})}const xd=X("ZodDiscriminatedUnion",(e,t)=>{Xc.init(e,t),Uh.init(e,t)});function Kc(e,t,a){return new xd({type:"union",options:t,discriminator:e,...se(a)})}const Cd=X("ZodIntersection",(e,t)=>{jh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>w1(e,a,n,r)});function ya(e,t){return new Cd({type:"intersection",left:e,right:t})}const Sd=X("ZodRecord",(e,t)=>{Yh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>_1(e,a,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Ce(e,t,a){return new Sd({type:"record",keyType:e,valueType:t,...se(a)})}const ua=X("ZodEnum",(e,t)=>{Wh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,r,i)=>d1(e,n,r),e.enum=t.entries,e.options=Object.values(t.entries);const a=new Set(Object.keys(t.entries));e.extract=(n,r)=>{const i={};for(const c of n)if(a.has(c))i[c]=t.entries[c];else throw new Error(`Key ${c} not found in enum`);return new ua({...t,checks:[],...se(r),entries:i})},e.exclude=(n,r)=>{const i={...t.entries};for(const c of n)if(a.has(c))delete i[c];else throw new Error(`Key ${c} not found in enum`);return new ua({...t,checks:[],...se(r),entries:i})}});function Ke(e,t){const a=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new ua({type:"enum",entries:a,...se(t)})}const Td=X("ZodLiteral",(e,t)=>{Vh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>p1(e,a,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function G(e,t){return new Td({type:"literal",values:Array.isArray(e)?e:[e],...se(t)})}const Ed=X("ZodTransform",(e,t)=>{Xh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>v1(e,a),e._zod.parse=(a,n)=>{if(n.direction==="backward")throw new vc(e.constructor.name);a.addIssue=i=>{if(typeof i=="string")a.issues.push(qt(i,a.value,t));else{const c=i;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=a.value),c.inst??(c.inst=e),a.issues.push(qt(c))}};const r=t.transform(a.value,a);return r instanceof Promise?r.then(i=>(a.value=i,a)):(a.value=r,a)}});function Jc(e){return new Ed({type:"transform",transform:e})}const Qc=X("ZodOptional",(e,t)=>{Lc.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>Zc(e,a,n,r),e.unwrap=()=>e._zod.def.innerType});function Be(e){return new Qc({type:"optional",innerType:e})}const Ad=X("ZodExactOptional",(e,t)=>{Kh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>Zc(e,a,n,r),e.unwrap=()=>e._zod.def.innerType});function Md(e){return new Ad({type:"optional",innerType:e})}const Nd=X("ZodNullable",(e,t)=>{Jh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>k1(e,a,n,r),e.unwrap=()=>e._zod.def.innerType});function wi(e){return new Nd({type:"nullable",innerType:e})}const Pd=X("ZodDefault",(e,t)=>{Qh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>C1(e,a,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function zd(e,t){return new Pd({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():wc(t)}})}const Id=X("ZodPrefault",(e,t)=>{ef.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>S1(e,a,n,r),e.unwrap=()=>e._zod.def.innerType});function Rd(e,t){return new Id({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():wc(t)}})}const el=X("ZodNonOptional",(e,t)=>{tf.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>x1(e,a,n,r),e.unwrap=()=>e._zod.def.innerType});function qd(e,t){return new el({type:"nonoptional",innerType:e,...se(t)})}const Bd=X("ZodCatch",(e,t)=>{rf.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>T1(e,a,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ld(e,t){return new Bd({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Od=X("ZodPipe",(e,t)=>{nf.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>E1(e,a,n,r),e.in=t.in,e.out=t.out});function ha(e,t){return new Od({type:"pipe",in:e,out:t})}const Dd=X("ZodReadonly",(e,t)=>{af.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>A1(e,a,n,r),e.unwrap=()=>e._zod.def.innerType});function Fd(e){return new Dd({type:"readonly",innerType:e})}const tl=X("ZodCustom",(e,t)=>{sf.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>g1(e,a)});function Hd(e,t){return e1(tl,e??(()=>!0),t)}function $d(e,t={}){return t1(tl,e,t)}function Zd(e){return r1(e)}function rl(e,t){return ha(Jc(e),t)}const yt="io.modelcontextprotocol/related-task",cr="2.0",De=Hd(e=>e!==null&&(typeof e=="object"||typeof e=="function")),nl=ye([U(),me().int()]),al=U();Ye({ttl:ye([me(),Wc()]).optional(),pollInterval:me().optional()});const Gd=Y({ttl:me().optional()}),Ud=Y({taskId:U()}),wa=Ye({progressToken:nl.optional(),[yt]:Ud.optional()}),Je=Y({_meta:wa.optional()}),Ot=Je.extend({task:Gd.optional()}),jd=e=>Ot.safeParse(e).success,Fe=Y({method:U(),params:Je.loose().optional()}),et=Y({_meta:wa.optional()}),tt=Y({method:U(),params:et.loose().optional()}),He=Ye({_meta:wa.optional()}),Dt=ye([U(),me().int()]),il=Y({jsonrpc:G(cr),id:Dt,...Fe.shape}).strict(),_i=e=>il.safeParse(e).success,sl=Y({jsonrpc:G(cr),...tt.shape}).strict(),Yd=e=>sl.safeParse(e).success,_a=Y({jsonrpc:G(cr),id:Dt,result:He}).strict(),Xt=e=>_a.safeParse(e).success;var xe;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(xe||(xe={}));const ka=Y({jsonrpc:G(cr),id:Dt.optional(),error:Y({code:me().int(),message:U(),data:Te().optional()})}).strict(),Wd=e=>ka.safeParse(e).success,Vd=ye([il,sl,_a,ka]);ye([_a,ka]);const xa=He.strict(),Xd=et.extend({requestId:Dt.optional(),reason:U().optional()}),Ca=tt.extend({method:G("notifications/cancelled"),params:Xd}),Kd=Y({src:U(),mimeType:U().optional(),sizes:fe(U()).optional(),theme:Ke(["light","dark"]).optional()}),Ft=Y({icons:fe(Kd).optional()}),At=Y({name:U(),title:U().optional()}),lr=At.extend({...At.shape,...Ft.shape,version:U(),websiteUrl:U().optional(),description:U().optional()}),Jd=ya(Y({applyDefaults:Ae().optional()}),Ce(U(),Te())),Qd=rl(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ya(Y({form:Jd.optional(),url:De.optional()}),Ce(U(),Te()).optional())),ep=Ye({list:De.optional(),cancel:De.optional(),requests:Ye({sampling:Ye({createMessage:De.optional()}).optional(),elicitation:Ye({create:De.optional()}).optional()}).optional()}),tp=Ye({list:De.optional(),cancel:De.optional(),requests:Ye({tools:Ye({call:De.optional()}).optional()}).optional()}),rp=Y({experimental:Ce(U(),De).optional(),sampling:Y({context:De.optional(),tools:De.optional()}).optional(),elicitation:Qd.optional(),roots:Y({listChanged:Ae().optional()}).optional(),tasks:ep.optional()}),np=Je.extend({protocolVersion:U(),capabilities:rp,clientInfo:lr}),ap=Fe.extend({method:G("initialize"),params:np}),ip=Y({experimental:Ce(U(),De).optional(),logging:De.optional(),completions:De.optional(),prompts:Y({listChanged:Ae().optional()}).optional(),resources:Y({subscribe:Ae().optional(),listChanged:Ae().optional()}).optional(),tools:Y({listChanged:Ae().optional()}).optional(),tasks:tp.optional()}),sp=He.extend({protocolVersion:U(),capabilities:ip,serverInfo:lr,instructions:U().optional()}),op=tt.extend({method:G("notifications/initialized"),params:et.optional()}),ur=Fe.extend({method:G("ping"),params:Je.optional()}),cp=Y({progress:me(),total:Be(me()),message:Be(U())}),lp=Y({...et.shape,...cp.shape,progressToken:nl}),Sa=tt.extend({method:G("notifications/progress"),params:lp}),up=Je.extend({cursor:al.optional()}),Ht=Fe.extend({params:up.optional()}),$t=He.extend({nextCursor:al.optional()}),hp=Ke(["working","input_required","completed","failed","cancelled"]),Zt=Y({taskId:U(),status:hp,ttl:ye([me(),Wc()]),createdAt:U(),lastUpdatedAt:U(),pollInterval:Be(me()),statusMessage:Be(U())}),Ta=He.extend({task:Zt}),fp=et.merge(Zt),rr=tt.extend({method:G("notifications/tasks/status"),params:fp}),Ea=Fe.extend({method:G("tasks/get"),params:Je.extend({taskId:U()})}),Aa=He.merge(Zt),Ma=Fe.extend({method:G("tasks/result"),params:Je.extend({taskId:U()})});He.loose();const Na=Ht.extend({method:G("tasks/list")}),Pa=$t.extend({tasks:fe(Zt)}),za=Fe.extend({method:G("tasks/cancel"),params:Je.extend({taskId:U()})}),dp=He.merge(Zt),ol=Y({uri:U(),mimeType:Be(U()),_meta:Ce(U(),Te()).optional()}),cl=ol.extend({text:U()}),Ia=U().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),ll=ol.extend({blob:Ia}),Gt=Ke(["user","assistant"]),Nt=Y({audience:fe(Gt).optional(),priority:me().min(0).max(1).optional(),lastModified:Uc({offset:!0}).optional()}),ul=Y({...At.shape,...Ft.shape,uri:U(),description:Be(U()),mimeType:Be(U()),annotations:Nt.optional(),_meta:Be(Ye({}))}),pp=Y({...At.shape,...Ft.shape,uriTemplate:U(),description:Be(U()),mimeType:Be(U()),annotations:Nt.optional(),_meta:Be(Ye({}))}),gp=Ht.extend({method:G("resources/list")}),hl=$t.extend({resources:fe(ul)}),vp=Ht.extend({method:G("resources/templates/list")}),mp=$t.extend({resourceTemplates:fe(pp)}),Ra=Je.extend({uri:U()}),bp=Ra,yp=Fe.extend({method:G("resources/read"),params:bp}),fl=He.extend({contents:fe(ye([cl,ll]))}),wp=tt.extend({method:G("notifications/resources/list_changed"),params:et.optional()}),_p=Ra,kp=Fe.extend({method:G("resources/subscribe"),params:_p}),xp=Ra,Cp=Fe.extend({method:G("resources/unsubscribe"),params:xp}),Sp=et.extend({uri:U()}),Tp=tt.extend({method:G("notifications/resources/updated"),params:Sp}),Ep=Y({name:U(),description:Be(U()),required:Be(Ae())}),Ap=Y({...At.shape,...Ft.shape,description:Be(U()),arguments:Be(fe(Ep)),_meta:Be(Ye({}))}),Mp=Ht.extend({method:G("prompts/list")}),Np=$t.extend({prompts:fe(Ap)}),Pp=Je.extend({name:U(),arguments:Ce(U(),U()).optional()}),zp=Fe.extend({method:G("prompts/get"),params:Pp}),qa=Y({type:G("text"),text:U(),annotations:Nt.optional(),_meta:Ce(U(),Te()).optional()}),Ba=Y({type:G("image"),data:Ia,mimeType:U(),annotations:Nt.optional(),_meta:Ce(U(),Te()).optional()}),La=Y({type:G("audio"),data:Ia,mimeType:U(),annotations:Nt.optional(),_meta:Ce(U(),Te()).optional()}),Ip=Y({type:G("tool_use"),name:U(),id:U(),input:Ce(U(),Te()),_meta:Ce(U(),Te()).optional()}),dl=Y({type:G("resource"),resource:ye([cl,ll]),annotations:Nt.optional(),_meta:Ce(U(),Te()).optional()}),pl=ul.extend({type:G("resource_link")}),Ut=ye([qa,Ba,La,pl,dl]),Rp=Y({role:Gt,content:Ut}),qp=He.extend({description:U().optional(),messages:fe(Rp)}),Bp=tt.extend({method:G("notifications/prompts/list_changed"),params:et.optional()}),Lp=Y({title:U().optional(),readOnlyHint:Ae().optional(),destructiveHint:Ae().optional(),idempotentHint:Ae().optional(),openWorldHint:Ae().optional()}),Op=Y({taskSupport:Ke(["required","optional","forbidden"]).optional()}),Oa=Y({...At.shape,...Ft.shape,description:U().optional(),inputSchema:Y({type:G("object"),properties:Ce(U(),De).optional(),required:fe(U()).optional()}).catchall(Te()),outputSchema:Y({type:G("object"),properties:Ce(U(),De).optional(),required:fe(U()).optional()}).catchall(Te()).optional(),annotations:Lp.optional(),execution:Op.optional(),_meta:Ce(U(),Te()).optional()}),gl=Ht.extend({method:G("tools/list")}),Dp=$t.extend({tools:fe(Oa)}),hr=He.extend({content:fe(Ut).default([]),structuredContent:Ce(U(),Te()).optional(),isError:Ae().optional()});hr.or(He.extend({toolResult:Te()}));const Fp=Ot.extend({name:U(),arguments:Ce(U(),Te()).optional()}),vl=Fe.extend({method:G("tools/call"),params:Fp}),Hp=tt.extend({method:G("notifications/tools/list_changed"),params:et.optional()});Y({autoRefresh:Ae().default(!0),debounceMs:me().int().nonnegative().default(300)});const ml=Ke(["debug","info","notice","warning","error","critical","alert","emergency"]),$p=Je.extend({level:ml}),Zp=Fe.extend({method:G("logging/setLevel"),params:$p}),Gp=et.extend({level:ml,logger:U().optional(),data:Te()}),Up=tt.extend({method:G("notifications/message"),params:Gp}),jp=Y({name:U().optional()}),Yp=Y({hints:fe(jp).optional(),costPriority:me().min(0).max(1).optional(),speedPriority:me().min(0).max(1).optional(),intelligencePriority:me().min(0).max(1).optional()}),Wp=Y({mode:Ke(["auto","required","none"]).optional()}),Vp=Y({type:G("tool_result"),toolUseId:U().describe("The unique identifier for the corresponding tool call."),content:fe(Ut).default([]),structuredContent:Y({}).loose().optional(),isError:Ae().optional(),_meta:Ce(U(),Te()).optional()}),Xp=Kc("type",[qa,Ba,La]),nr=Kc("type",[qa,Ba,La,Ip,Vp]),Kp=Y({role:Gt,content:ye([nr,fe(nr)]),_meta:Ce(U(),Te()).optional()}),Jp=Ot.extend({messages:fe(Kp),modelPreferences:Yp.optional(),systemPrompt:U().optional(),includeContext:Ke(["none","thisServer","allServers"]).optional(),temperature:me().optional(),maxTokens:me().int(),stopSequences:fe(U()).optional(),metadata:De.optional(),tools:fe(Oa).optional(),toolChoice:Wp.optional()}),Qp=Fe.extend({method:G("sampling/createMessage"),params:Jp}),e2=He.extend({model:U(),stopReason:Be(Ke(["endTurn","stopSequence","maxTokens"]).or(U())),role:Gt,content:Xp}),t2=He.extend({model:U(),stopReason:Be(Ke(["endTurn","stopSequence","maxTokens","toolUse"]).or(U())),role:Gt,content:ye([nr,fe(nr)])}),r2=Y({type:G("boolean"),title:U().optional(),description:U().optional(),default:Ae().optional()}),n2=Y({type:G("string"),title:U().optional(),description:U().optional(),minLength:me().optional(),maxLength:me().optional(),format:Ke(["email","uri","date","date-time"]).optional(),default:U().optional()}),a2=Y({type:Ke(["number","integer"]),title:U().optional(),description:U().optional(),minimum:me().optional(),maximum:me().optional(),default:me().optional()}),i2=Y({type:G("string"),title:U().optional(),description:U().optional(),enum:fe(U()),default:U().optional()}),s2=Y({type:G("string"),title:U().optional(),description:U().optional(),oneOf:fe(Y({const:U(),title:U()})),default:U().optional()}),o2=Y({type:G("string"),title:U().optional(),description:U().optional(),enum:fe(U()),enumNames:fe(U()).optional(),default:U().optional()}),c2=ye([i2,s2]),l2=Y({type:G("array"),title:U().optional(),description:U().optional(),minItems:me().optional(),maxItems:me().optional(),items:Y({type:G("string"),enum:fe(U())}),default:fe(U()).optional()}),u2=Y({type:G("array"),title:U().optional(),description:U().optional(),minItems:me().optional(),maxItems:me().optional(),items:Y({anyOf:fe(Y({const:U(),title:U()}))}),default:fe(U()).optional()}),h2=ye([l2,u2]),f2=ye([o2,c2,h2]),d2=ye([f2,r2,n2,a2]),p2=Ot.extend({mode:G("form").optional(),message:U(),requestedSchema:Y({type:G("object"),properties:Ce(U(),d2),required:fe(U()).optional()})}),g2=Ot.extend({mode:G("url"),message:U(),elicitationId:U(),url:U().url()}),v2=ye([p2,g2]),m2=Fe.extend({method:G("elicitation/create"),params:v2}),b2=et.extend({elicitationId:U()}),y2=tt.extend({method:G("notifications/elicitation/complete"),params:b2}),w2=He.extend({action:Ke(["accept","decline","cancel"]),content:rl(e=>e===null?void 0:e,Ce(U(),ye([U(),me(),Ae(),fe(U())])).optional())}),_2=Y({type:G("ref/resource"),uri:U()}),k2=Y({type:G("ref/prompt"),name:U()}),x2=Je.extend({ref:ye([k2,_2]),argument:Y({name:U(),value:U()}),context:Y({arguments:Ce(U(),U()).optional()}).optional()}),C2=Fe.extend({method:G("completion/complete"),params:x2}),S2=He.extend({completion:Ye({values:fe(U()).max(100),total:Be(me().int()),hasMore:Be(Ae())})}),T2=Y({uri:U().startsWith("file://"),name:U().optional(),_meta:Ce(U(),Te()).optional()}),E2=Fe.extend({method:G("roots/list"),params:Je.optional()}),A2=He.extend({roots:fe(T2)}),M2=tt.extend({method:G("notifications/roots/list_changed"),params:et.optional()});ye([ur,ap,C2,Zp,zp,Mp,gp,vp,yp,kp,Cp,vl,gl,Ea,Ma,Na,za]);ye([Ca,Sa,op,M2,rr]);ye([xa,e2,t2,w2,A2,Aa,Pa,Ta]);ye([ur,Qp,m2,E2,Ea,Ma,Na,za]);ye([Ca,Sa,Up,Tp,wp,Hp,Bp,rr,y2]);ye([xa,sp,S2,qp,Np,hl,mp,fl,hr,Dp,Aa,Pa,Ta]);class _e extends Error{constructor(t,a,n){super(`MCP error ${t}: ${a}`),this.code=t,this.data=n,this.name="McpError"}static fromError(t,a,n){if(t===xe.UrlElicitationRequired&&n){const r=n;if(r.elicitations)return new N2(r.elicitations,a)}return new _e(t,a,n)}}class N2 extends _e{constructor(t,a=`URL elicitation${t.length>1?"s":""} required`){super(xe.UrlElicitationRequired,a,{elicitations:t})}get elicitations(){var t;return((t=this.data)==null?void 0:t.elicitations)??[]}}function mt(e){return e==="completed"||e==="failed"||e==="cancelled"}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function ki(e){const t=M1(e),a=t==null?void 0:t.method;if(!a)throw new Error("Schema is missing a method literal");const n=N1(a);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function xi(e,t){const a=Gc(e,t);if(!a.success)throw a.error;return a.data}const P2=6e4;class z2{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Ca,a=>{this._oncancel(a)}),this.setNotificationHandler(Sa,a=>{this._onprogress(a)}),this.setRequestHandler(ur,a=>({})),this._taskStore=t==null?void 0:t.taskStore,this._taskMessageQueue=t==null?void 0:t.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Ea,async(a,n)=>{const r=await this._taskStore.getTask(a.params.taskId,n.sessionId);if(!r)throw new _e(xe.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(Ma,async(a,n)=>{const r=async()=>{var u;const i=a.params.taskId;if(this._taskMessageQueue){let f;for(;f=await this._taskMessageQueue.dequeue(i,n.sessionId);){if(f.type==="response"||f.type==="error"){const g=f.message,d=g.id,p=this._requestResolvers.get(d);if(p)if(this._requestResolvers.delete(d),f.type==="response")p(g);else{const l=g,o=new _e(l.error.code,l.error.message,l.error.data);p(o)}else{const l=f.type==="response"?"Response":"Error";this._onerror(new Error(`${l} handler missing for request ${d}`))}continue}await((u=this._transport)==null?void 0:u.send(f.message,{relatedRequestId:n.requestId}))}}const c=await this._taskStore.getTask(i,n.sessionId);if(!c)throw new _e(xe.InvalidParams,`Task not found: ${i}`);if(!mt(c.status))return await this._waitForTaskUpdate(i,n.signal),await r();if(mt(c.status)){const f=await this._taskStore.getTaskResult(i,n.sessionId);return this._clearTaskQueue(i),{...f,_meta:{...f._meta,[yt]:{taskId:i}}}}return await r()};return await r()}),this.setRequestHandler(Na,async(a,n)=>{var r;try{const{tasks:i,nextCursor:c}=await this._taskStore.listTasks((r=a.params)==null?void 0:r.cursor,n.sessionId);return{tasks:i,nextCursor:c,_meta:{}}}catch(i){throw new _e(xe.InvalidParams,`Failed to list tasks: ${i instanceof Error?i.message:String(i)}`)}}),this.setRequestHandler(za,async(a,n)=>{try{const r=await this._taskStore.getTask(a.params.taskId,n.sessionId);if(!r)throw new _e(xe.InvalidParams,`Task not found: ${a.params.taskId}`);if(mt(r.status))throw new _e(xe.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(a.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(a.params.taskId);const i=await this._taskStore.getTask(a.params.taskId,n.sessionId);if(!i)throw new _e(xe.InvalidParams,`Task not found after cancellation: ${a.params.taskId}`);return{_meta:{},...i}}catch(r){throw r instanceof _e?r:new _e(xe.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;const a=this._requestHandlerAbortControllers.get(t.params.requestId);a==null||a.abort(t.params.reason)}_setupTimeout(t,a,n,r,i=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(r,a),startTime:Date.now(),timeout:a,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(t){const a=this._timeoutInfo.get(t);if(!a)return!1;const n=Date.now()-a.startTime;if(a.maxTotalTimeout&&n>=a.maxTotalTimeout)throw this._timeoutInfo.delete(t),_e.fromError(xe.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:a.maxTotalTimeout,totalElapsed:n});return clearTimeout(a.timeoutId),a.timeoutId=setTimeout(a.onTimeout,a.timeout),!0}_cleanupTimeout(t){const a=this._timeoutInfo.get(t);a&&(clearTimeout(a.timeoutId),this._timeoutInfo.delete(t))}async connect(t){var i,c,u;this._transport=t;const a=(i=this.transport)==null?void 0:i.onclose;this._transport.onclose=()=>{a==null||a(),this._onclose()};const n=(c=this.transport)==null?void 0:c.onerror;this._transport.onerror=f=>{n==null||n(f),this._onerror(f)};const r=(u=this._transport)==null?void 0:u.onmessage;this._transport.onmessage=(f,g)=>{r==null||r(f,g),Xt(f)||Wd(f)?this._onresponse(f):_i(f)?this._onrequest(f,g):Yd(f)?this._onnotification(f):this._onerror(new Error(`Unknown message type: ${JSON.stringify(f)}`))},await this._transport.start()}_onclose(){var n;const t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();const a=_e.fromError(xe.ConnectionClosed,"Connection closed");this._transport=void 0,(n=this.onclose)==null||n.call(this);for(const r of t.values())r(a)}_onerror(t){var a;(a=this.onerror)==null||a.call(this,t)}_onnotification(t){const a=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;a!==void 0&&Promise.resolve().then(()=>a(t)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(t,a){var d,p,l,o;const n=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,r=this._transport,i=(l=(p=(d=t.params)==null?void 0:d._meta)==null?void 0:p[yt])==null?void 0:l.taskId;if(n===void 0){const h={jsonrpc:"2.0",id:t.id,error:{code:xe.MethodNotFound,message:"Method not found"}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:"error",message:h,timestamp:Date.now()},r==null?void 0:r.sessionId).catch(s=>this._onerror(new Error(`Failed to enqueue error response: ${s}`))):r==null||r.send(h).catch(s=>this._onerror(new Error(`Failed to send an error response: ${s}`)));return}const c=new AbortController;this._requestHandlerAbortControllers.set(t.id,c);const u=jd(t.params)?t.params.task:void 0,f=this._taskStore?this.requestTaskStore(t,r==null?void 0:r.sessionId):void 0,g={signal:c.signal,sessionId:r==null?void 0:r.sessionId,_meta:(o=t.params)==null?void 0:o._meta,sendNotification:async h=>{const s={relatedRequestId:t.id};i&&(s.relatedTask={taskId:i}),await this.notification(h,s)},sendRequest:async(h,s,v)=>{var _;const y={...v,relatedRequestId:t.id};i&&!y.relatedTask&&(y.relatedTask={taskId:i});const m=((_=y.relatedTask)==null?void 0:_.taskId)??i;return m&&f&&await f.updateTaskStatus(m,"input_required"),await this.request(h,s,y)},authInfo:a==null?void 0:a.authInfo,requestId:t.id,requestInfo:a==null?void 0:a.requestInfo,taskId:i,taskStore:f,taskRequestedTtl:u==null?void 0:u.ttl,closeSSEStream:a==null?void 0:a.closeSSEStream,closeStandaloneSSEStream:a==null?void 0:a.closeStandaloneSSEStream};Promise.resolve().then(()=>{u&&this.assertTaskHandlerCapability(t.method)}).then(()=>n(t,g)).then(async h=>{if(c.signal.aborted)return;const s={result:h,jsonrpc:"2.0",id:t.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"response",message:s,timestamp:Date.now()},r==null?void 0:r.sessionId):await(r==null?void 0:r.send(s))},async h=>{if(c.signal.aborted)return;const s={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(h.code)?h.code:xe.InternalError,message:h.message??"Internal error",...h.data!==void 0&&{data:h.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"error",message:s,timestamp:Date.now()},r==null?void 0:r.sessionId):await(r==null?void 0:r.send(s))}).catch(h=>this._onerror(new Error(`Failed to send response: ${h}`))).finally(()=>{this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){const{progressToken:a,...n}=t.params,r=Number(a),i=this._progressHandlers.get(r);if(!i){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}const c=this._responseHandlers.get(r),u=this._timeoutInfo.get(r);if(u&&c&&u.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(f){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),c(f);return}i(n)}_onresponse(t){const a=Number(t.id),n=this._requestResolvers.get(a);if(n){if(this._requestResolvers.delete(a),Xt(t))n(t);else{const c=new _e(t.error.code,t.error.message,t.error.data);n(c)}return}const r=this._responseHandlers.get(a);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(a),this._cleanupTimeout(a);let i=!1;if(Xt(t)&&t.result&&typeof t.result=="object"){const c=t.result;if(c.task&&typeof c.task=="object"){const u=c.task;typeof u.taskId=="string"&&(i=!0,this._taskProgressTokens.set(u.taskId,a))}}if(i||this._progressHandlers.delete(a),Xt(t))r(t);else{const c=_e.fromError(t.error.code,t.error.message,t.error.data);r(c)}}get transport(){return this._transport}async close(){var t;await((t=this._transport)==null?void 0:t.close())}async*requestStream(t,a,n){var c,u;const{task:r}=n??{};if(!r){try{yield{type:"result",result:await this.request(t,a,n)}}catch(f){yield{type:"error",error:f instanceof _e?f:new _e(xe.InternalError,String(f))}}return}let i;try{const f=await this.request(t,Ta,n);if(f.task)i=f.task.taskId,yield{type:"taskCreated",task:f.task};else throw new _e(xe.InternalError,"Task creation did not return a task");for(;;){const g=await this.getTask({taskId:i},n);if(yield{type:"taskStatus",task:g},mt(g.status)){g.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:i},a,n)}:g.status==="failed"?yield{type:"error",error:new _e(xe.InternalError,`Task ${i} failed`)}:g.status==="cancelled"&&(yield{type:"error",error:new _e(xe.InternalError,`Task ${i} was cancelled`)});return}if(g.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:i},a,n)};return}const d=g.pollInterval??((c=this._options)==null?void 0:c.defaultTaskPollInterval)??1e3;await new Promise(p=>setTimeout(p,d)),(u=n==null?void 0:n.signal)==null||u.throwIfAborted()}}catch(f){yield{type:"error",error:f instanceof _e?f:new _e(xe.InternalError,String(f))}}}request(t,a,n){const{relatedRequestId:r,resumptionToken:i,onresumptiontoken:c,task:u,relatedTask:f}=n??{};return new Promise((g,d)=>{var m,_,k,x,R;const p=I=>{d(I)};if(!this._transport){p(new Error("Not connected"));return}if(((m=this._options)==null?void 0:m.enforceStrictCapabilities)===!0)try{this.assertCapabilityForMethod(t.method),u&&this.assertTaskCapability(t.method)}catch(I){p(I);return}(_=n==null?void 0:n.signal)==null||_.throwIfAborted();const l=this._requestMessageId++,o={...t,jsonrpc:"2.0",id:l};n!=null&&n.onprogress&&(this._progressHandlers.set(l,n.onprogress),o.params={...t.params,_meta:{...((k=t.params)==null?void 0:k._meta)||{},progressToken:l}}),u&&(o.params={...o.params,task:u}),f&&(o.params={...o.params,_meta:{...((x=o.params)==null?void 0:x._meta)||{},[yt]:f}});const h=I=>{var A;this._responseHandlers.delete(l),this._progressHandlers.delete(l),this._cleanupTimeout(l),(A=this._transport)==null||A.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:l,reason:String(I)}},{relatedRequestId:r,resumptionToken:i,onresumptiontoken:c}).catch(N=>this._onerror(new Error(`Failed to send cancellation: ${N}`)));const b=I instanceof _e?I:new _e(xe.RequestTimeout,String(I));d(b)};this._responseHandlers.set(l,I=>{var b;if(!((b=n==null?void 0:n.signal)!=null&&b.aborted)){if(I instanceof Error)return d(I);try{const A=Gc(a,I.result);A.success?g(A.data):d(A.error)}catch(A){d(A)}}}),(R=n==null?void 0:n.signal)==null||R.addEventListener("abort",()=>{var I;h((I=n==null?void 0:n.signal)==null?void 0:I.reason)});const s=(n==null?void 0:n.timeout)??P2,v=()=>h(_e.fromError(xe.RequestTimeout,"Request timed out",{timeout:s}));this._setupTimeout(l,s,n==null?void 0:n.maxTotalTimeout,v,(n==null?void 0:n.resetTimeoutOnProgress)??!1);const y=f==null?void 0:f.taskId;if(y){const I=b=>{const A=this._responseHandlers.get(l);A?A(b):this._onerror(new Error(`Response handler missing for side-channeled request ${l}`))};this._requestResolvers.set(l,I),this._enqueueTaskMessage(y,{type:"request",message:o,timestamp:Date.now()}).catch(b=>{this._cleanupTimeout(l),d(b)})}else this._transport.send(o,{relatedRequestId:r,resumptionToken:i,onresumptiontoken:c}).catch(I=>{this._cleanupTimeout(l),d(I)})})}async getTask(t,a){return this.request({method:"tasks/get",params:t},Aa,a)}async getTaskResult(t,a,n){return this.request({method:"tasks/result",params:t},a,n)}async listTasks(t,a){return this.request({method:"tasks/list",params:t},Pa,a)}async cancelTask(t,a){return this.request({method:"tasks/cancel",params:t},dp,a)}async notification(t,a){var u,f,g,d;if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);const n=(u=a==null?void 0:a.relatedTask)==null?void 0:u.taskId;if(n){const p={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...((f=t.params)==null?void 0:f._meta)||{},[yt]:a.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:p,timestamp:Date.now()});return}if((((g=this._options)==null?void 0:g.debouncedNotificationMethods)??[]).includes(t.method)&&!t.params&&!(a!=null&&a.relatedRequestId)&&!(a!=null&&a.relatedTask)){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{var l,o;if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let p={...t,jsonrpc:"2.0"};a!=null&&a.relatedTask&&(p={...p,params:{...p.params,_meta:{...((l=p.params)==null?void 0:l._meta)||{},[yt]:a.relatedTask}}}),(o=this._transport)==null||o.send(p,a).catch(h=>this._onerror(h))});return}let c={...t,jsonrpc:"2.0"};a!=null&&a.relatedTask&&(c={...c,params:{...c.params,_meta:{...((d=c.params)==null?void 0:d._meta)||{},[yt]:a.relatedTask}}}),await this._transport.send(c,a)}setRequestHandler(t,a){const n=ki(t);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(r,i)=>{const c=xi(t,r);return Promise.resolve(a(c,i))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,a){const n=ki(t);this._notificationHandlers.set(n,r=>{const i=xi(t,r);return Promise.resolve(a(i))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){const a=this._taskProgressTokens.get(t);a!==void 0&&(this._progressHandlers.delete(a),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,a,n){var i;if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=(i=this._options)==null?void 0:i.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,a,n,r)}async _clearTaskQueue(t,a){if(this._taskMessageQueue){const n=await this._taskMessageQueue.dequeueAll(t,a);for(const r of n)if(r.type==="request"&&_i(r.message)){const i=r.message.id,c=this._requestResolvers.get(i);c?(c(new _e(xe.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(i)):this._onerror(new Error(`Resolver missing for request ${i} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,a){var r,i;let n=((r=this._options)==null?void 0:r.defaultTaskPollInterval)??1e3;try{const c=await((i=this._taskStore)==null?void 0:i.getTask(t));c!=null&&c.pollInterval&&(n=c.pollInterval)}catch{}return new Promise((c,u)=>{if(a.aborted){u(new _e(xe.InvalidRequest,"Request cancelled"));return}const f=setTimeout(c,n);a.addEventListener("abort",()=>{clearTimeout(f),u(new _e(xe.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,a){const n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async r=>{if(!t)throw new Error("No request provided");return await n.createTask(r,t.id,{method:t.method,params:t.params},a)},getTask:async r=>{const i=await n.getTask(r,a);if(!i)throw new _e(xe.InvalidParams,"Failed to retrieve task: Task not found");return i},storeTaskResult:async(r,i,c)=>{await n.storeTaskResult(r,i,c,a);const u=await n.getTask(r,a);if(u){const f=rr.parse({method:"notifications/tasks/status",params:u});await this.notification(f),mt(u.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>n.getTaskResult(r,a),updateTaskStatus:async(r,i,c)=>{const u=await n.getTask(r,a);if(!u)throw new _e(xe.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(mt(u.status))throw new _e(xe.InvalidParams,`Cannot update task "${r}" from terminal status "${u.status}" to "${i}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(r,i,c,a);const f=await n.getTask(r,a);if(f){const g=rr.parse({method:"notifications/tasks/status",params:f});await this.notification(g),mt(f.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>n.listTasks(r,a)}}}var I2="2026-01-26",R2="ui/notifications/tool-input-partial";class q2{constructor(t=window.parent,a){Ge(this,"eventTarget");Ge(this,"eventSource");Ge(this,"messageListener");Ge(this,"onclose");Ge(this,"onerror");Ge(this,"onmessage");Ge(this,"sessionId");Ge(this,"setProtocolVersion");this.eventTarget=t,this.eventSource=a,this.messageListener=n=>{var i,c,u;if(a&&n.source!==this.eventSource){console.debug("Ignoring message from unknown source",n);return}let r=Vd.safeParse(n.data);r.success?(console.debug("Parsed message",r.data),(i=this.onmessage)==null||i.call(this,r.data)):((c=n.data)==null?void 0:c.jsonrpc)!=="2.0"?console.debug("Ignoring non-JSON-RPC message",r.error.message,n):(console.error("Failed to parse message",r.error.message,n),(u=this.onerror)==null||u.call(this,Error("Invalid JSON-RPC message received: "+r.error.message)))}}async start(){window.addEventListener("message",this.messageListener)}async send(t,a){t.method!==R2&&console.debug("Sending message",t),this.eventTarget.postMessage(t,"*")}async close(){var t;window.removeEventListener("message",this.messageListener),(t=this.onclose)==null||t.call(this)}}var B2=ye([G("light"),G("dark")]).describe("Color theme preference for the host environment."),Bt=ye([G("inline"),G("fullscreen"),G("pip")]).describe("Display mode for UI presentation."),L2=ye([G("--color-background-primary"),G("--color-background-secondary"),G("--color-background-tertiary"),G("--color-background-inverse"),G("--color-background-ghost"),G("--color-background-info"),G("--color-background-danger"),G("--color-background-success"),G("--color-background-warning"),G("--color-background-disabled"),G("--color-text-primary"),G("--color-text-secondary"),G("--color-text-tertiary"),G("--color-text-inverse"),G("--color-text-ghost"),G("--color-text-info"),G("--color-text-danger"),G("--color-text-success"),G("--color-text-warning"),G("--color-text-disabled"),G("--color-border-primary"),G("--color-border-secondary"),G("--color-border-tertiary"),G("--color-border-inverse"),G("--color-border-ghost"),G("--color-border-info"),G("--color-border-danger"),G("--color-border-success"),G("--color-border-warning"),G("--color-border-disabled"),G("--color-ring-primary"),G("--color-ring-secondary"),G("--color-ring-inverse"),G("--color-ring-info"),G("--color-ring-danger"),G("--color-ring-success"),G("--color-ring-warning"),G("--font-sans"),G("--font-mono"),G("--font-weight-normal"),G("--font-weight-medium"),G("--font-weight-semibold"),G("--font-weight-bold"),G("--font-text-xs-size"),G("--font-text-sm-size"),G("--font-text-md-size"),G("--font-text-lg-size"),G("--font-heading-xs-size"),G("--font-heading-sm-size"),G("--font-heading-md-size"),G("--font-heading-lg-size"),G("--font-heading-xl-size"),G("--font-heading-2xl-size"),G("--font-heading-3xl-size"),G("--font-text-xs-line-height"),G("--font-text-sm-line-height"),G("--font-text-md-line-height"),G("--font-text-lg-line-height"),G("--font-heading-xs-line-height"),G("--font-heading-sm-line-height"),G("--font-heading-md-line-height"),G("--font-heading-lg-line-height"),G("--font-heading-xl-line-height"),G("--font-heading-2xl-line-height"),G("--font-heading-3xl-line-height"),G("--border-radius-xs"),G("--border-radius-sm"),G("--border-radius-md"),G("--border-radius-lg"),G("--border-radius-xl"),G("--border-radius-full"),G("--border-width-regular"),G("--shadow-hairline"),G("--shadow-sm"),G("--shadow-md"),G("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),O2=Ce(L2.describe(`Style variables for theming MCP apps.
|
|
46
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const p=d[1];if(t===d[0]){i(d);continue}if(e.external){const o=(f=e.external.registry.get(d[0]))==null?void 0:f.id;if(t!==d[0]&&o){i(d);continue}}if((g=e.metadataRegistry.get(d[0]))==null?void 0:g.id){i(d);continue}if(p.cycle){i(d);continue}if(p.count>1&&e.reused==="ref"){i(d);continue}}}function $c(e,t){var c,u,f;const a=e.seen.get(t);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=g=>{const d=e.seen.get(g);if(d.ref===null)return;const p=d.def??d.schema,l={...p},o=d.ref;if(d.ref=null,o){n(o);const s=e.seen.get(o),v=s.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(v)):Object.assign(p,v),Object.assign(p,l),g._zod.parent===o)for(const m in p)m==="$ref"||m==="allOf"||m in l||delete p[m];if(v.$ref)for(const m in p)m==="$ref"||m==="allOf"||m in s.def&&JSON.stringify(p[m])===JSON.stringify(s.def[m])&&delete p[m]}const h=g._zod.parent;if(h&&h!==o){n(h);const s=e.seen.get(h);if(s!=null&&s.schema.$ref&&(p.$ref=s.schema.$ref,s.def))for(const v in p)v==="$ref"||v==="allOf"||v in s.def&&JSON.stringify(p[v])===JSON.stringify(s.def[v])&&delete p[v]}e.override({zodSchema:g,jsonSchema:p,path:d.path??[]})};for(const g of[...e.seen.entries()].reverse())n(g[0]);const r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,(c=e.external)!=null&&c.uri){const g=(u=e.external.registry.get(t))==null?void 0:u.id;if(!g)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(g)}Object.assign(r,a.def??a.schema);const i=((f=e.external)==null?void 0:f.defs)??{};for(const g of e.seen.entries()){const d=g[1];d.def&&d.defId&&(i[d.defId]=d.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?r.$defs=i:r.definitions=i);try{const g=JSON.parse(JSON.stringify(r));return Object.defineProperty(g,"~standard",{value:{...t["~standard"],jsonSchema:{input:tr(t,"input",e.processors),output:tr(t,"output",e.processors)}},enumerable:!1,writable:!1}),g}catch{throw new Error("Error converting schema to JSON.")}}function je(e,t){const a=t??{seen:new Set};if(a.seen.has(e))return!1;a.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return je(n.element,a);if(n.type==="set")return je(n.valueType,a);if(n.type==="lazy")return je(n.getter(),a);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return je(n.innerType,a);if(n.type==="intersection")return je(n.left,a)||je(n.right,a);if(n.type==="record"||n.type==="map")return je(n.keyType,a)||je(n.valueType,a);if(n.type==="pipe")return je(n.in,a)||je(n.out,a);if(n.type==="object"){for(const r in n.shape)if(je(n.shape[r],a))return!0;return!1}if(n.type==="union"){for(const r of n.options)if(je(r,a))return!0;return!1}if(n.type==="tuple"){for(const r of n.items)if(je(r,a))return!0;return!!(n.rest&&je(n.rest,a))}return!1}const a1=(e,t={})=>a=>{const n=Fc({...a,processors:t});return Le(e,n),Hc(n,e),$c(n,e)},tr=(e,t,a={})=>n=>{const{libraryOptions:r,target:i}=n??{},c=Fc({...r??{},target:i,io:t,processors:a});return Le(e,c),Hc(c,e),$c(c,e)},i1={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},s1=(e,t,a,n)=>{const r=a;r.type="string";const{minimum:i,maximum:c,format:u,patterns:f,contentEncoding:g}=e._zod.bag;if(typeof i=="number"&&(r.minLength=i),typeof c=="number"&&(r.maxLength=c),u&&(r.format=i1[u]??u,r.format===""&&delete r.format,u==="time"&&delete r.format),g&&(r.contentEncoding=g),f&&f.size>0){const d=[...f];d.length===1?r.pattern=d[0].source:d.length>1&&(r.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},o1=(e,t,a,n)=>{const r=a,{minimum:i,maximum:c,format:u,multipleOf:f,exclusiveMaximum:g,exclusiveMinimum:d}=e._zod.bag;typeof u=="string"&&u.includes("int")?r.type="integer":r.type="number",typeof d=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.minimum=d,r.exclusiveMinimum=!0):r.exclusiveMinimum=d),typeof i=="number"&&(r.minimum=i,typeof d=="number"&&t.target!=="draft-04"&&(d>=i?delete r.minimum:delete r.exclusiveMinimum)),typeof g=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.maximum=g,r.exclusiveMaximum=!0):r.exclusiveMaximum=g),typeof c=="number"&&(r.maximum=c,typeof g=="number"&&t.target!=="draft-04"&&(g<=c?delete r.maximum:delete r.exclusiveMaximum)),typeof f=="number"&&(r.multipleOf=f)},c1=(e,t,a,n)=>{a.type="boolean"},l1=(e,t,a,n)=>{t.target==="openapi-3.0"?(a.type="string",a.nullable=!0,a.enum=[null]):a.type="null"},u1=(e,t,a,n)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},h1=(e,t,a,n)=>{a.not={}},f1=(e,t,a,n)=>{},d1=(e,t,a,n)=>{const r=e._zod.def,i=bc(r.entries);i.every(c=>typeof c=="number")&&(a.type="number"),i.every(c=>typeof c=="string")&&(a.type="string"),a.enum=i},p1=(e,t,a,n)=>{const r=e._zod.def,i=[];for(const c of r.values)if(c===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof c=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(c))}else i.push(c);if(i.length!==0)if(i.length===1){const c=i[0];a.type=c===null?"null":typeof c,t.target==="draft-04"||t.target==="openapi-3.0"?a.enum=[c]:a.const=c}else i.every(c=>typeof c=="number")&&(a.type="number"),i.every(c=>typeof c=="string")&&(a.type="string"),i.every(c=>typeof c=="boolean")&&(a.type="boolean"),i.every(c=>c===null)&&(a.type="null"),a.enum=i},g1=(e,t,a,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},v1=(e,t,a,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},m1=(e,t,a,n)=>{const r=a,i=e._zod.def,{minimum:c,maximum:u}=e._zod.bag;typeof c=="number"&&(r.minItems=c),typeof u=="number"&&(r.maxItems=u),r.type="array",r.items=Le(i.element,t,{...n,path:[...n.path,"items"]})},b1=(e,t,a,n)=>{var g;const r=a,i=e._zod.def;r.type="object",r.properties={};const c=i.shape;for(const d in c)r.properties[d]=Le(c[d],t,{...n,path:[...n.path,"properties",d]});const u=new Set(Object.keys(c)),f=new Set([...u].filter(d=>{const p=i.shape[d]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));f.size>0&&(r.required=Array.from(f)),((g=i.catchall)==null?void 0:g._zod.def.type)==="never"?r.additionalProperties=!1:i.catchall?i.catchall&&(r.additionalProperties=Le(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},y1=(e,t,a,n)=>{const r=e._zod.def,i=r.inclusive===!1,c=r.options.map((u,f)=>Le(u,t,{...n,path:[...n.path,i?"oneOf":"anyOf",f]}));i?a.oneOf=c:a.anyOf=c},w1=(e,t,a,n)=>{const r=e._zod.def,i=Le(r.left,t,{...n,path:[...n.path,"allOf",0]}),c=Le(r.right,t,{...n,path:[...n.path,"allOf",1]}),u=g=>"allOf"in g&&Object.keys(g).length===1,f=[...u(i)?i.allOf:[i],...u(c)?c.allOf:[c]];a.allOf=f},_1=(e,t,a,n)=>{const r=a,i=e._zod.def;r.type="object";const c=i.keyType,u=c._zod.bag,f=u==null?void 0:u.patterns;if(i.mode==="loose"&&f&&f.size>0){const d=Le(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});r.patternProperties={};for(const p of f)r.patternProperties[p.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(r.propertyNames=Le(i.keyType,t,{...n,path:[...n.path,"propertyNames"]})),r.additionalProperties=Le(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]});const g=c._zod.values;if(g){const d=[...g].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(r.required=d)}},k1=(e,t,a,n)=>{const r=e._zod.def,i=Le(r.innerType,t,n),c=t.seen.get(e);t.target==="openapi-3.0"?(c.ref=r.innerType,a.nullable=!0):a.anyOf=[i,{type:"null"}]},x1=(e,t,a,n)=>{const r=e._zod.def;Le(r.innerType,t,n);const i=t.seen.get(e);i.ref=r.innerType},C1=(e,t,a,n)=>{const r=e._zod.def;Le(r.innerType,t,n);const i=t.seen.get(e);i.ref=r.innerType,a.default=JSON.parse(JSON.stringify(r.defaultValue))},S1=(e,t,a,n)=>{const r=e._zod.def;Le(r.innerType,t,n);const i=t.seen.get(e);i.ref=r.innerType,t.io==="input"&&(a._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},T1=(e,t,a,n)=>{const r=e._zod.def;Le(r.innerType,t,n);const i=t.seen.get(e);i.ref=r.innerType;let c;try{c=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}a.default=c},E1=(e,t,a,n)=>{const r=e._zod.def,i=t.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;Le(i,t,n);const c=t.seen.get(e);c.ref=i},A1=(e,t,a,n)=>{const r=e._zod.def;Le(r.innerType,t,n);const i=t.seen.get(e);i.ref=r.innerType,a.readOnly=!0},Zc=(e,t,a,n)=>{const r=e._zod.def;Le(r.innerType,t,n);const i=t.seen.get(e);i.ref=r.innerType};function ba(e){return!!e._zod}function Gc(e,t){return ba(e)?Cc(e,t):e.safeParse(t)}function M1(e){var a,n;if(!e)return;let t;if(ba(e)?t=(n=(a=e._zod)==null?void 0:a.def)==null?void 0:n.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function N1(e){var r;if(ba(e)){const c=(r=e._zod)==null?void 0:r.def;if(c){if(c.value!==void 0)return c.value;if(Array.isArray(c.values)&&c.values.length>0)return c.values[0]}}const a=e._def;if(a){if(a.value!==void 0)return a.value;if(Array.isArray(a.values)&&a.values.length>0)return a.values[0]}const n=e.value;if(n!==void 0)return n}const P1=X("ZodISODateTime",(e,t)=>{kh.init(e,t),Ie.init(e,t)});function Uc(e){return Pf(P1,e)}const z1=X("ZodISODate",(e,t)=>{xh.init(e,t),Ie.init(e,t)});function I1(e){return zf(z1,e)}const R1=X("ZodISOTime",(e,t)=>{Ch.init(e,t),Ie.init(e,t)});function q1(e){return If(R1,e)}const B1=X("ZodISODuration",(e,t)=>{Sh.init(e,t),Ie.init(e,t)});function L1(e){return Rf(B1,e)}const O1=(e,t)=>{kc.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:a=>pu(e,a)},flatten:{value:a=>du(e,a)},addIssue:{value:a=>{e.issues.push(a),e.message=JSON.stringify(e.issues,oa,2)}},addIssues:{value:a=>{e.issues.push(...a),e.message=JSON.stringify(e.issues,oa,2)}},isEmpty:{get(){return e.issues.length===0}}})},Qe=X("ZodError",O1,{Parent:Error}),D1=ga(Qe),F1=va(Qe),H1=ir(Qe),$1=sr(Qe),Z1=vu(Qe),G1=mu(Qe),U1=bu(Qe),j1=yu(Qe),Y1=wu(Qe),W1=_u(Qe),V1=ku(Qe),X1=xu(Qe),Ne=X("ZodType",(e,t)=>(Me.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:tr(e,"input"),output:tr(e,"output")}}),e.toJSONSchema=a1(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...a)=>e.clone(ft(t,{checks:[...t.checks??[],...a.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(a,n)=>dt(e,a,n),e.brand=()=>e,e.register=((a,n)=>(a.add(e,n),e)),e.parse=(a,n)=>D1(e,a,n,{callee:e.parse}),e.safeParse=(a,n)=>H1(e,a,n),e.parseAsync=async(a,n)=>F1(e,a,n,{callee:e.parseAsync}),e.safeParseAsync=async(a,n)=>$1(e,a,n),e.spa=e.safeParseAsync,e.encode=(a,n)=>Z1(e,a,n),e.decode=(a,n)=>G1(e,a,n),e.encodeAsync=async(a,n)=>U1(e,a,n),e.decodeAsync=async(a,n)=>j1(e,a,n),e.safeEncode=(a,n)=>Y1(e,a,n),e.safeDecode=(a,n)=>W1(e,a,n),e.safeEncodeAsync=async(a,n)=>V1(e,a,n),e.safeDecodeAsync=async(a,n)=>X1(e,a,n),e.refine=(a,n)=>e.check($d(a,n)),e.superRefine=a=>e.check(Zd(a)),e.overwrite=a=>e.check(Mt(a)),e.optional=()=>Be(e),e.exactOptional=()=>Md(e),e.nullable=()=>wi(e),e.nullish=()=>Be(wi(e)),e.nonoptional=a=>qd(e,a),e.array=()=>fe(e),e.or=a=>ye([e,a]),e.and=a=>ya(e,a),e.transform=a=>ha(e,Jc(a)),e.default=a=>zd(e,a),e.prefault=a=>Rd(e,a),e.catch=a=>Ld(e,a),e.pipe=a=>ha(e,a),e.readonly=()=>Fd(e),e.describe=a=>{const n=e.clone();return It.add(n,{description:a}),n},Object.defineProperty(e,"description",{get(){var a;return(a=It.get(e))==null?void 0:a.description},configurable:!0}),e.meta=(...a)=>{if(a.length===0)return It.get(e);const n=e.clone();return It.add(n,a[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=a=>a(e),e)),jc=X("_ZodString",(e,t)=>{ma.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,r,i)=>s1(e,n,r);const a=e._zod.bag;e.format=a.format??null,e.minLength=a.minimum??null,e.maxLength=a.maximum??null,e.regex=(...n)=>e.check($f(...n)),e.includes=(...n)=>e.check(Uf(...n)),e.startsWith=(...n)=>e.check(jf(...n)),e.endsWith=(...n)=>e.check(Yf(...n)),e.min=(...n)=>e.check(er(...n)),e.max=(...n)=>e.check(Oc(...n)),e.length=(...n)=>e.check(Dc(...n)),e.nonempty=(...n)=>e.check(er(1,...n)),e.lowercase=n=>e.check(Zf(n)),e.uppercase=n=>e.check(Gf(n)),e.trim=()=>e.check(Vf()),e.normalize=(...n)=>e.check(Wf(...n)),e.toLowerCase=()=>e.check(Xf()),e.toUpperCase=()=>e.check(Kf()),e.slugify=()=>e.check(Jf())}),K1=X("ZodString",(e,t)=>{ma.init(e,t),jc.init(e,t),e.email=a=>e.check(uf(J1,a)),e.url=a=>e.check(gf(Q1,a)),e.jwt=a=>e.check(Nf(pd,a)),e.emoji=a=>e.check(vf(ed,a)),e.guid=a=>e.check(pi(bi,a)),e.uuid=a=>e.check(hf(Vt,a)),e.uuidv4=a=>e.check(ff(Vt,a)),e.uuidv6=a=>e.check(df(Vt,a)),e.uuidv7=a=>e.check(pf(Vt,a)),e.nanoid=a=>e.check(mf(td,a)),e.guid=a=>e.check(pi(bi,a)),e.cuid=a=>e.check(bf(rd,a)),e.cuid2=a=>e.check(yf(nd,a)),e.ulid=a=>e.check(wf(ad,a)),e.base64=a=>e.check(Ef(hd,a)),e.base64url=a=>e.check(Af(fd,a)),e.xid=a=>e.check(_f(id,a)),e.ksuid=a=>e.check(kf(sd,a)),e.ipv4=a=>e.check(xf(od,a)),e.ipv6=a=>e.check(Cf(cd,a)),e.cidrv4=a=>e.check(Sf(ld,a)),e.cidrv6=a=>e.check(Tf(ud,a)),e.e164=a=>e.check(Mf(dd,a)),e.datetime=a=>e.check(Uc(a)),e.date=a=>e.check(I1(a)),e.time=a=>e.check(q1(a)),e.duration=a=>e.check(L1(a))});function U(e){return lf(K1,e)}const Ie=X("ZodStringFormat",(e,t)=>{Pe.init(e,t),jc.init(e,t)}),J1=X("ZodEmail",(e,t)=>{dh.init(e,t),Ie.init(e,t)}),bi=X("ZodGUID",(e,t)=>{hh.init(e,t),Ie.init(e,t)}),Vt=X("ZodUUID",(e,t)=>{fh.init(e,t),Ie.init(e,t)}),Q1=X("ZodURL",(e,t)=>{ph.init(e,t),Ie.init(e,t)}),ed=X("ZodEmoji",(e,t)=>{gh.init(e,t),Ie.init(e,t)}),td=X("ZodNanoID",(e,t)=>{vh.init(e,t),Ie.init(e,t)}),rd=X("ZodCUID",(e,t)=>{mh.init(e,t),Ie.init(e,t)}),nd=X("ZodCUID2",(e,t)=>{bh.init(e,t),Ie.init(e,t)}),ad=X("ZodULID",(e,t)=>{yh.init(e,t),Ie.init(e,t)}),id=X("ZodXID",(e,t)=>{wh.init(e,t),Ie.init(e,t)}),sd=X("ZodKSUID",(e,t)=>{_h.init(e,t),Ie.init(e,t)}),od=X("ZodIPv4",(e,t)=>{Th.init(e,t),Ie.init(e,t)}),cd=X("ZodIPv6",(e,t)=>{Eh.init(e,t),Ie.init(e,t)}),ld=X("ZodCIDRv4",(e,t)=>{Ah.init(e,t),Ie.init(e,t)}),ud=X("ZodCIDRv6",(e,t)=>{Mh.init(e,t),Ie.init(e,t)}),hd=X("ZodBase64",(e,t)=>{Nh.init(e,t),Ie.init(e,t)}),fd=X("ZodBase64URL",(e,t)=>{zh.init(e,t),Ie.init(e,t)}),dd=X("ZodE164",(e,t)=>{Ih.init(e,t),Ie.init(e,t)}),pd=X("ZodJWT",(e,t)=>{qh.init(e,t),Ie.init(e,t)}),Yc=X("ZodNumber",(e,t)=>{Ic.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,r,i)=>o1(e,n,r),e.gt=(n,r)=>e.check(vi(n,r)),e.gte=(n,r)=>e.check(vr(n,r)),e.min=(n,r)=>e.check(vr(n,r)),e.lt=(n,r)=>e.check(gi(n,r)),e.lte=(n,r)=>e.check(gr(n,r)),e.max=(n,r)=>e.check(gr(n,r)),e.int=n=>e.check(yi(n)),e.safe=n=>e.check(yi(n)),e.positive=n=>e.check(vi(0,n)),e.nonnegative=n=>e.check(vr(0,n)),e.negative=n=>e.check(gi(0,n)),e.nonpositive=n=>e.check(gr(0,n)),e.multipleOf=(n,r)=>e.check(mi(n,r)),e.step=(n,r)=>e.check(mi(n,r)),e.finite=()=>e;const a=e._zod.bag;e.minValue=Math.max(a.minimum??Number.NEGATIVE_INFINITY,a.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(a.maximum??Number.POSITIVE_INFINITY,a.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(a.format??"").includes("int")||Number.isSafeInteger(a.multipleOf??.5),e.isFinite=!0,e.format=a.format??null});function me(e){return qf(Yc,e)}const gd=X("ZodNumberFormat",(e,t)=>{Bh.init(e,t),Yc.init(e,t)});function yi(e){return Bf(gd,e)}const vd=X("ZodBoolean",(e,t)=>{Lh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>c1(e,a,n)});function Ae(e){return Lf(vd,e)}const md=X("ZodUndefined",(e,t)=>{Oh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>u1(e,a)});function la(e){return Of(md,e)}const bd=X("ZodNull",(e,t)=>{Dh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>l1(e,a,n)});function Wc(e){return Df(bd,e)}const yd=X("ZodUnknown",(e,t)=>{Fh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>f1()});function Te(){return Ff(yd)}const wd=X("ZodNever",(e,t)=>{Hh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>h1(e,a,n)});function _d(e){return Hf(wd,e)}const kd=X("ZodArray",(e,t)=>{$h.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>m1(e,a,n,r),e.element=t.element,e.min=(a,n)=>e.check(er(a,n)),e.nonempty=a=>e.check(er(1,a)),e.max=(a,n)=>e.check(Oc(a,n)),e.length=(a,n)=>e.check(Dc(a,n)),e.unwrap=()=>e.element});function fe(e,t){return Qf(kd,e,t)}const Vc=X("ZodObject",(e,t)=>{Gh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>b1(e,a,n,r),ke(e,"shape",()=>t.shape),e.keyof=()=>Ke(Object.keys(e._zod.def.shape)),e.catchall=a=>e.clone({...e._zod.def,catchall:a}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Te()}),e.loose=()=>e.clone({...e._zod.def,catchall:Te()}),e.strict=()=>e.clone({...e._zod.def,catchall:_d()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=a=>cu(e,a),e.safeExtend=a=>lu(e,a),e.merge=a=>uu(e,a),e.pick=a=>su(e,a),e.omit=a=>ou(e,a),e.partial=(...a)=>hu(Qc,e,a[0]),e.required=(...a)=>fu(el,e,a[0])});function j(e,t){const a={type:"object",shape:e??{},...se(t)};return new Vc(a)}function Ye(e,t){return new Vc({type:"object",shape:e,catchall:Te(),...se(t)})}const Xc=X("ZodUnion",(e,t)=>{Bc.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>y1(e,a,n,r),e.options=t.options});function ye(e,t){return new Xc({type:"union",options:e,...se(t)})}const xd=X("ZodDiscriminatedUnion",(e,t)=>{Xc.init(e,t),Uh.init(e,t)});function Kc(e,t,a){return new xd({type:"union",options:t,discriminator:e,...se(a)})}const Cd=X("ZodIntersection",(e,t)=>{jh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>w1(e,a,n,r)});function ya(e,t){return new Cd({type:"intersection",left:e,right:t})}const Sd=X("ZodRecord",(e,t)=>{Yh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>_1(e,a,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Ce(e,t,a){return new Sd({type:"record",keyType:e,valueType:t,...se(a)})}const ua=X("ZodEnum",(e,t)=>{Wh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,r,i)=>d1(e,n,r),e.enum=t.entries,e.options=Object.values(t.entries);const a=new Set(Object.keys(t.entries));e.extract=(n,r)=>{const i={};for(const c of n)if(a.has(c))i[c]=t.entries[c];else throw new Error(`Key ${c} not found in enum`);return new ua({...t,checks:[],...se(r),entries:i})},e.exclude=(n,r)=>{const i={...t.entries};for(const c of n)if(a.has(c))delete i[c];else throw new Error(`Key ${c} not found in enum`);return new ua({...t,checks:[],...se(r),entries:i})}});function Ke(e,t){const a=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new ua({type:"enum",entries:a,...se(t)})}const Td=X("ZodLiteral",(e,t)=>{Vh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>p1(e,a,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function G(e,t){return new Td({type:"literal",values:Array.isArray(e)?e:[e],...se(t)})}const Ed=X("ZodTransform",(e,t)=>{Xh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>v1(e,a),e._zod.parse=(a,n)=>{if(n.direction==="backward")throw new vc(e.constructor.name);a.addIssue=i=>{if(typeof i=="string")a.issues.push(qt(i,a.value,t));else{const c=i;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=a.value),c.inst??(c.inst=e),a.issues.push(qt(c))}};const r=t.transform(a.value,a);return r instanceof Promise?r.then(i=>(a.value=i,a)):(a.value=r,a)}});function Jc(e){return new Ed({type:"transform",transform:e})}const Qc=X("ZodOptional",(e,t)=>{Lc.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>Zc(e,a,n,r),e.unwrap=()=>e._zod.def.innerType});function Be(e){return new Qc({type:"optional",innerType:e})}const Ad=X("ZodExactOptional",(e,t)=>{Kh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>Zc(e,a,n,r),e.unwrap=()=>e._zod.def.innerType});function Md(e){return new Ad({type:"optional",innerType:e})}const Nd=X("ZodNullable",(e,t)=>{Jh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>k1(e,a,n,r),e.unwrap=()=>e._zod.def.innerType});function wi(e){return new Nd({type:"nullable",innerType:e})}const Pd=X("ZodDefault",(e,t)=>{Qh.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>C1(e,a,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function zd(e,t){return new Pd({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():wc(t)}})}const Id=X("ZodPrefault",(e,t)=>{ef.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>S1(e,a,n,r),e.unwrap=()=>e._zod.def.innerType});function Rd(e,t){return new Id({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():wc(t)}})}const el=X("ZodNonOptional",(e,t)=>{tf.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>x1(e,a,n,r),e.unwrap=()=>e._zod.def.innerType});function qd(e,t){return new el({type:"nonoptional",innerType:e,...se(t)})}const Bd=X("ZodCatch",(e,t)=>{rf.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>T1(e,a,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ld(e,t){return new Bd({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Od=X("ZodPipe",(e,t)=>{nf.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>E1(e,a,n,r),e.in=t.in,e.out=t.out});function ha(e,t){return new Od({type:"pipe",in:e,out:t})}const Dd=X("ZodReadonly",(e,t)=>{af.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>A1(e,a,n,r),e.unwrap=()=>e._zod.def.innerType});function Fd(e){return new Dd({type:"readonly",innerType:e})}const tl=X("ZodCustom",(e,t)=>{sf.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,n,r)=>g1(e,a)});function Hd(e,t){return e1(tl,e??(()=>!0),t)}function $d(e,t={}){return t1(tl,e,t)}function Zd(e){return r1(e)}function rl(e,t){return ha(Jc(e),t)}const yt="io.modelcontextprotocol/related-task",cr="2.0",De=Hd(e=>e!==null&&(typeof e=="object"||typeof e=="function")),nl=ye([U(),me().int()]),al=U();Ye({ttl:ye([me(),Wc()]).optional(),pollInterval:me().optional()});const Gd=j({ttl:me().optional()}),Ud=j({taskId:U()}),wa=Ye({progressToken:nl.optional(),[yt]:Ud.optional()}),Je=j({_meta:wa.optional()}),Ot=Je.extend({task:Gd.optional()}),jd=e=>Ot.safeParse(e).success,Fe=j({method:U(),params:Je.loose().optional()}),et=j({_meta:wa.optional()}),tt=j({method:U(),params:et.loose().optional()}),He=Ye({_meta:wa.optional()}),Dt=ye([U(),me().int()]),il=j({jsonrpc:G(cr),id:Dt,...Fe.shape}).strict(),_i=e=>il.safeParse(e).success,sl=j({jsonrpc:G(cr),...tt.shape}).strict(),Yd=e=>sl.safeParse(e).success,_a=j({jsonrpc:G(cr),id:Dt,result:He}).strict(),Xt=e=>_a.safeParse(e).success;var xe;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(xe||(xe={}));const ka=j({jsonrpc:G(cr),id:Dt.optional(),error:j({code:me().int(),message:U(),data:Te().optional()})}).strict(),Wd=e=>ka.safeParse(e).success,Vd=ye([il,sl,_a,ka]);ye([_a,ka]);const xa=He.strict(),Xd=et.extend({requestId:Dt.optional(),reason:U().optional()}),Ca=tt.extend({method:G("notifications/cancelled"),params:Xd}),Kd=j({src:U(),mimeType:U().optional(),sizes:fe(U()).optional(),theme:Ke(["light","dark"]).optional()}),Ft=j({icons:fe(Kd).optional()}),At=j({name:U(),title:U().optional()}),lr=At.extend({...At.shape,...Ft.shape,version:U(),websiteUrl:U().optional(),description:U().optional()}),Jd=ya(j({applyDefaults:Ae().optional()}),Ce(U(),Te())),Qd=rl(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ya(j({form:Jd.optional(),url:De.optional()}),Ce(U(),Te()).optional())),ep=Ye({list:De.optional(),cancel:De.optional(),requests:Ye({sampling:Ye({createMessage:De.optional()}).optional(),elicitation:Ye({create:De.optional()}).optional()}).optional()}),tp=Ye({list:De.optional(),cancel:De.optional(),requests:Ye({tools:Ye({call:De.optional()}).optional()}).optional()}),rp=j({experimental:Ce(U(),De).optional(),sampling:j({context:De.optional(),tools:De.optional()}).optional(),elicitation:Qd.optional(),roots:j({listChanged:Ae().optional()}).optional(),tasks:ep.optional()}),np=Je.extend({protocolVersion:U(),capabilities:rp,clientInfo:lr}),ap=Fe.extend({method:G("initialize"),params:np}),ip=j({experimental:Ce(U(),De).optional(),logging:De.optional(),completions:De.optional(),prompts:j({listChanged:Ae().optional()}).optional(),resources:j({subscribe:Ae().optional(),listChanged:Ae().optional()}).optional(),tools:j({listChanged:Ae().optional()}).optional(),tasks:tp.optional()}),sp=He.extend({protocolVersion:U(),capabilities:ip,serverInfo:lr,instructions:U().optional()}),op=tt.extend({method:G("notifications/initialized"),params:et.optional()}),ur=Fe.extend({method:G("ping"),params:Je.optional()}),cp=j({progress:me(),total:Be(me()),message:Be(U())}),lp=j({...et.shape,...cp.shape,progressToken:nl}),Sa=tt.extend({method:G("notifications/progress"),params:lp}),up=Je.extend({cursor:al.optional()}),Ht=Fe.extend({params:up.optional()}),$t=He.extend({nextCursor:al.optional()}),hp=Ke(["working","input_required","completed","failed","cancelled"]),Zt=j({taskId:U(),status:hp,ttl:ye([me(),Wc()]),createdAt:U(),lastUpdatedAt:U(),pollInterval:Be(me()),statusMessage:Be(U())}),Ta=He.extend({task:Zt}),fp=et.merge(Zt),rr=tt.extend({method:G("notifications/tasks/status"),params:fp}),Ea=Fe.extend({method:G("tasks/get"),params:Je.extend({taskId:U()})}),Aa=He.merge(Zt),Ma=Fe.extend({method:G("tasks/result"),params:Je.extend({taskId:U()})});He.loose();const Na=Ht.extend({method:G("tasks/list")}),Pa=$t.extend({tasks:fe(Zt)}),za=Fe.extend({method:G("tasks/cancel"),params:Je.extend({taskId:U()})}),dp=He.merge(Zt),ol=j({uri:U(),mimeType:Be(U()),_meta:Ce(U(),Te()).optional()}),cl=ol.extend({text:U()}),Ia=U().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),ll=ol.extend({blob:Ia}),Gt=Ke(["user","assistant"]),Nt=j({audience:fe(Gt).optional(),priority:me().min(0).max(1).optional(),lastModified:Uc({offset:!0}).optional()}),ul=j({...At.shape,...Ft.shape,uri:U(),description:Be(U()),mimeType:Be(U()),annotations:Nt.optional(),_meta:Be(Ye({}))}),pp=j({...At.shape,...Ft.shape,uriTemplate:U(),description:Be(U()),mimeType:Be(U()),annotations:Nt.optional(),_meta:Be(Ye({}))}),gp=Ht.extend({method:G("resources/list")}),hl=$t.extend({resources:fe(ul)}),vp=Ht.extend({method:G("resources/templates/list")}),mp=$t.extend({resourceTemplates:fe(pp)}),Ra=Je.extend({uri:U()}),bp=Ra,yp=Fe.extend({method:G("resources/read"),params:bp}),fl=He.extend({contents:fe(ye([cl,ll]))}),wp=tt.extend({method:G("notifications/resources/list_changed"),params:et.optional()}),_p=Ra,kp=Fe.extend({method:G("resources/subscribe"),params:_p}),xp=Ra,Cp=Fe.extend({method:G("resources/unsubscribe"),params:xp}),Sp=et.extend({uri:U()}),Tp=tt.extend({method:G("notifications/resources/updated"),params:Sp}),Ep=j({name:U(),description:Be(U()),required:Be(Ae())}),Ap=j({...At.shape,...Ft.shape,description:Be(U()),arguments:Be(fe(Ep)),_meta:Be(Ye({}))}),Mp=Ht.extend({method:G("prompts/list")}),Np=$t.extend({prompts:fe(Ap)}),Pp=Je.extend({name:U(),arguments:Ce(U(),U()).optional()}),zp=Fe.extend({method:G("prompts/get"),params:Pp}),qa=j({type:G("text"),text:U(),annotations:Nt.optional(),_meta:Ce(U(),Te()).optional()}),Ba=j({type:G("image"),data:Ia,mimeType:U(),annotations:Nt.optional(),_meta:Ce(U(),Te()).optional()}),La=j({type:G("audio"),data:Ia,mimeType:U(),annotations:Nt.optional(),_meta:Ce(U(),Te()).optional()}),Ip=j({type:G("tool_use"),name:U(),id:U(),input:Ce(U(),Te()),_meta:Ce(U(),Te()).optional()}),dl=j({type:G("resource"),resource:ye([cl,ll]),annotations:Nt.optional(),_meta:Ce(U(),Te()).optional()}),pl=ul.extend({type:G("resource_link")}),Ut=ye([qa,Ba,La,pl,dl]),Rp=j({role:Gt,content:Ut}),qp=He.extend({description:U().optional(),messages:fe(Rp)}),Bp=tt.extend({method:G("notifications/prompts/list_changed"),params:et.optional()}),Lp=j({title:U().optional(),readOnlyHint:Ae().optional(),destructiveHint:Ae().optional(),idempotentHint:Ae().optional(),openWorldHint:Ae().optional()}),Op=j({taskSupport:Ke(["required","optional","forbidden"]).optional()}),Oa=j({...At.shape,...Ft.shape,description:U().optional(),inputSchema:j({type:G("object"),properties:Ce(U(),De).optional(),required:fe(U()).optional()}).catchall(Te()),outputSchema:j({type:G("object"),properties:Ce(U(),De).optional(),required:fe(U()).optional()}).catchall(Te()).optional(),annotations:Lp.optional(),execution:Op.optional(),_meta:Ce(U(),Te()).optional()}),gl=Ht.extend({method:G("tools/list")}),Dp=$t.extend({tools:fe(Oa)}),hr=He.extend({content:fe(Ut).default([]),structuredContent:Ce(U(),Te()).optional(),isError:Ae().optional()});hr.or(He.extend({toolResult:Te()}));const Fp=Ot.extend({name:U(),arguments:Ce(U(),Te()).optional()}),vl=Fe.extend({method:G("tools/call"),params:Fp}),Hp=tt.extend({method:G("notifications/tools/list_changed"),params:et.optional()});j({autoRefresh:Ae().default(!0),debounceMs:me().int().nonnegative().default(300)});const ml=Ke(["debug","info","notice","warning","error","critical","alert","emergency"]),$p=Je.extend({level:ml}),Zp=Fe.extend({method:G("logging/setLevel"),params:$p}),Gp=et.extend({level:ml,logger:U().optional(),data:Te()}),Up=tt.extend({method:G("notifications/message"),params:Gp}),jp=j({name:U().optional()}),Yp=j({hints:fe(jp).optional(),costPriority:me().min(0).max(1).optional(),speedPriority:me().min(0).max(1).optional(),intelligencePriority:me().min(0).max(1).optional()}),Wp=j({mode:Ke(["auto","required","none"]).optional()}),Vp=j({type:G("tool_result"),toolUseId:U().describe("The unique identifier for the corresponding tool call."),content:fe(Ut).default([]),structuredContent:j({}).loose().optional(),isError:Ae().optional(),_meta:Ce(U(),Te()).optional()}),Xp=Kc("type",[qa,Ba,La]),nr=Kc("type",[qa,Ba,La,Ip,Vp]),Kp=j({role:Gt,content:ye([nr,fe(nr)]),_meta:Ce(U(),Te()).optional()}),Jp=Ot.extend({messages:fe(Kp),modelPreferences:Yp.optional(),systemPrompt:U().optional(),includeContext:Ke(["none","thisServer","allServers"]).optional(),temperature:me().optional(),maxTokens:me().int(),stopSequences:fe(U()).optional(),metadata:De.optional(),tools:fe(Oa).optional(),toolChoice:Wp.optional()}),Qp=Fe.extend({method:G("sampling/createMessage"),params:Jp}),e2=He.extend({model:U(),stopReason:Be(Ke(["endTurn","stopSequence","maxTokens"]).or(U())),role:Gt,content:Xp}),t2=He.extend({model:U(),stopReason:Be(Ke(["endTurn","stopSequence","maxTokens","toolUse"]).or(U())),role:Gt,content:ye([nr,fe(nr)])}),r2=j({type:G("boolean"),title:U().optional(),description:U().optional(),default:Ae().optional()}),n2=j({type:G("string"),title:U().optional(),description:U().optional(),minLength:me().optional(),maxLength:me().optional(),format:Ke(["email","uri","date","date-time"]).optional(),default:U().optional()}),a2=j({type:Ke(["number","integer"]),title:U().optional(),description:U().optional(),minimum:me().optional(),maximum:me().optional(),default:me().optional()}),i2=j({type:G("string"),title:U().optional(),description:U().optional(),enum:fe(U()),default:U().optional()}),s2=j({type:G("string"),title:U().optional(),description:U().optional(),oneOf:fe(j({const:U(),title:U()})),default:U().optional()}),o2=j({type:G("string"),title:U().optional(),description:U().optional(),enum:fe(U()),enumNames:fe(U()).optional(),default:U().optional()}),c2=ye([i2,s2]),l2=j({type:G("array"),title:U().optional(),description:U().optional(),minItems:me().optional(),maxItems:me().optional(),items:j({type:G("string"),enum:fe(U())}),default:fe(U()).optional()}),u2=j({type:G("array"),title:U().optional(),description:U().optional(),minItems:me().optional(),maxItems:me().optional(),items:j({anyOf:fe(j({const:U(),title:U()}))}),default:fe(U()).optional()}),h2=ye([l2,u2]),f2=ye([o2,c2,h2]),d2=ye([f2,r2,n2,a2]),p2=Ot.extend({mode:G("form").optional(),message:U(),requestedSchema:j({type:G("object"),properties:Ce(U(),d2),required:fe(U()).optional()})}),g2=Ot.extend({mode:G("url"),message:U(),elicitationId:U(),url:U().url()}),v2=ye([p2,g2]),m2=Fe.extend({method:G("elicitation/create"),params:v2}),b2=et.extend({elicitationId:U()}),y2=tt.extend({method:G("notifications/elicitation/complete"),params:b2}),w2=He.extend({action:Ke(["accept","decline","cancel"]),content:rl(e=>e===null?void 0:e,Ce(U(),ye([U(),me(),Ae(),fe(U())])).optional())}),_2=j({type:G("ref/resource"),uri:U()}),k2=j({type:G("ref/prompt"),name:U()}),x2=Je.extend({ref:ye([k2,_2]),argument:j({name:U(),value:U()}),context:j({arguments:Ce(U(),U()).optional()}).optional()}),C2=Fe.extend({method:G("completion/complete"),params:x2}),S2=He.extend({completion:Ye({values:fe(U()).max(100),total:Be(me().int()),hasMore:Be(Ae())})}),T2=j({uri:U().startsWith("file://"),name:U().optional(),_meta:Ce(U(),Te()).optional()}),E2=Fe.extend({method:G("roots/list"),params:Je.optional()}),A2=He.extend({roots:fe(T2)}),M2=tt.extend({method:G("notifications/roots/list_changed"),params:et.optional()});ye([ur,ap,C2,Zp,zp,Mp,gp,vp,yp,kp,Cp,vl,gl,Ea,Ma,Na,za]);ye([Ca,Sa,op,M2,rr]);ye([xa,e2,t2,w2,A2,Aa,Pa,Ta]);ye([ur,Qp,m2,E2,Ea,Ma,Na,za]);ye([Ca,Sa,Up,Tp,wp,Hp,Bp,rr,y2]);ye([xa,sp,S2,qp,Np,hl,mp,fl,hr,Dp,Aa,Pa,Ta]);class _e extends Error{constructor(t,a,n){super(`MCP error ${t}: ${a}`),this.code=t,this.data=n,this.name="McpError"}static fromError(t,a,n){if(t===xe.UrlElicitationRequired&&n){const r=n;if(r.elicitations)return new N2(r.elicitations,a)}return new _e(t,a,n)}}class N2 extends _e{constructor(t,a=`URL elicitation${t.length>1?"s":""} required`){super(xe.UrlElicitationRequired,a,{elicitations:t})}get elicitations(){var t;return((t=this.data)==null?void 0:t.elicitations)??[]}}function mt(e){return e==="completed"||e==="failed"||e==="cancelled"}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function ki(e){const t=M1(e),a=t==null?void 0:t.method;if(!a)throw new Error("Schema is missing a method literal");const n=N1(a);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function xi(e,t){const a=Gc(e,t);if(!a.success)throw a.error;return a.data}const P2=6e4;class z2{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Ca,a=>{this._oncancel(a)}),this.setNotificationHandler(Sa,a=>{this._onprogress(a)}),this.setRequestHandler(ur,a=>({})),this._taskStore=t==null?void 0:t.taskStore,this._taskMessageQueue=t==null?void 0:t.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Ea,async(a,n)=>{const r=await this._taskStore.getTask(a.params.taskId,n.sessionId);if(!r)throw new _e(xe.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(Ma,async(a,n)=>{const r=async()=>{var u;const i=a.params.taskId;if(this._taskMessageQueue){let f;for(;f=await this._taskMessageQueue.dequeue(i,n.sessionId);){if(f.type==="response"||f.type==="error"){const g=f.message,d=g.id,p=this._requestResolvers.get(d);if(p)if(this._requestResolvers.delete(d),f.type==="response")p(g);else{const l=g,o=new _e(l.error.code,l.error.message,l.error.data);p(o)}else{const l=f.type==="response"?"Response":"Error";this._onerror(new Error(`${l} handler missing for request ${d}`))}continue}await((u=this._transport)==null?void 0:u.send(f.message,{relatedRequestId:n.requestId}))}}const c=await this._taskStore.getTask(i,n.sessionId);if(!c)throw new _e(xe.InvalidParams,`Task not found: ${i}`);if(!mt(c.status))return await this._waitForTaskUpdate(i,n.signal),await r();if(mt(c.status)){const f=await this._taskStore.getTaskResult(i,n.sessionId);return this._clearTaskQueue(i),{...f,_meta:{...f._meta,[yt]:{taskId:i}}}}return await r()};return await r()}),this.setRequestHandler(Na,async(a,n)=>{var r;try{const{tasks:i,nextCursor:c}=await this._taskStore.listTasks((r=a.params)==null?void 0:r.cursor,n.sessionId);return{tasks:i,nextCursor:c,_meta:{}}}catch(i){throw new _e(xe.InvalidParams,`Failed to list tasks: ${i instanceof Error?i.message:String(i)}`)}}),this.setRequestHandler(za,async(a,n)=>{try{const r=await this._taskStore.getTask(a.params.taskId,n.sessionId);if(!r)throw new _e(xe.InvalidParams,`Task not found: ${a.params.taskId}`);if(mt(r.status))throw new _e(xe.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(a.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(a.params.taskId);const i=await this._taskStore.getTask(a.params.taskId,n.sessionId);if(!i)throw new _e(xe.InvalidParams,`Task not found after cancellation: ${a.params.taskId}`);return{_meta:{},...i}}catch(r){throw r instanceof _e?r:new _e(xe.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;const a=this._requestHandlerAbortControllers.get(t.params.requestId);a==null||a.abort(t.params.reason)}_setupTimeout(t,a,n,r,i=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(r,a),startTime:Date.now(),timeout:a,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(t){const a=this._timeoutInfo.get(t);if(!a)return!1;const n=Date.now()-a.startTime;if(a.maxTotalTimeout&&n>=a.maxTotalTimeout)throw this._timeoutInfo.delete(t),_e.fromError(xe.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:a.maxTotalTimeout,totalElapsed:n});return clearTimeout(a.timeoutId),a.timeoutId=setTimeout(a.onTimeout,a.timeout),!0}_cleanupTimeout(t){const a=this._timeoutInfo.get(t);a&&(clearTimeout(a.timeoutId),this._timeoutInfo.delete(t))}async connect(t){var i,c,u;this._transport=t;const a=(i=this.transport)==null?void 0:i.onclose;this._transport.onclose=()=>{a==null||a(),this._onclose()};const n=(c=this.transport)==null?void 0:c.onerror;this._transport.onerror=f=>{n==null||n(f),this._onerror(f)};const r=(u=this._transport)==null?void 0:u.onmessage;this._transport.onmessage=(f,g)=>{r==null||r(f,g),Xt(f)||Wd(f)?this._onresponse(f):_i(f)?this._onrequest(f,g):Yd(f)?this._onnotification(f):this._onerror(new Error(`Unknown message type: ${JSON.stringify(f)}`))},await this._transport.start()}_onclose(){var n;const t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();const a=_e.fromError(xe.ConnectionClosed,"Connection closed");this._transport=void 0,(n=this.onclose)==null||n.call(this);for(const r of t.values())r(a)}_onerror(t){var a;(a=this.onerror)==null||a.call(this,t)}_onnotification(t){const a=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;a!==void 0&&Promise.resolve().then(()=>a(t)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(t,a){var d,p,l,o;const n=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,r=this._transport,i=(l=(p=(d=t.params)==null?void 0:d._meta)==null?void 0:p[yt])==null?void 0:l.taskId;if(n===void 0){const h={jsonrpc:"2.0",id:t.id,error:{code:xe.MethodNotFound,message:"Method not found"}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:"error",message:h,timestamp:Date.now()},r==null?void 0:r.sessionId).catch(s=>this._onerror(new Error(`Failed to enqueue error response: ${s}`))):r==null||r.send(h).catch(s=>this._onerror(new Error(`Failed to send an error response: ${s}`)));return}const c=new AbortController;this._requestHandlerAbortControllers.set(t.id,c);const u=jd(t.params)?t.params.task:void 0,f=this._taskStore?this.requestTaskStore(t,r==null?void 0:r.sessionId):void 0,g={signal:c.signal,sessionId:r==null?void 0:r.sessionId,_meta:(o=t.params)==null?void 0:o._meta,sendNotification:async h=>{const s={relatedRequestId:t.id};i&&(s.relatedTask={taskId:i}),await this.notification(h,s)},sendRequest:async(h,s,v)=>{var _;const y={...v,relatedRequestId:t.id};i&&!y.relatedTask&&(y.relatedTask={taskId:i});const m=((_=y.relatedTask)==null?void 0:_.taskId)??i;return m&&f&&await f.updateTaskStatus(m,"input_required"),await this.request(h,s,y)},authInfo:a==null?void 0:a.authInfo,requestId:t.id,requestInfo:a==null?void 0:a.requestInfo,taskId:i,taskStore:f,taskRequestedTtl:u==null?void 0:u.ttl,closeSSEStream:a==null?void 0:a.closeSSEStream,closeStandaloneSSEStream:a==null?void 0:a.closeStandaloneSSEStream};Promise.resolve().then(()=>{u&&this.assertTaskHandlerCapability(t.method)}).then(()=>n(t,g)).then(async h=>{if(c.signal.aborted)return;const s={result:h,jsonrpc:"2.0",id:t.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"response",message:s,timestamp:Date.now()},r==null?void 0:r.sessionId):await(r==null?void 0:r.send(s))},async h=>{if(c.signal.aborted)return;const s={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(h.code)?h.code:xe.InternalError,message:h.message??"Internal error",...h.data!==void 0&&{data:h.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"error",message:s,timestamp:Date.now()},r==null?void 0:r.sessionId):await(r==null?void 0:r.send(s))}).catch(h=>this._onerror(new Error(`Failed to send response: ${h}`))).finally(()=>{this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){const{progressToken:a,...n}=t.params,r=Number(a),i=this._progressHandlers.get(r);if(!i){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}const c=this._responseHandlers.get(r),u=this._timeoutInfo.get(r);if(u&&c&&u.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(f){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),c(f);return}i(n)}_onresponse(t){const a=Number(t.id),n=this._requestResolvers.get(a);if(n){if(this._requestResolvers.delete(a),Xt(t))n(t);else{const c=new _e(t.error.code,t.error.message,t.error.data);n(c)}return}const r=this._responseHandlers.get(a);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(a),this._cleanupTimeout(a);let i=!1;if(Xt(t)&&t.result&&typeof t.result=="object"){const c=t.result;if(c.task&&typeof c.task=="object"){const u=c.task;typeof u.taskId=="string"&&(i=!0,this._taskProgressTokens.set(u.taskId,a))}}if(i||this._progressHandlers.delete(a),Xt(t))r(t);else{const c=_e.fromError(t.error.code,t.error.message,t.error.data);r(c)}}get transport(){return this._transport}async close(){var t;await((t=this._transport)==null?void 0:t.close())}async*requestStream(t,a,n){var c,u;const{task:r}=n??{};if(!r){try{yield{type:"result",result:await this.request(t,a,n)}}catch(f){yield{type:"error",error:f instanceof _e?f:new _e(xe.InternalError,String(f))}}return}let i;try{const f=await this.request(t,Ta,n);if(f.task)i=f.task.taskId,yield{type:"taskCreated",task:f.task};else throw new _e(xe.InternalError,"Task creation did not return a task");for(;;){const g=await this.getTask({taskId:i},n);if(yield{type:"taskStatus",task:g},mt(g.status)){g.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:i},a,n)}:g.status==="failed"?yield{type:"error",error:new _e(xe.InternalError,`Task ${i} failed`)}:g.status==="cancelled"&&(yield{type:"error",error:new _e(xe.InternalError,`Task ${i} was cancelled`)});return}if(g.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:i},a,n)};return}const d=g.pollInterval??((c=this._options)==null?void 0:c.defaultTaskPollInterval)??1e3;await new Promise(p=>setTimeout(p,d)),(u=n==null?void 0:n.signal)==null||u.throwIfAborted()}}catch(f){yield{type:"error",error:f instanceof _e?f:new _e(xe.InternalError,String(f))}}}request(t,a,n){const{relatedRequestId:r,resumptionToken:i,onresumptiontoken:c,task:u,relatedTask:f}=n??{};return new Promise((g,d)=>{var m,_,k,x,R;const p=I=>{d(I)};if(!this._transport){p(new Error("Not connected"));return}if(((m=this._options)==null?void 0:m.enforceStrictCapabilities)===!0)try{this.assertCapabilityForMethod(t.method),u&&this.assertTaskCapability(t.method)}catch(I){p(I);return}(_=n==null?void 0:n.signal)==null||_.throwIfAborted();const l=this._requestMessageId++,o={...t,jsonrpc:"2.0",id:l};n!=null&&n.onprogress&&(this._progressHandlers.set(l,n.onprogress),o.params={...t.params,_meta:{...((k=t.params)==null?void 0:k._meta)||{},progressToken:l}}),u&&(o.params={...o.params,task:u}),f&&(o.params={...o.params,_meta:{...((x=o.params)==null?void 0:x._meta)||{},[yt]:f}});const h=I=>{var A;this._responseHandlers.delete(l),this._progressHandlers.delete(l),this._cleanupTimeout(l),(A=this._transport)==null||A.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:l,reason:String(I)}},{relatedRequestId:r,resumptionToken:i,onresumptiontoken:c}).catch(N=>this._onerror(new Error(`Failed to send cancellation: ${N}`)));const b=I instanceof _e?I:new _e(xe.RequestTimeout,String(I));d(b)};this._responseHandlers.set(l,I=>{var b;if(!((b=n==null?void 0:n.signal)!=null&&b.aborted)){if(I instanceof Error)return d(I);try{const A=Gc(a,I.result);A.success?g(A.data):d(A.error)}catch(A){d(A)}}}),(R=n==null?void 0:n.signal)==null||R.addEventListener("abort",()=>{var I;h((I=n==null?void 0:n.signal)==null?void 0:I.reason)});const s=(n==null?void 0:n.timeout)??P2,v=()=>h(_e.fromError(xe.RequestTimeout,"Request timed out",{timeout:s}));this._setupTimeout(l,s,n==null?void 0:n.maxTotalTimeout,v,(n==null?void 0:n.resetTimeoutOnProgress)??!1);const y=f==null?void 0:f.taskId;if(y){const I=b=>{const A=this._responseHandlers.get(l);A?A(b):this._onerror(new Error(`Response handler missing for side-channeled request ${l}`))};this._requestResolvers.set(l,I),this._enqueueTaskMessage(y,{type:"request",message:o,timestamp:Date.now()}).catch(b=>{this._cleanupTimeout(l),d(b)})}else this._transport.send(o,{relatedRequestId:r,resumptionToken:i,onresumptiontoken:c}).catch(I=>{this._cleanupTimeout(l),d(I)})})}async getTask(t,a){return this.request({method:"tasks/get",params:t},Aa,a)}async getTaskResult(t,a,n){return this.request({method:"tasks/result",params:t},a,n)}async listTasks(t,a){return this.request({method:"tasks/list",params:t},Pa,a)}async cancelTask(t,a){return this.request({method:"tasks/cancel",params:t},dp,a)}async notification(t,a){var u,f,g,d;if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);const n=(u=a==null?void 0:a.relatedTask)==null?void 0:u.taskId;if(n){const p={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...((f=t.params)==null?void 0:f._meta)||{},[yt]:a.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:p,timestamp:Date.now()});return}if((((g=this._options)==null?void 0:g.debouncedNotificationMethods)??[]).includes(t.method)&&!t.params&&!(a!=null&&a.relatedRequestId)&&!(a!=null&&a.relatedTask)){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{var l,o;if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let p={...t,jsonrpc:"2.0"};a!=null&&a.relatedTask&&(p={...p,params:{...p.params,_meta:{...((l=p.params)==null?void 0:l._meta)||{},[yt]:a.relatedTask}}}),(o=this._transport)==null||o.send(p,a).catch(h=>this._onerror(h))});return}let c={...t,jsonrpc:"2.0"};a!=null&&a.relatedTask&&(c={...c,params:{...c.params,_meta:{...((d=c.params)==null?void 0:d._meta)||{},[yt]:a.relatedTask}}}),await this._transport.send(c,a)}setRequestHandler(t,a){const n=ki(t);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(r,i)=>{const c=xi(t,r);return Promise.resolve(a(c,i))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,a){const n=ki(t);this._notificationHandlers.set(n,r=>{const i=xi(t,r);return Promise.resolve(a(i))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){const a=this._taskProgressTokens.get(t);a!==void 0&&(this._progressHandlers.delete(a),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,a,n){var i;if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=(i=this._options)==null?void 0:i.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,a,n,r)}async _clearTaskQueue(t,a){if(this._taskMessageQueue){const n=await this._taskMessageQueue.dequeueAll(t,a);for(const r of n)if(r.type==="request"&&_i(r.message)){const i=r.message.id,c=this._requestResolvers.get(i);c?(c(new _e(xe.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(i)):this._onerror(new Error(`Resolver missing for request ${i} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,a){var r,i;let n=((r=this._options)==null?void 0:r.defaultTaskPollInterval)??1e3;try{const c=await((i=this._taskStore)==null?void 0:i.getTask(t));c!=null&&c.pollInterval&&(n=c.pollInterval)}catch{}return new Promise((c,u)=>{if(a.aborted){u(new _e(xe.InvalidRequest,"Request cancelled"));return}const f=setTimeout(c,n);a.addEventListener("abort",()=>{clearTimeout(f),u(new _e(xe.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,a){const n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async r=>{if(!t)throw new Error("No request provided");return await n.createTask(r,t.id,{method:t.method,params:t.params},a)},getTask:async r=>{const i=await n.getTask(r,a);if(!i)throw new _e(xe.InvalidParams,"Failed to retrieve task: Task not found");return i},storeTaskResult:async(r,i,c)=>{await n.storeTaskResult(r,i,c,a);const u=await n.getTask(r,a);if(u){const f=rr.parse({method:"notifications/tasks/status",params:u});await this.notification(f),mt(u.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>n.getTaskResult(r,a),updateTaskStatus:async(r,i,c)=>{const u=await n.getTask(r,a);if(!u)throw new _e(xe.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(mt(u.status))throw new _e(xe.InvalidParams,`Cannot update task "${r}" from terminal status "${u.status}" to "${i}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(r,i,c,a);const f=await n.getTask(r,a);if(f){const g=rr.parse({method:"notifications/tasks/status",params:f});await this.notification(g),mt(f.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>n.listTasks(r,a)}}}var I2="2026-01-26",R2="ui/notifications/tool-input-partial";class q2{constructor(t=window.parent,a){Ge(this,"eventTarget");Ge(this,"eventSource");Ge(this,"messageListener");Ge(this,"onclose");Ge(this,"onerror");Ge(this,"onmessage");Ge(this,"sessionId");Ge(this,"setProtocolVersion");this.eventTarget=t,this.eventSource=a,this.messageListener=n=>{var i,c,u;if(a&&n.source!==this.eventSource){console.debug("Ignoring message from unknown source",n);return}let r=Vd.safeParse(n.data);r.success?(console.debug("Parsed message",r.data),(i=this.onmessage)==null||i.call(this,r.data)):((c=n.data)==null?void 0:c.jsonrpc)!=="2.0"?console.debug("Ignoring non-JSON-RPC message",r.error.message,n):(console.error("Failed to parse message",r.error.message,n),(u=this.onerror)==null||u.call(this,Error("Invalid JSON-RPC message received: "+r.error.message)))}}async start(){window.addEventListener("message",this.messageListener)}async send(t,a){t.method!==R2&&console.debug("Sending message",t),this.eventTarget.postMessage(t,"*")}async close(){var t;window.removeEventListener("message",this.messageListener),(t=this.onclose)==null||t.call(this)}}var B2=ye([G("light"),G("dark")]).describe("Color theme preference for the host environment."),Bt=ye([G("inline"),G("fullscreen"),G("pip")]).describe("Display mode for UI presentation."),L2=ye([G("--color-background-primary"),G("--color-background-secondary"),G("--color-background-tertiary"),G("--color-background-inverse"),G("--color-background-ghost"),G("--color-background-info"),G("--color-background-danger"),G("--color-background-success"),G("--color-background-warning"),G("--color-background-disabled"),G("--color-text-primary"),G("--color-text-secondary"),G("--color-text-tertiary"),G("--color-text-inverse"),G("--color-text-ghost"),G("--color-text-info"),G("--color-text-danger"),G("--color-text-success"),G("--color-text-warning"),G("--color-text-disabled"),G("--color-border-primary"),G("--color-border-secondary"),G("--color-border-tertiary"),G("--color-border-inverse"),G("--color-border-ghost"),G("--color-border-info"),G("--color-border-danger"),G("--color-border-success"),G("--color-border-warning"),G("--color-border-disabled"),G("--color-ring-primary"),G("--color-ring-secondary"),G("--color-ring-inverse"),G("--color-ring-info"),G("--color-ring-danger"),G("--color-ring-success"),G("--color-ring-warning"),G("--font-sans"),G("--font-mono"),G("--font-weight-normal"),G("--font-weight-medium"),G("--font-weight-semibold"),G("--font-weight-bold"),G("--font-text-xs-size"),G("--font-text-sm-size"),G("--font-text-md-size"),G("--font-text-lg-size"),G("--font-heading-xs-size"),G("--font-heading-sm-size"),G("--font-heading-md-size"),G("--font-heading-lg-size"),G("--font-heading-xl-size"),G("--font-heading-2xl-size"),G("--font-heading-3xl-size"),G("--font-text-xs-line-height"),G("--font-text-sm-line-height"),G("--font-text-md-line-height"),G("--font-text-lg-line-height"),G("--font-heading-xs-line-height"),G("--font-heading-sm-line-height"),G("--font-heading-md-line-height"),G("--font-heading-lg-line-height"),G("--font-heading-xl-line-height"),G("--font-heading-2xl-line-height"),G("--font-heading-3xl-line-height"),G("--border-radius-xs"),G("--border-radius-sm"),G("--border-radius-md"),G("--border-radius-lg"),G("--border-radius-xl"),G("--border-radius-full"),G("--border-width-regular"),G("--shadow-hairline"),G("--shadow-sm"),G("--shadow-md"),G("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),O2=Ce(L2.describe(`Style variables for theming MCP apps.
|
|
47
47
|
|
|
48
48
|
Individual style keys are optional - hosts may provide any subset of these values.
|
|
49
49
|
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
@@ -61,10 +61,10 @@ Individual style keys are optional - hosts may provide any subset of these value
|
|
|
61
61
|
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
62
62
|
|
|
63
63
|
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
64
|
-
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);
|
|
64
|
+
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);j({method:G("ui/open-link"),params:j({url:U().describe("URL to open in the host's browser")})});var D2=j({isError:Ae().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),F2=j({isError:Ae().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),H2=j({isError:Ae().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough();j({method:G("ui/notifications/sandbox-proxy-ready"),params:j({})});var Da=j({connectDomains:fe(U()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
|
|
65
65
|
|
|
66
66
|
- Maps to CSP \`connect-src\` directive
|
|
67
|
-
- Empty or omitted → no network connections (secure default)`),resourceDomains:fe(U()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:fe(U()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:fe(U()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),Fa=
|
|
67
|
+
- Empty or omitted → no network connections (secure default)`),resourceDomains:fe(U()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:fe(U()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:fe(U()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),Fa=j({camera:j({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:j({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:j({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:j({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")});j({method:G("ui/notifications/size-changed"),params:j({width:me().optional().describe("New width in pixels."),height:me().optional().describe("New height in pixels.")})});var $2=j({method:G("ui/notifications/tool-input"),params:j({arguments:Ce(U(),Te().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),Z2=j({method:G("ui/notifications/tool-input-partial"),params:j({arguments:Ce(U(),Te().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),G2=j({method:G("ui/notifications/tool-cancelled"),params:j({reason:U().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),U2=j({fonts:U().optional()}),j2=j({variables:O2.optional().describe("CSS variables for theming the app."),css:U2.optional().describe("CSS blocks that apps can inject.")}),Y2=j({method:G("ui/resource-teardown"),params:j({})});Ce(U(),Te());var Ci=j({text:j({}).optional().describe("Host supports text content blocks."),image:j({}).optional().describe("Host supports image content blocks."),audio:j({}).optional().describe("Host supports audio content blocks."),resource:j({}).optional().describe("Host supports resource content blocks."),resourceLink:j({}).optional().describe("Host supports resource link content blocks."),structuredContent:j({}).optional().describe("Host supports structured content.")});j({method:G("ui/notifications/request-teardown"),params:j({}).optional()});var W2=j({experimental:j({}).optional().describe("Experimental features (structure TBD)."),openLinks:j({}).optional().describe("Host supports opening external URLs."),downloadFile:j({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:j({listChanged:Ae().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:j({listChanged:Ae().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:j({}).optional().describe("Host accepts log messages."),sandbox:j({permissions:Fa.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:Da.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:Ci.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:Ci.optional().describe("Host supports receiving content messages (ui/message) from the view.")}),V2=j({experimental:j({}).optional().describe("Experimental features (structure TBD)."),tools:j({listChanged:Ae().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:fe(Bt).optional().describe("Display modes the app supports.")});j({method:G("ui/notifications/initialized"),params:j({}).optional()});j({csp:Da.optional().describe("Content Security Policy configuration for UI resources."),permissions:Fa.optional().describe("Sandbox permissions requested by the UI resource."),domain:U().optional().describe(`Dedicated origin for view sandbox.
|
|
68
68
|
|
|
69
69
|
Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
|
|
70
70
|
|
|
@@ -78,16 +78,16 @@ Boolean requesting whether a visible border and background is provided by the ho
|
|
|
78
78
|
|
|
79
79
|
- \`true\`: request visible border + background
|
|
80
80
|
- \`false\`: request no visible border + background
|
|
81
|
-
- omitted: host decides border`)});
|
|
81
|
+
- omitted: host decides border`)});j({method:G("ui/request-display-mode"),params:j({mode:Bt.describe("The display mode being requested.")})});var X2=j({mode:Bt.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),K2=ye([G("model"),G("app")]).describe("Tool visibility scope - who can access the tool.");j({resourceUri:U().optional(),visibility:fe(K2).optional().describe(`Who can access this tool. Default: ["model", "app"]
|
|
82
82
|
- "model": Tool visible to and callable by the agent
|
|
83
|
-
- "app": Tool callable by the app from this server only`)});
|
|
84
|
-
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:U().optional().describe("User's language and region preference in BCP 47 format."),timeZone:U().optional().describe("User's timezone in IANA format."),userAgent:U().optional().describe("Host application identifier."),platform:ye([G("web"),G("desktop"),G("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:Y({touch:Ae().optional().describe("Whether the device supports touch input."),hover:Ae().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:Y({top:me().describe("Top safe area inset in pixels."),right:me().describe("Right safe area inset in pixels."),bottom:me().describe("Bottom safe area inset in pixels."),left:me().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),Q2=Y({method:G("ui/notifications/host-context-changed"),params:bl.describe("Partial context update containing only changed fields.")});Y({method:G("ui/update-model-context"),params:Y({content:fe(Ut).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:Ce(U(),Te().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})});Y({method:G("ui/initialize"),params:Y({appInfo:lr.describe("App identification (name and version)."),appCapabilities:V2.describe("Features and capabilities this app provides."),protocolVersion:U().describe("Protocol version this app supports.")})});var eg=Y({protocolVersion:U().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:lr.describe("Host application identification and version."),hostCapabilities:W2.describe("Features and capabilities provided by the host."),hostContext:bl.describe("Rich context about the host environment.")}).passthrough();class tg extends z2{constructor(a,n={},r={autoResize:!0}){super(r);Ge(this,"_appInfo");Ge(this,"_capabilities");Ge(this,"options");Ge(this,"_hostCapabilities");Ge(this,"_hostInfo");Ge(this,"_hostContext");Ge(this,"sendOpenLink",this.openLink);this._appInfo=a,this._capabilities=n,this.options=r,this.setRequestHandler(ur,i=>(console.log("Received ping:",i.params),{})),this.onhostcontextchanged=()=>{}}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}set ontoolinput(a){this.setNotificationHandler($2,n=>a(n.params))}set ontoolinputpartial(a){this.setNotificationHandler(Z2,n=>a(n.params))}set ontoolresult(a){this.setNotificationHandler(J2,n=>a(n.params))}set ontoolcancelled(a){this.setNotificationHandler(G2,n=>a(n.params))}set onhostcontextchanged(a){this.setNotificationHandler(Q2,n=>{this._hostContext={...this._hostContext,...n.params},a(n.params)})}set onteardown(a){this.setRequestHandler(Y2,(n,r)=>a(n.params,r))}set oncalltool(a){this.setRequestHandler(vl,(n,r)=>a(n.params,r))}set onlisttools(a){this.setRequestHandler(gl,(n,r)=>a(n.params,r))}assertCapabilityForMethod(a){}assertRequestHandlerCapability(a){switch(a){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${a})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${a} registered`)}}assertNotificationCapability(a){}assertTaskCapability(a){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(a){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(a,n){if(typeof a=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${a}"). Did you mean: callServerTool({ name: "${a}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:a},hr,n)}async readServerResource(a,n){return await this.request({method:"resources/read",params:a},fl,n)}async listServerResources(a,n){return await this.request({method:"resources/list",params:a},hl,n)}sendMessage(a,n){return this.request({method:"ui/message",params:a},H2,n)}sendLog(a){return this.notification({method:"notifications/message",params:a})}updateModelContext(a,n){return this.request({method:"ui/update-model-context",params:a},xa,n)}openLink(a,n){return this.request({method:"ui/open-link",params:a},D2,n)}downloadFile(a,n){return this.request({method:"ui/download-file",params:a},F2,n)}requestDisplayMode(a,n){return this.request({method:"ui/request-display-mode",params:a},X2,n)}sendSizeChanged(a){return this.notification({method:"ui/notifications/size-changed",params:a})}setupSizeChangedNotifications(){let a=!1,n=0,r=0,i=()=>{a||(a=!0,requestAnimationFrame(()=>{a=!1;let u=document.documentElement,f=u.style.width,g=u.style.height;u.style.width="fit-content",u.style.height="max-content";let d=u.getBoundingClientRect();u.style.width=f,u.style.height=g;let p=window.innerWidth-u.clientWidth,l=Math.ceil(d.width+p),o=Math.ceil(d.height);(l!==n||o!==r)&&(n=l,r=o,this.sendSizeChanged({width:l,height:o}))}))};i();let c=new ResizeObserver(i);return c.observe(document.documentElement),c.observe(document.body),()=>c.disconnect()}async connect(a=new q2(window.parent,window.parent),n){var r;if(this.transport)throw Error("App is already connected. Call close() before connecting again.");await super.connect(a);try{let i=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:I2}},eg,n);if(i===void 0)throw Error(`Server sent invalid initialize result: ${i}`);this._hostCapabilities=i.hostCapabilities,this._hostInfo=i.hostInfo,this._hostContext=i.hostContext,await this.notification({method:"ui/notifications/initialized"}),(r=this.options)!=null&&r.autoResize&&this.setupSizeChangedNotifications()}catch(i){throw this.close(),i}}}function rg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mr,Si;function ng(){if(Si)return mr;Si=1;var e="6.6.0";return mr=e,mr}var br,Ti;function Ha(){if(Ti)return br;Ti=1;var e=function(a,n){var r=this;if(n||(n={}),r.qpm=n.qpm?parseInt(n.qpm,10):null,!r.qpm){var i=a.metaText?a.metaText.tempo:null;r.qpm=a.getBpm(i)}r.extraMeasuresAtBeginning=n.extraMeasuresAtBeginning?parseInt(n.extraMeasuresAtBeginning,10):0,r.beatCallback=n.beatCallback,r.eventCallback=n.eventCallback,r.lineEndCallback=n.lineEndCallback,r.lineEndAnticipation=n.lineEndAnticipation?parseInt(n.lineEndAnticipation,10):0,r.beatSubdivisions=n.beatSubdivisions?parseInt(n.beatSubdivisions,10):1,r.beatSubdivisions||(r.beatSubdivisions=1),r.joggerTimer=null,r.replaceTarget=function(u){if(r.noteTimings=u.setTiming(r.qpm,r.extraMeasuresAtBeginning),u.noteTimings.length===0&&(r.noteTimings=u.setTiming(0,0)),r.lineEndCallback&&(r.lineEndTimings=t(u.noteTimings,r.lineEndAnticipation)),r.startTime=null,r.currentBeat=0,r.currentEvent=0,r.currentLine=0,r.currentTime=0,r.isPaused=!1,r.isRunning=!1,r.pausedPercent=null,r.justUnpaused=!1,r.newSeekPercent=0,r.lastTimestamp=0,r.noteTimings.length!==0){r.millisecondsPerBeat=1e3/(r.qpm/60)/r.beatSubdivisions,r.lastMoment=r.noteTimings[r.noteTimings.length-1].milliseconds;var f=u.getMeter(),g="";if(f&&f.type==="specified"&&f.value&&f.value.length>0&&f.value[0].num.indexOf("+")>0&&(g=f.value[0].num),r.beatStarts=[],g){for(var d=r.noteTimings[r.noteTimings.length-1].millisecondsPerMeasure,p=r.lastMoment/d,l=g.split("+"),o=0;o<l.length;o++)l[o]=parseInt(l[o],10)/2;for(var h=0,s=0,v=0;v<p;v++)for(var y=v*d,m=0,_=0;_<l.length;_++){var k=l[_];if(r.beatSubdivisions===1)r.beatSubdivisions===1&&h<r.lastMoment&&r.beatStarts.push({b:s,ts:h}),h+=k*r.millisecondsPerBeat;else for(var x=k*r.beatSubdivisions,R=0;R<Math.floor(x);R++){var I=R/x,b=Math.round(y+m*r.millisecondsPerBeat);b<r.lastMoment&&r.beatStarts.push({b:s+I,ts:b}),m++}s++}r.beatStarts.push({b:p*l.length,ts:r.lastMoment}),r.totalBeats=r.beatStarts.length}else{r.totalBeats=Math.round(r.lastMoment/r.millisecondsPerBeat);for(var A=0;A<r.totalBeats+1;A++)r.beatStarts.push({b:A/r.beatSubdivisions,ts:Math.round(A*r.millisecondsPerBeat)})}}},r.replaceTarget(a),r.doTiming=function(u){if(r.lastTimestamp!==u&&(r.lastTimestamp=u,!r.isPaused&&r.isRunning)){for(r.startTime||(r.startTime=u),r.currentTime=u-r.startTime,r.currentTime+=16;r.noteTimings.length>r.currentEvent&&r.noteTimings[r.currentEvent].milliseconds<r.currentTime;){if(r.eventCallback&&r.noteTimings[r.currentEvent].type==="event"){var f=r.startTime;r.eventCallback(r.noteTimings[r.currentEvent]),f!==r.startTime&&(r.currentTime=u-r.startTime)}r.currentEvent++}if(r.lineEndCallback&&r.lineEndTimings.length>r.currentLine&&r.lineEndTimings[r.currentLine].milliseconds<r.currentTime&&r.currentEvent<r.noteTimings.length){var g=r.noteTimings[r.currentEvent].milliseconds===r.currentTime?r.noteTimings[r.currentEvent]:r.noteTimings[r.currentEvent-1];r.lineEndCallback(r.lineEndTimings[r.currentLine],g,{line:r.currentLine,endTimings:r.lineEndTimings,currentTime:r.currentTime}),r.currentLine++}if(r.currentTime<r.lastMoment){if(requestAnimationFrame(r.doTiming),r.currentBeat<r.beatStarts.length&&r.beatStarts[r.currentBeat].ts<=r.currentTime){var d=r.doBeatCallback(u);r.currentBeat++,d!==null&&(r.currentTime=d)}}else if(r.currentBeat<=r.totalBeats&&r.beatCallback){var p=r.doBeatCallback(u);r.currentBeat++,p!==null&&(r.currentTime=p),requestAnimationFrame(r.doTiming)}if(r.currentTime>=r.lastMoment)if(r.eventCallback){var l=r.eventCallback(null);r.shouldStop(l).then(function(o){o&&r.stop()})}else r.stop()}},r.shouldStop=function(u){return new Promise(function(f){if(!u)return f(!0);if(u==="continue")return f(!1);u.then&&u.then(function(g){f(g!=="continue")})})},r.doBeatCallback=function(u){if(r.beatCallback){for(var f=r.currentEvent;f<r.noteTimings.length&&r.noteTimings[f].left===null;)f++;var g,d;if(f<r.noteTimings.length){for(g=r.noteTimings[f].milliseconds,f=Math.max(0,r.currentEvent-1);f>=0&&r.noteTimings[f].left===null;)f--;d=r.noteTimings[f]}var p={},l={};if(d){p.top=d.top,p.height=d.height;var o=Math.max(0,u-r.startTime-d.milliseconds),h=g-d.milliseconds,s=d.endX-d.left,v=h?o*s/h:0;p.left=d.left+v,r.currentEvent===0&&d.milliseconds>u-r.startTime&&(p.left=void 0),l={timestamp:u,startTime:r.startTime,ev:d,endMs:g,offMs:o,offPx:v,gapMs:h,gapPx:s}}else l={timestamp:u,startTime:r.startTime};var y=r.startTime;if(r.beatCallback(r.beatStarts[r.currentBeat].b,r.totalBeats/r.beatSubdivisions,r.lastMoment,p,l),y!==r.startTime)return u-r.startTime}return null};var c=60;r.animationJogger=function(){r.isRunning&&(r.doTiming(performance.now()),r.joggerTimer=setTimeout(r.animationJogger,c))},r.start=function(u,f){if(r.isRunning=!0,r.isPaused&&(r.isPaused=!1,u===void 0&&(r.justUnpaused=!0)),u)r.setProgress(u,f);else if(u===0)r.reset();else if(r.pausedPercent!==null){var g=performance.now();r.currentTime=r.lastMoment*r.pausedPercent,r.startTime=g-r.currentTime,r.pausedPercent=null,r.reportNext=!0}requestAnimationFrame(r.doTiming),r.joggerTimer=setTimeout(r.animationJogger,c)},r.pause=function(){r.isPaused=!0;var u=performance.now();r.pausedPercent=(u-r.startTime)/r.lastMoment,r.isRunning=!1,r.joggerTimer&&(clearTimeout(r.joggerTimer),r.joggerTimer=null)},r.currentMillisecond=function(){return r.currentTime},r.reset=function(){r.currentBeat=0,r.currentEvent=0,r.currentLine=0,r.startTime=null,r.pausedPercent=null},r.stop=function(){r.pause(),r.reset()},r.setProgress=function(u,f){var g;switch(f){case"seconds":r.currentTime=u*1e3,r.currentTime<0&&(r.currentTime=0),r.currentTime>r.lastMoment&&(r.currentTime=r.lastMoment),g=r.currentTime/r.lastMoment;break;case"beats":r.currentTime=u*r.millisecondsPerBeat*r.beatSubdivisions,r.currentTime<0&&(r.currentTime=0),r.currentTime>r.lastMoment&&(r.currentTime=r.lastMoment),g=r.currentTime/r.lastMoment;break;default:g=u,g<0&&(g=0),g>1&&(g=1),r.currentTime=r.lastMoment*g;break}r.isRunning||(r.pausedPercent=g);var d=performance.now();for(r.startTime=d-r.currentTime,r.currentEvent=0;r.noteTimings.length>r.currentEvent&&r.noteTimings[r.currentEvent].milliseconds<r.currentTime;)r.currentEvent++;if(r.lineEndCallback)for(r.currentLine=0;r.lineEndTimings.length>r.currentLine&&r.lineEndTimings[r.currentLine].milliseconds+r.lineEndAnticipation<r.currentTime;)r.currentLine++;var p=r.currentBeat;for(r.currentBeat=0;r.currentBeat<r.beatStarts.length&&!(r.beatStarts[r.currentBeat].ts>r.currentTime);r.currentBeat++);r.currentBeat--,r.beatCallback&&p!==r.currentBeat&&(r.doBeatCallback(r.startTime+r.currentTime),r.currentBeat++),r.eventCallback&&r.currentEvent>=0&&r.noteTimings[r.currentEvent].type==="event"&&r.eventCallback(r.noteTimings[r.currentEvent]),r.lineEndCallback&&r.lineEndCallback(r.lineEndTimings[r.currentLine],r.noteTimings[r.currentEvent],{line:r.currentLine,endTimings:r.lineEndTimings}),r.joggerTimer=setTimeout(r.animationJogger,c)}};function t(a,n){for(var r=[],i=null,c=0;c<a.length;c++){var u=a[c];u.type!=="end"&&u.top!==i&&(r.push({measureNumber:u.measureNumber,milliseconds:u.milliseconds-n,top:u.top,bottom:u.top+u.height}),i=u.top)}return r}return br=e,br}var yr,Ei;function ag(){if(Ei)return yr;Ei=1;var e=Ha(),t={};return(function(){var a,n;t.startAnimation=function(r,i,c){a&&(a.stop(),a=void 0),c.showCursor&&(n=r.querySelector(".abcjs-cursor"),n||(n=document.createElement("DIV"),n.className="abcjs-cursor cursor",n.style.position="absolute",r.appendChild(n),r.style.position="relative"));function u(h){for(var s=0;s<h.length;s++){var v=h[s];v.classList.contains("abcjs-bar")||(v.style.display="none")}}var f;function g(h){if(f){var s=r.querySelectorAll(f);u(s)}f=h}function d(h){var s=r.querySelectorAll(h);u(s)}function p(h){c.hideCurrentMeasure?d(h):c.hideFinishedMeasures&&g(h)}function l(h){return".abcjs-l"+h.line+".abcjs-m"+h.measureNumber}function o(h){if(h){if(h.measureStart){var s=l(h);s&&p(s)}n&&(n.style.left=h.left+"px",n.style.top=h.top+"px",n.style.width=h.width+"px",n.style.height=h.height+"px")}else a.stop(),a=void 0}a=new e(i,{qpm:c.bpm,eventCallback:o}),a.start()},t.pauseAnimation=function(r){a&&(r?a.pause():a.start())},t.stopAnimation=function(){a&&(a.stop(),a=void 0)}})(),yr=t,yr}var wr,Ai;function nt(){if(Ai)return wr;Ai=1;var e={};return e.cloneArray=function(t){for(var a=[],n=0;n<t.length;n++)a.push(Object.assign({},t[n]));return a},e.cloneHashOfHash=function(t){var a={};for(var n in t)t.hasOwnProperty(n)&&(a[n]=Object.assign({},t[n]));return a},e.cloneHashOfArrayOfHash=function(t){var a={};for(var n in t)t.hasOwnProperty(n)&&(a[n]=e.cloneArray(t[n]));return a},e.strip=function(t){return t.replace(/^\s+/,"").replace(/\s+$/,"")},e.startsWith=function(t,a){return t.indexOf(a)===0},e.endsWith=function(t,a){var n=t.length-a.length;return n>=0&&t.lastIndexOf(a)===n},e.last=function(t){return t.length===0?null:t[t.length-1]},wr=e,wr}var _r,Mi;function $a(){if(Mi)return _r;Mi=1;var e=nt(),t={};return(function(){var a,n,r,i,c;t.initialize=function(w,C,S,q,D){a=w,n=C,r=S,i=q,c=D,u()};function u(){r.annotationfont={face:"Helvetica",size:12,weight:"normal",style:"normal",decoration:"none"},r.gchordfont={face:"Helvetica",size:12,weight:"normal",style:"normal",decoration:"none"},r.historyfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},r.infofont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},r.measurefont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},r.partsfont={face:'"Times New Roman"',size:15,weight:"normal",style:"normal",decoration:"none"},r.repeatfont={face:'"Times New Roman"',size:13,weight:"normal",style:"normal",decoration:"none"},r.textfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},r.tripletfont={face:"Times",size:11,weight:"normal",style:"italic",decoration:"none"},r.vocalfont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},r.wordsfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},i.formatting.composerfont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},i.formatting.subtitlefont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},i.formatting.tempofont={face:'"Times New Roman"',size:15,weight:"bold",style:"normal",decoration:"none"},i.formatting.titlefont={face:'"Times New Roman"',size:20,weight:"normal",style:"normal",decoration:"none"},i.formatting.footerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},i.formatting.headerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},i.formatting.voicefont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},i.formatting.tablabelfont={face:'"Trebuchet MS"',size:16,weight:"normal",style:"normal",decoration:"none"},i.formatting.tabnumberfont={face:'"Arial"',size:11,weight:"normal",style:"normal",decoration:"none"},i.formatting.tabgracefont={face:'"Arial"',size:8,weight:"normal",style:"normal",decoration:"none"},i.formatting.annotationfont=r.annotationfont,i.formatting.gchordfont=r.gchordfont,i.formatting.historyfont=r.historyfont,i.formatting.infofont=r.infofont,i.formatting.measurefont=r.measurefont,i.formatting.partsfont=r.partsfont,i.formatting.repeatfont=r.repeatfont,i.formatting.textfont=r.textfont,i.formatting.tripletfont=r.tripletfont,i.formatting.vocalfont=r.vocalfont,i.formatting.wordsfont=r.wordsfont}var f={gchordfont:!0,measurefont:!0,partsfont:!0,annotationfont:!0,composerfont:!0,historyfont:!0,infofont:!0,subtitlefont:!0,textfont:!0,titlefont:!0,voicefont:!0},g=function(w){switch(w){case"Arial-Italic":return{face:"Arial",weight:"normal",style:"italic",decoration:"none"};case"Arial-Bold":return{face:"Arial",weight:"bold",style:"normal",decoration:"none"};case"Bookman-Demi":return{face:"Bookman,serif",weight:"bold",style:"normal",decoration:"none"};case"Bookman-DemiItalic":return{face:"Bookman,serif",weight:"bold",style:"italic",decoration:"none"};case"Bookman-Light":return{face:"Bookman,serif",weight:"normal",style:"normal",decoration:"none"};case"Bookman-LightItalic":return{face:"Bookman,serif",weight:"normal",style:"italic",decoration:"none"};case"Courier":return{face:'"Courier New"',weight:"normal",style:"normal",decoration:"none"};case"Courier-Oblique":return{face:'"Courier New"',weight:"normal",style:"italic",decoration:"none"};case"Courier-Bold":return{face:'"Courier New"',weight:"bold",style:"normal",decoration:"none"};case"Courier-BoldOblique":return{face:'"Courier New"',weight:"bold",style:"italic",decoration:"none"};case"AvantGarde-Book":return{face:"AvantGarde,Arial",weight:"normal",style:"normal",decoration:"none"};case"AvantGarde-BookOblique":return{face:"AvantGarde,Arial",weight:"normal",style:"italic",decoration:"none"};case"AvantGarde-Demi":case"Avant-Garde-Demi":return{face:"AvantGarde,Arial",weight:"bold",style:"normal",decoration:"none"};case"AvantGarde-DemiOblique":return{face:"AvantGarde,Arial",weight:"bold",style:"italic",decoration:"none"};case"Helvetica-Oblique":return{face:"Helvetica",weight:"normal",style:"italic",decoration:"none"};case"Helvetica-Bold":return{face:"Helvetica",weight:"bold",style:"normal",decoration:"none"};case"Helvetica-BoldOblique":return{face:"Helvetica",weight:"bold",style:"italic",decoration:"none"};case"Helvetica-Narrow":return{face:'"Helvetica Narrow",Helvetica',weight:"normal",style:"normal",decoration:"none"};case"Helvetica-Narrow-Oblique":return{face:'"Helvetica Narrow",Helvetica',weight:"normal",style:"italic",decoration:"none"};case"Helvetica-Narrow-Bold":return{face:'"Helvetica Narrow",Helvetica',weight:"bold",style:"normal",decoration:"none"};case"Helvetica-Narrow-BoldOblique":return{face:'"Helvetica Narrow",Helvetica',weight:"bold",style:"italic",decoration:"none"};case"Palatino-Roman":return{face:"Palatino",weight:"normal",style:"normal",decoration:"none"};case"Palatino-Italic":return{face:"Palatino",weight:"normal",style:"italic",decoration:"none"};case"Palatino-Bold":return{face:"Palatino",weight:"bold",style:"normal",decoration:"none"};case"Palatino-BoldItalic":return{face:"Palatino",weight:"bold",style:"italic",decoration:"none"};case"NewCenturySchlbk-Roman":return{face:'"New Century",serif',weight:"normal",style:"normal",decoration:"none"};case"NewCenturySchlbk-Italic":return{face:'"New Century",serif',weight:"normal",style:"italic",decoration:"none"};case"NewCenturySchlbk-Bold":return{face:'"New Century",serif',weight:"bold",style:"normal",decoration:"none"};case"NewCenturySchlbk-BoldItalic":return{face:'"New Century",serif',weight:"bold",style:"italic",decoration:"none"};case"Times":case"Times-Roman":case"Times-Narrow":case"Times-Courier":case"Times-New-Roman":return{face:'"Times New Roman"',weight:"normal",style:"normal",decoration:"none"};case"Times-Italic":case"Times-Italics":return{face:'"Times New Roman"',weight:"normal",style:"italic",decoration:"none"};case"Times-Bold":return{face:'"Times New Roman"',weight:"bold",style:"normal",decoration:"none"};case"Times-BoldItalic":return{face:'"Times New Roman"',weight:"bold",style:"italic",decoration:"none"};case"ZapfChancery-MediumItalic":return{face:'"Zapf Chancery",cursive,serif',weight:"normal",style:"normal",decoration:"none"};default:return null}},d=function(w,C,S,q,D){function $(){var Se=parseInt(w[0].token);return w.shift(),C?w.length===0?{face:C.face,weight:C.weight,style:C.style,decoration:C.decoration,size:Se}:w.length===1&&w[0].token==="box"&&f[D]?{face:C.face,weight:C.weight,style:C.style,decoration:C.decoration,size:Se,box:!0}:(n("Extra parameters in font definition.",S,q),{face:C.face,weight:C.weight,style:C.style,decoration:C.decoration,size:Se}):(n("Can't set just the size of the font since there is no default value.",S,q),{face:'"Times New Roman"',weight:"normal",style:"normal",decoration:"none",size:Se})}if(w[0].token==="*"){if(w.shift(),w[0].type==="number")return $();n("Expected font size number after *.",S,q)}if(w[0].type==="number")return $();for(var F=[],K,te="normal",V="normal",ae="none",oe=!1,le="face",J=!1;w.length;){var ce=w.shift(),ee=ce.token.toLowerCase();switch(le){case"face":J||ee!=="utf"&&ce.type!=="number"&&ee!=="bold"&&ee!=="italic"&&ee!=="underline"&&ee!=="box"?F.length>0&&ce.token==="-"?(J=!0,F[F.length-1]=F[F.length-1]+ce.token):J?(J=!1,F[F.length-1]=F[F.length-1]+ce.token):F.push(ce.token):ce.type==="number"?(K?n("Font size specified twice in font definition.",S,q):K=ce.token,le="modifier"):ee==="bold"?te="bold":ee==="italic"?V="italic":ee==="underline"?ae="underline":ee==="box"?(f[D]?oe=!0:n(`This font style doesn't support "box"`,S,q),le="finished"):ee==="utf"?(ce=w.shift(),le="size"):n("Unknown parameter "+ce.token+" in font definition.",S,q);break;case"size":ce.type==="number"?K?n("Font size specified twice in font definition.",S,q):K=ce.token:n("Expected font size in font definition.",S,q),le="modifier";break;case"modifier":ee==="bold"?te="bold":ee==="italic"?V="italic":ee==="underline"?ae="underline":ee==="box"?(f[D]?oe=!0:n(`This font style doesn't support "box"`,S,q),le="finished"):n("Unknown parameter "+ce.token+" in font definition.",S,q);break;case"finished":n('Extra characters found after "box" in font definition.',S,q);break}}K===void 0?C?K=C.size:(n("Must specify the size of the font since there is no default value.",S,q),K=12):K=parseFloat(K),F=F.join(" "),F===""&&(C?F=C.face:(n("Must specify the name of the font since there is no default value.",S,q),F="sans-serif"));var he=g(F),de={};return he?(de.face=he.face,de.weight=he.weight,de.style=he.style,de.decoration=he.decoration,de.size=K,oe&&(de.box=!0),de):(de.face=F,de.weight=te,de.style=V,de.decoration=ae,de.size=K,oe&&(de.box=!0),de)},p=function(w,C,S){return C.length===0?'Directive "'+w+'" requires a font as a parameter.':(r[w]=d(C,r[w],S,0,w),r.is_in_header&&(i.formatting[w]=r[w]),null)},l=function(w,C,S){return C.length===0?'Directive "'+w+'" requires a font as a parameter.':(i.formatting[w]=d(C,i.formatting[w],S,0,w),null)},o=function(w,C){var S="";C.forEach(function(D){S+=D.token});var q=parseFloat(S);if(isNaN(q)||q===0)return'Directive "'+w+'" requires a number as a parameter.';i.formatting.scale=q},h=["acoustic-bass-drum","bass-drum-1","side-stick","acoustic-snare","hand-clap","electric-snare","low-floor-tom","closed-hi-hat","high-floor-tom","pedal-hi-hat","low-tom","open-hi-hat","low-mid-tom","hi-mid-tom","crash-cymbal-1","high-tom","ride-cymbal-1","chinese-cymbal","ride-bell","tambourine","splash-cymbal","cowbell","crash-cymbal-2","vibraslap","ride-cymbal-2","hi-bongo","low-bongo","mute-hi-conga","open-hi-conga","low-conga","high-timbale","low-timbale","high-agogo","low-agogo","cabasa","maracas","short-whistle","long-whistle","short-guiro","long-guiro","claves","hi-wood-block","low-wood-block","mute-cuica","open-cuica","mute-triangle","open-triangle"],s=function(w){var C=w.split(/\s+/);if(C.length!==2&&C.length!==3)return{error:'Expected parameters "abc-note", "drum-sound", and optionally "note-head"'};var S=C[0],q=parseInt(C[1],10);if((isNaN(q)||q<35||q>81)&&C[1]&&(q=h.indexOf(C[1].toLowerCase())+35),isNaN(q)||q<35||q>81)return{error:'Expected drum name, received "'+C[1]+'"'};var D={sound:q};return C.length===3&&(D.noteHead=C[2]),{key:S,value:D}},v=function(w,C){var S=a.getMeasurement(C);return S.used===0||C.length!==0?{error:'Directive "'+w+'" requires a measurement as a parameter.'}:S.value},y=function(w,C){var S=a.getMeasurement(C);return S.used===0||C.length!==0?'Directive "'+w+'" requires a measurement as a parameter.':(i.formatting[w]=S.value,null)},m=function(w,C,S,q,D){if(S.length!==1||S[0].type!=="number")return'Directive "'+C+'" requires a number as a parameter.';var $=S[0].intt;return q!==void 0&&$<q?'Directive "'+C+'" requires a number greater than or equal to '+q+" as a parameter.":D!==void 0&&$>D?'Directive "'+C+'" requires a number less than or equal to '+D+" as a parameter.":(r[w]=$,null)},_=function(w,C,S){if(S.length===1&&(S[0].token==="true"||S[0].token==="false"))return r[w]=S[0].token==="true",null;var q=m(w,C,S,0,1);return q!==null?q:(r[w]=r[w]===1,null)},k=function(w,C,S,q){if(S.length!==1)return'Directive "'+C+'" requires one of [ '+q.join(", ")+" ] as a parameter.";for(var D=S[0].token,$=!1,F=0;!$&&F<q.length;F++)q[F]===D&&($=!0);return $?(r[w]=D,null):'Directive "'+C+'" requires one of [ '+q.join(", ")+" ] as a parameter."},x=["nobarlines","barlines","beataccents","nobeataccents","droneon","droneoff","drumon","drumoff","fermatafixed","fermataproportional","gchordon","gchordoff","controlcombo","temperamentnormal","noportamento"],R=["gchord","ptstress","beatstring"],I=["bassvol","chordvol","c","channel","beatmod","deltaloudness","drumbars","gracedivider","makechordchannels","randomchordattack","chordattack","stressmodel","transpose","rtranspose","vol","volinc","gchordbars"],b=["program"],A=["ratio","snt","bendvelocity","pitchbend","control","temperamentlinear"],N=["beat"],M=["drone"],z=["portamento"],L=["expand","grace","trim"],E=["drum","chordname"],T=["bassprog","chordprog"],P=function(w,C,S){var q=w.shift().token,D=[];if(x.indexOf(q)>=0)w.length!==0&&n("Unexpected parameter in MIDI "+q,S,0);else if(R.indexOf(q)>=0)w.length!==1?n("Expected one parameter in MIDI "+q,S,0):D.push(w[0].token);else if(I.indexOf(q)>=0)w.length!==1?n("Expected one parameter in MIDI "+q,S,0):w[0].type!=="number"?n("Expected one integer parameter in MIDI "+q,S,0):D.push(w[0].intt);else if(b.indexOf(q)>=0)w.length!==1&&w.length!==2?n("Expected one or two parameters in MIDI "+q,S,0):w[0].type!=="number"||w.length===2&&w[1].type!=="number"?n("Expected integer parameter in MIDI "+q,S,0):(D.push(w[0].intt),w.length===2&&D.push(w[1].intt));else if(A.indexOf(q)>=0)w.length!==2?n("Expected two parameters in MIDI "+q,S,0):w[0].type!=="number"||w[1].type!=="number"?n("Expected two integer parameters in MIDI "+q,S,0):(D.push(w[0].intt),D.push(w[1].intt));else if(z.indexOf(q)>=0)w.length!==2?n("Expected two parameters in MIDI "+q,S,0):w[0].type!=="alpha"||w[1].type!=="number"?n("Expected one string and one integer parameters in MIDI "+q,S,0):(D.push(w[0].token),D.push(w[1].intt));else if(q==="drummap")w.length===2&&w[0].type==="alpha"&&w[1].type==="number"?(C.formatting||(C.formatting={}),C.formatting.midi||(C.formatting.midi={}),C.formatting.midi.drummap||(C.formatting.midi.drummap={}),C.formatting.midi.drummap[w[0].token]=w[1].intt,D=C.formatting.midi.drummap):w.length===3&&w[0].type==="punct"&&w[1].type==="alpha"&&w[2].type==="number"?(C.formatting||(C.formatting={}),C.formatting.midi||(C.formatting.midi={}),C.formatting.midi.drummap||(C.formatting.midi.drummap={}),C.formatting.midi.drummap[w[0].token+w[1].token]=w[2].intt,D=C.formatting.midi.drummap):n("Expected one note name and one integer parameter in MIDI "+q,S,0);else if(L.indexOf(q)>=0)w.length!==3||w[0].type!=="number"||w[1].token!=="/"||w[2].type!=="number"?n("Expected fraction parameter in MIDI "+q,S,0):(D.push(w[0].intt),D.push(w[2].intt));else if(N.indexOf(q)>=0)w.length!==4?n("Expected four parameters in MIDI "+q,S,0):w[0].type!=="number"||w[1].type!=="number"||w[2].type!=="number"||w[3].type!=="number"?n("Expected four integer parameters in MIDI "+q,S,0):(D.push(w[0].intt),D.push(w[1].intt),D.push(w[2].intt),D.push(w[3].intt));else if(M.indexOf(q)>=0)w.length!==5?n("Expected five parameters in MIDI "+q,S,0):w[0].type!=="number"||w[1].type!=="number"||w[2].type!=="number"||w[3].type!=="number"||w[4].type!=="number"?n("Expected five integer parameters in MIDI "+q,S,0):(D.push(w[0].intt),D.push(w[1].intt),D.push(w[2].intt),D.push(w[3].intt),D.push(w[4].intt));else if(b.indexOf(q)>=0)w.length!==1||w.length!==4?n("Expected one or two parameters in MIDI "+q,S,0):w[0].type!=="number"?n("Expected integer parameter in MIDI "+q,S,0):w.length===4?(w[1].token!=="octave"&&n("Expected octave parameter in MIDI "+q,S,0),w[2].token!=="="&&n("Expected octave parameter in MIDI "+q,S,0),w[3].type!=="number"&&n("Expected integer parameter for octave in MIDI "+q,S,0)):(D.push(w[0].intt),w.length===4&&D.push(w[3].intt));else if(E.indexOf(q)>=0)if(w.length<2)n("Expected string parameter and at least one integer parameter in MIDI "+q,S,0);else if(w[0].type!=="alpha")n("Expected string parameter and at least one integer parameter in MIDI "+q,S,0);else{var $=w.shift();for(D.push($.token);w.length>0;)$=w.shift(),$.type!=="number"&&n("Expected integer parameter in MIDI "+q,S,0),D.push($.intt)}else if(T.indexOf(q)>=0){if(w.length!==1&&w.length!==2)n("Expected one or two parameters in MIDI "+q,S,0);else if(w[0].type!=="number")n("Expected integer parameter in MIDI "+q,S,0);else if(w.length===2&&w[1].type!=="alpha")n("Expected alpha parameter in MIDI "+q,S,0);else if(D.push(w[0].intt),w.length===2){var F=w[1].token;F.indexOf("octave=")!=-1?(F=F.replace("octave=",""),F=parseInt(F),isNaN(F)?n("Expected octave value in MIDI"+q):(F<-1&&(n("Expected octave= in MIDI "+q+" to be >= -1 (recv:"+F+")"),F=-1),F>3&&(n("Expected octave= in MIDI "+q+" to be <= 3 (recv:"+F+")"),F=3),D.push(F))):n("Expected octave= in MIDI"+q)}}c.hasBeginMusic()?c.appendElement("midi",-1,-1,{cmd:q,params:D}):(C.formatting.midi===void 0&&(C.formatting.midi={}),C.formatting.midi[q]=D)};t.parseFontChangeLine=function(w){w=w.replace(/\$\$/g,"");var C=w.split("$");if(C.length>1&&r.setfont){var S=[];C[0]!==""&&S.push({text:C[0]});for(var q=1;q<C.length;q++)if(C[q][0]==="0")S.push({text:C[q].substring(1).replace(/\x03/g,"$$")});else{var D=parseInt(C[q][0],10);r.setfont[D]?S.push({font:r.setfont[D],text:C[q].substring(1).replace(/\x03/g,"$$")}):S[S.length-1].text+="$"+C[q].replace(/\x03/g,"$$")}return S}return w.replace(/\x03/g,"$$")};var B=["auto","above","below","hidden"];t.addDirective=function(w){var C=a.tokenize(w,0,w.length);if(C.length===0||C[0].type!=="alpha")return null;var S=w.substring(w.indexOf(C[0].token)+C[0].token.length);S=a.stripComment(S);var q=C.shift().token.toLowerCase(),D="",$;switch(q){case"bagpipes":i.formatting.bagpipes=!0;break;case"flatbeams":i.formatting.flatbeams=!0;break;case"jazzchords":i.formatting.jazzchords=!0;break;case"accentAbove":i.formatting.accentAbove=!0;break;case"germanAlphabet":i.formatting.germanAlphabet=!0;break;case"landscape":r.landscape=!0;break;case"papersize":r.papersize=S;break;case"graceslurs":if(C.length!==1)return"Directive graceslurs requires one parameter: 0 or 1";if(C[0].token==="0"||C[0].token==="false")i.formatting.graceSlurs=!1;else if(C[0].token==="1"||C[0].token==="true")i.formatting.graceSlurs=!0;else return"Directive graceslurs requires one parameter: 0 or 1 (received "+C[0].token+")";break;case"lineThickness":var F=O(C);if(F.value!==void 0&&(i.formatting.lineThickness=F.value),F.error)return F.error;break;case"stretchlast":var K=O(C);if(K.value!==void 0&&(i.formatting.stretchlast=K.value),K.error)return K.error;break;case"titlecaps":r.titlecaps=!0;break;case"titleleft":i.formatting.titleleft=!0;break;case"measurebox":i.formatting.measurebox=!0;break;case"vocal":return k("vocalPosition",q,C,B);case"dynamic":return k("dynamicPosition",q,C,B);case"gchord":return k("chordPosition",q,C,B);case"ornament":return k("ornamentPosition",q,C,B);case"volume":return k("volumePosition",q,C,B);case"botmargin":case"botspace":case"composerspace":case"indent":case"leftmargin":case"linesep":case"musicspace":case"partsspace":case"pageheight":case"pagewidth":case"rightmargin":case"stafftopmargin":case"staffsep":case"staffwidth":case"subtitlespace":case"sysstaffsep":case"systemsep":case"textspace":case"titlespace":case"topmargin":case"topspace":case"vocalspace":case"wordsspace":return y(q,C);case"voicescale":if(C.length!==1||C[0].type!=="number")return"voicescale requires one float as a parameter";var te=C.shift();return r.currentVoice&&(r.currentVoice.scale=te.floatt,c.changeVoiceScale(r.currentVoice.scale)),null;case"voicecolor":if(C.length!==1)return"voicecolor requires one string as a parameter";var V=C.shift();return r.currentVoice&&(r.currentVoice.color=V.token,c.changeVoiceColor(r.currentVoice.color)),null;case"vskip":var ae=Math.round(v(q,C));return ae.error?ae.error:(c.addSpacing(ae),null);case"scale":o(q,C);break;case"sep":if(C.length===0)c.addSeparator(14,14,85,{startChar:r.iChar,endChar:r.iChar+5});else{var oe=a.getMeasurement(C);if(oe.used===0)return'Directive "'+q+'" requires 3 numbers: space above, space below, length of line';var le=oe.value;if(oe=a.getMeasurement(C),oe.used===0)return'Directive "'+q+'" requires 3 numbers: space above, space below, length of line';var J=oe.value;if(oe=a.getMeasurement(C),oe.used===0||C.length!==0)return'Directive "'+q+'" requires 3 numbers: space above, space below, length of line';var ce=oe.value;c.addSeparator(le,J,ce,{startChar:r.iChar,endChar:r.iChar+S.length})}break;case"barsperstaff":if(D=m("barsperstaff",q,C),D!==null)return D;break;case"staffnonote":if(C.length!==1)return"Directive staffnonote requires one parameter: 0 or 1";if(C[0].token==="0")r.staffnonote=!0;else if(C[0].token==="1")r.staffnonote=!1;else return"Directive staffnonote requires one parameter: 0 or 1 (received "+C[0].token+")";break;case"printtempo":if(D=_("printTempo",q,C),D!==null)return D;break;case"partsbox":if(D=_("partsBox",q,C),D!==null)return D;r.partsfont.box=r.partsBox;break;case"freegchord":if(D=_("freegchord",q,C),D!==null)return D;break;case"measurenb":case"barnumbers":if(D=m("barNumbers",q,C),D!==null)return D;break;case"setbarnb":if(C.length!==1||C[0].type!=="number")return"Directive setbarnb requires a number as a parameter.";r.currBarNumber=c.setBarNumberImmediate(C[0].intt);break;case"keywarn":if(C.length!==1||C[0].type!=="number"||C[0].intt!==1&&C[0].intt!==0)return"Directive "+q+" requires 0 or 1 as a parameter.";r[q]=C[0].intt===1;break;case"begintext":var ee="";for($=a.nextLine();$&&$.indexOf("%%endtext")!==0;){if(e.startsWith($,"%%")){var he=$.substring(2);he=he.trim()+`
|
|
83
|
+
- "app": Tool callable by the app from this server only`)});j({mimeTypes:fe(U()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});j({method:G("ui/download-file"),params:j({contents:fe(ye([dl,pl])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})});j({method:G("ui/message"),params:j({role:G("user").describe('Message role, currently only "user" is supported.'),content:fe(Ut).describe("Message content blocks (text, image, etc.).")})});j({method:G("ui/notifications/sandbox-resource-ready"),params:j({html:U().describe("HTML content to load into the inner iframe."),sandbox:U().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:Da.optional().describe("CSP configuration from resource metadata."),permissions:Fa.optional().describe("Sandbox permissions from resource metadata.")})});var J2=j({method:G("ui/notifications/tool-result"),params:hr.describe("Standard MCP tool execution result.")}),bl=j({toolInfo:j({id:Dt.optional().describe("JSON-RPC id of the tools/call request."),tool:Oa.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:B2.optional().describe("Current color theme preference."),styles:j2.optional().describe("Style configuration for theming the app."),displayMode:Bt.optional().describe("How the UI is currently displayed."),availableDisplayModes:fe(Bt).optional().describe("Display modes the host supports."),containerDimensions:ye([j({height:me().describe("Fixed container height in pixels.")}),j({maxHeight:ye([me(),la()]).optional().describe("Maximum container height in pixels.")})]).and(ye([j({width:me().describe("Fixed container width in pixels.")}),j({maxWidth:ye([me(),la()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
|
|
84
|
+
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:U().optional().describe("User's language and region preference in BCP 47 format."),timeZone:U().optional().describe("User's timezone in IANA format."),userAgent:U().optional().describe("Host application identifier."),platform:ye([G("web"),G("desktop"),G("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:j({touch:Ae().optional().describe("Whether the device supports touch input."),hover:Ae().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:j({top:me().describe("Top safe area inset in pixels."),right:me().describe("Right safe area inset in pixels."),bottom:me().describe("Bottom safe area inset in pixels."),left:me().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),Q2=j({method:G("ui/notifications/host-context-changed"),params:bl.describe("Partial context update containing only changed fields.")});j({method:G("ui/update-model-context"),params:j({content:fe(Ut).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:Ce(U(),Te().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})});j({method:G("ui/initialize"),params:j({appInfo:lr.describe("App identification (name and version)."),appCapabilities:V2.describe("Features and capabilities this app provides."),protocolVersion:U().describe("Protocol version this app supports.")})});var eg=j({protocolVersion:U().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:lr.describe("Host application identification and version."),hostCapabilities:W2.describe("Features and capabilities provided by the host."),hostContext:bl.describe("Rich context about the host environment.")}).passthrough();class tg extends z2{constructor(a,n={},r={autoResize:!0}){super(r);Ge(this,"_appInfo");Ge(this,"_capabilities");Ge(this,"options");Ge(this,"_hostCapabilities");Ge(this,"_hostInfo");Ge(this,"_hostContext");Ge(this,"sendOpenLink",this.openLink);this._appInfo=a,this._capabilities=n,this.options=r,this.setRequestHandler(ur,i=>(console.log("Received ping:",i.params),{})),this.onhostcontextchanged=()=>{}}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}set ontoolinput(a){this.setNotificationHandler($2,n=>a(n.params))}set ontoolinputpartial(a){this.setNotificationHandler(Z2,n=>a(n.params))}set ontoolresult(a){this.setNotificationHandler(J2,n=>a(n.params))}set ontoolcancelled(a){this.setNotificationHandler(G2,n=>a(n.params))}set onhostcontextchanged(a){this.setNotificationHandler(Q2,n=>{this._hostContext={...this._hostContext,...n.params},a(n.params)})}set onteardown(a){this.setRequestHandler(Y2,(n,r)=>a(n.params,r))}set oncalltool(a){this.setRequestHandler(vl,(n,r)=>a(n.params,r))}set onlisttools(a){this.setRequestHandler(gl,(n,r)=>a(n.params,r))}assertCapabilityForMethod(a){}assertRequestHandlerCapability(a){switch(a){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${a})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${a} registered`)}}assertNotificationCapability(a){}assertTaskCapability(a){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(a){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(a,n){if(typeof a=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${a}"). Did you mean: callServerTool({ name: "${a}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:a},hr,n)}async readServerResource(a,n){return await this.request({method:"resources/read",params:a},fl,n)}async listServerResources(a,n){return await this.request({method:"resources/list",params:a},hl,n)}sendMessage(a,n){return this.request({method:"ui/message",params:a},H2,n)}sendLog(a){return this.notification({method:"notifications/message",params:a})}updateModelContext(a,n){return this.request({method:"ui/update-model-context",params:a},xa,n)}openLink(a,n){return this.request({method:"ui/open-link",params:a},D2,n)}downloadFile(a,n){return this.request({method:"ui/download-file",params:a},F2,n)}requestTeardown(a={}){return this.notification({method:"ui/notifications/request-teardown",params:a})}requestDisplayMode(a,n){return this.request({method:"ui/request-display-mode",params:a},X2,n)}sendSizeChanged(a){return this.notification({method:"ui/notifications/size-changed",params:a})}setupSizeChangedNotifications(){let a=!1,n=0,r=0,i=()=>{a||(a=!0,requestAnimationFrame(()=>{a=!1;let u=document.documentElement,f=u.style.width,g=u.style.height;u.style.width="fit-content",u.style.height="max-content";let d=u.getBoundingClientRect();u.style.width=f,u.style.height=g;let p=window.innerWidth-u.clientWidth,l=Math.ceil(d.width+p),o=Math.ceil(d.height);(l!==n||o!==r)&&(n=l,r=o,this.sendSizeChanged({width:l,height:o}))}))};i();let c=new ResizeObserver(i);return c.observe(document.documentElement),c.observe(document.body),()=>c.disconnect()}async connect(a=new q2(window.parent,window.parent),n){var r;if(this.transport)throw Error("App is already connected. Call close() before connecting again.");await super.connect(a);try{let i=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:I2}},eg,n);if(i===void 0)throw Error(`Server sent invalid initialize result: ${i}`);this._hostCapabilities=i.hostCapabilities,this._hostInfo=i.hostInfo,this._hostContext=i.hostContext,await this.notification({method:"ui/notifications/initialized"}),(r=this.options)!=null&&r.autoResize&&this.setupSizeChangedNotifications()}catch(i){throw this.close(),i}}}function rg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mr,Si;function ng(){if(Si)return mr;Si=1;var e="6.6.0";return mr=e,mr}var br,Ti;function Ha(){if(Ti)return br;Ti=1;var e=function(a,n){var r=this;if(n||(n={}),r.qpm=n.qpm?parseInt(n.qpm,10):null,!r.qpm){var i=a.metaText?a.metaText.tempo:null;r.qpm=a.getBpm(i)}r.extraMeasuresAtBeginning=n.extraMeasuresAtBeginning?parseInt(n.extraMeasuresAtBeginning,10):0,r.beatCallback=n.beatCallback,r.eventCallback=n.eventCallback,r.lineEndCallback=n.lineEndCallback,r.lineEndAnticipation=n.lineEndAnticipation?parseInt(n.lineEndAnticipation,10):0,r.beatSubdivisions=n.beatSubdivisions?parseInt(n.beatSubdivisions,10):1,r.beatSubdivisions||(r.beatSubdivisions=1),r.joggerTimer=null,r.replaceTarget=function(u){if(r.noteTimings=u.setTiming(r.qpm,r.extraMeasuresAtBeginning),u.noteTimings.length===0&&(r.noteTimings=u.setTiming(0,0)),r.lineEndCallback&&(r.lineEndTimings=t(u.noteTimings,r.lineEndAnticipation)),r.startTime=null,r.currentBeat=0,r.currentEvent=0,r.currentLine=0,r.currentTime=0,r.isPaused=!1,r.isRunning=!1,r.pausedPercent=null,r.justUnpaused=!1,r.newSeekPercent=0,r.lastTimestamp=0,r.noteTimings.length!==0){r.millisecondsPerBeat=1e3/(r.qpm/60)/r.beatSubdivisions,r.lastMoment=r.noteTimings[r.noteTimings.length-1].milliseconds;var f=u.getMeter(),g="";if(f&&f.type==="specified"&&f.value&&f.value.length>0&&f.value[0].num.indexOf("+")>0&&(g=f.value[0].num),r.beatStarts=[],g){for(var d=r.noteTimings[r.noteTimings.length-1].millisecondsPerMeasure,p=r.lastMoment/d,l=g.split("+"),o=0;o<l.length;o++)l[o]=parseInt(l[o],10)/2;for(var h=0,s=0,v=0;v<p;v++)for(var y=v*d,m=0,_=0;_<l.length;_++){var k=l[_];if(r.beatSubdivisions===1)r.beatSubdivisions===1&&h<r.lastMoment&&r.beatStarts.push({b:s,ts:h}),h+=k*r.millisecondsPerBeat;else for(var x=k*r.beatSubdivisions,R=0;R<Math.floor(x);R++){var I=R/x,b=Math.round(y+m*r.millisecondsPerBeat);b<r.lastMoment&&r.beatStarts.push({b:s+I,ts:b}),m++}s++}r.beatStarts.push({b:p*l.length,ts:r.lastMoment}),r.totalBeats=r.beatStarts.length}else{r.totalBeats=Math.round(r.lastMoment/r.millisecondsPerBeat);for(var A=0;A<r.totalBeats+1;A++)r.beatStarts.push({b:A/r.beatSubdivisions,ts:Math.round(A*r.millisecondsPerBeat)})}}},r.replaceTarget(a),r.doTiming=function(u){if(r.lastTimestamp!==u&&(r.lastTimestamp=u,!r.isPaused&&r.isRunning)){for(r.startTime||(r.startTime=u),r.currentTime=u-r.startTime,r.currentTime+=16;r.noteTimings.length>r.currentEvent&&r.noteTimings[r.currentEvent].milliseconds<r.currentTime;){if(r.eventCallback&&r.noteTimings[r.currentEvent].type==="event"){var f=r.startTime;r.eventCallback(r.noteTimings[r.currentEvent]),f!==r.startTime&&(r.currentTime=u-r.startTime)}r.currentEvent++}if(r.lineEndCallback&&r.lineEndTimings.length>r.currentLine&&r.lineEndTimings[r.currentLine].milliseconds<r.currentTime&&r.currentEvent<r.noteTimings.length){var g=r.noteTimings[r.currentEvent].milliseconds===r.currentTime?r.noteTimings[r.currentEvent]:r.noteTimings[r.currentEvent-1];r.lineEndCallback(r.lineEndTimings[r.currentLine],g,{line:r.currentLine,endTimings:r.lineEndTimings,currentTime:r.currentTime}),r.currentLine++}if(r.currentTime<r.lastMoment){if(requestAnimationFrame(r.doTiming),r.currentBeat<r.beatStarts.length&&r.beatStarts[r.currentBeat].ts<=r.currentTime){var d=r.doBeatCallback(u);r.currentBeat++,d!==null&&(r.currentTime=d)}}else if(r.currentBeat<=r.totalBeats&&r.beatCallback){var p=r.doBeatCallback(u);r.currentBeat++,p!==null&&(r.currentTime=p),requestAnimationFrame(r.doTiming)}if(r.currentTime>=r.lastMoment)if(r.eventCallback){var l=r.eventCallback(null);r.shouldStop(l).then(function(o){o&&r.stop()})}else r.stop()}},r.shouldStop=function(u){return new Promise(function(f){if(!u)return f(!0);if(u==="continue")return f(!1);u.then&&u.then(function(g){f(g!=="continue")})})},r.doBeatCallback=function(u){if(r.beatCallback){for(var f=r.currentEvent;f<r.noteTimings.length&&r.noteTimings[f].left===null;)f++;var g,d;if(f<r.noteTimings.length){for(g=r.noteTimings[f].milliseconds,f=Math.max(0,r.currentEvent-1);f>=0&&r.noteTimings[f].left===null;)f--;d=r.noteTimings[f]}var p={},l={};if(d){p.top=d.top,p.height=d.height;var o=Math.max(0,u-r.startTime-d.milliseconds),h=g-d.milliseconds,s=d.endX-d.left,v=h?o*s/h:0;p.left=d.left+v,r.currentEvent===0&&d.milliseconds>u-r.startTime&&(p.left=void 0),l={timestamp:u,startTime:r.startTime,ev:d,endMs:g,offMs:o,offPx:v,gapMs:h,gapPx:s}}else l={timestamp:u,startTime:r.startTime};var y=r.startTime;if(r.beatCallback(r.beatStarts[r.currentBeat].b,r.totalBeats/r.beatSubdivisions,r.lastMoment,p,l),y!==r.startTime)return u-r.startTime}return null};var c=60;r.animationJogger=function(){r.isRunning&&(r.doTiming(performance.now()),r.joggerTimer=setTimeout(r.animationJogger,c))},r.start=function(u,f){if(r.isRunning=!0,r.isPaused&&(r.isPaused=!1,u===void 0&&(r.justUnpaused=!0)),u)r.setProgress(u,f);else if(u===0)r.reset();else if(r.pausedPercent!==null){var g=performance.now();r.currentTime=r.lastMoment*r.pausedPercent,r.startTime=g-r.currentTime,r.pausedPercent=null,r.reportNext=!0}requestAnimationFrame(r.doTiming),r.joggerTimer=setTimeout(r.animationJogger,c)},r.pause=function(){r.isPaused=!0;var u=performance.now();r.pausedPercent=(u-r.startTime)/r.lastMoment,r.isRunning=!1,r.joggerTimer&&(clearTimeout(r.joggerTimer),r.joggerTimer=null)},r.currentMillisecond=function(){return r.currentTime},r.reset=function(){r.currentBeat=0,r.currentEvent=0,r.currentLine=0,r.startTime=null,r.pausedPercent=null},r.stop=function(){r.pause(),r.reset()},r.setProgress=function(u,f){var g;switch(f){case"seconds":r.currentTime=u*1e3,r.currentTime<0&&(r.currentTime=0),r.currentTime>r.lastMoment&&(r.currentTime=r.lastMoment),g=r.currentTime/r.lastMoment;break;case"beats":r.currentTime=u*r.millisecondsPerBeat*r.beatSubdivisions,r.currentTime<0&&(r.currentTime=0),r.currentTime>r.lastMoment&&(r.currentTime=r.lastMoment),g=r.currentTime/r.lastMoment;break;default:g=u,g<0&&(g=0),g>1&&(g=1),r.currentTime=r.lastMoment*g;break}r.isRunning||(r.pausedPercent=g);var d=performance.now();for(r.startTime=d-r.currentTime,r.currentEvent=0;r.noteTimings.length>r.currentEvent&&r.noteTimings[r.currentEvent].milliseconds<r.currentTime;)r.currentEvent++;if(r.lineEndCallback)for(r.currentLine=0;r.lineEndTimings.length>r.currentLine&&r.lineEndTimings[r.currentLine].milliseconds+r.lineEndAnticipation<r.currentTime;)r.currentLine++;var p=r.currentBeat;for(r.currentBeat=0;r.currentBeat<r.beatStarts.length&&!(r.beatStarts[r.currentBeat].ts>r.currentTime);r.currentBeat++);r.currentBeat--,r.beatCallback&&p!==r.currentBeat&&(r.doBeatCallback(r.startTime+r.currentTime),r.currentBeat++),r.eventCallback&&r.currentEvent>=0&&r.noteTimings[r.currentEvent].type==="event"&&r.eventCallback(r.noteTimings[r.currentEvent]),r.lineEndCallback&&r.lineEndCallback(r.lineEndTimings[r.currentLine],r.noteTimings[r.currentEvent],{line:r.currentLine,endTimings:r.lineEndTimings}),r.joggerTimer=setTimeout(r.animationJogger,c)}};function t(a,n){for(var r=[],i=null,c=0;c<a.length;c++){var u=a[c];u.type!=="end"&&u.top!==i&&(r.push({measureNumber:u.measureNumber,milliseconds:u.milliseconds-n,top:u.top,bottom:u.top+u.height}),i=u.top)}return r}return br=e,br}var yr,Ei;function ag(){if(Ei)return yr;Ei=1;var e=Ha(),t={};return(function(){var a,n;t.startAnimation=function(r,i,c){a&&(a.stop(),a=void 0),c.showCursor&&(n=r.querySelector(".abcjs-cursor"),n||(n=document.createElement("DIV"),n.className="abcjs-cursor cursor",n.style.position="absolute",r.appendChild(n),r.style.position="relative"));function u(h){for(var s=0;s<h.length;s++){var v=h[s];v.classList.contains("abcjs-bar")||(v.style.display="none")}}var f;function g(h){if(f){var s=r.querySelectorAll(f);u(s)}f=h}function d(h){var s=r.querySelectorAll(h);u(s)}function p(h){c.hideCurrentMeasure?d(h):c.hideFinishedMeasures&&g(h)}function l(h){return".abcjs-l"+h.line+".abcjs-m"+h.measureNumber}function o(h){if(h){if(h.measureStart){var s=l(h);s&&p(s)}n&&(n.style.left=h.left+"px",n.style.top=h.top+"px",n.style.width=h.width+"px",n.style.height=h.height+"px")}else a.stop(),a=void 0}a=new e(i,{qpm:c.bpm,eventCallback:o}),a.start()},t.pauseAnimation=function(r){a&&(r?a.pause():a.start())},t.stopAnimation=function(){a&&(a.stop(),a=void 0)}})(),yr=t,yr}var wr,Ai;function nt(){if(Ai)return wr;Ai=1;var e={};return e.cloneArray=function(t){for(var a=[],n=0;n<t.length;n++)a.push(Object.assign({},t[n]));return a},e.cloneHashOfHash=function(t){var a={};for(var n in t)t.hasOwnProperty(n)&&(a[n]=Object.assign({},t[n]));return a},e.cloneHashOfArrayOfHash=function(t){var a={};for(var n in t)t.hasOwnProperty(n)&&(a[n]=e.cloneArray(t[n]));return a},e.strip=function(t){return t.replace(/^\s+/,"").replace(/\s+$/,"")},e.startsWith=function(t,a){return t.indexOf(a)===0},e.endsWith=function(t,a){var n=t.length-a.length;return n>=0&&t.lastIndexOf(a)===n},e.last=function(t){return t.length===0?null:t[t.length-1]},wr=e,wr}var _r,Mi;function $a(){if(Mi)return _r;Mi=1;var e=nt(),t={};return(function(){var a,n,r,i,c;t.initialize=function(w,C,S,q,D){a=w,n=C,r=S,i=q,c=D,u()};function u(){r.annotationfont={face:"Helvetica",size:12,weight:"normal",style:"normal",decoration:"none"},r.gchordfont={face:"Helvetica",size:12,weight:"normal",style:"normal",decoration:"none"},r.historyfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},r.infofont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},r.measurefont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},r.partsfont={face:'"Times New Roman"',size:15,weight:"normal",style:"normal",decoration:"none"},r.repeatfont={face:'"Times New Roman"',size:13,weight:"normal",style:"normal",decoration:"none"},r.textfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},r.tripletfont={face:"Times",size:11,weight:"normal",style:"italic",decoration:"none"},r.vocalfont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},r.wordsfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},i.formatting.composerfont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},i.formatting.subtitlefont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},i.formatting.tempofont={face:'"Times New Roman"',size:15,weight:"bold",style:"normal",decoration:"none"},i.formatting.titlefont={face:'"Times New Roman"',size:20,weight:"normal",style:"normal",decoration:"none"},i.formatting.footerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},i.formatting.headerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},i.formatting.voicefont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},i.formatting.tablabelfont={face:'"Trebuchet MS"',size:16,weight:"normal",style:"normal",decoration:"none"},i.formatting.tabnumberfont={face:'"Arial"',size:11,weight:"normal",style:"normal",decoration:"none"},i.formatting.tabgracefont={face:'"Arial"',size:8,weight:"normal",style:"normal",decoration:"none"},i.formatting.annotationfont=r.annotationfont,i.formatting.gchordfont=r.gchordfont,i.formatting.historyfont=r.historyfont,i.formatting.infofont=r.infofont,i.formatting.measurefont=r.measurefont,i.formatting.partsfont=r.partsfont,i.formatting.repeatfont=r.repeatfont,i.formatting.textfont=r.textfont,i.formatting.tripletfont=r.tripletfont,i.formatting.vocalfont=r.vocalfont,i.formatting.wordsfont=r.wordsfont}var f={gchordfont:!0,measurefont:!0,partsfont:!0,annotationfont:!0,composerfont:!0,historyfont:!0,infofont:!0,subtitlefont:!0,textfont:!0,titlefont:!0,voicefont:!0},g=function(w){switch(w){case"Arial-Italic":return{face:"Arial",weight:"normal",style:"italic",decoration:"none"};case"Arial-Bold":return{face:"Arial",weight:"bold",style:"normal",decoration:"none"};case"Bookman-Demi":return{face:"Bookman,serif",weight:"bold",style:"normal",decoration:"none"};case"Bookman-DemiItalic":return{face:"Bookman,serif",weight:"bold",style:"italic",decoration:"none"};case"Bookman-Light":return{face:"Bookman,serif",weight:"normal",style:"normal",decoration:"none"};case"Bookman-LightItalic":return{face:"Bookman,serif",weight:"normal",style:"italic",decoration:"none"};case"Courier":return{face:'"Courier New"',weight:"normal",style:"normal",decoration:"none"};case"Courier-Oblique":return{face:'"Courier New"',weight:"normal",style:"italic",decoration:"none"};case"Courier-Bold":return{face:'"Courier New"',weight:"bold",style:"normal",decoration:"none"};case"Courier-BoldOblique":return{face:'"Courier New"',weight:"bold",style:"italic",decoration:"none"};case"AvantGarde-Book":return{face:"AvantGarde,Arial",weight:"normal",style:"normal",decoration:"none"};case"AvantGarde-BookOblique":return{face:"AvantGarde,Arial",weight:"normal",style:"italic",decoration:"none"};case"AvantGarde-Demi":case"Avant-Garde-Demi":return{face:"AvantGarde,Arial",weight:"bold",style:"normal",decoration:"none"};case"AvantGarde-DemiOblique":return{face:"AvantGarde,Arial",weight:"bold",style:"italic",decoration:"none"};case"Helvetica-Oblique":return{face:"Helvetica",weight:"normal",style:"italic",decoration:"none"};case"Helvetica-Bold":return{face:"Helvetica",weight:"bold",style:"normal",decoration:"none"};case"Helvetica-BoldOblique":return{face:"Helvetica",weight:"bold",style:"italic",decoration:"none"};case"Helvetica-Narrow":return{face:'"Helvetica Narrow",Helvetica',weight:"normal",style:"normal",decoration:"none"};case"Helvetica-Narrow-Oblique":return{face:'"Helvetica Narrow",Helvetica',weight:"normal",style:"italic",decoration:"none"};case"Helvetica-Narrow-Bold":return{face:'"Helvetica Narrow",Helvetica',weight:"bold",style:"normal",decoration:"none"};case"Helvetica-Narrow-BoldOblique":return{face:'"Helvetica Narrow",Helvetica',weight:"bold",style:"italic",decoration:"none"};case"Palatino-Roman":return{face:"Palatino",weight:"normal",style:"normal",decoration:"none"};case"Palatino-Italic":return{face:"Palatino",weight:"normal",style:"italic",decoration:"none"};case"Palatino-Bold":return{face:"Palatino",weight:"bold",style:"normal",decoration:"none"};case"Palatino-BoldItalic":return{face:"Palatino",weight:"bold",style:"italic",decoration:"none"};case"NewCenturySchlbk-Roman":return{face:'"New Century",serif',weight:"normal",style:"normal",decoration:"none"};case"NewCenturySchlbk-Italic":return{face:'"New Century",serif',weight:"normal",style:"italic",decoration:"none"};case"NewCenturySchlbk-Bold":return{face:'"New Century",serif',weight:"bold",style:"normal",decoration:"none"};case"NewCenturySchlbk-BoldItalic":return{face:'"New Century",serif',weight:"bold",style:"italic",decoration:"none"};case"Times":case"Times-Roman":case"Times-Narrow":case"Times-Courier":case"Times-New-Roman":return{face:'"Times New Roman"',weight:"normal",style:"normal",decoration:"none"};case"Times-Italic":case"Times-Italics":return{face:'"Times New Roman"',weight:"normal",style:"italic",decoration:"none"};case"Times-Bold":return{face:'"Times New Roman"',weight:"bold",style:"normal",decoration:"none"};case"Times-BoldItalic":return{face:'"Times New Roman"',weight:"bold",style:"italic",decoration:"none"};case"ZapfChancery-MediumItalic":return{face:'"Zapf Chancery",cursive,serif',weight:"normal",style:"normal",decoration:"none"};default:return null}},d=function(w,C,S,q,D){function $(){var Se=parseInt(w[0].token);return w.shift(),C?w.length===0?{face:C.face,weight:C.weight,style:C.style,decoration:C.decoration,size:Se}:w.length===1&&w[0].token==="box"&&f[D]?{face:C.face,weight:C.weight,style:C.style,decoration:C.decoration,size:Se,box:!0}:(n("Extra parameters in font definition.",S,q),{face:C.face,weight:C.weight,style:C.style,decoration:C.decoration,size:Se}):(n("Can't set just the size of the font since there is no default value.",S,q),{face:'"Times New Roman"',weight:"normal",style:"normal",decoration:"none",size:Se})}if(w[0].token==="*"){if(w.shift(),w[0].type==="number")return $();n("Expected font size number after *.",S,q)}if(w[0].type==="number")return $();for(var F=[],K,te="normal",V="normal",ae="none",oe=!1,le="face",J=!1;w.length;){var ce=w.shift(),ee=ce.token.toLowerCase();switch(le){case"face":J||ee!=="utf"&&ce.type!=="number"&&ee!=="bold"&&ee!=="italic"&&ee!=="underline"&&ee!=="box"?F.length>0&&ce.token==="-"?(J=!0,F[F.length-1]=F[F.length-1]+ce.token):J?(J=!1,F[F.length-1]=F[F.length-1]+ce.token):F.push(ce.token):ce.type==="number"?(K?n("Font size specified twice in font definition.",S,q):K=ce.token,le="modifier"):ee==="bold"?te="bold":ee==="italic"?V="italic":ee==="underline"?ae="underline":ee==="box"?(f[D]?oe=!0:n(`This font style doesn't support "box"`,S,q),le="finished"):ee==="utf"?(ce=w.shift(),le="size"):n("Unknown parameter "+ce.token+" in font definition.",S,q);break;case"size":ce.type==="number"?K?n("Font size specified twice in font definition.",S,q):K=ce.token:n("Expected font size in font definition.",S,q),le="modifier";break;case"modifier":ee==="bold"?te="bold":ee==="italic"?V="italic":ee==="underline"?ae="underline":ee==="box"?(f[D]?oe=!0:n(`This font style doesn't support "box"`,S,q),le="finished"):n("Unknown parameter "+ce.token+" in font definition.",S,q);break;case"finished":n('Extra characters found after "box" in font definition.',S,q);break}}K===void 0?C?K=C.size:(n("Must specify the size of the font since there is no default value.",S,q),K=12):K=parseFloat(K),F=F.join(" "),F===""&&(C?F=C.face:(n("Must specify the name of the font since there is no default value.",S,q),F="sans-serif"));var he=g(F),de={};return he?(de.face=he.face,de.weight=he.weight,de.style=he.style,de.decoration=he.decoration,de.size=K,oe&&(de.box=!0),de):(de.face=F,de.weight=te,de.style=V,de.decoration=ae,de.size=K,oe&&(de.box=!0),de)},p=function(w,C,S){return C.length===0?'Directive "'+w+'" requires a font as a parameter.':(r[w]=d(C,r[w],S,0,w),r.is_in_header&&(i.formatting[w]=r[w]),null)},l=function(w,C,S){return C.length===0?'Directive "'+w+'" requires a font as a parameter.':(i.formatting[w]=d(C,i.formatting[w],S,0,w),null)},o=function(w,C){var S="";C.forEach(function(D){S+=D.token});var q=parseFloat(S);if(isNaN(q)||q===0)return'Directive "'+w+'" requires a number as a parameter.';i.formatting.scale=q},h=["acoustic-bass-drum","bass-drum-1","side-stick","acoustic-snare","hand-clap","electric-snare","low-floor-tom","closed-hi-hat","high-floor-tom","pedal-hi-hat","low-tom","open-hi-hat","low-mid-tom","hi-mid-tom","crash-cymbal-1","high-tom","ride-cymbal-1","chinese-cymbal","ride-bell","tambourine","splash-cymbal","cowbell","crash-cymbal-2","vibraslap","ride-cymbal-2","hi-bongo","low-bongo","mute-hi-conga","open-hi-conga","low-conga","high-timbale","low-timbale","high-agogo","low-agogo","cabasa","maracas","short-whistle","long-whistle","short-guiro","long-guiro","claves","hi-wood-block","low-wood-block","mute-cuica","open-cuica","mute-triangle","open-triangle"],s=function(w){var C=w.split(/\s+/);if(C.length!==2&&C.length!==3)return{error:'Expected parameters "abc-note", "drum-sound", and optionally "note-head"'};var S=C[0],q=parseInt(C[1],10);if((isNaN(q)||q<35||q>81)&&C[1]&&(q=h.indexOf(C[1].toLowerCase())+35),isNaN(q)||q<35||q>81)return{error:'Expected drum name, received "'+C[1]+'"'};var D={sound:q};return C.length===3&&(D.noteHead=C[2]),{key:S,value:D}},v=function(w,C){var S=a.getMeasurement(C);return S.used===0||C.length!==0?{error:'Directive "'+w+'" requires a measurement as a parameter.'}:S.value},y=function(w,C){var S=a.getMeasurement(C);return S.used===0||C.length!==0?'Directive "'+w+'" requires a measurement as a parameter.':(i.formatting[w]=S.value,null)},m=function(w,C,S,q,D){if(S.length!==1||S[0].type!=="number")return'Directive "'+C+'" requires a number as a parameter.';var $=S[0].intt;return q!==void 0&&$<q?'Directive "'+C+'" requires a number greater than or equal to '+q+" as a parameter.":D!==void 0&&$>D?'Directive "'+C+'" requires a number less than or equal to '+D+" as a parameter.":(r[w]=$,null)},_=function(w,C,S){if(S.length===1&&(S[0].token==="true"||S[0].token==="false"))return r[w]=S[0].token==="true",null;var q=m(w,C,S,0,1);return q!==null?q:(r[w]=r[w]===1,null)},k=function(w,C,S,q){if(S.length!==1)return'Directive "'+C+'" requires one of [ '+q.join(", ")+" ] as a parameter.";for(var D=S[0].token,$=!1,F=0;!$&&F<q.length;F++)q[F]===D&&($=!0);return $?(r[w]=D,null):'Directive "'+C+'" requires one of [ '+q.join(", ")+" ] as a parameter."},x=["nobarlines","barlines","beataccents","nobeataccents","droneon","droneoff","drumon","drumoff","fermatafixed","fermataproportional","gchordon","gchordoff","controlcombo","temperamentnormal","noportamento"],R=["gchord","ptstress","beatstring"],I=["bassvol","chordvol","c","channel","beatmod","deltaloudness","drumbars","gracedivider","makechordchannels","randomchordattack","chordattack","stressmodel","transpose","rtranspose","vol","volinc","gchordbars"],b=["program"],A=["ratio","snt","bendvelocity","pitchbend","control","temperamentlinear"],N=["beat"],M=["drone"],z=["portamento"],L=["expand","grace","trim"],E=["drum","chordname"],T=["bassprog","chordprog"],P=function(w,C,S){var q=w.shift().token,D=[];if(x.indexOf(q)>=0)w.length!==0&&n("Unexpected parameter in MIDI "+q,S,0);else if(R.indexOf(q)>=0)w.length!==1?n("Expected one parameter in MIDI "+q,S,0):D.push(w[0].token);else if(I.indexOf(q)>=0)w.length!==1?n("Expected one parameter in MIDI "+q,S,0):w[0].type!=="number"?n("Expected one integer parameter in MIDI "+q,S,0):D.push(w[0].intt);else if(b.indexOf(q)>=0)w.length!==1&&w.length!==2?n("Expected one or two parameters in MIDI "+q,S,0):w[0].type!=="number"||w.length===2&&w[1].type!=="number"?n("Expected integer parameter in MIDI "+q,S,0):(D.push(w[0].intt),w.length===2&&D.push(w[1].intt));else if(A.indexOf(q)>=0)w.length!==2?n("Expected two parameters in MIDI "+q,S,0):w[0].type!=="number"||w[1].type!=="number"?n("Expected two integer parameters in MIDI "+q,S,0):(D.push(w[0].intt),D.push(w[1].intt));else if(z.indexOf(q)>=0)w.length!==2?n("Expected two parameters in MIDI "+q,S,0):w[0].type!=="alpha"||w[1].type!=="number"?n("Expected one string and one integer parameters in MIDI "+q,S,0):(D.push(w[0].token),D.push(w[1].intt));else if(q==="drummap")w.length===2&&w[0].type==="alpha"&&w[1].type==="number"?(C.formatting||(C.formatting={}),C.formatting.midi||(C.formatting.midi={}),C.formatting.midi.drummap||(C.formatting.midi.drummap={}),C.formatting.midi.drummap[w[0].token]=w[1].intt,D=C.formatting.midi.drummap):w.length===3&&w[0].type==="punct"&&w[1].type==="alpha"&&w[2].type==="number"?(C.formatting||(C.formatting={}),C.formatting.midi||(C.formatting.midi={}),C.formatting.midi.drummap||(C.formatting.midi.drummap={}),C.formatting.midi.drummap[w[0].token+w[1].token]=w[2].intt,D=C.formatting.midi.drummap):n("Expected one note name and one integer parameter in MIDI "+q,S,0);else if(L.indexOf(q)>=0)w.length!==3||w[0].type!=="number"||w[1].token!=="/"||w[2].type!=="number"?n("Expected fraction parameter in MIDI "+q,S,0):(D.push(w[0].intt),D.push(w[2].intt));else if(N.indexOf(q)>=0)w.length!==4?n("Expected four parameters in MIDI "+q,S,0):w[0].type!=="number"||w[1].type!=="number"||w[2].type!=="number"||w[3].type!=="number"?n("Expected four integer parameters in MIDI "+q,S,0):(D.push(w[0].intt),D.push(w[1].intt),D.push(w[2].intt),D.push(w[3].intt));else if(M.indexOf(q)>=0)w.length!==5?n("Expected five parameters in MIDI "+q,S,0):w[0].type!=="number"||w[1].type!=="number"||w[2].type!=="number"||w[3].type!=="number"||w[4].type!=="number"?n("Expected five integer parameters in MIDI "+q,S,0):(D.push(w[0].intt),D.push(w[1].intt),D.push(w[2].intt),D.push(w[3].intt),D.push(w[4].intt));else if(b.indexOf(q)>=0)w.length!==1||w.length!==4?n("Expected one or two parameters in MIDI "+q,S,0):w[0].type!=="number"?n("Expected integer parameter in MIDI "+q,S,0):w.length===4?(w[1].token!=="octave"&&n("Expected octave parameter in MIDI "+q,S,0),w[2].token!=="="&&n("Expected octave parameter in MIDI "+q,S,0),w[3].type!=="number"&&n("Expected integer parameter for octave in MIDI "+q,S,0)):(D.push(w[0].intt),w.length===4&&D.push(w[3].intt));else if(E.indexOf(q)>=0)if(w.length<2)n("Expected string parameter and at least one integer parameter in MIDI "+q,S,0);else if(w[0].type!=="alpha")n("Expected string parameter and at least one integer parameter in MIDI "+q,S,0);else{var $=w.shift();for(D.push($.token);w.length>0;)$=w.shift(),$.type!=="number"&&n("Expected integer parameter in MIDI "+q,S,0),D.push($.intt)}else if(T.indexOf(q)>=0){if(w.length!==1&&w.length!==2)n("Expected one or two parameters in MIDI "+q,S,0);else if(w[0].type!=="number")n("Expected integer parameter in MIDI "+q,S,0);else if(w.length===2&&w[1].type!=="alpha")n("Expected alpha parameter in MIDI "+q,S,0);else if(D.push(w[0].intt),w.length===2){var F=w[1].token;F.indexOf("octave=")!=-1?(F=F.replace("octave=",""),F=parseInt(F),isNaN(F)?n("Expected octave value in MIDI"+q):(F<-1&&(n("Expected octave= in MIDI "+q+" to be >= -1 (recv:"+F+")"),F=-1),F>3&&(n("Expected octave= in MIDI "+q+" to be <= 3 (recv:"+F+")"),F=3),D.push(F))):n("Expected octave= in MIDI"+q)}}c.hasBeginMusic()?c.appendElement("midi",-1,-1,{cmd:q,params:D}):(C.formatting.midi===void 0&&(C.formatting.midi={}),C.formatting.midi[q]=D)};t.parseFontChangeLine=function(w){w=w.replace(/\$\$/g,"");var C=w.split("$");if(C.length>1&&r.setfont){var S=[];C[0]!==""&&S.push({text:C[0]});for(var q=1;q<C.length;q++)if(C[q][0]==="0")S.push({text:C[q].substring(1).replace(/\x03/g,"$$")});else{var D=parseInt(C[q][0],10);r.setfont[D]?S.push({font:r.setfont[D],text:C[q].substring(1).replace(/\x03/g,"$$")}):S[S.length-1].text+="$"+C[q].replace(/\x03/g,"$$")}return S}return w.replace(/\x03/g,"$$")};var B=["auto","above","below","hidden"];t.addDirective=function(w){var C=a.tokenize(w,0,w.length);if(C.length===0||C[0].type!=="alpha")return null;var S=w.substring(w.indexOf(C[0].token)+C[0].token.length);S=a.stripComment(S);var q=C.shift().token.toLowerCase(),D="",$;switch(q){case"bagpipes":i.formatting.bagpipes=!0;break;case"flatbeams":i.formatting.flatbeams=!0;break;case"jazzchords":i.formatting.jazzchords=!0;break;case"accentAbove":i.formatting.accentAbove=!0;break;case"germanAlphabet":i.formatting.germanAlphabet=!0;break;case"landscape":r.landscape=!0;break;case"papersize":r.papersize=S;break;case"graceslurs":if(C.length!==1)return"Directive graceslurs requires one parameter: 0 or 1";if(C[0].token==="0"||C[0].token==="false")i.formatting.graceSlurs=!1;else if(C[0].token==="1"||C[0].token==="true")i.formatting.graceSlurs=!0;else return"Directive graceslurs requires one parameter: 0 or 1 (received "+C[0].token+")";break;case"lineThickness":var F=O(C);if(F.value!==void 0&&(i.formatting.lineThickness=F.value),F.error)return F.error;break;case"stretchlast":var K=O(C);if(K.value!==void 0&&(i.formatting.stretchlast=K.value),K.error)return K.error;break;case"titlecaps":r.titlecaps=!0;break;case"titleleft":i.formatting.titleleft=!0;break;case"measurebox":i.formatting.measurebox=!0;break;case"vocal":return k("vocalPosition",q,C,B);case"dynamic":return k("dynamicPosition",q,C,B);case"gchord":return k("chordPosition",q,C,B);case"ornament":return k("ornamentPosition",q,C,B);case"volume":return k("volumePosition",q,C,B);case"botmargin":case"botspace":case"composerspace":case"indent":case"leftmargin":case"linesep":case"musicspace":case"partsspace":case"pageheight":case"pagewidth":case"rightmargin":case"stafftopmargin":case"staffsep":case"staffwidth":case"subtitlespace":case"sysstaffsep":case"systemsep":case"textspace":case"titlespace":case"topmargin":case"topspace":case"vocalspace":case"wordsspace":return y(q,C);case"voicescale":if(C.length!==1||C[0].type!=="number")return"voicescale requires one float as a parameter";var te=C.shift();return r.currentVoice&&(r.currentVoice.scale=te.floatt,c.changeVoiceScale(r.currentVoice.scale)),null;case"voicecolor":if(C.length!==1)return"voicecolor requires one string as a parameter";var V=C.shift();return r.currentVoice&&(r.currentVoice.color=V.token,c.changeVoiceColor(r.currentVoice.color)),null;case"vskip":var ae=Math.round(v(q,C));return ae.error?ae.error:(c.addSpacing(ae),null);case"scale":o(q,C);break;case"sep":if(C.length===0)c.addSeparator(14,14,85,{startChar:r.iChar,endChar:r.iChar+5});else{var oe=a.getMeasurement(C);if(oe.used===0)return'Directive "'+q+'" requires 3 numbers: space above, space below, length of line';var le=oe.value;if(oe=a.getMeasurement(C),oe.used===0)return'Directive "'+q+'" requires 3 numbers: space above, space below, length of line';var J=oe.value;if(oe=a.getMeasurement(C),oe.used===0||C.length!==0)return'Directive "'+q+'" requires 3 numbers: space above, space below, length of line';var ce=oe.value;c.addSeparator(le,J,ce,{startChar:r.iChar,endChar:r.iChar+S.length})}break;case"barsperstaff":if(D=m("barsperstaff",q,C),D!==null)return D;break;case"staffnonote":if(C.length!==1)return"Directive staffnonote requires one parameter: 0 or 1";if(C[0].token==="0")r.staffnonote=!0;else if(C[0].token==="1")r.staffnonote=!1;else return"Directive staffnonote requires one parameter: 0 or 1 (received "+C[0].token+")";break;case"printtempo":if(D=_("printTempo",q,C),D!==null)return D;break;case"partsbox":if(D=_("partsBox",q,C),D!==null)return D;r.partsfont.box=r.partsBox;break;case"freegchord":if(D=_("freegchord",q,C),D!==null)return D;break;case"measurenb":case"barnumbers":if(D=m("barNumbers",q,C),D!==null)return D;break;case"setbarnb":if(C.length!==1||C[0].type!=="number")return"Directive setbarnb requires a number as a parameter.";r.currBarNumber=c.setBarNumberImmediate(C[0].intt);break;case"keywarn":if(C.length!==1||C[0].type!=="number"||C[0].intt!==1&&C[0].intt!==0)return"Directive "+q+" requires 0 or 1 as a parameter.";r[q]=C[0].intt===1;break;case"begintext":var ee="";for($=a.nextLine();$&&$.indexOf("%%endtext")!==0;){if(e.startsWith($,"%%")){var he=$.substring(2);he=he.trim()+`
|
|
85
85
|
`,ee+=he}else ee+=$.trim()+`
|
|
86
|
-
`;$=a.nextLine()}c.addText(ee,{startChar:r.iChar,endChar:r.iChar+ee.length+7});break;case"continueall":r.continueall=!0;break;case"beginps":for($=a.nextLine();$&&$.indexOf("%%endps")!==0;)a.nextLine();n("Postscript ignored",w,0);break;case"deco":S.length>0&&r.ignoredDecorations.push(S.substring(0,S.indexOf(" "))),n("Decoration redefinition ignored",w,0);break;case"text":var de=a.translateString(S);c.addText(t.parseFontChangeLine(de),{startChar:r.iChar,endChar:r.iChar+S.length+7});break;case"center":var Se=a.translateString(S);c.addCentered(t.parseFontChangeLine(Se));break;case"font":break;case"setfont":var we=a.tokenize(S,0,S.length);if(we.length>=4&&we[0].token==="-"&&we[1].type==="number"){var Re=parseInt(we[1].token);Re>=1&&Re<=9&&(r.setfont||(r.setfont=[]),we.shift(),we.shift(),r.setfont[Re]=d(we,r.setfont[Re],w,0,"setfont"))}break;case"gchordfont":case"partsfont":case"tripletfont":case"vocalfont":case"textfont":case"annotationfont":case"historyfont":case"infofont":case"measurefont":case"repeatfont":case"wordsfont":return p(q,C,w);case"composerfont":case"subtitlefont":case"tempofont":case"titlefont":case"voicefont":case"footerfont":case"headerfont":return l(q,C,w);case"barlabelfont":case"barnumberfont":case"barnumfont":return p("measurefont",C,w);case"staves":case"score":r.score_is_present=!0;for(var ze=function(ct,Xl,ei,ti,Kl){(Xl||r.staves.length===0)&&r.staves.push({index:r.staves.length,numVoices:0});var lt=e.last(r.staves);ei!==void 0&<.bracket===void 0&&(lt.bracket=ei),ti!==void 0&<.brace===void 0&&(lt.brace=ti),Kl&&(lt.connectBarLines="end"),r.voices[ct]===void 0&&(r.voices[ct]={staffNum:lt.index,index:lt.numVoices},lt.numVoices++)},Oe=!1,Z=!1,W=!1,H=!1,j=!1,Q=!1,re=!1,ie,ge=function(){if(re=!0,ie){var ct="start";ie.staffNum>0&&(r.staves[ie.staffNum-1].connectBarLines==="start"||r.staves[ie.staffNum-1].connectBarLines==="continue")&&(ct="continue"),r.staves[ie.staffNum].connectBarLines=ct}};C.length;){var ne=C.shift();switch(ne.token){case"(":Oe?n("Can't nest parenthesis in %%score",w,ne.start):(Oe=!0,H=!0);break;case")":!Oe||H?n("Unexpected close parenthesis in %%score",w,ne.start):Oe=!1;break;case"[":Z?n("Can't nest brackets in %%score",w,ne.start):(Z=!0,j=!0);break;case"]":!Z||j?n("Unexpected close bracket in %%score",w,ne.start):(Z=!1,r.staves[ie.staffNum].bracket="end");break;case"{":W?n("Can't nest braces in %%score",w,ne.start):(W=!0,Q=!0);break;case"}":!W||Q?n("Unexpected close brace in %%score",w,ne.start):(W=!1,r.staves[ie.staffNum].brace="end");break;case"|":ge();break;default:for(var ue="";(ne.type==="alpha"||ne.type==="number")&&(ue+=ne.token,ne.continueId);)ne=C.shift();var Ee=!Oe||H,qe=j?"start":Z?"continue":void 0,pe=Q?"start":W?"continue":void 0;ze(ue,Ee,qe,pe,re),H=!1,j=!1,Q=!1,re=!1,ie=r.voices[ue],q==="staves"&&ge();break}}break;case"maxstaves":var be=a.getInt(S);be.digits===0?n("Expected number of staves in maxstaves"):be.value>0&&(i.formatting.maxStaves=be.value);break;case"newpage":var $e=a.getInt(S);c.addNewPage($e.digits===0?-1:$e.value);break;case"abc":var ve=S.split(" ");switch(ve[0]){case"-copyright":case"-creator":case"-edited-by":case"-version":case"-charset":var rt=ve.shift();c.addMetaText(q+rt,ve.join(" "),{startChar:r.iChar,endChar:r.iChar+S.length+5});break;default:return"Unknown directive: "+q+ve[0]}break;case"header":case"footer":var Ue=a.getMeat(S,0,S.length);Ue=S.substring(Ue.start,Ue.end),Ue[0]==='"'&&Ue[Ue.length-1]==='"'&&(Ue=Ue.substring(1,Ue.length-1));var Ze=Ue.split(" "),st={};Ze.length===1?st={left:"",center:Ze[0],right:""}:Ze.length===2?st={left:Ze[0],center:Ze[1],right:""}:st={left:Ze[0],center:Ze[1],right:Ze[2]},Ze.length>3&&n("Too many tabs in "+q+": "+Ze.length+" found.",S,0),c.addMetaTextObj(q,st,{startChar:r.iChar,endChar:r.iChar+w.length});break;case"midi":var ot=a.tokenize(S,0,S.length,!0);ot.length>0&&ot[0].token==="="&&ot.shift(),ot.length===0?n("Expected midi command",S,0):P(ot,i,S);break;case"percmap":var vt=s(S);vt.error?n(vt.error,w,8):(i.formatting.percmap||(i.formatting.percmap={}),i.formatting.percmap[vt.key]=vt.value);break;case"visualtranspose":var kt=a.getInt(S);kt.digits===0?n("Expected number of half steps in visualTranspose"):r.globalTranspose=kt.value;break;case"map":case"playtempo":case"auquality":case"continuous":case"nobarcheck":i.formatting[q]=S;break;default:return"Unknown directive: "+q}return null},t.globalFormatting=function(w){for(var C in w)if(w.hasOwnProperty(C)){var S=""+w[C],q=a.tokenize(S,0,S.length),D;switch(C){case"titlefont":case"gchordfont":case"composerfont":case"footerfont":case"headerfont":case"historyfont":case"infofont":case"measurefont":case"partsfont":case"repeatfont":case"subtitlefont":case"tempofont":case"textfont":case"voicefont":case"tripletfont":case"vocalfont":case"wordsfont":case"annotationfont":case"tablabelfont":case"tabnumberfont":case"tabgracefont":p(C,q,S);break;case"scale":o(C,q);break;case"partsbox":D=_("partsBox",C,q),D!==null&&n(D),r.partsfont.box=r.partsBox;break;case"freegchord":D=_("freegchord",C,q),D!==null&&n(D);break;case"fontboxpadding":(q.length!==1||q[0].type!=="number")&&n('Directive "'+C+'" requires a number as a parameter.'),i.formatting.fontboxpadding=q[0].floatt;break;case"stafftopmargin":(q.length!==1||q[0].type!=="number")&&n('Directive "'+C+'" requires a number as a parameter.'),i.formatting.stafftopmargin=q[0].floatt;break;case"stretchlast":var $=O(q);if($.value!==void 0&&(i.formatting.stretchlast=$.value),$.error)return $.error;break;default:n("Formatting directive unrecognized: ",C,0)}}};function O(w){if(w.length===0)return{value:1};if(w.length===1)if(w[0].type==="number"){if(w[0].floatt>=0||w[0].floatt<=1)return{value:w[0].floatt}}else{if(w[0].token==="false")return{value:0};if(w[0].token==="true")return{value:1}}return{error:"Directive stretchlast requires zero or one parameter: false, true, or number between 0 and 1 (received "+w[0].token+")"}}})(),_r=t,_r}var kr,Ni;function ig(){if(Ni)return kr;Ni=1;var e={};const t=["C,,,","D,,,","E,,,","F,,,","G,,,","A,,,","B,,,","C,,","D,,","E,,","F,,","G,,","A,,","B,,","C,","D,","E,","F,","G,","A,","B,","C","D","E","F","G","A","B","c","d","e","f","g","a","b","c'","d'","e'","f'","g'","a'","b'","c''","d''","e''","f''","g''","a''","b''","c'''","d'''","e'''","f'''","g'''","a'''","b'''"];return e.pitchIndex=function(a){return t.indexOf(a)},e.noteName=function(a){return t[a]},kr=e,kr}var xr,Pi;function yl(){if(Pi)return xr;Pi=1;var e=["C","C♯","D","D♯","E","F","F♯","G","G♯","A","A♯","B"],t=["C","D♭","D","E♭","E","F","G♭","G","A♭","A","B♭","B"],a=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],n=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"];function r(i,c,u,f){if(!c||c%12===0)return i;for(;c<0;)c+=12;c>11&&(c=c%12);var g=i.match(/^([A-G][b#♭♯]?)([^\/]+)?\/?([A-G][b#♭♯]?)?(.+)?/);if(!g)return i;var d=g[1],p=g[2],l=g[3],o=g[4],h=e.indexOf(d);if(h<0&&(h=t.indexOf(d)),h<0&&(h=a.indexOf(d)),h<0&&(h=n.indexOf(d)),h<0)return i;h+=c,h=h%12,u?f?i=n[h]:i=t[h]:f?i=a[h]:i=e[h];var s=p&&(p.indexOf("dim")>=0||p.indexOf("°")>=0);if(s&&i==="A#"&&(i="Bb"),s&&i==="D#"&&(i="Eb"),s&&i==="A♯"&&(i="B♭"),s&&i==="D♯"&&(i="E♭"),p&&(i+=p),l){var h=e.indexOf(l);h<0&&(h=t.indexOf(l)),h<0&&(h=a.indexOf(l)),h<0&&(h=n.indexOf(l)),i+="/",h>=0?(h+=c,h=h%12,u?f?i+=n[h]:i+=t[h]:f?i+=a[h]:i+=e[h]):i+=l}return o&&(i+=o),i}return xr=r,xr}var Cr,zi;function wl(){if(zi)return Cr;zi=1;var e={C:{modes:["CMaj","CIon","Amin","AAeo","Am","GMix","DDor","EPhr","FLyd","BLoc"],stepsFromC:0},Db:{modes:["DbMaj","DbIon","Bbmin","BbAeo","Bbm","AbMix","EbDor","FPhr","GbLyd","CLoc"],stepsFromC:1},D:{modes:["DMaj","DIon","Bmin","BAeo","Bm","AMix","EDor","F#Phr","GLyd","C#Loc"],stepsFromC:2},Eb:{modes:["EbMaj","EbIon","Cmin","CAeo","Cm","BbMix","FDor","GPhr","AbLyd","DLoc"],stepsFromC:3},E:{modes:["EMaj","EIon","C#min","C#Aeo","C#m","BMix","F#Dor","G#Phr","ALyd","D#Loc"],stepsFromC:4},F:{modes:["FMaj","FIon","Dmin","DAeo","Dm","CMix","GDor","APhr","BbLyd","ELoc"],stepsFromC:5},Gb:{modes:["GbMaj","GbIon","Ebmin","EbAeo","Ebm","DbMix","AbDor","BbPhr","CbLyd","FLoc"],stepsFromC:6},G:{modes:["GMaj","GIon","Emin","EAeo","Em","DMix","ADor","BPhr","CLyd","F#Loc"],stepsFromC:7},Ab:{modes:["AbMaj","AbIon","Fmin","FAeo","Fm","EbMix","BbDor","CPhr","DbLyd","GLoc"],stepsFromC:8},A:{modes:["AMaj","AIon","F#min","F#Aeo","F#m","EMix","BDor","C#Phr","DLyd","G#Loc"],stepsFromC:9},Bb:{modes:["BbMaj","BbIon","Gmin","GAeo","Gm","FMix","CDor","DPhr","EbLyd","ALoc"],stepsFromC:10},B:{modes:["BMaj","BIon","G#min","G#Aeo","G#m","F#Mix","C#Dor","D#Phr","ELyd","A#Loc"],stepsFromC:11},"C#":{modes:["C#Maj","C#Ion","A#min","A#Aeo","A#m","G#Mix","D#Dor","E#Phr","F#Lyd","B#Loc"],stepsFromC:1},"F#":{modes:["F#Maj","F#Ion","D#min","D#Aeo","D#m","C#Mix","G#Dor","A#Phr","BLyd","E#Loc"],stepsFromC:6},Cb:{modes:["CbMaj","CbIon","Abmin","AbAeo","Abm","GbMix","DbDor","EbPhr","FbLyd","BbLoc"],stepsFromC:11}},t=["maj","ion","min","aeo","m","mix","dor","phr","lyd","loc"];function a(f){return t.indexOf(f.toLowerCase())>=0}var n=null;function r(){n={};for(var f=Object.keys(e),g=0;g<f.length;g++){var d=e[f[g]];n[f[g].toLowerCase()]=f[g];for(var p=0;p<d.modes.length;p++){var l=d.modes[p].toLowerCase();n[l]=f[g]}}}function i(f){n||r();var g=f.toLowerCase().match(/([a-g][b#]?)(maj|ion|min|aeo|mix|dor|phr|lyd|loc|m)?/);if(!g||!g[2])return f;g=g[1]+g[2];var d=n[g];return d||f}function c(f,g){var d=e[f];if(!d||g==="")return f;var p=g.toLowerCase().match(/^(maj|ion|min|aeo|mix|dor|phr|lyd|loc|m)/);if(!p)return f;for(var l=p[1],o=0;o<d.modes.length;o++){var h=d.modes[o],s=h.toLowerCase().indexOf(l);if(s!==-1&&s===h.length-l.length)return h.substring(0,h.length-l.length)}return f}function u(f,g){var d=e[f];if(!d)return f;for(;g<0;)g+=12;for(var p=(d.stepsFromC+g)%12,l=0;l<Object.keys(e).length;l++){var o=Object.keys(e)[l];if(e[o].stepsFromC===p)return o}return f}return Cr={relativeMajor:i,relativeMode:c,transposeKey:u,isLegalMode:a},Cr}var Sr,Ii;function _l(){if(Ii)return Sr;Ii=1;var{relativeMajor:e}=wl(),t={acc:"sharp",note:"f"},a={acc:"sharp",note:"c"},n={acc:"sharp",note:"g"},r={acc:"sharp",note:"d"},i={acc:"sharp",note:"A"},c={acc:"sharp",note:"e"},u={acc:"sharp",note:"B"},f={acc:"flat",note:"B"},g={acc:"flat",note:"e"},d={acc:"flat",note:"A"},p={acc:"flat",note:"d"},l={acc:"flat",note:"G"},o={acc:"flat",note:"c"},h={acc:"flat",note:"F"},s={"C#":[t,a,n,r,i,c,u],"F#":[t,a,n,r,i,c],B:[t,a,n,r,i],E:[t,a,n,r],A:[t,a,n],D:[t,a],G:[t],C:[],F:[f],Bb:[f,g],Eb:[f,g,d],Cm:[f,g,d],Ab:[f,g,d,p],Db:[f,g,d,p,l],Gb:[f,g,d,p,l,o],Cb:[f,g,d,p,l,o,h],"A#":[f,g],"B#":[],"D#":[f,g,d],"E#":[f],"G#":[f,g,d,p],none:[]};function v(y){var m=s[e(y)];return m?JSON.parse(JSON.stringify(m)):null}return Sr=v,Sr}var Tr,Ri;function kl(){if(Ri)return Tr;Ri=1;var e=ig(),t=yl(),a=_l(),n={},r={C:0,"C#":1,Db:1,D:2,"D#":3,Eb:3,E:4,F:5,"F#":6,Gb:6,G:7,"G#":8,Ab:8,A:9,"A#":10,Bb:10,B:11},i=["C","Db","D","Eb","E","F","F#","G","Ab","A","Bb","B"],c=["C","C#","D","D#","E","F","F#","G","G#","A","Bb","B"];n.keySignature=function(l,o,h,s,v){if(l.clef.type==="perc"||l.clef.type==="none")return{accidentals:a(o),root:h,acc:s};v||(v=0),l.localTransposeVerticalMovement=0,l.localTransposePreferFlats=!1;var y=a(o);if(!y)return l.key;if(l.localTranspose=(l.globalTranspose?l.globalTranspose:0)+v,!l.localTranspose)return{accidentals:y,root:h,acc:s};if(l.globalTransposeOrigKeySig=y,l.localTranspose%12===0)return l.localTransposeVerticalMovement=l.localTranspose/12*7,{accidentals:y,root:h,acc:s};var m=o[0];o[1]==="b"||o[1]==="#"?(m+=o[1],o=o.substr(2)):o=o.substr(1);var _=r[m],k=_!==void 0;k||(_=0,m="C",o="");for(var x=_+l.localTranspose;x<0;)x+=12;x>11&&(x=x%12);var R=o[0]==="m"?c[x]:i[x],I=R+o,b=a(I);(b.length===0||b[0].acc==="flat")&&(l.localTransposePreferFlats=!0);var A=I.charCodeAt(0)-m.charCodeAt(0);return l.localTranspose>0?(A<0||A===0&&(m[1]==="#"||I[1]==="b"))&&(A+=7):l.localTranspose<0&&(A>0||A===0&&(m[1]==="b"||I[1]==="#"))&&(A-=7),l.localTranspose>0?l.localTransposeVerticalMovement=A+Math.floor(l.localTranspose/12)*7:l.localTransposeVerticalMovement=A+Math.ceil(l.localTranspose/12)*7,k?{accidentals:b,root:R[0],acc:R.length>1?R[1]:""}:{accidentals:[],root:h,acc:s}},n.chordName=function(l,o){return t(o,l.localTranspose,l.localTransposePreferFlats,l.freegchord)};var u=["c","d","e","f","g","a","b"];function f(l,o,h,s,v){for(var y=u[(l+49)%7],m=0,_=0;_<s.length;_++)s[_].note.toLowerCase()===y&&(m=g[s[_].acc]);for(var k=g[h],x=k-m,R=u[(o+49)%7],I=0,b=0;b<v.accidentals.length;b++)v.accidentals[b].note.toLowerCase()===R&&(I=g[v.accidentals[b].acc]);var A=x+I;return A<-2&&(o--,A+=R==="c"||R==="f"?1:2),A>2&&(o++,A-=R==="b"||R==="e"?1:2),[o,A]}var g={dblflat:-2,flat:-1,natural:0,sharp:1,dblsharp:2},d={"-2":"dblflat","-1":"flat",0:"natural",1:"sharp",2:"dblsharp"},p={"-2":"__","-1":"_",0:"=",1:"^",2:"^^"};return n.note=function(l,o){if(!(!l.localTranspose||l.clef.type==="perc")){var h=o.pitch;if(l.localTransposeVerticalMovement&&(o.pitch=o.pitch+l.localTransposeVerticalMovement,o.name)){var s=o.accidental?o.name.substring(1):o.name,v=o.accidental?o.name[0]:"",y=e.pitchIndex(s);o.name=v+e.noteName(y+l.localTransposeVerticalMovement)}if(o.accidental){var m=f(h,o.pitch,o.accidental,l.globalTransposeOrigKeySig,l.targetKey);o.pitch=m[0],o.accidental=d[m[1]],o.name&&(o.name=p[m[1]]+o.name.replace(/[_^=]/g,""))}}},Tr=n,Tr}var Er,qi;function Za(){if(qi)return Er;qi=1;var e=$a(),t=kl(),a={};return(function(){var n,r,i,c;a.initialize=function(o,h,s,v,y){n=o,r=h,i=s,c=y},a.standardKey=function(o,h,s,v){return t.keySignature(i,o,h,s,v)};var u={treble:{clef:"treble",pitch:4,mid:0},"treble+8":{clef:"treble+8",pitch:4,mid:0},"treble-8":{clef:"treble-8",pitch:4,mid:0},"treble^8":{clef:"treble+8",pitch:4,mid:0},treble_8:{clef:"treble-8",pitch:4,mid:0},treble1:{clef:"treble",pitch:2,mid:2},treble2:{clef:"treble",pitch:4,mid:0},treble3:{clef:"treble",pitch:6,mid:-2},treble4:{clef:"treble",pitch:8,mid:-4},treble5:{clef:"treble",pitch:10,mid:-6},perc:{clef:"perc",pitch:6,mid:0},none:{clef:"none",mid:0},bass:{clef:"bass",pitch:8,mid:-12},"bass+8":{clef:"bass+8",pitch:8,mid:-12},"bass-8":{clef:"bass-8",pitch:8,mid:-12},"bass^8":{clef:"bass+8",pitch:8,mid:-12},bass_8:{clef:"bass-8",pitch:8,mid:-12},"bass+16":{clef:"bass",pitch:8,mid:-12},"bass-16":{clef:"bass",pitch:8,mid:-12},"bass^16":{clef:"bass",pitch:8,mid:-12},bass_16:{clef:"bass",pitch:8,mid:-12},bass1:{clef:"bass",pitch:2,mid:-6},bass2:{clef:"bass",pitch:4,mid:-8},bass3:{clef:"bass",pitch:6,mid:-10},bass4:{clef:"bass",pitch:8,mid:-12},bass5:{clef:"bass",pitch:10,mid:-14},tenor:{clef:"alto",pitch:8,mid:-8},tenor1:{clef:"alto",pitch:2,mid:-2},tenor2:{clef:"alto",pitch:4,mid:-4},tenor3:{clef:"alto",pitch:6,mid:-6},tenor4:{clef:"alto",pitch:8,mid:-8},tenor5:{clef:"alto",pitch:10,mid:-10},alto:{clef:"alto",pitch:6,mid:-6},alto1:{clef:"alto",pitch:2,mid:-2},alto2:{clef:"alto",pitch:4,mid:-4},alto3:{clef:"alto",pitch:6,mid:-6},alto4:{clef:"alto",pitch:8,mid:-8},alto5:{clef:"alto",pitch:10,mid:-10},"alto+8":{clef:"alto+8",pitch:6,mid:-6},"alto-8":{clef:"alto-8",pitch:6,mid:-6},"alto^8":{clef:"alto+8",pitch:6,mid:-6},alto_8:{clef:"alto-8",pitch:6,mid:-6}},f=function(o,h){var s=u[o],v=s?s.mid:0;return v+h};a.fixClef=function(o){var h=u[o.type];h&&(o.clefPos=h.pitch,o.type=h.clef)},a.deepCopyKey=function(o){var h={accidentals:[],root:o.root,acc:o.acc,mode:o.mode};return o.accidentals.forEach(function(s){h.accidentals.push(Object.assign({},s))}),h};var g={A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11};a.addPosToKey=function(o,h){var s=o.verticalPos;h.accidentals.forEach(function(v){var y=g[v.note];y=y-s,v.verticalPos=y}),h.impliedNaturals&&h.impliedNaturals.forEach(function(v){var y=g[v.note];y=y-s,v.verticalPos=y}),s<-10?(h.accidentals.forEach(function(v){v.verticalPos-=7,(v.verticalPos>=11||v.verticalPos===10&&v.acc==="flat")&&(v.verticalPos-=7),v.note==="A"&&v.acc==="sharp"&&(v.verticalPos-=7),(v.note==="G"||v.note==="F")&&v.acc==="flat"&&(v.verticalPos-=7)}),h.impliedNaturals&&h.impliedNaturals.forEach(function(v){v.verticalPos-=7,(v.verticalPos>=11||v.verticalPos===10&&v.acc==="flat")&&(v.verticalPos-=7),v.note==="A"&&v.acc==="sharp"&&(v.verticalPos-=7),(v.note==="G"||v.note==="F")&&v.acc==="flat"&&(v.verticalPos-=7)})):s<-4?(h.accidentals.forEach(function(v){v.verticalPos-=7,s===-8&&(v.note==="f"||v.note==="g")&&v.acc==="sharp"&&(v.verticalPos-=7)}),h.impliedNaturals&&h.impliedNaturals.forEach(function(v){v.verticalPos-=7,s===-8&&(v.note==="f"||v.note==="g")&&v.acc==="sharp"&&(v.verticalPos-=7)})):s>=7&&(h.accidentals.forEach(function(v){v.verticalPos+=7}),h.impliedNaturals&&h.impliedNaturals.forEach(function(v){v.verticalPos+=7}))},a.fixKey=function(o,h){var s=Object.assign({},h);return a.addPosToKey(o,s),s};var d=function(o){var h=0,s=o[h++];(s==="^"||s==="_")&&(s=o[h++]);var v=g[s];for(v===void 0&&(v=6);h<o.length;h++)if(o[h]===",")v-=7;else if(o[h]==="'")v+=7;else break;return{mid:v-6,str:o.substring(h)}},p=function(o){for(var h=0;h<o.length;h++)o[h].note==="b"?o[h].note="B":o[h].note==="a"?o[h].note="A":o[h].note==="F"?o[h].note="f":o[h].note==="E"?o[h].note="e":o[h].note==="D"?o[h].note="d":o[h].note==="C"?o[h].note="c":o[h].note==="G"&&o[h].acc==="sharp"?o[h].note="g":o[h].note==="g"&&o[h].acc==="flat"&&(o[h].note="G")};a.parseKey=function(o,h){o.length===0&&(o="none");var s=n.tokenize(o,0,o.length),v={};if(s.length===0)return r("Must pass in key signature.",o,0),v;switch(s[0].token){case"HP":e.addDirective("bagpipes"),i.key={root:"HP",accidentals:[],acc:"",mode:""},v.foundKey=!0,s.shift();break;case"Hp":e.addDirective("bagpipes"),i.key={root:"Hp",accidentals:[{acc:"natural",note:"g"},{acc:"sharp",note:"f"},{acc:"sharp",note:"c"}],acc:"",mode:""},v.foundKey=!0,s.shift();break;case"none":i.key={root:"none",accidentals:[],acc:"",mode:""},v.foundKey=!0,s.shift();break;default:var y=n.getKeyPitch(s[0].token);if(y.len>0){v.foundKey=!0;var m="",_="";s[0].token.length>1?s[0].token=s[0].token.substring(1):s.shift();var k=y.token;if(s.length>0){var x=n.getSharpFlat(s[0].token);if(x.len>0&&(s[0].token.length>1?s[0].token=s[0].token.substring(1):s.shift(),k+=x.token,m=x.token),s.length>0){var R=n.getMode(s[0].token);R.len>0&&(s.shift(),k+=R.token,_=R.token)}if(a.standardKey(k,y.token,m,0)===void 0)return r("Unsupported key signature: "+k,o,0),v}var I=a.deepCopyKey(i.key),b=!h&&i.globalTranspose?-i.globalTranspose:0,A;if(h&&(A=i.globalTransposeOrigKeySig),i.key=a.deepCopyKey(a.standardKey(k,y.token,m,b)),h&&(i.globalTransposeOrigKeySig=A),i.key.mode=_,I&&i.keywarn!==!1){for(var N,M=0;M<i.key.accidentals.length;M++)for(N=0;N<I.accidentals.length;N++)I.accidentals[N].note&&i.key.accidentals[M].note.toLowerCase()===I.accidentals[N].note.toLowerCase()&&(I.accidentals[N].note=null);for(N=0;N<I.accidentals.length;N++)I.accidentals[N].note&&(i.key.impliedNaturals||(i.key.impliedNaturals=[]),i.key.impliedNaturals.push({acc:"natural",note:I.accidentals[N].note}))}}break}if(s.length===0||(s[0].token==="exp"&&s.shift(),s.length===0)||(s[0].token==="oct"&&s.shift(),s.length===0))return v;var z=n.getKeyAccidentals2(s);if(z.warn&&r(z.warn,o,0),z.accs){v.foundKey||(v.foundKey=!0,i.key={root:"none",acc:"",mode:"",accidentals:[]}),p(z.accs);for(var L=0;L<z.accs.length;L++){for(var E=!1,T=0;T<i.key.accidentals.length&&!E;T++)i.key.accidentals[T].note===z.accs[L].note&&(E=!0,i.key.accidentals[T].acc!==z.accs[L].acc&&(i.key.accidentals[T].acc=z.accs[L].acc,i.key.explicitAccidentals||(i.key.explicitAccidentals=[]),i.key.explicitAccidentals.push(z.accs[L])));if(!E&&(i.key.explicitAccidentals||(i.key.explicitAccidentals=[]),i.key.explicitAccidentals.push(z.accs[L]),i.key.accidentals.push(z.accs[L]),i.key.impliedNaturals))for(var P=0;P<i.key.impliedNaturals.length;P++)i.key.impliedNaturals[P].note===z.accs[L].note&&i.key.impliedNaturals.splice(P,1)}}for(var B;s.length>0;)switch(s[0].token){case"m":case"middle":if(s.shift(),s.length===0)return r("Expected = after middle",o,0),v;if(B=s.shift(),B.token!=="="){r("Expected = after middle",o,B.start);break}if(s.length===0)return r("Expected parameter after middle=",o,0),v;var O=n.getPitchFromTokens(s);O.warn&&r(O.warn,o,0),O.position&&(i.clef.verticalPos=O.position-6);break;case"transpose":if(s.shift(),s.length===0)return r("Expected = after transpose",o,0),v;if(B=s.shift(),B.token!=="="){r("Expected = after transpose",o,B.start);break}if(s.length===0)return r("Expected parameter after transpose=",o,0),v;if(s[0].type!=="number"){r("Expected number after transpose",o,s[0].start);break}i.clef.transpose=s[0].intt,s.shift();break;case"stafflines":if(s.shift(),s.length===0)return r("Expected = after stafflines",o,0),v;if(B=s.shift(),B.token!=="="){r("Expected = after stafflines",o,B.start);break}if(s.length===0)return r("Expected parameter after stafflines=",o,0),v;if(s[0].type!=="number"){r("Expected number after stafflines",o,s[0].start);break}i.clef.stafflines=s[0].intt,s.shift();break;case"staffscale":if(s.shift(),s.length===0)return r("Expected = after staffscale",o,0),v;if(B=s.shift(),B.token!=="="){r("Expected = after staffscale",o,B.start);break}if(s.length===0)return r("Expected parameter after staffscale=",o,0),v;if(s[0].type!=="number"){r("Expected number after staffscale",o,s[0].start);break}i.clef.staffscale=s[0].floatt,s.shift();break;case"octave":if(s.shift(),s.length===0)return r("Expected = after octave",o,0),v;if(B=s.shift(),B.token!=="="){r("Expected = after octave",o,B.start);break}if(s.length===0)return r("Expected parameter after octave=",o,0),v;if(s[0].type!=="number"){r("Expected number after octave",o,s[0].start);break}i.octave=s[0].intt,s.shift();break;case"style":if(s.shift(),s.length===0)return r("Expected = after style",o,0),v;if(B=s.shift(),B.token!=="="){r("Expected = after style",o,B.start);break}if(s.length===0)return r("Expected parameter after style=",o,0),v;switch(s[0].token){case"normal":case"harmonic":case"rhythm":case"x":case"triangle":i.style=s[0].token,s.shift();break;default:r("error parsing style element: "+s[0].token,o,s[0].start);break}break;case"clef":if(s.shift(),s.length===0)return r("Expected = after clef",o,0),v;if(B=s.shift(),B.token!=="="){r("Expected = after clef",o,B.start);break}if(s.length===0)return r("Expected parameter after clef=",o,0),v;case"treble":case"bass":case"alto":case"tenor":case"perc":case"none":var w=s.shift();switch(w.token){case"treble":case"tenor":case"alto":case"bass":case"perc":case"none":break;case"C":w.token="alto";break;case"F":w.token="bass";break;case"G":w.token="treble";break;case"c":w.token="alto";break;case"f":w.token="bass";break;case"g":w.token="treble";break;default:r("Expected clef name. Found "+w.token,o,w.start);break}s.length>0&&s[0].type==="number"&&(w.token+=s[0].token,s.shift()),s.length>1&&(s[0].token==="-"||s[0].token==="+"||s[0].token==="^"||s[0].token==="_")&&s[1].token==="8"&&(w.token+=s[0].token+s[1].token,s.shift(),s.shift()),i.clef={type:w.token,verticalPos:f(w.token,0)},i.currentVoice&&i.currentVoice.transpose!==void 0&&(i.clef.transpose=i.currentVoice.transpose),v.foundClef=!0;break;default:r("Unknown parameter: "+s[0].token,o,s[0].start),s.shift()}return v};var l=function(o){var h=i.voices[o];if(!(i.currentVoice&&i.currentVoice.index===h.index&&i.currentVoice.staffNum===h.staffNum))return i.currentVoice=h,c.setCurrentVoice(h.staffNum,h.index,o)};a.parseVoice=function(o,h,s){var v=n.getMeat(o,h,s),y=v.start,m=v.end,_=n.getToken(o,y,m);if(_.length===0){r("Expected a voice id",o,y);return}var k=!1;i.voices[_]===void 0&&(i.voices[_]={},k=!0,i.score_is_present&&r("Can't have an unknown V: id when the %score directive is present",o,y)),y+=_.length,y+=n.eatWhiteSpace(o,y);for(var x={startStaff:k},R=function(O){var w=n.getVoiceToken(o,y,m);w.warn!==void 0?r("Expected value for "+O+" in voice: "+w.warn,o,y):w.err!==void 0?r("Expected value for "+O+" in voice: "+w.err,o,y):w.token.length===0&&o[y]!=='"'?r("Expected value for "+O+" in voice",o,y):x[O]=w.token,y+=w.len},I=function(O,w,C){var S=n.getVoiceToken(o,y,m);S.warn!==void 0?r("Expected value for "+w+" in voice: "+S.warn,o,y):S.err!==void 0?r("Expected value for "+w+" in voice: "+S.err,o,y):S.token.length===0&&o[y]!=='"'?r("Expected value for "+w+" in voice",o,y):(S.token=parseFloat(S.token),i.voices[O][w]=S.token),y+=S.len},b=function(O,w){var C=n.getVoiceToken(o,y,m);if(C.warn!==void 0)r("Expected value for "+O+" in voice: "+C.warn,o,y);else if(C.err!==void 0)r("Expected value for "+O+" in voice: "+C.err,o,y);else if(C.token.length===0&&o[y]!=='"')r("Expected value for "+O+" in voice",o,y);else return C.token;y+=C.len},A=function(O,w){var C={_B:2,_E:9,_b:-10,_e:-3},S=n.getVoiceToken(o,y,m);if(S.warn!==void 0)r("Expected one of (_B, _E, _b, _e) for "+w+" in voice: "+S.warn,o,y);else if(S.token.length===0&&o[y]!=='"')r("Expected one of (_B, _E, _b, _e) for "+w+" in voice",o,y);else{var q=C[S.token];q?i.voices[O][w]=q:r("Expected one of (_B, _E, _b, _e) for "+w+" in voice",o,y)}y+=S.len};y<m;){var N=n.getVoiceToken(o,y,m);if(y+=N.len,N.warn)r("Error parsing voice: "+N.warn,o,y);else{var M=null;switch(N.token){case"clef":case"cl":R("clef");var z=0;x.clef!==void 0&&(x.clef=x.clef.replace(/[',]/g,""),x.clef.indexOf("+16")!==-1&&(z+=14,x.clef=x.clef.replace("+16","")),x.verticalPos=f(x.clef,z));break;case"treble":case"bass":case"tenor":case"alto":case"perc":case"none":case"treble'":case"bass'":case"tenor'":case"alto'":case"none'":case"treble''":case"bass''":case"tenor''":case"alto''":case"none''":case"treble,":case"bass,":case"tenor,":case"alto,":case"none,":case"treble,,":case"bass,,":case"tenor,,":case"alto,,":case"none,,":case"treble+8":case"treble-8":case"treble^8":case"treble_8":case"treble1":case"treble2":case"treble3":case"treble4":case"treble5":case"bass+8":case"bass-8":case"bass^8":case"bass_8":case"bass+16":case"bass-16":case"bass^16":case"bass_16":case"bass1":case"bass2":case"bass3":case"bass4":case"bass5":case"tenor1":case"tenor2":case"tenor3":case"tenor4":case"tenor5":case"alto1":case"alto2":case"alto3":case"alto4":case"alto5":case"alto+8":case"alto-8":case"alto^8":case"alto_8":var L=0;x.clef=N.token.replace(/[',]/g,""),x.verticalPos=f(x.clef,L),i.voices[_].clef=N.token;break;case"staves":case"stave":case"stv":R("staves");break;case"brace":case"brc":R("brace");break;case"bracket":case"brk":R("bracket");break;case"name":case"nm":R("name");break;case"subname":case"sname":case"snm":R("subname");break;case"merge":x.startStaff=!1;break;case"stem":case"stems":M=n.getVoiceToken(o,y,m),M.warn!==void 0?r("Expected value for stems in voice: "+M.warn,o,y):M.err!==void 0?r("Expected value for stems in voice: "+M.err,o,y):M.token==="up"||M.token==="down"?i.voices[_].stem=M.token:r("Expected up or down for voice stem",o,y),y+=M.len;break;case"up":case"down":i.voices[_].stem=N.token;break;case"middle":case"m":R("verticalPos"),x.verticalPos=d(x.verticalPos).mid;break;case"gchords":case"gch":i.voices[_].suppressChords=!0,M=n.getVoiceToken(o,y,m),M.token==="0"&&(y=y+M.len);break;case"space":case"spc":R("spacing");break;case"scale":I(_,"scale");break;case"score":A(_,"scoreTranspose");break;case"transpose":I(_,"transpose");break;case"stafflines":I(_,"stafflines");break;case"staffscale":I(_,"staffscale");break;case"octave":I(_,"octave");break;case"volume":I(_,"volume");break;case"cue":var E=b("cue");E==="on"?i.voices[_].scale=.6:i.voices[_].scale=1;break;case"style":M=n.getVoiceToken(o,y,m),M.warn!==void 0?r("Expected value for style in voice: "+M.warn,o,y):M.err!==void 0?r("Expected value for style in voice: "+M.err,o,y):M.token==="normal"||M.token==="harmonic"||M.token==="rhythm"||M.token==="x"||M.token==="triangle"?i.voices[_].style=M.token:r("Expected one of [normal, harmonic, rhythm, x, triangle] for voice style",o,y),y+=M.len;break}}y+=n.eatWhiteSpace(o,y)}if((x.startStaff||i.staves.length===0)&&(i.staves.push({index:i.staves.length,meter:i.origMeter}),i.score_is_present||(i.staves[i.staves.length-1].numVoices=0)),i.voices[_].staffNum===void 0){i.voices[_].staffNum=i.staves.length-1;var T=0;for(var P in i.voices)i.voices.hasOwnProperty(P)&&i.voices[P].staffNum===i.voices[_].staffNum&&T++;i.voices[_].index=T-1}var B=i.staves[i.voices[_].staffNum];return i.score_is_present||B.numVoices++,x.clef&&(B.clef={type:x.clef,verticalPos:x.verticalPos}),x.spacing&&(B.spacing_below_offset=x.spacing),x.verticalPos&&(B.verticalPos=x.verticalPos),x.name&&(B.name?B.name.push(x.name):B.name=[x.name]),x.subname&&(B.subname?B.subname.push(x.subname):B.subname=[x.subname]),l(_)}})(),Er=a,Er}var Ar,Bi;function sg(){if(Bi)return Ar;Bi=1;var e=nt(),t=$a(),a=Za(),n=function(r,i,c,u,f){this.reset=function(p,l,o,h){a.initialize(p,l,o,h,f),t.initialize(p,l,o,h,f)},this.reset(r,i,c,u),this.setTitle=function(p,l){c.hasMainTitle?f.addSubtitle(p,{startChar:c.iChar,endChar:c.iChar+l+2}):(f.addMetaText("title",p,{startChar:c.iChar,endChar:c.iChar+l+2}),c.hasMainTitle=!0)},this.setMeter=function(p){if(p=r.stripComment(p),p==="C")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),{type:"common_time"};if(p==="C|")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),{type:"cut_time"};if(p==="o")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),{type:"tempus_perfectum"};if(p==="c")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),{type:"tempus_imperfectum"};if(p==="o.")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),{type:"tempus_perfectum_prolatio"};if(p==="c.")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),{type:"tempus_imperfectum_prolatio"};if(p.length===0||p.toLowerCase()==="none")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),null;var l=r.tokenize(p,0,p.length);try{var o=function(){var _={value:0,num:""},k=l.shift();for(k.token==="("&&(k=l.shift());;){if(k.type!=="number")throw"Expected top number of meter";if(_.value+=parseInt(k.token),_.num+=k.token,l.length===0||l[0].token==="/")return _;if(k=l.shift(),k.token===")"){if(l.length===0||l[0].token==="/")return _;throw"Unexpected paren in meter"}if(k.token!=="."&&k.token!=="+"||(_.num+=k.token,l.length===0))throw"Expected top number of meter";k=l.shift()}return _},h=function(){var _=o();if(l.length===0)return _;var k=l.shift();if(k.token!=="/")throw"Expected slash in meter";if(k=l.shift(),k.type!=="number")throw"Expected bottom number of meter";return _.den=k.token,_.value=_.value/parseInt(_.den),_};if(l.length===0)throw"Expected meter definition in M: line";for(var s={type:"specified",value:[]},v=0;;){var y=h();v+=y.value;var m={num:y.num};if(y.den!==void 0&&(m.den=y.den),s.value.push(m),l.length===0)break}return c.havent_set_length===!0&&(c.default_length=v<.75?.0625:.125,c.havent_set_length=!1),s}catch(_){i(_,p,0)}return null},this.calcTempo=function(p){var l=.25;c.meter&&c.meter.type==="specified"?l=1/parseInt(c.meter.value[0].den):c.origMeter&&c.origMeter.type==="specified"&&(l=1/parseInt(c.origMeter.value[0].den));for(var o=0;o<p.duration;o++)p.duration[o]=l*p.duration[o];return p},this.resolveTempo=function(){c.tempo&&(this.calcTempo(c.tempo),u.metaText.tempo=c.tempo,delete c.tempo)},this.addUserDefinition=function(p,l,o){var h=p.indexOf("=",l);if(h===-1){i("Need an = in a macro definition",p,l);return}var s=e.strip(p.substring(l,h)),v=e.strip(p.substring(h+1));if(s.length!==1){i("Macro definitions can only be one character",p,l);return}var y="HIJKLMNOPQRSTUVWXYhijklmnopqrstuvw~";if(y.indexOf(s)===-1){i("Macro definitions must be H-Y, h-w, or tilde",p,l);return}if(v.length===0){i("Missing macro definition",p,l);return}c.macros===void 0&&(c.macros={}),c.macros[s]=v},this.setDefaultLength=function(p,l,o){var h=p.substring(l,o).replace(/ /g,""),s=h.split("/");if(s.length===2){var v=parseInt(s[0]),y=parseInt(s[1]);y>0&&(c.default_length=v/y,c.havent_set_length=!1)}else s.length===1&&s[0]==="1"&&(c.default_length=1,c.havent_set_length=!1)};var g={larghissimo:20,adagissimo:24,sostenuto:28,grave:32,largo:40,lento:50,larghetto:60,adagio:68,adagietto:74,andante:80,andantino:88,"marcia moderato":84,"andante moderato":100,moderato:112,allegretto:116,"allegro moderato":120,allegro:126,animato:132,agitato:140,veloce:148,"mosso vivo":156,vivace:164,vivacissimo:172,allegrissimo:176,presto:184,prestissimo:210};this.setTempo=function(p,l,o,h){try{var s=r.tokenize(p,l,o);if(s.length===0)throw"Missing parameter in Q: field";var v={startChar:h+l-2,endChar:h+o},y=!0,m=s.shift();if(m.type==="quote"&&(v.preString=m.token,m=s.shift(),s.length===0))return g[v.preString.toLowerCase()]&&(v.bpm=g[v.preString.toLowerCase()],v.suppressBpm=!0),{type:"immediate",tempo:v};if(m.type==="alpha"&&m.token==="C"){if(s.length===0)throw"Missing tempo after C in Q: field";if(m=s.shift(),m.type==="punct"&&m.token==="="){if(s.length===0)throw"Missing tempo after = in Q: field";if(m=s.shift(),m.type!=="number")throw"Expected number after = in Q: field";v.duration=[1],v.bpm=parseInt(m.token)}else if(m.type==="number"){if(v.duration=[parseInt(m.token)],s.length===0)throw"Missing = after duration in Q: field";if(m=s.shift(),m.type!=="punct"||m.token!=="=")throw"Expected = after duration in Q: field";if(s.length===0)throw"Missing tempo after = in Q: field";if(m=s.shift(),m.type!=="number")throw"Expected number after = in Q: field";v.bpm=parseInt(m.token)}else throw"Expected number or equal after C in Q: field"}else if(m.type==="number"){var _=parseInt(m.token);if(s.length===0||s[0].type==="quote")v.duration=[1],v.bpm=_;else{if(y=!1,m=s.shift(),m.type!=="punct"&&m.token!=="/"||(m=s.shift(),m.type!=="number"))throw"Expected fraction in Q: field";var k=parseInt(m.token);for(v.duration=[_/k];s.length>0&&s[0].token!=="="&&s[0].type!=="quote";){if(m=s.shift(),m.type!=="number"||(_=parseInt(m.token),m=s.shift(),m.type!=="punct"&&m.token!=="/")||(m=s.shift(),m.type!=="number"))throw"Expected fraction in Q: field";k=parseInt(m.token),v.duration.push(_/k)}if(m=s.shift(),m.type!=="punct"&&m.token!=="=")throw"Expected = in Q: field";if(m=s.shift(),m.type!=="number")throw"Expected tempo in Q: field";v.bpm=parseInt(m.token)}}else throw"Unknown value in Q: field";if(s.length!==0&&(m=s.shift(),m.type==="quote"&&(v.postString=m.token,m=s.shift()),s.length!==0))throw"Unexpected string at end of Q: field";return c.printTempo===!1&&(v.suppress=!0),{type:y?"delaySet":"immediate",tempo:v}}catch(x){return i(x,p,l),{type:"none"}}},this.letter_to_inline_header=function(p,l,o){var h=!1,s=r.eatWhiteSpace(p,l);if(l+=s,p.length>=l+5&&p[l]==="["&&p[l+2]===":"){var v=p.indexOf("]",l),y=c.iChar+l,m=c.iChar+v+1;switch(p.substring(l,l+3)){case"[I:":var _=t.addDirective(p.substring(l+3,v));return _&&i(_,p,l),[v-l+1+s];case"[M:":var k=this.setMeter(p.substring(l+3,v));return f.hasBeginMusic()&&k?f.appendStartingElement("meter",y,m,k):c.meter=k,[v-l+1+s];case"[K:":var x=a.parseKey(p.substring(l+3,v),!0);return x.foundClef&&f.hasBeginMusic()&&f.appendStartingElement("clef",y,m,c.clef),x.foundKey&&f.hasBeginMusic()&&f.appendStartingElement("key",y,m,a.fixKey(c.clef,c.key)),[v-l+1+s];case"[P:":var R=t.parseFontChangeLine(p.substring(l+3,v));return o||u.lines.length<=u.lineNum?c.partForNextLine={title:R,startChar:y,endChar:m}:f.appendElement("part",y,m,{title:R}),[v-l+1+s];case"[L:":return this.setDefaultLength(p,l+3,v),[v-l+1+s];case"[Q:":if(v>0){var I=this.setTempo(p,l+3,v,c.iChar);return I.type==="delaySet"?f.hasBeginMusic()?f.appendElement("tempo",y,m,this.calcTempo(I.tempo)):c.tempoForNextLine=["tempo",y,m,this.calcTempo(I.tempo)]:I.type==="immediate"&&(!o&&f.hasBeginMusic()?f.appendElement("tempo",y,m,I.tempo):c.tempoForNextLine=["tempo",y,m,I.tempo]),[v-l+1+s,p[l+1],p.substring(l+3,v)]}break;case"[V:":if(v>0)return h=a.parseVoice(p,l+3,v),[v-l+1+s,p[l+1],p.substring(l+3,v),h];break;case"[r:":return[v-l+1+s]}}return[0]},this.letter_to_body_header=function(p,l){var o=!1;if(p.length>=l+3)switch(p.substring(l,l+2)){case"I:":var h=t.addDirective(p.substring(l+2));return h&&i(h,p,l),[p.length];case"M:":var s=this.setMeter(p.substring(l+2));return f.hasBeginMusic()&&s&&f.appendStartingElement("meter",c.iChar+l,c.iChar+p.length,s),[p.length];case"K:":var v=a.parseKey(p.substring(l+2),f.hasBeginMusic());return v.foundClef&&f.hasBeginMusic()&&c.keywarn!==!1&&f.appendStartingElement("clef",c.iChar+l,c.iChar+p.length,c.clef),v.foundKey&&f.hasBeginMusic()&&c.keywarn!==!1&&f.appendStartingElement("key",c.iChar+l,c.iChar+p.length,a.fixKey(c.clef,c.key)),[p.length];case"P:":return f.hasBeginMusic()&&f.appendElement("part",c.iChar+l,c.iChar+p.length,{title:p.substring(l+2)}),[p.length];case"L:":return this.setDefaultLength(p,l+2,p.length),[p.length];case"Q:":var y=p.indexOf("",l+2);y===-1&&(y=p.length);var m=this.setTempo(p,l+2,y,c.iChar);return m.type==="delaySet"?f.appendElement("tempo",c.iChar+l,c.iChar+p.length,this.calcTempo(m.tempo)):m.type==="immediate"&&f.appendElement("tempo",c.iChar+l,c.iChar+p.length,m.tempo),[y,p[l],e.strip(p.substring(l+2))];case"V:":return o=a.parseVoice(p,l+2,p.length),[p.length,p[l],e.strip(p.substring(l+2)),o]}return[0]};var d={A:"author",B:"book",C:"composer",D:"discography",F:"url",G:"group",I:"instruction",N:"notes",O:"origin",R:"rhythm",S:"source",W:"unalignedWords",Z:"transcription"};this.parseHeader=function(p){var l=d[p[0]],o=p.length-2,h=r.translateString(r.stripComment(p.substring(2)));if(l==="unalignedWords"||l==="notes")f.addMetaTextArray(l,t.parseFontChangeLine(h),{startChar:c.iChar,endChar:c.iChar+p.length});else if(l!==void 0)f.addMetaText(l,t.parseFontChangeLine(h),{startChar:c.iChar,endChar:c.iChar+p.length});else{var s=c.iChar,v=s+p.length;switch(p[0]){case"H":for(f.addMetaTextArray("history",t.parseFontChangeLine(h),{startChar:c.iChar,endChar:c.iChar+p.length}),p=r.peekLine();p&&p[1]!==":";)r.nextLine(),f.addMetaTextArray("history",t.parseFontChangeLine(r.translateString(r.stripComment(p))),{startChar:c.iChar,endChar:c.iChar+p.length}),p=r.peekLine();break;case"K":this.resolveTempo();var y=a.parseKey(p.substring(2),!1);!c.is_in_header&&f.hasBeginMusic()&&c.keywarn!==!1&&(y.foundClef&&f.appendStartingElement("clef",s,v,c.clef),y.foundKey&&f.appendStartingElement("key",s,v,a.fixKey(c.clef,c.key))),c.is_in_header=!1;break;case"L":this.setDefaultLength(p,2,p.length);break;case"M":c.origMeter=c.meter=this.setMeter(p.substring(2));break;case"P":c.is_in_header?f.addMetaText("partOrder",t.parseFontChangeLine(h),{startChar:c.iChar,endChar:c.iChar+p.length}):c.partForNextLine={title:h,startChar:s,endChar:v};break;case"Q":var m=this.setTempo(p,2,p.length,c.iChar);m.type==="delaySet"?c.tempo=m.tempo:m.type==="immediate"&&(u.metaText.tempo?c.tempoForNextLine=["tempo",s,v,m.tempo]:u.metaText.tempo=m.tempo);break;case"T":c.titlecaps&&(h=h.toUpperCase()),this.setTitle(t.parseFontChangeLine(r.theReverser(h)),o);break;case"U":this.addUserDefinition(p,2,p.length);break;case"V":if(a.parseVoice(p,2,p.length),!c.is_in_header)return{newline:!0};break;case"s":return{symbols:!0};case"w":return{words:!0};case"X":break;case"E":case"m":i("Ignored header",p,0);break;default:return{regular:!0}}}return{}}};return Ar=n,Ar}var Xe={},Li;function og(){return Li||(Li=1,Xe.legalAccents=["trill","trillh","lowermordent","uppermordent","mordent","pralltriller","accent","fermata","invertedfermata","tenuto","0","1","2","3","4","5","+","wedge","open","thumb","snap","turn","roll","breath","shortphrase","mediumphrase","longphrase","segno","coda","D.S.","D.C.","fine","beambr1","beambr2","slide","marcato","upbow","downbow","/","//","///","////","trem1","trem2","trem3","trem4","turnx","invertedturn","invertedturnx","trill(","trill)","arpeggio","xstem","mark","umarcato","style=normal","style=harmonic","style=rhythm","style=x","style=triangle","D.C.alcoda","D.C.alfine","D.S.alcoda","D.S.alfine","editorial","courtesy"],Xe.volumeDecorations=["p","pp","f","ff","mf","mp","ppp","pppp","fff","ffff","sfz"],Xe.dynamicDecorations=["crescendo(","crescendo)","diminuendo(","diminuendo)","glissando(","glissando)","~(","~)"],Xe.accentPseudonyms=[["<","accent"],[">","accent"],["tr","trill"],["plus","+"],["emphasis","accent"],["^","umarcato"],["marcato","umarcato"]],Xe.accentDynamicPseudonyms=[["<(","crescendo("],["<)","crescendo)"],[">(","diminuendo("],[">)","diminuendo)"]],Xe.nonDecorations="ABCDEFGabcdefgxyzZ[]|^_{",Xe.durations=[.5,.75,.875,.9375,.96875,.984375,.25,.375,.4375,.46875,.484375,.4921875,.125,.1875,.21875,.234375,.2421875,.24609375,.0625,.09375,.109375,.1171875,.12109375,.123046875,.03125,.046875,.0546875,.05859375,.060546875,.0615234375,.015625,.0234375,.02734375,.029296875,.0302734375,.03076171875],Xe.pitches={A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11},Xe.rests={x:"invisible",X:"invisible-multimeasure",y:"spacer",z:"rest",Z:"multimeasure"},Xe.accMap={dblflat:"__",flat:"_",natural:"=",sharp:"^",dblsharp:"^^",quarterflat:"_/",quartersharp:"^/"},Xe.tripletQ={2:3,3:2,4:3,5:2,6:2,7:2,8:3,9:2}),Xe}var Mr,Oi;function cg(){if(Oi)return Mr;Oi=1;var e=Za(),t=kl(),a,n,r,i,c,u,{legalAccents:f,volumeDecorations:g,dynamicDecorations:d,accentPseudonyms:p,accentDynamicPseudonyms:l,nonDecorations:o,durations:h,pitches:s,rests:v,accMap:y,tripletQ:m}=og(),_=function(w,C,S,q,D,$){a=w,n=C,r=S,i=q,c=D,u=$,this.lineContinuation=!1},k=function(w,C,S){if(w.inTie[C]===void 0)return!1;var q=w.currentVoice?w.currentVoice.staffNum*100+w.currentVoice.index:0;return!!(w.inTie[C][q]&&(S.pitches!==void 0||S.rest.type!=="spacer"))},x={};_.prototype.parseMusic=function(w){u.resolveTempo(),r.is_in_header=!1;for(var C=0,S=r.iChar;a.isWhiteSpace(w[C])&&C<w.length;)C++;if(!(C===w.length||w[C]==="%")){var q=r.start_new_line;r.continueall===void 0?r.start_new_line=!0:r.start_new_line=!1;var D=0,$=u.letter_to_body_header(w,C);$[0]>0&&(C+=$[0],$[1]==="V"&&this.startNewLine());for(var F=0;C<w.length;){var K=C;if(w[C]==="%")break;var te=u.letter_to_inline_header(w,C,q);if(te[0]>0)C+=te[0],te[1]==="V"&&(q=!0);else{(!c.hasBeginMusic()||q&&!this.lineContinuation)&&(this.startNewLine(),q=!1);for(var V;;)if(V=a.eatWhiteSpace(w,C),V>0&&(C+=V),C>0&&w[C-1]===""&&(V=u.letter_to_body_header(w,C),V[0]>0&&(V[1]==="V"&&this.startNewLine(),C=V[0],r.start_new_line=!1)),V=z(w,C),V[0]>0&&(C+=V[0]),V=I(w,C),V[0]>0){x.chord||(x.chord=[]);var ae=a.translateString(V[1]);ae=ae.replace(/;/g,`
|
|
86
|
+
`;$=a.nextLine()}c.addText(ee,{startChar:r.iChar,endChar:r.iChar+ee.length+7});break;case"continueall":r.continueall=!0;break;case"beginps":for($=a.nextLine();$&&$.indexOf("%%endps")!==0;)a.nextLine();n("Postscript ignored",w,0);break;case"deco":S.length>0&&r.ignoredDecorations.push(S.substring(0,S.indexOf(" "))),n("Decoration redefinition ignored",w,0);break;case"text":var de=a.translateString(S);c.addText(t.parseFontChangeLine(de),{startChar:r.iChar,endChar:r.iChar+S.length+7});break;case"center":var Se=a.translateString(S);c.addCentered(t.parseFontChangeLine(Se));break;case"font":break;case"setfont":var we=a.tokenize(S,0,S.length);if(we.length>=4&&we[0].token==="-"&&we[1].type==="number"){var Re=parseInt(we[1].token);Re>=1&&Re<=9&&(r.setfont||(r.setfont=[]),we.shift(),we.shift(),r.setfont[Re]=d(we,r.setfont[Re],w,0,"setfont"))}break;case"gchordfont":case"partsfont":case"tripletfont":case"vocalfont":case"textfont":case"annotationfont":case"historyfont":case"infofont":case"measurefont":case"repeatfont":case"wordsfont":return p(q,C,w);case"composerfont":case"subtitlefont":case"tempofont":case"titlefont":case"voicefont":case"footerfont":case"headerfont":return l(q,C,w);case"barlabelfont":case"barnumberfont":case"barnumfont":return p("measurefont",C,w);case"staves":case"score":r.score_is_present=!0;for(var ze=function(ct,Xl,ei,ti,Kl){(Xl||r.staves.length===0)&&r.staves.push({index:r.staves.length,numVoices:0});var lt=e.last(r.staves);ei!==void 0&<.bracket===void 0&&(lt.bracket=ei),ti!==void 0&<.brace===void 0&&(lt.brace=ti),Kl&&(lt.connectBarLines="end"),r.voices[ct]===void 0&&(r.voices[ct]={staffNum:lt.index,index:lt.numVoices},lt.numVoices++)},Oe=!1,Z=!1,W=!1,H=!1,Y=!1,Q=!1,re=!1,ie,ge=function(){if(re=!0,ie){var ct="start";ie.staffNum>0&&(r.staves[ie.staffNum-1].connectBarLines==="start"||r.staves[ie.staffNum-1].connectBarLines==="continue")&&(ct="continue"),r.staves[ie.staffNum].connectBarLines=ct}};C.length;){var ne=C.shift();switch(ne.token){case"(":Oe?n("Can't nest parenthesis in %%score",w,ne.start):(Oe=!0,H=!0);break;case")":!Oe||H?n("Unexpected close parenthesis in %%score",w,ne.start):Oe=!1;break;case"[":Z?n("Can't nest brackets in %%score",w,ne.start):(Z=!0,Y=!0);break;case"]":!Z||Y?n("Unexpected close bracket in %%score",w,ne.start):(Z=!1,r.staves[ie.staffNum].bracket="end");break;case"{":W?n("Can't nest braces in %%score",w,ne.start):(W=!0,Q=!0);break;case"}":!W||Q?n("Unexpected close brace in %%score",w,ne.start):(W=!1,r.staves[ie.staffNum].brace="end");break;case"|":ge();break;default:for(var ue="";(ne.type==="alpha"||ne.type==="number")&&(ue+=ne.token,ne.continueId);)ne=C.shift();var Ee=!Oe||H,qe=Y?"start":Z?"continue":void 0,pe=Q?"start":W?"continue":void 0;ze(ue,Ee,qe,pe,re),H=!1,Y=!1,Q=!1,re=!1,ie=r.voices[ue],q==="staves"&&ge();break}}break;case"maxstaves":var be=a.getInt(S);be.digits===0?n("Expected number of staves in maxstaves"):be.value>0&&(i.formatting.maxStaves=be.value);break;case"newpage":var $e=a.getInt(S);c.addNewPage($e.digits===0?-1:$e.value);break;case"abc":var ve=S.split(" ");switch(ve[0]){case"-copyright":case"-creator":case"-edited-by":case"-version":case"-charset":var rt=ve.shift();c.addMetaText(q+rt,ve.join(" "),{startChar:r.iChar,endChar:r.iChar+S.length+5});break;default:return"Unknown directive: "+q+ve[0]}break;case"header":case"footer":var Ue=a.getMeat(S,0,S.length);Ue=S.substring(Ue.start,Ue.end),Ue[0]==='"'&&Ue[Ue.length-1]==='"'&&(Ue=Ue.substring(1,Ue.length-1));var Ze=Ue.split(" "),st={};Ze.length===1?st={left:"",center:Ze[0],right:""}:Ze.length===2?st={left:Ze[0],center:Ze[1],right:""}:st={left:Ze[0],center:Ze[1],right:Ze[2]},Ze.length>3&&n("Too many tabs in "+q+": "+Ze.length+" found.",S,0),c.addMetaTextObj(q,st,{startChar:r.iChar,endChar:r.iChar+w.length});break;case"midi":var ot=a.tokenize(S,0,S.length,!0);ot.length>0&&ot[0].token==="="&&ot.shift(),ot.length===0?n("Expected midi command",S,0):P(ot,i,S);break;case"percmap":var vt=s(S);vt.error?n(vt.error,w,8):(i.formatting.percmap||(i.formatting.percmap={}),i.formatting.percmap[vt.key]=vt.value);break;case"visualtranspose":var kt=a.getInt(S);kt.digits===0?n("Expected number of half steps in visualTranspose"):r.globalTranspose=kt.value;break;case"map":case"playtempo":case"auquality":case"continuous":case"nobarcheck":i.formatting[q]=S;break;default:return"Unknown directive: "+q}return null},t.globalFormatting=function(w){for(var C in w)if(w.hasOwnProperty(C)){var S=""+w[C],q=a.tokenize(S,0,S.length),D;switch(C){case"titlefont":case"gchordfont":case"composerfont":case"footerfont":case"headerfont":case"historyfont":case"infofont":case"measurefont":case"partsfont":case"repeatfont":case"subtitlefont":case"tempofont":case"textfont":case"voicefont":case"tripletfont":case"vocalfont":case"wordsfont":case"annotationfont":case"tablabelfont":case"tabnumberfont":case"tabgracefont":p(C,q,S);break;case"scale":o(C,q);break;case"partsbox":D=_("partsBox",C,q),D!==null&&n(D),r.partsfont.box=r.partsBox;break;case"freegchord":D=_("freegchord",C,q),D!==null&&n(D);break;case"fontboxpadding":(q.length!==1||q[0].type!=="number")&&n('Directive "'+C+'" requires a number as a parameter.'),i.formatting.fontboxpadding=q[0].floatt;break;case"stafftopmargin":(q.length!==1||q[0].type!=="number")&&n('Directive "'+C+'" requires a number as a parameter.'),i.formatting.stafftopmargin=q[0].floatt;break;case"stretchlast":var $=O(q);if($.value!==void 0&&(i.formatting.stretchlast=$.value),$.error)return $.error;break;default:n("Formatting directive unrecognized: ",C,0)}}};function O(w){if(w.length===0)return{value:1};if(w.length===1)if(w[0].type==="number"){if(w[0].floatt>=0||w[0].floatt<=1)return{value:w[0].floatt}}else{if(w[0].token==="false")return{value:0};if(w[0].token==="true")return{value:1}}return{error:"Directive stretchlast requires zero or one parameter: false, true, or number between 0 and 1 (received "+w[0].token+")"}}})(),_r=t,_r}var kr,Ni;function ig(){if(Ni)return kr;Ni=1;var e={};const t=["C,,,","D,,,","E,,,","F,,,","G,,,","A,,,","B,,,","C,,","D,,","E,,","F,,","G,,","A,,","B,,","C,","D,","E,","F,","G,","A,","B,","C","D","E","F","G","A","B","c","d","e","f","g","a","b","c'","d'","e'","f'","g'","a'","b'","c''","d''","e''","f''","g''","a''","b''","c'''","d'''","e'''","f'''","g'''","a'''","b'''"];return e.pitchIndex=function(a){return t.indexOf(a)},e.noteName=function(a){return t[a]},kr=e,kr}var xr,Pi;function yl(){if(Pi)return xr;Pi=1;var e=["C","C♯","D","D♯","E","F","F♯","G","G♯","A","A♯","B"],t=["C","D♭","D","E♭","E","F","G♭","G","A♭","A","B♭","B"],a=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],n=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"];function r(i,c,u,f){if(!c||c%12===0)return i;for(;c<0;)c+=12;c>11&&(c=c%12);var g=i.match(/^([A-G][b#♭♯]?)([^\/]+)?\/?([A-G][b#♭♯]?)?(.+)?/);if(!g)return i;var d=g[1],p=g[2],l=g[3],o=g[4],h=e.indexOf(d);if(h<0&&(h=t.indexOf(d)),h<0&&(h=a.indexOf(d)),h<0&&(h=n.indexOf(d)),h<0)return i;h+=c,h=h%12,u?f?i=n[h]:i=t[h]:f?i=a[h]:i=e[h];var s=p&&(p.indexOf("dim")>=0||p.indexOf("°")>=0);if(s&&i==="A#"&&(i="Bb"),s&&i==="D#"&&(i="Eb"),s&&i==="A♯"&&(i="B♭"),s&&i==="D♯"&&(i="E♭"),p&&(i+=p),l){var h=e.indexOf(l);h<0&&(h=t.indexOf(l)),h<0&&(h=a.indexOf(l)),h<0&&(h=n.indexOf(l)),i+="/",h>=0?(h+=c,h=h%12,u?f?i+=n[h]:i+=t[h]:f?i+=a[h]:i+=e[h]):i+=l}return o&&(i+=o),i}return xr=r,xr}var Cr,zi;function wl(){if(zi)return Cr;zi=1;var e={C:{modes:["CMaj","CIon","Amin","AAeo","Am","GMix","DDor","EPhr","FLyd","BLoc"],stepsFromC:0},Db:{modes:["DbMaj","DbIon","Bbmin","BbAeo","Bbm","AbMix","EbDor","FPhr","GbLyd","CLoc"],stepsFromC:1},D:{modes:["DMaj","DIon","Bmin","BAeo","Bm","AMix","EDor","F#Phr","GLyd","C#Loc"],stepsFromC:2},Eb:{modes:["EbMaj","EbIon","Cmin","CAeo","Cm","BbMix","FDor","GPhr","AbLyd","DLoc"],stepsFromC:3},E:{modes:["EMaj","EIon","C#min","C#Aeo","C#m","BMix","F#Dor","G#Phr","ALyd","D#Loc"],stepsFromC:4},F:{modes:["FMaj","FIon","Dmin","DAeo","Dm","CMix","GDor","APhr","BbLyd","ELoc"],stepsFromC:5},Gb:{modes:["GbMaj","GbIon","Ebmin","EbAeo","Ebm","DbMix","AbDor","BbPhr","CbLyd","FLoc"],stepsFromC:6},G:{modes:["GMaj","GIon","Emin","EAeo","Em","DMix","ADor","BPhr","CLyd","F#Loc"],stepsFromC:7},Ab:{modes:["AbMaj","AbIon","Fmin","FAeo","Fm","EbMix","BbDor","CPhr","DbLyd","GLoc"],stepsFromC:8},A:{modes:["AMaj","AIon","F#min","F#Aeo","F#m","EMix","BDor","C#Phr","DLyd","G#Loc"],stepsFromC:9},Bb:{modes:["BbMaj","BbIon","Gmin","GAeo","Gm","FMix","CDor","DPhr","EbLyd","ALoc"],stepsFromC:10},B:{modes:["BMaj","BIon","G#min","G#Aeo","G#m","F#Mix","C#Dor","D#Phr","ELyd","A#Loc"],stepsFromC:11},"C#":{modes:["C#Maj","C#Ion","A#min","A#Aeo","A#m","G#Mix","D#Dor","E#Phr","F#Lyd","B#Loc"],stepsFromC:1},"F#":{modes:["F#Maj","F#Ion","D#min","D#Aeo","D#m","C#Mix","G#Dor","A#Phr","BLyd","E#Loc"],stepsFromC:6},Cb:{modes:["CbMaj","CbIon","Abmin","AbAeo","Abm","GbMix","DbDor","EbPhr","FbLyd","BbLoc"],stepsFromC:11}},t=["maj","ion","min","aeo","m","mix","dor","phr","lyd","loc"];function a(f){return t.indexOf(f.toLowerCase())>=0}var n=null;function r(){n={};for(var f=Object.keys(e),g=0;g<f.length;g++){var d=e[f[g]];n[f[g].toLowerCase()]=f[g];for(var p=0;p<d.modes.length;p++){var l=d.modes[p].toLowerCase();n[l]=f[g]}}}function i(f){n||r();var g=f.toLowerCase().match(/([a-g][b#]?)(maj|ion|min|aeo|mix|dor|phr|lyd|loc|m)?/);if(!g||!g[2])return f;g=g[1]+g[2];var d=n[g];return d||f}function c(f,g){var d=e[f];if(!d||g==="")return f;var p=g.toLowerCase().match(/^(maj|ion|min|aeo|mix|dor|phr|lyd|loc|m)/);if(!p)return f;for(var l=p[1],o=0;o<d.modes.length;o++){var h=d.modes[o],s=h.toLowerCase().indexOf(l);if(s!==-1&&s===h.length-l.length)return h.substring(0,h.length-l.length)}return f}function u(f,g){var d=e[f];if(!d)return f;for(;g<0;)g+=12;for(var p=(d.stepsFromC+g)%12,l=0;l<Object.keys(e).length;l++){var o=Object.keys(e)[l];if(e[o].stepsFromC===p)return o}return f}return Cr={relativeMajor:i,relativeMode:c,transposeKey:u,isLegalMode:a},Cr}var Sr,Ii;function _l(){if(Ii)return Sr;Ii=1;var{relativeMajor:e}=wl(),t={acc:"sharp",note:"f"},a={acc:"sharp",note:"c"},n={acc:"sharp",note:"g"},r={acc:"sharp",note:"d"},i={acc:"sharp",note:"A"},c={acc:"sharp",note:"e"},u={acc:"sharp",note:"B"},f={acc:"flat",note:"B"},g={acc:"flat",note:"e"},d={acc:"flat",note:"A"},p={acc:"flat",note:"d"},l={acc:"flat",note:"G"},o={acc:"flat",note:"c"},h={acc:"flat",note:"F"},s={"C#":[t,a,n,r,i,c,u],"F#":[t,a,n,r,i,c],B:[t,a,n,r,i],E:[t,a,n,r],A:[t,a,n],D:[t,a],G:[t],C:[],F:[f],Bb:[f,g],Eb:[f,g,d],Cm:[f,g,d],Ab:[f,g,d,p],Db:[f,g,d,p,l],Gb:[f,g,d,p,l,o],Cb:[f,g,d,p,l,o,h],"A#":[f,g],"B#":[],"D#":[f,g,d],"E#":[f],"G#":[f,g,d,p],none:[]};function v(y){var m=s[e(y)];return m?JSON.parse(JSON.stringify(m)):null}return Sr=v,Sr}var Tr,Ri;function kl(){if(Ri)return Tr;Ri=1;var e=ig(),t=yl(),a=_l(),n={},r={C:0,"C#":1,Db:1,D:2,"D#":3,Eb:3,E:4,F:5,"F#":6,Gb:6,G:7,"G#":8,Ab:8,A:9,"A#":10,Bb:10,B:11},i=["C","Db","D","Eb","E","F","F#","G","Ab","A","Bb","B"],c=["C","C#","D","D#","E","F","F#","G","G#","A","Bb","B"];n.keySignature=function(l,o,h,s,v){if(l.clef.type==="perc"||l.clef.type==="none")return{accidentals:a(o),root:h,acc:s};v||(v=0),l.localTransposeVerticalMovement=0,l.localTransposePreferFlats=!1;var y=a(o);if(!y)return l.key;if(l.localTranspose=(l.globalTranspose?l.globalTranspose:0)+v,!l.localTranspose)return{accidentals:y,root:h,acc:s};if(l.globalTransposeOrigKeySig=y,l.localTranspose%12===0)return l.localTransposeVerticalMovement=l.localTranspose/12*7,{accidentals:y,root:h,acc:s};var m=o[0];o[1]==="b"||o[1]==="#"?(m+=o[1],o=o.substr(2)):o=o.substr(1);var _=r[m],k=_!==void 0;k||(_=0,m="C",o="");for(var x=_+l.localTranspose;x<0;)x+=12;x>11&&(x=x%12);var R=o[0]==="m"?c[x]:i[x],I=R+o,b=a(I);(b.length===0||b[0].acc==="flat")&&(l.localTransposePreferFlats=!0);var A=I.charCodeAt(0)-m.charCodeAt(0);return l.localTranspose>0?(A<0||A===0&&(m[1]==="#"||I[1]==="b"))&&(A+=7):l.localTranspose<0&&(A>0||A===0&&(m[1]==="b"||I[1]==="#"))&&(A-=7),l.localTranspose>0?l.localTransposeVerticalMovement=A+Math.floor(l.localTranspose/12)*7:l.localTransposeVerticalMovement=A+Math.ceil(l.localTranspose/12)*7,k?{accidentals:b,root:R[0],acc:R.length>1?R[1]:""}:{accidentals:[],root:h,acc:s}},n.chordName=function(l,o){return t(o,l.localTranspose,l.localTransposePreferFlats,l.freegchord)};var u=["c","d","e","f","g","a","b"];function f(l,o,h,s,v){for(var y=u[(l+49)%7],m=0,_=0;_<s.length;_++)s[_].note.toLowerCase()===y&&(m=g[s[_].acc]);for(var k=g[h],x=k-m,R=u[(o+49)%7],I=0,b=0;b<v.accidentals.length;b++)v.accidentals[b].note.toLowerCase()===R&&(I=g[v.accidentals[b].acc]);var A=x+I;return A<-2&&(o--,A+=R==="c"||R==="f"?1:2),A>2&&(o++,A-=R==="b"||R==="e"?1:2),[o,A]}var g={dblflat:-2,flat:-1,natural:0,sharp:1,dblsharp:2},d={"-2":"dblflat","-1":"flat",0:"natural",1:"sharp",2:"dblsharp"},p={"-2":"__","-1":"_",0:"=",1:"^",2:"^^"};return n.note=function(l,o){if(!(!l.localTranspose||l.clef.type==="perc")){var h=o.pitch;if(l.localTransposeVerticalMovement&&(o.pitch=o.pitch+l.localTransposeVerticalMovement,o.name)){var s=o.accidental?o.name.substring(1):o.name,v=o.accidental?o.name[0]:"",y=e.pitchIndex(s);o.name=v+e.noteName(y+l.localTransposeVerticalMovement)}if(o.accidental){var m=f(h,o.pitch,o.accidental,l.globalTransposeOrigKeySig,l.targetKey);o.pitch=m[0],o.accidental=d[m[1]],o.name&&(o.name=p[m[1]]+o.name.replace(/[_^=]/g,""))}}},Tr=n,Tr}var Er,qi;function Za(){if(qi)return Er;qi=1;var e=$a(),t=kl(),a={};return(function(){var n,r,i,c;a.initialize=function(o,h,s,v,y){n=o,r=h,i=s,c=y},a.standardKey=function(o,h,s,v){return t.keySignature(i,o,h,s,v)};var u={treble:{clef:"treble",pitch:4,mid:0},"treble+8":{clef:"treble+8",pitch:4,mid:0},"treble-8":{clef:"treble-8",pitch:4,mid:0},"treble^8":{clef:"treble+8",pitch:4,mid:0},treble_8:{clef:"treble-8",pitch:4,mid:0},treble1:{clef:"treble",pitch:2,mid:2},treble2:{clef:"treble",pitch:4,mid:0},treble3:{clef:"treble",pitch:6,mid:-2},treble4:{clef:"treble",pitch:8,mid:-4},treble5:{clef:"treble",pitch:10,mid:-6},perc:{clef:"perc",pitch:6,mid:0},none:{clef:"none",mid:0},bass:{clef:"bass",pitch:8,mid:-12},"bass+8":{clef:"bass+8",pitch:8,mid:-12},"bass-8":{clef:"bass-8",pitch:8,mid:-12},"bass^8":{clef:"bass+8",pitch:8,mid:-12},bass_8:{clef:"bass-8",pitch:8,mid:-12},"bass+16":{clef:"bass",pitch:8,mid:-12},"bass-16":{clef:"bass",pitch:8,mid:-12},"bass^16":{clef:"bass",pitch:8,mid:-12},bass_16:{clef:"bass",pitch:8,mid:-12},bass1:{clef:"bass",pitch:2,mid:-6},bass2:{clef:"bass",pitch:4,mid:-8},bass3:{clef:"bass",pitch:6,mid:-10},bass4:{clef:"bass",pitch:8,mid:-12},bass5:{clef:"bass",pitch:10,mid:-14},tenor:{clef:"alto",pitch:8,mid:-8},tenor1:{clef:"alto",pitch:2,mid:-2},tenor2:{clef:"alto",pitch:4,mid:-4},tenor3:{clef:"alto",pitch:6,mid:-6},tenor4:{clef:"alto",pitch:8,mid:-8},tenor5:{clef:"alto",pitch:10,mid:-10},alto:{clef:"alto",pitch:6,mid:-6},alto1:{clef:"alto",pitch:2,mid:-2},alto2:{clef:"alto",pitch:4,mid:-4},alto3:{clef:"alto",pitch:6,mid:-6},alto4:{clef:"alto",pitch:8,mid:-8},alto5:{clef:"alto",pitch:10,mid:-10},"alto+8":{clef:"alto+8",pitch:6,mid:-6},"alto-8":{clef:"alto-8",pitch:6,mid:-6},"alto^8":{clef:"alto+8",pitch:6,mid:-6},alto_8:{clef:"alto-8",pitch:6,mid:-6}},f=function(o,h){var s=u[o],v=s?s.mid:0;return v+h};a.fixClef=function(o){var h=u[o.type];h&&(o.clefPos=h.pitch,o.type=h.clef)},a.deepCopyKey=function(o){var h={accidentals:[],root:o.root,acc:o.acc,mode:o.mode};return o.accidentals.forEach(function(s){h.accidentals.push(Object.assign({},s))}),h};var g={A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11};a.addPosToKey=function(o,h){var s=o.verticalPos;h.accidentals.forEach(function(v){var y=g[v.note];y=y-s,v.verticalPos=y}),h.impliedNaturals&&h.impliedNaturals.forEach(function(v){var y=g[v.note];y=y-s,v.verticalPos=y}),s<-10?(h.accidentals.forEach(function(v){v.verticalPos-=7,(v.verticalPos>=11||v.verticalPos===10&&v.acc==="flat")&&(v.verticalPos-=7),v.note==="A"&&v.acc==="sharp"&&(v.verticalPos-=7),(v.note==="G"||v.note==="F")&&v.acc==="flat"&&(v.verticalPos-=7)}),h.impliedNaturals&&h.impliedNaturals.forEach(function(v){v.verticalPos-=7,(v.verticalPos>=11||v.verticalPos===10&&v.acc==="flat")&&(v.verticalPos-=7),v.note==="A"&&v.acc==="sharp"&&(v.verticalPos-=7),(v.note==="G"||v.note==="F")&&v.acc==="flat"&&(v.verticalPos-=7)})):s<-4?(h.accidentals.forEach(function(v){v.verticalPos-=7,s===-8&&(v.note==="f"||v.note==="g")&&v.acc==="sharp"&&(v.verticalPos-=7)}),h.impliedNaturals&&h.impliedNaturals.forEach(function(v){v.verticalPos-=7,s===-8&&(v.note==="f"||v.note==="g")&&v.acc==="sharp"&&(v.verticalPos-=7)})):s>=7&&(h.accidentals.forEach(function(v){v.verticalPos+=7}),h.impliedNaturals&&h.impliedNaturals.forEach(function(v){v.verticalPos+=7}))},a.fixKey=function(o,h){var s=Object.assign({},h);return a.addPosToKey(o,s),s};var d=function(o){var h=0,s=o[h++];(s==="^"||s==="_")&&(s=o[h++]);var v=g[s];for(v===void 0&&(v=6);h<o.length;h++)if(o[h]===",")v-=7;else if(o[h]==="'")v+=7;else break;return{mid:v-6,str:o.substring(h)}},p=function(o){for(var h=0;h<o.length;h++)o[h].note==="b"?o[h].note="B":o[h].note==="a"?o[h].note="A":o[h].note==="F"?o[h].note="f":o[h].note==="E"?o[h].note="e":o[h].note==="D"?o[h].note="d":o[h].note==="C"?o[h].note="c":o[h].note==="G"&&o[h].acc==="sharp"?o[h].note="g":o[h].note==="g"&&o[h].acc==="flat"&&(o[h].note="G")};a.parseKey=function(o,h){o.length===0&&(o="none");var s=n.tokenize(o,0,o.length),v={};if(s.length===0)return r("Must pass in key signature.",o,0),v;switch(s[0].token){case"HP":e.addDirective("bagpipes"),i.key={root:"HP",accidentals:[],acc:"",mode:""},v.foundKey=!0,s.shift();break;case"Hp":e.addDirective("bagpipes"),i.key={root:"Hp",accidentals:[{acc:"natural",note:"g"},{acc:"sharp",note:"f"},{acc:"sharp",note:"c"}],acc:"",mode:""},v.foundKey=!0,s.shift();break;case"none":i.key={root:"none",accidentals:[],acc:"",mode:""},v.foundKey=!0,s.shift();break;default:var y=n.getKeyPitch(s[0].token);if(y.len>0){v.foundKey=!0;var m="",_="";s[0].token.length>1?s[0].token=s[0].token.substring(1):s.shift();var k=y.token;if(s.length>0){var x=n.getSharpFlat(s[0].token);if(x.len>0&&(s[0].token.length>1?s[0].token=s[0].token.substring(1):s.shift(),k+=x.token,m=x.token),s.length>0){var R=n.getMode(s[0].token);R.len>0&&(s.shift(),k+=R.token,_=R.token)}if(a.standardKey(k,y.token,m,0)===void 0)return r("Unsupported key signature: "+k,o,0),v}var I=a.deepCopyKey(i.key),b=!h&&i.globalTranspose?-i.globalTranspose:0,A;if(h&&(A=i.globalTransposeOrigKeySig),i.key=a.deepCopyKey(a.standardKey(k,y.token,m,b)),h&&(i.globalTransposeOrigKeySig=A),i.key.mode=_,I&&i.keywarn!==!1){for(var N,M=0;M<i.key.accidentals.length;M++)for(N=0;N<I.accidentals.length;N++)I.accidentals[N].note&&i.key.accidentals[M].note.toLowerCase()===I.accidentals[N].note.toLowerCase()&&(I.accidentals[N].note=null);for(N=0;N<I.accidentals.length;N++)I.accidentals[N].note&&(i.key.impliedNaturals||(i.key.impliedNaturals=[]),i.key.impliedNaturals.push({acc:"natural",note:I.accidentals[N].note}))}}break}if(s.length===0||(s[0].token==="exp"&&s.shift(),s.length===0)||(s[0].token==="oct"&&s.shift(),s.length===0))return v;var z=n.getKeyAccidentals2(s);if(z.warn&&r(z.warn,o,0),z.accs){v.foundKey||(v.foundKey=!0,i.key={root:"none",acc:"",mode:"",accidentals:[]}),p(z.accs);for(var L=0;L<z.accs.length;L++){for(var E=!1,T=0;T<i.key.accidentals.length&&!E;T++)i.key.accidentals[T].note===z.accs[L].note&&(E=!0,i.key.accidentals[T].acc!==z.accs[L].acc&&(i.key.accidentals[T].acc=z.accs[L].acc,i.key.explicitAccidentals||(i.key.explicitAccidentals=[]),i.key.explicitAccidentals.push(z.accs[L])));if(!E&&(i.key.explicitAccidentals||(i.key.explicitAccidentals=[]),i.key.explicitAccidentals.push(z.accs[L]),i.key.accidentals.push(z.accs[L]),i.key.impliedNaturals))for(var P=0;P<i.key.impliedNaturals.length;P++)i.key.impliedNaturals[P].note===z.accs[L].note&&i.key.impliedNaturals.splice(P,1)}}for(var B;s.length>0;)switch(s[0].token){case"m":case"middle":if(s.shift(),s.length===0)return r("Expected = after middle",o,0),v;if(B=s.shift(),B.token!=="="){r("Expected = after middle",o,B.start);break}if(s.length===0)return r("Expected parameter after middle=",o,0),v;var O=n.getPitchFromTokens(s);O.warn&&r(O.warn,o,0),O.position&&(i.clef.verticalPos=O.position-6);break;case"transpose":if(s.shift(),s.length===0)return r("Expected = after transpose",o,0),v;if(B=s.shift(),B.token!=="="){r("Expected = after transpose",o,B.start);break}if(s.length===0)return r("Expected parameter after transpose=",o,0),v;if(s[0].type!=="number"){r("Expected number after transpose",o,s[0].start);break}i.clef.transpose=s[0].intt,s.shift();break;case"stafflines":if(s.shift(),s.length===0)return r("Expected = after stafflines",o,0),v;if(B=s.shift(),B.token!=="="){r("Expected = after stafflines",o,B.start);break}if(s.length===0)return r("Expected parameter after stafflines=",o,0),v;if(s[0].type!=="number"){r("Expected number after stafflines",o,s[0].start);break}i.clef.stafflines=s[0].intt,s.shift();break;case"staffscale":if(s.shift(),s.length===0)return r("Expected = after staffscale",o,0),v;if(B=s.shift(),B.token!=="="){r("Expected = after staffscale",o,B.start);break}if(s.length===0)return r("Expected parameter after staffscale=",o,0),v;if(s[0].type!=="number"){r("Expected number after staffscale",o,s[0].start);break}i.clef.staffscale=s[0].floatt,s.shift();break;case"octave":if(s.shift(),s.length===0)return r("Expected = after octave",o,0),v;if(B=s.shift(),B.token!=="="){r("Expected = after octave",o,B.start);break}if(s.length===0)return r("Expected parameter after octave=",o,0),v;if(s[0].type!=="number"){r("Expected number after octave",o,s[0].start);break}i.octave=s[0].intt,s.shift();break;case"style":if(s.shift(),s.length===0)return r("Expected = after style",o,0),v;if(B=s.shift(),B.token!=="="){r("Expected = after style",o,B.start);break}if(s.length===0)return r("Expected parameter after style=",o,0),v;switch(s[0].token){case"normal":case"harmonic":case"rhythm":case"x":case"triangle":i.style=s[0].token,s.shift();break;default:r("error parsing style element: "+s[0].token,o,s[0].start);break}break;case"clef":if(s.shift(),s.length===0)return r("Expected = after clef",o,0),v;if(B=s.shift(),B.token!=="="){r("Expected = after clef",o,B.start);break}if(s.length===0)return r("Expected parameter after clef=",o,0),v;case"treble":case"bass":case"alto":case"tenor":case"perc":case"none":var w=s.shift();switch(w.token){case"treble":case"tenor":case"alto":case"bass":case"perc":case"none":break;case"C":w.token="alto";break;case"F":w.token="bass";break;case"G":w.token="treble";break;case"c":w.token="alto";break;case"f":w.token="bass";break;case"g":w.token="treble";break;default:r("Expected clef name. Found "+w.token,o,w.start);break}s.length>0&&s[0].type==="number"&&(w.token+=s[0].token,s.shift()),s.length>1&&(s[0].token==="-"||s[0].token==="+"||s[0].token==="^"||s[0].token==="_")&&s[1].token==="8"&&(w.token+=s[0].token+s[1].token,s.shift(),s.shift()),i.clef={type:w.token,verticalPos:f(w.token,0)},i.currentVoice&&i.currentVoice.transpose!==void 0&&(i.clef.transpose=i.currentVoice.transpose),v.foundClef=!0;break;default:r("Unknown parameter: "+s[0].token,o,s[0].start),s.shift()}return v};var l=function(o){var h=i.voices[o];if(!(i.currentVoice&&i.currentVoice.index===h.index&&i.currentVoice.staffNum===h.staffNum))return i.currentVoice=h,c.setCurrentVoice(h.staffNum,h.index,o)};a.parseVoice=function(o,h,s){var v=n.getMeat(o,h,s),y=v.start,m=v.end,_=n.getToken(o,y,m);if(_.length===0){r("Expected a voice id",o,y);return}var k=!1;i.voices[_]===void 0&&(i.voices[_]={},k=!0,i.score_is_present&&r("Can't have an unknown V: id when the %score directive is present",o,y)),y+=_.length,y+=n.eatWhiteSpace(o,y);for(var x={startStaff:k},R=function(O){var w=n.getVoiceToken(o,y,m);w.warn!==void 0?r("Expected value for "+O+" in voice: "+w.warn,o,y):w.err!==void 0?r("Expected value for "+O+" in voice: "+w.err,o,y):w.token.length===0&&o[y]!=='"'?r("Expected value for "+O+" in voice",o,y):x[O]=w.token,y+=w.len},I=function(O,w,C){var S=n.getVoiceToken(o,y,m);S.warn!==void 0?r("Expected value for "+w+" in voice: "+S.warn,o,y):S.err!==void 0?r("Expected value for "+w+" in voice: "+S.err,o,y):S.token.length===0&&o[y]!=='"'?r("Expected value for "+w+" in voice",o,y):(S.token=parseFloat(S.token),i.voices[O][w]=S.token),y+=S.len},b=function(O,w){var C=n.getVoiceToken(o,y,m);if(C.warn!==void 0)r("Expected value for "+O+" in voice: "+C.warn,o,y);else if(C.err!==void 0)r("Expected value for "+O+" in voice: "+C.err,o,y);else if(C.token.length===0&&o[y]!=='"')r("Expected value for "+O+" in voice",o,y);else return C.token;y+=C.len},A=function(O,w){var C={_B:2,_E:9,_b:-10,_e:-3},S=n.getVoiceToken(o,y,m);if(S.warn!==void 0)r("Expected one of (_B, _E, _b, _e) for "+w+" in voice: "+S.warn,o,y);else if(S.token.length===0&&o[y]!=='"')r("Expected one of (_B, _E, _b, _e) for "+w+" in voice",o,y);else{var q=C[S.token];q?i.voices[O][w]=q:r("Expected one of (_B, _E, _b, _e) for "+w+" in voice",o,y)}y+=S.len};y<m;){var N=n.getVoiceToken(o,y,m);if(y+=N.len,N.warn)r("Error parsing voice: "+N.warn,o,y);else{var M=null;switch(N.token){case"clef":case"cl":R("clef");var z=0;x.clef!==void 0&&(x.clef=x.clef.replace(/[',]/g,""),x.clef.indexOf("+16")!==-1&&(z+=14,x.clef=x.clef.replace("+16","")),x.verticalPos=f(x.clef,z));break;case"treble":case"bass":case"tenor":case"alto":case"perc":case"none":case"treble'":case"bass'":case"tenor'":case"alto'":case"none'":case"treble''":case"bass''":case"tenor''":case"alto''":case"none''":case"treble,":case"bass,":case"tenor,":case"alto,":case"none,":case"treble,,":case"bass,,":case"tenor,,":case"alto,,":case"none,,":case"treble+8":case"treble-8":case"treble^8":case"treble_8":case"treble1":case"treble2":case"treble3":case"treble4":case"treble5":case"bass+8":case"bass-8":case"bass^8":case"bass_8":case"bass+16":case"bass-16":case"bass^16":case"bass_16":case"bass1":case"bass2":case"bass3":case"bass4":case"bass5":case"tenor1":case"tenor2":case"tenor3":case"tenor4":case"tenor5":case"alto1":case"alto2":case"alto3":case"alto4":case"alto5":case"alto+8":case"alto-8":case"alto^8":case"alto_8":var L=0;x.clef=N.token.replace(/[',]/g,""),x.verticalPos=f(x.clef,L),i.voices[_].clef=N.token;break;case"staves":case"stave":case"stv":R("staves");break;case"brace":case"brc":R("brace");break;case"bracket":case"brk":R("bracket");break;case"name":case"nm":R("name");break;case"subname":case"sname":case"snm":R("subname");break;case"merge":x.startStaff=!1;break;case"stem":case"stems":M=n.getVoiceToken(o,y,m),M.warn!==void 0?r("Expected value for stems in voice: "+M.warn,o,y):M.err!==void 0?r("Expected value for stems in voice: "+M.err,o,y):M.token==="up"||M.token==="down"?i.voices[_].stem=M.token:r("Expected up or down for voice stem",o,y),y+=M.len;break;case"up":case"down":i.voices[_].stem=N.token;break;case"middle":case"m":R("verticalPos"),x.verticalPos=d(x.verticalPos).mid;break;case"gchords":case"gch":i.voices[_].suppressChords=!0,M=n.getVoiceToken(o,y,m),M.token==="0"&&(y=y+M.len);break;case"space":case"spc":R("spacing");break;case"scale":I(_,"scale");break;case"score":A(_,"scoreTranspose");break;case"transpose":I(_,"transpose");break;case"stafflines":I(_,"stafflines");break;case"staffscale":I(_,"staffscale");break;case"octave":I(_,"octave");break;case"volume":I(_,"volume");break;case"cue":var E=b("cue");E==="on"?i.voices[_].scale=.6:i.voices[_].scale=1;break;case"style":M=n.getVoiceToken(o,y,m),M.warn!==void 0?r("Expected value for style in voice: "+M.warn,o,y):M.err!==void 0?r("Expected value for style in voice: "+M.err,o,y):M.token==="normal"||M.token==="harmonic"||M.token==="rhythm"||M.token==="x"||M.token==="triangle"?i.voices[_].style=M.token:r("Expected one of [normal, harmonic, rhythm, x, triangle] for voice style",o,y),y+=M.len;break}}y+=n.eatWhiteSpace(o,y)}if((x.startStaff||i.staves.length===0)&&(i.staves.push({index:i.staves.length,meter:i.origMeter}),i.score_is_present||(i.staves[i.staves.length-1].numVoices=0)),i.voices[_].staffNum===void 0){i.voices[_].staffNum=i.staves.length-1;var T=0;for(var P in i.voices)i.voices.hasOwnProperty(P)&&i.voices[P].staffNum===i.voices[_].staffNum&&T++;i.voices[_].index=T-1}var B=i.staves[i.voices[_].staffNum];return i.score_is_present||B.numVoices++,x.clef&&(B.clef={type:x.clef,verticalPos:x.verticalPos}),x.spacing&&(B.spacing_below_offset=x.spacing),x.verticalPos&&(B.verticalPos=x.verticalPos),x.name&&(B.name?B.name.push(x.name):B.name=[x.name]),x.subname&&(B.subname?B.subname.push(x.subname):B.subname=[x.subname]),l(_)}})(),Er=a,Er}var Ar,Bi;function sg(){if(Bi)return Ar;Bi=1;var e=nt(),t=$a(),a=Za(),n=function(r,i,c,u,f){this.reset=function(p,l,o,h){a.initialize(p,l,o,h,f),t.initialize(p,l,o,h,f)},this.reset(r,i,c,u),this.setTitle=function(p,l){c.hasMainTitle?f.addSubtitle(p,{startChar:c.iChar,endChar:c.iChar+l+2}):(f.addMetaText("title",p,{startChar:c.iChar,endChar:c.iChar+l+2}),c.hasMainTitle=!0)},this.setMeter=function(p){if(p=r.stripComment(p),p==="C")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),{type:"common_time"};if(p==="C|")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),{type:"cut_time"};if(p==="o")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),{type:"tempus_perfectum"};if(p==="c")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),{type:"tempus_imperfectum"};if(p==="o.")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),{type:"tempus_perfectum_prolatio"};if(p==="c.")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),{type:"tempus_imperfectum_prolatio"};if(p.length===0||p.toLowerCase()==="none")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),null;var l=r.tokenize(p,0,p.length);try{var o=function(){var _={value:0,num:""},k=l.shift();for(k.token==="("&&(k=l.shift());;){if(k.type!=="number")throw"Expected top number of meter";if(_.value+=parseInt(k.token),_.num+=k.token,l.length===0||l[0].token==="/")return _;if(k=l.shift(),k.token===")"){if(l.length===0||l[0].token==="/")return _;throw"Unexpected paren in meter"}if(k.token!=="."&&k.token!=="+"||(_.num+=k.token,l.length===0))throw"Expected top number of meter";k=l.shift()}return _},h=function(){var _=o();if(l.length===0)return _;var k=l.shift();if(k.token!=="/")throw"Expected slash in meter";if(k=l.shift(),k.type!=="number")throw"Expected bottom number of meter";return _.den=k.token,_.value=_.value/parseInt(_.den),_};if(l.length===0)throw"Expected meter definition in M: line";for(var s={type:"specified",value:[]},v=0;;){var y=h();v+=y.value;var m={num:y.num};if(y.den!==void 0&&(m.den=y.den),s.value.push(m),l.length===0)break}return c.havent_set_length===!0&&(c.default_length=v<.75?.0625:.125,c.havent_set_length=!1),s}catch(_){i(_,p,0)}return null},this.calcTempo=function(p){var l=.25;c.meter&&c.meter.type==="specified"?l=1/parseInt(c.meter.value[0].den):c.origMeter&&c.origMeter.type==="specified"&&(l=1/parseInt(c.origMeter.value[0].den));for(var o=0;o<p.duration;o++)p.duration[o]=l*p.duration[o];return p},this.resolveTempo=function(){c.tempo&&(this.calcTempo(c.tempo),u.metaText.tempo=c.tempo,delete c.tempo)},this.addUserDefinition=function(p,l,o){var h=p.indexOf("=",l);if(h===-1){i("Need an = in a macro definition",p,l);return}var s=e.strip(p.substring(l,h)),v=e.strip(p.substring(h+1));if(s.length!==1){i("Macro definitions can only be one character",p,l);return}var y="HIJKLMNOPQRSTUVWXYhijklmnopqrstuvw~";if(y.indexOf(s)===-1){i("Macro definitions must be H-Y, h-w, or tilde",p,l);return}if(v.length===0){i("Missing macro definition",p,l);return}c.macros===void 0&&(c.macros={}),c.macros[s]=v},this.setDefaultLength=function(p,l,o){var h=p.substring(l,o).replace(/ /g,""),s=h.split("/");if(s.length===2){var v=parseInt(s[0]),y=parseInt(s[1]);y>0&&(c.default_length=v/y,c.havent_set_length=!1)}else s.length===1&&s[0]==="1"&&(c.default_length=1,c.havent_set_length=!1)};var g={larghissimo:20,adagissimo:24,sostenuto:28,grave:32,largo:40,lento:50,larghetto:60,adagio:68,adagietto:74,andante:80,andantino:88,"marcia moderato":84,"andante moderato":100,moderato:112,allegretto:116,"allegro moderato":120,allegro:126,animato:132,agitato:140,veloce:148,"mosso vivo":156,vivace:164,vivacissimo:172,allegrissimo:176,presto:184,prestissimo:210};this.setTempo=function(p,l,o,h){try{var s=r.tokenize(p,l,o);if(s.length===0)throw"Missing parameter in Q: field";var v={startChar:h+l-2,endChar:h+o},y=!0,m=s.shift();if(m.type==="quote"&&(v.preString=m.token,m=s.shift(),s.length===0))return g[v.preString.toLowerCase()]&&(v.bpm=g[v.preString.toLowerCase()],v.suppressBpm=!0),{type:"immediate",tempo:v};if(m.type==="alpha"&&m.token==="C"){if(s.length===0)throw"Missing tempo after C in Q: field";if(m=s.shift(),m.type==="punct"&&m.token==="="){if(s.length===0)throw"Missing tempo after = in Q: field";if(m=s.shift(),m.type!=="number")throw"Expected number after = in Q: field";v.duration=[1],v.bpm=parseInt(m.token)}else if(m.type==="number"){if(v.duration=[parseInt(m.token)],s.length===0)throw"Missing = after duration in Q: field";if(m=s.shift(),m.type!=="punct"||m.token!=="=")throw"Expected = after duration in Q: field";if(s.length===0)throw"Missing tempo after = in Q: field";if(m=s.shift(),m.type!=="number")throw"Expected number after = in Q: field";v.bpm=parseInt(m.token)}else throw"Expected number or equal after C in Q: field"}else if(m.type==="number"){var _=parseInt(m.token);if(s.length===0||s[0].type==="quote")v.duration=[1],v.bpm=_;else{if(y=!1,m=s.shift(),m.type!=="punct"&&m.token!=="/"||(m=s.shift(),m.type!=="number"))throw"Expected fraction in Q: field";var k=parseInt(m.token);for(v.duration=[_/k];s.length>0&&s[0].token!=="="&&s[0].type!=="quote";){if(m=s.shift(),m.type!=="number"||(_=parseInt(m.token),m=s.shift(),m.type!=="punct"&&m.token!=="/")||(m=s.shift(),m.type!=="number"))throw"Expected fraction in Q: field";k=parseInt(m.token),v.duration.push(_/k)}if(m=s.shift(),m.type!=="punct"&&m.token!=="=")throw"Expected = in Q: field";if(m=s.shift(),m.type!=="number")throw"Expected tempo in Q: field";v.bpm=parseInt(m.token)}}else throw"Unknown value in Q: field";if(s.length!==0&&(m=s.shift(),m.type==="quote"&&(v.postString=m.token,m=s.shift()),s.length!==0))throw"Unexpected string at end of Q: field";return c.printTempo===!1&&(v.suppress=!0),{type:y?"delaySet":"immediate",tempo:v}}catch(x){return i(x,p,l),{type:"none"}}},this.letter_to_inline_header=function(p,l,o){var h=!1,s=r.eatWhiteSpace(p,l);if(l+=s,p.length>=l+5&&p[l]==="["&&p[l+2]===":"){var v=p.indexOf("]",l),y=c.iChar+l,m=c.iChar+v+1;switch(p.substring(l,l+3)){case"[I:":var _=t.addDirective(p.substring(l+3,v));return _&&i(_,p,l),[v-l+1+s];case"[M:":var k=this.setMeter(p.substring(l+3,v));return f.hasBeginMusic()&&k?f.appendStartingElement("meter",y,m,k):c.meter=k,[v-l+1+s];case"[K:":var x=a.parseKey(p.substring(l+3,v),!0);return x.foundClef&&f.hasBeginMusic()&&f.appendStartingElement("clef",y,m,c.clef),x.foundKey&&f.hasBeginMusic()&&f.appendStartingElement("key",y,m,a.fixKey(c.clef,c.key)),[v-l+1+s];case"[P:":var R=t.parseFontChangeLine(p.substring(l+3,v));return o||u.lines.length<=u.lineNum?c.partForNextLine={title:R,startChar:y,endChar:m}:f.appendElement("part",y,m,{title:R}),[v-l+1+s];case"[L:":return this.setDefaultLength(p,l+3,v),[v-l+1+s];case"[Q:":if(v>0){var I=this.setTempo(p,l+3,v,c.iChar);return I.type==="delaySet"?f.hasBeginMusic()?f.appendElement("tempo",y,m,this.calcTempo(I.tempo)):c.tempoForNextLine=["tempo",y,m,this.calcTempo(I.tempo)]:I.type==="immediate"&&(!o&&f.hasBeginMusic()?f.appendElement("tempo",y,m,I.tempo):c.tempoForNextLine=["tempo",y,m,I.tempo]),[v-l+1+s,p[l+1],p.substring(l+3,v)]}break;case"[V:":if(v>0)return h=a.parseVoice(p,l+3,v),[v-l+1+s,p[l+1],p.substring(l+3,v),h];break;case"[r:":return[v-l+1+s]}}return[0]},this.letter_to_body_header=function(p,l){var o=!1;if(p.length>=l+3)switch(p.substring(l,l+2)){case"I:":var h=t.addDirective(p.substring(l+2));return h&&i(h,p,l),[p.length];case"M:":var s=this.setMeter(p.substring(l+2));return f.hasBeginMusic()&&s&&f.appendStartingElement("meter",c.iChar+l,c.iChar+p.length,s),[p.length];case"K:":var v=a.parseKey(p.substring(l+2),f.hasBeginMusic());return v.foundClef&&f.hasBeginMusic()&&c.keywarn!==!1&&f.appendStartingElement("clef",c.iChar+l,c.iChar+p.length,c.clef),v.foundKey&&f.hasBeginMusic()&&c.keywarn!==!1&&f.appendStartingElement("key",c.iChar+l,c.iChar+p.length,a.fixKey(c.clef,c.key)),[p.length];case"P:":return f.hasBeginMusic()&&f.appendElement("part",c.iChar+l,c.iChar+p.length,{title:p.substring(l+2)}),[p.length];case"L:":return this.setDefaultLength(p,l+2,p.length),[p.length];case"Q:":var y=p.indexOf("",l+2);y===-1&&(y=p.length);var m=this.setTempo(p,l+2,y,c.iChar);return m.type==="delaySet"?f.appendElement("tempo",c.iChar+l,c.iChar+p.length,this.calcTempo(m.tempo)):m.type==="immediate"&&f.appendElement("tempo",c.iChar+l,c.iChar+p.length,m.tempo),[y,p[l],e.strip(p.substring(l+2))];case"V:":return o=a.parseVoice(p,l+2,p.length),[p.length,p[l],e.strip(p.substring(l+2)),o]}return[0]};var d={A:"author",B:"book",C:"composer",D:"discography",F:"url",G:"group",I:"instruction",N:"notes",O:"origin",R:"rhythm",S:"source",W:"unalignedWords",Z:"transcription"};this.parseHeader=function(p){var l=d[p[0]],o=p.length-2,h=r.translateString(r.stripComment(p.substring(2)));if(l==="unalignedWords"||l==="notes")f.addMetaTextArray(l,t.parseFontChangeLine(h),{startChar:c.iChar,endChar:c.iChar+p.length});else if(l!==void 0)f.addMetaText(l,t.parseFontChangeLine(h),{startChar:c.iChar,endChar:c.iChar+p.length});else{var s=c.iChar,v=s+p.length;switch(p[0]){case"H":for(f.addMetaTextArray("history",t.parseFontChangeLine(h),{startChar:c.iChar,endChar:c.iChar+p.length}),p=r.peekLine();p&&p[1]!==":";)r.nextLine(),f.addMetaTextArray("history",t.parseFontChangeLine(r.translateString(r.stripComment(p))),{startChar:c.iChar,endChar:c.iChar+p.length}),p=r.peekLine();break;case"K":this.resolveTempo();var y=a.parseKey(p.substring(2),!1);!c.is_in_header&&f.hasBeginMusic()&&c.keywarn!==!1&&(y.foundClef&&f.appendStartingElement("clef",s,v,c.clef),y.foundKey&&f.appendStartingElement("key",s,v,a.fixKey(c.clef,c.key))),c.is_in_header=!1;break;case"L":this.setDefaultLength(p,2,p.length);break;case"M":c.origMeter=c.meter=this.setMeter(p.substring(2));break;case"P":c.is_in_header?f.addMetaText("partOrder",t.parseFontChangeLine(h),{startChar:c.iChar,endChar:c.iChar+p.length}):c.partForNextLine={title:h,startChar:s,endChar:v};break;case"Q":var m=this.setTempo(p,2,p.length,c.iChar);m.type==="delaySet"?c.tempo=m.tempo:m.type==="immediate"&&(u.metaText.tempo?c.tempoForNextLine=["tempo",s,v,m.tempo]:u.metaText.tempo=m.tempo);break;case"T":c.titlecaps&&(h=h.toUpperCase()),this.setTitle(t.parseFontChangeLine(r.theReverser(h)),o);break;case"U":this.addUserDefinition(p,2,p.length);break;case"V":if(a.parseVoice(p,2,p.length),!c.is_in_header)return{newline:!0};break;case"s":return{symbols:!0};case"w":return{words:!0};case"X":break;case"E":case"m":i("Ignored header",p,0);break;default:return{regular:!0}}}return{}}};return Ar=n,Ar}var Xe={},Li;function og(){return Li||(Li=1,Xe.legalAccents=["trill","trillh","lowermordent","uppermordent","mordent","pralltriller","accent","fermata","invertedfermata","tenuto","0","1","2","3","4","5","+","wedge","open","thumb","snap","turn","roll","breath","shortphrase","mediumphrase","longphrase","segno","coda","D.S.","D.C.","fine","beambr1","beambr2","slide","marcato","upbow","downbow","/","//","///","////","trem1","trem2","trem3","trem4","turnx","invertedturn","invertedturnx","trill(","trill)","arpeggio","xstem","mark","umarcato","style=normal","style=harmonic","style=rhythm","style=x","style=triangle","D.C.alcoda","D.C.alfine","D.S.alcoda","D.S.alfine","editorial","courtesy"],Xe.volumeDecorations=["p","pp","f","ff","mf","mp","ppp","pppp","fff","ffff","sfz"],Xe.dynamicDecorations=["crescendo(","crescendo)","diminuendo(","diminuendo)","glissando(","glissando)","~(","~)"],Xe.accentPseudonyms=[["<","accent"],[">","accent"],["tr","trill"],["plus","+"],["emphasis","accent"],["^","umarcato"],["marcato","umarcato"]],Xe.accentDynamicPseudonyms=[["<(","crescendo("],["<)","crescendo)"],[">(","diminuendo("],[">)","diminuendo)"]],Xe.nonDecorations="ABCDEFGabcdefgxyzZ[]|^_{",Xe.durations=[.5,.75,.875,.9375,.96875,.984375,.25,.375,.4375,.46875,.484375,.4921875,.125,.1875,.21875,.234375,.2421875,.24609375,.0625,.09375,.109375,.1171875,.12109375,.123046875,.03125,.046875,.0546875,.05859375,.060546875,.0615234375,.015625,.0234375,.02734375,.029296875,.0302734375,.03076171875],Xe.pitches={A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11},Xe.rests={x:"invisible",X:"invisible-multimeasure",y:"spacer",z:"rest",Z:"multimeasure"},Xe.accMap={dblflat:"__",flat:"_",natural:"=",sharp:"^",dblsharp:"^^",quarterflat:"_/",quartersharp:"^/"},Xe.tripletQ={2:3,3:2,4:3,5:2,6:2,7:2,8:3,9:2}),Xe}var Mr,Oi;function cg(){if(Oi)return Mr;Oi=1;var e=Za(),t=kl(),a,n,r,i,c,u,{legalAccents:f,volumeDecorations:g,dynamicDecorations:d,accentPseudonyms:p,accentDynamicPseudonyms:l,nonDecorations:o,durations:h,pitches:s,rests:v,accMap:y,tripletQ:m}=og(),_=function(w,C,S,q,D,$){a=w,n=C,r=S,i=q,c=D,u=$,this.lineContinuation=!1},k=function(w,C,S){if(w.inTie[C]===void 0)return!1;var q=w.currentVoice?w.currentVoice.staffNum*100+w.currentVoice.index:0;return!!(w.inTie[C][q]&&(S.pitches!==void 0||S.rest.type!=="spacer"))},x={};_.prototype.parseMusic=function(w){u.resolveTempo(),r.is_in_header=!1;for(var C=0,S=r.iChar;a.isWhiteSpace(w[C])&&C<w.length;)C++;if(!(C===w.length||w[C]==="%")){var q=r.start_new_line;r.continueall===void 0?r.start_new_line=!0:r.start_new_line=!1;var D=0,$=u.letter_to_body_header(w,C);$[0]>0&&(C+=$[0],$[1]==="V"&&this.startNewLine());for(var F=0;C<w.length;){var K=C;if(w[C]==="%")break;var te=u.letter_to_inline_header(w,C,q);if(te[0]>0)C+=te[0],te[1]==="V"&&(q=!0);else{(!c.hasBeginMusic()||q&&!this.lineContinuation)&&(this.startNewLine(),q=!1);for(var V;;)if(V=a.eatWhiteSpace(w,C),V>0&&(C+=V),C>0&&w[C-1]===""&&(V=u.letter_to_body_header(w,C),V[0]>0&&(V[1]==="V"&&this.startNewLine(),C=V[0],r.start_new_line=!1)),V=z(w,C),V[0]>0&&(C+=V[0]),V=I(w,C),V[0]>0){x.chord||(x.chord=[]);var ae=a.translateString(V[1]);ae=ae.replace(/;/g,`
|
|
87
87
|
`);for(var oe=!1,le=0;le<x.chord.length;le++)x.chord[le].position===V[2]&&(oe=!0,x.chord[le].name+=`
|
|
88
|
-
`+ae);oe===!1&&(V[2]===null&&V[3]?x.chord.push({name:ae,rel_position:V[3]}):x.chord.push({name:ae,position:V[2]})),C+=V[0];var J=a.skipWhiteSpace(w.substring(C));J>0&&(x.force_end_beam_last=!0),C+=J}else if(o.indexOf(w[C])===-1?V=M(w,C):V=[0],V[0]>0)V[1]===null?C+1<w.length&&this.startNewLine():V[1].length>0&&(V[1].indexOf("style=")===0?x.style=V[1].substr(6):(x.decoration===void 0&&(x.decoration=[]),V[1]==="beambr1"?x.beambr=1:V[1]==="beambr2"?x.beambr=2:x.decoration.push(V[1]))),C+=V[0];else if(V=b(w,C),V[0]>0)x.gracenotes=V[1],C+=V[0];else break;if(V=L(w,C),V[0]>0){F=0,x.gracenotes!==void 0&&(x.rest={type:"spacer"},x.duration=.125,r.addFormattingOptions(x,i.formatting,"note"),c.appendElement("note",S+C,S+C+V[0],x),r.measureNotEmpty=!0,x={});var ce={type:V[1]};ce.type.length===0?n("Unknown bar type",w,C):(r.inEnding&&ce.type!=="bar_thin"&&(ce.endEnding=!0,r.inEnding=!1),V[2]&&(ce.startEnding=V[2],r.inEnding&&(ce.endEnding=!0),r.inEnding=!0,V[1]==="bar_right_repeat"?r.restoreStartEndingHoldOvers():r.duplicateStartEndingHoldOvers()),x.decoration!==void 0&&(ce.decoration=x.decoration),x.chord!==void 0&&(ce.chord=x.chord),ce.startEnding&&r.barFirstEndingNum===void 0?r.barFirstEndingNum=r.currBarNumber:ce.startEnding&&ce.endEnding&&r.barFirstEndingNum?r.currBarNumber=r.barFirstEndingNum:ce.endEnding&&(r.barFirstEndingNum=void 0),ce.type!=="bar_invisible"&&r.measureNotEmpty&&O()&&(r.currBarNumber++,r.barNumbers&&r.currBarNumber%r.barNumbers===0&&(ce.barNumber=r.currBarNumber)),r.addFormattingOptions(x,i.formatting,"bar"),c.appendElement("bar",S+K,S+C+V[0],ce),r.measureNotEmpty=!1,x={}),C+=V[0]}else if(w[C]==="&")V=A(w,C),V[0]>0&&(c.appendElement("overlay",S,S+1,{}),C+=1,F++);else{if(V=E(w,C),V.consumed>0&&(V.startSlur!==void 0&&(x.startSlur=V.startSlur),V.dottedSlur&&(x.dottedSlur=!0),V.triplet!==void 0&&(D>0?n("Can't nest triplets",w,C):(x.startTriplet=V.triplet,x.tripletMultiplier=V.tripletQ/V.triplet,x.tripletR=V.num_notes,D=V.num_notes===void 0?V.triplet:V.num_notes)),C+=V.consumed),w[C]==="["){C++;for(var ee=null,he=!1,de=!1;!de;){var Se=M(w,C);Se[0]>0&&(C+=Se[0]);var we=P(w,C,{},!1);if(we!==null&&we.pitch!==void 0)Se[0]>0&&Se[1].indexOf("style=")!==0&&(x.decoration===void 0&&(x.decoration=[]),x.decoration.push(Se[1])),we.end_beam&&(x.end_beam=!0,delete we.end_beam),x.pitches===void 0?(x.duration=we.duration,x.pitches=[we]):x.pitches.push(we),delete we.duration,Se[0]>0&&Se[1].indexOf("style=")===0&&(x.pitches[x.pitches.length-1].style=Se[1].substr(6)),r.inTieChord[x.pitches.length]&&(we.endTie=!0,r.inTieChord[x.pitches.length]=void 0),we.startTie&&(r.inTieChord[x.pitches.length]=!0),C=we.endChar,delete we.endChar;else if(w[C]===" ")n("Spaces are not allowed in chords",w,C),C++;else{if(C<w.length&&w[C]==="]"){C++,r.next_note_duration!==0&&(x.duration=x.duration*r.next_note_duration,r.next_note_duration=0),k(r,F,x)&&(x.pitches.forEach(function(Q){Q.endTie=!0}),R(r,F,!1)),D>0&&!(x.rest&&x.rest.type==="spacer")&&(D--,D===0&&(x.endTriplet=!0));for(var Re=!1;C<w.length&&!Re;){switch(w[C]){case" ":case" ":T(x);break;case")":x.endSlur===void 0?x.endSlur=1:x.endSlur++;break;case"-":x.pitches.forEach(function(Q){Q.startTie={}}),R(r,F,!0);break;case">":case"<":var ze=B(w,C);C+=ze[0]-1,r.next_note_duration=ze[2],ee?ee=ee*ze[1]:ee=ze[1];break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"/":var Oe=a.getFraction(w,C);ee=Oe.value,C=Oe.index;var Z=w[C];Z===" "&&(he=!0),Z==="-"||Z===")"||Z===" "||Z==="<"||Z===">"?C--:Re=!0;break;case"0":ee=0;break;default:Re=!0;break}Re||C++}}else n("Expected ']' to end the chords",w,C);x.pitches!==void 0&&(ee!==null&&(x.duration=x.duration*ee,he&&T(x)),r.addFormattingOptions(x,i.formatting,"note"),c.appendElement("note",S+K,S+C,x),r.measureNotEmpty=!0,x={}),de=!0}}}else{var W={},H=P(w,C,W,!0);if(W.endTie!==void 0&&R(r,F,!0),H!==null){H.pitch!==void 0?(x.pitches=[{}],H.accidental!==void 0&&(x.pitches[0].accidental=H.accidental),x.pitches[0].pitch=H.pitch,x.pitches[0].name=H.name,(H.midipitch||H.midipitch===0)&&(x.pitches[0].midipitch=H.midipitch),H.endSlur!==void 0&&(x.pitches[0].endSlur=H.endSlur),H.endTie!==void 0&&(x.pitches[0].endTie=H.endTie),H.startSlur!==void 0&&(x.pitches[0].startSlur=H.startSlur),x.startSlur!==void 0&&(x.pitches[0].startSlur=x.startSlur),x.dottedSlur!==void 0&&(x.pitches[0].dottedSlur=!0),H.startTie!==void 0&&(x.pitches[0].startTie=H.startTie),x.startTie!==void 0&&(x.pitches[0].startTie=x.startTie)):(x.rest=H.rest,H.rest.type==="multimeasure"&&O()&&(r.currBarNumber+=H.rest.text-1),H.endSlur!==void 0&&(x.endSlur=H.endSlur),H.endTie!==void 0&&(x.rest.endTie=H.endTie),H.startSlur!==void 0&&(x.startSlur=H.startSlur),H.startTie!==void 0&&(x.rest.startTie=H.startTie),x.startTie!==void 0&&(x.rest.startTie=x.startTie)),H.chord!==void 0&&(x.chord=H.chord),H.duration!==void 0&&(x.duration=H.duration),H.decoration!==void 0&&(x.decoration=H.decoration),H.graceNotes!==void 0&&(x.graceNotes=H.graceNotes),delete x.startSlur,delete x.dottedSlur,k(r,F,x)&&(x.pitches!==void 0?x.pitches[0].endTie=!0:x.rest.type!=="spacer"&&(x.rest.endTie=!0),R(r,F,!1)),(H.startTie||x.startTie)&&R(r,F,!0),C=H.endChar,D>0&&!(H.rest&&H.rest.type==="spacer")&&(D--,D===0&&(x.endTriplet=!0)),H.end_beam&&T(x),x.rest&&x.rest.type==="rest"&&x.duration===1&&N(r)<=1&&(x.rest.type="whole",x.duration=N(r)),x.duration<1&&h.indexOf(x.duration)===-1&&x.duration!==0&&(!x.rest||x.rest.type!=="spacer")&&n("Duration not representable: "+w.substring(K,C),w,C),r.addFormattingOptions(x,i.formatting,"note");var j=c.appendElement("note",S+K,S+C,x);j||(this.startNewLine(),c.appendElement("note",S+K,S+C,x)),r.measureNotEmpty=!0,x={}}}C===K&&(w[C]!==" "&&w[C]!=="`"&&n("Unknown character ignored",w,C),C++)}}}this.lineContinuation=w.indexOf("")>=0||$[0]>0,this.lineContinuation||(x={})}};var R=function(w,C,S){var q=w.currentVoice?w.currentVoice.staffNum*100+w.currentVoice.index:0;w.inTie[C]===void 0&&(w.inTie[C]=[]),w.inTie[C][q]=S},I=function(w,C){if(w[C]==='"'){var S=a.getBrackettedSubstring(w,C,5);if(S[2]||n("Missing the closing quote while parsing the chord symbol",w,C),S[0]>0&&S[1].length>0&&S[1][0]==="^")S[1]=S[1].substring(1),S[2]="above";else if(S[0]>0&&S[1].length>0&&S[1][0]==="_")S[1]=S[1].substring(1),S[2]="below";else if(S[0]>0&&S[1].length>0&&S[1][0]==="<")S[1]=S[1].substring(1),S[2]="left";else if(S[0]>0&&S[1].length>0&&S[1][0]===">")S[1]=S[1].substring(1),S[2]="right";else if(S[0]>0&&S[1].length>0&&S[1][0]==="@"){S[1]=S[1].substring(1);var q=a.getFloat(S[1]);if(q.digits===0)return n("Missing first position in absolutely positioned annotation.",w,C),S[1]=S[1].replace("@",""),S[2]="above",S;if(S[1]=S[1].substring(q.digits),S[1][0]!==",")return n("Missing comma absolutely positioned annotation.",w,C),S[1]=S[1].replace("@",""),S[2]="above",S;S[1]=S[1].substring(1);var D=a.getFloat(S[1]);if(D.digits===0)return n("Missing second position in absolutely positioned annotation.",w,C),S[1]=S[1].replace("@",""),S[2]="above",S;S[1]=S[1].substring(D.digits);var $=a.skipWhiteSpace(S[1]);S[1]=S[1].substring($),S[2]=null,S[3]={x:q.value,y:D.value}}else r.freegchord!==!0&&(S[1]=S[1].replace(/([ABCDEFG0-9])b/g,"$1♭"),S[1]=S[1].replace(/([ABCDEFG0-9])#/g,"$1♯"),S[1]=S[1].replace(/^([ABCDEFG])([♯♭]?)o([^A-Za-z])/g,"$1$2°$3"),S[1]=S[1].replace(/^([ABCDEFG])([♯♭]?)o$/g,"$1$2°"),S[1]=S[1].replace(/^([ABCDEFG])([♯♭]?)0([^A-Za-z])/g,"$1$2ø$3"),S[1]=S[1].replace(/^([ABCDEFG])([♯♭]?)\^([^A-Za-z])/g,"$1$2∆$3")),S[2]="default",S[1]=t.chordName(r,S[1]);return S}return[0,""]},b=function(w,C){if(w[C]==="{"){var S=a.getBrackettedSubstring(w,C,1,"}");S[2]||n("Missing the closing '}' while parsing grace note",w,C),w[C+S[0]]===")"&&(S[0]++,S[1]+=")");for(var q=[],D=0,$=!1;D<S[1].length;){var F=!1;S[1][D]==="/"&&(F=!0,D++);var K=P(S[1],D,{},!1);K!==null?(K.duration=K.duration/(r.default_length*8),F&&(K.acciaccatura=!0),K.rest?n("Rests not allowed as grace notes '"+S[1][D]+"' while parsing grace note",w,C):q.push(K),$&&(K.endTie=!0,$=!1),K.startTie&&($=!0),D=K.endChar,delete K.endChar,K.end_beam&&(K.endBeam=!0,delete K.end_beam)):(S[1][D]===" "?q.length>0&&(q[q.length-1].endBeam=!0):n("Unknown character '"+S[1][D]+"' while parsing grace note",w,C),D++)}if(q.length)return[S[0],q]}return[0]};function A(w,C){if(w[C]==="&"){for(var S=C;w[C]&&w[C]!==":"&&w[C]!=="|";)C++;return[C-S,w.substring(S+1,C)]}return[0]}function N(w){var C=w.origMeter;return!C||C.type!=="specified"||!C.value||C.value.length===0?1:parseInt(C.value[0].num,10)/parseInt(C.value[0].den,10)}var M=function(w,C){var S=r.macros[w[C]];if(S!==void 0)return(S[0]==="!"||S[0]==="+")&&(S=S.substring(1)),(S[S.length-1]==="!"||S[S.length-1]==="+")&&(S=S.substring(0,S.length-1)),f.includes(S)?[1,S]:g.includes(S)?(r.volumePosition==="hidden"&&(S=""),[1,S]):d.includes(S)?(r.dynamicPosition==="hidden"&&(S=""),[1,S]):(r.ignoredDecorations.includes(S)||n("Unknown macro: "+S,w,C),[1,""]);switch(w[C]){case".":if(w[C+1]==="("||w[C+1]==="-")break;return[1,"staccato"];case"u":return[1,"upbow"];case"v":return[1,"downbow"];case"~":return[1,"irishroll"];case"!":case"+":var q=a.getBrackettedSubstring(w,C,5);if(q[1].length>1&&(q[1][0]==="^"||q[1][0]==="_")&&(q[1]=q[1].substring(1)),f.includes(q[1]))return q;if(g.includes(q[1]))return r.volumePosition==="hidden"&&(q[1]=""),q;if(d.includes(q[1]))return r.dynamicPosition==="hidden"&&(q[1]=""),q;var D=p.findIndex(function($){return q[1]===$[0]});return D>=0?(q[1]=p[D][1],q):(D=l.findIndex(function($){return q[1]===$[0]}),D>=0?(q[1]=l[D][1],r.dynamicPosition==="hidden"&&(q[1]=""),q):w[C]==="!"&&(q[0]===1||w[C+q[0]-1]!=="!")?[1,null]:(n("Unknown decoration: "+q[1],w,C),q[1]="",q));case"H":return[1,"fermata"];case"J":return[1,"slide"];case"L":return[1,"accent"];case"M":return[1,"mordent"];case"O":return[1,"coda"];case"P":return[1,"pralltriller"];case"R":return[1,"roll"];case"S":return[1,"segno"];case"T":return[1,"trill"];case"t":return[1,"trillh"]}return[0,0]},z=function(w,C){for(var S=C;a.isWhiteSpace(w[C]);)C++;return[C-S]},L=function(w,C){var S=a.getBarLine(w,C);if(S.len===0)return[0,""];if(S.warn)return n(S.warn,w,C),[S.len,""];for(var q=0;q<w.length&&w[C+S.len+q]===" ";q++);var D=S.len;if(w[C+S.len+q]==="["&&(S.len+=q+1),w[C+S.len]==='"'&&w[C+S.len-1]==="["){var $=a.getBrackettedSubstring(w,C+S.len,5);return[S.len+$[0],S.token,$[1]]}var F=a.getTokenOf(w.substring(C+S.len),"1234567890-,");return F.len===0||F.token[0]==="-"?[D,S.token]:[S.len+F.len,S.token,F.token]},E=function(w,C){var S={},q=C;for(w[C]==="."&&w[C+1]==="("&&(S.dottedSlur=!0,C++);w[C]==="("||a.isWhiteSpace(w[C]);)w[C]==="("&&(C+1<w.length&&w[C+1]>="2"&&w[C+1]<="9"?(S.triplet!==void 0?n("Can't nest triplets",w,C):(S.triplet=w[C+1]-"0",S.tripletQ=m[S.triplet],S.num_notes=S.triplet,C+2<w.length&&w[C+2]===":"&&(C+3<w.length&&w[C+3]===":"?C+4<w.length&&w[C+4]>="1"&&w[C+4]<="9"?(S.num_notes=w[C+4]-"0",C+=3):n("expected number after the two colons after the triplet to mark the duration",w,C):C+3<w.length&&w[C+3]>="1"&&w[C+3]<="9"?(S.tripletQ=w[C+3]-"0",C+4<w.length&&w[C+4]===":"?C+5<w.length&&w[C+5]>="1"&&w[C+5]<="9"&&(S.num_notes=w[C+5]-"0",C+=4):C+=2):n("expected number after the triplet to mark the duration",w,C))),C++):S.startSlur===void 0?S.startSlur=1:S.startSlur++),C++;return S.consumed=C-q,S};_.prototype.startNewLine=function(){var w={startChar:-1,endChar:-1};r.partForNextLine.title&&(w.part=r.partForNextLine),w.clef=r.currentVoice&&r.staves[r.currentVoice.staffNum].clef!==void 0?Object.assign({},r.staves[r.currentVoice.staffNum].clef):Object.assign({},r.clef);var C=r.currentVoice?r.currentVoice.scoreTranspose:0;if(w.key=e.standardKey(r.key.root+r.key.acc+r.key.mode,r.key.root,r.key.acc,C),w.key.mode=r.key.mode,r.key.impliedNaturals&&(w.key.impliedNaturals=r.key.impliedNaturals),r.key.explicitAccidentals)for(var S=0;S<r.key.explicitAccidentals.length;S++){for(var q=!1,D=0;D<w.key.accidentals.length;D++)w.key.accidentals[D].note===r.key.explicitAccidentals[S].note&&(w.key.accidentals[D].acc=r.key.explicitAccidentals[S].acc,q=!0);q||w.key.accidentals.push(r.key.explicitAccidentals[S])}if(r.targetKey=w.key,w.key.explicitAccidentals&&delete w.key.explicitAccidentals,e.addPosToKey(w.clef,w.key),r.meter!==null?(r.currentVoice?(r.staves.forEach(function(te){te.meter=r.meter}),w.meter=r.staves[r.currentVoice.staffNum].meter,r.staves[r.currentVoice.staffNum].meter=null):w.meter=r.meter,r.meter=null):r.currentVoice&&r.staves[r.currentVoice.staffNum].meter&&(w.meter=r.staves[r.currentVoice.staffNum].meter,r.staves[r.currentVoice.staffNum].meter=null),r.currentVoice&&r.currentVoice.name&&(w.name=r.currentVoice.name),r.vocalfont&&(w.vocalfont=r.vocalfont),r.tripletfont&&(w.tripletfont=r.tripletfont),r.gchordfont&&(w.gchordfont=r.gchordfont),r.style&&(w.style=r.style),r.currentVoice){var $=r.staves[r.currentVoice.staffNum];$.brace&&(w.brace=$.brace),$.bracket&&(w.bracket=$.bracket),$.connectBarLines&&(w.connectBarLines=$.connectBarLines),$.name&&(w.name=$.name[r.currentVoice.index]),$.subname&&(w.subname=$.subname[r.currentVoice.index]),r.currentVoice.stem&&(w.stem=r.currentVoice.stem),r.currentVoice.stafflines&&(w.stafflines=r.currentVoice.stafflines),r.currentVoice.staffscale&&(w.staffscale=r.currentVoice.staffscale),r.currentVoice.scale&&(w.scale=r.currentVoice.scale),r.currentVoice.color&&(w.color=r.currentVoice.color),r.currentVoice.style&&(w.style=r.currentVoice.style),r.currentVoice.transpose&&(w.clef.transpose=r.currentVoice.transpose),w.currentVoice=r.currentVoice;for(var F=Object.keys(r.voices),K=0;K<F.length;K++)w.currentVoice.staffNum===r.voices[F[K]].staffNum&&w.currentVoice.index===r.voices[F[K]].index&&(w.currentVoiceName=F[K])}r.barNumbers===0&&O()&&r.currBarNumber!==1&&(w.barNumber=r.currBarNumber),c.startNewLine(w),r.key.impliedNaturals&&delete r.key.impliedNaturals,r.partForNextLine={},r.tempoForNextLine.length===4&&c.appendElement(r.tempoForNextLine[0],r.tempoForNextLine[1],r.tempoForNextLine[2],r.tempoForNextLine[3]),r.tempoForNextLine=[]};var T=function(w){return w.duration!==void 0&&w.duration<.25&&(w.end_beam=!0),w},P=function(w,C,S,q){var D=function(le){return le==="octave"||le==="duration"||le==="Zduration"||le==="broken_rhythm"||le==="end_slur"},$;w[C]==="."&&w[C+1]==="-"&&($=!0,C++);for(var F="startSlur",K=!1;;){switch(w[C]){case"(":if(F==="startSlur")S.startSlur===void 0?S.startSlur=1:S.startSlur++;else return D(F)?(S.endChar=C,S):null;break;case")":if(D(F))S.endSlur===void 0?S.endSlur=1:S.endSlur++;else return null;break;case"^":if(F==="startSlur")S.accidental="sharp",F="sharp2";else if(F==="sharp2")S.accidental="dblsharp",F="pitch";else return D(F)?(S.endChar=C,S):null;break;case"_":if(F==="startSlur")S.accidental="flat",F="flat2";else if(F==="flat2")S.accidental="dblflat",F="pitch";else return D(F)?(S.endChar=C,S):null;break;case"=":if(F==="startSlur")S.accidental="natural",F="pitch";else return D(F)?(S.endChar=C,S):null;break;case"A":case"B":case"C":case"D":case"E":case"F":case"G":case"a":case"b":case"c":case"d":case"e":case"f":case"g":if(F==="startSlur"||F==="sharp2"||F==="flat2"||F==="pitch"){if(S.pitch=s[w[C]],S.pitch+=7*(r.currentVoice&&r.currentVoice.octave!==void 0?r.currentVoice.octave:r.octave),S.name=w[C],S.accidental&&(S.name=y[S.accidental]+S.name),t.note(r,S),F="octave",q&&r.next_note_duration!==0?(S.duration=r.default_length*r.next_note_duration,r.next_note_duration=0,K=!0):S.duration=r.default_length,r.clef&&r.clef.type==="perc"||r.currentVoice&&r.currentVoice.clef==="perc"){var te=w[C];S.accidental&&(te=y[S.accidental]+te),i.formatting&&i.formatting.midi&&i.formatting.midi.drummap&&(S.midipitch=i.formatting.midi.drummap[te])}}else return D(F)?(S.endChar=C,S):null;break;case",":if(F==="octave")S.pitch-=7,S.name+=",";else return D(F)?(S.endChar=C,S):null;break;case"'":if(F==="octave")S.pitch+=7,S.name+="'";else return D(F)?(S.endChar=C,S):null;break;case"x":case"X":case"y":case"z":case"Z":if(F==="startSlur")S.rest={type:v[w[C]]},delete S.accidental,delete S.startSlur,delete S.startTie,delete S.endSlur,delete S.endTie,delete S.end_beam,delete S.grace_notes,S.rest.type.indexOf("multimeasure")>=0?(S.duration=i.getBarLength(),S.rest.text=1,F="Zduration"):(q&&r.next_note_duration!==0?(S.duration=r.default_length*r.next_note_duration,r.next_note_duration=0,K=!0):S.duration=r.default_length,F="duration");else return D(F)?(S.endChar=C,S):null;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"0":case"/":if(F==="octave"||F==="duration"){var V=a.getFraction(w,C);for(S.duration=S.duration*V.value,S.endChar=V.index;V.index<w.length&&(a.isWhiteSpace(w[V.index])||w[V.index]==="-");)w[V.index]==="-"?S.startTie={}:S=T(S),V.index++;C=V.index-1,F="broken_rhythm"}else if(F==="sharp2")S.accidental="quartersharp",F="pitch";else if(F==="flat2")S.accidental="quarterflat",F="pitch";else if(F==="Zduration"){var ae=a.getNumber(w,C);return S.duration=ae.num*i.getBarLength(),S.rest.text=ae.num,S.endChar=ae.index,S}else return null;break;case"-":if(F==="startSlur")c.addTieToLastNote($),S.endTie=!0;else if(F==="octave"||F==="duration"||F==="end_slur")if(S.startTie={},!K&&q)F="broken_rhythm";else return a.isWhiteSpace(w[C+1])&&T(S),S.endChar=C+1,S;else return F==="broken_rhythm"?(S.endChar=C,S):null;break;case" ":case" ":if(D(F)){S.end_beam=!0,$=!1;do w[C]==="."&&w[C+1]==="-"&&($=!0,C++),w[C]==="-"&&(S.startTie={},$&&(S.startTie.style="dotted")),C++;while(C<w.length&&(a.isWhiteSpace(w[C])||w[C]==="-")||w[C]==="."&&w[C+1]==="-");if(S.endChar=C,!K&&q&&(w[C]==="<"||w[C]===">"))C--,F="broken_rhythm";else return S}else return null;break;case">":case"<":if(D(F))if(q){var oe=B(w,C);C+=oe[0]-1,r.next_note_duration=oe[2],S.duration=oe[1]*S.duration,F="end_slur"}else return S.endChar=C,S;else return null;break;default:return D(F)?(S.endChar=C,S):null}if(C++,C===w.length)return D(F)?(S.endChar=C,S):null}return null},B=function(w,C){switch(w[C]){case">":return C<w.length-2&&w[C+1]===">"&&w[C+2]===">"?[3,1.875,.125]:C<w.length-1&&w[C+1]===">"?[2,1.75,.25]:[1,1.5,.5];case"<":return C<w.length-2&&w[C+1]==="<"&&w[C+2]==="<"?[3,.125,1.875]:C<w.length-1&&w[C+1]==="<"?[2,.25,1.75]:[1,.5,1.5]}return null};function O(){return r.currentVoice===void 0||r.currentVoice.staffNum===0&&r.currentVoice.index===0}return Mr=_,Mr}var Nr,Di;function lg(){if(Di)return Nr;Di=1;var e=nt(),t=function(a,n){this.lineIndex=0,this.lines=a,this.multilineVars=n,this.skipWhiteSpace=function(o){for(var h=0;h<o.length;h++)if(!this.isWhiteSpace(o[h]))return h;return o.length};var r=function(o,h){return h>=o.length};this.eatWhiteSpace=function(o,h){for(var s=h;s<o.length;s++)if(!this.isWhiteSpace(o[s]))return s-h;return s-h},this.getKeyPitch=function(o){var h=this.skipWhiteSpace(o);if(r(o,h))return{len:0};switch(o[h]){case"A":return{len:h+1,token:"A"};case"B":return{len:h+1,token:"B"};case"C":return{len:h+1,token:"C"};case"D":return{len:h+1,token:"D"};case"E":return{len:h+1,token:"E"};case"F":return{len:h+1,token:"F"};case"G":return{len:h+1,token:"G"}}return{len:0}},this.getSharpFlat=function(o){if(o==="bass")return{len:0};switch(o[0]){case"#":return{len:1,token:"#"};case"b":return{len:1,token:"b"}}return{len:0}},this.getMode=function(o){var h=function(y,m){for(;m<y.length&&(y[m]>="a"&&y[m]<="z"||y[m]>="A"&&y[m]<="Z");)m++;return m},s=this.skipWhiteSpace(o);if(r(o,s))return{len:0};var v=o.substring(s,s+3).toLowerCase();switch((v.length>1&&v[1]===" "||v[1]==="^"||v[1]==="_"||v[1]==="=")&&(v=v[0]),v){case"mix":return{len:h(o,s),token:"Mix"};case"dor":return{len:h(o,s),token:"Dor"};case"phr":return{len:h(o,s),token:"Phr"};case"lyd":return{len:h(o,s),token:"Lyd"};case"loc":return{len:h(o,s),token:"Loc"};case"aeo":return{len:h(o,s),token:"m"};case"maj":return{len:h(o,s),token:""};case"ion":return{len:h(o,s),token:""};case"min":return{len:h(o,s),token:"m"};case"m":return{len:h(o,s),token:"m"}}return{len:0}},this.getClef=function(o,h){var s=o,v=this.skipWhiteSpace(o);if(r(o,v))return{len:0};var y=!1,m=o.substring(v);if(e.startsWith(m,"clef=")&&(y=!0,m=m.substring(5),v+=5),m.length===0&&y)return{len:v+5,warn:"No clef specified: "+s};var _=this.skipWhiteSpace(m);if(r(m,_))return{len:0};_>0&&(v+=_,m=m.substring(_));var k=null;if(e.startsWith(m,"treble"))k="treble";else if(e.startsWith(m,"bass3"))k="bass3";else if(e.startsWith(m,"bass"))k="bass";else if(e.startsWith(m,"tenor"))k="tenor";else if(e.startsWith(m,"alto2"))k="alto2";else if(e.startsWith(m,"alto1"))k="alto1";else if(e.startsWith(m,"alto"))k="alto";else if(!h&&y&&e.startsWith(m,"none"))k="none";else if(e.startsWith(m,"perc"))k="perc";else if(!h&&y&&e.startsWith(m,"C"))k="tenor";else if(!h&&y&&e.startsWith(m,"F"))k="bass";else if(!h&&y&&e.startsWith(m,"G"))k="treble";else return{len:v+5,warn:"Unknown clef specified: "+s};return m=m.substring(k.length),_=this.isMatch(m,"+8"),_>0?k+="+8":(_=this.isMatch(m,"-8"),_>0&&(k+="-8")),{len:v+k.length,token:k,explicit:y}},this.getBarLine=function(o,h){switch(o[h]){case"]":switch(++h,o[h]){case"|":return{len:2,token:"bar_thick_thin"};case"[":return++h,o[h]>="1"&&o[h]<="9"||o[h]==='"'?{len:2,token:"bar_invisible"}:{len:1,warn:"Unknown bar symbol"};default:return{len:1,token:"bar_invisible"}}case":":switch(++h,o[h]){case":":return{len:2,token:"bar_dbl_repeat"};case"|":switch(++h,o[h]){case"]":switch(++h,o[h]){case"|":return++h,o[h]===":"?{len:5,token:"bar_dbl_repeat"}:{len:3,token:"bar_right_repeat"};default:return{len:3,token:"bar_right_repeat"}}case"|":return++h,o[h]===":"?{len:4,token:"bar_dbl_repeat"}:{len:3,token:"bar_right_repeat"};default:return{len:2,token:"bar_right_repeat"}}default:return{len:1,warn:"Unknown bar symbol"}}case"[":if(++h,o[h]==="|")switch(++h,o[h]){case":":return{len:3,token:"bar_left_repeat"};case"]":return{len:3,token:"bar_invisible"};default:return{len:2,token:"bar_thick_thin"}}else return o[h]>="1"&&o[h]<="9"||o[h]==='"'?{len:1,token:"bar_invisible"}:{len:0};case"|":switch(++h,o[h]){case"]":return{len:2,token:"bar_thin_thick"};case"|":return++h,o[h]===":"?{len:3,token:"bar_left_repeat"}:{len:2,token:"bar_thin_thin"};case":":for(var s=0;o[h+s]===":";)s++;return{len:1+s,token:"bar_left_repeat"};default:return{len:1,token:"bar_thin"}}}return{len:0}},this.getTokenOf=function(o,h){for(var s=0;s<o.length;s++)if(h.indexOf(o[s])<0)return{len:s,token:o.substring(0,s)};return{len:s,token:o}},this.getToken=function(o,h,s){for(var v=h;v<s&&!this.isWhiteSpace(o[v]);)v++;return o.substring(h,v)},this.isMatch=function(o,h){var s=this.skipWhiteSpace(o);return r(o,s)?0:e.startsWith(o.substring(s),h)?s+h.length:0},this.getPitchFromTokens=function(o){var h={},s={A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11};if(h.position=s[o[0].token],h.position===void 0)return{warn:"Pitch expected. Found: "+o[0].token};for(o.shift();o.length;)switch(o[0].token){case",":h.position-=7,o.shift();break;case"'":h.position+=7,o.shift();break;default:return h}return h},this.getKeyAccidentals2=function(o){for(var h;o.length>0;){var s;if(o[0].token==="^"){if(s="sharp",o.shift(),o.length===0)return{accs:h,warn:"Expected note name after "+s};switch(o[0].token){case"^":s="dblsharp",o.shift();break;case"/":s="quartersharp",o.shift();break}}else if(o[0].token==="=")s="natural",o.shift();else if(o[0].token==="_"){if(s="flat",o.shift(),o.length===0)return{accs:h,warn:"Expected note name after "+s};switch(o[0].token){case"_":s="dblflat",o.shift();break;case"/":s="quarterflat",o.shift();break}}else return{accs:h};if(o.length===0)return{accs:h,warn:"Expected note name after "+s};switch(o[0].token[0]){case"a":case"b":case"c":case"d":case"e":case"f":case"g":case"A":case"B":case"C":case"D":case"E":case"F":case"G":h===void 0&&(h=[]),h.push({acc:s,note:o[0].token[0]}),o[0].token.length===1?o.shift():o[0].token=o[0].token.substring(1);break;default:return{accs:h,warn:"Expected note name after "+s+" Found: "+o[0].token}}}return{accs:h}},this.getKeyAccidental=function(o){var h={"^":"sharp","^^":"dblsharp","=":"natural",_:"flat",__:"dblflat","_/":"quarterflat","^/":"quartersharp"},s=this.skipWhiteSpace(o);if(r(o,s))return{len:0};var v=null;switch(o[s]){case"^":case"_":case"=":v=o[s];break;default:return{len:0}}if(s++,r(o,s))return{len:1,warn:"Expected note name after accidental"};switch(o[s]){case"a":case"b":case"c":case"d":case"e":case"f":case"g":case"A":case"B":case"C":case"D":case"E":case"F":case"G":return{len:s+1,token:{acc:h[v],note:o[s]}};case"^":case"_":case"/":if(v+=o[s],s++,r(o,s))return{len:2,warn:"Expected note name after accidental"};switch(o[s]){case"a":case"b":case"c":case"d":case"e":case"f":case"g":case"A":case"B":case"C":case"D":case"E":case"F":case"G":return{len:s+1,token:{acc:h[v],note:o[s]}};default:return{len:2,warn:"Expected note name after accidental"}}break;default:return{len:1,warn:"Expected note name after accidental"}}},this.isWhiteSpace=function(o){return o===" "||o===" "||o===""},this.getMeat=function(o,h,s){var v=o.indexOf("%",h);for(v>=0&&v<s&&(s=v);h<s&&(o[h]===" "||o[h]===" "||o[h]==="");)h++;for(;h<s&&(o[s-1]===" "||o[s-1]===" "||o[s-1]==="");)s--;return{start:h,end:s}};var i=function(o){return o>="A"&&o<="Z"||o>="a"&&o<="z"},c=function(o){return o>="0"&&o<="9"};this.tokenize=function(o,h,s,v){var y=this.getMeat(o,h,s);h=y.start,s=y.end;for(var m=[],_;h<s;){if(o[h]==='"'){for(_=h+1;_<s&&o[_]!=='"';)_++;m.push({type:"quote",token:o.substring(h+1,_),start:h+1,end:_}),_++}else if(i(o[h])){if(_=h+1,v)for(;_<s&&!this.isWhiteSpace(o[_]);)_++;else for(;_<s&&i(o[_]);)_++;m.push({type:"alpha",token:o.substring(h,_),continueId:c(o[_]),start:h,end:_}),h=_+1}else if(o[h]==="."&&c(o[_+1])){_=h+1;for(var k=null,x=null;_<s&&c(o[_]);)_++;x=parseFloat(o.substring(h,_)),m.push({type:"number",token:o.substring(h,_),intt:k,floatt:x,continueId:i(o[_]),start:h,end:_}),h=_+1}else if(c(o[h])||o[h]==="-"&&c(o[_+1])){_=h+1;for(var R=null,I=null;_<s&&c(o[_]);)_++;if(o[_]==="."&&c(o[_+1]))for(_++;_<s&&c(o[_]);)_++;else R=parseInt(o.substring(h,_));I=parseFloat(o.substring(h,_)),m.push({type:"number",token:o.substring(h,_),intt:R,floatt:I,continueId:i(o[_]),start:h,end:_}),h=_+1}else o[h]===" "||o[h]===" "||m.push({type:"punct",token:o[h],start:h,end:h+1}),_=h+1;h=_}return m},this.getVoiceToken=function(o,h,s){for(var v=h;v<s&&this.isWhiteSpace(o[v])||o[v]==="=";)v++;if(o[v]==='"'){var y=o.indexOf('"',v+1);return y===-1||y>=s?{len:1,err:"Missing close quote"}:{len:y-h+1,token:this.translateString(o.substring(v+1,y))}}else{for(var m=v;m<s&&!this.isWhiteSpace(o[m])&&o[m]!=="=";)m++;return{len:m-h+1,token:o.substring(v,m)}}};var u={"`a":"à","'a":"á","^a":"â","~a":"ã",'"a':"ä",oa:"å",aa:"å","=a":"ā",ua:"ă",";a":"ą","`e":"è","'e":"é","^e":"ê",'"e':"ë","=e":"ē",ue:"ĕ",";e":"ę",".e":"ė","`i":"ì","'i":"í","^i":"î",'"i':"ï","=i":"ī",ui:"ĭ",";i":"į","`o":"ò","'o":"ó","^o":"ô","~o":"õ",'"o':"ö","=o":"ō",uo:"ŏ","/o":"ø","`u":"ù","'u":"ú","^u":"û","~u":"ũ",'"u':"ü",ou:"ů","=u":"ū",uu:"ŭ",";u":"ų","`A":"À","'A":"Á","^A":"Â","~A":"Ã",'"A':"Ä",oA:"Å",AA:"Å","=A":"Ā",uA:"Ă",";A":"Ą","`E":"È","'E":"É","^E":"Ê",'"E':"Ë","=E":"Ē",uE:"Ĕ",";E":"Ę",".E":"Ė","`I":"Ì","'I":"Í","^I":"Î","~I":"Ĩ",'"I':"Ï","=I":"Ī",uI:"Ĭ",";I":"Į",".I":"İ","`O":"Ò","'O":"Ó","^O":"Ô","~O":"Õ",'"O':"Ö","=O":"Ō",uO:"Ŏ","/O":"Ø","`U":"Ù","'U":"Ú","^U":"Û","~U":"Ũ",'"U':"Ü",oU:"Ů","=U":"Ū",uU:"Ŭ",";U":"Ų",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",ss:"ß","'c":"ć","^c":"ĉ",uc:"č",cc:"ç",".c":"ċ",cC:"Ç","'C":"Ć","^C":"Ĉ",uC:"Č",".C":"Ċ","~N":"Ñ","~n":"ñ","=s":"š",vs:"š",DH:"Ð",dh:"ð",HO:"Ő",Ho:"ő",HU:"Ű",Hu:"ű","'Y":"Ý","'y":"ý","^Y":"Ŷ","^y":"ŷ",'"Y':"Ÿ",'"y':"ÿ",vS:"Š",vZ:"Ž",vz:"ž"},f={"#":"♯",b:"♭","=":"♮"},g={201:"♯",202:"♭",203:"♮",241:"¡",242:"¢",252:"a",262:"2",272:"o",302:"Â",312:"Ê",322:"Ò",332:"Ú",342:"â",352:"ê",362:"ò",372:"ú",243:"£",253:"«",263:"3",273:"»",303:"Ã",313:"Ë",323:"Ó",333:"Û",343:"ã",353:"ë",363:"ó",373:"û",244:"¤",254:"¬",264:" ́",274:"1⁄4",304:"Ä",314:"Ì",324:"Ô",334:"Ü",344:"ä",354:"ì",364:"ô",374:"ü",245:"¥",255:"-",265:"μ",275:"1⁄2",305:"Å",315:"Í",325:"Õ",335:"Ý",345:"å",355:"í",365:"õ",375:"ý",246:"¦",256:"®",266:"¶",276:"3⁄4",306:"Æ",316:"Î",326:"Ö",336:"Þ",346:"æ",356:"î",366:"ö",376:"þ",247:"§",257:" ̄",267:"·",277:"¿",307:"Ç",317:"Ï",327:"×",337:"ß",347:"ç",357:"ï",367:"÷",377:"ÿ",250:" ̈",260:"°",270:" ̧",300:"À",310:"È",320:"Ð",330:"Ø",340:"à",350:"è",360:"ð",370:"ø",251:"©",261:"±",271:"1",301:"Á",311:"É",321:"Ñ",331:"Ù",341:"á",351:"é",361:"ñ",371:"ù"};this.translateString=function(o){var h=o.split("\\");if(h.length===1)return o;var s=null;return h.forEach(function(v){if(s===null)s=v;else{var y=u[v.substring(0,2)];y!==void 0?s+=y+v.substring(2):(y=g[v.substring(0,3)],y!==void 0?s+=y+v.substring(3):(y=f[v.substring(0,1)],y!==void 0?s+=y+v.substring(1):s+="\\"+v))}}),s},this.getNumber=function(o,h){for(var s=0;h<o.length;)switch(o[h]){case"0":s=s*10,h++;break;case"1":s=s*10+1,h++;break;case"2":s=s*10+2,h++;break;case"3":s=s*10+3,h++;break;case"4":s=s*10+4,h++;break;case"5":s=s*10+5,h++;break;case"6":s=s*10+6,h++;break;case"7":s=s*10+7,h++;break;case"8":s=s*10+8,h++;break;case"9":s=s*10+9,h++;break;default:return{num:s,index:h}}return{num:s,index:h}},this.getFraction=function(o,h){var s=1,v=1;if(o[h]!=="/"){var y=this.getNumber(o,h);s=y.num,h=y.index}if(o[h]==="/")if(h++,o[h]==="/"){for(var m=.5;o[h++]==="/";)m=m/2;return{value:s*m,index:h-1}}else{var _=h,k=this.getNumber(o,h);k.num===0&&_===h&&(k.num=2),k.num!==0&&(v=k.num),h=k.index}return{value:s/v,index:h}};function d(o){const s=/^(\d+)\./.exec(o);return s?s[1]:null}var p=[{match:/,\s*The$/,replace:"The "},{match:/,\s*the$/,replace:"the "},{match:/,\s*A$/,replace:"A "},{match:/,\s*a$/,replace:"a "},{match:/,\s*An$/,replace:"An "},{match:/,\s*an$/,replace:"an "},{match:/,\s*Da$/,replace:"Da "},{match:/,\s*La$/,replace:"La "},{match:/,\s*Le$/,replace:"Le "},{match:/,\s*Les$/,replace:"Les "},{match:/,\s*Ye$/,replace:"Ye "}];this.theReverser=function(o){for(var h=0;h<p.length;h++){var s=p[h],v=o.match(s.match);if(v){var y=d(o);y&&(o=o.replace(y+".",""),o=o.trim());var m=v[0].length,_=s.replace+o.substring(0,o.length-m);return y&&(_=y+". "+_),_}}return o},this.stripComment=function(o){var h=o.indexOf("%");return h>=0?e.strip(o.substring(0,h)):e.strip(o)},this.getInt=function(o){var h=parseInt(o);if(isNaN(h))return{digits:0};var s=""+h,v=o.indexOf(s);return{value:h,digits:v+s.length}},this.getFloat=function(o){var h=parseFloat(o);if(isNaN(h))return{digits:0};var s=""+h,v=o.indexOf(s);return{value:h,digits:v+s.length}},this.getMeasurement=function(o){if(o.length===0)return{used:0};var h=1,s="";if(o[0].token==="-")o.shift(),s="-",h++;else if(o[0].type!=="number")return{used:0};if(s+=o.shift().token,o.length===0)return{used:1,value:parseInt(s)};var v=o.shift();if(v.token==="."){if(h++,o.length===0)return{used:h,value:parseInt(s)};if(o[0].type==="number"&&(v=o.shift(),s=s+"."+v.token,h++,o.length===0))return{used:h,value:parseFloat(s)};v=o.shift()}switch(v.token){case"pt":return{used:h+1,value:parseFloat(s)};case"px":return{used:h+1,value:parseFloat(s)};case"cm":return{used:h+1,value:parseFloat(s)/2.54*72};case"in":return{used:h+1,value:parseFloat(s)*72};default:return o.unshift(v),{used:h,value:parseFloat(s)}}};var l=function(o){return o=o.replace(/\\n/g,`
|
|
89
|
-
`),o=o.replace(/\\"/g,'"'),o};this.getBrackettedSubstring=function(o,h,s,v){for(var y=v||o[h],m=h+1,_=!1;m<o.length&&(_||o[m]!==y);)_=o[m]==="\\",++m;return o[m]===y?[m-h+1,l(o.substring(h+1,m)),!0]:(m=h+s,m>o.length-1&&(m=o.length-1),[m-h+1,l(o.substring(h+1,m)),!1])}};return t.prototype.peekLine=function(){return this.lines[this.lineIndex]},t.prototype.nextLine=function(){if(this.lineIndex>0&&(this.multilineVars.iChar+=this.lines[this.lineIndex-1].length+1),this.lineIndex<this.lines.length){var a=this.lines[this.lineIndex];return this.lineIndex++,a}return null},Nr=t,Nr}var Pr,Fi;function xl(){if(Fi)return Pr;Fi=1;function e(d,p,l){if(!(!p||d.lines.length===0)){var o=d.deline({lineBreaks:!1}),h=a(o,p);d.lines=t(o,h,l),d.lineBreaks=h}}function t(d,p,l){for(var o=[],h=[],s=[],v=1,y=0;y<p.length;y++){var m=p[y];if(d[m.ogLine].staff){var _=d[m.ogLine].staff[m.staff];if(o[m.line]||(o[m.line]={staff:[]}),!o[m.line].staff[m.staff]){o[m.line].staff[m.staff]={voices:[]},l!==void 0&&m.staff===0&&m.line>0&&(o[m.line].staff[m.staff].barNumber=v);for(var k=Object.keys(_),x=0;x<k.length;x++){var R=k[x]==="voices";k[x]==="meter"&&m.line!==0&&(R=!0),R||(o[m.line].staff[m.staff][k[x]]=_[k[x]])}h[m.staff]&&(o[m.line].staff[m.staff].key=h[m.staff])}o[m.line].staff[m.staff].voices[m.voice]||(o[m.line].staff[m.staff].voices[m.voice]=[]),o[m.line].staff[m.staff].voices[m.voice]=d[m.ogLine].staff[m.staff].voices[m.voice].slice(m.start,m.end+1),s[m.staff*10+m.voice]&&o[m.line].staff[m.staff].voices[m.voice].unshift({el_type:"stem",direction:s[m.staff*10+m.voice].direction});for(var I=o[m.line].staff[m.staff].voices[m.voice],b=I.length-1;b>=0;b--)if(I[b].el_type==="key"){h[m.staff]={root:I[b].root,acc:I[b].acc,mode:I[b].mode,accidentals:I[b].accidentals.filter(function(N){return N.acc!=="natural"})};break}for(b=I.length-1;b>=0;b--)if(I[b].el_type==="stem"){s[m.staff*10+m.voice]={direction:I[b].direction};break}if(l!==void 0&&m.staff===0&&m.voice===0)for(b=0;b<I.length;b++)I[b].el_type==="bar"&&(v++,b===I.length-1?delete I[b].barNumber:I[b].barNumber=v)}else o[m.line]=d[m.ogLine]}for(var A=0;A<o.length;A++)o[A].staff&&(o[A].staff=o[A].staff.filter(function(N){return N!=null}));return o}function a(d,p){for(var l=[],o=0,h=0,s=0,v=0;v<d.length;v++){var y=d[v];if(y.staff){var m=h,_=p[o];o++;for(var k=0;k<y.staff.length;k++)for(var x=y.staff[k],R=0;R<x.voices.length;R++){s=m;for(var I=0,b=0,A=x.voices[R],N=0,M=0;M<A.length;M++){var z=A[M];z.el_type==="bar"&&(_[b]===I&&(l.push({ogLine:v,line:s,staff:k,voice:R,start:N,end:M}),N=M+1,s++,h=Math.max(h,s),b++),I++)}l.push({ogLine:v,line:s,staff:k,voice:R,start:N,end:A.length}),s++,h=Math.max(h,s)}}else l.push({ogLine:v,line:s}),s++,h=Math.max(h,s)}return l}function n(d,p){for(var l=[],o=[],h=0,s=0;s<d.length;s++){var v=d[s],y=h+v;if(y<p)h=y;else{var m=p-h,_=y-p;m<_&&h>0?(l.push(s-1),o.push(Math.round(h-v)),h=v):s<d.length-1&&(l.push(s),o.push(Math.round(h)),h=0)}}return o.push(Math.round(h)),{lineBreaks:l,totals:o}}function r(d){for(var p=[],l=0;l<d.length;l++)p.push(d[l]);return p}function i(d,p,l,o,h,s,v,y,m,_,k){for(var x=_;x<d.length;x++){var R=d[x];l+=R,o+=R;var I=Math.abs(l-p[y]),b=Math.abs(I-s)<p[0]/10;if(b)if(I<s){var A=r(h),N=r(m);N.push(x-1),A.push(o-R),k.push({accumulator:l,lineAccumulator:R,lineWidths:A,lastVariance:Math.abs(l-p[y+1]),highestVariance:Math.max(v,s),currLine:y+1,lineBreaks:N,startIndex:x+1})}else I>s&&x<d.length-1&&(A=r(h),N=r(m),k.push({accumulator:l,lineAccumulator:o,lineWidths:A,lastVariance:I,highestVariance:Math.max(v,I),currLine:y,lineBreaks:N,startIndex:x+1}));I>s?(m.push(x-1),y++,v=Math.max(v,s),s=Math.abs(l-p[y]),h.push(o-R),o=R):s=I}h.push(o)}function c(d,p,l,o){for(var h=Math.ceil(d.total/p),s=Math.floor(d.total/h),v=[],y=0;y<h;y++)v.push(s*(y+1));var m=[];m.push({accumulator:0,lineAccumulator:0,lineWidths:[],lastVariance:999999,highestVariance:0,currLine:0,lineBreaks:[],startIndex:0});for(var _=0;_<m.length;)i(d.measureWidths,v,m[_].accumulator,m[_].lineAccumulator,m[_].lineWidths,m[_].lastVariance,m[_].highestVariance,m[_].currLine,m[_].lineBreaks,m[_].startIndex,m),_++;for(y=0;y<m.length;y++){var k=m[y];k.variances=[],k.aveVariance=0;for(var x=0;x<k.lineWidths.length;x++){var R=k.lineWidths[x];k.variances.push(R-v[0]),k.aveVariance+=Math.abs(R-v[0])}k.aveVariance=k.aveVariance/k.lineWidths.length,o.attempts.push({type:"optimizeLineWidths",lineBreaks:k.lineBreaks,variances:k.variances,aveVariance:k.aveVariance,widths:d.measureWidths})}var I=9999999,b=-1;for(y=0;y<m.length;y++)k=m[y],k.aveVariance<I&&(I=k.aveVariance,b=y);return{failed:!1,lineBreaks:m[b].lineBreaks,variance:m[b].highestVariance}}function u(d,p,l){for(var o=[],h=[],s=0,v=!1,y=0;y<d.length;y++)s+=d[y],s>p&&(v=!0),y%l===l-1&&(y!==d.length-1&&o.push(y),h.push(Math.round(s)),s=0);return{failed:v,totals:h,lineBreaks:o}}function f(d,p,l){var o={lineBreaks:d,staffwidth:p};for(var h in l)l.hasOwnProperty(h)&&h!=="wrap"&&h!=="staffwidth"&&(o[h]=l[h]);return{revisedParams:o}}function g(d,p,l){if(p.length===0||l.staffwidth<p[0].left)return{reParse:!1,explanation:"Staff width is narrower than the margin",revisedParams:l};var o=l.scale?Math.max(l.scale,.1):1,h=l.wrap.minSpacing?Math.max(parseFloat(l.wrap.minSpacing),1):1,s=l.wrap.minSpacingLimit?Math.max(parseFloat(l.wrap.minSpacingLimit),1):h-.1,v=l.wrap.maxSpacing?Math.max(parseFloat(l.wrap.maxSpacing),1):void 0;l.wrap.lastLineLimit&&!v&&(v=Math.max(parseFloat(l.wrap.lastLineLimit),1));for(var y=l.wrap.preferredMeasuresPerLine?Math.max(parseInt(l.wrap.preferredMeasuresPerLine,10),0):void 0,m=[],_=[],k=0;k<p.length;k++){var x=p[k],R=l.staffwidth-x.left,I=R/h/o,b=R/v/o,A=R/s/o,N={widths:x,lineBreakPoint:I,minLineSize:b,attempts:[],staffWidth:l.staffwidth,minWidth:Math.round(A)},M=null;if(y){var z=u(x.measureWidths,I,y);N.attempts.push({type:"Fixed Measures Per Line",preferredMeasuresPerLine:y,lineBreaks:z.lineBreaks,failed:z.failed,totals:z.totals}),z.failed||(M=z.lineBreaks)}if(!M){var L=n(x.measureWidths,I);N.attempts.push({type:"Free Form",lineBreaks:L.lineBreaks,totals:L.totals}),M=L.lineBreaks,M.length>0&&x.measureWidths.length<25&&(L=c(x,I,M,N),N.attempts.push({type:"Optimize",failed:L.failed,reason:L.reason,lineBreaks:L.lineBreaks,totals:L.totals}),L.failed||(M=L.lineBreaks))}m.push(M),_.push(N)}var E=l.staffwidth,T=f(m,E,l);return T.explanation=_,T.reParse=!0,T}return Pr={wrapLines:e,calcLineWraps:g},Pr}var zr,Hi;function ug(){if(Hi)return zr;Hi=1;function e(f){const g=f.getMeterFraction(),d=g.num===4&&g.den===4;if(!(g.num===2&&g.den===2)&&!d)throw new Error("notCommonTime");const l=f.deline();let o=[],h=!1;return l.forEach(s=>{if(s.subtitle)h&&o.push({type:"subtitle",subtitle:s.subtitle.text});else if(s.text)h=!0,o.push({type:"text",text:s.text.text});else if(s.staff){h=!0;const v=s.staff,y=a(v);o=o.concat(y)}}),r(o),i(o),c(o),o}const t=["break","(break)","no chord","n.c.","tacet"];function a(f){const g=[];let d="",p=[],l={chord:["","","",""]},o="",h="";if(f.forEach((s,v)=>{s.voices&&s.voices.forEach((y,m)=>{let _=0,k=0;y.forEach(x=>{if(x.el_type==="part")p.length>0&&v===0&&m===0&&(g.push({type:"part",name:d,lines:[p]}),p=[]),d=x.title;else if(x.el_type==="note"){u(x,l);const R=Math.floor(_);if(x.chord&&x.chord.length>0){const I=x.chord[0],b=I.position==="default"||t.indexOf(I.name.toLowerCase())>=0?I.name:"";b&&(R>0&&!l.chord[0]&&(l.chord[0]=o),o=b,l.chord[R]?R<4&&!l.chord[R+1]&&(l.chord[R+1]=b):l.chord[R]=b),x.chord.forEach(A=>{A.position!=="default"&&t.indexOf(I.name.toLowerCase())<0&&(l.annotations||(l.annotations=[]),l.annotations.push(A.name))})}if(!x.rest||x.rest.type!=="spacer"){const I=Math.floor(x.duration*4);if(I>4)k+=Math.floor(I/4),_=0;else{let b=x.duration*4;x.tripletMultiplier&&(b*=x.tripletMultiplier),_+=b}}}else if(x.el_type==="bar"){if(h&&(l.ending=h,h=""),u(x,l),(x.type==="bar_dbl_repeat"||x.type==="bar_left_repeat")&&(l.hasStartRepeat=!0),(x.type==="bar_dbl_repeat"||x.type==="bar_right_repeat")&&(l.hasEndRepeat=!0),x.startEnding&&(h=x.startEnding),_>=4){if(l.chord[0]===""&&(l.chord[1]||l.chord[2]||l.chord[3])&&(l.chord[0]=n(p)),v===0&&m===0)p.push(l);else{let R=k,I=0;for(;R>=g[I].lines[0].length&&I<g.length;)R-=g[I].lines[0].length,I++;if(I<g.length&&R<g[I].lines[0].length){const b=g[I].lines[0][R];!b.chord[0]&&l.chord[0]&&(b.chord[0]=l.chord[0]),!b.chord[1]&&l.chord[1]&&(b.chord[1]=l.chord[1]),!b.chord[2]&&l.chord[2]&&(b.chord[2]=l.chord[2]),!b.chord[3]&&l.chord[3]&&(b.chord[3]=l.chord[3]),l.annotations&&(b.annotations?b.annotations=b.annotations.concat(l.annotations):b.annotations=l.annotations)}k++}l={chord:["","","",""]}}else l.chord=["","","",""];_=0}else x.el_type}),v===0&&m===0&&g.push({type:"part",name:d,lines:[p]})})}),!o)throw new Error("noChords");return g}function n(f){for(let g=f.length-1;g>=0;g--)for(let d=f[g].chord.length-1;d>=0;d--)if(f[g].chord[d])return f[g].chord[d]}function r(f){f.forEach(g=>{if(g.type==="part"){const d=g.lines[0],p=d.findIndex(o=>!!o.ending),l=d.findIndex((o,h)=>h>p&&!!o.ending);if(p>=0&&l>=0&&l-p===d.length-l){let o=!0;for(let h=0;h<l-p&&o;h++){const s=d[p+h],v=d[l+h];if(s.chord[0]!==v.chord[0]&&(o=!1),s.chord[1]!==v.chord[1]&&(o=!1),s.chord[2]!==v.chord[2]&&(o=!1),s.chord[3]!==v.chord[3]&&(o=!1),s.annotations&&!v.annotations&&(o=!1),!s.annotations&&v.annotations&&(o=!1),s.annotations&&v.annotations)if(s.annotations.length!==v.annotations.length)o=!1;else for(let y=0;y<s.annotations.length;y++)s.annotations[y]!==v.annotations[y]&&(o=!1)}o&&(delete d[p].ending,d.splice(l,d.length-l))}}})}function i(f){f.forEach(g=>{if(g.type==="part"){const d=[],p=g.lines[0];let l=!1;const o=p.findIndex(v=>!!v.hasEndRepeat);(o>=0?Math.min(o+1,p.length):p.length)===12&&(l=!0);const s=l?4:8;for(let v=0;v<p.length;v+=s){const y=p.slice(v,v+s),m=y.findIndex(_=>!!_.hasEndRepeat);m>=0&&m<y.length-1?(d.push(y.slice(0,m+1)),d.push(y.slice(m+1))):d.push(y)}for(let v=0;v<d.length;v++)if(d[v][0].ending){const y=Math.max(0,v-1),m=d[y].length-d[v].length,_=[];for(let k=0;k<m;k++)_.push({noBorder:!0,chord:["","","",""]});d[v]=_.concat(d[v])}g.lines=d}})}function c(f){f.forEach(g=>{if(g.lines){let d=!1,p="";g.lines.forEach(l=>{l.forEach(o=>{if(!o.noBorder){const h=o.chord;!h[0]&&!h[1]&&!h[2]&&!h[3]?(d?p&&(h[0]="%"):h[0]=p,d=!0):!h[1]&&!h[2]&&!h[3]?(d=!0,p=h[0]):(d=!1,p=h[3]||h[2]||h[1])}})})}})}function u(f,g){if(f.decoration)for(let d=0;d<f.decoration.length;d++)switch(f.decoration[d]){case"fermata":case"segno":case"coda":case"D.C.":case"D.S.":case"D.C.alcoda":case"D.C.alfine":case"D.S.alcoda":case"D.S.alfine":case"fine":g.annotations||(g.annotations=[]),g.annotations.push(f.decoration[d]);break}}return zr=e,zr}var Ir,$i;function Ve(){if($i)return Ir;$i=1;var e={};return e.FONTEM=360,e.FONTSIZE=30,e.STEP=e.FONTSIZE*93/720,e.SPACE=10,e.TOPNOTE=15,e.STAVEHEIGHT=100,e.INDENT=50,Ir=e,Ir}var Rr,Zi;function hg(){if(Zi)return Rr;Zi=1;const e=nt();function t(i){this.sections=[{type:"startRepeat",index:-1}],this.addBar=function(c){var u=i.length-1,f=c.type==="bar_left_repeat"||c.type==="bar_dbl_repeat",g=c.type==="bar_right_repeat"||c.type==="bar_dbl_repeat",d=c.startEnding?r(c.startEnding):void 0;g&&this.sections.push({type:"endRepeat",index:u}),f&&this.sections.push({type:"startRepeat",index:u}),d&&this.sections.push({type:"startEnding",index:u,endings:d})},this.resolveRepeats=function(){var c,u=this.sections[this.sections.length-1],f=i.length-1;if(u.type==="startRepeat"?u.end=f:u.index+1<f&&this.sections.push({type:"startRepeat",index:u.index+1}),this.sections.length<2)return i;for(var g=[],d=null,p=0;p<this.sections.length;p++){var l=this.sections[p];switch(l.type){case"startRepeat":if(d){if(d.common.end||(d.common.end=l.index),d.endings)for(c=0;c<d.endings.length;c++)d.endings[c]&&!d.endings[c].end&&d.endings[c].start!==l.index&&(d.endings[c].end=l.index);this.sections[p-1].type==="endRepeat"&&d.endings&&d.endings.length&&(d.endings[d.endings.length]={start:-1,end:-1}),g.push(d)}if(d){var o=d.common.end;if(d.endings)for(c=0;c<d.endings.length;c++)d.endings[c]&&(o=Math.max(o,d.endings[c].end));o<l.index-1&&(console.log("gap",i.slice(o+1,l.index)),g.push({common:{start:o+1,end:l.index}}))}d={common:{start:l.index}};break;case"startEnding":{if(d)for(d.common.end||(d.common.end=l.index),d.endings||(d.endings=[]),c=0;c<l.endings.length;c++)d.endings[l.endings[c]]={start:l.index+1};break}case"endRepeat":if(d){if(d.endings||(d.endings=[]),d.endings.length>0)for(c=0;c<d.endings.length;c++)d.endings[c]&&!d.endings[c].end&&(d.endings[c].end=l.index);d.common.end||(d.common.end=l.index)}break}}if(d){if(d.common.end||(d.common.end=f),d.endings)for(c=0;c<d.endings.length;c++)d.endings[c]&&!d.endings[c].end&&(d.endings[c].end=f);g.push(d)}for(var h=[],s=-1,v=0;v<g.length;v++){var y=g[v];if(!y.endings)a(i,h,y.common.start,y.common.end);else if(y.endings.length===0)a(i,h,y.common.start,y.common.end),a(i,h,y.common.start,y.common.end);else for(c=0;c<y.endings.length;c++){var m=y.endings[c];m&&(a(i,h,y.common.start,y.common.end),m.start>0&&a(i,h,m.start,m.end),s=Math.max(s,m.end))}}return h}}function a(i,c,u,f){for(var g=u;g<=f;g++)c.push(n(i[g]))}function n(i){var c=Object.assign({},i);return c.pitches&&(c.pitches=e.cloneArray(c.pitches)),c}function r(i){var c=[],u,f,g;if(i.indexOf(",")>0)for(f=i.split(","),g=0;g<f.length;g++)u=parseInt(f[g],10),u>0&&c.push(u);else if(i.indexOf("-")>0){f=i.split("-");var d=parseInt(f[0],10),p=parseInt(f[1],10);for(g=d;g<=p;g++)c.push(g)}else u=parseInt(i,10),u>0&&c.push(u);return c}return Rr=t,Rr}var qr,Gi;function Cl(){if(Gi)return qr;Gi=1;var e,t=nt(),a=hg();return(function(){var n=1,r=128;e=function(v,y){y=y||{};var m,_=y.program||0,k=y.midiTranspose||0;v.visualTranspose&&(k-=v.visualTranspose);var x=y.channel||0,R=!1,I=y.drum||"",b=y.drumBars||1,A=y.drumIntro||0,N=I!=="",M=!!y.drumOff,z=[],L=50;_=parseInt(_,10),k=parseInt(k,10),x=parseInt(x,10),x===10&&(_=r),I=I.split(" "),b=parseInt(b,10),A=parseInt(A,10);var E=v.formatting.bagpipes;E&&(_=71);var T=[];if(v.formatting.midi){var P=v.formatting.midi;P.program&&P.program.length>0&&(_=P.program[0],P.program.length>1&&(_=P.program[1],x=P.program[0]),R=!0),P.transpose&&(k=P.transpose[0]),P.channel&&(x=P.channel[0],R=!0),P.drum&&(I=P.drum),P.drumbars&&(b=P.drumbars[0]),P.drumon&&(N=!0),x===10&&(_=r),P.beat&&T.push({el_type:"beat",beats:P.beat}),P.nobeataccents&&T.push({el_type:"beataccents",value:!1})}y.qpm?m=parseInt(y.qpm,10):v.metaText.tempo?m=d(v.metaText.tempo,v.getBeatLength()):y.defaultQpm?m=y.defaultQpm:m=180;var B=[];E&&B.push({el_type:"bagpipes"}),B.push({el_type:"instrument",program:_}),x&&B.push({el_type:"channel",channel:x}),k&&B.push({el_type:"transpose",transpose:k}),B.push({el_type:"tempo",qpm:m});for(var O=0;O<T.length;O++)B.push(T[O]);var w=[],C=[],S=[],q=[],D=[0],$={};$[0]={el_type:"tempo",qpm:m,timing:0};for(var F,K=[],te=!1,V=v.lines,ae=0;ae<V.length;ae++){var oe=V[ae];if(oe.staff){let pe=function(be){var $e={pppp:[15,10,5,1],ppp:[30,20,10,1],pp:[45,35,20,1],p:[60,50,35,1],mp:[75,65,50,1],mf:[90,80,65,1],f:[105,95,80,1],ff:[120,110,95,1],fff:[127,125,110,1],ffff:[127,125,110,1]},ve;if(be.decoration){if(be.decoration.indexOf("pppp")>=0?ve="pppp":be.decoration.indexOf("ppp")>=0?ve="ppp":be.decoration.indexOf("pp")>=0?ve="pp":be.decoration.indexOf("p")>=0?ve="p":be.decoration.indexOf("mp")>=0?ve="mp":be.decoration.indexOf("mf")>=0?ve="mf":be.decoration.indexOf("f")>=0?ve="f":be.decoration.indexOf("ff")>=0?ve="ff":be.decoration.indexOf("fff")>=0?ve="fff":be.decoration.indexOf("ffff")>=0&&(ve="ffff"),ve){F=$e[ve].slice(0);let kt=[F];Array.isArray(be.decoration)&&(kt=[],be.decoration.forEach(ct=>{ct in $e&&kt.push($e[ct].slice(0))})),w[J].push({el_type:"beat",beats:F.slice(0),volumesPerNotePitch:kt}),S[he]=!1,q[he]=!1}if(be.decoration.indexOf("crescendo(")>=0){var rt=i(de,W,"crescendo)"),Ue=Math.min(127,F[0]+L),Ze=c(de,W+rt+1,Object.keys($e));Ze&&(Ue=$e[Ze][0]),rt>0?S[he]=Math.floor((Ue-F[0])/rt):S[he]=!1,q[he]=!1}else if(be.decoration.indexOf("crescendo)")>=0)S[he]=!1;else if(be.decoration.indexOf("diminuendo(")>=0){var st=i(de,W,"diminuendo)"),ot=Math.max(15,F[0]-L),vt=c(de,W+st+1,Object.keys($e));vt&&(ot=$e[vt][0]),S[he]=!1,st>0?q[he]=Math.floor((ot-F[0])/st):q[he]=!1}else be.decoration.indexOf("diminuendo)")>=0&&(q[he]=!1)}};for(var qe=pe,le=oe.staff,J=0,ce=0;ce<le.length;ce++){var ee=le[ce];if(!(ee.clef&&ee.clef.type==="TAB"))for(var he=0;he<ee.voices.length;he++){var de=ee.voices[he];if(!w[J]){w[J]=[].concat(JSON.parse(JSON.stringify(B)));var Se=g(oe.staff,J);Se&&w[J].unshift({el_type:"name",trackName:Se}),K[J]=new a(w[J])}if(k&&ee.clef.type==="perc"&&w[J].push({el_type:"transpose",transpose:0}),ee.clef&&ee.clef.type==="perc"&&!R)for(var we=0;we<w[J].length;we++)w[J][we].el_type==="instrument"&&(w[J][we].program=r);else ee.key&&o(w[J],ee.key);ee.meter&&h(w[J],ee.meter),!te&&N&&(w[J].push({el_type:"drum",params:{pattern:I,bars:b,on:N,intro:A}}),te=!0),ee.clef&&ee.clef.type!=="perc"&&ee.clef.transpose&&(ee.clef.el_type="clef",w[J].push({el_type:"transpose",transpose:ee.clef.transpose}),C[J]=!1),ee.clef&&ee.clef.type&&(ee.clef.type.indexOf("-8")>=0?(w[J].push({el_type:"transpose",transpose:-12}),C[J]=!0):ee.clef.type.indexOf("+8")>=0?(w[J].push({el_type:"transpose",transpose:12}),C[J]=!0):C[J]&&(w[J].push({el_type:"transpose",transpose:0}),C[J]=!1)),v.formatting.midi&&v.formatting.midi.drumoff&&(w[J].push({el_type:"bar"}),w[J].push({el_type:"drum",params:{pattern:"",on:!1}}));var Re=0,ze=0,Oe=0,Z=0;F=[105,95,85,1];for(var W=0;W<de.length;W++){var H=de[W];switch(H.el_type){case"note":if(S[he]&&(F[0]+=S[he],F[1]+=S[he],F[2]+=S[he],w[J].push({el_type:"beat",beats:F.slice(0)})),q[he]&&(F[0]+=q[he],F[1]+=q[he],F[2]+=q[he],w[J].push({el_type:"beat",beats:F.slice(0)})),pe(H),!H.rest||H.rest.type!=="spacer"){var j={elem:H,el_type:"note",timing:D[J]};if(H.style?j.style=H.style:z[J]&&(j.style=z[J]),j.duration=H.duration===0?.25:H.duration,H.startTriplet){if(ze=H.tripletMultiplier,Oe=H.startTriplet*ze*H.duration,H.startTriplet!==H.tripletR&&W+H.tripletR<=de.length){for(var Q=0,re=W;re<W+H.tripletR;re++)Q+=de[re].duration;Oe=ze*Q}j.duration=j.duration*ze,j.duration=Math.round(j.duration*1e6)/1e6,Z=j.duration}else ze&&(H.endTriplet?(ze=0,j.duration=Math.round((Oe-Z)*1e6)/1e6):(j.duration=j.duration*ze,j.duration=Math.round(j.duration*1e6)/1e6,Z+=j.duration));H.rest&&(j.rest=H.rest),H.decoration&&(j.decoration=H.decoration.slice(0)),H.pitches&&(j.pitches=t.cloneArray(H.pitches)),H.gracenotes&&(j.gracenotes=t.cloneArray(H.gracenotes)),H.chord&&(j.chord=t.cloneArray(H.chord)),w[J].push(j),H.style==="rhythm"&&f(w),Re++,D[J]+=j.duration}break;case"key":case"keySignature":o(w[J],H);break;case"meter":h(w[J],H);break;case"clef":H.transpose&&w[J].push({el_type:"transpose",transpose:H.transpose}),H.type&&(H.type.indexOf("-8")>=0?w[J].push({el_type:"transpose",transpose:-12}):H.type.indexOf("+8")>=0&&w[J].push({el_type:"transpose",transpose:12}));break;case"tempo":m=d(H,v.getBeatLength()),w[J].push({el_type:"tempo",qpm:m,timing:D[J]}),$[""+D[J]]={el_type:"tempo",qpm:m,timing:D[J]};break;case"bar":Re>0&&w[J].push({el_type:"bar"}),pe(H),Re=0,K[J].addBar(H,J);break;case"style":z[J]=H.head;break;case"timeSignature":w[J].push(p(H));break;case"part":break;case"stem":case"scale":case"break":case"font":break;case"midi":var ie=!1;switch(H.cmd){case"drumon":N=!0,ie=!0;break;case"drumoff":N=!1,ie=!0;break;case"drum":I=H.params,ie=!0;break;case"drumbars":b=H.params[0],ie=!0;break;case"drummap":break;case"channel":H.params[0]===10&&w[J].push({el_type:"instrument",program:r});break;case"program":s(w[J],{el_type:"instrument",program:H.params[0]}),R=!0;break;case"transpose":w[J].push({el_type:"transpose",transpose:H.params[0]});break;case"gchordoff":w[J].push({el_type:"gchordOn",tacet:!0});break;case"gchordon":w[J].push({el_type:"gchordOn",tacet:!1});break;case"beat":w[J].push({el_type:"beat",beats:H.params});break;case"nobeataccents":w[J].push({el_type:"beataccents",value:!1});break;case"beataccents":w[J].push({el_type:"beataccents",value:!0});break;case"vol":case"volinc":w[J].push({el_type:H.cmd,volume:H.params[0]});break;case"swing":case"gchord":case"bassvol":case"chordvol":w[J].push({el_type:H.cmd,param:H.params[0]});break;case"bassprog":case"chordprog":w[J].push({el_type:H.cmd,value:H.params[0],octaveShift:H.params[1]});break;case"gchordbars":w[J].push({el_type:H.cmd,param:H.params[0]});break;default:console.log("MIDI seq: midi cmd not handled: ",H.cmd,H)}ie&&(w[0].push({el_type:"drum",params:{pattern:I,bars:b,intro:A,on:N}}),te=!0);break;default:console.log("MIDI: element type "+H.el_type+" not handled.")}}J++,D[J]||(D[J]=0)}}}}for(var ge=0;ge<K.length;ge++)w[ge]=K[ge].resolveRepeats();if(u(w,$),A)for(var ne=v.getPickupLength(),ue=0;ue<w.length;ue++){for(var Ee=0;w[ue][Ee].el_type!=="note"&&w[ue].length>Ee;)Ee++;if(w[ue].length>Ee){for(var re=0;re<A;re++)ne===0||re<A-1?(w[ue].splice(Ee,0,{el_type:"note",rest:{type:"rest"},duration:n},{el_type:"bar"}),Ee+=2):w[ue].splice(Ee++,0,{el_type:"note",rest:{type:"rest"},duration:n-ne});M&&(N=!1,w[ue].splice(Ee++,0,{el_type:"drum",params:{pattern:I,bars:b,intro:A,on:N}}),M=!1)}}return w.length>0&&w[0].length>0&&(w[0][0].pickupLength=v.getPickupLength()),w};function i(v,y,m){for(var _=0,k=y+1;k<v.length;k++)if(v[k].el_type==="note"&&_++,v[k].decoration&&v[k].decoration.indexOf(m)>=0)return _;return _}function c(v,y,m){for(var _=Math.min(v.length,y+3),k=y;k<_;k++)if(v[k].el_type==="note"&&v[k].decoration){for(var x=0;x<v[k].decoration.length;x++)if(m.indexOf(v[k].decoration[x])>=0)return v[k].decoration[x]}return null}function u(v,y){if(!(!y||y.length===0))for(var m=Object.keys(y),_=0;_<v.length;_++)for(var k=v[_],x=y[0]?y[0].qpm:0,R=0;R<k.length;R++){var I=k[R];I.el_type==="tempo"&&(x=I.qpm),m.indexOf(""+I.timing)>=0&&x!==y[""+I.timing].qpm&&(x=y[""+I.timing].qpm,I.el_type==="tempo"?(I.qpm=y[""+I.timing].qpm,R++):(v[_].splice(R,0,{el_type:"tempo",qpm:y[""+I.timing].qpm,timing:I.timing}),R+=2))}}function f(v){for(var y=0;y<v.length;y++)for(var m=v[y],_=m.length-1;_>=0&&m[_].el_type!=="bar";)m[_].noChordVoice=!0,_--}function g(v,y){if(!(!v||v.length<=y||!v[y].title))return v[y].title.join(" ")}function d(v,y){var m=.25;v.duration&&(m=v.duration[0]);var _=60;return v.bpm&&(_=v.bpm),m*_/y}function p(v){var y;switch(v.type){case"common_time":y={el_type:"meter",num:4,den:4},n=4/4;break;case"cut_time":y={el_type:"meter",num:2,den:2},n=2/2;break;case"specified":let k=0;if(v.value&&v.value.length>0&&v.value[0].num.indexOf("+")>0)for(var m=v.value[0].num.split("+"),_=0;_<m.length;_++)k+=parseInt(m[_],10);else k=parseInt(v.value[0].num,10);y={el_type:"meter",num:k,den:v.value[0].den},n=k/parseInt(v.value[0].den,10);break;default:y={el_type:"meter"},n=1}return y}function l(v){for(var y=[],m=0;m<v.length;m++)v[m].acc!=="natural"&&y.push(v[m]);return y}function o(v,y){var m;y.root==="HP"?m={el_type:"key",accidentals:[{acc:"natural",note:"g"},{acc:"sharp",note:"f"},{acc:"sharp",note:"c"}]}:m={el_type:"key",accidentals:l(y.accidentals)},s(v,m)}function h(v,y){var m=p(y);s(v,m)}function s(v,y){for(var m=v.length-1;m>=0;m--)if(v[m].el_type===y.el_type){JSON.stringify(v[m])!==JSON.stringify(y)&&v.push(y);return}v.push(y)}})(),qr=e,qr}var Br,Ui;function fg(){if(Ui)return Br;Ui=1;var e=function(g,d,p,l){this.chordTrack=[],this.chordTrackFinished=!1,this.chordChannel=g,this.currentChords=[],this.lastChord,this.chordLastBar,this.chordsOff=!!d,this.gChordTacet=this.chordsOff,this.hasRhythmHead=!1,this.transpose=0,this.lastBarTime=0,this.meter=l,this.tempoChangeFactor=1,this.bassInstrument=p.bassprog&&p.bassprog.length>=1?p.bassprog[0]:0,this.chordInstrument=p.chordprog&&p.chordprog.length>=1?p.chordprog[0]:0,this.bassOctaveShift=p.bassprog&&p.bassprog.length===2?p.bassprog[1]:0,this.chordOctaveShift=p.chordprog&&p.chordprog.length===2?p.chordprog[1]:0,this.boomVolume=p.bassvol&&p.bassvol.length===1?p.bassvol[0]:64,this.chickVolume=p.chordvol&&p.chordvol.length===1?p.chordvol[0]:48,p.gchord&&p.gchord.length>0?this.overridePattern=n(p.gchord[0]):this.overridePattern=void 0};e.prototype.setMeter=function(f){this.meter=f},e.prototype.setTempoChangeFactor=function(f){this.tempoChangeFactor=f},e.prototype.setLastBarTime=function(f){this.lastBarTime=f},e.prototype.setTranspose=function(f){this.transpose=f},e.prototype.setRhythmHead=function(f,g){this.hasRhythmHead=f;var d=[];if(f&&this.lastChord&&this.lastChord.chick)for(var p=0;p<this.lastChord.chick.length;p++){var l=Object.assign({},g.pitches[0]);l.actualPitch=this.lastChord.chick[p],d.push(l)}return d},e.prototype.barEnd=function(f){this.chordTrack.length>0&&!this.chordTrackFinished&&(this.resolveChords(this.lastBarTime,c(f.time)),this.currentChords=[]),this.chordLastBar=this.lastChord},e.prototype.gChordOn=function(f){this.chordsOff||(this.gChordTacet=f.tacet)},e.prototype.paramChange=function(f){switch(f.el_type){case"gchord":f.param&&f.param.length>0?this.overridePattern=n(f.param):this.overridePattern=void 0;break;case"bassprog":this.bassInstrument=f.value,f.octaveShift!=null&&f.octaveShift!=null?this.bassOctaveShift=f.octaveShift:this.bassOctaveShift=0;break;case"chordprog":this.chordInstrument=f.value,f.octaveShift!=null&&f.octaveShift!=null?this.chordOctaveShift=f.octaveShift:this.chordOctaveShift=0;break;case"bassvol":this.boomVolume=f.param;break;case"chordvol":this.chickVolume=f.param;break;default:console.log("unhandled midi param",f)}},e.prototype.finish=function(){this.chordTrackEmpty()||(this.chordTrackFinished=!0)},e.prototype.addTrack=function(f){this.chordTrackEmpty()||f.push(this.chordTrack)},e.prototype.findChord=function(f){if(this.gChordTacet)return"break";if(this.chordTrackFinished||!f.chord||f.chord.length===0)return null;for(var g=0;g<f.chord.length;g++){var d=f.chord[g];if(d.position==="default")return d.name;if(this.breakSynonyms.indexOf(d.name.toLowerCase())>=0)return"break"}return null},e.prototype.interpretChord=function(f){if(f.length!==0){if(f==="break")return{chick:[]};var g=f.substring(0,1);if(g==="("){if(f=f.substring(1,f.length-1),f.length===0)return;g=f.substring(0,1)}var d=this.basses[g];if(d){for(var p=this.transpose;p<-8;)p+=12;for(;p>8;)p-=12;d+=p,d<33?d+=12:d>44&&(d-=12);var l=d;d+=this.bassOctaveShift*12;var o=d-5,h;f.length===1&&(h=this.chordNotes(d,""));var s=f.substring(1),v=s.substring(0,1);v==="b"||v==="♭"?(l--,d--,o--,s=s.substring(1)):(v==="#"||v==="♯")&&(l++,d++,o++,s=s.substring(1));var y=s.split("/");if(h=this.chordNotes(l,y[0]),h.length>=3){var m=h[2]-h[0];o=o+m-7}if(y.length===2){var _=this.basses[y[1].substring(0,1)];if(_){var k=y[1].substring(1),x={"#":1,"♯":1,b:-1,"♭":-1}[k]||0;d=this.basses[y[1].substring(0,1)]+x+p,d+=this.bassOctaveShift*12,o=d}}return{boom:d,boom2:o,chick:h}}}},e.prototype.chordNotes=function(f,g){var d=this.chordIntervals[g];d||(g.slice(0,2).toLowerCase()==="ma"||g[0]==="M"?d=this.chordIntervals.M:g[0]==="m"||g[0]==="-"?d=this.chordIntervals.m:d=this.chordIntervals.M),f+=12,f+=this.chordOctaveShift*12;for(var p=[],l=0;l<d.length;l++)p.push(f+d[l]);return p},e.prototype.writeNote=function(f,g,d,p,l,o){f!==void 0&&this.chordTrack.push({cmd:"note",pitch:f,volume:d,start:this.lastBarTime+p*u(g,this.tempoChangeFactor),duration:u(l,this.tempoChangeFactor),gap:0,instrument:o})},e.prototype.chordTrackEmpty=function(){for(var f=!0,g=0;g<this.chordTrack.length&&f;g++)this.chordTrack[g].cmd==="note"&&(f=!1);return f},e.prototype.resolveChords=function(f,g){if(!this.hasRhythmHead){var d=this.meter.num,p=this.meter.den,l=1/p,o=l/2,h=parseInt(d,10)/parseInt(p,10),s=h-(g-f)/this.tempoChangeFactor;Math.abs(s)<1e-5&&(s=0),(this.currentChords.length===0||this.currentChords[0].beat!==0)&&this.currentChords.unshift({beat:0,chord:this.chordLastBar});var v=r(this.currentChords,8*d/p),y=this.overridePattern?this.overridePattern:this.rhythmPatterns[d+"/"+p];if(s){y=[];for(var m=(g-f)/this.tempoChangeFactor*8,_=0;_<m/2;_+=2)y.push("chick"),y.push("")}if(!y){y=[];for(var _=0;_<8*d/p/2;_++)y.push("chick"),y.push("")}for(var k=!0,x=Math.min(y.length,v.length),_=0;_<x;_++){_>0&&v[_-1]&&v[_]&&v[_-1].boom!==v[_].boom&&(k=!0);var R=y[_],I=R.indexOf("boom")>=0,b=!I&&_!==0&&y[0].indexOf("boom")>=0&&(!v[_-1]||v[_-1].boom!==v[_].boom),A=t(v[_],R,k,b);I&&(k=!1);for(var N=0;N<A.length;N++)this.writeNote(A[N],.125,I||b?this.boomVolume:this.chickVolume,_,o,I||b?this.bassInstrument:this.chordInstrument),b?b=!1:I=!1}}},e.prototype.processChord=function(f){if(!this.chordTrackFinished){var g=this.findChord(f);if(g){var d=this.interpretChord(g);if(d){this.chordTrack.length===0&&this.chordTrack.push({cmd:"program",channel:this.chordChannel,instrument:this.chordInstrument}),this.lastChord=d;var p=i(this.lastBarTime,c(f.time));this.currentChords.push({chord:this.lastChord,beat:p,start:c(f.time)})}}}};function t(f,g,d,p){var l=[];if(!f)return l;g.indexOf("boom")>=0?l.push(d?f.boom:f.boom2):p&&l.push(f.boom);var o=f.chick.length;if(g.indexOf("chick")>=0)for(var h=0;h<o;h++)l.push(f.chick[h]);switch(g){case"DO":l.push(f.chick[0]);break;case"MI":l.push(f.chick[1]);break;case"SOL":l.push(a(f,2));break;case"TI":l.push(a(f,3));break;case"TOP":l.push(a(f,4));break;case"do":l.push(f.chick[0]+12);break;case"mi":l.push(f.chick[1]+12);break;case"sol":l.push(a(f,2)+12);break;case"ti":l.push(a(f,3)+12);break;case"top":l.push(a(f,4)+12);break}return l}function a(f,g){var d=Math.floor(g/f.chick.length),p=f.chick[g%f.chick.length];return p+d*12}function n(f){for(var g=[],d=0;d<f.length;d++){var p=f[d];switch(p){case"z":g.push("");break;case"2":g.push("");break;case"c":g.push("chick");break;case"b":g.push("boom&chick");break;case"f":g.push("boom");break;case"G":g.push("DO");break;case"H":g.push("MI");break;case"I":g.push("SOL");break;case"J":g.push("TI");break;case"K":g.push("TOP");break;case"g":g.push("do");break;case"h":g.push("mi");break;case"i":g.push("sol");break;case"j":g.push("ti");break;case"k":g.push("top");break}}return g}function r(f,g,d){var p=[];if(f.length===0)return p;for(var l=f[0].chord,o=1;o<f.length;o++){for(var h=f[o];p.length<h.beat;)p.push(l);l=h.chord}for(;p.length<g;)p.push(l);return p}function i(f,g){var d=g-f;return d*8}e.prototype.breakSynonyms=["break","(break)","no chord","n.c.","tacet"],e.prototype.basses={A:33,B:35,C:36,D:38,E:40,F:41,G:43},e.prototype.chordIntervals={dim:[0,3,6],"°":[0,3,6],"˚":[0,3,6],dim7:[0,3,6,9],"°7":[0,3,6,9],"˚7":[0,3,6,9],ø7:[0,3,6,10],"m7(b5)":[0,3,6,10],m7b5:[0,3,6,10],"m7♭5":[0,3,6,10],"-7(b5)":[0,3,6,10],"-7b5":[0,3,6,10],"7b5":[0,4,6,10],"7(b5)":[0,4,6,10],"7♭5":[0,4,6,10],"7(b9,b5)":[0,4,6,10,13],"7b9,b5":[0,4,6,10,13],"7(#9,b5)":[0,4,6,10,15],"7#9b5":[0,4,6,10,15],"maj7(b5)":[0,4,6,11],maj7b5:[0,4,6,11],"13(b5)":[0,4,6,10,14,21],"13b5":[0,4,6,10,14,21],m:[0,3,7],"-":[0,3,7],m6:[0,3,7,9],"-6":[0,3,7,9],m7:[0,3,7,10],"-7":[0,3,7,10],"-(b6)":[0,3,7,8],"-b6":[0,3,7,8],"-6/9":[0,3,7,9,14],"-7(b9)":[0,3,7,10,13],"-7b9":[0,3,7,10,13],"-maj7":[0,3,7,11],"-9+7":[0,3,7,11,13],"-11":[0,3,7,11,14,17],m11:[0,3,7,11,14,17],"-maj9":[0,3,7,11,14],"-∆9":[0,3,7,11,14],mM9:[0,3,7,11,14],M:[0,4,7],6:[0,4,7,9],"6/9":[0,4,7,9,14],"6add9":[0,4,7,9,14],69:[0,4,7,9,14],7:[0,4,7,10],9:[0,4,7,10,14],11:[0,7,10,14,17],13:[0,4,7,10,14,21],"7b9":[0,4,7,10,13],"7♭9":[0,4,7,10,13],"7(b9)":[0,4,7,10,13],"7(#9)":[0,4,7,10,15],"7#9":[0,4,7,10,15],"(13)":[0,4,7,10,14,21],"7(9,13)":[0,4,7,10,14,21],"7(#9,b13)":[0,4,7,10,15,20],"7(#11)":[0,4,7,10,14,18],"7#11":[0,4,7,10,14,18],"7(b13)":[0,4,7,10,20],"7b13":[0,4,7,10,20],"9(#11)":[0,4,7,10,14,18],"9#11":[0,4,7,10,14,18],"13(#11)":[0,4,7,10,18,21],"13#11":[0,4,7,10,18,21],maj7:[0,4,7,11],"∆7":[0,4,7,11],Δ7:[0,4,7,11],maj9:[0,4,7,11,14],"maj7(9)":[0,4,7,11,14],"maj7(11)":[0,4,7,11,17],"maj7(#11)":[0,4,7,11,18],"maj7(13)":[0,4,7,14,21],"maj7(9,13)":[0,4,7,11,14,21],"7sus4":[0,5,7,10],m7sus4:[0,3,7,10,17],sus4:[0,5,7],sus2:[0,2,7],"7sus2":[0,2,7,10],"9sus4":[0,5,7,10,14],"13sus4":[0,5,7,10,14,21],aug7:[0,4,8,10],"+7":[0,4,8,10],"+":[0,4,8],"7#5":[0,4,8,10],"7♯5":[0,4,8,10],"7+5":[0,4,8,10],"9#5":[0,4,8,10,14],"9♯5":[0,4,8,10,14],"9+5":[0,4,8,10,14],"-7(#5)":[0,3,8,10],"-7#5":[0,3,8,10],"7(#5)":[0,4,8,10],"7(b9,#5)":[0,4,8,10,13],"7b9#5":[0,4,8,10,13],"maj7(#5)":[0,4,8,11],"maj7#5":[0,4,8,11],"maj7(#5,#11)":[0,4,8,11,18],"maj7#5#11":[0,4,8,11,18],"9(#5)":[0,4,8,10,14],"13(#5)":[0,4,8,10,14,21],"13#5":[0,4,8,10,14,21],5:[0,7],"5(8)":[0,7,12],"5add8":[0,7,12]},e.prototype.rhythmPatterns={"2/2":["boom","","","","chick","","",""],"3/2":["boom","","","","chick","","","","chick","","",""],"4/2":["boom","","","","chick","","","","boom","","","","chick","","",""],"2/4":["boom","","chick",""],"3/4":["boom","","chick","","chick",""],"4/4":["boom","","chick","","boom","","chick",""],"5/4":["boom","","chick","","chick","","boom","","chick",""],"6/4":["boom","","chick","","boom","","chick","","boom","","chick",""],"3/8":["boom","","chick"],"5/8":["boom","chick","chick","boom","chick"],"6/8":["boom","","chick","boom","","chick"],"7/8":["boom","chick","chick","boom","chick","boom","chick"],"9/8":["boom","","chick","boom","","chick","boom","","chick"],"10/8":["boom","chick","chick","boom","chick","chick","boom","chick","boom","chick"],"11/8":["boom","chick","chick","boom","chick","chick","boom","chick","boom","chick","chick"],"12/8":["boom","","chick","boom","","chick","boom","","chick","boom","","chick"]};function c(f){return f/1e6}function u(f,g){return Math.round(f*g*1e6)/1e6}return Br=e,Br}var Lr,ji;function Sl(){if(ji)return Lr;ji=1;var e={f0:"_C",n0:"=C",s0:"^C",x0:"C",f1:"_D",n1:"=D",s1:"^D",x1:"D",f2:"_E",n2:"=E",s2:"^E",x2:"E",f3:"_F",n3:"=F",s3:"^F",x3:"F",f4:"_G",n4:"=G",s4:"^G",x4:"G",f5:"_A",n5:"=A",s5:"^A",x5:"A",f6:"_B",n6:"=B",s6:"^B",x6:"B",f7:"_c",n7:"=c",s7:"^c",x7:"c",f8:"_d",n8:"=d",s8:"^d",x8:"d",f9:"_e",n9:"=e",s9:"^e",x9:"e",f10:"_f",n10:"=f",s10:"^f",x10:"f",f11:"_g",n11:"=g",s11:"^g",x11:"g",f12:"_a",n12:"=a",s12:"^a",x12:"a",f13:"_b",n13:"=b",s13:"^b",x13:"b",f14:"_c'",n14:"=c'",s14:"^c'",x14:"c'",f15:"_d'",n15:"=d'",s15:"^d'",x15:"d'",f16:"_e'",n16:"=e'",s16:"^e'",x16:"e'"};function t(a){var n=(a.accidental?a.accidental[0]:"x")+a.verticalPos;return e[n]}return Lr=t,Lr}var Or,Yi;function dg(){if(Yi)return Or;Yi=1;var e,t=fg(),a=Sl();return(function(){var n,r,i,c,u,f=1,g,d,p,l,o,h,s={num:4,den:4},v=128,y,m=!0,_=105,k=95,x=85,R=[[_,k,x]],I=.25,b,A,N=0,M,z={},L,E=0,T,P=0,B=-.001,O=.4;e=function(Z,W,H,j){W||(W={}),j||(j={}),n=[],r=[0,0,0,0,0,0,0],c=[],u=W.qpm,f=1,g=void 0,d=void 0,p=void 0,l=void 0,o=0,T=H,s={num:4,den:4},m=!0,_=105,k=95,x=85,R=[],I=.25,b=void 0,A=void 0,N=0,M=[],z={},L=1,Z.length>0&&Z[0].length>0&&(E=Z[0][0].pickupLength),W.bassprog!==void 0&&!j.bassprog&&(j.bassprog=[W.bassprog]),W.bassvol!==void 0&&!j.bassvol&&(j.bassvol=[W.bassvol]),W.chordprog!==void 0&&!j.chordprog&&(j.chordprog=[W.chordprog]),W.chordvol!==void 0&&!j.chordvol&&(j.chordvol=[W.chordvol]),W.gchord!==void 0&&!j.gchord&&(j.gchord=[W.gchord]),h=new t(Z.length,W.chordsOff,j,s),q(Z,W);for(var Q=0;Q<Z.length;Q++){i=0,h.setTranspose(i);var re=Z[Q];p=[{cmd:"program",channel:Q,instrument:g}],l=void 0,y=0,h.setLastBarTime(0);var ie=!1;(W.voicesOff===!0||W.voicesOff&&W.voicesOff.length&&W.voicesOff.indexOf(Q)>=0)&&(ie=!0);for(var ge=0;ge<re.length;ge++){var ne=re[ge];switch(ne.el_type){case"name":l={cmd:"text",type:"name",text:ne.trackName};break;case"note":V(ne,ie);break;case"key":r=J(ne);break;case"meter":s=ne,h.setMeter(s),I=D(s),Re();break;case"tempo":u?f=ne.qpm?u/ne.qpm:1:u=ne.qpm,h.setTempoChangeFactor(f);break;case"transpose":i=ne.transpose,h.setTranspose(i);break;case"bar":h.barEnd(ne),n=[],Q===0&&ze(Z.length+1),h.setRhythmHead(!1),y=C(ne.time),h.setLastBarTime(y);break;case"bagpipes":break;case"instrument":if(g===void 0&&(g=ne.program),d=ne.program,p.length>0&&p[p.length-1].cmd==="program")p[p.length-1].instrument=ne.program;else{var ue;for(ue=p.length-1;ue>=0&&p[ue].cmd!=="program";ue--);(ue<0||p[ue].instrument!==ne.program)&&p.push({cmd:"program",channel:0,instrument:ne.program})}break;case"channel":w(ne.channel);break;case"drum":z=we(ne.params),Re();break;case"gchordOn":h.gChordOn(ne);break;case"beat":_=ne.beats[0],k=ne.beats[1],x=ne.beats[2],ne.volumesPerNotePitch?R=ne.volumesPerNotePitch:R=[];break;case"vol":b=ne.volume;break;case"volinc":A=ne.volume;break;case"beataccents":m=ne.value;break;case"gchord":case"bassprog":case"chordprog":case"bassvol":case"chordvol":case"gchordbars":h.paramChange(ne);break;default:console.log("MIDI creation. Unknown el_type: "+ne.el_type+`
|
|
90
|
-
`);break}}p[0].instrument===void 0&&(p[0].instrument=g||0),l&&p.unshift(l),c.push(p),h.finish(),M.length>0}return W.detuneOctave&&Oe(c,parseInt(W.detuneOctave,10)),h.addTrack(c),M.length>0&&c.push(M),{tempo:u,instrument:g,tracks:c,totalDuration:o}};function w(Z){for(var W=p.length-1;W>=0;W--)if(p[W].cmd==="program"){p[W].channel=Z;return}}function C(Z){return Z/1e6}function S(Z){return Math.round(Z*f*1e6)/1e6}function q(Z,W){for(var H=0;H<Z.length;H++){for(var j=Z[H],Q={},re=W.qpm,ie=0,ge=1,ne=0;ne<j.length;ne++){var ue=j[ne];if(ue.el_type==="tempo"){re?ge=ue.qpm?re/ue.qpm:1:re=ue.qpm;continue}ue.time=ie;var Ee=ue.duration?ue.duration:0;if(ie+=Math.round(Ee*ge*1e6),ue.pitches){for(var qe=0;qe<ue.pitches.length;qe++){var pe=ue.pitches[qe];if(pe){if(pe.duration=ue.duration,pe.startTie)Q[pe.pitch]===void 0?Q[pe.pitch]={el:ne,pitch:qe}:(j[Q[pe.pitch].el].pitches[Q[pe.pitch].pitch].duration+=pe.duration,ue.pitches[qe]=null);else if(pe.endTie){var be=Q[pe.pitch];if(be){var $e=pe.duration;delete j[be.el].pitches[be.pitch].startTie,j[be.el].pitches[be.pitch].duration+=$e,ue.pitches[qe]=null,delete Q[pe.pitch]}else delete pe.endTie}}}delete ue.duration}}for(var ve in Q)if(Q.hasOwnProperty(ve)){var rt=Q[ve];delete j[rt.el].pitches[rt.pitch].startTie}}}function D(Z){switch(parseInt(Z.den,10)){case 2:return .5;case 4:return .25;case 8:return Z.num%3===0?.375:.125;case 16:return .125}return .25}function $(Z,W,H){var j=H-Z;return j/W}function F(Z,W,H){if(W)return 0;let j=_,Q=k,re=x;H!==void 0&&R.length>=H+1&&(j=R[H][0],Q=R[H][1],re=R[H][2]);var ie;if(b!==void 0)ie=b,b=void 0;else if(!m)ie=Q;else if(E>Z)ie=re;else{var ge=$(y,D(s),Z);ge===0?ie=j:parseInt(ge,10)===ge?ie=Q:ie=re}return A&&(ie+=A,A=void 0),ie<0&&(ie=0),ie>127&&(ie=127),W?0:ie}function K(Z,W){var H={};if(Z.decoration)for(var j=0;j<Z.decoration.length;j++)Z.decoration[j]==="staccato"?H.thisBreakBetweenNotes="staccato":Z.decoration[j]==="tenuto"?H.thisBreakBetweenNotes="tenuto":Z.decoration[j]==="accent"?H.velocity=Math.min(127,W*1.5):Z.decoration[j]==="trill"?H.noteModification="trill":Z.decoration[j]==="lowermordent"?H.noteModification="lowermordent":Z.decoration[j]==="uppermordent"?H.noteModification="pralltriller":Z.decoration[j]==="mordent"?H.noteModification="mordent":Z.decoration[j]==="turn"?H.noteModification="turn":Z.decoration[j]==="roll"?H.noteModification="roll":Z.decoration[j]==="pralltriller"?H.noteModification="pralltriller":Z.decoration[j]==="trillh"&&(H.noteModification="trillh");return H}function te(Z,W){var H=W.start,j=W.duration,Q=S(1/32);switch(Z){case"trill":for(var re=2;j>0;)p.push({cmd:"note",pitch:W.pitch+re,volume:W.volume,start:H,duration:Q,gap:0,instrument:d,style:"decoration"}),re=re===2?0:2,j-=Q,H+=Q;break;case"trillh":for(var re=1;j>0;)p.push({cmd:"note",pitch:W.pitch+re,volume:W.volume,start:H,duration:Q,gap:0,instrument:d,style:"decoration"}),re=re===1?0:1,j-=Q,H+=Q;break;case"pralltriller":p.push({cmd:"note",pitch:W.pitch,volume:W.volume,start:H,duration:Q,gap:0,instrument:d,style:"decoration"}),j-=Q,H+=Q,p.push({cmd:"note",pitch:W.pitch+2,volume:W.volume,start:H,duration:Q,gap:0,instrument:d,style:"decoration"}),j-=Q,H+=Q,p.push({cmd:"note",pitch:W.pitch,volume:W.volume,start:H,duration:j,gap:0,instrument:d});break;case"mordent":case"lowermordent":p.push({cmd:"note",pitch:W.pitch,volume:W.volume,start:H,duration:Q,gap:0,instrument:d,style:"decoration"}),j-=Q,H+=Q,p.push({cmd:"note",pitch:W.pitch-2,volume:W.volume,start:H,duration:Q,gap:0,instrument:d,style:"decoration"}),j-=Q,H+=Q,p.push({cmd:"note",pitch:W.pitch,volume:W.volume,start:H,duration:j,gap:0,instrument:d});break;case"turn":Q=W.duration/4,p.push({cmd:"note",pitch:W.pitch+2,volume:W.volume,start:H,duration:Q,gap:0,instrument:d,style:"decoration"}),p.push({cmd:"note",pitch:W.pitch,volume:W.volume,start:H+Q,duration:Q,gap:0,instrument:d,style:"decoration"}),p.push({cmd:"note",pitch:W.pitch-1,volume:W.volume,start:H+Q*2,duration:Q,gap:0,instrument:d,style:"decoration"}),p.push({cmd:"note",pitch:W.pitch,volume:W.volume,start:H+Q*3,duration:Q,gap:0,instrument:d,style:"decoration"});break;case"roll":for(;j>0;)p.push({cmd:"note",pitch:W.pitch,volume:W.volume,start:H,duration:Q,gap:0,instrument:d,style:"decoration"}),j-=Q*2,H+=Q*2;break}}function V(Z,W){var H=F(C(Z.time),W);h.processChord(Z);var j;if(Z.gracenotes&&Z.pitches&&Z.pitches.length>0&&Z.pitches[0]&&(j=ce(Z.gracenotes,Z.pitches[0].duration),Z.elem&&(Z.elem.midiGraceNotePitches=ee(j,C(Z.time),H*2/3,d))),Z.elem){var Q=C(Z.time),re=Q/I/u*60*1e3;if(Z.elem.currentTrackMilliseconds===void 0)Z.elem.currentTrackMilliseconds=re,Z.elem.currentTrackWholeNotes=Q;else if(Z.elem.currentTrackMilliseconds.length===void 0)Z.elem.currentTrackMilliseconds!==re&&(Z.elem.currentTrackMilliseconds=[Z.elem.currentTrackMilliseconds,re],Z.elem.currentTrackWholeNotes=[Z.elem.currentTrackWholeNotes,Q]);else{for(var ie=!1,ge=0;ge<Z.elem.currentTrackMilliseconds.length;ge++)Z.elem.currentTrackMilliseconds[ge]===re&&(ie=!0);ie||(Z.elem.currentTrackMilliseconds.push(re),Z.elem.currentTrackWholeNotes.push(Q))}}if(Z.pitches){var ne="",ue=K(Z,H);ue.thisBreakBetweenNotes&&(ne=ue.thisBreakBetweenNotes),ue.velocity&&(H=ue.velocity);var Ee=Z.pitches;Z.style==="rhythm"&&(Ee=h.setRhythmHead(!0,Z)),Z.elem&&(Z.elem.midiPitches=[]);for(var qe=0;qe<Ee.length;qe++){let Ze=H;!ue.velocity&&Array.isArray(Z.decoration)&&Z.decoration.length>qe&&(Ze=F(C(Z.time),W,qe));var pe=Ee[qe];if(pe){pe.startSlur&&(N+=pe.startSlur.length),pe.endSlur&&(N-=pe.endSlur.length);var be=pe.actualPitch?pe.actualPitch:le(pe);if(d===v&&T){var $e=a(pe);$e&&T[$e]&&(be=T[$e].sound)}var ve={cmd:"note",pitch:be,volume:Ze,start:C(Z.time),duration:S(pe.duration),instrument:d,startChar:Z.elem.startChar,endChar:Z.elem.endChar};if(ve=he(ve),Z.gracenotes&&(ve.duration=ve.duration/2,ve.start=ve.start+ve.duration),Z.elem&&Z.elem.midiPitches.push(ve),ue.noteModification)te(ue.noteModification,ve);else{switch(N>0?ve.endType="tenuto":ne&&(ve.endType=ne),ve.endType){case"tenuto":ve.gap=B;break;case"staccato":var rt=ve.duration*O;ve.gap=u/60*rt;break;default:ve.gap=P;break}p.push(ve)}}}p.length-1}var Ue=ae(Z);o=Math.max(o,C(Z.time)+S(Ue))}function ae(Z){return Z.pitches&&Z.pitches.length>0&&Z.pitches[0]?Z.pitches[0].duration:Z.elem?Z.elem.duration:Z.duration}var oe=[0,2,4,5,7,9,11];function le(Z){if(Z.midipitch!==void 0)return Z.midipitch;var W=Z.pitch;if(Z.accidental)switch(Z.accidental){case"sharp":n[W]=1;break;case"flat":n[W]=-1;break;case"natural":n[W]=0;break;case"dblsharp":n[W]=2;break;case"dblflat":n[W]=-2;break;case"quartersharp":n[W]=.25;break;case"quarterflat":n[W]=-.25;break}var H=de(W)*12+oe[Se(W)]+60;return n[W]!==void 0?H+=n[W]:H+=r[Se(W)],H+=i,H}function J(Z){var W=[0,0,0,0,0,0,0];if(!Z.accidentals)return W;for(var H=0;H<Z.accidentals.length;H++){var j=Z.accidentals[H],Q;switch(j.acc){case"flat":Q=-1;break;case"quarterflat":Q=-.25;break;case"sharp":Q=1;break;case"quartersharp":Q=.25;break;default:Q=0;break}var re=j.note.toLowerCase(),ie=Se(re.charCodeAt(0)-99);W[ie]+=Q}return W}function ce(Z,W){for(var H=0,j=[],Q,re=0;re<Z.length;re++)Q=Z[re],H+=Q.duration;var ie=W/2/H;for(re=0;re<Z.length;re++){Q=Z[re];var ge=le(Q);if(d===v&&T){var ne=a(Q);ne&&T[ne]&&(ge=T[ne].sound)}var ue={pitch:ge,duration:Q.duration*ie};ue=he(ue),j.push(ue)}return j}function ee(Z,W,H,j){var Q=[];H=Math.round(H);for(var re=0;re<Z.length;re++){var ie=Z[re];p.push({cmd:"note",pitch:ie.pitch,volume:H,start:W,duration:ie.duration,gap:0,instrument:j,style:"grace"}),Q.push({pitch:ie.pitch,durationInMeasures:ie.duration,volume:H,instrument:j}),W+=ie.duration}return Q}function he(Z){var W=""+Z.pitch;return W.indexOf(".75")>=0?(Z.pitch=Math.round(Z.pitch),Z.cents=-50):W.indexOf(".25")>=0&&(Z.pitch=Math.round(Z.pitch),Z.cents=50),Z}function de(Z){return Math.floor(Z/7)}function Se(Z){return Z=Z%7,Z<0&&(Z+=7),Z}function we(Z){if(Z.pattern.length===0||Z.on===!1)return{on:!1};for(var W=Z.pattern[0],H=[],j="",Q=0,re=0;re<W.length;re++)if(W[re]==="d"&&Q++,W[re]==="d"||W[re]==="z")j.length!==0?(H.push(j),j=W[re]):j=j+W[re];else{if(j.length===0)return{on:!1};j=j+W[re]}if(j.length!==0&&H.push(j),Z.pattern.length!==Q*2+1)return{on:!1};for(var ie={on:!0,bars:Z.bars,pattern:[]},ge=D(s),ne=0,ue=0;ue<H.length;ue++){j=H[ue];for(var Ee=1,qe=!1,pe=0,be=1;be<j.length;be++)switch(j[be]){case"/":pe!==0&&(Ee*=pe),pe=0,qe=!0;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":pe=pe*10+j[be];break;default:return{on:!1}}qe?(pe===0&&(pe=2),Ee/=pe):pe&&(Ee*=pe),j[0]==="d"?(ie.pattern.push({len:Ee*ge,pitch:Z.pattern[1+ne],velocity:Z.pattern[1+ne+Q]}),ne++):ie.pattern.push({len:Ee*ge,pitch:null})}return L=Z.bars?Z.bars:1,ie}function Re(){if(!(!z||!z.pattern)){for(var Z=z,W=0,H=s.num/s.den,j=0;j<Z.pattern.length;j++)W+=Z.pattern[j].len;var Q=W/L/H;for(j=0;j<Z.pattern.length;j++)Z.pattern[j].len=Z.pattern[j].len/Q;z=Z}}function ze(Z){if(!(M.length===0&&!z.on)){var W=s.num/s.den;if(M.length===0){if(o<W)return;M.push({cmd:"program",channel:Z,instrument:v})}if(z.on)for(var H=y,j=0;j<z.pattern.length;j++){var Q=S(z.pattern[j].len);z.pattern[j].pitch&&M.push({cmd:"note",pitch:z.pattern[j].pitch,volume:z.pattern[j].velocity,start:H,duration:Q,gap:0,instrument:v}),H+=Q}}}function Oe(Z,W){for(var H={},j=0;j<Z.length;j++)for(var Q=0;Q<Z[j].length;Q++){var re=Z[j][Q];re.cmd==="note"&&(H[re.start]===void 0&&(H[re.start]=[]),H[re.start].push({track:j,event:Q,pitch:re.pitch}))}var ie=Object.keys(H);for(j=0;j<ie.length;j++){var ge=H[ie[j]];if(ge.length>1){ge=ge.sort(function(pe,be){return pe.pitch-be.pitch});var ne=ge[ge.length-1],ue=ne.pitch%12,Ee=!1;for(Q=0;!Ee&&Q<ge.length-1;Q++)ge[Q].pitch%12===ue&&(Ee=!0);if(Ee){var qe=Z[ne.track][ne.event];qe.cents||(qe.cents=0),qe.cents+=W}}}}})(),Or=e,Or}var Dr,Wi;function pg(){if(Wi)return Dr;Wi=1;function e(f,g){g||(g={});for(var d=!!g.lineBreaks,p=[],l=!1,o=[],h=[],s=[],v=[],y=[],m=[],_=[],k=0;k<f.length;k++){var x=u(f[k]);if(x.staff){if(l&&!x.vskip)for(var R=p[p.length-1],I=0;I<R.staff.length;I++){var b=x.staff[I],A=R.staff[I];if(b&&(c(b.meter,o[I])||(a(b.meter,b.voices),o[I]=b.meter,delete b.meter),c(b.key,h[I])||(n(b.key,b.voices),h[I]=b.key,delete b.key),b.title&&(A.abbrevTitle=b.title),c(b.clef,s[I])||(r(b.clef,b.voices),s[I]=b.clef,delete b.clef),c(b.vocalfont,v[I])||(i(b.vocalfont,b.voices,"vocalfont"),v[I]=b.vocalfont,delete b.vocalfont),c(b.gchordfont,y[I])||(i(b.gchordfont,b.voices,"gchordfont"),y[I]=b.gchordfont,delete b.gchordfont),c(b.tripletfont,m[I])||(i(b.tripletfont,b.voices,"tripletfont"),m[I]=b.tripletfont,delete b.tripletfont),c(b.annotationfont,_[I])||(i(b.annotationfont,b.voices,"annotationfont"),_[I]=b.annotationfont,delete b.annotationfont)),b)for(var N=0;N<A.voices.length;N++){var M=A.voices[N],z=b.voices[N];d&&M.push({el_type:"break"}),z&&(A.voices[N]=M.concat(z))}}else{for(var L=0;L<x.staff.length;L++)h[L]=x.staff[L].key,o[L]=x.staff[L].meter,s[L]=x.staff[L].clef;p.push(u(x))}l=!0}else l=!1,p.push(x)}return p}function t(f,g){return f==="abselem"?"abselem":g}function a(f,g){f.el_type="meter",f.startChar=-1,f.endChar=-1;for(var d=0;d<g.length;d++)g[d].unshift(f)}function n(f,g){f.el_type="key",f.startChar=-1,f.endChar=-1;for(var d=0;d<g.length;d++)g[d].unshift(f)}function r(f,g){f.el_type="clef",f.startChar=-1,f.endChar=-1;for(var d=0;d<g.length;d++)g[d].unshift(f)}function i(f,g,d){f.el_type="font",f.type=d,f.startChar=-1,f.endChar=-1;for(var p=0;p<g.length;p++)g[p].unshift(f)}function c(f,g){if(!f)return!0;var d=JSON.stringify(f,t),p=JSON.stringify(g,t);return d===p}function u(f){for(var g={},d=Object.keys(f),p=0;p<d.length;p++)if(d[p]!=="staff")g[d[p]]=f[d[p]];else{g.staff=[];for(var l=0;l<f.staff.length;l++){for(var o={},h=Object.keys(f.staff[l]),s=0;s<h.length;s++)if(h[s]!=="voices")o[h[s]]=f.staff[l][h[s]];else{o.voices=[];for(var v=0;v<f.staff[l].voices.length;v++)o.voices.push([].concat(f.staff[l].voices[v]))}g.staff.push(o)}}return g}return Dr=e,Dr}var Fr,Vi;function Tl(){if(Vi)return Fr;Vi=1;var e=nt(),t=Ve(),a=Cl(),n=dg(),r=pg(),i=function(){this.reset=function(){this.version="1.1.0",this.media="screen",this.metaText={},this.metaTextInfo={},this.formatting={},this.lines=[],this.staffNum=0,this.voiceNum=0,this.lineNum=0,this.runningFonts={},delete this.visualTranspose},this.reset();function c(l,o,h,s){for(var v=0;v<s.length;v++)l[h][s[v]]=o[h][s[v]]}this.copyTopInfo=function(l){var o=["tempo","title","header","rhythm","origin","composer","author","partOrder"];c(this,l,"metaText",o),c(this,l,"metaTextInfo",o)},this.copyBottomInfo=function(l){var o=["unalignedWords","book","source","discography","notes","transcription","history","abc-copyright","abc-creator","abc-edited-by","footer"];c(this,l,"metaText",o),c(this,l,"metaTextInfo",o)},this.getBeatLength=function(){var l=this.getMeterFraction(),o=1;return l.num===6||l.num===9||l.num===12||l.num===3&&l.den===8?o=3:l.den===8&&(l.num===5||l.num===7)&&(o=2),o/l.den};function u(l,o){for(var h=0,s=0;s<l.length;s++)if(l[s].staff)for(var v=0;v<l[s].staff.length;v++)for(var y=0;y<l[s].staff[v].voices.length;y++)for(var m=l[s].staff[v].voices[y],_=1,k=0;k<m.length;k++){var x=m[k].rest&&m[k].rest.type==="spacer";if(m[k].startTriplet&&(_=m[k].tripletMultiplier),m[k].duration&&!x&&m[k].el_type!=="tempo"&&(h+=m[k].duration*_),m[k].endTriplet&&(_=1),h>=o&&(h-=o),m[k].el_type==="bar")return h}return h}this.getPickupLength=function(){var l=this.getBarLength(),o=u(this.lines,l);return o<1e-8||l-o<1e-8?0:o},this.getBarLength=function(){var l=this.getMeterFraction();return l.num/l.den},this.getTotalTime=function(){return this.totalTime},this.getTotalBeats=function(){return this.totalBeats},this.millisecondsPerMeasure=function(l){var o;if(l)o=l;else{var h=this.metaText?this.metaText.tempo:null;o=this.getBpm(h)}o<=0&&(o=1);var s=this.getBeatsPerMeasure(),v=s/o;return v*6e4},this.getBeatsPerMeasure=function(){var l=this.getBeatLength(),o=this.getBarLength();return o/l},this.getMeter=function(){for(var l=0;l<this.lines.length;l++){var o=this.lines[l];if(o.staff)for(var h=0;h<o.staff.length;h++){var s=o.staff[h].meter;if(s)return s}}return{type:"common_time"}},this.getMeterFraction=function(){var l=this.getMeter(),o=4,h=4;if(l)if(l.type==="specified"){if(l.value&&l.value.length>0&&l.value[0].num.indexOf("+")>0){var s=l.value[0].num.split("+");o=0;for(var v=0;v<s.length;v++)o+=parseInt(s[v],10)}else o=parseInt(l.value[0].num,10);h=parseInt(l.value[0].den,10)}else l.type==="cut_time"?(o=2,h=2):l.type==="common_time"&&(o=4,h=4);return this.meter={num:o,den:h},this.meter},this.getKeySignature=function(){for(var l=0;l<this.lines.length;l++){var o=this.lines[l];if(o.staff){for(var h=0;h<o.staff.length;h++)if(o.staff[h].key)return o.staff[h].key}}return{}},this.getElementFromChar=function(l){for(var o=0;o<this.lines.length;o++){var h=this.lines[o];if(h.staff)for(var s=0;s<h.staff.length;s++)for(var v=h.staff[s],y=0;y<v.voices.length;y++)for(var m=v.voices[y],_=0;_<m.length;_++){var k=m[_];if(k.startChar&&k.endChar&&k.startChar<=l&&k.endChar>l)return k}}return null};function f(l){for(var o,h,s,v,y=l.length-1;y>=0;y--){var m=l[y];m.type==="bar"?(m.top=s,m.nextTop=o,o=s,m.bottom=v,m.nextBottom=h,h=v):m.type==="event"&&(s=m.top,v=m.top+m.height)}}function g(l){var o=[];for(var h in l)l.hasOwnProperty(h)&&o.push(l[h]);return o=o.sort(function(s,v){var y=s.milliseconds-v.milliseconds;return y!==0?y:s.type==="bar"?-1:1}),o}this.addElementToEvents=function(l,o,h,s,v,y,m,_,k,x){if(o.hint)return{isTiedState:void 0,duration:0};var R=o.durationClass?o.durationClass:o.duration;if(o.abcelem.rest&&o.abcelem.rest.type==="spacer"&&(R=0),R>0){for(var I=[],b=0;b<o.elemset.length;b++)o.elemset[b]!==null&&I.push(o.elemset[b]);var A=o.startTie;if(k!==void 0)l["event"+k].elements.push(I),x&&(l["event"+h]||(l["event"+h]={type:"event",milliseconds:h,line:y,measureNumber:m,top:s,height:v,left:null,width:0,elements:[],startChar:null,endChar:null,startCharArray:[],endCharArray:[]}),l["event"+h].measureStart=!0,x=!1),A||(k=void 0);else{if(!l["event"+h])l["event"+h]={type:"event",milliseconds:h,line:y,measureNumber:m,top:s,height:v,left:o.x,width:o.w,elements:[I],startChar:o.abcelem.startChar,endChar:o.abcelem.endChar,startCharArray:[o.abcelem.startChar],endCharArray:[o.abcelem.endChar],midiPitches:o.abcelem.midiPitches?e.cloneArray(o.abcelem.midiPitches):[]},o.abcelem.midiGraceNotePitches&&(l["event"+h].midiGraceNotePitches=e.cloneArray(o.abcelem.midiGraceNotePitches));else{if(l["event"+h].left?l["event"+h].left=Math.min(l["event"+h].left,o.x):l["event"+h].left=o.x,l["event"+h].elements.push(I),l["event"+h].startCharArray.push(o.abcelem.startChar),l["event"+h].endCharArray.push(o.abcelem.endChar),l["event"+h].startChar===null&&(l["event"+h].startChar=o.abcelem.startChar),l["event"+h].endChar===null&&(l["event"+h].endChar=o.abcelem.endChar),o.abcelem.midiPitches&&o.abcelem.midiPitches.length){l["event"+h].midiPitches||(l["event"+h].midiPitches=[]);for(var b=0;b<o.abcelem.midiPitches.length;b++)l["event"+h].midiPitches.push(o.abcelem.midiPitches[b])}if(o.abcelem.midiGraceNotePitches&&o.abcelem.midiGraceNotePitches.length){l["event"+h].midiGraceNotePitches||(l["event"+h].midiGraceNotePitches=[]);for(var N=0;N<o.abcelem.midiGraceNotePitches.length;N++)l["event"+h].midiGraceNotePitches.push(o.abcelem.midiGraceNotePitches[N])}}x&&(l["event"+h].measureStart=!0,x=!1)}}return{isTiedState:k,duration:R/_,nextIsBar:x||o.type==="bar"}},this.makeVoicesArray=function(){for(var l=[],o=[],h={},s=0;s<this.engraver.staffgroups.length;s++){var v=this.engraver.staffgroups[s];if(v&&v.staffs&&v.staffs.length>0){var y=v.staffs[0],m=y.absoluteY,_=m-y.top*t.STEP,k=v.staffs[v.staffs.length-1];m=k.absoluteY;for(var x=m-k.bottom*t.STEP,R=x-_,I=v.voices,b=0;b<I.length;b++)if(!(I[b].staff&&I[b].staff.isTabStaff)){var A=!1;l[b]||(l[b]=[]),o[b]===void 0&&(o[b]=0);for(var N=I[b].children,M=0;M<N.length;M++)N[M].type==="tempo"&&(h[o[b]]=this.getBpm(N[M].abcelem)),l[b].push({top:_,height:R,line:v.line,measureNumber:o[b],elem:N[M]}),N[M].type==="bar"&&A&&o[b]++,(N[M].type==="note"||N[M].type==="rest")&&(A=!0)}}}return this.tempoLocations=h,l},this.setupEvents=function(l,o,h,s){s||(s=1);for(var v=[],y={},m=l,_,k=!0,x=this.makeVoicesArray(),R=0,I=0;I<x.length;I++){var b=m,A=Math.round(b*1e3),N=0,M=-1,z=x[I],L=h;o=this.getBeatLength()*L/60;for(var E=-1,T=0;T<z.length;T++){var P=z[T].measureNumber;E!==P&&this.tempoLocations[P]&&(L=this.tempoLocations[P],o=s*this.getBeatLength()*L/60,E=P);var B=z[T].elem,O=this.addElementToEvents(y,B,A,z[T].top,z[T].height,z[T].line,z[T].measureNumber,o,_,k);_=O.isTiedState,k=O.nextIsBar,b+=O.duration;var w;if(B.duration>0&&y["event"+A]&&(w="event"+A),A=Math.round(b*1e3),B.type==="bar"){var C=B.abcelem.type,S=C==="bar_right_repeat"||C==="bar_dbl_repeat",q=B.abcelem.startEnding==="1",D=C==="bar_left_repeat"||C==="bar_dbl_repeat"||C==="bar_right_repeat";if(S){T>0&&(y[w].endX=B.x),M===-1&&(M=T);var $=0;E=-1;for(var F=N;F<M;F++){P=z[F].measureNumber,E!==P&&this.tempoLocations[P]&&(L=this.tempoLocations[P],o=s*this.getBeatLength()*L/60,E=P);var K=z[F].elem;O=this.addElementToEvents(y,K,A,z[F].top,z[F].height,z[F].line,z[F].measureNumber,o,_,k),_=O.isTiedState,k=O.nextIsBar,b+=O.duration,$=A,A=Math.round(b*1e3)}y["event"+$]&&(y["event"+$].endX=z[M].elem.x),k=!0,M=-1}q&&(M=T),D&&(N=T)}}R=Math.max(R,A)}return v=g(y),f(v),p(this.lines,v),v.push({type:"end",milliseconds:R}),this.addUsefulCallbackInfo(v,L*s),v},this.addUsefulCallbackInfo=function(l,o){for(var h=this.millisecondsPerMeasure(o),s=0;s<l.length;s++){var v=l[s];v.millisecondsPerMeasure=h}};function d(l,o){for(;o<l.length&&l[o].left===null;)o++;return l[o]}function p(l,o){if(!(o.length<1)){for(var h=0;h<o.length-1;h++){var s=o[h],v=d(o,h+1);if(s.left!==null){var y=v&&s.top===v.top?v.left:l[s.line].staffGroup.w;s.endX!==void 0?y>s.left&&(s.endX=Math.min(s.endX,y)):s.endX=y}}var m=o[o.length-1];m.endX=l[m.line].staffGroup.w}}this.getBpm=function(l){var o;if(l||(l=this.metaText?this.metaText.tempo:null),l){o=l.bpm;var h=this.getBeatLength(),s=l.duration&&l.duration.length>0?l.duration[0]:h;o=o*s/h}if(!o){o=180;var v=this.getMeterFraction();v&&v.num!==3&&v.num%3===0&&(o=120)}return o},this.setTiming=function(l,o){if(o=o||0,!this.engraver||!this.engraver.staffgroups)return console.log("setTiming cannot be called before the tune is drawn."),this.noteTimings=[],this.noteTimings;var h=this.metaText?this.metaText.tempo:null,s=this.getBpm(h),v=1;l?h&&(v=l/s):l=s;var y=this.getBeatLength(),m=l/60,_=this.getBarLength(),k=_/y*o/m;k&&(k-=this.getPickupLength()/y/m);var x=y*m;return this.noteTimings=this.setupEvents(k,x,l,v),this.noteTimings.length>0?(this.totalTime=this.noteTimings[this.noteTimings.length-1].milliseconds/1e3,this.totalBeats=this.totalTime*m):(this.totalTime=void 0,this.totalBeats=void 0),this.noteTimings},this.setUpAudio=function(l){l||(l={});var o=a(this,l);return n(o,l,this.formatting.percmap,this.formatting.midi)},this.deline=function(l){return r(this.lines,l)},this.findSelectableElement=function(l){return this.engraver&&this.engraver.selectables?this.engraver.findSelectableElement(l):null},this.getSelectableArray=function(){return this.engraver&&this.engraver.selectables?this.engraver.selectables:[]}};return Fr=i,Fr}var Hr,Xi;function gg(){if(Xi)return Hr;Xi=1;var e=Za(),t=function(b){var A=this,N={},M="";b.reset(),this.setVisualTranspose=function(z){z!==void 0&&(b.visualTranspose=z)},this.cleanUp=function(z,L,E){o(b),delete b.runningFonts,n(b),b.metaText.tempo&&b.metaText.tempo.bpm&&!b.metaText.tempo.duration&&(b.metaText.tempo.duration=[b.getBeatLength()]);var T=!1,P,B,O;for(P=0;P<b.lines.length;P++)if(b.lines[P].staff!==void 0){var w=!1;for(B=0;B<b.lines[P].staff.length;B++)if(b.lines[P].staff[B]===void 0)T=!0,b.lines[P].staff[B]=null;else for(O=0;O<b.lines[P].staff[B].voices.length;O++)b.lines[P].staff[B].voices[O]===void 0?b.lines[P].staff[B].voices[O]=[]:h(b.lines[P].staff[B].voices[O])&&(w=!0);w||(b.lines[P]=null,T=!0)}if(T&&(b.lines=b.lines.filter(function(F){return!!F}),b.lines.forEach(function(F){F.staff&&(F.staff=F.staff.filter(function(K){return!!K}))})),z)for(;f(b.lines,z););if(L){for(T=!1,P=0;P<b.lines.length;P++)if(b.lines[P].staff!==void 0)for(B=0;B<b.lines[P].staff.length;B++){var C=!1;for(O=0;O<b.lines[P].staff[B].voices.length;O++)s(b.lines[P].staff[B].voices[O])&&(C=!0);C||(T=!0,b.lines[P].staff[B]=null)}T&&b.lines.forEach(function(F){F.staff&&(F.staff=F.staff.filter(function(K){return!!K}))})}for(c(b.lines),P=0;P<b.lines.length;P++)if(b.lines[P].staff)for(B=0;B<b.lines[P].staff.length;B++)delete b.lines[P].staff[B].workingClef;for(;r(b););for(var P=0;P<b.lines.length;P++){var S=b.lines[P].staff;if(S)for(b.staffNum=0;b.staffNum<S.length;b.staffNum++)for(S[b.staffNum].clef&&e.fixClef(S[b.staffNum].clef),b.voiceNum=0;b.voiceNum<S[b.staffNum].voices.length;b.voiceNum++){var q=S[b.staffNum].voices[b.voiceNum];u(q,b.staffNum,b.voiceNum,E);for(var D=0;D<q.length;D++)q[D].el_type==="clef"&&e.fixClef(q[D]);if(q.length>0&&q[q.length-1].barNumber){var $=d(b.lines,P);$&&($.staff[0].barNumber=q[q.length-1].barNumber),delete q[q.length-1].barNumber}}}return delete b.staffNum,delete b.voiceNum,delete b.lineNum,delete b.potentialStartBeam,delete b.potentialEndBeam,delete b.vskipPending,E},this.addTieToLastNote=function(z){var L=p(b);return L&&L.pitches&&L.pitches.length>0?(L.pitches[0].startTie={},z&&(L.pitches[0].startTie.style="dotted"),!0):!1},this.appendElement=function(z,L,E,T){if(T.el_type=z,L!==null&&(T.startChar=L),E!==null&&(T.endChar=E),z==="note"){var P=l(T);P>=.25||T.force_end_beam_last&&b.potentialStartBeam!==void 0?_(b):T.end_beam&&b.potentialStartBeam!==void 0?T.rest===void 0?m(T,b):_(b):T.rest===void 0&&(b.potentialStartBeam===void 0?T.end_beam||(b.potentialStartBeam=T,delete b.potentialEndBeam):b.potentialEndBeam=T)}else _(b);return delete T.end_beam,delete T.force_end_beam_last,T.rest&&T.rest.type==="invisible"&&delete T.decoration,b.lines.length<=b.lineNum||b.lines[b.lineNum].staff.length<=b.staffNum?!1:(y(A,b,T,N,M),!0)},this.appendStartingElement=function(z,L,E,T){o(b);var P;z==="key"&&(P=T.impliedNaturals,delete T.impliedNaturals,delete T.explicitAccidentals);var B=Object.assign({},T);if(b.lines[b.lineNum]){var O=b.lines[b.lineNum].staff;if(O){O.length<=b.staffNum&&(O[b.staffNum]={},O[b.staffNum].clef=Object.assign({},O[0].clef),O[b.staffNum].key=Object.assign({},O[0].key),O[0].meter&&(O[b.staffNum].meter=Object.assign({},O[0].meter)),O[b.staffNum].workingClef=Object.assign({},O[0].workingClef),O[b.staffNum].voices=[[]]),z==="clef"&&(O[b.staffNum].workingClef=B);for(var w=O[b.staffNum].voices[b.voiceNum],C=0;C<w.length;C++){if(w[C].el_type==="note"||w[C].el_type==="bar"){B.el_type=z,B.startChar=L,B.endChar=E,P&&(B.accidentals=P.concat(B.accidentals)),w.push(B);return}if(w[C].el_type===z){B.el_type=z,B.startChar=L,B.endChar=E,P&&(B.accidentals=P.concat(B.accidentals)),w[C]=B;return}}O[b.staffNum][z]=T}}},this.addSubtitle=function(z,L){v(b,{subtitle:{text:z,startChar:L.startChar,endChar:L.endChar}})},this.addSpacing=function(z){b.vskipPending=z},this.addNewPage=function(z){v(b,{newpage:z})},this.addSeparator=function(z,L,E,T){v(b,{separator:{spaceAbove:Math.round(z),spaceBelow:Math.round(L),lineLength:Math.round(E),startChar:T.startChar,endChar:T.endChar}})},this.addText=function(z,L){v(b,{text:{text:z,startChar:L.startChar,endChar:L.endChar}})},this.addCentered=function(z){v(b,{text:[{text:z,center:!0}]})},this.changeVoiceScale=function(z){A.appendElement("scale",null,null,{size:z})},this.changeVoiceColor=function(z){A.appendElement("color",null,null,{color:z})},this.startNewLine=function(z){o(b),z.currentVoiceName&&(M=z.currentVoiceName,N[z.currentVoiceName]=z),b.lines[b.lineNum]===void 0?I(A,b,z):b.lines[b.lineNum].staff===void 0?(b.lineNum++,this.startNewLine(z)):b.lines[b.lineNum].staff[b.staffNum]===void 0?R(A,b,z):b.lines[b.lineNum].staff[b.staffNum].voices[b.voiceNum]===void 0?x(A,b,z):h(b.lines[b.lineNum].staff[b.staffNum].voices[b.voiceNum])?(b.lineNum++,this.startNewLine(z)):z.part&&A.appendElement("part",z.part.startChar,z.part.endChar,{title:z.part.title})},this.setRunningFont=function(z,L){b.runningFonts[z]=L},this.setBarNumberImmediate=function(z){var L=this.getCurrentVoice();if(L&&L.length>0){var E=L[L.length-1];if(E.el_type==="bar")E.barNumber!==void 0&&(E.barNumber=z);else return z-1}return z},this.hasBeginMusic=function(){for(var z=0;z<b.lines.length;z++)if(b.lines[z].staff)return!0;return!1},this.isFirstLine=function(z){for(var L=z-1;L>=0;L--)if(b.lines[L].staff!==void 0)return!1;return!0},this.getCurrentVoice=function(){var z=g(b.lines,b.lineNum);if(!z)return null;var L=z.staff[b.staffNum];return L&&L.voices[b.voiceNum]!==void 0?L.voices[b.voiceNum]:null},this.setCurrentVoice=function(z,L,E){b.staffNum=z,b.voiceNum=L,M=E;for(var T=0;T<b.lines.length;T++)if(b.lines[T].staff&&(b.lines[T].staff[z]===void 0||b.lines[T].staff[z].voices[L]===void 0||!h(b.lines[T].staff[z].voices[L])))return b.lineNum=T,!!(!b.lines[T].staff[z]||b.lines[T].staff[z].voices[L]);return b.lineNum=T,!1},this.addMetaText=function(z,L,E){b.metaText[z]===void 0?(b.metaText[z]=L,b.metaTextInfo[z]=E):(typeof b.metaText[z]=="string"&&typeof L=="string"?b.metaText[z]+=`
|
|
88
|
+
`+ae);oe===!1&&(V[2]===null&&V[3]?x.chord.push({name:ae,rel_position:V[3]}):x.chord.push({name:ae,position:V[2]})),C+=V[0];var J=a.skipWhiteSpace(w.substring(C));J>0&&(x.force_end_beam_last=!0),C+=J}else if(o.indexOf(w[C])===-1?V=M(w,C):V=[0],V[0]>0)V[1]===null?C+1<w.length&&this.startNewLine():V[1].length>0&&(V[1].indexOf("style=")===0?x.style=V[1].substr(6):(x.decoration===void 0&&(x.decoration=[]),V[1]==="beambr1"?x.beambr=1:V[1]==="beambr2"?x.beambr=2:x.decoration.push(V[1]))),C+=V[0];else if(V=b(w,C),V[0]>0)x.gracenotes=V[1],C+=V[0];else break;if(V=L(w,C),V[0]>0){F=0,x.gracenotes!==void 0&&(x.rest={type:"spacer"},x.duration=.125,r.addFormattingOptions(x,i.formatting,"note"),c.appendElement("note",S+C,S+C+V[0],x),r.measureNotEmpty=!0,x={});var ce={type:V[1]};ce.type.length===0?n("Unknown bar type",w,C):(r.inEnding&&ce.type!=="bar_thin"&&(ce.endEnding=!0,r.inEnding=!1),V[2]&&(ce.startEnding=V[2],r.inEnding&&(ce.endEnding=!0),r.inEnding=!0,V[1]==="bar_right_repeat"?r.restoreStartEndingHoldOvers():r.duplicateStartEndingHoldOvers()),x.decoration!==void 0&&(ce.decoration=x.decoration),x.chord!==void 0&&(ce.chord=x.chord),ce.startEnding&&r.barFirstEndingNum===void 0?r.barFirstEndingNum=r.currBarNumber:ce.startEnding&&ce.endEnding&&r.barFirstEndingNum?r.currBarNumber=r.barFirstEndingNum:ce.endEnding&&(r.barFirstEndingNum=void 0),ce.type!=="bar_invisible"&&r.measureNotEmpty&&O()&&(r.currBarNumber++,r.barNumbers&&r.currBarNumber%r.barNumbers===0&&(ce.barNumber=r.currBarNumber)),r.addFormattingOptions(x,i.formatting,"bar"),c.appendElement("bar",S+K,S+C+V[0],ce),r.measureNotEmpty=!1,x={}),C+=V[0]}else if(w[C]==="&")V=A(w,C),V[0]>0&&(c.appendElement("overlay",S,S+1,{}),C+=1,F++);else{if(V=E(w,C),V.consumed>0&&(V.startSlur!==void 0&&(x.startSlur=V.startSlur),V.dottedSlur&&(x.dottedSlur=!0),V.triplet!==void 0&&(D>0?n("Can't nest triplets",w,C):(x.startTriplet=V.triplet,x.tripletMultiplier=V.tripletQ/V.triplet,x.tripletR=V.num_notes,D=V.num_notes===void 0?V.triplet:V.num_notes)),C+=V.consumed),w[C]==="["){C++;for(var ee=null,he=!1,de=!1;!de;){var Se=M(w,C);Se[0]>0&&(C+=Se[0]);var we=P(w,C,{},!1);if(we!==null&&we.pitch!==void 0)Se[0]>0&&Se[1].indexOf("style=")!==0&&(x.decoration===void 0&&(x.decoration=[]),x.decoration.push(Se[1])),we.end_beam&&(x.end_beam=!0,delete we.end_beam),x.pitches===void 0?(x.duration=we.duration,x.pitches=[we]):x.pitches.push(we),delete we.duration,Se[0]>0&&Se[1].indexOf("style=")===0&&(x.pitches[x.pitches.length-1].style=Se[1].substr(6)),r.inTieChord[x.pitches.length]&&(we.endTie=!0,r.inTieChord[x.pitches.length]=void 0),we.startTie&&(r.inTieChord[x.pitches.length]=!0),C=we.endChar,delete we.endChar;else if(w[C]===" ")n("Spaces are not allowed in chords",w,C),C++;else{if(C<w.length&&w[C]==="]"){C++,r.next_note_duration!==0&&(x.duration=x.duration*r.next_note_duration,r.next_note_duration=0),k(r,F,x)&&(x.pitches.forEach(function(Q){Q.endTie=!0}),R(r,F,!1)),D>0&&!(x.rest&&x.rest.type==="spacer")&&(D--,D===0&&(x.endTriplet=!0));for(var Re=!1;C<w.length&&!Re;){switch(w[C]){case" ":case" ":T(x);break;case")":x.endSlur===void 0?x.endSlur=1:x.endSlur++;break;case"-":x.pitches.forEach(function(Q){Q.startTie={}}),R(r,F,!0);break;case">":case"<":var ze=B(w,C);C+=ze[0]-1,r.next_note_duration=ze[2],ee?ee=ee*ze[1]:ee=ze[1];break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"/":var Oe=a.getFraction(w,C);ee=Oe.value,C=Oe.index;var Z=w[C];Z===" "&&(he=!0),Z==="-"||Z===")"||Z===" "||Z==="<"||Z===">"?C--:Re=!0;break;case"0":ee=0;break;default:Re=!0;break}Re||C++}}else n("Expected ']' to end the chords",w,C);x.pitches!==void 0&&(ee!==null&&(x.duration=x.duration*ee,he&&T(x)),r.addFormattingOptions(x,i.formatting,"note"),c.appendElement("note",S+K,S+C,x),r.measureNotEmpty=!0,x={}),de=!0}}}else{var W={},H=P(w,C,W,!0);if(W.endTie!==void 0&&R(r,F,!0),H!==null){H.pitch!==void 0?(x.pitches=[{}],H.accidental!==void 0&&(x.pitches[0].accidental=H.accidental),x.pitches[0].pitch=H.pitch,x.pitches[0].name=H.name,(H.midipitch||H.midipitch===0)&&(x.pitches[0].midipitch=H.midipitch),H.endSlur!==void 0&&(x.pitches[0].endSlur=H.endSlur),H.endTie!==void 0&&(x.pitches[0].endTie=H.endTie),H.startSlur!==void 0&&(x.pitches[0].startSlur=H.startSlur),x.startSlur!==void 0&&(x.pitches[0].startSlur=x.startSlur),x.dottedSlur!==void 0&&(x.pitches[0].dottedSlur=!0),H.startTie!==void 0&&(x.pitches[0].startTie=H.startTie),x.startTie!==void 0&&(x.pitches[0].startTie=x.startTie)):(x.rest=H.rest,H.rest.type==="multimeasure"&&O()&&(r.currBarNumber+=H.rest.text-1),H.endSlur!==void 0&&(x.endSlur=H.endSlur),H.endTie!==void 0&&(x.rest.endTie=H.endTie),H.startSlur!==void 0&&(x.startSlur=H.startSlur),H.startTie!==void 0&&(x.rest.startTie=H.startTie),x.startTie!==void 0&&(x.rest.startTie=x.startTie)),H.chord!==void 0&&(x.chord=H.chord),H.duration!==void 0&&(x.duration=H.duration),H.decoration!==void 0&&(x.decoration=H.decoration),H.graceNotes!==void 0&&(x.graceNotes=H.graceNotes),delete x.startSlur,delete x.dottedSlur,k(r,F,x)&&(x.pitches!==void 0?x.pitches[0].endTie=!0:x.rest.type!=="spacer"&&(x.rest.endTie=!0),R(r,F,!1)),(H.startTie||x.startTie)&&R(r,F,!0),C=H.endChar,D>0&&!(H.rest&&H.rest.type==="spacer")&&(D--,D===0&&(x.endTriplet=!0)),H.end_beam&&T(x),x.rest&&x.rest.type==="rest"&&x.duration===1&&N(r)<=1&&(x.rest.type="whole",x.duration=N(r)),x.duration<1&&h.indexOf(x.duration)===-1&&x.duration!==0&&(!x.rest||x.rest.type!=="spacer")&&n("Duration not representable: "+w.substring(K,C),w,C),r.addFormattingOptions(x,i.formatting,"note");var Y=c.appendElement("note",S+K,S+C,x);Y||(this.startNewLine(),c.appendElement("note",S+K,S+C,x)),r.measureNotEmpty=!0,x={}}}C===K&&(w[C]!==" "&&w[C]!=="`"&&n("Unknown character ignored",w,C),C++)}}}this.lineContinuation=w.indexOf("")>=0||$[0]>0,this.lineContinuation||(x={})}};var R=function(w,C,S){var q=w.currentVoice?w.currentVoice.staffNum*100+w.currentVoice.index:0;w.inTie[C]===void 0&&(w.inTie[C]=[]),w.inTie[C][q]=S},I=function(w,C){if(w[C]==='"'){var S=a.getBrackettedSubstring(w,C,5);if(S[2]||n("Missing the closing quote while parsing the chord symbol",w,C),S[0]>0&&S[1].length>0&&S[1][0]==="^")S[1]=S[1].substring(1),S[2]="above";else if(S[0]>0&&S[1].length>0&&S[1][0]==="_")S[1]=S[1].substring(1),S[2]="below";else if(S[0]>0&&S[1].length>0&&S[1][0]==="<")S[1]=S[1].substring(1),S[2]="left";else if(S[0]>0&&S[1].length>0&&S[1][0]===">")S[1]=S[1].substring(1),S[2]="right";else if(S[0]>0&&S[1].length>0&&S[1][0]==="@"){S[1]=S[1].substring(1);var q=a.getFloat(S[1]);if(q.digits===0)return n("Missing first position in absolutely positioned annotation.",w,C),S[1]=S[1].replace("@",""),S[2]="above",S;if(S[1]=S[1].substring(q.digits),S[1][0]!==",")return n("Missing comma absolutely positioned annotation.",w,C),S[1]=S[1].replace("@",""),S[2]="above",S;S[1]=S[1].substring(1);var D=a.getFloat(S[1]);if(D.digits===0)return n("Missing second position in absolutely positioned annotation.",w,C),S[1]=S[1].replace("@",""),S[2]="above",S;S[1]=S[1].substring(D.digits);var $=a.skipWhiteSpace(S[1]);S[1]=S[1].substring($),S[2]=null,S[3]={x:q.value,y:D.value}}else r.freegchord!==!0&&(S[1]=S[1].replace(/([ABCDEFG0-9])b/g,"$1♭"),S[1]=S[1].replace(/([ABCDEFG0-9])#/g,"$1♯"),S[1]=S[1].replace(/^([ABCDEFG])([♯♭]?)o([^A-Za-z])/g,"$1$2°$3"),S[1]=S[1].replace(/^([ABCDEFG])([♯♭]?)o$/g,"$1$2°"),S[1]=S[1].replace(/^([ABCDEFG])([♯♭]?)0([^A-Za-z])/g,"$1$2ø$3"),S[1]=S[1].replace(/^([ABCDEFG])([♯♭]?)\^([^A-Za-z])/g,"$1$2∆$3")),S[2]="default",S[1]=t.chordName(r,S[1]);return S}return[0,""]},b=function(w,C){if(w[C]==="{"){var S=a.getBrackettedSubstring(w,C,1,"}");S[2]||n("Missing the closing '}' while parsing grace note",w,C),w[C+S[0]]===")"&&(S[0]++,S[1]+=")");for(var q=[],D=0,$=!1;D<S[1].length;){var F=!1;S[1][D]==="/"&&(F=!0,D++);var K=P(S[1],D,{},!1);K!==null?(K.duration=K.duration/(r.default_length*8),F&&(K.acciaccatura=!0),K.rest?n("Rests not allowed as grace notes '"+S[1][D]+"' while parsing grace note",w,C):q.push(K),$&&(K.endTie=!0,$=!1),K.startTie&&($=!0),D=K.endChar,delete K.endChar,K.end_beam&&(K.endBeam=!0,delete K.end_beam)):(S[1][D]===" "?q.length>0&&(q[q.length-1].endBeam=!0):n("Unknown character '"+S[1][D]+"' while parsing grace note",w,C),D++)}if(q.length)return[S[0],q]}return[0]};function A(w,C){if(w[C]==="&"){for(var S=C;w[C]&&w[C]!==":"&&w[C]!=="|";)C++;return[C-S,w.substring(S+1,C)]}return[0]}function N(w){var C=w.origMeter;return!C||C.type!=="specified"||!C.value||C.value.length===0?1:parseInt(C.value[0].num,10)/parseInt(C.value[0].den,10)}var M=function(w,C){var S=r.macros[w[C]];if(S!==void 0)return(S[0]==="!"||S[0]==="+")&&(S=S.substring(1)),(S[S.length-1]==="!"||S[S.length-1]==="+")&&(S=S.substring(0,S.length-1)),f.includes(S)?[1,S]:g.includes(S)?(r.volumePosition==="hidden"&&(S=""),[1,S]):d.includes(S)?(r.dynamicPosition==="hidden"&&(S=""),[1,S]):(r.ignoredDecorations.includes(S)||n("Unknown macro: "+S,w,C),[1,""]);switch(w[C]){case".":if(w[C+1]==="("||w[C+1]==="-")break;return[1,"staccato"];case"u":return[1,"upbow"];case"v":return[1,"downbow"];case"~":return[1,"irishroll"];case"!":case"+":var q=a.getBrackettedSubstring(w,C,5);if(q[1].length>1&&(q[1][0]==="^"||q[1][0]==="_")&&(q[1]=q[1].substring(1)),f.includes(q[1]))return q;if(g.includes(q[1]))return r.volumePosition==="hidden"&&(q[1]=""),q;if(d.includes(q[1]))return r.dynamicPosition==="hidden"&&(q[1]=""),q;var D=p.findIndex(function($){return q[1]===$[0]});return D>=0?(q[1]=p[D][1],q):(D=l.findIndex(function($){return q[1]===$[0]}),D>=0?(q[1]=l[D][1],r.dynamicPosition==="hidden"&&(q[1]=""),q):w[C]==="!"&&(q[0]===1||w[C+q[0]-1]!=="!")?[1,null]:(n("Unknown decoration: "+q[1],w,C),q[1]="",q));case"H":return[1,"fermata"];case"J":return[1,"slide"];case"L":return[1,"accent"];case"M":return[1,"mordent"];case"O":return[1,"coda"];case"P":return[1,"pralltriller"];case"R":return[1,"roll"];case"S":return[1,"segno"];case"T":return[1,"trill"];case"t":return[1,"trillh"]}return[0,0]},z=function(w,C){for(var S=C;a.isWhiteSpace(w[C]);)C++;return[C-S]},L=function(w,C){var S=a.getBarLine(w,C);if(S.len===0)return[0,""];if(S.warn)return n(S.warn,w,C),[S.len,""];for(var q=0;q<w.length&&w[C+S.len+q]===" ";q++);var D=S.len;if(w[C+S.len+q]==="["&&(S.len+=q+1),w[C+S.len]==='"'&&w[C+S.len-1]==="["){var $=a.getBrackettedSubstring(w,C+S.len,5);return[S.len+$[0],S.token,$[1]]}var F=a.getTokenOf(w.substring(C+S.len),"1234567890-,");return F.len===0||F.token[0]==="-"?[D,S.token]:[S.len+F.len,S.token,F.token]},E=function(w,C){var S={},q=C;for(w[C]==="."&&w[C+1]==="("&&(S.dottedSlur=!0,C++);w[C]==="("||a.isWhiteSpace(w[C]);)w[C]==="("&&(C+1<w.length&&w[C+1]>="2"&&w[C+1]<="9"?(S.triplet!==void 0?n("Can't nest triplets",w,C):(S.triplet=w[C+1]-"0",S.tripletQ=m[S.triplet],S.num_notes=S.triplet,C+2<w.length&&w[C+2]===":"&&(C+3<w.length&&w[C+3]===":"?C+4<w.length&&w[C+4]>="1"&&w[C+4]<="9"?(S.num_notes=w[C+4]-"0",C+=3):n("expected number after the two colons after the triplet to mark the duration",w,C):C+3<w.length&&w[C+3]>="1"&&w[C+3]<="9"?(S.tripletQ=w[C+3]-"0",C+4<w.length&&w[C+4]===":"?C+5<w.length&&w[C+5]>="1"&&w[C+5]<="9"&&(S.num_notes=w[C+5]-"0",C+=4):C+=2):n("expected number after the triplet to mark the duration",w,C))),C++):S.startSlur===void 0?S.startSlur=1:S.startSlur++),C++;return S.consumed=C-q,S};_.prototype.startNewLine=function(){var w={startChar:-1,endChar:-1};r.partForNextLine.title&&(w.part=r.partForNextLine),w.clef=r.currentVoice&&r.staves[r.currentVoice.staffNum].clef!==void 0?Object.assign({},r.staves[r.currentVoice.staffNum].clef):Object.assign({},r.clef);var C=r.currentVoice?r.currentVoice.scoreTranspose:0;if(w.key=e.standardKey(r.key.root+r.key.acc+r.key.mode,r.key.root,r.key.acc,C),w.key.mode=r.key.mode,r.key.impliedNaturals&&(w.key.impliedNaturals=r.key.impliedNaturals),r.key.explicitAccidentals)for(var S=0;S<r.key.explicitAccidentals.length;S++){for(var q=!1,D=0;D<w.key.accidentals.length;D++)w.key.accidentals[D].note===r.key.explicitAccidentals[S].note&&(w.key.accidentals[D].acc=r.key.explicitAccidentals[S].acc,q=!0);q||w.key.accidentals.push(r.key.explicitAccidentals[S])}if(r.targetKey=w.key,w.key.explicitAccidentals&&delete w.key.explicitAccidentals,e.addPosToKey(w.clef,w.key),r.meter!==null?(r.currentVoice?(r.staves.forEach(function(te){te.meter=r.meter}),w.meter=r.staves[r.currentVoice.staffNum].meter,r.staves[r.currentVoice.staffNum].meter=null):w.meter=r.meter,r.meter=null):r.currentVoice&&r.staves[r.currentVoice.staffNum].meter&&(w.meter=r.staves[r.currentVoice.staffNum].meter,r.staves[r.currentVoice.staffNum].meter=null),r.currentVoice&&r.currentVoice.name&&(w.name=r.currentVoice.name),r.vocalfont&&(w.vocalfont=r.vocalfont),r.tripletfont&&(w.tripletfont=r.tripletfont),r.gchordfont&&(w.gchordfont=r.gchordfont),r.style&&(w.style=r.style),r.currentVoice){var $=r.staves[r.currentVoice.staffNum];$.brace&&(w.brace=$.brace),$.bracket&&(w.bracket=$.bracket),$.connectBarLines&&(w.connectBarLines=$.connectBarLines),$.name&&(w.name=$.name[r.currentVoice.index]),$.subname&&(w.subname=$.subname[r.currentVoice.index]),r.currentVoice.stem&&(w.stem=r.currentVoice.stem),r.currentVoice.stafflines&&(w.stafflines=r.currentVoice.stafflines),r.currentVoice.staffscale&&(w.staffscale=r.currentVoice.staffscale),r.currentVoice.scale&&(w.scale=r.currentVoice.scale),r.currentVoice.color&&(w.color=r.currentVoice.color),r.currentVoice.style&&(w.style=r.currentVoice.style),r.currentVoice.transpose&&(w.clef.transpose=r.currentVoice.transpose),w.currentVoice=r.currentVoice;for(var F=Object.keys(r.voices),K=0;K<F.length;K++)w.currentVoice.staffNum===r.voices[F[K]].staffNum&&w.currentVoice.index===r.voices[F[K]].index&&(w.currentVoiceName=F[K])}r.barNumbers===0&&O()&&r.currBarNumber!==1&&(w.barNumber=r.currBarNumber),c.startNewLine(w),r.key.impliedNaturals&&delete r.key.impliedNaturals,r.partForNextLine={},r.tempoForNextLine.length===4&&c.appendElement(r.tempoForNextLine[0],r.tempoForNextLine[1],r.tempoForNextLine[2],r.tempoForNextLine[3]),r.tempoForNextLine=[]};var T=function(w){return w.duration!==void 0&&w.duration<.25&&(w.end_beam=!0),w},P=function(w,C,S,q){var D=function(le){return le==="octave"||le==="duration"||le==="Zduration"||le==="broken_rhythm"||le==="end_slur"},$;w[C]==="."&&w[C+1]==="-"&&($=!0,C++);for(var F="startSlur",K=!1;;){switch(w[C]){case"(":if(F==="startSlur")S.startSlur===void 0?S.startSlur=1:S.startSlur++;else return D(F)?(S.endChar=C,S):null;break;case")":if(D(F))S.endSlur===void 0?S.endSlur=1:S.endSlur++;else return null;break;case"^":if(F==="startSlur")S.accidental="sharp",F="sharp2";else if(F==="sharp2")S.accidental="dblsharp",F="pitch";else return D(F)?(S.endChar=C,S):null;break;case"_":if(F==="startSlur")S.accidental="flat",F="flat2";else if(F==="flat2")S.accidental="dblflat",F="pitch";else return D(F)?(S.endChar=C,S):null;break;case"=":if(F==="startSlur")S.accidental="natural",F="pitch";else return D(F)?(S.endChar=C,S):null;break;case"A":case"B":case"C":case"D":case"E":case"F":case"G":case"a":case"b":case"c":case"d":case"e":case"f":case"g":if(F==="startSlur"||F==="sharp2"||F==="flat2"||F==="pitch"){if(S.pitch=s[w[C]],S.pitch+=7*(r.currentVoice&&r.currentVoice.octave!==void 0?r.currentVoice.octave:r.octave),S.name=w[C],S.accidental&&(S.name=y[S.accidental]+S.name),t.note(r,S),F="octave",q&&r.next_note_duration!==0?(S.duration=r.default_length*r.next_note_duration,r.next_note_duration=0,K=!0):S.duration=r.default_length,r.clef&&r.clef.type==="perc"||r.currentVoice&&r.currentVoice.clef==="perc"){var te=w[C];S.accidental&&(te=y[S.accidental]+te),i.formatting&&i.formatting.midi&&i.formatting.midi.drummap&&(S.midipitch=i.formatting.midi.drummap[te])}}else return D(F)?(S.endChar=C,S):null;break;case",":if(F==="octave")S.pitch-=7,S.name+=",";else return D(F)?(S.endChar=C,S):null;break;case"'":if(F==="octave")S.pitch+=7,S.name+="'";else return D(F)?(S.endChar=C,S):null;break;case"x":case"X":case"y":case"z":case"Z":if(F==="startSlur")S.rest={type:v[w[C]]},delete S.accidental,delete S.startSlur,delete S.startTie,delete S.endSlur,delete S.endTie,delete S.end_beam,delete S.grace_notes,S.rest.type.indexOf("multimeasure")>=0?(S.duration=i.getBarLength(),S.rest.text=1,F="Zduration"):(q&&r.next_note_duration!==0?(S.duration=r.default_length*r.next_note_duration,r.next_note_duration=0,K=!0):S.duration=r.default_length,F="duration");else return D(F)?(S.endChar=C,S):null;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"0":case"/":if(F==="octave"||F==="duration"){var V=a.getFraction(w,C);for(S.duration=S.duration*V.value,S.endChar=V.index;V.index<w.length&&(a.isWhiteSpace(w[V.index])||w[V.index]==="-");)w[V.index]==="-"?S.startTie={}:S=T(S),V.index++;C=V.index-1,F="broken_rhythm"}else if(F==="sharp2")S.accidental="quartersharp",F="pitch";else if(F==="flat2")S.accidental="quarterflat",F="pitch";else if(F==="Zduration"){var ae=a.getNumber(w,C);return S.duration=ae.num*i.getBarLength(),S.rest.text=ae.num,S.endChar=ae.index,S}else return null;break;case"-":if(F==="startSlur")c.addTieToLastNote($),S.endTie=!0;else if(F==="octave"||F==="duration"||F==="end_slur")if(S.startTie={},!K&&q)F="broken_rhythm";else return a.isWhiteSpace(w[C+1])&&T(S),S.endChar=C+1,S;else return F==="broken_rhythm"?(S.endChar=C,S):null;break;case" ":case" ":if(D(F)){S.end_beam=!0,$=!1;do w[C]==="."&&w[C+1]==="-"&&($=!0,C++),w[C]==="-"&&(S.startTie={},$&&(S.startTie.style="dotted")),C++;while(C<w.length&&(a.isWhiteSpace(w[C])||w[C]==="-")||w[C]==="."&&w[C+1]==="-");if(S.endChar=C,!K&&q&&(w[C]==="<"||w[C]===">"))C--,F="broken_rhythm";else return S}else return null;break;case">":case"<":if(D(F))if(q){var oe=B(w,C);C+=oe[0]-1,r.next_note_duration=oe[2],S.duration=oe[1]*S.duration,F="end_slur"}else return S.endChar=C,S;else return null;break;default:return D(F)?(S.endChar=C,S):null}if(C++,C===w.length)return D(F)?(S.endChar=C,S):null}return null},B=function(w,C){switch(w[C]){case">":return C<w.length-2&&w[C+1]===">"&&w[C+2]===">"?[3,1.875,.125]:C<w.length-1&&w[C+1]===">"?[2,1.75,.25]:[1,1.5,.5];case"<":return C<w.length-2&&w[C+1]==="<"&&w[C+2]==="<"?[3,.125,1.875]:C<w.length-1&&w[C+1]==="<"?[2,.25,1.75]:[1,.5,1.5]}return null};function O(){return r.currentVoice===void 0||r.currentVoice.staffNum===0&&r.currentVoice.index===0}return Mr=_,Mr}var Nr,Di;function lg(){if(Di)return Nr;Di=1;var e=nt(),t=function(a,n){this.lineIndex=0,this.lines=a,this.multilineVars=n,this.skipWhiteSpace=function(o){for(var h=0;h<o.length;h++)if(!this.isWhiteSpace(o[h]))return h;return o.length};var r=function(o,h){return h>=o.length};this.eatWhiteSpace=function(o,h){for(var s=h;s<o.length;s++)if(!this.isWhiteSpace(o[s]))return s-h;return s-h},this.getKeyPitch=function(o){var h=this.skipWhiteSpace(o);if(r(o,h))return{len:0};switch(o[h]){case"A":return{len:h+1,token:"A"};case"B":return{len:h+1,token:"B"};case"C":return{len:h+1,token:"C"};case"D":return{len:h+1,token:"D"};case"E":return{len:h+1,token:"E"};case"F":return{len:h+1,token:"F"};case"G":return{len:h+1,token:"G"}}return{len:0}},this.getSharpFlat=function(o){if(o==="bass")return{len:0};switch(o[0]){case"#":return{len:1,token:"#"};case"b":return{len:1,token:"b"}}return{len:0}},this.getMode=function(o){var h=function(y,m){for(;m<y.length&&(y[m]>="a"&&y[m]<="z"||y[m]>="A"&&y[m]<="Z");)m++;return m},s=this.skipWhiteSpace(o);if(r(o,s))return{len:0};var v=o.substring(s,s+3).toLowerCase();switch((v.length>1&&v[1]===" "||v[1]==="^"||v[1]==="_"||v[1]==="=")&&(v=v[0]),v){case"mix":return{len:h(o,s),token:"Mix"};case"dor":return{len:h(o,s),token:"Dor"};case"phr":return{len:h(o,s),token:"Phr"};case"lyd":return{len:h(o,s),token:"Lyd"};case"loc":return{len:h(o,s),token:"Loc"};case"aeo":return{len:h(o,s),token:"m"};case"maj":return{len:h(o,s),token:""};case"ion":return{len:h(o,s),token:""};case"min":return{len:h(o,s),token:"m"};case"m":return{len:h(o,s),token:"m"}}return{len:0}},this.getClef=function(o,h){var s=o,v=this.skipWhiteSpace(o);if(r(o,v))return{len:0};var y=!1,m=o.substring(v);if(e.startsWith(m,"clef=")&&(y=!0,m=m.substring(5),v+=5),m.length===0&&y)return{len:v+5,warn:"No clef specified: "+s};var _=this.skipWhiteSpace(m);if(r(m,_))return{len:0};_>0&&(v+=_,m=m.substring(_));var k=null;if(e.startsWith(m,"treble"))k="treble";else if(e.startsWith(m,"bass3"))k="bass3";else if(e.startsWith(m,"bass"))k="bass";else if(e.startsWith(m,"tenor"))k="tenor";else if(e.startsWith(m,"alto2"))k="alto2";else if(e.startsWith(m,"alto1"))k="alto1";else if(e.startsWith(m,"alto"))k="alto";else if(!h&&y&&e.startsWith(m,"none"))k="none";else if(e.startsWith(m,"perc"))k="perc";else if(!h&&y&&e.startsWith(m,"C"))k="tenor";else if(!h&&y&&e.startsWith(m,"F"))k="bass";else if(!h&&y&&e.startsWith(m,"G"))k="treble";else return{len:v+5,warn:"Unknown clef specified: "+s};return m=m.substring(k.length),_=this.isMatch(m,"+8"),_>0?k+="+8":(_=this.isMatch(m,"-8"),_>0&&(k+="-8")),{len:v+k.length,token:k,explicit:y}},this.getBarLine=function(o,h){switch(o[h]){case"]":switch(++h,o[h]){case"|":return{len:2,token:"bar_thick_thin"};case"[":return++h,o[h]>="1"&&o[h]<="9"||o[h]==='"'?{len:2,token:"bar_invisible"}:{len:1,warn:"Unknown bar symbol"};default:return{len:1,token:"bar_invisible"}}case":":switch(++h,o[h]){case":":return{len:2,token:"bar_dbl_repeat"};case"|":switch(++h,o[h]){case"]":switch(++h,o[h]){case"|":return++h,o[h]===":"?{len:5,token:"bar_dbl_repeat"}:{len:3,token:"bar_right_repeat"};default:return{len:3,token:"bar_right_repeat"}}case"|":return++h,o[h]===":"?{len:4,token:"bar_dbl_repeat"}:{len:3,token:"bar_right_repeat"};default:return{len:2,token:"bar_right_repeat"}}default:return{len:1,warn:"Unknown bar symbol"}}case"[":if(++h,o[h]==="|")switch(++h,o[h]){case":":return{len:3,token:"bar_left_repeat"};case"]":return{len:3,token:"bar_invisible"};default:return{len:2,token:"bar_thick_thin"}}else return o[h]>="1"&&o[h]<="9"||o[h]==='"'?{len:1,token:"bar_invisible"}:{len:0};case"|":switch(++h,o[h]){case"]":return{len:2,token:"bar_thin_thick"};case"|":return++h,o[h]===":"?{len:3,token:"bar_left_repeat"}:{len:2,token:"bar_thin_thin"};case":":for(var s=0;o[h+s]===":";)s++;return{len:1+s,token:"bar_left_repeat"};default:return{len:1,token:"bar_thin"}}}return{len:0}},this.getTokenOf=function(o,h){for(var s=0;s<o.length;s++)if(h.indexOf(o[s])<0)return{len:s,token:o.substring(0,s)};return{len:s,token:o}},this.getToken=function(o,h,s){for(var v=h;v<s&&!this.isWhiteSpace(o[v]);)v++;return o.substring(h,v)},this.isMatch=function(o,h){var s=this.skipWhiteSpace(o);return r(o,s)?0:e.startsWith(o.substring(s),h)?s+h.length:0},this.getPitchFromTokens=function(o){var h={},s={A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11};if(h.position=s[o[0].token],h.position===void 0)return{warn:"Pitch expected. Found: "+o[0].token};for(o.shift();o.length;)switch(o[0].token){case",":h.position-=7,o.shift();break;case"'":h.position+=7,o.shift();break;default:return h}return h},this.getKeyAccidentals2=function(o){for(var h;o.length>0;){var s;if(o[0].token==="^"){if(s="sharp",o.shift(),o.length===0)return{accs:h,warn:"Expected note name after "+s};switch(o[0].token){case"^":s="dblsharp",o.shift();break;case"/":s="quartersharp",o.shift();break}}else if(o[0].token==="=")s="natural",o.shift();else if(o[0].token==="_"){if(s="flat",o.shift(),o.length===0)return{accs:h,warn:"Expected note name after "+s};switch(o[0].token){case"_":s="dblflat",o.shift();break;case"/":s="quarterflat",o.shift();break}}else return{accs:h};if(o.length===0)return{accs:h,warn:"Expected note name after "+s};switch(o[0].token[0]){case"a":case"b":case"c":case"d":case"e":case"f":case"g":case"A":case"B":case"C":case"D":case"E":case"F":case"G":h===void 0&&(h=[]),h.push({acc:s,note:o[0].token[0]}),o[0].token.length===1?o.shift():o[0].token=o[0].token.substring(1);break;default:return{accs:h,warn:"Expected note name after "+s+" Found: "+o[0].token}}}return{accs:h}},this.getKeyAccidental=function(o){var h={"^":"sharp","^^":"dblsharp","=":"natural",_:"flat",__:"dblflat","_/":"quarterflat","^/":"quartersharp"},s=this.skipWhiteSpace(o);if(r(o,s))return{len:0};var v=null;switch(o[s]){case"^":case"_":case"=":v=o[s];break;default:return{len:0}}if(s++,r(o,s))return{len:1,warn:"Expected note name after accidental"};switch(o[s]){case"a":case"b":case"c":case"d":case"e":case"f":case"g":case"A":case"B":case"C":case"D":case"E":case"F":case"G":return{len:s+1,token:{acc:h[v],note:o[s]}};case"^":case"_":case"/":if(v+=o[s],s++,r(o,s))return{len:2,warn:"Expected note name after accidental"};switch(o[s]){case"a":case"b":case"c":case"d":case"e":case"f":case"g":case"A":case"B":case"C":case"D":case"E":case"F":case"G":return{len:s+1,token:{acc:h[v],note:o[s]}};default:return{len:2,warn:"Expected note name after accidental"}}break;default:return{len:1,warn:"Expected note name after accidental"}}},this.isWhiteSpace=function(o){return o===" "||o===" "||o===""},this.getMeat=function(o,h,s){var v=o.indexOf("%",h);for(v>=0&&v<s&&(s=v);h<s&&(o[h]===" "||o[h]===" "||o[h]==="");)h++;for(;h<s&&(o[s-1]===" "||o[s-1]===" "||o[s-1]==="");)s--;return{start:h,end:s}};var i=function(o){return o>="A"&&o<="Z"||o>="a"&&o<="z"},c=function(o){return o>="0"&&o<="9"};this.tokenize=function(o,h,s,v){var y=this.getMeat(o,h,s);h=y.start,s=y.end;for(var m=[],_;h<s;){if(o[h]==='"'){for(_=h+1;_<s&&o[_]!=='"';)_++;m.push({type:"quote",token:o.substring(h+1,_),start:h+1,end:_}),_++}else if(i(o[h])){if(_=h+1,v)for(;_<s&&!this.isWhiteSpace(o[_]);)_++;else for(;_<s&&i(o[_]);)_++;m.push({type:"alpha",token:o.substring(h,_),continueId:c(o[_]),start:h,end:_}),h=_+1}else if(o[h]==="."&&c(o[_+1])){_=h+1;for(var k=null,x=null;_<s&&c(o[_]);)_++;x=parseFloat(o.substring(h,_)),m.push({type:"number",token:o.substring(h,_),intt:k,floatt:x,continueId:i(o[_]),start:h,end:_}),h=_+1}else if(c(o[h])||o[h]==="-"&&c(o[_+1])){_=h+1;for(var R=null,I=null;_<s&&c(o[_]);)_++;if(o[_]==="."&&c(o[_+1]))for(_++;_<s&&c(o[_]);)_++;else R=parseInt(o.substring(h,_));I=parseFloat(o.substring(h,_)),m.push({type:"number",token:o.substring(h,_),intt:R,floatt:I,continueId:i(o[_]),start:h,end:_}),h=_+1}else o[h]===" "||o[h]===" "||m.push({type:"punct",token:o[h],start:h,end:h+1}),_=h+1;h=_}return m},this.getVoiceToken=function(o,h,s){for(var v=h;v<s&&this.isWhiteSpace(o[v])||o[v]==="=";)v++;if(o[v]==='"'){var y=o.indexOf('"',v+1);return y===-1||y>=s?{len:1,err:"Missing close quote"}:{len:y-h+1,token:this.translateString(o.substring(v+1,y))}}else{for(var m=v;m<s&&!this.isWhiteSpace(o[m])&&o[m]!=="=";)m++;return{len:m-h+1,token:o.substring(v,m)}}};var u={"`a":"à","'a":"á","^a":"â","~a":"ã",'"a':"ä",oa:"å",aa:"å","=a":"ā",ua:"ă",";a":"ą","`e":"è","'e":"é","^e":"ê",'"e':"ë","=e":"ē",ue:"ĕ",";e":"ę",".e":"ė","`i":"ì","'i":"í","^i":"î",'"i':"ï","=i":"ī",ui:"ĭ",";i":"į","`o":"ò","'o":"ó","^o":"ô","~o":"õ",'"o':"ö","=o":"ō",uo:"ŏ","/o":"ø","`u":"ù","'u":"ú","^u":"û","~u":"ũ",'"u':"ü",ou:"ů","=u":"ū",uu:"ŭ",";u":"ų","`A":"À","'A":"Á","^A":"Â","~A":"Ã",'"A':"Ä",oA:"Å",AA:"Å","=A":"Ā",uA:"Ă",";A":"Ą","`E":"È","'E":"É","^E":"Ê",'"E':"Ë","=E":"Ē",uE:"Ĕ",";E":"Ę",".E":"Ė","`I":"Ì","'I":"Í","^I":"Î","~I":"Ĩ",'"I':"Ï","=I":"Ī",uI:"Ĭ",";I":"Į",".I":"İ","`O":"Ò","'O":"Ó","^O":"Ô","~O":"Õ",'"O':"Ö","=O":"Ō",uO:"Ŏ","/O":"Ø","`U":"Ù","'U":"Ú","^U":"Û","~U":"Ũ",'"U':"Ü",oU:"Ů","=U":"Ū",uU:"Ŭ",";U":"Ų",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",ss:"ß","'c":"ć","^c":"ĉ",uc:"č",cc:"ç",".c":"ċ",cC:"Ç","'C":"Ć","^C":"Ĉ",uC:"Č",".C":"Ċ","~N":"Ñ","~n":"ñ","=s":"š",vs:"š",DH:"Ð",dh:"ð",HO:"Ő",Ho:"ő",HU:"Ű",Hu:"ű","'Y":"Ý","'y":"ý","^Y":"Ŷ","^y":"ŷ",'"Y':"Ÿ",'"y':"ÿ",vS:"Š",vZ:"Ž",vz:"ž"},f={"#":"♯",b:"♭","=":"♮"},g={201:"♯",202:"♭",203:"♮",241:"¡",242:"¢",252:"a",262:"2",272:"o",302:"Â",312:"Ê",322:"Ò",332:"Ú",342:"â",352:"ê",362:"ò",372:"ú",243:"£",253:"«",263:"3",273:"»",303:"Ã",313:"Ë",323:"Ó",333:"Û",343:"ã",353:"ë",363:"ó",373:"û",244:"¤",254:"¬",264:" ́",274:"1⁄4",304:"Ä",314:"Ì",324:"Ô",334:"Ü",344:"ä",354:"ì",364:"ô",374:"ü",245:"¥",255:"-",265:"μ",275:"1⁄2",305:"Å",315:"Í",325:"Õ",335:"Ý",345:"å",355:"í",365:"õ",375:"ý",246:"¦",256:"®",266:"¶",276:"3⁄4",306:"Æ",316:"Î",326:"Ö",336:"Þ",346:"æ",356:"î",366:"ö",376:"þ",247:"§",257:" ̄",267:"·",277:"¿",307:"Ç",317:"Ï",327:"×",337:"ß",347:"ç",357:"ï",367:"÷",377:"ÿ",250:" ̈",260:"°",270:" ̧",300:"À",310:"È",320:"Ð",330:"Ø",340:"à",350:"è",360:"ð",370:"ø",251:"©",261:"±",271:"1",301:"Á",311:"É",321:"Ñ",331:"Ù",341:"á",351:"é",361:"ñ",371:"ù"};this.translateString=function(o){var h=o.split("\\");if(h.length===1)return o;var s=null;return h.forEach(function(v){if(s===null)s=v;else{var y=u[v.substring(0,2)];y!==void 0?s+=y+v.substring(2):(y=g[v.substring(0,3)],y!==void 0?s+=y+v.substring(3):(y=f[v.substring(0,1)],y!==void 0?s+=y+v.substring(1):s+="\\"+v))}}),s},this.getNumber=function(o,h){for(var s=0;h<o.length;)switch(o[h]){case"0":s=s*10,h++;break;case"1":s=s*10+1,h++;break;case"2":s=s*10+2,h++;break;case"3":s=s*10+3,h++;break;case"4":s=s*10+4,h++;break;case"5":s=s*10+5,h++;break;case"6":s=s*10+6,h++;break;case"7":s=s*10+7,h++;break;case"8":s=s*10+8,h++;break;case"9":s=s*10+9,h++;break;default:return{num:s,index:h}}return{num:s,index:h}},this.getFraction=function(o,h){var s=1,v=1;if(o[h]!=="/"){var y=this.getNumber(o,h);s=y.num,h=y.index}if(o[h]==="/")if(h++,o[h]==="/"){for(var m=.5;o[h++]==="/";)m=m/2;return{value:s*m,index:h-1}}else{var _=h,k=this.getNumber(o,h);k.num===0&&_===h&&(k.num=2),k.num!==0&&(v=k.num),h=k.index}return{value:s/v,index:h}};function d(o){const s=/^(\d+)\./.exec(o);return s?s[1]:null}var p=[{match:/,\s*The$/,replace:"The "},{match:/,\s*the$/,replace:"the "},{match:/,\s*A$/,replace:"A "},{match:/,\s*a$/,replace:"a "},{match:/,\s*An$/,replace:"An "},{match:/,\s*an$/,replace:"an "},{match:/,\s*Da$/,replace:"Da "},{match:/,\s*La$/,replace:"La "},{match:/,\s*Le$/,replace:"Le "},{match:/,\s*Les$/,replace:"Les "},{match:/,\s*Ye$/,replace:"Ye "}];this.theReverser=function(o){for(var h=0;h<p.length;h++){var s=p[h],v=o.match(s.match);if(v){var y=d(o);y&&(o=o.replace(y+".",""),o=o.trim());var m=v[0].length,_=s.replace+o.substring(0,o.length-m);return y&&(_=y+". "+_),_}}return o},this.stripComment=function(o){var h=o.indexOf("%");return h>=0?e.strip(o.substring(0,h)):e.strip(o)},this.getInt=function(o){var h=parseInt(o);if(isNaN(h))return{digits:0};var s=""+h,v=o.indexOf(s);return{value:h,digits:v+s.length}},this.getFloat=function(o){var h=parseFloat(o);if(isNaN(h))return{digits:0};var s=""+h,v=o.indexOf(s);return{value:h,digits:v+s.length}},this.getMeasurement=function(o){if(o.length===0)return{used:0};var h=1,s="";if(o[0].token==="-")o.shift(),s="-",h++;else if(o[0].type!=="number")return{used:0};if(s+=o.shift().token,o.length===0)return{used:1,value:parseInt(s)};var v=o.shift();if(v.token==="."){if(h++,o.length===0)return{used:h,value:parseInt(s)};if(o[0].type==="number"&&(v=o.shift(),s=s+"."+v.token,h++,o.length===0))return{used:h,value:parseFloat(s)};v=o.shift()}switch(v.token){case"pt":return{used:h+1,value:parseFloat(s)};case"px":return{used:h+1,value:parseFloat(s)};case"cm":return{used:h+1,value:parseFloat(s)/2.54*72};case"in":return{used:h+1,value:parseFloat(s)*72};default:return o.unshift(v),{used:h,value:parseFloat(s)}}};var l=function(o){return o=o.replace(/\\n/g,`
|
|
89
|
+
`),o=o.replace(/\\"/g,'"'),o};this.getBrackettedSubstring=function(o,h,s,v){for(var y=v||o[h],m=h+1,_=!1;m<o.length&&(_||o[m]!==y);)_=o[m]==="\\",++m;return o[m]===y?[m-h+1,l(o.substring(h+1,m)),!0]:(m=h+s,m>o.length-1&&(m=o.length-1),[m-h+1,l(o.substring(h+1,m)),!1])}};return t.prototype.peekLine=function(){return this.lines[this.lineIndex]},t.prototype.nextLine=function(){if(this.lineIndex>0&&(this.multilineVars.iChar+=this.lines[this.lineIndex-1].length+1),this.lineIndex<this.lines.length){var a=this.lines[this.lineIndex];return this.lineIndex++,a}return null},Nr=t,Nr}var Pr,Fi;function xl(){if(Fi)return Pr;Fi=1;function e(d,p,l){if(!(!p||d.lines.length===0)){var o=d.deline({lineBreaks:!1}),h=a(o,p);d.lines=t(o,h,l),d.lineBreaks=h}}function t(d,p,l){for(var o=[],h=[],s=[],v=1,y=0;y<p.length;y++){var m=p[y];if(d[m.ogLine].staff){var _=d[m.ogLine].staff[m.staff];if(o[m.line]||(o[m.line]={staff:[]}),!o[m.line].staff[m.staff]){o[m.line].staff[m.staff]={voices:[]},l!==void 0&&m.staff===0&&m.line>0&&(o[m.line].staff[m.staff].barNumber=v);for(var k=Object.keys(_),x=0;x<k.length;x++){var R=k[x]==="voices";k[x]==="meter"&&m.line!==0&&(R=!0),R||(o[m.line].staff[m.staff][k[x]]=_[k[x]])}h[m.staff]&&(o[m.line].staff[m.staff].key=h[m.staff])}o[m.line].staff[m.staff].voices[m.voice]||(o[m.line].staff[m.staff].voices[m.voice]=[]),o[m.line].staff[m.staff].voices[m.voice]=d[m.ogLine].staff[m.staff].voices[m.voice].slice(m.start,m.end+1),s[m.staff*10+m.voice]&&o[m.line].staff[m.staff].voices[m.voice].unshift({el_type:"stem",direction:s[m.staff*10+m.voice].direction});for(var I=o[m.line].staff[m.staff].voices[m.voice],b=I.length-1;b>=0;b--)if(I[b].el_type==="key"){h[m.staff]={root:I[b].root,acc:I[b].acc,mode:I[b].mode,accidentals:I[b].accidentals.filter(function(N){return N.acc!=="natural"})};break}for(b=I.length-1;b>=0;b--)if(I[b].el_type==="stem"){s[m.staff*10+m.voice]={direction:I[b].direction};break}if(l!==void 0&&m.staff===0&&m.voice===0)for(b=0;b<I.length;b++)I[b].el_type==="bar"&&(v++,b===I.length-1?delete I[b].barNumber:I[b].barNumber=v)}else o[m.line]=d[m.ogLine]}for(var A=0;A<o.length;A++)o[A].staff&&(o[A].staff=o[A].staff.filter(function(N){return N!=null}));return o}function a(d,p){for(var l=[],o=0,h=0,s=0,v=0;v<d.length;v++){var y=d[v];if(y.staff){var m=h,_=p[o];o++;for(var k=0;k<y.staff.length;k++)for(var x=y.staff[k],R=0;R<x.voices.length;R++){s=m;for(var I=0,b=0,A=x.voices[R],N=0,M=0;M<A.length;M++){var z=A[M];z.el_type==="bar"&&(_[b]===I&&(l.push({ogLine:v,line:s,staff:k,voice:R,start:N,end:M}),N=M+1,s++,h=Math.max(h,s),b++),I++)}l.push({ogLine:v,line:s,staff:k,voice:R,start:N,end:A.length}),s++,h=Math.max(h,s)}}else l.push({ogLine:v,line:s}),s++,h=Math.max(h,s)}return l}function n(d,p){for(var l=[],o=[],h=0,s=0;s<d.length;s++){var v=d[s],y=h+v;if(y<p)h=y;else{var m=p-h,_=y-p;m<_&&h>0?(l.push(s-1),o.push(Math.round(h-v)),h=v):s<d.length-1&&(l.push(s),o.push(Math.round(h)),h=0)}}return o.push(Math.round(h)),{lineBreaks:l,totals:o}}function r(d){for(var p=[],l=0;l<d.length;l++)p.push(d[l]);return p}function i(d,p,l,o,h,s,v,y,m,_,k){for(var x=_;x<d.length;x++){var R=d[x];l+=R,o+=R;var I=Math.abs(l-p[y]),b=Math.abs(I-s)<p[0]/10;if(b)if(I<s){var A=r(h),N=r(m);N.push(x-1),A.push(o-R),k.push({accumulator:l,lineAccumulator:R,lineWidths:A,lastVariance:Math.abs(l-p[y+1]),highestVariance:Math.max(v,s),currLine:y+1,lineBreaks:N,startIndex:x+1})}else I>s&&x<d.length-1&&(A=r(h),N=r(m),k.push({accumulator:l,lineAccumulator:o,lineWidths:A,lastVariance:I,highestVariance:Math.max(v,I),currLine:y,lineBreaks:N,startIndex:x+1}));I>s?(m.push(x-1),y++,v=Math.max(v,s),s=Math.abs(l-p[y]),h.push(o-R),o=R):s=I}h.push(o)}function c(d,p,l,o){for(var h=Math.ceil(d.total/p),s=Math.floor(d.total/h),v=[],y=0;y<h;y++)v.push(s*(y+1));var m=[];m.push({accumulator:0,lineAccumulator:0,lineWidths:[],lastVariance:999999,highestVariance:0,currLine:0,lineBreaks:[],startIndex:0});for(var _=0;_<m.length;)i(d.measureWidths,v,m[_].accumulator,m[_].lineAccumulator,m[_].lineWidths,m[_].lastVariance,m[_].highestVariance,m[_].currLine,m[_].lineBreaks,m[_].startIndex,m),_++;for(y=0;y<m.length;y++){var k=m[y];k.variances=[],k.aveVariance=0;for(var x=0;x<k.lineWidths.length;x++){var R=k.lineWidths[x];k.variances.push(R-v[0]),k.aveVariance+=Math.abs(R-v[0])}k.aveVariance=k.aveVariance/k.lineWidths.length,o.attempts.push({type:"optimizeLineWidths",lineBreaks:k.lineBreaks,variances:k.variances,aveVariance:k.aveVariance,widths:d.measureWidths})}var I=9999999,b=-1;for(y=0;y<m.length;y++)k=m[y],k.aveVariance<I&&(I=k.aveVariance,b=y);return{failed:!1,lineBreaks:m[b].lineBreaks,variance:m[b].highestVariance}}function u(d,p,l){for(var o=[],h=[],s=0,v=!1,y=0;y<d.length;y++)s+=d[y],s>p&&(v=!0),y%l===l-1&&(y!==d.length-1&&o.push(y),h.push(Math.round(s)),s=0);return{failed:v,totals:h,lineBreaks:o}}function f(d,p,l){var o={lineBreaks:d,staffwidth:p};for(var h in l)l.hasOwnProperty(h)&&h!=="wrap"&&h!=="staffwidth"&&(o[h]=l[h]);return{revisedParams:o}}function g(d,p,l){if(p.length===0||l.staffwidth<p[0].left)return{reParse:!1,explanation:"Staff width is narrower than the margin",revisedParams:l};var o=l.scale?Math.max(l.scale,.1):1,h=l.wrap.minSpacing?Math.max(parseFloat(l.wrap.minSpacing),1):1,s=l.wrap.minSpacingLimit?Math.max(parseFloat(l.wrap.minSpacingLimit),1):h-.1,v=l.wrap.maxSpacing?Math.max(parseFloat(l.wrap.maxSpacing),1):void 0;l.wrap.lastLineLimit&&!v&&(v=Math.max(parseFloat(l.wrap.lastLineLimit),1));for(var y=l.wrap.preferredMeasuresPerLine?Math.max(parseInt(l.wrap.preferredMeasuresPerLine,10),0):void 0,m=[],_=[],k=0;k<p.length;k++){var x=p[k],R=l.staffwidth-x.left,I=R/h/o,b=R/v/o,A=R/s/o,N={widths:x,lineBreakPoint:I,minLineSize:b,attempts:[],staffWidth:l.staffwidth,minWidth:Math.round(A)},M=null;if(y){var z=u(x.measureWidths,I,y);N.attempts.push({type:"Fixed Measures Per Line",preferredMeasuresPerLine:y,lineBreaks:z.lineBreaks,failed:z.failed,totals:z.totals}),z.failed||(M=z.lineBreaks)}if(!M){var L=n(x.measureWidths,I);N.attempts.push({type:"Free Form",lineBreaks:L.lineBreaks,totals:L.totals}),M=L.lineBreaks,M.length>0&&x.measureWidths.length<25&&(L=c(x,I,M,N),N.attempts.push({type:"Optimize",failed:L.failed,reason:L.reason,lineBreaks:L.lineBreaks,totals:L.totals}),L.failed||(M=L.lineBreaks))}m.push(M),_.push(N)}var E=l.staffwidth,T=f(m,E,l);return T.explanation=_,T.reParse=!0,T}return Pr={wrapLines:e,calcLineWraps:g},Pr}var zr,Hi;function ug(){if(Hi)return zr;Hi=1;function e(f){const g=f.getMeterFraction(),d=g.num===4&&g.den===4;if(!(g.num===2&&g.den===2)&&!d)throw new Error("notCommonTime");const l=f.deline();let o=[],h=!1;return l.forEach(s=>{if(s.subtitle)h&&o.push({type:"subtitle",subtitle:s.subtitle.text});else if(s.text)h=!0,o.push({type:"text",text:s.text.text});else if(s.staff){h=!0;const v=s.staff,y=a(v);o=o.concat(y)}}),r(o),i(o),c(o),o}const t=["break","(break)","no chord","n.c.","tacet"];function a(f){const g=[];let d="",p=[],l={chord:["","","",""]},o="",h="";if(f.forEach((s,v)=>{s.voices&&s.voices.forEach((y,m)=>{let _=0,k=0;y.forEach(x=>{if(x.el_type==="part")p.length>0&&v===0&&m===0&&(g.push({type:"part",name:d,lines:[p]}),p=[]),d=x.title;else if(x.el_type==="note"){u(x,l);const R=Math.floor(_);if(x.chord&&x.chord.length>0){const I=x.chord[0],b=I.position==="default"||t.indexOf(I.name.toLowerCase())>=0?I.name:"";b&&(R>0&&!l.chord[0]&&(l.chord[0]=o),o=b,l.chord[R]?R<4&&!l.chord[R+1]&&(l.chord[R+1]=b):l.chord[R]=b),x.chord.forEach(A=>{A.position!=="default"&&t.indexOf(I.name.toLowerCase())<0&&(l.annotations||(l.annotations=[]),l.annotations.push(A.name))})}if(!x.rest||x.rest.type!=="spacer"){const I=Math.floor(x.duration*4);if(I>4)k+=Math.floor(I/4),_=0;else{let b=x.duration*4;x.tripletMultiplier&&(b*=x.tripletMultiplier),_+=b}}}else if(x.el_type==="bar"){if(h&&(l.ending=h,h=""),u(x,l),(x.type==="bar_dbl_repeat"||x.type==="bar_left_repeat")&&(l.hasStartRepeat=!0),(x.type==="bar_dbl_repeat"||x.type==="bar_right_repeat")&&(l.hasEndRepeat=!0),x.startEnding&&(h=x.startEnding),_>=4){if(l.chord[0]===""&&(l.chord[1]||l.chord[2]||l.chord[3])&&(l.chord[0]=n(p)),v===0&&m===0)p.push(l);else{let R=k,I=0;for(;R>=g[I].lines[0].length&&I<g.length;)R-=g[I].lines[0].length,I++;if(I<g.length&&R<g[I].lines[0].length){const b=g[I].lines[0][R];!b.chord[0]&&l.chord[0]&&(b.chord[0]=l.chord[0]),!b.chord[1]&&l.chord[1]&&(b.chord[1]=l.chord[1]),!b.chord[2]&&l.chord[2]&&(b.chord[2]=l.chord[2]),!b.chord[3]&&l.chord[3]&&(b.chord[3]=l.chord[3]),l.annotations&&(b.annotations?b.annotations=b.annotations.concat(l.annotations):b.annotations=l.annotations)}k++}l={chord:["","","",""]}}else l.chord=["","","",""];_=0}else x.el_type}),v===0&&m===0&&g.push({type:"part",name:d,lines:[p]})})}),!o)throw new Error("noChords");return g}function n(f){for(let g=f.length-1;g>=0;g--)for(let d=f[g].chord.length-1;d>=0;d--)if(f[g].chord[d])return f[g].chord[d]}function r(f){f.forEach(g=>{if(g.type==="part"){const d=g.lines[0],p=d.findIndex(o=>!!o.ending),l=d.findIndex((o,h)=>h>p&&!!o.ending);if(p>=0&&l>=0&&l-p===d.length-l){let o=!0;for(let h=0;h<l-p&&o;h++){const s=d[p+h],v=d[l+h];if(s.chord[0]!==v.chord[0]&&(o=!1),s.chord[1]!==v.chord[1]&&(o=!1),s.chord[2]!==v.chord[2]&&(o=!1),s.chord[3]!==v.chord[3]&&(o=!1),s.annotations&&!v.annotations&&(o=!1),!s.annotations&&v.annotations&&(o=!1),s.annotations&&v.annotations)if(s.annotations.length!==v.annotations.length)o=!1;else for(let y=0;y<s.annotations.length;y++)s.annotations[y]!==v.annotations[y]&&(o=!1)}o&&(delete d[p].ending,d.splice(l,d.length-l))}}})}function i(f){f.forEach(g=>{if(g.type==="part"){const d=[],p=g.lines[0];let l=!1;const o=p.findIndex(v=>!!v.hasEndRepeat);(o>=0?Math.min(o+1,p.length):p.length)===12&&(l=!0);const s=l?4:8;for(let v=0;v<p.length;v+=s){const y=p.slice(v,v+s),m=y.findIndex(_=>!!_.hasEndRepeat);m>=0&&m<y.length-1?(d.push(y.slice(0,m+1)),d.push(y.slice(m+1))):d.push(y)}for(let v=0;v<d.length;v++)if(d[v][0].ending){const y=Math.max(0,v-1),m=d[y].length-d[v].length,_=[];for(let k=0;k<m;k++)_.push({noBorder:!0,chord:["","","",""]});d[v]=_.concat(d[v])}g.lines=d}})}function c(f){f.forEach(g=>{if(g.lines){let d=!1,p="";g.lines.forEach(l=>{l.forEach(o=>{if(!o.noBorder){const h=o.chord;!h[0]&&!h[1]&&!h[2]&&!h[3]?(d?p&&(h[0]="%"):h[0]=p,d=!0):!h[1]&&!h[2]&&!h[3]?(d=!0,p=h[0]):(d=!1,p=h[3]||h[2]||h[1])}})})}})}function u(f,g){if(f.decoration)for(let d=0;d<f.decoration.length;d++)switch(f.decoration[d]){case"fermata":case"segno":case"coda":case"D.C.":case"D.S.":case"D.C.alcoda":case"D.C.alfine":case"D.S.alcoda":case"D.S.alfine":case"fine":g.annotations||(g.annotations=[]),g.annotations.push(f.decoration[d]);break}}return zr=e,zr}var Ir,$i;function Ve(){if($i)return Ir;$i=1;var e={};return e.FONTEM=360,e.FONTSIZE=30,e.STEP=e.FONTSIZE*93/720,e.SPACE=10,e.TOPNOTE=15,e.STAVEHEIGHT=100,e.INDENT=50,Ir=e,Ir}var Rr,Zi;function hg(){if(Zi)return Rr;Zi=1;const e=nt();function t(i){this.sections=[{type:"startRepeat",index:-1}],this.addBar=function(c){var u=i.length-1,f=c.type==="bar_left_repeat"||c.type==="bar_dbl_repeat",g=c.type==="bar_right_repeat"||c.type==="bar_dbl_repeat",d=c.startEnding?r(c.startEnding):void 0;g&&this.sections.push({type:"endRepeat",index:u}),f&&this.sections.push({type:"startRepeat",index:u}),d&&this.sections.push({type:"startEnding",index:u,endings:d})},this.resolveRepeats=function(){var c,u=this.sections[this.sections.length-1],f=i.length-1;if(u.type==="startRepeat"?u.end=f:u.index+1<f&&this.sections.push({type:"startRepeat",index:u.index+1}),this.sections.length<2)return i;for(var g=[],d=null,p=0;p<this.sections.length;p++){var l=this.sections[p];switch(l.type){case"startRepeat":if(d){if(d.common.end||(d.common.end=l.index),d.endings)for(c=0;c<d.endings.length;c++)d.endings[c]&&!d.endings[c].end&&d.endings[c].start!==l.index&&(d.endings[c].end=l.index);this.sections[p-1].type==="endRepeat"&&d.endings&&d.endings.length&&(d.endings[d.endings.length]={start:-1,end:-1}),g.push(d)}if(d){var o=d.common.end;if(d.endings)for(c=0;c<d.endings.length;c++)d.endings[c]&&(o=Math.max(o,d.endings[c].end));o<l.index-1&&(console.log("gap",i.slice(o+1,l.index)),g.push({common:{start:o+1,end:l.index}}))}d={common:{start:l.index}};break;case"startEnding":{if(d)for(d.common.end||(d.common.end=l.index),d.endings||(d.endings=[]),c=0;c<l.endings.length;c++)d.endings[l.endings[c]]={start:l.index+1};break}case"endRepeat":if(d){if(d.endings||(d.endings=[]),d.endings.length>0)for(c=0;c<d.endings.length;c++)d.endings[c]&&!d.endings[c].end&&(d.endings[c].end=l.index);d.common.end||(d.common.end=l.index)}break}}if(d){if(d.common.end||(d.common.end=f),d.endings)for(c=0;c<d.endings.length;c++)d.endings[c]&&!d.endings[c].end&&(d.endings[c].end=f);g.push(d)}for(var h=[],s=-1,v=0;v<g.length;v++){var y=g[v];if(!y.endings)a(i,h,y.common.start,y.common.end);else if(y.endings.length===0)a(i,h,y.common.start,y.common.end),a(i,h,y.common.start,y.common.end);else for(c=0;c<y.endings.length;c++){var m=y.endings[c];m&&(a(i,h,y.common.start,y.common.end),m.start>0&&a(i,h,m.start,m.end),s=Math.max(s,m.end))}}return h}}function a(i,c,u,f){for(var g=u;g<=f;g++)c.push(n(i[g]))}function n(i){var c=Object.assign({},i);return c.pitches&&(c.pitches=e.cloneArray(c.pitches)),c}function r(i){var c=[],u,f,g;if(i.indexOf(",")>0)for(f=i.split(","),g=0;g<f.length;g++)u=parseInt(f[g],10),u>0&&c.push(u);else if(i.indexOf("-")>0){f=i.split("-");var d=parseInt(f[0],10),p=parseInt(f[1],10);for(g=d;g<=p;g++)c.push(g)}else u=parseInt(i,10),u>0&&c.push(u);return c}return Rr=t,Rr}var qr,Gi;function Cl(){if(Gi)return qr;Gi=1;var e,t=nt(),a=hg();return(function(){var n=1,r=128;e=function(v,y){y=y||{};var m,_=y.program||0,k=y.midiTranspose||0;v.visualTranspose&&(k-=v.visualTranspose);var x=y.channel||0,R=!1,I=y.drum||"",b=y.drumBars||1,A=y.drumIntro||0,N=I!=="",M=!!y.drumOff,z=[],L=50;_=parseInt(_,10),k=parseInt(k,10),x=parseInt(x,10),x===10&&(_=r),I=I.split(" "),b=parseInt(b,10),A=parseInt(A,10);var E=v.formatting.bagpipes;E&&(_=71);var T=[];if(v.formatting.midi){var P=v.formatting.midi;P.program&&P.program.length>0&&(_=P.program[0],P.program.length>1&&(_=P.program[1],x=P.program[0]),R=!0),P.transpose&&(k=P.transpose[0]),P.channel&&(x=P.channel[0],R=!0),P.drum&&(I=P.drum),P.drumbars&&(b=P.drumbars[0]),P.drumon&&(N=!0),x===10&&(_=r),P.beat&&T.push({el_type:"beat",beats:P.beat}),P.nobeataccents&&T.push({el_type:"beataccents",value:!1})}y.qpm?m=parseInt(y.qpm,10):v.metaText.tempo?m=d(v.metaText.tempo,v.getBeatLength()):y.defaultQpm?m=y.defaultQpm:m=180;var B=[];E&&B.push({el_type:"bagpipes"}),B.push({el_type:"instrument",program:_}),x&&B.push({el_type:"channel",channel:x}),k&&B.push({el_type:"transpose",transpose:k}),B.push({el_type:"tempo",qpm:m});for(var O=0;O<T.length;O++)B.push(T[O]);var w=[],C=[],S=[],q=[],D=[0],$={};$[0]={el_type:"tempo",qpm:m,timing:0};for(var F,K=[],te=!1,V=v.lines,ae=0;ae<V.length;ae++){var oe=V[ae];if(oe.staff){let pe=function(be){var $e={pppp:[15,10,5,1],ppp:[30,20,10,1],pp:[45,35,20,1],p:[60,50,35,1],mp:[75,65,50,1],mf:[90,80,65,1],f:[105,95,80,1],ff:[120,110,95,1],fff:[127,125,110,1],ffff:[127,125,110,1]},ve;if(be.decoration){if(be.decoration.indexOf("pppp")>=0?ve="pppp":be.decoration.indexOf("ppp")>=0?ve="ppp":be.decoration.indexOf("pp")>=0?ve="pp":be.decoration.indexOf("p")>=0?ve="p":be.decoration.indexOf("mp")>=0?ve="mp":be.decoration.indexOf("mf")>=0?ve="mf":be.decoration.indexOf("f")>=0?ve="f":be.decoration.indexOf("ff")>=0?ve="ff":be.decoration.indexOf("fff")>=0?ve="fff":be.decoration.indexOf("ffff")>=0&&(ve="ffff"),ve){F=$e[ve].slice(0);let kt=[F];Array.isArray(be.decoration)&&(kt=[],be.decoration.forEach(ct=>{ct in $e&&kt.push($e[ct].slice(0))})),w[J].push({el_type:"beat",beats:F.slice(0),volumesPerNotePitch:kt}),S[he]=!1,q[he]=!1}if(be.decoration.indexOf("crescendo(")>=0){var rt=i(de,W,"crescendo)"),Ue=Math.min(127,F[0]+L),Ze=c(de,W+rt+1,Object.keys($e));Ze&&(Ue=$e[Ze][0]),rt>0?S[he]=Math.floor((Ue-F[0])/rt):S[he]=!1,q[he]=!1}else if(be.decoration.indexOf("crescendo)")>=0)S[he]=!1;else if(be.decoration.indexOf("diminuendo(")>=0){var st=i(de,W,"diminuendo)"),ot=Math.max(15,F[0]-L),vt=c(de,W+st+1,Object.keys($e));vt&&(ot=$e[vt][0]),S[he]=!1,st>0?q[he]=Math.floor((ot-F[0])/st):q[he]=!1}else be.decoration.indexOf("diminuendo)")>=0&&(q[he]=!1)}};for(var qe=pe,le=oe.staff,J=0,ce=0;ce<le.length;ce++){var ee=le[ce];if(!(ee.clef&&ee.clef.type==="TAB"))for(var he=0;he<ee.voices.length;he++){var de=ee.voices[he];if(!w[J]){w[J]=[].concat(JSON.parse(JSON.stringify(B)));var Se=g(oe.staff,J);Se&&w[J].unshift({el_type:"name",trackName:Se}),K[J]=new a(w[J])}if(k&&ee.clef.type==="perc"&&w[J].push({el_type:"transpose",transpose:0}),ee.clef&&ee.clef.type==="perc"&&!R)for(var we=0;we<w[J].length;we++)w[J][we].el_type==="instrument"&&(w[J][we].program=r);else ee.key&&o(w[J],ee.key);ee.meter&&h(w[J],ee.meter),!te&&N&&(w[J].push({el_type:"drum",params:{pattern:I,bars:b,on:N,intro:A}}),te=!0),ee.clef&&ee.clef.type!=="perc"&&ee.clef.transpose&&(ee.clef.el_type="clef",w[J].push({el_type:"transpose",transpose:ee.clef.transpose}),C[J]=!1),ee.clef&&ee.clef.type&&(ee.clef.type.indexOf("-8")>=0?(w[J].push({el_type:"transpose",transpose:-12}),C[J]=!0):ee.clef.type.indexOf("+8")>=0?(w[J].push({el_type:"transpose",transpose:12}),C[J]=!0):C[J]&&(w[J].push({el_type:"transpose",transpose:0}),C[J]=!1)),v.formatting.midi&&v.formatting.midi.drumoff&&(w[J].push({el_type:"bar"}),w[J].push({el_type:"drum",params:{pattern:"",on:!1}}));var Re=0,ze=0,Oe=0,Z=0;F=[105,95,85,1];for(var W=0;W<de.length;W++){var H=de[W];switch(H.el_type){case"note":if(S[he]&&(F[0]+=S[he],F[1]+=S[he],F[2]+=S[he],w[J].push({el_type:"beat",beats:F.slice(0)})),q[he]&&(F[0]+=q[he],F[1]+=q[he],F[2]+=q[he],w[J].push({el_type:"beat",beats:F.slice(0)})),pe(H),!H.rest||H.rest.type!=="spacer"){var Y={elem:H,el_type:"note",timing:D[J]};if(H.style?Y.style=H.style:z[J]&&(Y.style=z[J]),Y.duration=H.duration===0?.25:H.duration,H.startTriplet){if(ze=H.tripletMultiplier,Oe=H.startTriplet*ze*H.duration,H.startTriplet!==H.tripletR&&W+H.tripletR<=de.length){for(var Q=0,re=W;re<W+H.tripletR;re++)Q+=de[re].duration;Oe=ze*Q}Y.duration=Y.duration*ze,Y.duration=Math.round(Y.duration*1e6)/1e6,Z=Y.duration}else ze&&(H.endTriplet?(ze=0,Y.duration=Math.round((Oe-Z)*1e6)/1e6):(Y.duration=Y.duration*ze,Y.duration=Math.round(Y.duration*1e6)/1e6,Z+=Y.duration));H.rest&&(Y.rest=H.rest),H.decoration&&(Y.decoration=H.decoration.slice(0)),H.pitches&&(Y.pitches=t.cloneArray(H.pitches)),H.gracenotes&&(Y.gracenotes=t.cloneArray(H.gracenotes)),H.chord&&(Y.chord=t.cloneArray(H.chord)),w[J].push(Y),H.style==="rhythm"&&f(w),Re++,D[J]+=Y.duration}break;case"key":case"keySignature":o(w[J],H);break;case"meter":h(w[J],H);break;case"clef":H.transpose&&w[J].push({el_type:"transpose",transpose:H.transpose}),H.type&&(H.type.indexOf("-8")>=0?w[J].push({el_type:"transpose",transpose:-12}):H.type.indexOf("+8")>=0&&w[J].push({el_type:"transpose",transpose:12}));break;case"tempo":m=d(H,v.getBeatLength()),w[J].push({el_type:"tempo",qpm:m,timing:D[J]}),$[""+D[J]]={el_type:"tempo",qpm:m,timing:D[J]};break;case"bar":Re>0&&w[J].push({el_type:"bar"}),pe(H),Re=0,K[J].addBar(H,J);break;case"style":z[J]=H.head;break;case"timeSignature":w[J].push(p(H));break;case"part":break;case"stem":case"scale":case"break":case"font":break;case"midi":var ie=!1;switch(H.cmd){case"drumon":N=!0,ie=!0;break;case"drumoff":N=!1,ie=!0;break;case"drum":I=H.params,ie=!0;break;case"drumbars":b=H.params[0],ie=!0;break;case"drummap":break;case"channel":H.params[0]===10&&w[J].push({el_type:"instrument",program:r});break;case"program":s(w[J],{el_type:"instrument",program:H.params[0]}),R=!0;break;case"transpose":w[J].push({el_type:"transpose",transpose:H.params[0]});break;case"gchordoff":w[J].push({el_type:"gchordOn",tacet:!0});break;case"gchordon":w[J].push({el_type:"gchordOn",tacet:!1});break;case"beat":w[J].push({el_type:"beat",beats:H.params});break;case"nobeataccents":w[J].push({el_type:"beataccents",value:!1});break;case"beataccents":w[J].push({el_type:"beataccents",value:!0});break;case"vol":case"volinc":w[J].push({el_type:H.cmd,volume:H.params[0]});break;case"swing":case"gchord":case"bassvol":case"chordvol":w[J].push({el_type:H.cmd,param:H.params[0]});break;case"bassprog":case"chordprog":w[J].push({el_type:H.cmd,value:H.params[0],octaveShift:H.params[1]});break;case"gchordbars":w[J].push({el_type:H.cmd,param:H.params[0]});break;default:console.log("MIDI seq: midi cmd not handled: ",H.cmd,H)}ie&&(w[0].push({el_type:"drum",params:{pattern:I,bars:b,intro:A,on:N}}),te=!0);break;default:console.log("MIDI: element type "+H.el_type+" not handled.")}}J++,D[J]||(D[J]=0)}}}}for(var ge=0;ge<K.length;ge++)w[ge]=K[ge].resolveRepeats();if(u(w,$),A)for(var ne=v.getPickupLength(),ue=0;ue<w.length;ue++){for(var Ee=0;w[ue][Ee].el_type!=="note"&&w[ue].length>Ee;)Ee++;if(w[ue].length>Ee){for(var re=0;re<A;re++)ne===0||re<A-1?(w[ue].splice(Ee,0,{el_type:"note",rest:{type:"rest"},duration:n},{el_type:"bar"}),Ee+=2):w[ue].splice(Ee++,0,{el_type:"note",rest:{type:"rest"},duration:n-ne});M&&(N=!1,w[ue].splice(Ee++,0,{el_type:"drum",params:{pattern:I,bars:b,intro:A,on:N}}),M=!1)}}return w.length>0&&w[0].length>0&&(w[0][0].pickupLength=v.getPickupLength()),w};function i(v,y,m){for(var _=0,k=y+1;k<v.length;k++)if(v[k].el_type==="note"&&_++,v[k].decoration&&v[k].decoration.indexOf(m)>=0)return _;return _}function c(v,y,m){for(var _=Math.min(v.length,y+3),k=y;k<_;k++)if(v[k].el_type==="note"&&v[k].decoration){for(var x=0;x<v[k].decoration.length;x++)if(m.indexOf(v[k].decoration[x])>=0)return v[k].decoration[x]}return null}function u(v,y){if(!(!y||y.length===0))for(var m=Object.keys(y),_=0;_<v.length;_++)for(var k=v[_],x=y[0]?y[0].qpm:0,R=0;R<k.length;R++){var I=k[R];I.el_type==="tempo"&&(x=I.qpm),m.indexOf(""+I.timing)>=0&&x!==y[""+I.timing].qpm&&(x=y[""+I.timing].qpm,I.el_type==="tempo"?(I.qpm=y[""+I.timing].qpm,R++):(v[_].splice(R,0,{el_type:"tempo",qpm:y[""+I.timing].qpm,timing:I.timing}),R+=2))}}function f(v){for(var y=0;y<v.length;y++)for(var m=v[y],_=m.length-1;_>=0&&m[_].el_type!=="bar";)m[_].noChordVoice=!0,_--}function g(v,y){if(!(!v||v.length<=y||!v[y].title))return v[y].title.join(" ")}function d(v,y){var m=.25;v.duration&&(m=v.duration[0]);var _=60;return v.bpm&&(_=v.bpm),m*_/y}function p(v){var y;switch(v.type){case"common_time":y={el_type:"meter",num:4,den:4},n=4/4;break;case"cut_time":y={el_type:"meter",num:2,den:2},n=2/2;break;case"specified":let k=0;if(v.value&&v.value.length>0&&v.value[0].num.indexOf("+")>0)for(var m=v.value[0].num.split("+"),_=0;_<m.length;_++)k+=parseInt(m[_],10);else k=parseInt(v.value[0].num,10);y={el_type:"meter",num:k,den:v.value[0].den},n=k/parseInt(v.value[0].den,10);break;default:y={el_type:"meter"},n=1}return y}function l(v){for(var y=[],m=0;m<v.length;m++)v[m].acc!=="natural"&&y.push(v[m]);return y}function o(v,y){var m;y.root==="HP"?m={el_type:"key",accidentals:[{acc:"natural",note:"g"},{acc:"sharp",note:"f"},{acc:"sharp",note:"c"}]}:m={el_type:"key",accidentals:l(y.accidentals)},s(v,m)}function h(v,y){var m=p(y);s(v,m)}function s(v,y){for(var m=v.length-1;m>=0;m--)if(v[m].el_type===y.el_type){JSON.stringify(v[m])!==JSON.stringify(y)&&v.push(y);return}v.push(y)}})(),qr=e,qr}var Br,Ui;function fg(){if(Ui)return Br;Ui=1;var e=function(g,d,p,l){this.chordTrack=[],this.chordTrackFinished=!1,this.chordChannel=g,this.currentChords=[],this.lastChord,this.chordLastBar,this.chordsOff=!!d,this.gChordTacet=this.chordsOff,this.hasRhythmHead=!1,this.transpose=0,this.lastBarTime=0,this.meter=l,this.tempoChangeFactor=1,this.bassInstrument=p.bassprog&&p.bassprog.length>=1?p.bassprog[0]:0,this.chordInstrument=p.chordprog&&p.chordprog.length>=1?p.chordprog[0]:0,this.bassOctaveShift=p.bassprog&&p.bassprog.length===2?p.bassprog[1]:0,this.chordOctaveShift=p.chordprog&&p.chordprog.length===2?p.chordprog[1]:0,this.boomVolume=p.bassvol&&p.bassvol.length===1?p.bassvol[0]:64,this.chickVolume=p.chordvol&&p.chordvol.length===1?p.chordvol[0]:48,p.gchord&&p.gchord.length>0?this.overridePattern=n(p.gchord[0]):this.overridePattern=void 0};e.prototype.setMeter=function(f){this.meter=f},e.prototype.setTempoChangeFactor=function(f){this.tempoChangeFactor=f},e.prototype.setLastBarTime=function(f){this.lastBarTime=f},e.prototype.setTranspose=function(f){this.transpose=f},e.prototype.setRhythmHead=function(f,g){this.hasRhythmHead=f;var d=[];if(f&&this.lastChord&&this.lastChord.chick)for(var p=0;p<this.lastChord.chick.length;p++){var l=Object.assign({},g.pitches[0]);l.actualPitch=this.lastChord.chick[p],d.push(l)}return d},e.prototype.barEnd=function(f){this.chordTrack.length>0&&!this.chordTrackFinished&&(this.resolveChords(this.lastBarTime,c(f.time)),this.currentChords=[]),this.chordLastBar=this.lastChord},e.prototype.gChordOn=function(f){this.chordsOff||(this.gChordTacet=f.tacet)},e.prototype.paramChange=function(f){switch(f.el_type){case"gchord":f.param&&f.param.length>0?this.overridePattern=n(f.param):this.overridePattern=void 0;break;case"bassprog":this.bassInstrument=f.value,f.octaveShift!=null&&f.octaveShift!=null?this.bassOctaveShift=f.octaveShift:this.bassOctaveShift=0;break;case"chordprog":this.chordInstrument=f.value,f.octaveShift!=null&&f.octaveShift!=null?this.chordOctaveShift=f.octaveShift:this.chordOctaveShift=0;break;case"bassvol":this.boomVolume=f.param;break;case"chordvol":this.chickVolume=f.param;break;default:console.log("unhandled midi param",f)}},e.prototype.finish=function(){this.chordTrackEmpty()||(this.chordTrackFinished=!0)},e.prototype.addTrack=function(f){this.chordTrackEmpty()||f.push(this.chordTrack)},e.prototype.findChord=function(f){if(this.gChordTacet)return"break";if(this.chordTrackFinished||!f.chord||f.chord.length===0)return null;for(var g=0;g<f.chord.length;g++){var d=f.chord[g];if(d.position==="default")return d.name;if(this.breakSynonyms.indexOf(d.name.toLowerCase())>=0)return"break"}return null},e.prototype.interpretChord=function(f){if(f.length!==0){if(f==="break")return{chick:[]};var g=f.substring(0,1);if(g==="("){if(f=f.substring(1,f.length-1),f.length===0)return;g=f.substring(0,1)}var d=this.basses[g];if(d){for(var p=this.transpose;p<-8;)p+=12;for(;p>8;)p-=12;d+=p,d<33?d+=12:d>44&&(d-=12);var l=d;d+=this.bassOctaveShift*12;var o=d-5,h;f.length===1&&(h=this.chordNotes(d,""));var s=f.substring(1),v=s.substring(0,1);v==="b"||v==="♭"?(l--,d--,o--,s=s.substring(1)):(v==="#"||v==="♯")&&(l++,d++,o++,s=s.substring(1));var y=s.split("/");if(h=this.chordNotes(l,y[0]),h.length>=3){var m=h[2]-h[0];o=o+m-7}if(y.length===2){var _=this.basses[y[1].substring(0,1)];if(_){var k=y[1].substring(1),x={"#":1,"♯":1,b:-1,"♭":-1}[k]||0;d=this.basses[y[1].substring(0,1)]+x+p,d+=this.bassOctaveShift*12,o=d}}return{boom:d,boom2:o,chick:h}}}},e.prototype.chordNotes=function(f,g){var d=this.chordIntervals[g];d||(g.slice(0,2).toLowerCase()==="ma"||g[0]==="M"?d=this.chordIntervals.M:g[0]==="m"||g[0]==="-"?d=this.chordIntervals.m:d=this.chordIntervals.M),f+=12,f+=this.chordOctaveShift*12;for(var p=[],l=0;l<d.length;l++)p.push(f+d[l]);return p},e.prototype.writeNote=function(f,g,d,p,l,o){f!==void 0&&this.chordTrack.push({cmd:"note",pitch:f,volume:d,start:this.lastBarTime+p*u(g,this.tempoChangeFactor),duration:u(l,this.tempoChangeFactor),gap:0,instrument:o})},e.prototype.chordTrackEmpty=function(){for(var f=!0,g=0;g<this.chordTrack.length&&f;g++)this.chordTrack[g].cmd==="note"&&(f=!1);return f},e.prototype.resolveChords=function(f,g){if(!this.hasRhythmHead){var d=this.meter.num,p=this.meter.den,l=1/p,o=l/2,h=parseInt(d,10)/parseInt(p,10),s=h-(g-f)/this.tempoChangeFactor;Math.abs(s)<1e-5&&(s=0),(this.currentChords.length===0||this.currentChords[0].beat!==0)&&this.currentChords.unshift({beat:0,chord:this.chordLastBar});var v=r(this.currentChords,8*d/p),y=this.overridePattern?this.overridePattern:this.rhythmPatterns[d+"/"+p];if(s){y=[];for(var m=(g-f)/this.tempoChangeFactor*8,_=0;_<m/2;_+=2)y.push("chick"),y.push("")}if(!y){y=[];for(var _=0;_<8*d/p/2;_++)y.push("chick"),y.push("")}for(var k=!0,x=Math.min(y.length,v.length),_=0;_<x;_++){_>0&&v[_-1]&&v[_]&&v[_-1].boom!==v[_].boom&&(k=!0);var R=y[_],I=R.indexOf("boom")>=0,b=!I&&_!==0&&y[0].indexOf("boom")>=0&&(!v[_-1]||v[_-1].boom!==v[_].boom),A=t(v[_],R,k,b);I&&(k=!1);for(var N=0;N<A.length;N++)this.writeNote(A[N],.125,I||b?this.boomVolume:this.chickVolume,_,o,I||b?this.bassInstrument:this.chordInstrument),b?b=!1:I=!1}}},e.prototype.processChord=function(f){if(!this.chordTrackFinished){var g=this.findChord(f);if(g){var d=this.interpretChord(g);if(d){this.chordTrack.length===0&&this.chordTrack.push({cmd:"program",channel:this.chordChannel,instrument:this.chordInstrument}),this.lastChord=d;var p=i(this.lastBarTime,c(f.time));this.currentChords.push({chord:this.lastChord,beat:p,start:c(f.time)})}}}};function t(f,g,d,p){var l=[];if(!f)return l;g.indexOf("boom")>=0?l.push(d?f.boom:f.boom2):p&&l.push(f.boom);var o=f.chick.length;if(g.indexOf("chick")>=0)for(var h=0;h<o;h++)l.push(f.chick[h]);switch(g){case"DO":l.push(f.chick[0]);break;case"MI":l.push(f.chick[1]);break;case"SOL":l.push(a(f,2));break;case"TI":l.push(a(f,3));break;case"TOP":l.push(a(f,4));break;case"do":l.push(f.chick[0]+12);break;case"mi":l.push(f.chick[1]+12);break;case"sol":l.push(a(f,2)+12);break;case"ti":l.push(a(f,3)+12);break;case"top":l.push(a(f,4)+12);break}return l}function a(f,g){var d=Math.floor(g/f.chick.length),p=f.chick[g%f.chick.length];return p+d*12}function n(f){for(var g=[],d=0;d<f.length;d++){var p=f[d];switch(p){case"z":g.push("");break;case"2":g.push("");break;case"c":g.push("chick");break;case"b":g.push("boom&chick");break;case"f":g.push("boom");break;case"G":g.push("DO");break;case"H":g.push("MI");break;case"I":g.push("SOL");break;case"J":g.push("TI");break;case"K":g.push("TOP");break;case"g":g.push("do");break;case"h":g.push("mi");break;case"i":g.push("sol");break;case"j":g.push("ti");break;case"k":g.push("top");break}}return g}function r(f,g,d){var p=[];if(f.length===0)return p;for(var l=f[0].chord,o=1;o<f.length;o++){for(var h=f[o];p.length<h.beat;)p.push(l);l=h.chord}for(;p.length<g;)p.push(l);return p}function i(f,g){var d=g-f;return d*8}e.prototype.breakSynonyms=["break","(break)","no chord","n.c.","tacet"],e.prototype.basses={A:33,B:35,C:36,D:38,E:40,F:41,G:43},e.prototype.chordIntervals={dim:[0,3,6],"°":[0,3,6],"˚":[0,3,6],dim7:[0,3,6,9],"°7":[0,3,6,9],"˚7":[0,3,6,9],ø7:[0,3,6,10],"m7(b5)":[0,3,6,10],m7b5:[0,3,6,10],"m7♭5":[0,3,6,10],"-7(b5)":[0,3,6,10],"-7b5":[0,3,6,10],"7b5":[0,4,6,10],"7(b5)":[0,4,6,10],"7♭5":[0,4,6,10],"7(b9,b5)":[0,4,6,10,13],"7b9,b5":[0,4,6,10,13],"7(#9,b5)":[0,4,6,10,15],"7#9b5":[0,4,6,10,15],"maj7(b5)":[0,4,6,11],maj7b5:[0,4,6,11],"13(b5)":[0,4,6,10,14,21],"13b5":[0,4,6,10,14,21],m:[0,3,7],"-":[0,3,7],m6:[0,3,7,9],"-6":[0,3,7,9],m7:[0,3,7,10],"-7":[0,3,7,10],"-(b6)":[0,3,7,8],"-b6":[0,3,7,8],"-6/9":[0,3,7,9,14],"-7(b9)":[0,3,7,10,13],"-7b9":[0,3,7,10,13],"-maj7":[0,3,7,11],"-9+7":[0,3,7,11,13],"-11":[0,3,7,11,14,17],m11:[0,3,7,11,14,17],"-maj9":[0,3,7,11,14],"-∆9":[0,3,7,11,14],mM9:[0,3,7,11,14],M:[0,4,7],6:[0,4,7,9],"6/9":[0,4,7,9,14],"6add9":[0,4,7,9,14],69:[0,4,7,9,14],7:[0,4,7,10],9:[0,4,7,10,14],11:[0,7,10,14,17],13:[0,4,7,10,14,21],"7b9":[0,4,7,10,13],"7♭9":[0,4,7,10,13],"7(b9)":[0,4,7,10,13],"7(#9)":[0,4,7,10,15],"7#9":[0,4,7,10,15],"(13)":[0,4,7,10,14,21],"7(9,13)":[0,4,7,10,14,21],"7(#9,b13)":[0,4,7,10,15,20],"7(#11)":[0,4,7,10,14,18],"7#11":[0,4,7,10,14,18],"7(b13)":[0,4,7,10,20],"7b13":[0,4,7,10,20],"9(#11)":[0,4,7,10,14,18],"9#11":[0,4,7,10,14,18],"13(#11)":[0,4,7,10,18,21],"13#11":[0,4,7,10,18,21],maj7:[0,4,7,11],"∆7":[0,4,7,11],Δ7:[0,4,7,11],maj9:[0,4,7,11,14],"maj7(9)":[0,4,7,11,14],"maj7(11)":[0,4,7,11,17],"maj7(#11)":[0,4,7,11,18],"maj7(13)":[0,4,7,14,21],"maj7(9,13)":[0,4,7,11,14,21],"7sus4":[0,5,7,10],m7sus4:[0,3,7,10,17],sus4:[0,5,7],sus2:[0,2,7],"7sus2":[0,2,7,10],"9sus4":[0,5,7,10,14],"13sus4":[0,5,7,10,14,21],aug7:[0,4,8,10],"+7":[0,4,8,10],"+":[0,4,8],"7#5":[0,4,8,10],"7♯5":[0,4,8,10],"7+5":[0,4,8,10],"9#5":[0,4,8,10,14],"9♯5":[0,4,8,10,14],"9+5":[0,4,8,10,14],"-7(#5)":[0,3,8,10],"-7#5":[0,3,8,10],"7(#5)":[0,4,8,10],"7(b9,#5)":[0,4,8,10,13],"7b9#5":[0,4,8,10,13],"maj7(#5)":[0,4,8,11],"maj7#5":[0,4,8,11],"maj7(#5,#11)":[0,4,8,11,18],"maj7#5#11":[0,4,8,11,18],"9(#5)":[0,4,8,10,14],"13(#5)":[0,4,8,10,14,21],"13#5":[0,4,8,10,14,21],5:[0,7],"5(8)":[0,7,12],"5add8":[0,7,12]},e.prototype.rhythmPatterns={"2/2":["boom","","","","chick","","",""],"3/2":["boom","","","","chick","","","","chick","","",""],"4/2":["boom","","","","chick","","","","boom","","","","chick","","",""],"2/4":["boom","","chick",""],"3/4":["boom","","chick","","chick",""],"4/4":["boom","","chick","","boom","","chick",""],"5/4":["boom","","chick","","chick","","boom","","chick",""],"6/4":["boom","","chick","","boom","","chick","","boom","","chick",""],"3/8":["boom","","chick"],"5/8":["boom","chick","chick","boom","chick"],"6/8":["boom","","chick","boom","","chick"],"7/8":["boom","chick","chick","boom","chick","boom","chick"],"9/8":["boom","","chick","boom","","chick","boom","","chick"],"10/8":["boom","chick","chick","boom","chick","chick","boom","chick","boom","chick"],"11/8":["boom","chick","chick","boom","chick","chick","boom","chick","boom","chick","chick"],"12/8":["boom","","chick","boom","","chick","boom","","chick","boom","","chick"]};function c(f){return f/1e6}function u(f,g){return Math.round(f*g*1e6)/1e6}return Br=e,Br}var Lr,ji;function Sl(){if(ji)return Lr;ji=1;var e={f0:"_C",n0:"=C",s0:"^C",x0:"C",f1:"_D",n1:"=D",s1:"^D",x1:"D",f2:"_E",n2:"=E",s2:"^E",x2:"E",f3:"_F",n3:"=F",s3:"^F",x3:"F",f4:"_G",n4:"=G",s4:"^G",x4:"G",f5:"_A",n5:"=A",s5:"^A",x5:"A",f6:"_B",n6:"=B",s6:"^B",x6:"B",f7:"_c",n7:"=c",s7:"^c",x7:"c",f8:"_d",n8:"=d",s8:"^d",x8:"d",f9:"_e",n9:"=e",s9:"^e",x9:"e",f10:"_f",n10:"=f",s10:"^f",x10:"f",f11:"_g",n11:"=g",s11:"^g",x11:"g",f12:"_a",n12:"=a",s12:"^a",x12:"a",f13:"_b",n13:"=b",s13:"^b",x13:"b",f14:"_c'",n14:"=c'",s14:"^c'",x14:"c'",f15:"_d'",n15:"=d'",s15:"^d'",x15:"d'",f16:"_e'",n16:"=e'",s16:"^e'",x16:"e'"};function t(a){var n=(a.accidental?a.accidental[0]:"x")+a.verticalPos;return e[n]}return Lr=t,Lr}var Or,Yi;function dg(){if(Yi)return Or;Yi=1;var e,t=fg(),a=Sl();return(function(){var n,r,i,c,u,f=1,g,d,p,l,o,h,s={num:4,den:4},v=128,y,m=!0,_=105,k=95,x=85,R=[[_,k,x]],I=.25,b,A,N=0,M,z={},L,E=0,T,P=0,B=-.001,O=.4;e=function(Z,W,H,Y){W||(W={}),Y||(Y={}),n=[],r=[0,0,0,0,0,0,0],c=[],u=W.qpm,f=1,g=void 0,d=void 0,p=void 0,l=void 0,o=0,T=H,s={num:4,den:4},m=!0,_=105,k=95,x=85,R=[],I=.25,b=void 0,A=void 0,N=0,M=[],z={},L=1,Z.length>0&&Z[0].length>0&&(E=Z[0][0].pickupLength),W.bassprog!==void 0&&!Y.bassprog&&(Y.bassprog=[W.bassprog]),W.bassvol!==void 0&&!Y.bassvol&&(Y.bassvol=[W.bassvol]),W.chordprog!==void 0&&!Y.chordprog&&(Y.chordprog=[W.chordprog]),W.chordvol!==void 0&&!Y.chordvol&&(Y.chordvol=[W.chordvol]),W.gchord!==void 0&&!Y.gchord&&(Y.gchord=[W.gchord]),h=new t(Z.length,W.chordsOff,Y,s),q(Z,W);for(var Q=0;Q<Z.length;Q++){i=0,h.setTranspose(i);var re=Z[Q];p=[{cmd:"program",channel:Q,instrument:g}],l=void 0,y=0,h.setLastBarTime(0);var ie=!1;(W.voicesOff===!0||W.voicesOff&&W.voicesOff.length&&W.voicesOff.indexOf(Q)>=0)&&(ie=!0);for(var ge=0;ge<re.length;ge++){var ne=re[ge];switch(ne.el_type){case"name":l={cmd:"text",type:"name",text:ne.trackName};break;case"note":V(ne,ie);break;case"key":r=J(ne);break;case"meter":s=ne,h.setMeter(s),I=D(s),Re();break;case"tempo":u?f=ne.qpm?u/ne.qpm:1:u=ne.qpm,h.setTempoChangeFactor(f);break;case"transpose":i=ne.transpose,h.setTranspose(i);break;case"bar":h.barEnd(ne),n=[],Q===0&&ze(Z.length+1),h.setRhythmHead(!1),y=C(ne.time),h.setLastBarTime(y);break;case"bagpipes":break;case"instrument":if(g===void 0&&(g=ne.program),d=ne.program,p.length>0&&p[p.length-1].cmd==="program")p[p.length-1].instrument=ne.program;else{var ue;for(ue=p.length-1;ue>=0&&p[ue].cmd!=="program";ue--);(ue<0||p[ue].instrument!==ne.program)&&p.push({cmd:"program",channel:0,instrument:ne.program})}break;case"channel":w(ne.channel);break;case"drum":z=we(ne.params),Re();break;case"gchordOn":h.gChordOn(ne);break;case"beat":_=ne.beats[0],k=ne.beats[1],x=ne.beats[2],ne.volumesPerNotePitch?R=ne.volumesPerNotePitch:R=[];break;case"vol":b=ne.volume;break;case"volinc":A=ne.volume;break;case"beataccents":m=ne.value;break;case"gchord":case"bassprog":case"chordprog":case"bassvol":case"chordvol":case"gchordbars":h.paramChange(ne);break;default:console.log("MIDI creation. Unknown el_type: "+ne.el_type+`
|
|
90
|
+
`);break}}p[0].instrument===void 0&&(p[0].instrument=g||0),l&&p.unshift(l),c.push(p),h.finish(),M.length>0}return W.detuneOctave&&Oe(c,parseInt(W.detuneOctave,10)),h.addTrack(c),M.length>0&&c.push(M),{tempo:u,instrument:g,tracks:c,totalDuration:o}};function w(Z){for(var W=p.length-1;W>=0;W--)if(p[W].cmd==="program"){p[W].channel=Z;return}}function C(Z){return Z/1e6}function S(Z){return Math.round(Z*f*1e6)/1e6}function q(Z,W){for(var H=0;H<Z.length;H++){for(var Y=Z[H],Q={},re=W.qpm,ie=0,ge=1,ne=0;ne<Y.length;ne++){var ue=Y[ne];if(ue.el_type==="tempo"){re?ge=ue.qpm?re/ue.qpm:1:re=ue.qpm;continue}ue.time=ie;var Ee=ue.duration?ue.duration:0;if(ie+=Math.round(Ee*ge*1e6),ue.pitches){for(var qe=0;qe<ue.pitches.length;qe++){var pe=ue.pitches[qe];if(pe){if(pe.duration=ue.duration,pe.startTie)Q[pe.pitch]===void 0?Q[pe.pitch]={el:ne,pitch:qe}:(Y[Q[pe.pitch].el].pitches[Q[pe.pitch].pitch].duration+=pe.duration,ue.pitches[qe]=null);else if(pe.endTie){var be=Q[pe.pitch];if(be){var $e=pe.duration;delete Y[be.el].pitches[be.pitch].startTie,Y[be.el].pitches[be.pitch].duration+=$e,ue.pitches[qe]=null,delete Q[pe.pitch]}else delete pe.endTie}}}delete ue.duration}}for(var ve in Q)if(Q.hasOwnProperty(ve)){var rt=Q[ve];delete Y[rt.el].pitches[rt.pitch].startTie}}}function D(Z){switch(parseInt(Z.den,10)){case 2:return .5;case 4:return .25;case 8:return Z.num%3===0?.375:.125;case 16:return .125}return .25}function $(Z,W,H){var Y=H-Z;return Y/W}function F(Z,W,H){if(W)return 0;let Y=_,Q=k,re=x;H!==void 0&&R.length>=H+1&&(Y=R[H][0],Q=R[H][1],re=R[H][2]);var ie;if(b!==void 0)ie=b,b=void 0;else if(!m)ie=Q;else if(E>Z)ie=re;else{var ge=$(y,D(s),Z);ge===0?ie=Y:parseInt(ge,10)===ge?ie=Q:ie=re}return A&&(ie+=A,A=void 0),ie<0&&(ie=0),ie>127&&(ie=127),W?0:ie}function K(Z,W){var H={};if(Z.decoration)for(var Y=0;Y<Z.decoration.length;Y++)Z.decoration[Y]==="staccato"?H.thisBreakBetweenNotes="staccato":Z.decoration[Y]==="tenuto"?H.thisBreakBetweenNotes="tenuto":Z.decoration[Y]==="accent"?H.velocity=Math.min(127,W*1.5):Z.decoration[Y]==="trill"?H.noteModification="trill":Z.decoration[Y]==="lowermordent"?H.noteModification="lowermordent":Z.decoration[Y]==="uppermordent"?H.noteModification="pralltriller":Z.decoration[Y]==="mordent"?H.noteModification="mordent":Z.decoration[Y]==="turn"?H.noteModification="turn":Z.decoration[Y]==="roll"?H.noteModification="roll":Z.decoration[Y]==="pralltriller"?H.noteModification="pralltriller":Z.decoration[Y]==="trillh"&&(H.noteModification="trillh");return H}function te(Z,W){var H=W.start,Y=W.duration,Q=S(1/32);switch(Z){case"trill":for(var re=2;Y>0;)p.push({cmd:"note",pitch:W.pitch+re,volume:W.volume,start:H,duration:Q,gap:0,instrument:d,style:"decoration"}),re=re===2?0:2,Y-=Q,H+=Q;break;case"trillh":for(var re=1;Y>0;)p.push({cmd:"note",pitch:W.pitch+re,volume:W.volume,start:H,duration:Q,gap:0,instrument:d,style:"decoration"}),re=re===1?0:1,Y-=Q,H+=Q;break;case"pralltriller":p.push({cmd:"note",pitch:W.pitch,volume:W.volume,start:H,duration:Q,gap:0,instrument:d,style:"decoration"}),Y-=Q,H+=Q,p.push({cmd:"note",pitch:W.pitch+2,volume:W.volume,start:H,duration:Q,gap:0,instrument:d,style:"decoration"}),Y-=Q,H+=Q,p.push({cmd:"note",pitch:W.pitch,volume:W.volume,start:H,duration:Y,gap:0,instrument:d});break;case"mordent":case"lowermordent":p.push({cmd:"note",pitch:W.pitch,volume:W.volume,start:H,duration:Q,gap:0,instrument:d,style:"decoration"}),Y-=Q,H+=Q,p.push({cmd:"note",pitch:W.pitch-2,volume:W.volume,start:H,duration:Q,gap:0,instrument:d,style:"decoration"}),Y-=Q,H+=Q,p.push({cmd:"note",pitch:W.pitch,volume:W.volume,start:H,duration:Y,gap:0,instrument:d});break;case"turn":Q=W.duration/4,p.push({cmd:"note",pitch:W.pitch+2,volume:W.volume,start:H,duration:Q,gap:0,instrument:d,style:"decoration"}),p.push({cmd:"note",pitch:W.pitch,volume:W.volume,start:H+Q,duration:Q,gap:0,instrument:d,style:"decoration"}),p.push({cmd:"note",pitch:W.pitch-1,volume:W.volume,start:H+Q*2,duration:Q,gap:0,instrument:d,style:"decoration"}),p.push({cmd:"note",pitch:W.pitch,volume:W.volume,start:H+Q*3,duration:Q,gap:0,instrument:d,style:"decoration"});break;case"roll":for(;Y>0;)p.push({cmd:"note",pitch:W.pitch,volume:W.volume,start:H,duration:Q,gap:0,instrument:d,style:"decoration"}),Y-=Q*2,H+=Q*2;break}}function V(Z,W){var H=F(C(Z.time),W);h.processChord(Z);var Y;if(Z.gracenotes&&Z.pitches&&Z.pitches.length>0&&Z.pitches[0]&&(Y=ce(Z.gracenotes,Z.pitches[0].duration),Z.elem&&(Z.elem.midiGraceNotePitches=ee(Y,C(Z.time),H*2/3,d))),Z.elem){var Q=C(Z.time),re=Q/I/u*60*1e3;if(Z.elem.currentTrackMilliseconds===void 0)Z.elem.currentTrackMilliseconds=re,Z.elem.currentTrackWholeNotes=Q;else if(Z.elem.currentTrackMilliseconds.length===void 0)Z.elem.currentTrackMilliseconds!==re&&(Z.elem.currentTrackMilliseconds=[Z.elem.currentTrackMilliseconds,re],Z.elem.currentTrackWholeNotes=[Z.elem.currentTrackWholeNotes,Q]);else{for(var ie=!1,ge=0;ge<Z.elem.currentTrackMilliseconds.length;ge++)Z.elem.currentTrackMilliseconds[ge]===re&&(ie=!0);ie||(Z.elem.currentTrackMilliseconds.push(re),Z.elem.currentTrackWholeNotes.push(Q))}}if(Z.pitches){var ne="",ue=K(Z,H);ue.thisBreakBetweenNotes&&(ne=ue.thisBreakBetweenNotes),ue.velocity&&(H=ue.velocity);var Ee=Z.pitches;Z.style==="rhythm"&&(Ee=h.setRhythmHead(!0,Z)),Z.elem&&(Z.elem.midiPitches=[]);for(var qe=0;qe<Ee.length;qe++){let Ze=H;!ue.velocity&&Array.isArray(Z.decoration)&&Z.decoration.length>qe&&(Ze=F(C(Z.time),W,qe));var pe=Ee[qe];if(pe){pe.startSlur&&(N+=pe.startSlur.length),pe.endSlur&&(N-=pe.endSlur.length);var be=pe.actualPitch?pe.actualPitch:le(pe);if(d===v&&T){var $e=a(pe);$e&&T[$e]&&(be=T[$e].sound)}var ve={cmd:"note",pitch:be,volume:Ze,start:C(Z.time),duration:S(pe.duration),instrument:d,startChar:Z.elem.startChar,endChar:Z.elem.endChar};if(ve=he(ve),Z.gracenotes&&(ve.duration=ve.duration/2,ve.start=ve.start+ve.duration),Z.elem&&Z.elem.midiPitches.push(ve),ue.noteModification)te(ue.noteModification,ve);else{switch(N>0?ve.endType="tenuto":ne&&(ve.endType=ne),ve.endType){case"tenuto":ve.gap=B;break;case"staccato":var rt=ve.duration*O;ve.gap=u/60*rt;break;default:ve.gap=P;break}p.push(ve)}}}p.length-1}var Ue=ae(Z);o=Math.max(o,C(Z.time)+S(Ue))}function ae(Z){return Z.pitches&&Z.pitches.length>0&&Z.pitches[0]?Z.pitches[0].duration:Z.elem?Z.elem.duration:Z.duration}var oe=[0,2,4,5,7,9,11];function le(Z){if(Z.midipitch!==void 0)return Z.midipitch;var W=Z.pitch;if(Z.accidental)switch(Z.accidental){case"sharp":n[W]=1;break;case"flat":n[W]=-1;break;case"natural":n[W]=0;break;case"dblsharp":n[W]=2;break;case"dblflat":n[W]=-2;break;case"quartersharp":n[W]=.25;break;case"quarterflat":n[W]=-.25;break}var H=de(W)*12+oe[Se(W)]+60;return n[W]!==void 0?H+=n[W]:H+=r[Se(W)],H+=i,H}function J(Z){var W=[0,0,0,0,0,0,0];if(!Z.accidentals)return W;for(var H=0;H<Z.accidentals.length;H++){var Y=Z.accidentals[H],Q;switch(Y.acc){case"flat":Q=-1;break;case"quarterflat":Q=-.25;break;case"sharp":Q=1;break;case"quartersharp":Q=.25;break;default:Q=0;break}var re=Y.note.toLowerCase(),ie=Se(re.charCodeAt(0)-99);W[ie]+=Q}return W}function ce(Z,W){for(var H=0,Y=[],Q,re=0;re<Z.length;re++)Q=Z[re],H+=Q.duration;var ie=W/2/H;for(re=0;re<Z.length;re++){Q=Z[re];var ge=le(Q);if(d===v&&T){var ne=a(Q);ne&&T[ne]&&(ge=T[ne].sound)}var ue={pitch:ge,duration:Q.duration*ie};ue=he(ue),Y.push(ue)}return Y}function ee(Z,W,H,Y){var Q=[];H=Math.round(H);for(var re=0;re<Z.length;re++){var ie=Z[re];p.push({cmd:"note",pitch:ie.pitch,volume:H,start:W,duration:ie.duration,gap:0,instrument:Y,style:"grace"}),Q.push({pitch:ie.pitch,durationInMeasures:ie.duration,volume:H,instrument:Y}),W+=ie.duration}return Q}function he(Z){var W=""+Z.pitch;return W.indexOf(".75")>=0?(Z.pitch=Math.round(Z.pitch),Z.cents=-50):W.indexOf(".25")>=0&&(Z.pitch=Math.round(Z.pitch),Z.cents=50),Z}function de(Z){return Math.floor(Z/7)}function Se(Z){return Z=Z%7,Z<0&&(Z+=7),Z}function we(Z){if(Z.pattern.length===0||Z.on===!1)return{on:!1};for(var W=Z.pattern[0],H=[],Y="",Q=0,re=0;re<W.length;re++)if(W[re]==="d"&&Q++,W[re]==="d"||W[re]==="z")Y.length!==0?(H.push(Y),Y=W[re]):Y=Y+W[re];else{if(Y.length===0)return{on:!1};Y=Y+W[re]}if(Y.length!==0&&H.push(Y),Z.pattern.length!==Q*2+1)return{on:!1};for(var ie={on:!0,bars:Z.bars,pattern:[]},ge=D(s),ne=0,ue=0;ue<H.length;ue++){Y=H[ue];for(var Ee=1,qe=!1,pe=0,be=1;be<Y.length;be++)switch(Y[be]){case"/":pe!==0&&(Ee*=pe),pe=0,qe=!0;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":pe=pe*10+Y[be];break;default:return{on:!1}}qe?(pe===0&&(pe=2),Ee/=pe):pe&&(Ee*=pe),Y[0]==="d"?(ie.pattern.push({len:Ee*ge,pitch:Z.pattern[1+ne],velocity:Z.pattern[1+ne+Q]}),ne++):ie.pattern.push({len:Ee*ge,pitch:null})}return L=Z.bars?Z.bars:1,ie}function Re(){if(!(!z||!z.pattern)){for(var Z=z,W=0,H=s.num/s.den,Y=0;Y<Z.pattern.length;Y++)W+=Z.pattern[Y].len;var Q=W/L/H;for(Y=0;Y<Z.pattern.length;Y++)Z.pattern[Y].len=Z.pattern[Y].len/Q;z=Z}}function ze(Z){if(!(M.length===0&&!z.on)){var W=s.num/s.den;if(M.length===0){if(o<W)return;M.push({cmd:"program",channel:Z,instrument:v})}if(z.on)for(var H=y,Y=0;Y<z.pattern.length;Y++){var Q=S(z.pattern[Y].len);z.pattern[Y].pitch&&M.push({cmd:"note",pitch:z.pattern[Y].pitch,volume:z.pattern[Y].velocity,start:H,duration:Q,gap:0,instrument:v}),H+=Q}}}function Oe(Z,W){for(var H={},Y=0;Y<Z.length;Y++)for(var Q=0;Q<Z[Y].length;Q++){var re=Z[Y][Q];re.cmd==="note"&&(H[re.start]===void 0&&(H[re.start]=[]),H[re.start].push({track:Y,event:Q,pitch:re.pitch}))}var ie=Object.keys(H);for(Y=0;Y<ie.length;Y++){var ge=H[ie[Y]];if(ge.length>1){ge=ge.sort(function(pe,be){return pe.pitch-be.pitch});var ne=ge[ge.length-1],ue=ne.pitch%12,Ee=!1;for(Q=0;!Ee&&Q<ge.length-1;Q++)ge[Q].pitch%12===ue&&(Ee=!0);if(Ee){var qe=Z[ne.track][ne.event];qe.cents||(qe.cents=0),qe.cents+=W}}}}})(),Or=e,Or}var Dr,Wi;function pg(){if(Wi)return Dr;Wi=1;function e(f,g){g||(g={});for(var d=!!g.lineBreaks,p=[],l=!1,o=[],h=[],s=[],v=[],y=[],m=[],_=[],k=0;k<f.length;k++){var x=u(f[k]);if(x.staff){if(l&&!x.vskip)for(var R=p[p.length-1],I=0;I<R.staff.length;I++){var b=x.staff[I],A=R.staff[I];if(b&&(c(b.meter,o[I])||(a(b.meter,b.voices),o[I]=b.meter,delete b.meter),c(b.key,h[I])||(n(b.key,b.voices),h[I]=b.key,delete b.key),b.title&&(A.abbrevTitle=b.title),c(b.clef,s[I])||(r(b.clef,b.voices),s[I]=b.clef,delete b.clef),c(b.vocalfont,v[I])||(i(b.vocalfont,b.voices,"vocalfont"),v[I]=b.vocalfont,delete b.vocalfont),c(b.gchordfont,y[I])||(i(b.gchordfont,b.voices,"gchordfont"),y[I]=b.gchordfont,delete b.gchordfont),c(b.tripletfont,m[I])||(i(b.tripletfont,b.voices,"tripletfont"),m[I]=b.tripletfont,delete b.tripletfont),c(b.annotationfont,_[I])||(i(b.annotationfont,b.voices,"annotationfont"),_[I]=b.annotationfont,delete b.annotationfont)),b)for(var N=0;N<A.voices.length;N++){var M=A.voices[N],z=b.voices[N];d&&M.push({el_type:"break"}),z&&(A.voices[N]=M.concat(z))}}else{for(var L=0;L<x.staff.length;L++)h[L]=x.staff[L].key,o[L]=x.staff[L].meter,s[L]=x.staff[L].clef;p.push(u(x))}l=!0}else l=!1,p.push(x)}return p}function t(f,g){return f==="abselem"?"abselem":g}function a(f,g){f.el_type="meter",f.startChar=-1,f.endChar=-1;for(var d=0;d<g.length;d++)g[d].unshift(f)}function n(f,g){f.el_type="key",f.startChar=-1,f.endChar=-1;for(var d=0;d<g.length;d++)g[d].unshift(f)}function r(f,g){f.el_type="clef",f.startChar=-1,f.endChar=-1;for(var d=0;d<g.length;d++)g[d].unshift(f)}function i(f,g,d){f.el_type="font",f.type=d,f.startChar=-1,f.endChar=-1;for(var p=0;p<g.length;p++)g[p].unshift(f)}function c(f,g){if(!f)return!0;var d=JSON.stringify(f,t),p=JSON.stringify(g,t);return d===p}function u(f){for(var g={},d=Object.keys(f),p=0;p<d.length;p++)if(d[p]!=="staff")g[d[p]]=f[d[p]];else{g.staff=[];for(var l=0;l<f.staff.length;l++){for(var o={},h=Object.keys(f.staff[l]),s=0;s<h.length;s++)if(h[s]!=="voices")o[h[s]]=f.staff[l][h[s]];else{o.voices=[];for(var v=0;v<f.staff[l].voices.length;v++)o.voices.push([].concat(f.staff[l].voices[v]))}g.staff.push(o)}}return g}return Dr=e,Dr}var Fr,Vi;function Tl(){if(Vi)return Fr;Vi=1;var e=nt(),t=Ve(),a=Cl(),n=dg(),r=pg(),i=function(){this.reset=function(){this.version="1.1.0",this.media="screen",this.metaText={},this.metaTextInfo={},this.formatting={},this.lines=[],this.staffNum=0,this.voiceNum=0,this.lineNum=0,this.runningFonts={},delete this.visualTranspose},this.reset();function c(l,o,h,s){for(var v=0;v<s.length;v++)l[h][s[v]]=o[h][s[v]]}this.copyTopInfo=function(l){var o=["tempo","title","header","rhythm","origin","composer","author","partOrder"];c(this,l,"metaText",o),c(this,l,"metaTextInfo",o)},this.copyBottomInfo=function(l){var o=["unalignedWords","book","source","discography","notes","transcription","history","abc-copyright","abc-creator","abc-edited-by","footer"];c(this,l,"metaText",o),c(this,l,"metaTextInfo",o)},this.getBeatLength=function(){var l=this.getMeterFraction(),o=1;return l.num===6||l.num===9||l.num===12||l.num===3&&l.den===8?o=3:l.den===8&&(l.num===5||l.num===7)&&(o=2),o/l.den};function u(l,o){for(var h=0,s=0;s<l.length;s++)if(l[s].staff)for(var v=0;v<l[s].staff.length;v++)for(var y=0;y<l[s].staff[v].voices.length;y++)for(var m=l[s].staff[v].voices[y],_=1,k=0;k<m.length;k++){var x=m[k].rest&&m[k].rest.type==="spacer";if(m[k].startTriplet&&(_=m[k].tripletMultiplier),m[k].duration&&!x&&m[k].el_type!=="tempo"&&(h+=m[k].duration*_),m[k].endTriplet&&(_=1),h>=o&&(h-=o),m[k].el_type==="bar")return h}return h}this.getPickupLength=function(){var l=this.getBarLength(),o=u(this.lines,l);return o<1e-8||l-o<1e-8?0:o},this.getBarLength=function(){var l=this.getMeterFraction();return l.num/l.den},this.getTotalTime=function(){return this.totalTime},this.getTotalBeats=function(){return this.totalBeats},this.millisecondsPerMeasure=function(l){var o;if(l)o=l;else{var h=this.metaText?this.metaText.tempo:null;o=this.getBpm(h)}o<=0&&(o=1);var s=this.getBeatsPerMeasure(),v=s/o;return v*6e4},this.getBeatsPerMeasure=function(){var l=this.getBeatLength(),o=this.getBarLength();return o/l},this.getMeter=function(){for(var l=0;l<this.lines.length;l++){var o=this.lines[l];if(o.staff)for(var h=0;h<o.staff.length;h++){var s=o.staff[h].meter;if(s)return s}}return{type:"common_time"}},this.getMeterFraction=function(){var l=this.getMeter(),o=4,h=4;if(l)if(l.type==="specified"){if(l.value&&l.value.length>0&&l.value[0].num.indexOf("+")>0){var s=l.value[0].num.split("+");o=0;for(var v=0;v<s.length;v++)o+=parseInt(s[v],10)}else o=parseInt(l.value[0].num,10);h=parseInt(l.value[0].den,10)}else l.type==="cut_time"?(o=2,h=2):l.type==="common_time"&&(o=4,h=4);return this.meter={num:o,den:h},this.meter},this.getKeySignature=function(){for(var l=0;l<this.lines.length;l++){var o=this.lines[l];if(o.staff){for(var h=0;h<o.staff.length;h++)if(o.staff[h].key)return o.staff[h].key}}return{}},this.getElementFromChar=function(l){for(var o=0;o<this.lines.length;o++){var h=this.lines[o];if(h.staff)for(var s=0;s<h.staff.length;s++)for(var v=h.staff[s],y=0;y<v.voices.length;y++)for(var m=v.voices[y],_=0;_<m.length;_++){var k=m[_];if(k.startChar&&k.endChar&&k.startChar<=l&&k.endChar>l)return k}}return null};function f(l){for(var o,h,s,v,y=l.length-1;y>=0;y--){var m=l[y];m.type==="bar"?(m.top=s,m.nextTop=o,o=s,m.bottom=v,m.nextBottom=h,h=v):m.type==="event"&&(s=m.top,v=m.top+m.height)}}function g(l){var o=[];for(var h in l)l.hasOwnProperty(h)&&o.push(l[h]);return o=o.sort(function(s,v){var y=s.milliseconds-v.milliseconds;return y!==0?y:s.type==="bar"?-1:1}),o}this.addElementToEvents=function(l,o,h,s,v,y,m,_,k,x){if(o.hint)return{isTiedState:void 0,duration:0};var R=o.durationClass?o.durationClass:o.duration;if(o.abcelem.rest&&o.abcelem.rest.type==="spacer"&&(R=0),R>0){for(var I=[],b=0;b<o.elemset.length;b++)o.elemset[b]!==null&&I.push(o.elemset[b]);var A=o.startTie;if(k!==void 0)l["event"+k].elements.push(I),x&&(l["event"+h]||(l["event"+h]={type:"event",milliseconds:h,line:y,measureNumber:m,top:s,height:v,left:null,width:0,elements:[],startChar:null,endChar:null,startCharArray:[],endCharArray:[]}),l["event"+h].measureStart=!0,x=!1),A||(k=void 0);else{if(!l["event"+h])l["event"+h]={type:"event",milliseconds:h,line:y,measureNumber:m,top:s,height:v,left:o.x,width:o.w,elements:[I],startChar:o.abcelem.startChar,endChar:o.abcelem.endChar,startCharArray:[o.abcelem.startChar],endCharArray:[o.abcelem.endChar],midiPitches:o.abcelem.midiPitches?e.cloneArray(o.abcelem.midiPitches):[]},o.abcelem.midiGraceNotePitches&&(l["event"+h].midiGraceNotePitches=e.cloneArray(o.abcelem.midiGraceNotePitches));else{if(l["event"+h].left?l["event"+h].left=Math.min(l["event"+h].left,o.x):l["event"+h].left=o.x,l["event"+h].elements.push(I),l["event"+h].startCharArray.push(o.abcelem.startChar),l["event"+h].endCharArray.push(o.abcelem.endChar),l["event"+h].startChar===null&&(l["event"+h].startChar=o.abcelem.startChar),l["event"+h].endChar===null&&(l["event"+h].endChar=o.abcelem.endChar),o.abcelem.midiPitches&&o.abcelem.midiPitches.length){l["event"+h].midiPitches||(l["event"+h].midiPitches=[]);for(var b=0;b<o.abcelem.midiPitches.length;b++)l["event"+h].midiPitches.push(o.abcelem.midiPitches[b])}if(o.abcelem.midiGraceNotePitches&&o.abcelem.midiGraceNotePitches.length){l["event"+h].midiGraceNotePitches||(l["event"+h].midiGraceNotePitches=[]);for(var N=0;N<o.abcelem.midiGraceNotePitches.length;N++)l["event"+h].midiGraceNotePitches.push(o.abcelem.midiGraceNotePitches[N])}}x&&(l["event"+h].measureStart=!0,x=!1)}}return{isTiedState:k,duration:R/_,nextIsBar:x||o.type==="bar"}},this.makeVoicesArray=function(){for(var l=[],o=[],h={},s=0;s<this.engraver.staffgroups.length;s++){var v=this.engraver.staffgroups[s];if(v&&v.staffs&&v.staffs.length>0){var y=v.staffs[0],m=y.absoluteY,_=m-y.top*t.STEP,k=v.staffs[v.staffs.length-1];m=k.absoluteY;for(var x=m-k.bottom*t.STEP,R=x-_,I=v.voices,b=0;b<I.length;b++)if(!(I[b].staff&&I[b].staff.isTabStaff)){var A=!1;l[b]||(l[b]=[]),o[b]===void 0&&(o[b]=0);for(var N=I[b].children,M=0;M<N.length;M++)N[M].type==="tempo"&&(h[o[b]]=this.getBpm(N[M].abcelem)),l[b].push({top:_,height:R,line:v.line,measureNumber:o[b],elem:N[M]}),N[M].type==="bar"&&A&&o[b]++,(N[M].type==="note"||N[M].type==="rest")&&(A=!0)}}}return this.tempoLocations=h,l},this.setupEvents=function(l,o,h,s){s||(s=1);for(var v=[],y={},m=l,_,k=!0,x=this.makeVoicesArray(),R=0,I=0;I<x.length;I++){var b=m,A=Math.round(b*1e3),N=0,M=-1,z=x[I],L=h;o=this.getBeatLength()*L/60;for(var E=-1,T=0;T<z.length;T++){var P=z[T].measureNumber;E!==P&&this.tempoLocations[P]&&(L=this.tempoLocations[P],o=s*this.getBeatLength()*L/60,E=P);var B=z[T].elem,O=this.addElementToEvents(y,B,A,z[T].top,z[T].height,z[T].line,z[T].measureNumber,o,_,k);_=O.isTiedState,k=O.nextIsBar,b+=O.duration;var w;if(B.duration>0&&y["event"+A]&&(w="event"+A),A=Math.round(b*1e3),B.type==="bar"){var C=B.abcelem.type,S=C==="bar_right_repeat"||C==="bar_dbl_repeat",q=B.abcelem.startEnding==="1",D=C==="bar_left_repeat"||C==="bar_dbl_repeat"||C==="bar_right_repeat";if(S){T>0&&(y[w].endX=B.x),M===-1&&(M=T);var $=0;E=-1;for(var F=N;F<M;F++){P=z[F].measureNumber,E!==P&&this.tempoLocations[P]&&(L=this.tempoLocations[P],o=s*this.getBeatLength()*L/60,E=P);var K=z[F].elem;O=this.addElementToEvents(y,K,A,z[F].top,z[F].height,z[F].line,z[F].measureNumber,o,_,k),_=O.isTiedState,k=O.nextIsBar,b+=O.duration,$=A,A=Math.round(b*1e3)}y["event"+$]&&(y["event"+$].endX=z[M].elem.x),k=!0,M=-1}q&&(M=T),D&&(N=T)}}R=Math.max(R,A)}return v=g(y),f(v),p(this.lines,v),v.push({type:"end",milliseconds:R}),this.addUsefulCallbackInfo(v,L*s),v},this.addUsefulCallbackInfo=function(l,o){for(var h=this.millisecondsPerMeasure(o),s=0;s<l.length;s++){var v=l[s];v.millisecondsPerMeasure=h}};function d(l,o){for(;o<l.length&&l[o].left===null;)o++;return l[o]}function p(l,o){if(!(o.length<1)){for(var h=0;h<o.length-1;h++){var s=o[h],v=d(o,h+1);if(s.left!==null){var y=v&&s.top===v.top?v.left:l[s.line].staffGroup.w;s.endX!==void 0?y>s.left&&(s.endX=Math.min(s.endX,y)):s.endX=y}}var m=o[o.length-1];m.endX=l[m.line].staffGroup.w}}this.getBpm=function(l){var o;if(l||(l=this.metaText?this.metaText.tempo:null),l){o=l.bpm;var h=this.getBeatLength(),s=l.duration&&l.duration.length>0?l.duration[0]:h;o=o*s/h}if(!o){o=180;var v=this.getMeterFraction();v&&v.num!==3&&v.num%3===0&&(o=120)}return o},this.setTiming=function(l,o){if(o=o||0,!this.engraver||!this.engraver.staffgroups)return console.log("setTiming cannot be called before the tune is drawn."),this.noteTimings=[],this.noteTimings;var h=this.metaText?this.metaText.tempo:null,s=this.getBpm(h),v=1;l?h&&(v=l/s):l=s;var y=this.getBeatLength(),m=l/60,_=this.getBarLength(),k=_/y*o/m;k&&(k-=this.getPickupLength()/y/m);var x=y*m;return this.noteTimings=this.setupEvents(k,x,l,v),this.noteTimings.length>0?(this.totalTime=this.noteTimings[this.noteTimings.length-1].milliseconds/1e3,this.totalBeats=this.totalTime*m):(this.totalTime=void 0,this.totalBeats=void 0),this.noteTimings},this.setUpAudio=function(l){l||(l={});var o=a(this,l);return n(o,l,this.formatting.percmap,this.formatting.midi)},this.deline=function(l){return r(this.lines,l)},this.findSelectableElement=function(l){return this.engraver&&this.engraver.selectables?this.engraver.findSelectableElement(l):null},this.getSelectableArray=function(){return this.engraver&&this.engraver.selectables?this.engraver.selectables:[]}};return Fr=i,Fr}var Hr,Xi;function gg(){if(Xi)return Hr;Xi=1;var e=Za(),t=function(b){var A=this,N={},M="";b.reset(),this.setVisualTranspose=function(z){z!==void 0&&(b.visualTranspose=z)},this.cleanUp=function(z,L,E){o(b),delete b.runningFonts,n(b),b.metaText.tempo&&b.metaText.tempo.bpm&&!b.metaText.tempo.duration&&(b.metaText.tempo.duration=[b.getBeatLength()]);var T=!1,P,B,O;for(P=0;P<b.lines.length;P++)if(b.lines[P].staff!==void 0){var w=!1;for(B=0;B<b.lines[P].staff.length;B++)if(b.lines[P].staff[B]===void 0)T=!0,b.lines[P].staff[B]=null;else for(O=0;O<b.lines[P].staff[B].voices.length;O++)b.lines[P].staff[B].voices[O]===void 0?b.lines[P].staff[B].voices[O]=[]:h(b.lines[P].staff[B].voices[O])&&(w=!0);w||(b.lines[P]=null,T=!0)}if(T&&(b.lines=b.lines.filter(function(F){return!!F}),b.lines.forEach(function(F){F.staff&&(F.staff=F.staff.filter(function(K){return!!K}))})),z)for(;f(b.lines,z););if(L){for(T=!1,P=0;P<b.lines.length;P++)if(b.lines[P].staff!==void 0)for(B=0;B<b.lines[P].staff.length;B++){var C=!1;for(O=0;O<b.lines[P].staff[B].voices.length;O++)s(b.lines[P].staff[B].voices[O])&&(C=!0);C||(T=!0,b.lines[P].staff[B]=null)}T&&b.lines.forEach(function(F){F.staff&&(F.staff=F.staff.filter(function(K){return!!K}))})}for(c(b.lines),P=0;P<b.lines.length;P++)if(b.lines[P].staff)for(B=0;B<b.lines[P].staff.length;B++)delete b.lines[P].staff[B].workingClef;for(;r(b););for(var P=0;P<b.lines.length;P++){var S=b.lines[P].staff;if(S)for(b.staffNum=0;b.staffNum<S.length;b.staffNum++)for(S[b.staffNum].clef&&e.fixClef(S[b.staffNum].clef),b.voiceNum=0;b.voiceNum<S[b.staffNum].voices.length;b.voiceNum++){var q=S[b.staffNum].voices[b.voiceNum];u(q,b.staffNum,b.voiceNum,E);for(var D=0;D<q.length;D++)q[D].el_type==="clef"&&e.fixClef(q[D]);if(q.length>0&&q[q.length-1].barNumber){var $=d(b.lines,P);$&&($.staff[0].barNumber=q[q.length-1].barNumber),delete q[q.length-1].barNumber}}}return delete b.staffNum,delete b.voiceNum,delete b.lineNum,delete b.potentialStartBeam,delete b.potentialEndBeam,delete b.vskipPending,E},this.addTieToLastNote=function(z){var L=p(b);return L&&L.pitches&&L.pitches.length>0?(L.pitches[0].startTie={},z&&(L.pitches[0].startTie.style="dotted"),!0):!1},this.appendElement=function(z,L,E,T){if(T.el_type=z,L!==null&&(T.startChar=L),E!==null&&(T.endChar=E),z==="note"){var P=l(T);P>=.25||T.force_end_beam_last&&b.potentialStartBeam!==void 0?_(b):T.end_beam&&b.potentialStartBeam!==void 0?T.rest===void 0?m(T,b):_(b):T.rest===void 0&&(b.potentialStartBeam===void 0?T.end_beam||(b.potentialStartBeam=T,delete b.potentialEndBeam):b.potentialEndBeam=T)}else _(b);return delete T.end_beam,delete T.force_end_beam_last,T.rest&&T.rest.type==="invisible"&&delete T.decoration,b.lines.length<=b.lineNum||b.lines[b.lineNum].staff.length<=b.staffNum?!1:(y(A,b,T,N,M),!0)},this.appendStartingElement=function(z,L,E,T){o(b);var P;z==="key"&&(P=T.impliedNaturals,delete T.impliedNaturals,delete T.explicitAccidentals);var B=Object.assign({},T);if(b.lines[b.lineNum]){var O=b.lines[b.lineNum].staff;if(O){O.length<=b.staffNum&&(O[b.staffNum]={},O[b.staffNum].clef=Object.assign({},O[0].clef),O[b.staffNum].key=Object.assign({},O[0].key),O[0].meter&&(O[b.staffNum].meter=Object.assign({},O[0].meter)),O[b.staffNum].workingClef=Object.assign({},O[0].workingClef),O[b.staffNum].voices=[[]]),z==="clef"&&(O[b.staffNum].workingClef=B);for(var w=O[b.staffNum].voices[b.voiceNum],C=0;C<w.length;C++){if(w[C].el_type==="note"||w[C].el_type==="bar"){B.el_type=z,B.startChar=L,B.endChar=E,P&&(B.accidentals=P.concat(B.accidentals)),w.push(B);return}if(w[C].el_type===z){B.el_type=z,B.startChar=L,B.endChar=E,P&&(B.accidentals=P.concat(B.accidentals)),w[C]=B;return}}O[b.staffNum][z]=T}}},this.addSubtitle=function(z,L){v(b,{subtitle:{text:z,startChar:L.startChar,endChar:L.endChar}})},this.addSpacing=function(z){b.vskipPending=z},this.addNewPage=function(z){v(b,{newpage:z})},this.addSeparator=function(z,L,E,T){v(b,{separator:{spaceAbove:Math.round(z),spaceBelow:Math.round(L),lineLength:Math.round(E),startChar:T.startChar,endChar:T.endChar}})},this.addText=function(z,L){v(b,{text:{text:z,startChar:L.startChar,endChar:L.endChar}})},this.addCentered=function(z){v(b,{text:[{text:z,center:!0}]})},this.changeVoiceScale=function(z){A.appendElement("scale",null,null,{size:z})},this.changeVoiceColor=function(z){A.appendElement("color",null,null,{color:z})},this.startNewLine=function(z){o(b),z.currentVoiceName&&(M=z.currentVoiceName,N[z.currentVoiceName]=z),b.lines[b.lineNum]===void 0?I(A,b,z):b.lines[b.lineNum].staff===void 0?(b.lineNum++,this.startNewLine(z)):b.lines[b.lineNum].staff[b.staffNum]===void 0?R(A,b,z):b.lines[b.lineNum].staff[b.staffNum].voices[b.voiceNum]===void 0?x(A,b,z):h(b.lines[b.lineNum].staff[b.staffNum].voices[b.voiceNum])?(b.lineNum++,this.startNewLine(z)):z.part&&A.appendElement("part",z.part.startChar,z.part.endChar,{title:z.part.title})},this.setRunningFont=function(z,L){b.runningFonts[z]=L},this.setBarNumberImmediate=function(z){var L=this.getCurrentVoice();if(L&&L.length>0){var E=L[L.length-1];if(E.el_type==="bar")E.barNumber!==void 0&&(E.barNumber=z);else return z-1}return z},this.hasBeginMusic=function(){for(var z=0;z<b.lines.length;z++)if(b.lines[z].staff)return!0;return!1},this.isFirstLine=function(z){for(var L=z-1;L>=0;L--)if(b.lines[L].staff!==void 0)return!1;return!0},this.getCurrentVoice=function(){var z=g(b.lines,b.lineNum);if(!z)return null;var L=z.staff[b.staffNum];return L&&L.voices[b.voiceNum]!==void 0?L.voices[b.voiceNum]:null},this.setCurrentVoice=function(z,L,E){b.staffNum=z,b.voiceNum=L,M=E;for(var T=0;T<b.lines.length;T++)if(b.lines[T].staff&&(b.lines[T].staff[z]===void 0||b.lines[T].staff[z].voices[L]===void 0||!h(b.lines[T].staff[z].voices[L])))return b.lineNum=T,!!(!b.lines[T].staff[z]||b.lines[T].staff[z].voices[L]);return b.lineNum=T,!1},this.addMetaText=function(z,L,E){b.metaText[z]===void 0?(b.metaText[z]=L,b.metaTextInfo[z]=E):(typeof b.metaText[z]=="string"&&typeof L=="string"?b.metaText[z]+=`
|
|
91
91
|
`+L:(b.metaText[z]==="string"&&(b.metaText[z]=[{text:b.metaText[z]}]),typeof L=="string"&&(L=[{text:L}]),b.metaText[z]=b.metaText[z].concat(L)),b.metaTextInfo[z].endChar=E.endChar)},this.addMetaTextArray=function(z,L,E){b.metaText[z]===void 0?(b.metaText[z]=[L],b.metaTextInfo[z]=E):(b.metaText[z].push(L),b.metaTextInfo[z].endChar=E.endChar)},this.addMetaTextObj=function(z,L,E){b.metaText[z]=L,b.metaTextInfo[z]=E}};function a(b){if(!b||typeof b=="string")return!1;for(var A=0;A<b.length;A++)if(typeof b[A]!="string")return!1;return!0}function n(b){a(b.metaText.notes)&&(b.metaText.notes=b.metaText.notes.join(`
|
|
92
92
|
`)),a(b.metaText.history)&&(b.metaText.history=b.metaText.history.join(`
|
|
93
93
|
`))}function r(b){for(var A=!1,N=[],M=0;M<b.lines.length;M++){var z=b.lines[M];if(z.staff)for(var L=0;L<z.staff.length;L++){for(var E=z.staff[L],T=[],P=0;P<E.voices.length;P++){var B=E.voices[P];T.push({hasOverlay:!1,voice:[],snip:[]}),N[M]=0;for(var O=0,w=!1,C=-1,S=0;S<B.length;S++){var q=B[S];if(q.el_type==="overlay"&&!w){A=!0,w=!0,C=S,T[P].hasOverlay=!0;for(var D=0;D<M;D++)N[D]&&b.lines[D].staff&&E.voices.length>=b.lines[D].staff[0].voices.length&&b.lines[D].staff[0].voices.push([{el_type:"note",duration:N[D],rest:{type:"invisible"},startChar:q.startChar,endChar:q.endChar}])}else q.el_type==="bar"?(w?(w=!1,T[P].snip.push({start:C,len:S-C}),T[P].voice.push(q)):(O>0&&T[P].voice.push({el_type:"note",duration:O,rest:{type:"invisible"},startChar:q.startChar,endChar:q.endChar}),T[P].voice.push(q)),O=0):q.el_type==="note"?w?T[P].voice.push(q):(!q.rest||q.rest.type!=="spacer")&&(O+=q.duration,N[M]+=q.duration):(q.el_type==="scale"||q.el_type==="stem"||q.el_type==="overlay"||q.el_type==="style"||q.el_type==="transpose"||q.el_type==="color")&&T[P].voice.push(q)}T[P].hasOverlay&&T[P].snip.length===0&&T[P].snip.push({start:C,len:B.length-C})}for(P=0;P<T.length;P++){var $=T[P];if($.hasOverlay){$.voice.splice(0,0,{el_type:"stem",direction:"down"}),E.voices.push($.voice);for(var F=$.snip.length-1;F>=0;F--){var K=$.snip[F];E.voices[P].splice(K.start,K.len),E.voices[P].splice(K.start+1,0,{el_type:"stem",direction:"auto"});var te=i(E.voices[P],K.start);E.voices[P].splice(te,0,{el_type:"stem",direction:"up"})}for(F=0;F<E.voices[E.voices.length-1].length;F++){E.voices[E.voices.length-1][F]=Object.assign({},E.voices[E.voices.length-1][F]);var V=E.voices[E.voices.length-1][F];V.el_type==="bar"&&V.startEnding&&delete V.startEnding,V.el_type==="bar"&&V.endEnding&&delete V.endEnding}}}}}return A}function i(b,A){for(var N=A-1;N>0&&b[N].el_type!=="bar";N--);return N}function c(b){for(var A=!0,N=0;N<b.length;N++){var M=b[N];if(M.staff){for(var z=0;z<M.staff.length;z++){var L=M.staff[z];if(L.title){for(var E=!1,T=0;T<L.title.length;T++)L.title[T]?(L.title[T]=A?L.title[T].name:L.title[T].subname,L.title[T]?E=!0:L.title[T]=""):L.title[T]="";E||delete L.title}}A=!1}}}function u(b,A,N,M){M[A]||(M[A]=[]),M[A][N]||(M[A][N]=[]);for(var z,L=function(F,K,te){if(M[A][N][te]===void 0){for(z=0;z<M[A][N].length;z++)if(M[A][N][z]!==void 0){te=z;break}if(M[A][N][te]===void 0){var V=te*100+1;F.endSlur.forEach(function(le){V===le&&--V}),M[A][N][te]=[V]}}for(var ae,oe=0;oe<K;oe++)ae=M[A][N][te].pop(),F.endSlur.push(ae);return M[A][N][te].length===0&&delete M[A][N][te],ae},E=function(F,K,te,V){F.startSlur=[],M[A][N][te]===void 0&&(M[A][N][te]=[]);for(var ae=te*100+1,oe=0;oe<K;oe++)V&&(V.forEach(function(le){ae===le&&++ae}),V.forEach(function(le){ae===le&&++ae}),V.forEach(function(le){ae===le&&++ae})),M[A][N][te].forEach(function(le){ae===le&&++ae}),M[A][N][te].forEach(function(le){ae===le&&++ae}),M[A][N][te].push(ae),F.startSlur.push({label:ae}),F.dottedSlur&&(F.startSlur[F.startSlur.length-1].style="dotted",delete F.dottedSlur),ae++},T=0;T<b.length;T++){var P=b[T];if(P.el_type==="note"){if(P.gracenotes)for(var B=0;B<P.gracenotes.length;B++){if(P.gracenotes[B].endSlur){var O=P.gracenotes[B].endSlur;P.gracenotes[B].endSlur=[];for(var w=0;w<O;w++)L(P.gracenotes[B],1,20)}P.gracenotes[B].startSlur&&(z=P.gracenotes[B].startSlur,E(P.gracenotes[B],z,20))}if(P.endSlur&&(z=P.endSlur,P.endSlur=[],L(P,z,0)),P.startSlur&&(z=P.startSlur,E(P,z,0)),P.pitches){for(var C=[],S=0;S<P.pitches.length;S++)if(P.pitches[S].endSlur){var q=P.pitches[S].endSlur;P.pitches[S].endSlur=[];for(var D=0;D<q;D++){var $=L(P.pitches[S],1,S+1);C.push($)}}for(S=0;S<P.pitches.length;S++)P.pitches[S].startSlur&&(z=P.pitches[S].startSlur,E(P.pitches[S],z,S+1,C));P.gracenotes&&P.pitches[0].endSlur&&P.pitches[0].endSlur[0]===100&&P.pitches[0].startSlur&&(P.gracenotes[0].endSlur?P.gracenotes[0].endSlur.push(P.pitches[0].startSlur[0].label):P.gracenotes[0].endSlur=[P.pitches[0].startSlur[0].label],P.pitches[0].endSlur.length===1?delete P.pitches[0].endSlur:P.pitches[0].endSlur[0]===100?P.pitches[0].endSlur.shift():P.pitches[0].endSlur[P.pitches[0].endSlur.length-1]===100&&P.pitches[0].endSlur.pop(),M[A][N][1].length===1?delete M[A][N][1]:M[A][N][1].pop())}}}}function f(b,A){for(var N=0;N<b.length;N++)if(b[N].staff!==void 0)for(var M=0;M<b[N].staff.length;M++)for(var z=[],L=0;L<b[N].staff[M].voices.length;L++)for(var E=b[N].staff[M].voices[L],T=0,P=0;P<E.length;P++)if(E[P].el_type==="bar"){if(T++,T>=A&&P<E.length-1){var B=d(b,N);if(!B){var O=JSON.parse(JSON.stringify(b[N]));b.push(Object.assign({},O)),B=b[b.length-1];for(var w=0;w<B.staff.length;w++)for(var C=0;C<B.staff[w].voices.length;C++)B.staff[w].voices[C]=[]}var S=P+1,q=b[N].staff[M].voices[L].slice(S);return b[N].staff[M].voices[L]=b[N].staff[M].voices[L].slice(0,S),B.staff[M].voices[L]=z.concat(q.concat(B.staff[M].voices[L])),!0}}else E[P].duration||z.push(E[P]);return!1}function g(b,A){if(b.length<=A)return null;for(;A>=0;){if(b[A].staff)return b[A];A--}return null}function d(b,A){for(A++;b.length>A;){if(b[A].staff)return b[A];A++}return null}function p(b){if(!b.lines[b.lineNum]||!b.lines[b.lineNum].staff||!b.lines[b.lineNum].staff[b.staffNum])return null;var A=b.lines[b.lineNum].staff[b.staffNum].voices[b.voiceNum];if(!A)return null;for(var N=A.length-1;N>=0;N--){var M=A[N];if(M.el_type==="note")return M}return null}function l(b){return b.duration?b.duration:0}function o(b){b.potentialStartBeam&&b.potentialEndBeam&&(b.potentialStartBeam.startBeam=!0,b.potentialEndBeam.endBeam=!0),delete b.potentialStartBeam,delete b.potentialEndBeam}function h(b){for(var A=0;A<b.length;A++)if(b[A].el_type==="note"||b[A].el_type==="bar")return!0;return!1}function s(b){for(var A=0;A<b.length;A++)if(b[A].el_type==="note"&&(b[A].rest===void 0||b[A].chord!==void 0))return!0;return!1}function v(b,A){b.vskipPending&&(A.vskip=b.vskipPending,delete b.vskipPending),b.lines.push(A)}function y(b,A,N,M,z){var L=A.lines[A.lineNum].staff[A.staffNum];if(N.pitches!==void 0){var E=L.workingClef.verticalPos;N.pitches.forEach(function(P){P.verticalPos=P.pitch-E})}if(N.gracenotes!==void 0){var T=L.workingClef.verticalPos;N.gracenotes.forEach(function(P){P.verticalPos=P.pitch-T})}L.voices.length<=A.voiceNum&&(M[z]||(M[z]={}),x(b,A,M[z])),L.voices[A.voiceNum].push(N)}function m(b,A){A.potentialStartBeam.startBeam=!0,b.endBeam=!0,delete A.potentialStartBeam,delete A.potentialEndBeam}function _(b){b.potentialStartBeam!==void 0&&b.potentialEndBeam!==void 0&&(b.potentialStartBeam.startBeam=!0,b.potentialEndBeam.endBeam=!0),delete b.potentialStartBeam,delete b.potentialEndBeam}function k(b,A,N){if(b.runningFonts[A]){for(var M=!1,z=Object.keys(N),L=0;L<z.length;L++)b.runningFonts[A][z[L]]!==N[z[L]]&&(M=!0);M&&(b.lines[b.lineNum].staff[b.staffNum][A]=N)}b.runningFonts[A]=N}function x(b,A,N){var M=A.lines[A.lineNum].staff[A.staffNum];if(M.voices[A.voiceNum]=[],M.title||(M.title=[]),M.title[A.voiceNum]={name:N.name,subname:N.subname},N.style&&b.appendElement("style",null,null,{head:N.style}),N.stem)b.appendElement("stem",null,null,{direction:N.stem});else if(A.voiceNum>0){if(M.voices[0]!==void 0){for(var z=!1,L=0;L<M.voices[0].length;L++)M.voices[0].el_type==="stem"&&(z=!0);if(!z){var E={el_type:"stem",direction:"up"};M.voices[0].splice(0,0,E)}}b.appendElement("stem",null,null,{direction:"down"})}N.scale&&b.appendElement("scale",null,null,{size:N.scale}),N.color&&b.appendElement("color",null,null,{color:N.color})}function R(b,A,N){N.key&&N.key.impliedNaturals&&(N.key.accidentals=N.key.accidentals.concat(N.key.impliedNaturals),delete N.key.impliedNaturals),A.lines[A.lineNum].staff[A.staffNum]={voices:[],clef:N.clef,key:N.key,workingClef:N.clef};var M=A.lines[A.lineNum].staff[A.staffNum];N.stafflines!==void 0&&(M.clef.stafflines=N.stafflines,M.workingClef.stafflines=N.stafflines),N.staffscale&&(M.staffscale=N.staffscale),N.annotationfont&&k(A,"annotationfont",N.annotationfont),N.gchordfont&&k(A,"gchordfont",N.gchordfont),N.tripletfont&&k(A,"tripletfont",N.tripletfont),N.vocalfont&&k(A,"vocalfont",N.vocalfont),N.bracket&&(M.bracket=N.bracket),N.brace&&(M.brace=N.brace),N.connectBarLines&&(M.connectBarLines=N.connectBarLines),N.barNumber&&(M.barNumber=N.barNumber),x(b,A,N),N.part&&b.appendElement("part",N.part.startChar,N.part.endChar,{title:N.part.title}),N.meter!==void 0&&(M.meter=N.meter),A.vskipPending&&(A.lines[A.lineNum].vskip=A.vskipPending,delete A.vskipPending)}function I(b,A,N){A.lines[A.lineNum]={staff:[]},R(b,A,N)}return Hr=t,Hr}var $r,Ki;function El(){if(Ki)return $r;Ki=1;var e=nt(),t=$a(),a=sg(),n=cg(),r=lg(),i=xl(),c=ug(),u=Tl(),f=gg(),g=function(){var d=new u,p=new f(d),l,o="",h="";this.getTune=function(){var E={formatting:d.formatting,lines:d.lines,media:d.media,metaText:d.metaText,metaTextInfo:d.metaTextInfo,version:d.version,addElementToEvents:d.addElementToEvents,addUsefulCallbackInfo:d.addUsefulCallbackInfo,getTotalTime:d.getTotalTime,getTotalBeats:d.getTotalBeats,getBarLength:d.getBarLength,getBeatLength:d.getBeatLength,getBeatsPerMeasure:d.getBeatsPerMeasure,getBpm:d.getBpm,getMeter:d.getMeter,getMeterFraction:d.getMeterFraction,getPickupLength:d.getPickupLength,getKeySignature:d.getKeySignature,getElementFromChar:d.getElementFromChar,makeVoicesArray:d.makeVoicesArray,millisecondsPerMeasure:d.millisecondsPerMeasure,setupEvents:d.setupEvents,setTiming:d.setTiming,setUpAudio:d.setUpAudio,deline:d.deline,findSelectableElement:d.findSelectableElement,getSelectableArray:d.getSelectableArray};return d.lineBreaks&&(E.lineBreaks=d.lineBreaks),d.visualTranspose&&(E.visualTranspose=d.visualTranspose),d.chordGrid&&(E.chordGrid=d.chordGrid),E};function s(E,T,P){E.positioning||(E.positioning={}),E.positioning[T]=P}function v(E,T,P){E.fonts||(E.fonts={}),E.fonts[T]=P}var y={reset:function(){for(var E in this)this.hasOwnProperty(E)&&typeof this[E]!="function"&&delete this[E];this.iChar=0,this.key={accidentals:[],root:"none",acc:"",mode:""},this.meter=null,this.origMeter=null,this.hasMainTitle=!1,this.default_length=.125,this.clef={type:"treble",verticalPos:0},this.octave=0,this.next_note_duration=0,this.start_new_line=!0,this.is_in_header=!0,this.partForNextLine={},this.tempoForNextLine=[],this.havent_set_length=!0,this.voices={},this.staves=[],this.macros={},this.currBarNumber=1,this.barCounter={},this.ignoredDecorations=[],this.score_is_present=!1,this.inEnding=!1,this.inTie=[],this.inTieChord={},this.vocalPosition="auto",this.dynamicPosition="auto",this.chordPosition="auto",this.ornamentPosition="auto",this.volumePosition="auto",this.openSlurs=[],this.freegchord=!1,this.endingHoldOver={}},differentFont:function(E,T){return this[E].decoration!==T[E].decoration||this[E].face!==T[E].face||this[E].size!==T[E].size||this[E].style!==T[E].style||this[E].weight!==T[E].weight},addFormattingOptions:function(E,T,P){P==="note"?(this.vocalPosition!=="auto"&&s(E,"vocalPosition",this.vocalPosition),this.dynamicPosition!=="auto"&&s(E,"dynamicPosition",this.dynamicPosition),this.chordPosition!=="auto"&&s(E,"chordPosition",this.chordPosition),this.ornamentPosition!=="auto"&&s(E,"ornamentPosition",this.ornamentPosition),this.volumePosition!=="auto"&&s(E,"volumePosition",this.volumePosition),this.differentFont("annotationfont",T)&&v(E,"annotationfont",this.annotationfont),this.differentFont("gchordfont",T)&&v(E,"gchordfont",this.gchordfont),this.differentFont("vocalfont",T)&&v(E,"vocalfont",this.vocalfont),this.differentFont("tripletfont",T)&&v(E,"tripletfont",this.tripletfont)):P==="bar"&&(this.dynamicPosition!=="auto"&&s(E,"dynamicPosition",this.dynamicPosition),this.chordPosition!=="auto"&&s(E,"chordPosition",this.chordPosition),this.ornamentPosition!=="auto"&&s(E,"ornamentPosition",this.ornamentPosition),this.volumePosition!=="auto"&&s(E,"volumePosition",this.volumePosition),this.differentFont("measurefont",T)&&v(E,"measurefont",this.measurefont),this.differentFont("repeatfont",T)&&v(E,"repeatfont",this.repeatfont))},duplicateStartEndingHoldOvers:function(){this.endingHoldOver={inTie:[],inTieChord:{}};for(var E=0;E<this.inTie.length;E++)if(this.endingHoldOver.inTie.push([]),this.inTie[E])for(var T=0;T<this.inTie[E].length;T++)this.endingHoldOver.inTie[E].push(this.inTie[E][T]);for(var P in this.inTieChord)this.inTieChord.hasOwnProperty(P)&&(this.endingHoldOver.inTieChord[P]=this.inTieChord[P])},restoreStartEndingHoldOvers:function(){if(this.endingHoldOver.inTie){this.inTie=[],this.inTieChord={};for(var E=0;E<this.endingHoldOver.inTie.length;E++){this.inTie.push([]);for(var T=0;T<this.endingHoldOver.inTie[E].length;T++)this.inTie[E].push(this.endingHoldOver.inTie[E][T])}for(var P in this.endingHoldOver.inTieChord)this.endingHoldOver.inTieChord.hasOwnProperty(P)&&(this.inTieChord[P]=this.endingHoldOver.inTieChord[P])}}},m=function(E){y.warnings||(y.warnings=[]),y.warnings.push(E)},_=function(E){y.warningObjects||(y.warningObjects=[]),y.warningObjects.push(E)},k=function(E){var T=E.replace(/\x12/g," ");return T=T.replace(/&/g,"&"),T=T.replace(/</g,"<"),T.replace(/>/g,">")},x=function(E,T,P){T||(T=" ");var B=T[P];(B===" "||!B)&&(B="SPACE");var O=k(T.substring(P-64,P))+'<span style="text-decoration:underline;font-size:1.3em;font-weight:bold;">'+B+"</span>"+k(T.substring(P+1).substring(0,64));m("Music Line:"+l.lineIndex+":"+(P+1)+": "+E+": "+O),_({message:E,line:T,startChar:y.iChar+P,column:P})},R,I;this.getWarnings=function(){return y.warnings},this.getWarningObjects=function(){return y.warningObjects};var b=function(E,T){if(T.indexOf("")>=0){o+=T;return}if(T=o+T,o="",!E){x("Can't add words before the first line of music",E,0);return}T=e.strip(T),T[T.length-1]!=="-"&&(T=T+" ");for(var P=[],B=0,O=!1,w=function(q){var D=e.strip(T.substring(B,q));if(D=D.replace(/\\([-_*|~])/g,"$1"),B=q+1,D.length>0){O&&(D=D.replace(/~/g," "));var $=T[q];return $!=="_"&&$!=="-"&&($=" "),P.push({syllable:l.translateString(D),divider:$}),O=!1,!0}return!1},C=!1,S=0;S<T.length;S++){switch(T[S]){case" ":case"":w(S);break;case"-":!C&&!w(S)&&P.length>0&&(e.last(P).divider="-",P.push({skip:!0,to:"next"}));break;case"_":C||(w(S),P.push({skip:!0,to:"slur"}));break;case"*":C||(w(S),P.push({skip:!0,to:"next"}));break;case"|":C||(w(S),P.push({skip:!0,to:"bar"}));break;case"~":C||(O=!0);break}C=T[S]==="\\"}E.forEach(function(q){if(P.length!==0){if(P[0].skip){switch(P[0].to){case"next":q.el_type==="note"&&q.pitches!==null&&P.shift();break;case"slur":q.el_type==="note"&&q.pitches!==null&&P.shift();break;case"bar":q.el_type==="bar"&&P.shift();break}q.el_type!=="bar"&&(q.lyric===void 0?q.lyric=[{syllable:"",divider:" "}]:q.lyric.push({syllable:"",divider:" "}))}else if(q.el_type==="note"&&q.rest===void 0){var D=P.shift();D.syllable&&(D.syllable=D.syllable.replace(/ +/g," ")),q.lyric===void 0?q.lyric=[D]:q.lyric.push(D)}}})},A=function(E,T){if(T.indexOf("")>=0){h+=T;return}if(T=h+T,h="",!E){x("Can't add symbols before the first line of music",E,0);return}T=e.strip(T),T[T.length-1]!=="-"&&(T=T+" ");for(var P=[],B=0,O=!1,w=function(S){var q=e.strip(T.substring(B,S));if(B=S+1,q.length>0){O&&(q=q.replace(/~/g," "));var D=T[S];return D!=="_"&&D!=="-"&&(D=" "),P.push({syllable:l.translateString(q),divider:D}),O=!1,!0}return!1},C=0;C<T.length;C++)switch(T[C]){case" ":case"":w(C);break;case"-":!w(C)&&P.length>0&&(e.last(P).divider="-",P.push({skip:!0,to:"next"}));break;case"_":w(C),P.push({skip:!0,to:"slur"});break;case"*":w(C),P.push({skip:!0,to:"next"});break;case"|":w(C),P.push({skip:!0,to:"bar"});break;case"~":O=!0;break}E.forEach(function(S){if(P.length!==0){if(P[0].skip)switch(P[0].to){case"next":S.el_type==="note"&&S.pitches!==null&&P.shift();break;case"slur":S.el_type==="note"&&S.pitches!==null&&P.shift();break;case"bar":S.el_type==="bar"&&P.shift();break}else if(S.el_type==="note"&&S.rest===void 0){var q=P.shift();S.lyric===void 0?S.lyric=[q]:S.lyric.push(q)}}})},N=function(E){if(e.startsWith(E,"%%")){var T=t.addDirective(E.substring(2));T&&x(T,E,2);return}var P=E.indexOf("%");if(P>=0&&(E=E.substring(0,P)),E=E.replace(/\s+$/,""),E.length!==0){if(o){b(p.getCurrentVoice(),E.substring(2));return}if(h){A(p.getCurrentVoice(),E.substring(2));return}if(E.length<2||E[1]!==":"||I.lineContinuation){I.parseMusic(E);return}var B=R.parseHeader(E);B.regular&&I.parseMusic(E),B.newline&&I.startNewLine(),B.words&&b(p.getCurrentVoice(),E.substring(2)),B.symbols&&A(p.getCurrentVoice(),E.substring(2))}};function M(E,T){E.push({el_type:"hint"});for(var P=0;P<T.length;P++){var B=T[P],O=Object.assign({},B);if(E.push(O),B.el_type==="bar")return}}function z(E,T){for(var P=0;P<E.length;P++){var B=E[P],O=T[P];if(O)for(var w=0;w<O.voices.length;w++){var C=O.voices[w],S=B.voices[w];S&&M(S,C)}}}function L(){for(var E=0;E<d.lines.length;E++){var T=d.lines[E].staff;if(T){for(var P=E+1;P<d.lines.length&&d.lines[P].staff===void 0;)P++;if(P<d.lines.length){var B=d.lines[P].staff;z(T,B)}}}}this.parse=function(E,T,P){T||(T={}),P||(P=0),d.reset(),E=E.replace(/\r\n?/g,`
|
|
@@ -103,24 +103,24 @@ X:`),c=1;c<i.length;c++)i[c]="X:"+i[c];var u=r?r[0].length:0,f=[];if(i.forEach(f
|
|
|
103
103
|
|
|
104
104
|
`);o>0&&(l.abc=l.abc.substring(0,o)),l.pure=l.abc,l.abc=n+l.abc,l.title="";var h=l.pure.split("T:");h.length>1&&(h=h[1].split(`
|
|
105
105
|
`),l.title=e.strip(h[0]));var s=l.pure.substring(2,l.pure.indexOf(`
|
|
106
|
-
`));l.id=e.strip(s)}),{header:p,tunes:f}};return Zr=t,Zr}var Gr,Qi;function mg(){if(Qi)return Gr;Qi=1;function e(t,a){this.numLines=t,this.lineSpace=a,this.verticalSize=this.numLines*this.lineSpace;var n=3;this.bar={pitch:n,pitch2:a*t,height:5}}return e.prototype.bypass=function(t){var a=t.staffGroup.voices;return!!(a.length>0&&a[0].isPercussion)},e.prototype.setRelative=function(t,a,n){switch(t.type){case"bar":a.pitch=this.bar.pitch,a.pitch2=this.bar.pitch2,a.height=this.height;break;case"symbol":var r=this.bar.pitch2/2;if(t.name=="dots.dot")return n?(a.pitch=r,!1):(a.pitch=r+this.lineSpace,!0);break}return n},Gr=e,Gr}var Ur,es;function Al(){if(es)return Ur;es=1;var e=function(a,n){this.children=[],this.beams=[],this.otherchildren=[],this.w=0,this.duplicate=!1,this.voicenumber=a,this.voicetotal=n,this.bottom=7,this.top=7,this.specialY={tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}};return e.prototype.addChild=function(t){if(t.type==="bar"){for(var a=!0,n=0;a&&n<this.children.length;n++)this.children[n].type.indexOf("staff-extra")<0&&this.children[n].type!=="tempo"&&(a=!1);a||(this.beams.push("bar"),this.otherchildren.push("bar"))}this.children[this.children.length]=t,this.setRange(t)},e.prototype.setLimit=function(t,a){var n=a.specialY;n||(n=a),n[t]&&(this.specialY[t]?this.specialY[t]=Math.max(this.specialY[t],n[t]):this.specialY[t]=n[t])},e.prototype.adjustRange=function(t){t.bottom!==void 0&&(this.bottom=Math.min(this.bottom,t.bottom)),t.top!==void 0&&(this.top=Math.max(this.top,t.top))},e.prototype.setRange=function(t){this.adjustRange(t),this.setLimit("tempoHeightAbove",t),this.setLimit("partHeightAbove",t),this.setLimit("volumeHeightAbove",t),this.setLimit("dynamicHeightAbove",t),this.setLimit("endingHeightAbove",t),this.setLimit("chordHeightAbove",t),this.setLimit("lyricHeightAbove",t),this.setLimit("lyricHeightBelow",t),this.setLimit("chordHeightBelow",t),this.setLimit("volumeHeightBelow",t),this.setLimit("dynamicHeightBelow",t)},e.prototype.addOther=function(t){this.otherchildren.push(t),this.setRange(t)},e.prototype.addBeam=function(t){this.beams.push(t)},e.prototype.setWidth=function(t){this.w=t},Ur=e,Ur}var jr,ts;function Ga(){if(ts)return jr;ts=1;var e=function(t,a,n,r){if(t)for(var i=0;i<t.length;i++){var c=t[i],u=c.getAttribute("highlight");u||(u="fill"),c.setAttribute(u,r);var f=c.getAttribute("class");f||(f=""),f=f.replace(n,""),f=f.replace(a,""),a.length>0&&(f.length>0&&f[f.length-1]!==" "&&(f+=" "),f+=a),c.setAttribute("class",f)}};return jr=e,jr}var Yr,rs;function Ml(){if(rs)return Yr;rs=1;var e=Ga(),t=function(a,n){a===void 0&&(a="abcjs-note_selected"),n===void 0&&(n="#ff0000"),e(this.elemset,a,"",n)};return Yr=t,Yr}var Wr,ns;function Nl(){if(ns)return Wr;ns=1;var e=Ga(),t=function(a,n){a===void 0&&(a="abcjs-note_selected"),n===void 0&&(n="#000000"),e(this.elemset,"",a,n)};return Wr=t,Wr}var Vr,as;function Pt(){if(as)return Vr;as=1;var e=Ml(),t=Nl(),a=function(r,i,c,u,f,g){g||(g={}),this.tuneNumber=f,this.abcelem=r,this.duration=i,this.durationClass=g.durationClassOveride?g.durationClassOveride:this.duration,this.minspacing=c||0,this.x=0,this.children=[],this.heads=[],this.extra=[],this.extraw=0,this.w=0,this.right=[],this.invisible=!1,this.bottom=void 0,this.top=void 0,this.type=u,this.fixed={w:0,t:void 0,b:void 0},this.specialY={tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}};return a.prototype.getFixedCoords=function(){return{x:this.x,w:this.fixed.w,t:this.fixed.t,b:this.fixed.b}},a.prototype.addExtra=function(n){this.fixed.w=Math.max(this.fixed.w,n.dx+n.w),this.fixed.t===void 0?this.fixed.t=n.top:this.fixed.t=Math.max(this.fixed.t,n.top),this.fixed.b===void 0?this.fixed.b=n.bottom:this.fixed.b=Math.min(this.fixed.b,n.bottom),n.dx<this.extraw&&(this.extraw=n.dx),this.extra[this.extra.length]=n,this._addChild(n)},a.prototype.addHead=function(n){n.dx<this.extraw&&(this.extraw=n.dx),this.heads[this.heads.length]=n,this.addRight(n)},a.prototype.addRight=function(n){this.fixed.w=Math.max(this.fixed.w,n.dx+n.w),n.top!==void 0&&(this.fixed.t===void 0?this.fixed.t=n.top:this.fixed.t=Math.max(this.fixed.t,n.top)),n.bottom!==void 0&&(this.fixed.b===void 0?this.fixed.b=n.bottom:this.fixed.b=Math.min(this.fixed.b,n.bottom)),n.dx+n.w>this.w&&(this.w=n.dx+n.w),this.right[this.right.length]=n,this._addChild(n)},a.prototype.addFixed=function(n){this._addChild(n)},a.prototype.addFixedX=function(n){this._addChild(n)},a.prototype.addCentered=function(n){var r=n.w/2;-r<this.extraw&&(this.extraw=-r),this.extra[this.extra.length]=n,n.dx+r>this.w&&(this.w=n.dx+r),this.right[this.right.length]=n,this._addChild(n)},a.prototype.setLimit=function(n,r){r[n]&&(this.specialY[n]?this.specialY[n]=Math.max(this.specialY[n],r[n]):this.specialY[n]=r[n])},a.prototype._addChild=function(n){var r=!0;this.abcelem.el_type=="clef"&&n.type=="barNumber"&&(r=!1),n.parent=this,this.children[this.children.length]=n,r&&this.pushTop(n.top),this.pushBottom(n.bottom),this.setLimit("tempoHeightAbove",n),this.setLimit("partHeightAbove",n),this.setLimit("volumeHeightAbove",n),this.setLimit("dynamicHeightAbove",n),this.setLimit("endingHeightAbove",n),this.setLimit("chordHeightAbove",n),this.setLimit("lyricHeightAbove",n),this.setLimit("lyricHeightBelow",n),this.setLimit("chordHeightBelow",n),this.setLimit("volumeHeightBelow",n),this.setLimit("dynamicHeightBelow",n)},a.prototype.pushTop=function(n){n!==void 0&&(this.top===void 0?this.top=n:this.top=Math.max(n,this.top))},a.prototype.pushBottom=function(n){n!==void 0&&(this.bottom===void 0?this.bottom=n:this.bottom=Math.min(n,this.bottom))},a.prototype.setX=function(n){this.x=n;for(var r=0;r<this.children.length;r++)this.children[r].setX(n)},a.prototype.center=function(n,r){var i=(r.x-n.x)/2+n.x;this.x=i-this.w/2;for(var c=0;c<this.children.length;c++)this.children[c].setX(this.x)},a.prototype.setHint=function(){this.hint=!0},a.prototype.highlight=function(n,r){e.bind(this)(n,r)},a.prototype.unhighlight=function(n,r){t.bind(this)(n,r)},Vr=a,Vr}var Xr,is;function at(){if(is)return Xr;is=1;var e=function(a,n,r,i,c){switch(c=c||{},this.x=0,this.c=a,this.dx=n,this.w=r,this.pitch=i,this.scalex=c.scalex||1,this.scaley=c.scaley||1,this.type=c.type||"symbol",this.pitch2=c.pitch2,this.linewidth=c.linewidth,this.klass=c.klass,this.anchor=c.anchor?c.anchor:"middle",this.top=i,this.pitch2!==void 0&&this.pitch2>this.top&&(this.top=this.pitch2),this.bottom=i,this.pitch2!==void 0&&this.pitch2<this.bottom&&(this.bottom=this.pitch2),c.thickness&&(this.top+=c.thickness/2,this.bottom-=c.thickness/2),c.stemHeight&&(c.stemHeight>0?this.top+=c.stemHeight:this.bottom+=c.stemHeight),c.dim&&(this.dim=c.dim),c.position&&(this.position=c.position),this.height=c.height?c.height:4,c.top&&(this.top=c.top),c.bottom&&(this.bottom=c.bottom),c.name?this.name=c.name:this.c?this.name=this.c:this.name=this.type,c.realWidth?this.realWidth=c.realWidth:this.realWidth=this.w,this.centerVertically=!1,this.type){case"debug":this.chordHeightAbove=this.height;break;case"lyric":c.position&&c.position==="below"?this.lyricHeightBelow=this.height:this.lyricHeightAbove=this.height;break;case"chord":c.position&&c.position==="below"?this.chordHeightBelow=this.height:this.chordHeightAbove=this.height;break;case"text":this.pitch===void 0?c.position&&c.position==="below"?this.chordHeightBelow=this.height:this.chordHeightAbove=this.height:this.centerVertically=!0;break;case"part":this.partHeightAbove=this.height;break}};return e.prototype.getChordDim=function(){if(this.type==="debug"||!this.chordHeightAbove&&!this.chordHeightBelow)return null;var t=0,a=this.type==="chord"?this.realWidth/2:0,n=this.x-a-t,r=n+this.realWidth+t;return{left:n,right:r}},e.prototype.invertLane=function(t){this.lane===void 0&&(this.lane=0),this.lane=t-this.lane-1},e.prototype.putChordInLane=function(t){this.lane=t,this.chordHeightAbove?this.chordHeightAbove=this.height*1.25*this.lane:this.chordHeightBelow=this.height*1.25*this.lane},e.prototype.getLane=function(){return this.lane===void 0?0:this.lane},e.prototype.setX=function(t){this.x=t+this.dx},Xr=e,Xr}var Kr,ss;function bg(){if(ss)return Kr;ss=1;var e=Pt(),t=at();function a(s){return s!=null&&s.constructor===Object}function n(s,v){for(var y in v)v.hasOwnProperty(y)&&(Array.isArray(v[y])||a(v[y])||(s[y]=v[y]))}function r(s){var v=new e("",0,0,"",0);return n(v,s),v.top=0,v.bottom=-1,s.abcelem&&(v.abcelem={},n(v.abcelem,s.abcelem),v.abcelem.el_type==="note"&&(v.abcelem.el_type="tabNumber")),s.cloned=v,v}function i(s,v){var y=r(s);if(v)for(var m=s.children,_=!0,k=0;k<m.length;k++){var x=m[k],R=new t("",0,0,0,"");n(R,x),_=v.tablature.setRelative(x,R,_),y.children.push(R)}return y}function c(s,v,y){var m="tab.tiny",_=7.5;s.isTabBig&&(m="tab.big",_=10);var k={el_type:"tab",icon:m,Ypos:_};if(_+=s.tabSymbolOffset,!s.hideTabSymbol){var x=new e(k,0,0,"symbol",0);x.x=v;var R=new t(m,0,0,7.5,"tab");R.x=y,x.children.push(R),x.abcelem.el_type=="tab"&&(R.pitch=_)}return x}function u(s){if(s.extra)for(var v=0;v<s.extra.length;v++){var y=s.extra[v];if(y.type=="lyric")return{bottom:y.bottom,height:y.height}}return null}function f(){this.accidentals=null}function g(s){for(var v=0,y=0;y<s.length;y++)s[y].tabNameInfos||v++;return v}function d(s,v,y,m,_){var k=m.num;m.note.quarter!=null&&(k=k.toString(),k+=m.note.quarter);var x=s.semantics.stringToPitch(m.str);y.notes.push({num:k,str:m.str,pitch:m.note.emit()});var R={type:"tabNumber"},I=new t(k,0,0,x+.3,R);return I.x=v,I.isGrace=_,I.isAltered=m.note.isAltered,I}function p(s,v){var y=0;if(s.extra){for(var m=0;m<s.extra.length;m++)if(s.extra[m].c.indexOf("noteheads")>=0){if(y===v)return s.extra[m].x+s.extra[m].w/2;y++}}return-1}function l(s){if(s.abcelem){var v=s.abcelem;if(v.rest)return v.gracenotes}return null}function o(s,v,y){var m=s.semantics.notesToNumber(v,y);if(m.error)return s.setError(m.error),m;if(m.graces&&m.notes){var _=m.notes.length-1;m.notes[_].graces=m.graces}return m}function h(s,v,y,m,_){for(var k=0;k<m.length;k++){var x={el_type:"note",startChar:y.abcelem.startChar,endChar:y.abcelem.endChar,notes:[],grace:!0},R=p(y,k),I=m[k],b=d(s,R,x,I,!0);v.children.push(b),_.push(x)}}return f.prototype.build=function(s,v,y,m,_,k,x){g(v);var R=v[_+m],I=v[x],b=null,A=null;R.children[0].abcelem.el_type!="clef"&&k!="none"&&R.children.splice(0,0,k);for(var N=0;N<R.children.length;N++){var M=R.children[N],z=M.x,L=z;switch(M.isClef&&(I.children.push(c(s,z,L)),M.abcelem.type.indexOf("-8")>=0&&(s.semantics.clefTranspose=-12),M.abcelem.type.indexOf("+8")>=0&&(s.semantics.clefTranspose=12)),M.type){case"staff-extra key-signature":this.accidentals=M.abcelem.accidentals,s.semantics.accidentals=this.accidentals;break;case"bar":s.semantics.measureAccidentals={};var E=!1;N===R.children.length-1&&(E=!0);var T=i(M,s);if(T.abcelem.barNumber){delete T.abcelem.barNumber;for(var P=0;P<T.children.length;P++)if(T.children[P].type==="barNumber"){T.children.splice(P,1);break}}T.abcelem.lastBar=E,I.children.push(T),y.push({el_type:M.abcelem.el_type,type:M.abcelem.type,endChar:M.abcelem.endChar,startChar:M.abcelem.startChar,abselem:T});break;case"rest":var B=l(M);if(B){if(b=o(s,null,B),b.error)return;F={el_type:"note",startChar:M.abcelem.startChar,endChar:M.abcelem.endChar,notes:[],grace:!0},h(s,O,M,b.graces,y)}break;case"note":var O=r(M);O.x=M.heads[0].x+M.heads[0].w/2,O.lyricDim=u(M);var w=M.abcelem.pitches,C=M.abcelem.gracenotes;if(O.type="tabNumber",b=o(s,w,C),b.error)return;if(b.graces){var S=b.notes.length-1;b.notes[S].graces=b.graces}A={el_type:"note",startChar:M.abcelem.startChar,endChar:M.abcelem.endChar,notes:[]};for(var q=0;q<b.notes.length;q++){var D=b.notes[q];if(D.graces)for(var $=0;$<D.graces.length;$++){var F={el_type:"note",startChar:M.abcelem.startChar,endChar:M.abcelem.endChar,notes:[],grace:!0},K=p(M,$),te=D.graces[$],V=d(s,K,F,te,!0);O.children.push(V),y.push(F)}var ae=d(s,O.x+M.heads[q].dx,A,D,!1);O.children.push(ae)}A.notes.length>0&&(A.abselem=O,y.push(A),I.children.push(O));break}}},Kr=f,Kr}var Jr,os;function yg(){if(os)return Jr;os=1;var e=Al(),t=bg(),a=Ve();function n(){return{tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}}function r(s){for(var v=0,y=0;y<s.children.length;y++){var m=s.children[y];m.specialY&&m.specialY.lyricHeightBelow>v&&(v=m.specialY.lyricHeightBelow)}return v}function i(s,v,y){var m=s.semantics,_=v.controller.getTextSize,k=m.tabInfos(s),x=m.suppress(s),R=!0;if(x&&(R=!1),R){var I=_.calc(k,"tablabelfont","text instrumentname");return y.tabNameInfos={textSize:{height:I.height,width:I.width},name:k},I.height}return 0}function c(s,v){return v[s].isTabStaff?s===v.length-1?!0:!v[s+1].isTabStaff:!1}function u(s){for(var v=0,y=0;y<s.length;y++)s[y].isTabStaff||v++;return v}function f(s,v){for(var y=v;y>=0;y--)if(!s[y].isTabStaff)return y;return-1}function g(s){for(var v=0;v<s.length;v++)if(s[v].isTabStaff){var y=f(s,v);s[v].hasStaff=s[y],s[y].hasTab||(s[y].hasTab=[]),s[y].hasTab.push(s[v])}}function d(s,v){return u(s)===1&&v.voices.length>1}function p(s,v){for(var y=0,m=0,_=!0,k=0;_;){if(!v[y])return-1;if(v[y].isTabStaff||(k=v[y].voices.length),v[y].isTabStaff){if(m++,c(y,v)&&m<k)return y+1}else if(m=0,y>=s&&(y+1==v.length||!v[y+1].isTabStaff))return y+1;if(y++,y>v.length)return-1}}function l(s,v){for(var y=v;y>=0;y--)if(!s[y].isTabStaff)return s[y];return null}function o(s,v){var y=s[v],m=y.children[0].abcelem;return m.el_type==="clef"?null:v==0?"none":s[v-1].children[0]}function h(s,v,y,m){var _=new t,k={clef:{type:"TAB"}},x=s.linePitch*s.nbLines,R=y.staff;if(R){var I=R[0];if(I&&I.clef&&I.clef.stafflines==0){s.setError("No tablatures when stafflines=0");return}R.splice(R.length,0,k)}var b=y.staffGroup,A=b.voices,N=A[0],M=r(N),z=3,L=m,E=b.staffs[L],T=x+z-E.bottom-M;E.isTabStaff&&(T=E.top);var P={bottom:-1,isTabStaff:!0,specialY:n(),lines:s.nbLines,linePitch:s.linePitch,dy:.15,top:T},B=p(m,b.staffs);if(B!==-1){P.parentIndex=B-1,b.staffs.splice(B,0,P),b.height+=x+z;var O=l(b.staffs,B),w=1;d(b.staffs,O)&&(w=O.voices.length),k.voices=[];for(var C=0;C<w;C++){var S=new e(0,0);C>0&&(S.duplicate=!0);var q=i(s,v,S)/a.STEP;q=Math.max(q,1),b.staffs[m].top+=1,b.height+=q,S.staff=P;var D=A.length;A.splice(A.length,0,S);var $=o(A,C+m);k.voices[C]=[],_.build(s,A,k.voices[C],C,m,$,D)}g(b.staffs)}}return Jr=h,Jr}var Qr,cs;function Pl(){if(cs)return Qr;cs=1;var e={__:-2,_:-1,"_/":-.5,"=":0,"":0,"^/":.5,"^":1,"^^":2},t=["C","-","D","-","E","F","-","G","-","A","-","B","c","-","d","-","e","f","-","g","-","a","-","b"];function a(r){var i=r.match(/([_^\/]*)([ABCDEFGabcdefg])(,*)('*)/);if(i&&i.length===5){var c=e[i[1]],u=t.indexOf(i[2]),f=i[4].length-i[3].length;return 48+u+c+f*12}return 0}function n(r){r=parseInt(r,10);var i=Math.floor(r/12),c=r%12,u=t[c];if(u==="-"&&(u="^"+t[c-1]),i>4)for(u=u.toLowerCase(),i-=5;i>0;)u+="'",i--;else for(;i<4;)u+=",",i++;return u}return Qr={noteToMidi:a,midiToNote:n},Qr}var e0,ls;function zl(){if(ls)return e0;ls=1;var{noteToMidi:e,midiToNote:t}=Pl();function a(r,i){var c=e(r);i&&(c+=i);var u=t(c),f=!1,g=!1,d=!1,p=null,l=null,o=!1,h=0;r.startsWith("_")?(f=!0,h=-1,r[1]=="/"?(f=!1,l="v",h=0):r[1]=="_"&&(o=!0,h-=1)):r.startsWith("^")?(g=!0,h=1,r[1]=="/"?(g=!1,l="^",h=0):r[1]=="^"&&(o=!0,h+=1)):r.startsWith("=")&&(p=!0,h=0),d=f||g||l!=null,(d||p)&&(l!=null||o?u=r.slice(2):u=r.slice(1));var s=(u.match(/,/g)||[]).length,v=(u.match(/'/g)||[]).length;this.pitch=c,this.pitchAltered=0,this.name=u,this.acc=h,this.isSharp=g,this.isKeySharp=!1,this.isDouble=o,this.isAltered=d,this.isFlat=f,this.isKeyFlat=!1,this.natural=p,this.quarter=l,this.isLower=this.name==this.name.toLowerCase(),this.name=this.name[0].toUpperCase(),this.hasComma=s,this.isQuoted=v}function n(r){var i=r.name,c=new a(i);return c.pitch=r.pitch,c.hasComma=r.hasComma,c.isLower=r.isLower,c.isQuoted=r.isQuoted,c.isSharp=r.isSharp,c.isKeySharp=r.isKeySharp,c.isFlat=r.isFlat,c.isKeyFlat=r.isKeyFlat,c}return a.prototype.sameNoteAs=function(r){return r.pitch===this.pitch},a.prototype.isLowerThan=function(r){return r.pitch>this.pitch},a.prototype.checkKeyAccidentals=function(r,i){if(!(this.isAltered||this.natural)){if(i[this.name.toUpperCase()])switch(i[this.name.toUpperCase()]){case"__":this.acc=-2,this.pitchAltered=-2;return;case"_":this.acc=-1,this.pitchAltered=-1;return;case"=":this.acc=0,this.pitchAltered=0;return;case"^":this.acc=1,this.pitchAltered=1;return;case"^^":this.acc=2,this.pitchAltered=2;return}else if(r)for(var c=this.name,u=0;u<r.length;u++){var f=r[u];c==f.note.toUpperCase()&&(f.acc=="flat"&&(this.acc=-1,this.isKeyFlat=!0,this.pitchAltered=-1),f.acc=="sharp"&&(this.acc=1,this.isKeySharp=!0,this.pitchAltered=1))}}},a.prototype.getAccidentalEquiv=function(){var r=n(this);return r.isSharp||r.isKeySharp?(r=r.nextNote(),r.isFlat=!0,r.isSharp=!1,r.isKeySharp=!1):(r.isFlat||r.isKeyFlat)&&(r=r.prevNote(),r.isSharp=!0,r.isFlat=!1,r.isKeyFlat=!1),r},a.prototype.nextNote=function(){var r=t(this.pitch+1+this.pitchAltered);return new a(r)},a.prototype.prevNote=function(){var r=t(this.pitch-1+this.pitchAltered);return new a(r)},a.prototype.emitNoAccidentals=function(){var r=this.name;this.isLower&&(r=r.toLowerCase());for(var i=0;i<this.isQuoted;i++)r+="'";for(var c=0;c<this.hasComma;c++)r+=",";return r},a.prototype.emit=function(){var r=this.name;(this.isSharp||this.isKeySharp)&&(r="^"+r,this.isDouble&&(r="^"+r)),(this.isFlat||this.isKeyFlat)&&(r="_"+r,this.isDouble&&(r="_"+r)),this.quarter&&(this.quarter=="^"?r="^/"+r:r="_/"+r),this.natural&&(r="="+r);for(var i=1;i<=this.hasComma;i++)r+=",";if(this.isLower){r=r.toLowerCase();for(var c=1;c<=this.isQuoted;c++)r+="'"}return r},e0=a,e0}var t0,us;function wg(){if(us)return t0;us=1;var e=zl(),t=["A","B","C","D","E","F","G"];function a(n,r){var i=new e(n),c=new e(r);if(c.isLowerThan(i)){var u=i.emit(),f=c.emit();return{error:"Invalid string Instrument tuning : "+f+" string lower than "+u+" string"}}var g=[],d=t.indexOf(i.name),p=t.indexOf(c.name);if(d==-1||p==-1)return g;for(var l=!1;!l;)g.push(i.emit()),i=i.nextNote(),i.sameNoteAs(c)&&(l=!0);return g}return t0=a,t0}var r0,hs;function _g(){if(hs)return r0;hs=1;const{noteToMidi:e}=Pl();var t=zl(),a=wg();function n(l){var o=null,h=l.tuning;if(l.capo>0){o=[];for(var s=0;s<h.length;s++){for(var v=new t(h[s]),y=0;y<l.capo;y++)v=v.nextNote();o[s]=v.emit()}}return o}function r(l){var o=[],h=l.tuning;l.capo>0&&(h=l.capoTuning);for(var s=h.length-1,v=0;v<h.length;v++){var y=l.highestNote;v!=h.length-1&&(y=h[v+1]);var m=a(h[v],y);if(m.error)return m;o[s--]=m}return o}function i(l){var o=[];o[0]=[];for(var h=l.strings,s=1;s<h.length;s++)o[s]=h[s-1];return o}function c(l,o){for(var h=0;h<o.length-1;h++){var s=o[h],v=o[h+1];if(s.str==v.str){if(s.str==l.strings.length-1){s.num="?",v.num="?";return}v.num<s.num?(v.str++,v=f(l,v.note,v.str,l.secondPos,l.strings[v.str].length)):(s.str++,s=f(l,s.note,s.str,l.secondPos,l.strings[s.str].length)),o[h]=s,o[h+1]=v}}return null}function u(l,o){for(var h=[],s=0;s<o.length;s++)if(!o[s].endTie){var v=new t(o[s].name,l.clefTranspose);v.checkKeyAccidentals(l.accidentals,l.measureAccidentals);var y=g(l,v);h.push(y)}return c(l,h),h}function f(l,o,h,s,v){var y=l.strings;o.checkKeyAccidentals(l.accidentals,l.measureAccidentals),s&&(y=s);var m=o.emitNoAccidentals(),_=y[h].indexOf(m),k=o.acc;if(_!=-1){if(s&&(_+=v),(o.isFlat||o.acc==-1)&&_==0){var x=o.getAccidentalEquiv();h++,_=y[h].indexOf(x.emit()),k=0}return{num:_+k,str:h,note:o}}return null}function g(l,o){if(o.isAltered||o.natural){var h;o.isFlat?o.isDouble?h="__":h="_":o.isSharp?o.isDouble?h="^^":h="^":o.natural&&(h="="),l.measureAccidentals[o.name.toUpperCase()]=h}for(var s=l.stringPitches.length-1;s>=0;s--)if(o.pitch+o.pitchAltered>=l.stringPitches[s]){var v=o.pitch+o.pitchAltered-l.stringPitches[s];return o.quarter==="^"?v-=.5:o.quarter==="v"&&(v+=.5),{num:Math.round(v),str:l.stringPitches.length-1-s,note:o}}return{num:"?",str:l.stringPitches.length-1,note:o}}p.prototype.stringToPitch=function(l){var o=5.3,h=this.strings.length-1;return o+(h-l)*this.linePitch};function d(l,o){var h={num:"?",str:0,note:o};l.push(h),l.error=o.emit()+": unexpected note for instrument"}p.prototype.notesToNumber=function(l,o){var h,s,v=null,y=null;if(l&&(y=[],l.length>1?(y=u(this,l),y.error&&(v=y.error)):l[0].endTie||(h=new t(l[0].name,this.clefTranspose),h.checkKeyAccidentals(this.accidentals,this.measureAccidentals),s=g(this,h),s?y.push(s):(d(y,h),v=y.error))),v)return y;var m=null;if(o){m=[];for(var _=0;_<o.length;_++)h=new t(o[_].name,this.clefTranspose),h.checkKeyAccidentals(this.accidentals,this.measureAccidentals),s=g(this,h),s?m.push(s):(d(m,h),v=y.error)}return{notes:y,graces:m,error:v}},p.prototype.toString=function(){for(var l=[],o=0;o<this.tuning.length;o++){var h=this.tuning[o].replaceAll(",","").replaceAll("'","").toUpperCase();h[0]==="_"?h=h[1]+"b ":h[0]==="^"&&(h=h[1]+"# "),l.push(h)}return l.join("")},p.prototype.tabInfos=function(l){var o=l.params.label;if(o){var h=o.indexOf("%T"),s="";return h!=-1&&(s=this.toString(),l.capo>0&&(s+=" capo:"+l.capo),o=o.replace("%T",s)),o}return""},p.prototype.suppress=function(l){var o=l.params.suppress;return!!o};function p(l){var o=l.tuning,h=l.capo,s=l.params.highestNote;this.linePitch=l.linePitch,this.highestNote="a'",s&&(this.highestNote=s),this.measureAccidentals={},this.capo=0,h&&(this.capo=parseInt(h,10)),this.transpose=l.transpose?l.transpose:0,this.tuning=o,this.stringPitches=[];for(var v=0;v<this.tuning.length;v++){var y=e(this.tuning[v])+this.capo;this.stringPitches.push(y)}if(this.capo>0&&(this.capoTuning=n(this)),this.strings=r(this),this.strings.error){l.setError(this.strings.error),l.inError=!0;return}this.secondPos=i(this)}return r0=p,r0}var n0,fs;function kg(){if(fs)return n0;fs=1;var e=mg(),t=yg(),a=_g();n.prototype.init=function(i,c,u,f){this.tune=i,this.params=u,this.tuneNumber=c,this.inError=!1,this.abcTune=i,this.linePitch=3,this.nbLines=f.defaultTuning.length,this.isTabBig=f.isTabBig,this.tabSymbolOffset=f.tabSymbolOffset,this.capo=u.capo,this.transpose=u.visualTranspose,this.hideTabSymbol=u.hideTabSymbol,this.tablature=new e(this.nbLines,this.linePitch);var g=u.tuning;g||(g=f.defaultTuning),this.tuning=g,this.semantics=new a(this)},n.prototype.setError=function(i){i&&(this.error=i,this.inError=!0,this.tune.warnings?this.tune.warnings.push(i):this.tune.warnings=[i])},n.prototype.render=function(i,c,u){this.inError||this.tablature.bypass(c)||t(this,i,c,u)};function n(){}var r=function(){return{name:"StringTab",tablature:n}};return n0=r,n0}var a0,ds;function Il(){if(ds)return a0;ds=1;var e=kg(),t={violin:{name:"StringTab",defaultTuning:["G,","D","A","e"],isTabBig:!1,tabSymbolOffset:0},fiddle:{name:"StringTab",defaultTuning:["G,","D","A","e"],isTabBig:!1,tabSymbolOffset:0},mandolin:{name:"StringTab",defaultTuning:["G,","D","A","e"],isTabBig:!1,tabSymbolOffset:0},guitar:{name:"StringTab",defaultTuning:["E,","A,","D","G","B","e"],isTabBig:!0,tabSymbolOffset:0},fiveString:{name:"StringTab",defaultTuning:["C,","G,","D","A","e"],isTabBig:!1,tabSymbolOffset:-.95}},a={inited:!1,plugins:{},register:function(n){var r=n.name,i=n.tablature;this.plugins[r]=i},setError:function(n,r){n.warnings?n.warning.push(r):n.warnings=[r]},preparePlugins:function(n,r,i){this.inited||(this.register(new e),this.inited=!0);var c=null;if(i.tablature){var u=i.tablature;c=[];for(var f=0;f<u.length;f++){var g=u[f],d=g.instrument;if(d==null)return this.setError(n,"tablature 'instrument' is missing"),c;var p=t[d],l=null;if(p&&(l=this.plugins[p.name]),l){i.visualTranspose!=0&&(g.visualTranspose=i.visualTranspose),g.abcSrc=i.tablature.abcSrc;var o={classz:l,tuneNumber:r,params:g,instance:null,tabType:p};c.push(o)}else if(d==="")c.push(null);else return this.setError(n,"Undefined tablature plugin: "+d),c}}return c},layoutTablatures:function(r,i){var c=i.tablatures,u=0;if(c&&c.length>0)for(var f=c.length,g=0;g<f;++g)c[g]&&c[g].params.firstStaffOnly&&(c[g].params.suppress=!1);for(var d=0;d<i.lines.length;d++){var p=i.lines[d];if(p.staff&&u++,u>1&&c&&c.length>0)for(var f=c.length,g=0;g<f;++g)c[g].params.firstStaffOnly&&(c[g].params.suppress=!0);var l=p.staff;if(l){for(var o=l.length,h=0;h<l.length;h++)if(c[h]&&h<o){var s=c[h];s.instance==null&&(s.instance=new s.classz,s.instance.init(i,s.tuneNumber,s.params,s.tabType)),s.instance.render(r,p,h)}}}}};return a0=a,a0}var i0,ps;function fr(){if(ps)return i0;ps=1;var e=El(),t=vg(),a=Il(),n={};return(function(){n.numberOfTunes=function(i){var c=i.split(`
|
|
106
|
+
`));l.id=e.strip(s)}),{header:p,tunes:f}};return Zr=t,Zr}var Gr,Qi;function mg(){if(Qi)return Gr;Qi=1;function e(t,a){this.numLines=t,this.lineSpace=a,this.verticalSize=this.numLines*this.lineSpace;var n=3;this.bar={pitch:n,pitch2:a*t,height:5}}return e.prototype.bypass=function(t){var a=t.staffGroup.voices;return!!(a.length>0&&a[0].isPercussion)},e.prototype.setRelative=function(t,a,n){switch(t.type){case"bar":a.pitch=this.bar.pitch,a.pitch2=this.bar.pitch2,a.height=this.height;break;case"symbol":var r=this.bar.pitch2/2;if(t.name=="dots.dot")return n?(a.pitch=r,!1):(a.pitch=r+this.lineSpace,!0);break}return n},Gr=e,Gr}var Ur,es;function Al(){if(es)return Ur;es=1;var e=function(a,n){this.children=[],this.beams=[],this.otherchildren=[],this.w=0,this.duplicate=!1,this.voicenumber=a,this.voicetotal=n,this.bottom=7,this.top=7,this.specialY={tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}};return e.prototype.addChild=function(t){if(t.type==="bar"){for(var a=!0,n=0;a&&n<this.children.length;n++)this.children[n].type.indexOf("staff-extra")<0&&this.children[n].type!=="tempo"&&(a=!1);a||(this.beams.push("bar"),this.otherchildren.push("bar"))}this.children[this.children.length]=t,this.setRange(t)},e.prototype.setLimit=function(t,a){var n=a.specialY;n||(n=a),n[t]&&(this.specialY[t]?this.specialY[t]=Math.max(this.specialY[t],n[t]):this.specialY[t]=n[t])},e.prototype.adjustRange=function(t){t.bottom!==void 0&&(this.bottom=Math.min(this.bottom,t.bottom)),t.top!==void 0&&(this.top=Math.max(this.top,t.top))},e.prototype.setRange=function(t){this.adjustRange(t),this.setLimit("tempoHeightAbove",t),this.setLimit("partHeightAbove",t),this.setLimit("volumeHeightAbove",t),this.setLimit("dynamicHeightAbove",t),this.setLimit("endingHeightAbove",t),this.setLimit("chordHeightAbove",t),this.setLimit("lyricHeightAbove",t),this.setLimit("lyricHeightBelow",t),this.setLimit("chordHeightBelow",t),this.setLimit("volumeHeightBelow",t),this.setLimit("dynamicHeightBelow",t)},e.prototype.addOther=function(t){this.otherchildren.push(t),this.setRange(t)},e.prototype.addBeam=function(t){this.beams.push(t)},e.prototype.setWidth=function(t){this.w=t},Ur=e,Ur}var jr,ts;function Ga(){if(ts)return jr;ts=1;var e=function(t,a,n,r){if(t)for(var i=0;i<t.length;i++){var c=t[i],u=c.getAttribute("highlight");u||(u="fill"),c.setAttribute(u,r);var f=c.getAttribute("class");f||(f=""),f=f.replace(n,""),f=f.replace(a,""),a.length>0&&(f.length>0&&f[f.length-1]!==" "&&(f+=" "),f+=a),c.setAttribute("class",f)}};return jr=e,jr}var Yr,rs;function Ml(){if(rs)return Yr;rs=1;var e=Ga(),t=function(a,n){a===void 0&&(a="abcjs-note_selected"),n===void 0&&(n="#ff0000"),e(this.elemset,a,"",n)};return Yr=t,Yr}var Wr,ns;function Nl(){if(ns)return Wr;ns=1;var e=Ga(),t=function(a,n){a===void 0&&(a="abcjs-note_selected"),n===void 0&&(n="#000000"),e(this.elemset,"",a,n)};return Wr=t,Wr}var Vr,as;function Pt(){if(as)return Vr;as=1;var e=Ml(),t=Nl(),a=function(r,i,c,u,f,g){g||(g={}),this.tuneNumber=f,this.abcelem=r,this.duration=i,this.durationClass=g.durationClassOveride?g.durationClassOveride:this.duration,this.minspacing=c||0,this.x=0,this.children=[],this.heads=[],this.extra=[],this.extraw=0,this.w=0,this.right=[],this.invisible=!1,this.bottom=void 0,this.top=void 0,this.type=u,this.fixed={w:0,t:void 0,b:void 0},this.specialY={tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}};return a.prototype.getFixedCoords=function(){return{x:this.x,w:this.fixed.w,t:this.fixed.t,b:this.fixed.b}},a.prototype.addExtra=function(n){this.fixed.w=Math.max(this.fixed.w,n.dx+n.w),this.fixed.t===void 0?this.fixed.t=n.top:this.fixed.t=Math.max(this.fixed.t,n.top),this.fixed.b===void 0?this.fixed.b=n.bottom:this.fixed.b=Math.min(this.fixed.b,n.bottom),n.dx<this.extraw&&(this.extraw=n.dx),this.extra[this.extra.length]=n,this._addChild(n)},a.prototype.addHead=function(n){n.dx<this.extraw&&(this.extraw=n.dx),this.heads[this.heads.length]=n,this.addRight(n)},a.prototype.addRight=function(n){this.fixed.w=Math.max(this.fixed.w,n.dx+n.w),n.top!==void 0&&(this.fixed.t===void 0?this.fixed.t=n.top:this.fixed.t=Math.max(this.fixed.t,n.top)),n.bottom!==void 0&&(this.fixed.b===void 0?this.fixed.b=n.bottom:this.fixed.b=Math.min(this.fixed.b,n.bottom)),n.dx+n.w>this.w&&(this.w=n.dx+n.w),this.right[this.right.length]=n,this._addChild(n)},a.prototype.addFixed=function(n){this._addChild(n)},a.prototype.addFixedX=function(n){this._addChild(n)},a.prototype.addCentered=function(n){var r=n.w/2;-r<this.extraw&&(this.extraw=-r),this.extra[this.extra.length]=n,n.dx+r>this.w&&(this.w=n.dx+r),this.right[this.right.length]=n,this._addChild(n)},a.prototype.setLimit=function(n,r){r[n]&&(this.specialY[n]?this.specialY[n]=Math.max(this.specialY[n],r[n]):this.specialY[n]=r[n])},a.prototype._addChild=function(n){var r=!0;this.abcelem.el_type=="clef"&&n.type=="barNumber"&&(r=!1),n.parent=this,this.children[this.children.length]=n,r&&this.pushTop(n.top),this.pushBottom(n.bottom),this.setLimit("tempoHeightAbove",n),this.setLimit("partHeightAbove",n),this.setLimit("volumeHeightAbove",n),this.setLimit("dynamicHeightAbove",n),this.setLimit("endingHeightAbove",n),this.setLimit("chordHeightAbove",n),this.setLimit("lyricHeightAbove",n),this.setLimit("lyricHeightBelow",n),this.setLimit("chordHeightBelow",n),this.setLimit("volumeHeightBelow",n),this.setLimit("dynamicHeightBelow",n)},a.prototype.pushTop=function(n){n!==void 0&&(this.top===void 0?this.top=n:this.top=Math.max(n,this.top))},a.prototype.pushBottom=function(n){n!==void 0&&(this.bottom===void 0?this.bottom=n:this.bottom=Math.min(n,this.bottom))},a.prototype.setX=function(n){this.x=n;for(var r=0;r<this.children.length;r++)this.children[r].setX(n)},a.prototype.center=function(n,r){var i=(r.x-n.x)/2+n.x;this.x=i-this.w/2;for(var c=0;c<this.children.length;c++)this.children[c].setX(this.x)},a.prototype.setHint=function(){this.hint=!0},a.prototype.highlight=function(n,r){e.bind(this)(n,r)},a.prototype.unhighlight=function(n,r){t.bind(this)(n,r)},Vr=a,Vr}var Xr,is;function at(){if(is)return Xr;is=1;var e=function(a,n,r,i,c){switch(c=c||{},this.x=0,this.c=a,this.dx=n,this.w=r,this.pitch=i,this.scalex=c.scalex||1,this.scaley=c.scaley||1,this.type=c.type||"symbol",this.pitch2=c.pitch2,this.linewidth=c.linewidth,this.klass=c.klass,this.anchor=c.anchor?c.anchor:"middle",this.top=i,this.pitch2!==void 0&&this.pitch2>this.top&&(this.top=this.pitch2),this.bottom=i,this.pitch2!==void 0&&this.pitch2<this.bottom&&(this.bottom=this.pitch2),c.thickness&&(this.top+=c.thickness/2,this.bottom-=c.thickness/2),c.stemHeight&&(c.stemHeight>0?this.top+=c.stemHeight:this.bottom+=c.stemHeight),c.dim&&(this.dim=c.dim),c.position&&(this.position=c.position),this.height=c.height?c.height:4,c.top&&(this.top=c.top),c.bottom&&(this.bottom=c.bottom),c.name?this.name=c.name:this.c?this.name=this.c:this.name=this.type,c.realWidth?this.realWidth=c.realWidth:this.realWidth=this.w,this.centerVertically=!1,this.type){case"debug":this.chordHeightAbove=this.height;break;case"lyric":c.position&&c.position==="below"?this.lyricHeightBelow=this.height:this.lyricHeightAbove=this.height;break;case"chord":c.position&&c.position==="below"?this.chordHeightBelow=this.height:this.chordHeightAbove=this.height;break;case"text":this.pitch===void 0?c.position&&c.position==="below"?this.chordHeightBelow=this.height:this.chordHeightAbove=this.height:this.centerVertically=!0;break;case"part":this.partHeightAbove=this.height;break}};return e.prototype.getChordDim=function(){if(this.type==="debug"||!this.chordHeightAbove&&!this.chordHeightBelow)return null;var t=0,a=this.type==="chord"?this.realWidth/2:0,n=this.x-a-t,r=n+this.realWidth+t;return{left:n,right:r}},e.prototype.invertLane=function(t){this.lane===void 0&&(this.lane=0),this.lane=t-this.lane-1},e.prototype.putChordInLane=function(t){this.lane=t,this.chordHeightAbove?this.chordHeightAbove=this.height*1.25*this.lane:this.chordHeightBelow=this.height*1.25*this.lane},e.prototype.getLane=function(){return this.lane===void 0?0:this.lane},e.prototype.setX=function(t){this.x=t+this.dx},Xr=e,Xr}var Kr,ss;function bg(){if(ss)return Kr;ss=1;var e=Pt(),t=at();function a(s){return s!=null&&s.constructor===Object}function n(s,v){for(var y in v)v.hasOwnProperty(y)&&(Array.isArray(v[y])||a(v[y])||(s[y]=v[y]))}function r(s){var v=new e("",0,0,"",0);return n(v,s),v.top=0,v.bottom=-1,s.abcelem&&(v.abcelem={},n(v.abcelem,s.abcelem),v.abcelem.el_type==="note"&&(v.abcelem.el_type="tabNumber")),s.cloned=v,v}function i(s,v){var y=r(s);if(v)for(var m=s.children,_=!0,k=0;k<m.length;k++){var x=m[k],R=new t("",0,0,0,"");n(R,x),_=v.tablature.setRelative(x,R,_),y.children.push(R)}return y}function c(s,v,y){var m="tab.tiny",_=7.5;s.isTabBig&&(m="tab.big",_=10);var k={el_type:"tab",icon:m,Ypos:_};if(_+=s.tabSymbolOffset,!s.hideTabSymbol){var x=new e(k,0,0,"symbol",0);x.x=v;var R=new t(m,0,0,7.5,"tab");R.x=y,x.children.push(R),x.abcelem.el_type=="tab"&&(R.pitch=_)}return x}function u(s){if(s.extra)for(var v=0;v<s.extra.length;v++){var y=s.extra[v];if(y.type=="lyric")return{bottom:y.bottom,height:y.height}}return null}function f(){this.accidentals=null}function g(s){for(var v=0,y=0;y<s.length;y++)s[y].tabNameInfos||v++;return v}function d(s,v,y,m,_){var k=m.num;m.note.quarter!=null&&(k=k.toString(),k+=m.note.quarter);var x=s.semantics.stringToPitch(m.str);y.notes.push({num:k,str:m.str,pitch:m.note.emit()});var R={type:"tabNumber"},I=new t(k,0,0,x+.3,R);return I.x=v,I.isGrace=_,I.isAltered=m.note.isAltered,I}function p(s,v){var y=0;if(s.extra){for(var m=0;m<s.extra.length;m++)if(s.extra[m].c.indexOf("noteheads")>=0){if(y===v)return s.extra[m].x+s.extra[m].w/2;y++}}return-1}function l(s){if(s.abcelem){var v=s.abcelem;if(v.rest)return v.gracenotes}return null}function o(s,v,y){var m=s.semantics.notesToNumber(v,y);if(m.error)return s.setError(m.error),m;if(m.graces&&m.notes){var _=m.notes.length-1;m.notes[_].graces=m.graces}return m}function h(s,v,y,m,_){for(var k=0;k<m.length;k++){var x={el_type:"note",startChar:y.abcelem.startChar,endChar:y.abcelem.endChar,notes:[],grace:!0},R=p(y,k),I=m[k],b=d(s,R,x,I,!0);v.children.push(b),_.push(x)}}return f.prototype.build=function(s,v,y,m,_,k,x){g(v);var R=v[_+m],I=v[x],b=null,A=null;R.children[0].abcelem.el_type!="clef"&&k!="none"&&R.children.splice(0,0,k);for(var N=0;N<R.children.length;N++){var M=R.children[N],z=M.x,L=z;switch(M.isClef&&(I.children.push(c(s,z,L)),M.abcelem.type.indexOf("-8")>=0&&(s.semantics.clefTranspose=-12),M.abcelem.type.indexOf("+8")>=0&&(s.semantics.clefTranspose=12)),M.type){case"staff-extra key-signature":this.accidentals=M.abcelem.accidentals,s.semantics.accidentals=this.accidentals;break;case"bar":s.semantics.measureAccidentals={};var E=!1;N===R.children.length-1&&(E=!0);var T=i(M,s);if(T.abcelem.barNumber){delete T.abcelem.barNumber;for(var P=0;P<T.children.length;P++)if(T.children[P].type==="barNumber"){T.children.splice(P,1);break}}T.abcelem.lastBar=E,I.children.push(T),y.push({el_type:M.abcelem.el_type,type:M.abcelem.type,endChar:M.abcelem.endChar,startChar:M.abcelem.startChar,abselem:T});break;case"rest":var B=l(M);if(B){if(b=o(s,null,B),b.error)return;F={el_type:"note",startChar:M.abcelem.startChar,endChar:M.abcelem.endChar,notes:[],grace:!0},h(s,O,M,b.graces,y)}break;case"note":var O=r(M);O.x=M.heads[0].x+M.heads[0].w/2,O.lyricDim=u(M);var w=M.abcelem.pitches,C=M.abcelem.gracenotes;if(O.type="tabNumber",b=o(s,w,C),b.error)return;if(b.graces){var S=b.notes.length-1;b.notes[S].graces=b.graces}A={el_type:"note",startChar:M.abcelem.startChar,endChar:M.abcelem.endChar,notes:[]};for(var q=0;q<b.notes.length;q++){var D=b.notes[q];if(D.graces)for(var $=0;$<D.graces.length;$++){var F={el_type:"note",startChar:M.abcelem.startChar,endChar:M.abcelem.endChar,notes:[],grace:!0},K=p(M,$),te=D.graces[$],V=d(s,K,F,te,!0);O.children.push(V),y.push(F)}var ae=d(s,O.x+M.heads[q].dx,A,D,!1);O.children.push(ae)}A.notes.length>0&&(A.abselem=O,y.push(A),I.children.push(O));break}}},Kr=f,Kr}var Jr,os;function yg(){if(os)return Jr;os=1;var e=Al(),t=bg(),a=Ve();function n(){return{tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}}function r(s){for(var v=0,y=0;y<s.children.length;y++){var m=s.children[y];m.specialY&&m.specialY.lyricHeightBelow>v&&(v=m.specialY.lyricHeightBelow)}return v}function i(s,v,y){var m=s.semantics,_=v.controller.getTextSize,k=m.tabInfos(s),x=m.suppress(s),R=!0;if(x&&(R=!1),R){var I=_.calc(k,"tablabelfont","text instrumentname");return y.tabNameInfos={textSize:{height:I.height,width:I.width},name:k},I.height}return 0}function c(s,v){return v[s].isTabStaff?s===v.length-1?!0:!v[s+1].isTabStaff:!1}function u(s){for(var v=0,y=0;y<s.length;y++)s[y].isTabStaff||v++;return v}function f(s,v){for(var y=v;y>=0;y--)if(!s[y].isTabStaff)return y;return-1}function g(s){for(var v=0;v<s.length;v++)if(s[v].isTabStaff){var y=f(s,v);s[v].hasStaff=s[y],s[y].hasTab||(s[y].hasTab=[]),s[y].hasTab.push(s[v])}}function d(s,v){return u(s)===1&&v.voices.length>1}function p(s,v){for(var y=0,m=0,_=!0,k=0;_;){if(!v[y])return-1;if(v[y].isTabStaff||(k=v[y].voices.length),v[y].isTabStaff){if(m++,c(y,v)&&m<k)return y+1}else if(m=0,y>=s&&(y+1==v.length||!v[y+1].isTabStaff))return y+1;if(y++,y>v.length)return-1}}function l(s,v){for(var y=v;y>=0;y--)if(!s[y].isTabStaff)return s[y];return null}function o(s,v){var y=s[v],m=y.children[0].abcelem;return m.el_type==="clef"?null:v==0?"none":s[v-1].children[0]}function h(s,v,y,m){var _=new t,k={clef:{type:"TAB"}},x=s.linePitch*s.nbLines,R=y.staff;if(R){var I=R[0];if(I&&I.clef&&I.clef.stafflines==0){s.setError("No tablatures when stafflines=0");return}R.splice(R.length,0,k)}var b=y.staffGroup,A=b.voices,N=A[0],M=r(N),z=3,L=m,E=b.staffs[L],T=x+z-E.bottom-M;E.isTabStaff&&(T=E.top);var P={bottom:-1,isTabStaff:!0,specialY:n(),lines:s.nbLines,linePitch:s.linePitch,dy:.15,top:T},B=p(m,b.staffs);if(B!==-1){P.parentIndex=B-1,b.staffs.splice(B,0,P),b.height+=x+z;var O=l(b.staffs,B),w=1;d(b.staffs,O)&&(w=O.voices.length),k.voices=[];for(var C=0;C<w;C++){var S=new e(0,0);C>0&&(S.duplicate=!0);var q=i(s,v,S)/a.STEP;q=Math.max(q,1),b.staffs[m].top+=1,b.height+=q,S.staff=P;var D=A.length;A.splice(A.length,0,S);var $=o(A,C+m);k.voices[C]=[],_.build(s,A,k.voices[C],C,m,$,D)}g(b.staffs)}}return Jr=h,Jr}var Qr,cs;function Pl(){if(cs)return Qr;cs=1;var e={__:-2,_:-1,"_/":-.5,"=":0,"":0,"^/":.5,"^":1,"^^":2},t=["C","-","D","-","E","F","-","G","-","A","-","B","c","-","d","-","e","f","-","g","-","a","-","b"];function a(r){var i=r.match(/([_^\/]*)([ABCDEFGabcdefg])(,*)('*)/);if(i&&i.length===5){var c=e[i[1]],u=t.indexOf(i[2]),f=i[4].length-i[3].length;return 48+u+c+f*12}return 0}function n(r){r=parseInt(r,10);var i=Math.floor(r/12),c=r%12,u=t[c];if(u==="-"&&(u="^"+t[c-1]),i>4)for(u=u.toLowerCase(),i-=5;i>0;)u+="'",i--;else for(;i<4;)u+=",",i++;return u}return Qr={noteToMidi:a,midiToNote:n},Qr}var en,ls;function zl(){if(ls)return en;ls=1;var{noteToMidi:e,midiToNote:t}=Pl();function a(r,i){var c=e(r);i&&(c+=i);var u=t(c),f=!1,g=!1,d=!1,p=null,l=null,o=!1,h=0;r.startsWith("_")?(f=!0,h=-1,r[1]=="/"?(f=!1,l="v",h=0):r[1]=="_"&&(o=!0,h-=1)):r.startsWith("^")?(g=!0,h=1,r[1]=="/"?(g=!1,l="^",h=0):r[1]=="^"&&(o=!0,h+=1)):r.startsWith("=")&&(p=!0,h=0),d=f||g||l!=null,(d||p)&&(l!=null||o?u=r.slice(2):u=r.slice(1));var s=(u.match(/,/g)||[]).length,v=(u.match(/'/g)||[]).length;this.pitch=c,this.pitchAltered=0,this.name=u,this.acc=h,this.isSharp=g,this.isKeySharp=!1,this.isDouble=o,this.isAltered=d,this.isFlat=f,this.isKeyFlat=!1,this.natural=p,this.quarter=l,this.isLower=this.name==this.name.toLowerCase(),this.name=this.name[0].toUpperCase(),this.hasComma=s,this.isQuoted=v}function n(r){var i=r.name,c=new a(i);return c.pitch=r.pitch,c.hasComma=r.hasComma,c.isLower=r.isLower,c.isQuoted=r.isQuoted,c.isSharp=r.isSharp,c.isKeySharp=r.isKeySharp,c.isFlat=r.isFlat,c.isKeyFlat=r.isKeyFlat,c}return a.prototype.sameNoteAs=function(r){return r.pitch===this.pitch},a.prototype.isLowerThan=function(r){return r.pitch>this.pitch},a.prototype.checkKeyAccidentals=function(r,i){if(!(this.isAltered||this.natural)){if(i[this.name.toUpperCase()])switch(i[this.name.toUpperCase()]){case"__":this.acc=-2,this.pitchAltered=-2;return;case"_":this.acc=-1,this.pitchAltered=-1;return;case"=":this.acc=0,this.pitchAltered=0;return;case"^":this.acc=1,this.pitchAltered=1;return;case"^^":this.acc=2,this.pitchAltered=2;return}else if(r)for(var c=this.name,u=0;u<r.length;u++){var f=r[u];c==f.note.toUpperCase()&&(f.acc=="flat"&&(this.acc=-1,this.isKeyFlat=!0,this.pitchAltered=-1),f.acc=="sharp"&&(this.acc=1,this.isKeySharp=!0,this.pitchAltered=1))}}},a.prototype.getAccidentalEquiv=function(){var r=n(this);return r.isSharp||r.isKeySharp?(r=r.nextNote(),r.isFlat=!0,r.isSharp=!1,r.isKeySharp=!1):(r.isFlat||r.isKeyFlat)&&(r=r.prevNote(),r.isSharp=!0,r.isFlat=!1,r.isKeyFlat=!1),r},a.prototype.nextNote=function(){var r=t(this.pitch+1+this.pitchAltered);return new a(r)},a.prototype.prevNote=function(){var r=t(this.pitch-1+this.pitchAltered);return new a(r)},a.prototype.emitNoAccidentals=function(){var r=this.name;this.isLower&&(r=r.toLowerCase());for(var i=0;i<this.isQuoted;i++)r+="'";for(var c=0;c<this.hasComma;c++)r+=",";return r},a.prototype.emit=function(){var r=this.name;(this.isSharp||this.isKeySharp)&&(r="^"+r,this.isDouble&&(r="^"+r)),(this.isFlat||this.isKeyFlat)&&(r="_"+r,this.isDouble&&(r="_"+r)),this.quarter&&(this.quarter=="^"?r="^/"+r:r="_/"+r),this.natural&&(r="="+r);for(var i=1;i<=this.hasComma;i++)r+=",";if(this.isLower){r=r.toLowerCase();for(var c=1;c<=this.isQuoted;c++)r+="'"}return r},en=a,en}var tn,us;function wg(){if(us)return tn;us=1;var e=zl(),t=["A","B","C","D","E","F","G"];function a(n,r){var i=new e(n),c=new e(r);if(c.isLowerThan(i)){var u=i.emit(),f=c.emit();return{error:"Invalid string Instrument tuning : "+f+" string lower than "+u+" string"}}var g=[],d=t.indexOf(i.name),p=t.indexOf(c.name);if(d==-1||p==-1)return g;for(var l=!1;!l;)g.push(i.emit()),i=i.nextNote(),i.sameNoteAs(c)&&(l=!0);return g}return tn=a,tn}var rn,hs;function _g(){if(hs)return rn;hs=1;const{noteToMidi:e}=Pl();var t=zl(),a=wg();function n(l){var o=null,h=l.tuning;if(l.capo>0){o=[];for(var s=0;s<h.length;s++){for(var v=new t(h[s]),y=0;y<l.capo;y++)v=v.nextNote();o[s]=v.emit()}}return o}function r(l){var o=[],h=l.tuning;l.capo>0&&(h=l.capoTuning);for(var s=h.length-1,v=0;v<h.length;v++){var y=l.highestNote;v!=h.length-1&&(y=h[v+1]);var m=a(h[v],y);if(m.error)return m;o[s--]=m}return o}function i(l){var o=[];o[0]=[];for(var h=l.strings,s=1;s<h.length;s++)o[s]=h[s-1];return o}function c(l,o){for(var h=0;h<o.length-1;h++){var s=o[h],v=o[h+1];if(s.str==v.str){if(s.str==l.strings.length-1){s.num="?",v.num="?";return}v.num<s.num?(v.str++,v=f(l,v.note,v.str,l.secondPos,l.strings[v.str].length)):(s.str++,s=f(l,s.note,s.str,l.secondPos,l.strings[s.str].length)),o[h]=s,o[h+1]=v}}return null}function u(l,o){for(var h=[],s=0;s<o.length;s++)if(!o[s].endTie){var v=new t(o[s].name,l.clefTranspose);v.checkKeyAccidentals(l.accidentals,l.measureAccidentals);var y=g(l,v);h.push(y)}return c(l,h),h}function f(l,o,h,s,v){var y=l.strings;o.checkKeyAccidentals(l.accidentals,l.measureAccidentals),s&&(y=s);var m=o.emitNoAccidentals(),_=y[h].indexOf(m),k=o.acc;if(_!=-1){if(s&&(_+=v),(o.isFlat||o.acc==-1)&&_==0){var x=o.getAccidentalEquiv();h++,_=y[h].indexOf(x.emit()),k=0}return{num:_+k,str:h,note:o}}return null}function g(l,o){if(o.isAltered||o.natural){var h;o.isFlat?o.isDouble?h="__":h="_":o.isSharp?o.isDouble?h="^^":h="^":o.natural&&(h="="),l.measureAccidentals[o.name.toUpperCase()]=h}for(var s=l.stringPitches.length-1;s>=0;s--)if(o.pitch+o.pitchAltered>=l.stringPitches[s]){var v=o.pitch+o.pitchAltered-l.stringPitches[s];return o.quarter==="^"?v-=.5:o.quarter==="v"&&(v+=.5),{num:Math.round(v),str:l.stringPitches.length-1-s,note:o}}return{num:"?",str:l.stringPitches.length-1,note:o}}p.prototype.stringToPitch=function(l){var o=5.3,h=this.strings.length-1;return o+(h-l)*this.linePitch};function d(l,o){var h={num:"?",str:0,note:o};l.push(h),l.error=o.emit()+": unexpected note for instrument"}p.prototype.notesToNumber=function(l,o){var h,s,v=null,y=null;if(l&&(y=[],l.length>1?(y=u(this,l),y.error&&(v=y.error)):l[0].endTie||(h=new t(l[0].name,this.clefTranspose),h.checkKeyAccidentals(this.accidentals,this.measureAccidentals),s=g(this,h),s?y.push(s):(d(y,h),v=y.error))),v)return y;var m=null;if(o){m=[];for(var _=0;_<o.length;_++)h=new t(o[_].name,this.clefTranspose),h.checkKeyAccidentals(this.accidentals,this.measureAccidentals),s=g(this,h),s?m.push(s):(d(m,h),v=y.error)}return{notes:y,graces:m,error:v}},p.prototype.toString=function(){for(var l=[],o=0;o<this.tuning.length;o++){var h=this.tuning[o].replaceAll(",","").replaceAll("'","").toUpperCase();h[0]==="_"?h=h[1]+"b ":h[0]==="^"&&(h=h[1]+"# "),l.push(h)}return l.join("")},p.prototype.tabInfos=function(l){var o=l.params.label;if(o){var h=o.indexOf("%T"),s="";return h!=-1&&(s=this.toString(),l.capo>0&&(s+=" capo:"+l.capo),o=o.replace("%T",s)),o}return""},p.prototype.suppress=function(l){var o=l.params.suppress;return!!o};function p(l){var o=l.tuning,h=l.capo,s=l.params.highestNote;this.linePitch=l.linePitch,this.highestNote="a'",s&&(this.highestNote=s),this.measureAccidentals={},this.capo=0,h&&(this.capo=parseInt(h,10)),this.transpose=l.transpose?l.transpose:0,this.tuning=o,this.stringPitches=[];for(var v=0;v<this.tuning.length;v++){var y=e(this.tuning[v])+this.capo;this.stringPitches.push(y)}if(this.capo>0&&(this.capoTuning=n(this)),this.strings=r(this),this.strings.error){l.setError(this.strings.error),l.inError=!0;return}this.secondPos=i(this)}return rn=p,rn}var nn,fs;function kg(){if(fs)return nn;fs=1;var e=mg(),t=yg(),a=_g();n.prototype.init=function(i,c,u,f){this.tune=i,this.params=u,this.tuneNumber=c,this.inError=!1,this.abcTune=i,this.linePitch=3,this.nbLines=f.defaultTuning.length,this.isTabBig=f.isTabBig,this.tabSymbolOffset=f.tabSymbolOffset,this.capo=u.capo,this.transpose=u.visualTranspose,this.hideTabSymbol=u.hideTabSymbol,this.tablature=new e(this.nbLines,this.linePitch);var g=u.tuning;g||(g=f.defaultTuning),this.tuning=g,this.semantics=new a(this)},n.prototype.setError=function(i){i&&(this.error=i,this.inError=!0,this.tune.warnings?this.tune.warnings.push(i):this.tune.warnings=[i])},n.prototype.render=function(i,c,u){this.inError||this.tablature.bypass(c)||t(this,i,c,u)};function n(){}var r=function(){return{name:"StringTab",tablature:n}};return nn=r,nn}var an,ds;function Il(){if(ds)return an;ds=1;var e=kg(),t={violin:{name:"StringTab",defaultTuning:["G,","D","A","e"],isTabBig:!1,tabSymbolOffset:0},fiddle:{name:"StringTab",defaultTuning:["G,","D","A","e"],isTabBig:!1,tabSymbolOffset:0},mandolin:{name:"StringTab",defaultTuning:["G,","D","A","e"],isTabBig:!1,tabSymbolOffset:0},guitar:{name:"StringTab",defaultTuning:["E,","A,","D","G","B","e"],isTabBig:!0,tabSymbolOffset:0},fiveString:{name:"StringTab",defaultTuning:["C,","G,","D","A","e"],isTabBig:!1,tabSymbolOffset:-.95}},a={inited:!1,plugins:{},register:function(n){var r=n.name,i=n.tablature;this.plugins[r]=i},setError:function(n,r){n.warnings?n.warning.push(r):n.warnings=[r]},preparePlugins:function(n,r,i){this.inited||(this.register(new e),this.inited=!0);var c=null;if(i.tablature){var u=i.tablature;c=[];for(var f=0;f<u.length;f++){var g=u[f],d=g.instrument;if(d==null)return this.setError(n,"tablature 'instrument' is missing"),c;var p=t[d],l=null;if(p&&(l=this.plugins[p.name]),l){i.visualTranspose!=0&&(g.visualTranspose=i.visualTranspose),g.abcSrc=i.tablature.abcSrc;var o={classz:l,tuneNumber:r,params:g,instance:null,tabType:p};c.push(o)}else if(d==="")c.push(null);else return this.setError(n,"Undefined tablature plugin: "+d),c}}return c},layoutTablatures:function(r,i){var c=i.tablatures,u=0;if(c&&c.length>0)for(var f=c.length,g=0;g<f;++g)c[g]&&c[g].params.firstStaffOnly&&(c[g].params.suppress=!1);for(var d=0;d<i.lines.length;d++){var p=i.lines[d];if(p.staff&&u++,u>1&&c&&c.length>0)for(var f=c.length,g=0;g<f;++g)c[g].params.firstStaffOnly&&(c[g].params.suppress=!0);var l=p.staff;if(l){for(var o=l.length,h=0;h<l.length;h++)if(c[h]&&h<o){var s=c[h];s.instance==null&&(s.instance=new s.classz,s.instance.init(i,s.tuneNumber,s.params,s.tabType)),s.instance.render(r,p,h)}}}}};return an=a,an}var sn,ps;function fr(){if(ps)return sn;ps=1;var e=El(),t=vg(),a=Il(),n={};return(function(){n.numberOfTunes=function(i){var c=i.split(`
|
|
107
107
|
X:`),u=c.length;return u===0&&(u=1),u};var r=n.TuneBook=function(i){var c=t(i);this.header=c.header,this.tunes=c.tunes};r.prototype.getTuneById=function(i){for(var c=0;c<this.tunes.length;c++)if(this.tunes[c].id===""+i)return this.tunes[c];return null},r.prototype.getTuneByTitle=function(i){for(var c=0;c<this.tunes.length;c++)if(this.tunes[c].title===i)return this.tunes[c];return null},n.parseOnly=function(i,c){for(var u=n.numberOfTunes(i),f=[],g=0;g<u;g++)f.push(1);function d(){}return n.renderEngine(d,f,i,c)},n.renderEngine=function(i,c,u,f){var g=[],d=function(_){return _&&!_.propertyIsEnumerable("length")&&typeof _=="object"&&typeof _.length=="number"};if(!(c===void 0||u===void 0)){d(c)||(c=[c]),f===void 0&&(f={});for(var p=f.startingTune?parseInt(f.startingTune,10):0,l=new r(u),o=new e,h=0;h<c.length;h++){var s=c[h];if(s==="*"||typeof s=="string"&&(s=document.getElementById(s)),s)if(p>=0&&p<l.tunes.length){o.parse(l.tunes[p].abc,f,l.tunes[p].startPos-l.header.length);var v=o.getTune();f.tablature&&(v.tablatures=a.preparePlugins(v,p,f));var y=o.getWarnings();y&&(v.warnings=y);var m=i(s,v,h,l.tunes[p].abc);g.push(m||v)}else s.innerHTML&&(s.innerHTML="");p++}return g}},n.extractMeasures=function(i){for(var c=[],u=new r(i),f=0;f<u.tunes.length;f++){for(var g=u.tunes[f],d=g.abc.split("K:"),p=d[1].split(`
|
|
108
108
|
`),l=d[0]+"K:"+p[0]+`
|
|
109
|
-
`,o=null,h=null,s=null,v=[],y=!1,m=n.parseOnly(g.abc)[0],_=m.getPickupLength()>0,k=0;k<m.lines.length;k++){var x=m.lines[k];if(x.staff)for(var R=0;R<1;R++)for(var I=x.staff[R],b=0;b<1;b++)for(var A=I.voices[b],N=0;N<A.length;N++){var M=A[N];if(s===null&&M.startChar>=0&&(s=M.startChar,M.chord===void 0?h=o:h=null),M.chord&&(o=M),M.el_type==="bar"){if(y){var z=g.abc.substring(s,M.endChar),L={abc:z};o=h&&h.chord&&h.chord.length>0?h.chord[0].name:null,o&&(L.lastChord=o),M.startEnding&&(L.startEnding=M.startEnding),M.endEnding&&(L.endEnding=M.endEnding),v.push(L),s=null,y=!1}}else M.el_type==="note"&&(y=!0)}}c.push({header:l,measures:v,hasPickup:_})}return c}})(),i0=n,i0}var s0,gs;function xg(){if(gs)return s0;gs=1;var e=_l(),{relativeMajor:t,transposeKey:a,relativeMode:n,isLegalMode:r}=wl(),i=yl(),c;return(function(){c=function(b,A,N){if(A==="TEST")return{keyAccidentals:e,relativeMajor:t,transposeKey:a,relativeMode:n,transposeChordName:i};N=parseInt(N,10);var M=[],z;for(z=0;z<A.length;z++)M=M.concat(u(b,A[z],N));M=M.sort(function(T,P){return P.start-T.start});var L=b.split("");for(z=0;z<M.length;z++){var E=M[z];L.splice(E.start,E.end-E.start,E.note)}return L.join("")};function u(b,A,N){var M=[],z=A.getKeySignature();if(z.root==="Hp"||z.root==="HP")return M;M=M.concat(f(b,N));for(var L=0;L<A.lines.length;L++){var E=A.lines[L].staff;if(E)for(var T=0;T<E.length;T++){var P=E[T];P.clef.type!=="perc"&&(M=M.concat(g(b,P.voices,P.key,N)))}}return M}function f(b,A){for(var N=[],M=b.split("K:"),z=M[0].length,L=1;L<M.length;L++){var E=M[L],T=E.match(/^( *)([A-G])([#b]?)( ?)(\w*)/);if(T){var P=z+2+T[1].length,B=r(T[5])?T[5]:"",O=T[2]+T[3]+T[4]+B,w=s({root:T[2],acc:T[3],mode:B},A),C=w.root+w.acc+T[4]+w.mode;N.push({start:P,end:P+O.length,note:C})}z+=E.length+2}return N}function g(b,A,N,M){for(var z=[],L=s(N,M),E=0;E<A.length;E++)z=z.concat(l(b,A[E],N.root,d(N),L,M));return z}function d(b){for(var A={},N=0;N<b.accidentals.length;N++){var M=b.accidentals[N];M.acc==="flat"?A[M.note.toUpperCase()]="_":M.acc==="sharp"&&(A[M.note.toUpperCase()]="^")}return A}function p(b,A,N){var M=o.indexOf(b.root)-o.indexOf(A);return A==="none"&&(M=o.indexOf(b.root)),M===0?N>2?M+=7:N===-12&&(M-=7):N>0&&M<0?M+=7:N<0&&M>0&&(M-=7),N>12?M+=7:N<-12&&(M-=7),M}function l(b,A,N,M,z,L){for(var E=[],T=p(z,N,L),P={},B={},O=0;O<A.length;O++){var w=A[O];if(w.chord)for(var C=0;C<w.chord.length;C++){var S=w.chord[C];if(S.position==="default"){var q=z.accidentals.length&&z.accidentals[0].acc==="flat",D=i(S.name,L,q,!0);D=D.replace(/♭/g,"b").replace(/♯/g,"#"),D!==S.name&&E.push(R(b,w.startChar,w.endChar,D))}}if(w.el_type==="note"&&w.pitches){for(var $=k(b,w.startChar,w.endChar),F=0;F<$.length;F++){var K=_($[F].note,N,M,P);K.acc&&(P[K.name.toUpperCase()]=K.acc);var te=v(K,z,T,B);te.acc&&(B[te.upper]=te.acc),E.push({note:te.acc+te.name,start:$[F].index,end:$[F].index+$[F].note.length})}if(w.gracenotes)for(var V=0;V<w.gracenotes.length;V++){var ae=_(w.gracenotes[V].name,N,M,P);ae.acc&&(P[ae.name.toUpperCase()]=ae.acc);var oe=v(ae,z,T,P);oe.acc&&(B[oe.upper]=oe.acc),E.push(x(b,w.startChar,w.endChar,oe.acc+oe.name,V))}}else w.el_type==="bar"?(P={},B={}):w.el_type==="keySignature"&&(N=w.root,M=d(w),z=s(w,L),T=p(z,N,L))}return E}var o="CDEFGAB",h=[",,,,",",,,",",,",",","","'","''","'''","''''"];function s(b,A){if(b.root==="none")return{root:a("C",A),mode:"",acc:"",accidentals:[]};var N=t(b.root+b.acc+b.mode),M=a(N,A),z=n(M,b.mode),L=e(M);return{root:z[0],mode:b.mode,acc:z.length>1?z[1]:"",accidentals:L}}function v(b,A,N,M){for(var z=b.pitch,L=o.indexOf(b.name),E=o.indexOf(A.root),T=(E+z)%7,P=L+N,B=b.oct;P>6;)B++,P-=7;for(;P<0;)B--,P+=7;for(var O=o[T],w="",C=b.adj,S="=",q=0;q<A.accidentals.length;q++)if(A.accidentals[q].note.toLowerCase()===O.toLowerCase()){C=C+(A.accidentals[q].acc==="flat"?-1:1),S=A.accidentals[q].acc==="flat"?"_":"^";break}var D;switch(C){case-2:w="__";break;case-1:w="_";break;case 0:w="=";break;case 1:w="^";break;case 2:w="^^";break;case-3:return D={},D.pitch=b.pitch-1,D.oct=b.oct,D.name=o[o.indexOf(b.name)-1],D.name||(D.name="B",D.oct--),D.name==="B"||D.name==="E"?D.adj=b.adj+1:D.adj=b.adj+2,v(D,A,N+1,M);case 3:return D={},D.pitch=b.pitch+1,D.oct=b.oct,D.name=o[o.indexOf(b.name)+1],D.name||(D.name="C",D.oct++),D.name==="C"||D.name==="F"?D.adj=b.adj-1:D.adj=b.adj-2,v(D,A,N+1,M)}switch((M[O]===w||!M[O]&&w===S)&&!b.courtesy&&(w=""),B){case 0:O=O+",,,";break;case 1:O=O+",,";break;case 2:O=O+",";break;case 4:O=O.toLowerCase();break;case 5:O=O.toLowerCase()+"'";break;case 6:O=O.toLowerCase()+"''";break;case 7:O=O.toLowerCase()+"'''";break;case 8:O=O.toLowerCase()+"''''";break}return B>4&&(O=O.toLowerCase()),{acc:w,name:O,upper:O.toUpperCase()}}var y=/([_^=]*)([A-Ga-g])([,']*)/,m=/([_^=]*[A-Ga-g][,']*)?(\d*\/*\d*)?([\>\<\-\)]*)?/;function _(b,A,N,M){var z=A==="none"?0:o.indexOf(A),L=b.match(y),E=L[2].toUpperCase(),T=o.indexOf(E)-z;T<0&&(T+=7);var P=h.indexOf(L[3]);E===L[2]&&P--;var B=M[E]||N[E]||"=";return{acc:L[1],name:E,pitch:T,oct:P,adj:I(L[1],N[E],M[E]),courtesy:L[1]===B}}function k(b,A,N){for(var M=b.substring(A,N),z,L=[],E=/("[^"]+")+/g;(z=E.exec(M))!==null;)L.push({start:E.lastIndex-z[0].length,end:E.lastIndex});for(var T=/(![^!]+!)+/g;(z=T.exec(M))!==null;)L.push({start:T.lastIndex-z[0].length,end:T.lastIndex});for(var P=[],B=/([_^=]*)([A-Ga-g])([,']*)/g;(z=B.exec(M))!==null;){for(var O=!1,w=0;w<L.length;w++)B.lastIndex>=L[w].start&&B.lastIndex<=L[w].end&&(O=!0);O||P.push({note:z[0],index:A+B.lastIndex-z[0].length})}return P}function x(b,A,N,M,z){var L=b.substring(A,N),E=/\{/,T=/\}/,P=/([^\{]*)/,B=/(\/*)/,O=L.match(new RegExp(P.source+E.source+B.source+m.source+B.source+m.source+B.source+m.source+B.source+m.source+B.source+m.source+B.source+m.source+B.source+m.source+B.source+m.source+T.source));if(O){for(var w=1+O[1].length,C=0;C<z;C++)O[C*3+2]&&(w+=O[C*3+2].length),O[C*3+3]&&(w+=O[C*3+3].length),O[C*3+4]&&(w+=O[C*3+4].length),O[C*3+5]&&(w+=O[C*3+5].length);O[z*3+2]&&(w+=O[C*3+2].length),A+=w;var S=O[z*3+3]?O[z*3+3].length:0;S+=O[z*3+4]?O[z*3+4].length:0,S+=O[z*3+5]?O[z*3+5].length:0,N=A+S}return{start:A,end:N,note:M}}function R(b,A,N,M){var z=b.substring(A,N).match(/([^"]+)?(".+")+/);return z[1]&&(A+=z[1].length),N=A+z[2].length,{start:A+1,end:N-1,note:M}}function I(b,A,N){if(!b&&N&&(b=N),!b)return 0;switch(A){case void 0:switch(b){case"__":return-2;case"_":return-1;case"=":return 0;case"^":return 1;case"^^":return 2;default:return 0}case"_":switch(b){case"__":return-1;case"_":return 0;case"=":return 1;case"^":return 2;case"^^":return 3;default:return 0}case"^":switch(b){case"__":return-3;case"_":return-2;case"=":return-1;case"^":return 0;case"^^":return 1;default:return 0}}return 0}})(),s0=c,s0}var o0,vs;function Cg(){if(vs)return o0;vs=1;var e=function(n,r,i,c){this.type="BeamElem",this.isflat=!!i,this.isgrace=!!(r&&r==="grace"),this.forceup=!!(this.isgrace||r&&r==="up"),this.forcedown=!!(r&&r==="down"),this.elems=[],this.total=0,this.average=6,this.allrests=!0,this.stemHeight=n,this.beams=[],c&&c.duration?(this.duration=c.duration,c.startTriplet&&(this.duration*=c.tripletMultiplier),this.duration=Math.round(this.duration*1e3)/1e3):this.duration=0};e.prototype.setHint=function(){this.hint=!0},e.prototype.runningDirection=function(a){var n=a.averagepitch;n!==void 0&&(this.total=Math.round(this.total+n),this.count||(this.count=0),this.count++)},e.prototype.add=function(a){var n=a.abcelem.averagepitch;n!==void 0&&(a.abcelem.rest||(this.allrests=!1),a.beam=this,this.elems.push(a),this.total=Math.round(this.total+n),(this.min===void 0||a.abcelem.minpitch<this.min)&&(this.min=a.abcelem.minpitch),(this.max===void 0||a.abcelem.maxpitch>this.max)&&(this.max=a.abcelem.maxpitch))},e.prototype.addBeam=function(a){this.beams.push(a)},e.prototype.setStemDirection=function(){if(this.average=t(this.total,this.count),this.forceup)this.stemsUp=!0;else if(this.forcedown)this.stemsUp=!1;else{var a=6;this.stemsUp=this.average<a}delete this.count,this.total=0},e.prototype.calcDir=function(){if(this.average=t(this.total,this.elems.length),this.forceup)this.stemsUp=!0;else if(this.forcedown)this.stemsUp=!1;else{var a=6;this.stemsUp=this.average<a}for(var n=this.stemsUp?"up":"down",r=0;r<this.elems.length;r++)for(var i=0;i<this.elems[r].heads.length;i++)this.elems[r].heads[i].stemDir=n};function t(a,n){return n?a/n:0}return o0=e,o0}var c0,ms;function Sg(){if(ms)return c0;ms=1;var e=function(a,n){this.startVoice=a,this.type=n};return e.prototype.setBottomStaff=function(t){this.endVoice=t,this.startVoice.header&&!this.endVoice.header&&(this.header=this.startVoice.header,delete this.startVoice.header)},e.prototype.continuing=function(t){this.lastContinuedVoice=t},e.prototype.getWidth=function(){return 10},e.prototype.isStartVoice=function(t){return!!(this.startVoice&&this.startVoice.staff&&this.startVoice.staff.voices.length>0&&this.startVoice.staff.voices[0]===t)},c0=e,c0}var l0,bs;function pt(){if(bs)return l0;bs=1;var e=Ve(),t={0:{d:[["M",4.83,-14.97],["c",.33,-.03,1.11,0,1.47,.06],["c",1.68,.36,2.97,1.59,3.78,3.6],["c",1.2,2.97,.81,6.96,-.9,9.27],["c",-.78,1.08,-1.71,1.71,-2.91,1.95],["c",-.45,.09,-1.32,.09,-1.77,0],["c",-.81,-.18,-1.47,-.51,-2.07,-1.02],["c",-2.34,-2.07,-3.15,-6.72,-1.74,-10.2],["c",.87,-2.16,2.28,-3.42,4.14,-3.66],["z"],["m",1.11,.87],["c",-.21,-.06,-.69,-.09,-.87,-.06],["c",-.54,.12,-.87,.42,-1.17,.99],["c",-.36,.66,-.51,1.56,-.6,3],["c",-.03,.75,-.03,4.59,0,5.31],["c",.09,1.5,.27,2.4,.6,3.06],["c",.24,.48,.57,.78,.96,.9],["c",.27,.09,.78,.09,1.05,0],["c",.39,-.12,.72,-.42,.96,-.9],["c",.33,-.66,.51,-1.56,.6,-3.06],["c",.03,-.72,.03,-4.56,0,-5.31],["c",-.09,-1.47,-.27,-2.37,-.6,-3.03],["c",-.24,-.48,-.54,-.78,-.93,-.9],["z"]],w:10.78,h:14.959},1:{d:[["M",3.3,-15.06],["c",.06,-.06,.21,-.03,.66,.15],["c",.81,.39,1.08,.39,1.83,.03],["c",.21,-.09,.39,-.15,.42,-.15],["c",.12,0,.21,.09,.27,.21],["c",.06,.12,.06,.33,.06,5.94],["c",0,3.93,0,5.85,.03,6.03],["c",.06,.36,.15,.69,.27,.96],["c",.36,.75,.93,1.17,1.68,1.26],["c",.3,.03,.39,.09,.39,.3],["c",0,.15,-.03,.18,-.09,.24],["c",-.06,.06,-.09,.06,-.48,.06],["c",-.42,0,-.69,-.03,-2.1,-.24],["c",-.9,-.15,-1.77,-.15,-2.67,0],["c",-1.41,.21,-1.68,.24,-2.1,.24],["c",-.39,0,-.42,0,-.48,-.06],["c",-.06,-.06,-.06,-.09,-.06,-.24],["c",0,-.21,.06,-.27,.36,-.3],["c",.75,-.09,1.32,-.51,1.68,-1.26],["c",.12,-.27,.21,-.6,.27,-.96],["c",.03,-.18,.03,-1.59,.03,-4.29],["c",0,-3.87,0,-4.05,-.06,-4.14],["c",-.09,-.15,-.18,-.24,-.39,-.24],["c",-.12,0,-.15,.03,-.21,.06],["c",-.03,.06,-.45,.99,-.96,2.13],["c",-.48,1.14,-.9,2.1,-.93,2.16],["c",-.06,.15,-.21,.24,-.33,.24],["c",-.24,0,-.42,-.18,-.42,-.39],["c",0,-.06,3.27,-7.62,3.33,-7.74],["z"]],w:8.94,h:15.058},2:{d:[["M",4.23,-14.97],["c",.57,-.06,1.68,0,2.34,.18],["c",.69,.18,1.5,.54,2.01,.9],["c",1.35,.96,1.95,2.25,1.77,3.81],["c",-.15,1.35,-.66,2.34,-1.68,3.15],["c",-.6,.48,-1.44,.93,-3.12,1.65],["c",-1.32,.57,-1.8,.81,-2.37,1.14],["c",-.57,.33,-.57,.33,-.24,.27],["c",.39,-.09,1.26,-.09,1.68,0],["c",.72,.15,1.41,.45,2.1,.9],["c",.99,.63,1.86,.87,2.55,.75],["c",.24,-.06,.42,-.15,.57,-.3],["c",.12,-.09,.3,-.42,.3,-.51],["c",0,-.09,.12,-.21,.24,-.24],["c",.18,-.03,.39,.12,.39,.3],["c",0,.12,-.15,.57,-.3,.87],["c",-.54,1.02,-1.56,1.74,-2.79,2.01],["c",-.42,.09,-1.23,.09,-1.62,.03],["c",-.81,-.18,-1.32,-.45,-2.01,-1.11],["c",-.45,-.45,-.63,-.57,-.96,-.69],["c",-.84,-.27,-1.89,.12,-2.25,.9],["c",-.12,.21,-.21,.54,-.21,.72],["c",0,.12,-.12,.21,-.27,.24],["c",-.15,0,-.27,-.03,-.33,-.15],["c",-.09,-.21,.09,-1.08,.33,-1.71],["c",.24,-.66,.66,-1.26,1.29,-1.89],["c",.45,-.45,.9,-.81,1.92,-1.56],["c",1.29,-.93,1.89,-1.44,2.34,-1.98],["c",.87,-1.05,1.26,-2.19,1.2,-3.63],["c",-.06,-1.29,-.39,-2.31,-.96,-2.91],["c",-.36,-.33,-.72,-.51,-1.17,-.54],["c",-.84,-.03,-1.53,.42,-1.59,1.05],["c",-.03,.33,.12,.6,.57,1.14],["c",.45,.54,.54,.87,.42,1.41],["c",-.15,.63,-.54,1.11,-1.08,1.38],["c",-.63,.33,-1.2,.33,-1.83,0],["c",-.24,-.12,-.33,-.18,-.54,-.39],["c",-.18,-.18,-.27,-.3,-.36,-.51],["c",-.24,-.45,-.27,-.84,-.21,-1.38],["c",.12,-.75,.45,-1.41,1.02,-1.98],["c",.72,-.72,1.74,-1.17,2.85,-1.32],["z"]],w:10.764,h:14.97},3:{d:[["M",3.78,-14.97],["c",.3,-.03,1.41,0,1.83,.06],["c",2.22,.3,3.51,1.32,3.72,2.91],["c",.03,.33,.03,1.26,-.03,1.65],["c",-.12,.84,-.48,1.47,-1.05,1.77],["c",-.27,.15,-.36,.24,-.45,.39],["c",-.09,.21,-.09,.36,0,.57],["c",.09,.15,.18,.24,.51,.39],["c",.75,.42,1.23,1.14,1.41,2.13],["c",.06,.42,.06,1.35,0,1.71],["c",-.18,.81,-.48,1.38,-1.02,1.95],["c",-.75,.72,-1.8,1.2,-3.18,1.38],["c",-.42,.06,-1.56,.06,-1.95,0],["c",-1.89,-.33,-3.18,-1.29,-3.51,-2.64],["c",-.03,-.12,-.03,-.33,-.03,-.6],["c",0,-.36,0,-.42,.06,-.63],["c",.12,-.3,.27,-.51,.51,-.75],["c",.24,-.24,.45,-.39,.75,-.51],["c",.21,-.06,.27,-.06,.6,-.06],["c",.33,0,.39,0,.6,.06],["c",.3,.12,.51,.27,.75,.51],["c",.36,.33,.57,.75,.6,1.2],["c",0,.21,0,.27,-.06,.42],["c",-.09,.18,-.12,.24,-.54,.54],["c",-.51,.36,-.63,.54,-.6,.87],["c",.06,.54,.54,.9,1.38,.99],["c",.36,.06,.72,.03,.96,-.06],["c",.81,-.27,1.29,-1.23,1.44,-2.79],["c",.03,-.45,.03,-1.95,-.03,-2.37],["c",-.09,-.75,-.33,-1.23,-.75,-1.44],["c",-.33,-.18,-.45,-.18,-1.98,-.18],["c",-1.35,0,-1.41,0,-1.5,-.06],["c",-.18,-.12,-.24,-.39,-.12,-.6],["c",.12,-.15,.15,-.15,1.68,-.15],["c",1.5,0,1.62,0,1.89,-.15],["c",.18,-.09,.42,-.36,.54,-.57],["c",.18,-.42,.27,-.9,.3,-1.95],["c",.03,-1.2,-.06,-1.8,-.36,-2.37],["c",-.24,-.48,-.63,-.81,-1.14,-.96],["c",-.3,-.06,-1.08,-.06,-1.38,.03],["c",-.6,.15,-.9,.42,-.96,.84],["c",-.03,.3,.06,.45,.63,.84],["c",.33,.24,.42,.39,.45,.63],["c",.03,.72,-.57,1.5,-1.32,1.65],["c",-1.05,.27,-2.1,-.57,-2.1,-1.65],["c",0,-.45,.15,-.96,.39,-1.38],["c",.12,-.21,.54,-.63,.81,-.81],["c",.57,-.42,1.38,-.69,2.25,-.81],["z"]],w:9.735,h:14.967},4:{d:[["M",8.64,-14.94],["c",.27,-.09,.42,-.12,.54,-.03],["c",.09,.06,.15,.21,.15,.3],["c",-.03,.06,-1.92,2.31,-4.23,5.04],["c",-2.31,2.73,-4.23,4.98,-4.26,5.01],["c",-.03,.06,.12,.06,2.55,.06],["l",2.61,0],["l",0,-2.37],["c",0,-2.19,.03,-2.37,.06,-2.46],["c",.03,-.06,.21,-.18,.57,-.42],["c",1.08,-.72,1.38,-1.08,1.86,-2.16],["c",.12,-.3,.24,-.54,.27,-.57],["c",.12,-.12,.39,-.06,.45,.12],["c",.06,.09,.06,.57,.06,3.96],["l",0,3.9],["l",1.08,0],["c",1.05,0,1.11,0,1.2,.06],["c",.24,.15,.24,.54,0,.69],["c",-.09,.06,-.15,.06,-1.2,.06],["l",-1.08,0],["l",0,.33],["c",0,.57,.09,1.11,.3,1.53],["c",.36,.75,.93,1.17,1.68,1.26],["c",.3,.03,.39,.09,.39,.3],["c",0,.15,-.03,.18,-.09,.24],["c",-.06,.06,-.09,.06,-.48,.06],["c",-.42,0,-.69,-.03,-2.1,-.24],["c",-.9,-.15,-1.77,-.15,-2.67,0],["c",-1.41,.21,-1.68,.24,-2.1,.24],["c",-.39,0,-.42,0,-.48,-.06],["c",-.06,-.06,-.06,-.09,-.06,-.24],["c",0,-.21,.06,-.27,.36,-.3],["c",.75,-.09,1.32,-.51,1.68,-1.26],["c",.21,-.42,.3,-.96,.3,-1.53],["l",0,-.33],["l",-2.7,0],["c",-2.91,0,-2.85,0,-3.09,-.15],["c",-.18,-.12,-.3,-.39,-.27,-.54],["c",.03,-.06,.18,-.24,.33,-.45],["c",.75,-.9,1.59,-2.07,2.13,-3.03],["c",.33,-.54,.84,-1.62,1.05,-2.16],["c",.57,-1.41,.84,-2.64,.9,-4.05],["c",.03,-.63,.06,-.72,.24,-.81],["l",.12,-.06],["l",.45,.12],["c",.66,.18,1.02,.24,1.47,.27],["c",.6,.03,1.23,-.09,2.01,-.33],["z"]],w:11.795,h:14.994},5:{d:[["M",1.02,-14.94],["c",.12,-.09,.03,-.09,1.08,.06],["c",2.49,.36,4.35,.36,6.96,-.06],["c",.57,-.09,.66,-.06,.81,.06],["c",.15,.18,.12,.24,-.15,.51],["c",-1.29,1.26,-3.24,2.04,-5.58,2.31],["c",-.6,.09,-1.2,.12,-1.71,.12],["c",-.39,0,-.45,0,-.57,.06],["c",-.09,.06,-.15,.12,-.21,.21],["l",-.06,.12],["l",0,1.65],["l",0,1.65],["l",.21,-.21],["c",.66,-.57,1.41,-.96,2.19,-1.14],["c",.33,-.06,1.41,-.06,1.95,0],["c",2.61,.36,4.02,1.74,4.26,4.14],["c",.03,.45,.03,1.08,-.03,1.44],["c",-.18,1.02,-.78,2.01,-1.59,2.7],["c",-.72,.57,-1.62,1.02,-2.49,1.2],["c",-1.38,.27,-3.03,.06,-4.2,-.54],["c",-1.08,-.54,-1.71,-1.32,-1.86,-2.28],["c",-.09,-.69,.09,-1.29,.57,-1.74],["c",.24,-.24,.45,-.39,.75,-.51],["c",.21,-.06,.27,-.06,.6,-.06],["c",.33,0,.39,0,.6,.06],["c",.3,.12,.51,.27,.75,.51],["c",.36,.33,.57,.75,.6,1.2],["c",0,.21,0,.27,-.06,.42],["c",-.09,.18,-.12,.24,-.54,.54],["c",-.18,.12,-.36,.3,-.42,.33],["c",-.36,.42,-.18,.99,.36,1.26],["c",.51,.27,1.47,.36,2.01,.27],["c",.93,-.21,1.47,-1.17,1.65,-2.91],["c",.06,-.45,.06,-1.89,0,-2.31],["c",-.15,-1.2,-.51,-2.1,-1.05,-2.55],["c",-.21,-.18,-.54,-.36,-.81,-.39],["c",-.3,-.06,-.84,-.03,-1.26,.06],["c",-.93,.18,-1.65,.6,-2.16,1.2],["c",-.15,.21,-.27,.3,-.39,.3],["c",-.15,0,-.3,-.09,-.36,-.18],["c",-.06,-.09,-.06,-.15,-.06,-3.66],["c",0,-3.39,0,-3.57,.06,-3.66],["c",.03,-.06,.09,-.15,.15,-.18],["z"]],w:10.212,h:14.997},6:{d:[["M",4.98,-14.97],["c",.36,-.03,1.2,0,1.59,.06],["c",.9,.15,1.68,.51,2.25,1.05],["c",.57,.51,.87,1.23,.84,1.98],["c",-.03,.51,-.21,.9,-.6,1.26],["c",-.24,.24,-.45,.39,-.75,.51],["c",-.21,.06,-.27,.06,-.6,.06],["c",-.33,0,-.39,0,-.6,-.06],["c",-.3,-.12,-.51,-.27,-.75,-.51],["c",-.39,-.36,-.57,-.78,-.57,-1.26],["c",0,-.27,0,-.3,.09,-.42],["c",.03,-.09,.18,-.21,.3,-.3],["c",.12,-.09,.3,-.21,.39,-.27],["c",.09,-.06,.21,-.18,.27,-.24],["c",.06,-.12,.09,-.15,.09,-.33],["c",0,-.18,-.03,-.24,-.09,-.36],["c",-.24,-.39,-.75,-.6,-1.38,-.57],["c",-.54,.03,-.9,.18,-1.23,.48],["c",-.81,.72,-1.08,2.16,-.96,5.37],["l",0,.63],["l",.3,-.12],["c",.78,-.27,1.29,-.33,2.1,-.27],["c",1.47,.12,2.49,.54,3.27,1.29],["c",.48,.51,.81,1.11,.96,1.89],["c",.06,.27,.06,.42,.06,.93],["c",0,.54,0,.69,-.06,.96],["c",-.15,.78,-.48,1.38,-.96,1.89],["c",-.54,.51,-1.17,.87,-1.98,1.08],["c",-1.14,.3,-2.4,.33,-3.24,.03],["c",-1.5,-.48,-2.64,-1.89,-3.27,-4.02],["c",-.36,-1.23,-.51,-2.82,-.42,-4.08],["c",.3,-3.66,2.28,-6.3,4.95,-6.66],["z"],["m",.66,7.41],["c",-.27,-.09,-.81,-.12,-1.08,-.06],["c",-.72,.18,-1.08,.69,-1.23,1.71],["c",-.06,.54,-.06,3,0,3.54],["c",.18,1.26,.72,1.77,1.8,1.74],["c",.39,-.03,.63,-.09,.9,-.27],["c",.66,-.42,.9,-1.32,.9,-3.24],["c",0,-2.22,-.36,-3.12,-1.29,-3.42],["z"]],w:9.956,h:14.982},7:{d:[["M",.21,-14.97],["c",.21,-.06,.45,0,.54,.15],["c",.06,.09,.06,.15,.06,.39],["c",0,.24,0,.33,.06,.42],["c",.06,.12,.21,.24,.27,.24],["c",.03,0,.12,-.12,.24,-.21],["c",.96,-1.2,2.58,-1.35,3.99,-.42],["c",.15,.12,.42,.3,.54,.45],["c",.48,.39,.81,.57,1.29,.6],["c",.69,.03,1.5,-.3,2.13,-.87],["c",.09,-.09,.27,-.3,.39,-.45],["c",.12,-.15,.24,-.27,.3,-.3],["c",.18,-.06,.39,.03,.51,.21],["c",.06,.18,.06,.24,-.27,.72],["c",-.18,.24,-.54,.78,-.78,1.17],["c",-2.37,3.54,-3.54,6.27,-3.87,9],["c",-.03,.33,-.03,.66,-.03,1.26],["c",0,.9,0,1.08,.15,1.89],["c",.06,.45,.06,.48,.03,.6],["c",-.06,.09,-.21,.21,-.3,.21],["c",-.03,0,-.27,-.06,-.54,-.15],["c",-.84,-.27,-1.11,-.3,-1.65,-.3],["c",-.57,0,-.84,.03,-1.56,.27],["c",-.6,.18,-.69,.21,-.81,.15],["c",-.12,-.06,-.21,-.18,-.21,-.3],["c",0,-.15,.6,-1.44,1.2,-2.61],["c",1.14,-2.22,2.73,-4.68,5.1,-8.01],["c",.21,-.27,.36,-.48,.33,-.48],["c",0,0,-.12,.06,-.27,.12],["c",-.54,.3,-.99,.39,-1.56,.39],["c",-.75,.03,-1.2,-.18,-1.83,-.75],["c",-.99,-.9,-1.83,-1.17,-2.31,-.72],["c",-.18,.15,-.36,.51,-.45,.84],["c",-.06,.24,-.06,.33,-.09,1.98],["c",0,1.62,-.03,1.74,-.06,1.8],["c",-.15,.24,-.54,.24,-.69,0],["c",-.06,-.09,-.06,-.15,-.06,-3.57],["c",0,-3.42,0,-3.48,.06,-3.57],["c",.03,-.06,.09,-.12,.15,-.15],["z"]],w:10.561,h:15.093},8:{d:[["M",4.98,-14.97],["c",.33,-.03,1.02,-.03,1.32,0],["c",1.32,.12,2.49,.6,3.21,1.32],["c",.39,.39,.66,.81,.78,1.29],["c",.09,.36,.09,1.08,0,1.44],["c",-.21,.84,-.66,1.59,-1.59,2.55],["l",-.3,.3],["l",.27,.18],["c",1.47,.93,2.31,2.31,2.25,3.75],["c",-.03,.75,-.24,1.35,-.63,1.95],["c",-.45,.66,-1.02,1.14,-1.83,1.53],["c",-1.8,.87,-4.2,.87,-6,.03],["c",-1.62,-.78,-2.52,-2.16,-2.46,-3.66],["c",.06,-.99,.54,-1.77,1.8,-2.97],["c",.54,-.51,.54,-.54,.48,-.57],["c",-.39,-.27,-.96,-.78,-1.2,-1.14],["c",-.75,-1.11,-.87,-2.4,-.3,-3.6],["c",.69,-1.35,2.25,-2.25,4.2,-2.4],["z"],["m",1.53,.69],["c",-.42,-.09,-1.11,-.12,-1.38,-.06],["c",-.3,.06,-.6,.18,-.81,.3],["c",-.21,.12,-.6,.51,-.72,.72],["c",-.51,.87,-.42,1.89,.21,2.52],["c",.21,.21,.36,.3,1.95,1.23],["c",.96,.54,1.74,.99,1.77,1.02],["c",.09,0,.63,-.6,.99,-1.11],["c",.21,-.36,.48,-.87,.57,-1.23],["c",.06,-.24,.06,-.36,.06,-.72],["c",0,-.45,-.03,-.66,-.15,-.99],["c",-.39,-.81,-1.29,-1.44,-2.49,-1.68],["z"],["m",-1.44,8.07],["l",-1.89,-1.08],["c",-.03,0,-.18,.15,-.39,.33],["c",-1.2,1.08,-1.65,1.95,-1.59,3],["c",.09,1.59,1.35,2.85,3.21,3.24],["c",.33,.06,.45,.06,.93,.06],["c",.63,0,.81,-.03,1.29,-.27],["c",.9,-.42,1.47,-1.41,1.41,-2.4],["c",-.06,-.66,-.39,-1.29,-.9,-1.65],["c",-.12,-.09,-1.05,-.63,-2.07,-1.23],["z"]],w:10.926,h:14.989},9:{d:[["M",4.23,-14.97],["c",.42,-.03,1.29,0,1.62,.06],["c",.51,.12,.93,.3,1.38,.57],["c",1.53,1.02,2.52,3.24,2.73,5.94],["c",.18,2.55,-.48,4.98,-1.83,6.57],["c",-1.05,1.26,-2.4,1.89,-3.93,1.83],["c",-1.23,-.06,-2.31,-.45,-3.03,-1.14],["c",-.57,-.51,-.87,-1.23,-.84,-1.98],["c",.03,-.51,.21,-.9,.6,-1.26],["c",.24,-.24,.45,-.39,.75,-.51],["c",.21,-.06,.27,-.06,.6,-.06],["c",.33,0,.39,0,.6,.06],["c",.3,.12,.51,.27,.75,.51],["c",.39,.36,.57,.78,.57,1.26],["c",0,.27,0,.3,-.09,.42],["c",-.03,.09,-.18,.21,-.3,.3],["c",-.12,.09,-.3,.21,-.39,.27],["c",-.09,.06,-.21,.18,-.27,.24],["c",-.06,.12,-.06,.15,-.06,.33],["c",0,.18,0,.24,.06,.36],["c",.24,.39,.75,.6,1.38,.57],["c",.54,-.03,.9,-.18,1.23,-.48],["c",.81,-.72,1.08,-2.16,.96,-5.37],["l",0,-.63],["l",-.3,.12],["c",-.78,.27,-1.29,.33,-2.1,.27],["c",-1.47,-.12,-2.49,-.54,-3.27,-1.29],["c",-.48,-.51,-.81,-1.11,-.96,-1.89],["c",-.06,-.27,-.06,-.42,-.06,-.96],["c",0,-.51,0,-.66,.06,-.93],["c",.15,-.78,.48,-1.38,.96,-1.89],["c",.15,-.12,.33,-.27,.42,-.36],["c",.69,-.51,1.62,-.81,2.76,-.93],["z"],["m",1.17,.66],["c",-.21,-.06,-.57,-.06,-.81,-.03],["c",-.78,.12,-1.26,.69,-1.41,1.74],["c",-.12,.63,-.15,1.95,-.09,2.79],["c",.12,1.71,.63,2.4,1.77,2.46],["c",1.08,.03,1.62,-.48,1.8,-1.74],["c",.06,-.54,.06,-3,0,-3.54],["c",-.15,-1.05,-.51,-1.53,-1.26,-1.68],["z"]],w:9.959,h:14.986},"rests.multimeasure":{d:[["M",0,-4],["l",0,16],["l",1,0],["l",0,-5],["l",40,0],["l",0,5],["l",1,0],["l",0,-16],["l",-1,0],["l",0,5],["l",-40,0],["l",0,-5],["z"]],w:42,h:18},"rests.whole":{d:[["M",.06,.03],["l",.09,-.06],["l",5.46,0],["l",5.49,0],["l",.09,.06],["l",.06,.09],["l",0,2.19],["l",0,2.19],["l",-.06,.09],["l",-.09,.06],["l",-5.49,0],["l",-5.46,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-2.19],["l",0,-2.19],["z"]],w:11.25,h:4.68},"rests.half":{d:[["M",.06,-4.62],["l",.09,-.06],["l",5.46,0],["l",5.49,0],["l",.09,.06],["l",.06,.09],["l",0,2.19],["l",0,2.19],["l",-.06,.09],["l",-.09,.06],["l",-5.49,0],["l",-5.46,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-2.19],["l",0,-2.19],["z"]],w:11.25,h:4.68},"rests.quarter":{d:[["M",1.89,-11.82],["c",.12,-.06,.24,-.06,.36,-.03],["c",.09,.06,4.74,5.58,4.86,5.82],["c",.21,.39,.15,.78,-.15,1.26],["c",-.24,.33,-.72,.81,-1.62,1.56],["c",-.45,.36,-.87,.75,-.96,.84],["c",-.93,.99,-1.14,2.49,-.6,3.63],["c",.18,.39,.27,.48,1.32,1.68],["c",1.92,2.25,1.83,2.16,1.83,2.34],["c",0,.18,-.18,.36,-.36,.39],["c",-.15,0,-.27,-.06,-.48,-.27],["c",-.75,-.75,-2.46,-1.29,-3.39,-1.08],["c",-.45,.09,-.69,.27,-.9,.69],["c",-.12,.3,-.21,.66,-.24,1.14],["c",-.03,.66,.09,1.35,.3,2.01],["c",.15,.42,.24,.66,.45,.96],["c",.18,.24,.18,.33,.03,.42],["c",-.12,.06,-.18,.03,-.45,-.3],["c",-1.08,-1.38,-2.07,-3.36,-2.4,-4.83],["c",-.27,-1.05,-.15,-1.77,.27,-2.07],["c",.21,-.12,.42,-.15,.87,-.15],["c",.87,.06,2.1,.39,3.3,.9],["l",.39,.18],["l",-1.65,-1.95],["c",-2.52,-2.97,-2.61,-3.09,-2.7,-3.27],["c",-.09,-.24,-.12,-.48,-.03,-.75],["c",.15,-.48,.57,-.96,1.83,-2.01],["c",.45,-.36,.84,-.72,.93,-.78],["c",.69,-.75,1.02,-1.8,.9,-2.79],["c",-.06,-.33,-.21,-.84,-.39,-1.11],["c",-.09,-.15,-.45,-.6,-.81,-1.05],["c",-.36,-.42,-.69,-.81,-.72,-.87],["c",-.09,-.18,0,-.42,.21,-.51],["z"]],w:7.888,h:21.435},"rests.8th":{d:[["M",1.68,-6.12],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.12,0,.18,0,.33,-.09],["c",.39,-.18,1.32,-1.29,1.68,-1.98],["c",.09,-.21,.24,-.3,.39,-.3],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.27,1.11,-1.86,6.42],["c",-1.02,3.48,-1.89,6.39,-1.92,6.42],["c",0,.03,-.12,.12,-.24,.15],["c",-.18,.09,-.21,.09,-.45,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.15,-.57,1.68,-4.92],["c",.96,-2.67,1.74,-4.89,1.71,-4.89],["l",-.51,.15],["c",-1.08,.36,-1.74,.48,-2.55,.48],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:7.534,h:13.883},"rests.16th":{d:[["M",3.33,-6.12],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.15,.39,.57,.57,.87,.42],["c",.39,-.18,1.2,-1.23,1.62,-2.07],["c",.06,-.15,.24,-.24,.36,-.24],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.45,1.86,-2.67,10.17],["c",-1.5,5.55,-2.73,10.14,-2.76,10.17],["c",-.03,.03,-.12,.12,-.24,.15],["c",-.18,.09,-.21,.09,-.45,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.12,-.57,1.44,-4.92],["c",.81,-2.67,1.47,-4.86,1.47,-4.89],["c",-.03,0,-.27,.06,-.54,.15],["c",-1.08,.36,-1.77,.48,-2.58,.48],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.09,.09,.27,.18,.45,.21],["c",.12,0,.18,0,.33,-.09],["c",.33,-.15,1.02,-.93,1.41,-1.59],["c",.12,-.21,.18,-.39,.39,-1.08],["c",.66,-2.1,1.17,-3.84,1.17,-3.87],["c",0,0,-.21,.06,-.42,.15],["c",-.51,.15,-1.2,.33,-1.68,.42],["c",-.33,.06,-.51,.06,-.96,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:9.724,h:21.383},"rests.32nd":{d:[["M",4.23,-13.62],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.12,0,.18,0,.27,-.06],["c",.33,-.21,.99,-1.11,1.44,-1.98],["c",.09,-.24,.21,-.33,.39,-.33],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.57,2.67,-3.21,13.89],["c",-1.8,7.62,-3.3,13.89,-3.3,13.92],["c",-.03,.06,-.12,.12,-.24,.18],["c",-.21,.09,-.24,.09,-.48,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.09,-.57,1.23,-4.92],["c",.69,-2.67,1.26,-4.86,1.29,-4.89],["c",0,-.03,-.12,-.03,-.48,.12],["c",-1.17,.39,-2.22,.57,-3,.54],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.12,.09,.3,.18,.48,.21],["c",.12,0,.18,0,.3,-.09],["c",.42,-.21,1.29,-1.29,1.56,-1.89],["c",.03,-.12,1.23,-4.59,1.23,-4.65],["c",0,-.03,-.18,.03,-.39,.12],["c",-.63,.18,-1.2,.36,-1.74,.45],["c",-.39,.06,-.54,.06,-1.02,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.18,.18,.51,.27,.72,.15],["c",.3,-.12,.69,-.57,1.08,-1.17],["c",.42,-.6,.39,-.51,1.05,-3.03],["c",.33,-1.26,.6,-2.31,.6,-2.34],["c",0,0,-.21,.03,-.45,.12],["c",-.57,.18,-1.14,.33,-1.62,.42],["c",-.33,.06,-.51,.06,-.96,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:11.373,h:28.883},"rests.64th":{d:[["M",5.13,-13.62],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.18,.21,.54,.3,.75,.18],["c",.24,-.12,.63,-.66,1.08,-1.56],["c",.33,-.66,.39,-.72,.6,-.72],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.69,3.66,-3.54,17.64],["c",-1.95,9.66,-3.57,17.61,-3.57,17.64],["c",-.03,.06,-.12,.12,-.24,.18],["c",-.21,.09,-.24,.09,-.48,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.06,-.57,1.05,-4.95],["c",.6,-2.7,1.08,-4.89,1.08,-4.92],["c",0,0,-.24,.06,-.51,.15],["c",-.66,.24,-1.2,.36,-1.77,.48],["c",-.42,.06,-.57,.06,-1.05,.06],["c",-.69,0,-.87,-.03,-1.35,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.09,.09,.27,.18,.45,.21],["c",.21,.03,.39,-.09,.72,-.42],["c",.45,-.45,1.02,-1.26,1.17,-1.65],["c",.03,-.09,.27,-1.14,.54,-2.34],["c",.27,-1.2,.48,-2.19,.51,-2.22],["c",0,-.03,-.09,-.03,-.48,.12],["c",-1.17,.39,-2.22,.57,-3,.54],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.15,.39,.57,.57,.9,.42],["c",.36,-.18,1.2,-1.26,1.47,-1.89],["c",.03,-.09,.3,-1.2,.57,-2.43],["l",.51,-2.28],["l",-.54,.18],["c",-1.11,.36,-1.8,.48,-2.61,.48],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.21,.21,.54,.3,.75,.18],["c",.36,-.18,.93,-.93,1.29,-1.68],["c",.12,-.24,.18,-.48,.63,-2.55],["l",.51,-2.31],["c",0,-.03,-.18,.03,-.39,.12],["c",-1.14,.36,-2.1,.54,-2.82,.51],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:12.453,h:36.383},"rests.128th":{d:[["M",6.03,-21.12],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.21,0,.33,-.06,.54,-.36],["c",.15,-.21,.54,-.93,.78,-1.47],["c",.15,-.33,.18,-.39,.3,-.48],["c",.18,-.09,.45,0,.51,.15],["c",.03,.09,-7.11,42.75,-7.17,42.84],["c",-.03,.03,-.15,.09,-.24,.15],["c",-.18,.06,-.24,.06,-.45,.06],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.03,-.57,.84,-4.98],["c",.51,-2.7,.93,-4.92,.9,-4.92],["c",0,0,-.15,.06,-.36,.12],["c",-.78,.27,-1.62,.48,-2.31,.57],["c",-.15,.03,-.54,.03,-.81,.03],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.63,.48],["c",.12,0,.18,0,.3,-.09],["c",.42,-.21,1.14,-1.11,1.5,-1.83],["c",.12,-.27,.12,-.27,.54,-2.52],["c",.24,-1.23,.42,-2.25,.39,-2.25],["c",0,0,-.24,.06,-.51,.18],["c",-1.26,.39,-2.25,.57,-3.06,.54],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.18,.21,.51,.3,.75,.18],["c",.36,-.15,1.05,-.99,1.41,-1.77],["l",.15,-.3],["l",.42,-2.25],["c",.21,-1.26,.42,-2.28,.39,-2.28],["l",-.51,.15],["c",-1.11,.39,-1.89,.51,-2.7,.51],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.18,.18,.48,.27,.72,.21],["c",.33,-.12,1.14,-1.26,1.41,-1.95],["c",0,-.09,.21,-1.11,.45,-2.34],["c",.21,-1.2,.39,-2.22,.39,-2.28],["c",.03,-.03,0,-.03,-.45,.12],["c",-.57,.18,-1.2,.33,-1.71,.42],["c",-.3,.06,-.51,.06,-.93,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.18,0,.36,-.09,.57,-.33],["c",.33,-.36,.78,-1.14,.93,-1.56],["c",.03,-.12,.24,-1.2,.45,-2.4],["c",.24,-1.2,.42,-2.22,.42,-2.28],["c",.03,-.03,0,-.03,-.39,.09],["c",-1.05,.36,-1.8,.48,-2.58,.48],["c",-.63,0,-.84,-.03,-1.29,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:12.992,h:43.883},"accidentals.sharp":{d:[["M",5.73,-11.19],["c",.21,-.12,.54,-.03,.66,.24],["c",.06,.12,.06,.21,.06,2.31],["c",0,1.23,0,2.22,.03,2.22],["c",0,0,.27,-.12,.6,-.24],["c",.69,-.27,.78,-.3,.96,-.15],["c",.21,.15,.21,.18,.21,1.38],["c",0,1.02,0,1.11,-.06,1.2],["c",-.03,.06,-.09,.12,-.12,.15],["c",-.06,.03,-.42,.21,-.84,.36],["l",-.75,.33],["l",-.03,2.43],["c",0,1.32,0,2.43,.03,2.43],["c",0,0,.27,-.12,.6,-.24],["c",.69,-.27,.78,-.3,.96,-.15],["c",.21,.15,.21,.18,.21,1.38],["c",0,1.02,0,1.11,-.06,1.2],["c",-.03,.06,-.09,.12,-.12,.15],["c",-.06,.03,-.42,.21,-.84,.36],["l",-.75,.33],["l",-.03,2.52],["c",0,2.28,-.03,2.55,-.06,2.64],["c",-.21,.36,-.72,.36,-.93,0],["c",-.03,-.09,-.06,-.33,-.06,-2.43],["l",0,-2.31],["l",-1.29,.51],["l",-1.26,.51],["l",0,2.43],["c",0,2.58,0,2.52,-.15,2.67],["c",-.06,.09,-.27,.18,-.36,.18],["c",-.12,0,-.33,-.09,-.39,-.18],["c",-.15,-.15,-.15,-.09,-.15,-2.43],["c",0,-1.23,0,-2.22,-.03,-2.22],["c",0,0,-.27,.12,-.6,.24],["c",-.69,.27,-.78,.3,-.96,.15],["c",-.21,-.15,-.21,-.18,-.21,-1.38],["c",0,-1.02,0,-1.11,.06,-1.2],["c",.03,-.06,.09,-.12,.12,-.15],["c",.06,-.03,.42,-.21,.84,-.36],["l",.78,-.33],["l",0,-2.43],["c",0,-1.32,0,-2.43,-.03,-2.43],["c",0,0,-.27,.12,-.6,.24],["c",-.69,.27,-.78,.3,-.96,.15],["c",-.21,-.15,-.21,-.18,-.21,-1.38],["c",0,-1.02,0,-1.11,.06,-1.2],["c",.03,-.06,.09,-.12,.12,-.15],["c",.06,-.03,.42,-.21,.84,-.36],["l",.78,-.33],["l",0,-2.52],["c",0,-2.28,.03,-2.55,.06,-2.64],["c",.21,-.36,.72,-.36,.93,0],["c",.03,.09,.06,.33,.06,2.43],["l",.03,2.31],["l",1.26,-.51],["l",1.26,-.51],["l",0,-2.43],["c",0,-2.28,0,-2.43,.06,-2.55],["c",.06,-.12,.12,-.18,.27,-.24],["z"],["m",-.33,10.65],["l",0,-2.43],["l",-1.29,.51],["l",-1.26,.51],["l",0,2.46],["l",0,2.43],["l",.09,-.03],["c",.06,-.03,.63,-.27,1.29,-.51],["l",1.17,-.48],["l",0,-2.46],["z"]],w:8.25,h:22.462},"accidentals.halfsharp":{d:[["M",2.43,-10.05],["c",.21,-.12,.54,-.03,.66,.24],["c",.06,.12,.06,.21,.06,2.01],["c",0,1.05,0,1.89,.03,1.89],["l",.72,-.48],["c",.69,-.48,.69,-.51,.87,-.51],["c",.15,0,.18,.03,.27,.09],["c",.21,.15,.21,.18,.21,1.41],["c",0,1.11,-.03,1.14,-.09,1.23],["c",-.03,.03,-.48,.39,-1.02,.75],["l",-.99,.66],["l",0,2.37],["c",0,1.32,0,2.37,.03,2.37],["l",.72,-.48],["c",.69,-.48,.69,-.51,.87,-.51],["c",.15,0,.18,.03,.27,.09],["c",.21,.15,.21,.18,.21,1.41],["c",0,1.11,-.03,1.14,-.09,1.23],["c",-.03,.03,-.48,.39,-1.02,.75],["l",-.99,.66],["l",0,2.25],["c",0,1.95,0,2.28,-.06,2.37],["c",-.06,.12,-.12,.21,-.24,.27],["c",-.27,.12,-.54,.03,-.69,-.24],["c",-.06,-.12,-.06,-.21,-.06,-2.01],["c",0,-1.05,0,-1.89,-.03,-1.89],["l",-.72,.48],["c",-.69,.48,-.69,.48,-.87,.48],["c",-.15,0,-.18,0,-.27,-.06],["c",-.21,-.15,-.21,-.18,-.21,-1.41],["c",0,-1.11,.03,-1.14,.09,-1.23],["c",.03,-.03,.48,-.39,1.02,-.75],["l",.99,-.66],["l",0,-2.37],["c",0,-1.32,0,-2.37,-.03,-2.37],["l",-.72,.48],["c",-.69,.48,-.69,.48,-.87,.48],["c",-.15,0,-.18,0,-.27,-.06],["c",-.21,-.15,-.21,-.18,-.21,-1.41],["c",0,-1.11,.03,-1.14,.09,-1.23],["c",.03,-.03,.48,-.39,1.02,-.75],["l",.99,-.66],["l",0,-2.25],["c",0,-2.13,0,-2.28,.06,-2.4],["c",.06,-.12,.12,-.18,.27,-.24],["z"]],w:5.25,h:20.174},"accidentals.nat":{d:[["M",.21,-11.4],["c",.24,-.06,.78,0,.99,.15],["c",.03,.03,.03,.48,0,2.61],["c",-.03,1.44,-.03,2.61,-.03,2.61],["c",0,.03,.75,-.09,1.68,-.24],["c",.96,-.18,1.71,-.27,1.74,-.27],["c",.15,.03,.27,.15,.36,.3],["l",.06,.12],["l",.09,8.67],["c",.09,6.96,.12,8.67,.09,8.67],["c",-.03,.03,-.12,.06,-.21,.09],["c",-.24,.09,-.72,.09,-.96,0],["c",-.09,-.03,-.18,-.06,-.21,-.09],["c",-.03,-.03,-.03,-.48,0,-2.61],["c",.03,-1.44,.03,-2.61,.03,-2.61],["c",0,-.03,-.75,.09,-1.68,.24],["c",-.96,.18,-1.71,.27,-1.74,.27],["c",-.15,-.03,-.27,-.15,-.36,-.3],["l",-.06,-.15],["l",-.09,-7.53],["c",-.06,-4.14,-.09,-8.04,-.12,-8.67],["l",0,-1.11],["l",.15,-.06],["c",.09,-.03,.21,-.06,.27,-.09],["z"],["m",3.75,8.4],["c",0,-.33,0,-.42,-.03,-.42],["c",-.12,0,-2.79,.45,-2.79,.48],["c",-.03,0,-.09,6.3,-.09,6.33],["c",.03,0,2.79,-.45,2.82,-.48],["c",0,0,.09,-4.53,.09,-5.91],["z"]],w:5.4,h:22.8},"accidentals.flat":{d:[["M",-.36,-14.07],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.36,-.03,5.25],["c",-.06,2.85,-.09,5.19,-.09,5.19],["c",0,.03,.12,-.03,.24,-.12],["c",.63,-.42,1.41,-.66,2.19,-.72],["c",.81,-.03,1.47,.21,2.04,.78],["c",.57,.54,.87,1.26,.93,2.04],["c",.03,.57,-.09,1.08,-.36,1.62],["c",-.42,.81,-1.02,1.38,-2.82,2.61],["c",-1.14,.78,-1.44,1.02,-1.8,1.44],["c",-.18,.18,-.39,.39,-.45,.42],["c",-.27,.18,-.57,.15,-.81,-.06],["c",-.06,-.09,-.12,-.18,-.15,-.27],["c",-.03,-.06,-.09,-3.27,-.18,-8.34],["c",-.09,-4.53,-.15,-8.58,-.18,-9.03],["l",0,-.78],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",3.18,11.01],["c",-.21,-.12,-.54,-.15,-.81,-.06],["c",-.54,.15,-.99,.63,-1.17,1.26],["c",-.06,.3,-.12,2.88,-.06,3.87],["c",.03,.42,.03,.81,.06,.9],["l",.03,.12],["l",.45,-.39],["c",.63,-.54,1.26,-1.17,1.56,-1.59],["c",.3,-.42,.6,-.99,.72,-1.41],["c",.18,-.69,.09,-1.47,-.18,-2.07],["c",-.15,-.3,-.33,-.51,-.6,-.63],["z"]],w:6.75,h:18.801},"accidentals.halfflat":{d:[["M",4.83,-14.07],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.6,-.12,9.06],["c",-.09,5.55,-.15,9.06,-.18,9.12],["c",-.03,.09,-.09,.18,-.15,.27],["c",-.24,.21,-.54,.24,-.81,.06],["c",-.06,-.03,-.27,-.24,-.45,-.42],["c",-.36,-.42,-.66,-.66,-1.8,-1.44],["c",-1.23,-.84,-1.83,-1.32,-2.25,-1.77],["c",-.66,-.78,-.96,-1.56,-.93,-2.46],["c",.09,-1.41,1.11,-2.58,2.4,-2.79],["c",.3,-.06,.84,-.03,1.23,.06],["c",.54,.12,1.08,.33,1.53,.63],["c",.12,.09,.24,.15,.24,.12],["c",0,0,-.12,-8.37,-.18,-9.75],["l",0,-.66],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",-1.65,10.95],["c",-.6,-.18,-1.08,.09,-1.38,.69],["c",-.27,.6,-.36,1.38,-.18,2.07],["c",.12,.42,.42,.99,.72,1.41],["c",.3,.42,.93,1.05,1.56,1.59],["l",.48,.39],["l",0,-.12],["c",.03,-.09,.03,-.48,.06,-.9],["c",.03,-.57,.03,-1.08,0,-2.22],["c",-.03,-1.62,-.03,-1.62,-.24,-2.07],["c",-.21,-.42,-.6,-.75,-1.02,-.84],["z"]],w:6.728,h:18.801},"accidentals.dblflat":{d:[["M",-.36,-14.07],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.36,-.03,5.25],["c",-.06,2.85,-.09,5.19,-.09,5.19],["c",0,.03,.12,-.03,.24,-.12],["c",.63,-.42,1.41,-.66,2.19,-.72],["c",.81,-.03,1.47,.21,2.04,.78],["c",.57,.54,.87,1.26,.93,2.04],["c",.03,.57,-.09,1.08,-.36,1.62],["c",-.42,.81,-1.02,1.38,-2.82,2.61],["c",-1.14,.78,-1.44,1.02,-1.8,1.44],["c",-.18,.18,-.39,.39,-.45,.42],["c",-.27,.18,-.57,.15,-.81,-.06],["c",-.06,-.09,-.12,-.18,-.15,-.27],["c",-.03,-.06,-.09,-3.27,-.18,-8.34],["c",-.09,-4.53,-.15,-8.58,-.18,-9.03],["l",0,-.78],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",3.18,11.01],["c",-.21,-.12,-.54,-.15,-.81,-.06],["c",-.54,.15,-.99,.63,-1.17,1.26],["c",-.06,.3,-.12,2.88,-.06,3.87],["c",.03,.42,.03,.81,.06,.9],["l",.03,.12],["l",.45,-.39],["c",.63,-.54,1.26,-1.17,1.56,-1.59],["c",.3,-.42,.6,-.99,.72,-1.41],["c",.18,-.69,.09,-1.47,-.18,-2.07],["c",-.15,-.3,-.33,-.51,-.6,-.63],["z"],["m",3,-11],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.36,-.03,5.25],["c",-.06,2.85,-.09,5.19,-.09,5.19],["c",0,.03,.12,-.03,.24,-.12],["c",.63,-.42,1.41,-.66,2.19,-.72],["c",.81,-.03,1.47,.21,2.04,.78],["c",.57,.54,.87,1.26,.93,2.04],["c",.03,.57,-.09,1.08,-.36,1.62],["c",-.42,.81,-1.02,1.38,-2.82,2.61],["c",-1.14,.78,-1.44,1.02,-1.8,1.44],["c",-.18,.18,-.39,.39,-.45,.42],["c",-.27,.18,-.57,.15,-.81,-.06],["c",-.06,-.09,-.12,-.18,-.15,-.27],["c",-.03,-.06,-.09,-3.27,-.18,-8.34],["c",-.09,-4.53,-.15,-8.58,-.18,-9.03],["l",0,-.78],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",3.18,11.01],["c",-.21,-.12,-.54,-.15,-.81,-.06],["c",-.54,.15,-.99,.63,-1.17,1.26],["c",-.06,.3,-.12,2.88,-.06,3.87],["c",.03,.42,.03,.81,.06,.9],["l",.03,.12],["l",.45,-.39],["c",.63,-.54,1.26,-1.17,1.56,-1.59],["c",.3,-.42,.6,-.99,.72,-1.41],["c",.18,-.69,.09,-1.47,-.18,-2.07],["c",-.15,-.3,-.33,-.51,-.6,-.63],["z"]],w:12.1,h:18.804},"accidentals.dblsharp":{d:[["M",-.18,-3.96],["c",.06,-.03,.12,-.06,.15,-.06],["c",.09,0,2.76,.27,2.79,.3],["c",.12,.03,.15,.12,.15,.51],["c",.06,.96,.24,1.59,.57,2.1],["c",.06,.09,.15,.21,.18,.24],["l",.09,.06],["l",.09,-.06],["c",.03,-.03,.12,-.15,.18,-.24],["c",.33,-.51,.51,-1.14,.57,-2.1],["c",0,-.39,.03,-.45,.12,-.51],["c",.03,0,.66,-.09,1.44,-.15],["c",1.47,-.15,1.5,-.15,1.56,-.03],["c",.03,.06,0,.42,-.09,1.44],["c",-.09,.72,-.15,1.35,-.15,1.38],["c",0,.03,-.03,.09,-.06,.12],["c",-.06,.06,-.12,.09,-.51,.09],["c",-1.08,.06,-1.8,.3,-2.28,.75],["l",-.12,.09],["l",.09,.09],["c",.12,.15,.39,.33,.63,.45],["c",.42,.18,.96,.27,1.68,.33],["c",.39,0,.45,.03,.51,.09],["c",.03,.03,.06,.09,.06,.12],["c",0,.03,.06,.66,.15,1.38],["c",.09,1.02,.12,1.38,.09,1.44],["c",-.06,.12,-.09,.12,-1.56,-.03],["c",-.78,-.06,-1.41,-.15,-1.44,-.15],["c",-.09,-.06,-.12,-.12,-.12,-.54],["c",-.06,-.93,-.24,-1.56,-.57,-2.07],["c",-.06,-.09,-.15,-.21,-.18,-.24],["l",-.09,-.06],["l",-.09,.06],["c",-.03,.03,-.12,.15,-.18,.24],["c",-.33,.51,-.51,1.14,-.57,2.07],["c",0,.42,-.03,.48,-.12,.54],["c",-.03,0,-.66,.09,-1.44,.15],["c",-1.47,.15,-1.5,.15,-1.56,.03],["c",-.03,-.06,0,-.42,.09,-1.44],["c",.09,-.72,.15,-1.35,.15,-1.38],["c",0,-.03,.03,-.09,.06,-.12],["c",.06,-.06,.12,-.09,.51,-.09],["c",.72,-.06,1.26,-.15,1.68,-.33],["c",.24,-.12,.51,-.3,.63,-.45],["l",.09,-.09],["l",-.12,-.09],["c",-.48,-.45,-1.2,-.69,-2.28,-.75],["c",-.39,0,-.45,-.03,-.51,-.09],["c",-.03,-.03,-.06,-.09,-.06,-.12],["c",0,-.03,-.06,-.63,-.12,-1.38],["c",-.09,-.72,-.15,-1.35,-.15,-1.38],["z"]],w:7.95,h:7.977},"dots.dot":{d:[["M",1.32,-1.68],["c",.09,-.03,.27,-.06,.39,-.06],["c",.96,0,1.74,.78,1.74,1.71],["c",0,.96,-.78,1.74,-1.71,1.74],["c",-.96,0,-1.74,-.78,-1.74,-1.71],["c",0,-.78,.54,-1.5,1.32,-1.68],["z"]],w:3.45,h:3.45},"noteheads.dbl":{d:[["M",-.69,-4.02],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["c",.06,.15,.06,.18,.06,1.41],["l",0,1.23],["l",.12,-.18],["c",.72,-1.26,2.64,-2.31,4.86,-2.64],["c",.81,-.15,1.11,-.15,2.13,-.15],["c",.99,0,1.29,0,2.1,.15],["c",.75,.12,1.38,.27,2.04,.54],["c",1.35,.51,2.34,1.26,2.82,2.1],["l",.12,.18],["l",0,-1.23],["c",0,-1.2,0,-1.26,.06,-1.38],["c",.09,-.18,.15,-.24,.33,-.33],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["l",.06,.15],["l",0,3.54],["l",0,3.54],["l",-.06,.15],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.18,.09,-.36,.09,-.54,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.06,-.12,-.06,-.18,-.06,-1.38],["l",0,-1.23],["l",-.12,.18],["c",-.48,.84,-1.47,1.59,-2.82,2.1],["c",-.84,.33,-1.71,.54,-2.85,.66],["c",-.45,.06,-2.16,.06,-2.61,0],["c",-1.14,-.12,-2.01,-.33,-2.85,-.66],["c",-1.35,-.51,-2.34,-1.26,-2.82,-2.1],["l",-.12,-.18],["l",0,1.23],["c",0,1.23,0,1.26,-.06,1.38],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.18,.09,-.36,.09,-.54,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["l",-.06,-.15],["l",0,-3.54],["c",0,-3.48,0,-3.54,.06,-3.66],["c",.09,-.18,.15,-.24,.33,-.33],["z"],["m",7.71,.63],["c",-.36,-.06,-.9,-.06,-1.14,0],["c",-.3,.03,-.66,.24,-.87,.42],["c",-.6,.54,-.9,1.62,-.75,2.82],["c",.12,.93,.51,1.68,1.11,2.31],["c",.75,.72,1.83,1.2,2.85,1.26],["c",1.05,.06,1.83,-.54,2.1,-1.65],["c",.21,-.9,.12,-1.95,-.24,-2.82],["c",-.36,-.81,-1.08,-1.53,-1.95,-1.95],["c",-.3,-.15,-.78,-.3,-1.11,-.39],["z"]],w:16.83,h:8.145},"noteheads.whole":{d:[["M",6.51,-4.05],["c",.51,-.03,2.01,0,2.52,.03],["c",1.41,.18,2.64,.51,3.72,1.08],["c",1.2,.63,1.95,1.41,2.19,2.31],["c",.09,.33,.09,.9,0,1.23],["c",-.24,.9,-.99,1.68,-2.19,2.31],["c",-1.08,.57,-2.28,.9,-3.75,1.08],["c",-.66,.06,-2.31,.06,-2.97,0],["c",-1.47,-.18,-2.67,-.51,-3.75,-1.08],["c",-1.2,-.63,-1.95,-1.41,-2.19,-2.31],["c",-.09,-.33,-.09,-.9,0,-1.23],["c",.24,-.9,.99,-1.68,2.19,-2.31],["c",1.2,-.63,2.61,-.99,4.23,-1.11],["z"],["m",.57,.66],["c",-.87,-.15,-1.53,0,-2.04,.51],["c",-.15,.15,-.24,.27,-.33,.48],["c",-.24,.51,-.36,1.08,-.33,1.77],["c",.03,.69,.18,1.26,.42,1.77],["c",.6,1.17,1.74,1.98,3.18,2.22],["c",1.11,.21,1.95,-.15,2.34,-.99],["c",.24,-.51,.36,-1.08,.33,-1.8],["c",-.06,-1.11,-.45,-2.04,-1.17,-2.76],["c",-.63,-.63,-1.47,-1.05,-2.4,-1.2],["z"]],w:14.985,h:8.097},"noteheads.half":{d:[["M",7.44,-4.05],["c",.06,-.03,.27,-.03,.48,-.03],["c",1.05,0,1.71,.24,2.1,.81],["c",.42,.6,.45,1.35,.18,2.4],["c",-.42,1.59,-1.14,2.73,-2.16,3.39],["c",-1.41,.93,-3.18,1.44,-5.4,1.53],["c",-1.17,.03,-1.89,-.21,-2.28,-.81],["c",-.42,-.6,-.45,-1.35,-.18,-2.4],["c",.42,-1.59,1.14,-2.73,2.16,-3.39],["c",.63,-.42,1.23,-.72,1.98,-.96],["c",.9,-.3,1.65,-.42,3.12,-.54],["z"],["m",1.29,.87],["c",-.27,-.09,-.63,-.12,-.9,-.03],["c",-.72,.24,-1.53,.69,-3.27,1.8],["c",-2.34,1.5,-3.3,2.25,-3.57,2.79],["c",-.36,.72,-.06,1.5,.66,1.77],["c",.24,.12,.69,.09,.99,0],["c",.84,-.3,1.92,-.93,4.14,-2.37],["c",1.62,-1.08,2.37,-1.71,2.61,-2.19],["c",.36,-.72,.06,-1.5,-.66,-1.77],["z"]],w:10.37,h:8.132},"noteheads.quarter":{d:[["M",6.09,-4.05],["c",.36,-.03,1.2,0,1.53,.06],["c",1.17,.24,1.89,.84,2.16,1.83],["c",.06,.18,.06,.3,.06,.66],["c",0,.45,0,.63,-.15,1.08],["c",-.66,2.04,-3.06,3.93,-5.52,4.38],["c",-.54,.09,-1.44,.09,-1.83,.03],["c",-1.23,-.27,-1.98,-.87,-2.25,-1.86],["c",-.06,-.18,-.06,-.3,-.06,-.66],["c",0,-.45,0,-.63,.15,-1.08],["c",.24,-.78,.75,-1.53,1.44,-2.22],["c",1.2,-1.2,2.85,-2.01,4.47,-2.22],["z"]],w:9.81,h:8.094},"noteheads.slash.nostem":{d:[["M",9.3,-7.77],["c",.06,-.06,.18,-.06,1.71,-.06],["l",1.65,0],["l",.09,.09],["c",.06,.06,.06,.09,.06,.15],["c",-.03,.12,-9.21,15.24,-9.3,15.33],["c",-.06,.06,-.18,.06,-1.71,.06],["l",-1.65,0],["l",-.09,-.09],["c",-.06,-.06,-.06,-.09,-.06,-.15],["c",.03,-.12,9.21,-15.24,9.3,-15.33],["z"]],w:12.81,h:15.63},"noteheads.indeterminate":{d:[["M",.78,-4.05],["c",.12,-.03,.24,-.03,.36,.03],["c",.03,.03,.93,.72,1.95,1.56],["l",1.86,1.5],["l",1.86,-1.5],["c",1.02,-.84,1.92,-1.53,1.95,-1.56],["c",.21,-.12,.33,-.09,.75,.24],["c",.3,.27,.36,.36,.36,.54],["c",0,.03,-.03,.12,-.06,.18],["c",-.03,.06,-.9,.75,-1.89,1.56],["l",-1.8,1.47],["c",0,.03,.81,.69,1.8,1.5],["c",.99,.81,1.86,1.5,1.89,1.56],["c",.03,.06,.06,.15,.06,.18],["c",0,.18,-.06,.27,-.36,.54],["c",-.42,.33,-.54,.36,-.75,.24],["c",-.03,-.03,-.93,-.72,-1.95,-1.56],["l",-1.86,-1.5],["l",-1.86,1.5],["c",-1.02,.84,-1.92,1.53,-1.95,1.56],["c",-.21,.12,-.33,.09,-.75,-.24],["c",-.3,-.27,-.36,-.36,-.36,-.54],["c",0,-.03,.03,-.12,.06,-.18],["c",.03,-.06,.9,-.75,1.89,-1.56],["l",1.8,-1.47],["c",0,-.03,-.81,-.69,-1.8,-1.5],["c",-.99,-.81,-1.86,-1.5,-1.89,-1.56],["c",-.06,-.12,-.09,-.21,-.03,-.36],["c",.03,-.09,.57,-.57,.72,-.63],["z"]],w:9.843,h:8.139},"scripts.ufermata":{d:[["M",-.75,-10.77],["c",.12,0,.45,-.03,.69,-.03],["c",2.91,-.03,5.55,1.53,7.41,4.35],["c",1.17,1.71,1.95,3.72,2.43,6.03],["c",.12,.51,.12,.57,.03,.69],["c",-.12,.21,-.48,.27,-.69,.12],["c",-.12,-.09,-.18,-.24,-.27,-.69],["c",-.78,-3.63,-3.42,-6.54,-6.78,-7.38],["c",-.78,-.21,-1.2,-.24,-2.07,-.24],["c",-.63,0,-.84,0,-1.2,.06],["c",-1.83,.27,-3.42,1.08,-4.8,2.37],["c",-1.41,1.35,-2.4,3.21,-2.85,5.19],["c",-.09,.45,-.15,.6,-.27,.69],["c",-.21,.15,-.57,.09,-.69,-.12],["c",-.09,-.12,-.09,-.18,.03,-.69],["c",.33,-1.62,.78,-3,1.47,-4.38],["c",1.77,-3.54,4.44,-5.67,7.56,-5.97],["z"],["m",.33,7.47],["c",1.38,-.3,2.58,.9,2.31,2.25],["c",-.15,.72,-.78,1.35,-1.47,1.5],["c",-1.38,.27,-2.58,-.93,-2.31,-2.31],["c",.15,-.69,.78,-1.29,1.47,-1.44],["z"]],w:19.748,h:11.289},"scripts.dfermata":{d:[["M",-9.63,-.42],["c",.15,-.09,.36,-.06,.51,.03],["c",.12,.09,.18,.24,.27,.66],["c",.78,3.66,3.42,6.57,6.78,7.41],["c",.78,.21,1.2,.24,2.07,.24],["c",.63,0,.84,0,1.2,-.06],["c",1.83,-.27,3.42,-1.08,4.8,-2.37],["c",1.41,-1.35,2.4,-3.21,2.85,-5.22],["c",.09,-.42,.15,-.57,.27,-.66],["c",.21,-.15,.57,-.09,.69,.12],["c",.09,.12,.09,.18,-.03,.69],["c",-.33,1.62,-.78,3,-1.47,4.38],["c",-1.92,3.84,-4.89,6,-8.31,6],["c",-3.42,0,-6.39,-2.16,-8.31,-6],["c",-.48,-.96,-.84,-1.92,-1.14,-2.97],["c",-.18,-.69,-.42,-1.74,-.42,-1.92],["c",0,-.12,.09,-.27,.24,-.33],["z"],["m",9.21,0],["c",1.2,-.27,2.34,.63,2.34,1.86],["c",0,.9,-.66,1.68,-1.5,1.89],["c",-1.38,.27,-2.58,-.93,-2.31,-2.31],["c",.15,-.69,.78,-1.29,1.47,-1.44],["z"]],w:19.744,h:11.274},"scripts.sforzato":{d:[["M",-6.45,-3.69],["c",.06,-.03,.15,-.06,.18,-.06],["c",.06,0,2.85,.72,6.24,1.59],["l",6.33,1.65],["c",.33,.06,.45,.21,.45,.51],["c",0,.3,-.12,.45,-.45,.51],["l",-6.33,1.65],["c",-3.39,.87,-6.18,1.59,-6.21,1.59],["c",-.21,0,-.48,-.24,-.51,-.45],["c",0,-.15,.06,-.36,.18,-.45],["c",.09,-.06,.87,-.27,3.84,-1.05],["c",2.04,-.54,3.84,-.99,4.02,-1.02],["c",.15,-.06,1.14,-.24,2.22,-.42],["c",1.05,-.18,1.92,-.36,1.92,-.36],["c",0,0,-.87,-.18,-1.92,-.36],["c",-1.08,-.18,-2.07,-.36,-2.22,-.42],["c",-.18,-.03,-1.98,-.48,-4.02,-1.02],["c",-2.97,-.78,-3.75,-.99,-3.84,-1.05],["c",-.12,-.09,-.18,-.3,-.18,-.45],["c",.03,-.15,.15,-.3,.3,-.39],["z"]],w:13.5,h:7.5},"scripts.staccato":{d:[["M",-.36,-1.47],["c",.93,-.21,1.86,.51,1.86,1.47],["c",0,.93,-.87,1.65,-1.8,1.47],["c",-.54,-.12,-1.02,-.57,-1.14,-1.08],["c",-.21,-.81,.27,-1.65,1.08,-1.86],["z"]],w:2.989,h:3.004},"scripts.tenuto":{d:[["M",-4.2,-.48],["l",.12,-.06],["l",4.08,0],["l",4.08,0],["l",.12,.06],["c",.39,.21,.39,.75,0,.96],["l",-.12,.06],["l",-4.08,0],["l",-4.08,0],["l",-.12,-.06],["c",-.39,-.21,-.39,-.75,0,-.96],["z"]],w:8.985,h:1.08},"scripts.umarcato":{d:[["M",-.15,-8.19],["c",.15,-.12,.36,-.03,.45,.15],["c",.21,.42,3.45,7.65,3.45,7.71],["c",0,.12,-.12,.27,-.21,.3],["c",-.03,.03,-.51,.03,-1.14,.03],["c",-1.05,0,-1.08,0,-1.17,-.06],["c",-.09,-.06,-.24,-.36,-1.17,-2.4],["c",-.57,-1.29,-1.05,-2.34,-1.08,-2.34],["c",0,-.03,-.51,1.02,-1.08,2.34],["c",-.93,2.07,-1.08,2.34,-1.14,2.4],["c",-.06,.03,-.15,.06,-.18,.06],["c",-.15,0,-.33,-.18,-.33,-.33],["c",0,-.06,3.24,-7.32,3.45,-7.71],["c",.03,-.06,.09,-.15,.15,-.15],["z"]],w:7.5,h:8.245},"scripts.dmarcato":{d:[["M",-3.57,.03],["c",.03,0,.57,-.03,1.17,-.03],["c",1.05,0,1.08,0,1.17,.06],["c",.09,.06,.24,.36,1.17,2.4],["c",.57,1.29,1.05,2.34,1.08,2.34],["c",0,.03,.51,-1.02,1.08,-2.34],["c",.93,-2.07,1.08,-2.34,1.14,-2.4],["c",.06,-.03,.15,-.06,.18,-.06],["c",.15,0,.33,.18,.33,.33],["c",0,.09,-3.45,7.74,-3.54,7.83],["c",-.12,.12,-.3,.12,-.42,0],["c",-.09,-.09,-3.54,-7.74,-3.54,-7.83],["c",0,-.09,.12,-.27,.18,-.3],["z"]],w:7.5,h:8.25},"scripts.stopped":{d:[["M",-.27,-4.08],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["l",.06,.15],["l",0,1.5],["l",0,1.47],["l",1.47,0],["l",1.5,0],["l",.15,.06],["c",.15,.09,.21,.15,.3,.33],["c",.09,.18,.09,.36,0,.54],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.12,.06,-.18,.06,-1.62,.06],["l",-1.47,0],["l",0,1.47],["l",0,1.47],["l",-.06,.15],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.18,.09,-.36,.09,-.54,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["l",-.06,-.15],["l",0,-1.47],["l",0,-1.47],["l",-1.47,0],["c",-1.44,0,-1.5,0,-1.62,-.06],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.09,-.18,-.09,-.36,0,-.54],["c",.09,-.18,.15,-.24,.33,-.33],["l",.15,-.06],["l",1.47,0],["l",1.47,0],["l",0,-1.47],["c",0,-1.44,0,-1.5,.06,-1.62],["c",.09,-.18,.15,-.24,.33,-.33],["z"]],w:8.295,h:8.295},"scripts.upbow":{d:[["M",-4.65,-15.54],["c",.12,-.09,.36,-.06,.48,.03],["c",.03,.03,.09,.09,.12,.15],["c",.03,.06,.66,2.13,1.41,4.62],["c",1.35,4.41,1.38,4.56,2.01,6.96],["l",.63,2.46],["l",.63,-2.46],["c",.63,-2.4,.66,-2.55,2.01,-6.96],["c",.75,-2.49,1.38,-4.56,1.41,-4.62],["c",.06,-.15,.18,-.21,.36,-.24],["c",.15,0,.3,.06,.39,.18],["c",.15,.21,.24,-.18,-2.1,7.56],["c",-1.2,3.96,-2.22,7.32,-2.25,7.41],["c",0,.12,-.06,.27,-.09,.3],["c",-.12,.21,-.6,.21,-.72,0],["c",-.03,-.03,-.09,-.18,-.09,-.3],["c",-.03,-.09,-1.05,-3.45,-2.25,-7.41],["c",-2.34,-7.74,-2.25,-7.35,-2.1,-7.56],["c",.03,-.03,.09,-.09,.15,-.12],["z"]],w:9.73,h:15.608},"scripts.downbow":{d:[["M",-5.55,-9.93],["l",.09,-.06],["l",5.46,0],["l",5.46,0],["l",.09,.06],["l",.06,.09],["l",0,4.77],["c",0,5.28,0,4.89,-.18,5.01],["c",-.18,.12,-.42,.06,-.54,-.12],["c",-.06,-.09,-.06,-.18,-.06,-2.97],["l",0,-2.85],["l",-4.83,0],["l",-4.83,0],["l",0,2.85],["c",0,2.79,0,2.88,-.06,2.97],["c",-.15,.24,-.51,.24,-.66,0],["c",-.06,-.09,-.06,-.21,-.06,-4.89],["l",0,-4.77],["z"]],w:11.22,h:9.992},"scripts.turn":{d:[["M",-4.77,-3.9],["c",.36,-.06,1.05,-.06,1.44,.03],["c",.78,.15,1.5,.51,2.34,1.14],["c",.6,.45,1.05,.87,2.22,2.01],["c",1.11,1.08,1.62,1.5,2.22,1.86],["c",.6,.36,1.32,.57,1.92,.57],["c",.9,0,1.71,-.57,1.89,-1.35],["c",.24,-.93,-.39,-1.89,-1.35,-2.1],["l",-.15,-.06],["l",-.09,.15],["c",-.03,.09,-.15,.24,-.24,.33],["c",-.72,.72,-2.04,.54,-2.49,-.36],["c",-.48,-.93,.03,-1.86,1.17,-2.19],["c",.3,-.09,1.02,-.09,1.35,0],["c",.99,.27,1.74,.87,2.25,1.83],["c",.69,1.41,.63,3,-.21,4.26],["c",-.21,.3,-.69,.81,-.99,1.02],["c",-.3,.21,-.84,.45,-1.17,.54],["c",-1.23,.36,-2.49,.15,-3.72,-.6],["c",-.75,-.48,-1.41,-1.02,-2.85,-2.46],["c",-1.11,-1.08,-1.62,-1.5,-2.22,-1.86],["c",-.6,-.36,-1.32,-.57,-1.92,-.57],["c",-.9,0,-1.71,.57,-1.89,1.35],["c",-.24,.93,.39,1.89,1.35,2.1],["l",.15,.06],["l",.09,-.15],["c",.03,-.09,.15,-.24,.24,-.33],["c",.72,-.72,2.04,-.54,2.49,.36],["c",.48,.93,-.03,1.86,-1.17,2.19],["c",-.3,.09,-1.02,.09,-1.35,0],["c",-.99,-.27,-1.74,-.87,-2.25,-1.83],["c",-.69,-1.41,-.63,-3,.21,-4.26],["c",.21,-.3,.69,-.81,.99,-1.02],["c",.48,-.33,1.11,-.57,1.74,-.66],["z"]],w:16.366,h:7.893},"scripts.trill":{d:[["M",-.51,-16.02],["c",.12,-.09,.21,-.18,.21,-.18],["l",-.81,4.02],["l",-.81,4.02],["c",.03,0,.51,-.27,1.08,-.6],["c",.6,-.3,1.14,-.63,1.26,-.66],["c",1.14,-.54,2.31,-.6,3.09,-.18],["c",.27,.15,.54,.36,.6,.51],["l",.06,.12],["l",.21,-.21],["c",.9,-.81,2.22,-.99,3.12,-.42],["c",.6,.42,.9,1.14,.78,2.07],["c",-.15,1.29,-1.05,2.31,-1.95,2.25],["c",-.48,-.03,-.78,-.3,-.96,-.81],["c",-.09,-.27,-.09,-.9,-.03,-1.2],["c",.21,-.75,.81,-1.23,1.59,-1.32],["l",.24,-.03],["l",-.09,-.12],["c",-.51,-.66,-1.62,-.63,-2.31,.03],["c",-.39,.42,-.3,.09,-1.23,4.77],["l",-.81,4.14],["c",-.03,0,-.12,-.03,-.21,-.09],["c",-.33,-.15,-.54,-.18,-.99,-.18],["c",-.42,0,-.66,.03,-1.05,.18],["c",-.12,.06,-.21,.09,-.21,.09],["c",0,-.03,.36,-1.86,.81,-4.11],["c",.9,-4.47,.87,-4.26,.69,-4.53],["c",-.21,-.36,-.66,-.51,-1.17,-.36],["c",-.15,.06,-2.22,1.14,-2.58,1.38],["c",-.12,.09,-.12,.09,-.21,.6],["l",-.09,.51],["l",.21,.24],["c",.63,.75,1.02,1.47,1.2,2.19],["c",.06,.27,.06,.36,.06,.81],["c",0,.42,0,.54,-.06,.78],["c",-.15,.54,-.33,.93,-.63,1.35],["c",-.18,.24,-.57,.63,-.81,.78],["c",-.24,.15,-.63,.36,-.84,.42],["c",-.27,.06,-.66,.06,-.87,.03],["c",-.81,-.18,-1.32,-1.05,-1.38,-2.46],["c",-.03,-.6,.03,-.99,.33,-2.46],["c",.21,-1.08,.24,-1.32,.21,-1.29],["c",-1.2,.48,-2.4,.75,-3.21,.72],["c",-.69,-.06,-1.17,-.3,-1.41,-.72],["c",-.39,-.75,-.12,-1.8,.66,-2.46],["c",.24,-.18,.69,-.42,1.02,-.51],["c",.69,-.18,1.53,-.15,2.31,.09],["c",.3,.09,.75,.3,.99,.45],["c",.12,.09,.15,.09,.15,.03],["c",.03,-.03,.33,-1.59,.72,-3.45],["c",.36,-1.86,.66,-3.42,.69,-3.45],["c",0,-.03,.03,-.03,.21,.03],["c",.21,.06,.27,.06,.48,.06],["c",.42,-.03,.78,-.18,1.26,-.48],["c",.15,-.12,.36,-.27,.48,-.39],["z"],["m",-5.73,7.68],["c",-.27,-.03,-.96,-.06,-1.2,-.03],["c",-.81,.12,-1.35,.57,-1.5,1.2],["c",-.18,.66,.12,1.14,.75,1.29],["c",.66,.12,1.92,-.12,3.18,-.66],["l",.33,-.15],["l",.09,-.39],["c",.06,-.21,.09,-.42,.09,-.45],["c",0,-.03,-.45,-.3,-.75,-.45],["c",-.27,-.15,-.66,-.27,-.99,-.36],["z"],["m",4.29,3.63],["c",-.24,-.39,-.51,-.75,-.51,-.69],["c",-.06,.12,-.39,1.92,-.45,2.28],["c",-.09,.54,-.12,1.14,-.06,1.38],["c",.06,.42,.21,.6,.51,.57],["c",.39,-.06,.75,-.48,.93,-1.14],["c",.09,-.33,.09,-1.05,0,-1.38],["c",-.09,-.39,-.24,-.69,-.42,-1.02],["z"]],w:17.963,h:16.49},"scripts.segno":{d:[["M",-3.72,-11.22],["c",.78,-.09,1.59,.03,2.31,.42],["c",1.2,.6,2.01,1.71,2.31,3.09],["c",.09,.42,.09,1.2,.03,1.5],["c",-.15,.45,-.39,.81,-.66,.93],["c",-.33,.18,-.84,.21,-1.23,.15],["c",-.81,-.18,-1.32,-.93,-1.26,-1.89],["c",.03,-.36,.09,-.57,.24,-.9],["c",.15,-.33,.45,-.6,.72,-.75],["c",.12,-.06,.18,-.09,.18,-.12],["c",0,-.03,-.03,-.15,-.09,-.24],["c",-.18,-.45,-.54,-.87,-.96,-1.08],["c",-1.11,-.57,-2.34,-.18,-2.88,.9],["c",-.24,.51,-.33,1.11,-.24,1.83],["c",.27,1.92,1.5,3.54,3.93,5.13],["c",.48,.33,1.26,.78,1.29,.78],["c",.03,0,1.35,-2.19,2.94,-4.89],["l",2.88,-4.89],["l",.84,0],["l",.87,0],["l",-.03,.06],["c",-.15,.21,-6.15,10.41,-6.15,10.44],["c",0,0,.21,.15,.48,.27],["c",2.61,1.47,4.35,3.03,5.13,4.65],["c",1.14,2.34,.51,5.07,-1.44,6.39],["c",-.66,.42,-1.32,.63,-2.13,.69],["c",-2.01,.09,-3.81,-1.41,-4.26,-3.54],["c",-.09,-.42,-.09,-1.2,-.03,-1.5],["c",.15,-.45,.39,-.81,.66,-.93],["c",.33,-.18,.84,-.21,1.23,-.15],["c",.81,.18,1.32,.93,1.26,1.89],["c",-.03,.36,-.09,.57,-.24,.9],["c",-.15,.33,-.45,.6,-.72,.75],["c",-.12,.06,-.18,.09,-.18,.12],["c",0,.03,.03,.15,.09,.24],["c",.18,.45,.54,.87,.96,1.08],["c",1.11,.57,2.34,.18,2.88,-.9],["c",.24,-.51,.33,-1.11,.24,-1.83],["c",-.27,-1.92,-1.5,-3.54,-3.93,-5.13],["c",-.48,-.33,-1.26,-.78,-1.29,-.78],["c",-.03,0,-1.35,2.19,-2.91,4.89],["l",-2.88,4.89],["l",-.87,0],["l",-.87,0],["l",.03,-.06],["c",.15,-.21,6.15,-10.41,6.15,-10.44],["c",0,0,-.21,-.15,-.48,-.3],["c",-2.61,-1.44,-4.35,-3,-5.13,-4.62],["c",-.9,-1.89,-.72,-4.02,.48,-5.52],["c",.69,-.84,1.68,-1.41,2.73,-1.53],["z"],["m",8.76,9.09],["c",.03,-.03,.15,-.03,.27,-.03],["c",.33,.03,.57,.18,.72,.48],["c",.09,.18,.09,.57,0,.75],["c",-.09,.18,-.21,.3,-.36,.39],["c",-.15,.06,-.21,.06,-.39,.06],["c",-.21,0,-.27,0,-.39,-.06],["c",-.3,-.15,-.48,-.45,-.48,-.75],["c",0,-.39,.24,-.72,.63,-.84],["z"],["m",-10.53,2.61],["c",.03,-.03,.15,-.03,.27,-.03],["c",.33,.03,.57,.18,.72,.48],["c",.09,.18,.09,.57,0,.75],["c",-.09,.18,-.21,.3,-.36,.39],["c",-.15,.06,-.21,.06,-.39,.06],["c",-.21,0,-.27,0,-.39,-.06],["c",-.3,-.15,-.48,-.45,-.48,-.75],["c",0,-.39,.24,-.72,.63,-.84],["z"]],w:15,h:22.504},"scripts.coda":{d:[["M",-.21,-10.47],["c",.18,-.12,.42,-.06,.54,.12],["c",.06,.09,.06,.18,.06,1.5],["l",0,1.38],["l",.18,0],["c",.39,.06,.96,.24,1.38,.48],["c",1.68,.93,2.82,3.24,3.03,6.12],["c",.03,.24,.03,.45,.03,.45],["c",0,.03,.6,.03,1.35,.03],["c",1.5,0,1.47,0,1.59,.18],["c",.09,.12,.09,.3,0,.42],["c",-.12,.18,-.09,.18,-1.59,.18],["c",-.75,0,-1.35,0,-1.35,.03],["c",0,0,0,.21,-.03,.42],["c",-.24,3.15,-1.53,5.58,-3.45,6.36],["c",-.27,.12,-.72,.24,-.96,.27],["l",-.18,0],["l",0,1.38],["c",0,1.32,0,1.41,-.06,1.5],["c",-.15,.24,-.51,.24,-.66,0],["c",-.06,-.09,-.06,-.18,-.06,-1.5],["l",0,-1.38],["l",-.18,0],["c",-.39,-.06,-.96,-.24,-1.38,-.48],["c",-1.68,-.93,-2.82,-3.24,-3.03,-6.15],["c",-.03,-.21,-.03,-.42,-.03,-.42],["c",0,-.03,-.6,-.03,-1.35,-.03],["c",-1.5,0,-1.47,0,-1.59,-.18],["c",-.09,-.12,-.09,-.3,0,-.42],["c",.12,-.18,.09,-.18,1.59,-.18],["c",.75,0,1.35,0,1.35,-.03],["c",0,0,0,-.21,.03,-.45],["c",.24,-3.12,1.53,-5.55,3.45,-6.33],["c",.27,-.12,.72,-.24,.96,-.27],["l",.18,0],["l",0,-1.38],["c",0,-1.53,0,-1.5,.18,-1.62],["z"],["m",-.18,6.93],["c",0,-2.97,0,-3.15,-.06,-3.15],["c",-.09,0,-.51,.15,-.66,.21],["c",-.87,.51,-1.38,1.62,-1.56,3.51],["c",-.06,.54,-.12,1.59,-.12,2.16],["l",0,.42],["l",1.2,0],["l",1.2,0],["l",0,-3.15],["z"],["m",1.17,-3.06],["c",-.09,-.03,-.21,-.06,-.27,-.09],["l",-.12,0],["l",0,3.15],["l",0,3.15],["l",1.2,0],["l",1.2,0],["l",0,-.81],["c",-.06,-2.4,-.33,-3.69,-.93,-4.59],["c",-.27,-.39,-.66,-.69,-1.08,-.81],["z"],["m",-1.17,10.14],["l",0,-3.15],["l",-1.2,0],["l",-1.2,0],["l",0,.81],["c",.03,.96,.06,1.47,.15,2.13],["c",.24,2.04,.96,3.12,2.13,3.36],["l",.12,0],["l",0,-3.15],["z"],["m",3.18,-2.34],["l",0,-.81],["l",-1.2,0],["l",-1.2,0],["l",0,3.15],["l",0,3.15],["l",.12,0],["c",1.17,-.24,1.89,-1.32,2.13,-3.36],["c",.09,-.66,.12,-1.17,.15,-2.13],["z"]],w:16.035,h:21.062},"scripts.comma":{d:[["M",1.14,-4.62],["c",.3,-.12,.69,-.03,.93,.15],["c",.12,.12,.36,.45,.51,.78],["c",.9,1.77,.54,4.05,-1.08,6.75],["c",-.36,.63,-.87,1.38,-.96,1.44],["c",-.18,.12,-.42,.06,-.54,-.12],["c",-.09,-.18,-.09,-.3,.12,-.6],["c",.96,-1.44,1.44,-2.97,1.38,-4.35],["c",-.06,-.93,-.3,-1.68,-.78,-2.46],["c",-.27,-.39,-.33,-.63,-.24,-.96],["c",.09,-.27,.36,-.54,.66,-.63],["z"]],w:3.042,h:9.237},"scripts.roll":{d:[["M",1.95,-6],["c",.21,-.09,.36,-.09,.57,0],["c",.39,.15,.63,.39,1.47,1.35],["c",.66,.75,.78,.87,1.08,1.05],["c",.75,.45,1.65,.42,2.4,-.06],["c",.12,-.09,.27,-.27,.54,-.6],["c",.42,-.54,.51,-.63,.69,-.63],["c",.09,0,.3,.12,.36,.21],["c",.09,.12,.12,.3,.03,.42],["c",-.06,.12,-3.15,3.9,-3.3,4.08],["c",-.06,.06,-.18,.12,-.27,.18],["c",-.27,.12,-.6,.06,-.99,-.27],["c",-.27,-.21,-.42,-.39,-1.08,-1.14],["c",-.63,-.72,-.81,-.9,-1.17,-1.08],["c",-.36,-.18,-.57,-.21,-.99,-.21],["c",-.39,0,-.63,.03,-.93,.18],["c",-.36,.15,-.51,.27,-.9,.81],["c",-.24,.27,-.45,.51,-.48,.54],["c",-.12,.09,-.27,.06,-.39,0],["c",-.24,-.15,-.33,-.39,-.21,-.6],["c",.09,-.12,3.18,-3.87,3.33,-4.02],["c",.06,-.06,.18,-.15,.24,-.21],["z"]],w:10.817,h:6.125},"scripts.prall":{d:[["M",-4.38,-3.69],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["c",.03,0,.57,-.84,1.23,-1.83],["c",1.14,-1.68,1.23,-1.83,1.35,-1.89],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["l",.48,-.69],["c",.51,-.78,.54,-.84,.69,-.9],["c",.42,-.18,.87,.15,.81,.6],["c",-.03,.12,-.3,.51,-1.5,2.37],["c",-1.38,2.07,-1.5,2.22,-1.62,2.28],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.89,-1.95],["l",-1.53,-1.83],["c",-.03,0,-.57,.84,-1.23,1.83],["c",-1.14,1.68,-1.23,1.83,-1.35,1.89],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.89,-1.95],["l",-1.53,-1.83],["l",-.48,.69],["c",-.51,.78,-.54,.84,-.69,.9],["c",-.42,.18,-.87,-.15,-.81,-.6],["c",.03,-.12,.3,-.51,1.5,-2.37],["c",1.38,-2.07,1.5,-2.22,1.62,-2.28],["z"]],w:15.011,h:7.5},"scripts.arpeggio":{d:[["M",1.5,0],["c",1.5,2,1.5,3,1.5,3],["s",0,1,-2,1.5],["s",-.5,3,1,5.5],["l",1.5,0],["s",-1.75,-2,-1.9,-3.25],["s",2.15,-.6,2.95,-1.6],["s",.45,-1,.5,-1.25],["s",0,-1,-2,-3.9],["l",-1.5,0],["z"]],w:5,h:10},"scripts.mordent":{d:[["M",-.21,-4.95],["c",.27,-.15,.63,0,.75,.27],["c",.06,.12,.06,.24,.06,1.44],["l",0,1.29],["l",.57,-.84],["c",.51,-.75,.57,-.84,.69,-.9],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["l",.48,-.69],["c",.51,-.78,.54,-.84,.69,-.9],["c",.42,-.18,.87,.15,.81,.6],["c",-.03,.12,-.3,.51,-1.5,2.37],["c",-1.38,2.07,-1.5,2.22,-1.62,2.28],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.83,-1.89],["c",-.81,-.99,-1.5,-1.8,-1.53,-1.86],["c",-.06,-.03,-.06,-.03,-.12,.03],["c",-.06,.06,-.06,.15,-.06,2.28],["c",0,1.95,0,2.25,-.06,2.34],["c",-.18,.45,-.81,.48,-1.05,.03],["c",-.03,-.06,-.06,-.24,-.06,-1.41],["l",0,-1.35],["l",-.57,.84],["c",-.54,.78,-.6,.87,-.72,.93],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.89,-1.95],["l",-1.53,-1.83],["l",-.48,.69],["c",-.51,.78,-.54,.84,-.69,.9],["c",-.42,.18,-.87,-.15,-.81,-.6],["c",.03,-.12,.3,-.51,1.5,-2.37],["c",1.38,-2.07,1.5,-2.22,1.62,-2.28],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["c",.03,0,.06,-.06,.09,-.09],["c",.06,-.12,.06,-.15,.06,-2.28],["c",0,-1.92,0,-2.22,.06,-2.31],["c",.06,-.15,.15,-.24,.3,-.3],["z"]],w:15.011,h:10.012},"flags.u8th":{d:[["M",-.42,3.75],["l",0,-3.75],["l",.21,0],["l",.21,0],["l",0,.18],["c",0,.3,.06,.84,.12,1.23],["c",.24,1.53,.9,3.12,2.13,5.16],["l",.99,1.59],["c",.87,1.44,1.38,2.34,1.77,3.09],["c",.81,1.68,1.2,3.06,1.26,4.53],["c",.03,1.53,-.21,3.27,-.75,5.01],["c",-.21,.69,-.51,1.5,-.6,1.59],["c",-.09,.12,-.27,.21,-.42,.21],["c",-.15,0,-.42,-.12,-.51,-.21],["c",-.15,-.18,-.18,-.42,-.09,-.66],["c",.15,-.33,.45,-1.2,.57,-1.62],["c",.42,-1.38,.6,-2.58,.6,-3.9],["c",0,-.66,0,-.81,-.06,-1.11],["c",-.39,-2.07,-1.8,-4.26,-4.59,-7.14],["l",-.42,-.45],["l",-.21,0],["l",-.21,0],["l",0,-3.75],["z"]],w:6.692,h:22.59},"flags.u16th":{d:[["M",-.42,7.5],["l",0,-7.5],["l",.21,0],["l",.21,0],["l",0,.39],["c",.06,1.08,.39,2.19,.99,3.39],["c",.45,.9,.87,1.59,1.95,3.12],["c",1.29,1.86,1.77,2.64,2.22,3.57],["c",.45,.93,.72,1.8,.87,2.64],["c",.06,.51,.06,1.5,0,1.92],["c",-.12,.6,-.3,1.2,-.54,1.71],["l",-.09,.24],["l",.18,.45],["c",.51,1.2,.72,2.22,.69,3.42],["c",-.06,1.53,-.39,3.03,-.99,4.53],["c",-.3,.75,-.36,.81,-.57,.9],["c",-.15,.09,-.33,.06,-.48,0],["c",-.18,-.09,-.27,-.18,-.33,-.33],["c",-.09,-.18,-.06,-.3,.12,-.75],["c",.66,-1.41,1.02,-2.88,1.08,-4.32],["c",0,-.6,-.03,-1.05,-.18,-1.59],["c",-.3,-1.2,-.99,-2.4,-2.25,-3.87],["c",-.42,-.48,-1.53,-1.62,-2.19,-2.22],["l",-.45,-.42],["l",-.03,1.11],["l",0,1.11],["l",-.21,0],["l",-.21,0],["l",0,-7.5],["z"],["m",1.65,.09],["c",-.3,-.3,-.69,-.72,-.9,-.87],["l",-.33,-.33],["l",0,.15],["c",0,.3,.06,.81,.15,1.26],["c",.27,1.29,.87,2.61,2.04,4.29],["c",.15,.24,.6,.87,.96,1.38],["l",1.08,1.53],["l",.42,.63],["c",.03,0,.12,-.36,.21,-.72],["c",.06,-.33,.06,-1.2,0,-1.62],["c",-.33,-1.71,-1.44,-3.48,-3.63,-5.7],["z"]],w:6.693,h:26.337},"flags.u32nd":{d:[["M",-.42,11.25],["l",0,-11.25],["l",.21,0],["l",.21,0],["l",0,.36],["c",.09,1.68,.69,3.27,2.07,5.46],["l",.87,1.35],["c",1.02,1.62,1.47,2.37,1.86,3.18],["c",.48,1.02,.78,1.92,.93,2.88],["c",.06,.48,.06,1.5,0,1.89],["c",-.09,.42,-.21,.87,-.36,1.26],["l",-.12,.3],["l",.15,.39],["c",.69,1.56,.84,2.88,.54,4.38],["c",-.09,.45,-.27,1.08,-.45,1.47],["l",-.12,.24],["l",.18,.36],["c",.33,.72,.57,1.56,.69,2.34],["c",.12,1.02,-.06,2.52,-.42,3.84],["c",-.27,.93,-.75,2.13,-.93,2.31],["c",-.18,.15,-.45,.18,-.66,.09],["c",-.18,-.09,-.27,-.18,-.33,-.33],["c",-.09,-.18,-.06,-.3,.06,-.6],["c",.21,-.36,.42,-.9,.57,-1.38],["c",.51,-1.41,.69,-3.06,.48,-4.08],["c",-.15,-.81,-.57,-1.68,-1.2,-2.55],["c",-.72,-.99,-1.83,-2.13,-3.3,-3.33],["l",-.48,-.42],["l",-.03,1.53],["l",0,1.56],["l",-.21,0],["l",-.21,0],["l",0,-11.25],["z"],["m",1.26,-3.96],["c",-.27,-.3,-.54,-.6,-.66,-.72],["l",-.18,-.21],["l",0,.42],["c",.06,.87,.24,1.74,.66,2.67],["c",.36,.87,.96,1.86,1.92,3.18],["c",.21,.33,.63,.87,.87,1.23],["c",.27,.39,.6,.84,.75,1.08],["l",.27,.39],["l",.03,-.12],["c",.12,-.45,.15,-1.05,.09,-1.59],["c",-.27,-1.86,-1.38,-3.78,-3.75,-6.33],["z"],["m",-.27,6.09],["c",-.27,-.21,-.48,-.42,-.51,-.45],["c",-.06,-.03,-.06,-.03,-.06,.21],["c",0,.9,.3,2.04,.81,3.09],["c",.48,1.02,.96,1.77,2.37,3.63],["c",.6,.78,1.05,1.44,1.29,1.77],["c",.06,.12,.15,.21,.15,.18],["c",.03,-.03,.18,-.57,.24,-.87],["c",.06,-.45,.06,-1.32,-.03,-1.74],["c",-.09,-.48,-.24,-.9,-.51,-1.44],["c",-.66,-1.35,-1.83,-2.7,-3.75,-4.38],["z"]],w:6.697,h:32.145},"flags.u64th":{d:[["M",-.42,15],["l",0,-15],["l",.21,0],["l",.21,0],["l",0,.36],["c",.06,1.2,.39,2.37,1.02,3.66],["c",.39,.81,.84,1.56,1.8,3.09],["c",.81,1.26,1.05,1.68,1.35,2.22],["c",.87,1.5,1.35,2.79,1.56,4.08],["c",.06,.54,.06,1.56,-.03,2.04],["c",-.09,.48,-.21,.99,-.36,1.35],["l",-.12,.27],["l",.12,.27],["c",.09,.15,.21,.45,.27,.66],["c",.69,1.89,.63,3.66,-.18,5.46],["l",-.18,.39],["l",.15,.33],["c",.3,.66,.51,1.44,.63,2.1],["c",.06,.48,.06,1.35,0,1.71],["c",-.15,.57,-.42,1.2,-.78,1.68],["l",-.21,.27],["l",.18,.33],["c",.57,1.05,.93,2.13,1.02,3.18],["c",.06,.72,0,1.83,-.21,2.79],["c",-.18,1.02,-.63,2.34,-1.02,3.09],["c",-.15,.33,-.48,.45,-.78,.3],["c",-.18,-.09,-.27,-.18,-.33,-.33],["c",-.09,-.18,-.06,-.3,.03,-.54],["c",.75,-1.5,1.23,-3.45,1.17,-4.89],["c",-.06,-1.02,-.42,-2.01,-1.17,-3.15],["c",-.48,-.72,-1.02,-1.35,-1.89,-2.22],["c",-.57,-.57,-1.56,-1.5,-1.92,-1.77],["l",-.12,-.09],["l",0,1.68],["l",0,1.68],["l",-.21,0],["l",-.21,0],["l",0,-15],["z"],["m",.93,-8.07],["c",-.27,-.3,-.48,-.54,-.51,-.54],["c",0,0,0,.69,.03,1.02],["c",.15,1.47,.75,2.94,2.04,4.83],["l",1.08,1.53],["c",.39,.57,.84,1.2,.99,1.44],["c",.15,.24,.3,.45,.3,.45],["c",0,0,.03,-.09,.06,-.21],["c",.36,-1.59,-.15,-3.33,-1.47,-5.4],["c",-.63,-.93,-1.35,-1.83,-2.52,-3.12],["z"],["m",.06,6.72],["c",-.24,-.21,-.48,-.42,-.51,-.45],["l",-.06,-.06],["l",0,.33],["c",0,1.2,.3,2.34,.93,3.6],["c",.45,.9,.96,1.68,2.25,3.51],["c",.39,.54,.84,1.17,1.02,1.44],["c",.21,.33,.33,.51,.33,.48],["c",.06,-.09,.21,-.63,.3,-.99],["c",.06,-.33,.06,-.45,.06,-.96],["c",0,-.6,-.03,-.84,-.18,-1.35],["c",-.3,-1.08,-1.02,-2.28,-2.13,-3.57],["c",-.39,-.45,-1.44,-1.47,-2.01,-1.98],["z"],["m",0,6.72],["c",-.24,-.21,-.48,-.39,-.51,-.42],["l",-.06,-.06],["l",0,.33],["c",0,1.41,.45,2.82,1.38,4.35],["c",.42,.72,.72,1.14,1.86,2.73],["c",.36,.45,.75,.99,.87,1.2],["c",.15,.21,.3,.36,.3,.36],["c",.06,0,.3,-.48,.39,-.75],["c",.09,-.36,.12,-.63,.12,-1.05],["c",-.06,-1.05,-.45,-2.04,-1.2,-3.18],["c",-.57,-.87,-1.11,-1.53,-2.07,-2.49],["c",-.36,-.33,-.84,-.78,-1.08,-1.02],["z"]],w:6.682,h:39.694},"flags.d8th":{d:[["M",5.67,-21.63],["c",.24,-.12,.54,-.06,.69,.15],["c",.06,.06,.21,.36,.39,.66],["c",.84,1.77,1.26,3.36,1.32,5.1],["c",.03,1.29,-.21,2.37,-.81,3.63],["c",-.6,1.23,-1.26,2.13,-3.21,4.38],["c",-1.35,1.53,-1.86,2.19,-2.4,2.97],["c",-.63,.93,-1.11,1.92,-1.38,2.79],["c",-.15,.54,-.27,1.35,-.27,1.8],["l",0,.15],["l",-.21,0],["l",-.21,0],["l",0,-3.75],["l",0,-3.75],["l",.21,0],["l",.21,0],["l",.48,-.3],["c",1.83,-1.11,3.12,-2.1,4.17,-3.12],["c",.78,-.81,1.32,-1.53,1.71,-2.31],["c",.45,-.93,.6,-1.74,.51,-2.88],["c",-.12,-1.56,-.63,-3.18,-1.47,-4.68],["c",-.12,-.21,-.15,-.33,-.06,-.51],["c",.06,-.15,.15,-.24,.33,-.33],["z"]],w:8.492,h:21.691},"flags.ugrace":{d:[["M",6.03,6.93],["c",.15,-.09,.33,-.06,.51,0],["c",.15,.09,.21,.15,.3,.33],["c",.09,.18,.06,.39,-.03,.54],["c",-.06,.15,-10.89,8.88,-11.07,8.97],["c",-.15,.09,-.33,.06,-.48,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.09,-.18,-.06,-.39,.03,-.54],["c",.06,-.15,10.89,-8.88,11.07,-8.97],["z"]],w:12.019,h:9.954},"flags.dgrace":{d:[["M",-6.06,-15.93],["c",.18,-.09,.33,-.12,.48,-.06],["c",.18,.09,14.01,8.04,14.1,8.1],["c",.12,.12,.18,.33,.18,.51],["c",-.03,.21,-.15,.39,-.36,.48],["c",-.18,.09,-.33,.12,-.48,.06],["c",-.18,-.09,-14.01,-8.04,-14.1,-8.1],["c",-.12,-.12,-.18,-.33,-.18,-.51],["c",.03,-.21,.15,-.39,.36,-.48],["z"]],w:15.12,h:9.212},"flags.d16th":{d:[["M",6.84,-22.53],["c",.27,-.12,.57,-.06,.72,.15],["c",.15,.15,.33,.87,.45,1.56],["c",.06,.33,.06,1.35,0,1.65],["c",-.06,.33,-.15,.78,-.27,1.11],["c",-.12,.33,-.45,.96,-.66,1.32],["l",-.18,.27],["l",.09,.18],["c",.48,1.02,.72,2.25,.69,3.3],["c",-.06,1.23,-.42,2.28,-1.26,3.45],["c",-.57,.87,-.99,1.32,-3,3.39],["c",-1.56,1.56,-2.22,2.4,-2.76,3.45],["c",-.42,.84,-.66,1.8,-.66,2.55],["l",0,.15],["l",-.21,0],["l",-.21,0],["l",0,-7.5],["l",0,-7.5],["l",.21,0],["l",.21,0],["l",0,1.14],["l",0,1.11],["l",.27,-.15],["c",1.11,-.57,1.77,-.99,2.52,-1.47],["c",2.37,-1.56,3.69,-3.15,4.05,-4.83],["c",.03,-.18,.03,-.39,.03,-.78],["c",0,-.6,-.03,-.93,-.24,-1.5],["c",-.06,-.18,-.12,-.39,-.15,-.45],["c",-.03,-.24,.12,-.48,.36,-.6],["z"],["m",-.63,7.5],["c",-.06,-.18,-.15,-.36,-.15,-.36],["c",-.03,0,-.03,.03,-.06,.06],["c",-.06,.12,-.96,1.02,-1.95,1.98],["c",-.63,.57,-1.26,1.17,-1.44,1.35],["c",-1.53,1.62,-2.28,2.85,-2.55,4.32],["c",-.03,.18,-.03,.54,-.06,.99],["l",0,.69],["l",.18,-.09],["c",.93,-.54,2.1,-1.29,2.82,-1.83],["c",.69,-.51,1.02,-.81,1.53,-1.29],["c",1.86,-1.89,2.37,-3.66,1.68,-5.82],["z"]],w:8.475,h:22.591},"flags.d32nd":{d:[["M",6.84,-29.13],["c",.27,-.12,.57,-.06,.72,.15],["c",.12,.12,.27,.63,.36,1.11],["c",.33,1.59,.06,3.06,-.81,4.47],["l",-.18,.27],["l",.09,.15],["c",.12,.24,.33,.69,.45,1.05],["c",.63,1.83,.45,3.57,-.57,5.22],["l",-.18,.3],["l",.15,.27],["c",.42,.87,.6,1.71,.57,2.61],["c",-.06,1.29,-.48,2.46,-1.35,3.78],["c",-.54,.81,-.93,1.29,-2.46,3],["c",-.51,.54,-1.05,1.17,-1.26,1.41],["c",-1.56,1.86,-2.25,3.36,-2.37,5.01],["l",0,.33],["l",-.21,0],["l",-.21,0],["l",0,-11.25],["l",0,-11.25],["l",.21,0],["l",.21,0],["l",0,1.35],["l",.03,1.35],["l",.78,-.39],["c",1.38,-.69,2.34,-1.26,3.24,-1.92],["c",1.38,-1.02,2.28,-2.13,2.64,-3.21],["c",.15,-.48,.18,-.72,.18,-1.29],["c",0,-.57,-.06,-.9,-.24,-1.47],["c",-.06,-.18,-.12,-.39,-.15,-.45],["c",-.03,-.24,.12,-.48,.36,-.6],["z"],["m",-.63,7.2],["c",-.09,-.18,-.12,-.21,-.12,-.15],["c",-.03,.09,-1.02,1.08,-2.04,2.04],["c",-1.17,1.08,-1.65,1.56,-2.07,2.04],["c",-.84,.96,-1.38,1.86,-1.68,2.76],["c",-.21,.57,-.27,.99,-.3,1.65],["l",0,.54],["l",.66,-.33],["c",3.57,-1.86,5.49,-3.69,5.94,-5.7],["c",.06,-.39,.06,-1.2,-.03,-1.65],["c",-.06,-.39,-.24,-.9,-.36,-1.2],["z"],["m",-.06,7.2],["c",-.06,-.15,-.12,-.33,-.15,-.45],["l",-.06,-.18],["l",-.18,.21],["l",-1.83,1.83],["c",-.87,.9,-1.77,1.8,-1.95,2.01],["c",-1.08,1.29,-1.62,2.31,-1.89,3.51],["c",-.06,.3,-.06,.51,-.09,.93],["l",0,.57],["l",.09,-.06],["c",.75,-.45,1.89,-1.26,2.52,-1.74],["c",.81,-.66,1.74,-1.53,2.22,-2.16],["c",1.26,-1.53,1.68,-3.06,1.32,-4.47],["z"]],w:8.385,h:29.191},"flags.d64th":{d:[["M",7.08,-32.88],["c",.3,-.12,.66,-.03,.78,.24],["c",.18,.33,.27,2.1,.15,2.64],["c",-.09,.39,-.21,.78,-.39,1.08],["l",-.15,.3],["l",.09,.27],["c",.03,.12,.09,.45,.12,.69],["c",.27,1.44,.18,2.55,-.3,3.6],["l",-.12,.33],["l",.06,.42],["c",.27,1.35,.33,2.82,.21,3.63],["c",-.12,.6,-.3,1.23,-.57,1.8],["l",-.15,.27],["l",.03,.42],["c",.06,1.02,.06,2.7,.03,3.06],["c",-.15,1.47,-.66,2.76,-1.74,4.41],["c",-.45,.69,-.75,1.11,-1.74,2.37],["c",-1.05,1.38,-1.5,1.98,-1.95,2.73],["c",-.93,1.5,-1.38,2.82,-1.44,4.2],["l",0,.42],["l",-.21,0],["l",-.21,0],["l",0,-15],["l",0,-15],["l",.21,0],["l",.21,0],["l",0,1.86],["l",0,1.89],["c",0,0,.21,-.03,.45,-.09],["c",2.22,-.39,4.08,-1.11,5.19,-2.01],["c",.63,-.54,1.02,-1.14,1.2,-1.8],["c",.06,-.3,.06,-1.14,-.03,-1.65],["c",-.03,-.18,-.06,-.39,-.09,-.48],["c",-.03,-.24,.12,-.48,.36,-.6],["z"],["m",-.45,6.15],["c",-.03,-.18,-.06,-.42,-.06,-.54],["l",-.03,-.18],["l",-.33,.3],["c",-.42,.36,-.87,.72,-1.68,1.29],["c",-1.98,1.38,-2.25,1.59,-2.85,2.16],["c",-.75,.69,-1.23,1.44,-1.47,2.19],["c",-.15,.45,-.18,.63,-.21,1.35],["l",0,.66],["l",.39,-.18],["c",1.83,-.9,3.45,-1.95,4.47,-2.91],["c",.93,-.9,1.53,-1.83,1.74,-2.82],["c",.06,-.33,.06,-.87,.03,-1.32],["z"],["m",-.27,4.86],["c",-.03,-.21,-.06,-.36,-.06,-.36],["c",0,-.03,-.12,.09,-.24,.24],["c",-.39,.48,-.99,1.08,-2.16,2.19],["c",-1.47,1.38,-1.92,1.83,-2.46,2.49],["c",-.66,.87,-1.08,1.74,-1.29,2.58],["c",-.09,.42,-.15,.87,-.15,1.44],["l",0,.54],["l",.48,-.33],["c",1.5,-1.02,2.58,-1.89,3.51,-2.82],["c",1.47,-1.47,2.25,-2.85,2.4,-4.26],["c",.03,-.39,.03,-1.17,-.03,-1.71],["z"],["m",-.66,7.68],["c",.03,-.15,.03,-.6,.03,-.99],["l",0,-.72],["l",-.27,.33],["l",-1.74,1.98],["c",-1.77,1.92,-2.43,2.76,-2.97,3.9],["c",-.51,1.02,-.72,1.77,-.75,2.91],["c",0,.63,0,.63,.06,.6],["c",.03,-.03,.3,-.27,.63,-.54],["c",.66,-.6,1.86,-1.8,2.31,-2.31],["c",1.65,-1.89,2.52,-3.54,2.7,-5.16],["z"]],w:8.485,h:32.932},"clefs.C":{d:[["M",.06,-14.94],["l",.09,-.06],["l",1.92,0],["l",1.92,0],["l",.09,.06],["l",.06,.09],["l",0,14.85],["l",0,14.82],["l",-.06,.09],["l",-.09,.06],["l",-1.92,0],["l",-1.92,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-14.82],["l",0,-14.85],["z"],["m",5.37,0],["c",.09,-.06,.09,-.06,.57,-.06],["c",.45,0,.45,0,.54,.06],["l",.06,.09],["l",0,7.14],["l",0,7.11],["l",.09,-.06],["c",.18,-.18,.72,-.84,.96,-1.2],["c",.3,-.45,.66,-1.17,.84,-1.65],["c",.36,-.9,.57,-1.83,.6,-2.79],["c",.03,-.48,.03,-.54,.09,-.63],["c",.12,-.18,.36,-.21,.54,-.12],["c",.18,.09,.21,.15,.24,.66],["c",.06,.87,.21,1.56,.57,2.22],["c",.51,1.02,1.26,1.68,2.22,1.92],["c",.21,.06,.33,.06,.78,.06],["c",.45,0,.57,0,.84,-.06],["c",.45,-.12,.81,-.33,1.08,-.6],["c",.57,-.57,.87,-1.41,.99,-2.88],["c",.06,-.54,.06,-3,0,-3.57],["c",-.21,-2.58,-.84,-3.87,-2.16,-4.5],["c",-.48,-.21,-1.17,-.36,-1.77,-.36],["c",-.69,0,-1.29,.27,-1.5,.72],["c",-.06,.15,-.06,.21,-.06,.42],["c",0,.24,0,.3,.06,.45],["c",.12,.24,.24,.39,.63,.66],["c",.42,.3,.57,.48,.69,.72],["c",.06,.15,.06,.21,.06,.48],["c",0,.39,-.03,.63,-.21,.96],["c",-.3,.6,-.87,1.08,-1.5,1.26],["c",-.27,.06,-.87,.06,-1.14,0],["c",-.78,-.24,-1.44,-.87,-1.65,-1.68],["c",-.12,-.42,-.09,-1.17,.09,-1.71],["c",.51,-1.65,1.98,-2.82,3.81,-3.09],["c",.84,-.09,2.46,.03,3.51,.27],["c",2.22,.57,3.69,1.8,4.44,3.75],["c",.36,.93,.57,2.13,.57,3.36],["c",0,1.44,-.48,2.73,-1.38,3.81],["c",-1.26,1.5,-3.27,2.43,-5.28,2.43],["c",-.48,0,-.51,0,-.75,-.09],["c",-.15,-.03,-.48,-.21,-.78,-.36],["c",-.69,-.36,-.87,-.42,-1.26,-.42],["c",-.27,0,-.3,0,-.51,.09],["c",-.57,.3,-.81,.9,-.81,2.1],["c",0,1.23,.24,1.83,.81,2.13],["c",.21,.09,.24,.09,.51,.09],["c",.39,0,.57,-.06,1.26,-.42],["c",.3,-.15,.63,-.33,.78,-.36],["c",.24,-.09,.27,-.09,.75,-.09],["c",2.01,0,4.02,.93,5.28,2.4],["c",.9,1.11,1.38,2.4,1.38,3.84],["c",0,1.5,-.3,2.88,-.84,3.96],["c",-.78,1.59,-2.19,2.64,-4.17,3.15],["c",-1.05,.24,-2.67,.36,-3.51,.27],["c",-1.83,-.27,-3.3,-1.44,-3.81,-3.09],["c",-.18,-.54,-.21,-1.29,-.09,-1.74],["c",.15,-.6,.63,-1.2,1.23,-1.47],["c",.36,-.18,.57,-.21,.99,-.21],["c",.42,0,.63,.03,1.02,.21],["c",.42,.21,.84,.63,1.05,1.05],["c",.18,.36,.21,.6,.21,.96],["c",0,.3,0,.36,-.06,.51],["c",-.12,.24,-.27,.42,-.69,.72],["c",-.57,.42,-.69,.63,-.69,1.08],["c",0,.24,0,.3,.06,.45],["c",.12,.21,.3,.39,.57,.54],["c",.42,.18,.87,.21,1.53,.15],["c",1.08,-.15,1.8,-.57,2.34,-1.32],["c",.54,-.75,.84,-1.83,.99,-3.51],["c",.06,-.57,.06,-3.03,0,-3.57],["c",-.12,-1.47,-.42,-2.31,-.99,-2.88],["c",-.27,-.27,-.63,-.48,-1.08,-.6],["c",-.27,-.06,-.39,-.06,-.84,-.06],["c",-.45,0,-.57,0,-.78,.06],["c",-1.14,.27,-2.01,1.17,-2.46,2.49],["c",-.21,.57,-.3,.99,-.33,1.65],["c",-.03,.51,-.06,.57,-.24,.66],["c",-.12,.06,-.27,.06,-.39,0],["c",-.21,-.09,-.21,-.15,-.24,-.75],["c",-.09,-1.92,-.78,-3.72,-2.01,-5.19],["c",-.18,-.21,-.36,-.42,-.39,-.45],["l",-.09,-.06],["l",0,7.11],["l",0,7.14],["l",-.06,.09],["c",-.09,.06,-.09,.06,-.54,.06],["c",-.48,0,-.48,0,-.57,-.06],["l",-.06,-.09],["l",0,-14.82],["l",0,-14.85],["z"]],w:20.31,h:29.97},"clefs.F":{d:[["M",6.3,-7.8],["c",.36,-.03,1.65,0,2.13,.03],["c",3.6,.42,6.03,2.1,6.93,4.86],["c",.27,.84,.36,1.5,.36,2.58],["c",0,.9,-.03,1.35,-.18,2.16],["c",-.78,3.78,-3.54,7.08,-8.37,9.96],["c",-1.74,1.05,-3.87,2.13,-6.18,3.12],["c",-.39,.18,-.75,.33,-.81,.36],["c",-.06,.03,-.15,.06,-.18,.06],["c",-.15,0,-.33,-.18,-.33,-.33],["c",0,-.15,.06,-.21,.51,-.48],["c",3,-1.77,5.13,-3.21,6.84,-4.74],["c",.51,-.45,1.59,-1.5,1.95,-1.95],["c",1.89,-2.19,2.88,-4.32,3.15,-6.78],["c",.06,-.42,.06,-1.77,0,-2.19],["c",-.24,-2.01,-.93,-3.63,-2.04,-4.71],["c",-.63,-.63,-1.29,-1.02,-2.07,-1.2],["c",-1.62,-.39,-3.36,.15,-4.56,1.44],["c",-.54,.6,-1.05,1.47,-1.32,2.22],["l",-.09,.21],["l",.24,-.12],["c",.39,-.21,.63,-.24,1.11,-.24],["c",.3,0,.45,0,.66,.06],["c",1.92,.48,2.85,2.55,1.95,4.38],["c",-.45,.99,-1.41,1.62,-2.46,1.71],["c",-1.47,.09,-2.91,-.87,-3.39,-2.25],["c",-.18,-.57,-.21,-1.32,-.03,-2.28],["c",.39,-2.25,1.83,-4.2,3.81,-5.19],["c",.69,-.36,1.59,-.6,2.37,-.69],["z"],["m",11.58,2.52],["c",.84,-.21,1.71,.3,1.89,1.14],["c",.3,1.17,-.72,2.19,-1.89,1.89],["c",-.99,-.21,-1.5,-1.32,-1.02,-2.25],["c",.18,-.39,.6,-.69,1.02,-.78],["z"],["m",0,7.5],["c",.84,-.21,1.71,.3,1.89,1.14],["c",.21,.87,-.3,1.71,-1.14,1.89],["c",-.87,.21,-1.71,-.3,-1.89,-1.14],["c",-.21,-.84,.3,-1.71,1.14,-1.89],["z"]],w:20.153,h:23.142},"clefs.G":{d:[["M",9.69,-37.41],["c",.09,-.09,.24,-.06,.36,0],["c",.12,.09,.57,.6,.96,1.11],["c",1.77,2.34,3.21,5.85,3.57,8.73],["c",.21,1.56,.03,3.27,-.45,4.86],["c",-.69,2.31,-1.92,4.47,-4.23,7.44],["c",-.3,.39,-.57,.72,-.6,.75],["c",-.03,.06,0,.15,.18,.78],["c",.54,1.68,1.38,4.44,1.68,5.49],["l",.09,.42],["l",.39,0],["c",1.47,.09,2.76,.51,3.96,1.29],["c",1.83,1.23,3.06,3.21,3.39,5.52],["c",.09,.45,.12,1.29,.06,1.74],["c",-.09,1.02,-.33,1.83,-.75,2.73],["c",-.84,1.71,-2.28,3.06,-4.02,3.72],["l",-.33,.12],["l",.03,1.26],["c",0,1.74,-.06,3.63,-.21,4.62],["c",-.45,3.06,-2.19,5.49,-4.47,6.21],["c",-.57,.18,-.9,.21,-1.59,.21],["c",-.69,0,-1.02,-.03,-1.65,-.21],["c",-1.14,-.27,-2.13,-.84,-2.94,-1.65],["c",-.99,-.99,-1.56,-2.16,-1.71,-3.54],["c",-.09,-.81,.06,-1.53,.45,-2.13],["c",.63,-.99,1.83,-1.56,3,-1.53],["c",1.5,.09,2.64,1.32,2.73,2.94],["c",.06,1.47,-.93,2.7,-2.37,2.97],["c",-.45,.06,-.84,.03,-1.29,-.09],["l",-.21,-.09],["l",.09,.12],["c",.39,.54,.78,.93,1.32,1.26],["c",1.35,.87,3.06,1.02,4.35,.36],["c",1.44,-.72,2.52,-2.28,2.97,-4.35],["c",.15,-.66,.24,-1.5,.3,-3.03],["c",.03,-.84,.03,-2.94,0,-3],["c",-.03,0,-.18,0,-.36,.03],["c",-.66,.12,-.99,.12,-1.83,.12],["c",-1.05,0,-1.71,-.06,-2.61,-.3],["c",-4.02,-.99,-7.11,-4.35,-7.8,-8.46],["c",-.12,-.66,-.12,-.99,-.12,-1.83],["c",0,-.84,0,-1.14,.15,-1.92],["c",.36,-2.28,1.41,-4.62,3.3,-7.29],["l",2.79,-3.6],["c",.54,-.66,.96,-1.2,.96,-1.23],["c",0,-.03,-.09,-.33,-.18,-.69],["c",-.96,-3.21,-1.41,-5.28,-1.59,-7.68],["c",-.12,-1.38,-.15,-3.09,-.06,-3.96],["c",.33,-2.67,1.38,-5.07,3.12,-7.08],["c",.36,-.42,.99,-1.05,1.17,-1.14],["z"],["m",2.01,4.71],["c",-.15,-.3,-.3,-.54,-.3,-.54],["c",-.03,0,-.18,.09,-.3,.21],["c",-2.4,1.74,-3.87,4.2,-4.26,7.11],["c",-.06,.54,-.06,1.41,-.03,1.89],["c",.09,1.29,.48,3.12,1.08,5.22],["c",.15,.42,.24,.78,.24,.81],["c",0,.03,.84,-1.11,1.23,-1.68],["c",1.89,-2.73,2.88,-5.07,3.15,-7.53],["c",.09,-.57,.12,-1.74,.06,-2.37],["c",-.09,-1.23,-.27,-1.92,-.87,-3.12],["z"],["m",-2.94,20.7],["c",-.21,-.72,-.39,-1.32,-.42,-1.32],["c",0,0,-1.2,1.47,-1.86,2.37],["c",-2.79,3.63,-4.02,6.3,-4.35,9.3],["c",-.03,.21,-.03,.69,-.03,1.08],["c",0,.69,0,.75,.06,1.11],["c",.12,.54,.27,.99,.51,1.47],["c",.69,1.38,1.83,2.55,3.42,3.42],["c",.96,.54,2.07,.9,3.21,1.08],["c",.78,.12,2.04,.12,2.94,-.03],["c",.51,-.06,.45,-.03,.42,-.3],["c",-.24,-3.33,-.72,-6.33,-1.62,-10.08],["c",-.09,-.39,-.18,-.75,-.18,-.78],["c",-.03,-.03,-.42,0,-.81,.09],["c",-.9,.18,-1.65,.57,-2.22,1.14],["c",-.72,.72,-1.08,1.65,-1.05,2.64],["c",.06,.96,.48,1.83,1.23,2.58],["c",.36,.36,.72,.63,1.17,.9],["c",.33,.18,.36,.21,.42,.33],["c",.18,.42,-.18,.9,-.6,.87],["c",-.18,-.03,-.84,-.36,-1.26,-.63],["c",-.78,-.51,-1.38,-1.11,-1.86,-1.83],["c",-1.77,-2.7,-.99,-6.42,1.71,-8.19],["c",.3,-.21,.81,-.48,1.17,-.63],["c",.3,-.09,1.02,-.3,1.14,-.3],["c",.06,0,.09,0,.09,-.03],["c",.03,-.03,-.51,-1.92,-1.23,-4.26],["z"],["m",3.78,7.41],["c",-.18,-.03,-.36,-.06,-.39,-.06],["c",-.03,0,0,.21,.18,1.02],["c",.75,3.18,1.26,6.3,1.5,9.09],["c",.06,.72,0,.69,.51,.42],["c",.78,-.36,1.44,-.96,1.98,-1.77],["c",1.08,-1.62,1.2,-3.69,.3,-5.55],["c",-.81,-1.62,-2.31,-2.79,-4.08,-3.15],["z"]],w:19.051,h:57.057},"clefs.perc":{d:[["M",5.07,-7.44],["l",.09,-.06],["l",1.53,0],["l",1.53,0],["l",.09,.06],["l",.06,.09],["l",0,7.35],["l",0,7.32],["l",-.06,.09],["l",-.09,.06],["l",-1.53,0],["l",-1.53,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-7.32],["l",0,-7.35],["z"],["m",6.63,0],["l",.09,-.06],["l",1.53,0],["l",1.53,0],["l",.09,.06],["l",.06,.09],["l",0,7.35],["l",0,7.32],["l",-.06,.09],["l",-.09,.06],["l",-1.53,0],["l",-1.53,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-7.32],["l",0,-7.35],["z"]],w:21,h:14.97},"tab.big":{d:[["M",20.16,-21.66],["c",.24,-.09,.66,.09,.78,.36],["c",.09,.21,.09,.24,-.18,.54],["c",-.78,.81,-1.86,1.44,-2.94,1.71],["c",-.87,.24,-1.71,.24,-2.55,.03],["l",-.06,-.03],["l",-.18,.99],["c",-.33,1.98,-.75,4.26,-.96,5.04],["c",-.42,1.65,-1.26,3.18,-2.28,4.14],["c",-.57,.57,-1.17,.9,-1.86,1.08],["c",-.18,.06,-.33,.06,-.66,.06],["c",-.54,0,-.78,-.03,-1.23,-.27],["c",-.39,-.18,-.66,-.39,-1.38,-.99],["c",-.3,-.24,-.66,-.51,-.75,-.57],["c",-.21,-.15,-.27,-.24,-.24,-.45],["c",.06,-.27,.36,-.6,.6,-.66],["c",.18,-.03,.33,.06,.9,.57],["c",.48,.42,.72,.57,.93,.69],["c",.66,.33,1.38,.21,1.95,-.36],["c",.63,-.6,1.05,-1.62,1.23,-3],["c",.03,-.18,.09,-.66,.09,-1.11],["c",.09,-1.56,.33,-3.81,.57,-5.49],["c",.06,-.33,.09,-.63,.09,-.63],["c",-.03,-.03,-.81,-.12,-1.02,-.12],["c",-.57,0,-1.32,.12,-1.8,.33],["c",-.87,.3,-1.35,.78,-1.5,1.41],["c",-.18,.63,.09,1.26,.66,1.65],["c",.12,.06,.15,.12,.18,.24],["c",.09,.27,.06,.57,-.09,.75],["c",-.03,.06,-.12,.09,-.27,.15],["c",-.72,.21,-1.44,.15,-2.1,-.18],["c",-.54,-.27,-.96,-.66,-1.2,-1.14],["c",-.39,-.75,-.33,-1.74,.15,-2.52],["c",.27,-.42,.84,-.93,1.41,-1.23],["c",1.17,-.57,2.88,-.9,4.8,-.9],["c",.69,0,.78,0,1.08,.06],["c",.45,.09,1.11,.3,2.07,.6],["c",1.47,.48,1.83,.57,2.55,.54],["c",1.02,-.06,2.04,-.45,2.94,-1.11],["c",.12,-.09,.24,-.18,.27,-.18],["z"],["m",-5.88,13.05],["c",.21,-.03,.81,0,1.08,.06],["c",.48,.12,.9,.42,.99,.69],["c",.03,.09,.03,.15,0,.27],["c",0,.09,-.03,.57,-.06,1.08],["c",-.09,2.19,-.24,5.76,-.39,8.28],["c",-.06,1.53,-.06,1.77,.03,2.01],["c",.09,.18,.15,.24,.3,.3],["c",.24,.12,.54,.06,1.23,-.27],["c",.57,-.27,.66,-.3,.75,-.24],["c",.09,.06,.18,.3,.18,.45],["c",0,.33,-.15,.51,-.45,.63],["c",-.12,.03,-.39,.15,-.6,.27],["c",-1.17,.6,-1.38,.69,-1.8,.72],["c",-.45,.03,-.78,-.09,-1.08,-.39],["c",-.39,-.42,-.66,-1.2,-1.02,-3.12],["c",-.24,-1.23,-.36,-2.07,-.54,-3.75],["l",0,-.18],["l",-.36,.45],["c",-.6,.75,-1.32,1.59,-1.95,2.25],["c",-.15,.18,-.27,.3,-.27,.33],["c",0,0,.06,.09,.15,.18],["c",.24,.33,.6,.57,1.05,.69],["c",.18,.06,.3,.06,.69,.06],["l",.48,.03],["l",.06,.12],["c",.15,.27,.03,.72,-.21,.9],["c",-.18,.12,-.93,.27,-1.41,.27],["c",-.84,0,-1.59,-.3,-1.98,-.84],["l",-.12,-.15],["l",-.45,.42],["c",-.99,.87,-1.53,1.32,-2.16,1.74],["c",-.78,.51,-1.5,.84,-2.1,.93],["c",-.69,.12,-1.2,.03,-1.95,-.42],["c",-.21,-.12,-.51,-.27,-.66,-.36],["c",-.24,-.12,-.3,-.18,-.33,-.24],["c",-.12,-.27,.15,-.78,.45,-.93],["c",.24,-.12,.33,-.09,.9,.18],["c",.6,.3,.84,.39,1.2,.36],["c",.87,-.09,1.77,-.69,3.24,-2.31],["c",2.67,-2.85,4.59,-5.94,5.7,-9.15],["c",.15,-.45,.24,-.63,.42,-.81],["c",.21,-.24,.6,-.45,.99,-.51],["z"],["m",-3.99,16.05],["c",.18,0,.69,-.03,1.17,0],["c",3.27,.03,5.37,.75,6,2.07],["c",.45,.99,.12,2.4,-.81,3.42],["c",-.24,.27,-.57,.57,-.84,.75],["c",-.09,.06,-.18,.09,-.18,.12],["c",0,0,.18,.03,.42,.09],["c",1.23,.3,2.01,.81,2.37,1.59],["c",.27,.54,.3,1.32,.09,2.1],["c",-.12,.36,-.45,1.05,-.69,1.35],["c",-.87,1.17,-2.1,1.92,-3.54,2.25],["c",-.36,.06,-.48,.06,-.96,.06],["c",-.45,0,-.66,0,-.84,-.03],["c",-.84,-.18,-1.47,-.51,-2.07,-1.11],["c",-.33,-.33,-.45,-.51,-.45,-.63],["c",0,-.06,.03,-.15,.06,-.24],["c",.18,-.33,.69,-.6,.93,-.48],["c",.03,.03,.15,.12,.27,.24],["c",.39,.42,.99,.57,1.62,.45],["c",1.05,-.21,1.98,-1.02,2.31,-2.01],["c",.48,-1.53,-.48,-2.55,-2.58,-2.67],["c",-.21,0,-.36,-.03,-.42,-.06],["c",-.15,-.09,-.21,-.51,-.06,-.78],["c",.12,-.27,.24,-.33,.6,-.36],["c",.57,-.06,1.11,-.42,1.5,-.99],["c",.48,-.72,.54,-1.59,.18,-2.31],["c",-.12,-.21,-.45,-.54,-.69,-.69],["c",-.33,-.21,-.93,-.45,-1.35,-.51],["l",-.12,-.03],["l",-.06,.48],["c",-.54,2.94,-1.14,6.24,-1.29,6.75],["c",-.33,1.35,-.93,2.61,-1.65,3.6],["c",-.3,.36,-.81,.9,-1.14,1.14],["c",-.3,.24,-.84,.48,-1.14,.57],["c",-.33,.09,-.96,.09,-1.26,.03],["c",-.45,-.12,-.87,-.39,-1.53,-.96],["c",-.24,-.15,-.51,-.39,-.63,-.48],["c",-.3,-.21,-.33,-.33,-.21,-.63],["c",.12,-.18,.27,-.36,.42,-.45],["c",.27,-.12,.36,-.09,.87,.33],["c",.78,.6,1.08,.75,1.65,.72],["c",.45,-.03,.81,-.21,1.17,-.54],["c",.87,-.9,1.38,-2.85,1.38,-5.37],["c",0,-.6,.03,-1.11,.12,-2.04],["c",.06,-.69,.24,-2.01,.33,-2.58],["c",.06,-.24,.06,-.42,.06,-.42],["c",0,0,-.12,.03,-.21,.09],["c",-1.44,.57,-2.16,1.65,-1.74,2.55],["c",.09,.15,.18,.24,.27,.33],["c",.24,.21,.3,.27,.33,.39],["c",.06,.24,0,.63,-.15,.78],["c",-.09,.12,-.54,.21,-.96,.24],["c",-1.02,.03,-2.01,-.48,-2.43,-1.32],["c",-.21,-.45,-.27,-.9,-.15,-1.44],["c",.06,-.27,.21,-.66,.39,-.93],["c",.87,-1.29,3,-2.22,5.64,-2.43],["z"]],w:19.643,h:43.325},"tab.tiny":{d:[["M",16.02,-17.25],["c",.12,-.09,.15,-.09,.27,-.09],["c",.21,.03,.51,.3,.51,.45],["c",0,.06,-.12,.18,-.3,.36],["c",-1.11,1.08,-2.55,1.59,-3.84,1.41],["c",-.15,-.03,-.33,-.06,-.39,-.09],["c",-.06,-.03,-.09,-.03,-.12,-.03],["c",0,0,-.06,.42,-.15,.93],["c",-.33,2.01,-.66,3.69,-.84,4.26],["c",-.42,1.41,-1.23,2.67,-2.16,3.33],["c",-.27,.18,-.75,.42,-.99,.48],["c",-.3,.09,-.72,.09,-1.02,.06],["c",-.45,-.09,-.84,-.33,-1.53,-.9],["c",-.21,-.18,-.51,-.39,-.63,-.48],["c",-.27,-.21,-.3,-.24,-.3,-.36],["c",0,-.12,.09,-.36,.18,-.45],["c",.09,-.09,.27,-.18,.36,-.18],["c",.12,0,.3,.12,.66,.45],["c",.57,.51,.87,.69,1.23,.72],["c",.93,.06,1.68,-.78,1.98,-2.37],["c",.09,-.39,.15,-.75,.18,-1.53],["c",.06,-.99,.24,-2.79,.42,-4.05],["c",.03,-.3,.06,-.57,.06,-.6],["c",0,-.06,-.03,-.09,-.15,-.12],["c",-.9,-.18,-2.13,.06,-2.76,.57],["c",-.36,.3,-.51,.6,-.51,1.02],["c",0,.45,.15,.75,.48,.99],["c",.06,.06,.15,.18,.18,.24],["c",.12,.24,.03,.63,-.15,.69],["c",-.24,.12,-.6,.15,-.9,.15],["c",-.36,-.03,-.57,-.09,-.87,-.24],["c",-.78,-.36,-1.23,-1.11,-1.2,-1.92],["c",.12,-1.53,1.74,-2.49,4.62,-2.7],["c",1.2,-.09,1.47,-.03,3.33,.57],["c",.9,.3,1.14,.36,1.56,.39],["c",.45,0,.93,-.06,1.38,-.21],["c",.51,-.18,.81,-.33,1.41,-.75],["z"],["m",-4.68,10.38],["c",.39,-.06,.84,0,1.2,.15],["c",.24,.12,.36,.21,.45,.36],["l",.09,.09],["l",-.06,1.41],["c",-.09,2.19,-.18,3.96,-.27,5.49],["c",-.03,.78,-.06,1.59,-.06,1.86],["c",0,.42,0,.48,.06,.57],["c",.06,.18,.18,.24,.36,.27],["c",.18,0,.39,-.06,.84,-.27],["c",.45,-.21,.54,-.24,.63,-.18],["c",.12,.12,.15,.54,.03,.69],["c",-.03,.03,-.15,.12,-.27,.18],["c",-.15,.03,-.3,.12,-.36,.15],["c",-.87,.45,-1.02,.51,-1.26,.57],["c",-.33,.09,-.6,.06,-.84,-.06],["c",-.42,-.18,-.63,-.6,-.87,-1.44],["c",-.3,-1.23,-.57,-2.97,-.66,-4.08],["c",0,-.18,-.03,-.3,-.03,-.33],["l",-.06,.06],["c",-.18,.27,-1.11,1.38,-1.68,2.01],["l",-.33,.33],["l",.06,.09],["c",.06,.15,.27,.33,.48,.42],["c",.27,.18,.51,.24,.96,.27],["l",.39,0],["l",.03,.12],["c",.12,.21,.03,.57,-.15,.69],["c",-.03,.03,-.21,.09,-.36,.15],["c",-.27,.06,-.39,.06,-.75,.06],["c",-.48,0,-.75,-.03,-1.08,-.21],["c",-.21,-.12,-.51,-.36,-.57,-.48],["l",-.03,-.09],["l",-.39,.36],["c",-1.47,1.35,-2.49,1.98,-3.42,2.13],["c",-.54,.09,-.96,-.03,-1.62,-.39],["c",-.21,-.15,-.45,-.27,-.54,-.3],["c",-.18,-.09,-.21,-.21,-.12,-.45],["c",.06,-.27,.33,-.48,.54,-.48],["c",.03,0,.27,.09,.48,.21],["c",.48,.24,.69,.27,.99,.27],["c",.6,-.06,1.17,-.42,2.1,-1.35],["c",2.22,-2.22,4.02,-4.98,4.95,-7.59],["c",.21,-.57,.3,-.78,.48,-.93],["c",.15,-.15,.42,-.27,.66,-.33],["z"],["m",-3.06,12.84],["c",.27,-.03,1.68,0,2.01,.03],["c",1.92,.18,3.15,.69,3.63,1.5],["c",.18,.33,.24,.51,.21,.93],["c",0,.45,-.06,.72,-.24,1.11],["c",-.24,.51,-.69,1.02,-1.17,1.35],["c",-.21,.15,-.21,.15,-.12,.18],["c",.72,.15,1.11,.3,1.5,.57],["c",.39,.24,.63,.57,.75,.96],["c",.09,.3,.09,.96,0,1.29],["c",-.15,.57,-.39,1.05,-.78,1.5],["c",-.66,.75,-1.62,1.32,-2.61,1.53],["c",-.27,.06,-.42,.06,-.84,.06],["c",-.48,0,-.57,0,-.81,-.06],["c",-.6,-.18,-1.05,-.42,-1.47,-.81],["c",-.36,-.39,-.42,-.51,-.3,-.75],["c",.12,-.21,.39,-.39,.6,-.39],["c",.09,0,.15,.03,.33,.18],["c",.12,.12,.27,.24,.36,.27],["c",.96,.48,2.46,-.33,2.82,-1.5],["c",.24,-.81,-.03,-1.44,-.69,-1.77],["c",-.39,-.21,-1.02,-.33,-1.53,-.33],["c",-.18,0,-.21,0,-.27,-.09],["c",-.06,-.09,-.06,-.3,-.03,-.48],["c",.06,-.18,.18,-.36,.33,-.36],["c",.39,-.06,.51,-.09,.72,-.18],["c",.69,-.36,1.11,-1.23,.99,-2.01],["c",-.09,-.51,-.42,-.9,-.93,-1.17],["c",-.24,-.12,-.6,-.27,-.87,-.3],["c",-.09,-.03,-.09,-.03,-.12,.12],["c",0,.09,-.21,1.11,-.42,2.25],["c",-.66,3.75,-.72,3.99,-1.26,5.07],["c",-.9,1.89,-2.25,2.85,-3.48,2.61],["c",-.39,-.09,-.69,-.27,-1.38,-.84],["c",-.63,-.51,-.63,-.48,-.63,-.6],["c",0,-.18,.18,-.48,.39,-.57],["c",.21,-.12,.3,-.09,.81,.33],["c",.15,.15,.39,.3,.54,.36],["c",.18,.12,.27,.12,.48,.15],["c",.99,.06,1.71,-.78,2.04,-2.46],["c",.12,-.66,.18,-1.14,.21,-2.22],["c",.03,-1.23,.12,-2.25,.36,-3.63],["c",.03,-.24,.06,-.45,.06,-.48],["c",-.06,-.03,-.66,.27,-.9,.42],["c",-.06,.06,-.21,.18,-.33,.3],["c",-.57,.57,-.6,1.35,-.06,1.74],["c",.18,.12,.24,.24,.21,.51],["c",-.03,.3,-.15,.42,-.57,.48],["c",-1.11,.24,-2.22,-.42,-2.43,-1.38],["c",-.09,-.45,.03,-1.02,.3,-1.47],["c",.18,-.24,.6,-.63,.9,-.84],["c",.9,-.6,2.28,-1.02,3.69,-1.11],["z"]],w:15.709,h:34.656},"timesig.common":{d:[["M",6.66,-7.83],["c",.72,-.06,1.41,-.03,1.98,.09],["c",1.2,.27,2.34,.96,3.09,1.92],["c",.63,.81,1.08,1.86,1.14,2.73],["c",.06,1.02,-.51,1.92,-1.44,2.22],["c",-.24,.09,-.3,.09,-.63,.09],["c",-.33,0,-.42,0,-.63,-.06],["c",-.66,-.24,-1.14,-.63,-1.41,-1.2],["c",-.15,-.3,-.21,-.51,-.24,-.9],["c",-.06,-1.08,.57,-2.04,1.56,-2.37],["c",.18,-.06,.27,-.06,.63,-.06],["l",.45,0],["c",.06,.03,.09,.03,.09,0],["c",0,0,-.09,-.12,-.24,-.27],["c",-1.02,-1.11,-2.55,-1.68,-4.08,-1.5],["c",-1.29,.15,-2.04,.69,-2.4,1.74],["c",-.36,.93,-.42,1.89,-.42,5.37],["c",0,2.97,.06,3.96,.24,4.77],["c",.24,1.08,.63,1.68,1.41,2.07],["c",.81,.39,2.16,.45,3.18,.09],["c",1.29,-.45,2.37,-1.53,3.03,-2.97],["c",.15,-.33,.33,-.87,.39,-1.17],["c",.09,-.24,.15,-.36,.3,-.39],["c",.21,-.03,.42,.15,.39,.36],["c",-.06,.39,-.42,1.38,-.69,1.89],["c",-.96,1.8,-2.49,2.94,-4.23,3.18],["c",-.99,.12,-2.58,-.06,-3.63,-.45],["c",-.96,-.36,-1.71,-.84,-2.4,-1.5],["c",-1.11,-1.11,-1.8,-2.61,-2.04,-4.56],["c",-.06,-.6,-.06,-2.01,0,-2.61],["c",.24,-1.95,.9,-3.45,2.01,-4.56],["c",.69,-.66,1.44,-1.11,2.37,-1.47],["c",.63,-.24,1.47,-.42,2.22,-.48],["z"]],w:13.038,h:15.689},"timesig.cut":{d:[["M",6.24,-10.44],["c",.09,-.06,.09,-.06,.48,-.06],["c",.36,0,.36,0,.45,.06],["l",.06,.09],["l",0,1.23],["l",0,1.26],["l",.27,0],["c",1.26,0,2.49,.45,3.48,1.29],["c",1.05,.87,1.8,2.28,1.89,3.48],["c",.06,1.02,-.51,1.92,-1.44,2.22],["c",-.24,.09,-.3,.09,-.63,.09],["c",-.33,0,-.42,0,-.63,-.06],["c",-.66,-.24,-1.14,-.63,-1.41,-1.2],["c",-.15,-.3,-.21,-.51,-.24,-.9],["c",-.06,-1.08,.57,-2.04,1.56,-2.37],["c",.18,-.06,.27,-.06,.63,-.06],["l",.45,0],["c",.06,.03,.09,.03,.09,0],["c",0,-.03,-.45,-.51,-.66,-.69],["c",-.87,-.69,-1.83,-1.05,-2.94,-1.11],["l",-.42,0],["l",0,7.17],["l",0,7.14],["l",.42,0],["c",.69,-.03,1.23,-.18,1.86,-.51],["c",1.05,-.51,1.89,-1.47,2.46,-2.7],["c",.15,-.33,.33,-.87,.39,-1.17],["c",.09,-.24,.15,-.36,.3,-.39],["c",.21,-.03,.42,.15,.39,.36],["c",-.03,.24,-.21,.78,-.39,1.2],["c",-.96,2.37,-2.94,3.9,-5.13,3.9],["l",-.3,0],["l",0,1.26],["l",0,1.23],["l",-.06,.09],["c",-.09,.06,-.09,.06,-.45,.06],["c",-.39,0,-.39,0,-.48,-.06],["l",-.06,-.09],["l",0,-1.29],["l",0,-1.29],["l",-.21,-.03],["c",-1.23,-.21,-2.31,-.63,-3.21,-1.29],["c",-.15,-.09,-.45,-.36,-.66,-.57],["c",-1.11,-1.11,-1.8,-2.61,-2.04,-4.56],["c",-.06,-.6,-.06,-2.01,0,-2.61],["c",.24,-1.95,.93,-3.45,2.04,-4.59],["c",.42,-.39,.78,-.66,1.26,-.93],["c",.75,-.45,1.65,-.75,2.61,-.9],["l",.21,-.03],["l",0,-1.29],["l",0,-1.29],["z"],["m",-.06,10.44],["c",0,-5.58,0,-6.99,-.03,-6.99],["c",-.15,0,-.63,.27,-.87,.45],["c",-.45,.36,-.75,.93,-.93,1.77],["c",-.18,.81,-.24,1.8,-.24,4.74],["c",0,2.97,.06,3.96,.24,4.77],["c",.24,1.08,.66,1.68,1.41,2.07],["c",.12,.06,.3,.12,.33,.15],["l",.09,0],["l",0,-6.96],["z"]],w:13.038,h:20.97},"timesig.imperfectum":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},"timesig.imperfectum2":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},"timesig.perfectum":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},"timesig.perfectum2":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},f:{d:[["M",9.93,-14.28],["c",1.53,-.18,2.88,.45,3.12,1.5],["c",.12,.51,0,1.32,-.27,1.86],["c",-.15,.3,-.42,.57,-.63,.69],["c",-.69,.36,-1.56,.03,-1.83,-.69],["c",-.09,-.24,-.09,-.69,0,-.87],["c",.06,-.12,.21,-.24,.45,-.42],["c",.42,-.24,.57,-.45,.6,-.72],["c",.03,-.33,-.09,-.39,-.63,-.42],["c",-.3,0,-.45,0,-.6,.03],["c",-.81,.21,-1.35,.93,-1.74,2.46],["c",-.06,.27,-.48,2.25,-.48,2.31],["c",0,.03,.39,.03,.9,.03],["c",.72,0,.9,0,.99,.06],["c",.42,.15,.45,.72,.03,.9],["c",-.12,.06,-.24,.06,-1.17,.06],["l",-1.05,0],["l",-.78,2.55],["c",-.45,1.41,-.87,2.79,-.96,3.06],["c",-.87,2.37,-2.37,4.74,-3.78,5.91],["c",-1.05,.9,-2.04,1.23,-3.09,1.08],["c",-1.11,-.18,-1.89,-.78,-2.04,-1.59],["c",-.12,-.66,.15,-1.71,.54,-2.19],["c",.69,-.75,1.86,-.54,2.22,.39],["c",.06,.15,.09,.27,.09,.48],["c",0,.24,-.03,.27,-.12,.42],["c",-.03,.09,-.15,.18,-.27,.27],["c",-.09,.06,-.27,.21,-.36,.27],["c",-.24,.18,-.36,.36,-.39,.6],["c",-.03,.33,.09,.39,.63,.42],["c",.42,0,.63,-.03,.9,-.15],["c",.6,-.3,.96,-.96,1.38,-2.64],["c",.09,-.42,.63,-2.55,1.17,-4.77],["l",1.02,-4.08],["c",0,-.03,-.36,-.03,-.81,-.03],["c",-.72,0,-.81,0,-.93,-.06],["c",-.42,-.18,-.39,-.75,.03,-.9],["c",.09,-.06,.27,-.06,1.05,-.06],["l",.96,0],["l",0,-.09],["c",.06,-.18,.3,-.72,.51,-1.17],["c",1.2,-2.46,3.3,-4.23,5.34,-4.5],["z"]],w:16.155,h:19.445},m:{d:[["M",2.79,-8.91],["c",.09,0,.3,-.03,.45,-.03],["c",.24,.03,.3,.03,.45,.12],["c",.36,.15,.63,.54,.75,1.02],["l",.03,.21],["l",.33,-.3],["c",.69,-.69,1.38,-1.02,2.07,-1.02],["c",.27,0,.33,0,.48,.06],["c",.21,.09,.48,.36,.63,.6],["c",.03,.09,.12,.27,.18,.42],["c",.03,.15,.09,.27,.12,.27],["c",0,0,.09,-.09,.18,-.21],["c",.33,-.39,.87,-.81,1.29,-.99],["c",.78,-.33,1.47,-.21,2.01,.33],["c",.3,.33,.48,.69,.6,1.14],["c",.09,.42,.06,.54,-.54,3.06],["c",-.33,1.29,-.57,2.4,-.57,2.43],["c",0,.12,.09,.21,.21,.21],["c",.24,0,.75,-.3,1.2,-.72],["c",.45,-.39,.6,-.45,.78,-.27],["c",.18,.18,.09,.36,-.45,.87],["c",-1.05,.96,-1.83,1.47,-2.58,1.71],["c",-.93,.33,-1.53,.21,-1.8,-.33],["c",-.06,-.15,-.06,-.21,-.06,-.45],["c",0,-.24,.03,-.48,.6,-2.82],["c",.42,-1.71,.6,-2.64,.63,-2.79],["c",.03,-.57,-.3,-.75,-.84,-.48],["c",-.24,.12,-.54,.39,-.66,.63],["c",-.03,.09,-.42,1.38,-.9,3],["c",-.9,3.15,-.84,3,-1.14,3.15],["l",-.15,.09],["l",-.78,0],["c",-.6,0,-.78,0,-.84,-.06],["c",-.09,-.03,-.18,-.18,-.18,-.27],["c",0,-.03,.36,-1.38,.84,-2.97],["c",.57,-2.04,.81,-2.97,.84,-3.12],["c",.03,-.54,-.3,-.72,-.84,-.45],["c",-.24,.12,-.57,.42,-.66,.63],["c",-.06,.09,-.51,1.44,-1.05,2.97],["c",-.51,1.56,-.99,2.85,-.99,2.91],["c",-.06,.12,-.21,.24,-.36,.3],["c",-.12,.06,-.21,.06,-.9,.06],["c",-.6,0,-.78,0,-.84,-.06],["c",-.09,-.03,-.18,-.18,-.18,-.27],["c",0,-.03,.45,-1.38,.99,-2.97],["c",1.05,-3.18,1.05,-3.18,.93,-3.45],["c",-.12,-.27,-.39,-.3,-.72,-.15],["c",-.54,.27,-1.14,1.17,-1.56,2.4],["c",-.06,.15,-.15,.3,-.18,.36],["c",-.21,.21,-.57,.27,-.72,.09],["c",-.09,-.09,-.06,-.21,.06,-.63],["c",.48,-1.26,1.26,-2.46,2.01,-3.21],["c",.57,-.54,1.2,-.87,1.83,-1.02],["z"]],w:14.687,h:9.126},p:{d:[["M",1.92,-8.7],["c",.27,-.09,.81,-.06,1.11,.03],["c",.54,.18,.93,.51,1.17,.99],["c",.09,.15,.15,.33,.18,.36],["l",0,.12],["l",.3,-.27],["c",.66,-.6,1.35,-1.02,2.13,-1.2],["c",.21,-.06,.33,-.06,.78,-.06],["c",.45,0,.51,0,.84,.09],["c",1.29,.33,2.07,1.32,2.25,2.79],["c",.09,.81,-.09,2.01,-.45,2.79],["c",-.54,1.26,-1.86,2.55,-3.18,3.03],["c",-.45,.18,-.81,.24,-1.29,.24],["c",-.69,-.03,-1.35,-.18,-1.86,-.45],["c",-.3,-.15,-.51,-.18,-.69,-.09],["c",-.09,.03,-.18,.09,-.18,.12],["c",-.09,.12,-1.05,2.94,-1.05,3.06],["c",0,.24,.18,.48,.51,.63],["c",.18,.06,.54,.15,.75,.15],["c",.21,0,.36,.06,.42,.18],["c",.12,.18,.06,.42,-.12,.54],["c",-.09,.03,-.15,.03,-.78,0],["c",-1.98,-.15,-3.81,-.15,-5.79,0],["c",-.63,.03,-.69,.03,-.78,0],["c",-.24,-.15,-.24,-.57,.03,-.66],["c",.06,-.03,.48,-.09,.99,-.12],["c",.87,-.06,1.11,-.09,1.35,-.21],["c",.18,-.06,.33,-.18,.39,-.3],["c",.06,-.12,3.24,-9.42,3.27,-9.6],["c",.06,-.33,.03,-.57,-.15,-.69],["c",-.09,-.06,-.12,-.06,-.3,-.06],["c",-.69,.06,-1.53,1.02,-2.28,2.61],["c",-.09,.21,-.21,.45,-.27,.51],["c",-.09,.12,-.33,.24,-.48,.24],["c",-.18,0,-.36,-.15,-.36,-.3],["c",0,-.24,.78,-1.83,1.26,-2.55],["c",.72,-1.11,1.47,-1.74,2.28,-1.92],["z"],["m",5.37,1.47],["c",-.27,-.12,-.75,-.03,-1.14,.21],["c",-.75,.48,-1.47,1.68,-1.89,3.15],["c",-.45,1.47,-.42,2.34,0,2.7],["c",.45,.39,1.26,.21,1.83,-.36],["c",.51,-.51,.99,-1.68,1.38,-3.27],["c",.3,-1.17,.33,-1.74,.15,-2.13],["c",-.09,-.15,-.15,-.21,-.33,-.3],["z"]],w:14.689,h:13.127},r:{d:[["M",6.33,-9.12],["c",.27,-.03,.93,0,1.2,.06],["c",.84,.21,1.23,.81,1.02,1.53],["c",-.24,.75,-.9,1.17,-1.56,.96],["c",-.33,-.09,-.51,-.3,-.66,-.75],["c",-.03,-.12,-.09,-.24,-.12,-.3],["c",-.09,-.15,-.3,-.24,-.48,-.24],["c",-.57,0,-1.38,.54,-1.65,1.08],["c",-.06,.15,-.33,1.17,-.9,3.27],["c",-.57,2.31,-.81,3.12,-.87,3.21],["c",-.03,.06,-.12,.15,-.18,.21],["l",-.12,.06],["l",-.81,.03],["c",-.69,0,-.81,0,-.9,-.03],["c",-.09,-.06,-.18,-.21,-.18,-.3],["c",0,-.06,.39,-1.62,.9,-3.51],["c",.84,-3.24,.87,-3.45,.87,-3.72],["c",0,-.21,0,-.27,-.03,-.36],["c",-.12,-.15,-.21,-.24,-.42,-.24],["c",-.24,0,-.45,.15,-.78,.42],["c",-.33,.36,-.45,.54,-.72,1.14],["c",-.03,.12,-.21,.24,-.36,.27],["c",-.12,0,-.15,0,-.24,-.06],["c",-.18,-.12,-.18,-.21,-.06,-.54],["c",.21,-.57,.42,-.93,.78,-1.32],["c",.54,-.51,1.2,-.81,1.95,-.87],["c",.81,-.03,1.53,.3,1.92,.87],["l",.12,.18],["l",.09,-.09],["c",.57,-.45,1.41,-.84,2.19,-.96],["z"]],w:9.41,h:9.132},s:{d:[["M",4.47,-8.73],["c",.09,0,.36,-.03,.57,-.03],["c",.75,.03,1.29,.24,1.71,.63],["c",.51,.54,.66,1.26,.36,1.83],["c",-.24,.42,-.63,.57,-1.11,.42],["c",-.33,-.09,-.6,-.36,-.6,-.57],["c",0,-.03,.06,-.21,.15,-.39],["c",.12,-.21,.15,-.33,.18,-.48],["c",0,-.24,-.06,-.48,-.15,-.6],["c",-.15,-.21,-.42,-.24,-.75,-.15],["c",-.27,.06,-.48,.18,-.69,.36],["c",-.39,.39,-.51,.96,-.33,1.38],["c",.09,.21,.42,.51,.78,.72],["c",1.11,.69,1.59,1.11,1.89,1.68],["c",.21,.39,.24,.78,.15,1.29],["c",-.18,1.2,-1.17,2.16,-2.52,2.52],["c",-1.02,.24,-1.95,.12,-2.7,-.42],["c",-.72,-.51,-.99,-1.47,-.6,-2.19],["c",.24,-.48,.72,-.63,1.17,-.42],["c",.33,.18,.54,.45,.57,.81],["c",0,.21,-.03,.3,-.33,.51],["c",-.33,.24,-.39,.42,-.27,.69],["c",.06,.15,.21,.27,.45,.33],["c",.3,.09,.87,.09,1.2,0],["c",.75,-.21,1.23,-.72,1.29,-1.35],["c",.03,-.42,-.15,-.81,-.54,-1.2],["c",-.24,-.24,-.48,-.42,-1.41,-1.02],["c",-.69,-.42,-1.05,-.93,-1.05,-1.47],["c",0,-.39,.12,-.87,.3,-1.23],["c",.27,-.57,.78,-1.05,1.38,-1.35],["c",.24,-.12,.63,-.27,.9,-.3],["z"]],w:6.632,h:8.758},z:{d:[["M",2.64,-7.95],["c",.36,-.09,.81,-.03,1.71,.27],["c",.78,.21,.96,.27,1.74,.3],["c",.87,.06,1.02,.03,1.38,-.21],["c",.21,-.15,.33,-.15,.48,-.06],["c",.15,.09,.21,.3,.15,.45],["c",-.03,.06,-1.26,1.26,-2.76,2.67],["l",-2.73,2.55],["l",.54,.03],["c",.54,.03,.72,.03,2.01,.15],["c",.36,.03,.9,.06,1.2,.09],["c",.66,0,.81,-.03,1.02,-.24],["c",.3,-.3,.39,-.72,.27,-1.23],["c",-.06,-.27,-.06,-.27,-.03,-.39],["c",.15,-.3,.54,-.27,.69,.03],["c",.15,.33,.27,1.02,.27,1.5],["c",0,1.47,-1.11,2.7,-2.52,2.79],["c",-.57,.03,-1.02,-.09,-2.01,-.51],["c",-1.02,-.42,-1.23,-.48,-2.13,-.54],["c",-.81,-.06,-.96,-.03,-1.26,.18],["c",-.12,.06,-.24,.12,-.27,.12],["c",-.27,0,-.45,-.3,-.36,-.51],["c",.03,-.06,1.32,-1.32,2.91,-2.79],["l",2.88,-2.73],["c",-.03,0,-.21,.03,-.42,.06],["c",-.21,.03,-.78,.09,-1.23,.12],["c",-1.11,.12,-1.23,.15,-1.95,.27],["c",-.72,.15,-1.17,.18,-1.29,.09],["c",-.27,-.18,-.21,-.75,.12,-1.26],["c",.39,-.6,.93,-1.02,1.59,-1.2],["z"]],w:8.573,h:8.743},"+":{d:[["M",3.48,-9.3],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["l",.06,.15],["l",0,1.29],["l",0,1.29],["l",1.29,0],["c",1.23,0,1.29,0,1.41,.06],["c",.06,.03,.15,.09,.18,.12],["c",.12,.09,.21,.33,.21,.48],["c",0,.15,-.09,.39,-.21,.48],["c",-.03,.03,-.12,.09,-.18,.12],["c",-.12,.06,-.18,.06,-1.41,.06],["l",-1.29,0],["l",0,1.29],["c",0,1.23,0,1.29,-.06,1.41],["c",-.09,.18,-.15,.24,-.3,.33],["c",-.21,.09,-.39,.09,-.57,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.06,-.12,-.06,-.18,-.06,-1.41],["l",0,-1.29],["l",-1.29,0],["c",-1.23,0,-1.29,0,-1.41,-.06],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.09,-.18,-.09,-.36,0,-.54],["c",.09,-.18,.15,-.24,.33,-.33],["l",.15,-.06],["l",1.26,0],["l",1.29,0],["l",0,-1.29],["c",0,-1.23,0,-1.29,.06,-1.41],["c",.09,-.18,.15,-.24,.33,-.33],["z"]],w:7.507,h:7.515},",":{d:[["M",1.85,-3.36],["c",.57,-.15,1.17,.03,1.59,.45],["c",.45,.45,.6,.96,.51,1.89],["c",-.09,1.23,-.42,2.46,-.99,3.93],["c",-.3,.72,-.72,1.62,-.78,1.68],["c",-.18,.21,-.51,.18,-.66,-.06],["c",-.03,-.06,-.06,-.15,-.06,-.18],["c",0,-.06,.12,-.33,.24,-.63],["c",.84,-1.8,1.02,-2.61,.69,-3.24],["c",-.12,-.24,-.27,-.36,-.75,-.6],["c",-.36,-.15,-.42,-.21,-.6,-.39],["c",-.69,-.69,-.69,-1.71,0,-2.4],["c",.21,-.21,.51,-.39,.81,-.45],["z"]],w:3.452,h:8.143},"-":{d:[["M",.18,-5.34],["c",.09,-.06,.15,-.06,2.31,-.06],["c",2.46,0,2.37,0,2.46,.21],["c",.12,.21,.03,.42,-.15,.54],["c",-.09,.06,-.15,.06,-2.28,.06],["c",-2.16,0,-2.22,0,-2.31,-.06],["c",-.27,-.15,-.27,-.54,-.03,-.69],["z"]],w:5.001,h:.81},".":{d:[["M",1.32,-3.36],["c",1.05,-.27,2.1,.57,2.1,1.65],["c",0,1.08,-1.05,1.92,-2.1,1.65],["c",-.9,-.21,-1.5,-1.14,-1.26,-2.04],["c",.12,-.63,.63,-1.11,1.26,-1.26],["z"]],w:3.413,h:3.402},"scripts.wedge":{d:[["M",-3.66,-7.44],["c",.06,-.09,0,-.09,.81,.03],["c",1.86,.3,3.84,.3,5.73,0],["c",.78,-.12,.72,-.12,.78,-.03],["c",.15,.15,.12,.24,-.24,.6],["c",-.93,.93,-1.98,2.76,-2.67,4.62],["c",-.3,.78,-.51,1.71,-.51,2.13],["c",0,.15,0,.18,-.06,.27],["c",-.12,.09,-.24,.09,-.36,0],["c",-.06,-.09,-.06,-.12,-.06,-.27],["c",0,-.42,-.21,-1.35,-.51,-2.13],["c",-.69,-1.86,-1.74,-3.69,-2.67,-4.62],["c",-.36,-.36,-.39,-.45,-.24,-.6],["z"]],w:7.49,h:7.752},"scripts.thumb":{d:[["M",-.54,-3.69],["c",.15,-.03,.36,-.06,.51,-.06],["c",1.44,0,2.58,1.11,2.94,2.85],["c",.09,.48,.09,1.32,0,1.8],["c",-.27,1.41,-1.08,2.43,-2.16,2.73],["l",-.18,.06],["l",0,.12],["c",.03,.06,.06,.45,.09,.87],["c",.03,.57,.03,.78,0,.84],["c",-.09,.27,-.39,.48,-.66,.48],["c",-.27,0,-.57,-.21,-.66,-.48],["c",-.03,-.06,-.03,-.27,0,-.84],["c",.03,-.42,.06,-.81,.09,-.87],["l",0,-.12],["l",-.18,-.06],["c",-1.08,-.3,-1.89,-1.32,-2.16,-2.73],["c",-.09,-.48,-.09,-1.32,0,-1.8],["c",.15,-.84,.51,-1.53,1.02,-2.04],["c",.39,-.39,.84,-.63,1.35,-.75],["z"],["m",1.05,.9],["c",-.15,-.09,-.21,-.09,-.45,-.12],["c",-.15,0,-.3,.03,-.39,.03],["c",-.57,.18,-.9,.72,-1.08,1.74],["c",-.06,.48,-.06,1.8,0,2.28],["c",.15,.9,.42,1.44,.9,1.65],["c",.18,.09,.21,.09,.51,.09],["c",.3,0,.33,0,.51,-.09],["c",.48,-.21,.75,-.75,.9,-1.65],["c",.03,-.27,.03,-.54,.03,-1.14],["c",0,-.6,0,-.87,-.03,-1.14],["c",-.15,-.9,-.45,-1.44,-.9,-1.65],["z"]],w:5.955,h:9.75},"scripts.open":{d:[["M",-.54,-3.69],["c",.15,-.03,.36,-.06,.51,-.06],["c",1.44,0,2.58,1.11,2.94,2.85],["c",.09,.48,.09,1.32,0,1.8],["c",-.33,1.74,-1.47,2.85,-2.91,2.85],["c",-1.44,0,-2.58,-1.11,-2.91,-2.85],["c",-.09,-.48,-.09,-1.32,0,-1.8],["c",.15,-.84,.51,-1.53,1.02,-2.04],["c",.39,-.39,.84,-.63,1.35,-.75],["z"],["m",1.11,.9],["c",-.21,-.09,-.27,-.09,-.51,-.12],["c",-.3,0,-.42,.03,-.66,.15],["c",-.24,.12,-.51,.39,-.66,.63],["c",-.54,.93,-.63,2.64,-.21,3.81],["c",.21,.54,.51,.9,.93,1.11],["c",.21,.09,.24,.09,.54,.09],["c",.3,0,.33,0,.54,-.09],["c",.42,-.21,.72,-.57,.93,-1.11],["c",.36,-.99,.36,-2.37,0,-3.36],["c",-.21,-.54,-.51,-.9,-.9,-1.11],["z"]],w:5.955,h:7.5},"scripts.longphrase":{d:[["M",1.47,-15.09],["c",.36,-.09,.66,-.18,.69,-.18],["c",.06,0,.06,.54,.06,11.25],["l",0,11.25],["l",-.63,.15],["c",-.66,.18,-1.44,.39,-1.5,.39],["c",-.03,0,-.03,-3.39,-.03,-11.25],["l",0,-11.25],["l",.36,-.09],["c",.21,-.06,.66,-.18,1.05,-.27],["z"]],w:2.16,h:23.04},"scripts.mediumphrase":{d:[["M",1.47,-7.59],["c",.36,-.09,.66,-.18,.69,-.18],["c",.06,0,.06,.39,.06,7.5],["l",0,7.5],["l",-.63,.15],["c",-.66,.18,-1.44,.39,-1.5,.39],["c",-.03,0,-.03,-2.28,-.03,-7.5],["l",0,-7.5],["l",.36,-.09],["c",.21,-.06,.66,-.18,1.05,-.27],["z"]],w:2.16,h:15.54},"scripts.shortphrase":{d:[["M",1.47,-7.59],["c",.36,-.09,.66,-.18,.69,-.18],["c",.06,0,.06,.21,.06,3.75],["l",0,3.75],["l",-.42,.09],["c",-.57,.18,-1.65,.45,-1.71,.45],["c",-.03,0,-.03,-.72,-.03,-3.75],["l",0,-3.75],["l",.36,-.09],["c",.21,-.06,.66,-.18,1.05,-.27],["z"]],w:2.16,h:8.04},"scripts.snap":{d:[["M",4.5,-3.39],["c",.36,-.03,.96,-.03,1.35,0],["c",1.56,.15,3.15,.9,4.2,2.01],["c",.24,.27,.33,.42,.33,.6],["c",0,.27,.03,.24,-2.46,2.22],["c",-1.29,1.02,-2.4,1.86,-2.49,1.92],["c",-.18,.09,-.3,.09,-.48,0],["c",-.09,-.06,-1.2,-.9,-2.49,-1.92],["c",-2.49,-1.98,-2.46,-1.95,-2.46,-2.22],["c",0,-.18,.09,-.33,.33,-.6],["c",1.05,-1.08,2.64,-1.86,4.17,-2.01],["z"],["m",1.29,1.17],["c",-1.47,-.15,-2.97,.3,-4.14,1.2],["l",-.18,.15],["l",.06,.09],["c",.15,.12,3.63,2.85,3.66,2.85],["c",.03,0,3.51,-2.73,3.66,-2.85],["l",.06,-.09],["l",-.18,-.15],["c",-.84,-.66,-1.89,-1.08,-2.94,-1.2],["z"]],w:10.38,h:6.84}};t["noteheads.slash.whole"]={d:[["M",5,-5],["l",1,1],["l",-5,5],["l",-1,-1],["z"],["m",4,6],["l",-5,-5],["l",2,-2],["l",5,5],["z"],["m",0,-2],["l",1,1],["l",-5,5],["l",-1,-1],["z"],["m",-4,6],["l",-5,-5],["l",2,-2],["l",5,5],["z"]],w:10.81,h:15.63},t["noteheads.slash.quarter"]={d:[["M",9,-6],["l",0,4],["l",-9,9],["l",0,-4],["z"]],w:9,h:9},t["noteheads.harmonic.quarter"]={d:[["M",3.63,-4.02],["c",.09,-.06,.18,-.09,.24,-.03],["c",.03,.03,.87,.93,1.83,2.01],["c",1.5,1.65,1.8,1.98,1.8,2.04],["c",0,.06,-.3,.39,-1.8,2.04],["c",-.96,1.08,-1.8,1.98,-1.83,2.01],["c",-.06,.06,-.15,.03,-.24,-.03],["c",-.12,-.09,-3.54,-3.84,-3.6,-3.93],["c",-.03,-.03,-.03,-.09,-.03,-.15],["c",.03,-.06,3.45,-3.84,3.63,-3.96],["z"]],w:7.5,h:8.165},t["noteheads.triangle.quarter"]={d:[["M",0,4],["l",9,0],["l",-4.5,-9],["z"]],w:9,h:9};var a=function(i){for(var c=[],u=0,f=i.length;u<f;u++){c[u]=[];for(var g=0,d=i[u].length;g<d;g++)c[u][g]=i[u][g]}return c},n=function(i,c,u){for(var f=0,g=i.length;f<g;f++){var d=i[f],p,l;for(p=1,l=d.length;p<l;p++)d[p]*=p%2?c:u}},r={printSymbol:function(i,c,u,f,g){if(!t[u])return null;var d=a(t[u].d);d[0][1]+=i,d[0][2]+=c;for(var p="",l=0;l<d.length;l++)p+=d[l].join(" ");return g.path=p,f.path(g)},getPathForSymbol:function(i,c,u,f,g){if(f=f||1,g=g||1,!t[u])return null;var d=a(t[u].d);return(f!==1||g!==1)&&n(d,f,g),d[0][1]+=i,d[0][2]+=c,d},getSymbolWidth:function(i){return t[i]?t[i].w:0},symbolHeightInPitches:function(i){var c=t[i]?t[i].h:0;return c/e.STEP},getSymbolAlign:function(i){return i.substring(0,7)==="scripts"&&i!=="scripts.roll"?"center":"left"},getYCorr:function(i){switch(i){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":return-2;case"timesig.common":case"timesig.cut":return 0;case"flags.d32nd":return-1;case"flags.d64th":return-2;case"flags.u32nd":return 1;case"flags.u64th":return 3;case"rests.whole":return 1;case"rests.half":return-1;case"rests.8th":return-1;case"rests.quarter":return-1;case"rests.16th":return-1;case"rests.32nd":return-1;case"rests.64th":return-1;case"f":case"m":case"p":case"s":case"z":return-4;case"scripts.trill":case"scripts.upbow":case"scripts.downbow":return-2;case"scripts.ufermata":case"scripts.wedge":case"scripts.roll":case"scripts.shortphrase":case"scripts.longphrase":return-1;case"scripts.dfermata":return 1;default:return 0}},setSymbol:function(i,c){t[i]=c}};return l0=r,l0}var u0,ys;function Tg(){if(ys)return u0;ys=1;var e=Pt(),t=pt(),a=at(),n=function(i,c){var u,f=0;i.el_type="clef";var g=new e(i,0,10,"staff-extra clef",c);switch(g.isClef=!0,i.type){case"treble":u="clefs.G";break;case"tenor":u="clefs.C";break;case"alto":u="clefs.C";break;case"bass":u="clefs.F";break;case"treble+8":u="clefs.G",f=1;break;case"tenor+8":u="clefs.C",f=1;break;case"bass+8":u="clefs.F",f=1;break;case"alto+8":u="clefs.C",f=1;break;case"treble-8":u="clefs.G",f=-1;break;case"tenor-8":u="clefs.C",f=-1;break;case"bass-8":u="clefs.F",f=-1;break;case"alto-8":u="clefs.C",f=-1;break;case"none":return null;case"perc":u="clefs.perc";break;default:g.addFixed(new a("clef="+i.type,0,0,void 0,{type:"debug"}))}var d=5;if(u){var p=t.symbolHeightInPitches(u),l=r(u);if(g.addRight(new a(u,d,t.getSymbolWidth(u),i.clefPos,{top:p+i.clefPos+l,bottom:i.clefPos+l})),f!==0){var o=.6666666666666666,h=(t.getSymbolWidth(u)-t.getSymbolWidth("8")*o)/2,s=f>0?g.top+3:g.bottom-1,v=f>0?g.top+3:g.bottom-3,y=v-2;i.type==="bass-8"&&(s=3,h=0),g.addRight(new a("8",d+h,t.getSymbolWidth("8")*o,s,{scalex:o,scaley:o,top:v,bottom:y}))}}return g};function r(i){switch(i){case"clefs.G":return-5;case"clefs.C":return-4;case"clefs.F":return-4;case"clefs.perc":return-2;default:return 0}}return u0=n,u0}var h0,ws;function Eg(){if(ws)return h0;ws=1;var e=Pt(),t=pt(),a=at(),n=function(r,i){if(r.el_type="keySignature",!r.accidentals||r.accidentals.length===0)return null;var c=new e(r,0,10,"staff-extra key-signature",i);c.isKeySig=!0;var u=0;return r.accidentals.forEach(function(f){var g,d=0;switch(f.acc){case"sharp":g="accidentals.sharp",d=-3;break;case"natural":g="accidentals.nat";break;case"flat":g="accidentals.flat",d=-1.2;break;case"quartersharp":g="accidentals.halfsharp",d=-2.5;break;case"quarterflat":g="accidentals.halfflat",d=-1.2;break;default:g="accidentals.flat"}c.addRight(new a(g,u,t.getSymbolWidth(g),f.verticalPos,{thickness:t.symbolHeightInPitches(g),top:f.verticalPos+t.symbolHeightInPitches(g)+d,bottom:f.verticalPos+d})),u+=t.getSymbolWidth(g)+2},this),c};return h0=n,h0}var f0,_s;function Ag(){if(_s)return f0;_s=1;var e=pt(),t=at(),a=function(n,r,i,c){c||(c={});var u=c.dir!==void 0?c.dir:null,f=c.headx!==void 0?c.headx:0,g=c.extrax!==void 0?c.extrax:0,d=c.flag!==void 0?c.flag:null,p=c.dot!==void 0?c.dot:0,l=c.dotshiftx!==void 0?c.dotshiftx:0,o=c.scale!==void 0?c.scale:1,h=c.accidentalSlot!==void 0?c.accidentalSlot:[],s=c.shouldExtendStem!==void 0?c.shouldExtendStem:!1,v=c.printAccidentals!==void 0?c.printAccidentals:!0,y=i.verticalPos,m,_=0,k=0,x=0;if(r===void 0)n.addFixed(new t("pitch is undefined",0,0,0,{type:"debug"}));else if(r==="")m=new t(null,0,0,y);else{var R=f;if(i.printer_shift){var I=i.printer_shift==="same"?1:0;R=u==="down"?-e.getSymbolWidth(r)*o+I:e.getSymbolWidth(r)*o-I}var b={scalex:o,scaley:o,thickness:e.symbolHeightInPitches(r)*o,name:i.name};if(m=new t(r,R,e.getSymbolWidth(r)*o,y,b),m.stemDir=u,d){var A=y+(u==="down"?-7:7)*o;s&&(u==="down"&&A>6&&(A=6),u==="up"&&A<6&&(A=6));var N=u==="down"?f:f+m.w-.6;n.addRight(new t(d,N,e.getSymbolWidth(d)*o,A,{scalex:o,scaley:o}))}for(k=m.w+l-2+5*p;p>0;p--){var M=1-Math.abs(y)%2;n.addRight(new t("dots.dot",m.w+l-2+5*p,e.getSymbolWidth("dots.dot"),y+M))}}if(m&&(m.highestVert=i.highestVert),v&&i.accidental){var z;switch(i.accidental){case"quartersharp":z="accidentals.halfsharp";break;case"dblsharp":z="accidentals.dblsharp";break;case"sharp":z="accidentals.sharp";break;case"quarterflat":z="accidentals.halfflat";break;case"flat":z="accidentals.flat";break;case"dblflat":z="accidentals.dblflat";break;case"natural":z="accidentals.nat"}for(var L=!1,E=g,T=0;T<h.length;T++)if(y-h[T][0]>=6){h[T][0]=y,E=h[T][1],L=!0;break}L===!1&&(E-=e.getSymbolWidth(z)*o+2,h.push([y,E]),_=e.getSymbolWidth(z)*o+2);var P=e.symbolHeightInPitches(z);n.addExtra(new t(z,E,e.getSymbolWidth(z),y,{scalex:o,scaley:o,top:y+P/2,bottom:y-P/2})),x=e.getSymbolWidth(z)/2}return{notehead:m,accidentalshiftx:_,dotshiftx:k,extraLeft:x}};return f0=a,f0}var d0,ks;function Mg(){if(ks)return d0;ks=1;var e=Pt(),t=pt(),a=at(),n=function(r,i){r.el_type="timeSignature";var c=new e(r,0,10,"staff-extra time-signature",i);if(r.type==="specified")for(var u=0,f=0;f<r.value.length;f++)if(f!==0&&(c.addRight(new a("+",u+1,t.getSymbolWidth("+"),6,{thickness:t.symbolHeightInPitches("+")})),u+=t.getSymbolWidth("+")+2),r.value[f].den){for(var g=0,d=0;d<r.value[f].num.length;d++)g+=t.getSymbolWidth(r.value[f].num[d]);var p=0;for(d=0;d<r.value[f].num.length;d++)p+=t.getSymbolWidth(r.value[f].den[d]);var l=Math.max(g,p);c.addRight(new a(r.value[f].num,u+(l-g)/2,g,8,{thickness:t.symbolHeightInPitches(r.value[f].num[0])})),c.addRight(new a(r.value[f].den,u+(l-p)/2,p,4,{thickness:t.symbolHeightInPitches(r.value[f].den[0])})),u+=l}else{for(var o=0,h=0;h<r.value[f].num.length;h++)o+=t.getSymbolWidth(r.value[f].num[h]);c.addRight(new a(r.value[f].num,u,o,6,{thickness:t.symbolHeightInPitches(r.value[f].num[0])})),u+=o}else r.type==="common_time"?c.addRight(new a("timesig.common",0,t.getSymbolWidth("timesig.common"),6,{thickness:t.symbolHeightInPitches("timesig.common")})):r.type==="cut_time"?c.addRight(new a("timesig.cut",0,t.getSymbolWidth("timesig.cut"),6,{thickness:t.symbolHeightInPitches("timesig.cut")})):r.type==="tempus_imperfectum"?c.addRight(new a("timesig.imperfectum",0,t.getSymbolWidth("timesig.imperfectum"),6,{thickness:t.symbolHeightInPitches("timesig.imperfectum")})):r.type==="tempus_imperfectum_prolatio"?c.addRight(new a("timesig.imperfectum2",0,t.getSymbolWidth("timesig.imperfectum2"),6,{thickness:t.symbolHeightInPitches("timesig.imperfectum2")})):r.type==="tempus_perfectum"?c.addRight(new a("timesig.perfectum",0,t.getSymbolWidth("timesig.perfectum"),6,{thickness:t.symbolHeightInPitches("timesig.perfectum")})):r.type==="tempus_perfectum_prolatio"?c.addRight(new a("timesig.perfectum2",0,t.getSymbolWidth("timesig.perfectum2"),6,{thickness:t.symbolHeightInPitches("timesig.perfectum2")})):console.log("time signature:",r);return c};return d0=n,d0}var p0,xs;function Ng(){if(xs)return p0;xs=1;var e=function(a,n,r){this.type="DynamicDecoration",this.anchor=a,this.dec=n,r==="below"?this.volumeHeightBelow=6:this.volumeHeightAbove=6,this.pitch=void 0};return p0=e,p0}var g0,Cs;function Pg(){if(Cs)return g0;Cs=1;var e=function(a,n,r,i){this.type="CrescendoElem",this.anchor1=a,this.anchor2=n,this.dir=r,i==="above"?this.dynamicHeightAbove=6:this.dynamicHeightBelow=6,this.pitch=void 0};return g0=e,g0}var v0,Ss;function zg(){if(Ss)return v0;Ss=1;var e=function(a,n){this.type="GlissandoElem",this.anchor1=a,this.anchor2=n};return v0=e,v0}var m0,Ts;function Rl(){if(Ts)return m0;Ts=1;var e=function(a){this.type="TieElem",this.anchor1=a.anchor1,this.anchor2=a.anchor2,a.isGrace&&(this.isGrace=!0),a.fixedY&&(this.fixedY=!0),a.stemDir&&(this.stemDir=a.stemDir),a.voiceNumber!==void 0&&(this.voiceNumber=a.voiceNumber),a.style!==void 0&&(this.dotted=!0),this.internalNotes=[]};return e.prototype.addInternalNote=function(t){this.internalNotes.push(t)},e.prototype.setEndAnchor=function(t){this.anchor2=t,this.anchor1?(this.top=Math.max(this.anchor1.pitch,this.anchor2.pitch)+4,this.bottom=Math.min(this.anchor1.pitch,this.anchor2.pitch)-4):(this.top=this.anchor2.pitch+4,this.bottom=this.anchor2.pitch-4)},e.prototype.setStartX=function(t){this.startLimitX=t},e.prototype.setEndX=function(t){this.endLimitX=t},e.prototype.setHint=function(){this.hint=!0},e.prototype.calcTieDirection=function(){if(this.isGrace)this.above=!1;else if(this.voiceNumber===0)this.above=!0;else if(this.voiceNumber>0)this.above=!1;else{var t;this.anchor1?t=this.anchor1.pitch:this.anchor2?t=this.anchor2.pitch:t=14,this.anchor1&&this.anchor1.stemDir==="down"&&this.anchor2&&this.anchor2.stemDir==="down"?this.above=!0:this.anchor1&&this.anchor1.stemDir==="up"&&this.anchor2&&this.anchor2.stemDir==="up"?this.above=!1:this.anchor1&&this.anchor2?this.above=t>=6:this.anchor1?this.above=this.anchor1.stemDir==="down":this.anchor2?this.above=this.anchor2.stemDir==="down":this.above=t>=6}},e.prototype.calcSlurDirection=function(){if(this.isGrace)this.above=!1;else if(this.voiceNumber===0)this.above=!0;else if(this.voiceNumber>0)this.above=!1;else{var t=!1;this.anchor1&&this.anchor1.stemDir==="down"&&(t=!0),this.anchor2&&this.anchor2.stemDir==="down"&&(t=!0);for(var a=0;a<this.internalNotes.length;a++){var n=this.internalNotes[a];n.stemDir==="down"&&(t=!0)}this.above=t}},e.prototype.calcX=function(t,a){this.anchor1?(this.startX=this.anchor1.x,this.anchor1.scalex<1&&(this.startX-=3)):this.startLimitX?this.startX=this.startLimitX.x+this.startLimitX.w:this.anchor2?this.startX=this.anchor2.x-20:this.startX=t,!this.anchor1&&this.dotted&&(this.startX-=3),this.anchor2?this.endX=this.anchor2.x:this.endLimitX?this.endX=this.endLimitX.x:this.endX=a},e.prototype.calcTieY=function(){this.anchor1?this.startY=this.anchor1.pitch:this.anchor2?this.startY=this.anchor2.pitch:this.startY=this.above?14:0,this.anchor2?this.endY=this.anchor2.pitch:this.anchor1?this.endY=this.anchor1.pitch:this.endY=this.above?14:0},e.prototype.calcSlurY=function(){if(this.anchor1&&this.anchor2){this.above&&this.anchor1.stemDir==="up"&&!this.fixedY?(this.startY=(this.anchor1.highestVert+this.anchor1.pitch)/2,this.startX+=this.anchor1.w/2):this.startY=this.anchor1.pitch;var t=this.anchor2.parent.beam&&this.anchor2.parent.beam.stemsUp&&this.anchor2.parent.beam.elems[0]!==this.anchor2.parent,a=(this.anchor2.highestVert+this.anchor2.pitch)/2;if(this.above&&this.anchor2.stemDir==="up"&&!this.fixedY&&!t&&a<this.startY?(this.endY=a,this.endX+=Math.round(this.anchor2.w/2)):this.endY=this.above&&t?this.anchor2.highestVert:this.anchor2.pitch,this.anchor1.scalex===1){var n=!!this.anchor1.parent.beam,r=!!this.anchor2.parent.beam;if(n){var i=this.anchor1.parent===this.anchor1.parent.beam.elems[this.anchor1.parent.beam.elems.length-1];i||(this.above?this.startY=this.anchor1.parent.fixed.t:this.startY=this.anchor1.parent.fixed.b)}if(r){var c=this.anchor2.parent===this.anchor2.parent.beam.elems[0];c||(this.above?this.endY=this.anchor2.parent.fixed.t:this.endY=this.anchor2.parent.fixed.b)}}}else this.anchor1?this.startY=this.endY=this.anchor1.pitch:this.anchor2?this.startY=this.endY=this.anchor2.pitch:(this.startY=this.above?14:0,this.endY=this.above?14:0)},e.prototype.avoidCollisionAbove=function(){if(this.above){for(var t=-50,a=0;a<this.internalNotes.length;a++)this.internalNotes[a].highestVert>t&&(t=this.internalNotes[a].highestVert);t>this.startY&&t>this.endY&&(this.startY=this.endY=t-1)}},e.prototype.getYBounds=function(){var t=10,a=1e3;this.isTie?(this.calcTieDirection(),this.calcX(t,a),this.calcTieY()):(this.calcSlurDirection(),this.calcX(t,a),this.calcSlurY());var n,r;return this.above?(r=Math.min(this.startY,this.endY),n=r+3):(n=Math.min(this.startY,this.endY),r=n-3),[n,r]},m0=e,m0}var b0,Es;function Ig(){if(Es)return b0;Es=1;var e=Ng(),t=Pg(),a=zg(),n=pt(),r=at(),i=Rl(),c=function(){this.startDiminuendoX=void 0,this.startCrescendoX=void 0,this.minTop=12,this.minBottom=0},u=function(l,o,h,s,v,y,m,_,k){for(var x,R=0;R<o.length;R++){if(o[R]==="staccato"||o[R]==="tenuto"||o[R]==="accent"&&!k){var I="scripts."+o[R];if(o[R]==="accent"&&(I="scripts.sforzato"),x===void 0?x=m==="down"?h+2:_-2:x=m==="down"?x+2:x-2,o[R]==="accent")m==="up"?x--:x++;else switch(x){case 2:case 4:case 6:case 8:case 10:m==="up"?x--:x++;break}h>9&&x++;var b=s/2;n.getSymbolAlign(I)!=="center"&&(b-=n.getSymbolWidth(I)/2),v.addFixedX(new r(I,b,n.getSymbolWidth(I),x))}if(o[R]==="slide"&&v.heads[0]){var A=v.heads[0].pitch;A-=2;var N=new r("",-y-15,0,A-1),M=new r("",-y-5,0,A+1);v.addFixedX(N),v.addFixedX(M),l.addOther(new i({anchor1:N,anchor2:M,fixedY:!0}))}}return x===void 0&&(x=h),{above:x,below:v.bottom}},f=function(l,o,h,s){for(var v=0;v<o.length;v++)switch(o[v]){case"p":case"mp":case"pp":case"ppp":case"pppp":case"f":case"ff":case"fff":case"ffff":case"sfz":case"mf":var y=new e(h,o[v],s);l.addOther(y)}},g=function(l,o,h,s,v){function y(){if(s.heads.length===0)return 10;for(var x=s.heads[0].pitch,R=1;R<s.heads.length;R++)x=Math.max(x,s.heads[R].pitch);return x}function m(){if(s.heads.length===0)return 2;for(var x=s.heads[0].pitch,R=1;R<s.heads.length;R++)x=Math.min(x,s.heads[R].pitch);return x}function _(x,R){var I=v==="down"?m()+1:y()+9;v!=="down"&&R===1&&I--;var b=h/2;b+=v==="down"?-5:3;for(var A=0;A<R;A++)I-=1,s.addFixedX(new r(x,b,n.getSymbolWidth(x),I))}for(var k=0;k<l.length;k++)switch(l[k]){case"/":_("flags.ugrace",1);break;case"//":_("flags.ugrace",2);break;case"///":_("flags.ugrace",3);break;case"////":_("flags.ugrace",4);break}},d=function(l,o,h,s,v,y,m,_){function k(M,z){M==="above"?s.above+=z:s.below-=z}function x(M){var z;return M==="above"?(z=s.above,z<y&&(z=y)):(z=s.below,z>m&&(z=m)),z}function R(M,z,L){var E=x(z),T=2,P=5;h.addFixedX(new r(M,o/2,0,E+T,{type:"decoration",klass:"ornament",thickness:3,anchor:L})),k(z,P)}function I(M,z){var L=o/2;n.getSymbolAlign(M)!=="center"&&(L-=n.getSymbolWidth(M)/2);var E=n.symbolHeightInPitches(M)+1,T=x(z);T=z==="above"?T+E/2:T-E/2,h.addFixedX(new r(M,L,n.getSymbolWidth(M),T,{klass:"ornament",thickness:n.symbolHeightInPitches(M),position:z})),k(z,E)}for(var b={"+":"scripts.stopped",open:"scripts.open",snap:"scripts.snap",wedge:"scripts.wedge",thumb:"scripts.thumb",shortphrase:"scripts.shortphrase",mediumphrase:"scripts.mediumphrase",longphrase:"scripts.longphrase",trill:"scripts.trill",trillh:"scripts.trill",roll:"scripts.roll",irishroll:"scripts.roll",marcato:"scripts.umarcato",dmarcato:"scripts.dmarcato",umarcato:"scripts.umarcato",turn:"scripts.turn",uppermordent:"scripts.prall",pralltriller:"scripts.prall",mordent:"scripts.mordent",lowermordent:"scripts.mordent",downbow:"scripts.downbow",upbow:"scripts.upbow",fermata:"scripts.ufermata",invertedfermata:"scripts.dfermata",breath:",",coda:"scripts.coda",segno:"scripts.segno"},A=!1,N=0;N<l.length;N++)switch(l[N]){case"0":case"1":case"2":case"3":case"4":case"5":case"D.C.":case"D.S.":R(l[N],v,"middle"),A=!0;break;case"D.C.alcoda":R("D.C. al coda",v,"end"),A=!0;break;case"D.C.alfine":R("D.C. al fine",v,"end"),A=!0;break;case"D.S.alcoda":R("D.S. al coda",v,"end"),A=!0;break;case"D.S.alfine":R("D.S. al fine",v,"end"),A=!0;break;case"fine":R("FINE",v,"middle"),A=!0;break;case"+":case"open":case"snap":case"wedge":case"thumb":case"shortphrase":case"mediumphrase":case"longphrase":case"trill":case"trillh":case"roll":case"irishroll":case"marcato":case"dmarcato":case"turn":case"uppermordent":case"pralltriller":case"mordent":case"lowermordent":case"downbow":case"upbow":case"fermata":case"breath":case"umarcato":case"coda":case"segno":I(b[l[N]],v),A=!0;break;case"invertedfermata":I(b[l[N]],"below"),A=!0;break;case"mark":h.klass="mark";break;case"accent":_&&(I("scripts.sforzato",v),A=!0);break}return A};function p(l,o,h){for(var s=0;s<l.length;s++)switch(l[s]){case"arpeggio":for(var v=o.abcelem.minpitch-1;v<=o.abcelem.maxpitch;v+=2)o.addExtra(new r("scripts.arpeggio",-n.getSymbolWidth("scripts.arpeggio")*2-h,0,v+2,{klass:"ornament",thickness:n.symbolHeightInPitches("scripts.arpeggio")}));break}}return c.prototype.dynamicDecoration=function(l,o,h,s){for(var v,y,m,_=0;_<o.length;_++)switch(o[_]){case"diminuendo(":this.startDiminuendoX=h,v=void 0;break;case"diminuendo)":v={start:this.startDiminuendoX,stop:h},this.startDiminuendoX=void 0;break;case"crescendo(":this.startCrescendoX=h,y=void 0;break;case"crescendo)":y={start:this.startCrescendoX,stop:h},this.startCrescendoX=void 0;break;case"~(":case"glissando(":this.startGlissandoX=h,m=void 0;break;case"~)":case"glissando)":m={start:this.startGlissandoX,stop:h},this.startGlissandoX=void 0;break}v&&l.addOther(new t(v.start,v.stop,">",s)),y&&l.addOther(new t(y.start,y.stop,"<",s)),m&&l.addOther(new a(m.start,m.stop))},c.prototype.createDecoration=function(l,o,h,s,v,y,m,_,k,x,R){k||(k={ornamentPosition:"above",volumePosition:x?"above":"below",dynamicPosition:x?"above":"below"}),f(l,o,v,k.volumePosition),this.dynamicDecoration(l,o,v,k.dynamicPosition),g(o,h,s,v,m);var I=u(l,o,h,s,v,y,m,_,R);I.above=Math.max(I.above,this.minTop),I.below=Math.min(I.below,_),d(o,s,v,I,k.ornamentPosition,this.minTop,_,R),p(o,v,y)},b0=c,b0}var y0,As;function Rg(){if(As)return y0;As=1;var e=function(a,n,r){this.type="EndingElem",this.text=a,this.anchor1=n,this.anchor2=r,this.endingHeightAbove=5,this.pitch=void 0};return y0=e,y0}var w0,Ms;function qg(){if(Ms)return w0;Ms=1;var e=function(t){for(var a=0,n=0;n<t.voices.length;n++){var r=t.voices[n].staff;t.voices[n].duplicate||(a+=r.top,a+=-r.bottom)}return a};return w0=e,w0}var _0,Ns;function Bg(){if(Ns)return _0;Ns=1;var e=qg(),t=function(a){this.getTextSize=a,this.voices=[],this.staffs=[],this.brace=void 0,this.bracket=void 0};return t.prototype.setLimit=function(a,n){n.specialY[a]&&(n.staff.specialY[a]?n.staff.specialY[a]=Math.max(n.staff.specialY[a],n.specialY[a]):n.staff.specialY[a]=n.specialY[a])},t.prototype.addVoice=function(a,n,r){var i=this.voices.length;this.voices[i]=a,this.staffs[n]?this.staffs[n].voices.push(i):this.staffs[this.staffs.length]={top:10,bottom:2,lines:r,voices:[i],specialY:{tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}},a.staff=this.staffs[n]},t.prototype.setHeight=function(){this.height=e(this)},t.prototype.setWidth=function(a){this.w=a;for(var n=0;n<this.voices.length;n++)this.voices[n].setWidth(a)},t.prototype.setStaffLimits=function(a){a.staff.top=Math.max(a.staff.top,a.top),a.staff.bottom=Math.min(a.staff.bottom,a.bottom),this.setLimit("tempoHeightAbove",a),this.setLimit("partHeightAbove",a),this.setLimit("volumeHeightAbove",a),this.setLimit("dynamicHeightAbove",a),this.setLimit("endingHeightAbove",a),this.setLimit("chordHeightAbove",a),this.setLimit("lyricHeightAbove",a),this.setLimit("lyricHeightBelow",a),this.setLimit("chordHeightBelow",a),this.setLimit("volumeHeightBelow",a),this.setLimit("dynamicHeightBelow",a)},_0=t,_0}var k0,Ps;function Lg(){if(Ps)return k0;Ps=1;var e=Pt(),t=at(),a=function(r,i,c){this.type="TempoElement",this.tempo=r,this.tempo.type="tempo",this.tuneNumber=i,this.totalHeightInPitches=6,this.tempoHeightAbove=this.totalHeightInPitches,this.pitch=void 0,this.tempo.duration&&!this.tempo.suppressBpm&&(this.note=this.createNote(c,r,i))};return a.prototype.setX=function(n){this.x=n},a.prototype.createNote=function(n,r,i){var c=.75,u=r.duration[0],f=new e(r,u,1,"tempo",i),g,d,p;u<=1/32?(p="noteheads.quarter",d="flags.u32nd",g=0):u<=1/16?(p="noteheads.quarter",d="flags.u16th",g=0):u<=3/32?(p="noteheads.quarter",d="flags.u16nd",g=1):u<=1/8?(p="noteheads.quarter",d="flags.u8th",g=0):u<=3/16?(p="noteheads.quarter",d="flags.u8th",g=1):u<=1/4?(p="noteheads.quarter",g=0):u<=3/8?(p="noteheads.quarter",g=1):u<=1/2?(p="noteheads.half",g=0):u<=3/4?(p="noteheads.half",g=1):u<=1?(p="noteheads.whole",g=0):u<=1.5?(p="noteheads.whole",g=1):u<=2?(p="noteheads.dbl",g=0):(p="noteheads.dbl",g=1);var l=n(f,p,{verticalPos:0},{dir:"up",flag:d,dot:g,scale:c}),o=l.notehead;f.addHead(o);var h;if(p!=="noteheads.whole"&&p!=="noteheads.dbl"){var s=.3333333333333333*c,v=5*c,y=o.dx+o.w,m=-.6;h=new t(null,y,0,s,{type:"stem",pitch2:v,linewidth:m}),f.addRight(h)}return f},k0=a,k0}var x0,zs;function Og(){if(zs)return x0;zs=1;var e=function(a,n,r){this.type="TripletElem",this.anchor1=n,this.number=a,this.durationClass=("d"+Math.round(n.parent.durationClass*1e3)/1e3).replace(/\./,"-"),this.middleElems=[],this.flatBeams=r.flatBeams};return e.prototype.isClosed=function(){return!!this.anchor2},e.prototype.middleNote=function(t){this.middleElems.push(t)},e.prototype.setCloseAnchor=function(t){this.anchor2=t,(!this.anchor1.parent.beam||this.anchor1.stemDir==="up")&&(this.endingHeightAbove=4)},x0=e,x0}var C0,Is;function Dg(){if(Is)return C0;Is=1;function e(a){switch(a){case"B#":return"H#";case"B♯":return"H♯";case"B":return"H";case"Bb":return"B";case"B♭":return"B"}return a}function t(a,n,r){var i=a.split(`
|
|
109
|
+
`,o=null,h=null,s=null,v=[],y=!1,m=n.parseOnly(g.abc)[0],_=m.getPickupLength()>0,k=0;k<m.lines.length;k++){var x=m.lines[k];if(x.staff)for(var R=0;R<1;R++)for(var I=x.staff[R],b=0;b<1;b++)for(var A=I.voices[b],N=0;N<A.length;N++){var M=A[N];if(s===null&&M.startChar>=0&&(s=M.startChar,M.chord===void 0?h=o:h=null),M.chord&&(o=M),M.el_type==="bar"){if(y){var z=g.abc.substring(s,M.endChar),L={abc:z};o=h&&h.chord&&h.chord.length>0?h.chord[0].name:null,o&&(L.lastChord=o),M.startEnding&&(L.startEnding=M.startEnding),M.endEnding&&(L.endEnding=M.endEnding),v.push(L),s=null,y=!1}}else M.el_type==="note"&&(y=!0)}}c.push({header:l,measures:v,hasPickup:_})}return c}})(),sn=n,sn}var on,gs;function xg(){if(gs)return on;gs=1;var e=_l(),{relativeMajor:t,transposeKey:a,relativeMode:n,isLegalMode:r}=wl(),i=yl(),c;return(function(){c=function(b,A,N){if(A==="TEST")return{keyAccidentals:e,relativeMajor:t,transposeKey:a,relativeMode:n,transposeChordName:i};N=parseInt(N,10);var M=[],z;for(z=0;z<A.length;z++)M=M.concat(u(b,A[z],N));M=M.sort(function(T,P){return P.start-T.start});var L=b.split("");for(z=0;z<M.length;z++){var E=M[z];L.splice(E.start,E.end-E.start,E.note)}return L.join("")};function u(b,A,N){var M=[],z=A.getKeySignature();if(z.root==="Hp"||z.root==="HP")return M;M=M.concat(f(b,N));for(var L=0;L<A.lines.length;L++){var E=A.lines[L].staff;if(E)for(var T=0;T<E.length;T++){var P=E[T];P.clef.type!=="perc"&&(M=M.concat(g(b,P.voices,P.key,N)))}}return M}function f(b,A){for(var N=[],M=b.split("K:"),z=M[0].length,L=1;L<M.length;L++){var E=M[L],T=E.match(/^( *)([A-G])([#b]?)( ?)(\w*)/);if(T){var P=z+2+T[1].length,B=r(T[5])?T[5]:"",O=T[2]+T[3]+T[4]+B,w=s({root:T[2],acc:T[3],mode:B},A),C=w.root+w.acc+T[4]+w.mode;N.push({start:P,end:P+O.length,note:C})}z+=E.length+2}return N}function g(b,A,N,M){for(var z=[],L=s(N,M),E=0;E<A.length;E++)z=z.concat(l(b,A[E],N.root,d(N),L,M));return z}function d(b){for(var A={},N=0;N<b.accidentals.length;N++){var M=b.accidentals[N];M.acc==="flat"?A[M.note.toUpperCase()]="_":M.acc==="sharp"&&(A[M.note.toUpperCase()]="^")}return A}function p(b,A,N){var M=o.indexOf(b.root)-o.indexOf(A);return A==="none"&&(M=o.indexOf(b.root)),M===0?N>2?M+=7:N===-12&&(M-=7):N>0&&M<0?M+=7:N<0&&M>0&&(M-=7),N>12?M+=7:N<-12&&(M-=7),M}function l(b,A,N,M,z,L){for(var E=[],T=p(z,N,L),P={},B={},O=0;O<A.length;O++){var w=A[O];if(w.chord)for(var C=0;C<w.chord.length;C++){var S=w.chord[C];if(S.position==="default"){var q=z.accidentals.length&&z.accidentals[0].acc==="flat",D=i(S.name,L,q,!0);D=D.replace(/♭/g,"b").replace(/♯/g,"#"),D!==S.name&&E.push(R(b,w.startChar,w.endChar,D))}}if(w.el_type==="note"&&w.pitches){for(var $=k(b,w.startChar,w.endChar),F=0;F<$.length;F++){var K=_($[F].note,N,M,P);K.acc&&(P[K.name.toUpperCase()]=K.acc);var te=v(K,z,T,B);te.acc&&(B[te.upper]=te.acc),E.push({note:te.acc+te.name,start:$[F].index,end:$[F].index+$[F].note.length})}if(w.gracenotes)for(var V=0;V<w.gracenotes.length;V++){var ae=_(w.gracenotes[V].name,N,M,P);ae.acc&&(P[ae.name.toUpperCase()]=ae.acc);var oe=v(ae,z,T,P);oe.acc&&(B[oe.upper]=oe.acc),E.push(x(b,w.startChar,w.endChar,oe.acc+oe.name,V))}}else w.el_type==="bar"?(P={},B={}):w.el_type==="keySignature"&&(N=w.root,M=d(w),z=s(w,L),T=p(z,N,L))}return E}var o="CDEFGAB",h=[",,,,",",,,",",,",",","","'","''","'''","''''"];function s(b,A){if(b.root==="none")return{root:a("C",A),mode:"",acc:"",accidentals:[]};var N=t(b.root+b.acc+b.mode),M=a(N,A),z=n(M,b.mode),L=e(M);return{root:z[0],mode:b.mode,acc:z.length>1?z[1]:"",accidentals:L}}function v(b,A,N,M){for(var z=b.pitch,L=o.indexOf(b.name),E=o.indexOf(A.root),T=(E+z)%7,P=L+N,B=b.oct;P>6;)B++,P-=7;for(;P<0;)B--,P+=7;for(var O=o[T],w="",C=b.adj,S="=",q=0;q<A.accidentals.length;q++)if(A.accidentals[q].note.toLowerCase()===O.toLowerCase()){C=C+(A.accidentals[q].acc==="flat"?-1:1),S=A.accidentals[q].acc==="flat"?"_":"^";break}var D;switch(C){case-2:w="__";break;case-1:w="_";break;case 0:w="=";break;case 1:w="^";break;case 2:w="^^";break;case-3:return D={},D.pitch=b.pitch-1,D.oct=b.oct,D.name=o[o.indexOf(b.name)-1],D.name||(D.name="B",D.oct--),D.name==="B"||D.name==="E"?D.adj=b.adj+1:D.adj=b.adj+2,v(D,A,N+1,M);case 3:return D={},D.pitch=b.pitch+1,D.oct=b.oct,D.name=o[o.indexOf(b.name)+1],D.name||(D.name="C",D.oct++),D.name==="C"||D.name==="F"?D.adj=b.adj-1:D.adj=b.adj-2,v(D,A,N+1,M)}switch((M[O]===w||!M[O]&&w===S)&&!b.courtesy&&(w=""),B){case 0:O=O+",,,";break;case 1:O=O+",,";break;case 2:O=O+",";break;case 4:O=O.toLowerCase();break;case 5:O=O.toLowerCase()+"'";break;case 6:O=O.toLowerCase()+"''";break;case 7:O=O.toLowerCase()+"'''";break;case 8:O=O.toLowerCase()+"''''";break}return B>4&&(O=O.toLowerCase()),{acc:w,name:O,upper:O.toUpperCase()}}var y=/([_^=]*)([A-Ga-g])([,']*)/,m=/([_^=]*[A-Ga-g][,']*)?(\d*\/*\d*)?([\>\<\-\)]*)?/;function _(b,A,N,M){var z=A==="none"?0:o.indexOf(A),L=b.match(y),E=L[2].toUpperCase(),T=o.indexOf(E)-z;T<0&&(T+=7);var P=h.indexOf(L[3]);E===L[2]&&P--;var B=M[E]||N[E]||"=";return{acc:L[1],name:E,pitch:T,oct:P,adj:I(L[1],N[E],M[E]),courtesy:L[1]===B}}function k(b,A,N){for(var M=b.substring(A,N),z,L=[],E=/("[^"]+")+/g;(z=E.exec(M))!==null;)L.push({start:E.lastIndex-z[0].length,end:E.lastIndex});for(var T=/(![^!]+!)+/g;(z=T.exec(M))!==null;)L.push({start:T.lastIndex-z[0].length,end:T.lastIndex});for(var P=[],B=/([_^=]*)([A-Ga-g])([,']*)/g;(z=B.exec(M))!==null;){for(var O=!1,w=0;w<L.length;w++)B.lastIndex>=L[w].start&&B.lastIndex<=L[w].end&&(O=!0);O||P.push({note:z[0],index:A+B.lastIndex-z[0].length})}return P}function x(b,A,N,M,z){var L=b.substring(A,N),E=/\{/,T=/\}/,P=/([^\{]*)/,B=/(\/*)/,O=L.match(new RegExp(P.source+E.source+B.source+m.source+B.source+m.source+B.source+m.source+B.source+m.source+B.source+m.source+B.source+m.source+B.source+m.source+B.source+m.source+T.source));if(O){for(var w=1+O[1].length,C=0;C<z;C++)O[C*3+2]&&(w+=O[C*3+2].length),O[C*3+3]&&(w+=O[C*3+3].length),O[C*3+4]&&(w+=O[C*3+4].length),O[C*3+5]&&(w+=O[C*3+5].length);O[z*3+2]&&(w+=O[C*3+2].length),A+=w;var S=O[z*3+3]?O[z*3+3].length:0;S+=O[z*3+4]?O[z*3+4].length:0,S+=O[z*3+5]?O[z*3+5].length:0,N=A+S}return{start:A,end:N,note:M}}function R(b,A,N,M){var z=b.substring(A,N).match(/([^"]+)?(".+")+/);return z[1]&&(A+=z[1].length),N=A+z[2].length,{start:A+1,end:N-1,note:M}}function I(b,A,N){if(!b&&N&&(b=N),!b)return 0;switch(A){case void 0:switch(b){case"__":return-2;case"_":return-1;case"=":return 0;case"^":return 1;case"^^":return 2;default:return 0}case"_":switch(b){case"__":return-1;case"_":return 0;case"=":return 1;case"^":return 2;case"^^":return 3;default:return 0}case"^":switch(b){case"__":return-3;case"_":return-2;case"=":return-1;case"^":return 0;case"^^":return 1;default:return 0}}return 0}})(),on=c,on}var cn,vs;function Cg(){if(vs)return cn;vs=1;var e=function(n,r,i,c){this.type="BeamElem",this.isflat=!!i,this.isgrace=!!(r&&r==="grace"),this.forceup=!!(this.isgrace||r&&r==="up"),this.forcedown=!!(r&&r==="down"),this.elems=[],this.total=0,this.average=6,this.allrests=!0,this.stemHeight=n,this.beams=[],c&&c.duration?(this.duration=c.duration,c.startTriplet&&(this.duration*=c.tripletMultiplier),this.duration=Math.round(this.duration*1e3)/1e3):this.duration=0};e.prototype.setHint=function(){this.hint=!0},e.prototype.runningDirection=function(a){var n=a.averagepitch;n!==void 0&&(this.total=Math.round(this.total+n),this.count||(this.count=0),this.count++)},e.prototype.add=function(a){var n=a.abcelem.averagepitch;n!==void 0&&(a.abcelem.rest||(this.allrests=!1),a.beam=this,this.elems.push(a),this.total=Math.round(this.total+n),(this.min===void 0||a.abcelem.minpitch<this.min)&&(this.min=a.abcelem.minpitch),(this.max===void 0||a.abcelem.maxpitch>this.max)&&(this.max=a.abcelem.maxpitch))},e.prototype.addBeam=function(a){this.beams.push(a)},e.prototype.setStemDirection=function(){if(this.average=t(this.total,this.count),this.forceup)this.stemsUp=!0;else if(this.forcedown)this.stemsUp=!1;else{var a=6;this.stemsUp=this.average<a}delete this.count,this.total=0},e.prototype.calcDir=function(){if(this.average=t(this.total,this.elems.length),this.forceup)this.stemsUp=!0;else if(this.forcedown)this.stemsUp=!1;else{var a=6;this.stemsUp=this.average<a}for(var n=this.stemsUp?"up":"down",r=0;r<this.elems.length;r++)for(var i=0;i<this.elems[r].heads.length;i++)this.elems[r].heads[i].stemDir=n};function t(a,n){return n?a/n:0}return cn=e,cn}var ln,ms;function Sg(){if(ms)return ln;ms=1;var e=function(a,n){this.startVoice=a,this.type=n};return e.prototype.setBottomStaff=function(t){this.endVoice=t,this.startVoice.header&&!this.endVoice.header&&(this.header=this.startVoice.header,delete this.startVoice.header)},e.prototype.continuing=function(t){this.lastContinuedVoice=t},e.prototype.getWidth=function(){return 10},e.prototype.isStartVoice=function(t){return!!(this.startVoice&&this.startVoice.staff&&this.startVoice.staff.voices.length>0&&this.startVoice.staff.voices[0]===t)},ln=e,ln}var un,bs;function pt(){if(bs)return un;bs=1;var e=Ve(),t={0:{d:[["M",4.83,-14.97],["c",.33,-.03,1.11,0,1.47,.06],["c",1.68,.36,2.97,1.59,3.78,3.6],["c",1.2,2.97,.81,6.96,-.9,9.27],["c",-.78,1.08,-1.71,1.71,-2.91,1.95],["c",-.45,.09,-1.32,.09,-1.77,0],["c",-.81,-.18,-1.47,-.51,-2.07,-1.02],["c",-2.34,-2.07,-3.15,-6.72,-1.74,-10.2],["c",.87,-2.16,2.28,-3.42,4.14,-3.66],["z"],["m",1.11,.87],["c",-.21,-.06,-.69,-.09,-.87,-.06],["c",-.54,.12,-.87,.42,-1.17,.99],["c",-.36,.66,-.51,1.56,-.6,3],["c",-.03,.75,-.03,4.59,0,5.31],["c",.09,1.5,.27,2.4,.6,3.06],["c",.24,.48,.57,.78,.96,.9],["c",.27,.09,.78,.09,1.05,0],["c",.39,-.12,.72,-.42,.96,-.9],["c",.33,-.66,.51,-1.56,.6,-3.06],["c",.03,-.72,.03,-4.56,0,-5.31],["c",-.09,-1.47,-.27,-2.37,-.6,-3.03],["c",-.24,-.48,-.54,-.78,-.93,-.9],["z"]],w:10.78,h:14.959},1:{d:[["M",3.3,-15.06],["c",.06,-.06,.21,-.03,.66,.15],["c",.81,.39,1.08,.39,1.83,.03],["c",.21,-.09,.39,-.15,.42,-.15],["c",.12,0,.21,.09,.27,.21],["c",.06,.12,.06,.33,.06,5.94],["c",0,3.93,0,5.85,.03,6.03],["c",.06,.36,.15,.69,.27,.96],["c",.36,.75,.93,1.17,1.68,1.26],["c",.3,.03,.39,.09,.39,.3],["c",0,.15,-.03,.18,-.09,.24],["c",-.06,.06,-.09,.06,-.48,.06],["c",-.42,0,-.69,-.03,-2.1,-.24],["c",-.9,-.15,-1.77,-.15,-2.67,0],["c",-1.41,.21,-1.68,.24,-2.1,.24],["c",-.39,0,-.42,0,-.48,-.06],["c",-.06,-.06,-.06,-.09,-.06,-.24],["c",0,-.21,.06,-.27,.36,-.3],["c",.75,-.09,1.32,-.51,1.68,-1.26],["c",.12,-.27,.21,-.6,.27,-.96],["c",.03,-.18,.03,-1.59,.03,-4.29],["c",0,-3.87,0,-4.05,-.06,-4.14],["c",-.09,-.15,-.18,-.24,-.39,-.24],["c",-.12,0,-.15,.03,-.21,.06],["c",-.03,.06,-.45,.99,-.96,2.13],["c",-.48,1.14,-.9,2.1,-.93,2.16],["c",-.06,.15,-.21,.24,-.33,.24],["c",-.24,0,-.42,-.18,-.42,-.39],["c",0,-.06,3.27,-7.62,3.33,-7.74],["z"]],w:8.94,h:15.058},2:{d:[["M",4.23,-14.97],["c",.57,-.06,1.68,0,2.34,.18],["c",.69,.18,1.5,.54,2.01,.9],["c",1.35,.96,1.95,2.25,1.77,3.81],["c",-.15,1.35,-.66,2.34,-1.68,3.15],["c",-.6,.48,-1.44,.93,-3.12,1.65],["c",-1.32,.57,-1.8,.81,-2.37,1.14],["c",-.57,.33,-.57,.33,-.24,.27],["c",.39,-.09,1.26,-.09,1.68,0],["c",.72,.15,1.41,.45,2.1,.9],["c",.99,.63,1.86,.87,2.55,.75],["c",.24,-.06,.42,-.15,.57,-.3],["c",.12,-.09,.3,-.42,.3,-.51],["c",0,-.09,.12,-.21,.24,-.24],["c",.18,-.03,.39,.12,.39,.3],["c",0,.12,-.15,.57,-.3,.87],["c",-.54,1.02,-1.56,1.74,-2.79,2.01],["c",-.42,.09,-1.23,.09,-1.62,.03],["c",-.81,-.18,-1.32,-.45,-2.01,-1.11],["c",-.45,-.45,-.63,-.57,-.96,-.69],["c",-.84,-.27,-1.89,.12,-2.25,.9],["c",-.12,.21,-.21,.54,-.21,.72],["c",0,.12,-.12,.21,-.27,.24],["c",-.15,0,-.27,-.03,-.33,-.15],["c",-.09,-.21,.09,-1.08,.33,-1.71],["c",.24,-.66,.66,-1.26,1.29,-1.89],["c",.45,-.45,.9,-.81,1.92,-1.56],["c",1.29,-.93,1.89,-1.44,2.34,-1.98],["c",.87,-1.05,1.26,-2.19,1.2,-3.63],["c",-.06,-1.29,-.39,-2.31,-.96,-2.91],["c",-.36,-.33,-.72,-.51,-1.17,-.54],["c",-.84,-.03,-1.53,.42,-1.59,1.05],["c",-.03,.33,.12,.6,.57,1.14],["c",.45,.54,.54,.87,.42,1.41],["c",-.15,.63,-.54,1.11,-1.08,1.38],["c",-.63,.33,-1.2,.33,-1.83,0],["c",-.24,-.12,-.33,-.18,-.54,-.39],["c",-.18,-.18,-.27,-.3,-.36,-.51],["c",-.24,-.45,-.27,-.84,-.21,-1.38],["c",.12,-.75,.45,-1.41,1.02,-1.98],["c",.72,-.72,1.74,-1.17,2.85,-1.32],["z"]],w:10.764,h:14.97},3:{d:[["M",3.78,-14.97],["c",.3,-.03,1.41,0,1.83,.06],["c",2.22,.3,3.51,1.32,3.72,2.91],["c",.03,.33,.03,1.26,-.03,1.65],["c",-.12,.84,-.48,1.47,-1.05,1.77],["c",-.27,.15,-.36,.24,-.45,.39],["c",-.09,.21,-.09,.36,0,.57],["c",.09,.15,.18,.24,.51,.39],["c",.75,.42,1.23,1.14,1.41,2.13],["c",.06,.42,.06,1.35,0,1.71],["c",-.18,.81,-.48,1.38,-1.02,1.95],["c",-.75,.72,-1.8,1.2,-3.18,1.38],["c",-.42,.06,-1.56,.06,-1.95,0],["c",-1.89,-.33,-3.18,-1.29,-3.51,-2.64],["c",-.03,-.12,-.03,-.33,-.03,-.6],["c",0,-.36,0,-.42,.06,-.63],["c",.12,-.3,.27,-.51,.51,-.75],["c",.24,-.24,.45,-.39,.75,-.51],["c",.21,-.06,.27,-.06,.6,-.06],["c",.33,0,.39,0,.6,.06],["c",.3,.12,.51,.27,.75,.51],["c",.36,.33,.57,.75,.6,1.2],["c",0,.21,0,.27,-.06,.42],["c",-.09,.18,-.12,.24,-.54,.54],["c",-.51,.36,-.63,.54,-.6,.87],["c",.06,.54,.54,.9,1.38,.99],["c",.36,.06,.72,.03,.96,-.06],["c",.81,-.27,1.29,-1.23,1.44,-2.79],["c",.03,-.45,.03,-1.95,-.03,-2.37],["c",-.09,-.75,-.33,-1.23,-.75,-1.44],["c",-.33,-.18,-.45,-.18,-1.98,-.18],["c",-1.35,0,-1.41,0,-1.5,-.06],["c",-.18,-.12,-.24,-.39,-.12,-.6],["c",.12,-.15,.15,-.15,1.68,-.15],["c",1.5,0,1.62,0,1.89,-.15],["c",.18,-.09,.42,-.36,.54,-.57],["c",.18,-.42,.27,-.9,.3,-1.95],["c",.03,-1.2,-.06,-1.8,-.36,-2.37],["c",-.24,-.48,-.63,-.81,-1.14,-.96],["c",-.3,-.06,-1.08,-.06,-1.38,.03],["c",-.6,.15,-.9,.42,-.96,.84],["c",-.03,.3,.06,.45,.63,.84],["c",.33,.24,.42,.39,.45,.63],["c",.03,.72,-.57,1.5,-1.32,1.65],["c",-1.05,.27,-2.1,-.57,-2.1,-1.65],["c",0,-.45,.15,-.96,.39,-1.38],["c",.12,-.21,.54,-.63,.81,-.81],["c",.57,-.42,1.38,-.69,2.25,-.81],["z"]],w:9.735,h:14.967},4:{d:[["M",8.64,-14.94],["c",.27,-.09,.42,-.12,.54,-.03],["c",.09,.06,.15,.21,.15,.3],["c",-.03,.06,-1.92,2.31,-4.23,5.04],["c",-2.31,2.73,-4.23,4.98,-4.26,5.01],["c",-.03,.06,.12,.06,2.55,.06],["l",2.61,0],["l",0,-2.37],["c",0,-2.19,.03,-2.37,.06,-2.46],["c",.03,-.06,.21,-.18,.57,-.42],["c",1.08,-.72,1.38,-1.08,1.86,-2.16],["c",.12,-.3,.24,-.54,.27,-.57],["c",.12,-.12,.39,-.06,.45,.12],["c",.06,.09,.06,.57,.06,3.96],["l",0,3.9],["l",1.08,0],["c",1.05,0,1.11,0,1.2,.06],["c",.24,.15,.24,.54,0,.69],["c",-.09,.06,-.15,.06,-1.2,.06],["l",-1.08,0],["l",0,.33],["c",0,.57,.09,1.11,.3,1.53],["c",.36,.75,.93,1.17,1.68,1.26],["c",.3,.03,.39,.09,.39,.3],["c",0,.15,-.03,.18,-.09,.24],["c",-.06,.06,-.09,.06,-.48,.06],["c",-.42,0,-.69,-.03,-2.1,-.24],["c",-.9,-.15,-1.77,-.15,-2.67,0],["c",-1.41,.21,-1.68,.24,-2.1,.24],["c",-.39,0,-.42,0,-.48,-.06],["c",-.06,-.06,-.06,-.09,-.06,-.24],["c",0,-.21,.06,-.27,.36,-.3],["c",.75,-.09,1.32,-.51,1.68,-1.26],["c",.21,-.42,.3,-.96,.3,-1.53],["l",0,-.33],["l",-2.7,0],["c",-2.91,0,-2.85,0,-3.09,-.15],["c",-.18,-.12,-.3,-.39,-.27,-.54],["c",.03,-.06,.18,-.24,.33,-.45],["c",.75,-.9,1.59,-2.07,2.13,-3.03],["c",.33,-.54,.84,-1.62,1.05,-2.16],["c",.57,-1.41,.84,-2.64,.9,-4.05],["c",.03,-.63,.06,-.72,.24,-.81],["l",.12,-.06],["l",.45,.12],["c",.66,.18,1.02,.24,1.47,.27],["c",.6,.03,1.23,-.09,2.01,-.33],["z"]],w:11.795,h:14.994},5:{d:[["M",1.02,-14.94],["c",.12,-.09,.03,-.09,1.08,.06],["c",2.49,.36,4.35,.36,6.96,-.06],["c",.57,-.09,.66,-.06,.81,.06],["c",.15,.18,.12,.24,-.15,.51],["c",-1.29,1.26,-3.24,2.04,-5.58,2.31],["c",-.6,.09,-1.2,.12,-1.71,.12],["c",-.39,0,-.45,0,-.57,.06],["c",-.09,.06,-.15,.12,-.21,.21],["l",-.06,.12],["l",0,1.65],["l",0,1.65],["l",.21,-.21],["c",.66,-.57,1.41,-.96,2.19,-1.14],["c",.33,-.06,1.41,-.06,1.95,0],["c",2.61,.36,4.02,1.74,4.26,4.14],["c",.03,.45,.03,1.08,-.03,1.44],["c",-.18,1.02,-.78,2.01,-1.59,2.7],["c",-.72,.57,-1.62,1.02,-2.49,1.2],["c",-1.38,.27,-3.03,.06,-4.2,-.54],["c",-1.08,-.54,-1.71,-1.32,-1.86,-2.28],["c",-.09,-.69,.09,-1.29,.57,-1.74],["c",.24,-.24,.45,-.39,.75,-.51],["c",.21,-.06,.27,-.06,.6,-.06],["c",.33,0,.39,0,.6,.06],["c",.3,.12,.51,.27,.75,.51],["c",.36,.33,.57,.75,.6,1.2],["c",0,.21,0,.27,-.06,.42],["c",-.09,.18,-.12,.24,-.54,.54],["c",-.18,.12,-.36,.3,-.42,.33],["c",-.36,.42,-.18,.99,.36,1.26],["c",.51,.27,1.47,.36,2.01,.27],["c",.93,-.21,1.47,-1.17,1.65,-2.91],["c",.06,-.45,.06,-1.89,0,-2.31],["c",-.15,-1.2,-.51,-2.1,-1.05,-2.55],["c",-.21,-.18,-.54,-.36,-.81,-.39],["c",-.3,-.06,-.84,-.03,-1.26,.06],["c",-.93,.18,-1.65,.6,-2.16,1.2],["c",-.15,.21,-.27,.3,-.39,.3],["c",-.15,0,-.3,-.09,-.36,-.18],["c",-.06,-.09,-.06,-.15,-.06,-3.66],["c",0,-3.39,0,-3.57,.06,-3.66],["c",.03,-.06,.09,-.15,.15,-.18],["z"]],w:10.212,h:14.997},6:{d:[["M",4.98,-14.97],["c",.36,-.03,1.2,0,1.59,.06],["c",.9,.15,1.68,.51,2.25,1.05],["c",.57,.51,.87,1.23,.84,1.98],["c",-.03,.51,-.21,.9,-.6,1.26],["c",-.24,.24,-.45,.39,-.75,.51],["c",-.21,.06,-.27,.06,-.6,.06],["c",-.33,0,-.39,0,-.6,-.06],["c",-.3,-.12,-.51,-.27,-.75,-.51],["c",-.39,-.36,-.57,-.78,-.57,-1.26],["c",0,-.27,0,-.3,.09,-.42],["c",.03,-.09,.18,-.21,.3,-.3],["c",.12,-.09,.3,-.21,.39,-.27],["c",.09,-.06,.21,-.18,.27,-.24],["c",.06,-.12,.09,-.15,.09,-.33],["c",0,-.18,-.03,-.24,-.09,-.36],["c",-.24,-.39,-.75,-.6,-1.38,-.57],["c",-.54,.03,-.9,.18,-1.23,.48],["c",-.81,.72,-1.08,2.16,-.96,5.37],["l",0,.63],["l",.3,-.12],["c",.78,-.27,1.29,-.33,2.1,-.27],["c",1.47,.12,2.49,.54,3.27,1.29],["c",.48,.51,.81,1.11,.96,1.89],["c",.06,.27,.06,.42,.06,.93],["c",0,.54,0,.69,-.06,.96],["c",-.15,.78,-.48,1.38,-.96,1.89],["c",-.54,.51,-1.17,.87,-1.98,1.08],["c",-1.14,.3,-2.4,.33,-3.24,.03],["c",-1.5,-.48,-2.64,-1.89,-3.27,-4.02],["c",-.36,-1.23,-.51,-2.82,-.42,-4.08],["c",.3,-3.66,2.28,-6.3,4.95,-6.66],["z"],["m",.66,7.41],["c",-.27,-.09,-.81,-.12,-1.08,-.06],["c",-.72,.18,-1.08,.69,-1.23,1.71],["c",-.06,.54,-.06,3,0,3.54],["c",.18,1.26,.72,1.77,1.8,1.74],["c",.39,-.03,.63,-.09,.9,-.27],["c",.66,-.42,.9,-1.32,.9,-3.24],["c",0,-2.22,-.36,-3.12,-1.29,-3.42],["z"]],w:9.956,h:14.982},7:{d:[["M",.21,-14.97],["c",.21,-.06,.45,0,.54,.15],["c",.06,.09,.06,.15,.06,.39],["c",0,.24,0,.33,.06,.42],["c",.06,.12,.21,.24,.27,.24],["c",.03,0,.12,-.12,.24,-.21],["c",.96,-1.2,2.58,-1.35,3.99,-.42],["c",.15,.12,.42,.3,.54,.45],["c",.48,.39,.81,.57,1.29,.6],["c",.69,.03,1.5,-.3,2.13,-.87],["c",.09,-.09,.27,-.3,.39,-.45],["c",.12,-.15,.24,-.27,.3,-.3],["c",.18,-.06,.39,.03,.51,.21],["c",.06,.18,.06,.24,-.27,.72],["c",-.18,.24,-.54,.78,-.78,1.17],["c",-2.37,3.54,-3.54,6.27,-3.87,9],["c",-.03,.33,-.03,.66,-.03,1.26],["c",0,.9,0,1.08,.15,1.89],["c",.06,.45,.06,.48,.03,.6],["c",-.06,.09,-.21,.21,-.3,.21],["c",-.03,0,-.27,-.06,-.54,-.15],["c",-.84,-.27,-1.11,-.3,-1.65,-.3],["c",-.57,0,-.84,.03,-1.56,.27],["c",-.6,.18,-.69,.21,-.81,.15],["c",-.12,-.06,-.21,-.18,-.21,-.3],["c",0,-.15,.6,-1.44,1.2,-2.61],["c",1.14,-2.22,2.73,-4.68,5.1,-8.01],["c",.21,-.27,.36,-.48,.33,-.48],["c",0,0,-.12,.06,-.27,.12],["c",-.54,.3,-.99,.39,-1.56,.39],["c",-.75,.03,-1.2,-.18,-1.83,-.75],["c",-.99,-.9,-1.83,-1.17,-2.31,-.72],["c",-.18,.15,-.36,.51,-.45,.84],["c",-.06,.24,-.06,.33,-.09,1.98],["c",0,1.62,-.03,1.74,-.06,1.8],["c",-.15,.24,-.54,.24,-.69,0],["c",-.06,-.09,-.06,-.15,-.06,-3.57],["c",0,-3.42,0,-3.48,.06,-3.57],["c",.03,-.06,.09,-.12,.15,-.15],["z"]],w:10.561,h:15.093},8:{d:[["M",4.98,-14.97],["c",.33,-.03,1.02,-.03,1.32,0],["c",1.32,.12,2.49,.6,3.21,1.32],["c",.39,.39,.66,.81,.78,1.29],["c",.09,.36,.09,1.08,0,1.44],["c",-.21,.84,-.66,1.59,-1.59,2.55],["l",-.3,.3],["l",.27,.18],["c",1.47,.93,2.31,2.31,2.25,3.75],["c",-.03,.75,-.24,1.35,-.63,1.95],["c",-.45,.66,-1.02,1.14,-1.83,1.53],["c",-1.8,.87,-4.2,.87,-6,.03],["c",-1.62,-.78,-2.52,-2.16,-2.46,-3.66],["c",.06,-.99,.54,-1.77,1.8,-2.97],["c",.54,-.51,.54,-.54,.48,-.57],["c",-.39,-.27,-.96,-.78,-1.2,-1.14],["c",-.75,-1.11,-.87,-2.4,-.3,-3.6],["c",.69,-1.35,2.25,-2.25,4.2,-2.4],["z"],["m",1.53,.69],["c",-.42,-.09,-1.11,-.12,-1.38,-.06],["c",-.3,.06,-.6,.18,-.81,.3],["c",-.21,.12,-.6,.51,-.72,.72],["c",-.51,.87,-.42,1.89,.21,2.52],["c",.21,.21,.36,.3,1.95,1.23],["c",.96,.54,1.74,.99,1.77,1.02],["c",.09,0,.63,-.6,.99,-1.11],["c",.21,-.36,.48,-.87,.57,-1.23],["c",.06,-.24,.06,-.36,.06,-.72],["c",0,-.45,-.03,-.66,-.15,-.99],["c",-.39,-.81,-1.29,-1.44,-2.49,-1.68],["z"],["m",-1.44,8.07],["l",-1.89,-1.08],["c",-.03,0,-.18,.15,-.39,.33],["c",-1.2,1.08,-1.65,1.95,-1.59,3],["c",.09,1.59,1.35,2.85,3.21,3.24],["c",.33,.06,.45,.06,.93,.06],["c",.63,0,.81,-.03,1.29,-.27],["c",.9,-.42,1.47,-1.41,1.41,-2.4],["c",-.06,-.66,-.39,-1.29,-.9,-1.65],["c",-.12,-.09,-1.05,-.63,-2.07,-1.23],["z"]],w:10.926,h:14.989},9:{d:[["M",4.23,-14.97],["c",.42,-.03,1.29,0,1.62,.06],["c",.51,.12,.93,.3,1.38,.57],["c",1.53,1.02,2.52,3.24,2.73,5.94],["c",.18,2.55,-.48,4.98,-1.83,6.57],["c",-1.05,1.26,-2.4,1.89,-3.93,1.83],["c",-1.23,-.06,-2.31,-.45,-3.03,-1.14],["c",-.57,-.51,-.87,-1.23,-.84,-1.98],["c",.03,-.51,.21,-.9,.6,-1.26],["c",.24,-.24,.45,-.39,.75,-.51],["c",.21,-.06,.27,-.06,.6,-.06],["c",.33,0,.39,0,.6,.06],["c",.3,.12,.51,.27,.75,.51],["c",.39,.36,.57,.78,.57,1.26],["c",0,.27,0,.3,-.09,.42],["c",-.03,.09,-.18,.21,-.3,.3],["c",-.12,.09,-.3,.21,-.39,.27],["c",-.09,.06,-.21,.18,-.27,.24],["c",-.06,.12,-.06,.15,-.06,.33],["c",0,.18,0,.24,.06,.36],["c",.24,.39,.75,.6,1.38,.57],["c",.54,-.03,.9,-.18,1.23,-.48],["c",.81,-.72,1.08,-2.16,.96,-5.37],["l",0,-.63],["l",-.3,.12],["c",-.78,.27,-1.29,.33,-2.1,.27],["c",-1.47,-.12,-2.49,-.54,-3.27,-1.29],["c",-.48,-.51,-.81,-1.11,-.96,-1.89],["c",-.06,-.27,-.06,-.42,-.06,-.96],["c",0,-.51,0,-.66,.06,-.93],["c",.15,-.78,.48,-1.38,.96,-1.89],["c",.15,-.12,.33,-.27,.42,-.36],["c",.69,-.51,1.62,-.81,2.76,-.93],["z"],["m",1.17,.66],["c",-.21,-.06,-.57,-.06,-.81,-.03],["c",-.78,.12,-1.26,.69,-1.41,1.74],["c",-.12,.63,-.15,1.95,-.09,2.79],["c",.12,1.71,.63,2.4,1.77,2.46],["c",1.08,.03,1.62,-.48,1.8,-1.74],["c",.06,-.54,.06,-3,0,-3.54],["c",-.15,-1.05,-.51,-1.53,-1.26,-1.68],["z"]],w:9.959,h:14.986},"rests.multimeasure":{d:[["M",0,-4],["l",0,16],["l",1,0],["l",0,-5],["l",40,0],["l",0,5],["l",1,0],["l",0,-16],["l",-1,0],["l",0,5],["l",-40,0],["l",0,-5],["z"]],w:42,h:18},"rests.whole":{d:[["M",.06,.03],["l",.09,-.06],["l",5.46,0],["l",5.49,0],["l",.09,.06],["l",.06,.09],["l",0,2.19],["l",0,2.19],["l",-.06,.09],["l",-.09,.06],["l",-5.49,0],["l",-5.46,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-2.19],["l",0,-2.19],["z"]],w:11.25,h:4.68},"rests.half":{d:[["M",.06,-4.62],["l",.09,-.06],["l",5.46,0],["l",5.49,0],["l",.09,.06],["l",.06,.09],["l",0,2.19],["l",0,2.19],["l",-.06,.09],["l",-.09,.06],["l",-5.49,0],["l",-5.46,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-2.19],["l",0,-2.19],["z"]],w:11.25,h:4.68},"rests.quarter":{d:[["M",1.89,-11.82],["c",.12,-.06,.24,-.06,.36,-.03],["c",.09,.06,4.74,5.58,4.86,5.82],["c",.21,.39,.15,.78,-.15,1.26],["c",-.24,.33,-.72,.81,-1.62,1.56],["c",-.45,.36,-.87,.75,-.96,.84],["c",-.93,.99,-1.14,2.49,-.6,3.63],["c",.18,.39,.27,.48,1.32,1.68],["c",1.92,2.25,1.83,2.16,1.83,2.34],["c",0,.18,-.18,.36,-.36,.39],["c",-.15,0,-.27,-.06,-.48,-.27],["c",-.75,-.75,-2.46,-1.29,-3.39,-1.08],["c",-.45,.09,-.69,.27,-.9,.69],["c",-.12,.3,-.21,.66,-.24,1.14],["c",-.03,.66,.09,1.35,.3,2.01],["c",.15,.42,.24,.66,.45,.96],["c",.18,.24,.18,.33,.03,.42],["c",-.12,.06,-.18,.03,-.45,-.3],["c",-1.08,-1.38,-2.07,-3.36,-2.4,-4.83],["c",-.27,-1.05,-.15,-1.77,.27,-2.07],["c",.21,-.12,.42,-.15,.87,-.15],["c",.87,.06,2.1,.39,3.3,.9],["l",.39,.18],["l",-1.65,-1.95],["c",-2.52,-2.97,-2.61,-3.09,-2.7,-3.27],["c",-.09,-.24,-.12,-.48,-.03,-.75],["c",.15,-.48,.57,-.96,1.83,-2.01],["c",.45,-.36,.84,-.72,.93,-.78],["c",.69,-.75,1.02,-1.8,.9,-2.79],["c",-.06,-.33,-.21,-.84,-.39,-1.11],["c",-.09,-.15,-.45,-.6,-.81,-1.05],["c",-.36,-.42,-.69,-.81,-.72,-.87],["c",-.09,-.18,0,-.42,.21,-.51],["z"]],w:7.888,h:21.435},"rests.8th":{d:[["M",1.68,-6.12],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.12,0,.18,0,.33,-.09],["c",.39,-.18,1.32,-1.29,1.68,-1.98],["c",.09,-.21,.24,-.3,.39,-.3],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.27,1.11,-1.86,6.42],["c",-1.02,3.48,-1.89,6.39,-1.92,6.42],["c",0,.03,-.12,.12,-.24,.15],["c",-.18,.09,-.21,.09,-.45,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.15,-.57,1.68,-4.92],["c",.96,-2.67,1.74,-4.89,1.71,-4.89],["l",-.51,.15],["c",-1.08,.36,-1.74,.48,-2.55,.48],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:7.534,h:13.883},"rests.16th":{d:[["M",3.33,-6.12],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.15,.39,.57,.57,.87,.42],["c",.39,-.18,1.2,-1.23,1.62,-2.07],["c",.06,-.15,.24,-.24,.36,-.24],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.45,1.86,-2.67,10.17],["c",-1.5,5.55,-2.73,10.14,-2.76,10.17],["c",-.03,.03,-.12,.12,-.24,.15],["c",-.18,.09,-.21,.09,-.45,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.12,-.57,1.44,-4.92],["c",.81,-2.67,1.47,-4.86,1.47,-4.89],["c",-.03,0,-.27,.06,-.54,.15],["c",-1.08,.36,-1.77,.48,-2.58,.48],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.09,.09,.27,.18,.45,.21],["c",.12,0,.18,0,.33,-.09],["c",.33,-.15,1.02,-.93,1.41,-1.59],["c",.12,-.21,.18,-.39,.39,-1.08],["c",.66,-2.1,1.17,-3.84,1.17,-3.87],["c",0,0,-.21,.06,-.42,.15],["c",-.51,.15,-1.2,.33,-1.68,.42],["c",-.33,.06,-.51,.06,-.96,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:9.724,h:21.383},"rests.32nd":{d:[["M",4.23,-13.62],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.12,0,.18,0,.27,-.06],["c",.33,-.21,.99,-1.11,1.44,-1.98],["c",.09,-.24,.21,-.33,.39,-.33],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.57,2.67,-3.21,13.89],["c",-1.8,7.62,-3.3,13.89,-3.3,13.92],["c",-.03,.06,-.12,.12,-.24,.18],["c",-.21,.09,-.24,.09,-.48,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.09,-.57,1.23,-4.92],["c",.69,-2.67,1.26,-4.86,1.29,-4.89],["c",0,-.03,-.12,-.03,-.48,.12],["c",-1.17,.39,-2.22,.57,-3,.54],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.12,.09,.3,.18,.48,.21],["c",.12,0,.18,0,.3,-.09],["c",.42,-.21,1.29,-1.29,1.56,-1.89],["c",.03,-.12,1.23,-4.59,1.23,-4.65],["c",0,-.03,-.18,.03,-.39,.12],["c",-.63,.18,-1.2,.36,-1.74,.45],["c",-.39,.06,-.54,.06,-1.02,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.18,.18,.51,.27,.72,.15],["c",.3,-.12,.69,-.57,1.08,-1.17],["c",.42,-.6,.39,-.51,1.05,-3.03],["c",.33,-1.26,.6,-2.31,.6,-2.34],["c",0,0,-.21,.03,-.45,.12],["c",-.57,.18,-1.14,.33,-1.62,.42],["c",-.33,.06,-.51,.06,-.96,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:11.373,h:28.883},"rests.64th":{d:[["M",5.13,-13.62],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.18,.21,.54,.3,.75,.18],["c",.24,-.12,.63,-.66,1.08,-1.56],["c",.33,-.66,.39,-.72,.6,-.72],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.69,3.66,-3.54,17.64],["c",-1.95,9.66,-3.57,17.61,-3.57,17.64],["c",-.03,.06,-.12,.12,-.24,.18],["c",-.21,.09,-.24,.09,-.48,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.06,-.57,1.05,-4.95],["c",.6,-2.7,1.08,-4.89,1.08,-4.92],["c",0,0,-.24,.06,-.51,.15],["c",-.66,.24,-1.2,.36,-1.77,.48],["c",-.42,.06,-.57,.06,-1.05,.06],["c",-.69,0,-.87,-.03,-1.35,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.09,.09,.27,.18,.45,.21],["c",.21,.03,.39,-.09,.72,-.42],["c",.45,-.45,1.02,-1.26,1.17,-1.65],["c",.03,-.09,.27,-1.14,.54,-2.34],["c",.27,-1.2,.48,-2.19,.51,-2.22],["c",0,-.03,-.09,-.03,-.48,.12],["c",-1.17,.39,-2.22,.57,-3,.54],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.15,.39,.57,.57,.9,.42],["c",.36,-.18,1.2,-1.26,1.47,-1.89],["c",.03,-.09,.3,-1.2,.57,-2.43],["l",.51,-2.28],["l",-.54,.18],["c",-1.11,.36,-1.8,.48,-2.61,.48],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.21,.21,.54,.3,.75,.18],["c",.36,-.18,.93,-.93,1.29,-1.68],["c",.12,-.24,.18,-.48,.63,-2.55],["l",.51,-2.31],["c",0,-.03,-.18,.03,-.39,.12],["c",-1.14,.36,-2.1,.54,-2.82,.51],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:12.453,h:36.383},"rests.128th":{d:[["M",6.03,-21.12],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.21,0,.33,-.06,.54,-.36],["c",.15,-.21,.54,-.93,.78,-1.47],["c",.15,-.33,.18,-.39,.3,-.48],["c",.18,-.09,.45,0,.51,.15],["c",.03,.09,-7.11,42.75,-7.17,42.84],["c",-.03,.03,-.15,.09,-.24,.15],["c",-.18,.06,-.24,.06,-.45,.06],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.03,-.57,.84,-4.98],["c",.51,-2.7,.93,-4.92,.9,-4.92],["c",0,0,-.15,.06,-.36,.12],["c",-.78,.27,-1.62,.48,-2.31,.57],["c",-.15,.03,-.54,.03,-.81,.03],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.63,.48],["c",.12,0,.18,0,.3,-.09],["c",.42,-.21,1.14,-1.11,1.5,-1.83],["c",.12,-.27,.12,-.27,.54,-2.52],["c",.24,-1.23,.42,-2.25,.39,-2.25],["c",0,0,-.24,.06,-.51,.18],["c",-1.26,.39,-2.25,.57,-3.06,.54],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.18,.21,.51,.3,.75,.18],["c",.36,-.15,1.05,-.99,1.41,-1.77],["l",.15,-.3],["l",.42,-2.25],["c",.21,-1.26,.42,-2.28,.39,-2.28],["l",-.51,.15],["c",-1.11,.39,-1.89,.51,-2.7,.51],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.18,.18,.48,.27,.72,.21],["c",.33,-.12,1.14,-1.26,1.41,-1.95],["c",0,-.09,.21,-1.11,.45,-2.34],["c",.21,-1.2,.39,-2.22,.39,-2.28],["c",.03,-.03,0,-.03,-.45,.12],["c",-.57,.18,-1.2,.33,-1.71,.42],["c",-.3,.06,-.51,.06,-.93,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.18,0,.36,-.09,.57,-.33],["c",.33,-.36,.78,-1.14,.93,-1.56],["c",.03,-.12,.24,-1.2,.45,-2.4],["c",.24,-1.2,.42,-2.22,.42,-2.28],["c",.03,-.03,0,-.03,-.39,.09],["c",-1.05,.36,-1.8,.48,-2.58,.48],["c",-.63,0,-.84,-.03,-1.29,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:12.992,h:43.883},"accidentals.sharp":{d:[["M",5.73,-11.19],["c",.21,-.12,.54,-.03,.66,.24],["c",.06,.12,.06,.21,.06,2.31],["c",0,1.23,0,2.22,.03,2.22],["c",0,0,.27,-.12,.6,-.24],["c",.69,-.27,.78,-.3,.96,-.15],["c",.21,.15,.21,.18,.21,1.38],["c",0,1.02,0,1.11,-.06,1.2],["c",-.03,.06,-.09,.12,-.12,.15],["c",-.06,.03,-.42,.21,-.84,.36],["l",-.75,.33],["l",-.03,2.43],["c",0,1.32,0,2.43,.03,2.43],["c",0,0,.27,-.12,.6,-.24],["c",.69,-.27,.78,-.3,.96,-.15],["c",.21,.15,.21,.18,.21,1.38],["c",0,1.02,0,1.11,-.06,1.2],["c",-.03,.06,-.09,.12,-.12,.15],["c",-.06,.03,-.42,.21,-.84,.36],["l",-.75,.33],["l",-.03,2.52],["c",0,2.28,-.03,2.55,-.06,2.64],["c",-.21,.36,-.72,.36,-.93,0],["c",-.03,-.09,-.06,-.33,-.06,-2.43],["l",0,-2.31],["l",-1.29,.51],["l",-1.26,.51],["l",0,2.43],["c",0,2.58,0,2.52,-.15,2.67],["c",-.06,.09,-.27,.18,-.36,.18],["c",-.12,0,-.33,-.09,-.39,-.18],["c",-.15,-.15,-.15,-.09,-.15,-2.43],["c",0,-1.23,0,-2.22,-.03,-2.22],["c",0,0,-.27,.12,-.6,.24],["c",-.69,.27,-.78,.3,-.96,.15],["c",-.21,-.15,-.21,-.18,-.21,-1.38],["c",0,-1.02,0,-1.11,.06,-1.2],["c",.03,-.06,.09,-.12,.12,-.15],["c",.06,-.03,.42,-.21,.84,-.36],["l",.78,-.33],["l",0,-2.43],["c",0,-1.32,0,-2.43,-.03,-2.43],["c",0,0,-.27,.12,-.6,.24],["c",-.69,.27,-.78,.3,-.96,.15],["c",-.21,-.15,-.21,-.18,-.21,-1.38],["c",0,-1.02,0,-1.11,.06,-1.2],["c",.03,-.06,.09,-.12,.12,-.15],["c",.06,-.03,.42,-.21,.84,-.36],["l",.78,-.33],["l",0,-2.52],["c",0,-2.28,.03,-2.55,.06,-2.64],["c",.21,-.36,.72,-.36,.93,0],["c",.03,.09,.06,.33,.06,2.43],["l",.03,2.31],["l",1.26,-.51],["l",1.26,-.51],["l",0,-2.43],["c",0,-2.28,0,-2.43,.06,-2.55],["c",.06,-.12,.12,-.18,.27,-.24],["z"],["m",-.33,10.65],["l",0,-2.43],["l",-1.29,.51],["l",-1.26,.51],["l",0,2.46],["l",0,2.43],["l",.09,-.03],["c",.06,-.03,.63,-.27,1.29,-.51],["l",1.17,-.48],["l",0,-2.46],["z"]],w:8.25,h:22.462},"accidentals.halfsharp":{d:[["M",2.43,-10.05],["c",.21,-.12,.54,-.03,.66,.24],["c",.06,.12,.06,.21,.06,2.01],["c",0,1.05,0,1.89,.03,1.89],["l",.72,-.48],["c",.69,-.48,.69,-.51,.87,-.51],["c",.15,0,.18,.03,.27,.09],["c",.21,.15,.21,.18,.21,1.41],["c",0,1.11,-.03,1.14,-.09,1.23],["c",-.03,.03,-.48,.39,-1.02,.75],["l",-.99,.66],["l",0,2.37],["c",0,1.32,0,2.37,.03,2.37],["l",.72,-.48],["c",.69,-.48,.69,-.51,.87,-.51],["c",.15,0,.18,.03,.27,.09],["c",.21,.15,.21,.18,.21,1.41],["c",0,1.11,-.03,1.14,-.09,1.23],["c",-.03,.03,-.48,.39,-1.02,.75],["l",-.99,.66],["l",0,2.25],["c",0,1.95,0,2.28,-.06,2.37],["c",-.06,.12,-.12,.21,-.24,.27],["c",-.27,.12,-.54,.03,-.69,-.24],["c",-.06,-.12,-.06,-.21,-.06,-2.01],["c",0,-1.05,0,-1.89,-.03,-1.89],["l",-.72,.48],["c",-.69,.48,-.69,.48,-.87,.48],["c",-.15,0,-.18,0,-.27,-.06],["c",-.21,-.15,-.21,-.18,-.21,-1.41],["c",0,-1.11,.03,-1.14,.09,-1.23],["c",.03,-.03,.48,-.39,1.02,-.75],["l",.99,-.66],["l",0,-2.37],["c",0,-1.32,0,-2.37,-.03,-2.37],["l",-.72,.48],["c",-.69,.48,-.69,.48,-.87,.48],["c",-.15,0,-.18,0,-.27,-.06],["c",-.21,-.15,-.21,-.18,-.21,-1.41],["c",0,-1.11,.03,-1.14,.09,-1.23],["c",.03,-.03,.48,-.39,1.02,-.75],["l",.99,-.66],["l",0,-2.25],["c",0,-2.13,0,-2.28,.06,-2.4],["c",.06,-.12,.12,-.18,.27,-.24],["z"]],w:5.25,h:20.174},"accidentals.nat":{d:[["M",.21,-11.4],["c",.24,-.06,.78,0,.99,.15],["c",.03,.03,.03,.48,0,2.61],["c",-.03,1.44,-.03,2.61,-.03,2.61],["c",0,.03,.75,-.09,1.68,-.24],["c",.96,-.18,1.71,-.27,1.74,-.27],["c",.15,.03,.27,.15,.36,.3],["l",.06,.12],["l",.09,8.67],["c",.09,6.96,.12,8.67,.09,8.67],["c",-.03,.03,-.12,.06,-.21,.09],["c",-.24,.09,-.72,.09,-.96,0],["c",-.09,-.03,-.18,-.06,-.21,-.09],["c",-.03,-.03,-.03,-.48,0,-2.61],["c",.03,-1.44,.03,-2.61,.03,-2.61],["c",0,-.03,-.75,.09,-1.68,.24],["c",-.96,.18,-1.71,.27,-1.74,.27],["c",-.15,-.03,-.27,-.15,-.36,-.3],["l",-.06,-.15],["l",-.09,-7.53],["c",-.06,-4.14,-.09,-8.04,-.12,-8.67],["l",0,-1.11],["l",.15,-.06],["c",.09,-.03,.21,-.06,.27,-.09],["z"],["m",3.75,8.4],["c",0,-.33,0,-.42,-.03,-.42],["c",-.12,0,-2.79,.45,-2.79,.48],["c",-.03,0,-.09,6.3,-.09,6.33],["c",.03,0,2.79,-.45,2.82,-.48],["c",0,0,.09,-4.53,.09,-5.91],["z"]],w:5.4,h:22.8},"accidentals.flat":{d:[["M",-.36,-14.07],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.36,-.03,5.25],["c",-.06,2.85,-.09,5.19,-.09,5.19],["c",0,.03,.12,-.03,.24,-.12],["c",.63,-.42,1.41,-.66,2.19,-.72],["c",.81,-.03,1.47,.21,2.04,.78],["c",.57,.54,.87,1.26,.93,2.04],["c",.03,.57,-.09,1.08,-.36,1.62],["c",-.42,.81,-1.02,1.38,-2.82,2.61],["c",-1.14,.78,-1.44,1.02,-1.8,1.44],["c",-.18,.18,-.39,.39,-.45,.42],["c",-.27,.18,-.57,.15,-.81,-.06],["c",-.06,-.09,-.12,-.18,-.15,-.27],["c",-.03,-.06,-.09,-3.27,-.18,-8.34],["c",-.09,-4.53,-.15,-8.58,-.18,-9.03],["l",0,-.78],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",3.18,11.01],["c",-.21,-.12,-.54,-.15,-.81,-.06],["c",-.54,.15,-.99,.63,-1.17,1.26],["c",-.06,.3,-.12,2.88,-.06,3.87],["c",.03,.42,.03,.81,.06,.9],["l",.03,.12],["l",.45,-.39],["c",.63,-.54,1.26,-1.17,1.56,-1.59],["c",.3,-.42,.6,-.99,.72,-1.41],["c",.18,-.69,.09,-1.47,-.18,-2.07],["c",-.15,-.3,-.33,-.51,-.6,-.63],["z"]],w:6.75,h:18.801},"accidentals.halfflat":{d:[["M",4.83,-14.07],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.6,-.12,9.06],["c",-.09,5.55,-.15,9.06,-.18,9.12],["c",-.03,.09,-.09,.18,-.15,.27],["c",-.24,.21,-.54,.24,-.81,.06],["c",-.06,-.03,-.27,-.24,-.45,-.42],["c",-.36,-.42,-.66,-.66,-1.8,-1.44],["c",-1.23,-.84,-1.83,-1.32,-2.25,-1.77],["c",-.66,-.78,-.96,-1.56,-.93,-2.46],["c",.09,-1.41,1.11,-2.58,2.4,-2.79],["c",.3,-.06,.84,-.03,1.23,.06],["c",.54,.12,1.08,.33,1.53,.63],["c",.12,.09,.24,.15,.24,.12],["c",0,0,-.12,-8.37,-.18,-9.75],["l",0,-.66],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",-1.65,10.95],["c",-.6,-.18,-1.08,.09,-1.38,.69],["c",-.27,.6,-.36,1.38,-.18,2.07],["c",.12,.42,.42,.99,.72,1.41],["c",.3,.42,.93,1.05,1.56,1.59],["l",.48,.39],["l",0,-.12],["c",.03,-.09,.03,-.48,.06,-.9],["c",.03,-.57,.03,-1.08,0,-2.22],["c",-.03,-1.62,-.03,-1.62,-.24,-2.07],["c",-.21,-.42,-.6,-.75,-1.02,-.84],["z"]],w:6.728,h:18.801},"accidentals.dblflat":{d:[["M",-.36,-14.07],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.36,-.03,5.25],["c",-.06,2.85,-.09,5.19,-.09,5.19],["c",0,.03,.12,-.03,.24,-.12],["c",.63,-.42,1.41,-.66,2.19,-.72],["c",.81,-.03,1.47,.21,2.04,.78],["c",.57,.54,.87,1.26,.93,2.04],["c",.03,.57,-.09,1.08,-.36,1.62],["c",-.42,.81,-1.02,1.38,-2.82,2.61],["c",-1.14,.78,-1.44,1.02,-1.8,1.44],["c",-.18,.18,-.39,.39,-.45,.42],["c",-.27,.18,-.57,.15,-.81,-.06],["c",-.06,-.09,-.12,-.18,-.15,-.27],["c",-.03,-.06,-.09,-3.27,-.18,-8.34],["c",-.09,-4.53,-.15,-8.58,-.18,-9.03],["l",0,-.78],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",3.18,11.01],["c",-.21,-.12,-.54,-.15,-.81,-.06],["c",-.54,.15,-.99,.63,-1.17,1.26],["c",-.06,.3,-.12,2.88,-.06,3.87],["c",.03,.42,.03,.81,.06,.9],["l",.03,.12],["l",.45,-.39],["c",.63,-.54,1.26,-1.17,1.56,-1.59],["c",.3,-.42,.6,-.99,.72,-1.41],["c",.18,-.69,.09,-1.47,-.18,-2.07],["c",-.15,-.3,-.33,-.51,-.6,-.63],["z"],["m",3,-11],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.36,-.03,5.25],["c",-.06,2.85,-.09,5.19,-.09,5.19],["c",0,.03,.12,-.03,.24,-.12],["c",.63,-.42,1.41,-.66,2.19,-.72],["c",.81,-.03,1.47,.21,2.04,.78],["c",.57,.54,.87,1.26,.93,2.04],["c",.03,.57,-.09,1.08,-.36,1.62],["c",-.42,.81,-1.02,1.38,-2.82,2.61],["c",-1.14,.78,-1.44,1.02,-1.8,1.44],["c",-.18,.18,-.39,.39,-.45,.42],["c",-.27,.18,-.57,.15,-.81,-.06],["c",-.06,-.09,-.12,-.18,-.15,-.27],["c",-.03,-.06,-.09,-3.27,-.18,-8.34],["c",-.09,-4.53,-.15,-8.58,-.18,-9.03],["l",0,-.78],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",3.18,11.01],["c",-.21,-.12,-.54,-.15,-.81,-.06],["c",-.54,.15,-.99,.63,-1.17,1.26],["c",-.06,.3,-.12,2.88,-.06,3.87],["c",.03,.42,.03,.81,.06,.9],["l",.03,.12],["l",.45,-.39],["c",.63,-.54,1.26,-1.17,1.56,-1.59],["c",.3,-.42,.6,-.99,.72,-1.41],["c",.18,-.69,.09,-1.47,-.18,-2.07],["c",-.15,-.3,-.33,-.51,-.6,-.63],["z"]],w:12.1,h:18.804},"accidentals.dblsharp":{d:[["M",-.18,-3.96],["c",.06,-.03,.12,-.06,.15,-.06],["c",.09,0,2.76,.27,2.79,.3],["c",.12,.03,.15,.12,.15,.51],["c",.06,.96,.24,1.59,.57,2.1],["c",.06,.09,.15,.21,.18,.24],["l",.09,.06],["l",.09,-.06],["c",.03,-.03,.12,-.15,.18,-.24],["c",.33,-.51,.51,-1.14,.57,-2.1],["c",0,-.39,.03,-.45,.12,-.51],["c",.03,0,.66,-.09,1.44,-.15],["c",1.47,-.15,1.5,-.15,1.56,-.03],["c",.03,.06,0,.42,-.09,1.44],["c",-.09,.72,-.15,1.35,-.15,1.38],["c",0,.03,-.03,.09,-.06,.12],["c",-.06,.06,-.12,.09,-.51,.09],["c",-1.08,.06,-1.8,.3,-2.28,.75],["l",-.12,.09],["l",.09,.09],["c",.12,.15,.39,.33,.63,.45],["c",.42,.18,.96,.27,1.68,.33],["c",.39,0,.45,.03,.51,.09],["c",.03,.03,.06,.09,.06,.12],["c",0,.03,.06,.66,.15,1.38],["c",.09,1.02,.12,1.38,.09,1.44],["c",-.06,.12,-.09,.12,-1.56,-.03],["c",-.78,-.06,-1.41,-.15,-1.44,-.15],["c",-.09,-.06,-.12,-.12,-.12,-.54],["c",-.06,-.93,-.24,-1.56,-.57,-2.07],["c",-.06,-.09,-.15,-.21,-.18,-.24],["l",-.09,-.06],["l",-.09,.06],["c",-.03,.03,-.12,.15,-.18,.24],["c",-.33,.51,-.51,1.14,-.57,2.07],["c",0,.42,-.03,.48,-.12,.54],["c",-.03,0,-.66,.09,-1.44,.15],["c",-1.47,.15,-1.5,.15,-1.56,.03],["c",-.03,-.06,0,-.42,.09,-1.44],["c",.09,-.72,.15,-1.35,.15,-1.38],["c",0,-.03,.03,-.09,.06,-.12],["c",.06,-.06,.12,-.09,.51,-.09],["c",.72,-.06,1.26,-.15,1.68,-.33],["c",.24,-.12,.51,-.3,.63,-.45],["l",.09,-.09],["l",-.12,-.09],["c",-.48,-.45,-1.2,-.69,-2.28,-.75],["c",-.39,0,-.45,-.03,-.51,-.09],["c",-.03,-.03,-.06,-.09,-.06,-.12],["c",0,-.03,-.06,-.63,-.12,-1.38],["c",-.09,-.72,-.15,-1.35,-.15,-1.38],["z"]],w:7.95,h:7.977},"dots.dot":{d:[["M",1.32,-1.68],["c",.09,-.03,.27,-.06,.39,-.06],["c",.96,0,1.74,.78,1.74,1.71],["c",0,.96,-.78,1.74,-1.71,1.74],["c",-.96,0,-1.74,-.78,-1.74,-1.71],["c",0,-.78,.54,-1.5,1.32,-1.68],["z"]],w:3.45,h:3.45},"noteheads.dbl":{d:[["M",-.69,-4.02],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["c",.06,.15,.06,.18,.06,1.41],["l",0,1.23],["l",.12,-.18],["c",.72,-1.26,2.64,-2.31,4.86,-2.64],["c",.81,-.15,1.11,-.15,2.13,-.15],["c",.99,0,1.29,0,2.1,.15],["c",.75,.12,1.38,.27,2.04,.54],["c",1.35,.51,2.34,1.26,2.82,2.1],["l",.12,.18],["l",0,-1.23],["c",0,-1.2,0,-1.26,.06,-1.38],["c",.09,-.18,.15,-.24,.33,-.33],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["l",.06,.15],["l",0,3.54],["l",0,3.54],["l",-.06,.15],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.18,.09,-.36,.09,-.54,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.06,-.12,-.06,-.18,-.06,-1.38],["l",0,-1.23],["l",-.12,.18],["c",-.48,.84,-1.47,1.59,-2.82,2.1],["c",-.84,.33,-1.71,.54,-2.85,.66],["c",-.45,.06,-2.16,.06,-2.61,0],["c",-1.14,-.12,-2.01,-.33,-2.85,-.66],["c",-1.35,-.51,-2.34,-1.26,-2.82,-2.1],["l",-.12,-.18],["l",0,1.23],["c",0,1.23,0,1.26,-.06,1.38],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.18,.09,-.36,.09,-.54,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["l",-.06,-.15],["l",0,-3.54],["c",0,-3.48,0,-3.54,.06,-3.66],["c",.09,-.18,.15,-.24,.33,-.33],["z"],["m",7.71,.63],["c",-.36,-.06,-.9,-.06,-1.14,0],["c",-.3,.03,-.66,.24,-.87,.42],["c",-.6,.54,-.9,1.62,-.75,2.82],["c",.12,.93,.51,1.68,1.11,2.31],["c",.75,.72,1.83,1.2,2.85,1.26],["c",1.05,.06,1.83,-.54,2.1,-1.65],["c",.21,-.9,.12,-1.95,-.24,-2.82],["c",-.36,-.81,-1.08,-1.53,-1.95,-1.95],["c",-.3,-.15,-.78,-.3,-1.11,-.39],["z"]],w:16.83,h:8.145},"noteheads.whole":{d:[["M",6.51,-4.05],["c",.51,-.03,2.01,0,2.52,.03],["c",1.41,.18,2.64,.51,3.72,1.08],["c",1.2,.63,1.95,1.41,2.19,2.31],["c",.09,.33,.09,.9,0,1.23],["c",-.24,.9,-.99,1.68,-2.19,2.31],["c",-1.08,.57,-2.28,.9,-3.75,1.08],["c",-.66,.06,-2.31,.06,-2.97,0],["c",-1.47,-.18,-2.67,-.51,-3.75,-1.08],["c",-1.2,-.63,-1.95,-1.41,-2.19,-2.31],["c",-.09,-.33,-.09,-.9,0,-1.23],["c",.24,-.9,.99,-1.68,2.19,-2.31],["c",1.2,-.63,2.61,-.99,4.23,-1.11],["z"],["m",.57,.66],["c",-.87,-.15,-1.53,0,-2.04,.51],["c",-.15,.15,-.24,.27,-.33,.48],["c",-.24,.51,-.36,1.08,-.33,1.77],["c",.03,.69,.18,1.26,.42,1.77],["c",.6,1.17,1.74,1.98,3.18,2.22],["c",1.11,.21,1.95,-.15,2.34,-.99],["c",.24,-.51,.36,-1.08,.33,-1.8],["c",-.06,-1.11,-.45,-2.04,-1.17,-2.76],["c",-.63,-.63,-1.47,-1.05,-2.4,-1.2],["z"]],w:14.985,h:8.097},"noteheads.half":{d:[["M",7.44,-4.05],["c",.06,-.03,.27,-.03,.48,-.03],["c",1.05,0,1.71,.24,2.1,.81],["c",.42,.6,.45,1.35,.18,2.4],["c",-.42,1.59,-1.14,2.73,-2.16,3.39],["c",-1.41,.93,-3.18,1.44,-5.4,1.53],["c",-1.17,.03,-1.89,-.21,-2.28,-.81],["c",-.42,-.6,-.45,-1.35,-.18,-2.4],["c",.42,-1.59,1.14,-2.73,2.16,-3.39],["c",.63,-.42,1.23,-.72,1.98,-.96],["c",.9,-.3,1.65,-.42,3.12,-.54],["z"],["m",1.29,.87],["c",-.27,-.09,-.63,-.12,-.9,-.03],["c",-.72,.24,-1.53,.69,-3.27,1.8],["c",-2.34,1.5,-3.3,2.25,-3.57,2.79],["c",-.36,.72,-.06,1.5,.66,1.77],["c",.24,.12,.69,.09,.99,0],["c",.84,-.3,1.92,-.93,4.14,-2.37],["c",1.62,-1.08,2.37,-1.71,2.61,-2.19],["c",.36,-.72,.06,-1.5,-.66,-1.77],["z"]],w:10.37,h:8.132},"noteheads.quarter":{d:[["M",6.09,-4.05],["c",.36,-.03,1.2,0,1.53,.06],["c",1.17,.24,1.89,.84,2.16,1.83],["c",.06,.18,.06,.3,.06,.66],["c",0,.45,0,.63,-.15,1.08],["c",-.66,2.04,-3.06,3.93,-5.52,4.38],["c",-.54,.09,-1.44,.09,-1.83,.03],["c",-1.23,-.27,-1.98,-.87,-2.25,-1.86],["c",-.06,-.18,-.06,-.3,-.06,-.66],["c",0,-.45,0,-.63,.15,-1.08],["c",.24,-.78,.75,-1.53,1.44,-2.22],["c",1.2,-1.2,2.85,-2.01,4.47,-2.22],["z"]],w:9.81,h:8.094},"noteheads.slash.nostem":{d:[["M",9.3,-7.77],["c",.06,-.06,.18,-.06,1.71,-.06],["l",1.65,0],["l",.09,.09],["c",.06,.06,.06,.09,.06,.15],["c",-.03,.12,-9.21,15.24,-9.3,15.33],["c",-.06,.06,-.18,.06,-1.71,.06],["l",-1.65,0],["l",-.09,-.09],["c",-.06,-.06,-.06,-.09,-.06,-.15],["c",.03,-.12,9.21,-15.24,9.3,-15.33],["z"]],w:12.81,h:15.63},"noteheads.indeterminate":{d:[["M",.78,-4.05],["c",.12,-.03,.24,-.03,.36,.03],["c",.03,.03,.93,.72,1.95,1.56],["l",1.86,1.5],["l",1.86,-1.5],["c",1.02,-.84,1.92,-1.53,1.95,-1.56],["c",.21,-.12,.33,-.09,.75,.24],["c",.3,.27,.36,.36,.36,.54],["c",0,.03,-.03,.12,-.06,.18],["c",-.03,.06,-.9,.75,-1.89,1.56],["l",-1.8,1.47],["c",0,.03,.81,.69,1.8,1.5],["c",.99,.81,1.86,1.5,1.89,1.56],["c",.03,.06,.06,.15,.06,.18],["c",0,.18,-.06,.27,-.36,.54],["c",-.42,.33,-.54,.36,-.75,.24],["c",-.03,-.03,-.93,-.72,-1.95,-1.56],["l",-1.86,-1.5],["l",-1.86,1.5],["c",-1.02,.84,-1.92,1.53,-1.95,1.56],["c",-.21,.12,-.33,.09,-.75,-.24],["c",-.3,-.27,-.36,-.36,-.36,-.54],["c",0,-.03,.03,-.12,.06,-.18],["c",.03,-.06,.9,-.75,1.89,-1.56],["l",1.8,-1.47],["c",0,-.03,-.81,-.69,-1.8,-1.5],["c",-.99,-.81,-1.86,-1.5,-1.89,-1.56],["c",-.06,-.12,-.09,-.21,-.03,-.36],["c",.03,-.09,.57,-.57,.72,-.63],["z"]],w:9.843,h:8.139},"scripts.ufermata":{d:[["M",-.75,-10.77],["c",.12,0,.45,-.03,.69,-.03],["c",2.91,-.03,5.55,1.53,7.41,4.35],["c",1.17,1.71,1.95,3.72,2.43,6.03],["c",.12,.51,.12,.57,.03,.69],["c",-.12,.21,-.48,.27,-.69,.12],["c",-.12,-.09,-.18,-.24,-.27,-.69],["c",-.78,-3.63,-3.42,-6.54,-6.78,-7.38],["c",-.78,-.21,-1.2,-.24,-2.07,-.24],["c",-.63,0,-.84,0,-1.2,.06],["c",-1.83,.27,-3.42,1.08,-4.8,2.37],["c",-1.41,1.35,-2.4,3.21,-2.85,5.19],["c",-.09,.45,-.15,.6,-.27,.69],["c",-.21,.15,-.57,.09,-.69,-.12],["c",-.09,-.12,-.09,-.18,.03,-.69],["c",.33,-1.62,.78,-3,1.47,-4.38],["c",1.77,-3.54,4.44,-5.67,7.56,-5.97],["z"],["m",.33,7.47],["c",1.38,-.3,2.58,.9,2.31,2.25],["c",-.15,.72,-.78,1.35,-1.47,1.5],["c",-1.38,.27,-2.58,-.93,-2.31,-2.31],["c",.15,-.69,.78,-1.29,1.47,-1.44],["z"]],w:19.748,h:11.289},"scripts.dfermata":{d:[["M",-9.63,-.42],["c",.15,-.09,.36,-.06,.51,.03],["c",.12,.09,.18,.24,.27,.66],["c",.78,3.66,3.42,6.57,6.78,7.41],["c",.78,.21,1.2,.24,2.07,.24],["c",.63,0,.84,0,1.2,-.06],["c",1.83,-.27,3.42,-1.08,4.8,-2.37],["c",1.41,-1.35,2.4,-3.21,2.85,-5.22],["c",.09,-.42,.15,-.57,.27,-.66],["c",.21,-.15,.57,-.09,.69,.12],["c",.09,.12,.09,.18,-.03,.69],["c",-.33,1.62,-.78,3,-1.47,4.38],["c",-1.92,3.84,-4.89,6,-8.31,6],["c",-3.42,0,-6.39,-2.16,-8.31,-6],["c",-.48,-.96,-.84,-1.92,-1.14,-2.97],["c",-.18,-.69,-.42,-1.74,-.42,-1.92],["c",0,-.12,.09,-.27,.24,-.33],["z"],["m",9.21,0],["c",1.2,-.27,2.34,.63,2.34,1.86],["c",0,.9,-.66,1.68,-1.5,1.89],["c",-1.38,.27,-2.58,-.93,-2.31,-2.31],["c",.15,-.69,.78,-1.29,1.47,-1.44],["z"]],w:19.744,h:11.274},"scripts.sforzato":{d:[["M",-6.45,-3.69],["c",.06,-.03,.15,-.06,.18,-.06],["c",.06,0,2.85,.72,6.24,1.59],["l",6.33,1.65],["c",.33,.06,.45,.21,.45,.51],["c",0,.3,-.12,.45,-.45,.51],["l",-6.33,1.65],["c",-3.39,.87,-6.18,1.59,-6.21,1.59],["c",-.21,0,-.48,-.24,-.51,-.45],["c",0,-.15,.06,-.36,.18,-.45],["c",.09,-.06,.87,-.27,3.84,-1.05],["c",2.04,-.54,3.84,-.99,4.02,-1.02],["c",.15,-.06,1.14,-.24,2.22,-.42],["c",1.05,-.18,1.92,-.36,1.92,-.36],["c",0,0,-.87,-.18,-1.92,-.36],["c",-1.08,-.18,-2.07,-.36,-2.22,-.42],["c",-.18,-.03,-1.98,-.48,-4.02,-1.02],["c",-2.97,-.78,-3.75,-.99,-3.84,-1.05],["c",-.12,-.09,-.18,-.3,-.18,-.45],["c",.03,-.15,.15,-.3,.3,-.39],["z"]],w:13.5,h:7.5},"scripts.staccato":{d:[["M",-.36,-1.47],["c",.93,-.21,1.86,.51,1.86,1.47],["c",0,.93,-.87,1.65,-1.8,1.47],["c",-.54,-.12,-1.02,-.57,-1.14,-1.08],["c",-.21,-.81,.27,-1.65,1.08,-1.86],["z"]],w:2.989,h:3.004},"scripts.tenuto":{d:[["M",-4.2,-.48],["l",.12,-.06],["l",4.08,0],["l",4.08,0],["l",.12,.06],["c",.39,.21,.39,.75,0,.96],["l",-.12,.06],["l",-4.08,0],["l",-4.08,0],["l",-.12,-.06],["c",-.39,-.21,-.39,-.75,0,-.96],["z"]],w:8.985,h:1.08},"scripts.umarcato":{d:[["M",-.15,-8.19],["c",.15,-.12,.36,-.03,.45,.15],["c",.21,.42,3.45,7.65,3.45,7.71],["c",0,.12,-.12,.27,-.21,.3],["c",-.03,.03,-.51,.03,-1.14,.03],["c",-1.05,0,-1.08,0,-1.17,-.06],["c",-.09,-.06,-.24,-.36,-1.17,-2.4],["c",-.57,-1.29,-1.05,-2.34,-1.08,-2.34],["c",0,-.03,-.51,1.02,-1.08,2.34],["c",-.93,2.07,-1.08,2.34,-1.14,2.4],["c",-.06,.03,-.15,.06,-.18,.06],["c",-.15,0,-.33,-.18,-.33,-.33],["c",0,-.06,3.24,-7.32,3.45,-7.71],["c",.03,-.06,.09,-.15,.15,-.15],["z"]],w:7.5,h:8.245},"scripts.dmarcato":{d:[["M",-3.57,.03],["c",.03,0,.57,-.03,1.17,-.03],["c",1.05,0,1.08,0,1.17,.06],["c",.09,.06,.24,.36,1.17,2.4],["c",.57,1.29,1.05,2.34,1.08,2.34],["c",0,.03,.51,-1.02,1.08,-2.34],["c",.93,-2.07,1.08,-2.34,1.14,-2.4],["c",.06,-.03,.15,-.06,.18,-.06],["c",.15,0,.33,.18,.33,.33],["c",0,.09,-3.45,7.74,-3.54,7.83],["c",-.12,.12,-.3,.12,-.42,0],["c",-.09,-.09,-3.54,-7.74,-3.54,-7.83],["c",0,-.09,.12,-.27,.18,-.3],["z"]],w:7.5,h:8.25},"scripts.stopped":{d:[["M",-.27,-4.08],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["l",.06,.15],["l",0,1.5],["l",0,1.47],["l",1.47,0],["l",1.5,0],["l",.15,.06],["c",.15,.09,.21,.15,.3,.33],["c",.09,.18,.09,.36,0,.54],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.12,.06,-.18,.06,-1.62,.06],["l",-1.47,0],["l",0,1.47],["l",0,1.47],["l",-.06,.15],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.18,.09,-.36,.09,-.54,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["l",-.06,-.15],["l",0,-1.47],["l",0,-1.47],["l",-1.47,0],["c",-1.44,0,-1.5,0,-1.62,-.06],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.09,-.18,-.09,-.36,0,-.54],["c",.09,-.18,.15,-.24,.33,-.33],["l",.15,-.06],["l",1.47,0],["l",1.47,0],["l",0,-1.47],["c",0,-1.44,0,-1.5,.06,-1.62],["c",.09,-.18,.15,-.24,.33,-.33],["z"]],w:8.295,h:8.295},"scripts.upbow":{d:[["M",-4.65,-15.54],["c",.12,-.09,.36,-.06,.48,.03],["c",.03,.03,.09,.09,.12,.15],["c",.03,.06,.66,2.13,1.41,4.62],["c",1.35,4.41,1.38,4.56,2.01,6.96],["l",.63,2.46],["l",.63,-2.46],["c",.63,-2.4,.66,-2.55,2.01,-6.96],["c",.75,-2.49,1.38,-4.56,1.41,-4.62],["c",.06,-.15,.18,-.21,.36,-.24],["c",.15,0,.3,.06,.39,.18],["c",.15,.21,.24,-.18,-2.1,7.56],["c",-1.2,3.96,-2.22,7.32,-2.25,7.41],["c",0,.12,-.06,.27,-.09,.3],["c",-.12,.21,-.6,.21,-.72,0],["c",-.03,-.03,-.09,-.18,-.09,-.3],["c",-.03,-.09,-1.05,-3.45,-2.25,-7.41],["c",-2.34,-7.74,-2.25,-7.35,-2.1,-7.56],["c",.03,-.03,.09,-.09,.15,-.12],["z"]],w:9.73,h:15.608},"scripts.downbow":{d:[["M",-5.55,-9.93],["l",.09,-.06],["l",5.46,0],["l",5.46,0],["l",.09,.06],["l",.06,.09],["l",0,4.77],["c",0,5.28,0,4.89,-.18,5.01],["c",-.18,.12,-.42,.06,-.54,-.12],["c",-.06,-.09,-.06,-.18,-.06,-2.97],["l",0,-2.85],["l",-4.83,0],["l",-4.83,0],["l",0,2.85],["c",0,2.79,0,2.88,-.06,2.97],["c",-.15,.24,-.51,.24,-.66,0],["c",-.06,-.09,-.06,-.21,-.06,-4.89],["l",0,-4.77],["z"]],w:11.22,h:9.992},"scripts.turn":{d:[["M",-4.77,-3.9],["c",.36,-.06,1.05,-.06,1.44,.03],["c",.78,.15,1.5,.51,2.34,1.14],["c",.6,.45,1.05,.87,2.22,2.01],["c",1.11,1.08,1.62,1.5,2.22,1.86],["c",.6,.36,1.32,.57,1.92,.57],["c",.9,0,1.71,-.57,1.89,-1.35],["c",.24,-.93,-.39,-1.89,-1.35,-2.1],["l",-.15,-.06],["l",-.09,.15],["c",-.03,.09,-.15,.24,-.24,.33],["c",-.72,.72,-2.04,.54,-2.49,-.36],["c",-.48,-.93,.03,-1.86,1.17,-2.19],["c",.3,-.09,1.02,-.09,1.35,0],["c",.99,.27,1.74,.87,2.25,1.83],["c",.69,1.41,.63,3,-.21,4.26],["c",-.21,.3,-.69,.81,-.99,1.02],["c",-.3,.21,-.84,.45,-1.17,.54],["c",-1.23,.36,-2.49,.15,-3.72,-.6],["c",-.75,-.48,-1.41,-1.02,-2.85,-2.46],["c",-1.11,-1.08,-1.62,-1.5,-2.22,-1.86],["c",-.6,-.36,-1.32,-.57,-1.92,-.57],["c",-.9,0,-1.71,.57,-1.89,1.35],["c",-.24,.93,.39,1.89,1.35,2.1],["l",.15,.06],["l",.09,-.15],["c",.03,-.09,.15,-.24,.24,-.33],["c",.72,-.72,2.04,-.54,2.49,.36],["c",.48,.93,-.03,1.86,-1.17,2.19],["c",-.3,.09,-1.02,.09,-1.35,0],["c",-.99,-.27,-1.74,-.87,-2.25,-1.83],["c",-.69,-1.41,-.63,-3,.21,-4.26],["c",.21,-.3,.69,-.81,.99,-1.02],["c",.48,-.33,1.11,-.57,1.74,-.66],["z"]],w:16.366,h:7.893},"scripts.trill":{d:[["M",-.51,-16.02],["c",.12,-.09,.21,-.18,.21,-.18],["l",-.81,4.02],["l",-.81,4.02],["c",.03,0,.51,-.27,1.08,-.6],["c",.6,-.3,1.14,-.63,1.26,-.66],["c",1.14,-.54,2.31,-.6,3.09,-.18],["c",.27,.15,.54,.36,.6,.51],["l",.06,.12],["l",.21,-.21],["c",.9,-.81,2.22,-.99,3.12,-.42],["c",.6,.42,.9,1.14,.78,2.07],["c",-.15,1.29,-1.05,2.31,-1.95,2.25],["c",-.48,-.03,-.78,-.3,-.96,-.81],["c",-.09,-.27,-.09,-.9,-.03,-1.2],["c",.21,-.75,.81,-1.23,1.59,-1.32],["l",.24,-.03],["l",-.09,-.12],["c",-.51,-.66,-1.62,-.63,-2.31,.03],["c",-.39,.42,-.3,.09,-1.23,4.77],["l",-.81,4.14],["c",-.03,0,-.12,-.03,-.21,-.09],["c",-.33,-.15,-.54,-.18,-.99,-.18],["c",-.42,0,-.66,.03,-1.05,.18],["c",-.12,.06,-.21,.09,-.21,.09],["c",0,-.03,.36,-1.86,.81,-4.11],["c",.9,-4.47,.87,-4.26,.69,-4.53],["c",-.21,-.36,-.66,-.51,-1.17,-.36],["c",-.15,.06,-2.22,1.14,-2.58,1.38],["c",-.12,.09,-.12,.09,-.21,.6],["l",-.09,.51],["l",.21,.24],["c",.63,.75,1.02,1.47,1.2,2.19],["c",.06,.27,.06,.36,.06,.81],["c",0,.42,0,.54,-.06,.78],["c",-.15,.54,-.33,.93,-.63,1.35],["c",-.18,.24,-.57,.63,-.81,.78],["c",-.24,.15,-.63,.36,-.84,.42],["c",-.27,.06,-.66,.06,-.87,.03],["c",-.81,-.18,-1.32,-1.05,-1.38,-2.46],["c",-.03,-.6,.03,-.99,.33,-2.46],["c",.21,-1.08,.24,-1.32,.21,-1.29],["c",-1.2,.48,-2.4,.75,-3.21,.72],["c",-.69,-.06,-1.17,-.3,-1.41,-.72],["c",-.39,-.75,-.12,-1.8,.66,-2.46],["c",.24,-.18,.69,-.42,1.02,-.51],["c",.69,-.18,1.53,-.15,2.31,.09],["c",.3,.09,.75,.3,.99,.45],["c",.12,.09,.15,.09,.15,.03],["c",.03,-.03,.33,-1.59,.72,-3.45],["c",.36,-1.86,.66,-3.42,.69,-3.45],["c",0,-.03,.03,-.03,.21,.03],["c",.21,.06,.27,.06,.48,.06],["c",.42,-.03,.78,-.18,1.26,-.48],["c",.15,-.12,.36,-.27,.48,-.39],["z"],["m",-5.73,7.68],["c",-.27,-.03,-.96,-.06,-1.2,-.03],["c",-.81,.12,-1.35,.57,-1.5,1.2],["c",-.18,.66,.12,1.14,.75,1.29],["c",.66,.12,1.92,-.12,3.18,-.66],["l",.33,-.15],["l",.09,-.39],["c",.06,-.21,.09,-.42,.09,-.45],["c",0,-.03,-.45,-.3,-.75,-.45],["c",-.27,-.15,-.66,-.27,-.99,-.36],["z"],["m",4.29,3.63],["c",-.24,-.39,-.51,-.75,-.51,-.69],["c",-.06,.12,-.39,1.92,-.45,2.28],["c",-.09,.54,-.12,1.14,-.06,1.38],["c",.06,.42,.21,.6,.51,.57],["c",.39,-.06,.75,-.48,.93,-1.14],["c",.09,-.33,.09,-1.05,0,-1.38],["c",-.09,-.39,-.24,-.69,-.42,-1.02],["z"]],w:17.963,h:16.49},"scripts.segno":{d:[["M",-3.72,-11.22],["c",.78,-.09,1.59,.03,2.31,.42],["c",1.2,.6,2.01,1.71,2.31,3.09],["c",.09,.42,.09,1.2,.03,1.5],["c",-.15,.45,-.39,.81,-.66,.93],["c",-.33,.18,-.84,.21,-1.23,.15],["c",-.81,-.18,-1.32,-.93,-1.26,-1.89],["c",.03,-.36,.09,-.57,.24,-.9],["c",.15,-.33,.45,-.6,.72,-.75],["c",.12,-.06,.18,-.09,.18,-.12],["c",0,-.03,-.03,-.15,-.09,-.24],["c",-.18,-.45,-.54,-.87,-.96,-1.08],["c",-1.11,-.57,-2.34,-.18,-2.88,.9],["c",-.24,.51,-.33,1.11,-.24,1.83],["c",.27,1.92,1.5,3.54,3.93,5.13],["c",.48,.33,1.26,.78,1.29,.78],["c",.03,0,1.35,-2.19,2.94,-4.89],["l",2.88,-4.89],["l",.84,0],["l",.87,0],["l",-.03,.06],["c",-.15,.21,-6.15,10.41,-6.15,10.44],["c",0,0,.21,.15,.48,.27],["c",2.61,1.47,4.35,3.03,5.13,4.65],["c",1.14,2.34,.51,5.07,-1.44,6.39],["c",-.66,.42,-1.32,.63,-2.13,.69],["c",-2.01,.09,-3.81,-1.41,-4.26,-3.54],["c",-.09,-.42,-.09,-1.2,-.03,-1.5],["c",.15,-.45,.39,-.81,.66,-.93],["c",.33,-.18,.84,-.21,1.23,-.15],["c",.81,.18,1.32,.93,1.26,1.89],["c",-.03,.36,-.09,.57,-.24,.9],["c",-.15,.33,-.45,.6,-.72,.75],["c",-.12,.06,-.18,.09,-.18,.12],["c",0,.03,.03,.15,.09,.24],["c",.18,.45,.54,.87,.96,1.08],["c",1.11,.57,2.34,.18,2.88,-.9],["c",.24,-.51,.33,-1.11,.24,-1.83],["c",-.27,-1.92,-1.5,-3.54,-3.93,-5.13],["c",-.48,-.33,-1.26,-.78,-1.29,-.78],["c",-.03,0,-1.35,2.19,-2.91,4.89],["l",-2.88,4.89],["l",-.87,0],["l",-.87,0],["l",.03,-.06],["c",.15,-.21,6.15,-10.41,6.15,-10.44],["c",0,0,-.21,-.15,-.48,-.3],["c",-2.61,-1.44,-4.35,-3,-5.13,-4.62],["c",-.9,-1.89,-.72,-4.02,.48,-5.52],["c",.69,-.84,1.68,-1.41,2.73,-1.53],["z"],["m",8.76,9.09],["c",.03,-.03,.15,-.03,.27,-.03],["c",.33,.03,.57,.18,.72,.48],["c",.09,.18,.09,.57,0,.75],["c",-.09,.18,-.21,.3,-.36,.39],["c",-.15,.06,-.21,.06,-.39,.06],["c",-.21,0,-.27,0,-.39,-.06],["c",-.3,-.15,-.48,-.45,-.48,-.75],["c",0,-.39,.24,-.72,.63,-.84],["z"],["m",-10.53,2.61],["c",.03,-.03,.15,-.03,.27,-.03],["c",.33,.03,.57,.18,.72,.48],["c",.09,.18,.09,.57,0,.75],["c",-.09,.18,-.21,.3,-.36,.39],["c",-.15,.06,-.21,.06,-.39,.06],["c",-.21,0,-.27,0,-.39,-.06],["c",-.3,-.15,-.48,-.45,-.48,-.75],["c",0,-.39,.24,-.72,.63,-.84],["z"]],w:15,h:22.504},"scripts.coda":{d:[["M",-.21,-10.47],["c",.18,-.12,.42,-.06,.54,.12],["c",.06,.09,.06,.18,.06,1.5],["l",0,1.38],["l",.18,0],["c",.39,.06,.96,.24,1.38,.48],["c",1.68,.93,2.82,3.24,3.03,6.12],["c",.03,.24,.03,.45,.03,.45],["c",0,.03,.6,.03,1.35,.03],["c",1.5,0,1.47,0,1.59,.18],["c",.09,.12,.09,.3,0,.42],["c",-.12,.18,-.09,.18,-1.59,.18],["c",-.75,0,-1.35,0,-1.35,.03],["c",0,0,0,.21,-.03,.42],["c",-.24,3.15,-1.53,5.58,-3.45,6.36],["c",-.27,.12,-.72,.24,-.96,.27],["l",-.18,0],["l",0,1.38],["c",0,1.32,0,1.41,-.06,1.5],["c",-.15,.24,-.51,.24,-.66,0],["c",-.06,-.09,-.06,-.18,-.06,-1.5],["l",0,-1.38],["l",-.18,0],["c",-.39,-.06,-.96,-.24,-1.38,-.48],["c",-1.68,-.93,-2.82,-3.24,-3.03,-6.15],["c",-.03,-.21,-.03,-.42,-.03,-.42],["c",0,-.03,-.6,-.03,-1.35,-.03],["c",-1.5,0,-1.47,0,-1.59,-.18],["c",-.09,-.12,-.09,-.3,0,-.42],["c",.12,-.18,.09,-.18,1.59,-.18],["c",.75,0,1.35,0,1.35,-.03],["c",0,0,0,-.21,.03,-.45],["c",.24,-3.12,1.53,-5.55,3.45,-6.33],["c",.27,-.12,.72,-.24,.96,-.27],["l",.18,0],["l",0,-1.38],["c",0,-1.53,0,-1.5,.18,-1.62],["z"],["m",-.18,6.93],["c",0,-2.97,0,-3.15,-.06,-3.15],["c",-.09,0,-.51,.15,-.66,.21],["c",-.87,.51,-1.38,1.62,-1.56,3.51],["c",-.06,.54,-.12,1.59,-.12,2.16],["l",0,.42],["l",1.2,0],["l",1.2,0],["l",0,-3.15],["z"],["m",1.17,-3.06],["c",-.09,-.03,-.21,-.06,-.27,-.09],["l",-.12,0],["l",0,3.15],["l",0,3.15],["l",1.2,0],["l",1.2,0],["l",0,-.81],["c",-.06,-2.4,-.33,-3.69,-.93,-4.59],["c",-.27,-.39,-.66,-.69,-1.08,-.81],["z"],["m",-1.17,10.14],["l",0,-3.15],["l",-1.2,0],["l",-1.2,0],["l",0,.81],["c",.03,.96,.06,1.47,.15,2.13],["c",.24,2.04,.96,3.12,2.13,3.36],["l",.12,0],["l",0,-3.15],["z"],["m",3.18,-2.34],["l",0,-.81],["l",-1.2,0],["l",-1.2,0],["l",0,3.15],["l",0,3.15],["l",.12,0],["c",1.17,-.24,1.89,-1.32,2.13,-3.36],["c",.09,-.66,.12,-1.17,.15,-2.13],["z"]],w:16.035,h:21.062},"scripts.comma":{d:[["M",1.14,-4.62],["c",.3,-.12,.69,-.03,.93,.15],["c",.12,.12,.36,.45,.51,.78],["c",.9,1.77,.54,4.05,-1.08,6.75],["c",-.36,.63,-.87,1.38,-.96,1.44],["c",-.18,.12,-.42,.06,-.54,-.12],["c",-.09,-.18,-.09,-.3,.12,-.6],["c",.96,-1.44,1.44,-2.97,1.38,-4.35],["c",-.06,-.93,-.3,-1.68,-.78,-2.46],["c",-.27,-.39,-.33,-.63,-.24,-.96],["c",.09,-.27,.36,-.54,.66,-.63],["z"]],w:3.042,h:9.237},"scripts.roll":{d:[["M",1.95,-6],["c",.21,-.09,.36,-.09,.57,0],["c",.39,.15,.63,.39,1.47,1.35],["c",.66,.75,.78,.87,1.08,1.05],["c",.75,.45,1.65,.42,2.4,-.06],["c",.12,-.09,.27,-.27,.54,-.6],["c",.42,-.54,.51,-.63,.69,-.63],["c",.09,0,.3,.12,.36,.21],["c",.09,.12,.12,.3,.03,.42],["c",-.06,.12,-3.15,3.9,-3.3,4.08],["c",-.06,.06,-.18,.12,-.27,.18],["c",-.27,.12,-.6,.06,-.99,-.27],["c",-.27,-.21,-.42,-.39,-1.08,-1.14],["c",-.63,-.72,-.81,-.9,-1.17,-1.08],["c",-.36,-.18,-.57,-.21,-.99,-.21],["c",-.39,0,-.63,.03,-.93,.18],["c",-.36,.15,-.51,.27,-.9,.81],["c",-.24,.27,-.45,.51,-.48,.54],["c",-.12,.09,-.27,.06,-.39,0],["c",-.24,-.15,-.33,-.39,-.21,-.6],["c",.09,-.12,3.18,-3.87,3.33,-4.02],["c",.06,-.06,.18,-.15,.24,-.21],["z"]],w:10.817,h:6.125},"scripts.prall":{d:[["M",-4.38,-3.69],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["c",.03,0,.57,-.84,1.23,-1.83],["c",1.14,-1.68,1.23,-1.83,1.35,-1.89],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["l",.48,-.69],["c",.51,-.78,.54,-.84,.69,-.9],["c",.42,-.18,.87,.15,.81,.6],["c",-.03,.12,-.3,.51,-1.5,2.37],["c",-1.38,2.07,-1.5,2.22,-1.62,2.28],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.89,-1.95],["l",-1.53,-1.83],["c",-.03,0,-.57,.84,-1.23,1.83],["c",-1.14,1.68,-1.23,1.83,-1.35,1.89],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.89,-1.95],["l",-1.53,-1.83],["l",-.48,.69],["c",-.51,.78,-.54,.84,-.69,.9],["c",-.42,.18,-.87,-.15,-.81,-.6],["c",.03,-.12,.3,-.51,1.5,-2.37],["c",1.38,-2.07,1.5,-2.22,1.62,-2.28],["z"]],w:15.011,h:7.5},"scripts.arpeggio":{d:[["M",1.5,0],["c",1.5,2,1.5,3,1.5,3],["s",0,1,-2,1.5],["s",-.5,3,1,5.5],["l",1.5,0],["s",-1.75,-2,-1.9,-3.25],["s",2.15,-.6,2.95,-1.6],["s",.45,-1,.5,-1.25],["s",0,-1,-2,-3.9],["l",-1.5,0],["z"]],w:5,h:10},"scripts.mordent":{d:[["M",-.21,-4.95],["c",.27,-.15,.63,0,.75,.27],["c",.06,.12,.06,.24,.06,1.44],["l",0,1.29],["l",.57,-.84],["c",.51,-.75,.57,-.84,.69,-.9],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["l",.48,-.69],["c",.51,-.78,.54,-.84,.69,-.9],["c",.42,-.18,.87,.15,.81,.6],["c",-.03,.12,-.3,.51,-1.5,2.37],["c",-1.38,2.07,-1.5,2.22,-1.62,2.28],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.83,-1.89],["c",-.81,-.99,-1.5,-1.8,-1.53,-1.86],["c",-.06,-.03,-.06,-.03,-.12,.03],["c",-.06,.06,-.06,.15,-.06,2.28],["c",0,1.95,0,2.25,-.06,2.34],["c",-.18,.45,-.81,.48,-1.05,.03],["c",-.03,-.06,-.06,-.24,-.06,-1.41],["l",0,-1.35],["l",-.57,.84],["c",-.54,.78,-.6,.87,-.72,.93],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.89,-1.95],["l",-1.53,-1.83],["l",-.48,.69],["c",-.51,.78,-.54,.84,-.69,.9],["c",-.42,.18,-.87,-.15,-.81,-.6],["c",.03,-.12,.3,-.51,1.5,-2.37],["c",1.38,-2.07,1.5,-2.22,1.62,-2.28],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["c",.03,0,.06,-.06,.09,-.09],["c",.06,-.12,.06,-.15,.06,-2.28],["c",0,-1.92,0,-2.22,.06,-2.31],["c",.06,-.15,.15,-.24,.3,-.3],["z"]],w:15.011,h:10.012},"flags.u8th":{d:[["M",-.42,3.75],["l",0,-3.75],["l",.21,0],["l",.21,0],["l",0,.18],["c",0,.3,.06,.84,.12,1.23],["c",.24,1.53,.9,3.12,2.13,5.16],["l",.99,1.59],["c",.87,1.44,1.38,2.34,1.77,3.09],["c",.81,1.68,1.2,3.06,1.26,4.53],["c",.03,1.53,-.21,3.27,-.75,5.01],["c",-.21,.69,-.51,1.5,-.6,1.59],["c",-.09,.12,-.27,.21,-.42,.21],["c",-.15,0,-.42,-.12,-.51,-.21],["c",-.15,-.18,-.18,-.42,-.09,-.66],["c",.15,-.33,.45,-1.2,.57,-1.62],["c",.42,-1.38,.6,-2.58,.6,-3.9],["c",0,-.66,0,-.81,-.06,-1.11],["c",-.39,-2.07,-1.8,-4.26,-4.59,-7.14],["l",-.42,-.45],["l",-.21,0],["l",-.21,0],["l",0,-3.75],["z"]],w:6.692,h:22.59},"flags.u16th":{d:[["M",-.42,7.5],["l",0,-7.5],["l",.21,0],["l",.21,0],["l",0,.39],["c",.06,1.08,.39,2.19,.99,3.39],["c",.45,.9,.87,1.59,1.95,3.12],["c",1.29,1.86,1.77,2.64,2.22,3.57],["c",.45,.93,.72,1.8,.87,2.64],["c",.06,.51,.06,1.5,0,1.92],["c",-.12,.6,-.3,1.2,-.54,1.71],["l",-.09,.24],["l",.18,.45],["c",.51,1.2,.72,2.22,.69,3.42],["c",-.06,1.53,-.39,3.03,-.99,4.53],["c",-.3,.75,-.36,.81,-.57,.9],["c",-.15,.09,-.33,.06,-.48,0],["c",-.18,-.09,-.27,-.18,-.33,-.33],["c",-.09,-.18,-.06,-.3,.12,-.75],["c",.66,-1.41,1.02,-2.88,1.08,-4.32],["c",0,-.6,-.03,-1.05,-.18,-1.59],["c",-.3,-1.2,-.99,-2.4,-2.25,-3.87],["c",-.42,-.48,-1.53,-1.62,-2.19,-2.22],["l",-.45,-.42],["l",-.03,1.11],["l",0,1.11],["l",-.21,0],["l",-.21,0],["l",0,-7.5],["z"],["m",1.65,.09],["c",-.3,-.3,-.69,-.72,-.9,-.87],["l",-.33,-.33],["l",0,.15],["c",0,.3,.06,.81,.15,1.26],["c",.27,1.29,.87,2.61,2.04,4.29],["c",.15,.24,.6,.87,.96,1.38],["l",1.08,1.53],["l",.42,.63],["c",.03,0,.12,-.36,.21,-.72],["c",.06,-.33,.06,-1.2,0,-1.62],["c",-.33,-1.71,-1.44,-3.48,-3.63,-5.7],["z"]],w:6.693,h:26.337},"flags.u32nd":{d:[["M",-.42,11.25],["l",0,-11.25],["l",.21,0],["l",.21,0],["l",0,.36],["c",.09,1.68,.69,3.27,2.07,5.46],["l",.87,1.35],["c",1.02,1.62,1.47,2.37,1.86,3.18],["c",.48,1.02,.78,1.92,.93,2.88],["c",.06,.48,.06,1.5,0,1.89],["c",-.09,.42,-.21,.87,-.36,1.26],["l",-.12,.3],["l",.15,.39],["c",.69,1.56,.84,2.88,.54,4.38],["c",-.09,.45,-.27,1.08,-.45,1.47],["l",-.12,.24],["l",.18,.36],["c",.33,.72,.57,1.56,.69,2.34],["c",.12,1.02,-.06,2.52,-.42,3.84],["c",-.27,.93,-.75,2.13,-.93,2.31],["c",-.18,.15,-.45,.18,-.66,.09],["c",-.18,-.09,-.27,-.18,-.33,-.33],["c",-.09,-.18,-.06,-.3,.06,-.6],["c",.21,-.36,.42,-.9,.57,-1.38],["c",.51,-1.41,.69,-3.06,.48,-4.08],["c",-.15,-.81,-.57,-1.68,-1.2,-2.55],["c",-.72,-.99,-1.83,-2.13,-3.3,-3.33],["l",-.48,-.42],["l",-.03,1.53],["l",0,1.56],["l",-.21,0],["l",-.21,0],["l",0,-11.25],["z"],["m",1.26,-3.96],["c",-.27,-.3,-.54,-.6,-.66,-.72],["l",-.18,-.21],["l",0,.42],["c",.06,.87,.24,1.74,.66,2.67],["c",.36,.87,.96,1.86,1.92,3.18],["c",.21,.33,.63,.87,.87,1.23],["c",.27,.39,.6,.84,.75,1.08],["l",.27,.39],["l",.03,-.12],["c",.12,-.45,.15,-1.05,.09,-1.59],["c",-.27,-1.86,-1.38,-3.78,-3.75,-6.33],["z"],["m",-.27,6.09],["c",-.27,-.21,-.48,-.42,-.51,-.45],["c",-.06,-.03,-.06,-.03,-.06,.21],["c",0,.9,.3,2.04,.81,3.09],["c",.48,1.02,.96,1.77,2.37,3.63],["c",.6,.78,1.05,1.44,1.29,1.77],["c",.06,.12,.15,.21,.15,.18],["c",.03,-.03,.18,-.57,.24,-.87],["c",.06,-.45,.06,-1.32,-.03,-1.74],["c",-.09,-.48,-.24,-.9,-.51,-1.44],["c",-.66,-1.35,-1.83,-2.7,-3.75,-4.38],["z"]],w:6.697,h:32.145},"flags.u64th":{d:[["M",-.42,15],["l",0,-15],["l",.21,0],["l",.21,0],["l",0,.36],["c",.06,1.2,.39,2.37,1.02,3.66],["c",.39,.81,.84,1.56,1.8,3.09],["c",.81,1.26,1.05,1.68,1.35,2.22],["c",.87,1.5,1.35,2.79,1.56,4.08],["c",.06,.54,.06,1.56,-.03,2.04],["c",-.09,.48,-.21,.99,-.36,1.35],["l",-.12,.27],["l",.12,.27],["c",.09,.15,.21,.45,.27,.66],["c",.69,1.89,.63,3.66,-.18,5.46],["l",-.18,.39],["l",.15,.33],["c",.3,.66,.51,1.44,.63,2.1],["c",.06,.48,.06,1.35,0,1.71],["c",-.15,.57,-.42,1.2,-.78,1.68],["l",-.21,.27],["l",.18,.33],["c",.57,1.05,.93,2.13,1.02,3.18],["c",.06,.72,0,1.83,-.21,2.79],["c",-.18,1.02,-.63,2.34,-1.02,3.09],["c",-.15,.33,-.48,.45,-.78,.3],["c",-.18,-.09,-.27,-.18,-.33,-.33],["c",-.09,-.18,-.06,-.3,.03,-.54],["c",.75,-1.5,1.23,-3.45,1.17,-4.89],["c",-.06,-1.02,-.42,-2.01,-1.17,-3.15],["c",-.48,-.72,-1.02,-1.35,-1.89,-2.22],["c",-.57,-.57,-1.56,-1.5,-1.92,-1.77],["l",-.12,-.09],["l",0,1.68],["l",0,1.68],["l",-.21,0],["l",-.21,0],["l",0,-15],["z"],["m",.93,-8.07],["c",-.27,-.3,-.48,-.54,-.51,-.54],["c",0,0,0,.69,.03,1.02],["c",.15,1.47,.75,2.94,2.04,4.83],["l",1.08,1.53],["c",.39,.57,.84,1.2,.99,1.44],["c",.15,.24,.3,.45,.3,.45],["c",0,0,.03,-.09,.06,-.21],["c",.36,-1.59,-.15,-3.33,-1.47,-5.4],["c",-.63,-.93,-1.35,-1.83,-2.52,-3.12],["z"],["m",.06,6.72],["c",-.24,-.21,-.48,-.42,-.51,-.45],["l",-.06,-.06],["l",0,.33],["c",0,1.2,.3,2.34,.93,3.6],["c",.45,.9,.96,1.68,2.25,3.51],["c",.39,.54,.84,1.17,1.02,1.44],["c",.21,.33,.33,.51,.33,.48],["c",.06,-.09,.21,-.63,.3,-.99],["c",.06,-.33,.06,-.45,.06,-.96],["c",0,-.6,-.03,-.84,-.18,-1.35],["c",-.3,-1.08,-1.02,-2.28,-2.13,-3.57],["c",-.39,-.45,-1.44,-1.47,-2.01,-1.98],["z"],["m",0,6.72],["c",-.24,-.21,-.48,-.39,-.51,-.42],["l",-.06,-.06],["l",0,.33],["c",0,1.41,.45,2.82,1.38,4.35],["c",.42,.72,.72,1.14,1.86,2.73],["c",.36,.45,.75,.99,.87,1.2],["c",.15,.21,.3,.36,.3,.36],["c",.06,0,.3,-.48,.39,-.75],["c",.09,-.36,.12,-.63,.12,-1.05],["c",-.06,-1.05,-.45,-2.04,-1.2,-3.18],["c",-.57,-.87,-1.11,-1.53,-2.07,-2.49],["c",-.36,-.33,-.84,-.78,-1.08,-1.02],["z"]],w:6.682,h:39.694},"flags.d8th":{d:[["M",5.67,-21.63],["c",.24,-.12,.54,-.06,.69,.15],["c",.06,.06,.21,.36,.39,.66],["c",.84,1.77,1.26,3.36,1.32,5.1],["c",.03,1.29,-.21,2.37,-.81,3.63],["c",-.6,1.23,-1.26,2.13,-3.21,4.38],["c",-1.35,1.53,-1.86,2.19,-2.4,2.97],["c",-.63,.93,-1.11,1.92,-1.38,2.79],["c",-.15,.54,-.27,1.35,-.27,1.8],["l",0,.15],["l",-.21,0],["l",-.21,0],["l",0,-3.75],["l",0,-3.75],["l",.21,0],["l",.21,0],["l",.48,-.3],["c",1.83,-1.11,3.12,-2.1,4.17,-3.12],["c",.78,-.81,1.32,-1.53,1.71,-2.31],["c",.45,-.93,.6,-1.74,.51,-2.88],["c",-.12,-1.56,-.63,-3.18,-1.47,-4.68],["c",-.12,-.21,-.15,-.33,-.06,-.51],["c",.06,-.15,.15,-.24,.33,-.33],["z"]],w:8.492,h:21.691},"flags.ugrace":{d:[["M",6.03,6.93],["c",.15,-.09,.33,-.06,.51,0],["c",.15,.09,.21,.15,.3,.33],["c",.09,.18,.06,.39,-.03,.54],["c",-.06,.15,-10.89,8.88,-11.07,8.97],["c",-.15,.09,-.33,.06,-.48,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.09,-.18,-.06,-.39,.03,-.54],["c",.06,-.15,10.89,-8.88,11.07,-8.97],["z"]],w:12.019,h:9.954},"flags.dgrace":{d:[["M",-6.06,-15.93],["c",.18,-.09,.33,-.12,.48,-.06],["c",.18,.09,14.01,8.04,14.1,8.1],["c",.12,.12,.18,.33,.18,.51],["c",-.03,.21,-.15,.39,-.36,.48],["c",-.18,.09,-.33,.12,-.48,.06],["c",-.18,-.09,-14.01,-8.04,-14.1,-8.1],["c",-.12,-.12,-.18,-.33,-.18,-.51],["c",.03,-.21,.15,-.39,.36,-.48],["z"]],w:15.12,h:9.212},"flags.d16th":{d:[["M",6.84,-22.53],["c",.27,-.12,.57,-.06,.72,.15],["c",.15,.15,.33,.87,.45,1.56],["c",.06,.33,.06,1.35,0,1.65],["c",-.06,.33,-.15,.78,-.27,1.11],["c",-.12,.33,-.45,.96,-.66,1.32],["l",-.18,.27],["l",.09,.18],["c",.48,1.02,.72,2.25,.69,3.3],["c",-.06,1.23,-.42,2.28,-1.26,3.45],["c",-.57,.87,-.99,1.32,-3,3.39],["c",-1.56,1.56,-2.22,2.4,-2.76,3.45],["c",-.42,.84,-.66,1.8,-.66,2.55],["l",0,.15],["l",-.21,0],["l",-.21,0],["l",0,-7.5],["l",0,-7.5],["l",.21,0],["l",.21,0],["l",0,1.14],["l",0,1.11],["l",.27,-.15],["c",1.11,-.57,1.77,-.99,2.52,-1.47],["c",2.37,-1.56,3.69,-3.15,4.05,-4.83],["c",.03,-.18,.03,-.39,.03,-.78],["c",0,-.6,-.03,-.93,-.24,-1.5],["c",-.06,-.18,-.12,-.39,-.15,-.45],["c",-.03,-.24,.12,-.48,.36,-.6],["z"],["m",-.63,7.5],["c",-.06,-.18,-.15,-.36,-.15,-.36],["c",-.03,0,-.03,.03,-.06,.06],["c",-.06,.12,-.96,1.02,-1.95,1.98],["c",-.63,.57,-1.26,1.17,-1.44,1.35],["c",-1.53,1.62,-2.28,2.85,-2.55,4.32],["c",-.03,.18,-.03,.54,-.06,.99],["l",0,.69],["l",.18,-.09],["c",.93,-.54,2.1,-1.29,2.82,-1.83],["c",.69,-.51,1.02,-.81,1.53,-1.29],["c",1.86,-1.89,2.37,-3.66,1.68,-5.82],["z"]],w:8.475,h:22.591},"flags.d32nd":{d:[["M",6.84,-29.13],["c",.27,-.12,.57,-.06,.72,.15],["c",.12,.12,.27,.63,.36,1.11],["c",.33,1.59,.06,3.06,-.81,4.47],["l",-.18,.27],["l",.09,.15],["c",.12,.24,.33,.69,.45,1.05],["c",.63,1.83,.45,3.57,-.57,5.22],["l",-.18,.3],["l",.15,.27],["c",.42,.87,.6,1.71,.57,2.61],["c",-.06,1.29,-.48,2.46,-1.35,3.78],["c",-.54,.81,-.93,1.29,-2.46,3],["c",-.51,.54,-1.05,1.17,-1.26,1.41],["c",-1.56,1.86,-2.25,3.36,-2.37,5.01],["l",0,.33],["l",-.21,0],["l",-.21,0],["l",0,-11.25],["l",0,-11.25],["l",.21,0],["l",.21,0],["l",0,1.35],["l",.03,1.35],["l",.78,-.39],["c",1.38,-.69,2.34,-1.26,3.24,-1.92],["c",1.38,-1.02,2.28,-2.13,2.64,-3.21],["c",.15,-.48,.18,-.72,.18,-1.29],["c",0,-.57,-.06,-.9,-.24,-1.47],["c",-.06,-.18,-.12,-.39,-.15,-.45],["c",-.03,-.24,.12,-.48,.36,-.6],["z"],["m",-.63,7.2],["c",-.09,-.18,-.12,-.21,-.12,-.15],["c",-.03,.09,-1.02,1.08,-2.04,2.04],["c",-1.17,1.08,-1.65,1.56,-2.07,2.04],["c",-.84,.96,-1.38,1.86,-1.68,2.76],["c",-.21,.57,-.27,.99,-.3,1.65],["l",0,.54],["l",.66,-.33],["c",3.57,-1.86,5.49,-3.69,5.94,-5.7],["c",.06,-.39,.06,-1.2,-.03,-1.65],["c",-.06,-.39,-.24,-.9,-.36,-1.2],["z"],["m",-.06,7.2],["c",-.06,-.15,-.12,-.33,-.15,-.45],["l",-.06,-.18],["l",-.18,.21],["l",-1.83,1.83],["c",-.87,.9,-1.77,1.8,-1.95,2.01],["c",-1.08,1.29,-1.62,2.31,-1.89,3.51],["c",-.06,.3,-.06,.51,-.09,.93],["l",0,.57],["l",.09,-.06],["c",.75,-.45,1.89,-1.26,2.52,-1.74],["c",.81,-.66,1.74,-1.53,2.22,-2.16],["c",1.26,-1.53,1.68,-3.06,1.32,-4.47],["z"]],w:8.385,h:29.191},"flags.d64th":{d:[["M",7.08,-32.88],["c",.3,-.12,.66,-.03,.78,.24],["c",.18,.33,.27,2.1,.15,2.64],["c",-.09,.39,-.21,.78,-.39,1.08],["l",-.15,.3],["l",.09,.27],["c",.03,.12,.09,.45,.12,.69],["c",.27,1.44,.18,2.55,-.3,3.6],["l",-.12,.33],["l",.06,.42],["c",.27,1.35,.33,2.82,.21,3.63],["c",-.12,.6,-.3,1.23,-.57,1.8],["l",-.15,.27],["l",.03,.42],["c",.06,1.02,.06,2.7,.03,3.06],["c",-.15,1.47,-.66,2.76,-1.74,4.41],["c",-.45,.69,-.75,1.11,-1.74,2.37],["c",-1.05,1.38,-1.5,1.98,-1.95,2.73],["c",-.93,1.5,-1.38,2.82,-1.44,4.2],["l",0,.42],["l",-.21,0],["l",-.21,0],["l",0,-15],["l",0,-15],["l",.21,0],["l",.21,0],["l",0,1.86],["l",0,1.89],["c",0,0,.21,-.03,.45,-.09],["c",2.22,-.39,4.08,-1.11,5.19,-2.01],["c",.63,-.54,1.02,-1.14,1.2,-1.8],["c",.06,-.3,.06,-1.14,-.03,-1.65],["c",-.03,-.18,-.06,-.39,-.09,-.48],["c",-.03,-.24,.12,-.48,.36,-.6],["z"],["m",-.45,6.15],["c",-.03,-.18,-.06,-.42,-.06,-.54],["l",-.03,-.18],["l",-.33,.3],["c",-.42,.36,-.87,.72,-1.68,1.29],["c",-1.98,1.38,-2.25,1.59,-2.85,2.16],["c",-.75,.69,-1.23,1.44,-1.47,2.19],["c",-.15,.45,-.18,.63,-.21,1.35],["l",0,.66],["l",.39,-.18],["c",1.83,-.9,3.45,-1.95,4.47,-2.91],["c",.93,-.9,1.53,-1.83,1.74,-2.82],["c",.06,-.33,.06,-.87,.03,-1.32],["z"],["m",-.27,4.86],["c",-.03,-.21,-.06,-.36,-.06,-.36],["c",0,-.03,-.12,.09,-.24,.24],["c",-.39,.48,-.99,1.08,-2.16,2.19],["c",-1.47,1.38,-1.92,1.83,-2.46,2.49],["c",-.66,.87,-1.08,1.74,-1.29,2.58],["c",-.09,.42,-.15,.87,-.15,1.44],["l",0,.54],["l",.48,-.33],["c",1.5,-1.02,2.58,-1.89,3.51,-2.82],["c",1.47,-1.47,2.25,-2.85,2.4,-4.26],["c",.03,-.39,.03,-1.17,-.03,-1.71],["z"],["m",-.66,7.68],["c",.03,-.15,.03,-.6,.03,-.99],["l",0,-.72],["l",-.27,.33],["l",-1.74,1.98],["c",-1.77,1.92,-2.43,2.76,-2.97,3.9],["c",-.51,1.02,-.72,1.77,-.75,2.91],["c",0,.63,0,.63,.06,.6],["c",.03,-.03,.3,-.27,.63,-.54],["c",.66,-.6,1.86,-1.8,2.31,-2.31],["c",1.65,-1.89,2.52,-3.54,2.7,-5.16],["z"]],w:8.485,h:32.932},"clefs.C":{d:[["M",.06,-14.94],["l",.09,-.06],["l",1.92,0],["l",1.92,0],["l",.09,.06],["l",.06,.09],["l",0,14.85],["l",0,14.82],["l",-.06,.09],["l",-.09,.06],["l",-1.92,0],["l",-1.92,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-14.82],["l",0,-14.85],["z"],["m",5.37,0],["c",.09,-.06,.09,-.06,.57,-.06],["c",.45,0,.45,0,.54,.06],["l",.06,.09],["l",0,7.14],["l",0,7.11],["l",.09,-.06],["c",.18,-.18,.72,-.84,.96,-1.2],["c",.3,-.45,.66,-1.17,.84,-1.65],["c",.36,-.9,.57,-1.83,.6,-2.79],["c",.03,-.48,.03,-.54,.09,-.63],["c",.12,-.18,.36,-.21,.54,-.12],["c",.18,.09,.21,.15,.24,.66],["c",.06,.87,.21,1.56,.57,2.22],["c",.51,1.02,1.26,1.68,2.22,1.92],["c",.21,.06,.33,.06,.78,.06],["c",.45,0,.57,0,.84,-.06],["c",.45,-.12,.81,-.33,1.08,-.6],["c",.57,-.57,.87,-1.41,.99,-2.88],["c",.06,-.54,.06,-3,0,-3.57],["c",-.21,-2.58,-.84,-3.87,-2.16,-4.5],["c",-.48,-.21,-1.17,-.36,-1.77,-.36],["c",-.69,0,-1.29,.27,-1.5,.72],["c",-.06,.15,-.06,.21,-.06,.42],["c",0,.24,0,.3,.06,.45],["c",.12,.24,.24,.39,.63,.66],["c",.42,.3,.57,.48,.69,.72],["c",.06,.15,.06,.21,.06,.48],["c",0,.39,-.03,.63,-.21,.96],["c",-.3,.6,-.87,1.08,-1.5,1.26],["c",-.27,.06,-.87,.06,-1.14,0],["c",-.78,-.24,-1.44,-.87,-1.65,-1.68],["c",-.12,-.42,-.09,-1.17,.09,-1.71],["c",.51,-1.65,1.98,-2.82,3.81,-3.09],["c",.84,-.09,2.46,.03,3.51,.27],["c",2.22,.57,3.69,1.8,4.44,3.75],["c",.36,.93,.57,2.13,.57,3.36],["c",0,1.44,-.48,2.73,-1.38,3.81],["c",-1.26,1.5,-3.27,2.43,-5.28,2.43],["c",-.48,0,-.51,0,-.75,-.09],["c",-.15,-.03,-.48,-.21,-.78,-.36],["c",-.69,-.36,-.87,-.42,-1.26,-.42],["c",-.27,0,-.3,0,-.51,.09],["c",-.57,.3,-.81,.9,-.81,2.1],["c",0,1.23,.24,1.83,.81,2.13],["c",.21,.09,.24,.09,.51,.09],["c",.39,0,.57,-.06,1.26,-.42],["c",.3,-.15,.63,-.33,.78,-.36],["c",.24,-.09,.27,-.09,.75,-.09],["c",2.01,0,4.02,.93,5.28,2.4],["c",.9,1.11,1.38,2.4,1.38,3.84],["c",0,1.5,-.3,2.88,-.84,3.96],["c",-.78,1.59,-2.19,2.64,-4.17,3.15],["c",-1.05,.24,-2.67,.36,-3.51,.27],["c",-1.83,-.27,-3.3,-1.44,-3.81,-3.09],["c",-.18,-.54,-.21,-1.29,-.09,-1.74],["c",.15,-.6,.63,-1.2,1.23,-1.47],["c",.36,-.18,.57,-.21,.99,-.21],["c",.42,0,.63,.03,1.02,.21],["c",.42,.21,.84,.63,1.05,1.05],["c",.18,.36,.21,.6,.21,.96],["c",0,.3,0,.36,-.06,.51],["c",-.12,.24,-.27,.42,-.69,.72],["c",-.57,.42,-.69,.63,-.69,1.08],["c",0,.24,0,.3,.06,.45],["c",.12,.21,.3,.39,.57,.54],["c",.42,.18,.87,.21,1.53,.15],["c",1.08,-.15,1.8,-.57,2.34,-1.32],["c",.54,-.75,.84,-1.83,.99,-3.51],["c",.06,-.57,.06,-3.03,0,-3.57],["c",-.12,-1.47,-.42,-2.31,-.99,-2.88],["c",-.27,-.27,-.63,-.48,-1.08,-.6],["c",-.27,-.06,-.39,-.06,-.84,-.06],["c",-.45,0,-.57,0,-.78,.06],["c",-1.14,.27,-2.01,1.17,-2.46,2.49],["c",-.21,.57,-.3,.99,-.33,1.65],["c",-.03,.51,-.06,.57,-.24,.66],["c",-.12,.06,-.27,.06,-.39,0],["c",-.21,-.09,-.21,-.15,-.24,-.75],["c",-.09,-1.92,-.78,-3.72,-2.01,-5.19],["c",-.18,-.21,-.36,-.42,-.39,-.45],["l",-.09,-.06],["l",0,7.11],["l",0,7.14],["l",-.06,.09],["c",-.09,.06,-.09,.06,-.54,.06],["c",-.48,0,-.48,0,-.57,-.06],["l",-.06,-.09],["l",0,-14.82],["l",0,-14.85],["z"]],w:20.31,h:29.97},"clefs.F":{d:[["M",6.3,-7.8],["c",.36,-.03,1.65,0,2.13,.03],["c",3.6,.42,6.03,2.1,6.93,4.86],["c",.27,.84,.36,1.5,.36,2.58],["c",0,.9,-.03,1.35,-.18,2.16],["c",-.78,3.78,-3.54,7.08,-8.37,9.96],["c",-1.74,1.05,-3.87,2.13,-6.18,3.12],["c",-.39,.18,-.75,.33,-.81,.36],["c",-.06,.03,-.15,.06,-.18,.06],["c",-.15,0,-.33,-.18,-.33,-.33],["c",0,-.15,.06,-.21,.51,-.48],["c",3,-1.77,5.13,-3.21,6.84,-4.74],["c",.51,-.45,1.59,-1.5,1.95,-1.95],["c",1.89,-2.19,2.88,-4.32,3.15,-6.78],["c",.06,-.42,.06,-1.77,0,-2.19],["c",-.24,-2.01,-.93,-3.63,-2.04,-4.71],["c",-.63,-.63,-1.29,-1.02,-2.07,-1.2],["c",-1.62,-.39,-3.36,.15,-4.56,1.44],["c",-.54,.6,-1.05,1.47,-1.32,2.22],["l",-.09,.21],["l",.24,-.12],["c",.39,-.21,.63,-.24,1.11,-.24],["c",.3,0,.45,0,.66,.06],["c",1.92,.48,2.85,2.55,1.95,4.38],["c",-.45,.99,-1.41,1.62,-2.46,1.71],["c",-1.47,.09,-2.91,-.87,-3.39,-2.25],["c",-.18,-.57,-.21,-1.32,-.03,-2.28],["c",.39,-2.25,1.83,-4.2,3.81,-5.19],["c",.69,-.36,1.59,-.6,2.37,-.69],["z"],["m",11.58,2.52],["c",.84,-.21,1.71,.3,1.89,1.14],["c",.3,1.17,-.72,2.19,-1.89,1.89],["c",-.99,-.21,-1.5,-1.32,-1.02,-2.25],["c",.18,-.39,.6,-.69,1.02,-.78],["z"],["m",0,7.5],["c",.84,-.21,1.71,.3,1.89,1.14],["c",.21,.87,-.3,1.71,-1.14,1.89],["c",-.87,.21,-1.71,-.3,-1.89,-1.14],["c",-.21,-.84,.3,-1.71,1.14,-1.89],["z"]],w:20.153,h:23.142},"clefs.G":{d:[["M",9.69,-37.41],["c",.09,-.09,.24,-.06,.36,0],["c",.12,.09,.57,.6,.96,1.11],["c",1.77,2.34,3.21,5.85,3.57,8.73],["c",.21,1.56,.03,3.27,-.45,4.86],["c",-.69,2.31,-1.92,4.47,-4.23,7.44],["c",-.3,.39,-.57,.72,-.6,.75],["c",-.03,.06,0,.15,.18,.78],["c",.54,1.68,1.38,4.44,1.68,5.49],["l",.09,.42],["l",.39,0],["c",1.47,.09,2.76,.51,3.96,1.29],["c",1.83,1.23,3.06,3.21,3.39,5.52],["c",.09,.45,.12,1.29,.06,1.74],["c",-.09,1.02,-.33,1.83,-.75,2.73],["c",-.84,1.71,-2.28,3.06,-4.02,3.72],["l",-.33,.12],["l",.03,1.26],["c",0,1.74,-.06,3.63,-.21,4.62],["c",-.45,3.06,-2.19,5.49,-4.47,6.21],["c",-.57,.18,-.9,.21,-1.59,.21],["c",-.69,0,-1.02,-.03,-1.65,-.21],["c",-1.14,-.27,-2.13,-.84,-2.94,-1.65],["c",-.99,-.99,-1.56,-2.16,-1.71,-3.54],["c",-.09,-.81,.06,-1.53,.45,-2.13],["c",.63,-.99,1.83,-1.56,3,-1.53],["c",1.5,.09,2.64,1.32,2.73,2.94],["c",.06,1.47,-.93,2.7,-2.37,2.97],["c",-.45,.06,-.84,.03,-1.29,-.09],["l",-.21,-.09],["l",.09,.12],["c",.39,.54,.78,.93,1.32,1.26],["c",1.35,.87,3.06,1.02,4.35,.36],["c",1.44,-.72,2.52,-2.28,2.97,-4.35],["c",.15,-.66,.24,-1.5,.3,-3.03],["c",.03,-.84,.03,-2.94,0,-3],["c",-.03,0,-.18,0,-.36,.03],["c",-.66,.12,-.99,.12,-1.83,.12],["c",-1.05,0,-1.71,-.06,-2.61,-.3],["c",-4.02,-.99,-7.11,-4.35,-7.8,-8.46],["c",-.12,-.66,-.12,-.99,-.12,-1.83],["c",0,-.84,0,-1.14,.15,-1.92],["c",.36,-2.28,1.41,-4.62,3.3,-7.29],["l",2.79,-3.6],["c",.54,-.66,.96,-1.2,.96,-1.23],["c",0,-.03,-.09,-.33,-.18,-.69],["c",-.96,-3.21,-1.41,-5.28,-1.59,-7.68],["c",-.12,-1.38,-.15,-3.09,-.06,-3.96],["c",.33,-2.67,1.38,-5.07,3.12,-7.08],["c",.36,-.42,.99,-1.05,1.17,-1.14],["z"],["m",2.01,4.71],["c",-.15,-.3,-.3,-.54,-.3,-.54],["c",-.03,0,-.18,.09,-.3,.21],["c",-2.4,1.74,-3.87,4.2,-4.26,7.11],["c",-.06,.54,-.06,1.41,-.03,1.89],["c",.09,1.29,.48,3.12,1.08,5.22],["c",.15,.42,.24,.78,.24,.81],["c",0,.03,.84,-1.11,1.23,-1.68],["c",1.89,-2.73,2.88,-5.07,3.15,-7.53],["c",.09,-.57,.12,-1.74,.06,-2.37],["c",-.09,-1.23,-.27,-1.92,-.87,-3.12],["z"],["m",-2.94,20.7],["c",-.21,-.72,-.39,-1.32,-.42,-1.32],["c",0,0,-1.2,1.47,-1.86,2.37],["c",-2.79,3.63,-4.02,6.3,-4.35,9.3],["c",-.03,.21,-.03,.69,-.03,1.08],["c",0,.69,0,.75,.06,1.11],["c",.12,.54,.27,.99,.51,1.47],["c",.69,1.38,1.83,2.55,3.42,3.42],["c",.96,.54,2.07,.9,3.21,1.08],["c",.78,.12,2.04,.12,2.94,-.03],["c",.51,-.06,.45,-.03,.42,-.3],["c",-.24,-3.33,-.72,-6.33,-1.62,-10.08],["c",-.09,-.39,-.18,-.75,-.18,-.78],["c",-.03,-.03,-.42,0,-.81,.09],["c",-.9,.18,-1.65,.57,-2.22,1.14],["c",-.72,.72,-1.08,1.65,-1.05,2.64],["c",.06,.96,.48,1.83,1.23,2.58],["c",.36,.36,.72,.63,1.17,.9],["c",.33,.18,.36,.21,.42,.33],["c",.18,.42,-.18,.9,-.6,.87],["c",-.18,-.03,-.84,-.36,-1.26,-.63],["c",-.78,-.51,-1.38,-1.11,-1.86,-1.83],["c",-1.77,-2.7,-.99,-6.42,1.71,-8.19],["c",.3,-.21,.81,-.48,1.17,-.63],["c",.3,-.09,1.02,-.3,1.14,-.3],["c",.06,0,.09,0,.09,-.03],["c",.03,-.03,-.51,-1.92,-1.23,-4.26],["z"],["m",3.78,7.41],["c",-.18,-.03,-.36,-.06,-.39,-.06],["c",-.03,0,0,.21,.18,1.02],["c",.75,3.18,1.26,6.3,1.5,9.09],["c",.06,.72,0,.69,.51,.42],["c",.78,-.36,1.44,-.96,1.98,-1.77],["c",1.08,-1.62,1.2,-3.69,.3,-5.55],["c",-.81,-1.62,-2.31,-2.79,-4.08,-3.15],["z"]],w:19.051,h:57.057},"clefs.perc":{d:[["M",5.07,-7.44],["l",.09,-.06],["l",1.53,0],["l",1.53,0],["l",.09,.06],["l",.06,.09],["l",0,7.35],["l",0,7.32],["l",-.06,.09],["l",-.09,.06],["l",-1.53,0],["l",-1.53,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-7.32],["l",0,-7.35],["z"],["m",6.63,0],["l",.09,-.06],["l",1.53,0],["l",1.53,0],["l",.09,.06],["l",.06,.09],["l",0,7.35],["l",0,7.32],["l",-.06,.09],["l",-.09,.06],["l",-1.53,0],["l",-1.53,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-7.32],["l",0,-7.35],["z"]],w:21,h:14.97},"tab.big":{d:[["M",20.16,-21.66],["c",.24,-.09,.66,.09,.78,.36],["c",.09,.21,.09,.24,-.18,.54],["c",-.78,.81,-1.86,1.44,-2.94,1.71],["c",-.87,.24,-1.71,.24,-2.55,.03],["l",-.06,-.03],["l",-.18,.99],["c",-.33,1.98,-.75,4.26,-.96,5.04],["c",-.42,1.65,-1.26,3.18,-2.28,4.14],["c",-.57,.57,-1.17,.9,-1.86,1.08],["c",-.18,.06,-.33,.06,-.66,.06],["c",-.54,0,-.78,-.03,-1.23,-.27],["c",-.39,-.18,-.66,-.39,-1.38,-.99],["c",-.3,-.24,-.66,-.51,-.75,-.57],["c",-.21,-.15,-.27,-.24,-.24,-.45],["c",.06,-.27,.36,-.6,.6,-.66],["c",.18,-.03,.33,.06,.9,.57],["c",.48,.42,.72,.57,.93,.69],["c",.66,.33,1.38,.21,1.95,-.36],["c",.63,-.6,1.05,-1.62,1.23,-3],["c",.03,-.18,.09,-.66,.09,-1.11],["c",.09,-1.56,.33,-3.81,.57,-5.49],["c",.06,-.33,.09,-.63,.09,-.63],["c",-.03,-.03,-.81,-.12,-1.02,-.12],["c",-.57,0,-1.32,.12,-1.8,.33],["c",-.87,.3,-1.35,.78,-1.5,1.41],["c",-.18,.63,.09,1.26,.66,1.65],["c",.12,.06,.15,.12,.18,.24],["c",.09,.27,.06,.57,-.09,.75],["c",-.03,.06,-.12,.09,-.27,.15],["c",-.72,.21,-1.44,.15,-2.1,-.18],["c",-.54,-.27,-.96,-.66,-1.2,-1.14],["c",-.39,-.75,-.33,-1.74,.15,-2.52],["c",.27,-.42,.84,-.93,1.41,-1.23],["c",1.17,-.57,2.88,-.9,4.8,-.9],["c",.69,0,.78,0,1.08,.06],["c",.45,.09,1.11,.3,2.07,.6],["c",1.47,.48,1.83,.57,2.55,.54],["c",1.02,-.06,2.04,-.45,2.94,-1.11],["c",.12,-.09,.24,-.18,.27,-.18],["z"],["m",-5.88,13.05],["c",.21,-.03,.81,0,1.08,.06],["c",.48,.12,.9,.42,.99,.69],["c",.03,.09,.03,.15,0,.27],["c",0,.09,-.03,.57,-.06,1.08],["c",-.09,2.19,-.24,5.76,-.39,8.28],["c",-.06,1.53,-.06,1.77,.03,2.01],["c",.09,.18,.15,.24,.3,.3],["c",.24,.12,.54,.06,1.23,-.27],["c",.57,-.27,.66,-.3,.75,-.24],["c",.09,.06,.18,.3,.18,.45],["c",0,.33,-.15,.51,-.45,.63],["c",-.12,.03,-.39,.15,-.6,.27],["c",-1.17,.6,-1.38,.69,-1.8,.72],["c",-.45,.03,-.78,-.09,-1.08,-.39],["c",-.39,-.42,-.66,-1.2,-1.02,-3.12],["c",-.24,-1.23,-.36,-2.07,-.54,-3.75],["l",0,-.18],["l",-.36,.45],["c",-.6,.75,-1.32,1.59,-1.95,2.25],["c",-.15,.18,-.27,.3,-.27,.33],["c",0,0,.06,.09,.15,.18],["c",.24,.33,.6,.57,1.05,.69],["c",.18,.06,.3,.06,.69,.06],["l",.48,.03],["l",.06,.12],["c",.15,.27,.03,.72,-.21,.9],["c",-.18,.12,-.93,.27,-1.41,.27],["c",-.84,0,-1.59,-.3,-1.98,-.84],["l",-.12,-.15],["l",-.45,.42],["c",-.99,.87,-1.53,1.32,-2.16,1.74],["c",-.78,.51,-1.5,.84,-2.1,.93],["c",-.69,.12,-1.2,.03,-1.95,-.42],["c",-.21,-.12,-.51,-.27,-.66,-.36],["c",-.24,-.12,-.3,-.18,-.33,-.24],["c",-.12,-.27,.15,-.78,.45,-.93],["c",.24,-.12,.33,-.09,.9,.18],["c",.6,.3,.84,.39,1.2,.36],["c",.87,-.09,1.77,-.69,3.24,-2.31],["c",2.67,-2.85,4.59,-5.94,5.7,-9.15],["c",.15,-.45,.24,-.63,.42,-.81],["c",.21,-.24,.6,-.45,.99,-.51],["z"],["m",-3.99,16.05],["c",.18,0,.69,-.03,1.17,0],["c",3.27,.03,5.37,.75,6,2.07],["c",.45,.99,.12,2.4,-.81,3.42],["c",-.24,.27,-.57,.57,-.84,.75],["c",-.09,.06,-.18,.09,-.18,.12],["c",0,0,.18,.03,.42,.09],["c",1.23,.3,2.01,.81,2.37,1.59],["c",.27,.54,.3,1.32,.09,2.1],["c",-.12,.36,-.45,1.05,-.69,1.35],["c",-.87,1.17,-2.1,1.92,-3.54,2.25],["c",-.36,.06,-.48,.06,-.96,.06],["c",-.45,0,-.66,0,-.84,-.03],["c",-.84,-.18,-1.47,-.51,-2.07,-1.11],["c",-.33,-.33,-.45,-.51,-.45,-.63],["c",0,-.06,.03,-.15,.06,-.24],["c",.18,-.33,.69,-.6,.93,-.48],["c",.03,.03,.15,.12,.27,.24],["c",.39,.42,.99,.57,1.62,.45],["c",1.05,-.21,1.98,-1.02,2.31,-2.01],["c",.48,-1.53,-.48,-2.55,-2.58,-2.67],["c",-.21,0,-.36,-.03,-.42,-.06],["c",-.15,-.09,-.21,-.51,-.06,-.78],["c",.12,-.27,.24,-.33,.6,-.36],["c",.57,-.06,1.11,-.42,1.5,-.99],["c",.48,-.72,.54,-1.59,.18,-2.31],["c",-.12,-.21,-.45,-.54,-.69,-.69],["c",-.33,-.21,-.93,-.45,-1.35,-.51],["l",-.12,-.03],["l",-.06,.48],["c",-.54,2.94,-1.14,6.24,-1.29,6.75],["c",-.33,1.35,-.93,2.61,-1.65,3.6],["c",-.3,.36,-.81,.9,-1.14,1.14],["c",-.3,.24,-.84,.48,-1.14,.57],["c",-.33,.09,-.96,.09,-1.26,.03],["c",-.45,-.12,-.87,-.39,-1.53,-.96],["c",-.24,-.15,-.51,-.39,-.63,-.48],["c",-.3,-.21,-.33,-.33,-.21,-.63],["c",.12,-.18,.27,-.36,.42,-.45],["c",.27,-.12,.36,-.09,.87,.33],["c",.78,.6,1.08,.75,1.65,.72],["c",.45,-.03,.81,-.21,1.17,-.54],["c",.87,-.9,1.38,-2.85,1.38,-5.37],["c",0,-.6,.03,-1.11,.12,-2.04],["c",.06,-.69,.24,-2.01,.33,-2.58],["c",.06,-.24,.06,-.42,.06,-.42],["c",0,0,-.12,.03,-.21,.09],["c",-1.44,.57,-2.16,1.65,-1.74,2.55],["c",.09,.15,.18,.24,.27,.33],["c",.24,.21,.3,.27,.33,.39],["c",.06,.24,0,.63,-.15,.78],["c",-.09,.12,-.54,.21,-.96,.24],["c",-1.02,.03,-2.01,-.48,-2.43,-1.32],["c",-.21,-.45,-.27,-.9,-.15,-1.44],["c",.06,-.27,.21,-.66,.39,-.93],["c",.87,-1.29,3,-2.22,5.64,-2.43],["z"]],w:19.643,h:43.325},"tab.tiny":{d:[["M",16.02,-17.25],["c",.12,-.09,.15,-.09,.27,-.09],["c",.21,.03,.51,.3,.51,.45],["c",0,.06,-.12,.18,-.3,.36],["c",-1.11,1.08,-2.55,1.59,-3.84,1.41],["c",-.15,-.03,-.33,-.06,-.39,-.09],["c",-.06,-.03,-.09,-.03,-.12,-.03],["c",0,0,-.06,.42,-.15,.93],["c",-.33,2.01,-.66,3.69,-.84,4.26],["c",-.42,1.41,-1.23,2.67,-2.16,3.33],["c",-.27,.18,-.75,.42,-.99,.48],["c",-.3,.09,-.72,.09,-1.02,.06],["c",-.45,-.09,-.84,-.33,-1.53,-.9],["c",-.21,-.18,-.51,-.39,-.63,-.48],["c",-.27,-.21,-.3,-.24,-.3,-.36],["c",0,-.12,.09,-.36,.18,-.45],["c",.09,-.09,.27,-.18,.36,-.18],["c",.12,0,.3,.12,.66,.45],["c",.57,.51,.87,.69,1.23,.72],["c",.93,.06,1.68,-.78,1.98,-2.37],["c",.09,-.39,.15,-.75,.18,-1.53],["c",.06,-.99,.24,-2.79,.42,-4.05],["c",.03,-.3,.06,-.57,.06,-.6],["c",0,-.06,-.03,-.09,-.15,-.12],["c",-.9,-.18,-2.13,.06,-2.76,.57],["c",-.36,.3,-.51,.6,-.51,1.02],["c",0,.45,.15,.75,.48,.99],["c",.06,.06,.15,.18,.18,.24],["c",.12,.24,.03,.63,-.15,.69],["c",-.24,.12,-.6,.15,-.9,.15],["c",-.36,-.03,-.57,-.09,-.87,-.24],["c",-.78,-.36,-1.23,-1.11,-1.2,-1.92],["c",.12,-1.53,1.74,-2.49,4.62,-2.7],["c",1.2,-.09,1.47,-.03,3.33,.57],["c",.9,.3,1.14,.36,1.56,.39],["c",.45,0,.93,-.06,1.38,-.21],["c",.51,-.18,.81,-.33,1.41,-.75],["z"],["m",-4.68,10.38],["c",.39,-.06,.84,0,1.2,.15],["c",.24,.12,.36,.21,.45,.36],["l",.09,.09],["l",-.06,1.41],["c",-.09,2.19,-.18,3.96,-.27,5.49],["c",-.03,.78,-.06,1.59,-.06,1.86],["c",0,.42,0,.48,.06,.57],["c",.06,.18,.18,.24,.36,.27],["c",.18,0,.39,-.06,.84,-.27],["c",.45,-.21,.54,-.24,.63,-.18],["c",.12,.12,.15,.54,.03,.69],["c",-.03,.03,-.15,.12,-.27,.18],["c",-.15,.03,-.3,.12,-.36,.15],["c",-.87,.45,-1.02,.51,-1.26,.57],["c",-.33,.09,-.6,.06,-.84,-.06],["c",-.42,-.18,-.63,-.6,-.87,-1.44],["c",-.3,-1.23,-.57,-2.97,-.66,-4.08],["c",0,-.18,-.03,-.3,-.03,-.33],["l",-.06,.06],["c",-.18,.27,-1.11,1.38,-1.68,2.01],["l",-.33,.33],["l",.06,.09],["c",.06,.15,.27,.33,.48,.42],["c",.27,.18,.51,.24,.96,.27],["l",.39,0],["l",.03,.12],["c",.12,.21,.03,.57,-.15,.69],["c",-.03,.03,-.21,.09,-.36,.15],["c",-.27,.06,-.39,.06,-.75,.06],["c",-.48,0,-.75,-.03,-1.08,-.21],["c",-.21,-.12,-.51,-.36,-.57,-.48],["l",-.03,-.09],["l",-.39,.36],["c",-1.47,1.35,-2.49,1.98,-3.42,2.13],["c",-.54,.09,-.96,-.03,-1.62,-.39],["c",-.21,-.15,-.45,-.27,-.54,-.3],["c",-.18,-.09,-.21,-.21,-.12,-.45],["c",.06,-.27,.33,-.48,.54,-.48],["c",.03,0,.27,.09,.48,.21],["c",.48,.24,.69,.27,.99,.27],["c",.6,-.06,1.17,-.42,2.1,-1.35],["c",2.22,-2.22,4.02,-4.98,4.95,-7.59],["c",.21,-.57,.3,-.78,.48,-.93],["c",.15,-.15,.42,-.27,.66,-.33],["z"],["m",-3.06,12.84],["c",.27,-.03,1.68,0,2.01,.03],["c",1.92,.18,3.15,.69,3.63,1.5],["c",.18,.33,.24,.51,.21,.93],["c",0,.45,-.06,.72,-.24,1.11],["c",-.24,.51,-.69,1.02,-1.17,1.35],["c",-.21,.15,-.21,.15,-.12,.18],["c",.72,.15,1.11,.3,1.5,.57],["c",.39,.24,.63,.57,.75,.96],["c",.09,.3,.09,.96,0,1.29],["c",-.15,.57,-.39,1.05,-.78,1.5],["c",-.66,.75,-1.62,1.32,-2.61,1.53],["c",-.27,.06,-.42,.06,-.84,.06],["c",-.48,0,-.57,0,-.81,-.06],["c",-.6,-.18,-1.05,-.42,-1.47,-.81],["c",-.36,-.39,-.42,-.51,-.3,-.75],["c",.12,-.21,.39,-.39,.6,-.39],["c",.09,0,.15,.03,.33,.18],["c",.12,.12,.27,.24,.36,.27],["c",.96,.48,2.46,-.33,2.82,-1.5],["c",.24,-.81,-.03,-1.44,-.69,-1.77],["c",-.39,-.21,-1.02,-.33,-1.53,-.33],["c",-.18,0,-.21,0,-.27,-.09],["c",-.06,-.09,-.06,-.3,-.03,-.48],["c",.06,-.18,.18,-.36,.33,-.36],["c",.39,-.06,.51,-.09,.72,-.18],["c",.69,-.36,1.11,-1.23,.99,-2.01],["c",-.09,-.51,-.42,-.9,-.93,-1.17],["c",-.24,-.12,-.6,-.27,-.87,-.3],["c",-.09,-.03,-.09,-.03,-.12,.12],["c",0,.09,-.21,1.11,-.42,2.25],["c",-.66,3.75,-.72,3.99,-1.26,5.07],["c",-.9,1.89,-2.25,2.85,-3.48,2.61],["c",-.39,-.09,-.69,-.27,-1.38,-.84],["c",-.63,-.51,-.63,-.48,-.63,-.6],["c",0,-.18,.18,-.48,.39,-.57],["c",.21,-.12,.3,-.09,.81,.33],["c",.15,.15,.39,.3,.54,.36],["c",.18,.12,.27,.12,.48,.15],["c",.99,.06,1.71,-.78,2.04,-2.46],["c",.12,-.66,.18,-1.14,.21,-2.22],["c",.03,-1.23,.12,-2.25,.36,-3.63],["c",.03,-.24,.06,-.45,.06,-.48],["c",-.06,-.03,-.66,.27,-.9,.42],["c",-.06,.06,-.21,.18,-.33,.3],["c",-.57,.57,-.6,1.35,-.06,1.74],["c",.18,.12,.24,.24,.21,.51],["c",-.03,.3,-.15,.42,-.57,.48],["c",-1.11,.24,-2.22,-.42,-2.43,-1.38],["c",-.09,-.45,.03,-1.02,.3,-1.47],["c",.18,-.24,.6,-.63,.9,-.84],["c",.9,-.6,2.28,-1.02,3.69,-1.11],["z"]],w:15.709,h:34.656},"timesig.common":{d:[["M",6.66,-7.83],["c",.72,-.06,1.41,-.03,1.98,.09],["c",1.2,.27,2.34,.96,3.09,1.92],["c",.63,.81,1.08,1.86,1.14,2.73],["c",.06,1.02,-.51,1.92,-1.44,2.22],["c",-.24,.09,-.3,.09,-.63,.09],["c",-.33,0,-.42,0,-.63,-.06],["c",-.66,-.24,-1.14,-.63,-1.41,-1.2],["c",-.15,-.3,-.21,-.51,-.24,-.9],["c",-.06,-1.08,.57,-2.04,1.56,-2.37],["c",.18,-.06,.27,-.06,.63,-.06],["l",.45,0],["c",.06,.03,.09,.03,.09,0],["c",0,0,-.09,-.12,-.24,-.27],["c",-1.02,-1.11,-2.55,-1.68,-4.08,-1.5],["c",-1.29,.15,-2.04,.69,-2.4,1.74],["c",-.36,.93,-.42,1.89,-.42,5.37],["c",0,2.97,.06,3.96,.24,4.77],["c",.24,1.08,.63,1.68,1.41,2.07],["c",.81,.39,2.16,.45,3.18,.09],["c",1.29,-.45,2.37,-1.53,3.03,-2.97],["c",.15,-.33,.33,-.87,.39,-1.17],["c",.09,-.24,.15,-.36,.3,-.39],["c",.21,-.03,.42,.15,.39,.36],["c",-.06,.39,-.42,1.38,-.69,1.89],["c",-.96,1.8,-2.49,2.94,-4.23,3.18],["c",-.99,.12,-2.58,-.06,-3.63,-.45],["c",-.96,-.36,-1.71,-.84,-2.4,-1.5],["c",-1.11,-1.11,-1.8,-2.61,-2.04,-4.56],["c",-.06,-.6,-.06,-2.01,0,-2.61],["c",.24,-1.95,.9,-3.45,2.01,-4.56],["c",.69,-.66,1.44,-1.11,2.37,-1.47],["c",.63,-.24,1.47,-.42,2.22,-.48],["z"]],w:13.038,h:15.689},"timesig.cut":{d:[["M",6.24,-10.44],["c",.09,-.06,.09,-.06,.48,-.06],["c",.36,0,.36,0,.45,.06],["l",.06,.09],["l",0,1.23],["l",0,1.26],["l",.27,0],["c",1.26,0,2.49,.45,3.48,1.29],["c",1.05,.87,1.8,2.28,1.89,3.48],["c",.06,1.02,-.51,1.92,-1.44,2.22],["c",-.24,.09,-.3,.09,-.63,.09],["c",-.33,0,-.42,0,-.63,-.06],["c",-.66,-.24,-1.14,-.63,-1.41,-1.2],["c",-.15,-.3,-.21,-.51,-.24,-.9],["c",-.06,-1.08,.57,-2.04,1.56,-2.37],["c",.18,-.06,.27,-.06,.63,-.06],["l",.45,0],["c",.06,.03,.09,.03,.09,0],["c",0,-.03,-.45,-.51,-.66,-.69],["c",-.87,-.69,-1.83,-1.05,-2.94,-1.11],["l",-.42,0],["l",0,7.17],["l",0,7.14],["l",.42,0],["c",.69,-.03,1.23,-.18,1.86,-.51],["c",1.05,-.51,1.89,-1.47,2.46,-2.7],["c",.15,-.33,.33,-.87,.39,-1.17],["c",.09,-.24,.15,-.36,.3,-.39],["c",.21,-.03,.42,.15,.39,.36],["c",-.03,.24,-.21,.78,-.39,1.2],["c",-.96,2.37,-2.94,3.9,-5.13,3.9],["l",-.3,0],["l",0,1.26],["l",0,1.23],["l",-.06,.09],["c",-.09,.06,-.09,.06,-.45,.06],["c",-.39,0,-.39,0,-.48,-.06],["l",-.06,-.09],["l",0,-1.29],["l",0,-1.29],["l",-.21,-.03],["c",-1.23,-.21,-2.31,-.63,-3.21,-1.29],["c",-.15,-.09,-.45,-.36,-.66,-.57],["c",-1.11,-1.11,-1.8,-2.61,-2.04,-4.56],["c",-.06,-.6,-.06,-2.01,0,-2.61],["c",.24,-1.95,.93,-3.45,2.04,-4.59],["c",.42,-.39,.78,-.66,1.26,-.93],["c",.75,-.45,1.65,-.75,2.61,-.9],["l",.21,-.03],["l",0,-1.29],["l",0,-1.29],["z"],["m",-.06,10.44],["c",0,-5.58,0,-6.99,-.03,-6.99],["c",-.15,0,-.63,.27,-.87,.45],["c",-.45,.36,-.75,.93,-.93,1.77],["c",-.18,.81,-.24,1.8,-.24,4.74],["c",0,2.97,.06,3.96,.24,4.77],["c",.24,1.08,.66,1.68,1.41,2.07],["c",.12,.06,.3,.12,.33,.15],["l",.09,0],["l",0,-6.96],["z"]],w:13.038,h:20.97},"timesig.imperfectum":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},"timesig.imperfectum2":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},"timesig.perfectum":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},"timesig.perfectum2":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},f:{d:[["M",9.93,-14.28],["c",1.53,-.18,2.88,.45,3.12,1.5],["c",.12,.51,0,1.32,-.27,1.86],["c",-.15,.3,-.42,.57,-.63,.69],["c",-.69,.36,-1.56,.03,-1.83,-.69],["c",-.09,-.24,-.09,-.69,0,-.87],["c",.06,-.12,.21,-.24,.45,-.42],["c",.42,-.24,.57,-.45,.6,-.72],["c",.03,-.33,-.09,-.39,-.63,-.42],["c",-.3,0,-.45,0,-.6,.03],["c",-.81,.21,-1.35,.93,-1.74,2.46],["c",-.06,.27,-.48,2.25,-.48,2.31],["c",0,.03,.39,.03,.9,.03],["c",.72,0,.9,0,.99,.06],["c",.42,.15,.45,.72,.03,.9],["c",-.12,.06,-.24,.06,-1.17,.06],["l",-1.05,0],["l",-.78,2.55],["c",-.45,1.41,-.87,2.79,-.96,3.06],["c",-.87,2.37,-2.37,4.74,-3.78,5.91],["c",-1.05,.9,-2.04,1.23,-3.09,1.08],["c",-1.11,-.18,-1.89,-.78,-2.04,-1.59],["c",-.12,-.66,.15,-1.71,.54,-2.19],["c",.69,-.75,1.86,-.54,2.22,.39],["c",.06,.15,.09,.27,.09,.48],["c",0,.24,-.03,.27,-.12,.42],["c",-.03,.09,-.15,.18,-.27,.27],["c",-.09,.06,-.27,.21,-.36,.27],["c",-.24,.18,-.36,.36,-.39,.6],["c",-.03,.33,.09,.39,.63,.42],["c",.42,0,.63,-.03,.9,-.15],["c",.6,-.3,.96,-.96,1.38,-2.64],["c",.09,-.42,.63,-2.55,1.17,-4.77],["l",1.02,-4.08],["c",0,-.03,-.36,-.03,-.81,-.03],["c",-.72,0,-.81,0,-.93,-.06],["c",-.42,-.18,-.39,-.75,.03,-.9],["c",.09,-.06,.27,-.06,1.05,-.06],["l",.96,0],["l",0,-.09],["c",.06,-.18,.3,-.72,.51,-1.17],["c",1.2,-2.46,3.3,-4.23,5.34,-4.5],["z"]],w:16.155,h:19.445},m:{d:[["M",2.79,-8.91],["c",.09,0,.3,-.03,.45,-.03],["c",.24,.03,.3,.03,.45,.12],["c",.36,.15,.63,.54,.75,1.02],["l",.03,.21],["l",.33,-.3],["c",.69,-.69,1.38,-1.02,2.07,-1.02],["c",.27,0,.33,0,.48,.06],["c",.21,.09,.48,.36,.63,.6],["c",.03,.09,.12,.27,.18,.42],["c",.03,.15,.09,.27,.12,.27],["c",0,0,.09,-.09,.18,-.21],["c",.33,-.39,.87,-.81,1.29,-.99],["c",.78,-.33,1.47,-.21,2.01,.33],["c",.3,.33,.48,.69,.6,1.14],["c",.09,.42,.06,.54,-.54,3.06],["c",-.33,1.29,-.57,2.4,-.57,2.43],["c",0,.12,.09,.21,.21,.21],["c",.24,0,.75,-.3,1.2,-.72],["c",.45,-.39,.6,-.45,.78,-.27],["c",.18,.18,.09,.36,-.45,.87],["c",-1.05,.96,-1.83,1.47,-2.58,1.71],["c",-.93,.33,-1.53,.21,-1.8,-.33],["c",-.06,-.15,-.06,-.21,-.06,-.45],["c",0,-.24,.03,-.48,.6,-2.82],["c",.42,-1.71,.6,-2.64,.63,-2.79],["c",.03,-.57,-.3,-.75,-.84,-.48],["c",-.24,.12,-.54,.39,-.66,.63],["c",-.03,.09,-.42,1.38,-.9,3],["c",-.9,3.15,-.84,3,-1.14,3.15],["l",-.15,.09],["l",-.78,0],["c",-.6,0,-.78,0,-.84,-.06],["c",-.09,-.03,-.18,-.18,-.18,-.27],["c",0,-.03,.36,-1.38,.84,-2.97],["c",.57,-2.04,.81,-2.97,.84,-3.12],["c",.03,-.54,-.3,-.72,-.84,-.45],["c",-.24,.12,-.57,.42,-.66,.63],["c",-.06,.09,-.51,1.44,-1.05,2.97],["c",-.51,1.56,-.99,2.85,-.99,2.91],["c",-.06,.12,-.21,.24,-.36,.3],["c",-.12,.06,-.21,.06,-.9,.06],["c",-.6,0,-.78,0,-.84,-.06],["c",-.09,-.03,-.18,-.18,-.18,-.27],["c",0,-.03,.45,-1.38,.99,-2.97],["c",1.05,-3.18,1.05,-3.18,.93,-3.45],["c",-.12,-.27,-.39,-.3,-.72,-.15],["c",-.54,.27,-1.14,1.17,-1.56,2.4],["c",-.06,.15,-.15,.3,-.18,.36],["c",-.21,.21,-.57,.27,-.72,.09],["c",-.09,-.09,-.06,-.21,.06,-.63],["c",.48,-1.26,1.26,-2.46,2.01,-3.21],["c",.57,-.54,1.2,-.87,1.83,-1.02],["z"]],w:14.687,h:9.126},p:{d:[["M",1.92,-8.7],["c",.27,-.09,.81,-.06,1.11,.03],["c",.54,.18,.93,.51,1.17,.99],["c",.09,.15,.15,.33,.18,.36],["l",0,.12],["l",.3,-.27],["c",.66,-.6,1.35,-1.02,2.13,-1.2],["c",.21,-.06,.33,-.06,.78,-.06],["c",.45,0,.51,0,.84,.09],["c",1.29,.33,2.07,1.32,2.25,2.79],["c",.09,.81,-.09,2.01,-.45,2.79],["c",-.54,1.26,-1.86,2.55,-3.18,3.03],["c",-.45,.18,-.81,.24,-1.29,.24],["c",-.69,-.03,-1.35,-.18,-1.86,-.45],["c",-.3,-.15,-.51,-.18,-.69,-.09],["c",-.09,.03,-.18,.09,-.18,.12],["c",-.09,.12,-1.05,2.94,-1.05,3.06],["c",0,.24,.18,.48,.51,.63],["c",.18,.06,.54,.15,.75,.15],["c",.21,0,.36,.06,.42,.18],["c",.12,.18,.06,.42,-.12,.54],["c",-.09,.03,-.15,.03,-.78,0],["c",-1.98,-.15,-3.81,-.15,-5.79,0],["c",-.63,.03,-.69,.03,-.78,0],["c",-.24,-.15,-.24,-.57,.03,-.66],["c",.06,-.03,.48,-.09,.99,-.12],["c",.87,-.06,1.11,-.09,1.35,-.21],["c",.18,-.06,.33,-.18,.39,-.3],["c",.06,-.12,3.24,-9.42,3.27,-9.6],["c",.06,-.33,.03,-.57,-.15,-.69],["c",-.09,-.06,-.12,-.06,-.3,-.06],["c",-.69,.06,-1.53,1.02,-2.28,2.61],["c",-.09,.21,-.21,.45,-.27,.51],["c",-.09,.12,-.33,.24,-.48,.24],["c",-.18,0,-.36,-.15,-.36,-.3],["c",0,-.24,.78,-1.83,1.26,-2.55],["c",.72,-1.11,1.47,-1.74,2.28,-1.92],["z"],["m",5.37,1.47],["c",-.27,-.12,-.75,-.03,-1.14,.21],["c",-.75,.48,-1.47,1.68,-1.89,3.15],["c",-.45,1.47,-.42,2.34,0,2.7],["c",.45,.39,1.26,.21,1.83,-.36],["c",.51,-.51,.99,-1.68,1.38,-3.27],["c",.3,-1.17,.33,-1.74,.15,-2.13],["c",-.09,-.15,-.15,-.21,-.33,-.3],["z"]],w:14.689,h:13.127},r:{d:[["M",6.33,-9.12],["c",.27,-.03,.93,0,1.2,.06],["c",.84,.21,1.23,.81,1.02,1.53],["c",-.24,.75,-.9,1.17,-1.56,.96],["c",-.33,-.09,-.51,-.3,-.66,-.75],["c",-.03,-.12,-.09,-.24,-.12,-.3],["c",-.09,-.15,-.3,-.24,-.48,-.24],["c",-.57,0,-1.38,.54,-1.65,1.08],["c",-.06,.15,-.33,1.17,-.9,3.27],["c",-.57,2.31,-.81,3.12,-.87,3.21],["c",-.03,.06,-.12,.15,-.18,.21],["l",-.12,.06],["l",-.81,.03],["c",-.69,0,-.81,0,-.9,-.03],["c",-.09,-.06,-.18,-.21,-.18,-.3],["c",0,-.06,.39,-1.62,.9,-3.51],["c",.84,-3.24,.87,-3.45,.87,-3.72],["c",0,-.21,0,-.27,-.03,-.36],["c",-.12,-.15,-.21,-.24,-.42,-.24],["c",-.24,0,-.45,.15,-.78,.42],["c",-.33,.36,-.45,.54,-.72,1.14],["c",-.03,.12,-.21,.24,-.36,.27],["c",-.12,0,-.15,0,-.24,-.06],["c",-.18,-.12,-.18,-.21,-.06,-.54],["c",.21,-.57,.42,-.93,.78,-1.32],["c",.54,-.51,1.2,-.81,1.95,-.87],["c",.81,-.03,1.53,.3,1.92,.87],["l",.12,.18],["l",.09,-.09],["c",.57,-.45,1.41,-.84,2.19,-.96],["z"]],w:9.41,h:9.132},s:{d:[["M",4.47,-8.73],["c",.09,0,.36,-.03,.57,-.03],["c",.75,.03,1.29,.24,1.71,.63],["c",.51,.54,.66,1.26,.36,1.83],["c",-.24,.42,-.63,.57,-1.11,.42],["c",-.33,-.09,-.6,-.36,-.6,-.57],["c",0,-.03,.06,-.21,.15,-.39],["c",.12,-.21,.15,-.33,.18,-.48],["c",0,-.24,-.06,-.48,-.15,-.6],["c",-.15,-.21,-.42,-.24,-.75,-.15],["c",-.27,.06,-.48,.18,-.69,.36],["c",-.39,.39,-.51,.96,-.33,1.38],["c",.09,.21,.42,.51,.78,.72],["c",1.11,.69,1.59,1.11,1.89,1.68],["c",.21,.39,.24,.78,.15,1.29],["c",-.18,1.2,-1.17,2.16,-2.52,2.52],["c",-1.02,.24,-1.95,.12,-2.7,-.42],["c",-.72,-.51,-.99,-1.47,-.6,-2.19],["c",.24,-.48,.72,-.63,1.17,-.42],["c",.33,.18,.54,.45,.57,.81],["c",0,.21,-.03,.3,-.33,.51],["c",-.33,.24,-.39,.42,-.27,.69],["c",.06,.15,.21,.27,.45,.33],["c",.3,.09,.87,.09,1.2,0],["c",.75,-.21,1.23,-.72,1.29,-1.35],["c",.03,-.42,-.15,-.81,-.54,-1.2],["c",-.24,-.24,-.48,-.42,-1.41,-1.02],["c",-.69,-.42,-1.05,-.93,-1.05,-1.47],["c",0,-.39,.12,-.87,.3,-1.23],["c",.27,-.57,.78,-1.05,1.38,-1.35],["c",.24,-.12,.63,-.27,.9,-.3],["z"]],w:6.632,h:8.758},z:{d:[["M",2.64,-7.95],["c",.36,-.09,.81,-.03,1.71,.27],["c",.78,.21,.96,.27,1.74,.3],["c",.87,.06,1.02,.03,1.38,-.21],["c",.21,-.15,.33,-.15,.48,-.06],["c",.15,.09,.21,.3,.15,.45],["c",-.03,.06,-1.26,1.26,-2.76,2.67],["l",-2.73,2.55],["l",.54,.03],["c",.54,.03,.72,.03,2.01,.15],["c",.36,.03,.9,.06,1.2,.09],["c",.66,0,.81,-.03,1.02,-.24],["c",.3,-.3,.39,-.72,.27,-1.23],["c",-.06,-.27,-.06,-.27,-.03,-.39],["c",.15,-.3,.54,-.27,.69,.03],["c",.15,.33,.27,1.02,.27,1.5],["c",0,1.47,-1.11,2.7,-2.52,2.79],["c",-.57,.03,-1.02,-.09,-2.01,-.51],["c",-1.02,-.42,-1.23,-.48,-2.13,-.54],["c",-.81,-.06,-.96,-.03,-1.26,.18],["c",-.12,.06,-.24,.12,-.27,.12],["c",-.27,0,-.45,-.3,-.36,-.51],["c",.03,-.06,1.32,-1.32,2.91,-2.79],["l",2.88,-2.73],["c",-.03,0,-.21,.03,-.42,.06],["c",-.21,.03,-.78,.09,-1.23,.12],["c",-1.11,.12,-1.23,.15,-1.95,.27],["c",-.72,.15,-1.17,.18,-1.29,.09],["c",-.27,-.18,-.21,-.75,.12,-1.26],["c",.39,-.6,.93,-1.02,1.59,-1.2],["z"]],w:8.573,h:8.743},"+":{d:[["M",3.48,-9.3],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["l",.06,.15],["l",0,1.29],["l",0,1.29],["l",1.29,0],["c",1.23,0,1.29,0,1.41,.06],["c",.06,.03,.15,.09,.18,.12],["c",.12,.09,.21,.33,.21,.48],["c",0,.15,-.09,.39,-.21,.48],["c",-.03,.03,-.12,.09,-.18,.12],["c",-.12,.06,-.18,.06,-1.41,.06],["l",-1.29,0],["l",0,1.29],["c",0,1.23,0,1.29,-.06,1.41],["c",-.09,.18,-.15,.24,-.3,.33],["c",-.21,.09,-.39,.09,-.57,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.06,-.12,-.06,-.18,-.06,-1.41],["l",0,-1.29],["l",-1.29,0],["c",-1.23,0,-1.29,0,-1.41,-.06],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.09,-.18,-.09,-.36,0,-.54],["c",.09,-.18,.15,-.24,.33,-.33],["l",.15,-.06],["l",1.26,0],["l",1.29,0],["l",0,-1.29],["c",0,-1.23,0,-1.29,.06,-1.41],["c",.09,-.18,.15,-.24,.33,-.33],["z"]],w:7.507,h:7.515},",":{d:[["M",1.85,-3.36],["c",.57,-.15,1.17,.03,1.59,.45],["c",.45,.45,.6,.96,.51,1.89],["c",-.09,1.23,-.42,2.46,-.99,3.93],["c",-.3,.72,-.72,1.62,-.78,1.68],["c",-.18,.21,-.51,.18,-.66,-.06],["c",-.03,-.06,-.06,-.15,-.06,-.18],["c",0,-.06,.12,-.33,.24,-.63],["c",.84,-1.8,1.02,-2.61,.69,-3.24],["c",-.12,-.24,-.27,-.36,-.75,-.6],["c",-.36,-.15,-.42,-.21,-.6,-.39],["c",-.69,-.69,-.69,-1.71,0,-2.4],["c",.21,-.21,.51,-.39,.81,-.45],["z"]],w:3.452,h:8.143},"-":{d:[["M",.18,-5.34],["c",.09,-.06,.15,-.06,2.31,-.06],["c",2.46,0,2.37,0,2.46,.21],["c",.12,.21,.03,.42,-.15,.54],["c",-.09,.06,-.15,.06,-2.28,.06],["c",-2.16,0,-2.22,0,-2.31,-.06],["c",-.27,-.15,-.27,-.54,-.03,-.69],["z"]],w:5.001,h:.81},".":{d:[["M",1.32,-3.36],["c",1.05,-.27,2.1,.57,2.1,1.65],["c",0,1.08,-1.05,1.92,-2.1,1.65],["c",-.9,-.21,-1.5,-1.14,-1.26,-2.04],["c",.12,-.63,.63,-1.11,1.26,-1.26],["z"]],w:3.413,h:3.402},"scripts.wedge":{d:[["M",-3.66,-7.44],["c",.06,-.09,0,-.09,.81,.03],["c",1.86,.3,3.84,.3,5.73,0],["c",.78,-.12,.72,-.12,.78,-.03],["c",.15,.15,.12,.24,-.24,.6],["c",-.93,.93,-1.98,2.76,-2.67,4.62],["c",-.3,.78,-.51,1.71,-.51,2.13],["c",0,.15,0,.18,-.06,.27],["c",-.12,.09,-.24,.09,-.36,0],["c",-.06,-.09,-.06,-.12,-.06,-.27],["c",0,-.42,-.21,-1.35,-.51,-2.13],["c",-.69,-1.86,-1.74,-3.69,-2.67,-4.62],["c",-.36,-.36,-.39,-.45,-.24,-.6],["z"]],w:7.49,h:7.752},"scripts.thumb":{d:[["M",-.54,-3.69],["c",.15,-.03,.36,-.06,.51,-.06],["c",1.44,0,2.58,1.11,2.94,2.85],["c",.09,.48,.09,1.32,0,1.8],["c",-.27,1.41,-1.08,2.43,-2.16,2.73],["l",-.18,.06],["l",0,.12],["c",.03,.06,.06,.45,.09,.87],["c",.03,.57,.03,.78,0,.84],["c",-.09,.27,-.39,.48,-.66,.48],["c",-.27,0,-.57,-.21,-.66,-.48],["c",-.03,-.06,-.03,-.27,0,-.84],["c",.03,-.42,.06,-.81,.09,-.87],["l",0,-.12],["l",-.18,-.06],["c",-1.08,-.3,-1.89,-1.32,-2.16,-2.73],["c",-.09,-.48,-.09,-1.32,0,-1.8],["c",.15,-.84,.51,-1.53,1.02,-2.04],["c",.39,-.39,.84,-.63,1.35,-.75],["z"],["m",1.05,.9],["c",-.15,-.09,-.21,-.09,-.45,-.12],["c",-.15,0,-.3,.03,-.39,.03],["c",-.57,.18,-.9,.72,-1.08,1.74],["c",-.06,.48,-.06,1.8,0,2.28],["c",.15,.9,.42,1.44,.9,1.65],["c",.18,.09,.21,.09,.51,.09],["c",.3,0,.33,0,.51,-.09],["c",.48,-.21,.75,-.75,.9,-1.65],["c",.03,-.27,.03,-.54,.03,-1.14],["c",0,-.6,0,-.87,-.03,-1.14],["c",-.15,-.9,-.45,-1.44,-.9,-1.65],["z"]],w:5.955,h:9.75},"scripts.open":{d:[["M",-.54,-3.69],["c",.15,-.03,.36,-.06,.51,-.06],["c",1.44,0,2.58,1.11,2.94,2.85],["c",.09,.48,.09,1.32,0,1.8],["c",-.33,1.74,-1.47,2.85,-2.91,2.85],["c",-1.44,0,-2.58,-1.11,-2.91,-2.85],["c",-.09,-.48,-.09,-1.32,0,-1.8],["c",.15,-.84,.51,-1.53,1.02,-2.04],["c",.39,-.39,.84,-.63,1.35,-.75],["z"],["m",1.11,.9],["c",-.21,-.09,-.27,-.09,-.51,-.12],["c",-.3,0,-.42,.03,-.66,.15],["c",-.24,.12,-.51,.39,-.66,.63],["c",-.54,.93,-.63,2.64,-.21,3.81],["c",.21,.54,.51,.9,.93,1.11],["c",.21,.09,.24,.09,.54,.09],["c",.3,0,.33,0,.54,-.09],["c",.42,-.21,.72,-.57,.93,-1.11],["c",.36,-.99,.36,-2.37,0,-3.36],["c",-.21,-.54,-.51,-.9,-.9,-1.11],["z"]],w:5.955,h:7.5},"scripts.longphrase":{d:[["M",1.47,-15.09],["c",.36,-.09,.66,-.18,.69,-.18],["c",.06,0,.06,.54,.06,11.25],["l",0,11.25],["l",-.63,.15],["c",-.66,.18,-1.44,.39,-1.5,.39],["c",-.03,0,-.03,-3.39,-.03,-11.25],["l",0,-11.25],["l",.36,-.09],["c",.21,-.06,.66,-.18,1.05,-.27],["z"]],w:2.16,h:23.04},"scripts.mediumphrase":{d:[["M",1.47,-7.59],["c",.36,-.09,.66,-.18,.69,-.18],["c",.06,0,.06,.39,.06,7.5],["l",0,7.5],["l",-.63,.15],["c",-.66,.18,-1.44,.39,-1.5,.39],["c",-.03,0,-.03,-2.28,-.03,-7.5],["l",0,-7.5],["l",.36,-.09],["c",.21,-.06,.66,-.18,1.05,-.27],["z"]],w:2.16,h:15.54},"scripts.shortphrase":{d:[["M",1.47,-7.59],["c",.36,-.09,.66,-.18,.69,-.18],["c",.06,0,.06,.21,.06,3.75],["l",0,3.75],["l",-.42,.09],["c",-.57,.18,-1.65,.45,-1.71,.45],["c",-.03,0,-.03,-.72,-.03,-3.75],["l",0,-3.75],["l",.36,-.09],["c",.21,-.06,.66,-.18,1.05,-.27],["z"]],w:2.16,h:8.04},"scripts.snap":{d:[["M",4.5,-3.39],["c",.36,-.03,.96,-.03,1.35,0],["c",1.56,.15,3.15,.9,4.2,2.01],["c",.24,.27,.33,.42,.33,.6],["c",0,.27,.03,.24,-2.46,2.22],["c",-1.29,1.02,-2.4,1.86,-2.49,1.92],["c",-.18,.09,-.3,.09,-.48,0],["c",-.09,-.06,-1.2,-.9,-2.49,-1.92],["c",-2.49,-1.98,-2.46,-1.95,-2.46,-2.22],["c",0,-.18,.09,-.33,.33,-.6],["c",1.05,-1.08,2.64,-1.86,4.17,-2.01],["z"],["m",1.29,1.17],["c",-1.47,-.15,-2.97,.3,-4.14,1.2],["l",-.18,.15],["l",.06,.09],["c",.15,.12,3.63,2.85,3.66,2.85],["c",.03,0,3.51,-2.73,3.66,-2.85],["l",.06,-.09],["l",-.18,-.15],["c",-.84,-.66,-1.89,-1.08,-2.94,-1.2],["z"]],w:10.38,h:6.84}};t["noteheads.slash.whole"]={d:[["M",5,-5],["l",1,1],["l",-5,5],["l",-1,-1],["z"],["m",4,6],["l",-5,-5],["l",2,-2],["l",5,5],["z"],["m",0,-2],["l",1,1],["l",-5,5],["l",-1,-1],["z"],["m",-4,6],["l",-5,-5],["l",2,-2],["l",5,5],["z"]],w:10.81,h:15.63},t["noteheads.slash.quarter"]={d:[["M",9,-6],["l",0,4],["l",-9,9],["l",0,-4],["z"]],w:9,h:9},t["noteheads.harmonic.quarter"]={d:[["M",3.63,-4.02],["c",.09,-.06,.18,-.09,.24,-.03],["c",.03,.03,.87,.93,1.83,2.01],["c",1.5,1.65,1.8,1.98,1.8,2.04],["c",0,.06,-.3,.39,-1.8,2.04],["c",-.96,1.08,-1.8,1.98,-1.83,2.01],["c",-.06,.06,-.15,.03,-.24,-.03],["c",-.12,-.09,-3.54,-3.84,-3.6,-3.93],["c",-.03,-.03,-.03,-.09,-.03,-.15],["c",.03,-.06,3.45,-3.84,3.63,-3.96],["z"]],w:7.5,h:8.165},t["noteheads.triangle.quarter"]={d:[["M",0,4],["l",9,0],["l",-4.5,-9],["z"]],w:9,h:9};var a=function(i){for(var c=[],u=0,f=i.length;u<f;u++){c[u]=[];for(var g=0,d=i[u].length;g<d;g++)c[u][g]=i[u][g]}return c},n=function(i,c,u){for(var f=0,g=i.length;f<g;f++){var d=i[f],p,l;for(p=1,l=d.length;p<l;p++)d[p]*=p%2?c:u}},r={printSymbol:function(i,c,u,f,g){if(!t[u])return null;var d=a(t[u].d);d[0][1]+=i,d[0][2]+=c;for(var p="",l=0;l<d.length;l++)p+=d[l].join(" ");return g.path=p,f.path(g)},getPathForSymbol:function(i,c,u,f,g){if(f=f||1,g=g||1,!t[u])return null;var d=a(t[u].d);return(f!==1||g!==1)&&n(d,f,g),d[0][1]+=i,d[0][2]+=c,d},getSymbolWidth:function(i){return t[i]?t[i].w:0},symbolHeightInPitches:function(i){var c=t[i]?t[i].h:0;return c/e.STEP},getSymbolAlign:function(i){return i.substring(0,7)==="scripts"&&i!=="scripts.roll"?"center":"left"},getYCorr:function(i){switch(i){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":return-2;case"timesig.common":case"timesig.cut":return 0;case"flags.d32nd":return-1;case"flags.d64th":return-2;case"flags.u32nd":return 1;case"flags.u64th":return 3;case"rests.whole":return 1;case"rests.half":return-1;case"rests.8th":return-1;case"rests.quarter":return-1;case"rests.16th":return-1;case"rests.32nd":return-1;case"rests.64th":return-1;case"f":case"m":case"p":case"s":case"z":return-4;case"scripts.trill":case"scripts.upbow":case"scripts.downbow":return-2;case"scripts.ufermata":case"scripts.wedge":case"scripts.roll":case"scripts.shortphrase":case"scripts.longphrase":return-1;case"scripts.dfermata":return 1;default:return 0}},setSymbol:function(i,c){t[i]=c}};return un=r,un}var hn,ys;function Tg(){if(ys)return hn;ys=1;var e=Pt(),t=pt(),a=at(),n=function(i,c){var u,f=0;i.el_type="clef";var g=new e(i,0,10,"staff-extra clef",c);switch(g.isClef=!0,i.type){case"treble":u="clefs.G";break;case"tenor":u="clefs.C";break;case"alto":u="clefs.C";break;case"bass":u="clefs.F";break;case"treble+8":u="clefs.G",f=1;break;case"tenor+8":u="clefs.C",f=1;break;case"bass+8":u="clefs.F",f=1;break;case"alto+8":u="clefs.C",f=1;break;case"treble-8":u="clefs.G",f=-1;break;case"tenor-8":u="clefs.C",f=-1;break;case"bass-8":u="clefs.F",f=-1;break;case"alto-8":u="clefs.C",f=-1;break;case"none":return null;case"perc":u="clefs.perc";break;default:g.addFixed(new a("clef="+i.type,0,0,void 0,{type:"debug"}))}var d=5;if(u){var p=t.symbolHeightInPitches(u),l=r(u);if(g.addRight(new a(u,d,t.getSymbolWidth(u),i.clefPos,{top:p+i.clefPos+l,bottom:i.clefPos+l})),f!==0){var o=.6666666666666666,h=(t.getSymbolWidth(u)-t.getSymbolWidth("8")*o)/2,s=f>0?g.top+3:g.bottom-1,v=f>0?g.top+3:g.bottom-3,y=v-2;i.type==="bass-8"&&(s=3,h=0),g.addRight(new a("8",d+h,t.getSymbolWidth("8")*o,s,{scalex:o,scaley:o,top:v,bottom:y}))}}return g};function r(i){switch(i){case"clefs.G":return-5;case"clefs.C":return-4;case"clefs.F":return-4;case"clefs.perc":return-2;default:return 0}}return hn=n,hn}var fn,ws;function Eg(){if(ws)return fn;ws=1;var e=Pt(),t=pt(),a=at(),n=function(r,i){if(r.el_type="keySignature",!r.accidentals||r.accidentals.length===0)return null;var c=new e(r,0,10,"staff-extra key-signature",i);c.isKeySig=!0;var u=0;return r.accidentals.forEach(function(f){var g,d=0;switch(f.acc){case"sharp":g="accidentals.sharp",d=-3;break;case"natural":g="accidentals.nat";break;case"flat":g="accidentals.flat",d=-1.2;break;case"quartersharp":g="accidentals.halfsharp",d=-2.5;break;case"quarterflat":g="accidentals.halfflat",d=-1.2;break;default:g="accidentals.flat"}c.addRight(new a(g,u,t.getSymbolWidth(g),f.verticalPos,{thickness:t.symbolHeightInPitches(g),top:f.verticalPos+t.symbolHeightInPitches(g)+d,bottom:f.verticalPos+d})),u+=t.getSymbolWidth(g)+2},this),c};return fn=n,fn}var dn,_s;function Ag(){if(_s)return dn;_s=1;var e=pt(),t=at(),a=function(n,r,i,c){c||(c={});var u=c.dir!==void 0?c.dir:null,f=c.headx!==void 0?c.headx:0,g=c.extrax!==void 0?c.extrax:0,d=c.flag!==void 0?c.flag:null,p=c.dot!==void 0?c.dot:0,l=c.dotshiftx!==void 0?c.dotshiftx:0,o=c.scale!==void 0?c.scale:1,h=c.accidentalSlot!==void 0?c.accidentalSlot:[],s=c.shouldExtendStem!==void 0?c.shouldExtendStem:!1,v=c.printAccidentals!==void 0?c.printAccidentals:!0,y=i.verticalPos,m,_=0,k=0,x=0;if(r===void 0)n.addFixed(new t("pitch is undefined",0,0,0,{type:"debug"}));else if(r==="")m=new t(null,0,0,y);else{var R=f;if(i.printer_shift){var I=i.printer_shift==="same"?1:0;R=u==="down"?-e.getSymbolWidth(r)*o+I:e.getSymbolWidth(r)*o-I}var b={scalex:o,scaley:o,thickness:e.symbolHeightInPitches(r)*o,name:i.name};if(m=new t(r,R,e.getSymbolWidth(r)*o,y,b),m.stemDir=u,d){var A=y+(u==="down"?-7:7)*o;s&&(u==="down"&&A>6&&(A=6),u==="up"&&A<6&&(A=6));var N=u==="down"?f:f+m.w-.6;n.addRight(new t(d,N,e.getSymbolWidth(d)*o,A,{scalex:o,scaley:o}))}for(k=m.w+l-2+5*p;p>0;p--){var M=1-Math.abs(y)%2;n.addRight(new t("dots.dot",m.w+l-2+5*p,e.getSymbolWidth("dots.dot"),y+M))}}if(m&&(m.highestVert=i.highestVert),v&&i.accidental){var z;switch(i.accidental){case"quartersharp":z="accidentals.halfsharp";break;case"dblsharp":z="accidentals.dblsharp";break;case"sharp":z="accidentals.sharp";break;case"quarterflat":z="accidentals.halfflat";break;case"flat":z="accidentals.flat";break;case"dblflat":z="accidentals.dblflat";break;case"natural":z="accidentals.nat"}for(var L=!1,E=g,T=0;T<h.length;T++)if(y-h[T][0]>=6){h[T][0]=y,E=h[T][1],L=!0;break}L===!1&&(E-=e.getSymbolWidth(z)*o+2,h.push([y,E]),_=e.getSymbolWidth(z)*o+2);var P=e.symbolHeightInPitches(z);n.addExtra(new t(z,E,e.getSymbolWidth(z),y,{scalex:o,scaley:o,top:y+P/2,bottom:y-P/2})),x=e.getSymbolWidth(z)/2}return{notehead:m,accidentalshiftx:_,dotshiftx:k,extraLeft:x}};return dn=a,dn}var pn,ks;function Mg(){if(ks)return pn;ks=1;var e=Pt(),t=pt(),a=at(),n=function(r,i){r.el_type="timeSignature";var c=new e(r,0,10,"staff-extra time-signature",i);if(r.type==="specified")for(var u=0,f=0;f<r.value.length;f++)if(f!==0&&(c.addRight(new a("+",u+1,t.getSymbolWidth("+"),6,{thickness:t.symbolHeightInPitches("+")})),u+=t.getSymbolWidth("+")+2),r.value[f].den){for(var g=0,d=0;d<r.value[f].num.length;d++)g+=t.getSymbolWidth(r.value[f].num[d]);var p=0;for(d=0;d<r.value[f].num.length;d++)p+=t.getSymbolWidth(r.value[f].den[d]);var l=Math.max(g,p);c.addRight(new a(r.value[f].num,u+(l-g)/2,g,8,{thickness:t.symbolHeightInPitches(r.value[f].num[0])})),c.addRight(new a(r.value[f].den,u+(l-p)/2,p,4,{thickness:t.symbolHeightInPitches(r.value[f].den[0])})),u+=l}else{for(var o=0,h=0;h<r.value[f].num.length;h++)o+=t.getSymbolWidth(r.value[f].num[h]);c.addRight(new a(r.value[f].num,u,o,6,{thickness:t.symbolHeightInPitches(r.value[f].num[0])})),u+=o}else r.type==="common_time"?c.addRight(new a("timesig.common",0,t.getSymbolWidth("timesig.common"),6,{thickness:t.symbolHeightInPitches("timesig.common")})):r.type==="cut_time"?c.addRight(new a("timesig.cut",0,t.getSymbolWidth("timesig.cut"),6,{thickness:t.symbolHeightInPitches("timesig.cut")})):r.type==="tempus_imperfectum"?c.addRight(new a("timesig.imperfectum",0,t.getSymbolWidth("timesig.imperfectum"),6,{thickness:t.symbolHeightInPitches("timesig.imperfectum")})):r.type==="tempus_imperfectum_prolatio"?c.addRight(new a("timesig.imperfectum2",0,t.getSymbolWidth("timesig.imperfectum2"),6,{thickness:t.symbolHeightInPitches("timesig.imperfectum2")})):r.type==="tempus_perfectum"?c.addRight(new a("timesig.perfectum",0,t.getSymbolWidth("timesig.perfectum"),6,{thickness:t.symbolHeightInPitches("timesig.perfectum")})):r.type==="tempus_perfectum_prolatio"?c.addRight(new a("timesig.perfectum2",0,t.getSymbolWidth("timesig.perfectum2"),6,{thickness:t.symbolHeightInPitches("timesig.perfectum2")})):console.log("time signature:",r);return c};return pn=n,pn}var gn,xs;function Ng(){if(xs)return gn;xs=1;var e=function(a,n,r){this.type="DynamicDecoration",this.anchor=a,this.dec=n,r==="below"?this.volumeHeightBelow=6:this.volumeHeightAbove=6,this.pitch=void 0};return gn=e,gn}var vn,Cs;function Pg(){if(Cs)return vn;Cs=1;var e=function(a,n,r,i){this.type="CrescendoElem",this.anchor1=a,this.anchor2=n,this.dir=r,i==="above"?this.dynamicHeightAbove=6:this.dynamicHeightBelow=6,this.pitch=void 0};return vn=e,vn}var mn,Ss;function zg(){if(Ss)return mn;Ss=1;var e=function(a,n){this.type="GlissandoElem",this.anchor1=a,this.anchor2=n};return mn=e,mn}var bn,Ts;function Rl(){if(Ts)return bn;Ts=1;var e=function(a){this.type="TieElem",this.anchor1=a.anchor1,this.anchor2=a.anchor2,a.isGrace&&(this.isGrace=!0),a.fixedY&&(this.fixedY=!0),a.stemDir&&(this.stemDir=a.stemDir),a.voiceNumber!==void 0&&(this.voiceNumber=a.voiceNumber),a.style!==void 0&&(this.dotted=!0),this.internalNotes=[]};return e.prototype.addInternalNote=function(t){this.internalNotes.push(t)},e.prototype.setEndAnchor=function(t){this.anchor2=t,this.anchor1?(this.top=Math.max(this.anchor1.pitch,this.anchor2.pitch)+4,this.bottom=Math.min(this.anchor1.pitch,this.anchor2.pitch)-4):(this.top=this.anchor2.pitch+4,this.bottom=this.anchor2.pitch-4)},e.prototype.setStartX=function(t){this.startLimitX=t},e.prototype.setEndX=function(t){this.endLimitX=t},e.prototype.setHint=function(){this.hint=!0},e.prototype.calcTieDirection=function(){if(this.isGrace)this.above=!1;else if(this.voiceNumber===0)this.above=!0;else if(this.voiceNumber>0)this.above=!1;else{var t;this.anchor1?t=this.anchor1.pitch:this.anchor2?t=this.anchor2.pitch:t=14,this.anchor1&&this.anchor1.stemDir==="down"&&this.anchor2&&this.anchor2.stemDir==="down"?this.above=!0:this.anchor1&&this.anchor1.stemDir==="up"&&this.anchor2&&this.anchor2.stemDir==="up"?this.above=!1:this.anchor1&&this.anchor2?this.above=t>=6:this.anchor1?this.above=this.anchor1.stemDir==="down":this.anchor2?this.above=this.anchor2.stemDir==="down":this.above=t>=6}},e.prototype.calcSlurDirection=function(){if(this.isGrace)this.above=!1;else if(this.voiceNumber===0)this.above=!0;else if(this.voiceNumber>0)this.above=!1;else{var t=!1;this.anchor1&&this.anchor1.stemDir==="down"&&(t=!0),this.anchor2&&this.anchor2.stemDir==="down"&&(t=!0);for(var a=0;a<this.internalNotes.length;a++){var n=this.internalNotes[a];n.stemDir==="down"&&(t=!0)}this.above=t}},e.prototype.calcX=function(t,a){this.anchor1?(this.startX=this.anchor1.x,this.anchor1.scalex<1&&(this.startX-=3)):this.startLimitX?this.startX=this.startLimitX.x+this.startLimitX.w:this.anchor2?this.startX=this.anchor2.x-20:this.startX=t,!this.anchor1&&this.dotted&&(this.startX-=3),this.anchor2?this.endX=this.anchor2.x:this.endLimitX?this.endX=this.endLimitX.x:this.endX=a},e.prototype.calcTieY=function(){this.anchor1?this.startY=this.anchor1.pitch:this.anchor2?this.startY=this.anchor2.pitch:this.startY=this.above?14:0,this.anchor2?this.endY=this.anchor2.pitch:this.anchor1?this.endY=this.anchor1.pitch:this.endY=this.above?14:0},e.prototype.calcSlurY=function(){if(this.anchor1&&this.anchor2){this.above&&this.anchor1.stemDir==="up"&&!this.fixedY?(this.startY=(this.anchor1.highestVert+this.anchor1.pitch)/2,this.startX+=this.anchor1.w/2):this.startY=this.anchor1.pitch;var t=this.anchor2.parent.beam&&this.anchor2.parent.beam.stemsUp&&this.anchor2.parent.beam.elems[0]!==this.anchor2.parent,a=(this.anchor2.highestVert+this.anchor2.pitch)/2;if(this.above&&this.anchor2.stemDir==="up"&&!this.fixedY&&!t&&a<this.startY?(this.endY=a,this.endX+=Math.round(this.anchor2.w/2)):this.endY=this.above&&t?this.anchor2.highestVert:this.anchor2.pitch,this.anchor1.scalex===1){var n=!!this.anchor1.parent.beam,r=!!this.anchor2.parent.beam;if(n){var i=this.anchor1.parent===this.anchor1.parent.beam.elems[this.anchor1.parent.beam.elems.length-1];i||(this.above?this.startY=this.anchor1.parent.fixed.t:this.startY=this.anchor1.parent.fixed.b)}if(r){var c=this.anchor2.parent===this.anchor2.parent.beam.elems[0];c||(this.above?this.endY=this.anchor2.parent.fixed.t:this.endY=this.anchor2.parent.fixed.b)}}}else this.anchor1?this.startY=this.endY=this.anchor1.pitch:this.anchor2?this.startY=this.endY=this.anchor2.pitch:(this.startY=this.above?14:0,this.endY=this.above?14:0)},e.prototype.avoidCollisionAbove=function(){if(this.above){for(var t=-50,a=0;a<this.internalNotes.length;a++)this.internalNotes[a].highestVert>t&&(t=this.internalNotes[a].highestVert);t>this.startY&&t>this.endY&&(this.startY=this.endY=t-1)}},e.prototype.getYBounds=function(){var t=10,a=1e3;this.isTie?(this.calcTieDirection(),this.calcX(t,a),this.calcTieY()):(this.calcSlurDirection(),this.calcX(t,a),this.calcSlurY());var n,r;return this.above?(r=Math.min(this.startY,this.endY),n=r+3):(n=Math.min(this.startY,this.endY),r=n-3),[n,r]},bn=e,bn}var yn,Es;function Ig(){if(Es)return yn;Es=1;var e=Ng(),t=Pg(),a=zg(),n=pt(),r=at(),i=Rl(),c=function(){this.startDiminuendoX=void 0,this.startCrescendoX=void 0,this.minTop=12,this.minBottom=0},u=function(l,o,h,s,v,y,m,_,k){for(var x,R=0;R<o.length;R++){if(o[R]==="staccato"||o[R]==="tenuto"||o[R]==="accent"&&!k){var I="scripts."+o[R];if(o[R]==="accent"&&(I="scripts.sforzato"),x===void 0?x=m==="down"?h+2:_-2:x=m==="down"?x+2:x-2,o[R]==="accent")m==="up"?x--:x++;else switch(x){case 2:case 4:case 6:case 8:case 10:m==="up"?x--:x++;break}h>9&&x++;var b=s/2;n.getSymbolAlign(I)!=="center"&&(b-=n.getSymbolWidth(I)/2),v.addFixedX(new r(I,b,n.getSymbolWidth(I),x))}if(o[R]==="slide"&&v.heads[0]){var A=v.heads[0].pitch;A-=2;var N=new r("",-y-15,0,A-1),M=new r("",-y-5,0,A+1);v.addFixedX(N),v.addFixedX(M),l.addOther(new i({anchor1:N,anchor2:M,fixedY:!0}))}}return x===void 0&&(x=h),{above:x,below:v.bottom}},f=function(l,o,h,s){for(var v=0;v<o.length;v++)switch(o[v]){case"p":case"mp":case"pp":case"ppp":case"pppp":case"f":case"ff":case"fff":case"ffff":case"sfz":case"mf":var y=new e(h,o[v],s);l.addOther(y)}},g=function(l,o,h,s,v){function y(){if(s.heads.length===0)return 10;for(var x=s.heads[0].pitch,R=1;R<s.heads.length;R++)x=Math.max(x,s.heads[R].pitch);return x}function m(){if(s.heads.length===0)return 2;for(var x=s.heads[0].pitch,R=1;R<s.heads.length;R++)x=Math.min(x,s.heads[R].pitch);return x}function _(x,R){var I=v==="down"?m()+1:y()+9;v!=="down"&&R===1&&I--;var b=h/2;b+=v==="down"?-5:3;for(var A=0;A<R;A++)I-=1,s.addFixedX(new r(x,b,n.getSymbolWidth(x),I))}for(var k=0;k<l.length;k++)switch(l[k]){case"/":_("flags.ugrace",1);break;case"//":_("flags.ugrace",2);break;case"///":_("flags.ugrace",3);break;case"////":_("flags.ugrace",4);break}},d=function(l,o,h,s,v,y,m,_){function k(M,z){M==="above"?s.above+=z:s.below-=z}function x(M){var z;return M==="above"?(z=s.above,z<y&&(z=y)):(z=s.below,z>m&&(z=m)),z}function R(M,z,L){var E=x(z),T=2,P=5;h.addFixedX(new r(M,o/2,0,E+T,{type:"decoration",klass:"ornament",thickness:3,anchor:L})),k(z,P)}function I(M,z){var L=o/2;n.getSymbolAlign(M)!=="center"&&(L-=n.getSymbolWidth(M)/2);var E=n.symbolHeightInPitches(M)+1,T=x(z);T=z==="above"?T+E/2:T-E/2,h.addFixedX(new r(M,L,n.getSymbolWidth(M),T,{klass:"ornament",thickness:n.symbolHeightInPitches(M),position:z})),k(z,E)}for(var b={"+":"scripts.stopped",open:"scripts.open",snap:"scripts.snap",wedge:"scripts.wedge",thumb:"scripts.thumb",shortphrase:"scripts.shortphrase",mediumphrase:"scripts.mediumphrase",longphrase:"scripts.longphrase",trill:"scripts.trill",trillh:"scripts.trill",roll:"scripts.roll",irishroll:"scripts.roll",marcato:"scripts.umarcato",dmarcato:"scripts.dmarcato",umarcato:"scripts.umarcato",turn:"scripts.turn",uppermordent:"scripts.prall",pralltriller:"scripts.prall",mordent:"scripts.mordent",lowermordent:"scripts.mordent",downbow:"scripts.downbow",upbow:"scripts.upbow",fermata:"scripts.ufermata",invertedfermata:"scripts.dfermata",breath:",",coda:"scripts.coda",segno:"scripts.segno"},A=!1,N=0;N<l.length;N++)switch(l[N]){case"0":case"1":case"2":case"3":case"4":case"5":case"D.C.":case"D.S.":R(l[N],v,"middle"),A=!0;break;case"D.C.alcoda":R("D.C. al coda",v,"end"),A=!0;break;case"D.C.alfine":R("D.C. al fine",v,"end"),A=!0;break;case"D.S.alcoda":R("D.S. al coda",v,"end"),A=!0;break;case"D.S.alfine":R("D.S. al fine",v,"end"),A=!0;break;case"fine":R("FINE",v,"middle"),A=!0;break;case"+":case"open":case"snap":case"wedge":case"thumb":case"shortphrase":case"mediumphrase":case"longphrase":case"trill":case"trillh":case"roll":case"irishroll":case"marcato":case"dmarcato":case"turn":case"uppermordent":case"pralltriller":case"mordent":case"lowermordent":case"downbow":case"upbow":case"fermata":case"breath":case"umarcato":case"coda":case"segno":I(b[l[N]],v),A=!0;break;case"invertedfermata":I(b[l[N]],"below"),A=!0;break;case"mark":h.klass="mark";break;case"accent":_&&(I("scripts.sforzato",v),A=!0);break}return A};function p(l,o,h){for(var s=0;s<l.length;s++)switch(l[s]){case"arpeggio":for(var v=o.abcelem.minpitch-1;v<=o.abcelem.maxpitch;v+=2)o.addExtra(new r("scripts.arpeggio",-n.getSymbolWidth("scripts.arpeggio")*2-h,0,v+2,{klass:"ornament",thickness:n.symbolHeightInPitches("scripts.arpeggio")}));break}}return c.prototype.dynamicDecoration=function(l,o,h,s){for(var v,y,m,_=0;_<o.length;_++)switch(o[_]){case"diminuendo(":this.startDiminuendoX=h,v=void 0;break;case"diminuendo)":v={start:this.startDiminuendoX,stop:h},this.startDiminuendoX=void 0;break;case"crescendo(":this.startCrescendoX=h,y=void 0;break;case"crescendo)":y={start:this.startCrescendoX,stop:h},this.startCrescendoX=void 0;break;case"~(":case"glissando(":this.startGlissandoX=h,m=void 0;break;case"~)":case"glissando)":m={start:this.startGlissandoX,stop:h},this.startGlissandoX=void 0;break}v&&l.addOther(new t(v.start,v.stop,">",s)),y&&l.addOther(new t(y.start,y.stop,"<",s)),m&&l.addOther(new a(m.start,m.stop))},c.prototype.createDecoration=function(l,o,h,s,v,y,m,_,k,x,R){k||(k={ornamentPosition:"above",volumePosition:x?"above":"below",dynamicPosition:x?"above":"below"}),f(l,o,v,k.volumePosition),this.dynamicDecoration(l,o,v,k.dynamicPosition),g(o,h,s,v,m);var I=u(l,o,h,s,v,y,m,_,R);I.above=Math.max(I.above,this.minTop),I.below=Math.min(I.below,_),d(o,s,v,I,k.ornamentPosition,this.minTop,_,R),p(o,v,y)},yn=c,yn}var wn,As;function Rg(){if(As)return wn;As=1;var e=function(a,n,r){this.type="EndingElem",this.text=a,this.anchor1=n,this.anchor2=r,this.endingHeightAbove=5,this.pitch=void 0};return wn=e,wn}var _n,Ms;function qg(){if(Ms)return _n;Ms=1;var e=function(t){for(var a=0,n=0;n<t.voices.length;n++){var r=t.voices[n].staff;t.voices[n].duplicate||(a+=r.top,a+=-r.bottom)}return a};return _n=e,_n}var kn,Ns;function Bg(){if(Ns)return kn;Ns=1;var e=qg(),t=function(a){this.getTextSize=a,this.voices=[],this.staffs=[],this.brace=void 0,this.bracket=void 0};return t.prototype.setLimit=function(a,n){n.specialY[a]&&(n.staff.specialY[a]?n.staff.specialY[a]=Math.max(n.staff.specialY[a],n.specialY[a]):n.staff.specialY[a]=n.specialY[a])},t.prototype.addVoice=function(a,n,r){var i=this.voices.length;this.voices[i]=a,this.staffs[n]?this.staffs[n].voices.push(i):this.staffs[this.staffs.length]={top:10,bottom:2,lines:r,voices:[i],specialY:{tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}},a.staff=this.staffs[n]},t.prototype.setHeight=function(){this.height=e(this)},t.prototype.setWidth=function(a){this.w=a;for(var n=0;n<this.voices.length;n++)this.voices[n].setWidth(a)},t.prototype.setStaffLimits=function(a){a.staff.top=Math.max(a.staff.top,a.top),a.staff.bottom=Math.min(a.staff.bottom,a.bottom),this.setLimit("tempoHeightAbove",a),this.setLimit("partHeightAbove",a),this.setLimit("volumeHeightAbove",a),this.setLimit("dynamicHeightAbove",a),this.setLimit("endingHeightAbove",a),this.setLimit("chordHeightAbove",a),this.setLimit("lyricHeightAbove",a),this.setLimit("lyricHeightBelow",a),this.setLimit("chordHeightBelow",a),this.setLimit("volumeHeightBelow",a),this.setLimit("dynamicHeightBelow",a)},kn=t,kn}var xn,Ps;function Lg(){if(Ps)return xn;Ps=1;var e=Pt(),t=at(),a=function(r,i,c){this.type="TempoElement",this.tempo=r,this.tempo.type="tempo",this.tuneNumber=i,this.totalHeightInPitches=6,this.tempoHeightAbove=this.totalHeightInPitches,this.pitch=void 0,this.tempo.duration&&!this.tempo.suppressBpm&&(this.note=this.createNote(c,r,i))};return a.prototype.setX=function(n){this.x=n},a.prototype.createNote=function(n,r,i){var c=.75,u=r.duration[0],f=new e(r,u,1,"tempo",i),g,d,p;u<=1/32?(p="noteheads.quarter",d="flags.u32nd",g=0):u<=1/16?(p="noteheads.quarter",d="flags.u16th",g=0):u<=3/32?(p="noteheads.quarter",d="flags.u16nd",g=1):u<=1/8?(p="noteheads.quarter",d="flags.u8th",g=0):u<=3/16?(p="noteheads.quarter",d="flags.u8th",g=1):u<=1/4?(p="noteheads.quarter",g=0):u<=3/8?(p="noteheads.quarter",g=1):u<=1/2?(p="noteheads.half",g=0):u<=3/4?(p="noteheads.half",g=1):u<=1?(p="noteheads.whole",g=0):u<=1.5?(p="noteheads.whole",g=1):u<=2?(p="noteheads.dbl",g=0):(p="noteheads.dbl",g=1);var l=n(f,p,{verticalPos:0},{dir:"up",flag:d,dot:g,scale:c}),o=l.notehead;f.addHead(o);var h;if(p!=="noteheads.whole"&&p!=="noteheads.dbl"){var s=.3333333333333333*c,v=5*c,y=o.dx+o.w,m=-.6;h=new t(null,y,0,s,{type:"stem",pitch2:v,linewidth:m}),f.addRight(h)}return f},xn=a,xn}var Cn,zs;function Og(){if(zs)return Cn;zs=1;var e=function(a,n,r){this.type="TripletElem",this.anchor1=n,this.number=a,this.durationClass=("d"+Math.round(n.parent.durationClass*1e3)/1e3).replace(/\./,"-"),this.middleElems=[],this.flatBeams=r.flatBeams};return e.prototype.isClosed=function(){return!!this.anchor2},e.prototype.middleNote=function(t){this.middleElems.push(t)},e.prototype.setCloseAnchor=function(t){this.anchor2=t,(!this.anchor1.parent.beam||this.anchor1.stemDir==="up")&&(this.endingHeightAbove=4)},Cn=e,Cn}var Sn,Is;function Dg(){if(Is)return Sn;Is=1;function e(a){switch(a){case"B#":return"H#";case"B♯":return"H♯";case"B":return"H";case"Bb":return"B";case"B♭":return"B"}return a}function t(a,n,r){var i=a.split(`
|
|
110
110
|
`);for(let c=0;c<i.length;c++){let f=i[c].match(/^([ABCDEFG][♯♭]?)?([^\/]+)?(\/([ABCDEFG][#b♯♭]?))?/);if(!f)continue;let g=f[1]||"",d=f[2]||"",p=f[4]||"";r&&(g=e(g),p=e(p));const l=n?"":"",o=p?"/"+p:"";i[c]=[g,d,o].join(l)}return i.join(`
|
|
111
|
-
`)}return
|
|
112
|
-
`),x=k.length-1;x>=0;x--){var R=k[x],I=0,b;f||(R=a(R,m,_));var A=l.calc(R,g,d),N=A.width,M=A.height/t.STEP;switch(c){case"left":s+=N+7,I=-s,b=h.averagepitch,o.addExtra(new e(R,I,N+4,b,{type:"text",height:M,dim:p,position:"left"}));break;case"right":v+=4,I=v,b=h.averagepitch,o.addRight(new e(R,I,N+4,b,{type:"text",height:M,dim:p,position:"right"}));break;case"below":o.addRight(new e(R,0,0,void 0,{type:"text",position:"below",height:M,dim:p,realWidth:N}));break;case"above":o.addRight(new e(R,0,0,void 0,{type:"text",position:"above",height:M,dim:p,realWidth:N}));break;default:if(u){var z=u.y+3*t.STEP;o.addRight(new e(R,I+u.x,0,h.minpitch+z/t.STEP,{position:"relative",type:"text",height:M,dim:p}))}else{var L="above";h.positioning&&h.positioning.chordPosition&&(L=h.positioning.chordPosition),L!=="hidden"&&o.addCentered(new e(R,y/2,N,void 0,{type:"chord",position:L,height:M,dim:p,realWidth:N}))}}}return{roomTaken:s,roomTakenRight:v}}return
|
|
113
|
-
`),C.headerPosition=6+E.getTextSize.baselineToCenter(C.header,"voicefont","staff-extra voice-name",w,T.voices.length)/p.STEP),T.clef&&T.clef.type==="perc"&&(C.isPercussion=!0);var S=(!this.initialClef||O===0)&&n(T.clef,this.tuneNumber);S&&(w===0&&T.barNumber&&this.addMeasureNumber(T.barNumber,S),C.addChild(S),this.startlimitelem=S);var q=r(T.key,this.tuneNumber);if(q&&(C.addChild(q),this.startlimitelem=q),T.meter){T.meter.type==="specified"?this.measureLength=T.meter.value[0].num/T.meter.value[0].den:this.measureLength=1;var D=c(T.meter,this.tuneNumber);C.addChild(D),this.startlimitelem=D}C.duplicate&&(C.children=[]);var $=T.clef.stafflines||T.clef.stafflines===0?T.clef.stafflines:5;E.addVoice(C,B,$);var F=$===1;this.createABCVoice(T.voices[w],P,B,w,F,C),E.setStaffLimits(C),w===0&&(T.brace==="start"||!E.brace&&T.brace?(E.brace||(E.brace=[]),E.brace.push(new a(C,"brace"))):T.brace==="end"&&E.brace?E.brace[E.brace.length-1].setBottomStaff(C):T.brace==="continue"&&E.brace&&E.brace[E.brace.length-1].continuing(C),T.bracket==="start"||!E.bracket&&T.bracket?(E.bracket||(E.bracket=[]),E.bracket.push(new a(C,"bracket"))):T.bracket==="end"&&E.bracket?E.bracket[E.bracket.length-1].setBottomStaff(C):T.bracket==="continue"&&E.bracket&&E.bracket[E.bracket.length-1].continuing(C))}};function b(E,T){var P=E[T];if(P.el_type!=="note"||!P.startBeam||P.endBeam)return{count:1,elem:P};for(var B=[];T<E.length&&E[T].el_type==="note"&&(B.push(E[T]),!E[T].endBeam);)T++;return{count:B.length,elem:B}}I.prototype.createABCVoice=function(E,T,P,B,O,w){this.popCrossLineElems(P,B),this.stemdir=this.isBagpipes?"down":null,this.abcline=E,this.partstartelem&&(this.partstartelem=new f("",null,null),w.addOther(this.partstartelem));var C=w.voicetotal<2?-1:w.voicenumber;for(var S in this.slurs)this.slurs.hasOwnProperty(S)&&(this.slurs[S]=new h({force:this.slurs[S].force,voiceNumber:C,stemDir:this.slurs[S].stemDir,style:this.slurs[S].dotted}),x&&this.slurs[S].setHint(),w.addOther(this.slurs[S]));for(var q=0;q<this.ties.length;q++)this.ties[q]=new h({force:this.ties[q].force,stemDir:this.ties[q].stemDir,voiceNumber:C,style:this.ties[q].dotted}),x&&this.ties[q].setHint(),w.addOther(this.ties[q]);for(var D=0;D<this.abcline.length;D++)A(this.abcline[D]),this.minY=Math.min(this.abcline[D].minpitch,this.minY);for(var $=P===0,F=0;F<this.abcline.length;){var K=b(this.abcline,F),te=this.createABCElement($,O,w,K.elem);if(te)for(q=0;q<te.length;q++){if(!this.tempoSet&&T&&!T.suppress){this.tempoSet=!0;var V=new e(T,0,0,"tempo",this.tuneNumber,{});V.addFixedX(new o(T,this.tuneNumber,i)),w.addChild(V)}w.addChild(te[q])}F+=K.count}this.pushCrossLineElems(P,B)},I.prototype.saveState=function(){this.tiesSave=_.cloneArray(this.ties),this.slursSave=_.cloneHashOfHash(this.slurs),this.slursbyvoiceSave=_.cloneHashOfHash(this.slursbyvoice),this.tiesbyvoiceSave=_.cloneHashOfArrayOfHash(this.tiesbyvoice)},I.prototype.restoreState=function(){this.ties=_.cloneArray(this.tiesSave),this.slurs=_.cloneHashOfHash(this.slursSave),this.slursbyvoice=_.cloneHashOfHash(this.slursbyvoiceSave),this.tiesbyvoice=_.cloneHashOfArrayOfHash(this.tiesbyvoiceSave)},I.prototype.createABCElement=function(E,T,P,B){var O=[];switch(B.el_type){case void 0:O=this.createBeam(T,P,B);break;case"note":O[0]=this.createNote(B,!1,T,P),this.triplet&&this.triplet.isClosed()&&(P.addOther(this.triplet),this.triplet=null,this.tripletmultiplier=1);break;case"bar":O[0]=this.createBarLine(P,B,E),P.duplicate&&O.length>0&&(O[0].invisible=!0);break;case"meter":O[0]=c(B,this.tuneNumber),this.startlimitelem=O[0],P.duplicate&&O.length>0&&(O[0].invisible=!0);break;case"clef":if(O[0]=n(B,this.tuneNumber),!O[0])return null;P.duplicate&&O.length>0&&(O[0].invisible=!0);break;case"key":var w=r(B,this.tuneNumber);w&&(O[0]=w,this.startlimitelem=O[0]),P.duplicate&&O.length>0&&(O[0].invisible=!0);break;case"stem":this.stemdir=B.direction==="auto"?void 0:B.direction;break;case"part":var C=new e(B,0,0,"part",this.tuneNumber),S=this.getTextSize.calc(B.title,"partsfont","part");C.addFixedX(new d(B.title,0,0,void 0,{type:"part",height:S.height/p.STEP})),O[0]=C;break;case"tempo":var q=new e(B,0,0,"tempo",this.tuneNumber);B.suppress||q.addFixedX(new o(B,this.tuneNumber,i)),O[0]=q;break;case"style":B.head==="normal"?delete this.style:this.style=B.head;break;case"hint":x=!0,this.saveState();break;case"midi":break;case"scale":this.voiceScale=B.size;break;case"color":this.voiceColor=B.color,P.color=this.voiceColor;break;default:var D=new e(B,0,0,"unsupported",this.tuneNumber);D.addFixed(new d("element type "+B.el_type,0,0,void 0,{type:"debug"})),O[0]=D}return O};function A(E){if(E.pitches){N(E);for(var T=0,P=0;P<E.pitches.length;P++)T+=E.pitches[P].verticalPos;E.averagepitch=T/E.pitches.length,E.minpitch=E.pitches[0].verticalPos,E.maxpitch=E.pitches[E.pitches.length-1].verticalPos}}I.prototype.createBeam=function(E,T,P){var B=[],O=new t(this.stemHeight*this.voiceScale,this.stemdir,this.flatBeams,P[0]);x&&O.setHint();for(var w=0;w<P.length;w++)O.runningDirection(P[w]);O.setStemDirection();var C=this.stemdir;for(this.stemdir=O.stemsUp?"up":"down",w=0;w<P.length;w++){var S=P[w],q=this.createNote(S,!0,E,T);B.push(q),O.add(q),this.triplet&&this.triplet.isClosed()&&(T.addOther(this.triplet),this.triplet=null,this.tripletmultiplier=1)}return O.calcDir(),T.addBeam(O),this.stemdir=C,B};var N=function(E){var T;do{T=!0;for(var P=0;P<E.pitches.length-1;P++)if(E.pitches[P].pitch>E.pitches[P+1].pitch){T=!1;var B=E.pitches[P];E.pitches[P]=E.pitches[P+1],E.pitches[P+1]=B}}while(!T)},M=function(E,T,P,B,O,w,C,S,q){for(var D=P;D>11;D--)D%2===0&&!B&&E.addFixed(new d(null,S,(O+4)*q,D,{type:"ledger"}));for(D=T;D<1;D++)D%2===0&&!B&&E.addFixed(new d(null,S,(O+4)*q,D,{type:"ledger"}));for(D=0;D<w.length;D++){var $=O;C==="down"&&($=-$),E.addFixed(new d(null,$+S,(O+4)*q,w[D],{type:"ledger"}))}};I.prototype.addGraceNotes=function(E,T,P,B,O,w,C){var S=.6,q=3.5/5;O=Math.round(O*q);var D=null,$;E.gracenotes.length>1&&(D=new t(O,"grace",w),x&&D.setHint(),D.mainNote=P);var F,K=[];for(F=E.gracenotes.length-1;F>=0;F--)C+=10,K[F]=C,E.gracenotes[F].accidental&&(C+=7);for(F=0;F<E.gracenotes.length;F++){var te=E.gracenotes[F].verticalPos;$=D?null:R.uflags[w?5:3];var V=[],ae=i(P,"noteheads.quarter",E.gracenotes[F],{dir:"up",headx:-K[F],extrax:-K[F],flag:$,scale:S*this.voiceScale,accidentalSlot:V});ae.notehead.highestVert=ae.notehead.pitch+O;var oe=ae.notehead;if(this.addSlursAndTies(P,E.gracenotes[F],oe,T,"up",!0),P.addExtra(oe),E.gracenotes[F].acciaccatura){var le=E.gracenotes[F].verticalPos+7*S,J=D?5:6;P.addRight(new d("flags.ugrace",-K[F]+J,0,le,{scalex:S,scaley:S}))}if(D){var ce=E.gracenotes[F].duration/2;w&&(ce/=2);var ee={heads:[oe],abcelem:{averagepitch:te,minpitch:te,maxpitch:te,duration:ce}};D.add(ee)}else{var he=te+.3333333333333333*S,de=te+7*S,Se=oe.dx+oe.w,we=-.6;P.addExtra(new d(null,Se,0,he,{type:"stem",pitch2:de,linewidth:we}))}M(P,te,te,!1,g.getSymbolWidth("noteheads.quarter"),[],!0,oe.dx-1,.6);var Re=E.rest&&(E.rest.type==="spacer"||E.rest.type==="invisible");F===0&&!w&&this.graceSlurs&&!Re&&T.addOther(new h({anchor1:oe,anchor2:B,isGrace:!0}))}return D&&(D.calcDir(),T.addBeam(D)),C};function z(E,T,P,B,O,w,C,S,q){var D,$=7,F,K,te;switch(O&&(w==="down"&&($=3),w==="up"&&($=11)),C&&(P<.5||P<1?$=7:$=5),T.rest.type){case"whole":D=R.rest[0],T.averagepitch=$,T.minpitch=$,T.maxpitch=$,B=0;break;case"rest":T.style==="rhythm"?D=R.rhythm[-S]:D=R.rest[-S],T.averagepitch=$,T.minpitch=$,T.maxpitch=$;break;case"invisible":case"invisible-multimeasure":case"spacer":D="",T.averagepitch=$,T.minpitch=$,T.maxpitch=$;break;case"multimeasure":D=R.rest.multi,T.averagepitch=$,T.minpitch=$,T.maxpitch=$,B=0;var V=g.getSymbolWidth(D);E.addHead(new d(D,V,V*2,7));var ae=new d(""+T.rest.text,V,V,16,{type:"multimeasure-text"});E.addExtra(ae)}if(T.rest.type.indexOf("multimeasure")<0&&T.rest.type!=="invisible"){var oe=i(E,D,{verticalPos:$},{dot:B,scale:q});F=oe.notehead,F&&(E.addHead(F),K=oe.accidentalshiftx,te=oe.dotshiftx)}return{noteHead:F,roomTaken:K,roomTakenRight:te}}function L(E,T){for(var P=0;P<E.length;P++)if(JSON.stringify(E[P])===JSON.stringify(T))return;E.push(T)}return I.prototype.addNoteToAbcElement=function(E,T,P,B,O,w,C,S,q){var D=0,$,F=0,K=0,te,V,ae=[],oe=[],le=0,J=T.averagepitch>=6?"down":"up";B&&(J=B),O=T.style?T.style:O,(!O||O==="normal")&&(O="note");var ce;w?ce=R[O].nostem:ce=R[O][-C],ce||console.log("noteSymbol:",O,C,w);var ee;for(ee=J==="down"?T.pitches.length-2:1;J==="down"?ee>=0:ee<T.pitches.length;ee=J==="down"?ee-1:ee+1){var he=T.pitches[J==="down"?ee+1:ee-1],de=T.pitches[ee],Se=J==="down"?he.pitch-de.pitch:de.pitch-he.pitch;Se<=1&&!he.printer_shift&&(de.printer_shift=Se?"different":"same",(de.verticalPos>11||de.verticalPos<1)&&ae.push(de.verticalPos-de.verticalPos%2),J==="down"?F=g.getSymbolWidth(ce)+2:D=g.getSymbolWidth(ce)+2)}var we=T.pitches.length;for(ee=0;ee<T.pitches.length;ee++){if(!S){var Re;J==="down"&&ee!==0||J==="up"&&ee!==we-1?Re=null:Re=R[J==="down"?"dflags":"uflags"][-C]}var ze;if(T.pitches[ee].style)ze=R[T.pitches[ee].style][-C];else if(q.isPercussion&&this.percmap){ze=ce;var Oe=this.percmap[m(T.pitches[ee])];Oe&&Oe.noteHead&&R[Oe.noteHead]&&(ze=R[Oe.noteHead][-C])}else ze=ce;T.pitches[ee].highestVert=T.pitches[ee].verticalPos;var Z=(B==="up"||J==="up")&&ee===0,W=(B==="down"||J==="down")&&ee===we-1;if(Z||W){if((T.startSlur||we===1)&&(T.pitches[ee].highestVert=T.pitches[we-1].verticalPos,k(T)<1&&(B==="up"||J==="up")&&(T.pitches[ee].highestVert+=6)),T.startSlur)for(T.pitches[ee].startSlur||(T.pitches[ee].startSlur=[]),V=0;V<T.startSlur.length;V++)L(T.pitches[ee].startSlur,T.startSlur[V]);if(T.endSlur)for(T.pitches[ee].highestVert=T.pitches[we-1].verticalPos,k(T)<1&&(B==="up"||J==="up")&&(T.pitches[ee].highestVert+=6),T.pitches[ee].endSlur||(T.pitches[ee].endSlur=[]),V=0;V<T.endSlur.length;V++)L(T.pitches[ee].endSlur,T.endSlur[V])}var H=!S&&C<=-1,j=i(E,ze,T.pitches[ee],{dir:J,extrax:-F,flag:Re,dot:P,dotshiftx:D,scale:this.voiceScale,accidentalSlot:oe,shouldExtendStem:!B,printAccidentals:!q.isPercussion});le=Math.max(g.getSymbolWidth(ze),le),E.extraw-=j.extraLeft,$=j.notehead,$&&(this.addSlursAndTies(E,T.pitches[ee],$,q,H?J:null,!1),T.gracenotes&&T.gracenotes.length>0&&($.bottom=$.bottom-1),E.addHead($)),F+=j.accidentalshiftx,K=Math.max(K,j.dotshiftx)}if(H){var Q=Math.round(70*this.voiceScale)/10,re=J==="down"?T.minpitch-Q:T.minpitch+1/3;re>6&&!B&&(re=6);var ie=J==="down"?T.maxpitch-1/3:T.maxpitch+Q;ie<6&&!B&&(ie=6);var ge=J==="down"||E.heads.length===0?0:E.heads[0].w,ne=J==="down"?1:-1;$&&$.c==="noteheads.slash.quarter"&&(J==="down"?ie-=1:re+=1),$&&$.c==="noteheads.triangle.quarter"&&(J==="down"?ie-=.7:re-=1.2),E.addRight(new d(null,ge,0,re,{type:"stem",pitch2:ie,linewidth:ne,bottom:re-1})),te=Math.min(re,ie)}return{noteHead:$,roomTaken:F,roomTakenRight:K,min:te,additionalLedgers:ae,dir:J,symbolWidth:le}},I.prototype.addLyric=function(E,T){var P="";T.lyric.forEach(function(w){var C=w.divider===" "?"":w.divider;P+=w.syllable+C+`
|
|
114
|
-
`});var B=this.getTextSize.calc(P,"vocalfont","lyric"),O=T.positioning?T.positioning.vocalPosition:"below";E.addCentered(new d(P,0,B.width,void 0,{type:"lyric",position:O,height:B.height/p.STEP,dim:this.getTextSize.attr("vocalfont","lyric")}))},I.prototype.createNote=function(E,T,P,B){var O=null,w=0,C=0,S=0,q=[],D,$=k(E),F=!1;$===0&&(F=!0,$=.25,T=!0);for(var K=Math.floor(Math.log($)/Math.log(2)),te=0,V=Math.pow(2,K),ae=V/2;V<$;te++,V+=ae,ae/=2);E.startTriplet&&(this.tripletmultiplier=E.tripletMultiplier);var oe=$*this.tripletmultiplier;E.rest&&E.rest.type==="multimeasure"&&(oe=1),E.rest&&E.rest.type==="invisible-multimeasure"&&(oe=this.measureLength*E.rest.text);var le=E.rest?"rest":"note",J=new e(E,oe,1,le,this.tuneNumber,{durationClassOveride:E.duration*this.tripletmultiplier});if(x&&J.setHint(),E.rest){this.measureLength===$&&E.rest.type!=="invisible"&&E.rest.type!=="spacer"&&E.rest.type.indexOf("multimeasure")<0&&(E.rest.type="whole");var ce=z(J,E,$,te,B.voicetotal>1,this.stemdir,P,K,this.voiceScale);O=ce.noteHead,w=ce.roomTaken,C=ce.roomTakenRight}else{var ee=this.addNoteToAbcElement(J,E,te,this.stemdir,this.style,F,K,T,B);ee.min!==void 0&&(this.minY=Math.min(ee.min,this.minY)),O=ee.noteHead,w=ee.roomTaken,C=ee.roomTakenRight,q=ee.additionalLedgers,D=ee.dir,S=ee.symbolWidth}if(E.lyric!==void 0&&this.addLyric(J,E),E.gracenotes!==void 0&&(w+=this.addGraceNotes(E,B,J,O,this.stemHeight*this.voiceScale,this.isBagpipes,w)),E.decoration){var he=T&&D!=="up"?Math.min(-3,J.bottom-6):J.bottom;this.decoration.createDecoration(B,E.decoration,J.top,O?O.w:0,J,w,D,he,E.positioning,this.hasVocals,this.accentAbove)}if(E.barNumber&&J.addFixed(new d(E.barNumber,-10,0,0,{type:"barNumber"})),M(J,E.minpitch,E.maxpitch,E.rest,S,q,D,-2,1),E.chord!==void 0){var de=y(this.getTextSize,J,E,w,C,S,this.jazzchords,this.germanAlphabet);w=de.roomTaken,C=de.roomTakenRight}return E.startTriplet&&(this.triplet=new s(E.startTriplet,O,{flatBeams:this.flatBeams})),E.endTriplet&&this.triplet&&this.triplet.setCloseAnchor(O),this.triplet&&!E.startTriplet&&!E.endTriplet&&!(E.rest&&E.rest.type==="spacer")&&this.triplet.middleNote(O),J},I.prototype.addSlursAndTies=function(E,T,P,B,O,w){if(T.endTie&&this.ties.length>0){for(var C=!1,S=0;S<this.ties.length;S++)if(this.ties[S].anchor1&&this.ties[S].anchor1.pitch===P.pitch){this.ties[S].setEndAnchor(P),B.setRange(this.ties[S]),this.ties.splice(S,1),C=!0;break}C||(this.ties[0].setEndAnchor(P),B.setRange(this.ties[0]),this.ties.splice(0,1))}var q=B.voicetotal<2?-1:B.voicenumber;if(T.startTie){var D=new h({anchor1:P,force:this.stemdir==="down"||this.stemdir==="up",stemDir:this.stemdir,isGrace:w,voiceNumber:q,style:T.startTie.style});x&&D.setHint(),this.ties[this.ties.length]=D,B.addOther(D),E.startTie=!0}var $,F;if(T.endSlur)for(var K=0;K<T.endSlur.length;K++)F=T.endSlur[K],this.slurs[F]?($=this.slurs[F],$.setEndAnchor(P),B.setRange($),delete this.slurs[F]):($=new h({anchor2:P,stemDir:this.stemdir,voiceNumber:q}),x&&$.setHint(),B.addOther($)),this.startlimitelem&&$.setStartX(this.startlimitelem);else if(!w)for(var te in this.slurs)this.slurs.hasOwnProperty(te)&&this.slurs[te].addInternalNote(P);if(T.startSlur)for(K=0;K<T.startSlur.length;K++)F=T.startSlur[K].label,$=new h({anchor1:P,stemDir:this.stemdir,voiceNumber:q,style:T.startSlur[K].style}),x&&$.setHint(),this.slurs[F]=$,B.addOther($)},I.prototype.addMeasureNumber=function(E,T){var P=this.getTextSize.calc(E,"measurefont","bar-number"),B=0;T.isClef&&(B+=P.width/2);var O=P.width>10&&T.abcelem.type==="treble"?13.5:11;T.addFixed(new d(E,B,P.width,O+P.height/p.STEP,{type:"barNumber",dim:this.getTextSize.attr("measurefont","bar-number")}))},I.prototype.createBarLine=function(E,T,P){var B=new e(T,0,10,"bar",this.tuneNumber),O=null,w=0;T.barNumber&&this.addMeasureNumber(T.barNumber,B);var C=T.type==="bar_right_repeat"||T.type==="bar_dbl_repeat",S=T.type!=="bar_left_repeat"&&T.type!=="bar_thick_thin"&&T.type!=="bar_invisible",q=T.type==="bar_right_repeat"||T.type==="bar_dbl_repeat"||T.type==="bar_left_repeat"||T.type==="bar_thin_thick"||T.type==="bar_thick_thin",D=T.type==="bar_left_repeat"||T.type==="bar_thick_thin"||T.type==="bar_thin_thin"||T.type==="bar_dbl_repeat",$=T.type==="bar_left_repeat"||T.type==="bar_dbl_repeat";if(C||$){for(var F in this.slurs)this.slurs.hasOwnProperty(F)&&this.slurs[F].setEndX(B);this.startlimitelem=B}if(C&&(B.addRight(new d("dots.dot",w,1,7)),B.addRight(new d("dots.dot",w,1,5)),w+=6),S&&(O=new d(null,w,1,2,{type:"bar",pitch2:10,linewidth:.6}),B.addRight(O)),T.type==="bar_invisible"&&(O=new d(null,w,1,2,{type:"none",pitch2:10,linewidth:.6}),B.addRight(O)),T.decoration&&this.decoration.createDecoration(E,T.decoration,12,q?3:1,B,0,"down",2,T.positioning,this.hasVocals,this.accentAbove),q&&(w+=4,O=new d(null,w,4,2,{type:"bar",pitch2:10,linewidth:4}),B.addRight(O),w+=5),this.partstartelem&&T.endEnding&&(this.partstartelem.anchor2=O,this.partstartelem=null),D&&(w+=3,O=new d(null,w,1,2,{type:"bar",pitch2:10,linewidth:.6}),B.addRight(O)),$&&(w+=3,B.addRight(new d("dots.dot",w,1,7)),B.addRight(new d("dots.dot",w,1,5))),T.startEnding&&P&&E.voicenumber===0){var K=this.getTextSize.calc(T.startEnding,"repeatfont","").width;B.minspacing+=K+10,this.partstartelem=new f(T.startEnding,O,null),E.addOther(this.partstartelem)}return B.extraw-=5,T.chord!==void 0&&y(this.getTextSize,B,T,0,0,0,!1,this.germanAlphabet),B},
|
|
115
|
-
`),h=0;h<o.length;h++)if(!(l&&o[h]=="")){var s=document.createElementNS(e,"tspan");if(g)for(var v in g)g.hasOwnProperty(v)&&s.setAttribute(v,g[v]);if(s.setAttribute("x",u.x?u.x:0),h!==0&&s.setAttribute("dy","1.2em"),o[h].indexOf("")!==-1){var y=o[h].split("");if(s.textContent=y[0],y[1]){var m=document.createElementNS(e,"tspan");m.setAttribute("dy","-0.3em"),m.setAttribute("style","font-size:0.7em"),m.textContent=y[1],s.appendChild(m)}if(y[2]){var _=y[1]?"0.4em":"0.1em",k=document.createElementNS(e,"tspan");k.setAttribute("dy",_),k.setAttribute("style","font-size:0.7em"),k.textContent=y[2],s.appendChild(k)}}else l&&o[h].trim()==""?s.innerHTML=" ":s.textContent=o[h];d.appendChild(s)}return f?f.appendChild(d):this.append(d),d},t.prototype.richTextLine=function(c,u,f,g,d,p){var l=document.createElementNS(e,"text");l.setAttribute("stroke","none"),l.setAttribute("class",g),l.setAttribute("x",u),l.setAttribute("y",f),l.setAttribute("text-anchor",d),l.setAttribute("dominant-baseline","middle");for(var o=0;o<c.length;o++){for(var h=c[o],s=document.createElementNS(e,"tspan"),v=Object.keys(h.attrs),y=0;y<v.length;y++){var m=h.attrs[v[y]];m!==""&&s.setAttribute(v[y],m)}s.textContent=h.content,l.appendChild(s)}return p?p.appendChild(l):this.append(l),l},t.prototype.guessWidth=function(c,u){var f=this.createDummySvg(),g=this.text(c,u,f),d;try{d=g.getBBox(),isNaN(d.height)||!d.height?d={width:u["font-size"]/2,height:u["font-size"]+2}:d={width:d.width,height:d.height}}catch{d={width:u["font-size"]/2,height:u["font-size"]+2}}return f.removeChild(g),d},t.prototype.createDummySvg=function(){if(!this.dummySvg){this.dummySvg=i();var c=["display: block !important;","height: 1px;","width: 1px;","position: absolute;"];this.dummySvg.setAttribute("style",c.join(""));var u=document.querySelector("body");u.appendChild(this.dummySvg)}return this.dummySvg};var r={};t.prototype.getTextSize=function(c,u,f){if(typeof c=="number"&&(c=""+c),!c||c.match(/^\s+$/))return{width:0,height:0};var g;if(c.length<20&&(g=c+JSON.stringify(u),r[g]))return r[g];var d=!f;f||(f=this.text(c,u));var p;try{p=f.getBBox(),isNaN(p.height)||!p.height?p=this.guessWidth(c,u):p={width:p.width,height:p.height}}catch{p=this.guessWidth(c,u)}return d&&(this.currentGroup.length>0?this.currentGroup[0].removeChild(f):this.svg.removeChild(f)),g&&(r[g]=p),p},t.prototype.openGroup=function(c){c=c||{};var u=document.createElementNS(e,"g");return c.klass&&u.setAttribute("class",c.klass),c.fill&&u.setAttribute("fill",c.fill),c.stroke&&u.setAttribute("stroke",c.stroke),c["data-name"]&&u.setAttribute("data-name",c["data-name"]),c.prepend?this.prepend(u):this.append(u),this.currentGroup.unshift(u),u},t.prototype.closeGroup=function(){var c=this.currentGroup.shift();return c&&c.children.length===0?(c.parentElement.removeChild(c),null):c},t.prototype.path=function(c){var u=document.createElementNS(e,"path");for(var f in c)c.hasOwnProperty(f)&&(f==="path"?u.setAttributeNS(null,"d",c.path):f==="klass"?u.setAttributeNS(null,"class",c[f]):c[f]!==void 0&&u.setAttributeNS(null,f,c[f]));return this.append(u),u},t.prototype.pathToBack=function(c){var u=document.createElementNS(e,"path");for(var f in c)c.hasOwnProperty(f)&&(f==="path"?u.setAttributeNS(null,"d",c.path):f==="klass"?u.setAttributeNS(null,"class",c[f]):u.setAttributeNS(null,f,c[f]));return this.prepend(u),u},t.prototype.lineToBack=function(c){for(var u=document.createElementNS(e,"line"),f=Object.keys(c),g=0;g<f.length;g++)u.setAttribute(f[g],c[f[g]]);return this.prepend(u),u},t.prototype.append=function(c){this.currentGroup.length>0?this.currentGroup[0].appendChild(c):this.svg.appendChild(c)},t.prototype.prepend=function(c){this.currentGroup.length>0?this.currentGroup[0].appendChild(c):this.svg.insertBefore(c,this.svg.firstChild)},t.prototype.setAttributeOnElement=function(c,u){for(var f in u)u.hasOwnProperty(f)&&c.setAttributeNS(null,f,u[f])},t.prototype.moveElementToChild=function(c,u){c.appendChild(u)};function i(){var c=document.createElementNS(e,"svg");return c.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),c.setAttribute("role","img"),c.setAttribute("fill","currentColor"),c.setAttribute("stroke","currentColor"),c}return
|
|
116
|
-
`)};var v=y;this.rows.push({move:g.attr["font-size"]/2}),this.rows.push({left:r,text:u,font:"textfont",klass:"defined-text",anchor:"start",startChar:t.startChar,endChar:t.endChar,absElemType:"freeText",name:"free-text"});var d=y(u);f=c.calc(d,"textfont","defined-text"),this.rows.push({move:f.height})}else if(u){for(var p=0,l=r,o="textfont",h=0;h<u.length;h++)u[h].font?o=u[h].font:o="textfont",this.rows.push({left:l,text:u[h].text,font:o,klass:"defined-text",anchor:"start",startChar:t.startChar,endChar:t.endChar,absElemType:"freeText",name:"free-text"}),f=c.calc(u[h].text,n.calc(o,"defined-text").font,"defined-text"),l+=f.width+f.height/2,p=Math.max(p,f.height);this.rows.push({move:p})}else if(t.length===1){var s=i/2;this.rows.push({left:s,text:t[0].text,font:"textfont",klass:"defined-text",anchor:"middle",startChar:t.startChar,endChar:t.endChar,absElemType:"freeText",name:"free-text"}),f=c.calc(t[0].text,"textfont","defined-text"),this.rows.push({move:f.height})}}return
|
|
111
|
+
`)}return Sn=t,Sn}var Tn,Rs;function Fg(){if(Rs)return Tn;Rs=1;var e=at(),t=Ve();const a=Dg();var n=function(i,c,u,f,g,d,p,l){for(var o=0;o<u.chord.length;o++){var h=u.chord[o].position,s=u.chord[o].rel_position,v=h==="left"||h==="right"||h==="below"||h==="above"||!!s,y,m;v?(y="annotationfont",m="abcjs-annotation"):(y="gchordfont",m="abcjs-chord");var _=i.attr(y,m),k=u.chord[o].name,x;if(typeof k=="string")x=r(k,h,s,v,y,m,_,i,c,u,f,g,d,p,l),f=x.roomTaken,g=x.roomTakenRight;else for(var R=0;R<k.length;R++)x=r(k[R].text,h,s,v,y,m,_,i,c,u,f,g,d,p,l),f=x.roomTaken,g=x.roomTakenRight}return{roomTaken:f,roomTakenRight:g}};function r(i,c,u,f,g,d,p,l,o,h,s,v,y,m,_){for(var k=i.split(`
|
|
112
|
+
`),x=k.length-1;x>=0;x--){var R=k[x],I=0,b;f||(R=a(R,m,_));var A=l.calc(R,g,d),N=A.width,M=A.height/t.STEP;switch(c){case"left":s+=N+7,I=-s,b=h.averagepitch,o.addExtra(new e(R,I,N+4,b,{type:"text",height:M,dim:p,position:"left"}));break;case"right":v+=4,I=v,b=h.averagepitch,o.addRight(new e(R,I,N+4,b,{type:"text",height:M,dim:p,position:"right"}));break;case"below":o.addRight(new e(R,0,0,void 0,{type:"text",position:"below",height:M,dim:p,realWidth:N}));break;case"above":o.addRight(new e(R,0,0,void 0,{type:"text",position:"above",height:M,dim:p,realWidth:N}));break;default:if(u){var z=u.y+3*t.STEP;o.addRight(new e(R,I+u.x,0,h.minpitch+z/t.STEP,{position:"relative",type:"text",height:M,dim:p}))}else{var L="above";h.positioning&&h.positioning.chordPosition&&(L=h.positioning.chordPosition),L!=="hidden"&&o.addCentered(new e(R,y/2,N,void 0,{type:"chord",position:L,height:M,dim:p,realWidth:N}))}}}return{roomTaken:s,roomTakenRight:v}}return Tn=n,Tn}var En,qs;function Hg(){if(qs)return En;qs=1;var e=Pt(),t=Cg(),a=Sg(),n=Tg(),r=Eg(),i=Ag(),c=Mg(),u=Ig(),f=Rg(),g=pt(),d=at(),p=Ve(),l=Bg(),o=Lg(),h=Rl(),s=Og(),v=Al(),y=Fg(),m=Sl(),_=nt(),k=function(E){var T=0;return E.duration&&(T=E.duration),T},x=!1,R={rest:{0:"rests.whole",1:"rests.half",2:"rests.quarter",3:"rests.8th",4:"rests.16th",5:"rests.32nd",6:"rests.64th",7:"rests.128th",multi:"rests.multimeasure"},note:{"-1":"noteheads.dbl",0:"noteheads.whole",1:"noteheads.half",2:"noteheads.quarter",3:"noteheads.quarter",4:"noteheads.quarter",5:"noteheads.quarter",6:"noteheads.quarter",7:"noteheads.quarter",nostem:"noteheads.quarter"},rhythm:{"-1":"noteheads.slash.whole",0:"noteheads.slash.whole",1:"noteheads.slash.whole",2:"noteheads.slash.quarter",3:"noteheads.slash.quarter",4:"noteheads.slash.quarter",5:"noteheads.slash.quarter",6:"noteheads.slash.quarter",7:"noteheads.slash.quarter",nostem:"noteheads.slash.nostem"},x:{"-1":"noteheads.indeterminate",0:"noteheads.indeterminate",1:"noteheads.indeterminate",2:"noteheads.indeterminate",3:"noteheads.indeterminate",4:"noteheads.indeterminate",5:"noteheads.indeterminate",6:"noteheads.indeterminate",7:"noteheads.indeterminate",nostem:"noteheads.indeterminate"},harmonic:{"-1":"noteheads.harmonic.quarter",0:"noteheads.harmonic.quarter",1:"noteheads.harmonic.quarter",2:"noteheads.harmonic.quarter",3:"noteheads.harmonic.quarter",4:"noteheads.harmonic.quarter",5:"noteheads.harmonic.quarter",6:"noteheads.harmonic.quarter",7:"noteheads.harmonic.quarter",nostem:"noteheads.harmonic.quarter"},triangle:{"-1":"noteheads.triangle.quarter",0:"noteheads.triangle.quarter",1:"noteheads.triangle.quarter",2:"noteheads.triangle.quarter",3:"noteheads.triangle.quarter",4:"noteheads.triangle.quarter",5:"noteheads.triangle.quarter",6:"noteheads.triangle.quarter",7:"noteheads.triangle.quarter",nostem:"noteheads.triangle.quarter"},uflags:{3:"flags.u8th",4:"flags.u16th",5:"flags.u32nd",6:"flags.u64th"},dflags:{3:"flags.d8th",4:"flags.d16th",5:"flags.d32nd",6:"flags.d64th"}},I=function(E,T,P){this.decoration=new u,this.getTextSize=E,this.tuneNumber=T,this.isBagpipes=P.bagpipes,this.flatBeams=P.flatbeams,this.graceSlurs=P.graceSlurs,this.percmap=P.percmap,this.initialClef=P.initialClef,this.jazzchords=!!P.jazzchords,this.accentAbove=!!P.accentAbove,this.germanAlphabet=!!P.germanAlphabet,this.reset()};I.prototype.reset=function(){this.slurs={},this.ties=[],this.voiceScale=1,this.voiceColor=void 0,this.slursbyvoice={},this.tiesbyvoice={},this.endingsbyvoice={},this.scaleByVoice={},this.colorByVoice={},this.tripletmultiplier=1,this.abcline=void 0,this.accidentalSlot=void 0,this.accidentalshiftx=void 0,this.dotshiftx=void 0,this.hasVocals=!1,this.minY=void 0,this.partstartelem=void 0,this.startlimitelem=void 0,this.stemdir=void 0},I.prototype.setStemHeight=function(E){this.stemHeight=Math.round(E*10/p.STEP)/10},I.prototype.getCurrentVoiceId=function(E,T){return"s"+E+"v"+T},I.prototype.pushCrossLineElems=function(E,T){this.slursbyvoice[this.getCurrentVoiceId(E,T)]=this.slurs,this.tiesbyvoice[this.getCurrentVoiceId(E,T)]=this.ties,this.endingsbyvoice[this.getCurrentVoiceId(E,T)]=this.partstartelem,this.scaleByVoice[this.getCurrentVoiceId(E,T)]=this.voiceScale,this.voiceColor&&(this.colorByVoice[this.getCurrentVoiceId(E,T)]=this.voiceColor)},I.prototype.popCrossLineElems=function(E,T){this.slurs=this.slursbyvoice[this.getCurrentVoiceId(E,T)]||{},this.ties=this.tiesbyvoice[this.getCurrentVoiceId(E,T)]||[],this.partstartelem=this.endingsbyvoice[this.getCurrentVoiceId(E,T)],this.voiceScale=this.scaleByVoice[this.getCurrentVoiceId(E,T)],this.voiceScale===void 0&&(this.voiceScale=1),this.voiceColor=this.colorByVoice[this.getCurrentVoiceId(E,T)]},I.prototype.containsLyrics=function(E){for(var T=0;T<E.length;T++)for(var P=0;P<E[T].voices.length;P++)for(var B=0;B<E[T].voices[P].length;B++){var O=E[T].voices[P][B];if(O.lyric){(!O.positioning||O.positioning.vocalPosition==="below")&&(this.hasVocals=!0);return}}},I.prototype.createABCLine=function(E,T,P){this.minY=2,this.containsLyrics(E);var B=new l(this.getTextSize);this.tempoSet=!1;for(var O=0;O<E.length;O++)x&&this.restoreState(),x=!1,this.createABCStaff(B,E[O],T,O,P);return B},I.prototype.createABCStaff=function(E,T,P,B,O){E.getTextSize.updateFonts(T);for(var w=0;w<T.voices.length;w++){var C=new v(w,T.voices.length);w===0?(C.barfrom=T.connectBarLines==="start"||T.connectBarLines==="continue",C.barto=T.connectBarLines==="continue"||T.connectBarLines==="end"):C.duplicate=!0,T.title&&T.title[w]&&(C.header=T.title[w].replace(/\\n/g,`
|
|
113
|
+
`),C.headerPosition=6+E.getTextSize.baselineToCenter(C.header,"voicefont","staff-extra voice-name",w,T.voices.length)/p.STEP),T.clef&&T.clef.type==="perc"&&(C.isPercussion=!0);var S=(!this.initialClef||O===0)&&n(T.clef,this.tuneNumber);S&&(w===0&&T.barNumber&&this.addMeasureNumber(T.barNumber,S),C.addChild(S),this.startlimitelem=S);var q=r(T.key,this.tuneNumber);if(q&&(C.addChild(q),this.startlimitelem=q),T.meter){T.meter.type==="specified"?this.measureLength=T.meter.value[0].num/T.meter.value[0].den:this.measureLength=1;var D=c(T.meter,this.tuneNumber);C.addChild(D),this.startlimitelem=D}C.duplicate&&(C.children=[]);var $=T.clef.stafflines||T.clef.stafflines===0?T.clef.stafflines:5;E.addVoice(C,B,$);var F=$===1;this.createABCVoice(T.voices[w],P,B,w,F,C),E.setStaffLimits(C),w===0&&(T.brace==="start"||!E.brace&&T.brace?(E.brace||(E.brace=[]),E.brace.push(new a(C,"brace"))):T.brace==="end"&&E.brace?E.brace[E.brace.length-1].setBottomStaff(C):T.brace==="continue"&&E.brace&&E.brace[E.brace.length-1].continuing(C),T.bracket==="start"||!E.bracket&&T.bracket?(E.bracket||(E.bracket=[]),E.bracket.push(new a(C,"bracket"))):T.bracket==="end"&&E.bracket?E.bracket[E.bracket.length-1].setBottomStaff(C):T.bracket==="continue"&&E.bracket&&E.bracket[E.bracket.length-1].continuing(C))}};function b(E,T){var P=E[T];if(P.el_type!=="note"||!P.startBeam||P.endBeam)return{count:1,elem:P};for(var B=[];T<E.length&&E[T].el_type==="note"&&(B.push(E[T]),!E[T].endBeam);)T++;return{count:B.length,elem:B}}I.prototype.createABCVoice=function(E,T,P,B,O,w){this.popCrossLineElems(P,B),this.stemdir=this.isBagpipes?"down":null,this.abcline=E,this.partstartelem&&(this.partstartelem=new f("",null,null),w.addOther(this.partstartelem));var C=w.voicetotal<2?-1:w.voicenumber;for(var S in this.slurs)this.slurs.hasOwnProperty(S)&&(this.slurs[S]=new h({force:this.slurs[S].force,voiceNumber:C,stemDir:this.slurs[S].stemDir,style:this.slurs[S].dotted}),x&&this.slurs[S].setHint(),w.addOther(this.slurs[S]));for(var q=0;q<this.ties.length;q++)this.ties[q]=new h({force:this.ties[q].force,stemDir:this.ties[q].stemDir,voiceNumber:C,style:this.ties[q].dotted}),x&&this.ties[q].setHint(),w.addOther(this.ties[q]);for(var D=0;D<this.abcline.length;D++)A(this.abcline[D]),this.minY=Math.min(this.abcline[D].minpitch,this.minY);for(var $=P===0,F=0;F<this.abcline.length;){var K=b(this.abcline,F),te=this.createABCElement($,O,w,K.elem);if(te)for(q=0;q<te.length;q++){if(!this.tempoSet&&T&&!T.suppress){this.tempoSet=!0;var V=new e(T,0,0,"tempo",this.tuneNumber,{});V.addFixedX(new o(T,this.tuneNumber,i)),w.addChild(V)}w.addChild(te[q])}F+=K.count}this.pushCrossLineElems(P,B)},I.prototype.saveState=function(){this.tiesSave=_.cloneArray(this.ties),this.slursSave=_.cloneHashOfHash(this.slurs),this.slursbyvoiceSave=_.cloneHashOfHash(this.slursbyvoice),this.tiesbyvoiceSave=_.cloneHashOfArrayOfHash(this.tiesbyvoice)},I.prototype.restoreState=function(){this.ties=_.cloneArray(this.tiesSave),this.slurs=_.cloneHashOfHash(this.slursSave),this.slursbyvoice=_.cloneHashOfHash(this.slursbyvoiceSave),this.tiesbyvoice=_.cloneHashOfArrayOfHash(this.tiesbyvoiceSave)},I.prototype.createABCElement=function(E,T,P,B){var O=[];switch(B.el_type){case void 0:O=this.createBeam(T,P,B);break;case"note":O[0]=this.createNote(B,!1,T,P),this.triplet&&this.triplet.isClosed()&&(P.addOther(this.triplet),this.triplet=null,this.tripletmultiplier=1);break;case"bar":O[0]=this.createBarLine(P,B,E),P.duplicate&&O.length>0&&(O[0].invisible=!0);break;case"meter":O[0]=c(B,this.tuneNumber),this.startlimitelem=O[0],P.duplicate&&O.length>0&&(O[0].invisible=!0);break;case"clef":if(O[0]=n(B,this.tuneNumber),!O[0])return null;P.duplicate&&O.length>0&&(O[0].invisible=!0);break;case"key":var w=r(B,this.tuneNumber);w&&(O[0]=w,this.startlimitelem=O[0]),P.duplicate&&O.length>0&&(O[0].invisible=!0);break;case"stem":this.stemdir=B.direction==="auto"?void 0:B.direction;break;case"part":var C=new e(B,0,0,"part",this.tuneNumber),S=this.getTextSize.calc(B.title,"partsfont","part");C.addFixedX(new d(B.title,0,0,void 0,{type:"part",height:S.height/p.STEP})),O[0]=C;break;case"tempo":var q=new e(B,0,0,"tempo",this.tuneNumber);B.suppress||q.addFixedX(new o(B,this.tuneNumber,i)),O[0]=q;break;case"style":B.head==="normal"?delete this.style:this.style=B.head;break;case"hint":x=!0,this.saveState();break;case"midi":break;case"scale":this.voiceScale=B.size;break;case"color":this.voiceColor=B.color,P.color=this.voiceColor;break;default:var D=new e(B,0,0,"unsupported",this.tuneNumber);D.addFixed(new d("element type "+B.el_type,0,0,void 0,{type:"debug"})),O[0]=D}return O};function A(E){if(E.pitches){N(E);for(var T=0,P=0;P<E.pitches.length;P++)T+=E.pitches[P].verticalPos;E.averagepitch=T/E.pitches.length,E.minpitch=E.pitches[0].verticalPos,E.maxpitch=E.pitches[E.pitches.length-1].verticalPos}}I.prototype.createBeam=function(E,T,P){var B=[],O=new t(this.stemHeight*this.voiceScale,this.stemdir,this.flatBeams,P[0]);x&&O.setHint();for(var w=0;w<P.length;w++)O.runningDirection(P[w]);O.setStemDirection();var C=this.stemdir;for(this.stemdir=O.stemsUp?"up":"down",w=0;w<P.length;w++){var S=P[w],q=this.createNote(S,!0,E,T);B.push(q),O.add(q),this.triplet&&this.triplet.isClosed()&&(T.addOther(this.triplet),this.triplet=null,this.tripletmultiplier=1)}return O.calcDir(),T.addBeam(O),this.stemdir=C,B};var N=function(E){var T;do{T=!0;for(var P=0;P<E.pitches.length-1;P++)if(E.pitches[P].pitch>E.pitches[P+1].pitch){T=!1;var B=E.pitches[P];E.pitches[P]=E.pitches[P+1],E.pitches[P+1]=B}}while(!T)},M=function(E,T,P,B,O,w,C,S,q){for(var D=P;D>11;D--)D%2===0&&!B&&E.addFixed(new d(null,S,(O+4)*q,D,{type:"ledger"}));for(D=T;D<1;D++)D%2===0&&!B&&E.addFixed(new d(null,S,(O+4)*q,D,{type:"ledger"}));for(D=0;D<w.length;D++){var $=O;C==="down"&&($=-$),E.addFixed(new d(null,$+S,(O+4)*q,w[D],{type:"ledger"}))}};I.prototype.addGraceNotes=function(E,T,P,B,O,w,C){var S=.6,q=3.5/5;O=Math.round(O*q);var D=null,$;E.gracenotes.length>1&&(D=new t(O,"grace",w),x&&D.setHint(),D.mainNote=P);var F,K=[];for(F=E.gracenotes.length-1;F>=0;F--)C+=10,K[F]=C,E.gracenotes[F].accidental&&(C+=7);for(F=0;F<E.gracenotes.length;F++){var te=E.gracenotes[F].verticalPos;$=D?null:R.uflags[w?5:3];var V=[],ae=i(P,"noteheads.quarter",E.gracenotes[F],{dir:"up",headx:-K[F],extrax:-K[F],flag:$,scale:S*this.voiceScale,accidentalSlot:V});ae.notehead.highestVert=ae.notehead.pitch+O;var oe=ae.notehead;if(this.addSlursAndTies(P,E.gracenotes[F],oe,T,"up",!0),P.addExtra(oe),E.gracenotes[F].acciaccatura){var le=E.gracenotes[F].verticalPos+7*S,J=D?5:6;P.addRight(new d("flags.ugrace",-K[F]+J,0,le,{scalex:S,scaley:S}))}if(D){var ce=E.gracenotes[F].duration/2;w&&(ce/=2);var ee={heads:[oe],abcelem:{averagepitch:te,minpitch:te,maxpitch:te,duration:ce}};D.add(ee)}else{var he=te+.3333333333333333*S,de=te+7*S,Se=oe.dx+oe.w,we=-.6;P.addExtra(new d(null,Se,0,he,{type:"stem",pitch2:de,linewidth:we}))}M(P,te,te,!1,g.getSymbolWidth("noteheads.quarter"),[],!0,oe.dx-1,.6);var Re=E.rest&&(E.rest.type==="spacer"||E.rest.type==="invisible");F===0&&!w&&this.graceSlurs&&!Re&&T.addOther(new h({anchor1:oe,anchor2:B,isGrace:!0}))}return D&&(D.calcDir(),T.addBeam(D)),C};function z(E,T,P,B,O,w,C,S,q){var D,$=7,F,K,te;switch(O&&(w==="down"&&($=3),w==="up"&&($=11)),C&&(P<.5||P<1?$=7:$=5),T.rest.type){case"whole":D=R.rest[0],T.averagepitch=$,T.minpitch=$,T.maxpitch=$,B=0;break;case"rest":T.style==="rhythm"?D=R.rhythm[-S]:D=R.rest[-S],T.averagepitch=$,T.minpitch=$,T.maxpitch=$;break;case"invisible":case"invisible-multimeasure":case"spacer":D="",T.averagepitch=$,T.minpitch=$,T.maxpitch=$;break;case"multimeasure":D=R.rest.multi,T.averagepitch=$,T.minpitch=$,T.maxpitch=$,B=0;var V=g.getSymbolWidth(D);E.addHead(new d(D,V,V*2,7));var ae=new d(""+T.rest.text,V,V,16,{type:"multimeasure-text"});E.addExtra(ae)}if(T.rest.type.indexOf("multimeasure")<0&&T.rest.type!=="invisible"){var oe=i(E,D,{verticalPos:$},{dot:B,scale:q});F=oe.notehead,F&&(E.addHead(F),K=oe.accidentalshiftx,te=oe.dotshiftx)}return{noteHead:F,roomTaken:K,roomTakenRight:te}}function L(E,T){for(var P=0;P<E.length;P++)if(JSON.stringify(E[P])===JSON.stringify(T))return;E.push(T)}return I.prototype.addNoteToAbcElement=function(E,T,P,B,O,w,C,S,q){var D=0,$,F=0,K=0,te,V,ae=[],oe=[],le=0,J=T.averagepitch>=6?"down":"up";B&&(J=B),O=T.style?T.style:O,(!O||O==="normal")&&(O="note");var ce;w?ce=R[O].nostem:ce=R[O][-C],ce||console.log("noteSymbol:",O,C,w);var ee;for(ee=J==="down"?T.pitches.length-2:1;J==="down"?ee>=0:ee<T.pitches.length;ee=J==="down"?ee-1:ee+1){var he=T.pitches[J==="down"?ee+1:ee-1],de=T.pitches[ee],Se=J==="down"?he.pitch-de.pitch:de.pitch-he.pitch;Se<=1&&!he.printer_shift&&(de.printer_shift=Se?"different":"same",(de.verticalPos>11||de.verticalPos<1)&&ae.push(de.verticalPos-de.verticalPos%2),J==="down"?F=g.getSymbolWidth(ce)+2:D=g.getSymbolWidth(ce)+2)}var we=T.pitches.length;for(ee=0;ee<T.pitches.length;ee++){if(!S){var Re;J==="down"&&ee!==0||J==="up"&&ee!==we-1?Re=null:Re=R[J==="down"?"dflags":"uflags"][-C]}var ze;if(T.pitches[ee].style)ze=R[T.pitches[ee].style][-C];else if(q.isPercussion&&this.percmap){ze=ce;var Oe=this.percmap[m(T.pitches[ee])];Oe&&Oe.noteHead&&R[Oe.noteHead]&&(ze=R[Oe.noteHead][-C])}else ze=ce;T.pitches[ee].highestVert=T.pitches[ee].verticalPos;var Z=(B==="up"||J==="up")&&ee===0,W=(B==="down"||J==="down")&&ee===we-1;if(Z||W){if((T.startSlur||we===1)&&(T.pitches[ee].highestVert=T.pitches[we-1].verticalPos,k(T)<1&&(B==="up"||J==="up")&&(T.pitches[ee].highestVert+=6)),T.startSlur)for(T.pitches[ee].startSlur||(T.pitches[ee].startSlur=[]),V=0;V<T.startSlur.length;V++)L(T.pitches[ee].startSlur,T.startSlur[V]);if(T.endSlur)for(T.pitches[ee].highestVert=T.pitches[we-1].verticalPos,k(T)<1&&(B==="up"||J==="up")&&(T.pitches[ee].highestVert+=6),T.pitches[ee].endSlur||(T.pitches[ee].endSlur=[]),V=0;V<T.endSlur.length;V++)L(T.pitches[ee].endSlur,T.endSlur[V])}var H=!S&&C<=-1,Y=i(E,ze,T.pitches[ee],{dir:J,extrax:-F,flag:Re,dot:P,dotshiftx:D,scale:this.voiceScale,accidentalSlot:oe,shouldExtendStem:!B,printAccidentals:!q.isPercussion});le=Math.max(g.getSymbolWidth(ze),le),E.extraw-=Y.extraLeft,$=Y.notehead,$&&(this.addSlursAndTies(E,T.pitches[ee],$,q,H?J:null,!1),T.gracenotes&&T.gracenotes.length>0&&($.bottom=$.bottom-1),E.addHead($)),F+=Y.accidentalshiftx,K=Math.max(K,Y.dotshiftx)}if(H){var Q=Math.round(70*this.voiceScale)/10,re=J==="down"?T.minpitch-Q:T.minpitch+1/3;re>6&&!B&&(re=6);var ie=J==="down"?T.maxpitch-1/3:T.maxpitch+Q;ie<6&&!B&&(ie=6);var ge=J==="down"||E.heads.length===0?0:E.heads[0].w,ne=J==="down"?1:-1;$&&$.c==="noteheads.slash.quarter"&&(J==="down"?ie-=1:re+=1),$&&$.c==="noteheads.triangle.quarter"&&(J==="down"?ie-=.7:re-=1.2),E.addRight(new d(null,ge,0,re,{type:"stem",pitch2:ie,linewidth:ne,bottom:re-1})),te=Math.min(re,ie)}return{noteHead:$,roomTaken:F,roomTakenRight:K,min:te,additionalLedgers:ae,dir:J,symbolWidth:le}},I.prototype.addLyric=function(E,T){var P="";T.lyric.forEach(function(w){var C=w.divider===" "?"":w.divider;P+=w.syllable+C+`
|
|
114
|
+
`});var B=this.getTextSize.calc(P,"vocalfont","lyric"),O=T.positioning?T.positioning.vocalPosition:"below";E.addCentered(new d(P,0,B.width,void 0,{type:"lyric",position:O,height:B.height/p.STEP,dim:this.getTextSize.attr("vocalfont","lyric")}))},I.prototype.createNote=function(E,T,P,B){var O=null,w=0,C=0,S=0,q=[],D,$=k(E),F=!1;$===0&&(F=!0,$=.25,T=!0);for(var K=Math.floor(Math.log($)/Math.log(2)),te=0,V=Math.pow(2,K),ae=V/2;V<$;te++,V+=ae,ae/=2);E.startTriplet&&(this.tripletmultiplier=E.tripletMultiplier);var oe=$*this.tripletmultiplier;E.rest&&E.rest.type==="multimeasure"&&(oe=1),E.rest&&E.rest.type==="invisible-multimeasure"&&(oe=this.measureLength*E.rest.text);var le=E.rest?"rest":"note",J=new e(E,oe,1,le,this.tuneNumber,{durationClassOveride:E.duration*this.tripletmultiplier});if(x&&J.setHint(),E.rest){this.measureLength===$&&E.rest.type!=="invisible"&&E.rest.type!=="spacer"&&E.rest.type.indexOf("multimeasure")<0&&(E.rest.type="whole");var ce=z(J,E,$,te,B.voicetotal>1,this.stemdir,P,K,this.voiceScale);O=ce.noteHead,w=ce.roomTaken,C=ce.roomTakenRight}else{var ee=this.addNoteToAbcElement(J,E,te,this.stemdir,this.style,F,K,T,B);ee.min!==void 0&&(this.minY=Math.min(ee.min,this.minY)),O=ee.noteHead,w=ee.roomTaken,C=ee.roomTakenRight,q=ee.additionalLedgers,D=ee.dir,S=ee.symbolWidth}if(E.lyric!==void 0&&this.addLyric(J,E),E.gracenotes!==void 0&&(w+=this.addGraceNotes(E,B,J,O,this.stemHeight*this.voiceScale,this.isBagpipes,w)),E.decoration){var he=T&&D!=="up"?Math.min(-3,J.bottom-6):J.bottom;this.decoration.createDecoration(B,E.decoration,J.top,O?O.w:0,J,w,D,he,E.positioning,this.hasVocals,this.accentAbove)}if(E.barNumber&&J.addFixed(new d(E.barNumber,-10,0,0,{type:"barNumber"})),M(J,E.minpitch,E.maxpitch,E.rest,S,q,D,-2,1),E.chord!==void 0){var de=y(this.getTextSize,J,E,w,C,S,this.jazzchords,this.germanAlphabet);w=de.roomTaken,C=de.roomTakenRight}return E.startTriplet&&(this.triplet=new s(E.startTriplet,O,{flatBeams:this.flatBeams})),E.endTriplet&&this.triplet&&this.triplet.setCloseAnchor(O),this.triplet&&!E.startTriplet&&!E.endTriplet&&!(E.rest&&E.rest.type==="spacer")&&this.triplet.middleNote(O),J},I.prototype.addSlursAndTies=function(E,T,P,B,O,w){if(T.endTie&&this.ties.length>0){for(var C=!1,S=0;S<this.ties.length;S++)if(this.ties[S].anchor1&&this.ties[S].anchor1.pitch===P.pitch){this.ties[S].setEndAnchor(P),B.setRange(this.ties[S]),this.ties.splice(S,1),C=!0;break}C||(this.ties[0].setEndAnchor(P),B.setRange(this.ties[0]),this.ties.splice(0,1))}var q=B.voicetotal<2?-1:B.voicenumber;if(T.startTie){var D=new h({anchor1:P,force:this.stemdir==="down"||this.stemdir==="up",stemDir:this.stemdir,isGrace:w,voiceNumber:q,style:T.startTie.style});x&&D.setHint(),this.ties[this.ties.length]=D,B.addOther(D),E.startTie=!0}var $,F;if(T.endSlur)for(var K=0;K<T.endSlur.length;K++)F=T.endSlur[K],this.slurs[F]?($=this.slurs[F],$.setEndAnchor(P),B.setRange($),delete this.slurs[F]):($=new h({anchor2:P,stemDir:this.stemdir,voiceNumber:q}),x&&$.setHint(),B.addOther($)),this.startlimitelem&&$.setStartX(this.startlimitelem);else if(!w)for(var te in this.slurs)this.slurs.hasOwnProperty(te)&&this.slurs[te].addInternalNote(P);if(T.startSlur)for(K=0;K<T.startSlur.length;K++)F=T.startSlur[K].label,$=new h({anchor1:P,stemDir:this.stemdir,voiceNumber:q,style:T.startSlur[K].style}),x&&$.setHint(),this.slurs[F]=$,B.addOther($)},I.prototype.addMeasureNumber=function(E,T){var P=this.getTextSize.calc(E,"measurefont","bar-number"),B=0;T.isClef&&(B+=P.width/2);var O=P.width>10&&T.abcelem.type==="treble"?13.5:11;T.addFixed(new d(E,B,P.width,O+P.height/p.STEP,{type:"barNumber",dim:this.getTextSize.attr("measurefont","bar-number")}))},I.prototype.createBarLine=function(E,T,P){var B=new e(T,0,10,"bar",this.tuneNumber),O=null,w=0;T.barNumber&&this.addMeasureNumber(T.barNumber,B);var C=T.type==="bar_right_repeat"||T.type==="bar_dbl_repeat",S=T.type!=="bar_left_repeat"&&T.type!=="bar_thick_thin"&&T.type!=="bar_invisible",q=T.type==="bar_right_repeat"||T.type==="bar_dbl_repeat"||T.type==="bar_left_repeat"||T.type==="bar_thin_thick"||T.type==="bar_thick_thin",D=T.type==="bar_left_repeat"||T.type==="bar_thick_thin"||T.type==="bar_thin_thin"||T.type==="bar_dbl_repeat",$=T.type==="bar_left_repeat"||T.type==="bar_dbl_repeat";if(C||$){for(var F in this.slurs)this.slurs.hasOwnProperty(F)&&this.slurs[F].setEndX(B);this.startlimitelem=B}if(C&&(B.addRight(new d("dots.dot",w,1,7)),B.addRight(new d("dots.dot",w,1,5)),w+=6),S&&(O=new d(null,w,1,2,{type:"bar",pitch2:10,linewidth:.6}),B.addRight(O)),T.type==="bar_invisible"&&(O=new d(null,w,1,2,{type:"none",pitch2:10,linewidth:.6}),B.addRight(O)),T.decoration&&this.decoration.createDecoration(E,T.decoration,12,q?3:1,B,0,"down",2,T.positioning,this.hasVocals,this.accentAbove),q&&(w+=4,O=new d(null,w,4,2,{type:"bar",pitch2:10,linewidth:4}),B.addRight(O),w+=5),this.partstartelem&&T.endEnding&&(this.partstartelem.anchor2=O,this.partstartelem=null),D&&(w+=3,O=new d(null,w,1,2,{type:"bar",pitch2:10,linewidth:.6}),B.addRight(O)),$&&(w+=3,B.addRight(new d("dots.dot",w,1,7)),B.addRight(new d("dots.dot",w,1,5))),T.startEnding&&P&&E.voicenumber===0){var K=this.getTextSize.calc(T.startEnding,"repeatfont","").width;B.minspacing+=K+10,this.partstartelem=new f(T.startEnding,O,null),E.addOther(this.partstartelem)}return B.extraw-=5,T.chord!==void 0&&y(this.getTextSize,B,T,0,0,0,!1,this.germanAlphabet),B},En=I,En}var An,Bs;function $g(){if(Bs)return An;Bs=1;var e="http://www.w3.org/2000/svg";function t(c){this.svg=i(),this.currentGroup=[],c.appendChild(this.svg)}t.prototype.clear=function(){if(this.svg){var c=this.svg.parentNode;this.svg=i(),this.currentGroup=[],c&&(c.innerHTML="",c.appendChild(this.svg))}},t.prototype.setTitle=function(c){var u=document.createElement("title"),f=document.createTextNode(c);u.appendChild(f),this.svg.insertBefore(u,this.svg.firstChild)},t.prototype.setResponsiveWidth=function(c,u){if(this.svg.setAttribute("viewBox","0 0 "+c+" "+u),this.svg.setAttribute("preserveAspectRatio","xMinYMin meet"),this.svg.removeAttribute("height"),this.svg.removeAttribute("width"),this.svg.style.display="inline-block",this.svg.style.position="absolute",this.svg.style.top="0",this.svg.style.left="0",this.svg.parentNode){var f=this.svg.parentNode.getAttribute("class");f?f.indexOf("abcjs-container")<0&&this.svg.parentNode.setAttribute("class",f+" abcjs-container"):this.svg.parentNode.setAttribute("class","abcjs-container"),this.svg.parentNode.style.display="inline-block",this.svg.parentNode.style.position="relative",this.svg.parentNode.style.width="100%";var g=u/c*100;this.svg.parentNode.style["padding-bottom"]=g+"%",this.svg.parentNode.style["vertical-align"]="middle",this.svg.parentNode.style.overflow="hidden"}},t.prototype.setSize=function(c,u){this.svg.setAttribute("width",c),this.svg.setAttribute("height",u)},t.prototype.setAttribute=function(c,u){this.svg.setAttribute(c,u)},t.prototype.setScale=function(c){c!==1?(this.svg.style.transform="scale("+c+","+c+")",this.svg.style["-ms-transform"]="scale("+c+","+c+")",this.svg.style["-webkit-transform"]="scale("+c+","+c+")",this.svg.style["transform-origin"]="0 0",this.svg.style["-ms-transform-origin-x"]="0",this.svg.style["-ms-transform-origin-y"]="0",this.svg.style["-webkit-transform-origin-x"]="0",this.svg.style["-webkit-transform-origin-y"]="0"):(this.svg.style.transform="",this.svg.style["-ms-transform"]="",this.svg.style["-webkit-transform"]="")},t.prototype.insertStyles=function(c){var u=document.createElementNS(e,"style");u.textContent=c,this.svg.insertBefore(u,this.svg.firstChild)},t.prototype.setParentStyles=function(c){for(var u in c)c.hasOwnProperty(u)&&this.svg.parentNode&&(this.svg.parentNode.style[u]=c[u]);if(this.dummySvg){var f=document.querySelector("body");f.removeChild(this.dummySvg),this.dummySvg=null}};function a(c,u,f){var g=f-c;return"M "+c+" "+u+" l "+g+" 0 l 0 1 l "+-g+" 0 z "}function n(c,u,f){var g=f-u;return"M "+c+" "+u+" l 0 "+g+" l 1 0 l 0 "+-g+" z "}t.prototype.rect=function(c){var u=[],f=c.x,g=c.y,d=c.x+c.width,p=c.y+c.height;return u.push(a(f,g,d)),u.push(a(f,p,d)),u.push(n(d,g,p)),u.push(n(f,p,g)),this.path({path:u.join(" "),stroke:"none","data-name":c["data-name"]})},t.prototype.dottedLine=function(c){var u=document.createElementNS(e,"line");u.setAttribute("x1",c.x1),u.setAttribute("x2",c.x2),u.setAttribute("y1",c.y1),u.setAttribute("y2",c.y2),u.setAttribute("stroke",c.stroke),u.setAttribute("stroke-dasharray","5,5"),this.svg.insertBefore(u,this.svg.firstChild)},t.prototype.rectBeneath=function(c){var u=document.createElementNS(e,"rect");u.setAttribute("x",c.x),u.setAttribute("width",c.width),u.setAttribute("y",c.y),u.setAttribute("height",c.height),c.stroke&&u.setAttribute("stroke",c.stroke),c["stroke-opacity"]&&u.setAttribute("stroke-opacity",c["stroke-opacity"]),c.fill&&u.setAttribute("fill",c.fill),c["fill-opacity"]&&u.setAttribute("fill-opacity",c["fill-opacity"]),this.svg.insertBefore(u,this.svg.firstChild)},t.prototype.text=function(c,u,f,g){var d=document.createElementNS(e,"text");d.setAttribute("stroke","none");for(var p in u)u.hasOwnProperty(p)&&d.setAttribute(p,u[p]);for(var l=u["data-name"]=="free-text",o=(""+c).split(`
|
|
115
|
+
`),h=0;h<o.length;h++)if(!(l&&o[h]=="")){var s=document.createElementNS(e,"tspan");if(g)for(var v in g)g.hasOwnProperty(v)&&s.setAttribute(v,g[v]);if(s.setAttribute("x",u.x?u.x:0),h!==0&&s.setAttribute("dy","1.2em"),o[h].indexOf("")!==-1){var y=o[h].split("");if(s.textContent=y[0],y[1]){var m=document.createElementNS(e,"tspan");m.setAttribute("dy","-0.3em"),m.setAttribute("style","font-size:0.7em"),m.textContent=y[1],s.appendChild(m)}if(y[2]){var _=y[1]?"0.4em":"0.1em",k=document.createElementNS(e,"tspan");k.setAttribute("dy",_),k.setAttribute("style","font-size:0.7em"),k.textContent=y[2],s.appendChild(k)}}else l&&o[h].trim()==""?s.innerHTML=" ":s.textContent=o[h];d.appendChild(s)}return f?f.appendChild(d):this.append(d),d},t.prototype.richTextLine=function(c,u,f,g,d,p){var l=document.createElementNS(e,"text");l.setAttribute("stroke","none"),l.setAttribute("class",g),l.setAttribute("x",u),l.setAttribute("y",f),l.setAttribute("text-anchor",d),l.setAttribute("dominant-baseline","middle");for(var o=0;o<c.length;o++){for(var h=c[o],s=document.createElementNS(e,"tspan"),v=Object.keys(h.attrs),y=0;y<v.length;y++){var m=h.attrs[v[y]];m!==""&&s.setAttribute(v[y],m)}s.textContent=h.content,l.appendChild(s)}return p?p.appendChild(l):this.append(l),l},t.prototype.guessWidth=function(c,u){var f=this.createDummySvg(),g=this.text(c,u,f),d;try{d=g.getBBox(),isNaN(d.height)||!d.height?d={width:u["font-size"]/2,height:u["font-size"]+2}:d={width:d.width,height:d.height}}catch{d={width:u["font-size"]/2,height:u["font-size"]+2}}return f.removeChild(g),d},t.prototype.createDummySvg=function(){if(!this.dummySvg){this.dummySvg=i();var c=["display: block !important;","height: 1px;","width: 1px;","position: absolute;"];this.dummySvg.setAttribute("style",c.join(""));var u=document.querySelector("body");u.appendChild(this.dummySvg)}return this.dummySvg};var r={};t.prototype.getTextSize=function(c,u,f){if(typeof c=="number"&&(c=""+c),!c||c.match(/^\s+$/))return{width:0,height:0};var g;if(c.length<20&&(g=c+JSON.stringify(u),r[g]))return r[g];var d=!f;f||(f=this.text(c,u));var p;try{p=f.getBBox(),isNaN(p.height)||!p.height?p=this.guessWidth(c,u):p={width:p.width,height:p.height}}catch{p=this.guessWidth(c,u)}return d&&(this.currentGroup.length>0?this.currentGroup[0].removeChild(f):this.svg.removeChild(f)),g&&(r[g]=p),p},t.prototype.openGroup=function(c){c=c||{};var u=document.createElementNS(e,"g");return c.klass&&u.setAttribute("class",c.klass),c.fill&&u.setAttribute("fill",c.fill),c.stroke&&u.setAttribute("stroke",c.stroke),c["data-name"]&&u.setAttribute("data-name",c["data-name"]),c.prepend?this.prepend(u):this.append(u),this.currentGroup.unshift(u),u},t.prototype.closeGroup=function(){var c=this.currentGroup.shift();return c&&c.children.length===0?(c.parentElement.removeChild(c),null):c},t.prototype.path=function(c){var u=document.createElementNS(e,"path");for(var f in c)c.hasOwnProperty(f)&&(f==="path"?u.setAttributeNS(null,"d",c.path):f==="klass"?u.setAttributeNS(null,"class",c[f]):c[f]!==void 0&&u.setAttributeNS(null,f,c[f]));return this.append(u),u},t.prototype.pathToBack=function(c){var u=document.createElementNS(e,"path");for(var f in c)c.hasOwnProperty(f)&&(f==="path"?u.setAttributeNS(null,"d",c.path):f==="klass"?u.setAttributeNS(null,"class",c[f]):u.setAttributeNS(null,f,c[f]));return this.prepend(u),u},t.prototype.lineToBack=function(c){for(var u=document.createElementNS(e,"line"),f=Object.keys(c),g=0;g<f.length;g++)u.setAttribute(f[g],c[f[g]]);return this.prepend(u),u},t.prototype.append=function(c){this.currentGroup.length>0?this.currentGroup[0].appendChild(c):this.svg.appendChild(c)},t.prototype.prepend=function(c){this.currentGroup.length>0?this.currentGroup[0].appendChild(c):this.svg.insertBefore(c,this.svg.firstChild)},t.prototype.setAttributeOnElement=function(c,u){for(var f in u)u.hasOwnProperty(f)&&c.setAttributeNS(null,f,u[f])},t.prototype.moveElementToChild=function(c,u){c.appendChild(u)};function i(){var c=document.createElementNS(e,"svg");return c.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),c.setAttribute("role","img"),c.setAttribute("fill","currentColor"),c.setAttribute("stroke","currentColor"),c}return An=t,An}var Mn,Ls;function Zg(){if(Ls)return Mn;Ls=1;var e=Ve(),t=$g(),a=function(n){this.paper=new t(n),this.controller=null,this.space=3*e.SPACE,this.padding={},this.reset(),this.firefox112=navigator.userAgent.indexOf("Firefox/112.0")>=0};return a.prototype.reset=function(){this.paper.clear(),this.y=0,this.abctune=null,this.path=null,this.isPrint=!1,this.lineThickness=0,this.initVerticalSpace()},a.prototype.newTune=function(n){this.abctune=n,this.setVerticalSpace(n.formatting),this.isPrint=n.media==="print",this.setPadding(n)},a.prototype.setLineThickness=function(n){this.lineThickness=n},a.prototype.setPaddingOverride=function(n){this.paddingOverride={top:n.paddingtop,bottom:n.paddingbottom,right:n.paddingright,left:n.paddingleft}},a.prototype.setPadding=function(n){function r(i,c,u,f,g){n.formatting[u]!==void 0?i.padding[c]=n.formatting[u]:i.paddingOverride[c]!==void 0?i.padding[c]=i.paddingOverride[c]:i.isPrint?i.padding[c]=f:i.padding[c]=g}r(this,"top","topmargin",38,15),r(this,"bottom","botmargin",38,15),r(this,"left","leftmargin",68,15),r(this,"right","rightmargin",68,15)},a.prototype.adjustNonScaledItems=function(n){this.padding.top/=n,this.padding.bottom/=n,this.padding.left/=n,this.padding.right/=n,this.abctune.formatting.headerfont.size/=n,this.abctune.formatting.footerfont.size/=n},a.prototype.initVerticalSpace=function(){this.spacing={composer:7.56,graceBefore:8.67,graceInside:10.67,graceAfter:16,info:0,lineSkipFactor:1.1,music:7.56,paragraphSkipFactor:.4,parts:11.33,slurHeight:1,staffSeparation:61.33,staffTopMargin:0,stemHeight:26.67+10,subtitle:3.78,systemStaffSeparation:48,text:18.9,title:7.56,top:30.24,vocal:0,words:0}},a.prototype.setVerticalSpace=function(n){n.staffsep!==void 0&&(this.spacing.staffSeparation=n.staffsep*4/3),n.composerspace!==void 0&&(this.spacing.composer=n.composerspace*4/3),n.partsspace!==void 0&&(this.spacing.parts=n.partsspace*4/3),n.textspace!==void 0&&(this.spacing.text=n.textspace*4/3),n.musicspace!==void 0&&(this.spacing.music=n.musicspace*4/3),n.titlespace!==void 0&&(this.spacing.title=n.titlespace*4/3),n.sysstaffsep!==void 0&&(this.spacing.systemStaffSeparation=n.sysstaffsep*4/3),n.stafftopmargin!==void 0&&(this.spacing.staffTopMargin=n.stafftopmargin*4/3),n.subtitlespace!==void 0&&(this.spacing.subtitle=n.subtitlespace*4/3),n.topspace!==void 0&&(this.spacing.top=n.topspace*4/3),n.vocalspace!==void 0&&(this.spacing.vocal=n.vocalspace*4/3),n.wordsspace!==void 0&&(this.spacing.words=n.wordsspace*4/3)},a.prototype.calcY=function(n){return this.y-n*e.STEP},a.prototype.yToPitch=function(n){return n/e.STEP},a.prototype.moveY=function(n,r){r===void 0&&(r=1),this.y+=n*r},a.prototype.absolutemoveY=function(n){this.y=n},Mn=a,Mn}var Nn,Os;function Gg(){if(Os)return Nn;Os=1;function e(t,a,n,r,i,c){var u=t.text;this.rows=[];var f;a&&this.rows.push({move:a});var g=n.calc("textfont","defined-text");if(u==="")this.rows.push({move:g.attr["font-size"]*2});else if(typeof u=="string"){let y=function(m){return m.replace(/^[ \t]*\n/gm,`X
|
|
116
|
+
`)};var v=y;this.rows.push({move:g.attr["font-size"]/2}),this.rows.push({left:r,text:u,font:"textfont",klass:"defined-text",anchor:"start",startChar:t.startChar,endChar:t.endChar,absElemType:"freeText",name:"free-text"});var d=y(u);f=c.calc(d,"textfont","defined-text"),this.rows.push({move:f.height})}else if(u){for(var p=0,l=r,o="textfont",h=0;h<u.length;h++)u[h].font?o=u[h].font:o="textfont",this.rows.push({left:l,text:u[h].text,font:o,klass:"defined-text",anchor:"start",startChar:t.startChar,endChar:t.endChar,absElemType:"freeText",name:"free-text"}),f=c.calc(u[h].text,n.calc(o,"defined-text").font,"defined-text"),l+=f.width+f.height/2,p=Math.max(p,f.height);this.rows.push({move:p})}else if(t.length===1){var s=i/2;this.rows.push({left:s,text:t[0].text,font:"textfont",klass:"defined-text",anchor:"middle",startChar:t.startChar,endChar:t.endChar,absElemType:"freeText",name:"free-text"}),f=c.calc(t[0].text,"textfont","defined-text"),this.rows.push({move:f.height})}}return Nn=e,Nn}var Pn,Ds;function Ug(){if(Ds)return Pn;Ds=1;function e(t,a,n){this.rows=[],t&&this.rows.push({move:t}),this.rows.push({separator:a,absElemType:"separator"}),n&&this.rows.push({move:n})}return Pn=e,Pn}var zn,Fs;function jg(){if(Fs)return zn;Fs=1;function e(t,a,n,r,i,c){this.rows=[],t&&this.rows.push({move:t});var u=a.titleleft?"start":"middle",f=a.titleleft?i:r;this.rows.push({left:f,text:n.text,font:"subtitlefont",klass:"text subtitle",anchor:u,startChar:n.startChar,endChar:n.endChar,absElemType:"subtitle",name:"subtitle"});var g=c.calc(n.text,"subtitlefont","text subtitle");this.rows.push({move:g.height})}return zn=e,zn}var In,Hs;function Ua(){if(Hs)return In;Hs=1;function e(t,a,n){if(a.text){a.marginLeft||(a.marginLeft=0),a.klass||(a.klass=""),a.anchor||(a.anchor="start"),a.info||(a.info={startChar:-2,endChar:-2}),a.marginTop&&t.push({move:a.marginTop});var r={left:a.marginLeft,text:a.text,font:a.font,anchor:a.anchor,startChar:a.info.startChar,endChar:a.info.endChar,"dominant-baseline":a["dominant-baseline"]};a.absElemType&&(r.absElemType=a.absElemType),!a.inGroup&&a.klass&&(r.klass=a.klass),a.name&&(r.name=a.name),t.push(r);var i=n.calc("A",a.font,a.klass),c=a.text.split(`
|
|
117
117
|
`).length;if(a.text[a.text.length-1]===`
|
|
118
|
-
`&&c--,!a.noMove){var u=i.height*1.1*c;t.push({move:Math.round(u)}),a.marginBottom&&t.push({move:a.marginBottom})}}}return
|
|
119
|
-
`+u),e(i,{marginLeft:f,text:u,font:g,absElemType:"extraText",name:o,"dominant-baseline":"middle",klass:l},v);else{i.push({startGroup:p,klass:l,name:o}),i.push({move:h.info}),c&&(e(i,{marginLeft:f,text:c,font:g,absElemType:"extraText",name:o,"dominant-baseline":"middle"},v),i.push({move:y.height*3/4}));for(var m=0;m<u.length;m++)t(i,u[m],g,"",o,f,{anchor:"start"},v),m<u.length-1&&typeof u[m]=="string"&&typeof u[m+1]!="string"&&i.push({move:y.height*3/4});i.push({endGroup:p,absElemType:d,startChar:-1,endChar:-1,name:o}),i.push({move:y.height})}}}return a.prototype.extraText=function(i,c,u,f,g){n(this.rows,"Book: ",i.book,c,"abcjs-book",f,g),n(this.rows,"Source: ",i.source,c,"abcjs-source",f,g),n(this.rows,"Discography: ",i.discography,c,"abcjs-discography",f,g),r(this.rows,"Notes:",i.notes,c,"historyfont","extraText","notes","abcjs-notes","description",u,f,g),n(this.rows,"Transcription: ",i.transcription,c,"abcjs-transcription",f,g),r(this.rows,"History:",i.history,c,"historyfont","extraText","history","abcjs-history","description",u,f,g),n(this.rows,"Copyright: ",i["abc-copyright"],c,"abcjs-copyright",f,g),n(this.rows,"Creator: ",i["abc-creator"],c,"abcjs-creator",f,g),n(this.rows,"Edited By: ",i["abc-edited-by"],c,"abcjs-edited-by",f,g)},a.prototype.footer=function(i,c,u,f){var g="header meta-bottom",d="footerfont";this.rows.push({startGroup:"footer",klass:g}),e(this.rows,{marginLeft:u,text:i.left,font:d,klass:g,name:"footer"},f),e(this.rows,{marginLeft:u+c/2,text:i.center,font:d,klass:g,anchor:"middle",name:"footer"},f),e(this.rows,{marginLeft:u+c,text:i.right,font:d,klass:g,anchor:"end",name:"footer"},f)},q0=a,q0}var B0,Us;function Bl(){if(Us)return B0;Us=1;function e(a,n,r,i){if(a.indexOf(n)===0){var c=a.replace(n,""),u=parseInt(c,10);""+u===c&&(r[i]=u)}}function t(a,n){var r=[];if(a.absEl.elemset){for(var i={},c=0;c<a.absEl.elemset.length;c++){var u=a.absEl.elemset[c];if(u)for(var f=u.getAttribute("class").split(" "),g=0;g<f.length;g++)i[f[g]]=!0}for(var d=0;d<Object.keys(i).length;d++)r.push(Object.keys(i)[d])}for(var p={},l=0;l<r.length;l++)e(r[l],"abcjs-v",p,"voice"),e(r[l],"abcjs-l",p,"line"),e(r[l],"abcjs-m",p,"measure");a.staffPos&&(p.staffPos=a.staffPos);for(var o=n.target;o&&o.dataset&&!o.dataset.name&&o.tagName.toLowerCase()!=="svg";)o=o.parentNode;for(var h=n.target;h&&h.dataset&&!h.dataset.index&&h.tagName.toLowerCase()!=="svg";)h=h.parentNode;return h&&h.dataset&&(p.name=h.dataset.name,p.clickedName=o.dataset.name,p.parentClasses=h.classList),o&&o.classList&&(p.clickedClasses=o.classList),p.selectableElement=a.svgEl,{classes:r,analysis:p}}return B0=t,B0}var L0,js;function Vg(){if(js)return L0;js=1;var e=Ve(),t=Bl();function a(b,A){if(b.rangeHighlight=_,b.dragging)for(var N=0;N<b.selectables.length;N++){var M=b.selectables[N];M.svgEl.getAttribute("selectable")==="true"&&(M.svgEl.setAttribute("tabindex",0),M.svgEl.setAttribute("data-index",N),M.svgEl.addEventListener("keydown",i.bind(b)),M.svgEl.addEventListener("keyup",c.bind(b)),M.svgEl.addEventListener("focus",r.bind(b)))}for(var z=0;z<A.length;z++)A[z].addEventListener("touchstart",o.bind(b),{passive:!0}),A[z].addEventListener("touchmove",h.bind(b),{passive:!0}),A[z].addEventListener("touchend",s.bind(b),{passive:!0}),A[z].addEventListener("mousedown",o.bind(b)),A[z].addEventListener("mousemove",h.bind(b)),A[z].addEventListener("mouseup",s.bind(b))}function n(b){var A=1,N=1,M=b.target.closest("svg"),z=0;M&&M.viewBox&&M.viewBox.baseVal&&(M.viewBox.baseVal.width!==0&&(A=M.viewBox.baseVal.width/M.clientWidth),M.viewBox.baseVal.height!==0&&(N=M.viewBox.baseVal.height/M.clientHeight),z=M.viewBox.baseVal.y);var L=b.target&&b.target.tagName==="svg",E,T;return L?(E=b.offsetX,T=b.offsetY):(E=b.layerX,T=b.layerY),E=E*A,T=T*N,[E,T+z]}function r(b){this.dragMechanism==="keyboard"&&this.dragYStep!==0&&this.dragTarget&&y.bind(this)(this.dragTarget,this.dragYStep,this.selectables.length,this.dragIndex,b),this.dragYStep=0}function i(b){switch(b.keyCode){case 38:case 40:b.preventDefault()}}function c(b){var A=!1,N=b.target.dataset.index;switch(b.keyCode){case 13:case 32:A=!0,this.dragTarget=this.selectables[N],this.dragIndex=N,this.dragMechanism="keyboard",s.bind(this)(b);break;case 38:A=!0,this.dragTarget=this.selectables[N],this.dragIndex=N,this.dragTarget&&this.dragTarget.isDraggable&&(this.dragging&&this.dragTarget.isDraggable&&this.dragTarget.absEl.highlight(void 0,this.dragColor),this.dragYStep--,this.dragTarget.svgEl.setAttribute("transform","translate(0,"+this.dragYStep*e.STEP+")"));break;case 40:A=!0,this.dragTarget=this.selectables[N],this.dragIndex=N,this.dragMechanism="keyboard",this.dragTarget&&this.dragTarget.isDraggable&&(this.dragging&&this.dragTarget.isDraggable&&this.dragTarget.absEl.highlight(void 0,this.dragColor),this.dragYStep++,this.dragTarget.svgEl.setAttribute("transform","translate(0,"+this.dragYStep*e.STEP+")"));break;case 9:this.dragYStep!==0&&s.bind(this)(b);break}A&&b.preventDefault()}function u(b,A){if(!A)return-1;var N=A.dataset;if(!N)return-1;for(var M=N.index,z=0;z<b.length;z++){var L=b[z].svgEl.dataset;if(L&&M===L.index)return z}return-1}function f(b,A,N){for(var M=9999999,z=-1,L=0;L<b.selectables.length&&M>0;L++){var E=b.selectables[L];if(b.getDim(E),E.dim.left<A&&E.dim.right>A&&E.dim.top<N&&E.dim.bottom>N)z=L,M=0;else if(E.dim.top<N&&E.dim.bottom>N){var T=Math.min(Math.abs(E.dim.left-A),Math.abs(E.dim.right-A));T<M&&(M=T,z=L)}else if(E.dim.left<A&&E.dim.right>A){var P=Math.min(Math.abs(E.dim.top-N),Math.abs(E.dim.bottom-N));P<M&&(M=P,z=L)}else{var B=Math.abs(A-E.dim.left)>Math.abs(A-E.dim.right)?Math.abs(A-E.dim.right):Math.abs(A-E.dim.left),O=Math.abs(N-E.dim.top)>Math.abs(N-E.dim.bottom)?Math.abs(N-E.dim.bottom):Math.abs(N-E.dim.top),w=Math.sqrt(B*B+O*O);w<M&&(M=w,z=L)}}return z>=0&&M<=12?z:-1}function g(b,A,N){if(b.x<=A.offsetX&&b.x+b.width>=A.offsetX&&b.y<=A.offsetY&&b.y+b.height>=A.offsetY)return[A.offsetX,A.offsetY];var M=Math.abs(A.layerY/N-A.offsetY);return M<3?[A.offsetX,A.offsetY]:[A.layerX,A.layerY]}function d(b){if(!b)return null;if(b.tagName==="svg")return b;if(!b.getAttribute)return null;for(var A=b.getAttribute("selectable");!A;)b.parentElement?(b=b.parentElement,b.tagName==="svg"?A=!0:A=b.getAttribute("selectable")):A=!0;return b}function p(b,A){var N,M,z,L=u(b.selectables,d(A.target));return L>=0?(z=g(b.selectables[L].svgEl.getBBox(),A,b.scale),N=z[0],M=z[1]):(z=n(A),N=z[0],M=z[1],L=f(b,N,M)),{x:N,y:M,clickedOn:L}}function l(b){if(!(!b||!b.target||!b.touches||b.touches.length<1)){var A=b.target.getBoundingClientRect(),N=b.touches[0].pageX-A.left,M=b.touches[0].pageY-A.top;b.touches[0].offsetX=N,b.touches[0].offsetY=M,b.touches[0].layerX=b.touches[0].pageX,b.touches[0].layerY=b.touches[0].pageY}}function o(b){var A=b;b.type==="touchstart"&&(l(b),b.touches.length>0&&(A=b.touches[0]));var N=p(this,A);N.clickedOn>=0&&(b.type==="touchstart"||b.button===0)&&this.selectables[N.clickedOn]&&(this.dragTarget=this.selectables[N.clickedOn],this.dragIndex=N.clickedOn,this.dragMechanism="mouse",this.dragMouseStart={x:N.x,y:N.y},this.dragging&&this.dragTarget.isDraggable&&(R(this.renderer.paper,"abcjs-dragging-in-progress"),this.dragTarget.absEl.highlight(void 0,this.dragColor)))}function h(b){var A=b;if(b.type==="touchmove"&&(l(b),b.touches.length>0&&(A=b.touches[0])),this.lastTouchMove=b,!(!this.dragTarget||!this.dragging||!this.dragTarget.isDraggable||this.dragMechanism!=="mouse"||!this.dragMouseStart)){var N=p(this,A),M=Math.round((N.y-this.dragMouseStart.y)/e.STEP);M!==this.dragYStep&&(this.dragYStep=M,this.dragTarget.svgEl.setAttribute("transform","translate(0,"+M*e.STEP+")"))}}function s(b){var A=b;b.type==="touchend"&&this.lastTouchMove&&(l(this.lastTouchMove),this.lastTouchMove&&this.lastTouchMove.touches&&this.lastTouchMove.touches.length>0&&(A=this.lastTouchMove.touches[0])),this.dragTarget&&(m.bind(this)(),this.dragTarget.absEl&&this.dragTarget.absEl.highlight&&(this.selected=[this.dragTarget.absEl],this.dragTarget.absEl.highlight(void 0,this.selectionColor)),y.bind(this)(this.dragTarget,this.dragYStep,this.selectables.length,this.dragIndex,A),this.dragTarget.svgEl&&this.dragTarget.svgEl.focus&&(this.dragTarget.svgEl.focus(),this.dragTarget=null,this.dragIndex=-1),I(this.renderer.svg,"abcjs-dragging-in-progress"))}function v(b){b>=0&&b<this.selectables.length&&(this.dragTarget=this.selectables[b],this.dragIndex=b,this.dragMechanism="keyboard",s.bind(this)({target:this.dragTarget.svgEl}))}function y(b,A,N,M,z){for(var L=t(b,z),E=L.classes,T=L.analysis,P=0;P<this.listeners.length;P++)this.listeners[P](b.absEl.abcelem,b.absEl.tuneNumber,E.join(" "),T,{step:A,max:N,index:M,setSelection:v.bind(this)},z)}function m(){for(var b=0;b<this.selected.length;b++)this.selected[b].unhighlight(void 0,this.renderer.foregroundColor);this.selected=[]}function _(b,A){m.bind(this)();for(var N=0;N<this.staffgroups.length;N++)for(var M=this.staffgroups[N].voices,z=0;z<M.length;z++)for(var L=M[z].children,E=0;E<L.length;E++){var T=L[E].abcelem.startChar,P=L[E].abcelem.endChar;(A>T&&b<P||A===b&&A===P)&&(this.selected[this.selected.length]=L[E],L[E].highlight(void 0,this.selectionColor))}}function k(b){var A=b.getAttribute("class");A||(A="");for(var N=A.split(" "),M={},z=0;z<N.length;z++)M[N[z]]=!0;return M}function x(b,A){var N=[];for(var M in A)A.hasOwnProperty(M)&&N.push(M);b.setAttribute("class",N.join(" "))}function R(b,A){if(b){var N=k(b.svg);N[A]=!0,x(b.svg,N)}}function I(b,A){if(b){var N=k(b.svg);delete N[A],x(b.svg,N)}}return L0=a,L0}var O0,Ys;function ja(){if(Ys)return O0;Ys=1;function e(t,a,n,r,i){return a+(r-a)/(n-t)*(i-t)}return O0=e,O0}var D0,Ws;function Xg(){if(Ws)return D0;Ws=1;var e=at(),t=Ve(),a=ja(),n=function(l){if(!(l.elems.length===0||l.allrests)){var o=u(l.stemsUp,l.isgrace),h=l.elems[0],s=l.elems[l.elems.length-1],v=0,y=l.stemsUp?h.abcelem.maxpitch:h.abcelem.minpitch;v=i(h,l.stemsUp,y,v),v=i(s,l.stemsUp,y,v),v=Math.max(l.stemHeight,v+3);var m=g(l.average,l.elems.length,v,l.stemsUp,h.abcelem.averagepitch,s.abcelem.averagepitch,l.isflat,l.min,l.max,l.isgrace),_=f(l.stemsUp,h,s);l.addBeam({startX:_[0],endX:_[1],startY:m[0],endY:m[1],dy:o});for(var k=p(l.elems,l.stemsUp,l.beams[0],l.isgrace,o),x=0;x<k.length;x++)l.addBeam(k[x]);d(l.elems,l.stemsUp,l.beams[0],o,l.mainNote)}},r=function(l){return l===void 0?0:Math.floor(Math.log(l)/Math.log(2))};function i(l,o,h,s){if(!l.children)return s;for(var v=0;v<l.children.length;v++){var y=l.children[v];o&&y.top!==void 0&&y.c==="flags.ugrace"?s=Math.max(s,y.top-h):!o&&y.bottom!==void 0&&y.c==="flags.ugrace"&&(s=Math.max(s,h-y.bottom+7))}return s}function c(l,o,h,s){if(s)return 0;var v=l-o,y=h/2;return v>y&&(v=y),v<-y&&(v=-y),v}function u(l,o){var h=l?t.STEP:-t.STEP;return o&&(h=h*.4),h}function f(l,o,h){var s=o.heads[l?0:o.heads.length-1],v=h.heads[l?0:h.heads.length-1],y=s.x;l&&(y+=s.w-.6);var m=v.x;return m+=l?v.w:.6,[y,m]}function g(l,o,h,s,v,y,m,_,k,x){var R=h-2,I=h-2,b=Math.round(s?Math.max(l+R,k+I):Math.min(l-R,_-I)),A=c(v,y,o,m),N=b+Math.floor(A/2),M=b+Math.floor(-A/2);return x||(s&&b<6||!s&&b>6)&&(N=6,M=6),[N,M]}function d(l,o,h,s,v){for(var y=0;y<l.length;y++){var m=l[y];if(!m.abcelem.rest){var _=!m.addExtra,k=_?v:m,x=m.heads[o?0:m.heads.length-1],R=1/5,I=x.pitch+(o?R:-R),b=o?x.w:0;_||(b+=x.dx);var A=x.x+b,N=a(h.startX,h.startY,h.endX,h.endY,A),M=o?-.6:.6;o||(N-=s/2/t.STEP),_&&(b+=m.heads[0].dx),x.c==="noteheads.slash.quarter"&&(o?I+=1:I-=1);var z=new e(null,b,0,I,{type:"stem",pitch2:N,linewidth:M});z.setX(k.x),k.addRight(z)}}}function p(l,o,h,s,v){for(var y=[],m=[],_=0;_<l.length;_++){var k=l[_];if(!k.abcelem.rest){var x=k.heads[o?0:k.heads.length-1],R=x.x+(o?x.w:0),I=a(h.startX,h.startY,h.endX,h.endY,R),b=o?-1.5:1.5;s&&(b=b*2/3);var A=k.abcelem.duration;A===0&&(A=.25);for(var N=r(A);N<-3;N++){var M=-4-N;if(m[M]?m[M].single=!1:m[M]={x:R+(o?-.6:0),y:I+b*(M+1),durlog:N,single:!0},_>0&&k.abcelem.beambr&&k.abcelem.beambr<=M+1){m[M].split||(m[M].split=[m[M].x]);var z=f(o,l[_-1],k);m[M].split[m[M].split.length-1]>=z[0]&&(z[0]+=k.w),m[M].split.push(z[0]),m[M].split.push(z[1])}}for(var L=m.length-1;L>=0;L--)if(_===l.length-1||r(l[_+1].abcelem.duration)>-L-4){var E=R,T=I+b*(L+1);m[L].single&&(_===0?E=R+5:_===l.length-1?E=R-5:l[_-1].duration===l[_+1].duration?E=_%2===0?R+5:R-5:E=l[_-1].duration>l[_+1].duration?R+5:R-5,T=a(h.startX,h.startY,h.endX,h.endY,E)+b*(L+1));var P={startX:m[L].x,endX:E,startY:m[L].y,endY:T,dy:v};if(m[L].split!==void 0){var B=m[L].split;P.endX<=B[B.length-1]&&(B[B.length-1]-=k.w),B.push(P.endX),P.split=m[L].split}y.push(P),m=m.slice(0,L)}}}return y}return D0=n,D0}var F0,Vs;function Kg(){if(Vs)return F0;Vs=1;var e=ja();function t(i){if(i.anchor1&&i.anchor2){i.hasBeam=!!i.anchor1.parent.beam&&i.anchor1.parent.beam===i.anchor2.parent.beam;var c=i.anchor1.parent.beam;if(i.hasBeam&&(c.elems[0]!==i.anchor1.parent||c.elems[c.elems.length-1]!==i.anchor2.parent)&&(i.hasBeam=!1),i.hasBeam){var u=a(c)?i.anchor1.x+i.anchor1.w:i.anchor1.x;i.yTextPos=n(u,i.anchor2.x,c),i.yTextPos+=a(c)?3:-2,i.xTextPos=r(u,i.anchor2.x),i.top=i.yTextPos+1,i.bottom=i.yTextPos-2,a(c)&&(i.endingHeightAbove=4)}else{i.startNote=Math.max(i.anchor1.parent.top,9)+4,i.endNote=Math.max(i.anchor2.parent.top,9)+4,i.anchor1.parent.type==="rest"&&i.anchor2.parent.type!=="rest"?i.startNote=i.endNote:i.anchor2.parent.type==="rest"&&i.anchor1.parent.type!=="rest"&&(i.endNote=i.startNote);for(var f=0,g=0;g<i.middleElems.length;g++)f=Math.max(f,i.middleElems[g].top);f+=4,(f>i.startNote||f>i.endNote)&&(i.startNote=f,i.endNote=f),i.flatBeams&&(i.startNote=Math.max(i.startNote,i.endNote),i.endNote=Math.max(i.startNote,i.endNote)),i.yTextPos=i.startNote+(i.endNote-i.startNote)/2,i.xTextPos=i.anchor1.x+(i.anchor2.x+i.anchor2.w-i.anchor1.x)/2,i.top=i.yTextPos+1}}delete i.middleElems,delete i.flatBeams}function a(i){return i.stemsUp}function n(i,c,u){if(u.beams.length===0)return 0;u=u.beams[0];var f=i+(c-i)/2;return e(u.startX,u.startY,u.endX,u.endY,f)}function r(i,c){return i+(c-i)/2}return F0=t,F0}var H0,Xs;function Jg(){if(Xs)return H0;Xs=1;var e=Xg(),t=ja(),a=Kg(),n=function(d){for(var p=0;p<d.beams.length;p++)if(d.beams[p].type==="BeamElem"){e(d.beams[p]),r(d.beams[p]);for(var l=0;l<d.beams[p].elems.length;l++)d.adjustRange(d.beams[p].elems[l])}for(d.staff.specialY.chordLines=c(d.children),p=0;p<d.otherchildren.length;p++){var o=d.otherchildren[p];o.type==="TripletElem"&&(a(o),d.adjustRange(o))}d.staff.top=Math.max(d.staff.top,d.top),d.staff.bottom=Math.min(d.staff.bottom,d.bottom)};function r(d){for(var p=1.5,l=0;l<d.elems.length;l++){var o=d.elems[l];if(o.top)for(var h=g(o,d),s=0;s<o.children.length;s++){var v=o.children[s];if(v.klass==="ornament"&&v.position!=="below"&&v.bottom-p<h){var y=h-v.bottom+p;v.bottom+=y,v.top+=y,v.pitch+=y,h=o.top=v.top}}}}function i(d,p){var l=p.getChordDim();if(l){for(var o=0;o<d.length;o++){var h=d[o]<l.left;if(h){o>0&&p.putChordInLane(o),d[o]=l.right;return}}d.push(l.right),p.putChordInLane(d.length-1)}}function c(d){var p=[0],l=[0],o,h,s;for(o=0;o<d.length;o++){for(h=0;h<d[o].children.length;h++)s=d[o].children[h],s.chordHeightAbove&&i(p,s);for(h=d[o].children.length-1;h>=0;h--)s=d[o].children[h],s.chordHeightBelow&&i(l,s)}return(p.length>1||l.length>1)&&f(d,p.length,l.length),{above:p.length,below:l.length}}function u(d){for(var p=0,l=0;l<d.children.length;l++){var o=d.children[l];o.chordHeightBelow&&p++}return p}function f(d,p,l){for(var o=0;o<d.length;o++){u(d[o]);for(var h=0;h<d[o].children.length;h++){var s=d[o].children[h];s.chordHeightAbove&&s.invertLane(p)}}}function g(d,p){return p=p.beams[0],t(p.startX,p.startY,p.endX,p.endY,d.x)}return H0=n,H0}var $0,Ks;function Qg(){if(Ks)return $0;Ks=1;var e=Ve(),t=function(p,l){for(var o,h=0;h<l.staffs.length;h++){var s=l.staffs[h],v={tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0};if(p.showDebug&&p.showDebug.indexOf("box")>=0&&(s.originalTop=s.top,s.originalBottom=s.bottom),n(s,v,"lyricHeightAbove"),n(s,v,"chordHeightAbove",s.specialY.chordLines.above),s.specialY.endingHeightAbove&&(s.specialY.chordHeightAbove?s.top+=2:s.top+=s.specialY.endingHeightAbove+a,v.endingHeightAbove=s.top),s.specialY.dynamicHeightAbove&&s.specialY.volumeHeightAbove?(s.top+=Math.max(s.specialY.dynamicHeightAbove,s.specialY.volumeHeightAbove)+a,v.dynamicHeightAbove=s.top,v.volumeHeightAbove=s.top):(n(s,v,"dynamicHeightAbove"),n(s,v,"volumeHeightAbove")),n(s,v,"partHeightAbove"),n(s,v,"tempoHeightAbove"),s.specialY.lyricHeightBelow&&(s.specialY.lyricHeightBelow+=p.spacing.vocal/e.STEP,v.lyricHeightBelow=s.bottom,s.bottom-=s.specialY.lyricHeightBelow+a),s.specialY.chordHeightBelow){v.chordHeightBelow=s.bottom;var y=s.specialY.chordHeightBelow;s.specialY.chordLines.below&&(y*=s.specialY.chordLines.below),s.bottom-=y+a}s.specialY.volumeHeightBelow&&s.specialY.dynamicHeightBelow?(v.volumeHeightBelow=s.bottom,v.dynamicHeightBelow=s.bottom,s.bottom-=Math.max(s.specialY.volumeHeightBelow,s.specialY.dynamicHeightBelow)+a):s.specialY.volumeHeightBelow?(v.volumeHeightBelow=s.bottom,s.bottom-=s.specialY.volumeHeightBelow+a):s.specialY.dynamicHeightBelow&&(v.dynamicHeightBelow=s.bottom,s.bottom-=s.specialY.dynamicHeightBelow+a),p.showDebug&&p.showDebug.indexOf("box")>=0&&(s.positionY=v);for(var m=0;m<s.voices.length;m++){var _=l.voices[s.voices[m]];r(v,_,p.spacing)}if(o!==void 0){var k=s.top-10,x=o+k,R=p.spacing.systemStaffSeparation/e.STEP,I=R-x;I>0&&(s.top+=I)}s.top+=p.spacing.staffTopMargin/e.STEP,o=2-s.bottom}},a=1;function n(p,l,o,h){if(p.specialY[o]){var s=p.specialY[o];h&&(s*=h),p.top+=s+a,l[o]=p.top}}function r(p,l,o){var h,s;for(h=0;h<l.children.length;h++)s=l.children[h],i(p,s,o);for(h=0;h<l.otherchildren.length;h++)switch(s=l.otherchildren[h],s.type){case"CrescendoElem":c(p,s);break;case"DynamicDecoration":u(p,s);break;case"EndingElem":f(p,s);break;case"TieElem":var v=s.getYBounds();l.staff.top=Math.max(l.staff.top,v[0]),l.staff.top=Math.max(l.staff.top,v[1]),l.staff.bottom=Math.min(l.staff.bottom,v[0]),l.staff.bottom=Math.min(l.staff.bottom,v[1]);break}}function i(p,l,o){for(var h=0;h<l.children.length;h++){var s=l.children[h];for(var v in l.specialY)l.specialY.hasOwnProperty(v)&&s[v]&&(s.pitch=p[v],s.top===void 0&&(s.type==="TempoElement"?g(p,s):d(p,s,o),l.pushTop(s.top),l.pushBottom(s.bottom)))}}function c(p,l){l.dynamicHeightAbove?l.pitch=p.dynamicHeightAbove:l.pitch=p.dynamicHeightBelow}function u(p,l){l.volumeHeightAbove?l.pitch=p.volumeHeightAbove:l.pitch=p.volumeHeightBelow}function f(p,l){l.pitch=p.endingHeightAbove-2}function g(p,l){if(l.pitch=p.tempoHeightAbove,l.top=p.tempoHeightAbove,l.bottom=p.tempoHeightAbove,l.note){var o=l.pitch-l.totalHeightInPitches+1;l.note.top=o,l.note.bottom=o;for(var h=0;h<l.note.children.length;h++){var s=l.note.children[h];s.top+=o,s.bottom+=o,s.pitch+=o,s.pitch2!==void 0&&(s.pitch2+=o)}}}function d(p,l,o){switch(l.type){case"part":l.top=p.partHeightAbove+l.height,l.bottom=p.partHeightAbove;break;case"text":case"chord":l.chordHeightAbove?(l.top=p.chordHeightAbove,l.bottom=p.chordHeightAbove):(l.top=p.chordHeightBelow,l.bottom=p.chordHeightBelow);break;case"lyric":l.lyricHeightAbove?(l.top=p.lyricHeightAbove,l.bottom=p.lyricHeightAbove):(l.top=p.lyricHeightBelow+o.vocal/e.STEP,l.bottom=p.lyricHeightBelow+o.vocal/e.STEP,l.pitch-=o.vocal/e.STEP);break;case"debug":l.top=p.chordHeightAbove,l.bottom=p.chordHeightAbove;break}(l.pitch===void 0||l.top===void 0)&&console.error("RelativeElement position not set.",l.type,l.pitch,l.top,p)}return $0=t,$0}var Z0,Js;function ev(){if(Js)return Z0;Js=1;var e=function(){};e.beginLayout=function(n,r){r.i=0,r.durationindex=0,r.startx=n,r.minx=n,r.nextx=n,r.spacingduration=0},e.layoutEnded=function(n){return n.i>=n.children.length},e.getNextX=function(n){return Math.max(n.minx,n.nextx)},e.getSpacingUnits=function(n){return Math.sqrt(n.spacingduration*8)},e.layoutOneItem=function(n,r,i,c,u){var f=i.children[i.i];if(!f)return 0;var g=n-i.minx,d=i.durationindex+f.duration>0?c:0;if(f.abcelem.el_type==="note"&&!f.abcelem.rest&&i.voicenumber!==0&&u){var p=u.children[u.i],l=p&&(f.abcelem.maxpitch<=p.abcelem.maxpitch+1&&f.abcelem.maxpitch>=p.abcelem.minpitch-1||f.abcelem.minpitch<=p.abcelem.maxpitch+1&&f.abcelem.minpitch>=p.abcelem.minpitch-1);if(l&&f.abcelem.minpitch===p.abcelem.minpitch&&f.abcelem.maxpitch===p.abcelem.maxpitch&&p.heads&&p.heads.length>0&&f.heads&&f.heads.length>0&&p.heads[0].c===f.heads[0].c&&(l=!1),l){var o=p.heads&&p.heads.length>0?p.heads[0].realWidth:p.fixed.w;f.adjustedWidth||(f.adjustedWidth=o+f.w),f.w=f.adjustedWidth;for(var h=0;h<f.children.length;h++){var s=f.children[h];s.name.indexOf("accidental")<0&&(s.adjustedWidth||(s.adjustedWidth=s.dx+o),s.dx=s.adjustedWidth)}}}var v=t(f,d);return g<v&&(i.i===0||f.type!=="bar"||i.children[i.i-1].type!=="part"&&i.children[i.i-1].type!=="tempo")&&(n+=v-g),f.setX(n),i.spacingduration=f.duration,i.minx=n+a(f),i.i!==i.children.length-1&&(i.minx+=f.minspacing),this.updateNextX(n,r,i),n},e.shiftRight=function(n,r){var i=r.children[r.i];i&&(i.setX(i.x+n),r.minx+=n,r.nextx+=n)},e.updateNextX=function(n,r,i){i.nextx=n+r*this.getSpacingUnits(i)},e.updateIndices=function(n){this.layoutEnded(n)||(n.durationindex+=n.children[n.i].duration,n.children[n.i].type==="bar"&&(n.durationindex=Math.round(n.durationindex*64)/64),n.i++)};function t(n,r){var i=0;return(n.type==="note"||n.type==="bar")&&(i=r),-n.extraw+i}function a(n){return n.w}return Z0=e,Z0}var G0,Qs;function tv(){if(Qs)return G0;Qs=1;var e=ev();function t(c){for(var u=0,f=0;f<c.length;f++){var g=c[f];if(g.children.length>0){var d=g.children.length-1,p=g.children[d];if(p.abcelem.el_type==="bar"){var l=p.children[0].x;l>u?u=l:p.children[0].x=u}}}}var a=function(c,u,f,g,d){var p=1e-7,l=0,o=1e3,h=d;g.startx=h;var s,v=0;for(f&&console.log("init layout",c),s=0;s<g.voices.length;s++)e.beginLayout(h,g.voices[s]);for(var y=0;!n(g.voices);){for(v=null,s=0;s<g.voices.length;s++)!e.layoutEnded(g.voices[s])&&(!v||r(g.voices[s])<v)&&(v=r(g.voices[s]));var m=[],_=[];for(s=0;s<g.voices.length;s++){var k=r(g.voices[s]);k-v>p?_.push(g.voices[s]):m.push(g.voices[s])}y=0;var x=0;for(s=0;s<m.length;s++)e.getNextX(m[s])>h&&(h=e.getNextX(m[s]),y=e.getSpacingUnits(m[s]),x=m[s].spacingduration);l+=y,o=Math.min(o,y),f&&console.log("currentduration: ",v,l,o);var R=void 0;for(s=0;s<m.length;s++){var I=m[s];I.voicenumber===0&&(R=s);var b=R!==void 0&&m[R].voicenumber!==I.voicenumber?m[R]:void 0;i(I,b)||(b=void 0);var A=e.layoutOneItem(h,c,I,u,b),N=A-h;if(N>0){h=A;for(var M=0;M<s;M++)e.shiftRight(N,m[M])}}for(s=0;s<_.length;s++)_[s].spacingduration-=x,e.updateNextX(h,c,_[s]);for(s=0;s<m.length;s++){var z=m[s];e.updateIndices(z)}}for(s=0;s<g.voices.length;s++)e.getNextX(g.voices[s])>h&&(h=e.getNextX(g.voices[s]),y=e.getSpacingUnits(g.voices[s]));return t(g.voices),l+=y,g.setWidth(h),{spacingUnits:l,minSpace:o}};function n(c){for(var u=0;u<c.length;u++)if(!e.layoutEnded(c[u]))return!1;return!0}function r(c){return c.durationindex-(c.children[c.i]&&c.children[c.i].duration>0?0:5e-7)}function i(c,u){return!c||!c.staff||!c.staff.voices||c.staff.voices.length===0||!u||!u.staff||!u.staff.voices||u.staff.voices.length===0?!1:c.staff.voices[0]===u.staff.voices[0]}return G0=a,G0}var U0,eo;function Ll(){if(eo)return U0;eo=1;function e(r,i,c,u,f){var g=r.padding.left,d=0,p,l;for(p=0;p<c.length;p++)c[p].header&&(l=i.calc(c[p].header,"voicefont",""),d=Math.max(d,l.width));if(d=t(d,u,i),d=t(d,f,i),d){var o=i.calc("A","voicefont","");d+=o.width}g+=d;var h=0;return h=a(u,g,h),h=a(f,g,h),g+h}function t(r,i,c){if(i){for(var u=0;u<i.length;u++)if(i[u].header){var f=c.calc(i[u].header,"voicefont","");r=Math.max(r,f.width)}}return r}function a(r,i,c){if(r)for(var u=0;u<r.length;u++)n(i,r[u]),c=Math.max(c,r[u].getWidth());return c}function n(r,i){i.x=r}return U0=e,U0}var j0,to;function rv(){if(to)return j0;to=1;var e=Ll();function t(n,r,i){var c=e(n,r.getTextSize,r.voices,r.brace,r.bracket),u=a(r,i.minPadding),f=u.totalDuration,g=u.minSpacing,d=g*f;i.minWidth&&(d=Math.max(d,i.minWidth));var p=i.minPadding?i.minPadding/2:2;r.startx=c,r.w=d+c;for(var l=0;l<r.voices.length;l++){var o=r.voices[l];o.startx=c,o.w=d+c;for(var h=c,s=!1,v=0,y=0;y<o.children.length;y++){var m=o.children[y];s||(m.duration!==0?(s=!0,v=(d+c-h)/f,r.gridStart=h):(m.x=h,h+=m.w+m.minspacing)),s&&(i.align==="center"?m.x=h+m.duration*v/2-m.w/2:m.duration===0?m.x=h+1-m.w:m.x=h+p-m.extraw,h+=m.duration*v);for(var _=0;_<m.children.length;_++){var k=m.children[_],x=k.dx?k.dx:0;k.x=m.x+x}}r.gridEnd=h}return d}function a(n,r){for(var i=0,c=0,u=0;u<n.voices.length;u++){for(var f=0,g=n.voices[u],d=0;d<g.children.length;d++){var p=g.children[d];if(f+=p.duration,p.duration){var l=(p.w+r)/p.duration;i=Math.max(i,l)}}c=Math.max(c,f)}return{totalDuration:c,minSpacing:i}}return j0=t,j0}var Y0,ro;function nv(){if(ro)return Y0;ro=1;var e=Jg(),t=Qg(),a=tv(),n=Ll(),r=rv(),i=function(g,d,p,l,o,h){var s,v,y=p;for(s=0;s<d.lines.length;s++)if(v=d.lines[s],v.staff){var m;h!==void 0?m=r(g,v.staffGroup,h):m=c(g,y,l,v.staffGroup,d.formatting,s===d.lines.length-1,!1),Math.round(m)>Math.round(y)&&(y=m,o&&(s=-1))}for(s=0;s<d.lines.length;s++)if(v=d.lines[s],v.staffGroup&&v.staffGroup.voices){for(var _=0;_<v.staffGroup.voices.length;_++)e(v.staffGroup.voices[_]);t(g,v.staffGroup)}for(s=0;s<d.lines.length;s++)v=d.lines[s],v.staffGroup&&v.staffGroup.setHeight();return y},c=function(g,d,p,l,o,h,s){for(var v=n(g,l.getTextSize,l.voices,l.brace,l.bracket),y=p,m=0;m<8;m++){var _=a(y,g.minPadding,s,l,v);if(y=u(h,o.stretchlast,d+g.padding.left,l.w,y,_.spacingUnits,_.minSpace,g.padding.left+g.padding.right),y===null)break}return f(l.voices),l.w-v};function u(g,d,p,l,o,h,s,v){if(g)if(d===void 0){if(l/p<.66)return null}else{var y=1-(l+v)/p,m=y<d;if(!m)return null}if(Math.abs(p-l)<2)return null;var _=h*o,k=l-_;return h>0?(o=(p-k)/h,o*s>50&&(o=50/s),o):null}function f(g){for(var d=0;d<g.length;d++)for(var p=g[d],l=1;l<p.children.length-1;l++){var o=p.children[l];if(o.abcelem.rest&&(o.abcelem.rest.type==="whole"||o.abcelem.rest.type==="multimeasure")){var h=p.children[l-1],s=p.children[l+1];o.center(h,s)}}}return Y0=i,Y0}var W0,no;function av(){if(no)return W0;no=1;var e=function(a){this.shouldAddClasses=a.shouldAddClasses,this.reset()};return e.prototype.reset=function(){this.lineNumber=null,this.voiceNumber=null,this.measureNumber=null,this.measureTotalPerLine=[],this.noteNumber=null},e.prototype.incrLine=function(){this.lineNumber===null?this.lineNumber=0:this.lineNumber++,this.voiceNumber=null,this.measureNumber=null,this.noteNumber=null},e.prototype.incrVoice=function(){this.voiceNumber===null?this.voiceNumber=0:this.voiceNumber++,this.measureNumber=null,this.noteNumber=null},e.prototype.isInMeasure=function(){return this.measureNumber!==null},e.prototype.newMeasure=function(){this.measureNumber&&(this.measureTotalPerLine[this.lineNumber]=this.measureNumber),this.measureNumber=null,this.noteNumber=null},e.prototype.startMeasure=function(){this.measureNumber=0,this.noteNumber=0},e.prototype.incrMeasure=function(){this.measureNumber++,this.noteNumber=0},e.prototype.incrNote=function(){this.noteNumber++},e.prototype.measureTotal=function(){for(var t=0,a=0;a<this.lineNumber;a++)t+=this.measureTotalPerLine[a]?this.measureTotalPerLine[a]:0;return this.measureNumber&&(t+=this.measureNumber),t},e.prototype.getCurrent=function(t){return{line:this.lineNumber,measure:this.measureNumber,measureTotal:this.measureTotal(),voice:this.voiceNumber,note:this.noteNumber}},e.prototype.generate=function(t){if(!this.shouldAddClasses)return"";var a=[];if(t&&t.length>0&&a.push(t),t==="abcjs-tab-number")return a.join(" ");if(t==="text instrument-name")return"abcjs-text abcjs-instrument-name";if(this.lineNumber!==null&&a.push("l"+this.lineNumber),this.measureNumber!==null&&a.push("m"+this.measureNumber),this.measureNumber!==null&&a.push("mm"+this.measureTotal()),this.voiceNumber!==null&&a.push("v"+this.voiceNumber),t&&(t.indexOf("note")>=0||t.indexOf("rest")>=0||t.indexOf("lyric")>=0)&&this.noteNumber!==null&&a.push("n"+this.noteNumber),a.length>0){a=a.join(" "),a=a.split(" ");for(var n=0;n<a.length;n++)a[n].indexOf("abcjs-")!==0&&a[n].length>0&&(a[n]="abcjs-"+a[n])}return a.join(" ")},W0=e,W0}var V0,ao;function iv(){if(ao)return V0;ao=1;var e=function(a,n){this.formatting=a,this.classes=n};return e.prototype.updateFonts=function(t){t.gchordfont&&(this.formatting.gchordfont=t.gchordfont),t.tripletfont&&(this.formatting.tripletfont=t.tripletfont),t.annotationfont&&(this.formatting.annotationfont=t.annotationfont),t.vocalfont&&(this.formatting.vocalfont=t.vocalfont)},e.prototype.getFamily=function(t){return t[0]==='"'&&t[t.length-1]==='"'?t.substring(1,t.length-1):t},e.prototype.calc=function(t,a){var n;typeof t=="string"?(n=this.formatting[t],n?n={face:n.face,size:Math.round(n.size*4/3),decoration:n.decoration,style:n.style,weight:n.weight,box:n.box}:n={face:"Arial",size:Math.round(48/3),decoration:"underline",style:"normal",weight:"normal"}):n={face:t.face,size:Math.round(t.size*4/3),decoration:t.decoration,style:t.style,weight:t.weight,box:t.box};var r=this.formatting.fontboxpadding?this.formatting.fontboxpadding:.1;n.padding=n.size*r;var i={"font-size":n.size,"font-style":n.style,"font-family":this.getFamily(n.face),"font-weight":n.weight,"text-decoration":n.decoration,class:this.classes.generate(a)};return{font:n,attr:i}},V0=e,V0}var X0,io;function sv(){if(io)return X0;io=1;var e=function(a,n){this.getFontAndAttr=a,this.svg=n};return e.prototype.updateFonts=function(t){this.getFontAndAttr.updateFonts(t)},e.prototype.attr=function(t,a){return this.getFontAndAttr.calc(t,a)},e.prototype.getFamily=function(t){return t[0]==='"'&&t[t.length-1]==='"'?t.substring(1,t.length-1):t},e.prototype.calc=function(t,a,n,r){var i;typeof a=="string"?i=this.attr(a,n):i={font:{face:a.face,size:a.size,decoration:a.decoration,style:a.style,weight:a.weight},attr:{"font-size":a.size,"font-style":a.style,"font-family":this.getFamily(a.face),"font-weight":a.weight,"text-decoration":a.decoration,class:this.getFontAndAttr.classes.generate(n)}};var c=this.svg.getTextSize(t,i.attr,r);return i.font.box?{height:c.height+i.font.padding*4,width:c.width+i.font.padding*4}:c},e.prototype.baselineToCenter=function(t,a,n,r,i){var c=this.calc(t,a,n).height,u=this.attr(a,n).font.size;return c*.5+(i-r-2)*u},X0=e,X0}var K0,so;function _t(){if(so)return K0;so=1;var e=function(){for(var t=0,a,n=arguments[t++],r=[],i,c,u,f;n;){if(i=/^[^\x25]+/.exec(n))r.push(i[0]);else if(i=/^\x25{2}/.exec(n))r.push("%");else if(i=/^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(n)){if((a=arguments[i[1]||t++])==null||a==null)throw"Too few arguments.";if(/[^s]/.test(i[7])&&typeof a!="number")throw"Expecting number but found "+typeof a;switch(i[7]){case"b":a=a.toString(2);break;case"c":a=String.fromCharCode(a);break;case"d":a=parseInt(a);break;case"e":a=i[6]?a.toExponential(i[6]):a.toExponential();break;case"f":a=i[6]?parseFloat(a).toFixed(i[6]):parseFloat(a);break;case"o":a=a.toString(8);break;case"s":a=(a=String(a))&&i[6]?a.substring(0,i[6]):a;break;case"u":a=Math.abs(a);break;case"x":a=a.toString(16);break;case"X":a=a.toString(16).toUpperCase();break}a=/[def]/.test(i[7])&&i[2]&&a>0?"+"+a:a,u=i[3]?i[3]=="0"?"0":i[3][1]:" ",f=i[5]-String(a).length,c=i[5]?str_repeat(u,f):"",r.push(i[4]?a+c:c+a)}else throw"Huh ?!";n=n.substring(i[0].length)}return r.join("")};return K0=e,K0}var J0,oo;function it(){if(oo)return J0;oo=1;function e(t){return parseFloat(t.toFixed(2))}return J0=e,J0}var Q0,co;function gt(){if(co)return Q0;co=1;var e=it();function t(a,n,r){var i=n.y;if(n.phrases){var g=a.paper.richTextLine(n.phrases,n.x,n.y,n.klass,n.anchor);return g}if(n.lane){var c=n.dim.font.size*.25;i+=(n.dim.font.size+c)*n.lane}var u;n.dim?(u=n.dim,u.attr.class=n.klass):u=a.controller.getFontAndAttr.calc(n.type,n.klass),n.anchor&&(u.attr["text-anchor"]=n.anchor),n["dominant-baseline"]&&(u.attr["dominant-baseline"]=n["dominant-baseline"]),u.attr.x=n.x,u.attr.y=i,n.centerVertically||(u.attr.y+=u.font.size),n.type==="debugfont"&&(console.log("Debug msg: "+n.text),u.attr.stroke="#ff0000"),n.cursor&&(u.attr.cursor=n.cursor);var f;n.name==="free-text"?f=n.text.replace(/^[ \t]*\n/gm,`
|
|
118
|
+
`&&c--,!a.noMove){var u=i.height*1.1*c;t.push({move:Math.round(u)}),a.marginBottom&&t.push({move:a.marginBottom})}}}return In=e,In}var Rn,$s;function ql(){if($s)return Rn;$s=1;const e=Ua();function t(a,n,r,i,c,u,f,g){var d=g.calc("i",r,i);if(n==="")a.push({move:d.height});else{if(typeof n=="string"){e(a,{marginLeft:u,text:n,font:r,klass:i,marginTop:f.marginTop,anchor:f.anchor,absElemType:f.absElemType,info:f.info,name:c},g);return}f.marginTop&&a.push({move:f.marginTop});var p=0,l={left:u,anchor:f.anchor,phrases:[]};i&&(l.klass=i),a.push(l);for(var o=0;o<n.length;o++){var h=n[o],s=h.font?h.font:g.attr(r,i).font,v={content:h.text};s&&(v.attrs={"font-family":g.getFamily(s.face),"font-size":s.size,"font-weight":s.weight,"font-style":s.style,"font-decoration":s.decoration}),l.phrases.push(v);var y=g.calc(h.text,s,i);p=Math.max(p,y.height),h.text[h.text.length-1]===" "&&d.width}a.push({move:p})}}return Rn=t,Rn}var qn,Zs;function Yg(){if(Zs)return qn;Zs=1;const e=Ua(),t=ql();function a(n,r,i,c,u,f,g,d,p,l){if(this.rows=[],n.header&&f){var o=l.calc("X","headerfont","abcjs-header abcjs-meta-top").height;e(this.rows,{marginLeft:g,text:n.header.left,font:"headerfont",klass:"header meta-top",marginTop:-o,info:r.header,name:"header"},l),e(this.rows,{marginLeft:g+u/2,text:n.header.center,font:"headerfont",klass:"header meta-top",marginTop:-o,anchor:"middle",info:r.header,name:"header"},l),e(this.rows,{marginLeft:g+u,text:n.header.right,font:"headerfont",klass:"header meta-top",marginTop:-o,anchor:"end",info:r.header,name:"header"},l)}f&&this.rows.push({move:d.top});var h=i.titleleft?"start":"middle",s=i.titleleft?g:g+u/2;if(n.title){var v=p?"abcjs-title":"";t(this.rows,n.title,"titlefont",v,"title",s,{marginTop:d.title,anchor:h,absElemType:"title",info:r.title},l)}if(c.length)for(var y=0;y<c.length&&c[y].subtitle;){var v=p?"abcjs-text abcjs-subtitle":"";t(this.rows,c[y].subtitle.text,"subtitlefont",v,"subtitle",s,{marginTop:d.subtitle,anchor:h,absElemType:"subtitle",info:c[y].subtitle},l),y++}if(n.rhythm||n.origin||n.composer){if(this.rows.push({move:d.composer}),n.rhythm&&n.rhythm.length>0){var m=!!(n.composer||n.origin),v=p?"abcjs-rhythm":"";e(this.rows,{marginLeft:g,text:n.rhythm,font:"infofont",klass:v,absElemType:"rhythm",noMove:m,info:r.rhythm,name:"rhythm"},l)}n.composer&&n.composer,n.origin&&n.origin;var _=n.composer?n.composer:"";if(n.origin&&(typeof _=="string"&&typeof n.origin=="string"?_+=" ("+n.origin+")":typeof _=="string"&&typeof n.origin!="string"?(_=[{text:_}],_.push({text:" ("}),_=_.concat(n.origin),_.push({text:")"})):(_.push({text:" ("}),_=_.concat(n.origin),_.push({text:")"}))),_){var v=p?"abcjs-composer":"";t(this.rows,_,"composerfont",v,"composer",g+u,{anchor:"end",absElemType:"composer",info:r.composer,ingroup:!0},l)}}if(n.author&&n.author.length>0){var v=p?"abcjs-author":"";t(this.rows,n.author,"composerfont",v,"author",g+u,{anchor:"end",absElemType:"author",info:r.author},l)}if(n.partOrder&&n.partOrder.length>0){var v=p?"abcjs-part-order":"";t(this.rows,n.partOrder,"partsfont",v,"part-order",g,{absElemType:"partOrder",info:r.partOrder,anchor:"start"},l)}}return qn=a,qn}var Bn,Gs;function Wg(){if(Gs)return Bn;Gs=1;const e=Ua(),t=ql();function a(i,c,u,f,g,d,p){this.rows=[],i.unalignedWords&&i.unalignedWords.length>0&&this.unalignedWords(i.unalignedWords,f,g,d,p),this.extraText(i,f,g,d,p),i.footer&&u&&this.footer(i.footer,c,f,p)}a.prototype.unalignedWords=function(i,c,u,f,g){var d=f?"abcjs-unaligned-words":"",p="wordsfont",l=g.calc("i",p,d);this.rows.push({move:u.words}),r(this.rows,"",i,c,p,"unalignedWords","unalignedWords",d,"unalignedWords",u,f,g),this.rows.push({move:l.height})};function n(i,c,u,f,g,d,p){u&&(c&&(typeof u=="string"?u=c+u:u=[{text:c}].concat(u)),g=d?"abcjs-extra-text "+g:"",t(i,u,"historyfont",g,"description",f,{absElemType:"extraText",anchor:"start"},p))}function r(i,c,u,f,g,d,p,l,o,h,s,v){if(u){l=s?"abcjs-extra-text "+l:"";var y=v.calc("A",g,l);if(typeof u=="string")c&&(u=c+`
|
|
119
|
+
`+u),e(i,{marginLeft:f,text:u,font:g,absElemType:"extraText",name:o,"dominant-baseline":"middle",klass:l},v);else{i.push({startGroup:p,klass:l,name:o}),i.push({move:h.info}),c&&(e(i,{marginLeft:f,text:c,font:g,absElemType:"extraText",name:o,"dominant-baseline":"middle"},v),i.push({move:y.height*3/4}));for(var m=0;m<u.length;m++)t(i,u[m],g,"",o,f,{anchor:"start"},v),m<u.length-1&&typeof u[m]=="string"&&typeof u[m+1]!="string"&&i.push({move:y.height*3/4});i.push({endGroup:p,absElemType:d,startChar:-1,endChar:-1,name:o}),i.push({move:y.height})}}}return a.prototype.extraText=function(i,c,u,f,g){n(this.rows,"Book: ",i.book,c,"abcjs-book",f,g),n(this.rows,"Source: ",i.source,c,"abcjs-source",f,g),n(this.rows,"Discography: ",i.discography,c,"abcjs-discography",f,g),r(this.rows,"Notes:",i.notes,c,"historyfont","extraText","notes","abcjs-notes","description",u,f,g),n(this.rows,"Transcription: ",i.transcription,c,"abcjs-transcription",f,g),r(this.rows,"History:",i.history,c,"historyfont","extraText","history","abcjs-history","description",u,f,g),n(this.rows,"Copyright: ",i["abc-copyright"],c,"abcjs-copyright",f,g),n(this.rows,"Creator: ",i["abc-creator"],c,"abcjs-creator",f,g),n(this.rows,"Edited By: ",i["abc-edited-by"],c,"abcjs-edited-by",f,g)},a.prototype.footer=function(i,c,u,f){var g="header meta-bottom",d="footerfont";this.rows.push({startGroup:"footer",klass:g}),e(this.rows,{marginLeft:u,text:i.left,font:d,klass:g,name:"footer"},f),e(this.rows,{marginLeft:u+c/2,text:i.center,font:d,klass:g,anchor:"middle",name:"footer"},f),e(this.rows,{marginLeft:u+c,text:i.right,font:d,klass:g,anchor:"end",name:"footer"},f)},Bn=a,Bn}var Ln,Us;function Bl(){if(Us)return Ln;Us=1;function e(a,n,r,i){if(a.indexOf(n)===0){var c=a.replace(n,""),u=parseInt(c,10);""+u===c&&(r[i]=u)}}function t(a,n){var r=[];if(a.absEl.elemset){for(var i={},c=0;c<a.absEl.elemset.length;c++){var u=a.absEl.elemset[c];if(u)for(var f=u.getAttribute("class").split(" "),g=0;g<f.length;g++)i[f[g]]=!0}for(var d=0;d<Object.keys(i).length;d++)r.push(Object.keys(i)[d])}for(var p={},l=0;l<r.length;l++)e(r[l],"abcjs-v",p,"voice"),e(r[l],"abcjs-l",p,"line"),e(r[l],"abcjs-m",p,"measure");a.staffPos&&(p.staffPos=a.staffPos);for(var o=n.target;o&&o.dataset&&!o.dataset.name&&o.tagName.toLowerCase()!=="svg";)o=o.parentNode;for(var h=n.target;h&&h.dataset&&!h.dataset.index&&h.tagName.toLowerCase()!=="svg";)h=h.parentNode;return h&&h.dataset&&(p.name=h.dataset.name,p.clickedName=o.dataset.name,p.parentClasses=h.classList),o&&o.classList&&(p.clickedClasses=o.classList),p.selectableElement=a.svgEl,{classes:r,analysis:p}}return Ln=t,Ln}var On,js;function Vg(){if(js)return On;js=1;var e=Ve(),t=Bl();function a(b,A){if(b.rangeHighlight=_,b.dragging)for(var N=0;N<b.selectables.length;N++){var M=b.selectables[N];M.svgEl.getAttribute("selectable")==="true"&&(M.svgEl.setAttribute("tabindex",0),M.svgEl.setAttribute("data-index",N),M.svgEl.addEventListener("keydown",i.bind(b)),M.svgEl.addEventListener("keyup",c.bind(b)),M.svgEl.addEventListener("focus",r.bind(b)))}for(var z=0;z<A.length;z++)A[z].addEventListener("touchstart",o.bind(b),{passive:!0}),A[z].addEventListener("touchmove",h.bind(b),{passive:!0}),A[z].addEventListener("touchend",s.bind(b),{passive:!0}),A[z].addEventListener("mousedown",o.bind(b)),A[z].addEventListener("mousemove",h.bind(b)),A[z].addEventListener("mouseup",s.bind(b))}function n(b){var A=1,N=1,M=b.target.closest("svg"),z=0;M&&M.viewBox&&M.viewBox.baseVal&&(M.viewBox.baseVal.width!==0&&(A=M.viewBox.baseVal.width/M.clientWidth),M.viewBox.baseVal.height!==0&&(N=M.viewBox.baseVal.height/M.clientHeight),z=M.viewBox.baseVal.y);var L=b.target&&b.target.tagName==="svg",E,T;return L?(E=b.offsetX,T=b.offsetY):(E=b.layerX,T=b.layerY),E=E*A,T=T*N,[E,T+z]}function r(b){this.dragMechanism==="keyboard"&&this.dragYStep!==0&&this.dragTarget&&y.bind(this)(this.dragTarget,this.dragYStep,this.selectables.length,this.dragIndex,b),this.dragYStep=0}function i(b){switch(b.keyCode){case 38:case 40:b.preventDefault()}}function c(b){var A=!1,N=b.target.dataset.index;switch(b.keyCode){case 13:case 32:A=!0,this.dragTarget=this.selectables[N],this.dragIndex=N,this.dragMechanism="keyboard",s.bind(this)(b);break;case 38:A=!0,this.dragTarget=this.selectables[N],this.dragIndex=N,this.dragTarget&&this.dragTarget.isDraggable&&(this.dragging&&this.dragTarget.isDraggable&&this.dragTarget.absEl.highlight(void 0,this.dragColor),this.dragYStep--,this.dragTarget.svgEl.setAttribute("transform","translate(0,"+this.dragYStep*e.STEP+")"));break;case 40:A=!0,this.dragTarget=this.selectables[N],this.dragIndex=N,this.dragMechanism="keyboard",this.dragTarget&&this.dragTarget.isDraggable&&(this.dragging&&this.dragTarget.isDraggable&&this.dragTarget.absEl.highlight(void 0,this.dragColor),this.dragYStep++,this.dragTarget.svgEl.setAttribute("transform","translate(0,"+this.dragYStep*e.STEP+")"));break;case 9:this.dragYStep!==0&&s.bind(this)(b);break}A&&b.preventDefault()}function u(b,A){if(!A)return-1;var N=A.dataset;if(!N)return-1;for(var M=N.index,z=0;z<b.length;z++){var L=b[z].svgEl.dataset;if(L&&M===L.index)return z}return-1}function f(b,A,N){for(var M=9999999,z=-1,L=0;L<b.selectables.length&&M>0;L++){var E=b.selectables[L];if(b.getDim(E),E.dim.left<A&&E.dim.right>A&&E.dim.top<N&&E.dim.bottom>N)z=L,M=0;else if(E.dim.top<N&&E.dim.bottom>N){var T=Math.min(Math.abs(E.dim.left-A),Math.abs(E.dim.right-A));T<M&&(M=T,z=L)}else if(E.dim.left<A&&E.dim.right>A){var P=Math.min(Math.abs(E.dim.top-N),Math.abs(E.dim.bottom-N));P<M&&(M=P,z=L)}else{var B=Math.abs(A-E.dim.left)>Math.abs(A-E.dim.right)?Math.abs(A-E.dim.right):Math.abs(A-E.dim.left),O=Math.abs(N-E.dim.top)>Math.abs(N-E.dim.bottom)?Math.abs(N-E.dim.bottom):Math.abs(N-E.dim.top),w=Math.sqrt(B*B+O*O);w<M&&(M=w,z=L)}}return z>=0&&M<=12?z:-1}function g(b,A,N){if(b.x<=A.offsetX&&b.x+b.width>=A.offsetX&&b.y<=A.offsetY&&b.y+b.height>=A.offsetY)return[A.offsetX,A.offsetY];var M=Math.abs(A.layerY/N-A.offsetY);return M<3?[A.offsetX,A.offsetY]:[A.layerX,A.layerY]}function d(b){if(!b)return null;if(b.tagName==="svg")return b;if(!b.getAttribute)return null;for(var A=b.getAttribute("selectable");!A;)b.parentElement?(b=b.parentElement,b.tagName==="svg"?A=!0:A=b.getAttribute("selectable")):A=!0;return b}function p(b,A){var N,M,z,L=u(b.selectables,d(A.target));return L>=0?(z=g(b.selectables[L].svgEl.getBBox(),A,b.scale),N=z[0],M=z[1]):(z=n(A),N=z[0],M=z[1],L=f(b,N,M)),{x:N,y:M,clickedOn:L}}function l(b){if(!(!b||!b.target||!b.touches||b.touches.length<1)){var A=b.target.getBoundingClientRect(),N=b.touches[0].pageX-A.left,M=b.touches[0].pageY-A.top;b.touches[0].offsetX=N,b.touches[0].offsetY=M,b.touches[0].layerX=b.touches[0].pageX,b.touches[0].layerY=b.touches[0].pageY}}function o(b){var A=b;b.type==="touchstart"&&(l(b),b.touches.length>0&&(A=b.touches[0]));var N=p(this,A);N.clickedOn>=0&&(b.type==="touchstart"||b.button===0)&&this.selectables[N.clickedOn]&&(this.dragTarget=this.selectables[N.clickedOn],this.dragIndex=N.clickedOn,this.dragMechanism="mouse",this.dragMouseStart={x:N.x,y:N.y},this.dragging&&this.dragTarget.isDraggable&&(R(this.renderer.paper,"abcjs-dragging-in-progress"),this.dragTarget.absEl.highlight(void 0,this.dragColor)))}function h(b){var A=b;if(b.type==="touchmove"&&(l(b),b.touches.length>0&&(A=b.touches[0])),this.lastTouchMove=b,!(!this.dragTarget||!this.dragging||!this.dragTarget.isDraggable||this.dragMechanism!=="mouse"||!this.dragMouseStart)){var N=p(this,A),M=Math.round((N.y-this.dragMouseStart.y)/e.STEP);M!==this.dragYStep&&(this.dragYStep=M,this.dragTarget.svgEl.setAttribute("transform","translate(0,"+M*e.STEP+")"))}}function s(b){var A=b;b.type==="touchend"&&this.lastTouchMove&&(l(this.lastTouchMove),this.lastTouchMove&&this.lastTouchMove.touches&&this.lastTouchMove.touches.length>0&&(A=this.lastTouchMove.touches[0])),this.dragTarget&&(m.bind(this)(),this.dragTarget.absEl&&this.dragTarget.absEl.highlight&&(this.selected=[this.dragTarget.absEl],this.dragTarget.absEl.highlight(void 0,this.selectionColor)),y.bind(this)(this.dragTarget,this.dragYStep,this.selectables.length,this.dragIndex,A),this.dragTarget.svgEl&&this.dragTarget.svgEl.focus&&(this.dragTarget.svgEl.focus(),this.dragTarget=null,this.dragIndex=-1),I(this.renderer.svg,"abcjs-dragging-in-progress"))}function v(b){b>=0&&b<this.selectables.length&&(this.dragTarget=this.selectables[b],this.dragIndex=b,this.dragMechanism="keyboard",s.bind(this)({target:this.dragTarget.svgEl}))}function y(b,A,N,M,z){for(var L=t(b,z),E=L.classes,T=L.analysis,P=0;P<this.listeners.length;P++)this.listeners[P](b.absEl.abcelem,b.absEl.tuneNumber,E.join(" "),T,{step:A,max:N,index:M,setSelection:v.bind(this)},z)}function m(){for(var b=0;b<this.selected.length;b++)this.selected[b].unhighlight(void 0,this.renderer.foregroundColor);this.selected=[]}function _(b,A){m.bind(this)();for(var N=0;N<this.staffgroups.length;N++)for(var M=this.staffgroups[N].voices,z=0;z<M.length;z++)for(var L=M[z].children,E=0;E<L.length;E++){var T=L[E].abcelem.startChar,P=L[E].abcelem.endChar;(A>T&&b<P||A===b&&A===P)&&(this.selected[this.selected.length]=L[E],L[E].highlight(void 0,this.selectionColor))}}function k(b){var A=b.getAttribute("class");A||(A="");for(var N=A.split(" "),M={},z=0;z<N.length;z++)M[N[z]]=!0;return M}function x(b,A){var N=[];for(var M in A)A.hasOwnProperty(M)&&N.push(M);b.setAttribute("class",N.join(" "))}function R(b,A){if(b){var N=k(b.svg);N[A]=!0,x(b.svg,N)}}function I(b,A){if(b){var N=k(b.svg);delete N[A],x(b.svg,N)}}return On=a,On}var Dn,Ys;function ja(){if(Ys)return Dn;Ys=1;function e(t,a,n,r,i){return a+(r-a)/(n-t)*(i-t)}return Dn=e,Dn}var Fn,Ws;function Xg(){if(Ws)return Fn;Ws=1;var e=at(),t=Ve(),a=ja(),n=function(l){if(!(l.elems.length===0||l.allrests)){var o=u(l.stemsUp,l.isgrace),h=l.elems[0],s=l.elems[l.elems.length-1],v=0,y=l.stemsUp?h.abcelem.maxpitch:h.abcelem.minpitch;v=i(h,l.stemsUp,y,v),v=i(s,l.stemsUp,y,v),v=Math.max(l.stemHeight,v+3);var m=g(l.average,l.elems.length,v,l.stemsUp,h.abcelem.averagepitch,s.abcelem.averagepitch,l.isflat,l.min,l.max,l.isgrace),_=f(l.stemsUp,h,s);l.addBeam({startX:_[0],endX:_[1],startY:m[0],endY:m[1],dy:o});for(var k=p(l.elems,l.stemsUp,l.beams[0],l.isgrace,o),x=0;x<k.length;x++)l.addBeam(k[x]);d(l.elems,l.stemsUp,l.beams[0],o,l.mainNote)}},r=function(l){return l===void 0?0:Math.floor(Math.log(l)/Math.log(2))};function i(l,o,h,s){if(!l.children)return s;for(var v=0;v<l.children.length;v++){var y=l.children[v];o&&y.top!==void 0&&y.c==="flags.ugrace"?s=Math.max(s,y.top-h):!o&&y.bottom!==void 0&&y.c==="flags.ugrace"&&(s=Math.max(s,h-y.bottom+7))}return s}function c(l,o,h,s){if(s)return 0;var v=l-o,y=h/2;return v>y&&(v=y),v<-y&&(v=-y),v}function u(l,o){var h=l?t.STEP:-t.STEP;return o&&(h=h*.4),h}function f(l,o,h){var s=o.heads[l?0:o.heads.length-1],v=h.heads[l?0:h.heads.length-1],y=s.x;l&&(y+=s.w-.6);var m=v.x;return m+=l?v.w:.6,[y,m]}function g(l,o,h,s,v,y,m,_,k,x){var R=h-2,I=h-2,b=Math.round(s?Math.max(l+R,k+I):Math.min(l-R,_-I)),A=c(v,y,o,m),N=b+Math.floor(A/2),M=b+Math.floor(-A/2);return x||(s&&b<6||!s&&b>6)&&(N=6,M=6),[N,M]}function d(l,o,h,s,v){for(var y=0;y<l.length;y++){var m=l[y];if(!m.abcelem.rest){var _=!m.addExtra,k=_?v:m,x=m.heads[o?0:m.heads.length-1],R=1/5,I=x.pitch+(o?R:-R),b=o?x.w:0;_||(b+=x.dx);var A=x.x+b,N=a(h.startX,h.startY,h.endX,h.endY,A),M=o?-.6:.6;o||(N-=s/2/t.STEP),_&&(b+=m.heads[0].dx),x.c==="noteheads.slash.quarter"&&(o?I+=1:I-=1);var z=new e(null,b,0,I,{type:"stem",pitch2:N,linewidth:M});z.setX(k.x),k.addRight(z)}}}function p(l,o,h,s,v){for(var y=[],m=[],_=0;_<l.length;_++){var k=l[_];if(!k.abcelem.rest){var x=k.heads[o?0:k.heads.length-1],R=x.x+(o?x.w:0),I=a(h.startX,h.startY,h.endX,h.endY,R),b=o?-1.5:1.5;s&&(b=b*2/3);var A=k.abcelem.duration;A===0&&(A=.25);for(var N=r(A);N<-3;N++){var M=-4-N;if(m[M]?m[M].single=!1:m[M]={x:R+(o?-.6:0),y:I+b*(M+1),durlog:N,single:!0},_>0&&k.abcelem.beambr&&k.abcelem.beambr<=M+1){m[M].split||(m[M].split=[m[M].x]);var z=f(o,l[_-1],k);m[M].split[m[M].split.length-1]>=z[0]&&(z[0]+=k.w),m[M].split.push(z[0]),m[M].split.push(z[1])}}for(var L=m.length-1;L>=0;L--)if(_===l.length-1||r(l[_+1].abcelem.duration)>-L-4){var E=R,T=I+b*(L+1);m[L].single&&(_===0?E=R+5:_===l.length-1?E=R-5:l[_-1].duration===l[_+1].duration?E=_%2===0?R+5:R-5:E=l[_-1].duration>l[_+1].duration?R+5:R-5,T=a(h.startX,h.startY,h.endX,h.endY,E)+b*(L+1));var P={startX:m[L].x,endX:E,startY:m[L].y,endY:T,dy:v};if(m[L].split!==void 0){var B=m[L].split;P.endX<=B[B.length-1]&&(B[B.length-1]-=k.w),B.push(P.endX),P.split=m[L].split}y.push(P),m=m.slice(0,L)}}}return y}return Fn=n,Fn}var Hn,Vs;function Kg(){if(Vs)return Hn;Vs=1;var e=ja();function t(i){if(i.anchor1&&i.anchor2){i.hasBeam=!!i.anchor1.parent.beam&&i.anchor1.parent.beam===i.anchor2.parent.beam;var c=i.anchor1.parent.beam;if(i.hasBeam&&(c.elems[0]!==i.anchor1.parent||c.elems[c.elems.length-1]!==i.anchor2.parent)&&(i.hasBeam=!1),i.hasBeam){var u=a(c)?i.anchor1.x+i.anchor1.w:i.anchor1.x;i.yTextPos=n(u,i.anchor2.x,c),i.yTextPos+=a(c)?3:-2,i.xTextPos=r(u,i.anchor2.x),i.top=i.yTextPos+1,i.bottom=i.yTextPos-2,a(c)&&(i.endingHeightAbove=4)}else{i.startNote=Math.max(i.anchor1.parent.top,9)+4,i.endNote=Math.max(i.anchor2.parent.top,9)+4,i.anchor1.parent.type==="rest"&&i.anchor2.parent.type!=="rest"?i.startNote=i.endNote:i.anchor2.parent.type==="rest"&&i.anchor1.parent.type!=="rest"&&(i.endNote=i.startNote);for(var f=0,g=0;g<i.middleElems.length;g++)f=Math.max(f,i.middleElems[g].top);f+=4,(f>i.startNote||f>i.endNote)&&(i.startNote=f,i.endNote=f),i.flatBeams&&(i.startNote=Math.max(i.startNote,i.endNote),i.endNote=Math.max(i.startNote,i.endNote)),i.yTextPos=i.startNote+(i.endNote-i.startNote)/2,i.xTextPos=i.anchor1.x+(i.anchor2.x+i.anchor2.w-i.anchor1.x)/2,i.top=i.yTextPos+1}}delete i.middleElems,delete i.flatBeams}function a(i){return i.stemsUp}function n(i,c,u){if(u.beams.length===0)return 0;u=u.beams[0];var f=i+(c-i)/2;return e(u.startX,u.startY,u.endX,u.endY,f)}function r(i,c){return i+(c-i)/2}return Hn=t,Hn}var $n,Xs;function Jg(){if(Xs)return $n;Xs=1;var e=Xg(),t=ja(),a=Kg(),n=function(d){for(var p=0;p<d.beams.length;p++)if(d.beams[p].type==="BeamElem"){e(d.beams[p]),r(d.beams[p]);for(var l=0;l<d.beams[p].elems.length;l++)d.adjustRange(d.beams[p].elems[l])}for(d.staff.specialY.chordLines=c(d.children),p=0;p<d.otherchildren.length;p++){var o=d.otherchildren[p];o.type==="TripletElem"&&(a(o),d.adjustRange(o))}d.staff.top=Math.max(d.staff.top,d.top),d.staff.bottom=Math.min(d.staff.bottom,d.bottom)};function r(d){for(var p=1.5,l=0;l<d.elems.length;l++){var o=d.elems[l];if(o.top)for(var h=g(o,d),s=0;s<o.children.length;s++){var v=o.children[s];if(v.klass==="ornament"&&v.position!=="below"&&v.bottom-p<h){var y=h-v.bottom+p;v.bottom+=y,v.top+=y,v.pitch+=y,h=o.top=v.top}}}}function i(d,p){var l=p.getChordDim();if(l){for(var o=0;o<d.length;o++){var h=d[o]<l.left;if(h){o>0&&p.putChordInLane(o),d[o]=l.right;return}}d.push(l.right),p.putChordInLane(d.length-1)}}function c(d){var p=[0],l=[0],o,h,s;for(o=0;o<d.length;o++){for(h=0;h<d[o].children.length;h++)s=d[o].children[h],s.chordHeightAbove&&i(p,s);for(h=d[o].children.length-1;h>=0;h--)s=d[o].children[h],s.chordHeightBelow&&i(l,s)}return(p.length>1||l.length>1)&&f(d,p.length,l.length),{above:p.length,below:l.length}}function u(d){for(var p=0,l=0;l<d.children.length;l++){var o=d.children[l];o.chordHeightBelow&&p++}return p}function f(d,p,l){for(var o=0;o<d.length;o++){u(d[o]);for(var h=0;h<d[o].children.length;h++){var s=d[o].children[h];s.chordHeightAbove&&s.invertLane(p)}}}function g(d,p){return p=p.beams[0],t(p.startX,p.startY,p.endX,p.endY,d.x)}return $n=n,$n}var Zn,Ks;function Qg(){if(Ks)return Zn;Ks=1;var e=Ve(),t=function(p,l){for(var o,h=0;h<l.staffs.length;h++){var s=l.staffs[h],v={tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0};if(p.showDebug&&p.showDebug.indexOf("box")>=0&&(s.originalTop=s.top,s.originalBottom=s.bottom),n(s,v,"lyricHeightAbove"),n(s,v,"chordHeightAbove",s.specialY.chordLines.above),s.specialY.endingHeightAbove&&(s.specialY.chordHeightAbove?s.top+=2:s.top+=s.specialY.endingHeightAbove+a,v.endingHeightAbove=s.top),s.specialY.dynamicHeightAbove&&s.specialY.volumeHeightAbove?(s.top+=Math.max(s.specialY.dynamicHeightAbove,s.specialY.volumeHeightAbove)+a,v.dynamicHeightAbove=s.top,v.volumeHeightAbove=s.top):(n(s,v,"dynamicHeightAbove"),n(s,v,"volumeHeightAbove")),n(s,v,"partHeightAbove"),n(s,v,"tempoHeightAbove"),s.specialY.lyricHeightBelow&&(s.specialY.lyricHeightBelow+=p.spacing.vocal/e.STEP,v.lyricHeightBelow=s.bottom,s.bottom-=s.specialY.lyricHeightBelow+a),s.specialY.chordHeightBelow){v.chordHeightBelow=s.bottom;var y=s.specialY.chordHeightBelow;s.specialY.chordLines.below&&(y*=s.specialY.chordLines.below),s.bottom-=y+a}s.specialY.volumeHeightBelow&&s.specialY.dynamicHeightBelow?(v.volumeHeightBelow=s.bottom,v.dynamicHeightBelow=s.bottom,s.bottom-=Math.max(s.specialY.volumeHeightBelow,s.specialY.dynamicHeightBelow)+a):s.specialY.volumeHeightBelow?(v.volumeHeightBelow=s.bottom,s.bottom-=s.specialY.volumeHeightBelow+a):s.specialY.dynamicHeightBelow&&(v.dynamicHeightBelow=s.bottom,s.bottom-=s.specialY.dynamicHeightBelow+a),p.showDebug&&p.showDebug.indexOf("box")>=0&&(s.positionY=v);for(var m=0;m<s.voices.length;m++){var _=l.voices[s.voices[m]];r(v,_,p.spacing)}if(o!==void 0){var k=s.top-10,x=o+k,R=p.spacing.systemStaffSeparation/e.STEP,I=R-x;I>0&&(s.top+=I)}s.top+=p.spacing.staffTopMargin/e.STEP,o=2-s.bottom}},a=1;function n(p,l,o,h){if(p.specialY[o]){var s=p.specialY[o];h&&(s*=h),p.top+=s+a,l[o]=p.top}}function r(p,l,o){var h,s;for(h=0;h<l.children.length;h++)s=l.children[h],i(p,s,o);for(h=0;h<l.otherchildren.length;h++)switch(s=l.otherchildren[h],s.type){case"CrescendoElem":c(p,s);break;case"DynamicDecoration":u(p,s);break;case"EndingElem":f(p,s);break;case"TieElem":var v=s.getYBounds();l.staff.top=Math.max(l.staff.top,v[0]),l.staff.top=Math.max(l.staff.top,v[1]),l.staff.bottom=Math.min(l.staff.bottom,v[0]),l.staff.bottom=Math.min(l.staff.bottom,v[1]);break}}function i(p,l,o){for(var h=0;h<l.children.length;h++){var s=l.children[h];for(var v in l.specialY)l.specialY.hasOwnProperty(v)&&s[v]&&(s.pitch=p[v],s.top===void 0&&(s.type==="TempoElement"?g(p,s):d(p,s,o),l.pushTop(s.top),l.pushBottom(s.bottom)))}}function c(p,l){l.dynamicHeightAbove?l.pitch=p.dynamicHeightAbove:l.pitch=p.dynamicHeightBelow}function u(p,l){l.volumeHeightAbove?l.pitch=p.volumeHeightAbove:l.pitch=p.volumeHeightBelow}function f(p,l){l.pitch=p.endingHeightAbove-2}function g(p,l){if(l.pitch=p.tempoHeightAbove,l.top=p.tempoHeightAbove,l.bottom=p.tempoHeightAbove,l.note){var o=l.pitch-l.totalHeightInPitches+1;l.note.top=o,l.note.bottom=o;for(var h=0;h<l.note.children.length;h++){var s=l.note.children[h];s.top+=o,s.bottom+=o,s.pitch+=o,s.pitch2!==void 0&&(s.pitch2+=o)}}}function d(p,l,o){switch(l.type){case"part":l.top=p.partHeightAbove+l.height,l.bottom=p.partHeightAbove;break;case"text":case"chord":l.chordHeightAbove?(l.top=p.chordHeightAbove,l.bottom=p.chordHeightAbove):(l.top=p.chordHeightBelow,l.bottom=p.chordHeightBelow);break;case"lyric":l.lyricHeightAbove?(l.top=p.lyricHeightAbove,l.bottom=p.lyricHeightAbove):(l.top=p.lyricHeightBelow+o.vocal/e.STEP,l.bottom=p.lyricHeightBelow+o.vocal/e.STEP,l.pitch-=o.vocal/e.STEP);break;case"debug":l.top=p.chordHeightAbove,l.bottom=p.chordHeightAbove;break}(l.pitch===void 0||l.top===void 0)&&console.error("RelativeElement position not set.",l.type,l.pitch,l.top,p)}return Zn=t,Zn}var Gn,Js;function ev(){if(Js)return Gn;Js=1;var e=function(){};e.beginLayout=function(n,r){r.i=0,r.durationindex=0,r.startx=n,r.minx=n,r.nextx=n,r.spacingduration=0},e.layoutEnded=function(n){return n.i>=n.children.length},e.getNextX=function(n){return Math.max(n.minx,n.nextx)},e.getSpacingUnits=function(n){return Math.sqrt(n.spacingduration*8)},e.layoutOneItem=function(n,r,i,c,u){var f=i.children[i.i];if(!f)return 0;var g=n-i.minx,d=i.durationindex+f.duration>0?c:0;if(f.abcelem.el_type==="note"&&!f.abcelem.rest&&i.voicenumber!==0&&u){var p=u.children[u.i],l=p&&(f.abcelem.maxpitch<=p.abcelem.maxpitch+1&&f.abcelem.maxpitch>=p.abcelem.minpitch-1||f.abcelem.minpitch<=p.abcelem.maxpitch+1&&f.abcelem.minpitch>=p.abcelem.minpitch-1);if(l&&f.abcelem.minpitch===p.abcelem.minpitch&&f.abcelem.maxpitch===p.abcelem.maxpitch&&p.heads&&p.heads.length>0&&f.heads&&f.heads.length>0&&p.heads[0].c===f.heads[0].c&&(l=!1),l){var o=p.heads&&p.heads.length>0?p.heads[0].realWidth:p.fixed.w;f.adjustedWidth||(f.adjustedWidth=o+f.w),f.w=f.adjustedWidth;for(var h=0;h<f.children.length;h++){var s=f.children[h];s.name.indexOf("accidental")<0&&(s.adjustedWidth||(s.adjustedWidth=s.dx+o),s.dx=s.adjustedWidth)}}}var v=t(f,d);return g<v&&(i.i===0||f.type!=="bar"||i.children[i.i-1].type!=="part"&&i.children[i.i-1].type!=="tempo")&&(n+=v-g),f.setX(n),i.spacingduration=f.duration,i.minx=n+a(f),i.i!==i.children.length-1&&(i.minx+=f.minspacing),this.updateNextX(n,r,i),n},e.shiftRight=function(n,r){var i=r.children[r.i];i&&(i.setX(i.x+n),r.minx+=n,r.nextx+=n)},e.updateNextX=function(n,r,i){i.nextx=n+r*this.getSpacingUnits(i)},e.updateIndices=function(n){this.layoutEnded(n)||(n.durationindex+=n.children[n.i].duration,n.children[n.i].type==="bar"&&(n.durationindex=Math.round(n.durationindex*64)/64),n.i++)};function t(n,r){var i=0;return(n.type==="note"||n.type==="bar")&&(i=r),-n.extraw+i}function a(n){return n.w}return Gn=e,Gn}var Un,Qs;function tv(){if(Qs)return Un;Qs=1;var e=ev();function t(c){for(var u=0,f=0;f<c.length;f++){var g=c[f];if(g.children.length>0){var d=g.children.length-1,p=g.children[d];if(p.abcelem.el_type==="bar"){var l=p.children[0].x;l>u?u=l:p.children[0].x=u}}}}var a=function(c,u,f,g,d){var p=1e-7,l=0,o=1e3,h=d;g.startx=h;var s,v=0;for(f&&console.log("init layout",c),s=0;s<g.voices.length;s++)e.beginLayout(h,g.voices[s]);for(var y=0;!n(g.voices);){for(v=null,s=0;s<g.voices.length;s++)!e.layoutEnded(g.voices[s])&&(!v||r(g.voices[s])<v)&&(v=r(g.voices[s]));var m=[],_=[];for(s=0;s<g.voices.length;s++){var k=r(g.voices[s]);k-v>p?_.push(g.voices[s]):m.push(g.voices[s])}y=0;var x=0;for(s=0;s<m.length;s++)e.getNextX(m[s])>h&&(h=e.getNextX(m[s]),y=e.getSpacingUnits(m[s]),x=m[s].spacingduration);l+=y,o=Math.min(o,y),f&&console.log("currentduration: ",v,l,o);var R=void 0;for(s=0;s<m.length;s++){var I=m[s];I.voicenumber===0&&(R=s);var b=R!==void 0&&m[R].voicenumber!==I.voicenumber?m[R]:void 0;i(I,b)||(b=void 0);var A=e.layoutOneItem(h,c,I,u,b),N=A-h;if(N>0){h=A;for(var M=0;M<s;M++)e.shiftRight(N,m[M])}}for(s=0;s<_.length;s++)_[s].spacingduration-=x,e.updateNextX(h,c,_[s]);for(s=0;s<m.length;s++){var z=m[s];e.updateIndices(z)}}for(s=0;s<g.voices.length;s++)e.getNextX(g.voices[s])>h&&(h=e.getNextX(g.voices[s]),y=e.getSpacingUnits(g.voices[s]));return t(g.voices),l+=y,g.setWidth(h),{spacingUnits:l,minSpace:o}};function n(c){for(var u=0;u<c.length;u++)if(!e.layoutEnded(c[u]))return!1;return!0}function r(c){return c.durationindex-(c.children[c.i]&&c.children[c.i].duration>0?0:5e-7)}function i(c,u){return!c||!c.staff||!c.staff.voices||c.staff.voices.length===0||!u||!u.staff||!u.staff.voices||u.staff.voices.length===0?!1:c.staff.voices[0]===u.staff.voices[0]}return Un=a,Un}var jn,eo;function Ll(){if(eo)return jn;eo=1;function e(r,i,c,u,f){var g=r.padding.left,d=0,p,l;for(p=0;p<c.length;p++)c[p].header&&(l=i.calc(c[p].header,"voicefont",""),d=Math.max(d,l.width));if(d=t(d,u,i),d=t(d,f,i),d){var o=i.calc("A","voicefont","");d+=o.width}g+=d;var h=0;return h=a(u,g,h),h=a(f,g,h),g+h}function t(r,i,c){if(i){for(var u=0;u<i.length;u++)if(i[u].header){var f=c.calc(i[u].header,"voicefont","");r=Math.max(r,f.width)}}return r}function a(r,i,c){if(r)for(var u=0;u<r.length;u++)n(i,r[u]),c=Math.max(c,r[u].getWidth());return c}function n(r,i){i.x=r}return jn=e,jn}var Yn,to;function rv(){if(to)return Yn;to=1;var e=Ll();function t(n,r,i){var c=e(n,r.getTextSize,r.voices,r.brace,r.bracket),u=a(r,i.minPadding),f=u.totalDuration,g=u.minSpacing,d=g*f;i.minWidth&&(d=Math.max(d,i.minWidth));var p=i.minPadding?i.minPadding/2:2;r.startx=c,r.w=d+c;for(var l=0;l<r.voices.length;l++){var o=r.voices[l];o.startx=c,o.w=d+c;for(var h=c,s=!1,v=0,y=0;y<o.children.length;y++){var m=o.children[y];s||(m.duration!==0?(s=!0,v=(d+c-h)/f,r.gridStart=h):(m.x=h,h+=m.w+m.minspacing)),s&&(i.align==="center"?m.x=h+m.duration*v/2-m.w/2:m.duration===0?m.x=h+1-m.w:m.x=h+p-m.extraw,h+=m.duration*v);for(var _=0;_<m.children.length;_++){var k=m.children[_],x=k.dx?k.dx:0;k.x=m.x+x}}r.gridEnd=h}return d}function a(n,r){for(var i=0,c=0,u=0;u<n.voices.length;u++){for(var f=0,g=n.voices[u],d=0;d<g.children.length;d++){var p=g.children[d];if(f+=p.duration,p.duration){var l=(p.w+r)/p.duration;i=Math.max(i,l)}}c=Math.max(c,f)}return{totalDuration:c,minSpacing:i}}return Yn=t,Yn}var Wn,ro;function nv(){if(ro)return Wn;ro=1;var e=Jg(),t=Qg(),a=tv(),n=Ll(),r=rv(),i=function(g,d,p,l,o,h){var s,v,y=p;for(s=0;s<d.lines.length;s++)if(v=d.lines[s],v.staff){var m;h!==void 0?m=r(g,v.staffGroup,h):m=c(g,y,l,v.staffGroup,d.formatting,s===d.lines.length-1,!1),Math.round(m)>Math.round(y)&&(y=m,o&&(s=-1))}for(s=0;s<d.lines.length;s++)if(v=d.lines[s],v.staffGroup&&v.staffGroup.voices){for(var _=0;_<v.staffGroup.voices.length;_++)e(v.staffGroup.voices[_]);t(g,v.staffGroup)}for(s=0;s<d.lines.length;s++)v=d.lines[s],v.staffGroup&&v.staffGroup.setHeight();return y},c=function(g,d,p,l,o,h,s){for(var v=n(g,l.getTextSize,l.voices,l.brace,l.bracket),y=p,m=0;m<8;m++){var _=a(y,g.minPadding,s,l,v);if(y=u(h,o.stretchlast,d+g.padding.left,l.w,y,_.spacingUnits,_.minSpace,g.padding.left+g.padding.right),y===null)break}return f(l.voices),l.w-v};function u(g,d,p,l,o,h,s,v){if(g)if(d===void 0){if(l/p<.66)return null}else{var y=1-(l+v)/p,m=y<d;if(!m)return null}if(Math.abs(p-l)<2)return null;var _=h*o,k=l-_;return h>0?(o=(p-k)/h,o*s>50&&(o=50/s),o):null}function f(g){for(var d=0;d<g.length;d++)for(var p=g[d],l=1;l<p.children.length-1;l++){var o=p.children[l];if(o.abcelem.rest&&(o.abcelem.rest.type==="whole"||o.abcelem.rest.type==="multimeasure")){var h=p.children[l-1],s=p.children[l+1];o.center(h,s)}}}return Wn=i,Wn}var Vn,no;function av(){if(no)return Vn;no=1;var e=function(a){this.shouldAddClasses=a.shouldAddClasses,this.reset()};return e.prototype.reset=function(){this.lineNumber=null,this.voiceNumber=null,this.measureNumber=null,this.measureTotalPerLine=[],this.noteNumber=null},e.prototype.incrLine=function(){this.lineNumber===null?this.lineNumber=0:this.lineNumber++,this.voiceNumber=null,this.measureNumber=null,this.noteNumber=null},e.prototype.incrVoice=function(){this.voiceNumber===null?this.voiceNumber=0:this.voiceNumber++,this.measureNumber=null,this.noteNumber=null},e.prototype.isInMeasure=function(){return this.measureNumber!==null},e.prototype.newMeasure=function(){this.measureNumber&&(this.measureTotalPerLine[this.lineNumber]=this.measureNumber),this.measureNumber=null,this.noteNumber=null},e.prototype.startMeasure=function(){this.measureNumber=0,this.noteNumber=0},e.prototype.incrMeasure=function(){this.measureNumber++,this.noteNumber=0},e.prototype.incrNote=function(){this.noteNumber++},e.prototype.measureTotal=function(){for(var t=0,a=0;a<this.lineNumber;a++)t+=this.measureTotalPerLine[a]?this.measureTotalPerLine[a]:0;return this.measureNumber&&(t+=this.measureNumber),t},e.prototype.getCurrent=function(t){return{line:this.lineNumber,measure:this.measureNumber,measureTotal:this.measureTotal(),voice:this.voiceNumber,note:this.noteNumber}},e.prototype.generate=function(t){if(!this.shouldAddClasses)return"";var a=[];if(t&&t.length>0&&a.push(t),t==="abcjs-tab-number")return a.join(" ");if(t==="text instrument-name")return"abcjs-text abcjs-instrument-name";if(this.lineNumber!==null&&a.push("l"+this.lineNumber),this.measureNumber!==null&&a.push("m"+this.measureNumber),this.measureNumber!==null&&a.push("mm"+this.measureTotal()),this.voiceNumber!==null&&a.push("v"+this.voiceNumber),t&&(t.indexOf("note")>=0||t.indexOf("rest")>=0||t.indexOf("lyric")>=0)&&this.noteNumber!==null&&a.push("n"+this.noteNumber),a.length>0){a=a.join(" "),a=a.split(" ");for(var n=0;n<a.length;n++)a[n].indexOf("abcjs-")!==0&&a[n].length>0&&(a[n]="abcjs-"+a[n])}return a.join(" ")},Vn=e,Vn}var Xn,ao;function iv(){if(ao)return Xn;ao=1;var e=function(a,n){this.formatting=a,this.classes=n};return e.prototype.updateFonts=function(t){t.gchordfont&&(this.formatting.gchordfont=t.gchordfont),t.tripletfont&&(this.formatting.tripletfont=t.tripletfont),t.annotationfont&&(this.formatting.annotationfont=t.annotationfont),t.vocalfont&&(this.formatting.vocalfont=t.vocalfont)},e.prototype.getFamily=function(t){return t[0]==='"'&&t[t.length-1]==='"'?t.substring(1,t.length-1):t},e.prototype.calc=function(t,a){var n;typeof t=="string"?(n=this.formatting[t],n?n={face:n.face,size:Math.round(n.size*4/3),decoration:n.decoration,style:n.style,weight:n.weight,box:n.box}:n={face:"Arial",size:Math.round(48/3),decoration:"underline",style:"normal",weight:"normal"}):n={face:t.face,size:Math.round(t.size*4/3),decoration:t.decoration,style:t.style,weight:t.weight,box:t.box};var r=this.formatting.fontboxpadding?this.formatting.fontboxpadding:.1;n.padding=n.size*r;var i={"font-size":n.size,"font-style":n.style,"font-family":this.getFamily(n.face),"font-weight":n.weight,"text-decoration":n.decoration,class:this.classes.generate(a)};return{font:n,attr:i}},Xn=e,Xn}var Kn,io;function sv(){if(io)return Kn;io=1;var e=function(a,n){this.getFontAndAttr=a,this.svg=n};return e.prototype.updateFonts=function(t){this.getFontAndAttr.updateFonts(t)},e.prototype.attr=function(t,a){return this.getFontAndAttr.calc(t,a)},e.prototype.getFamily=function(t){return t[0]==='"'&&t[t.length-1]==='"'?t.substring(1,t.length-1):t},e.prototype.calc=function(t,a,n,r){var i;typeof a=="string"?i=this.attr(a,n):i={font:{face:a.face,size:a.size,decoration:a.decoration,style:a.style,weight:a.weight},attr:{"font-size":a.size,"font-style":a.style,"font-family":this.getFamily(a.face),"font-weight":a.weight,"text-decoration":a.decoration,class:this.getFontAndAttr.classes.generate(n)}};var c=this.svg.getTextSize(t,i.attr,r);return i.font.box?{height:c.height+i.font.padding*4,width:c.width+i.font.padding*4}:c},e.prototype.baselineToCenter=function(t,a,n,r,i){var c=this.calc(t,a,n).height,u=this.attr(a,n).font.size;return c*.5+(i-r-2)*u},Kn=e,Kn}var Jn,so;function _t(){if(so)return Jn;so=1;var e=function(){for(var t=0,a,n=arguments[t++],r=[],i,c,u,f;n;){if(i=/^[^\x25]+/.exec(n))r.push(i[0]);else if(i=/^\x25{2}/.exec(n))r.push("%");else if(i=/^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(n)){if((a=arguments[i[1]||t++])==null||a==null)throw"Too few arguments.";if(/[^s]/.test(i[7])&&typeof a!="number")throw"Expecting number but found "+typeof a;switch(i[7]){case"b":a=a.toString(2);break;case"c":a=String.fromCharCode(a);break;case"d":a=parseInt(a);break;case"e":a=i[6]?a.toExponential(i[6]):a.toExponential();break;case"f":a=i[6]?parseFloat(a).toFixed(i[6]):parseFloat(a);break;case"o":a=a.toString(8);break;case"s":a=(a=String(a))&&i[6]?a.substring(0,i[6]):a;break;case"u":a=Math.abs(a);break;case"x":a=a.toString(16);break;case"X":a=a.toString(16).toUpperCase();break}a=/[def]/.test(i[7])&&i[2]&&a>0?"+"+a:a,u=i[3]?i[3]=="0"?"0":i[3][1]:" ",f=i[5]-String(a).length,c=i[5]?str_repeat(u,f):"",r.push(i[4]?a+c:c+a)}else throw"Huh ?!";n=n.substring(i[0].length)}return r.join("")};return Jn=e,Jn}var Qn,oo;function it(){if(oo)return Qn;oo=1;function e(t){return parseFloat(t.toFixed(2))}return Qn=e,Qn}var e0,co;function gt(){if(co)return e0;co=1;var e=it();function t(a,n,r){var i=n.y;if(n.phrases){var g=a.paper.richTextLine(n.phrases,n.x,n.y,n.klass,n.anchor);return g}if(n.lane){var c=n.dim.font.size*.25;i+=(n.dim.font.size+c)*n.lane}var u;n.dim?(u=n.dim,u.attr.class=n.klass):u=a.controller.getFontAndAttr.calc(n.type,n.klass),n.anchor&&(u.attr["text-anchor"]=n.anchor),n["dominant-baseline"]&&(u.attr["dominant-baseline"]=n["dominant-baseline"]),u.attr.x=n.x,u.attr.y=i,n.centerVertically||(u.attr.y+=u.font.size),n.type==="debugfont"&&(console.log("Debug msg: "+n.text),u.attr.stroke="#ff0000"),n.cursor&&(u.attr.cursor=n.cursor);var f;n.name==="free-text"?f=n.text.replace(/^[ \t]*\n/gm,`
|
|
120
120
|
`):f=n.text.replace(/\n\n/g,`
|
|
121
121
|
|
|
122
122
|
`),f=f.replace(/^\n/,`
|
|
123
|
-
`),u.font.box&&(r||a.paper.openGroup({klass:u.attr.class,fill:a.foregroundColor,"data-name":n.name}),u.attr["text-anchor"]==="end"?u.attr.x-=u.font.padding:u.attr["text-anchor"]==="start"&&(u.attr.x+=u.font.padding),u.attr.y+=u.font.padding,delete u.attr.class),n.noClass&&delete u.attr.class,u.attr.x=e(u.attr.x),u.attr.y=e(u.attr.y),n.name&&(u.attr["data-name"]=n.name);var g=a.paper.text(f,u.attr);if(u.font.box){var d=g.getBBox(),p=0;u.attr["text-anchor"]==="middle"?p=d.width/2+u.font.padding:u.attr["text-anchor"]==="end"&&(p=d.width+u.font.padding*2);var l=0;n.centerVertically&&(l=d.height-u.font.padding),a.paper.rect({"data-name":"box",x:Math.round(n.x-p),y:Math.round(i-l),width:Math.round(d.width+u.font.padding*2),height:Math.round(d.height+u.font.padding*2)}),r||(g=a.paper.closeGroup())}return g}return Q0=t,Q0}var en,lo;function ov(){if(lo)return en;lo=1;var e=_t(),t=Ve(),a=gt();function n(f,g,d){var p=g.startVoice.staff.absoluteY-t.STEP*10;return g.endVoice&&g.endVoice.staff?g.endY=g.endVoice.staff.absoluteY-t.STEP*2:g.lastContinuedVoice&&g.lastContinuedVoice.staff?g.endY=g.lastContinuedVoice.staff.absoluteY-t.STEP*2:g.endY=g.startVoice.staff.absoluteY-t.STEP*2,u(f,g.x,p,g.endY,g.type,g.header,d)}function r(f,g,d,p,l){g+=t.STEP;var o=t.STEP*.75,h=t.STEP*.75,s=p-d,v=e("M %f %f l %f %f l %f %f l %f %f z",g,d-h,0,s+h*2,o,0,0,-(s+h*2)),y=t.STEP*2,m=t.STEP;return v+=e("M %f %f q %f %f %f %f q %f %f %f %f z",g+o,d-h,y*.6,m*.2,y,-m,-y*.1,m*.3,-y,m+t.STEP),v+=e("M %f %f q %f %f %f %f q %f %f %f %f z",g+o,d+h+s,y*.6,-m*.2,y,m,-y*.1,-m*.3,-y,-m-t.STEP),f.paper.path({path:v,stroke:f.foregroundColor,fill:f.foregroundColor,class:f.controller.classes.generate(l),"data-name":l})}function i(f,g,d,p,l){var o=p-d,h=c(g,d,[7.5,-8,21,0,18.5,-10.5,7.5],[0,o/5.5,o/3.14,o/2,o/2.93,o/4.88,0]);return h+=c(g,d,[0,17.5,-7.5,6.6,-5,20,0],[o/2,o/1.46,o/1.22,o,o/1.19,o/1.42,o/2]),f.paper.path({path:h,stroke:f.foregroundColor,fill:f.foregroundColor,class:f.controller.classes.generate(l),"data-name":l})}function c(f,g,d,p){return e("M %f %f C %f %f %f %f %f %f C %f %f %f %f %f %f z",f+d[0],g+p[0],f+d[1],g+p[1],f+d[2],g+p[2],f+d[3],g+p[3],f+d[4],g+p[4],f+d[5],g+p[5],f+d[6],g+p[6])}var u=function(f,g,d,p,l,o,h){var s;if(o){f.paper.openGroup({klass:f.controller.classes.generate("staff-extra voice-name"),"data-name":l});var v=d+(p-d)/2;v=v-f.controller.getTextSize.baselineToCenter(o,"voicefont","staff-extra voice-name",0,1),a(f,{x:f.padding.left,y:v,text:o,type:"voicefont",klass:"staff-extra voice-name",anchor:"start",centerVertically:!0})}return l==="brace"?s=i(f,g,d,p,l):l==="bracket"&&(s=r(f,g,d,p,l)),o&&(s=f.paper.closeGroup()),h.wrapSvgEl({el_type:l,startChar:-1,endChar:-1},s),s};return en=n,en}var tn,uo;function jt(){if(uo)return tn;uo=1;function e(t,a,n){var r=t.paper.path(a);return r}return tn=e,tn}var rn,ho;function cv(){if(ho)return rn;ho=1;var e=_t(),t=jt(),a=it();function n(s,v,y){(!v.anchor1||!v.anchor2||!v.anchor1.heads||!v.anchor2.heads||v.anchor1.heads.length===0||v.anchor2.heads.length===0)&&window.console.error("Glissando Element not set.");var m=4,_=s.calcY(v.anchor1.heads[0].pitch),k=s.calcY(v.anchor2.heads[0].pitch),x=v.anchor1.x+v.anchor1.w/2,R=v.anchor2.x+v.anchor2.w/2,I=r(x,_,R,k),b=v.anchor1.w/2+m,A=v.anchor2.w/2+m,N=i(x,_,R,k),M=c(_,N,b);c(k,N,-A);var z=u(I-b-A),L=h(s,x+b,M,z,N);return y.wrapSvgEl({el_type:"glissando",startChar:-1,endChar:-1},L),[L]}function r(s,v,y,m){var _=y-s,k=m-v;return Math.sqrt(_*_+k*k)}function i(s,v,y,m){return(m-v)/(y-s)}function c(s,v,y){return a(s+y*v)}function u(s){var v=5;return Math.max(2,Math.floor((s-v*2)/6))}var f=[[3.5,-4.8]],g=[[1.5,-1],[.3,-.3],[-3.5,3.8]],d=[[-1.5,2]],p=[[3,4],[3,-4]],l=[[-3,4],[-3,-4]];function o(s,v){for(var y="",m=0;m<s.length;m++)y+="l"+s[m][0]+" "+c(s[m][1],v,s[m][0]);return y}var h=function(s,v,y,m,_){var k=e("M %f %f",v,y);k+=o(f,_);var x;for(x=0;x<m;x++)k+=o(p,_);for(k+=o(g,_),x=0;x<m;x++)k+=o(l,_);return k+=o(d,_)+"z",t(s,{path:k,highlight:"stroke",stroke:s.foregroundColor,class:s.controller.classes.generate("decoration"),"data-name":"glissando"})};return rn=n,rn}var nn,fo;function lv(){if(fo)return nn;fo=1;var e=_t(),t=jt(),a=it();function n(i,c,u){c.pitch===void 0&&window.console.error("Crescendo Element y-coordinate not set.");var f=i.calcY(c.pitch)+4,g=8,d=c.anchor1?c.anchor1.x:0,p=c.anchor2?c.anchor2.x:800,l;return c.dir==="<"?l=r(i,f+g/2,f,f+g/2,f+g,d,p):l=r(i,f,f+g/2,f+g,f+g/2,d,p),u.wrapSvgEl({el_type:"dynamicDecoration",startChar:-1,endChar:-1},l),[l]}var r=function(i,c,u,f,g,d,p){c=a(c),u=a(u),f=a(f),g=a(g),d=a(d),p=a(p);var l=e("M %f %f L %f %f M %f %f L %f %f",d,c,p,u,d,f,p,g);return t(i,{path:l,highlight:"stroke",stroke:i.foregroundColor,class:i.controller.classes.generate("dynamics decoration"),"data-name":"dynamics"})};return nn=n,nn}var an,po;function Ya(){if(po)return an;po=1;var e=it();function t(){this.ingroup=!1}t.prototype.beginGroup=function(n,r){this.paper=n,this.controller=r,this.path=[],this.lastM=[0,0],this.ingroup=!0,this.paper.openGroup()},t.prototype.isInGroup=function(){return this.ingroup},t.prototype.addPath=function(n){if(n=n||[],n.length!==0){n[0][0]="m",n[0][1]=e(n[0][1]-this.lastM[0]),n[0][2]=e(n[0][2]-this.lastM[1]),this.lastM[0]+=n[0][1],this.lastM[1]+=n[0][2],this.path.push(n[0]);for(var r=1,i=n.length;r<i;r++)n[r][0]==="m"&&(this.lastM[0]+=n[r][1],this.lastM[1]+=n[r][2]),this.path.push(n[r])}},t.prototype.endGroup=function(n,r){this.ingroup=!1;for(var i="",c=0;c<this.path.length;c++)i+=this.path[c].join(" ");this.path=[];var u=this.paper.closeGroup();return u&&(u.setAttribute("class",this.controller.classes.generate(n)),u.setAttribute("fill",this.controller.renderer.foregroundColor),u.setAttribute("stroke","none"),u.setAttribute("data-name",r)),u};var a=new t;return an=a,an}var sn,go;function Wa(){if(go)return sn;go=1;var e=gt(),t=pt(),a=Ya();function n(i,c,u,f,g){var d,p;if(!f)return null;if(f.length>1&&f.indexOf(".")<0){var l=a.isInGroup()?"":g.klass;i.paper.openGroup({"data-name":g.name,klass:l});for(var o=0,h=0;h<f.length;h++){var s=f[h];p=t.getYCorr(s),d=t.printSymbol(c+o,i.calcY(u+p),s,i.paper,{stroke:g.stroke,fill:g.fill}),d?h<f.length-1&&(o+=r(s,f[h+1],t.getSymbolWidth(s))):e(i,{x:c,y:i.y,text:"no symbol:"+f,type:"debugfont",klass:"debug-msg",anchor:"start"},!1)}var v=i.paper.closeGroup();return v}else return p=t.getYCorr(f),a.isInGroup()?d=t.printSymbol(c,i.calcY(u+p),f,i.paper,{"data-name":g.name}):d=t.printSymbol(c,i.calcY(u+p),f,i.paper,{klass:g.klass,stroke:g.stroke,fill:g.fill,"data-name":g.name}),d||(e(i,{x:c,y:i.y,text:"no symbol:"+f,type:"debugfont",klass:"debug-msg",anchor:"start"},!1),null)}function r(i,c,u){var f=u;return i==="f"&&c==="f"&&(f=f*2/3),i==="p"&&c==="p"&&(f=f*5/6),i==="f"&&c==="z"&&(f=f*5/8),f}return sn=n,sn}var on,vo;function uv(){if(vo)return on;vo=1;var e=Wa();function t(a,n,r){n.pitch===void 0&&window.console.error("Dynamic Element y-coordinate not set.");var i=1,c=1,u=e(a,n.anchor.x,n.pitch,n.dec,{scalex:i,scaley:c,klass:a.controller.classes.generate("decoration dynamics"),fill:a.foregroundColor,stroke:"none",name:"dynamics"});return r.wrapSvgEl({el_type:"dynamicDecoration",startChar:-1,endChar:-1,decoration:n.dec},u),[u]}return on=t,on}var cn,mo;function hv(){if(mo)return cn;mo=1;var e=_t(),t=gt(),a=jt(),n=it();function r(u,f,g){u.paper.openGroup({klass:u.controller.classes.generate("triplet "+f.durationClass),"data-name":"triplet"}),f.hasBeam||c(u,f.anchor1.x,f.startNote,f.anchor2.x+f.anchor2.w,f.endNote),t(u,{x:f.xTextPos,y:u.calcY(f.yTextPos-1),text:""+f.number,type:"tripletfont",anchor:"middle",centerVertically:!0,noClass:!0,name:""+f.number},!0);var d=u.paper.closeGroup();return g.wrapSvgEl({el_type:"triplet",startChar:-1,endChar:-1},d),d}function i(u,f,g,d){return e("M %f %f L %f %f",n(u),n(f),n(g),n(d))}function c(u,f,g,d,p){g=u.calcY(g),p=u.calcY(p);var l=5,o="";o+=i(f,g,f,g+l),o+=i(d,p,d,p+l);var h=f+(d-f)/2,s=8,v=(p-g)/(d-f),y=h-s,m=g+(y-f)*v;o+=i(f,g,y,m);var _=h+s,k=g+(_-f)*v;o+=i(_,k,d,p),a(u,{path:o,stroke:u.foregroundColor,"data-name":"triplet-bracket"})}return cn=r,cn}var ln,bo;function fv(){if(bo)return ln;bo=1;var e=_t(),t=gt(),a=jt(),n=it();function r(i,c,u,f,g){c.pitch===void 0&&window.console.error("Ending Element y-coordinate not set.");var d=n(i.calcY(c.pitch)),p=20,l="";c.anchor1&&(u=n(c.anchor1.x+c.anchor1.w),l+=e("M %f %f L %f %f ",u,d,u,n(d+p))),c.anchor2&&(f=n(c.anchor2.x),l+=e("M %f %f L %f %f ",f,d,f,n(d+p))),l+=e("M %f %f L %f %f ",u,d,f,d),i.paper.openGroup({klass:i.controller.classes.generate("ending"),fill:i.foregroundColor,"data-name":"ending"}),a(i,{path:l,stroke:i.foregroundColor,fill:i.foregroundColor,"data-name":"line"}),c.anchor1&&t(i,{x:n(u+5),y:n(i.calcY(c.pitch-.5)),text:c.text,type:"repeatfont",klass:"ending",anchor:"start",noClass:!0,name:c.text});var o=i.paper.closeGroup();return g.wrapSvgEl({el_type:"ending",startChar:-1,endChar:-1},o),[o]}return ln=r,ln}var un,yo;function dv(){if(yo)return un;yo=1;var e=_t(),t=it();function a(i,c,u,f,g){n(c,u,f);var d="";c.anchor1?d+="abcjs-start-m"+c.anchor1.parent.counters.measure+"-n"+c.anchor1.parent.counters.note:d+="abcjs-start-edge",c.anchor2?d+=" abcjs-end-m"+c.anchor2.parent.counters.measure+"-n"+c.anchor2.parent.counters.note:d+=" abcjs-end-edge",c.hint&&(d="abcjs-hint");var p=c.fixedY?1.5:0,l=r(i,c.startX,c.endX,c.startY+p,c.endY+p,c.above,d,c.isTie,c.dotted),o=-1;c.anchor1&&!c.isTie&&(o=c.anchor1.parent.abcelem.startChar-1);var h=-1;return c.anchor2&&!c.isTie&&(h=c.anchor2.parent.abcelem.endChar+1),g.wrapSvgEl({el_type:"slur",startChar:o,endChar:h},l),[l]}var n=function(i,c,u){!i.anchor1||!i.anchor2||i.anchor1.pitch===i.anchor2.pitch&&i.internalNotes.length===0?i.isTie=!0:i.isTie=!1,i.isTie?(i.calcTieDirection(),i.calcX(c,u),i.calcTieY()):(i.calcSlurDirection(),i.calcX(c,u),i.calcSlurY()),i.avoidCollisionAbove()},r=function(i,c,u,f,g,d,p,l,o){var h=l?1.2:1.5;c=t(c+6),u=t(u+4),f=f+(d?h:-h),g=g+(d?h:-h);var s=t(i.calcY(f)),v=t(i.calcY(g)),y=u-c,m=v-s,_=Math.sqrt(y*y+m*m),k=y/_,x=m/_,R=_/3.5,I=l?10:25,b=(d?-1:1)*Math.min(I,Math.max(4,R)),A=t(c+R*k-b*x),N=t(s+R*x+b*k),M=t(u-R*k-b*x),z=t(v-R*x+b*k),L=2;p?p+=" slur":p="slur",p+=l?" tie":" legato";var E;if(o){p+=" dotted";var T=e("M %f %f C %f %f %f %f %f %f",c,s,A,N,M,z,u,v);E=i.paper.path({path:T,stroke:i.foregroundColor,fill:"none","stroke-dasharray":"5 5",class:i.controller.classes.generate(p),"data-name":l?"tie":"slur"})}else{var P=e("M %f %f C %f %f %f %f %f %f C %f %f %f %f %f %f z",c,s,A,N,M,z,u,v,t(M-L*x),t(z+L*k),t(A-L*x),t(N+L*k),c,s);E=i.paper.path({path:P,stroke:"none",fill:i.foregroundColor,class:i.controller.classes.generate(p),"data-name":l?"tie":"slur"})}return E};return un=a,un}var hn,wo;function pv(){if(wo)return hn;wo=1;var e=jt(),t=it();function a(c,u){if(u.beams.length!==0){for(var f="",g=0;g<u.beams.length;g++){var d=u.beams[g];if(d.split){for(var p=r(c,d.startX,d.startY,d.endX,d.endY),l=[],o=0;o<d.split.length;o+=2)l.push([d.split[o],d.split[o+1]]);for(o=0;o<l.length;o++){var h=i(d.startX,d.startY,p,l[o][0]),s=i(d.startX,d.startY,p,l[o][1]);f+=n(c,l[o][0],h,l[o][1],s,d.dy)}}else f+=n(c,d.startX,d.startY,d.endX,d.endY,d.dy)}var v=("abcjs-d"+u.duration).replace(/\./g,"-"),y=c.controller.classes.generate("beam-elem "+v),m=e(c,{path:f,stroke:"none",fill:c.foregroundColor,class:y});return[m]}}function n(c,u,f,g,d,p){f=t(c.calcY(f)),d=t(c.calcY(d)),u=t(u),g=t(g);var l=t(f+p),o=t(d+p);return"M"+u+" "+f+" L"+g+" "+d+"L"+g+" "+o+" L"+u+" "+l+"z"}function r(c,u,f,g,d){return(d-f)/(g-u)}function i(c,u,f,g){var d=g-c;return u+d*f}return hn=a,hn}var fn,_o;function Va(){if(_o)return fn;_o=1;var e=Ya(),t=it();function a(n,r,i,c,u,f,g){if(i<0||c<u){var d=t(u);u=t(c),c=d}else c=t(c),u=t(u);r=t(r);var p=t(r+i);if(n.firefox112){r+=i/2;var o={x1:r,x2:r,y1:c,y2:u,stroke:n.foregroundColor,"stroke-width":Math.abs(i)};return f&&(o.class=f),g&&(o["data-name"]=g),n.paper.lineToBack(o)}for(var l=[["M",r,c],["L",r,u],["L",p,u],["L",p,c],["z"]],o={path:""},h=0;h<l.length;h++)o.path+=l[h].join(" ");return f&&(o.class=f),g&&(o["data-name"]=g),e.isInGroup()||(o.stroke="none",o.fill=n.foregroundColor),n.paper.pathToBack(o)}return fn=a,fn}var dn,ko;function gv(){if(ko)return dn;ko=1;var e=_t(),t=it();function a(n,r,i,c,u,f,g){var d=n.foregroundColor;r=t(r),i=t(i);var p=t(c-g),l=t(c+g);if(n.firefox112){c+=g/2;var o={x1:r,x2:i,y1:c,y2:c,stroke:n.foregroundColor,"stroke-width":Math.abs(g*2)};return u&&(o.class=u),f&&(o["data-name"]=f),n.paper.lineToBack(o)}var h=e("M %f %f L %f %f L %f %f L %f %f z",r,p,i,p,i,l,r,l),s={path:h,stroke:"none",fill:d};f&&(s["data-name"]=f),u&&(s.class=u);var v=n.paper.pathToBack(s);return v}return dn=a,dn}var pn,xo;function Ol(){if(xo)return pn;xo=1;var e=gv();function t(a,n,r,i,c,u,f){var g=a.calcY(i);return e(a,n,r,g,c,u,f)}return pn=t,pn}var gn,Co;function Dl(){if(Co)return gn;Co=1;var e=gt(),t=Va(),a=Ol(),n=Wa();function r(c,u,f){u.pitch===void 0&&window.console.error(u.type+" Relative Element y-coordinate not set.");var g=c.calcY(u.pitch);switch(u.type){case"symbol":if(u.c===null)return null;var d="symbol";u.klass&&(d+=" "+u.klass),u.graphelem=n(c,u.x,u.pitch,u.c,{scalex:u.scalex,scaley:u.scaley,klass:c.controller.classes.generate(d),name:u.name});break;case"debug":u.graphelem=e(c,{x:u.x,y:c.calcY(15),text:""+u.c,type:"debugfont",klass:c.controller.classes.generate("debug-msg"),anchor:"start",centerVertically:!1,dim:u.dim},!1);break;case"tabNumber":var p="middle",l="tabnumberfont",o="abcjs-tab-number";u.isGrace&&(l="tabgracefont",g+=2.5,o="tab-grace"),u.graphelem=e(c,{x:u.x,y:g,text:""+u.c,type:l,klass:c.controller.classes.generate(o),anchor:p,centerVertically:!1,dim:u.dim,cursor:"default"},!1);break;case"barNumber":u.graphelem=e(c,{x:u.x,y:g,text:""+u.c,type:"measurefont",klass:c.controller.classes.generate("bar-number"),anchor:"middle",dim:u.dim,name:"bar-number"},!0);break;case"lyric":u.graphelem=e(c,{x:u.x,y:g,text:u.c,type:"vocalfont",klass:c.controller.classes.generate("lyric"),anchor:"middle",dim:u.dim,name:"lyric"},!1);break;case"chord":u.graphelem=e(c,{x:u.x,y:g,text:u.c,type:"gchordfont",klass:c.controller.classes.generate("chord"),anchor:"middle",dim:u.dim,lane:u.getLane(),name:"chord"},!1);break;case"decoration":u.graphelem=e(c,{x:u.x,y:g+6,text:u.c,type:"annotationfont",klass:c.controller.classes.generate("annotation"),anchor:u.anchor,centerVertically:!0,dim:u.dim},!1);break;case"text":u.graphelem=e(c,{x:u.x,y:g,text:u.c,type:"annotationfont",klass:c.controller.classes.generate("annotation"),anchor:"start",centerVertically:u.centerVertically,dim:u.dim,lane:u.getLane(),name:"annotation"},!1);break;case"multimeasure-text":u.graphelem=e(c,{x:u.x+u.w/2,y:g,text:u.c,type:"tempofont",klass:c.controller.classes.generate("rest"),anchor:"middle",centerVertically:!1,dim:u.dim},!1);break;case"part":u.graphelem=e(c,{x:u.x,y:g,text:u.c,type:"partsfont",klass:c.controller.classes.generate("part"),anchor:"start",dim:u.dim,name:u.c},!0);break;case"bar":u.graphelem=t(c,u.x,u.linewidth+c.lineThickness,g,f||c.calcY(u.pitch2),null,"bar");break;case"stem":var h=u.linewidth>0?u.linewidth+c.lineThickness:u.linewidth-c.lineThickness;u.graphelem=t(c,u.x,h,g,c.calcY(u.pitch2),"abcjs-stem","stem");break;case"ledger":u.graphelem=a(c,u.x,u.x+u.w,u.pitch,"abcjs-ledger","ledger",.35+c.lineThickness);break}return u.scalex!==1&&u.graphelem&&i(c.paper,u.graphelem,u.scalex,u.scaley,u.x,g),u.graphelem}function i(c,u,f,g,d,p){c.setAttributeOnElement(u,{style:"transform:scale("+f+","+g+");transform-origin:"+d+"px "+p+"px;"})}return gn=r,gn}var vn,So;function vv(){if(So)return vn;So=1;var e=Dl(),t=gt();function a(n,r){var i=r.x;r.pitch===void 0&&window.console.error("Tempo Element y-coordinate not set."),r.tempo.el_type="tempo";var c=n.calcY(r.pitch)+2,u,f;if(r.tempo.preString){u=t(n,{x:i,y:c,text:r.tempo.preString,type:"tempofont",klass:"abcjs-tempo",anchor:"start",noClass:!0,name:"pre"},!0),f=n.controller.getTextSize.calc(r.tempo.preString,"tempofont","tempo",u);var g=f.width,d=g/r.tempo.preString.length;i+=g+d}if(r.note){r.note.setX(i);for(var p=0;p<r.note.children.length;p++)e(n,r.note.children[p],i);i+=r.note.w+5;var l="= "+r.tempo.bpm;u=t(n,{x:i,y:c,text:l,type:"tempofont",klass:"abcjs-tempo",anchor:"start",noClass:!0,name:"beats"}),f=n.controller.getTextSize.calc(l,"tempofont","tempo",u);var o=f.width,h=o/l.length;i+=o+h}r.tempo.postString&&t(n,{x:i,y:c,text:r.tempo.postString,type:"tempofont",klass:"abcjs-tempo",anchor:"start",noClass:!0,name:"post"},!0)}return vn=a,vn}var mn,To;function mv(){if(To)return mn;To=1;var e=vv(),t=Dl(),a=Ve(),n=Ga(),r=Ya();function i(c,u,f,g,d){if(!u.invisible){var p=u.children.length>0&&u.children[0].type==="TempoElement";u.elemset=[],r.beginGroup(c.paper,c.controller);for(var l=0;l<u.children.length;l++){var o=u.children[l];switch(o.type){case"TempoElement":e(c,o);break;default:var h=t(c,o,f);o.type==="symbol"&&o.c&&o.c.indexOf("notehead")>=0&&h.setAttribute("class","abcjs-notehead")}}var s=u.type;if((u.type==="note"||u.type==="rest")&&(u.counters=c.controller.classes.getCurrent(),s+=" d"+Math.round(u.durationClass*1e3)/1e3,s=s.replace(/\./g,"-"),u.abcelem.pitches))for(var v=0;v<u.abcelem.pitches.length;v++)s+=" p"+u.abcelem.pitches[v].pitch;var y=r.endGroup(s,u.type);if(y){if(u.cloned&&(u.cloned.overrideClasses=y.className.baseVal),u.overrideClasses){var m=y.classList&&y.classList.length>0?y.classList[0]+" ":"";y.setAttribute("class",m+u.overrideClasses)}if(p)u.startChar=u.abcelem.startChar,u.endChar=u.abcelem.endChar,g.add(u,y,!1,d);else{u.elemset.push(y);var _=!1;(u.type==="note"||u.type==="tabNumber")&&(_=!0),g.add(u,y,_,d)}}else u.elemset.length>0&&g.add(u,u.elemset[0],u.type==="note",d);if(u.klass&&n(u.elemset,"mark","","#00ff00"),u.hint&&n(u.elemset,"abcjs-hint","",null),u.abcelem.abselem=u,u.heads&&u.heads.length>0){u.notePositions=[];for(var k=0;k<u.heads.length;k++)u.notePositions.push({x:u.heads[k].x+u.heads[k].w/2,y:d.zero-u.heads[k].pitch*a.STEP})}}}return mn=i,mn}var bn,Eo;function bv(){if(Eo)return bn;Eo=1;var e=cv(),t=lv(),a=uv(),n=hv(),r=fv(),i=dv(),c=pv(),u=gt(),f=mv();function g(p,l,o,h,s){var v=l.w-1;p.staffbottom=l.staff.bottom;var y=p.foregroundColor;if(l.color&&(p.foregroundColor=l.color),l.header){var m=u(p,{x:p.padding.left,y:p.calcY(l.headerPosition),text:l.header,type:"voicefont",klass:"staff-extra voice-name",anchor:"start",centerVertically:!0,name:"voice-name"},!0);h.wrapSvgEl({el_type:"voiceName",startChar:-1,endChar:-1,text:l.header},m)}var _,k,x=!1;for(_=0;_<l.children.length;_++){k=l.children[_],(k.type==="note"||k.type==="rest")&&(x=!0);var R=!1;k.type!=="staff-extra"&&!p.controller.classes.isInMeasure()&&(p.controller.classes.startMeasure(),R=!0),l.staff.isTabStaff&&(k.invisible=!1,k.type=="bar"&&k.abcelem.lastBar&&(o=l.topLine)),f(p,k,l.barto||_===l.children.length-1?o:0,h,s),(k.type==="note"||d(k))&&p.controller.classes.incrNote(),k.type==="bar"&&!R&&x&&p.controller.classes.incrMeasure()}for(p.controller.classes.startMeasure(),_=0;_<l.beams.length;_++){var I=l.beams[_];I==="bar"?p.controller.classes.incrMeasure():c(p,I,h)}for(p.controller.classes.startMeasure(),_=0;_<l.otherchildren.length;_++)if(k=l.otherchildren[_],k==="bar")p.controller.classes.incrMeasure();else switch(k.type){case"GlissandoElem":k.elemset=e(p,k,h);break;case"CrescendoElem":k.elemset=t(p,k,h);break;case"DynamicDecoration":k.elemset=a(p,k,h);break;case"TripletElem":n(p,k,h);break;case"EndingElem":k.elemset=r(p,k,l.startx+10,v,h);break;case"TieElem":k.elemset=i(p,k,l.startx+10,v,h);break;default:console.log(k),f(p,k,l.startx+10,v,h,s)}p.foregroundColor=y}function d(p){return p.type!=="rest"?!1:!!(p.abcelem&&p.abcelem.rest&&p.abcelem.rest.type!=="spacer")}return bn=g,bn}var yn,Ao;function yv(){if(Ao)return yn;Ao=1;var e=Ol();function t(a,n,r,i,c,u){var f="abcjs-top-line",g=2;c&&(g=c),a.paper.openGroup({prepend:!0,klass:a.controller.classes.generate("abcjs-staff")});var d=0,p=0;if(i===1)e(a,n,r,6,f,null,u+a.lineThickness),d=a.calcY(10),p=a.calcY(2);else for(var l=i-1;l>=0;l--){var o=(l+1)*g;p=a.calcY(o),d===0&&(d=p),e(a,n,r,o,f,null,u+a.lineThickness),f=void 0}return a.paper.closeGroup(),[d,p]}return yn=t,yn}var wn,Mo;function wv(){if(Mo)return wn;Mo=1;function e(t,a,n){var r=t.paper.rectBeneath(a);return n&&t.paper.text(n,{x:0,y:a.y+7,"text-anchor":"start","font-size":"14px",fill:"rgba(0,0,255,.4)",stroke:"rgba(0,0,255,.4)"}),r}return wn=e,wn}var _n,No;function _v(){if(No)return _n;No=1;function e(t,a){var n="rgba(0,0,0,255)",r="rgba(0,0,0,0)",i=Math.round(t.y),c=t.controller.width,u=(c-a)/2,f=u+a,g="M "+u+" "+i+" L "+f+" "+i+" L "+f+" "+(i+1)+" L "+u+" "+(i+1)+" L "+u+" "+i+" z";t.paper.pathToBack({path:g,stroke:r,fill:n,class:t.controller.classes.generate("defined-text")})}return _n=e,_n}var kn,Po;function Fl(){if(Po)return kn;Po=1;var e=_v(),t=gt();function a(n,r,i){for(var c=0;c<r.rows.length;c++){var u=r.rows[c];if(u.absmove)n.absolutemoveY(u.absmove);else if(u.move)n.moveY(u.move);else if(u.text||u.phrases){var f=u.left?u.left:0,g=t(n,{x:f,y:n.y,text:u.text,phrases:u.phrases,"dominant-baseline":u["dominant-baseline"],type:u.font,klass:u.klass,name:u.name,anchor:u.anchor});u.absElemType&&i.wrapSvgEl({el_type:u.absElemType,name:u.name,startChar:u.startChar,endChar:u.endChar,text:u.text},g)}else if(u.separator)e(n,u.separator);else if(u.startGroup)n.paper.openGroup({klass:u.klass,"data-name":u.name});else if(u.endGroup){var d=n.paper.closeGroup();u.absElemType&&i.wrapSvgEl({el_type:u.absElemType,name:u.name,startChar:u.startChar,endChar:u.endChar,text:""},d)}}}return kn=a,kn}var xn,zo;function kv(){if(zo)return xn;zo=1;var e=Ve(),t=ov(),a=bv(),n=yv(),r=wv(),i=Va(),c=Fl();function u(d,p,l,o){for(var h,s=d.y,v=0;v<p.staffs.length;v++){var y=p.staffs[v];d.moveY(e.STEP,y.top),y.absoluteY=d.y,d.showDebug&&(d.showDebug.indexOf("box")>=0&&y.voices&&g(d,p.voices,y.voices),d.showDebug.indexOf("grid")>=0&&(d.paper.dottedLine({x1:d.padding.left,x2:d.padding.left+d.controller.width,y1:s,y2:s,stroke:"#0000ff"}),r(d,{x:d.padding.left,y:d.calcY(y.originalTop),width:d.controller.width,height:d.calcY(y.originalBottom)-d.calcY(y.originalTop),fill:d.foregroundColor,stroke:d.foregroundColor,"fill-opacity":.1,"stroke-opacity":.1}),h=0,E(y,"chordHeightAbove"),E(y,"chordHeightBelow"),E(y,"dynamicHeightAbove"),E(y,"dynamicHeightBelow"),E(y,"endingHeightAbove"),E(y,"lyricHeightAbove"),E(y,"lyricHeightBelow"),E(y,"partHeightAbove"),E(y,"tempoHeightAbove"),E(y,"volumeHeightAbove"),E(y,"volumeHeightBelow"))),d.moveY(e.STEP,-y.bottom),d.showDebug&&d.showDebug.indexOf("grid")>=0&&d.paper.dottedLine({x1:d.padding.left,x2:d.padding.left+d.controller.width,y1:d.y,y2:d.y,stroke:"#0000aa"})}for(var m,_,k=2,x=0,R=0;R<p.voices.length;R++){var I=p.voices[R].staff,b=p.voices[R].tabNameInfos;if(d.y=I.absoluteY,d.controller.classes.incrVoice(),!p.voices[R].duplicate){if(m||(m=d.calcY(10)),_=d.calcY(k),I.lines!==0){I.linePitch&&(k=I.linePitch),d.controller.classes.newMeasure();var A=n(d,p.startx,p.w,I.lines,I.linePitch,.35);_=A[1],I.bottomLine=_,I.topLine=A[0],I.hasTab&&(x=I.topLine),I.hasStaff&&(x=I.hasStaff.topLine,p.voices[R].barto=!0,p.voices[R].topLine=m)}f(d,I.absoluteY,p.brace,R,l),f(d,I.absoluteY,p.bracket,R,l)}a(d,p.voices[R],x,l,{top:s,zero:d.y,height:p.height*e.STEP});var N=0;if(b){var M={rows:[]};M.rows.push({absmove:_+2});var z=8;M.rows.push({left:p.startx+z,text:b.name,font:"tablabelfont",klass:"text instrument-name",anchor:"start"}),M.rows.push({move:b.textSize.height}),c(d,M),N=b.textSize.height}d.controller.classes.newMeasure(),p.voices[R].duplicate||(x=d.calcY(2+N))}d.controller.classes.newMeasure();var L=p.staffs.length;L>1&&(m=p.staffs[0].topLine,_=p.staffs[L-1].bottomLine,i(d,p.startx,.6,m,_,null)),d.y=s;function E(T,P){var B=["rgb(207,27,36)","rgb(168,214,80)","rgb(110,161,224)","rgb(191,119,218)","rgb(195,30,151)","rgb(31,170,177)","rgb(220,166,142)"];if(T.positionY&&T.positionY[P]){var O=T.specialY[P]*e.STEP;P==="chordHeightAbove"&&T.specialY.chordLines&&T.specialY.chordLines.above&&(O*=T.specialY.chordLines.above),P==="chordHeightBelow"&&T.specialY.chordLines&&T.specialY.chordLines.below&&(O*=T.specialY.chordLines.below),r(d,{x:d.padding.left,y:d.calcY(T.positionY[P]),width:d.controller.width,height:O,fill:B[h],stroke:B[h],"fill-opacity":.4,"stroke-opacity":.4},P.substr(0,4)),h+=1,h>6&&(h=0)}}}function f(d,p,l,o,h){if(l)for(var s=0;s<l.length;s++)l[s].isStartVoice(o)&&(l[s].startY=p-e.STEP*10,l[s].elemset=t(d,l[s],h))}function g(d,p,l){for(var o=0;o<l.length;o++)for(var h=p[l[o]].children,s=0;s<h.length;s++){var v=h[s],y=v.getFixedCoords();if(!(v.invisible||y.t===void 0||y.b===void 0)){var m=(y.t-y.b)*e.STEP;r(d,{x:y.x,y:d.calcY(y.t),width:y.w,height:m,fill:"#88e888","fill-opacity":.4,stroke:"#4aa93d","stroke-opacity":.8});for(var _=0;_<v.children.length;_++){var k=v.children[_],x=k.getChordDim();if(x){var R=d.calcY(k.pitch);R+=k.dim.font.size*k.getLane(),r(d,{x:x.left,y:R,width:x.right-x.left,height:k.dim.font.size,fill:"none",stroke:"#4aa93d","stroke-opacity":.8})}}}}}return xn=u,xn}var Cn,Io;function xv(){if(Io)return Cn;Io=1;function e(t,a,n,r){var i=(a+t.padding.left+t.padding.right)*n,c=(t.y+t.padding.bottom)*n;if(t.isPrint&&(c=Math.max(c,1056)),t.ariaLabel!==""){var u="Sheet Music";t.abctune&&t.abctune.metaText&&t.abctune.metaText.title&&(u+=' for "'+t.abctune.metaText.title+'"'),t.paper.setTitle(u);var f=t.ariaLabel?t.ariaLabel:u;t.paper.setAttribute("aria-label",f)}var g=["-webkit-touch-callout: none;","-webkit-user-select: none;","-khtml-user-select: none;","-moz-user-select: none;","-ms-user-select: none;","user-select: none;"];t.paper.insertStyles(".abcjs-dragging-in-progress text, .abcjs-dragging-in-progress tspan {"+g.join(" ")+"}");var d={overflow:"hidden"};r==="resize"?t.paper.setResponsiveWidth(i,c):(d.width="",d.height=c+"px",n<1?(d.width=i+"px",t.paper.setSize(i/n,c/n)):t.paper.setSize(i,c)),t.paper.setScale(n),t.paper.setParentStyles(d)}return Cn=e,Cn}var Sn,Ro;function Cv(){if(Ro)return Sn;Ro=1;var e=Ml(),t=Nl();function a(n,r,i){this.elements=[],this.paper=n,this.tuneNumber=i,this.selectTypes=r}return a.prototype.getElements=function(){return this.elements},a.prototype.add=function(n,r,i,c){if(this.canSelect(n)){var u;this.selectTypes===void 0?u={selectable:!1,"data-index":this.elements.length}:u={selectable:!0,tabindex:0,"data-index":this.elements.length},this.paper.setAttributeOnElement(r,u);var f={absEl:n,svgEl:r,isDraggable:i};c!==void 0&&(f.staffPos=c),this.elements.push(f)}},a.prototype.canSelect=function(n){return this.selectTypes===!1||!n||!n.abcelem?!1:this.selectTypes===!0?!0:this.selectTypes===void 0?n.abcelem.el_type==="note"||n.abcelem.el_type==="tabNumber":this.selectTypes.indexOf(n.abcelem.el_type)>=0},a.prototype.wrapSvgEl=function(n,r){var i={tuneNumber:this.tuneNumber,abcelem:n,elemset:[r],highlight:e,unhighlight:t};this.add(i,r,!1)},Sn=a,Sn}var Tn,qo;function Sv(){if(qo)return Tn;qo=1;const e=Wa(),t=Va();function a(m,_,k,x,R){const I=R.gchordfont;R.partsfont;const b=R.annotationfont,A=R.repeatfont,N=R.textfont,M=R.subtitlefont,z=50,L=10,E=14,T=10,P=20,B=16;_.forEach(O=>{switch(O.type){case"text":y(m,O.text,k,m.y,16,N,null,null,!1),m.moveY(B);break;case"subtitle":y(m,O.subtitle,k,m.y+T,20,M,null,"abcjs-subtitle",!1),m.moveY(P);break;case"part":if(O.lines.length>0){y(m,O.name,k,m.y+T,20,M,O.name,"abcjs-part",!1),m.moveY(P);const w=O.lines[0].length,C=x/w;O.lines.forEach((S,q)=>{let D=!1,$=!1;S.forEach(K=>{K.ending&&(D=!0),K.annotations&&K.annotations.length>0&&($=!0)});const F=$?E:D?L:0;S.forEach((K,te)=>{if(!K.noBorder){m.paper.rect({x:k+te*C,y:m.y,width:C,height:F+z}),m.paper.rect({x:k+te*C+1,y:m.y+1,width:C-2,height:F+z-2});let ae=0,oe=0;const le=m.y,J=k+C*te;K.hasStartRepeat&&(r(m,J,le,le+z+F,!0,F),ae=12),K.hasEndRepeat&&(r(m,J+C,le,le+z+F,!1,F),oe=12);let ce=0;K.ending&&(ce=y(m,K.ending,k+te*C+4,le+10,12,A,null,null,!1).getBBox().width+4),u(m,le,k+ae,C,q,te,K.chord,I,ae+oe,z,F),K.annotations&&K.annotations.length>0&&c(m,le,k+te*C+ce,K.annotations,b),F&&m.paper.rectBeneath({x:k+te*C,y:m.y,width:C,height:F,fill:"#e8e8e8",stroke:"none"})}}),m.moveY(F+z)}),m.moveY(P)}break}})}function n(m,_,k,x){var R=_-10,I=_+10,b=k+10,A=k-10,N=_-10,M=-m.yToPitch(x)+2,z=_+6.5,L=-m.yToPitch(x)-2.3;m.paper.lineToBack({x1:R,x2:I,y1:b,y2:A,"stroke-width":"3px","stroke-linecap":"round"}),e(m,N,M,"dots.dot",{scalex:1,scaley:1,klass:"",name:"dot"}),e(m,z,L,"dots.dot",{scalex:1,scaley:1,klass:"",name:"dot"})}function r(m,_,k,x,R,I){const b=R?_+2:_-4,A=R?_+9:_-11;m.paper.openGroup({klass:"abcjs-repeat"}),t(m,b,3+m.lineThickness,k,x,null,"bar"),e(m,A,-m.yToPitch(I)-4,"dots.dot",{scalex:1,scaley:1,klass:"",name:"dot"}),e(m,A,-m.yToPitch(I)-8,"dots.dot",{scalex:1,scaley:1,klass:"",name:"dot"}),m.paper.closeGroup()}const i={segno:"scripts.segno",coda:"scripts.coda",fermata:"scripts.ufermata"};function c(m,_,k,x,R){k+=3;let I;for(let b=0;b<x.length;b++)switch(x[b]){case"segno":case"coda":case"fermata":{k+=12,I=e(m,k,-3,i[x[b]],{scalex:1,scaley:1,name:i[x[b]]});const A=I.getBBox();k+=A.width}break;default:y(m,x[b],k,_+12,12,R,null,null,!1)}}function u(m,_,k,x,R,I,b,A,N,M,z){const L=k+x*I;!b[1]&&!b[2]&&!b[3]?o(m,L,_+z,x-N,M,b[0],A,z):!b[1]&&!b[3]?h(m,L,_,x-N,M,b[0],b[2],A,z):s(m,L,_,x-N,M,b,A,z)}function f(m,_,k,x,R,I,b){const A=y(m,R,_,k,x,I,null,"abcjs-chord",!0);let N=A.getBBox(),M=x;for(;N.width>b&&M>=14;)M-=2,A.setAttribute("font-size",M),N=A.getBBox()}const g=34,d=26,p=20,l=-3;function o(m,_,k,x,R,I,b,A){I==="%"?n(m,_+x/2,k+R/2,A+R/2):f(m,_+x/2,k+R/2+l,g,I,b,x)}function h(m,_,k,x,R,I,b,A,N){m.paper.lineToBack({x1:_,x2:_+x,y1:k+R+N,y2:k+2}),f(m,_+x/4,k+R/4+5+N+l,d,I,A,x/2),f(m,_+3*x/4,k+3*R/4+N+l,d,b,A,x/2)}function s(m,_,k,x,R,I,b,A){m.paper.lineToBack({x1:_+3,x2:_+x-3,y1:k+R/2+A,y2:k+R/2+A}),m.paper.lineToBack({x1:_+x/2,x2:_+x/2,y1:k+3+A,y2:k+R-3+A}),I[0]&&f(m,_+x/4,k+R/4+2+A+l,p,v(I[0]),b,x/2),I[1]&&f(m,_+3*x/4,k+R/4+2+A+l,p,v(I[1]),b,x/2),I[2]&&f(m,_+x/4,k+3*R/4+A+l,p,v(I[2]),b,x/2),I[3]&&f(m,_+3*x/4,k+3*R/4+A+l,p,v(I[3]),b,x/2)}function v(m){return m==="No Chord"?"N.C.":m}function y(m,_,k,x,R,I,b,A,N){const M={x:k,y:x,stroke:"none","font-size":R,"font-style":I.style,"font-family":I.face,"font-weight":I.weight,"text-decoration":I.decoration};return b&&(M["data-name"]=b),A&&(M.class=A),M["text-anchor"]=N?"middle":"start",m.paper.text(_,M,null,{"alignment-baseline":"middle"})}return Tn=a,Tn}var En,Bo;function Tv(){if(Bo)return En;Bo=1;var e=kv(),t=xv(),a=Fl(),n=Ve(),r=Cv(),i=Sv();function c(g,d,p,l,o,h,s,v,y,m,_){var k=new r(g.paper,v,y),x={};d.shouldAddClasses&&(x.klass="abcjs-meta-top"),g.paper.openGroup(x),g.moveY(g.padding.top),a(g,p.topText,k),g.paper.closeGroup(),g.moveY(g.spacing.music);let R=!1;_&&p.chordGrid&&(i(g,p.chordGrid,g.padding.left,l,p.formatting),_==="noMusic"&&(R=!0));var I=[],b=0;if(!R)for(var A=0;A<p.lines.length;A++){d.incrLine();var N=p.lines[A];if(N.staff){if(b++,p.formatting.maxStaves&&b>p.formatting.maxStaves)break;d.shouldAddClasses&&(x.klass="abcjs-staff-wrapper abcjs-l"+d.lineNumber),g.paper.openGroup(x),N.vskip&&g.moveY(N.vskip),I.length>=1&&f(g,g.spacing.staffSeparation,I[I.length-1],N.staffGroup);var M=u(g,N.staffGroup,k,A);M.line=m+A,I.push(M),g.paper.closeGroup()}else N.nonMusic&&(d.shouldAddClasses&&(x.klass="abcjs-non-music"),g.paper.openGroup(x),a(g,N.nonMusic,k),g.paper.closeGroup())}return d.reset(),R||p.bottomText&&p.bottomText.rows&&p.bottomText.rows.length>0&&(d.shouldAddClasses&&(x.klass="abcjs-meta-bottom"),g.paper.openGroup(x),g.moveY(24),a(g,p.bottomText,k),g.paper.closeGroup()),t(g,o,s,h),{staffgroups:I,selectables:k.getElements()}}function u(g,d,p,l){e(g,d,p,l);var o=d.height*n.STEP;return g.y+=o,d}function f(g,d,p,l){var o=p.staffs[p.staffs.length-1],h=-(o.bottom-2),s=l.staffs[0].top-10,v=s+h,y=v*n.STEP;y<d&&g.moveY(d-y)}return En=c,En}var An,Lo;function Ev(){if(Lo)return An;Lo=1;var e=Bl();function t(a){for(var n=a;n&&n.attributes&&n.tagName.toLowerCase()!=="svg"&&!n.attributes.selectable;)n=n.parentNode;if(n&&n.attributes&&n.attributes.selectable){var r=n.attributes["data-index"].nodeValue;if(r&&(r=parseInt(r,10),r>=0&&r<this.selectables.length)){var i=this.selectables[r],c=e(i,a);return c.index=r,c.element=i,c}}return null}return An=t,An}var Mn,Oo;function Hl(){if(Oo)return Mn;Oo=1;var e=Ve(),t=Hg(),a=Zg(),n=Gg(),r=Ug(),i=jg(),c=Yg(),u=Wg(),f=Vg(),g=nv(),d=av(),p=iv(),l=sv(),o=Tv(),h=Il(),s=Ev(),v=function(_,k){k=k||{},this.findSelectableElement=s,this.oneSvgPerLine=k.oneSvgPerLine,this.selectionColor=k.selectionColor,this.dragColor=k.dragColor?k.dragColor:k.selectionColor,this.dragging=!!k.dragging,this.selectTypes=k.selectTypes,this.responsive=k.responsive,this.space=3*e.SPACE,this.initialClef=k.initialClef,this.timeBasedLayout=k.timeBasedLayout,this.expandToWidest=!!k.expandToWidest,this.scale=k.scale?parseFloat(k.scale):0,this.classes=new d({shouldAddClasses:k.add_classes}),this.scale>.1||(this.scale=void 0),k.staffwidth?(this.staffwidthScreen=k.staffwidth,this.staffwidthPrint=k.staffwidth):(this.staffwidthScreen=740,this.staffwidthPrint=680),this.listeners=[],k.clickListener&&this.addSelectListener(k.clickListener),this.renderer=new a(_),this.renderer.setPaddingOverride(k),k.showDebug&&(this.renderer.showDebug=k.showDebug),k.jazzchords&&(this.jazzchords=k.jazzchords),k.accentAbove&&(this.accentAbove=k.accentAbove),k.germanAlphabet&&(this.germanAlphabet=k.germanAlphabet),k.lineThickness&&(this.lineThickness=k.lineThickness),k.chordGrid&&(this.chordGrid=k.chordGrid),this.renderer.controller=this,this.renderer.foregroundColor=k.foregroundColor?k.foregroundColor:"currentColor",k.ariaLabel!==void 0&&(this.renderer.ariaLabel=k.ariaLabel),this.renderer.minPadding=k.minPadding?k.minPadding:0,this.reset()};v.prototype.reset=function(){this.selected=[],this.staffgroups=[],this.engraver&&this.engraver.reset(),this.engraver=null,this.renderer.reset(),this.dragTarget=null,this.dragIndex=-1,this.dragMouseStart={x:-1,y:-1},this.dragYStep=0,this.lineThickness&&this.renderer.setLineThickness(this.lineThickness)},v.prototype.engraveABC=function(_,k,x){_[0]===void 0&&(_=[_]),this.reset();for(var R=0;R<_.length;R++)k===void 0&&(k=R),this.getFontAndAttr=new p(_[R].formatting,this.classes),this.getTextSize=new l(this.getFontAndAttr,this.renderer.paper),this.engraveTune(_[R],k,x)},v.prototype.adjustNonScaledItems=function(_){this.width/=_,this.renderer.adjustNonScaledItems(_)},v.prototype.getMeasureWidths=function(_){this.reset(),this.getFontAndAttr=new p(_.formatting,this.classes),this.getTextSize=new l(this.getFontAndAttr,this.renderer.paper);var k=this.jazzchords;this.setupTune(_,0),this.constructTuneElements(_),g(this.renderer,_,0,this.space,this.timeBasedLayout);for(var x=[],R,I=!0,b=0;b<_.lines.length;b++){var A=_.lines[b];if(A.staff){if(I&&(R={left:0,measureWidths:[],total:0},x.push(R),I=!1),A.staffGroup.voices.length>0)for(var N=A.staffGroup.voices[0],M=!1,z=0,L=0;L<N.children.length;L++){var E=N.children[L];!M&&!E.isClef&&!E.isKeySig&&(M=!0,R.left=E.x,z=E.x),E.type==="bar"&&(R.measureWidths.push(E.x-z),R.total+=E.x-z,z=E.x)}}else I=!0}return this.jazzchords=k,x},v.prototype.setupTune=function(_,k){this.classes.reset(),_.formatting.jazzchords!==void 0&&(this.jazzchords=_.formatting.jazzchords),_.formatting.accentAbove!==void 0&&(this.accentAbove=_.formatting.accentAbove),this.renderer.newTune(_),this.engraver=new t(this.getTextSize,k,{bagpipes:_.formatting.bagpipes,flatbeams:_.formatting.flatbeams,graceSlurs:_.formatting.graceSlurs!==!1,percmap:_.formatting.percmap,initialClef:this.initialClef,jazzchords:this.jazzchords,timeBasedLayout:this.timeBasedLayout,accentAbove:this.accentAbove,germanAlphabet:this.germanAlphabet}),this.engraver.setStemHeight(this.renderer.spacing.stemHeight),this.engraver.measureLength=_.getMeterFraction().num/_.getMeterFraction().den,_.formatting.staffwidth?this.width=_.formatting.staffwidth*1.33:this.width=this.renderer.isPrint?this.staffwidthPrint:this.staffwidthScreen;var x=_.formatting.scale?_.formatting.scale:this.scale;return this.responsive==="resize"&&(x=void 0),x===void 0&&(x=this.renderer.isPrint?.75:1),this.adjustNonScaledItems(x),x},v.prototype.constructTuneElements=function(_){_.topText=new c(_.metaText,_.metaTextInfo,_.formatting,_.lines,this.width,this.renderer.isPrint,this.renderer.padding.left,this.renderer.spacing,this.classes.shouldAddClasses,this.getTextSize);var k,x,R=!1,I=!1;for(k=0;k<_.lines.length;k++)if(x=_.lines[k],x.staff)I=!0,x.staffGroup=this.engraver.createABCLine(x.staff,R?null:_.metaText.tempo,k),R=!0;else if(x.subtitle){if(I){var b=this.width/2+this.renderer.padding.left;x.nonMusic=new i(this.renderer.spacing.subtitle,_.formatting,x.subtitle,b,this.renderer.padding.left,this.getTextSize)}}else x.text!==void 0?(I=!0,x.nonMusic=new n(x.text,x.vskip,this.getFontAndAttr,this.renderer.padding.left,this.width,this.getTextSize)):x.separator!==void 0&&x.separator.lineLength&&(I=!0,x.nonMusic=new r(x.separator.spaceAbove,x.separator.lineLength,x.separator.spaceBelow));_.bottomText=new u(_.metaText,this.width,this.renderer.isPrint,this.renderer.padding.left,this.renderer.spacing,this.classes.shouldAddClasses,this.getTextSize)},v.prototype.engraveTune=function(_,k,x){var R=this.jazzchords,I=this.setupTune(_,k);this.constructTuneElements(_);var b=g(this.renderer,_,this.width,this.space,this.expandToWidest,this.timeBasedLayout);if(this.expandToWidest&&b>this.width+1&&(_.topText=new c(_.metaText,_.metaTextInfo,_.formatting,_.lines,b,this.renderer.isPrint,this.renderer.padding.left,this.renderer.spacing,this.classes.shouldAddClasses,this.getTextSize),_.lines&&_.lines.length>0))for(var A=_.lines.length,N=0;N<A;++N){var M=_.lines[N];if(M.nonMusic&&M.nonMusic.rows&&M.nonMusic.rows.length>0)for(var z=M.nonMusic.rows.length,L=0;L<z;++L){var E=M.nonMusic.rows[L];E.left&&(M.subtitle?E.left=b/2+this.renderer.padding.left:M.text&&M.text.length>0&&M.text[0].center&&(E.left=b/2+this.renderer.padding.left))}}_.tablatures&&h.layoutTablatures(this.renderer,_);var T=o(this.renderer,this.classes,_,this.width,b,this.responsive,I,this.selectTypes,k,x,this.chordGrid);if(this.staffgroups=T.staffgroups,this.selectables=T.selectables,this.oneSvgPerLine){var P=this.renderer.paper.svg.parentNode;this.svgs=y(this.renderer,P,_.metaText.title,this.responsive,I)}else this.svgs=[this.renderer.paper.svg];f(this,this.svgs),this.jazzchords=R};function y(_,k,x,R,I){x||(x="Untitled");var b=k.querySelector("svg");R==="resize"&&(k.style.paddingBottom="");for(var A=b.querySelector("style"),N=R==="resize"?b.viewBox.baseVal.width:b.getAttribute("width"),M=k.querySelectorAll("svg > g"),z=0,L=[],E=0;E<M.length;E++){var T=M[E],P=T.getBBox(),B=P.y-z,O=P.height+B,w=document.createElement("div"),C="overflow: hidden;";R!=="resize"&&(C+="height:"+O*I+"px;"),w.setAttribute("style",C);var S=m(b),q='Sheet Music for "'+x+'" section '+(E+1);S.setAttribute("aria-label",q),R!=="resize"&&S.setAttribute("height",O),R==="resize"&&(S.style.position="");var D=_.firefox112?O+1:O;S.setAttribute("viewBox","0 "+z+" "+N+" "+D),S.appendChild(A.cloneNode(!0));var $=document.createElement("title");$.innerText=q,S.appendChild($),S.appendChild(T),w.appendChild(S),L.push(S),k.appendChild(w),z=P.y+P.height}return k.removeChild(b),L}function m(_){for(var k="http://www.w3.org/2000/svg",x=document.createElementNS(k,"svg"),R=0;R<_.attributes.length;R++){var I=_.attributes[R];I.name!=="height"&&I.name!="aria-label"&&x.setAttribute(I.name,I.value)}return x}return v.prototype.getDim=function(_){if(!_.dim){var k=_.svgEl.getBBox();_.dim={left:Math.round(k.x),top:Math.round(k.y),right:Math.round(k.x+k.width),bottom:Math.round(k.y+k.height)}}return _.dim},v.prototype.addSelectListener=function(_){this.listeners[this.listeners.length]=_},Mn=v,Mn}var Nn,Do;function $l(){if(Do)return Nn;Do=1;var e=fr();Tl();var t=Hl(),a=El(),n=xl(),r={};function i(){var g=window.innerWidth;for(var d in r)if(r.hasOwnProperty(d)){var p=r[d],l=p.offsetLeft;g-=l*2,p.style.width=g+"px"}}try{window.addEventListener("resize",i),window.addEventListener("orientationChange",i)}catch{}function c(g,d,p,l,o){p.viewportHorizontal?(g.innerHTML='<div class="abcjs-inner"></div>',p.scrollHorizontal?(g.style.overflowX="auto",g.style.overflowY="hidden"):g.style.overflow="hidden",r[g.id]=g,g=g.children[0]):p.viewportVertical?(g.innerHTML='<div class="abcjs-inner scroll-amount"></div>',g.style.overflowX="hidden",g.style.overflowY="auto",g=g.children[0]):g.innerHTML="";var h=new t(g,p);if(h.engraveABC(d,l,o),d.engraver=h,p.viewportVertical||p.viewportHorizontal){var s=g.parentNode;s.style.width=g.style.width}}var u=function(g,d,p,l,o){var h={},s;if(p){for(s in p)p.hasOwnProperty(s)&&(h[s]=p[s]);h.warnings_id&&h.tablature&&(h.tablature.warning_id=h.warnings_id)}if(l)for(s in l)l.hasOwnProperty(s)&&(s==="listener"?l[s].highlight&&(h.clickListener=l[s].highlight):h[s]=l[s]);if(o)for(s in o)o.hasOwnProperty(s)&&(h[s]=o[s]);function v(y,m,_,k){var x=!1;return y==="*"&&(x=!0,y=document.createElement("div"),y.setAttribute("style","visibility: hidden;"),document.body.appendChild(y)),!x&&h.wrap&&h.staffwidth?(m=f(y,m,_,k,h),m):(h.afterParsing&&h.afterParsing(m,_,k),c(y,m,h,_,0),x&&y.parentNode.removeChild(y),null)}return e.renderEngine(v,g,d,h)};function f(g,d,p,l,o){var h=new t(g,o),s=h.getMeasureWidths(d),v=n.calcLineWraps(d,s,o);if(v.reParse){var y=new a;y.parse(l,v.revisedParams),d=y.getTune();var m=y.getWarnings();m&&(d.warnings=m)}return o.afterParsing&&o.afterParsing(d,p,l),c(g,d,v.revisedParams,p,0),d.explanation=v.explanation,d}return Nn=u,Nn}var Pn,Fo;function Av(){if(Fo)return Pn;Fo=1;var e=fr(),t=Hl(),a=function(n,r){function i(c,u,f,g){c=document.createElement("div"),c.setAttribute("style","visibility: hidden;"),document.body.appendChild(c);var d=new t(c,r),p=d.getMeasureWidths(u);return c.parentNode.removeChild(c),{sections:p}}return e.renderEngine(i,"*",n,r)};return Pn=a,Pn}var zn,Ho;function Xa(){if(Ho)return zn;Ho=1;var e={};return zn=e,zn}var In,$o;function Mv(){if($o)return In;$o=1;var e=Xa(),t=function(a,n,r,i){e[n]||(e[n]={});var c=e[n];return c[r]||(c[r]=new Promise(function(u,f){var g=new XMLHttpRequest;let d=a+n+"-mp3/"+r+".mp3";g.open("GET",d,!0),g.responseType="arraybuffer",g.onload=function(){if(g.status!==200){f(Error("Can't load sound at "+d+" status="+g.status));return}var p=function(o){u({instrument:n,name:r,status:"loaded",audioBuffer:o})},l=i.decodeAudioData(g.response,p,function(){f(Error("Can't decode sound at "+d))});l&&typeof l.catch=="function"&&l.catch(f)},g.onerror=function(){f(Error("Can't load sound at "+d))},g.send()}).catch(u=>{throw console.error("Didn't load note",n,r,":",u.message),u})),c[r]};return In=t,In}var Rn,Zo;function Ka(){if(Zo)return Rn;Zo=1;var e=["acoustic_grand_piano","bright_acoustic_piano","electric_grand_piano","honkytonk_piano","electric_piano_1","electric_piano_2","harpsichord","clavinet","celesta","glockenspiel","music_box","vibraphone","marimba","xylophone","tubular_bells","dulcimer","drawbar_organ","percussive_organ","rock_organ","church_organ","reed_organ","accordion","harmonica","tango_accordion","acoustic_guitar_nylon","acoustic_guitar_steel","electric_guitar_jazz","electric_guitar_clean","electric_guitar_muted","overdriven_guitar","distortion_guitar","guitar_harmonics","acoustic_bass","electric_bass_finger","electric_bass_pick","fretless_bass","slap_bass_1","slap_bass_2","synth_bass_1","synth_bass_2","violin","viola","cello","contrabass","tremolo_strings","pizzicato_strings","orchestral_harp","timpani","string_ensemble_1","string_ensemble_2","synth_strings_1","synth_strings_2","choir_aahs","voice_oohs","synth_choir","orchestra_hit","trumpet","trombone","tuba","muted_trumpet","french_horn","brass_section","synth_brass_1","synth_brass_2","soprano_sax","alto_sax","tenor_sax","baritone_sax","oboe","english_horn","bassoon","clarinet","piccolo","flute","recorder","pan_flute","blown_bottle","shakuhachi","whistle","ocarina","lead_1_square","lead_2_sawtooth","lead_3_calliope","lead_4_chiff","lead_5_charang","lead_6_voice","lead_7_fifths","lead_8_bass_lead","pad_1_new_age","pad_2_warm","pad_3_polysynth","pad_4_choir","pad_5_bowed","pad_6_metallic","pad_7_halo","pad_8_sweep","fx_1_rain","fx_2_soundtrack","fx_3_crystal","fx_4_atmosphere","fx_5_brightness","fx_6_goblins","fx_7_echoes","fx_8_scifi","sitar","banjo","shamisen","koto","kalimba","bagpipe","fiddle","shanai","tinkle_bell","agogo","steel_drums","woodblock","taiko_drum","melodic_tom","synth_drum","reverse_cymbal","guitar_fret_noise","breath_noise","seashore","bird_tweet","telephone_ring","helicopter","applause","gunshot","percussion"];return Rn=e,Rn}var qn,Go;function Nv(){if(Go)return qn;Go=1;var e=Ka(),t=function(a){for(var n=[],r=0;r<a.tracks.length;r++)n.push([]);var i=e[0];return a.tracks.forEach(function(c,u){c.forEach(function(f){switch(f.cmd){case"note":var g=f.instrument!==void 0?e[f.instrument]:i;if(f.duration>0){var d=f.gap?f.gap:0,p=f.duration;d=Math.min(d,p*2/3);var l={pitch:f.pitch,instrument:g,start:Math.round(f.start*1e6)/1e6,end:Math.round((f.start+p-d)*1e6)/1e6,volume:f.volume};f.startChar&&(l.startChar=f.startChar),f.endChar&&(l.endChar=f.endChar),f.style&&(l.style=f.style),f.cents&&(l.cents=f.cents),n[u].push(l)}break;case"program":i=e[f.instrument];break;case"text":break;default:console.log("Unhandled midi event",f)}})}),n};return qn=t,qn}var Bn,Uo;function dr(){if(Uo)return Bn;Uo=1;function e(t){if(t)window.abcjsAudioContext=t;else if(!window.abcjsAudioContext){var a=window.AudioContext||window.webkitAudioContext;if(a)window.abcjsAudioContext=new a;else return!1}return window.abcjsAudioContext.state!=="suspended"}return Bn=e,Bn}var Ln,jo;function zt(){if(jo)return Ln;jo=1;var e=dr();function t(){return window.abcjsAudioContext||e(),window.abcjsAudioContext}return Ln=t,Ln}var On,Yo;function pr(){if(Yo)return On;Yo=1;var e=zt();function t(){if(!window.Promise||!window.AudioContext&&!window.webkitAudioContext&&!navigator.mozAudioContext&&!navigator.msAudioContext)return!1;var a=e();if(a)return a.resume!==void 0}return On=t,On}var Dn,Wo;function Ja(){if(Wo)return Dn;Wo=1;var e={21:"A0",22:"Bb0",23:"B0",24:"C1",25:"Db1",26:"D1",27:"Eb1",28:"E1",29:"F1",30:"Gb1",31:"G1",32:"Ab1",33:"A1",34:"Bb1",35:"B1",36:"C2",37:"Db2",38:"D2",39:"Eb2",40:"E2",41:"F2",42:"Gb2",43:"G2",44:"Ab2",45:"A2",46:"Bb2",47:"B2",48:"C3",49:"Db3",50:"D3",51:"Eb3",52:"E3",53:"F3",54:"Gb3",55:"G3",56:"Ab3",57:"A3",58:"Bb3",59:"B3",60:"C4",61:"Db4",62:"D4",63:"Eb4",64:"E4",65:"F4",66:"Gb4",67:"G4",68:"Ab4",69:"A4",70:"Bb4",71:"B4",72:"C5",73:"Db5",74:"D5",75:"Eb5",76:"E5",77:"F5",78:"Gb5",79:"G5",80:"Ab5",81:"A5",82:"Bb5",83:"B5",84:"C6",85:"Db6",86:"D6",87:"Eb6",88:"E6",89:"F6",90:"Gb6",91:"G6",92:"Ab6",93:"A6",94:"Bb6",95:"B6",96:"C7",97:"Db7",98:"D7",99:"Eb7",100:"E7",101:"F7",102:"Gb7",103:"G7",104:"Ab7",105:"A7",106:"Bb7",107:"B7",108:"C8",109:"Db8",110:"D8",111:"Eb8",112:"E8",113:"F8",114:"Gb8",115:"G8",116:"Ab8",117:"A8",118:"Bb8",119:"B8",120:"C9",121:"Db9"};return Dn=e,Dn}var Fn,Vo;function Pv(){if(Vo)return Fn;Vo=1;var e=function(a){return window.URL.createObjectURL(t(a.audioBuffers))};function t(a){var n=a[0],r=n.numberOfChannels,i=n.length*r*2+44,c=new ArrayBuffer(i),u=new DataView(c),f=[],g,d,p=0,l=0;for(h(1179011410),h(i-8),h(1163280727),h(544501094),h(16),o(1),o(r),h(n.sampleRate),h(n.sampleRate*2*r),o(r*2),o(16),h(1635017060),h(i-l-4),g=0;g<r;g++)f.push(n.getChannelData(g));for(;l<i;){for(g=0;g<f.length;g++)d=Math.max(-1,Math.min(1,f[g][p])),d=(.5+d<0?d*32768:d*32767)|0,u.setInt16(l,d,!0),l+=2;p++}return new Blob([c],{type:"audio/wav"});function o(s){u.setUint16(l,s,!0),l+=2}function h(s){u.setUint32(l,s,!0),l+=4}}return Fn=e,Fn}var Hn,Xo;function Zl(){if(Xo)return Hn;Xo=1;function e(t){return Math.pow(2,t/1200)}return Hn=e,Hn}var $n,Ko;function zv(){if(Ko)return $n;Ko=1;var e=Xa(),t=Ja(),a=Zl();function n(i,c,u,f,g,d,p,l,o){var h=window.OfflineAudioContext||window.webkitOfflineAudioContext,s=u.len*u.tempoMultiplier;d&&(s+=d/1e3),s-=l,s<0&&(s=.005);var v=new h(2,Math.floor((s+p)*c),c),y=t[u.pitch];if(!e[u.instrument])return o&&o("placeNote skipped (instrument empty): "+u.instrument+":"+y),Promise.resolve();var m=e[u.instrument][y];return m?m.then(function(_){var k=v.createBufferSource();k.buffer=_.audioBuffer;var x=u.volume/96*g;k.gainNode=v.createGain(),u.pan&&v.createStereoPanner&&(k.panNode=v.createStereoPanner(),k.panNode.pan.setValueAtTime(u.pan,0)),k.gainNode.gain.value=x,k.gainNode.gain.linearRampToValueAtTime(k.gainNode.gain.value,s),k.gainNode.gain.linearRampToValueAtTime(0,s+p),u.cents&&(k.playbackRate.value=a(u.cents)),k.panNode?(k.panNode.connect(v.destination),k.gainNode.connect(k.panNode)):k.gainNode.connect(v.destination),k.connect(k.gainNode),k.start(0),k.noteOff?k.noteOff(s+p):k.stop(s+p);var R;return v.oncomplete=function(I){if(I.renderedBuffer&&I.renderedBuffer.getChannelData)for(var b=0;b<f.length;b++){var A=f[b]*u.tempoMultiplier;d&&(A-=d/1e3),A<0&&(A=0),A=Math.floor(A*c),r(i,I.renderedBuffer,A)}o&&o("placeNote: "+u.instrument+":"+y),R()},v.startRendering(),new Promise(function(I){R=I})}).catch(function(_){return o&&o("placeNote catch: "+_.message),Promise.reject(_)}):(o&&o("placeNote skipped: "+u.instrument+":"+y),Promise.resolve())}var r=function(i,c,u){for(var f=0;f<2;f++)for(var g=c.getChannelData(f),d=i.getChannelData(f),p=0;p<g.length;p++)d[p+u]+=g[p]};return $n=n,$n}var Zn,Jo;function Qa(){if(Jo)return Zn;Jo=1;var e=Mv(),t=Nv(),a=dr(),n=zt(),r=pr(),i=Ja(),c=Ka(),u=Pv(),f=zv(),g=Xa(),d="MIDI is not supported in this browser.",p="https://paulrosen.github.io/midi-js-soundfonts/abcjs/",l="https://paulrosen.github.io/midi-js-soundfonts/FluidR3_GM/",o="https://paulrosen.github.io/midi-js-soundfonts/MusyngKite/";function h(){var s=this;s.audioBufferPossible=void 0,s.directSource=[],s.startTimeSec=void 0,s.pausedTimeSec=void 0,s.audioBuffers=[],s.duration=void 0,s.isRunning=!1,s.options={},s.pickupLength=0,s.init=function(m){m||(m={}),m.options&&(s.options=m.options),a(m.audioContext);var _=n().currentTime;if(s.debugCallback=m.debugCallback,s.debugCallback&&s.debugCallback("init called"),s.audioBufferPossible=s._deviceCapable(),!s.audioBufferPossible)return Promise.reject({status:"NotSupported",message:d});var k=m.options?m.options:{};s.soundFontUrl=k.soundFontUrl?k.soundFontUrl:l,s.soundFontUrl[s.soundFontUrl.length-1]!=="/"&&(s.soundFontUrl+="/"),k.soundFontVolumeMultiplier||k.soundFontVolumeMultiplier===0?s.soundFontVolumeMultiplier=k.soundFontVolumeMultiplier:s.soundFontUrl===l||s.soundFontUrl===o?s.soundFontVolumeMultiplier=3:s.soundFontUrl===p?s.soundFontVolumeMultiplier=.4:s.soundFontVolumeMultiplier=1,k.programOffsets?s.programOffsets=k.programOffsets:s.soundFontUrl===p?s.programOffsets={bright_acoustic_piano:20,honkytonk_piano:20,electric_piano_1:30,electric_piano_2:30,harpsichord:40,clavinet:20,celesta:20,glockenspiel:40,vibraphone:30,marimba:35,xylophone:30,tubular_bells:35,dulcimer:30,drawbar_organ:20,percussive_organ:25,rock_organ:20,church_organ:40,reed_organ:40,accordion:40,harmonica:40,acoustic_guitar_nylon:20,acoustic_guitar_steel:30,electric_guitar_jazz:25,electric_guitar_clean:15,electric_guitar_muted:35,overdriven_guitar:25,distortion_guitar:20,guitar_harmonics:30,electric_bass_finger:15,electric_bass_pick:30,fretless_bass:40,violin:105,viola:50,cello:40,contrabass:60,trumpet:10,trombone:90,alto_sax:20,tenor_sax:20,clarinet:20,flute:50,banjo:50,woodblock:20}:s.programOffsets={};var x=k.fadeLength!==void 0?parseInt(k.fadeLength,10):NaN;if(s.fadeLength=isNaN(x)?200:x,x=k.noteEnd!==void 0?parseInt(k.noteEnd,10):NaN,s.noteEnd=isNaN(x)?0:x,s.pan=k.pan,s.meterSize=1,m.visualObj){s.flattened=m.visualObj.setUpAudio(k);var R=m.visualObj.getMeterFraction();R.den&&(s.meterSize=R.num/R.den),s.pickupLength=m.visualObj.getPickupLength()}else if(m.sequence)s.flattened=m.sequence;else return Promise.reject(new Error("Must pass in either a visualObj or a sequence"));s.millisecondsPerMeasure=m.millisecondsPerMeasure?m.millisecondsPerMeasure:m.visualObj?m.visualObj.millisecondsPerMeasure(s.flattened.tempo):1e3,s.beatsPerMeasure=m.visualObj?m.visualObj.getBeatsPerMeasure():4,s.sequenceCallback=k.sequenceCallback,s.callbackContext=k.callbackContext,s.onEnded=k.onEnded,s.meterFraction=m.visualObj?m.visualObj.getMeterFraction():{den:1};var I={},b=[],A=[],N=c[0];s.flattened.tracks.forEach(function(T){T.forEach(function(P){if(P.cmd==="program"&&c[P.instrument]&&(N=c[P.instrument]),P.pitch!==void 0){var B=P.pitch,O=i[B],w=P.instrument!==void 0?c[P.instrument]:N;if(O)if(I[w]||(I[w]={}),!g[w]||!g[w][O])I[w][O]=!0;else{var C=w+":"+O;b.indexOf(C)<0&&b.push(C)}else{var S=w+":"+O;console.log("Can't find note: ",B,S),A.indexOf(S)<0&&A.push(S)}}})}),s.debugCallback&&s.debugCallback("note gathering time = "+Math.floor((n().currentTime-_)*1e3)+"ms"),_=n().currentTime;var M=[];Object.keys(I).forEach(function(T){Object.keys(I[T]).forEach(function(P){M.push({instrument:T,note:P})})}),s.debugCallback&&s.debugCallback("notes "+JSON.stringify(M));for(var z=[],L=256,E=0;E<M.length;E+=L)z.push(M.slice(E,E+L));return new Promise(function(T,P){var B={cached:b,error:A,loaded:[]},O=0,w=function(){s.debugCallback&&s.debugCallback("loadBatch idx="+O+" len="+z.length),O<z.length?s._loadBatch(z[O],s.soundFontUrl,_).then(function(C){s.debugCallback&&s.debugCallback("loadBatch then"),_=n().currentTime,C&&(C.error&&(B.error=B.error.concat(C.error)),C.loaded&&(B.loaded=B.loaded.concat(C.loaded))),O++,w()},P):(s.debugCallback&&s.debugCallback("resolve init"),T(B))};w()})},s._loadBatch=(function(m,_,k,x){var R=[];return m.forEach(function(I){s.debugCallback&&s.debugCallback("getNote "+I.instrument+":"+I.note),R.push(e(_,I.instrument,I.note,n()))}),Promise.all(R).then(function(I){s.debugCallback&&s.debugCallback("mp3 load time = "+Math.floor((n().currentTime-k)*1e3)+"ms");for(var b=[],A=[],N=[],M=[],z=0;z<I.length;z++){var L=I[z],E=L.instrument+":"+L.name;L.status==="loaded"?b.push(E):L.status==="pending"?N.push(E):L.status==="cached"?A.push(E):M.push(E+" "+L.message)}if(N.length>0){if(s.debugCallback&&s.debugCallback("pending "+JSON.stringify(N)),x?x=x*2:x=50,x<9e4)return new Promise(function(B,O){setTimeout(function(){var w=[];for(z=0;z<N.length;z++)E=N[z].split(":"),w.push({instrument:E[0],note:E[1]});s.debugCallback&&s.debugCallback("retry "+JSON.stringify(w)),s._loadBatch(w,_,k,x).then(function(C){B(C)}).catch(function(C){O(C)})},x)});for(var T=[],P=0;P<m.length;P++)T.push(m[P].instrument+"/"+m[P].note);return s.debugCallback&&s.debugCallback("loadBatch timeout"),Promise.reject(new Error("timeout attempting to load: "+T.join(", ")))}else return s.debugCallback&&s.debugCallback("loadBatch resolve"),Promise.resolve({loaded:b,cached:A,error:M})}).catch(function(I){s.debugCallback&&s.debugCallback("loadBatch catch "+I.message)})}),s.prime=function(){var m=s.fadeLength/1e3;return s.isRunning=!1,s.audioBufferPossible?(s.debugCallback&&s.debugCallback("prime called"),new Promise(function(_,k){try{let O=function(w){var C=w&&w.audioBuffers&&w.audioBuffers.length>0?w.audioBuffers[0].duration:0;return{status:n().state,duration:C}};var B=O,x=n().currentTime,R=s.millisecondsPerMeasure/1e3/s.meterSize;if(s.duration=s.flattened.totalDuration*R,s.duration<=0)return s.audioBuffers=[],_({status:"empty",seconds:0});s.duration+=m;var I=Math.floor(n().sampleRate*s.duration);s.stop();var b=t(s.flattened);s.options.swing&&y(b,s.options.swing,s.meterFraction,s.pickupLength),s.sequenceCallback&&s.sequenceCallback(b,s.callbackContext);var A=v(b.length,s.pan),N={};b.forEach(function(w,C){var S=A&&A.length>C?A[C]:0;w.forEach(function(q){var D=q.instrument+":"+q.pitch+":"+q.volume+":"+Math.round((q.end-q.start)*1e3)/1e3+":"+S+":"+R+":"+(q.cents?q.cents:0);s.debugCallback&&s.debugCallback("noteMapTrack "+D),N[D]||(N[D]=[]),N[D].push(q.start)})});for(var M=[],z=n().createBuffer(2,I,n().sampleRate),L=0;L<Object.keys(N).length;L++){var E=Object.keys(N)[L],T=E.split(":"),P=T[6]!==void 0?parseFloat(T[6]):0;T={instrument:T[0],pitch:parseInt(T[1],10),volume:parseInt(T[2],10),len:parseFloat(T[3]),pan:parseFloat(T[4]),tempoMultiplier:parseFloat(T[5]),cents:P},M.push(f(z,n().sampleRate,T,N[E],s.soundFontVolumeMultiplier,s.programOffsets[T.instrument],m,s.noteEnd/1e3,s.debugCallback))}s.audioBuffers=[z],s.debugCallback&&(s.debugCallback("sampleRate = "+n().sampleRate),s.debugCallback("totalSamples = "+I),s.debugCallback("creationTime = "+Math.floor((n().currentTime-x)*1e3)+"ms")),Promise.all(M).then(function(){n().state==="suspended"?n().resume().then(function(){_(O(s))}):n().state==="interrupted"?n().suspend().then(function(){n().resume().then(function(){_(O(s))})}):_(O(s))}).catch(function(w){k(w)})}catch(O){k(O)}})):Promise.reject(new Error(d))};function v(m,_){if(_==null)return null;var k=[];if(_.length){for(var x=0;x<m;x++)if(x<_.length){var R=parseFloat(_[x]);R<-1?R=-1:R>1&&(R=1),k.push(R)}else k.push(0);return k}else{var I=parseFloat(_);if(I*(m-1)>2)return null;for(var b=m%2===0,A=b?0-I/2:0,N=A+I,M=0;M<m;M++)b=M%2===0,b?(k.push(A),A-=I):(k.push(N),N+=I);return k}}s.start=function(){if(!s.audioBufferPossible)throw new Error(d);s.debugCallback&&s.debugCallback("start called");var m=s.pausedTimeSec?s.pausedTimeSec:0;s._kickOffSound(m),s.startTimeSec=n().currentTime-m,s.pausedTimeSec=void 0,s.debugCallback&&s.debugCallback("MIDI STARTED",s.startTimeSec)},s.pause=function(){if(!s.audioBufferPossible)throw new Error(d);return s.debugCallback&&s.debugCallback("pause called"),s.pausedTimeSec=s.stop(),s.pausedTimeSec},s.resume=function(){s.start()},s.seek=function(m,_){var k;switch(_){case"seconds":k=m;break;case"beats":k=m*s.millisecondsPerMeasure/s.beatsPerMeasure/1e3;break;default:k=(s.duration-s.fadeLength/1e3)*m;break}if(!s.audioBufferPossible)throw new Error(d);s.debugCallback&&s.debugCallback("seek called sec="+k),s.isRunning?(s.stop(),s._kickOffSound(k)):s.pausedTimeSec=k,s.pausedTimeSec=k},s.stop=function(){s.isRunning=!1,s.pausedTimeSec=void 0,s.directSource.forEach(function(_){try{_.stop()}catch(k){console.log("direct source didn't stop:",k)}}),s.directSource=[];var m=n().currentTime-s.startTimeSec;return m},s.finished=function(){s.startTimeSec=void 0,s.pausedTimeSec=void 0,s.isRunning=!1},s.download=function(){return u(s)},s.getAudioBuffer=function(){return s.audioBuffers[0]},s.getIsRunning=function(){return s.isRunning},s._deviceCapable=function(){return r()?!0:(console.warn(d),s.debugCallback&&s.debugCallback(d),!1)},s._kickOffSound=function(m){s.isRunning=!0,s.directSource=[],s.audioBuffers.forEach(function(_,k){s.directSource[k]=n().createBufferSource(),s.directSource[k].buffer=_,s.directSource[k].connect(n().destination)}),s.directSource.forEach(function(_){_.start(0,m)}),s.onEnded&&(s.directSource[0].onended=function(){s.onEnded(s.callbackContext)})};function y(m,_,k,x){if(!(k.den!=4&&k.den!=8)&&(_=parseFloat(_),!(isNaN(_)||_<=50))){_>75&&(_=75),_=_/50-1;var R=0,I=.25;k.den===8&&(I=I/2);for(var b=I/2,A=b*_,N=0;N<m.length;N++)for(var M=m[N],z=0;z<M.length;z++){var L=M[z];if((L.start-x)%b==0&&(L.start-x)%I!=0&&(z==0||M[z-1].start<=M[z].start-b)&&(z==M.length-1||M[z+1].start>=M[z].start+b)){var E=L.start;L.start+=A,L.volume*=1+R,z>0&&M[z-1].end==E&&(M[z-1].end=L.start,M[z-1].volume*=1-R)}}}}}return Zn=h,Zn}var Gn,Qo;function Gl(){if(Qo)return Gn;Qo=1;var e=function(){var t=this;t.tracks=[],t.totalDuration=0,t.currentInstrument=[],t.starts=[],t.addTrack=function(){return t.tracks.push([]),t.currentInstrument.push(0),t.starts.push(0),t.tracks.length-1},t.setInstrument=function(a,n){t.tracks[a].push({channel:0,cmd:"program",instrument:n}),t.currentInstrument[a]=n},t.appendNote=function(a,n,r,i,c){var u={cmd:"note",duration:r,gap:0,instrument:t.currentInstrument[a],pitch:n,start:t.starts[a],volume:i};c&&(u.cents=c),t.tracks[a].push(u),t.starts[a]+=r,t.totalDuration=Math.max(t.totalDuration,t.starts[a])}};return Gn=e,Gn}var Un,ec;function Iv(){if(ec)return Un;ec=1;var e=`
|
|
123
|
+
`),u.font.box&&(r||a.paper.openGroup({klass:u.attr.class,fill:a.foregroundColor,"data-name":n.name}),u.attr["text-anchor"]==="end"?u.attr.x-=u.font.padding:u.attr["text-anchor"]==="start"&&(u.attr.x+=u.font.padding),u.attr.y+=u.font.padding,delete u.attr.class),n.noClass&&delete u.attr.class,u.attr.x=e(u.attr.x),u.attr.y=e(u.attr.y),n.name&&(u.attr["data-name"]=n.name);var g=a.paper.text(f,u.attr);if(u.font.box){var d=g.getBBox(),p=0;u.attr["text-anchor"]==="middle"?p=d.width/2+u.font.padding:u.attr["text-anchor"]==="end"&&(p=d.width+u.font.padding*2);var l=0;n.centerVertically&&(l=d.height-u.font.padding),a.paper.rect({"data-name":"box",x:Math.round(n.x-p),y:Math.round(i-l),width:Math.round(d.width+u.font.padding*2),height:Math.round(d.height+u.font.padding*2)}),r||(g=a.paper.closeGroup())}return g}return e0=t,e0}var t0,lo;function ov(){if(lo)return t0;lo=1;var e=_t(),t=Ve(),a=gt();function n(f,g,d){var p=g.startVoice.staff.absoluteY-t.STEP*10;return g.endVoice&&g.endVoice.staff?g.endY=g.endVoice.staff.absoluteY-t.STEP*2:g.lastContinuedVoice&&g.lastContinuedVoice.staff?g.endY=g.lastContinuedVoice.staff.absoluteY-t.STEP*2:g.endY=g.startVoice.staff.absoluteY-t.STEP*2,u(f,g.x,p,g.endY,g.type,g.header,d)}function r(f,g,d,p,l){g+=t.STEP;var o=t.STEP*.75,h=t.STEP*.75,s=p-d,v=e("M %f %f l %f %f l %f %f l %f %f z",g,d-h,0,s+h*2,o,0,0,-(s+h*2)),y=t.STEP*2,m=t.STEP;return v+=e("M %f %f q %f %f %f %f q %f %f %f %f z",g+o,d-h,y*.6,m*.2,y,-m,-y*.1,m*.3,-y,m+t.STEP),v+=e("M %f %f q %f %f %f %f q %f %f %f %f z",g+o,d+h+s,y*.6,-m*.2,y,m,-y*.1,-m*.3,-y,-m-t.STEP),f.paper.path({path:v,stroke:f.foregroundColor,fill:f.foregroundColor,class:f.controller.classes.generate(l),"data-name":l})}function i(f,g,d,p,l){var o=p-d,h=c(g,d,[7.5,-8,21,0,18.5,-10.5,7.5],[0,o/5.5,o/3.14,o/2,o/2.93,o/4.88,0]);return h+=c(g,d,[0,17.5,-7.5,6.6,-5,20,0],[o/2,o/1.46,o/1.22,o,o/1.19,o/1.42,o/2]),f.paper.path({path:h,stroke:f.foregroundColor,fill:f.foregroundColor,class:f.controller.classes.generate(l),"data-name":l})}function c(f,g,d,p){return e("M %f %f C %f %f %f %f %f %f C %f %f %f %f %f %f z",f+d[0],g+p[0],f+d[1],g+p[1],f+d[2],g+p[2],f+d[3],g+p[3],f+d[4],g+p[4],f+d[5],g+p[5],f+d[6],g+p[6])}var u=function(f,g,d,p,l,o,h){var s;if(o){f.paper.openGroup({klass:f.controller.classes.generate("staff-extra voice-name"),"data-name":l});var v=d+(p-d)/2;v=v-f.controller.getTextSize.baselineToCenter(o,"voicefont","staff-extra voice-name",0,1),a(f,{x:f.padding.left,y:v,text:o,type:"voicefont",klass:"staff-extra voice-name",anchor:"start",centerVertically:!0})}return l==="brace"?s=i(f,g,d,p,l):l==="bracket"&&(s=r(f,g,d,p,l)),o&&(s=f.paper.closeGroup()),h.wrapSvgEl({el_type:l,startChar:-1,endChar:-1},s),s};return t0=n,t0}var r0,uo;function jt(){if(uo)return r0;uo=1;function e(t,a,n){var r=t.paper.path(a);return r}return r0=e,r0}var n0,ho;function cv(){if(ho)return n0;ho=1;var e=_t(),t=jt(),a=it();function n(s,v,y){(!v.anchor1||!v.anchor2||!v.anchor1.heads||!v.anchor2.heads||v.anchor1.heads.length===0||v.anchor2.heads.length===0)&&window.console.error("Glissando Element not set.");var m=4,_=s.calcY(v.anchor1.heads[0].pitch),k=s.calcY(v.anchor2.heads[0].pitch),x=v.anchor1.x+v.anchor1.w/2,R=v.anchor2.x+v.anchor2.w/2,I=r(x,_,R,k),b=v.anchor1.w/2+m,A=v.anchor2.w/2+m,N=i(x,_,R,k),M=c(_,N,b);c(k,N,-A);var z=u(I-b-A),L=h(s,x+b,M,z,N);return y.wrapSvgEl({el_type:"glissando",startChar:-1,endChar:-1},L),[L]}function r(s,v,y,m){var _=y-s,k=m-v;return Math.sqrt(_*_+k*k)}function i(s,v,y,m){return(m-v)/(y-s)}function c(s,v,y){return a(s+y*v)}function u(s){var v=5;return Math.max(2,Math.floor((s-v*2)/6))}var f=[[3.5,-4.8]],g=[[1.5,-1],[.3,-.3],[-3.5,3.8]],d=[[-1.5,2]],p=[[3,4],[3,-4]],l=[[-3,4],[-3,-4]];function o(s,v){for(var y="",m=0;m<s.length;m++)y+="l"+s[m][0]+" "+c(s[m][1],v,s[m][0]);return y}var h=function(s,v,y,m,_){var k=e("M %f %f",v,y);k+=o(f,_);var x;for(x=0;x<m;x++)k+=o(p,_);for(k+=o(g,_),x=0;x<m;x++)k+=o(l,_);return k+=o(d,_)+"z",t(s,{path:k,highlight:"stroke",stroke:s.foregroundColor,class:s.controller.classes.generate("decoration"),"data-name":"glissando"})};return n0=n,n0}var a0,fo;function lv(){if(fo)return a0;fo=1;var e=_t(),t=jt(),a=it();function n(i,c,u){c.pitch===void 0&&window.console.error("Crescendo Element y-coordinate not set.");var f=i.calcY(c.pitch)+4,g=8,d=c.anchor1?c.anchor1.x:0,p=c.anchor2?c.anchor2.x:800,l;return c.dir==="<"?l=r(i,f+g/2,f,f+g/2,f+g,d,p):l=r(i,f,f+g/2,f+g,f+g/2,d,p),u.wrapSvgEl({el_type:"dynamicDecoration",startChar:-1,endChar:-1},l),[l]}var r=function(i,c,u,f,g,d,p){c=a(c),u=a(u),f=a(f),g=a(g),d=a(d),p=a(p);var l=e("M %f %f L %f %f M %f %f L %f %f",d,c,p,u,d,f,p,g);return t(i,{path:l,highlight:"stroke",stroke:i.foregroundColor,class:i.controller.classes.generate("dynamics decoration"),"data-name":"dynamics"})};return a0=n,a0}var i0,po;function Ya(){if(po)return i0;po=1;var e=it();function t(){this.ingroup=!1}t.prototype.beginGroup=function(n,r){this.paper=n,this.controller=r,this.path=[],this.lastM=[0,0],this.ingroup=!0,this.paper.openGroup()},t.prototype.isInGroup=function(){return this.ingroup},t.prototype.addPath=function(n){if(n=n||[],n.length!==0){n[0][0]="m",n[0][1]=e(n[0][1]-this.lastM[0]),n[0][2]=e(n[0][2]-this.lastM[1]),this.lastM[0]+=n[0][1],this.lastM[1]+=n[0][2],this.path.push(n[0]);for(var r=1,i=n.length;r<i;r++)n[r][0]==="m"&&(this.lastM[0]+=n[r][1],this.lastM[1]+=n[r][2]),this.path.push(n[r])}},t.prototype.endGroup=function(n,r){this.ingroup=!1;for(var i="",c=0;c<this.path.length;c++)i+=this.path[c].join(" ");this.path=[];var u=this.paper.closeGroup();return u&&(u.setAttribute("class",this.controller.classes.generate(n)),u.setAttribute("fill",this.controller.renderer.foregroundColor),u.setAttribute("stroke","none"),u.setAttribute("data-name",r)),u};var a=new t;return i0=a,i0}var s0,go;function Wa(){if(go)return s0;go=1;var e=gt(),t=pt(),a=Ya();function n(i,c,u,f,g){var d,p;if(!f)return null;if(f.length>1&&f.indexOf(".")<0){var l=a.isInGroup()?"":g.klass;i.paper.openGroup({"data-name":g.name,klass:l});for(var o=0,h=0;h<f.length;h++){var s=f[h];p=t.getYCorr(s),d=t.printSymbol(c+o,i.calcY(u+p),s,i.paper,{stroke:g.stroke,fill:g.fill}),d?h<f.length-1&&(o+=r(s,f[h+1],t.getSymbolWidth(s))):e(i,{x:c,y:i.y,text:"no symbol:"+f,type:"debugfont",klass:"debug-msg",anchor:"start"},!1)}var v=i.paper.closeGroup();return v}else return p=t.getYCorr(f),a.isInGroup()?d=t.printSymbol(c,i.calcY(u+p),f,i.paper,{"data-name":g.name}):d=t.printSymbol(c,i.calcY(u+p),f,i.paper,{klass:g.klass,stroke:g.stroke,fill:g.fill,"data-name":g.name}),d||(e(i,{x:c,y:i.y,text:"no symbol:"+f,type:"debugfont",klass:"debug-msg",anchor:"start"},!1),null)}function r(i,c,u){var f=u;return i==="f"&&c==="f"&&(f=f*2/3),i==="p"&&c==="p"&&(f=f*5/6),i==="f"&&c==="z"&&(f=f*5/8),f}return s0=n,s0}var o0,vo;function uv(){if(vo)return o0;vo=1;var e=Wa();function t(a,n,r){n.pitch===void 0&&window.console.error("Dynamic Element y-coordinate not set.");var i=1,c=1,u=e(a,n.anchor.x,n.pitch,n.dec,{scalex:i,scaley:c,klass:a.controller.classes.generate("decoration dynamics"),fill:a.foregroundColor,stroke:"none",name:"dynamics"});return r.wrapSvgEl({el_type:"dynamicDecoration",startChar:-1,endChar:-1,decoration:n.dec},u),[u]}return o0=t,o0}var c0,mo;function hv(){if(mo)return c0;mo=1;var e=_t(),t=gt(),a=jt(),n=it();function r(u,f,g){u.paper.openGroup({klass:u.controller.classes.generate("triplet "+f.durationClass),"data-name":"triplet"}),f.hasBeam||c(u,f.anchor1.x,f.startNote,f.anchor2.x+f.anchor2.w,f.endNote),t(u,{x:f.xTextPos,y:u.calcY(f.yTextPos-1),text:""+f.number,type:"tripletfont",anchor:"middle",centerVertically:!0,noClass:!0,name:""+f.number},!0);var d=u.paper.closeGroup();return g.wrapSvgEl({el_type:"triplet",startChar:-1,endChar:-1},d),d}function i(u,f,g,d){return e("M %f %f L %f %f",n(u),n(f),n(g),n(d))}function c(u,f,g,d,p){g=u.calcY(g),p=u.calcY(p);var l=5,o="";o+=i(f,g,f,g+l),o+=i(d,p,d,p+l);var h=f+(d-f)/2,s=8,v=(p-g)/(d-f),y=h-s,m=g+(y-f)*v;o+=i(f,g,y,m);var _=h+s,k=g+(_-f)*v;o+=i(_,k,d,p),a(u,{path:o,stroke:u.foregroundColor,"data-name":"triplet-bracket"})}return c0=r,c0}var l0,bo;function fv(){if(bo)return l0;bo=1;var e=_t(),t=gt(),a=jt(),n=it();function r(i,c,u,f,g){c.pitch===void 0&&window.console.error("Ending Element y-coordinate not set.");var d=n(i.calcY(c.pitch)),p=20,l="";c.anchor1&&(u=n(c.anchor1.x+c.anchor1.w),l+=e("M %f %f L %f %f ",u,d,u,n(d+p))),c.anchor2&&(f=n(c.anchor2.x),l+=e("M %f %f L %f %f ",f,d,f,n(d+p))),l+=e("M %f %f L %f %f ",u,d,f,d),i.paper.openGroup({klass:i.controller.classes.generate("ending"),fill:i.foregroundColor,"data-name":"ending"}),a(i,{path:l,stroke:i.foregroundColor,fill:i.foregroundColor,"data-name":"line"}),c.anchor1&&t(i,{x:n(u+5),y:n(i.calcY(c.pitch-.5)),text:c.text,type:"repeatfont",klass:"ending",anchor:"start",noClass:!0,name:c.text});var o=i.paper.closeGroup();return g.wrapSvgEl({el_type:"ending",startChar:-1,endChar:-1},o),[o]}return l0=r,l0}var u0,yo;function dv(){if(yo)return u0;yo=1;var e=_t(),t=it();function a(i,c,u,f,g){n(c,u,f);var d="";c.anchor1?d+="abcjs-start-m"+c.anchor1.parent.counters.measure+"-n"+c.anchor1.parent.counters.note:d+="abcjs-start-edge",c.anchor2?d+=" abcjs-end-m"+c.anchor2.parent.counters.measure+"-n"+c.anchor2.parent.counters.note:d+=" abcjs-end-edge",c.hint&&(d="abcjs-hint");var p=c.fixedY?1.5:0,l=r(i,c.startX,c.endX,c.startY+p,c.endY+p,c.above,d,c.isTie,c.dotted),o=-1;c.anchor1&&!c.isTie&&(o=c.anchor1.parent.abcelem.startChar-1);var h=-1;return c.anchor2&&!c.isTie&&(h=c.anchor2.parent.abcelem.endChar+1),g.wrapSvgEl({el_type:"slur",startChar:o,endChar:h},l),[l]}var n=function(i,c,u){!i.anchor1||!i.anchor2||i.anchor1.pitch===i.anchor2.pitch&&i.internalNotes.length===0?i.isTie=!0:i.isTie=!1,i.isTie?(i.calcTieDirection(),i.calcX(c,u),i.calcTieY()):(i.calcSlurDirection(),i.calcX(c,u),i.calcSlurY()),i.avoidCollisionAbove()},r=function(i,c,u,f,g,d,p,l,o){var h=l?1.2:1.5;c=t(c+6),u=t(u+4),f=f+(d?h:-h),g=g+(d?h:-h);var s=t(i.calcY(f)),v=t(i.calcY(g)),y=u-c,m=v-s,_=Math.sqrt(y*y+m*m),k=y/_,x=m/_,R=_/3.5,I=l?10:25,b=(d?-1:1)*Math.min(I,Math.max(4,R)),A=t(c+R*k-b*x),N=t(s+R*x+b*k),M=t(u-R*k-b*x),z=t(v-R*x+b*k),L=2;p?p+=" slur":p="slur",p+=l?" tie":" legato";var E;if(o){p+=" dotted";var T=e("M %f %f C %f %f %f %f %f %f",c,s,A,N,M,z,u,v);E=i.paper.path({path:T,stroke:i.foregroundColor,fill:"none","stroke-dasharray":"5 5",class:i.controller.classes.generate(p),"data-name":l?"tie":"slur"})}else{var P=e("M %f %f C %f %f %f %f %f %f C %f %f %f %f %f %f z",c,s,A,N,M,z,u,v,t(M-L*x),t(z+L*k),t(A-L*x),t(N+L*k),c,s);E=i.paper.path({path:P,stroke:"none",fill:i.foregroundColor,class:i.controller.classes.generate(p),"data-name":l?"tie":"slur"})}return E};return u0=a,u0}var h0,wo;function pv(){if(wo)return h0;wo=1;var e=jt(),t=it();function a(c,u){if(u.beams.length!==0){for(var f="",g=0;g<u.beams.length;g++){var d=u.beams[g];if(d.split){for(var p=r(c,d.startX,d.startY,d.endX,d.endY),l=[],o=0;o<d.split.length;o+=2)l.push([d.split[o],d.split[o+1]]);for(o=0;o<l.length;o++){var h=i(d.startX,d.startY,p,l[o][0]),s=i(d.startX,d.startY,p,l[o][1]);f+=n(c,l[o][0],h,l[o][1],s,d.dy)}}else f+=n(c,d.startX,d.startY,d.endX,d.endY,d.dy)}var v=("abcjs-d"+u.duration).replace(/\./g,"-"),y=c.controller.classes.generate("beam-elem "+v),m=e(c,{path:f,stroke:"none",fill:c.foregroundColor,class:y});return[m]}}function n(c,u,f,g,d,p){f=t(c.calcY(f)),d=t(c.calcY(d)),u=t(u),g=t(g);var l=t(f+p),o=t(d+p);return"M"+u+" "+f+" L"+g+" "+d+"L"+g+" "+o+" L"+u+" "+l+"z"}function r(c,u,f,g,d){return(d-f)/(g-u)}function i(c,u,f,g){var d=g-c;return u+d*f}return h0=a,h0}var f0,_o;function Va(){if(_o)return f0;_o=1;var e=Ya(),t=it();function a(n,r,i,c,u,f,g){if(i<0||c<u){var d=t(u);u=t(c),c=d}else c=t(c),u=t(u);r=t(r);var p=t(r+i);if(n.firefox112){r+=i/2;var o={x1:r,x2:r,y1:c,y2:u,stroke:n.foregroundColor,"stroke-width":Math.abs(i)};return f&&(o.class=f),g&&(o["data-name"]=g),n.paper.lineToBack(o)}for(var l=[["M",r,c],["L",r,u],["L",p,u],["L",p,c],["z"]],o={path:""},h=0;h<l.length;h++)o.path+=l[h].join(" ");return f&&(o.class=f),g&&(o["data-name"]=g),e.isInGroup()||(o.stroke="none",o.fill=n.foregroundColor),n.paper.pathToBack(o)}return f0=a,f0}var d0,ko;function gv(){if(ko)return d0;ko=1;var e=_t(),t=it();function a(n,r,i,c,u,f,g){var d=n.foregroundColor;r=t(r),i=t(i);var p=t(c-g),l=t(c+g);if(n.firefox112){c+=g/2;var o={x1:r,x2:i,y1:c,y2:c,stroke:n.foregroundColor,"stroke-width":Math.abs(g*2)};return u&&(o.class=u),f&&(o["data-name"]=f),n.paper.lineToBack(o)}var h=e("M %f %f L %f %f L %f %f L %f %f z",r,p,i,p,i,l,r,l),s={path:h,stroke:"none",fill:d};f&&(s["data-name"]=f),u&&(s.class=u);var v=n.paper.pathToBack(s);return v}return d0=a,d0}var p0,xo;function Ol(){if(xo)return p0;xo=1;var e=gv();function t(a,n,r,i,c,u,f){var g=a.calcY(i);return e(a,n,r,g,c,u,f)}return p0=t,p0}var g0,Co;function Dl(){if(Co)return g0;Co=1;var e=gt(),t=Va(),a=Ol(),n=Wa();function r(c,u,f){u.pitch===void 0&&window.console.error(u.type+" Relative Element y-coordinate not set.");var g=c.calcY(u.pitch);switch(u.type){case"symbol":if(u.c===null)return null;var d="symbol";u.klass&&(d+=" "+u.klass),u.graphelem=n(c,u.x,u.pitch,u.c,{scalex:u.scalex,scaley:u.scaley,klass:c.controller.classes.generate(d),name:u.name});break;case"debug":u.graphelem=e(c,{x:u.x,y:c.calcY(15),text:""+u.c,type:"debugfont",klass:c.controller.classes.generate("debug-msg"),anchor:"start",centerVertically:!1,dim:u.dim},!1);break;case"tabNumber":var p="middle",l="tabnumberfont",o="abcjs-tab-number";u.isGrace&&(l="tabgracefont",g+=2.5,o="tab-grace"),u.graphelem=e(c,{x:u.x,y:g,text:""+u.c,type:l,klass:c.controller.classes.generate(o),anchor:p,centerVertically:!1,dim:u.dim,cursor:"default"},!1);break;case"barNumber":u.graphelem=e(c,{x:u.x,y:g,text:""+u.c,type:"measurefont",klass:c.controller.classes.generate("bar-number"),anchor:"middle",dim:u.dim,name:"bar-number"},!0);break;case"lyric":u.graphelem=e(c,{x:u.x,y:g,text:u.c,type:"vocalfont",klass:c.controller.classes.generate("lyric"),anchor:"middle",dim:u.dim,name:"lyric"},!1);break;case"chord":u.graphelem=e(c,{x:u.x,y:g,text:u.c,type:"gchordfont",klass:c.controller.classes.generate("chord"),anchor:"middle",dim:u.dim,lane:u.getLane(),name:"chord"},!1);break;case"decoration":u.graphelem=e(c,{x:u.x,y:g+6,text:u.c,type:"annotationfont",klass:c.controller.classes.generate("annotation"),anchor:u.anchor,centerVertically:!0,dim:u.dim},!1);break;case"text":u.graphelem=e(c,{x:u.x,y:g,text:u.c,type:"annotationfont",klass:c.controller.classes.generate("annotation"),anchor:"start",centerVertically:u.centerVertically,dim:u.dim,lane:u.getLane(),name:"annotation"},!1);break;case"multimeasure-text":u.graphelem=e(c,{x:u.x+u.w/2,y:g,text:u.c,type:"tempofont",klass:c.controller.classes.generate("rest"),anchor:"middle",centerVertically:!1,dim:u.dim},!1);break;case"part":u.graphelem=e(c,{x:u.x,y:g,text:u.c,type:"partsfont",klass:c.controller.classes.generate("part"),anchor:"start",dim:u.dim,name:u.c},!0);break;case"bar":u.graphelem=t(c,u.x,u.linewidth+c.lineThickness,g,f||c.calcY(u.pitch2),null,"bar");break;case"stem":var h=u.linewidth>0?u.linewidth+c.lineThickness:u.linewidth-c.lineThickness;u.graphelem=t(c,u.x,h,g,c.calcY(u.pitch2),"abcjs-stem","stem");break;case"ledger":u.graphelem=a(c,u.x,u.x+u.w,u.pitch,"abcjs-ledger","ledger",.35+c.lineThickness);break}return u.scalex!==1&&u.graphelem&&i(c.paper,u.graphelem,u.scalex,u.scaley,u.x,g),u.graphelem}function i(c,u,f,g,d,p){c.setAttributeOnElement(u,{style:"transform:scale("+f+","+g+");transform-origin:"+d+"px "+p+"px;"})}return g0=r,g0}var v0,So;function vv(){if(So)return v0;So=1;var e=Dl(),t=gt();function a(n,r){var i=r.x;r.pitch===void 0&&window.console.error("Tempo Element y-coordinate not set."),r.tempo.el_type="tempo";var c=n.calcY(r.pitch)+2,u,f;if(r.tempo.preString){u=t(n,{x:i,y:c,text:r.tempo.preString,type:"tempofont",klass:"abcjs-tempo",anchor:"start",noClass:!0,name:"pre"},!0),f=n.controller.getTextSize.calc(r.tempo.preString,"tempofont","tempo",u);var g=f.width,d=g/r.tempo.preString.length;i+=g+d}if(r.note){r.note.setX(i);for(var p=0;p<r.note.children.length;p++)e(n,r.note.children[p],i);i+=r.note.w+5;var l="= "+r.tempo.bpm;u=t(n,{x:i,y:c,text:l,type:"tempofont",klass:"abcjs-tempo",anchor:"start",noClass:!0,name:"beats"}),f=n.controller.getTextSize.calc(l,"tempofont","tempo",u);var o=f.width,h=o/l.length;i+=o+h}r.tempo.postString&&t(n,{x:i,y:c,text:r.tempo.postString,type:"tempofont",klass:"abcjs-tempo",anchor:"start",noClass:!0,name:"post"},!0)}return v0=a,v0}var m0,To;function mv(){if(To)return m0;To=1;var e=vv(),t=Dl(),a=Ve(),n=Ga(),r=Ya();function i(c,u,f,g,d){if(!u.invisible){var p=u.children.length>0&&u.children[0].type==="TempoElement";u.elemset=[],r.beginGroup(c.paper,c.controller);for(var l=0;l<u.children.length;l++){var o=u.children[l];switch(o.type){case"TempoElement":e(c,o);break;default:var h=t(c,o,f);o.type==="symbol"&&o.c&&o.c.indexOf("notehead")>=0&&h.setAttribute("class","abcjs-notehead")}}var s=u.type;if((u.type==="note"||u.type==="rest")&&(u.counters=c.controller.classes.getCurrent(),s+=" d"+Math.round(u.durationClass*1e3)/1e3,s=s.replace(/\./g,"-"),u.abcelem.pitches))for(var v=0;v<u.abcelem.pitches.length;v++)s+=" p"+u.abcelem.pitches[v].pitch;var y=r.endGroup(s,u.type);if(y){if(u.cloned&&(u.cloned.overrideClasses=y.className.baseVal),u.overrideClasses){var m=y.classList&&y.classList.length>0?y.classList[0]+" ":"";y.setAttribute("class",m+u.overrideClasses)}if(p)u.startChar=u.abcelem.startChar,u.endChar=u.abcelem.endChar,g.add(u,y,!1,d);else{u.elemset.push(y);var _=!1;(u.type==="note"||u.type==="tabNumber")&&(_=!0),g.add(u,y,_,d)}}else u.elemset.length>0&&g.add(u,u.elemset[0],u.type==="note",d);if(u.klass&&n(u.elemset,"mark","","#00ff00"),u.hint&&n(u.elemset,"abcjs-hint","",null),u.abcelem.abselem=u,u.heads&&u.heads.length>0){u.notePositions=[];for(var k=0;k<u.heads.length;k++)u.notePositions.push({x:u.heads[k].x+u.heads[k].w/2,y:d.zero-u.heads[k].pitch*a.STEP})}}}return m0=i,m0}var b0,Eo;function bv(){if(Eo)return b0;Eo=1;var e=cv(),t=lv(),a=uv(),n=hv(),r=fv(),i=dv(),c=pv(),u=gt(),f=mv();function g(p,l,o,h,s){var v=l.w-1;p.staffbottom=l.staff.bottom;var y=p.foregroundColor;if(l.color&&(p.foregroundColor=l.color),l.header){var m=u(p,{x:p.padding.left,y:p.calcY(l.headerPosition),text:l.header,type:"voicefont",klass:"staff-extra voice-name",anchor:"start",centerVertically:!0,name:"voice-name"},!0);h.wrapSvgEl({el_type:"voiceName",startChar:-1,endChar:-1,text:l.header},m)}var _,k,x=!1;for(_=0;_<l.children.length;_++){k=l.children[_],(k.type==="note"||k.type==="rest")&&(x=!0);var R=!1;k.type!=="staff-extra"&&!p.controller.classes.isInMeasure()&&(p.controller.classes.startMeasure(),R=!0),l.staff.isTabStaff&&(k.invisible=!1,k.type=="bar"&&k.abcelem.lastBar&&(o=l.topLine)),f(p,k,l.barto||_===l.children.length-1?o:0,h,s),(k.type==="note"||d(k))&&p.controller.classes.incrNote(),k.type==="bar"&&!R&&x&&p.controller.classes.incrMeasure()}for(p.controller.classes.startMeasure(),_=0;_<l.beams.length;_++){var I=l.beams[_];I==="bar"?p.controller.classes.incrMeasure():c(p,I,h)}for(p.controller.classes.startMeasure(),_=0;_<l.otherchildren.length;_++)if(k=l.otherchildren[_],k==="bar")p.controller.classes.incrMeasure();else switch(k.type){case"GlissandoElem":k.elemset=e(p,k,h);break;case"CrescendoElem":k.elemset=t(p,k,h);break;case"DynamicDecoration":k.elemset=a(p,k,h);break;case"TripletElem":n(p,k,h);break;case"EndingElem":k.elemset=r(p,k,l.startx+10,v,h);break;case"TieElem":k.elemset=i(p,k,l.startx+10,v,h);break;default:console.log(k),f(p,k,l.startx+10,v,h,s)}p.foregroundColor=y}function d(p){return p.type!=="rest"?!1:!!(p.abcelem&&p.abcelem.rest&&p.abcelem.rest.type!=="spacer")}return b0=g,b0}var y0,Ao;function yv(){if(Ao)return y0;Ao=1;var e=Ol();function t(a,n,r,i,c,u){var f="abcjs-top-line",g=2;c&&(g=c),a.paper.openGroup({prepend:!0,klass:a.controller.classes.generate("abcjs-staff")});var d=0,p=0;if(i===1)e(a,n,r,6,f,null,u+a.lineThickness),d=a.calcY(10),p=a.calcY(2);else for(var l=i-1;l>=0;l--){var o=(l+1)*g;p=a.calcY(o),d===0&&(d=p),e(a,n,r,o,f,null,u+a.lineThickness),f=void 0}return a.paper.closeGroup(),[d,p]}return y0=t,y0}var w0,Mo;function wv(){if(Mo)return w0;Mo=1;function e(t,a,n){var r=t.paper.rectBeneath(a);return n&&t.paper.text(n,{x:0,y:a.y+7,"text-anchor":"start","font-size":"14px",fill:"rgba(0,0,255,.4)",stroke:"rgba(0,0,255,.4)"}),r}return w0=e,w0}var _0,No;function _v(){if(No)return _0;No=1;function e(t,a){var n="rgba(0,0,0,255)",r="rgba(0,0,0,0)",i=Math.round(t.y),c=t.controller.width,u=(c-a)/2,f=u+a,g="M "+u+" "+i+" L "+f+" "+i+" L "+f+" "+(i+1)+" L "+u+" "+(i+1)+" L "+u+" "+i+" z";t.paper.pathToBack({path:g,stroke:r,fill:n,class:t.controller.classes.generate("defined-text")})}return _0=e,_0}var k0,Po;function Fl(){if(Po)return k0;Po=1;var e=_v(),t=gt();function a(n,r,i){for(var c=0;c<r.rows.length;c++){var u=r.rows[c];if(u.absmove)n.absolutemoveY(u.absmove);else if(u.move)n.moveY(u.move);else if(u.text||u.phrases){var f=u.left?u.left:0,g=t(n,{x:f,y:n.y,text:u.text,phrases:u.phrases,"dominant-baseline":u["dominant-baseline"],type:u.font,klass:u.klass,name:u.name,anchor:u.anchor});u.absElemType&&i.wrapSvgEl({el_type:u.absElemType,name:u.name,startChar:u.startChar,endChar:u.endChar,text:u.text},g)}else if(u.separator)e(n,u.separator);else if(u.startGroup)n.paper.openGroup({klass:u.klass,"data-name":u.name});else if(u.endGroup){var d=n.paper.closeGroup();u.absElemType&&i.wrapSvgEl({el_type:u.absElemType,name:u.name,startChar:u.startChar,endChar:u.endChar,text:""},d)}}}return k0=a,k0}var x0,zo;function kv(){if(zo)return x0;zo=1;var e=Ve(),t=ov(),a=bv(),n=yv(),r=wv(),i=Va(),c=Fl();function u(d,p,l,o){for(var h,s=d.y,v=0;v<p.staffs.length;v++){var y=p.staffs[v];d.moveY(e.STEP,y.top),y.absoluteY=d.y,d.showDebug&&(d.showDebug.indexOf("box")>=0&&y.voices&&g(d,p.voices,y.voices),d.showDebug.indexOf("grid")>=0&&(d.paper.dottedLine({x1:d.padding.left,x2:d.padding.left+d.controller.width,y1:s,y2:s,stroke:"#0000ff"}),r(d,{x:d.padding.left,y:d.calcY(y.originalTop),width:d.controller.width,height:d.calcY(y.originalBottom)-d.calcY(y.originalTop),fill:d.foregroundColor,stroke:d.foregroundColor,"fill-opacity":.1,"stroke-opacity":.1}),h=0,E(y,"chordHeightAbove"),E(y,"chordHeightBelow"),E(y,"dynamicHeightAbove"),E(y,"dynamicHeightBelow"),E(y,"endingHeightAbove"),E(y,"lyricHeightAbove"),E(y,"lyricHeightBelow"),E(y,"partHeightAbove"),E(y,"tempoHeightAbove"),E(y,"volumeHeightAbove"),E(y,"volumeHeightBelow"))),d.moveY(e.STEP,-y.bottom),d.showDebug&&d.showDebug.indexOf("grid")>=0&&d.paper.dottedLine({x1:d.padding.left,x2:d.padding.left+d.controller.width,y1:d.y,y2:d.y,stroke:"#0000aa"})}for(var m,_,k=2,x=0,R=0;R<p.voices.length;R++){var I=p.voices[R].staff,b=p.voices[R].tabNameInfos;if(d.y=I.absoluteY,d.controller.classes.incrVoice(),!p.voices[R].duplicate){if(m||(m=d.calcY(10)),_=d.calcY(k),I.lines!==0){I.linePitch&&(k=I.linePitch),d.controller.classes.newMeasure();var A=n(d,p.startx,p.w,I.lines,I.linePitch,.35);_=A[1],I.bottomLine=_,I.topLine=A[0],I.hasTab&&(x=I.topLine),I.hasStaff&&(x=I.hasStaff.topLine,p.voices[R].barto=!0,p.voices[R].topLine=m)}f(d,I.absoluteY,p.brace,R,l),f(d,I.absoluteY,p.bracket,R,l)}a(d,p.voices[R],x,l,{top:s,zero:d.y,height:p.height*e.STEP});var N=0;if(b){var M={rows:[]};M.rows.push({absmove:_+2});var z=8;M.rows.push({left:p.startx+z,text:b.name,font:"tablabelfont",klass:"text instrument-name",anchor:"start"}),M.rows.push({move:b.textSize.height}),c(d,M),N=b.textSize.height}d.controller.classes.newMeasure(),p.voices[R].duplicate||(x=d.calcY(2+N))}d.controller.classes.newMeasure();var L=p.staffs.length;L>1&&(m=p.staffs[0].topLine,_=p.staffs[L-1].bottomLine,i(d,p.startx,.6,m,_,null)),d.y=s;function E(T,P){var B=["rgb(207,27,36)","rgb(168,214,80)","rgb(110,161,224)","rgb(191,119,218)","rgb(195,30,151)","rgb(31,170,177)","rgb(220,166,142)"];if(T.positionY&&T.positionY[P]){var O=T.specialY[P]*e.STEP;P==="chordHeightAbove"&&T.specialY.chordLines&&T.specialY.chordLines.above&&(O*=T.specialY.chordLines.above),P==="chordHeightBelow"&&T.specialY.chordLines&&T.specialY.chordLines.below&&(O*=T.specialY.chordLines.below),r(d,{x:d.padding.left,y:d.calcY(T.positionY[P]),width:d.controller.width,height:O,fill:B[h],stroke:B[h],"fill-opacity":.4,"stroke-opacity":.4},P.substr(0,4)),h+=1,h>6&&(h=0)}}}function f(d,p,l,o,h){if(l)for(var s=0;s<l.length;s++)l[s].isStartVoice(o)&&(l[s].startY=p-e.STEP*10,l[s].elemset=t(d,l[s],h))}function g(d,p,l){for(var o=0;o<l.length;o++)for(var h=p[l[o]].children,s=0;s<h.length;s++){var v=h[s],y=v.getFixedCoords();if(!(v.invisible||y.t===void 0||y.b===void 0)){var m=(y.t-y.b)*e.STEP;r(d,{x:y.x,y:d.calcY(y.t),width:y.w,height:m,fill:"#88e888","fill-opacity":.4,stroke:"#4aa93d","stroke-opacity":.8});for(var _=0;_<v.children.length;_++){var k=v.children[_],x=k.getChordDim();if(x){var R=d.calcY(k.pitch);R+=k.dim.font.size*k.getLane(),r(d,{x:x.left,y:R,width:x.right-x.left,height:k.dim.font.size,fill:"none",stroke:"#4aa93d","stroke-opacity":.8})}}}}}return x0=u,x0}var C0,Io;function xv(){if(Io)return C0;Io=1;function e(t,a,n,r){var i=(a+t.padding.left+t.padding.right)*n,c=(t.y+t.padding.bottom)*n;if(t.isPrint&&(c=Math.max(c,1056)),t.ariaLabel!==""){var u="Sheet Music";t.abctune&&t.abctune.metaText&&t.abctune.metaText.title&&(u+=' for "'+t.abctune.metaText.title+'"'),t.paper.setTitle(u);var f=t.ariaLabel?t.ariaLabel:u;t.paper.setAttribute("aria-label",f)}var g=["-webkit-touch-callout: none;","-webkit-user-select: none;","-khtml-user-select: none;","-moz-user-select: none;","-ms-user-select: none;","user-select: none;"];t.paper.insertStyles(".abcjs-dragging-in-progress text, .abcjs-dragging-in-progress tspan {"+g.join(" ")+"}");var d={overflow:"hidden"};r==="resize"?t.paper.setResponsiveWidth(i,c):(d.width="",d.height=c+"px",n<1?(d.width=i+"px",t.paper.setSize(i/n,c/n)):t.paper.setSize(i,c)),t.paper.setScale(n),t.paper.setParentStyles(d)}return C0=e,C0}var S0,Ro;function Cv(){if(Ro)return S0;Ro=1;var e=Ml(),t=Nl();function a(n,r,i){this.elements=[],this.paper=n,this.tuneNumber=i,this.selectTypes=r}return a.prototype.getElements=function(){return this.elements},a.prototype.add=function(n,r,i,c){if(this.canSelect(n)){var u;this.selectTypes===void 0?u={selectable:!1,"data-index":this.elements.length}:u={selectable:!0,tabindex:0,"data-index":this.elements.length},this.paper.setAttributeOnElement(r,u);var f={absEl:n,svgEl:r,isDraggable:i};c!==void 0&&(f.staffPos=c),this.elements.push(f)}},a.prototype.canSelect=function(n){return this.selectTypes===!1||!n||!n.abcelem?!1:this.selectTypes===!0?!0:this.selectTypes===void 0?n.abcelem.el_type==="note"||n.abcelem.el_type==="tabNumber":this.selectTypes.indexOf(n.abcelem.el_type)>=0},a.prototype.wrapSvgEl=function(n,r){var i={tuneNumber:this.tuneNumber,abcelem:n,elemset:[r],highlight:e,unhighlight:t};this.add(i,r,!1)},S0=a,S0}var T0,qo;function Sv(){if(qo)return T0;qo=1;const e=Wa(),t=Va();function a(m,_,k,x,R){const I=R.gchordfont;R.partsfont;const b=R.annotationfont,A=R.repeatfont,N=R.textfont,M=R.subtitlefont,z=50,L=10,E=14,T=10,P=20,B=16;_.forEach(O=>{switch(O.type){case"text":y(m,O.text,k,m.y,16,N,null,null,!1),m.moveY(B);break;case"subtitle":y(m,O.subtitle,k,m.y+T,20,M,null,"abcjs-subtitle",!1),m.moveY(P);break;case"part":if(O.lines.length>0){y(m,O.name,k,m.y+T,20,M,O.name,"abcjs-part",!1),m.moveY(P);const w=O.lines[0].length,C=x/w;O.lines.forEach((S,q)=>{let D=!1,$=!1;S.forEach(K=>{K.ending&&(D=!0),K.annotations&&K.annotations.length>0&&($=!0)});const F=$?E:D?L:0;S.forEach((K,te)=>{if(!K.noBorder){m.paper.rect({x:k+te*C,y:m.y,width:C,height:F+z}),m.paper.rect({x:k+te*C+1,y:m.y+1,width:C-2,height:F+z-2});let ae=0,oe=0;const le=m.y,J=k+C*te;K.hasStartRepeat&&(r(m,J,le,le+z+F,!0,F),ae=12),K.hasEndRepeat&&(r(m,J+C,le,le+z+F,!1,F),oe=12);let ce=0;K.ending&&(ce=y(m,K.ending,k+te*C+4,le+10,12,A,null,null,!1).getBBox().width+4),u(m,le,k+ae,C,q,te,K.chord,I,ae+oe,z,F),K.annotations&&K.annotations.length>0&&c(m,le,k+te*C+ce,K.annotations,b),F&&m.paper.rectBeneath({x:k+te*C,y:m.y,width:C,height:F,fill:"#e8e8e8",stroke:"none"})}}),m.moveY(F+z)}),m.moveY(P)}break}})}function n(m,_,k,x){var R=_-10,I=_+10,b=k+10,A=k-10,N=_-10,M=-m.yToPitch(x)+2,z=_+6.5,L=-m.yToPitch(x)-2.3;m.paper.lineToBack({x1:R,x2:I,y1:b,y2:A,"stroke-width":"3px","stroke-linecap":"round"}),e(m,N,M,"dots.dot",{scalex:1,scaley:1,klass:"",name:"dot"}),e(m,z,L,"dots.dot",{scalex:1,scaley:1,klass:"",name:"dot"})}function r(m,_,k,x,R,I){const b=R?_+2:_-4,A=R?_+9:_-11;m.paper.openGroup({klass:"abcjs-repeat"}),t(m,b,3+m.lineThickness,k,x,null,"bar"),e(m,A,-m.yToPitch(I)-4,"dots.dot",{scalex:1,scaley:1,klass:"",name:"dot"}),e(m,A,-m.yToPitch(I)-8,"dots.dot",{scalex:1,scaley:1,klass:"",name:"dot"}),m.paper.closeGroup()}const i={segno:"scripts.segno",coda:"scripts.coda",fermata:"scripts.ufermata"};function c(m,_,k,x,R){k+=3;let I;for(let b=0;b<x.length;b++)switch(x[b]){case"segno":case"coda":case"fermata":{k+=12,I=e(m,k,-3,i[x[b]],{scalex:1,scaley:1,name:i[x[b]]});const A=I.getBBox();k+=A.width}break;default:y(m,x[b],k,_+12,12,R,null,null,!1)}}function u(m,_,k,x,R,I,b,A,N,M,z){const L=k+x*I;!b[1]&&!b[2]&&!b[3]?o(m,L,_+z,x-N,M,b[0],A,z):!b[1]&&!b[3]?h(m,L,_,x-N,M,b[0],b[2],A,z):s(m,L,_,x-N,M,b,A,z)}function f(m,_,k,x,R,I,b){const A=y(m,R,_,k,x,I,null,"abcjs-chord",!0);let N=A.getBBox(),M=x;for(;N.width>b&&M>=14;)M-=2,A.setAttribute("font-size",M),N=A.getBBox()}const g=34,d=26,p=20,l=-3;function o(m,_,k,x,R,I,b,A){I==="%"?n(m,_+x/2,k+R/2,A+R/2):f(m,_+x/2,k+R/2+l,g,I,b,x)}function h(m,_,k,x,R,I,b,A,N){m.paper.lineToBack({x1:_,x2:_+x,y1:k+R+N,y2:k+2}),f(m,_+x/4,k+R/4+5+N+l,d,I,A,x/2),f(m,_+3*x/4,k+3*R/4+N+l,d,b,A,x/2)}function s(m,_,k,x,R,I,b,A){m.paper.lineToBack({x1:_+3,x2:_+x-3,y1:k+R/2+A,y2:k+R/2+A}),m.paper.lineToBack({x1:_+x/2,x2:_+x/2,y1:k+3+A,y2:k+R-3+A}),I[0]&&f(m,_+x/4,k+R/4+2+A+l,p,v(I[0]),b,x/2),I[1]&&f(m,_+3*x/4,k+R/4+2+A+l,p,v(I[1]),b,x/2),I[2]&&f(m,_+x/4,k+3*R/4+A+l,p,v(I[2]),b,x/2),I[3]&&f(m,_+3*x/4,k+3*R/4+A+l,p,v(I[3]),b,x/2)}function v(m){return m==="No Chord"?"N.C.":m}function y(m,_,k,x,R,I,b,A,N){const M={x:k,y:x,stroke:"none","font-size":R,"font-style":I.style,"font-family":I.face,"font-weight":I.weight,"text-decoration":I.decoration};return b&&(M["data-name"]=b),A&&(M.class=A),M["text-anchor"]=N?"middle":"start",m.paper.text(_,M,null,{"alignment-baseline":"middle"})}return T0=a,T0}var E0,Bo;function Tv(){if(Bo)return E0;Bo=1;var e=kv(),t=xv(),a=Fl(),n=Ve(),r=Cv(),i=Sv();function c(g,d,p,l,o,h,s,v,y,m,_){var k=new r(g.paper,v,y),x={};d.shouldAddClasses&&(x.klass="abcjs-meta-top"),g.paper.openGroup(x),g.moveY(g.padding.top),a(g,p.topText,k),g.paper.closeGroup(),g.moveY(g.spacing.music);let R=!1;_&&p.chordGrid&&(i(g,p.chordGrid,g.padding.left,l,p.formatting),_==="noMusic"&&(R=!0));var I=[],b=0;if(!R)for(var A=0;A<p.lines.length;A++){d.incrLine();var N=p.lines[A];if(N.staff){if(b++,p.formatting.maxStaves&&b>p.formatting.maxStaves)break;d.shouldAddClasses&&(x.klass="abcjs-staff-wrapper abcjs-l"+d.lineNumber),g.paper.openGroup(x),N.vskip&&g.moveY(N.vskip),I.length>=1&&f(g,g.spacing.staffSeparation,I[I.length-1],N.staffGroup);var M=u(g,N.staffGroup,k,A);M.line=m+A,I.push(M),g.paper.closeGroup()}else N.nonMusic&&(d.shouldAddClasses&&(x.klass="abcjs-non-music"),g.paper.openGroup(x),a(g,N.nonMusic,k),g.paper.closeGroup())}return d.reset(),R||p.bottomText&&p.bottomText.rows&&p.bottomText.rows.length>0&&(d.shouldAddClasses&&(x.klass="abcjs-meta-bottom"),g.paper.openGroup(x),g.moveY(24),a(g,p.bottomText,k),g.paper.closeGroup()),t(g,o,s,h),{staffgroups:I,selectables:k.getElements()}}function u(g,d,p,l){e(g,d,p,l);var o=d.height*n.STEP;return g.y+=o,d}function f(g,d,p,l){var o=p.staffs[p.staffs.length-1],h=-(o.bottom-2),s=l.staffs[0].top-10,v=s+h,y=v*n.STEP;y<d&&g.moveY(d-y)}return E0=c,E0}var A0,Lo;function Ev(){if(Lo)return A0;Lo=1;var e=Bl();function t(a){for(var n=a;n&&n.attributes&&n.tagName.toLowerCase()!=="svg"&&!n.attributes.selectable;)n=n.parentNode;if(n&&n.attributes&&n.attributes.selectable){var r=n.attributes["data-index"].nodeValue;if(r&&(r=parseInt(r,10),r>=0&&r<this.selectables.length)){var i=this.selectables[r],c=e(i,a);return c.index=r,c.element=i,c}}return null}return A0=t,A0}var M0,Oo;function Hl(){if(Oo)return M0;Oo=1;var e=Ve(),t=Hg(),a=Zg(),n=Gg(),r=Ug(),i=jg(),c=Yg(),u=Wg(),f=Vg(),g=nv(),d=av(),p=iv(),l=sv(),o=Tv(),h=Il(),s=Ev(),v=function(_,k){k=k||{},this.findSelectableElement=s,this.oneSvgPerLine=k.oneSvgPerLine,this.selectionColor=k.selectionColor,this.dragColor=k.dragColor?k.dragColor:k.selectionColor,this.dragging=!!k.dragging,this.selectTypes=k.selectTypes,this.responsive=k.responsive,this.space=3*e.SPACE,this.initialClef=k.initialClef,this.timeBasedLayout=k.timeBasedLayout,this.expandToWidest=!!k.expandToWidest,this.scale=k.scale?parseFloat(k.scale):0,this.classes=new d({shouldAddClasses:k.add_classes}),this.scale>.1||(this.scale=void 0),k.staffwidth?(this.staffwidthScreen=k.staffwidth,this.staffwidthPrint=k.staffwidth):(this.staffwidthScreen=740,this.staffwidthPrint=680),this.listeners=[],k.clickListener&&this.addSelectListener(k.clickListener),this.renderer=new a(_),this.renderer.setPaddingOverride(k),k.showDebug&&(this.renderer.showDebug=k.showDebug),k.jazzchords&&(this.jazzchords=k.jazzchords),k.accentAbove&&(this.accentAbove=k.accentAbove),k.germanAlphabet&&(this.germanAlphabet=k.germanAlphabet),k.lineThickness&&(this.lineThickness=k.lineThickness),k.chordGrid&&(this.chordGrid=k.chordGrid),this.renderer.controller=this,this.renderer.foregroundColor=k.foregroundColor?k.foregroundColor:"currentColor",k.ariaLabel!==void 0&&(this.renderer.ariaLabel=k.ariaLabel),this.renderer.minPadding=k.minPadding?k.minPadding:0,this.reset()};v.prototype.reset=function(){this.selected=[],this.staffgroups=[],this.engraver&&this.engraver.reset(),this.engraver=null,this.renderer.reset(),this.dragTarget=null,this.dragIndex=-1,this.dragMouseStart={x:-1,y:-1},this.dragYStep=0,this.lineThickness&&this.renderer.setLineThickness(this.lineThickness)},v.prototype.engraveABC=function(_,k,x){_[0]===void 0&&(_=[_]),this.reset();for(var R=0;R<_.length;R++)k===void 0&&(k=R),this.getFontAndAttr=new p(_[R].formatting,this.classes),this.getTextSize=new l(this.getFontAndAttr,this.renderer.paper),this.engraveTune(_[R],k,x)},v.prototype.adjustNonScaledItems=function(_){this.width/=_,this.renderer.adjustNonScaledItems(_)},v.prototype.getMeasureWidths=function(_){this.reset(),this.getFontAndAttr=new p(_.formatting,this.classes),this.getTextSize=new l(this.getFontAndAttr,this.renderer.paper);var k=this.jazzchords;this.setupTune(_,0),this.constructTuneElements(_),g(this.renderer,_,0,this.space,this.timeBasedLayout);for(var x=[],R,I=!0,b=0;b<_.lines.length;b++){var A=_.lines[b];if(A.staff){if(I&&(R={left:0,measureWidths:[],total:0},x.push(R),I=!1),A.staffGroup.voices.length>0)for(var N=A.staffGroup.voices[0],M=!1,z=0,L=0;L<N.children.length;L++){var E=N.children[L];!M&&!E.isClef&&!E.isKeySig&&(M=!0,R.left=E.x,z=E.x),E.type==="bar"&&(R.measureWidths.push(E.x-z),R.total+=E.x-z,z=E.x)}}else I=!0}return this.jazzchords=k,x},v.prototype.setupTune=function(_,k){this.classes.reset(),_.formatting.jazzchords!==void 0&&(this.jazzchords=_.formatting.jazzchords),_.formatting.accentAbove!==void 0&&(this.accentAbove=_.formatting.accentAbove),this.renderer.newTune(_),this.engraver=new t(this.getTextSize,k,{bagpipes:_.formatting.bagpipes,flatbeams:_.formatting.flatbeams,graceSlurs:_.formatting.graceSlurs!==!1,percmap:_.formatting.percmap,initialClef:this.initialClef,jazzchords:this.jazzchords,timeBasedLayout:this.timeBasedLayout,accentAbove:this.accentAbove,germanAlphabet:this.germanAlphabet}),this.engraver.setStemHeight(this.renderer.spacing.stemHeight),this.engraver.measureLength=_.getMeterFraction().num/_.getMeterFraction().den,_.formatting.staffwidth?this.width=_.formatting.staffwidth*1.33:this.width=this.renderer.isPrint?this.staffwidthPrint:this.staffwidthScreen;var x=_.formatting.scale?_.formatting.scale:this.scale;return this.responsive==="resize"&&(x=void 0),x===void 0&&(x=this.renderer.isPrint?.75:1),this.adjustNonScaledItems(x),x},v.prototype.constructTuneElements=function(_){_.topText=new c(_.metaText,_.metaTextInfo,_.formatting,_.lines,this.width,this.renderer.isPrint,this.renderer.padding.left,this.renderer.spacing,this.classes.shouldAddClasses,this.getTextSize);var k,x,R=!1,I=!1;for(k=0;k<_.lines.length;k++)if(x=_.lines[k],x.staff)I=!0,x.staffGroup=this.engraver.createABCLine(x.staff,R?null:_.metaText.tempo,k),R=!0;else if(x.subtitle){if(I){var b=this.width/2+this.renderer.padding.left;x.nonMusic=new i(this.renderer.spacing.subtitle,_.formatting,x.subtitle,b,this.renderer.padding.left,this.getTextSize)}}else x.text!==void 0?(I=!0,x.nonMusic=new n(x.text,x.vskip,this.getFontAndAttr,this.renderer.padding.left,this.width,this.getTextSize)):x.separator!==void 0&&x.separator.lineLength&&(I=!0,x.nonMusic=new r(x.separator.spaceAbove,x.separator.lineLength,x.separator.spaceBelow));_.bottomText=new u(_.metaText,this.width,this.renderer.isPrint,this.renderer.padding.left,this.renderer.spacing,this.classes.shouldAddClasses,this.getTextSize)},v.prototype.engraveTune=function(_,k,x){var R=this.jazzchords,I=this.setupTune(_,k);this.constructTuneElements(_);var b=g(this.renderer,_,this.width,this.space,this.expandToWidest,this.timeBasedLayout);if(this.expandToWidest&&b>this.width+1&&(_.topText=new c(_.metaText,_.metaTextInfo,_.formatting,_.lines,b,this.renderer.isPrint,this.renderer.padding.left,this.renderer.spacing,this.classes.shouldAddClasses,this.getTextSize),_.lines&&_.lines.length>0))for(var A=_.lines.length,N=0;N<A;++N){var M=_.lines[N];if(M.nonMusic&&M.nonMusic.rows&&M.nonMusic.rows.length>0)for(var z=M.nonMusic.rows.length,L=0;L<z;++L){var E=M.nonMusic.rows[L];E.left&&(M.subtitle?E.left=b/2+this.renderer.padding.left:M.text&&M.text.length>0&&M.text[0].center&&(E.left=b/2+this.renderer.padding.left))}}_.tablatures&&h.layoutTablatures(this.renderer,_);var T=o(this.renderer,this.classes,_,this.width,b,this.responsive,I,this.selectTypes,k,x,this.chordGrid);if(this.staffgroups=T.staffgroups,this.selectables=T.selectables,this.oneSvgPerLine){var P=this.renderer.paper.svg.parentNode;this.svgs=y(this.renderer,P,_.metaText.title,this.responsive,I)}else this.svgs=[this.renderer.paper.svg];f(this,this.svgs),this.jazzchords=R};function y(_,k,x,R,I){x||(x="Untitled");var b=k.querySelector("svg");R==="resize"&&(k.style.paddingBottom="");for(var A=b.querySelector("style"),N=R==="resize"?b.viewBox.baseVal.width:b.getAttribute("width"),M=k.querySelectorAll("svg > g"),z=0,L=[],E=0;E<M.length;E++){var T=M[E],P=T.getBBox(),B=P.y-z,O=P.height+B,w=document.createElement("div"),C="overflow: hidden;";R!=="resize"&&(C+="height:"+O*I+"px;"),w.setAttribute("style",C);var S=m(b),q='Sheet Music for "'+x+'" section '+(E+1);S.setAttribute("aria-label",q),R!=="resize"&&S.setAttribute("height",O),R==="resize"&&(S.style.position="");var D=_.firefox112?O+1:O;S.setAttribute("viewBox","0 "+z+" "+N+" "+D),S.appendChild(A.cloneNode(!0));var $=document.createElement("title");$.innerText=q,S.appendChild($),S.appendChild(T),w.appendChild(S),L.push(S),k.appendChild(w),z=P.y+P.height}return k.removeChild(b),L}function m(_){for(var k="http://www.w3.org/2000/svg",x=document.createElementNS(k,"svg"),R=0;R<_.attributes.length;R++){var I=_.attributes[R];I.name!=="height"&&I.name!="aria-label"&&x.setAttribute(I.name,I.value)}return x}return v.prototype.getDim=function(_){if(!_.dim){var k=_.svgEl.getBBox();_.dim={left:Math.round(k.x),top:Math.round(k.y),right:Math.round(k.x+k.width),bottom:Math.round(k.y+k.height)}}return _.dim},v.prototype.addSelectListener=function(_){this.listeners[this.listeners.length]=_},M0=v,M0}var N0,Do;function $l(){if(Do)return N0;Do=1;var e=fr();Tl();var t=Hl(),a=El(),n=xl(),r={};function i(){var g=window.innerWidth;for(var d in r)if(r.hasOwnProperty(d)){var p=r[d],l=p.offsetLeft;g-=l*2,p.style.width=g+"px"}}try{window.addEventListener("resize",i),window.addEventListener("orientationChange",i)}catch{}function c(g,d,p,l,o){p.viewportHorizontal?(g.innerHTML='<div class="abcjs-inner"></div>',p.scrollHorizontal?(g.style.overflowX="auto",g.style.overflowY="hidden"):g.style.overflow="hidden",r[g.id]=g,g=g.children[0]):p.viewportVertical?(g.innerHTML='<div class="abcjs-inner scroll-amount"></div>',g.style.overflowX="hidden",g.style.overflowY="auto",g=g.children[0]):g.innerHTML="";var h=new t(g,p);if(h.engraveABC(d,l,o),d.engraver=h,p.viewportVertical||p.viewportHorizontal){var s=g.parentNode;s.style.width=g.style.width}}var u=function(g,d,p,l,o){var h={},s;if(p){for(s in p)p.hasOwnProperty(s)&&(h[s]=p[s]);h.warnings_id&&h.tablature&&(h.tablature.warning_id=h.warnings_id)}if(l)for(s in l)l.hasOwnProperty(s)&&(s==="listener"?l[s].highlight&&(h.clickListener=l[s].highlight):h[s]=l[s]);if(o)for(s in o)o.hasOwnProperty(s)&&(h[s]=o[s]);function v(y,m,_,k){var x=!1;return y==="*"&&(x=!0,y=document.createElement("div"),y.setAttribute("style","visibility: hidden;"),document.body.appendChild(y)),!x&&h.wrap&&h.staffwidth?(m=f(y,m,_,k,h),m):(h.afterParsing&&h.afterParsing(m,_,k),c(y,m,h,_,0),x&&y.parentNode.removeChild(y),null)}return e.renderEngine(v,g,d,h)};function f(g,d,p,l,o){var h=new t(g,o),s=h.getMeasureWidths(d),v=n.calcLineWraps(d,s,o);if(v.reParse){var y=new a;y.parse(l,v.revisedParams),d=y.getTune();var m=y.getWarnings();m&&(d.warnings=m)}return o.afterParsing&&o.afterParsing(d,p,l),c(g,d,v.revisedParams,p,0),d.explanation=v.explanation,d}return N0=u,N0}var P0,Fo;function Av(){if(Fo)return P0;Fo=1;var e=fr(),t=Hl(),a=function(n,r){function i(c,u,f,g){c=document.createElement("div"),c.setAttribute("style","visibility: hidden;"),document.body.appendChild(c);var d=new t(c,r),p=d.getMeasureWidths(u);return c.parentNode.removeChild(c),{sections:p}}return e.renderEngine(i,"*",n,r)};return P0=a,P0}var z0,Ho;function Xa(){if(Ho)return z0;Ho=1;var e={};return z0=e,z0}var I0,$o;function Mv(){if($o)return I0;$o=1;var e=Xa(),t=function(a,n,r,i){e[n]||(e[n]={});var c=e[n];return c[r]||(c[r]=new Promise(function(u,f){var g=new XMLHttpRequest;let d=a+n+"-mp3/"+r+".mp3";g.open("GET",d,!0),g.responseType="arraybuffer",g.onload=function(){if(g.status!==200){f(Error("Can't load sound at "+d+" status="+g.status));return}var p=function(o){u({instrument:n,name:r,status:"loaded",audioBuffer:o})},l=i.decodeAudioData(g.response,p,function(){f(Error("Can't decode sound at "+d))});l&&typeof l.catch=="function"&&l.catch(f)},g.onerror=function(){f(Error("Can't load sound at "+d))},g.send()}).catch(u=>{throw console.error("Didn't load note",n,r,":",u.message),u})),c[r]};return I0=t,I0}var R0,Zo;function Ka(){if(Zo)return R0;Zo=1;var e=["acoustic_grand_piano","bright_acoustic_piano","electric_grand_piano","honkytonk_piano","electric_piano_1","electric_piano_2","harpsichord","clavinet","celesta","glockenspiel","music_box","vibraphone","marimba","xylophone","tubular_bells","dulcimer","drawbar_organ","percussive_organ","rock_organ","church_organ","reed_organ","accordion","harmonica","tango_accordion","acoustic_guitar_nylon","acoustic_guitar_steel","electric_guitar_jazz","electric_guitar_clean","electric_guitar_muted","overdriven_guitar","distortion_guitar","guitar_harmonics","acoustic_bass","electric_bass_finger","electric_bass_pick","fretless_bass","slap_bass_1","slap_bass_2","synth_bass_1","synth_bass_2","violin","viola","cello","contrabass","tremolo_strings","pizzicato_strings","orchestral_harp","timpani","string_ensemble_1","string_ensemble_2","synth_strings_1","synth_strings_2","choir_aahs","voice_oohs","synth_choir","orchestra_hit","trumpet","trombone","tuba","muted_trumpet","french_horn","brass_section","synth_brass_1","synth_brass_2","soprano_sax","alto_sax","tenor_sax","baritone_sax","oboe","english_horn","bassoon","clarinet","piccolo","flute","recorder","pan_flute","blown_bottle","shakuhachi","whistle","ocarina","lead_1_square","lead_2_sawtooth","lead_3_calliope","lead_4_chiff","lead_5_charang","lead_6_voice","lead_7_fifths","lead_8_bass_lead","pad_1_new_age","pad_2_warm","pad_3_polysynth","pad_4_choir","pad_5_bowed","pad_6_metallic","pad_7_halo","pad_8_sweep","fx_1_rain","fx_2_soundtrack","fx_3_crystal","fx_4_atmosphere","fx_5_brightness","fx_6_goblins","fx_7_echoes","fx_8_scifi","sitar","banjo","shamisen","koto","kalimba","bagpipe","fiddle","shanai","tinkle_bell","agogo","steel_drums","woodblock","taiko_drum","melodic_tom","synth_drum","reverse_cymbal","guitar_fret_noise","breath_noise","seashore","bird_tweet","telephone_ring","helicopter","applause","gunshot","percussion"];return R0=e,R0}var q0,Go;function Nv(){if(Go)return q0;Go=1;var e=Ka(),t=function(a){for(var n=[],r=0;r<a.tracks.length;r++)n.push([]);var i=e[0];return a.tracks.forEach(function(c,u){c.forEach(function(f){switch(f.cmd){case"note":var g=f.instrument!==void 0?e[f.instrument]:i;if(f.duration>0){var d=f.gap?f.gap:0,p=f.duration;d=Math.min(d,p*2/3);var l={pitch:f.pitch,instrument:g,start:Math.round(f.start*1e6)/1e6,end:Math.round((f.start+p-d)*1e6)/1e6,volume:f.volume};f.startChar&&(l.startChar=f.startChar),f.endChar&&(l.endChar=f.endChar),f.style&&(l.style=f.style),f.cents&&(l.cents=f.cents),n[u].push(l)}break;case"program":i=e[f.instrument];break;case"text":break;default:console.log("Unhandled midi event",f)}})}),n};return q0=t,q0}var B0,Uo;function dr(){if(Uo)return B0;Uo=1;function e(t){if(t)window.abcjsAudioContext=t;else if(!window.abcjsAudioContext){var a=window.AudioContext||window.webkitAudioContext;if(a)window.abcjsAudioContext=new a;else return!1}return window.abcjsAudioContext.state!=="suspended"}return B0=e,B0}var L0,jo;function zt(){if(jo)return L0;jo=1;var e=dr();function t(){return window.abcjsAudioContext||e(),window.abcjsAudioContext}return L0=t,L0}var O0,Yo;function pr(){if(Yo)return O0;Yo=1;var e=zt();function t(){if(!window.Promise||!window.AudioContext&&!window.webkitAudioContext&&!navigator.mozAudioContext&&!navigator.msAudioContext)return!1;var a=e();if(a)return a.resume!==void 0}return O0=t,O0}var D0,Wo;function Ja(){if(Wo)return D0;Wo=1;var e={21:"A0",22:"Bb0",23:"B0",24:"C1",25:"Db1",26:"D1",27:"Eb1",28:"E1",29:"F1",30:"Gb1",31:"G1",32:"Ab1",33:"A1",34:"Bb1",35:"B1",36:"C2",37:"Db2",38:"D2",39:"Eb2",40:"E2",41:"F2",42:"Gb2",43:"G2",44:"Ab2",45:"A2",46:"Bb2",47:"B2",48:"C3",49:"Db3",50:"D3",51:"Eb3",52:"E3",53:"F3",54:"Gb3",55:"G3",56:"Ab3",57:"A3",58:"Bb3",59:"B3",60:"C4",61:"Db4",62:"D4",63:"Eb4",64:"E4",65:"F4",66:"Gb4",67:"G4",68:"Ab4",69:"A4",70:"Bb4",71:"B4",72:"C5",73:"Db5",74:"D5",75:"Eb5",76:"E5",77:"F5",78:"Gb5",79:"G5",80:"Ab5",81:"A5",82:"Bb5",83:"B5",84:"C6",85:"Db6",86:"D6",87:"Eb6",88:"E6",89:"F6",90:"Gb6",91:"G6",92:"Ab6",93:"A6",94:"Bb6",95:"B6",96:"C7",97:"Db7",98:"D7",99:"Eb7",100:"E7",101:"F7",102:"Gb7",103:"G7",104:"Ab7",105:"A7",106:"Bb7",107:"B7",108:"C8",109:"Db8",110:"D8",111:"Eb8",112:"E8",113:"F8",114:"Gb8",115:"G8",116:"Ab8",117:"A8",118:"Bb8",119:"B8",120:"C9",121:"Db9"};return D0=e,D0}var F0,Vo;function Pv(){if(Vo)return F0;Vo=1;var e=function(a){return window.URL.createObjectURL(t(a.audioBuffers))};function t(a){var n=a[0],r=n.numberOfChannels,i=n.length*r*2+44,c=new ArrayBuffer(i),u=new DataView(c),f=[],g,d,p=0,l=0;for(h(1179011410),h(i-8),h(1163280727),h(544501094),h(16),o(1),o(r),h(n.sampleRate),h(n.sampleRate*2*r),o(r*2),o(16),h(1635017060),h(i-l-4),g=0;g<r;g++)f.push(n.getChannelData(g));for(;l<i;){for(g=0;g<f.length;g++)d=Math.max(-1,Math.min(1,f[g][p])),d=(.5+d<0?d*32768:d*32767)|0,u.setInt16(l,d,!0),l+=2;p++}return new Blob([c],{type:"audio/wav"});function o(s){u.setUint16(l,s,!0),l+=2}function h(s){u.setUint32(l,s,!0),l+=4}}return F0=e,F0}var H0,Xo;function Zl(){if(Xo)return H0;Xo=1;function e(t){return Math.pow(2,t/1200)}return H0=e,H0}var $0,Ko;function zv(){if(Ko)return $0;Ko=1;var e=Xa(),t=Ja(),a=Zl();function n(i,c,u,f,g,d,p,l,o){var h=window.OfflineAudioContext||window.webkitOfflineAudioContext,s=u.len*u.tempoMultiplier;d&&(s+=d/1e3),s-=l,s<0&&(s=.005);var v=new h(2,Math.floor((s+p)*c),c),y=t[u.pitch];if(!e[u.instrument])return o&&o("placeNote skipped (instrument empty): "+u.instrument+":"+y),Promise.resolve();var m=e[u.instrument][y];return m?m.then(function(_){var k=v.createBufferSource();k.buffer=_.audioBuffer;var x=u.volume/96*g;k.gainNode=v.createGain(),u.pan&&v.createStereoPanner&&(k.panNode=v.createStereoPanner(),k.panNode.pan.setValueAtTime(u.pan,0)),k.gainNode.gain.value=x,k.gainNode.gain.linearRampToValueAtTime(k.gainNode.gain.value,s),k.gainNode.gain.linearRampToValueAtTime(0,s+p),u.cents&&(k.playbackRate.value=a(u.cents)),k.panNode?(k.panNode.connect(v.destination),k.gainNode.connect(k.panNode)):k.gainNode.connect(v.destination),k.connect(k.gainNode),k.start(0),k.noteOff?k.noteOff(s+p):k.stop(s+p);var R;return v.oncomplete=function(I){if(I.renderedBuffer&&I.renderedBuffer.getChannelData)for(var b=0;b<f.length;b++){var A=f[b]*u.tempoMultiplier;d&&(A-=d/1e3),A<0&&(A=0),A=Math.floor(A*c),r(i,I.renderedBuffer,A)}o&&o("placeNote: "+u.instrument+":"+y),R()},v.startRendering(),new Promise(function(I){R=I})}).catch(function(_){return o&&o("placeNote catch: "+_.message),Promise.reject(_)}):(o&&o("placeNote skipped: "+u.instrument+":"+y),Promise.resolve())}var r=function(i,c,u){for(var f=0;f<2;f++)for(var g=c.getChannelData(f),d=i.getChannelData(f),p=0;p<g.length;p++)d[p+u]+=g[p]};return $0=n,$0}var Z0,Jo;function Qa(){if(Jo)return Z0;Jo=1;var e=Mv(),t=Nv(),a=dr(),n=zt(),r=pr(),i=Ja(),c=Ka(),u=Pv(),f=zv(),g=Xa(),d="MIDI is not supported in this browser.",p="https://paulrosen.github.io/midi-js-soundfonts/abcjs/",l="https://paulrosen.github.io/midi-js-soundfonts/FluidR3_GM/",o="https://paulrosen.github.io/midi-js-soundfonts/MusyngKite/";function h(){var s=this;s.audioBufferPossible=void 0,s.directSource=[],s.startTimeSec=void 0,s.pausedTimeSec=void 0,s.audioBuffers=[],s.duration=void 0,s.isRunning=!1,s.options={},s.pickupLength=0,s.init=function(m){m||(m={}),m.options&&(s.options=m.options),a(m.audioContext);var _=n().currentTime;if(s.debugCallback=m.debugCallback,s.debugCallback&&s.debugCallback("init called"),s.audioBufferPossible=s._deviceCapable(),!s.audioBufferPossible)return Promise.reject({status:"NotSupported",message:d});var k=m.options?m.options:{};s.soundFontUrl=k.soundFontUrl?k.soundFontUrl:l,s.soundFontUrl[s.soundFontUrl.length-1]!=="/"&&(s.soundFontUrl+="/"),k.soundFontVolumeMultiplier||k.soundFontVolumeMultiplier===0?s.soundFontVolumeMultiplier=k.soundFontVolumeMultiplier:s.soundFontUrl===l||s.soundFontUrl===o?s.soundFontVolumeMultiplier=3:s.soundFontUrl===p?s.soundFontVolumeMultiplier=.4:s.soundFontVolumeMultiplier=1,k.programOffsets?s.programOffsets=k.programOffsets:s.soundFontUrl===p?s.programOffsets={bright_acoustic_piano:20,honkytonk_piano:20,electric_piano_1:30,electric_piano_2:30,harpsichord:40,clavinet:20,celesta:20,glockenspiel:40,vibraphone:30,marimba:35,xylophone:30,tubular_bells:35,dulcimer:30,drawbar_organ:20,percussive_organ:25,rock_organ:20,church_organ:40,reed_organ:40,accordion:40,harmonica:40,acoustic_guitar_nylon:20,acoustic_guitar_steel:30,electric_guitar_jazz:25,electric_guitar_clean:15,electric_guitar_muted:35,overdriven_guitar:25,distortion_guitar:20,guitar_harmonics:30,electric_bass_finger:15,electric_bass_pick:30,fretless_bass:40,violin:105,viola:50,cello:40,contrabass:60,trumpet:10,trombone:90,alto_sax:20,tenor_sax:20,clarinet:20,flute:50,banjo:50,woodblock:20}:s.programOffsets={};var x=k.fadeLength!==void 0?parseInt(k.fadeLength,10):NaN;if(s.fadeLength=isNaN(x)?200:x,x=k.noteEnd!==void 0?parseInt(k.noteEnd,10):NaN,s.noteEnd=isNaN(x)?0:x,s.pan=k.pan,s.meterSize=1,m.visualObj){s.flattened=m.visualObj.setUpAudio(k);var R=m.visualObj.getMeterFraction();R.den&&(s.meterSize=R.num/R.den),s.pickupLength=m.visualObj.getPickupLength()}else if(m.sequence)s.flattened=m.sequence;else return Promise.reject(new Error("Must pass in either a visualObj or a sequence"));s.millisecondsPerMeasure=m.millisecondsPerMeasure?m.millisecondsPerMeasure:m.visualObj?m.visualObj.millisecondsPerMeasure(s.flattened.tempo):1e3,s.beatsPerMeasure=m.visualObj?m.visualObj.getBeatsPerMeasure():4,s.sequenceCallback=k.sequenceCallback,s.callbackContext=k.callbackContext,s.onEnded=k.onEnded,s.meterFraction=m.visualObj?m.visualObj.getMeterFraction():{den:1};var I={},b=[],A=[],N=c[0];s.flattened.tracks.forEach(function(T){T.forEach(function(P){if(P.cmd==="program"&&c[P.instrument]&&(N=c[P.instrument]),P.pitch!==void 0){var B=P.pitch,O=i[B],w=P.instrument!==void 0?c[P.instrument]:N;if(O)if(I[w]||(I[w]={}),!g[w]||!g[w][O])I[w][O]=!0;else{var C=w+":"+O;b.indexOf(C)<0&&b.push(C)}else{var S=w+":"+O;console.log("Can't find note: ",B,S),A.indexOf(S)<0&&A.push(S)}}})}),s.debugCallback&&s.debugCallback("note gathering time = "+Math.floor((n().currentTime-_)*1e3)+"ms"),_=n().currentTime;var M=[];Object.keys(I).forEach(function(T){Object.keys(I[T]).forEach(function(P){M.push({instrument:T,note:P})})}),s.debugCallback&&s.debugCallback("notes "+JSON.stringify(M));for(var z=[],L=256,E=0;E<M.length;E+=L)z.push(M.slice(E,E+L));return new Promise(function(T,P){var B={cached:b,error:A,loaded:[]},O=0,w=function(){s.debugCallback&&s.debugCallback("loadBatch idx="+O+" len="+z.length),O<z.length?s._loadBatch(z[O],s.soundFontUrl,_).then(function(C){s.debugCallback&&s.debugCallback("loadBatch then"),_=n().currentTime,C&&(C.error&&(B.error=B.error.concat(C.error)),C.loaded&&(B.loaded=B.loaded.concat(C.loaded))),O++,w()},P):(s.debugCallback&&s.debugCallback("resolve init"),T(B))};w()})},s._loadBatch=(function(m,_,k,x){var R=[];return m.forEach(function(I){s.debugCallback&&s.debugCallback("getNote "+I.instrument+":"+I.note),R.push(e(_,I.instrument,I.note,n()))}),Promise.all(R).then(function(I){s.debugCallback&&s.debugCallback("mp3 load time = "+Math.floor((n().currentTime-k)*1e3)+"ms");for(var b=[],A=[],N=[],M=[],z=0;z<I.length;z++){var L=I[z],E=L.instrument+":"+L.name;L.status==="loaded"?b.push(E):L.status==="pending"?N.push(E):L.status==="cached"?A.push(E):M.push(E+" "+L.message)}if(N.length>0){if(s.debugCallback&&s.debugCallback("pending "+JSON.stringify(N)),x?x=x*2:x=50,x<9e4)return new Promise(function(B,O){setTimeout(function(){var w=[];for(z=0;z<N.length;z++)E=N[z].split(":"),w.push({instrument:E[0],note:E[1]});s.debugCallback&&s.debugCallback("retry "+JSON.stringify(w)),s._loadBatch(w,_,k,x).then(function(C){B(C)}).catch(function(C){O(C)})},x)});for(var T=[],P=0;P<m.length;P++)T.push(m[P].instrument+"/"+m[P].note);return s.debugCallback&&s.debugCallback("loadBatch timeout"),Promise.reject(new Error("timeout attempting to load: "+T.join(", ")))}else return s.debugCallback&&s.debugCallback("loadBatch resolve"),Promise.resolve({loaded:b,cached:A,error:M})}).catch(function(I){s.debugCallback&&s.debugCallback("loadBatch catch "+I.message)})}),s.prime=function(){var m=s.fadeLength/1e3;return s.isRunning=!1,s.audioBufferPossible?(s.debugCallback&&s.debugCallback("prime called"),new Promise(function(_,k){try{let O=function(w){var C=w&&w.audioBuffers&&w.audioBuffers.length>0?w.audioBuffers[0].duration:0;return{status:n().state,duration:C}};var B=O,x=n().currentTime,R=s.millisecondsPerMeasure/1e3/s.meterSize;if(s.duration=s.flattened.totalDuration*R,s.duration<=0)return s.audioBuffers=[],_({status:"empty",seconds:0});s.duration+=m;var I=Math.floor(n().sampleRate*s.duration);s.stop();var b=t(s.flattened);s.options.swing&&y(b,s.options.swing,s.meterFraction,s.pickupLength),s.sequenceCallback&&s.sequenceCallback(b,s.callbackContext);var A=v(b.length,s.pan),N={};b.forEach(function(w,C){var S=A&&A.length>C?A[C]:0;w.forEach(function(q){var D=q.instrument+":"+q.pitch+":"+q.volume+":"+Math.round((q.end-q.start)*1e3)/1e3+":"+S+":"+R+":"+(q.cents?q.cents:0);s.debugCallback&&s.debugCallback("noteMapTrack "+D),N[D]||(N[D]=[]),N[D].push(q.start)})});for(var M=[],z=n().createBuffer(2,I,n().sampleRate),L=0;L<Object.keys(N).length;L++){var E=Object.keys(N)[L],T=E.split(":"),P=T[6]!==void 0?parseFloat(T[6]):0;T={instrument:T[0],pitch:parseInt(T[1],10),volume:parseInt(T[2],10),len:parseFloat(T[3]),pan:parseFloat(T[4]),tempoMultiplier:parseFloat(T[5]),cents:P},M.push(f(z,n().sampleRate,T,N[E],s.soundFontVolumeMultiplier,s.programOffsets[T.instrument],m,s.noteEnd/1e3,s.debugCallback))}s.audioBuffers=[z],s.debugCallback&&(s.debugCallback("sampleRate = "+n().sampleRate),s.debugCallback("totalSamples = "+I),s.debugCallback("creationTime = "+Math.floor((n().currentTime-x)*1e3)+"ms")),Promise.all(M).then(function(){n().state==="suspended"?n().resume().then(function(){_(O(s))}):n().state==="interrupted"?n().suspend().then(function(){n().resume().then(function(){_(O(s))})}):_(O(s))}).catch(function(w){k(w)})}catch(O){k(O)}})):Promise.reject(new Error(d))};function v(m,_){if(_==null)return null;var k=[];if(_.length){for(var x=0;x<m;x++)if(x<_.length){var R=parseFloat(_[x]);R<-1?R=-1:R>1&&(R=1),k.push(R)}else k.push(0);return k}else{var I=parseFloat(_);if(I*(m-1)>2)return null;for(var b=m%2===0,A=b?0-I/2:0,N=A+I,M=0;M<m;M++)b=M%2===0,b?(k.push(A),A-=I):(k.push(N),N+=I);return k}}s.start=function(){if(!s.audioBufferPossible)throw new Error(d);s.debugCallback&&s.debugCallback("start called");var m=s.pausedTimeSec?s.pausedTimeSec:0;s._kickOffSound(m),s.startTimeSec=n().currentTime-m,s.pausedTimeSec=void 0,s.debugCallback&&s.debugCallback("MIDI STARTED",s.startTimeSec)},s.pause=function(){if(!s.audioBufferPossible)throw new Error(d);return s.debugCallback&&s.debugCallback("pause called"),s.pausedTimeSec=s.stop(),s.pausedTimeSec},s.resume=function(){s.start()},s.seek=function(m,_){var k;switch(_){case"seconds":k=m;break;case"beats":k=m*s.millisecondsPerMeasure/s.beatsPerMeasure/1e3;break;default:k=(s.duration-s.fadeLength/1e3)*m;break}if(!s.audioBufferPossible)throw new Error(d);s.debugCallback&&s.debugCallback("seek called sec="+k),s.isRunning?(s.stop(),s._kickOffSound(k)):s.pausedTimeSec=k,s.pausedTimeSec=k},s.stop=function(){s.isRunning=!1,s.pausedTimeSec=void 0,s.directSource.forEach(function(_){try{_.stop()}catch(k){console.log("direct source didn't stop:",k)}}),s.directSource=[];var m=n().currentTime-s.startTimeSec;return m},s.finished=function(){s.startTimeSec=void 0,s.pausedTimeSec=void 0,s.isRunning=!1},s.download=function(){return u(s)},s.getAudioBuffer=function(){return s.audioBuffers[0]},s.getIsRunning=function(){return s.isRunning},s._deviceCapable=function(){return r()?!0:(console.warn(d),s.debugCallback&&s.debugCallback(d),!1)},s._kickOffSound=function(m){s.isRunning=!0,s.directSource=[],s.audioBuffers.forEach(function(_,k){s.directSource[k]=n().createBufferSource(),s.directSource[k].buffer=_,s.directSource[k].connect(n().destination)}),s.directSource.forEach(function(_){_.start(0,m)}),s.onEnded&&(s.directSource[0].onended=function(){s.onEnded(s.callbackContext)})};function y(m,_,k,x){if(!(k.den!=4&&k.den!=8)&&(_=parseFloat(_),!(isNaN(_)||_<=50))){_>75&&(_=75),_=_/50-1;var R=0,I=.25;k.den===8&&(I=I/2);for(var b=I/2,A=b*_,N=0;N<m.length;N++)for(var M=m[N],z=0;z<M.length;z++){var L=M[z];if((L.start-x)%b==0&&(L.start-x)%I!=0&&(z==0||M[z-1].start<=M[z].start-b)&&(z==M.length-1||M[z+1].start>=M[z].start+b)){var E=L.start;L.start+=A,L.volume*=1+R,z>0&&M[z-1].end==E&&(M[z-1].end=L.start,M[z-1].volume*=1-R)}}}}}return Z0=h,Z0}var G0,Qo;function Gl(){if(Qo)return G0;Qo=1;var e=function(){var t=this;t.tracks=[],t.totalDuration=0,t.currentInstrument=[],t.starts=[],t.addTrack=function(){return t.tracks.push([]),t.currentInstrument.push(0),t.starts.push(0),t.tracks.length-1},t.setInstrument=function(a,n){t.tracks[a].push({channel:0,cmd:"program",instrument:n}),t.currentInstrument[a]=n},t.appendNote=function(a,n,r,i,c){var u={cmd:"note",duration:r,gap:0,instrument:t.currentInstrument[a],pitch:n,start:t.starts[a],volume:i};c&&(u.cents=c),t.tracks[a].push(u),t.starts[a]+=r,t.totalDuration=Math.max(t.totalDuration,t.starts[a])}};return G0=e,G0}var U0,ec;function Iv(){if(ec)return U0;ec=1;var e=`
|
|
124
124
|
<svg version="1.0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 700" preserveAspectRatio="xMidYMid meet">
|
|
125
125
|
<g transform="translate(0,700) scale(0.1,-0.1)" >
|
|
126
126
|
<path d="M3111 6981 c-20 -37 -90 -55 -364 -96 -120 -18 -190 -33 -244 -55
|
|
@@ -182,31 +182,31 @@ X:`),u=c.length;return u===0&&(u=1),u};var r=n.TuneBook=function(i){var c=t(i);t
|
|
|
182
182
|
0 -1086 -11z"></path>
|
|
183
183
|
</g>
|
|
184
184
|
</svg>
|
|
185
|
-
`;return
|
|
185
|
+
`;return U0=e,U0}var j0,tc;function Rv(){if(tc)return j0;tc=1;var e=`
|
|
186
186
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25" class="abcjs-play-svg">
|
|
187
187
|
<g>
|
|
188
188
|
<polygon points="4 0 23 12.5 4 25"/>
|
|
189
189
|
</g>
|
|
190
190
|
</svg>
|
|
191
|
-
`;return
|
|
191
|
+
`;return j0=e,j0}var Y0,rc;function qv(){if(rc)return Y0;rc=1;var e=`
|
|
192
192
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25" class="abcjs-pause-svg">
|
|
193
193
|
<g>
|
|
194
194
|
<rect width="8.23" height="25"/>
|
|
195
195
|
<rect width="8.23" height="25" x="17"/>
|
|
196
196
|
</g>
|
|
197
197
|
</svg>
|
|
198
|
-
`;return
|
|
198
|
+
`;return Y0=e,Y0}var W0,nc;function Bv(){if(nc)return W0;nc=1;var e=`
|
|
199
199
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" class="abcjs-loading-svg">
|
|
200
200
|
<circle cx="50" cy="50" fill="none" stroke-width="20" r="35" stroke-dasharray="160 55"></circle>
|
|
201
201
|
</svg>
|
|
202
|
-
`;return
|
|
202
|
+
`;return W0=e,W0}var V0,ac;function Lv(){if(ac)return V0;ac=1;var e=`
|
|
203
203
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25">
|
|
204
204
|
<g>
|
|
205
205
|
<polygon points="5 12.5 24 0 24 25"/>
|
|
206
206
|
<rect width="3" height="25" x="0" y="0"/>
|
|
207
207
|
</g>
|
|
208
208
|
</svg>
|
|
209
|
-
`;return
|
|
209
|
+
`;return V0=e,V0}var X0,ic;function Ul(){if(ic)return X0;ic=1;var e=pr(),t=dr(),a=zt(),n=Iv(),r=Rv(),i=qv(),c=Bv(),u=Lv();function f(o,h){var s=this;if(typeof o=="string"){var v=o;if(o=document.querySelector(v),!o)throw new Error('Cannot find element "'+v+'" in the DOM.')}else if(!(o instanceof HTMLElement))throw new Error("The first parameter must be a valid element or selector in the DOM.");if(s.parent=o,s.options={},h&&(s.options=Object.assign({},h)),s.options.ac&&t(s.options.ac),g(s.parent,s.options),l(s),s.disable=function(m){var _=s.parent.querySelector(".abcjs-inline-audio");m?_.classList.add("abcjs-disabled"):_.classList.remove("abcjs-disabled")},s.setWarp=function(m,_){var k=s.parent.querySelector(".abcjs-midi-tempo");k.value=Math.round(_),s.setTempo(m)},s.setTempo=function(m){var _=s.parent.querySelector(".abcjs-midi-current-tempo");_&&(_.innerHTML=Math.round(m))},s.resetAll=function(){for(var m=s.parent.querySelectorAll(".abcjs-pushed"),_=0;_<m.length;_++){var k=m[_];k.classList.remove("abcjs-pushed")}},s.pushPlay=function(m){var _=s.parent.querySelector(".abcjs-midi-start");_&&(m?_.classList.add("abcjs-pushed"):_.classList.remove("abcjs-pushed"))},s.pushLoop=function(m){var _=s.parent.querySelector(".abcjs-midi-loop");_&&(m?_.classList.add("abcjs-pushed"):_.classList.remove("abcjs-pushed"))},s.setProgress=function(m,_){var k=s.parent.querySelector(".abcjs-midi-progress-background"),x=s.parent.querySelector(".abcjs-midi-progress-indicator");if(!(!k||!x)){var R=k.clientWidth,I=R*m;x.style.left=I+"px";var b=s.parent.querySelector(".abcjs-midi-clock");if(b){var A=_*m/1e3,N=Math.floor(A/60),M=Math.floor(A%60),z=M<10?"0"+M:M;b.innerHTML=N+":"+z}}},s.options.afterResume){var y=!1;s.options.ac?y=s.options.ac.state!=="suspended":a()&&(y=a().state!=="suspended"),y&&s.options.afterResume()}}function g(o,h){var s=!!h.loopHandler,v=!!h.restartHandler,y=!!h.playHandler||!!h.playPromiseHandler,m=!!h.progressHandler,_=!!h.warpHandler,k=h.hasClock!==!1,x=`<div class="abcjs-inline-audio">
|
|
210
210
|
`;if(s){var R=h.repeatTitle?h.repeatTitle:"Click to toggle play once/repeat.",I=h.repeatAria?h.repeatAria:R;x+='<button type="button" class="abcjs-midi-loop abcjs-btn" title="'+R+'" aria-label="'+I+'">'+n+`</button>
|
|
211
211
|
`}if(v){var b=h.restartTitle?h.restartTitle:"Click to go to beginning.",A=h.restartAria?h.restartAria:b;x+='<button type="button" class="abcjs-midi-reset abcjs-btn" title="'+b+'" aria-label="'+A+'">'+u+`</button>
|
|
212
212
|
`}if(y){var N=h.playTitle?h.playTitle:"Click to play/pause.",M=h.playAria?h.playAria:N;x+='<button type="button" class="abcjs-midi-start abcjs-btn" title="'+N+'" aria-label="'+M+'">'+r+i+c+`</button>
|
|
@@ -214,7 +214,7 @@ X:`),u=c.length;return u===0&&(u=1),u};var r=n.TuneBook=function(i){var c=t(i);t
|
|
|
214
214
|
`}if(k&&(x+=`<span class="abcjs-midi-clock"></span>
|
|
215
215
|
`),_){var E=h.warpTitle?h.warpTitle:"Change the playback speed.",T=h.warpAria?h.warpAria:E,P=h.bpm?h.bpm:"BPM";x+='<span class="abcjs-tempo-wrapper"><label><input class="abcjs-midi-tempo" type="number" min="1" max="300" value="100" title="'+E+'" aria-label="'+T+'">%</label><span> (<span class="abcjs-midi-current-tempo"></span> '+P+`)</span></span>
|
|
216
216
|
`}x+='<div class="abcjs-css-warning" style="font-size: 12px;color:red;border: 1px solid red;text-align: center;width: 300px;margin-top: 4px;font-weight: bold;border-radius: 4px;">CSS required: load abcjs-audio.css</div>',x+=`</div>
|
|
217
|
-
`,o.innerHTML=x}function d(o,h,s,v,y){var m=!0;if(a()?m=a().state==="suspended":t(),!e())throw{status:"NotSupported",message:"This browser does not support audio."};(m||y)&&s&&s.classList.add("abcjs-loading"),m?a().resume().then(function(){v?v().then(function(_){p(o,h,s,y)}):p(o,h,s,y)}):p(o,h,s,y)}function p(o,h,s,v){v?o(h).then(function(){s&&s.classList.remove("abcjs-loading")}):(o(h),s&&s.classList.remove("abcjs-loading"))}function l(o){var h=!!o.options.loopHandler,s=!!o.options.restartHandler,v=!!o.options.playHandler||!!o.options.playPromiseHandler,y=!!o.options.progressHandler,m=!!o.options.warpHandler,_=o.parent.querySelector(".abcjs-midi-start");h&&o.parent.querySelector(".abcjs-midi-loop").addEventListener("click",function(k){d(o.options.loopHandler,k,_,o.options.afterResume)}),s&&o.parent.querySelector(".abcjs-midi-reset").addEventListener("click",function(k){d(o.options.restartHandler,k,_,o.options.afterResume)}),v&&_.addEventListener("click",function(k){d(o.options.playPromiseHandler||o.options.playHandler,k,_,o.options.afterResume,!!o.options.playPromiseHandler)}),y&&o.parent.querySelector(".abcjs-midi-progress-background").addEventListener("click",function(k){d(o.options.progressHandler,k,_,o.options.afterResume)}),m&&o.parent.querySelector(".abcjs-midi-tempo").addEventListener("change",function(k){d(o.options.warpHandler,k,_,o.options.afterResume)})}return Xn=f,Xn}var Kn,sc;function Ov(){if(sc)return Kn;sc=1;var e=Gl(),t=Qa(),a=zt();function n(i,c,u,f,g){for(var d=new e,p=0;p<i.length;p++){var l=i[p],o=d.addTrack();if(d.setInstrument(o,l.instrument),p===0&&c)for(var h=0;h<c.length;h++){var s=c[h];d.appendNote(o,s.pitch,1/64,s.volume,s.cents)}d.appendNote(o,l.pitch,l.duration,l.volume,l.cents)}var v=a();return v.state==="suspended"?v.resume().then(function(){return r(d,u,f,g)}):r(d,u,f,g)}function r(i,c,u,f){var g=new t;return g.init({sequence:i,millisecondsPerMeasure:c,options:{soundFontUrl:u},debugCallback:f}).then(function(){return g.prime()}).then(function(){return g.start(),Promise.resolve()})}return Kn=n,Kn}var Jn,oc;function jl(){if(oc)return Jn;oc=1;var e=Ul(),t=Qa(),a=Ha(),n=zt();function r(){var i=this;i.warp=100,i.cursorControl=null,i.visualObj=null,i.timer=null,i.midiBuffer=null,i.options=null,i.currentTempo=null,i.control=null,i.isLooping=!1,i.isStarted=!1,i.isLoaded=!1,i.isLoading=!1,i.load=function(u,f,g){g||(g={}),g.displayPlay===void 0&&(g.displayPlay=!0),g.displayProgress===void 0&&(g.displayProgress=!0),i.control=new e(u,{loopHandler:g.displayLoop?i.toggleLoop:void 0,restartHandler:g.displayRestart?i.restart:void 0,playPromiseHandler:g.displayPlay?i.play:void 0,progressHandler:g.displayProgress?i.randomAccess:void 0,warpHandler:g.displayWarp?i.onWarp:void 0,afterResume:i.init}),i.cursorControl=f,i.disable(!0)},i.disable=function(u){i.control&&i.control.disable(u)},i.setTune=function(u,f,g){return i.visualObj=u,i.disable(!1),i.options=g||{},i.control&&(i.pause(),i.setProgress(0,1),i.control.resetAll(),i.restart(),i.isStarted=!1),i.isLooping=!1,f?i.go():Promise.resolve({status:"no-audio-context"})},i.go=function(){i.isLoading=!0;var u=i.visualObj.millisecondsPerMeasure()*100/i.warp;i.currentTempo=Math.round(i.visualObj.getBeatsPerMeasure()/u*6e4),i.control&&i.control.setTempo(i.currentTempo),i.percent=0;var f;return i.midiBuffer||(i.midiBuffer=new t),n().resume().then(function(g){return i.midiBuffer.init({visualObj:i.visualObj,options:i.options,millisecondsPerMeasure:u})}).then(function(g){return f=g,i.midiBuffer.prime()}).then(function(){var g=16;return i.cursorControl&&i.cursorControl.beatSubdivisions!==void 0&&parseInt(i.cursorControl.beatSubdivisions,10)>=1&&parseInt(i.cursorControl.beatSubdivisions,10)<=64&&(g=parseInt(i.cursorControl.beatSubdivisions,10)),i.timer=new a(i.visualObj,{beatCallback:i.beatCallback,eventCallback:i.eventCallback,lineEndCallback:i.lineEndCallback,qpm:i.currentTempo,extraMeasuresAtBeginning:i.cursorControl?i.cursorControl.extraMeasuresAtBeginning:void 0,lineEndAnticipation:i.cursorControl?i.cursorControl.lineEndAnticipation:0,beatSubdivisions:g}),i.cursorControl&&i.cursorControl.onReady&&typeof i.cursorControl.onReady=="function"&&i.cursorControl.onReady(i),i.isLoaded=!0,i.isLoading=!1,Promise.resolve({status:"created",notesStatus:f})})},i.destroy=function(){i.timer&&(i.timer.reset(),i.timer.stop(),i.timer=null),i.midiBuffer&&(i.midiBuffer.stop(),i.midiBuffer=null),i.setProgress(0,1),i.control&&i.control.resetAll()},i.play=function(){return i.runWhenReady(i._play,void 0)};function c(u){return new Promise(function(f){setTimeout(f,u)})}i.runWhenReady=function(u,f){return i.visualObj?i.isLoading?c(500).then(function(){return i.isLoading?i.runWhenReady(u,f):u(f)}):i.isLoaded?u(f):i.go().then(function(){return u(f)}):Promise.resolve({status:"loading"})},i._play=function(){return n().resume().then(function(){return i.isStarted=!i.isStarted,i.isStarted?(i.cursorControl&&i.cursorControl.onStart&&typeof i.cursorControl.onStart=="function"&&i.cursorControl.onStart(),i.midiBuffer.start(),i.timer.start(i.percent),i.control&&i.control.pushPlay(!0)):i.pause(),Promise.resolve({status:"ok"})})},i.pause=function(){i.timer&&(i.timer.pause(),i.midiBuffer.pause(),i.control&&i.control.pushPlay(!1))},i.toggleLoop=function(){i.isLooping=!i.isLooping,i.control&&i.control.pushLoop(i.isLooping)},i.restart=function(){i.timer&&(i.timer.setProgress(0),i.midiBuffer.seek(0))},i.randomAccess=function(u){return i.runWhenReady(i._randomAccess,u)},i._randomAccess=function(u){var f=u.target.classList.contains("abcjs-midi-progress-indicator")?u.target.parentNode:u.target,g=(u.x-f.getBoundingClientRect().left)/f.offsetWidth;return g<0&&(g=0),g>1&&(g=1),i.seek(g),Promise.resolve({status:"ok"})},i.seek=function(u,f){i.timer&&i.midiBuffer&&(i.timer.setProgress(u,f),i.midiBuffer.seek(u,f))},i.setWarp=function(u){if(parseInt(u,10)>0){i.warp=parseInt(u,10);var f=i.isStarted,g=i.percent;return i.destroy(),i.isStarted=!1,i.go().then(function(){return i.setProgress(g,i.midiBuffer.duration*1e3),i.control&&i.control.setWarp(i.currentTempo,i.warp),f?i.play().then(function(){return i.seek(g),Promise.resolve()}):(i.seek(g),Promise.resolve())})}return Promise.resolve()},i.onWarp=function(u){var f=u.target.value;return i.setWarp(f)},i.setProgress=function(u,f){i.percent=u,i.control&&i.control.setProgress(u,f)},i.finished=function(){if(i.timer.reset(),i.isLooping)return i.timer.start(0),i.midiBuffer.finished(),i.midiBuffer.start(),"continue";i.timer.stop(),i.isStarted&&(i.control&&i.control.pushPlay(!1),i.isStarted=!1,i.midiBuffer.finished(),i.cursorControl&&i.cursorControl.onFinished&&typeof i.cursorControl.onFinished=="function"&&i.cursorControl.onFinished(),i.setProgress(0,1))},i.beatCallback=function(u,f,g,d){var p=u/f;i.setProgress(p,g),i.cursorControl&&i.cursorControl.onBeat&&typeof i.cursorControl.onBeat=="function"&&i.cursorControl.onBeat(u,f,g,d)},i.eventCallback=function(u){if(u)i.cursorControl&&i.cursorControl.onEvent&&typeof i.cursorControl.onEvent=="function"&&i.cursorControl.onEvent(u);else return i.finished()},i.lineEndCallback=function(u,f){i.cursorControl&&i.cursorControl.onLineEnd&&typeof i.cursorControl.onLineEnd=="function"&&i.cursorControl.onLineEnd(u,f)},i.getUrl=function(){return i.midiBuffer.download()},i.download=function(u){var f=i.getUrl(),g=document.createElement("a");document.body.appendChild(g),g.setAttribute("style","display: none;"),g.href=f,g.download=u||"output.wav",g.click(),window.URL.revokeObjectURL(f),document.body.removeChild(g)}}return Jn=r,Jn}var Qn,cc;function Yl(){if(cc)return Qn;cc=1;var e=Zl(),t;return(function(){function a(l,o){for(var h in o)o.hasOwnProperty(h)&&l.setAttribute(h,o[h]);return l}function n(){this.trackstrings="",this.trackcount=0,this.noteOnAndChannel="%90",this.noteOffAndChannel="%80"}n.prototype.setTempo=function(l){this.trackcount===0&&(this.startTrack(),this.track+="%00%FF%51%03"+g(Math.round(6e7/l),6),this.endTrack())},n.prototype.setGlobalInfo=function(l,o,h,s){if(this.trackcount===0){this.startTrack();var v=Math.round(6e7/l);this.track+="%00%FF%51%03"+g(v,6),h&&(this.track+=c(h)),s&&(this.track+=u(s)),o&&(this.track+=i(o,"%01")),this.endTrack()}},n.prototype.startTrack=function(){this.noteWarped={},this.track="",this.trackName="",this.trackInstrument="",this.silencelength=0,this.trackcount++,this.instrument&&this.setInstrument(this.instrument)},n.prototype.endTrack=function(){this.track=this.trackName+this.trackInstrument+this.track;var l=g(this.track.length/3+4,8);this.track="MTrk"+l+this.track+"%00%FF%2F%00",this.trackstrings+=this.track},n.prototype.setText=function(l,o){switch(l){case"name":this.trackName=i(o,"%03");break}},n.prototype.setInstrument=function(l){this.trackInstrument="%00%C0"+g(l,2),this.instrument=l},n.prototype.setChannel=function(l,o){this.channel=l;var h="%00%B"+this.channel.toString(16);this.track+=h+"%79%00",this.track+=h+"%40%00",this.track+=h+"%5B%30",o||(o=0),o=Math.round((o+1)*64),this.track+=h+"%0A"+g(o,2),this.track+=h+"%07%64",this.noteOnAndChannel="%9"+this.channel.toString(16),this.noteOffAndChannel="%8"+this.channel.toString(16)};var r=4096;n.prototype.startNote=function(l,o,h){if(this.track+=p(this.silencelength),this.silencelength=0,h){this.track+="%e"+this.channel.toString(16);var s=Math.round(e(h)*r);this.track+=d(8192+s),this.track+=p(0),this.noteWarped[l]=!0}this.track+=this.noteOnAndChannel,this.track+="%"+l.toString(16)+g(o,2)},n.prototype.endNote=function(l){this.track+=p(this.silencelength),this.silencelength=0,this.noteWarped[l]&&(this.track+="%e"+this.channel.toString(16),this.track+=d(8192),this.track+=p(0),this.noteWarped[l]=!1),this.track+=this.noteOffAndChannel,this.track+="%"+l.toString(16)+"%00"},n.prototype.addRest=function(l){this.silencelength+=l,this.silencelength<0&&(this.silencelength=0)},n.prototype.getData=function(){return"data:audio/midi,MThd%00%00%00%06%00%01"+g(this.trackcount,4)+"%01%e0"+this.trackstrings},n.prototype.embed=function(l,o){var h=this.getData(),s=a(document.createElement("a"),{href:h});if(s.innerHTML="download midi",l.insertBefore(s,l.firstChild),!o){var v=a(document.createElement("embed"),{src:h,type:"video/quicktime",controller:"true",autoplay:"false",loop:"false",enablejavascript:"true",style:"display:block; height: 20px;"});l.insertBefore(v,l.firstChild)}};function i(l,o){for(var h="",s=0;s<l.length;s++)h+=g(l.charCodeAt(s),2);return"%00%FF"+o+g(h.length/3,2)+h}function c(l){if(!l||!l.accidentals)return"";for(var o="%00%FF%59%02",h=0,s=256,v=0;v<l.accidentals.length;v++)l.accidentals[v].acc==="sharp"?h++:l.accidentals[v].acc==="flat"&&s--;var y=g(s!==256?s:h,2),m=l.mode==="m"?"%01":"%00";return o+y+m}function u(l){var o="%00%FF%58%04"+g(l.num,2),h={1:0,2:1,4:2,8:3,16:4,32:5},s=h[l.den];if(!s)return"";o+=g(s,2);var v;switch(l.num+"/"+l.den){case"2/4":case"3/4":case"4/4":case"5/4":v=24;break;case"6/4":v=72;break;case"2/2":case"3/2":case"4/2":v=48;break;case"3/8":case"6/8":case"9/8":case"12/8":v=36;break}return v?(o+=g(v,2),o+"%08"):""}function f(l){for(var o="",h=0;h<l.length;h+=2)o+="%",o+=l.substr(h,2);return o}function g(l,o){var h=l.toString(16);for(h=h.split(".")[0];h.length<o;)h="0"+h;return h.length>o&&(h=h.substring(0,o)),f(h)}function d(l){l=Math.round(l);var o=l%128,h=l-o;return g(h*2+o,4)}function p(l){var o=0,h=[];for(l=Math.round(l);l!==0;)h.push(l&127),l=l>>7;for(var s=h.length-1;s>=0;s--){o=o<<8;var v=h[s];s!==0&&(v=v|128),o=o|v}var y=o.toString(16).length;return y+=y%2,g(o,y)}t=function(){return new n}})(),Qn=t,Qn}var ea,lc;function Dv(){if(lc)return ea;lc=1;var e=Yl(),t;return(function(){var a=1920;t=function(i,c){c===void 0&&(c={});var u=i.setUpAudio(c),f=e(),g=i.metaText?i.metaText.title:void 0;g&&g.length>128&&(g=g.substring(0,124)+"...");var d=i.getKeySignature(),p=i.getMeterFraction(),l=u.tempo,o=l/60;if(p.den===8&&p.num!==5&&p.num!==7){var h=i.millisecondsPerMeasure();l=6e4/(h/p.num)/2,o=l/60}f.setGlobalInfo(l,g,d,p);for(var s=0;s<u.tracks.length;s++){f.startTrack();for(var v={},y=0;y<u.tracks[s].length;y++){var m=u.tracks[s][y];switch(m.cmd){case"text":f.setText(m.type,m.text);break;case"program":var _=0;c.pan&&c.pan.length>s&&(_=c.pan[s]),m.instrument===128?(f.setChannel(9,_),f.setInstrument(0)):(f.setChannel(m.channel,_),f.setInstrument(m.instrument));break;case"note":var k=m.gap*o,x=m.start,R=x+m.duration-k;v[x]||(v[x]=[]),v[x].push({pitch:m.pitch,volume:m.volume,cents:m.cents}),v[R]||(v[R]=[]),v[R].push({pitch:m.pitch,volume:0});break;default:console.log("MIDI create Unknown: "+m.cmd)}}n(f,v,a),f.endTrack()}return f.getData()};function n(r,i,c){for(var u=Object.keys(i),f=0;f<u.length;f++)u[f]=parseFloat(u[f]);u.sort(function(s,v){return s-v});for(var g=0,d=0;d<u.length;d++){var p=i[u[d]];if(u[d]>g){var l=(u[d]-g)*c;r.addRest(l),g=u[d]}for(var o=0;o<p.length;o++){var h=p[o];h.volume?r.startNote(h.pitch,h.volume,h.cents):r.endNote(h.pitch)}}}})(),ea=t,ea}var ta,uc;function Fv(){if(uc)return ta;uc=1;var e=fr(),t=Dv(),a=function(i,c){var u={};if(c)for(var f in c)c.hasOwnProperty(f)&&(u[f]=c[f]);u.generateInline=!1;function g(d,p,l){var o=t(p,u);switch(u.midiOutputType){case"encoded":return o;case"binary":var h=o.replace("data:audio/midi,","");h=h.replace(/MThd/g,"%4d%54%68%64"),h=h.replace(/MTrk/g,"%4d%54%72%6b");for(var s=new ArrayBuffer(h.length/3),v=new Uint8Array(s),y=0;y<h.length/3;y++){var m=y*3+1,_=parseInt(h.substring(m,m+2),16);v[y]=_}return v;case"link":default:return r(p,u,o,l)}}return typeof i=="string"?e.renderEngine(g,"*",i,u):g(null,i,0)};function n(i){var c={};return i&&c.toString.call(i)==="[object Function]"}var r=function(i,c,u,f){var g=["abcjs-download-midi","abcjs-midi-"+f];c.downloadClass&&g.push(c.downloadClass);var d='<div class="'+g.join(" ")+'">';c.preTextDownload&&(d+=c.preTextDownload);var p=i.metaText&&i.metaText.title?i.metaText.title:"Untitled",l;c.downloadLabel&&n(c.downloadLabel)?l=c.downloadLabel(i,f):c.downloadLabel?l=c.downloadLabel.replace(/%T/,p):l='Download MIDI for "'+p+'"',p=p.toLowerCase().replace(/'/g,"").replace(/\W/g,"_").replace(/__/g,"_");var o=c.fileName?c.fileName:p+".midi";return d+='<a download="'+o+'" href="'+u+'">'+l+"</a>",c.postTextDownload&&(d+=c.postTextDownload),d+"</div>"};return ta=a,ta}var ra,hc;function Wl(){if(hc)return ra;hc=1;try{if(typeof window.CustomEvent!="function"){var e=function(a,n){n=n||{bubbles:!1,cancelable:!1,detail:void 0};var r=document.createEvent("CustomEvent");return r.initCustomEvent(a,n.bubbles,n.cancelable,n.detail),r};e.prototype=window.Event.prototype,window.CustomEvent=e}}catch{}var t=function(a){this.isEditArea=!0,typeof a=="string"?(this.textarea=document.getElementById(a),this.textarea||(this.textarea=document.querySelector(a))):this.textarea=a,this.initialText=this.textarea.value,this.isDragging=!1};return t.prototype.addSelectionListener=function(a){this.textarea.onmousemove=function(n){this.isDragging&&a.fireSelectionChanged()}},t.prototype.addChangeListener=function(a){this.changelistener=a,this.textarea.onkeyup=function(){a.fireChanged()},this.textarea.onmousedown=function(){this.isDragging=!0,a.fireSelectionChanged()},this.textarea.onmouseup=function(){this.isDragging=!1,a.fireChanged()},this.textarea.onchange=function(){a.fireChanged()}},t.prototype.getSelection=function(){return{start:this.textarea.selectionStart,end:this.textarea.selectionEnd}},t.prototype.setSelection=function(a,n){if(this.textarea.setSelectionRange)this.textarea.setSelectionRange(a,n);else if(this.textarea.createTextRange){var r=this.textarea.createTextRange();r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",a),r.select()}this.textarea.focus()},t.prototype.getString=function(){return this.textarea.value},t.prototype.setString=function(a){this.textarea.value=a,this.initialText=this.getString(),this.changelistener&&this.changelistener.fireChanged()},t.prototype.getElem=function(){return this.textarea},ra=t,ra}var na,fc;function Hv(){if(fc)return na;fc=1;var e=nt(),t=jl(),a=pr(),n=$l(),r=Wl();function i(u){var f={},g;if(u.abcjsParams)for(g in u.abcjsParams)u.abcjsParams.hasOwnProperty(g)&&(f[g]=u.abcjsParams[g]);if(u.midi_options)for(g in u.midi_options)u.midi_options.hasOwnProperty(g)&&(f[g]=u.midi_options[g]);if(u.parser_options)for(g in u.parser_options)u.parser_options.hasOwnProperty(g)&&(f[g]=u.parser_options[g]);if(u.render_options)for(g in u.render_options)u.render_options.hasOwnProperty(g)&&(f[g]=u.render_options[g]);return f.tablature&&u.warnings_id&&(f.tablature.warnings_id=u.warnings_id),f}var c=function(u,f){this.abcjsParams=i(f),f.indicate_changed&&(this.indicate_changed=!0),typeof u=="string"?this.editarea=new r(u):u.isEditArea?this.editarea=u:this.editarea=new r(u),this.editarea.addSelectionListener(this),this.editarea.addChangeListener(this),f.canvas_id?this.div=f.canvas_id:f.paper_id?this.div=f.paper_id:(this.div=document.createElement("DIV"),this.editarea.getElem().parentNode.insertBefore(this.div,this.editarea.getElem())),typeof this.div=="string"&&(this.div=document.getElementById(this.div)),f.selectionChangeCallback&&(this.selectionChangeCallback=f.selectionChangeCallback),this.clientClickListener=this.abcjsParams.clickListener,this.abcjsParams.clickListener=this.highlight.bind(this),f.synth&&a()&&(this.synth={el:f.synth.el,cursorControl:f.synth.cursorControl,options:f.synth.options}),f.generate_midi&&(this.generate_midi=f.generate_midi,this.abcjsParams.generateDownload&&(typeof f.midi_download_id=="string"?this.downloadMidi=document.getElementById(f.midi_download_id):f.midi_download_id&&(this.downloadMidi=f.midi_download_id)),this.abcjsParams.generateInline!==!1&&(typeof f.midi_id=="string"?this.inlineMidi=document.getElementById(f.midi_id):f.midi_id&&(this.inlineMidi=f.midi_id))),f.warnings_id?typeof f.warnings_id=="string"?this.warningsdiv=document.getElementById(f.warnings_id):this.warningsdiv=f.warnings_id:f.generate_warnings&&(this.warningsdiv=document.createElement("div"),this.div.parentNode.insertBefore(this.warningsdiv,this.div)),this.onchangeCallback=f.onchange,this.redrawCallback=f.redrawCallback,this.currentAbc="",this.tunes=[],this.bReentry=!1,this.parseABC(),this.modelChanged(),this.addClassName=function(g,d){var p=function(l,o){var h=l.className;return h.length>0&&(h===o||new RegExp("(^|\\s)"+o+"(\\s|$)").test(h))};return p(g,d)||(g.className+=(g.className?" ":"")+d),g},this.removeClassName=function(g,d){return g.className=e.strip(g.className.replace(new RegExp("(^|\\s+)"+d+"(\\s+|$)")," ")),g},this.setReadOnly=function(g){var d="abc_textarea_readonly",p=this.editarea.getElem();g?(p.setAttribute("readonly","yes"),this.addClassName(p,d)):(p.removeAttribute("readonly"),this.removeClassName(p,d))}};return c.prototype.redrawMidi=function(){if(this.generate_midi&&!this.midiPause){var u=new window.CustomEvent("generateMidi",{detail:{tunes:this.tunes,abcjsParams:this.abcjsParams,downloadMidiEl:this.downloadMidi,inlineMidiEl:this.inlineMidi,engravingEl:this.div}});window.dispatchEvent(u)}if(this.synth){var f=this.synth.synthControl;this.synth.synthControl||(this.synth.synthControl=new t,this.synth.synthControl.load(this.synth.el,this.synth.cursorControl,this.synth.options)),this.synth.synthControl.setTune(this.tunes[0],f,this.synth.options)}},c.prototype.modelChanged=function(){if(!this.bReentry){this.bReentry=!0;try{this.timerId=null,this.redrawCallback&&this.redrawCallback(!0),this.synth&&this.synth.synthControl&&this.synth.synthControl.disable(!0),this.tunes=n(this.div,this.currentAbc,this.abcjsParams),this.tunes.length>0&&(this.warnings=this.tunes[0].warnings),this.redrawMidi(),this.redrawCallback&&this.redrawCallback(!1)}catch(u){console.error("ABCJS error: ",u),this.warnings||(this.warnings=[]),this.warnings.push(u.message)}this.warningsdiv&&(this.warningsdiv.innerHTML=this.warnings?this.warnings.join("<br />"):"No errors"),this.updateSelection(),this.bReentry=!1}},c.prototype.paramChanged=function(u){if(u)for(var f in u)u.hasOwnProperty(f)&&(this.abcjsParams[f]=u[f]);this.currentAbc="",this.fireChanged()},c.prototype.getTunes=function(){return this.tunes},c.prototype.synthParamChanged=function(u){if(this.synth){if(this.synth.options={},u)for(var f in u)u.hasOwnProperty(f)&&(this.synth.options[f]=u[f]);this.currentAbc="",this.fireChanged()}},c.prototype.parseABC=function(){var u=this.editarea.getString();return u===this.currentAbc?(this.updateSelection(),!1):(this.currentAbc=u,!0)},c.prototype.updateSelection=function(){var u=this.editarea.getSelection();try{this.tunes.length>0&&this.tunes[0].engraver&&this.tunes[0].engraver.rangeHighlight(u.start,u.end)}catch{}this.selectionChangeCallback&&this.selectionChangeCallback(u.start,u.end)},c.prototype.fireSelectionChanged=function(){this.updateSelection()},c.prototype.setDirtyStyle=function(u){if(this.indicate_changed!==void 0){var f=function(l,o){var h=function(s,v){var y=s.className;return y.length>0&&(y===v||new RegExp("(^|\\s)"+v+"(\\s|$)").test(y))};return h(l,o)||(l.className+=(l.className?" ":"")+o),l},g=function(l,o){return l.className=e.strip(l.className.replace(new RegExp("(^|\\s+)"+o+"(\\s+|$)")," ")),l},d="abc_textarea_dirty",p=this.editarea.getElem();u?f(p,d):g(p,d)}},c.prototype.fireChanged=function(){if(!this.bIsPaused&&this.parseABC()){var u=this;this.timerId&&clearTimeout(this.timerId),this.timerId=setTimeout(function(){u.modelChanged()},300);var f=this.isDirty();this.wasDirty!==f&&(this.wasDirty=f,this.setDirtyStyle(f)),this.onchangeCallback&&this.onchangeCallback(this)}},c.prototype.setNotDirty=function(){this.editarea.initialText=this.editarea.getString(),this.wasDirty=!1,this.setDirtyStyle(!1)},c.prototype.isDirty=function(){return this.indicate_changed===void 0?!1:this.editarea.initialText!==this.editarea.getString()},c.prototype.highlight=function(u,f,g,d,p,l){this.editarea.setSelection(u.startChar,u.endChar),this.selectionChangeCallback&&this.selectionChangeCallback(u.startChar,u.endChar),this.clientClickListener&&this.clientClickListener(u,f,g,d,p,l)},c.prototype.pause=function(u){this.bIsPaused=u,u||this.fireChanged()},c.prototype.millisecondsPerMeasure=function(){return!this.synth||!this.synth.synthControl||!this.synth.synthControl.visualObj?0:this.synth.synthControl.visualObj.millisecondsPerMeasure()},c.prototype.pauseMidi=function(u){this.midiPause=u,u||this.redrawMidi()},na=c,na}var aa,dc;function $v(){if(dc)return aa;dc=1;var e=ng(),t=ag(),a=fr(),n=Cl(),r=xg(),i={};i.signature="abcjs-basic v"+e,Object.keys(t).forEach(function(_){i[_]=t[_]}),Object.keys(a).forEach(function(_){i[_]=a[_]}),i.renderAbc=$l(),i.tuneMetrics=Av(),i.TimingCallbacks=Ha();var c=pt();i.setGlyph=c.setSymbol,i.strTranspose=r;var u=Qa(),f=Ka(),g=Ja(),d=Gl(),p=Ul(),l=dr(),o=zt(),h=pr(),s=Ov(),v=jl(),y=Fv(),m=Yl();return i.synth={CreateSynth:u,instrumentIndexToName:f,pitchToNoteName:g,SynthController:v,SynthSequence:d,CreateSynthControl:p,registerAudioContext:l,activeAudioContext:o,supportsAudio:h,playEvent:s,getMidiFile:y,sequence:n,midiRenderer:m},i.Editor=Hv(),i.EditArea=Wl(),aa=i,aa}var Zv=$v();const ia=rg(Zv),bt={visualObj:null,synthControl:null},Kt=document.querySelector(".main"),pc=document.getElementById("status"),gc=document.getElementById("sheet-music"),sa=document.getElementById("audio-controls");"audioSession"in navigator&&(navigator.audioSession.type="playback");function Jt(e,t=!1){pc.textContent=e,pc.classList.toggle("error",t)}async function Gv(e){try{if(Jt("Rendering..."),gc.innerHTML="",sa.innerHTML="",bt.visualObj=ia.renderAbc(gc,e,{responsive:"resize",add_classes:!0}),!bt.visualObj||bt.visualObj.length===0)throw new Error("Failed to parse music notation");if(!ia.synth.supportsAudio())throw new Error("Audio not supported in this browser");bt.synthControl=new ia.synth.SynthController,bt.synthControl.load(sa,null,{displayLoop:!0,displayPlay:!0,displayProgress:!0}),await bt.synthControl.setTune(bt.visualObj[0],!1,{}),Jt("Ready to play!")}catch(t){console.error("Render error:",t),Jt(`Error: ${t.message}`,!0),sa.innerHTML=""}}const Lt=new tg({name:"Sheet Music App",version:"1.0.0"});Lt.ontoolinput=e=>{var a;console.info("Received tool input:",e);const t=(a=e.arguments)==null?void 0:a.abcNotation;t?Gv(t):Jt("No ABC notation provided",!0)};Lt.onerror=console.error;function Vl(e){e.safeAreaInsets&&(Kt.style.paddingTop=`${e.safeAreaInsets.top}px`,Kt.style.paddingRight=`${e.safeAreaInsets.right}px`,Kt.style.paddingBottom=`${e.safeAreaInsets.bottom}px`,Kt.style.paddingLeft=`${e.safeAreaInsets.left}px`)}Lt.onhostcontextchanged=Vl;Lt.connect().then(()=>{const e=Lt.getHostContext();e&&Vl(e)});</script>
|
|
217
|
+
`,o.innerHTML=x}function d(o,h,s,v,y){var m=!0;if(a()?m=a().state==="suspended":t(),!e())throw{status:"NotSupported",message:"This browser does not support audio."};(m||y)&&s&&s.classList.add("abcjs-loading"),m?a().resume().then(function(){v?v().then(function(_){p(o,h,s,y)}):p(o,h,s,y)}):p(o,h,s,y)}function p(o,h,s,v){v?o(h).then(function(){s&&s.classList.remove("abcjs-loading")}):(o(h),s&&s.classList.remove("abcjs-loading"))}function l(o){var h=!!o.options.loopHandler,s=!!o.options.restartHandler,v=!!o.options.playHandler||!!o.options.playPromiseHandler,y=!!o.options.progressHandler,m=!!o.options.warpHandler,_=o.parent.querySelector(".abcjs-midi-start");h&&o.parent.querySelector(".abcjs-midi-loop").addEventListener("click",function(k){d(o.options.loopHandler,k,_,o.options.afterResume)}),s&&o.parent.querySelector(".abcjs-midi-reset").addEventListener("click",function(k){d(o.options.restartHandler,k,_,o.options.afterResume)}),v&&_.addEventListener("click",function(k){d(o.options.playPromiseHandler||o.options.playHandler,k,_,o.options.afterResume,!!o.options.playPromiseHandler)}),y&&o.parent.querySelector(".abcjs-midi-progress-background").addEventListener("click",function(k){d(o.options.progressHandler,k,_,o.options.afterResume)}),m&&o.parent.querySelector(".abcjs-midi-tempo").addEventListener("change",function(k){d(o.options.warpHandler,k,_,o.options.afterResume)})}return X0=f,X0}var K0,sc;function Ov(){if(sc)return K0;sc=1;var e=Gl(),t=Qa(),a=zt();function n(i,c,u,f,g){for(var d=new e,p=0;p<i.length;p++){var l=i[p],o=d.addTrack();if(d.setInstrument(o,l.instrument),p===0&&c)for(var h=0;h<c.length;h++){var s=c[h];d.appendNote(o,s.pitch,1/64,s.volume,s.cents)}d.appendNote(o,l.pitch,l.duration,l.volume,l.cents)}var v=a();return v.state==="suspended"?v.resume().then(function(){return r(d,u,f,g)}):r(d,u,f,g)}function r(i,c,u,f){var g=new t;return g.init({sequence:i,millisecondsPerMeasure:c,options:{soundFontUrl:u},debugCallback:f}).then(function(){return g.prime()}).then(function(){return g.start(),Promise.resolve()})}return K0=n,K0}var J0,oc;function jl(){if(oc)return J0;oc=1;var e=Ul(),t=Qa(),a=Ha(),n=zt();function r(){var i=this;i.warp=100,i.cursorControl=null,i.visualObj=null,i.timer=null,i.midiBuffer=null,i.options=null,i.currentTempo=null,i.control=null,i.isLooping=!1,i.isStarted=!1,i.isLoaded=!1,i.isLoading=!1,i.load=function(u,f,g){g||(g={}),g.displayPlay===void 0&&(g.displayPlay=!0),g.displayProgress===void 0&&(g.displayProgress=!0),i.control=new e(u,{loopHandler:g.displayLoop?i.toggleLoop:void 0,restartHandler:g.displayRestart?i.restart:void 0,playPromiseHandler:g.displayPlay?i.play:void 0,progressHandler:g.displayProgress?i.randomAccess:void 0,warpHandler:g.displayWarp?i.onWarp:void 0,afterResume:i.init}),i.cursorControl=f,i.disable(!0)},i.disable=function(u){i.control&&i.control.disable(u)},i.setTune=function(u,f,g){return i.visualObj=u,i.disable(!1),i.options=g||{},i.control&&(i.pause(),i.setProgress(0,1),i.control.resetAll(),i.restart(),i.isStarted=!1),i.isLooping=!1,f?i.go():Promise.resolve({status:"no-audio-context"})},i.go=function(){i.isLoading=!0;var u=i.visualObj.millisecondsPerMeasure()*100/i.warp;i.currentTempo=Math.round(i.visualObj.getBeatsPerMeasure()/u*6e4),i.control&&i.control.setTempo(i.currentTempo),i.percent=0;var f;return i.midiBuffer||(i.midiBuffer=new t),n().resume().then(function(g){return i.midiBuffer.init({visualObj:i.visualObj,options:i.options,millisecondsPerMeasure:u})}).then(function(g){return f=g,i.midiBuffer.prime()}).then(function(){var g=16;return i.cursorControl&&i.cursorControl.beatSubdivisions!==void 0&&parseInt(i.cursorControl.beatSubdivisions,10)>=1&&parseInt(i.cursorControl.beatSubdivisions,10)<=64&&(g=parseInt(i.cursorControl.beatSubdivisions,10)),i.timer=new a(i.visualObj,{beatCallback:i.beatCallback,eventCallback:i.eventCallback,lineEndCallback:i.lineEndCallback,qpm:i.currentTempo,extraMeasuresAtBeginning:i.cursorControl?i.cursorControl.extraMeasuresAtBeginning:void 0,lineEndAnticipation:i.cursorControl?i.cursorControl.lineEndAnticipation:0,beatSubdivisions:g}),i.cursorControl&&i.cursorControl.onReady&&typeof i.cursorControl.onReady=="function"&&i.cursorControl.onReady(i),i.isLoaded=!0,i.isLoading=!1,Promise.resolve({status:"created",notesStatus:f})})},i.destroy=function(){i.timer&&(i.timer.reset(),i.timer.stop(),i.timer=null),i.midiBuffer&&(i.midiBuffer.stop(),i.midiBuffer=null),i.setProgress(0,1),i.control&&i.control.resetAll()},i.play=function(){return i.runWhenReady(i._play,void 0)};function c(u){return new Promise(function(f){setTimeout(f,u)})}i.runWhenReady=function(u,f){return i.visualObj?i.isLoading?c(500).then(function(){return i.isLoading?i.runWhenReady(u,f):u(f)}):i.isLoaded?u(f):i.go().then(function(){return u(f)}):Promise.resolve({status:"loading"})},i._play=function(){return n().resume().then(function(){return i.isStarted=!i.isStarted,i.isStarted?(i.cursorControl&&i.cursorControl.onStart&&typeof i.cursorControl.onStart=="function"&&i.cursorControl.onStart(),i.midiBuffer.start(),i.timer.start(i.percent),i.control&&i.control.pushPlay(!0)):i.pause(),Promise.resolve({status:"ok"})})},i.pause=function(){i.timer&&(i.timer.pause(),i.midiBuffer.pause(),i.control&&i.control.pushPlay(!1))},i.toggleLoop=function(){i.isLooping=!i.isLooping,i.control&&i.control.pushLoop(i.isLooping)},i.restart=function(){i.timer&&(i.timer.setProgress(0),i.midiBuffer.seek(0))},i.randomAccess=function(u){return i.runWhenReady(i._randomAccess,u)},i._randomAccess=function(u){var f=u.target.classList.contains("abcjs-midi-progress-indicator")?u.target.parentNode:u.target,g=(u.x-f.getBoundingClientRect().left)/f.offsetWidth;return g<0&&(g=0),g>1&&(g=1),i.seek(g),Promise.resolve({status:"ok"})},i.seek=function(u,f){i.timer&&i.midiBuffer&&(i.timer.setProgress(u,f),i.midiBuffer.seek(u,f))},i.setWarp=function(u){if(parseInt(u,10)>0){i.warp=parseInt(u,10);var f=i.isStarted,g=i.percent;return i.destroy(),i.isStarted=!1,i.go().then(function(){return i.setProgress(g,i.midiBuffer.duration*1e3),i.control&&i.control.setWarp(i.currentTempo,i.warp),f?i.play().then(function(){return i.seek(g),Promise.resolve()}):(i.seek(g),Promise.resolve())})}return Promise.resolve()},i.onWarp=function(u){var f=u.target.value;return i.setWarp(f)},i.setProgress=function(u,f){i.percent=u,i.control&&i.control.setProgress(u,f)},i.finished=function(){if(i.timer.reset(),i.isLooping)return i.timer.start(0),i.midiBuffer.finished(),i.midiBuffer.start(),"continue";i.timer.stop(),i.isStarted&&(i.control&&i.control.pushPlay(!1),i.isStarted=!1,i.midiBuffer.finished(),i.cursorControl&&i.cursorControl.onFinished&&typeof i.cursorControl.onFinished=="function"&&i.cursorControl.onFinished(),i.setProgress(0,1))},i.beatCallback=function(u,f,g,d){var p=u/f;i.setProgress(p,g),i.cursorControl&&i.cursorControl.onBeat&&typeof i.cursorControl.onBeat=="function"&&i.cursorControl.onBeat(u,f,g,d)},i.eventCallback=function(u){if(u)i.cursorControl&&i.cursorControl.onEvent&&typeof i.cursorControl.onEvent=="function"&&i.cursorControl.onEvent(u);else return i.finished()},i.lineEndCallback=function(u,f){i.cursorControl&&i.cursorControl.onLineEnd&&typeof i.cursorControl.onLineEnd=="function"&&i.cursorControl.onLineEnd(u,f)},i.getUrl=function(){return i.midiBuffer.download()},i.download=function(u){var f=i.getUrl(),g=document.createElement("a");document.body.appendChild(g),g.setAttribute("style","display: none;"),g.href=f,g.download=u||"output.wav",g.click(),window.URL.revokeObjectURL(f),document.body.removeChild(g)}}return J0=r,J0}var Q0,cc;function Yl(){if(cc)return Q0;cc=1;var e=Zl(),t;return(function(){function a(l,o){for(var h in o)o.hasOwnProperty(h)&&l.setAttribute(h,o[h]);return l}function n(){this.trackstrings="",this.trackcount=0,this.noteOnAndChannel="%90",this.noteOffAndChannel="%80"}n.prototype.setTempo=function(l){this.trackcount===0&&(this.startTrack(),this.track+="%00%FF%51%03"+g(Math.round(6e7/l),6),this.endTrack())},n.prototype.setGlobalInfo=function(l,o,h,s){if(this.trackcount===0){this.startTrack();var v=Math.round(6e7/l);this.track+="%00%FF%51%03"+g(v,6),h&&(this.track+=c(h)),s&&(this.track+=u(s)),o&&(this.track+=i(o,"%01")),this.endTrack()}},n.prototype.startTrack=function(){this.noteWarped={},this.track="",this.trackName="",this.trackInstrument="",this.silencelength=0,this.trackcount++,this.instrument&&this.setInstrument(this.instrument)},n.prototype.endTrack=function(){this.track=this.trackName+this.trackInstrument+this.track;var l=g(this.track.length/3+4,8);this.track="MTrk"+l+this.track+"%00%FF%2F%00",this.trackstrings+=this.track},n.prototype.setText=function(l,o){switch(l){case"name":this.trackName=i(o,"%03");break}},n.prototype.setInstrument=function(l){this.trackInstrument="%00%C0"+g(l,2),this.instrument=l},n.prototype.setChannel=function(l,o){this.channel=l;var h="%00%B"+this.channel.toString(16);this.track+=h+"%79%00",this.track+=h+"%40%00",this.track+=h+"%5B%30",o||(o=0),o=Math.round((o+1)*64),this.track+=h+"%0A"+g(o,2),this.track+=h+"%07%64",this.noteOnAndChannel="%9"+this.channel.toString(16),this.noteOffAndChannel="%8"+this.channel.toString(16)};var r=4096;n.prototype.startNote=function(l,o,h){if(this.track+=p(this.silencelength),this.silencelength=0,h){this.track+="%e"+this.channel.toString(16);var s=Math.round(e(h)*r);this.track+=d(8192+s),this.track+=p(0),this.noteWarped[l]=!0}this.track+=this.noteOnAndChannel,this.track+="%"+l.toString(16)+g(o,2)},n.prototype.endNote=function(l){this.track+=p(this.silencelength),this.silencelength=0,this.noteWarped[l]&&(this.track+="%e"+this.channel.toString(16),this.track+=d(8192),this.track+=p(0),this.noteWarped[l]=!1),this.track+=this.noteOffAndChannel,this.track+="%"+l.toString(16)+"%00"},n.prototype.addRest=function(l){this.silencelength+=l,this.silencelength<0&&(this.silencelength=0)},n.prototype.getData=function(){return"data:audio/midi,MThd%00%00%00%06%00%01"+g(this.trackcount,4)+"%01%e0"+this.trackstrings},n.prototype.embed=function(l,o){var h=this.getData(),s=a(document.createElement("a"),{href:h});if(s.innerHTML="download midi",l.insertBefore(s,l.firstChild),!o){var v=a(document.createElement("embed"),{src:h,type:"video/quicktime",controller:"true",autoplay:"false",loop:"false",enablejavascript:"true",style:"display:block; height: 20px;"});l.insertBefore(v,l.firstChild)}};function i(l,o){for(var h="",s=0;s<l.length;s++)h+=g(l.charCodeAt(s),2);return"%00%FF"+o+g(h.length/3,2)+h}function c(l){if(!l||!l.accidentals)return"";for(var o="%00%FF%59%02",h=0,s=256,v=0;v<l.accidentals.length;v++)l.accidentals[v].acc==="sharp"?h++:l.accidentals[v].acc==="flat"&&s--;var y=g(s!==256?s:h,2),m=l.mode==="m"?"%01":"%00";return o+y+m}function u(l){var o="%00%FF%58%04"+g(l.num,2),h={1:0,2:1,4:2,8:3,16:4,32:5},s=h[l.den];if(!s)return"";o+=g(s,2);var v;switch(l.num+"/"+l.den){case"2/4":case"3/4":case"4/4":case"5/4":v=24;break;case"6/4":v=72;break;case"2/2":case"3/2":case"4/2":v=48;break;case"3/8":case"6/8":case"9/8":case"12/8":v=36;break}return v?(o+=g(v,2),o+"%08"):""}function f(l){for(var o="",h=0;h<l.length;h+=2)o+="%",o+=l.substr(h,2);return o}function g(l,o){var h=l.toString(16);for(h=h.split(".")[0];h.length<o;)h="0"+h;return h.length>o&&(h=h.substring(0,o)),f(h)}function d(l){l=Math.round(l);var o=l%128,h=l-o;return g(h*2+o,4)}function p(l){var o=0,h=[];for(l=Math.round(l);l!==0;)h.push(l&127),l=l>>7;for(var s=h.length-1;s>=0;s--){o=o<<8;var v=h[s];s!==0&&(v=v|128),o=o|v}var y=o.toString(16).length;return y+=y%2,g(o,y)}t=function(){return new n}})(),Q0=t,Q0}var ea,lc;function Dv(){if(lc)return ea;lc=1;var e=Yl(),t;return(function(){var a=1920;t=function(i,c){c===void 0&&(c={});var u=i.setUpAudio(c),f=e(),g=i.metaText?i.metaText.title:void 0;g&&g.length>128&&(g=g.substring(0,124)+"...");var d=i.getKeySignature(),p=i.getMeterFraction(),l=u.tempo,o=l/60;if(p.den===8&&p.num!==5&&p.num!==7){var h=i.millisecondsPerMeasure();l=6e4/(h/p.num)/2,o=l/60}f.setGlobalInfo(l,g,d,p);for(var s=0;s<u.tracks.length;s++){f.startTrack();for(var v={},y=0;y<u.tracks[s].length;y++){var m=u.tracks[s][y];switch(m.cmd){case"text":f.setText(m.type,m.text);break;case"program":var _=0;c.pan&&c.pan.length>s&&(_=c.pan[s]),m.instrument===128?(f.setChannel(9,_),f.setInstrument(0)):(f.setChannel(m.channel,_),f.setInstrument(m.instrument));break;case"note":var k=m.gap*o,x=m.start,R=x+m.duration-k;v[x]||(v[x]=[]),v[x].push({pitch:m.pitch,volume:m.volume,cents:m.cents}),v[R]||(v[R]=[]),v[R].push({pitch:m.pitch,volume:0});break;default:console.log("MIDI create Unknown: "+m.cmd)}}n(f,v,a),f.endTrack()}return f.getData()};function n(r,i,c){for(var u=Object.keys(i),f=0;f<u.length;f++)u[f]=parseFloat(u[f]);u.sort(function(s,v){return s-v});for(var g=0,d=0;d<u.length;d++){var p=i[u[d]];if(u[d]>g){var l=(u[d]-g)*c;r.addRest(l),g=u[d]}for(var o=0;o<p.length;o++){var h=p[o];h.volume?r.startNote(h.pitch,h.volume,h.cents):r.endNote(h.pitch)}}}})(),ea=t,ea}var ta,uc;function Fv(){if(uc)return ta;uc=1;var e=fr(),t=Dv(),a=function(i,c){var u={};if(c)for(var f in c)c.hasOwnProperty(f)&&(u[f]=c[f]);u.generateInline=!1;function g(d,p,l){var o=t(p,u);switch(u.midiOutputType){case"encoded":return o;case"binary":var h=o.replace("data:audio/midi,","");h=h.replace(/MThd/g,"%4d%54%68%64"),h=h.replace(/MTrk/g,"%4d%54%72%6b");for(var s=new ArrayBuffer(h.length/3),v=new Uint8Array(s),y=0;y<h.length/3;y++){var m=y*3+1,_=parseInt(h.substring(m,m+2),16);v[y]=_}return v;case"link":default:return r(p,u,o,l)}}return typeof i=="string"?e.renderEngine(g,"*",i,u):g(null,i,0)};function n(i){var c={};return i&&c.toString.call(i)==="[object Function]"}var r=function(i,c,u,f){var g=["abcjs-download-midi","abcjs-midi-"+f];c.downloadClass&&g.push(c.downloadClass);var d='<div class="'+g.join(" ")+'">';c.preTextDownload&&(d+=c.preTextDownload);var p=i.metaText&&i.metaText.title?i.metaText.title:"Untitled",l;c.downloadLabel&&n(c.downloadLabel)?l=c.downloadLabel(i,f):c.downloadLabel?l=c.downloadLabel.replace(/%T/,p):l='Download MIDI for "'+p+'"',p=p.toLowerCase().replace(/'/g,"").replace(/\W/g,"_").replace(/__/g,"_");var o=c.fileName?c.fileName:p+".midi";return d+='<a download="'+o+'" href="'+u+'">'+l+"</a>",c.postTextDownload&&(d+=c.postTextDownload),d+"</div>"};return ta=a,ta}var ra,hc;function Wl(){if(hc)return ra;hc=1;try{if(typeof window.CustomEvent!="function"){var e=function(a,n){n=n||{bubbles:!1,cancelable:!1,detail:void 0};var r=document.createEvent("CustomEvent");return r.initCustomEvent(a,n.bubbles,n.cancelable,n.detail),r};e.prototype=window.Event.prototype,window.CustomEvent=e}}catch{}var t=function(a){this.isEditArea=!0,typeof a=="string"?(this.textarea=document.getElementById(a),this.textarea||(this.textarea=document.querySelector(a))):this.textarea=a,this.initialText=this.textarea.value,this.isDragging=!1};return t.prototype.addSelectionListener=function(a){this.textarea.onmousemove=function(n){this.isDragging&&a.fireSelectionChanged()}},t.prototype.addChangeListener=function(a){this.changelistener=a,this.textarea.onkeyup=function(){a.fireChanged()},this.textarea.onmousedown=function(){this.isDragging=!0,a.fireSelectionChanged()},this.textarea.onmouseup=function(){this.isDragging=!1,a.fireChanged()},this.textarea.onchange=function(){a.fireChanged()}},t.prototype.getSelection=function(){return{start:this.textarea.selectionStart,end:this.textarea.selectionEnd}},t.prototype.setSelection=function(a,n){if(this.textarea.setSelectionRange)this.textarea.setSelectionRange(a,n);else if(this.textarea.createTextRange){var r=this.textarea.createTextRange();r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",a),r.select()}this.textarea.focus()},t.prototype.getString=function(){return this.textarea.value},t.prototype.setString=function(a){this.textarea.value=a,this.initialText=this.getString(),this.changelistener&&this.changelistener.fireChanged()},t.prototype.getElem=function(){return this.textarea},ra=t,ra}var na,fc;function Hv(){if(fc)return na;fc=1;var e=nt(),t=jl(),a=pr(),n=$l(),r=Wl();function i(u){var f={},g;if(u.abcjsParams)for(g in u.abcjsParams)u.abcjsParams.hasOwnProperty(g)&&(f[g]=u.abcjsParams[g]);if(u.midi_options)for(g in u.midi_options)u.midi_options.hasOwnProperty(g)&&(f[g]=u.midi_options[g]);if(u.parser_options)for(g in u.parser_options)u.parser_options.hasOwnProperty(g)&&(f[g]=u.parser_options[g]);if(u.render_options)for(g in u.render_options)u.render_options.hasOwnProperty(g)&&(f[g]=u.render_options[g]);return f.tablature&&u.warnings_id&&(f.tablature.warnings_id=u.warnings_id),f}var c=function(u,f){this.abcjsParams=i(f),f.indicate_changed&&(this.indicate_changed=!0),typeof u=="string"?this.editarea=new r(u):u.isEditArea?this.editarea=u:this.editarea=new r(u),this.editarea.addSelectionListener(this),this.editarea.addChangeListener(this),f.canvas_id?this.div=f.canvas_id:f.paper_id?this.div=f.paper_id:(this.div=document.createElement("DIV"),this.editarea.getElem().parentNode.insertBefore(this.div,this.editarea.getElem())),typeof this.div=="string"&&(this.div=document.getElementById(this.div)),f.selectionChangeCallback&&(this.selectionChangeCallback=f.selectionChangeCallback),this.clientClickListener=this.abcjsParams.clickListener,this.abcjsParams.clickListener=this.highlight.bind(this),f.synth&&a()&&(this.synth={el:f.synth.el,cursorControl:f.synth.cursorControl,options:f.synth.options}),f.generate_midi&&(this.generate_midi=f.generate_midi,this.abcjsParams.generateDownload&&(typeof f.midi_download_id=="string"?this.downloadMidi=document.getElementById(f.midi_download_id):f.midi_download_id&&(this.downloadMidi=f.midi_download_id)),this.abcjsParams.generateInline!==!1&&(typeof f.midi_id=="string"?this.inlineMidi=document.getElementById(f.midi_id):f.midi_id&&(this.inlineMidi=f.midi_id))),f.warnings_id?typeof f.warnings_id=="string"?this.warningsdiv=document.getElementById(f.warnings_id):this.warningsdiv=f.warnings_id:f.generate_warnings&&(this.warningsdiv=document.createElement("div"),this.div.parentNode.insertBefore(this.warningsdiv,this.div)),this.onchangeCallback=f.onchange,this.redrawCallback=f.redrawCallback,this.currentAbc="",this.tunes=[],this.bReentry=!1,this.parseABC(),this.modelChanged(),this.addClassName=function(g,d){var p=function(l,o){var h=l.className;return h.length>0&&(h===o||new RegExp("(^|\\s)"+o+"(\\s|$)").test(h))};return p(g,d)||(g.className+=(g.className?" ":"")+d),g},this.removeClassName=function(g,d){return g.className=e.strip(g.className.replace(new RegExp("(^|\\s+)"+d+"(\\s+|$)")," ")),g},this.setReadOnly=function(g){var d="abc_textarea_readonly",p=this.editarea.getElem();g?(p.setAttribute("readonly","yes"),this.addClassName(p,d)):(p.removeAttribute("readonly"),this.removeClassName(p,d))}};return c.prototype.redrawMidi=function(){if(this.generate_midi&&!this.midiPause){var u=new window.CustomEvent("generateMidi",{detail:{tunes:this.tunes,abcjsParams:this.abcjsParams,downloadMidiEl:this.downloadMidi,inlineMidiEl:this.inlineMidi,engravingEl:this.div}});window.dispatchEvent(u)}if(this.synth){var f=this.synth.synthControl;this.synth.synthControl||(this.synth.synthControl=new t,this.synth.synthControl.load(this.synth.el,this.synth.cursorControl,this.synth.options)),this.synth.synthControl.setTune(this.tunes[0],f,this.synth.options)}},c.prototype.modelChanged=function(){if(!this.bReentry){this.bReentry=!0;try{this.timerId=null,this.redrawCallback&&this.redrawCallback(!0),this.synth&&this.synth.synthControl&&this.synth.synthControl.disable(!0),this.tunes=n(this.div,this.currentAbc,this.abcjsParams),this.tunes.length>0&&(this.warnings=this.tunes[0].warnings),this.redrawMidi(),this.redrawCallback&&this.redrawCallback(!1)}catch(u){console.error("ABCJS error: ",u),this.warnings||(this.warnings=[]),this.warnings.push(u.message)}this.warningsdiv&&(this.warningsdiv.innerHTML=this.warnings?this.warnings.join("<br />"):"No errors"),this.updateSelection(),this.bReentry=!1}},c.prototype.paramChanged=function(u){if(u)for(var f in u)u.hasOwnProperty(f)&&(this.abcjsParams[f]=u[f]);this.currentAbc="",this.fireChanged()},c.prototype.getTunes=function(){return this.tunes},c.prototype.synthParamChanged=function(u){if(this.synth){if(this.synth.options={},u)for(var f in u)u.hasOwnProperty(f)&&(this.synth.options[f]=u[f]);this.currentAbc="",this.fireChanged()}},c.prototype.parseABC=function(){var u=this.editarea.getString();return u===this.currentAbc?(this.updateSelection(),!1):(this.currentAbc=u,!0)},c.prototype.updateSelection=function(){var u=this.editarea.getSelection();try{this.tunes.length>0&&this.tunes[0].engraver&&this.tunes[0].engraver.rangeHighlight(u.start,u.end)}catch{}this.selectionChangeCallback&&this.selectionChangeCallback(u.start,u.end)},c.prototype.fireSelectionChanged=function(){this.updateSelection()},c.prototype.setDirtyStyle=function(u){if(this.indicate_changed!==void 0){var f=function(l,o){var h=function(s,v){var y=s.className;return y.length>0&&(y===v||new RegExp("(^|\\s)"+v+"(\\s|$)").test(y))};return h(l,o)||(l.className+=(l.className?" ":"")+o),l},g=function(l,o){return l.className=e.strip(l.className.replace(new RegExp("(^|\\s+)"+o+"(\\s+|$)")," ")),l},d="abc_textarea_dirty",p=this.editarea.getElem();u?f(p,d):g(p,d)}},c.prototype.fireChanged=function(){if(!this.bIsPaused&&this.parseABC()){var u=this;this.timerId&&clearTimeout(this.timerId),this.timerId=setTimeout(function(){u.modelChanged()},300);var f=this.isDirty();this.wasDirty!==f&&(this.wasDirty=f,this.setDirtyStyle(f)),this.onchangeCallback&&this.onchangeCallback(this)}},c.prototype.setNotDirty=function(){this.editarea.initialText=this.editarea.getString(),this.wasDirty=!1,this.setDirtyStyle(!1)},c.prototype.isDirty=function(){return this.indicate_changed===void 0?!1:this.editarea.initialText!==this.editarea.getString()},c.prototype.highlight=function(u,f,g,d,p,l){this.editarea.setSelection(u.startChar,u.endChar),this.selectionChangeCallback&&this.selectionChangeCallback(u.startChar,u.endChar),this.clientClickListener&&this.clientClickListener(u,f,g,d,p,l)},c.prototype.pause=function(u){this.bIsPaused=u,u||this.fireChanged()},c.prototype.millisecondsPerMeasure=function(){return!this.synth||!this.synth.synthControl||!this.synth.synthControl.visualObj?0:this.synth.synthControl.visualObj.millisecondsPerMeasure()},c.prototype.pauseMidi=function(u){this.midiPause=u,u||this.redrawMidi()},na=c,na}var aa,dc;function $v(){if(dc)return aa;dc=1;var e=ng(),t=ag(),a=fr(),n=Cl(),r=xg(),i={};i.signature="abcjs-basic v"+e,Object.keys(t).forEach(function(_){i[_]=t[_]}),Object.keys(a).forEach(function(_){i[_]=a[_]}),i.renderAbc=$l(),i.tuneMetrics=Av(),i.TimingCallbacks=Ha();var c=pt();i.setGlyph=c.setSymbol,i.strTranspose=r;var u=Qa(),f=Ka(),g=Ja(),d=Gl(),p=Ul(),l=dr(),o=zt(),h=pr(),s=Ov(),v=jl(),y=Fv(),m=Yl();return i.synth={CreateSynth:u,instrumentIndexToName:f,pitchToNoteName:g,SynthController:v,SynthSequence:d,CreateSynthControl:p,registerAudioContext:l,activeAudioContext:o,supportsAudio:h,playEvent:s,getMidiFile:y,sequence:n,midiRenderer:m},i.Editor=Hv(),i.EditArea=Wl(),aa=i,aa}var Zv=$v();const ia=rg(Zv),bt={visualObj:null,synthControl:null},Kt=document.querySelector(".main"),pc=document.getElementById("status"),gc=document.getElementById("sheet-music"),sa=document.getElementById("audio-controls");"audioSession"in navigator&&(navigator.audioSession.type="playback");function Jt(e,t=!1){pc.textContent=e,pc.classList.toggle("error",t)}async function Gv(e){try{if(Jt("Rendering..."),gc.innerHTML="",sa.innerHTML="",bt.visualObj=ia.renderAbc(gc,e,{responsive:"resize",add_classes:!0}),!bt.visualObj||bt.visualObj.length===0)throw new Error("Failed to parse music notation");if(!ia.synth.supportsAudio())throw new Error("Audio not supported in this browser");bt.synthControl=new ia.synth.SynthController,bt.synthControl.load(sa,null,{displayLoop:!0,displayPlay:!0,displayProgress:!0}),await bt.synthControl.setTune(bt.visualObj[0],!1,{}),Jt("Ready to play!")}catch(t){console.error("Render error:",t),Jt(`Error: ${t.message}`,!0),sa.innerHTML=""}}const Lt=new tg({name:"Sheet Music App",version:"1.0.0"});Lt.ontoolinput=e=>{var a;console.info("Received tool input:",e);const t=(a=e.arguments)==null?void 0:a.abcNotation;t?Gv(t):Jt("No ABC notation provided",!0)};Lt.onerror=console.error;function Vl(e){e.safeAreaInsets&&(Kt.style.paddingTop=`${e.safeAreaInsets.top}px`,Kt.style.paddingRight=`${e.safeAreaInsets.right}px`,Kt.style.paddingBottom=`${e.safeAreaInsets.bottom}px`,Kt.style.paddingLeft=`${e.safeAreaInsets.left}px`)}Lt.onhostcontextchanged=Vl;Lt.connect().then(()=>{const e=Lt.getHostContext();e&&Vl(e)});</script>
|
|
218
218
|
<style rel="stylesheet" crossorigin>.abcjs-inline-audio{height:26px;padding:0 5px;border-radius:3px;background-color:#424242;display:flex;align-items:center;box-sizing:border-box}.abcjs-inline-audio.abcjs-disabled{opacity:.5}.abcjs-inline-audio .abcjs-btn{display:block;width:28px;height:34px;margin-right:2px;padding:7px 4px;background:none!important;border:1px solid transparent;box-sizing:border-box;line-height:1}.abcjs-btn g{fill:#f4f4f4;stroke:#f4f4f4}.abcjs-inline-audio .abcjs-btn:hover g{fill:#ccc;stroke:#ccc}.abcjs-inline-audio .abcjs-midi-selection.abcjs-pushed,.abcjs-inline-audio .abcjs-midi-loop.abcjs-pushed,.abcjs-inline-audio .abcjs-midi-reset.abcjs-pushed{border:1px solid #cccccc;background-color:#666;box-sizing:border-box}.abcjs-inline-audio .abcjs-midi-start .abcjs-pause-svg,.abcjs-inline-audio .abcjs-midi-start .abcjs-loading-svg,.abcjs-inline-audio .abcjs-midi-start.abcjs-pushed .abcjs-play-svg,.abcjs-inline-audio .abcjs-midi-start.abcjs-loading .abcjs-play-svg{display:none}.abcjs-inline-audio .abcjs-midi-start.abcjs-pushed .abcjs-pause-svg{display:block}.abcjs-inline-audio .abcjs-midi-progress-background{background-color:#424242;height:10px;border-radius:5px;border:2px solid #cccccc;margin:0 8px 0 15px;position:relative;flex:1;padding:0;box-sizing:border-box}.abcjs-inline-audio .abcjs-midi-progress-indicator{width:20px;margin-left:-10px;height:14px;background-color:#f4f4f4;position:absolute;display:inline-block;border-radius:6px;top:-4px;left:0;box-sizing:border-box}.abcjs-inline-audio .abcjs-midi-clock{margin-left:4px;margin-top:1px;margin-right:2px;display:inline-block;font-family:sans-serif;font-size:16px;box-sizing:border-box;color:#f4f4f4}.abcjs-inline-audio .abcjs-tempo-wrapper{font-size:10px;color:#f4f4f4;box-sizing:border-box;display:flex;align-items:center}.abcjs-inline-audio .abcjs-midi-tempo{border-radius:2px;border:none;margin:0 2px 0 4px;width:42px;padding-left:2px;box-sizing:border-box}.abcjs-inline-audio .abcjs-loading .abcjs-loading-svg{display:inherit}.abcjs-inline-audio .abcjs-loading{outline:none;animation-name:abcjs-spin;animation-duration:1s;animation-iteration-count:infinite;animation-timing-function:linear}.abcjs-inline-audio .abcjs-loading-svg circle{stroke:#f4f4f4}@keyframes abcjs-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.abcjs-large .abcjs-inline-audio{height:52px}.abcjs-large .abcjs-btn{width:56px;height:52px;font-size:28px;padding:6px 8px}.abcjs-large .abcjs-midi-progress-background{height:20px;border:4px solid #cccccc}.abcjs-large .abcjs-midi-progress-indicator{height:28px;top:-8px;width:40px}.abcjs-large .abcjs-midi-clock{font-size:32px;margin-right:10px;margin-left:10px;margin-top:-1px}.abcjs-large .abcjs-midi-tempo{font-size:20px;width:50px}.abcjs-large .abcjs-tempo-wrapper{font-size:20px}.abcjs-css-warning{display:none}*{box-sizing:border-box}html,body{font-family:system-ui,-apple-system,sans-serif;font-size:1rem}code{font-size:1em}:root{--color-bg: #ffffff;--color-text: #1f2937;--color-text-muted: #6b7280;--color-primary: #2563eb;--color-success: #10b981;--color-danger: #ef4444;--color-card-bg: #f9fafb;--color-border: #e5e7eb}@media(prefers-color-scheme:dark){:root{--color-bg: #111827;--color-text: #f9fafb;--color-text-muted: #9ca3af;--color-primary: #3b82f6;--color-success: #34d399;--color-danger: #f87171;--color-card-bg: #1f2937;--color-border: #374151}}html,body{margin:0;padding:0;background:var(--color-bg);color:var(--color-text)}.main{width:100%;margin:0 auto;padding:8px;display:flex;flex-direction:column;gap:8px}#audio-controls:empty{display:none}#audio-controls:not(:empty)~#status{display:none}.audio-controls{width:100%}.audio-controls .abcjs-inline-audio{border-radius:8px}.audio-controls .abcjs-inline-audio .abcjs-midi-loop.abcjs-pushed{background-color:var(--color-success)!important;border-color:var(--color-success)!important}.status{font-size:.875rem;color:var(--color-text-muted)}.status.error{color:var(--color-danger)}.sheet-section{background:var(--color-card-bg);border-radius:8px;padding:16px;border:1px solid var(--color-border);min-height:500px}.sheet-section .sheet-music-container{width:100%;overflow-x:auto}</style>
|
|
219
219
|
</head>
|
|
220
220
|
<body>
|