mcp-music-studio 0.1.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.
@@ -0,0 +1,255 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <meta name="color-scheme" content="light dark">
7
+ <title>Music Studio</title>
8
+ <script type="module" crossorigin>var vu=Object.defineProperty;var mu=(e,t,n)=>t in e?vu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var je=(e,t,n)=>mu(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))a(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&a(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();function K(e,t,n){function a(l,h){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:h,constr:o,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,h);const g=o.prototype,p=Object.keys(g);for(let d=0;d<p.length;d++){const f=p[d];f in l||(l[f]=g[f].bind(l))}}const r=(n==null?void 0:n.Parent)??Object;class s extends r{}Object.defineProperty(s,"name",{value:e});function o(l){var h;const g=n!=null&&n.Parent?new s:this;a(g,l),(h=g._zod).deferred??(h.deferred=[]);for(const p of g._zod.deferred)p();return g}return Object.defineProperty(o,"init",{value:a}),Object.defineProperty(o,Symbol.hasInstance,{value:l=>{var h,g;return n!=null&&n.Parent&&l instanceof n.Parent?!0:(g=(h=l==null?void 0:l._zod)==null?void 0:h.traits)==null?void 0:g.has(e)}}),Object.defineProperty(o,"name",{value:e}),o}class Mt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ac extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Mc={};function ft(e){return Mc}function Ic(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,r])=>t.indexOf(+a)===-1).map(([a,r])=>r)}function va(e,t){return typeof t=="bigint"?t.toString():t}function hr(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function _a(e){return e==null}function ka(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function bu(e,t){const n=(e.toString().split(".")[1]||"").length,a=t.toString();let r=(a.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(a)){const h=a.match(/\d?e-(\d?)/);h!=null&&h[1]&&(r=Number.parseInt(h[1]))}const s=n>r?n:r,o=Number.parseInt(e.toFixed(s).replace(".","")),l=Number.parseInt(t.toFixed(s).replace(".",""));return o%l/10**s}const pi=Symbol("evaluating");function xe(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==pi)return a===void 0&&(a=pi,a=n()),a},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function xt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function pt(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function gi(e){return JSON.stringify(e)}function yu(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Nc="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Dt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const wu=hr(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Nt(e){if(Dt(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Dt(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Pc(e){return Nt(e)?{...e}:Array.isArray(e)?[...e]:e}const _u=new Set(["string","number","symbol"]);function Pt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function gt(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(a._zod.parent=e),a}function le(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function ku(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const xu={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Cu(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=pt(e._zod.def,{get shape(){const o={};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(o[l]=n.shape[l])}return xt(this,"shape",o),o},checks:[]});return gt(e,s)}function Su(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=pt(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete o[l]}return xt(this,"shape",o),o},checks:[]});return gt(e,s)}function Tu(e,t){if(!Nt(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const o in t)if(Object.getOwnPropertyDescriptor(s,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=pt(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return xt(this,"shape",s),s}});return gt(e,r)}function Eu(e,t){if(!Nt(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=pt(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return xt(this,"shape",a),a}});return gt(e,n)}function Au(e,t){const n=pt(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return xt(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return gt(e,n)}function Mu(e,t,n){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=pt(t._zod.def,{get shape(){const l=t._zod.def.shape,h={...l};if(n)for(const g in n){if(!(g in l))throw new Error(`Unrecognized key: "${g}"`);n[g]&&(h[g]=e?new e({type:"optional",innerType:l[g]}):l[g])}else for(const g in l)h[g]=e?new e({type:"optional",innerType:l[g]}):l[g];return xt(this,"shape",h),h},checks:[]});return gt(t,o)}function Iu(e,t,n){const a=pt(t._zod.def,{get shape(){const r=t._zod.def.shape,s={...r};if(n)for(const o in n){if(!(o in s))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(s[o]=new e({type:"nonoptional",innerType:r[o]}))}else for(const o in r)s[o]=new e({type:"nonoptional",innerType:r[o]});return xt(this,"shape",s),s}});return gt(t,a)}function Tt(e,t=0){var n;if(e.aborted===!0)return!0;for(let a=t;a<e.issues.length;a++)if(((n=e.issues[a])==null?void 0:n.continue)!==!0)return!0;return!1}function Et(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function Qt(e){return typeof e=="string"?e:e==null?void 0:e.message}function dt(e,t,n){var r,s,o,l,h,g;const a={...e,path:e.path??[]};if(!e.message){const p=Qt((o=(s=(r=e.inst)==null?void 0:r._zod.def)==null?void 0:s.error)==null?void 0:o.call(s,e))??Qt((l=t==null?void 0:t.error)==null?void 0:l.call(t,e))??Qt((h=n.customError)==null?void 0:h.call(n,e))??Qt((g=n.localeError)==null?void 0:g.call(n,e))??"Invalid input";a.message=p}return delete a.inst,delete a.continue,t!=null&&t.reportInput||delete a.input,a}function xa(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ft(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const zc=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,va,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Rc=K("$ZodError",zc),qc=K("$ZodError",zc,{Parent:Error});function Nu(e,t=n=>n.message){const n={},a=[];for(const r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):a.push(t(r));return{formErrors:a,fieldErrors:n}}function Pu(e,t=n=>n.message){const n={_errors:[]},a=r=>{for(const s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(o=>a({issues:o}));else if(s.code==="invalid_key")a({issues:s.issues});else if(s.code==="invalid_element")a({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let o=n,l=0;for(;l<s.path.length;){const h=s.path[l];l===s.path.length-1?(o[h]=o[h]||{_errors:[]},o[h]._errors.push(t(s))):o[h]=o[h]||{_errors:[]},o=o[h],l++}}};return a(e),n}const Ca=e=>(t,n,a,r)=>{const s=a?Object.assign(a,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},s);if(o instanceof Promise)throw new Mt;if(o.issues.length){const l=new((r==null?void 0:r.Err)??e)(o.issues.map(h=>dt(h,s,ft())));throw Nc(l,r==null?void 0:r.callee),l}return o.value},Sa=e=>async(t,n,a,r)=>{const s=a?Object.assign(a,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},s);if(o instanceof Promise&&(o=await o),o.issues.length){const l=new((r==null?void 0:r.Err)??e)(o.issues.map(h=>dt(h,s,ft())));throw Nc(l,r==null?void 0:r.callee),l}return o.value},fr=e=>(t,n,a)=>{const r=a?{...a,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise)throw new Mt;return s.issues.length?{success:!1,error:new(e??Rc)(s.issues.map(o=>dt(o,r,ft())))}:{success:!0,data:s.value}},Bc=fr(qc),dr=e=>async(t,n,a)=>{const r=a?Object.assign(a,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(o=>dt(o,r,ft())))}:{success:!0,data:s.value}},zu=dr(qc),Ru=e=>(t,n,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Ca(e)(t,n,r)},qu=e=>(t,n,a)=>Ca(e)(t,n,a),Bu=e=>async(t,n,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Sa(e)(t,n,r)},Lu=e=>async(t,n,a)=>Sa(e)(t,n,a),Ou=e=>(t,n,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return fr(e)(t,n,r)},Du=e=>(t,n,a)=>fr(e)(t,n,a),Fu=e=>async(t,n,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return dr(e)(t,n,r)},Hu=e=>async(t,n,a)=>dr(e)(t,n,a),$u=/^[cC][^\s-]{8,}$/,Gu=/^[0-9a-z]+$/,Zu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ju=/^[0-9a-vA-V]{20}$/,Uu=/^[A-Za-z0-9]{27}$/,Yu=/^[a-zA-Z0-9_-]{21}$/,Wu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Vu=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,vi=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Xu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ku="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ju(){return new RegExp(Ku,"u")}const Qu=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,eh=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,th=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,rh=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,nh=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Lc=/^[A-Za-z0-9_-]*$/,ah=/^\+[1-9]\d{6,14}$/,Oc="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",ih=new RegExp(`^${Oc}$`);function Dc(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function sh(e){return new RegExp(`^${Dc(e)}$`)}function oh(e){const t=Dc({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${n.join("|")})`;return new RegExp(`^${Oc}T(?:${a})$`)}const ch=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},lh=/^-?\d+$/,Fc=/^-?\d+(?:\.\d+)?$/,uh=/^(?:true|false)$/i,hh=/^null$/i,fh=/^undefined$/i,dh=/^[^A-Z]*$/,ph=/^[^a-z]*$/,Ve=K("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Hc={number:"number",bigint:"bigint",object:"date"},$c=K("$ZodCheckLessThan",(e,t)=>{Ve.init(e,t);const n=Hc[typeof t.value];e._zod.onattach.push(a=>{const r=a._zod.bag,s=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Gc=K("$ZodCheckGreaterThan",(e,t)=>{Ve.init(e,t);const n=Hc[typeof t.value];e._zod.onattach.push(a=>{const r=a._zod.bag,s=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),gh=K("$ZodCheckMultipleOf",(e,t)=>{Ve.init(e,t),e._zod.onattach.push(n=>{var a;(a=n._zod.bag).multipleOf??(a.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):bu(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),vh=K("$ZodCheckNumberFormat",(e,t)=>{var o;Ve.init(e,t),t.format=t.format||"float64";const n=(o=t.format)==null?void 0:o.includes("int"),a=n?"int":"number",[r,s]=xu[t.format];e._zod.onattach.push(l=>{const h=l._zod.bag;h.format=t.format,h.minimum=r,h.maximum=s,n&&(h.pattern=lh)}),e._zod.check=l=>{const h=l.value;if(n){if(!Number.isInteger(h)){l.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:h,inst:e});return}if(!Number.isSafeInteger(h)){h>0?l.issues.push({input:h,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}):l.issues.push({input:h,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort});return}}h<r&&l.issues.push({origin:"number",input:h,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),h>s&&l.issues.push({origin:"number",input:h,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),mh=K("$ZodCheckMaxLength",(e,t)=>{var n;Ve.init(e,t),(n=e._zod.def).when??(n.when=a=>{const r=a.value;return!_a(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const r=a.value;if(r.length<=t.maximum)return;const o=xa(r);a.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),bh=K("$ZodCheckMinLength",(e,t)=>{var n;Ve.init(e,t),(n=e._zod.def).when??(n.when=a=>{const r=a.value;return!_a(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const r=a.value;if(r.length>=t.minimum)return;const o=xa(r);a.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),yh=K("$ZodCheckLengthEquals",(e,t)=>{var n;Ve.init(e,t),(n=e._zod.def).when??(n.when=a=>{const r=a.value;return!_a(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=a=>{const r=a.value,s=r.length;if(s===t.length)return;const o=xa(r),l=s>t.length;a.issues.push({origin:o,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),pr=K("$ZodCheckStringFormat",(e,t)=>{var n,a;Ve.init(e,t),e._zod.onattach.push(r=>{const s=r._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),wh=K("$ZodCheckRegex",(e,t)=>{pr.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),_h=K("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=dh),pr.init(e,t)}),kh=K("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ph),pr.init(e,t)}),xh=K("$ZodCheckIncludes",(e,t)=>{Ve.init(e,t);const n=Pt(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(a)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),Ch=K("$ZodCheckStartsWith",(e,t)=>{Ve.init(e,t);const n=new RegExp(`^${Pt(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const r=a._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),Sh=K("$ZodCheckEndsWith",(e,t)=>{Ve.init(e,t);const n=new RegExp(`.*${Pt(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const r=a._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}}),Th=K("$ZodCheckOverwrite",(e,t)=>{Ve.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Eh{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const a=t.split(`
9
+ `).filter(o=>o),r=Math.min(...a.map(o=>o.length-o.trimStart().length)),s=a.map(o=>o.slice(r)).map(o=>" ".repeat(this.indent*2)+o);for(const o of s)this.content.push(o)}compile(){const t=Function,n=this==null?void 0:this.args,r=[...((this==null?void 0:this.content)??[""]).map(s=>` ${s}`)];return new t(...n,r.join(`
10
+ `))}}const Ah={major:4,minor:3,patch:6},Ie=K("$ZodType",(e,t)=>{var r;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ah;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const s of a)for(const o of s._zod.onattach)o(e);if(a.length===0)(n=e._zod).deferred??(n.deferred=[]),(r=e._zod.deferred)==null||r.push(()=>{e._zod.run=e._zod.parse});else{const s=(l,h,g)=>{let p=Tt(l),d;for(const f of h){if(f._zod.def.when){if(!f._zod.def.when(l))continue}else if(p)continue;const c=l.issues.length,u=f._zod.check(l);if(u instanceof Promise&&(g==null?void 0:g.async)===!1)throw new Mt;if(d||u instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await u,l.issues.length!==c&&(p||(p=Tt(l,c)))});else{if(l.issues.length===c)continue;p||(p=Tt(l,c))}}return d?d.then(()=>l):l},o=(l,h,g)=>{if(Tt(l))return l.aborted=!0,l;const p=s(h,a,g);if(p instanceof Promise){if(g.async===!1)throw new Mt;return p.then(d=>e._zod.parse(d,g))}return e._zod.parse(p,g)};e._zod.run=(l,h)=>{if(h.skipChecks)return e._zod.parse(l,h);if(h.direction==="backward"){const p=e._zod.parse({value:l.value,issues:[]},{...h,skipChecks:!0});return p instanceof Promise?p.then(d=>o(d,l,h)):o(p,l,h)}const g=e._zod.parse(l,h);if(g instanceof Promise){if(h.async===!1)throw new Mt;return g.then(p=>s(p,a,h))}return s(g,a,h)}}xe(e,"~standard",()=>({validate:s=>{var o;try{const l=Bc(e,s);return l.success?{value:l.data}:{issues:(o=l.error)==null?void 0:o.issues}}catch{return zu(e,s).then(h=>{var g;return h.success?{value:h.data}:{issues:(g=h.error)==null?void 0:g.issues}})}},vendor:"zod",version:1}))}),Ta=K("$ZodString",(e,t)=>{var n;Ie.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??ch(e._zod.bag),e._zod.parse=(a,r)=>{if(t.coerce)try{a.value=String(a.value)}catch{}return typeof a.value=="string"||a.issues.push({expected:"string",code:"invalid_type",input:a.value,inst:e}),a}}),Pe=K("$ZodStringFormat",(e,t)=>{pr.init(e,t),Ta.init(e,t)}),Mh=K("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Vu),Pe.init(e,t)}),Ih=K("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=vi(a))}else t.pattern??(t.pattern=vi());Pe.init(e,t)}),Nh=K("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Xu),Pe.init(e,t)}),Ph=K("$ZodURL",(e,t)=>{Pe.init(e,t),e._zod.check=n=>{try{const a=n.value.trim(),r=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=r.href:n.value=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),zh=K("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ju()),Pe.init(e,t)}),Rh=K("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Yu),Pe.init(e,t)}),qh=K("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=$u),Pe.init(e,t)}),Bh=K("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Gu),Pe.init(e,t)}),Lh=K("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Zu),Pe.init(e,t)}),Oh=K("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ju),Pe.init(e,t)}),Dh=K("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Uu),Pe.init(e,t)}),Fh=K("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=oh(t)),Pe.init(e,t)}),Hh=K("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ih),Pe.init(e,t)}),$h=K("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=sh(t)),Pe.init(e,t)}),Gh=K("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Wu),Pe.init(e,t)}),Zh=K("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Qu),Pe.init(e,t),e._zod.bag.format="ipv4"}),jh=K("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=eh),Pe.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Uh=K("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=th),Pe.init(e,t)}),Yh=K("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=rh),Pe.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[r,s]=a;if(!s)throw new Error;const o=Number(s);if(`${o}`!==s)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Zc(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Wh=K("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=nh),Pe.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Zc(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Vh(e){if(!Lc.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Zc(n)}const Xh=K("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Lc),Pe.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Vh(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Kh=K("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ah),Pe.init(e,t)});function Jh(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[a]=n;if(!a)return!1;const r=JSON.parse(atob(a));return!("typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}const Qh=K("$ZodJWT",(e,t)=>{Pe.init(e,t),e._zod.check=n=>{Jh(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),jc=K("$ZodNumber",(e,t)=>{Ie.init(e,t),e._zod.pattern=e._zod.bag.pattern??Fc,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;const s=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...s?{received:s}:{}}),n}}),ef=K("$ZodNumberFormat",(e,t)=>{vh.init(e,t),jc.init(e,t)}),tf=K("$ZodBoolean",(e,t)=>{Ie.init(e,t),e._zod.pattern=uh,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=!!n.value}catch{}const r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}}),rf=K("$ZodUndefined",(e,t)=>{Ie.init(e,t),e._zod.pattern=fh,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,a)=>{const r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}}),nf=K("$ZodNull",(e,t)=>{Ie.init(e,t),e._zod.pattern=hh,e._zod.values=new Set([null]),e._zod.parse=(n,a)=>{const r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}}),af=K("$ZodUnknown",(e,t)=>{Ie.init(e,t),e._zod.parse=n=>n}),sf=K("$ZodNever",(e,t)=>{Ie.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function mi(e,t,n){e.issues.length&&t.issues.push(...Et(n,e.issues)),t.value[n]=e.value}const of=K("$ZodArray",(e,t)=>{Ie.init(e,t),e._zod.parse=(n,a)=>{const r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);const s=[];for(let o=0;o<r.length;o++){const l=r[o],h=t.element._zod.run({value:l,issues:[]},a);h instanceof Promise?s.push(h.then(g=>mi(g,n,o))):mi(h,n,o)}return s.length?Promise.all(s).then(()=>n):n}});function sr(e,t,n,a,r){if(e.issues.length){if(r&&!(n in a))return;t.issues.push(...Et(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function Uc(e){var a,r,s,o;const t=Object.keys(e.shape);for(const l of t)if(!((o=(s=(r=(a=e.shape)==null?void 0:a[l])==null?void 0:r._zod)==null?void 0:s.traits)!=null&&o.has("$ZodType")))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const n=ku(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Yc(e,t,n,a,r,s){const o=[],l=r.keySet,h=r.catchall._zod,g=h.def.type,p=h.optout==="optional";for(const d in t){if(l.has(d))continue;if(g==="never"){o.push(d);continue}const f=h.run({value:t[d],issues:[]},a);f instanceof Promise?e.push(f.then(c=>sr(c,n,d,t,p))):sr(f,n,d,t,p)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const cf=K("$ZodObject",(e,t)=>{Ie.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!(n!=null&&n.get)){const l=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...l};return Object.defineProperty(t,"shape",{value:h}),h}})}const a=hr(()=>Uc(t));xe(e._zod,"propValues",()=>{const l=t.shape,h={};for(const g in l){const p=l[g]._zod;if(p.values){h[g]??(h[g]=new Set);for(const d of p.values)h[g].add(d)}}return h});const r=Dt,s=t.catchall;let o;e._zod.parse=(l,h)=>{o??(o=a.value);const g=l.value;if(!r(g))return l.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),l;l.value={};const p=[],d=o.shape;for(const f of o.keys){const c=d[f],u=c._zod.optout==="optional",i=c._zod.run({value:g[f],issues:[]},h);i instanceof Promise?p.push(i.then(v=>sr(v,l,f,g,u))):sr(i,l,f,g,u)}return s?Yc(p,g,l,h,a.value,e):p.length?Promise.all(p).then(()=>l):l}}),lf=K("$ZodObjectJIT",(e,t)=>{cf.init(e,t);const n=e._zod.parse,a=hr(()=>Uc(t)),r=f=>{var w;const c=new Eh(["shape","payload","ctx"]),u=a.value,i=_=>{const T=gi(_);return`shape[${T}]._zod.run({ value: input[${T}], issues: [] }, ctx)`};c.write("const input = payload.value;");const v=Object.create(null);let b=0;for(const _ of u.keys)v[_]=`key_${b++}`;c.write("const newResult = {};");for(const _ of u.keys){const T=v[_],q=gi(_),I=f[_],E=((w=I==null?void 0:I._zod)==null?void 0:w.optout)==="optional";c.write(`const ${T} = ${i(_)};`),E?c.write(`
11
+ if (${T}.issues.length) {
12
+ if (${q} in input) {
13
+ payload.issues = payload.issues.concat(${T}.issues.map(iss => ({
14
+ ...iss,
15
+ path: iss.path ? [${q}, ...iss.path] : [${q}]
16
+ })));
17
+ }
18
+ }
19
+
20
+ if (${T}.value === undefined) {
21
+ if (${q} in input) {
22
+ newResult[${q}] = undefined;
23
+ }
24
+ } else {
25
+ newResult[${q}] = ${T}.value;
26
+ }
27
+
28
+ `):c.write(`
29
+ if (${T}.issues.length) {
30
+ payload.issues = payload.issues.concat(${T}.issues.map(iss => ({
31
+ ...iss,
32
+ path: iss.path ? [${q}, ...iss.path] : [${q}]
33
+ })));
34
+ }
35
+
36
+ if (${T}.value === undefined) {
37
+ if (${q} in input) {
38
+ newResult[${q}] = undefined;
39
+ }
40
+ } else {
41
+ newResult[${q}] = ${T}.value;
42
+ }
43
+
44
+ `)}c.write("payload.value = newResult;"),c.write("return payload;");const m=c.compile();return(_,T)=>m(f,_,T)};let s;const o=Dt,l=!Mc.jitless,g=l&&wu.value,p=t.catchall;let d;e._zod.parse=(f,c)=>{d??(d=a.value);const u=f.value;return o(u)?l&&g&&(c==null?void 0:c.async)===!1&&c.jitless!==!0?(s||(s=r(t.shape)),f=s(f,c),p?Yc([],u,f,c,d,e):f):n(f,c):(f.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),f)}});function bi(e,t,n,a){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const r=e.filter(s=>!Tt(s));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(o=>dt(o,a,ft())))}),t)}const Wc=K("$ZodUnion",(e,t)=>{Ie.init(e,t),xe(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),xe(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),xe(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),xe(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${r.map(s=>ka(s.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(r,s)=>{if(n)return a(r,s);let o=!1;const l=[];for(const h of t.options){const g=h._zod.run({value:r.value,issues:[]},s);if(g instanceof Promise)l.push(g),o=!0;else{if(g.issues.length===0)return g;l.push(g)}}return o?Promise.all(l).then(h=>bi(h,r,e,s)):bi(l,r,e,s)}}),uf=K("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Wc.init(e,t);const n=e._zod.parse;xe(e._zod,"propValues",()=>{const r={};for(const s of t.options){const o=s._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[l,h]of Object.entries(o)){r[l]||(r[l]=new Set);for(const g of h)r[l].add(g)}}return r});const a=hr(()=>{var o;const r=t.options,s=new Map;for(const l of r){const h=(o=l._zod.propValues)==null?void 0:o[t.discriminator];if(!h||h.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(const g of h){if(s.has(g))throw new Error(`Duplicate discriminator value "${String(g)}"`);s.set(g,l)}}return s});e._zod.parse=(r,s)=>{const o=r.value;if(!Dt(o))return r.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),r;const l=a.value.get(o==null?void 0:o[t.discriminator]);return l?l._zod.run(r,s):t.unionFallback?n(r,s):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),r)}}),hf=K("$ZodIntersection",(e,t)=>{Ie.init(e,t),e._zod.parse=(n,a)=>{const r=n.value,s=t.left._zod.run({value:r,issues:[]},a),o=t.right._zod.run({value:r,issues:[]},a);return s instanceof Promise||o instanceof Promise?Promise.all([s,o]).then(([h,g])=>yi(n,h,g)):yi(n,s,o)}});function ma(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(Nt(e)&&Nt(t)){const n=Object.keys(t),a=Object.keys(e).filter(s=>n.indexOf(s)!==-1),r={...e,...t};for(const s of a){const o=ma(e[s],t[s]);if(!o.valid)return{valid:!1,mergeErrorPath:[s,...o.mergeErrorPath]};r[s]=o.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let a=0;a<e.length;a++){const r=e[a],s=t[a],o=ma(r,s);if(!o.valid)return{valid:!1,mergeErrorPath:[a,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function yi(e,t,n){const a=new Map;let r;for(const l of t.issues)if(l.code==="unrecognized_keys"){r??(r=l);for(const h of l.keys)a.has(h)||a.set(h,{}),a.get(h).l=!0}else e.issues.push(l);for(const l of n.issues)if(l.code==="unrecognized_keys")for(const h of l.keys)a.has(h)||a.set(h,{}),a.get(h).r=!0;else e.issues.push(l);const s=[...a].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(s.length&&r&&e.issues.push({...r,keys:s}),Tt(e))return e;const o=ma(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const ff=K("$ZodRecord",(e,t)=>{Ie.init(e,t),e._zod.parse=(n,a)=>{const r=n.value;if(!Nt(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),n;const s=[],o=t.keyType._zod.values;if(o){n.value={};const l=new Set;for(const g of o)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){l.add(typeof g=="number"?g.toString():g);const p=t.valueType._zod.run({value:r[g],issues:[]},a);p instanceof Promise?s.push(p.then(d=>{d.issues.length&&n.issues.push(...Et(g,d.issues)),n.value[g]=d.value})):(p.issues.length&&n.issues.push(...Et(g,p.issues)),n.value[g]=p.value)}let h;for(const g in r)l.has(g)||(h=h??[],h.push(g));h&&h.length>0&&n.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:h})}else{n.value={};for(const l of Reflect.ownKeys(r)){if(l==="__proto__")continue;let h=t.keyType._zod.run({value:l,issues:[]},a);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&Fc.test(l)&&h.issues.length){const d=t.keyType._zod.run({value:Number(l),issues:[]},a);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(h=d)}if(h.issues.length){t.mode==="loose"?n.value[l]=r[l]:n.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(d=>dt(d,a,ft())),input:l,path:[l],inst:e});continue}const p=t.valueType._zod.run({value:r[l],issues:[]},a);p instanceof Promise?s.push(p.then(d=>{d.issues.length&&n.issues.push(...Et(l,d.issues)),n.value[h.value]=d.value})):(p.issues.length&&n.issues.push(...Et(l,p.issues)),n.value[h.value]=p.value)}}return s.length?Promise.all(s).then(()=>n):n}}),df=K("$ZodEnum",(e,t)=>{Ie.init(e,t);const n=Ic(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(r=>_u.has(typeof r)).map(r=>typeof r=="string"?Pt(r):r.toString()).join("|")})$`),e._zod.parse=(r,s)=>{const o=r.value;return a.has(o)||r.issues.push({code:"invalid_value",values:n,input:o,inst:e}),r}}),pf=K("$ZodLiteral",(e,t)=>{if(Ie.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?Pt(a):a?Pt(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,r)=>{const s=a.value;return n.has(s)||a.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),a}}),gf=K("$ZodTransform",(e,t)=>{Ie.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new Ac(e.constructor.name);const r=t.transform(n.value,n);if(a.async)return(r instanceof Promise?r:Promise.resolve(r)).then(o=>(n.value=o,n));if(r instanceof Promise)throw new Mt;return n.value=r,n}});function wi(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Vc=K("$ZodOptional",(e,t)=>{Ie.init(e,t),e._zod.optin="optional",e._zod.optout="optional",xe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),xe(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ka(n.source)})?$`):void 0}),e._zod.parse=(n,a)=>{if(t.innerType._zod.optin==="optional"){const r=t.innerType._zod.run(n,a);return r instanceof Promise?r.then(s=>wi(s,n.value)):wi(r,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),vf=K("$ZodExactOptional",(e,t)=>{Vc.init(e,t),xe(e._zod,"values",()=>t.innerType._zod.values),xe(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),mf=K("$ZodNullable",(e,t)=>{Ie.init(e,t),xe(e._zod,"optin",()=>t.innerType._zod.optin),xe(e._zod,"optout",()=>t.innerType._zod.optout),xe(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ka(n.source)}|null)$`):void 0}),xe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,a)=>n.value===null?n:t.innerType._zod.run(n,a)}),bf=K("$ZodDefault",(e,t)=>{Ie.init(e,t),e._zod.optin="optional",xe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);if(n.value===void 0)return n.value=t.defaultValue,n;const r=t.innerType._zod.run(n,a);return r instanceof Promise?r.then(s=>_i(s,t)):_i(r,t)}});function _i(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const yf=K("$ZodPrefault",(e,t)=>{Ie.init(e,t),e._zod.optin="optional",xe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>(a.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,a))}),wf=K("$ZodNonOptional",(e,t)=>{Ie.init(e,t),xe(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(a=>a!==void 0)):void 0}),e._zod.parse=(n,a)=>{const r=t.innerType._zod.run(n,a);return r instanceof Promise?r.then(s=>ki(s,e)):ki(r,e)}});function ki(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 _f=K("$ZodCatch",(e,t)=>{Ie.init(e,t),xe(e._zod,"optin",()=>t.innerType._zod.optin),xe(e._zod,"optout",()=>t.innerType._zod.optout),xe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const r=t.innerType._zod.run(n,a);return r instanceof Promise?r.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(o=>dt(o,a,ft()))},input:n.value}),n.issues=[]),n)):(n.value=r.value,r.issues.length&&(n.value=t.catchValue({...n,error:{issues:r.issues.map(s=>dt(s,a,ft()))},input:n.value}),n.issues=[]),n)}}),kf=K("$ZodPipe",(e,t)=>{Ie.init(e,t),xe(e._zod,"values",()=>t.in._zod.values),xe(e._zod,"optin",()=>t.in._zod.optin),xe(e._zod,"optout",()=>t.out._zod.optout),xe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const s=t.out._zod.run(n,a);return s instanceof Promise?s.then(o=>er(o,t.in,a)):er(s,t.in,a)}const r=t.in._zod.run(n,a);return r instanceof Promise?r.then(s=>er(s,t.out,a)):er(r,t.out,a)}});function er(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const xf=K("$ZodReadonly",(e,t)=>{Ie.init(e,t),xe(e._zod,"propValues",()=>t.innerType._zod.propValues),xe(e._zod,"values",()=>t.innerType._zod.values),xe(e._zod,"optin",()=>{var n,a;return(a=(n=t.innerType)==null?void 0:n._zod)==null?void 0:a.optin}),xe(e._zod,"optout",()=>{var n,a;return(a=(n=t.innerType)==null?void 0:n._zod)==null?void 0:a.optout}),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const r=t.innerType._zod.run(n,a);return r instanceof Promise?r.then(xi):xi(r)}});function xi(e){return e.value=Object.freeze(e.value),e}const Cf=K("$ZodCustom",(e,t)=>{Ve.init(e,t),Ie.init(e,t),e._zod.parse=(n,a)=>n,e._zod.check=n=>{const a=n.value,r=t.fn(a);if(r instanceof Promise)return r.then(s=>Ci(s,n,a,e));Ci(r,n,a,e)}});function Ci(e,t,n,a){if(!e){const r={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(r.params=a._zod.def.params),t.issues.push(Ft(r))}}var Si;class Sf{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const a=n[0];return this._map.set(t,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const a={...this.get(n)??{}};delete a.id;const r={...a,...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 Tf(){return new Sf}(Si=globalThis).__zod_globalRegistry??(Si.__zod_globalRegistry=Tf());const Ot=globalThis.__zod_globalRegistry;function Ef(e,t){return new e({type:"string",...le(t)})}function Af(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...le(t)})}function Ti(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...le(t)})}function Mf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...le(t)})}function If(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...le(t)})}function Nf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...le(t)})}function Pf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...le(t)})}function zf(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...le(t)})}function Rf(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...le(t)})}function qf(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...le(t)})}function Bf(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...le(t)})}function Lf(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...le(t)})}function Of(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...le(t)})}function Df(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...le(t)})}function Ff(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...le(t)})}function Hf(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...le(t)})}function $f(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...le(t)})}function Gf(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...le(t)})}function Zf(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...le(t)})}function jf(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...le(t)})}function Uf(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...le(t)})}function Yf(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...le(t)})}function Wf(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...le(t)})}function Vf(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...le(t)})}function Xf(e,t){return new e({type:"string",format:"date",check:"string_format",...le(t)})}function Kf(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...le(t)})}function Jf(e,t){return new e({type:"string",format:"duration",check:"string_format",...le(t)})}function Qf(e,t){return new e({type:"number",checks:[],...le(t)})}function e1(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...le(t)})}function t1(e,t){return new e({type:"boolean",...le(t)})}function r1(e,t){return new e({type:"undefined",...le(t)})}function n1(e,t){return new e({type:"null",...le(t)})}function a1(e){return new e({type:"unknown"})}function i1(e,t){return new e({type:"never",...le(t)})}function Ei(e,t){return new $c({check:"less_than",...le(t),value:e,inclusive:!1})}function Cr(e,t){return new $c({check:"less_than",...le(t),value:e,inclusive:!0})}function Ai(e,t){return new Gc({check:"greater_than",...le(t),value:e,inclusive:!1})}function Sr(e,t){return new Gc({check:"greater_than",...le(t),value:e,inclusive:!0})}function Mi(e,t){return new gh({check:"multiple_of",...le(t),value:e})}function Xc(e,t){return new mh({check:"max_length",...le(t),maximum:e})}function or(e,t){return new bh({check:"min_length",...le(t),minimum:e})}function Kc(e,t){return new yh({check:"length_equals",...le(t),length:e})}function s1(e,t){return new wh({check:"string_format",format:"regex",...le(t),pattern:e})}function o1(e){return new _h({check:"string_format",format:"lowercase",...le(e)})}function c1(e){return new kh({check:"string_format",format:"uppercase",...le(e)})}function l1(e,t){return new xh({check:"string_format",format:"includes",...le(t),includes:e})}function u1(e,t){return new Ch({check:"string_format",format:"starts_with",...le(t),prefix:e})}function h1(e,t){return new Sh({check:"string_format",format:"ends_with",...le(t),suffix:e})}function Rt(e){return new Th({check:"overwrite",tx:e})}function f1(e){return Rt(t=>t.normalize(e))}function d1(){return Rt(e=>e.trim())}function p1(){return Rt(e=>e.toLowerCase())}function g1(){return Rt(e=>e.toUpperCase())}function v1(){return Rt(e=>yu(e))}function m1(e,t,n){return new e({type:"array",element:t,...le(n)})}function b1(e,t,n){const a=le(n);return a.abort??(a.abort=!0),new e({type:"custom",check:"custom",fn:t,...a})}function y1(e,t,n){return new e({type:"custom",check:"custom",fn:t,...le(n)})}function w1(e){const t=_1(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(Ft(a,n.value,t._zod.def));else{const r=a;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(Ft(r))}},e(n.value,n)));return t}function _1(e,t){const n=new Ve({check:"custom",...le(t)});return n._zod.check=e,n}function Jc(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)??Ot,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 Oe(e,t,n={path:[],schemaPath:[]}){var p,d;var a;const r=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const l=(d=(p=e._zod).toJSONSchema)==null?void 0:d.call(p);if(l)o.schema=l;else{const f={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,f);else{const u=o.schema,i=t.processors[r.type];if(!i)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);i(e,t,u,f)}const c=e._zod.parent;c&&(o.ref||(o.ref=c),Oe(c,t,f),t.seen.get(c).isParent=!0)}const h=t.metadataRegistry.get(e);return h&&Object.assign(o.schema,h),t.io==="input"&&Ye(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((a=o.schema).default??(a.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Qc(e,t){var o,l,h,g;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const p of e.seen.entries()){const d=(o=e.metadataRegistry.get(p[0]))==null?void 0:o.id;if(d){const f=a.get(d);if(f&&f!==p[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(d,p[0])}}const r=p=>{var i;const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const v=(i=e.external.registry.get(p[0]))==null?void 0:i.id,b=e.external.uri??(w=>w);if(v)return{ref:b(v)};const m=p[1].defId??p[1].schema.id??`schema${e.counter++}`;return p[1].defId=m,{defId:m,ref:`${b("__shared")}#/${d}/${m}`}}if(p[1]===n)return{ref:"#"};const c=`#/${d}/`,u=p[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:c+u}},s=p=>{if(p[1].schema.$ref)return;const d=p[1],{ref:f,defId:c}=r(p);d.def={...d.schema},c&&(d.defId=c);const u=d.schema;for(const i in u)delete u[i];u.$ref=f};if(e.cycles==="throw")for(const p of e.seen.entries()){const d=p[1];if(d.cycle)throw new Error(`Cycle detected: #/${(l=d.cycle)==null?void 0:l.join("/")}/<root>
45
+
46
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const p of e.seen.entries()){const d=p[1];if(t===p[0]){s(p);continue}if(e.external){const c=(h=e.external.registry.get(p[0]))==null?void 0:h.id;if(t!==p[0]&&c){s(p);continue}}if((g=e.metadataRegistry.get(p[0]))==null?void 0:g.id){s(p);continue}if(d.cycle){s(p);continue}if(d.count>1&&e.reused==="ref"){s(p);continue}}}function el(e,t){var o,l,h;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=g=>{const p=e.seen.get(g);if(p.ref===null)return;const d=p.def??p.schema,f={...d},c=p.ref;if(p.ref=null,c){a(c);const i=e.seen.get(c),v=i.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(v)):Object.assign(d,v),Object.assign(d,f),g._zod.parent===c)for(const m in d)m==="$ref"||m==="allOf"||m in f||delete d[m];if(v.$ref&&i.def)for(const m in d)m==="$ref"||m==="allOf"||m in i.def&&JSON.stringify(d[m])===JSON.stringify(i.def[m])&&delete d[m]}const u=g._zod.parent;if(u&&u!==c){a(u);const i=e.seen.get(u);if(i!=null&&i.schema.$ref&&(d.$ref=i.schema.$ref,i.def))for(const v in d)v==="$ref"||v==="allOf"||v in i.def&&JSON.stringify(d[v])===JSON.stringify(i.def[v])&&delete d[v]}e.override({zodSchema:g,jsonSchema:d,path:p.path??[]})};for(const g of[...e.seen.entries()].reverse())a(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,(o=e.external)!=null&&o.uri){const g=(l=e.external.registry.get(t))==null?void 0:l.id;if(!g)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(g)}Object.assign(r,n.def??n.schema);const s=((h=e.external)==null?void 0:h.defs)??{};for(const g of e.seen.entries()){const p=g[1];p.def&&p.defId&&(s[p.defId]=p.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?r.$defs=s:r.definitions=s);try{const g=JSON.parse(JSON.stringify(r));return Object.defineProperty(g,"~standard",{value:{...t["~standard"],jsonSchema:{input:cr(t,"input",e.processors),output:cr(t,"output",e.processors)}},enumerable:!1,writable:!1}),g}catch{throw new Error("Error converting schema to JSON.")}}function Ye(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return Ye(a.element,n);if(a.type==="set")return Ye(a.valueType,n);if(a.type==="lazy")return Ye(a.getter(),n);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return Ye(a.innerType,n);if(a.type==="intersection")return Ye(a.left,n)||Ye(a.right,n);if(a.type==="record"||a.type==="map")return Ye(a.keyType,n)||Ye(a.valueType,n);if(a.type==="pipe")return Ye(a.in,n)||Ye(a.out,n);if(a.type==="object"){for(const r in a.shape)if(Ye(a.shape[r],n))return!0;return!1}if(a.type==="union"){for(const r of a.options)if(Ye(r,n))return!0;return!1}if(a.type==="tuple"){for(const r of a.items)if(Ye(r,n))return!0;return!!(a.rest&&Ye(a.rest,n))}return!1}const k1=(e,t={})=>n=>{const a=Jc({...n,processors:t});return Oe(e,a),Qc(a,e),el(a,e)},cr=(e,t,n={})=>a=>{const{libraryOptions:r,target:s}=a??{},o=Jc({...r??{},target:s,io:t,processors:n});return Oe(e,o),Qc(o,e),el(o,e)},x1={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},C1=(e,t,n,a)=>{const r=n;r.type="string";const{minimum:s,maximum:o,format:l,patterns:h,contentEncoding:g}=e._zod.bag;if(typeof s=="number"&&(r.minLength=s),typeof o=="number"&&(r.maxLength=o),l&&(r.format=x1[l]??l,r.format===""&&delete r.format,l==="time"&&delete r.format),g&&(r.contentEncoding=g),h&&h.size>0){const p=[...h];p.length===1?r.pattern=p[0].source:p.length>1&&(r.allOf=[...p.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},S1=(e,t,n,a)=>{const r=n,{minimum:s,maximum:o,format:l,multipleOf:h,exclusiveMaximum:g,exclusiveMinimum:p}=e._zod.bag;typeof l=="string"&&l.includes("int")?r.type="integer":r.type="number",typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.minimum=p,r.exclusiveMinimum=!0):r.exclusiveMinimum=p),typeof s=="number"&&(r.minimum=s,typeof p=="number"&&t.target!=="draft-04"&&(p>=s?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 o=="number"&&(r.maximum=o,typeof g=="number"&&t.target!=="draft-04"&&(g<=o?delete r.maximum:delete r.exclusiveMaximum)),typeof h=="number"&&(r.multipleOf=h)},T1=(e,t,n,a)=>{n.type="boolean"},E1=(e,t,n,a)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},A1=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},M1=(e,t,n,a)=>{n.not={}},I1=(e,t,n,a)=>{},N1=(e,t,n,a)=>{const r=e._zod.def,s=Ic(r.entries);s.every(o=>typeof o=="number")&&(n.type="number"),s.every(o=>typeof o=="string")&&(n.type="string"),n.enum=s},P1=(e,t,n,a)=>{const r=e._zod.def,s=[];for(const o of r.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(o))}else s.push(o);if(s.length!==0)if(s.length===1){const o=s[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else s.every(o=>typeof o=="number")&&(n.type="number"),s.every(o=>typeof o=="string")&&(n.type="string"),s.every(o=>typeof o=="boolean")&&(n.type="boolean"),s.every(o=>o===null)&&(n.type="null"),n.enum=s},z1=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},R1=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},q1=(e,t,n,a)=>{const r=n,s=e._zod.def,{minimum:o,maximum:l}=e._zod.bag;typeof o=="number"&&(r.minItems=o),typeof l=="number"&&(r.maxItems=l),r.type="array",r.items=Oe(s.element,t,{...a,path:[...a.path,"items"]})},B1=(e,t,n,a)=>{var g;const r=n,s=e._zod.def;r.type="object",r.properties={};const o=s.shape;for(const p in o)r.properties[p]=Oe(o[p],t,{...a,path:[...a.path,"properties",p]});const l=new Set(Object.keys(o)),h=new Set([...l].filter(p=>{const d=s.shape[p]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));h.size>0&&(r.required=Array.from(h)),((g=s.catchall)==null?void 0:g._zod.def.type)==="never"?r.additionalProperties=!1:s.catchall?s.catchall&&(r.additionalProperties=Oe(s.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},L1=(e,t,n,a)=>{const r=e._zod.def,s=r.inclusive===!1,o=r.options.map((l,h)=>Oe(l,t,{...a,path:[...a.path,s?"oneOf":"anyOf",h]}));s?n.oneOf=o:n.anyOf=o},O1=(e,t,n,a)=>{const r=e._zod.def,s=Oe(r.left,t,{...a,path:[...a.path,"allOf",0]}),o=Oe(r.right,t,{...a,path:[...a.path,"allOf",1]}),l=g=>"allOf"in g&&Object.keys(g).length===1,h=[...l(s)?s.allOf:[s],...l(o)?o.allOf:[o]];n.allOf=h},D1=(e,t,n,a)=>{const r=n,s=e._zod.def;r.type="object";const o=s.keyType,l=o._zod.bag,h=l==null?void 0:l.patterns;if(s.mode==="loose"&&h&&h.size>0){const p=Oe(s.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});r.patternProperties={};for(const d of h)r.patternProperties[d.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(r.propertyNames=Oe(s.keyType,t,{...a,path:[...a.path,"propertyNames"]})),r.additionalProperties=Oe(s.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const g=o._zod.values;if(g){const p=[...g].filter(d=>typeof d=="string"||typeof d=="number");p.length>0&&(r.required=p)}},F1=(e,t,n,a)=>{const r=e._zod.def,s=Oe(r.innerType,t,a),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=r.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},H1=(e,t,n,a)=>{const r=e._zod.def;Oe(r.innerType,t,a);const s=t.seen.get(e);s.ref=r.innerType},$1=(e,t,n,a)=>{const r=e._zod.def;Oe(r.innerType,t,a);const s=t.seen.get(e);s.ref=r.innerType,n.default=JSON.parse(JSON.stringify(r.defaultValue))},G1=(e,t,n,a)=>{const r=e._zod.def;Oe(r.innerType,t,a);const s=t.seen.get(e);s.ref=r.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},Z1=(e,t,n,a)=>{const r=e._zod.def;Oe(r.innerType,t,a);const s=t.seen.get(e);s.ref=r.innerType;let o;try{o=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},j1=(e,t,n,a)=>{const r=e._zod.def,s=t.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;Oe(s,t,a);const o=t.seen.get(e);o.ref=s},U1=(e,t,n,a)=>{const r=e._zod.def;Oe(r.innerType,t,a);const s=t.seen.get(e);s.ref=r.innerType,n.readOnly=!0},tl=(e,t,n,a)=>{const r=e._zod.def;Oe(r.innerType,t,a);const s=t.seen.get(e);s.ref=r.innerType};function Ea(e){return!!e._zod}function rl(e,t){return Ea(e)?Bc(e,t):e.safeParse(t)}function Y1(e){var n,a;if(!e)return;let t;if(Ea(e)?t=(a=(n=e._zod)==null?void 0:n.def)==null?void 0:a.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function W1(e){var r;if(Ea(e)){const o=(r=e._zod)==null?void 0:r.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const n=e._def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}const a=e.value;if(a!==void 0)return a}const V1=K("ZodISODateTime",(e,t)=>{Fh.init(e,t),Re.init(e,t)});function nl(e){return Vf(V1,e)}const X1=K("ZodISODate",(e,t)=>{Hh.init(e,t),Re.init(e,t)});function K1(e){return Xf(X1,e)}const J1=K("ZodISOTime",(e,t)=>{$h.init(e,t),Re.init(e,t)});function Q1(e){return Kf(J1,e)}const ed=K("ZodISODuration",(e,t)=>{Gh.init(e,t),Re.init(e,t)});function td(e){return Jf(ed,e)}const rd=(e,t)=>{Rc.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Pu(e,n)},flatten:{value:n=>Nu(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,va,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,va,2)}},isEmpty:{get(){return e.issues.length===0}}})},et=K("ZodError",rd,{Parent:Error}),nd=Ca(et),ad=Sa(et),id=fr(et),sd=dr(et),od=Ru(et),cd=qu(et),ld=Bu(et),ud=Lu(et),hd=Ou(et),fd=Du(et),dd=Fu(et),pd=Hu(et),Ne=K("ZodType",(e,t)=>(Ie.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:cr(e,"input"),output:cr(e,"output")}}),e.toJSONSchema=k1(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(pt(t,{checks:[...t.checks??[],...n.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(n,a)=>gt(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>nd(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>id(e,n,a),e.parseAsync=async(n,a)=>ad(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>sd(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>od(e,n,a),e.decode=(n,a)=>cd(e,n,a),e.encodeAsync=async(n,a)=>ld(e,n,a),e.decodeAsync=async(n,a)=>ud(e,n,a),e.safeEncode=(n,a)=>hd(e,n,a),e.safeDecode=(n,a)=>fd(e,n,a),e.safeEncodeAsync=async(n,a)=>dd(e,n,a),e.safeDecodeAsync=async(n,a)=>pd(e,n,a),e.refine=(n,a)=>e.check(sp(n,a)),e.superRefine=n=>e.check(op(n)),e.overwrite=n=>e.check(Rt(n)),e.optional=()=>Le(e),e.exactOptional=()=>Yd(e),e.nullable=()=>Pi(e),e.nullish=()=>Le(Pi(e)),e.nonoptional=n=>Qd(e,n),e.array=()=>fe(e),e.or=n=>we([e,n]),e.and=n=>Aa(e,n),e.transform=n=>wa(e,ul(n)),e.default=n=>Xd(e,n),e.prefault=n=>Jd(e,n),e.catch=n=>tp(e,n),e.pipe=n=>wa(e,n),e.readonly=()=>ap(e),e.describe=n=>{const a=e.clone();return Ot.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){var n;return(n=Ot.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Ot.get(e);const a=e.clone();return Ot.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),al=K("_ZodString",(e,t)=>{Ta.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,r,s)=>C1(e,a,r);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...a)=>e.check(s1(...a)),e.includes=(...a)=>e.check(l1(...a)),e.startsWith=(...a)=>e.check(u1(...a)),e.endsWith=(...a)=>e.check(h1(...a)),e.min=(...a)=>e.check(or(...a)),e.max=(...a)=>e.check(Xc(...a)),e.length=(...a)=>e.check(Kc(...a)),e.nonempty=(...a)=>e.check(or(1,...a)),e.lowercase=a=>e.check(o1(a)),e.uppercase=a=>e.check(c1(a)),e.trim=()=>e.check(d1()),e.normalize=(...a)=>e.check(f1(...a)),e.toLowerCase=()=>e.check(p1()),e.toUpperCase=()=>e.check(g1()),e.slugify=()=>e.check(v1())}),gd=K("ZodString",(e,t)=>{Ta.init(e,t),al.init(e,t),e.email=n=>e.check(Af(vd,n)),e.url=n=>e.check(zf(md,n)),e.jwt=n=>e.check(Wf(Pd,n)),e.emoji=n=>e.check(Rf(bd,n)),e.guid=n=>e.check(Ti(Ii,n)),e.uuid=n=>e.check(Mf(tr,n)),e.uuidv4=n=>e.check(If(tr,n)),e.uuidv6=n=>e.check(Nf(tr,n)),e.uuidv7=n=>e.check(Pf(tr,n)),e.nanoid=n=>e.check(qf(yd,n)),e.guid=n=>e.check(Ti(Ii,n)),e.cuid=n=>e.check(Bf(wd,n)),e.cuid2=n=>e.check(Lf(_d,n)),e.ulid=n=>e.check(Of(kd,n)),e.base64=n=>e.check(jf(Md,n)),e.base64url=n=>e.check(Uf(Id,n)),e.xid=n=>e.check(Df(xd,n)),e.ksuid=n=>e.check(Ff(Cd,n)),e.ipv4=n=>e.check(Hf(Sd,n)),e.ipv6=n=>e.check($f(Td,n)),e.cidrv4=n=>e.check(Gf(Ed,n)),e.cidrv6=n=>e.check(Zf(Ad,n)),e.e164=n=>e.check(Yf(Nd,n)),e.datetime=n=>e.check(nl(n)),e.date=n=>e.check(K1(n)),e.time=n=>e.check(Q1(n)),e.duration=n=>e.check(td(n))});function j(e){return Ef(gd,e)}const Re=K("ZodStringFormat",(e,t)=>{Pe.init(e,t),al.init(e,t)}),vd=K("ZodEmail",(e,t)=>{Nh.init(e,t),Re.init(e,t)}),Ii=K("ZodGUID",(e,t)=>{Mh.init(e,t),Re.init(e,t)}),tr=K("ZodUUID",(e,t)=>{Ih.init(e,t),Re.init(e,t)}),md=K("ZodURL",(e,t)=>{Ph.init(e,t),Re.init(e,t)}),bd=K("ZodEmoji",(e,t)=>{zh.init(e,t),Re.init(e,t)}),yd=K("ZodNanoID",(e,t)=>{Rh.init(e,t),Re.init(e,t)}),wd=K("ZodCUID",(e,t)=>{qh.init(e,t),Re.init(e,t)}),_d=K("ZodCUID2",(e,t)=>{Bh.init(e,t),Re.init(e,t)}),kd=K("ZodULID",(e,t)=>{Lh.init(e,t),Re.init(e,t)}),xd=K("ZodXID",(e,t)=>{Oh.init(e,t),Re.init(e,t)}),Cd=K("ZodKSUID",(e,t)=>{Dh.init(e,t),Re.init(e,t)}),Sd=K("ZodIPv4",(e,t)=>{Zh.init(e,t),Re.init(e,t)}),Td=K("ZodIPv6",(e,t)=>{jh.init(e,t),Re.init(e,t)}),Ed=K("ZodCIDRv4",(e,t)=>{Uh.init(e,t),Re.init(e,t)}),Ad=K("ZodCIDRv6",(e,t)=>{Yh.init(e,t),Re.init(e,t)}),Md=K("ZodBase64",(e,t)=>{Wh.init(e,t),Re.init(e,t)}),Id=K("ZodBase64URL",(e,t)=>{Xh.init(e,t),Re.init(e,t)}),Nd=K("ZodE164",(e,t)=>{Kh.init(e,t),Re.init(e,t)}),Pd=K("ZodJWT",(e,t)=>{Qh.init(e,t),Re.init(e,t)}),il=K("ZodNumber",(e,t)=>{jc.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,r,s)=>S1(e,a,r),e.gt=(a,r)=>e.check(Ai(a,r)),e.gte=(a,r)=>e.check(Sr(a,r)),e.min=(a,r)=>e.check(Sr(a,r)),e.lt=(a,r)=>e.check(Ei(a,r)),e.lte=(a,r)=>e.check(Cr(a,r)),e.max=(a,r)=>e.check(Cr(a,r)),e.int=a=>e.check(Ni(a)),e.safe=a=>e.check(Ni(a)),e.positive=a=>e.check(Ai(0,a)),e.nonnegative=a=>e.check(Sr(0,a)),e.negative=a=>e.check(Ei(0,a)),e.nonpositive=a=>e.check(Cr(0,a)),e.multipleOf=(a,r)=>e.check(Mi(a,r)),e.step=(a,r)=>e.check(Mi(a,r)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function me(e){return Qf(il,e)}const zd=K("ZodNumberFormat",(e,t)=>{ef.init(e,t),il.init(e,t)});function Ni(e){return e1(zd,e)}const Rd=K("ZodBoolean",(e,t)=>{tf.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,a,r)=>T1(e,n,a)});function Me(e){return t1(Rd,e)}const qd=K("ZodUndefined",(e,t)=>{rf.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,a,r)=>A1(e,n)});function ba(e){return r1(qd,e)}const Bd=K("ZodNull",(e,t)=>{nf.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,a,r)=>E1(e,n,a)});function sl(e){return n1(Bd,e)}const Ld=K("ZodUnknown",(e,t)=>{af.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,a,r)=>I1()});function Ee(){return a1(Ld)}const Od=K("ZodNever",(e,t)=>{sf.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,a,r)=>M1(e,n,a)});function Dd(e){return i1(Od,e)}const Fd=K("ZodArray",(e,t)=>{of.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,a,r)=>q1(e,n,a,r),e.element=t.element,e.min=(n,a)=>e.check(or(n,a)),e.nonempty=n=>e.check(or(1,n)),e.max=(n,a)=>e.check(Xc(n,a)),e.length=(n,a)=>e.check(Kc(n,a)),e.unwrap=()=>e.element});function fe(e,t){return m1(Fd,e,t)}const ol=K("ZodObject",(e,t)=>{lf.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,a,r)=>B1(e,n,a,r),xe(e,"shape",()=>t.shape),e.keyof=()=>Je(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ee()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ee()}),e.strict=()=>e.clone({...e._zod.def,catchall:Dd()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>Tu(e,n),e.safeExtend=n=>Eu(e,n),e.merge=n=>Au(e,n),e.pick=n=>Cu(e,n),e.omit=n=>Su(e,n),e.partial=(...n)=>Mu(hl,e,n[0]),e.required=(...n)=>Iu(fl,e,n[0])});function Y(e,t){const n={type:"object",shape:e??{},...le(t)};return new ol(n)}function We(e,t){return new ol({type:"object",shape:e,catchall:Ee(),...le(t)})}const cl=K("ZodUnion",(e,t)=>{Wc.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,a,r)=>L1(e,n,a,r),e.options=t.options});function we(e,t){return new cl({type:"union",options:e,...le(t)})}const Hd=K("ZodDiscriminatedUnion",(e,t)=>{cl.init(e,t),uf.init(e,t)});function ll(e,t,n){return new Hd({type:"union",options:t,discriminator:e,...le(n)})}const $d=K("ZodIntersection",(e,t)=>{hf.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,a,r)=>O1(e,n,a,r)});function Aa(e,t){return new $d({type:"intersection",left:e,right:t})}const Gd=K("ZodRecord",(e,t)=>{ff.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,a,r)=>D1(e,n,a,r),e.keyType=t.keyType,e.valueType=t.valueType});function Se(e,t,n){return new Gd({type:"record",keyType:e,valueType:t,...le(n)})}const ya=K("ZodEnum",(e,t)=>{df.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(a,r,s)=>N1(e,a,r),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(a,r)=>{const s={};for(const o of a)if(n.has(o))s[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new ya({...t,checks:[],...le(r),entries:s})},e.exclude=(a,r)=>{const s={...t.entries};for(const o of a)if(n.has(o))delete s[o];else throw new Error(`Key ${o} not found in enum`);return new ya({...t,checks:[],...le(r),entries:s})}});function Je(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new ya({type:"enum",entries:n,...le(t)})}const Zd=K("ZodLiteral",(e,t)=>{pf.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,a,r)=>P1(e,n,a),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 Z(e,t){return new Zd({type:"literal",values:Array.isArray(e)?e:[e],...le(t)})}const jd=K("ZodTransform",(e,t)=>{gf.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,a,r)=>R1(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new Ac(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Ft(s,n.value,t));else{const o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(Ft(o))}};const r=t.transform(n.value,n);return r instanceof Promise?r.then(s=>(n.value=s,n)):(n.value=r,n)}});function ul(e){return new jd({type:"transform",transform:e})}const hl=K("ZodOptional",(e,t)=>{Vc.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,a,r)=>tl(e,n,a,r),e.unwrap=()=>e._zod.def.innerType});function Le(e){return new hl({type:"optional",innerType:e})}const Ud=K("ZodExactOptional",(e,t)=>{vf.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,a,r)=>tl(e,n,a,r),e.unwrap=()=>e._zod.def.innerType});function Yd(e){return new Ud({type:"optional",innerType:e})}const Wd=K("ZodNullable",(e,t)=>{mf.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,a,r)=>F1(e,n,a,r),e.unwrap=()=>e._zod.def.innerType});function Pi(e){return new Wd({type:"nullable",innerType:e})}const Vd=K("ZodDefault",(e,t)=>{bf.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,a,r)=>$1(e,n,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Xd(e,t){return new Vd({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Pc(t)}})}const Kd=K("ZodPrefault",(e,t)=>{yf.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,a,r)=>G1(e,n,a,r),e.unwrap=()=>e._zod.def.innerType});function Jd(e,t){return new Kd({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Pc(t)}})}const fl=K("ZodNonOptional",(e,t)=>{wf.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,a,r)=>H1(e,n,a,r),e.unwrap=()=>e._zod.def.innerType});function Qd(e,t){return new fl({type:"nonoptional",innerType:e,...le(t)})}const ep=K("ZodCatch",(e,t)=>{_f.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,a,r)=>Z1(e,n,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function tp(e,t){return new ep({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const rp=K("ZodPipe",(e,t)=>{kf.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,a,r)=>j1(e,n,a,r),e.in=t.in,e.out=t.out});function wa(e,t){return new rp({type:"pipe",in:e,out:t})}const np=K("ZodReadonly",(e,t)=>{xf.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,a,r)=>U1(e,n,a,r),e.unwrap=()=>e._zod.def.innerType});function ap(e){return new np({type:"readonly",innerType:e})}const dl=K("ZodCustom",(e,t)=>{Cf.init(e,t),Ne.init(e,t),e._zod.processJSONSchema=(n,a,r)=>z1(e,n)});function ip(e,t){return b1(dl,e??(()=>!0),t)}function sp(e,t={}){return y1(dl,e,t)}function op(e){return w1(e)}function pl(e,t){return wa(ul(e),t)}const wt="io.modelcontextprotocol/related-task",gr="2.0",Fe=ip(e=>e!==null&&(typeof e=="object"||typeof e=="function")),gl=we([j(),me().int()]),vl=j();We({ttl:we([me(),sl()]).optional(),pollInterval:me().optional()});const cp=Y({ttl:me().optional()}),lp=Y({taskId:j()}),Ma=We({progressToken:gl.optional(),[wt]:lp.optional()}),Qe=Y({_meta:Ma.optional()}),Gt=Qe.extend({task:cp.optional()}),up=e=>Gt.safeParse(e).success,He=Y({method:j(),params:Qe.loose().optional()}),tt=Y({_meta:Ma.optional()}),rt=Y({method:j(),params:tt.loose().optional()}),$e=We({_meta:Ma.optional()}),Zt=we([j(),me().int()]),ml=Y({jsonrpc:Z(gr),id:Zt,...He.shape}).strict(),zi=e=>ml.safeParse(e).success,bl=Y({jsonrpc:Z(gr),...rt.shape}).strict(),hp=e=>bl.safeParse(e).success,Ia=Y({jsonrpc:Z(gr),id:Zt,result:$e}).strict(),rr=e=>Ia.safeParse(e).success;var Ce;(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"})(Ce||(Ce={}));const Na=Y({jsonrpc:Z(gr),id:Zt.optional(),error:Y({code:me().int(),message:j(),data:Ee().optional()})}).strict(),fp=e=>Na.safeParse(e).success,dp=we([ml,bl,Ia,Na]);we([Ia,Na]);const Pa=$e.strict(),pp=tt.extend({requestId:Zt.optional(),reason:j().optional()}),za=rt.extend({method:Z("notifications/cancelled"),params:pp}),gp=Y({src:j(),mimeType:j().optional(),sizes:fe(j()).optional(),theme:Je(["light","dark"]).optional()}),jt=Y({icons:fe(gp).optional()}),zt=Y({name:j(),title:j().optional()}),vr=zt.extend({...zt.shape,...jt.shape,version:j(),websiteUrl:j().optional(),description:j().optional()}),vp=Aa(Y({applyDefaults:Me().optional()}),Se(j(),Ee())),mp=pl(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Aa(Y({form:vp.optional(),url:Fe.optional()}),Se(j(),Ee()).optional())),bp=We({list:Fe.optional(),cancel:Fe.optional(),requests:We({sampling:We({createMessage:Fe.optional()}).optional(),elicitation:We({create:Fe.optional()}).optional()}).optional()}),yp=We({list:Fe.optional(),cancel:Fe.optional(),requests:We({tools:We({call:Fe.optional()}).optional()}).optional()}),wp=Y({experimental:Se(j(),Fe).optional(),sampling:Y({context:Fe.optional(),tools:Fe.optional()}).optional(),elicitation:mp.optional(),roots:Y({listChanged:Me().optional()}).optional(),tasks:bp.optional()}),_p=Qe.extend({protocolVersion:j(),capabilities:wp,clientInfo:vr}),kp=He.extend({method:Z("initialize"),params:_p}),xp=Y({experimental:Se(j(),Fe).optional(),logging:Fe.optional(),completions:Fe.optional(),prompts:Y({listChanged:Me().optional()}).optional(),resources:Y({subscribe:Me().optional(),listChanged:Me().optional()}).optional(),tools:Y({listChanged:Me().optional()}).optional(),tasks:yp.optional()}),Cp=$e.extend({protocolVersion:j(),capabilities:xp,serverInfo:vr,instructions:j().optional()}),Sp=rt.extend({method:Z("notifications/initialized"),params:tt.optional()}),mr=He.extend({method:Z("ping"),params:Qe.optional()}),Tp=Y({progress:me(),total:Le(me()),message:Le(j())}),Ep=Y({...tt.shape,...Tp.shape,progressToken:gl}),Ra=rt.extend({method:Z("notifications/progress"),params:Ep}),Ap=Qe.extend({cursor:vl.optional()}),Ut=He.extend({params:Ap.optional()}),Yt=$e.extend({nextCursor:vl.optional()}),Mp=Je(["working","input_required","completed","failed","cancelled"]),Wt=Y({taskId:j(),status:Mp,ttl:we([me(),sl()]),createdAt:j(),lastUpdatedAt:j(),pollInterval:Le(me()),statusMessage:Le(j())}),qa=$e.extend({task:Wt}),Ip=tt.merge(Wt),lr=rt.extend({method:Z("notifications/tasks/status"),params:Ip}),Ba=He.extend({method:Z("tasks/get"),params:Qe.extend({taskId:j()})}),La=$e.merge(Wt),Oa=He.extend({method:Z("tasks/result"),params:Qe.extend({taskId:j()})});$e.loose();const Da=Ut.extend({method:Z("tasks/list")}),Fa=Yt.extend({tasks:fe(Wt)}),Ha=He.extend({method:Z("tasks/cancel"),params:Qe.extend({taskId:j()})}),Np=$e.merge(Wt),yl=Y({uri:j(),mimeType:Le(j()),_meta:Se(j(),Ee()).optional()}),wl=yl.extend({text:j()}),$a=j().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),_l=yl.extend({blob:$a}),Vt=Je(["user","assistant"]),qt=Y({audience:fe(Vt).optional(),priority:me().min(0).max(1).optional(),lastModified:nl({offset:!0}).optional()}),kl=Y({...zt.shape,...jt.shape,uri:j(),description:Le(j()),mimeType:Le(j()),annotations:qt.optional(),_meta:Le(We({}))}),Pp=Y({...zt.shape,...jt.shape,uriTemplate:j(),description:Le(j()),mimeType:Le(j()),annotations:qt.optional(),_meta:Le(We({}))}),zp=Ut.extend({method:Z("resources/list")}),xl=Yt.extend({resources:fe(kl)}),Rp=Ut.extend({method:Z("resources/templates/list")}),qp=Yt.extend({resourceTemplates:fe(Pp)}),Ga=Qe.extend({uri:j()}),Bp=Ga,Lp=He.extend({method:Z("resources/read"),params:Bp}),Cl=$e.extend({contents:fe(we([wl,_l]))}),Op=rt.extend({method:Z("notifications/resources/list_changed"),params:tt.optional()}),Dp=Ga,Fp=He.extend({method:Z("resources/subscribe"),params:Dp}),Hp=Ga,$p=He.extend({method:Z("resources/unsubscribe"),params:Hp}),Gp=tt.extend({uri:j()}),Zp=rt.extend({method:Z("notifications/resources/updated"),params:Gp}),jp=Y({name:j(),description:Le(j()),required:Le(Me())}),Up=Y({...zt.shape,...jt.shape,description:Le(j()),arguments:Le(fe(jp)),_meta:Le(We({}))}),Yp=Ut.extend({method:Z("prompts/list")}),Wp=Yt.extend({prompts:fe(Up)}),Vp=Qe.extend({name:j(),arguments:Se(j(),j()).optional()}),Xp=He.extend({method:Z("prompts/get"),params:Vp}),Za=Y({type:Z("text"),text:j(),annotations:qt.optional(),_meta:Se(j(),Ee()).optional()}),ja=Y({type:Z("image"),data:$a,mimeType:j(),annotations:qt.optional(),_meta:Se(j(),Ee()).optional()}),Ua=Y({type:Z("audio"),data:$a,mimeType:j(),annotations:qt.optional(),_meta:Se(j(),Ee()).optional()}),Kp=Y({type:Z("tool_use"),name:j(),id:j(),input:Se(j(),Ee()),_meta:Se(j(),Ee()).optional()}),Sl=Y({type:Z("resource"),resource:we([wl,_l]),annotations:qt.optional(),_meta:Se(j(),Ee()).optional()}),Tl=kl.extend({type:Z("resource_link")}),Xt=we([Za,ja,Ua,Tl,Sl]),Jp=Y({role:Vt,content:Xt}),Qp=$e.extend({description:j().optional(),messages:fe(Jp)}),e2=rt.extend({method:Z("notifications/prompts/list_changed"),params:tt.optional()}),t2=Y({title:j().optional(),readOnlyHint:Me().optional(),destructiveHint:Me().optional(),idempotentHint:Me().optional(),openWorldHint:Me().optional()}),r2=Y({taskSupport:Je(["required","optional","forbidden"]).optional()}),Ya=Y({...zt.shape,...jt.shape,description:j().optional(),inputSchema:Y({type:Z("object"),properties:Se(j(),Fe).optional(),required:fe(j()).optional()}).catchall(Ee()),outputSchema:Y({type:Z("object"),properties:Se(j(),Fe).optional(),required:fe(j()).optional()}).catchall(Ee()).optional(),annotations:t2.optional(),execution:r2.optional(),_meta:Se(j(),Ee()).optional()}),El=Ut.extend({method:Z("tools/list")}),n2=Yt.extend({tools:fe(Ya)}),br=$e.extend({content:fe(Xt).default([]),structuredContent:Se(j(),Ee()).optional(),isError:Me().optional()});br.or($e.extend({toolResult:Ee()}));const a2=Gt.extend({name:j(),arguments:Se(j(),Ee()).optional()}),Al=He.extend({method:Z("tools/call"),params:a2}),i2=rt.extend({method:Z("notifications/tools/list_changed"),params:tt.optional()});Y({autoRefresh:Me().default(!0),debounceMs:me().int().nonnegative().default(300)});const Ml=Je(["debug","info","notice","warning","error","critical","alert","emergency"]),s2=Qe.extend({level:Ml}),o2=He.extend({method:Z("logging/setLevel"),params:s2}),c2=tt.extend({level:Ml,logger:j().optional(),data:Ee()}),l2=rt.extend({method:Z("notifications/message"),params:c2}),u2=Y({name:j().optional()}),h2=Y({hints:fe(u2).optional(),costPriority:me().min(0).max(1).optional(),speedPriority:me().min(0).max(1).optional(),intelligencePriority:me().min(0).max(1).optional()}),f2=Y({mode:Je(["auto","required","none"]).optional()}),d2=Y({type:Z("tool_result"),toolUseId:j().describe("The unique identifier for the corresponding tool call."),content:fe(Xt).default([]),structuredContent:Y({}).loose().optional(),isError:Me().optional(),_meta:Se(j(),Ee()).optional()}),p2=ll("type",[Za,ja,Ua]),ur=ll("type",[Za,ja,Ua,Kp,d2]),g2=Y({role:Vt,content:we([ur,fe(ur)]),_meta:Se(j(),Ee()).optional()}),v2=Gt.extend({messages:fe(g2),modelPreferences:h2.optional(),systemPrompt:j().optional(),includeContext:Je(["none","thisServer","allServers"]).optional(),temperature:me().optional(),maxTokens:me().int(),stopSequences:fe(j()).optional(),metadata:Fe.optional(),tools:fe(Ya).optional(),toolChoice:f2.optional()}),m2=He.extend({method:Z("sampling/createMessage"),params:v2}),b2=$e.extend({model:j(),stopReason:Le(Je(["endTurn","stopSequence","maxTokens"]).or(j())),role:Vt,content:p2}),y2=$e.extend({model:j(),stopReason:Le(Je(["endTurn","stopSequence","maxTokens","toolUse"]).or(j())),role:Vt,content:we([ur,fe(ur)])}),w2=Y({type:Z("boolean"),title:j().optional(),description:j().optional(),default:Me().optional()}),_2=Y({type:Z("string"),title:j().optional(),description:j().optional(),minLength:me().optional(),maxLength:me().optional(),format:Je(["email","uri","date","date-time"]).optional(),default:j().optional()}),k2=Y({type:Je(["number","integer"]),title:j().optional(),description:j().optional(),minimum:me().optional(),maximum:me().optional(),default:me().optional()}),x2=Y({type:Z("string"),title:j().optional(),description:j().optional(),enum:fe(j()),default:j().optional()}),C2=Y({type:Z("string"),title:j().optional(),description:j().optional(),oneOf:fe(Y({const:j(),title:j()})),default:j().optional()}),S2=Y({type:Z("string"),title:j().optional(),description:j().optional(),enum:fe(j()),enumNames:fe(j()).optional(),default:j().optional()}),T2=we([x2,C2]),E2=Y({type:Z("array"),title:j().optional(),description:j().optional(),minItems:me().optional(),maxItems:me().optional(),items:Y({type:Z("string"),enum:fe(j())}),default:fe(j()).optional()}),A2=Y({type:Z("array"),title:j().optional(),description:j().optional(),minItems:me().optional(),maxItems:me().optional(),items:Y({anyOf:fe(Y({const:j(),title:j()}))}),default:fe(j()).optional()}),M2=we([E2,A2]),I2=we([S2,T2,M2]),N2=we([I2,w2,_2,k2]),P2=Gt.extend({mode:Z("form").optional(),message:j(),requestedSchema:Y({type:Z("object"),properties:Se(j(),N2),required:fe(j()).optional()})}),z2=Gt.extend({mode:Z("url"),message:j(),elicitationId:j(),url:j().url()}),R2=we([P2,z2]),q2=He.extend({method:Z("elicitation/create"),params:R2}),B2=tt.extend({elicitationId:j()}),L2=rt.extend({method:Z("notifications/elicitation/complete"),params:B2}),O2=$e.extend({action:Je(["accept","decline","cancel"]),content:pl(e=>e===null?void 0:e,Se(j(),we([j(),me(),Me(),fe(j())])).optional())}),D2=Y({type:Z("ref/resource"),uri:j()}),F2=Y({type:Z("ref/prompt"),name:j()}),H2=Qe.extend({ref:we([F2,D2]),argument:Y({name:j(),value:j()}),context:Y({arguments:Se(j(),j()).optional()}).optional()}),$2=He.extend({method:Z("completion/complete"),params:H2}),G2=$e.extend({completion:We({values:fe(j()).max(100),total:Le(me().int()),hasMore:Le(Me())})}),Z2=Y({uri:j().startsWith("file://"),name:j().optional(),_meta:Se(j(),Ee()).optional()}),j2=He.extend({method:Z("roots/list"),params:Qe.optional()}),U2=$e.extend({roots:fe(Z2)}),Y2=rt.extend({method:Z("notifications/roots/list_changed"),params:tt.optional()});we([mr,kp,$2,o2,Xp,Yp,zp,Rp,Lp,Fp,$p,Al,El,Ba,Oa,Da,Ha]);we([za,Ra,Sp,Y2,lr]);we([Pa,b2,y2,O2,U2,La,Fa,qa]);we([mr,m2,q2,j2,Ba,Oa,Da,Ha]);we([za,Ra,l2,Zp,Op,i2,e2,lr,L2]);we([Pa,Cp,G2,Qp,Wp,xl,qp,Cl,br,n2,La,Fa,qa]);class ke extends Error{constructor(t,n,a){super(`MCP error ${t}: ${n}`),this.code=t,this.data=a,this.name="McpError"}static fromError(t,n,a){if(t===Ce.UrlElicitationRequired&&a){const r=a;if(r.elicitations)return new W2(r.elicitations,n)}return new ke(t,n,a)}}class W2 extends ke{constructor(t,n=`URL elicitation${t.length>1?"s":""} required`){super(Ce.UrlElicitationRequired,n,{elicitations:t})}get elicitations(){var t;return((t=this.data)==null?void 0:t.elicitations)??[]}}function yt(e){return e==="completed"||e==="failed"||e==="cancelled"}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Ri(e){const t=Y1(e),n=t==null?void 0:t.method;if(!n)throw new Error("Schema is missing a method literal");const a=W1(n);if(typeof a!="string")throw new Error("Schema method literal must be a string");return a}function qi(e,t){const n=rl(e,t);if(!n.success)throw n.error;return n.data}const V2=6e4;class X2{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(za,n=>{this._oncancel(n)}),this.setNotificationHandler(Ra,n=>{this._onprogress(n)}),this.setRequestHandler(mr,n=>({})),this._taskStore=t==null?void 0:t.taskStore,this._taskMessageQueue=t==null?void 0:t.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Ba,async(n,a)=>{const r=await this._taskStore.getTask(n.params.taskId,a.sessionId);if(!r)throw new ke(Ce.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(Oa,async(n,a)=>{const r=async()=>{var l;const s=n.params.taskId;if(this._taskMessageQueue){let h;for(;h=await this._taskMessageQueue.dequeue(s,a.sessionId);){if(h.type==="response"||h.type==="error"){const g=h.message,p=g.id,d=this._requestResolvers.get(p);if(d)if(this._requestResolvers.delete(p),h.type==="response")d(g);else{const f=g,c=new ke(f.error.code,f.error.message,f.error.data);d(c)}else{const f=h.type==="response"?"Response":"Error";this._onerror(new Error(`${f} handler missing for request ${p}`))}continue}await((l=this._transport)==null?void 0:l.send(h.message,{relatedRequestId:a.requestId}))}}const o=await this._taskStore.getTask(s,a.sessionId);if(!o)throw new ke(Ce.InvalidParams,`Task not found: ${s}`);if(!yt(o.status))return await this._waitForTaskUpdate(s,a.signal),await r();if(yt(o.status)){const h=await this._taskStore.getTaskResult(s,a.sessionId);return this._clearTaskQueue(s),{...h,_meta:{...h._meta,[wt]:{taskId:s}}}}return await r()};return await r()}),this.setRequestHandler(Da,async(n,a)=>{var r;try{const{tasks:s,nextCursor:o}=await this._taskStore.listTasks((r=n.params)==null?void 0:r.cursor,a.sessionId);return{tasks:s,nextCursor:o,_meta:{}}}catch(s){throw new ke(Ce.InvalidParams,`Failed to list tasks: ${s instanceof Error?s.message:String(s)}`)}}),this.setRequestHandler(Ha,async(n,a)=>{try{const r=await this._taskStore.getTask(n.params.taskId,a.sessionId);if(!r)throw new ke(Ce.InvalidParams,`Task not found: ${n.params.taskId}`);if(yt(r.status))throw new ke(Ce.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(n.params.taskId,"cancelled","Client cancelled task execution.",a.sessionId),this._clearTaskQueue(n.params.taskId);const s=await this._taskStore.getTask(n.params.taskId,a.sessionId);if(!s)throw new ke(Ce.InvalidParams,`Task not found after cancellation: ${n.params.taskId}`);return{_meta:{},...s}}catch(r){throw r instanceof ke?r:new ke(Ce.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;const n=this._requestHandlerAbortControllers.get(t.params.requestId);n==null||n.abort(t.params.reason)}_setupTimeout(t,n,a,r,s=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(r,n),startTime:Date.now(),timeout:n,maxTotalTimeout:a,resetTimeoutOnProgress:s,onTimeout:r})}_resetTimeout(t){const n=this._timeoutInfo.get(t);if(!n)return!1;const a=Date.now()-n.startTime;if(n.maxTotalTimeout&&a>=n.maxTotalTimeout)throw this._timeoutInfo.delete(t),ke.fromError(Ce.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:n.maxTotalTimeout,totalElapsed:a});return clearTimeout(n.timeoutId),n.timeoutId=setTimeout(n.onTimeout,n.timeout),!0}_cleanupTimeout(t){const n=this._timeoutInfo.get(t);n&&(clearTimeout(n.timeoutId),this._timeoutInfo.delete(t))}async connect(t){var s,o,l;if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=t;const n=(s=this.transport)==null?void 0:s.onclose;this._transport.onclose=()=>{n==null||n(),this._onclose()};const a=(o=this.transport)==null?void 0:o.onerror;this._transport.onerror=h=>{a==null||a(h),this._onerror(h)};const r=(l=this._transport)==null?void 0:l.onmessage;this._transport.onmessage=(h,g)=>{r==null||r(h,g),rr(h)||fp(h)?this._onresponse(h):zi(h)?this._onrequest(h,g):hp(h)?this._onnotification(h):this._onerror(new Error(`Unknown message type: ${JSON.stringify(h)}`))},await this._transport.start()}_onclose(){var a;const t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const r of this._requestHandlerAbortControllers.values())r.abort();this._requestHandlerAbortControllers.clear();const n=ke.fromError(Ce.ConnectionClosed,"Connection closed");this._transport=void 0,(a=this.onclose)==null||a.call(this);for(const r of t.values())r(n)}_onerror(t){var n;(n=this.onerror)==null||n.call(this,t)}_onnotification(t){const n=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;n!==void 0&&Promise.resolve().then(()=>n(t)).catch(a=>this._onerror(new Error(`Uncaught error in notification handler: ${a}`)))}_onrequest(t,n){var p,d,f,c;const a=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,r=this._transport,s=(f=(d=(p=t.params)==null?void 0:p._meta)==null?void 0:d[wt])==null?void 0:f.taskId;if(a===void 0){const u={jsonrpc:"2.0",id:t.id,error:{code:Ce.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:u,timestamp:Date.now()},r==null?void 0:r.sessionId).catch(i=>this._onerror(new Error(`Failed to enqueue error response: ${i}`))):r==null||r.send(u).catch(i=>this._onerror(new Error(`Failed to send an error response: ${i}`)));return}const o=new AbortController;this._requestHandlerAbortControllers.set(t.id,o);const l=up(t.params)?t.params.task:void 0,h=this._taskStore?this.requestTaskStore(t,r==null?void 0:r.sessionId):void 0,g={signal:o.signal,sessionId:r==null?void 0:r.sessionId,_meta:(c=t.params)==null?void 0:c._meta,sendNotification:async u=>{if(o.signal.aborted)return;const i={relatedRequestId:t.id};s&&(i.relatedTask={taskId:s}),await this.notification(u,i)},sendRequest:async(u,i,v)=>{var w;if(o.signal.aborted)throw new ke(Ce.ConnectionClosed,"Request was cancelled");const b={...v,relatedRequestId:t.id};s&&!b.relatedTask&&(b.relatedTask={taskId:s});const m=((w=b.relatedTask)==null?void 0:w.taskId)??s;return m&&h&&await h.updateTaskStatus(m,"input_required"),await this.request(u,i,b)},authInfo:n==null?void 0:n.authInfo,requestId:t.id,requestInfo:n==null?void 0:n.requestInfo,taskId:s,taskStore:h,taskRequestedTtl:l==null?void 0:l.ttl,closeSSEStream:n==null?void 0:n.closeSSEStream,closeStandaloneSSEStream:n==null?void 0:n.closeStandaloneSSEStream};Promise.resolve().then(()=>{l&&this.assertTaskHandlerCapability(t.method)}).then(()=>a(t,g)).then(async u=>{if(o.signal.aborted)return;const i={result:u,jsonrpc:"2.0",id:t.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:i,timestamp:Date.now()},r==null?void 0:r.sessionId):await(r==null?void 0:r.send(i))},async u=>{if(o.signal.aborted)return;const i={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(u.code)?u.code:Ce.InternalError,message:u.message??"Internal error",...u.data!==void 0&&{data:u.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:i,timestamp:Date.now()},r==null?void 0:r.sessionId):await(r==null?void 0:r.send(i))}).catch(u=>this._onerror(new Error(`Failed to send response: ${u}`))).finally(()=>{this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){const{progressToken:n,...a}=t.params,r=Number(n),s=this._progressHandlers.get(r);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}const o=this._responseHandlers.get(r),l=this._timeoutInfo.get(r);if(l&&o&&l.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(h){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),o(h);return}s(a)}_onresponse(t){const n=Number(t.id),a=this._requestResolvers.get(n);if(a){if(this._requestResolvers.delete(n),rr(t))a(t);else{const o=new ke(t.error.code,t.error.message,t.error.data);a(o)}return}const r=this._responseHandlers.get(n);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(n),this._cleanupTimeout(n);let s=!1;if(rr(t)&&t.result&&typeof t.result=="object"){const o=t.result;if(o.task&&typeof o.task=="object"){const l=o.task;typeof l.taskId=="string"&&(s=!0,this._taskProgressTokens.set(l.taskId,n))}}if(s||this._progressHandlers.delete(n),rr(t))r(t);else{const o=ke.fromError(t.error.code,t.error.message,t.error.data);r(o)}}get transport(){return this._transport}async close(){var t;await((t=this._transport)==null?void 0:t.close())}async*requestStream(t,n,a){var o,l;const{task:r}=a??{};if(!r){try{yield{type:"result",result:await this.request(t,n,a)}}catch(h){yield{type:"error",error:h instanceof ke?h:new ke(Ce.InternalError,String(h))}}return}let s;try{const h=await this.request(t,qa,a);if(h.task)s=h.task.taskId,yield{type:"taskCreated",task:h.task};else throw new ke(Ce.InternalError,"Task creation did not return a task");for(;;){const g=await this.getTask({taskId:s},a);if(yield{type:"taskStatus",task:g},yt(g.status)){g.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},n,a)}:g.status==="failed"?yield{type:"error",error:new ke(Ce.InternalError,`Task ${s} failed`)}:g.status==="cancelled"&&(yield{type:"error",error:new ke(Ce.InternalError,`Task ${s} was cancelled`)});return}if(g.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},n,a)};return}const p=g.pollInterval??((o=this._options)==null?void 0:o.defaultTaskPollInterval)??1e3;await new Promise(d=>setTimeout(d,p)),(l=a==null?void 0:a.signal)==null||l.throwIfAborted()}}catch(h){yield{type:"error",error:h instanceof ke?h:new ke(Ce.InternalError,String(h))}}}request(t,n,a){const{relatedRequestId:r,resumptionToken:s,onresumptiontoken:o,task:l,relatedTask:h}=a??{};return new Promise((g,p)=>{var m,w,_,T,q;const d=I=>{p(I)};if(!this._transport){d(new Error("Not connected"));return}if(((m=this._options)==null?void 0:m.enforceStrictCapabilities)===!0)try{this.assertCapabilityForMethod(t.method),l&&this.assertTaskCapability(t.method)}catch(I){d(I);return}(w=a==null?void 0:a.signal)==null||w.throwIfAborted();const f=this._requestMessageId++,c={...t,jsonrpc:"2.0",id:f};a!=null&&a.onprogress&&(this._progressHandlers.set(f,a.onprogress),c.params={...t.params,_meta:{...((_=t.params)==null?void 0:_._meta)||{},progressToken:f}}),l&&(c.params={...c.params,task:l}),h&&(c.params={...c.params,_meta:{...((T=c.params)==null?void 0:T._meta)||{},[wt]:h}});const u=I=>{var P;this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),(P=this._transport)==null||P.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(I)}},{relatedRequestId:r,resumptionToken:s,onresumptiontoken:o}).catch(x=>this._onerror(new Error(`Failed to send cancellation: ${x}`)));const E=I instanceof ke?I:new ke(Ce.RequestTimeout,String(I));p(E)};this._responseHandlers.set(f,I=>{var E;if(!((E=a==null?void 0:a.signal)!=null&&E.aborted)){if(I instanceof Error)return p(I);try{const P=rl(n,I.result);P.success?g(P.data):p(P.error)}catch(P){p(P)}}}),(q=a==null?void 0:a.signal)==null||q.addEventListener("abort",()=>{var I;u((I=a==null?void 0:a.signal)==null?void 0:I.reason)});const i=(a==null?void 0:a.timeout)??V2,v=()=>u(ke.fromError(Ce.RequestTimeout,"Request timed out",{timeout:i}));this._setupTimeout(f,i,a==null?void 0:a.maxTotalTimeout,v,(a==null?void 0:a.resetTimeoutOnProgress)??!1);const b=h==null?void 0:h.taskId;if(b){const I=E=>{const P=this._responseHandlers.get(f);P?P(E):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,I),this._enqueueTaskMessage(b,{type:"request",message:c,timestamp:Date.now()}).catch(E=>{this._cleanupTimeout(f),p(E)})}else this._transport.send(c,{relatedRequestId:r,resumptionToken:s,onresumptiontoken:o}).catch(I=>{this._cleanupTimeout(f),p(I)})})}async getTask(t,n){return this.request({method:"tasks/get",params:t},La,n)}async getTaskResult(t,n,a){return this.request({method:"tasks/result",params:t},n,a)}async listTasks(t,n){return this.request({method:"tasks/list",params:t},Fa,n)}async cancelTask(t,n){return this.request({method:"tasks/cancel",params:t},Np,n)}async notification(t,n){var l,h,g,p;if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);const a=(l=n==null?void 0:n.relatedTask)==null?void 0:l.taskId;if(a){const d={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...((h=t.params)==null?void 0:h._meta)||{},[wt]:n.relatedTask}}};await this._enqueueTaskMessage(a,{type:"notification",message:d,timestamp:Date.now()});return}if((((g=this._options)==null?void 0:g.debouncedNotificationMethods)??[]).includes(t.method)&&!t.params&&!(n!=null&&n.relatedRequestId)&&!(n!=null&&n.relatedTask)){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{var f,c;if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let d={...t,jsonrpc:"2.0"};n!=null&&n.relatedTask&&(d={...d,params:{...d.params,_meta:{...((f=d.params)==null?void 0:f._meta)||{},[wt]:n.relatedTask}}}),(c=this._transport)==null||c.send(d,n).catch(u=>this._onerror(u))});return}let o={...t,jsonrpc:"2.0"};n!=null&&n.relatedTask&&(o={...o,params:{...o.params,_meta:{...((p=o.params)==null?void 0:p._meta)||{},[wt]:n.relatedTask}}}),await this._transport.send(o,n)}setRequestHandler(t,n){const a=Ri(t);this.assertRequestHandlerCapability(a),this._requestHandlers.set(a,(r,s)=>{const o=qi(t,r);return Promise.resolve(n(o,s))})}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,n){const a=Ri(t);this._notificationHandlers.set(a,r=>{const s=qi(t,r);return Promise.resolve(n(s))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){const n=this._taskProgressTokens.get(t);n!==void 0&&(this._progressHandlers.delete(n),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,n,a){var s;if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=(s=this._options)==null?void 0:s.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,n,a,r)}async _clearTaskQueue(t,n){if(this._taskMessageQueue){const a=await this._taskMessageQueue.dequeueAll(t,n);for(const r of a)if(r.type==="request"&&zi(r.message)){const s=r.message.id,o=this._requestResolvers.get(s);o?(o(new ke(Ce.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(new Error(`Resolver missing for request ${s} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,n){var r,s;let a=((r=this._options)==null?void 0:r.defaultTaskPollInterval)??1e3;try{const o=await((s=this._taskStore)==null?void 0:s.getTask(t));o!=null&&o.pollInterval&&(a=o.pollInterval)}catch{}return new Promise((o,l)=>{if(n.aborted){l(new ke(Ce.InvalidRequest,"Request cancelled"));return}const h=setTimeout(o,a);n.addEventListener("abort",()=>{clearTimeout(h),l(new ke(Ce.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,n){const a=this._taskStore;if(!a)throw new Error("No task store configured");return{createTask:async r=>{if(!t)throw new Error("No request provided");return await a.createTask(r,t.id,{method:t.method,params:t.params},n)},getTask:async r=>{const s=await a.getTask(r,n);if(!s)throw new ke(Ce.InvalidParams,"Failed to retrieve task: Task not found");return s},storeTaskResult:async(r,s,o)=>{await a.storeTaskResult(r,s,o,n);const l=await a.getTask(r,n);if(l){const h=lr.parse({method:"notifications/tasks/status",params:l});await this.notification(h),yt(l.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>a.getTaskResult(r,n),updateTaskStatus:async(r,s,o)=>{const l=await a.getTask(r,n);if(!l)throw new ke(Ce.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(yt(l.status))throw new ke(Ce.InvalidParams,`Cannot update task "${r}" from terminal status "${l.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await a.updateTaskStatus(r,s,o,n);const h=await a.getTask(r,n);if(h){const g=lr.parse({method:"notifications/tasks/status",params:h});await this.notification(g),yt(h.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>a.listTasks(r,n)}}}var K2="2026-01-26",J2="ui/notifications/tool-input-partial";class Q2{constructor(t=window.parent,n){je(this,"eventTarget");je(this,"eventSource");je(this,"messageListener");je(this,"onclose");je(this,"onerror");je(this,"onmessage");je(this,"sessionId");je(this,"setProtocolVersion");this.eventTarget=t,this.eventSource=n,this.messageListener=a=>{var s,o,l;if(n&&a.source!==this.eventSource){console.debug("Ignoring message from unknown source",a);return}let r=dp.safeParse(a.data);r.success?(console.debug("Parsed message",r.data),(s=this.onmessage)==null||s.call(this,r.data)):((o=a.data)==null?void 0:o.jsonrpc)!=="2.0"?console.debug("Ignoring non-JSON-RPC message",r.error.message,a):(console.error("Failed to parse message",r.error.message,a),(l=this.onerror)==null||l.call(this,Error("Invalid JSON-RPC message received: "+r.error.message)))}}async start(){window.addEventListener("message",this.messageListener)}async send(t,n){t.method!==J2&&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 eg=we([Z("light"),Z("dark")]).describe("Color theme preference for the host environment."),Ht=we([Z("inline"),Z("fullscreen"),Z("pip")]).describe("Display mode for UI presentation."),tg=we([Z("--color-background-primary"),Z("--color-background-secondary"),Z("--color-background-tertiary"),Z("--color-background-inverse"),Z("--color-background-ghost"),Z("--color-background-info"),Z("--color-background-danger"),Z("--color-background-success"),Z("--color-background-warning"),Z("--color-background-disabled"),Z("--color-text-primary"),Z("--color-text-secondary"),Z("--color-text-tertiary"),Z("--color-text-inverse"),Z("--color-text-ghost"),Z("--color-text-info"),Z("--color-text-danger"),Z("--color-text-success"),Z("--color-text-warning"),Z("--color-text-disabled"),Z("--color-border-primary"),Z("--color-border-secondary"),Z("--color-border-tertiary"),Z("--color-border-inverse"),Z("--color-border-ghost"),Z("--color-border-info"),Z("--color-border-danger"),Z("--color-border-success"),Z("--color-border-warning"),Z("--color-border-disabled"),Z("--color-ring-primary"),Z("--color-ring-secondary"),Z("--color-ring-inverse"),Z("--color-ring-info"),Z("--color-ring-danger"),Z("--color-ring-success"),Z("--color-ring-warning"),Z("--font-sans"),Z("--font-mono"),Z("--font-weight-normal"),Z("--font-weight-medium"),Z("--font-weight-semibold"),Z("--font-weight-bold"),Z("--font-text-xs-size"),Z("--font-text-sm-size"),Z("--font-text-md-size"),Z("--font-text-lg-size"),Z("--font-heading-xs-size"),Z("--font-heading-sm-size"),Z("--font-heading-md-size"),Z("--font-heading-lg-size"),Z("--font-heading-xl-size"),Z("--font-heading-2xl-size"),Z("--font-heading-3xl-size"),Z("--font-text-xs-line-height"),Z("--font-text-sm-line-height"),Z("--font-text-md-line-height"),Z("--font-text-lg-line-height"),Z("--font-heading-xs-line-height"),Z("--font-heading-sm-line-height"),Z("--font-heading-md-line-height"),Z("--font-heading-lg-line-height"),Z("--font-heading-xl-line-height"),Z("--font-heading-2xl-line-height"),Z("--font-heading-3xl-line-height"),Z("--border-radius-xs"),Z("--border-radius-sm"),Z("--border-radius-md"),Z("--border-radius-lg"),Z("--border-radius-xl"),Z("--border-radius-full"),Z("--border-width-regular"),Z("--shadow-hairline"),Z("--shadow-sm"),Z("--shadow-md"),Z("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),rg=Se(tg.describe(`Style variables for theming MCP apps.
47
+
48
+ Individual style keys are optional - hosts may provide any subset of these values.
49
+ Values are strings containing CSS values (colors, sizes, font stacks, etc.).
50
+
51
+ Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
52
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),we([j(),ba()]).describe(`Style variables for theming MCP apps.
53
+
54
+ Individual style keys are optional - hosts may provide any subset of these values.
55
+ Values are strings containing CSS values (colors, sizes, font stacks, etc.).
56
+
57
+ Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
58
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.
59
+
60
+ Individual style keys are optional - hosts may provide any subset of these values.
61
+ Values are strings containing CSS values (colors, sizes, font stacks, etc.).
62
+
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.`);Y({method:Z("ui/open-link"),params:Y({url:j().describe("URL to open in the host's browser")})});var ng=Y({isError:Me().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),ag=Y({isError:Me().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),ig=Y({isError:Me().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough();Y({method:Z("ui/notifications/sandbox-proxy-ready"),params:Y({})});var Wa=Y({connectDomains:fe(j()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
65
+
66
+ - Maps to CSP \`connect-src\` directive
67
+ - Empty or omitted → no network connections (secure default)`),resourceDomains:fe(j()).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(j()).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(j()).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'`)")}),Va=Y({camera:Y({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:Y({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:Y({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:Y({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")});Y({method:Z("ui/notifications/size-changed"),params:Y({width:me().optional().describe("New width in pixels."),height:me().optional().describe("New height in pixels.")})});var sg=Y({method:Z("ui/notifications/tool-input"),params:Y({arguments:Se(j(),Ee().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),og=Y({method:Z("ui/notifications/tool-input-partial"),params:Y({arguments:Se(j(),Ee().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),cg=Y({method:Z("ui/notifications/tool-cancelled"),params:Y({reason:j().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),lg=Y({fonts:j().optional()}),ug=Y({variables:rg.optional().describe("CSS variables for theming the app."),css:lg.optional().describe("CSS blocks that apps can inject.")}),hg=Y({method:Z("ui/resource-teardown"),params:Y({})});Se(j(),Ee());var Bi=Y({text:Y({}).optional().describe("Host supports text content blocks."),image:Y({}).optional().describe("Host supports image content blocks."),audio:Y({}).optional().describe("Host supports audio content blocks."),resource:Y({}).optional().describe("Host supports resource content blocks."),resourceLink:Y({}).optional().describe("Host supports resource link content blocks."),structuredContent:Y({}).optional().describe("Host supports structured content.")}),fg=Y({experimental:Y({}).optional().describe("Experimental features (structure TBD)."),openLinks:Y({}).optional().describe("Host supports opening external URLs."),downloadFile:Y({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:Y({listChanged:Me().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:Y({listChanged:Me().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:Y({}).optional().describe("Host accepts log messages."),sandbox:Y({permissions:Va.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:Wa.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:Bi.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:Bi.optional().describe("Host supports receiving content messages (ui/message) from the view.")}),dg=Y({experimental:Y({}).optional().describe("Experimental features (structure TBD)."),tools:Y({listChanged:Me().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:fe(Ht).optional().describe("Display modes the app supports.")});Y({method:Z("ui/notifications/initialized"),params:Y({}).optional()});Y({csp:Wa.optional().describe("Content Security Policy configuration for UI resources."),permissions:Va.optional().describe("Sandbox permissions requested by the UI resource."),domain:j().optional().describe(`Dedicated origin for view sandbox.
68
+
69
+ Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
70
+
71
+ **Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include:
72
+ - Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
73
+ - URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
74
+
75
+ If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:Me().optional().describe(`Visual boundary preference - true if view prefers a visible border.
76
+
77
+ Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.
78
+
79
+ - \`true\`: request visible border + background
80
+ - \`false\`: request no visible border + background
81
+ - omitted: host decides border`)});Y({method:Z("ui/request-display-mode"),params:Y({mode:Ht.describe("The display mode being requested.")})});var pg=Y({mode:Ht.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),gg=we([Z("model"),Z("app")]).describe("Tool visibility scope - who can access the tool.");Y({resourceUri:j().optional(),visibility:fe(gg).optional().describe(`Who can access this tool. Default: ["model", "app"]
82
+ - "model": Tool visible to and callable by the agent
83
+ - "app": Tool callable by the app from this server only`)});Y({mimeTypes:fe(j()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});Y({method:Z("ui/download-file"),params:Y({contents:fe(we([Sl,Tl])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})});Y({method:Z("ui/message"),params:Y({role:Z("user").describe('Message role, currently only "user" is supported.'),content:fe(Xt).describe("Message content blocks (text, image, etc.).")})});Y({method:Z("ui/notifications/sandbox-resource-ready"),params:Y({html:j().describe("HTML content to load into the inner iframe."),sandbox:j().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:Wa.optional().describe("CSP configuration from resource metadata."),permissions:Va.optional().describe("Sandbox permissions from resource metadata.")})});var vg=Y({method:Z("ui/notifications/tool-result"),params:br.describe("Standard MCP tool execution result.")}),Il=Y({toolInfo:Y({id:Zt.optional().describe("JSON-RPC id of the tools/call request."),tool:Ya.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:eg.optional().describe("Current color theme preference."),styles:ug.optional().describe("Style configuration for theming the app."),displayMode:Ht.optional().describe("How the UI is currently displayed."),availableDisplayModes:fe(Ht).optional().describe("Display modes the host supports."),containerDimensions:we([Y({height:me().describe("Fixed container height in pixels.")}),Y({maxHeight:we([me(),ba()]).optional().describe("Maximum container height in pixels.")})]).and(we([Y({width:me().describe("Fixed container width in pixels.")}),Y({maxWidth:we([me(),ba()]).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:j().optional().describe("User's language and region preference in BCP 47 format."),timeZone:j().optional().describe("User's timezone in IANA format."),userAgent:j().optional().describe("Host application identifier."),platform:we([Z("web"),Z("desktop"),Z("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:Y({touch:Me().optional().describe("Whether the device supports touch input."),hover:Me().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(),mg=Y({method:Z("ui/notifications/host-context-changed"),params:Il.describe("Partial context update containing only changed fields.")});Y({method:Z("ui/update-model-context"),params:Y({content:fe(Xt).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:Se(j(),Ee().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})});Y({method:Z("ui/initialize"),params:Y({appInfo:vr.describe("App identification (name and version)."),appCapabilities:dg.describe("Features and capabilities this app provides."),protocolVersion:j().describe("Protocol version this app supports.")})});var bg=Y({protocolVersion:j().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:vr.describe("Host application identification and version."),hostCapabilities:fg.describe("Features and capabilities provided by the host."),hostContext:Il.describe("Rich context about the host environment.")}).passthrough();class yg extends X2{constructor(n,a={},r={autoResize:!0}){super(r);je(this,"_appInfo");je(this,"_capabilities");je(this,"options");je(this,"_hostCapabilities");je(this,"_hostInfo");je(this,"_hostContext");je(this,"sendOpenLink",this.openLink);this._appInfo=n,this._capabilities=a,this.options=r,this.setRequestHandler(mr,s=>(console.log("Received ping:",s.params),{})),this.onhostcontextchanged=()=>{}}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}set ontoolinput(n){this.setNotificationHandler(sg,a=>n(a.params))}set ontoolinputpartial(n){this.setNotificationHandler(og,a=>n(a.params))}set ontoolresult(n){this.setNotificationHandler(vg,a=>n(a.params))}set ontoolcancelled(n){this.setNotificationHandler(cg,a=>n(a.params))}set onhostcontextchanged(n){this.setNotificationHandler(mg,a=>{this._hostContext={...this._hostContext,...a.params},n(a.params)})}set onteardown(n){this.setRequestHandler(hg,(a,r)=>n(a.params,r))}set oncalltool(n){this.setRequestHandler(Al,(a,r)=>n(a.params,r))}set onlisttools(n){this.setRequestHandler(El,(a,r)=>n(a.params,r))}assertCapabilityForMethod(n){}assertRequestHandlerCapability(n){switch(n){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${n})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${n} registered`)}}assertNotificationCapability(n){}assertTaskCapability(n){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(n){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(n,a){if(typeof n=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${n}"). Did you mean: callServerTool({ name: "${n}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:n},br,a)}async readServerResource(n,a){return await this.request({method:"resources/read",params:n},Cl,a)}async listServerResources(n,a){return await this.request({method:"resources/list",params:n},xl,a)}sendMessage(n,a){return this.request({method:"ui/message",params:n},ig,a)}sendLog(n){return this.notification({method:"notifications/message",params:n})}updateModelContext(n,a){return this.request({method:"ui/update-model-context",params:n},Pa,a)}openLink(n,a){return this.request({method:"ui/open-link",params:n},ng,a)}downloadFile(n,a){return this.request({method:"ui/download-file",params:n},ag,a)}requestDisplayMode(n,a){return this.request({method:"ui/request-display-mode",params:n},pg,a)}sendSizeChanged(n){return this.notification({method:"ui/notifications/size-changed",params:n})}setupSizeChangedNotifications(){let n=!1,a=0,r=0,s=()=>{n||(n=!0,requestAnimationFrame(()=>{n=!1;let l=document.documentElement,h=l.style.width,g=l.style.height;l.style.width="fit-content",l.style.height="max-content";let p=l.getBoundingClientRect();l.style.width=h,l.style.height=g;let d=window.innerWidth-l.clientWidth,f=Math.ceil(p.width+d),c=Math.ceil(p.height);(f!==a||c!==r)&&(a=f,r=c,this.sendSizeChanged({width:f,height:c}))}))};s();let o=new ResizeObserver(s);return o.observe(document.documentElement),o.observe(document.body),()=>o.disconnect()}async connect(n=new Q2(window.parent,window.parent),a){var r;if(this.transport)throw Error("App is already connected. Call close() before connecting again.");await super.connect(n);try{let s=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:K2}},bg,a);if(s===void 0)throw Error(`Server sent invalid initialize result: ${s}`);this._hostCapabilities=s.hostCapabilities,this._hostInfo=s.hostInfo,this._hostContext=s.hostContext,await this.notification({method:"ui/notifications/initialized"}),(r=this.options)!=null&&r.autoResize&&this.setupSizeChangedNotifications()}catch(s){throw this.close(),s}}}function wg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tr,Li;function _g(){if(Li)return Tr;Li=1;var e="6.6.2";return Tr=e,Tr}var Er,Oi;function Xa(){if(Oi)return Er;Oi=1;var e=function(n,a){var r=this;if(a||(a={}),r.qpm=a.qpm?parseInt(a.qpm,10):null,!r.qpm){var s=n.metaText?n.metaText.tempo:null;r.qpm=n.getBpm(s)}r.extraMeasuresAtBeginning=a.extraMeasuresAtBeginning?parseInt(a.extraMeasuresAtBeginning,10):0,r.beatCallback=a.beatCallback,r.eventCallback=a.eventCallback,r.lineEndCallback=a.lineEndCallback,r.lineEndAnticipation=a.lineEndAnticipation?parseInt(a.lineEndAnticipation,10):0,r.beatSubdivisions=a.beatSubdivisions?parseInt(a.beatSubdivisions,10):1,r.beatSubdivisions||(r.beatSubdivisions=1),r.joggerTimer=null,r.replaceTarget=function(l){if(r.noteTimings=l.setTiming(r.qpm,r.extraMeasuresAtBeginning),l.noteTimings.length===0&&(r.noteTimings=l.setTiming(0,0)),r.lineEndCallback&&(r.lineEndTimings=t(l.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 h=l.getMeter(),g="";if(h&&h.type==="specified"&&h.value&&h.value.length>0&&h.value[0].num.indexOf("+")>0&&(g=h.value[0].num),r.beatStarts=[],g){for(var p=r.noteTimings[r.noteTimings.length-1].millisecondsPerMeasure,d=r.lastMoment/p,f=g.split("+"),c=0;c<f.length;c++)f[c]=parseInt(f[c],10)/2;for(var u=0,i=0,v=0;v<d;v++)for(var b=v*p,m=0,w=0;w<f.length;w++){var _=f[w];if(r.beatSubdivisions===1)r.beatSubdivisions===1&&u<r.lastMoment&&r.beatStarts.push({b:i,ts:u}),u+=_*r.millisecondsPerBeat;else for(var T=_*r.beatSubdivisions,q=0;q<Math.floor(T);q++){var I=q/T,E=Math.round(b+m*r.millisecondsPerBeat);E<r.lastMoment&&r.beatStarts.push({b:i+I,ts:E}),m++}i++}r.beatStarts.push({b:d*f.length,ts:r.lastMoment}),r.totalBeats=r.beatStarts.length}else{r.totalBeats=Math.round(r.lastMoment/r.millisecondsPerBeat);for(var P=0;P<r.totalBeats+1;P++)r.beatStarts.push({b:P/r.beatSubdivisions,ts:Math.round(P*r.millisecondsPerBeat)})}}},r.replaceTarget(n),r.doTiming=function(l){if(r.lastTimestamp!==l&&(r.lastTimestamp=l,!r.isPaused&&r.isRunning)){for(r.startTime||(r.startTime=l),r.currentTime=l-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 h=r.startTime;r.eventCallback(r.noteTimings[r.currentEvent]),h!==r.startTime&&(r.currentTime=l-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 p=r.doBeatCallback(l);r.currentBeat++,p!==null&&(r.currentTime=p)}}else if(r.currentBeat<=r.totalBeats&&r.beatCallback){var d=r.doBeatCallback(l);r.currentBeat++,d!==null&&(r.currentTime=d),requestAnimationFrame(r.doTiming)}if(r.currentTime>=r.lastMoment)if(r.eventCallback){var f=r.eventCallback(null);r.shouldStop(f).then(function(c){c&&r.stop()})}else r.stop()}},r.shouldStop=function(l){return new Promise(function(h){if(!l)return h(!0);if(l==="continue")return h(!1);l.then&&l.then(function(g){h(g!=="continue")})})},r.doBeatCallback=function(l){if(r.beatCallback){for(var h=r.currentEvent;h<r.noteTimings.length&&r.noteTimings[h].left===null;)h++;var g,p;if(h<r.noteTimings.length){for(g=r.noteTimings[h].milliseconds,h=Math.max(0,r.currentEvent-1);h>=0&&r.noteTimings[h].left===null;)h--;p=r.noteTimings[h]}var d={},f={};if(p){d.top=p.top,d.height=p.height;var c=Math.max(0,l-r.startTime-p.milliseconds),u=g-p.milliseconds,i=p.endX-p.left,v=u?c*i/u:0;d.left=p.left+v,r.currentEvent===0&&p.milliseconds>l-r.startTime&&(d.left=void 0),f={timestamp:l,startTime:r.startTime,ev:p,endMs:g,offMs:c,offPx:v,gapMs:u,gapPx:i}}else f={timestamp:l,startTime:r.startTime};var b=r.startTime;if(r.beatCallback(r.beatStarts[r.currentBeat].b,r.totalBeats/r.beatSubdivisions,r.lastMoment,d,f),b!==r.startTime)return l-r.startTime}return null};var o=60;r.animationJogger=function(){r.isRunning&&(r.doTiming(performance.now()),r.joggerTimer=setTimeout(r.animationJogger,o))},r.start=function(l,h){if(r.isRunning=!0,r.isPaused&&(r.isPaused=!1,l===void 0&&(r.justUnpaused=!0)),l)r.setProgress(l,h);else if(l===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,o)},r.pause=function(){r.isPaused=!0;var l=performance.now();r.pausedPercent=(l-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(l,h){var g;switch(h){case"seconds":r.currentTime=l*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=l*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=l,g<0&&(g=0),g>1&&(g=1),r.currentTime=r.lastMoment*g;break}r.isRunning||(r.pausedPercent=g);var p=performance.now();for(r.startTime=p-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 d=r.currentBeat;for(r.currentBeat=0;r.currentBeat<r.beatStarts.length&&!(r.beatStarts[r.currentBeat].ts>r.currentTime);r.currentBeat++);r.currentBeat--,r.beatCallback&&d!==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,o)}};function t(n,a){for(var r=[],s=null,o=0;o<n.length;o++){var l=n[o];l.type!=="end"&&l.top!==s&&(r.push({measureNumber:l.measureNumber,milliseconds:l.milliseconds-a,top:l.top,bottom:l.top+l.height}),s=l.top)}return r}return Er=e,Er}var Ar,Di;function kg(){if(Di)return Ar;Di=1;var e=Xa(),t={};return(function(){var n,a;t.startAnimation=function(r,s,o){n&&(n.stop(),n=void 0),o.showCursor&&(a=r.querySelector(".abcjs-cursor"),a||(a=document.createElement("DIV"),a.className="abcjs-cursor cursor",a.style.position="absolute",r.appendChild(a),r.style.position="relative"));function l(u){for(var i=0;i<u.length;i++){var v=u[i];v.classList.contains("abcjs-bar")||(v.style.display="none")}}var h;function g(u){if(h){var i=r.querySelectorAll(h);l(i)}h=u}function p(u){var i=r.querySelectorAll(u);l(i)}function d(u){o.hideCurrentMeasure?p(u):o.hideFinishedMeasures&&g(u)}function f(u){return".abcjs-l"+u.line+".abcjs-m"+u.measureNumber}function c(u){if(u){if(u.measureStart){var i=f(u);i&&d(i)}a&&(a.style.left=u.left+"px",a.style.top=u.top+"px",a.style.width=u.width+"px",a.style.height=u.height+"px")}else n.stop(),n=void 0}n=new e(s,{qpm:o.bpm,eventCallback:c}),n.start()},t.pauseAnimation=function(r){n&&(r?n.pause():n.start())},t.stopAnimation=function(){n&&(n.stop(),n=void 0)}})(),Ar=t,Ar}var Mr,Fi;function at(){if(Fi)return Mr;Fi=1;var e={};return e.cloneArray=function(t){for(var n=[],a=0;a<t.length;a++)n.push(Object.assign({},t[a]));return n},e.cloneHashOfHash=function(t){var n={};for(var a in t)t.hasOwnProperty(a)&&(n[a]=Object.assign({},t[a]));return n},e.cloneHashOfArrayOfHash=function(t){var n={};for(var a in t)t.hasOwnProperty(a)&&(n[a]=e.cloneArray(t[a]));return n},e.strip=function(t){return t.replace(/^\s+/,"").replace(/\s+$/,"")},e.startsWith=function(t,n){return t.indexOf(n)===0},e.endsWith=function(t,n){var a=t.length-n.length;return a>=0&&t.lastIndexOf(n)===a},e.last=function(t){return t.length===0?null:t[t.length-1]},Mr=e,Mr}var Ir,Hi;function Ka(){if(Hi)return Ir;Hi=1;var e=at(),t={};return(function(){var n,a,r,s,o;t.initialize=function(y,C,A,B,O){n=y,a=C,r=A,s=B,o=O,l()};function l(){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"},s.formatting.composerfont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},s.formatting.subtitlefont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},s.formatting.tempofont={face:'"Times New Roman"',size:15,weight:"bold",style:"normal",decoration:"none"},s.formatting.titlefont={face:'"Times New Roman"',size:20,weight:"normal",style:"normal",decoration:"none"},s.formatting.footerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},s.formatting.headerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},s.formatting.voicefont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},s.formatting.tablabelfont={face:'"Trebuchet MS"',size:16,weight:"normal",style:"normal",decoration:"none"},s.formatting.tabnumberfont={face:'"Arial"',size:11,weight:"normal",style:"normal",decoration:"none"},s.formatting.tabgracefont={face:'"Arial"',size:8,weight:"normal",style:"normal",decoration:"none"},s.formatting.annotationfont=r.annotationfont,s.formatting.gchordfont=r.gchordfont,s.formatting.historyfont=r.historyfont,s.formatting.infofont=r.infofont,s.formatting.measurefont=r.measurefont,s.formatting.partsfont=r.partsfont,s.formatting.repeatfont=r.repeatfont,s.formatting.textfont=r.textfont,s.formatting.tripletfont=r.tripletfont,s.formatting.vocalfont=r.vocalfont,s.formatting.wordsfont=r.wordsfont}var h={gchordfont:!0,measurefont:!0,partsfont:!0,annotationfont:!0,composerfont:!0,historyfont:!0,infofont:!0,subtitlefont:!0,textfont:!0,titlefont:!0,voicefont:!0},g=function(y){switch(y){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}},p=function(y,C,A,B,O){function $(){var Te=parseInt(y[0].token);return y.shift(),C?y.length===0?{face:C.face,weight:C.weight,style:C.style,decoration:C.decoration,size:Te}:y.length===1&&y[0].token==="box"&&h[O]?{face:C.face,weight:C.weight,style:C.style,decoration:C.decoration,size:Te,box:!0}:(a("Extra parameters in font definition.",A,B),{face:C.face,weight:C.weight,style:C.style,decoration:C.decoration,size:Te}):(a("Can't set just the size of the font since there is no default value.",A,B),{face:'"Times New Roman"',weight:"normal",style:"normal",decoration:"none",size:Te})}if(y[0].token==="*"){if(y.shift(),y[0].type==="number")return $();a("Expected font size number after *.",A,B)}if(y[0].type==="number")return $();for(var F=[],W,te="normal",J="normal",ie="none",re=!1,oe="face",X=!1;y.length;){var ne=y.shift(),ee=ne.token.toLowerCase();switch(oe){case"face":X||ee!=="utf"&&ne.type!=="number"&&ee!=="bold"&&ee!=="italic"&&ee!=="underline"&&ee!=="box"?F.length>0&&ne.token==="-"?(X=!0,F[F.length-1]=F[F.length-1]+ne.token):X?(X=!1,F[F.length-1]=F[F.length-1]+ne.token):F.push(ne.token):ne.type==="number"?(W?a("Font size specified twice in font definition.",A,B):W=ne.token,oe="modifier"):ee==="bold"?te="bold":ee==="italic"?J="italic":ee==="underline"?ie="underline":ee==="box"?(h[O]?re=!0:a(`This font style doesn't support "box"`,A,B),oe="finished"):ee==="utf"?(ne=y.shift(),oe="size"):a("Unknown parameter "+ne.token+" in font definition.",A,B);break;case"size":ne.type==="number"?W?a("Font size specified twice in font definition.",A,B):W=ne.token:a("Expected font size in font definition.",A,B),oe="modifier";break;case"modifier":ee==="bold"?te="bold":ee==="italic"?J="italic":ee==="underline"?ie="underline":ee==="box"?(h[O]?re=!0:a(`This font style doesn't support "box"`,A,B),oe="finished"):a("Unknown parameter "+ne.token+" in font definition.",A,B);break;case"finished":a('Extra characters found after "box" in font definition.',A,B);break}}W===void 0?C?W=C.size:(a("Must specify the size of the font since there is no default value.",A,B),W=12):W=parseFloat(W),F=F.join(" "),F===""&&(C?F=C.face:(a("Must specify the name of the font since there is no default value.",A,B),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=W,re&&(de.box=!0),de):(de.face=F,de.weight=te,de.style=J,de.decoration=ie,de.size=W,re&&(de.box=!0),de)},d=function(y,C,A){return C.length===0?'Directive "'+y+'" requires a font as a parameter.':(r[y]=p(C,r[y],A,0,y),r.is_in_header&&(s.formatting[y]=r[y]),null)},f=function(y,C,A){return C.length===0?'Directive "'+y+'" requires a font as a parameter.':(s.formatting[y]=p(C,s.formatting[y],A,0,y),null)},c=function(y,C){var A="";C.forEach(function(O){A+=O.token});var B=parseFloat(A);if(isNaN(B)||B===0)return'Directive "'+y+'" requires a number as a parameter.';s.formatting.scale=B},u=["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"],i=function(y){var C=y.split(/\s+/);if(C.length!==2&&C.length!==3)return{error:'Expected parameters "abc-note", "drum-sound", and optionally "note-head"'};var A=C[0],B=parseInt(C[1],10);if((isNaN(B)||B<35||B>81)&&C[1]&&(B=u.indexOf(C[1].toLowerCase())+35),isNaN(B)||B<35||B>81)return{error:'Expected drum name, received "'+C[1]+'"'};var O={sound:B};return C.length===3&&(O.noteHead=C[2]),{key:A,value:O}},v=function(y,C){var A=n.getMeasurement(C);return A.used===0||C.length!==0?{error:'Directive "'+y+'" requires a measurement as a parameter.'}:A.value},b=function(y,C){var A=n.getMeasurement(C);return A.used===0||C.length!==0?'Directive "'+y+'" requires a measurement as a parameter.':(s.formatting[y]=A.value,null)},m=function(y,C,A,B,O){if(A.length!==1||A[0].type!=="number")return'Directive "'+C+'" requires a number as a parameter.';var $=A[0].intt;return B!==void 0&&$<B?'Directive "'+C+'" requires a number greater than or equal to '+B+" as a parameter.":O!==void 0&&$>O?'Directive "'+C+'" requires a number less than or equal to '+O+" as a parameter.":(r[y]=$,null)},w=function(y,C,A){if(A.length===1&&(A[0].token==="true"||A[0].token==="false"))return r[y]=A[0].token==="true",null;var B=m(y,C,A,0,1);return B!==null?B:(r[y]=r[y]===1,null)},_=function(y,C,A,B){if(A.length!==1)return'Directive "'+C+'" requires one of [ '+B.join(", ")+" ] as a parameter.";for(var O=A[0].token,$=!1,F=0;!$&&F<B.length;F++)B[F]===O&&($=!0);return $?(r[y]=O,null):'Directive "'+C+'" requires one of [ '+B.join(", ")+" ] as a parameter."},T=["nobarlines","barlines","beataccents","nobeataccents","droneon","droneoff","drumon","drumoff","fermatafixed","fermataproportional","gchordon","gchordoff","controlcombo","temperamentnormal","noportamento"],q=["gchord","ptstress","beatstring"],I=["bassvol","chordvol","c","channel","beatmod","deltaloudness","drumbars","gracedivider","makechordchannels","randomchordattack","chordattack","stressmodel","transpose","rtranspose","vol","volinc","gchordbars"],E=["program"],P=["ratio","snt","bendvelocity","pitchbend","control","temperamentlinear"],x=["beat"],M=["drone"],N=["portamento"],D=["expand","grace","trim"],k=["drum","chordname"],S=["bassprog","chordprog"],z=function(y,C,A){var B=y.shift().token,O=[];if(T.indexOf(B)>=0)y.length!==0&&a("Unexpected parameter in MIDI "+B,A,0);else if(q.indexOf(B)>=0)y.length!==1?a("Expected one parameter in MIDI "+B,A,0):O.push(y[0].token);else if(I.indexOf(B)>=0)y.length!==1?a("Expected one parameter in MIDI "+B,A,0):y[0].type!=="number"?a("Expected one integer parameter in MIDI "+B,A,0):O.push(y[0].intt);else if(E.indexOf(B)>=0)y.length!==1&&y.length!==2?a("Expected one or two parameters in MIDI "+B,A,0):y[0].type!=="number"||y.length===2&&y[1].type!=="number"?a("Expected integer parameter in MIDI "+B,A,0):(O.push(y[0].intt),y.length===2&&O.push(y[1].intt));else if(P.indexOf(B)>=0)y.length!==2?a("Expected two parameters in MIDI "+B,A,0):y[0].type!=="number"||y[1].type!=="number"?a("Expected two integer parameters in MIDI "+B,A,0):(O.push(y[0].intt),O.push(y[1].intt));else if(N.indexOf(B)>=0)y.length!==2?a("Expected two parameters in MIDI "+B,A,0):y[0].type!=="alpha"||y[1].type!=="number"?a("Expected one string and one integer parameters in MIDI "+B,A,0):(O.push(y[0].token),O.push(y[1].intt));else if(B==="drummap")y.length===2&&y[0].type==="alpha"&&y[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[y[0].token]=y[1].intt,O=C.formatting.midi.drummap):y.length===3&&y[0].type==="punct"&&y[1].type==="alpha"&&y[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[y[0].token+y[1].token]=y[2].intt,O=C.formatting.midi.drummap):a("Expected one note name and one integer parameter in MIDI "+B,A,0);else if(D.indexOf(B)>=0)y.length!==3||y[0].type!=="number"||y[1].token!=="/"||y[2].type!=="number"?a("Expected fraction parameter in MIDI "+B,A,0):(O.push(y[0].intt),O.push(y[2].intt));else if(x.indexOf(B)>=0)y.length!==4?a("Expected four parameters in MIDI "+B,A,0):y[0].type!=="number"||y[1].type!=="number"||y[2].type!=="number"||y[3].type!=="number"?a("Expected four integer parameters in MIDI "+B,A,0):(O.push(y[0].intt),O.push(y[1].intt),O.push(y[2].intt),O.push(y[3].intt));else if(M.indexOf(B)>=0)y.length!==5?a("Expected five parameters in MIDI "+B,A,0):y[0].type!=="number"||y[1].type!=="number"||y[2].type!=="number"||y[3].type!=="number"||y[4].type!=="number"?a("Expected five integer parameters in MIDI "+B,A,0):(O.push(y[0].intt),O.push(y[1].intt),O.push(y[2].intt),O.push(y[3].intt),O.push(y[4].intt));else if(E.indexOf(B)>=0)y.length!==1||y.length!==4?a("Expected one or two parameters in MIDI "+B,A,0):y[0].type!=="number"?a("Expected integer parameter in MIDI "+B,A,0):y.length===4?(y[1].token!=="octave"&&a("Expected octave parameter in MIDI "+B,A,0),y[2].token!=="="&&a("Expected octave parameter in MIDI "+B,A,0),y[3].type!=="number"&&a("Expected integer parameter for octave in MIDI "+B,A,0)):(O.push(y[0].intt),y.length===4&&O.push(y[3].intt));else if(k.indexOf(B)>=0)if(y.length<2)a("Expected string parameter and at least one integer parameter in MIDI "+B,A,0);else if(y[0].type!=="alpha")a("Expected string parameter and at least one integer parameter in MIDI "+B,A,0);else{var $=y.shift();for(O.push($.token);y.length>0;)$=y.shift(),$.type!=="number"&&a("Expected integer parameter in MIDI "+B,A,0),O.push($.intt)}else if(S.indexOf(B)>=0){if(y.length!==1&&y.length!==2)a("Expected one or two parameters in MIDI "+B,A,0);else if(y[0].type!=="number")a("Expected integer parameter in MIDI "+B,A,0);else if(y.length===2&&y[1].type!=="alpha")a("Expected alpha parameter in MIDI "+B,A,0);else if(O.push(y[0].intt),y.length===2){var F=y[1].token;F.indexOf("octave=")!=-1?(F=F.replace("octave=",""),F=parseInt(F),isNaN(F)?a("Expected octave value in MIDI"+B):(F<-1&&(a("Expected octave= in MIDI "+B+" to be >= -1 (recv:"+F+")"),F=-1),F>3&&(a("Expected octave= in MIDI "+B+" to be <= 3 (recv:"+F+")"),F=3),O.push(F))):a("Expected octave= in MIDI"+B)}}o.hasBeginMusic()?o.appendElement("midi",-1,-1,{cmd:B,params:O}):(C.formatting.midi===void 0&&(C.formatting.midi={}),C.formatting.midi[B]=O)};t.parseFontChangeLine=function(y){y=y.replace(/\$\$/g,"");var C=y.split("$");if(C.length>1&&r.setfont){var A=[];C[0]!==""&&A.push({text:C[0]});for(var B=1;B<C.length;B++)if(C[B][0]==="0")A.push({text:C[B].substring(1).replace(/\x03/g,"$$")});else{var O=parseInt(C[B][0],10);r.setfont[O]?A.push({font:r.setfont[O],text:C[B].substring(1).replace(/\x03/g,"$$")}):A[A.length-1].text+="$"+C[B].replace(/\x03/g,"$$")}return A}return y.replace(/\x03/g,"$$")};var L=["auto","above","below","hidden"];t.addDirective=function(y){var C=n.tokenize(y,0,y.length);if(C.length===0||C[0].type!=="alpha")return null;var A=y.substring(y.indexOf(C[0].token)+C[0].token.length);A=n.stripComment(A);var B=C.shift().token.toLowerCase(),O="",$;switch(B){case"bagpipes":s.formatting.bagpipes=!0;break;case"flatbeams":s.formatting.flatbeams=!0;break;case"jazzchords":s.formatting.jazzchords=!0;break;case"accentAbove":s.formatting.accentAbove=!0;break;case"germanAlphabet":s.formatting.germanAlphabet=!0;break;case"landscape":r.landscape=!0;break;case"papersize":r.papersize=A;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")s.formatting.graceSlurs=!1;else if(C[0].token==="1"||C[0].token==="true")s.formatting.graceSlurs=!0;else return"Directive graceslurs requires one parameter: 0 or 1 (received "+C[0].token+")";break;case"lineThickness":var F=R(C);if(F.value!==void 0&&(s.formatting.lineThickness=F.value),F.error)return F.error;break;case"stretchlast":var W=R(C);if(W.value!==void 0&&(s.formatting.stretchlast=W.value),W.error)return W.error;break;case"titlecaps":r.titlecaps=!0;break;case"titleleft":s.formatting.titleleft=!0;break;case"measurebox":s.formatting.measurebox=!0;break;case"vocal":return _("vocalPosition",B,C,L);case"dynamic":return _("dynamicPosition",B,C,L);case"gchord":return _("chordPosition",B,C,L);case"ornament":return _("ornamentPosition",B,C,L);case"volume":return _("volumePosition",B,C,L);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 b(B,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,o.changeVoiceScale(r.currentVoice.scale)),null;case"voicecolor":if(C.length!==1)return"voicecolor requires one string as a parameter";var J=C.shift();return r.currentVoice&&(r.currentVoice.color=J.token,o.changeVoiceColor(r.currentVoice.color)),null;case"vskip":var ie=Math.round(v(B,C));return ie.error?ie.error:(o.addSpacing(ie),null);case"scale":c(B,C);break;case"sep":if(C.length===0)o.addSeparator(14,14,85,{startChar:r.iChar,endChar:r.iChar+5});else{var re=n.getMeasurement(C);if(re.used===0)return'Directive "'+B+'" requires 3 numbers: space above, space below, length of line';var oe=re.value;if(re=n.getMeasurement(C),re.used===0)return'Directive "'+B+'" requires 3 numbers: space above, space below, length of line';var X=re.value;if(re=n.getMeasurement(C),re.used===0||C.length!==0)return'Directive "'+B+'" requires 3 numbers: space above, space below, length of line';var ne=re.value;o.addSeparator(oe,X,ne,{startChar:r.iChar,endChar:r.iChar+A.length})}break;case"barsperstaff":if(O=m("barsperstaff",B,C),O!==null)return O;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(O=w("printTempo",B,C),O!==null)return O;break;case"partsbox":if(O=w("partsBox",B,C),O!==null)return O;r.partsfont.box=r.partsBox;break;case"freegchord":if(O=w("freegchord",B,C),O!==null)return O;break;case"measurenb":case"barnumbers":if(O=m("barNumbers",B,C),O!==null)return O;break;case"setbarnb":if(C.length!==1||C[0].type!=="number")return"Directive setbarnb requires a number as a parameter.";r.currBarNumber=o.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 "+B+" requires 0 or 1 as a parameter.";r[B]=C[0].intt===1;break;case"begintext":var ee="";for($=n.nextLine();$&&$.indexOf("%%endtext")!==0;){if(e.startsWith($,"%%")){var he=$.substring(2);he=he.trim()+`
85
+ `,ee+=he}else ee+=$.trim()+`
86
+ `;$=n.nextLine()}o.addText(ee,{startChar:r.iChar,endChar:r.iChar+ee.length+7});break;case"continueall":r.continueall=!0;break;case"beginps":for($=n.nextLine();$&&$.indexOf("%%endps")!==0;)n.nextLine();a("Postscript ignored",y,0);break;case"deco":A.length>0&&r.ignoredDecorations.push(A.substring(0,A.indexOf(" "))),a("Decoration redefinition ignored",y,0);break;case"text":var de=n.translateString(A);o.addText(t.parseFontChangeLine(de),{startChar:r.iChar,endChar:r.iChar+A.length+7});break;case"center":var Te=n.translateString(A);o.addCentered(t.parseFontChangeLine(Te));break;case"font":break;case"setfont":var _e=n.tokenize(A,0,A.length);if(_e.length>=4&&_e[0].token==="-"&&_e[1].type==="number"){var qe=parseInt(_e[1].token);qe>=1&&qe<=9&&(r.setfont||(r.setfont=[]),_e.shift(),_e.shift(),r.setfont[qe]=p(_e,r.setfont[qe],y,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 d(B,C,y);case"composerfont":case"subtitlefont":case"tempofont":case"titlefont":case"voicefont":case"footerfont":case"headerfont":return f(B,C,y);case"barlabelfont":case"barnumberfont":case"barnumfont":return d("measurefont",C,y);case"staves":case"score":r.score_is_present=!0;for(var ze=function(ut,pu,fi,di,gu){(pu||r.staves.length===0)&&r.staves.push({index:r.staves.length,numVoices:0});var ht=e.last(r.staves);fi!==void 0&&ht.bracket===void 0&&(ht.bracket=fi),di!==void 0&&ht.brace===void 0&&(ht.brace=di),gu&&(ht.connectBarLines="end"),r.voices[ut]===void 0&&(r.voices[ut]={staffNum:ht.index,index:ht.numVoices},ht.numVoices++)},De=!1,G=!1,V=!1,H=!1,U=!1,Q=!1,ae=!1,ce,ge=function(){if(ae=!0,ce){var ut="start";ce.staffNum>0&&(r.staves[ce.staffNum-1].connectBarLines==="start"||r.staves[ce.staffNum-1].connectBarLines==="continue")&&(ut="continue"),r.staves[ce.staffNum].connectBarLines=ut}};C.length;){var se=C.shift();switch(se.token){case"(":De?a("Can't nest parenthesis in %%score",y,se.start):(De=!0,H=!0);break;case")":!De||H?a("Unexpected close parenthesis in %%score",y,se.start):De=!1;break;case"[":G?a("Can't nest brackets in %%score",y,se.start):(G=!0,U=!0);break;case"]":!G||U?a("Unexpected close bracket in %%score",y,se.start):(G=!1,r.staves[ce.staffNum].bracket="end");break;case"{":V?a("Can't nest braces in %%score",y,se.start):(V=!0,Q=!0);break;case"}":!V||Q?a("Unexpected close brace in %%score",y,se.start):(V=!1,r.staves[ce.staffNum].brace="end");break;case"|":ge();break;default:for(var ue="";(se.type==="alpha"||se.type==="number")&&(ue+=se.token,se.continueId);)se=C.shift();var Ae=!De||H,Be=U?"start":G?"continue":void 0,pe=Q?"start":V?"continue":void 0;ze(ue,Ae,Be,pe,ae),H=!1,U=!1,Q=!1,ae=!1,ce=r.voices[ue],B==="staves"&&ge();break}}break;case"maxstaves":var be=n.getInt(A);be.digits===0?a("Expected number of staves in maxstaves"):be.value>0&&(s.formatting.maxStaves=be.value);break;case"newpage":var Ge=n.getInt(A);o.addNewPage(Ge.digits===0?-1:Ge.value);break;case"abc":var ve=A.split(" ");switch(ve[0]){case"-copyright":case"-creator":case"-edited-by":case"-version":case"-charset":var nt=ve.shift();o.addMetaText(B+nt,ve.join(" "),{startChar:r.iChar,endChar:r.iChar+A.length+5});break;default:return"Unknown directive: "+B+ve[0]}break;case"header":case"footer":var Ue=n.getMeat(A,0,A.length);Ue=A.substring(Ue.start,Ue.end),Ue[0]==='"'&&Ue[Ue.length-1]==='"'&&(Ue=Ue.substring(1,Ue.length-1));var Ze=Ue.split(" "),ct={};Ze.length===1?ct={left:"",center:Ze[0],right:""}:Ze.length===2?ct={left:Ze[0],center:Ze[1],right:""}:ct={left:Ze[0],center:Ze[1],right:Ze[2]},Ze.length>3&&a("Too many tabs in "+B+": "+Ze.length+" found.",A,0),o.addMetaTextObj(B,ct,{startChar:r.iChar,endChar:r.iChar+y.length});break;case"midi":var lt=n.tokenize(A,0,A.length,!0);lt.length>0&&lt[0].token==="="&&lt.shift(),lt.length===0?a("Expected midi command",A,0):z(lt,s,A);break;case"percmap":var bt=i(A);bt.error?a(bt.error,y,8):(s.formatting.percmap||(s.formatting.percmap={}),s.formatting.percmap[bt.key]=bt.value);break;case"visualtranspose":var St=n.getInt(A);St.digits===0?a("Expected number of half steps in visualTranspose"):r.globalTranspose=St.value;break;case"map":case"playtempo":case"auquality":case"continuous":case"nobarcheck":s.formatting[B]=A;break;default:return"Unknown directive: "+B}return null},t.globalFormatting=function(y){for(var C in y)if(y.hasOwnProperty(C)){var A=""+y[C],B=n.tokenize(A,0,A.length),O;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":d(C,B,A);break;case"scale":c(C,B);break;case"partsbox":O=w("partsBox",C,B),O!==null&&a(O),r.partsfont.box=r.partsBox;break;case"freegchord":O=w("freegchord",C,B),O!==null&&a(O);break;case"fontboxpadding":(B.length!==1||B[0].type!=="number")&&a('Directive "'+C+'" requires a number as a parameter.'),s.formatting.fontboxpadding=B[0].floatt;break;case"stafftopmargin":(B.length!==1||B[0].type!=="number")&&a('Directive "'+C+'" requires a number as a parameter.'),s.formatting.stafftopmargin=B[0].floatt;break;case"stretchlast":var $=R(B);if($.value!==void 0&&(s.formatting.stretchlast=$.value),$.error)return $.error;break;default:a("Formatting directive unrecognized: ",C,0)}}};function R(y){if(y.length===0)return{value:1};if(y.length===1)if(y[0].type==="number"){if(y[0].floatt>=0||y[0].floatt<=1)return{value:y[0].floatt}}else{if(y[0].token==="false")return{value:0};if(y[0].token==="true")return{value:1}}return{error:"Directive stretchlast requires zero or one parameter: false, true, or number between 0 and 1 (received "+y[0].token+")"}}})(),Ir=t,Ir}var Nr,$i;function xg(){if($i)return Nr;$i=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(n){return t.indexOf(n)},e.noteName=function(n){return t[n]},Nr=e,Nr}var Pr,Gi;function Nl(){if(Gi)return Pr;Gi=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"],n=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],a=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"];function r(s,o,l,h){if(!o||o%12===0)return s;for(;o<0;)o+=12;o>11&&(o=o%12);var g=s.match(/^([A-G][b#♭♯]?)([^\/]+)?\/?([A-G][b#♭♯]?)?(.+)?/);if(!g)return s;var p=g[1],d=g[2],f=g[3],c=g[4],u=e.indexOf(p);if(u<0&&(u=t.indexOf(p)),u<0&&(u=n.indexOf(p)),u<0&&(u=a.indexOf(p)),u<0)return s;u+=o,u=u%12,l?h?s=a[u]:s=t[u]:h?s=n[u]:s=e[u];var i=d&&(d.indexOf("dim")>=0||d.indexOf("°")>=0);if(i&&s==="A#"&&(s="Bb"),i&&s==="D#"&&(s="Eb"),i&&s==="A♯"&&(s="B♭"),i&&s==="D♯"&&(s="E♭"),d&&(s+=d),f){var u=e.indexOf(f);u<0&&(u=t.indexOf(f)),u<0&&(u=n.indexOf(f)),u<0&&(u=a.indexOf(f)),s+="/",u>=0?(u+=o,u=u%12,l?h?s+=a[u]:s+=t[u]:h?s+=n[u]:s+=e[u]):s+=f}return c&&(s+=c),s}return Pr=r,Pr}var zr,Zi;function Pl(){if(Zi)return zr;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 n(h){return t.indexOf(h.toLowerCase())>=0}var a=null;function r(){a={};for(var h=Object.keys(e),g=0;g<h.length;g++){var p=e[h[g]];a[h[g].toLowerCase()]=h[g];for(var d=0;d<p.modes.length;d++){var f=p.modes[d].toLowerCase();a[f]=h[g]}}}function s(h){a||r();var g=h.toLowerCase().match(/([a-g][b#]?)(maj|ion|min|aeo|mix|dor|phr|lyd|loc|m)?/);if(!g||!g[2])return h;g=g[1]+g[2];var p=a[g];return p||h}function o(h,g){var p=e[h];if(!p||g==="")return h;var d=g.toLowerCase().match(/^(maj|ion|min|aeo|mix|dor|phr|lyd|loc|m)/);if(!d)return h;for(var f=d[1],c=0;c<p.modes.length;c++){var u=p.modes[c],i=u.toLowerCase().indexOf(f);if(i!==-1&&i===u.length-f.length)return u.substring(0,u.length-f.length)}return h}function l(h,g){var p=e[h];if(!p)return h;for(;g<0;)g+=12;for(var d=(p.stepsFromC+g)%12,f=0;f<Object.keys(e).length;f++){var c=Object.keys(e)[f];if(e[c].stepsFromC===d)return c}return h}return zr={relativeMajor:s,relativeMode:o,transposeKey:l,isLegalMode:n},zr}var Rr,ji;function zl(){if(ji)return Rr;ji=1;var{relativeMajor:e}=Pl(),t={acc:"sharp",note:"f"},n={acc:"sharp",note:"c"},a={acc:"sharp",note:"g"},r={acc:"sharp",note:"d"},s={acc:"sharp",note:"A"},o={acc:"sharp",note:"e"},l={acc:"sharp",note:"B"},h={acc:"flat",note:"B"},g={acc:"flat",note:"e"},p={acc:"flat",note:"A"},d={acc:"flat",note:"d"},f={acc:"flat",note:"G"},c={acc:"flat",note:"c"},u={acc:"flat",note:"F"},i={"C#":[t,n,a,r,s,o,l],"F#":[t,n,a,r,s,o],B:[t,n,a,r,s],E:[t,n,a,r],A:[t,n,a],D:[t,n],G:[t],C:[],F:[h],Bb:[h,g],Eb:[h,g,p],Cm:[h,g,p],Ab:[h,g,p,d],Db:[h,g,p,d,f],Gb:[h,g,p,d,f,c],Cb:[h,g,p,d,f,c,u],"A#":[h,g],"B#":[],"D#":[h,g,p],"E#":[h],"G#":[h,g,p,d],none:[]};function v(b){var m=i[e(b)];return m?JSON.parse(JSON.stringify(m)):null}return Rr=v,Rr}var qr,Ui;function Rl(){if(Ui)return qr;Ui=1;var e=xg(),t=Nl(),n=zl(),a={},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},s=["C","Db","D","Eb","E","F","F#","G","Ab","A","Bb","B"],o=["C","C#","D","D#","E","F","F#","G","G#","A","Bb","B"];a.keySignature=function(f,c,u,i,v){if(f.clef.type==="perc"||f.clef.type==="none")return{accidentals:n(c),root:u,acc:i};v||(v=0),f.localTransposeVerticalMovement=0,f.localTransposePreferFlats=!1;var b=n(c);if(!b)return f.key;if(f.localTranspose=(f.globalTranspose?f.globalTranspose:0)+v,!f.localTranspose)return{accidentals:b,root:u,acc:i};if(f.globalTransposeOrigKeySig=b,f.localTranspose%12===0)return f.localTransposeVerticalMovement=f.localTranspose/12*7,{accidentals:b,root:u,acc:i};var m=c[0];c[1]==="b"||c[1]==="#"?(m+=c[1],c=c.substr(2)):c=c.substr(1);var w=r[m],_=w!==void 0;_||(w=0,m="C",c="");for(var T=w+f.localTranspose;T<0;)T+=12;T>11&&(T=T%12);var q=c[0]==="m"?o[T]:s[T],I=q+c,E=n(I);(E.length===0||E[0].acc==="flat")&&(f.localTransposePreferFlats=!0);var P=I.charCodeAt(0)-m.charCodeAt(0);return f.localTranspose>0?(P<0||P===0&&(m[1]==="#"||I[1]==="b"))&&(P+=7):f.localTranspose<0&&(P>0||P===0&&(m[1]==="b"||I[1]==="#"))&&(P-=7),f.localTranspose>0?f.localTransposeVerticalMovement=P+Math.floor(f.localTranspose/12)*7:f.localTransposeVerticalMovement=P+Math.ceil(f.localTranspose/12)*7,_?{accidentals:E,root:q[0],acc:q.length>1?q[1]:""}:{accidentals:[],root:u,acc:i}},a.chordName=function(f,c){return t(c,f.localTranspose,f.localTransposePreferFlats,f.freegchord)};var l=["c","d","e","f","g","a","b"];function h(f,c,u,i,v){for(var b=l[(f+49)%7],m=0,w=0;w<i.length;w++)i[w].note.toLowerCase()===b&&(m=g[i[w].acc]);for(var _=g[u],T=_-m,q=l[(c+49)%7],I=0,E=0;E<v.accidentals.length;E++)v.accidentals[E].note.toLowerCase()===q&&(I=g[v.accidentals[E].acc]);var P=T+I;return P<-2&&(c--,P+=q==="c"||q==="f"?1:2),P>2&&(c++,P-=q==="b"||q==="e"?1:2),[c,P]}var g={dblflat:-2,flat:-1,natural:0,sharp:1,dblsharp:2},p={"-2":"dblflat","-1":"flat",0:"natural",1:"sharp",2:"dblsharp"},d={"-2":"__","-1":"_",0:"=",1:"^",2:"^^"};return a.note=function(f,c){if(!(!f.localTranspose||f.clef.type==="perc")){var u=c.pitch;if(f.localTransposeVerticalMovement&&(c.pitch=c.pitch+f.localTransposeVerticalMovement,c.name)){var i=c.accidental?c.name.substring(1):c.name,v=c.accidental?c.name[0]:"",b=e.pitchIndex(i);c.name=v+e.noteName(b+f.localTransposeVerticalMovement)}if(c.accidental){var m=h(u,c.pitch,c.accidental,f.globalTransposeOrigKeySig,f.targetKey);c.pitch=m[0],c.accidental=p[m[1]],c.name&&(c.name=d[m[1]]+c.name.replace(/[_^=]/g,""))}}},qr=a,qr}var Br,Yi;function Ja(){if(Yi)return Br;Yi=1;var e=Ka(),t=Rl(),n={};return(function(){var a,r,s,o;n.initialize=function(c,u,i,v,b){a=c,r=u,s=i,o=b},n.standardKey=function(c,u,i,v){return t.keySignature(s,c,u,i,v)};var l={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}},h=function(c,u){var i=l[c],v=i?i.mid:0;return v+u};n.fixClef=function(c){var u=l[c.type];u&&(c.clefPos=u.pitch,c.type=u.clef)},n.deepCopyKey=function(c){var u={accidentals:[],root:c.root,acc:c.acc,mode:c.mode};return c.accidentals.forEach(function(i){u.accidentals.push(Object.assign({},i))}),u};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};n.addPosToKey=function(c,u){var i=c.verticalPos;u.accidentals.forEach(function(v){var b=g[v.note];b=b-i,v.verticalPos=b}),u.impliedNaturals&&u.impliedNaturals.forEach(function(v){var b=g[v.note];b=b-i,v.verticalPos=b}),i<-10?(u.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)}),u.impliedNaturals&&u.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)})):i<-4?(u.accidentals.forEach(function(v){v.verticalPos-=7,i===-8&&(v.note==="f"||v.note==="g")&&v.acc==="sharp"&&(v.verticalPos-=7)}),u.impliedNaturals&&u.impliedNaturals.forEach(function(v){v.verticalPos-=7,i===-8&&(v.note==="f"||v.note==="g")&&v.acc==="sharp"&&(v.verticalPos-=7)})):i>=7&&(u.accidentals.forEach(function(v){v.verticalPos+=7}),u.impliedNaturals&&u.impliedNaturals.forEach(function(v){v.verticalPos+=7}))},n.fixKey=function(c,u){var i=Object.assign({},u);return n.addPosToKey(c,i),i};var p=function(c){var u=0,i=c[u++];(i==="^"||i==="_")&&(i=c[u++]);var v=g[i];for(v===void 0&&(v=6);u<c.length;u++)if(c[u]===",")v-=7;else if(c[u]==="'")v+=7;else break;return{mid:v-6,str:c.substring(u)}},d=function(c){for(var u=0;u<c.length;u++)c[u].note==="b"?c[u].note="B":c[u].note==="a"?c[u].note="A":c[u].note==="F"?c[u].note="f":c[u].note==="E"?c[u].note="e":c[u].note==="D"?c[u].note="d":c[u].note==="C"?c[u].note="c":c[u].note==="G"&&c[u].acc==="sharp"?c[u].note="g":c[u].note==="g"&&c[u].acc==="flat"&&(c[u].note="G")};n.parseKey=function(c,u){c.length===0&&(c="none");var i=a.tokenize(c,0,c.length),v={};if(i.length===0)return r("Must pass in key signature.",c,0),v;switch(i[0].token){case"HP":e.addDirective("bagpipes"),s.key={root:"HP",accidentals:[],acc:"",mode:""},v.foundKey=!0,i.shift();break;case"Hp":e.addDirective("bagpipes"),s.key={root:"Hp",accidentals:[{acc:"natural",note:"g"},{acc:"sharp",note:"f"},{acc:"sharp",note:"c"}],acc:"",mode:""},v.foundKey=!0,i.shift();break;case"none":s.key={root:"none",accidentals:[],acc:"",mode:""},v.foundKey=!0,i.shift();break;default:var b=a.getKeyPitch(i[0].token);if(b.len>0){v.foundKey=!0;var m="",w="";i[0].token.length>1?i[0].token=i[0].token.substring(1):i.shift();var _=b.token;if(i.length>0){var T=a.getSharpFlat(i[0].token);if(T.len>0&&(i[0].token.length>1?i[0].token=i[0].token.substring(1):i.shift(),_+=T.token,m=T.token),i.length>0){var q=a.getMode(i[0].token);q.len>0&&(i.shift(),_+=q.token,w=q.token)}if(n.standardKey(_,b.token,m,0)===void 0)return r("Unsupported key signature: "+_,c,0),v}var I=n.deepCopyKey(s.key),E=!u&&s.globalTranspose?-s.globalTranspose:0,P;if(u&&(P=s.globalTransposeOrigKeySig),s.key=n.deepCopyKey(n.standardKey(_,b.token,m,E)),u&&(s.globalTransposeOrigKeySig=P),s.key.mode=w,I&&s.keywarn!==!1){for(var x,M=0;M<s.key.accidentals.length;M++)for(x=0;x<I.accidentals.length;x++)I.accidentals[x].note&&s.key.accidentals[M].note.toLowerCase()===I.accidentals[x].note.toLowerCase()&&(I.accidentals[x].note=null);for(x=0;x<I.accidentals.length;x++)I.accidentals[x].note&&(s.key.impliedNaturals||(s.key.impliedNaturals=[]),s.key.impliedNaturals.push({acc:"natural",note:I.accidentals[x].note}))}}break}if(i.length===0||(i[0].token==="exp"&&i.shift(),i.length===0)||(i[0].token==="oct"&&i.shift(),i.length===0))return v;var N=a.getKeyAccidentals2(i);if(N.warn&&r(N.warn,c,0),N.accs){v.foundKey||(v.foundKey=!0,s.key={root:"none",acc:"",mode:"",accidentals:[]}),d(N.accs);for(var D=0;D<N.accs.length;D++){for(var k=!1,S=0;S<s.key.accidentals.length&&!k;S++)s.key.accidentals[S].note===N.accs[D].note&&(k=!0,s.key.accidentals[S].acc!==N.accs[D].acc&&(s.key.accidentals[S].acc=N.accs[D].acc,s.key.explicitAccidentals||(s.key.explicitAccidentals=[]),s.key.explicitAccidentals.push(N.accs[D])));if(!k&&(s.key.explicitAccidentals||(s.key.explicitAccidentals=[]),s.key.explicitAccidentals.push(N.accs[D]),s.key.accidentals.push(N.accs[D]),s.key.impliedNaturals))for(var z=0;z<s.key.impliedNaturals.length;z++)s.key.impliedNaturals[z].note===N.accs[D].note&&s.key.impliedNaturals.splice(z,1)}}for(var L;i.length>0;)switch(i[0].token){case"m":case"middle":if(i.shift(),i.length===0)return r("Expected = after middle",c,0),v;if(L=i.shift(),L.token!=="="){r("Expected = after middle",c,L.start);break}if(i.length===0)return r("Expected parameter after middle=",c,0),v;var R=a.getPitchFromTokens(i);R.warn&&r(R.warn,c,0),R.position&&(s.clef.verticalPos=R.position-6);break;case"transpose":if(i.shift(),i.length===0)return r("Expected = after transpose",c,0),v;if(L=i.shift(),L.token!=="="){r("Expected = after transpose",c,L.start);break}if(i.length===0)return r("Expected parameter after transpose=",c,0),v;if(i[0].type!=="number"){r("Expected number after transpose",c,i[0].start);break}s.clef.transpose=i[0].intt,i.shift();break;case"stafflines":if(i.shift(),i.length===0)return r("Expected = after stafflines",c,0),v;if(L=i.shift(),L.token!=="="){r("Expected = after stafflines",c,L.start);break}if(i.length===0)return r("Expected parameter after stafflines=",c,0),v;if(i[0].type!=="number"){r("Expected number after stafflines",c,i[0].start);break}s.clef.stafflines=i[0].intt,i.shift();break;case"staffscale":if(i.shift(),i.length===0)return r("Expected = after staffscale",c,0),v;if(L=i.shift(),L.token!=="="){r("Expected = after staffscale",c,L.start);break}if(i.length===0)return r("Expected parameter after staffscale=",c,0),v;if(i[0].type!=="number"){r("Expected number after staffscale",c,i[0].start);break}s.clef.staffscale=i[0].floatt,i.shift();break;case"octave":if(i.shift(),i.length===0)return r("Expected = after octave",c,0),v;if(L=i.shift(),L.token!=="="){r("Expected = after octave",c,L.start);break}if(i.length===0)return r("Expected parameter after octave=",c,0),v;if(i[0].type!=="number"){r("Expected number after octave",c,i[0].start);break}s.octave=i[0].intt,i.shift();break;case"style":if(i.shift(),i.length===0)return r("Expected = after style",c,0),v;if(L=i.shift(),L.token!=="="){r("Expected = after style",c,L.start);break}if(i.length===0)return r("Expected parameter after style=",c,0),v;switch(i[0].token){case"normal":case"harmonic":case"rhythm":case"x":case"triangle":s.style=i[0].token,i.shift();break;default:r("error parsing style element: "+i[0].token,c,i[0].start);break}break;case"clef":if(i.shift(),i.length===0)return r("Expected = after clef",c,0),v;if(L=i.shift(),L.token!=="="){r("Expected = after clef",c,L.start);break}if(i.length===0)return r("Expected parameter after clef=",c,0),v;case"treble":case"bass":case"alto":case"tenor":case"perc":case"none":var y=i.shift();switch(y.token){case"treble":case"tenor":case"alto":case"bass":case"perc":case"none":break;case"C":y.token="alto";break;case"F":y.token="bass";break;case"G":y.token="treble";break;case"c":y.token="alto";break;case"f":y.token="bass";break;case"g":y.token="treble";break;default:r("Expected clef name. Found "+y.token,c,y.start);break}i.length>0&&i[0].type==="number"&&(y.token+=i[0].token,i.shift()),i.length>1&&(i[0].token==="-"||i[0].token==="+"||i[0].token==="^"||i[0].token==="_")&&i[1].token==="8"&&(y.token+=i[0].token+i[1].token,i.shift(),i.shift()),s.clef={type:y.token,verticalPos:h(y.token,0)},s.currentVoice&&s.currentVoice.transpose!==void 0&&(s.clef.transpose=s.currentVoice.transpose),v.foundClef=!0;break;default:r("Unknown parameter: "+i[0].token,c,i[0].start),i.shift()}return v};var f=function(c){var u=s.voices[c];if(!(s.currentVoice&&s.currentVoice.index===u.index&&s.currentVoice.staffNum===u.staffNum))return s.currentVoice=u,o.setCurrentVoice(u.staffNum,u.index,c)};n.parseVoice=function(c,u,i){var v=a.getMeat(c,u,i),b=v.start,m=v.end,w=a.getToken(c,b,m);if(w.length===0){r("Expected a voice id",c,b);return}var _=!1;s.voices[w]===void 0&&(s.voices[w]={},_=!0,s.score_is_present&&r("Can't have an unknown V: id when the %score directive is present",c,b)),b+=w.length,b+=a.eatWhiteSpace(c,b);for(var T={startStaff:_},q=function(R){var y=a.getVoiceToken(c,b,m);y.warn!==void 0?r("Expected value for "+R+" in voice: "+y.warn,c,b):y.err!==void 0?r("Expected value for "+R+" in voice: "+y.err,c,b):y.token.length===0&&c[b]!=='"'?r("Expected value for "+R+" in voice",c,b):T[R]=y.token,b+=y.len},I=function(R,y,C){var A=a.getVoiceToken(c,b,m);A.warn!==void 0?r("Expected value for "+y+" in voice: "+A.warn,c,b):A.err!==void 0?r("Expected value for "+y+" in voice: "+A.err,c,b):A.token.length===0&&c[b]!=='"'?r("Expected value for "+y+" in voice",c,b):(A.token=parseFloat(A.token),s.voices[R][y]=A.token),b+=A.len},E=function(R,y){var C=a.getVoiceToken(c,b,m);if(C.warn!==void 0)r("Expected value for "+R+" in voice: "+C.warn,c,b);else if(C.err!==void 0)r("Expected value for "+R+" in voice: "+C.err,c,b);else if(C.token.length===0&&c[b]!=='"')r("Expected value for "+R+" in voice",c,b);else return C.token;b+=C.len},P=function(R,y){var C={_B:2,_E:9,_b:-10,_e:-3},A=a.getVoiceToken(c,b,m);if(A.warn!==void 0)r("Expected one of (_B, _E, _b, _e) for "+y+" in voice: "+A.warn,c,b);else if(A.token.length===0&&c[b]!=='"')r("Expected one of (_B, _E, _b, _e) for "+y+" in voice",c,b);else{var B=C[A.token];B?s.voices[R][y]=B:r("Expected one of (_B, _E, _b, _e) for "+y+" in voice",c,b)}b+=A.len};b<m;){var x=a.getVoiceToken(c,b,m);if(b+=x.len,x.warn)r("Error parsing voice: "+x.warn,c,b);else{var M=null;switch(x.token){case"clef":case"cl":q("clef");var N=0;T.clef!==void 0&&(T.clef=T.clef.replace(/[',]/g,""),T.clef.indexOf("+16")!==-1&&(N+=14,T.clef=T.clef.replace("+16","")),T.verticalPos=h(T.clef,N));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 D=0;T.clef=x.token.replace(/[',]/g,""),T.verticalPos=h(T.clef,D),s.voices[w].clef=x.token;break;case"staves":case"stave":case"stv":q("staves");break;case"brace":case"brc":q("brace");break;case"bracket":case"brk":q("bracket");break;case"name":case"nm":q("name");break;case"subname":case"sname":case"snm":q("subname");break;case"merge":T.startStaff=!1;break;case"stem":case"stems":M=a.getVoiceToken(c,b,m),M.warn!==void 0?r("Expected value for stems in voice: "+M.warn,c,b):M.err!==void 0?r("Expected value for stems in voice: "+M.err,c,b):M.token==="up"||M.token==="down"?s.voices[w].stem=M.token:r("Expected up or down for voice stem",c,b),b+=M.len;break;case"up":case"down":s.voices[w].stem=x.token;break;case"middle":case"m":q("verticalPos"),T.verticalPos=p(T.verticalPos).mid;break;case"gchords":case"gch":s.voices[w].suppressChords=!0,M=a.getVoiceToken(c,b,m),M.token==="0"&&(b=b+M.len);break;case"space":case"spc":q("spacing");break;case"scale":I(w,"scale");break;case"score":P(w,"scoreTranspose");break;case"transpose":I(w,"transpose");break;case"stafflines":I(w,"stafflines");break;case"staffscale":I(w,"staffscale");break;case"octave":I(w,"octave");break;case"volume":I(w,"volume");break;case"cue":var k=E("cue");k==="on"?s.voices[w].scale=.6:s.voices[w].scale=1;break;case"style":M=a.getVoiceToken(c,b,m),M.warn!==void 0?r("Expected value for style in voice: "+M.warn,c,b):M.err!==void 0?r("Expected value for style in voice: "+M.err,c,b):M.token==="normal"||M.token==="harmonic"||M.token==="rhythm"||M.token==="x"||M.token==="triangle"?s.voices[w].style=M.token:r("Expected one of [normal, harmonic, rhythm, x, triangle] for voice style",c,b),b+=M.len;break}}b+=a.eatWhiteSpace(c,b)}if((T.startStaff||s.staves.length===0)&&(s.staves.push({index:s.staves.length,meter:s.origMeter}),s.score_is_present||(s.staves[s.staves.length-1].numVoices=0)),s.voices[w].staffNum===void 0){s.voices[w].staffNum=s.staves.length-1;var S=0;for(var z in s.voices)s.voices.hasOwnProperty(z)&&s.voices[z].staffNum===s.voices[w].staffNum&&S++;s.voices[w].index=S-1}var L=s.staves[s.voices[w].staffNum];return s.score_is_present||L.numVoices++,T.clef&&(L.clef={type:T.clef,verticalPos:T.verticalPos}),T.spacing&&(L.spacing_below_offset=T.spacing),T.verticalPos&&(L.verticalPos=T.verticalPos),T.name&&(L.name?L.name.push(T.name):L.name=[T.name]),T.subname&&(L.subname?L.subname.push(T.subname):L.subname=[T.subname]),f(w)}})(),Br=n,Br}var Lr,Wi;function Cg(){if(Wi)return Lr;Wi=1;var e=at(),t=Ka(),n=Ja(),a=function(r,s,o,l,h){this.reset=function(d,f,c,u){n.initialize(d,f,c,u,h),t.initialize(d,f,c,u,h)},this.reset(r,s,o,l),this.setTitle=function(d,f){o.hasMainTitle?h.addSubtitle(d,{startChar:o.iChar,endChar:o.iChar+f+2}):(h.addMetaText("title",d,{startChar:o.iChar,endChar:o.iChar+f+2}),o.hasMainTitle=!0)},this.setMeter=function(d){if(d=r.stripComment(d),d==="C")return o.havent_set_length===!0&&(o.default_length=.125,o.havent_set_length=!1),{type:"common_time"};if(d==="C|")return o.havent_set_length===!0&&(o.default_length=.125,o.havent_set_length=!1),{type:"cut_time"};if(d==="o")return o.havent_set_length===!0&&(o.default_length=.125,o.havent_set_length=!1),{type:"tempus_perfectum"};if(d==="c")return o.havent_set_length===!0&&(o.default_length=.125,o.havent_set_length=!1),{type:"tempus_imperfectum"};if(d==="o.")return o.havent_set_length===!0&&(o.default_length=.125,o.havent_set_length=!1),{type:"tempus_perfectum_prolatio"};if(d==="c.")return o.havent_set_length===!0&&(o.default_length=.125,o.havent_set_length=!1),{type:"tempus_imperfectum_prolatio"};if(d.length===0||d.toLowerCase()==="none")return o.havent_set_length===!0&&(o.default_length=.125,o.havent_set_length=!1),null;var f=r.tokenize(d,0,d.length);try{var c=function(){var w={value:0,num:""},_=f.shift();for(_.token==="("&&(_=f.shift());;){if(_.type!=="number")throw"Expected top number of meter";if(w.value+=parseInt(_.token),w.num+=_.token,f.length===0||f[0].token==="/")return w;if(_=f.shift(),_.token===")"){if(f.length===0||f[0].token==="/")return w;throw"Unexpected paren in meter"}if(_.token!=="."&&_.token!=="+"||(w.num+=_.token,f.length===0))throw"Expected top number of meter";_=f.shift()}return w},u=function(){var w=c();if(f.length===0)return w;var _=f.shift();if(_.token!=="/")throw"Expected slash in meter";if(_=f.shift(),_.type!=="number")throw"Expected bottom number of meter";return w.den=_.token,w.value=w.value/parseInt(w.den),w};if(f.length===0)throw"Expected meter definition in M: line";for(var i={type:"specified",value:[]},v=0;;){var b=u();v+=b.value;var m={num:b.num};if(b.den!==void 0&&(m.den=b.den),i.value.push(m),f.length===0)break}return o.havent_set_length===!0&&(o.default_length=v<.75?.0625:.125,o.havent_set_length=!1),i}catch(w){s(w,d,0)}return null},this.calcTempo=function(d){var f=.25;o.meter&&o.meter.type==="specified"?f=1/parseInt(o.meter.value[0].den):o.origMeter&&o.origMeter.type==="specified"&&(f=1/parseInt(o.origMeter.value[0].den));for(var c=0;c<d.duration;c++)d.duration[c]=f*d.duration[c];return d},this.resolveTempo=function(){o.tempo&&(this.calcTempo(o.tempo),l.metaText.tempo=o.tempo,delete o.tempo)},this.addUserDefinition=function(d,f,c){var u=d.indexOf("=",f);if(u===-1){s("Need an = in a macro definition",d,f);return}var i=e.strip(d.substring(f,u)),v=e.strip(d.substring(u+1));if(i.length!==1){s("Macro definitions can only be one character",d,f);return}var b="HIJKLMNOPQRSTUVWXYhijklmnopqrstuvw~";if(b.indexOf(i)===-1){s("Macro definitions must be H-Y, h-w, or tilde",d,f);return}if(v.length===0){s("Missing macro definition",d,f);return}o.macros===void 0&&(o.macros={}),o.macros[i]=v},this.setDefaultLength=function(d,f,c){var u=d.substring(f,c).replace(/ /g,""),i=u.split("/");if(i.length===2){var v=parseInt(i[0]),b=parseInt(i[1]);b>0&&(o.default_length=v/b,o.havent_set_length=!1)}else i.length===1&&i[0]==="1"&&(o.default_length=1,o.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(d,f,c,u){try{var i=r.tokenize(d,f,c);if(i.length===0)throw"Missing parameter in Q: field";var v={startChar:u+f-2,endChar:u+c},b=!0,m=i.shift();if(m.type==="quote"&&(v.preString=m.token,m=i.shift(),i.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(i.length===0)throw"Missing tempo after C in Q: field";if(m=i.shift(),m.type==="punct"&&m.token==="="){if(i.length===0)throw"Missing tempo after = in Q: field";if(m=i.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)],i.length===0)throw"Missing = after duration in Q: field";if(m=i.shift(),m.type!=="punct"||m.token!=="=")throw"Expected = after duration in Q: field";if(i.length===0)throw"Missing tempo after = in Q: field";if(m=i.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 w=parseInt(m.token);if(i.length===0||i[0].type==="quote")v.duration=[1],v.bpm=w;else{if(b=!1,m=i.shift(),m.type!=="punct"&&m.token!=="/"||(m=i.shift(),m.type!=="number"))throw"Expected fraction in Q: field";var _=parseInt(m.token);for(v.duration=[w/_];i.length>0&&i[0].token!=="="&&i[0].type!=="quote";){if(m=i.shift(),m.type!=="number"||(w=parseInt(m.token),m=i.shift(),m.type!=="punct"&&m.token!=="/")||(m=i.shift(),m.type!=="number"))throw"Expected fraction in Q: field";_=parseInt(m.token),v.duration.push(w/_)}if(m=i.shift(),m.type!=="punct"&&m.token!=="=")throw"Expected = in Q: field";if(m=i.shift(),m.type!=="number")throw"Expected tempo in Q: field";v.bpm=parseInt(m.token)}}else throw"Unknown value in Q: field";if(i.length!==0&&(m=i.shift(),m.type==="quote"&&(v.postString=m.token,m=i.shift()),i.length!==0))throw"Unexpected string at end of Q: field";return o.printTempo===!1&&(v.suppress=!0),{type:b?"delaySet":"immediate",tempo:v}}catch(T){return s(T,d,f),{type:"none"}}},this.letter_to_inline_header=function(d,f,c){var u=!1,i=r.eatWhiteSpace(d,f);if(f+=i,d.length>=f+5&&d[f]==="["&&d[f+2]===":"){var v=d.indexOf("]",f),b=o.iChar+f,m=o.iChar+v+1;switch(d.substring(f,f+3)){case"[I:":var w=t.addDirective(d.substring(f+3,v));return w&&s(w,d,f),[v-f+1+i];case"[M:":var _=this.setMeter(d.substring(f+3,v));return h.hasBeginMusic()&&_?h.appendStartingElement("meter",b,m,_):o.meter=_,[v-f+1+i];case"[K:":var T=n.parseKey(d.substring(f+3,v),!0);return T.foundClef&&h.hasBeginMusic()&&h.appendStartingElement("clef",b,m,o.clef),T.foundKey&&h.hasBeginMusic()&&h.appendStartingElement("key",b,m,n.fixKey(o.clef,o.key)),[v-f+1+i];case"[P:":var q=t.parseFontChangeLine(d.substring(f+3,v));return c||l.lines.length<=l.lineNum?o.partForNextLine={title:q,startChar:b,endChar:m}:h.appendElement("part",b,m,{title:q}),[v-f+1+i];case"[L:":return this.setDefaultLength(d,f+3,v),[v-f+1+i];case"[Q:":if(v>0){var I=this.setTempo(d,f+3,v,o.iChar);return I.type==="delaySet"?h.hasBeginMusic()?h.appendElement("tempo",b,m,this.calcTempo(I.tempo)):o.tempoForNextLine=["tempo",b,m,this.calcTempo(I.tempo)]:I.type==="immediate"&&(!c&&h.hasBeginMusic()?h.appendElement("tempo",b,m,I.tempo):o.tempoForNextLine=["tempo",b,m,I.tempo]),[v-f+1+i,d[f+1],d.substring(f+3,v)]}break;case"[V:":if(v>0)return u=n.parseVoice(d,f+3,v),[v-f+1+i,d[f+1],d.substring(f+3,v),u];break;case"[r:":return[v-f+1+i]}}return[0]},this.letter_to_body_header=function(d,f){var c=!1;if(d.length>=f+3)switch(d.substring(f,f+2)){case"I:":var u=t.addDirective(d.substring(f+2));return u&&s(u,d,f),[d.length];case"M:":var i=this.setMeter(d.substring(f+2));return h.hasBeginMusic()&&i&&h.appendStartingElement("meter",o.iChar+f,o.iChar+d.length,i),[d.length];case"K:":var v=n.parseKey(d.substring(f+2),h.hasBeginMusic());return v.foundClef&&h.hasBeginMusic()&&o.keywarn!==!1&&h.appendStartingElement("clef",o.iChar+f,o.iChar+d.length,o.clef),v.foundKey&&h.hasBeginMusic()&&o.keywarn!==!1&&h.appendStartingElement("key",o.iChar+f,o.iChar+d.length,n.fixKey(o.clef,o.key)),[d.length];case"P:":return h.hasBeginMusic()&&h.appendElement("part",o.iChar+f,o.iChar+d.length,{title:d.substring(f+2)}),[d.length];case"L:":return this.setDefaultLength(d,f+2,d.length),[d.length];case"Q:":var b=d.indexOf("",f+2);b===-1&&(b=d.length);var m=this.setTempo(d,f+2,b,o.iChar);return m.type==="delaySet"?h.appendElement("tempo",o.iChar+f,o.iChar+d.length,this.calcTempo(m.tempo)):m.type==="immediate"&&h.appendElement("tempo",o.iChar+f,o.iChar+d.length,m.tempo),[b,d[f],e.strip(d.substring(f+2))];case"V:":return c=n.parseVoice(d,f+2,d.length),[d.length,d[f],e.strip(d.substring(f+2)),c]}return[0]};var p={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(d){var f=p[d[0]],c=d.length-2,u=r.translateString(r.stripComment(d.substring(2)));if(f==="unalignedWords"||f==="notes")h.addMetaTextArray(f,t.parseFontChangeLine(u),{startChar:o.iChar,endChar:o.iChar+d.length});else if(f!==void 0)h.addMetaText(f,t.parseFontChangeLine(u),{startChar:o.iChar,endChar:o.iChar+d.length});else{var i=o.iChar,v=i+d.length;switch(d[0]){case"H":for(h.addMetaTextArray("history",t.parseFontChangeLine(u),{startChar:o.iChar,endChar:o.iChar+d.length}),d=r.peekLine();d&&d[1]!==":";)r.nextLine(),h.addMetaTextArray("history",t.parseFontChangeLine(r.translateString(r.stripComment(d))),{startChar:o.iChar,endChar:o.iChar+d.length}),d=r.peekLine();break;case"K":this.resolveTempo();var b=n.parseKey(d.substring(2),!1);!o.is_in_header&&h.hasBeginMusic()&&o.keywarn!==!1&&(b.foundClef&&h.appendStartingElement("clef",i,v,o.clef),b.foundKey&&h.appendStartingElement("key",i,v,n.fixKey(o.clef,o.key))),o.is_in_header=!1;break;case"L":this.setDefaultLength(d,2,d.length);break;case"M":o.origMeter=o.meter=this.setMeter(d.substring(2));break;case"P":o.is_in_header?h.addMetaText("partOrder",t.parseFontChangeLine(u),{startChar:o.iChar,endChar:o.iChar+d.length}):o.partForNextLine={title:u,startChar:i,endChar:v};break;case"Q":var m=this.setTempo(d,2,d.length,o.iChar);m.type==="delaySet"?o.tempo=m.tempo:m.type==="immediate"&&(l.metaText.tempo?o.tempoForNextLine=["tempo",i,v,m.tempo]:l.metaText.tempo=m.tempo);break;case"T":o.titlecaps&&(u=u.toUpperCase()),this.setTitle(t.parseFontChangeLine(r.theReverser(u)),c);break;case"U":this.addUserDefinition(d,2,d.length);break;case"V":if(n.parseVoice(d,2,d.length),!o.is_in_header)return{newline:!0};break;case"s":return{symbols:!0};case"w":return{words:!0};case"X":break;case"E":case"m":s("Ignored header",d,0);break;default:return{regular:!0}}}return{}}};return Lr=a,Lr}var Ke={},Vi;function Sg(){return Vi||(Vi=1,Ke.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"],Ke.volumeDecorations=["p","pp","f","ff","mf","mp","ppp","pppp","fff","ffff","sfz"],Ke.dynamicDecorations=["crescendo(","crescendo)","diminuendo(","diminuendo)","glissando(","glissando)","~(","~)"],Ke.accentPseudonyms=[["<","accent"],[">","accent"],["tr","trill"],["plus","+"],["emphasis","accent"],["^","umarcato"],["marcato","umarcato"]],Ke.accentDynamicPseudonyms=[["<(","crescendo("],["<)","crescendo)"],[">(","diminuendo("],[">)","diminuendo)"]],Ke.nonDecorations="ABCDEFGabcdefgxyzZ[]|^_{",Ke.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],Ke.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},Ke.rests={x:"invisible",X:"invisible-multimeasure",y:"spacer",z:"rest",Z:"multimeasure"},Ke.accMap={dblflat:"__",flat:"_",natural:"=",sharp:"^",dblsharp:"^^",quarterflat:"_/",quartersharp:"^/"},Ke.tripletQ={2:3,3:2,4:3,5:2,6:2,7:2,8:3,9:2}),Ke}var Or,Xi;function Tg(){if(Xi)return Or;Xi=1;var e=Ja(),t=Rl(),n,a,r,s,o,l,{legalAccents:h,volumeDecorations:g,dynamicDecorations:p,accentPseudonyms:d,accentDynamicPseudonyms:f,nonDecorations:c,durations:u,pitches:i,rests:v,accMap:b,tripletQ:m}=Sg(),w=function(y,C,A,B,O,$){n=y,a=C,r=A,s=B,o=O,l=$,this.lineContinuation=!1},_=function(y,C,A){if(y.inTie[C]===void 0)return!1;var B=y.currentVoice?y.currentVoice.staffNum*100+y.currentVoice.index:0;return!!(y.inTie[C][B]&&(A.pitches!==void 0||A.rest.type!=="spacer"))},T={};w.prototype.parseMusic=function(y){l.resolveTempo(),r.is_in_header=!1;for(var C=0,A=r.iChar;n.isWhiteSpace(y[C])&&C<y.length;)C++;if(!(C===y.length||y[C]==="%")){var B=r.start_new_line;r.continueall===void 0?r.start_new_line=!0:r.start_new_line=!1;var O=0,$=l.letter_to_body_header(y,C);$[0]>0&&(C+=$[0],$[1]==="V"&&this.startNewLine());for(var F=0;C<y.length;){var W=C;if(y[C]==="%")break;var te=l.letter_to_inline_header(y,C,B);if(te[0]>0)C+=te[0],te[1]==="V"&&(B=!0);else{(!o.hasBeginMusic()||B&&!this.lineContinuation)&&(this.startNewLine(),B=!1);for(var J;;)if(J=n.eatWhiteSpace(y,C),J>0&&(C+=J),C>0&&y[C-1]===""&&(J=l.letter_to_body_header(y,C),J[0]>0&&(J[1]==="V"&&this.startNewLine(),C=J[0],r.start_new_line=!1)),J=N(y,C),J[0]>0&&(C+=J[0]),J=I(y,C),J[0]>0){T.chord||(T.chord=[]);var ie=n.translateString(J[1]);ie=ie.replace(/;/g,`
87
+ `);for(var re=!1,oe=0;oe<T.chord.length;oe++)T.chord[oe].position===J[2]&&(re=!0,T.chord[oe].name+=`
88
+ `+ie);re===!1&&(J[2]===null&&J[3]?T.chord.push({name:ie,rel_position:J[3]}):T.chord.push({name:ie,position:J[2]})),C+=J[0];var X=n.skipWhiteSpace(y.substring(C));X>0&&(T.force_end_beam_last=!0),C+=X}else if(c.indexOf(y[C])===-1?J=M(y,C):J=[0],J[0]>0)J[1]===null?C+1<y.length&&this.startNewLine():J[1].length>0&&(J[1].indexOf("style=")===0?T.style=J[1].substr(6):(T.decoration===void 0&&(T.decoration=[]),J[1]==="beambr1"?T.beambr=1:J[1]==="beambr2"?T.beambr=2:T.decoration.push(J[1]))),C+=J[0];else if(J=E(y,C),J[0]>0)T.gracenotes=J[1],C+=J[0];else break;if(J=D(y,C),J[0]>0){F=0,T.gracenotes!==void 0&&(T.rest={type:"spacer"},T.duration=.125,r.addFormattingOptions(T,s.formatting,"note"),o.appendElement("note",A+C,A+C+J[0],T),r.measureNotEmpty=!0,T={});var ne={type:J[1]};ne.type.length===0?a("Unknown bar type",y,C):(r.inEnding&&ne.type!=="bar_thin"&&(ne.endEnding=!0,r.inEnding=!1),J[2]&&(ne.startEnding=J[2],r.inEnding&&(ne.endEnding=!0),r.inEnding=!0,J[1]==="bar_right_repeat"?r.restoreStartEndingHoldOvers():r.duplicateStartEndingHoldOvers()),T.decoration!==void 0&&(ne.decoration=T.decoration),T.chord!==void 0&&(ne.chord=T.chord),ne.startEnding&&r.barFirstEndingNum===void 0?r.barFirstEndingNum=r.currBarNumber:ne.startEnding&&ne.endEnding&&r.barFirstEndingNum?r.currBarNumber=r.barFirstEndingNum:ne.endEnding&&(r.barFirstEndingNum=void 0),ne.type!=="bar_invisible"&&r.measureNotEmpty&&R()&&(r.currBarNumber++,r.barNumbers&&r.currBarNumber%r.barNumbers===0&&(ne.barNumber=r.currBarNumber)),r.addFormattingOptions(T,s.formatting,"bar"),o.appendElement("bar",A+W,A+C+J[0],ne),r.measureNotEmpty=!1,T={}),C+=J[0]}else if(y[C]==="&")J=P(y,C),J[0]>0&&(o.appendElement("overlay",A,A+1,{}),C+=1,F++);else{if(J=k(y,C),J.consumed>0&&(J.startSlur!==void 0&&(T.startSlur=J.startSlur),J.dottedSlur&&(T.dottedSlur=!0),J.triplet!==void 0&&(O>0?a("Can't nest triplets",y,C):(T.startTriplet=J.triplet,T.tripletMultiplier=J.tripletQ/J.triplet,T.tripletR=J.num_notes,O=J.num_notes===void 0?J.triplet:J.num_notes)),C+=J.consumed),y[C]==="["){C++;for(var ee=null,he=!1,de=!1;!de;){var Te=M(y,C);Te[0]>0&&(C+=Te[0]);var _e=z(y,C,{},!1);if(_e!==null&&_e.pitch!==void 0)Te[0]>0&&Te[1].indexOf("style=")!==0&&(T.decoration===void 0&&(T.decoration=[]),T.decoration.push(Te[1])),_e.end_beam&&(T.end_beam=!0,delete _e.end_beam),T.pitches===void 0?(T.duration=_e.duration,T.pitches=[_e]):T.pitches.push(_e),delete _e.duration,Te[0]>0&&Te[1].indexOf("style=")===0&&(T.pitches[T.pitches.length-1].style=Te[1].substr(6)),r.inTieChord[T.pitches.length]&&(_e.endTie=!0,r.inTieChord[T.pitches.length]=void 0),_e.startTie&&(r.inTieChord[T.pitches.length]=!0),C=_e.endChar,delete _e.endChar;else if(y[C]===" ")a("Spaces are not allowed in chords",y,C),C++;else{if(C<y.length&&y[C]==="]"){C++,r.next_note_duration!==0&&(T.duration=T.duration*r.next_note_duration,r.next_note_duration=0),_(r,F,T)&&(T.pitches.forEach(function(Q){Q.endTie=!0}),q(r,F,!1)),O>0&&!(T.rest&&T.rest.type==="spacer")&&(O--,O===0&&(T.endTriplet=!0));for(var qe=!1;C<y.length&&!qe;){switch(y[C]){case" ":case" ":S(T);break;case")":T.endSlur===void 0?T.endSlur=1:T.endSlur++;break;case"-":T.pitches.forEach(function(Q){Q.startTie={}}),q(r,F,!0);break;case">":case"<":var ze=L(y,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 De=n.getFraction(y,C);ee=De.value,C=De.index;var G=y[C];G===" "&&(he=!0),G==="-"||G===")"||G===" "||G==="<"||G===">"?C--:qe=!0;break;case"0":ee=0;break;default:qe=!0;break}qe||C++}}else a("Expected ']' to end the chords",y,C);T.pitches!==void 0&&(ee!==null&&(T.duration=T.duration*ee,he&&S(T)),r.addFormattingOptions(T,s.formatting,"note"),o.appendElement("note",A+W,A+C,T),r.measureNotEmpty=!0,T={}),de=!0}}}else{var V={},H=z(y,C,V,!0);if(V.endTie!==void 0&&q(r,F,!0),H!==null){H.pitch!==void 0?(T.pitches=[{}],H.accidental!==void 0&&(T.pitches[0].accidental=H.accidental),T.pitches[0].pitch=H.pitch,T.pitches[0].name=H.name,(H.midipitch||H.midipitch===0)&&(T.pitches[0].midipitch=H.midipitch),H.endSlur!==void 0&&(T.pitches[0].endSlur=H.endSlur),H.endTie!==void 0&&(T.pitches[0].endTie=H.endTie),H.startSlur!==void 0&&(T.pitches[0].startSlur=H.startSlur),T.startSlur!==void 0&&(T.pitches[0].startSlur=T.startSlur),T.dottedSlur!==void 0&&(T.pitches[0].dottedSlur=!0),H.startTie!==void 0&&(T.pitches[0].startTie=H.startTie),T.startTie!==void 0&&(T.pitches[0].startTie=T.startTie)):(T.rest=H.rest,H.rest.type==="multimeasure"&&R()&&(r.currBarNumber+=H.rest.text-1),H.endSlur!==void 0&&(T.endSlur=H.endSlur),H.endTie!==void 0&&(T.rest.endTie=H.endTie),H.startSlur!==void 0&&(T.startSlur=H.startSlur),H.startTie!==void 0&&(T.rest.startTie=H.startTie),T.startTie!==void 0&&(T.rest.startTie=T.startTie)),H.chord!==void 0&&(T.chord=H.chord),H.duration!==void 0&&(T.duration=H.duration),H.decoration!==void 0&&(T.decoration=H.decoration),H.graceNotes!==void 0&&(T.graceNotes=H.graceNotes),delete T.startSlur,delete T.dottedSlur,_(r,F,T)&&(T.pitches!==void 0?T.pitches[0].endTie=!0:T.rest.type!=="spacer"&&(T.rest.endTie=!0),q(r,F,!1)),(H.startTie||T.startTie)&&q(r,F,!0),C=H.endChar,O>0&&!(H.rest&&H.rest.type==="spacer")&&(O--,O===0&&(T.endTriplet=!0)),H.end_beam&&S(T),T.rest&&T.rest.type==="rest"&&T.duration===1&&x(r)<=1&&(T.rest.type="whole",T.duration=x(r)),T.duration<1&&u.indexOf(T.duration)===-1&&T.duration!==0&&(!T.rest||T.rest.type!=="spacer")&&a("Duration not representable: "+y.substring(W,C),y,C),r.addFormattingOptions(T,s.formatting,"note");var U=o.appendElement("note",A+W,A+C,T);U||(this.startNewLine(),o.appendElement("note",A+W,A+C,T)),r.measureNotEmpty=!0,T={}}}C===W&&(y[C]!==" "&&y[C]!=="`"&&a("Unknown character ignored",y,C),C++)}}}this.lineContinuation=y.indexOf("")>=0||$[0]>0,this.lineContinuation||(T={})}};var q=function(y,C,A){var B=y.currentVoice?y.currentVoice.staffNum*100+y.currentVoice.index:0;y.inTie[C]===void 0&&(y.inTie[C]=[]),y.inTie[C][B]=A},I=function(y,C){if(y[C]==='"'){var A=n.getBrackettedSubstring(y,C,5);if(A[2]||a("Missing the closing quote while parsing the chord symbol",y,C),A[0]>0&&A[1].length>0&&A[1][0]==="^")A[1]=A[1].substring(1),A[2]="above";else if(A[0]>0&&A[1].length>0&&A[1][0]==="_")A[1]=A[1].substring(1),A[2]="below";else if(A[0]>0&&A[1].length>0&&A[1][0]==="<")A[1]=A[1].substring(1),A[2]="left";else if(A[0]>0&&A[1].length>0&&A[1][0]===">")A[1]=A[1].substring(1),A[2]="right";else if(A[0]>0&&A[1].length>0&&A[1][0]==="@"){A[1]=A[1].substring(1);var B=n.getFloat(A[1]);if(B.digits===0)return a("Missing first position in absolutely positioned annotation.",y,C),A[1]=A[1].replace("@",""),A[2]="above",A;if(A[1]=A[1].substring(B.digits),A[1][0]!==",")return a("Missing comma absolutely positioned annotation.",y,C),A[1]=A[1].replace("@",""),A[2]="above",A;A[1]=A[1].substring(1);var O=n.getFloat(A[1]);if(O.digits===0)return a("Missing second position in absolutely positioned annotation.",y,C),A[1]=A[1].replace("@",""),A[2]="above",A;A[1]=A[1].substring(O.digits);var $=n.skipWhiteSpace(A[1]);A[1]=A[1].substring($),A[2]=null,A[3]={x:B.value,y:O.value}}else r.freegchord!==!0&&(A[1]=A[1].replace(/([ABCDEFG0-9])b/g,"$1♭"),A[1]=A[1].replace(/([ABCDEFG0-9])#/g,"$1♯"),A[1]=A[1].replace(/^([ABCDEFG])([♯♭]?)o([^A-Za-z])/g,"$1$2°$3"),A[1]=A[1].replace(/^([ABCDEFG])([♯♭]?)o$/g,"$1$2°"),A[1]=A[1].replace(/^([ABCDEFG])([♯♭]?)0([^A-Za-z])/g,"$1$2ø$3"),A[1]=A[1].replace(/^([ABCDEFG])([♯♭]?)\^([^A-Za-z])/g,"$1$2∆$3")),A[2]="default",A[1]=t.chordName(r,A[1]);return A}return[0,""]},E=function(y,C){if(y[C]==="{"){var A=n.getBrackettedSubstring(y,C,1,"}");A[2]||a("Missing the closing '}' while parsing grace note",y,C),y[C+A[0]]===")"&&(A[0]++,A[1]+=")");for(var B=[],O=0,$=!1;O<A[1].length;){var F=!1;A[1][O]==="/"&&(F=!0,O++);var W=z(A[1],O,{},!1);W!==null?(W.duration=W.duration/(r.default_length*8),F&&(W.acciaccatura=!0),W.rest?a("Rests not allowed as grace notes '"+A[1][O]+"' while parsing grace note",y,C):B.push(W),$&&(W.endTie=!0,$=!1),W.startTie&&($=!0),O=W.endChar,delete W.endChar,W.end_beam&&(W.endBeam=!0,delete W.end_beam)):(A[1][O]===" "?B.length>0&&(B[B.length-1].endBeam=!0):a("Unknown character '"+A[1][O]+"' while parsing grace note",y,C),O++)}if(B.length)return[A[0],B]}return[0]};function P(y,C){if(y[C]==="&"){for(var A=C;y[C]&&y[C]!==":"&&y[C]!=="|";)C++;return[C-A,y.substring(A+1,C)]}return[0]}function x(y){var C=y.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(y,C){var A=r.macros[y[C]];if(A!==void 0)return(A[0]==="!"||A[0]==="+")&&(A=A.substring(1)),(A[A.length-1]==="!"||A[A.length-1]==="+")&&(A=A.substring(0,A.length-1)),h.includes(A)?[1,A]:g.includes(A)?(r.volumePosition==="hidden"&&(A=""),[1,A]):p.includes(A)?(r.dynamicPosition==="hidden"&&(A=""),[1,A]):(r.ignoredDecorations.includes(A)||a("Unknown macro: "+A,y,C),[1,""]);switch(y[C]){case".":if(y[C+1]==="("||y[C+1]==="-")break;return[1,"staccato"];case"u":return[1,"upbow"];case"v":return[1,"downbow"];case"~":return[1,"irishroll"];case"!":case"+":var B=n.getBrackettedSubstring(y,C,5);if(B[1].length>1&&(B[1][0]==="^"||B[1][0]==="_")&&(B[1]=B[1].substring(1)),h.includes(B[1]))return B;if(g.includes(B[1]))return r.volumePosition==="hidden"&&(B[1]=""),B;if(p.includes(B[1]))return r.dynamicPosition==="hidden"&&(B[1]=""),B;var O=d.findIndex(function($){return B[1]===$[0]});return O>=0?(B[1]=d[O][1],B):(O=f.findIndex(function($){return B[1]===$[0]}),O>=0?(B[1]=f[O][1],r.dynamicPosition==="hidden"&&(B[1]=""),B):y[C]==="!"&&(B[0]===1||y[C+B[0]-1]!=="!")?[1,null]:(a("Unknown decoration: "+B[1],y,C),B[1]="",B));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]},N=function(y,C){for(var A=C;n.isWhiteSpace(y[C]);)C++;return[C-A]},D=function(y,C){var A=n.getBarLine(y,C);if(A.len===0)return[0,""];if(A.warn)return a(A.warn,y,C),[A.len,""];for(var B=0;B<y.length&&y[C+A.len+B]===" ";B++);var O=A.len;if(y[C+A.len+B]==="["&&(A.len+=B+1),y[C+A.len]==='"'&&y[C+A.len-1]==="["){var $=n.getBrackettedSubstring(y,C+A.len,5);return[A.len+$[0],A.token,$[1]]}var F=n.getTokenOf(y.substring(C+A.len),"1234567890-,");return F.len===0||F.token[0]==="-"?[O,A.token]:[A.len+F.len,A.token,F.token]},k=function(y,C){var A={},B=C;for(y[C]==="."&&y[C+1]==="("&&(A.dottedSlur=!0,C++);y[C]==="("||n.isWhiteSpace(y[C]);)y[C]==="("&&(C+1<y.length&&y[C+1]>="2"&&y[C+1]<="9"?(A.triplet!==void 0?a("Can't nest triplets",y,C):(A.triplet=y[C+1]-"0",A.tripletQ=m[A.triplet],A.num_notes=A.triplet,C+2<y.length&&y[C+2]===":"&&(C+3<y.length&&y[C+3]===":"?C+4<y.length&&y[C+4]>="1"&&y[C+4]<="9"?(A.num_notes=y[C+4]-"0",C+=3):a("expected number after the two colons after the triplet to mark the duration",y,C):C+3<y.length&&y[C+3]>="1"&&y[C+3]<="9"?(A.tripletQ=y[C+3]-"0",C+4<y.length&&y[C+4]===":"?C+5<y.length&&y[C+5]>="1"&&y[C+5]<="9"&&(A.num_notes=y[C+5]-"0",C+=4):C+=2):a("expected number after the triplet to mark the duration",y,C))),C++):A.startSlur===void 0?A.startSlur=1:A.startSlur++),C++;return A.consumed=C-B,A};w.prototype.startNewLine=function(){var y={startChar:-1,endChar:-1};r.partForNextLine.title&&(y.part=r.partForNextLine),y.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(y.key=e.standardKey(r.key.root+r.key.acc+r.key.mode,r.key.root,r.key.acc,C),y.key.mode=r.key.mode,r.key.impliedNaturals&&(y.key.impliedNaturals=r.key.impliedNaturals),r.key.explicitAccidentals)for(var A=0;A<r.key.explicitAccidentals.length;A++){for(var B=!1,O=0;O<y.key.accidentals.length;O++)y.key.accidentals[O].note===r.key.explicitAccidentals[A].note&&(y.key.accidentals[O].acc=r.key.explicitAccidentals[A].acc,B=!0);B||y.key.accidentals.push(r.key.explicitAccidentals[A])}if(r.targetKey=y.key,y.key.explicitAccidentals&&delete y.key.explicitAccidentals,e.addPosToKey(y.clef,y.key),r.meter!==null?(r.currentVoice?(r.staves.forEach(function(te){te.meter=r.meter}),y.meter=r.staves[r.currentVoice.staffNum].meter,r.staves[r.currentVoice.staffNum].meter=null):y.meter=r.meter,r.meter=null):r.currentVoice&&r.staves[r.currentVoice.staffNum].meter&&(y.meter=r.staves[r.currentVoice.staffNum].meter,r.staves[r.currentVoice.staffNum].meter=null),r.currentVoice&&r.currentVoice.name&&(y.name=r.currentVoice.name),r.vocalfont&&(y.vocalfont=r.vocalfont),r.tripletfont&&(y.tripletfont=r.tripletfont),r.gchordfont&&(y.gchordfont=r.gchordfont),r.style&&(y.style=r.style),r.currentVoice){var $=r.staves[r.currentVoice.staffNum];$.brace&&(y.brace=$.brace),$.bracket&&(y.bracket=$.bracket),$.connectBarLines&&(y.connectBarLines=$.connectBarLines),$.name&&(y.name=$.name[r.currentVoice.index]),$.subname&&(y.subname=$.subname[r.currentVoice.index]),r.currentVoice.stem&&(y.stem=r.currentVoice.stem),r.currentVoice.stafflines&&(y.stafflines=r.currentVoice.stafflines),r.currentVoice.staffscale&&(y.staffscale=r.currentVoice.staffscale),r.currentVoice.scale&&(y.scale=r.currentVoice.scale),r.currentVoice.color&&(y.color=r.currentVoice.color),r.currentVoice.style&&(y.style=r.currentVoice.style),r.currentVoice.transpose&&(y.clef.transpose=r.currentVoice.transpose),y.currentVoice=r.currentVoice;for(var F=Object.keys(r.voices),W=0;W<F.length;W++)y.currentVoice.staffNum===r.voices[F[W]].staffNum&&y.currentVoice.index===r.voices[F[W]].index&&(y.currentVoiceName=F[W])}r.barNumbers===0&&R()&&r.currBarNumber!==1&&(y.barNumber=r.currBarNumber),o.startNewLine(y),r.key.impliedNaturals&&delete r.key.impliedNaturals,r.partForNextLine={},r.tempoForNextLine.length===4&&o.appendElement(r.tempoForNextLine[0],r.tempoForNextLine[1],r.tempoForNextLine[2],r.tempoForNextLine[3]),r.tempoForNextLine=[]};var S=function(y){return y.duration!==void 0&&y.duration<.25&&(y.end_beam=!0),y},z=function(y,C,A,B){var O=function(oe){return oe==="octave"||oe==="duration"||oe==="Zduration"||oe==="broken_rhythm"||oe==="end_slur"},$;y[C]==="."&&y[C+1]==="-"&&($=!0,C++);for(var F="startSlur",W=!1;;){switch(y[C]){case"(":if(F==="startSlur")A.startSlur===void 0?A.startSlur=1:A.startSlur++;else return O(F)?(A.endChar=C,A):null;break;case")":if(O(F))A.endSlur===void 0?A.endSlur=1:A.endSlur++;else return null;break;case"^":if(F==="startSlur")A.accidental="sharp",F="sharp2";else if(F==="sharp2")A.accidental="dblsharp",F="pitch";else return O(F)?(A.endChar=C,A):null;break;case"_":if(F==="startSlur")A.accidental="flat",F="flat2";else if(F==="flat2")A.accidental="dblflat",F="pitch";else return O(F)?(A.endChar=C,A):null;break;case"=":if(F==="startSlur")A.accidental="natural",F="pitch";else return O(F)?(A.endChar=C,A):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(A.pitch=i[y[C]],A.pitch+=7*(r.currentVoice&&r.currentVoice.octave!==void 0?r.currentVoice.octave:r.octave),A.name=y[C],A.accidental&&(A.name=b[A.accidental]+A.name),t.note(r,A),F="octave",B&&r.next_note_duration!==0?(A.duration=r.default_length*r.next_note_duration,r.next_note_duration=0,W=!0):A.duration=r.default_length,r.clef&&r.clef.type==="perc"||r.currentVoice&&r.currentVoice.clef==="perc"){var te=y[C];A.accidental&&(te=b[A.accidental]+te),s.formatting&&s.formatting.midi&&s.formatting.midi.drummap&&(A.midipitch=s.formatting.midi.drummap[te])}}else return O(F)?(A.endChar=C,A):null;break;case",":if(F==="octave")A.pitch-=7,A.name+=",";else return O(F)?(A.endChar=C,A):null;break;case"'":if(F==="octave")A.pitch+=7,A.name+="'";else return O(F)?(A.endChar=C,A):null;break;case"x":case"X":case"y":case"z":case"Z":if(F==="startSlur")A.rest={type:v[y[C]]},delete A.accidental,delete A.startSlur,delete A.startTie,delete A.endSlur,delete A.endTie,delete A.end_beam,delete A.grace_notes,A.rest.type.indexOf("multimeasure")>=0?(A.duration=s.getBarLength(),A.rest.text=1,F="Zduration"):(B&&r.next_note_duration!==0?(A.duration=r.default_length*r.next_note_duration,r.next_note_duration=0,W=!0):A.duration=r.default_length,F="duration");else return O(F)?(A.endChar=C,A):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 J=n.getFraction(y,C);for(A.duration=A.duration*J.value,A.endChar=J.index;J.index<y.length&&(n.isWhiteSpace(y[J.index])||y[J.index]==="-");)y[J.index]==="-"?A.startTie={}:A=S(A),J.index++;C=J.index-1,F="broken_rhythm"}else if(F==="sharp2")A.accidental="quartersharp",F="pitch";else if(F==="flat2")A.accidental="quarterflat",F="pitch";else if(F==="Zduration"){var ie=n.getNumber(y,C);return A.duration=ie.num*s.getBarLength(),A.rest.text=ie.num,A.endChar=ie.index,A}else return null;break;case"-":if(F==="startSlur")o.addTieToLastNote($),A.endTie=!0;else if(F==="octave"||F==="duration"||F==="end_slur")if(A.startTie={},!W&&B)F="broken_rhythm";else return n.isWhiteSpace(y[C+1])&&S(A),A.endChar=C+1,A;else return F==="broken_rhythm"?(A.endChar=C,A):null;break;case" ":case" ":if(O(F)){A.end_beam=!0,$=!1;do y[C]==="."&&y[C+1]==="-"&&($=!0,C++),y[C]==="-"&&(A.startTie={},$&&(A.startTie.style="dotted")),C++;while(C<y.length&&(n.isWhiteSpace(y[C])||y[C]==="-")||y[C]==="."&&y[C+1]==="-");if(A.endChar=C,!W&&B&&(y[C]==="<"||y[C]===">"))C--,F="broken_rhythm";else return A}else return null;break;case">":case"<":if(O(F))if(B){var re=L(y,C);C+=re[0]-1,r.next_note_duration=re[2],A.duration=re[1]*A.duration,F="end_slur"}else return A.endChar=C,A;else return null;break;default:return O(F)?(A.endChar=C,A):null}if(C++,C===y.length)return O(F)?(A.endChar=C,A):null}return null},L=function(y,C){switch(y[C]){case">":return C<y.length-2&&y[C+1]===">"&&y[C+2]===">"?[3,1.875,.125]:C<y.length-1&&y[C+1]===">"?[2,1.75,.25]:[1,1.5,.5];case"<":return C<y.length-2&&y[C+1]==="<"&&y[C+2]==="<"?[3,.125,1.875]:C<y.length-1&&y[C+1]==="<"?[2,.25,1.75]:[1,.5,1.5]}return null};function R(){return r.currentVoice===void 0||r.currentVoice.staffNum===0&&r.currentVoice.index===0}return Or=w,Or}var Dr,Ki;function Eg(){if(Ki)return Dr;Ki=1;var e=at(),t=function(n,a){this.lineIndex=0,this.lines=n,this.multilineVars=a,this.skipWhiteSpace=function(c){for(var u=0;u<c.length;u++)if(!this.isWhiteSpace(c[u]))return u;return c.length};var r=function(c,u){return u>=c.length};this.eatWhiteSpace=function(c,u){for(var i=u;i<c.length;i++)if(!this.isWhiteSpace(c[i]))return i-u;return i-u},this.getKeyPitch=function(c){var u=this.skipWhiteSpace(c);if(r(c,u))return{len:0};switch(c[u]){case"A":return{len:u+1,token:"A"};case"B":return{len:u+1,token:"B"};case"C":return{len:u+1,token:"C"};case"D":return{len:u+1,token:"D"};case"E":return{len:u+1,token:"E"};case"F":return{len:u+1,token:"F"};case"G":return{len:u+1,token:"G"}}return{len:0}},this.getSharpFlat=function(c){if(c==="bass")return{len:0};switch(c[0]){case"#":return{len:1,token:"#"};case"b":return{len:1,token:"b"}}return{len:0}},this.getMode=function(c){var u=function(b,m){for(;m<b.length&&(b[m]>="a"&&b[m]<="z"||b[m]>="A"&&b[m]<="Z");)m++;return m},i=this.skipWhiteSpace(c);if(r(c,i))return{len:0};var v=c.substring(i,i+3).toLowerCase();switch((v.length>1&&v[1]===" "||v[1]==="^"||v[1]==="_"||v[1]==="=")&&(v=v[0]),v){case"mix":return{len:u(c,i),token:"Mix"};case"dor":return{len:u(c,i),token:"Dor"};case"phr":return{len:u(c,i),token:"Phr"};case"lyd":return{len:u(c,i),token:"Lyd"};case"loc":return{len:u(c,i),token:"Loc"};case"aeo":return{len:u(c,i),token:"m"};case"maj":return{len:u(c,i),token:""};case"ion":return{len:u(c,i),token:""};case"min":return{len:u(c,i),token:"m"};case"m":return{len:u(c,i),token:"m"}}return{len:0}},this.getClef=function(c,u){var i=c,v=this.skipWhiteSpace(c);if(r(c,v))return{len:0};var b=!1,m=c.substring(v);if(e.startsWith(m,"clef=")&&(b=!0,m=m.substring(5),v+=5),m.length===0&&b)return{len:v+5,warn:"No clef specified: "+i};var w=this.skipWhiteSpace(m);if(r(m,w))return{len:0};w>0&&(v+=w,m=m.substring(w));var _=null;if(e.startsWith(m,"treble"))_="treble";else if(e.startsWith(m,"bass3"))_="bass3";else if(e.startsWith(m,"bass"))_="bass";else if(e.startsWith(m,"tenor"))_="tenor";else if(e.startsWith(m,"alto2"))_="alto2";else if(e.startsWith(m,"alto1"))_="alto1";else if(e.startsWith(m,"alto"))_="alto";else if(!u&&b&&e.startsWith(m,"none"))_="none";else if(e.startsWith(m,"perc"))_="perc";else if(!u&&b&&e.startsWith(m,"C"))_="tenor";else if(!u&&b&&e.startsWith(m,"F"))_="bass";else if(!u&&b&&e.startsWith(m,"G"))_="treble";else return{len:v+5,warn:"Unknown clef specified: "+i};return m=m.substring(_.length),w=this.isMatch(m,"+8"),w>0?_+="+8":(w=this.isMatch(m,"-8"),w>0&&(_+="-8")),{len:v+_.length,token:_,explicit:b}},this.getBarLine=function(c,u){switch(c[u]){case"]":switch(++u,c[u]){case"|":return{len:2,token:"bar_thick_thin"};case"[":return++u,c[u]>="1"&&c[u]<="9"||c[u]==='"'?{len:2,token:"bar_invisible"}:{len:1,warn:"Unknown bar symbol"};default:return{len:1,token:"bar_invisible"}}case":":switch(++u,c[u]){case":":return{len:2,token:"bar_dbl_repeat"};case"|":switch(++u,c[u]){case"]":switch(++u,c[u]){case"|":return++u,c[u]===":"?{len:5,token:"bar_dbl_repeat"}:{len:3,token:"bar_right_repeat"};default:return{len:3,token:"bar_right_repeat"}}case"|":return++u,c[u]===":"?{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(++u,c[u]==="|")switch(++u,c[u]){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 c[u]>="1"&&c[u]<="9"||c[u]==='"'?{len:1,token:"bar_invisible"}:{len:0};case"|":switch(++u,c[u]){case"]":return{len:2,token:"bar_thin_thick"};case"|":return++u,c[u]===":"?{len:3,token:"bar_left_repeat"}:{len:2,token:"bar_thin_thin"};case":":for(var i=0;c[u+i]===":";)i++;return{len:1+i,token:"bar_left_repeat"};default:return{len:1,token:"bar_thin"}}}return{len:0}},this.getTokenOf=function(c,u){for(var i=0;i<c.length;i++)if(u.indexOf(c[i])<0)return{len:i,token:c.substring(0,i)};return{len:i,token:c}},this.getToken=function(c,u,i){for(var v=u;v<i&&!this.isWhiteSpace(c[v]);)v++;return c.substring(u,v)},this.isMatch=function(c,u){var i=this.skipWhiteSpace(c);return r(c,i)?0:e.startsWith(c.substring(i),u)?i+u.length:0},this.getPitchFromTokens=function(c){var u={},i={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(u.position=i[c[0].token],u.position===void 0)return{warn:"Pitch expected. Found: "+c[0].token};for(c.shift();c.length;)switch(c[0].token){case",":u.position-=7,c.shift();break;case"'":u.position+=7,c.shift();break;default:return u}return u},this.getKeyAccidentals2=function(c){for(var u;c.length>0;){var i;if(c[0].token==="^"){if(i="sharp",c.shift(),c.length===0)return{accs:u,warn:"Expected note name after "+i};switch(c[0].token){case"^":i="dblsharp",c.shift();break;case"/":i="quartersharp",c.shift();break}}else if(c[0].token==="=")i="natural",c.shift();else if(c[0].token==="_"){if(i="flat",c.shift(),c.length===0)return{accs:u,warn:"Expected note name after "+i};switch(c[0].token){case"_":i="dblflat",c.shift();break;case"/":i="quarterflat",c.shift();break}}else return{accs:u};if(c.length===0)return{accs:u,warn:"Expected note name after "+i};switch(c[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":u===void 0&&(u=[]),u.push({acc:i,note:c[0].token[0]}),c[0].token.length===1?c.shift():c[0].token=c[0].token.substring(1);break;default:return{accs:u,warn:"Expected note name after "+i+" Found: "+c[0].token}}}return{accs:u}},this.getKeyAccidental=function(c){var u={"^":"sharp","^^":"dblsharp","=":"natural",_:"flat",__:"dblflat","_/":"quarterflat","^/":"quartersharp"},i=this.skipWhiteSpace(c);if(r(c,i))return{len:0};var v=null;switch(c[i]){case"^":case"_":case"=":v=c[i];break;default:return{len:0}}if(i++,r(c,i))return{len:1,warn:"Expected note name after accidental"};switch(c[i]){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:i+1,token:{acc:u[v],note:c[i]}};case"^":case"_":case"/":if(v+=c[i],i++,r(c,i))return{len:2,warn:"Expected note name after accidental"};switch(c[i]){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:i+1,token:{acc:u[v],note:c[i]}};default:return{len:2,warn:"Expected note name after accidental"}}break;default:return{len:1,warn:"Expected note name after accidental"}}},this.isWhiteSpace=function(c){return c===" "||c===" "||c===""},this.getMeat=function(c,u,i){var v=c.indexOf("%",u);for(v>=0&&v<i&&(i=v);u<i&&(c[u]===" "||c[u]===" "||c[u]==="");)u++;for(;u<i&&(c[i-1]===" "||c[i-1]===" "||c[i-1]==="");)i--;return{start:u,end:i}};var s=function(c){return c>="A"&&c<="Z"||c>="a"&&c<="z"},o=function(c){return c>="0"&&c<="9"};this.tokenize=function(c,u,i,v){var b=this.getMeat(c,u,i);u=b.start,i=b.end;for(var m=[],w;u<i;){if(c[u]==='"'){for(w=u+1;w<i&&c[w]!=='"';)w++;m.push({type:"quote",token:c.substring(u+1,w),start:u+1,end:w}),w++}else if(s(c[u])){if(w=u+1,v)for(;w<i&&!this.isWhiteSpace(c[w]);)w++;else for(;w<i&&s(c[w]);)w++;m.push({type:"alpha",token:c.substring(u,w),continueId:o(c[w]),start:u,end:w}),u=w+1}else if(c[u]==="."&&o(c[w+1])){w=u+1;for(var _=null,T=null;w<i&&o(c[w]);)w++;T=parseFloat(c.substring(u,w)),m.push({type:"number",token:c.substring(u,w),intt:_,floatt:T,continueId:s(c[w]),start:u,end:w}),u=w+1}else if(o(c[u])||c[u]==="-"&&o(c[w+1])){w=u+1;for(var q=null,I=null;w<i&&o(c[w]);)w++;if(c[w]==="."&&o(c[w+1]))for(w++;w<i&&o(c[w]);)w++;else q=parseInt(c.substring(u,w));I=parseFloat(c.substring(u,w)),m.push({type:"number",token:c.substring(u,w),intt:q,floatt:I,continueId:s(c[w]),start:u,end:w}),u=w+1}else c[u]===" "||c[u]===" "||m.push({type:"punct",token:c[u],start:u,end:u+1}),w=u+1;u=w}return m},this.getVoiceToken=function(c,u,i){for(var v=u;v<i&&this.isWhiteSpace(c[v])||c[v]==="=";)v++;if(c[v]==='"'){var b=c.indexOf('"',v+1);return b===-1||b>=i?{len:1,err:"Missing close quote"}:{len:b-u+1,token:this.translateString(c.substring(v+1,b))}}else{for(var m=v;m<i&&!this.isWhiteSpace(c[m])&&c[m]!=="=";)m++;return{len:m-u+1,token:c.substring(v,m)}}};var l={"`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:"ž"},h={"#":"♯",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(c){var u=c.split("\\");if(u.length===1)return c;var i=null;return u.forEach(function(v){if(i===null)i=v;else{var b=l[v.substring(0,2)];b!==void 0?i+=b+v.substring(2):(b=g[v.substring(0,3)],b!==void 0?i+=b+v.substring(3):(b=h[v.substring(0,1)],b!==void 0?i+=b+v.substring(1):i+="\\"+v))}}),i},this.getNumber=function(c,u){for(var i=0;u<c.length;)switch(c[u]){case"0":i=i*10,u++;break;case"1":i=i*10+1,u++;break;case"2":i=i*10+2,u++;break;case"3":i=i*10+3,u++;break;case"4":i=i*10+4,u++;break;case"5":i=i*10+5,u++;break;case"6":i=i*10+6,u++;break;case"7":i=i*10+7,u++;break;case"8":i=i*10+8,u++;break;case"9":i=i*10+9,u++;break;default:return{num:i,index:u}}return{num:i,index:u}},this.getFraction=function(c,u){var i=1,v=1;if(c[u]!=="/"){var b=this.getNumber(c,u);i=b.num,u=b.index}if(c[u]==="/")if(u++,c[u]==="/"){for(var m=.5;c[u++]==="/";)m=m/2;return{value:i*m,index:u-1}}else{var w=u,_=this.getNumber(c,u);_.num===0&&w===u&&(_.num=2),_.num!==0&&(v=_.num),u=_.index}return{value:i/v,index:u}};function p(c){const i=/^(\d+)\./.exec(c);return i?i[1]:null}var d=[{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(c){for(var u=0;u<d.length;u++){var i=d[u],v=c.match(i.match);if(v){var b=p(c);b&&(c=c.replace(b+".",""),c=c.trim());var m=v[0].length,w=i.replace+c.substring(0,c.length-m);return b&&(w=b+". "+w),w}}return c},this.stripComment=function(c){var u=c.indexOf("%");return u>=0?e.strip(c.substring(0,u)):e.strip(c)},this.getInt=function(c){var u=parseInt(c);if(isNaN(u))return{digits:0};var i=""+u,v=c.indexOf(i);return{value:u,digits:v+i.length}},this.getFloat=function(c){var u=parseFloat(c);if(isNaN(u))return{digits:0};var i=""+u,v=c.indexOf(i);return{value:u,digits:v+i.length}},this.getMeasurement=function(c){if(c.length===0)return{used:0};var u=1,i="";if(c[0].token==="-")c.shift(),i="-",u++;else if(c[0].type!=="number")return{used:0};if(i+=c.shift().token,c.length===0)return{used:1,value:parseInt(i)};var v=c.shift();if(v.token==="."){if(u++,c.length===0)return{used:u,value:parseInt(i)};if(c[0].type==="number"&&(v=c.shift(),i=i+"."+v.token,u++,c.length===0))return{used:u,value:parseFloat(i)};v=c.shift()}switch(v.token){case"pt":return{used:u+1,value:parseFloat(i)};case"px":return{used:u+1,value:parseFloat(i)};case"cm":return{used:u+1,value:parseFloat(i)/2.54*72};case"in":return{used:u+1,value:parseFloat(i)*72};default:return c.unshift(v),{used:u,value:parseFloat(i)}}};var f=function(c){return c=c.replace(/\\n/g,`
89
+ `),c=c.replace(/\\"/g,'"'),c};this.getBrackettedSubstring=function(c,u,i,v){for(var b=v||c[u],m=u+1,w=!1;m<c.length&&(w||c[m]!==b);)w=c[m]==="\\",++m;return c[m]===b?[m-u+1,f(c.substring(u+1,m)),!0]:(m=u+i,m>c.length-1&&(m=c.length-1),[m-u+1,f(c.substring(u+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 n=this.lines[this.lineIndex];return this.lineIndex++,n}return null},Dr=t,Dr}var Fr,Ji;function ql(){if(Ji)return Fr;Ji=1;function e(p,d,f){if(!(!d||p.lines.length===0)){var c=p.deline({lineBreaks:!1}),u=n(c,d);p.lines=t(c,u,f),p.lineBreaks=u}}function t(p,d,f){for(var c=[],u=[],i=[],v=1,b=0;b<d.length;b++){var m=d[b];if(p[m.ogLine].staff){var w=p[m.ogLine].staff[m.staff];if(c[m.line]||(c[m.line]={staff:[]}),!c[m.line].staff[m.staff]){c[m.line].staff[m.staff]={voices:[]},f!==void 0&&m.staff===0&&m.line>0&&(c[m.line].staff[m.staff].barNumber=v);for(var _=Object.keys(w),T=0;T<_.length;T++){var q=_[T]==="voices";_[T]==="meter"&&m.line!==0&&(q=!0),q||(c[m.line].staff[m.staff][_[T]]=w[_[T]])}u[m.staff]&&(c[m.line].staff[m.staff].key=u[m.staff])}c[m.line].staff[m.staff].voices[m.voice]||(c[m.line].staff[m.staff].voices[m.voice]=[]),c[m.line].staff[m.staff].voices[m.voice]=p[m.ogLine].staff[m.staff].voices[m.voice].slice(m.start,m.end+1),i[m.staff*10+m.voice]&&c[m.line].staff[m.staff].voices[m.voice].unshift({el_type:"stem",direction:i[m.staff*10+m.voice].direction});for(var I=c[m.line].staff[m.staff].voices[m.voice],E=I.length-1;E>=0;E--)if(I[E].el_type==="key"){u[m.staff]={root:I[E].root,acc:I[E].acc,mode:I[E].mode,accidentals:I[E].accidentals.filter(function(x){return x.acc!=="natural"})};break}for(E=I.length-1;E>=0;E--)if(I[E].el_type==="stem"){i[m.staff*10+m.voice]={direction:I[E].direction};break}if(f!==void 0&&m.staff===0&&m.voice===0)for(E=0;E<I.length;E++)I[E].el_type==="bar"&&(v++,E===I.length-1?delete I[E].barNumber:I[E].barNumber=v)}else c[m.line]=p[m.ogLine]}for(var P=0;P<c.length;P++)c[P].staff&&(c[P].staff=c[P].staff.filter(function(x){return x!=null}));return c}function n(p,d){for(var f=[],c=0,u=0,i=0,v=0;v<p.length;v++){var b=p[v];if(b.staff){var m=u,w=d[c];c++;for(var _=0;_<b.staff.length;_++)for(var T=b.staff[_],q=0;q<T.voices.length;q++){i=m;for(var I=0,E=0,P=T.voices[q],x=0,M=0;M<P.length;M++){var N=P[M];N.el_type==="bar"&&(w[E]===I&&(f.push({ogLine:v,line:i,staff:_,voice:q,start:x,end:M}),x=M+1,i++,u=Math.max(u,i),E++),I++)}f.push({ogLine:v,line:i,staff:_,voice:q,start:x,end:P.length}),i++,u=Math.max(u,i)}}else f.push({ogLine:v,line:i}),i++,u=Math.max(u,i)}return f}function a(p,d){for(var f=[],c=[],u=0,i=0;i<p.length;i++){var v=p[i],b=u+v;if(b<d)u=b;else{var m=d-u,w=b-d;m<w&&u>0?(f.push(i-1),c.push(Math.round(u-v)),u=v):i<p.length-1&&(f.push(i),c.push(Math.round(u)),u=0)}}return c.push(Math.round(u)),{lineBreaks:f,totals:c}}function r(p){for(var d=[],f=0;f<p.length;f++)d.push(p[f]);return d}function s(p,d,f,c,u,i,v,b,m,w,_){for(var T=w;T<p.length;T++){var q=p[T];f+=q,c+=q;var I=Math.abs(f-d[b]),E=Math.abs(I-i)<d[0]/10;if(E)if(I<i){var P=r(u),x=r(m);x.push(T-1),P.push(c-q),_.push({accumulator:f,lineAccumulator:q,lineWidths:P,lastVariance:Math.abs(f-d[b+1]),highestVariance:Math.max(v,i),currLine:b+1,lineBreaks:x,startIndex:T+1})}else I>i&&T<p.length-1&&(P=r(u),x=r(m),_.push({accumulator:f,lineAccumulator:c,lineWidths:P,lastVariance:I,highestVariance:Math.max(v,I),currLine:b,lineBreaks:x,startIndex:T+1}));I>i?(m.push(T-1),b++,v=Math.max(v,i),i=Math.abs(f-d[b]),u.push(c-q),c=q):i=I}u.push(c)}function o(p,d,f,c){for(var u=Math.ceil(p.total/d),i=Math.floor(p.total/u),v=[],b=0;b<u;b++)v.push(i*(b+1));var m=[];m.push({accumulator:0,lineAccumulator:0,lineWidths:[],lastVariance:999999,highestVariance:0,currLine:0,lineBreaks:[],startIndex:0});for(var w=0;w<m.length;)s(p.measureWidths,v,m[w].accumulator,m[w].lineAccumulator,m[w].lineWidths,m[w].lastVariance,m[w].highestVariance,m[w].currLine,m[w].lineBreaks,m[w].startIndex,m),w++;for(b=0;b<m.length;b++){var _=m[b];_.variances=[],_.aveVariance=0;for(var T=0;T<_.lineWidths.length;T++){var q=_.lineWidths[T];_.variances.push(q-v[0]),_.aveVariance+=Math.abs(q-v[0])}_.aveVariance=_.aveVariance/_.lineWidths.length,c.attempts.push({type:"optimizeLineWidths",lineBreaks:_.lineBreaks,variances:_.variances,aveVariance:_.aveVariance,widths:p.measureWidths})}var I=9999999,E=-1;for(b=0;b<m.length;b++)_=m[b],_.aveVariance<I&&(I=_.aveVariance,E=b);return{failed:!1,lineBreaks:m[E].lineBreaks,variance:m[E].highestVariance}}function l(p,d,f){for(var c=[],u=[],i=0,v=!1,b=0;b<p.length;b++)i+=p[b],i>d&&(v=!0),b%f===f-1&&(b!==p.length-1&&c.push(b),u.push(Math.round(i)),i=0);return{failed:v,totals:u,lineBreaks:c}}function h(p,d,f){var c={lineBreaks:p,staffwidth:d};for(var u in f)f.hasOwnProperty(u)&&u!=="wrap"&&u!=="staffwidth"&&(c[u]=f[u]);return{revisedParams:c}}function g(p,d,f){if(d.length===0||f.staffwidth<d[0].left)return{reParse:!1,explanation:"Staff width is narrower than the margin",revisedParams:f};var c=f.scale?Math.max(f.scale,.1):1,u=f.wrap.minSpacing?Math.max(parseFloat(f.wrap.minSpacing),1):1,i=f.wrap.minSpacingLimit?Math.max(parseFloat(f.wrap.minSpacingLimit),1):u-.1,v=f.wrap.maxSpacing?Math.max(parseFloat(f.wrap.maxSpacing),1):void 0;f.wrap.lastLineLimit&&!v&&(v=Math.max(parseFloat(f.wrap.lastLineLimit),1));for(var b=f.wrap.preferredMeasuresPerLine?Math.max(parseInt(f.wrap.preferredMeasuresPerLine,10),0):void 0,m=[],w=[],_=0;_<d.length;_++){var T=d[_],q=f.staffwidth-T.left,I=q/u/c,E=q/v/c,P=q/i/c,x={widths:T,lineBreakPoint:I,minLineSize:E,attempts:[],staffWidth:f.staffwidth,minWidth:Math.round(P)},M=null;if(b){var N=l(T.measureWidths,I,b);x.attempts.push({type:"Fixed Measures Per Line",preferredMeasuresPerLine:b,lineBreaks:N.lineBreaks,failed:N.failed,totals:N.totals}),N.failed||(M=N.lineBreaks)}if(!M){var D=a(T.measureWidths,I);x.attempts.push({type:"Free Form",lineBreaks:D.lineBreaks,totals:D.totals}),M=D.lineBreaks,M.length>0&&T.measureWidths.length<25&&(D=o(T,I,M,x),x.attempts.push({type:"Optimize",failed:D.failed,reason:D.reason,lineBreaks:D.lineBreaks,totals:D.totals}),D.failed||(M=D.lineBreaks))}m.push(M),w.push(x)}var k=f.staffwidth,S=h(m,k,f);return S.explanation=w,S.reParse=!0,S}return Fr={wrapLines:e,calcLineWraps:g},Fr}var Hr,Qi;function Ag(){if(Qi)return Hr;Qi=1;function e(h){const g=h.getMeterFraction(),p=g.num===4&&g.den===4;if(!(g.num===2&&g.den===2)&&!p)throw new Error("notCommonTime");const f=h.deline();let c=[],u=!1;return f.forEach(i=>{if(i.subtitle)u&&c.push({type:"subtitle",subtitle:i.subtitle.text});else if(i.text)u=!0,c.push({type:"text",text:i.text.text});else if(i.staff){u=!0;const v=i.staff,b=n(v);c=c.concat(b)}}),r(c),s(c),o(c),c}const t=["break","(break)","no chord","n.c.","tacet"];function n(h){const g=[];let p="",d=[],f={chord:["","","",""]},c="",u="";if(h.forEach((i,v)=>{i.voices&&i.voices.forEach((b,m)=>{let w=0,_=0;b.forEach(T=>{if(T.el_type==="part")d.length>0&&v===0&&m===0&&(g.push({type:"part",name:p,lines:[d]}),d=[]),p=T.title;else if(T.el_type==="note"){l(T,f);const q=Math.floor(w);if(T.chord&&T.chord.length>0){const I=T.chord[0],E=I.position==="default"||t.indexOf(I.name.toLowerCase())>=0?I.name:"";E&&(q>0&&!f.chord[0]&&(f.chord[0]=c),c=E,f.chord[q]?q<4&&!f.chord[q+1]&&(f.chord[q+1]=E):f.chord[q]=E),T.chord.forEach(P=>{P.position!=="default"&&t.indexOf(I.name.toLowerCase())<0&&(f.annotations||(f.annotations=[]),f.annotations.push(P.name))})}if(!T.rest||T.rest.type!=="spacer"){const I=T.duration===0&&!T.rest?.25:T.duration,E=Math.floor(I*4);if(E>4)_+=Math.floor(E/4),w=0;else{let P=I*4;T.tripletMultiplier&&(P*=T.tripletMultiplier),w+=P}}}else if(T.el_type==="bar"){if(u&&(f.ending=u,u=""),l(T,f),T.chord&&T.chord.forEach(q=>{q.position!=="default"&&(f.annotations||(f.annotations=[]),f.annotations.push(q.name))}),(T.type==="bar_dbl_repeat"||T.type==="bar_left_repeat")&&(f.hasStartRepeat=!0),(T.type==="bar_dbl_repeat"||T.type==="bar_right_repeat")&&(f.hasEndRepeat=!0),T.startEnding&&(u=T.startEnding),w>=4){if(f.chord[0]===""&&(f.chord[1]||f.chord[2]||f.chord[3])&&(f.chord[0]=a(d)),v===0&&m===0)d.push(f);else{let q=_,I=0;for(;q>=g[I].lines[0].length&&I<g.length;)q-=g[I].lines[0].length,I++;if(I<g.length&&q<g[I].lines[0].length){const E=g[I].lines[0][q];!E.chord[0]&&f.chord[0]&&(E.chord[0]=f.chord[0]),!E.chord[1]&&f.chord[1]&&(E.chord[1]=f.chord[1]),!E.chord[2]&&f.chord[2]&&(E.chord[2]=f.chord[2]),!E.chord[3]&&f.chord[3]&&(E.chord[3]=f.chord[3]),f.annotations&&(E.annotations?E.annotations=E.annotations.concat(f.annotations):E.annotations=f.annotations)}_++}f={chord:["","","",""]}}else f.chord=["","","",""];w=0}else T.el_type}),v===0&&m===0&&g.push({type:"part",name:p,lines:[d]})})}),!c)throw new Error("noChords");return g}function a(h){for(let g=h.length-1;g>=0;g--)for(let p=h[g].chord.length-1;p>=0;p--)if(h[g].chord[p])return h[g].chord[p]}function r(h){h.forEach(g=>{if(g.type==="part"){const p=g.lines[0],d=p.findIndex(c=>!!c.ending),f=p.findIndex((c,u)=>u>d&&!!c.ending);if(d>=0&&f>=0&&f-d===p.length-f){let c=!0;for(let u=0;u<f-d&&c;u++){const i=p[d+u],v=p[f+u];if(i.chord[0]!==v.chord[0]&&(c=!1),i.chord[1]!==v.chord[1]&&(c=!1),i.chord[2]!==v.chord[2]&&(c=!1),i.chord[3]!==v.chord[3]&&(c=!1),i.annotations&&!v.annotations&&(c=!1),!i.annotations&&v.annotations&&(c=!1),i.annotations&&v.annotations)if(i.annotations.length!==v.annotations.length)c=!1;else for(let b=0;b<i.annotations.length;b++)i.annotations[b]!==v.annotations[b]&&(c=!1)}c&&(delete p[d].ending,p.splice(f,p.length-f))}}})}function s(h){h.forEach(g=>{if(g.type==="part"){const p=[],d=g.lines[0];let f=!1;const c=d.findIndex(v=>!!v.hasEndRepeat);(c>=0?Math.min(c+1,d.length):d.length)===12&&(f=!0);const i=f?4:8;for(let v=0;v<d.length;v+=i){const b=d.slice(v,v+i),m=b.findIndex(w=>!!w.hasEndRepeat);m>=0&&m<b.length-1?(p.push(b.slice(0,m+1)),p.push(b.slice(m+1))):p.push(b)}for(let v=0;v<p.length;v++)if(p[v][0].ending){const b=Math.max(0,v-1),m=p[b].length-p[v].length,w=[];for(let _=0;_<m;_++)w.push({noBorder:!0,chord:["","","",""]});p[v]=w.concat(p[v])}g.lines=p}})}function o(h){h.forEach(g=>{if(g.lines){let p=!1,d="";g.lines.forEach(f=>{f.forEach(c=>{if(!c.noBorder){const u=c.chord;!u[0]&&!u[1]&&!u[2]&&!u[3]?(p?d&&(u[0]="%"):u[0]=d,p=!0):!u[1]&&!u[2]&&!u[3]?(p=!0,d=u[0]):(p=!1,d=u[3]||u[2]||u[1])}})})}})}function l(h,g){if(h.decoration)for(let p=0;p<h.decoration.length;p++)switch(h.decoration[p]){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(h.decoration[p]);break}}return Hr=e,Hr}var $r,es;function Xe(){if(es)return $r;es=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,$r=e,$r}var Gr,ts;function Mg(){if(ts)return Gr;ts=1;const e=at();function t(o){this.sections=[{type:"startRepeat",index:-1}],this.addBar=function(l){var h=o.length-1,g=l.type==="bar_left_repeat"||l.type==="bar_dbl_repeat",p=l.type==="bar_right_repeat"||l.type==="bar_dbl_repeat",d=l.startEnding?s(l.startEnding):void 0;p&&(this.sections.length>0&&this.sections[this.sections.length-1].type==="endRepeat"&&this.sections.push({type:"startRepeat",index:this.sections[this.sections.length-1].index}),this.sections.push({type:"endRepeat",index:h})),g&&this.sections.push({type:"startRepeat",index:h}),d&&this.sections.push({type:"startEnding",index:h,endings:d})},this.resolveRepeats=function(){var l,h=this.sections[this.sections.length-1],g=o.length-1;if(h.type==="startRepeat"?h.end=g:h.index+1<g&&this.sections.push({type:"startRepeat",index:h.index+1}),this.sections.length<2)return o;for(var p=[],d=null,f=0;f<this.sections.length;f++){var c=this.sections[f];switch(c.type){case"startRepeat":if(d){if(d.common.end||(d.common.end=c.index),d.endings)for(l=0;l<d.endings.length;l++)d.endings[l]&&!d.endings[l].end&&d.endings[l].start!==c.index&&(d.endings[l].end=c.index);this.sections[f-1].type==="endRepeat"&&d.endings&&d.endings.length&&(d.endings[d.endings.length]={start:-1,end:-1}),p.push(d)}if(d){var u=d.common.end;if(d.endings)for(l=0;l<d.endings.length;l++)d.endings[l]&&(u=Math.max(u,d.endings[l].end));u<c.index-1&&p.push({common:{start:u+1,end:c.index}})}d={common:{start:c.index}};break;case"startEnding":{if(d)for(d.common.end||(d.common.end=c.index),d.endings||(d.endings=[]),l=0;l<c.endings.length;l++)d.endings[c.endings[l]]={start:c.index+1};break}case"endRepeat":if(d){if(d.endings||(d.endings=[]),d.endings.length>0)for(l=0;l<d.endings.length;l++)d.endings[l]&&!d.endings[l].end&&(d.endings[l].end=c.index);d.common.end||(d.common.end=c.index)}break}}if(d){if(d.common.end||(d.common.end=g),d.endings)for(l=0;l<d.endings.length;l++)d.endings[l]&&!d.endings[l].end&&(d.endings[l].end=g);p.push(d)}for(var i=[],v=-1,b=0;b<p.length;b++){var m=p[b];if(!m.endings)n(o,i,m.common.start,m.common.end);else if(m.endings.length===0)n(o,i,m.common.start,m.common.end),n(o,i,m.common.start,m.common.end);else for(l=0;l<m.endings.length;l++){var w=m.endings[l];w&&(n(o,i,m.common.start,m.common.end),w.start>0&&n(o,i,w.start,w.end),v=Math.max(v,w.end))}}return i}}function n(o,l,h,g){h<0&&(h=0),l.length>0&&o[h].el_type==="bar"&&l[l.length-1].el_type==="bar"&&h++;for(var p=h;p<=g;p++){var d,f=!1;if(o[p].el_type==="key"||o[p].el_type==="meter"||o[p].el_type==="tempo"||o[p].el_type==="instrument"){for(d=l.length-1;d>=0&&l[d].el_type!==o[p].el_type;)d--;d>=0&&(o[p].el_type==="key"&&r(o[p],l[d])||o[p].el_type==="meter"&&o[p].num===l[d].num&&o[p].den===l[d].den||o[p].el_type==="instrument"&&o[p].program===l[d].program||o[p].el_type==="tempo"&&o[p].qpm===l[d].qpm)&&(f=!0)}f||l.push(a(o[p]))}}function a(o){var l=Object.assign({},o);return l.pitches&&(l.pitches=e.cloneArray(l.pitches)),l}function r(o,l){return!o.accidentals||!l.accidentals?!1:JSON.stringify(o.accidentals)===JSON.stringify(l.accidentals)}function s(o){var l=[],h,g,p;if(o.indexOf(",")>0)for(g=o.split(","),p=0;p<g.length;p++)h=parseInt(g[p],10),h>0&&l.push(h);else if(o.indexOf("-")>0){g=o.split("-");var d=parseInt(g[0],10),f=parseInt(g[1],10);for(p=d;p<=f;p++)l.push(p)}else h=parseInt(o,10),h>0&&l.push(h);return l}return Gr=t,Gr}var Zr,rs;function Bl(){if(rs)return Zr;rs=1;var e,t=at(),n=Mg();return(function(){var a=1,r=128;e=function(v,b){b=b||{};var m,w=b.program||0,_=b.midiTranspose||0;v.visualTranspose&&(_-=v.visualTranspose);var T=b.channel||0,q=!1,I=b.drum||"",E=b.drumBars||1,P=b.drumIntro||0,x=I!=="",M=!!b.drumOff,N=[],D=50;w=parseInt(w,10),_=parseInt(_,10),T=parseInt(T,10),T===10&&(w=r),I=I.split(" "),E=parseInt(E,10),P=parseInt(P,10);var k=v.formatting.bagpipes;k&&(w=71);var S=[];if(v.formatting.midi){var z=v.formatting.midi;z.program&&z.program.length>0&&(w=z.program[0],z.program.length>1&&(w=z.program[1],T=z.program[0]),q=!0),z.transpose&&(_=z.transpose[0]),z.channel&&(T=z.channel[0],q=!0),z.drum&&(I=z.drum),z.drumbars&&(E=z.drumbars[0]),z.drumon&&(x=!0),T===10&&(w=r),z.beat&&S.push({el_type:"beat",beats:z.beat}),z.nobeataccents&&S.push({el_type:"beataccents",value:!1})}b.qpm?m=parseInt(b.qpm,10):v.metaText.tempo?m=p(v.metaText.tempo,v.getBeatLength()):b.defaultQpm?m=b.defaultQpm:m=180;var L=[];k&&L.push({el_type:"bagpipes"}),L.push({el_type:"instrument",program:w}),T&&L.push({el_type:"channel",channel:T}),_&&L.push({el_type:"transpose",transpose:_}),L.push({el_type:"tempo",qpm:m});for(var R=0;R<S.length;R++)L.push(S[R]);var y=[],C=[],A=[],B=[],O=[0],$={};$[0]={el_type:"tempo",qpm:m,timing:0};for(var F,W=[],te=!1,J=v.lines,ie=0;ie<J.length;ie++){var re=J[ie];if(re.staff){let pe=function(be){var Ge={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=Ge[ve].slice(0);let St=[F];Array.isArray(be.decoration)&&(St=[],be.decoration.forEach(ut=>{ut in Ge&&St.push(Ge[ut].slice(0))})),y[X].push({el_type:"beat",beats:F.slice(0),volumesPerNotePitch:St}),A[he]=!1,B[he]=!1}if(be.decoration.indexOf("crescendo(")>=0){var nt=s(de,V,"crescendo)"),Ue=Math.min(127,F[0]+D),Ze=o(de,V+nt+1,Object.keys(Ge));Ze&&(Ue=Ge[Ze][0]),nt>0?A[he]=Math.floor((Ue-F[0])/nt):A[he]=!1,B[he]=!1}else if(be.decoration.indexOf("crescendo)")>=0)A[he]=!1;else if(be.decoration.indexOf("diminuendo(")>=0){var ct=s(de,V,"diminuendo)"),lt=Math.max(15,F[0]-D),bt=o(de,V+ct+1,Object.keys(Ge));bt&&(lt=Ge[bt][0]),A[he]=!1,ct>0?B[he]=Math.floor((lt-F[0])/ct):B[he]=!1}else be.decoration.indexOf("diminuendo)")>=0&&(B[he]=!1)}};for(var Be=pe,oe=re.staff,X=0,ne=0;ne<oe.length;ne++){var ee=oe[ne];if(!(ee.clef&&ee.clef.type==="TAB"))for(var he=0;he<ee.voices.length;he++){var de=ee.voices[he];if(!y[X]){y[X]=[].concat(JSON.parse(JSON.stringify(L)));var Te=g(re.staff,X);Te&&y[X].unshift({el_type:"name",trackName:Te}),W[X]=new n(y[X])}if(_&&ee.clef.type==="perc"&&y[X].push({el_type:"transpose",transpose:0}),ee.clef&&ee.clef.type==="perc"&&!q)for(var _e=0;_e<y[X].length;_e++)y[X][_e].el_type==="instrument"&&(y[X][_e].program=r);else ee.key&&c(y[X],ee.key);ee.meter&&u(y[X],ee.meter),!te&&x&&(y[X].push({el_type:"drum",params:{pattern:I,bars:E,on:x,intro:P}}),te=!0),ee.clef&&ee.clef.type!=="perc"&&ee.clef.transpose&&(ee.clef.el_type="clef",y[X].push({el_type:"transpose",transpose:ee.clef.transpose}),C[X]=!1),ee.clef&&ee.clef.type&&(ee.clef.type.indexOf("-8")>=0?(y[X].push({el_type:"transpose",transpose:-12}),C[X]=!0):ee.clef.type.indexOf("+8")>=0?(y[X].push({el_type:"transpose",transpose:12}),C[X]=!0):C[X]&&(y[X].push({el_type:"transpose",transpose:0}),C[X]=!1)),v.formatting.midi&&v.formatting.midi.drumoff&&(y[X].push({el_type:"bar"}),y[X].push({el_type:"drum",params:{pattern:"",on:!1}}));var qe=0,ze=0,De=0,G=0;F=[105,95,85,1];for(var V=0;V<de.length;V++){var H=de[V];switch(H.el_type){case"note":if(A[he]&&(F[0]+=A[he],F[1]+=A[he],F[2]+=A[he],y[X].push({el_type:"beat",beats:F.slice(0)})),B[he]&&(F[0]+=B[he],F[1]+=B[he],F[2]+=B[he],y[X].push({el_type:"beat",beats:F.slice(0)})),pe(H),!H.rest||H.rest.type!=="spacer"){var U={elem:H,el_type:"note",timing:O[X]};if(H.style?U.style=H.style:N[X]&&(U.style=N[X]),U.duration=H.duration===0?.25:H.duration,H.startTriplet){if(ze=H.tripletMultiplier,De=H.startTriplet*ze*H.duration,H.startTriplet!==H.tripletR&&V+H.tripletR<=de.length){for(var Q=0,ae=V;ae<V+H.tripletR;ae++)Q+=de[ae].duration;De=ze*Q}U.duration=U.duration*ze,U.duration=Math.round(U.duration*1e6)/1e6,G=U.duration}else ze&&(H.endTriplet?(ze=0,U.duration=Math.round((De-G)*1e6)/1e6):(U.duration=U.duration*ze,U.duration=Math.round(U.duration*1e6)/1e6,G+=U.duration));H.rest&&(U.rest=H.rest),H.decoration&&(U.decoration=H.decoration.slice(0)),H.pitches&&(U.pitches=t.cloneArray(H.pitches)),H.gracenotes&&(U.gracenotes=t.cloneArray(H.gracenotes)),H.chord&&(U.chord=t.cloneArray(H.chord)),y[X].push(U),H.style==="rhythm"&&h(y),qe++,O[X]+=U.duration}break;case"key":case"keySignature":c(y[X],H);break;case"meter":u(y[X],H);break;case"clef":H.transpose&&y[X].push({el_type:"transpose",transpose:H.transpose}),H.type&&(H.type.indexOf("-8")>=0?y[X].push({el_type:"transpose",transpose:-12}):H.type.indexOf("+8")>=0&&y[X].push({el_type:"transpose",transpose:12}));break;case"tempo":m=p(H,v.getBeatLength()),y[X].push({el_type:"tempo",qpm:m,timing:O[X]}),$[""+O[X]]={el_type:"tempo",qpm:m,timing:O[X]};break;case"bar":qe>0&&y[X].push({el_type:"bar"}),pe(H),qe=0,W[X].addBar(H,X);break;case"style":N[X]=H.head;break;case"timeSignature":y[X].push(d(H));break;case"part":break;case"stem":case"scale":case"break":case"font":break;case"midi":var ce=!1;switch(H.cmd){case"drumon":x=!0,ce=!0;break;case"drumoff":x=!1,ce=!0;break;case"drum":I=H.params,ce=!0;break;case"drumbars":E=H.params[0],ce=!0;break;case"drummap":break;case"channel":H.params[0]===10&&y[X].push({el_type:"instrument",program:r});break;case"program":i(y[X],{el_type:"instrument",program:H.params[0]}),q=!0;break;case"transpose":y[X].push({el_type:"transpose",transpose:H.params[0]});break;case"gchordoff":y[X].push({el_type:"gchordOn",tacet:!0});break;case"gchordon":y[X].push({el_type:"gchordOn",tacet:!1});break;case"beat":y[X].push({el_type:"beat",beats:H.params});break;case"nobeataccents":y[X].push({el_type:"beataccents",value:!1});break;case"beataccents":y[X].push({el_type:"beataccents",value:!0});break;case"vol":case"volinc":y[X].push({el_type:H.cmd,volume:H.params[0]});break;case"swing":case"gchord":case"bassvol":case"chordvol":y[X].push({el_type:H.cmd,param:H.params[0]});break;case"bassprog":case"chordprog":y[X].push({el_type:H.cmd,value:H.params[0],octaveShift:H.params[1]});break;case"gchordbars":y[X].push({el_type:H.cmd,param:H.params[0]});break;default:console.log("MIDI seq: midi cmd not handled: ",H.cmd,H)}ce&&(y[0].push({el_type:"drum",params:{pattern:I,bars:E,intro:P,on:x}}),te=!0);break;default:console.log("MIDI: element type "+H.el_type+" not handled.")}}X++,O[X]||(O[X]=0)}}}}for(var ge=0;ge<W.length;ge++)y[ge]=W[ge].resolveRepeats();if(l(y,$),P)for(var se=v.getPickupLength(),ue=0;ue<y.length;ue++){for(var Ae=0;y[ue][Ae].el_type!=="note"&&y[ue].length>Ae;)Ae++;if(y[ue].length>Ae){for(var ae=0;ae<P;ae++)se===0||ae<P-1?(y[ue].splice(Ae,0,{el_type:"note",rest:{type:"rest"},duration:a},{el_type:"bar"}),Ae+=2):y[ue].splice(Ae++,0,{el_type:"note",rest:{type:"rest"},duration:a-se});M&&(x=!1,y[ue].splice(Ae++,0,{el_type:"drum",params:{pattern:I,bars:E,intro:P,on:x}}),M=!1)}}return y.length>0&&y[0].length>0&&(y[0][0].pickupLength=v.getPickupLength()),y};function s(v,b,m){for(var w=0,_=b+1;_<v.length;_++)if(v[_].el_type==="note"&&w++,v[_].decoration&&v[_].decoration.indexOf(m)>=0)return w;return w}function o(v,b,m){for(var w=Math.min(v.length,b+3),_=b;_<w;_++)if(v[_].el_type==="note"&&v[_].decoration){for(var T=0;T<v[_].decoration.length;T++)if(m.indexOf(v[_].decoration[T])>=0)return v[_].decoration[T]}return null}function l(v,b){if(!(!b||b.length===0))for(var m=Object.keys(b),w=0;w<v.length;w++)for(var _=v[w],T=b[0]?b[0].qpm:0,q=0;q<_.length;q++){var I=_[q];I.el_type==="tempo"&&(T=I.qpm),m.indexOf(""+I.timing)>=0&&T!==b[""+I.timing].qpm&&(T=b[""+I.timing].qpm,I.el_type==="tempo"?(I.qpm=b[""+I.timing].qpm,q++):(v[w].splice(q,0,{el_type:"tempo",qpm:b[""+I.timing].qpm,timing:I.timing}),q+=2))}}function h(v){for(var b=0;b<v.length;b++)for(var m=v[b],w=m.length-1;w>=0&&m[w].el_type!=="bar";)m[w].noChordVoice=!0,w--}function g(v,b){if(!(!v||v.length<=b||!v[b].title))return v[b].title.join(" ")}function p(v,b){var m=.25;v.duration&&(m=v.duration[0]);var w=60;return v.bpm&&(w=v.bpm),m*w/b}function d(v){var b;switch(v.type){case"common_time":b={el_type:"meter",num:4,den:4},a=4/4;break;case"cut_time":b={el_type:"meter",num:2,den:2},a=2/2;break;case"specified":let _=0;if(v.value&&v.value.length>0&&v.value[0].num.indexOf("+")>0)for(var m=v.value[0].num.split("+"),w=0;w<m.length;w++)_+=parseInt(m[w],10);else _=parseInt(v.value[0].num,10);b={el_type:"meter",num:_,den:v.value[0].den},a=_/parseInt(v.value[0].den,10);break;default:b={el_type:"meter"},a=1}return b}function f(v){for(var b=[],m=0;m<v.length;m++)v[m].acc!=="natural"&&b.push(v[m]);return b}function c(v,b){var m;b.root==="HP"?m={el_type:"key",accidentals:[{acc:"natural",note:"g"},{acc:"sharp",note:"f"},{acc:"sharp",note:"c"}]}:m={el_type:"key",accidentals:f(b.accidentals)},i(v,m)}function u(v,b){var m=d(b);i(v,m)}function i(v,b){for(var m=v.length-1;m>=0;m--)if(v[m].el_type===b.el_type){JSON.stringify(v[m])!==JSON.stringify(b)&&v.push(b);return}v.push(b)}})(),Zr=e,Zr}var jr,ns;function Ig(){if(ns)return jr;ns=1;var e=function(g,p,d,f){this.chordTrack=[],this.chordTrackFinished=!1,this.chordChannel=g,this.currentChords=[],this.lastChord,this.chordLastBar,this.chordsOff=!!p,this.gChordTacet=this.chordsOff,this.hasRhythmHead=!1,this.transpose=0,this.lastBarTime=0,this.meter=f,this.tempoChangeFactor=1,this.bassInstrument=d.bassprog&&d.bassprog.length>=1?d.bassprog[0]:0,this.chordInstrument=d.chordprog&&d.chordprog.length>=1?d.chordprog[0]:0,this.bassOctaveShift=d.bassprog&&d.bassprog.length===2?d.bassprog[1]:0,this.chordOctaveShift=d.chordprog&&d.chordprog.length===2?d.chordprog[1]:0,this.boomVolume=d.bassvol&&d.bassvol.length===1?d.bassvol[0]:64,this.chickVolume=d.chordvol&&d.chordvol.length===1?d.chordvol[0]:48,d.gchord&&d.gchord.length>0?this.overridePattern=a(d.gchord[0]):this.overridePattern=void 0};e.prototype.setMeter=function(h){this.meter=h},e.prototype.setTempoChangeFactor=function(h){this.tempoChangeFactor=h},e.prototype.setLastBarTime=function(h){this.lastBarTime=h},e.prototype.setTranspose=function(h){this.transpose=h},e.prototype.setRhythmHead=function(h,g){this.hasRhythmHead=h;var p=[];if(h&&this.lastChord&&this.lastChord.chick)for(var d=0;d<this.lastChord.chick.length;d++){var f=Object.assign({},g.pitches[0]);f.actualPitch=this.lastChord.chick[d],p.push(f)}return p},e.prototype.barEnd=function(h){this.chordTrack.length>0&&!this.chordTrackFinished&&(this.resolveChords(this.lastBarTime,o(h.time)),this.currentChords=[]),this.chordLastBar=this.lastChord},e.prototype.gChordOn=function(h){this.chordsOff||(this.gChordTacet=h.tacet)},e.prototype.paramChange=function(h){switch(h.el_type){case"gchord":h.param&&h.param.length>0?this.overridePattern=a(h.param):this.overridePattern=void 0;break;case"bassprog":this.bassInstrument=h.value,h.octaveShift!=null&&h.octaveShift!=null?this.bassOctaveShift=h.octaveShift:this.bassOctaveShift=0;break;case"chordprog":this.chordInstrument=h.value,h.octaveShift!=null&&h.octaveShift!=null?this.chordOctaveShift=h.octaveShift:this.chordOctaveShift=0;break;case"bassvol":this.boomVolume=h.param;break;case"chordvol":this.chickVolume=h.param;break;default:console.log("unhandled midi param",h)}},e.prototype.finish=function(){this.chordTrackEmpty()||(this.chordTrackFinished=!0)},e.prototype.addTrack=function(h){this.chordTrackEmpty()||h.push(this.chordTrack)},e.prototype.findChord=function(h){if(this.gChordTacet)return"break";if(this.chordTrackFinished||!h.chord||h.chord.length===0)return null;for(var g=0;g<h.chord.length;g++){var p=h.chord[g];if(p.position==="default")return p.name;if(this.breakSynonyms.indexOf(p.name.toLowerCase())>=0)return"break"}return null},e.prototype.interpretChord=function(h){if(h.length!==0){if(h==="break")return{chick:[]};var g=h.substring(0,1);if(g==="("){if(h=h.substring(1,h.length-1),h.length===0)return;g=h.substring(0,1)}var p=this.basses[g];if(p){for(var d=this.transpose;d<-8;)d+=12;for(;d>8;)d-=12;p+=d,p<33?p+=12:p>44&&(p-=12);var f=p;p+=this.bassOctaveShift*12;var c=p-5,u;h.length===1&&(u=this.chordNotes(p,""));var i=h.substring(1),v=i.substring(0,1);v==="b"||v==="♭"?(f--,p--,c--,i=i.substring(1)):(v==="#"||v==="♯")&&(f++,p++,c++,i=i.substring(1));var b=i.split("/");if(u=this.chordNotes(f,b[0]),u.length>=3){var m=u[2]-u[0];c=c+m-7}if(b.length===2){var w=this.basses[b[1].substring(0,1)];if(w){var _=b[1].substring(1),T={"#":1,"♯":1,b:-1,"♭":-1}[_]||0;p=this.basses[b[1].substring(0,1)]+T+d,p+=this.bassOctaveShift*12,c=p}}return{boom:p,boom2:c,chick:u}}}},e.prototype.chordNotes=function(h,g){var p=this.chordIntervals[g];p||(g.slice(0,2).toLowerCase()==="ma"||g[0]==="M"?p=this.chordIntervals.M:g[0]==="m"||g[0]==="-"?p=this.chordIntervals.m:p=this.chordIntervals.M),h+=12,h+=this.chordOctaveShift*12;for(var d=[],f=0;f<p.length;f++)d.push(h+p[f]);return d},e.prototype.writeNote=function(h,g,p,d,f,c){h!==void 0&&this.chordTrack.push({cmd:"note",pitch:h,volume:p,start:this.lastBarTime+d*l(g,this.tempoChangeFactor),duration:l(f,this.tempoChangeFactor),gap:0,instrument:c})},e.prototype.chordTrackEmpty=function(){for(var h=!0,g=0;g<this.chordTrack.length&&h;g++)this.chordTrack[g].cmd==="note"&&(h=!1);return h},e.prototype.resolveChords=function(h,g){if(!this.hasRhythmHead){var p=this.meter.num,d=this.meter.den,f=1/d,c=f/2,u=parseInt(p,10)/parseInt(d,10),i=u-(g-h)/this.tempoChangeFactor;Math.abs(i)<1e-5&&(i=0),(this.currentChords.length===0||this.currentChords[0].beat!==0)&&this.currentChords.unshift({beat:0,chord:this.chordLastBar});var v=r(this.currentChords,8*p/d),b=this.overridePattern?this.overridePattern:this.rhythmPatterns[p+"/"+d];if(i){b=[];for(var m=(g-h)/this.tempoChangeFactor*8,w=0;w<m/2;w+=2)b.push("chick"),b.push("")}if(!b){b=[];for(var w=0;w<8*p/d/2;w++)b.push("chick"),b.push("")}for(var _=!0,T=Math.min(b.length,v.length),w=0;w<T;w++){w>0&&v[w-1]&&v[w]&&v[w-1].boom!==v[w].boom&&(_=!0);var q=b[w],I=q.indexOf("boom")>=0,E=!I&&w!==0&&b[0].indexOf("boom")>=0&&(!v[w-1]||v[w-1].boom!==v[w].boom),P=t(v[w],q,_,E);I&&(_=!1);for(var x=0;x<P.length;x++)this.writeNote(P[x],.125,I||E?this.boomVolume:this.chickVolume,w,c,I||E?this.bassInstrument:this.chordInstrument),E?E=!1:I=!1}}},e.prototype.processChord=function(h){if(!this.chordTrackFinished){var g=this.findChord(h);if(g){var p=this.interpretChord(g);if(p){this.chordTrack.length===0&&this.chordTrack.push({cmd:"program",channel:this.chordChannel,instrument:this.chordInstrument}),this.lastChord=p;var d=s(this.lastBarTime,o(h.time));this.currentChords.push({chord:this.lastChord,beat:d,start:o(h.time)})}}}};function t(h,g,p,d){var f=[];if(!h)return f;g.indexOf("boom")>=0?f.push(p?h.boom:h.boom2):d&&f.push(h.boom);var c=h.chick.length;if(g.indexOf("chick")>=0)for(var u=0;u<c;u++)f.push(h.chick[u]);switch(g){case"DO":f.push(h.chick[0]);break;case"MI":f.push(h.chick[1]);break;case"SOL":f.push(n(h,2));break;case"TI":f.push(n(h,3));break;case"TOP":f.push(n(h,4));break;case"do":f.push(h.chick[0]+12);break;case"mi":f.push(h.chick[1]+12);break;case"sol":f.push(n(h,2)+12);break;case"ti":f.push(n(h,3)+12);break;case"top":f.push(n(h,4)+12);break}return f}function n(h,g){var p=Math.floor(g/h.chick.length),d=h.chick[g%h.chick.length];return d+p*12}function a(h){for(var g=[],p=0;p<h.length;p++){var d=h[p];switch(d){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(h,g,p){var d=[];if(h.length===0)return d;for(var f=h[0].chord,c=1;c<h.length;c++){for(var u=h[c];d.length<u.beat;)d.push(f);f=u.chord}for(;d.length<g;)d.push(f);return d}function s(h,g){var p=g-h;return p*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 o(h){return h/1e6}function l(h,g){return Math.round(h*g*1e6)/1e6}return jr=e,jr}var Ur,as;function Ll(){if(as)return Ur;as=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(n){var a=(n.accidental?n.accidental[0]:"x")+n.verticalPos;return e[a]}return Ur=t,Ur}var Yr,is;function Ng(){if(is)return Yr;is=1;var e,t=Ig(),n=Ll();return(function(){var a,r,s,o,l,h=1,g,p,d,f,c,u,i={num:4,den:4},v=128,b,m=!0,w=105,_=95,T=85,q=[[w,_,T]],I=.25,E,P,x=0,M,N={},D,k=0,S,z=0,L=-.001,R=.4;e=function(G,V,H,U){V||(V={}),U||(U={}),a=[],r=[0,0,0,0,0,0,0],o=[],l=V.qpm,h=1,g=void 0,p=void 0,d=void 0,f=void 0,c=0,S=H,i={num:4,den:4},m=!0,w=105,_=95,T=85,q=[],I=.25,E=void 0,P=void 0,x=0,M=[],N={},D=1,G.length>0&&G[0].length>0&&(k=G[0][0].pickupLength),V.bassprog!==void 0&&!U.bassprog&&(U.bassprog=[V.bassprog]),V.bassvol!==void 0&&!U.bassvol&&(U.bassvol=[V.bassvol]),V.chordprog!==void 0&&!U.chordprog&&(U.chordprog=[V.chordprog]),V.chordvol!==void 0&&!U.chordvol&&(U.chordvol=[V.chordvol]),V.gchord!==void 0&&!U.gchord&&(U.gchord=[V.gchord]),u=new t(G.length,V.chordsOff,U,i),B(G,V);for(var Q=0;Q<G.length;Q++){s=0,u.setTranspose(s);var ae=G[Q];d=[{cmd:"program",channel:Q,instrument:g}],f=void 0,b=0,u.setLastBarTime(0);var ce=!1;(V.voicesOff===!0||V.voicesOff&&V.voicesOff.length&&V.voicesOff.indexOf(Q)>=0)&&(ce=!0);for(var ge=0;ge<ae.length;ge++){var se=ae[ge];switch(se.el_type){case"name":f={cmd:"text",type:"name",text:se.trackName};break;case"note":J(se,ce);break;case"key":r=X(se);break;case"meter":i=se,u.setMeter(i),I=O(i),qe();break;case"tempo":l?h=se.qpm?l/se.qpm:1:l=se.qpm,u.setTempoChangeFactor(h);break;case"transpose":s=se.transpose,u.setTranspose(s);break;case"bar":u.barEnd(se),a=[],Q===0&&ze(G.length+1),u.setRhythmHead(!1),b=C(se.time),u.setLastBarTime(b);break;case"bagpipes":break;case"instrument":if(g===void 0&&(g=se.program),p=se.program,d.length>0&&d[d.length-1].cmd==="program")d[d.length-1].instrument=se.program;else{var ue;for(ue=d.length-1;ue>=0&&d[ue].cmd!=="program";ue--);(ue<0||d[ue].instrument!==se.program)&&d.push({cmd:"program",channel:0,instrument:se.program})}break;case"channel":y(se.channel);break;case"drum":N=_e(se.params),qe();break;case"gchordOn":u.gChordOn(se);break;case"beat":w=se.beats[0],_=se.beats[1],T=se.beats[2],se.volumesPerNotePitch?q=se.volumesPerNotePitch:q=[];break;case"vol":E=se.volume;break;case"volinc":P=se.volume;break;case"beataccents":m=se.value;break;case"gchord":case"bassprog":case"chordprog":case"bassvol":case"chordvol":case"gchordbars":u.paramChange(se);break;default:console.log("MIDI creation. Unknown el_type: "+se.el_type+`
90
+ `);break}}d[0].instrument===void 0&&(d[0].instrument=g||0),f&&d.unshift(f),o.push(d),u.finish(),M.length>0}return V.detuneOctave&&De(o,parseInt(V.detuneOctave,10)),u.addTrack(o),M.length>0&&o.push(M),{tempo:l,instrument:g,tracks:o,totalDuration:c}};function y(G){for(var V=d.length-1;V>=0;V--)if(d[V].cmd==="program"){d[V].channel=G;return}}function C(G){return G/1e6}function A(G){return Math.round(G*h*1e6)/1e6}function B(G,V){for(var H=0;H<G.length;H++){for(var U=G[H],Q={},ae=V.qpm,ce=0,ge=1,se=0;se<U.length;se++){var ue=U[se];if(ue.el_type==="tempo"){ae?ge=ue.qpm?ae/ue.qpm:1:ae=ue.qpm;continue}ue.time=ce;var Ae=ue.duration?ue.duration:0;if(ce+=Math.round(Ae*ge*1e6),ue.pitches){for(var Be=0;Be<ue.pitches.length;Be++){var pe=ue.pitches[Be];if(pe){if(pe.duration=ue.duration,pe.startTie)Q[pe.pitch]===void 0?Q[pe.pitch]={el:se,pitch:Be}:(U[Q[pe.pitch].el].pitches[Q[pe.pitch].pitch].duration+=pe.duration,ue.pitches[Be]=null);else if(pe.endTie){var be=Q[pe.pitch];if(be){var Ge=pe.duration;delete U[be.el].pitches[be.pitch].startTie,U[be.el].pitches[be.pitch].duration+=Ge,ue.pitches[Be]=null,delete Q[pe.pitch]}else delete pe.endTie}}}delete ue.duration}}for(var ve in Q)if(Q.hasOwnProperty(ve)){var nt=Q[ve];delete U[nt.el].pitches[nt.pitch].startTie}}}function O(G){switch(parseInt(G.den,10)){case 2:return .5;case 4:return .25;case 8:return G.num%3===0?.375:.125;case 16:return .125}return .25}function $(G,V,H){var U=H-G;return U/V}function F(G,V,H){if(V)return 0;let U=w,Q=_,ae=T;H!==void 0&&q.length>=H+1&&(U=q[H][0],Q=q[H][1],ae=q[H][2]);var ce;if(E!==void 0)ce=E,E=void 0;else if(!m)ce=Q;else if(k>G)ce=ae;else{var ge=$(b,O(i),G);ge===0?ce=U:parseInt(ge,10)===ge?ce=Q:ce=ae}return P&&(ce+=P,P=void 0),ce<0&&(ce=0),ce>127&&(ce=127),V?0:ce}function W(G,V){var H={};if(G.decoration)for(var U=0;U<G.decoration.length;U++)G.decoration[U]==="staccato"?H.thisBreakBetweenNotes="staccato":G.decoration[U]==="tenuto"?H.thisBreakBetweenNotes="tenuto":G.decoration[U]==="accent"?H.velocity=Math.min(127,V*1.5):G.decoration[U]==="trill"?H.noteModification="trill":G.decoration[U]==="lowermordent"?H.noteModification="lowermordent":G.decoration[U]==="uppermordent"?H.noteModification="pralltriller":G.decoration[U]==="mordent"?H.noteModification="mordent":G.decoration[U]==="turn"?H.noteModification="turn":G.decoration[U]==="roll"?H.noteModification="roll":G.decoration[U]==="pralltriller"?H.noteModification="pralltriller":G.decoration[U]==="trillh"&&(H.noteModification="trillh");return H}function te(G,V){var H=V.start,U=V.duration,Q=A(1/32);switch(G){case"trill":for(var ae=2;U>0;)d.push({cmd:"note",pitch:V.pitch+ae,volume:V.volume,start:H,duration:Q,gap:0,instrument:p,style:"decoration"}),ae=ae===2?0:2,U-=Q,H+=Q;break;case"trillh":for(var ae=1;U>0;)d.push({cmd:"note",pitch:V.pitch+ae,volume:V.volume,start:H,duration:Q,gap:0,instrument:p,style:"decoration"}),ae=ae===1?0:1,U-=Q,H+=Q;break;case"pralltriller":d.push({cmd:"note",pitch:V.pitch,volume:V.volume,start:H,duration:Q,gap:0,instrument:p,style:"decoration"}),U-=Q,H+=Q,d.push({cmd:"note",pitch:V.pitch+2,volume:V.volume,start:H,duration:Q,gap:0,instrument:p,style:"decoration"}),U-=Q,H+=Q,d.push({cmd:"note",pitch:V.pitch,volume:V.volume,start:H,duration:U,gap:0,instrument:p});break;case"mordent":case"lowermordent":d.push({cmd:"note",pitch:V.pitch,volume:V.volume,start:H,duration:Q,gap:0,instrument:p,style:"decoration"}),U-=Q,H+=Q,d.push({cmd:"note",pitch:V.pitch-2,volume:V.volume,start:H,duration:Q,gap:0,instrument:p,style:"decoration"}),U-=Q,H+=Q,d.push({cmd:"note",pitch:V.pitch,volume:V.volume,start:H,duration:U,gap:0,instrument:p});break;case"turn":Q=V.duration/4,d.push({cmd:"note",pitch:V.pitch+2,volume:V.volume,start:H,duration:Q,gap:0,instrument:p,style:"decoration"}),d.push({cmd:"note",pitch:V.pitch,volume:V.volume,start:H+Q,duration:Q,gap:0,instrument:p,style:"decoration"}),d.push({cmd:"note",pitch:V.pitch-1,volume:V.volume,start:H+Q*2,duration:Q,gap:0,instrument:p,style:"decoration"}),d.push({cmd:"note",pitch:V.pitch,volume:V.volume,start:H+Q*3,duration:Q,gap:0,instrument:p,style:"decoration"});break;case"roll":for(;U>0;)d.push({cmd:"note",pitch:V.pitch,volume:V.volume,start:H,duration:Q,gap:0,instrument:p,style:"decoration"}),U-=Q*2,H+=Q*2;break}}function J(G,V){var H=F(C(G.time),V);u.processChord(G);var U;if(G.gracenotes&&G.pitches&&G.pitches.length>0&&G.pitches[0]&&(U=ne(G.gracenotes,G.pitches[0].duration),G.elem&&(G.elem.midiGraceNotePitches=ee(U,C(G.time),H*2/3,p))),G.elem){var Q=C(G.time),ae=Q/I/l*60*1e3;if(G.elem.currentTrackMilliseconds===void 0)G.elem.currentTrackMilliseconds=ae,G.elem.currentTrackWholeNotes=Q;else if(G.elem.currentTrackMilliseconds.length===void 0)G.elem.currentTrackMilliseconds!==ae&&(G.elem.currentTrackMilliseconds=[G.elem.currentTrackMilliseconds,ae],G.elem.currentTrackWholeNotes=[G.elem.currentTrackWholeNotes,Q]);else{for(var ce=!1,ge=0;ge<G.elem.currentTrackMilliseconds.length;ge++)G.elem.currentTrackMilliseconds[ge]===ae&&(ce=!0);ce||(G.elem.currentTrackMilliseconds.push(ae),G.elem.currentTrackWholeNotes.push(Q))}}if(G.pitches){var se="",ue=W(G,H);ue.thisBreakBetweenNotes&&(se=ue.thisBreakBetweenNotes),ue.velocity&&(H=ue.velocity);var Ae=G.pitches;G.style==="rhythm"&&(Ae=u.setRhythmHead(!0,G)),G.elem&&(G.elem.midiPitches=[]);for(var Be=0;Be<Ae.length;Be++){let Ze=H;!ue.velocity&&Array.isArray(G.decoration)&&G.decoration.length>Be&&(Ze=F(C(G.time),V,Be));var pe=Ae[Be];if(pe){pe.startSlur&&(x+=pe.startSlur.length),pe.endSlur&&(x-=pe.endSlur.length);var be=pe.actualPitch?pe.actualPitch:oe(pe);if(p===v&&S){var Ge=n(pe);Ge&&S[Ge]&&(be=S[Ge].sound)}var ve={cmd:"note",pitch:be,volume:Ze,start:C(G.time),duration:A(pe.duration),instrument:p,startChar:G.elem.startChar,endChar:G.elem.endChar};if(ve=he(ve),G.gracenotes&&(ve.duration=ve.duration/2,ve.start=ve.start+ve.duration),G.elem&&G.elem.midiPitches.push(ve),ue.noteModification)te(ue.noteModification,ve);else{switch(x>0?ve.endType="tenuto":se&&(ve.endType=se),ve.endType){case"tenuto":ve.gap=L;break;case"staccato":var nt=ve.duration*R;ve.gap=l/60*nt;break;default:ve.gap=z;break}d.push(ve)}}}d.length-1}var Ue=ie(G);c=Math.max(c,C(G.time)+A(Ue))}function ie(G){return G.pitches&&G.pitches.length>0&&G.pitches[0]?G.pitches[0].duration:G.elem?G.elem.duration:G.duration}var re=[0,2,4,5,7,9,11];function oe(G){if(G.midipitch!==void 0)return G.midipitch;var V=G.pitch;if(G.accidental)switch(G.accidental){case"sharp":a[V]=1;break;case"flat":a[V]=-1;break;case"natural":a[V]=0;break;case"dblsharp":a[V]=2;break;case"dblflat":a[V]=-2;break;case"quartersharp":a[V]=.25;break;case"quarterflat":a[V]=-.25;break}var H=de(V)*12+re[Te(V)]+60;return a[V]!==void 0?H+=a[V]:H+=r[Te(V)],H+=s,H}function X(G){var V=[0,0,0,0,0,0,0];if(!G.accidentals)return V;for(var H=0;H<G.accidentals.length;H++){var U=G.accidentals[H],Q;switch(U.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 ae=U.note.toLowerCase(),ce=Te(ae.charCodeAt(0)-99);V[ce]+=Q}return V}function ne(G,V){for(var H=0,U=[],Q,ae=0;ae<G.length;ae++)Q=G[ae],H+=Q.duration;var ce=V/2/H;for(ae=0;ae<G.length;ae++){Q=G[ae];var ge=oe(Q);if(p===v&&S){var se=n(Q);se&&S[se]&&(ge=S[se].sound)}var ue={pitch:ge,duration:Q.duration*ce};ue=he(ue),U.push(ue)}return U}function ee(G,V,H,U){var Q=[];H=Math.round(H);for(var ae=0;ae<G.length;ae++){var ce=G[ae];d.push({cmd:"note",pitch:ce.pitch,volume:H,start:V,duration:ce.duration,gap:0,instrument:U,style:"grace"}),Q.push({pitch:ce.pitch,durationInMeasures:ce.duration,volume:H,instrument:U}),V+=ce.duration}return Q}function he(G){var V=""+G.pitch;return V.indexOf(".75")>=0?(G.pitch=Math.round(G.pitch),G.cents=-50):V.indexOf(".25")>=0&&(G.pitch=Math.round(G.pitch),G.cents=50),G}function de(G){return Math.floor(G/7)}function Te(G){return G=G%7,G<0&&(G+=7),G}function _e(G){if(G.pattern.length===0||G.on===!1)return{on:!1};for(var V=G.pattern[0],H=[],U="",Q=0,ae=0;ae<V.length;ae++)if(V[ae]==="d"&&Q++,V[ae]==="d"||V[ae]==="z")U.length!==0?(H.push(U),U=V[ae]):U=U+V[ae];else{if(U.length===0)return{on:!1};U=U+V[ae]}if(U.length!==0&&H.push(U),G.pattern.length!==Q*2+1)return{on:!1};for(var ce={on:!0,bars:G.bars,pattern:[]},ge=O(i),se=0,ue=0;ue<H.length;ue++){U=H[ue];for(var Ae=1,Be=!1,pe=0,be=1;be<U.length;be++)switch(U[be]){case"/":pe!==0&&(Ae*=pe),pe=0,Be=!0;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":pe=pe*10+U[be];break;default:return{on:!1}}Be?(pe===0&&(pe=2),Ae/=pe):pe&&(Ae*=pe),U[0]==="d"?(ce.pattern.push({len:Ae*ge,pitch:G.pattern[1+se],velocity:G.pattern[1+se+Q]}),se++):ce.pattern.push({len:Ae*ge,pitch:null})}return D=G.bars?G.bars:1,ce}function qe(){if(!(!N||!N.pattern)){for(var G=N,V=0,H=i.num/i.den,U=0;U<G.pattern.length;U++)V+=G.pattern[U].len;var Q=V/D/H;for(U=0;U<G.pattern.length;U++)G.pattern[U].len=G.pattern[U].len/Q;N=G}}function ze(G){if(!(M.length===0&&!N.on)){var V=i.num/i.den;if(M.length===0){if(c<V)return;M.push({cmd:"program",channel:G,instrument:v})}if(N.on)for(var H=b,U=0;U<N.pattern.length;U++){var Q=A(N.pattern[U].len);N.pattern[U].pitch&&M.push({cmd:"note",pitch:N.pattern[U].pitch,volume:N.pattern[U].velocity,start:H,duration:Q,gap:0,instrument:v}),H+=Q}}}function De(G,V){for(var H={},U=0;U<G.length;U++)for(var Q=0;Q<G[U].length;Q++){var ae=G[U][Q];ae.cmd==="note"&&(H[ae.start]===void 0&&(H[ae.start]=[]),H[ae.start].push({track:U,event:Q,pitch:ae.pitch}))}var ce=Object.keys(H);for(U=0;U<ce.length;U++){var ge=H[ce[U]];if(ge.length>1){ge=ge.sort(function(pe,be){return pe.pitch-be.pitch});var se=ge[ge.length-1],ue=se.pitch%12,Ae=!1;for(Q=0;!Ae&&Q<ge.length-1;Q++)ge[Q].pitch%12===ue&&(Ae=!0);if(Ae){var Be=G[se.track][se.event];Be.cents||(Be.cents=0),Be.cents+=V}}}}})(),Yr=e,Yr}var Wr,ss;function Pg(){if(ss)return Wr;ss=1;function e(h,g){g||(g={});for(var p=!!g.lineBreaks,d=[],f=!1,c=[],u=[],i=[],v=[],b=[],m=[],w=[],_=0;_<h.length;_++){var T=l(h[_]);if(T.staff){if(f&&!T.vskip)for(var q=d[d.length-1],I=0;I<q.staff.length;I++){var E=T.staff[I],P=q.staff[I];if(E&&(o(E.meter,c[I])||(n(E.meter,E.voices),c[I]=E.meter,delete E.meter),o(E.key,u[I])||(a(E.key,E.voices),u[I]=E.key,delete E.key),E.title&&(P.abbrevTitle=E.title),o(E.clef,i[I])||(r(E.clef,E.voices),i[I]=E.clef,delete E.clef),o(E.vocalfont,v[I])||(s(E.vocalfont,E.voices,"vocalfont"),v[I]=E.vocalfont,delete E.vocalfont),o(E.gchordfont,b[I])||(s(E.gchordfont,E.voices,"gchordfont"),b[I]=E.gchordfont,delete E.gchordfont),o(E.tripletfont,m[I])||(s(E.tripletfont,E.voices,"tripletfont"),m[I]=E.tripletfont,delete E.tripletfont),o(E.annotationfont,w[I])||(s(E.annotationfont,E.voices,"annotationfont"),w[I]=E.annotationfont,delete E.annotationfont)),E)for(var x=0;x<P.voices.length;x++){var M=P.voices[x],N=E.voices[x];p&&M.push({el_type:"break"}),N&&(P.voices[x]=M.concat(N))}}else{for(var D=0;D<T.staff.length;D++)u[D]=T.staff[D].key,c[D]=T.staff[D].meter,i[D]=T.staff[D].clef;d.push(l(T))}f=!0}else f=!1,d.push(T)}return d}function t(h,g){return h==="abselem"?"abselem":g}function n(h,g){h.el_type="meter",h.startChar=-1,h.endChar=-1;for(var p=0;p<g.length;p++)g[p].unshift(h)}function a(h,g){h.el_type="key",h.startChar=-1,h.endChar=-1;for(var p=0;p<g.length;p++)g[p].unshift(h)}function r(h,g){h.el_type="clef",h.startChar=-1,h.endChar=-1;for(var p=0;p<g.length;p++)g[p].unshift(h)}function s(h,g,p){h.el_type="font",h.type=p,h.startChar=-1,h.endChar=-1;for(var d=0;d<g.length;d++)g[d].unshift(h)}function o(h,g){if(!h)return!0;var p=JSON.stringify(h,t),d=JSON.stringify(g,t);return p===d}function l(h){for(var g={},p=Object.keys(h),d=0;d<p.length;d++)if(p[d]!=="staff")g[p[d]]=h[p[d]];else{g.staff=[];for(var f=0;f<h.staff.length;f++){for(var c={},u=Object.keys(h.staff[f]),i=0;i<u.length;i++)if(u[i]!=="voices")c[u[i]]=h.staff[f][u[i]];else{c.voices=[];for(var v=0;v<h.staff[f].voices.length;v++)c.voices.push([].concat(h.staff[f].voices[v]))}g.staff.push(c)}}return g}return Wr=e,Wr}var Vr,os;function Ol(){if(os)return Vr;os=1;var e=at(),t=Xe(),n=Bl(),a=Ng(),r=Pg(),s=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 o(f,c,u,i){for(var v=0;v<i.length;v++)f[u][i[v]]=c[u][i[v]]}this.copyTopInfo=function(f){var c=["tempo","title","header","rhythm","origin","composer","author","partOrder"];o(this,f,"metaText",c),o(this,f,"metaTextInfo",c)},this.copyBottomInfo=function(f){var c=["unalignedWords","book","source","discography","notes","transcription","history","abc-copyright","abc-creator","abc-edited-by","footer"];o(this,f,"metaText",c),o(this,f,"metaTextInfo",c)},this.getBeatLength=function(){var f=this.getMeterFraction(),c=1;return f.num===6||f.num===9||f.num===12||f.num===3&&f.den===8?c=3:f.den===8&&(f.num===5||f.num===7)&&(c=2),c/f.den};function l(f,c){for(var u=0,i=0;i<f.length;i++)if(f[i].staff)for(var v=0;v<f[i].staff.length;v++)for(var b=0;b<f[i].staff[v].voices.length;b++)for(var m=f[i].staff[v].voices[b],w=1,_=0;_<m.length;_++){var T=m[_].rest&&m[_].rest.type==="spacer";if(m[_].startTriplet&&(w=m[_].tripletMultiplier),m[_].duration&&!T&&m[_].el_type!=="tempo"&&(u+=m[_].duration*w),m[_].endTriplet&&(w=1),u>=c&&(u-=c),m[_].el_type==="bar")return u}return u}this.getPickupLength=function(){var f=this.getBarLength(),c=l(this.lines,f);return c<1e-8||f-c<1e-8?0:c},this.getBarLength=function(){var f=this.getMeterFraction();return f.num/f.den},this.getTotalTime=function(){return this.totalTime},this.getTotalBeats=function(){return this.totalBeats},this.millisecondsPerMeasure=function(f){var c;if(f)c=f;else{var u=this.metaText?this.metaText.tempo:null;c=this.getBpm(u)}c<=0&&(c=1);var i=this.getBeatsPerMeasure(),v=i/c;return v*6e4},this.getBeatsPerMeasure=function(){var f=this.getBeatLength(),c=this.getBarLength();return c/f},this.getMeter=function(){for(var f=0;f<this.lines.length;f++){var c=this.lines[f];if(c.staff)for(var u=0;u<c.staff.length;u++){var i=c.staff[u].meter;if(i)return i}}return{type:"common_time"}},this.getMeterFraction=function(){var f=this.getMeter(),c=4,u=4;if(f)if(f.type==="specified"){if(f.value&&f.value.length>0&&f.value[0].num.indexOf("+")>0){var i=f.value[0].num.split("+");c=0;for(var v=0;v<i.length;v++)c+=parseInt(i[v],10)}else c=parseInt(f.value[0].num,10);u=parseInt(f.value[0].den,10)}else f.type==="cut_time"?(c=2,u=2):f.type==="common_time"&&(c=4,u=4);return this.meter={num:c,den:u},this.meter},this.getKeySignature=function(){for(var f=0;f<this.lines.length;f++){var c=this.lines[f];if(c.staff){for(var u=0;u<c.staff.length;u++)if(c.staff[u].key)return c.staff[u].key}}return{}},this.getElementFromChar=function(f){for(var c=0;c<this.lines.length;c++){var u=this.lines[c];if(u.staff)for(var i=0;i<u.staff.length;i++)for(var v=u.staff[i],b=0;b<v.voices.length;b++)for(var m=v.voices[b],w=0;w<m.length;w++){var _=m[w];if(_.startChar&&_.endChar&&_.startChar<=f&&_.endChar>f)return _}}return null};function h(f){for(var c,u,i,v,b=f.length-1;b>=0;b--){var m=f[b];m.type==="bar"?(m.top=i,m.nextTop=c,c=i,m.bottom=v,m.nextBottom=u,u=v):m.type==="event"&&(i=m.top,v=m.top+m.height)}}function g(f){var c=[];for(var u in f)f.hasOwnProperty(u)&&c.push(f[u]);return c=c.sort(function(i,v){var b=i.milliseconds-v.milliseconds;return b!==0?b:i.type==="bar"?-1:1}),c}this.addElementToEvents=function(f,c,u,i,v,b,m,w,_,T){if(c.hint)return{isTiedState:void 0,duration:0};var q=c.durationClass?c.durationClass:c.duration;if(c.abcelem.rest&&c.abcelem.rest.type==="spacer"&&(q=0),q>0){for(var I=[],E=0;E<c.elemset.length;E++)c.elemset[E]!==null&&I.push(c.elemset[E]);var P=c.startTie;if(_!==void 0)f["event"+_].elements.push(I),T&&(f["event"+u]||(f["event"+u]={type:"event",milliseconds:u,line:b,measureNumber:m,top:i,height:v,left:null,width:0,elements:[],startChar:null,endChar:null,startCharArray:[],endCharArray:[]}),f["event"+u].measureStart=!0,T=!1),P||(_=void 0);else{if(!f["event"+u])f["event"+u]={type:"event",milliseconds:u,line:b,measureNumber:m,top:i,height:v,left:c.x,width:c.w,elements:[I],startChar:c.abcelem.startChar,endChar:c.abcelem.endChar,startCharArray:[c.abcelem.startChar],endCharArray:[c.abcelem.endChar],midiPitches:c.abcelem.midiPitches?e.cloneArray(c.abcelem.midiPitches):[]},c.abcelem.midiGraceNotePitches&&(f["event"+u].midiGraceNotePitches=e.cloneArray(c.abcelem.midiGraceNotePitches));else{if(f["event"+u].left?f["event"+u].left=Math.min(f["event"+u].left,c.x):f["event"+u].left=c.x,f["event"+u].elements.push(I),f["event"+u].startCharArray.push(c.abcelem.startChar),f["event"+u].endCharArray.push(c.abcelem.endChar),f["event"+u].startChar===null&&(f["event"+u].startChar=c.abcelem.startChar),f["event"+u].endChar===null&&(f["event"+u].endChar=c.abcelem.endChar),c.abcelem.midiPitches&&c.abcelem.midiPitches.length){f["event"+u].midiPitches||(f["event"+u].midiPitches=[]);for(var E=0;E<c.abcelem.midiPitches.length;E++)f["event"+u].midiPitches.push(c.abcelem.midiPitches[E])}if(c.abcelem.midiGraceNotePitches&&c.abcelem.midiGraceNotePitches.length){f["event"+u].midiGraceNotePitches||(f["event"+u].midiGraceNotePitches=[]);for(var x=0;x<c.abcelem.midiGraceNotePitches.length;x++)f["event"+u].midiGraceNotePitches.push(c.abcelem.midiGraceNotePitches[x])}}T&&(f["event"+u].measureStart=!0,T=!1)}}return{isTiedState:_,duration:q/w,nextIsBar:T||c.type==="bar"}},this.makeVoicesArray=function(){for(var f=[],c=[],u={},i=0;i<this.engraver.staffgroups.length;i++){var v=this.engraver.staffgroups[i];if(v&&v.staffs&&v.staffs.length>0){var b=v.staffs[0],m=b.absoluteY,w=m-b.top*t.STEP,_=v.staffs[v.staffs.length-1];m=_.absoluteY;for(var T=m-_.bottom*t.STEP,q=T-w,I=v.voices,E=0;E<I.length;E++)if(!(I[E].staff&&I[E].staff.isTabStaff)){var P=!1;f[E]||(f[E]=[]),c[E]===void 0&&(c[E]=0);for(var x=I[E].children,M=0;M<x.length;M++)x[M].type==="tempo"&&(u[c[E]]=this.getBpm(x[M].abcelem)),f[E].push({top:w,height:q,line:v.line,measureNumber:c[E],elem:x[M]}),x[M].type==="bar"&&P&&c[E]++,(x[M].type==="note"||x[M].type==="rest")&&(P=!0)}}}return this.tempoLocations=u,f},this.setupEvents=function(f,c,u,i){i||(i=1);for(var v=[],b={},m=f,w,_=!0,T=this.makeVoicesArray(),q=0,I=0;I<T.length;I++){var E=m,P=Math.round(E*1e3),x=0,M=-1,N=T[I],D=u;c=this.getBeatLength()*D/60;for(var k=-1,S=0;S<N.length;S++){var z=N[S].measureNumber;k!==z&&this.tempoLocations[z]&&(D=this.tempoLocations[z],c=i*this.getBeatLength()*D/60,k=z);var L=N[S].elem,R=this.addElementToEvents(b,L,P,N[S].top,N[S].height,N[S].line,N[S].measureNumber,c,w,_);w=R.isTiedState,_=R.nextIsBar,E+=R.duration;var y;if(L.duration>0&&b["event"+P]&&(y="event"+P),P=Math.round(E*1e3),L.type==="bar"){var C=L.abcelem.type,A=C==="bar_right_repeat"||C==="bar_dbl_repeat",B=L.abcelem.startEnding==="1",O=C==="bar_left_repeat"||C==="bar_dbl_repeat"||C==="bar_right_repeat";if(A){S>0&&(b[y].endX=L.x),M===-1&&(M=S);var $=0;k=-1;for(var F=x;F<M;F++){z=N[F].measureNumber,k!==z&&this.tempoLocations[z]&&(D=this.tempoLocations[z],c=i*this.getBeatLength()*D/60,k=z);var W=N[F].elem;R=this.addElementToEvents(b,W,P,N[F].top,N[F].height,N[F].line,N[F].measureNumber,c,w,_),w=R.isTiedState,_=R.nextIsBar,E+=R.duration,$=P,P=Math.round(E*1e3)}b["event"+$]&&(b["event"+$].endX=N[M].elem.x),_=!0,M=-1}B&&(M=S),O&&(x=S)}}q=Math.max(q,P)}return v=g(b),h(v),d(this.lines,v),v.push({type:"end",milliseconds:q}),this.addUsefulCallbackInfo(v,D*i),v},this.addUsefulCallbackInfo=function(f,c){for(var u=this.millisecondsPerMeasure(c),i=0;i<f.length;i++){var v=f[i];v.millisecondsPerMeasure=u}};function p(f,c){for(;c<f.length&&f[c].left===null;)c++;return f[c]}function d(f,c){if(!(c.length<1)){for(var u=0;u<c.length-1;u++){var i=c[u],v=p(c,u+1);if(i.left!==null){var b=v&&i.top===v.top?v.left:f[i.line].staffGroup.w;i.endX!==void 0?b>i.left&&(i.endX=Math.min(i.endX,b)):i.endX=b}}var m=c[c.length-1];m.endX=f[m.line].staffGroup.w}}this.getBpm=function(f){var c;if(f||(f=this.metaText?this.metaText.tempo:null),f){c=f.bpm;var u=this.getBeatLength(),i=f.duration&&f.duration.length>0?f.duration[0]:u;c=c*i/u}if(!c){c=180;var v=this.getMeterFraction();v&&v.num!==3&&v.num%3===0&&(c=120)}return c},this.setTiming=function(f,c){if(c=c||0,!this.engraver||!this.engraver.staffgroups)return console.log("setTiming cannot be called before the tune is drawn."),this.noteTimings=[],this.noteTimings;var u=this.metaText?this.metaText.tempo:null,i=this.getBpm(u),v=1;f?u&&(v=f/i):f=i;var b=this.getBeatLength(),m=f/60,w=this.getBarLength(),_=w/b*c/m;_&&(_-=this.getPickupLength()/b/m);var T=b*m;return this.noteTimings=this.setupEvents(_,T,f,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(f){f||(f={});var c=n(this,f);return a(c,f,this.formatting.percmap,this.formatting.midi)},this.deline=function(f){return r(this.lines,f)},this.findSelectableElement=function(f){return this.engraver&&this.engraver.selectables?this.engraver.findSelectableElement(f):null},this.getSelectableArray=function(){return this.engraver&&this.engraver.selectables?this.engraver.selectables:[]}};return Vr=s,Vr}var Xr,cs;function zg(){if(cs)return Xr;cs=1;var e=Ja(),t=function(x){var M=this,N={},D="";x.reset(),this.setVisualTranspose=function(k){k!==void 0&&(x.visualTranspose=k)},this.cleanUp=function(k,S,z){c(x),delete x.runningFonts,a(x),x.metaText.tempo&&x.metaText.tempo.bpm&&!x.metaText.tempo.duration&&(x.metaText.tempo.duration=[x.getBeatLength()]);var L=!1,R,y,C;for(R=0;R<x.lines.length;R++)if(x.lines[R].staff!==void 0){var A=!1;for(y=0;y<x.lines[R].staff.length;y++)if(x.lines[R].staff[y]===void 0)L=!0,x.lines[R].staff[y]=null;else for(C=0;C<x.lines[R].staff[y].voices.length;C++)x.lines[R].staff[y].voices[C]===void 0?x.lines[R].staff[y].voices[C]=[]:u(x.lines[R].staff[y].voices[C])&&(A=!0);A||(x.lines[R]=null,L=!0)}if(L&&(x.lines=x.lines.filter(function(re){return!!re}),x.lines.forEach(function(re){re.staff&&(re.staff=re.staff.filter(function(oe){return!!oe}))})),k)for(;h(x.lines,k););if(S){for(L=!1,R=0;R<x.lines.length;R++)if(x.lines[R].staff!==void 0)for(y=0;y<x.lines[R].staff.length;y++){var B=!1;for(C=0;C<x.lines[R].staff[y].voices.length;C++)i(x.lines[R].staff[y].voices[C])&&(B=!0);B||(L=!0,x.lines[R].staff[y]=null)}L&&x.lines.forEach(function(re){re.staff&&(re.staff=re.staff.filter(function(oe){return!!oe}))})}for(o(x.lines),R=0;R<x.lines.length;R++)if(x.lines[R].staff)for(y=0;y<x.lines[R].staff.length;y++)delete x.lines[R].staff[y].workingClef;for(var O=!1;r(x);)O=!0;if(O)for(var $=0,F=E(x.lines,$);F!=="not-found";)F=E(x.lines,$),F?$++:P(x.lines,$);for(var R=0;R<x.lines.length;R++){var W=x.lines[R].staff;if(W)for(x.staffNum=0;x.staffNum<W.length;x.staffNum++)for(W[x.staffNum].clef&&e.fixClef(W[x.staffNum].clef),x.voiceNum=0;x.voiceNum<W[x.staffNum].voices.length;x.voiceNum++){var te=W[x.staffNum].voices[x.voiceNum];l(te,x.staffNum,x.voiceNum,z);for(var J=0;J<te.length;J++)te[J].el_type==="clef"&&e.fixClef(te[J]);if(te.length>0&&te[te.length-1].barNumber){var ie=p(x.lines,R);ie&&(ie.staff[0].barNumber=te[te.length-1].barNumber),delete te[te.length-1].barNumber}}}return delete x.staffNum,delete x.voiceNum,delete x.lineNum,delete x.potentialStartBeam,delete x.potentialEndBeam,delete x.vskipPending,z},this.addTieToLastNote=function(k){var S=d(x);return S&&S.pitches&&S.pitches.length>0?(S.pitches[0].startTie={},k&&(S.pitches[0].startTie.style="dotted"),!0):!1},this.appendElement=function(k,S,z,L){if(L.el_type=k,S!==null&&(L.startChar=S),z!==null&&(L.endChar=z),k==="note"){var R=f(L);R>=.25||L.force_end_beam_last&&x.potentialStartBeam!==void 0?w(x):L.end_beam&&x.potentialStartBeam!==void 0?L.rest===void 0?m(L,x):w(x):L.rest===void 0&&(x.potentialStartBeam===void 0?L.end_beam||(x.potentialStartBeam=L,delete x.potentialEndBeam):x.potentialEndBeam=L)}else w(x);return delete L.end_beam,delete L.force_end_beam_last,L.rest&&L.rest.type==="invisible"&&delete L.decoration,x.lines.length<=x.lineNum||x.lines[x.lineNum].staff.length<=x.staffNum?!1:(b(M,x,L,N,D),!0)},this.appendStartingElement=function(k,S,z,L){c(x);var R;k==="key"&&(R=L.impliedNaturals,delete L.impliedNaturals,delete L.explicitAccidentals);var y=Object.assign({},L);if(x.lines[x.lineNum]){var C=x.lines[x.lineNum].staff;if(C){C.length<=x.staffNum&&(C[x.staffNum]={},C[x.staffNum].clef=Object.assign({},C[0].clef),C[x.staffNum].key=Object.assign({},C[0].key),C[0].meter&&(C[x.staffNum].meter=Object.assign({},C[0].meter)),C[x.staffNum].workingClef=Object.assign({},C[0].workingClef),C[x.staffNum].voices=[[]]),k==="clef"&&(C[x.staffNum].workingClef=y);for(var A=C[x.staffNum].voices[x.voiceNum],B=0;B<A.length;B++){if(A[B].el_type==="note"||A[B].el_type==="bar"){y.el_type=k,y.startChar=S,y.endChar=z,R&&(y.accidentals=R.concat(y.accidentals)),A.push(y);return}if(A[B].el_type===k){y.el_type=k,y.startChar=S,y.endChar=z,R&&(y.accidentals=R.concat(y.accidentals)),A[B]=y;return}}C[x.staffNum][k]=L}}},this.addSubtitle=function(k,S){v(x,{subtitle:{text:k,startChar:S.startChar,endChar:S.endChar}})},this.addSpacing=function(k){x.vskipPending=k},this.addNewPage=function(k){v(x,{newpage:k})},this.addSeparator=function(k,S,z,L){v(x,{separator:{spaceAbove:Math.round(k),spaceBelow:Math.round(S),lineLength:Math.round(z),startChar:L.startChar,endChar:L.endChar}})},this.addText=function(k,S){v(x,{text:{text:k,startChar:S.startChar,endChar:S.endChar}})},this.addCentered=function(k){v(x,{text:[{text:k,center:!0}]})},this.changeVoiceScale=function(k){M.appendElement("scale",null,null,{size:k})},this.changeVoiceColor=function(k){M.appendElement("color",null,null,{color:k})},this.startNewLine=function(k){c(x),k.currentVoiceName&&(D=k.currentVoiceName,N[k.currentVoiceName]=k),x.lines[x.lineNum]===void 0?I(M,x,k):x.lines[x.lineNum].staff===void 0?(x.lineNum++,this.startNewLine(k)):x.lines[x.lineNum].staff[x.staffNum]===void 0?q(M,x,k):x.lines[x.lineNum].staff[x.staffNum].voices[x.voiceNum]===void 0?T(M,x,k):u(x.lines[x.lineNum].staff[x.staffNum].voices[x.voiceNum])?(x.lineNum++,this.startNewLine(k)):k.part&&M.appendElement("part",k.part.startChar,k.part.endChar,{title:k.part.title})},this.setRunningFont=function(k,S){x.runningFonts[k]=S},this.setBarNumberImmediate=function(k){var S=this.getCurrentVoice();if(S&&S.length>0){var z=S[S.length-1];if(z.el_type==="bar")z.barNumber!==void 0&&(z.barNumber=k);else return k-1}return k},this.hasBeginMusic=function(){for(var k=0;k<x.lines.length;k++)if(x.lines[k].staff)return!0;return!1},this.isFirstLine=function(k){for(var S=k-1;S>=0;S--)if(x.lines[S].staff!==void 0)return!1;return!0},this.getCurrentVoice=function(){var k=g(x.lines,x.lineNum);if(!k)return null;var S=k.staff[x.staffNum];return S&&S.voices[x.voiceNum]!==void 0?S.voices[x.voiceNum]:null},this.setCurrentVoice=function(k,S,z){x.staffNum=k,x.voiceNum=S,D=z;for(var L=0;L<x.lines.length;L++)if(x.lines[L].staff&&(x.lines[L].staff[k]===void 0||x.lines[L].staff[k].voices[S]===void 0||!u(x.lines[L].staff[k].voices[S])))return x.lineNum=L,!!(!x.lines[L].staff[k]||x.lines[L].staff[k].voices[S]);return x.lineNum=L,!1},this.addMetaText=function(k,S,z){x.metaText[k]===void 0?(x.metaText[k]=S,x.metaTextInfo[k]=z):(typeof x.metaText[k]=="string"&&typeof S=="string"?x.metaText[k]+=`
91
+ `+S:(x.metaText[k]==="string"&&(x.metaText[k]=[{text:x.metaText[k]}]),typeof S=="string"&&(S=[{text:S}]),x.metaText[k]=x.metaText[k].concat(S)),x.metaTextInfo[k].endChar=z.endChar)},this.addMetaTextArray=function(k,S,z){x.metaText[k]===void 0?(x.metaText[k]=[S],x.metaTextInfo[k]=z):(x.metaText[k].push(S),x.metaTextInfo[k].endChar=z.endChar)},this.addMetaTextObj=function(k,S,z){x.metaText[k]=S,x.metaTextInfo[k]=z}};function n(x){if(!x||typeof x=="string")return!1;for(var M=0;M<x.length;M++)if(typeof x[M]!="string")return!1;return!0}function a(x){n(x.metaText.notes)&&(x.metaText.notes=x.metaText.notes.join(`
92
+ `)),n(x.metaText.history)&&(x.metaText.history=x.metaText.history.join(`
93
+ `))}function r(x){for(var M=!1,N=0;N<x.lines.length;N++){var D=x.lines[N];if(D.staff)for(var k=0;k<D.staff.length;k++){for(var S=D.staff[k],z=[],L=0;L<S.voices.length;L++){var R=S.voices[L];z.push({hasOverlay:!1,voice:[],snip:[]});for(var y=0,C=!1,A=-1,B=0;B<R.length;B++){var O=R[B];if(O.el_type==="overlay"&&!C){M=!0,C=!0,A=B,z[L].hasOverlay=!0;for(var $=0;$<N;$++)x.lines[$].staff&&x.lines[$].staff.forEach(re=>{S.voices.length>=re.voices.length&&re.voices.forEach(oe=>{let X=[];oe.forEach(ne=>{ne.el_type==="bar"?X.push(ne):ne.el_type==="note"&&X.push({el_type:"note",duration:ne.duration,rest:{type:"invisible"},startChar:ne.startChar,endChar:ne.endChar})}),re.voices.push(X)})})}else O.el_type==="bar"?(C?(C=!1,z[L].snip.push({start:A,len:B-A}),z[L].voice.push(O)):(y>0&&z[L].voice.push({el_type:"note",duration:y,rest:{type:"invisible"},startChar:O.startChar,endChar:O.endChar}),z[L].voice.push(O)),y=0):O.el_type==="note"?C?z[L].voice.push(O):(!O.rest||O.rest.type!=="spacer")&&(y+=O.duration):(O.el_type==="scale"||O.el_type==="stem"||O.el_type==="overlay"||O.el_type==="style"||O.el_type==="transpose"||O.el_type==="color")&&z[L].voice.push(O)}z[L].hasOverlay&&z[L].snip.length===0&&z[L].snip.push({start:A,len:R.length-A})}for(L=0;L<z.length;L++){var F=z[L];if(F.hasOverlay){F.voice.splice(0,0,{el_type:"stem",direction:"down"}),S.voices.push(F.voice);for(var W=F.snip.length-1;W>=0;W--){var te=F.snip[W];S.voices[L].splice(te.start,te.len),S.voices[L].splice(te.start+1,0,{el_type:"stem",direction:"auto"});var J=s(S.voices[L],te.start);S.voices[L].splice(J,0,{el_type:"stem",direction:"up"})}for(W=0;W<S.voices[S.voices.length-1].length;W++){S.voices[S.voices.length-1][W]=Object.assign({},S.voices[S.voices.length-1][W]);var ie=S.voices[S.voices.length-1][W];ie.el_type==="bar"&&ie.startEnding&&delete ie.startEnding,ie.el_type==="bar"&&ie.endEnding&&delete ie.endEnding}}}}}return M}function s(x,M){for(var N=M-1;N>0&&x[N].el_type!=="bar";N--);return N}function o(x){for(var M=!0,N=0;N<x.length;N++){var D=x[N];if(D.staff){for(var k=0;k<D.staff.length;k++){var S=D.staff[k];if(S.title){for(var z=!1,L=0;L<S.title.length;L++)S.title[L]?(S.title[L]=M?S.title[L].name:S.title[L].subname,S.title[L]?z=!0:S.title[L]=""):S.title[L]="";z||delete S.title}}M=!1}}}function l(x,M,N,D){D[M]||(D[M]=[]),D[M][N]||(D[M][N]=[]);for(var k,S=function(te,J,ie){if(D[M][N][ie]===void 0){for(k=0;k<D[M][N].length;k++)if(D[M][N][k]!==void 0){ie=k;break}if(D[M][N][ie]===void 0){var re=ie*100+1;te.endSlur.forEach(function(ne){re===ne&&--re}),D[M][N][ie]=[re]}}for(var oe,X=0;X<J;X++)oe=D[M][N][ie].pop(),te.endSlur.push(oe);return D[M][N][ie].length===0&&delete D[M][N][ie],oe},z=function(te,J,ie,re){te.startSlur=[],D[M][N][ie]===void 0&&(D[M][N][ie]=[]);for(var oe=ie*100+1,X=0;X<J;X++)re&&(re.forEach(function(ne){oe===ne&&++oe}),re.forEach(function(ne){oe===ne&&++oe}),re.forEach(function(ne){oe===ne&&++oe})),D[M][N][ie].forEach(function(ne){oe===ne&&++oe}),D[M][N][ie].forEach(function(ne){oe===ne&&++oe}),D[M][N][ie].push(oe),te.startSlur.push({label:oe}),te.dottedSlur&&(te.startSlur[te.startSlur.length-1].style="dotted",delete te.dottedSlur),oe++},L=0;L<x.length;L++){var R=x[L];if(R.el_type==="note"){if(R.gracenotes)for(var y=0;y<R.gracenotes.length;y++){if(R.gracenotes[y].endSlur){var C=R.gracenotes[y].endSlur;R.gracenotes[y].endSlur=[];for(var A=0;A<C;A++)S(R.gracenotes[y],1,20)}R.gracenotes[y].startSlur&&(k=R.gracenotes[y].startSlur,z(R.gracenotes[y],k,20))}if(R.endSlur&&(k=R.endSlur,R.endSlur=[],S(R,k,0)),R.startSlur&&(k=R.startSlur,z(R,k,0)),R.pitches){for(var B=[],O=0;O<R.pitches.length;O++)if(R.pitches[O].endSlur){var $=R.pitches[O].endSlur;R.pitches[O].endSlur=[];for(var F=0;F<$;F++){var W=S(R.pitches[O],1,O+1);B.push(W)}}for(O=0;O<R.pitches.length;O++)R.pitches[O].startSlur&&(k=R.pitches[O].startSlur,z(R.pitches[O],k,O+1,B));R.gracenotes&&R.pitches[0].endSlur&&R.pitches[0].endSlur[0]===100&&R.pitches[0].startSlur&&(R.gracenotes[0].endSlur?R.gracenotes[0].endSlur.push(R.pitches[0].startSlur[0].label):R.gracenotes[0].endSlur=[R.pitches[0].startSlur[0].label],R.pitches[0].endSlur.length===1?delete R.pitches[0].endSlur:R.pitches[0].endSlur[0]===100?R.pitches[0].endSlur.shift():R.pitches[0].endSlur[R.pitches[0].endSlur.length-1]===100&&R.pitches[0].endSlur.pop(),D[M][N][1].length===1?delete D[M][N][1]:D[M][N][1].pop())}}}}function h(x,M){for(var N=0;N<x.length;N++)if(x[N].staff!==void 0)for(var D=0;D<x[N].staff.length;D++)for(var k=[],S=0;S<x[N].staff[D].voices.length;S++)for(var z=x[N].staff[D].voices[S],L=0,R=0;R<z.length;R++)if(z[R].el_type==="bar"){if(L++,L>=M&&R<z.length-1){var y=p(x,N);if(!y){var C=JSON.parse(JSON.stringify(x[N]));x.push(Object.assign({},C)),y=x[x.length-1];for(var A=0;A<y.staff.length;A++)for(var B=0;B<y.staff[A].voices.length;B++)y.staff[A].voices[B]=[]}var O=R+1,$=x[N].staff[D].voices[S].slice(O);return x[N].staff[D].voices[S]=x[N].staff[D].voices[S].slice(0,O),y.staff[D].voices[S]=k.concat($.concat(y.staff[D].voices[S])),!0}}else z[R].duration||k.push(z[R]);return!1}function g(x,M){if(x.length<=M)return null;for(;M>=0;){if(x[M].staff)return x[M];M--}return null}function p(x,M){for(M++;x.length>M;){if(x[M].staff)return x[M];M++}return null}function d(x){if(!x.lines[x.lineNum]||!x.lines[x.lineNum].staff||!x.lines[x.lineNum].staff[x.staffNum])return null;var M=x.lines[x.lineNum].staff[x.staffNum].voices[x.voiceNum];if(!M)return null;for(var N=M.length-1;N>=0;N--){var D=M[N];if(D.el_type==="note")return D}return null}function f(x){return x.duration?x.duration:0}function c(x){x.potentialStartBeam&&x.potentialEndBeam&&(x.potentialStartBeam.startBeam=!0,x.potentialEndBeam.endBeam=!0),delete x.potentialStartBeam,delete x.potentialEndBeam}function u(x){for(var M=0;M<x.length;M++)if(x[M].el_type==="note"||x[M].el_type==="bar")return!0;return!1}function i(x){for(var M=0;M<x.length;M++)if(x[M].el_type==="note"&&(x[M].rest===void 0||x[M].chord!==void 0))return!0;return!1}function v(x,M){x.vskipPending&&(M.vskip=x.vskipPending,delete x.vskipPending),x.lines.push(M)}function b(x,M,N,D,k){var S=M.lines[M.lineNum].staff[M.staffNum];if(N.pitches!==void 0){var z=S.workingClef.verticalPos;N.pitches.forEach(function(R){R.verticalPos=R.pitch-z})}if(N.gracenotes!==void 0){var L=S.workingClef.verticalPos;N.gracenotes.forEach(function(R){R.verticalPos=R.pitch-L})}S.voices.length<=M.voiceNum&&(D[k]||(D[k]={}),T(x,M,D[k])),S.voices[M.voiceNum].push(N)}function m(x,M){M.potentialStartBeam.startBeam=!0,x.endBeam=!0,delete M.potentialStartBeam,delete M.potentialEndBeam}function w(x){x.potentialStartBeam!==void 0&&x.potentialEndBeam!==void 0&&(x.potentialStartBeam.startBeam=!0,x.potentialEndBeam.endBeam=!0),delete x.potentialStartBeam,delete x.potentialEndBeam}function _(x,M,N){if(x.runningFonts[M]){for(var D=!1,k=Object.keys(N),S=0;S<k.length;S++)x.runningFonts[M][k[S]]!==N[k[S]]&&(D=!0);D&&(x.lines[x.lineNum].staff[x.staffNum][M]=N)}x.runningFonts[M]=N}function T(x,M,N){var D=M.lines[M.lineNum].staff[M.staffNum];if(D.voices[M.voiceNum]=[],D.title||(D.title=[]),D.title[M.voiceNum]={name:N.name,subname:N.subname},N.style&&x.appendElement("style",null,null,{head:N.style}),N.stem)x.appendElement("stem",null,null,{direction:N.stem});else if(M.voiceNum>0){if(D.voices[0]!==void 0){for(var k=!1,S=0;S<D.voices[0].length;S++)D.voices[0].el_type==="stem"&&(k=!0);if(!k){var z={el_type:"stem",direction:"up"};D.voices[0].splice(0,0,z)}}x.appendElement("stem",null,null,{direction:"down"})}N.scale&&x.appendElement("scale",null,null,{size:N.scale}),N.color&&x.appendElement("color",null,null,{color:N.color})}function q(x,M,N){N.key&&N.key.impliedNaturals&&(N.key.accidentals=N.key.accidentals.concat(N.key.impliedNaturals),delete N.key.impliedNaturals),M.lines[M.lineNum].staff[M.staffNum]={voices:[],clef:N.clef,key:N.key,workingClef:N.clef};var D=M.lines[M.lineNum].staff[M.staffNum];N.stafflines!==void 0&&(D.clef.stafflines=N.stafflines,D.workingClef.stafflines=N.stafflines),N.staffscale&&(D.staffscale=N.staffscale),N.annotationfont&&_(M,"annotationfont",N.annotationfont),N.gchordfont&&_(M,"gchordfont",N.gchordfont),N.tripletfont&&_(M,"tripletfont",N.tripletfont),N.vocalfont&&_(M,"vocalfont",N.vocalfont),N.bracket&&(D.bracket=N.bracket),N.brace&&(D.brace=N.brace),N.connectBarLines&&(D.connectBarLines=N.connectBarLines),N.barNumber&&(D.barNumber=N.barNumber),T(x,M,N),N.part&&x.appendElement("part",N.part.startChar,N.part.endChar,{title:N.part.title}),N.meter!==void 0&&(D.meter=N.meter),M.vskipPending&&(M.lines[M.lineNum].vskip=M.vskipPending,delete M.vskipPending)}function I(x,M,N){M.lines[M.lineNum]={staff:[]},q(x,M,N)}function E(x,M){for(var N=!1,D=!1,k=0;k<x.length;k++){var S=x[k].staff;if(S)for(var z=0;z<S.length;z++){var L=S[z];if(M<L.voices.length){D=!0;for(var R=L.voices[M],y=0;y<R.length;y++){var C=R[y];C.el_type==="note"&&(!C.rest||C.chord)&&(N=!0)}}}}return D?N:"not-found"}function P(x,M){for(var N=0;N<x.length;N++){var D=x[N].staff;if(D)for(var k=0;k<D.length;k++){var S=D[k];M<S.voices.length&&S.voices.splice(M,1)}}}return Xr=t,Xr}var Kr,ls;function Dl(){if(ls)return Kr;ls=1;var e=at(),t=Ka(),n=Cg(),a=Tg(),r=Eg(),s=ql(),o=Ag(),l=Ol(),h=zg(),g=function(){var p=new l,d=new h(p),f,c="",u="";this.getTune=function(){var k={formatting:p.formatting,lines:p.lines,media:p.media,metaText:p.metaText,metaTextInfo:p.metaTextInfo,version:p.version,addElementToEvents:p.addElementToEvents,addUsefulCallbackInfo:p.addUsefulCallbackInfo,getTotalTime:p.getTotalTime,getTotalBeats:p.getTotalBeats,getBarLength:p.getBarLength,getBeatLength:p.getBeatLength,getBeatsPerMeasure:p.getBeatsPerMeasure,getBpm:p.getBpm,getMeter:p.getMeter,getMeterFraction:p.getMeterFraction,getPickupLength:p.getPickupLength,getKeySignature:p.getKeySignature,getElementFromChar:p.getElementFromChar,makeVoicesArray:p.makeVoicesArray,millisecondsPerMeasure:p.millisecondsPerMeasure,setupEvents:p.setupEvents,setTiming:p.setTiming,setUpAudio:p.setUpAudio,deline:p.deline,findSelectableElement:p.findSelectableElement,getSelectableArray:p.getSelectableArray};return p.lineBreaks&&(k.lineBreaks=p.lineBreaks),p.visualTranspose&&(k.visualTranspose=p.visualTranspose),p.chordGrid&&(k.chordGrid=p.chordGrid),k};function i(k,S,z){k.positioning||(k.positioning={}),k.positioning[S]=z}function v(k,S,z){k.fonts||(k.fonts={}),k.fonts[S]=z}var b={reset:function(){for(var k in this)this.hasOwnProperty(k)&&typeof this[k]!="function"&&delete this[k];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(k,S){return this[k].decoration!==S[k].decoration||this[k].face!==S[k].face||this[k].size!==S[k].size||this[k].style!==S[k].style||this[k].weight!==S[k].weight},addFormattingOptions:function(k,S,z){z==="note"?(this.vocalPosition!=="auto"&&i(k,"vocalPosition",this.vocalPosition),this.dynamicPosition!=="auto"&&i(k,"dynamicPosition",this.dynamicPosition),this.chordPosition!=="auto"&&i(k,"chordPosition",this.chordPosition),this.ornamentPosition!=="auto"&&i(k,"ornamentPosition",this.ornamentPosition),this.volumePosition!=="auto"&&i(k,"volumePosition",this.volumePosition),this.differentFont("annotationfont",S)&&v(k,"annotationfont",this.annotationfont),this.differentFont("gchordfont",S)&&v(k,"gchordfont",this.gchordfont),this.differentFont("vocalfont",S)&&v(k,"vocalfont",this.vocalfont),this.differentFont("tripletfont",S)&&v(k,"tripletfont",this.tripletfont)):z==="bar"&&(this.dynamicPosition!=="auto"&&i(k,"dynamicPosition",this.dynamicPosition),this.chordPosition!=="auto"&&i(k,"chordPosition",this.chordPosition),this.ornamentPosition!=="auto"&&i(k,"ornamentPosition",this.ornamentPosition),this.volumePosition!=="auto"&&i(k,"volumePosition",this.volumePosition),this.differentFont("measurefont",S)&&v(k,"measurefont",this.measurefont),this.differentFont("repeatfont",S)&&v(k,"repeatfont",this.repeatfont))},duplicateStartEndingHoldOvers:function(){this.endingHoldOver={inTie:[],inTieChord:{}};for(var k=0;k<this.inTie.length;k++)if(this.endingHoldOver.inTie.push([]),this.inTie[k])for(var S=0;S<this.inTie[k].length;S++)this.endingHoldOver.inTie[k].push(this.inTie[k][S]);for(var z in this.inTieChord)this.inTieChord.hasOwnProperty(z)&&(this.endingHoldOver.inTieChord[z]=this.inTieChord[z])},restoreStartEndingHoldOvers:function(){if(this.endingHoldOver.inTie){this.inTie=[],this.inTieChord={};for(var k=0;k<this.endingHoldOver.inTie.length;k++){this.inTie.push([]);for(var S=0;S<this.endingHoldOver.inTie[k].length;S++)this.inTie[k].push(this.endingHoldOver.inTie[k][S])}for(var z in this.endingHoldOver.inTieChord)this.endingHoldOver.inTieChord.hasOwnProperty(z)&&(this.inTieChord[z]=this.endingHoldOver.inTieChord[z])}}},m=function(k){b.warnings||(b.warnings=[]),b.warnings.push(k)},w=function(k){b.warningObjects||(b.warningObjects=[]),b.warningObjects.push(k)},_=function(k){var S=k.replace(/\x12/g," ");return S=S.replace(/&/g,"&amp;"),S=S.replace(/</g,"&lt;"),S.replace(/>/g,"&gt;")},T=function(k,S,z){S||(S=" ");var L=S[z];(L===" "||!L)&&(L="SPACE");var R=_(S.substring(z-64,z))+'<span style="text-decoration:underline;font-size:1.3em;font-weight:bold;">'+L+"</span>"+_(S.substring(z+1).substring(0,64));m("Music Line:"+f.lineIndex+":"+(z+1)+": "+k+": "+R),w({message:k,line:S,startChar:b.iChar+z,column:z})},q,I;this.getWarnings=function(){return b.warnings},this.getWarningObjects=function(){return b.warningObjects};var E=function(k,S){if(S.indexOf("")>=0){c+=S;return}if(S=c+S,c="",!k){T("Can't add words before the first line of music",k,0);return}S=e.strip(S),S[S.length-1]!=="-"&&(S=S+" ");for(var z=[],L=0,R=!1,y=function(B){var O=e.strip(S.substring(L,B));if(O=O.replace(/\\([-_*|~])/g,"$1"),L=B+1,O.length>0){R&&(O=O.replace(/~/g," "));var $=S[B];return $!=="_"&&$!=="-"&&($=" "),z.push({syllable:f.translateString(O),divider:$}),R=!1,!0}return!1},C=!1,A=0;A<S.length;A++){switch(S[A]){case" ":case"":y(A);break;case"-":!C&&!y(A)&&z.length>0&&(e.last(z).divider="-",z.push({skip:!0,to:"next"}));break;case"_":C||(y(A),z.push({skip:!0,to:"slur"}));break;case"*":C||(y(A),z.push({skip:!0,to:"next"}));break;case"|":C||(y(A),z.push({skip:!0,to:"bar"}));break;case"~":C||(R=!0);break}C=S[A]==="\\"}k.forEach(function(B){if(z.length!==0){if(z[0].skip){switch(z[0].to){case"next":B.el_type==="note"&&B.pitches!==null&&z.shift();break;case"slur":B.el_type==="note"&&B.pitches!==null&&z.shift();break;case"bar":B.el_type==="bar"&&z.shift();break}B.el_type!=="bar"&&(B.lyric===void 0?B.lyric=[{syllable:"",divider:" "}]:B.lyric.push({syllable:"",divider:" "}))}else if(B.el_type==="note"&&B.rest===void 0){var O=z.shift();O.syllable&&(O.syllable=O.syllable.replace(/ +/g," ")),B.lyric===void 0?B.lyric=[O]:B.lyric.push(O)}}})},P=function(k,S){if(S.indexOf("")>=0){u+=S;return}if(S=u+S,u="",!k){T("Can't add symbols before the first line of music",k,0);return}S=e.strip(S),S[S.length-1]!=="-"&&(S=S+" ");for(var z=[],L=0,R=!1,y=function(A){var B=e.strip(S.substring(L,A));if(L=A+1,B.length>0){R&&(B=B.replace(/~/g," "));var O=S[A];return O!=="_"&&O!=="-"&&(O=" "),z.push({syllable:f.translateString(B),divider:O}),R=!1,!0}return!1},C=0;C<S.length;C++)switch(S[C]){case" ":case"":y(C);break;case"-":!y(C)&&z.length>0&&(e.last(z).divider="-",z.push({skip:!0,to:"next"}));break;case"_":y(C),z.push({skip:!0,to:"slur"});break;case"*":y(C),z.push({skip:!0,to:"next"});break;case"|":y(C),z.push({skip:!0,to:"bar"});break;case"~":R=!0;break}k.forEach(function(A){if(z.length!==0){if(z[0].skip)switch(z[0].to){case"next":A.el_type==="note"&&A.pitches!==null&&z.shift();break;case"slur":A.el_type==="note"&&A.pitches!==null&&z.shift();break;case"bar":A.el_type==="bar"&&z.shift();break}else if(A.el_type==="note"&&A.rest===void 0){var B=z.shift();A.lyric===void 0?A.lyric=[B]:A.lyric.push(B)}}})},x=function(k){if(e.startsWith(k,"%%")){var S=t.addDirective(k.substring(2));S&&T(S,k,2);return}var z=k.indexOf("%");if(z>=0&&(k=k.substring(0,z)),k=k.replace(/\s+$/,""),k.length!==0){if(c){E(d.getCurrentVoice(),k.substring(2));return}if(u){P(d.getCurrentVoice(),k.substring(2));return}if(k.length<2||k[1]!==":"||I.lineContinuation){I.parseMusic(k);return}var L=q.parseHeader(k);L.regular&&I.parseMusic(k),L.newline&&I.startNewLine(),L.words&&E(d.getCurrentVoice(),k.substring(2)),L.symbols&&P(d.getCurrentVoice(),k.substring(2))}};function M(k,S){k.push({el_type:"hint"});for(var z=0;z<S.length;z++){var L=S[z],R=Object.assign({},L);if(k.push(R),L.el_type==="bar")return}}function N(k,S){for(var z=0;z<k.length;z++){var L=k[z],R=S[z];if(R)for(var y=0;y<R.voices.length;y++){var C=R.voices[y],A=L.voices[y];A&&M(A,C)}}}function D(){for(var k=0;k<p.lines.length;k++){var S=p.lines[k].staff;if(S){for(var z=k+1;z<p.lines.length&&p.lines[z].staff===void 0;)z++;if(z<p.lines.length){var L=p.lines[z].staff;N(S,L)}}}}this.parse=function(k,S,z){S||(S={}),z||(z=0),p.reset(),k=k.replace(/\r\n?/g,`
94
+ `)+`
95
+ `;var L=k.split(`
96
+ \\`);if(L.length>1){for(var R=1;R<L.length;R++)for(;L[R].length>0&&L[R][0]!==`
97
+ `;)L[R]=L[R].substr(1),L[R-1]+=" ";k=L.join(" ")}k=k.replace(/\\([ \t]*)(%.*)*\n/g,function(F,W,te){var J=te?Array(te.length+1).join(" "):"";return W+""+J+`
98
+ `});var y=k.split(`
99
+ `);e.last(y).length===0&&y.pop(),f=new r(y,b),q=new n(f,T,b,p,d),I=new a(f,T,b,p,d,q),S.print&&(p.media="print"),b.reset(),b.iChar=z,S.visualTranspose?(b.globalTranspose=parseInt(S.visualTranspose),b.globalTranspose===0?b.globalTranspose=void 0:d.setVisualTranspose(S.visualTranspose)):b.globalTranspose=void 0,S.lineBreaks&&(b.lineBreaks=S.lineBreaks),q.reset(f,T,b,p);try{S.format&&t.globalFormatting(S.format);for(var C=f.nextLine();C;){if(S.header_only&&b.is_in_header===!1||S.stop_on_warning&&b.warnings)throw"normal_abort";var A=b.is_in_header;x(C),A&&!b.is_in_header&&(d.setRunningFont("annotationfont",b.annotationfont),d.setRunningFont("gchordfont",b.gchordfont),d.setRunningFont("tripletfont",b.tripletfont),d.setRunningFont("vocalfont",b.vocalfont)),C=f.nextLine()}c&&E(d.getCurrentVoice(),""),u&&P(d.getCurrentVoice(),""),b.openSlurs=d.cleanUp(b.barsperstaff,b.staffnonote,b.openSlurs)}catch(F){if(F!=="normal_abort")throw F}var B=792,O=8.5*72;switch(b.papersize){case"legal":B=1008,O=8.5*72;break;case"A4":B=11.7*72,O=8.3*72;break}if(b.landscape){var $=B;B=O,O=$}if(p.formatting.pagewidth||(p.formatting.pagewidth=O),p.formatting.pageheight||(p.formatting.pageheight=B),S.hint_measures&&D(),s.wrapLines(p,b.lineBreaks,b.barNumbers),S.chordGrid)try{p.chordGrid=o(p)}catch(F){switch(F.message){case"notCommonTime":T("Chord grid only works for 2/2 and 4/4 time.",0,0);break;case"noChords":T("No chords are found in the tune.",0,0);break;default:T(F.message,0,0)}}}};return Kr=g,Kr}var Jr,us;function Rg(){if(us)return Jr;us=1;var e=at(),t=function(n){var a="",r=n.match(/(\s*)/);n=e.strip(n);for(var s=n.split(`
100
+ X:`),o=1;o<s.length;o++)s[o]="X:"+s[o];var l=r?r[0].length:0,h=[];if(s.forEach(function(f){h.push({abc:f,startPos:l}),l+=f.length+1}),h.length>1&&!e.startsWith(h[0].abc,"X:")){var g=h.shift(),p=g.abc.split(`
101
+ `);p.forEach(function(f){e.startsWith(f,"%%")&&(a+=f+`
102
+ `)})}var d=a;return h.forEach(function(f){var c=f.abc.indexOf(`
103
+
104
+ `);c>0&&(f.abc=f.abc.substring(0,c)),f.pure=f.abc,f.abc=a+f.abc,f.title="";var u=f.pure.split("T:");u.length>1&&(u=u[1].split(`
105
+ `),f.title=e.strip(u[0]));var i=f.pure.substring(2,f.pure.indexOf(`
106
+ `));f.id=e.strip(i)}),{header:d,tunes:h}};return Jr=t,Jr}var Qr,hs;function qg(){if(hs)return Qr;hs=1;function e(t,n){this.numLines=t,this.lineSpace=n,this.verticalSize=this.numLines*this.lineSpace;var a=3;this.bar={pitch:a,pitch2:n*t,height:5}}return e.prototype.bypass=function(t){var n=t.staffGroup.voices;return!!(n.length>0&&n[0].isPercussion)},e.prototype.setRelative=function(t,n,a){switch(t.type){case"bar":n.pitch=this.bar.pitch,n.pitch2=this.bar.pitch2,n.height=this.height;break;case"symbol":var r=this.bar.pitch2/2;if(t.name=="dots.dot")return a?(n.pitch=r,!1):(n.pitch=r+this.lineSpace,!0);break}return a},Qr=e,Qr}var en,fs;function Fl(){if(fs)return en;fs=1;var e=function(n,a){this.children=[],this.beams=[],this.otherchildren=[],this.w=0,this.duplicate=!1,this.voicenumber=n,this.voicetotal=a,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 n=!0,a=0;n&&a<this.children.length;a++)this.children[a].type.indexOf("staff-extra")<0&&this.children[a].type!=="tempo"&&(n=!1);n||(this.beams.push("bar"),this.otherchildren.push("bar"))}this.children[this.children.length]=t,this.setRange(t)},e.prototype.setLimit=function(t,n){var a=n.specialY;a||(a=n),a[t]&&(this.specialY[t]?this.specialY[t]=Math.max(this.specialY[t],a[t]):this.specialY[t]=a[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},en=e,en}var tn,ds;function Qa(){if(ds)return tn;ds=1;var e=function(t,n,a,r){if(t)for(var s=0;s<t.length;s++){var o=t[s],l=o.getAttribute("highlight");l||(l="fill"),o.setAttribute(l,r);var h=o.getAttribute("class");h||(h=""),h=h.replace(a,""),h=h.replace(n,""),n.length>0&&(h.length>0&&h[h.length-1]!==" "&&(h+=" "),h+=n),o.setAttribute("class",h)}};return tn=e,tn}var rn,ps;function Hl(){if(ps)return rn;ps=1;var e=Qa(),t=function(n,a){n===void 0&&(n="abcjs-note_selected"),a===void 0&&(a="#ff0000"),e(this.elemset,n,"",a)};return rn=t,rn}var nn,gs;function $l(){if(gs)return nn;gs=1;var e=Qa(),t=function(n,a){n===void 0&&(n="abcjs-note_selected"),a===void 0&&(a="#000000"),e(this.elemset,"",n,a)};return nn=t,nn}var an,vs;function Bt(){if(vs)return an;vs=1;var e=Hl(),t=$l(),n=function(r,s,o,l,h,g){g||(g={}),this.tuneNumber=h,this.abcelem=r,this.duration=s,this.durationClass=g.durationClassOveride?g.durationClassOveride:this.duration,this.minspacing=o||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=l,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 n.prototype.getFixedCoords=function(){return{x:this.x,w:this.fixed.w,t:this.fixed.t,b:this.fixed.b}},n.prototype.addExtra=function(a){this.fixed.w=Math.max(this.fixed.w,a.dx+a.w),this.fixed.t===void 0?this.fixed.t=a.top:this.fixed.t=Math.max(this.fixed.t,a.top),this.fixed.b===void 0?this.fixed.b=a.bottom:this.fixed.b=Math.min(this.fixed.b,a.bottom),a.dx<this.extraw&&(this.extraw=a.dx),this.extra[this.extra.length]=a,this._addChild(a)},n.prototype.addHead=function(a){a.dx<this.extraw&&(this.extraw=a.dx),this.heads[this.heads.length]=a,this.addRight(a)},n.prototype.addRight=function(a){this.fixed.w=Math.max(this.fixed.w,a.dx+a.w),a.top!==void 0&&(this.fixed.t===void 0?this.fixed.t=a.top:this.fixed.t=Math.max(this.fixed.t,a.top)),a.bottom!==void 0&&(this.fixed.b===void 0?this.fixed.b=a.bottom:this.fixed.b=Math.min(this.fixed.b,a.bottom)),a.dx+a.w>this.w&&(this.w=a.dx+a.w),this.right[this.right.length]=a,this._addChild(a)},n.prototype.addFixed=function(a){this._addChild(a)},n.prototype.addFixedX=function(a){this._addChild(a)},n.prototype.addCentered=function(a){var r=a.w/2;-r<this.extraw&&(this.extraw=-r),this.extra[this.extra.length]=a,a.dx+r>this.w&&(this.w=a.dx+r),this.right[this.right.length]=a,this._addChild(a)},n.prototype.setLimit=function(a,r){r[a]&&(this.specialY[a]?this.specialY[a]=Math.max(this.specialY[a],r[a]):this.specialY[a]=r[a])},n.prototype._addChild=function(a){var r=!0;this.abcelem.el_type=="clef"&&a.type=="barNumber"&&(r=!1),a.parent=this,this.children[this.children.length]=a,r&&this.pushTop(a.top),this.pushBottom(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)},n.prototype.pushTop=function(a){a!==void 0&&(this.top===void 0?this.top=a:this.top=Math.max(a,this.top))},n.prototype.pushBottom=function(a){a!==void 0&&(this.bottom===void 0?this.bottom=a:this.bottom=Math.min(a,this.bottom))},n.prototype.setX=function(a){this.x=a;for(var r=0;r<this.children.length;r++)this.children[r].setX(a)},n.prototype.center=function(a,r){var s=(r.x-a.x)/2+a.x;this.x=s-this.w/2;for(var o=0;o<this.children.length;o++)this.children[o].setX(this.x)},n.prototype.setHint=function(){this.hint=!0},n.prototype.highlight=function(a,r){e.bind(this)(a,r)},n.prototype.unhighlight=function(a,r){t.bind(this)(a,r)},an=n,an}var sn,ms;function it(){if(ms)return sn;ms=1;var e=function(n,a,r,s,o){switch(o=o||{},this.x=0,this.c=n,this.dx=a,this.w=r,this.pitch=s,this.scalex=o.scalex||1,this.scaley=o.scaley||1,this.type=o.type||"symbol",this.pitch2=o.pitch2,this.linewidth=o.linewidth,this.klass=o.klass,this.anchor=o.anchor?o.anchor:"middle",this.top=s,this.pitch2!==void 0&&this.pitch2>this.top&&(this.top=this.pitch2),this.bottom=s,this.pitch2!==void 0&&this.pitch2<this.bottom&&(this.bottom=this.pitch2),o.thickness&&(this.top+=o.thickness/2,this.bottom-=o.thickness/2),o.stemHeight&&(o.stemHeight>0?this.top+=o.stemHeight:this.bottom+=o.stemHeight),o.dim&&(this.dim=o.dim),o.position&&(this.position=o.position),this.height=o.height?o.height:4,o.top&&(this.top=o.top),o.bottom&&(this.bottom=o.bottom),o.name?this.name=o.name:this.c?this.name=this.c:this.name=this.type,o.realWidth?this.realWidth=o.realWidth:this.realWidth=this.w,this.centerVertically=!1,this.type){case"debug":this.chordHeightAbove=this.height;break;case"lyric":o.position&&o.position==="below"?this.lyricHeightBelow=this.height:this.lyricHeightAbove=this.height;break;case"chord":o.position&&o.position==="below"?this.chordHeightBelow=this.height:this.chordHeightAbove=this.height;break;case"text":this.pitch===void 0?o.position&&o.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,n=this.type==="chord"?this.realWidth/2:0,a=this.x-n-t,r=a+this.realWidth+t;return{left:a,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},sn=e,sn}var on,bs;function Bg(){if(bs)return on;bs=1;var e=Bt(),t=it();function n(i){return i!=null&&i.constructor===Object}function a(i,v){for(var b in v)v.hasOwnProperty(b)&&(Array.isArray(v[b])||n(v[b])||(i[b]=v[b]))}function r(i){var v=new e("",0,0,"",0);return a(v,i),v.top=0,v.bottom=-1,i.abcelem&&(v.abcelem={},a(v.abcelem,i.abcelem),v.abcelem.el_type==="note"&&(v.abcelem.el_type="tabNumber")),i.cloned=v,v}function s(i,v){var b=r(i);if(v)for(var m=i.children,w=!0,_=0;_<m.length;_++){var T=m[_],q=new t("",0,0,0,"");a(q,T),w=v.tablature.setRelative(T,q,w),b.children.push(q)}return b}function o(i,v,b){var m="tab.tiny",w=7.5;i.isTabBig&&(m="tab.big",w=10);var _={el_type:"tab",icon:m,Ypos:w};if(w+=i.tabSymbolOffset,!i.hideTabSymbol){var T=new e(_,0,0,"symbol",0);T.x=v;var q=new t(m,0,0,7.5,"tab");q.x=b,T.children.push(q),T.abcelem.el_type=="tab"&&(q.pitch=w)}return T}function l(i){if(i.extra)for(var v=0;v<i.extra.length;v++){var b=i.extra[v];if(b.type=="lyric")return{bottom:b.bottom,height:b.height}}return null}function h(){this.accidentals=null}function g(i){for(var v=0,b=0;b<i.length;b++)i[b].tabNameInfos||v++;return v}function p(i,v,b,m,w){var _=m.num;m.note.quarter!=null&&(_=_.toString(),_+=m.note.quarter);var T=i.semantics.stringToPitch(m.str);b.notes.push({num:_,str:m.str,pitch:m.note.emit()});var q={type:"tabNumber"},I=new t(_,0,0,T+.3,q);return I.x=v,I.isGrace=w,I.isAltered=m.note.isAltered,I}function d(i,v){var b=0;if(i.extra){for(var m=0;m<i.extra.length;m++)if(i.extra[m].c.indexOf("noteheads")>=0){if(b===v)return i.extra[m].x+i.extra[m].w/2;b++}}return-1}function f(i){if(i.abcelem){var v=i.abcelem;if(v.rest)return v.gracenotes}return null}function c(i,v,b){var m=i.semantics.notesToNumber(v,b);if(m.error)return i.setError(m.error),m;if(m.graces&&m.notes){var w=m.notes.length-1;m.notes[w].graces=m.graces}return m}function u(i,v,b,m,w){for(var _=0;_<m.length;_++){var T={el_type:"note",startChar:b.abcelem.startChar,endChar:b.abcelem.endChar,notes:[],grace:!0},q=d(b,_),I=m[_],E=p(i,q,T,I,!0);v.children.push(E),w.push(T)}}return h.prototype.build=function(i,v,b,m,w,_,T){g(v);var q=v[w+m],I=v[T],E=null,P=null;q.children[0].abcelem.el_type!="clef"&&_!="none"&&q.children.splice(0,0,_);for(var x=0;x<q.children.length;x++){var M=q.children[x],N=M.x,D=N;switch(M.isClef&&(I.children.push(o(i,N,D)),M.abcelem.type.indexOf("-8")>=0&&(i.semantics.clefTranspose=-12),M.abcelem.type.indexOf("+8")>=0&&(i.semantics.clefTranspose=12)),M.type){case"staff-extra key-signature":this.accidentals=M.abcelem.accidentals,i.semantics.accidentals=this.accidentals;break;case"bar":i.semantics.measureAccidentals={};var k=!1;x===q.children.length-1&&(k=!0);var S=s(M,i);if(S.abcelem.barNumber){delete S.abcelem.barNumber;for(var z=0;z<S.children.length;z++)if(S.children[z].type==="barNumber"){S.children.splice(z,1);break}}S.abcelem.lastBar=k,I.children.push(S),b.push({el_type:M.abcelem.el_type,type:M.abcelem.type,endChar:M.abcelem.endChar,startChar:M.abcelem.startChar,abselem:S});break;case"rest":var L=f(M);if(L){if(E=c(i,null,L),E.error)return;F={el_type:"note",startChar:M.abcelem.startChar,endChar:M.abcelem.endChar,notes:[],grace:!0},u(i,R,M,E.graces,b)}break;case"note":var R=r(M);R.x=M.heads[0].x+M.heads[0].w/2,R.lyricDim=l(M);var y=M.abcelem.pitches,C=M.abcelem.gracenotes;if(R.type="tabNumber",E=c(i,y,C),E.error)return;if(E.graces){var A=E.notes.length-1;E.notes[A].graces=E.graces}P={el_type:"note",startChar:M.abcelem.startChar,endChar:M.abcelem.endChar,notes:[]};for(var B=0;B<E.notes.length;B++){var O=E.notes[B];if(O.graces)for(var $=0;$<O.graces.length;$++){var F={el_type:"note",startChar:M.abcelem.startChar,endChar:M.abcelem.endChar,notes:[],grace:!0},W=d(M,$),te=O.graces[$],J=p(i,W,F,te,!0);R.children.push(J),b.push(F)}var ie=p(i,R.x+M.heads[B].dx,P,O,!1);R.children.push(ie)}P.notes.length>0&&(P.abselem=R,b.push(P),I.children.push(R));break}}},on=h,on}var cn,ys;function Lg(){if(ys)return cn;ys=1;var e=Fl(),t=Bg(),n=Xe();function a(){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(i){for(var v=0,b=0;b<i.children.length;b++){var m=i.children[b];m.specialY&&m.specialY.lyricHeightBelow>v&&(v=m.specialY.lyricHeightBelow)}return v}function s(i,v,b){var m=i.semantics,w=v.controller.getTextSize,_=m.tabInfos(i),T=m.suppress(i),q=!0;if(T&&(q=!1),q){var I=w.calc(_,"tablabelfont","text instrumentname");return b.tabNameInfos={textSize:{height:I.height,width:I.width},name:_},I.height}return 0}function o(i,v){return v[i].isTabStaff?i===v.length-1?!0:!v[i+1].isTabStaff:!1}function l(i){for(var v=0,b=0;b<i.length;b++)i[b].isTabStaff||v++;return v}function h(i,v){for(var b=v;b>=0;b--)if(!i[b].isTabStaff)return b;return-1}function g(i){for(var v=0;v<i.length;v++)if(i[v].isTabStaff){var b=h(i,v);i[v].hasStaff=i[b],i[b].hasTab||(i[b].hasTab=[]),i[b].hasTab.push(i[v])}}function p(i,v){return l(i)===1&&v.voices.length>1}function d(i,v){for(var b=0,m=0,w=!0,_=0;w;){if(!v[b])return-1;if(v[b].isTabStaff||(_=v[b].voices.length),v[b].isTabStaff){if(m++,o(b,v)&&m<_)return b+1}else if(m=0,b>=i&&(b+1==v.length||!v[b+1].isTabStaff))return b+1;if(b++,b>v.length)return-1}}function f(i,v){for(var b=v;b>=0;b--)if(!i[b].isTabStaff)return i[b];return null}function c(i,v){var b=i[v],m=b.children[0].abcelem;return m.el_type==="clef"?null:v==0?"none":i[v-1].children[0]}function u(i,v,b,m){var w=new t,_={clef:{type:"TAB"}},T=i.linePitch*i.nbLines,q=b.staff;if(q){var I=q[0];if(I&&I.clef&&I.clef.stafflines==0){i.setError("No tablatures when stafflines=0");return}q.splice(q.length,0,_)}var E=b.staffGroup,P=E.voices,x=P[0],M=r(x),N=3,D=m,k=E.staffs[D],S=T+N-k.bottom-M;k.isTabStaff&&(S=k.top);var z={bottom:-1,isTabStaff:!0,specialY:a(),lines:i.nbLines,linePitch:i.linePitch,dy:.15,top:S},L=d(m,E.staffs);if(L!==-1){z.parentIndex=L-1,E.staffs.splice(L,0,z),E.height+=T+N;var R=f(E.staffs,L),y=1;p(E.staffs,R)&&(y=R.voices.length),_.voices=[];for(var C=0;C<y;C++){var A=new e(0,0);C>0&&(A.duplicate=!0);var B=s(i,v,A)/n.STEP;B=Math.max(B,1),E.staffs[m].top+=1,E.height+=B,A.staff=z;var O=P.length;P.splice(P.length,0,A);var $=c(P,C+m);_.voices[C]=[],w.build(i,P,_.voices[C],C,m,$,O)}g(E.staffs)}}return cn=u,cn}var ln,ws;function Gl(){if(ws)return ln;ws=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 n(r){var s=r.match(/([_^\/]*)([ABCDEFGabcdefg])(,*)('*)/);if(s&&s.length===5){var o=e[s[1]],l=t.indexOf(s[2]),h=s[4].length-s[3].length;return 48+l+o+h*12}return 0}function a(r){r=parseInt(r,10);var s=Math.floor(r/12),o=r%12,l=t[o];if(l==="-"&&(l="^"+t[o-1]),s>4)for(l=l.toLowerCase(),s-=5;s>0;)l+="'",s--;else for(;s<4;)l+=",",s++;return l}return ln={noteToMidi:n,midiToNote:a},ln}var un,_s;function Zl(){if(_s)return un;_s=1;var{noteToMidi:e,midiToNote:t}=Gl();function n(r,s){var o=e(r);s&&(o+=s);var l=t(o),h=!1,g=!1,p=!1,d=null,f=null,c=!1,u=0;r.startsWith("_")?(h=!0,u=-1,r[1]=="/"?(h=!1,f="v",u=0):r[1]=="_"&&(c=!0,u-=1)):r.startsWith("^")?(g=!0,u=1,r[1]=="/"?(g=!1,f="^",u=0):r[1]=="^"&&(c=!0,u+=1)):r.startsWith("=")&&(d=!0,u=0),p=h||g||f!=null,(p||d)&&(f!=null||c?l=r.slice(2):l=r.slice(1));var i=(l.match(/,/g)||[]).length,v=(l.match(/'/g)||[]).length;this.pitch=o,this.pitchAltered=0,this.name=l,this.acc=u,this.isSharp=g,this.isKeySharp=!1,this.isDouble=c,this.isAltered=p,this.isFlat=h,this.isKeyFlat=!1,this.natural=d,this.quarter=f,this.isLower=this.name==this.name.toLowerCase(),this.name=this.name[0].toUpperCase(),this.hasComma=i,this.isQuoted=v}function a(r){var s=r.name,o=new n(s);return o.pitch=r.pitch,o.hasComma=r.hasComma,o.isLower=r.isLower,o.isQuoted=r.isQuoted,o.isSharp=r.isSharp,o.isKeySharp=r.isKeySharp,o.isFlat=r.isFlat,o.isKeyFlat=r.isKeyFlat,o}return n.prototype.sameNoteAs=function(r){return r.pitch===this.pitch},n.prototype.isLowerThan=function(r){return r.pitch>this.pitch},n.prototype.checkKeyAccidentals=function(r,s){if(!(this.isAltered||this.natural)){if(s[this.name.toUpperCase()])switch(s[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 o=this.name,l=0;l<r.length;l++){var h=r[l];o==h.note.toUpperCase()&&(h.acc=="flat"&&(this.acc=-1,this.isKeyFlat=!0,this.pitchAltered=-1),h.acc=="sharp"&&(this.acc=1,this.isKeySharp=!0,this.pitchAltered=1))}}},n.prototype.getAccidentalEquiv=function(){var r=a(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},n.prototype.nextNote=function(){var r=t(this.pitch+1+this.pitchAltered);return new n(r)},n.prototype.prevNote=function(){var r=t(this.pitch-1+this.pitchAltered);return new n(r)},n.prototype.emitNoAccidentals=function(){var r=this.name;this.isLower&&(r=r.toLowerCase());for(var s=0;s<this.isQuoted;s++)r+="'";for(var o=0;o<this.hasComma;o++)r+=",";return r},n.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 s=1;s<=this.hasComma;s++)r+=",";if(this.isLower){r=r.toLowerCase();for(var o=1;o<=this.isQuoted;o++)r+="'"}return r},un=n,un}var hn,ks;function Og(){if(ks)return hn;ks=1;var e=Zl(),t=["A","B","C","D","E","F","G"];function n(a,r){var s=new e(a),o=new e(r);if(o.isLowerThan(s)){var l=s.emit(),h=o.emit();return{error:"Invalid string Instrument tuning : "+h+" string lower than "+l+" string"}}var g=[],p=t.indexOf(s.name),d=t.indexOf(o.name);if(p==-1||d==-1)return g;for(var f=!1;!f;)g.push(s.emit()),s=s.nextNote(),s.sameNoteAs(o)&&(f=!0);return g}return hn=n,hn}var fn,xs;function Dg(){if(xs)return fn;xs=1;const{noteToMidi:e}=Gl();var t=Zl(),n=Og();function a(f){var c=null,u=f.tuning;if(f.capo>0){c=[];for(var i=0;i<u.length;i++){for(var v=new t(u[i]),b=0;b<f.capo;b++)v=v.nextNote();c[i]=v.emit()}}return c}function r(f){var c=[],u=f.tuning;f.capo>0&&(u=f.capoTuning);for(var i=u.length-1,v=0;v<u.length;v++){var b=f.highestNote;v!=u.length-1&&(b=u[v+1]);var m=n(u[v],b);if(m.error)return m;c[i--]=m}return c}function s(f){var c=[];c[0]=[];for(var u=f.strings,i=1;i<u.length;i++)c[i]=u[i-1];return c}function o(f,c){for(var u=0;u<c.length-1;u++){var i=c[u],v=c[u+1];if(i.str==v.str){if(i.str==f.strings.length-1){i.num="?",v.num="?";return}v.num<i.num?(v.str++,v=h(f,v.note,v.str,f.secondPos,f.strings[v.str].length)):(i.str++,i=h(f,i.note,i.str,f.secondPos,f.strings[i.str].length)),c[u]=i,c[u+1]=v}}return null}function l(f,c){for(var u=[],i=0;i<c.length;i++)if(!c[i].endTie){var v=new t(c[i].name,f.clefTranspose);v.checkKeyAccidentals(f.accidentals,f.measureAccidentals);var b=g(f,v);u.push(b)}return o(f,u),u}function h(f,c,u,i,v){var b=f.strings;c.checkKeyAccidentals(f.accidentals,f.measureAccidentals),i&&(b=i);var m=c.emitNoAccidentals(),w=b[u].indexOf(m),_=c.acc;if(w!=-1){if(i&&(w+=v),(c.isFlat||c.acc==-1)&&w==0){var T=c.getAccidentalEquiv();u++,w=b[u].indexOf(T.emit()),_=0}return{num:w+_,str:u,note:c}}return null}function g(f,c){if(c.isAltered||c.natural){var u;c.isFlat?c.isDouble?u="__":u="_":c.isSharp?c.isDouble?u="^^":u="^":c.natural&&(u="="),f.measureAccidentals[c.name.toUpperCase()]=u}for(var i=f.stringPitches.length-1;i>=0;i--)if(c.pitch+c.pitchAltered>=f.stringPitches[i]){var v=c.pitch+c.pitchAltered-f.stringPitches[i];return c.quarter==="^"?v-=.5:c.quarter==="v"&&(v+=.5),{num:Math.round(v),str:f.stringPitches.length-1-i,note:c}}return{num:"?",str:f.stringPitches.length-1,note:c}}d.prototype.stringToPitch=function(f){var c=5.3,u=this.strings.length-1;return c+(u-f)*this.linePitch};function p(f,c){var u={num:"?",str:0,note:c};f.push(u),f.error=c.emit()+": unexpected note for instrument"}d.prototype.notesToNumber=function(f,c){var u,i,v=null,b=null;if(f&&(b=[],f.length>1?(b=l(this,f),b.error&&(v=b.error)):f[0].endTie||(u=new t(f[0].name,this.clefTranspose),u.checkKeyAccidentals(this.accidentals,this.measureAccidentals),i=g(this,u),i?b.push(i):(p(b,u),v=b.error))),v)return b;var m=null;if(c){m=[];for(var w=0;w<c.length;w++)u=new t(c[w].name,this.clefTranspose),u.checkKeyAccidentals(this.accidentals,this.measureAccidentals),i=g(this,u),i?m.push(i):(p(m,u),v=b.error)}return{notes:b,graces:m,error:v}},d.prototype.toString=function(){for(var f=[],c=0;c<this.tuning.length;c++){var u=this.tuning[c].replaceAll(",","").replaceAll("'","").toUpperCase();u[0]==="_"?u=u[1]+"b ":u[0]==="^"&&(u=u[1]+"# "),f.push(u)}return f.join("")},d.prototype.tabInfos=function(f){var c=f.params.label;if(c){var u=c.indexOf("%T"),i="";return u!=-1&&(i=this.toString(),f.capo>0&&(i+=" capo:"+f.capo),c=c.replace("%T",i)),c}return""},d.prototype.suppress=function(f){var c=f.params.suppress;return!!c};function d(f){var c=f.tuning,u=f.capo,i=f.params.highestNote;this.linePitch=f.linePitch,this.highestNote="a'",i&&(this.highestNote=i),this.measureAccidentals={},this.capo=0,u&&(this.capo=parseInt(u,10)),this.transpose=f.transpose?f.transpose:0,this.tuning=c,this.stringPitches=[];for(var v=0;v<this.tuning.length;v++){var b=e(this.tuning[v])+this.capo;this.stringPitches.push(b)}if(this.capo>0&&(this.capoTuning=a(this)),this.strings=r(this),this.strings.error){f.setError(this.strings.error),f.inError=!0;return}this.secondPos=s(this)}return fn=d,fn}var dn,Cs;function Fg(){if(Cs)return dn;Cs=1;var e=qg(),t=Lg(),n=Dg();a.prototype.init=function(s,o,l,h){this.tune=s,this.params=l,this.tuneNumber=o,this.inError=!1,this.abcTune=s,this.linePitch=3,this.nbLines=h.defaultTuning.length,this.isTabBig=h.isTabBig,this.tabSymbolOffset=h.tabSymbolOffset,this.capo=l.capo,this.transpose=l.visualTranspose,this.hideTabSymbol=l.hideTabSymbol,this.tablature=new e(this.nbLines,this.linePitch);var g=l.tuning;g||(g=h.defaultTuning),this.tuning=g,this.semantics=new n(this)},a.prototype.setError=function(s){s&&(this.error=s,this.inError=!0,this.tune.warnings?this.tune.warnings.push(s):this.tune.warnings=[s])},a.prototype.render=function(s,o,l){this.inError||this.tablature.bypass(o)||t(this,s,o,l)};function a(){}var r=function(){return{name:"StringTab",tablature:a}};return dn=r,dn}var pn,Ss;function jl(){if(Ss)return pn;Ss=1;var e=Fg(),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}},n={inited:!1,plugins:{},register:function(a){var r=a.name,s=a.tablature;this.plugins[r]=s},setError:function(a,r){a.warnings?a.warning.push(r):a.warnings=[r]},preparePlugins:function(a,r,s){this.inited||(this.register(new e),this.inited=!0);var o=null;if(s.tablature){var l=s.tablature;o=[];for(var h=0;h<l.length;h++){var g=l[h],p=g.instrument;if(p==null)return this.setError(a,"tablature 'instrument' is missing"),o;var d=t[p],f=null;if(d&&(f=this.plugins[d.name]),f){s.visualTranspose!=0&&(g.visualTranspose=s.visualTranspose),g.abcSrc=s.tablature.abcSrc;var c={classz:f,tuneNumber:r,params:g,instance:null,tabType:d};o.push(c)}else if(p==="")o.push(null);else return this.setError(a,"Undefined tablature plugin: "+p),o}}return o},layoutTablatures:function(r,s){var o=s.tablatures,l=0;if(o&&o.length>0)for(var h=o.length,g=0;g<h;++g)o[g]&&o[g].params.firstStaffOnly&&(o[g].params.suppress=!1);for(var p=0;p<s.lines.length;p++){var d=s.lines[p];if(d.staff&&l++,l>1&&o&&o.length>0)for(var h=o.length,g=0;g<h;++g)o[g].params.firstStaffOnly&&(o[g].params.suppress=!0);var f=d.staff;if(f){for(var c=f.length,u=0;u<f.length;u++)if(o[u]&&u<c){var i=o[u];i.instance==null&&(i.instance=new i.classz,i.instance.init(s,i.tuneNumber,i.params,i.tabType)),i.instance.render(r,d,u)}}}}};return pn=n,pn}var gn,Ts;function yr(){if(Ts)return gn;Ts=1;var e=Dl(),t=Rg(),n=jl(),a={};return(function(){a.numberOfTunes=function(s){var o=s.split(`
107
+ X:`),l=o.length;return l===0&&(l=1),l};var r=a.TuneBook=function(s){var o=t(s);this.header=o.header,this.tunes=o.tunes};r.prototype.getTuneById=function(s){for(var o=0;o<this.tunes.length;o++)if(this.tunes[o].id===""+s)return this.tunes[o];return null},r.prototype.getTuneByTitle=function(s){for(var o=0;o<this.tunes.length;o++)if(this.tunes[o].title===s)return this.tunes[o];return null},a.parseOnly=function(s,o){for(var l=a.numberOfTunes(s),h=[],g=0;g<l;g++)h.push(1);function p(){}return a.renderEngine(p,h,s,o)},a.renderEngine=function(s,o,l,h){var g=[],p=function(w){return w&&!w.propertyIsEnumerable("length")&&typeof w=="object"&&typeof w.length=="number"};if(!(o===void 0||l===void 0)){p(o)||(o=[o]),h===void 0&&(h={});for(var d=h.startingTune?parseInt(h.startingTune,10):0,f=new r(l),c=new e,u=0;u<o.length;u++){var i=o[u];if(i==="*"||typeof i=="string"&&(i=document.getElementById(i)),i)if(d>=0&&d<f.tunes.length){c.parse(f.tunes[d].abc,h,f.tunes[d].startPos-f.header.length);var v=c.getTune();h.tablature&&(v.tablatures=n.preparePlugins(v,d,h));var b=c.getWarnings();b&&(v.warnings=b);var m=s(i,v,u,f.tunes[d].abc);g.push(m||v)}else i.innerHTML&&(i.innerHTML="");d++}return g}},a.extractMeasures=function(s){for(var o=[],l=new r(s),h=0;h<l.tunes.length;h++){for(var g=l.tunes[h],p=g.abc.split("K:"),d=p[1].split(`
108
+ `),f=p[0]+"K:"+d[0]+`
109
+ `,c=null,u=null,i=null,v=[],b=!1,m=a.parseOnly(g.abc)[0],w=m.getPickupLength()>0,_=0;_<m.lines.length;_++){var T=m.lines[_];if(T.staff)for(var q=0;q<1;q++)for(var I=T.staff[q],E=0;E<1;E++)for(var P=I.voices[E],x=0;x<P.length;x++){var M=P[x];if(i===null&&M.startChar>=0&&(i=M.startChar,M.chord===void 0?u=c:u=null),M.chord&&(c=M),M.el_type==="bar"){if(b){var N=g.abc.substring(i,M.endChar),D={abc:N};c=u&&u.chord&&u.chord.length>0?u.chord[0].name:null,c&&(D.lastChord=c),M.startEnding&&(D.startEnding=M.startEnding),M.endEnding&&(D.endEnding=M.endEnding),v.push(D),i=null,b=!1}}else M.el_type==="note"&&(b=!0)}}o.push({header:f,measures:v,hasPickup:w})}return o}})(),gn=a,gn}var vn,Es;function Hg(){if(Es)return vn;Es=1;var e=zl(),{relativeMajor:t,transposeKey:n,relativeMode:a,isLegalMode:r}=Pl(),s=Nl(),o;return(function(){o=function(E,P,x){if(P==="TEST")return{keyAccidentals:e,relativeMajor:t,transposeKey:n,relativeMode:a,transposeChordName:s};x=parseInt(x,10);var M=[],N;for(N=0;N<P.length;N++)M=M.concat(l(E,P[N],x));M=M.sort(function(S,z){return z.start-S.start});var D=E.split("");for(N=0;N<M.length;N++){var k=M[N];D.splice(k.start,k.end-k.start,k.note)}return D.join("")};function l(E,P,x){var M=[],N=P.getKeySignature();if(N.root==="Hp"||N.root==="HP")return M;M=M.concat(h(E,x));for(var D=0;D<P.lines.length;D++){var k=P.lines[D].staff;if(k)for(var S=0;S<k.length;S++){var z=k[S];z.clef.type!=="perc"&&(M=M.concat(g(E,z.voices,z.key,x)))}}return M}function h(E,P){for(var x=[],M=E.split("K:"),N=M[0].length,D=1;D<M.length;D++){var k=M[D],S=k.match(/^( *)([A-G])([#b]?)( ?)(\w*)/);if(S){var z=N+2+S[1].length,L=r(S[5])?S[5]:"",R=S[2]+S[3]+S[4]+L,y=i({root:S[2],acc:S[3],mode:L},P),C=y.root+y.acc+S[4]+y.mode;x.push({start:z,end:z+R.length,note:C})}N+=k.length+2}return x}function g(E,P,x,M){for(var N=[],D=i(x,M),k=0;k<P.length;k++)N=N.concat(f(E,P[k],x.root,p(x),D,M));return N}function p(E){for(var P={},x=0;x<E.accidentals.length;x++){var M=E.accidentals[x];M.acc==="flat"?P[M.note.toUpperCase()]="_":M.acc==="sharp"&&(P[M.note.toUpperCase()]="^")}return P}function d(E,P,x){var M=c.indexOf(E.root)-c.indexOf(P);return P==="none"&&(M=c.indexOf(E.root)),M===0?x>2?M+=7:x===-12&&(M-=7):x>0&&M<0?M+=7:x<0&&M>0&&(M-=7),x>12?M+=7:x<-12&&(M-=7),M}function f(E,P,x,M,N,D){for(var k=[],S=d(N,x,D),z={},L={},R=0;R<P.length;R++){var y=P[R];if(y.chord)for(var C=0;C<y.chord.length;C++){var A=y.chord[C];if(A.position==="default"){var B=N.accidentals.length&&N.accidentals[0].acc==="flat",O=s(A.name,D,B,!0);O=O.replace(/♭/g,"b").replace(/♯/g,"#"),O!==A.name&&k.push(q(E,y.startChar,y.endChar,O))}}if(y.el_type==="note"&&y.pitches){for(var $=_(E,y.startChar,y.endChar),F=0;F<$.length;F++){var W=w($[F].note,x,M,z);W.acc&&(z[W.name.toUpperCase()]=W.acc);var te=v(W,N,S,L);te.acc&&(L[te.upper]=te.acc),k.push({note:te.acc+te.name,start:$[F].index,end:$[F].index+$[F].note.length})}if(y.gracenotes)for(var J=0;J<y.gracenotes.length;J++){var ie=w(y.gracenotes[J].name,x,M,z);ie.acc&&(z[ie.name.toUpperCase()]=ie.acc);var re=v(ie,N,S,z);re.acc&&(L[re.upper]=re.acc),k.push(T(E,y.startChar,y.endChar,re.acc+re.name,J))}}else y.el_type==="bar"?(z={},L={}):y.el_type==="keySignature"&&(x=y.root,M=p(y),N=i(y,D),S=d(N,x,D))}return k}var c="CDEFGAB",u=[",,,,",",,,",",,",",","","'","''","'''","''''"];function i(E,P){if(E.root==="none")return{root:n("C",P),mode:"",acc:"",accidentals:[]};var x=t(E.root+E.acc+E.mode),M=n(x,P),N=a(M,E.mode),D=e(M);return{root:N[0],mode:E.mode,acc:N.length>1?N[1]:"",accidentals:D}}function v(E,P,x,M){for(var N=E.pitch,D=c.indexOf(E.name),k=c.indexOf(P.root),S=(k+N)%7,z=D+x,L=E.oct;z>6;)L++,z-=7;for(;z<0;)L--,z+=7;for(var R=c[S],y="",C=E.adj,A="=",B=0;B<P.accidentals.length;B++)if(P.accidentals[B].note.toLowerCase()===R.toLowerCase()){C=C+(P.accidentals[B].acc==="flat"?-1:1),A=P.accidentals[B].acc==="flat"?"_":"^";break}var O;switch(C){case-2:y="__";break;case-1:y="_";break;case 0:y="=";break;case 1:y="^";break;case 2:y="^^";break;case-3:return O={},O.pitch=E.pitch-1,O.oct=E.oct,O.name=c[c.indexOf(E.name)-1],O.name||(O.name="B",O.oct--),O.name==="B"||O.name==="E"?O.adj=E.adj+1:O.adj=E.adj+2,v(O,P,x+1,M);case 3:return O={},O.pitch=E.pitch+1,O.oct=E.oct,O.name=c[c.indexOf(E.name)+1],O.name||(O.name="C",O.oct++),O.name==="C"||O.name==="F"?O.adj=E.adj-1:O.adj=E.adj-2,v(O,P,x+1,M)}switch((M[R]===y||!M[R]&&y===A)&&!E.courtesy&&(y=""),L){case 0:R=R+",,,";break;case 1:R=R+",,";break;case 2:R=R+",";break;case 4:R=R.toLowerCase();break;case 5:R=R.toLowerCase()+"'";break;case 6:R=R.toLowerCase()+"''";break;case 7:R=R.toLowerCase()+"'''";break;case 8:R=R.toLowerCase()+"''''";break}return L>4&&(R=R.toLowerCase()),{acc:y,name:R,upper:R.toUpperCase()}}var b=/([_^=]*)([A-Ga-g])([,']*)/,m=/([_^=]*[A-Ga-g][,']*)?(\d*\/*\d*)?([\>\<\-\)]*)?/;function w(E,P,x,M){var N=P==="none"?0:c.indexOf(P),D=E.match(b),k=D[2].toUpperCase(),S=c.indexOf(k)-N;S<0&&(S+=7);var z=u.indexOf(D[3]);k===D[2]&&z--;var L=M[k]||x[k]||"=";return{acc:D[1],name:k,pitch:S,oct:z,adj:I(D[1],x[k],M[k]),courtesy:D[1]===L}}function _(E,P,x){for(var M=E.substring(P,x),N,D=[],k=/("[^"]+")+/g;(N=k.exec(M))!==null;)D.push({start:k.lastIndex-N[0].length,end:k.lastIndex});for(var S=/(![^!]+!)+/g;(N=S.exec(M))!==null;)D.push({start:S.lastIndex-N[0].length,end:S.lastIndex});for(var z=[],L=/([_^=]*)([A-Ga-g])([,']*)/g;(N=L.exec(M))!==null;){for(var R=!1,y=0;y<D.length;y++)L.lastIndex>=D[y].start&&L.lastIndex<=D[y].end&&(R=!0);R||z.push({note:N[0],index:P+L.lastIndex-N[0].length})}return z}function T(E,P,x,M,N){var D=E.substring(P,x),k=/\{/,S=/\}/,z=/([^\{]*)/,L=/(\/*)/,R=D.match(new RegExp(z.source+k.source+L.source+m.source+L.source+m.source+L.source+m.source+L.source+m.source+L.source+m.source+L.source+m.source+L.source+m.source+L.source+m.source+S.source));if(R){for(var y=1+R[1].length,C=0;C<N;C++)R[C*3+2]&&(y+=R[C*3+2].length),R[C*3+3]&&(y+=R[C*3+3].length),R[C*3+4]&&(y+=R[C*3+4].length),R[C*3+5]&&(y+=R[C*3+5].length);R[N*3+2]&&(y+=R[C*3+2].length),P+=y;var A=R[N*3+3]?R[N*3+3].length:0;A+=R[N*3+4]?R[N*3+4].length:0,A+=R[N*3+5]?R[N*3+5].length:0,x=P+A}return{start:P,end:x,note:M}}function q(E,P,x,M){var N=E.substring(P,x).match(/([^"]+)?(".+")+/);return N[1]&&(P+=N[1].length),x=P+N[2].length,{start:P+1,end:x-1,note:M}}function I(E,P,x){if(!E&&x&&(E=x),!E)return 0;switch(P){case void 0:switch(E){case"__":return-2;case"_":return-1;case"=":return 0;case"^":return 1;case"^^":return 2;default:return 0}case"_":switch(E){case"__":return-1;case"_":return 0;case"=":return 1;case"^":return 2;case"^^":return 3;default:return 0}case"^":switch(E){case"__":return-3;case"_":return-2;case"=":return-1;case"^":return 0;case"^^":return 1;default:return 0}}return 0}})(),vn=o,vn}var mn,As;function $g(){if(As)return mn;As=1;var e=function(a,r,s,o){this.type="BeamElem",this.isflat=!!s,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=a,this.beams=[],o&&o.duration?(this.duration=o.duration,o.startTriplet&&(this.duration*=o.tripletMultiplier),this.duration=Math.round(this.duration*1e3)/1e3):this.duration=0};e.prototype.setHint=function(){this.hint=!0},e.prototype.runningDirection=function(n){var a=n.averagepitch;a!==void 0&&(this.total=Math.round(this.total+a),this.count||(this.count=0),this.count++)},e.prototype.add=function(n){var a=n.abcelem.averagepitch;a!==void 0&&(n.abcelem.rest||(this.allrests=!1),n.beam=this,this.elems.push(n),this.total=Math.round(this.total+a),(this.min===void 0||n.abcelem.minpitch<this.min)&&(this.min=n.abcelem.minpitch),(this.max===void 0||n.abcelem.maxpitch>this.max)&&(this.max=n.abcelem.maxpitch))},e.prototype.addBeam=function(n){this.beams.push(n)},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 n=6;this.stemsUp=this.average<n}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 n=6;this.stemsUp=this.average<n}for(var a=this.stemsUp?"up":"down",r=0;r<this.elems.length;r++)for(var s=0;s<this.elems[r].heads.length;s++)this.elems[r].heads[s].stemDir=a};function t(n,a){return a?n/a:0}return mn=e,mn}var bn,Ms;function Gg(){if(Ms)return bn;Ms=1;var e=function(n,a){this.startVoice=n,this.type=a};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)},bn=e,bn}var yn,Is;function vt(){if(Is)return yn;Is=1;var e=Xe(),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 n=function(s){for(var o=[],l=0,h=s.length;l<h;l++){o[l]=[];for(var g=0,p=s[l].length;g<p;g++)o[l][g]=s[l][g]}return o},a=function(s,o,l){for(var h=0,g=s.length;h<g;h++){var p=s[h],d,f;for(d=1,f=p.length;d<f;d++)p[d]*=d%2?o:l}},r={printSymbol:function(s,o,l,h,g){if(!t[l])return null;var p=n(t[l].d);p[0][1]+=s,p[0][2]+=o;for(var d="",f=0;f<p.length;f++)d+=p[f].join(" ");return g.path=d,h.path(g)},getPathForSymbol:function(s,o,l,h,g){if(h=h||1,g=g||1,!t[l])return null;var p=n(t[l].d);return(h!==1||g!==1)&&a(p,h,g),p[0][1]+=s,p[0][2]+=o,p},getSymbolWidth:function(s){return t[s]?t[s].w:0},symbolHeightInPitches:function(s){var o=t[s]?t[s].h:0;return o/e.STEP},getSymbolAlign:function(s){return s.substring(0,7)==="scripts"&&s!=="scripts.roll"?"center":"left"},getYCorr:function(s){switch(s){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(s,o){t[s]=o}};return yn=r,yn}var wn,Ns;function Zg(){if(Ns)return wn;Ns=1;var e=Bt(),t=vt(),n=it(),a=function(s,o){var l,h=0;s.el_type="clef";var g=new e(s,0,10,"staff-extra clef",o);switch(g.isClef=!0,s.type){case"treble":l="clefs.G";break;case"tenor":l="clefs.C";break;case"alto":l="clefs.C";break;case"bass":l="clefs.F";break;case"treble+8":l="clefs.G",h=1;break;case"tenor+8":l="clefs.C",h=1;break;case"bass+8":l="clefs.F",h=1;break;case"alto+8":l="clefs.C",h=1;break;case"treble-8":l="clefs.G",h=-1;break;case"tenor-8":l="clefs.C",h=-1;break;case"bass-8":l="clefs.F",h=-1;break;case"alto-8":l="clefs.C",h=-1;break;case"none":return null;case"perc":l="clefs.perc";break;default:g.addFixed(new n("clef="+s.type,0,0,void 0,{type:"debug"}))}var p=5;if(l){var d=t.symbolHeightInPitches(l),f=r(l);if(g.addRight(new n(l,p,t.getSymbolWidth(l),s.clefPos,{top:d+s.clefPos+f,bottom:s.clefPos+f})),h!==0){var c=.6666666666666666,u=(t.getSymbolWidth(l)-t.getSymbolWidth("8")*c)/2,i=h>0?g.top+3:g.bottom-1,v=h>0?g.top+3:g.bottom-3,b=v-2;s.type==="bass-8"&&(i=3,u=0),g.addRight(new n("8",p+u,t.getSymbolWidth("8")*c,i,{scalex:c,scaley:c,top:v,bottom:b}))}}return g};function r(s){switch(s){case"clefs.G":return-5;case"clefs.C":return-4;case"clefs.F":return-4;case"clefs.perc":return-2;default:return 0}}return wn=a,wn}var _n,Ps;function jg(){if(Ps)return _n;Ps=1;var e=Bt(),t=vt(),n=it(),a=function(r,s){if(r.el_type="keySignature",!r.accidentals||r.accidentals.length===0)return null;var o=new e(r,0,10,"staff-extra key-signature",s);o.isKeySig=!0;var l=0;return r.accidentals.forEach(function(h){var g,p=0;switch(h.acc){case"sharp":g="accidentals.sharp",p=-3;break;case"natural":g="accidentals.nat";break;case"flat":g="accidentals.flat",p=-1.2;break;case"quartersharp":g="accidentals.halfsharp",p=-2.5;break;case"quarterflat":g="accidentals.halfflat",p=-1.2;break;default:g="accidentals.flat"}o.addRight(new n(g,l,t.getSymbolWidth(g),h.verticalPos,{thickness:t.symbolHeightInPitches(g),top:h.verticalPos+t.symbolHeightInPitches(g)+p,bottom:h.verticalPos+p})),l+=t.getSymbolWidth(g)+2},this),o};return _n=a,_n}var kn,zs;function Ug(){if(zs)return kn;zs=1;var e=vt(),t=it(),n=function(a,r,s,o){o||(o={});var l=o.dir!==void 0?o.dir:null,h=o.headx!==void 0?o.headx:0,g=o.extrax!==void 0?o.extrax:0,p=o.flag!==void 0?o.flag:null,d=o.dot!==void 0?o.dot:0,f=o.dotshiftx!==void 0?o.dotshiftx:0,c=o.scale!==void 0?o.scale:1,u=o.accidentalSlot!==void 0?o.accidentalSlot:[],i=o.shouldExtendStem!==void 0?o.shouldExtendStem:!1,v=o.printAccidentals!==void 0?o.printAccidentals:!0,b=s.verticalPos,m,w=0,_=0,T=0;if(r===void 0)a.addFixed(new t("pitch is undefined",0,0,0,{type:"debug"}));else if(r==="")m=new t(null,0,0,b);else{var q=h;if(s.printer_shift){var I=s.printer_shift==="same"?1:0;q=l==="down"?-e.getSymbolWidth(r)*c+I:e.getSymbolWidth(r)*c-I}var E={scalex:c,scaley:c,thickness:e.symbolHeightInPitches(r)*c,name:s.name};if(m=new t(r,q,e.getSymbolWidth(r)*c,b,E),m.stemDir=l,p){var P=b+(l==="down"?-7:7)*c;i&&(l==="down"&&P>6&&(P=6),l==="up"&&P<6&&(P=6));var x=l==="down"?h:h+m.w-.6;a.addRight(new t(p,x,e.getSymbolWidth(p)*c,P,{scalex:c,scaley:c}))}for(_=m.w+f-2+5*d;d>0;d--){var M=1-Math.abs(b)%2;a.addRight(new t("dots.dot",m.w+f-2+5*d,e.getSymbolWidth("dots.dot"),b+M))}}if(m&&(m.highestVert=s.highestVert),v&&s.accidental){var N;switch(s.accidental){case"quartersharp":N="accidentals.halfsharp";break;case"dblsharp":N="accidentals.dblsharp";break;case"sharp":N="accidentals.sharp";break;case"quarterflat":N="accidentals.halfflat";break;case"flat":N="accidentals.flat";break;case"dblflat":N="accidentals.dblflat";break;case"natural":N="accidentals.nat"}for(var D=!1,k=g,S=0;S<u.length;S++)if(b-u[S][0]>=6){u[S][0]=b,k=u[S][1],D=!0;break}D===!1&&(k-=e.getSymbolWidth(N)*c+2,u.push([b,k]),w=e.getSymbolWidth(N)*c+2);var z=e.symbolHeightInPitches(N);a.addExtra(new t(N,k,e.getSymbolWidth(N),b,{scalex:c,scaley:c,top:b+z/2,bottom:b-z/2})),T=e.getSymbolWidth(N)/2}return{notehead:m,accidentalshiftx:w,dotshiftx:_,extraLeft:T}};return kn=n,kn}var xn,Rs;function Yg(){if(Rs)return xn;Rs=1;var e=Bt(),t=vt(),n=it(),a=function(r,s){r.el_type="timeSignature";var o=new e(r,0,10,"staff-extra time-signature",s);if(r.type==="specified")for(var l=0,h=0;h<r.value.length;h++)if(h!==0&&(o.addRight(new n("+",l+1,t.getSymbolWidth("+"),6,{thickness:t.symbolHeightInPitches("+")})),l+=t.getSymbolWidth("+")+2),r.value[h].den){for(var g=0,p=0;p<r.value[h].num.length;p++)g+=t.getSymbolWidth(r.value[h].num[p]);var d=0;for(p=0;p<r.value[h].num.length;p++)d+=t.getSymbolWidth(r.value[h].den[p]);var f=Math.max(g,d);o.addRight(new n(r.value[h].num,l+(f-g)/2,g,8,{thickness:t.symbolHeightInPitches(r.value[h].num[0])})),o.addRight(new n(r.value[h].den,l+(f-d)/2,d,4,{thickness:t.symbolHeightInPitches(r.value[h].den[0])})),l+=f}else{for(var c=0,u=0;u<r.value[h].num.length;u++)c+=t.getSymbolWidth(r.value[h].num[u]);o.addRight(new n(r.value[h].num,l,c,6,{thickness:t.symbolHeightInPitches(r.value[h].num[0])})),l+=c}else r.type==="common_time"?o.addRight(new n("timesig.common",0,t.getSymbolWidth("timesig.common"),6,{thickness:t.symbolHeightInPitches("timesig.common")})):r.type==="cut_time"?o.addRight(new n("timesig.cut",0,t.getSymbolWidth("timesig.cut"),6,{thickness:t.symbolHeightInPitches("timesig.cut")})):r.type==="tempus_imperfectum"?o.addRight(new n("timesig.imperfectum",0,t.getSymbolWidth("timesig.imperfectum"),6,{thickness:t.symbolHeightInPitches("timesig.imperfectum")})):r.type==="tempus_imperfectum_prolatio"?o.addRight(new n("timesig.imperfectum2",0,t.getSymbolWidth("timesig.imperfectum2"),6,{thickness:t.symbolHeightInPitches("timesig.imperfectum2")})):r.type==="tempus_perfectum"?o.addRight(new n("timesig.perfectum",0,t.getSymbolWidth("timesig.perfectum"),6,{thickness:t.symbolHeightInPitches("timesig.perfectum")})):r.type==="tempus_perfectum_prolatio"?o.addRight(new n("timesig.perfectum2",0,t.getSymbolWidth("timesig.perfectum2"),6,{thickness:t.symbolHeightInPitches("timesig.perfectum2")})):console.log("time signature:",r);return o};return xn=a,xn}var Cn,qs;function Wg(){if(qs)return Cn;qs=1;var e=function(n,a,r){this.type="DynamicDecoration",this.anchor=n,this.dec=a,r==="below"?this.volumeHeightBelow=6:this.volumeHeightAbove=6,this.pitch=void 0};return Cn=e,Cn}var Sn,Bs;function Vg(){if(Bs)return Sn;Bs=1;var e=function(n,a,r,s){this.type="CrescendoElem",this.anchor1=n,this.anchor2=a,this.dir=r,s==="above"?this.dynamicHeightAbove=6:this.dynamicHeightBelow=6,this.pitch=void 0};return Sn=e,Sn}var Tn,Ls;function Xg(){if(Ls)return Tn;Ls=1;var e=function(n,a){this.type="GlissandoElem",this.anchor1=n,this.anchor2=a};return Tn=e,Tn}var En,Os;function Ul(){if(Os)return En;Os=1;var e=function(n){this.type="TieElem",this.anchor1=n.anchor1,this.anchor2=n.anchor2,n.isGrace&&(this.isGrace=!0),n.fixedY&&(this.fixedY=!0),n.stemDir&&(this.stemDir=n.stemDir),n.voiceNumber!==void 0&&(this.voiceNumber=n.voiceNumber),n.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 n=0;n<this.internalNotes.length;n++){var a=this.internalNotes[n];a.stemDir==="down"&&(t=!0)}this.above=t}},e.prototype.calcX=function(t,n){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=n},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,n=(this.anchor2.highestVert+this.anchor2.pitch)/2;if(this.above&&this.anchor2.stemDir==="up"&&!this.fixedY&&!t&&n<this.startY?(this.endY=n,this.endX+=Math.round(this.anchor2.w/2)):this.endY=this.above&&t?this.anchor2.highestVert:this.anchor2.pitch,this.anchor1.scalex===1){var a=!!this.anchor1.parent.beam,r=!!this.anchor2.parent.beam;if(a){var s=this.anchor1.parent===this.anchor1.parent.beam.elems[this.anchor1.parent.beam.elems.length-1];s||(this.above?this.startY=this.anchor1.parent.fixed.t:this.startY=this.anchor1.parent.fixed.b)}if(r){var o=this.anchor2.parent===this.anchor2.parent.beam.elems[0];o||(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,n=0;n<this.internalNotes.length;n++)this.internalNotes[n].highestVert>t&&(t=this.internalNotes[n].highestVert);t>this.startY&&t>this.endY&&(this.startY=this.endY=t-1)}},e.prototype.getYBounds=function(){var t=10,n=1e3;this.isTie?(this.calcTieDirection(),this.calcX(t,n),this.calcTieY()):(this.calcSlurDirection(),this.calcX(t,n),this.calcSlurY());var a,r;return this.above?(r=Math.min(this.startY,this.endY),a=r+3):(a=Math.min(this.startY,this.endY),r=a-3),[a,r]},En=e,En}var An,Ds;function Kg(){if(Ds)return An;Ds=1;var e=Wg(),t=Vg(),n=Xg(),a=vt(),r=it(),s=Ul(),o=function(){this.startDiminuendoX=void 0,this.startCrescendoX=void 0,this.minTop=12,this.minBottom=0},l=function(u,i,v,b,m,w,_,T,q){for(var I,E=0;E<i.length;E++){if(i[E]==="staccato"||i[E]==="tenuto"||i[E]==="accent"&&!q){var P="scripts."+i[E];if(i[E]==="accent"&&(P="scripts.sforzato"),I===void 0?I=_==="down"?v+2:T-2:I=_==="down"?I+2:I-2,i[E]==="accent")_==="up"?I--:I++;else switch(I){case 2:case 4:case 6:case 8:case 10:_==="up"?I--:I++;break}v>9&&I++;var x=b/2;a.getSymbolAlign(P)!=="center"&&(x-=a.getSymbolWidth(P)/2),m.addFixedX(new r(P,x,a.getSymbolWidth(P),I))}if(i[E]==="slide"&&m.heads[0]){var M=m.heads[0].pitch;M-=2;var N=new r("",-w-15,0,M-1),D=new r("",-w-5,0,M+1);m.addFixedX(N),m.addFixedX(D),u.addOther(new s({anchor1:N,anchor2:D,fixedY:!0}))}}return I===void 0&&(I=v),{above:I,below:m.bottom}},h=function(u,i,v,b){for(var m=0;m<i.length;m++)switch(i[m]){case"p":case"mp":case"pp":case"ppp":case"pppp":case"f":case"ff":case"fff":case"ffff":case"sfz":case"mf":var w=new e(v,i[m],b);u.addOther(w)}},g=function(u,i,v,b,m){function w(){if(b.heads.length===0)return 10;for(var I=b.heads[0].pitch,E=1;E<b.heads.length;E++)I=Math.max(I,b.heads[E].pitch);return I}function _(){if(b.heads.length===0)return 2;for(var I=b.heads[0].pitch,E=1;E<b.heads.length;E++)I=Math.min(I,b.heads[E].pitch);return I}function T(I,E){var P=m==="down"?_()+1:w()+9;m!=="down"&&E===1&&P--;var x=v/2;x+=m==="down"?-5:3;for(var M=0;M<E;M++)P-=1,b.addFixedX(new r(I,x,a.getSymbolWidth(I),P))}for(var q=0;q<u.length;q++)switch(u[q]){case"/":T("flags.ugrace",1);break;case"//":T("flags.ugrace",2);break;case"///":T("flags.ugrace",3);break;case"////":T("flags.ugrace",4);break}},p=function(u,i,v,b,m,w,_,T){function q(D,k){D==="above"?b.above+=k:b.below-=k}function I(D){var k;return D==="above"?(k=b.above,k<w&&(k=w)):(k=b.below,k>_&&(k=_)),k}function E(D,k,S){var z=I(k),L=2,R=5;v.addFixedX(new r(D,i/2,0,z+L,{type:"decoration",klass:"ornament",thickness:3,anchor:S})),q(k,R)}function P(D,k){var S=i/2;a.getSymbolAlign(D)!=="center"&&(S-=a.getSymbolWidth(D)/2);var z=a.symbolHeightInPitches(D)+1,L=I(k);L=k==="above"?L+z/2:L-z/2,v.addFixedX(new r(D,S,a.getSymbolWidth(D),L,{klass:"ornament",thickness:a.symbolHeightInPitches(D),position:k})),q(k,z)}for(var x={"+":"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"},M=!1,N=0;N<u.length;N++)switch(u[N]){case"0":case"1":case"2":case"3":case"4":case"5":case"D.C.":case"D.S.":E(u[N],m,"middle"),M=!0;break;case"D.C.alcoda":E("D.C. al coda",m,"end"),M=!0;break;case"D.C.alfine":E("D.C. al fine",m,"end"),M=!0;break;case"D.S.alcoda":E("D.S. al coda",m,"end"),M=!0;break;case"D.S.alfine":E("D.S. al fine",m,"end"),M=!0;break;case"fine":E("FINE",m,"middle"),M=!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":P(x[u[N]],m),M=!0;break;case"invertedfermata":P(x[u[N]],"below"),M=!0;break;case"mark":v.klass="mark";break;case"accent":T&&(P("scripts.sforzato",m),M=!0);break}return M};function d(u,i,v){for(var b=0;b<u.length;b++)switch(u[b]){case"arpeggio":for(var m=i.abcelem.minpitch-1;m<=i.abcelem.maxpitch;m+=2)i.addExtra(new r("scripts.arpeggio",-a.getSymbolWidth("scripts.arpeggio")*2-v,0,m+2,{klass:"ornament",thickness:a.symbolHeightInPitches("scripts.arpeggio")}));break}}o.prototype.endLine=function(u){this.startDiminuendoX&&(u.addOther(new t(this.startDiminuendoX,c(u.children),">",this.dynamicPositioning)),this.startDiminuendoX=void 0),this.startCrescendoX&&(u.addOther(new t(this.startCrescendoX,c(u.children),"<",this.dynamicPositioning)),this.startCrescendoX=void 0)},o.prototype.dynamicDecoration=function(u,i,v,b){for(var m,w,_,T=0;T<i.length;T++)switch(i[T]){case"diminuendo(":this.startDiminuendoX=v,this.dynamicPositioning=b,m=void 0;break;case"diminuendo)":this.startDiminuendoX||(this.startDiminuendoX=f(u.children)),m={start:this.startDiminuendoX,stop:v},this.startDiminuendoX=void 0;break;case"crescendo(":this.startCrescendoX=v,this.dynamicPositioning=b,w=void 0;break;case"crescendo)":this.startCrescendoX||(this.startCrescendoX=f(u.children)),w={start:this.startCrescendoX,stop:v},this.startCrescendoX=void 0;break;case"~(":case"glissando(":this.startGlissandoX=v,_=void 0;break;case"~)":case"glissando)":_={start:this.startGlissandoX,stop:v},this.startGlissandoX=void 0;break}m&&u.addOther(new t(m.start,m.stop,">",b)),w&&u.addOther(new t(w.start,w.stop,"<",b)),_&&u.addOther(new n(_.start,_.stop))};function f(u){for(var i=0;i<u.length;i++)if(u[i].abcelem.pitches)return u[i];return null}function c(u){return u[u.length-1]}return o.prototype.createDecoration=function(u,i,v,b,m,w,_,T,q,I,E){q||(q={ornamentPosition:"above",volumePosition:I?"above":"below",dynamicPosition:I?"above":"below"}),h(u,i,m,q.volumePosition),this.dynamicDecoration(u,i,m,q.dynamicPosition),g(i,v,b,m,_);var P=l(u,i,v,b,m,w,_,T,E);P.above=Math.max(P.above,this.minTop),P.below=Math.min(P.below,T),p(i,b,m,P,q.ornamentPosition,this.minTop,T,E),d(i,m,w)},An=o,An}var Mn,Fs;function Jg(){if(Fs)return Mn;Fs=1;var e=function(n,a,r){this.type="EndingElem",this.text=n,this.anchor1=a,this.anchor2=r,this.endingHeightAbove=5,this.pitch=void 0};return Mn=e,Mn}var In,Hs;function Qg(){if(Hs)return In;Hs=1;var e=function(t){for(var n=0,a=0;a<t.voices.length;a++){var r=t.voices[a].staff;t.voices[a].duplicate||(n+=r.top,n+=-r.bottom)}return n};return In=e,In}var Nn,$s;function ev(){if($s)return Nn;$s=1;var e=Qg(),t=function(n){this.getTextSize=n,this.voices=[],this.staffs=[],this.brace=void 0,this.bracket=void 0};return t.prototype.setLimit=function(n,a){a.specialY[n]&&(a.staff.specialY[n]?a.staff.specialY[n]=Math.max(a.staff.specialY[n],a.specialY[n]):a.staff.specialY[n]=a.specialY[n])},t.prototype.addVoice=function(n,a,r){var s=this.voices.length;this.voices[s]=n,this.staffs[a]?this.staffs[a].voices.push(s):this.staffs[this.staffs.length]={top:10,bottom:2,lines:r,voices:[s],specialY:{tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}},n.staff=this.staffs[a]},t.prototype.setHeight=function(){this.height=e(this)},t.prototype.setWidth=function(n){this.w=n;for(var a=0;a<this.voices.length;a++)this.voices[a].setWidth(n)},t.prototype.setStaffLimits=function(n){n.staff.top=Math.max(n.staff.top,n.top),n.staff.bottom=Math.min(n.staff.bottom,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)},Nn=t,Nn}var Pn,Gs;function tv(){if(Gs)return Pn;Gs=1;var e=Bt(),t=it(),n=function(r,s,o){this.type="TempoElement",this.tempo=r,this.tempo.type="tempo",this.tuneNumber=s,this.totalHeightInPitches=6,this.tempoHeightAbove=this.totalHeightInPitches,this.pitch=void 0,this.tempo.duration&&!this.tempo.suppressBpm&&(this.note=this.createNote(o,r,s))};return n.prototype.setX=function(a){this.x=a},n.prototype.createNote=function(a,r,s){var o=.75,l=r.duration[0],h=new e(r,l,1,"tempo",s),g,p,d;l<=1/32?(d="noteheads.quarter",p="flags.u32nd",g=0):l<=1/16?(d="noteheads.quarter",p="flags.u16th",g=0):l<=3/32?(d="noteheads.quarter",p="flags.u16nd",g=1):l<=1/8?(d="noteheads.quarter",p="flags.u8th",g=0):l<=3/16?(d="noteheads.quarter",p="flags.u8th",g=1):l<=1/4?(d="noteheads.quarter",g=0):l<=3/8?(d="noteheads.quarter",g=1):l<=1/2?(d="noteheads.half",g=0):l<=3/4?(d="noteheads.half",g=1):l<=1?(d="noteheads.whole",g=0):l<=1.5?(d="noteheads.whole",g=1):l<=2?(d="noteheads.dbl",g=0):(d="noteheads.dbl",g=1);var f=a(h,d,{verticalPos:0},{dir:"up",flag:p,dot:g,scale:o}),c=f.notehead;h.addHead(c);var u;if(d!=="noteheads.whole"&&d!=="noteheads.dbl"){var i=.3333333333333333*o,v=5*o,b=c.dx+c.w,m=-.6;u=new t(null,b,0,i,{type:"stem",pitch2:v,linewidth:m}),h.addRight(u)}return h},Pn=n,Pn}var zn,Zs;function rv(){if(Zs)return zn;Zs=1;var e=function(n,a,r){this.type="TripletElem",this.anchor1=a,this.number=n,this.durationClass=("d"+Math.round(a.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)},zn=e,zn}var Rn,js;function nv(){if(js)return Rn;js=1;function e(n){switch(n){case"B#":return"H#";case"B♯":return"H♯";case"B":return"H";case"Bb":return"B";case"B♭":return"B"}return n}function t(n,a,r){var s=n.split(`
110
+ `);for(let o=0;o<s.length;o++){let h=s[o].match(/^([ABCDEFG][♯♭]?)?([^\/]+)?(\/([ABCDEFG][#b♯♭]?))?/);if(!h)continue;let g=h[1]||"",p=h[2]||"",d=h[4]||"";r&&(g=e(g),d=e(d));const f=a?"":"",c=d?"/"+d:"";s[o]=[g,p,c].join(f)}return s.join(`
111
+ `)}return Rn=t,Rn}var qn,Us;function av(){if(Us)return qn;Us=1;var e=it(),t=Xe();const n=nv();var a=function(s,o,l,h,g,p,d,f){for(var c=0;c<l.chord.length;c++){var u=l.chord[c].position,i=l.chord[c].rel_position,v=u==="left"||u==="right"||u==="below"||u==="above"||!!i,b,m;v?(b="annotationfont",m="abcjs-annotation"):(b="gchordfont",m="abcjs-chord");var w=s.attr(b,m),_=l.chord[c].name,T;if(typeof _=="string")T=r(_,u,i,v,b,m,w,s,o,l,h,g,p,d,f),h=T.roomTaken,g=T.roomTakenRight;else for(var q=0;q<_.length;q++)T=r(_[q].text,u,i,v,b,m,w,s,o,l,h,g,p,d,f),h=T.roomTaken,g=T.roomTakenRight}return{roomTaken:h,roomTakenRight:g}};function r(s,o,l,h,g,p,d,f,c,u,i,v,b,m,w){for(var _=s.split(`
112
+ `),T=_.length-1;T>=0;T--){var q=_[T],I=0,E;h||(q=n(q,m,w));var P=f.calc(q,g,p),x=P.width,M=P.height/t.STEP;switch(o){case"left":i+=x+7,I=-i,E=u.averagepitch,c.addExtra(new e(q,I,x+4,E,{type:"text",height:M,dim:d,position:"left"}));break;case"right":v+=4,I=v,E=u.averagepitch,c.addRight(new e(q,I,x+4,E,{type:"text",height:M,dim:d,position:"right"}));break;case"below":c.addRight(new e(q,0,0,void 0,{type:"text",position:"below",height:M,dim:d,realWidth:x}));break;case"above":c.addRight(new e(q,0,0,void 0,{type:"text",position:"above",height:M,dim:d,realWidth:x}));break;default:if(l){var N=l.y+3*t.STEP;c.addRight(new e(q,I+l.x,0,u.minpitch+N/t.STEP,{position:"relative",type:"text",height:M,dim:d}))}else{var D="above";u.positioning&&u.positioning.chordPosition&&(D=u.positioning.chordPosition),D!=="hidden"&&c.addCentered(new e(q,b/2,x,void 0,{type:"chord",position:D,height:M,dim:d,realWidth:x}))}}}return{roomTaken:i,roomTakenRight:v}}return qn=a,qn}var Bn,Ys;function iv(){if(Ys)return Bn;Ys=1;var e=Bt(),t=$g(),n=Gg(),a=Zg(),r=jg(),s=Ug(),o=Yg(),l=Kg(),h=Jg(),g=vt(),p=it(),d=Xe(),f=ev(),c=tv(),u=Ul(),i=rv(),v=Fl(),b=av(),m=Ll(),w=at(),_=function(k){var S=0;return k.duration&&(S=k.duration),S},T=!1,q={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(k,S,z){this.decoration=new l,this.getTextSize=k,this.tuneNumber=S,this.isBagpipes=z.bagpipes,this.flatBeams=z.flatbeams,this.graceSlurs=z.graceSlurs,this.percmap=z.percmap,this.initialClef=z.initialClef,this.jazzchords=!!z.jazzchords,this.accentAbove=!!z.accentAbove,this.germanAlphabet=!!z.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(k){this.stemHeight=Math.round(k*10/d.STEP)/10},I.prototype.getCurrentVoiceId=function(k,S){return"s"+k+"v"+S},I.prototype.pushCrossLineElems=function(k,S){this.slursbyvoice[this.getCurrentVoiceId(k,S)]=this.slurs,this.tiesbyvoice[this.getCurrentVoiceId(k,S)]=this.ties,this.endingsbyvoice[this.getCurrentVoiceId(k,S)]=this.partstartelem,this.scaleByVoice[this.getCurrentVoiceId(k,S)]=this.voiceScale,this.voiceColor&&(this.colorByVoice[this.getCurrentVoiceId(k,S)]=this.voiceColor)},I.prototype.popCrossLineElems=function(k,S){this.slurs=this.slursbyvoice[this.getCurrentVoiceId(k,S)]||{},this.ties=this.tiesbyvoice[this.getCurrentVoiceId(k,S)]||[],this.partstartelem=this.endingsbyvoice[this.getCurrentVoiceId(k,S)],this.voiceScale=this.scaleByVoice[this.getCurrentVoiceId(k,S)],this.voiceScale===void 0&&(this.voiceScale=1),this.voiceColor=this.colorByVoice[this.getCurrentVoiceId(k,S)]},I.prototype.containsLyrics=function(k){for(var S=0;S<k.length;S++)for(var z=0;z<k[S].voices.length;z++)for(var L=0;L<k[S].voices[z].length;L++){var R=k[S].voices[z][L];if(R.lyric){(!R.positioning||R.positioning.vocalPosition==="below")&&(this.hasVocals=!0);return}}},I.prototype.createABCLine=function(k,S,z){this.minY=2,this.containsLyrics(k);var L=new f(this.getTextSize);this.tempoSet=!1;for(var R=0;R<k.length;R++)T&&this.restoreState(),T=!1,this.createABCStaff(L,k[R],S,R,z);return L},I.prototype.createABCStaff=function(k,S,z,L,R){k.getTextSize.updateFonts(S);for(var y=0;y<S.voices.length;y++){var C=new v(y,S.voices.length);y===0?(C.barfrom=S.connectBarLines==="start"||S.connectBarLines==="continue",C.barto=S.connectBarLines==="continue"||S.connectBarLines==="end"):C.duplicate=!0,S.title&&S.title[y]&&(C.header=S.title[y].replace(/\\n/g,`
113
+ `),C.headerPosition=6+k.getTextSize.baselineToCenter(C.header,"voicefont","staff-extra voice-name",y,S.voices.length)/d.STEP),S.clef&&S.clef.type==="perc"&&(C.isPercussion=!0);var A=(!this.initialClef||R===0)&&a(S.clef,this.tuneNumber);A&&(y===0&&S.barNumber&&this.addMeasureNumber(S.barNumber,A),C.addChild(A),this.startlimitelem=A);var B=r(S.key,this.tuneNumber);if(B&&(C.addChild(B),this.startlimitelem=B),S.meter){S.meter.type==="specified"?this.measureLength=S.meter.value[0].num/S.meter.value[0].den:this.measureLength=1;var O=o(S.meter,this.tuneNumber);C.addChild(O),this.startlimitelem=O}C.duplicate&&(C.children=[]);var $=S.clef.stafflines||S.clef.stafflines===0?S.clef.stafflines:5;k.addVoice(C,L,$);var F=$===1;this.createABCVoice(S.voices[y],z,L,y,F,C),k.setStaffLimits(C),y===0&&(S.brace==="start"||!k.brace&&S.brace?(k.brace||(k.brace=[]),k.brace.push(new n(C,"brace"))):S.brace==="end"&&k.brace?k.brace[k.brace.length-1].setBottomStaff(C):S.brace==="continue"&&k.brace&&k.brace[k.brace.length-1].continuing(C),S.bracket==="start"||!k.bracket&&S.bracket?(k.bracket||(k.bracket=[]),k.bracket.push(new n(C,"bracket"))):S.bracket==="end"&&k.bracket?k.bracket[k.bracket.length-1].setBottomStaff(C):S.bracket==="continue"&&k.bracket&&k.bracket[k.bracket.length-1].continuing(C))}};function E(k,S){var z=k[S];if(z.el_type!=="note"||!z.startBeam||z.endBeam)return{count:1,elem:z};for(var L=[];S<k.length&&k[S].el_type==="note"&&(L.push(k[S]),!k[S].endBeam);)S++;return{count:L.length,elem:L}}I.prototype.createABCVoice=function(k,S,z,L,R,y){this.popCrossLineElems(z,L),this.stemdir=this.isBagpipes?"down":null,this.abcline=k,this.partstartelem&&(this.partstartelem=new h("",null,null),y.addOther(this.partstartelem));var C=y.voicetotal<2?-1:y.voicenumber;for(var A in this.slurs)this.slurs.hasOwnProperty(A)&&(this.slurs[A]=new u({force:this.slurs[A].force,voiceNumber:C,stemDir:this.slurs[A].stemDir,style:this.slurs[A].dotted}),T&&this.slurs[A].setHint(),y.addOther(this.slurs[A]));for(var B=0;B<this.ties.length;B++)this.ties[B]=new u({force:this.ties[B].force,stemDir:this.ties[B].stemDir,voiceNumber:C,style:this.ties[B].dotted}),T&&this.ties[B].setHint(),y.addOther(this.ties[B]);for(var O=0;O<this.abcline.length;O++)P(this.abcline[O]),this.minY=Math.min(this.abcline[O].minpitch,this.minY);for(var $=z===0,F=0;F<this.abcline.length;){var W=E(this.abcline,F),te=this.createABCElement($,R,y,W.elem);if(te)for(B=0;B<te.length;B++){if(!this.tempoSet&&S&&!S.suppress){this.tempoSet=!0;var J=new e(S,0,0,"tempo",this.tuneNumber,{});J.addFixedX(new c(S,this.tuneNumber,s)),y.addChild(J)}y.addChild(te[B])}F+=W.count}this.decoration.endLine(y),this.pushCrossLineElems(z,L)},I.prototype.saveState=function(){this.tiesSave=w.cloneArray(this.ties),this.slursSave=w.cloneHashOfHash(this.slurs),this.slursbyvoiceSave=w.cloneHashOfHash(this.slursbyvoice),this.tiesbyvoiceSave=w.cloneHashOfArrayOfHash(this.tiesbyvoice)},I.prototype.restoreState=function(){this.ties=w.cloneArray(this.tiesSave),this.slurs=w.cloneHashOfHash(this.slursSave),this.slursbyvoice=w.cloneHashOfHash(this.slursbyvoiceSave),this.tiesbyvoice=w.cloneHashOfArrayOfHash(this.tiesbyvoiceSave)},I.prototype.createABCElement=function(k,S,z,L){var R=[];switch(L.el_type){case void 0:R=this.createBeam(S,z,L);break;case"note":R[0]=this.createNote(L,!1,S,z),this.triplet&&this.triplet.isClosed()&&(z.addOther(this.triplet),this.triplet=null,this.tripletmultiplier=1);break;case"bar":R[0]=this.createBarLine(z,L,k),z.duplicate&&R.length>0&&(R[0].invisible=!0);break;case"meter":R[0]=o(L,this.tuneNumber),this.startlimitelem=R[0],z.duplicate&&R.length>0&&(R[0].invisible=!0);break;case"clef":if(R[0]=a(L,this.tuneNumber),!R[0])return null;z.duplicate&&R.length>0&&(R[0].invisible=!0);break;case"key":var y=r(L,this.tuneNumber);y&&(R[0]=y,this.startlimitelem=R[0]),z.duplicate&&R.length>0&&(R[0].invisible=!0);break;case"stem":this.stemdir=L.direction==="auto"?void 0:L.direction;break;case"part":var C=new e(L,0,0,"part",this.tuneNumber),A=this.getTextSize.calc(L.title,"partsfont","part");C.addFixedX(new p(L.title,0,0,void 0,{type:"part",height:A.height/d.STEP})),R[0]=C;break;case"tempo":var B=new e(L,0,0,"tempo",this.tuneNumber);L.suppress||B.addFixedX(new c(L,this.tuneNumber,s)),R[0]=B;break;case"style":L.head==="normal"?delete this.style:this.style=L.head;break;case"hint":T=!0,this.saveState();break;case"midi":break;case"scale":this.voiceScale=L.size;break;case"color":this.voiceColor=L.color,z.color=this.voiceColor;break;default:var O=new e(L,0,0,"unsupported",this.tuneNumber);O.addFixed(new p("element type "+L.el_type,0,0,void 0,{type:"debug"})),R[0]=O}return R};function P(k){if(k.pitches){x(k);for(var S=0,z=0;z<k.pitches.length;z++)S+=k.pitches[z].verticalPos;k.averagepitch=S/k.pitches.length,k.minpitch=k.pitches[0].verticalPos,k.maxpitch=k.pitches[k.pitches.length-1].verticalPos}}I.prototype.createBeam=function(k,S,z){var L=[],R=new t(this.stemHeight*this.voiceScale,this.stemdir,this.flatBeams,z[0]);T&&R.setHint();for(var y=0;y<z.length;y++)R.runningDirection(z[y]);R.setStemDirection();var C=this.stemdir;for(this.stemdir=R.stemsUp?"up":"down",y=0;y<z.length;y++){var A=z[y],B=this.createNote(A,!0,k,S);L.push(B),R.add(B),this.triplet&&this.triplet.isClosed()&&(S.addOther(this.triplet),this.triplet=null,this.tripletmultiplier=1)}return R.calcDir(),S.addBeam(R),this.stemdir=C,L};var x=function(k){var S;do{S=!0;for(var z=0;z<k.pitches.length-1;z++)if(k.pitches[z].pitch>k.pitches[z+1].pitch){S=!1;var L=k.pitches[z];k.pitches[z]=k.pitches[z+1],k.pitches[z+1]=L}}while(!S)},M=function(k,S,z,L,R,y,C,A,B){for(var O=z;O>11;O--)O%2===0&&!L&&k.addFixed(new p(null,A,(R+4)*B,O,{type:"ledger"}));for(O=S;O<1;O++)O%2===0&&!L&&k.addFixed(new p(null,A,(R+4)*B,O,{type:"ledger"}));for(O=0;O<y.length;O++){var $=R;C==="down"&&($=-$),k.addFixed(new p(null,$+A,(R+4)*B,y[O],{type:"ledger"}))}};I.prototype.addGraceNotes=function(k,S,z,L,R,y,C){var A=.6,B=3.5/5;R=Math.round(R*B);var O=null,$;k.gracenotes.length>1&&(O=new t(R,"grace",y),T&&O.setHint(),O.mainNote=z);var F,W=[];for(F=k.gracenotes.length-1;F>=0;F--)C+=10,W[F]=C,k.gracenotes[F].accidental&&(C+=7);for(F=0;F<k.gracenotes.length;F++){var te=k.gracenotes[F].verticalPos;$=O?null:q.uflags[y?5:3];var J=[],ie=s(z,"noteheads.quarter",k.gracenotes[F],{dir:"up",headx:-W[F],extrax:-W[F],flag:$,scale:A*this.voiceScale,accidentalSlot:J});ie.notehead.highestVert=ie.notehead.pitch+R;var re=ie.notehead;if(this.addSlursAndTies(z,k.gracenotes[F],re,S,"up",!0),z.addExtra(re),k.gracenotes[F].acciaccatura){var oe=k.gracenotes[F].verticalPos+7*A,X=O?5:6;z.addRight(new p("flags.ugrace",-W[F]+X,0,oe,{scalex:A,scaley:A}))}if(O){var ne=k.gracenotes[F].duration/2;y&&(ne/=2);var ee={heads:[re],abcelem:{averagepitch:te,minpitch:te,maxpitch:te,duration:ne}};O.add(ee)}else{var he=te+.3333333333333333*A,de=te+7*A,Te=re.dx+re.w,_e=-.6;z.addExtra(new p(null,Te,0,he,{type:"stem",pitch2:de,linewidth:_e}))}M(z,te,te,!1,g.getSymbolWidth("noteheads.quarter"),[],!0,re.dx-1,.6);var qe=k.rest&&(k.rest.type==="spacer"||k.rest.type==="invisible");F===0&&!y&&this.graceSlurs&&!qe&&S.addOther(new u({anchor1:re,anchor2:L,isGrace:!0}))}return O&&(O.calcDir(),S.addBeam(O)),C};function N(k,S,z,L,R,y,C,A,B){var O,$=7,F,W,te;switch(R&&(y==="down"&&($=3),y==="up"&&($=11)),C&&(z<.5||z<1?$=7:$=5),S.rest.type){case"whole":O=q.rest[0],S.averagepitch=$,S.minpitch=$,S.maxpitch=$,L=0;break;case"rest":S.style==="rhythm"?O=q.rhythm[-A]:O=q.rest[-A],S.averagepitch=$,S.minpitch=$,S.maxpitch=$;break;case"invisible":case"invisible-multimeasure":case"spacer":O="",S.averagepitch=$,S.minpitch=$,S.maxpitch=$;break;case"multimeasure":O=q.rest.multi,S.averagepitch=$,S.minpitch=$,S.maxpitch=$,L=0;var J=g.getSymbolWidth(O);k.addHead(new p(O,J,J*2,7));var ie=new p(""+S.rest.text,J,J,16,{type:"multimeasure-text"});k.addExtra(ie)}if(S.rest.type.indexOf("multimeasure")<0&&S.rest.type!=="invisible"){var re=s(k,O,{verticalPos:$},{dot:L,scale:B});F=re.notehead,F&&(k.addHead(F),W=re.accidentalshiftx,te=re.dotshiftx)}return{noteHead:F,roomTaken:W,roomTakenRight:te}}function D(k,S){for(var z=0;z<k.length;z++)if(JSON.stringify(k[z])===JSON.stringify(S))return;k.push(S)}return I.prototype.addNoteToAbcElement=function(k,S,z,L,R,y,C,A,B){var O=0,$,F=0,W=0,te,J,ie=[],re=[],oe=0,X=S.averagepitch>=6?"down":"up";L&&(X=L),R=S.style?S.style:R,(!R||R==="normal")&&(R="note");var ne;y?ne=q[R].nostem:ne=q[R][-C],ne||console.log("noteSymbol:",R,C,y);var ee;for(ee=X==="down"?S.pitches.length-2:1;X==="down"?ee>=0:ee<S.pitches.length;ee=X==="down"?ee-1:ee+1){var he=S.pitches[X==="down"?ee+1:ee-1],de=S.pitches[ee],Te=X==="down"?he.pitch-de.pitch:de.pitch-he.pitch;Te<=1&&!he.printer_shift&&(de.printer_shift=Te?"different":"same",(de.verticalPos>11||de.verticalPos<1)&&ie.push(de.verticalPos-de.verticalPos%2),X==="down"?F=g.getSymbolWidth(ne)+2:O=g.getSymbolWidth(ne)+2)}var _e=S.pitches.length;for(ee=0;ee<S.pitches.length;ee++){if(!A){var qe;X==="down"&&ee!==0||X==="up"&&ee!==_e-1?qe=null:qe=q[X==="down"?"dflags":"uflags"][-C]}var ze;if(S.pitches[ee].style)ze=q[S.pitches[ee].style][-C];else if(B.isPercussion&&this.percmap){ze=ne;var De=this.percmap[m(S.pitches[ee])];De&&De.noteHead&&q[De.noteHead]&&(ze=q[De.noteHead][-C])}else ze=ne;S.pitches[ee].highestVert=S.pitches[ee].verticalPos;var G=(L==="up"||X==="up")&&ee===0,V=(L==="down"||X==="down")&&ee===_e-1;if(G||V){if((S.startSlur||_e===1)&&(S.pitches[ee].highestVert=S.pitches[_e-1].verticalPos,_(S)<1&&(L==="up"||X==="up")&&(S.pitches[ee].highestVert+=6)),S.startSlur)for(S.pitches[ee].startSlur||(S.pitches[ee].startSlur=[]),J=0;J<S.startSlur.length;J++)D(S.pitches[ee].startSlur,S.startSlur[J]);if(S.endSlur)for(S.pitches[ee].highestVert=S.pitches[_e-1].verticalPos,_(S)<1&&(L==="up"||X==="up")&&(S.pitches[ee].highestVert+=6),S.pitches[ee].endSlur||(S.pitches[ee].endSlur=[]),J=0;J<S.endSlur.length;J++)D(S.pitches[ee].endSlur,S.endSlur[J])}var H=!A&&C<=-1,U=s(k,ze,S.pitches[ee],{dir:X,extrax:-F,flag:qe,dot:z,dotshiftx:O,scale:this.voiceScale,accidentalSlot:re,shouldExtendStem:!L,printAccidentals:!B.isPercussion});oe=Math.max(g.getSymbolWidth(ze),oe),k.extraw-=U.extraLeft,$=U.notehead,$&&(this.addSlursAndTies(k,S.pitches[ee],$,B,H?X:null,!1),S.gracenotes&&S.gracenotes.length>0&&($.bottom=$.bottom-1),k.addHead($)),F+=U.accidentalshiftx,W=Math.max(W,U.dotshiftx)}if(H){var Q=Math.round(70*this.voiceScale)/10,ae=X==="down"?S.minpitch-Q:S.minpitch+1/3;ae>6&&!L&&(ae=6);var ce=X==="down"?S.maxpitch-1/3:S.maxpitch+Q;ce<6&&!L&&(ce=6);var ge=X==="down"||k.heads.length===0?0:k.heads[0].w,se=X==="down"?1:-1;$&&$.c==="noteheads.slash.quarter"&&(X==="down"?ce-=1:ae+=1),$&&$.c==="noteheads.triangle.quarter"&&(X==="down"?ce-=.7:ae-=1.2),k.addRight(new p(null,ge,0,ae,{type:"stem",pitch2:ce,linewidth:se,bottom:ae-1})),te=Math.min(ae,ce)}return{noteHead:$,roomTaken:F,roomTakenRight:W,min:te,additionalLedgers:ie,dir:X,symbolWidth:oe}},I.prototype.addLyric=function(k,S){var z="";S.lyric.forEach(function(y){var C=y.divider===" "?"":y.divider;z+=y.syllable+C+`
114
+ `});var L=this.getTextSize.calc(z,"vocalfont","lyric"),R=S.positioning?S.positioning.vocalPosition:"below";k.addCentered(new p(z,0,L.width,void 0,{type:"lyric",position:R,height:L.height/d.STEP,dim:this.getTextSize.attr("vocalfont","lyric")}))},I.prototype.createNote=function(k,S,z,L){var R=null,y=0,C=0,A=0,B=[],O,$=_(k),F=!1;$===0&&(F=!0,$=.25,S=!0);for(var W=Math.floor(Math.log($)/Math.log(2)),te=0,J=Math.pow(2,W),ie=J/2;J<$;te++,J+=ie,ie/=2);k.startTriplet&&(this.tripletmultiplier=k.tripletMultiplier);var re=$*this.tripletmultiplier;k.rest&&k.rest.type==="multimeasure"&&(re=1),k.rest&&k.rest.type==="invisible-multimeasure"&&(re=this.measureLength*k.rest.text);var oe=k.rest?"rest":"note",X=new e(k,re,1,oe,this.tuneNumber,{durationClassOveride:k.duration*this.tripletmultiplier});if(T&&X.setHint(),k.rest){this.measureLength===$&&k.rest.type!=="invisible"&&k.rest.type!=="spacer"&&k.rest.type.indexOf("multimeasure")<0&&(k.rest.type="whole");var ne=N(X,k,$,te,L.voicetotal>1,this.stemdir,z,W,this.voiceScale);R=ne.noteHead,y=ne.roomTaken,C=ne.roomTakenRight}else{var ee=this.addNoteToAbcElement(X,k,te,this.stemdir,this.style,F,W,S,L);ee.min!==void 0&&(this.minY=Math.min(ee.min,this.minY)),R=ee.noteHead,y=ee.roomTaken,C=ee.roomTakenRight,B=ee.additionalLedgers,O=ee.dir,A=ee.symbolWidth}if(k.lyric!==void 0&&this.addLyric(X,k),k.gracenotes!==void 0&&(y+=this.addGraceNotes(k,L,X,R,this.stemHeight*this.voiceScale,this.isBagpipes,y)),k.decoration){var he=S&&O!=="up"?Math.min(-3,X.bottom-6):X.bottom;this.decoration.createDecoration(L,k.decoration,X.top,R?R.w:0,X,y,O,he,k.positioning,this.hasVocals,this.accentAbove)}if(k.barNumber&&X.addFixed(new p(k.barNumber,-10,0,0,{type:"barNumber"})),M(X,k.minpitch,k.maxpitch,k.rest,A,B,O,-2,1),k.chord!==void 0){var de=b(this.getTextSize,X,k,y,C,A,this.jazzchords,this.germanAlphabet);y=de.roomTaken,C=de.roomTakenRight}return k.startTriplet&&(this.triplet=new i(k.startTriplet,R,{flatBeams:this.flatBeams})),k.endTriplet&&this.triplet&&this.triplet.setCloseAnchor(R),this.triplet&&!k.startTriplet&&!k.endTriplet&&!(k.rest&&k.rest.type==="spacer")&&this.triplet.middleNote(R),X},I.prototype.addSlursAndTies=function(k,S,z,L,R,y){if(S.endTie&&this.ties.length>0){for(var C=!1,A=0;A<this.ties.length;A++)if(this.ties[A].anchor1&&this.ties[A].anchor1.pitch===z.pitch){this.ties[A].setEndAnchor(z),L.setRange(this.ties[A]),this.ties.splice(A,1),C=!0;break}C||(this.ties[0].setEndAnchor(z),L.setRange(this.ties[0]),this.ties.splice(0,1))}var B=L.voicetotal<2?-1:L.voicenumber;if(S.startTie){var O=new u({anchor1:z,force:this.stemdir==="down"||this.stemdir==="up",stemDir:this.stemdir,isGrace:y,voiceNumber:B,style:S.startTie.style});T&&O.setHint(),this.ties[this.ties.length]=O,L.addOther(O),k.startTie=!0}var $,F;if(S.endSlur)for(var W=0;W<S.endSlur.length;W++)F=S.endSlur[W],this.slurs[F]?($=this.slurs[F],$.setEndAnchor(z),L.setRange($),delete this.slurs[F]):($=new u({anchor2:z,stemDir:this.stemdir,voiceNumber:B}),T&&$.setHint(),L.addOther($)),this.startlimitelem&&$.setStartX(this.startlimitelem);else if(!y)for(var te in this.slurs)this.slurs.hasOwnProperty(te)&&this.slurs[te].addInternalNote(z);if(S.startSlur)for(W=0;W<S.startSlur.length;W++)F=S.startSlur[W].label,$=new u({anchor1:z,stemDir:this.stemdir,voiceNumber:B,style:S.startSlur[W].style}),T&&$.setHint(),this.slurs[F]=$,L.addOther($)},I.prototype.addMeasureNumber=function(k,S){var z=this.getTextSize.calc(k,"measurefont","bar-number"),L=0;S.isClef&&(L+=z.width/2);var R=z.width>10&&S.abcelem.type==="treble"?13.5:11;S.addFixed(new p(k,L,z.width,R+z.height/d.STEP,{type:"barNumber",dim:this.getTextSize.attr("measurefont","bar-number")}))},I.prototype.createBarLine=function(k,S,z){var L=new e(S,0,10,"bar",this.tuneNumber),R=null,y=0;S.barNumber&&this.addMeasureNumber(S.barNumber,L);var C=S.type==="bar_right_repeat"||S.type==="bar_dbl_repeat",A=S.type!=="bar_left_repeat"&&S.type!=="bar_thick_thin"&&S.type!=="bar_invisible",B=S.type==="bar_right_repeat"||S.type==="bar_dbl_repeat"||S.type==="bar_left_repeat"||S.type==="bar_thin_thick"||S.type==="bar_thick_thin",O=S.type==="bar_left_repeat"||S.type==="bar_thick_thin"||S.type==="bar_thin_thin"||S.type==="bar_dbl_repeat",$=S.type==="bar_left_repeat"||S.type==="bar_dbl_repeat";if(C||$){for(var F in this.slurs)this.slurs.hasOwnProperty(F)&&this.slurs[F].setEndX(L);this.startlimitelem=L}if(C&&(L.addRight(new p("dots.dot",y,1,7)),L.addRight(new p("dots.dot",y,1,5)),y+=6),A&&(R=new p(null,y,1,2,{type:"bar",pitch2:10,linewidth:.6}),L.addRight(R)),S.type==="bar_invisible"&&(R=new p(null,y,1,2,{type:"none",pitch2:10,linewidth:.6}),L.addRight(R)),S.decoration&&this.decoration.createDecoration(k,S.decoration,12,B?3:1,L,0,"down",2,S.positioning,this.hasVocals,this.accentAbove),B&&(y+=4,R=new p(null,y,4,2,{type:"bar",pitch2:10,linewidth:4}),L.addRight(R),y+=5),this.partstartelem&&S.endEnding&&(this.partstartelem.anchor2=R,this.partstartelem=null),O&&(y+=3,R=new p(null,y,1,2,{type:"bar",pitch2:10,linewidth:.6}),L.addRight(R)),$&&(y+=3,L.addRight(new p("dots.dot",y,1,7)),L.addRight(new p("dots.dot",y,1,5))),S.startEnding&&z&&k.voicenumber===0){var W=this.getTextSize.calc(S.startEnding,"repeatfont","").width;L.minspacing+=W+10,this.partstartelem=new h(S.startEnding,R,null),k.addOther(this.partstartelem)}return L.extraw-=5,S.chord!==void 0&&b(this.getTextSize,L,S,0,0,0,!1,this.germanAlphabet),L},Bn=I,Bn}var Ln,Ws;function sv(){if(Ws)return Ln;Ws=1;var e="http://www.w3.org/2000/svg";function t(o){this.svg=s(),this.currentGroup=[],o.appendChild(this.svg)}t.prototype.clear=function(){if(this.svg){var o=this.svg.parentNode;this.svg=s(),this.currentGroup=[],o&&(o.innerHTML="",o.appendChild(this.svg))}},t.prototype.setTitle=function(o){var l=document.createElement("title"),h=document.createTextNode(o);l.appendChild(h),this.svg.insertBefore(l,this.svg.firstChild)},t.prototype.setResponsiveWidth=function(o,l){if(this.svg.setAttribute("viewBox","0 0 "+o+" "+l),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 h=this.svg.parentNode.getAttribute("class");h?h.indexOf("abcjs-container")<0&&this.svg.parentNode.setAttribute("class",h+" 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=l/o*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(o,l){this.svg.setAttribute("width",o),this.svg.setAttribute("height",l)},t.prototype.setAttribute=function(o,l){this.svg.setAttribute(o,l)},t.prototype.setScale=function(o){o!==1?(this.svg.style.transform="scale("+o+","+o+")",this.svg.style["-ms-transform"]="scale("+o+","+o+")",this.svg.style["-webkit-transform"]="scale("+o+","+o+")",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(o){var l=document.createElementNS(e,"style");l.textContent=o,this.svg.insertBefore(l,this.svg.firstChild)},t.prototype.setParentStyles=function(o){for(var l in o)o.hasOwnProperty(l)&&this.svg.parentNode&&(this.svg.parentNode.style[l]=o[l]);if(this.dummySvg){var h=document.querySelector("body");h.removeChild(this.dummySvg),this.dummySvg=null}};function n(o,l,h){var g=h-o;return"M "+o+" "+l+" l "+g+" 0 l 0 1 l "+-g+" 0 z "}function a(o,l,h){var g=h-l;return"M "+o+" "+l+" l 0 "+g+" l 1 0 l 0 "+-g+" z "}t.prototype.rect=function(o){var l=[],h=o.x,g=o.y,p=o.x+o.width,d=o.y+o.height;return l.push(n(h,g,p)),l.push(n(h,d,p)),l.push(a(p,g,d)),l.push(a(h,d,g)),this.path({path:l.join(" "),stroke:"none","data-name":o["data-name"]})},t.prototype.dottedLine=function(o){var l=document.createElementNS(e,"line");l.setAttribute("x1",o.x1),l.setAttribute("x2",o.x2),l.setAttribute("y1",o.y1),l.setAttribute("y2",o.y2),l.setAttribute("stroke",o.stroke),l.setAttribute("stroke-dasharray","5,5"),this.svg.insertBefore(l,this.svg.firstChild)},t.prototype.rectBeneath=function(o){var l=document.createElementNS(e,"rect");l.setAttribute("x",o.x),l.setAttribute("width",o.width),l.setAttribute("y",o.y),l.setAttribute("height",o.height),o.stroke&&l.setAttribute("stroke",o.stroke),o["stroke-opacity"]&&l.setAttribute("stroke-opacity",o["stroke-opacity"]),o.fill&&l.setAttribute("fill",o.fill),o["fill-opacity"]&&l.setAttribute("fill-opacity",o["fill-opacity"]),this.svg.insertBefore(l,this.svg.firstChild)},t.prototype.text=function(o,l,h,g){var p=document.createElementNS(e,"text");p.setAttribute("stroke","none");for(var d in l)l.hasOwnProperty(d)&&p.setAttribute(d,l[d]);for(var f=l["data-name"]=="free-text",c=(""+o).split(`
115
+ `),u=0;u<c.length;u++)if(!(f&&c[u]=="")){var i=document.createElementNS(e,"tspan");if(g)for(var v in g)g.hasOwnProperty(v)&&i.setAttribute(v,g[v]);if(i.setAttribute("x",l.x?l.x:0),u!==0&&i.setAttribute("dy","1.2em"),c[u].indexOf("")!==-1){var b=c[u].split("");if(i.textContent=b[0],b[1]){var m=document.createElementNS(e,"tspan");m.setAttribute("dy","-0.3em"),m.setAttribute("style","font-size:0.7em"),m.textContent=b[1],i.appendChild(m)}if(b[2]){var w=b[1]?"0.4em":"0.1em",_=document.createElementNS(e,"tspan");_.setAttribute("dy",w),_.setAttribute("style","font-size:0.7em"),_.textContent=b[2],i.appendChild(_)}}else f&&c[u].trim()==""?i.innerHTML="&nbsp;":i.textContent=c[u];p.appendChild(i)}return h?h.appendChild(p):this.append(p),p},t.prototype.richTextLine=function(o,l,h,g,p,d){var f=document.createElementNS(e,"text");f.setAttribute("stroke","none"),f.setAttribute("class",g),f.setAttribute("x",l),f.setAttribute("y",h),f.setAttribute("text-anchor",p),f.setAttribute("dominant-baseline","middle");for(var c=0;c<o.length;c++){for(var u=o[c],i=document.createElementNS(e,"tspan"),v=Object.keys(u.attrs),b=0;b<v.length;b++){var m=u.attrs[v[b]];m!==""&&i.setAttribute(v[b],m)}i.textContent=u.content,f.appendChild(i)}return d?d.appendChild(f):this.append(f),f},t.prototype.guessWidth=function(o,l){var h=this.createDummySvg(),g=this.text(o,l,h),p;try{p=g.getBBox(),isNaN(p.height)||!p.height?p={width:l["font-size"]/2,height:l["font-size"]+2}:p={width:p.width,height:p.height}}catch{p={width:l["font-size"]/2,height:l["font-size"]+2}}return h.removeChild(g),p},t.prototype.createDummySvg=function(){if(!this.dummySvg){this.dummySvg=s();var o=["display: block !important;","height: 1px;","width: 1px;","position: absolute;"];this.dummySvg.setAttribute("style",o.join(""));var l=document.querySelector("body");l.appendChild(this.dummySvg)}return this.dummySvg};var r={};t.prototype.getTextSize=function(o,l,h){if(typeof o=="number"&&(o=""+o),!o||o.match(/^\s+$/))return{width:0,height:0};var g;if(o.length<20&&(g=o+JSON.stringify(l),r[g]))return r[g];var p=!h;h||(h=this.text(o,l));var d;try{d=h.getBBox(),isNaN(d.height)||!d.height?d=this.guessWidth(o,l):d={width:d.width,height:d.height}}catch{d=this.guessWidth(o,l)}return p&&(this.currentGroup.length>0?this.currentGroup[0].removeChild(h):this.svg.removeChild(h)),g&&(r[g]=d),d},t.prototype.openGroup=function(o){o=o||{};var l=document.createElementNS(e,"g");return o.klass&&l.setAttribute("class",o.klass),o.fill&&l.setAttribute("fill",o.fill),o.stroke&&l.setAttribute("stroke",o.stroke),o["data-name"]&&l.setAttribute("data-name",o["data-name"]),o.prepend?this.prepend(l):this.append(l),this.currentGroup.unshift(l),l},t.prototype.closeGroup=function(){var o=this.currentGroup.shift();return o&&o.children.length===0?(o.parentElement.removeChild(o),null):o},t.prototype.path=function(o){var l=document.createElementNS(e,"path");for(var h in o)o.hasOwnProperty(h)&&(h==="path"?l.setAttributeNS(null,"d",o.path):h==="klass"?l.setAttributeNS(null,"class",o[h]):o[h]!==void 0&&l.setAttributeNS(null,h,o[h]));return this.append(l),l},t.prototype.pathToBack=function(o){var l=document.createElementNS(e,"path");for(var h in o)o.hasOwnProperty(h)&&(h==="path"?l.setAttributeNS(null,"d",o.path):h==="klass"?l.setAttributeNS(null,"class",o[h]):l.setAttributeNS(null,h,o[h]));return this.prepend(l),l},t.prototype.lineToBack=function(o){for(var l=document.createElementNS(e,"line"),h=Object.keys(o),g=0;g<h.length;g++)l.setAttribute(h[g],o[h[g]]);return this.prepend(l),l},t.prototype.append=function(o){this.currentGroup.length>0?this.currentGroup[0].appendChild(o):this.svg.appendChild(o)},t.prototype.prepend=function(o){this.currentGroup.length>0?this.currentGroup[0].appendChild(o):this.svg.insertBefore(o,this.svg.firstChild)},t.prototype.setAttributeOnElement=function(o,l){for(var h in l)l.hasOwnProperty(h)&&o.setAttributeNS(null,h,l[h])},t.prototype.moveElementToChild=function(o,l){o.appendChild(l)};function s(){var o=document.createElementNS(e,"svg");return o.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),o.setAttribute("role","img"),o.setAttribute("fill","currentColor"),o.setAttribute("stroke","currentColor"),o}return Ln=t,Ln}var On,Vs;function ov(){if(Vs)return On;Vs=1;var e=Xe(),t=sv(),n=function(a){this.paper=new t(a),this.controller=null,this.space=3*e.SPACE,this.padding={},this.reset(),this.firefox112=navigator.userAgent.indexOf("Firefox/112.0")>=0};return n.prototype.reset=function(){this.paper.clear(),this.y=0,this.abctune=null,this.path=null,this.isPrint=!1,this.lineThickness=0,this.initVerticalSpace()},n.prototype.newTune=function(a){this.abctune=a,this.setVerticalSpace(a.formatting),this.isPrint=a.media==="print",this.setPadding(a)},n.prototype.setLineThickness=function(a){this.lineThickness=a},n.prototype.setPaddingOverride=function(a){this.paddingOverride={top:a.paddingtop,bottom:a.paddingbottom,right:a.paddingright,left:a.paddingleft}},n.prototype.setPadding=function(a){function r(s,o,l,h,g){a.formatting[l]!==void 0?s.padding[o]=a.formatting[l]:s.paddingOverride[o]!==void 0?s.padding[o]=s.paddingOverride[o]:s.isPrint?s.padding[o]=h:s.padding[o]=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)},n.prototype.adjustNonScaledItems=function(a){this.padding.top/=a,this.padding.bottom/=a,this.padding.left/=a,this.padding.right/=a,this.abctune.formatting.headerfont.size/=a,this.abctune.formatting.footerfont.size/=a},n.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}},n.prototype.setVerticalSpace=function(a){a.staffsep!==void 0&&(this.spacing.staffSeparation=a.staffsep*4/3),a.composerspace!==void 0&&(this.spacing.composer=a.composerspace*4/3),a.partsspace!==void 0&&(this.spacing.parts=a.partsspace*4/3),a.textspace!==void 0&&(this.spacing.text=a.textspace*4/3),a.musicspace!==void 0&&(this.spacing.music=a.musicspace*4/3),a.titlespace!==void 0&&(this.spacing.title=a.titlespace*4/3),a.sysstaffsep!==void 0&&(this.spacing.systemStaffSeparation=a.sysstaffsep*4/3),a.stafftopmargin!==void 0&&(this.spacing.staffTopMargin=a.stafftopmargin*4/3),a.subtitlespace!==void 0&&(this.spacing.subtitle=a.subtitlespace*4/3),a.topspace!==void 0&&(this.spacing.top=a.topspace*4/3),a.vocalspace!==void 0&&(this.spacing.vocal=a.vocalspace*4/3),a.wordsspace!==void 0&&(this.spacing.words=a.wordsspace*4/3)},n.prototype.calcY=function(a){return this.y-a*e.STEP},n.prototype.yToPitch=function(a){return a/e.STEP},n.prototype.moveY=function(a,r){r===void 0&&(r=1),this.y+=a*r},n.prototype.absolutemoveY=function(a){this.y=a},On=n,On}var Dn,Xs;function cv(){if(Xs)return Dn;Xs=1;function e(t,n,a,r,s,o){var l=t.text;this.rows=[];var h;n&&this.rows.push({move:n});var g=a.calc("textfont","defined-text");if(l==="")this.rows.push({move:g.attr["font-size"]*2});else if(typeof l=="string"){let b=function(m){return m.replace(/^[ \t]*\n/gm,`X
116
+ `)};var v=b;this.rows.push({move:g.attr["font-size"]/2}),this.rows.push({left:r,text:l,font:"textfont",klass:"defined-text",anchor:"start",startChar:t.startChar,endChar:t.endChar,absElemType:"freeText",name:"free-text"});var p=b(l);h=o.calc(p,"textfont","defined-text"),this.rows.push({move:h.height})}else if(l){for(var d=0,f=r,c="textfont",u=0;u<l.length;u++)l[u].font?c=l[u].font:c="textfont",this.rows.push({left:f,text:l[u].text,font:c,klass:"defined-text",anchor:"start",startChar:t.startChar,endChar:t.endChar,absElemType:"freeText",name:"free-text"}),h=o.calc(l[u].text,a.calc(c,"defined-text").font,"defined-text"),f+=h.width+h.height/2,d=Math.max(d,h.height);this.rows.push({move:d})}else if(t.length===1){var i=s/2;this.rows.push({left:i,text:t[0].text,font:"textfont",klass:"defined-text",anchor:"middle",startChar:t.startChar,endChar:t.endChar,absElemType:"freeText",name:"free-text"}),h=o.calc(t[0].text,"textfont","defined-text"),this.rows.push({move:h.height})}}return Dn=e,Dn}var Fn,Ks;function lv(){if(Ks)return Fn;Ks=1;function e(t,n,a){this.rows=[],t&&this.rows.push({move:t}),this.rows.push({separator:n,absElemType:"separator"}),a&&this.rows.push({move:a})}return Fn=e,Fn}var Hn,Js;function uv(){if(Js)return Hn;Js=1;function e(t,n,a,r,s,o){this.rows=[],t&&this.rows.push({move:t});var l=n.titleleft?"start":"middle",h=n.titleleft?s:r;this.rows.push({left:h,text:a.text,font:"subtitlefont",klass:"text subtitle",anchor:l,startChar:a.startChar,endChar:a.endChar,absElemType:"subtitle",name:"subtitle"});var g=o.calc(a.text,"subtitlefont","text subtitle");this.rows.push({move:g.height})}return Hn=e,Hn}var $n,Qs;function ei(){if(Qs)return $n;Qs=1;function e(t,n,a){if(n.text){n.marginLeft||(n.marginLeft=0),n.klass||(n.klass=""),n.anchor||(n.anchor="start"),n.info||(n.info={startChar:-2,endChar:-2}),n.marginTop&&t.push({move:n.marginTop});var r={left:n.marginLeft,text:n.text,font:n.font,anchor:n.anchor,startChar:n.info.startChar,endChar:n.info.endChar,"dominant-baseline":n["dominant-baseline"]};n.absElemType&&(r.absElemType=n.absElemType),!n.inGroup&&n.klass&&(r.klass=n.klass),n.name&&(r.name=n.name),t.push(r);var s=a.calc("A",n.font,n.klass),o=n.text.split(`
117
+ `).length;if(n.text[n.text.length-1]===`
118
+ `&&o--,!n.noMove){var l=s.height*1.1*o;t.push({move:Math.round(l)}),n.marginBottom&&t.push({move:n.marginBottom})}}}return $n=e,$n}var Gn,eo;function Yl(){if(eo)return Gn;eo=1;const e=ei();function t(n,a,r,s,o,l,h,g){var p=g.calc("i",r,s);if(a==="")n.push({move:p.height});else{if(typeof a=="string"){e(n,{marginLeft:l,text:a,font:r,klass:s,marginTop:h.marginTop,anchor:h.anchor,absElemType:h.absElemType,info:h.info,name:o},g);return}h.marginTop&&n.push({move:h.marginTop});var d=0,f={left:l,anchor:h.anchor,phrases:[]};s&&(f.klass=s),n.push(f);for(var c=0;c<a.length;c++){var u=a[c],i=u.font?u.font:g.attr(r,s).font,v={content:u.text};i&&(v.attrs={"font-family":g.getFamily(i.face),"font-size":i.size,"font-weight":i.weight,"font-style":i.style,"font-decoration":i.decoration}),f.phrases.push(v);var b=g.calc(u.text,i,s);d=Math.max(d,b.height),u.text[u.text.length-1]===" "&&p.width}n.push({move:d})}}return Gn=t,Gn}var Zn,to;function hv(){if(to)return Zn;to=1;const e=ei(),t=Yl();function n(a,r,s,o,l,h,g,p,d,f){if(this.rows=[],a.header&&h){var c=f.calc("X","headerfont","abcjs-header abcjs-meta-top").height;e(this.rows,{marginLeft:g,text:a.header.left,font:"headerfont",klass:"header meta-top",marginTop:-c,info:r.header,name:"header"},f),e(this.rows,{marginLeft:g+l/2,text:a.header.center,font:"headerfont",klass:"header meta-top",marginTop:-c,anchor:"middle",info:r.header,name:"header"},f),e(this.rows,{marginLeft:g+l,text:a.header.right,font:"headerfont",klass:"header meta-top",marginTop:-c,anchor:"end",info:r.header,name:"header"},f)}h&&this.rows.push({move:p.top});var u=s.titleleft?"start":"middle",i=s.titleleft?g:g+l/2;if(a.title){var v=d?"abcjs-title":"";t(this.rows,a.title,"titlefont",v,"title",i,{marginTop:p.title,anchor:u,absElemType:"title",info:r.title},f)}if(o.length)for(var b=0;b<o.length&&o[b].subtitle;){var v=d?"abcjs-text abcjs-subtitle":"";t(this.rows,o[b].subtitle.text,"subtitlefont",v,"subtitle",i,{marginTop:p.subtitle,anchor:u,absElemType:"subtitle",info:o[b].subtitle},f),b++}if(a.rhythm||a.origin||a.composer){if(this.rows.push({move:p.composer}),a.rhythm&&a.rhythm.length>0){var m=!!(a.composer||a.origin),v=d?"abcjs-rhythm":"";e(this.rows,{marginLeft:g,text:a.rhythm,font:"infofont",klass:v,absElemType:"rhythm",noMove:m,info:r.rhythm,name:"rhythm"},f)}a.composer&&a.composer,a.origin&&a.origin;var w=a.composer?a.composer:"";if(a.origin&&(typeof w=="string"&&typeof a.origin=="string"?w+=" ("+a.origin+")":typeof w=="string"&&typeof a.origin!="string"?(w=[{text:w}],w.push({text:" ("}),w=w.concat(a.origin),w.push({text:")"})):(w.push({text:" ("}),w=w.concat(a.origin),w.push({text:")"}))),w){var v=d?"abcjs-composer":"";t(this.rows,w,"composerfont",v,"composer",g+l,{anchor:"end",absElemType:"composer",info:r.composer,ingroup:!0},f)}}if(a.author&&a.author.length>0){var v=d?"abcjs-author":"";t(this.rows,a.author,"composerfont",v,"author",g+l,{anchor:"end",absElemType:"author",info:r.author},f)}if(a.partOrder&&a.partOrder.length>0){var v=d?"abcjs-part-order":"";t(this.rows,a.partOrder,"partsfont",v,"part-order",g,{absElemType:"partOrder",info:r.partOrder,anchor:"start"},f)}}return Zn=n,Zn}var jn,ro;function fv(){if(ro)return jn;ro=1;const e=ei(),t=Yl();function n(s,o,l,h,g,p,d){this.rows=[],s.unalignedWords&&s.unalignedWords.length>0&&this.unalignedWords(s.unalignedWords,h,g,p,d),this.extraText(s,h,g,p,d),s.footer&&l&&this.footer(s.footer,o,h,d)}n.prototype.unalignedWords=function(s,o,l,h,g){var p=h?"abcjs-unaligned-words":"",d="wordsfont",f=g.calc("i",d,p);this.rows.push({move:l.words}),r(this.rows,"",s,o,d,"unalignedWords","unalignedWords",p,"unalignedWords",l,h,g),this.rows.push({move:f.height})};function a(s,o,l,h,g,p,d){l&&(o&&(typeof l=="string"?l=o+l:l=[{text:o}].concat(l)),g=p?"abcjs-extra-text "+g:"",t(s,l,"historyfont",g,"description",h,{absElemType:"extraText",anchor:"start"},d))}function r(s,o,l,h,g,p,d,f,c,u,i,v){if(l){f=i?"abcjs-extra-text "+f:"";var b=v.calc("A",g,f);if(typeof l=="string")o&&(l=o+`
119
+ `+l),e(s,{marginLeft:h,text:l,font:g,absElemType:"extraText",name:c,"dominant-baseline":"middle",klass:f},v);else{s.push({startGroup:d,klass:f,name:c}),s.push({move:u.info}),o&&(e(s,{marginLeft:h,text:o,font:g,absElemType:"extraText",name:c,"dominant-baseline":"middle"},v),s.push({move:b.height*3/4}));for(var m=0;m<l.length;m++)t(s,l[m],g,"",c,h,{anchor:"start"},v),m<l.length-1&&typeof l[m]=="string"&&typeof l[m+1]!="string"&&s.push({move:b.height*3/4});s.push({endGroup:d,absElemType:p,startChar:-1,endChar:-1,name:c}),s.push({move:b.height})}}}return n.prototype.extraText=function(s,o,l,h,g){a(this.rows,"Book: ",s.book,o,"abcjs-book",h,g),a(this.rows,"Source: ",s.source,o,"abcjs-source",h,g),a(this.rows,"Discography: ",s.discography,o,"abcjs-discography",h,g),r(this.rows,"Notes:",s.notes,o,"historyfont","extraText","notes","abcjs-notes","description",l,h,g),a(this.rows,"Transcription: ",s.transcription,o,"abcjs-transcription",h,g),r(this.rows,"History:",s.history,o,"historyfont","extraText","history","abcjs-history","description",l,h,g),a(this.rows,"Copyright: ",s["abc-copyright"],o,"abcjs-copyright",h,g),a(this.rows,"Creator: ",s["abc-creator"],o,"abcjs-creator",h,g),a(this.rows,"Edited By: ",s["abc-edited-by"],o,"abcjs-edited-by",h,g)},n.prototype.footer=function(s,o,l,h){var g="header meta-bottom",p="footerfont";this.rows.push({startGroup:"footer",klass:g}),e(this.rows,{marginLeft:l,text:s.left,font:p,klass:g,name:"footer"},h),e(this.rows,{marginLeft:l+o/2,text:s.center,font:p,klass:g,anchor:"middle",name:"footer"},h),e(this.rows,{marginLeft:l+o,text:s.right,font:p,klass:g,anchor:"end",name:"footer"},h)},jn=n,jn}var Un,no;function Wl(){if(no)return Un;no=1;function e(n,a,r,s){if(n.indexOf(a)===0){var o=n.replace(a,""),l=parseInt(o,10);""+l===o&&(r[s]=l)}}function t(n,a){var r=[];if(n.absEl.elemset){for(var s={},o=0;o<n.absEl.elemset.length;o++){var l=n.absEl.elemset[o];if(l)for(var h=l.getAttribute("class").split(" "),g=0;g<h.length;g++)s[h[g]]=!0}for(var p=0;p<Object.keys(s).length;p++)r.push(Object.keys(s)[p])}for(var d={},f=0;f<r.length;f++)e(r[f],"abcjs-v",d,"voice"),e(r[f],"abcjs-l",d,"line"),e(r[f],"abcjs-m",d,"measure");n.staffPos&&(d.staffPos=n.staffPos);for(var c=a.target;c&&c.dataset&&!c.dataset.name&&c.tagName.toLowerCase()!=="svg";)c=c.parentNode;for(var u=a.target;u&&u.dataset&&!u.dataset.index&&u.tagName.toLowerCase()!=="svg";)u=u.parentNode;return u&&u.dataset&&(d.name=u.dataset.name,d.clickedName=c.dataset.name,d.parentClasses=u.classList),c&&c.classList&&(d.clickedClasses=c.classList),d.selectableElement=n.svgEl,{classes:r,analysis:d}}return Un=t,Un}var Yn,ao;function dv(){if(ao)return Yn;ao=1;var e=Xe(),t=Wl();function n(E,P){if(E.rangeHighlight=w,E.dragging)for(var x=0;x<E.selectables.length;x++){var M=E.selectables[x];M.svgEl.getAttribute("selectable")==="true"&&(M.svgEl.setAttribute("tabindex",0),M.svgEl.setAttribute("data-index",x),M.svgEl.addEventListener("keydown",s.bind(E)),M.svgEl.addEventListener("keyup",o.bind(E)),M.svgEl.addEventListener("focus",r.bind(E)))}for(var N=0;N<P.length;N++)P[N].addEventListener("touchstart",c.bind(E),{passive:!0}),P[N].addEventListener("touchmove",u.bind(E),{passive:!0}),P[N].addEventListener("touchend",i.bind(E),{passive:!0}),P[N].addEventListener("mousedown",c.bind(E)),P[N].addEventListener("mousemove",u.bind(E)),P[N].addEventListener("mouseup",i.bind(E))}function a(E){var P=1,x=1,M=E.target.closest("svg"),N=0;M&&M.viewBox&&M.viewBox.baseVal&&(M.viewBox.baseVal.width!==0&&(P=M.viewBox.baseVal.width/M.clientWidth),M.viewBox.baseVal.height!==0&&(x=M.viewBox.baseVal.height/M.clientHeight),N=M.viewBox.baseVal.y);var D=E.target&&E.target.tagName==="svg",k,S;return D?(k=E.offsetX,S=E.offsetY):(k=E.layerX,S=E.layerY),k=k*P,S=S*x,[k,S+N]}function r(E){this.dragMechanism==="keyboard"&&this.dragYStep!==0&&this.dragTarget&&b.bind(this)(this.dragTarget,this.dragYStep,this.selectables.length,this.dragIndex,E),this.dragYStep=0}function s(E){switch(E.keyCode){case 38:case 40:E.preventDefault()}}function o(E){var P=!1,x=E.target.dataset.index;switch(E.keyCode){case 13:case 32:P=!0,this.dragTarget=this.selectables[x],this.dragIndex=x,this.dragMechanism="keyboard",i.bind(this)(E);break;case 38:P=!0,this.dragTarget=this.selectables[x],this.dragIndex=x,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:P=!0,this.dragTarget=this.selectables[x],this.dragIndex=x,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&&i.bind(this)(E);break}P&&E.preventDefault()}function l(E,P){if(!P)return-1;var x=P.dataset;if(!x)return-1;for(var M=x.index,N=0;N<E.length;N++){var D=E[N].svgEl.dataset;if(D&&M===D.index)return N}return-1}function h(E,P,x){for(var M=9999999,N=-1,D=0;D<E.selectables.length&&M>0;D++){var k=E.selectables[D];if(E.getDim(k),k.dim.left<P&&k.dim.right>P&&k.dim.top<x&&k.dim.bottom>x)N=D,M=0;else if(k.dim.top<x&&k.dim.bottom>x){var S=Math.min(Math.abs(k.dim.left-P),Math.abs(k.dim.right-P));S<M&&(M=S,N=D)}else if(k.dim.left<P&&k.dim.right>P){var z=Math.min(Math.abs(k.dim.top-x),Math.abs(k.dim.bottom-x));z<M&&(M=z,N=D)}else{var L=Math.abs(P-k.dim.left)>Math.abs(P-k.dim.right)?Math.abs(P-k.dim.right):Math.abs(P-k.dim.left),R=Math.abs(x-k.dim.top)>Math.abs(x-k.dim.bottom)?Math.abs(x-k.dim.bottom):Math.abs(x-k.dim.top),y=Math.sqrt(L*L+R*R);y<M&&(M=y,N=D)}}return N>=0&&M<=12?N:-1}function g(E,P,x){if(E.x<=P.offsetX&&E.x+E.width>=P.offsetX&&E.y<=P.offsetY&&E.y+E.height>=P.offsetY)return[P.offsetX,P.offsetY];var M=Math.abs(P.layerY/x-P.offsetY);return M<3?[P.offsetX,P.offsetY]:[P.layerX,P.layerY]}function p(E){if(!E)return null;if(E.tagName==="svg")return E;if(!E.getAttribute)return null;for(var P=E.getAttribute("selectable");!P;)E.parentElement?(E=E.parentElement,E.tagName==="svg"?P=!0:P=E.getAttribute("selectable")):P=!0;return E}function d(E,P){var x,M,N,D=l(E.selectables,p(P.target));return D>=0?(N=g(E.selectables[D].svgEl.getBBox(),P,E.scale),x=N[0],M=N[1]):(N=a(P),x=N[0],M=N[1],D=h(E,x,M)),{x,y:M,clickedOn:D}}function f(E){if(!(!E||!E.target||!E.touches||E.touches.length<1)){var P=E.target.getBoundingClientRect(),x=E.touches[0].pageX-P.left,M=E.touches[0].pageY-P.top;E.touches[0].offsetX=x,E.touches[0].offsetY=M,E.touches[0].layerX=E.touches[0].pageX,E.touches[0].layerY=E.touches[0].pageY}}function c(E){var P=E;E.type==="touchstart"&&(f(E),E.touches.length>0&&(P=E.touches[0]));var x=d(this,P);x.clickedOn>=0&&(E.type==="touchstart"||E.button===0)&&this.selectables[x.clickedOn]&&(this.dragTarget=this.selectables[x.clickedOn],this.dragIndex=x.clickedOn,this.dragMechanism="mouse",this.dragMouseStart={x:x.x,y:x.y},this.dragging&&this.dragTarget.isDraggable&&(q(this.renderer.paper,"abcjs-dragging-in-progress"),this.dragTarget.absEl.highlight(void 0,this.dragColor)))}function u(E){var P=E;if(E.type==="touchmove"&&(f(E),E.touches.length>0&&(P=E.touches[0])),this.lastTouchMove=E,!(!this.dragTarget||!this.dragging||!this.dragTarget.isDraggable||this.dragMechanism!=="mouse"||!this.dragMouseStart)){var x=d(this,P),M=Math.round((x.y-this.dragMouseStart.y)/e.STEP);M!==this.dragYStep&&(this.dragYStep=M,this.dragTarget.svgEl.setAttribute("transform","translate(0,"+M*e.STEP+")"))}}function i(E){var P=E;E.type==="touchend"&&this.lastTouchMove&&(f(this.lastTouchMove),this.lastTouchMove&&this.lastTouchMove.touches&&this.lastTouchMove.touches.length>0&&(P=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)),b.bind(this)(this.dragTarget,this.dragYStep,this.selectables.length,this.dragIndex,P),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(E){E>=0&&E<this.selectables.length&&(this.dragTarget=this.selectables[E],this.dragIndex=E,this.dragMechanism="keyboard",i.bind(this)({target:this.dragTarget.svgEl}))}function b(E,P,x,M,N){for(var D=t(E,N),k=D.classes,S=D.analysis,z=0;z<this.listeners.length;z++)this.listeners[z](E.absEl.abcelem,E.absEl.tuneNumber,k.join(" "),S,{step:P,max:x,index:M,setSelection:v.bind(this)},N)}function m(){for(var E=0;E<this.selected.length;E++)this.selected[E].unhighlight(void 0,this.renderer.foregroundColor);this.selected=[]}function w(E,P){m.bind(this)();for(var x=0;x<this.staffgroups.length;x++)for(var M=this.staffgroups[x].voices,N=0;N<M.length;N++)for(var D=M[N].children,k=0;k<D.length;k++){var S=D[k].abcelem.startChar,z=D[k].abcelem.endChar;(P>S&&E<z||P===E&&P===z)&&(this.selected[this.selected.length]=D[k],D[k].highlight(void 0,this.selectionColor))}}function _(E){var P=E.getAttribute("class");P||(P="");for(var x=P.split(" "),M={},N=0;N<x.length;N++)M[x[N]]=!0;return M}function T(E,P){var x=[];for(var M in P)P.hasOwnProperty(M)&&x.push(M);E.setAttribute("class",x.join(" "))}function q(E,P){if(E){var x=_(E.svg);x[P]=!0,T(E.svg,x)}}function I(E,P){if(E){var x=_(E.svg);delete x[P],T(E.svg,x)}}return Yn=n,Yn}var Wn,io;function ti(){if(io)return Wn;io=1;function e(t,n,a,r,s){return n+(r-n)/(a-t)*(s-t)}return Wn=e,Wn}var Vn,so;function pv(){if(so)return Vn;so=1;var e=it(),t=Xe(),n=ti(),a=function(u){if(!(u.elems.length===0||u.allrests)){var i=l(u.stemsUp,u.isgrace),v=u.elems[0],b=u.elems[u.elems.length-1],m=0,w=u.stemsUp?v.abcelem.maxpitch:v.abcelem.minpitch;m=s(v,u.stemsUp,w,m),m=s(b,u.stemsUp,w,m),m=Math.max(u.stemHeight,m+3);var _=g(u.average,u.elems.length,m,u.stemsUp,v.abcelem.averagepitch,b.abcelem.averagepitch,u.isflat,u.min,u.max,u.isgrace),T=h(u.stemsUp,v,b);u.addBeam({startX:T[0],endX:T[1],startY:_[0],endY:_[1],dy:i});for(var q=c(u.elems,u.stemsUp,u.beams[0],u.isgrace,i),I=0;I<q.length;I++)u.addBeam(q[I]);p(u.elems,u.stemsUp,u.beams[0],i,u.mainNote)}},r=function(u){return u===void 0?0:Math.floor(Math.log(u)/Math.log(2))};function s(u,i,v,b){if(!u.children)return b;for(var m=0;m<u.children.length;m++){var w=u.children[m];i&&w.top!==void 0&&w.c==="flags.ugrace"?b=Math.max(b,w.top-v):!i&&w.bottom!==void 0&&w.c==="flags.ugrace"&&(b=Math.max(b,v-w.bottom+7))}return b}function o(u,i,v,b){if(b)return 0;var m=u-i,w=v/2;return m>w&&(m=w),m<-w&&(m=-w),m}function l(u,i){var v=u?t.STEP:-t.STEP;return i&&(v=v*.4),v}function h(u,i,v){var b=i.heads[u?0:i.heads.length-1],m=v.heads[u?0:v.heads.length-1],w=b.x;u&&(w+=b.w-.6);var _=m.x;return _+=u?m.w:.6,[w,_]}function g(u,i,v,b,m,w,_,T,q,I){var E=v-2,P=v-2,x=Math.round(b?Math.max(u+E,q+P):Math.min(u-E,T-P)),M=o(m,w,i,_),N=x+Math.floor(M/2),D=x+Math.floor(-M/2);return I||(b&&x<6||!b&&x>6)&&(N=6,D=6),[N,D]}function p(u,i,v,b,m){for(var w=0;w<u.length;w++){var _=u[w];if(!_.abcelem.rest){var T=!_.addExtra,q=T?m:_,I=_.heads[i?0:_.heads.length-1],E=1/5,P=I.pitch+(i?E:-E),x=i?I.w:0;T||(x+=I.dx);var M=I.x+x,N=n(v.startX,v.startY,v.endX,v.endY,M),D=i?-.6:.6;i||(N-=b/2/t.STEP),T&&(x+=_.heads[0].dx),I.c==="noteheads.slash.quarter"&&(i?P+=1:P-=1);var k=new e(null,x,0,P,{type:"stem",pitch2:N,linewidth:D});k.setX(q.x),q.addRight(k)}}}function d(u,i){for(var v=i+1;v<u.length;v++)if(!u[v].abcelem.rest)return v;return-1}function f(u,i){for(var v=i-1;v>=0;v--)if(!u[v].abcelem.rest)return v;return-1}function c(u,i,v,b,m){for(var w=[],_=[],T=0;T<u.length;T++){var q=u[T];if(!q.abcelem.rest){var I=q.heads[i?0:q.heads.length-1],E=I.x+(i?I.w:0),P=n(v.startX,v.startY,v.endX,v.endY,E),x=i?-1.5:1.5;b&&(x=x*2/3);var M=q.abcelem.duration;M===0&&(M=.25);for(var N=r(M);N<-3;N++){var D=-4-N;if(_[D]?_[D].single=!1:_[D]={x:E+(i?-.6:0),y:P+x*(D+1),durlog:N,single:!0},T>0&&q.abcelem.beambr&&q.abcelem.beambr<=D+1){_[D].split||(_[D].split=[_[D].x]);var k=h(i,u[T-1],q);_[D].split[_[D].split.length-1]>=k[0]&&(k[0]+=q.w),_[D].split.push(k[0]),_[D].split.push(k[1])}}for(var S=_.length-1;S>=0;S--){var z=d(u,T),L=z===-1||z<u.length&&r(u[z].abcelem.duration)>-S-4;if(L){var R=E,y=P+x*(S+1);if(_[S].single){var C=f(u,T),A=C===-1,B=z===-1;if(A)R=E+5;else if(B)R=E-5;else{var O=u[C].abcelem.duration,$=u[z].abcelem.duration;O===$?R=T%2===0?E+5:E-5:R=O<$?E+5:E-5}y=n(v.startX,v.startY,v.endX,v.endY,R)+x*(S+1)}var F={startX:_[S].x,endX:R,startY:_[S].y,endY:y,dy:m};if(_[S].split!==void 0){var W=_[S].split;F.endX<=W[W.length-1]&&(W[W.length-1]-=q.w),W.push(F.endX),F.split=_[S].split}w.push(F),_=_.slice(0,S)}}}}return w}return Vn=a,Vn}var Xn,oo;function gv(){if(oo)return Xn;oo=1;var e=ti();function t(s){if(s.anchor1&&s.anchor2){s.hasBeam=!!s.anchor1.parent.beam&&s.anchor1.parent.beam===s.anchor2.parent.beam;var o=s.anchor1.parent.beam;if(s.hasBeam&&(o.elems[0]!==s.anchor1.parent||o.elems[o.elems.length-1]!==s.anchor2.parent)&&(s.hasBeam=!1),s.hasBeam){var l=n(o)?s.anchor1.x+s.anchor1.w:s.anchor1.x;s.yTextPos=a(l,s.anchor2.x,o),s.yTextPos+=n(o)?3:-2,s.xTextPos=r(l,s.anchor2.x),s.top=s.yTextPos+1,s.bottom=s.yTextPos-2,n(o)&&(s.endingHeightAbove=4)}else{s.startNote=Math.max(s.anchor1.parent.top,9)+4,s.endNote=Math.max(s.anchor2.parent.top,9)+4,s.anchor1.parent.type==="rest"&&s.anchor2.parent.type!=="rest"?s.startNote=s.endNote:s.anchor2.parent.type==="rest"&&s.anchor1.parent.type!=="rest"&&(s.endNote=s.startNote);for(var h=0,g=0;g<s.middleElems.length;g++)h=Math.max(h,s.middleElems[g].top);h+=4,(h>s.startNote||h>s.endNote)&&(s.startNote=h,s.endNote=h),s.flatBeams&&(s.startNote=Math.max(s.startNote,s.endNote),s.endNote=Math.max(s.startNote,s.endNote)),s.yTextPos=s.startNote+(s.endNote-s.startNote)/2,s.xTextPos=s.anchor1.x+(s.anchor2.x+s.anchor2.w-s.anchor1.x)/2,s.top=s.yTextPos+1}}delete s.middleElems,delete s.flatBeams}function n(s){return s.stemsUp}function a(s,o,l){if(l.beams.length===0)return 0;l=l.beams[0];var h=s+(o-s)/2;return e(l.startX,l.startY,l.endX,l.endY,h)}function r(s,o){return s+(o-s)/2}return Xn=t,Xn}var Kn,co;function vv(){if(co)return Kn;co=1;var e=pv(),t=ti(),n=gv(),a=function(p){for(var d=0;d<p.beams.length;d++)if(p.beams[d].type==="BeamElem"){e(p.beams[d]),r(p.beams[d]);for(var f=0;f<p.beams[d].elems.length;f++)p.adjustRange(p.beams[d].elems[f])}for(p.staff.specialY.chordLines=o(p.children),d=0;d<p.otherchildren.length;d++){var c=p.otherchildren[d];c.type==="TripletElem"&&(n(c),p.adjustRange(c))}p.staff.top=Math.max(p.staff.top,p.top),p.staff.bottom=Math.min(p.staff.bottom,p.bottom)};function r(p){for(var d=1.5,f=0;f<p.elems.length;f++){var c=p.elems[f];if(c.top)for(var u=g(c,p),i=0;i<c.children.length;i++){var v=c.children[i];if(v.klass==="ornament"&&v.position!=="below"&&v.bottom-d<u){var b=u-v.bottom+d;v.bottom+=b,v.top+=b,v.pitch+=b,u=c.top=v.top}}}}function s(p,d){var f=d.getChordDim();if(f){for(var c=0;c<p.length;c++){var u=p[c]<f.left;if(u){c>0&&d.putChordInLane(c),p[c]=f.right;return}}p.push(f.right),d.putChordInLane(p.length-1)}}function o(p){var d=[0],f=[0],c,u,i;for(c=0;c<p.length;c++){for(u=0;u<p[c].children.length;u++)i=p[c].children[u],i.chordHeightAbove&&s(d,i);for(u=p[c].children.length-1;u>=0;u--)i=p[c].children[u],i.chordHeightBelow&&s(f,i)}return(d.length>1||f.length>1)&&h(p,d.length,f.length),{above:d.length,below:f.length}}function l(p){for(var d=0,f=0;f<p.children.length;f++){var c=p.children[f];c.chordHeightBelow&&d++}return d}function h(p,d,f){for(var c=0;c<p.length;c++){l(p[c]);for(var u=0;u<p[c].children.length;u++){var i=p[c].children[u];i.chordHeightAbove&&i.invertLane(d)}}}function g(p,d){return d=d.beams[0],t(d.startX,d.startY,d.endX,d.endY,p.x)}return Kn=a,Kn}var Jn,lo;function mv(){if(lo)return Jn;lo=1;var e=Xe(),t=function(d,f){for(var c,u=0;u<f.staffs.length;u++){var i=f.staffs[u],v={tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0};if(d.showDebug&&d.showDebug.indexOf("box")>=0&&(i.originalTop=i.top,i.originalBottom=i.bottom),a(i,v,"lyricHeightAbove"),a(i,v,"chordHeightAbove",i.specialY.chordLines.above),i.specialY.endingHeightAbove&&(i.specialY.chordHeightAbove?i.top+=2:i.top+=i.specialY.endingHeightAbove+n,v.endingHeightAbove=i.top),i.specialY.dynamicHeightAbove&&i.specialY.volumeHeightAbove?(i.top+=Math.max(i.specialY.dynamicHeightAbove,i.specialY.volumeHeightAbove)+n,v.dynamicHeightAbove=i.top,v.volumeHeightAbove=i.top):(a(i,v,"dynamicHeightAbove"),a(i,v,"volumeHeightAbove")),a(i,v,"partHeightAbove"),a(i,v,"tempoHeightAbove"),i.specialY.lyricHeightBelow&&(i.specialY.lyricHeightBelow+=d.spacing.vocal/e.STEP,v.lyricHeightBelow=i.bottom,i.bottom-=i.specialY.lyricHeightBelow+n),i.specialY.chordHeightBelow){v.chordHeightBelow=i.bottom;var b=i.specialY.chordHeightBelow;i.specialY.chordLines.below&&(b*=i.specialY.chordLines.below),i.bottom-=b+n}i.specialY.volumeHeightBelow&&i.specialY.dynamicHeightBelow?(v.volumeHeightBelow=i.bottom,v.dynamicHeightBelow=i.bottom,i.bottom-=Math.max(i.specialY.volumeHeightBelow,i.specialY.dynamicHeightBelow)+n):i.specialY.volumeHeightBelow?(v.volumeHeightBelow=i.bottom,i.bottom-=i.specialY.volumeHeightBelow+n):i.specialY.dynamicHeightBelow&&(v.dynamicHeightBelow=i.bottom,i.bottom-=i.specialY.dynamicHeightBelow+n),d.showDebug&&d.showDebug.indexOf("box")>=0&&(i.positionY=v);for(var m=0;m<i.voices.length;m++){var w=f.voices[i.voices[m]];r(v,w,d.spacing)}if(c!==void 0){var _=i.top-10,T=c+_,q=d.spacing.systemStaffSeparation/e.STEP,I=q-T;I>0&&(i.top+=I)}i.top+=d.spacing.staffTopMargin/e.STEP,c=2-i.bottom}},n=1;function a(d,f,c,u){if(d.specialY[c]){var i=d.specialY[c];u&&(i*=u),d.top+=i+n,f[c]=d.top}}function r(d,f,c){var u,i;for(u=0;u<f.children.length;u++)i=f.children[u],s(d,i,c);for(u=0;u<f.otherchildren.length;u++)switch(i=f.otherchildren[u],i.type){case"CrescendoElem":o(d,i);break;case"DynamicDecoration":l(d,i);break;case"EndingElem":h(d,i);break;case"TieElem":var v=i.getYBounds();f.staff.top=Math.max(f.staff.top,v[0]),f.staff.top=Math.max(f.staff.top,v[1]),f.staff.bottom=Math.min(f.staff.bottom,v[0]),f.staff.bottom=Math.min(f.staff.bottom,v[1]);break}}function s(d,f,c){for(var u=0;u<f.children.length;u++){var i=f.children[u];for(var v in f.specialY)f.specialY.hasOwnProperty(v)&&i[v]&&(i.pitch=d[v],i.top===void 0&&(i.type==="TempoElement"?g(d,i):p(d,i,c),f.pushTop(i.top),f.pushBottom(i.bottom)))}}function o(d,f){f.dynamicHeightAbove?f.pitch=d.dynamicHeightAbove:f.pitch=d.dynamicHeightBelow}function l(d,f){f.volumeHeightAbove?f.pitch=d.volumeHeightAbove:f.pitch=d.volumeHeightBelow}function h(d,f){f.pitch=d.endingHeightAbove-2}function g(d,f){if(f.pitch=d.tempoHeightAbove,f.top=d.tempoHeightAbove,f.bottom=d.tempoHeightAbove,f.note){var c=f.pitch-f.totalHeightInPitches+1;f.note.top=c,f.note.bottom=c;for(var u=0;u<f.note.children.length;u++){var i=f.note.children[u];i.top+=c,i.bottom+=c,i.pitch+=c,i.pitch2!==void 0&&(i.pitch2+=c)}}}function p(d,f,c){switch(f.type){case"part":f.top=d.partHeightAbove+f.height,f.bottom=d.partHeightAbove;break;case"text":case"chord":f.chordHeightAbove?(f.top=d.chordHeightAbove,f.bottom=d.chordHeightAbove):(f.top=d.chordHeightBelow,f.bottom=d.chordHeightBelow);break;case"lyric":f.lyricHeightAbove?(f.top=d.lyricHeightAbove,f.bottom=d.lyricHeightAbove):(f.top=d.lyricHeightBelow+c.vocal/e.STEP,f.bottom=d.lyricHeightBelow+c.vocal/e.STEP,f.pitch-=c.vocal/e.STEP);break;case"debug":f.top=d.chordHeightAbove,f.bottom=d.chordHeightAbove;break}(f.pitch===void 0||f.top===void 0)&&console.error("RelativeElement position not set.",f.type,f.pitch,f.top,d)}return Jn=t,Jn}var Qn,uo;function bv(){if(uo)return Qn;uo=1;var e=function(){};e.beginLayout=function(a,r){r.i=0,r.durationindex=0,r.startx=a,r.minx=a,r.nextx=a,r.spacingduration=0},e.layoutEnded=function(a){return a.i>=a.children.length},e.getNextX=function(a){return Math.max(a.minx,a.nextx)},e.getSpacingUnits=function(a){return Math.sqrt(a.spacingduration*8)},e.layoutOneItem=function(a,r,s,o,l){var h=s.children[s.i];if(!h)return 0;var g=a-s.minx,p=s.durationindex+h.duration>0?o:0;if(h.abcelem.el_type==="note"&&!h.abcelem.rest&&s.voicenumber!==0&&l){var d=l.children[l.i],f=d&&(h.abcelem.maxpitch<=d.abcelem.maxpitch+1&&h.abcelem.maxpitch>=d.abcelem.minpitch-1||h.abcelem.minpitch<=d.abcelem.maxpitch+1&&h.abcelem.minpitch>=d.abcelem.minpitch-1);if(f&&h.abcelem.minpitch===d.abcelem.minpitch&&h.abcelem.maxpitch===d.abcelem.maxpitch&&d.heads&&d.heads.length>0&&h.heads&&h.heads.length>0&&d.heads[0].c===h.heads[0].c&&(f=!1),f){var c=d.heads&&d.heads.length>0?d.heads[0].realWidth:d.fixed.w;h.adjustedWidth||(h.adjustedWidth=c+h.w),h.w=h.adjustedWidth;for(var u=0;u<h.children.length;u++){var i=h.children[u];i.name.indexOf("accidental")<0&&(i.adjustedWidth||(i.adjustedWidth=i.dx+c),i.dx=i.adjustedWidth)}}}var v=t(h,p);return g<v&&(s.i===0||h.type!=="bar"||s.children[s.i-1].type!=="part"&&s.children[s.i-1].type!=="tempo")&&(a+=v-g),h.setX(a),s.spacingduration=h.duration,s.minx=a+n(h),s.i!==s.children.length-1&&(s.minx+=h.minspacing),this.updateNextX(a,r,s),a},e.shiftRight=function(a,r){var s=r.children[r.i];s&&(s.setX(s.x+a),r.minx+=a,r.nextx+=a)},e.updateNextX=function(a,r,s){s.nextx=a+r*this.getSpacingUnits(s)},e.updateIndices=function(a){this.layoutEnded(a)||(a.durationindex+=a.children[a.i].duration,a.children[a.i].type==="bar"&&(a.durationindex=Math.round(a.durationindex*64)/64),a.i++)};function t(a,r){var s=0;return(a.type==="note"||a.type==="bar")&&(s=r),-a.extraw+s}function n(a){return a.w}return Qn=e,Qn}var e0,ho;function yv(){if(ho)return e0;ho=1;var e=bv();function t(o){for(var l=0,h=0;h<o.length;h++){var g=o[h];if(g.children.length>0){var p=g.children.length-1,d=g.children[p];if(d.abcelem.el_type==="bar"){var f=d.children[0].x;f>l?l=f:d.children[0].x=l}}}}var n=function(o,l,h,g,p){var d=1e-7,f=0,c=1e3,u=p;g.startx=u;var i,v=0;for(h&&console.log("init layout",o),i=0;i<g.voices.length;i++)e.beginLayout(u,g.voices[i]);for(var b=0;!a(g.voices);){for(v=null,i=0;i<g.voices.length;i++)!e.layoutEnded(g.voices[i])&&(!v||r(g.voices[i])<v)&&(v=r(g.voices[i]));var m=[],w=[];for(i=0;i<g.voices.length;i++){var _=r(g.voices[i]);_-v>d?w.push(g.voices[i]):m.push(g.voices[i])}b=0;var T=0;for(i=0;i<m.length;i++)e.getNextX(m[i])>u&&(u=e.getNextX(m[i]),b=e.getSpacingUnits(m[i]),T=m[i].spacingduration);f+=b,c=Math.min(c,b),h&&console.log("currentduration: ",v,f,c);var q=void 0;for(i=0;i<m.length;i++){var I=m[i];I.voicenumber===0&&(q=i);var E=q!==void 0&&m[q].voicenumber!==I.voicenumber?m[q]:void 0;s(I,E)||(E=void 0);var P=e.layoutOneItem(u,o,I,l,E),x=P-u;if(x>0){u=P;for(var M=0;M<i;M++)e.shiftRight(x,m[M])}}for(i=0;i<w.length;i++)w[i].spacingduration-=T,e.updateNextX(u,o,w[i]);for(i=0;i<m.length;i++){var N=m[i];e.updateIndices(N)}}for(i=0;i<g.voices.length;i++)e.getNextX(g.voices[i])>u&&(u=e.getNextX(g.voices[i]),b=e.getSpacingUnits(g.voices[i]));return t(g.voices),f+=b,g.setWidth(u),{spacingUnits:f,minSpace:c}};function a(o){for(var l=0;l<o.length;l++)if(!e.layoutEnded(o[l]))return!1;return!0}function r(o){return o.durationindex-(o.children[o.i]&&o.children[o.i].duration>0?0:5e-7)}function s(o,l){return!o||!o.staff||!o.staff.voices||o.staff.voices.length===0||!l||!l.staff||!l.staff.voices||l.staff.voices.length===0?!1:o.staff.voices[0]===l.staff.voices[0]}return e0=n,e0}var t0,fo;function Vl(){if(fo)return t0;fo=1;function e(r,s,o,l,h){var g=r.padding.left,p=0,d,f;for(d=0;d<o.length;d++)o[d].header&&(f=s.calc(o[d].header,"voicefont",""),p=Math.max(p,f.width));if(p=t(p,l,s),p=t(p,h,s),p){var c=s.calc("A","voicefont","");p+=c.width}g+=p;var u=0;return u=n(l,g,u),u=n(h,g,u),g+u}function t(r,s,o){if(s){for(var l=0;l<s.length;l++)if(s[l].header){var h=o.calc(s[l].header,"voicefont","");r=Math.max(r,h.width)}}return r}function n(r,s,o){if(r)for(var l=0;l<r.length;l++)a(s,r[l]),o=Math.max(o,r[l].getWidth());return o}function a(r,s){s.x=r}return t0=e,t0}var r0,po;function wv(){if(po)return r0;po=1;var e=Vl();function t(a,r,s){var o=e(a,r.getTextSize,r.voices,r.brace,r.bracket),l=n(r,s.minPadding),h=l.totalDuration,g=l.minSpacing,p=g*h;s.minWidth&&(p=Math.max(p,s.minWidth));var d=s.minPadding?s.minPadding/2:2;r.startx=o,r.w=p+o;for(var f=0;f<r.voices.length;f++){var c=r.voices[f];c.startx=o,c.w=p+o;for(var u=o,i=!1,v=0,b=0;b<c.children.length;b++){var m=c.children[b];i||(m.duration!==0?(i=!0,v=(p+o-u)/h,r.gridStart=u):(m.x=u,u+=m.w+m.minspacing)),i&&(s.align==="center"?m.x=u+m.duration*v/2-m.w/2:m.duration===0?m.x=u+1-m.w:m.x=u+d-m.extraw,u+=m.duration*v);for(var w=0;w<m.children.length;w++){var _=m.children[w],T=_.dx?_.dx:0;_.x=m.x+T}}r.gridEnd=u}return p}function n(a,r){for(var s=0,o=0,l=0;l<a.voices.length;l++){for(var h=0,g=a.voices[l],p=0;p<g.children.length;p++){var d=g.children[p];if(h+=d.duration,d.duration){var f=(d.w+r)/d.duration;s=Math.max(s,f)}}o=Math.max(o,h)}return{totalDuration:o,minSpacing:s}}return r0=t,r0}var n0,go;function _v(){if(go)return n0;go=1;var e=vv(),t=mv(),n=yv(),a=Vl(),r=wv(),s=function(g,p,d,f,c,u){var i,v,b=d;for(i=0;i<p.lines.length;i++)if(v=p.lines[i],v.staff){var m;u!==void 0?m=r(g,v.staffGroup,u):m=o(g,b,f,v.staffGroup,p.formatting,i===p.lines.length-1,!1),Math.round(m)>Math.round(b)&&(b=m,c&&(i=-1))}for(i=0;i<p.lines.length;i++)if(v=p.lines[i],v.staffGroup&&v.staffGroup.voices){for(var w=0;w<v.staffGroup.voices.length;w++)e(v.staffGroup.voices[w]);t(g,v.staffGroup)}for(i=0;i<p.lines.length;i++)v=p.lines[i],v.staffGroup&&v.staffGroup.setHeight();return b},o=function(g,p,d,f,c,u,i){for(var v=a(g,f.getTextSize,f.voices,f.brace,f.bracket),b=d,m=0;m<8;m++){var w=n(b,g.minPadding,i,f,v);if(b=l(u,c.stretchlast,p+g.padding.left,f.w,b,w.spacingUnits,w.minSpace,g.padding.left+g.padding.right),b===null)break}return h(f.voices),f.w-v};function l(g,p,d,f,c,u,i,v){if(g)if(p===void 0){if(f/d<.66)return null}else{var b=1-(f+v)/d,m=b<p;if(!m)return null}if(Math.abs(d-f)<2)return null;var w=u*c,_=f-w;return u>0?(c=(d-_)/u,c*i>50&&(c=50/i),c):null}function h(g){for(var p=0;p<g.length;p++)for(var d=g[p],f=1;f<d.children.length-1;f++){var c=d.children[f];if(c.abcelem.rest&&(c.abcelem.rest.type==="whole"||c.abcelem.rest.type==="multimeasure")){var u=d.children[f-1],i=d.children[f+1];c.center(u,i)}}}return n0=s,n0}var a0,vo;function kv(){if(vo)return a0;vo=1;var e=function(n){this.shouldAddClasses=n.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,n=0;n<this.lineNumber;n++)t+=this.measureTotalPerLine[n]?this.measureTotalPerLine[n]: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 n=[];if(t&&t.length>0&&n.push(t),t==="abcjs-tab-number")return n.join(" ");if(t==="text instrument-name")return"abcjs-text abcjs-instrument-name";if(this.lineNumber!==null&&n.push("l"+this.lineNumber),this.measureNumber!==null&&n.push("m"+this.measureNumber),this.measureNumber!==null&&n.push("mm"+this.measureTotal()),this.voiceNumber!==null&&n.push("v"+this.voiceNumber),t&&(t.indexOf("note")>=0||t.indexOf("rest")>=0||t.indexOf("lyric")>=0)&&this.noteNumber!==null&&n.push("n"+this.noteNumber),n.length>0){n=n.join(" "),n=n.split(" ");for(var a=0;a<n.length;a++)n[a].indexOf("abcjs-")!==0&&n[a].length>0&&(n[a]="abcjs-"+n[a])}return n.join(" ")},a0=e,a0}var i0,mo;function xv(){if(mo)return i0;mo=1;var e=function(n,a){this.formatting=n,this.classes=a};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,n){var a;typeof t=="string"?(a=this.formatting[t],a?a={face:a.face,size:Math.round(a.size*4/3),decoration:a.decoration,style:a.style,weight:a.weight,box:a.box}:a={face:"Arial",size:Math.round(48/3),decoration:"underline",style:"normal",weight:"normal"}):a={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;a.padding=a.size*r;var s={"font-size":a.size,"font-style":a.style,"font-family":this.getFamily(a.face),"font-weight":a.weight,"text-decoration":a.decoration,class:this.classes.generate(n)};return{font:a,attr:s}},i0=e,i0}var s0,bo;function Cv(){if(bo)return s0;bo=1;var e=function(n,a){this.getFontAndAttr=n,this.svg=a};return e.prototype.updateFonts=function(t){this.getFontAndAttr.updateFonts(t)},e.prototype.attr=function(t,n){return this.getFontAndAttr.calc(t,n)},e.prototype.getFamily=function(t){return t[0]==='"'&&t[t.length-1]==='"'?t.substring(1,t.length-1):t},e.prototype.calc=function(t,n,a,r){var s;typeof n=="string"?s=this.attr(n,a):s={font:{face:n.face,size:n.size,decoration:n.decoration,style:n.style,weight:n.weight},attr:{"font-size":n.size,"font-style":n.style,"font-family":this.getFamily(n.face),"font-weight":n.weight,"text-decoration":n.decoration,class:this.getFontAndAttr.classes.generate(a)}};var o=this.svg.getTextSize(t,s.attr,r);return s.font.box?{height:o.height+s.font.padding*4,width:o.width+s.font.padding*4}:o},e.prototype.baselineToCenter=function(t,n,a,r,s){var o=this.calc(t,n,a).height,l=this.attr(n,a).font.size;return o*.5+(s-r-2)*l},s0=e,s0}var o0,yo;function Ct(){if(yo)return o0;yo=1;var e=function(){for(var t=0,n,a=arguments[t++],r=[],s,o,l,h;a;){if(s=/^[^\x25]+/.exec(a))r.push(s[0]);else if(s=/^\x25{2}/.exec(a))r.push("%");else if(s=/^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(a)){if((n=arguments[s[1]||t++])==null||n==null)throw"Too few arguments.";if(/[^s]/.test(s[7])&&typeof n!="number")throw"Expecting number but found "+typeof n;switch(s[7]){case"b":n=n.toString(2);break;case"c":n=String.fromCharCode(n);break;case"d":n=parseInt(n);break;case"e":n=s[6]?n.toExponential(s[6]):n.toExponential();break;case"f":n=s[6]?parseFloat(n).toFixed(s[6]):parseFloat(n);break;case"o":n=n.toString(8);break;case"s":n=(n=String(n))&&s[6]?n.substring(0,s[6]):n;break;case"u":n=Math.abs(n);break;case"x":n=n.toString(16);break;case"X":n=n.toString(16).toUpperCase();break}n=/[def]/.test(s[7])&&s[2]&&n>0?"+"+n:n,l=s[3]?s[3]=="0"?"0":s[3][1]:" ",h=s[5]-String(n).length,o=s[5]?str_repeat(l,h):"",r.push(s[4]?n+o:o+n)}else throw"Huh ?!";a=a.substring(s[0].length)}return r.join("")};return o0=e,o0}var c0,wo;function st(){if(wo)return c0;wo=1;function e(t){return parseFloat(t.toFixed(2))}return c0=e,c0}var l0,_o;function mt(){if(_o)return l0;_o=1;var e=st();function t(n,a,r){var s=a.y;if(a.phrases){var g=n.paper.richTextLine(a.phrases,a.x,a.y,a.klass,a.anchor);return g}if(a.lane){var o=a.dim.font.size*.25;s+=(a.dim.font.size+o)*a.lane}var l;a.dim?(l=a.dim,l.attr.class=a.klass):l=n.controller.getFontAndAttr.calc(a.type,a.klass),a.anchor&&(l.attr["text-anchor"]=a.anchor),a["dominant-baseline"]&&(l.attr["dominant-baseline"]=a["dominant-baseline"]),l.attr.x=a.x,l.attr.y=s,a.centerVertically||(l.attr.y+=l.font.size),a.type==="debugfont"&&(console.log("Debug msg: "+a.text),l.attr.stroke="#ff0000"),a.cursor&&(l.attr.cursor=a.cursor);var h;a.name==="free-text"?h=a.text.replace(/^[ \t]*\n/gm,`
120
+ `):h=a.text.replace(/\n\n/g,`
121
+
122
+ `),h=h.replace(/^\n/,` 
123
+ `),l.font.box&&(r||n.paper.openGroup({klass:l.attr.class,fill:n.foregroundColor,"data-name":a.name}),l.attr["text-anchor"]==="end"?l.attr.x-=l.font.padding:l.attr["text-anchor"]==="start"&&(l.attr.x+=l.font.padding),l.attr.y+=l.font.padding,delete l.attr.class),a.noClass&&delete l.attr.class,l.attr.x=e(l.attr.x),l.attr.y=e(l.attr.y),a.name&&(l.attr["data-name"]=a.name);var g=n.paper.text(h,l.attr);if(l.font.box){var p=g.getBBox(),d=0;l.attr["text-anchor"]==="middle"?d=p.width/2+l.font.padding:l.attr["text-anchor"]==="end"&&(d=p.width+l.font.padding*2);var f=0;a.centerVertically&&(f=p.height-l.font.padding),n.paper.rect({"data-name":"box",x:Math.round(a.x-d),y:Math.round(s-f),width:Math.round(p.width+l.font.padding*2),height:Math.round(p.height+l.font.padding*2)}),r||(g=n.paper.closeGroup())}return g}return l0=t,l0}var u0,ko;function Sv(){if(ko)return u0;ko=1;var e=Ct(),t=Xe(),n=mt();function a(h,g,p){var d=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,l(h,g.x,d,g.endY,g.type,g.header,p)}function r(h,g,p,d,f){g+=t.STEP;var c=t.STEP*.75,u=t.STEP*.75,i=d-p,v=e("M %f %f l %f %f l %f %f l %f %f z",g,p-u,0,i+u*2,c,0,0,-(i+u*2)),b=t.STEP*2,m=t.STEP;return v+=e("M %f %f q %f %f %f %f q %f %f %f %f z",g+c,p-u,b*.6,m*.2,b,-m,-b*.1,m*.3,-b,m+t.STEP),v+=e("M %f %f q %f %f %f %f q %f %f %f %f z",g+c,p+u+i,b*.6,-m*.2,b,m,-b*.1,-m*.3,-b,-m-t.STEP),h.paper.path({path:v,stroke:h.foregroundColor,fill:h.foregroundColor,class:h.controller.classes.generate(f),"data-name":f})}function s(h,g,p,d,f){var c=d-p,u=o(g,p,[7.5,-8,21,0,18.5,-10.5,7.5],[0,c/5.5,c/3.14,c/2,c/2.93,c/4.88,0]);return u+=o(g,p,[0,17.5,-7.5,6.6,-5,20,0],[c/2,c/1.46,c/1.22,c,c/1.19,c/1.42,c/2]),h.paper.path({path:u,stroke:h.foregroundColor,fill:h.foregroundColor,class:h.controller.classes.generate(f),"data-name":f})}function o(h,g,p,d){return e("M %f %f C %f %f %f %f %f %f C %f %f %f %f %f %f z",h+p[0],g+d[0],h+p[1],g+d[1],h+p[2],g+d[2],h+p[3],g+d[3],h+p[4],g+d[4],h+p[5],g+d[5],h+p[6],g+d[6])}var l=function(h,g,p,d,f,c,u){var i;if(c){h.paper.openGroup({klass:h.controller.classes.generate("staff-extra voice-name"),"data-name":f});var v=p+(d-p)/2;v=v-h.controller.getTextSize.baselineToCenter(c,"voicefont","staff-extra voice-name",0,1),n(h,{x:h.padding.left,y:v,text:c,type:"voicefont",klass:"staff-extra voice-name",anchor:"start",centerVertically:!0})}return f==="brace"?i=s(h,g,p,d,f):f==="bracket"&&(i=r(h,g,p,d,f)),c&&(i=h.paper.closeGroup()),u.wrapSvgEl({el_type:f,startChar:-1,endChar:-1},i),i};return u0=a,u0}var h0,xo;function Kt(){if(xo)return h0;xo=1;function e(t,n,a){var r=t.paper.path(n);return r}return h0=e,h0}var f0,Co;function Tv(){if(Co)return f0;Co=1;var e=Ct(),t=Kt(),n=st();function a(i,v,b){(!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,w=i.calcY(v.anchor1.heads[0].pitch),_=i.calcY(v.anchor2.heads[0].pitch),T=v.anchor1.x+v.anchor1.w/2,q=v.anchor2.x+v.anchor2.w/2,I=r(T,w,q,_),E=v.anchor1.w/2+m,P=v.anchor2.w/2+m,x=s(T,w,q,_),M=o(w,x,E);o(_,x,-P);var N=l(I-E-P),D=u(i,T+E,M,N,x);return b.wrapSvgEl({el_type:"glissando",startChar:-1,endChar:-1},D),[D]}function r(i,v,b,m){var w=b-i,_=m-v;return Math.sqrt(w*w+_*_)}function s(i,v,b,m){return(m-v)/(b-i)}function o(i,v,b){return n(i+b*v)}function l(i){var v=5;return Math.max(2,Math.floor((i-v*2)/6))}var h=[[3.5,-4.8]],g=[[1.5,-1],[.3,-.3],[-3.5,3.8]],p=[[-1.5,2]],d=[[3,4],[3,-4]],f=[[-3,4],[-3,-4]];function c(i,v){for(var b="",m=0;m<i.length;m++)b+="l"+i[m][0]+" "+o(i[m][1],v,i[m][0]);return b}var u=function(i,v,b,m,w){var _=e("M %f %f",v,b);_+=c(h,w);var T;for(T=0;T<m;T++)_+=c(d,w);for(_+=c(g,w),T=0;T<m;T++)_+=c(f,w);return _+=c(p,w)+"z",t(i,{path:_,highlight:"stroke",stroke:i.foregroundColor,class:i.controller.classes.generate("decoration"),"data-name":"glissando"})};return f0=a,f0}var d0,So;function Ev(){if(So)return d0;So=1;var e=Ct(),t=Kt(),n=st();function a(s,o,l){o.pitch===void 0&&window.console.error("Crescendo Element y-coordinate not set.");var h=s.calcY(o.pitch)+4,g=8,p=o.anchor1?o.anchor1.x:0,d=o.anchor2?o.anchor2.x:800,f;return o.dir==="<"?f=r(s,h+g/2,h,h+g/2,h+g,p,d):f=r(s,h,h+g/2,h+g,h+g/2,p,d),l.wrapSvgEl({el_type:"dynamicDecoration",startChar:-1,endChar:-1},f),[f]}var r=function(s,o,l,h,g,p,d){o=n(o),l=n(l),h=n(h),g=n(g),p=n(p),d=n(d);var f=e("M %f %f L %f %f M %f %f L %f %f",p,o,d,l,p,h,d,g);return t(s,{path:f,highlight:"stroke",stroke:s.foregroundColor,class:s.controller.classes.generate("dynamics decoration"),"data-name":"dynamics"})};return d0=a,d0}var p0,To;function ri(){if(To)return p0;To=1;var e=st();function t(){this.ingroup=!1}t.prototype.beginGroup=function(a,r){this.paper=a,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(a){if(a=a||[],a.length!==0){a[0][0]="m",a[0][1]=e(a[0][1]-this.lastM[0]),a[0][2]=e(a[0][2]-this.lastM[1]),this.lastM[0]+=a[0][1],this.lastM[1]+=a[0][2],this.path.push(a[0]);for(var r=1,s=a.length;r<s;r++)a[r][0]==="m"&&(this.lastM[0]+=a[r][1],this.lastM[1]+=a[r][2]),this.path.push(a[r])}},t.prototype.endGroup=function(a,r){this.ingroup=!1;for(var s="",o=0;o<this.path.length;o++)s+=this.path[o].join(" ");this.path=[];var l=this.paper.closeGroup();return l&&(l.setAttribute("class",this.controller.classes.generate(a)),l.setAttribute("fill",this.controller.renderer.foregroundColor),l.setAttribute("stroke","none"),l.setAttribute("data-name",r)),l};var n=new t;return p0=n,p0}var g0,Eo;function ni(){if(Eo)return g0;Eo=1;var e=mt(),t=vt(),n=ri();function a(s,o,l,h,g){var p,d;if(!h)return null;if(h.length>1&&h.indexOf(".")<0){var f=n.isInGroup()?"":g.klass;s.paper.openGroup({"data-name":g.name,klass:f});for(var c=0,u=0;u<h.length;u++){var i=h[u];d=t.getYCorr(i),p=t.printSymbol(o+c,s.calcY(l+d),i,s.paper,{stroke:g.stroke,fill:g.fill}),p?u<h.length-1&&(c+=r(i,h[u+1],t.getSymbolWidth(i))):e(s,{x:o,y:s.y,text:"no symbol:"+h,type:"debugfont",klass:"debug-msg",anchor:"start"},!1)}var v=s.paper.closeGroup();return v}else return d=t.getYCorr(h),n.isInGroup()?p=t.printSymbol(o,s.calcY(l+d),h,s.paper,{"data-name":g.name}):p=t.printSymbol(o,s.calcY(l+d),h,s.paper,{klass:g.klass,stroke:g.stroke,fill:g.fill,"data-name":g.name}),p||(e(s,{x:o,y:s.y,text:"no symbol:"+h,type:"debugfont",klass:"debug-msg",anchor:"start"},!1),null)}function r(s,o,l){var h=l;return s==="f"&&o==="f"&&(h=h*2/3),s==="p"&&o==="p"&&(h=h*5/6),s==="f"&&o==="z"&&(h=h*5/8),h}return g0=a,g0}var v0,Ao;function Av(){if(Ao)return v0;Ao=1;var e=ni();function t(n,a,r){a.pitch===void 0&&window.console.error("Dynamic Element y-coordinate not set.");var s=1,o=1,l=e(n,a.anchor.x,a.pitch,a.dec,{scalex:s,scaley:o,klass:n.controller.classes.generate("decoration dynamics"),fill:n.foregroundColor,stroke:"none",name:"dynamics"});return r.wrapSvgEl({el_type:"dynamicDecoration",startChar:-1,endChar:-1,decoration:a.dec},l),[l]}return v0=t,v0}var m0,Mo;function Mv(){if(Mo)return m0;Mo=1;var e=Ct(),t=mt(),n=Kt(),a=st();function r(l,h,g){l.paper.openGroup({klass:l.controller.classes.generate("triplet "+h.durationClass),"data-name":"triplet"}),h.hasBeam||o(l,h.anchor1.x,h.startNote,h.anchor2.x+h.anchor2.w,h.endNote),t(l,{x:h.xTextPos,y:l.calcY(h.yTextPos-1),text:""+h.number,type:"tripletfont",anchor:"middle",centerVertically:!0,noClass:!0,name:""+h.number},!0);var p=l.paper.closeGroup();return g.wrapSvgEl({el_type:"triplet",startChar:-1,endChar:-1},p),p}function s(l,h,g,p){return e("M %f %f L %f %f",a(l),a(h),a(g),a(p))}function o(l,h,g,p,d){g=l.calcY(g),d=l.calcY(d);var f=5,c="";c+=s(h,g,h,g+f),c+=s(p,d,p,d+f);var u=h+(p-h)/2,i=8,v=(d-g)/(p-h),b=u-i,m=g+(b-h)*v;c+=s(h,g,b,m);var w=u+i,_=g+(w-h)*v;c+=s(w,_,p,d),n(l,{path:c,stroke:l.foregroundColor,"data-name":"triplet-bracket"})}return m0=r,m0}var b0,Io;function Iv(){if(Io)return b0;Io=1;var e=Ct(),t=mt(),n=Kt(),a=st();function r(s,o,l,h,g){o.pitch===void 0&&window.console.error("Ending Element y-coordinate not set.");var p=a(s.calcY(o.pitch)),d=20,f="";o.anchor1&&(l=a(o.anchor1.x+o.anchor1.w),f+=e("M %f %f L %f %f ",l,p,l,a(p+d))),o.anchor2&&(h=a(o.anchor2.x),f+=e("M %f %f L %f %f ",h,p,h,a(p+d))),f+=e("M %f %f L %f %f ",l,p,h,p),s.paper.openGroup({klass:s.controller.classes.generate("ending"),fill:s.foregroundColor,"data-name":"ending"}),n(s,{path:f,stroke:s.foregroundColor,fill:s.foregroundColor,"data-name":"line"}),o.anchor1&&t(s,{x:a(l+5),y:a(s.calcY(o.pitch-.5)),text:o.text,type:"repeatfont",klass:"ending",anchor:"start",noClass:!0,name:o.text});var c=s.paper.closeGroup();return g.wrapSvgEl({el_type:"ending",startChar:-1,endChar:-1},c),[c]}return b0=r,b0}var y0,No;function Nv(){if(No)return y0;No=1;var e=Ct(),t=st();function n(s,o,l,h,g){a(o,l,h);var p="";o.anchor1?p+="abcjs-start-m"+o.anchor1.parent.counters.measure+"-n"+o.anchor1.parent.counters.note:p+="abcjs-start-edge",o.anchor2?p+=" abcjs-end-m"+o.anchor2.parent.counters.measure+"-n"+o.anchor2.parent.counters.note:p+=" abcjs-end-edge",o.hint&&(p="abcjs-hint");var d=o.fixedY?1.5:0,f=r(s,o.startX,o.endX,o.startY+d,o.endY+d,o.above,p,o.isTie,o.dotted),c=-1;o.anchor1&&!o.isTie&&(c=o.anchor1.parent.abcelem.startChar-1);var u=-1;return o.anchor2&&!o.isTie&&(u=o.anchor2.parent.abcelem.endChar+1),g.wrapSvgEl({el_type:"slur",startChar:c,endChar:u},f),[f]}var a=function(s,o,l){!s.anchor1||!s.anchor2||s.anchor1.pitch===s.anchor2.pitch&&s.internalNotes.length===0?s.isTie=!0:s.isTie=!1,s.isTie?(s.calcTieDirection(),s.calcX(o,l),s.calcTieY()):(s.calcSlurDirection(),s.calcX(o,l),s.calcSlurY()),s.avoidCollisionAbove()},r=function(s,o,l,h,g,p,d,f,c){var u=f?1.2:1.5;o=t(o+6),l=t(l+4),h=h+(p?u:-u),g=g+(p?u:-u);var i=t(s.calcY(h)),v=t(s.calcY(g)),b=l-o,m=v-i,w=Math.sqrt(b*b+m*m),_=b/w,T=m/w,q=w/3.5,I=f?10:25,E=(p?-1:1)*Math.min(I,Math.max(4,q)),P=t(o+q*_-E*T),x=t(i+q*T+E*_),M=t(l-q*_-E*T),N=t(v-q*T+E*_),D=2;d?d+=" slur":d="slur",d+=f?" tie":" legato";var k;if(c){d+=" dotted";var S=e("M %f %f C %f %f %f %f %f %f",o,i,P,x,M,N,l,v);k=s.paper.path({path:S,stroke:s.foregroundColor,fill:"none","stroke-dasharray":"5 5",class:s.controller.classes.generate(d),"data-name":f?"tie":"slur"})}else{var z=e("M %f %f C %f %f %f %f %f %f C %f %f %f %f %f %f z",o,i,P,x,M,N,l,v,t(M-D*T),t(N+D*_),t(P-D*T),t(x+D*_),o,i);k=s.paper.path({path:z,stroke:"none",fill:s.foregroundColor,class:s.controller.classes.generate(d),"data-name":f?"tie":"slur"})}return k};return y0=n,y0}var w0,Po;function Pv(){if(Po)return w0;Po=1;var e=Kt(),t=st();function n(o,l){if(l.beams.length!==0){for(var h="",g=0;g<l.beams.length;g++){var p=l.beams[g];if(p.split){for(var d=r(o,p.startX,p.startY,p.endX,p.endY),f=[],c=0;c<p.split.length;c+=2)f.push([p.split[c],p.split[c+1]]);for(c=0;c<f.length;c++){var u=s(p.startX,p.startY,d,f[c][0]),i=s(p.startX,p.startY,d,f[c][1]);h+=a(o,f[c][0],u,f[c][1],i,p.dy)}}else h+=a(o,p.startX,p.startY,p.endX,p.endY,p.dy)}var v=("abcjs-d"+l.duration).replace(/\./g,"-"),b=o.controller.classes.generate("beam-elem "+v),m=e(o,{path:h,stroke:"none",fill:o.foregroundColor,class:b});return[m]}}function a(o,l,h,g,p,d){h=t(o.calcY(h)),p=t(o.calcY(p)),l=t(l),g=t(g);var f=t(h+d),c=t(p+d);return"M"+l+" "+h+" L"+g+" "+p+"L"+g+" "+c+" L"+l+" "+f+"z"}function r(o,l,h,g,p){return(p-h)/(g-l)}function s(o,l,h,g){var p=g-o;return l+p*h}return w0=n,w0}var _0,zo;function ai(){if(zo)return _0;zo=1;var e=ri(),t=st();function n(a,r,s,o,l,h,g){if(s<0||o<l){var p=t(l);l=t(o),o=p}else o=t(o),l=t(l);r=t(r);var d=t(r+s);if(a.firefox112){r+=s/2;var c={x1:r,x2:r,y1:o,y2:l,stroke:a.foregroundColor,"stroke-width":Math.abs(s)};return h&&(c.class=h),g&&(c["data-name"]=g),a.paper.lineToBack(c)}for(var f=[["M",r,o],["L",r,l],["L",d,l],["L",d,o],["z"]],c={path:""},u=0;u<f.length;u++)c.path+=f[u].join(" ");return h&&(c.class=h),g&&(c["data-name"]=g),e.isInGroup()||(c.stroke="none",c.fill=a.foregroundColor),a.paper.pathToBack(c)}return _0=n,_0}var k0,Ro;function zv(){if(Ro)return k0;Ro=1;var e=Ct(),t=st();function n(a,r,s,o,l,h,g){var p=a.foregroundColor;r=t(r),s=t(s);var d=t(o-g),f=t(o+g);if(a.firefox112){o+=g/2;var c={x1:r,x2:s,y1:o,y2:o,stroke:a.foregroundColor,"stroke-width":Math.abs(g*2)};return l&&(c.class=l),h&&(c["data-name"]=h),a.paper.lineToBack(c)}var u=e("M %f %f L %f %f L %f %f L %f %f z",r,d,s,d,s,f,r,f),i={path:u,stroke:"none",fill:p};h&&(i["data-name"]=h),l&&(i.class=l);var v=a.paper.pathToBack(i);return v}return k0=n,k0}var x0,qo;function Xl(){if(qo)return x0;qo=1;var e=zv();function t(n,a,r,s,o,l,h){var g=n.calcY(s);return e(n,a,r,g,o,l,h)}return x0=t,x0}var C0,Bo;function Kl(){if(Bo)return C0;Bo=1;var e=mt(),t=ai(),n=Xl(),a=ni();function r(o,l,h){l.pitch===void 0&&window.console.error(l.type+" Relative Element y-coordinate not set.");var g=o.calcY(l.pitch);switch(l.type){case"symbol":if(l.c===null)return null;var p="symbol";l.klass&&(p+=" "+l.klass),l.graphelem=a(o,l.x,l.pitch,l.c,{scalex:l.scalex,scaley:l.scaley,klass:o.controller.classes.generate(p),name:l.name});break;case"debug":l.graphelem=e(o,{x:l.x,y:o.calcY(15),text:""+l.c,type:"debugfont",klass:o.controller.classes.generate("debug-msg"),anchor:"start",centerVertically:!1,dim:l.dim},!1);break;case"tabNumber":var d="middle",f="tabnumberfont",c="abcjs-tab-number";l.isGrace&&(f="tabgracefont",g+=2.5,c="tab-grace"),l.graphelem=e(o,{x:l.x,y:g,text:""+l.c,type:f,klass:o.controller.classes.generate(c),anchor:d,centerVertically:!1,dim:l.dim,cursor:"default"},!1);break;case"barNumber":l.graphelem=e(o,{x:l.x,y:g,text:""+l.c,type:"measurefont",klass:o.controller.classes.generate("bar-number"),anchor:"middle",dim:l.dim,name:"bar-number"},!0);break;case"lyric":l.graphelem=e(o,{x:l.x,y:g,text:l.c,type:"vocalfont",klass:o.controller.classes.generate("lyric"),anchor:"middle",dim:l.dim,name:"lyric"},!1);break;case"chord":l.graphelem=e(o,{x:l.x,y:g,text:l.c,type:"gchordfont",klass:o.controller.classes.generate("chord"),anchor:"middle",dim:l.dim,lane:l.getLane(),name:"chord"},!1);break;case"decoration":l.graphelem=e(o,{x:l.x,y:g+6,text:l.c,type:"annotationfont",klass:o.controller.classes.generate("annotation"),anchor:l.anchor,centerVertically:!0,dim:l.dim},!1);break;case"text":l.graphelem=e(o,{x:l.x,y:g,text:l.c,type:"annotationfont",klass:o.controller.classes.generate("annotation"),anchor:"start",centerVertically:l.centerVertically,dim:l.dim,lane:l.getLane(),name:"annotation"},!1);break;case"multimeasure-text":l.graphelem=e(o,{x:l.x+l.w/2,y:g,text:l.c,type:"tempofont",klass:o.controller.classes.generate("rest"),anchor:"middle",centerVertically:!1,dim:l.dim},!1);break;case"part":l.graphelem=e(o,{x:l.x,y:g,text:l.c,type:"partsfont",klass:o.controller.classes.generate("part"),anchor:"start",dim:l.dim,name:l.c},!0);break;case"bar":l.graphelem=t(o,l.x,l.linewidth+o.lineThickness,g,h||o.calcY(l.pitch2),null,"bar");break;case"stem":var u=l.linewidth>0?l.linewidth+o.lineThickness:l.linewidth-o.lineThickness;l.graphelem=t(o,l.x,u,g,o.calcY(l.pitch2),"abcjs-stem","stem");break;case"ledger":l.graphelem=n(o,l.x,l.x+l.w,l.pitch,"abcjs-ledger","ledger",.35+o.lineThickness);break}return l.scalex!==1&&l.graphelem&&s(o.paper,l.graphelem,l.scalex,l.scaley,l.x,g),l.graphelem}function s(o,l,h,g,p,d){o.setAttributeOnElement(l,{style:"transform:scale("+h+","+g+");transform-origin:"+p+"px "+d+"px;"})}return C0=r,C0}var S0,Lo;function Rv(){if(Lo)return S0;Lo=1;var e=Kl(),t=mt();function n(a,r){var s=r.x;r.pitch===void 0&&window.console.error("Tempo Element y-coordinate not set."),r.tempo.el_type="tempo";var o=a.calcY(r.pitch)+2,l,h;if(r.tempo.preString){l=t(a,{x:s,y:o,text:r.tempo.preString,type:"tempofont",klass:"abcjs-tempo",anchor:"start",noClass:!0,name:"pre"},!0),h=a.controller.getTextSize.calc(r.tempo.preString,"tempofont","tempo",l);var g=h.width,p=g/r.tempo.preString.length;s+=g+p}if(r.note){r.note.setX(s);for(var d=0;d<r.note.children.length;d++)e(a,r.note.children[d],s);s+=r.note.w+5;var f="= "+r.tempo.bpm;l=t(a,{x:s,y:o,text:f,type:"tempofont",klass:"abcjs-tempo",anchor:"start",noClass:!0,name:"beats"}),h=a.controller.getTextSize.calc(f,"tempofont","tempo",l);var c=h.width,u=c/f.length;s+=c+u}r.tempo.postString&&t(a,{x:s,y:o,text:r.tempo.postString,type:"tempofont",klass:"abcjs-tempo",anchor:"start",noClass:!0,name:"post"},!0)}return S0=n,S0}var T0,Oo;function qv(){if(Oo)return T0;Oo=1;var e=Rv(),t=Kl(),n=Xe(),a=Qa(),r=ri();function s(o,l,h,g,p){if(!l.invisible){var d=l.children.length>0&&l.children[0].type==="TempoElement";l.elemset=[],r.beginGroup(o.paper,o.controller);for(var f=0;f<l.children.length;f++){var c=l.children[f];switch(c.type){case"TempoElement":e(o,c);break;default:var u=t(o,c,h);c.type==="symbol"&&c.c&&c.c.indexOf("notehead")>=0&&u.setAttribute("class","abcjs-notehead")}}var i=l.type;if((l.type==="note"||l.type==="rest")&&(l.counters=o.controller.classes.getCurrent(),i+=" d"+Math.round(l.durationClass*1e3)/1e3,i=i.replace(/\./g,"-"),l.abcelem.pitches))for(var v=0;v<l.abcelem.pitches.length;v++)i+=" p"+l.abcelem.pitches[v].pitch;var b=r.endGroup(i,l.type);if(b){if(l.cloned&&(l.cloned.overrideClasses=b.className.baseVal),l.overrideClasses){var m=b.classList&&b.classList.length>0?b.classList[0]+" ":"";b.setAttribute("class",m+l.overrideClasses)}if(d)l.startChar=l.abcelem.startChar,l.endChar=l.abcelem.endChar,g.add(l,b,!1,p);else{l.elemset.push(b);var w=!1;(l.type==="note"||l.type==="tabNumber")&&(w=!0),g.add(l,b,w,p)}}else l.elemset.length>0&&g.add(l,l.elemset[0],l.type==="note",p);if(l.klass&&a(l.elemset,"mark","","#00ff00"),l.hint&&a(l.elemset,"abcjs-hint","",null),l.abcelem.abselem=l,l.heads&&l.heads.length>0){l.notePositions=[];for(var _=0;_<l.heads.length;_++)l.notePositions.push({x:l.heads[_].x+l.heads[_].w/2,y:p.zero-l.heads[_].pitch*n.STEP})}}}return T0=s,T0}var E0,Do;function Bv(){if(Do)return E0;Do=1;var e=Tv(),t=Ev(),n=Av(),a=Mv(),r=Iv(),s=Nv(),o=Pv(),l=mt(),h=qv();function g(d,f,c,u,i){var v=f.w-1;d.staffbottom=f.staff.bottom;var b=d.foregroundColor;if(f.color&&(d.foregroundColor=f.color),f.header){var m=l(d,{x:d.padding.left,y:d.calcY(f.headerPosition),text:f.header,type:"voicefont",klass:"staff-extra voice-name",anchor:"start",centerVertically:!0,name:"voice-name"},!0);u.wrapSvgEl({el_type:"voiceName",startChar:-1,endChar:-1,text:f.header},m)}var w,_,T=!1;for(w=0;w<f.children.length;w++){_=f.children[w],(_.type==="note"||_.type==="rest")&&(T=!0);var q=!1;_.type!=="staff-extra"&&!d.controller.classes.isInMeasure()&&(d.controller.classes.startMeasure(),q=!0),f.staff.isTabStaff&&(_.invisible=!1,_.type=="bar"&&_.abcelem.lastBar&&(c=f.topLine)),h(d,_,f.barto||w===f.children.length-1?c:0,u,i),(_.type==="note"||p(_))&&d.controller.classes.incrNote(),_.type==="bar"&&!q&&T&&d.controller.classes.incrMeasure()}for(d.controller.classes.startMeasure(),w=0;w<f.beams.length;w++){var I=f.beams[w];I==="bar"?d.controller.classes.incrMeasure():o(d,I,u)}for(d.controller.classes.startMeasure(),w=0;w<f.otherchildren.length;w++)if(_=f.otherchildren[w],_==="bar")d.controller.classes.incrMeasure();else switch(_.type){case"GlissandoElem":_.elemset=e(d,_,u);break;case"CrescendoElem":_.elemset=t(d,_,u);break;case"DynamicDecoration":_.elemset=n(d,_,u);break;case"TripletElem":a(d,_,u);break;case"EndingElem":_.elemset=r(d,_,f.startx+10,v,u);break;case"TieElem":_.elemset=s(d,_,f.startx+10,v,u);break;default:console.log(_),h(d,_,f.startx+10,v,u,i)}d.foregroundColor=b}function p(d){return d.type!=="rest"?!1:!!(d.abcelem&&d.abcelem.rest&&d.abcelem.rest.type!=="spacer")}return E0=g,E0}var A0,Fo;function Lv(){if(Fo)return A0;Fo=1;var e=Xl();function t(n,a,r,s,o,l){var h="abcjs-top-line",g=2;o&&(g=o),n.paper.openGroup({prepend:!0,klass:n.controller.classes.generate("abcjs-staff")});var p=0,d=0;if(s===1)e(n,a,r,6,h,null,l+n.lineThickness),p=n.calcY(10),d=n.calcY(2);else for(var f=s-1;f>=0;f--){var c=(f+1)*g;d=n.calcY(c),p===0&&(p=d),e(n,a,r,c,h,null,l+n.lineThickness),h=void 0}return n.paper.closeGroup(),[p,d]}return A0=t,A0}var M0,Ho;function Ov(){if(Ho)return M0;Ho=1;function e(t,n,a){var r=t.paper.rectBeneath(n);return a&&t.paper.text(a,{x:0,y:n.y+7,"text-anchor":"start","font-size":"14px",fill:"rgba(0,0,255,.4)",stroke:"rgba(0,0,255,.4)"}),r}return M0=e,M0}var I0,$o;function Dv(){if($o)return I0;$o=1;function e(t,n){var a="rgba(0,0,0,255)",r="rgba(0,0,0,0)",s=Math.round(t.y),o=t.controller.width,l=(o-n)/2,h=l+n,g="M "+l+" "+s+" L "+h+" "+s+" L "+h+" "+(s+1)+" L "+l+" "+(s+1)+" L "+l+" "+s+" z";t.paper.pathToBack({path:g,stroke:r,fill:a,class:t.controller.classes.generate("defined-text")})}return I0=e,I0}var N0,Go;function Jl(){if(Go)return N0;Go=1;var e=Dv(),t=mt();function n(a,r,s){for(var o=0;o<r.rows.length;o++){var l=r.rows[o];if(l.absmove)a.absolutemoveY(l.absmove);else if(l.move)a.moveY(l.move);else if(l.text||l.phrases){var h=l.left?l.left:0,g=t(a,{x:h,y:a.y,text:l.text,phrases:l.phrases,"dominant-baseline":l["dominant-baseline"],type:l.font,klass:l.klass,name:l.name,anchor:l.anchor});l.absElemType&&s.wrapSvgEl({el_type:l.absElemType,name:l.name,startChar:l.startChar,endChar:l.endChar,text:l.text},g)}else if(l.separator)e(a,l.separator);else if(l.startGroup)a.paper.openGroup({klass:l.klass,"data-name":l.name});else if(l.endGroup){var p=a.paper.closeGroup();l.absElemType&&s.wrapSvgEl({el_type:l.absElemType,name:l.name,startChar:l.startChar,endChar:l.endChar,text:""},p)}}}return N0=n,N0}var P0,Zo;function Fv(){if(Zo)return P0;Zo=1;var e=Xe(),t=Sv(),n=Bv(),a=Lv(),r=Ov(),s=ai(),o=Jl();function l(p,d,f,c){for(var u,i=p.y,v=0;v<d.staffs.length;v++){var b=d.staffs[v];p.moveY(e.STEP,b.top),b.absoluteY=p.y,p.showDebug&&(p.showDebug.indexOf("box")>=0&&b.voices&&g(p,d.voices,b.voices),p.showDebug.indexOf("grid")>=0&&(p.paper.dottedLine({x1:p.padding.left,x2:p.padding.left+p.controller.width,y1:i,y2:i,stroke:"#0000ff"}),r(p,{x:p.padding.left,y:p.calcY(b.originalTop),width:p.controller.width,height:p.calcY(b.originalBottom)-p.calcY(b.originalTop),fill:p.foregroundColor,stroke:p.foregroundColor,"fill-opacity":.1,"stroke-opacity":.1}),u=0,k(b,"chordHeightAbove"),k(b,"chordHeightBelow"),k(b,"dynamicHeightAbove"),k(b,"dynamicHeightBelow"),k(b,"endingHeightAbove"),k(b,"lyricHeightAbove"),k(b,"lyricHeightBelow"),k(b,"partHeightAbove"),k(b,"tempoHeightAbove"),k(b,"volumeHeightAbove"),k(b,"volumeHeightBelow"))),p.moveY(e.STEP,-b.bottom),p.showDebug&&p.showDebug.indexOf("grid")>=0&&p.paper.dottedLine({x1:p.padding.left,x2:p.padding.left+p.controller.width,y1:p.y,y2:p.y,stroke:"#0000aa"})}for(var m,w,_=2,T=0,q=0;q<d.voices.length;q++){var I=d.voices[q].staff,E=d.voices[q].tabNameInfos;if(p.y=I.absoluteY,p.controller.classes.incrVoice(),!d.voices[q].duplicate){if(m||(m=p.calcY(10)),w=p.calcY(_),I.lines!==0){I.linePitch&&(_=I.linePitch),p.controller.classes.newMeasure();var P=a(p,d.startx,d.w,I.lines,I.linePitch,.35);w=P[1],I.bottomLine=w,I.topLine=P[0],I.hasTab&&(T=I.topLine),I.hasStaff&&(T=I.hasStaff.topLine,d.voices[q].barto=!0,d.voices[q].topLine=m)}h(p,I.absoluteY,d.brace,q,f),h(p,I.absoluteY,d.bracket,q,f)}n(p,d.voices[q],T,f,{top:i,zero:p.y,height:d.height*e.STEP});var x=0;if(E){var M={rows:[]};M.rows.push({absmove:w+2});var N=8;M.rows.push({left:d.startx+N,text:E.name,font:"tablabelfont",klass:"text instrument-name",anchor:"start"}),M.rows.push({move:E.textSize.height}),o(p,M),x=E.textSize.height}p.controller.classes.newMeasure(),d.voices[q].duplicate||(T=p.calcY(2+x))}p.controller.classes.newMeasure();var D=d.staffs.length;D>1&&(m=d.staffs[0].topLine,w=d.staffs[D-1].bottomLine,s(p,d.startx,.6,m,w,null)),p.y=i;function k(S,z){var L=["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(S.positionY&&S.positionY[z]){var R=S.specialY[z]*e.STEP;z==="chordHeightAbove"&&S.specialY.chordLines&&S.specialY.chordLines.above&&(R*=S.specialY.chordLines.above),z==="chordHeightBelow"&&S.specialY.chordLines&&S.specialY.chordLines.below&&(R*=S.specialY.chordLines.below),r(p,{x:p.padding.left,y:p.calcY(S.positionY[z]),width:p.controller.width,height:R,fill:L[u],stroke:L[u],"fill-opacity":.4,"stroke-opacity":.4},z.substr(0,4)),u+=1,u>6&&(u=0)}}}function h(p,d,f,c,u){if(f)for(var i=0;i<f.length;i++)f[i].isStartVoice(c)&&(f[i].startY=d-e.STEP*10,f[i].elemset=t(p,f[i],u))}function g(p,d,f){for(var c=0;c<f.length;c++)for(var u=d[f[c]].children,i=0;i<u.length;i++){var v=u[i],b=v.getFixedCoords();if(!(v.invisible||b.t===void 0||b.b===void 0)){var m=(b.t-b.b)*e.STEP;r(p,{x:b.x,y:p.calcY(b.t),width:b.w,height:m,fill:"#88e888","fill-opacity":.4,stroke:"#4aa93d","stroke-opacity":.8});for(var w=0;w<v.children.length;w++){var _=v.children[w],T=_.getChordDim();if(T){var q=p.calcY(_.pitch);q+=_.dim.font.size*_.getLane(),r(p,{x:T.left,y:q,width:T.right-T.left,height:_.dim.font.size,fill:"none",stroke:"#4aa93d","stroke-opacity":.8})}}}}}return P0=l,P0}var z0,jo;function Hv(){if(jo)return z0;jo=1;function e(t,n,a,r){var s=(n+t.padding.left+t.padding.right)*a,o=(t.y+t.padding.bottom)*a;if(t.isPrint&&(o=Math.max(o,1056)),t.ariaLabel!==""){var l="Sheet Music";t.abctune&&t.abctune.metaText&&t.abctune.metaText.title&&(l+=' for "'+t.abctune.metaText.title+'"'),t.paper.setTitle(l);var h=t.ariaLabel?t.ariaLabel:l;t.paper.setAttribute("aria-label",h)}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 p={overflow:"hidden"};r==="resize"?t.paper.setResponsiveWidth(s,o):(p.width="",p.height=o+"px",a<1?(p.width=s+"px",t.paper.setSize(s/a,o/a)):t.paper.setSize(s,o)),t.paper.setScale(a),t.paper.setParentStyles(p)}return z0=e,z0}var R0,Uo;function $v(){if(Uo)return R0;Uo=1;var e=Hl(),t=$l();function n(a,r,s){this.elements=[],this.paper=a,this.tuneNumber=s,this.selectTypes=r}return n.prototype.getElements=function(){return this.elements},n.prototype.add=function(a,r,s,o){if(this.canSelect(a)){var l;this.selectTypes===void 0?l={selectable:!1,"data-index":this.elements.length}:l={selectable:!0,tabindex:0,"data-index":this.elements.length},this.paper.setAttributeOnElement(r,l);var h={absEl:a,svgEl:r,isDraggable:s};o!==void 0&&(h.staffPos=o),this.elements.push(h)}},n.prototype.canSelect=function(a){return this.selectTypes===!1||!a||!a.abcelem?!1:this.selectTypes===!0?!0:this.selectTypes===void 0?a.abcelem.el_type==="note"||a.abcelem.el_type==="tabNumber":this.selectTypes.indexOf(a.abcelem.el_type)>=0},n.prototype.wrapSvgEl=function(a,r){var s={tuneNumber:this.tuneNumber,abcelem:a,elemset:[r],highlight:e,unhighlight:t};this.add(s,r,!1)},R0=n,R0}var q0,Yo;function Gv(){if(Yo)return q0;Yo=1;const e=ni(),t=ai();function n(m,w,_,T,q){const I=q.gchordfont;q.partsfont;const E=q.annotationfont,P=q.repeatfont,x=q.textfont,M=q.subtitlefont,N=50,D=10,k=14,S=10,z=20,L=16;m.paper.openGroup({klass:"abcjs-chord-grid"}),w.forEach(R=>{switch(R.type){case"text":b(m,R.text,_,m.y,16,x,null,null,!1),m.moveY(L);break;case"subtitle":b(m,R.subtitle,_,m.y+S,20,M,null,"abcjs-subtitle",!1),m.moveY(z);break;case"part":if(R.lines.length>0){b(m,R.name,_,m.y+S,20,M,R.name,"abcjs-part",!1),m.moveY(z);const y=R.lines[0].length,C=T/y;R.lines.forEach((A,B)=>{let O=!1,$=!1;A.forEach(W=>{W.ending&&(O=!0),W.annotations&&W.annotations.length>0&&($=!0)});const F=$?k:O?D:0;A.forEach((W,te)=>{if(!W.noBorder){m.paper.rect({x:_+te*C,y:m.y,width:C,height:F+N}),m.paper.rect({x:_+te*C+1,y:m.y+1,width:C-2,height:F+N-2});let ie=0,re=0;const oe=m.y,X=_+C*te;W.hasStartRepeat&&(r(m,X,oe,oe+N+F,!0,F),ie=12),W.hasEndRepeat&&(r(m,X+C,oe,oe+N+F,!1,F),re=12);let ne=0;W.ending&&(ne=b(m,W.ending,_+te*C+4,oe+10,12,P,null,null,!1).getBBox().width+4),l(m,oe,_+ie,C,B,te,W.chord,I,ie+re,N,F),W.annotations&&W.annotations.length>0&&o(m,oe,_+te*C+ne,W.annotations,E),F&&m.paper.rectBeneath({x:_+te*C,y:m.y,width:C,height:F,fill:"#e8e8e8",stroke:"none"})}}),m.moveY(F+N)}),m.moveY(z)}break}}),m.paper.closeGroup()}function a(m,w,_,T){var q=w-10,I=w+10,E=_+10,P=_-10,x=w-10,M=-m.yToPitch(T)+2,N=w+6.5,D=-m.yToPitch(T)-2.3;m.paper.lineToBack({x1:q,x2:I,y1:E,y2:P,"stroke-width":"3px","stroke-linecap":"round"}),e(m,x,M,"dots.dot",{scalex:1,scaley:1,klass:"",name:"dot"}),e(m,N,D,"dots.dot",{scalex:1,scaley:1,klass:"",name:"dot"})}function r(m,w,_,T,q,I){const E=q?w+2:w-4,P=q?w+9:w-11;m.paper.openGroup({klass:"abcjs-repeat"}),t(m,E,3+m.lineThickness,_,T,null,"bar"),e(m,P,-m.yToPitch(I)-4,"dots.dot",{scalex:1,scaley:1,klass:"",name:"dot"}),e(m,P,-m.yToPitch(I)-8,"dots.dot",{scalex:1,scaley:1,klass:"",name:"dot"}),m.paper.closeGroup()}const s={segno:"scripts.segno",coda:"scripts.coda",fermata:"scripts.ufermata"};function o(m,w,_,T,q){_+=3;let I;for(let E=0;E<T.length;E++)switch(T[E]){case"segno":case"coda":case"fermata":{_+=12,I=e(m,_,-3,s[T[E]],{scalex:1,scaley:1,name:s[T[E]]});const P=I.getBBox();_+=P.width}break;default:b(m,T[E],_,w+12,12,q,null,null,!1)}}function l(m,w,_,T,q,I,E,P,x,M,N){const D=_+T*I;!E[1]&&!E[2]&&!E[3]?c(m,D,w+N,T-x,M,E[0],P,N):!E[1]&&!E[3]?u(m,D,w,T-x,M,E[0],E[2],P,N):i(m,D,w,T-x,M,E,P,N)}function h(m,w,_,T,q,I,E){const P=b(m,q,w,_,T,I,null,"abcjs-chord",!0);let x=P.getBBox(),M=T;for(;x.width>E&&M>=14;)M-=2,P.setAttribute("font-size",M),x=P.getBBox()}const g=34,p=26,d=20,f=-3;function c(m,w,_,T,q,I,E,P){I==="%"?a(m,w+T/2,_+q/2,P+q/2):h(m,w+T/2,_+q/2+f,g,I,E,T)}function u(m,w,_,T,q,I,E,P,x){m.paper.lineToBack({x1:w,x2:w+T,y1:_+q+x,y2:_+2}),h(m,w+T/4,_+q/4+5+x+f,p,I,P,T/2),h(m,w+3*T/4,_+3*q/4+x+f,p,E,P,T/2)}function i(m,w,_,T,q,I,E,P){m.paper.lineToBack({x1:w+3,x2:w+T-3,y1:_+q/2+P,y2:_+q/2+P}),m.paper.lineToBack({x1:w+T/2,x2:w+T/2,y1:_+3+P,y2:_+q-3+P}),I[0]&&h(m,w+T/4,_+q/4+2+P+f,d,v(I[0]),E,T/2),I[1]&&h(m,w+3*T/4,_+q/4+2+P+f,d,v(I[1]),E,T/2),I[2]&&h(m,w+T/4,_+3*q/4+P+f,d,v(I[2]),E,T/2),I[3]&&h(m,w+3*T/4,_+3*q/4+P+f,d,v(I[3]),E,T/2)}function v(m){return m==="No Chord"?"N.C.":m}function b(m,w,_,T,q,I,E,P,x){const M={x:_,y:T,stroke:"none","font-size":q,"font-style":I.style,"font-family":I.face,"font-weight":I.weight,"text-decoration":I.decoration};return E&&(M["data-name"]=E),P&&(M.class=P),M["text-anchor"]=x?"middle":"start",m.paper.text(w,M,null,{"alignment-baseline":"middle"})}return q0=n,q0}var B0,Wo;function Zv(){if(Wo)return B0;Wo=1;var e=Fv(),t=Hv(),n=Jl(),a=Xe(),r=$v(),s=Gv();function o(g,p,d,f,c,u,i,v,b,m,w){var _=new r(g.paper,v,b),T={};p.shouldAddClasses&&(T.klass="abcjs-meta-top"),g.paper.openGroup(T),g.moveY(g.padding.top),n(g,d.topText,_),g.paper.closeGroup(),g.moveY(g.spacing.music);let q=!1;w&&d.chordGrid&&(s(g,d.chordGrid,g.padding.left,f,d.formatting),w==="noMusic"&&(q=!0));var I=[],E=0;if(!q)for(var P=0;P<d.lines.length;P++){p.incrLine();var x=d.lines[P];if(x.staff){if(E++,d.formatting.maxStaves&&E>d.formatting.maxStaves)break;p.shouldAddClasses&&(T.klass="abcjs-staff-wrapper abcjs-l"+p.lineNumber),g.paper.openGroup(T),x.vskip&&g.moveY(x.vskip),I.length>=1&&h(g,g.spacing.staffSeparation,I[I.length-1],x.staffGroup);var M=l(g,x.staffGroup,_,P);M.line=m+P,I.push(M),g.paper.closeGroup()}else x.nonMusic&&(p.shouldAddClasses&&(T.klass="abcjs-non-music"),g.paper.openGroup(T),n(g,x.nonMusic,_),g.paper.closeGroup())}return p.reset(),q||d.bottomText&&d.bottomText.rows&&d.bottomText.rows.length>0&&(p.shouldAddClasses&&(T.klass="abcjs-meta-bottom"),g.paper.openGroup(T),g.moveY(24),n(g,d.bottomText,_),g.paper.closeGroup()),t(g,c,i,u),{staffgroups:I,selectables:_.getElements()}}function l(g,p,d,f){e(g,p,d,f);var c=p.height*a.STEP;return g.y+=c,p}function h(g,p,d,f){var c=d.staffs[d.staffs.length-1],u=-(c.bottom-2),i=f.staffs[0].top-10,v=i+u,b=v*a.STEP;b<p&&g.moveY(p-b)}return B0=o,B0}var L0,Vo;function jv(){if(Vo)return L0;Vo=1;var e=Wl();function t(n){for(var a=n;a&&a.attributes&&a.tagName.toLowerCase()!=="svg"&&!a.attributes.selectable;)a=a.parentNode;if(a&&a.attributes&&a.attributes.selectable){var r=a.attributes["data-index"].nodeValue;if(r&&(r=parseInt(r,10),r>=0&&r<this.selectables.length)){var s=this.selectables[r],o=e(s,n);return o.index=r,o.element=s,o}}return null}return L0=t,L0}var O0,Xo;function Ql(){if(Xo)return O0;Xo=1;var e=Xe(),t=iv(),n=ov(),a=cv(),r=lv(),s=uv(),o=hv(),l=fv(),h=dv(),g=_v(),p=kv(),d=xv(),f=Cv(),c=Zv(),u=jl(),i=jv(),v=function(w,_){_=_||{},this.findSelectableElement=i,this.oneSvgPerLine=_.oneSvgPerLine,this.selectionColor=_.selectionColor,this.dragColor=_.dragColor?_.dragColor:_.selectionColor,this.dragging=!!_.dragging,this.selectTypes=_.selectTypes,this.responsive=_.responsive,this.space=3*e.SPACE,this.initialClef=_.initialClef,this.timeBasedLayout=_.timeBasedLayout,this.expandToWidest=!!_.expandToWidest,this.scale=_.scale?parseFloat(_.scale):0,this.classes=new p({shouldAddClasses:_.add_classes}),this.scale>.1||(this.scale=void 0),_.staffwidth?(this.staffwidthScreen=_.staffwidth,this.staffwidthPrint=_.staffwidth):(this.staffwidthScreen=740,this.staffwidthPrint=680),this.listeners=[],_.clickListener&&this.addSelectListener(_.clickListener),this.renderer=new n(w),this.renderer.setPaddingOverride(_),_.showDebug&&(this.renderer.showDebug=_.showDebug),_.jazzchords&&(this.jazzchords=_.jazzchords),_.accentAbove&&(this.accentAbove=_.accentAbove),_.germanAlphabet&&(this.germanAlphabet=_.germanAlphabet),_.lineThickness&&(this.lineThickness=_.lineThickness),_.chordGrid&&(this.chordGrid=_.chordGrid),this.renderer.controller=this,this.renderer.foregroundColor=_.foregroundColor?_.foregroundColor:"currentColor",_.ariaLabel!==void 0&&(this.renderer.ariaLabel=_.ariaLabel),this.renderer.minPadding=_.minPadding?_.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(w,_,T){w[0]===void 0&&(w=[w]),this.reset();for(var q=0;q<w.length;q++)_===void 0&&(_=q),this.getFontAndAttr=new d(w[q].formatting,this.classes),this.getTextSize=new f(this.getFontAndAttr,this.renderer.paper),this.engraveTune(w[q],_,T)},v.prototype.adjustNonScaledItems=function(w){this.width/=w,this.renderer.adjustNonScaledItems(w)},v.prototype.getMeasureWidths=function(w){this.reset(),this.getFontAndAttr=new d(w.formatting,this.classes),this.getTextSize=new f(this.getFontAndAttr,this.renderer.paper);var _=this.jazzchords;this.setupTune(w,0),this.constructTuneElements(w),g(this.renderer,w,0,this.space,this.timeBasedLayout);for(var T=[],q,I=!0,E=0;E<w.lines.length;E++){var P=w.lines[E];if(P.staff){if(I&&(q={left:0,measureWidths:[],total:0},T.push(q),I=!1),P.staffGroup.voices.length>0)for(var x=P.staffGroup.voices[0],M=!1,N=0,D=0;D<x.children.length;D++){var k=x.children[D];!M&&!k.isClef&&!k.isKeySig&&(M=!0,q.left=k.x,N=k.x),k.type==="bar"&&(q.measureWidths.push(k.x-N),q.total+=k.x-N,N=k.x)}}else I=!0}return this.jazzchords=_,T},v.prototype.setupTune=function(w,_){this.classes.reset(),w.formatting.jazzchords!==void 0&&(this.jazzchords=w.formatting.jazzchords),w.formatting.accentAbove!==void 0&&(this.accentAbove=w.formatting.accentAbove),this.renderer.newTune(w),this.engraver=new t(this.getTextSize,_,{bagpipes:w.formatting.bagpipes,flatbeams:w.formatting.flatbeams,graceSlurs:w.formatting.graceSlurs!==!1,percmap:w.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=w.getMeterFraction().num/w.getMeterFraction().den,w.formatting.staffwidth?this.width=w.formatting.staffwidth*1.33:this.width=this.renderer.isPrint?this.staffwidthPrint:this.staffwidthScreen;var T=w.formatting.scale?w.formatting.scale:this.scale;return this.responsive==="resize"&&(T=void 0),T===void 0&&(T=this.renderer.isPrint?.75:1),this.adjustNonScaledItems(T),T},v.prototype.constructTuneElements=function(w){w.topText=new o(w.metaText,w.metaTextInfo,w.formatting,w.lines,this.width,this.renderer.isPrint,this.renderer.padding.left,this.renderer.spacing,this.classes.shouldAddClasses,this.getTextSize);var _,T,q=!1,I=!1;for(_=0;_<w.lines.length;_++)if(T=w.lines[_],T.staff)I=!0,T.staffGroup=this.engraver.createABCLine(T.staff,q?null:w.metaText.tempo,_),q=!0;else if(T.subtitle){if(I){var E=this.width/2+this.renderer.padding.left;T.nonMusic=new s(this.renderer.spacing.subtitle,w.formatting,T.subtitle,E,this.renderer.padding.left,this.getTextSize)}}else T.text!==void 0?(I=!0,T.nonMusic=new a(T.text,T.vskip,this.getFontAndAttr,this.renderer.padding.left,this.width,this.getTextSize)):T.separator!==void 0&&T.separator.lineLength&&(I=!0,T.nonMusic=new r(T.separator.spaceAbove,T.separator.lineLength,T.separator.spaceBelow));w.bottomText=new l(w.metaText,this.width,this.renderer.isPrint,this.renderer.padding.left,this.renderer.spacing,this.classes.shouldAddClasses,this.getTextSize)},v.prototype.engraveTune=function(w,_,T){var q=this.jazzchords,I=this.setupTune(w,_);this.constructTuneElements(w);var E=g(this.renderer,w,this.width,this.space,this.expandToWidest,this.timeBasedLayout);if(this.expandToWidest&&E>this.width+1&&(w.topText=new o(w.metaText,w.metaTextInfo,w.formatting,w.lines,E,this.renderer.isPrint,this.renderer.padding.left,this.renderer.spacing,this.classes.shouldAddClasses,this.getTextSize),w.lines&&w.lines.length>0))for(var P=w.lines.length,x=0;x<P;++x){var M=w.lines[x];if(M.nonMusic&&M.nonMusic.rows&&M.nonMusic.rows.length>0)for(var N=M.nonMusic.rows.length,D=0;D<N;++D){var k=M.nonMusic.rows[D];k.left&&(M.subtitle?k.left=E/2+this.renderer.padding.left:M.text&&M.text.length>0&&M.text[0].center&&(k.left=E/2+this.renderer.padding.left))}}w.tablatures&&u.layoutTablatures(this.renderer,w);var S=c(this.renderer,this.classes,w,this.width,E,this.responsive,I,this.selectTypes,_,T,this.chordGrid);if(this.staffgroups=S.staffgroups,this.selectables=S.selectables,this.oneSvgPerLine){var z=this.renderer.paper.svg.parentNode;this.svgs=b(this.renderer,z,w.metaText.title,this.responsive,I)}else this.svgs=[this.renderer.paper.svg];h(this,this.svgs),this.jazzchords=q};function b(w,_,T,q,I){T||(T="Untitled");var E=_.querySelector("svg");q==="resize"&&(_.style.paddingBottom="");for(var P=E.querySelector("style"),x=q==="resize"?E.viewBox.baseVal.width:E.getAttribute("width"),M=_.querySelectorAll("svg > g"),N=0,D=[],k=0;k<M.length;k++){var S=M[k],z=S.getBBox(),L=z.y-N,R=z.height+L,y=document.createElement("div"),C="overflow: hidden;";q!=="resize"&&(C+="height:"+R*I+"px;"),y.setAttribute("style",C);var A=m(E),B='Sheet Music for "'+T+'" section '+(k+1);A.setAttribute("aria-label",B),q!=="resize"&&A.setAttribute("height",R),q==="resize"&&(A.style.position="");var O=w.firefox112?R+1:R;A.setAttribute("viewBox","0 "+N+" "+x+" "+O),A.appendChild(P.cloneNode(!0));var $=document.createElement("title");$.innerText=B,A.appendChild($),A.appendChild(S),y.appendChild(A),D.push(A),_.appendChild(y),N=z.y+z.height}return _.removeChild(E),D}function m(w){for(var _="http://www.w3.org/2000/svg",T=document.createElementNS(_,"svg"),q=0;q<w.attributes.length;q++){var I=w.attributes[q];I.name!=="height"&&I.name!="aria-label"&&T.setAttribute(I.name,I.value)}return T}return v.prototype.getDim=function(w){if(!w.dim){var _=w.svgEl.getBBox();w.dim={left:Math.round(_.x),top:Math.round(_.y),right:Math.round(_.x+_.width),bottom:Math.round(_.y+_.height)}}return w.dim},v.prototype.addSelectListener=function(w){this.listeners[this.listeners.length]=w},O0=v,O0}var D0,Ko;function eu(){if(Ko)return D0;Ko=1;var e=yr();Ol();var t=Ql(),n=Dl(),a=ql(),r={};function s(){var g=window.innerWidth;for(var p in r)if(r.hasOwnProperty(p)){var d=r[p],f=d.offsetLeft;g-=f*2,d.style.width=g+"px"}}try{window.addEventListener("resize",s),window.addEventListener("orientationChange",s)}catch{}function o(g,p,d,f,c){d.viewportHorizontal?(g.innerHTML='<div class="abcjs-inner"></div>',d.scrollHorizontal?(g.style.overflowX="auto",g.style.overflowY="hidden"):g.style.overflow="hidden",r[g.id]=g,g=g.children[0]):d.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 u=new t(g,d);if(u.engraveABC(p,f,c),p.engraver=u,d.viewportVertical||d.viewportHorizontal){var i=g.parentNode;i.style.width=g.style.width}}var l=function(g,p,d,f,c){var u={},i;if(d){for(i in d)d.hasOwnProperty(i)&&(u[i]=d[i]);u.warnings_id&&u.tablature&&(u.tablature.warning_id=u.warnings_id)}if(f)for(i in f)f.hasOwnProperty(i)&&(i==="listener"?f[i].highlight&&(u.clickListener=f[i].highlight):u[i]=f[i]);if(c)for(i in c)c.hasOwnProperty(i)&&(u[i]=c[i]);function v(b,m,w,_){var T=!1;return b==="*"&&(T=!0,b=document.createElement("div"),b.setAttribute("style","visibility: hidden;"),document.body.appendChild(b)),!T&&u.wrap&&u.staffwidth?(m=h(b,m,w,_,u),m):(u.afterParsing&&u.afterParsing(m,w,_),o(b,m,u,w,0),T&&b.parentNode.removeChild(b),null)}return e.renderEngine(v,g,p,u)};function h(g,p,d,f,c){var u=new t(g,c),i=u.getMeasureWidths(p),v=a.calcLineWraps(p,i,c);if(v.reParse){var b=new n;b.parse(f,v.revisedParams),p=b.getTune();var m=b.getWarnings();m&&(p.warnings=m)}return c.afterParsing&&c.afterParsing(p,d,f),o(g,p,v.revisedParams,d,0),p.explanation=v.explanation,p}return D0=l,D0}var F0,Jo;function Uv(){if(Jo)return F0;Jo=1;var e=yr(),t=Ql(),n=function(a,r){function s(o,l,h,g){o=document.createElement("div"),o.setAttribute("style","visibility: hidden;"),document.body.appendChild(o);var p=new t(o,r),d=p.getMeasureWidths(l);return o.parentNode.removeChild(o),{sections:d}}return e.renderEngine(s,"*",a,r)};return F0=n,F0}var H0,Qo;function ii(){if(Qo)return H0;Qo=1;var e={};return H0=e,H0}var $0,ec;function Yv(){if(ec)return $0;ec=1;var e=ii(),t=function(n,a,r,s){e[a]||(e[a]={});var o=e[a];return o[r]||(o[r]=new Promise(function(l,h){var g=new XMLHttpRequest;let p=n+a+"-mp3/"+r+".mp3";g.open("GET",p,!0),g.responseType="arraybuffer",g.onload=function(){if(g.status!==200){h(Error("Can't load sound at "+p+" status="+g.status));return}var d=function(c){l({instrument:a,name:r,status:"loaded",audioBuffer:c})},f=s.decodeAudioData(g.response,d,function(){h(Error("Can't decode sound at "+p))});f&&typeof f.catch=="function"&&f.catch(h)},g.onerror=function(){h(Error("Can't load sound at "+p))},g.send()}).catch(l=>{throw console.error("Didn't load note",a,r,":",l.message),l})),o[r]};return $0=t,$0}var G0,tc;function si(){if(tc)return G0;tc=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 G0=e,G0}var Z0,rc;function Wv(){if(rc)return Z0;rc=1;var e=si(),t=function(n){for(var a=[],r=0;r<n.tracks.length;r++)a.push([]);var s=e[0];return n.tracks.forEach(function(o,l){o.forEach(function(h){switch(h.cmd){case"note":var g=h.instrument!==void 0?e[h.instrument]:s;if(h.duration>0){var p=h.gap?h.gap:0,d=h.duration;p=Math.min(p,d*2/3);var f={pitch:h.pitch,instrument:g,start:Math.round(h.start*1e6)/1e6,end:Math.round((h.start+d-p)*1e6)/1e6,volume:h.volume};h.startChar&&(f.startChar=h.startChar),h.endChar&&(f.endChar=h.endChar),h.style&&(f.style=h.style),h.cents&&(f.cents=h.cents),a[l].push(f)}break;case"program":s=e[h.instrument];break;case"text":break;default:console.log("Unhandled midi event",h)}})}),a};return Z0=t,Z0}var j0,nc;function wr(){if(nc)return j0;nc=1;function e(t){if(t)window.abcjsAudioContext=t;else if(!window.abcjsAudioContext){var n=window.AudioContext||window.webkitAudioContext;if(n)window.abcjsAudioContext=new n;else return!1}return window.abcjsAudioContext.state!=="suspended"}return j0=e,j0}var U0,ac;function Lt(){if(ac)return U0;ac=1;var e=wr();function t(){return window.abcjsAudioContext||e(),window.abcjsAudioContext}return U0=t,U0}var Y0,ic;function _r(){if(ic)return Y0;ic=1;var e=Lt();function t(){if(!window.Promise||!window.AudioContext&&!window.webkitAudioContext&&!navigator.mozAudioContext&&!navigator.msAudioContext)return!1;var n=e();if(n)return n.resume!==void 0}return Y0=t,Y0}var W0,sc;function oi(){if(sc)return W0;sc=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 W0=e,W0}var V0,oc;function Vv(){if(oc)return V0;oc=1;var e=function(n){return window.URL.createObjectURL(t(n.audioBuffers))};function t(n){var a=n[0],r=a.numberOfChannels,s=a.length*r*2+44,o=new ArrayBuffer(s),l=new DataView(o),h=[],g,p,d=0,f=0;for(u(1179011410),u(s-8),u(1163280727),u(544501094),u(16),c(1),c(r),u(a.sampleRate),u(a.sampleRate*2*r),c(r*2),c(16),u(1635017060),u(s-f-4),g=0;g<r;g++)h.push(a.getChannelData(g));for(;f<s;){for(g=0;g<h.length;g++)p=Math.max(-1,Math.min(1,h[g][d])),p=(.5+p<0?p*32768:p*32767)|0,l.setInt16(f,p,!0),f+=2;d++}return new Blob([o],{type:"audio/wav"});function c(i){l.setUint16(f,i,!0),f+=2}function u(i){l.setUint32(f,i,!0),f+=4}}return V0=e,V0}var X0,cc;function tu(){if(cc)return X0;cc=1;function e(t){return Math.pow(2,t/1200)}return X0=e,X0}var K0,lc;function Xv(){if(lc)return K0;lc=1;var e=ii(),t=oi(),n=tu();function a(s,o,l,h,g,p,d,f,c){var u=window.OfflineAudioContext||window.webkitOfflineAudioContext,i=l.len*l.tempoMultiplier;p&&(i+=p/1e3),i-=f,i<0&&(i=.005);var v=new u(2,Math.floor((i+d)*o),o),b=t[l.pitch];if(!e[l.instrument])return c&&c("placeNote skipped (instrument empty): "+l.instrument+":"+b),Promise.resolve();var m=e[l.instrument][b];return m?m.then(function(w){var _=v.createBufferSource();_.buffer=w.audioBuffer;var T=l.volume/96*g;_.gainNode=v.createGain(),l.pan&&v.createStereoPanner&&(_.panNode=v.createStereoPanner(),_.panNode.pan.setValueAtTime(l.pan,0)),_.gainNode.gain.value=T,_.gainNode.gain.linearRampToValueAtTime(_.gainNode.gain.value,i),_.gainNode.gain.linearRampToValueAtTime(0,i+d),l.cents&&(_.playbackRate.value=n(l.cents)),_.panNode?(_.panNode.connect(v.destination),_.gainNode.connect(_.panNode)):_.gainNode.connect(v.destination),_.connect(_.gainNode),_.start(0),_.noteOff?_.noteOff(i+d):_.stop(i+d);var q;return v.oncomplete=function(I){if(I.renderedBuffer&&I.renderedBuffer.getChannelData)for(var E=0;E<h.length;E++){var P=h[E]*l.tempoMultiplier;p&&(P-=p/1e3),P<0&&(P=0),P=Math.floor(P*o),r(s,I.renderedBuffer,P)}c&&c("placeNote: "+l.instrument+":"+b),q()},v.startRendering(),new Promise(function(I){q=I})}).catch(function(w){return c&&c("placeNote catch: "+w.message),Promise.reject(w)}):(c&&c("placeNote skipped: "+l.instrument+":"+b),Promise.resolve())}var r=function(s,o,l){for(var h=0;h<2;h++)for(var g=o.getChannelData(h),p=s.getChannelData(h),d=0;d<g.length;d++)p[d+l]+=g[d]};return K0=a,K0}var J0,uc;function ci(){if(uc)return J0;uc=1;var e=Yv(),t=Wv(),n=wr(),a=Lt(),r=_r(),s=oi(),o=si(),l=Vv(),h=Xv(),g=ii(),p="MIDI is not supported in this browser.",d="https://paulrosen.github.io/midi-js-soundfonts/abcjs/",f="https://paulrosen.github.io/midi-js-soundfonts/FluidR3_GM/",c="https://paulrosen.github.io/midi-js-soundfonts/MusyngKite/";function u(){var i=this;i.audioBufferPossible=void 0,i.directSource=[],i.startTimeSec=void 0,i.pausedTimeSec=void 0,i.audioBuffers=[],i.duration=void 0,i.isRunning=!1,i.options={},i.pickupLength=0,i.init=function(m){m||(m={}),m.options&&(i.options=m.options),n(m.audioContext);var w=a().currentTime;if(i.debugCallback=m.debugCallback,i.debugCallback&&i.debugCallback("init called"),i.audioBufferPossible=i._deviceCapable(),!i.audioBufferPossible)return Promise.reject({status:"NotSupported",message:p});var _=m.options?m.options:{};i.soundFontUrl=_.soundFontUrl?_.soundFontUrl:f,i.soundFontUrl[i.soundFontUrl.length-1]!=="/"&&(i.soundFontUrl+="/"),_.soundFontVolumeMultiplier||_.soundFontVolumeMultiplier===0?i.soundFontVolumeMultiplier=_.soundFontVolumeMultiplier:i.soundFontUrl===f||i.soundFontUrl===c?i.soundFontVolumeMultiplier=3:i.soundFontUrl===d?i.soundFontVolumeMultiplier=.4:i.soundFontVolumeMultiplier=1,_.programOffsets?i.programOffsets=_.programOffsets:i.soundFontUrl===d?i.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}:i.programOffsets={};var T=_.fadeLength!==void 0?parseInt(_.fadeLength,10):NaN;if(i.fadeLength=isNaN(T)?200:T,T=_.noteEnd!==void 0?parseInt(_.noteEnd,10):NaN,i.noteEnd=isNaN(T)?0:T,i.pan=_.pan,i.meterSize=1,m.visualObj){i.flattened=m.visualObj.setUpAudio(_);var q=m.visualObj.getMeterFraction();q.den&&(i.meterSize=q.num/q.den),i.pickupLength=m.visualObj.getPickupLength()}else if(m.sequence)i.flattened=m.sequence;else return Promise.reject(new Error("Must pass in either a visualObj or a sequence"));i.millisecondsPerMeasure=m.millisecondsPerMeasure?m.millisecondsPerMeasure:m.visualObj?m.visualObj.millisecondsPerMeasure(i.flattened.tempo):1e3,i.beatsPerMeasure=m.visualObj?m.visualObj.getBeatsPerMeasure():4,i.sequenceCallback=_.sequenceCallback,i.callbackContext=_.callbackContext,i.onEnded=_.onEnded,i.meterFraction=m.visualObj?m.visualObj.getMeterFraction():{den:1};var I={},E=[],P=[],x=o[0];i.flattened.tracks.forEach(function(S){S.forEach(function(z){if(z.cmd==="program"&&o[z.instrument]&&(x=o[z.instrument]),z.pitch!==void 0){var L=z.pitch,R=s[L],y=z.instrument!==void 0?o[z.instrument]:x;if(R)if(I[y]||(I[y]={}),!g[y]||!g[y][R])I[y][R]=!0;else{var C=y+":"+R;E.indexOf(C)<0&&E.push(C)}else{var A=y+":"+R;console.log("Can't find note: ",L,A),P.indexOf(A)<0&&P.push(A)}}})}),i.debugCallback&&i.debugCallback("note gathering time = "+Math.floor((a().currentTime-w)*1e3)+"ms"),w=a().currentTime;var M=[];Object.keys(I).forEach(function(S){Object.keys(I[S]).forEach(function(z){M.push({instrument:S,note:z})})}),i.debugCallback&&i.debugCallback("notes "+JSON.stringify(M));for(var N=[],D=256,k=0;k<M.length;k+=D)N.push(M.slice(k,k+D));return new Promise(function(S,z){var L={cached:E,error:P,loaded:[]},R=0,y=function(){i.debugCallback&&i.debugCallback("loadBatch idx="+R+" len="+N.length),R<N.length?i._loadBatch(N[R],i.soundFontUrl,w).then(function(C){i.debugCallback&&i.debugCallback("loadBatch then"),w=a().currentTime,C&&(C.error&&(L.error=L.error.concat(C.error)),C.loaded&&(L.loaded=L.loaded.concat(C.loaded))),R++,y()},z):(i.debugCallback&&i.debugCallback("resolve init"),S(L))};y()})},i._loadBatch=(function(m,w,_,T){var q=[];return m.forEach(function(I){i.debugCallback&&i.debugCallback("getNote "+I.instrument+":"+I.note),q.push(e(w,I.instrument,I.note,a()))}),Promise.all(q).then(function(I){i.debugCallback&&i.debugCallback("mp3 load time = "+Math.floor((a().currentTime-_)*1e3)+"ms");for(var E=[],P=[],x=[],M=[],N=0;N<I.length;N++){var D=I[N],k=D.instrument+":"+D.name;D.status==="loaded"?E.push(k):D.status==="pending"?x.push(k):D.status==="cached"?P.push(k):M.push(k+" "+D.message)}if(x.length>0){if(i.debugCallback&&i.debugCallback("pending "+JSON.stringify(x)),T?T=T*2:T=50,T<9e4)return new Promise(function(L,R){setTimeout(function(){var y=[];for(N=0;N<x.length;N++)k=x[N].split(":"),y.push({instrument:k[0],note:k[1]});i.debugCallback&&i.debugCallback("retry "+JSON.stringify(y)),i._loadBatch(y,w,_,T).then(function(C){L(C)}).catch(function(C){R(C)})},T)});for(var S=[],z=0;z<m.length;z++)S.push(m[z].instrument+"/"+m[z].note);return i.debugCallback&&i.debugCallback("loadBatch timeout"),Promise.reject(new Error("timeout attempting to load: "+S.join(", ")))}else return i.debugCallback&&i.debugCallback("loadBatch resolve"),Promise.resolve({loaded:E,cached:P,error:M})}).catch(function(I){i.debugCallback&&i.debugCallback("loadBatch catch "+I.message)})}),i.prime=function(){var m=i.fadeLength/1e3;return i.isRunning=!1,i.audioBufferPossible?(i.debugCallback&&i.debugCallback("prime called"),new Promise(function(w,_){try{let R=function(y){var C=y&&y.audioBuffers&&y.audioBuffers.length>0?y.audioBuffers[0].duration:0;return{status:a().state,duration:C}};var L=R,T=a().currentTime,q=i.millisecondsPerMeasure/1e3/i.meterSize;if(i.duration=i.flattened.totalDuration*q,i.duration<=0)return i.audioBuffers=[],w({status:"empty",seconds:0});i.duration+=m;var I=Math.floor(a().sampleRate*i.duration);i.stop();var E=t(i.flattened);i.options.swing&&b(E,i.options.swing,i.meterFraction,i.pickupLength),i.sequenceCallback&&i.sequenceCallback(E,i.callbackContext);var P=v(E.length,i.pan),x={};E.forEach(function(y,C){var A=P&&P.length>C?P[C]:0;y.forEach(function(B){var O=B.instrument+":"+B.pitch+":"+B.volume+":"+Math.round((B.end-B.start)*1e3)/1e3+":"+A+":"+q+":"+(B.cents?B.cents:0);i.debugCallback&&i.debugCallback("noteMapTrack "+O),x[O]||(x[O]=[]),x[O].push(B.start)})});for(var M=[],N=a().createBuffer(2,I,a().sampleRate),D=0;D<Object.keys(x).length;D++){var k=Object.keys(x)[D],S=k.split(":"),z=S[6]!==void 0?parseFloat(S[6]):0;S={instrument:S[0],pitch:parseInt(S[1],10),volume:parseInt(S[2],10),len:parseFloat(S[3]),pan:parseFloat(S[4]),tempoMultiplier:parseFloat(S[5]),cents:z},M.push(h(N,a().sampleRate,S,x[k],i.soundFontVolumeMultiplier,i.programOffsets[S.instrument],m,i.noteEnd/1e3,i.debugCallback))}i.audioBuffers=[N],i.debugCallback&&(i.debugCallback("sampleRate = "+a().sampleRate),i.debugCallback("totalSamples = "+I),i.debugCallback("creationTime = "+Math.floor((a().currentTime-T)*1e3)+"ms")),Promise.all(M).then(function(){a().state==="suspended"?a().resume().then(function(){w(R(i))}):a().state==="interrupted"?a().suspend().then(function(){a().resume().then(function(){w(R(i))})}):w(R(i))}).catch(function(y){_(y)})}catch(R){_(R)}})):Promise.reject(new Error(p))};function v(m,w){if(w==null)return null;var _=[];if(w.length){for(var T=0;T<m;T++)if(T<w.length){var q=parseFloat(w[T]);q<-1?q=-1:q>1&&(q=1),_.push(q)}else _.push(0);return _}else{var I=parseFloat(w);if(I*(m-1)>2)return null;for(var E=m%2===0,P=E?0-I/2:0,x=P+I,M=0;M<m;M++)E=M%2===0,E?(_.push(P),P-=I):(_.push(x),x+=I);return _}}i.start=function(){if(!i.audioBufferPossible)throw new Error(p);i.debugCallback&&i.debugCallback("start called");var m=i.pausedTimeSec?i.pausedTimeSec:0;i._kickOffSound(m),i.startTimeSec=a().currentTime-m,i.pausedTimeSec=void 0,i.debugCallback&&i.debugCallback("MIDI STARTED",i.startTimeSec)},i.pause=function(){if(!i.audioBufferPossible)throw new Error(p);return i.debugCallback&&i.debugCallback("pause called"),i.pausedTimeSec=i.stop(),i.pausedTimeSec},i.resume=function(){i.start()},i.seek=function(m,w){var _;switch(w){case"seconds":_=m;break;case"beats":_=m*i.millisecondsPerMeasure/i.beatsPerMeasure/1e3;break;default:_=(i.duration-i.fadeLength/1e3)*m;break}if(!i.audioBufferPossible)throw new Error(p);i.debugCallback&&i.debugCallback("seek called sec="+_),i.isRunning?(i.stop(),i._kickOffSound(_)):i.pausedTimeSec=_,i.pausedTimeSec=_},i.stop=function(){i.isRunning=!1,i.pausedTimeSec=void 0,i.directSource.forEach(function(w){try{w.stop()}catch(_){console.log("direct source didn't stop:",_)}}),i.directSource=[];var m=a().currentTime-i.startTimeSec;return m},i.finished=function(){i.startTimeSec=void 0,i.pausedTimeSec=void 0,i.isRunning=!1},i.download=function(){return l(i)},i.getAudioBuffer=function(){return i.audioBuffers[0]},i.getIsRunning=function(){return i.isRunning},i._deviceCapable=function(){return r()?!0:(console.warn(p),i.debugCallback&&i.debugCallback(p),!1)},i._kickOffSound=function(m){i.isRunning=!0,i.directSource=[],i.audioBuffers.forEach(function(w,_){i.directSource[_]=a().createBufferSource(),i.directSource[_].buffer=w,i.directSource[_].connect(a().destination)}),i.directSource.forEach(function(w){w.start(0,m)}),i.onEnded&&(i.directSource[0].onended=function(){i.onEnded(i.callbackContext)})};function b(m,w,_,T){if(!(_.den!=4&&_.den!=8)&&(w=parseFloat(w),!(isNaN(w)||w<=50))){w>75&&(w=75),w=w/50-1;var q=0,I=.25;_.den===8&&(I=I/2);for(var E=I/2,P=E*w,x=0;x<m.length;x++)for(var M=m[x],N=0;N<M.length;N++){var D=M[N];if((D.start-T)%E==0&&(D.start-T)%I!=0&&(N==0||M[N-1].start<=M[N].start-E)&&(N==M.length-1||M[N+1].start>=M[N].start+E)){var k=D.start;D.start+=P,D.volume*=1+q,N>0&&M[N-1].end==k&&(M[N-1].end=D.start,M[N-1].volume*=1-q)}}}}}return J0=u,J0}var Q0,hc;function ru(){if(hc)return Q0;hc=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(n,a){t.tracks[n].push({channel:0,cmd:"program",instrument:a}),t.currentInstrument[n]=a},t.appendNote=function(n,a,r,s,o){var l={cmd:"note",duration:r,gap:0,instrument:t.currentInstrument[n],pitch:a,start:t.starts[n],volume:s};o&&(l.cents=o),t.tracks[n].push(l),t.starts[n]+=r,t.totalDuration=Math.max(t.totalDuration,t.starts[n])}};return Q0=e,Q0}var ea,fc;function Kv(){if(fc)return ea;fc=1;var e=`
124
+ <svg version="1.0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 700" preserveAspectRatio="xMidYMid meet">
125
+ <g transform="translate(0,700) scale(0.1,-0.1)" >
126
+ <path d="M3111 6981 c-20 -37 -90 -55 -364 -96 -120 -18 -190 -33 -244 -55
127
+ -42 -17 -124 -42 -182 -56 -78 -18 -119 -34 -157 -60 -28 -19 -86 -46 -128
128
+ -60 -43 -13 -107 -42 -144 -64 -37 -23 -84 -46 -106 -52 -21 -7 -56 -29 -79
129
+ -50 -22 -22 -61 -50 -86 -63 -26 -13 -67 -40 -91 -60 -24 -20 -65 -47 -90 -60
130
+ -25 -13 -53 -31 -61 -41 -8 -9 -32 -30 -54 -46 -75 -54 -486 -460 -512 -507
131
+ -15 -25 -48 -69 -75 -98 -26 -28 -48 -57 -48 -63 0 -6 -18 -29 -39 -53 -21
132
+ -23 -56 -71 -77 -107 -20 -36 -50 -80 -65 -97 -16 -18 -33 -52 -40 -75 -12
133
+ -47 -47 -115 -84 -166 -13 -18 -30 -56 -38 -83 -8 -27 -34 -80 -56 -118 -33
134
+ -53 -46 -91 -62 -167 -12 -63 -34 -127 -59 -179 -42 -84 -60 -166 -60 -270 0
135
+ -90 26 -122 125 -154 54 -17 96 -19 430 -20 305 -1 381 2 430 14 82 22 140 51
136
+ 153 78 6 12 22 47 37 77 14 30 38 77 54 103 15 27 34 73 40 103 7 30 28 78 48
137
+ 107 19 28 44 74 55 101 10 28 34 67 53 87 18 20 49 61 68 90 19 30 44 63 57
138
+ 74 13 11 36 40 52 65 59 94 232 270 306 313 20 11 57 37 82 58 25 20 70 52
139
+ 100 72 30 19 66 47 79 61 13 14 49 35 80 46 30 12 80 37 111 56 31 19 95 45
140
+ 143 58 48 12 110 37 139 55 63 40 127 55 323 76 83 9 208 28 279 41 156 29
141
+ 165 29 330 4 453 -71 514 -84 606 -130 31 -16 83 -36 116 -45 32 -9 84 -34
142
+ 115 -56 31 -21 82 -48 113 -60 32 -11 72 -33 89 -48 18 -16 59 -45 92 -65 33
143
+ -21 74 -51 90 -66 17 -15 49 -40 73 -54 52 -32 65 -61 50 -113 -8 -31 -61 -90
144
+ -277 -308 -300 -303 -361 -382 -369 -481 -2 -29 0 -66 6 -81 13 -40 88 -138
145
+ 115 -151 12 -6 54 -26 92 -44 l70 -33 945 -2 c520 -1 975 2 1012 7 64 8 191
146
+ 50 231 76 11 7 33 34 50 60 22 34 42 51 65 58 l32 9 0 1101 0 1102 -32 9 c-21
147
+ 7 -44 26 -64 55 -60 84 -77 97 -140 110 -44 9 -76 10 -127 2 -59 -9 -77 -17
148
+ -134 -62 -37 -28 -172 -155 -301 -281 -129 -127 -249 -237 -267 -245 -25 -10
149
+ -41 -11 -71 -2 -58 15 -112 45 -124 69 -6 11 -35 35 -64 54 -28 18 -58 41 -66
150
+ 50 -8 9 -41 35 -75 58 -33 22 -77 56 -99 75 -21 18 -64 46 -95 61 -31 14 -73
151
+ 39 -93 55 -20 15 -70 40 -110 55 -40 15 -97 44 -127 64 -29 21 -78 44 -107 53
152
+ -30 8 -77 31 -105 51 -42 28 -73 39 -173 60 -68 14 -154 39 -196 58 -95 43
153
+ -131 51 -343 76 -209 24 -242 32 -279 70 l-30 29 -328 0 c-312 0 -330 -1 -339
154
+ -19z"></path>
155
+ <path d="M254 2875 c-89 -16 -107 -26 -145 -78 -32 -44 -62 -66 -91 -67 -17 0
156
+ -18 -61 -18 -1140 l0 -1140 24 0 c16 0 41 -17 72 -50 40 -42 61 -55 117 -72
157
+ l69 -21 82 23 c44 12 96 30 114 39 18 9 148 132 290 272 141 141 267 261 279
158
+ 268 51 26 86 14 176 -61 32 -26 62 -48 66 -48 5 0 36 -25 70 -55 34 -30 74
159
+ -61 89 -69 15 -8 37 -28 50 -45 12 -17 50 -45 84 -62 34 -17 78 -44 98 -60 19
160
+ -16 61 -37 93 -48 32 -11 81 -37 107 -56 27 -20 76 -45 109 -56 33 -12 75 -31
161
+ 93 -44 62 -45 93 -58 191 -82 54 -12 130 -37 168 -54 68 -29 180 -58 226 -59
162
+ 62 0 183 -64 183 -96 0 -12 88 -14 639 -14 l639 0 12 30 c18 44 76 66 233 89
163
+ 89 14 160 30 200 47 34 15 106 42 159 60 54 18 112 44 130 57 47 35 85 52 146
164
+ 67 29 7 76 28 105 48 29 20 77 48 107 63 30 15 66 39 80 54 14 15 50 40 81 56
165
+ 31 15 78 46 104 69 26 22 61 46 79 54 17 7 43 26 56 42 14 16 41 41 60 56 64
166
+ 48 380 362 408 405 15 23 40 51 55 63 15 12 36 38 46 58 11 21 37 57 58 82 22
167
+ 25 49 62 62 83 13 20 38 56 57 78 19 23 50 74 69 113 19 39 46 86 59 104 14
168
+ 18 34 62 46 98 12 36 32 77 45 92 31 38 60 97 80 167 9 33 26 76 37 95 29 50
169
+ 47 103 68 206 10 52 32 117 51 155 29 56 33 74 34 140 0 94 -10 108 -101 138
170
+ -61 20 -83 21 -463 21 -226 0 -421 -4 -451 -10 -63 -12 -86 -30 -110 -85 -10
171
+ -22 -33 -63 -52 -92 -21 -31 -42 -80 -53 -123 -11 -44 -32 -93 -56 -128 -20
172
+ -32 -47 -83 -59 -115 -12 -32 -37 -77 -56 -100 -19 -23 -50 -65 -69 -94 -19
173
+ -29 -44 -57 -54 -63 -11 -5 -29 -27 -42 -47 -52 -85 -234 -277 -300 -315 -25
174
+ -15 -53 -38 -62 -51 -9 -14 -42 -39 -74 -57 -32 -18 -75 -48 -95 -66 -21 -18
175
+ -59 -44 -85 -58 -26 -13 -72 -40 -100 -59 -35 -24 -78 -41 -128 -52 -47 -11
176
+ -99 -31 -139 -56 -69 -42 -94 -49 -391 -110 -245 -51 -425 -66 -595 -50 -168
177
+ 16 -230 27 -330 61 -47 16 -123 35 -170 44 -98 17 -123 25 -172 58 -20 14 -71
178
+ 37 -114 53 -44 15 -95 40 -115 56 -20 16 -70 42 -110 59 -40 16 -88 45 -108
179
+ 63 -20 19 -55 46 -78 61 -24 14 -49 35 -55 47 -7 11 -34 33 -60 49 -50 31 -65
180
+ 61 -53 102 4 13 130 147 281 298 236 238 277 283 299 335 15 32 35 71 46 86
181
+ 12 18 19 44 19 76 0 42 -8 63 -53 138 -92 151 11 139 -1207 141 -798 2 -1030
182
+ 0 -1086 -11z"></path>
183
+ </g>
184
+ </svg>
185
+ `;return ea=e,ea}var ta,dc;function Jv(){if(dc)return ta;dc=1;var e=`
186
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25" class="abcjs-play-svg">
187
+ <g>
188
+ <polygon points="4 0 23 12.5 4 25"/>
189
+ </g>
190
+ </svg>
191
+ `;return ta=e,ta}var ra,pc;function Qv(){if(pc)return ra;pc=1;var e=`
192
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25" class="abcjs-pause-svg">
193
+ <g>
194
+ <rect width="8.23" height="25"/>
195
+ <rect width="8.23" height="25" x="17"/>
196
+ </g>
197
+ </svg>
198
+ `;return ra=e,ra}var na,gc;function e3(){if(gc)return na;gc=1;var e=`
199
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" class="abcjs-loading-svg">
200
+ <circle cx="50" cy="50" fill="none" stroke-width="20" r="35" stroke-dasharray="160 55"></circle>
201
+ </svg>
202
+ `;return na=e,na}var aa,vc;function t3(){if(vc)return aa;vc=1;var e=`
203
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25">
204
+ <g>
205
+ <polygon points="5 12.5 24 0 24 25"/>
206
+ <rect width="3" height="25" x="0" y="0"/>
207
+ </g>
208
+ </svg>
209
+ `;return aa=e,aa}var ia,mc;function nu(){if(mc)return ia;mc=1;var e=_r(),t=wr(),n=Lt(),a=Kv(),r=Jv(),s=Qv(),o=e3(),l=t3();function h(c,u){var i=this;if(typeof c=="string"){var v=c;if(c=document.querySelector(v),!c)throw new Error('Cannot find element "'+v+'" in the DOM.')}else if(!(c instanceof HTMLElement))throw new Error("The first parameter must be a valid element or selector in the DOM.");if(i.parent=c,i.options={},u&&(i.options=Object.assign({},u)),i.options.ac&&t(i.options.ac),g(i.parent,i.options),f(i),i.disable=function(m){var w=i.parent.querySelector(".abcjs-inline-audio");m?w.classList.add("abcjs-disabled"):w.classList.remove("abcjs-disabled")},i.setWarp=function(m,w){var _=i.parent.querySelector(".abcjs-midi-tempo");_.value=Math.round(w),i.setTempo(m)},i.setTempo=function(m){var w=i.parent.querySelector(".abcjs-midi-current-tempo");w&&(w.innerHTML=Math.round(m))},i.resetAll=function(){for(var m=i.parent.querySelectorAll(".abcjs-pushed"),w=0;w<m.length;w++){var _=m[w];_.classList.remove("abcjs-pushed")}},i.pushPlay=function(m){var w=i.parent.querySelector(".abcjs-midi-start");w&&(m?w.classList.add("abcjs-pushed"):w.classList.remove("abcjs-pushed"))},i.pushLoop=function(m){var w=i.parent.querySelector(".abcjs-midi-loop");w&&(m?w.classList.add("abcjs-pushed"):w.classList.remove("abcjs-pushed"))},i.setProgress=function(m,w){var _=i.parent.querySelector(".abcjs-midi-progress-background"),T=i.parent.querySelector(".abcjs-midi-progress-indicator");if(!(!_||!T)){var q=_.clientWidth,I=q*m;T.style.left=I+"px";var E=i.parent.querySelector(".abcjs-midi-clock");if(E){var P=w*m/1e3,x=Math.floor(P/60),M=Math.floor(P%60),N=M<10?"0"+M:M;E.innerHTML=x+":"+N}}},i.options.afterResume){var b=!1;i.options.ac?b=i.options.ac.state!=="suspended":n()&&(b=n().state!=="suspended"),b&&i.options.afterResume()}}function g(c,u){var i=!!u.loopHandler,v=!!u.restartHandler,b=!!u.playHandler||!!u.playPromiseHandler,m=!!u.progressHandler,w=!!u.warpHandler,_=u.hasClock!==!1,T=`<div class="abcjs-inline-audio">
210
+ `;if(i){var q=u.repeatTitle?u.repeatTitle:"Click to toggle play once/repeat.",I=u.repeatAria?u.repeatAria:q;T+='<button type="button" class="abcjs-midi-loop abcjs-btn" title="'+q+'" aria-label="'+I+'">'+a+`</button>
211
+ `}if(v){var E=u.restartTitle?u.restartTitle:"Click to go to beginning.",P=u.restartAria?u.restartAria:E;T+='<button type="button" class="abcjs-midi-reset abcjs-btn" title="'+E+'" aria-label="'+P+'">'+l+`</button>
212
+ `}if(b){var x=u.playTitle?u.playTitle:"Click to play/pause.",M=u.playAria?u.playAria:x;T+='<button type="button" class="abcjs-midi-start abcjs-btn" title="'+x+'" aria-label="'+M+'">'+r+s+o+`</button>
213
+ `}if(m){var N=u.randomTitle?u.randomTitle:"Click to change the playback position.",D=u.randomAria?u.randomAria:N;T+='<button type="button" class="abcjs-midi-progress-background" title="'+N+'" aria-label="'+D+`"><span class="abcjs-midi-progress-indicator"></span></button>
214
+ `}if(_&&(T+=`<span class="abcjs-midi-clock"></span>
215
+ `),w){var k=u.warpTitle?u.warpTitle:"Change the playback speed.",S=u.warpAria?u.warpAria:k,z=u.bpm?u.bpm:"BPM";T+='<span class="abcjs-tempo-wrapper"><label><input class="abcjs-midi-tempo" type="number" min="1" max="300" value="100" title="'+k+'" aria-label="'+S+'">%</label><span>&nbsp;(<span class="abcjs-midi-current-tempo"></span> '+z+`)</span></span>
216
+ `}T+='<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>',T+=`</div>
217
+ `,c.innerHTML=T}function p(c,u,i,v,b){var m=!0;if(n()?m=n().state==="suspended":t(),!e())throw{status:"NotSupported",message:"This browser does not support audio."};(m||b)&&i&&i.classList.add("abcjs-loading"),m?n().resume().then(function(){v?v().then(function(w){d(c,u,i,b)}):d(c,u,i,b)}):d(c,u,i,b)}function d(c,u,i,v){v?c(u).then(function(){i&&i.classList.remove("abcjs-loading")}):(c(u),i&&i.classList.remove("abcjs-loading"))}function f(c){var u=!!c.options.loopHandler,i=!!c.options.restartHandler,v=!!c.options.playHandler||!!c.options.playPromiseHandler,b=!!c.options.progressHandler,m=!!c.options.warpHandler,w=c.parent.querySelector(".abcjs-midi-start");u&&c.parent.querySelector(".abcjs-midi-loop").addEventListener("click",function(_){p(c.options.loopHandler,_,w,c.options.afterResume)}),i&&c.parent.querySelector(".abcjs-midi-reset").addEventListener("click",function(_){p(c.options.restartHandler,_,w,c.options.afterResume)}),v&&w.addEventListener("click",function(_){p(c.options.playPromiseHandler||c.options.playHandler,_,w,c.options.afterResume,!!c.options.playPromiseHandler)}),b&&c.parent.querySelector(".abcjs-midi-progress-background").addEventListener("click",function(_){p(c.options.progressHandler,_,w,c.options.afterResume)}),m&&c.parent.querySelector(".abcjs-midi-tempo").addEventListener("change",function(_){p(c.options.warpHandler,_,w,c.options.afterResume)})}return ia=h,ia}var sa,bc;function r3(){if(bc)return sa;bc=1;var e=ru(),t=ci(),n=Lt();function a(s,o,l,h,g){for(var p=new e,d=0;d<s.length;d++){var f=s[d],c=p.addTrack();if(p.setInstrument(c,f.instrument),d===0&&o)for(var u=0;u<o.length;u++){var i=o[u];p.appendNote(c,i.pitch,1/64,i.volume,i.cents)}p.appendNote(c,f.pitch,f.duration,f.volume,f.cents)}var v=n();return v.state==="suspended"?v.resume().then(function(){return r(p,l,h,g)}):r(p,l,h,g)}function r(s,o,l,h){var g=new t;return g.init({sequence:s,millisecondsPerMeasure:o,options:{soundFontUrl:l},debugCallback:h}).then(function(){return g.prime()}).then(function(){return g.start(),Promise.resolve()})}return sa=a,sa}var oa,yc;function au(){if(yc)return oa;yc=1;var e=nu(),t=ci(),n=Xa(),a=Lt();function r(){var s=this;s.warp=100,s.cursorControl=null,s.visualObj=null,s.timer=null,s.midiBuffer=null,s.options=null,s.currentTempo=null,s.control=null,s.isLooping=!1,s.isStarted=!1,s.isLoaded=!1,s.isLoading=!1,s.load=function(l,h,g){g||(g={}),g.displayPlay===void 0&&(g.displayPlay=!0),g.displayProgress===void 0&&(g.displayProgress=!0),s.control=new e(l,{loopHandler:g.displayLoop?s.toggleLoop:void 0,restartHandler:g.displayRestart?s.restart:void 0,playPromiseHandler:g.displayPlay?s.play:void 0,progressHandler:g.displayProgress?s.randomAccess:void 0,warpHandler:g.displayWarp?s.onWarp:void 0,afterResume:s.init}),s.cursorControl=h,s.disable(!0)},s.disable=function(l){s.control&&s.control.disable(l)},s.setTune=function(l,h,g){return s.visualObj=l,s.disable(!1),s.options=g||{},s.control&&(s.pause(),s.setProgress(0,1),s.control.resetAll(),s.restart(),s.isStarted=!1),s.isLooping=!1,h?s.go():Promise.resolve({status:"no-audio-context"})},s.go=function(){s.isLoading=!0;var l=s.visualObj.millisecondsPerMeasure()*100/s.warp;s.currentTempo=Math.round(s.visualObj.getBeatsPerMeasure()/l*6e4),s.control&&s.control.setTempo(s.currentTempo),s.percent=0;var h;return s.midiBuffer||(s.midiBuffer=new t),a().resume().then(function(g){return s.midiBuffer.init({visualObj:s.visualObj,options:s.options,millisecondsPerMeasure:l})}).then(function(g){return h=g,s.midiBuffer.prime()}).then(function(){var g=16;return s.cursorControl&&s.cursorControl.beatSubdivisions!==void 0&&parseInt(s.cursorControl.beatSubdivisions,10)>=1&&parseInt(s.cursorControl.beatSubdivisions,10)<=64&&(g=parseInt(s.cursorControl.beatSubdivisions,10)),s.timer=new n(s.visualObj,{beatCallback:s.beatCallback,eventCallback:s.eventCallback,lineEndCallback:s.lineEndCallback,qpm:s.currentTempo,extraMeasuresAtBeginning:s.cursorControl?s.cursorControl.extraMeasuresAtBeginning:void 0,lineEndAnticipation:s.cursorControl?s.cursorControl.lineEndAnticipation:0,beatSubdivisions:g}),s.cursorControl&&s.cursorControl.onReady&&typeof s.cursorControl.onReady=="function"&&s.cursorControl.onReady(s),s.isLoaded=!0,s.isLoading=!1,Promise.resolve({status:"created",notesStatus:h})})},s.destroy=function(){s.timer&&(s.timer.reset(),s.timer.stop(),s.timer=null),s.midiBuffer&&(s.midiBuffer.stop(),s.midiBuffer=null),s.setProgress(0,1),s.control&&s.control.resetAll()},s.play=function(){return s.runWhenReady(s._play,void 0)};function o(l){return new Promise(function(h){setTimeout(h,l)})}s.runWhenReady=function(l,h){return s.visualObj?s.isLoading?o(500).then(function(){return s.isLoading?s.runWhenReady(l,h):l(h)}):s.isLoaded?l(h):s.go().then(function(){return l(h)}):Promise.resolve({status:"loading"})},s._play=function(){return a().resume().then(function(){return s.isStarted=!s.isStarted,s.isStarted?(s.cursorControl&&s.cursorControl.onStart&&typeof s.cursorControl.onStart=="function"&&s.cursorControl.onStart(),s.midiBuffer.start(),s.timer.start(s.percent),s.control&&s.control.pushPlay(!0)):s.pause(),Promise.resolve({status:"ok"})})},s.pause=function(){s.timer&&(s.timer.pause(),s.midiBuffer.pause(),s.control&&s.control.pushPlay(!1))},s.toggleLoop=function(){s.isLooping=!s.isLooping,s.control&&s.control.pushLoop(s.isLooping)},s.restart=function(){s.timer&&(s.timer.setProgress(0),s.midiBuffer.seek(0))},s.randomAccess=function(l){return s.runWhenReady(s._randomAccess,l)},s._randomAccess=function(l){var h=l.target.classList.contains("abcjs-midi-progress-indicator")?l.target.parentNode:l.target,g=(l.x-h.getBoundingClientRect().left)/h.offsetWidth;return g<0&&(g=0),g>1&&(g=1),s.seek(g),Promise.resolve({status:"ok"})},s.seek=function(l,h){s.timer&&s.midiBuffer&&(s.timer.setProgress(l,h),s.midiBuffer.seek(l,h))},s.setWarp=function(l){if(parseInt(l,10)>0){s.warp=parseInt(l,10);var h=s.isStarted,g=s.percent;return s.destroy(),s.isStarted=!1,s.go().then(function(){return s.setProgress(g,s.midiBuffer.duration*1e3),s.control&&s.control.setWarp(s.currentTempo,s.warp),h?s.play().then(function(){return s.seek(g),Promise.resolve()}):(s.seek(g),Promise.resolve())})}return Promise.resolve()},s.onWarp=function(l){var h=l.target.value;return s.setWarp(h)},s.setProgress=function(l,h){s.percent=l,s.control&&s.control.setProgress(l,h)},s.finished=function(){if(s.timer.reset(),s.isLooping)return s.timer.start(0),s.midiBuffer.finished(),s.midiBuffer.start(),"continue";s.timer.stop(),s.isStarted&&(s.control&&s.control.pushPlay(!1),s.isStarted=!1,s.midiBuffer.finished(),s.cursorControl&&s.cursorControl.onFinished&&typeof s.cursorControl.onFinished=="function"&&s.cursorControl.onFinished(),s.setProgress(0,1))},s.beatCallback=function(l,h,g,p){var d=l/h;s.setProgress(d,g),s.cursorControl&&s.cursorControl.onBeat&&typeof s.cursorControl.onBeat=="function"&&s.cursorControl.onBeat(l,h,g,p)},s.eventCallback=function(l){if(l)s.cursorControl&&s.cursorControl.onEvent&&typeof s.cursorControl.onEvent=="function"&&s.cursorControl.onEvent(l);else return s.finished()},s.lineEndCallback=function(l,h){s.cursorControl&&s.cursorControl.onLineEnd&&typeof s.cursorControl.onLineEnd=="function"&&s.cursorControl.onLineEnd(l,h)},s.getUrl=function(){return s.midiBuffer.download()},s.download=function(l){var h=s.getUrl(),g=document.createElement("a");document.body.appendChild(g),g.setAttribute("style","display: none;"),g.href=h,g.download=l||"output.wav",g.click(),window.URL.revokeObjectURL(h),document.body.removeChild(g)}}return oa=r,oa}var ca,wc;function iu(){if(wc)return ca;wc=1;var e=tu(),t;return(function(){function n(f,c){for(var u in c)c.hasOwnProperty(u)&&f.setAttribute(u,c[u]);return f}function a(){this.trackstrings="",this.trackcount=0,this.noteOnAndChannel="%90",this.noteOffAndChannel="%80"}a.prototype.setTempo=function(f){this.trackcount===0&&(this.startTrack(),this.track+="%00%FF%51%03"+g(Math.round(6e7/f),6),this.endTrack())},a.prototype.setGlobalInfo=function(f,c,u,i){if(this.trackcount===0){this.startTrack();var v=Math.round(6e7/f);this.track+="%00%FF%51%03"+g(v,6),u&&(this.track+=o(u)),i&&(this.track+=l(i)),c&&(this.track+=s(c,"%01")),this.endTrack()}},a.prototype.startTrack=function(){this.noteWarped={},this.track="",this.trackName="",this.trackInstrument="",this.silencelength=0,this.trackcount++,this.instrument&&this.setInstrument(this.instrument)},a.prototype.endTrack=function(){this.track=this.trackName+this.trackInstrument+this.track;var f=g(this.track.length/3+4,8);this.track="MTrk"+f+this.track+"%00%FF%2F%00",this.trackstrings+=this.track},a.prototype.setText=function(f,c){switch(f){case"name":this.trackName=s(c,"%03");break}},a.prototype.setInstrument=function(f){this.trackInstrument="%00%C0"+g(f,2),this.instrument=f},a.prototype.setChannel=function(f,c){this.channel=f;var u="%00%B"+this.channel.toString(16);this.track+=u+"%79%00",this.track+=u+"%40%00",this.track+=u+"%5B%30",c||(c=0),c=Math.round((c+1)*64),this.track+=u+"%0A"+g(c,2),this.track+=u+"%07%64",this.noteOnAndChannel="%9"+this.channel.toString(16),this.noteOffAndChannel="%8"+this.channel.toString(16)};var r=4096;a.prototype.startNote=function(f,c,u){if(this.track+=d(this.silencelength),this.silencelength=0,u){this.track+="%e"+this.channel.toString(16);var i=Math.round(e(u)*r);this.track+=p(8192+i),this.track+=d(0),this.noteWarped[f]=!0}this.track+=this.noteOnAndChannel,this.track+="%"+f.toString(16)+g(c,2)},a.prototype.endNote=function(f){this.track+=d(this.silencelength),this.silencelength=0,this.noteWarped[f]&&(this.track+="%e"+this.channel.toString(16),this.track+=p(8192),this.track+=d(0),this.noteWarped[f]=!1),this.track+=this.noteOffAndChannel,this.track+="%"+f.toString(16)+"%00"},a.prototype.addRest=function(f){this.silencelength+=f,this.silencelength<0&&(this.silencelength=0)},a.prototype.getData=function(){return"data:audio/midi,MThd%00%00%00%06%00%01"+g(this.trackcount,4)+"%01%e0"+this.trackstrings},a.prototype.embed=function(f,c){var u=this.getData(),i=n(document.createElement("a"),{href:u});if(i.innerHTML="download midi",f.insertBefore(i,f.firstChild),!c){var v=n(document.createElement("embed"),{src:u,type:"video/quicktime",controller:"true",autoplay:"false",loop:"false",enablejavascript:"true",style:"display:block; height: 20px;"});f.insertBefore(v,f.firstChild)}};function s(f,c){for(var u="",i=0;i<f.length;i++)u+=g(f.charCodeAt(i),2);return"%00%FF"+c+g(u.length/3,2)+u}function o(f){if(!f||!f.accidentals)return"";for(var c="%00%FF%59%02",u=0,i=256,v=0;v<f.accidentals.length;v++)f.accidentals[v].acc==="sharp"?u++:f.accidentals[v].acc==="flat"&&i--;var b=g(i!==256?i:u,2),m=f.mode==="m"?"%01":"%00";return c+b+m}function l(f){var c="%00%FF%58%04"+g(f.num,2),u={1:0,2:1,4:2,8:3,16:4,32:5},i=u[f.den];if(!i)return"";c+=g(i,2);var v;switch(f.num+"/"+f.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?(c+=g(v,2),c+"%08"):""}function h(f){for(var c="",u=0;u<f.length;u+=2)c+="%",c+=f.substr(u,2);return c}function g(f,c){var u=f.toString(16);for(u=u.split(".")[0];u.length<c;)u="0"+u;return u.length>c&&(u=u.substring(0,c)),h(u)}function p(f){f=Math.round(f);var c=f%128,u=f-c;return g(u*2+c,4)}function d(f){var c=0,u=[];for(f=Math.round(f);f!==0;)u.push(f&127),f=f>>7;for(var i=u.length-1;i>=0;i--){c=c<<8;var v=u[i];i!==0&&(v=v|128),c=c|v}var b=c.toString(16).length;return b+=b%2,g(c,b)}t=function(){return new a}})(),ca=t,ca}var la,_c;function n3(){if(_c)return la;_c=1;var e=iu(),t;return(function(){var n=1920;t=function(s,o){o===void 0&&(o={});var l=s.setUpAudio(o),h=e(),g=s.metaText?s.metaText.title:void 0;g&&g.length>128&&(g=g.substring(0,124)+"...");var p=s.getKeySignature(),d=s.getMeterFraction(),f=l.tempo,c=f/60;if(d.den===8&&d.num!==5&&d.num!==7){var u=s.millisecondsPerMeasure();f=6e4/(u/d.num)/2,c=f/60}h.setGlobalInfo(f,g,p,d);for(var i=0;i<l.tracks.length;i++){h.startTrack();for(var v={},b=0;b<l.tracks[i].length;b++){var m=l.tracks[i][b];switch(m.cmd){case"text":h.setText(m.type,m.text);break;case"program":var w=0;o.pan&&o.pan.length>i&&(w=o.pan[i]),m.instrument===128?(h.setChannel(9,w),h.setInstrument(0)):(h.setChannel(m.channel,w),h.setInstrument(m.instrument));break;case"note":var _=m.gap*c,T=m.start,q=T+m.duration-_;v[T]||(v[T]=[]),v[T].push({pitch:m.pitch,volume:m.volume,cents:m.cents}),v[q]||(v[q]=[]),v[q].push({pitch:m.pitch,volume:0});break;default:console.log("MIDI create Unknown: "+m.cmd)}}a(h,v,n),h.endTrack()}return h.getData()};function a(r,s,o){for(var l=Object.keys(s),h=0;h<l.length;h++)l[h]=parseFloat(l[h]);l.sort(function(i,v){return i-v});for(var g=0,p=0;p<l.length;p++){var d=s[l[p]];if(l[p]>g){var f=(l[p]-g)*o;r.addRest(f),g=l[p]}for(var c=0;c<d.length;c++){var u=d[c];u.volume?r.startNote(u.pitch,u.volume,u.cents):r.endNote(u.pitch)}}}})(),la=t,la}var ua,kc;function a3(){if(kc)return ua;kc=1;var e=yr(),t=n3(),n=function(s,o){var l={};if(o)for(var h in o)o.hasOwnProperty(h)&&(l[h]=o[h]);l.generateInline=!1;function g(p,d,f){var c=t(d,l);switch(l.midiOutputType){case"encoded":return c;case"binary":var u=c.replace("data:audio/midi,","");u=u.replace(/MThd/g,"%4d%54%68%64"),u=u.replace(/MTrk/g,"%4d%54%72%6b");for(var i=new ArrayBuffer(u.length/3),v=new Uint8Array(i),b=0;b<u.length/3;b++){var m=b*3+1,w=parseInt(u.substring(m,m+2),16);v[b]=w}return v;case"link":default:return r(d,l,c,f)}}return typeof s=="string"?e.renderEngine(g,"*",s,l):g(null,s,0)};function a(s){var o={};return s&&o.toString.call(s)==="[object Function]"}var r=function(s,o,l,h){var g=["abcjs-download-midi","abcjs-midi-"+h];o.downloadClass&&g.push(o.downloadClass);var p='<div class="'+g.join(" ")+'">';o.preTextDownload&&(p+=o.preTextDownload);var d=s.metaText&&s.metaText.title?s.metaText.title:"Untitled",f;o.downloadLabel&&a(o.downloadLabel)?f=o.downloadLabel(s,h):o.downloadLabel?f=o.downloadLabel.replace(/%T/,d):f='Download MIDI for "'+d+'"',d=d.toLowerCase().replace(/'/g,"").replace(/\W/g,"_").replace(/__/g,"_");var c=o.fileName?o.fileName:d+".midi";return p+='<a download="'+c+'" href="'+l+'">'+f+"</a>",o.postTextDownload&&(p+=o.postTextDownload),p+"</div>"};return ua=n,ua}var ha,xc;function su(){if(xc)return ha;xc=1;try{if(typeof window.CustomEvent!="function"){var e=function(n,a){a=a||{bubbles:!1,cancelable:!1,detail:void 0};var r=document.createEvent("CustomEvent");return r.initCustomEvent(n,a.bubbles,a.cancelable,a.detail),r};e.prototype=window.Event.prototype,window.CustomEvent=e}}catch{}var t=function(n){this.isEditArea=!0,typeof n=="string"?(this.textarea=document.getElementById(n),this.textarea||(this.textarea=document.querySelector(n))):this.textarea=n,this.initialText=this.textarea.value,this.isDragging=!1};return t.prototype.addSelectionListener=function(n){this.textarea.onmousemove=function(a){this.isDragging&&n.fireSelectionChanged()}},t.prototype.addChangeListener=function(n){this.changelistener=n,this.textarea.onkeyup=function(){n.fireChanged()},this.textarea.onmousedown=function(){this.isDragging=!0,n.fireSelectionChanged()},this.textarea.onmouseup=function(){this.isDragging=!1,n.fireChanged()},this.textarea.onchange=function(){n.fireChanged()}},t.prototype.getSelection=function(){return{start:this.textarea.selectionStart,end:this.textarea.selectionEnd}},t.prototype.setSelection=function(n,a){if(this.textarea.setSelectionRange)this.textarea.setSelectionRange(n,a);else if(this.textarea.createTextRange){var r=this.textarea.createTextRange();r.collapse(!0),r.moveEnd("character",a),r.moveStart("character",n),r.select()}this.textarea.focus()},t.prototype.getString=function(){return this.textarea.value},t.prototype.setString=function(n){this.textarea.value=n,this.initialText=this.getString(),this.changelistener&&this.changelistener.fireChanged()},t.prototype.getElem=function(){return this.textarea},ha=t,ha}var fa,Cc;function i3(){if(Cc)return fa;Cc=1;var e=at(),t=au(),n=_r(),a=eu(),r=su();function s(l){var h={},g;if(l.abcjsParams)for(g in l.abcjsParams)l.abcjsParams.hasOwnProperty(g)&&(h[g]=l.abcjsParams[g]);if(l.midi_options)for(g in l.midi_options)l.midi_options.hasOwnProperty(g)&&(h[g]=l.midi_options[g]);if(l.parser_options)for(g in l.parser_options)l.parser_options.hasOwnProperty(g)&&(h[g]=l.parser_options[g]);if(l.render_options)for(g in l.render_options)l.render_options.hasOwnProperty(g)&&(h[g]=l.render_options[g]);return h.tablature&&l.warnings_id&&(h.tablature.warnings_id=l.warnings_id),h}var o=function(l,h){this.abcjsParams=s(h),h.indicate_changed&&(this.indicate_changed=!0),typeof l=="string"?this.editarea=new r(l):l.isEditArea?this.editarea=l:this.editarea=new r(l),this.editarea.addSelectionListener(this),this.editarea.addChangeListener(this),h.canvas_id?this.div=h.canvas_id:h.paper_id?this.div=h.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)),h.selectionChangeCallback&&(this.selectionChangeCallback=h.selectionChangeCallback),this.clientClickListener=this.abcjsParams.clickListener,this.abcjsParams.clickListener=this.highlight.bind(this),h.synth&&n()&&(this.synth={el:h.synth.el,cursorControl:h.synth.cursorControl,options:h.synth.options}),h.generate_midi&&(this.generate_midi=h.generate_midi,this.abcjsParams.generateDownload&&(typeof h.midi_download_id=="string"?this.downloadMidi=document.getElementById(h.midi_download_id):h.midi_download_id&&(this.downloadMidi=h.midi_download_id)),this.abcjsParams.generateInline!==!1&&(typeof h.midi_id=="string"?this.inlineMidi=document.getElementById(h.midi_id):h.midi_id&&(this.inlineMidi=h.midi_id))),h.warnings_id?typeof h.warnings_id=="string"?this.warningsdiv=document.getElementById(h.warnings_id):this.warningsdiv=h.warnings_id:h.generate_warnings&&(this.warningsdiv=document.createElement("div"),this.div.parentNode.insertBefore(this.warningsdiv,this.div)),this.onchangeCallback=h.onchange,this.redrawCallback=h.redrawCallback,this.currentAbc="",this.tunes=[],this.bReentry=!1,this.parseABC(),this.modelChanged(),this.addClassName=function(g,p){var d=function(f,c){var u=f.className;return u.length>0&&(u===c||new RegExp("(^|\\s)"+c+"(\\s|$)").test(u))};return d(g,p)||(g.className+=(g.className?" ":"")+p),g},this.removeClassName=function(g,p){return g.className=e.strip(g.className.replace(new RegExp("(^|\\s+)"+p+"(\\s+|$)")," ")),g},this.setReadOnly=function(g){var p="abc_textarea_readonly",d=this.editarea.getElem();g?(d.setAttribute("readonly","yes"),this.addClassName(d,p)):(d.removeAttribute("readonly"),this.removeClassName(d,p))}};return o.prototype.redrawMidi=function(){if(this.generate_midi&&!this.midiPause){var l=new window.CustomEvent("generateMidi",{detail:{tunes:this.tunes,abcjsParams:this.abcjsParams,downloadMidiEl:this.downloadMidi,inlineMidiEl:this.inlineMidi,engravingEl:this.div}});window.dispatchEvent(l)}if(this.synth){var h=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],h,this.synth.options)}},o.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=a(this.div,this.currentAbc,this.abcjsParams),this.tunes.length>0&&(this.warnings=this.tunes[0].warnings),this.redrawMidi(),this.redrawCallback&&this.redrawCallback(!1)}catch(l){console.error("ABCJS error: ",l),this.warnings||(this.warnings=[]),this.warnings.push(l.message)}this.warningsdiv&&(this.warningsdiv.innerHTML=this.warnings?this.warnings.join("<br />"):"No errors"),this.updateSelection(),this.bReentry=!1}},o.prototype.paramChanged=function(l){if(l)for(var h in l)l.hasOwnProperty(h)&&(this.abcjsParams[h]=l[h]);this.currentAbc="",this.fireChanged()},o.prototype.getTunes=function(){return this.tunes},o.prototype.synthParamChanged=function(l){if(this.synth){if(this.synth.options={},l)for(var h in l)l.hasOwnProperty(h)&&(this.synth.options[h]=l[h]);this.currentAbc="",this.fireChanged()}},o.prototype.parseABC=function(){var l=this.editarea.getString();return l===this.currentAbc?(this.updateSelection(),!1):(this.currentAbc=l,!0)},o.prototype.updateSelection=function(){var l=this.editarea.getSelection();try{this.tunes.length>0&&this.tunes[0].engraver&&this.tunes[0].engraver.rangeHighlight(l.start,l.end)}catch{}this.selectionChangeCallback&&this.selectionChangeCallback(l.start,l.end)},o.prototype.fireSelectionChanged=function(){this.updateSelection()},o.prototype.setDirtyStyle=function(l){if(this.indicate_changed!==void 0){var h=function(f,c){var u=function(i,v){var b=i.className;return b.length>0&&(b===v||new RegExp("(^|\\s)"+v+"(\\s|$)").test(b))};return u(f,c)||(f.className+=(f.className?" ":"")+c),f},g=function(f,c){return f.className=e.strip(f.className.replace(new RegExp("(^|\\s+)"+c+"(\\s+|$)")," ")),f},p="abc_textarea_dirty",d=this.editarea.getElem();l?h(d,p):g(d,p)}},o.prototype.fireChanged=function(){if(!this.bIsPaused&&this.parseABC()){var l=this;this.timerId&&clearTimeout(this.timerId),this.timerId=setTimeout(function(){l.modelChanged()},300);var h=this.isDirty();this.wasDirty!==h&&(this.wasDirty=h,this.setDirtyStyle(h)),this.onchangeCallback&&this.onchangeCallback(this)}},o.prototype.setNotDirty=function(){this.editarea.initialText=this.editarea.getString(),this.wasDirty=!1,this.setDirtyStyle(!1)},o.prototype.isDirty=function(){return this.indicate_changed===void 0?!1:this.editarea.initialText!==this.editarea.getString()},o.prototype.highlight=function(l,h,g,p,d,f){this.editarea.setSelection(l.startChar,l.endChar),this.selectionChangeCallback&&this.selectionChangeCallback(l.startChar,l.endChar),this.clientClickListener&&this.clientClickListener(l,h,g,p,d,f)},o.prototype.pause=function(l){this.bIsPaused=l,l||this.fireChanged()},o.prototype.millisecondsPerMeasure=function(){return!this.synth||!this.synth.synthControl||!this.synth.synthControl.visualObj?0:this.synth.synthControl.visualObj.millisecondsPerMeasure()},o.prototype.pauseMidi=function(l){this.midiPause=l,l||this.redrawMidi()},fa=o,fa}var da,Sc;function s3(){if(Sc)return da;Sc=1;var e=_g(),t=kg(),n=yr(),a=Bl(),r=Hg(),s={};s.signature="abcjs-basic v"+e,Object.keys(t).forEach(function(w){s[w]=t[w]}),Object.keys(n).forEach(function(w){s[w]=n[w]}),s.renderAbc=eu(),s.tuneMetrics=Uv(),s.TimingCallbacks=Xa();var o=vt();s.setGlyph=o.setSymbol,s.strTranspose=r;var l=ci(),h=si(),g=oi(),p=ru(),d=nu(),f=wr(),c=Lt(),u=_r(),i=r3(),v=au(),b=a3(),m=iu();return s.synth={CreateSynth:l,instrumentIndexToName:h,pitchToNoteName:g,SynthController:v,SynthSequence:p,CreateSynthControl:d,registerAudioContext:f,activeAudioContext:c,supportsAudio:u,playEvent:i,getMidiFile:b,sequence:a,midiRenderer:m},s.Editor=i3(),s.EditArea=su(),da=s,da}var o3=s3();const ar=wg(o3),ou="Acoustic Grand Piano",c3="",$t={"Acoustic Grand Piano":0,"Bright Acoustic Piano":1,"Electric Piano":4,Harpsichord:6,Celesta:8,"Music Box":10,Vibraphone:11,Marimba:12,Xylophone:13,"Church Organ":19,Accordion:21,Harmonica:22,"Acoustic Guitar (Nylon)":24,"Acoustic Guitar (Steel)":25,"Electric Guitar (Clean)":27,"Acoustic Bass":32,Violin:40,Viola:41,Cello:42,"String Ensemble":48,Trumpet:56,Trombone:57,"French Horn":60,"Alto Sax":65,"Tenor Sax":66,Oboe:68,Clarinet:71,Flute:73,"Pan Flute":75,"Steel Drums":114},li={rock:["%%MIDI drumon","%%MIDI drum dddd 36 42 38 42 90 70 100 70","%%MIDI gchord fzcz","%%MIDI chordprog 27","%%MIDI bassprog 33","%%MIDI chordvol 70","%%MIDI bassvol 85"].join(`
218
+ `),jazz:["%%MIDI drumon","%%MIDI drum dzddzd 51 0 51 51 0 42 80 0 60 80 0 50","%%MIDI gchord fzcz","%%MIDI chordprog 0","%%MIDI bassprog 32","%%MIDI chordvol 65","%%MIDI bassvol 80"].join(`
219
+ `),bossa:["%%MIDI drumon","%%MIDI drum dddddddd 36 76 38 76 36 76 38 76 80 50 70 50 80 50 70 50","%%MIDI gchord fzcfzc","%%MIDI chordprog 24","%%MIDI bassprog 32","%%MIDI chordvol 65","%%MIDI bassvol 85"].join(`
220
+ `),waltz:["%%MIDI drumon","%%MIDI drum dzz 36 0 0 90 0 0","%%MIDI gchord fcc","%%MIDI chordprog 0","%%MIDI bassprog 32","%%MIDI chordvol 70","%%MIDI bassvol 80"].join(`
221
+ `),march:["%%MIDI drumon","%%MIDI drum dddd 38 38 38 38 100 60 80 60","%%MIDI gchord fzcz","%%MIDI chordprog 56","%%MIDI bassprog 32","%%MIDI chordvol 75","%%MIDI bassvol 85"].join(`
222
+ `),reggae:["%%MIDI drumon","%%MIDI drum zdzd 0 42 0 38 0 60 0 90","%%MIDI gchord zcfz","%%MIDI chordprog 27","%%MIDI bassprog 33","%%MIDI chordvol 65","%%MIDI bassvol 90"].join(`
223
+ `),folk:["%%MIDI drumon","%%MIDI drum dzzz 36 0 0 0 50 0 0 0","%%MIDI gchord fzcz","%%MIDI chordprog 25","%%MIDI bassprog 32","%%MIDI chordvol 70","%%MIDI bassvol 75"].join(`
224
+ `),classical:["%%MIDI gchord fzcz","%%MIDI chordprog 48","%%MIDI bassprog 42","%%MIDI chordvol 65","%%MIDI bassvol 75"].join(`
225
+ `)};function ui(e){return e in li}function l3(e){if(e in $t)return e;const t=e.toLowerCase();return Object.keys($t).find(n=>n.toLowerCase()===t||n.toLowerCase().includes(t))}function u3(e){return{instrument:(e.instrument?l3(e.instrument):void 0)??ou,style:e.style&&ui(e.style)?e.style:c3}}function cu(e,t){if(!t||!ui(t))return e;const n=li[t],a=e.match(/^(K:[^\n]*\n)/m);if(a&&a.index!==void 0){const r=a.index+a[0].length;return e.slice(0,r)+n+`
226
+ `+e.slice(r)}return n+`
227
+ `+e}function h3(e,t){let n=e;t.tempo!==void 0&&(n=n.replace(/^Q:[^\n]*\n?/m,""));const a=[];return t.tempo!==void 0&&a.push(`Q:1/4=${t.tempo}`),t.transpose!==void 0&&a.push(`%%MIDI transpose ${t.transpose}`),a.length===0?n:/(K:[^\n]*\n)/m.test(n)?n.replace(/(K:[^\n]*\n)/m,`$1${a.join(`
228
+ `)}
229
+ `):`${a.join(`
230
+ `)}
231
+ ${n}`}function f3(e){const t=u3(e),n={};return e.swing!==void 0&&(n.swing=e.swing),{...t,abcNotation:e.abcNotation?h3(e.abcNotation,e):void 0,synthOptions:n}}const ye={visualObj:null,synthControl:null,currentInstrument:ou,currentStyle:"",currentAbc:null,highlightedEls:[]},nr=document.querySelector(".main"),Tc=document.getElementById("status"),At=document.getElementById("sheet-music"),pa=document.getElementById("audio-controls"),lu=document.getElementById("instrument-selector"),uu=document.getElementById("style-selector"),hu=document.getElementById("toolbar");"audioSession"in navigator&&(navigator.audioSession.type="playback");const d3={onEvent(e){if(ye.highlightedEls.forEach(t=>t.classList.remove("note-playing")),ye.highlightedEls=[],!!e.elements){for(const t of e.elements)for(const n of t)n.classList.add("note-playing"),ye.highlightedEls.push(n);ye.highlightedEls.length>0&&ye.highlightedEls[0].scrollIntoView({behavior:"smooth",block:"nearest"})}},onFinished(){ye.highlightedEls.forEach(e=>e.classList.remove("note-playing")),ye.highlightedEls=[]}},_t=document.createElement("select");_t.id="instrument-select";_t.className="control-select";for(const e of Object.keys($t)){const t=document.createElement("option");t.value=e,t.textContent=e,e===ye.currentInstrument&&(t.selected=!0),_t.appendChild(t)}_t.addEventListener("change",()=>{ye.currentInstrument=_t.value,ye.visualObj&&ye.synthControl&&p3()});async function p3(){var e;if(!(!ye.synthControl||!((e=ye.visualObj)!=null&&e[0])))try{const n={program:$t[ye.currentInstrument]??0};await ye.synthControl.setTune(ye.visualObj[0],!1,n)}catch(t){console.error("Failed to apply settings:",t)}}const kr=document.createElement("label");kr.className="control-label";kr.htmlFor="instrument-select";kr.textContent="Instrument";lu.appendChild(kr);lu.appendChild(_t);const ot=document.createElement("select");ot.id="style-select";ot.className="control-select";const hi=document.createElement("option");hi.value="";hi.textContent="No style (melody only)";ot.appendChild(hi);for(const e of Object.keys(li)){const t=document.createElement("option");t.value=e,t.textContent=e.charAt(0).toUpperCase()+e.slice(1),ot.appendChild(t)}ot.addEventListener("change",()=>{ye.currentStyle=ot.value,ye.currentAbc&&fu(ye.currentAbc)});const xr=document.createElement("label");xr.className="control-label";xr.htmlFor="style-select";xr.textContent="Style";uu.appendChild(xr);uu.appendChild(ot);let ir=null;const Jt=document.createElement("button");Jt.className="toolbar-btn";Jt.textContent="⛶";Jt.title="Toggle fullscreen";Jt.addEventListener("click",()=>{ir==null||ir.requestDisplayMode({mode:"fullscreen"})});hu.appendChild(Jt);function It(e,t=!1){Tc.textContent=e,Tc.classList.toggle("error",t)}async function fu(e,t){try{It("Rendering..."),ye.synthControl&&ye.synthControl.pause(),ye.currentAbc=e,At.innerHTML="",pa.innerHTML="";const n=cu(e,ye.currentStyle);if(ye.visualObj=ar.renderAbc(At,n,{responsive:"resize",add_classes:!0}),!ye.visualObj||ye.visualObj.length===0)throw new Error("Failed to parse music notation");if(!ar.synth.supportsAudio())throw new Error("Audio not supported in this browser");ye.synthControl=new ar.synth.SynthController,ye.synthControl.load(pa,d3,{displayLoop:!0,displayPlay:!0,displayProgress:!0,displayWarp:!0});const r={program:$t[ye.currentInstrument]??0,...t};await ye.synthControl.setTune(ye.visualObj[0],!1,r),hu.classList.add("visible"),It("Ready to play!")}catch(n){console.error("Render error:",n),It(`Error: ${n.message}`,!0),pa.innerHTML=""}}const kt=new yg({name:"Music Studio",version:"0.1.0"});ir=kt;kt.ontoolinput=e=>{console.info("Received tool input:",e);const t=f3(e.arguments??{});ye.currentInstrument=t.instrument,_t.value=t.instrument,ye.currentStyle=t.style,ot.value=t.style,t.abcNotation?fu(t.abcNotation,t.synthOptions).catch(console.error):It("No ABC notation provided",!0)};let ga=null,Ec="";kt.ontoolinputpartial=e=>{var a,r;const t=(a=e.arguments)==null?void 0:a.abcNotation;if(!t)return;ye.currentAbc=t;const n=(r=e.arguments)==null?void 0:r.style;if(n&&ui(n)&&ye.currentStyle!==n&&(ye.currentStyle=n,ot.value=n),!t.match(/K:[^\n]+/)){It("Composing...");return}t!==Ec&&(Ec=t,ga&&clearTimeout(ga),ga=setTimeout(()=>{try{const s=cu(t,ye.currentStyle);ar.renderAbc(At,s,{responsive:"resize",add_classes:!0}),At.scrollTop=At.scrollHeight;const o=At.closest(".sheet-section");o&&(o.scrollTop=o.scrollHeight),It("Composing...")}catch{}},150))};kt.onerror=console.error;function du(e){e.safeAreaInsets&&(nr.style.paddingTop=`${e.safeAreaInsets.top}px`,nr.style.paddingRight=`${e.safeAreaInsets.right}px`,nr.style.paddingBottom=`${e.safeAreaInsets.bottom}px`,nr.style.paddingLeft=`${e.safeAreaInsets.left}px`)}kt.onhostcontextchanged=du;kt.connect().then(()=>{const e=kt.getHostContext();e&&du(e)});</script>
232
+ <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}.header{display:flex;flex-direction:column;gap:6px}#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)}.toolbar{display:none;flex-wrap:wrap;gap:8px}.toolbar.visible{display:flex}.toolbar-group{display:flex;align-items:center;gap:6px;flex:1;min-width:140px}.control-label{font-size:.75rem;color:var(--color-text-muted);white-space:nowrap;text-transform:uppercase;letter-spacing:.05em}.control-select{flex:1;padding:5px 8px;border:1px solid var(--color-border);border-radius:6px;background:var(--color-card-bg);color:var(--color-text);font-size:.8125rem;cursor:pointer;min-width:0}.control-select:focus{outline:2px solid var(--color-primary);outline-offset:-1px}.toolbar-btn{padding:5px 10px;border:1px solid var(--color-border);border-radius:6px;background:var(--color-card-bg);color:var(--color-text);font-size:1rem;cursor:pointer;line-height:1}.toolbar-btn:hover{background:var(--color-border)}.note-playing path,.note-playing circle,.note-playing ellipse,.note-playing polygon{fill:var(--color-primary)!important;transition:fill .08s ease}.note-playing path[stroke]{stroke:var(--color-primary)!important}.sheet-section{background:var(--color-card-bg);border-radius:8px;padding:16px;border:1px solid var(--color-border);min-height:200px;max-height:80vh;overflow-y:auto;scroll-behavior:smooth}.sheet-section .sheet-music-container{width:100%;overflow-x:auto}</style>
233
+ </head>
234
+ <body>
235
+ <main class="main">
236
+ <header class="header">
237
+ <div id="audio-controls" class="audio-controls abcjs-large">
238
+ <!-- SynthController will inject audio controls here -->
239
+ </div>
240
+ <div id="toolbar" class="toolbar">
241
+ <div id="style-selector" class="toolbar-group"></div>
242
+ <div id="instrument-selector" class="toolbar-group"></div>
243
+ </div>
244
+ <span id="status" class="status">Waiting for notation...</span>
245
+ </header>
246
+
247
+ <section class="sheet-section">
248
+ <div id="sheet-music" class="sheet-music-container">
249
+ <!-- ABC notation will be rendered here by abcjs -->
250
+ </div>
251
+ </section>
252
+ </main>
253
+
254
+ </body>
255
+ </html>