opensheetmusicdisplay.min.js 1.1 MB

123
  1. /*! For license information please see opensheetmusicdisplay.min.js.LICENSE.txt */
  2. !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.opensheetmusicdisplay=e():t.opensheetmusicdisplay=e()}(this,(()=>(()=>{var t={5733:(t,e,i)=>{t.exports=function t(e,i,s){function n(o,a){if(!i[o]){if(!e[o]){if(r)return r(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var h=i[o]={exports:{}};e[o][0].call(h.exports,(function(t){return n(e[o][1][t]||t)}),h,h.exports,t,e,i,s)}return i[o].exports}for(var r=void 0,o=0;o<s.length;o++)n(s[o]);return n}({1:[function(t,e,i){"use strict";var s=t("./utils"),n=t("./support"),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i.encode=function(t){for(var e,i,n,o,a,l,h,c=[],u=0,d=t.length,f=d,m="string"!==s.getTypeOf(t);u<t.length;)f=d-u,n=m?(e=t[u++],i=u<d?t[u++]:0,u<d?t[u++]:0):(e=t.charCodeAt(u++),i=u<d?t.charCodeAt(u++):0,u<d?t.charCodeAt(u++):0),o=e>>2,a=(3&e)<<4|i>>4,l=1<f?(15&i)<<2|n>>6:64,h=2<f?63&n:64,c.push(r.charAt(o)+r.charAt(a)+r.charAt(l)+r.charAt(h));return c.join("")},i.decode=function(t){var e,i,s,o,a,l,h=0,c=0,u="data:";if(t.substr(0,u.length)===u)throw new Error("Invalid base64 input, it looks like a data url.");var d,f=3*(t=t.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(t.charAt(t.length-1)===r.charAt(64)&&f--,t.charAt(t.length-2)===r.charAt(64)&&f--,f%1!=0)throw new Error("Invalid base64 input, bad content length.");for(d=n.uint8array?new Uint8Array(0|f):new Array(0|f);h<t.length;)e=r.indexOf(t.charAt(h++))<<2|(o=r.indexOf(t.charAt(h++)))>>4,i=(15&o)<<4|(a=r.indexOf(t.charAt(h++)))>>2,s=(3&a)<<6|(l=r.indexOf(t.charAt(h++))),d[c++]=e,64!==a&&(d[c++]=i),64!==l&&(d[c++]=s);return d}},{"./support":30,"./utils":32}],2:[function(t,e,i){"use strict";var s=t("./external"),n=t("./stream/DataWorker"),r=t("./stream/Crc32Probe"),o=t("./stream/DataLengthProbe");function a(t,e,i,s,n){this.compressedSize=t,this.uncompressedSize=e,this.crc32=i,this.compression=s,this.compressedContent=n}a.prototype={getContentWorker:function(){var t=new n(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),e=this;return t.on("end",(function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new n(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(t,e,i){return t.pipe(new r).pipe(new o("uncompressedSize")).pipe(e.compressWorker(i)).pipe(new o("compressedSize")).withStreamInfo("compression",e)},e.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,i){"use strict";var s=t("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},i.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,i){"use strict";var s=t("./utils"),n=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var s=0;s<8;s++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==s.getTypeOf(t)?function(t,e,i,s){var r=n,o=0+i;t^=-1;for(var a=0;a<o;a++)t=t>>>8^r[255&(t^e[a])];return-1^t}(0|e,t,t.length):function(t,e,i,s){var r=n,o=0+i;t^=-1;for(var a=0;a<o;a++)t=t>>>8^r[255&(t^e.charCodeAt(a))];return-1^t}(0|e,t,t.length):0}},{"./utils":32}],5:[function(t,e,i){"use strict";i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(t,e,i){"use strict";var s;s="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:s}},{lie:37}],7:[function(t,e,i){"use strict";var s="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,n=t("pako"),r=t("./utils"),o=t("./stream/GenericWorker"),a=s?"uint8array":"array";function l(t,e){o.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}i.magic="\b\0",r.inherits(l,o),l.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(r.transformTo(a,t.data),!1)},l.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new n[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},i.compressWorker=function(t){return new l("Deflate",t)},i.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,i){"use strict";function s(t,e){var i,s="";for(i=0;i<e;i++)s+=String.fromCharCode(255&t),t>>>=8;return s}function n(t,e,i,n,o,c){var u,d,f=t.file,m=t.compression,p=c!==a.utf8encode,b=r.transformTo("string",c(f.name)),g=r.transformTo("string",a.utf8encode(f.name)),S=f.comment,y=r.transformTo("string",c(S)),E=r.transformTo("string",a.utf8encode(S)),v=g.length!==f.name.length,x=E.length!==S.length,_="",M="",w="",P=f.dir,T=f.date,L={crc32:0,compressedSize:0,uncompressedSize:0};e&&!i||(L.crc32=t.crc32,L.compressedSize=t.compressedSize,L.uncompressedSize=t.uncompressedSize);var A=0;e&&(A|=8),p||!v&&!x||(A|=2048);var C=0,I=0;P&&(C|=16),"UNIX"===o?(I=798,C|=function(t,e){var i=t;return t||(i=e?16893:33204),(65535&i)<<16}(f.unixPermissions,P)):(I=20,C|=function(t){return 63&(t||0)}(f.dosPermissions)),u=T.getUTCHours(),u<<=6,u|=T.getUTCMinutes(),u<<=5,u|=T.getUTCSeconds()/2,d=T.getUTCFullYear()-1980,d<<=4,d|=T.getUTCMonth()+1,d<<=5,d|=T.getUTCDate(),v&&(M=s(1,1)+s(l(b),4)+g,_+="up"+s(M.length,2)+M),x&&(w=s(1,1)+s(l(y),4)+E,_+="uc"+s(w.length,2)+w);var R="";return R+="\n\0",R+=s(A,2),R+=m.magic,R+=s(u,2),R+=s(d,2),R+=s(L.crc32,4),R+=s(L.compressedSize,4),R+=s(L.uncompressedSize,4),R+=s(b.length,2),R+=s(_.length,2),{fileRecord:h.LOCAL_FILE_HEADER+R+b+_,dirRecord:h.CENTRAL_FILE_HEADER+s(I,2)+R+s(y.length,2)+"\0\0\0\0"+s(C,4)+s(n,4)+b+_+y}}var r=t("../utils"),o=t("../stream/GenericWorker"),a=t("../utf8"),l=t("../crc32"),h=t("../signature");function c(t,e,i,s){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=i,this.encodeFileName=s,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(c,o),c.prototype.push=function(t){var e=t.meta.percent||0,i=this.entriesCount,s=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,o.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:i?(e+100*(i-s-1))/i:100}}))},c.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var i=n(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:i.fileRecord,meta:{percent:0}})}else this.accumulate=!0},c.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,i=n(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(i.dirRecord),e)this.push({data:function(t){return h.DATA_DESCRIPTOR+s(t.crc32,4)+s(t.compressedSize,4)+s(t.uncompressedSize,4)}(t),meta:{percent:100}});else for(this.push({data:i.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},c.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e<this.dirRecords.length;e++)this.push({data:this.dirRecords[e],meta:{percent:100}});var i=this.bytesWritten-t,n=function(t,e,i,n,o){var a=r.transformTo("string",o(n));return h.CENTRAL_DIRECTORY_END+"\0\0\0\0"+s(t,2)+s(t,2)+s(e,4)+s(i,4)+s(a.length,2)+a}(this.dirRecords.length,i,t,this.zipComment,this.encodeFileName);this.push({data:n,meta:{percent:100}})},c.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},c.prototype.registerPrevious=function(t){this._sources.push(t);var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.closedSource(e.previous.streamInfo),e._sources.length?e.prepareNextSource():e.end()})),t.on("error",(function(t){e.error(t)})),this},c.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},c.prototype.error=function(t){var e=this._sources;if(!o.prototype.error.call(this,t))return!1;for(var i=0;i<e.length;i++)try{e[i].error(t)}catch(t){}return!0},c.prototype.lock=function(){o.prototype.lock.call(this);for(var t=this._sources,e=0;e<t.length;e++)t[e].lock()},e.exports=c},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,e,i){"use strict";var s=t("../compressions"),n=t("./ZipFileWorker");i.generateWorker=function(t,e,i){var r=new n(e.streamFiles,i,e.platform,e.encodeFileName),o=0;try{t.forEach((function(t,i){o++;var n=function(t,e){var i=t||e,n=s[i];if(!n)throw new Error(i+" is not a valid compression method !");return n}(i.options.compression,e.compression),a=i.options.compressionOptions||e.compressionOptions||{},l=i.dir,h=i.date;i._compressWorker(n,a).withStreamInfo("file",{name:t,dir:l,date:h,comment:i.comment||"",unixPermissions:i.unixPermissions,dosPermissions:i.dosPermissions}).pipe(r)})),r.entriesCount=o}catch(t){r.error(t)}return r}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,e,i){"use strict";function s(){if(!(this instanceof s))return new s;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var t=new s;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t}}(s.prototype=t("./object")).loadAsync=t("./load"),s.support=t("./support"),s.defaults=t("./defaults"),s.version="3.10.1",s.loadAsync=function(t,e){return(new s).loadAsync(t,e)},s.external=t("./external"),e.exports=s},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,e,i){"use strict";var s=t("./utils"),n=t("./external"),r=t("./utf8"),o=t("./zipEntries"),a=t("./stream/Crc32Probe"),l=t("./nodejsUtils");function h(t){return new n.Promise((function(e,i){var s=t.decompressed.getContentWorker().pipe(new a);s.on("error",(function(t){i(t)})).on("end",(function(){s.streamInfo.crc32!==t.decompressed.crc32?i(new Error("Corrupted zip : CRC32 mismatch")):e()})).resume()}))}e.exports=function(t,e){var i=this;return e=s.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:r.utf8decode}),l.isNode&&l.isStream(t)?n.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):s.prepareContent("the loaded zip file",t,!0,e.optimizedBinaryString,e.base64).then((function(t){var i=new o(e);return i.load(t),i})).then((function(t){var i=[n.Promise.resolve(t)],s=t.files;if(e.checkCRC32)for(var r=0;r<s.length;r++)i.push(h(s[r]));return n.Promise.all(i)})).then((function(t){for(var n=t.shift(),r=n.files,o=0;o<r.length;o++){var a=r[o],l=a.fileNameStr,h=s.resolve(a.fileNameStr);i.file(h,a.decompressed,{binary:!0,optimizedBinaryString:!0,date:a.date,dir:a.dir,comment:a.fileCommentStr.length?a.fileCommentStr:null,unixPermissions:a.unixPermissions,dosPermissions:a.dosPermissions,createFolders:e.createFolders}),a.dir||(i.file(h).unsafeOriginalName=l)}return n.zipComment.length&&(i.comment=n.zipComment),i}))}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,e,i){"use strict";var s=t("../utils"),n=t("../stream/GenericWorker");function r(t,e){n.call(this,"Nodejs stream input adapter for "+t),this._upstreamEnded=!1,this._bindStream(e)}s.inherits(r,n),r.prototype._bindStream=function(t){var e=this;(this._stream=t).pause(),t.on("data",(function(t){e.push({data:t,meta:{percent:0}})})).on("error",(function(t){e.isPaused?this.generatedError=t:e.error(t)})).on("end",(function(){e.isPaused?e._upstreamEnded=!0:e.end()}))},r.prototype.pause=function(){return!!n.prototype.pause.call(this)&&(this._stream.pause(),!0)},r.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},e.exports=r},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,e,i){"use strict";var s=t("readable-stream").Readable;function n(t,e,i){s.call(this,e),this._helper=t;var n=this;t.on("data",(function(t,e){n.push(t)||n._helper.pause(),i&&i(e)})).on("error",(function(t){n.emit("error",t)})).on("end",(function(){n.push(null)}))}t("../utils").inherits(n,s),n.prototype._read=function(){this._helper.resume()},e.exports=n},{"../utils":32,"readable-stream":16}],14:[function(t,e,i){"use strict";e.exports={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(t,e){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(t,e);if("number"==typeof t)throw new Error('The "data" argument must not be a number');return new Buffer(t,e)},allocBuffer:function(t){if(Buffer.alloc)return Buffer.alloc(t);var e=new Buffer(t);return e.fill(0),e},isBuffer:function(t){return Buffer.isBuffer(t)},isStream:function(t){return t&&"function"==typeof t.on&&"function"==typeof t.pause&&"function"==typeof t.resume}}},{}],15:[function(t,e,i){"use strict";function s(t,e,i){var s,n=r.getTypeOf(e),a=r.extend(i||{},l);a.date=a.date||new Date,null!==a.compression&&(a.compression=a.compression.toUpperCase()),"string"==typeof a.unixPermissions&&(a.unixPermissions=parseInt(a.unixPermissions,8)),a.unixPermissions&&16384&a.unixPermissions&&(a.dir=!0),a.dosPermissions&&16&a.dosPermissions&&(a.dir=!0),a.dir&&(t=p(t)),a.createFolders&&(s=m(t))&&b.call(this,s,!0);var u="string"===n&&!1===a.binary&&!1===a.base64;i&&void 0!==i.binary||(a.binary=!u),(e instanceof h&&0===e.uncompressedSize||a.dir||!e||0===e.length)&&(a.base64=!1,a.binary=!0,e="",a.compression="STORE",n="string");var g;g=e instanceof h||e instanceof o?e:d.isNode&&d.isStream(e)?new f(t,e):r.prepareContent(t,e,a.binary,a.optimizedBinaryString,a.base64);var S=new c(t,g,a);this.files[t]=S}var n=t("./utf8"),r=t("./utils"),o=t("./stream/GenericWorker"),a=t("./stream/StreamHelper"),l=t("./defaults"),h=t("./compressedObject"),c=t("./zipObject"),u=t("./generate"),d=t("./nodejsUtils"),f=t("./nodejs/NodejsStreamInputAdapter"),m=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return 0<e?t.substring(0,e):""},p=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},b=function(t,e){return e=void 0!==e?e:l.createFolders,t=p(t),this.files[t]||s.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function g(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var S={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var e,i,s;for(e in this.files)s=this.files[e],(i=e.slice(this.root.length,e.length))&&e.slice(0,this.root.length)===this.root&&t(i,s)},filter:function(t){var e=[];return this.forEach((function(i,s){t(i,s)&&e.push(s)})),e},file:function(t,e,i){if(1!==arguments.length)return t=this.root+t,s.call(this,t,e,i),this;if(g(t)){var n=t;return this.filter((function(t,e){return!e.dir&&n.test(t)}))}var r=this.files[this.root+t];return r&&!r.dir?r:null},folder:function(t){if(!t)return this;if(g(t))return this.filter((function(e,i){return i.dir&&t.test(e)}));var e=this.root+t,i=b.call(this,e),s=this.clone();return s.root=i.name,s},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var i=this.filter((function(e,i){return i.name.slice(0,t.length)===t})),s=0;s<i.length;s++)delete this.files[i[s].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(t){var e,i={};try{if((i=r.extend(t||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:n.utf8encode})).type=i.type.toLowerCase(),i.compression=i.compression.toUpperCase(),"binarystring"===i.type&&(i.type="string"),!i.type)throw new Error("No output type specified.");r.checkSupport(i.type),"darwin"!==i.platform&&"freebsd"!==i.platform&&"linux"!==i.platform&&"sunos"!==i.platform||(i.platform="UNIX"),"win32"===i.platform&&(i.platform="DOS");var s=i.comment||this.comment||"";e=u.generateWorker(this,i,s)}catch(t){(e=new o("error")).error(t)}return new a(e,i.type||"string",i.mimeType)},generateAsync:function(t,e){return this.generateInternalStream(t).accumulate(e)},generateNodeStream:function(t,e){return(t=t||{}).type||(t.type="nodebuffer"),this.generateInternalStream(t).toNodejsStream(e)}};e.exports=S},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,e,i){"use strict";e.exports=t("stream")},{stream:void 0}],17:[function(t,e,i){"use strict";var s=t("./DataReader");function n(t){s.call(this,t);for(var e=0;e<this.data.length;e++)t[e]=255&t[e]}t("../utils").inherits(n,s),n.prototype.byteAt=function(t){return this.data[this.zero+t]},n.prototype.lastIndexOfSignature=function(t){for(var e=t.charCodeAt(0),i=t.charCodeAt(1),s=t.charCodeAt(2),n=t.charCodeAt(3),r=this.length-4;0<=r;--r)if(this.data[r]===e&&this.data[r+1]===i&&this.data[r+2]===s&&this.data[r+3]===n)return r-this.zero;return-1},n.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),i=t.charCodeAt(1),s=t.charCodeAt(2),n=t.charCodeAt(3),r=this.readData(4);return e===r[0]&&i===r[1]&&s===r[2]&&n===r[3]},n.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./DataReader":18}],18:[function(t,e,i){"use strict";var s=t("../utils");function n(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}n.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length<this.zero+t||t<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(){},readInt:function(t){var e,i=0;for(this.checkOffset(t),e=this.index+t-1;e>=this.index;e--)i=(i<<8)+this.byteAt(e);return this.index+=t,i},readString:function(t){return s.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=n},{"../utils":32}],19:[function(t,e,i){"use strict";var s=t("./Uint8ArrayReader");function n(t){s.call(this,t)}t("../utils").inherits(n,s),n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,i){"use strict";var s=t("./DataReader");function n(t){s.call(this,t)}t("../utils").inherits(n,s),n.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},n.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},n.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./DataReader":18}],21:[function(t,e,i){"use strict";var s=t("./ArrayReader");function n(t){s.call(this,t)}t("../utils").inherits(n,s),n.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,i){"use strict";var s=t("../utils"),n=t("../support"),r=t("./ArrayReader"),o=t("./StringReader"),a=t("./NodeBufferReader"),l=t("./Uint8ArrayReader");e.exports=function(t){var e=s.getTypeOf(t);return s.checkSupport(e),"string"!==e||n.uint8array?"nodebuffer"===e?new a(t):n.uint8array?new l(s.transformTo("uint8array",t)):new r(s.transformTo("array",t)):new o(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,i){"use strict";i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,e,i){"use strict";var s=t("./GenericWorker"),n=t("../utils");function r(t){s.call(this,"ConvertWorker to "+t),this.destType=t}n.inherits(r,s),r.prototype.processChunk=function(t){this.push({data:n.transformTo(this.destType,t.data),meta:t.meta})},e.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,i){"use strict";var s=t("./GenericWorker"),n=t("../crc32");function r(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(r,s),r.prototype.processChunk=function(t){this.streamInfo.crc32=n(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,i){"use strict";var s=t("../utils"),n=t("./GenericWorker");function r(t){n.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}s.inherits(r,n),r.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}n.prototype.processChunk.call(this,t)},e.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,i){"use strict";var s=t("../utils"),n=t("./GenericWorker");function r(t){n.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=s.getTypeOf(t),e.isPaused||e._tickAndRepeat()}),(function(t){e.error(t)}))}s.inherits(r,n),r.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,i){"use strict";function s(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var i=0;i<this._listeners[t].length;i++)this._listeners[t][i].call(this,e)},pipe:function(t){return t.registerPrevious(this)},registerPrevious:function(t){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=t.streamInfo,this.mergeStreamInfo(),this.previous=t;var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.end()})),t.on("error",(function(t){e.error(t)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var t=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),t=!0),this.previous&&this.previous.resume(),!t},flush:function(){},processChunk:function(t){this.push(t)},withStreamInfo:function(t,e){return this.extraStreamInfo[t]=e,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var t in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,t)&&(this.streamInfo[t]=this.extraStreamInfo[t])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var t="Worker "+this.name;return this.previous?this.previous+" -> "+t:t}},e.exports=s},{}],29:[function(t,e,i){"use strict";var s=t("../utils"),n=t("./ConvertWorker"),r=t("./GenericWorker"),o=t("../base64"),a=t("../support"),l=t("../external"),h=null;if(a.nodestream)try{h=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function c(t,e,i){var o=e;switch(e){case"blob":case"arraybuffer":o="uint8array";break;case"base64":o="string"}try{this._internalType=o,this._outputType=e,this._mimeType=i,s.checkSupport(o),this._worker=t.pipe(new n(o)),t.lock()}catch(t){this._worker=new r("error"),this._worker.error(t)}}c.prototype={accumulate:function(t){return function(t,e){return new l.Promise((function(i,n){var r=[],a=t._internalType,l=t._outputType,h=t._mimeType;t.on("data",(function(t,i){r.push(t),e&&e(i)})).on("error",(function(t){r=[],n(t)})).on("end",(function(){try{var t=function(t,e,i){switch(t){case"blob":return s.newBlob(s.transformTo("arraybuffer",e),i);case"base64":return o.encode(e);default:return s.transformTo(t,e)}}(l,function(t,e){var i,s=0,n=null,r=0;for(i=0;i<e.length;i++)r+=e[i].length;switch(t){case"string":return e.join("");case"array":return Array.prototype.concat.apply([],e);case"uint8array":for(n=new Uint8Array(r),i=0;i<e.length;i++)n.set(e[i],s),s+=e[i].length;return n;case"nodebuffer":return Buffer.concat(e);default:throw new Error("concat : unsupported type '"+t+"'")}}(a,r),h);i(t)}catch(t){n(t)}r=[]})).resume()}))}(this,t)},on:function(t,e){var i=this;return"data"===t?this._worker.on(t,(function(t){e.call(i,t.data,t.meta)})):this._worker.on(t,(function(){s.delay(e,arguments,i)})),this},resume:function(){return s.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(t){if(s.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new h(this,{objectMode:"nodebuffer"!==this._outputType},t)}},e.exports=c},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,e,i){"use strict";if(i.base64=!0,i.array=!0,i.string=!0,i.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,i.nodebuffer="undefined"!=typeof Buffer,i.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)i.blob=!1;else{var s=new ArrayBuffer(0);try{i.blob=0===new Blob([s],{type:"application/zip"}).size}catch(t){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);n.append(s),i.blob=0===n.getBlob("application/zip").size}catch(t){i.blob=!1}}}try{i.nodestream=!!t("readable-stream").Readable}catch(t){i.nodestream=!1}},{"readable-stream":16}],31:[function(t,e,i){"use strict";for(var s=t("./utils"),n=t("./support"),r=t("./nodejsUtils"),o=t("./stream/GenericWorker"),a=new Array(256),l=0;l<256;l++)a[l]=252<=l?6:248<=l?5:240<=l?4:224<=l?3:192<=l?2:1;function h(){o.call(this,"utf-8 decode"),this.leftOver=null}function c(){o.call(this,"utf-8 encode")}a[254]=a[254]=1,i.utf8encode=function(t){return n.nodebuffer?r.newBufferFrom(t,"utf-8"):function(t){var e,i,s,r,o,a=t.length,l=0;for(r=0;r<a;r++)55296==(64512&(i=t.charCodeAt(r)))&&r+1<a&&56320==(64512&(s=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(s-56320),r++),l+=i<128?1:i<2048?2:i<65536?3:4;for(e=n.uint8array?new Uint8Array(l):new Array(l),r=o=0;o<l;r++)55296==(64512&(i=t.charCodeAt(r)))&&r+1<a&&56320==(64512&(s=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(s-56320),r++),i<128?e[o++]=i:(i<2048?e[o++]=192|i>>>6:(i<65536?e[o++]=224|i>>>12:(e[o++]=240|i>>>18,e[o++]=128|i>>>12&63),e[o++]=128|i>>>6&63),e[o++]=128|63&i);return e}(t)},i.utf8decode=function(t){return n.nodebuffer?s.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,i,n,r,o=t.length,l=new Array(2*o);for(e=i=0;e<o;)if((n=t[e++])<128)l[i++]=n;else if(4<(r=a[n]))l[i++]=65533,e+=r-1;else{for(n&=2===r?31:3===r?15:7;1<r&&e<o;)n=n<<6|63&t[e++],r--;1<r?l[i++]=65533:n<65536?l[i++]=n:(n-=65536,l[i++]=55296|n>>10&1023,l[i++]=56320|1023&n)}return l.length!==i&&(l.subarray?l=l.subarray(0,i):l.length=i),s.applyFromCharCode(l)}(t=s.transformTo(n.uint8array?"uint8array":"array",t))},s.inherits(h,o),h.prototype.processChunk=function(t){var e=s.transformTo(n.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(n.uint8array){var r=e;(e=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),e.set(r,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var o=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;0<=i&&128==(192&t[i]);)i--;return i<0||0===i?e:i+a[t[i]]>e?i:e}(e),l=e;o!==e.length&&(n.uint8array?(l=e.subarray(0,o),this.leftOver=e.subarray(o,e.length)):(l=e.slice(0,o),this.leftOver=e.slice(o,e.length))),this.push({data:i.utf8decode(l),meta:t.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=h,s.inherits(c,o),c.prototype.processChunk=function(t){this.push({data:i.utf8encode(t.data),meta:t.meta})},i.Utf8EncodeWorker=c},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,i){"use strict";var s=t("./support"),n=t("./base64"),r=t("./nodejsUtils"),o=t("./external");function a(t){return t}function l(t,e){for(var i=0;i<t.length;++i)e[i]=255&t.charCodeAt(i);return e}t("setimmediate"),i.newBlob=function(t,e){i.checkSupport("blob");try{return new Blob([t],{type:e})}catch(i){try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return s.append(t),s.getBlob(e)}catch(t){throw new Error("Bug : can't construct the Blob.")}}};var h={stringifyByChunk:function(t,e,i){var s=[],n=0,r=t.length;if(r<=i)return String.fromCharCode.apply(null,t);for(;n<r;)"array"===e||"nodebuffer"===e?s.push(String.fromCharCode.apply(null,t.slice(n,Math.min(n+i,r)))):s.push(String.fromCharCode.apply(null,t.subarray(n,Math.min(n+i,r)))),n+=i;return s.join("")},stringifyByChar:function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},applyCanBeUsed:{uint8array:function(){try{return s.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(t){return!1}}(),nodebuffer:function(){try{return s.nodebuffer&&1===String.fromCharCode.apply(null,r.allocBuffer(1)).length}catch(t){return!1}}()}};function c(t){var e=65536,s=i.getTypeOf(t),n=!0;if("uint8array"===s?n=h.applyCanBeUsed.uint8array:"nodebuffer"===s&&(n=h.applyCanBeUsed.nodebuffer),n)for(;1<e;)try{return h.stringifyByChunk(t,s,e)}catch(t){e=Math.floor(e/2)}return h.stringifyByChar(t)}function u(t,e){for(var i=0;i<t.length;i++)e[i]=t[i];return e}i.applyFromCharCode=c;var d={};d.string={string:a,array:function(t){return l(t,new Array(t.length))},arraybuffer:function(t){return d.string.uint8array(t).buffer},uint8array:function(t){return l(t,new Uint8Array(t.length))},nodebuffer:function(t){return l(t,r.allocBuffer(t.length))}},d.array={string:c,array:a,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return r.newBufferFrom(t)}},d.arraybuffer={string:function(t){return c(new Uint8Array(t))},array:function(t){return u(new Uint8Array(t),new Array(t.byteLength))},arraybuffer:a,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return r.newBufferFrom(new Uint8Array(t))}},d.uint8array={string:c,array:function(t){return u(t,new Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:a,nodebuffer:function(t){return r.newBufferFrom(t)}},d.nodebuffer={string:c,array:function(t){return u(t,new Array(t.length))},arraybuffer:function(t){return d.nodebuffer.uint8array(t).buffer},uint8array:function(t){return u(t,new Uint8Array(t.length))},nodebuffer:a},i.transformTo=function(t,e){if(e=e||"",!t)return e;i.checkSupport(t);var s=i.getTypeOf(e);return d[s][t](e)},i.resolve=function(t){for(var e=t.split("/"),i=[],s=0;s<e.length;s++){var n=e[s];"."===n||""===n&&0!==s&&s!==e.length-1||(".."===n?i.pop():i.push(n))}return i.join("/")},i.getTypeOf=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":s.nodebuffer&&r.isBuffer(t)?"nodebuffer":s.uint8array&&t instanceof Uint8Array?"uint8array":s.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0},i.checkSupport=function(t){if(!s[t.toLowerCase()])throw new Error(t+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(t){var e,i,s="";for(i=0;i<(t||"").length;i++)s+="\\x"+((e=t.charCodeAt(i))<16?"0":"")+e.toString(16).toUpperCase();return s},i.delay=function(t,e,i){setImmediate((function(){t.apply(i||null,e||[])}))},i.inherits=function(t,e){function i(){}i.prototype=e.prototype,t.prototype=new i},i.extend=function(){var t,e,i={};for(t=0;t<arguments.length;t++)for(e in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],e)&&void 0===i[e]&&(i[e]=arguments[t][e]);return i},i.prepareContent=function(t,e,r,a,h){return o.Promise.resolve(e).then((function(t){return s.blob&&(t instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(t)))&&"undefined"!=typeof FileReader?new o.Promise((function(e,i){var s=new FileReader;s.onload=function(t){e(t.target.result)},s.onerror=function(t){i(t.target.error)},s.readAsArrayBuffer(t)})):t})).then((function(e){var c=i.getTypeOf(e);return c?("arraybuffer"===c?e=i.transformTo("uint8array",e):"string"===c&&(h?e=n.decode(e):r&&!0!==a&&(e=function(t){return l(t,s.uint8array?new Uint8Array(t.length):new Array(t.length))}(e))),e):o.Promise.reject(new Error("Can't read the data of '"+t+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,e,i){"use strict";var s=t("./reader/readerFor"),n=t("./utils"),r=t("./signature"),o=t("./zipEntry"),a=t("./support");function l(t){this.files=[],this.loadOptions=t}l.prototype={checkSignature:function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var e=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+n.pretty(e)+", expected "+n.pretty(t)+")")}},isSignature:function(t,e){var i=this.reader.index;this.reader.setIndex(t);var s=this.reader.readString(4)===e;return this.reader.setIndex(i),s},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var t=this.reader.readData(this.zipCommentLength),e=a.uint8array?"uint8array":"array",i=n.transformTo(e,t);this.zipComment=this.loadOptions.decodeFileName(i)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t,e,i,s=this.zip64EndOfCentralSize-44;0<s;)t=this.reader.readInt(2),e=this.reader.readInt(4),i=this.reader.readData(e),this.zip64ExtensibleData[t]={id:t,length:e,value:i}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t<this.files.length;t++)e=this.files[t],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(r.LOCAL_FILE_HEADER),e.readLocalPart(this.reader),e.handleUTF8(),e.processAttributes()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(r.CENTRAL_FILE_HEADER);)(t=new o({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(t);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(r.CENTRAL_DIRECTORY_END);if(t<0)throw this.isSignature(0,r.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(t);var e=t;if(this.checkSignature(r.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===n.MAX_VALUE_16BITS||this.diskWithCentralDirStart===n.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===n.MAX_VALUE_16BITS||this.centralDirRecords===n.MAX_VALUE_16BITS||this.centralDirSize===n.MAX_VALUE_32BITS||this.centralDirOffset===n.MAX_VALUE_32BITS){if(this.zip64=!0,(t=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(t),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,r.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var i=this.centralDirOffset+this.centralDirSize;this.zip64&&(i+=20,i+=12+this.zip64EndOfCentralSize);var s=e-i;if(0<s)this.isSignature(e,r.CENTRAL_FILE_HEADER)||(this.reader.zero=s);else if(s<0)throw new Error("Corrupted zip: missing "+Math.abs(s)+" bytes.")},prepareReader:function(t){this.reader=s(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=l},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,e,i){"use strict";var s=t("./reader/readerFor"),n=t("./utils"),r=t("./compressedObject"),o=t("./crc32"),a=t("./utf8"),l=t("./compressions"),h=t("./support");function c(t,e){this.options=t,this.loadOptions=e}c.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(t){var e,i;if(t.skip(22),this.fileNameLength=t.readInt(2),i=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(i),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(e=function(t){for(var e in l)if(Object.prototype.hasOwnProperty.call(l,e)&&l[e].magic===t)return l[e];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+n.pretty(this.compressionMethod)+" unknown (inner file : "+n.transformTo("string",this.fileName)+")");this.decompressed=new r(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==t&&(this.dosPermissions=63&this.externalFileAttributes),3==t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=s(this.extraFields[1].value);this.uncompressedSize===n.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===n.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===n.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===n.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,i,s,n=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4<n;)e=t.readInt(2),i=t.readInt(2),s=t.readData(i),this.extraFields[e]={id:e,length:i,value:s};t.setIndex(n)},handleUTF8:function(){var t=h.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=a.utf8decode(this.fileName),this.fileCommentStr=a.utf8decode(this.fileComment);else{var e=this.findExtraFieldUnicodePath();if(null!==e)this.fileNameStr=e;else{var i=n.transformTo(t,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(i)}var s=this.findExtraFieldUnicodeComment();if(null!==s)this.fileCommentStr=s;else{var r=n.transformTo(t,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(r)}}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var e=s(t.value);return 1!==e.readInt(1)||o(this.fileName)!==e.readInt(4)?null:a.utf8decode(e.readData(t.length-5))}return null},findExtraFieldUnicodeComment:function(){var t=this.extraFields[25461];if(t){var e=s(t.value);return 1!==e.readInt(1)||o(this.fileComment)!==e.readInt(4)?null:a.utf8decode(e.readData(t.length-5))}return null}},e.exports=c},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,e,i){"use strict";function s(t,e,i){this.name=t,this.dir=i.dir,this.date=i.date,this.comment=i.comment,this.unixPermissions=i.unixPermissions,this.dosPermissions=i.dosPermissions,this._data=e,this._dataBinary=i.binary,this.options={compression:i.compression,compressionOptions:i.compressionOptions}}var n=t("./stream/StreamHelper"),r=t("./stream/DataWorker"),o=t("./utf8"),a=t("./compressedObject"),l=t("./stream/GenericWorker");s.prototype={internalStream:function(t){var e=null,i="string";try{if(!t)throw new Error("No output type specified.");var s="string"===(i=t.toLowerCase())||"text"===i;"binarystring"!==i&&"text"!==i||(i="string"),e=this._decompressWorker();var r=!this._dataBinary;r&&!s&&(e=e.pipe(new o.Utf8EncodeWorker)),!r&&s&&(e=e.pipe(new o.Utf8DecodeWorker))}catch(t){(e=new l("error")).error(t)}return new n(e,i,"")},async:function(t,e){return this.internalStream(t).accumulate(e)},nodeStream:function(t,e){return this.internalStream(t||"nodebuffer").toNodejsStream(e)},_compressWorker:function(t,e){if(this._data instanceof a&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var i=this._decompressWorker();return this._dataBinary||(i=i.pipe(new o.Utf8EncodeWorker)),a.createWorkerFrom(i,t,e)},_decompressWorker:function(){return this._data instanceof a?this._data.getContentWorker():this._data instanceof l?this._data:new r(this._data)}};for(var h=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],c=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},u=0;u<h.length;u++)s.prototype[h[u]]=c;e.exports=s},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,e,s){(function(t){"use strict";var i,s,n=t.MutationObserver||t.WebKitMutationObserver;if(n){var r=0,o=new n(c),a=t.document.createTextNode("");o.observe(a,{characterData:!0}),i=function(){a.data=r=++r%2}}else if(t.setImmediate||void 0===t.MessageChannel)i="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){c(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(c,0)};else{var l=new t.MessageChannel;l.port1.onmessage=c,i=function(){l.port2.postMessage(0)}}var h=[];function c(){var t,e;s=!0;for(var i=h.length;i;){for(e=h,h=[],t=-1;++t<i;)e[t]();i=h.length}s=!1}e.exports=function(t){1!==h.push(t)||s||i()}}).call(this,void 0!==i.g?i.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(t,e,i){"use strict";var s=t("immediate");function n(){}var r={},o=["REJECTED"],a=["FULFILLED"],l=["PENDING"];function h(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,t!==n&&f(this,t)}function c(t,e,i){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof i&&(this.onRejected=i,this.callRejected=this.otherCallRejected)}function u(t,e,i){s((function(){var s;try{s=e(i)}catch(s){return r.reject(t,s)}s===t?r.reject(t,new TypeError("Cannot resolve promise with itself")):r.resolve(t,s)}))}function d(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function f(t,e){var i=!1;function s(e){i||(i=!0,r.reject(t,e))}function n(e){i||(i=!0,r.resolve(t,e))}var o=m((function(){e(n,s)}));"error"===o.status&&s(o.value)}function m(t,e){var i={};try{i.value=t(e),i.status="success"}catch(t){i.status="error",i.value=t}return i}(e.exports=h).prototype.finally=function(t){if("function"!=typeof t)return this;var e=this.constructor;return this.then((function(i){return e.resolve(t()).then((function(){return i}))}),(function(i){return e.resolve(t()).then((function(){throw i}))}))},h.prototype.catch=function(t){return this.then(null,t)},h.prototype.then=function(t,e){if("function"!=typeof t&&this.state===a||"function"!=typeof e&&this.state===o)return this;var i=new this.constructor(n);return this.state!==l?u(i,this.state===a?t:e,this.outcome):this.queue.push(new c(i,t,e)),i},c.prototype.callFulfilled=function(t){r.resolve(this.promise,t)},c.prototype.otherCallFulfilled=function(t){u(this.promise,this.onFulfilled,t)},c.prototype.callRejected=function(t){r.reject(this.promise,t)},c.prototype.otherCallRejected=function(t){u(this.promise,this.onRejected,t)},r.resolve=function(t,e){var i=m(d,e);if("error"===i.status)return r.reject(t,i.value);var s=i.value;if(s)f(t,s);else{t.state=a,t.outcome=e;for(var n=-1,o=t.queue.length;++n<o;)t.queue[n].callFulfilled(e)}return t},r.reject=function(t,e){t.state=o,t.outcome=e;for(var i=-1,s=t.queue.length;++i<s;)t.queue[i].callRejected(e);return t},h.resolve=function(t){return t instanceof this?t:r.resolve(new this(n),t)},h.reject=function(t){var e=new this(n);return r.reject(e,t)},h.all=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var i=t.length,s=!1;if(!i)return this.resolve([]);for(var o=new Array(i),a=0,l=-1,h=new this(n);++l<i;)c(t[l],l);return h;function c(t,n){e.resolve(t).then((function(t){o[n]=t,++a!==i||s||(s=!0,r.resolve(h,o))}),(function(t){s||(s=!0,r.reject(h,t))}))}},h.race=function(t){if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var e=t.length,i=!1;if(!e)return this.resolve([]);for(var s,o=-1,a=new this(n);++o<e;)s=t[o],this.resolve(s).then((function(t){i||(i=!0,r.resolve(a,t))}),(function(t){i||(i=!0,r.reject(a,t))}));return a}},{immediate:36}],38:[function(t,e,i){"use strict";var s={};(0,t("./lib/utils/common").assign)(s,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),e.exports=s},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,e,i){"use strict";var s=t("./zlib/deflate"),n=t("./utils/common"),r=t("./utils/strings"),o=t("./zlib/messages"),a=t("./zlib/zstream"),l=Object.prototype.toString;function h(t){if(!(this instanceof h))return new h(t);this.options=n.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e=this.options;e.raw&&0<e.windowBits?e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var i=s.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==i)throw new Error(o[i]);if(e.header&&s.deflateSetHeader(this.strm,e.header),e.dictionary){var c;if(c="string"==typeof e.dictionary?r.string2buf(e.dictionary):"[object ArrayBuffer]"===l.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(i=s.deflateSetDictionary(this.strm,c)))throw new Error(o[i]);this._dict_set=!0}}function c(t,e){var i=new h(e);if(i.push(t,!0),i.err)throw i.msg||o[i.err];return i.result}h.prototype.push=function(t,e){var i,o,a=this.strm,h=this.options.chunkSize;if(this.ended)return!1;o=e===~~e?e:!0===e?4:0,"string"==typeof t?a.input=r.string2buf(t):"[object ArrayBuffer]"===l.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new n.Buf8(h),a.next_out=0,a.avail_out=h),1!==(i=s.deflate(a,o))&&0!==i)return this.onEnd(i),!(this.ended=!0);0!==a.avail_out&&(0!==a.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(r.buf2binstring(n.shrinkBuf(a.output,a.next_out))):this.onData(n.shrinkBuf(a.output,a.next_out)))}while((0<a.avail_in||0===a.avail_out)&&1!==i);return 4===o?(i=s.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,0===i):2!==o||(this.onEnd(0),!(a.avail_out=0))},h.prototype.onData=function(t){this.chunks.push(t)},h.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},i.Deflate=h,i.deflate=c,i.deflateRaw=function(t,e){return(e=e||{}).raw=!0,c(t,e)},i.gzip=function(t,e){return(e=e||{}).gzip=!0,c(t,e)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,e,i){"use strict";var s=t("./zlib/inflate"),n=t("./utils/common"),r=t("./utils/strings"),o=t("./zlib/constants"),a=t("./zlib/messages"),l=t("./zlib/zstream"),h=t("./zlib/gzheader"),c=Object.prototype.toString;function u(t){if(!(this instanceof u))return new u(t);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&0<=e.windowBits&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(0<=e.windowBits&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),15<e.windowBits&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var i=s.inflateInit2(this.strm,e.windowBits);if(i!==o.Z_OK)throw new Error(a[i]);this.header=new h,s.inflateGetHeader(this.strm,this.header)}function d(t,e){var i=new u(e);if(i.push(t,!0),i.err)throw i.msg||a[i.err];return i.result}u.prototype.push=function(t,e){var i,a,l,h,u,d,f=this.strm,m=this.options.chunkSize,p=this.options.dictionary,b=!1;if(this.ended)return!1;a=e===~~e?e:!0===e?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof t?f.input=r.binstring2buf(t):"[object ArrayBuffer]"===c.call(t)?f.input=new Uint8Array(t):f.input=t,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new n.Buf8(m),f.next_out=0,f.avail_out=m),(i=s.inflate(f,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&p&&(d="string"==typeof p?r.string2buf(p):"[object ArrayBuffer]"===c.call(p)?new Uint8Array(p):p,i=s.inflateSetDictionary(this.strm,d)),i===o.Z_BUF_ERROR&&!0===b&&(i=o.Z_OK,b=!1),i!==o.Z_STREAM_END&&i!==o.Z_OK)return this.onEnd(i),!(this.ended=!0);f.next_out&&(0!==f.avail_out&&i!==o.Z_STREAM_END&&(0!==f.avail_in||a!==o.Z_FINISH&&a!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(l=r.utf8border(f.output,f.next_out),h=f.next_out-l,u=r.buf2string(f.output,l),f.next_out=h,f.avail_out=m-h,h&&n.arraySet(f.output,f.output,l,h,0),this.onData(u)):this.onData(n.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(b=!0)}while((0<f.avail_in||0===f.avail_out)&&i!==o.Z_STREAM_END);return i===o.Z_STREAM_END&&(a=o.Z_FINISH),a===o.Z_FINISH?(i=s.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===o.Z_OK):a!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),!(f.avail_out=0))},u.prototype.onData=function(t){this.chunks.push(t)},u.prototype.onEnd=function(t){t===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},i.Inflate=u,i.inflate=d,i.inflateRaw=function(t,e){return(e=e||{}).raw=!0,d(t,e)},i.ungzip=d},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,e,i){"use strict";var s="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;i.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var s in i)i.hasOwnProperty(s)&&(t[s]=i[s])}}return t},i.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var n={arraySet:function(t,e,i,s,n){if(e.subarray&&t.subarray)t.set(e.subarray(i,i+s),n);else for(var r=0;r<s;r++)t[n+r]=e[i+r]},flattenChunks:function(t){var e,i,s,n,r,o;for(e=s=0,i=t.length;e<i;e++)s+=t[e].length;for(o=new Uint8Array(s),e=n=0,i=t.length;e<i;e++)r=t[e],o.set(r,n),n+=r.length;return o}},r={arraySet:function(t,e,i,s,n){for(var r=0;r<s;r++)t[n+r]=e[i+r]},flattenChunks:function(t){return[].concat.apply([],t)}};i.setTyped=function(t){t?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,n)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,r))},i.setTyped(s)},{}],42:[function(t,e,i){"use strict";var s=t("./common"),n=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch(t){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){r=!1}for(var o=new s.Buf8(256),a=0;a<256;a++)o[a]=252<=a?6:248<=a?5:240<=a?4:224<=a?3:192<=a?2:1;function l(t,e){if(e<65537&&(t.subarray&&r||!t.subarray&&n))return String.fromCharCode.apply(null,s.shrinkBuf(t,e));for(var i="",o=0;o<e;o++)i+=String.fromCharCode(t[o]);return i}o[254]=o[254]=1,i.string2buf=function(t){var e,i,n,r,o,a=t.length,l=0;for(r=0;r<a;r++)55296==(64512&(i=t.charCodeAt(r)))&&r+1<a&&56320==(64512&(n=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(n-56320),r++),l+=i<128?1:i<2048?2:i<65536?3:4;for(e=new s.Buf8(l),r=o=0;o<l;r++)55296==(64512&(i=t.charCodeAt(r)))&&r+1<a&&56320==(64512&(n=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(n-56320),r++),i<128?e[o++]=i:(i<2048?e[o++]=192|i>>>6:(i<65536?e[o++]=224|i>>>12:(e[o++]=240|i>>>18,e[o++]=128|i>>>12&63),e[o++]=128|i>>>6&63),e[o++]=128|63&i);return e},i.buf2binstring=function(t){return l(t,t.length)},i.binstring2buf=function(t){for(var e=new s.Buf8(t.length),i=0,n=e.length;i<n;i++)e[i]=t.charCodeAt(i);return e},i.buf2string=function(t,e){var i,s,n,r,a=e||t.length,h=new Array(2*a);for(i=s=0;i<a;)if((n=t[i++])<128)h[s++]=n;else if(4<(r=o[n]))h[s++]=65533,i+=r-1;else{for(n&=2===r?31:3===r?15:7;1<r&&i<a;)n=n<<6|63&t[i++],r--;1<r?h[s++]=65533:n<65536?h[s++]=n:(n-=65536,h[s++]=55296|n>>10&1023,h[s++]=56320|1023&n)}return l(h,s)},i.utf8border=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;0<=i&&128==(192&t[i]);)i--;return i<0||0===i?e:i+o[t[i]]>e?i:e}},{"./common":41}],43:[function(t,e,i){"use strict";e.exports=function(t,e,i,s){for(var n=65535&t|0,r=t>>>16&65535|0,o=0;0!==i;){for(i-=o=2e3<i?2e3:i;r=r+(n=n+e[s++]|0)|0,--o;);n%=65521,r%=65521}return n|r<<16|0}},{}],44:[function(t,e,i){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,e,i){"use strict";var s=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var s=0;s<8;s++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();e.exports=function(t,e,i,n){var r=s,o=n+i;t^=-1;for(var a=n;a<o;a++)t=t>>>8^r[255&(t^e[a])];return-1^t}},{}],46:[function(t,e,i){"use strict";var s,n=t("../utils/common"),r=t("./trees"),o=t("./adler32"),a=t("./crc32"),l=t("./messages"),h=-2,c=258,u=262,d=113;function f(t,e){return t.msg=l[e],e}function m(t){return(t<<1)-(4<t?9:0)}function p(t){for(var e=t.length;0<=--e;)t[e]=0}function b(t){var e=t.state,i=e.pending;i>t.avail_out&&(i=t.avail_out),0!==i&&(n.arraySet(t.output,e.pending_buf,e.pending_out,i,t.next_out),t.next_out+=i,e.pending_out+=i,t.total_out+=i,t.avail_out-=i,e.pending-=i,0===e.pending&&(e.pending_out=0))}function g(t,e){r._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,b(t.strm)}function S(t,e){t.pending_buf[t.pending++]=e}function y(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function E(t,e){var i,s,n=t.max_chain_length,r=t.strstart,o=t.prev_length,a=t.nice_match,l=t.strstart>t.w_size-u?t.strstart-(t.w_size-u):0,h=t.window,d=t.w_mask,f=t.prev,m=t.strstart+c,p=h[r+o-1],b=h[r+o];t.prev_length>=t.good_match&&(n>>=2),a>t.lookahead&&(a=t.lookahead);do{if(h[(i=e)+o]===b&&h[i+o-1]===p&&h[i]===h[r]&&h[++i]===h[r+1]){r+=2,i++;do{}while(h[++r]===h[++i]&&h[++r]===h[++i]&&h[++r]===h[++i]&&h[++r]===h[++i]&&h[++r]===h[++i]&&h[++r]===h[++i]&&h[++r]===h[++i]&&h[++r]===h[++i]&&r<m);if(s=c-(m-r),r=m-c,o<s){if(t.match_start=e,a<=(o=s))break;p=h[r+o-1],b=h[r+o]}}}while((e=f[e&d])>l&&0!=--n);return o<=t.lookahead?o:t.lookahead}function v(t){var e,i,s,r,l,h,c,d,f,m,p=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=p+(p-u)){for(n.arraySet(t.window,t.window,p,p,0),t.match_start-=p,t.strstart-=p,t.block_start-=p,e=i=t.hash_size;s=t.head[--e],t.head[e]=p<=s?s-p:0,--i;);for(e=i=p;s=t.prev[--e],t.prev[e]=p<=s?s-p:0,--i;);r+=p}if(0===t.strm.avail_in)break;if(h=t.strm,c=t.window,d=t.strstart+t.lookahead,m=void 0,(f=r)<(m=h.avail_in)&&(m=f),i=0===m?0:(h.avail_in-=m,n.arraySet(c,h.input,h.next_in,m,d),1===h.state.wrap?h.adler=o(h.adler,c,m,d):2===h.state.wrap&&(h.adler=a(h.adler,c,m,d)),h.next_in+=m,h.total_in+=m,m),t.lookahead+=i,t.lookahead+t.insert>=3)for(l=t.strstart-t.insert,t.ins_h=t.window[l],t.ins_h=(t.ins_h<<t.hash_shift^t.window[l+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[l+3-1])&t.hash_mask,t.prev[l&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=l,l++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<u&&0!==t.strm.avail_in)}function x(t,e){for(var i,s;;){if(t.lookahead<u){if(v(t),t.lookahead<u&&0===e)return 1;if(0===t.lookahead)break}if(i=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==i&&t.strstart-i<=t.w_size-u&&(t.match_length=E(t,i)),t.match_length>=3)if(s=r._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,0!=--t.match_length;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else s=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(s&&(g(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(g(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(g(t,!1),0===t.strm.avail_out)?1:2}function _(t,e){for(var i,s,n;;){if(t.lookahead<u){if(v(t),t.lookahead<u&&0===e)return 1;if(0===t.lookahead)break}if(i=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==i&&t.prev_length<t.max_lazy_match&&t.strstart-i<=t.w_size-u&&(t.match_length=E(t,i),t.match_length<=5&&(1===t.strategy||3===t.match_length&&4096<t.strstart-t.match_start)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){for(n=t.strstart+t.lookahead-3,s=r._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=n&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!=--t.prev_length;);if(t.match_available=0,t.match_length=2,t.strstart++,s&&(g(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((s=r._tr_tally(t,0,t.window[t.strstart-1]))&&g(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(s=r._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(g(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(g(t,!1),0===t.strm.avail_out)?1:2}function M(t,e,i,s,n){this.good_length=t,this.max_lazy=e,this.nice_length=i,this.max_chain=s,this.func=n}function w(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new n.Buf16(1146),this.dyn_dtree=new n.Buf16(122),this.bl_tree=new n.Buf16(78),p(this.dyn_ltree),p(this.dyn_dtree),p(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new n.Buf16(16),this.heap=new n.Buf16(573),p(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(573),p(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function P(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:d,t.adler=2===e.wrap?0:1,e.last_flush=0,r._tr_init(e),0):f(t,h)}function T(t){var e=P(t);return 0===e&&function(t){t.window_size=2*t.w_size,p(t.head),t.max_lazy_match=s[t.level].max_lazy,t.good_match=s[t.level].good_length,t.nice_match=s[t.level].nice_length,t.max_chain_length=s[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0}(t.state),e}function L(t,e,i,s,r,o){if(!t)return h;var a=1;if(-1===e&&(e=6),s<0?(a=0,s=-s):15<s&&(a=2,s-=16),r<1||9<r||8!==i||s<8||15<s||e<0||9<e||o<0||4<o)return f(t,h);8===s&&(s=9);var l=new w;return(t.state=l).strm=t,l.wrap=a,l.gzhead=null,l.w_bits=s,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=r+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+3-1)/3),l.window=new n.Buf8(2*l.w_size),l.head=new n.Buf16(l.hash_size),l.prev=new n.Buf16(l.w_size),l.lit_bufsize=1<<r+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new n.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=e,l.strategy=o,l.method=i,T(t)}s=[new M(0,0,0,0,(function(t,e){var i=65535;for(i>t.pending_buf_size-5&&(i=t.pending_buf_size-5);;){if(t.lookahead<=1){if(v(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var s=t.block_start+i;if((0===t.strstart||t.strstart>=s)&&(t.lookahead=t.strstart-s,t.strstart=s,g(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-u&&(g(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(g(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(g(t,!1),t.strm.avail_out),1)})),new M(4,4,8,4,x),new M(4,5,16,8,x),new M(4,6,32,32,x),new M(4,4,16,16,_),new M(8,16,32,32,_),new M(8,16,128,128,_),new M(8,32,128,256,_),new M(32,128,258,1024,_),new M(32,258,258,4096,_)],i.deflateInit=function(t,e){return L(t,e,8,15,8,0)},i.deflateInit2=L,i.deflateReset=T,i.deflateResetKeep=P,i.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?h:(t.state.gzhead=e,0):h},i.deflate=function(t,e){var i,n,o,l;if(!t||!t.state||5<e||e<0)return t?f(t,h):h;if(n=t.state,!t.output||!t.input&&0!==t.avail_in||666===n.status&&4!==e)return f(t,0===t.avail_out?-5:h);if(n.strm=t,i=n.last_flush,n.last_flush=e,42===n.status)if(2===n.wrap)t.adler=0,S(n,31),S(n,139),S(n,8),n.gzhead?(S(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),S(n,255&n.gzhead.time),S(n,n.gzhead.time>>8&255),S(n,n.gzhead.time>>16&255),S(n,n.gzhead.time>>24&255),S(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),S(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(S(n,255&n.gzhead.extra.length),S(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=a(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(S(n,0),S(n,0),S(n,0),S(n,0),S(n,0),S(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),S(n,3),n.status=d);else{var u=8+(n.w_bits-8<<4)<<8;u|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(u|=32),u+=31-u%31,n.status=d,y(n,u),0!==n.strstart&&(y(n,t.adler>>>16),y(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),b(t),o=n.pending,n.pending!==n.pending_buf_size));)S(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),b(t),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,S(n,l)}while(0!==l);n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),b(t),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,S(n,l)}while(0!==l);n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&b(t),n.pending+2<=n.pending_buf_size&&(S(n,255&t.adler),S(n,t.adler>>8&255),t.adler=0,n.status=d)):n.status=d),0!==n.pending){if(b(t),0===t.avail_out)return n.last_flush=-1,0}else if(0===t.avail_in&&m(e)<=m(i)&&4!==e)return f(t,-5);if(666===n.status&&0!==t.avail_in)return f(t,-5);if(0!==t.avail_in||0!==n.lookahead||0!==e&&666!==n.status){var E=2===n.strategy?function(t,e){for(var i;;){if(0===t.lookahead&&(v(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,i=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,i&&(g(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(g(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(g(t,!1),0===t.strm.avail_out)?1:2}(n,e):3===n.strategy?function(t,e){for(var i,s,n,o,a=t.window;;){if(t.lookahead<=c){if(v(t),t.lookahead<=c&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&0<t.strstart&&(s=a[n=t.strstart-1])===a[++n]&&s===a[++n]&&s===a[++n]){o=t.strstart+c;do{}while(s===a[++n]&&s===a[++n]&&s===a[++n]&&s===a[++n]&&s===a[++n]&&s===a[++n]&&s===a[++n]&&s===a[++n]&&n<o);t.match_length=c-(o-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(i=r._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(i=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),i&&(g(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(g(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(g(t,!1),0===t.strm.avail_out)?1:2}(n,e):s[n.level].func(n,e);if(3!==E&&4!==E||(n.status=666),1===E||3===E)return 0===t.avail_out&&(n.last_flush=-1),0;if(2===E&&(1===e?r._tr_align(n):5!==e&&(r._tr_stored_block(n,0,0,!1),3===e&&(p(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),b(t),0===t.avail_out))return n.last_flush=-1,0}return 4!==e?0:n.wrap<=0?1:(2===n.wrap?(S(n,255&t.adler),S(n,t.adler>>8&255),S(n,t.adler>>16&255),S(n,t.adler>>24&255),S(n,255&t.total_in),S(n,t.total_in>>8&255),S(n,t.total_in>>16&255),S(n,t.total_in>>24&255)):(y(n,t.adler>>>16),y(n,65535&t.adler)),b(t),0<n.wrap&&(n.wrap=-n.wrap),0!==n.pending?0:1)},i.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&103!==e&&e!==d&&666!==e?f(t,h):(t.state=null,e===d?f(t,-3):0):h},i.deflateSetDictionary=function(t,e){var i,s,r,a,l,c,u,d,f=e.length;if(!t||!t.state)return h;if(2===(a=(i=t.state).wrap)||1===a&&42!==i.status||i.lookahead)return h;for(1===a&&(t.adler=o(t.adler,e,f,0)),i.wrap=0,f>=i.w_size&&(0===a&&(p(i.head),i.strstart=0,i.block_start=0,i.insert=0),d=new n.Buf8(i.w_size),n.arraySet(d,e,f-i.w_size,i.w_size,0),e=d,f=i.w_size),l=t.avail_in,c=t.next_in,u=t.input,t.avail_in=f,t.next_in=0,t.input=e,v(i);i.lookahead>=3;){for(s=i.strstart,r=i.lookahead-2;i.ins_h=(i.ins_h<<i.hash_shift^i.window[s+3-1])&i.hash_mask,i.prev[s&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=s,s++,--r;);i.strstart=s,i.lookahead=2,v(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=c,t.input=u,t.avail_in=l,i.wrap=a,0},i.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,e,i){"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(t,e,i){"use strict";e.exports=function(t,e){var i,s,n,r,o,a,l,h,c,u,d,f,m,p,b,g,S,y,E,v,x,_,M,w,P;i=t.state,s=t.next_in,w=t.input,n=s+(t.avail_in-5),r=t.next_out,P=t.output,o=r-(e-t.avail_out),a=r+(t.avail_out-257),l=i.dmax,h=i.wsize,c=i.whave,u=i.wnext,d=i.window,f=i.hold,m=i.bits,p=i.lencode,b=i.distcode,g=(1<<i.lenbits)-1,S=(1<<i.distbits)-1;t:do{m<15&&(f+=w[s++]<<m,m+=8,f+=w[s++]<<m,m+=8),y=p[f&g];e:for(;;){if(f>>>=E=y>>>24,m-=E,0==(E=y>>>16&255))P[r++]=65535&y;else{if(!(16&E)){if(0==(64&E)){y=p[(65535&y)+(f&(1<<E)-1)];continue e}if(32&E){i.mode=12;break t}t.msg="invalid literal/length code",i.mode=30;break t}v=65535&y,(E&=15)&&(m<E&&(f+=w[s++]<<m,m+=8),v+=f&(1<<E)-1,f>>>=E,m-=E),m<15&&(f+=w[s++]<<m,m+=8,f+=w[s++]<<m,m+=8),y=b[f&S];i:for(;;){if(f>>>=E=y>>>24,m-=E,!(16&(E=y>>>16&255))){if(0==(64&E)){y=b[(65535&y)+(f&(1<<E)-1)];continue i}t.msg="invalid distance code",i.mode=30;break t}if(x=65535&y,m<(E&=15)&&(f+=w[s++]<<m,(m+=8)<E&&(f+=w[s++]<<m,m+=8)),l<(x+=f&(1<<E)-1)){t.msg="invalid distance too far back",i.mode=30;break t}if(f>>>=E,m-=E,(E=r-o)<x){if(c<(E=x-E)&&i.sane){t.msg="invalid distance too far back",i.mode=30;break t}if(M=d,(_=0)===u){if(_+=h-E,E<v){for(v-=E;P[r++]=d[_++],--E;);_=r-x,M=P}}else if(u<E){if(_+=h+u-E,(E-=u)<v){for(v-=E;P[r++]=d[_++],--E;);if(_=0,u<v){for(v-=E=u;P[r++]=d[_++],--E;);_=r-x,M=P}}}else if(_+=u-E,E<v){for(v-=E;P[r++]=d[_++],--E;);_=r-x,M=P}for(;2<v;)P[r++]=M[_++],P[r++]=M[_++],P[r++]=M[_++],v-=3;v&&(P[r++]=M[_++],1<v&&(P[r++]=M[_++]))}else{for(_=r-x;P[r++]=P[_++],P[r++]=P[_++],P[r++]=P[_++],2<(v-=3););v&&(P[r++]=P[_++],1<v&&(P[r++]=P[_++]))}break}}break}}while(s<n&&r<a);s-=v=m>>3,f&=(1<<(m-=v<<3))-1,t.next_in=s,t.next_out=r,t.avail_in=s<n?n-s+5:5-(s-n),t.avail_out=r<a?a-r+257:257-(r-a),i.hold=f,i.bits=m}},{}],49:[function(t,e,i){"use strict";var s=t("../utils/common"),n=t("./adler32"),r=t("./crc32"),o=t("./inffast"),a=t("./inftrees"),l=-2;function h(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function u(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new s.Buf32(852),e.distcode=e.distdyn=new s.Buf32(592),e.sane=1,e.back=-1,0):l}function d(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,u(t)):l}function f(t,e){var i,s;return t&&t.state?(s=t.state,e<0?(i=0,e=-e):(i=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15<e)?l:(null!==s.window&&s.wbits!==e&&(s.window=null),s.wrap=i,s.wbits=e,d(t))):l}function m(t,e){var i,s;return t?(s=new c,(t.state=s).window=null,0!==(i=f(t,e))&&(t.state=null),i):l}var p,b,g=!0;function S(t){if(g){var e;for(p=new s.Buf32(512),b=new s.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(a(1,t.lens,0,288,p,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;a(2,t.lens,0,32,b,0,t.work,{bits:5}),g=!1}t.lencode=p,t.lenbits=9,t.distcode=b,t.distbits=5}function y(t,e,i,n){var r,o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new s.Buf8(o.wsize)),n>=o.wsize?(s.arraySet(o.window,e,i-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(n<(r=o.wsize-o.wnext)&&(r=n),s.arraySet(o.window,e,i-n,r,o.wnext),(n-=r)?(s.arraySet(o.window,e,i-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=r,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=r))),0}i.inflateReset=d,i.inflateReset2=f,i.inflateResetKeep=u,i.inflateInit=function(t){return m(t,15)},i.inflateInit2=m,i.inflate=function(t,e){var i,c,u,d,f,m,p,b,g,E,v,x,_,M,w,P,T,L,A,C,I,R,N,B,F=0,D=new s.Buf8(4),O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return l;12===(i=t.state).mode&&(i.mode=13),f=t.next_out,u=t.output,p=t.avail_out,d=t.next_in,c=t.input,m=t.avail_in,b=i.hold,g=i.bits,E=m,v=p,R=0;t:for(;;)switch(i.mode){case 1:if(0===i.wrap){i.mode=13;break}for(;g<16;){if(0===m)break t;m--,b+=c[d++]<<g,g+=8}if(2&i.wrap&&35615===b){D[i.check=0]=255&b,D[1]=b>>>8&255,i.check=r(i.check,D,2,0),g=b=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&b)<<8)+(b>>8))%31){t.msg="incorrect header check",i.mode=30;break}if(8!=(15&b)){t.msg="unknown compression method",i.mode=30;break}if(g-=4,I=8+(15&(b>>>=4)),0===i.wbits)i.wbits=I;else if(I>i.wbits){t.msg="invalid window size",i.mode=30;break}i.dmax=1<<I,t.adler=i.check=1,i.mode=512&b?10:12,g=b=0;break;case 2:for(;g<16;){if(0===m)break t;m--,b+=c[d++]<<g,g+=8}if(i.flags=b,8!=(255&i.flags)){t.msg="unknown compression method",i.mode=30;break}if(57344&i.flags){t.msg="unknown header flags set",i.mode=30;break}i.head&&(i.head.text=b>>8&1),512&i.flags&&(D[0]=255&b,D[1]=b>>>8&255,i.check=r(i.check,D,2,0)),g=b=0,i.mode=3;case 3:for(;g<32;){if(0===m)break t;m--,b+=c[d++]<<g,g+=8}i.head&&(i.head.time=b),512&i.flags&&(D[0]=255&b,D[1]=b>>>8&255,D[2]=b>>>16&255,D[3]=b>>>24&255,i.check=r(i.check,D,4,0)),g=b=0,i.mode=4;case 4:for(;g<16;){if(0===m)break t;m--,b+=c[d++]<<g,g+=8}i.head&&(i.head.xflags=255&b,i.head.os=b>>8),512&i.flags&&(D[0]=255&b,D[1]=b>>>8&255,i.check=r(i.check,D,2,0)),g=b=0,i.mode=5;case 5:if(1024&i.flags){for(;g<16;){if(0===m)break t;m--,b+=c[d++]<<g,g+=8}i.length=b,i.head&&(i.head.extra_len=b),512&i.flags&&(D[0]=255&b,D[1]=b>>>8&255,i.check=r(i.check,D,2,0)),g=b=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&(m<(x=i.length)&&(x=m),x&&(i.head&&(I=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),s.arraySet(i.head.extra,c,d,x,I)),512&i.flags&&(i.check=r(i.check,c,x,d)),m-=x,d+=x,i.length-=x),i.length))break t;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===m)break t;for(x=0;I=c[d+x++],i.head&&I&&i.length<65536&&(i.head.name+=String.fromCharCode(I)),I&&x<m;);if(512&i.flags&&(i.check=r(i.check,c,x,d)),m-=x,d+=x,I)break t}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===m)break t;for(x=0;I=c[d+x++],i.head&&I&&i.length<65536&&(i.head.comment+=String.fromCharCode(I)),I&&x<m;);if(512&i.flags&&(i.check=r(i.check,c,x,d)),m-=x,d+=x,I)break t}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;g<16;){if(0===m)break t;m--,b+=c[d++]<<g,g+=8}if(b!==(65535&i.check)){t.msg="header crc mismatch",i.mode=30;break}g=b=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=12;break;case 10:for(;g<32;){if(0===m)break t;m--,b+=c[d++]<<g,g+=8}t.adler=i.check=h(b),g=b=0,i.mode=11;case 11:if(0===i.havedict)return t.next_out=f,t.avail_out=p,t.next_in=d,t.avail_in=m,i.hold=b,i.bits=g,2;t.adler=i.check=1,i.mode=12;case 12:if(5===e||6===e)break t;case 13:if(i.last){b>>>=7&g,g-=7&g,i.mode=27;break}for(;g<3;){if(0===m)break t;m--,b+=c[d++]<<g,g+=8}switch(i.last=1&b,g-=1,3&(b>>>=1)){case 0:i.mode=14;break;case 1:if(S(i),i.mode=20,6!==e)break;b>>>=2,g-=2;break t;case 2:i.mode=17;break;case 3:t.msg="invalid block type",i.mode=30}b>>>=2,g-=2;break;case 14:for(b>>>=7&g,g-=7&g;g<32;){if(0===m)break t;m--,b+=c[d++]<<g,g+=8}if((65535&b)!=(b>>>16^65535)){t.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&b,g=b=0,i.mode=15,6===e)break t;case 15:i.mode=16;case 16:if(x=i.length){if(m<x&&(x=m),p<x&&(x=p),0===x)break t;s.arraySet(u,c,d,x,f),m-=x,d+=x,p-=x,f+=x,i.length-=x;break}i.mode=12;break;case 17:for(;g<14;){if(0===m)break t;m--,b+=c[d++]<<g,g+=8}if(i.nlen=257+(31&b),b>>>=5,g-=5,i.ndist=1+(31&b),b>>>=5,g-=5,i.ncode=4+(15&b),b>>>=4,g-=4,286<i.nlen||30<i.ndist){t.msg="too many length or distance symbols",i.mode=30;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;g<3;){if(0===m)break t;m--,b+=c[d++]<<g,g+=8}i.lens[O[i.have++]]=7&b,b>>>=3,g-=3}for(;i.have<19;)i.lens[O[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,N={bits:i.lenbits},R=a(0,i.lens,0,19,i.lencode,0,i.work,N),i.lenbits=N.bits,R){t.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;P=(F=i.lencode[b&(1<<i.lenbits)-1])>>>16&255,T=65535&F,!((w=F>>>24)<=g);){if(0===m)break t;m--,b+=c[d++]<<g,g+=8}if(T<16)b>>>=w,g-=w,i.lens[i.have++]=T;else{if(16===T){for(B=w+2;g<B;){if(0===m)break t;m--,b+=c[d++]<<g,g+=8}if(b>>>=w,g-=w,0===i.have){t.msg="invalid bit length repeat",i.mode=30;break}I=i.lens[i.have-1],x=3+(3&b),b>>>=2,g-=2}else if(17===T){for(B=w+3;g<B;){if(0===m)break t;m--,b+=c[d++]<<g,g+=8}g-=w,I=0,x=3+(7&(b>>>=w)),b>>>=3,g-=3}else{for(B=w+7;g<B;){if(0===m)break t;m--,b+=c[d++]<<g,g+=8}g-=w,I=0,x=11+(127&(b>>>=w)),b>>>=7,g-=7}if(i.have+x>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=30;break}for(;x--;)i.lens[i.have++]=I}}if(30===i.mode)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=30;break}if(i.lenbits=9,N={bits:i.lenbits},R=a(1,i.lens,0,i.nlen,i.lencode,0,i.work,N),i.lenbits=N.bits,R){t.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,N={bits:i.distbits},R=a(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,N),i.distbits=N.bits,R){t.msg="invalid distances set",i.mode=30;break}if(i.mode=20,6===e)break t;case 20:i.mode=21;case 21:if(6<=m&&258<=p){t.next_out=f,t.avail_out=p,t.next_in=d,t.avail_in=m,i.hold=b,i.bits=g,o(t,v),f=t.next_out,u=t.output,p=t.avail_out,d=t.next_in,c=t.input,m=t.avail_in,b=i.hold,g=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;P=(F=i.lencode[b&(1<<i.lenbits)-1])>>>16&255,T=65535&F,!((w=F>>>24)<=g);){if(0===m)break t;m--,b+=c[d++]<<g,g+=8}if(P&&0==(240&P)){for(L=w,A=P,C=T;P=(F=i.lencode[C+((b&(1<<L+A)-1)>>L)])>>>16&255,T=65535&F,!(L+(w=F>>>24)<=g);){if(0===m)break t;m--,b+=c[d++]<<g,g+=8}b>>>=L,g-=L,i.back+=L}if(b>>>=w,g-=w,i.back+=w,i.length=T,0===P){i.mode=26;break}if(32&P){i.back=-1,i.mode=12;break}if(64&P){t.msg="invalid literal/length code",i.mode=30;break}i.extra=15&P,i.mode=22;case 22:if(i.extra){for(B=i.extra;g<B;){if(0===m)break t;m--,b+=c[d++]<<g,g+=8}i.length+=b&(1<<i.extra)-1,b>>>=i.extra,g-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;P=(F=i.distcode[b&(1<<i.distbits)-1])>>>16&255,T=65535&F,!((w=F>>>24)<=g);){if(0===m)break t;m--,b+=c[d++]<<g,g+=8}if(0==(240&P)){for(L=w,A=P,C=T;P=(F=i.distcode[C+((b&(1<<L+A)-1)>>L)])>>>16&255,T=65535&F,!(L+(w=F>>>24)<=g);){if(0===m)break t;m--,b+=c[d++]<<g,g+=8}b>>>=L,g-=L,i.back+=L}if(b>>>=w,g-=w,i.back+=w,64&P){t.msg="invalid distance code",i.mode=30;break}i.offset=T,i.extra=15&P,i.mode=24;case 24:if(i.extra){for(B=i.extra;g<B;){if(0===m)break t;m--,b+=c[d++]<<g,g+=8}i.offset+=b&(1<<i.extra)-1,b>>>=i.extra,g-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=30;break}i.mode=25;case 25:if(0===p)break t;if(x=v-p,i.offset>x){if((x=i.offset-x)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=30;break}_=x>i.wnext?(x-=i.wnext,i.wsize-x):i.wnext-x,x>i.length&&(x=i.length),M=i.window}else M=u,_=f-i.offset,x=i.length;for(p<x&&(x=p),p-=x,i.length-=x;u[f++]=M[_++],--x;);0===i.length&&(i.mode=21);break;case 26:if(0===p)break t;u[f++]=i.length,p--,i.mode=21;break;case 27:if(i.wrap){for(;g<32;){if(0===m)break t;m--,b|=c[d++]<<g,g+=8}if(v-=p,t.total_out+=v,i.total+=v,v&&(t.adler=i.check=i.flags?r(i.check,u,v,f-v):n(i.check,u,v,f-v)),v=p,(i.flags?b:h(b))!==i.check){t.msg="incorrect data check",i.mode=30;break}g=b=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;g<32;){if(0===m)break t;m--,b+=c[d++]<<g,g+=8}if(b!==(4294967295&i.total)){t.msg="incorrect length check",i.mode=30;break}g=b=0}i.mode=29;case 29:R=1;break t;case 30:R=-3;break t;case 31:return-4;default:return l}return t.next_out=f,t.avail_out=p,t.next_in=d,t.avail_in=m,i.hold=b,i.bits=g,(i.wsize||v!==t.avail_out&&i.mode<30&&(i.mode<27||4!==e))&&y(t,t.output,t.next_out,v-t.avail_out)?(i.mode=31,-4):(E-=t.avail_in,v-=t.avail_out,t.total_in+=E,t.total_out+=v,i.total+=v,i.wrap&&v&&(t.adler=i.check=i.flags?r(i.check,u,v,t.next_out-v):n(i.check,u,v,t.next_out-v)),t.data_type=i.bits+(i.last?64:0)+(12===i.mode?128:0)+(20===i.mode||15===i.mode?256:0),(0==E&&0===v||4===e)&&0===R&&(R=-5),R)},i.inflateEnd=function(t){if(!t||!t.state)return l;var e=t.state;return e.window&&(e.window=null),t.state=null,0},i.inflateGetHeader=function(t,e){var i;return t&&t.state?0==(2&(i=t.state).wrap)?l:((i.head=e).done=!1,0):l},i.inflateSetDictionary=function(t,e){var i,s=e.length;return t&&t.state?0!==(i=t.state).wrap&&11!==i.mode?l:11===i.mode&&n(1,e,s,0)!==i.check?-3:y(t,e,s,s)?(i.mode=31,-4):(i.havedict=1,0):l},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,e,i){"use strict";var s=t("../utils/common"),n=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],r=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,i,l,h,c,u,d){var f,m,p,b,g,S,y,E,v,x=d.bits,_=0,M=0,w=0,P=0,T=0,L=0,A=0,C=0,I=0,R=0,N=null,B=0,F=new s.Buf16(16),D=new s.Buf16(16),O=null,k=0;for(_=0;_<=15;_++)F[_]=0;for(M=0;M<l;M++)F[e[i+M]]++;for(T=x,P=15;1<=P&&0===F[P];P--);if(P<T&&(T=P),0===P)return h[c++]=20971520,h[c++]=20971520,d.bits=1,0;for(w=1;w<P&&0===F[w];w++);for(T<w&&(T=w),_=C=1;_<=15;_++)if(C<<=1,(C-=F[_])<0)return-1;if(0<C&&(0===t||1!==P))return-1;for(D[1]=0,_=1;_<15;_++)D[_+1]=D[_]+F[_];for(M=0;M<l;M++)0!==e[i+M]&&(u[D[e[i+M]]++]=M);if(S=0===t?(N=O=u,19):1===t?(N=n,B-=257,O=r,k-=257,256):(N=o,O=a,-1),_=w,g=c,A=M=R=0,p=-1,b=(I=1<<(L=T))-1,1===t&&852<I||2===t&&592<I)return 1;for(;;){for(y=_-A,v=u[M]<S?(E=0,u[M]):u[M]>S?(E=O[k+u[M]],N[B+u[M]]):(E=96,0),f=1<<_-A,w=m=1<<L;h[g+(R>>A)+(m-=f)]=y<<24|E<<16|v|0,0!==m;);for(f=1<<_-1;R&f;)f>>=1;if(0!==f?(R&=f-1,R+=f):R=0,M++,0==--F[_]){if(_===P)break;_=e[i+u[M]]}if(T<_&&(R&b)!==p){for(0===A&&(A=T),g+=w,C=1<<(L=_-A);L+A<P&&!((C-=F[L+A])<=0);)L++,C<<=1;if(I+=1<<L,1===t&&852<I||2===t&&592<I)return 1;h[p=R&b]=T<<24|L<<16|g-c|0}}return 0!==R&&(h[g+R]=_-A<<24|64<<16|0),d.bits=T,0}},{"../utils/common":41}],51:[function(t,e,i){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,e,i){"use strict";var s=t("../utils/common");function n(t){for(var e=t.length;0<=--e;)t[e]=0}var r=256,o=286,a=30,l=15,h=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],c=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],d=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],f=new Array(576);n(f);var m=new Array(60);n(m);var p=new Array(512);n(p);var b=new Array(256);n(b);var g=new Array(29);n(g);var S,y,E,v=new Array(a);function x(t,e,i,s,n){this.static_tree=t,this.extra_bits=e,this.extra_base=i,this.elems=s,this.max_length=n,this.has_stree=t&&t.length}function _(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function M(t){return t<256?p[t]:p[256+(t>>>7)]}function w(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function P(t,e,i){t.bi_valid>16-i?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=i-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=i)}function T(t,e,i){P(t,i[2*e],i[2*e+1])}function L(t,e){for(var i=0;i|=1&t,t>>>=1,i<<=1,0<--e;);return i>>>1}function A(t,e,i){var s,n,r=new Array(16),o=0;for(s=1;s<=l;s++)r[s]=o=o+i[s-1]<<1;for(n=0;n<=e;n++){var a=t[2*n+1];0!==a&&(t[2*n]=L(r[a]++,a))}}function C(t){var e;for(e=0;e<o;e++)t.dyn_ltree[2*e]=0;for(e=0;e<a;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function I(t){8<t.bi_valid?w(t,t.bi_buf):0<t.bi_valid&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function R(t,e,i,s){var n=2*e,r=2*i;return t[n]<t[r]||t[n]===t[r]&&s[e]<=s[i]}function N(t,e,i){for(var s=t.heap[i],n=i<<1;n<=t.heap_len&&(n<t.heap_len&&R(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!R(e,s,t.heap[n],t.depth));)t.heap[i]=t.heap[n],i=n,n<<=1;t.heap[i]=s}function B(t,e,i){var s,n,o,a,l=0;if(0!==t.last_lit)for(;s=t.pending_buf[t.d_buf+2*l]<<8|t.pending_buf[t.d_buf+2*l+1],n=t.pending_buf[t.l_buf+l],l++,0===s?T(t,n,e):(T(t,(o=b[n])+r+1,e),0!==(a=h[o])&&P(t,n-=g[o],a),T(t,o=M(--s),i),0!==(a=c[o])&&P(t,s-=v[o],a)),l<t.last_lit;);T(t,256,e)}function F(t,e){var i,s,n,r=e.dyn_tree,o=e.stat_desc.static_tree,a=e.stat_desc.has_stree,h=e.stat_desc.elems,c=-1;for(t.heap_len=0,t.heap_max=573,i=0;i<h;i++)0!==r[2*i]?(t.heap[++t.heap_len]=c=i,t.depth[i]=0):r[2*i+1]=0;for(;t.heap_len<2;)r[2*(n=t.heap[++t.heap_len]=c<2?++c:0)]=1,t.depth[n]=0,t.opt_len--,a&&(t.static_len-=o[2*n+1]);for(e.max_code=c,i=t.heap_len>>1;1<=i;i--)N(t,r,i);for(n=h;i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],N(t,r,1),s=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=s,r[2*n]=r[2*i]+r[2*s],t.depth[n]=(t.depth[i]>=t.depth[s]?t.depth[i]:t.depth[s])+1,r[2*i+1]=r[2*s+1]=n,t.heap[1]=n++,N(t,r,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var i,s,n,r,o,a,h=e.dyn_tree,c=e.max_code,u=e.stat_desc.static_tree,d=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,m=e.stat_desc.extra_base,p=e.stat_desc.max_length,b=0;for(r=0;r<=l;r++)t.bl_count[r]=0;for(h[2*t.heap[t.heap_max]+1]=0,i=t.heap_max+1;i<573;i++)p<(r=h[2*h[2*(s=t.heap[i])+1]+1]+1)&&(r=p,b++),h[2*s+1]=r,c<s||(t.bl_count[r]++,o=0,m<=s&&(o=f[s-m]),a=h[2*s],t.opt_len+=a*(r+o),d&&(t.static_len+=a*(u[2*s+1]+o)));if(0!==b){do{for(r=p-1;0===t.bl_count[r];)r--;t.bl_count[r]--,t.bl_count[r+1]+=2,t.bl_count[p]--,b-=2}while(0<b);for(r=p;0!==r;r--)for(s=t.bl_count[r];0!==s;)c<(n=t.heap[--i])||(h[2*n+1]!==r&&(t.opt_len+=(r-h[2*n+1])*h[2*n],h[2*n+1]=r),s--)}}(t,e),A(r,c,t.bl_count)}function D(t,e,i){var s,n,r=-1,o=e[1],a=0,l=7,h=4;for(0===o&&(l=138,h=3),e[2*(i+1)+1]=65535,s=0;s<=i;s++)n=o,o=e[2*(s+1)+1],++a<l&&n===o||(a<h?t.bl_tree[2*n]+=a:0!==n?(n!==r&&t.bl_tree[2*n]++,t.bl_tree[32]++):a<=10?t.bl_tree[34]++:t.bl_tree[36]++,r=n,h=(a=0)===o?(l=138,3):n===o?(l=6,3):(l=7,4))}function O(t,e,i){var s,n,r=-1,o=e[1],a=0,l=7,h=4;for(0===o&&(l=138,h=3),s=0;s<=i;s++)if(n=o,o=e[2*(s+1)+1],!(++a<l&&n===o)){if(a<h)for(;T(t,n,t.bl_tree),0!=--a;);else 0!==n?(n!==r&&(T(t,n,t.bl_tree),a--),T(t,16,t.bl_tree),P(t,a-3,2)):a<=10?(T(t,17,t.bl_tree),P(t,a-3,3)):(T(t,18,t.bl_tree),P(t,a-11,7));r=n,h=(a=0)===o?(l=138,3):n===o?(l=6,3):(l=7,4)}}n(v);var k=!1;function V(t,e,i,n){P(t,0+(n?1:0),3),function(t,e,i,n){I(t),w(t,i),w(t,~i),s.arraySet(t.pending_buf,t.window,e,i,t.pending),t.pending+=i}(t,e,i)}i._tr_init=function(t){k||(function(){var t,e,i,s,n,r=new Array(16);for(s=i=0;s<28;s++)for(g[s]=i,t=0;t<1<<h[s];t++)b[i++]=s;for(b[i-1]=s,s=n=0;s<16;s++)for(v[s]=n,t=0;t<1<<c[s];t++)p[n++]=s;for(n>>=7;s<a;s++)for(v[s]=n<<7,t=0;t<1<<c[s]-7;t++)p[256+n++]=s;for(e=0;e<=l;e++)r[e]=0;for(t=0;t<=143;)f[2*t+1]=8,t++,r[8]++;for(;t<=255;)f[2*t+1]=9,t++,r[9]++;for(;t<=279;)f[2*t+1]=7,t++,r[7]++;for(;t<=287;)f[2*t+1]=8,t++,r[8]++;for(A(f,287,r),t=0;t<a;t++)m[2*t+1]=5,m[2*t]=L(t,5);S=new x(f,h,257,o,l),y=new x(m,c,0,a,l),E=new x(new Array(0),u,0,19,7)}(),k=!0),t.l_desc=new _(t.dyn_ltree,S),t.d_desc=new _(t.dyn_dtree,y),t.bl_desc=new _(t.bl_tree,E),t.bi_buf=0,t.bi_valid=0,C(t)},i._tr_stored_block=V,i._tr_flush_block=function(t,e,i,s){var n,o,a=0;0<t.level?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<r;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),F(t,t.l_desc),F(t,t.d_desc),a=function(t){var e;for(D(t,t.dyn_ltree,t.l_desc.max_code),D(t,t.dyn_dtree,t.d_desc.max_code),F(t,t.bl_desc),e=18;3<=e&&0===t.bl_tree[2*d[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),n=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=n&&(n=o)):n=o=i+5,i+4<=n&&-1!==e?V(t,e,i,s):4===t.strategy||o===n?(P(t,2+(s?1:0),3),B(t,f,m)):(P(t,4+(s?1:0),3),function(t,e,i,s){var n;for(P(t,e-257,5),P(t,i-1,5),P(t,s-4,4),n=0;n<s;n++)P(t,t.bl_tree[2*d[n]+1],3);O(t,t.dyn_ltree,e-1),O(t,t.dyn_dtree,i-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),B(t,t.dyn_ltree,t.dyn_dtree)),C(t),s&&I(t)},i._tr_tally=function(t,e,i){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(b[i]+r+1)]++,t.dyn_dtree[2*M(e)]++),t.last_lit===t.lit_bufsize-1},i._tr_align=function(t){P(t,2,3),T(t,256,f),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},{"../utils/common":41}],53:[function(t,e,i){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,e,s){(function(t){!function(t,e){"use strict";if(!t.setImmediate){var i,s,n,r,o=1,a={},l=!1,h=t.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(t);c=c&&c.setTimeout?c:t,i="[object process]"==={}.toString.call(t.process)?function(t){process.nextTick((function(){d(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,i=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=i,e}}()?(r="setImmediate$"+Math.random()+"$",t.addEventListener?t.addEventListener("message",f,!1):t.attachEvent("onmessage",f),function(e){t.postMessage(r+e,"*")}):t.MessageChannel?((n=new MessageChannel).port1.onmessage=function(t){d(t.data)},function(t){n.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(s=h.documentElement,function(t){var e=h.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,s.removeChild(e),e=null},s.appendChild(e)}):function(t){setTimeout(d,0,t)},c.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),s=0;s<e.length;s++)e[s]=arguments[s+1];var n={callback:t,args:e};return a[o]=n,i(o),o++},c.clearImmediate=u}function u(t){delete a[t]}function d(t){if(l)setTimeout(d,0,t);else{var e=a[t];if(e){l=!0;try{!function(t){var e=t.callback,i=t.args;switch(i.length){case 0:e();break;case 1:e(i[0]);break;case 2:e(i[0],i[1]);break;case 3:e(i[0],i[1],i[2]);break;default:e.apply(undefined,i)}}(e)}finally{u(t),l=!1}}}}function f(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(r)&&d(+e.data.slice(r.length))}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,void 0!==i.g?i.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)},2043:function(t,e,i){var s,n;!function(r,o){"use strict";s=function(){var t=function(){},e="undefined",i=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"];function n(t,e){var i=t[e];if("function"==typeof i.bind)return i.bind(t);try{return Function.prototype.bind.call(i,t)}catch(e){return function(){return Function.prototype.apply.apply(i,[t,arguments])}}}function r(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function o(s){return"debug"===s&&(s="log"),typeof console!==e&&("trace"===s&&i?r:void 0!==console[s]?n(console,s):void 0!==console.log?n(console,"log"):t)}function a(e,i){for(var n=0;n<s.length;n++){var r=s[n];this[r]=n<e?t:this.methodFactory(r,e,i)}this.log=this.debug}function l(t,i,s){return function(){typeof console!==e&&(a.call(this,i,s),this[t].apply(this,arguments))}}function h(t,e,i){return o(t)||l.apply(this,arguments)}function c(t,i,n){var r,o=this;i=null==i?"WARN":i;var l="loglevel";function c(){var t;if(typeof window!==e&&l){try{t=window.localStorage[l]}catch(t){}if(typeof t===e)try{var i=window.document.cookie,s=i.indexOf(encodeURIComponent(l)+"=");-1!==s&&(t=/^([^;]+)/.exec(i.slice(s))[1])}catch(t){}return void 0===o.levels[t]&&(t=void 0),t}}"string"==typeof t?l+=":"+t:"symbol"==typeof t&&(l=void 0),o.name=t,o.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},o.methodFactory=n||h,o.getLevel=function(){return r},o.setLevel=function(i,n){if("string"==typeof i&&void 0!==o.levels[i.toUpperCase()]&&(i=o.levels[i.toUpperCase()]),!("number"==typeof i&&i>=0&&i<=o.levels.SILENT))throw"log.setLevel() called with invalid level: "+i;if(r=i,!1!==n&&function(t){var i=(s[t]||"silent").toUpperCase();if(typeof window!==e&&l){try{return void(window.localStorage[l]=i)}catch(t){}try{window.document.cookie=encodeURIComponent(l)+"="+i+";"}catch(t){}}}(i),a.call(o,i,t),typeof console===e&&i<o.levels.SILENT)return"No console available for logging"},o.setDefaultLevel=function(t){i=t,c()||o.setLevel(t,!1)},o.resetLevel=function(){o.setLevel(i,!1),function(){if(typeof window!==e&&l){try{return void window.localStorage.removeItem(l)}catch(t){}try{window.document.cookie=encodeURIComponent(l)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(t){}}}()},o.enableAll=function(t){o.setLevel(o.levels.TRACE,t)},o.disableAll=function(t){o.setLevel(o.levels.SILENT,t)};var u=c();null==u&&(u=i),o.setLevel(u,!1)}var u=new c,d={};u.getLogger=function(t){if("symbol"!=typeof t&&"string"!=typeof t||""===t)throw new TypeError("You must supply a name when creating a logger.");var e=d[t];return e||(e=d[t]=new c(t,u.getLevel(),u.methodFactory)),e};var f=typeof window!==e?window.log:void 0;return u.noConflict=function(){return typeof window!==e&&window.log===u&&(window.log=f),u},u.getLoggers=function(){return d},u.default=u,u},void 0===(n=s.call(e,i,e,t))||(t.exports=n)}()},1797:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Fraction=void 0;class i{constructor(t=0,e=1,i=0,s=!0){this.numerator=0,this.denominator=1,this.wholeValue=0,this.numerator=t,this.denominator=e,this.wholeValue=i,s&&this.simplify(),this.setRealValue()}static max(t,e){return t.RealValue>e.RealValue?t:e}static Equal(t,e){return t.wholeValue===e.wholeValue&&t.Denominator===e.Denominator&&t.Numerator===e.Numerator}static createFromFraction(t){return new i(t.numerator,t.denominator,t.wholeValue,!1)}static plus(t,e){const i=t.clone();return i.Add(e),i}static minus(t,e){const i=t.clone();return i.Sub(e),i}static multiply(t,e){return new i((t.wholeValue*t.denominator+t.numerator)*(e.wholeValue*e.denominator+e.numerator),t.denominator*e.denominator)}static greatestCommonDenominator(t,e){if(0===t)return e;if(1===e)return 1;for(;Math.abs(e)>1e-8;)t>e?t-=e:e-=t;return Math.round(t)}toString(){let t=this.numerator+"/"+this.denominator;return 0!==this.wholeValue&&(t=this.wholeValue+" "+t),t}clone(){return new i(this.numerator,this.denominator,this.wholeValue,!1)}get Numerator(){return this.numerator}set Numerator(t){this.numerator!==t&&(this.numerator=t,this.simplify(),this.setRealValue())}get Denominator(){return this.denominator}set Denominator(t){this.denominator!==t&&(this.denominator=t,0!==this.numerator&&this.simplify(),this.setRealValue())}get WholeValue(){return this.wholeValue}set WholeValue(t){this.wholeValue!==t&&(this.wholeValue=t,this.setRealValue())}GetExpandedNumerator(){return this.wholeValue*this.denominator+this.numerator}calculateNumberOfNeededDots(){let t=1,e=2;const i=this.GetExpandedNumerator();for(;e<i;)t++,e=Math.pow(2,t);return Math.min(3,t-1)}IsNegative(){return this.realValue<0}get RealValue(){return this.realValue}expand(t){this.numerator*=t,this.denominator*=t,0!==this.wholeValue&&(this.numerator+=this.wholeValue*this.denominator,this.wholeValue=0)}Add(t){return this.numerator=(this.wholeValue*this.denominator+this.numerator)*t.denominator+(t.wholeValue*t.denominator+t.numerator)*this.denominator,this.denominator=this.denominator*t.denominator,this.wholeValue=0,this.simplify(),this.setRealValue(),this}Sub(t){return this.numerator=(this.wholeValue*this.denominator+this.numerator)*t.denominator-(t.wholeValue*t.denominator+t.numerator)*this.denominator,this.denominator=this.denominator*t.denominator,this.wholeValue=0,this.simplify(),this.setRealValue(),this}Quantize(t){if(this.denominator<=t)return this;const e=new i(this.numerator+1,this.denominator,this.wholeValue);for(;e.Denominator>t;)e.Numerator++;if(this.numerator>this.denominator){const s=new i(this.numerator-1,this.denominator,this.wholeValue);for(;s.Denominator>t;)s.Numerator--;if(s.Denominator<e.Denominator)return s}return e}Equals(t){return this.realValue===(null==t?void 0:t.realValue)}CompareTo(t){const e=this.realValue-t.realValue;return e?e<0?-1:1:0}lt(t){return this.realValue<t.realValue}lte(t){return this.realValue<=t.realValue}gt(t){return!this.lte(t)}gte(t){return!this.lt(t)}setRealValue(){this.realValue=this.wholeValue+this.numerator/this.denominator}simplify(){if(0===this.numerator)return void(this.denominator=1);const t=i.greatestCommonDenominator(Math.abs(this.numerator),Math.abs(this.denominator));this.numerator/=t,this.denominator/=t;const e=Math.floor(this.numerator/this.denominator);if(0!==e&&(this.wholeValue+=e,this.numerator-=e*this.denominator,0===this.numerator&&(this.denominator=1)),this.denominator>i.maximumAllowedNumber){const t=this.denominator/i.maximumAllowedNumber;this.numerator=Math.round(this.numerator/t),this.denominator=Math.round(this.denominator/t)}if(this.numerator>i.maximumAllowedNumber){const t=this.numerator/i.maximumAllowedNumber;this.numerator=Math.round(this.numerator/t),this.denominator=Math.round(this.denominator/t)}}isOnBeat(t){const e=this.distanceFromBeat(t);return Math.abs(e)<i.FloatInaccuracyTolerance}distanceFromBeat(t){const e=new i(1,t.Denominator);return this.RealValue%e.RealValue}}e.Fraction=i,i.maximumAllowedNumber=46340,i.FloatInaccuracyTolerance=1e-4},8363:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Matrix2D=void 0;const s=i(9086);class n{constructor(){this.matrix=[];for(let t=0;t<2;t++){this.matrix[t]=[];for(let e=0;e<2;e++)this.matrix[t][e]=0}}static getRotationMatrix(t){const e=new n,i=Math.cos(t),s=Math.sin(t);return e.matrix[0][0]=i,e.matrix[0][1]=-s,e.matrix[1][0]=s,e.matrix[1][1]=i,e}scalarMultiplication(t){for(let e=0;e<2;e++)for(let i=0;i<2;i++)this.matrix[e][i]*=t}getTransposeMatrix(){const t=new n;for(let e=0;e<2;e++)for(let i=0;i<2;i++)t.matrix[e][i]=this.matrix[i][e];return t}vectorMultiplication(t){const e=new s.PointF2D;return e.x=t.x*this.matrix[0][0]+t.y*this.matrix[0][1],e.y=t.x*this.matrix[1][0]+t.y*this.matrix[1][1],e}}e.Matrix2D=n},9651:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSheetErrors=void 0,e.MusicSheetErrors=class{constructor(){this.measureErrors={},this.errors=[],this.tempErrors=[]}finalizeMeasure(t){let e=this.measureErrors[t];e||(e=[]),this.measureErrors[t]=e.concat(this.tempErrors),this.tempErrors=[]}pushMeasureError(t){this.tempErrors.push(t)}push(t){this.errors.push(t)}}},9855:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OSMDColor=void 0;class i{constructor(t,e,i){this.alpha=255,this.red=t,this.green=e,this.blue=i}static get Black(){return new i(0,0,0)}static get DeepSkyBlue(){return new i(0,191,255)}static get Green(){return new i(20,160,20)}static get Magenta(){return new i(255,0,255)}static get Orange(){return new i(255,128,0)}static get Red(){return new i(240,20,20)}static get Disabled(){return new i(225,225,225)}static get DarkBlue(){return new i(0,0,140)}static get Debug1(){return new i(200,0,140)}static get Debug2(){return new i(100,100,200)}static get Debug3(){return new i(0,50,140)}toString(){return"rgb("+this.red+","+this.green+","+this.blue+","+this.alpha+")"}}e.OSMDColor=i},8640:(t,e)=>{"use strict";var i,s;Object.defineProperty(e,"__esModule",{value:!0}),e.Pitch=e.AccidentalEnum=e.NoteEnum=void 0,function(t){t[t.C=0]="C",t[t.D=2]="D",t[t.E=4]="E",t[t.F=5]="F",t[t.G=7]="G",t[t.A=9]="A",t[t.B=11]="B"}(i=e.NoteEnum||(e.NoteEnum={})),function(t){t[t.SHARP=0]="SHARP",t[t.FLAT=1]="FLAT",t[t.NONE=2]="NONE",t[t.NATURAL=3]="NATURAL",t[t.DOUBLESHARP=4]="DOUBLESHARP",t[t.DOUBLEFLAT=5]="DOUBLEFLAT",t[t.TRIPLESHARP=6]="TRIPLESHARP",t[t.TRIPLEFLAT=7]="TRIPLEFLAT",t[t.QUARTERTONESHARP=8]="QUARTERTONESHARP",t[t.QUARTERTONEFLAT=9]="QUARTERTONEFLAT",t[t.SLASHFLAT=10]="SLASHFLAT",t[t.THREEQUARTERSSHARP=11]="THREEQUARTERSSHARP",t[t.THREEQUARTERSFLAT=12]="THREEQUARTERSFLAT",t[t.SLASHQUARTERSHARP=13]="SLASHQUARTERSHARP",t[t.SLASHSHARP=14]="SLASHSHARP",t[t.DOUBLESLASHFLAT=15]="DOUBLESLASHFLAT",t[t.SORI=16]="SORI",t[t.KORON=17]="KORON"}(s=e.AccidentalEnum||(e.AccidentalEnum={}));class n{constructor(t,e,i,r,o=!1){this.accidental=s.NONE,this.fundamentalNote=t,this.octave=e,this.accidental=i,this.accidentalXml=r,this.halfTone=t+12*(e+n.octXmlDiff)+n.HalfTonesFromAccidental(i),o||(this.frequency=n.calcFrequency(this))}static getNoteEnumString(t){switch(t){case i.C:return"C";case i.D:return"D";case i.E:return"E";case i.F:return"F";case i.G:return"G";case i.A:return"A";case i.B:return"B";default:return""}}static lineShiftFromNoteEnum(t,e){if(0===e)return[t,0];const i=n.pitchEnumValues,s=i.indexOf(t);let r=0,o=(s+e)%i.length;return s+e>i.length-1&&(r=1),o<0&&(o=i.length+o,r=-1),[i[o],r]}static CalculateTransposedHalfTone(t,e){const i=t.fundamentalNote+t.AccidentalHalfTones+e;return n.WrapAroundCheck(i,12)}static WrapAroundCheck(t,e){let i=0;for(;t<0;)t+=e,i--;for(;t>=e;)t-=e,i++;return{overflow:i,halftone:t}}static calcFrequency(t){let e,s=0;if(t instanceof n){const n=t;s=n.octave-1,e=n.fundamentalNote-i.A+n.AccidentalHalfTones}else"number"==typeof t&&(e=t-57);return 440*Math.pow(2,s)*Math.pow(2,e/12)}static calcFractionalKey(t){return Math.log(t/440)/Math.LN10*n.halftoneFactor+57}static fromFrequency(t){const e=n.calcFractionalKey(t)+.5,i=Math.floor(e/12)-n.octXmlDiff,r=Math.floor(e)%12;let o=r,a=s.NONE;return-1===this.pitchEnumValues.indexOf(o)&&(o=r-1,a=s.SHARP),new n(o,i,a)}static fromHalftone(t){const e=Math.floor(t/12)-n.octXmlDiff,i=t%12;let r=i,o=s.NONE;return-1===this.pitchEnumValues.indexOf(r)&&(r=i-1,o=s.SHARP),new n(r,e,o)}static ceiling(t){let e=t%=12;return-1===this.pitchEnumValues.indexOf(e)&&(e=t+1),e}static floor(t){let e=t%=12;return-1===this.pitchEnumValues.indexOf(e)&&(e=t-1),e}static HalfTonesFromAccidental(t){switch(t){case s.NONE:return 0;case s.SHARP:return 1;case s.FLAT:return-1;case s.NATURAL:return 0;case s.DOUBLESHARP:return 2;case s.DOUBLEFLAT:return-2;case s.TRIPLESHARP:return 3;case s.TRIPLEFLAT:return-3;case s.QUARTERTONESHARP:return.5;case s.QUARTERTONEFLAT:return-.5;case s.SLASHFLAT:return-.51;case s.THREEQUARTERSSHARP:return 1.5;case s.THREEQUARTERSFLAT:return-1.5;case s.SLASHQUARTERSHARP:return.0013;case s.SLASHSHARP:return.0014;case s.DOUBLESLASHFLAT:return-.0015;case s.SORI:return.0016;case s.KORON:return.0017;default:throw new Error("Unhandled AccidentalEnum value")}}static AccidentalFromHalfTones(t){switch(t){case 0:return s.NONE;case 1:return s.SHARP;case-1:return s.FLAT;case 2:return s.DOUBLESHARP;case-2:return s.DOUBLEFLAT;case 3:return s.TRIPLESHARP;case-3:return s.TRIPLEFLAT;case.5:return s.QUARTERTONESHARP;case-.5:return s.QUARTERTONEFLAT;case 1.5:return s.THREEQUARTERSSHARP;case-1.5:return s.THREEQUARTERSFLAT;default:return t>0&&t<1?s.QUARTERTONESHARP:t<0&&t>-1?s.QUARTERTONEFLAT:s.QUARTERTONESHARP}}static accidentalVexflow(t){let e;switch(t){case s.NATURAL:e="n";break;case s.FLAT:e="b";break;case s.SHARP:e="#";break;case s.DOUBLESHARP:e="##";break;case s.TRIPLESHARP:e="###";break;case s.DOUBLEFLAT:e="bb";break;case s.TRIPLEFLAT:e="bbs";break;case s.QUARTERTONESHARP:e="+";break;case s.QUARTERTONEFLAT:e="d";break;case s.SLASHFLAT:e="bs";break;case s.THREEQUARTERSSHARP:e="++";break;case s.THREEQUARTERSFLAT:e="db";break;case s.SLASHQUARTERSHARP:e="+-";break;case s.SLASHSHARP:e="++-";break;case s.DOUBLESLASHFLAT:e="bss";break;case s.SORI:e="o";break;case s.KORON:e="k"}return e}get AccidentalHalfTones(){return n.HalfTonesFromAccidental(this.accidental)}get Octave(){return this.octave}get FundamentalNote(){return this.fundamentalNote}get Accidental(){return this.accidental}get AccidentalXml(){return this.accidentalXml}get Frequency(){return this.frequency}static get OctaveXmlDifference(){return n.octXmlDiff}getHalfTone(){return this.halfTone}getTransposedPitch(t){if(t>12)throw new Error("rewrite this method to handle bigger octave changes or don't use is with bigger octave changes!");return t>0?this.getHigherPitchByTransposeFactor(t):t<0?this.getLowerPitchByTransposeFactor(-t):this}DoEnharmonicChange(){switch(this.accidental){case s.FLAT:case s.DOUBLEFLAT:this.fundamentalNote=this.getPreviousFundamentalNote(this.fundamentalNote),this.accidental=n.AccidentalFromHalfTones(this.halfTone-(this.fundamentalNote+12*(this.octave+n.octXmlDiff)));break;case s.SHARP:case s.DOUBLESHARP:this.fundamentalNote=this.getNextFundamentalNote(this.fundamentalNote),this.accidental=n.AccidentalFromHalfTones(this.halfTone-(this.fundamentalNote+12*(this.octave+n.octXmlDiff)));break;default:return}}ToString(){let t=n.accidentalVexflow(this.accidental);return t||(t=""),"Key: "+n.getNoteEnumString(this.fundamentalNote)+t+", Note: "+this.fundamentalNote+", octave: "+this.octave.toString()}OperatorEquals(t){const e=this;return!(!e||!t)&&e.FundamentalNote===t.FundamentalNote&&e.Octave===t.Octave&&e.Accidental===t.Accidental}OperatorNotEqual(t){return!(this===t)}OperatorFundamentalGreaterThan(t){const e=this;return e.Octave===t.Octave?e.FundamentalNote>t.FundamentalNote:e.Octave>t.Octave}OperatorFundamentalLessThan(t){const e=this;return e.Octave===t.Octave?e.FundamentalNote<t.FundamentalNote:e.Octave<t.Octave}getHigherPitchByTransposeFactor(t){const e=n.pitchEnumValues.indexOf(this.fundamentalNote);let i,r=this.octave;return e+t>n.pitchEnumValues.length-1?(i=n.pitchEnumValues[e+t-n.pitchEnumValues.length],r++):i=n.pitchEnumValues[e+t],new n(i,r,s.NONE)}getLowerPitchByTransposeFactor(t){const e=n.pitchEnumValues.indexOf(this.fundamentalNote);let i,r=this.octave;return e-t<0?(i=n.pitchEnumValues[n.pitchEnumValues.length+e-t],r--):i=n.pitchEnumValues[e-t],new n(i,r,s.NONE)}getNextFundamentalNote(t){let e=n.pitchEnumValues.indexOf(t);return e=(e+1)%n.pitchEnumValues.length,n.pitchEnumValues[e]}getPreviousFundamentalNote(t){const e=n.pitchEnumValues.indexOf(t);return e>0?n.pitchEnumValues[e-1]:n.pitchEnumValues[n.pitchEnumValues.length-1]}}e.Pitch=n,n.pitchEnumValues=[i.C,i.D,i.E,i.F,i.G,i.A,i.B],n.halftoneFactor=12/(Math.LN2/Math.LN10),n.octXmlDiff=3},9086:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PointF2D=void 0;class i{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}static get Empty(){return new i}static pointsAreEqual(t,e){return t.x===e.x&&t.y===e.y}ToString(){return"["+this.x+", "+this.y+"]"}}e.PointF2D=i},3278:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RectangleF2D=void 0;const s=i(739),n=i(9086);class r{constructor(t,e,i,s){this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=i,this.height=s}static createFromLocationAndSize(t,e){return new r(t.x,t.y,e.width,e.height)}get Location(){return new n.PointF2D(this.x,this.y)}get Size(){return new s.SizeF2D(this.width,this.height)}}e.RectangleF2D=r},739:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SizeF2D=void 0,e.SizeF2D=class{constructor(t=0,e=0){this.width=t,this.height=e}}},8918:function(t,e,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(t,e,i,s){void 0===s&&(s=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,s,n)}:function(t,e,i,s){void 0===s&&(s=i),t[s]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||s(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(1797),e),n(i(8363),e),n(i(9651),e),n(i(9855),e),n(i(8640),e),n(i(9086),e),n(i(3278),e),n(i(739),e)},2562:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.FontStyles=void 0,(i=e.FontStyles||(e.FontStyles={}))[i.Regular=0]="Regular",i[i.Bold=1]="Bold",i[i.Italic=2]="Italic",i[i.BoldItalic=3]="BoldItalic",i[i.Underlined=4]="Underlined"},96:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.Fonts=void 0,(i=e.Fonts||(e.Fonts={}))[i.TimesNewRoman=0]="TimesNewRoman",i[i.Kokila=1]="Kokila"},1274:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.TextAlignment=e.TextAlignmentEnum=void 0,function(t){t[t.LeftTop=0]="LeftTop",t[t.LeftCenter=1]="LeftCenter",t[t.LeftBottom=2]="LeftBottom",t[t.CenterTop=3]="CenterTop",t[t.CenterCenter=4]="CenterCenter",t[t.CenterBottom=5]="CenterBottom",t[t.RightTop=6]="RightTop",t[t.RightCenter=7]="RightCenter",t[t.RightBottom=8]="RightBottom"}(i=e.TextAlignmentEnum||(e.TextAlignmentEnum={})),e.TextAlignment=class{static IsLeft(t){return t===i.LeftTop||t===i.LeftCenter||t===i.LeftBottom}static IsCenterAligned(t){return t===i.CenterTop||t===i.CenterCenter||t===i.CenterBottom}static IsRight(t){return t===i.RightTop||t===i.RightCenter||t===i.RightBottom}}},7119:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.TieTypes=void 0,(i=e.TieTypes||(e.TieTypes={})).SIMPLE="",i.HAMMERON="H",i.PULLOFF="P",i.SLIDE="S",i.TAPPING="T"},5544:function(t,e,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(t,e,i,s){void 0===s&&(s=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,s,n)}:function(t,e,i,s){void 0===s&&(s=i),t[s]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||s(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(2562),e),n(i(96),e),n(i(1274),e),n(i(7119),e)},7056:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.MXLHelper=void 0;const n=i(9228),r=s(i(5733)),o=s(i(2043));e.MXLHelper=class{static MXLtoIXmlElement(t){const e=new r.default;return e.loadAsync(t).then((t=>e.file("META-INF/container.xml").async("text")),(t=>{throw t})).then((t=>{const i=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("rootfile")[0].getAttribute("full-path");return e.file(i).async("text")}),(t=>{throw t})).then((t=>{const e=(new DOMParser).parseFromString(t,"text/xml"),i=new n.IXmlElement(e.documentElement);return Promise.resolve(i)}),(t=>{throw t})).then((t=>t),(t=>{throw new Error("extractSheetFromMxl: "+t.message)}))}static MXLtoXMLstring(t){const e=new r.default;return e.loadAsync(t).then((t=>e.file("META-INF/container.xml").async("text")),(t=>{throw o.default.error(t),t})).then((t=>{const i=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("rootfile")[0].getAttribute("full-path");return e.file(i).async("text")}),(t=>{throw t}))}}},9228:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IXmlElement=void 0;class i{constructor(t){if(this.hasAttributes=!1,!t)throw new Error("IXmlElement: expected Element, got undefined");this.elem=t,this.name=t.nodeName.toLowerCase(),t.hasAttributes()&&(this.hasAttributes=!0,this.firstAttribute=t.attributes[0]),this.hasElements=t.hasChildNodes(),1===t.childNodes.length&&t.childNodes[0].nodeType===Node.TEXT_NODE?this.value=t.childNodes[0].nodeValue:this.value=""}attribute(t){return this.elem.attributes.getNamedItem(t)}attributes(){if(!this.attrs){const t=this.elem.attributes,e=[];for(let i=0;i<t.length;i+=1)e.push(t[i]);this.attrs=e}return this.attrs}element(t){const e=this.elem.childNodes;for(let s=0,n=e.length;s<n;s+=1){const n=e[s];if(n.nodeType===Node.ELEMENT_NODE&&n.nodeName.toLowerCase()===t)return new i(n)}}elements(t){const e=this.elem.childNodes,s=[],n=!t;n||(t=t.toLowerCase());for(let r=0;r<e.length;r+=1){const o=e[r];o.nodeType!==Node.ELEMENT_NODE||!n&&o.nodeName.toLowerCase()!==t||s.push(new i(o))}return s}combinedElement(t){const e=this.elem.childNodes;if(e.length>0){let s;for(let i=0,n=e.length;i<n;i+=1){const n=e[i];if(n.nodeType===Node.ELEMENT_NODE&&n.nodeName.toLowerCase()===t)if(s){const t=n.childNodes;for(let e=0,i=t.length;e<i;e+=1){const i=t[e];s.appendChild(i.cloneNode(!0))}}else s=n}if(s)return new i(s)}}}e.IXmlElement=i},9633:function(t,e,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(t,e,i,s){void 0===s&&(s=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,s,n)}:function(t,e,i,s){void 0===s&&(s=i),t[s]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||s(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(7056),e),n(i(9228),e)},1211:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StringUtil=void 0,e.StringUtil=class{static StringContainsSeparatedWord(t,e,i=!1){return new RegExp("( |^)"+e+"([ .]|$)",i?"i":void 0).test(t)}}},5205:function(t,e,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(t,e,i,s){void 0===s&&(s=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,s,n)}:function(t,e,i,s){void 0===s&&(s=i),t[s]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||s(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(8918),e),n(i(5544),e),n(i(9633),e)},1703:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidEnumArgumentException=e.ArgumentOutOfRangeException=e.MusicSheetReadingException=void 0,e.MusicSheetReadingException=class{constructor(t,e){this.message=t,e&&(this.message+=" "+e.toString())}},e.ArgumentOutOfRangeException=class{constructor(t){this.message=t}},e.InvalidEnumArgumentException=class{constructor(t){this.message=t}}},6791:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractGraphicalExpression=void 0;const s=i(4785),n=i(8911);class r extends s.GraphicalObject{constructor(t,e,i){super(),this.expression=e,this.parentMeasure=i,this.boundingBox=new n.BoundingBox(this,t.PositionAndShape),this.parentStaffLine=t,this.parentStaffLine.AbstractExpressions.push(this),this.rules=t.ParentMusicSystem.rules}get Label(){return this.label}get ParentStaffLine(){return this.parentStaffLine}get SourceExpression(){return this.expression}get Placement(){return this.expression.Placement}}e.AbstractGraphicalExpression=r},6055:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractGraphicalInstruction=void 0;const s=i(4785);class n extends s.GraphicalObject{constructor(t){super(),this.parent=t}get Parent(){return this.parent}set Parent(t){this.parent=t}}e.AbstractGraphicalInstruction=n},1070:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AccidentalCalculator=void 0;const s=i(8640),n=i(8640),r=i(1649),o=i(4040);e.AccidentalCalculator=class{constructor(){this.keySignatureNoteAlterationsDict=new r.Dictionary,this.currentAlterationsComparedToKeyInstructionList=[],this.currentInMeasureNoteAlterationsDict=new r.Dictionary}get ActiveKeyInstruction(){return this.activeKeyInstruction}set ActiveKeyInstruction(t){this.activeKeyInstruction=t,this.reactOnKeyInstructionChange()}doCalculationsAtEndOfMeasure(){this.currentInMeasureNoteAlterationsDict.clear(),this.currentAlterationsComparedToKeyInstructionList.clear();for(const t of this.keySignatureNoteAlterationsDict.keys())this.currentInMeasureNoteAlterationsDict.setValue(t,this.keySignatureNoteAlterationsDict.getValue(t))}checkAccidental(t,e){if(!e)return;const i=e.FundamentalNote+12*e.Octave,r=this.currentAlterationsComparedToKeyInstructionList.indexOf(i)>=0;if(this.currentInMeasureNoteAlterationsDict.containsKey(i)){if(r&&this.currentAlterationsComparedToKeyInstructionList.splice(this.currentAlterationsComparedToKeyInstructionList.indexOf(i),1),this.currentInMeasureNoteAlterationsDict.getValue(i)!==e.AccidentalHalfTones){this.keySignatureNoteAlterationsDict.containsKey(i)&&this.keySignatureNoteAlterationsDict.getValue(i)!==e.AccidentalHalfTones?(this.currentAlterationsComparedToKeyInstructionList.push(i),this.currentInMeasureNoteAlterationsDict.setValue(i,e.AccidentalHalfTones)):e.Accidental!==s.AccidentalEnum.NONE&&this.currentInMeasureNoteAlterationsDict.remove(i);const r=this.currentInMeasureNoteAlterationsDict.getValue(i);if(e.Accidental===s.AccidentalEnum.NONE&&(e=.5===Math.abs(r)?new n.Pitch(e.FundamentalNote,e.Octave,s.AccidentalEnum.NONE):new n.Pitch(e.FundamentalNote,e.Octave,s.AccidentalEnum.NATURAL)),this.isAlterAmbiguousAccidental(e.Accidental)&&!e.AccidentalXml)return;o.MusicSheetCalculator.symbolFactory.addGraphicalAccidental(t,e)}}else if(e.Accidental!==s.AccidentalEnum.NONE){if(r||this.currentAlterationsComparedToKeyInstructionList.push(i),this.currentInMeasureNoteAlterationsDict.setValue(i,e.AccidentalHalfTones),this.isAlterAmbiguousAccidental(e.Accidental)&&!e.AccidentalXml)return;o.MusicSheetCalculator.symbolFactory.addGraphicalAccidental(t,e)}else r&&(e=new n.Pitch(e.FundamentalNote,e.Octave,s.AccidentalEnum.NATURAL),this.currentAlterationsComparedToKeyInstructionList.splice(this.currentAlterationsComparedToKeyInstructionList.indexOf(i),1),o.MusicSheetCalculator.symbolFactory.addGraphicalAccidental(t,e))}isAlterAmbiguousAccidental(t){return t===s.AccidentalEnum.SLASHFLAT||t===s.AccidentalEnum.QUARTERTONEFLAT}reactOnKeyInstructionChange(){const t=this.activeKeyInstruction.AlteratedNotes;let e;e=this.activeKeyInstruction.Key>0?s.AccidentalEnum.SHARP:s.AccidentalEnum.FLAT,this.keySignatureNoteAlterationsDict.clear(),this.currentAlterationsComparedToKeyInstructionList.length=0;for(let i=-9;i<9;i++)for(let s=0;s<t.length;s++)this.keySignatureNoteAlterationsDict.setValue(t[s]+12*i,n.Pitch.HalfTonesFromAccidental(e));this.doCalculationsAtEndOfMeasure()}}},8911:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ColDirEnum=e.BoundingBox=void 0;const n=s(i(2043)),r=i(1703),o=i(9086),a=i(739),l=i(3278),h=i(4785);var c;e.BoundingBox=class{constructor(t,e,i=!1){this.isSymbol=!1,this.relativePositionHasBeenSet=!1,this.xBordersHaveBeenSet=!1,this.yBordersHaveBeenSet=!1,this.absolutePosition=new o.PointF2D,this.relativePosition=new o.PointF2D,this.size=new a.SizeF2D,this.marginSize=new a.SizeF2D,this.upperLeftCorner=new o.PointF2D,this.upperLeftMarginCorner=new o.PointF2D,this.borderLeft=0,this.borderRight=0,this.borderTop=0,this.borderBottom=0,this.borderMarginLeft=0,this.borderMarginRight=0,this.borderMarginTop=0,this.borderMarginBottom=0,this.childElements=[],this.parent=e,this.dataObject=t,this.isSymbol=i,this.xBordersHaveBeenSet=!1,this.yBordersHaveBeenSet=!1,e&&(this.Parent=e)}get RelativePositionHasBeenSet(){return this.relativePositionHasBeenSet}get XBordersHaveBeenSet(){return this.xBordersHaveBeenSet}set XBordersHaveBeenSet(t){this.xBordersHaveBeenSet=t}get YBordersHaveBeenSet(){return this.yBordersHaveBeenSet}set YBordersHaveBeenSet(t){this.yBordersHaveBeenSet=t}get AbsolutePosition(){return this.absolutePosition}set AbsolutePosition(t){this.absolutePosition=t}get RelativePosition(){return this.relativePosition}set RelativePosition(t){this.relativePosition=t,this.relativePositionHasBeenSet=!0}get Size(){return this.size}set Size(t){this.size=t}get MarginSize(){return this.marginSize}get UpperLeftCorner(){return this.upperLeftCorner}get UpperLeftMarginCorner(){return this.upperLeftMarginCorner}get BorderLeft(){return this.borderLeft}set BorderLeft(t){this.borderLeft=t,this.calculateRectangle()}get BorderRight(){return this.borderRight}set BorderRight(t){this.borderRight=t,this.calculateRectangle()}get BorderTop(){return this.borderTop}set BorderTop(t){this.borderTop=t,this.calculateRectangle()}get BorderBottom(){return this.borderBottom}set BorderBottom(t){this.borderBottom=t,this.calculateRectangle()}get BorderMarginLeft(){return this.borderMarginLeft>this.borderLeft?this.borderLeft:this.borderMarginLeft}set BorderMarginLeft(t){this.borderMarginLeft=t,this.calculateMarginRectangle()}get BorderMarginRight(){return this.borderMarginRight<this.borderRight?this.borderRight:this.borderMarginRight}set BorderMarginRight(t){this.borderMarginRight=t,this.calculateMarginRectangle()}get BorderMarginTop(){return this.borderMarginTop>this.borderTop?this.borderTop:this.borderMarginTop}set BorderMarginTop(t){this.borderMarginTop=t,this.calculateMarginRectangle()}get BorderMarginBottom(){return this.borderMarginBottom<this.borderBottom?this.borderBottom:this.borderMarginBottom}set BorderMarginBottom(t){this.borderMarginBottom=t,this.calculateMarginRectangle()}get BoundingRectangle(){return this.boundingRectangle}get BoundingMarginRectangle(){return this.boundingMarginRectangle}get ChildElements(){return this.childElements}set ChildElements(t){this.childElements=t}get Parent(){return this.parent}set Parent(t){if(this.parent){const t=this.parent.ChildElements.indexOf(this,0);t>-1&&this.parent.ChildElements.splice(t,1)}this.parent=t,this.parent.ChildElements.indexOf(this)>-1?n.default.error("BoundingBox of "+this.dataObject.constructor.name+" already in children list of "+this.parent.dataObject.constructor.name+"'s BoundingBox"):this.parent.ChildElements.push(this)}get DataObject(){return this.dataObject}get Center(){return new o.PointF2D(this.RelativePosition.x+(this.BorderMarginRight+this.BorderMarginLeft),this.RelativePosition.y+(this.BorderMarginBottom+this.BorderMarginTop))}setAbsolutePositionFromParent(){this.parent?(this.absolutePosition.x=this.parent.AbsolutePosition.x+this.relativePosition.x,this.absolutePosition.y=this.parent.AbsolutePosition.y+this.relativePosition.y):this.absolutePosition=this.relativePosition}calculateAbsolutePosition(){this.absolutePosition.x=this.relativePosition.x,this.absolutePosition.y=this.relativePosition.y;let t=this.parent;for(;t;)this.absolutePosition.x+=t.relativePosition.x,this.absolutePosition.y+=t.relativePosition.y,t=t.parent}calculateAbsolutePositionsRecursiveWithoutTopelement(){this.absolutePosition.x=0,this.absolutePosition.y=0;for(let t=0,e=this.ChildElements.length;t<e;++t)this.ChildElements[t].calculateAbsolutePositionsRecursive(this.absolutePosition.x,this.absolutePosition.y)}calculateAbsolutePositionsRecursive(t,e){this.absolutePosition.x=this.relativePosition.x+t,this.absolutePosition.y=this.relativePosition.y+e;for(let t=0,e=this.ChildElements.length;t<e;++t)this.ChildElements[t].calculateAbsolutePositionsRecursive(this.absolutePosition.x,this.absolutePosition.y)}calculateAbsolutePositionsOfChildren(){for(let t=0,e=this.ChildElements.length;t<e;++t)this.ChildElements[t].calculateAbsolutePositionsRecursive(this.absolutePosition.x,this.absolutePosition.y)}calculateBoundingBox(){if(0===this.childElements.length)return;for(let t=0,e=this.ChildElements.length;t<e;++t)this.ChildElements[t].calculateBoundingBox();let t=Number.MAX_VALUE,e=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,n=Number.MAX_VALUE,r=Number.MIN_VALUE,o=Number.MAX_VALUE,a=Number.MIN_VALUE;this.isSymbol&&(t=this.borderLeft,e=this.borderRight,i=this.borderTop,s=this.borderBottom,n=this.borderMarginLeft,r=this.borderMarginRight,o=this.borderMarginTop,a=this.borderMarginBottom);for(let l=0,h=this.ChildElements.length;l<h;++l){const h=this.ChildElements[l];t=Math.min(t,h.relativePosition.x+h.borderLeft),e=Math.max(e,h.relativePosition.x+h.borderRight),i=Math.min(i,h.relativePosition.y+h.borderTop),s=Math.max(s,h.relativePosition.y+h.borderBottom),n=Math.min(n,h.relativePosition.x+h.borderMarginLeft),r=Math.max(r,h.relativePosition.x+h.borderMarginRight),o=Math.min(o,h.relativePosition.y+h.borderMarginTop),a=Math.max(a,h.relativePosition.y+h.borderMarginBottom)}this.borderLeft=t,this.borderRight=e,this.borderTop=i,this.borderBottom=s,this.borderMarginLeft=n,this.borderMarginRight=r,this.borderMarginTop=o,this.borderMarginBottom=a,this.calculateRectangle(),this.calculateMarginRectangle(),this.xBordersHaveBeenSet=!0,this.yBordersHaveBeenSet=!0}calculateTopBottomBorders(){if(0===this.childElements.length)return;for(let t=0,e=this.ChildElements.length;t<e;++t)this.ChildElements[t].calculateTopBottomBorders();let t=Number.MAX_VALUE,e=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE;this.yBordersHaveBeenSet&&(t=this.borderTop,e=this.borderBottom,i=this.borderMarginTop,s=this.borderMarginBottom);for(let n=0,r=this.ChildElements.length;n<r;++n){const r=this.ChildElements[n];t=Math.min(t,r.relativePosition.y+r.borderTop),e=Math.max(e,r.relativePosition.y+r.borderBottom),i=Math.min(i,r.relativePosition.y+r.borderMarginTop),s=Math.max(s,r.relativePosition.y+r.borderMarginBottom)}this.borderTop=t,this.borderBottom=e,this.borderMarginTop=i,this.borderMarginBottom=s,this.calculateRectangle(),this.calculateMarginRectangle()}computeNonOverlappingPositionWithMargin(t,e,i){this.RelativePosition=new o.PointF2D(i.x,i.y),this.setAbsolutePositionFromParent();let s=0,n=!1;do{switch(e){case c.Left:case c.Right:s=this.relativePosition.x,t.calculateMarginPositionAlongDirection(this,e),n=Math.abs(s-this.relativePosition.x)>.001;break;case c.Up:case c.Down:s=this.relativePosition.y,t.calculateMarginPositionAlongDirection(this,e),n=Math.abs(s-this.relativePosition.y)>.001;break;default:throw new r.ArgumentOutOfRangeException("direction")}}while(n)}collisionDetection(t){const e=Math.min(this.AbsolutePosition.x+this.borderRight,t.absolutePosition.x+t.borderRight)-Math.max(this.AbsolutePosition.x+this.borderLeft,t.absolutePosition.x+t.borderLeft),i=Math.min(this.AbsolutePosition.y+this.borderBottom,t.absolutePosition.y+t.borderBottom)-Math.max(this.AbsolutePosition.y+this.borderTop,t.absolutePosition.y+t.borderTop);return e>0&&i>0}liesInsideBorders(t){const e=this.AbsolutePosition.x+this.borderLeft<=t.absolutePosition.x+t.borderLeft&&t.absolutePosition.x+t.borderLeft<=this.AbsolutePosition.x+this.borderRight,i=this.AbsolutePosition.x+this.borderLeft<=t.absolutePosition.x+t.borderRight&&t.absolutePosition.x+t.borderRight<=this.AbsolutePosition.x+this.borderRight;if(e&&i){const e=this.AbsolutePosition.y+this.borderTop<=t.absolutePosition.y+t.borderTop&&t.absolutePosition.y+t.borderTop<=this.AbsolutePosition.y+this.borderBottom,i=this.AbsolutePosition.y+this.borderTop<=t.absolutePosition.y+t.borderBottom&&t.absolutePosition.y+t.borderBottom<=this.AbsolutePosition.y+this.borderBottom;if(e&&i)return!0}return!1}pointLiesInsideBorders(t){return this.AbsolutePosition.x+this.borderLeft<=t.x&&t.x<=this.AbsolutePosition.x+this.borderRight&&this.AbsolutePosition.y+this.borderTop<=t.y&&t.y<=this.AbsolutePosition.y+this.borderBottom}marginCollisionDetection(t){const e=Math.min(this.AbsolutePosition.x+this.borderMarginRight,t.absolutePosition.x+t.borderMarginRight)-Math.max(this.AbsolutePosition.x+this.borderMarginLeft,t.absolutePosition.x+t.borderMarginLeft),i=Math.min(this.AbsolutePosition.y+this.borderMarginBottom,t.absolutePosition.y+t.borderMarginBottom)-Math.max(this.AbsolutePosition.y+this.borderMarginTop,t.absolutePosition.y+t.borderMarginTop);return e>0&&i>0}liesInsideMargins(t){const e=this.AbsolutePosition.x+this.borderMarginLeft<=t.absolutePosition.x+t.borderMarginLeft&&t.absolutePosition.x+t.borderMarginLeft<=this.AbsolutePosition.x+this.borderMarginRight,i=this.AbsolutePosition.x+this.borderMarginLeft<=t.absolutePosition.x+t.borderMarginRight&&t.absolutePosition.x+t.borderMarginRight<=this.AbsolutePosition.x+this.borderMarginRight;if(e&&i){const e=this.AbsolutePosition.y+this.borderMarginTop<=t.absolutePosition.y+t.borderMarginTop&&t.absolutePosition.y+t.borderMarginTop<=this.AbsolutePosition.y+this.borderMarginBottom,i=this.AbsolutePosition.y+this.borderMarginTop<=t.absolutePosition.y+t.borderMarginBottom&&t.absolutePosition.y+t.borderMarginBottom<=this.AbsolutePosition.y+this.borderMarginBottom;if(e&&i)return!0}return!1}pointLiesInsideMargins(t){return this.AbsolutePosition.x+this.borderMarginLeft<=t.x&&t.x<=this.AbsolutePosition.x+this.borderMarginRight&&this.AbsolutePosition.y+this.borderMarginTop<=t.y&&t.y<=this.AbsolutePosition.y+this.borderMarginBottom}computeNonOverlappingPosition(t,e,i){this.RelativePosition=new o.PointF2D(i.x,i.y),this.setAbsolutePositionFromParent();let s=0,n=!1;do{switch(e){case c.Left:case c.Right:s=this.relativePosition.x,t.calculatePositionAlongDirection(this,e),n=Math.abs(s-this.relativePosition.x)>1e-4;break;case c.Up:case c.Down:s=this.relativePosition.y,t.calculatePositionAlongDirection(this,e),n=Math.abs(s-this.relativePosition.y)>1e-4;break;default:throw new r.ArgumentOutOfRangeException("direction")}}while(n)}getClickedObjectOfType(t){const e=this.dataObject;if(this.pointLiesInsideBorders(t)&&e)return e;for(let e=0,i=this.childElements.length;e<i;++e){const i=this.childElements[e].getClickedObjectOfType(t);if(i)return i}}getObjectsInRegion(t,e=!0,i=h.GraphicalObject.name){let s=[];for(const n of this.childElements)s=s.concat(n.getObjectsInRegion(t,e,i));return this.dataObject&&this.dataObject.isInstanceOfClass(i)&&(e?t.liesInsideBorders(this)&&s.push(this.dataObject):t.collisionDetection(this)&&s.push(this.dataObject)),s}calculateRectangle(){this.upperLeftCorner=new o.PointF2D(this.BorderLeft,this.BorderTop),this.size=new a.SizeF2D(this.BorderRight-this.BorderLeft,this.BorderBottom-this.BorderTop),this.boundingRectangle=l.RectangleF2D.createFromLocationAndSize(this.upperLeftCorner,this.size)}calculateMarginRectangle(){this.upperLeftMarginCorner=new o.PointF2D(this.BorderMarginLeft,this.BorderMarginTop),this.marginSize=new a.SizeF2D(this.BorderMarginRight-this.BorderMarginLeft,this.BorderMarginBottom-this.BorderMarginTop),this.boundingMarginRectangle=l.RectangleF2D.createFromLocationAndSize(this.upperLeftMarginCorner,this.marginSize)}calculateMarginPositionAlongDirection(t,e){if(this!==t){if(this.isSymbol&&this.marginCollisionDetection(t)){let i=0;switch(e){case c.Left:return i=this.absolutePosition.x+this.borderMarginLeft-(t.absolutePosition.x+t.borderMarginRight),t.relativePosition.x+=i,void(t.absolutePosition.x+=i);case c.Right:return i=this.absolutePosition.x+this.borderMarginRight-(t.absolutePosition.x+t.borderMarginLeft),t.relativePosition.x+=i,void(t.absolutePosition.x+=i);case c.Up:return i=this.absolutePosition.y+this.borderMarginTop-(t.absolutePosition.y+t.borderMarginBottom),t.relativePosition.y+=i,void(t.absolutePosition.y+=i);case c.Down:return i=this.absolutePosition.y+this.borderMarginBottom-(t.absolutePosition.y+t.borderMarginTop),t.relativePosition.y+=i,void(t.absolutePosition.y+=i);default:throw new r.ArgumentOutOfRangeException("direction")}}for(let i=0,s=this.ChildElements.length;i<s;++i)this.ChildElements[i].calculateMarginPositionAlongDirection(t,e)}}calculatePositionAlongDirection(t,e){if(this!==t){if(this.isSymbol&&this.collisionDetection(t)){let i;switch(e){case c.Left:return i=this.absolutePosition.x+this.borderLeft-(t.absolutePosition.x+t.borderRight),t.relativePosition.x+=i,void(t.absolutePosition.x+=i);case c.Right:return i=this.absolutePosition.x+this.borderRight-(t.absolutePosition.x+t.borderLeft),t.relativePosition.x+=i,void(t.absolutePosition.x+=i);case c.Up:return i=this.absolutePosition.y+this.borderTop-(t.absolutePosition.y+t.borderBottom),t.relativePosition.y+=i,void(t.absolutePosition.y+=i);case c.Down:return i=this.absolutePosition.y+this.borderBottom-(t.absolutePosition.y+t.borderTop),t.relativePosition.y+=i,void(t.absolutePosition.y+=i);default:throw new r.ArgumentOutOfRangeException("direction")}}for(let i=0,s=this.ChildElements.length;i<s;++i)this.ChildElements[i].calculatePositionAlongDirection(t,e)}}},function(t){t[t.Left=0]="Left",t[t.Right=1]="Right",t[t.Up=2]="Up",t[t.Down=3]="Down",t[t.NotYetDefined=4]="NotYetDefined"}(c=e.ColDirEnum||(e.ColDirEnum={}))},4278:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Clickable=void 0;const s=i(4785);class n extends s.GraphicalObject{}e.Clickable=n},8155:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AutoColorSet=e.NoteState=e.GraphicalLayers=e.StyleSets=e.OUTLINE_AND_FILL_STYLE_DICT=e.OutlineAndFillStyleEnum=void 0;const s=i(1649);var n,r,o,a,l;!function(t){t[t.BaseWritingColor=0]="BaseWritingColor",t[t.FollowingCursor=1]="FollowingCursor",t[t.AlternativeFollowingCursor=2]="AlternativeFollowingCursor",t[t.PlaybackCursor=3]="PlaybackCursor",t[t.Highlighted=4]="Highlighted",t[t.ErrorUnderlay=5]="ErrorUnderlay",t[t.Selected=6]="Selected",t[t.SelectionSymbol=7]="SelectionSymbol",t[t.DebugColor1=8]="DebugColor1",t[t.DebugColor2=9]="DebugColor2",t[t.DebugColor3=10]="DebugColor3",t[t.SplitScreenDivision=11]="SplitScreenDivision",t[t.GreyTransparentOverlay=12]="GreyTransparentOverlay",t[t.MarkedArea1=13]="MarkedArea1",t[t.MarkedArea2=14]="MarkedArea2",t[t.MarkedArea3=15]="MarkedArea3",t[t.MarkedArea4=16]="MarkedArea4",t[t.MarkedArea5=17]="MarkedArea5",t[t.MarkedArea6=18]="MarkedArea6",t[t.MarkedArea7=19]="MarkedArea7",t[t.MarkedArea8=20]="MarkedArea8",t[t.MarkedArea9=21]="MarkedArea9",t[t.MarkedArea10=22]="MarkedArea10",t[t.Comment1=23]="Comment1",t[t.Comment2=24]="Comment2",t[t.Comment3=25]="Comment3",t[t.Comment4=26]="Comment4",t[t.Comment5=27]="Comment5",t[t.Comment6=28]="Comment6",t[t.Comment7=29]="Comment7",t[t.Comment8=30]="Comment8",t[t.Comment9=31]="Comment9",t[t.Comment10=32]="Comment10"}(n=e.OutlineAndFillStyleEnum||(e.OutlineAndFillStyleEnum={})),e.OUTLINE_AND_FILL_STYLE_DICT=new s.Dictionary,e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.BaseWritingColor,"Thistle"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.FollowingCursor,"Aqua"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.AlternativeFollowingCursor,"Azure"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.PlaybackCursor,"Bisque"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.Highlighted,"CadetBlue"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.ErrorUnderlay,"DarkBlue"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.Selected,"DarkGoldenRod"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.SelectionSymbol,"BlanchedAlmond"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.DebugColor1,"Chartreuse"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.DebugColor2,"DarkGreen"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.DebugColor3,"DarkOrange"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.SplitScreenDivision,"FireBrick"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.GreyTransparentOverlay,"DarkSalmon"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.MarkedArea1,"DarkSeaGreen"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.MarkedArea2,"DarkOrchid"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.MarkedArea3,"Aquamarine"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.MarkedArea4,"DarkKhaki"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.MarkedArea5,"ForestGreen"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.MarkedArea6,"AliceBlue"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.MarkedArea7,"DeepPink"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.MarkedArea8,"Coral"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.MarkedArea9,"DarkOliveGreen"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.MarkedArea10,"Chocolate"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.Comment1,"DodgerBlue"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.Comment2,"Blue"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.Comment3,"Beige"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.Comment4,"Crimson"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.Comment5,"Fuchsia"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.Comment6,"Brown"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.Comment7,"BlanchedAlmond"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.Comment8,"CornflowerBlue"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.Comment9,"Cornsilk"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(n.Comment10,"DarkGrey"),(l=e.StyleSets||(e.StyleSets={}))[l.MarkedArea=0]="MarkedArea",l[l.Comment=1]="Comment",(a=e.GraphicalLayers||(e.GraphicalLayers={}))[a.Background=0]="Background",a[a.Highlight=1]="Highlight",a[a.MeasureError=2]="MeasureError",a[a.SelectionSymbol=3]="SelectionSymbol",a[a.Cursor=4]="Cursor",a[a.PSI_Debug=5]="PSI_Debug",a[a.Notes=6]="Notes",a[a.Comment=7]="Comment",a[a.Debug_above=8]="Debug_above",(o=e.NoteState||(e.NoteState={}))[o.Normal=0]="Normal",o[o.Selected=1]="Selected",o[o.Follow_Confirmed=2]="Follow_Confirmed",o[o.QFeedback_NotFound=3]="QFeedback_NotFound",o[o.QFeedback_OK=4]="QFeedback_OK",o[o.QFeedback_Perfect=5]="QFeedback_Perfect",o[o.Debug1=6]="Debug1",o[o.Debug2=7]="Debug2",o[o.Debug3=8]="Debug3",(r=e.AutoColorSet||(e.AutoColorSet={})).C="#d82c6b",r.D="#F89D15",r.E="#FFE21A",r.F="#4dbd5c",r.G="#009D96",r.A="#43469d",r.B="#76429c",r.Rest="#000000"},5074:(t,e)=>{"use strict";var i,s,n;Object.defineProperty(e,"__esModule",{value:!0}),e.PhonicScoreModes=e.MusicSymbolDrawingStyle=e.DrawingMode=void 0,(n=e.DrawingMode||(e.DrawingMode={}))[n.All=0]="All",n[n.NoOverlays=1]="NoOverlays",n[n.Leadsheet=2]="Leadsheet",(s=e.MusicSymbolDrawingStyle||(e.MusicSymbolDrawingStyle={}))[s.Normal=0]="Normal",s[s.Disabled=1]="Disabled",s[s.Selected=2]="Selected",s[s.Clickable=3]="Clickable",s[s.PlaybackSymbols=4]="PlaybackSymbols",s[s.FollowSymbols=5]="FollowSymbols",s[s.QFeedbackNotFound=6]="QFeedbackNotFound",s[s.QFeedbackOk=7]="QFeedbackOk",s[s.QFeedbackPerfect=8]="QFeedbackPerfect",s[s.Debug1=9]="Debug1",s[s.Debug2=10]="Debug2",s[s.Debug3=11]="Debug3",(i=e.PhonicScoreModes||(e.PhonicScoreModes={}))[i.Following=0]="Following",i[i.Midi=1]="Midi",i[i.Manual=2]="Manual"},7459:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DrawingParameters=e.DrawingParametersEnum=e.ColoringModes=void 0;const s=i(1405),n=i(3748);var r,o;(o=e.ColoringModes||(e.ColoringModes={}))[o.XML=0]="XML",o[o.AutoColoring=1]="AutoColoring",o[o.CustomColorSet=2]="CustomColorSet",function(t){t.allon="allon",t.compact="compact",t.compacttight="compacttight",t.default="default",t.leadsheet="leadsheet",t.preview="preview",t.thumbnail="thumbnail"}(r=e.DrawingParametersEnum||(e.DrawingParametersEnum={})),e.DrawingParameters=class{constructor(t=r.default,e){this.drawCursors=!0,this.drawTitle=!0,this.drawSubtitle=!0,this.drawLyricist=!0,this.drawComposer=!0,this.drawCopyright=!1,this.drawCredits=!0,this.drawPartNames=!0,this.fingeringPosition=n.PlacementEnum.Left,this.drawHiddenNotes=!1,this.rules=e,this.rules||(this.rules=new s.EngravingRules),this.DrawingParametersEnum=t}set DrawingParametersEnum(t){switch(this.drawingParametersEnum=t,t){case r.allon:this.setForAllOn();break;case r.thumbnail:this.setForThumbnail();break;case r.leadsheet:this.setForLeadsheet();break;case r.compact:this.setForCompactMode();break;case r.compacttight:this.setForCompactTightMode();break;case r.default:default:this.setForDefault()}}get DrawingParametersEnum(){return this.drawingParametersEnum}setForAllOn(){this.drawHighlights=!0,this.drawErrors=!0,this.drawSelectionStartSymbol=!0,this.drawSelectionEndSymbol=!0,this.drawCursors=!0,this.drawActivitySymbols=!0,this.drawScrollIndicator=!0,this.drawComments=!0,this.drawMarkedAreas=!0,this.DrawTitle=!0,this.DrawSubtitle=!0,this.DrawComposer=!0,this.DrawLyricist=!0,this.drawCredits=!0,this.DrawPartNames=!0,this.drawHiddenNotes=!0,this.rules.CompactMode=!1}setForDefault(){this.rules.loadDefaultValues(),this.setForAllOn(),this.drawHiddenNotes=!1}setForThumbnail(){this.drawHighlights=!1,this.drawErrors=!1,this.drawSelectionStartSymbol=!1,this.drawSelectionStartSymbol=!1,this.drawCursors=!1,this.drawActivitySymbols=!1,this.drawScrollIndicator=!1,this.drawComments=!0,this.drawMarkedAreas=!0,this.drawHiddenNotes=!1}setForCompactMode(){this.rules.CompactMode=!0,this.DrawCredits=!1,this.drawHiddenNotes=!1}setForCompactTightMode(){this.setForCompactMode(),this.DrawPartNames=!1,this.rules.VoiceSpacingMultiplierVexflow=.65,this.rules.VoiceSpacingAddendVexflow=2,this.rules.MinSkyBottomDistBetweenStaves=1,this.rules.MinSkyBottomDistBetweenSystems=1,this.rules.BetweenStaffDistance=2.5,this.rules.StaffDistance=3.5,this.rules.MinimumDistanceBetweenSystems=1,this.rules.PageBottomMargin=0,this.rules.PageLeftMargin=2,this.rules.PageRightMargin=2}setForLeadsheet(){this.drawHighlights=!1,this.drawErrors=!1,this.drawSelectionStartSymbol=!0,this.drawSelectionEndSymbol=!0,this.drawCursors=!0,this.drawActivitySymbols=!1,this.drawScrollIndicator=!0,this.drawComments=!0,this.drawMarkedAreas=!0}get DrawCredits(){return this.drawCredits}set DrawCredits(t){this.drawCredits=t,this.DrawComposer=t,this.DrawTitle=t,this.DrawSubtitle=t,this.DrawLyricist=t,this.DrawCopyright=t}get DrawTitle(){return this.drawTitle}set DrawTitle(t){this.drawTitle=t,this.rules.RenderTitle=t,t||(this.DrawSubtitle=!1)}get DrawSubtitle(){return this.drawSubtitle}set DrawSubtitle(t){this.drawSubtitle=t,this.rules.RenderSubtitle=t,t&&(this.DrawTitle=!0)}get DrawComposer(){return this.drawComposer}set DrawComposer(t){this.drawComposer=t,this.rules.RenderComposer=t}get DrawLyricist(){return this.drawLyricist}set DrawLyricist(t){this.drawLyricist=t,this.rules.RenderLyricist=t}get DrawCopyright(){return this.drawCopyright}set DrawCopyright(t){this.drawCopyright=t,this.rules.RenderCopyright=t}get DrawPartNames(){return this.drawPartNames}set DrawPartNames(t){this.drawPartNames=t,this.rules.RenderPartNames=t,this.rules.RenderPartNames||(this.rules.RenderPartAbbreviations=!1)}get FingeringPosition(){return this.fingeringPosition}set FingeringPosition(t){this.fingeringPosition=t,this.rules.FingeringPosition=t}get Rules(){return this.rules}set Rules(t){this.rules=t}}},1405:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.PageFormat=e.EngravingRules=void 0;const n=i(599),r=s(i(2043)),o=i(1274),a=i(3748),l=i(41),h=i(7459),c=i(1649),u=i(5544),d=i(8640),f=i(4123),m=i(3486);class p{constructor(){this.NoteDistances=[1,1,1.3,1.6,2,2.5,3,4],this.NoteDistancesScalingFactors=[1,2,4,8,16,32,64,128],this.DurationDistanceDict={},this.DurationScalingDistanceDict={},this.NoteToGraphicalNoteMapObjectCount=0,this.loadDefaultValues()}loadDefaultValues(){this.SamplingUnit=3*p.unit,this.SheetTitleHeight=4,this.SheetSubtitleHeight=2,this.SheetMinimumDistanceBetweenTitleAndSubtitle=1,this.SheetComposerHeight=2,this.SheetAuthorHeight=2,this.SheetCopyrightHeight=1.5,this.SheetCopyrightMargin=2,this.CompactMode=!1,this.PagePlacementEnum=n.PagePlacementEnum.Down,this.PageHeight=100001,this.PageTopMargin=5,this.PageTopMarginNarrow=0,this.PageBottomMargin=5,this.PageLeftMargin=5,this.PageRightMargin=5,this.TitleTopDistance=5,this.TitleBottomDistance=1,this.StaffDistance=7,this.BetweenStaffDistance=5,this.MinimumStaffLineDistance=4,this.MinSkyBottomDistBetweenStaves=1,this.StaffHeight=4,this.TabStaffInterlineHeight=1.1111,this.BetweenStaffLinesDistance=p.unit,this.SystemLeftMargin=0,this.SystemRightMargin=0,this.SystemLabelsRightMargin=2,this.SystemComposerDistance=2,this.InstrumentLabelTextHeight=2,this.MinimumDistanceBetweenSystems=7,this.MinSkyBottomDistBetweenSystems=5,this.LastSystemMaxScalingFactor=1.4,this.AutoBeamNotes=!1,this.AutoBeamOptions={beam_middle_rests_only:!1,beam_rests:!1,maintain_stem_directions:!1},this.AutoBeamTabs=!1,this.BeamWidth=p.unit/2,this.BeamSpaceWidth=p.unit/3,this.BeamForwardLength=1.25*p.unit,this.FlatBeams=!1,this.FlatBeamOffset=20,this.FlatBeamOffsetPerBeam=10,this.ClefLeftMargin=.5,this.ClefRightMargin=.75,this.PercussionOneLineCutoff=3,this.PercussionForceVoicesOneLineCutoff=1,this.PercussionUseXMLDisplayStep=!0,this.PercussionXMLDisplayStepNoteValueShift=0,this.PercussionOneLineXMLDisplayStepOctaveOffset=0,this.BetweenKeySymbolsDistance=.2,this.KeyRightMargin=.75,this.RhythmRightMargin=1.25,this.ShowRhythmAgainAfterPartEndOrFinalBarline=!0,this.NewPartAndSystemAfterFinalBarline=!1,this.InStaffClefScalingFactor=.8,this.DistanceBetweenNaturalAndSymbolWhenCancelling=.4,this.NoteHelperLinesOffset=.25,this.MeasureLeftMargin=.7,this.MeasureRightMargin=0,this.DistanceBetweenLastInstructionAndRepetitionBarline=1,this.ArpeggioDistance=.6,this.StaccatoShorteningFactor=2,this.IdealStemLength=3,this.StemNoteHeadBorderYOffset=.2,this.StemMargin=.2,this.StemMinLength=2.5,this.StemMaxLength=4.5,this.BeamSlopeMaxAngle=10,this.StemMinAllowedDistanceBetweenNoteHeadAndBeamLine=1,this.SetWantedStemDirectionByXml=!0,this.GraceNoteScalingFactor=.6,this.GraceNoteXOffset=.2,this.GraceNoteGroupXMargin=0,this.WedgeOpeningLength=1.2,this.WedgeMeasureEndOpeningLength=.75,this.WedgeMeasureBeginOpeningLength=.75,this.WedgePlacementAboveY=-1.5,this.WedgePlacementBelowY=1.5,this.WedgeHorizontalMargin=.6,this.WedgeVerticalMargin=.5,this.DistanceOffsetBetweenTwoHorizontallyCrossedWedges=.3,this.WedgeMinLength=2,this.WedgeEndDistanceBetweenTimestampsFactor=1.75,this.SoftAccentWedgePadding=.4,this.SoftAccentSizeFactor=.6,this.DistanceBetweenAdjacentDynamics=.75,this.TempoChangeMeasureValidity=4,this.TempoContinousFactor=.7,this.StaccatoScalingFactor=.8,this.BetweenDotsDistance=.8,this.OrnamentAccidentalScalingFactor=.65,this.ChordSymbolTextHeight=2,this.ChordSymbolTextAlignment=o.TextAlignmentEnum.LeftBottom,this.ChordSymbolRelativeXOffset=-1,this.ChordSymbolXSpacing=1,this.ChordOverlapAllowedIntoNextMeasure=0,this.ChordSymbolYOffset=.1,this.ChordSymbolYPadding=0,this.ChordSymbolYAlignment=!0,this.ChordSymbolYAlignmentScope="staffline",this.ChordAccidentalTexts=new c.Dictionary,this.resetChordAccidentalTexts(this.ChordAccidentalTexts,!1),this.ChordSymbolLabelTexts=new c.Dictionary,this.resetChordSymbolLabelTexts(this.ChordSymbolLabelTexts),this.CustomChords=[],this.resetChordNames(),this.RepetitionSymbolsYOffset=0,this.RepetitionEndInstructionXShiftAsPercentOfStaveWidth=.4,this.RehearsalMarkXOffsetDefault=10,this.RehearsalMarkXOffset=0,this.RehearsalMarkXOffsetSystemStartMeasure=-20,this.RehearsalMarkYOffsetDefault=-15,this.RehearsalMarkYOffset=0,this.RehearsalMarkFontSize=10,this.MeasureNumberLabelHeight=1.5*p.unit,this.MeasureNumberLabelOffset=2,this.MeasureNumberLabelXOffset=-.5,this.TupletsRatioed=!1,this.TupletsBracketed=!1,this.TripletsBracketed=!1,this.TupletNumberLabelHeight=1.5*p.unit,this.TupletNumberYOffset=.5,this.TupletNumberLimitConsecutiveRepetitions=!0,this.TupletNumberMaxConsecutiveRepetitions=2,this.TupletNumberAlwaysDisableAfterFirstMax=!0,this.LabelMarginBorderFactor=.1,this.TupletVerticalLineLength=.5,this.TupletNumbersInTabs=!1,this.SlurPlacementFromXML=!0,this.BezierCurveStepSize=1e3,this.calculateCurveParametersArrays(),this.TieGhostObjectWidth=.75,this.TieYPositionOffsetFactor=.3,this.MinimumNeededXspaceForTieGhostObject=1,this.TieHeightMinimum=.28,this.TieHeightMaximum=1.2,this.TieHeightInterpolationK=.0288,this.TieHeightInterpolationD=.136,this.SlurNoteHeadYOffset=.5,this.SlurEndArticulationYOffset=.8,this.SlurStartArticulationYOffsetOfArticulation=.5,this.SlurStemXOffset=.3,this.SlurSlopeMaxAngle=15,this.SlurTangentMinAngle=30,this.SlurTangentMaxAngle=80,this.SlurHeightFactor=1,this.SlurHeightFlattenLongSlursFactorByWidth=.24,this.SlurHeightFlattenLongSlursFactorByAngle=.36,this.SlurHeightFlattenLongSlursCutoffAngle=47,this.SlurHeightFlattenLongSlursCutoffWidth=16,this.SlursStartingAtSameStaffEntryYOffset=.8,this.SlurMaximumYControlPointDistance=void 0,this.GlissandoNoteOffset=.5,this.GlissandoStafflineStartMinimumWidth=1,this.GlissandoStafflineStartYDistanceToNote=.8,this.GlissandoStafflineEndOffset=1,this.GlissandoDefaultWidth=.1,this.RepetitionEndingLabelHeight=2,this.RepetitionEndingLabelXOffset=.5,this.RepetitionEndingLabelYOffset=.3,this.RepetitionEndingLineYLowerOffset=.5,this.RepetitionEndingLineYUpperOffset=.3,this.VoltaOffset=2.5,this.LyricsAlignmentStandard=o.TextAlignmentEnum.LeftBottom,this.LyricsHeight=2,this.LyricsYOffsetToStaffHeight=0,this.LyricsYMarginToBottomLine=.2,this.VerticalBetweenLyricsDistance=.5,this.HorizontalBetweenLyricsDistance=.2,this.BetweenSyllableMaximumDistance=10,this.BetweenSyllableMinimumDistance=.5,this.LyricOverlapAllowedIntoNextMeasure=3.4,this.MinimumDistanceBetweenDashes=10,this.MaximumLyricsElongationFactor=2.5,this.TempoYSpacing=.5,this.InstantaneousTempoTextHeight=2.3,this.ContinuousDynamicTextHeight=2.3,this.MoodTextHeight=2.3,this.UnknownTextHeight=2,this.ContinuousTempoTextHeight=2.3,this.DynamicExpressionMaxDistance=2,this.DynamicExpressionSpacer=.5,this.VexFlowDefaultNotationFontScale=39,this.VexFlowDefaultTabFontScale=39,this.TremoloStrokeScale=1,this.TremoloYSpacingScale=1,this.StemWidth=.15,this.StaffLineWidth=.1,this.StaffLineColor=void 0,this.LedgerLineWidth=1,this.LedgerLineStrokeStyle=void 0,this.LedgerLineColorDefault="#000000",this.WedgeLineWidth=.12,this.TupletLineWidth=.12,this.LyricUnderscoreLineWidth=.12,this.SystemThinLineWidth=.12,this.SystemBoldLineWidth=p.unit/2,this.SystemRepetitionEndingLineWidth=.12,this.SystemDotWidth=p.unit/2,this.DistanceBetweenVerticalSystemLines=.35,this.DistanceBetweenDotAndLine=.7,this.RepeatEndStartPadding=2,this.OctaveShiftLineWidth=.12,this.OctaveShiftVerticalLineLength=p.unit,this.GraceLineWidth=this.StaffLineWidth*this.GraceNoteScalingFactor,this.MultipleRestMeasureDefaultWidth=4,this.MultipleRestMeasureAddKeySignature=!0,this.FixedMeasureWidth=!1,this.FixedMeasureWidthFixedValue=void 0,this.MinimumCrossedBeamDifferenceMargin=1e-4,this.SheetMaximumWidth=32767,this.VoiceSpacingMultiplierVexflow=.85,this.VoiceSpacingAddendVexflow=3,this.PickupMeasureWidthMultiplier=1,this.PickupMeasureRepetitionSpacing=.8,this.PickupMeasureSpacingSingleNoteAddend=1.6,this.DisplacedNoteMargin=.1,this.MinNoteDistance=2,this.SubMeasureXSpacingThreshold=35,this.MeasureDynamicsMaxScalingFactor=2.5,this.WholeRestXShiftVexflow=-1.5,this.MetronomeMarksDrawn=!0,this.MetronomeMarkXShift=-6,this.MetronomeMarkYShift=-1,this.SoftmaxFactorVexFlow=15,this.StaggerSameWholeNotes=!0,this.AlignRests=l.AlignRestOption.Never,this.RestCollisionYPadding=0,this.FillEmptyMeasuresWithWholeRest=l.FillEmptyMeasuresWithWholeRests.No,this.ArpeggiosGoAcrossVoices=!1,this.RenderArpeggios=!0,this.RenderSlurs=!0,this.RenderGlissandi=!0,this.ColoringMode=h.ColoringModes.XML,this.ColoringEnabled=!0,this.ColorStemsLikeNoteheads=!1,this.ColorBeams=!0,this.ColorFlags=!0,this.applyDefaultColorMusic("#000000"),this.DefaultColorCursor="#33e02f",this.DefaultFontFamily="Times New Roman",this.DefaultFontStyle=u.FontStyles.Regular,this.DefaultVexFlowNoteFont="gonville",this.MaxMeasureToDrawIndex=Number.MAX_VALUE,this.MinMeasureToDrawIndex=0,this.MaxSystemToDrawNumber=Number.MAX_VALUE,this.MaxPageToDrawNumber=Number.MAX_VALUE,this.RenderComposer=!0,this.RenderTitle=!0,this.RenderSubtitle=!0,this.RenderLyricist=!0,this.RenderCopyright=!1,this.RenderPartNames=!0,this.RenderPartAbbreviations=!0,this.RenderFingerings=!0,this.RenderMeasureNumbers=!0,this.RenderMeasureNumbersOnlyAtSystemStart=!1,this.UseXMLMeasureNumbers=!0,this.RenderLyrics=!0,this.RenderChordSymbols=!0,this.RenderMultipleRestMeasures=!0,this.AutoGenerateMultipleRestMeasuresFromRestMeasures=!0,this.RenderRehearsalMarks=!0,this.RenderClefsAtBeginningOfStaffline=!0,this.RenderKeySignatures=!0,this.RenderTimeSignatures=!0,this.RenderPedals=!0,this.ArticulationPlacementFromXML=!0,this.BreathMarkDistance=.8,this.FingeringPosition=a.PlacementEnum.AboveOrBelow,this.FingeringPositionFromXML=!0,this.FingeringPositionGrace=a.PlacementEnum.Left,this.FingeringInsideStafflines=!1,this.FingeringLabelFontHeight=1.7,this.FingeringOffsetX=0,this.FingeringOffsetY=0,this.FingeringPaddingY=-.2,this.FingeringTextSize=1.5,this.RenderStringNumbersClassical=!0,this.StringNumberOffsetY=0,this.NewSystemAtXMLNewSystemAttribute=!1,this.NewPageAtXMLNewPageAttribute=!1,this.NewSystemAtXMLNewPageAttribute=!1,this.RestoreCursorAfterRerender=!0,this.StretchLastSystemLine=!1,this.IgnoreBracketsWords=!0,this.PageFormat=b.UndefinedPageFormat,this.PageBackgroundColor=void 0,this.RenderSingleHorizontalStaffline=!1,this.SpacingBetweenTextLines=0,this.NoteToGraphicalNoteMap=new c.Dictionary,this.NoteToGraphicalNoteMapObjectCount=0,this.SkyBottomLineBatchMinMeasures=5,this.SkyBottomLineWebGLMinMeasures=80,this.AlwaysSetPreferredSkyBottomLineBackendAutomatically=!0,this.DisableWebGLInFirefox=!0,this.DisableWebGLInSafariAndIOS=!0,this.setPreferredSkyBottomLineBackendAutomatically();try{this.MaxInstructionsConstValue=this.ClefLeftMargin+this.ClefRightMargin+this.KeyRightMargin+this.RhythmRightMargin+11}catch(t){r.default.info("EngravingRules()",t)}}setPreferredSkyBottomLineBackendAutomatically(t=-1){var e,i,s,n;let r="",o="";"object"==typeof globalThis&&(r=null!==(i=null===(e=globalThis.navigator)||void 0===e?void 0:e.vendor)&&void 0!==i?i:"",o=null!==(n=null===(s=globalThis.navigator)||void 0===s?void 0:s.userAgent)&&void 0!==n?n:"");let a=!1;(this.DisableWebGLInSafariAndIOS&&/apple/i.test(r)||this.DisableWebGLInFirefox&&o.includes("Firefox"))&&(a=!0),this.PreferredSkyBottomLineBatchCalculatorBackend=l.SkyBottomLineBatchCalculatorBackendType.Plain,a||t>=this.SkyBottomLineWebGLMinMeasures&&(this.PreferredSkyBottomLineBatchCalculatorBackend=l.SkyBottomLineBatchCalculatorBackendType.WebGL)}applyDefaultColorMusic(t){this.DefaultColorMusic=t,this.DefaultColorNotehead=t,this.DefaultColorRest=t,this.DefaultColorStem=t,this.DefaultColorLabel=t,this.DefaultColorLyrics=t,this.DefaultColorTitle=t,this.LedgerLineColorDefault=t}addGraphicalNoteToNoteMap(t,e){t.NoteToGraphicalNoteObjectId=this.NoteToGraphicalNoteMapObjectCount,this.NoteToGraphicalNoteMap.setValue(t.NoteToGraphicalNoteObjectId,e),this.NoteToGraphicalNoteMapObjectCount++}GNote(t){return m.GraphicalNote.FromNote(t,this)}clearMusicSheetObjects(){this.NoteToGraphicalNoteMap=new c.Dictionary,this.NoteToGraphicalNoteMapObjectCount=0}resetChordAccidentalTexts(t,e){t.setValue(d.AccidentalEnum.SHARP,e?"♯":"#"),t.setValue(d.AccidentalEnum.FLAT,e?"♭":"b"),t.setValue(d.AccidentalEnum.DOUBLEFLAT,e?"𝄫":"bb"),t.setValue(d.AccidentalEnum.DOUBLESHARP,e?"𝄪":"x")}setChordSymbolLabelText(t,e){this.ChordSymbolLabelTexts.setValue(t,e)}resetChordSymbolLabelTexts(t){return t.setValue(f.ChordSymbolEnum.minor,"m"),t.setValue(f.ChordSymbolEnum.augmented,"aug"),t.setValue(f.ChordSymbolEnum.diminished,"dim"),t.setValue(f.ChordSymbolEnum.dominant,"7"),t.setValue(f.ChordSymbolEnum.majorseventh,"maj7"),t.setValue(f.ChordSymbolEnum.minorseventh,"m7"),t.setValue(f.ChordSymbolEnum.diminishedseventh,"dim7"),t.setValue(f.ChordSymbolEnum.augmentedseventh,"aug7"),t.setValue(f.ChordSymbolEnum.halfdiminished,`m7${this.ChordAccidentalTexts.getValue(d.AccidentalEnum.FLAT)}5`),t.setValue(f.ChordSymbolEnum.majorminor,"m(maj7)"),t.setValue(f.ChordSymbolEnum.majorsixth,"maj6"),t.setValue(f.ChordSymbolEnum.minorsixth,"m6"),t.setValue(f.ChordSymbolEnum.dominantninth,"9"),t.setValue(f.ChordSymbolEnum.majorninth,"maj9"),t.setValue(f.ChordSymbolEnum.minorninth,"m9"),t.setValue(f.ChordSymbolEnum.dominant11th,"11"),t.setValue(f.ChordSymbolEnum.major11th,"maj11"),t.setValue(f.ChordSymbolEnum.minor11th,"m11"),t.setValue(f.ChordSymbolEnum.dominant13th,"13"),t.setValue(f.ChordSymbolEnum.major13th,"maj13"),t.setValue(f.ChordSymbolEnum.minor13th,"m13"),t.setValue(f.ChordSymbolEnum.suspendedsecond,"sus2"),t.setValue(f.ChordSymbolEnum.suspendedfourth,"sus4"),t.setValue(f.ChordSymbolEnum.power,"5"),t.setValue(f.ChordSymbolEnum.none,"N.C."),t}addChordName(t,e,i,s,n){if(void 0!==f.ChordSymbolEnum[e]){const r={adds:i,alts:s,subs:n};this.CustomChords.push(f.CustomChord.createCustomChord(t,f.ChordSymbolEnum[e],r))}}renameChord(t,e){f.CustomChord.renameCustomChord(t,e,this.CustomChords)}resetChordNames(){const t=this.ChordAccidentalTexts.getValue(d.AccidentalEnum.SHARP),e=this.ChordAccidentalTexts.getValue(d.AccidentalEnum.FLAT);this.addChordName("alt","major",[`${t}5`,`${e}9`,`${t}9`],[`${e}5`],[]),this.addChordName("7alt","dominant",[`${t}5`,`${e}9`,`${t}9`],[`${e}5`],[]),this.addChordName("7sus4","dominant",["4"],[],["3"]),this.addChordName("7sus4","suspendedfourth",["7"],[],[]),this.addChordName("9sus4","dominantninth",["4"],[],["3"]),this.addChordName("9sus4","suspendedfourth",["9"],[],[]),this.addChordName("11sus4","dominant11th",["4"],[],["3"]),this.addChordName("11sus4","suspendedfourth",["11"],[],[]),this.addChordName("13sus4","dominant13th",["4"],[],["3"]),this.addChordName("13sus4","suspendedfourth",["13"],[],[]),this.addChordName("7sus2","dominant",["2"],[],["3"]),this.addChordName("7sus2","suspendedsecond",["7"],[],[]),this.addChordName(`m7${e}5`,"minorseventh",[],[`${e}5`],[]),this.addChordName("9sus2","dominantninth",["2"],[],["3"]),this.addChordName("9sus2","suspendedsecond",["9"],[],[]),this.addChordName("11sus2","dominant11th",["2"],[],["3"]),this.addChordName("11sus2","suspendedsecond",["11"],[],[]),this.addChordName("13sus2","dominant13th",["2"],[],["3"]),this.addChordName("13sus2","suspendedsecond",["13"],[],[]),this.addChordName("m(maj9)","majorminor",["9"],[],[]),this.addChordName("m(maj11)","majorminor",["11"],[],[]),this.addChordName("m(maj13)","majorminor",["13"],[],[]),this.addChordName("69","majorsixth",["9"],[],[]),this.addChordName("mi69","minorsixth",["9"],[],[])}calculateCurveParametersArrays(){this.TPower3=new Array(this.BezierCurveStepSize),this.OneMinusTPower3=new Array(this.BezierCurveStepSize),this.FactorOne=new Array(this.BezierCurveStepSize),this.FactorTwo=new Array(this.BezierCurveStepSize);for(let t=0;t<this.BezierCurveStepSize;t++){const e=t/this.BezierCurveStepSize;this.TPower3[t]=Math.pow(e,3),this.OneMinusTPower3[t]=Math.pow(1-e,3),this.FactorOne[t]=3*Math.pow(1-e,2)*e,this.FactorTwo[t]=3*(1-e)*Math.pow(e,2)}}}e.EngravingRules=p,p.unit=1;class b{constructor(t,e,i="noIdStringGiven"){this.width=t,this.height=e,this.idString=i}get aspectRatio(){return this.IsUndefined?0:this.width/this.height}get IsUndefined(){return void 0===this.width||void 0===this.height||0===this.height||0===this.width}static get UndefinedPageFormat(){return new b(0,0)}Equals(t){return!!t&&t.width===this.width&&t.height===this.height}}e.PageFormat=b},4146:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalChordSymbolContainer=void 0;const s=i(2255),n=i(9946),r=i(4123),o=i(8911),a=i(4785),l=i(9086);class h extends a.GraphicalObject{constructor(t,e,i,s,n,r){super(),this.chordSymbolContainer=t,this.boundingBox=new o.BoundingBox(this,e),this.rules=r,this.calculateLabel(i,n,s)}get GetChordSymbolContainer(){return this.chordSymbolContainer}get GraphicalLabel(){return this.graphicalLabel}calculateLabel(t,e,i){const o=r.ChordSymbolContainer.calculateChordText(this.chordSymbolContainer,e,i);this.graphicalLabel=new n.GraphicalLabel(new s.Label(o),t,this.rules.ChordSymbolTextAlignment,this.rules,this.boundingBox),this.graphicalLabel.PositionAndShape.RelativePosition=new l.PointF2D(this.rules.ChordSymbolRelativeXOffset,0),this.graphicalLabel.Label.colorDefault=this.rules.DefaultColorChordSymbol}}e.GraphicalChordSymbolContainer=h},3442:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalComment=void 0,e.GraphicalComment=class{constructor(t,e){this.label=t,this.settings=e}}},374:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalContinuousDynamicExpression=void 0;const n=i(6729),r=i(7839),o=i(9086),a=i(6791),l=i(3748),h=s(i(2043));class c extends a.AbstractGraphicalExpression{constructor(t,e,i){super(e,t,i),this.lines=[],this.isSplittedPart=!1,this.notToBeRemoved=!1}get StartMeasure(){return this.startMeasure}set StartMeasure(t){this.startMeasure=t}get EndMeasure(){return this.endMeasure}set EndMeasure(t){this.endMeasure=t}get EndStaffLine(){return this.endMeasure?this.endMeasure.ParentStaffLine:void 0}get IsSplittedPart(){return this.isSplittedPart}set IsSplittedPart(t){this.isSplittedPart=t}get IsVerbal(){return this.ContinuousDynamic.Label&&this.ContinuousDynamic.Label.length>0}get NotToBeRemoved(){return this.notToBeRemoved}set NotToBeRemoved(t){this.notToBeRemoved=t}get Lines(){return this.lines}get ContinuousDynamic(){return this.SourceExpression}updateSkyBottomLine(){var t;const e=this.parentStaffLine.SkyBottomLineCalculator,i=this.IsVerbal?this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginLeft:0,s=this.IsVerbal?this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginRight:0;switch(!this.IsSoftAccent&&!this.IsVerbal&&this.lines.length<2&&h.default.warn("Not enough lines for SkyBottomLine calculation"),this.IsVerbal||this.ContinuousDynamic.DynamicType!==r.ContDynamicEnum.crescendo&&this.ContinuousDynamic.DynamicType!==r.ContDynamicEnum.diminuendo&&h.default.warn("GraphicalContinuousDynamicExpression.updateSkyBottomLine(): unhandled continuous dynamic type. start measure: "+(null===(t=this.startMeasure)||void 0===t?void 0:t.MeasureNumber)),this.Placement){case l.PlacementEnum.Above:if(this.IsSoftAccent)e.updateSkyLineWithWedge(this.lines[0].Start,this.lines[0].End),e.updateSkyLineWithWedge(this.lines[2].End,this.lines[2].Start),e.updateSkyLineWithLine(this.lines[0].End,this.lines[2].End,this.lines[0].End.y);else if(this.IsVerbal){const t=this.label.PositionAndShape.BorderMarginTop+this.label.PositionAndShape.RelativePosition.y;e.updateSkyLineInRange(i,s,t)}else this.ContinuousDynamic.DynamicType===r.ContDynamicEnum.crescendo?e.updateSkyLineWithWedge(this.lines[0].Start,this.lines[0].End):this.ContinuousDynamic.DynamicType===r.ContDynamicEnum.diminuendo&&e.updateSkyLineWithWedge(this.lines[0].End,this.lines[0].Start);break;case l.PlacementEnum.Below:if(this.IsVerbal){const t=this.label.PositionAndShape.BorderMarginBottom+this.label.PositionAndShape.RelativePosition.y;e.updateBottomLineInRange(i,s,t)}else this.ContinuousDynamic.DynamicType===r.ContDynamicEnum.crescendo?e.updateBottomLineWithWedge(this.lines[1].Start,this.lines[1].End):this.ContinuousDynamic.DynamicType===r.ContDynamicEnum.diminuendo&&e.updateBottomLineWithWedge(this.lines[1].End,this.lines[1].Start);break;default:h.default.error("Placement for GraphicalContinuousDynamicExpression is unknown")}}createCrescendoLines(t,e,i,s=this.rules.WedgeOpeningLength,n=this.rules.WedgeLineWidth){const r=new o.PointF2D(t,i),a=new o.PointF2D(e,i-s/2),l=new o.PointF2D(e,i+s/2);this.addWedgeLines(r,a,l,n)}createFirstHalfCrescendoLines(t,e,i,s=this.rules.WedgeMeasureEndOpeningLength,n=this.rules.WedgeLineWidth){const r=new o.PointF2D(t,i),a=new o.PointF2D(e,i-s/2),l=new o.PointF2D(e,i+s/2);this.addWedgeLines(r,a,l,n)}createSecondHalfCrescendoLines(t,e,i,s=this.rules.WedgeMeasureBeginOpeningLength,n=this.rules.WedgeOpeningLength,r=this.rules.WedgeLineWidth){const a=new o.PointF2D(t,i-s/2),l=new o.PointF2D(t,i+s/2),h=new o.PointF2D(e,i-n/2),c=new o.PointF2D(e,i+n/2);this.addDoubleLines(a,h,l,c,r)}recalculateCrescendoLines(t,e,i){const s=Math.abs(this.lines[0].Start.y-this.lines[1].Start.y)>1e-4;this.lines.clear(),s?this.createSecondHalfCrescendoLines(t,e,i):this.isSplittedPart?this.createFirstHalfCrescendoLines(t,e,i):this.createCrescendoLines(t,e,i)}createDiminuendoLines(t,e,i,s=this.rules.WedgeOpeningLength,n=this.rules.WedgeLineWidth){const r=new o.PointF2D(t,i-s/2),a=new o.PointF2D(t,i+s/2),l=new o.PointF2D(e,i);this.addWedgeLines(l,r,a,n)}createFirstHalfDiminuendoLines(t,e,i,s=this.rules.WedgeOpeningLength,n=this.rules.WedgeMeasureEndOpeningLength,r=this.rules.WedgeLineWidth){const a=new o.PointF2D(t,i-s/2),l=new o.PointF2D(t,i+s/2),h=new o.PointF2D(e,i-n/2),c=new o.PointF2D(e,i+n/2);this.addDoubleLines(a,h,l,c,r)}createSecondHalfDiminuendoLines(t,e,i,s=this.rules.WedgeMeasureBeginOpeningLength,n=this.rules.WedgeLineWidth){const r=new o.PointF2D(t,i-s/2),a=new o.PointF2D(t,i+s/2),l=new o.PointF2D(e,i);this.addWedgeLines(l,r,a,n)}recalculateDiminuendoLines(t,e,i){const s=Math.abs(this.lines[0].End.y-this.lines[1].End.y)>1e-4;this.lines.clear(),s?this.createFirstHalfDiminuendoLines(t,e,i):this.isSplittedPart?this.createSecondHalfDiminuendoLines(t,e,i):this.createDiminuendoLines(t,e,i)}calcPsi(){this.IsVerbal?this.PositionAndShape.calculateBoundingBox():(this.PositionAndShape.RelativePosition=this.lines[0].Start,this.PositionAndShape.BorderMarginTop=this.lines[0].End.y-this.lines[0].Start.y,this.PositionAndShape.BorderMarginBottom=this.lines[1].End.y-this.lines[1].Start.y,this.PositionAndShape.Center.y=(this.PositionAndShape.BorderMarginTop+this.PositionAndShape.BorderMarginBottom)/2,this.IsSoftAccent?(this.PositionAndShape.BorderMarginLeft=0,this.PositionAndShape.BorderMarginRight=this.lines[3].Start.x-this.lines[0].Start.x):this.ContinuousDynamic.DynamicType===r.ContDynamicEnum.crescendo?(this.PositionAndShape.BorderMarginLeft=0,this.PositionAndShape.BorderMarginRight=this.lines[0].End.x-this.lines[0].Start.x):(this.PositionAndShape.BorderMarginLeft=this.lines[0].End.x-this.lines[0].Start.x,this.PositionAndShape.BorderMarginRight=0))}cleanUp(){this.lines.clear()}shiftYPosition(t){this.IsVerbal?(this.PositionAndShape.RelativePosition.y+=t,this.PositionAndShape.calculateBoundingBox()):(this.lines[0].Start.y+=t,this.lines[0].End.y+=t,this.lines[1].End.y+=t)}squeeze(t){this.IsVerbal||Math.abs(this.lines[0].End.x-this.lines[0].Start.x)<Math.abs(t)||(this.ContinuousDynamic.DynamicType===r.ContDynamicEnum.crescendo?t>0?this.lines[0].Start.x+=t:(this.lines[0].End.x+=t,this.lines[1].End.x+=t):t<0?this.lines[0].Start.x+=t:(this.lines[0].End.x+=t,this.lines[1].End.x+=t),this.calcPsi())}addWedgeLines(t,e,i,s){const r=new n.GraphicalLine(t,e,s),o=new n.GraphicalLine(t,i,s);this.rules.DefaultColorMusic&&(r.colorHex=this.rules.DefaultColorMusic,o.colorHex=this.rules.DefaultColorMusic),this.lines.push(r),this.lines.push(o)}addDoubleLines(t,e,i,s,r){const o=new n.GraphicalLine(t,e,r),a=new n.GraphicalLine(i,s,r);this.rules.DefaultColorMusic&&(o.colorHex=this.rules.DefaultColorMusic,a.colorHex=this.rules.DefaultColorMusic),this.lines.push(o),this.lines.push(a)}}e.GraphicalContinuousDynamicExpression=c},5330:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalCurve=void 0;const s=i(9086);class n{constructor(){n.tPow3=new Array(n.bezierCurveStepSize),n.oneMinusTPow3=new Array(n.bezierCurveStepSize),n.bezierFactorOne=new Array(n.bezierCurveStepSize),n.bezierFactorTwo=new Array(n.bezierCurveStepSize);for(let t=0;t<n.bezierCurveStepSize;t++){const e=t/n.bezierCurveStepSize;n.tPow3[t]=Math.pow(e,3),n.oneMinusTPow3[t]=Math.pow(1-e,3),n.bezierFactorOne[t]=3*Math.pow(1-e,2)*e,n.bezierFactorTwo[t]=3*(1-e)*Math.pow(e,2)}}calculateCurvePointAtIndex(t){const e=Math.round(t*n.bezierCurveStepSize);return e<0||e>=n.bezierCurveStepSize?new s.PointF2D:new s.PointF2D(n.oneMinusTPow3[e]*this.bezierStartPt.x+n.bezierFactorOne[e]*this.bezierStartControlPt.x+n.bezierFactorTwo[e]*this.bezierEndControlPt.x+n.tPow3[e]*this.bezierEndPt.x,n.oneMinusTPow3[e]*this.bezierStartPt.y+n.bezierFactorOne[e]*this.bezierStartControlPt.y+n.bezierFactorTwo[e]*this.bezierEndControlPt.y+n.tPow3[e]*this.bezierEndPt.y)}}e.GraphicalCurve=n,n.bezierCurveStepSize=1e3},1443:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalGlissando=void 0;const s=i(9086),n=i(8911),r=i(6729);e.GraphicalGlissando=class{constructor(t){this.Glissando=t,this.staffEntries=[]}calculateLine(t){const e=this.staffEntries[0],i=this.staffEntries[this.staffEntries.length-1],o=e.findGraphicalNoteFromNote(this.Glissando.StartNote),a=i.findGraphicalNoteFromNote(this.Glissando.EndNote);if(!o&&!a)return;const l=e.parentMeasure.ParentStaffLine;let h,c,u,d;if(o&&e.parentMeasure.ParentStaffLine===this.StaffLine)h=o.PositionAndShape.RelativePosition.x+o.parentVoiceEntry.parentStaffEntry.PositionAndShape.RelativePosition.x+o.parentVoiceEntry.parentStaffEntry.parentMeasure.PositionAndShape.RelativePosition.x+t.GlissandoNoteOffset,u=o.PositionAndShape.AbsolutePosition.y;else{h=i.parentMeasure.beginInstructionsWidth-.4;const e=this.Glissando.Direction===n.ColDirEnum.Down?-1:1;u=a.PositionAndShape.AbsolutePosition.y+e*t.GlissandoStafflineStartYDistanceToNote}if(a&&i.parentMeasure.ParentStaffLine===this.StaffLine)c=a.PositionAndShape.RelativePosition.x+a.parentVoiceEntry.parentStaffEntry.PositionAndShape.RelativePosition.x+a.parentVoiceEntry.parentStaffEntry.parentMeasure.PositionAndShape.RelativePosition.x-.5-t.GlissandoNoteOffset,h>c&&(h=c-t.GlissandoStafflineStartMinimumWidth),d=a.PositionAndShape.AbsolutePosition.y;else{if(l.Measures.last().parentSourceMeasure.HasEndLine)return;c=l.PositionAndShape.Size.width,c-h>t.GlissandoStafflineEndOffset&&(h=c-t.GlissandoStafflineEndOffset);const e=this.Glissando.Direction===n.ColDirEnum.Down?1:-1;d=o.PositionAndShape.AbsolutePosition.y+e*t.GlissandoStafflineStartYDistanceToNote}const f=new s.PointF2D(h,u),m=new s.PointF2D(c,d);void 0===this.Width&&(this.Width=t.GlissandoDefaultWidth),this.Line=new r.GraphicalLine(f,m,this.Width)}}},9428:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalInstantaneousDynamicExpression=void 0;const n=i(6791),r=i(3748),o=s(i(2043));class a extends n.AbstractGraphicalExpression{constructor(t,e,i){super(e,t,i.parentSourceMeasure),this.mInstantaneousDynamicExpression=t,this.mMeasure=i}updateSkyBottomLine(){const t=this.parentStaffLine.SkyBottomLineCalculator,e=this.PositionAndShape.RelativePosition.x+this.PositionAndShape.BorderMarginLeft,i=this.PositionAndShape.RelativePosition.x+this.PositionAndShape.BorderMarginRight;let s=0;switch(this.Placement){case r.PlacementEnum.Above:s=this.PositionAndShape.RelativePosition.y+this.PositionAndShape.BorderMarginTop,t.updateSkyLineInRange(e,i,s);break;case r.PlacementEnum.Below:s=this.PositionAndShape.RelativePosition.y+this.PositionAndShape.BorderMarginBottom,t.updateBottomLineInRange(e,i,s);break;default:o.default.error("Placement for GraphicalInstantaneousDynamicExpression is unknown")}}}e.GraphicalInstantaneousDynamicExpression=a},5277:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalInstantaneousTempoExpression=void 0;const s=i(6791);class n extends s.AbstractGraphicalExpression{constructor(t,e){super(e.PositionAndShape.Parent.DataObject,t,t.parentMeasure),this.label=e}get GraphicalLabel(){return this.label}updateSkyBottomLine(){}}e.GraphicalInstantaneousTempoExpression=n},9946:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalLabel=void 0;const s=i(1274),n=i(8911),r=i(4278),o=i(4040);class a extends r.Clickable{constructor(t,e,i,s,r){super(),this.label=t,this.boundingBox=new n.BoundingBox(this,r),this.label.fontHeight=e,this.label.textAlignment=i,this.rules=s}get Label(){return this.label}toString(){return`${this.label.text} (${this.boundingBox.RelativePosition.x},${this.boundingBox.RelativePosition.y})`}setLabelPositionAndShapeBorders(){var t,e;if(""===this.Label.text.trim())return;this.TextLines=[];const i=null!==(e=null===(t=this.rules)||void 0===t?void 0:t.LabelMarginBorderFactor)&&void 0!==e?e:.1,n=this.Label.text.split(/[\n\r]+/g),r=n.length;let a=0;for(let t=0;t<r;t++){const e=n[t].trim(),i=o.MusicSheetCalculator.TextMeasurer.computeTextWidthToHeightRatio(e,this.Label.font,this.Label.fontStyle,this.label.fontFamily),s=this.Label.fontHeight*i;a=Math.max(a,s),this.TextLines.push({text:e,xOffset:0,width:s})}for(const t of this.TextLines){let e=0;switch(this.Label.textAlignment){case s.TextAlignmentEnum.RightBottom:case s.TextAlignmentEnum.RightCenter:case s.TextAlignmentEnum.RightTop:e=a-t.width;break;case s.TextAlignmentEnum.CenterBottom:case s.TextAlignmentEnum.CenterCenter:case s.TextAlignmentEnum.CenterTop:e=(a-t.width)/2}t.xOffset=e}let l=this.Label.fontHeight*r;this.rules.SpacingBetweenTextLines>0&&this.TextLines.length>1&&(l+=this.rules.SpacingBetweenTextLines*r/10);const h=this.PositionAndShape;switch(this.Label.textAlignment){case s.TextAlignmentEnum.CenterBottom:h.BorderTop=-l,h.BorderLeft=-a/2,h.BorderBottom=0,h.BorderRight=a/2;break;case s.TextAlignmentEnum.CenterCenter:h.BorderTop=-l/2,h.BorderLeft=-a/2,h.BorderBottom=l/2,h.BorderRight=a/2;break;case s.TextAlignmentEnum.CenterTop:h.BorderTop=0,h.BorderLeft=-a/2,h.BorderBottom=l,h.BorderRight=a/2;break;case s.TextAlignmentEnum.LeftBottom:h.BorderTop=-l,h.BorderLeft=0,h.BorderBottom=0,h.BorderRight=a;break;case s.TextAlignmentEnum.LeftCenter:h.BorderTop=-l/2,h.BorderLeft=0,h.BorderBottom=l/2,h.BorderRight=a;break;case s.TextAlignmentEnum.LeftTop:h.BorderTop=0,h.BorderLeft=0,h.BorderBottom=l,h.BorderRight=a;break;case s.TextAlignmentEnum.RightBottom:h.BorderTop=-l,h.BorderLeft=-a,h.BorderBottom=0,h.BorderRight=0;break;case s.TextAlignmentEnum.RightCenter:h.BorderTop=-l/2,h.BorderLeft=-a,h.BorderBottom=l/2,h.BorderRight=0;break;case s.TextAlignmentEnum.RightTop:h.BorderTop=0,h.BorderLeft=-a,h.BorderBottom=l,h.BorderRight=0}h.BorderMarginTop=h.BorderTop-l*i,h.BorderMarginLeft=h.BorderLeft-l*i,h.BorderMarginBottom=h.BorderBottom+l*i,h.BorderMarginRight=h.BorderRight+l*i}}e.GraphicalLabel=a},6729:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalLine=void 0;const s=i(8155);e.GraphicalLine=class{constructor(t,e,i=0,n=s.OutlineAndFillStyleEnum.BaseWritingColor,r){this.start=t,this.end=e,this.width=i,this.styleId=n,this.colorHex=r}get Start(){return this.start}set Start(t){this.start=t}get End(){return this.end}set End(t){this.end=t}get Width(){return this.width}set Width(t){this.width=t}}},5091:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalLyricEntry=void 0;const s=i(9946),n=i(2255),r=i(9086),o=i(1274);e.GraphicalLyricEntry=class{constructor(t,e,i,a){this.lyricsEntry=t,this.graphicalStaffEntry=e;const l=e.parentMeasure.parentSourceMeasure.Rules.LyricsAlignmentStandard;t.Text.length>=4&&t.Parent.Notes[0].Length.Denominator>4&&o.TextAlignmentEnum.LeftBottom;const h=new n.Label(t.Text),c=this.graphicalStaffEntry.parentMeasure.parentSourceMeasure.Rules;this.graphicalLabel=new s.GraphicalLabel(h,i,l,c,e.PositionAndShape),this.graphicalLabel.Label.colorDefault=c.DefaultColorLyrics,this.graphicalLabel.PositionAndShape.RelativePosition=new r.PointF2D(0,a),l===o.TextAlignmentEnum.LeftBottom&&(this.graphicalLabel.PositionAndShape.RelativePosition.x-=1)}get LyricsEntry(){return this.lyricsEntry}get ParentLyricWord(){return this.graphicalLyricWord}set ParentLyricWord(t){this.graphicalLyricWord=t}get GraphicalLabel(){return this.graphicalLabel}set GraphicalLabel(t){this.graphicalLabel=t}get StaffEntryParent(){return this.graphicalStaffEntry}set StaffEntryParent(t){this.graphicalStaffEntry=t}}},8720:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalLyricWord=void 0,e.GraphicalLyricWord=class{constructor(t){this.graphicalLyricsEntries=[],this.lyricWord=t,this.initialize()}get GetLyricWord(){return this.lyricWord}get GraphicalLyricsEntries(){return this.graphicalLyricsEntries}set GraphicalLyricsEntries(t){this.graphicalLyricsEntries=t}isFilled(){for(let t=0;t<this.graphicalLyricsEntries.length;t++)if(!this.graphicalLyricsEntries[t])return!1;return!0}initialize(){for(let t=0;t<this.lyricWord.Syllables.length;t++)this.graphicalLyricsEntries.push(void 0)}}},7963:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalMarkedArea=void 0,e.GraphicalMarkedArea=class{constructor(t,e,i,s){this.systemRectangle=t,this.labelRectangle=e,this.label=i,this.settings=s}}},1513:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalMeasure=void 0;const s=i(4785),n=i(1797),r=i(8911),o=i(9086);class a extends s.GraphicalObject{constructor(t,e,i){super(),this.hasOnlyRests=!1,this.measureNumber=-1,this.ShowTimeSignature=!0,this.ShowKeySignature=!0,this.parentStaff=t,this.parentSourceMeasure=e,this.parentStaffLine=i,i?(this.parentStaff=i.ParentStaff,this.PositionAndShape=new r.BoundingBox(this,i.PositionAndShape)):this.PositionAndShape=new r.BoundingBox(this),this.PositionAndShape.BorderBottom=4,this.parentSourceMeasure&&(this.measureNumber=this.parentSourceMeasure.MeasureNumber),this.staffEntries=[]}get ParentStaff(){return this.parentStaff}get ParentMusicSystem(){return this.parentMusicSystem}set ParentMusicSystem(t){this.parentMusicSystem=t}get MeasureNumber(){return this.measureNumber}get FirstInstructionStaffEntry(){return this.firstInstructionStaffEntry}set FirstInstructionStaffEntry(t){this.firstInstructionStaffEntry=t}get LastInstructionStaffEntry(){return this.lastInstructionStaffEntry}set LastInstructionStaffEntry(t){this.lastInstructionStaffEntry=t}get ParentStaffLine(){return this.parentStaffLine}set ParentStaffLine(t){this.parentStaffLine=t,this.parentStaffLine&&(this.PositionAndShape.Parent=this.parentStaffLine.PositionAndShape)}resetLayout(){throw new Error("not implemented")}getLineWidth(t){throw new Error("not implemented")}addClefAtBegin(t){throw new Error("not implemented")}addKeyAtBegin(t,e,i){throw new Error("not implemented")}addRhythmAtBegin(t){throw new Error("not implemented")}addClefAtEnd(t,e=!0){throw new Error("not implemented")}setPositionInStaffline(t){this.PositionAndShape.RelativePosition=new o.PointF2D(t,0)}setWidth(t){this.PositionAndShape.BorderRight=t}layoutSymbols(){throw new Error("not implemented")}findGraphicalStaffEntryFromTimestamp(t){var e;for(let i=0,s=this.staffEntries.length;i<s;++i){const s=this.staffEntries[i];if(null===(e=s.relInMeasureTimestamp)||void 0===e?void 0:e.Equals(t))return s}}findGraphicalStaffEntryFromVerticalContainerTimestamp(t){for(let e=0,i=this.staffEntries.length;e<i;++e){const i=this.staffEntries[e];if(i.sourceStaffEntry.VerticalContainerParent.getAbsoluteTimestamp().Equals(t))return i}}hasSameDurationWithSourceMeasureParent(){const t=new n.Fraction(0,1);for(let e=0,i=this.staffEntries.length;e<i;++e){const i=this.staffEntries[e];t.Add(i.findStaffEntryMinNoteLength())}return t.Equals(this.parentSourceMeasure.Duration)}hasMultipleVoices(){if(0===this.staffEntries.length)return!1;const t=[];for(let e=0,i=this.staffEntries.length;e<i;++e){const i=this.staffEntries[e];for(let e=0,s=i.sourceStaffEntry.VoiceEntries.length;e<s;++e){const s=i.sourceStaffEntry.VoiceEntries[e];t.indexOf(s.ParentVoice)<0&&t.push(s.ParentVoice)}}return t.length>1}isVisible(){return this.ParentStaff.ParentInstrument.Visible}getGraphicalMeasureDurationFromStaffEntries(){let t=new n.Fraction(0,1);const e=[];for(let t=0,i=this.staffEntries.length;t<i;++t){const i=this.staffEntries[t];for(let t=0,s=i.sourceStaffEntry.VoiceEntries.length;t<s;++t){const s=i.sourceStaffEntry.VoiceEntries[t];e.indexOf(s.ParentVoice)<0&&e.push(s.ParentVoice)}}for(let i=0,s=e.length;i<s;++i){const s=e[i],r=new n.Fraction(0,1);for(const t of this.staffEntries)for(const e of t.graphicalVoiceEntries)e.parentVoiceEntry.ParentVoice===s&&e.notes.length>0&&r.Add(e.notes[0].graphicalNoteLength);t.lt(r)&&(t=n.Fraction.createFromFraction(r))}return t}addGraphicalStaffEntry(t){this.staffEntries.push(t)}addGraphicalStaffEntryAtTimestamp(t){if(t)if(0===this.staffEntries.length||this.staffEntries[this.staffEntries.length-1].relInMeasureTimestamp.lt(t.relInMeasureTimestamp))this.staffEntries.push(t);else for(let e=this.staffEntries.length-1;e>=0;e--){if(this.staffEntries[e].relInMeasureTimestamp.lt(t.relInMeasureTimestamp)){this.staffEntries.splice(e+1,0,t);break}0===e&&this.staffEntries.splice(e,0,t)}}isPianoRightHand(){return this.isUpperStaffOfInstrument()}isPianoLeftHand(){return this.isLowerStaffOfInstrument()}isUpperStaffOfInstrument(){return 1===this.parentStaff.ParentInstrument.Staves.length||this.ParentStaff===this.parentStaff.ParentInstrument.Staves[0]}isLowerStaffOfInstrument(){return 1!==this.parentStaff.ParentInstrument.Staves.length&&this.ParentStaff===this.ParentStaff.ParentInstrument.Staves.last()}beginsWithLineRepetition(){const t=this.parentSourceMeasure;return!!t&&t.beginsWithLineRepetition()}endsWithLineRepetition(){const t=this.parentSourceMeasure;return!!t&&t.endsWithLineRepetition()}beginsWithWordRepetition(){const t=this.parentSourceMeasure;return!!t&&t.beginsWithWordRepetition()}endsWithWordRepetition(){const t=this.parentSourceMeasure;return!!t&&t.endsWithWordRepetition()}getTransposedHalftones(){return this.parentStaff.ParentInstrument.GetMusicSheet.Transpose+this.parentStaff.ParentInstrument.Transpose}}e.GraphicalMeasure=a},599:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PagePlacementEnum=e.GraphicalMusicPage=void 0;const s=i(8911),n=i(4785),r=i(9086);class o extends n.GraphicalObject{constructor(t){super(),this.musicSystems=[],this.labels=[],this.parent=t,this.boundingBox=new s.BoundingBox(this,void 0)}get MusicSystems(){return this.musicSystems}set MusicSystems(t){this.musicSystems=t}get Labels(){return this.labels}set Labels(t){this.labels=t}get Parent(){return this.parent}set Parent(t){this.parent=t}get PageNumber(){return this.pageNumber}set PageNumber(t){this.pageNumber=t}setMusicPageAbsolutePosition(t,e){return new r.PointF2D(0,0)}}var a;e.GraphicalMusicPage=o,(a=e.PagePlacementEnum||(e.PagePlacementEnum={}))[a.Down=0]="Down",a[a.Right=1]="Right",a[a.RightDown=2]="RightDown"},4324:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SystemImageProperties=e.GraphicalMusicSheet=void 0;const n=i(525),r=i(6729),o=i(9086),a=i(289),l=i(5198),h=i(1797),c=i(8911),u=s(i(2043)),d=i(2337),f=i(5974),m=i(4785);e.GraphicalMusicSheet=class{constructor(t,e){this.musicPages=[],this.measureList=[],this.verticalGraphicalStaffEntryContainers=[],this.cursors=[],this.leadSheet=!1,this.musicSheet=t,this.numberOfStaves=this.musicSheet.Staves.length,this.calculator=e,this.calculator.initialize(this)}get ParentMusicSheet(){return this.musicSheet}get GetCalculator(){return this.calculator}get MusicPages(){return this.musicPages}set MusicPages(t){this.musicPages=t}get MeasureList(){return this.measureList}set MeasureList(t){this.measureList=t}get VerticalGraphicalStaffEntryContainers(){return this.verticalGraphicalStaffEntryContainers}set VerticalGraphicalStaffEntryContainers(t){this.verticalGraphicalStaffEntryContainers=t}get Title(){return this.title}set Title(t){this.title=t}get Subtitle(){return this.subtitle}set Subtitle(t){this.subtitle=t}get Composer(){return this.composer}set Composer(t){this.composer=t}get Lyricist(){return this.lyricist}set Lyricist(t){this.lyricist=t}get Copyright(){return this.copyright}set Copyright(t){this.copyright=t}get Cursors(){return this.cursors}get SelectionStartSymbol(){return this.selectionStartSymbol}get SelectionEndSymbol(){return this.selectionEndSymbol}get MinAllowedSystemWidth(){return this.minAllowedSystemWidth}set MinAllowedSystemWidth(t){this.minAllowedSystemWidth=t}get NumberOfStaves(){return this.numberOfStaves}get LeadSheet(){return this.leadSheet}set LeadSheet(t){this.leadSheet=t}static transformRelativeToAbsolutePosition(t){for(let e=0;e<t.MusicPages.length;e++){const i=t.MusicPages[e].setMusicPageAbsolutePosition(e,t.ParentMusicSheet.Rules);t.MusicPages[e].PositionAndShape.calculateAbsolutePositionsRecursive(i.x,i.y)}}Initialize(){this.verticalGraphicalStaffEntryContainers=[],this.musicPages=[],this.measureList=[]}reCalculate(){this.calculator.calculate()}EnforceRedrawOfMusicSystems(){for(let t=0,e=this.musicPages.length;t<e;++t){const e=this.musicPages[t];for(let t=0,i=e.MusicSystems.length;t<i;++t)e.MusicSystems[t].needsToBeRedrawn=!0}}getClickedObject(t){for(let e=0,i=this.MusicPages.length;e<i;++e)return this.MusicPages[e].PositionAndShape.getClickedObjectOfType(t)}findGraphicalMeasure(t,e){for(let i=t;i>=0;i--){const t=this.measureList[i][e];if(t)return t}}findGraphicalStaffEntryFromMeasureList(t,e,i){for(let s=e;s<this.measureList.length;s++){const e=this.measureList[s][t];if(e)for(let t=0,s=e.staffEntries.length;t<s;++t){const s=e.staffEntries[t];if(s.sourceStaffEntry===i)return s}}}findNextGraphicalStaffEntry(t,e,i){const s=i.parentMeasure,n=s.staffEntries.indexOf(i);if(n<s.staffEntries.length-1)return s.staffEntries[n+1];if(e<this.measureList.length-1){const i=this.measureList[e+1][t];if(i.staffEntries.length>0)return i.staffEntries[0]}}getFirstVisibleMeasuresListFromIndices(t,e){const i=[],s=this.measureList[0].length;for(let n=t;n<=e;n++)for(let t=0;t<s;t++)if(this.measureList[n][t].isVisible()){i.push(this.measureList[n][t]);break}return i}orderMeasuresByStaffLine(t){const e=[];let i=[];e.push(i);for(let s=0;s<t.length;s++)0===s?i.push(t[0]):(t[s].ParentStaffLine===t[s-1].ParentStaffLine||(-1===e.indexOf(i)&&e.push(i),i=[],e.push(i)),i.push(t[s]));return e}initializeActiveClefs(){const t=[],e=this.musicSheet.getFirstSourceMeasure();if(e)for(let i=0;i<e.CompleteNumberOfStaves;i++){let s=new a.ClefInstruction;if(e.FirstInstructionsStaffEntries[i])for(let t=0,n=e.FirstInstructionsStaffEntries[i].Instructions.length;t<n;++t){const n=e.FirstInstructionsStaffEntries[i].Instructions[t];n instanceof a.ClefInstruction&&(s=n)}t.push(s)}return t}GetMainKey(){const t=this.musicSheet.getFirstSourceMeasure();if(t)for(let e=0;e<t.CompleteNumberOfStaves;e++)for(let i=0,s=t.FirstInstructionsStaffEntries[e].Instructions.length;i<s;++i){const s=t.FirstInstructionsStaffEntries[e].Instructions[i];if(s instanceof l.KeyInstruction)return s}}getOrCreateVerticalContainer(t){if(0===this.verticalGraphicalStaffEntryContainers.length||d.CollectionUtil.getLastElement(this.verticalGraphicalStaffEntryContainers).AbsoluteTimestamp.lt(t)){const e=new n.VerticalGraphicalStaffEntryContainer(this.numberOfStaves,t);return this.verticalGraphicalStaffEntryContainers.push(e),e}for(let e=this.verticalGraphicalStaffEntryContainers.length-1;e>=0;e--){if(this.verticalGraphicalStaffEntryContainers[e].AbsoluteTimestamp.lt(t)){const i=new n.VerticalGraphicalStaffEntryContainer(this.numberOfStaves,t);return this.verticalGraphicalStaffEntryContainers.splice(e+1,0,i),i}if(this.verticalGraphicalStaffEntryContainers[e].AbsoluteTimestamp.Equals(t))return this.verticalGraphicalStaffEntryContainers[e]}}GetVerticalContainerFromTimestamp(t,e=0){const i=d.CollectionUtil.binarySearch(this.verticalGraphicalStaffEntryContainers,new n.VerticalGraphicalStaffEntryContainer(0,t),n.VerticalGraphicalStaffEntryContainer.compareByTimestamp,e);if(i>=0)return this.verticalGraphicalStaffEntryContainers[i]}GetInterpolatedIndexInVerticalContainers(t){const e=this.verticalGraphicalStaffEntryContainers;let i,s,n=0,r=e.length-1;if(t.lte(e[e.length-1].AbsoluteTimestamp)){for(;r-n>1;){const i=Math.floor((r+n)/2);if(e[n].AbsoluteTimestamp.Equals(t)){r=n;break}if(e[r].AbsoluteTimestamp.Equals(t)){n=r;break}if(e[i].AbsoluteTimestamp.Equals(t))return this.verticalGraphicalStaffEntryContainers.indexOf(e[i]);t.lt(e[i].AbsoluteTimestamp)?r=i:n=i}if(n===r)return this.verticalGraphicalStaffEntryContainers.indexOf(e[n]);i=e[n].AbsoluteTimestamp,s=e[r].AbsoluteTimestamp}else i=e[e.length-1].AbsoluteTimestamp,s=h.Fraction.plus(this.getLongestStaffEntryDuration(e.length-1),i),r=e.length;const o=s.RealValue-i.RealValue,a=r-(s.RealValue-t.RealValue)/o;return Math.min(a,this.verticalGraphicalStaffEntryContainers.length)}getVisibleStavesIndicesFromSourceMeasure(t){const e=[],i=[];for(let i=0,s=t.length;i<s;++i){const s=t[i].ParentStaff.ParentInstrument;-1===e.indexOf(s)&&e.push(s)}for(let t=0,s=e.length;t<s;++t){const s=e[t],n=this.musicSheet.getGlobalStaffIndexOfFirstStaff(s);for(let t=0;t<s.Staves.length;t++)i.push(n+t)}return i}getGraphicalMeasureFromSourceMeasureAndIndex(t,e){var i;for(let s=0;s<this.measureList.length;s++)if((null===(i=this.measureList[s][0])||void 0===i?void 0:i.parentSourceMeasure)===t)return this.measureList[s][e]}getLastGraphicalMeasureFromIndex(t,e=!0){let i=this.measureList.length-1;return e&&(i=Math.min(i,this.musicSheet.Rules.MaxMeasureToDrawIndex)),this.measureList[i][t]}getMeasureIndex(t,e,i){for(e=0;e<this.measureList.length;e++)for(let i=0,s=this.measureList[e].length;i<s;++i)if(this.measureList[e][i]===t)return!0;return!1}GetNearestGraphicalObject(t,e=m.GraphicalObject.name,i=5,s=20,n=5,r){const a=[];for(;0===a.length&&i<=s;){const s=new c.BoundingBox(void 0);s.BorderLeft=t.x-i,s.BorderTop=t.y-i,s.BorderRight=t.x+i,s.BorderBottom=t.y+i,s.AbsolutePosition=new o.PointF2D(t.x,t.y),s.calculateAbsolutePosition();for(let t=0,i=this.MusicPages.length;t<i;++t){const i=this.MusicPages[t].PositionAndShape.getObjectsInRegion(s,!1,e);if(i&&0!==i.length)for(let t=0,e=i.length;t<e;++t)r?r(i[t])&&a.push(i[t]):a.push(i[t])}i+=n}let l;for(let e=0,i=a.length;e<i;++e){const i=a[e];(void 0===l||this.CalculateDistance(i.PositionAndShape.AbsolutePosition,t)<this.CalculateDistance(l.PositionAndShape.AbsolutePosition,t))&&(l=i)}if(l)return l}GetNearestVoiceEntry(t){return this.GetNearestGraphicalObject(t,f.GraphicalVoiceEntry.name,5,20,5,(t=>{var e;return void 0!==(null===(e=t.parentStaffEntry)||void 0===e?void 0:e.relInMeasureTimestamp)}))}GetNearestNote(t,e){const i=this.GetNearestVoiceEntry(t);if(!i)return;let s,n=Number.MAX_SAFE_INTEGER;for(const e of i.notes){const i=e.PositionAndShape.AbsolutePosition.y,r=Math.abs(e.PositionAndShape.AbsolutePosition.x-t.x),o=Math.abs(i-t.y);r+o<n&&(s=e,n=r+o)}return s}domToSvg(t){return this.domToSvgTransform(t,!0)}svgToDom(t){return this.domToSvgTransform(t,!1)}svgToOsmd(t){const e=new o.PointF2D(t.x,t.y);return e.x/=10,e.y/=10,e}domToSvgTransform(t,e){const i=this.drawer.Backends[0].getSvgElement(),s=i.createSVGPoint();s.x=t.x,s.y=t.y;let n=i.getScreenCTM();e&&(n=n.inverse());const r=s.matrixTransform(n);return new o.PointF2D(r.x,r.y)}GetClickableLabel(t){const e=new c.BoundingBox;e.BorderLeft=t.x-4,e.BorderTop=t.y-4,e.BorderRight=t.x+4,e.BorderBottom=t.y+4,e.AbsolutePosition=new o.PointF2D(0,0);for(let t=0,i=this.MusicPages.length;t<i;++t){const i=this.MusicPages[t].PositionAndShape.getObjectsInRegion(e);if(1===i.length)for(let t=0,e=i.length;t<e;++t)return i[t]}}GetNearestStaffEntry(t){const e=[],i=new c.BoundingBox(void 0);i.BorderLeft=t.x-10,i.BorderTop=t.y-10,i.BorderRight=t.x+10,i.BorderBottom=t.y+10,i.AbsolutePosition=new o.PointF2D(0,0);for(let t=0,s=this.MusicPages.length;t<s;++t){const s=this.MusicPages[t].PositionAndShape.getObjectsInRegion(i,!1);if(s&&0!==s.length)for(let t=0,i=s.length;t<i;++t){const i=s[t];e.push(i)}}let s;for(let i=0,n=e.length;i<n;++i){const n=e[i];if(void 0===s)s=n;else{if(!n.relInMeasureTimestamp)continue;this.CalculateDistance(n.PositionAndShape.AbsolutePosition,t)<this.CalculateDistance(s.PositionAndShape.AbsolutePosition,t)&&(s=n)}}if(s)return s}GetPossibleCommentAnchor(t){const e=this.GetNearestStaffEntry(t);if(e)return e.sourceStaffEntry}getClickedObjectOfType(t){for(let e=0,i=this.musicPages.length;e<i;++e){const i=this.musicPages[e].PositionAndShape.getClickedObjectOfType(t);if(i)return i}}tryGetTimestampFromPosition(t){const e=this.getClickedObjectOfType(t);if(e)return e.getAbsoluteTimestamp()}tryGetClickableLabel(t){try{return this.GetClickableLabel(t)}catch(e){u.default.info("GraphicalMusicSheet.tryGetClickableObject","positionOnMusicSheet: "+t,e)}}tryGetTimeStampFromPosition(t){try{const e=this.GetNearestStaffEntry(t);if(!e)return;return e.getAbsoluteTimestamp()}catch(e){u.default.info("GraphicalMusicSheet.tryGetTimeStampFromPosition","positionOnMusicSheet: "+t,e)}}getStaffEntry(t){const e=this.VerticalGraphicalStaffEntryContainers[t];let i;try{for(let t=0,s=e.StaffEntries.length;t<s;++t){const s=e.StaffEntries[t];s&&s.sourceStaffEntry.ParentStaff.ParentInstrument.Visible&&(i?s.PositionAndShape&&i.PositionAndShape&&i.PositionAndShape.RelativePosition.x>s.PositionAndShape.RelativePosition.x&&(i=s):i=s)}}catch(t){u.default.info("GraphicalMusicSheet.getStaffEntry",t)}return i}GetPreviousVisibleContainerIndex(t){for(let e=t-1;e>=0;e--){const t=this.verticalGraphicalStaffEntryContainers[e].StaffEntries;for(let i=0,s=t.length;i<s;++i){const s=t[i];if(s&&s.sourceStaffEntry.ParentStaff.ParentInstrument.Visible)return e}}return-1}GetNextVisibleContainerIndex(t){for(let e=t+1;e<this.verticalGraphicalStaffEntryContainers.length;++e){const t=this.verticalGraphicalStaffEntryContainers[e].StaffEntries;for(let i=0,s=t.length;i<s;++i){const s=t[i];if(s&&s.sourceStaffEntry.ParentStaff.ParentInstrument.Visible)return e}}return-1}findClosestLeftStaffEntry(t,e){let i,s=Math.floor(t);s=Math.min(this.VerticalGraphicalStaffEntryContainers.length-1,s);for(let t=s;t>=0;t--)if(i=this.getStaffEntry(t),i){if(!e)return i;if(i.sourceStaffEntry.ParentStaff.ParentInstrument.Visible)return i}}findClosestRightStaffEntry(t,e){let i;for(let s=Math.max(0,Math.ceil(t));s<this.VerticalGraphicalStaffEntryContainers.length;s++)if(i=this.getStaffEntry(s),i){if(!e)return i;if(i.sourceStaffEntry.ParentStaff.ParentInstrument.Visible)return i}}calculateCursorLineAtTimestamp(t,e){const i=this.calculateXPositionFromTimestamp(t),s=i[0],n=i[1];if(!n||0===n.StaffLines.length)return;const a=n.PositionAndShape.AbsolutePosition.y,l=d.CollectionUtil.last(n.StaffLines).PositionAndShape.RelativePosition.y+4;return new r.GraphicalLine(new o.PointF2D(s,a),new o.PointF2D(s,a+l),3,e)}calculateXPositionFromTimestamp(t){var e,i,s,n;let r;const o=this.GetInterpolatedIndexInVerticalContainers(t),a=this.findClosestLeftStaffEntry(o,!0),l=this.findClosestRightStaffEntry(o,!0),c=t.RealValue;if(!a&&!l)return[0,void 0];let u,d;if(u=a?null===(e=a.parentMeasure.ParentStaffLine)||void 0===e?void 0:e.ParentMusicSystem:null===(i=l.parentMeasure.ParentStaffLine)||void 0===i?void 0:i.ParentMusicSystem,d=l?null===(s=l.parentMeasure.ParentStaffLine)||void 0===s?void 0:s.ParentMusicSystem:null===(n=a.parentMeasure.ParentStaffLine)||void 0===n?void 0:n.ParentMusicSystem,u===d){let t,e,i;if(r=u,a)if(l)e=a.PositionAndShape.AbsolutePosition.x,i=l.PositionAndShape.AbsolutePosition.x,t=a===l?0:(c-a.getAbsoluteTimestamp().RealValue)/(l.getAbsoluteTimestamp().RealValue-a.getAbsoluteTimestamp().RealValue);else{e=a.PositionAndShape.AbsolutePosition.x,i=r.GetRightBorderAbsoluteXPosition();const s=a.parentMeasure.parentSourceMeasure;t=(c-a.getAbsoluteTimestamp().RealValue)/(h.Fraction.plus(s.AbsoluteTimestamp,s.Duration).RealValue-a.getAbsoluteTimestamp().RealValue)}else e=i=l.PositionAndShape.AbsolutePosition.x,t=0;return t=Math.min(1,Math.max(0,t)),[e+t*(i-e),r]}{const t=l.parentMeasure.parentSourceMeasure.AbsoluteTimestamp.RealValue;let e,i;if(c<t){r=u;const s=a.PositionAndShape.AbsolutePosition.x,n=r.GetRightBorderAbsoluteXPosition();e=(c-a.getAbsoluteTimestamp().RealValue)/(t-a.getAbsoluteTimestamp().RealValue),e=Math.min(1,Math.max(0,e)),i=s+e*(n-s)}else{r=d;const s=l.PositionAndShape.AbsolutePosition.x,n=r.GetLeftBorderAbsoluteXPosition();e=(c-t)/(l.getAbsoluteTimestamp().RealValue-t),e=Math.min(1,Math.max(0,e)),i=n+e*(s-n)}return[i,r]}}GetNumberOfVisibleInstruments(){let t=0;for(let e=0,i=this.musicSheet.Instruments.length;e<i;++e)!0===this.musicSheet.Instruments[e].Visible&&t++;return t}GetNumberOfFollowedInstruments(){let t=0;for(let e=0,i=this.musicSheet.Instruments.length;e<i;++e)!0===this.musicSheet.Instruments[e].Following&&t++;return t}GetGraphicalFromSourceStaffEntry(t){var e;if(!(null===(e=t.VerticalContainerParent.ParentMeasure)||void 0===e?void 0:e.VerticalMeasureList))return;const i=t.VerticalContainerParent.ParentMeasure.VerticalMeasureList[t.ParentStaff.idInMusicSheet];return null==i?void 0:i.findGraphicalStaffEntryFromTimestamp(t.Timestamp)}CalculateDistance(t,e){const i=t.x-e.x,s=t.y-e.y;return i*i+s*s}getLongestStaffEntryDuration(t){let e=new h.Fraction(0,1);for(const i of this.verticalGraphicalStaffEntryContainers[t].StaffEntries){if(!i)continue;const t=i.findStaffEntryMaxNoteLength();e.lt(t)&&(e=t)}return e}},e.SystemImageProperties=class{}},3486:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalNote=void 0;const s=i(8640),n=i(4785),r=i(4040),o=i(8911);class a extends n.GraphicalObject{constructor(t,e,i,n){super(),this.DrawnAccidental=s.AccidentalEnum.NONE,this.lineShift=0,this.sourceNote=t,this.parentVoiceEntry=e,this.PositionAndShape=new o.BoundingBox(this,e.PositionAndShape),this.graphicalNoteLength=n||t.Length,this.numberOfDots=this.calculateNumberOfNeededDots(this.graphicalNoteLength),this.rules=i,this.rules.addGraphicalNoteToNoteMap(t,this)}Transpose(t,e,i,s){let n=this.sourceNote.Pitch;return r.MusicSheetCalculator.transposeCalculator&&(n=r.MusicSheetCalculator.transposeCalculator.transposePitch(this.sourceNote.Pitch,t,i)),n}calculateNumberOfNeededDots(t){return this.sourceNote&&this.sourceNote.NoteTuplet?0:t.calculateNumberOfNeededDots()}get ParentMusicPage(){return this.parentVoiceEntry.parentStaffEntry.parentMeasure.ParentMusicSystem.Parent}static FromNote(t,e){return e.NoteToGraphicalNoteMap.getValue(t.NoteToGraphicalNoteObjectId)}}e.GraphicalNote=a},4785:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalObject=void 0;const s=i(1035);class n extends s.AClassHierarchyTrackable{get PositionAndShape(){return this.boundingBox}set PositionAndShape(t){this.boundingBox=t}}e.GraphicalObject=n},873:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalOctaveShift=void 0;const s=i(4785),n=i(5853),r=i(8911),o=i(158),a=i(1703);class l extends s.GraphicalObject{constructor(t,e){super(),this.getOctaveShift=t,this.setSymbol(),this.PositionAndShape=new r.BoundingBox(this,e)}setSymbol(){switch(this.getOctaveShift.Type){case n.OctaveEnum.VA8:this.octaveSymbol=o.MusicSymbol.VA8;break;case n.OctaveEnum.VB8:this.octaveSymbol=o.MusicSymbol.VB8;break;case n.OctaveEnum.MA15:this.octaveSymbol=o.MusicSymbol.MA15;break;case n.OctaveEnum.MB15:this.octaveSymbol=o.MusicSymbol.MB15;break;default:throw new a.ArgumentOutOfRangeException("")}}}e.GraphicalOctaveShift=l},4082:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalPedal=void 0;const s=i(4785),n=i(8911),r=i(158);class o extends s.GraphicalObject{constructor(t,e){super(),this.getPedal=t,this.setSymbol(),this.PositionAndShape=new n.BoundingBox(this,e)}setSymbol(){!this.getPedal.IsLine&&this.getPedal.IsSign?this.pedalSymbol=r.MusicSymbol.PEDAL_SYMBOL:this.getPedal.IsLine&&this.getPedal.IsSign?this.pedalSymbol=r.MusicSymbol.PEDAL_MIXED:this.pedalSymbol=r.MusicSymbol.PEDAL_BRACKET}}e.GraphicalPedal=o},3411:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalRectangle=void 0;const s=i(8911),n=i(4785);class r extends n.GraphicalObject{constructor(t,e,i,n){super(),this.boundingBox=new s.BoundingBox(this,i),this.boundingBox.RelativePosition=t,this.boundingBox.BorderRight=e.x-t.x,this.boundingBox.BorderBottom=e.y-t.y,this.style=n}}e.GraphicalRectangle=r},9876:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalSlur=void 0;const n=i(9086),r=i(5330),o=i(3748),a=i(8363),l=i(2947),h=i(1797),c=i(908);var u=s(i(6368)).default.Flow;class d extends r.GraphicalCurve{constructor(t,e){super(),this.staffEntries=[],this.slur=t,this.rules=e}static Compare(t,e){if(t.staffEntries.length<1)return-1;if(e.staffEntries.length<1)return 1;const i=h.Fraction.minus(t.staffEntries[t.staffEntries.length-1].getAbsoluteTimestamp(),t.staffEntries[0].getAbsoluteTimestamp()),s=h.Fraction.minus(e.staffEntries[e.staffEntries.length-1].getAbsoluteTimestamp(),e.staffEntries[0].getAbsoluteTimestamp());return i.RealValue>s.RealValue?1:s.RealValue>i.RealValue?-1:0}calculateCurve(t){const e=this.staffEntries[0],i=this.staffEntries[this.staffEntries.length-1];let s=e.findGraphicalNoteFromNote(this.slur.StartNote);!s&&this.graceStart&&(s=e.findGraphicalNoteFromGraceNote(this.slur.StartNote)),s||(s=e.findEndTieGraphicalNoteFromNoteWithStartingSlur(this.slur.StartNote,this.slur));let r=i.findGraphicalNoteFromNote(this.slur.EndNote);!r&&this.graceEnd&&(r=i.findGraphicalNoteFromGraceNote(this.slur.EndNote));const l=e.parentMeasure.ParentStaffLine,h=l.SkyBottomLineCalculator;this.calculatePlacement(h,l);const c=this.calculateStartAndEnd(s,r,l,t,h),u=c.startX,d=c.endX;let f=c.startY,m=c.endY;const p=t.SlurTangentMinAngle,b=t.SlurTangentMaxAngle;let g;if(this.placement===o.PlacementEnum.Above){f-=t.SlurNoteHeadYOffset,m-=t.SlurNoteHeadYOffset;const e=new n.PointF2D(this.staffEntries[0].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[0].PositionAndShape.RelativePosition.x,f);s?e.x+=this.staffEntries[0].PositionAndShape.BorderRight:e.x=this.staffEntries[0].parentMeasure.beginInstructionsWidth,this.graceStart&&(e.x+=i.PositionAndShape.RelativePosition.x);const o=new n.PointF2D(this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].PositionAndShape.RelativePosition.x,m);if(r?o.x+=this.staffEntries[this.staffEntries.length-1].PositionAndShape.BorderLeft:o.x=this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.Size.width,this.graceEnd&&(o.x+=i.staffEntryParent.PositionAndShape.RelativePosition.x),g=this.calculateTopPoints(e,o,l,h),0===g.length){const t=new n.PointF2D((o.x-e.x)/2+e.x,(o.y-e.y)/2+e.y);g.push(t)}const c=Math.atan((m-f)/(d-u)),S=new n.PointF2D(0,0);let y=new n.PointF2D(d-u,-(m-f));const E=a.Matrix2D.getRotationMatrix(c),v=E.getTransposeMatrix();y=E.vectorMultiplication(y);const x=this.calculateTranslatedAndRotatedPointListAbove(g,u,f,E),_=this.calculateMaxLeftSlope(x,S,y),M=this.calculateMaxRightSlope(x,S,y),w=S.y-S.x*_,P=y.y-y.x*M,T=new n.PointF2D;let L=!1;Math.abs(Math.abs(_)-Math.abs(M))<1e-4?(T.x=y.x/2,T.y=0,L=!0):(T.x=(P-w)/(_-M),T.y=_*T.x+w);const A=this.calculateHeightWidthRatio(y.x,x),C=0,I=0;let R=p,N=-p;if(!L){const t=this.calculateAngles(p,_,M,b);R=t.startAngle,N=t.endAngle}const B=this.calculateControlPoints(y.x,R,N,x,A,f,m);let F=B.startControlPoint,D=B.endControlPoint;F=v.vectorMultiplication(F),F.x+=u,F.y=-F.y+f,D=v.vectorMultiplication(D),D.x+=u,D.y=-D.y+f,this.bezierStartPt=new n.PointF2D(u,f-C),this.bezierStartControlPt=new n.PointF2D(F.x,F.y-C),this.bezierEndControlPt=new n.PointF2D(D.x,D.y-I),this.bezierEndPt=new n.PointF2D(d,m-I);const O=l.SkyLine.length,k=h.getLeftIndexForPointX(this.bezierStartPt.x,O),V=h.getLeftIndexForPointX(this.bezierEndPt.x,O),G=this.bezierEndPt.x-this.bezierStartPt.x,W=h.SamplingUnit;for(let t=k;t<V;t++){const e=t/W-this.bezierStartPt.x,i=this.calculateCurvePointAtIndex(Math.abs(e)/G);let s=h.getLeftIndexForPointX(i.x,O);s>=k&&(l.SkyLine[s]=Math.min(l.SkyLine[s],i.y)),s++,s<O&&(l.SkyLine[s]=Math.min(l.SkyLine[s],i.y))}}else{f+=t.SlurNoteHeadYOffset,m+=t.SlurNoteHeadYOffset;const e=new n.PointF2D(this.staffEntries[0].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[0].PositionAndShape.RelativePosition.x,f);s?e.x+=this.staffEntries[0].PositionAndShape.BorderRight:e.x=this.staffEntries[0].parentMeasure.beginInstructionsWidth,this.graceStart&&(e.x+=i.PositionAndShape.RelativePosition.x);const o=new n.PointF2D(this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].PositionAndShape.RelativePosition.x,m);if(r?o.x+=this.staffEntries[this.staffEntries.length-1].PositionAndShape.BorderLeft:o.x=this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.Size.width,this.graceEnd&&(o.x+=i.staffEntryParent.PositionAndShape.RelativePosition.x),g=this.calculateBottomPoints(e,o,l,h),0===g.length){const t=new n.PointF2D((o.x-e.x)/2+e.x,(o.y-e.y)/2+e.y);g.push(t)}const c=Math.atan((m-f)/(d-u)),S=new n.PointF2D(0,0);let y=new n.PointF2D(d-u,m-f);const E=a.Matrix2D.getRotationMatrix(-c),v=E.getTransposeMatrix();y=E.vectorMultiplication(y);const x=this.calculateTranslatedAndRotatedPointListBelow(g,u,f,E),_=this.calculateMaxLeftSlope(x,S,y),M=this.calculateMaxRightSlope(x,S,y),w=S.y-S.x*_,P=y.y-y.x*M,T=new n.PointF2D;let L=!1;Math.abs(Math.abs(_)-Math.abs(M))<1e-4?(T.x=y.x/2,T.y=0,L=!0):(T.x=(P-w)/(_-M),T.y=_*T.x+w);const A=this.calculateHeightWidthRatio(y.x,x),C=0,I=0;let R=p,N=-p;if(!L){const t=this.calculateAngles(p,_,M,b);R=t.startAngle,N=t.endAngle}const B=this.calculateControlPoints(y.x,R,N,x,A,f,m);let F=B.startControlPoint,D=B.endControlPoint;F=v.vectorMultiplication(F),F.x+=u,F.y+=f,D=v.vectorMultiplication(D),D.x+=u,D.y+=f,this.bezierStartPt=new n.PointF2D(u,f+C),this.bezierStartControlPt=new n.PointF2D(F.x,F.y+C),this.bezierEndControlPt=new n.PointF2D(D.x,D.y+I),this.bezierEndPt=new n.PointF2D(d,m+I);const O=l.BottomLine.length,k=h.getLeftIndexForPointX(this.bezierStartPt.x,O),V=h.getLeftIndexForPointX(this.bezierEndPt.x,O),G=this.bezierEndPt.x-this.bezierStartPt.x,W=h.SamplingUnit;for(let t=k;t<V;t++){const e=t/W-this.bezierStartPt.x,i=this.calculateCurvePointAtIndex(Math.abs(e)/G);let s=h.getLeftIndexForPointX(i.x,O);s>=k&&(l.BottomLine[s]=Math.max(l.BottomLine[s],i.y)),s++,s<O&&(l.BottomLine[s]=Math.max(l.BottomLine[s],i.y))}}}calculateStartAndEnd(t,e,i,s,n){let r=0,a=0,l=0,h=0;if(t){r=t.PositionAndShape.RelativePosition.x+t.parentVoiceEntry.parentStaffEntry.PositionAndShape.RelativePosition.x+t.parentVoiceEntry.parentStaffEntry.parentMeasure.PositionAndShape.RelativePosition.x,this.graceStart&&(r+=t.parentVoiceEntry.parentStaffEntry.staffEntryParent.PositionAndShape.RelativePosition.x);const e=t.parentVoiceEntry;a=this.placement===o.PlacementEnum.Above?e.PositionAndShape.RelativePosition.y+e.PositionAndShape.BorderTop:e.PositionAndShape.RelativePosition.y+e.PositionAndShape.BorderBottom,e.parentVoiceEntry.StemDirection===c.StemDirectionType.Down&&this.placement===o.PlacementEnum.Below&&(r-=.5),e.parentVoiceEntry.StemDirection===c.StemDirectionType.Up&&this.placement===o.PlacementEnum.Above&&(r+=.5)}else r=0;if(e){l=e.PositionAndShape.RelativePosition.x+e.parentVoiceEntry.parentStaffEntry.PositionAndShape.RelativePosition.x+e.parentVoiceEntry.parentStaffEntry.parentMeasure.PositionAndShape.RelativePosition.x,this.graceEnd&&(l+=e.parentVoiceEntry.parentStaffEntry.staffEntryParent.PositionAndShape.RelativePosition.x);const t=e.parentVoiceEntry;let i;for(const s of t.parentVoiceEntry.Articulations)if(s.placement===o.PlacementEnum.NotYetDefined)for(const t of e.vfnote[0].modifiers)if(t.getCategory()===u.Articulation.CATEGORY){t.position===u.Modifier.Position.ABOVE?(s.placement=o.PlacementEnum.Above,i=o.PlacementEnum.Above):t.position===u.Modifier.Position.BELOW&&(s.placement=o.PlacementEnum.Below,i=o.PlacementEnum.Below);break}this.placement===o.PlacementEnum.Above?(h=t.PositionAndShape.RelativePosition.y+t.PositionAndShape.BorderTop,i===o.PlacementEnum.Above&&(h-=this.rules.SlurEndArticulationYOffset)):(h=t.PositionAndShape.RelativePosition.y+t.PositionAndShape.BorderBottom,i===o.PlacementEnum.Below&&(h+=this.rules.SlurEndArticulationYOffset)),t.parentVoiceEntry.StemDirection===c.StemDirectionType.Down&&this.placement===o.PlacementEnum.Below&&(l-=.5),t.parentVoiceEntry.StemDirection===c.StemDirectionType.Up&&this.placement===o.PlacementEnum.Above&&(l+=.5)}else l=i.PositionAndShape.Size.width;return t||e||(a=-1.5,h=-1.5),t||(a=this.placement===o.PlacementEnum.Above?h-1:h+1),e||(h=this.placement===o.PlacementEnum.Above?a-1:a+1),this.slur.startNoteHasMoreStartingSlurs()&&this.slur.isSlurLonger()&&(this.placement===o.PlacementEnum.Above?a-=s.SlursStartingAtSameStaffEntryYOffset:a+=s.SlursStartingAtSameStaffEntryYOffset),this.slur.endNoteHasMoreEndingSlurs()&&this.slur.isSlurLonger()&&(this.placement===o.PlacementEnum.Above?h-=s.SlursStartingAtSameStaffEntryYOffset:h+=s.SlursStartingAtSameStaffEntryYOffset),this.placement===o.PlacementEnum.Above?(a=Math.min(a,1.5),h=Math.min(h,1.5)):(a=Math.max(a,i.StaffHeight-1.5),h=Math.max(h,i.StaffHeight-1.5)),{startX:r,startY:a,endX:l,endY:h}}calculatePlacement(t,e){if(this.rules.SlurPlacementFromXML&&this.slur.PlacementXml!==o.PlacementEnum.NotYetDefined)return void(this.placement=this.slur.PlacementXml);for(let t=0,e=this.staffEntries.length;t<e;++t)if(this.staffEntries[t].parentMeasure.hasMultipleVoices())return void(this.slur.StartNote.ParentVoiceEntry.ParentVoice instanceof l.LinkedVoice||this.slur.EndNote.ParentVoiceEntry.ParentVoice instanceof l.LinkedVoice?this.placement=o.PlacementEnum.Below:this.placement=o.PlacementEnum.Above);for(let t=0,e=this.staffEntries.length;t<e;++t)if(this.staffEntries[t].LyricsEntries.length>0)return void(this.placement=o.PlacementEnum.Above);const i=this.staffEntries[0],s=this.staffEntries[this.staffEntries.length-1],n=i.graphicalVoiceEntries[0].parentVoiceEntry.StemDirection;if(n===s.graphicalVoiceEntries[0].parentVoiceEntry.StemDirection)this.placement=n===c.StemDirectionType.Up?o.PlacementEnum.Below:o.PlacementEnum.Above;else{let n=i.PositionAndShape.BorderLeft+i.PositionAndShape.RelativePosition.x+i.parentMeasure.PositionAndShape.RelativePosition.x,r=s.PositionAndShape.BorderRight+s.PositionAndShape.RelativePosition.x+s.parentMeasure.PositionAndShape.RelativePosition.x;this.graceStart&&(n+=s.PositionAndShape.RelativePosition.x),this.graceEnd&&(r+=s.staffEntryParent.PositionAndShape.RelativePosition.x);const a=-1*t.getSkyLineMinInRange(n,r),l=t.getBottomLineMaxInRange(n,r)-e.StaffHeight;this.placement=l>a?o.PlacementEnum.Above:o.PlacementEnum.Below}}calculateTopPoints(t,e,i,s){const r=[];let o=s.getRightIndexForPointX(t.x,i.SkyLine.length),a=s.getLeftIndexForPointX(e.x,i.SkyLine.length);o<0&&(o=0),a>=i.SkyLine.length&&(a=i.SkyLine.length-1);for(let t=o;t<a;t++){const e=i.SkyLine[t];if(0!==e){const i=new n.PointF2D((.5+t)/s.SamplingUnit,e);r.push(i)}}return r}calculateBottomPoints(t,e,i,s){const r=[];let o=s.getRightIndexForPointX(t.x,i.BottomLine.length),a=s.getLeftIndexForPointX(e.x,i.BottomLine.length);o<0&&(o=0),a>=i.BottomLine.length&&(a=i.BottomLine.length-1);for(let t=o;t<a;t++){const e=i.BottomLine[t];if(0!==e){const i=new n.PointF2D((.5+t)/s.SamplingUnit,e);r.push(i)}}return r}calculateMaxLeftSlope(t,e,i){let s=-Number.MAX_VALUE;const n=e.x,r=e.y;for(let e=0;e<t.length;e++)Math.abs(t[e].y-Number.MAX_VALUE)<1e-4||Math.abs(t[e].y- -Number.MAX_VALUE)<1e-4||(s=Math.max(s,(t[e].y-r)/(t[e].x-n)));return s=Math.max(s,Math.abs(i.y-r)/(i.x-n)),s=Math.min(s,5.6713),s}calculateMaxRightSlope(t,e,i){let s=Number.MAX_VALUE;const n=i.x,r=i.y;for(let e=0;e<t.length;e++)Math.abs(t[e].y-Number.MAX_VALUE)<1e-4||Math.abs(t[e].y- -Number.MAX_VALUE)<1e-4||(s=Math.min(s,(r-t[e].y)/(n-t[e].x)));return s=Math.min(s,(r-e.y)/(n-e.x)),s=Math.max(s,-5.6713),s}getPointListMaxY(t){let e=-Number.MAX_VALUE;for(let i=0,s=t.length;i<s;++i){const s=t[i];Math.abs(s.y- -Number.MAX_VALUE)<1e-4||Math.abs(s.y-Number.MAX_VALUE)<1e-4||(e=Math.max(e,s.y))}return e}calculateTranslatedAndRotatedPointListAbove(t,e,i,s){const r=[];for(let o=0;o<t.length;o++){if(Math.abs(t[o].y-Number.MAX_VALUE)<1e-4||Math.abs(t[o].y- -Number.MAX_VALUE)<1e-4)continue;let a=new n.PointF2D(t[o].x-e,-(t[o].y-i));a=s.vectorMultiplication(a),r.push(a)}return r}calculateTranslatedAndRotatedPointListBelow(t,e,i,s){const r=[];for(let o=0;o<t.length;o++){if(Math.abs(t[o].y-Number.MAX_VALUE)<1e-4||Math.abs(t[o].y- -Number.MAX_VALUE)<1e-4)continue;let a=new n.PointF2D(t[o].x-e,t[o].y-i);a=s.vectorMultiplication(a),r.push(a)}return r}calculateHeightWidthRatio(t,e){return 0===e.length?0:Math.max(0,this.getPointListMaxY(e))/t}calculateControlPoints(t,e,i,s,r,o,a){let l=this.rules.SlurHeightFactor,h=1;const c=this.rules.SlurHeightFlattenLongSlursCutoffAngle,u=this.rules.SlurHeightFlattenLongSlursCutoffWidth;e>c&&t>u&&(h+=t/70*this.rules.SlurHeightFlattenLongSlursFactorByWidth,h*=1+e/30*this.rules.SlurHeightFlattenLongSlursFactorByAngle,l/=h);const f=Math.min(.5,Math.max(.1,1.7*e/80*l*Math.pow(Math.max(r,.05),.4))),m=Math.min(.5,Math.max(.1,1.7*-i/80*l*Math.pow(Math.max(r,.05),.4))),p=new n.PointF2D;p.x=t*f*Math.cos(e*d.degreesToRadiansFactor),p.y=t*f*Math.sin(e*d.degreesToRadiansFactor);const b=new n.PointF2D;b.x=t-t*m*Math.cos(i*d.degreesToRadiansFactor),b.y=-t*m*Math.sin(i*d.degreesToRadiansFactor);let g=p.y-b.y;for(;this.rules.SlurMaximumYControlPointDistance&&Math.abs(g)>this.rules.SlurMaximumYControlPointDistance;)g<0?(p.y+=1,b.y-=1):(p.y-=1,b.y+=1),g=p.y-b.y;return{startControlPoint:p,endControlPoint:b}}calculateAngles(t,e,i,s){let n=Math.atan(e)/d.degreesToRadiansFactor;e>0?n+=20:n-=20;let r=Math.atan(i)/d.degreesToRadiansFactor;return i<0?r-=20:r+=20,{startAngle:Math.min(Math.max(t,n),s),endAngle:Math.max(Math.min(-t,r),-s)}}}e.GraphicalSlur=d,d.degreesToRadiansFactor=Math.PI/180},3023:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalStaffEntry=void 0;const s=i(8911),n=i(1797),r=i(4785),o=i(2337),a=i(4040);class l extends r.GraphicalObject{constructor(t,e,i){super(),this.graphicalChordContainers=[],this.tabStaffEntry=void 0,this.MaxAccidentals=0,this.graphicalInstructions=[],this.ties=[],this.graphicalTies=[],this.lyricsEntries=[],this.parentMeasure=t,this.graphicalVoiceEntries=[],this.sourceStaffEntry=e,i?(this.staffEntryParent=i,this.parentVerticalContainer=i.parentVerticalContainer,this.PositionAndShape=new s.BoundingBox(this,i.PositionAndShape)):this.PositionAndShape=new s.BoundingBox(this,t.PositionAndShape),e&&(this.relInMeasureTimestamp=e.Timestamp),this.FingeringEntries=[]}get GraphicalInstructions(){return this.graphicalInstructions}get GraphicalTies(){return this.graphicalTies}get LyricsEntries(){return this.lyricsEntries}set LyricsEntries(t){this.lyricsEntries=t}getAbsoluteTimestamp(){const t=this.parentMeasure.parentSourceMeasure.AbsoluteTimestamp.clone();return this.relInMeasureTimestamp&&t.Add(this.relInMeasureTimestamp),t}findTieGraphicalNoteFromNote(t){for(const e of this.graphicalVoiceEntries)for(const i of e.notes){const e=i.sourceNote;if(!e.isRest()&&e.Pitch.FundamentalNote===t.Pitch.FundamentalNote&&e.Pitch.Octave===t.Pitch.Octave&&e.getAbsoluteTimestamp().Equals(t.getAbsoluteTimestamp()))return i}}findEndTieGraphicalNoteFromNoteWithStartingSlur(t,e){if(t)for(const i of this.graphicalVoiceEntries)if(i.parentVoiceEntry===t.ParentVoiceEntry)for(const t of i.notes){const i=t.sourceNote;if(i.NoteTie&&-1!==i.NoteSlurs.indexOf(e))return t}}findGraphicalNoteFromGraceNote(t){if(t)for(const e of this.graphicalVoiceEntries)if(e.parentVoiceEntry===t.ParentVoiceEntry)for(const i of e.notes)if(i.sourceNote===t)return i}findGraphicalNoteFromNote(t){if(t)for(const e of this.graphicalVoiceEntries)if(e.parentVoiceEntry===t.ParentVoiceEntry)for(const i of e.notes)if(i.sourceNote===t&&this.getAbsoluteTimestamp().Equals(t.getAbsoluteTimestamp()))return i}getGraphicalNoteDurationFromVoice(t){for(const e of this.graphicalVoiceEntries)if(e.parentVoiceEntry.ParentVoice===t)return e.notes[0].graphicalNoteLength;return new n.Fraction(0,1)}findVoiceEntryGraphicalNotes(t){for(const e of this.graphicalVoiceEntries)if(e.parentVoiceEntry===t)return e.notes}isVoiceEntryPartOfLinkedVoiceEntry(t){if(this.sourceStaffEntry.Link)for(let e=0,i=this.sourceStaffEntry.Link.LinkStaffEntries.length;e<i;++e){const i=this.sourceStaffEntry.Link.LinkStaffEntries[e];if(-1!==i.VoiceEntries.indexOf(t)&&i!==this.sourceStaffEntry)return!0}return!1}findStaffEntryMinNoteLength(){let t=new n.Fraction(Number.MAX_VALUE,1);for(const e of this.graphicalVoiceEntries)for(const i of e.notes){const e=i.graphicalNoteLength;e.lt(t)&&e.GetExpandedNumerator()>0&&(t=e)}return t}findStaffEntryMaxNoteLength(){let t=new n.Fraction(0,1);for(const e of this.graphicalVoiceEntries)for(const i of e.notes){const e=i.graphicalNoteLength;t.lt(e)&&e.GetExpandedNumerator()>0&&(t=e)}return t}findOrCreateGraphicalVoiceEntry(t){for(const e of this.graphicalVoiceEntries)if(e.parentVoiceEntry===t)return e;const e=a.MusicSheetCalculator.symbolFactory.createVoiceEntry(t,this);return this.graphicalVoiceEntries.push(e),e}findOrCreateGraphicalVoiceEntryFromGraphicalNote(t){for(const e of this.graphicalVoiceEntries)if(e===t.parentVoiceEntry)return e;const e=a.MusicSheetCalculator.symbolFactory.createVoiceEntry(t.sourceNote.ParentVoiceEntry,this);return this.graphicalVoiceEntries.push(e),e}addGraphicalNoteToListAtCorrectYPosition(t,e){const i=t.notes;if(0===i.length||e.PositionAndShape.RelativePosition.y<o.CollectionUtil.last(i).PositionAndShape.RelativePosition.y)i.push(e);else for(let t=i.length-1;t>=0;t--){if(i[t].PositionAndShape.RelativePosition.y>e.PositionAndShape.RelativePosition.y){i.splice(t+1,0,e);break}if(0===t){i.splice(0,0,e);break}}}hasOnlyRests(){for(const t of this.graphicalVoiceEntries)for(const e of t.notes)if(!e.sourceNote.isRest())return!1;return!0}getSkylineMin(){var t;const e=null===(t=this.parentMeasure)||void 0===t?void 0:t.ParentStaffLine.SkyBottomLineCalculator;if(!e)return;const[i,s]=this.getAbsoluteStartAndEnd();return e.getSkyLineMinInRange(i,s)}getHighestYAtEntry(){return this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.y+this.getSkylineMin()}getLowestYAtEntry(){return this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.y+this.getBottomlineMax()}getBottomlineMax(){var t;const e=null===(t=this.parentMeasure)||void 0===t?void 0:t.ParentStaffLine.SkyBottomLineCalculator;if(!e)return;const[i,s]=this.getAbsoluteStartAndEnd();return e.getBottomLineMaxInRange(i,s)}getAbsoluteStartAndEnd(){let t=this.PositionAndShape.AbsolutePosition.x;return t-=this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.x,[t,t+this.PositionAndShape.Size.width]}}e.GraphicalStaffEntry=l},8898:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalStaffEntryLink=void 0,e.GraphicalStaffEntryLink=class{constructor(t){this.graphicalLinkedStaffEntries=[],this.staffEntryLink=t,this.initialize()}get GetStaffEntryLink(){return this.staffEntryLink}get GraphicalLinkedStaffEntries(){return this.graphicalLinkedStaffEntries}set GraphicalLinkedStaffEntries(t){this.graphicalLinkedStaffEntries=t}isFilled(){for(let t=0;t<this.graphicalLinkedStaffEntries.length;t++)if(!this.graphicalLinkedStaffEntries[t])return!1;return!0}getLinkedStaffEntriesGraphicalNotes(t){if(-1!==this.graphicalLinkedStaffEntries.indexOf(t)){const t=[];for(let e=0,i=this.graphicalLinkedStaffEntries.length;e<i;++e){const i=this.graphicalLinkedStaffEntries[e];for(const e of i.graphicalVoiceEntries)for(const i of e.notes)i.sourceNote.ParentStaffEntry.Link&&i.sourceNote.ParentVoiceEntry===this.staffEntryLink.GetVoiceEntry&&t.push(i)}return t}}initialize(){for(let t=0,e=this.staffEntryLink.LinkStaffEntries.length;t<e;++t)this.graphicalLinkedStaffEntries.push(void 0)}}},5309:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalTie=void 0,e.GraphicalTie=class{constructor(t,e,i){this.tie=t,this.startNote=e,this.endNote=i}get SVGElement(){return this.vfTie.getAttribute("el")}get GetTie(){return this.tie}get StartNote(){return this.startNote}get Tie(){return this.tie}set StartNote(t){this.startNote=t}get EndNote(){return this.endNote}set EndNote(t){this.endNote=t}}},4462:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalUnknownExpression=void 0;const n=i(6791),r=i(3748),o=s(i(2043));class a extends n.AbstractGraphicalExpression{constructor(t,e,i,s,n){super(t,new r.AbstractExpression(i),s),this.label=e,this.sourceMultiExpression=n}updateSkyBottomLine(){const t=this.parentStaffLine.SkyBottomLineCalculator,e=this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginLeft,i=this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginRight;switch(this.Placement){case r.PlacementEnum.Above:const s=this.label.PositionAndShape.BorderMarginTop+this.label.PositionAndShape.RelativePosition.y;t.updateSkyLineInRange(e,i,s);break;case r.PlacementEnum.Below:const n=this.label.PositionAndShape.BorderMarginBottom+this.label.PositionAndShape.RelativePosition.y;t.updateBottomLineInRange(e,i,n);break;default:o.default.error("Placement for GraphicalUnknownExpression is unknown")}}}e.GraphicalUnknownExpression=a},5974:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalVoiceEntry=void 0;const s=i(4785),n=i(8911),r=i(1405);class o extends s.GraphicalObject{constructor(t,e,i){super(),this.parentVoiceEntry=t,this.parentStaffEntry=e,this.PositionAndShape=new n.BoundingBox(this,e?e.PositionAndShape:void 0,!0),this.notes=[],this.rules=i||(e?e.parentMeasure.parentSourceMeasure.Rules:new r.EngravingRules)}sort(){return this.notes.sort(((t,e)=>{var i,s,n,r;return(null!==(s=null===(i=e.sourceNote.Pitch)||void 0===i?void 0:i.getHalfTone())&&void 0!==s?s:0)-(null!==(r=null===(n=t.sourceNote.Pitch)||void 0===n?void 0:n.getHalfTone())&&void 0!==r?r:0)})),this.notes}sortForVexflow(){return this.notes.sort(((t,e)=>{var i,s,n;return(null!==(s=null===(i=t.sourceNote.Pitch)||void 0===i?void 0:i.getHalfTone())&&void 0!==s?s:0)-(null!==(n=e.sourceNote.Pitch.getHalfTone())&&void 0!==n?n:0)})),this.notes}color(){}}e.GraphicalVoiceEntry=o},8823:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4040:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSheetCalculator=void 0;const n=i(4324),r=i(1797),o=i(5253),a=i(289),l=i(5853),h=i(908),c=i(5623),u=i(9086),d=i(9050),f=i(9946),m=i(1274),p=i(5198),b=i(2947),g=i(8911),S=i(4574),y=i(1070),E=i(289),v=s(i(2043)),x=i(1649),_=i(6729),M=i(2255),w=i(141),P=i(3748),T=i(5277),L=i(9667),A=i(280),C=i(7839),I=i(374),R=i(41),N=i(4462),B=i(3884);class F{constructor(){this.staffEntriesWithGraphicalTies=[],this.staffEntriesWithOrnaments=[],this.staffEntriesWithChordSymbols=[],this.staffLinesWithLyricWords=[],this.graphicalLyricWords=[],this.abstractNotImplementedErrorMessage="abstract, not implemented",this.dynamicExpressionMap=new Map}static get TextMeasurer(){return F.textMeasurer}static set TextMeasurer(t){F.textMeasurer=t}get leadSheet(){return this.graphicalMusicSheet.LeadSheet}static setMeasuresMinStaffEntriesWidth(t,e){for(let i=0,s=t.length;i<s;++i){const s=t[i];s&&(s.minimumStaffEntriesWidth=e)}}initialize(t){this.graphicalMusicSheet=t,this.rules=t.ParentMusicSheet.Rules,this.rules.clearMusicSheetObjects(),this.prepareGraphicalMusicSheet()}prepareGraphicalMusicSheet(){const t=this.graphicalMusicSheet.ParentMusicSheet;this.staffEntriesWithGraphicalTies=[],this.staffEntriesWithOrnaments=[],this.staffEntriesWithChordSymbols=[],this.staffLinesWithLyricWords=[],this.graphicalMusicSheet.Initialize();const e=this.graphicalMusicSheet.MeasureList,i=this.createAccidentalCalculators(),s=this.graphicalMusicSheet.initializeActiveClefs(),n=[],r=t.getCompleteNumberOfStaves(),o=[];for(let t=0;t<r;t++)o.push(void 0);for(let r=0,a=t.SourceMeasures.length;r<a;++r){const a=t.SourceMeasures[r],l=this.createGraphicalMeasuresForSourceMeasure(a,i,n,o,s);if(e.push(l),a.multipleRestMeasures>0&&this.rules.RenderMultipleRestMeasures){a.isReducedToMultiRest=!0,a.multipleRestMeasureNumber=1;const i=a.multipleRestMeasures-1;r+=i;for(let s=1;s<=i;s++){const i=t.SourceMeasures.indexOf(a)+s;if(i>=t.SourceMeasures.length)break;const n=t.SourceMeasures[i];n.multipleRestMeasureNumber=s+1,n.isReducedToMultiRest=!0,e.push([void 0])}}}if(this.rules.AutoGenerateMultipleRestMeasuresFromRestMeasures&&this.rules.RenderMultipleRestMeasures){let r,a=0;for(let l=0,h=t.SourceMeasures.length;l<h;++l){const h=t.SourceMeasures[l];if(!h.isReducedToMultiRest&&h.canBeReducedToMultiRest())if(a>0){r.isReducedToMultiRest=!0,r.multipleRestMeasureNumber=1,a++,h.multipleRestMeasureNumber=a,h.isReducedToMultiRest=!0;for(let t=0;t<e[l].length;t++)e[l][t]=void 0}else r=h,a=1;else if(a>1){r.multipleRestMeasures=a;const t=this.createGraphicalMeasuresForSourceMeasure(r,i,n,o,s);e[r.measureListIndex]=t,a=0,r=void 0}else a=0,r=void 0}if(a>1){r.multipleRestMeasures=a,r.isReducedToMultiRest=!0;const t=this.createGraphicalMeasuresForSourceMeasure(r,i,n,o,s);e[r.measureListIndex]=t,a=0,r=void 0}}const l=s.map((t=>t.ClefType===a.ClefEnum.percussion));this.handleStaffEntries(l),this.calculateVerticalContainersList(),this.setIndicesToVerticalGraphicalContainers()}calculate(){this.musicSystems=[],this.clearSystemsAndMeasures(),this.clearRecreatedObjects(),this.createGraphicalTies(),this.calculateSheetLabelBoundingBoxes(),this.calculateXLayout(this.graphicalMusicSheet,this.maxInstrNameLabelLength()),this.graphicalMusicSheet.MusicPages.length=0,this.calculateMusicSystems(),n.GraphicalMusicSheet.transformRelativeToAbsolutePosition(this.graphicalMusicSheet)}calculateXLayout(t,e){if(this.graphicalMusicSheet.MeasureList.length>0){let t=this.graphicalMusicSheet.MeasureList[0],e=this.calculateMeasureXLayout(t);e=this.calculateMeasureWidthFromStaffEntries(t,e),F.setMeasuresMinStaffEntriesWidth(t,e);let i=0;for(let s=1;s<this.graphicalMusicSheet.MeasureList.length;s++)t=this.graphicalMusicSheet.MeasureList[s],e=this.calculateMeasureXLayout(t),e=this.calculateMeasureWidthFromStaffEntries(t,e),e>i&&(i=e),F.setMeasuresMinStaffEntriesWidth(t,e);if(this.rules.FixedMeasureWidth){let e=i;this.rules.FixedMeasureWidthFixedValue&&(e=this.rules.FixedMeasureWidthFixedValue);for(let i=1;i<this.graphicalMusicSheet.MeasureList.length;i++)t=this.graphicalMusicSheet.MeasureList[i],F.setMeasuresMinStaffEntriesWidth(t,e)}}}calculateMeasureWidthFromStaffEntries(t,e){throw new Error(this.abstractNotImplementedErrorMessage)}formatMeasures(){throw new Error(this.abstractNotImplementedErrorMessage)}calculateMeasureXLayout(t){throw new Error(this.abstractNotImplementedErrorMessage)}initGraphicalMeasuresCreation(){throw new Error(this.abstractNotImplementedErrorMessage)}handleBeam(t,e,i){throw new Error(this.abstractNotImplementedErrorMessage)}handleTiedGraphicalNote(t,e,i,s,n,r,o,a){throw new Error(this.abstractNotImplementedErrorMessage)}handleVoiceEntryLyrics(t,e,i){throw new Error(this.abstractNotImplementedErrorMessage)}handleVoiceEntryOrnaments(t,e,i){throw new Error(this.abstractNotImplementedErrorMessage)}handleVoiceEntryArticulations(t,e,i){throw new Error(this.abstractNotImplementedErrorMessage)}handleVoiceEntryTechnicalInstructions(t,e,i){throw new Error(this.abstractNotImplementedErrorMessage)}handleTuplet(t,e,i){throw new Error(this.abstractNotImplementedErrorMessage)}layoutVoiceEntry(t,e,i,s){throw new Error(this.abstractNotImplementedErrorMessage)}layoutStaffEntry(t){throw new Error(this.abstractNotImplementedErrorMessage)}createGraphicalTie(t,e,i,s,n){throw new Error(this.abstractNotImplementedErrorMessage)}updateStaffLineBorders(t){throw new Error(this.abstractNotImplementedErrorMessage)}calculateMeasureNumberPlacement(t){const e=t.StaffLines[0];if(!e||!e.Measures[0])return void v.default.warn("calculateMeasureNumberPlacement: measure undefined for system.Id "+t.Id);let i=e.Measures[0].MeasureNumber,s=0;for(let n=0;n<e.Measures.length;n++){const r=e.Measures[n];let o=this.rules.RenderMeasureNumbersOnlyAtSystemStart&&n>1;if(1===n&&e.Measures[0].parentSourceMeasure.ImplicitMeasure&&(o=!1),o)return;0!==r.MeasureNumber&&1!==r.MeasureNumber||(i=r.MeasureNumber),s=r!==e.Measures[0]&&this.rules.MeasureNumberLabelXOffset?this.rules.MeasureNumberLabelXOffset:0;const a=this.rules.UseXMLMeasureNumbers&&1===r.MeasureNumber&&1!==r.parentSourceMeasure.getPrintedMeasureNumber();((r.MeasureNumber===i||r.MeasureNumber>=i+this.rules.MeasureNumberLabelOffset)&&!r.parentSourceMeasure.ImplicitMeasure||a)&&((1!==r.MeasureNumber||1===r.MeasureNumber&&r!==e.Measures[0]||a)&&this.calculateSingleMeasureNumberPlacement(r,e,t,s),i=r.MeasureNumber)}}calculateSingleMeasureNumberPlacement(t,e,i,s=0){const n=t.parentSourceMeasure.getPrintedMeasureNumber().toString(),r=new M.Label(n),o=new f.GraphicalLabel(r,this.rules.MeasureNumberLabelHeight,m.TextAlignmentEnum.LeftBottom,this.rules),a=e.SkyBottomLineCalculator;o.setLabelPositionAndShapeBorders(),o.PositionAndShape.Parent=i.PositionAndShape;const l=e.PositionAndShape.RelativePosition.x+t.PositionAndShape.RelativePosition.x-o.PositionAndShape.BorderMarginLeft+s;let h,c=l,d=l-o.PositionAndShape.BorderLeft+o.PositionAndShape.BorderRight;c-=e.PositionAndShape.RelativePosition.x,d-=e.PositionAndShape.RelativePosition.x;const p=c+.5,b=d-.5,g=a.getSkyLineMinInRange(p,b);if(t===e.Measures[0]){let t=0;if(i.GroupBrackets.length>0)for(const e of i.GroupBrackets)t=Math.min(t,e.PositionAndShape.BorderTop);h=Math.min(g,t)}else h=g;h=Math.min(0,h),o.PositionAndShape.RelativePosition=new u.PointF2D(l,h),i.MeasureNumberLabels.push(o)}calculateMeasureNumberSkyline(t){const e=t.StaffLines[0];for(const i of t.MeasureNumberLabels){let t=i.PositionAndShape.RelativePosition.x,s=t-i.PositionAndShape.BorderLeft+i.PositionAndShape.BorderRight;t-=e.PositionAndShape.RelativePosition.x,s-=e.PositionAndShape.RelativePosition.x,e.SkyBottomLineCalculator.updateSkyLineInRange(t,s,i.PositionAndShape.RelativePosition.y+i.PositionAndShape.BorderMarginTop)}}layoutGraphicalTie(t,e,i){throw new Error(this.abstractNotImplementedErrorMessage)}calculateSingleStaffLineLyricsPosition(t,e){let i=0,s=this.rules.StaffHeight;const n=new Map,r=[],o=t.SkyBottomLineCalculator;let a=t.Measures.length;for(let e=0;e<a;++e){const a=t.Measures[e],l=a.PositionAndShape.RelativePosition,h=a.staffEntries.length;for(let t=0;t<h;++t){const e=a.staffEntries[t],h=e.LyricsEntries.length;for(let t=0;t<h;++t){const i=e.LyricsEntries[t].LyricsEntry;n[i.VerseNumber]=i.IsChorus}if(h>0){r.push(e),i=Math.max(i,e.LyricsEntries.length);const t=e.PositionAndShape.RelativePosition.x+l.x;let n=Number.MAX_VALUE,a=Number.MIN_VALUE;for(let i=0;i<e.LyricsEntries.length;i++){const s=e.LyricsEntries[i].GraphicalLabel;n=Math.min(n,t+s.PositionAndShape.BorderMarginLeft),a=Math.max(a,t+s.PositionAndShape.BorderMarginRight)}const h=o.getBottomLineMaxInRange(n,a);s=Math.max(s,h+this.rules.LyricsYMarginToBottomLine)}}}let l=0;a=r.length;for(const t of r){const i=[];let r=!0;for(let e=0;e<t.LyricsEntries.length;e++)r&&(r=t.LyricsEntries[e].LyricsEntry.IsChorus);for(const t of e)n[t]===r&&i.push(t);for(let e=0;e<t.LyricsEntries.length;e++){const n=t.LyricsEntries[e],r=n.GraphicalLabel,o=n.LyricsEntry.VerseNumber,a=i.indexOf(o);let h=s+this.rules.LyricsHeight+this.rules.VerticalBetweenLyricsDistance+this.rules.LyricsYOffsetToStaffHeight+(this.rules.VerticalBetweenLyricsDistance+this.rules.LyricsHeight)*a;this.leadSheet&&(h=3.4+(this.rules.VerticalBetweenLyricsDistance+this.rules.LyricsHeight)*a);const c=r.PositionAndShape.RelativePosition.x;r.PositionAndShape.RelativePosition=new u.PointF2D(c,h),r.Label.fontStyle=n.LyricsEntry.FontStyle,l=Math.max(l,h)}}if(r.length>0){const e=t.PositionAndShape.Size.width;let i=r[0].PositionAndShape.RelativePosition.x+r[0].PositionAndShape.BorderMarginLeft+r[0].parentMeasure.PositionAndShape.RelativePosition.x;i=i>e?e:i,o.updateBottomLineInRange(i,e,l)}return r}calculateLyricsExtendsAndDashes(t){for(let e=0,i=t.length;e<i;++e){const i=t[e];for(let t=0;t<i.LyricsEntries.length;t++){const e=i.LyricsEntries[t];e.ParentLyricWord&&e.ParentLyricWord.GraphicalLyricsEntries[e.ParentLyricWord.GraphicalLyricsEntries.length-1]!==e&&this.calculateSingleLyricWord(e),e.LyricsEntry.extend&&this.calculateLyricExtend(e)}}}calculateSingleOctaveShift(t,e,i,s){throw new Error(this.abstractNotImplementedErrorMessage)}calculateWordRepetitionInstruction(t,e){throw new Error(this.abstractNotImplementedErrorMessage)}calculateMoodAndUnknownExpression(t,e,i){var s;const n=t.AbsoluteTimestamp,r=this.graphicalMusicSheet.MeasureList[e];let o=new u.PointF2D;if(t.MoodList.length>0||t.UnknownList.length>0){let e="";for(let i=0,s=t.EntriesList.length;i<s;++i){const s=t.EntriesList[i];""!==s.prefix&&(e+=""===e?s.prefix:" "+s.prefix),e+=""===e?s.label:" "+s.label}const a=r[i].ParentStaffLine;if(!a)return void v.default.debug("MusicSheetCalculator.calculateMoodAndUnknownExpression: staffLine undefined. Returning.");o=this.getRelativePositionInStaffLineFromTimestamp(n,i,a,null==a?void 0:a.isPartOfMultiStaffInstrument()),Math.abs(o.x-0)<1e-4&&(o.x=r[i].beginInstructionsWidth+this.rules.RhythmRightMargin);const l=this.rules.UnknownTextHeight,h=t.getPlacementOfFirstEntry(),c=this.calculateLabel(a,o,e,t.getFontstyleOfFirstEntry(),h,l),u=new N.GraphicalUnknownExpression(a,c,h,null===(s=r[i])||void 0===s?void 0:s.parentSourceMeasure,t);a.AbstractExpressions.push(u)}}clearRecreatedObjects(){for(let t=0,e=this.staffEntriesWithGraphicalTies.length;t<e;++t)this.staffEntriesWithGraphicalTies[t].GraphicalTies.length=0;this.staffEntriesWithGraphicalTies.length=0}handleStaffEntryLink(t,e){v.default.debug("handleStaffEntryLink not implemented")}calculateMusicSystems(){if(!this.graphicalMusicSheet.MeasureList)return;const t=this.graphicalMusicSheet.MeasureList;if(!t)return;this.rules.MinMeasureToDrawIndex>t.length-1&&(v.default.debug("minimum measure to draw index out of range. resetting min measure index to limit."),this.rules.MinMeasureToDrawIndex=t.length-1);const e=[];for(let i=this.rules.MinMeasureToDrawIndex,s=t.length;i<s&&i<=this.rules.MaxMeasureToDrawIndex;++i){const s=[];for(let e=0,n=t[i].length;e<n;++e){const n=t[i][e];if((null==n?void 0:n.isVisible())&&(s.push(n),this.rules.ColoringEnabled))for(const t of n.staffEntries)for(const e of t.graphicalVoiceEntries)e.color()}e.push(s)}let i=0;for(let t=0,s=e.length;t<s;++t){const s=e[t];i=Math.max(s.length,i);break}if(0===i)return;const s=new c.MusicSystemBuilder;if(s.initialize(this.graphicalMusicSheet,e,i),this.musicSystems=s.buildMusicSystems(),this.formatMeasures(),this.leadSheet||(this.optimizeRestPlacement(),this.calculateStaffEntryArticulationMarks(),this.rules.RenderSlurs&&this.calculateTieCurves()),this.calculateSkyBottomLines(),this.calculateTupletNumbers(),this.rules.RenderMeasureNumbers)for(let t=0,e=this.musicSystems.length;t<e;++t){const e=this.musicSystems[t];this.calculateMeasureNumberPlacement(e)}if(this.calculateFingerings(),!this.leadSheet&&this.rules.RenderSlurs&&this.calculateSlurs(),this.calculateGlissandi(),this.rules.RenderMeasureNumbers)for(let t=0,e=this.musicSystems.length;t<e;++t){const e=this.musicSystems[t];this.calculateMeasureNumberSkyline(e)}this.leadSheet||this.calculateOrnaments(),this.calculateChordSymbols(),this.leadSheet||(this.calculateDynamicExpressions(),this.calculateMoodAndUnknownExpressions(),this.calculateExpressionAlignements(),this.calculateOctaveShifts(),this.rules.RenderPedals&&this.calculatePedals(),this.calculateWordRepetitionInstructions()),this.calculateRepetitionEndings(),this.leadSheet||this.calculateTempoExpressions(),this.calculateRehearsalMarks(),this.calculateLyricsPosition();for(let t=0,e=this.musicSystems.length;t<e;++t){const e=this.musicSystems[t];for(let t=0,i=e.StaffLines.length;t<i;++t){const i=e.StaffLines[t];this.updateStaffLineBorders(i)}}s.calculateSystemYLayout(),this.calculateComments(),this.calculateMarkedAreas();for(let t=0,e=this.graphicalMusicSheet.MusicPages.length;t<e;++t){const e=this.graphicalMusicSheet.MusicPages[t];for(let i=0,s=e.MusicSystems.length;i<s;++i){const s=0===t&&0===i,n=e.MusicSystems[i];n.setMusicSystemLabelsYPosition(),this.leadSheet?n===n.Parent.MusicSystems[0]&&n.createSystemLeftLine(this.rules.SystemThinLineWidth,this.rules.SystemLabelsRightMargin,s):(n.setYPositionsToVerticalLineObjectsAndCreateLines(this.rules),n.createSystemLeftLine(this.rules.SystemThinLineWidth,this.rules.SystemLabelsRightMargin,s),n.createInstrumentBrackets(this.graphicalMusicSheet.ParentMusicSheet.Instruments,this.rules.StaffHeight),n.createGroupBrackets(this.graphicalMusicSheet.ParentMusicSheet.InstrumentalGroups,this.rules.StaffHeight,0),n.alignBeginInstructions()),n.calculateBorders(this.rules)}const i=e.MusicSystems[0].PositionAndShape.BorderTop;for(let t=0,s=e.MusicSystems.length;t<s;++t){const s=e.MusicSystems[t];s.PositionAndShape.RelativePosition=new u.PointF2D(s.PositionAndShape.RelativePosition.x,s.PositionAndShape.RelativePosition.y-i)}e.PositionAndShape.calculateTopBottomBorders(),e===this.graphicalMusicSheet.MusicPages[0]&&this.calculatePageLabels(e),e.PositionAndShape.calculateTopBottomBorders()}}calculateMarkedAreas(){}calculateComments(){}calculateChordSymbols(){for(const t of this.musicSystems)for(const e of t.StaffLines){const t=e.SkyBottomLineCalculator;let i=Number.MAX_SAFE_INTEGER;if(this.rules.ChordSymbolYAlignment&&"staffline"===this.rules.ChordSymbolYAlignmentScope){const s=[];for(const t of e.Measures)s.push(...t.staffEntries);i=this.calculateAlignedChordSymbolsOffset(s,t)}for(const s of e.Measures){this.rules.ChordSymbolYAlignment&&"measure"===this.rules.ChordSymbolYAlignmentScope&&(i=this.calculateAlignedChordSymbolsOffset(s.staffEntries,t));for(const e of s.staffEntries)if(e.graphicalChordContainers&&0!==e.graphicalChordContainers.length)for(let s=0;s<e.graphicalChordContainers.length;s++){const n=e.graphicalChordContainers[s],r=e.PositionAndShape,o=n.PositionAndShape,a=o.BorderMarginLeft+r.AbsolutePosition.x,l=o.BorderMarginRight+r.AbsolutePosition.x;(!this.rules.ChordSymbolYAlignment||i>0)&&(i=t.getSkyLineMinInRange(a,l));let h=0;0===s?(h+=this.rules.ChordSymbolYOffset,h+=.1):h+=this.rules.ChordSymbolYPadding,h*=-1;const c=n.GraphicalLabel;c.PositionAndShape.RelativePosition.y=i+h,c.setLabelPositionAndShapeBorders(),c.PositionAndShape.calculateBoundingBox(),t.updateSkyLineInRange(a,l,i+c.PositionAndShape.BorderMarginTop)}}}}calculateAlignedChordSymbolsOffset(t,e){let i=Number.MAX_SAFE_INTEGER;for(const s of t)for(const t of s.graphicalChordContainers){const n=s.PositionAndShape,r=t.PositionAndShape,o=r.BorderMarginLeft+n.AbsolutePosition.x,a=r.BorderMarginRight+n.AbsolutePosition.x;i=Math.min(i,e.getSkyLineMinInRange(o,a))}return i}layoutMeasureWithWholeRest(t,e,i){}layoutBeams(t){}layoutArticulationMarks(t,e,i){}layoutOrnament(t,e,i){}calculateRestNotePlacementWithinGraphicalBeam(t,e,i,s,n){}calculateTupletNumbers(){if(!this.rules.TupletNumberLimitConsecutiveRepetitions)return;let t,e,i,s=-1,n=0;const r={};for(const o of this.graphicalMusicSheet.ParentMusicSheet.Instruments)for(const a of o.Voices){n=0,r[a.VoiceId]={};for(const o of a.VoiceEntries)if(o.Notes.length>0){const l=o.Notes[0];if(!l.NoteTuplet){s=-1,n=0,e=void 0,t=void 0;continue}if(l.NoteTuplet===i)continue;let h=l.TypeLength;if(h||(v.default.warn("note missing TypeLength"),h=l.NoteTuplet.Fractions[0]),l.NoteTuplet!==e&&r[a.VoiceId][l.NoteTuplet.TupletLabelNumber]&&r[a.VoiceId][l.NoteTuplet.TupletLabelNumber][h.RealValue]){l.NoteTuplet.RenderTupletNumber=!1,i=l.NoteTuplet;continue}l.NoteTuplet.TupletLabelNumber===s&&h.Equals(t)||(s=l.NoteTuplet.TupletLabelNumber,t=h,n=0),e=l.NoteTuplet,n++,n<=this.rules.TupletNumberMaxConsecutiveRepetitions&&(l.NoteTuplet.RenderTupletNumber=!0),n>this.rules.TupletNumberMaxConsecutiveRepetitions&&(l.NoteTuplet.RenderTupletNumber=!1,this.rules.TupletNumberAlwaysDisableAfterFirstMax&&(r[a.VoiceId][s]||(r[a.VoiceId][s]={}),r[a.VoiceId][s][h.RealValue]=!0)),i=e}}}calculateSlurs(){}calculateGlissandi(){}calculateDynamicExpressionsForMultiExpression(t,e,i){}calculateGraphicalVerbalContinuousDynamic(t,e){const i=t.Label,s=e.x+i.PositionAndShape.BorderMarginLeft,n=e.x+i.PositionAndShape.BorderMarginRight,r=t.ContinuousDynamic.Placement,o=t.ParentStaffLine.SkyBottomLineCalculator;let a;r===P.PlacementEnum.Below?(a=o.getBottomLineMaxInRange(s,n),i.PositionAndShape.RelativePosition=new u.PointF2D(e.x,a-i.PositionAndShape.BorderMarginTop)):(a=o.getSkyLineMinInRange(s,n),i.PositionAndShape.RelativePosition=new u.PointF2D(e.x,a-i.PositionAndShape.BorderMarginBottom))}calculateGraphicalContinuousDynamic(t,e){var i;const s=t.IsSoftAccent,n=t.ParentStaffLine.ParentStaff.idInMusicSheet,o=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(t.ContinuousDynamic.EndMultiExpression.SourceMeasureParent,n);if(!o)return void v.default.warn("MusicSheetCalculator.calculateGraphicalContinuousDynamic: No endMeasure found");t.EndMeasure=o;const a=t.ParentStaffLine,l=o.ParentStaffLine,h=l&&a===l;let c=!1;l?c=null==l?void 0:l.isPartOfMultiStaffInstrument():a&&(c=null==a?void 0:a.isPartOfMultiStaffInstrument());const u=r.Fraction.createFromFraction(t.ContinuousDynamic.EndMultiExpression.AbsoluteTimestamp),d=this.graphicalMusicSheet.GetVerticalContainerFromTimestamp(u),f=d.getFirstNonNullStaffEntry().parentMeasure,m=f.PositionAndShape.AbsolutePosition.x+f.PositionAndShape.BorderRight;let p=new r.Fraction(0,0,0);for(const t of d.StaffEntries){const e=null===(i=null==t?void 0:t.sourceStaffEntry)||void 0===i?void 0:i.calculateMaxNoteLength();(null==e?void 0:e.gt(p))&&(p=e)}const b=this.getRelativePositionInStaffLineFromTimestamp(u,n,l,c,0),g=r.Fraction.plus(u,p),S=this.getRelativePositionInStaffLineFromTimestamp(g,n,l,c,0),y=this.rules.SoftAccentWedgePadding,E=d.getFirstNonNullStaffEntry().PositionAndShape.Size.width,x=this.rules.SoftAccentSizeFactor;s?(e.x-=E/2*x+y,b.x=e.x+E/2*x):S.x>b.x&&S.x<m?b.x+=(S.x-b.x)/this.rules.WedgeEndDistanceBetweenTimestampsFactor:b.x=m-this.rules.WedgeHorizontalMargin;const _=this.dynamicExpressionMap.get(t.ContinuousDynamic.StartMultiExpression.AbsoluteTimestamp.RealValue);_&&(e.x=_.RelativePosition.x+_.BorderMarginRight+this.rules.WedgeHorizontalMargin);const M=a.ParentMusicSystem,w=M.StaffLines.indexOf(a),T=a.SkyBottomLineCalculator,L=t.ContinuousDynamic.Placement;let A;h&&b.x-e.x<this.rules.WedgeMinLength&&!s&&(b.x=e.x+this.rules.WedgeMinLength);const R=e.x;let N=l.Measures[0].beginInstructionsWidth-this.rules.WedgeHorizontalMargin-2,B=0,F=0;h?B=b.x:(B=a.PositionAndShape.Size.width,F=b.x,A=new I.GraphicalContinuousDynamicExpression(t.ContinuousDynamic,l,o.parentSourceMeasure),A.IsSplittedPart=!0,t.IsSplittedPart=!0),s&&(N=b.x+y,F=N+E/2*x);let D=0,O=0;if(L===P.PlacementEnum.Below){let e=0;if(w<M.StaffLines.length-1&&(e=w+1),e>w){const t=M.StaffLines[e].PositionAndShape.RelativePosition.y-a.PositionAndShape.RelativePosition.y-this.rules.StaffHeight;D=this.rules.StaffHeight+t/2}else D=this.rules.WedgePlacementBelowY;D-=this.rules.WedgeOpeningLength/2,h||(O=D);let i=T.getBottomLineMaxInRange(R,B);i>D&&(D=i);const s=!1;if(w<M.StaffLines.length-1){const i=a.findClosestStaffEntry(B),n=a.findClosestStaffEntry(R);if(n&&i&&(n.parentVerticalContainer,s)){const i=M.StaffLines[e],s=i.SkyBottomLineCalculator.getSkyLineMinInRange(R,B),n=i.PositionAndShape.RelativePosition.y-a.PositionAndShape.RelativePosition.y+s;D=n-this.rules.WedgeOpeningLength>this.rules.StaffHeight?n-this.rules.WedgeVerticalMargin:this.rules.StaffHeight+this.rules.WedgeOpeningLength,t.NotToBeRemoved=!0}}h||(i=l.SkyBottomLineCalculator.getBottomLineMaxInRange(N,F),i>O&&(O=i),O+=this.rules.WedgeOpeningLength/2,O+=this.rules.WedgeVerticalMargin),s||(D+=this.rules.WedgeOpeningLength/2,D+=this.rules.WedgeVerticalMargin)}else if(L===P.PlacementEnum.Above){if(1===a.ParentStaff.ParentInstrument.Staves.length)D=this.rules.WedgePlacementAboveY;else{let t=0;w>0&&(t=w-1);const e=M.StaffLines[t];D=-(a.PositionAndShape.RelativePosition.y-e.PositionAndShape.RelativePosition.y-this.rules.StaffHeight)/2}D+=this.rules.WedgeOpeningLength/2,h||(O=D);let t=T.getSkyLineMinInRange(R,B);t<D&&(D=t);const e=!1;if(a.ParentStaff.ParentInstrument.Staves.length>1&&w>0){const t=a.findClosestStaffEntry(R),i=a.findClosestStaffEntry(B);if(t&&i){t.parentVerticalContainer;const i=w-1;if(e){const t=M.StaffLines[i],e=t.SkyBottomLineCalculator.getBottomLineMaxInRange(R,B);D=(a.PositionAndShape.RelativePosition.y-t.PositionAndShape.RelativePosition.y-e-this.rules.StaffHeight)/2+this.rules.StaffHeight}}}h||(t=l.SkyBottomLineCalculator.getSkyLineMinInRange(N,F),t<O&&(O=t),O-=this.rules.WedgeOpeningLength/2),e||(D-=this.rules.WedgeOpeningLength/2,D-=this.rules.WedgeVerticalMargin),h||(O-=this.rules.WedgeVerticalMargin)}t.Lines.clear(),t.ContinuousDynamic.DynamicType===C.ContDynamicEnum.crescendo?s?(t.createFirstHalfCrescendoLines(R,B,D),t.createSecondHalfDiminuendoLines(N,F,D),t.calcPsi()):h&&!s?(t.createCrescendoLines(R,B,D),t.calcPsi()):(t.createFirstHalfCrescendoLines(R,B,D),t.calcPsi(),A.createSecondHalfCrescendoLines(N,F,O),A.calcPsi()):t.ContinuousDynamic.DynamicType===C.ContDynamicEnum.diminuendo&&(h?(t.createDiminuendoLines(R,B,D),t.calcPsi()):(t.createFirstHalfDiminuendoLines(R,B,D),t.calcPsi(),A.createSecondHalfDiminuendoLines(N,F,O),A.calcPsi())),this.dynamicExpressionMap.set(u.RealValue,t.PositionAndShape)}calculateGraphicalInstantaneousDynamicExpression(t,e,i){const s=t.ParentStaffLine;if(!s)return;const n=e.x+t.PositionAndShape.BorderMarginLeft,r=e.x+t.PositionAndShape.BorderMarginRight,o=s.SkyBottomLineCalculator;let a=0;if(t.Placement===P.PlacementEnum.Above){const i=o.getSkyLineMinInRange(n,r);if(s.isPartOfMultiStaffInstrument()&&s.ParentStaff!==s.ParentStaff.ParentInstrument.Staves[0]){const e=s.ParentMusicSystem.StaffLines[s.ParentMusicSystem.StaffLines.indexOf(s)-1],n=s.PositionAndShape.RelativePosition.y-e.PositionAndShape.RelativePosition.y-this.rules.StaffHeight;a=i>-n/2?-n/2:i-t.PositionAndShape.BorderMarginBottom}else a=i-t.PositionAndShape.BorderMarginBottom;t.PositionAndShape.RelativePosition=new u.PointF2D(e.x,a)}else if(t.Placement===P.PlacementEnum.Below){const i=o.getBottomLineMaxInRange(n,r),l=s.ParentStaff.ParentInstrument.Staves[s.ParentStaff.ParentInstrument.Staves.length-1];if(s.isPartOfMultiStaffInstrument()&&s.ParentStaff!==l){const e=s.ParentMusicSystem.StaffLines[s.ParentMusicSystem.StaffLines.indexOf(s)+1].PositionAndShape.RelativePosition.y-s.PositionAndShape.RelativePosition.y-this.rules.StaffHeight;a=i+t.PositionAndShape.BorderMarginBottom<this.rules.StaffHeight+e/2?this.rules.StaffHeight+e/2:i-t.PositionAndShape.BorderMarginTop}else a=i-t.PositionAndShape.BorderMarginTop;t.PositionAndShape.RelativePosition=new u.PointF2D(e.x,a)}t.updateSkyBottomLine()}calcGraphicalRepetitionEndingsRecursively(t){}layoutSingleRepetitionEnding(t,e,i,s,n,r){}calculateLabel(t,e,i,s,n,r,o=m.TextAlignmentEnum.CenterBottom,a=0){const l=new M.Label(i,o);l.fontStyle=s,l.fontHeight=r;const h=new f.GraphicalLabel(l,r,l.textAlignment,this.rules,t.PositionAndShape),c=1.1;n===P.PlacementEnum.Below&&(h.Label.textAlignment=m.TextAlignmentEnum.LeftTop),h.setLabelPositionAndShapeBorders(),h.PositionAndShape.BorderMarginBottom*=c,h.PositionAndShape.BorderMarginTop*=c,h.PositionAndShape.BorderMarginLeft*=c,h.PositionAndShape.BorderMarginRight*=c;let d,p=e.x+h.PositionAndShape.BorderMarginLeft,b=e.x+h.PositionAndShape.BorderMarginRight;b>t.PositionAndShape.Size.width&&(b=t.PositionAndShape.Size.width-this.rules.MeasureRightMargin,p=b-h.PositionAndShape.MarginSize.width,e.x=p-h.PositionAndShape.BorderMarginLeft);const g=t.SkyBottomLineCalculator;return d=n===P.PlacementEnum.Below?g.getBottomLineMaxInRange(p,b)+a:g.getSkyLineMinInRange(p,b)-a,h.PositionAndShape.RelativePosition=new u.PointF2D(e.x,d),n===P.PlacementEnum.Below?g.updateBottomLineInRange(p,b,h.PositionAndShape.BorderMarginBottom+d):g.updateSkyLineInRange(p,b,h.PositionAndShape.BorderMarginTop+d),h}calculateTempoExpressionsForMultiTempoExpression(t,e,i){const s=r.Fraction.plus(t.AbsoluteTimestamp,e.Timestamp),n=this.graphicalMusicSheet.MeasureList[i];let o=new u.PointF2D;if(e.ContinuousTempo||e.InstantaneousTempo){if(this.rules.MinMeasureToDrawIndex>0)return;if(!n[0])return;let t=n[0].ParentStaffLine,i=n[0].PositionAndShape.RelativePosition.x,r=0;for(let e=0;e<n.length;e++)if(n[e].ParentStaffLine&&0!==n[e].ParentStaffLine.Measures.length&&n[e].ParentStaffLine.Measures.length>0){t=n[e].ParentStaffLine,i=n[e].PositionAndShape.RelativePosition.x,r=e;break}if(o=this.getRelativePositionInStaffLineFromTimestamp(s,r,t,t.isPartOfMultiStaffInstrument(),i),e.EntriesList.length>0&&e.EntriesList[0].Expression instanceof L.InstantaneousTempoExpression&&(e.EntriesList[0].Expression.Placement=P.PlacementEnum.Above,t.Measures[0].staffEntries.length>0&&0===Math.abs(o.x-t.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x)&&t.ParentMusicSystem===this.musicSystems[0])){const e=t.Measures[0].FirstInstructionStaffEntry;if(e){const t=e.GraphicalInstructions.last();o.x=t.PositionAndShape.RelativePosition.x}this.rules.CompactMode&&(o.x=t.PositionAndShape.RelativePosition.x+t.Measures[0].PositionAndShape.RelativePosition.x)}for(const i of e.EntriesList){let s=m.TextAlignmentEnum.CenterBottom;this.rules.CompactMode&&(s=m.TextAlignmentEnum.LeftBottom);const n=this.calculateLabel(t,o,i.label,e.getFontstyleOfFirstEntry(),i.Expression.Placement,this.rules.UnknownTextHeight,s,this.rules.TempoYSpacing);if(i.Expression instanceof L.InstantaneousTempoExpression){for(const e of t.AbstractExpressions)e instanceof T.GraphicalInstantaneousTempoExpression&&(e.SourceExpression.Label,i.Expression.Label);if(new T.GraphicalInstantaneousTempoExpression(i.Expression,n).ParentStaffLine||v.default.warn("Adding staffline didn't work"),this.rules.MetronomeMarksDrawn&&i.Expression.Enum===L.TempoEnum.metronomeMark){this.createMetronomeMark(i.Expression);continue}}else i.Expression,A.ContinuousTempoExpression}}}createMetronomeMark(t){throw new Error(this.abstractNotImplementedErrorMessage)}graphicalMeasureCreatedCalculations(t){}clearSystemsAndMeasures(){for(let t=0,e=this.graphicalMusicSheet.MusicPages.length;t<e;++t){const e=this.graphicalMusicSheet.MusicPages[t];for(let t=0,i=e.MusicSystems.length;t<i;++t){const i=e.MusicSystems[t];for(let t=0,e=i.StaffLines.length;t<e;++t){const e=i.StaffLines[t];for(let t=0,i=e.Measures.length;t<i;++t){const i=e.Measures[t];if(i.FirstInstructionStaffEntry){const t=i.PositionAndShape.ChildElements.indexOf(i.FirstInstructionStaffEntry.PositionAndShape);t>-1&&i.PositionAndShape.ChildElements.splice(t,1),i.FirstInstructionStaffEntry=void 0,i.beginInstructionsWidth=0}if(i.LastInstructionStaffEntry){const t=i.PositionAndShape.ChildElements.indexOf(i.LastInstructionStaffEntry.PositionAndShape);t>-1&&i.PositionAndShape.ChildElements.splice(t,1),i.LastInstructionStaffEntry=void 0,i.endInstructionsWidth=0}}e.Measures=[],e.PositionAndShape.ChildElements=[]}i.StaffLines.length=0,i.PositionAndShape.ChildElements=[]}e.MusicSystems=[],e.PositionAndShape.ChildElements=[]}this.graphicalMusicSheet.MusicPages=[]}handleVoiceEntry(t,e,i,s,n,r,o,a,l,c,u){t.StemDirectionXml!==h.StemDirectionType.Undefined&&this.rules.SetWantedStemDirectionByXml&&void 0!==t.StemDirectionXml?t.WantedStemDirection=t.StemDirectionXml:this.calculateStemDirectionFromVoices(t);const d=e.findOrCreateGraphicalVoiceEntry(t);d.octaveShiftValue=a;const f=e.tabStaffEntry;let m;f&&(m=f.findOrCreateGraphicalVoiceEntry(t));for(let s=0,l=t.Notes.length;s<l;++s){const l=t.Notes[s];if(!l)continue;if(void 0!==u&&void 0!==u.Link&&void 0!==c&&c.indexOf(l)>-1)continue;let h;if(t.IsGrace?h=F.symbolFactory.createGraceNote(l,d,n,this.rules,a):(h=F.symbolFactory.createNote(l,d,n,a,this.rules,void 0),F.stafflineNoteCalculator.trackNote(h)),l.Pitch&&this.checkNoteForAccidental(h,i,n,a),this.resetYPositionForLeadSheet(h.PositionAndShape),e.addGraphicalNoteToListAtCorrectYPosition(d,h),h.PositionAndShape.calculateBoundingBox(),this.leadSheet||(void 0!==l.NoteBeam&&l.PrintObject&&this.handleBeam(h,l.NoteBeam,o),void 0!==l.NoteTuplet&&l.PrintObject&&this.handleTuplet(h,l.NoteTuplet,r)),m){const t=F.symbolFactory.createNote(l,m,n,a,this.rules,void 0);f.addGraphicalNoteToListAtCorrectYPosition(m,t),t.PositionAndShape.calculateBoundingBox(),this.leadSheet||l.NoteTuplet&&this.handleTuplet(t,l.NoteTuplet,r)}}return t.Articulations.length>0&&this.handleVoiceEntryArticulations(t.Articulations,t,e),t.TechnicalInstructions.length>0&&this.handleVoiceEntryTechnicalInstructions(t.TechnicalInstructions,t,e),t.LyricsEntries.size()>0&&this.handleVoiceEntryLyrics(t,e,s),t.OrnamentContainer&&this.handleVoiceEntryOrnaments(t.OrnamentContainer,t,e),a}resetYPositionForLeadSheet(t){this.leadSheet&&(t.RelativePosition=new u.PointF2D(t.RelativePosition.x,0))}layoutVoiceEntries(t,e){if(t.PositionAndShape.RelativePosition=new u.PointF2D(0,0),!this.leadSheet)for(const e of t.graphicalVoiceEntries){const i=e.notes;if(0===i.length)continue;const s=i[0].sourceNote.ParentVoiceEntry,n=void 0!==i[0].sourceNote.Pitch;this.layoutVoiceEntry(s,i,t,n)}}maxInstrNameLabelLength(){var t;let e=0;for(const i of this.graphicalMusicSheet.ParentMusicSheet.Instruments)if((null===(t=i.NameLabel)||void 0===t?void 0:t.print)&&i.Voices.length>0&&i.Voices[0].Visible){let t=i.NameLabel;this.rules.RenderPartNames||(t=new M.Label("",t.textAlignment,t.font));const s=new f.GraphicalLabel(t,this.rules.InstrumentLabelTextHeight,m.TextAlignmentEnum.LeftCenter,this.rules);s.setLabelPositionAndShapeBorders(),e=Math.max(e,s.PositionAndShape.MarginSize.width)}return this.rules.RenderPartNames?e:0}calculateSheetLabelBoundingBoxes(){const t=this.graphicalMusicSheet.ParentMusicSheet,e=this.rules.DefaultColorTitle;if(void 0!==t.Title&&this.rules.RenderTitle){const i=new f.GraphicalLabel(t.Title,this.rules.SheetTitleHeight,m.TextAlignmentEnum.CenterBottom,this.rules);i.Label.IsCreditLabel=!0,i.Label.colorDefault=e,this.graphicalMusicSheet.Title=i,i.setLabelPositionAndShapeBorders()}else this.rules.RenderTitle||(this.graphicalMusicSheet.Title=void 0);if(void 0!==t.Subtitle&&this.rules.RenderSubtitle){const i=new f.GraphicalLabel(t.Subtitle,this.rules.SheetSubtitleHeight,m.TextAlignmentEnum.CenterCenter,this.rules);i.Label.IsCreditLabel=!0,i.Label.colorDefault=e,this.graphicalMusicSheet.Subtitle=i,i.setLabelPositionAndShapeBorders()}else this.rules.RenderSubtitle||(this.graphicalMusicSheet.Subtitle=void 0);if(void 0!==t.Composer&&this.rules.RenderComposer){const i=new f.GraphicalLabel(t.Composer,this.rules.SheetComposerHeight,m.TextAlignmentEnum.RightCenter,this.rules);i.Label.IsCreditLabel=!0,i.Label.colorDefault=e,this.graphicalMusicSheet.Composer=i,i.setLabelPositionAndShapeBorders()}else this.rules.RenderComposer||(this.graphicalMusicSheet.Composer=void 0);if(void 0!==t.Lyricist&&this.rules.RenderLyricist){const i=new f.GraphicalLabel(t.Lyricist,this.rules.SheetAuthorHeight,m.TextAlignmentEnum.LeftCenter,this.rules);i.Label.IsCreditLabel=!0,i.Label.colorDefault=e,this.graphicalMusicSheet.Lyricist=i,i.setLabelPositionAndShapeBorders()}else this.rules.RenderLyricist||(this.graphicalMusicSheet.Lyricist=void 0);if(void 0!==t.Copyright&&this.rules.RenderCopyright){const i=new f.GraphicalLabel(t.Copyright,this.rules.SheetCopyrightHeight,m.TextAlignmentEnum.CenterBottom,this.rules);i.Label.IsCreditLabel=!0,i.Label.colorDefault=e,this.graphicalMusicSheet.Copyright=i,i.setLabelPositionAndShapeBorders()}else this.rules.RenderCopyright||(this.graphicalMusicSheet.Copyright=void 0)}checkMeasuresForWholeRestNotes(){for(let t=0,e=this.musicSystems.length;t<e;++t){const e=this.musicSystems[t];for(let t=0,i=e.StaffLines.length;t<i;++t){const i=e.StaffLines[t];for(let t=0,e=i.Measures.length;t<e;++t){const e=i.Measures[t];if(1===e.staffEntries.length){const t=e.staffEntries[0];if(t.graphicalVoiceEntries.length>0&&1===t.graphicalVoiceEntries[0].notes.length){const i=t.graphicalVoiceEntries[0].notes[0];!i.sourceNote.Pitch&&new r.Fraction(1,2).lt(i.sourceNote.Length)&&this.layoutMeasureWithWholeRest(i,t,e)}}}}}}optimizeRestNotePlacement(t,e){if(0===t.graphicalVoiceEntries.length)return;const i=t.graphicalVoiceEntries[0].notes;if(0===i.length)return;const s=i[0],n=s.sourceNote.isRest();if(2===t.graphicalVoiceEntries.length){let e=!1;const i=t.graphicalVoiceEntries[1].notes;i.length>0&&(e=i[0].sourceNote.isRest()),n&&e?this.calculateTwoRestNotesPlacementWithCollisionDetection(t):(n||e)&&this.calculateRestNotePlacementWithCollisionDetectionFromGraphicalNote(t)}else if(n&&t!==e.staffEntries[0]&&t!==e.staffEntries[e.staffEntries.length-1]){const i=e.staffEntries.indexOf(t),n=e.staffEntries[i-1],r=e.staffEntries[i+1];if(1===n.graphicalVoiceEntries.length){const e=n.graphicalVoiceEntries[0].notes[0];if(void 0!==e.sourceNote.NoteBeam&&1===r.graphicalVoiceEntries.length){const i=r.graphicalVoiceEntries[0].notes[0];void 0!==i.sourceNote.NoteBeam&&e.sourceNote.NoteBeam===i.sourceNote.NoteBeam&&(this.calculateRestNotePlacementWithinGraphicalBeam(t,s,e,r,i),t.PositionAndShape.calculateBoundingBox())}}}}getRelativePositionInStaffLineFromTimestamp(t,e,i,s,n=0){let o,a,l=new u.PointF2D;const h=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length,c=this.graphicalMusicSheet.GetInterpolatedIndexInVerticalContainers(t),d=Math.min(Math.floor(c),h-1),f=Math.min(Math.ceil(c),h-1);if(d<0||e<0)return l;if(o=this.getFirstLeftNotNullStaffEntryFromContainer(d,e,s),a=this.getFirstRightNotNullStaffEntryFromContainer(f,e,s),o&&a){let e=o.parentMeasure.PositionAndShape.RelativePosition.x;n>0&&(e=n);let s=o.PositionAndShape.RelativePosition.x+e,h=a.PositionAndShape.RelativePosition.x+a.parentMeasure.PositionAndShape.RelativePosition.x;n>0&&(h=a.PositionAndShape.RelativePosition.x+e);let c=0;if(o!==a){const e=o.getAbsoluteTimestamp(),i=a.getAbsoluteTimestamp();c=r.Fraction.minus(t,e).RealValue/r.Fraction.minus(i,e).RealValue}o.parentMeasure.ParentStaffLine!==a.parentMeasure.ParentStaffLine&&(o.parentMeasure.ParentStaffLine===i?h=i.PositionAndShape.Size.width:s=i.PositionAndShape.RelativePosition.x),l=new u.PointF2D(s+(h-s)*c,0)}return l}getRelativeXPositionFromTimestamp(t){const e=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length,i=this.graphicalMusicSheet.GetInterpolatedIndexInVerticalContainers(t),s=Math.max(0,Math.min(Math.round(i),e-1)),n=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[s].getFirstNonNullStaffEntry();return n.PositionAndShape.RelativePosition.x+n.parentMeasure.PositionAndShape.RelativePosition.x}calculatePageLabels(t){var e;this.rules.RenderSingleHorizontalStaffline&&(t.PositionAndShape.BorderRight=t.PositionAndShape.Size.width,t.PositionAndShape.calculateBoundingBox(),this.graphicalMusicSheet.ParentMusicSheet.pageWidth=t.PositionAndShape.Size.width);let i=10,s=-1;if(t.MusicSystems.length>0){const e=t.MusicSystems[0];i=e.PositionAndShape.RelativePosition.y+e.PositionAndShape.BorderTop;const n=t.MusicSystems[t.MusicSystems.length-1];s=n.PositionAndShape.RelativePosition.y+n.PositionAndShape.BorderBottom}if(this.graphicalMusicSheet.Title&&this.rules.RenderTitle){const e=this.graphicalMusicSheet.Title;e.PositionAndShape.Parent=t.PositionAndShape;const i=new u.PointF2D;i.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth/2,i.y=this.rules.TitleTopDistance+this.rules.SheetTitleHeight,e.PositionAndShape.RelativePosition=i,t.Labels.push(e)}if(this.graphicalMusicSheet.Subtitle&&this.rules.RenderTitle&&this.rules.RenderSubtitle){const e=this.graphicalMusicSheet.Subtitle;e.PositionAndShape.Parent=t.PositionAndShape;const i=new u.PointF2D;i.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth/2,i.y=this.rules.TitleTopDistance+this.rules.SheetTitleHeight+this.rules.SheetMinimumDistanceBetweenTitleAndSubtitle,e.PositionAndShape.RelativePosition=i,t.Labels.push(e)}const n=this.graphicalMusicSheet.Composer;let r;if(n&&this.rules.RenderComposer){n.PositionAndShape.Parent=t.PositionAndShape,n.setLabelPositionAndShapeBorders();const s=new u.PointF2D;s.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth-this.rules.PageRightMargin,s.y=i,s.y-=this.rules.SystemComposerDistance;const o=null===(e=n.TextLines)||void 0===e?void 0:e.length;o>1&&(s.y-=n.PositionAndShape.BorderBottom*(o-1)/o),r=s.y,n.PositionAndShape.RelativePosition=s,t.Labels.push(n)}const o=this.graphicalMusicSheet.Lyricist;if(o&&this.rules.RenderLyricist){o.PositionAndShape.Parent=t.PositionAndShape,o.setLabelPositionAndShapeBorders();const e=new u.PointF2D;e.x=this.rules.PageLeftMargin,e.y=i,e.y+=o.PositionAndShape.BorderBottom,e.y=Math.min(e.y,null!=r?r:Number.MAX_SAFE_INTEGER),o.PositionAndShape.RelativePosition=e,t.Labels.push(o)}const a=this.graphicalMusicSheet.Copyright;if(a&&this.rules.RenderCopyright){a.PositionAndShape.Parent=t.PositionAndShape,a.setLabelPositionAndShapeBorders();const e=new u.PointF2D;e.x=t.PositionAndShape.Size.width/2,e.y=s+this.rules.SheetCopyrightMargin,e.y-=a.PositionAndShape.BorderTop,a.PositionAndShape.RelativePosition=e,t.Labels.push(a)}}createGraphicalTies(){for(let t=0;t<this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length;t++){const e=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[t];for(let i=0;i<e.CompleteNumberOfStaves;i++)for(let s=0;s<e.VerticalSourceStaffEntryContainers.length;s++){const n=e.VerticalSourceStaffEntryContainers[s].StaffEntries[i];if(n){const e=this.graphicalMusicSheet.findGraphicalStaffEntryFromMeasureList(i,t,n);e&&(e.GraphicalTies.clear(),e.ties.clear());for(let s=0,r=n.VoiceEntries.length;s<r;++s){const r=n.VoiceEntries[s];for(let s=0,n=r.Notes.length;s<n;++s){const n=r.Notes[s];if(n.NoteTie){const s=n.NoteTie;if(n===n.NoteTie.Notes.last())continue;if(e)for(const t of e.GraphicalTies)t.Tie;this.handleTie(s,e,i,t)}}}this.setTieDirections(e)}}}}handleTie(t,e,i,s){if(!e)return;e.ties.push(t);let n,r,o,a=e;for(let e=1;e<t.Notes.length;e++)if(n=a.findTieGraphicalNoteFromNote(t.Notes[e-1]),r=this.graphicalMusicSheet.GetGraphicalFromSourceStaffEntry(t.Notes[e].ParentStaffEntry),r){if(o=r.findTieGraphicalNoteFromNote(t.Notes[e]),void 0!==n&&void 0!==o&&r){if(!n.sourceNote.PrintObject||!o.sourceNote.PrintObject)continue;const e=this.createGraphicalTie(t,a,r,n,o);a.GraphicalTies.push(e),this.staffEntriesWithGraphicalTies.indexOf(a)>=0&&this.staffEntriesWithGraphicalTies.push(a)}a=r}}setTieDirections(t){if(!t)return;const e=t.ties;if(1===e.length){const t=e[0];if(t.TieDirection===P.PlacementEnum.NotYetDefined){const e=t.Notes[0].ParentVoiceEntry.ParentVoice.VoiceId;2!==e&&6!==e||(t.TieDirection=P.PlacementEnum.Below)}}if(e.length>1){let t;for(const i of e){const e=i.Notes[0];(!t||e.Pitch.getHalfTone()>t.Pitch.getHalfTone())&&(t=e)}for(const i of e)i.TieDirection===P.PlacementEnum.NotYetDefined&&(i.Notes[0]===t?i.TieDirection=P.PlacementEnum.Above:i.TieDirection=P.PlacementEnum.Below)}}createAccidentalCalculators(){const t=[],e=this.graphicalMusicSheet.ParentMusicSheet.getFirstSourceMeasure();if(e)for(let i=0;i<e.CompleteNumberOfStaves;i++){const s=new y.AccidentalCalculator;if(t.push(s),e.FirstInstructionsStaffEntries[i])for(let t=0,n=e.FirstInstructionsStaffEntries[i].Instructions.length;t<n;++t){const n=e.FirstInstructionsStaffEntries[i].Instructions[t];if(n instanceof p.KeyInstruction){const t=n;s.ActiveKeyInstruction=t}}}return t}calculateVerticalContainersList(){const t=this.graphicalMusicSheet.MeasureList[0].length;for(let e=0;e<this.graphicalMusicSheet.MeasureList.length;e++)for(let i=0;i<t;i++){const t=this.graphicalMusicSheet.MeasureList[e][i];if(t)for(let e=0,s=t.staffEntries.length;e<s;++e){const s=t.staffEntries[e],n=this.graphicalMusicSheet.getOrCreateVerticalContainer(s.getAbsoluteTimestamp());n&&(n.StaffEntries[i]=s,s.parentVerticalContainer=n)}}}setIndicesToVerticalGraphicalContainers(){for(let t=0;t<this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length;t++)this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[t].Index=t}createGraphicalMeasuresForSourceMeasure(t,e,i,s,n){this.initGraphicalMeasuresCreation();const r=[],o=[],a=[],l=[];let h=!0;for(let c=0;c<t.CompleteNumberOfStaves;c++){const u=this.createGraphicalMeasure(t,a,o,e[c],n,s,i,c,l);h=h&&u.hasOnlyRests,r.push(u)}return t.allRests=h,t.VerticalMeasureList=r,r}createGraphicalMeasure(t,e,i,s,n,c,u,f,m){var b,g,y,v;const x=this.graphicalMusicSheet.ParentMusicSheet.getStaffFromIndex(f);let _;if(n[f].ClefType===a.ClefEnum.TAB)x.isTab=!0,_=F.symbolFactory.createTabStaffMeasure(t,x);else if(t.multipleRestMeasures&&this.rules.RenderMultipleRestMeasures)_=F.symbolFactory.createMultiRestMeasure(t,x);else{if(t.multipleRestMeasureNumber>1)return;_=F.symbolFactory.createGraphicalMeasure(t,x)}if(_.hasError=t.getErrorInMeasure(f),t.FirstInstructionsStaffEntries[f])for(let e=0,i=t.FirstInstructionsStaffEntries[f].Instructions.length;e<i;++e){const i=t.FirstInstructionsStaffEntries[f].Instructions[e];if(i instanceof p.KeyInstruction){const t=p.KeyInstruction.copy(i),e=_.getTransposedHalftones();0!==e&&_.ParentStaff.ParentInstrument.MidiInstrumentId!==E.MidiInstrument.Percussion&&F.transposeCalculator&&F.transposeCalculator.transposeKey(t,e),s.ActiveKeyInstruction=t}}const M=[];for(let e=0,i=t.StaffLinkedExpressions[f].length;e<i;++e){const i=t.StaffLinkedExpressions[f][e];let s;if(i.OctaveShiftStart?s=i.OctaveShiftStart:i.OctaveShiftEnd&&(s=i.OctaveShiftEnd),s){M.push(i);const e=s;let n=null===(b=null==e?void 0:e.ParentEndMultiExpression)||void 0===b?void 0:b.AbsoluteTimestamp;(null==e?void 0:e.ParentEndMultiExpression)||(n=r.Fraction.plus(t.AbsoluteTimestamp,t.Duration)),c[f]=new S.OctaveShiftParams(e,e.ParentStartMultiExpression.AbsoluteTimestamp,n)}}for(let r=0;r<t.VerticalSourceStaffEntryContainers.length;r++){const o=t.VerticalSourceStaffEntryContainers[r].StaffEntries[f];if(o){for(let t=0,e=o.Instructions.length;t<e;++t){const e=o.Instructions[t];e instanceof a.ClefInstruction&&(n[f]=e)}const t=F.symbolFactory.createStaffEntry(o,_);r<_.staffEntries.length?_.addGraphicalStaffEntryAtTimestamp(t):_.addGraphicalStaffEntry(t);const h=[];o.Link&&(o.findLinkedNotes(h),this.handleStaffEntryLink(t,m));let d=l.OctaveEnum.NONE;if(c[f]&&c[f].getAbsoluteStartTimestamp.lte(o.AbsoluteTimestamp)&&o.AbsoluteTimestamp.lte(c[f].getAbsoluteEndTimestamp)&&(d=c[f].getOpenOctaveShift.Type),d===l.OctaveEnum.NONE)for(const t of M){let e;if(t.OctaveShiftStart?e=t.OctaveShiftStart:t.OctaveShiftEnd&&(e=t.OctaveShiftEnd),(null===(g=null==e?void 0:e.ParentStartMultiExpression)||void 0===g?void 0:g.AbsoluteTimestamp.lte(o.AbsoluteTimestamp))&&!(null===(y=e.ParentEndMultiExpression)||void 0===y?void 0:y.AbsoluteTimestamp.lt(o.AbsoluteTimestamp))){d=e.Type;break}}for(let r=0,a=o.VoiceEntries.length;r<a;++r){const a=o.VoiceEntries[r];d=this.handleVoiceEntry(a,t,s,u,n[f],e,i,d,f,h,o)}if(o.Instructions.length>0){const e=o.Instructions[0];F.symbolFactory.createInStaffClef(t,e)}this.rules.RenderChordSymbols&&(null===(v=o.ChordContainers)||void 0===v?void 0:v.length)>0&&(o.ParentStaff.ParentInstrument.HasChordSymbols=!0,F.symbolFactory.createChordSymbols(o,t,s.ActiveKeyInstruction,this.graphicalMusicSheet.ParentMusicSheet.Transpose))}}if(s.doCalculationsAtEndOfMeasure(),t.LastInstructionsStaffEntries[f]){const e=t.LastInstructionsStaffEntries[f];for(let t=0,i=e.Instructions.length;t<i;++t){const i=e.Instructions[t];i instanceof a.ClefInstruction&&(n[f]=i)}}for(let e=0,i=t.StaffLinkedExpressions[f].length;e<i;++e){const i=t.StaffLinkedExpressions[f][e];void 0!==i.OctaveShiftEnd&&void 0!==c[f]&&i.OctaveShiftEnd===c[f].getOpenOctaveShift&&(c[f]=void 0)}for(const t of _.staffEntries)for(const e of t.graphicalVoiceEntries)this.setBeamNotesWantedStemDirections(e.parentVoiceEntry);if(this.rules.FillEmptyMeasuresWithWholeRest>=1&&0===_.staffEntries.length){const e=new d.SourceStaffEntry(new w.VerticalSourceStaffEntryContainer(_.parentSourceMeasure,_.parentSourceMeasure.AbsoluteTimestamp,_.parentSourceMeasure.CompleteNumberOfStaves),x);if(0===x.Voices.length){const t=new B.Voice(_.ParentStaff.ParentInstrument,-1);x.Voices.push(t)}const i=new h.VoiceEntry(new r.Fraction(0,1),x.Voices[0],e);let s=t.Duration;0===s.RealValue&&(s=t.ActiveTimeSignature.clone());const n=new o.Note(i,e,s,void 0,t,!0);n.IsWholeMeasureRest=!0,n.PrintObject=this.rules.FillEmptyMeasuresWithWholeRest===R.FillEmptyMeasuresWithWholeRests.YesVisible,i.Notes.push(n);const c=F.symbolFactory.createStaffEntry(e,_);_.addGraphicalStaffEntry(c),c.relInMeasureTimestamp=i.Timestamp;const u=F.symbolFactory.createVoiceEntry(i,c);c.graphicalVoiceEntries.push(u);const f=F.symbolFactory.createNote(n,u,new a.ClefInstruction,l.OctaveEnum.NONE,this.rules);F.stafflineNoteCalculator.trackNote(f),u.notes.push(f)}_.hasOnlyRests=!0;for(const t of _.staffEntries)if(_.hasOnlyRests=t.hasOnlyRests(),!_.hasOnlyRests)break;return _}checkNoteForAccidental(t,e,i,s){let n=t.sourceNote.Pitch;const r=t.parentVoiceEntry.parentStaffEntry.parentMeasure.getTransposedHalftones();0!==r&&t.sourceNote.ParentStaffEntry.ParentStaff.ParentInstrument.MidiInstrumentId!==E.MidiInstrument.Percussion&&(n=t.Transpose(e.ActiveKeyInstruction,i,r,s),t.sourceNote.TransposedPitch=n),t.sourceNote.halfTone=n.getHalfTone(),e.checkAccidental(t,n)}handleStaffEntries(t){for(let e=0,i=this.graphicalMusicSheet.MeasureList.length;e<i;++e){const i=this.graphicalMusicSheet.MeasureList[e];for(let e=0,s=i.length;e<s;++e){const s=i[e];if(s){void 0!==this.rules.PercussionOneLineCutoff&&0!==this.rules.PercussionOneLineCutoff&&t[e]&&(-1===this.rules.PercussionOneLineCutoff||F.stafflineNoteCalculator.getStafflineUniquePositionCount(e)<this.rules.PercussionOneLineCutoff)&&(s.ParentStaff.StafflineCount=1);for(const t of s.staffEntries)void 0!==t.parentMeasure&&t.graphicalVoiceEntries.length>0&&t.graphicalVoiceEntries[0].notes.length>0&&(this.layoutVoiceEntries(t,e),this.layoutStaffEntry(t));this.graphicalMeasureCreatedCalculations(s)}}}}calculateSkyBottomLines(){}calculateExpressionAlignements(){}calculateStaffEntryArticulationMarks(){for(let t=0,e=this.musicSystems.length;t<e;++t){const e=this.musicSystems[t];for(let t=0,i=e.StaffLines.length;t<i;++t){const i=e.StaffLines[t];for(let t=0,e=i.Measures.length;t<e;++t){const e=i.Measures[t];for(let t=0,i=e.staffEntries.length;t<i;++t){const i=e.staffEntries[t];for(let t=0,e=i.sourceStaffEntry.VoiceEntries.length;t<e;++t){const e=i.sourceStaffEntry.VoiceEntries[t];e.Articulations.length>0&&this.layoutArticulationMarks(e.Articulations,e,i)}}}}}}calculateOrnaments(){for(let t=0,e=this.musicSystems.length;t<e;++t){const e=this.musicSystems[t];for(let t=0,i=e.StaffLines.length;t<i;++t){const i=e.StaffLines[t];for(let t=0,e=i.Measures.length;t<e;++t){const e=i.Measures[t];for(let t=0,i=e.staffEntries.length;t<i;++t){const i=e.staffEntries[t];for(let t=0,e=i.sourceStaffEntry.VoiceEntries.length;t<e;++t){const e=i.sourceStaffEntry.VoiceEntries[t];if(e.OrnamentContainer){if(e.hasTie()&&!i.relInMeasureTimestamp.Equals(e.Timestamp))continue;this.layoutOrnament(e.OrnamentContainer,e,i),-1===this.staffEntriesWithOrnaments.indexOf(i)&&this.staffEntriesWithOrnaments.push(i)}}}}}}}getFingeringPlacement(t){let e=this.rules.FingeringPosition;return e!==P.PlacementEnum.NotYetDefined&&e!==P.PlacementEnum.AboveOrBelow||(e=t.isUpperStaffOfInstrument()?P.PlacementEnum.Above:P.PlacementEnum.Below),e}calculateFingerings(){if(this.rules.FingeringPosition!==P.PlacementEnum.Left&&this.rules.FingeringPosition!==P.PlacementEnum.Right)for(const t of this.musicSystems)for(const e of t.StaffLines)for(const t of e.Measures){const i=this.getFingeringPlacement(t);for(const s of t.staffEntries){s.FingeringEntries=[];const n=e.SkyBottomLineCalculator,r=s.PositionAndShape.RelativePosition.x+t.PositionAndShape.RelativePosition.x,o=[];for(const t of s.graphicalVoiceEntries)for(const e of t.notes){const t=e.sourceNote;t.Fingering&&!t.IsGraceNote&&o.push(t.Fingering)}i===P.PlacementEnum.Below&&o.reverse();for(let t=0;t<o.length;t++){const a=o[t],l=i===P.PlacementEnum.Above?m.TextAlignmentEnum.CenterBottom:m.TextAlignmentEnum.CenterTop,h=new M.Label(a.value,l),c=new f.GraphicalLabel(h,this.rules.FingeringTextSize,h.textAlignment,this.rules,e.PositionAndShape),u=r+c.PositionAndShape.BorderMarginLeft,d=r+c.PositionAndShape.BorderMarginRight;let p;p=i===P.PlacementEnum.Above?n.getSkyLineMinInRange(u,d):n.getBottomLineMaxInRange(u,d);let b=0;0===t?(b+=this.rules.FingeringOffsetY,i===P.PlacementEnum.Above&&(b+=.1)):b+=this.rules.FingeringPaddingY,i===P.PlacementEnum.Above&&(b*=-1),c.PositionAndShape.RelativePosition.y+=p+b,c.PositionAndShape.RelativePosition.x=r,c.setLabelPositionAndShapeBorders(),c.PositionAndShape.calculateBoundingBox(),s.FingeringEntries.push(c);const g=c.PositionAndShape.RelativePosition.x+c.PositionAndShape.BorderLeft,S=g-c.PositionAndShape.BorderLeft+c.PositionAndShape.BorderRight;i===P.PlacementEnum.Above?n.updateSkyLineInRange(g,S,c.PositionAndShape.RelativePosition.y+c.PositionAndShape.BorderTop):i===P.PlacementEnum.Below&&n.updateBottomLineInRange(g,S,c.PositionAndShape.RelativePosition.y+c.PositionAndShape.BorderBottom)}}}}optimizeRestPlacement(){for(let t=0,e=this.musicSystems.length;t<e;++t){const e=this.musicSystems[t];for(let t=0,i=e.StaffLines.length;t<i;++t){const i=e.StaffLines[t];for(let t=0,e=i.Measures.length;t<e;++t){const e=i.Measures[t];for(let t=0,i=e.staffEntries.length;t<i;++t){const i=e.staffEntries[t];this.optimizeRestNotePlacement(i,e)}}}}}calculateTwoRestNotesPlacementWithCollisionDetection(t){const e=t.graphicalVoiceEntries[0].notes[0],i=t.graphicalVoiceEntries[1].notes[0];i.PositionAndShape.RelativePosition=new u.PointF2D(0,2.5),t.PositionAndShape.calculateAbsolutePositionsRecursiveWithoutTopelement(),e.PositionAndShape.computeNonOverlappingPositionWithMargin(t.PositionAndShape,g.ColDirEnum.Up,new u.PointF2D(0,i.PositionAndShape.RelativePosition.y));const s=e.PositionAndShape.RelativePosition;s.y-=1,e.PositionAndShape.RelativePosition=s,t.PositionAndShape.calculateBoundingBox()}calculateRestNotePlacementWithCollisionDetectionFromGraphicalNote(t){let e,i;t.graphicalVoiceEntries[0].notes[0].sourceNote.isRest()?(e=t.graphicalVoiceEntries[0].notes[0],i=t.graphicalVoiceEntries[1].notes):(i=t.graphicalVoiceEntries[0].notes,e=t.graphicalVoiceEntries[1].notes[0]);let s=!1;t.PositionAndShape.calculateAbsolutePositionsRecursiveWithoutTopelement();for(let t=0,n=i.length;t<n;++t){const n=i[t];if(e.PositionAndShape.marginCollisionDetection(n.PositionAndShape)){s=!0;break}}if(s)if(e.sourceNote.ParentVoiceEntry.ParentVoice instanceof b.LinkedVoice){const t=i[0].PositionAndShape.BorderMarginBottom+i[0].PositionAndShape.RelativePosition.y;e.PositionAndShape.RelativePosition=new u.PointF2D(0,t-e.PositionAndShape.BorderMarginTop+.5)}else{const t=i[i.length-1],s=t.PositionAndShape.BorderMarginTop+t.PositionAndShape.RelativePosition.y;if(i[0].sourceNote.ParentVoiceEntry.ParentVoice instanceof b.LinkedVoice)e.PositionAndShape.RelativePosition=new u.PointF2D(0,s-e.PositionAndShape.BorderMarginBottom-.5);else{const t=i[0].PositionAndShape.BorderMarginBottom+i[0].PositionAndShape.RelativePosition.y;e.PositionAndShape.RelativePosition=t<2?new u.PointF2D(0,t-e.PositionAndShape.BorderMarginTop+.5):new u.PointF2D(0,s-e.PositionAndShape.BorderMarginBottom-0)}}t.PositionAndShape.calculateBoundingBox()}calculateTieCurves(){for(const t of this.musicSystems)for(const e of t.StaffLines)for(const t of e.Measures)for(const e of t.staffEntries)for(const i of e.GraphicalTies)if(void 0!==i.StartNote&&i.StartNote.parentVoiceEntry.parentStaffEntry===e){const e=i.StartNote.parentVoiceEntry.parentStaffEntry.parentMeasure.ParentStaffLine!==i.EndNote.parentVoiceEntry.parentStaffEntry.parentMeasure.ParentStaffLine;this.layoutGraphicalTie(i,e,t.ParentStaff.isTab)}}calculateLyricsPosition(){const t=new x.Dictionary;for(let t=0,e=this.graphicalMusicSheet.ParentMusicSheet.Instruments.length;t<e;++t){const e=this.graphicalMusicSheet.ParentMusicSheet.Instruments[t];e.HasLyrics&&e.LyricVersesNumbers.length>0&&e.LyricVersesNumbers.sort()}for(let e=0,i=this.musicSystems.length;e<i;++e){const i=this.musicSystems[e];for(let e=0,s=i.StaffLines.length;e<s;++e){const s=i.StaffLines[e],n=this.calculateSingleStaffLineLyricsPosition(s,s.ParentStaff.ParentInstrument.LyricVersesNumbers);t.setValue(s,n),this.calculateLyricsExtendsAndDashes(t.getValue(s))}}for(let e=0,i=this.musicSystems.length;e<i;++e){const i=this.musicSystems[e];for(let e=0,s=i.StaffLines.length;e<s;++e){const s=i.StaffLines[e];this.calculateLyricsExtendsAndDashes(t.getValue(s))}}}calculateSingleLyricWord(t){const e=t.ParentLyricWord,i=e.GraphicalLyricsEntries.indexOf(t);let s;if(i>=0&&(s=e.GraphicalLyricsEntries[i+1]),!s)return;const n=t.StaffEntryParent.parentMeasure.ParentStaffLine,r=s.StaffEntryParent.parentMeasure.ParentStaffLine,o=t.StaffEntryParent,a=s.StaffEntryParent;if(t.StaffEntryParent.parentMeasure.ParentStaffLine===s.StaffEntryParent.parentMeasure.ParentStaffLine){const e=o.parentMeasure.PositionAndShape.RelativePosition.x+o.PositionAndShape.RelativePosition.x+t.GraphicalLabel.PositionAndShape.RelativePosition.x+t.GraphicalLabel.PositionAndShape.BorderMarginRight,i=a.parentMeasure.PositionAndShape.RelativePosition.x+a.PositionAndShape.RelativePosition.x+t.GraphicalLabel.PositionAndShape.RelativePosition.x+s.GraphicalLabel.PositionAndShape.BorderMarginLeft,r=t.GraphicalLabel.PositionAndShape.RelativePosition.y;let l=1;i-e>3*this.rules.MinimumDistanceBetweenDashes&&(l=Math.floor((i-e)/this.rules.MinimumDistanceBetweenDashes)-1),1===l?this.calculateSingleDashForLyricWord(n,e,i,r):this.calculateDashes(n,e,i,r)}else{const e=o.parentMeasure.PositionAndShape.RelativePosition.x+o.PositionAndShape.RelativePosition.x+t.GraphicalLabel.PositionAndShape.BorderMarginRight,i=n.Measures[n.Measures.length-1],l=i.PositionAndShape.RelativePosition.x+i.PositionAndShape.Size.width;let h=t.GraphicalLabel.PositionAndShape.RelativePosition.y;if(this.calculateDashes(n,e,l,h),r&&r.Measures[0]&&a.parentMeasure.ParentStaffLine&&(a!==a.parentMeasure.staffEntries[0]||a.parentMeasure!==a.parentMeasure.ParentStaffLine.Measures[0])){const t=r.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x,e=a.parentMeasure.PositionAndShape.RelativePosition.x+a.PositionAndShape.RelativePosition.x+s.GraphicalLabel.PositionAndShape.BorderMarginLeft;h=s.GraphicalLabel.PositionAndShape.RelativePosition.y,this.calculateDashes(r,t,e,h)}}}calculateDashes(t,e,i,s){let n=i-e;if(n<3*this.rules.MinimumDistanceBetweenDashes)this.calculateSingleDashForLyricWord(t,e,i,s);else{const r=Math.floor(n/this.rules.MinimumDistanceBetweenDashes)-1,o=n/(r+1);let a=0;for(e+=o,i-=o;a<=Math.floor(r/2)&&i>e;)n=this.calculateRightAndLeftDashesForLyricWord(t,e,i,s),e+=o,i-=o,a++;n>2*o&&this.calculateSingleDashForLyricWord(t,e,i,s)}}calculateSingleDashForLyricWord(t,e,i,s){const n=new M.Label("-");n.colorDefault=this.rules.DefaultColorLyrics;const r=new f.GraphicalLabel(n,this.rules.LyricsHeight,m.TextAlignmentEnum.CenterBottom,this.rules);r.setLabelPositionAndShapeBorders(),t.LyricsDashes.push(r),-1===this.staffLinesWithLyricWords.indexOf(t)&&this.staffLinesWithLyricWords.push(t),r.PositionAndShape.Parent=t.PositionAndShape;const o=new u.PointF2D(e+(i-e)/2,s);r.PositionAndShape.RelativePosition=o}calculateLyricExtend(t){let e=t.GraphicalLabel.PositionAndShape.RelativePosition.y;const i=t.StaffEntryParent,s=i.parentMeasure.ParentStaffLine;let n,r;const o=i.parentMeasure.ParentStaff.idInMusicSheet;for(let t=i.parentVerticalContainer.Index+1;t<this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length;++t){const e=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[t].StaffEntries[o];if(e){if(e.hasOnlyRests())break;if(e.LyricsEntries.length>0)break;n=e,r=n.parentMeasure.ParentStaffLine,r||(r=i.parentMeasure.ParentStaffLine)}}if(n&&r)if(s===r&&n.parentMeasure.ParentStaffLine){const r=i.parentMeasure.PositionAndShape.RelativePosition.x+i.PositionAndShape.RelativePosition.x+t.GraphicalLabel.PositionAndShape.BorderMarginRight,o=n.parentMeasure.PositionAndShape.RelativePosition.x+n.PositionAndShape.RelativePosition.x+n.PositionAndShape.BorderMarginRight;e-=t.GraphicalLabel.PositionAndShape.Size.height/4,this.calculateSingleLyricWordWithUnderscore(s,r,o,e)}else{const o=s.Measures[s.Measures.length-1].PositionAndShape,a=i.parentMeasure.PositionAndShape.RelativePosition.x+i.PositionAndShape.RelativePosition.x+t.GraphicalLabel.PositionAndShape.BorderMarginRight,l=o.RelativePosition.x+o.Size.width;if(e-=t.GraphicalLabel.PositionAndShape.Size.height/4,this.calculateSingleLyricWordWithUnderscore(s,a,l,e),!n)return;if(n.parentMeasure.ParentStaffLine&&n.parentMeasure.staffEntries&&(n!==n.parentMeasure.staffEntries[0]||n.parentMeasure!==n.parentMeasure.ParentStaffLine.Measures[0])){const t=r.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x,i=n.parentMeasure.PositionAndShape.RelativePosition.x+n.PositionAndShape.RelativePosition.x+n.PositionAndShape.BorderMarginRight;this.calculateSingleLyricWordWithUnderscore(r,t,i,e)}}}calculateSingleLyricWordWithUnderscore(t,e,i,s){const n=new u.PointF2D(e,s),r=new u.PointF2D(i,s),o=new _.GraphicalLine(n,r,this.rules.LyricUnderscoreLineWidth);o.colorHex=this.rules.DefaultColorLyrics,t.LyricLines.push(o),-1===this.staffLinesWithLyricWords.indexOf(t)&&this.staffLinesWithLyricWords.push(t)}calculateRightAndLeftDashesForLyricWord(t,e,i,s){const n=new M.Label("-");n.colorDefault=this.rules.DefaultColorLyrics;const r=new f.GraphicalLabel(n,this.rules.LyricsHeight,m.TextAlignmentEnum.CenterBottom,this.rules);r.setLabelPositionAndShapeBorders(),t.LyricsDashes.push(r),-1===this.staffLinesWithLyricWords.indexOf(t)&&this.staffLinesWithLyricWords.push(t),r.PositionAndShape.Parent=t.PositionAndShape;const o=new u.PointF2D(e,s);r.PositionAndShape.RelativePosition=o;const a=new M.Label("-"),l=new f.GraphicalLabel(a,this.rules.LyricsHeight,m.TextAlignmentEnum.CenterBottom,this.rules);l.setLabelPositionAndShapeBorders(),t.LyricsDashes.push(l),l.PositionAndShape.Parent=t.PositionAndShape;const h=new u.PointF2D(i,s);return l.PositionAndShape.RelativePosition=h,l.PositionAndShape.RelativePosition.x-r.PositionAndShape.RelativePosition.x}calculateDynamicExpressions(){const t=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,this.rules.MaxMeasureToDrawIndex);for(let e=Math.min(this.rules.MinMeasureToDrawIndex,this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length);e<=t;e++){const t=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[e];this.dynamicExpressionMap.clear();for(let i=0;i<t.StaffLinkedExpressions.length;i++)if(this.graphicalMusicSheet.MeasureList[e]&&this.graphicalMusicSheet.MeasureList[e][i]&&this.graphicalMusicSheet.MeasureList[e][i].ParentStaff.ParentInstrument.Visible)for(let s=0;s<t.StaffLinkedExpressions[i].length;s++)(void 0!==t.StaffLinkedExpressions[i][s].InstantaneousDynamic||void 0!==t.StaffLinkedExpressions[i][s].StartingContinuousDynamic&&t.StaffLinkedExpressions[i][s].StartingContinuousDynamic.StartMultiExpression===t.StaffLinkedExpressions[i][s]&&0===t.StaffLinkedExpressions[i][s].UnknownList.length)&&this.calculateDynamicExpressionsForMultiExpression(t.StaffLinkedExpressions[i][s],e,i)}this.dynamicExpressionMap.clear()}calculateOctaveShifts(){for(let t=0;t<this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length;t++){const e=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[t];for(let i=0;i<e.StaffLinkedExpressions.length;i++)if(this.graphicalMusicSheet.MeasureList[t]&&this.graphicalMusicSheet.MeasureList[t][i]&&this.graphicalMusicSheet.MeasureList[t][i].ParentStaff.ParentInstrument.Visible)for(let s=0;s<e.StaffLinkedExpressions[i].length;s++)e.StaffLinkedExpressions[i][s].OctaveShiftStart&&this.calculateSingleOctaveShift(e,e.StaffLinkedExpressions[i][s],t,i)}}calculatePedals(){for(let t=0;t<this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length;t++){const e=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[t];for(let i=0;i<e.StaffLinkedExpressions.length;i++)if(this.graphicalMusicSheet.MeasureList[t]&&this.graphicalMusicSheet.MeasureList[t][i]&&this.graphicalMusicSheet.MeasureList[t][i].ParentStaff.ParentInstrument.Visible)for(let s=0;s<e.StaffLinkedExpressions[i].length;s++)e.StaffLinkedExpressions[i][s].PedalStart&&this.calculateSinglePedal(e,e.StaffLinkedExpressions[i][s],t,i)}}getFirstLeftNotNullStaffEntryFromContainer(t,e,i){if(this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[t].StaffEntries[e])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[t].StaffEntries[e];for(let i=t-1;i>=0;i--)if(this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[i].StaffEntries[e])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[i].StaffEntries[e]}getFirstRightNotNullStaffEntryFromContainer(t,e,i){if(this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[t].StaffEntries[e])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[t].StaffEntries[e];for(let i=t+1;i<this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length;i++)if(this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[i].StaffEntries[e])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[i].StaffEntries[e]}calculateWordRepetitionInstructions(){for(let t=0;t<this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length;t++){const e=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[t];for(let i=0,s=e.FirstRepetitionInstructions.length;i<s;++i){const s=e.FirstRepetitionInstructions[i];this.calculateWordRepetitionInstruction(s,t)}for(let i=0,s=e.LastRepetitionInstructions.length;i<s;++i){const s=e.LastRepetitionInstructions[i];this.calculateWordRepetitionInstruction(s,t)}}}calculateRepetitionEndings(){const t=this.graphicalMusicSheet.ParentMusicSheet;for(let e=0,i=t.Repetitions.length;e<i;++e){const i=t.Repetitions[e];this.calcGraphicalRepetitionEndingsRecursively(i)}}calculateTempoExpressions(){const t=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,this.rules.MaxMeasureToDrawIndex);for(let e=this.rules.MinMeasureToDrawIndex;e<=t;e++){const t=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[e];for(let i=0;i<t.TempoExpressions.length;i++)this.calculateTempoExpressionsForMultiTempoExpression(t,t.TempoExpressions[i],e)}}calculateRehearsalMarks(){if(this.rules.RenderRehearsalMarks)for(const t of this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures)this.calculateRehearsalMark(t)}calculateRehearsalMark(t){throw new Error(this.abstractNotImplementedErrorMessage)}calculateMoodAndUnknownExpressions(){for(let t=0;t<this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length;t++){const e=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[t];for(let i=0;i<e.StaffLinkedExpressions.length;i++)if(this.graphicalMusicSheet.MeasureList[t]&&this.graphicalMusicSheet.MeasureList[t][i]&&this.graphicalMusicSheet.MeasureList[t][i].ParentStaff.ParentInstrument.Visible)for(let s=0;s<e.StaffLinkedExpressions[i].length;s++)(e.StaffLinkedExpressions[i][s].MoodList.length>0||e.StaffLinkedExpressions[i][s].UnknownList.length>0)&&this.calculateMoodAndUnknownExpression(e.StaffLinkedExpressions[i][s],t,i)}}calculateStemDirectionFromVoices(t){if(void 0!==t.ParentSourceStaffEntry.Link)return t===t.ParentSourceStaffEntry.VoiceEntries[0]?void(t.WantedStemDirection=h.StemDirectionType.Up):void(t.WantedStemDirection=h.StemDirectionType.Down);t.ParentVoice instanceof b.LinkedVoice?t.WantedStemDirection=h.StemDirectionType.Down:t.ParentSourceStaffEntry.VoiceEntries.length>1&&(t.WantedStemDirection=h.StemDirectionType.Up)}setBeamNotesWantedStemDirections(t){if(!(t.Notes.length>0))return;const e=t.Notes[0].NoteBeam;if(e)for(const i of e.Notes)if(i.ParentVoiceEntry.WantedStemDirection!==h.StemDirectionType.Undefined&&i.ParentVoiceEntry.ParentSourceStaffEntry.ParentStaff.Id===t.ParentSourceStaffEntry.ParentStaff.Id){t.WantedStemDirection=i.ParentVoiceEntry.WantedStemDirection;break}}}e.MusicSheetCalculator=F},1494:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSheetDrawer=void 0;const s=i(8911),n=i(8155),r=i(6729),o=i(3278),a=i(9086),l=i(9946),h=i(2255),c=i(1274),u=i(1703),d=i(7771),f=i(158),m=i(5074),p=i(9839),b=i(4196);e.MusicSheetDrawer=class{constructor(t,e){this.drawableBoundingBoxElement="None",this.skyLineVisible=!1,this.bottomLineVisible=!1,this.phonicScoreMode=m.PhonicScoreModes.Manual,this.textMeasurer=t,this.splitScreenLineColor=-1,this.drawingParameters=e,this.rules=e.Rules}set Mode(t){this.phonicScoreMode=t}drawSheet(t){if(this.graphicalMusicSheet=t,this.rules=t.ParentMusicSheet.Rules,this.drawSplitScreenLine(),this.drawingParameters.drawCursors)for(const e of t.Cursors){if(!e)continue;const t=new s.BoundingBox(e);t.AbsolutePosition=e.Start,t.BorderBottom=e.End.y-e.Start.y,t.BorderRight=e.Width/2,t.BorderLeft=-e.Width/2,this.isVisible(t)&&this.drawLineAsVerticalRectangle(e,n.GraphicalLayers.Cursor)}this.drawingParameters.drawScrollIndicator&&this.drawScrollIndicator();const e=Math.min(this.graphicalMusicSheet.MusicPages.length,this.rules.MaxPageToDrawNumber);for(let t=0;t<e;t++){const e=this.graphicalMusicSheet.MusicPages[t];this.drawPage(e)}}drawLineAsHorizontalRectangle(t,e){let i=new o.RectangleF2D(t.Start.x,t.End.y-t.Width/2,t.End.x-t.Start.x,t.Width);i=this.applyScreenTransformationForRect(i),this.renderRectangle(i,e,t.styleId,t.colorHex)}drawLineAsVerticalRectangle(t,e){const i=t.Start,s=t.Width;let n=new o.RectangleF2D(i.x-s/2,i.y,s,t.End.y-i.y);n=this.applyScreenTransformationForRect(n),this.renderRectangle(n,e,t.styleId)}drawLineAsHorizontalRectangleWithOffset(t,e,i){const s=new a.PointF2D(t.Start.x+e.x,t.Start.y+e.y),n=new a.PointF2D(t.End.x+e.x,t.End.y+e.y),r=t.Width;let l=new o.RectangleF2D(s.x,n.y-r/2,n.x-s.x,r);l=this.applyScreenTransformationForRect(l),this.renderRectangle(l,i,t.styleId)}drawLineAsVerticalRectangleWithOffset(t,e,i){const s=new a.PointF2D(t.Start.x+e.x,t.Start.y+e.y),n=new a.PointF2D(t.End.x+e.x,t.End.y+e.y),r=t.Width;let l=new o.RectangleF2D(s.x,s.y,r,n.y-s.y);l=this.applyScreenTransformationForRect(l),this.renderRectangle(l,i,t.styleId)}drawRectangle(t,e){const i=t.PositionAndShape;let s=new o.RectangleF2D(i.AbsolutePosition.x,i.AbsolutePosition.y,i.BorderRight,i.BorderBottom);s=this.applyScreenTransformationForRect(s),this.renderRectangle(s,e,t.style)}calculatePixelDistance(t){throw new Error("not implemented")}drawLabel(t,e){if(!this.isVisible(t.PositionAndShape))return;const i=t.Label;if(""===i.text.trim())return;const s=this.applyScreenTransformation(t.PositionAndShape.AbsolutePosition),n=this.calculatePixelDistance(i.fontHeight),r=this.calculatePixelDistance(t.PositionAndShape.Size.width),o=Math.ceil(r),a=Math.ceil(n*(.2+t.TextLines.length));switch(i.textAlignment){case c.TextAlignmentEnum.LeftTop:break;case c.TextAlignmentEnum.LeftCenter:s.y-=a/2;break;case c.TextAlignmentEnum.LeftBottom:s.y-=a;break;case c.TextAlignmentEnum.CenterTop:s.x-=o/2;break;case c.TextAlignmentEnum.CenterCenter:s.x-=o/2,s.y-=a/2;break;case c.TextAlignmentEnum.CenterBottom:s.x-=o/2,s.y-=a;break;case c.TextAlignmentEnum.RightTop:s.x-=o;break;case c.TextAlignmentEnum.RightCenter:s.x-=o,s.y-=a/2;break;case c.TextAlignmentEnum.RightBottom:s.x-=o,s.y-=a;break;default:throw new u.ArgumentOutOfRangeException("")}return this.renderLabel(t,e,o,a,n,s)}applyScreenTransformation(t){throw new Error("not implemented")}applyScreenTransformations(t){const e=[];for(const i of t)e.push(this.applyScreenTransformation(i));return e}applyScreenTransformationForRect(t){throw new Error("not implemented")}drawSplitScreenLine(){}renderRectangle(t,e,i,s,n=1){throw new Error("not implemented")}drawScrollIndicator(){}drawSelectionStartSymbol(t){}drawSelectionEndSymbol(t){}renderLabel(t,e,i,s,n,r){throw new Error("not implemented")}renderSystemToScreen(t,e,i){}drawMeasure(t){throw new Error("not implemented")}drawSkyLine(t){}drawBottomLine(t){}drawInstrumentBrace(t,e){}drawGroupBracket(t,e){}isVisible(t){return!0}drawMusicSystem(t){const e=this.getSystemAbsBoundingRect(t),i=this.getSytemBoundingBoxInPixels(e);this.drawMusicSystemComponents(t,i,e)}getSytemBoundingBoxInPixels(t){const e=this.applyScreenTransformationForRect(t);return e.x=Math.round(e.x),e.y=Math.round(e.y),e}getSystemAbsBoundingRect(t){const e=t.PositionAndShape.BoundingRectangle;return new o.RectangleF2D(t.PositionAndShape.AbsolutePosition.x+t.PositionAndShape.BorderLeft-1,t.PositionAndShape.AbsolutePosition.y+t.PositionAndShape.BorderTop-1,e.width+6,e.height+2)}drawMusicSystemComponents(t,e,i){const s=this.graphicalMusicSheet.SelectionStartSymbol,r=this.graphicalMusicSheet.SelectionEndSymbol;this.drawingParameters.drawSelectionStartSymbol&&void 0!==s&&this.isVisible(s.PositionAndShape)&&this.drawSelectionStartSymbol(s),this.drawingParameters.drawSelectionEndSymbol&&void 0!==r&&this.isVisible(r.PositionAndShape)&&this.drawSelectionEndSymbol(r);for(const e of t.StaffLines)this.drawStaffLine(e),this.rules.RenderLyrics&&(e.LyricsDashes.length>0&&this.drawDashes(e.LyricsDashes),e.LyricLines.length>0&&this.drawLyricLines(e.LyricLines,e));for(const e of t.SystemLines)this.drawSystemLineObject(e);if(t.Parent===t.Parent.Parent.MusicPages[0])for(const e of t.Labels)e.SVGNode=this.drawLabel(e,n.GraphicalLayers.Notes);const o=this.graphicalMusicSheet.ParentMusicSheet.Instruments,a=o.filter((t=>t.Visible)).length;for(const e of t.InstrumentBrackets)this.drawInstrumentBrace(e,t);if(o.length>0)if(a>1)for(const e of t.GroupBrackets)this.drawGroupBracket(e,t);else for(const e of t.GroupBrackets)e.Visible=!1;if(!this.leadSheet)for(const e of t.MeasureNumberLabels)e.SVGNode=this.drawLabel(e,n.GraphicalLayers.Notes);for(const e of t.StaffLines)this.drawStaffLineSymbols(e);this.drawingParameters.drawMarkedAreas&&this.drawMarkedAreas(t),this.drawingParameters.drawComments&&this.drawComment(t)}activateSystemRendering(t,e,i,s){return!0}drawSystemLineObject(t){}drawStaffLine(t){for(const e of t.Measures)this.drawMeasure(e);this.rules.RenderLyrics&&t.LyricsDashes.length>0&&this.drawDashes(t.LyricsDashes),this.drawOctaveShifts(t),this.drawPedals(t),this.drawExpressions(t),this.skyLineVisible&&this.drawSkyLine(t),this.bottomLineVisible&&this.drawBottomLine(t)}drawLyricLines(t,e){e.LyricLines.forEach((t=>{t.Start.y+=e.PositionAndShape.AbsolutePosition.y,t.End.y+=e.PositionAndShape.AbsolutePosition.y,t.Start.x+=e.PositionAndShape.AbsolutePosition.x,t.End.x+=e.PositionAndShape.AbsolutePosition.x,this.drawGraphicalLine(t,this.rules.LyricUnderscoreLineWidth,t.colorHex)}))}drawExpressions(t){}drawGraphicalLine(t,e,i="black"){return this.drawLine(t.Start,t.End,i,e)}drawLine(t,e,i="#FF0000FF",s){}drawDashes(t){t.forEach((t=>t.SVGNode=this.drawLabel(t,n.GraphicalLayers.Notes)))}drawOctaveShifts(t){}drawStaffLines(t){if(t.StaffLines){const e=t.PositionAndShape.AbsolutePosition;for(let i=0;i<5;i++)this.drawLineAsHorizontalRectangleWithOffset(t.StaffLines[i],e,n.GraphicalLayers.Notes)}}drawInstantaneousDynamic(t){throw new Error("not implemented")}drawContinuousDynamic(t){throw new Error("not implemented")}drawSymbol(t,e,i,s=1,r=n.GraphicalLayers.Notes){}get leadSheet(){return this.graphicalMusicSheet.LeadSheet}set leadSheet(t){this.graphicalMusicSheet.LeadSheet=t}drawPage(t){if(this.isVisible(t.PositionAndShape)){for(const e of t.MusicSystems)this.isVisible(e.PositionAndShape)&&this.drawMusicSystem(e);if(t===t.Parent.MusicPages[0])for(const e of t.Labels)e.SVGNode=this.drawLabel(e,n.GraphicalLayers.Notes);this.drawableBoundingBoxElement&&this.drawBoundingBoxes(t.PositionAndShape,0,this.drawableBoundingBoxElement)}}drawBoundingBoxes(t,e=0,i="all"){const s=t.DataObject.constructor.name;let n=!1;"all"===i?n=!0:"VexFlowStaffEntry"===i?n=t.DataObject instanceof p.VexFlowStaffEntry:"VexFlowMeasure"===i?n=t.DataObject instanceof p.VexFlowMeasure:"VexFlowGraphicalNote"===i?n=t.DataObject instanceof p.VexFlowGraphicalNote:"VexFlowVoiceEntry"===i?n=t.DataObject instanceof p.VexFlowVoiceEntry:"GraphicalLabel"===i?n=t.DataObject instanceof l.GraphicalLabel:"VexFlowStaffLine"===i?n=t.DataObject instanceof p.VexFlowStaffLine:"SystemLine"===i?n=t.DataObject instanceof d.SystemLine:"StaffLineActivitySymbol"===i?n=t.DataObject instanceof b.StaffLineActivitySymbol:"VexFlowContinuousDynamicExpression"===i&&(n=t.DataObject instanceof p.VexFlowContinuousDynamicExpression),(n||s===i)&&this.drawBoundingBox(t,void 0,!0,s,e),e++,t.ChildElements.forEach((t=>this.drawBoundingBoxes(t,e,i)))}drawBoundingBox(t,e,i=!1,s,u=0){let d=new o.RectangleF2D(t.AbsolutePosition.x+t.BorderMarginLeft,t.AbsolutePosition.y+t.BorderMarginTop,t.BorderMarginRight-t.BorderMarginLeft,t.BorderMarginBottom-t.BorderMarginTop);i&&(this.drawLineAsHorizontalRectangle(new r.GraphicalLine(new a.PointF2D(t.AbsolutePosition.x-1,t.AbsolutePosition.y),new a.PointF2D(t.AbsolutePosition.x+1,t.AbsolutePosition.y),.1,n.OutlineAndFillStyleEnum.BaseWritingColor,e),u-1),this.drawLineAsVerticalRectangle(new r.GraphicalLine(new a.PointF2D(t.AbsolutePosition.x,t.AbsolutePosition.y-1),new a.PointF2D(t.AbsolutePosition.x,t.AbsolutePosition.y+1),.1,n.OutlineAndFillStyleEnum.BaseWritingColor,e),u-1)),d=this.applyScreenTransformationForRect(d);const f=this.renderRectangle(d,n.GraphicalLayers.Background,u,e,.5);if(s){const t=new h.Label(s);this.renderLabel(new l.GraphicalLabel(t,.8,c.TextAlignmentEnum.CenterCenter,this.rules),u,d.width,d.height,d.height,new a.PointF2D(d.x,d.y+12))}return f}drawMarkedAreas(t){for(const e of t.GraphicalMarkedAreas)e&&(e.systemRectangle&&this.drawRectangle(e.systemRectangle,n.GraphicalLayers.Background),e.settings&&(e.settings.SVGNode=this.drawLabel(e.settings,n.GraphicalLayers.Comment)),e.labelRectangle&&this.drawRectangle(e.labelRectangle,n.GraphicalLayers.Background),e.label&&(e.label.SVGNode=this.drawLabel(e.label,n.GraphicalLayers.Comment)))}drawComment(t){for(const e of t.GraphicalComments)e&&(e.settings&&(e.settings.SVGNode=this.drawLabel(e.settings,n.GraphicalLayers.Comment)),e.label&&(e.label.SVGNode=this.drawLabel(e.label,n.GraphicalLayers.Comment)))}drawStaffLineSymbols(t){const e=t.ParentStaff.ParentInstrument,i=t.PositionAndShape.AbsolutePosition.x,s=t.PositionAndShape.AbsolutePosition.y+2,o=t.PositionAndShape.BorderRight;e.highlight&&this.drawingParameters.drawHighlights&&this.drawLineAsHorizontalRectangle(new r.GraphicalLine(new a.PointF2D(i,s),new a.PointF2D(i+o,s),4,n.OutlineAndFillStyleEnum.Highlighted),n.GraphicalLayers.Highlight);let l=m.MusicSymbolDrawingStyle.Disabled,h=f.MusicSymbol.PLAY,c=this.drawingParameters.drawActivitySymbols;switch(this.phonicScoreMode){case m.PhonicScoreModes.Midi:h=f.MusicSymbol.PLAY,this.midiPlaybackAvailable&&t.ParentStaff.audible&&(l=m.MusicSymbolDrawingStyle.PlaybackSymbols);break;case m.PhonicScoreModes.Following:h=f.MusicSymbol.MIC,t.ParentStaff.following&&(l=m.MusicSymbolDrawingStyle.FollowSymbols);break;default:c=!1}if(c){const t=new a.PointF2D(i+o+2,s);this.drawSymbol(h,l,t)}if(this.drawingParameters.drawErrors)for(const e of t.Measures){const t=e.PositionAndShape,i=t.AbsolutePosition.x,s=t.AbsolutePosition.y+2;e.hasError&&this.graphicalMusicSheet.ParentMusicSheet.DrawErroneousMeasures&&this.drawLineAsHorizontalRectangle(new r.GraphicalLine(new a.PointF2D(i,s),new a.PointF2D(i+t.BorderRight,s),4,n.OutlineAndFillStyleEnum.ErrorUnderlay),n.GraphicalLayers.MeasureError)}}}},158:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSymbol=void 0,(i=e.MusicSymbol||(e.MusicSymbol={}))[i.Unused_first_Symbol=0]="Unused_first_Symbol",i[i.BLACK_HEAD=1]="BLACK_HEAD",i[i.UPWARDS_TAIL=2]="UPWARDS_TAIL",i[i.DOWNWARDS_TAIL=3]="DOWNWARDS_TAIL",i[i.UPWARDS_DOUBLE_TAIL=4]="UPWARDS_DOUBLE_TAIL",i[i.DOWNWARDS_DOUBLE_TAIL=5]="DOWNWARDS_DOUBLE_TAIL",i[i.UPWARDS_TRIPLE_TAIL=6]="UPWARDS_TRIPLE_TAIL",i[i.DOWNWARDS_TRIPLE_TAIL=7]="DOWNWARDS_TRIPLE_TAIL",i[i.UPWARDS_QUAD_TAIL=8]="UPWARDS_QUAD_TAIL",i[i.DOWNWARDS_QUAD_TAIL=9]="DOWNWARDS_QUAD_TAIL",i[i.ROUND_HEAD=10]="ROUND_HEAD",i[i.WHITE_HEAD=11]="WHITE_HEAD",i[i.G_CLEF=12]="G_CLEF",i[i.F_CLEF=13]="F_CLEF",i[i.C_CLEF=14]="C_CLEF",i[i.BREVE=15]="BREVE",i[i.BREVE_REST=16]="BREVE_REST",i[i.COMMON_TIME=17]="COMMON_TIME",i[i.CUT_TIME=18]="CUT_TIME",i[i.WHOLE_REST=19]="WHOLE_REST",i[i.HALF_REST=20]="HALF_REST",i[i.QUARTER_REST=21]="QUARTER_REST",i[i.EIGHTH_REST=22]="EIGHTH_REST",i[i.SIXTEENTH_REST=23]="SIXTEENTH_REST",i[i.THIRTYSECOND_REST=24]="THIRTYSECOND_REST",i[i.SIXTYFOURTH_REST=25]="SIXTYFOURTH_REST",i[i.FLAT=26]="FLAT",i[i.SHARP=27]="SHARP",i[i.NATURAL=28]="NATURAL",i[i.DOUBLE_FLAT=29]="DOUBLE_FLAT",i[i.DOUBLE_SHARP=30]="DOUBLE_SHARP",i[i.ZERO=31]="ZERO",i[i.ONE=32]="ONE",i[i.TWO=33]="TWO",i[i.THREE=34]="THREE",i[i.FOUR=35]="FOUR",i[i.FIVE=36]="FIVE",i[i.SIX=37]="SIX",i[i.SEVEN=38]="SEVEN",i[i.EIGHT=39]="EIGHT",i[i.NINE=40]="NINE",i[i.DOT=41]="DOT",i[i.FERMATA=42]="FERMATA",i[i.INVERTED_FERMATA=43]="INVERTED_FERMATA",i[i.SPICCATO=44]="SPICCATO",i[i.TENUTO=45]="TENUTO",i[i.MARCATO=46]="MARCATO",i[i.MARCATISSIMO=47]="MARCATISSIMO",i[i.INVERTED_MARCATISSIMO=48]="INVERTED_MARCATISSIMO",i[i.P=49]="P",i[i.F=50]="F",i[i.S=51]="S",i[i.Z=52]="Z",i[i.M=53]="M",i[i.R=54]="R",i[i.SEGNO=55]="SEGNO",i[i.CODA=56]="CODA",i[i.DRUM_CLEF=57]="DRUM_CLEF",i[i.G_CLEF_SUB8=58]="G_CLEF_SUB8",i[i.G_CLEF_SUPER8=59]="G_CLEF_SUPER8",i[i.G_CLEF_SUB15=60]="G_CLEF_SUB15",i[i.G_CLEF_SUPER15=61]="G_CLEF_SUPER15",i[i.F_CLEF_SUB8=62]="F_CLEF_SUB8",i[i.F_CLEF_SUPER8=63]="F_CLEF_SUPER8",i[i.F_CLEF_SUB15=64]="F_CLEF_SUB15",i[i.F_CLEF_SUPER15=65]="F_CLEF_SUPER15",i[i.DOWN_BOW=66]="DOWN_BOW",i[i.MORDENT=67]="MORDENT",i[i.INVERTED_MORDENT=68]="INVERTED_MORDENT",i[i.TURN=69]="TURN",i[i.INVERTED_TURN=70]="INVERTED_TURN",i[i.LEFTHAND_PIZZICATO=71]="LEFTHAND_PIZZICATO",i[i.RELEASE_PED=72]="RELEASE_PED",i[i.ENGAGE_PED=73]="ENGAGE_PED",i[i.VA8=74]="VA8",i[i.VB8=75]="VB8",i[i.TRILL=76]="TRILL",i[i.MA15=77]="MA15",i[i.MB15=78]="MB15",i[i.HIGH=79]="HIGH",i[i.PLAY=80]="PLAY",i[i.MIC=81]="MIC",i[i.SNAP_PIZZICATO=82]="SNAP_PIZZICATO",i[i.NATURAL_HARMONIC=83]="NATURAL_HARMONIC",i[i.EditPen=84]="EditPen",i[i.PEDAL_BRACKET=85]="PEDAL_BRACKET",i[i.PEDAL_MIXED=86]="PEDAL_MIXED",i[i.PEDAL_SYMBOL=87]="PEDAL_SYMBOL"},7142:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSystem=void 0;const s=i(6842),n=i(8911),r=i(1797),o=i(1274),a=i(9946),l=i(4785),h=i(9086),c=i(6894),u=i(1649),d=i(1225),f=i(2255);class m extends l.GraphicalObject{constructor(t){super(),this.needsToBeRedrawn=!0,this.staffLines=[],this.graphicalMeasures=[],this.labels=new u.Dictionary,this.measureNumberLabels=[],this.objectsToRedraw=[],this.instrumentBrackets=[],this.groupBrackets=[],this.graphicalMarkedAreas=[],this.graphicalComments=[],this.systemLines=[],this.breaksPage=!1,this.id=t,this.boundingBox=new n.BoundingBox(this),this.maxLabelLength=0}get Parent(){return this.parent}set Parent(t){if(this.parent){const t=this.parent.MusicSystems.indexOf(this,0);t>-1&&this.parent.MusicSystems.splice(t,1)}this.parent=t,this.boundingBox.Parent=t.PositionAndShape}get NextSystem(){const t=this.Parent.MusicSystems.indexOf(this);return t!==this.Parent.MusicSystems.length?this.Parent.MusicSystems[t+1]:void 0}get StaffLines(){return this.staffLines}get GraphicalMeasures(){return this.graphicalMeasures}get MeasureNumberLabels(){return this.measureNumberLabels}get Labels(){return this.labels.values()}get ObjectsToRedraw(){return this.objectsToRedraw}get InstrumentBrackets(){return this.instrumentBrackets}get GroupBrackets(){return this.groupBrackets}get GraphicalMarkedAreas(){return this.graphicalMarkedAreas}get GraphicalComments(){return this.graphicalComments}get SystemLines(){return this.systemLines}get Id(){return this.id}createSystemLeftLine(t,e,i){let s=-t/2;i&&(s=this.maxLabelLength+e-t/2);const n=this.staffLines[0].Measures[0];let r;this.staffLines.length>1&&(r=this.staffLines[this.staffLines.length-1].Measures[0]);const o=this.createSystemLine(s,t,c.SystemLinesEnum.SingleThin,d.SystemLinePosition.MeasureBegin,this,n,r);this.SystemLines.push(o),o.PositionAndShape.RelativePosition=new h.PointF2D(s,0),o.PositionAndShape.BorderLeft=0,o.PositionAndShape.BorderRight=t,o.PositionAndShape.BorderTop=o.PositionAndShape.Parent.BorderTop,o.PositionAndShape.BorderBottom=o.PositionAndShape.Parent.BorderBottom,this.createLinesForSystemLine(o)}createVerticalLineForMeasure(t,e,i,s,n,r){const o=r.ParentStaffLine,a=new h.PointF2D(o.PositionAndShape.RelativePosition.x,o.PositionAndShape.RelativePosition.y),l=o.ParentStaff.ParentInstrument.Staves;if(o.ParentStaff===l[0]){let c;l.length>1&&(c=this.getBottomStaffLine(o).Measures[n]);const u=this.createSystemLine(t,e,i,s,this,r,c),d=a.x+t;u.PositionAndShape.RelativePosition=new h.PointF2D(d,0),u.PositionAndShape.BorderLeft=0,u.PositionAndShape.BorderRight=e,this.SystemLines.push(u)}}setYPositionsToVerticalLineObjectsAndCreateLines(t){}calculateBorders(t){}alignBeginInstructions(){}GetLeftBorderAbsoluteXPosition(){return this.StaffLines[0].PositionAndShape.AbsolutePosition.x+this.StaffLines[0].Measures[0].beginInstructionsWidth}GetRightBorderAbsoluteXPosition(){return this.StaffLines[0].PositionAndShape.AbsolutePosition.x+this.StaffLines[0].StaffLines[0].End.x}AddGraphicalMeasures(t){for(let e=0,i=t.length;e<i;++e)t[e].ParentMusicSystem=this;this.graphicalMeasures.push(t)}GetSystemsFirstTimeStamp(){return this.graphicalMeasures[0][0].parentSourceMeasure.AbsoluteTimestamp}GetSystemsLastTimeStamp(){const t=this.graphicalMeasures[this.graphicalMeasures.length-1][0].parentSourceMeasure;return r.Fraction.plus(t.AbsoluteTimestamp,t.Duration)}createInstrumentBrackets(t,e){for(let e=0,i=t.length;e<i;++e){const i=t[e];if(i.Staves.length>1){let t,e;for(let s=0,n=this.staffLines.length;s<n;++s){const n=this.staffLines[s];n.ParentStaff===i.Staves[0]&&(t=n),n.ParentStaff===i.Staves[i.Staves.length-1]&&(e=n)}t&&e&&this.createInstrumentBracket(t,e)}}}createGroupBrackets(t,e,i){for(let s=0,n=t.length;s<n;++s){const n=t[s];if(n.InstrumentalGroups.length<1)continue;const r=this.findFirstVisibleInstrumentInInstrumentalGroup(n),o=this.findLastVisibleInstrumentInInstrumentalGroup(n);if(!r||!o)continue;let a,l;for(let t=0,e=this.staffLines.length;t<e;++t){const e=this.staffLines[t];e.ParentStaff===r.Staves[0]&&(a=e),e.ParentStaff===o.Staves[0]&&(l=e)}a&&l&&this.createGroupBracket(a,l,i),n.InstrumentalGroups.length<1||this.createGroupBrackets(n.InstrumentalGroups,e,i+1)}}createMusicSystemLabel(t,e,i,s=!1){var n;const r=e;for(let i=0,r=this.staffLines.length;i<r;++i){const r=this.staffLines[i].ParentStaff.ParentInstrument;let l;if(s)l=r.NameLabel,this.rules.RenderPartNames&&(null==l?void 0:l.print)||(l=new f.Label("",r.NameLabel.textAlignment,r.NameLabel.font),e=0);else{if(!this.rules.RenderPartAbbreviations||!this.rules.RenderPartNames||1===this.staffLines.length||!r.PartAbbreviation||""===r.PartAbbreviation)return;const t=r.PartAbbreviation;l=new f.Label(t,r.NameLabel.textAlignment,r.NameLabel.font)}if(null===(n=null==r?void 0:r.NameLabel)||void 0===n?void 0:n.print){const e=new a.GraphicalLabel(l,t,o.TextAlignmentEnum.LeftCenter,this.rules,this.boundingBox);e.setLabelPositionAndShapeBorders(),this.labels.setValue(r,e)}else e=0}this.maxLabelLength=0;const l=this.labels.values();for(let t=0,i=l.length;t<i;++t){const i=l[t];i.Label.print&&i.PositionAndShape.Size.width>this.maxLabelLength&&(this.maxLabelLength=i.PositionAndShape.Size.width,e=r)}this.updateMusicSystemStaffLineXPosition(e)}setMusicSystemLabelsYPosition(){this.labels.forEach(((t,e)=>{let i=0,s=0;for(let e=0;e<this.staffLines.length;e++)if(this.staffLines[e].ParentStaff.ParentInstrument===t){for(let n=e;n<this.staffLines.length;n++){const e=this.staffLines[n];if(e.ParentStaff.ParentInstrument!==t)break;i+=e.PositionAndShape.RelativePosition.y,s++}break}s>0&&(e.PositionAndShape.RelativePosition=new h.PointF2D(0,i/s+2))}))}checkStaffEntriesForStaffEntryLink(){let t=!1,e=!1;for(let i=0;i<this.staffLines.length-1;i++){for(let e=0,s=this.staffLines[i].Measures.length;e<s;++e){const s=this.staffLines[i].Measures[e];for(let e=0,i=s.staffEntries.length;e<i;++e)s.staffEntries[e].sourceStaffEntry.Link&&(t=!0)}for(let t=0,s=this.staffLines[i+1].Measures.length;t<s;++t){const s=this.staffLines[i+1].Measures[t];for(let t=0,i=s.staffEntries.length;t<i;++t)s.staffEntries[t].sourceStaffEntry.Link&&(e=!0)}}return!(!t||!e)}getBottomStaffLine(t){const e=t.ParentStaff.ParentInstrument.Staves,i=e[e.length-1];for(const e of t.ParentMusicSystem.staffLines)if(e.ParentStaff===i)return e}createSystemLine(t,e,i,s,n,r,o){throw new Error("not implemented")}createLinesForSystemLine(t){}calcBracketsWidth(){let t=0;for(let e=0,i=this.GroupBrackets.length;e<i;++e){const i=this.GroupBrackets[e];t=Math.max(t,i.PositionAndShape.Size.width)}for(let e=0,i=this.InstrumentBrackets.length;e<i;++e){const i=this.InstrumentBrackets[e];t=Math.max(t,i.PositionAndShape.Size.width)}return t}createInstrumentBracket(t,e){}createGroupBracket(t,e,i){}findFirstVisibleInstrumentInInstrumentalGroup(t){for(let e=0,i=t.InstrumentalGroups.length;e<i;++e){const i=t.InstrumentalGroups[e];if(!(i instanceof s.Instrument))return this.findFirstVisibleInstrumentInInstrumentalGroup(i);if(!0===i.Visible)return i}}findLastVisibleInstrumentInInstrumentalGroup(t){let e;for(let i=t.InstrumentalGroups.length-1;i>=0;i--){if(e=t.InstrumentalGroups[i],!(e instanceof s.Instrument))return this.findLastVisibleInstrumentInInstrumentalGroup(e);if(!0===e.Visible)return e}}updateMusicSystemStaffLineXPosition(t){for(let e=0,i=this.StaffLines.length;e<i;++e){const i=this.StaffLines[e],s=i.PositionAndShape.RelativePosition;s.x=this.maxLabelLength+t,i.PositionAndShape.RelativePosition=s,i.PositionAndShape.BorderRight=this.boundingBox.Size.width-this.maxLabelLength-t;for(let t=0;t<i.StaffLines.length;t++){const e=new h.PointF2D(i.PositionAndShape.Size.width,i.StaffLines[t].End.y);i.StaffLines[t].End=e}}}}e.MusicSystem=m},5623:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MeasureBuildParameters=e.SystemBuildParameters=e.MusicSystemBuilder=void 0;const s=i(599),n=i(3331),r=i(5198),o=i(289),a=i(9086),l=i(6729),h=i(6894),c=i(4040),u=i(289),d=i(2337),f=i(1225);e.MusicSystemBuilder=class{constructor(){this.musicSystems=[],this.globalSystemIndex=0,this.leadSheet=!1}initialize(t,e,i){this.leadSheet=t.LeadSheet,this.graphicalMusicSheet=t,this.rules=this.graphicalMusicSheet.ParentMusicSheet.Rules,this.measureList=e,this.numberOfVisibleStaffLines=i,this.activeRhythm=new Array(this.numberOfVisibleStaffLines),this.activeKeys=new Array(this.numberOfVisibleStaffLines),this.activeClefs=new Array(this.numberOfVisibleStaffLines),this.initializeActiveInstructions(this.measureList[0])}buildMusicSystems(){var t,e,i;const s=this.getFullPageSystemWidth();let n=!1;for(this.measureListIndex=0,this.currentSystemParams=new m,this.currentSystemParams.currentSystem=this.initMusicSystem();this.measureListIndex<this.measureList.length;){const r=this.measureList[this.measureListIndex];if(!r||!r[0]){this.measureListIndex++;continue}for(let t=0,e=r.length;t<e;++t)r[t].resetLayout();const o=r[0].parentSourceMeasure,a=o.HasEndLine,l=a&&this.rules.NewPartAndSystemAfterFinalBarline,h=this.currentSystemParams.IsSystemStartMeasure();o.IsSystemStartMeasure=h;const c=o===this.graphicalMusicSheet.ParentMusicSheet.getFirstSourceMeasure();let u=this.rules.MeasureLeftMargin,d=0;const f=this.getMeasureStartLine();if(u+=this.getLineWidth(r[0],f,h),!this.leadSheet){let t=!1;n&&this.rules.ShowRhythmAgainAfterPartEndOrFinalBarline&&(t=!0),u+=this.addBeginInstructions(r,h,c||t),d+=this.addEndInstructions(r)}let m=0;for(let t=0;t<this.numberOfVisibleStaffLines;t++)m=Math.max(m,r[t].minimumStaffEntriesWidth);const p=this.getMeasureEndLine();d+=this.getLineWidth(r[0],p,h);let b,g=this.rules.MeasureLeftMargin;if(this.measureListIndex+1<this.measureList.length){const e=this.measureList[this.measureListIndex+1];b=null===(t=e[0])||void 0===t?void 0:t.parentSourceMeasure,(null==b?void 0:b.hasBeginInstructions())&&(g+=this.addBeginInstructions(e,!1,!1))}let S=u+d+m;(null===(i=null===(e=r[0])||void 0===e?void 0:e.parentSourceMeasure)||void 0===i?void 0:i.multipleRestMeasures)&&(S=this.rules.MultipleRestMeasureDefaultWidth);const y=this.currentSystemParams.currentWidth+S+g<s,E=this.rules.NewPageAtXMLNewPageAttribute&&o.printNewPageXml,v=E||this.rules.NewSystemAtXMLNewPageAttribute&&o.printNewPageXml||this.rules.NewSystemAtXMLNewSystemAttribute&&o.printNewSystemXml;if(h||y&&!v){if(this.addMeasureToSystem(r,f,p,S,u,m,d),this.updateActiveClefs(o,r),this.measureListIndex++,l){if(this.rules.MaxSystemToDrawNumber===this.musicSystems.length)return this.finalizeCurrentSystem(r,!this.rules.StretchLastSystemLine,!1),this.musicSystems;this.finalizeCurrentAndCreateNewSystem(r,!this.rules.StretchLastSystemLine,!1)}n=a}else{if(this.rules.MaxSystemToDrawNumber===this.musicSystems.length)return this.finalizeCurrentSystem(r,!1,!0,E),this.musicSystems;this.finalizeCurrentAndCreateNewSystem(r,!1,!0,E)}}if(this.currentSystemParams.systemMeasures.length>0){if(this.rules.MaxSystemToDrawNumber===this.musicSystems.length)return this.finalizeCurrentSystem(this.measureList[this.measureList.length-1],!this.rules.StretchLastSystemLine,!1),this.musicSystems;this.finalizeCurrentAndCreateNewSystem(this.measureList[this.measureList.length-1],!this.rules.StretchLastSystemLine,!1)}return this.musicSystems}calculateSystemYLayout(){for(const t of this.musicSystems)this.optimizeDistanceBetweenStaffLines(t);this.calculateMusicSystemsRelativePositions()}setMeasureWidth(t,e,i,s){for(let n=0,r=t.length;n<r;++n){const r=t[n];r.setWidth(e),i>0&&(r.beginInstructionsWidth=i),s>0&&(r.endInstructionsWidth=s)}}finalizeCurrentAndCreateNewSystem(t,e=!1,i=!0,s=!1){this.finalizeCurrentSystem(t,e,i,s),this.currentSystemParams=new m,void 0!==t&&this.measureListIndex<this.measureList.length&&(this.currentSystemParams.currentSystem=this.initMusicSystem())}finalizeCurrentSystem(t,e=!1,i=!0,s=!1){this.currentSystemParams.currentSystem.breaksPage=s,this.adaptRepetitionLineWithIfNeeded(),void 0!==t&&i&&this.checkAndCreateExtraInstructionMeasure(t),this.stretchMusicSystem(e)}adaptRepetitionLineWithIfNeeded(){const t=this.currentSystemParams.systemMeasures;if(t.length>=1){const e=this.currentSystemParams.currentSystem.GraphicalMeasures[this.currentSystemParams.currentSystem.GraphicalMeasures.length-1];let i=0;const s=t[t.length-1];s.endLine===h.SystemLinesEnum.DotsBoldBoldDots&&(s.endLine=h.SystemLinesEnum.DotsThinBold,i=e[0].getLineWidth(h.SystemLinesEnum.DotsBoldBoldDots)/2-e[0].getLineWidth(h.SystemLinesEnum.DotsThinBold)),this.currentSystemParams.currentSystemFixWidth-=i;for(let t=0,s=e.length;t<s;++t)e[t].endInstructionsWidth-=i}}addMeasureToSystem(t,e,i,s,n,r,o){this.currentSystemParams.systemMeasures.push({beginLine:e,endLine:i}),this.setMeasureWidth(t,s,n,o),this.addStaveMeasuresToSystem(t),this.currentSystemParams.currentWidth+=s,this.currentSystemParams.currentSystemFixWidth+=n+o,this.currentSystemParams.currentSystemVarWidth+=r,this.currentSystemParams.systemMeasureIndex++}initMusicSystem(){const t=c.MusicSheetCalculator.symbolFactory.createMusicSystem(this.globalSystemIndex++,this.rules);return this.musicSystems.push(t),this.layoutSystemStaves(t),t.createMusicSystemLabel(this.rules.InstrumentLabelTextHeight,this.rules.SystemLabelsRightMargin,this.rules.LabelMarginBorderFactor,1===this.musicSystems.length),t}getFullPageSystemWidth(){return this.graphicalMusicSheet.ParentMusicSheet.pageWidth-this.rules.PageLeftMargin-this.rules.PageRightMargin-this.rules.SystemLeftMargin-this.rules.SystemRightMargin}layoutSystemStaves(t){const e=this.getFullPageSystemWidth(),i=t.PositionAndShape;i.BorderLeft=0,i.BorderRight=e,i.BorderTop=0;const s=[],n=this.graphicalMusicSheet.ParentMusicSheet.Instruments;for(let t=0,e=n.length;t<e;++t){const e=n[t];if(e.Visible&&0!==e.Voices.length)for(let t=0,i=e.Staves.length;t<i;++t){const i=e.Staves[t];s.push(i)}}let r=!1;if(this.leadSheet)for(let t=0,e=s.length;t<e;++t)if(s[t].ParentInstrument.LyricVersesNumbers.length>1){r=!0;break}let o=0;for(let e=0;e<s.length;e++)if(this.addStaffLineToMusicSystem(t,o,s[e]),o+=this.rules.StaffHeight,e+1<s.length){let t=0;t=this.leadSheet&&!r?2.5:s[e].ParentInstrument===s[e+1].ParentInstrument?this.rules.BetweenStaffDistance:this.rules.StaffDistance,o+=t}i.BorderBottom=o}addStaffLineToMusicSystem(t,e,i){if(t){const s=c.MusicSheetCalculator.symbolFactory.createStaffLine(t,i);t.StaffLines.push(s);const n=s.PositionAndShape,r=new a.PointF2D;r.x=0,n.BorderRight=t.PositionAndShape.Size.width,r.y=e,n.RelativePosition=r,n.BorderLeft=0,n.BorderTop=0,n.BorderBottom=this.rules.StaffHeight;for(let t=0;t<5;t++){const e=new a.PointF2D;e.x=0,e.y=t*this.rules.StaffHeight/4;const i=new a.PointF2D;i.x=s.PositionAndShape.Size.width,i.y=t*this.rules.StaffHeight/4,this.leadSheet&&(e.y=i.y=0),s.StaffLines[t]=new l.GraphicalLine(e,i,this.rules.StaffLineWidth)}}}initializeActiveInstructions(t){const e=this.graphicalMusicSheet.ParentMusicSheet.getFirstSourceMeasure();if(e){this.visibleStaffIndices=this.graphicalMusicSheet.getVisibleStavesIndicesFromSourceMeasure(t);for(let t=0,i=this.visibleStaffIndices.length;t<i;t++){const i=this.visibleStaffIndices[t],s=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(e,i);this.activeClefs[t]=e.FirstInstructionsStaffEntries[i].Instructions[0];const n=e.FirstInstructionsStaffEntries[i].Instructions[1];if(n){let e=r.KeyInstruction.copy(n);e=this.transposeKeyInstruction(e,s),this.activeKeys[t]=e}const o=e.FirstInstructionsStaffEntries[i].Instructions[2];this.activeRhythm[t]=o}}}transposeKeyInstruction(t,e){const i=e.getTransposedHalftones();return i!==t.isTransposedBy&&e.ParentStaff.ParentInstrument.MidiInstrumentId!==u.MidiInstrument.Percussion&&void 0!==c.MusicSheetCalculator.transposeCalculator&&c.MusicSheetCalculator.transposeCalculator.transposeKey(t,i),t}addBeginInstructions(t,e,i){const s=t.length;if(0===s)return 0;let n=0;const r=t[0].parentSourceMeasure;for(let o=0;o<s;++o){const s=t[o],a=this.visibleStaffIndices[o],l=r.FirstInstructionsStaffEntries[a],h=this.AddInstructionsAtMeasureBegin(l,s,o,i,e);n=Math.max(n,h)}return n}addEndInstructions(t){const e=t.length;if(0===e)return 0;let i=.5;const s=t[0].parentSourceMeasure;for(let n=0;n<e;n++){const e=t[n],r=this.visibleStaffIndices[n],o=s.LastInstructionsStaffEntries[r],a=this.addInstructionsAtMeasureEnd(o,e,t);i=Math.max(i,a)}return i}AddInstructionsAtMeasureBegin(t,e,i,s,a){var l;let h,c,u,d=0;if(t)for(let e=0,i=t.Instructions.length;e<i;++e){const i=t.Instructions[e];i instanceof o.ClefInstruction?h=i:i instanceof r.KeyInstruction?c=i:i instanceof n.RhythmInstruction&&(u=i)}a&&(h||(h=this.activeClefs[i]),c||(c=r.KeyInstruction.copy(this.activeKeys[i])),s&&!u&&(u=this.activeRhythm[i]));let f=!1,m=!1,p=!1;if(h?(e.addClefAtBegin(h),f=!0):h=this.activeClefs[i],c){c=this.transposeKeyInstruction(c,e);const t=a?void 0:this.activeKeys[i];e.addKeyAtBegin(c,t,h),m=!0}if(void 0!==u&&u.PrintObject&&this.rules.RenderTimeSignatures){let t=!0;const i=e.MeasureNumber-1-this.rules.MinMeasureToDrawIndex;if(e.MeasureNumber-1>=0&&this.measureList[i]){const e=null===(l=this.measureList[i][0])||void 0===l?void 0:l.parentSourceMeasure;(null==e?void 0:e.ImplicitMeasure)&&(null==e?void 0:e.RhythmPrinted)&&(t=!1)}t&&(e.addRhythmAtBegin(u),e.parentSourceMeasure.RhythmPrinted=u,p=!0)}return(f||m||p)&&(d+=e.beginInstructionsWidth,p&&(d+=this.rules.RhythmRightMargin)),d}addInstructionsAtMeasureEnd(t,e,i){if(!t||!t.Instructions||0===t.Instructions.length)return 0;for(let s=0,n=t.Instructions.length;s<n;++s){const n=t.Instructions[s];if(n instanceof o.ClefInstruction){const t=n;e.addClefAtEnd(t);for(const s of i)s!==e&&s.addClefAtEnd(t,!1)}}return this.rules.MeasureRightMargin+e.endInstructionsWidth}updateActiveClefs(t,e){for(let i=0,s=e.length;i<s;i++){const e=this.visibleStaffIndices[i],s=t.FirstInstructionsStaffEntries[e];if(s)for(let t=0,e=s.Instructions.length;t<e;++t){const e=s.Instructions[t];e instanceof o.ClefInstruction?this.activeClefs[i]=e:e instanceof r.KeyInstruction?this.activeKeys[i]=e:e instanceof n.RhythmInstruction&&(this.activeRhythm[i]=e)}const a=t.getEntriesPerStaff(e);for(let t=0,e=a.length;t<e;++t){const e=a[t];if(e.Instructions)for(let t=0,s=e.Instructions.length;t<s;++t){const s=e.Instructions[t];s instanceof o.ClefInstruction&&(this.activeClefs[i]=s)}}const l=t.LastInstructionsStaffEntries[e];if(l){const t=l.Instructions;for(let e=0,s=t.length;e<s;++e){const s=t[e];s instanceof o.ClefInstruction&&(this.activeClefs[i]=s)}}}}checkAndCreateExtraInstructionMeasure(t){const e=t[0].parentSourceMeasure.FirstInstructionsStaffEntries,i=[];for(let s=0,n=t.length;s<n;++s){const n=t[s];i.push(e[n.ParentStaff.idInMusicSheet])}let s=0;for(let t=0,e=i.length;t<e;++t){const e=i[t];if(!e)continue;const o=e.Instructions;let a,l;for(let e=0,i=o.length;e<i;++e){const i=o[e];i instanceof r.KeyInstruction&&i.Key!==this.activeKeys[t].Key&&(a=i),i instanceof n.RhythmInstruction&&i!==this.activeRhythm[t]&&(l=i)}if(void 0!==a||l){const e=this.addExtraInstructionMeasure(t,a,l);s=Math.max(s,e)}}s>0&&(this.currentSystemParams.systemMeasures.push({beginLine:h.SystemLinesEnum.None,endLine:h.SystemLinesEnum.None}),this.currentSystemParams.currentWidth+=s,this.currentSystemParams.currentSystemFixWidth+=s)}addExtraInstructionMeasure(t,e,i){const s=this.currentSystemParams.currentSystem,n=c.MusicSheetCalculator.symbolFactory.createExtraGraphicalMeasure(s.StaffLines[t]);[].push(n),e&&n.addKeyAtBegin(e,this.activeKeys[t],this.activeClefs[t]),void 0!==i&&i.PrintObject&&n.addRhythmAtBegin(i),n.PositionAndShape.BorderLeft=0,n.PositionAndShape.BorderTop=0,n.PositionAndShape.BorderBottom=this.rules.StaffHeight;const r=this.rules.MeasureLeftMargin+n.beginInstructionsWidth+this.rules.MeasureRightMargin;return n.PositionAndShape.BorderRight=r,s.StaffLines[t].Measures.push(n),r}addStaveMeasuresToSystem(t){if(t[0]){const e=[];for(let i=0;i<t.length;i++)e.push(t[i]);const i=this.currentSystemParams.currentSystem;for(let t=0;t<this.numberOfVisibleStaffLines;t++){const s=e[t];i.StaffLines[t].Measures.push(s),s.ParentStaffLine=i.StaffLines[t]}i.AddGraphicalMeasures(e)}}getMeasureStartLine(){if(this.thisMeasureBeginsLineRepetition()){const t=this.currentSystemParams.IsSystemStartMeasure(),e=0===this.measureListIndex;if(this.previousMeasureEndsLineRepetition()&&!t)return h.SystemLinesEnum.DotsBoldBoldDots;if(!e)return h.SystemLinesEnum.BoldThinDots}return h.SystemLinesEnum.None}getMeasureEndLine(){let t;try{if(t=this.measureList[this.measureListIndex][0].parentSourceMeasure,this.rules.RenderMultipleRestMeasures&&t.multipleRestMeasures>1){const e=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,t.measureListIndex+t.multipleRestMeasures-1);t=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[e]}}finally{}return this.nextMeasureBeginsLineRepetition()&&this.thisMeasureEndsLineRepetition()?h.SystemLinesEnum.DotsBoldBoldDots:this.thisMeasureEndsLineRepetition()?h.SystemLinesEnum.DotsThinBold:this.nextMeasureHasKeyInstructionChange()||this.thisMeasureEndsWordRepetition()||this.nextMeasureBeginsWordRepetition()?h.SystemLinesEnum.DoubleThin:t&&void 0!==t.endingBarStyleEnum?t.endingBarStyleEnum:h.SystemLinesEnum.SingleThin}getLineWidth(t,e,i){let s=t.getLineWidth(e);return e===h.SystemLinesEnum.DotsBoldBoldDots&&(s/=2),i&&e===h.SystemLinesEnum.BoldThinDots&&(s+=this.rules.DistanceBetweenLastInstructionAndRepetitionBarline),s}previousMeasureEndsLineRepetition(){if(0===this.measureListIndex)return!1;for(let t=0,e=this.measureList[this.measureListIndex-1].length;t<e;++t)if(this.measureList[this.measureListIndex-1][t].endsWithLineRepetition())return!0;return!1}thisMeasureBeginsLineRepetition(){for(let t=0,e=this.measureList[this.measureListIndex].length;t<e;++t)if(this.measureList[this.measureListIndex][t].beginsWithLineRepetition())return!0;return!1}nextMeasureBeginsLineRepetition(){const t=this.measureListIndex+1;if(t>=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length||!this.measureList[t])return!1;for(let e=0,i=this.measureList[t].length;e<i;++e)if(this.measureList[t][e].beginsWithLineRepetition())return!0;return!1}thisMeasureEndsLineRepetition(){var t;for(let e=0,i=this.measureList[this.measureListIndex].length;e<i;++e){const i=this.measureList[this.measureListIndex][e];if(i.endsWithLineRepetition())return!0;if(null===(t=i.parentSourceMeasure)||void 0===t?void 0:t.isReducedToMultiRest){const t=this.graphicalMusicSheet.ParentMusicSheet;let e=i.parentSourceMeasure;const s=t.SourceMeasures.indexOf(e);let n=e.multipleRestMeasureNumber;for(let i=s+1;i<t.SourceMeasures.length;i++){const s=t.SourceMeasures[i];if(!(s.multipleRestMeasureNumber>=n))break;e=s,n=s.multipleRestMeasureNumber}return e.endsWithLineRepetition()}}return!1}nextMeasureBeginsWordRepetition(){const t=this.measureListIndex+1;if(t>=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length||t>this.measureList.length-1)return!1;for(let e=0,i=this.measureList[t].length;e<i;++e)if(this.measureList[t][e].beginsWithWordRepetition())return!0;return!1}thisMeasureEndsWordRepetition(){for(let t=0,e=this.measureList[this.measureListIndex].length;t<e;++t)if(this.measureList[this.measureListIndex][t].endsWithWordRepetition())return!0;return!1}nextMeasureHasKeyInstructionChange(){return void 0!==this.getNextMeasureKeyInstruction()}getNextMeasureKeyInstruction(){var t;if(this.measureListIndex<this.measureList.length-1)for(let e=0;e<this.measureList[this.measureListIndex].length;e++){const i=null===(t=this.measureList[this.measureListIndex+1][e])||void 0===t?void 0:t.parentSourceMeasure;if(!i)return;return i.getKeyInstruction(this.visibleStaffIndices[e])}}calculateXScalingFactor(t,e){return Math.abs(e-0)<1e-5||Math.abs(t-0)<1e-5?1:(this.currentSystemParams.currentSystem.StaffLines[0].PositionAndShape.Size.width-t)/e}stretchMusicSystem(t){let e=this.calculateXScalingFactor(this.currentSystemParams.currentSystemFixWidth,this.currentSystemParams.currentSystemVarWidth);t&&(e=Math.min(e,this.rules.LastSystemMaxScalingFactor));const i=this.currentSystemParams.currentSystem;for(let t=0,s=i.StaffLines.length;t<s;++t){const s=i.StaffLines[t];let n=0;for(let t=0;t<s.Measures.length;t++){const r=s.Measures[t];r.setPositionInStaffline(n);const o=r.beginInstructionsWidth;if(r.setWidth(o+r.minimumStaffEntriesWidth*e+r.endInstructionsWidth),t<this.currentSystemParams.systemMeasures.length){const e=this.currentSystemParams.systemMeasures[t].beginLine,s=r.getLineWidth(h.SystemLinesEnum.BoldThinDots);if(e===h.SystemLinesEnum.BoldThinDots){let o=n;0===t&&(o=n+r.beginInstructionsWidth-s),i.createVerticalLineForMeasure(o,s,e,f.SystemLinePosition.MeasureBegin,t,r)}}if(r.staffEntriesScaleFactor=e,r.layoutSymbols(),!(t+1<this.currentSystemParams.systemMeasures.length&&this.currentSystemParams.systemMeasures[t+1].beginLine===h.SystemLinesEnum.BoldThinDots)){let e=h.SystemLinesEnum.SingleThin;t<this.currentSystemParams.systemMeasures.length&&(e=this.currentSystemParams.systemMeasures[t].endLine);const s=r.getLineWidth(e);let n=r.PositionAndShape.RelativePosition.x+r.PositionAndShape.BorderRight-s;e===h.SystemLinesEnum.DotsBoldBoldDots&&(n-=s/2),i.createVerticalLineForMeasure(n,s,e,f.SystemLinePosition.MeasureEnd,t,r)}n=r.PositionAndShape.RelativePosition.x+r.PositionAndShape.BorderRight}}t&&this.decreaseMusicSystemBorders()}decreaseMusicSystemBorders(){const t=this.currentSystemParams.currentSystem,e=d.CollectionUtil.last(t.StaffLines[0].Measures).PositionAndShape,i=e.RelativePosition.x+e.Size.width;for(let e=0,s=t.StaffLines.length;e<s;++e){const s=t.StaffLines[e];s.PositionAndShape.BorderRight=i;for(let t=0,e=s.StaffLines.length;t<e;++t){const e=s.StaffLines[t];e.End=new a.PointF2D(i,e.End.y)}}t.PositionAndShape.BorderRight=i+this.currentSystemParams.maxLabelLength+this.rules.SystemLabelsRightMargin}updateStaffLinesRelativePosition(t,e,i){for(let s=e;s<t.StaffLines.length;s++)t.StaffLines[s].PositionAndShape.RelativePosition.y=i;t.PositionAndShape.BorderBottom+=i}createMusicPage(){const t=new s.GraphicalMusicPage(this.graphicalMusicSheet);return this.graphicalMusicSheet.MusicPages.push(t),t.PageNumber=this.graphicalMusicSheet.MusicPages.length,t.PositionAndShape.BorderLeft=0,t.PositionAndShape.BorderRight=this.graphicalMusicSheet.ParentMusicSheet.pageWidth,t.PositionAndShape.BorderTop=0,t.PositionAndShape.BorderBottom=this.rules.PageHeight,t.PositionAndShape.RelativePosition=new a.PointF2D(0,0),t}addSystemToPage(t,e){t.MusicSystems.push(e),e.Parent=t}optimizeDistanceBetweenStaffLines(t){if(!t.checkStaffEntriesForStaffEntryLink())for(let e=0;e<t.StaffLines.length-1;e++){const i=t.StaffLines[e].BottomLine,s=t.StaffLines[e+1].SkyLine;let n=0;for(let t=0;t<i.length;t++){const e=i[t],r=Math.max(0,t-6),o=Math.min(s.length-1,t+6);let a=0;for(let t=r;t<=o;t++)a=Math.min(a,s[t]);const l=e-a;n=Math.max(l,n)}n+=this.rules.MinSkyBottomDistBetweenStaves,n=Math.max(n,this.rules.StaffHeight+this.rules.MinimumStaffLineDistance);const r=n+t.StaffLines[e].PositionAndShape.RelativePosition.y;this.updateStaffLinesRelativePosition(t,e+1,r)}const e=t.StaffLines[0];t.PositionAndShape.BorderTop=e.PositionAndShape.RelativePosition.y+e.PositionAndShape.BorderTop;const i=t.StaffLines[t.StaffLines.length-1];t.PositionAndShape.BorderBottom=i.PositionAndShape.RelativePosition.y+i.PositionAndShape.BorderBottom}calculateMusicSystemsRelativePositions(){let t=this.createMusicPage(),e=0,i=this.musicSystems[0],s=0;for(let n=0;n<this.musicSystems.length;n++)if(i=this.musicSystems[n],0===t.MusicSystems.length){this.addSystemToPage(t,i),e=this.rules.CompactMode?this.rules.PageTopMarginNarrow:this.rules.PageTopMargin,1===this.graphicalMusicSheet.MusicPages.length&&this.rules.RenderTitle&&(e+=this.rules.TitleTopDistance+this.rules.SheetTitleHeight+this.rules.TitleBottomDistance);const n=new a.PointF2D(this.rules.PageLeftMargin+this.rules.SystemLeftMargin,e);i.PositionAndShape.RelativePosition=n,e+i.PositionAndShape.BorderBottom>this.rules.PageHeight-this.rules.PageBottomMargin&&(s++,s<=4&&console.log(`warning: could not fit a single system on page ${t.PageNumber} and measure number ${i.GraphicalMeasures[0][0].MeasureNumber}.\n The PageFormat may be too small for this sheet."\n Will not give further warnings for all pages, only total.`))}else{const s=this.musicSystems[n-1],r=s.StaffLines[s.StaffLines.length-1],o=r.PositionAndShape;let l=this.findRequiredDistanceWithSkyBottomLine(s,i);l+=this.rules.MinSkyBottomDistBetweenSystems,l=Math.max(l,this.rules.MinimumDistanceBetweenSystems+r.StaffHeight);const h=e+o.RelativePosition.y+l,c=h+i.PositionAndShape.BorderMarginBottom;if(this.rules.NewPageAtXMLNewPageAttribute&&s.breaksPage||!(c<this.rules.PageHeight-this.rules.PageBottomMargin)){t=this.createMusicPage(),n-=1;continue}{this.addSystemToPage(t,i),e=h;const s=new a.PointF2D(this.rules.PageLeftMargin+this.rules.SystemLeftMargin,e);i.PositionAndShape.RelativePosition=s}}s>0&&console.log(`total amount of pages that couldn't fit a single music system: ${s} of ${t.PageNumber}`)}findRequiredDistanceWithSkyBottomLine(t,e){const i=t.StaffLines[t.StaffLines.length-1],s=e.StaffLines[0],n=i.BottomLine,r=s.SkyLine,o=i.PositionAndShape,a=s.PositionAndShape,l=1/this.rules.SamplingUnit;let h=0;for(let t=0;t<n.length;t++){const e=n[t],i=t+Math.round((o.RelativePosition.x-a.RelativePosition.x)*l);if(i<0)continue;if(i>=r.length)break;const s=Math.max(0,i-6),c=Math.min(r.length-1,i+6);let u=0;for(let t=s;t<=c;t++)u=Math.min(u,r[t]);const d=e-u;h=Math.max(d,h)}return 0===h&&(h=o.BorderBottom-a.BorderTop),h}};class m{constructor(){this.systemMeasures=[],this.systemMeasureIndex=0,this.currentWidth=0,this.currentSystemFixWidth=0,this.currentSystemVarWidth=0,this.maxLabelLength=0}IsSystemStartMeasure(){return 0===this.systemMeasureIndex}}e.SystemBuildParameters=m,e.MeasureBuildParameters=class{}},4574:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OctaveShiftParams=void 0,e.OctaveShiftParams=class{constructor(t,e,i){this.getOpenOctaveShift=t,this.getAbsoluteStartTimestamp=e,this.getAbsoluteEndTimestamp=i}}},9059:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PlainSkyBottomLineBatchCalculatorBackend=void 0;const s=i(1378),n=i(9531);class r extends n.SkyBottomLineBatchCalculatorBackend{constructor(t,e){super(t,e)}getPreferredRenderingConfiguration(t,e){return{elementWidth:Math.ceil(t),numColumns:6,numRows:6}}onInitialize(t){}calculateFromCanvas(t,e,i,n,r){const o=t.width,a=e.getImageData(0,0,t.width,t.height),{elementWidth:l,elementHeight:h,numColumns:c}=r,u=[];for(let t=0;t<i.length;++t){const e=i[t],r=Math.floor(e.getVFStave().getWidth()),d=Math.max(Math.ceil(e.PositionAndShape.Size.width*n),1),f=t%c*l,m=f+r,p=Math.floor(t/c)*h,b=p+h,g=new Array(Math.max(d,r)).fill(0),S=new Array(Math.max(d,r)).fill(0);for(let t=f;t<m;++t){g[t-f]=0;for(let e=p;e<b;++e){const i=e*o*4+4*t;if(a.data[i+3]>0){g[t-f]=e-p;break}}S[t-f]=h;for(let e=b-1;e>=p;e--){const i=e*o*4+4*t;if(a.data[i+3]>0){S[t-f]=e-p;break}}}const y=Math.max(...g),E=Math.min(...S);for(let t=0;t<r;++t)g[t]=0===g[t]?y:g[t],S[t]=S[t]===h?E:S[t];u.push(new s.SkyBottomLineCalculationResult(g,S))}return u}}e.PlainSkyBottomLineBatchCalculatorBackend=r},9067:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionEndSymbol=void 0;const s=i(4785),n=i(8155),r=i(9086),o=i(8911),a=i(6729),l=i(2337);class h extends s.GraphicalObject{constructor(t,e){super();const i=e,s=t.PositionAndShape.AbsolutePosition.y,h=l.CollectionUtil.last(t.StaffLines).PositionAndShape.RelativePosition.y+4;this.verticalLine=new a.GraphicalLine(new r.PointF2D(i,s),new r.PointF2D(i,s+h),.4,n.OutlineAndFillStyleEnum.SelectionSymbol);for(let e=0,n=t.StaffLines.length;e<n;++e){const n=t.StaffLines[e],o=new r.PointF2D(i,s+n.PositionAndShape.RelativePosition.y),a=new Array(3);o.y-=.2,a[0].x=o.x-3,a[0].y=o.y+1.2,a[1].x=o.x-2,a[1].y=o.y+.4,a[2].x=o.x-2,a[2].y=o.y+2,this.arrows.push(a);const l=new Array(8),h=.8;o.x-=.1,o.y+=.3;const c=.2;l[0].x=o.x-2,l[0].y=o.y+1.5-c,l[1].x=o.x-1,l[1].y=o.y+1.5-c,l[2].x=o.x-1,l[2].y=o.y+2.5,l[3].x=o.x-2,l[3].y=o.y+2.5,l[4].x=l[0].x,l[4].y=l[0].y-h,l[5].x=l[4].x+h+1,l[5].y=l[4].y,l[6].x=l[5].x,l[6].y=l[3].y+h,l[7].x=l[3].x,l[7].y=l[6].y,this.arrowlines.push(l)}this.boundingBox=new o.BoundingBox(this),this.boundingBox.AbsolutePosition=new r.PointF2D(i,s),this.boundingBox.BorderLeft=-.4,this.boundingBox.BorderRight=4,this.boundingBox.BorderBottom=h}}e.SelectionEndSymbol=h},3501:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionStartSymbol=void 0;const s=i(9086),n=i(8155),r=i(6729),o=i(4785),a=i(8911),l=i(2337);class h extends o.GraphicalObject{constructor(t,e){super();const i=e,o=t.PositionAndShape.AbsolutePosition.y,h=l.CollectionUtil.last(t.StaffLines).PositionAndShape.RelativePosition.y+4;this.verticalLine=new r.GraphicalLine(new s.PointF2D(i,o),new s.PointF2D(i,o+h),.4,n.OutlineAndFillStyleEnum.SelectionSymbol);for(let e=0,n=t.StaffLines.length;e<n;++e){const n=t.StaffLines[e],r=new s.PointF2D(i,o+n.PositionAndShape.RelativePosition.y),a=new Array(7);a[0].x=r.x+4,a[0].y=r.y+2,a[1].x=r.x+2.5,a[1].y=r.y+.5,a[2].x=r.x+2.5,a[2].y=r.y+1.3,a[3].x=r.x+1,a[3].y=r.y+1.3,a[4].x=r.x+1,a[4].y=r.y+2.7,a[5].x=r.x+2.5,a[5].y=r.y+2.7,a[6].x=r.x+2.5,a[6].y=r.y+3.5,this.arrows.push(a)}this.boundingBox=new a.BoundingBox(this),this.boundingBox.AbsolutePosition=new s.PointF2D(i,o),this.boundingBox.BorderLeft=-.4,this.boundingBox.BorderRight=4,this.boundingBox.BorderBottom=h}}e.SelectionStartSymbol=h},1659:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SkyBottomLineBatchCalculator=void 0;const n=i(2861),r=i(9059),o=i(7636),a=s(i(2043)),l=i(2337);e.SkyBottomLineBatchCalculator=class{constructor(t,e){const i=new Map;for(const e of t){const t=e.ParentMusicSystem.rules;(()=>{if(i.has(t))return i.get(t);{const e=[];return i.set(t,e),e}})().push({skyBottomLineCalculator:e.SkyBottomLineCalculator,measures:e.Measures})}this.batches=new Map;for(const[t,s]of i.entries()){const i=l.CollectionUtil.flat(s.map((t=>t.measures))),h=(()=>{if(e===n.SkyBottomLineBatchCalculatorBackendType.Plain)return new r.PlainSkyBottomLineBatchCalculatorBackend(t,i).initialize();try{return new o.WebGLSkyBottomLineBatchCalculatorBackend(t,i).initialize()}catch(e){return a.default.info("Couldn't create WebGLBackend for Skyline. Using fallback."),new r.PlainSkyBottomLineBatchCalculatorBackend(t,i).initialize()}})();h.initialize(),this.batches.set(t,{backend:h,entries:s})}}calculateLines(){for(const[,{backend:t,entries:e}]of this.batches){const i=t.calculateLines();let s=0;for(const{skyBottomLineCalculator:t,measures:n}of e){const e=s+n.length;t.updateLines(i.slice(s,e)),s=e}}}}},9531:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SkyBottomLineBatchCalculatorBackend=void 0;const n=i(4028),r=s(i(2043));e.SkyBottomLineBatchCalculatorBackend=class{constructor(t,e){this.elementHeight=300,this.canvas=new n.CanvasVexFlowBackend(t),this.measures=e,this.maxWidth=Math.max(...this.measures.map((t=>{let e=t.getVFStave().getWidth();return e>0||t.IsExtraGraphicalMeasure||(r.default.warn("SkyBottomLineBatchCalculatorBackend: width not > 0 in measure "+t.MeasureNumber),e=50),e}))),this.samplingUnit=t.SamplingUnit}initialize(){if(this.tableConfiguration=Object.assign(Object.assign({},this.getPreferredRenderingConfiguration(this.maxWidth,this.elementHeight)),{elementHeight:this.elementHeight}),this.tableConfiguration.numRows<1||this.tableConfiguration.numColumns<1)throw r.default.warn("SkyBottomLineBatchCalculatorBackend: numRows or numColumns in tableConfiguration is 0"),new Error("numRows or numColumns in tableConfiguration is 0");this.tableConfiguration.elementWidth<this.maxWidth&&r.default.warn("SkyBottomLineBatchCalculatorBackend: elementWidth in tableConfiguration is less than the width of widest measure");const t=this.tableConfiguration.elementWidth*this.tableConfiguration.numColumns,e=this.elementHeight*this.tableConfiguration.numRows;return this.canvas.initializeHeadless(t,e),this.onInitialize(this.tableConfiguration),this}calculateLines(){const{numColumns:t,numRows:e,elementWidth:i}=this.tableConfiguration,s=this.elementHeight,n=t*e,o=this.canvas.getContext(),a=o,l=this.canvas.getCanvas(),h=[];for(let e=0;e<this.measures.length;e+=n){o.clear();const c=this.measures.slice(e,e+n);for(let e=0;e<c.length;++e){const n=c[e],l=n.getVFStave(),h=e%t,u=Math.floor(e/t);let d=l.getWidth();d>0||n.IsExtraGraphicalMeasure||(d=50),d=Math.floor(d),n.PositionAndShape.calculateAbsolutePositionsRecursive(0,0);const f=0;l.setX(f);const m=l.y+100;l.setY(m);const p=l.getWidth();l.setWidth(d),n.format(),l.setWidth(p);try{a.translate(h*i,u*s),n.draw(o),a.translate(-h*i,-u*s)}catch(t){r.default.warn("SkyBottomLineBatchCalculatorBackend.calculateLines.draw",t)}}const u=this.calculateFromCanvas(l,o,c,this.samplingUnit,this.tableConfiguration);h.push(...u)}return h}}},1378:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SkyBottomLineCalculationResult=void 0,e.SkyBottomLineCalculationResult=class{constructor(t,e){this.skyLine=t,this.bottomLine=e}}},6040:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SkyBottomLineCalculator=void 0;i(9086);const n=i(5820),r=s(i(2043)),o=i(1378),a=i(4028);e.SkyBottomLineCalculator=class{constructor(t){this.mStaffLineParent=t,this.mRules=t.ParentMusicSystem.rules}updateLines(t){const e=this.StaffLineParent.Measures;if(t.length!==e.length)if(r.default.warn("SkyBottomLineCalculator: lengths of calculation result array and measure array do not match"),t.length<e.length)for(;t.length<e.length;)t.push(new o.SkyBottomLineCalculationResult([],[]));else t=t.slice(0,e.length);const i=Math.max(Math.ceil(this.StaffLineParent.PositionAndShape.Size.width*this.SamplingUnit),1);this.mSkyLine=[],this.mBottomLine=[];for(const{skyLine:e,bottomLine:i}of t)this.mSkyLine.push(...e),this.mBottomLine.push(...i);const s=this.mSkyLine.length/i,a=[],l=[];for(let t=0;t<this.mSkyLine.length&&a.length!==i;t+=s){const e=Math.min(this.mSkyLine.length,t+s);let i=this.mSkyLine.slice(t,e+1);a.push(Math.min(...i)),i=this.mBottomLine.slice(t,e+1),l.push(Math.max(...i))}this.mSkyLine=a,this.mBottomLine=l,this.mSkyLine.length!==i&&r.default.debug(`SkyLine calculation was not correct (${this.mSkyLine.length} instead of ${i})`);const h=Math.max(...this.mSkyLine);this.mSkyLine=this.mSkyLine.map((t=>(t-h)/n.unitInPixels+this.StaffLineParent.TopLineOffset));const c=Math.min(...this.mBottomLine);this.mBottomLine=this.mBottomLine.map((t=>(t-c)/n.unitInPixels+this.StaffLineParent.BottomLineOffset))}calculateLines(){const t=this.mRules.SamplingUnit,e=[],i=new a.CanvasVexFlowBackend(this.mRules);for(const s of this.StaffLineParent.Measures){s.PositionAndShape.calculateAbsolutePositionsRecursive(0,0);const n=s.getVFStave();let a=n.getWidth();a>0||s.IsExtraGraphicalMeasure||(r.default.warn("SkyBottomLineCalculator: width not > 0 in measure "+s.MeasureNumber),a=50),i.initializeHeadless(a);const l=i.getContext(),h=i.getCanvas();a=h.width;const c=h.height;n.setY(n.y+100);const u=n.getWidth();n.setWidth(a),s.format(),n.setWidth(u);try{s.draw(l)}catch(t){r.default.warn("SkyBottomLineCalculator.calculateLines.draw",t)}const d=l.getImageData(0,0,a,c),f=4,m=Math.max(Math.ceil(s.PositionAndShape.Size.width*t),1),p=new Array(m),b=new Array(m);for(let t=0;t<a;t++){for(let e=0;e<c;e++){const i=e*a*f+t*f;if(d.data[i+3]>0){p[t]=e;break}}for(let e=c;e>0;e--){const i=e*a*f+t*f;if(d.data[i+3]>0){b[t]=e;break}}}for(let t=0;t<p.length;t++)void 0===p[t]&&(p[t]=Math.max(this.findPreviousValidNumber(t,p),this.findNextValidNumber(t,p)));for(let t=0;t<b.length;t++)void 0===b[t]&&(b[t]=Math.max(this.findPreviousValidNumber(t,b),this.findNextValidNumber(t,b)));e.push(new o.SkyBottomLineCalculationResult(p,b)),i.clear()}this.updateLines(e)}updateSkyLineWithLine(t,e,i){const s=Math.floor(t.x*this.SamplingUnit),n=Math.ceil(e.x*this.SamplingUnit);for(let t=s+1;t<Math.min(n,this.SkyLine.length);t++)this.SkyLine[t]=i}updateSkyLineWithWedge(t,e){let i=Math.floor(t.x*this.SamplingUnit),s=Math.ceil(e.x*this.SamplingUnit),n=(e.y-t.y)/(e.x-t.x);s-i<=1&&(s++,n=0),i<0&&(i=0),i>=this.BottomLine.length&&(i=this.BottomLine.length-1),s<0&&(s=0),s>=this.BottomLine.length&&(s=this.BottomLine.length),this.SkyLine[i]=t.y;for(let t=i+1;t<Math.min(s,this.SkyLine.length);t++)this.SkyLine[t]=this.SkyLine[t-1]+n/this.SamplingUnit}updateBottomLineWithWedge(t,e){let i=Math.floor(t.x*this.SamplingUnit),s=Math.ceil(e.x*this.SamplingUnit),n=(e.y-t.y)/(e.x-t.x);s-i<=1&&(s++,n=0),i<0&&(i=0),i>=this.BottomLine.length&&(i=this.BottomLine.length-1),s<0&&(s=0),s>=this.BottomLine.length&&(s=this.BottomLine.length),this.BottomLine[i]=t.y;for(let t=i+1;t<s;t++)this.BottomLine[t]=this.BottomLine[t-1]+n/this.SamplingUnit}updateSkyLineInRange(t,e,i){this.updateInRange(this.mSkyLine,t,e,i)}updateBottomLineInRange(t,e,i){this.updateInRange(this.BottomLine,t,e,i)}resetSkyLineInRange(t,e){this.updateInRange(this.SkyLine,t,e)}resetBottomLineInRange(t,e){this.setInRange(this.BottomLine,t,e)}setSkyLineWithValue(t){this.SkyLine.forEach((e=>t))}setBottomLineWithValue(t){this.BottomLine.forEach((e=>t))}getLeftIndexForPointX(t,e){const i=Math.floor(t*this.SamplingUnit);return i<0?0:i>=e?e-1:i}getRightIndexForPointX(t,e){const i=Math.ceil(t*this.SamplingUnit);return i<0?0:i>=e?e-1:i}updateStaffLineBorders(){this.mStaffLineParent.PositionAndShape.BorderTop=this.getSkyLineMin(),this.mStaffLineParent.PositionAndShape.BorderMarginTop=this.getSkyLineMin(),this.mStaffLineParent.PositionAndShape.BorderBottom=this.getBottomLineMax(),this.mStaffLineParent.PositionAndShape.BorderMarginBottom=this.getBottomLineMax()}getSkyLineMin(){return Math.min(...this.SkyLine.filter((t=>!isNaN(t))))}getSkyLineMinAtPoint(t){const e=Math.round(t*this.SamplingUnit);return this.mSkyLine[e]}getSkyLineMinInRange(t,e){return this.getMinInRange(this.SkyLine,t,e)}getBottomLineMax(){return Math.max(...this.BottomLine.filter((t=>!isNaN(t))))}getBottomLineMaxAtPoint(t){const e=Math.round(t*this.SamplingUnit);return this.mBottomLine[e]}getBottomLineMaxInRange(t,e){return this.getMaxInRange(this.BottomLine,t,e)}getBottomLineMaxInBoundingBox(t){const e=Math.floor(t.AbsolutePosition.x+t.BorderLeft),i=Math.ceil(t.AbsolutePosition.x+t.BorderRight);return this.getMaxInRange(this.mBottomLine,e,i)}updateWithBoundingBoxRecursively(t){if(t.ChildElements&&t.ChildElements.length>0)this.updateWithBoundingBoxRecursively(t);else{const e=t.BorderTop+t.AbsolutePosition.y,i=t.BorderBottom+t.AbsolutePosition.y;if(e<0){const i=Math.floor(t.AbsolutePosition.x+t.BorderLeft),s=Math.ceil(t.AbsolutePosition.x+t.BorderRight);this.updateInRange(this.mSkyLine,i,s,e)}else if(i>this.StaffLineParent.StaffHeight){const e=Math.floor(t.AbsolutePosition.x+t.BorderLeft),s=Math.ceil(t.AbsolutePosition.x+t.BorderRight);this.updateInRange(this.mBottomLine,e,s,i)}}}findPreviousValidNumber(t,e){for(let i=t;i>=0;i--)if(!isNaN(e[i]))return e[i];return 0}findNextValidNumber(t,e){if(t>=e.length)return e[t-1];for(let i=t;i<e.length;i++)if(!isNaN(e[i]))return e[i];return 0}drawPixel(t,e,i="#FF0000FF"){const s=e.getContext(),n=s.fillStyle;s.fillStyle=i,s.fillRect(t.x,t.y,2,2),s.fillStyle=n}updateInRange(t,e=0,i=t.length,s=0){if(e=Math.floor(e*this.SamplingUnit),(i=Math.ceil(i*this.SamplingUnit))<e)throw new Error("start index of line is greater than the end index");e<0&&(e=0),i>t.length&&(i=t.length);for(let n=e;n<i;n++)t[n]=Math.abs(s)>Math.abs(t[n])?s:t[n]}setInRange(t,e=0,i=t.length,s=0){if(e=Math.floor(e*this.SamplingUnit),(i=Math.ceil(i*this.SamplingUnit))<e)throw new Error("start index of line is greater then the end index");e<0&&(e=0),i>t.length&&(i=t.length);for(let n=e;n<i;n++)t[n]=s}getMinInRange(t,e,i){return e=Math.floor(e*this.SamplingUnit),i=Math.ceil(i*this.SamplingUnit),t?(e<0&&(e=0),e>=t.length&&(e=t.length-1),i<0&&(i=0),i>=t.length&&(i=t.length),e>=0&&i<=t.length?Math.min(...t.slice(e,i+1)):void 0):Number.MAX_VALUE}getMaxInRange(t,e,i){return e=Math.floor(e*this.SamplingUnit),i=Math.ceil(i*this.SamplingUnit),t?(e<0&&(e=0),e>=t.length&&(e=t.length-1),i<0&&(i=0),i>=t.length&&(i=t.length),e>=0&&i<=t.length?Math.max(...t.slice(e,i+1)):void 0):Number.MIN_VALUE}get SamplingUnit(){return this.mRules.SamplingUnit}get StaffLineParent(){return this.mStaffLineParent}get SkyLine(){return this.mSkyLine}get BottomLine(){return this.mBottomLine}}},9953:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StaffLine=void 0;const s=i(8911),n=i(4785),r=i(4196),o=i(9086),a=i(6040);class l extends n.GraphicalObject{constructor(t,e){super(),this.measures=[],this.staffLines=new Array(5),this.octaveShifts=[],this.lyricLines=[],this.lyricsDashes=[],this.abstractExpressions=[],this.graphicalSlurs=[],this.graphicalGlissandi=[],this.Pedals=[],this.parentMusicSystem=t,this.parentStaff=e,this.boundingBox=new s.BoundingBox(this,t.PositionAndShape),this.skyBottomLine=new a.SkyBottomLineCalculator(this),this.staffHeight=this.parentMusicSystem.rules.StaffHeight,this.topLineOffset=0,this.bottomLineOffset=4,this.calculateStaffLineOffsets()}calculateStaffLineOffsets(){if(this.ParentStaff.isTab)5===this.ParentStaff.StafflineCount?this.staffHeight=this.bottomLineOffset=6*this.ParentStaff.ParentInstrument.GetMusicSheet.Rules.TabStaffInterlineHeight:this.staffHeight=this.bottomLineOffset=this.ParentStaff.ParentInstrument.GetMusicSheet.Rules.TabStaffInterlineHeight*this.ParentStaff.StafflineCount;else switch(this.ParentStaff.StafflineCount){case 4:this.bottomLineOffset=1;break;case 3:this.topLineOffset=1,this.bottomLineOffset=1;break;case 2:this.topLineOffset=2,this.bottomLineOffset=1;break;case 1:this.topLineOffset=2,this.bottomLineOffset=2}}get Measures(){return this.measures}set Measures(t){this.measures=t}get StaffLines(){return this.staffLines}set StaffLines(t){this.staffLines=t}get NextStaffLine(){const t=this.parentMusicSystem.StaffLines.indexOf(this);return t!==this.parentMusicSystem.StaffLines.length?this.parentMusicSystem.StaffLines[t+1]:void 0}get LyricLines(){return this.lyricLines}get AbstractExpressions(){return this.abstractExpressions}set AbstractExpressions(t){this.abstractExpressions=t}set LyricLines(t){this.lyricLines=t}get LyricsDashes(){return this.lyricsDashes}set LyricsDashes(t){this.lyricsDashes=t}get ParentMusicSystem(){return this.parentMusicSystem}set ParentMusicSystem(t){this.parentMusicSystem=t}get ParentStaff(){return this.parentStaff}set ParentStaff(t){this.parentStaff=t}get SkyBottomLineCalculator(){return this.skyBottomLine}get SkyLine(){return this.skyBottomLine.SkyLine}get BottomLine(){return this.skyBottomLine.BottomLine}get OctaveShifts(){return this.octaveShifts}set OctaveShifts(t){this.octaveShifts=t}get StaffHeight(){return this.staffHeight}get TopLineOffset(){return this.topLineOffset}get BottomLineOffset(){return this.bottomLineOffset}get GraphicalSlurs(){return this.graphicalSlurs}get GraphicalGlissandi(){return this.graphicalGlissandi}addSlurToStaffline(t){this.graphicalSlurs.push(t)}addGlissandoToStaffline(t){this.graphicalGlissandi.push(t),t.StaffLine=this}addActivitySymbolClickArea(){const t=new r.StaffLineActivitySymbol(this),e=this.PositionAndShape;t.PositionAndShape.RelativePosition=new o.PointF2D(e.RelativePosition.x+e.BorderRight+.5,e.RelativePosition.y+.5),t.PositionAndShape.Parent=this.parentMusicSystem.PositionAndShape}isPartOfMultiStaffInstrument(){return this.parentStaff.ParentInstrument.Staves.length>1}findClosestStaffEntry(t){let e;for(let i=0,s=this.Measures.length;i<s;++i){const s=this.Measures[i];for(let i=0,n=s.staffEntries.length;i<n;++i){const n=s.staffEntries[i];Math.abs(n.PositionAndShape.RelativePosition.x-t+s.PositionAndShape.RelativePosition.x)<5&&(e=n)}}return e}}e.StaffLine=l},4196:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StaffLineActivitySymbol=void 0;const s=i(4785),n=i(8911);class r extends s.GraphicalObject{constructor(t){super(),this.parentStaffLine=t;const e=t.PositionAndShape;this.boundingBox=new n.BoundingBox(this,e),this.boundingBox.BorderRight=6,this.boundingBox.BorderBottom=4.5,this.boundingBox.BorderLeft=-1.5,this.boundingBox.BorderTop=-1.5}}e.StaffLineActivitySymbol=r},7771:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SystemLine=void 0;const s=i(6894),n=i(8911),r=i(4785);class o extends r.GraphicalObject{constructor(t,e,i,s,r){super(),this.lineType=t,this.linePosition=e,this.parentMusicSystem=i,this.topMeasure=s,this.bottomMeasure=r,this.parentTopStaffLine=null==s?void 0:s.ParentStaffLine,this.boundingBox=new n.BoundingBox(this,i.PositionAndShape)}static getObjectWidthForLineType(t,e){switch(e){case s.SystemLinesEnum.SingleThin:return t.SystemThinLineWidth;case s.SystemLinesEnum.DoubleThin:return 2*t.SystemThinLineWidth+t.DistanceBetweenVerticalSystemLines;case s.SystemLinesEnum.ThinBold:return t.SystemThinLineWidth+t.SystemBoldLineWidth+t.DistanceBetweenVerticalSystemLines;case s.SystemLinesEnum.BoldThinDots:case s.SystemLinesEnum.DotsThinBold:return t.SystemThinLineWidth+t.SystemBoldLineWidth+t.DistanceBetweenVerticalSystemLines+t.SystemDotWidth+t.DistanceBetweenDotAndLine;case s.SystemLinesEnum.DotsBoldBoldDots:return 2*t.SystemBoldLineWidth+2*t.SystemDotWidth+2*t.DistanceBetweenDotAndLine+t.DistanceBetweenVerticalSystemLines;default:return 0}}}e.SystemLine=o},1225:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.SystemLinePosition=void 0,(i=e.SystemLinePosition||(e.SystemLinePosition={}))[i.MeasureBegin=0]="MeasureBegin",i[i.MeasureEnd=1]="MeasureEnd"},6894:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.SystemLinesEnumHelper=e.SystemLinesEnum=void 0,function(t){t[t.SingleThin=0]="SingleThin",t[t.DoubleThin=1]="DoubleThin",t[t.ThinBold=2]="ThinBold",t[t.BoldThinDots=3]="BoldThinDots",t[t.DotsThinBold=4]="DotsThinBold",t[t.DotsBoldBoldDots=5]="DotsBoldBoldDots",t[t.None=6]="None",t[t.Dotted=7]="Dotted",t[t.Dashed=8]="Dashed",t[t.Bold=9]="Bold",t[t.BoldThin=10]="BoldThin",t[t.DoubleBold=11]="DoubleBold",t[t.Tick=12]="Tick",t[t.Short=13]="Short"}(i=e.SystemLinesEnum||(e.SystemLinesEnum={})),e.SystemLinesEnumHelper=class{static xmlBarlineStyleToSystemLinesEnum(t){return"regular"===t?i.SingleThin:"dotted"===t?i.Dotted:"dashed"===t?i.Dashed:"heavy"===t?i.Bold:"light-light"===t?i.DoubleThin:"light-heavy"===t?i.ThinBold:"heavy-light"===t?i.BoldThin:"heavy-heavy"===t?i.DoubleBold:"tick"===t?i.Tick:"short"===t?i.Short:"none"===t?i.None:i.SingleThin}}},525:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VerticalGraphicalStaffEntryContainer=void 0,e.VerticalGraphicalStaffEntryContainer=class{constructor(t,e){this.staffEntries=[],this.absoluteTimestamp=e,this.staffEntries=new Array(t)}get Index(){return this.index}set Index(t){this.index=t}get AbsoluteTimestamp(){return this.absoluteTimestamp}get StaffEntries(){return this.staffEntries}set StaffEntries(t){this.staffEntries=t}static compareByTimestamp(t,e){const i=t.absoluteTimestamp.RealValue,s=e.absoluteTimestamp.RealValue;return i<s?-1:i>s?1:0}getFirstNonNullStaffEntry(){for(let t=0,e=this.staffEntries.length;t<e;++t){const e=this.staffEntries[t];if(e)return e}}}},449:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AlignmentManager=void 0;const s=i(9344),n=i(9086);e.AlignmentManager=class{constructor(t){this.parentStaffline=t,this.rules=this.parentStaffline.ParentMusicSystem.rules}alignDynamicExpressions(){var t,e;const i=[];let n=new Array;for(let s=0;s<this.parentStaffline.AbstractExpressions.length-1;s++){const r=this.parentStaffline.AbstractExpressions[s],o=this.parentStaffline.AbstractExpressions[s+1];if((null===(t=null==r?void 0:r.SourceExpression)||void 0===t?void 0:t.Placement)===(null===(e=null==o?void 0:o.SourceExpression)||void 0===e?void 0:e.Placement)){const t=this.getDistance(r.PositionAndShape,o.PositionAndShape);Math.abs(t.x)<this.rules.DynamicExpressionMaxDistance?(-1===n.indexOf(r)&&n.push(r),n.push(o)):(i.push(n),n=new Array)}}i.push(n);for(const t of i)if(t.length>0){const e=t.map((t=>t.PositionAndShape.Center.y)),i=Math.max(...e);for(let n=0;n<t.length;n++){const r=t[n],o=e[n]-i;if(r instanceof s.VexFlowContinuousDynamicExpression?(r.shiftYPosition(-o),r.calcPsi()):(r.PositionAndShape.RelativePosition.y-=.8*o,r.PositionAndShape.calculateBoundingBox()),r.squeeze){const e=n<t.length-1?t[n+1]:void 0,i=n>0?t[n-1]:void 0;if(e){const t=this.getOverlap(r.PositionAndShape,e.PositionAndShape);r.squeeze(-(t.x+this.rules.DynamicExpressionSpacer))}if(i){const t=this.getOverlap(i.PositionAndShape,r.PositionAndShape);r.squeeze(t.x+this.rules.DynamicExpressionSpacer)}}}}}getDistance(t,e){const i=t.RelativePosition.x+t.BorderMarginRight,s=e.RelativePosition.x+e.BorderMarginLeft,r=t.RelativePosition.y+t.BorderMarginBottom,o=e.RelativePosition.y+e.BorderMarginTop;return new n.PointF2D(s-i,o-r)}getOverlap(t,e){return new n.PointF2D(t.RelativePosition.x+t.BorderMarginRight-(e.RelativePosition.x+e.BorderMarginLeft),t.RelativePosition.y+t.BorderMarginBottom-(e.RelativePosition.y+e.BorderMarginTop))}}},4028:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasVexFlowBackend=void 0;var n=s(i(6368)).default.Flow;const r=i(709),o=i(8129),a=i(41),l=i(599);class h extends r.VexFlowBackend{constructor(t){super(),this.rules=t}getVexflowBackendType(){return n.Renderer.Backends.CANVAS}getOSMDBackendType(){return a.BackendType.Canvas}getCanvasSize(){var t;return null===(t=document.getElementById("osmdCanvasPage"+this.graphicalMusicPage.PageNumber))||void 0===t?void 0:t.offsetHeight}initialize(t,e){this.zoom=e,this.canvas=document.createElement("canvas"),this.graphicalMusicPage||(this.graphicalMusicPage=new l.GraphicalMusicPage(void 0),this.graphicalMusicPage.PageNumber=1),this.canvas.id="osmdCanvasVexFlowBackendCanvas"+this.graphicalMusicPage.PageNumber,this.inner=document.createElement("div"),this.inner.id="osmdCanvasPage"+this.graphicalMusicPage.PageNumber,this.inner.style.position="relative",this.canvas.style.zIndex="0",this.inner.appendChild(this.canvas),t.appendChild(this.inner),this.renderer=new n.Renderer(this.canvas,this.getVexflowBackendType()),this.ctx=this.renderer.getContext()}initializeHeadless(t=300,e=300){this.graphicalMusicPage||(this.graphicalMusicPage=new l.GraphicalMusicPage(void 0),this.graphicalMusicPage.PageNumber=1),this.canvas=document.createElement("canvas"),this.canvas.width=t,this.canvas.height=e,this.renderer=new n.Renderer(this.canvas,this.getVexflowBackendType()),this.ctx=this.renderer.getContext()}getContext(){return this.ctx}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.rules.PageBackgroundColor&&(this.ctx.save(),this.ctx.setFillStyle(this.rules.PageBackgroundColor),this.zoom=1,this.ctx.fillRect(0,0,this.canvas.width/this.zoom,this.canvas.height/this.zoom),this.ctx.restore())}scale(t){this.ctx.scale(t,t)}translate(t,e){this.CanvasRenderingCtx.translate(t,e)}renderText(t,e,i,s,n,r,a,l){const h=this.CanvasRenderingCtx.font;this.CanvasRenderingCtx.save(),this.CanvasRenderingCtx.font=o.VexFlowConverter.font(t,e,i,this.rules,l),this.CanvasRenderingCtx.fillStyle=a,this.CanvasRenderingCtx.strokeStyle=a,this.CanvasRenderingCtx.fillText(s,r.x,r.y+n),this.CanvasRenderingCtx.restore(),this.CanvasRenderingCtx.font=h}renderRectangle(t,e,i,s=1){const n=this.CanvasRenderingCtx.fillStyle;this.CanvasRenderingCtx.fillStyle=i||o.VexFlowConverter.style(e),this.CanvasRenderingCtx.globalAlpha=s,this.ctx.fillRect(t.x,t.y,t.width,t.height),this.CanvasRenderingCtx.fillStyle=n,this.CanvasRenderingCtx.globalAlpha=1}renderLine(t,e,i="#FF0000FF",s=2){const n=this.CanvasRenderingCtx.strokeStyle;this.CanvasRenderingCtx.strokeStyle=i,this.CanvasRenderingCtx.beginPath(),this.CanvasRenderingCtx.moveTo(t.x,t.y),this.CanvasRenderingCtx.lineTo(e.x,e.y),this.CanvasRenderingCtx.stroke(),this.CanvasRenderingCtx.strokeStyle=n}renderCurve(t){this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.bezierCurveTo(t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y),this.ctx.lineTo(t[7].x,t[7].y),this.ctx.bezierCurveTo(t[6].x,t[6].y,t[5].x,t[5].y,t[4].x,t[4].y),this.ctx.lineTo(t[0].x,t[0].y),this.ctx.closePath(),this.ctx.fill()}get CanvasRenderingCtx(){return this.ctx.vexFlowCanvasContext}}e.CanvasVexFlowBackend=h},9505:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SvgVexFlowBackend=void 0;var n=s(i(6368)).default.Flow;const r=i(709),o=i(8129),a=i(2562),l=i(41),h=s(i(2043));class c extends r.VexFlowBackend{constructor(t){super(),this.rules=t}getVexflowBackendType(){return n.Renderer.Backends.SVG}getOSMDBackendType(){return l.BackendType.SVG}getCanvasSize(){var t;return null===(t=document.getElementById("osmdCanvasPage"+this.graphicalMusicPage.PageNumber))||void 0===t?void 0:t.offsetHeight}initialize(t,e){this.zoom=e,this.canvas=document.createElement("div"),this.canvas.id="osmdCanvasPage"+this.graphicalMusicPage.PageNumber,this.inner=this.canvas,this.inner.style.position="relative",this.canvas.style.zIndex="0",t.appendChild(this.inner),this.renderer=new n.Renderer(this.canvas,this.getVexflowBackendType()),this.ctx=this.renderer.getContext(),this.ctx.svg.id="osmdSvgPage"+this.graphicalMusicPage.PageNumber}getContext(){return this.ctx}getSvgElement(){return this.ctx.svg}removeNode(t){var e;const i=null===(e=this.ctx)||void 0===e?void 0:e.svg;if(!i)return!1;try{i.removeChild(t)}catch(t){return h.default.error(t),!1}return!0}clear(){if(!this.ctx)return;const t=this.ctx.svg;for(;t.lastChild;)t.removeChild(t.lastChild);this.rules.PageBackgroundColor&&(this.ctx.svg.style["background-color"]=this.rules.PageBackgroundColor)}scale(t){this.ctx.scale(t,t)}translate(t,e){}renderText(t,e,i,s,n,r,l,h){this.ctx.save();const c=this.ctx.openGroup("text");l&&(this.ctx.attributes.fill=l,this.ctx.attributes.stroke=l);let u=h;h&&"default"!==h||(u=this.rules.DefaultFontFamily),this.ctx.setFont(u,t,o.VexFlowConverter.fontStyle(e)),this.ctx.attributes["font-size"]=`${t}px`,this.ctx.state["font-size"]=`${t}px`;let d="normal",f="normal";switch(e){case a.FontStyles.Bold:d="bold";break;case a.FontStyles.Italic:f="italic";break;case a.FontStyles.BoldItalic:d="bold",f="italic";break;default:d="normal"}return this.ctx.attributes["font-weight"]=d,this.ctx.state["font-weight"]=d,this.ctx.attributes["font-style"]=f,this.ctx.state["font-style"]=f,this.ctx.fillText(s,r.x,r.y+n),this.ctx.closeGroup(),this.ctx.restore(),c}renderRectangle(t,e,i,s=1){this.ctx.save();const n=this.ctx.openGroup("rect");return this.ctx.attributes.fill=i||o.VexFlowConverter.style(e),this.ctx.attributes["fill-opacity"]=s,this.ctx.fillRect(t.x,t.y,t.width,t.height),this.ctx.restore(),this.ctx.attributes["fill-opacity"]=1,this.ctx.closeGroup(),n}renderLine(t,e,i="#FF0000FF",s=2){this.ctx.save();const n=this.ctx.openGroup("line");return this.ctx.beginPath(),this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(e.x,e.y),this.ctx.attributes.stroke=i,this.ctx.lineWidth=s,this.ctx.stroke(),this.ctx.closeGroup(),this.ctx.restore(),n}renderCurve(t){const e=this.ctx.openGroup("curve");return this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.bezierCurveTo(t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y),this.ctx.lineTo(t[7].x,t[7].y),this.ctx.bezierCurveTo(t[6].x,t[6].y,t[5].x,t[5].y,t[4].x,t[4].y),this.ctx.lineTo(t[0].x,t[0].y),this.ctx.closePath(),this.ctx.fill(),this.ctx.closeGroup(),e}export(){const t=this.ctx.svg.cloneNode(!0),e=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),i=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",e);i.replaceChild(t,i.documentElement);const s=(new XMLSerializer).serializeToString(i),n=document.createElement("a");n.href="data:image/svg+xml; charset=utf8, "+encodeURIComponent(s.replace(/></g,">\n\r<")),n.download="opensheetmusicdisplay_download.svg",n.innerHTML=window.location.href+"/download",document.body.appendChild(n)}}e.SvgVexFlowBackend=c},709:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowBackend=e.VexFlowBackends=void 0;var n=s(i(6368)).default.Flow;e.VexFlowBackends=class{},e.VexFlowBackend=class{getInnerElement(){return this.inner}getCanvas(){return this.canvas}getRenderElement(){let t=this.canvas;return this.getVexflowBackendType()===n.Renderer.Backends.CANVAS&&(t=this.inner),t}getRenderer(){return this.renderer}removeAllChildrenFromContainer(t){for(;0!==t.children.length;)t.removeChild(t.children.item(0))}removeFromContainer(t){const e=this.getRenderElement();for(let i=0;i<t.children.length;i++)if(t.children.item(i)===e){t.removeChild(e);break}}resize(t,e){this.renderer.resize(t,e),this.width=t,this.height=e}}},9344:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowContinuousDynamicExpression=void 0;const s=i(374),n=i(9946),r=i(2255),o=i(1274),a=i(2562);class l extends s.GraphicalContinuousDynamicExpression{constructor(t,e,i,s){if(super(t,e,i),this.IsVerbal){const e=new r.Label(t.Label);this.label=new n.GraphicalLabel(e,s||this.rules.ContinuousDynamicTextHeight,o.TextAlignmentEnum.LeftCenter,this.rules,this.PositionAndShape),this.label.Label.fontStyle=a.FontStyles.Italic,this.label.setLabelPositionAndShapeBorders(),this.PositionAndShape.calculateBoundingBox()}}}e.VexFlowContinuousDynamicExpression=l},8129:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowConverter=void 0;var n=s(i(6368)).default.Flow;const r=i(289),o=i(8640),a=i(1797),l=i(3331),h=i(5198),c=i(8640),u=i(8640),d=i(6894),f=i(2562),m=i(96),p=i(8155),b=s(i(2043)),g=i(908),S=i(1225),y=i(5922),E=i(766),v=i(5820),x=i(3029),_=i(3748);class M{static durations(t,e){const i=[],s=t.clone();for(;s.RealValue>0;){const t=s.RealValue;if(t>=2)i.push("1/2"),s.Sub(new a.Fraction(2,1));else if(t>=1)i.push("w"),s.Sub(new a.Fraction(1,1));else if(t<1&&t>=.5){if(e&&t>.5)return["w"];i.push("h"),s.Sub(new a.Fraction(1,2))}else if(t<.5&&t>=.25){if(e&&t>.25)return["h"];i.push("q"),s.Sub(new a.Fraction(1,4))}else if(t<.25&&t>=.125){if(e&&t>.125)return["q"];i.push("8"),s.Sub(new a.Fraction(1,8))}else if(t<.125&&t>=.0625){if(e&&t>.0625)return["8"];i.push("16"),s.Sub(new a.Fraction(1,16))}else if(t<.0625&&t>=.03125){if(e&&t>.03125)return["16"];i.push("32"),s.Sub(new a.Fraction(1,32))}else if(t<.03125&&t>=.015625){if(e&&t>.015625)return["32"];i.push("64"),s.Sub(new a.Fraction(1,64))}else{if(e)return["64"];i.push("128"),s.Sub(new a.Fraction(1,128))}}return i}static pitch(t,e,i,s,n){let a=n;void 0===n&&(a=3),e&&void 0===n&&(a=0,i.ClefType===r.ClefEnum.F&&(a=2),i.ClefType===r.ClefEnum.C&&(a=2));const l=u.NoteEnum[t.FundamentalNote].toLowerCase(),h=o.Pitch.accidentalVexflow(t.Accidental),c=t.Octave-i.OctaveOffset+a;let d="";return s&&(d=this.NoteHeadCode(s)),[l+"n/"+c+d,h,i]}static restToNotePitch(t,e){let i=t.Octave;switch(e){case r.ClefEnum.C:case r.ClefEnum.F:i+=2;case r.ClefEnum.G:}return new o.Pitch(t.FundamentalNote,i,c.AccidentalEnum.NONE)}static NoteHeadCode(t){const e=t.Filled?"2":"1";switch(t.Shape){case E.NoteHeadShape.NORMAL:return"";case E.NoteHeadShape.DIAMOND:return"/D"+e;case E.NoteHeadShape.TRIANGLE:return"/T"+e;case E.NoteHeadShape.X:return"/X"+e;case E.NoteHeadShape.CIRCLEX:return"/X3";case E.NoteHeadShape.RECTANGLE:return"/R"+e;case E.NoteHeadShape.SQUARE:return"/S"+e;case E.NoteHeadShape.SLASH:default:return""}}static GhostNotes(t){const e=[],i=M.durations(t,!1);for(const t of i)e.push(new n.GhostNote({duration:t}));return e}static StaveNote(t){var e,i,s,a,l,h,c,u,d,f;t.sortForVexflow();const m=t.notes,p=t.parentStaffEntry.parentMeasure.parentSourceMeasure.Rules,b=m[0];let S=[];const y=[],x=b.graphicalNoteLength,_=void 0!==b.sourceNote.NoteTuplet;let w,P=M.durations(x,_)[0];void 0!==b.sourceNote.TypeLength&&b.sourceNote.TypeLength!==x&&0!==b.sourceNote.TypeLength.RealValue&&(P=M.durations(b.sourceNote.TypeLength,_)[0],b.numberOfDots=b.sourceNote.DotsXml);let T,L,A=b.numberOfDots,C=!1,I=0,R=!1;for(const t of m){if(A<t.numberOfDots&&(A=t.numberOfDots),t.sourceNote.isRest()){if(R=!0,t.sourceNote.Pitch){S=[t.vfpitch[0]];break}{S=["b/4"];const n=null===(e=t.parentVoiceEntry)||void 0===e?void 0:e.parentVoiceEntry;if(n){const e=null===(i=t.parentVoiceEntry)||void 0===i?void 0:i.parentStaffEntry.parentMeasure.staffEntries;let r,o,d=-1;for(let t=0;t<e.length;t++)if((null===(s=e[t])||void 0===s?void 0:s.graphicalVoiceEntries[0].parentVoiceEntry)===n){d=t;break}if(d>=1&&e.length-1>=d+1&&(r=null===(l=null===(a=e[d-1])||void 0===a?void 0:a.graphicalVoiceEntries[0])||void 0===l?void 0:l.parentVoiceEntry,o=null===(c=null===(h=e[d+1])||void 0===h?void 0:h.graphicalVoiceEntries[0])||void 0===c?void 0:c.parentVoiceEntry,r&&o)){const e=r.Notes[0],i=o.Notes[0];if(null===(u=e.NoteBeam)||void 0===u?void 0:u.Notes.includes(i)){const e=r.Notes.last().Pitch,i=t.Clef();S=[M.pitch(M.restToNotePitch(e.getTransposedPitch(-2),i.ClefType),!1,i)[0]]}}}}if((t.sourceNote.IsWholeMeasureRest||x.RealValue===t.sourceNote.SourceMeasure.ActiveTimeSignature.RealValue)&&(S=["d/5"],P="w",A=0,C=!0,I=p.WholeRestXShiftVexflow*v.unitInPixels),t.sourceNote.ParentStaff.Voices.length>1){const e=t.parentVoiceEntry.parentStaffEntry.graphicalVoiceEntries,i=t.parentVoiceEntry.parentVoiceEntry.ParentVoice.VoiceId;let s,n;for(const r of e)for(const e of r.notes){if(e===t||e.sourceNote.isRest()||!e.sourceNote.PrintObject)continue;const r=e.parentVoiceEntry.parentVoiceEntry.WantedStemDirection,o=1===i||5===i,a=o?1:-1,l=e.sourceNote.Pitch.getHalfTone(),h=1===a&&l>s,c=-1===a&&l<s;(!s||h||c)&&(s=l,n=0,o&&r===g.StemDirectionType.Up?n+=7:o||r!==g.StemDirectionType.Down?n+=o?1:2:n+=7,P.includes("8")||r===g.StemDirectionType.Up&&-1===a&&(n+=1),e.sourceNote.NoteBeam&&(n+=1),P.includes("w")&&(n/=2),n+=.5*Math.ceil(p.RestCollisionYPadding),n*=a,t.lineShift=n)}if(s>0){let e=3;const i=t.Clef();switch(i.ClefType){case r.ClefEnum.F:e=5;break;case r.ClefEnum.C:e=4}T=o.Pitch.fromHalftone(s),S=[M.pitch(T,!0,i,void 0,e)[0]]}}break}const n=t.vfpitch;S.push(n[0]),y.push(n[1]),w||(w=M.Clef(n[2]).type)}for(let t=0,e=A;t<e;++t)P+="d";1===m.length&&(null===(d=m[0].sourceNote.Notehead)||void 0===d?void 0:d.Shape)===E.NoteHeadShape.SLASH&&(P+="s"),R&&(P+="r");const N={align_center:C,auto_stem:!0,clef:w,duration:P,keys:S,slash:t.GraceSlash},B=t.notes[0].sourceNote;B.IsCueNote&&(N.glyph_font_scale=n.DEFAULT_NOTATION_FONT_SCALE*n.GraceNote.SCALE,N.stroke_px=n.GraceNote.LEDGER_LINE_OFFSET),t.parentVoiceEntry.IsGrace||t.notes[0].sourceNote.IsCueNote?L=new n.GraceNote(N):(L=new n.StaveNote(N),L.stagger_same_whole_notes=p.StaggerSameWholeNotes);const F=t.notes[0].lineShift;if(0!==F&&(L.getKeyProps()[0].line+=F),m.length>1)for(let t=0;t<m.length;t++)(null===(f=m[t].sourceNote.Notehead)||void 0===f?void 0:f.Shape)===E.NoteHeadShape.SLASH&&(L.note_heads[t].note_type="s");if(L.getKeyProps().forEach((({line:e},i)=>t.notes[i].staffLine=e)),(p.LedgerLineWidth||p.LedgerLineStrokeStyle)&&(L.ledgerLineStyle||(L.ledgerLineStyle={}),p.LedgerLineWidth&&(L.ledgerLineStyle.lineWidth=p.LedgerLineWidth),p.LedgerLineStrokeStyle&&(L.ledgerLineStyle.strokeStyle=p.LedgerLineStrokeStyle)),p.ColoringEnabled){const e=p.DefaultColorStem;let i=t.parentVoiceEntry.StemColor;!i&&e&&(i=e);const s={fillStyle:i,strokeStyle:i};i&&(L.setStemStyle(s),L.flag&&p.ColorFlags&&L.setFlagStyle(s))}if(L.x_shift=I,t.parentVoiceEntry.IsGrace&&t.notes[0].sourceNote.NoteBeam&&(t.parentVoiceEntry.WantedStemDirection=t.notes[0].sourceNote.NoteBeam.Notes[0].ParentVoiceEntry.WantedStemDirection),t.parentVoiceEntry)switch(t.parentVoiceEntry.WantedStemDirection){case g.StemDirectionType.Up:L.setStemDirection(n.Stem.UP),t.parentVoiceEntry.StemDirection=g.StemDirectionType.Up;break;case g.StemDirectionType.Down:L.setStemDirection(n.Stem.DOWN),t.parentVoiceEntry.StemDirection=g.StemDirectionType.Down}for(let t=0,e=m.length;t<e;t+=1){if(m[t].setIndex(L,t),y[t]){if("###"===y[t]){L.addAccidental(t,new n.Accidental("##")),L.addAccidental(t,new n.Accidental("#"));continue}if("bbs"===y[t]){L.addAccidental(t,new n.Accidental("bb")),L.addAccidental(t,new n.Accidental("b"));continue}L.addAccidental(t,new n.Accidental(y[t]))}const e=m[t].sourceNote.TremoloStrokes;if(e>0){const i=new n.Tremolo(e);i.extra_stroke_scale=p.TremoloStrokeScale,i.y_spacing_scale=p.TremoloYSpacingScale,L.addModifier(t,i)}}if(.25===B.Length.RealValue&&B.Notehead&&!1===B.Notehead.Filled){const t=L.getKeyProps();for(let e=0;e<t.length;e++)t[e].code="v81"}for(let t=0,e=A;t<e;++t)L.addDotToAll();return L}static generateArticulations(t,e,i){if(t&&"GhostNote"!==t.getAttribute("type"))for(const s of e.sourceNote.ParentVoiceEntry.Articulations){let r,o=n.Modifier.Position.ABOVE;t.getStemDirection()===n.Stem.UP&&(o=n.Modifier.Position.BELOW);const a=s.articulationEnum;switch(i.ArticulationPlacementFromXML&&(s.placement===_.PlacementEnum.Above?o=n.Modifier.Position.ABOVE:s.placement===_.PlacementEnum.Below&&(o=n.Modifier.Position.BELOW)),a){case g.ArticulationEnum.accent:{r=new n.Articulation("a>");const t=e.sourceNote.NoteSlurs;for(const s of t)s.StartNote===e.sourceNote&&(s.PlacementXml===_.PlacementEnum.Above?r.setYShift(10*-i.SlurStartArticulationYOffsetOfArticulation):s.PlacementXml===_.PlacementEnum.Below&&r.setYShift(10*i.SlurStartArticulationYOffsetOfArticulation));break}case g.ArticulationEnum.breathmark:r=new n.Articulation("abr"),s.placement===_.PlacementEnum.Above&&(o=n.Modifier.Position.ABOVE),r.breathMarkDistance=i.BreathMarkDistance;break;case g.ArticulationEnum.downbow:r=new n.Articulation("am"),void 0===s.placement&&(o=n.Modifier.Position.ABOVE,s.placement=_.PlacementEnum.Above);break;case g.ArticulationEnum.fermata:r=new n.Articulation("a@a"),o=n.Modifier.Position.ABOVE,s.placement=_.PlacementEnum.Above;break;case g.ArticulationEnum.marcatodown:r=new n.Articulation("a|");break;case g.ArticulationEnum.marcatoup:r=new n.Articulation("a^"),o=n.Modifier.Position.ABOVE;break;case g.ArticulationEnum.invertedfermata:{const t=e.sourceNote.ParentVoiceEntry;if(t!==e.sourceNote.ParentVoiceEntry.ParentSourceStaffEntry.VoiceEntries.last()){t.Articulations=t.Articulations.slice(t.Articulations.indexOf(s)),t.ParentSourceStaffEntry.VoiceEntries.last().Articulations.push(s);continue}r=new n.Articulation("a@u"),o=n.Modifier.Position.BELOW,s.placement=_.PlacementEnum.Below;break}case g.ArticulationEnum.lefthandpizzicato:r=new n.Articulation("a+");break;case g.ArticulationEnum.naturalharmonic:r=new n.Articulation("ah");break;case g.ArticulationEnum.snappizzicato:r=new n.Articulation("ao");break;case g.ArticulationEnum.staccatissimo:r=new n.Articulation("av");break;case g.ArticulationEnum.staccato:r=new n.Articulation("a.");break;case g.ArticulationEnum.tenuto:r=new n.Articulation("a-");break;case g.ArticulationEnum.upbow:r=new n.Articulation("a|"),void 0===s.placement&&(o=n.Modifier.Position.ABOVE,s.placement=_.PlacementEnum.Above);break;case g.ArticulationEnum.strongaccent:r=new n.Articulation("a^")}r&&(r.setPosition(o),t.addModifier(0,r))}}static generateOrnaments(t,e){let i,s=n.Modifier.Position.ABOVE;switch(e.placement===_.PlacementEnum.Below&&(s=n.Modifier.Position.BELOW),e.GetOrnament){case y.OrnamentEnum.DelayedInvertedTurn:i=new n.Ornament("turn_inverted"),i.setDelayed(!0);break;case y.OrnamentEnum.DelayedTurn:i=new n.Ornament("turn"),i.setDelayed(!0);break;case y.OrnamentEnum.InvertedMordent:i=new n.Ornament("mordent"),i.setDelayed(!1);break;case y.OrnamentEnum.InvertedTurn:i=new n.Ornament("turn_inverted"),i.setDelayed(!1);break;case y.OrnamentEnum.Mordent:i=new n.Ornament("mordent_inverted"),i.setDelayed(!1);break;case y.OrnamentEnum.Trill:i=new n.Ornament("tr"),i.setDelayed(!1);break;case y.OrnamentEnum.Turn:i=new n.Ornament("turn"),i.setDelayed(!1);break;default:return void b.default.warn("unhandled OrnamentEnum type: "+e.GetOrnament)}i&&(e.AccidentalBelow!==c.AccidentalEnum.NONE&&i.setLowerAccidental(o.Pitch.accidentalVexflow(e.AccidentalBelow)),e.AccidentalAbove!==c.AccidentalEnum.NONE&&i.setUpperAccidental(o.Pitch.accidentalVexflow(e.AccidentalAbove)),i.setPosition(s),t.addModifier(0,i))}static StrokeTypeFromArpeggioType(t){switch(t){case x.ArpeggioType.ARPEGGIO_DIRECTIONLESS:return n.Stroke.Type.ARPEGGIO_DIRECTIONLESS;case x.ArpeggioType.BRUSH_DOWN:return n.Stroke.Type.BRUSH_UP;case x.ArpeggioType.BRUSH_UP:return n.Stroke.Type.BRUSH_DOWN;case x.ArpeggioType.RASQUEDO_DOWN:return n.Stroke.Type.RASQUEDO_UP;case x.ArpeggioType.RASQUEDO_UP:return n.Stroke.Type.RASQUEDO_DOWN;case x.ArpeggioType.ROLL_DOWN:return n.Stroke.Type.ROLL_UP;case x.ArpeggioType.ROLL_UP:return n.Stroke.Type.ROLL_DOWN;default:return n.Stroke.Type.ARPEGGIO_DIRECTIONLESS}}static CreateTabNote(t){const e=[],i=t.notes.reverse(),s=[],r=t.notes[0].graphicalNoteLength,o=void 0!==t.notes[0].sourceNote.NoteTuplet;let a=M.durations(r,o)[0],l=0,h=!1;for(const i of t.notes){const t=i.sourceNote,r={str:t.StringNumberTab,fret:t.FretNumber};e.push(r),t.BendArray&&t.BendArray.forEach((function(t){let e;const i=t.bendalter-r.fret;e=i>1?"Full":1===i?"1/2":"1/4","up"===t.direction?s.push({type:n.Bend.UP,text:e,width:10}):s.push({type:n.Bend.DOWN,text:e,width:10})})),t.VibratoStroke&&(h=!0),l<i.numberOfDots&&(l=i.numberOfDots)}for(let t=0,e=l;t<e;++t)a+="d";const c=new n.TabNote({duration:a,positions:e});for(let t=0,e=i.length;t<e;t+=1)i[t].setIndex(c,t);return s.forEach((function(t){t.type===n.Bend.UP?c.addModifier(new n.Bend(t.text,!1)):c.addModifier(new n.Bend(t.text,!0))})),h&&c.addModifier(new n.Vibrato),c}static Clef(t,e="default"){let i,s;switch("default"!==e&&"small"!==e&&(b.default.warn(`Invalid VexFlow clef size "${e}" specified. Using "default".`),e="default"),t.ClefType){case r.ClefEnum.G:switch(t.Line){case 1:i="french";break;case 2:i="treble";break;default:i="treble",b.default.error(`Clef ${r.ClefEnum[t.ClefType]} on line ${t.Line} not supported by VexFlow. Using default value "${i}".`)}break;case r.ClefEnum.F:switch(t.Line){case 4:i="bass";break;case 3:i="baritone-f";break;case 5:i="subbass";break;default:i="bass",b.default.error(`Clef ${r.ClefEnum[t.ClefType]} on line ${t.Line} not supported by VexFlow. Using default value "${i}".`)}break;case r.ClefEnum.C:switch(t.Line){case 3:i="alto";break;case 4:i="tenor";break;case 1:i="soprano";break;case 2:i="mezzo-soprano";break;default:i="alto",b.default.error(`Clef ${r.ClefEnum[t.ClefType]} on line ${t.Line} not supported by VexFlow. Using default value "${i}".`)}break;case r.ClefEnum.percussion:i="percussion";break;case r.ClefEnum.TAB:i="treble";break;default:b.default.info("bad clef type: "+t.ClefType),i="treble"}return 1===t.OctaveOffset&&"bass"!==i?s="8va":-1===t.OctaveOffset&&(s="8vb"),{type:i,size:e,annotation:s}}static TimeSignature(t){let e;switch(t.SymbolEnum){case l.RhythmSymbolEnum.NONE:e=t.Rhythm.Numerator+"/"+t.Rhythm.Denominator;break;case l.RhythmSymbolEnum.COMMON:e="C";break;case l.RhythmSymbolEnum.CUT:e="C|"}return new n.TimeSignature(e)}static keySignature(t){if(!t)return;let e;switch(t.Mode){case h.KeyEnum.minor:e=M.minorMap[t.Key]+"m";break;case h.KeyEnum.major:case h.KeyEnum.none:e=M.majorMap[t.Key];break;default:e="C"}return e}static line(t,e){switch(t){case d.SystemLinesEnum.SingleThin:return e===S.SystemLinePosition.MeasureBegin?n.StaveConnector.type.SINGLE:n.StaveConnector.type.SINGLE_RIGHT;case d.SystemLinesEnum.DoubleThin:return n.StaveConnector.type.THIN_DOUBLE;case d.SystemLinesEnum.ThinBold:return n.StaveConnector.type.BOLD_DOUBLE_RIGHT;case d.SystemLinesEnum.BoldThinDots:return n.StaveConnector.type.BOLD_DOUBLE_LEFT;case d.SystemLinesEnum.DotsThinBold:case d.SystemLinesEnum.DotsBoldBoldDots:return n.StaveConnector.type.BOLD_DOUBLE_RIGHT;case d.SystemLinesEnum.None:return n.StaveConnector.type.NONE}}static font(t,e=f.FontStyles.Regular,i=m.Fonts.TimesNewRoman,s,n){let r="normal",o="normal",a=`'${s.DefaultFontFamily}'`;switch(e){case f.FontStyles.Bold:o="bold";break;case f.FontStyles.Italic:r="italic";break;case f.FontStyles.BoldItalic:r="italic",o="bold";case f.FontStyles.Underlined:}return m.Fonts.Kokila,n&&"default"!==n&&(a=`'${n}'`),r+" "+o+" "+Math.floor(t)+"px "+a}static fontStyle(t){switch(t){case f.FontStyles.Bold:return"bold";case f.FontStyles.Italic:return"italic";case f.FontStyles.BoldItalic:return"italic bold";default:return"normal"}}static style(t){return p.OUTLINE_AND_FILL_STYLE_DICT.getValue(t)}}e.VexFlowConverter=M,M.majorMap={"-1":"F","-2":"Bb","-3":"Eb","-4":"Ab","-5":"Db","-6":"Gb","-7":"Cb","-8":"Fb",0:"C",1:"G",2:"D",3:"A",4:"E",5:"B",6:"F#",7:"C#",8:"G#"},M.minorMap={"-1":"D","-2":"G","-3":"C","-4":"F","-5":"Bb","-6":"Eb","-7":"Ab","-8":"Db",0:"A",1:"E",2:"B",3:"F#",4:"C#",5:"G#",6:"D#",7:"A#",8:"E#"}},3602:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowGlissando=void 0;const s=i(1443);class n extends s.GraphicalGlissando{}e.VexFlowGlissando=n},4679:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowGraphicalNote=void 0;const s=i(3486),n=i(8129),r=i(5853);class o extends s.GraphicalNote{constructor(t,e,i,s=r.OctaveEnum.NONE,o,a){if(super(t,e,o,a),this.clef=i,this.octaveShift=s,t.Pitch){const e=t.isRest()?t.Pitch:r.OctaveShift.getPitchFromOctaveShift(t.Pitch,s);this.vfpitch=n.VexFlowConverter.pitch(e,t.isRest(),this.clef,this.sourceNote.Notehead),this.vfpitch[1]=void 0}}setAccidental(t){const e=this.drawPitch(t);this.vfpitch=n.VexFlowConverter.pitch(e,this.sourceNote.isRest(),this.clef,this.sourceNote.Notehead),this.DrawnAccidental=e.Accidental}drawPitch(t){return r.OctaveShift.getPitchFromOctaveShift(t,this.octaveShift)}Transpose(t,e,i,s){const o=super.Transpose(t,e,i,s),a=r.OctaveShift.getPitchFromOctaveShift(o,this.octaveShift);return this.vfpitch=n.VexFlowConverter.pitch(a,this.sourceNote.isRest(),this.clef,this.sourceNote.Notehead),this.vfpitch[1]=void 0,a}setIndex(t,e){this.vfnote=[t,e],this.vfnoteIndex=e}notehead(t){let e=t;e||(e=this.vfnote[0]);const i=e.note_heads;return i&&i.length>this.vfnoteIndex&&i[this.vfnoteIndex]?e.note_heads[this.vfnoteIndex]:{line:0}}Clef(){return this.clef}getSVGId(){if(this.vfnote)return this.vfnote[0].getAttribute("id")}getSVGGElement(){if(this.vfnote)return this.vfnote[0].getAttribute("el")}getStemSVG(){return document.getElementById("vf-"+this.getSVGId()+"-stem")}getBeamSVGs(){const t=[];for(let e=0;;e++){const i=document.getElementById(`vf-${this.getSVGId()}-beam${e}`);if(!i)break;t.push(i)}return t}}e.VexFlowGraphicalNote=o},8144:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowGraphicalSymbolFactory=void 0;var n=s(i(6368)).default.Flow;const r=i(8494),o=i(7330),a=i(9252),l=i(5853),h=i(4679),c=i(4146),u=i(5460),d=i(8129),f=i(8790),m=i(4828),p=i(4405);e.VexFlowGraphicalSymbolFactory=class{createMusicSystem(t,e){return new r.VexFlowMusicSystem(t,e)}createStaffLine(t,e){return new m.VexFlowStaffLine(t,e)}createGraphicalMeasure(t,e,i=!1){return new o.VexFlowMeasure(e,t,void 0)}createMultiRestMeasure(t,e,i){return new p.VexFlowMultiRestMeasure(e,t,i)}createTabStaffMeasure(t,e){return new f.VexFlowTabMeasure(e,t)}createExtraGraphicalMeasure(t){const e=new o.VexFlowMeasure(t.ParentStaff,void 0,t);return e.IsExtraGraphicalMeasure=!0,e.ExtraGraphicalMeasurePreviousMeasure=t.Measures.last(),e}createStaffEntry(t,e){return new a.VexFlowStaffEntry(e,t,void 0)}createVoiceEntry(t,e){return new u.VexFlowVoiceEntry(t,e)}createNote(t,e,i,s=l.OctaveEnum.NONE,n,r){return new h.VexFlowGraphicalNote(t,e,i,s,n,r)}createGraceNote(t,e,i,s,n=l.OctaveEnum.NONE){return new h.VexFlowGraphicalNote(t,e,i,n,s)}addGraphicalAccidental(t,e){t.setAccidental(e)}addFermataAtTiedEndNote(t,e){}createInStaffClef(t,e){const i=t,s=d.VexFlowConverter.Clef(e,"small");i.vfClefBefore=new n.ClefNote(s.type,s.size,s.annotation)}createChordSymbols(t,e,i,s){const n=e.parentMeasure.parentSourceMeasure.Rules;let r=0;const o=n.ChordSymbolXSpacing;for(const a of t.ChordContainers){const t=new c.GraphicalChordSymbolContainer(a,e.PositionAndShape,n.ChordSymbolTextHeight,i,s,e.parentMeasure.parentSourceMeasure.Rules),l=t.GraphicalLabel;l.PositionAndShape.RelativePosition.y-=n.ChordSymbolYOffset,l.PositionAndShape.RelativePosition.x+=r,l.setLabelPositionAndShapeBorders(),t.PositionAndShape.calculateBoundingBox(),e.graphicalChordContainers.push(t),r+=l.PositionAndShape.Size.width+o}}createGraphicalTechnicalInstruction(t,e){}}},6351:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowInstantaneousDynamicExpression=void 0;const s=i(9428),n=i(9793),r=i(9946),o=i(2255),a=i(1274),l=i(2562);class h extends s.GraphicalInstantaneousDynamicExpression{constructor(t,e,i){super(t,e,i);const s=new o.Label(this.Expression);this.label=new r.GraphicalLabel(s,this.rules.ContinuousDynamicTextHeight,a.TextAlignmentEnum.CenterCenter,this.rules,this.PositionAndShape),this.label.Label.fontStyle=l.FontStyles.BoldItalic,this.label.setLabelPositionAndShapeBorders(),this.PositionAndShape.calculateBoundingBox()}get InstantaneousDynamic(){return this.mInstantaneousDynamicExpression}get Expression(){return n.DynamicEnum[this.mInstantaneousDynamicExpression.DynEnum]}}e.VexFlowInstantaneousDynamicExpression=h},8939:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowInstrumentBrace=void 0;var n=s(i(6368)).default.Flow;const r=i(5575);class o extends r.VexFlowInstrumentBracket{constructor(t,e,i=0){super(t,e,i),this.vexflowConnector.setType(n.StaveConnector.type.BRACE)}}e.VexFlowInstrumentBrace=o},5575:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowInstrumentBracket=void 0;var n=s(i(6368)).default.Flow;const r=i(4785),o=i(8911),a=i(5820);class l extends r.GraphicalObject{constructor(t,e,i=0){super(),this.Visible=!0,this.PositionAndShape=new o.BoundingBox(this,t.ParentMusicSystem.PositionAndShape);const s=t.Measures[0],r=e.Measures[0];this.addConnector(s.getVFStave(),r.getVFStave(),n.StaveConnector.type.BRACKET,i)}draw(t){this.Visible&&this.vexflowConnector.setContext(t).draw();const e=this.vexflowConnector,i=e.top_stave.getYForLine(0),s=e.bottom_stave.getYForLine(e.bottom_stave.getNumLines()-1)+e.thickness;this.PositionAndShape.AbsolutePosition.x=(e.top_stave.getX()-2+e.x_shift)/a.unitInPixels,this.PositionAndShape.AbsolutePosition.y=i/a.unitInPixels,this.PositionAndShape.Size.height=(s-i)/a.unitInPixels,this.PositionAndShape.Size.width=12/a.unitInPixels}addConnector(t,e,i,s){this.vexflowConnector=new n.StaveConnector(t,e).setType(i).setXShift(-5*s)}}e.VexFlowInstrumentBracket=l},7330:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.StavePositionEnum=e.VexFlowMeasure=void 0;var n=s(i(6368)).default.Flow;const r=i(1513),o=i(6894),a=i(289),l=i(8129);var h=n.NoteSubGroup;const c=s(i(2043)),u=i(5820),d=i(6189),f=i(1225),m=i(908),p=i(5460),b=i(1797),g=i(1405),S=i(3748),y=i(2478);class E extends r.GraphicalMeasure{constructor(t,e,i){super(t,e,i),this.isTabMeasure=!1,this.octaveOffset=3,this.vfVoices={},this.vfTies=[],this.vfRepetitionWords=[],this.connectors=[],this.beams={},this.autoVfBeams=[],this.autoTupletVfBeams=[],this.vfbeams={},this.tuplets={},this.vftuplets={},this.minimumStaffEntriesWidth=-1,this.rules=i?i.ParentMusicSystem.rules:e?e.Rules:new g.EngravingRules,this.resetLayout()}setAbsoluteCoordinates(t,e){this.stave.setX(t).setY(e)}resetLayout(){this.stave=new n.Stave(0,0,0,{fill_style:this.rules.StaffLineColor,space_above_staff_ln:0,space_below_staff_ln:0}),this.stave.MeasureNumber=this.MeasureNumber,this.ParentStaff&&this.setLineNumber(this.ParentStaff.StafflineCount),this.stave.setBegBarType(n.Barline.type.NONE),this.parentSourceMeasure&&this.parentSourceMeasure.endingBarStyleEnum===o.SystemLinesEnum.None&&this.stave.setEndBarType(n.Barline.type.NONE),this.updateInstructionWidth()}clean(){this.vfTies.length=0,this.connectors=[],this.resetLayout()}getLineWidth(t){switch(t){case o.SystemLinesEnum.BoldThinDots:case o.SystemLinesEnum.DotsThinBold:return 10/u.unitInPixels;case o.SystemLinesEnum.DotsBoldBoldDots:return 10/u.unitInPixels+this.rules.RepeatEndStartPadding;default:return 0}}addClefAtBegin(t){if(this.rules.RenderClefsAtBeginningOfStaffline){if(this.octaveOffset=t.OctaveOffset,t.ClefType===a.ClefEnum.TAB)this.stave.addClef("tab",void 0,void 0,void 0);else{const e=l.VexFlowConverter.Clef(t,"default");this.stave.addClef(e.type,e.size,e.annotation,n.StaveModifier.Position.BEGIN)}this.updateInstructionWidth()}}setLineNumber(t){5!==t&&(0===t?(this.stave.setNumLines(0),this.stave.getBottomLineY=function(){return this.getYForLine(this.options.num_lines)}):1===t?(this.stave.options.line_config=[{visible:!1},{visible:!1},{visible:!0},{visible:!1},{visible:!1}],this.stave.getBottomLineY=function(){return this.getYForLine(2)}):2===t?(this.stave.options.line_config=[{visible:!1},{visible:!1},{visible:!0},{visible:!0},{visible:!1}],this.stave.getBottomLineY=function(){return this.getYForLine(3)}):3===t?(this.stave.options.line_config=[{visible:!1},{visible:!0},{visible:!0},{visible:!0},{visible:!1}],this.stave.getBottomLineY=function(){return this.getYForLine(2)}):(this.stave.setNumLines(t),this.stave.getBottomLineY=function(){return this.getYForLine(this.options.num_lines)}))}addKeyAtBegin(t,e,i){var s;this.rules.RenderKeySignatures&&this.ShowKeySignature&&((null===(s=this.parentSourceMeasure)||void 0===s?void 0:s.isReducedToMultiRest)&&!this.rules.MultipleRestMeasureAddKeySignature||(this.stave.setKeySignature(l.VexFlowConverter.keySignature(t),l.VexFlowConverter.keySignature(e),void 0),this.updateInstructionWidth()))}addRhythmAtBegin(t){const e=l.VexFlowConverter.TimeSignature(t);this.stave.addModifier(e,n.StaveModifier.Position.BEGIN),this.ShowTimeSignature||e.setStyle({fillStyle:"#00000000"}),this.updateInstructionWidth()}addClefAtEnd(t,e=!0){const i=l.VexFlowConverter.Clef(t,"small");if(e||!this.stave.endClef){this.stave.setEndClef(i.type,i.size,i.annotation);for(const t of this.stave.getModifiers())if(e){const e=t.originalStrokeStyle,i=t.originalFillStyle;t.getStyle()&&(e&&i?(t.getStyle().strokeStyle=e,t.getStyle().fillStyle=i):(t.getStyle().strokeStyle=null,t.getStyle().fillStyle=null))}else if("clefs"===t.getCategory()&&t.getPosition()===n.StaveModifier.Position.END&&t.type===i.type){const e="#12345600",i=t.getStyle();i&&(t.originalStrokeStyle=i.strokeStyle,t.originalFillStyle=i.fillStyle),t.setStyle({strokeStyle:e,fillStyle:e})}return this.parentSourceMeasure.hasEndClef=!0,this.updateInstructionWidth()}}addMeasureLine(t,e,i=!0){switch(e){case f.SystemLinePosition.MeasureBegin:t===o.SystemLinesEnum.BoldThinDots&&(i||(this.stave.modifiers[0].draw=function(t){switch(t.checkContext(),this.setRendered(),this.type){case n.Barline.type.SINGLE:this.drawVerticalBar(t,this.x,!1);break;case n.Barline.type.DOUBLE:this.drawVerticalBar(t,this.x,!0);break;case n.Barline.type.END:this.drawVerticalEndBar(t,this.x);break;case n.Barline.type.REPEAT_BEGIN:this.drawRepeatBar(t,this.x,!0);break;case n.Barline.type.REPEAT_END:this.drawRepeatBar(t,this.x,!1);break;case n.Barline.type.REPEAT_BOTH:this.drawRepeatBar(t,this.x,!1),this.drawRepeatBar(t,this.x,!0)}}),this.stave.setBegBarType(n.Barline.type.REPEAT_BEGIN));break;case f.SystemLinePosition.MeasureEnd:switch(t){case o.SystemLinesEnum.DotsBoldBoldDots:this.stave.setEndBarType(n.Barline.type.REPEAT_BOTH);break;case o.SystemLinesEnum.DotsThinBold:this.stave.setEndBarType(n.Barline.type.REPEAT_END);break;case o.SystemLinesEnum.DoubleThin:this.stave.setEndBarType(n.Barline.type.DOUBLE);break;case o.SystemLinesEnum.ThinBold:this.stave.setEndBarType(n.Barline.type.END);break;case o.SystemLinesEnum.None:this.stave.setEndBarType(n.Barline.type.NONE)}}}addMeasureNumber(){const t=this.MeasureNumber.toString(),e=v.ABOVE;this.stave.setText(t,e,{justification:1,shift_x:0,shift_y:0})}addWordRepetition(t){let e,i=n.StaveModifier.Position.END;const s=this.beginInstructionsWidth;switch(t.type){case d.RepetitionInstructionEnum.Segno:e=n.Repetition.type.SEGNO_LEFT,i=n.StaveModifier.Position.LEFT;break;case d.RepetitionInstructionEnum.Coda:e=n.Repetition.type.CODA_LEFT,i=n.StaveModifier.Position.LEFT;break;case d.RepetitionInstructionEnum.DaCapo:e=n.Repetition.type.DC;break;case d.RepetitionInstructionEnum.DalSegno:e=n.Repetition.type.DS;break;case d.RepetitionInstructionEnum.Fine:e=n.Repetition.type.FINE;break;case d.RepetitionInstructionEnum.ToCoda:e=n.Repetition.type.TO_CODA;break;case d.RepetitionInstructionEnum.DaCapoAlFine:e=n.Repetition.type.DC_AL_FINE;break;case d.RepetitionInstructionEnum.DaCapoAlCoda:e=n.Repetition.type.DC_AL_CODA;break;case d.RepetitionInstructionEnum.DalSegnoAlFine:e=n.Repetition.type.DS_AL_FINE;break;case d.RepetitionInstructionEnum.DalSegnoAlCoda:e=n.Repetition.type.DS_AL_CODA}if(e){const t=new n.Repetition(e,s,-this.rules.RepetitionSymbolsYOffset);return t.xShiftAsPercentOfStaveWidth=this.rules.RepetitionEndInstructionXShiftAsPercentOfStaveWidth,void this.stave.addModifier(t,i)}this.addVolta(t)}addVolta(t){var e;let i=n.Volta.type.BEGIN;if(t.type===d.RepetitionInstructionEnum.Ending){switch(t.alignment){case d.AlignmentType.Begin:i=this.parentSourceMeasure.endsRepetitionEnding()?n.Volta.type.BEGIN_END:n.Volta.type.BEGIN;break;case d.AlignmentType.End:if(this.parentSourceMeasure.beginsRepetitionEnding())return;i=n.Volta.type.END}const s=this.ParentStaffLine.SkyBottomLineCalculator,r=this.PositionAndShape.AbsolutePosition.x+this.PositionAndShape.BorderMarginLeft+.4,o=Math.max(this.PositionAndShape.AbsolutePosition.x+this.PositionAndShape.BorderMarginRight,r+.4),a=s.getSkyLineMinInRange(r,o)-2;let l,h=-6.1+this.rules.VoltaOffset,c=this.rules.VoltaOffset;a<h&&(c+=a-h,h=a);const f=this.parentSourceMeasure.MeasureNumber;for(let t=0;t<this.ParentStaffLine.Measures.length;t++){const i=this.ParentStaffLine.Measures[t];i instanceof E&&(i.MeasureNumber!==f-1&&i.MeasureNumber+(null===(e=i.parentSourceMeasure)||void 0===e?void 0:e.multipleRestMeasures)!==f||(l=i))}if(l){const t=l.stave.getModifiers();for(let e=0;e<t.length;e++){const i=t[e];if(i.hasOwnProperty("volta")){const t=l.ParentStaffLine.SkyBottomLineCalculator,e=l.PositionAndShape.AbsolutePosition.x+l.PositionAndShape.BorderMarginLeft+.4,s=Math.max(l.PositionAndShape.AbsolutePosition.x+l.PositionAndShape.BorderMarginRight,e+.4),n=t.getSkyLineMinInRange(e,s);n<=h?(c+=n-h,h=n):(i.y_shift=c*u.unitInPixels,l.ParentStaffLine.SkyBottomLineCalculator.updateSkyLineInRange(e,s,h))}}}c*=10,this.stave.setVoltaType(i,t.endingIndices[0],c),s.updateSkyLineInRange(r,o,h)}}setWidth(t){super.setWidth(t),this.stave.setWidth(t*u.unitInPixels)}layoutSymbols(){}draw(t){this.stave.setContext(t).draw();for(const e in this.vfVoices)this.vfVoices.hasOwnProperty(e)&&(t.save(),this.vfVoices[e].draw(t,this.stave),t.restore());for(const e in this.vfbeams)if(this.vfbeams.hasOwnProperty(e))for(const i of this.vfbeams[e])i.setContext(t).draw();if(this.autoVfBeams)for(const e of this.autoVfBeams)e.setContext(t).draw();if(!this.isTabMeasure||this.rules.TupletNumbersInTabs){if(this.autoTupletVfBeams)for(const e of this.autoTupletVfBeams)e.setContext(t).draw();for(const e in this.vftuplets)if(this.vftuplets.hasOwnProperty(e))for(let i=0;i<this.tuplets[e].length;i++){const s=this.tuplets[e][i][0],n=this.vftuplets[e][i];s.RenderTupletNumber?n.RenderTupletNumber=!0:n.RenderTupletNumber=!1,n.setContext(t).draw()}}for(const e of this.vfTies){if(e instanceof n.TabSlide)return;e.setContext(t),e.draw()}for(const e of this.connectors)e.setContext(t).draw();this.correctNotePositions()}format(){this.formatVoices&&this.formatVoices((this.PositionAndShape.Size.width-this.beginInstructionsWidth-this.endInstructionsWidth)*u.unitInPixels,this)}correctNotePositions(){if(!this.isTabMeasure)for(const t of this.getVoicesWithinMeasure())for(const e of t.VoiceEntries)for(const t of e.Notes){const e=this.rules.GNote(t);if(!(null==e?void 0:e.vfnote))return;const i=e.vfnote[0];let s=0;e.parentVoiceEntry.parentVoiceEntry.StemDirection===m.StemDirectionType.Up&&"w"!==e.vfnote[0].getDuration()?s+=3.5:s+=.5,s+=-e.notehead(i).line+e.parentVoiceEntry.notes.last().notehead().line,e.PositionAndShape.RelativePosition.y=s}}getVoicesWithinMeasure(){const t=[];for(const e of this.staffEntries)for(const i of e.graphicalVoiceEntries)-1===t.indexOf(i.parentVoiceEntry.ParentVoice)&&t.push(i.parentVoiceEntry.ParentVoice);return t}getGraphicalVoiceEntriesPerVoice(t){const e=[];for(const i of this.staffEntries)for(const s of i.graphicalVoiceEntries)s.parentVoiceEntry.ParentVoice===t&&e.push(s);return e}getRestFilledVexFlowStaveNotesPerVoice(t){let e,i=this.getGraphicalVoiceEntriesPerVoice(t);for(let t=0;t<i.length;t++){const s=i[t],n=s.notes[0].sourceNote.getAbsoluteTimestamp();let r=new b.Fraction;for(const t of s.notes){const e=b.Fraction.plus(t.sourceNote.getAbsoluteTimestamp(),t.sourceNote.Length);r.lt(e)&&(r=e)}if(e){const s=b.Fraction.minus(n,e);if(s.RealValue>0){c.default.trace(`Ghost Found in between (measure ${this.MeasureNumber})`);const e=this.createGhostGves(s);i.splice(t,0,...e),t+=e.length}}else{const e=b.Fraction.minus(n,this.parentSourceMeasure.AbsoluteTimestamp);if(e.RealValue>0){c.default.trace(`Ghost Found at start (measure ${this.MeasureNumber})`);const s=this.createGhostGves(e);i.splice(0,0,...s),t+=s.length}}e=r}const s=b.Fraction.plus(this.parentSourceMeasure.AbsoluteTimestamp,this.parentSourceMeasure.Duration),n=b.Fraction.minus(s,e);if(n.RealValue>0){c.default.trace(`Ghost Found at end (measure ${this.MeasureNumber})`);const t=this.createGhostGves(n);i=i.concat(t)}return i}createGhostGves(t){const e=l.VexFlowConverter.GhostNotes(t),i=[];for(const t of e){const e=new p.VexFlowVoiceEntry(void 0,void 0,this.rules);e.vfStaveNote=t,i.push(e)}return i}handleBeam(t,e){const i=t.sourceNote.ParentVoiceEntry.ParentVoice.VoiceId;let s,n=this.beams[i];n||(n=this.beams[i]=[]);for(const t of n)t[0]===e&&(s=t);s||(s=[e,[]],n.push(s));const r=t.parentVoiceEntry;s[1].indexOf(r)<0&&s[1].push(r)}handleTuplet(t,e){const i=t.sourceNote.ParentVoiceEntry.ParentVoice.VoiceId;e=t.sourceNote.NoteTuplet;let s,n=this.tuplets[i];n||(n=this.tuplets[i]=[]);for(const t of n)t[0]===e&&(s=t);s||(s=[e,[]],n.push(s));const r=t.parentVoiceEntry;s[1].indexOf(r)<0&&s[1].push(r)}finalizeBeams(){this.vfbeams={};const t=[];for(const e in this.beams)if(this.beams.hasOwnProperty(e)){let i=this.vfbeams[e];i||(i=this.vfbeams[e]=[]);for(const s of this.beams[e]){let e=!1;for(const t of s[0].Notes)if(t.Length.RealValue>=new b.Fraction(1,4).RealValue&&(!t.TypeLength||t.TypeLength.RealValue>.125)){e=!0;break}if(e){c.default.debug("Beam between note >= quarter, likely tremolo, currently unsupported. continuing.");continue}const r=[],o=s[0],a=s[1];let l=!0;for(const t of a)t.parentVoiceEntry.ParentVoice===o.Notes[0].ParentVoiceEntry.ParentVoice&&(l=t.parentVoiceEntry.WantedStemDirection===m.StemDirectionType.Undefined);let h,u=!1;const d=[];for(const e of a){const i=e.vfStaveNote;i&&(r.push(i),t.push(i)),e.parentVoiceEntry.IsGrace&&(u=!0),e.parentVoiceEntry.StemColor&&this.rules.ColoringEnabled&&d.push(e.parentVoiceEntry.StemColor)}if(r.length>1){const t=new n.Beam(r,l);if(u&&(t.render_options.beam_width=3,t.render_options.partial_beam_length=4),d.length>=2&&this.rules.ColorBeams){h=d[0];for(const t of d)if(t!==h){h=void 0;break}t.setStyle({fillStyle:h,strokeStyle:h})}this.rules.FlatBeams&&(t.render_options.flat_beams=!0,t.render_options.flat_beam_offset=this.rules.FlatBeamOffset,t.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),i.push(t)}else c.default.debug("Warning! Beam with no notes!")}}this.rules.AutoBeamNotes&&this.autoBeamNotes(t)}autoBeamNotes(t){if(!this.rules.AutoBeamTabs&&this.isTabMeasure)return;let e,i=[],s=[],r=[];this.autoTupletVfBeams=[];const o=[];this.autoVfBeams=[];let a=this.parentSourceMeasure.ActiveTimeSignature;a||(a=this.parentSourceMeasure.Duration);for(const l of this.staffEntries)for(const h of l.graphicalVoiceEntries){const c=h.vfStaveNote,u=h.notes[0],d=l.relInMeasureTimestamp.isOnBeat(a),f=s.length>=2,m=u.sourceNote.Length.RealValue-new b.Fraction(1,4).RealValue>-b.Fraction.FloatInaccuracyTolerance,p=h.parentVoiceEntry.IsGrace||m||t.contains(c);if(p||d){if(f){for(const t of s)i.push(t);o.push(i.slice()),i=[]}if(s=[],p)continue}const g=h.notes[0].sourceNote.NoteTuplet;if(g){let t=!1;for(const e of g.Notes){for(const i of e)if(i.NoteTypeXml>=y.NoteType.QUARTER||i.ParentVoiceEntry.IsGrace||i.isRest()&&!this.rules.AutoBeamOptions.beam_rests){t=!0;break}if(t)break}if(e){if(e!==g){if(r.length>1){const t=new n.Beam(r,!0);this.rules.FlatBeams&&(t.render_options.flat_beams=!0,t.render_options.flat_beam_offset=this.rules.FlatBeamOffset,t.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoTupletVfBeams.push(t)}r=[],e=g}}else e=g;t||r.push(c)}else e=void 0,s.push(c)}if(r.length>=2){const t=new n.Beam(r,!0);this.rules.FlatBeams&&(t.render_options.flat_beams=!0,t.render_options.flat_beam_offset=this.rules.FlatBeamOffset,t.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoTupletVfBeams.push(t)}if(s.length>=2){for(const t of s)i.push(t);o.push(i)}const l=this.rules.AutoBeamOptions,h={beam_middle_only:l.beam_middle_rests_only,beam_rests:l.beam_rests,maintain_stem_directions:l.maintain_stem_directions};if(l.groups&&l.groups.length){const t=[];for(const e of l.groups)t.push(new n.Fraction(e[0],e[1]));h.groups=t}for(const t of o){const e=n.Beam.generateBeams(t,h);for(const t of e)this.rules.FlatBeams&&(t.render_options.flat_beams=!0,t.render_options.flat_beam_offset=this.rules.FlatBeamOffset,t.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoVfBeams.push(t)}}finalizeTuplets(){this.vftuplets={};for(const t in this.tuplets)if(this.tuplets.hasOwnProperty(t)){let e=this.vftuplets[t];e||(e=this.vftuplets[t]=[]);for(const i of this.tuplets[t]){const t=[],s=i[1];for(const e of s)t.push(e.vfStaveNote);if(t.length>1){const s=i[0],r=s.Notes[0][0].NormalNotes,o=s.Bracket||3===s.TupletLabelNumber&&this.rules.TripletsBracketed||3!==s.TupletLabelNumber&&this.rules.TupletsBracketed;let a=n.Tuplet.LOCATION_TOP;s.tupletLabelNumberPlacement===S.PlacementEnum.Below&&(a=n.Tuplet.LOCATION_BOTTOM);const l=new n.Tuplet(t,{bracketed:o,location:a,notes_occupied:r,num_notes:s.TupletLabelNumber,ratioed:this.rules.TupletsRatioed});e.push(l)}else c.default.debug("Warning! Tuplet with no notes! Trying to ignore, but this is a serious problem.")}}}layoutStaffEntry(t){}graphicalMeasureCreatedCalculations(){let t,e=[];const i=[];for(const s of this.staffEntries){t=!1,e=[];for(const r of s.graphicalVoiceEntries)if(r.parentVoiceEntry.IsGrace)e.push(r),i.push(r),t||(t=r.parentVoiceEntry.GraceSlur);else if(r.vfStaveNote=l.VexFlowConverter.StaveNote(r),e.length>0){const i=[];for(let t=0;t<e.length;t++){const s=e[t];s.GraceSlash=s.parentVoiceEntry.GraceNoteSlash,t>0&&(s.GraceSlash=!1);const n=l.VexFlowConverter.StaveNote(s);s.vfStaveNote=n,i.push(n)}const s=new n.GraceNoteGroup(i,t);s.spacing=10*this.rules.GraceNoteGroupXMargin,r.vfStaveNote.addModifier(0,s),e=[]}}if(e.length>0)for(const t of e)t.vfStaveNote=l.VexFlowConverter.StaveNote(t),t.parentVoiceEntry.GraceAfterMainNote=!0;this.finalizeBeams(),this.finalizeTuplets();const s=this.getVoicesWithinMeasure();if(this.rules.RenderFingerings)for(const t of this.staffEntries)t.setModifierXOffsets();for(const t of s){if(!t)continue;this.vfVoices[t.VoiceId]=new n.Voice({beat_value:this.parentSourceMeasure.ActiveTimeSignature.Denominator,num_beats:this.parentSourceMeasure.ActiveTimeSignature.Numerator,resolution:n.RESOLUTION}).setMode(n.Voice.Mode.SOFT);const e=this.getRestFilledVexFlowStaveNotesPerVoice(t);for(const i of e){if(i.parentVoiceEntry&&i.parentVoiceEntry.IsGrace&&!i.parentVoiceEntry.GraceAfterMainNote)continue;const e=i;if(0===e.vfStaveNote.getTicks().denominator)continue;if(0===i.notes.length||!i.notes[0]||!i.notes[0].sourceNote.PrintObject){this.vfVoices[t.VoiceId].addTickable(e.vfStaveNote);continue}const s=e.parentStaffEntry;if(s&&s.vfClefBefore){const t=new h([s.vfClefBefore]);e.vfStaveNote.getCategory&&"stavenotes"===e.vfStaveNote.getCategory()&&e.vfStaveNote.addModifier(0,t)}i.parentVoiceEntry&&this.rules.RenderFingerings&&(this.rules.FingeringPosition!==S.PlacementEnum.Left&&this.rules.FingeringPosition!==S.PlacementEnum.Right||this.createFingerings(i),this.createStringNumber(i)),this.createArpeggio(i),this.vfVoices[t.VoiceId].addTickable(e.vfStaveNote)}}this.setStemDirectionFromVexFlow();for(const t of i)this.createFingerings(t),this.createStringNumber(t),this.createArpeggio(t);this.createArticulations(),this.createOrnaments()}createArpeggio(t){if(t.parentVoiceEntry&&t.parentVoiceEntry.Arpeggio){const e=t.parentVoiceEntry.Arpeggio;if(t.notes&&t.notes.length>1){const i=l.VexFlowConverter.StrokeTypeFromArpeggioType(e.type),s=new n.Stroke(i,{all_voices:this.rules.ArpeggiosGoAcrossVoices});this.rules.RenderArpeggios&&t.vfStaveNote.addStroke(0,s)}else c.default.debug(`[OSMD] arpeggio in measure ${this.MeasureNumber} could not be drawn.\n voice entry had less than two notes, arpeggio is likely between voice entries, not currently supported in Vexflow.`)}}setStemDirectionFromVexFlow(){for(const t of this.staffEntries)for(const e of t.graphicalVoiceEntries)for(const t of e.notes){const i=t.vfnote;if(i&&i[0])switch(i[0].getStemDirection()){case n.Stem.UP:e.parentVoiceEntry.StemDirection=m.StemDirectionType.Up;break;case n.Stem.DOWN:e.parentVoiceEntry.StemDirection=m.StemDirectionType.Down}}}createArticulations(){for(let t=0,e=this.staffEntries.length;t<e;++t){const e=this.staffEntries[t].graphicalVoiceEntries;for(const t of e){const e=t.vfStaveNote;l.VexFlowConverter.generateArticulations(e,t.notes[0],this.rules)}}}createOrnaments(){for(let t=0,e=this.staffEntries.length;t<e;++t){const e=this.staffEntries[t].graphicalVoiceEntries;for(const t in e)if(e.hasOwnProperty(t)){const i=e[t].vfStaveNote,s=e[t].notes[0].sourceNote.ParentVoiceEntry.OrnamentContainer;s&&l.VexFlowConverter.generateOrnaments(i,s)}}}createFingerings(t){const e=t;let i=0;for(const e of t.notes)e.sourceNote.Fingering&&i++;let s=-1;for(const r of t.notes){const o=r.sourceNote.Fingering;if(!o){s++;continue}s++;let a=this.rules.FingeringPosition;this.rules.FingeringPositionGrace===S.PlacementEnum.AboveOrBelow&&(this.isUpperStaffOfInstrument()?a=S.PlacementEnum.Above:this.isLowerStaffOfInstrument()&&(a=S.PlacementEnum.Below)),o.placement!==S.PlacementEnum.NotYetDefined&&(a=o.placement);let l,h=this.rules.FingeringOffsetX;switch(a){default:case S.PlacementEnum.Left:l=n.StaveModifier.Position.LEFT,h-=r.baseFingeringXOffset*u.unitInPixels;break;case S.PlacementEnum.Right:l=n.StaveModifier.Position.RIGHT,h+=r.baseFingeringXOffset*u.unitInPixels;break;case S.PlacementEnum.Above:l=n.StaveModifier.Position.ABOVE;break;case S.PlacementEnum.Below:l=n.StaveModifier.Position.BELOW;break;case S.PlacementEnum.NotYetDefined:const e=t.parentStaffEntry.sourceStaffEntry.ParentStaff;t.notes.length>1||t.parentStaffEntry.graphicalVoiceEntries.length>1?l=n.StaveModifier.Position.LEFT:0===e.idInMusicSheet?(l=n.StaveModifier.Position.ABOVE,a=S.PlacementEnum.Above):(l=n.StaveModifier.Position.BELOW,a=S.PlacementEnum.Below)}const c=new n.FretHandFinger(o.value);if(c.setPosition(l),c.setOffsetX(h),a===S.PlacementEnum.Above||a===S.PlacementEnum.Below){const t=a===S.PlacementEnum.Above?-1:1,r=a===S.PlacementEnum.Above?s:i-1-s;if(this.rules.FingeringInsideStafflines&&i>1){const e=c.getWidth()/2,s=2.5*i;c.setOffsetY(t*(r+s)*e)}else if(!this.rules.FingeringInsideStafflines){const i=new n.StringNumber(o.value);i.radius=0,i.setPosition(l),i.setOffsetY(t*r*i.getWidth()*2/3),e.vfStaveNote.addModifier(s,i);continue}}e.vfStaveNote.addModifier(s,c)}}createStringNumber(t){if(!this.rules.RenderStringNumbersClassical)return;const e=t;t.notes.forEach(((i,s)=>{const r=i.sourceNote.StringInstruction;if(r){let o=r.value;switch(o){case"1":o="I";break;case"2":o="II";break;case"3":o="III";break;case"4":o="IV";break;case"5":o="V";break;case"6":o="VI"}const a=new n.StringNumber(o);a.radius=0;const l=-this.rules.StringNumberOffsetY;t.notes.length>1||t.parentStaffEntry.graphicalVoiceEntries.length>1?(a.setOffsetX(13*i.baseStringNumberXOffset),a.setPosition(n.Modifier.Position.RIGHT)):a.setPosition(n.Modifier.Position.ABOVE),a.setOffsetY(l),e.vfStaveNote.addModifier(s,a)}}))}lineTo(t,e){const i=new n.StaveConnector(t.getVFStave(),this.stave);i.setType(e),this.connectors.push(i)}getVFStave(){return this.stave}updateInstructionWidth(){let t=0,e=0;const i=this.stave.getModifiers();for(const s of i)s.getPosition()===v.BEGIN?t+=s.getWidth()+s.getPadding(void 0):s.getPosition()===v.END&&(e+=s.getWidth()+s.getPadding(void 0));this.beginInstructionsWidth=(null!=t?t:0)/u.unitInPixels,this.endInstructionsWidth=(null!=e?e:0)/u.unitInPixels}addStaveTie(t,e){this.vfTies.push(t),e.vfTie=t,e.Tie.TieDirection===S.PlacementEnum.Below&&t.setDirection(1)}}var v;e.VexFlowMeasure=E,function(t){t[t.LEFT=1]="LEFT",t[t.RIGHT=2]="RIGHT",t[t.ABOVE=3]="ABOVE",t[t.BELOW=4]="BELOW",t[t.BEGIN=5]="BEGIN",t[t.END=6]="END"}(v=e.StavePositionEnum||(e.StavePositionEnum={}))},4405:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowMultiRestMeasure=void 0;var n=s(i(6368)).default.Flow;const r=i(7330);class o extends r.VexFlowMeasure{constructor(t,e,i){super(t,e,i),this.minimumStaffEntriesWidth=-1,i?this.rules=i.ParentMusicSystem.rules:e&&(this.rules=e.Rules),this.resetLayout(),this.multiRestElement=new n.MultiMeasureRest(e.multipleRestMeasures,{})}draw(t){this.stave.setContext(t).draw(),this.multiRestElement.setStave(this.stave),this.multiRestElement.setContext(t),this.multiRestElement.draw();for(const e of this.connectors)e.setContext(t).draw()}format(){}getVoicesWithinMeasure(){return[]}getGraphicalVoiceEntriesPerVoice(t){return[]}getRestFilledVexFlowStaveNotesPerVoice(t){return[]}handleBeam(t,e){}handleTuplet(t,e){}finalizeBeams(){}finalizeTuplets(){}layoutStaffEntry(t){}graphicalMeasureCreatedCalculations(){}createArticulations(){}createOrnaments(){}createFingerings(t){}getVFStave(){return this.stave}}e.VexFlowMultiRestMeasure=o},8738:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowMusicSheetCalculator=void 0;const n=i(4040),r=i(8144),o=i(1659),a=i(5309),l=i(2942),h=s(i(6368));var c=h.default.Flow;const u=s(i(2043)),d=i(5820),f=i(5091),m=i(8720),p=i(9520),b=i(6351),g=i(1274),S=i(9876),y=i(9344),E=i(9667),v=i(41),x=i(7781),_=i(2478),M=i(8129),w=i(2343),P=i(6894),T=i(3010),L=i(158),A=i(2337),C=i(3602);class I extends n.MusicSheetCalculator{constructor(t){var e,i,s,o,a,c,u,d;super(),this.beamsNeedUpdate=!1,this.rules=t,n.MusicSheetCalculator.symbolFactory=new r.VexFlowGraphicalSymbolFactory,n.MusicSheetCalculator.TextMeasurer=new l.VexFlowTextMeasurer(this.rules),n.MusicSheetCalculator.stafflineNoteCalculator=new x.VexflowStafflineNoteCalculator(this.rules),"gonville"===(null===(e=this.rules.DefaultVexFlowNoteFont)||void 0===e?void 0:e.toLowerCase())?h.default.Flow.DEFAULT_FONT_STACK=[null===(i=h.default.Flow.Fonts)||void 0===i?void 0:i.Gonville,null===(s=h.default.Flow.Fonts)||void 0===s?void 0:s.Bravura,null===(o=h.default.Flow.Fonts)||void 0===o?void 0:o.Custom]:"petaluma"===(null===(a=this.rules.DefaultVexFlowNoteFont)||void 0===a?void 0:a.toLowerCase())&&(h.default.Flow.DEFAULT_FONT_STACK=[null===(c=h.default.Flow.Fonts)||void 0===c?void 0:c.Petaluma,null===(u=h.default.Flow.Fonts)||void 0===u?void 0:u.Gonville,null===(d=h.default.Flow.Fonts)||void 0===d?void 0:d.Bravura])}clearRecreatedObjects(){super.clearRecreatedObjects(),n.MusicSheetCalculator.stafflineNoteCalculator=new x.VexflowStafflineNoteCalculator(this.rules);for(const t of this.graphicalMusicSheet.MeasureList)for(const e of t)null==e||e.clean()}formatMeasures(){for(const t of this.graphicalMusicSheet.MeasureList)if(t&&t[0]){t.find((t=>null==t?void 0:t.isVisible())).format();for(const e of t){for(const t of e.staffEntries)t.calculateXPosition();e.finalizeBeams()}}this.beamsNeedUpdate=!1}calculateMeasureXLayout(t){const e=[];for(const i of t)i&&e.push(i);if(0===e.length)return 0;t=e;const i=[],s=new c.Formatter({softmaxFactor:this.rules.SoftmaxFactorVexFlow});let r=t[0].staffEntries.length,o=1;for(const e of t){if(!e)continue;let t=0;for(const i of e.staffEntries)t+=i.setMaxAccidentals();e.parentSourceMeasure.ImplicitMeasure&&(r=Math.max(e.staffEntries.length,r),o=Math.max(e.staffEntries.length+t,o));const n=e.vfVoices,a=[];for(const t in n)if(n.hasOwnProperty(t)){const s=n[t];e.hasOnlyRests&&!s.ticksUsed.equals(s.totalTicks)&&(s.ticksUsed=s.totalTicks),a.push(s),i.push(s)}0!==a.length?s.joinVoices(a):u.default.debug("Found a measure with no voices. Continuing anyway.",n)}let a=12;const l=t[0].parentSourceMeasure;if(i.length>0){if(a=s.preCalculateMinTotalWidth(i)/d.unitInPixels*this.rules.VoiceSpacingMultiplierVexflow+this.rules.VoiceSpacingAddendVexflow+.3*r,null==l?void 0:l.ImplicitMeasure){a=l.Duration.RealValue/l.ActiveTimeSignature.RealValue*a;let t=0;const e=l.measureListIndex;if(e>1)for(const i of this.graphicalMusicSheet.MeasureList[e-1]){const e=null==i?void 0:i.parentSourceMeasure.endingBarStyleEnum;if(e===P.SystemLinesEnum.ThinBold||e===P.SystemLinesEnum.DotsThinBold){t=this.rules.PickupMeasureRepetitionSpacing;break}}a+=t,r>1?a+=.3*o*1.5:e>1&&1===r&&(a+=this.rules.PickupMeasureSpacingSingleNoteAddend),a*=this.rules.PickupMeasureWidthMultiplier}n.MusicSheetCalculator.setMeasuresMinStaffEntriesWidth(t,a);const e=(t,e)=>{s.formatToStave(i,e.getVFStave())},h=(t,e)=>{s.formatToStave(i,e.getVFStave(),{align_rests:!0,context:void 0})};for(const i of t){if(this.rules.AlignRests===v.AlignRestOption.Never)i.formatVoices=e;else if(this.rules.AlignRests===v.AlignRestOption.Always)i.formatVoices=h;else if(this.rules.AlignRests===v.AlignRestOption.Auto){let t=!1;for(const e of i.staffEntries){let i=0,s=0;for(const n of e.graphicalVoiceEntries)if(n.parentVoiceEntry.IsGrace||n&&n.notes&&n.notes[0]&&n.notes[0].sourceNote&&n.notes[0].sourceNote.PrintObject&&i++,n&&n.notes&&n.notes[0]&&n.notes[0].sourceNote&&n.notes[0].sourceNote.isRest()&&n.notes[0].sourceNote.PrintObject&&s++,i>1&&s>=1){t=!0;break}if(t)break}i.formatVoices=t?h:e}if(i===t[0]){const t=i;t.formatVoices(a*d.unitInPixels,t)}}}for(const e of t)if(e)for(const t of e.staffEntries)t.calculateXPosition();for(const e of t){if(!e)continue;const t=e.vfVoices,i=[];for(const e in t)t.hasOwnProperty(e)&&i.push(t[e]);0!==i.length?s.joinVoices(i):u.default.debug("Found a measure with no voices. Continuing anyway.",t)}return a}calculateElongationFactor(t,e,i,s,n,r,o,a){let l=n,h=0;for(const c of t){const t=c.GraphicalLabel.Label.textAlignment;let u=o,d=a;if(c instanceof f.GraphicalLyricEntry&&c.ParentLyricWord){c.LyricsEntry.SyllableIndex>0&&(u=this.rules.BetweenSyllableMinimumDistance,g.TextAlignment.IsCenterAligned(t)&&(u+=1));const e=c.ParentLyricWord.GetLyricWord.Syllables;e.length>1&&c.LyricsEntry.SyllableIndex<e.length-1&&(void 0===this.dashSpace&&(this.dashSpace=1.5),d-=this.dashSpace)}const m=c instanceof f.GraphicalLyricEntry?c.GraphicalLabel.PositionAndShape:c.PositionAndShape,p=m.Size.width,b=e.PositionAndShape.RelativePosition.x+m.BorderMarginLeft;let S,y,E,v;void 0!==i[h]&&i[h].extend,i[h]&&(y=b-i[h].xPosition);const x=s*n;g.TextAlignment.IsCenterAligned(t)?(d/=4,E=x-b,v=p/2-d,i[h]&&(S=i[h].labelWidth/2+p/2+u)):g.TextAlignment.IsLeft(t)&&(E=x-b,v=p-d,i[h]&&(S=i[h].labelWidth+u));let _=1;const M=v/E;let w=1;if(c instanceof f.GraphicalLyricEntry&&c.LyricsEntry){if(i[h]){const t=i[h].sourceNoteDuration;w=S/y,t.Denominator>4&&(w*=1.1)}}else i[h]&&(w=S/y);_=Math.max(M,w),l=Math.max(l,_);let P=Math.max(S-y||0,0);i[h]&&(P+=i[h].cumulativeOverlap),i[h]={cumulativeOverlap:P,extend:c instanceof f.GraphicalLyricEntry&&c.LyricsEntry.extend,labelWidth:p,measureNumber:r,sourceNoteDuration:c instanceof f.GraphicalLyricEntry&&c.LyricsEntry&&c.LyricsEntry.Parent.Notes[0].Length,text:c instanceof f.GraphicalLyricEntry?c.LyricsEntry.Text:c.GraphicalLabel.Label.text,xPosition:b},h++}return l}calculateElongationFactorFromStaffEntries(t,e,i,s){let n=i;const r={},o={};for(const i of t)i.LyricsEntries.length>0&&(n=this.calculateElongationFactor(i.LyricsEntries,i,r,e,n,s,this.rules.HorizontalBetweenLyricsDistance,this.rules.LyricOverlapAllowedIntoNextMeasure)),i.graphicalChordContainers.length>0&&(n=this.calculateElongationFactor(i.graphicalChordContainers,i,o,e,n,s,this.rules.ChordSymbolXSpacing,this.rules.ChordOverlapAllowedIntoNextMeasure));return n}calculateMeasureWidthFromStaffEntries(t,e){let i=1;for(const s of t)s&&0!==s.staffEntries.length&&(i=this.calculateElongationFactorFromStaffEntries(s.staffEntries,e,i,s.MeasureNumber));return i=Math.min(i,this.rules.MaximumLyricsElongationFactor),e*i}createGraphicalTie(t,e,i,s,n){return new a.GraphicalTie(t,s,n)}updateStaffLineBorders(t){t.SkyBottomLineCalculator.updateStaffLineBorders()}graphicalMeasureCreatedCalculations(t){t.rules=this.rules,t.graphicalMeasureCreatedCalculations()}layoutVoiceEntry(t,e,i,s){for(let t=0;t<e.length;t++)e[t]=n.MusicSheetCalculator.stafflineNoteCalculator.positionNote(e[t])}layoutStaffEntry(t){t.parentMeasure.layoutStaffEntry(t)}initGraphicalMeasuresCreation(){}layoutArticulationMarks(t,e,i){}layoutGraphicalTie(t,e,i){const s=t.StartNote,n=t.EndNote;let r,o,a=0;s&&s.vfnote&&s.vfnote.length>=2&&(r=s.vfnote[0],a=s.vfnote[1]);let l=0;if(n&&n.vfnote&&n.vfnote.length>=2&&(o=n.vfnote[0],l=n.vfnote[1]),e){if(r){const e=new c.StaveTie({first_indices:[a],first_note:r});s.parentVoiceEntry.parentStaffEntry.parentMeasure.addStaveTie(e,t)}if(o){const e=new c.StaveTie({last_indices:[l],last_note:o});n.parentVoiceEntry.parentStaffEntry.parentMeasure.addStaveTie(e,t)}}else if(r||o){let e;if(i)if("S"===t.Tie.Type){const i=t.StartNote.sourceNote,s=t.EndNote.sourceNote;let n=1;i.FretNumber>s.FretNumber&&(n=-1),e=new c.TabSlide({first_indices:[a],first_note:r,last_indices:[l],last_note:o},n)}else e=new c.TabTie({first_indices:[a],first_note:r,last_indices:[l],last_note:o},t.Tie.Type);else{e=new c.StaveTie({first_indices:[a],first_note:r,last_indices:[l],last_note:o});const i=t.Tie.getTieDirection(s.sourceNote);i===w.PlacementEnum.Below?e.setDirection(1):i===w.PlacementEnum.Above&&e.setDirection(-1)}n.parentVoiceEntry.parentStaffEntry.parentMeasure.addStaveTie(e,t)}}calculateDynamicExpressionsForMultiExpression(t,e,i){if(e<this.rules.MinMeasureToDrawIndex||e>this.rules.MaxMeasureToDrawIndex)return;const s=t.AbsoluteTimestamp,n=this.graphicalMusicSheet.MeasureList[e],r=n[i].ParentStaffLine,o=n[i],a=this.getRelativePositionInStaffLineFromTimestamp(s,i,r,null==r?void 0:r.isPartOfMultiStaffInstrument());if(a.x<=0&&(a.x=o.beginInstructionsWidth+this.rules.RhythmRightMargin),t.InstantaneousDynamic){const e=new b.VexFlowInstantaneousDynamicExpression(t.InstantaneousDynamic,r,o);this.calculateGraphicalInstantaneousDynamicExpression(e,a,s),this.dynamicExpressionMap.set(s.RealValue,e.PositionAndShape)}if(t.StartingContinuousDynamic){const e=t.StartingContinuousDynamic,i=new y.VexFlowContinuousDynamicExpression(t.StartingContinuousDynamic,r,o.parentSourceMeasure);if(i.StartMeasure=o,i.IsSoftAccent=t.StartingContinuousDynamic.IsStartOfSoftAccent,!i.IsVerbal&&e.EndMultiExpression)try{this.calculateGraphicalContinuousDynamic(i,a),i.updateSkyBottomLine()}catch(t){}else i.IsVerbal?this.calculateGraphicalVerbalContinuousDynamic(i,a):u.default.warn("This continuous dynamic is not covered. measure"+t.SourceMeasureParent.MeasureNumber)}}createMetronomeMark(t){var e,i;const s=Math.max(t.ParentMultiTempoExpression.SourceMeasureParent.MeasureNumber-1,0),n=Math.max(t.StaffNumber-1,0),r=0===s&&0===n,o=this.graphicalMusicSheet.MeasureList[s][n].getVFStave();let a="q";if(t.beatUnit){const e=_.NoteTypeHandler.getNoteDurationFromType(t.beatUnit);a=M.VexFlowConverter.durations(e,!1)[0]}let l=this.rules.MetronomeMarkYShift,h=!1;for(const i of t.parentMeasure.TempoExpressions){const t=(null===(e=i.InstantaneousTempo)||void 0===e?void 0:e.Enum)===E.TempoEnum.metronomeMark;if(i.getPlacementOfFirstEntry()===w.PlacementEnum.Above&&!t){h=!0;break}}h&&(l-=1.4);const c=null===(i=this.graphicalMusicSheet.MeasureList[0][0].ParentStaffLine)||void 0===i?void 0:i.SkyLine;o.setTempo({bpm:t.TempoInBpm,dots:t.dotted,duration:a},l*d.unitInPixels);const u=r?this.rules.MetronomeMarkXShift*d.unitInPixels:0;o.getModifiers()[o.getModifiers().length-1].setShiftX(u),c&&(c[0]=Math.min(c[0],-4.5+l))}calculateRehearsalMark(t){var e;const i=t.rehearsalExpression;if(!i)return;const s=this.graphicalMusicSheet.MeasureList[0][0].MeasureNumber,n=Math.max(t.MeasureNumber-s,0),r=null===(e=this.graphicalMusicSheet.MeasureList[n][0])||void 0===e?void 0:e.getVFStave();if(!r)return;const o=-this.rules.RehearsalMarkYOffsetDefault-this.rules.RehearsalMarkYOffset;let a=this.rules.RehearsalMarkXOffsetDefault+this.rules.RehearsalMarkXOffset;t.IsSystemStartMeasure&&(a+=this.rules.RehearsalMarkXOffsetSystemStartMeasure);const l=this.rules.RehearsalMarkFontSize;r.setSection(i.label,o,a,l)}calculateSingleOctaveShift(t,e,i,s){var n;const r=e.OctaveShiftStart,o=r.ParentStartMultiExpression.Timestamp,a=null===(n=r.ParentEndMultiExpression)||void 0===n?void 0:n.Timestamp,l=this.rules.MinMeasureToDrawIndex,h=this.rules.MaxMeasureToDrawIndex;let c,d,f=this.graphicalMusicSheet.MeasureList[i][s].ParentStaffLine;if(f||(f=this.graphicalMusicSheet.MeasureList[l][s].ParentStaffLine),c=r.ParentEndMultiExpression?this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(r.ParentEndMultiExpression.SourceMeasureParent,s):this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(s,!0),c.MeasureNumber>h+1&&(c=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(s,!0)),d=r.ParentEndMultiExpression?this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(r.ParentStartMultiExpression.SourceMeasureParent,s):this.graphicalMusicSheet.MeasureList[l][s],d.MeasureNumber<l+1&&(d=this.graphicalMusicSheet.MeasureList[l][s]),d.MeasureNumber<l+1||d.MeasureNumber>h+1||c.MeasureNumber<l+1||c.MeasureNumber>h+1)return;let m=c.ParentStaffLine;if(m||(m=f),c&&f&&m){const t=new p.VexFlowOctaveShift(r,f.PositionAndShape);if(!t.startNote){let e;for(const t of d.staffEntries)if(t){e=t;break}if(!e)return;if(t.setStartNote(e),!t.startNote)return}if(!t.endNote){let e;for(let t=c.staffEntries.length-1;t>=0;t++)if(c.staffEntries[t]){e=c.staffEntries[t];break}if(t.setEndNote(e),!t.endNote)return}let e=d.findGraphicalStaffEntryFromTimestamp(o);e||(e=d.staffEntries[0]);let i=c.findGraphicalStaffEntryFromTimestamp(a);if(i||(i=c.staffEntries[c.staffEntries.length-1]),t.setStartNote(e),m!==f){t.endsOnDifferentStaffLine=!0;let n=this.findLastStafflineMeasure(f);void 0===n&&(n=c);const o=n.staffEntries[n.staffEntries.length-1];t.setEndNote(o),t.graphicalEndAtMeasureEnd=!0,t.endMeasure=n;const a=m.ParentMusicSystem.Id-f.ParentMusicSystem.Id;if(a>0)for(let t=f.ParentMusicSystem.Id;t<m.ParentMusicSystem.Id;t++){const e=t+1,n=this.musicSystems[e].StaffLines[s],o=n.Measures[0],l=new p.VexFlowOctaveShift(r,o.PositionAndShape);let h=this.findLastStafflineMeasure(n);t<a-1&&(l.endsOnDifferentStaffLine=!0,l.graphicalEndAtMeasureEnd=!0,l.endMeasure=h);const d=o.staffEntries[0];let f=h.staffEntries[h.staffEntries.length-1];c.ParentStaffLine===n&&(h=c,f=i),1===f.graphicalVoiceEntries.length&&1===f.graphicalVoiceEntries[0].notes.length&&f.graphicalVoiceEntries[0].notes[0].sourceNote.isWholeMeasureNote()&&(l.graphicalEndAtMeasureEnd=!0,l.endMeasure=h);const m="VexFlowMusicSheetCalculator.calculateSingleOctaveShift: ";d||u.default.warn(m+"no firstNote found"),f||u.default.warn(m+"no lastNote found"),l.setStartNote(d),l.setEndNote(f),n.OctaveShifts.push(l),this.calculateOctaveShiftSkyBottomLine(d,f,l,n)}this.calculateOctaveShiftSkyBottomLine(e,o,t,f)}else t.setEndNote(i),this.calculateOctaveShiftSkyBottomLine(e,i,t,f);f.OctaveShifts.push(t)}else u.default.warn("End measure or staffLines for octave shift are undefined! This should not happen!")}findLastStafflineMeasure(t){for(let e=t.Measures.length-1;e>=0;e--){const i=t.Measures[e];if(i.staffEntries.length>0)return i}}calculateSinglePedal(t,e,i,s){var n;const r=e.PedalStart,o=r.ParentStartMultiExpression.Timestamp,a=null===(n=r.ParentEndMultiExpression)||void 0===n?void 0:n.Timestamp,l=this.rules.MinMeasureToDrawIndex,h=this.rules.MaxMeasureToDrawIndex;let c,d,f=this.graphicalMusicSheet.MeasureList[i][s].ParentStaffLine;if(f||(f=this.graphicalMusicSheet.MeasureList[l][s].ParentStaffLine),c=r.ParentEndMultiExpression?this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(r.ParentEndMultiExpression.SourceMeasureParent,s):this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(s,!0),c.MeasureNumber>h+1&&(c=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(s,!0)),r.ParentEndMultiExpression?d=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(r.ParentStartMultiExpression.SourceMeasureParent,s):(d=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(r.ParentStartMultiExpression.SourceMeasureParent,s),d||(d=this.graphicalMusicSheet.MeasureList[l][s])),d.MeasureNumber<l+1&&(d=this.graphicalMusicSheet.MeasureList[l][s]),d.parentSourceMeasure.measureListIndex<l||d.parentSourceMeasure.measureListIndex>h||c.parentSourceMeasure.measureListIndex<l||c.parentSourceMeasure.measureListIndex>h)return;let m=c.ParentStaffLine;if(m||(m=f),c&&f&&m){let t=!1;f!==m&&(t=!0);const e=new T.VexFlowPedal(r,f.PositionAndShape,!1,t);e.setEndsStave(c,a);let i=d.findGraphicalStaffEntryFromTimestamp(o);i||(i=d.staffEntries[0]);let n=c.findGraphicalStaffEntryFromTimestamp(a);if(n||(n=c.staffEntries[c.staffEntries.length-1]),!e.setStartNote(i))return;if(e.setBeginsStave(e.startNote.isRest(),o),m!==f)if(e.pedalSymbol===L.MusicSymbol.PEDAL_SYMBOL){e.setEndNote(n),e.setEndMeasure(c),e.ReleaseText=" ",e.CalculateBoundingBox(),this.calculatePedalSkyBottomLine(e.startVfVoiceEntry,e.endVfVoiceEntry,e,f);const t=m.Measures[0],i=new T.VexFlowPedal(r,t.PositionAndShape);e.setEndsStave(c,a);const s=t.staffEntries[0];if(!i.setStartNote(s))return;i.setEndNote(n),e.setEndMeasure(c),m.Pedals.push(i),i.CalculateBoundingBox(),i.DepressText=" ",this.calculatePedalSkyBottomLine(i.startVfVoiceEntry,i.endVfVoiceEntry,i,m)}else{let t=this.findLastStafflineMeasure(f);void 0===t&&(t=c);const i=t.staffEntries[t.staffEntries.length-1];e.setEndNote(i),e.setEndMeasure(c),e.ChangeEnd=!1;const o=m.ParentMusicSystem.Id-f.ParentMusicSystem.Id;if(o>0){let t=1;for(let i=f.ParentMusicSystem.Id;i<m.ParentMusicSystem.Id;i++){const l=this.musicSystems[i+1].StaffLines[s],h=l.Measures[0];let u=!1,d=!1;t<o?u=!0:d=!0,t++;const f=new T.VexFlowPedal(r,h.PositionAndShape,!0,u);e.setEndsStave(c,a),f.ChangeBegin=!1,f.ChangeEnd=!!d&&r.ChangeEnd;let m=this.findLastStafflineMeasure(l);const p=h.staffEntries[0];let b=m.staffEntries[m.staffEntries.length-1];if(c.ParentStaffLine===l?(m=c,f.setEndMeasure(c),b=n):f.setEndMeasure(l.Measures.last()),!f.setStartNote(p))break;f.setEndNote(b),e.setEndMeasure(c),l.Pedals.push(f),f.CalculateBoundingBox(),this.calculatePedalSkyBottomLine(f.startVfVoiceEntry,f.endVfVoiceEntry,f,l)}}e.CalculateBoundingBox(),this.calculatePedalSkyBottomLine(e.startVfVoiceEntry,e.endVfVoiceEntry,e,f)}else e.setEndNote(n),e.setEndMeasure(c),e.CalculateBoundingBox(),this.calculatePedalSkyBottomLine(e.startVfVoiceEntry,e.endVfVoiceEntry,e,f);f.Pedals.push(e)}else u.default.warn("End measure or staffLines for pedal are undefined! This should not happen!")}calculatePedalSkyBottomLine(t,e,i,s){var n,r,o,a;let l=null==e?void 0:e.PositionAndShape;l||(l=i.endMeasure.PositionAndShape);const c=h.default.Flow.PedalMarking.Styles,u=i.getPedalMarking(),d=u.line+3+(s.StaffLines.length-1),f=u.render_options.text_margin_right/10;let m,p=t.PositionAndShape.AbsolutePosition.x-f;u.style!==c.MIXED&&u.style!==c.MIXED_OPEN_END&&u.style!==c.TEXT||(p-=1);let b=s.StaffLines.length-1;for(const t of s.Pedals){const e=t.getPedalMarking().line+3+(s.StaffLines.length-1);b=Math.max(e,b)}if(i.EndSymbolPositionAndShape){const t=u.render_options.glyph_point_size/20;m=p+3.4;const e=l.AbsolutePosition.x-f,n=e+1.5;b=Math.max(s.SkyBottomLineCalculator.getBottomLineMaxInRange(p,m),b),b=Math.max(d+2*t,b);const r=s.SkyBottomLineCalculator.getBottomLineMaxInRange(e,n);i.DepressText||(b=Math.max(b,r)),i.setLine(b-3-(s.StaffLines.length-1)),s.SkyBottomLineCalculator.updateBottomLineInRange(p,m,b+t),s.SkyBottomLineCalculator.updateBottomLineInRange(e,n,b+t)}else{const t=u.render_options.bracket_height/10;if(u.EndsStave)m=e?e.parentStaffEntry.parentMeasure.PositionAndShape.AbsolutePosition.x+e.parentStaffEntry.parentMeasure.PositionAndShape.Size.width-f:l.AbsolutePosition.x+l.Size.width;else switch(u.style){case c.BRACKET_OPEN_END:case c.BRACKET_OPEN_BOTH:case c.MIXED_OPEN_END:m=l.AbsolutePosition.x+l.BorderRight-f;break;default:m=l.AbsolutePosition.x+l.BorderLeft-f}const r=null===(n=null==e?void 0:e.parentStaffEntry)||void 0===n?void 0:n.vfClefBefore;if(r&&(m+=r.getWidth()/10),b=Math.max(s.SkyBottomLineCalculator.getBottomLineMaxInRange(p,m),b),b===1/0)return;if(b=Math.max(b,d+t),i.setLine(b-3-(s.StaffLines.length-1)),p>m){const t=m;m=p,p=t}s.SkyBottomLineCalculator.updateBottomLineInRange(p,m,b+t)}for(const t of s.Pedals){const e=t,i=e.getPedalMarking();if(b>i.line+3+(s.StaffLines.length-1)){const t=i.render_options.text_margin_right/10;let n,l=e.startVfVoiceEntry.PositionAndShape.AbsolutePosition.x-t;e.setLine(b-3-(s.StaffLines.length-1));let h=null===(r=e.endVfVoiceEntry)||void 0===r?void 0:r.PositionAndShape;if(h||(h=e.endMeasure.PositionAndShape),e.EndSymbolPositionAndShape){const e=u.render_options.glyph_point_size/20;n=l+3.4;const i=h.AbsolutePosition.x-t,r=i+1.5;s.SkyBottomLineCalculator.updateBottomLineInRange(l,n,b+e),s.SkyBottomLineCalculator.updateBottomLineInRange(i,r,b+e)}else{const r=i.render_options.bracket_height/10;if(i.EndsStave)n=h.AbsolutePosition.x+h.Size.width-t;else switch(u.style){case c.BRACKET_OPEN_END:case c.BRACKET_OPEN_BOTH:case c.MIXED_OPEN_END:n=h.AbsolutePosition.x+h.BorderRight-t;break;default:n=h.AbsolutePosition.x+h.BorderLeft-t}const d=null===(a=null===(o=e.endVfVoiceEntry)||void 0===o?void 0:o.parentStaffEntry)||void 0===a?void 0:a.vfClefBefore;if(d&&(n+=d.getWidth()/10),l>n){const t=l;l=n,n=t}s.SkyBottomLineCalculator.updateBottomLineInRange(l,n,b+r)}}}}calculateOctaveShiftSkyBottomLine(t,e,i,s){if(!e)return void u.default.warn("octaveshift: no endStaffEntry");let n=e.PositionAndShape;i.graphicalEndAtMeasureEnd&&(n=e.parentMeasure.PositionAndShape);let r=t.PositionAndShape.Size.width,o=n.Size.width;t.hasOnlyRests()?r=-r:r/=2,i.graphicalEndAtMeasureEnd||(e.hasOnlyRests()?o*=2:o/=2,t===e&&(o*=2));let a=t.PositionAndShape.AbsolutePosition.x-r,l=n.AbsolutePosition.x+o;if(a>l){const t=a;a=l,l=t}i.PositionAndShape.Size.width=l-a;const h=i.getTextBracket(),d=h.font.size/10;if(h.position===c.TextBracket.Positions.TOP){const t=Math.ceil(s.SkyBottomLineCalculator.getSkyLineMinInRange(a,l));if(t===1/0)return;h.start.getStave().options.top_text_position=Math.abs(t),s.SkyBottomLineCalculator.updateSkyLineInRange(a,l,t-2*d)}else{const t=s.SkyBottomLineCalculator.getBottomLineMaxInRange(a,l);if(t===1/0)return;h.start.getStave().options.bottom_text_position=t,s.SkyBottomLineCalculator.updateBottomLineInRange(a,l,t+1.5*d)}}calculateWordRepetitionInstruction(t,e){let i;const s=this.graphicalMusicSheet.MeasureList[e];for(let t=0,e=s.length;t<e;++t){const e=s[t];if(e&&e.ParentStaffLine&&e.ParentStaff.ParentInstrument.Visible){i=e;break}}i&&i.addWordRepetition(t)}calculateSkyBottomLines(){const t=A.CollectionUtil.flat(this.musicSystems.map((t=>t.StaffLines)));let e=0;for(const i of t)for(const t of i.Measures)t&&e++;if(this.rules.AlwaysSetPreferredSkyBottomLineBackendAutomatically&&this.rules.setPreferredSkyBottomLineBackendAutomatically(e),e>=this.rules.SkyBottomLineBatchMinMeasures)new o.SkyBottomLineBatchCalculator(t,this.rules.PreferredSkyBottomLineBatchCalculatorBackend).calculateLines();else for(const e of t)e.SkyBottomLineCalculator.calculateLines()}calculateExpressionAlignements(){for(const t of this.musicSystems)for(const e of t.StaffLines)try{e.AlignmentManager.alignDynamicExpressions(),e.AbstractExpressions.forEach((t=>{t.updateSkyBottomLine()}))}catch(t){}}handleTiedGraphicalNote(t,e,i,s,n,r,o,a){}handleBeam(t,e,i){t.parentVoiceEntry.parentStaffEntry.parentMeasure.handleBeam(t,e)}handleVoiceEntryLyrics(t,e,i){t.LyricsEntries.forEach(((t,s)=>{const n=new f.GraphicalLyricEntry(s,e,this.rules.LyricsHeight,this.rules.StaffHeight);if(e.LyricsEntries.push(n),n.GraphicalLabel.setLabelPositionAndShapeBorders(),s.Word){const t=s.Word.Syllables.indexOf(s);let e=i.indexOf(s.Word);if(-1===e&&(i.push(s.Word),e=i.indexOf(s.Word)),0===this.graphicalLyricWords.length||e>this.graphicalLyricWords.length-1){const e=new m.GraphicalLyricWord(s.Word);n.ParentLyricWord=e,e.GraphicalLyricsEntries[t]=n,this.graphicalLyricWords.push(e)}else{const s=this.graphicalLyricWords[e];n.ParentLyricWord=s,s.GraphicalLyricsEntries[t]=n,s.isFilled()&&(i.splice(e,1),this.graphicalLyricWords.splice(this.graphicalLyricWords.indexOf(s),1))}}}))}handleVoiceEntryOrnaments(t,e,i){}handleVoiceEntryArticulations(t,e,i){}handleVoiceEntryTechnicalInstructions(t,e,i){}handleTuplet(t,e,i){t.parentVoiceEntry.parentStaffEntry.parentMeasure.handleTuplet(t,e)}findIndexGraphicalSlurFromSlur(t,e){for(let i=0;i<t.length;i++)if(t[i].slur===e)return i;return-1}indexOfGraphicalGlissFromGliss(t,e){for(let i=0;i<t.length;i++)if(t[i].Glissando===e)return i;return-1}calculateSlurs(){const t={};for(const e of this.graphicalMusicSheet.MeasureList[0])t[e.ParentStaff.idInMusicSheet]=[];for(const e of this.musicSystems)for(const i of e.StaffLines){const e=t[i.ParentStaff.idInMusicSheet];for(let t=0;t<e.length;t++){const s=e[t],n=new S.GraphicalSlur(s.slur,this.rules);i.addSlurToStaffline(n),e[t]=n}for(const t of i.Measures)for(const s of t.staffEntries){for(const t of s.graphicalVoiceEntries)for(const n of t.notes)for(const t of n.sourceNote.NoteSlurs)if(t.EndNote&&t.StartNote){if(t.StartNote===n.sourceNote){const s=new S.GraphicalSlur(t,this.rules);e.push(s),i.addSlurToStaffline(s)}if(t.EndNote===n.sourceNote){const i=this.findIndexGraphicalSlurFromSlur(e,t);if(i>=0){const t=e[i];-1===t.staffEntries.indexOf(s)&&t.staffEntries.push(s),e.splice(i,1)}}}for(const t of e)-1===t.staffEntries.indexOf(s)&&t.staffEntries.push(s)}}for(const t of this.musicSystems)for(const e of t.StaffLines){const t=e.GraphicalSlurs.sort(S.GraphicalSlur.Compare);for(const e of t)e.slur.isCrossed()||e.calculateCurve(this.rules)}}calculateGlissandi(){const t={};for(const e of this.graphicalMusicSheet.MeasureList[0])t[e.ParentStaff.idInMusicSheet]=[];for(const e of this.musicSystems)for(const i of e.StaffLines){const e=t[i.ParentStaff.idInMusicSheet];for(let t=0;t<e.length;t++){const s=e[t],n=new C.VexFlowGlissando(s.Glissando);i.addGlissandoToStaffline(n),e[t]=n}for(const t of i.Measures)for(const s of t.staffEntries){for(const t of s.graphicalVoiceEntries)for(const n of t.notes){const t=n.sourceNote.NoteGlissando;if((null==t?void 0:t.EndNote)&&(null==t?void 0:t.StartNote)){if(t.StartNote===n.sourceNote){const s=new C.VexFlowGlissando(t);e.push(s),i.addGlissandoToStaffline(s)}if(t.EndNote===n.sourceNote){const i=this.indexOfGraphicalGlissFromGliss(e,t);if(i>=0){const t=e[i];-1===t.staffEntries.indexOf(s)&&t.staffEntries.push(s),e.splice(i,1)}}}}for(const t of e)-1===t.staffEntries.indexOf(s)&&t.staffEntries.push(s)}}for(const t of this.musicSystems)for(const e of t.StaffLines)for(const t of e.GraphicalGlissandi)if(e.ParentStaff.isTab){const e=t.Glissando.StartNote,i=t.Glissando.EndNote,s=t.staffEntries[0].findGraphicalNoteFromNote(e),n=t.staffEntries.last().findGraphicalNoteFromNote(i);if(!s&&!n)return;let r,o,a,l,h=1;e.FretNumber>i.FretNumber&&(h=-1),s&&s.vfnote&&s.vfnote.length>=2&&(a=s.vfnote[0],r=[0]),n&&n.vfnote&&n.vfnote.length>=2&&(l=n.vfnote[0],o=[0]);const u=new c.TabSlide({first_indices:r,first_note:a,last_indices:o,last_note:l},h),d=null==s?void 0:s.parentVoiceEntry.parentStaffEntry.parentMeasure;d&&(d.vfTies.push(u),t.vfTie=u);const f=null==n?void 0:n.parentVoiceEntry.parentStaffEntry.parentMeasure;f&&(f.vfTies.push(u),t.vfTie=u)}}}e.VexFlowMusicSheetCalculator=I},5820:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowMusicSheetDrawer=e.unitInPixels=void 0;const n=s(i(6368)),r=i(1494),o=i(3278),a=i(9086),l=i(2942),h=i(8155),c=i(3748),u=i(5277),d=i(9428),f=s(i(2043)),m=i(374),p=i(7459),b=i(4462);e.unitInPixels=10;class g extends r.MusicSheetDrawer{constructor(t=new p.DrawingParameters){super(new l.VexFlowTextMeasurer(t.Rules),t),this.backends=[],this.zoom=1,this.pageIdx=0}get Backends(){return this.backends}drawSheet(t){var i,s,r;"gonville"===this.rules.DefaultVexFlowNoteFont&&(n.default.Flow.DEFAULT_FONT_STACK=[null===(i=n.default.Flow.Fonts)||void 0===i?void 0:i.Gonville,null===(s=n.default.Flow.Fonts)||void 0===s?void 0:s.Bravura,null===(r=n.default.Flow.Fonts)||void 0===r?void 0:r.Custom]),n.default.Flow.STAVE_LINE_THICKNESS=this.rules.StaffLineWidth*e.unitInPixels,n.default.Flow.STEM_WIDTH=this.rules.StemWidth*e.unitInPixels,n.default.Flow.DEFAULT_NOTATION_FONT_SCALE=this.rules.VexFlowDefaultNotationFontScale,n.default.Flow.DEFAULT_TAB_FONT_SCALE=this.rules.VexFlowDefaultTabFontScale,this.pageIdx=0;for(const e of t.MusicPages){if(e.PageNumber>this.rules.MaxPageToDrawNumber)break;const t=this.backends[this.pageIdx];t.graphicalMusicPage=e,t.scale(this.zoom),this.pageIdx+=1}this.pageIdx=0,this.backend=this.backends[0],super.drawSheet(t)}drawPage(t){t&&(this.backend=this.backends[t.PageNumber-1],super.drawPage(t),this.pageIdx+=1)}clear(){for(const t of this.backends)t.clear()}setZoom(t){this.zoom=t}calculatePixelDistance(t){return t*e.unitInPixels}drawStaffLine(t){super.drawStaffLine(t);const e=t.PositionAndShape.AbsolutePosition;this.rules.RenderSlurs&&this.drawSlurs(t,e),this.rules.RenderGlissandi&&this.drawGlissandi(t,e)}drawSlurs(t,e){for(const i of t.GraphicalSlurs)i.slur.isCrossed()||this.drawSlur(i,e)}drawGlissandi(t,e){for(const i of t.GraphicalGlissandi)this.drawGlissando(i,e)}drawGlissando(t,e){if(t.StaffLine.ParentStaff.isTab||t.calculateLine(this.rules),t.Line){const i=new a.PointF2D(t.Line.Start.x+e.x,t.Line.Start.y),s=new a.PointF2D(t.Line.End.x+e.x,t.Line.End.y);this.drawLine(i,s,t.Color,t.Width)}else{const e=t.vfTie;if(e){const t=this.backend.getContext();e.setContext(t),e.draw()}}}drawSlur(t,e){const i=[],s=new a.PointF2D(t.bezierStartPt.x+e.x,t.bezierStartPt.y+e.y),n=new a.PointF2D(t.bezierStartControlPt.x+e.x,t.bezierStartControlPt.y+e.y),r=new a.PointF2D(t.bezierEndControlPt.x+e.x,t.bezierEndControlPt.y+e.y),o=new a.PointF2D(t.bezierEndPt.x+e.x,t.bezierEndPt.y+e.y);i.push(this.applyScreenTransformation(s)),i.push(this.applyScreenTransformation(n)),i.push(this.applyScreenTransformation(r)),i.push(this.applyScreenTransformation(o)),t.placement===c.PlacementEnum.Above?(s.y-=.05,n.y-=.3,r.y-=.3,o.y-=.05):(s.y+=.05,n.y+=.3,r.y+=.3,o.y+=.05),i.push(this.applyScreenTransformation(s)),i.push(this.applyScreenTransformation(n)),i.push(this.applyScreenTransformation(r)),i.push(this.applyScreenTransformation(o)),t.SVGElement=this.backend.renderCurve(i)}drawMeasure(t){t.setAbsoluteCoordinates(t.PositionAndShape.AbsolutePosition.x*e.unitInPixels,t.PositionAndShape.AbsolutePosition.y*e.unitInPixels);try{t.draw(this.backend.getContext())}catch(t){f.default.warn("VexFlowMusicSheetDrawer.drawMeasure",t)}for(const e of t.staffEntries)this.drawStaffEntry(e)}drawLine(t,i,s="#000000FF",n=.2){return t=this.applyScreenTransformation(t),i=this.applyScreenTransformation(i),this.backend.renderLine(t,i,s,n*e.unitInPixels)}DrawOverlayLine(t,i,s,n="#FF0000FF",r=.2){if(!s.PageNumber||s.PageNumber>this.backends.length||s.PageNumber<1)return void console.log("VexFlowMusicSheetDrawer.drawOverlayLine: invalid page number / music page number doesn't correspond to an existing backend.");const o=s.PageNumber-1,a=this.backends[o];return t=this.applyScreenTransformation(t),i=this.applyScreenTransformation(i),a.renderLine(t,i,n,r*e.unitInPixels)}drawSkyLine(t){const e=t.PositionAndShape.AbsolutePosition,i=t.PositionAndShape.Size.width;this.drawSampledLine(t.SkyLine,e,i)}drawBottomLine(t){const e=new a.PointF2D(t.PositionAndShape.AbsolutePosition.x,t.PositionAndShape.AbsolutePosition.y),i=t.PositionAndShape.Size.width;this.drawSampledLine(t.BottomLine,e,i,"#0000FFFF")}drawSampledLine(t,e,i,s="#FF0000FF"){const n=[];let r=0;for(let e=0;e<t.length;e++)t[e]!==r&&(n.push(e),r=t[e]);const o=e;if(n.length>0){const e=this.rules.SamplingUnit;let r,l,h=new a.PointF2D(o.x,o.y),c=new a.PointF2D(n[0]/e+o.x,o.y);this.drawLine(h,c,s),t[0]>=0&&(r=new a.PointF2D(n[0]/e+o.x,o.y),l=new a.PointF2D(n[0]/e+o.x,o.y+t[n[0]]),this.drawLine(r,l,s));for(let i=1;i<n.length;i++)h=new a.PointF2D(n[i-1]/e+o.x,o.y+t[n[i-1]]),c=new a.PointF2D(n[i]/e+o.x,o.y+t[n[i-1]]),this.drawLine(h,c,s),r=new a.PointF2D(n[i]/e+o.x,o.y+t[n[i-1]]),l=new a.PointF2D(n[i]/e+o.x,o.y+t[n[i]]),this.drawLine(r,l,s);n[n.length-1]<t.length?(h=new a.PointF2D(n[n.length-1]/e+o.x,o.y+t[n[n.length-1]]),c=new a.PointF2D(o.x+i,o.y+t[n[n.length-1]]),this.drawLine(h,c,s)):(h=new a.PointF2D(n[n.length-1]/e+o.x,o.y),c=new a.PointF2D(o.x+i,o.y),this.drawLine(h,c,s))}else{const t=new a.PointF2D(o.x,o.y),e=new a.PointF2D(o.x+i,o.y);this.drawLine(t,e,s)}}drawStaffEntry(t){if(t.FingeringEntries.length>0)for(const e of t.FingeringEntries)e.SVGNode=this.drawLabel(e,h.GraphicalLayers.Notes);if(void 0!==t.graphicalChordContainers&&t.graphicalChordContainers.length>0)for(const e of t.graphicalChordContainers){const t=e.GraphicalLabel;t.SVGNode=this.drawLabel(t,h.GraphicalLayers.Notes)}this.rules.RenderLyrics&&t.LyricsEntries.length>0&&this.drawLyrics(t.LyricsEntries,h.GraphicalLayers.Notes)}drawLyrics(t,e){t.forEach((t=>{const i=t.GraphicalLabel;i.Label.colorDefault=this.rules.DefaultColorLyrics,i.SVGNode=this.drawLabel(i,e)}))}drawInstrumentBrace(t,e){t.draw(this.backend.getContext())}drawGroupBracket(t,e){t.draw(this.backend.getContext())}drawOctaveShifts(t){for(const e of t.OctaveShifts)if(e){const t=e,i=this.backend.getContext(),s=t.getTextBracket();this.rules.DefaultColorMusic&&(s.render_options.color=this.rules.DefaultColorMusic),s.setContext(i);try{s.draw()}catch(t){f.default.warn(t)}}}drawPedals(t){for(const e of t.Pedals)if(e){const t=e,i=this.backend.getContext(),s=t.getPedalMarking();s.render_options.color=this.rules.DefaultColorMusic,s.setContext(i),s.draw()}}drawExpressions(t){for(const e of t.AbstractExpressions)if(e instanceof d.GraphicalInstantaneousDynamicExpression)this.drawInstantaneousDynamic(e);else if(e instanceof u.GraphicalInstantaneousTempoExpression){const t=e.GraphicalLabel;t.SVGNode=this.drawLabel(t,h.GraphicalLayers.Notes)}else if(e instanceof m.GraphicalContinuousDynamicExpression)this.drawContinuousDynamic(e);else if(e instanceof b.GraphicalUnknownExpression){const t=e.Label;t.SVGNode=this.drawLabel(t,h.GraphicalLayers.Notes)}else f.default.warn("Unkown type of expression!")}drawInstantaneousDynamic(t){const e=t.Label;e.SVGNode=this.drawLabel(e,h.GraphicalLayers.Notes)}drawContinuousDynamic(t){var e;if(t.IsVerbal){const e=t.Label;e.SVGNode=this.drawLabel(e,h.GraphicalLayers.Notes)}else for(const i of t.Lines){const s=new a.PointF2D(t.ParentStaffLine.PositionAndShape.AbsolutePosition.x+i.Start.x,t.ParentStaffLine.PositionAndShape.AbsolutePosition.y+i.Start.y),n=new a.PointF2D(t.ParentStaffLine.PositionAndShape.AbsolutePosition.x+i.End.x,t.ParentStaffLine.PositionAndShape.AbsolutePosition.y+i.End.y);this.drawLine(s,n,null!==(e=i.colorHex)&&void 0!==e?e:"#000000",i.Width)}}renderLabel(t,i,s,n,r,o){var l;if(!t.Label.print)return;const h=t.Label.fontHeight*e.unitInPixels,{font:c}=t.Label;let u;this.rules.ColoringEnabled&&(u=t.Label.colorDefault,u||(u=this.rules.DefaultColorLabel));let d,{fontStyle:f,fontFamily:m}=t.Label;f||(f=this.rules.DefaultFontStyle),m||(m=this.rules.DefaultFontFamily);for(let e=0;e<(null===(l=t.TextLines)||void 0===l?void 0:l.length);e++){const i=t.TextLines[e],s=this.calculatePixelDistance(i.xOffset),n=new a.PointF2D(o.x+s,o.y),l=this.backend.renderText(h,f,c,i.text,r,n,u,t.Label.fontFamily);d?d.appendChild(l):d=l,o.y=o.y+r,t.TextLines.length>1&&(o.y+=this.rules.SpacingBetweenTextLines)}return d}renderRectangle(t,e,i,s,n){return this.backend.renderRectangle(t,i,s,n)}applyScreenTransformation(t){return new a.PointF2D(t.x*e.unitInPixels,t.y*e.unitInPixels)}applyScreenTransformationForRect(t){return new o.RectangleF2D(t.x*e.unitInPixels,t.y*e.unitInPixels,t.width*e.unitInPixels,t.height*e.unitInPixels)}}e.VexFlowMusicSheetDrawer=g},8494:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowMusicSystem=void 0;const s=i(7142),n=i(6894),r=i(7771),o=i(8129),a=i(5575),l=i(8939);class h extends s.MusicSystem{constructor(t,e){super(t),this.rules=e}calculateBorders(t){if(0===this.staffLines.length)return;const e=this.calcBracketsWidth();this.boundingBox.BorderLeft=-e,this.boundingBox.BorderMarginLeft=-e,this.boundingBox.XBordersHaveBeenSet=!0;const i=this.staffLines[0].SkyBottomLineCalculator.getSkyLineMin();this.boundingBox.BorderTop=i,this.boundingBox.BorderMarginTop=i;const s=this.staffLines[this.staffLines.length-1],n=s.SkyBottomLineCalculator.getBottomLineMax()+s.PositionAndShape.RelativePosition.y;this.boundingBox.BorderBottom=n,this.boundingBox.BorderMarginBottom=n,this.boundingBox.XBordersHaveBeenSet=!0,this.boundingBox.YBordersHaveBeenSet=!0}createSystemLine(t,e,i,s,a,l,h){const c=l;let u=!1;if(h&&(u=!0,h.lineTo(l,o.VexFlowConverter.line(i,s)),h.addMeasureLine(i,s),i===n.SystemLinesEnum.DotsBoldBoldDots)){const t=h.ParentStaffLine.Measures.indexOf(h)+1,e=h.ParentStaffLine.Measures[t],i=l.ParentStaffLine.Measures[t];e&&i&&(e.lineTo(i,o.VexFlowConverter.line(n.SystemLinesEnum.BoldThinDots,s)),e.addMeasureLine(n.SystemLinesEnum.BoldThinDots,s))}return c&&c.addMeasureLine(i,s,u),new r.SystemLine(i,s,this,l,h)}createInstrumentBracket(t,e){const i=t,s=e,n=new l.VexFlowInstrumentBrace(i,s);this.InstrumentBrackets.push(n)}createGroupBracket(t,e,i){const s=t,n=e;if(0===i){const t=new a.VexFlowInstrumentBracket(s,n,i);this.GroupBrackets.push(t)}else{const t=new l.VexFlowInstrumentBrace(s,n,i);this.GroupBrackets.push(t)}}}e.VexFlowMusicSystem=h},9520:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowOctaveShift=void 0;var n=s(i(6368)).default.Flow;const r=i(873),o=i(5853),a=s(i(2043));class l extends r.GraphicalOctaveShift{constructor(t,e){switch(super(t,e),t.Type){case o.OctaveEnum.VA8:this.position=n.TextBracket.Positions.TOP,this.supscript="va",this.text="8";break;case o.OctaveEnum.MA15:this.position=n.TextBracket.Positions.TOP,this.supscript="ma",this.text="15";break;case o.OctaveEnum.VB8:this.position=n.TextBracket.Positions.BOTTOM,this.supscript="vb",this.text="8";break;case o.OctaveEnum.MB15:this.position=n.TextBracket.Positions.BOTTOM,this.supscript="mb",this.text="15";break;default:a.default.error("Unknown or NONE octaveshift. This should not be called!")}}setStartNote(t){for(const e of t.graphicalVoiceEntries){const t=e;if(null==t?void 0:t.vfStaveNote)return this.startNote=t.vfStaveNote,!0}return!1}setEndNote(t){for(const e of t.graphicalVoiceEntries){const t=e;if(null==t?void 0:t.vfStaveNote)return this.endNote=t.vfStaveNote,!0}return!1}getTextBracket(){let t,e=this.endNote;const i=this;this.graphicalEndAtMeasureEnd&&(t={getAbsoluteX:()=>10*(i.endMeasure.PositionAndShape.AbsolutePosition.x+i.endMeasure.PositionAndShape.Size.width),getGlyph:()=>({getWidth:()=>0})}),t&&(e=t);const s=new n.TextBracket({position:this.position,start:this.startNote,stop:e,superscript:this.supscript,text:this.text});return this.endsOnDifferentStaffLine&&(s.render_options.show_bracket=!1),s}}e.VexFlowOctaveShift=l},3010:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowPedal=void 0;const n=s(i(6368)),r=i(8911),o=i(4082),a=i(158);class l extends o.GraphicalPedal{constructor(t,e,i=!1,s=!1){switch(super(t,e),this.vfStyle=n.default.Flow.PedalMarking.Styles.BRACKET,this.ChangeBegin=!1,this.ChangeEnd=!1,this.line=-3,this.EndSymbolPositionAndShape=void 0,this.ChangeBegin=t.ChangeBegin,this.ChangeEnd=t.ChangeEnd,this.pedalSymbol){case a.MusicSymbol.PEDAL_SYMBOL:this.vfStyle=n.default.Flow.PedalMarking.Styles.TEXT,this.EndSymbolPositionAndShape=new r.BoundingBox(this,e);break;case a.MusicSymbol.PEDAL_MIXED:this.vfStyle=i&&s?n.default.Flow.PedalMarking.Styles.BRACKET_OPEN_BOTH:i?n.default.Flow.PedalMarking.Styles.BRACKET_OPEN_BEGIN:s?n.default.Flow.PedalMarking.Styles.MIXED_OPEN_END:n.default.Flow.PedalMarking.Styles.MIXED;break;case a.MusicSymbol.PEDAL_BRACKET:default:this.vfStyle=i&&s?n.default.Flow.PedalMarking.Styles.BRACKET_OPEN_BOTH:i?n.default.Flow.PedalMarking.Styles.BRACKET_OPEN_BEGIN:s?n.default.Flow.PedalMarking.Styles.BRACKET_OPEN_END:n.default.Flow.PedalMarking.Styles.BRACKET}}setStartNote(t){if(!t)return!1;for(const e of t.graphicalVoiceEntries){const t=e;if(null==t?void 0:t.vfStaveNote)return this.startNote=t.vfStaveNote,this.startVfVoiceEntry=t,!0}return!1}setEndNote(t){if(!t)return!1;for(const e of t.graphicalVoiceEntries){const t=e;if(null==t?void 0:t.vfStaveNote)return this.endNote=t.vfStaveNote,this.endVfVoiceEntry=t,!0}return!1}setEndMeasure(t){this.endMeasure=t}CalculateBoundingBox(){}setLine(t){this.line=t}getPedalMarking(){const t=new n.default.Flow.PedalMarking([this.startNote,this.endNote]);return this.endMeasure&&t.setEndStave(this.endMeasure.getVFStave()),t.setStyle(this.vfStyle),t.setLine(this.line),t.setCustomText(this.DepressText,this.ReleaseText),this.endVfVoiceEntry&&!this.getPedal.EndsStave||(t.EndsStave=!0),this.getPedal.BeginsStave&&(t.BeginsStave=!0),t.ChangeBegin=this.ChangeBegin,t.ChangeEnd=this.ChangeEnd,t}setEndsStave(t,e){(null==e?void 0:e.gte(t.parentSourceMeasure.Duration))&&(this.getPedal.EndsStave=!0)}setBeginsStave(t,e){t&&0===e.RealValue&&(this.getPedal.BeginsStave=!0)}}e.VexFlowPedal=l},8041:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowSlur=e.CurvePositionEnum=void 0;var n,r=s(i(6368)).default.Flow;!function(t){t[t.NEAR_HEAD=1]="NEAR_HEAD",t[t.NEAR_TOP=2]="NEAR_TOP"}(n=e.CurvePositionEnum||(e.CurvePositionEnum={}));class o{constructor(t){this.vfStartNote=void 0,this.vfEndNote=void 0,this.parentSlur=t}static createFromVexflowSlur(t){return new o(t.parentSlur)}get vfSlur(){return this.parentSlur}curve_Options(){return{cps:[{x:0,y:10},{x:0,y:10}],invert:!1,position:n.NEAR_TOP,position_end:n.NEAR_TOP,spacing:2,thickness:2,x_shift:0,y_shift:10}}createVexFlowCurve(){this.vfCurve=new r.Curve(this.vfStartNote,this.vfEndNote,void 0)}}e.VexFlowSlur=o},9252:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowStaffEntry=void 0;const s=i(3023),n=i(5820),r=i(8640);class o extends s.GraphicalStaffEntry{constructor(t,e,i){super(t,e,i)}calculateXPosition(){const t=this.parentMeasure.getVFStave();let e=0;for(const i of this.graphicalVoiceEntries)if(i.vfStaveNote){if(i.vfStaveNote.setStave(t),!i.vfStaveNote.preFormatted)continue;i.applyBordersFromVexflow(),this.parentMeasure.ParentStaff.isTab?this.PositionAndShape.RelativePosition.x=(i.vfStaveNote.getAbsoluteX()+i.vfStaveNote.glyph.getWidth())/n.unitInPixels:this.PositionAndShape.RelativePosition.x=i.vfStaveNote.getBoundingBox().getX()/n.unitInPixels;const s=i.notes[0].sourceNote;s.isRest()&&s.Length.RealValue===this.parentMeasure.parentSourceMeasure.ActiveTimeSignature.RealValue&&(this.PositionAndShape.RelativePosition.x+=this.parentMeasure.parentSourceMeasure.Rules.WholeRestXShiftVexflow-.1,i.PositionAndShape.BorderLeft=-.7,i.PositionAndShape.BorderRight=.7),i.PositionAndShape.BorderLeft<e&&(e=i.PositionAndShape.BorderLeft)}this.PositionAndShape.RelativePosition.x-=e,this.PositionAndShape.calculateBoundingBox()}setMaxAccidentals(){for(const t of this.graphicalVoiceEntries)for(const e of t.notes)if(e.DrawnAccidental!==r.AccidentalEnum.NONE)return this.MaxAccidentals=1;return this.MaxAccidentals=0}setModifierXOffsets(){let t=[];for(const e of this.graphicalVoiceEntries)t=t.concat(e.notes);const e=t.map((t=>t.staffLine)),i=this.calculateModifierXOffsets(e,1),s=this.calculateModifierXOffsets(e,.5);t.forEach(((t,e)=>{t.baseFingeringXOffset=s[e],t.baseStringNumberXOffset=i[e]}))}calculateModifierXOffsets(t,e){const i=[];for(let s=0;s<t.length;s++){let n=0,r=!0;for(;r;)for(let o=s;o>=0;o--){if(Math.abs(t[s]-t[o])<=e&&n===i[o]){n++,r=!0;break}r=!1}i.push(n)}return i}}e.VexFlowStaffEntry=o},4828:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowStaffLine=void 0;const s=i(9953),n=i(449);class r extends s.StaffLine{constructor(t,e){super(t,e),this.slursInVFStaffLine=[],this.alignmentManager=new n.AlignmentManager(this)}get SlursInVFStaffLine(){return this.slursInVFStaffLine}addVFSlurToVFStaffline(t){this.slursInVFStaffLine.push(t)}get AlignmentManager(){return this.alignmentManager}}e.VexFlowStaffLine=r},8790:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowTabMeasure=void 0;var n=s(i(6368)).default.Flow;const r=i(7330),o=i(8129),a=s(i(2043));class l extends r.VexFlowMeasure{constructor(t,e,i){super(t,e,i),this.isTabMeasure=!0}resetLayout(){var t;const e=null!==(t=this.ParentStaff.StafflineCount)&&void 0!==t?t:6;this.stave=new n.TabStave(0,0,0,{space_above_staff_ln:0,space_below_staff_ln:0,num_lines:e}),this.updateInstructionWidth()}graphicalMeasureCreatedCalculations(){for(let t=0,e=this.staffEntries.length;t<e;++t){const e=this.staffEntries[t];for(const t of e.graphicalVoiceEntries)t.notes[0].sourceNote.isRest()?t.vfStaveNote=o.VexFlowConverter.GhostNotes(t.notes[0].sourceNote.Length)[0]:t.vfStaveNote=o.VexFlowConverter.CreateTabNote(t)}this.rules.TupletNumbersInTabs&&this.finalizeTuplets();const t=this.getVoicesWithinMeasure();for(const e of t){if(!e)continue;this.vfVoices[e.VoiceId]=new n.Voice({beat_value:this.parentSourceMeasure.Duration.Denominator,num_beats:this.parentSourceMeasure.Duration.Numerator,resolution:n.RESOLUTION}).setMode(n.Voice.Mode.SOFT);const t=this.getRestFilledVexFlowStaveNotesPerVoice(e);for(const i of t){if(i.parentVoiceEntry&&i.parentVoiceEntry.IsGrace&&!i.parentVoiceEntry.GraceAfterMainNote)continue;const t=i;if(0!==i.notes.length&&i.notes[0]&&i.notes[0].sourceNote.PrintObject){if(i.parentVoiceEntry&&i.parentVoiceEntry.Arpeggio){const e=i.parentVoiceEntry.Arpeggio;if(i.notes&&i.notes.length>1){const i=o.VexFlowConverter.StrokeTypeFromArpeggioType(e.type),s=new n.Stroke(i,{all_voices:this.rules.ArpeggiosGoAcrossVoices});this.rules.RenderArpeggios&&t.vfStaveNote.addStroke(0,s)}else a.default.debug(`[OSMD] arpeggio in measure ${this.MeasureNumber} could not be drawn.\n voice entry had less than two notes, arpeggio is likely between voice entries, not currently supported in Vexflow.`)}this.vfVoices[e.VoiceId].addTickable(t.vfStaveNote)}else this.vfVoices[e.VoiceId].addTickable(t.vfStaveNote)}}}}e.VexFlowTabMeasure=l},2942:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowTextMeasurer=void 0;const s=i(8129);e.VexFlowTextMeasurer=class{constructor(t){this.fontSize=20,this.fontSizeStandard=this.fontSize;const e=document.createElement("canvas");this.context=e.getContext("2d"),this.rules=t}computeTextWidthToHeightRatio(t,e,i,n,r=this.fontSize){return this.context.font=s.VexFlowConverter.font(r,i,e,this.rules,n),this.context.measureText(t).width/r}setFontSize(t=this.fontSizeStandard){return this.fontSize=t,t}}},5460:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowVoiceEntry=void 0;const s=i(5974),n=i(5820),r=i(7459);class o extends s.GraphicalVoiceEntry{constructor(t,e,i){super(t,e,i)}applyBordersFromVexflow(){const t=this.vfStaveNote;if(!t.getNoteHeadBeginX)return;const e=t.getBoundingBox(),i=t.getNoteHeadBeginX()-e.x;this.PositionAndShape.RelativePosition.y=e.y/n.unitInPixels,this.PositionAndShape.BorderTop=0,this.PositionAndShape.BorderBottom=e.h/n.unitInPixels,this.PositionAndShape.BorderLeft=-(i+t.width/2)/n.unitInPixels,this.PositionAndShape.BorderRight=(e.w-i)/n.unitInPixels}set vfStaveNote(t){this.mVexFlowStaveNote=t}get vfStaveNote(){return this.mVexFlowStaveNote}color(){var t;const e=this.rules.DefaultColorNotehead,i=this.rules.DefaultColorRest,s=this.rules.DefaultColorStem,n="#00000000";let o,a;const l=this.vfStaveNote;for(let s=0;s<this.notes.length;s++){const h=this.notes[s];if(a=h.sourceNote.NoteheadColor,o=a,this.rules.ColoringMode===r.ColoringModes.AutoColoring||this.rules.ColoringMode===r.ColoringModes.CustomColorSet)if(h.sourceNote.isRest())o=this.rules.ColoringSetCurrent.getValue(-1);else{const t=h.sourceNote.Pitch.FundamentalNote;o=this.rules.ColoringSetCurrent.getValue(t)}if(h.sourceNote.PrintObject?o&&"#000000"!==o||(o=this.rules.DefaultColorNotehead):o=n,!a&&this.rules.ColoringMode===r.ColoringModes.XML&&h.sourceNote.PrintObject&&(!h.sourceNote.isRest()&&e?o=e:h.sourceNote.isRest()&&i&&(o=i)),o&&h.sourceNote.PrintObject)h.sourceNote.NoteheadColorCurrentlyRendered=o;else if(!o)continue;if(this.rules.ColoringEnabled&&h.sourceNote.NoteBeam&&this.rules.ColorBeams){const e=h.sourceNote.NoteBeam.Notes;let i=!0;for(let t=0;t<e.length;t++)e[t].NoteheadColorCurrentlyRendered!==o&&(i=!1);i&&(null===(t=null==l?void 0:l.beam)||void 0===t?void 0:t.setStyle)&&l.beam.setStyle({fillStyle:o,strokeStyle:o})}if(l){if(l.note_heads){const t=l.note_heads[s];t&&t.setStyle({fillStyle:o,strokeStyle:o})}l.setLedgerLineStyle&&(o===n?l.setLedgerLineStyle({fillStyle:o,strokeStyle:o,lineWidth:this.rules.LedgerLineWidth}):l.setLedgerLineStyle({fillStyle:this.rules.LedgerLineColorDefault,lineWidth:this.rules.LedgerLineWidth,strokeStyle:this.rules.LedgerLineColorDefault}))}}let h=s,c=!1;this.rules.ColoringEnabled&&(h=this.parentVoiceEntry.StemColor,h&&"#000000"!==h||(h=s),this.rules.ColorStemsLikeNoteheads&&o&&(h=o,c=!0));let u=!0;for(const t of this.parentVoiceEntry.Notes)if(t.PrintObject){u=!1;break}u&&(h=n);const d={fillStyle:h,strokeStyle:h};l&&l.setStemStyle&&(!u&&c&&(this.parentVoiceEntry.StemColor=h),l.setStemStyle(d),l.flag&&l.setFlagStyle&&this.rules.ColorFlags&&l.setFlagStyle(d))}}e.VexFlowVoiceEntry=o},7781:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VexflowStafflineNoteCalculator=void 0;const s=i(8640),n=i(4679),r=i(1649),o=i(289),a=i(908);class l{constructor(t){this.staffPitchListMapping=new r.Dictionary,this.baseLineNote=s.NoteEnum.B,this.baseLineOctave=1,this.rules=t}trackNote(t){if(!(t instanceof n.VexFlowGraphicalNote)||t.Clef().ClefType!==o.ClefEnum.percussion||t.sourceNote.isRest()||0===this.rules.PercussionOneLineCutoff||-1===this.rules.PercussionForceVoicesOneLineCutoff)return;const e=t.parentVoiceEntry.parentStaffEntry.sourceStaffEntry.ParentStaff.idInMusicSheet;let i;this.staffPitchListMapping.containsKey(e)||this.staffPitchListMapping.setValue(e,new Array),i=this.staffPitchListMapping.getValue(e);const s=t.sourceNote.Pitch;l.findOrInsert(i,s)}static PitchIndexOf(t,e,i=0){if(i>t.length-1)return-1;for(let s=i;s<t.length;s++){const i=t[s];if(e.OperatorEquals(i))return s}return-1}static findOrInsert(t,e){for(let i=0;i<t.length;i++){const s=t[i];if(e.OperatorEquals(s))return i;if(e.OperatorFundamentalLessThan(s))return t.splice(i,0,e),i}return t.push(e),t.length-1}positionNote(t){const e=t.parentVoiceEntry.parentStaffEntry.sourceStaffEntry.ParentStaff.idInMusicSheet;if(!(t instanceof n.VexFlowGraphicalNote)||t.sourceNote.isRest()||!this.staffPitchListMapping.containsKey(e))return t;const i=this.staffPitchListMapping.getValue(e),r=this.rules.PercussionUseXMLDisplayStep&&void 0!==t.sourceNote.displayStepUnpitched;if(i.length>this.rules.PercussionOneLineCutoff&&!r)return t;const o=t,h=t.sourceNote.Pitch;let c=this.baseLineNote,u=this.baseLineOctave;if(this.rules.PercussionUseXMLDisplayStep&&void 0!==t.sourceNote.displayStepUnpitched&&(c=t.sourceNote.displayStepUnpitched,u=t.sourceNote.displayOctaveUnpitched+this.rules.PercussionOneLineXMLDisplayStepOctaveOffset),i.length<=this.rules.PercussionForceVoicesOneLineCutoff)o.setAccidental(new s.Pitch(c,u,h.Accidental));else{const t=l.PitchIndexOf(i,h);if(t>-1){const e=Math.ceil(i.length/2);if(!this.rules.PercussionUseXMLDisplayStep)if(t>=e)switch(u=2,(t-e)%5){case 1:c=s.NoteEnum.E;break;case 2:c=s.NoteEnum.G;break;case 3:c=s.NoteEnum.B;break;case 4:c=s.NoteEnum.D,u=3;break;default:c=s.NoteEnum.C}else switch(t%5){case 1:c=s.NoteEnum.F;break;case 2:c=s.NoteEnum.D;break;case 3:c=s.NoteEnum.B,u=0;break;case 4:c=s.NoteEnum.G,u=0;break;default:c=s.NoteEnum.A}const n=new s.Pitch(c,u,h.Accidental);o.setAccidental(n);const r=o.parentVoiceEntry.parentVoiceEntry;!this.rules.SetWantedStemDirectionByXml&&r.Notes.length<2&&(n.Octave>this.baseLineOctave||n.FundamentalNote===this.baseLineNote&&n.Octave===this.baseLineOctave?o.parentVoiceEntry.parentVoiceEntry.WantedStemDirection=a.StemDirectionType.Up:o.parentVoiceEntry.parentVoiceEntry.WantedStemDirection=a.StemDirectionType.Down)}}return o}getStafflineUniquePositionCount(t){return this.staffPitchListMapping.containsKey(t)?this.staffPitchListMapping.getValue(t).length:0}}e.VexflowStafflineNoteCalculator=l},9839:function(t,e,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(t,e,i,s){void 0===s&&(s=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,s,n)}:function(t,e,i,s){void 0===s&&(s=i),t[s]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||s(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(449),e),n(i(4028),e),n(i(9505),e),n(i(709),e),n(i(9344),e),n(i(8129),e),n(i(3602),e),n(i(4679),e),n(i(8144),e),n(i(6351),e),n(i(8939),e),n(i(5575),e),n(i(7330),e),n(i(4405),e),n(i(8738),e),n(i(5820),e),n(i(8494),e),n(i(9520),e),n(i(8041),e),n(i(9252),e),n(i(4828),e),n(i(7781),e),n(i(8790),e),n(i(2942),e),n(i(5460),e)},7636:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.WebGLSkyBottomLineBatchCalculatorBackend=void 0;const n=i(1378),r=i(9531),o=s(i(6357)),a=s(i(6150)),l=s(i(2043)),h=i(2337);function c(t,e,i){const s=t.createShader(e);if(!s)throw l.default.warn("WebGLSkyBottomLineCalculatorBackend: Could not create a WebGL shader"),new Error("Could not create a WebGL shader");if(t.shaderSource(s,i),t.compileShader(s),!t.getShaderParameter(s,t.COMPILE_STATUS))throw l.default.warn("Shader compilation failed\n"+t.getShaderInfoLog(s)),t.deleteShader(s),new Error("WebGL shader compilation failed");return s}class u extends r.SkyBottomLineBatchCalculatorBackend{constructor(t,e){super(t,e)}getPreferredRenderingConfiguration(t,e){const i=Math.min(4096,function(){const t=document.createElement("canvas").getContext("webgl");return t.getParameter(t.MAX_TEXTURE_SIZE)}()),s=Math.ceil(t);return{elementWidth:s,numColumns:Math.min(5,Math.floor(i/s)),numRows:Math.min(5,Math.floor(i/e))}}onInitialize(t){const{elementWidth:e,elementHeight:i,numColumns:s,numRows:n}=t,r=document.createElement("canvas");r.width=e*s,r.height=n;const u=r.getContext("webgl");if(!u)throw l.default.warn("WebGLSkyBottomLineCalculatorBackend: No WebGL support"),new Error("No WebGL support");this.gl=u;const d=function(t,e,i){const s=t.createProgram();if(!s)throw l.default.warn("WebGLSkyBottomLineCalculatorBackend: Could not create a WebGL program"),new Error("Could not create a WebGL program");if(t.attachShader(s,e),t.attachShader(s,i),t.linkProgram(s),!t.getProgramParameter(s,t.LINK_STATUS))throw l.default.warn("WebGLSkyBottomLineCalculatorBackend: WebGL program link failed\n"+t.getProgramInfoLog(s)),t.deleteProgram(s),new Error("WebGL program link failed");return s}(u,c(u,u.VERTEX_SHADER,o.default),c(u,u.FRAGMENT_SHADER,function(t,e){let i=t;for(const[t,s]of Object.entries(e)){const e=new RegExp(`#define ${t} .*`);i=i.replace(e,`#define ${t} ${s}`)}return i}(a.default,{NUM_ROWS:n,ELEMENT_HEIGHT:i})));!function(t,e,i,s){const n=t.createBuffer();if(!n)throw l.default.warn("WebGLSkyBottomLineCalculatorBackend: WebGL buffer creation failed"),new Error("WebGL buffer creation failed");t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,new Float32Array(h.CollectionUtil.flat([[-1,-1],[1,-1],[1,1],[-1,-1],[1,1],[-1,1]])),t.STATIC_DRAW),t.useProgram(e);const r=t.getAttribLocation(e,"a_position");t.enableVertexAttribArray(r),t.vertexAttribPointer(r,2,t.FLOAT,!1,0,0)}(u,d),this.texture=function(t,e,i,s){const n=t.createTexture();if(!n)throw l.default.warn("WebGLSkyBottomLineCalculatorBackend: WebGL texture creation failed"),new Error("WebGL texture creation failed");t.activeTexture(t.TEXTURE0+0),t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST);const r=t.getUniformLocation(e,"u_image");if(!r)throw l.default.warn("WebGLSkyBottomLineCalculatorBackend: WebGL invalid uniform name"),new Error("WebGL invalid uniform name");return t.uniform1i(r,0),n}(u,d)}calculateFromCanvas(t,e,i,s,r){const o=this.gl,{elementWidth:a,elementHeight:l,numColumns:h}=r;o.viewport(0,0,o.canvas.width,o.canvas.height),o.bindTexture(o.TEXTURE_2D,this.texture),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,t),o.drawArrays(o.TRIANGLES,0,6);const c=new Uint8Array(o.canvas.width*o.canvas.height*4);o.readPixels(0,0,o.canvas.width,o.canvas.height,o.RGBA,o.UNSIGNED_BYTE,c);const u=[];for(let t=0;t<i.length;++t){const e=i[t],r=Math.floor(e.getVFStave().getWidth()),o=Math.max(Math.ceil(e.PositionAndShape.Size.width*s),1),d=t%h*a*4,f=Math.floor(t/h)*a*h*4,m=new Array(Math.max(o,r)).fill(0),p=new Array(Math.max(o,r)).fill(0);for(let t=0;t<r;++t){const e=c[4*t+d+f],i=c[4*t+d+f+1],s=c[4*t+d+f+2],n=e+256*Math.floor(s/16),r=i+s%16*256;m[t]=n,p[t]=r}const b=Math.max(...m),g=Math.min(...p);for(let t=0;t<r;++t)m[t]=0===m[t]?b:m[t],p[t]=p[t]===l?g:p[t];u.push(new n.SkyBottomLineCalculationResult(m,p))}return u}}e.WebGLSkyBottomLineBatchCalculatorBackend=u},4759:function(t,e,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(t,e,i,s){void 0===s&&(s=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,s,n)}:function(t,e,i,s){void 0===s&&(s=i),t[s]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||s(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(6791),e),n(i(6055),e),n(i(1070),e),n(i(449),e),n(i(8911),e),n(i(4278),e),n(i(8155),e),n(i(5074),e),n(i(7459),e),n(i(1405),e),n(i(4146),e),n(i(3442),e),n(i(374),e),n(i(5330),e),n(i(1443),e),n(i(9428),e),n(i(5277),e),n(i(9946),e),n(i(6729),e),n(i(5091),e),n(i(8720),e),n(i(7963),e),n(i(1513),e),n(i(599),e),n(i(4324),e),n(i(3486),e),n(i(4785),e),n(i(873),e),n(i(3411),e),n(i(9876),e),n(i(3023),e),n(i(8898),e),n(i(5309),e),n(i(5974),e),n(i(8823),e),n(i(4040),e),n(i(1494),e),n(i(158),e),n(i(7142),e),n(i(5623),e),n(i(4574),e),n(i(9067),e),n(i(3501),e),n(i(6040),e),n(i(9953),e),n(i(4196),e),n(i(7771),e),n(i(1225),e),n(i(6894),e),n(i(525),e),n(i(9839),e)},6842:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Instrument=void 0;const s=i(884),n=i(2255),r=i(0);class o extends s.InstrumentalGroup{constructor(t,e,i,s){super(void 0,i,s),this.Transpose=0,this.voices=[],this.staves=[],this.hasLyrics=!1,this.hasChordSymbols=!1,this.lyricVersesNumbers=[],this.subInstruments=[],this.id=t,this.idString=e,this.nameLabel=new n.Label(e)}get Voices(){return this.voices}get Staves(){return this.staves}get NameLabel(){return this.nameLabel}get HasLyrics(){return this.hasLyrics}set HasLyrics(t){this.hasLyrics=t}get HasChordSymbols(){return this.hasChordSymbols}set HasChordSymbols(t){this.hasChordSymbols=t}get LyricVersesNumbers(){return this.lyricVersesNumbers}set LyricVersesNumbers(t){this.lyricVersesNumbers=t}get Name(){return this.nameLabel.text}set Name(t){this.nameLabel.text=t}get IdString(){return this.idString}get Id(){return this.id}get MidiInstrumentId(){return this.subInstruments[0].midiInstrumentID}set MidiInstrumentId(t){this.subInstruments[0].midiInstrumentID=t}get Volume(){return this.subInstruments[0].volume}set Volume(t){for(let e=0,i=this.subInstruments.length;e<i;++e)this.subInstruments[e].volume=t}get PlaybackTranspose(){return this.playbackTranspose}set PlaybackTranspose(t){this.playbackTranspose=t}get SubInstruments(){return this.subInstruments}getSubInstrument(t){for(let e=0,i=this.subInstruments.length;e<i;++e){const i=this.subInstruments[e];if(i.idString===t)return i}}get PartAbbreviation(){return this.partAbbreviation}set PartAbbreviation(t){this.partAbbreviation=t}get Visible(){return this.voices.length>0&&this.Voices[0].Visible}set Visible(t){for(let e=0,i=this.Voices.length;e<i;++e)this.Voices[e].Visible=t}get Audible(){let t=!1;for(let e=0,i=this.Voices.length;e<i;++e){const i=this.Voices[e];t=t||i.Audible}return t}set Audible(t){for(let e=0,i=this.Voices.length;e<i;++e)this.Voices[e].Audible=t;for(let e=0,i=this.staves.length;e<i;++e)this.staves[e].audible=t}get Following(){let t=!1;for(let e=0,i=this.Voices.length;e<i;++e){const i=this.Voices[e];t=t||i.Following}return t}set Following(t){for(let e=0,i=this.Voices.length;e<i;++e)this.Voices[e].Following=t;for(let e=0,i=this.staves.length;e<i;++e)this.staves[e].following=t}SetVoiceAudible(t,e){for(let i=0,s=this.Voices.length;i<s;++i){const s=this.Voices[i];if(s.VoiceId===t){s.Audible=e;break}}}SetVoiceFollowing(t,e){for(let i=0,s=this.Voices.length;i<s;++i){const s=this.Voices[i];if(s.VoiceId===t){s.Following=e;break}}}SetStaffAudible(t,e){const i=this.staves[t-1];if(i.audible=e,e)for(let t=0,e=i.Voices.length;t<e;++t)i.Voices[t].Audible=!0;else for(let e=0,s=i.Voices.length;e<s;++e){const s=i.Voices[e];let n=!1;for(let e=0,i=this.Staves.length;e<i;++e){const i=this.Staves[e];if(i.Id!==t&&i.audible)for(let t=0,e=i.Voices.length;t<e;++t)i.Voices[t]===s&&(n=!0)}n||(s.Audible=!1)}}SetStaffFollow(t,e){const i=this.staves[t-1];if(i.following=e,e)for(let t=0,e=i.Voices.length;t<e;++t)i.Voices[t].Following=!0;else for(let e=0,s=i.Voices.length;e<s;++e){const s=i.Voices[e];let n=!1;for(let e=0,i=this.Staves.length;e<i;++e){const i=this.Staves[e];if(i.Id!==t&&i.following)for(let t=0,e=i.Voices.length;t<e;++t)i.Voices[t]===s&&(n=!0)}n||(s.Following=!1)}}areAllVoiceVisible(){for(const t of this.Voices)if(!t.Visible)return!1;return!0}createStaves(t){for(let e=0;e<t;e++)this.staves.push(new r.Staff(this,e+1))}toString(){return`${this.Name} , id: ${this.id}, idstring: ${this.idString}`}}e.Instrument=o},884:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InstrumentalGroup=void 0,e.InstrumentalGroup=class{constructor(t,e,i){this.instrumentalGroups=[],this.name=t,this.musicSheet=e,this.parent=i}get InstrumentalGroups(){return this.instrumentalGroups}get Parent(){return this.parent}get Name(){return this.name}set Name(t){this.name=t}get GetMusicSheet(){return this.musicSheet}}},1035:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AClassHierarchyTrackable=void 0,e.AClassHierarchyTrackable=class{isInstanceOfClass(t){let e=this.constructor.prototype;for(;e;){if(t===e.constructor.name)return!0;e=e.__proto__}return!1}}},9603:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},7058:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6287:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4543:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4207:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6331:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ITextTranslation=void 0,e.ITextTranslation=class{static translateText(t,e){if(!this.defaultTextTranslation)return e}}},9984:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4854:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4143:function(t,e,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(t,e,i,s){void 0===s&&(s=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,s,n)}:function(t,e,i,s){void 0===s&&(s=i),t[s]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||s(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(9603),e),n(i(7058),e),n(i(6287),e),n(i(4207),e),n(i(6331),e),n(i(9984),e),n(i(4854),e),n(i(1035),e),n(i(4543),e)},2255:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Label=void 0;const s=i(1274);e.Label=class{constructor(t="",e=s.TextAlignmentEnum.CenterBottom,i,n=!0){this.IsCreditLabel=!1,this.text=t,this.print=n,this.textAlignment=e,this.font=i,this.fontFamily=void 0}ToString(){return this.text}}},5278:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TimestampTransform=e.MusicPartManager=void 0;const s=i(1797),n=i(301);e.MusicPartManager=class{constructor(t){this.musicSheet=t}reInit(){this.init()}init(){this.parts=this.musicSheet.Repetitions.slice(),this.sheetStart=this.musicSheet.SelectionStart=new s.Fraction(0,1),this.sheetEnd=this.musicSheet.SelectionEnd=this.musicSheet.SheetEndTimestamp,this.calcMapping()}getCurrentRepetitionTimestampTransform(t){let e;for(let i=this.timestamps.length-1;i>=0;i--)if(e=this.timestamps[i],t.gte(e.$from))return e;return this.timestamps[0]}absoluteEnrolledToSheetTimestamp(t){if(0===this.timestamps.length)return t;const e=this.getCurrentRepetitionTimestampTransform(t);return s.Fraction.plus(t,s.Fraction.minus(e.to,e.$from))}get Parts(){return this.parts}get MusicSheet(){return this.musicSheet}getIterator(t){return t?new n.MusicPartManagerIterator(this.musicSheet,t,void 0):new n.MusicPartManagerIterator(this.musicSheet,this.musicSheet.SelectionStart,this.musicSheet.SelectionEnd)}setSelectionStart(t){this.musicSheet.SelectionStart=t,this.musicSheet.SelectionEnd=void 0}setSelectionRange(t,e){this.musicSheet.SelectionStart=null!=t?t:this.sheetStart,this.musicSheet.SelectionEnd=null!=e?e:this.sheetEnd}calcMapping(){const t=[],e=this.getIterator();let i=e.CurrentRepetition,s=new r(e.CurrentEnrolledTimestamp.clone(),e.CurrentSourceTimestamp.clone(),void 0,0);for(t.push(s);!e.EndReached;){if(e.JumpOccurred||i!==e.CurrentRepetition){if(i=e.CurrentRepetition,e.backJumpOccurred){const i=e.JumpResponsibleRepetition;s.nextBackJump=e.CurrentEnrolledTimestamp,s.curRepetition=i,s.curRepetitionIteration=e.CurrentJumpResponsibleRepetitionIterationBeforeJump;for(let e=this.timestamps.length-2;e>=0&&!t[e].to.lt(i.AbsoluteTimestamp)&&!t[e].curRepetition;e--)t[e].nextBackJump=s.nextBackJump,t[e].curRepetition=i,t[e].curRepetitionIteration=s.curRepetitionIteration}s=new r(e.CurrentEnrolledTimestamp.clone(),e.CurrentSourceTimestamp.clone(),void 0,0),t.push(s)}e.moveToNext()}this.timestamps=t}};class r{constructor(t,e,i,s){this.$from=t,this.to=e,this.curRepetition=i,this.curRepetitionIteration=s,this.nextBackJump=void 0,this.nextForwardJump=void 0}}e.TimestampTransform=r},301:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.MusicPartManagerIterator=void 0;const n=i(1797),r=i(5356),o=i(3331),a=i(7839),l=s(i(2043));class h{constructor(t,e,i){this.currentMeasureIndex=0,this.currentPartIndex=0,this.currentVoiceEntryIndex=-1,this.currentDynamicEntryIndex=0,this.currentTempoEntryIndex=0,this.currentDynamicChangingExpressions=[],this.currentRepetition=void 0,this.endReached=!1,this.frontReached=!1,this.currentTimeStamp=new n.Fraction(0,1),this.currentEnrolledMeasureTimestamp=new n.Fraction(0,1),this.currentRelativeInMeasureTimestamp=new n.Fraction(0,1),this.currentVerticalContainerInMeasureTimestamp=new n.Fraction(0,1),this.jumpResponsibleRepetition=void 0,this.activeDynamicExpressions=[],this.SkipInvisibleNotes=!0;try{this.frontReached=!0,this.musicSheet=t,this.currentVoiceEntries=void 0,this.frontReached=!1;for(const t of this.musicSheet.Repetitions)this.setRepetitionIterationCount(t,1);if(this.activeDynamicExpressions=new Array(this.musicSheet.getCompleteNumberOfStaves()),this.currentMeasure=this.musicSheet.SourceMeasures[0],!e)return;do{this.moveToNext()}while((!this.currentVoiceEntries||this.currentTimeStamp.lt(e))&&!this.endReached);for(let t=0;t<this.activeDynamicExpressions.length;t++)if(this.activeDynamicExpressions[t])if(this.activeDynamicExpressions[t]instanceof a.ContinuousDynamicExpression){const e=this.activeDynamicExpressions[t];this.currentDynamicChangingExpressions.push(new r.DynamicsContainer(e,t))}else{const e=this.activeDynamicExpressions[t];this.currentDynamicChangingExpressions.push(new r.DynamicsContainer(e,t))}this.currentTempoChangingExpression=this.activeTempoExpression}catch(t){l.default.info("MusicPartManagerIterator: "+t)}}get EndReached(){return this.endReached}get FrontReached(){return this.frontReached}get CurrentMeasure(){return this.currentMeasure}get CurrentRepetition(){return this.currentRepetition}get CurrentRepetitionIteration(){return this.CurrentRepetition?this.getRepetitionIterationCount(this.CurrentRepetition):0}get CurrentJumpResponsibleRepetitionIterationBeforeJump(){return this.jumpResponsibleRepetition?this.getRepetitionIterationCount(this.jumpResponsibleRepetition)-1:0}get CurrentBpm(){return this.currentBpm}get CurrentVoiceEntries(){return this.currentVoiceEntries}get CurrentMeasureIndex(){return this.currentMeasureIndex}get CurrentEnrolledTimestamp(){return n.Fraction.plus(this.currentEnrolledMeasureTimestamp,this.currentVerticalContainerInMeasureTimestamp)}get CurrentSourceTimestamp(){return this.currentTimeStamp}get CurrentRelativeInMeasureTimestamp(){return this.currentRelativeInMeasureTimestamp}get JumpOccurred(){return this.backJumpOccurred||this.forwardJumpOccurred}get ActiveTempoExpression(){return this.activeTempoExpression}get ActiveDynamicExpressions(){return this.activeDynamicExpressions}get CurrentTempoChangingExpression(){return this.currentTempoChangingExpression}get JumpResponsibleRepetition(){return this.jumpResponsibleRepetition}clone(t,e){const i=new h(this.musicSheet,null!=t?t:this.currentTimeStamp,e);return i.currentVoiceEntryIndex=this.currentVoiceEntryIndex,i.currentMappingPart=this.currentMappingPart,i.currentPartIndex=this.currentPartIndex,i.currentVoiceEntries=this.currentVoiceEntries,i.endReached=this.endReached,i.frontReached=this.frontReached,i}CurrentVisibleVoiceEntries(t){const e=[];if(!this.currentVoiceEntries)return e;if(t){for(const i of this.currentVoiceEntries)if(i.ParentVoice.Parent.IdString===t.IdString)return this.getVisibleEntries(i,e),e}else for(const t of this.currentVoiceEntries)this.getVisibleEntries(t,e);return e}CurrentAudibleVoiceEntries(t){const e=[];if(!this.currentVoiceEntries)return e;if(t){for(const i of this.currentVoiceEntries)if(i.ParentVoice.Parent.IdString===t.IdString)return this.getAudibleEntries(i,e),e}else for(const t of this.currentVoiceEntries)this.getAudibleEntries(t,e);return e}getCurrentDynamicChangingExpressions(){return this.currentDynamicChangingExpressions}CurrentScoreFollowingVoiceEntries(t){const e=[];if(!this.currentVoiceEntries)return e;if(t){for(const i of this.currentVoiceEntries)if(i.ParentVoice.Parent.IdString===t.IdString)return this.getScoreFollowingEntries(i,e),e}else for(const t of this.currentVoiceEntries)this.getScoreFollowingEntries(t,e);return e}moveToPrevious(){this.frontReached||(this.currentVoiceEntries&&(this.currentVoiceEntries=[]),this.recursiveMoveBack())}moveToPreviousVisibleVoiceEntry(t){for(;!this.frontReached;)if(this.moveToPrevious(),this.checkEntries(t))return}moveToNext(){this.forwardJumpOccurred=this.backJumpOccurred=!1,this.endReached||(this.frontReached&&(this.frontReached=!1,this.currentVoiceEntryIndex=-1),this.currentVoiceEntries&&(this.currentVoiceEntries=[]),this.recursiveMove(),this.currentMeasure||(this.currentTimeStamp=new n.Fraction(99999,1),this.currentMeasure=this.musicSheet.SourceMeasures.last()))}moveToNextVisibleVoiceEntry(t){for(;!this.endReached;)if(this.moveToNext(),this.checkEntries(t))return}resetRepetitionIterationCount(t){return this.setRepetitionIterationCount(t,1),1}incrementRepetitionIterationCount(t){return-1===this.repetitionIterationCountDictKeys.indexOf(t)?this.setRepetitionIterationCount(t,1):this.setRepetitionIterationCount(t,this.getRepetitionIterationCount(t)+1)}setRepetitionIterationCount(t,e){const i=this.repetitionIterationCountDictKeys.indexOf(t);return-1===i?(this.repetitionIterationCountDictKeys.push(t),this.repetitionIterationCountDictValues.push(e)):this.repetitionIterationCountDictValues[i]=e,e}getRepetitionIterationCount(t){const e=this.repetitionIterationCountDictKeys.indexOf(t);if(-1!==e)return this.repetitionIterationCountDictValues[e]}handleRepetitionsAtMeasureBegin(){for(let t=0,e=this.currentMeasure.FirstRepetitionInstructions.length;t<e;++t){const e=this.currentMeasure.FirstRepetitionInstructions[t];if(!e.parentRepetition)continue;const i=e.parentRepetition;this.currentRepetition=i,i.StartIndex===this.currentMeasureIndex&&void 0!==this.JumpResponsibleRepetition&&i!==this.JumpResponsibleRepetition&&i.StartIndex>=this.JumpResponsibleRepetition.StartIndex&&i.EndIndex<=this.JumpResponsibleRepetition.EndIndex&&this.resetRepetitionIterationCount(i)}}handleRepetitionsAtMeasureEnd(){for(let t=0,e=this.currentMeasure.LastRepetitionInstructions.length;t<e;++t){const e=this.currentMeasure.LastRepetitionInstructions[t],i=e.parentRepetition;if(i){if(i.BackwardJumpInstructions.indexOf(e)>-1&&this.getRepetitionIterationCount(i)<i.UserNumberOfRepetitions)return this.doBackJump(i),void(this.backJumpOccurred=!0);if(e===i.forwardJumpInstruction){void 0!==this.JumpResponsibleRepetition&&i!==this.JumpResponsibleRepetition&&i.StartIndex>=this.JumpResponsibleRepetition.StartIndex&&i.EndIndex<=this.JumpResponsibleRepetition.EndIndex&&this.resetRepetitionIterationCount(i);const t=i.getForwardJumpTargetForIteration(this.getRepetitionIterationCount(i));if(t>=0)return this.currentMeasureIndex=t,this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex],this.currentVoiceEntryIndex=-1,this.jumpResponsibleRepetition=i,void(this.forwardJumpOccurred=!0);-2===t&&(this.endReached=!0)}}}this.currentMeasureIndex++,void 0!==this.JumpResponsibleRepetition&&this.currentMeasureIndex>this.JumpResponsibleRepetition.EndIndex&&(this.jumpResponsibleRepetition=void 0)}doBackJump(t){this.currentMeasureIndex=t.getBackwardJumpTarget(),this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex],this.currentVoiceEntryIndex=-1,this.incrementRepetitionIterationCount(t),this.jumpResponsibleRepetition=t}activateCurrentRhythmInstructions(){if(void 0!==this.currentMeasure&&this.currentMeasure.FirstInstructionsStaffEntries.length>0&&void 0!==this.currentMeasure.FirstInstructionsStaffEntries[0]){const t=this.currentMeasure.FirstInstructionsStaffEntries[0].Instructions;for(let e=0,i=t.length;e<i;++e){const i=t[e];i instanceof o.RhythmInstruction&&(this.musicSheet.SheetPlaybackSetting.rhythm=i.Rhythm)}}}activateCurrentDynamicOrTempoInstructions(){const t=this.musicSheet.TimestampSortedDynamicExpressionsList;for(;this.currentDynamicEntryIndex>0&&(this.currentDynamicEntryIndex>=t.length||this.CurrentSourceTimestamp.lte(t[this.currentDynamicEntryIndex].parMultiExpression().AbsoluteTimestamp));)this.currentDynamicEntryIndex--;for(;this.currentDynamicEntryIndex<t.length&&t[this.currentDynamicEntryIndex].parMultiExpression().AbsoluteTimestamp.lt(this.CurrentSourceTimestamp);)this.currentDynamicEntryIndex++;for(;this.currentDynamicEntryIndex<t.length&&t[this.currentDynamicEntryIndex].parMultiExpression().AbsoluteTimestamp.Equals(this.CurrentSourceTimestamp);){const e=t[this.currentDynamicEntryIndex],i=e.staffNumber;this.CurrentSourceTimestamp.Equals(e.parMultiExpression().AbsoluteTimestamp)&&(e.continuousDynamicExpression?this.activeDynamicExpressions[i]=e.continuousDynamicExpression:e.instantaneousDynamicExpression&&(this.activeDynamicExpressions[i]=e.instantaneousDynamicExpression)),this.currentDynamicEntryIndex++}this.currentDynamicChangingExpressions=[];for(let t=0;t<this.activeDynamicExpressions.length;t++)if(this.activeDynamicExpressions[t]){let e,i;if(this.activeDynamicExpressions[t]instanceof a.ContinuousDynamicExpression){const s=this.activeDynamicExpressions[t];e=s.StartMultiExpression.AbsoluteTimestamp,i=s.EndMultiExpression.AbsoluteTimestamp,e.lte(this.CurrentSourceTimestamp)&&this.CurrentSourceTimestamp.lte(i)&&this.currentDynamicChangingExpressions.push(new r.DynamicsContainer(s,t))}else{const e=this.activeDynamicExpressions[t];this.CurrentSourceTimestamp.Equals(e.ParentMultiExpression.AbsoluteTimestamp)&&this.currentDynamicChangingExpressions.push(new r.DynamicsContainer(e,t))}}const e=this.musicSheet.TimestampSortedTempoExpressionsList;for(;this.currentTempoEntryIndex>0&&(this.currentTempoEntryIndex>=e.length||this.CurrentSourceTimestamp.lte(e[this.currentTempoEntryIndex].AbsoluteTimestamp));)this.currentTempoEntryIndex--;for(;this.currentTempoEntryIndex<e.length&&e[this.currentTempoEntryIndex].AbsoluteTimestamp.lt(this.CurrentSourceTimestamp);)this.currentTempoEntryIndex++;for(;this.currentTempoEntryIndex<e.length&&e[this.currentTempoEntryIndex].AbsoluteTimestamp.Equals(this.CurrentSourceTimestamp);)this.activeTempoExpression=e[this.currentTempoEntryIndex],this.currentTempoEntryIndex++;if(this.currentTempoChangingExpression=void 0,this.activeTempoExpression){let t=this.activeTempoExpression.AbsoluteTimestamp;this.activeTempoExpression.ContinuousTempo&&(t=this.activeTempoExpression.ContinuousTempo.AbsoluteEndTimestamp),(this.activeTempoExpression.AbsoluteTimestamp.lte(this.CurrentSourceTimestamp)||this.CurrentSourceTimestamp.lte(t))&&(this.currentTempoChangingExpression=this.activeTempoExpression)}}recursiveMoveBack(){if(this.currentVoiceEntryIndex>0){this.currentVoiceEntryIndex--;const t=this.currentMeasure.VerticalSourceStaffEntryContainers[this.currentVoiceEntryIndex];this.currentVoiceEntries=this.getVoiceEntries(t),this.currentVerticalContainerInMeasureTimestamp=t.Timestamp,this.currentTimeStamp=n.Fraction.plus(this.currentMeasure.AbsoluteTimestamp,this.currentVerticalContainerInMeasureTimestamp),this.activateCurrentDynamicOrTempoInstructions();const e=this.musicSheet.SelectionEnd;return e&&this.currentTimeStamp.lt(e)&&(this.endReached=!1),void(this.currentMeasureIndex=this.musicSheet.SourceMeasures.indexOf(this.CurrentMeasure))}if(0!==this.currentVoiceEntryIndex||0===this.currentMeasureIndex)this.frontReached=!0,this.currentTimeStamp=new n.Fraction(-1,1);else{const t=this.musicSheet.SourceMeasures[this.currentMeasureIndex-1];this.currentMeasureIndex--,this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex];const e=t.VerticalSourceStaffEntryContainers[t.VerticalSourceStaffEntryContainers.length-1];this.currentVoiceEntries=this.getVoiceEntries(e),this.currentVerticalContainerInMeasureTimestamp=e.Timestamp,this.currentVoiceEntryIndex=t.VerticalSourceStaffEntryContainers.length-1,this.currentTimeStamp=n.Fraction.plus(this.currentMeasure.AbsoluteTimestamp,e.Timestamp),this.activateCurrentDynamicOrTempoInstructions();const i=this.musicSheet.SelectionEnd;i&&this.currentTimeStamp.lt(i)&&(this.endReached=!1)}}recursiveMove(){if(this.currentVoiceEntryIndex++,0===this.currentVoiceEntryIndex&&(this.handleRepetitionsAtMeasureBegin(),this.activateCurrentRhythmInstructions()),this.currentVoiceEntryIndex>=0&&this.currentVoiceEntryIndex<this.currentMeasure.VerticalSourceStaffEntryContainers.length){const t=this.currentMeasure.VerticalSourceStaffEntryContainers[this.currentVoiceEntryIndex];this.currentVoiceEntries=this.getVoiceEntries(t),this.currentVerticalContainerInMeasureTimestamp=t.Timestamp,this.currentTimeStamp=n.Fraction.plus(this.currentMeasure.AbsoluteTimestamp,this.currentVerticalContainerInMeasureTimestamp);const e=this.musicSheet.SelectionEnd;return e&&this.currentTimeStamp.gte(e)&&(this.endReached=!0),void this.activateCurrentDynamicOrTempoInstructions()}if(this.currentEnrolledMeasureTimestamp.Add(this.currentMeasure.Duration),this.handleRepetitionsAtMeasureEnd(),this.currentMeasureIndex>=0&&this.currentMeasureIndex<this.musicSheet.SourceMeasures.length)return this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex],this.currentTimeStamp=n.Fraction.plus(this.currentMeasure.AbsoluteTimestamp,this.currentVerticalContainerInMeasureTimestamp),this.currentVoiceEntryIndex=-1,void this.recursiveMove();this.currentVerticalContainerInMeasureTimestamp=new n.Fraction,this.currentMeasure=void 0,this.currentVoiceEntries=void 0,this.endReached=!0}checkEntries(t){const e=this.CurrentVisibleVoiceEntries();if(e.length>0){if(!t)return!0;for(let t=0,i=e.length;t<i;++t)if(e[t].Notes[0].Pitch)return!0}return!1}getVisibleEntries(t,e){if(t.ParentVoice.Visible){let i=!1;for(const e of t.Notes)if(e.PrintObject){i=!0;break}if(!i&&this.SkipInvisibleNotes)return;e.push(t)}}getAudibleEntries(t,e){t.ParentVoice.Audible&&e.push(t)}getScoreFollowingEntries(t,e){t.ParentVoice.Following&&t.ParentVoice.Parent.Following&&e.push(t)}getVoiceEntries(t){const e=[];for(const i of t.StaffEntries)if(i)for(const t of i.VoiceEntries)e.push(t);return e}}e.MusicPartManagerIterator=h},4257:function(t,e,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(t,e,i,s){void 0===s&&(s=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,s,n)}:function(t,e,i,s){void 0===s&&(s=i),t[s]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||s(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(5278),e),n(i(301),e)},7514:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSheet=e.PlaybackSettings=void 0;const n=i(1797),r=i(5278),o=i(1717),a=i(2255),l=i(3884),h=i(9651),c=i(1405),u=i(8155),d=s(i(2043)),f=i(1274);class m{}e.PlaybackSettings=m;class p{constructor(){this.idString="uninitialized",this.sourceMeasures=[],this.repetitions=[],this.dynListStaves=[],this.timestampSortedDynamicExpressionsList=[],this.timestampSortedTempoExpressionsList=[],this.instrumentalGroups=[],this.instruments=[],this.musicPartManager=void 0,this.musicSheetErrors=new h.MusicSheetErrors,this.staves=[],this.transpose=0,this.defaultStartTempoInBpm=0,this.drawErroneousMeasures=!1,this.hasBeenOpenedForTheFirstTime=!1,this.currentEnrolledPosition=new n.Fraction(0,1),this.playbackSettings=new m,this.playbackSettings.rhythm=new n.Fraction(4,4,0,!1),this.userStartTempoInBPM=100,this.pageWidth=120,this.MusicPartManager=new r.MusicPartManager(this),this.hasBPMInfo=!1}static getIndexFromStaff(t){return t.idInMusicSheet}get SourceMeasures(){return this.sourceMeasures}set SourceMeasures(t){this.sourceMeasures=t}get Repetitions(){return this.repetitions}set Repetitions(t){this.repetitions=t}get DynListStaves(){return this.dynListStaves}get TimestampSortedTempoExpressionsList(){return this.timestampSortedTempoExpressionsList}get TimestampSortedDynamicExpressionsList(){return this.timestampSortedDynamicExpressionsList}get InstrumentalGroups(){return this.instrumentalGroups}get Parts(){return this.instruments}get Instruments(){return this.instruments}get SheetPlaybackSetting(){return this.playbackSettings}set SheetPlaybackSetting(t){this.playbackSettings=t}get DrawErroneousMeasures(){return this.drawErroneousMeasures}set DrawErroneousMeasures(t){this.drawErroneousMeasures=t}get HasBeenOpenedForTheFirstTime(){return this.hasBeenOpenedForTheFirstTime}set HasBeenOpenedForTheFirstTime(t){this.hasBeenOpenedForTheFirstTime=t}InitializeStartTempoInBPM(t){this.userStartTempoInBPM=t}get DefaultStartTempoInBpm(){return this.defaultStartTempoInBpm}set DefaultStartTempoInBpm(t){this.defaultStartTempoInBpm=t,this.InitializeStartTempoInBPM(t)}get Path(){return this.path}set Path(t){this.path=t}get Staves(){return this.staves}get TitleString(){return this.title?this.title.text:""}set TitleString(t){this.Title=new a.Label(t)}get SubtitleString(){return this.subtitle?this.subtitle.text:""}set SubtitleString(t){this.Subtitle=new a.Label(t)}get ComposerString(){return this.composer?this.composer.text:""}set ComposerString(t){this.Composer=new a.Label(t)}get LyricistString(){return this.lyricist?this.lyricist.text:""}set LyricistString(t){this.Lyricist=new a.Label(t)}get CopyrightString(){return this.copyright?this.copyright.text:""}set CopyrightString(t){this.Copyright=new a.Label(t,f.TextAlignmentEnum.CenterBottom,void 0,!0)}get Title(){return this.title}set Title(t){this.title=t}get Subtitle(){return this.subtitle}set Subtitle(t){this.subtitle=t}get Composer(){return this.composer}set Composer(t){this.composer=t}get Lyricist(){return this.lyricist}set Lyricist(t){this.lyricist=t}get Copyright(){return this.copyright}set Copyright(t){this.copyright=t}get Rules(){return this.rules||(d.default.debug("warning: sheet.Rules was undefined. Creating new EngravingRules."),this.rules=new c.EngravingRules),this.rules}set Rules(t){this.rules=t}get SheetErrors(){return this.musicSheetErrors}get SelectionStart(){return this.selectionStart}set SelectionStart(t){this.selectionStart=t.clone(),this.currentEnrolledPosition=t.clone()}get SelectionEnd(){return this.selectionEnd}set SelectionEnd(t){this.selectionEnd=t}set HasBPMInfo(t){this.hasBPMInfo=t}get HasBPMInfo(){return this.hasBPMInfo}addMeasure(t){this.sourceMeasures.push(t),t.measureListIndex=this.sourceMeasures.length-1}checkForInstrumentWithNoVoice(){for(let t=0,e=this.instruments.length;t<e;++t){const e=this.instruments[t];if(0===e.Voices.length){const t=new l.Voice(e,1);e.Voices.push(t)}}}getStaffFromIndex(t){return this.staves[t]}fillStaffList(){let t=0;for(let e=0,i=this.instruments.length;e<i;++e){const i=this.instruments[e];for(let e=0,s=i.Staves.length;e<s;++e){const s=i.Staves[e];s.idInMusicSheet=t,this.staves.push(s),t++}}}get MusicPartManager(){return this.musicPartManager}set MusicPartManager(t){this.musicPartManager=t}getCompleteNumberOfStaves(){let t=0;for(let e=0,i=this.instruments.length;e<i;++e)t+=this.instruments[e].Staves.length;return t}getListOfMeasuresFromIndeces(t,e){const i=[];for(let s=t;s<=e;s++)i.push(this.sourceMeasures[s]);return i}getNextSourceMeasure(t){const e=this.sourceMeasures.indexOf(t);return e===this.sourceMeasures.length-1?t:this.sourceMeasures[e+1]}getFirstSourceMeasure(){return this.sourceMeasures[0]}getLastSourceMeasure(){return this.sourceMeasures[this.sourceMeasures.length-1]}resetAllNoteStates(){const t=this.MusicPartManager.getIterator();for(;!t.EndReached&&t.CurrentVoiceEntries;){for(let e=0,i=t.CurrentVoiceEntries.length;e<i;++e){const i=t.CurrentVoiceEntries[e];for(let t=0,e=i.Notes.length;t<e;++t)i.Notes[t].state=u.NoteState.Normal}t.moveToNext()}}getMusicSheetInstrumentIndex(t){return this.Instruments.indexOf(t)}getGlobalStaffIndexOfFirstStaff(t){const e=this.getMusicSheetInstrumentIndex(t);let i=0;for(let t=0;t<e;t++)i+=this.Instruments[t].Staves.length;return i}setRepetitionNewUserNumberOfRepetitions(t,e){let i=0;for(let s=0;s<this.repetitions.length;s++)if(this.repetitions[s]instanceof o.Repetition){if(t===i){this.repetitions[s].UserNumberOfRepetitions=e;break}i++}}getRepetitionByIndex(t){let e=0;for(let i=0;i<this.repetitions.length;i++)if(this.repetitions[i]instanceof o.Repetition){if(t===e)return this.repetitions[i];e++}}CompareTo(t){return this.Title.text.localeCompare(t.Title.text)}getExpressionsStartTempoInBPM(){if(this.TimestampSortedTempoExpressionsList.length>0){const t=this.TimestampSortedTempoExpressionsList[0];if(t.InstantaneousTempo)return t.InstantaneousTempo.TempoInBpm;if(t.ContinuousTempo)return t.ContinuousTempo.StartTempo}return this.userStartTempoInBPM}get Errors(){return this.musicSheetErrors.measureErrors}get FirstMeasureNumber(){try{return this.getFirstSourceMeasure().MeasureNumber}catch(t){return d.default.info("MusicSheet.FirstMeasureNumber: ",t),0}}get LastMeasureNumber(){try{return this.getLastSourceMeasure().MeasureNumber}catch(t){return d.default.info("MusicSheet.LastMeasureNumber: ",t),0}}get CurrentEnrolledPosition(){return this.currentEnrolledPosition.clone()}set CurrentEnrolledPosition(t){this.currentEnrolledPosition=t.clone()}get Transpose(){return this.transpose}set Transpose(t){this.transpose=t}get FullNameString(){return this.ComposerString+" "+this.TitleString}get IdString(){return this.idString}set IdString(t){this.idString=t}getEnrolledSelectionStartTimeStampWorkaround(){const t=this.MusicPartManager.getIterator(this.SelectionStart);return n.Fraction.createFromFraction(t.CurrentEnrolledTimestamp)}get SheetEndTimestamp(){const t=this.getLastSourceMeasure();return n.Fraction.plus(t.AbsoluteTimestamp,t.Duration)}getSourceMeasureFromTimeStamp(t){for(let e=0,i=this.sourceMeasures.length;e<i;++e){const i=this.sourceMeasures[e];for(let e=0,s=i.VerticalSourceStaffEntryContainers.length;e<s;++e){const s=i.VerticalSourceStaffEntryContainers[e];if(t.Equals(s.getAbsoluteTimestamp()))return i}}return this.findSourceMeasureFromTimeStamp(t)}findSourceMeasureFromTimeStamp(t){for(const e of this.sourceMeasures)if(e.AbsoluteTimestamp.lte(t)&&t.lt(n.Fraction.plus(e.AbsoluteTimestamp,e.Duration)))return e}getVisibleInstruments(){const t=[];for(let e=0,i=this.Instruments.length;e<i;++e){const i=this.Instruments[e];i.Voices.length>0&&i.Voices[0].Visible&&t.push(i)}return t}}e.MusicSheet=p,p.defaultTitle="defaultTitle"},6656:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MappingSourceMusicPart=void 0,e.MappingSourceMusicPart=class{constructor(t,e,i,s=-1,n=!1){this.repetitionRun=-1,this.sourceMusicPart=t,this.parentPartListEntry=i,this.startTimestamp=e.clone(),this.repetitionRun=s,this.parentRepetition=i,this.isEnding=n}get IsRepetition(){return void 0!==this.parentRepetition}get IsEnding(){return this.isEnding}get IsLastRepetitionRun(){return this.IsRepetition&&this.repetitionRun+1===this.parentRepetition.UserNumberOfRepetitions}get RepetitionRun(){return this.repetitionRun}get ParentPartListEntry(){return this.parentPartListEntry}get SourceMusicPart(){return this.sourceMusicPart}get StartTimestamp(){return this.startTimestamp}CompareTo(t){return t?this.startTimestamp.CompareTo(t.startTimestamp):1}}},3766:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PartListEntry=void 0,e.PartListEntry=class{constructor(t){this.enrolledTimestamps=[],this.visible=!0,this.musicSheet=t}get Visible(){return this.visible}set Visible(t){this.visible=t}getFirstSourceMeasure(){return this.musicSheet.SourceMeasures[this.startIndex]}getLastSourceMeasure(){return this.musicSheet.SourceMeasures[this.endIndex]}}},1717:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.RepetitionEndingPart=e.Repetition=void 0;const n=i(8817),r=i(1797),o=i(3766),a=s(i(2043));class l extends o.PartListEntry{constructor(t,e){super(t),this.backwardJumpInstructions=[],this.endingParts=[],this.endingIndexDict={},this.userNumberOfRepetitions=0,this.visibles=[],this.fromWords=!1,this.repetitonIterationOrder=[],this.numberOfEndings=1,this.musicSheet2=t,this.virtualOverallRepetition=e}get BackwardJumpInstructions(){return this.backwardJumpInstructions}get EndingIndexDict(){return this.endingIndexDict}get EndingParts(){return this.endingParts}get Visibles(){return this.visibles}set Visibles(t){this.visibles=t}get DefaultNumberOfRepetitions(){let t=2;return this.virtualOverallRepetition&&(t=1),Math.max(t,Object.keys(this.endingIndexDict).length,this.checkRepetitionForMultipleLyricVerses())}get UserNumberOfRepetitions(){return this.userNumberOfRepetitions}set UserNumberOfRepetitions(t){this.userNumberOfRepetitions=t,this.repetitonIterationOrder=[];const e=this.userNumberOfRepetitions-this.NumberOfEndings;for(let t=1;t<=this.userNumberOfRepetitions;t++)t<=e?this.repetitonIterationOrder.push(1):this.repetitonIterationOrder.push(t-e)}getForwardJumpTargetForIteration(t){const e=this.repetitonIterationOrder[t-1];return this.endingIndexDict[e]?this.endingIndexDict[e].part.StartIndex:-1}getBackwardJumpTarget(){return this.startMarker.measureIndex}SetEndingStartIndex(t,e){const i=new h(new n.SourceMusicPart(this.musicSheet2,e,e));this.endingParts.push(i);for(const e of t)try{this.endingIndexDict[e]=i,i.endingIndices.push(e),this.numberOfEndings<e&&(this.numberOfEndings=e)}catch(t){a.default.error("Repetition: Exception.",t)}}setEndingEndIndex(t,e){this.endingIndexDict[t]&&this.endingIndexDict[t].part.setEndIndex(e)}get NumberOfEndings(){return this.numberOfEndings}get FromWords(){return this.fromWords}set FromWords(t){this.fromWords=t}get AbsoluteTimestamp(){return r.Fraction.createFromFraction(this.musicSheet2.SourceMeasures[this.startMarker.measureIndex].AbsoluteTimestamp)}get StartIndex(){return this.startMarker.measureIndex}get EndIndex(){if(0===this.BackwardJumpInstructions.length)return this.StartIndex;let t=this.backwardJumpInstructions[this.backwardJumpInstructions.length-1].measureIndex;return this.endingIndexDict[this.NumberOfEndings]&&(t=Math.max(this.endingIndexDict[this.NumberOfEndings].part.EndIndex,t)),t}checkRepetitionForMultipleLyricVerses(){let t=0;const e=this.StartIndex,i=this.EndIndex;for(let s=e;s<=i;s++){const e=this.musicSheet2.SourceMeasures[s];for(let i=0;i<e.CompleteNumberOfStaves;i++)for(const s of e.VerticalSourceStaffEntryContainers[i].StaffEntries)if(s){let e=0;for(const t of s.VoiceEntries)e+=Object.keys(t.LyricsEntries).length;t=Math.max(t,e)}}return t}get FirstSourceMeasureNumber(){return this.getFirstSourceMeasure().MeasureNumber}get LastSourceMeasureNumber(){return this.getLastSourceMeasure().MeasureNumber}}e.Repetition=l;class h{constructor(t){this.endingIndices=[],this.part=t}ToString(){return this.endingIndices.join(", ")}}e.RepetitionEndingPart=h},8817:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SourceMusicPart=void 0;const s=i(3766),n=i(1797);class r extends s.PartListEntry{constructor(t,e,i){super(t),this.musicSheet=t,this.startIndex=e,this.endIndex=i}get MeasuresCount(){return this.endIndex-this.startIndex+1}get StartIndex(){return this.startIndex}get EndIndex(){return this.endIndex}get ParentRepetition(){return this.parentRepetition}set ParentRepetition(t){this.parentRepetition=t}get AbsoluteTimestamp(){return n.Fraction.createFromFraction(this.musicSheet.SourceMeasures[this.startIndex].AbsoluteTimestamp)}setStartIndex(t){this.startIndex=t}setEndIndex(t){this.endIndex=t}}e.SourceMusicPart=r},4990:function(t,e,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(t,e,i,s){void 0===s&&(s=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,s,n)}:function(t,e,i,s){void 0===s&&(s=i),t[s]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||s(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(6656),e),n(i(3766),e),n(i(1717),e),n(i(8817),e)},2393:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.InstrumentReader=void 0;const n=i(8109),r=i(9050),o=i(289),a=i(5198),l=i(3331),h=i(1797),c=i(6331),u=i(1703),d=i(289),f=i(3331),m=i(5198),p=s(i(2043)),b=i(289),g=i(2905),S=i(4671),y=i(3755),E=i(908),v=i(2478),x=i(6894);e.InstrumentReader=class{constructor(t,e,i,s){this.voiceGeneratorsDict={},this.staffMainVoiceGeneratorDict={},this.divisions=0,this.currentClefNumber=1,this.currentXmlMeasureIndex=0,this.activeKeyHasBeenInitialized=!1,this.abstractInstructions=[],this.repetitionInstructionReader=e,this.xmlMeasureList=i,this.musicSheet=s.GetMusicSheet,this.instrument=s,this.activeClefs=new Array(s.Staves.length),this.activeClefsHaveBeenInitialized=new Array(s.Staves.length);for(let t=0;t<s.Staves.length;t++)this.activeClefsHaveBeenInitialized[t]=!1;this.createExpressionGenerators(s.Staves.length),this.slurReader=new y.SlurReader(this.musicSheet),this.pluginManager=t}get ActiveKey(){return this.activeKey}get MaxTieNoteFraction(){return this.maxTieNoteFraction}get ActiveRhythm(){return this.activeRhythm}set ActiveRhythm(t){this.activeRhythm=t}readNextXmlMeasure(t,e,i){var s,n,r;if(this.currentXmlMeasureIndex>=this.xmlMeasureList.length)return!1;this.currentMeasure=t,this.followingMultirestMeasures=Math.max(this.followingMultirestMeasures-1,0),this.inSourceMeasureInstrumentIndex=this.musicSheet.getGlobalStaffIndexOfFirstStaff(this.instrument),this.repetitionInstructionReader&&this.repetitionInstructionReader.prepareReadingMeasure(t,this.currentXmlMeasureIndex);let o=new h.Fraction(0,1),a=new h.Fraction(0,1),l=!1;this.maxTieNoteFraction=new h.Fraction(0,1);let d=!1;try{const f=this.xmlMeasureList[this.currentXmlMeasureIndex],m=f.elements();if(t.Rules.UseXMLMeasureNumbers&&!Number.isInteger(t.MeasureNumberXML)){const e=parseInt(null===(s=f.attribute("number"))||void 0===s?void 0:s.value,10);Number.isInteger(e)&&(t.MeasureNumberXML=e)}let b;for(let s=0;s<m.length;s++){const f=m[s];if(s>0&&(b=m[s-1]),"print"===f.name){const e=f.attribute("new-system");"yes"===(null==e?void 0:e.value)&&(t.printNewSystemXml=!0);const i=f.attribute("new-page");"yes"===(null==i?void 0:i.value)&&(t.printNewPageXml=!0)}else if("attributes"===f.name){const e=f.element("divisions");if(e&&(this.divisions=parseInt(e.value,10),isNaN(this.divisions))){const t=c.ITextTranslation.translateText("ReaderErrorMessages/DivisionError","Invalid divisions value at Instrument: ");if(p.default.debug("InstrumentReader.readNextXmlMeasure",t),this.divisions=this.readDivisionsFromNotes(),!(this.divisions>0))throw l=!0,new u.MusicSheetReadingException(t+this.instrument.Name);this.musicSheet.SheetErrors.push(t+this.instrument.Name)}if(!f.element("divisions")&&0===this.divisions&&0===this.currentXmlMeasureIndex){const t=c.ITextTranslation.translateText("ReaderErrorMessages/DivisionError","Invalid divisions value at Instrument: ");if(this.divisions=this.readDivisionsFromNotes(),!(this.divisions>0))throw l=!0,new u.MusicSheetReadingException(t+this.instrument.Name);this.musicSheet.SheetErrors.push(t+this.instrument.Name)}this.addAbstractInstruction(f,i,b,o.clone()),o.Equals(new h.Fraction(0,1))&&this.isAttributesNodeAtBeginOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex],f)&&this.saveAbstractInstructionList(this.instrument.Staves.length,!0),this.isAttributesNodeAtEndOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex],f,o)&&this.saveClefInstructionAtEndOfMeasure();const s=f.elements("staff-details");for(const t of s){const e=t.element("staff-lines");if(e){let i=1;const s=t.attribute("number");s&&(i=parseInt(s.value,10)),this.instrument.Staves[i-1].StafflineCount=parseInt(e.value,10)}}const n=f.element("measure-style");if(n){const e=n.element("multiple-rest");if(e){const i=e.value;let s=0;try{s=Number.parseInt(i,10),void 0!==t.multipleRestMeasures&&s!==t.multipleRestMeasures?t.multipleRestMeasures=0:(t.multipleRestMeasures=s,this.currentMultirestStartMeasure=t,this.followingMultirestMeasures=s+1)}catch(t){console.log("multirest parse error: "+t)}}}}else if("note"===f.name){let t=!0;"no"===(null===(n=f.attribute("print-object"))||void 0===n?void 0:n.value)&&(t=!1);const s=this.getNoteStaff(f);this.currentStaff=this.instrument.Staves[s-1];const r=void 0!==f.element("chord");if(f.element("voice")){const t=parseInt(f.element("voice").value,10);this.currentVoiceGenerator=this.getOrCreateVoiceGenerator(t,s-1)}else r&&this.currentVoiceGenerator||(this.currentVoiceGenerator=this.getOrCreateVoiceGenerator(1,s-1));let l,u=0,m=new h.Fraction(0,1),b=2,g=!1;if(f.element("duration")){if(u=parseInt(f.element("duration").value,10),isNaN(u)){const t=c.ITextTranslation.translateText("ReaderErrorMessages/NoteDurationError","Invalid Note Duration.");this.musicSheet.SheetErrors.pushMeasureError(t),p.default.debug("InstrumentReader.readNextXmlMeasure",t);continue}if(m=new h.Fraction(u,4*this.divisions),0===u?m=this.getNoteDurationFromTypeNode(f):l=this.getNoteDurationFromTypeNode(f),f.element("time-modification")){m=this.getNoteDurationForTuplet(f);const t=f.element("time-modification");(null==t?void 0:t.element("normal-notes"))&&(b=parseInt(t.element("normal-notes").value,10)),g=!0}}const S=void 0!==f.element("rest"),y=f.combinedElement("notations"),E=void 0!==f.element("grace")||0===u||r&&d;let v=!1,x=!1;if(E){const t=f.element("grace");t&&t.attributes()&&t.attribute("slash")&&"yes"===t.attribute("slash").value&&(v=!0),m=this.getNoteDurationFromTypeNode(f),y&&y.element("slur")&&(x=!0)}const[_,M]=this.getCueNoteAndNoteTypeXml(f),[w,P,T]=this.getStemDirectionAndColors(f);let L=0,A=!1;if(y){const t=y.element("ornaments");t&&(L=this.getTremoloStrokes(t),A=this.getVibratoStrokes(t))}const C=r?a.clone():o.clone();this.currentStaffEntry=this.currentMeasure.findOrCreateStaffEntry(C,this.inSourceMeasureInstrumentIndex+s-1,this.currentStaff).staffEntry,(!this.currentVoiceGenerator.hasVoiceEntry()||!r&&!E&&!d||E&&!d||E&&!r||!E&&d)&&this.currentVoiceGenerator.createVoiceEntry(C,this.currentStaffEntry,!S&&!E,E,v,x),E||r||(a=o.clone(),o.Add(m)),r&&void 0!==this.currentStaffEntry&&this.currentStaffEntry.ParentStaff!==this.currentStaff&&(this.currentStaffEntry=this.currentVoiceGenerator.checkForStaffEntryLink(this.inSourceMeasureInstrumentIndex+s-1,this.currentStaff,this.currentStaffEntry,this.currentMeasure));const I=void 0!==this.currentStaffEntry&&void 0!==this.currentStaffEntry.Timestamp&&this.currentStaffEntry.Timestamp.Equals(new h.Fraction(0,1))&&!this.currentStaffEntry.hasNotes();this.saveAbstractInstructionList(this.instrument.Staves.length,I),this.activeRhythm,g||E||(m=new h.Fraction(u,4*this.divisions));const R=f.elements("dot").length;if(this.currentVoiceGenerator.read(f,m,l,M,b,S,this.currentStaffEntry,this.currentMeasure,e,this.maxTieNoteFraction,r,i,t,_,E,w,L,P,T,A,R),void 0!==y&&y.element("dynamics")){const t=this.expressionReaders[this.readExpressionStaffNumber(f)-1];t&&(t.readExpressionParameters(f,this.instrument,this.divisions,o,a,this.currentMeasure.MeasureNumber,!1),t.read(f,this.currentMeasure,a))}d=E}else if("forward"===f.name){const t=parseInt(f.element("duration").value,10);o.Add(new h.Fraction(t,4*this.divisions))}else if("backup"===f.name){const t=parseInt(f.element("duration").value,10);o.Sub(new h.Fraction(t,4*this.divisions)),o.IsNegative()&&(o=new h.Fraction(0,1)),a.Sub(new h.Fraction(t,4*this.divisions)),a.IsNegative()&&(a=new h.Fraction(0,1))}else if("direction"===f.name){const t=f.element("direction-type");let e=Math.min(1,o.RealValue);void 0!==this.activeRhythm&&this.activeRhythm.Rhythm&&(e/=this.activeRhythm.Rhythm.RealValue);let i=!1;if(this.repetitionInstructionReader&&(i=this.repetitionInstructionReader.handleRepetitionInstructionsFromWordsOrSymbols(t,e)),!i){let e=this.expressionReaders[0];const i=this.readExpressionStaffNumber(f)-1;i<this.expressionReaders.length&&(e=this.expressionReaders[i]),e&&(t.element("octave-shift")&&(e.readExpressionParameters(f,this.instrument,this.divisions,o,a,this.currentMeasure.MeasureNumber,!0),e.addOctaveShift(f,this.currentMeasure,a.clone())),t.element("pedal")&&(e.readExpressionParameters(f,this.instrument,this.divisions,o,a,this.currentMeasure.MeasureNumber,!0),e.addPedalMarking(f,this.currentMeasure,o.clone())),e.readExpressionParameters(f,this.instrument,this.divisions,o,a,this.currentMeasure.MeasureNumber,!1),e.read(f,this.currentMeasure,o,a.clone()))}}else if("barline"===f.name){this.repetitionInstructionReader&&this.repetitionInstructionReader.handleLineRepetitionInstructions(f)&&(this.currentMeasure.HasEndLine=!0);const t=f.attribute("location");if(s===m.length-1||t&&"right"===t.value){const t=null===(r=f.element("bar-style"))||void 0===r?void 0:r.value;t&&(this.currentMeasure.endingBarStyleXml=t,this.currentMeasure.endingBarStyleEnum=x.SystemLinesEnumHelper.xmlBarlineStyleToSystemLinesEnum(t))}}else if("sound"===f.name)try{if(f.attribute("tempo")){const t=parseFloat(f.attribute("tempo").value);0===this.currentXmlMeasureIndex&&(this.musicSheet.DefaultStartTempoInBpm=t,this.musicSheet.HasBPMInfo=!0)}}catch(t){p.default.debug("InstrumentReader.readTempoInstruction",t)}else if("harmony"===f.name){const t=this.getNoteStaff(f);this.currentStaff=this.instrument.Staves[t-1];const e=o.clone();this.currentStaffEntry=this.currentMeasure.findOrCreateStaffEntry(e,this.inSourceMeasureInstrumentIndex+t-1,this.currentStaff).staffEntry,this.currentStaffEntry.ChordContainers.push(g.ChordSymbolReader.readChordSymbol(f,this.musicSheet,this.activeKey))}}for(const t in this.voiceGeneratorsDict)this.voiceGeneratorsDict.hasOwnProperty(t)&&this.voiceGeneratorsDict[t].checkForOpenBeam();if(this.currentXmlMeasureIndex===this.xmlMeasureList.length-1){for(let t=0;t<this.instrument.Staves.length;t++)this.activeClefsHaveBeenInitialized[t]||this.createDefaultClefInstruction(this.musicSheet.getGlobalStaffIndexOfFirstStaff(this.instrument)+t);this.activeKeyHasBeenInitialized||this.createDefaultKeyInstruction();for(let t=0;t<this.expressionReaders.length;t++){const e=this.expressionReaders[t];e&&e.closeOpenExpressions(this.currentMeasure,o)}}this.musicSheet.HasBPMInfo?0===t.TempoInBPM&&this.previousMeasure&&(this.currentMeasure.TempoInBPM=this.previousMeasure.TempoInBPM):this.currentMeasure.TempoInBPM=120}catch(t){if(l)throw new u.MusicSheetReadingException(t.Message);const e=c.ITextTranslation.translateText("ReaderErrorMessages/MeasureError","Error while reading Measure.");this.musicSheet.SheetErrors.pushMeasureError(e),p.default.debug("InstrumentReader.readNextXmlMeasure",e,t)}return this.previousMeasure=this.currentMeasure,this.currentXmlMeasureIndex+=1,!0}getStemDirectionAndColors(t){let e,i=E.StemDirectionType.Undefined;const s=t.element("stem");if(s){i=this.getStemDirectionType(s);const t=s.attribute("color");t&&(e=this.parseXmlColor(t.value))}let n=this.getNoteHeadColorXml(t);const r=this.getNoteColorXml(t);return r&&!n&&(n=r),r&&!e&&(e=r),[i,e,n]}parseXmlColor(t){if(t)return 7===t.length?t:9===t.length?"#"+t.substr(3):void 0}doCalculationsAfterDurationHasBeenSet(){for(const t in this.voiceGeneratorsDict)this.voiceGeneratorsDict.hasOwnProperty(t)&&this.voiceGeneratorsDict[t].checkOpenTies()}getOrCreateVoiceGenerator(t,e){const i=this.instrument.Staves[e];let s=this.voiceGeneratorsDict[t];if(s)-1===i.Voices.indexOf(s.GetVoice)&&i.Voices.push(s.GetVoice);else{const r=this.staffMainVoiceGeneratorDict[e];r?(s=new n.VoiceGenerator(this.pluginManager,i,t,this.slurReader,r.GetVoice),i.Voices.push(s.GetVoice),this.voiceGeneratorsDict[t]=s):(s=new n.VoiceGenerator(this.pluginManager,i,t,this.slurReader),i.Voices.push(s.GetVoice),this.voiceGeneratorsDict[t]=s,this.staffMainVoiceGeneratorDict[e]=s)}return s}createExpressionGenerators(t){this.expressionReaders=new Array(t);for(let e=0;e<t;e++)this.expressionReaders[e]=new S.ExpressionReader(this.musicSheet,this.instrument,e+1)}createDefaultClefInstruction(t){let e;e=this.musicSheet.SourceMeasures.length>0?this.musicSheet.SourceMeasures[0]:this.currentMeasure;const i=new o.ClefInstruction(d.ClefEnum.G,0,2);let s;e.FirstInstructionsStaffEntries[t]?(s=e.FirstInstructionsStaffEntries[t],s.removeFirstInstructionOfTypeClefInstruction()):(s=new r.SourceStaffEntry(void 0,void 0),e.FirstInstructionsStaffEntries[t]=s),i.Parent=s,s.Instructions.splice(0,0,i)}createDefaultKeyInstruction(){let t;t=this.musicSheet.SourceMeasures.length>0?this.musicSheet.SourceMeasures[0]:this.currentMeasure;const e=new a.KeyInstruction(void 0,0,m.KeyEnum.major);for(let i=this.inSourceMeasureInstrumentIndex;i<this.inSourceMeasureInstrumentIndex+this.instrument.Staves.length;i++)if(t.FirstInstructionsStaffEntries[i]){const s=t.FirstInstructionsStaffEntries[i];e.Parent=s,s.removeFirstInstructionOfTypeKeyInstruction(),s.Instructions[0]instanceof o.ClefInstruction?s.Instructions.splice(1,0,e):s.Instructions.splice(0,0,e)}else{const s=new r.SourceStaffEntry(void 0,void 0);t.FirstInstructionsStaffEntries[i]=s,e.Parent=s,s.Instructions.push(e)}}isAttributesNodeAtBeginOfMeasure(t,e){const i=t.elements(),s=i.indexOf(e);if(s>0&&"backup"===i[s-1].name)return!0;let n=-1;for(let t=0;t<i.length;t++)if("note"===i[t].name){n=t;break}return s<n&&n>0||n<0}isAttributesNodeAtEndOfMeasure(t,e,i){var s;if(i.Equals(null===(s=this.ActiveRhythm)||void 0===s?void 0:s.Rhythm))return!0;const n=t.elements().slice();let r=0;for(let t=0;t<n.length;t++)if(n[t]===e){r=t;break}let o=0;for(let t=r;t<n.length;t++)if("note"===n[t].name){o=t;break}return r>o}getNoteDurationFromTypeNode(t){const e=t.element("type");if(e){const t=e.value;return v.NoteTypeHandler.getNoteDurationFromType(t)}return new h.Fraction(0,4*this.divisions)}addAbstractInstruction(t,e,i,s){if(t.element("divisions")&&1===t.elements().length)return;const n=t.element("transpose");if(n){const t=n.element("chromatic");t&&(this.instrument.PlaybackTranspose=parseInt(t.value,10))}const r=t.elements("clef");let u;if(r.length>0)for(let t=0,e=r.length;t<e;++t){const e=r[t];let i=d.ClefEnum.G,n=2,a=1,l=0;const h=e.element("line");if(h)try{n=parseInt(h.value,10)}catch(t){u=c.ITextTranslation.translateText("ReaderErrorMessages/ClefLineError","Invalid clef line. Using default."),this.musicSheet.SheetErrors.pushMeasureError(u),n=2,p.default.debug("InstrumentReader.addAbstractInstruction",u,t)}const f=e.element("sign");if(f)try{i=d.ClefEnum[f.value],o.ClefInstruction.isSupportedClef(i)||(u=c.ITextTranslation.translateText("ReaderErrorMessages/ClefError","Unsupported clef. Using default."),this.musicSheet.SheetErrors.pushMeasureError(u),i=d.ClefEnum.G,n=2),i===d.ClefEnum.TAB&&(l=-1)}catch(t){u=c.ITextTranslation.translateText("ReaderErrorMessages/ClefError","Invalid clef. Using default."),this.musicSheet.SheetErrors.pushMeasureError(u),i=d.ClefEnum.G,n=2,p.default.debug("InstrumentReader.addAbstractInstruction",u,t)}const m=e.element("clef-octave-change");if(m)try{l=parseInt(m.value,10)}catch(t){u=c.ITextTranslation.translateText("ReaderErrorMessages/ClefOctaveError","Invalid clef octave. Using default."),this.musicSheet.SheetErrors.pushMeasureError(u),l=0}if(e.hasAttributes&&e.attribute("number"))try{a=parseInt(e.attribute("number").value,10),a>this.currentClefNumber&&(a=this.currentClefNumber),this.currentClefNumber=a+1}catch(t){u=c.ITextTranslation.translateText("ReaderErrorMessages/ClefError","Invalid clef. Using default."),this.musicSheet.SheetErrors.pushMeasureError(u),a=1,this.currentClefNumber=a+1}const b=new o.ClefInstruction(i,l,n);this.abstractInstructions.push([a,b,s])}if(void 0!==t.element("key")&&this.instrument.MidiInstrumentId!==b.MidiInstrument.Percussion){let e=0;const i=t.element("key").element("fifths");if(i)try{e=parseInt(i.value,10)}catch(t){u=c.ITextTranslation.translateText("ReaderErrorMessages/KeyError","Invalid key. Set to default."),this.musicSheet.SheetErrors.pushMeasureError(u),e=0,p.default.debug("InstrumentReader.addAbstractInstruction",u,t)}let n=m.KeyEnum.none,r=t.element("key");if(r&&(r=r.element("mode")),r)try{n=m.KeyEnum[r.value]}catch(t){u=c.ITextTranslation.translateText("ReaderErrorMessages/KeyError","Invalid key/mode. Set to default."),this.musicSheet.SheetErrors.pushMeasureError(u),n=m.KeyEnum.major,p.default.debug("InstrumentReader.addAbstractInstruction",u,t)}const o=new a.KeyInstruction(void 0,e,n);this.abstractInstructions.push([1,o,s])}if(t.element("time")){const e=t.element("time");let i=f.RhythmSymbolEnum.NONE,n=!0;if(void 0!==e&&e.hasAttributes){const t=e.attribute("symbol");t&&("common"===t.value?i=f.RhythmSymbolEnum.COMMON:"cut"===t.value&&(i=f.RhythmSymbolEnum.CUT));const s=e.attribute("print-object");s&&"no"===s.value&&(n=!1)}let r=0,o=0;const a=e&&void 0!==e.element("senza-misura"),d=t.elements("time"),m=[],b=[];for(let t=0,e=d.length;t<e;++t){const e=d[t];m.push.apply(m,e.elements("beats")),b.push.apply(b,e.elements("beat-type"))}if(a)this.abstractInstructions.push([1,new l.RhythmInstruction(new h.Fraction(4,4,0,!1),f.RhythmSymbolEnum.NONE),s]);else{try{if(void 0!==m&&m.length>0&&void 0!==b&&m.length===b.length){const t=m.length,e=new Array(t);let i=0;for(let s=0;s<t;s++){const t=m[s].value;let n=0,r=0;if(-1!==t.indexOf("+")){const e=t.split("+");for(let t=0,i=e.length;t<i;++t)n+=parseInt(e[t],10)}else n=parseInt(t,10);r=parseInt(b[s].value,10),i=Math.max(i,r),e[s]=new h.Fraction(n,r,0,!1)}for(let s=0;s<t;s++)e[s].Denominator===i?r+=e[s].Numerator:r+=i/e[s].Denominator*e[s].Numerator;o=i}else r=parseInt(t.element("time").element("beats").value,10),o=parseInt(t.element("time").element("beat-type").value,10)}catch(t){u=c.ITextTranslation.translateText("ReaderErrorMessages/RhythmError","Invalid rhythm. Set to default."),this.musicSheet.SheetErrors.pushMeasureError(u),r=4,o=4,p.default.debug("InstrumentReader.addAbstractInstruction",u,t)}const e=new l.RhythmInstruction(new h.Fraction(r,o,0,!1),i);e.PrintObject=n,this.abstractInstructions.push([1,e,s])}}}saveAbstractInstructionList(t,e){for(let i=this.abstractInstructions.length-1;i>=0;i--){const s=this.abstractInstructions[i],n=s[0],h=s[1],c=s[2];if(h instanceof o.ClefInstruction){const t=h;if(0===this.currentXmlMeasureIndex||n<=this.activeClefs.length&&t!==this.activeClefs[n-1])if(e||void 0===this.currentStaffEntry||this.currentStaffEntry.hasNotes()||n-1!==this.instrument.Staves.indexOf(this.currentStaffEntry.ParentStaff))if(e){if(0!==c.RealValue)continue;let e;if(this.currentMeasure){const s=t,a=this.inSourceMeasureInstrumentIndex+n-1,l=this.currentMeasure.FirstInstructionsStaffEntries[a];if(0===this.currentXmlMeasureIndex)if(l)if(void 0===this.currentMeasure.FirstInstructionsStaffEntries[a]||l.Instructions[0]instanceof o.ClefInstruction){const t=new r.SourceStaffEntry(void 0,void 0);this.currentMeasure.LastInstructionsStaffEntries[a]=t,s.Parent=t,t.Instructions.push(s)}else e=l,s.Parent=e,e.removeFirstInstructionOfTypeClefInstruction(),e.Instructions.splice(0,0,s),this.activeClefsHaveBeenInitialized[n-1]=!0;else e=new r.SourceStaffEntry(void 0,void 0),this.currentMeasure.FirstInstructionsStaffEntries[a]=e,s.Parent=e,e.Instructions.push(s),this.activeClefsHaveBeenInitialized[n-1]=!0;else if(this.activeClefsHaveBeenInitialized[n-1]){let t=this.previousMeasure;this.followingMultirestMeasures>0&&this.currentMeasure.Rules.RenderMultipleRestMeasures&&(t=this.currentMultirestStartMeasure);const e=new r.SourceStaffEntry(void 0,void 0);t.LastInstructionsStaffEntries[a]=e,s.Parent=e,e.Instructions.push(s)}else{const t=this.musicSheet.SourceMeasures[0];t.FirstInstructionsStaffEntries[a]?(e=t.FirstInstructionsStaffEntries[a],e.removeFirstInstructionOfTypeClefInstruction()):e=new r.SourceStaffEntry(void 0,void 0),s.Parent=e,e.Instructions.splice(0,0,s),this.activeClefsHaveBeenInitialized[n-1]=!0}this.activeClefs[n-1]=t,this.abstractInstructions.splice(i,1)}}else{let e;const s=this.activeRhythm.Rhythm;s.RealValue>0&&c.RealValue/s.RealValue>.9&&(this.currentMeasure.LastInstructionsStaffEntries[n-1]||(this.currentMeasure.LastInstructionsStaffEntries[n-1]=new r.SourceStaffEntry(void 0,this.instrument.Staves[n-1])),e=this.currentMeasure.LastInstructionsStaffEntries[n-1]),e&&(t.Parent=e,e.Instructions.push(t),this.activeClefs[n-1]=t,this.abstractInstructions.splice(i,1))}else{const e=t,s=this.currentStaffEntry;if(c&&Math.abs(c.RealValue-s.Timestamp.RealValue)>.01)continue;e.Parent=s,s.removeFirstInstructionOfTypeClefInstruction(),s.Instructions.push(e),this.activeClefs[n-1]=t,this.abstractInstructions.splice(i,1)}else n<=this.activeClefs.length&&t===this.activeClefs[n-1]&&this.abstractInstructions.splice(i,1)}if(h instanceof a.KeyInstruction){const e=h;if(this.activeKey&&this.activeKey.Key===e.Key)this.abstractInstructions.splice(i,1);else{let s;if(this.activeKey=e,this.abstractInstructions.splice(i,1),this.activeKeyHasBeenInitialized?s=this.currentMeasure:(this.activeKeyHasBeenInitialized=!0,s=this.currentXmlMeasureIndex>0?this.musicSheet.SourceMeasures[0]:this.currentMeasure),s)for(let i=this.inSourceMeasureInstrumentIndex;i<this.inSourceMeasureInstrumentIndex+t;i++){const t=e;if(s.FirstInstructionsStaffEntries[i]){const e=s.FirstInstructionsStaffEntries[i];t.Parent=e,e.removeFirstInstructionOfTypeKeyInstruction(),0===e.Instructions.length?e.Instructions.push(t):e.Instructions[0]instanceof o.ClefInstruction?e.Instructions.splice(1,0,t):e.Instructions.splice(0,0,t)}else{const e=new r.SourceStaffEntry(void 0,void 0);s.FirstInstructionsStaffEntries[i]=e,t.Parent=e,e.Instructions.push(t)}}}}if(h instanceof l.RhythmInstruction){const e=h;if(this.activeRhythm&&this.activeRhythm===e)this.abstractInstructions.splice(i,1);else if(this.activeRhythm=e,this.abstractInstructions.splice(i,1),this.currentMeasure)for(let i=this.inSourceMeasureInstrumentIndex;i<this.inSourceMeasureInstrumentIndex+t;i++){const t=e;let s;this.currentMeasure.FirstInstructionsStaffEntries[i]?(s=this.currentMeasure.FirstInstructionsStaffEntries[i],s.removeFirstInstructionOfTypeRhythmInstruction()):(s=new r.SourceStaffEntry(void 0,void 0),this.currentMeasure.FirstInstructionsStaffEntries[i]=s),t.Parent=s,s.Instructions.push(t)}}}}saveClefInstructionAtEndOfMeasure(){for(let t=this.abstractInstructions.length-1;t>=0;t--){const e=this.abstractInstructions[t][0],i=this.abstractInstructions[t][1];if(i instanceof o.ClefInstruction){const s=i;if(!this.activeClefs[e-1]||s.ClefType!==this.activeClefs[e-1].ClefType||s.ClefType===this.activeClefs[e-1].ClefType&&s.Line!==this.activeClefs[e-1].Line){const i=new r.SourceStaffEntry(void 0,void 0);this.currentMeasure.LastInstructionsStaffEntries[this.inSourceMeasureInstrumentIndex+e-1]=i;const n=s;n.Parent=i,i.Instructions.push(n),this.activeClefs[e-1]=s,this.abstractInstructions.splice(t,1)}}}}getNoteDurationForTuplet(t){let e=new h.Fraction(0,1);const i=this.getNoteDurationFromTypeNode(t);if(t.element("time-modification")){const s=t.element("time-modification");if(s&&void 0!==s.element("actual-notes")&&s.element("normal-notes")){const t=s.element("actual-notes"),n=s.element("normal-notes");if(void 0!==t&&n){const s=parseInt(t.value,10),r=parseInt(n.value,10);e=new h.Fraction(r*i.Numerator,s*i.Denominator)}}}return e}readExpressionStaffNumber(t){let e=1;if(t.element("staff")){const i=t.element("staff");if(i)try{e=parseInt(i.value,10)}catch(t){const i=c.ITextTranslation.translateText("ReaderErrorMessages/ExpressionStaffError","Invalid Expression staff number. Set to default.");this.musicSheet.SheetErrors.pushMeasureError(i),e=1,p.default.debug("InstrumentReader.readExpressionStaffNumber",i,t)}}return e}readDivisionsFromNotes(){let t=0,e=this.currentXmlMeasureIndex,i=!1;for(;!i;){const s=this.xmlMeasureList[e].elements();for(let e=0,n=s.length;e<n;++e){const n=s[e];if("note"===n.name&&!n.element("time-modification")){const e=n.element("duration"),i=n.element("type");if(void 0!==e&&i){const s=i.value;let n=0;try{n=parseInt(e.value,10)}catch(t){p.default.debug("InstrumentReader.readDivisionsFromNotes",t);continue}switch(s){case"1024th":t=n/4*1024;break;case"512th":t=n/4*512;break;case"256th":t=n/4*256;break;case"128th":t=n/4*128;break;case"64th":t=n/4*64;break;case"32nd":t=n/4*32;break;case"16th":t=n/4*16;break;case"eighth":t=n/4*8;break;case"quarter":t=n/4*4;break;case"half":t=n/4*2;break;case"whole":t=n/4;break;case"breve":t=n/4/2;break;case"long":t=n/4/4;break;case"maxima":t=n/4/8}}}if(t>0){i=!0;break}}if(0===t&&(e++,e===this.xmlMeasureList.length)){const t=c.ITextTranslation.translateText("ReaderErrorMEssages/DivisionsError","Invalid divisions value at Instrument: ");throw new u.MusicSheetReadingException(t+this.instrument.Name)}}return t}getCueNoteAndNoteTypeXml(t){let e=!1;t.element("cue")&&(e=!0);const i=t.element("type");let s=v.NoteType.UNDEFINED;if(i){const t=i.attribute("size");"cue"===(null==t?void 0:t.value)&&(e=!0),s=v.NoteTypeHandler.StringToNoteType(i.value)}return[e,s]}getStemDirectionType(t){switch(t.value){case"down":return E.StemDirectionType.Down;case"up":return E.StemDirectionType.Up;case"double":return E.StemDirectionType.Double;case"none":return E.StemDirectionType.None;default:return E.StemDirectionType.Undefined}}getNoteHeadColorXml(t){const e=t.element("notehead");if(e){const t=e.attribute("color");if(t)return this.parseXmlColor(t.value)}return null}getNoteColorXml(t){const e=t.attribute("color");return e?this.parseXmlColor(e.value):null}getTremoloStrokes(t){const e=t.element("tremolo");if(e){const t=e.attribute("type");if(t&&"single"===t.value){const t=parseInt(e.value,10);if(t>0)return t}}return 0}getVibratoStrokes(t){const e=t.element("wavy-line");if(void 0!==e){const t=e.attribute("type");if(t&&"start"===t.value)return!0}return!1}getNoteStaff(t){let e=1;return this.instrument.Staves.length>1&&t.element("staff")&&(e=parseInt(t.element("staff").value,10),isNaN(e)&&(p.default.debug("InstrumentReader.readNextXmlMeasure.get staff number"),e=1)),e}}},1372:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSheetReader=void 0;const n=i(7514),r=i(5942),o=i(1797),a=i(2393),l=i(6842),h=i(6331),c=i(1703),u=s(i(2043)),d=i(3331),f=i(3331),m=i(9050),p=i(884),b=i(5142),g=i(289),S=i(2255),y=i(8736),E=i(1405),v=i(2458),x=i(1274);class _{constructor(t,e=new E.EngravingRules){this.completeNumberOfStaves=0,this.pluginManager=new v.ReaderPluginManager,this.afterSheetReadingModules=t||[],this.repetitionInstructionReader=y.MusicSymbolModuleFactory.createRepetitionInstructionReader(),this.repetitionCalculator=y.MusicSymbolModuleFactory.createRepetitionCalculator(),this.rules=e}get PluginManager(){return this.pluginManager}get CompleteNumberOfStaves(){return this.completeNumberOfStaves}static doCalculationsAfterDurationHasBeenSet(t){for(const e of t)e.doCalculationsAfterDurationHasBeenSet()}createMusicSheet(t,e){try{return this._createMusicSheet(t,e)}catch(t){return void u.default.error("MusicSheetReader.CreateMusicSheet",t)}}_removeFromArray(t,e){const i=t.indexOf(e);-1!==i&&t.splice(i,1)}trimString(t){return t.replace(/^\s+|\s+$/g,"")}_lastElement(t){return t[t.length-1]}_createMusicSheet(t,e){const i=[];let s=0;if(this.musicSheet=new n.MusicSheet,this.musicSheet.Path=e,this.musicSheet.Rules=this.rules,!t)throw new c.MusicSheetReadingException("Undefined root element");this.pushSheetLabels(t,e);const a=t.element("part-list");if(!a)throw new c.MusicSheetReadingException("Undefined partListNode");const l=t.elements("part"),u=a.elements();this.initializeReading(u,l,i);let d=!0;this.currentFraction=new o.Fraction(0,1);let f=!1,m=t.element("identification");for(m&&(m=m.element("encoding")),m&&(m=m.element("software")),void 0!==m&&"Guitar Pro 5"===m.value&&(f=!0);d;){void 0!==this.currentMeasure&&this.currentMeasure.HasEndLine&&this.rules.NewPartAndSystemAfterFinalBarline&&(s=0),this.currentMeasure=new r.SourceMeasure(this.completeNumberOfStaves,this.musicSheet.Rules);for(const t of i)try{d=d&&t.readNextXmlMeasure(this.currentMeasure,this.currentFraction,f)}catch(t){const e=h.ITextTranslation.translateText("ReaderErrorMessages/InstrumentError","Error while reading instruments.");throw new c.MusicSheetReadingException(e,t)}d&&(this.musicSheet.addMeasure(this.currentMeasure),this.checkIfRhythmInstructionsAreSetAndEqual(i),this.checkSourceMeasureForNullEntries(),s=this.setSourceMeasureDuration(i,s),_.doCalculationsAfterDurationHasBeenSet(i),this.currentMeasure.AbsoluteTimestamp=this.currentFraction.clone(),this.musicSheet.SheetErrors.finalizeMeasure(this.currentMeasure.MeasureNumber),this.currentFraction.Add(this.currentMeasure.Duration),this.previousMeasure=this.currentMeasure)}this.repetitionInstructionReader&&(this.repetitionInstructionReader.removeRedundantInstructions(),this.repetitionCalculator&&this.repetitionCalculator.calculateRepetitions(this.musicSheet,this.repetitionInstructionReader.repetitionInstructions)),this.musicSheet.checkForInstrumentWithNoVoice(),this.musicSheet.fillStaffList();for(let t=0,e=this.afterSheetReadingModules.length;t<e;++t)this.afterSheetReadingModules[t].calculate(this.musicSheet);return this.musicSheet.userStartTempoInBPM=this.musicSheet.userStartTempoInBPM||this.musicSheet.DefaultStartTempoInBpm,this.musicSheet}initializeReading(t,e,i){const s=this.createInstrumentGroups(t);this.completeNumberOfStaves=this.getCompleteNumberOfStavesFromXml(e),0!==e.length&&(this.repetitionInstructionReader.MusicSheet=this.musicSheet,this.currentFraction=new o.Fraction(0,1),this.currentMeasure=void 0,this.previousMeasure=void 0);let n=0;for(const t of e){const e=t.attribute("id");if(e){const r=s[e.value],o=t.elements("measure");let l=1;try{l=this.getInstrumentNumberOfStavesFromXml(t)}catch(t){const e=h.ITextTranslation.translateText("ReaderErrorMessages/InstrumentStavesNumberError","Invalid number of staves at instrument: ");this.musicSheet.SheetErrors.push(e+r.Name);continue}r.createStaves(l),i.push(new a.InstrumentReader(this.pluginManager,this.repetitionInstructionReader,o,r)),this.repetitionInstructionReader&&(this.repetitionInstructionReader.xmlMeasureList[n]=o),n++}}}checkIfRhythmInstructionsAreSetAndEqual(t){const e=[];for(let t=0;t<this.completeNumberOfStaves;t++)if(this.currentMeasure.FirstInstructionsStaffEntries[t]){const i=this.currentMeasure.FirstInstructionsStaffEntries[t].Instructions[this.currentMeasure.FirstInstructionsStaffEntries[t].Instructions.length-1];i instanceof d.RhythmInstruction&&e.push(i)}let i=0,s=-1;for(let t=0,n=e.length;t<n;++t){const n=e[t];if(n.Rhythm.RealValue>i){if(this.areRhythmInstructionsMixed(e)&&n.SymbolEnum!==f.RhythmSymbolEnum.NONE)continue;i=n.Rhythm.RealValue,s=e.indexOf(n)}}if(e.length>0&&e.length<this.completeNumberOfStaves){const i=e[s].clone();for(let t=0;t<this.completeNumberOfStaves;t++)void 0===this.currentMeasure.FirstInstructionsStaffEntries[t]||this._lastElement(this.currentMeasure.FirstInstructionsStaffEntries[t].Instructions)instanceof d.RhythmInstruction||(this.currentMeasure.FirstInstructionsStaffEntries[t].removeAllInstructionsOfTypeRhythmInstruction(),this.currentMeasure.FirstInstructionsStaffEntries[t].Instructions.push(i.clone())),this.currentMeasure.FirstInstructionsStaffEntries[t]||(this.currentMeasure.FirstInstructionsStaffEntries[t]=new m.SourceStaffEntry(void 0,void 0),this.currentMeasure.FirstInstructionsStaffEntries[t].Instructions.push(i.clone()));for(let e=0,s=t.length;e<s;++e)t[e].ActiveRhythm=i}if(0===e.length&&this.currentMeasure===this.musicSheet.SourceMeasures[0]){const e=new d.RhythmInstruction(new o.Fraction(4,4,0,!1),f.RhythmSymbolEnum.NONE);for(let t=0;t<this.completeNumberOfStaves;t++)this.currentMeasure.FirstInstructionsStaffEntries[t]?this.currentMeasure.FirstInstructionsStaffEntries[t].removeAllInstructionsOfTypeRhythmInstruction():this.currentMeasure.FirstInstructionsStaffEntries[t]=new m.SourceStaffEntry(void 0,void 0),this.currentMeasure.FirstInstructionsStaffEntries[t].Instructions.push(e);for(let i=0,s=t.length;i<s;++i)t[i].ActiveRhythm=e}for(let t=0,n=e.length;t<n;++t){const n=e[t];if(n.Rhythm.RealValue<i&&this._lastElement(this.currentMeasure.FirstInstructionsStaffEntries[e.indexOf(n)].Instructions)instanceof d.RhythmInstruction){const t=this.currentMeasure.FirstInstructionsStaffEntries[e.indexOf(n)].Instructions;t[t.length-1]=e[s].clone()}Math.abs(n.Rhythm.RealValue-i)<1e-6&&n.SymbolEnum!==f.RhythmSymbolEnum.NONE&&this.areRhythmInstructionsMixed(e)&&(n.SymbolEnum=f.RhythmSymbolEnum.NONE)}}areRhythmInstructionsMixed(t){for(let e=1;e<t.length;e++)if(Math.abs(t[e].Rhythm.RealValue-t[0].Rhythm.RealValue)<1e-6&&t[e].SymbolEnum!==t[0].SymbolEnum)return!0;return!1}setSourceMeasureDuration(t,e){let i=new o.Fraction(0,1);const s=[];for(const e of t){s.push(e.MaxTieNoteFraction);const t=e.ActiveRhythm.Rhythm;i.lt(t)&&(i=new o.Fraction(t.Numerator,t.Denominator,0,!1))}const n=this.currentMeasure.calculateInstrumentsDuration(this.musicSheet,s);let r=new o.Fraction(0,1);for(const t of n)r.lt(t)&&(r=t);o.Fraction.Equal(r,i)?this.checkFractionsForEquivalence(r,i):r.lt(i)&&(r=this.currentMeasure.reverseCheck(this.musicSheet,r),this.checkFractionsForEquivalence(r,i)),this.currentMeasure.ImplicitMeasure=this.checkIfMeasureIsImplicit(r,i),this.currentMeasure.ImplicitMeasure||e++,this.currentMeasure.Duration=r,this.currentMeasure.ActiveTimeSignature=i,this.currentMeasure.MeasureNumber=e;for(let t=0;t<n.length;t++){const e=n[t];if(this.currentMeasure.ImplicitMeasure&&e!==r||!o.Fraction.Equal(e,i)&&!this.allInstrumentsHaveSameDuration(n,r)){const e=this.musicSheet.getGlobalStaffIndexOfFirstStaff(this.musicSheet.Instruments[t]);for(let i=0;i<this.musicSheet.Instruments[t].Staves.length;i++)if(!this.graphicalMeasureIsEmpty(e+i)){this.currentMeasure.setErrorInGraphicalMeasure(e+i,!0);const t=h.ITextTranslation.translateText("ReaderErrorMessages/MissingNotesError","Given Notes don't correspond to measure duration.");this.musicSheet.SheetErrors.pushMeasureError(t)}}}return e}checkFractionsForEquivalence(t,e){if(e.Denominator>t.Denominator){const i=e.Denominator/t.Denominator;t.expand(i)}}checkIfMeasureIsImplicit(t,e){return!(this.previousMeasure||!t.lt(e))||!!this.previousMeasure&&o.Fraction.plus(this.previousMeasure.Duration,t).Equals(e)}allInstrumentsHaveSameDuration(t,e){let i=0;for(let s=0,n=t.length;s<n;++s)t[s].Equals(e)&&i++;return i===t.length&&e!==new o.Fraction(0,1)}graphicalMeasureIsEmpty(t){let e=0;for(let i=0;i<this.currentMeasure.VerticalSourceStaffEntryContainers.length;i++)this.currentMeasure.VerticalSourceStaffEntryContainers[i].StaffEntries[t]||e++;return e===this.currentMeasure.VerticalSourceStaffEntryContainers.length}checkSourceMeasureForNullEntries(){for(let t=this.currentMeasure.VerticalSourceStaffEntryContainers.length-1;t>=0;t--)for(let e=this.currentMeasure.VerticalSourceStaffEntryContainers[t].StaffEntries.length-1;e>=0;e--){const i=this.currentMeasure.VerticalSourceStaffEntryContainers[t].StaffEntries[e];if(i)for(let t=i.VoiceEntries.length-1;t>=0;t--){const e=i.VoiceEntries[t];0===e.Notes.length&&(this._removeFromArray(e.ParentVoice.VoiceEntries,e),this._removeFromArray(i.VoiceEntries,e))}void 0!==i&&0===i.VoiceEntries.length&&(this.currentMeasure.VerticalSourceStaffEntryContainers[t].StaffEntries[e]=void 0)}for(let t=this.currentMeasure.VerticalSourceStaffEntryContainers.length-1;t>=0;t--){let e=0;for(let i=0,s=this.currentMeasure.VerticalSourceStaffEntryContainers[t].StaffEntries.length;i<s;++i)this.currentMeasure.VerticalSourceStaffEntryContainers[t].StaffEntries[i]||e++;e===this.currentMeasure.VerticalSourceStaffEntryContainers[t].StaffEntries.length&&this._removeFromArray(this.currentMeasure.VerticalSourceStaffEntryContainers,this.currentMeasure.VerticalSourceStaffEntryContainers[t])}}pushSheetLabels(t,e){this.readComposer(t),this.readTitle(t),this.readCopyright(t);try{this.musicSheet.Title&&this.musicSheet.Composer||this.readTitleAndComposerFromCredits(t)}catch(t){u.default.info("MusicSheetReader.pushSheetLabels","readTitleAndComposerFromCredits",t)}try{if(!this.musicSheet.Title){const t=Math.max(0,e.lastIndexOf("/"),e.lastIndexOf("\\")),i=e.substr(t).split(".",1);this.musicSheet.Title=new S.Label(i[0])}}catch(t){u.default.info("MusicSheetReader.pushSheetLabels","read title from file name",t)}}presentAttrsWithValue(t,e){for(const i of t.attributes())if(i.value===e)return!0;return!1}readComposer(t){const e=t.element("identification");if(e){const t=e.elements("creator");for(let e=0,i=t.length;e<i;++e){const i=t[e];if(i.hasAttributes){if(this.presentAttrsWithValue(i,"composer")){this.musicSheet.Composer=new S.Label(this.trimString(i.value));continue}(this.presentAttrsWithValue(i,"lyricist")||this.presentAttrsWithValue(i,"poet"))&&(this.musicSheet.Lyricist=new S.Label(this.trimString(i.value)))}}}}readCopyright(t){const e=t.elements("identification");if(e.length>0){const t=e[0].elements("rights");if(t.length>0)for(let e=0,i=t.length;e<i;++e){const i=t[e];if(i.value){this.musicSheet.Copyright=new S.Label(i.value,x.TextAlignmentEnum.CenterBottom,void 0,!0);break}}}}readTitleAndComposerFromCredits(t){var e,i,s;const n=this.computeSystemYCoordinates(t);if(0===n)return;let r,o,a,l=1,h=0;const c=t.elements("credit");for(let t=0,u=c.length;t<u;++t){const u=c[t];if(!u.attribute("page"))return;if("1"===u.attribute("page").value){let t;if(u){if(t=u.element("credit-words"),!t.attribute("justify"))break;const c=null===(e=t.attribute("justify"))||void 0===e?void 0:e.value,d=null===(i=t.attribute("default-y"))||void 0===i?void 0:i.value,f=null!=d,m=f?parseFloat(d):Number.MIN_VALUE;if(f&&m>n){if(!this.musicSheet.Title){const e=null===(s=t.attribute("font-size"))||void 0===s?void 0:s.value;if(e){const i=parseFloat(e);l<i&&(l=i,r=t.value)}}if(this.musicSheet.Subtitle||"right"!==c&&"left"!==c&&h<m&&(h=m,a?(o=a,a=t.value):a=t.value),void 0===this.musicSheet.Composer||!this.musicSheet.Lyricist)switch(c){case"right":this.musicSheet.Composer=new S.Label(this.trimString(t.value));break;case"left":this.musicSheet.Lyricist=new S.Label(this.trimString(t.value))}}}}}!this.musicSheet.Title&&r&&(this.musicSheet.Title=new S.Label(this.trimString(r))),!this.musicSheet.Subtitle&&o&&(this.musicSheet.Subtitle=new S.Label(this.trimString(o)))}computeSystemYCoordinates(t){if(!t.element("defaults"))return 0;let e=0,i=0;try{const i=t.element("defaults").element("page-layout").element("page-height").value;e=parseFloat(i)}catch(t){return u.default.info("MusicSheetReader.computeSystemYCoordinates(): couldn't find page height, not reading title/composer."),0}let s=!1;const n=t.elements("part");for(let t=0,e=n.length;t<e;++t){const e=n[t].elements("measure");for(let t=0,n=e.length;t<n;++t){const n=e[t];if(n.element("print")){const t=n.element("print").elements("system-layout");for(let e=0,n=t.length;e<n;++e){const n=t[e];if(n.element("top-system-distance")){const t=n.element("top-system-distance").value;i=parseFloat(t),s=!0;break}}break}}if(s)break}if(t.element("defaults").element("system-layout")&&t.element("defaults").element("system-layout").element("top-system-distance")){const e=t.element("defaults").element("system-layout").element("top-system-distance").value;i=parseFloat(e)}return 0===i?0:e-i}readTitle(t){const e=t.element("work");let i;e&&(i=e.element("work-title"),i&&i.value&&(this.musicSheet.Title=new S.Label(this.trimString(i.value))));const s=t.element("movement-title");let n="";if(s&&(this.musicSheet.Title?n=this.trimString(s.value):this.musicSheet.Title=new S.Label(this.trimString(s.value))),e){const t=e.element("work-number");if(t){const e=t.value;e&&(n=""===n?e:n+", "+e)}}n&&(this.musicSheet.Subtitle=new S.Label(n))}createInstrumentGroups(t){let e=0;const i={};let s;try{const n=t;for(let t=0,r=n.length;t<r;++t){const r=n[t];if("score-part"===r.name){const t=r.attribute("id").value,n=new l.Instrument(e,t,this.musicSheet,s);e++;const o=r.elements();for(let t=0,e=o.length;t<e;++t){const e=o[t];try{if("part-name"===e.name)n.Name=e.value,e.attribute("print-object")&&"no"===e.attribute("print-object").value&&(n.NameLabel.print=!1);else if("part-abbreviation"===e.name)n.PartAbbreviation=e.value;else if("score-instrument"===e.name){const t=new b.SubInstrument(n);t.idString=e.firstAttribute.value,n.SubInstruments.push(t);const i=e.element("instrument-name");i&&(t.name=i.value,t.setMidiInstrument(i.value))}else if("midi-instrument"===e.name){let t=n.getSubInstrument(e.firstAttribute.value);for(let i=0,s=n.SubInstruments.length;i<s;++i){const s=n.SubInstruments[i];if(s.idString===e.value){t=s;break}}const i=e.elements();for(let e=0,s=i.length;e<s;++e){const s=i[e];try{if("midi-channel"===s.name)10===parseInt(s.value,10)&&(n.MidiInstrumentId=g.MidiInstrument.Percussion);else if("midi-program"===s.name)n.SubInstruments.length>0&&n.MidiInstrumentId!==g.MidiInstrument.Percussion&&(t.midiInstrumentID=Math.max(0,parseInt(s.value,10)-1));else if("midi-unpitched"===s.name)t.fixedKey=Math.max(0,parseInt(s.value,10));else if("volume"===s.name)try{const e=parseFloat(s.value);t.volume=e/127}catch(t){u.default.debug("ExpressionReader.readExpressionParameters","read volume",t)}else if("pan"===s.name)try{const e=parseFloat(s.value);t.pan=e/64}catch(t){u.default.debug("ExpressionReader.readExpressionParameters","read pan",t)}}catch(t){u.default.info("MusicSheetReader.createInstrumentGroups midi settings: ",t)}}}}catch(t){u.default.info("MusicSheetReader.createInstrumentGroups: ",t)}}if(0===n.SubInstruments.length){const t=new b.SubInstrument(n);n.SubInstruments.push(t)}i[t]=n,s?(s.InstrumentalGroups.push(n),this.musicSheet.Instruments.push(n)):(this.musicSheet.InstrumentalGroups.push(n),this.musicSheet.Instruments.push(n))}else if("part-group"===r.name&&"start"===r.attribute("type").value){const t=new p.InstrumentalGroup("group",this.musicSheet,s);s?s.InstrumentalGroups.push(t):this.musicSheet.InstrumentalGroups.push(t),s=t}else if("part-group"===r.name&&"stop"===r.attribute("type").value&&s){if(1===s.InstrumentalGroups.length){const t=s.InstrumentalGroups[0];s.Parent?(s.Parent.InstrumentalGroups.push(t),this._removeFromArray(s.Parent.InstrumentalGroups,s)):(this.musicSheet.InstrumentalGroups.push(t),this._removeFromArray(this.musicSheet.InstrumentalGroups,s))}s=s.Parent}}}catch(t){const e=h.ITextTranslation.translateText("ReaderErrorMessages/InstrumentError","Error while reading Instruments");throw new c.MusicSheetReadingException(e,t)}for(let t=0,e=this.musicSheet.Instruments.length;t<e;++t){const e=this.musicSheet.Instruments[t];e.Name||(e.Name="Instr. "+e.IdString)}return i}getCompleteNumberOfStavesFromXml(t){let e=0;for(const i of t){const t=i.elements("measure");if(t.length>0){const i=t[0];if(i){let t=i.element("attributes");t&&(t=t.element("staves")),t?e+=parseInt(t.value,10):e++}}}if(isNaN(e)||e<=0){const t=h.ITextTranslation.translateText("ReaderErrorMessages/StaffError","Invalid number of staves.");throw new c.MusicSheetReadingException(t)}return e}getInstrumentNumberOfStavesFromXml(t){let e=0;const i=t.element("measure");if(i){const t=i.element("attributes");let s;t&&(s=t.element("staves")),e=t&&s?parseInt(s.value,10):1}if(isNaN(e)||e<=0){const t=h.ITextTranslation.translateText("ReaderErrorMessages/StaffError","Invalid number of Staves.");throw new c.MusicSheetReadingException(t)}return e}}e.MusicSheetReader=_},8736:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSymbolModuleFactory=void 0;const s=i(9934),n=i(6789);e.MusicSymbolModuleFactory=class{static createRepetitionInstructionReader(){return new s.RepetitionInstructionReader}static createRepetitionCalculator(){return new n.RepetitionCalculator}}},7677:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ArticulationReader=void 0;const n=i(908),r=s(i(2043)),o=i(1357),a=i(5922),l=i(3748),h=i(8640),c=i(1662),u=i(6943),d=i(8084);e.ArticulationReader=class{constructor(t){this.rules=t}getAccEnumFromString(t){switch(t){case"sharp":return h.AccidentalEnum.SHARP;case"flat":return h.AccidentalEnum.FLAT;case"natural":return h.AccidentalEnum.NATURAL;case"double-sharp":case"sharp-sharp":return h.AccidentalEnum.DOUBLESHARP;case"double-flat":case"flat-flat":return h.AccidentalEnum.DOUBLEFLAT;case"triple-sharp":return h.AccidentalEnum.TRIPLESHARP;case"triple-flat":return h.AccidentalEnum.TRIPLEFLAT;case"quarter-sharp":return h.AccidentalEnum.QUARTERTONESHARP;case"quarter-flat":return h.AccidentalEnum.QUARTERTONEFLAT;case"three-quarters-sharp":return h.AccidentalEnum.THREEQUARTERSSHARP;case"three-quarters-flat":return h.AccidentalEnum.THREEQUARTERSFLAT;case"slash-quarter-sharp":return h.AccidentalEnum.SLASHQUARTERSHARP;case"slash-sharp":return h.AccidentalEnum.SLASHSHARP;case"double-slash-flat":return h.AccidentalEnum.DOUBLESLASHFLAT;case"sori":return h.AccidentalEnum.SORI;case"koron":return h.AccidentalEnum.KORON;default:return h.AccidentalEnum.NONE}}addArticulationExpression(t,e){var i,s;if(void 0!==t&&t.elements().length>0){const o=t.elements();for(let t=0,a=o.length;t<a;++t){const a=o[t];let h=a.name;try{h=h.replace("-","");const t=n.ArticulationEnum[h];if(n.VoiceEntry.isSupportedArticulation(t)){let r=l.PlacementEnum.NotYetDefined;const o=null===(i=a.attribute("placement"))||void 0===i?void 0:i.value;"above"===o?r=l.PlacementEnum.Above:"below"===o&&(r=l.PlacementEnum.Below);const f=new c.Articulation(t,r);if("staccato"===h)e.Articulations.length>0&&e.Articulations[0].articulationEnum!==n.ArticulationEnum.staccato&&e.Articulations.splice(0,0,f);else if("breathmark"===h)r===l.PlacementEnum.NotYetDefined&&(f.placement=l.PlacementEnum.Above);else if("strongaccent"===h){const t=null===(s=null==a?void 0:a.attribute("type"))||void 0===s?void 0:s.value;"up"===t?f.articulationEnum=n.ArticulationEnum.marcatoup:"down"===t&&(f.articulationEnum=n.ArticulationEnum.marcatodown)}else if(t===n.ArticulationEnum.softaccent){const t=e.ParentSourceStaffEntry.ParentStaff.Id-1;r===l.PlacementEnum.NotYetDefined&&(r=l.PlacementEnum.Above,t>0&&(r=l.PlacementEnum.Below));const i=e.ParentSourceStaffEntry.VerticalContainerParent.ParentMeasure,s=new u.MultiExpression(i,e.Timestamp);s.StartingContinuousDynamic=new d.ContinuousDynamicExpression(d.ContDynamicEnum.crescendo,r,t,i,-1),s.StartingContinuousDynamic.IsStartOfSoftAccent=!0,s.StartingContinuousDynamic.StartMultiExpression=s,s.StartingContinuousDynamic.EndMultiExpression=s,s.EndingContinuousDynamic=new d.ContinuousDynamicExpression(d.ContDynamicEnum.diminuendo,r,t,i,-1),s.EndingContinuousDynamic.StartMultiExpression=s,s.EndingContinuousDynamic.EndMultiExpression=s,i.StaffLinkedExpressions[t].push(s)}e.hasArticulation(f)||e.Articulations.push(f)}}catch(t){const e="Invalid note articulation.";return void r.default.debug("addArticulationExpression",e,t)}}}}addFermata(t,e){var i;let s=n.ArticulationEnum.fermata;t.attributes().length>0&&t.attribute("type")&&"inverted"===t.attribute("type").value&&(s=n.ArticulationEnum.invertedfermata);let r=l.PlacementEnum.Above;"below"===(null===(i=t.attribute("placement"))||void 0===i?void 0:i.value)&&(r=l.PlacementEnum.Below),e.Articulations.push(new c.Articulation(s,r))}addTechnicalArticulations(t,e,i){var s,r;const a={bend:n.ArticulationEnum.bend,"down-bow":n.ArticulationEnum.downbow,"open-string":n.ArticulationEnum.naturalharmonic,"snap-pizzicato":n.ArticulationEnum.snappizzicato,stopped:n.ArticulationEnum.lefthandpizzicato,"up-bow":n.ArticulationEnum.upbow,harmonic:n.ArticulationEnum.naturalharmonic};for(const i in a){if(!a.hasOwnProperty(i))continue;const n=a[i],o=t.element(i);if(o){let t;"above"===(null===(s=o.attribute("placement"))||void 0===s?void 0:s.value)&&(t=l.PlacementEnum.Above),"below"===(null===(r=o.attribute("placement"))||void 0===r?void 0:r.value)&&(t=l.PlacementEnum.Below);const i=new c.Articulation(n,t);e.hasArticulation(i)||e.Articulations.push(i)}}const h=t.element("fingering");if(h){const t=this.createTechnicalInstruction(h,i);t.type=o.TechnicalInstructionType.Fingering,i.Fingering=t,e.TechnicalInstructions.push(t)}const u=t.element("string");if(u){const t=this.createTechnicalInstruction(u,i);t.type=o.TechnicalInstructionType.String,i.StringInstruction=t,e.TechnicalInstructions.push(t)}}createTechnicalInstruction(t,e){const i=new o.TechnicalInstruction;i.sourceNote=e,i.value=t.value;const s=t.attribute("placement");return this.rules.FingeringPositionFromXML&&(i.placement=this.getPlacement(s)),i}getPlacement(t,e=l.PlacementEnum.NotYetDefined){if(e!==l.PlacementEnum.NotYetDefined)return e;if(!t)return l.PlacementEnum.NotYetDefined;switch(t.value){case"above":return l.PlacementEnum.Above;case"below":return l.PlacementEnum.Below;case"left":return l.PlacementEnum.Left;case"right":return l.PlacementEnum.Right;default:return l.PlacementEnum.NotYetDefined}}addOrnament(t,e){if(t){let i;const s={"delayed-inverted-turn":a.OrnamentEnum.DelayedInvertedTurn,"delayed-turn":a.OrnamentEnum.DelayedTurn,"inverted-mordent":a.OrnamentEnum.InvertedMordent,"inverted-turn":a.OrnamentEnum.InvertedTurn,mordent:a.OrnamentEnum.Mordent,"trill-mark":a.OrnamentEnum.Trill,turn:a.OrnamentEnum.Turn};for(const e in s){if(!s.hasOwnProperty(e))continue;const n=t.element(e);if(n){i=new a.OrnamentContainer(s[e]);const t=n.attribute("placement");t&&"below"===t.value&&(i.placement=l.PlacementEnum.Below)}}if(i){const s=t.elements("accidental-mark");if(s){let t=l.PlacementEnum.Below,e=h.AccidentalEnum.NONE;const n=s;for(let s=0,r=n.length;s<r;++s){const r=n[s];let o=r.value;e=this.getAccEnumFromString(o);const a=r.attribute("placement");r.hasAttributes&&a&&(o=a.value,"above"===o?t=l.PlacementEnum.Above:"below"===o&&(t=l.PlacementEnum.Below)),t===l.PlacementEnum.Above?i.AccidentalAbove=e:t===l.PlacementEnum.Below&&(i.AccidentalBelow=e)}}e.OrnamentContainer=i}}}}},2905:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ChordSymbolReader=void 0;const n=i(4123),r=i(8640),o=i(6331),a=s(i(2043));e.ChordSymbolReader=class{static readChordSymbol(t,e,i){const s=t.element("root"),l=t.element("kind"),h=l.attribute("text");if(!s||!l)return;const c=s.element("root-step"),u=s.element("root-alter");if(!c)return;let d;try{d=r.NoteEnum[c.value.trim()]}catch(t){const i=o.ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError","Invalid chord symbol");return e.SheetErrors.pushMeasureError(i),void a.default.debug("InstrumentReader.readChordSymbol",i,t)}let f=r.AccidentalEnum.NONE;if(u)try{f=r.Pitch.AccidentalFromHalfTones(parseInt(u.value,10))}catch(t){const i=o.ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError","Invalid chord symbol");e.SheetErrors.pushMeasureError(i),a.default.debug("InstrumentReader.readChordSymbol",i,t)}const m=new r.Pitch(d,1,f);let p,b,g=l.value.trim().replace("-","");if(h)switch(h.value){case"aug":g="augmented";break;case"dim":g="diminished"}try{p=n.ChordSymbolEnum[g]}catch(t){const i=o.ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError","Invalid chord symbol");return e.SheetErrors.pushMeasureError(i),void a.default.debug("InstrumentReader.readChordSymbol",i,t)}const S=t.element("bass");if(S){const t=S.element("bass-step"),i=S.element("bass-alter");let s=r.NoteEnum.C;if(t)try{s=r.NoteEnum[t.value.trim()]}catch(t){const i=o.ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError","Invalid chord symbol");return e.SheetErrors.pushMeasureError(i),void a.default.debug("InstrumentReader.readChordSymbol",i,t)}let n=r.AccidentalEnum.NONE;if(i)try{n=r.Pitch.AccidentalFromHalfTones(parseInt(i.value,10))}catch(t){const i=o.ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError","Invalid chord symbol");e.SheetErrors.pushMeasureError(i),a.default.debug("InstrumentReader.readChordSymbol",i,t)}b=new r.Pitch(s,1,n)}const y=[],E=t.elements("degree");for(const t of E)if(t){const i=t.element("degree-value"),s=t.element("degree-alter"),l=t.element("degree-type");if(!i||!s||!l)return;let h,c,u;try{h=parseInt(i.value.trim(),10)}catch(t){const i=o.ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError","Invalid chord symbol");return e.SheetErrors.pushMeasureError(i),void a.default.debug("InstrumentReader.readChordSymbol",i,t)}try{c=r.Pitch.AccidentalFromHalfTones(parseInt(s.value,10))}catch(t){const i=o.ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError","Invalid chord symbol");return e.SheetErrors.pushMeasureError(i),void a.default.debug("InstrumentReader.readChordSymbol",i,t)}try{u=n.ChordDegreeText[l.value.trim().toLowerCase()]}catch(t){const i=o.ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError","Invalid chord symbol");return e.SheetErrors.pushMeasureError(i),void a.default.debug("InstrumentReader.readChordSymbol",i,t)}y.push(new n.Degree(h,c,u))}return new n.ChordSymbolContainer(m,p,b,y,e.Rules)}}},4671:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ExpressionReader=void 0;const n=i(1797),r=i(6124),o=i(7839),a=i(280),l=i(9793),h=i(5853),c=i(6943),u=i(9667),d=i(7527),f=i(1614),m=i(3748),p=i(1274),b=i(6331),g=s(i(2043)),S=i(2562),y=i(7513),E=i(308);e.ExpressionReader=class{constructor(t,e,i){this.openContinuousDynamicExpressions=[],this.musicSheet=t,this.staffNumber=i,this.globalStaffIndex=t.getGlobalStaffIndexOfFirstStaff(e)+(i-1),this.initialize()}readExpressionParameters(t,e,i,s,r,o,a){this.initialize();const l=t.element("offset");if(void 0!==l&&!a)try{this.offsetDivisions=parseInt(l.value,10)}catch(t){const e="ReaderErrorMessages/ExpressionOffsetError, Invalid expression offset -> set to default.";g.default.debug("ExpressionReader.readExpressionParameters",e,t),this.musicSheet.SheetErrors.pushMeasureError(e),this.offsetDivisions=0}this.directionTimestamp=n.Fraction.createFromFraction(s);let h,c=new n.Fraction(Math.abs(this.offsetDivisions),4*i);this.offsetDivisions>0?s.RealValue>0?(c=n.Fraction.multiply(n.Fraction.minus(s,r),c),this.directionTimestamp=n.Fraction.plus(c,s)):this.directionTimestamp=n.Fraction.createFromFraction(c):this.offsetDivisions<0&&(s.RealValue>0?(c=n.Fraction.multiply(n.Fraction.minus(s,r),c),this.directionTimestamp=n.Fraction.minus(s,c)):this.directionTimestamp=n.Fraction.createFromFraction(c));const u=t.element("direction-type");let d;if(u&&(d=u.element("wedge"),d)){const t=d.attribute("default-y");t&&(h=this.readPosition(t))}this.WedgeYPosXml=h;const f=t.attribute("placement");if(f)try{const t=f.value;"below"===t?this.placement=m.PlacementEnum.Below:"above"===t&&(this.placement=m.PlacementEnum.Above)}catch(t){const e=b.ITextTranslation.translateText("ReaderErrorMessages/ExpressionPlacementError","Invalid expression placement -> set to default.");g.default.debug("ExpressionReader.readExpressionParameters",e,t),this.musicSheet.SheetErrors.pushMeasureError(e),this.placement=m.PlacementEnum.Below}if(this.placement===m.PlacementEnum.NotYetDefined)try{if(u){const t=u.element("dynamics");if(t){const e=t.attribute("default-y");e&&this.readExpressionPlacement(e,"read dynamics y pos")}if(d){const t=d.attribute("default-y");t&&this.readExpressionPlacement(t,"read wedge y pos")}const e=u.element("words");if(e){const t=e.attribute("default-y");t&&this.readExpressionPlacement(t,"read words y pos")}const i=u.element("rehearsal");if(i){const t=i.attribute("default-y");t&&this.readExpressionPlacement(t,"read rehearsal pos")}}}catch(t){const e=b.ITextTranslation.translateText("ReaderErrorMessages/ExpressionPlacementError","Invalid expression placement. Set to default.");g.default.debug("ExpressionReader.readExpressionParameters",e,t),this.musicSheet.SheetErrors.pushMeasureError(e),this.placement=m.PlacementEnum.Below}this.placement===m.PlacementEnum.NotYetDefined&&(e.Staves.length>1?this.placement=m.PlacementEnum.Below:e.HasLyrics?this.placement=m.PlacementEnum.Above:this.placement=m.PlacementEnum.Below)}read(t,e,i,s){let r=!1,o=!1;const a=t.element("sound");if(a){const t=a.attribute("tempo"),i=a.attribute("dynamics");if(t){const i=t.value.match(/^(\d+)(\.\d+)?$/);(null==i?void 0:i.length)>0?this.soundTempo=Math.round(Number.parseFloat(t.value)):(g.default.info("invalid xml tempo: "+t.value),this.soundTempo=100),e.TempoInBPM=this.soundTempo,0===this.musicSheet.DefaultStartTempoInBpm&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),this.musicSheet.HasBPMInfo=!0,r=!0}if(i){const t=i.value.match(/\d+/);this.soundDynamic=void 0!==t?parseInt(t[0],10):100,o=!0}}const l=t.element("direction-type");if(!l)return;let h=l.element("metronome");if(h){const t=h.element("beat-unit"),s=void 0!==h.element("beat-unit-dot"),r=h.element("per-minute");if(void 0!==t&&r){h.hasAttributes&&void 0!==h.attribute("default-x")&&(this.directionTimestamp=n.Fraction.createFromFraction(i));const o=parseFloat(r.value);this.createNewTempoExpressionIfNeeded(e);const a=new u.InstantaneousTempoExpression(void 0,this.placement,this.staffNumber,o,this.currentMultiTempoExpression,!0);a.parentMeasure=e,this.soundTempo=o,e.TempoInBPM=this.soundTempo*(s?1.5:1),0===this.musicSheet.DefaultStartTempoInBpm&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),this.musicSheet.HasBPMInfo=!0,a.dotted=s,a.beatUnit=t.value,this.currentMultiTempoExpression.addExpression(a,""),this.currentMultiTempoExpression.CombinedExpressionsText="test"}}else if(h=l.element("dynamics"),h){const s=void 0!==t.element("notations");this.interpretInstantaneousDynamics(h,e,i,s)}else if(h=l.element("words"),h)if(r){this.createNewTempoExpressionIfNeeded(e),this.currentMultiTempoExpression.CombinedExpressionsText=h.value;const t=new u.InstantaneousTempoExpression(h.value,this.placement,this.staffNumber,this.soundTempo,this.currentMultiTempoExpression);this.currentMultiTempoExpression.addExpression(t,"")}else o||this.interpretWords(h,e,i);else h=l.element("wedge"),h?this.interpretWedge(h,e,s,e.MeasureNumber):(h=l.element("rehearsal"),h&&this.interpretRehearsalMark(h,e,i,e.MeasureNumber))}closeOpenExpressions(t,e){for(const i of this.openContinuousDynamicExpressions)this.createNewMultiExpressionIfNeeded(t,i.NumberXml,e),this.closeOpenContinuousDynamic(i,t,e);this.openContinuousTempoExpression&&this.closeOpenContinuousTempo(n.Fraction.plus(t.AbsoluteTimestamp,e))}addOctaveShift(t,e,i){var s;let n=1;const r=t.element("staff");if(r)try{n=parseInt(r.value,10)}catch(t){const e=b.ITextTranslation.translateText("ReaderErrorMessages/OctaveShiftStaffError","Invalid octave shift staff number. Set to default");this.musicSheet.SheetErrors.pushMeasureError(e),n=1,g.default.debug("ExpressionReader.addOctaveShift",e,t)}const o=t.element("direction-type");if(o){const r=o.element("octave-shift"),a=this.readPlacement(t);if(void 0!==r&&r.hasAttributes)try{const t=this.readNumber(r);if(r.attribute("size")){const o=parseInt(r.attribute("size").value,10);let l=0;8===o?l=1:15===o&&(l=2);let c=null===(s=r.attribute("type"))||void 0===s?void 0:s.value;if(c||(a===m.PlacementEnum.Above?c="down":a===m.PlacementEnum.Below&&(c="up")),"up"===c||"down"===c){const i=new h.OctaveShift(c,l);i.StaffNumber=n,this.getMultiExpression=this.createNewMultiExpressionIfNeeded(e,t),this.getMultiExpression.OctaveShiftStart=i,i.ParentStartMultiExpression=this.getMultiExpression,this.openOctaveShift=i}else"stop"===c?this.openOctaveShift&&(this.getMultiExpression=this.createNewMultiExpressionIfNeeded(e,this.openOctaveShift.numberXml,i),this.getMultiExpression.OctaveShiftEnd=this.openOctaveShift,this.openOctaveShift.ParentEndMultiExpression=this.getMultiExpression,this.openOctaveShift=void 0):c||g.default.debug("octave-shift missing type in xml")}}catch(t){const e=b.ITextTranslation.translateText("ReaderErrorMessages/OctaveShiftError","Error while reading octave shift.");this.musicSheet.SheetErrors.pushMeasureError(e),g.default.debug("ExpressionReader.addOctaveShift",e,t)}}}addPedalMarking(t,e,i){var s,n,r;const o=t.element("direction-type");if(o){const t=o.element("pedal");if(void 0!==t&&t.hasAttributes){let o=!1,a=!1;try{switch("yes"===(null===(s=t.attribute("line"))||void 0===s?void 0:s.value)?a=!0:"no"===(null===(n=t.attribute("line"))||void 0===n?void 0:n.value)?(a=!1,o=!0):"yes"===(null===(r=t.attribute("sign"))||void 0===r?void 0:r.value)?o=!0:(o=!1,a=!0),t.attribute("type").value){case"start":this.openPedal&&this.openPedal.IsLine&&this.endOpenPedal(e),this.createNewMultiExpressionIfNeeded(e,-1),this.openPedal=new E.Pedal(a,o),this.getMultiExpression.PedalStart=this.openPedal,this.openPedal.ParentStartMultiExpression=this.getMultiExpression;break;case"stop":this.openPedal&&this.endOpenPedal(e,i);break;case"change":this.openPedal&&this.openPedal.IsLine&&(this.openPedal.ChangeEnd=!0,this.createNewMultiExpressionIfNeeded(e,-1),this.getMultiExpression.PedalEnd=this.openPedal,this.openPedal.ParentEndMultiExpression=this.getMultiExpression,this.createNewMultiExpressionIfNeeded(e,-1),this.openPedal=new E.Pedal(a,o),this.openPedal.ChangeBegin=!0,this.getMultiExpression.PedalStart=this.openPedal,this.openPedal.ParentStartMultiExpression=this.getMultiExpression)}}catch(t){const e=b.ITextTranslation.translateText("ReaderErrorMessages/PedalError","Error while reading pedal.");this.musicSheet.SheetErrors.pushMeasureError(e),g.default.debug("ExpressionReader.addPedalMarking",e,t)}}}}endOpenPedal(t,e){this.createNewMultiExpressionIfNeeded(t,-1,e),this.getMultiExpression.PedalEnd=this.openPedal,this.openPedal.ParentEndMultiExpression=this.getMultiExpression,this.openPedal=void 0}initialize(){this.placement=m.PlacementEnum.NotYetDefined,this.soundTempo=0,this.soundDynamic=0,this.offsetDivisions=0}readPlacement(t){var e;const i=null===(e=t.attribute("placement"))||void 0===e?void 0:e.value;return"above"===i?m.PlacementEnum.Above:"below"===i?m.PlacementEnum.Below:m.PlacementEnum.NotYetDefined}readExpressionPlacement(t,e){try{const e=this.readPosition(t);e<0?this.placement=m.PlacementEnum.Below:e>0&&(this.placement=m.PlacementEnum.Above)}catch(t){g.default.debug("ExpressionReader.readExpressionParameters",e,t)}}readPosition(t){try{const e=parseInt(t.value,10);return e<0?this.placement=m.PlacementEnum.Below:e>0&&(this.placement=m.PlacementEnum.Above),e}catch(t){g.default.debug("ExpressionReader.readExpressionParameters",t)}}interpretInstantaneousDynamics(t,e,i,s){var r;if(t.hasElements){t.hasAttributes&&t.attribute("default-x")&&(this.directionTimestamp=n.Fraction.createFromFraction(i));const o=this.readNumber(t);let a=null===(r=t.elements()[0])||void 0===r?void 0:r.name;if("other-dynamics"===a&&(a=t.elements()[0].value),a){s?this.createNewMultiExpressionIfNeeded(e,o,n.Fraction.createFromFraction(i)):this.createNewMultiExpressionIfNeeded(e,o);const t=new l.InstantaneousDynamicExpression(a,this.soundDynamic,this.placement,this.staffNumber,e);t.InMeasureTimestamp=i.clone(),this.getMultiExpression.addExpression(t,""),this.initialize(),this.activeInstantaneousDynamic?this.activeInstantaneousDynamic.DynEnum=t.DynEnum:this.activeInstantaneousDynamic=new l.InstantaneousDynamicExpression(a,0,m.PlacementEnum.NotYetDefined,1,e)}}}interpretWords(t,e,i){const s=t.value;if(e.Rules.IgnoreBracketsWords&&(/^\(\s*\)$/.test(s)||/^\[\s*\]$/.test(s)))return;let r;const o=t.attribute("font-style");if(o&&"italic"===o.value&&(r=S.FontStyles.Italic),s.length>0){if(t.hasAttributes&&t.attribute("default-x")&&(this.directionTimestamp=n.Fraction.createFromFraction(i)),this.checkIfWordsNodeIsRepetitionInstruction(s))return;this.fillMultiOrTempoExpression(s,e,i,r),this.initialize()}}readNumber(t){var e;let i=1;const s=null===(e=t.attribute("number"))||void 0===e?void 0:e.value;return s&&(i=Number.parseInt(s,10)),i}interpretWedge(t,e,i,s){var r,a;void 0!==t&&t.hasAttributes&&t.attribute("default-x")&&(this.directionTimestamp=n.Fraction.createFromFraction(i));const l=this.readNumber(t),h=null===(a=null===(r=t.attribute("type"))||void 0===r?void 0:r.value)||void 0===a?void 0:a.toLowerCase();this.lastWedge&&this.lastWedge.parentMeasure.MeasureNumberXML===e.MeasureNumberXML&&this.lastWedge.StaffNumber===this.staffNumber&&this.placement===this.lastWedge.Placement&&void 0!==this.WedgeYPosXml&&this.lastWedge.YPosXml===this.WedgeYPosXml&&this.lastWedge.StartMultiExpression.Timestamp.Equals(this.directionTimestamp)&&this.lastWedge.DynamicType===o.ContDynamicEnum[h]||("stop"===h?this.createNewMultiExpressionIfNeeded(e,l,i):this.createNewMultiExpressionIfNeeded(e,l),this.addWedge(t,e,i),this.initialize())}interpretRehearsalMark(t,e,i,s){e.rehearsalExpression=new y.RehearsalExpression(t.value,this.placement)}createNewMultiExpressionIfNeeded(t,e,i){i||(i=this.directionTimestamp);let s=this.getMultiExpression;return(!s||s&&(s.SourceMeasureParent!==t||s.numberXml!==e||s.SourceMeasureParent===t&&s.Timestamp!==i))&&(this.getMultiExpression=s=new c.MultiExpression(t,n.Fraction.createFromFraction(i)),t.StaffLinkedExpressions[this.globalStaffIndex].push(s)),s}createNewTempoExpressionIfNeeded(t){this.currentMultiTempoExpression&&this.currentMultiTempoExpression.SourceMeasureParent===t&&this.currentMultiTempoExpression.Timestamp===this.directionTimestamp||(this.currentMultiTempoExpression=new r.MultiTempoExpression(t,n.Fraction.createFromFraction(this.directionTimestamp)),t.TempoExpressions.push(this.currentMultiTempoExpression))}addWedge(t,e,i){if(void 0!==t&&t.hasAttributes){const s=this.readNumber(t),n=t.attribute("type").value.toLowerCase();try{if("crescendo"===n||"diminuendo"===n){const t=new o.ContinuousDynamicExpression(o.ContDynamicEnum[n],this.placement,this.staffNumber,e,s);this.lastWedge=t,this.lastWedge.YPosXml=this.WedgeYPosXml,this.openContinuousDynamicExpressions.push(t);let i=this.getMultiExpression;i||(i=this.createNewMultiExpressionIfNeeded(e,s)),i.StartingContinuousDynamic=t,t.StartMultiExpression=i,void 0!==this.activeInstantaneousDynamic&&this.activeInstantaneousDynamic.StaffNumber===t.StaffNumber&&(this.activeInstantaneousDynamic=void 0)}else if("stop"===n)for(const t of this.openContinuousDynamicExpressions)t.NumberXml===s&&t.NumberXml===s&&this.closeOpenContinuousDynamic(t,e,i)}catch(t){const e="ReaderErrorMessages/WedgeError, Error while reading Crescendo / Diminuendo.";this.musicSheet.SheetErrors.pushMeasureError(e),g.default.debug("ExpressionReader.addWedge",e,t)}}}fillMultiOrTempoExpression(t,e,i,s){if(!t)return;const n=t.trim();this.createExpressionFromString("",n,e,i,t,s)}createExpressionFromString(t,e,i,s,n,r){if(u.InstantaneousTempoExpression.isInputStringInstantaneousTempo(e)||a.ContinuousTempoExpression.isInputStringContinuousTempo(e)){if(i.TempoExpressions.length>0)for(let t=0,s=i.TempoExpressions.length;t<s;++t){const s=i.TempoExpressions[t];if(s.Timestamp===this.directionTimestamp&&void 0!==s.InstantaneousTempo&&-1!==s.InstantaneousTempo.Label.indexOf(e))return!1}if(this.createNewTempoExpressionIfNeeded(i),this.currentMultiTempoExpression.CombinedExpressionsText=n,u.InstantaneousTempoExpression.isInputStringInstantaneousTempo(e)){const i=new u.InstantaneousTempoExpression(e,this.placement,this.staffNumber,this.soundTempo,this.currentMultiTempoExpression);return this.currentMultiTempoExpression.addExpression(i,t),!0}if(a.ContinuousTempoExpression.isInputStringContinuousTempo(e)){const i=new a.ContinuousTempoExpression(e,this.placement,this.staffNumber,this.currentMultiTempoExpression);return this.currentMultiTempoExpression.addExpression(i,t),!0}}if(o.ContinuousDynamicExpression.isInputStringContinuousDynamic(e)){const n=new o.ContinuousDynamicExpression(void 0,this.placement,this.staffNumber,i,-1,e),r=this.getMultiExpression;return r&&this.closeOpenContinuousDynamic(r.StartingContinuousDynamic,i,s),this.createNewMultiExpressionIfNeeded(i,-1),void 0!==this.activeInstantaneousDynamic&&this.activeInstantaneousDynamic.StaffNumber===n.StaffNumber&&(this.activeInstantaneousDynamic=void 0),this.openContinuousDynamicExpressions.push(n),n.StartMultiExpression=this.getMultiExpression,this.getMultiExpression.addExpression(n,t),!0}if(d.MoodExpression.isInputStringMood(e)){const s=this.createNewMultiExpressionIfNeeded(i,-1);i.hasMoodExpressions=!0;const n=new d.MoodExpression(e,this.placement,this.staffNumber);return n.fontStyle=r,s.addExpression(n,t),!0}const l=this.createNewMultiExpressionIfNeeded(i,-1);if(i.TempoExpressions.length>0)for(let t=0,s=i.TempoExpressions.length;t<s;++t){const s=i.TempoExpressions[t];if(s.Timestamp===this.directionTimestamp&&void 0!==s.InstantaneousTempo&&s.EntriesList.length>0&&!this.hasDigit(e)&&this.globalStaffIndex>0){if(s.EntriesList[0].label.indexOf(e)>=0)return!1;break}}let h=p.TextAlignmentEnum.CenterBottom;this.musicSheet.Rules.CompactMode&&(h=p.TextAlignmentEnum.LeftBottom);const c=new f.UnknownExpression(e,this.placement,h,this.staffNumber);return c.fontStyle=r,l.addExpression(c,t),!1}closeOpenContinuousDynamic(t,e,i){if(!t)return;const s=t.NumberXml;t.EndMultiExpression=this.createNewMultiExpressionIfNeeded(e,s,i),t.StartMultiExpression.EndingContinuousDynamic=t,this.openContinuousDynamicExpressions=this.openContinuousDynamicExpressions.filter((e=>e!==t))}closeOpenContinuousTempo(t){this.openContinuousTempoExpression.AbsoluteEndTimestamp=t,this.openContinuousTempoExpression=void 0}checkIfWordsNodeIsRepetitionInstruction(t){return"coda"===(t=t.trim().toLowerCase())||"tocoda"===t||"to coda"===t||"fine"===t||"d.c."===t||"dacapo"===t||"da capo"===t||"d.s."===t||"dalsegno"===t||"dal segno"===t||"d.c. al fine"===t||"d.s. al fine"===t||"d.c. al coda"===t||"d.s. al coda"===t}hasDigit(t){return/\d/.test(t)}}},2535:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LyricsReader=void 0;const s=i(2672),n=i(7274),r=i(6331);e.LyricsReader=class{constructor(t){this.openLyricWords={},this.musicSheet=t}addLyricEntry(t,e){var i,o;if(t){const a=t;for(let t=0,l=a.length;t<l;++t){const l=a[t];try{let t="single";if(l.element("text")){let r=l.element("text");if(l.element("syllabic")&&(t=l.element("syllabic").value),r){let a="";const h=l.elements();for(const t of h)"text"!==t.name&&"elision"!==t.name||(a+=t.value);if(a=a.replace(" "," "),void 0!==l.element("elision")&&"-"===a){const e=l.elements();let i,s,n=0;for(let t=0;t<e.length;t++)if("elision"===e[t].name){n=t;break}if(n>0)for(let t=n;t<e.length;t++){const n=e[t];"text"===n.name&&(i=n),"syllabic"===n.name&&(s=n)}void 0!==i&&s&&(r=i,t="middle")}let c,u="1";if(void 0!==l.attributes()&&l.attribute("number")&&(u=l.attribute("number").value),"single"===t||"end"===t){if(this.openLyricWords[u]){this.currentLyricWord=this.openLyricWords[u];const t=this.currentLyricWord.Syllables.length;c=new n.LyricsEntry(a,u,this.currentLyricWord,e,t),this.currentLyricWord.Syllables.push(c),delete this.openLyricWords[u],this.currentLyricWord=void 0}else c=new n.LyricsEntry(a,u,void 0,e);c.extend=void 0!==l.element("extend")}else if("begin"===t)this.openLyricWords[u]&&(delete this.openLyricWords[u],this.currentLyricWord=void 0),this.currentLyricWord=new s.LyricWord,this.openLyricWords[u]=this.currentLyricWord,c=new n.LyricsEntry(a,u,this.currentLyricWord,e,0),this.currentLyricWord.Syllables.push(c);else if("middle"===t)if(this.openLyricWords[u]){this.currentLyricWord=this.openLyricWords[u];const t=this.currentLyricWord.Syllables.length;c=new n.LyricsEntry(a,u,this.currentLyricWord,e,t),this.currentLyricWord.Syllables.push(c)}else c=new n.LyricsEntry(a,u,void 0,e);c&&(e.LyricsEntries[u]||(e.LyricsEntries.setValue(u,c),(null===(o=null===(i=e.ParentSourceStaffEntry)||void 0===i?void 0:i.VerticalContainerParent)||void 0===o?void 0:o.ParentMeasure)&&(e.ParentSourceStaffEntry.VerticalContainerParent.ParentMeasure.hasLyrics=!0)),e.ParentVoice.Parent.LyricVersesNumbers.includes(u)||e.ParentVoice.Parent.LyricVersesNumbers.push(u))}}}catch(t){const e=r.ITextTranslation.translateText("ReaderErrorMessages/LyricError","Error while reading lyric entry.");this.musicSheet.SheetErrors.pushMeasureError(e);continue}}}}}},6789:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RepetitionCalculator=void 0;const s=i(6189),n=i(6189),r=i(1703);e.RepetitionCalculator=class{constructor(){this.repetitionInstructions=[]}calculateRepetitions(t,e){this.musicSheet=t,this.repetitionInstructions=e;const i=this.musicSheet.SourceMeasures;for(let t=0,e=this.repetitionInstructions.length;t<e;++t){const e=this.repetitionInstructions[t];this.currentMeasureIndex=e.measureIndex,this.currentMeasure=i[this.currentMeasureIndex],this.handleRepetitionInstructions(e)}for(let t=0,e=this.musicSheet.SourceMeasures.length;t<e;++t){const e=this.musicSheet.SourceMeasures[t];e.FirstRepetitionInstructions.length>1&&e.FirstRepetitionInstructions.sort(n.RepetitionInstructionComparer.Compare),e.LastRepetitionInstructions.length>1&&e.LastRepetitionInstructions.sort(n.RepetitionInstructionComparer.Compare)}}handleRepetitionInstructions(t){if(!this.currentMeasure)return!1;switch(t.type){case s.RepetitionInstructionEnum.StartLine:this.currentMeasure.FirstRepetitionInstructions.push(t);break;case s.RepetitionInstructionEnum.BackJumpLine:this.currentMeasure.LastRepetitionInstructions.push(t);break;case s.RepetitionInstructionEnum.Ending:if(t.alignment===s.AlignmentType.Begin)this.currentMeasure.FirstRepetitionInstructions.push(t);else for(let e=0,i=t.endingIndices.length;e<i;++e)this.currentMeasure.LastRepetitionInstructions.push(t);break;case s.RepetitionInstructionEnum.Segno:this.currentMeasure.FirstRepetitionInstructions.push(t);break;case s.RepetitionInstructionEnum.Fine:case s.RepetitionInstructionEnum.ToCoda:case s.RepetitionInstructionEnum.Coda:case s.RepetitionInstructionEnum.DaCapo:case s.RepetitionInstructionEnum.DalSegno:case s.RepetitionInstructionEnum.DalSegnoAlFine:case s.RepetitionInstructionEnum.DaCapoAlFine:case s.RepetitionInstructionEnum.DalSegnoAlCoda:case s.RepetitionInstructionEnum.DaCapoAlCoda:this.currentMeasure.LastRepetitionInstructions.push(t);break;case s.RepetitionInstructionEnum.None:break;default:throw new r.ArgumentOutOfRangeException("currentRepetitionInstruction")}return!0}}},9934:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RepetitionInstructionReader=void 0;const s=i(6189),n=i(6189),r=i(1211);e.RepetitionInstructionReader=class{set MusicSheet(t){this.musicSheet=t,this.xmlMeasureList=new Array(this.musicSheet.Instruments.length),this.repetitionInstructions=[]}prepareReadingMeasure(t,e){this.currentMeasureIndex=e}handleLineRepetitionInstructions(t){let e=!1;if(t.elements().length>0){let i="",n=!1,r="",o="",a="";const l=[],h=t.element("bar-style");h&&(a=h.value),i=t.attributes().length>0&&t.attribute("location")?t.attribute("location").value:"right";const c=t.elements();for(let t=0,e=c.length;t<e;++t){const e=c[t];if("repeat"===e.name&&e.hasAttributes)n=!0,r=e.attribute("direction").value;else if("ending"===e.name&&e.hasAttributes&&void 0!==e.attribute("type")&&e.attribute("number")){o=e.attribute("type").value;const t=e.attribute("number").value.split("[,+]");for(let e=0,i=t.length;e<i;++e){const i=t[e],s=i.match("[0-9]");if(-1!==i.search("-")&&2===s.length){const t=parseInt(s[0],10),e=parseInt(s[1],10);for(let i=t;i<=e;i++)l.push(i)}else for(let t=0,e=s.length;t<e;++t){const e=s[t];l.push(parseInt(e,10))}}}}if("light-heavy"!==a||0!==l.length||n||(e=!0),n||l.length>0)if("left"===i){if("start"===o){const t=new s.RepetitionInstruction(this.currentMeasureIndex,s.RepetitionInstructionEnum.Ending,s.AlignmentType.Begin,void 0,l);this.addInstruction(this.repetitionInstructions,t)}if("forward"===r){const t=new s.RepetitionInstruction(this.currentMeasureIndex,s.RepetitionInstructionEnum.StartLine);this.addInstruction(this.repetitionInstructions,t)}}else{if("stop"===o){const t=new s.RepetitionInstruction(this.currentMeasureIndex,s.RepetitionInstructionEnum.Ending,s.AlignmentType.End,void 0,l);this.addInstruction(this.repetitionInstructions,t)}if("backward"===r){const t=new s.RepetitionInstruction(this.currentMeasureIndex,s.RepetitionInstructionEnum.BackJumpLine);this.addInstruction(this.repetitionInstructions,t)}}}return e}handleRepetitionInstructionsFromWordsOrSymbols(t,e){const i=t.element("words"),n=this.currentMeasureIndex;if(i){const t="d\\s?\\.s\\.",e=i.value.trim().toLowerCase();if(r.StringUtil.StringContainsSeparatedWord(e,t+" al fine",!0)){const t=new s.RepetitionInstruction(n,s.RepetitionInstructionEnum.DalSegnoAlFine);return this.addInstruction(this.repetitionInstructions,t),!0}const o="d\\.\\s?c\\.";if(r.StringUtil.StringContainsSeparatedWord(e,o+" al coda",!0)){const t=new s.RepetitionInstruction(n,s.RepetitionInstructionEnum.DaCapoAlCoda);return this.addInstruction(this.repetitionInstructions,t),!0}if(r.StringUtil.StringContainsSeparatedWord(e,o+" al fine",!0)){const t=new s.RepetitionInstruction(n,s.RepetitionInstructionEnum.DaCapoAlFine);return this.addInstruction(this.repetitionInstructions,t),!0}if(r.StringUtil.StringContainsSeparatedWord(e,o+" al coda",!0)){const t=new s.RepetitionInstruction(n,s.RepetitionInstructionEnum.DaCapoAlCoda);return this.addInstruction(this.repetitionInstructions,t),!0}if(r.StringUtil.StringContainsSeparatedWord(e,o)||r.StringUtil.StringContainsSeparatedWord(e,"da\\s?capo",!0)){const t=new s.RepetitionInstruction(n,s.RepetitionInstructionEnum.DaCapo);return this.addInstruction(this.repetitionInstructions,t),!0}if(r.StringUtil.StringContainsSeparatedWord(e,t,!0)||r.StringUtil.StringContainsSeparatedWord(e,"dal\\s?segno",!0)){let t;return t=r.StringUtil.StringContainsSeparatedWord(e,"al\\s?coda",!0)?new s.RepetitionInstruction(n,s.RepetitionInstructionEnum.DalSegnoAlCoda):new s.RepetitionInstruction(n,s.RepetitionInstructionEnum.DalSegno),this.addInstruction(this.repetitionInstructions,t),!0}if(r.StringUtil.StringContainsSeparatedWord(e,"to\\s?coda",!0)||r.StringUtil.StringContainsSeparatedWord(e,"a (la )?coda",!0)){const t=new s.RepetitionInstruction(n,s.RepetitionInstructionEnum.ToCoda);return this.addInstruction(this.repetitionInstructions,t),!0}if(r.StringUtil.StringContainsSeparatedWord(e,"fine",!0)){const t=new s.RepetitionInstruction(n,s.RepetitionInstructionEnum.Fine);return this.addInstruction(this.repetitionInstructions,t),!0}if(r.StringUtil.StringContainsSeparatedWord(e,"coda",!0)){const t=new s.RepetitionInstruction(n,s.RepetitionInstructionEnum.Coda);return this.addInstruction(this.repetitionInstructions,t),!0}if(r.StringUtil.StringContainsSeparatedWord(e,"segno",!0)){const t=new s.RepetitionInstruction(n,s.RepetitionInstructionEnum.Segno);return this.addInstruction(this.repetitionInstructions,t),!0}}else{if(t.element("segno")){const t=new s.RepetitionInstruction(n,s.RepetitionInstructionEnum.Segno);return this.addInstruction(this.repetitionInstructions,t),!0}if(t.element("coda")){const t=new s.RepetitionInstruction(n,s.RepetitionInstructionEnum.Coda);return this.addInstruction(this.repetitionInstructions,t),!0}}return!1}removeRedundantInstructions(){let t=0,e=0,i=0,r=0;for(let n=0;n<this.repetitionInstructions.length;n++){const o=this.repetitionInstructions[n];switch(o.type){case s.RepetitionInstructionEnum.Coda:i>0&&this.findInstructionInPreviousMeasure(n,o.measureIndex,s.RepetitionInstructionEnum.ToCoda)&&(o.type=s.RepetitionInstructionEnum.None);break;case s.RepetitionInstructionEnum.Segno:if(t-r>0){let t=!1;for(let n=0,r=this.repetitionInstructions.length;n<r;++n){const r=this.repetitionInstructions[n];if(o.measureIndex-r.measureIndex==1)switch(r.type){case s.RepetitionInstructionEnum.BackJumpLine:r.type=i-e>0?s.RepetitionInstructionEnum.DalSegnoAlCoda:s.RepetitionInstructionEnum.DalSegno,o.type=s.RepetitionInstructionEnum.None,t=!0;break;case s.RepetitionInstructionEnum.DalSegno:case s.RepetitionInstructionEnum.DalSegnoAlFine:case s.RepetitionInstructionEnum.DalSegnoAlCoda:o.type=s.RepetitionInstructionEnum.None,t=!0}if(t)break}if(t)break;o.type=i-e>0?s.RepetitionInstructionEnum.DalSegnoAlCoda:s.RepetitionInstructionEnum.DalSegno,o.alignment=s.AlignmentType.End,o.measureIndex--}}if(this.backwardSearchForPreviousIdenticalInstruction(n,o)||o.type===s.RepetitionInstructionEnum.None)this.repetitionInstructions.splice(n,1),n--;else switch(o.type){case s.RepetitionInstructionEnum.Fine:break;case s.RepetitionInstructionEnum.ToCoda:i++;break;case s.RepetitionInstructionEnum.Coda:e++;break;case s.RepetitionInstructionEnum.Segno:t++;break;case s.RepetitionInstructionEnum.DalSegnoAlFine:case s.RepetitionInstructionEnum.DalSegnoAlCoda:r++}}this.repetitionInstructions.sort(n.RepetitionInstructionComparer.Compare)}findInstructionInPreviousMeasure(t,e,i){for(let s=t-1;s>=0;s--){const t=this.repetitionInstructions[s];if(e-t.measureIndex==1&&t.type===i)return!0}return!1}backwardSearchForPreviousIdenticalInstruction(t,e){for(let i=t-1;i>=0;i--)if(this.repetitionInstructions[i].equals(e))return!0;return!1}addInstruction(t,e){let i=!0;for(let s=0,n=t.length;s<n;++s){const n=t[s];if(e.equals(n)){i=!1;break}}i&&t.push(e)}}},3755:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SlurReader=void 0;const n=i(1928),r=s(i(2043)),o=i(6331),a=i(2343),l=i(7198);e.SlurReader=class{constructor(t){this.openSlurDict={},this.musicSheet=t}addSlur(t,e){try{if(t)for(const i of t)if(i.attributes().length>0){const t=i.attribute("type").value;let s=1;try{i.attribute("number")&&(s=parseInt(i.attribute("number").value,10))}catch(t){r.default.debug("VoiceGenerator.addSlur number: ",t)}let o=a.PlacementEnum.NotYetDefined;const h=i.attribute("placement");h&&h.value&&("above"===h.value?o=a.PlacementEnum.Above:"below"===h.value&&(o=a.PlacementEnum.Below));const c=i.attribute("orientation");if(c&&c.value&&("over"===c.value?o=a.PlacementEnum.Above:"under"===c.value&&(o=a.PlacementEnum.Below)),"start"===t){let t=this.openSlurDict[s];t||(t=new n.Slur,this.openSlurDict[s]=t),t.StartNote=e,t.PlacementXml=o}else if("stop"===t){const t=this.openSlurDict[s];if(t){const n=i.name;if("slide"===n||"glissando"===n){const i=t.StartNote,n=new l.Glissando(i);n.AddNote(e),n.EndNote=e,e.NoteGlissando=n,delete this.openSlurDict[s]}else t.EndNote=e,e.isDuplicateSlur(t)||(e.NoteSlurs.push(t),t.StartNote.NoteSlurs.push(t)),delete this.openSlurDict[s]}}}}catch(t){const e=o.ITextTranslation.translateText("ReaderErrorMessages/SlurError","Error while reading slur.");this.musicSheet.SheetErrors.pushMeasureError(e)}}}},1651:function(t,e,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(t,e,i,s){void 0===s&&(s=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,s,n)}:function(t,e,i,s){void 0===s&&(s=i),t[s]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||s(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(7677),e),n(i(2905),e),n(i(4671),e),n(i(2535),e),n(i(6789),e),n(i(9934),e),n(i(3755),e)},2458:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ReaderPluginManager=void 0;const n=s(i(2043));e.ReaderPluginManager=class{constructor(){this.voiceMeasureReadPlugins=[]}addVoiceMeasureReadPlugin(t){this.voiceMeasureReadPlugins.push(t)}processVoiceMeasureReadPlugins(t,e,i){for(const s of this.voiceMeasureReadPlugins)try{s.measureReadCalculations(t,e,i)}catch(t){n.default.info("VoiceGenerator.addSingleNote: ",t)}}}},8109:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VoiceGenerator=void 0;const n=i(2947),r=i(3884),o=i(908),a=i(5253),l=i(9050),h=i(9224),c=i(4555),u=i(5544),d=i(8069),f=i(1797),m=i(6331),p=i(2535),b=i(1703),g=i(8640),S=i(8640),y=i(4447),E=s(i(2043)),v=i(8640),x=i(2337),_=i(7677),M=i(766),w=i(3029),P=i(2478),T=i(2953),L=i(3748);e.VoiceGenerator=class{constructor(t,e,i,s,o){this.openBeams=[],this.beamNumberOffset=0,this.currentOctaveShift=0,this.tupletDict={},this.openTupletNumber=0,this.staff=e,this.instrument=e.ParentInstrument,this.musicSheet=this.instrument.GetMusicSheet,this.slurReader=s,this.pluginManager=t,this.voice=o?new n.LinkedVoice(this.instrument,i,o):new r.Voice(this.instrument,i),this.instrument.Voices.push(this.voice),this.staff.Voices.push(this.voice),this.lyricsReader=new p.LyricsReader(this.musicSheet),this.articulationReader=new _.ArticulationReader(this.musicSheet.Rules)}get openTieDict(){return this.staff.openTieDict}get GetVoice(){return this.voice}get OctaveShift(){return this.currentOctaveShift}set OctaveShift(t){this.currentOctaveShift=t}createVoiceEntry(t,e,i,s=!1,n=!1,r=!1){this.currentVoiceEntry=new o.VoiceEntry(t.clone(),this.voice,e,s,n,r),i&&this.voice.VoiceEntries.push(this.currentVoiceEntry)}read(t,e,i,s,n,r,o,a,l,h,c,d,f,p,b,g,S,y,v,x,_){this.currentStaffEntry=o,this.currentMeasure=a;try{this.currentNote=r?this.addRestNote(t.element("rest"),e,s,i,n,f,p,v):this.addSingleNote(t,e,s,i,n,c,d,f,p,b,g,S,y,v,x),this.currentNote.DotsXml=_;const o=t.elements("lyric");void 0!==this.lyricsReader&&o&&(this.lyricsReader.addLyricEntry(o,this.currentVoiceEntry),this.voice.Parent.HasLyrics=!0);let a=!1;const m=t.element("notations");if(m){this.articulationReader&&this.readArticulations(m,this.currentVoiceEntry,this.currentNote);const e=m.elements("slur"),i=m.elements("slide"),s=m.elements("glissando");void 0!==this.slurReader&&(e.length>0||i.length>0)&&!this.currentNote.ParentVoiceEntry.IsGrace&&(this.slurReader.addSlur(e,this.currentNote),i.length>0&&this.slurReader.addSlur(i,this.currentNote),s.length>0&&this.slurReader.addSlur(s,this.currentNote));const n=m.elements("tuplet");n.length>0&&(this.openTupletNumber=this.addTuplet(t,n),a=!0);const r=m.element("arpeggiate");if(void 0!==r){let t;if(this.currentVoiceEntry.Arpeggio)t=this.currentVoiceEntry.Arpeggio;else{let e=!1;for(const i of this.currentStaffEntry.VoiceEntries)if(i.Arpeggio){e=!0,t=i.Arpeggio;break}if(!e){let e=w.ArpeggioType.ARPEGGIO_DIRECTIONLESS;const i=r.attribute("direction");if(i)switch(i.value){case"up":e=w.ArpeggioType.ROLL_UP;break;case"down":e=w.ArpeggioType.ROLL_DOWN;break;default:e=w.ArpeggioType.ARPEGGIO_DIRECTIONLESS}t=new w.Arpeggio(this.currentVoiceEntry,e),this.currentVoiceEntry.Arpeggio=t}}t.addNote(this.currentNote)}const o=m.elements("tied");o.length>0&&this.addTie(o,l,h,u.TieTypes.SIMPLE);const c=m.element("technical");if(c){const t=c.elements("hammer-on");t.length>0&&this.addTie(t,l,h,u.TieTypes.HAMMERON);const e=c.elements("pull-off");e.length>0&&this.addTie(e,l,h,u.TieTypes.PULLOFF)}}void 0===t.element("time-modification")||a||this.handleTimeModificationNode(t)}catch(t){E.default.warn(t);const e=m.ITextTranslation.translateText("ReaderErrorMessages/NoteError","Ignored erroneous Note.");this.musicSheet.SheetErrors.pushMeasureError(e),this.musicSheet.SheetErrors.pushMeasureError(t)}return this.currentNote}checkForStaffEntryLink(t,e,i,s){const n=new y.StaffEntryLink(this.currentVoiceEntry);n.LinkStaffEntries.push(i),i.Link=n;const r=this.currentVoiceEntry.Timestamp.clone(),o=s.getVerticalContainerByTimestamp(r);return(i=o.StaffEntries[t])||(i=new l.SourceStaffEntry(o,e),o.StaffEntries[t]=i),i.VoiceEntries.push(this.currentVoiceEntry),n.LinkStaffEntries.push(i),i.Link=n,i}checkForOpenBeam(){this.openBeams.length>0&&this.currentNote&&this.handleOpenBeam()}checkOpenTies(){const t=this.openTieDict;for(const e in t)if(t.hasOwnProperty(e)){const i=t[e];f.Fraction.plus(i.StartNote.ParentStaffEntry.Timestamp,i.Duration).lt(i.StartNote.SourceMeasure.Duration)&&delete t[e]}}hasVoiceEntry(){return void 0!==this.currentVoiceEntry}readArticulations(t,e,i){const s=t.element("articulations");s&&this.articulationReader.addArticulationExpression(s,e);const n=t.element("fermata");n&&this.articulationReader.addFermata(n,e);const r=t.element("technical");r&&this.articulationReader.addTechnicalArticulations(r,e,i);const o=t.element("ornaments");o&&this.articulationReader.addOrnament(o,e)}addSingleNote(t,e,i,s,n,r,l,h,c,u,d,p,y,x,_){let w,P,L,A,C=0,I=g.AccidentalEnum.NONE,R=S.NoteEnum.C,N=S.NoteEnum.C,B=0,F=0;const D=t.elements();for(let t=0,e=D.length;t<e;++t){const e=D[t];try{if("pitch"===e.name){const t=e.elements();for(let e=0,i=t.length;e<i;++e){const i=t[e];L=void 0,A=void 0;try{if("step"===i.name){if(R=S.NoteEnum[i.value],void 0===R){const t=m.ITextTranslation.translateText("ReaderErrorMessages/NotePitchError","Invalid pitch while reading note.");throw this.musicSheet.SheetErrors.pushMeasureError(t),new b.MusicSheetReadingException(t,void 0)}}else if("alter"===i.name){if(C=parseFloat(i.value),isNaN(C)){const t=m.ITextTranslation.translateText("ReaderErrorMessages/NoteAlterationError","Invalid alteration while reading note.");throw this.musicSheet.SheetErrors.pushMeasureError(t),new b.MusicSheetReadingException(t,void 0)}I=v.Pitch.AccidentalFromHalfTones(C)}else if("octave"===i.name&&(B=parseInt(i.value,10),isNaN(B))){const t=m.ITextTranslation.translateText("ReaderErrorMessages/NoteOctaveError","Invalid octave value while reading note.");throw this.musicSheet.SheetErrors.pushMeasureError(t),new b.MusicSheetReadingException(t,void 0)}}catch(t){E.default.info("VoiceGenerator.addSingleNote read Step: ",t.message)}}}else if("accidental"===e.name)w=e.value,"natural"===w?I=g.AccidentalEnum.NATURAL:"slash-flat"===w?I=g.AccidentalEnum.SLASHFLAT:"slash-quarter-sharp"===w?I=g.AccidentalEnum.SLASHQUARTERSHARP:"slash-sharp"===w?I=g.AccidentalEnum.SLASHSHARP:"double-slash-flat"===w?I=g.AccidentalEnum.DOUBLESLASHFLAT:"sori"===w?I=g.AccidentalEnum.SORI:"koron"===w&&(I=g.AccidentalEnum.KORON);else if("unpitched"===e.name){const t=e.element("display-step"),i=e.element("display-octave");if(i&&(B=parseInt(i.value,10),F=B-3,l&&(B+=1),1===this.instrument.Staves[0].StafflineCount&&(F+=1)),t){R=S.NoteEnum[t.value.toUpperCase()];let e=0,i=this.musicSheet.Rules.PercussionXMLDisplayStepNoteValueShift;1===this.instrument.Staves[0].StafflineCount&&(i-=3),[N,e]=v.Pitch.lineShiftFromNoteEnum(R,i),F+=e}}else"instrument"===e.name?e.firstAttribute&&(P=e.firstAttribute.value):"notehead"===e.name&&(L=e.value,e.attribute("filled")&&(A="yes"===e.attribute("filled").value))}catch(t){E.default.info("VoiceGenerator.addSingleNote: ",t)}}B-=v.Pitch.OctaveXmlDifference;const O=new v.Pitch(R,B,I,w),k=f.Fraction.createFromFraction(e);let V,G=-1,W=-1;const U=[],z=t.element("notations");if(z){const t=z.element("technical");if(t){const e=t.element("string");e&&(G=parseInt(e.value,10));const i=t.element("fret");i&&(W=parseInt(i.value,10)),t.elements("bend").forEach((function(t){const e=t.element("bend-alter");void 0!==t.element("release")?U.push({bendalter:parseInt(e.value,10),direction:"down"}):U.push({bendalter:parseInt(e.value,10),direction:"up"})}))}}return V=G<0||W<0?new a.Note(this.currentVoiceEntry,this.currentStaffEntry,k,O,this.currentMeasure):new T.TabNote(this.currentVoiceEntry,this.currentStaffEntry,k,O,this.currentMeasure,G,W,U,_),this.addNoteInfo(V,i,h,c,n,N,F,x,x),V.TypeLength=s,V.IsGraceNote=u,V.StemDirectionXml=d,V.TremoloStrokes=p,V.PlaybackInstrumentId=P,(void 0!==L&&"normal"!==L||void 0!==A)&&(V.Notehead=new M.Notehead(V,L,A)),d===o.StemDirectionType.None&&(y="#00000000"),this.currentVoiceEntry.Notes.push(V),this.currentVoiceEntry.StemDirectionXml=d,y&&(this.currentVoiceEntry.StemColorXml=y,this.currentVoiceEntry.StemColor=y,V.StemColorXml=y),t.elements("beam")&&!r&&this.createBeam(t,V),V}addRestNote(t,e,i,s,n,r,o,l){const h=f.Fraction.createFromFraction(e),c=t.element("display-step"),u=t.element("display-octave");let d,m,p;c&&u&&(d=S.NoteEnum[c.value.toUpperCase()],m=parseInt(u.value,10),p=new v.Pitch(d,m,g.AccidentalEnum.NONE,void 0,!0));const b=new a.Note(this.currentVoiceEntry,this.currentStaffEntry,h,p,this.currentMeasure,!0);return this.addNoteInfo(b,i,r,o,n,d,m,l,l),b.TypeLength=s,this.currentVoiceEntry.Notes.push(b),this.openBeams.length>0&&this.openBeams.last().ExtendedNoteList.push(b),b}addNoteInfo(t,e,i,s,n,r,o,a,l){t.NoteTypeXml=e,t.PrintObject=i,t.IsCueNote=s,t.NormalNotes=n,t.displayStepUnpitched=r,t.displayOctaveUnpitched=o,t.NoteheadColorXml=a,t.NoteheadColor=a}createBeam(t,e){var i;try{const s=t.element("beam");let n;if(void 0!==s&&s.hasAttributes&&(n=s.attribute("number")),n){let s=parseInt(n.value,10);const r=t.elements("beam"),o=r[0].value;r&&("begin"===o?(s===(null===(i=this.openBeams.last())||void 0===i?void 0:i.BeamNumber)?(this.beamNumberOffset++,s+=this.beamNumberOffset):this.openBeams.last()&&this.handleOpenBeam(),this.openBeams.push(new h.Beam(s,this.beamNumberOffset))):s+=this.beamNumberOffset);let a=!1;if(!(s>0&&s<=this.openBeams.length&&this.openBeams[s-1]))return void E.default.debug("[OSMD] invalid beamnumber");for(let t=0,e=this.openBeams[s-1].Notes.length;t<e;++t){const e=this.openBeams[s-1].Notes[t];this.currentVoiceEntry===e.ParentVoiceEntry&&(a=!0)}a||(this.openBeams[s-1].addNoteToBeam(e),"end"===o&&this.endBeam())}}catch(t){const e=m.ITextTranslation.translateText("ReaderErrorMessages/BeamError","Error while reading beam.");throw this.musicSheet.SheetErrors.pushMeasureError(e),new b.MusicSheetReadingException("",t)}}endBeam(){this.openBeams.pop(),this.beamNumberOffset=Math.max(0,this.beamNumberOffset-1)}handleOpenBeam(){const t=this.openBeams.last();if(0!==t.Notes.length){if(1===t.Notes.length)return t.Notes[0].NoteBeam=void 0,void this.endBeam();if(this.currentNote===x.CollectionUtil.last(t.Notes))this.endBeam();else{const e=x.CollectionUtil.last(t.Notes).ParentStaffEntry,i=this.currentMeasure.getVerticalContainerIndexByTimestamp(e.Timestamp),s=e.VerticalContainerParent.StaffEntries.indexOf(e);if(i<this.currentMeasure.VerticalSourceStaffEntryContainers.length-1){const t=this.currentMeasure.VerticalSourceStaffEntryContainers[i+1].StaffEntries[s];if(t)for(let e=0,i=t.VoiceEntries.length;e<i;++e){const i=t.VoiceEntries[e];if(i.ParentVoice===this.voice){const t=i.Notes[0];t.Length.lte(new f.Fraction(1,8))?(this.openBeams.last().addNoteToBeam(t),this.endBeam()):this.endBeam()}}}else this.endBeam()}}else this.endBeam()}addTuplet(t,e){let i=!1;if(void 0!==e&&e.length>1){let s=t.element("time-modification");s&&(s=s.element("actual-notes"));const n=e;for(let e=0,r=n.length;e<r;++e){const r=n[e];if(void 0!==r&&r.attributes()){const e=r.attribute("bracket");e&&"yes"===e.value&&(i=!0);const n=r.attribute("type");if(n&&"start"===n.value){let e=1;r.attribute("number")&&(e=parseInt(r.attribute("number").value,10));let n=0;if(s&&(n=parseInt(s.value,10),isNaN(n))){const t=m.ITextTranslation.translateText("ReaderErrorMessages/TupletNoteDurationError","Invalid tuplet note duration.");throw this.musicSheet.SheetErrors.pushMeasureError(t),new b.MusicSheetReadingException(t,void 0)}const o=new d.Tuplet(n,i);o.tupletLabelNumberPlacement=L.PlacementEnum.Above;const a=r.attribute("placement");a&&("below"===a.value&&(o.tupletLabelNumberPlacement=L.PlacementEnum.Below),o.PlacementFromXml=!0),this.tupletDict[e]&&(delete this.tupletDict[e],0===Object.keys(this.tupletDict).length?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--),this.tupletDict[e]=o;const l=[];l.push(this.currentNote),o.Notes.push(l),o.Fractions.push(this.getTupletNoteDurationFromType(t)),this.currentNote.NoteTuplet=o,this.openTupletNumber=e}else if("stop"===n.value){let e=1;r.attribute("number")&&(e=parseInt(r.attribute("number").value,10));const i=this.tupletDict[e];if(i){const s=r.attribute("placement");s&&("below"===s.value?i.tupletLabelNumberPlacement=L.PlacementEnum.Below:i.tupletLabelNumberPlacement=L.PlacementEnum.Above,i.PlacementFromXml=!0);const n=[];if(n.push(this.currentNote),i.Notes.push(n),!i.PlacementFromXml){let t=!1;for(const e of i.Notes){for(const s of e)if(!s.isRest()){s.StemDirectionXml===o.StemDirectionType.Down?i.tupletLabelNumberPlacement=L.PlacementEnum.Below:i.tupletLabelNumberPlacement=L.PlacementEnum.Above,t=!0;break}if(t)break}}i.Fractions.push(this.getTupletNoteDurationFromType(t)),this.currentNote.NoteTuplet=i,delete this.tupletDict[e],0===Object.keys(this.tupletDict).length?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--}}}}}else if(e[0]){const s=e[0];if(s.hasAttributes){const e=s.attribute("type").value;let n=1;s.attribute("number")&&(n=parseInt(s.attribute("number").value,10));const r=isNaN(n),a=s.attribute("bracket");if(a&&"yes"===a.value&&(i=!0),"start"===e){let e=0,o=t.element("time-modification");if(o&&(o=o.element("actual-notes")),o&&(e=parseInt(o.value,10),isNaN(e))){const t=m.ITextTranslation.translateText("ReaderErrorMessages/TupletNoteDurationError","Invalid tuplet note duration.");throw this.musicSheet.SheetErrors.pushMeasureError(t),new b.MusicSheetReadingException(t)}r&&(this.openTupletNumber++,n=this.openTupletNumber);let a=this.tupletDict[n];a||(a=this.tupletDict[n]=new d.Tuplet(e,i),a.tupletLabelNumberPlacement=L.PlacementEnum.Above);const l=s.attribute("placement");l&&("below"===l.value?a.tupletLabelNumberPlacement=L.PlacementEnum.Below:a.tupletLabelNumberPlacement=L.PlacementEnum.Above,a.PlacementFromXml=!0);const h=[];h.push(this.currentNote),a.Notes.push(h),a.Fractions.push(this.getTupletNoteDurationFromType(t)),this.currentNote.NoteTuplet=a,this.openTupletNumber=n}else if("stop"===e){r&&(n=this.openTupletNumber);const e=this.tupletDict[this.openTupletNumber];if(e){const i=s.attribute("placement");i&&("below"===i.value?e.tupletLabelNumberPlacement=L.PlacementEnum.Below:e.tupletLabelNumberPlacement=L.PlacementEnum.Above,e.PlacementFromXml=!0);const r=[];if(r.push(this.currentNote),e.Notes.push(r),!e.PlacementFromXml){let t=!1;for(const i of e.Notes){for(const s of i)if(!s.isRest()){s.StemDirectionXml===o.StemDirectionType.Down?e.tupletLabelNumberPlacement=L.PlacementEnum.Below:e.tupletLabelNumberPlacement=L.PlacementEnum.Above,t=!0;break}if(t)break}}e.Fractions.push(this.getTupletNoteDurationFromType(t)),this.currentNote.NoteTuplet=e,0===Object.keys(this.tupletDict).length?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--,delete this.tupletDict[n]}}}}return this.openTupletNumber}handleTimeModificationNode(t){if(this.tupletDict[this.openTupletNumber])try{const e=this.tupletDict[this.openTupletNumber],i=x.CollectionUtil.last(e.Notes);let s;i[0].ParentVoiceEntry.Timestamp.Equals(this.currentVoiceEntry.Timestamp)?s=i:(s=[],e.Notes.push(s),e.Fractions.push(this.getTupletNoteDurationFromType(t))),s.push(this.currentNote),this.currentNote.NoteTuplet=e}catch(t){const e=m.ITextTranslation.translateText("ReaderErrorMessages/TupletNumberError","Invalid tuplet number.");throw this.musicSheet.SheetErrors.pushMeasureError(e),t}else if(this.currentVoiceEntry.Notes.length>0){const t=this.currentVoiceEntry.Notes[0];if(t.NoteTuplet){const e=t.NoteTuplet;x.CollectionUtil.last(e.Notes).push(this.currentNote),this.currentNote.NoteTuplet=e}}}addTie(t,e,i,s){if(t)if(1===t.length){const e=t[0];if(void 0!==e&&e.attributes()){const t=this.getTieDirection(e),i=e.attribute("type").value;try{if("start"===i){const e=this.findCurrentNoteInTieDict(this.currentNote);e<0&&delete this.openTieDict[e];const i=this.getNextAvailableNumberForTie(),n=new c.Tie(this.currentNote,s);this.openTieDict[i]=n,n.TieNumber=i,n.TieDirection=t}else if("stop"===i){const t=this.findCurrentNoteInTieDict(this.currentNote),e=this.openTieDict[t];e&&(e.AddNote(this.currentNote),delete this.openTieDict[t])}}catch(t){const e=m.ITextTranslation.translateText("ReaderErrorMessages/TieError","Error while reading tie.");this.musicSheet.SheetErrors.pushMeasureError(e)}}}else if(2===t.length){const e=this.findCurrentNoteInTieDict(this.currentNote);if(e>=0){const i=this.openTieDict[e];i.AddNote(this.currentNote);for(const e of t)if("start"===e.attribute("type").value){const t=this.getTieDirection(e);i.NoteIndexToTieDirection[i.Notes.length-1]=t}}}}getTieDirection(t){let e=L.PlacementEnum.NotYetDefined;const i=t.attribute("placement");i&&("above"===i.value?e=L.PlacementEnum.Above:"below"===i.value&&(e=L.PlacementEnum.Below));const s=t.attribute("orientation");return s&&("over"===s.value?e=L.PlacementEnum.Above:"under"===s.value&&(e=L.PlacementEnum.Below)),e}getNextAvailableNumberForTie(){const t=Object.keys(this.openTieDict);if(0===t.length)return 1;t.sort(((t,e)=>+t-+e));for(let e=0;e<t.length;e++)if(""+(e+1)!==t[e])return e+1;return+t[t.length-1]+1}findCurrentNoteInTieDict(t){const e=this.openTieDict;for(const i in e)if(e.hasOwnProperty(i)){const s=e[i],n=s.Notes[0],r=t;if(s.Pitch.FundamentalNote===t.Pitch.FundamentalNote&&s.Pitch.Octave===t.Pitch.Octave)return parseInt(i,10);if(void 0!==n.StringNumberTab&&n.StringNumberTab===r.StringNumberTab)return parseInt(i,10)}return-1}getTupletNoteDurationFromType(t){if(t.element("type")){const e=t.element("type");if(e){const t=e.value;try{return P.NoteTypeHandler.getNoteDurationFromType(t)}catch(t){const e=m.ITextTranslation.translateText("ReaderErrorMessages/NoteDurationError","Invalid note duration.");throw this.musicSheet.SheetErrors.pushMeasureError(e),new b.MusicSheetReadingException("",t)}}}}}},9714:function(t,e,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(t,e,i,s){void 0===s&&(s=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,s,n)}:function(t,e,i,s){void 0===s&&(s=i),t[s]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||s(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(2393),e),n(i(1372),e),n(i(8736),e),n(i(8109),e),n(i(1651),e),n(i(2458),e)},5142:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SubInstrument=void 0;const n=i(289),r=s(i(2043));class o{constructor(t){this.parentInstrument=t,this.fixedKey=-1,this.name=this.parseMidiInstrument(this.parentInstrument.Name),this.midiInstrumentID=o.midiInstrument[this.name],this.volume=1}get ParentInstrument(){return this.parentInstrument}static isPianoInstrument(t){return t===n.MidiInstrument.Acoustic_Grand_Piano||t===n.MidiInstrument.Bright_Acoustic_Piano||t===n.MidiInstrument.Electric_Grand_Piano||t===n.MidiInstrument.Electric_Piano_1||t===n.MidiInstrument.Electric_Piano_2}setMidiInstrument(t){this.midiInstrumentID=o.midiInstrument[this.parseMidiInstrument(t)]}parseMidiInstrument(t){try{if(t){const e=t.toLowerCase().trim();for(const t in o.midiInstrument)if(-1!==e.indexOf(t))return t}if(this.parentInstrument.Name){const t=this.parentInstrument.Name.toLowerCase().trim();for(const e in o.midiInstrument)if(-1!==t.indexOf(e))return e}}catch(t){r.default.error("Error parsing MIDI Instrument. Default to Grand Piano.")}return"unnamed"}}e.SubInstrument=o,o.midiInstrument={alt:n.MidiInstrument.Synth_Voice,alto:n.MidiInstrument.Synth_Voice,banjo:n.MidiInstrument.Banjo,bariton:n.MidiInstrument.Synth_Voice,baritone:n.MidiInstrument.Synth_Voice,bass:n.MidiInstrument.Synth_Voice,blockfloete:n.MidiInstrument.Recorder,brass:n.MidiInstrument.Trombone,bratsche:n.MidiInstrument.Viola,cello:n.MidiInstrument.Cello,clarinet:n.MidiInstrument.Clarinet,contrabass:n.MidiInstrument.Contrabass,drums:n.MidiInstrument.Percussion,flute:n.MidiInstrument.Flute,floete:n.MidiInstrument.Flute,frenchhorn:n.MidiInstrument.French_Horn,gitarre:n.MidiInstrument.Acoustic_Guitar_nylon,guitar:n.MidiInstrument.Acoustic_Guitar_nylon,harfe:n.MidiInstrument.Orchestral_Harp,harp:n.MidiInstrument.Orchestral_Harp,klarinette:n.MidiInstrument.Clarinet,klavier:n.MidiInstrument.Acoustic_Grand_Piano,kontrabass:n.MidiInstrument.Contrabass,oboe:n.MidiInstrument.Oboe,organ:n.MidiInstrument.Church_Organ,orgel:n.MidiInstrument.Church_Organ,orgue:n.MidiInstrument.Church_Organ,percussion:n.MidiInstrument.Percussion,piano:n.MidiInstrument.Acoustic_Grand_Piano,piccolo:n.MidiInstrument.Piccolo,posaune:n.MidiInstrument.Trombone,recorder:n.MidiInstrument.Recorder,sax:n.MidiInstrument.Tenor_Sax,schlagwerk:n.MidiInstrument.Percussion,schlagzeug:n.MidiInstrument.Percussion,sopran:n.MidiInstrument.Synth_Voice,steeldrum:n.MidiInstrument.Steel_Drums,streicher:n.MidiInstrument.String_Ensemble_1,strings:n.MidiInstrument.String_Ensemble_1,tenor:n.MidiInstrument.Synth_Voice,tpt:n.MidiInstrument.Trumpet,trombone:n.MidiInstrument.Trombone,trompete:n.MidiInstrument.Trumpet,trumpet:n.MidiInstrument.Trumpet,tuba:n.MidiInstrument.Tuba,unnamed:n.MidiInstrument.Acoustic_Grand_Piano,viola:n.MidiInstrument.Viola,violin:n.MidiInstrument.Violin,"violon-c":n.MidiInstrument.Cello,"violon.":n.MidiInstrument.Violin,voice:n.MidiInstrument.Synth_Voice,woodblock:n.MidiInstrument.Woodblock}},3029:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.ArpeggioType=e.Arpeggio=void 0,e.Arpeggio=class{constructor(t,e=i.ARPEGGIO_DIRECTIONLESS){this.parentVoiceEntry=t,this.type=e,this.notes=[]}addNote(t){this.notes.push(t),t.Arpeggio=this}},function(t){t[t.BRUSH_DOWN=1]="BRUSH_DOWN",t[t.BRUSH_UP=2]="BRUSH_UP",t[t.ROLL_DOWN=3]="ROLL_DOWN",t[t.ROLL_UP=4]="ROLL_UP",t[t.RASQUEDO_DOWN=5]="RASQUEDO_DOWN",t[t.RASQUEDO_UP=6]="RASQUEDO_UP",t[t.ARPEGGIO_DIRECTIONLESS=7]="ARPEGGIO_DIRECTIONLESS"}(i=e.ArpeggioType||(e.ArpeggioType={}))},1662:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Articulation=void 0,e.Articulation=class{constructor(t,e){this.articulationEnum=t,this.placement=e}Equals(t){return t.articulationEnum===this.articulationEnum&&t.placement===this.placement}}},9224:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.BeamEnum=e.Beam=void 0,e.Beam=class{constructor(t=1,e=0){this.notes=[],this.extendedNoteList=[],this.BeamNumberOffsetToXML=0,this.BeamNumber=t,this.BeamNumberOffsetToXML=e}get Notes(){return this.notes}set Notes(t){this.notes=t}get ExtendedNoteList(){return this.extendedNoteList}set ExtendedNoteList(t){this.extendedNoteList=t}addNoteToBeam(t){t&&(t.NoteBeam=this,this.notes.push(t),this.extendedNoteList.push(t))}},(i=e.BeamEnum||(e.BeamEnum={}))[i.BeamNone=-1]="BeamNone",i[i.BeamBegin=0]="BeamBegin",i[i.BeamContinue=1]="BeamContinue",i[i.BeamEnd=2]="BeamEnd",i[i.BeamForward=3]="BeamForward",i[i.BeamBackward=4]="BeamBackward"},4123:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChordSymbolEnum=e.ChordDegreeText=e.CustomChord=e.Degree=e.ChordSymbolContainer=void 0;const s=i(8640),n=i(4040),r=i(8640);e.ChordSymbolContainer=class{constructor(t,e,i,s,n){this.rootPitch=t,this.chordKind=e,this.bassPitch=i,this.degrees=s,this.rules=n}get RootPitch(){return this.rootPitch}get ChordKind(){return this.chordKind}get BassPitch(){return this.bassPitch}get ChordDegrees(){return this.degrees}static calculateChordText(t,e,i){let o=t.RootPitch;if(n.MusicSheetCalculator.transposeCalculator&&(o=n.MusicSheetCalculator.transposeCalculator.transposePitch(t.RootPitch,i,e)),t.ChordKind===l.none)return t.getTextFromChordKindEnum(t.ChordKind);let h=s.Pitch.getNoteEnumString(o.FundamentalNote);o.Accidental!==r.AccidentalEnum.NONE&&(h+=t.getTextForAccidental(o.Accidental));const c={adds:[],alts:[],subs:[]};for(const e of t.ChordDegrees)if(e){let i="";switch(e.alteration!==r.AccidentalEnum.NONE&&(i+=t.getTextForAccidental(e.alteration)),i+=e.value,e.text){case a.add:c.adds.push(i);break;case a.alter:c.alts.push(i);break;case a.subtract:c.subs.push(i)}}let u=t.getTextFromChordKindEnum(t.ChordKind);const d=["adds","alts","subs"],f=t.rules.CustomChords;for(const e of f){if(e.chordKind!==t.chordKind)continue;let i=!0;for(const t of d){for(const s of e.degrees[t]||[])if(c[t].indexOf(s)<0){i=!1;break}if(!i)break}if(i){for(const t of d)for(const i of e.degrees[t]||[])c[t].splice(c[t].indexOf(i),1);u=e.alternateName}}if(h+=u,c.adds.length>0&&(h+="("+c.adds.join(",")+")"),c.alts.length>0&&(h+="(alt "+c.alts.join(",")+")"),c.subs.length>0&&(h+="(omit "+c.subs.join(",")+")"),t.BassPitch){let r=t.BassPitch;n.MusicSheetCalculator.transposeCalculator&&(r=n.MusicSheetCalculator.transposeCalculator.transposePitch(t.BassPitch,i,e)),h+="/",h+=s.Pitch.getNoteEnumString(r.FundamentalNote),h+=t.getTextForAccidental(r.Accidental)}return h}getTextForAccidental(t){const e=this.rules.ChordAccidentalTexts.getValue(t);return void 0!==e?e:""}getTextFromChordKindEnum(t){var e;return null!==(e=this.rules.ChordSymbolLabelTexts.getValue(t))&&void 0!==e?e:""}},e.Degree=class{constructor(t,e,i){this.value=t,this.alteration=e,this.text=i}};class o{constructor(t,e,i){this.alternateName=t,this.chordKind=e,this.degrees=i}static createCustomChord(t,e,i){return new o(t,e,i)}static renameCustomChord(t,e,i){for(const s of i)s.alternateName===t&&(s.alternateName=e)}}var a,l;e.CustomChord=o,function(t){t[t.add=0]="add",t[t.alter=1]="alter",t[t.subtract=2]="subtract"}(a=e.ChordDegreeText||(e.ChordDegreeText={})),function(t){t[t.major=0]="major",t[t.minor=1]="minor",t[t.augmented=2]="augmented",t[t.diminished=3]="diminished",t[t.dominant=4]="dominant",t[t.majorseventh=5]="majorseventh",t[t.minorseventh=6]="minorseventh",t[t.diminishedseventh=7]="diminishedseventh",t[t.augmentedseventh=8]="augmentedseventh",t[t.halfdiminished=9]="halfdiminished",t[t.majorminor=10]="majorminor",t[t.majorsixth=11]="majorsixth",t[t.minorsixth=12]="minorsixth",t[t.dominantninth=13]="dominantninth",t[t.majorninth=14]="majorninth",t[t.minorninth=15]="minorninth",t[t.dominant11th=16]="dominant11th",t[t.major11th=17]="major11th",t[t.minor11th=18]="minor11th",t[t.dominant13th=19]="dominant13th",t[t.major13th=20]="major13th",t[t.minor13th=21]="minor13th",t[t.suspendedsecond=22]="suspendedsecond",t[t.suspendedfourth=23]="suspendedfourth",t[t.Neapolitan=24]="Neapolitan",t[t.Italian=25]="Italian",t[t.French=26]="French",t[t.German=27]="German",t[t.pedal=28]="pedal",t[t.power=29]="power",t[t.Tristan=30]="Tristan",t[t.none=31]="none"}(l=e.ChordSymbolEnum||(e.ChordSymbolEnum={}))},3748:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.PlacementEnum=e.AbstractExpression=void 0,e.AbstractExpression=class{constructor(t){this.placement=t}static isStringInStringList(t,e){for(let i=0,s=t.length;i<s;++i){const s=t[i];if(e.toLowerCase()===s.toLowerCase().trim())return!0}return!1}get Placement(){return this.placement}static PlacementEnumFromString(t){switch(t.toLowerCase()){case"above":return i.Above;case"below":return i.Below;case"aboveorbelow":case"abovebelow":return i.AboveOrBelow;case"left":return i.Left;case"right":return i.Right;default:return i.NotYetDefined}}},function(t){t[t.Above=0]="Above",t[t.Below=1]="Below",t[t.Left=2]="Left",t[t.Right=3]="Right",t[t.NotYetDefined=4]="NotYetDefined",t[t.AboveOrBelow=5]="AboveOrBelow"}(i=e.PlacementEnum||(e.PlacementEnum={}))},9775:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractTempoExpression=void 0;const s=i(3748);class n extends s.AbstractExpression{constructor(t,e,i,s){super(e),this.label=t,this.staffNumber=i,this.parentMultiTempoExpression=s}get Label(){return this.label}set Label(t){this.label=t}get Placement(){return this.placement}set Placement(t){this.placement=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get ParentMultiTempoExpression(){return this.parentMultiTempoExpression}static isStringInStringList(t,e){for(const i of t)if(n.stringContainsSeparatedWord(e.toLowerCase().trim(),i.toLowerCase().trim()))return!0;return!1}static stringContainsSeparatedWord(t,e){return t===e||-1!==t.indexOf(" "+e)||-1!==t.indexOf(e+" ")}}e.AbstractTempoExpression=n},7839:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContDynamicEnum=e.ContinuousDynamicExpression=void 0;const s=i(3748),n=i(1797);class r extends s.AbstractExpression{constructor(t,e,i,s,n,r=""){super(e),super.parentMeasure=s,this.NumberXml=n,this.dynamicType=t,this.label=r,this.staffNumber=i,this.startVolume=-1,this.endVolume=-1,""!==r&&this.setType()}get DynamicType(){return this.dynamicType}set DynamicType(t){this.dynamicType=t}get StartMultiExpression(){return this.startMultiExpression}set StartMultiExpression(t){this.startMultiExpression=t}get EndMultiExpression(){return this.endMultiExpression}set EndMultiExpression(t){this.endMultiExpression=t}get Placement(){return this.placement}set Placement(t){this.placement=t}get StartVolume(){return this.startVolume}set StartVolume(t){this.startVolume=t}get EndVolume(){return this.endVolume}set EndVolume(t){this.endVolume=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get Label(){return this.label}set Label(t){this.label=t,this.setType()}static isInputStringContinuousDynamic(t){return!!t&&(r.isStringInStringList(r.listContinuousDynamicIncreasing,t)||r.isStringInStringList(r.listContinuousDynamicDecreasing,t))}getInterpolatedDynamic(t){const e=this.StartMultiExpression.AbsoluteTimestamp;let i;if(i=this.EndMultiExpression?this.EndMultiExpression.AbsoluteTimestamp:n.Fraction.plus(this.startMultiExpression.SourceMeasureParent.AbsoluteTimestamp,this.startMultiExpression.SourceMeasureParent.Duration),t.lt(e))return-1;if(i.lt(t))return-2;const s=n.Fraction.minus(t,e).RealValue/n.Fraction.minus(i,e).RealValue;return Math.max(0,Math.min(99.9,this.startVolume+(this.endVolume-this.startVolume)*s))}isWedge(){return!this.label}setType(){r.isStringInStringList(r.listContinuousDynamicIncreasing,this.label)?this.dynamicType=o.crescendo:r.isStringInStringList(r.listContinuousDynamicDecreasing,this.label)&&(this.dynamicType=o.diminuendo)}}var o;e.ContinuousDynamicExpression=r,r.listContinuousDynamicIncreasing=["crescendo","cresc","cresc.","cres."],r.listContinuousDynamicDecreasing=["decrescendo","decresc","decr.","diminuendo","dim.","dim"],function(t){t[t.crescendo=0]="crescendo",t[t.diminuendo=1]="diminuendo"}(o=e.ContDynamicEnum||(e.ContDynamicEnum={}))},280:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContinuousTempoType=e.ContinuousTempoExpression=void 0;const s=i(1797),n=i(9775);class r extends n.AbstractTempoExpression{constructor(t,e,i,s){super(t,e,i,s),this.setTempoType()}static isInputStringContinuousTempo(t){return!!t&&(r.isStringInStringList(r.listContinuousTempoFaster,t)||r.isStringInStringList(r.listContinuousTempoSlower,t))}static isIncreasingTempo(t){return t<=o.piuMosso}static isDecreasingTempo(t){return t>=o.allargando&&t<=o.ritenuto}get TempoType(){return this.tempoType}set TempoType(t){this.tempoType=t}get StartTempo(){return this.startTempo}set StartTempo(t){this.startTempo=t}get EndTempo(){return this.endTempo}set EndTempo(t){this.endTempo=t}get AbsoluteEndTimestamp(){return this.absoluteEndTimestamp}set AbsoluteEndTimestamp(t){this.absoluteEndTimestamp=t}get AbsoluteTimestamp(){return this.ParentMultiTempoExpression.AbsoluteTimestamp}getAbsoluteFloatTimestamp(){return this.ParentMultiTempoExpression.AbsoluteTimestamp.RealValue}getInterpolatedTempo(t){const e=s.Fraction.plus(this.parentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.parentMultiTempoExpression.Timestamp);if(t.lt(e))return-1;if(this.absoluteEndTimestamp.lt(t))return-2;const i=s.Fraction.minus(t,e).RealValue/s.Fraction.minus(this.absoluteEndTimestamp,e).RealValue;return Math.max(0,Math.min(250,this.startTempo+(this.endTempo-this.startTempo)*i))}setTempoType(){r.isStringInStringList(r.listContinuousTempoFaster,this.label)?this.tempoType=o.accelerando:r.isStringInStringList(r.listContinuousTempoSlower,this.label)&&(this.tempoType=o.ritardando)}}var o;e.ContinuousTempoExpression=r,r.listContinuousTempoFaster=["accelerando","piu mosso","poco piu","stretto"],r.listContinuousTempoSlower=["poco meno","meno mosso","piu lento","calando","allargando","rallentando","ritardando","ritenuto","ritard.","ritard","rit.","rit","riten.","riten"],function(t){t[t.accelerando=0]="accelerando",t[t.stretto=1]="stretto",t[t.stringendo=2]="stringendo",t[t.mosso=3]="mosso",t[t.piuMosso=4]="piuMosso",t[t.allargando=5]="allargando",t[t.calando=6]="calando",t[t.menoMosso=7]="menoMosso",t[t.rallentando=8]="rallentando",t[t.ritardando=9]="ritardando",t[t.ritard=10]="ritard",t[t.rit=11]="rit",t[t.ritenuto=12]="ritenuto",t[t.rubato=13]="rubato",t[t.precipitando=14]="precipitando"}(o=e.ContinuousTempoType||(e.ContinuousTempoType={}))},5853:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OctaveEnum=e.OctaveShift=void 0;const s=i(8640);var n;e.OctaveShift=class{constructor(t,e){this.numberXml=1,this.setOctaveShiftValue(t,e)}get Type(){return this.octaveValue}set Type(t){this.octaveValue=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get ParentStartMultiExpression(){return this.startMultiExpression}set ParentStartMultiExpression(t){this.startMultiExpression=t}get ParentEndMultiExpression(){return this.endMultiExpression}set ParentEndMultiExpression(t){this.endMultiExpression=t}setOctaveShiftValue(t,e){this.octaveValue=1===e&&"down"===t?n.VA8:1===e&&"up"===t?n.VB8:2===e&&"down"===t?n.MA15:2===e&&"up"===t?n.MB15:n.NONE}static getPitchFromOctaveShift(t,e){if(!t)return;let i=t.Octave;switch(e){case n.VA8:i-=1;break;case n.VB8:i+=1;break;case n.MA15:i-=2;break;case n.MB15:i+=2;break;case n.NONE:default:i+=0}return new s.Pitch(t.FundamentalNote,i,t.Accidental)}},function(t){t[t.VA8=0]="VA8",t[t.VB8=1]="VB8",t[t.MA15=2]="MA15",t[t.MB15=3]="MB15",t[t.NONE=4]="NONE"}(n=e.OctaveEnum||(e.OctaveEnum={}))},308:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Pedal=void 0,e.Pedal=class{constructor(t=!1,e=!0){this.ChangeEnd=!1,this.ChangeBegin=!1,this.EndsStave=!1,this.BeginsStave=!1,this.line=t,this.sign=e}get IsLine(){return this.line}get IsSign(){return this.sign}}},1928:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Slur=void 0;const s=i(1797);e.Slur=class{constructor(){}get StartNote(){return this.startNote}set StartNote(t){this.startNote=t}get EndNote(){return this.endNote}set EndNote(t){this.endNote=t}startNoteHasMoreStartingSlurs(){if(!this.startNote)return!1;for(let t=0,e=this.startNote.NoteSlurs.length;t<e;++t){const e=this.startNote.NoteSlurs[t];if(e!==this&&e.StartNote===this.startNote)return!0}return!1}endNoteHasMoreEndingSlurs(){if(!this.endNote)return!1;for(let t=0,e=this.endNote.NoteSlurs.length;t<e;++t){const e=this.endNote.NoteSlurs[t];if(e!==this&&e.EndNote===this.endNote)return!0}return!1}isCrossed(){return this.startNote.ParentStaffEntry.ParentStaff!==this.endNote.ParentStaffEntry.ParentStaff}isSlurLonger(){if(!this.endNote||!this.startNote)return!1;const t=s.Fraction.minus(this.endNote.getAbsoluteTimestamp(),this.startNote.getAbsoluteTimestamp());for(let e=0,i=this.startNote.NoteSlurs.length;e<i;++e){const i=this.startNote.NoteSlurs[e];if(i!==this&&void 0!==i.EndNote&&void 0!==i.StartNote&&-1===s.Fraction.minus(i.EndNote.getAbsoluteTimestamp(),i.StartNote.getAbsoluteTimestamp()).CompareTo(t))return!0}for(let e=0,i=this.endNote.NoteSlurs.length;e<i;++e){const i=this.endNote.NoteSlurs[e];if(i!==this&&void 0!==i.EndNote&&void 0!==i.StartNote&&s.Fraction.minus(i.EndNote.getAbsoluteTimestamp(),i.StartNote.getAbsoluteTimestamp()).CompareTo(t))return!0}return!1}}},8084:function(t,e,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(t,e,i,s){void 0===s&&(s=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,s,n)}:function(t,e,i,s){void 0===s&&(s=i),t[s]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||s(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(7839),e),n(i(280),e),n(i(5853),e),n(i(1928),e)},4802:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.DynamicExpressionSymbolEnum=void 0,(i=e.DynamicExpressionSymbolEnum||(e.DynamicExpressionSymbolEnum={}))[i.p=0]="p",i[i.f=1]="f",i[i.s=2]="s",i[i.z=3]="z",i[i.m=4]="m",i[i.r=5]="r"},9793:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.DynamicEnum=e.InstantaneousDynamicExpression=void 0;const n=i(3748),r=i(4802),o=i(1703),a=s(i(2043)),l=i(1649);class h extends n.AbstractExpression{constructor(t,e,i,s,n){super(i),super.parentMeasure=n,this.dynamicEnum=c[t.toLowerCase()],this.soundDynamic=e,this.staffNumber=s}static staticConstructor(){h.dynamicToRelativeVolumeDict.setValue(c.ffffff,1),h.dynamicToRelativeVolumeDict.setValue(c.fffff,126/127),h.dynamicToRelativeVolumeDict.setValue(c.ffff,125/127),h.dynamicToRelativeVolumeDict.setValue(c.fff,124/127),h.dynamicToRelativeVolumeDict.setValue(c.ff,122/127),h.dynamicToRelativeVolumeDict.setValue(c.f,108/127),h.dynamicToRelativeVolumeDict.setValue(c.mf,76/127),h.dynamicToRelativeVolumeDict.setValue(c.sf,.5),h.dynamicToRelativeVolumeDict.setValue(c.sfp,.5),h.dynamicToRelativeVolumeDict.setValue(c.sfpp,.5),h.dynamicToRelativeVolumeDict.setValue(c.fp,.5),h.dynamicToRelativeVolumeDict.setValue(c.rf,.5),h.dynamicToRelativeVolumeDict.setValue(c.rfz,.5),h.dynamicToRelativeVolumeDict.setValue(c.sfz,.5),h.dynamicToRelativeVolumeDict.setValue(c.sffz,.5),h.dynamicToRelativeVolumeDict.setValue(c.fz,.5),h.dynamicToRelativeVolumeDict.setValue(c.mp,60/127),h.dynamicToRelativeVolumeDict.setValue(c.p,28/127),h.dynamicToRelativeVolumeDict.setValue(c.pp,12/127),h.dynamicToRelativeVolumeDict.setValue(c.ppp,10/127),h.dynamicToRelativeVolumeDict.setValue(c.pppp,7/127),h.dynamicToRelativeVolumeDict.setValue(c.ppppp,5/127),h.dynamicToRelativeVolumeDict.setValue(c.pppppp,4/127)}get ParentMultiExpression(){return this.multiExpression}set ParentMultiExpression(t){this.multiExpression=t}get DynEnum(){return this.dynamicEnum}set DynEnum(t){this.dynamicEnum=t}get SoundDynamic(){return this.soundDynamic}set SoundDynamic(t){this.soundDynamic=t}get Placement(){return this.placement}set Placement(t){this.placement=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get Length(){return Math.abs(this.length)<1e-4&&(this.length=this.calculateLength()),this.length}get MidiVolume(){return 127*this.Volume}get Volume(){return h.dynamicToRelativeVolumeDict.getValue(this.dynamicEnum)}static isInputStringInstantaneousDynamic(t){return!!t&&h.isStringInStringList(h.listInstantaneousDynamics,t)}getDynamicExpressionSymbol(t){switch(t){case"p":return r.DynamicExpressionSymbolEnum.p;case"f":return r.DynamicExpressionSymbolEnum.f;case"s":return r.DynamicExpressionSymbolEnum.s;case"z":return r.DynamicExpressionSymbolEnum.z;case"m":return r.DynamicExpressionSymbolEnum.m;case"r":return r.DynamicExpressionSymbolEnum.r;default:throw new o.InvalidEnumArgumentException("unknown DynamicExpressionSymbolEnum: "+t)}}calculateLength(){return a.default.debug("[Andrea] instantaneousDynamicExpression: not implemented: calculateLength!"),0}}var c;e.InstantaneousDynamicExpression=h,h.dynamicToRelativeVolumeDict=new l.Dictionary,h.listInstantaneousDynamics=["pppppp","ppppp","pppp","ppp","pp","p","ffffff","fffff","ffff","fff","ff","f","mf","mp","sf","sff","sp","spp","fp","rf","rfz","sfz","sffz","fz"],function(t){t[t.pppppp=0]="pppppp",t[t.ppppp=1]="ppppp",t[t.pppp=2]="pppp",t[t.ppp=3]="ppp",t[t.pp=4]="pp",t[t.p=5]="p",t[t.mp=6]="mp",t[t.mf=7]="mf",t[t.f=8]="f",t[t.ff=9]="ff",t[t.fff=10]="fff",t[t.ffff=11]="ffff",t[t.fffff=12]="fffff",t[t.ffffff=13]="ffffff",t[t.sf=14]="sf",t[t.sff=15]="sff",t[t.sfp=16]="sfp",t[t.sfpp=17]="sfpp",t[t.fp=18]="fp",t[t.rf=19]="rf",t[t.rfz=20]="rfz",t[t.sfz=21]="sfz",t[t.sffz=22]="sffz",t[t.fz=23]="fz",t[t.other=24]="other"}(c=e.DynamicEnum||(e.DynamicEnum={})),h.staticConstructor()},9667:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TempoEnum=e.InstantaneousTempoExpression=void 0;const s=i(9775),n=i(1703),r=i(1797);class o extends s.AbstractTempoExpression{constructor(t,e,i,s,n,r=!1){super(t,e,i,n),this.setTempoAndTempoType(s)}static getDefaultValueForTempoType(t){switch(t){case a.larghissimo:return 20;case a.grave:return 30;case a.lento:return 48;case a.largo:return 52;case a.larghetto:return 63;case a.adagio:return 70;case a.adagietto:return 75;case a.andanteModerato:return 88;case a.andante:return 92;case a.andantino:return 96;case a.moderato:return 106;case a.allegretto:return 112;case a.allegroModerato:return 118;case a.allegro:return 130;case a.vivace:return 140;case a.vivacissimo:return 155;case a.allegrissimo:return 170;case a.presto:return 184;case a.prestissimo:return 200;default:throw new n.ArgumentOutOfRangeException("tempoEnum")}}static isInputStringInstantaneousTempo(t){return!!t&&(o.isStringInStringList(o.listInstantaneousTempoLarghissimo,t)||o.isStringInStringList(o.listInstantaneousTempoGrave,t)||o.isStringInStringList(o.listInstantaneousTempoLento,t)||o.isStringInStringList(o.listInstantaneousTempoLargo,t)||o.isStringInStringList(o.listInstantaneousTempoLarghetto,t)||o.isStringInStringList(o.listInstantaneousTempoAdagio,t)||o.isStringInStringList(o.listInstantaneousTempoAdagietto,t)||o.isStringInStringList(o.listInstantaneousTempoAndanteModerato,t)||o.isStringInStringList(o.listInstantaneousTempoAndante,t)||o.isStringInStringList(o.listInstantaneousTempoAndantino,t)||o.isStringInStringList(o.listInstantaneousTempoModerato,t)||o.isStringInStringList(o.listInstantaneousTempoAllegretto,t)||o.isStringInStringList(o.listInstantaneousTempoAllegroModerato,t)||o.isStringInStringList(o.listInstantaneousTempoAllegro,t)||o.isStringInStringList(o.listInstantaneousTempoVivace,t)||o.isStringInStringList(o.listInstantaneousTempoVivacissimo,t)||o.isStringInStringList(o.listInstantaneousTempoAllegrissimo,t)||o.isStringInStringList(o.listInstantaneousTempoPresto,t)||o.isStringInStringList(o.listInstantaneousTempoPrestissimo,t)||o.isStringInStringList(o.listInstantaneousTempoChangesGeneral,t))}get Label(){return this.label}set Label(t){this.label=t}get Placement(){return this.placement}set Placement(t){this.placement=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get Enum(){return this.tempoEnum}get TempoInBpm(){return this.tempoInBpm}set TempoInBpm(t){this.tempoInBpm=t}get ParentMultiTempoExpression(){return this.parentMultiTempoExpression}getAbsoluteTimestamp(){return r.Fraction.plus(this.ParentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.ParentMultiTempoExpression.Timestamp)}getAbsoluteFloatTimestamp(){return r.Fraction.plus(this.ParentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.ParentMultiTempoExpression.Timestamp).RealValue}setTempoAndTempoType(t){return this.label?o.isStringInStringList(o.listInstantaneousTempoLarghissimo,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.larghissimo)),this.tempoInBpm=t,void(this.tempoEnum=a.larghissimo)):o.isStringInStringList(o.listInstantaneousTempoGrave,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.grave)),this.tempoInBpm=t,void(this.tempoEnum=a.grave)):o.isStringInStringList(o.listInstantaneousTempoLento,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.lento)),this.tempoInBpm=t,void(this.tempoEnum=a.lento)):o.isStringInStringList(o.listInstantaneousTempoLargo,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.largo)),this.tempoInBpm=t,void(this.tempoEnum=a.largo)):o.isStringInStringList(o.listInstantaneousTempoLarghetto,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.larghetto)),this.tempoInBpm=t,void(this.tempoEnum=a.larghetto)):o.isStringInStringList(o.listInstantaneousTempoAdagio,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.adagio)),this.tempoInBpm=t,void(this.tempoEnum=a.adagio)):o.isStringInStringList(o.listInstantaneousTempoAdagietto,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.adagietto)),this.tempoInBpm=t,void(this.tempoEnum=a.adagietto)):o.isStringInStringList(o.listInstantaneousTempoAndanteModerato,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.andanteModerato)),this.tempoInBpm=t,void(this.tempoEnum=a.andanteModerato)):o.isStringInStringList(o.listInstantaneousTempoAndante,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.andante)),this.tempoInBpm=t,void(this.tempoEnum=a.andante)):o.isStringInStringList(o.listInstantaneousTempoAndantino,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.andantino)),this.tempoInBpm=t,void(this.tempoEnum=a.andantino)):o.isStringInStringList(o.listInstantaneousTempoModerato,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.moderato)),this.tempoInBpm=t,void(this.tempoEnum=a.moderato)):o.isStringInStringList(o.listInstantaneousTempoAllegretto,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.allegretto)),this.tempoInBpm=t,void(this.tempoEnum=a.allegretto)):o.isStringInStringList(o.listInstantaneousTempoAllegroModerato,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.allegroModerato)),this.tempoInBpm=t,void(this.tempoEnum=a.allegroModerato)):o.isStringInStringList(o.listInstantaneousTempoAllegro,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.allegro)),this.tempoInBpm=t,void(this.tempoEnum=a.allegro)):o.isStringInStringList(o.listInstantaneousTempoVivace,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.vivace)),this.tempoInBpm=t,void(this.tempoEnum=a.vivace)):o.isStringInStringList(o.listInstantaneousTempoVivacissimo,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.vivacissimo)),this.tempoInBpm=t,void(this.tempoEnum=a.vivacissimo)):o.isStringInStringList(o.listInstantaneousTempoAllegrissimo,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.allegrissimo)),this.tempoInBpm=t,void(this.tempoEnum=a.allegrissimo)):o.isStringInStringList(o.listInstantaneousTempoPresto,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.presto)),this.tempoInBpm=t,void(this.tempoEnum=a.presto)):o.isStringInStringList(o.listInstantaneousTempoPrestissimo,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.prestissimo)),this.tempoInBpm=t,void(this.tempoEnum=a.prestissimo)):o.isStringInStringList(o.listInstantaneousTempoAddons,this.label)?(this.tempoInBpm=0,void(this.tempoEnum=a.addon)):o.isStringInStringList(o.listInstantaneousTempoChangesGeneral,this.label)?(this.tempoInBpm=0,void(this.tempoEnum=a.changes)):void 0:(this.tempoInBpm=t,void(this.tempoEnum=a.metronomeMark))}}var a;e.InstantaneousTempoExpression=o,o.listInstantaneousTempoLarghissimo=["Larghissimo","Sehr breit","very, very slow"],o.listInstantaneousTempoGrave=["Grave","Schwer","slow and solemn"],o.listInstantaneousTempoLento=["Lento","Lent","Langsam","slowly"],o.listInstantaneousTempoLargo=["Largo","Breit","broadly"],o.listInstantaneousTempoLarghetto=["Larghetto","Etwas breit","rather broadly"],o.listInstantaneousTempoAdagio=["Adagio","Langsam","Ruhig","slow and stately"],o.listInstantaneousTempoAdagietto=["Adagietto","Ziemlich ruhig","Ziemlich langsam","rather slow"],o.listInstantaneousTempoAndanteModerato=["Andante moderato"],o.listInstantaneousTempoAndante=["Andante","Gehend","Schreitend","at a walking pace"],o.listInstantaneousTempoAndantino=["Andantino"],o.listInstantaneousTempoModerato=["Moderato","Mäßig","Modéré","moderately"],o.listInstantaneousTempoAllegretto=["Allegretto","fast"],o.listInstantaneousTempoAllegroModerato=["Allegro moderato"],o.listInstantaneousTempoAllegro=["Allegro","Rapide","Vite","Rasch","Schnell","Fröhlich"],o.listInstantaneousTempoVivace=["Vivace","Lebhaft","Lebendig","lively and fast"],o.listInstantaneousTempoVivacissimo=["Vivacissimo","Sehr lebhaft","Sehr lebendig"],o.listInstantaneousTempoAllegrissimo=["Allegrissimo","very fast"],o.listInstantaneousTempoPresto=["Presto","Sehr schnell","Geschwind"],o.listInstantaneousTempoPrestissimo=["Prestissimo","äußerst schnell"],o.listInstantaneousTempoChangesGeneral=["tempo primo","a tempo","tempo i","rubato","doppio movimento","rallentando","ritardando","ritard.","rit.","ritard","rall...","accelerando","accel"],o.listInstantaneousTempoAddons=["assai","amoroso","cantabile","con brio","con dolore","con espressione","con fuoco","con moto","con spirito","spiritoso","espressivo","giocoso","giusto","grazioso","lesto","lugubre","maestoso","ma non troppo","marcato","molto","morendo","mosso","non tanto","piu","un poco","poco","quasi","risoluto","scherzando","sostenuto","teneramente","tempo giusto","tranquillo","sehr","lieblich","liebevoll","mit Leidenschaft","mit Liebe","amourös","gesanglich","mit Schwung","mit Feuer","mit Schmerz","mit Ausdruck","mit Bewegung","geistvoll","ausdrucksvoll","freudig","verspielt","angemessen","graziös","mit Grazie","flink","behände","traurig","klagend","majestätisch","aber nicht zu sehr","markant","gemäßigt","viel","sehr","ersterbend","bewegt","nicht zu sehr","mehr","ein wenig","gleichsam","entschlossen","zupackend","heiter","nachdrücklich","getragen","gewichtig","zart","zärtlich","im angemessenen Zeitmaß","ruhig","ein wenig","alla marcia","ad libitum","alla breve"],function(t){t[t.none=0]="none",t[t.larghissimo=1]="larghissimo",t[t.grave=2]="grave",t[t.lento=3]="lento",t[t.largo=4]="largo",t[t.larghetto=5]="larghetto",t[t.adagio=6]="adagio",t[t.adagietto=7]="adagietto",t[t.andanteModerato=8]="andanteModerato",t[t.andante=9]="andante",t[t.andantino=10]="andantino",t[t.moderato=11]="moderato",t[t.allegretto=12]="allegretto",t[t.allegroModerato=13]="allegroModerato",t[t.allegro=14]="allegro",t[t.vivace=15]="vivace",t[t.vivacissimo=16]="vivacissimo",t[t.allegrissimo=17]="allegrissimo",t[t.presto=18]="presto",t[t.prestissimo=19]="prestissimo",t[t.lastRealTempo=20]="lastRealTempo",t[t.addon=21]="addon",t[t.changes=22]="changes",t[t.metronomeMark=23]="metronomeMark"}(a=e.TempoEnum||(e.TempoEnum={}))},7527:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MoodEnum=e.MoodExpression=void 0;const s=i(3748);class n extends s.AbstractExpression{constructor(t,e,i){super(e),this.label=t,this.staffNumber=i,this.setMoodType()}static isInputStringMood(t){return!!t&&(n.isStringInStringList(n.listMoodAffettuoso,t)||n.isStringInStringList(n.listMoodAgitato,t)||n.isStringInStringList(n.listMoodAnimato,t)||n.isStringInStringList(n.listMoodAppassionato,t)||n.isStringInStringList(n.listMoodBrillante,t)||n.isStringInStringList(n.listMoodCantabile,t)||n.isStringInStringList(n.listMoodDolce,t)||n.isStringInStringList(n.listMoodEnergico,t)||n.isStringInStringList(n.listMoodEroico,t)||n.isStringInStringList(n.listMoodEspressivo,t)||n.isStringInStringList(n.listMoodFurioso,t)||n.isStringInStringList(n.listMoodGiocoso,t)||n.isStringInStringList(n.listMoodGioioso,t)||n.isStringInStringList(n.listMoodGrandioso,t)||n.isStringInStringList(n.listMoodGrazioso,t)||n.isStringInStringList(n.listMoodLacrimoso,t)||n.isStringInStringList(n.listMoodLeggiero,t)||n.isStringInStringList(n.listMoodMaestoso,t)||n.isStringInStringList(n.listMoodMalinconico,t)||n.isStringInStringList(n.listMoodMarcato,t)||n.isStringInStringList(n.listMoodMarziale,t)||n.isStringInStringList(n.listMoodMesto,t)||n.isStringInStringList(n.listMoodMorendo,t)||n.isStringInStringList(n.listMoodNobilmente,t)||n.isStringInStringList(n.listMoodPatetico,t)||n.isStringInStringList(n.listMoodPesante,t)||n.isStringInStringList(n.listMoodSaltando,t)||n.isStringInStringList(n.listMoodSautille,t)||n.isStringInStringList(n.listMoodScherzando,t)||n.isStringInStringList(n.listMoodSostenuto,t)||n.isStringInStringList(n.listMoodSpiccato,t)||n.isStringInStringList(n.listMoodTenerezza,t)||n.isStringInStringList(n.listMoodTranquillamente,t)||n.isStringInStringList(n.listMoodTrionfante,t))}get Label(){return this.label}set Label(t){this.label=t}get Mood(){return this.moodType}set Mood(t){this.moodType=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get Placement(){return this.placement}set Placement(t){this.placement=t}setMoodType(){n.isStringInStringList(n.listMoodAffettuoso,this.label)?this.moodType=r.Affettuoso:n.isStringInStringList(n.listMoodAgitato,this.label)?this.moodType=r.Agitato:n.isStringInStringList(n.listMoodAnimato,this.label)?this.moodType=r.Animato:n.isStringInStringList(n.listMoodAppassionato,this.label)?this.moodType=r.Appassionato:n.isStringInStringList(n.listMoodBrillante,this.label)?this.moodType=r.Brillante:n.isStringInStringList(n.listMoodCantabile,this.label)?this.moodType=r.Cantabile:n.isStringInStringList(n.listMoodDolce,this.label)?this.moodType=r.Dolce:n.isStringInStringList(n.listMoodEnergico,this.label)?this.moodType=r.Energico:n.isStringInStringList(n.listMoodEroico,this.label)?this.moodType=r.Eroico:n.isStringInStringList(n.listMoodEspressivo,this.label)?this.moodType=r.Espressivo:n.isStringInStringList(n.listMoodFurioso,this.label)?this.moodType=r.Furioso:n.isStringInStringList(n.listMoodGiocoso,this.label)?this.moodType=r.Giocoso:n.isStringInStringList(n.listMoodGioioso,this.label)?this.moodType=r.Gioioso:n.isStringInStringList(n.listMoodGrandioso,this.label)?this.moodType=r.Grandioso:n.isStringInStringList(n.listMoodGrazioso,this.label)?this.moodType=r.Grazioso:n.isStringInStringList(n.listMoodLacrimoso,this.label)?this.moodType=r.Lacrimoso:n.isStringInStringList(n.listMoodLeggiero,this.label)?this.moodType=r.Leggiero:n.isStringInStringList(n.listMoodMaestoso,this.label)?this.moodType=r.Maestoso:n.isStringInStringList(n.listMoodMalinconico,this.label)?this.moodType=r.Malinconico:n.isStringInStringList(n.listMoodMarcato,this.label)?this.moodType=r.Marcato:n.isStringInStringList(n.listMoodMarziale,this.label)?this.moodType=r.Marziale:n.isStringInStringList(n.listMoodMesto,this.label)?this.moodType=r.Mesto:n.isStringInStringList(n.listMoodMorendo,this.label)?this.moodType=r.Morendo:n.isStringInStringList(n.listMoodNobilmente,this.label)?this.moodType=r.Nobilmente:n.isStringInStringList(n.listMoodPatetico,this.label)?this.moodType=r.Patetico:n.isStringInStringList(n.listMoodPesante,this.label)?this.moodType=r.Pesante:n.isStringInStringList(n.listMoodSaltando,this.label)?this.moodType=r.Saltando:n.isStringInStringList(n.listMoodSautille,this.label)?this.moodType=r.Sautille:n.isStringInStringList(n.listMoodScherzando,this.label)?this.moodType=r.Scherzando:n.isStringInStringList(n.listMoodSostenuto,this.label)?this.moodType=r.Sostenuto:n.isStringInStringList(n.listMoodSpiccato,this.label)?this.moodType=r.Spiccato:n.isStringInStringList(n.listMoodTenerezza,this.label)?this.moodType=r.Tenerezza:n.isStringInStringList(n.listMoodTranquillamente,this.label)?this.moodType=r.Tranquillamente:n.isStringInStringList(n.listMoodTrionfante,this.label)&&(this.moodType=r.Trionfante)}}var r;e.MoodExpression=n,n.listMoodAffettuoso=["affettuoso"],n.listMoodAgitato=["agitato"],n.listMoodAppassionato=["appassionato"],n.listMoodAnimato=["animato","lively"],n.listMoodBrillante=["brillante"],n.listMoodCantabile=["cantabile"],n.listMoodDolce=["dolce"],n.listMoodEnergico=["energico"],n.listMoodEroico=["eroico"],n.listMoodEspressivo=["espressivo"],n.listMoodFurioso=["furioso"],n.listMoodGiocoso=["giocoso"],n.listMoodGioioso=["gioioso"],n.listMoodLacrimoso=["lacrimoso"],n.listMoodGrandioso=["grandioso"],n.listMoodGrazioso=["grazioso"],n.listMoodLeggiero=["leggiero"],n.listMoodMaestoso=["maestoso"],n.listMoodMalinconico=["malinconico"],n.listMoodMarcato=["marcato"],n.listMoodMarziale=["marziale"],n.listMoodMesto=["mesto"],n.listMoodMorendo=["morendo"],n.listMoodNobilmente=["nobilmente"],n.listMoodPatetico=["patetico"],n.listMoodPesante=["pesante"],n.listMoodSautille=["sautille"],n.listMoodSaltando=["saltando"],n.listMoodScherzando=["scherzando"],n.listMoodSostenuto=["sostenuto"],n.listMoodSpiccato=["spiccato"],n.listMoodTenerezza=["tenerezza"],n.listMoodTranquillamente=["tranquillamente"],n.listMoodTrionfante=["trionfante"],function(t){t[t.Affettuoso=0]="Affettuoso",t[t.Agitato=1]="Agitato",t[t.Appassionato=2]="Appassionato",t[t.Animato=3]="Animato",t[t.Brillante=4]="Brillante",t[t.Cantabile=5]="Cantabile",t[t.Dolce=6]="Dolce",t[t.Energico=7]="Energico",t[t.Eroico=8]="Eroico",t[t.Espressivo=9]="Espressivo",t[t.Furioso=10]="Furioso",t[t.Giocoso=11]="Giocoso",t[t.Gioioso=12]="Gioioso",t[t.Lacrimoso=13]="Lacrimoso",t[t.Grandioso=14]="Grandioso",t[t.Grazioso=15]="Grazioso",t[t.Leggiero=16]="Leggiero",t[t.Maestoso=17]="Maestoso",t[t.Malinconico=18]="Malinconico",t[t.Marcato=19]="Marcato",t[t.Marziale=20]="Marziale",t[t.Mesto=21]="Mesto",t[t.Morendo=22]="Morendo",t[t.Nobilmente=23]="Nobilmente",t[t.Patetico=24]="Patetico",t[t.Pesante=25]="Pesante",t[t.Sautille=26]="Sautille",t[t.Saltando=27]="Saltando",t[t.Scherzando=28]="Scherzando",t[t.Sostenuto=29]="Sostenuto",t[t.Spiccato=30]="Spiccato",t[t.Tenerezza=31]="Tenerezza",t[t.Tranquillamente=32]="Tranquillamente",t[t.Trionfante=33]="Trionfante",t[t.Vivace=34]="Vivace"}(r=e.MoodEnum||(e.MoodEnum={}))},6943:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MultiExpressionEntry=e.MultiExpression=void 0;const s=i(1797),n=i(9793),r=i(7839),o=i(7527),a=i(1614),l=i(3748),h=i(2562);e.MultiExpression=class{constructor(t,e){this.unknownList=[],this.moodList=[],this.expressions=[],this.sourceMeasure=t,this.timestamp=e}get SourceMeasureParent(){return this.sourceMeasure}set SourceMeasureParent(t){this.sourceMeasure=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get Timestamp(){return this.timestamp}set Timestamp(t){this.timestamp=t}get AbsoluteTimestamp(){return s.Fraction.plus(this.timestamp,this.sourceMeasure.AbsoluteTimestamp)}get InstantaneousDynamic(){return this.instantaneousDynamic}set InstantaneousDynamic(t){this.instantaneousDynamic=t}get EndingContinuousDynamic(){return this.endingContinuousDynamic}set EndingContinuousDynamic(t){this.endingContinuousDynamic=t}get StartingContinuousDynamic(){return this.startingContinuousDynamic}set StartingContinuousDynamic(t){this.startingContinuousDynamic=t}get MoodList(){return this.moodList}get UnknownList(){return this.unknownList}get EntriesList(){return this.expressions}get OctaveShiftStart(){return this.octaveShiftStart}set OctaveShiftStart(t){this.octaveShiftStart=t}get OctaveShiftEnd(){return this.octaveShiftEnd}set OctaveShiftEnd(t){this.octaveShiftEnd=t}get CombinedExpressionsText(){return this.combinedExpressionsText}set CombinedExpressionsText(t){this.combinedExpressionsText=t}getPlacementOfFirstEntry(){let t=l.PlacementEnum.Above;return this.expressions.length>0&&(this.expressions[0].expression instanceof n.InstantaneousDynamicExpression||this.expressions[0].expression instanceof r.ContinuousDynamicExpression||this.expressions[0].expression instanceof o.MoodExpression||this.expressions[0].expression instanceof a.UnknownExpression)&&(t=this.expressions[0].expression.Placement),t}getFontstyleOfFirstEntry(){var t;let e=h.FontStyles.Regular;return this.expressions.length>0&&(this.expressions[0].expression instanceof r.ContinuousDynamicExpression||this.expressions[0].expression instanceof o.MoodExpression?e=h.FontStyles.Italic:this.expressions[0].expression instanceof a.UnknownExpression&&(e=null!==(t=this.expressions[0].expression.fontStyle)&&void 0!==t?t:h.FontStyles.Regular)),e}addExpression(t,e){t instanceof n.InstantaneousDynamicExpression?(this.instantaneousDynamic&&this.removeExpressionFromEntryList(this.InstantaneousDynamic),this.instantaneousDynamic=t,this.instantaneousDynamic.ParentMultiExpression=this):t instanceof r.ContinuousDynamicExpression?this.startingContinuousDynamic=t:t instanceof o.MoodExpression?this.moodList.push(t):t instanceof a.UnknownExpression&&this.unknownList.push(t),this.addExpressionToEntryList(t,e)}CompareTo(t){return this.Timestamp.RealValue>t.Timestamp.RealValue?1:this.Timestamp.RealValue<t.Timestamp.RealValue?-1:0}addExpressionToEntryList(t,e){const i=new c;i.prefix=e,i.expression=t,t instanceof r.ContinuousDynamicExpression||t instanceof o.MoodExpression||t instanceof a.UnknownExpression?i.label=t.Label:i.label="",this.expressions.push(i)}removeExpressionFromEntryList(t){for(let e=0,i=this.expressions.length;e<i;++e)if(this.expressions[e].expression===t){this.expressions.splice(e,1);break}}};class c{}e.MultiExpressionEntry=c},6124:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TempoExpressionEntry=e.MultiTempoExpression=void 0;const s=i(1797),n=i(9667),r=i(3748),o=i(2562),a=i(280);e.MultiTempoExpression=class{constructor(t,e){this.expressions=[],this.sourceMeasure=t,this.timestamp=e}get Timestamp(){return this.timestamp}get AbsoluteTimestamp(){return s.Fraction.plus(this.sourceMeasure.AbsoluteTimestamp,this.timestamp)}get SourceMeasureParent(){return this.sourceMeasure}set SourceMeasureParent(t){this.sourceMeasure=t}get InstantaneousTempo(){return this.instantaneousTempo}get ContinuousTempo(){return this.continuousTempo}get EntriesList(){return this.expressions}get CombinedExpressionsText(){return this.combinedExpressionsText}set CombinedExpressionsText(t){this.combinedExpressionsText=t}getPlacementOfFirstEntry(){let t=r.PlacementEnum.Above;return this.expressions.length>0&&(this.expressions[0].Expression instanceof n.InstantaneousTempoExpression||this.expressions[0].Expression instanceof a.ContinuousTempoExpression)&&(t=this.expressions[0].Expression.Placement),t}getFontstyleOfFirstEntry(){let t=o.FontStyles.Regular;return this.expressions[0].Expression instanceof n.InstantaneousTempoExpression?t=o.FontStyles.Bold:this.expressions[0].Expression instanceof a.ContinuousTempoExpression&&(t=o.FontStyles.Italic),t}addExpression(t,e){if(this.checkIfAlreadyExists(t))return;t instanceof n.InstantaneousTempoExpression?this.instantaneousTempo=t:t instanceof a.ContinuousTempoExpression&&(this.continuousTempo=t);const i=new l;i.prefix=e,i.Expression=t,i.label=t.Label,this.expressions.push(i)}CompareTo(t){return this.Timestamp.RealValue>t.Timestamp.RealValue?1:this.Timestamp.RealValue<t.Timestamp.RealValue?-1:0}checkIfAlreadyExists(t){for(const e of this.expressions)if(e.label===t.Label)return!0;return!1}};class l{get Expression(){return this.expression}set Expression(t){this.expression=t}}e.TempoExpressionEntry=l},7513:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RehearsalExpression=void 0;const s=i(3748);class n extends s.AbstractExpression{constructor(t,e){super(e),this.label=t}}e.RehearsalExpression=n},1614:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UnknownExpression=void 0;const s=i(3748),n=i(1274);class r extends s.AbstractExpression{constructor(t,e,i,s){super(e),this.label=t,this.staffNumber=s,void 0===i&&(i=n.TextAlignmentEnum.LeftBottom),this.textAlignment=i}get Label(){return this.label}get Placement(){return this.placement}set Placement(t){this.placement=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get TextAlignment(){return this.textAlignment}}e.UnknownExpression=r},2343:function(t,e,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(t,e,i,s){void 0===s&&(s=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,s,n)}:function(t,e,i,s){void 0===s&&(s=i),t[s]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||s(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(3748),e),n(i(9775),e),n(i(4802),e),n(i(9793),e),n(i(9667),e),n(i(7527),e),n(i(6943),e),n(i(6124),e),n(i(7513),e),n(i(1614),e)},7198:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Glissando=void 0;const s=i(1797),n=i(8911);e.Glissando=class{constructor(t){this.notes=[],this.XMLNumber=1,this.AddNote(t),this.StartNote=t,this.Direction=n.ColDirEnum.NotYetDefined}get Notes(){return this.notes}get Duration(){const t=new s.Fraction;for(const e of this.notes)t.Add(e.Length);return t}get Pitch(){return this.StartNote.Pitch}AddNote(t){this.notes.push(t),t.NoteGlissando=this,2===this.notes.length&&(this.notes[0].Pitch.getHalfTone()<this.notes[1].Pitch.getHalfTone()?this.Direction=n.ColDirEnum.Up:this.Direction=n.ColDirEnum.Down)}}},5356:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DynamicsContainer=void 0;const s=i(7839),n=i(9793);e.DynamicsContainer=class{constructor(t,e){t instanceof s.ContinuousDynamicExpression?this.continuousDynamicExpression=t:t instanceof n.InstantaneousDynamicExpression&&(this.instantaneousDynamicExpression=t),this.staffNumber=e}parMultiExpression(){return this.continuousDynamicExpression?this.continuousDynamicExpression.StartMultiExpression:this.instantaneousDynamicExpression?this.instantaneousDynamicExpression.ParentMultiExpression:void 0}CompareTo(t){return this.parMultiExpression().AbsoluteTimestamp.CompareTo(t.parMultiExpression().AbsoluteTimestamp)}}},1877:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractNotationInstruction=void 0,e.AbstractNotationInstruction=class{constructor(t){this.printObject=!0,this.parent=t}get Parent(){return this.parent}set Parent(t){this.parent=t}get PrintObject(){return this.printObject}set PrintObject(t){this.printObject=t}}},289:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MidiInstrument=e.ClefEnum=e.ClefInstruction=void 0;const s=i(8640),n=i(1877),r=i(8640),o=i(8640),a=i(1703);class l extends n.AbstractNotationInstruction{constructor(t=h.G,e=0,i=2){super(void 0),this.clefType=h.G,this.line=2,this.octaveOffset=0,this.line=i,this.clefType=t,this.octaveOffset=e,this.calcParameters()}static getDefaultClefFromMidiInstrument(t){switch(t){case c.Acoustic_Grand_Piano:case c.Electric_Bass_finger:case c.Electric_Bass_pick:case c.Fretless_Bass:case c.Slap_Bass_1:case c.Slap_Bass_2:case c.Synth_Bass_1:case c.Synth_Bass_2:case c.Contrabass:return new l(h.F,0,4);default:return new l(h.G,0,2)}}static getAllPossibleClefs(){const t=[];for(let e=0;e<=2;e++){const i=new l(h.G,e,2);t.push(i)}for(let e=-2;e<=0;e++){const i=new l(h.F,e,4);t.push(i)}return t}static isSupportedClef(t){switch(t){case h.G:case h.F:case h.C:case h.percussion:case h.TAB:return!0;default:return!1}}get ClefType(){return this.clefType}set ClefType(t){this.clefType=t}get Line(){return this.line}set Line(t){this.line=t}get OctaveOffset(){return this.octaveOffset}set OctaveOffset(t){this.octaveOffset=t}get ClefPitch(){return this.clefPitch}set ClefPitch(t){this.clefPitch=t}get ReferenceCyPosition(){return this.referenceCyPosition}set ReferenceCyPosition(t){this.referenceCyPosition=t}Equals(t){return this===t||!(!this||!t)&&this.clefPitch===t.clefPitch&&this.Line===t.Line}NotEqual(t){return!this.Equals(t)}ToString(){return"ClefType: "+this.clefType}calcParameters(){switch(this.clefType){case h.G:this.clefPitch=new s.Pitch(r.NoteEnum.G,1+this.octaveOffset,o.AccidentalEnum.NONE),this.referenceCyPosition=5-this.line+2;break;case h.F:this.clefPitch=new s.Pitch(r.NoteEnum.F,0+this.octaveOffset,o.AccidentalEnum.NONE),this.referenceCyPosition=5-this.line+1.5;break;case h.C:this.clefPitch=new s.Pitch(r.NoteEnum.C,1+this.octaveOffset,o.AccidentalEnum.NONE),this.referenceCyPosition=5-this.line;break;case h.percussion:this.clefPitch=new s.Pitch(r.NoteEnum.C,2,o.AccidentalEnum.NONE),this.referenceCyPosition=2;break;case h.TAB:this.clefPitch=new s.Pitch(r.NoteEnum.G,0,o.AccidentalEnum.NONE),this.referenceCyPosition=0;break;default:throw new a.ArgumentOutOfRangeException("clefType")}}}var h,c;e.ClefInstruction=l,function(t){t[t.G=0]="G",t[t.F=1]="F",t[t.C=2]="C",t[t.percussion=3]="percussion",t[t.TAB=4]="TAB"}(h=e.ClefEnum||(e.ClefEnum={})),function(t){t[t.None=-1]="None",t[t.Acoustic_Grand_Piano=0]="Acoustic_Grand_Piano",t[t.Bright_Acoustic_Piano=1]="Bright_Acoustic_Piano",t[t.Electric_Grand_Piano=2]="Electric_Grand_Piano",t[t.Honky_tonk_Piano=3]="Honky_tonk_Piano",t[t.Electric_Piano_1=4]="Electric_Piano_1",t[t.Electric_Piano_2=5]="Electric_Piano_2",t[t.Harpsichord=6]="Harpsichord",t[t.Clavinet=7]="Clavinet",t[t.Celesta=8]="Celesta",t[t.Glockenspiel=9]="Glockenspiel",t[t.Music_Box=10]="Music_Box",t[t.Vibraphone=11]="Vibraphone",t[t.Marimba=12]="Marimba",t[t.Xylophone=13]="Xylophone",t[t.Tubular_Bells=14]="Tubular_Bells",t[t.Dulcimer=15]="Dulcimer",t[t.Drawbar_Organ=16]="Drawbar_Organ",t[t.Percussive_Organ=17]="Percussive_Organ",t[t.Rock_Organ=18]="Rock_Organ",t[t.Church_Organ=19]="Church_Organ",t[t.Reed_Organ=20]="Reed_Organ",t[t.Accordion=21]="Accordion",t[t.Harmonica=22]="Harmonica",t[t.Tango_Accordion=23]="Tango_Accordion",t[t.Acoustic_Guitar_nylon=24]="Acoustic_Guitar_nylon",t[t.Acoustic_Guitar_steel=25]="Acoustic_Guitar_steel",t[t.Electric_Guitar_jazz=26]="Electric_Guitar_jazz",t[t.Electric_Guitar_clean=27]="Electric_Guitar_clean",t[t.Electric_Guitar_muted=28]="Electric_Guitar_muted",t[t.Overdriven_Guitar=29]="Overdriven_Guitar",t[t.Distortion_Guitar=30]="Distortion_Guitar",t[t.Guitar_harmonics=31]="Guitar_harmonics",t[t.Acoustic_Bass=32]="Acoustic_Bass",t[t.Electric_Bass_finger=33]="Electric_Bass_finger",t[t.Electric_Bass_pick=34]="Electric_Bass_pick",t[t.Fretless_Bass=35]="Fretless_Bass",t[t.Slap_Bass_1=36]="Slap_Bass_1",t[t.Slap_Bass_2=37]="Slap_Bass_2",t[t.Synth_Bass_1=38]="Synth_Bass_1",t[t.Synth_Bass_2=39]="Synth_Bass_2",t[t.Violin=40]="Violin",t[t.Viola=41]="Viola",t[t.Cello=42]="Cello",t[t.Contrabass=43]="Contrabass",t[t.Tremolo_Strings=44]="Tremolo_Strings",t[t.Pizzicato_Strings=45]="Pizzicato_Strings",t[t.Orchestral_Harp=46]="Orchestral_Harp",t[t.Timpani=47]="Timpani",t[t.String_Ensemble_1=48]="String_Ensemble_1",t[t.String_Ensemble_2=49]="String_Ensemble_2",t[t.Synth_Strings_1=50]="Synth_Strings_1",t[t.Synth_Strings_2=51]="Synth_Strings_2",t[t.Choir_Aahs=52]="Choir_Aahs",t[t.Voice_Oohs=53]="Voice_Oohs",t[t.Synth_Voice=54]="Synth_Voice",t[t.Orchestra_Hit=55]="Orchestra_Hit",t[t.Trumpet=56]="Trumpet",t[t.Trombone=57]="Trombone",t[t.Tuba=58]="Tuba",t[t.Muted_Trumpet=59]="Muted_Trumpet",t[t.French_Horn=60]="French_Horn",t[t.Brass_Section=61]="Brass_Section",t[t.Synth_Brass_1=62]="Synth_Brass_1",t[t.Synth_Brass_2=63]="Synth_Brass_2",t[t.Soprano_Sax=64]="Soprano_Sax",t[t.Alto_Sax=65]="Alto_Sax",t[t.Tenor_Sax=66]="Tenor_Sax",t[t.Baritone_Sax=67]="Baritone_Sax",t[t.Oboe=68]="Oboe",t[t.English_Horn=69]="English_Horn",t[t.Bassoon=70]="Bassoon",t[t.Clarinet=71]="Clarinet",t[t.Piccolo=72]="Piccolo",t[t.Flute=73]="Flute",t[t.Recorder=74]="Recorder",t[t.Pan_Flute=75]="Pan_Flute",t[t.Blown_Bottle=76]="Blown_Bottle",t[t.Shakuhachi=77]="Shakuhachi",t[t.Whistle=78]="Whistle",t[t.Ocarina=79]="Ocarina",t[t.Lead_1_square=80]="Lead_1_square",t[t.Lead_2_sawtooth=81]="Lead_2_sawtooth",t[t.Lead_3_calliope=82]="Lead_3_calliope",t[t.Lead_4_chiff=83]="Lead_4_chiff",t[t.Lead_5_charang=84]="Lead_5_charang",t[t.Lead_6_voice=85]="Lead_6_voice",t[t.Lead_7_fifths=86]="Lead_7_fifths",t[t.Lead_8_bass_lead=87]="Lead_8_bass_lead",t[t.Pad_1_new_age=88]="Pad_1_new_age",t[t.Pad_2_warm=89]="Pad_2_warm",t[t.Pad_3_polysynth=90]="Pad_3_polysynth",t[t.Pad_4_choir=91]="Pad_4_choir",t[t.Pad_5_bowed=92]="Pad_5_bowed",t[t.Pad_6_metallic=93]="Pad_6_metallic",t[t.Pad_7_halo=94]="Pad_7_halo",t[t.Pad_8_sweep=95]="Pad_8_sweep",t[t.FX_1_rain=96]="FX_1_rain",t[t.FX_2_soundtrack=97]="FX_2_soundtrack",t[t.FX_3_crystal=98]="FX_3_crystal",t[t.FX_4_atmosphere=99]="FX_4_atmosphere",t[t.FX_5_brightness=100]="FX_5_brightness",t[t.FX_6_goblins=101]="FX_6_goblins",t[t.FX_7_echoes=102]="FX_7_echoes",t[t.FX_8_scifi=103]="FX_8_scifi",t[t.Sitar=104]="Sitar",t[t.Banjo=105]="Banjo",t[t.Shamisen=106]="Shamisen",t[t.Koto=107]="Koto",t[t.Kalimba=108]="Kalimba",t[t.Bag_pipe=109]="Bag_pipe",t[t.Fiddle=110]="Fiddle",t[t.Shanai=111]="Shanai",t[t.Tinkle_Bell=112]="Tinkle_Bell",t[t.Agogo=113]="Agogo",t[t.Steel_Drums=114]="Steel_Drums",t[t.Woodblock=115]="Woodblock",t[t.Taiko_Drum=116]="Taiko_Drum",t[t.Melodic_Tom=117]="Melodic_Tom",t[t.Synth_Drum=118]="Synth_Drum",t[t.Reverse_Cymbal=119]="Reverse_Cymbal",t[t.Guitar_Fret_Noise=120]="Guitar_Fret_Noise",t[t.Breath_Noise=121]="Breath_Noise",t[t.Seashore=122]="Seashore",t[t.Bird_Tweet=123]="Bird_Tweet",t[t.Telephone_Ring=124]="Telephone_Ring",t[t.Helicopter=125]="Helicopter",t[t.Applause=126]="Applause",t[t.Gunshot=127]="Gunshot",t[t.Percussion=128]="Percussion"}(c=e.MidiInstrument||(e.MidiInstrument={}))},5198:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KeyEnum=e.NoteEnumToHalfToneLink=e.KeyInstruction=void 0;const s=i(1877),n=i(8640),r=i(8640);class o extends s.AbstractNotationInstruction{constructor(t,e=0,i=a.major){super(t),this.isTransposedBy=0,this.Key=e,this.keyTypeOriginal=e,this.mode=i,this.alteratedNotes=this.calcAlteratedNotes()}static copy(t){const e=new o(t.parent,t.Key,t.Mode);return e.keyTypeOriginal=t.keyTypeOriginal,e}static getAllPossibleMajorKeyInstructions(){const t=[];for(let e=-7;e<7;e++){const i=new o(void 0,e,a.major);t.push(i)}return t}get Key(){return this.keyType}set Key(t){this.keyType=t,this.alteratedNotes=this.calcAlteratedNotes()}get Mode(){return this.mode}set Mode(t){this.mode=t}get AlteratedNotes(){return this.alteratedNotes}calcAlteratedNotes(){const t=[];if(this.keyType>0)for(let e=0;e<this.keyType;e++)t.push(o.sharpPositionList[e]);else if(this.keyType<0)for(let e=0;e<-this.keyType;e++)t.push(o.flatPositionList[e]);return t}willAlterateNote(t){return this.alteratedNotes.indexOf(t)>=0}getAlterationForPitch(t){return this.keyType>0&&this.alteratedNotes.indexOf(t.FundamentalNote)<=this.keyType?r.AccidentalEnum.SHARP:this.keyType<0&&this.alteratedNotes.indexOf(t.FundamentalNote)<=Math.abs(this.keyType)?r.AccidentalEnum.FLAT:r.AccidentalEnum.NONE}ToString(){return"Key: "+this.keyType+this.mode}OperatorEquals(t){const e=this;return e===t||!(!e||!t)&&e.Key===t.Key&&e.Mode===t.Mode}OperatorNotEqual(t){return!this.OperatorEquals(t)}}var a;e.KeyInstruction=o,o.sharpPositionList=[n.NoteEnum.F,n.NoteEnum.C,n.NoteEnum.G,n.NoteEnum.D,n.NoteEnum.A,n.NoteEnum.E,n.NoteEnum.B],o.flatPositionList=[n.NoteEnum.B,n.NoteEnum.E,n.NoteEnum.A,n.NoteEnum.D,n.NoteEnum.G,n.NoteEnum.C,n.NoteEnum.F],e.NoteEnumToHalfToneLink=class{constructor(t,e){this.note=t,this.halfTone=e}},function(t){t[t.major=0]="major",t[t.minor=1]="minor",t[t.none=2]="none",t[t.dorian=3]="dorian",t[t.phrygian=4]="phrygian",t[t.lydian=5]="lydian",t[t.mixolydian=6]="mixolydian",t[t.aeolian=7]="aeolian",t[t.ionian=8]="ionian",t[t.locrian=9]="locrian"}(a=e.KeyEnum||(e.KeyEnum={}))},6189:(t,e)=>{"use strict";var i,s;Object.defineProperty(e,"__esModule",{value:!0}),e.AlignmentType=e.RepetitionInstructionEnum=e.RepetitionInstruction=e.RepetitionInstructionComparer=void 0,e.RepetitionInstructionComparer=class{static Compare(t,e){if(void 0!==t.parentRepetition&&e.parentRepetition){if(t.alignment===s.End&&e.alignment===s.End){if(t.parentRepetition.StartIndex<e.parentRepetition.StartIndex)return 1;if(t.parentRepetition.StartIndex>e.parentRepetition.StartIndex)return-1}if(t.alignment===s.Begin&&e.alignment===s.Begin){if(t.parentRepetition.EndIndex<e.parentRepetition.EndIndex)return 1;if(t.parentRepetition.EndIndex>e.parentRepetition.EndIndex)return-1}}return 0}},e.RepetitionInstruction=class{constructor(t,e,i=s.End,n,r){this.endingIndices=void 0,this.measureIndex=t,r&&(this.endingIndices=r.slice()),this.type=e,this.alignment=i,this.parentRepetition=n}CompareTo(t){const e=t;if(this.measureIndex>e.measureIndex)return 1;if(this.measureIndex<e.measureIndex)return-1;if(this.alignment===s.Begin){if(e.alignment===s.End)return-1;switch(this.type){case i.Ending:return 1;case i.StartLine:return e.type===i.Ending?-1:1;case i.Coda:case i.Segno:return e.type===i.Coda?1:-1}}else{if(e.alignment===s.Begin)return 1;switch(this.type){case i.Ending:return-1;case i.Fine:case i.ToCoda:return e.type===i.Ending?1:-1;case i.ForwardJump:switch(e.type){case i.Ending:case i.Fine:case i.ToCoda:return 1}return-1;case i.DalSegnoAlFine:case i.DaCapoAlFine:case i.DalSegnoAlCoda:case i.DaCapoAlCoda:case i.DaCapo:case i.DalSegno:case i.BackJumpLine:return 1}}return 0}equals(t){if(this.measureIndex!==t.measureIndex||this.type!==t.type||this.alignment!==t.alignment)return!1;if(this.endingIndices===t.endingIndices)return!0;if(!this.endingIndices||!t.endingIndices||this.endingIndices.length!==t.endingIndices.length)return!1;for(let e=0;e<this.endingIndices.length;e++)if(this.endingIndices[e]!==t.endingIndices[e])return!1;return!0}},function(t){t[t.StartLine=0]="StartLine",t[t.ForwardJump=1]="ForwardJump",t[t.BackJumpLine=2]="BackJumpLine",t[t.Ending=3]="Ending",t[t.DaCapo=4]="DaCapo",t[t.DalSegno=5]="DalSegno",t[t.Fine=6]="Fine",t[t.ToCoda=7]="ToCoda",t[t.DalSegnoAlFine=8]="DalSegnoAlFine",t[t.DaCapoAlFine=9]="DaCapoAlFine",t[t.DalSegnoAlCoda=10]="DalSegnoAlCoda",t[t.DaCapoAlCoda=11]="DaCapoAlCoda",t[t.Coda=12]="Coda",t[t.Segno=13]="Segno",t[t.None=14]="None"}(i=e.RepetitionInstructionEnum||(e.RepetitionInstructionEnum={})),function(t){t[t.Begin=0]="Begin",t[t.End=1]="End"}(s=e.AlignmentType||(e.AlignmentType={}))},3331:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RhythmSymbolEnum=e.RhythmInstruction=void 0;const s=i(1877);class n extends s.AbstractNotationInstruction{constructor(t,e){super(void 0),this.rhythm=t,this.numerator=t.Numerator,this.denominator=t.Denominator,this.symbolEnum=e}get Rhythm(){return this.rhythm}set Rhythm(t){this.rhythm=t}get SymbolEnum(){return this.symbolEnum}set SymbolEnum(t){this.symbolEnum=t}clone(){return new n(this.rhythm.clone(),this.symbolEnum)}OperatorEquals(t){const e=this;return e===t||!(!e||!t)&&e.numerator===t.numerator&&e.denominator===t.denominator}OperatorNotEqual(t){return!(this===t)}ToString(){return"Rhythm: "+this.rhythm.toString()}}var r;e.RhythmInstruction=n,(r=e.RhythmSymbolEnum||(e.RhythmSymbolEnum={}))[r.NONE=0]="NONE",r[r.COMMON=1]="COMMON",r[r.CUT=2]="CUT"},1357:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.TechnicalInstruction=e.TechnicalInstructionType=void 0,(i=e.TechnicalInstructionType||(e.TechnicalInstructionType={}))[i.Fingering=0]="Fingering",i[i.String=1]="String",e.TechnicalInstruction=class{}},6065:function(t,e,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(t,e,i,s){void 0===s&&(s=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,s,n)}:function(t,e,i,s){void 0===s&&(s=i),t[s]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||s(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(1877),e),n(i(289),e),n(i(5198),e),n(i(6189),e),n(i(3331),e),n(i(1357),e)},2947:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedVoice=void 0;const s=i(3884);class n extends s.Voice{constructor(t,e,i){super(t,e),this.master=i}get Master(){return this.master}}e.LinkedVoice=n},7274:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LyricsEntry=void 0;const s=i(2562);e.LyricsEntry=class{constructor(t,e,i,s,n=-1){this.text=t,this.word=i,this.parent=s,this.verseNumber=e,n>=0&&(this.syllableIndex=n)}get Text(){return this.text}set Text(t){this.text=t}get Word(){return this.word}get Parent(){return this.parent}set Parent(t){this.parent=t}get VerseNumber(){return this.verseNumber}get SyllableIndex(){return this.syllableIndex}get IsTranslation(){return this.VerseNumber.endsWith("translation")}get IsChorus(){return this.VerseNumber.startsWith("chorus")}get FontStyle(){return this.IsChorus||this.IsTranslation?s.FontStyles.Italic:s.FontStyles.Regular}}},2672:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LyricWord=void 0,e.LyricWord=class{constructor(){this.syllables=[]}get Syllables(){return this.syllables}containsVoiceEntry(t){for(let e=0,i=this.Syllables.length;e<i;++e)if(this.Syllables[e].Parent===t)return!0;return!1}findLyricEntryInVoiceEntry(t){for(let e=0,i=this.Syllables.length;e<i;++e){const i=this.Syllables[e];if(i.Parent===t)return i}}}},5253:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Appearance=e.Note=void 0;const s=i(1797);var n;e.Note=class{constructor(t,e,i,s,n,r){this.slurs=[],this.playbackInstrumentId=void 0,this.notehead=void 0,this.printObject=!0,this.voiceEntry=t,this.parentStaffEntry=e,this.length=i,this.pitch=s,this.sourceMeasure=n,this.isRestFlag=null!=r&&r,this.halfTone=s?s.getHalfTone():0}get NoteAsString(){return this.pitch.toString()}get ParentVoiceEntry(){return this.voiceEntry}set ParentVoiceEntry(t){this.voiceEntry=t}get ParentStaffEntry(){return this.parentStaffEntry}get ParentStaff(){return this.parentStaffEntry.ParentStaff}get Length(){return this.length}set Length(t){this.length=t}get SourceMeasure(){return this.sourceMeasure}get TypeLength(){return this.typeLength}set TypeLength(t){this.typeLength=t}get NoteTypeXml(){return this.noteTypeXml}set NoteTypeXml(t){this.noteTypeXml=t}get NormalNotes(){return this.normalNotes}set NormalNotes(t){this.normalNotes=t}get Pitch(){return this.pitch}get NoteBeam(){return this.beam}set NoteBeam(t){this.beam=t}set Notehead(t){this.notehead=t}get Notehead(){return this.notehead}get NoteTuplet(){return this.tuplet}set NoteTuplet(t){this.tuplet=t}get NoteGlissando(){return this.glissando}set NoteGlissando(t){this.glissando=t}get NoteTie(){return this.tie}set NoteTie(t){this.tie=t}get NoteSlurs(){return this.slurs}set NoteSlurs(t){this.slurs=t}get PlaybackInstrumentId(){return this.playbackInstrumentId}set PlaybackInstrumentId(t){this.playbackInstrumentId=t}get PrintObject(){return this.printObject}set PrintObject(t){this.printObject=t}get Arpeggio(){return this.arpeggio}set Arpeggio(t){this.arpeggio=t}get IsCueNote(){return this.isCueNote}set IsCueNote(t){this.isCueNote=t}get StemDirectionXml(){return this.stemDirectionXml}set StemDirectionXml(t){this.stemDirectionXml=t}get TremoloStrokes(){return this.tremoloStrokes}set TremoloStrokes(t){this.tremoloStrokes=t}get StemColorXml(){return this.stemColorXml}set StemColorXml(t){this.stemColorXml=t}get NoteheadColorXml(){return this.noteheadColorXml}set NoteheadColorXml(t){this.noteheadColorXml=t}get NoteheadColor(){return this.noteheadColor}set NoteheadColor(t){this.noteheadColor=t}get NoteheadColorCurrentlyRendered(){return this.noteheadColorCurrentlyRendered}set NoteheadColorCurrentlyRendered(t){this.noteheadColorCurrentlyRendered=t}isRest(){return this.isRestFlag}isWholeRest(){return this.isRest()&&this.Length.RealValue===this.sourceMeasure.ActiveTimeSignature.RealValue}isWholeMeasureNote(){return this.Length.RealValue===this.sourceMeasure.ActiveTimeSignature.RealValue}ToString(){return this.pitch?this.Pitch.ToString()+", length: "+this.length.toString():"rest note, length: "+this.length.toString()}getAbsoluteTimestamp(){return s.Fraction.plus(this.voiceEntry.Timestamp,this.sourceMeasure.AbsoluteTimestamp)}isDuplicateSlur(t){for(let e=0,i=this.slurs.length;e<i;++e){const i=this.slurs[e];if(void 0!==i.StartNote&&void 0!==i.EndNote&&void 0!==t.StartNote&&t.StartNote===i.StartNote&&i.EndNote===this&&t.PlacementXml===i.PlacementXml)return!0}return!1}},(n=e.Appearance||(e.Appearance={}))[n.Normal=0]="Normal",n[n.Grace=1]="Grace",n[n.Cue=2]="Cue"},2478:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NoteTypeHandler=e.NoteType=void 0;const s=i(1797),n=i(6331),r=i(1703);var o;!function(t){t[t.UNDEFINED=0]="UNDEFINED",t[t._1024th=1]="_1024th",t[t._512th=2]="_512th",t[t._256th=3]="_256th",t[t._128th=4]="_128th",t[t._64th=5]="_64th",t[t._32nd=6]="_32nd",t[t._16th=7]="_16th",t[t.EIGTH=8]="EIGTH",t[t.QUARTER=9]="QUARTER",t[t.HALF=10]="HALF",t[t.WHOLE=11]="WHOLE",t[t.BREVE=12]="BREVE",t[t.LONG=13]="LONG",t[t.MAXIMA=14]="MAXIMA"}(o=e.NoteType||(e.NoteType={}));class a{static NoteTypeToString(t){return this.NoteTypeXmlValues[t]}static StringToNoteType(t){const e=this.NoteTypeXmlValues.indexOf(t);return-1!==e?e:o.UNDEFINED}static getNoteDurationFromType(t){switch(t){case"1024th":return new s.Fraction(1,1024);case"512th":return new s.Fraction(1,512);case"256th":return new s.Fraction(1,256);case"128th":return new s.Fraction(1,128);case"64th":return new s.Fraction(1,64);case"32th":case"32nd":return new s.Fraction(1,32);case"16th":return new s.Fraction(1,16);case"eighth":return new s.Fraction(1,8);case"quarter":return new s.Fraction(1,4);case"half":return new s.Fraction(1,2);case"whole":return new s.Fraction(1,1);case"breve":return new s.Fraction(2,1);case"long":return new s.Fraction(4,1);case"maxima":return new s.Fraction(8,1);default:{const t=n.ITextTranslation.translateText("ReaderErrorMessages/NoteDurationError","Invalid note duration.");throw new r.MusicSheetReadingException(t)}}}}e.NoteTypeHandler=a,a.NoteTypeXmlValues=["","1024th","512th","256th","128th","64th","32nd","16th","eigth","quarter","half","whole","breve","long","maxima"]},766:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.NoteHeadShape=e.Notehead=void 0;const n=s(i(2043));class r{constructor(t,e,i){this.sourceNote=t,this.setShapeFromXml(e,i)}setShapeFromXml(t,e){this.shape=r.ShapeTypeXmlToShape(t);let i=e;void 0===i&&(this.sourceNote?i=this.sourceNote.Length.Denominator>2:(n.default.warn("notehead: sourceNote and filledXmlAttribute undefined."),i=!0)),this.filled=i}get SourceNote(){return this.sourceNote}get Shape(){return this.shape}get Filled(){return this.filled}static ShapeTypeXmlToShape(t){switch(t.toLowerCase()){case"normal":return o.NORMAL;case"x":return o.X;case"slash":return o.SLASH;case"diamond":return o.DIAMOND;case"square":case"la":return o.SQUARE;case"do":case"triangle":return o.TRIANGLE;case"rectangle":return o.RECTANGLE;case"circle-x":return o.CIRCLEX;default:return n.default.info("unsupported/unhandled xml notehead '"+t+"'. Using normal notehead."),o.NORMAL}}}var o;e.Notehead=r,function(t){t[t.CIRCLEX=0]="CIRCLEX",t[t.DIAMOND=1]="DIAMOND",t[t.NORMAL=2]="NORMAL",t[t.RECTANGLE=3]="RECTANGLE",t[t.SLASH=4]="SLASH",t[t.SQUARE=5]="SQUARE",t[t.TRIANGLE=6]="TRIANGLE",t[t.X=7]="X"}(o=e.NoteHeadShape||(e.NoteHeadShape={}))},5922:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OrnamentEnum=e.OrnamentContainer=void 0;const s=i(8640),n=i(3748);var r;e.OrnamentContainer=class{constructor(t){this.placement=n.PlacementEnum.Above,this.accidentalAbove=s.AccidentalEnum.NONE,this.accidentalBelow=s.AccidentalEnum.NONE,this.ornament=t}get GetOrnament(){return this.ornament}get AccidentalAbove(){return this.accidentalAbove}set AccidentalAbove(t){this.accidentalAbove=t}get AccidentalBelow(){return this.accidentalBelow}set AccidentalBelow(t){this.accidentalBelow=t}},(r=e.OrnamentEnum||(e.OrnamentEnum={}))[r.Trill=0]="Trill",r[r.Turn=1]="Turn",r[r.InvertedTurn=2]="InvertedTurn",r[r.DelayedTurn=3]="DelayedTurn",r[r.DelayedInvertedTurn=4]="DelayedInvertedTurn",r[r.Mordent=5]="Mordent",r[r.InvertedMordent=6]="InvertedMordent"},5942:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SourceMeasure=void 0;const s=i(1797),n=i(141),r=i(9050),o=i(6189),a=i(908),l=i(289),h=i(5198),c=i(6894);e.SourceMeasure=class{constructor(t,e){this.printNewSystemXml=!1,this.printNewPageXml=!1,this.IsSystemStartMeasure=!1,this.hasLyrics=!1,this.hasMoodExpressions=!1,this.allRests=!1,this.isReducedToMultiRest=!1,this.multipleRestMeasureNumber=0,this.staffLinkedExpressions=[],this.tempoExpressions=[],this.verticalSourceStaffEntryContainers=[],this.graphicalMeasureErrors=[],this.firstRepetitionInstructions=[],this.lastRepetitionInstructions=[],this.completeNumberOfStaves=t,this.implicitMeasure=!1,this.hasEndLine=!1,this.endingBarStyleXml="",this.endingBarStyleEnum=c.SystemLinesEnum.SingleThin,this.firstInstructionsStaffEntries=new Array(t),this.lastInstructionsStaffEntries=new Array(t),this.rules=e,this.TempoInBPM=0;for(let e=0;e<t;e++)this.graphicalMeasureErrors.push(!1),this.staffLinkedExpressions.push([])}get MeasureNumber(){return this.measureNumber}set MeasureNumber(t){this.measureNumber=t}getPrintedMeasureNumber(){return this.rules.UseXMLMeasureNumbers&&Number.isInteger(this.MeasureNumberXML)?(this.MeasureNumberPrinted=this.MeasureNumberXML,this.MeasureNumberPrinted):(this.MeasureNumberPrinted=this.MeasureNumber,this.MeasureNumberPrinted)}get AbsoluteTimestamp(){return this.absoluteTimestamp}set AbsoluteTimestamp(t){this.absoluteTimestamp=t}get CompleteNumberOfStaves(){return this.completeNumberOfStaves}get Duration(){return this.duration}set Duration(t){this.duration=t}get ActiveTimeSignature(){return this.activeTimeSignature}set ActiveTimeSignature(t){this.activeTimeSignature=t}get ImplicitMeasure(){return this.implicitMeasure}set ImplicitMeasure(t){this.implicitMeasure=t}get HasEndLine(){return this.hasEndLine}set HasEndLine(t){this.hasEndLine=t}get StaffLinkedExpressions(){return this.staffLinkedExpressions}get TempoExpressions(){return this.tempoExpressions}get VerticalSourceStaffEntryContainers(){return this.verticalSourceStaffEntryContainers}get FirstInstructionsStaffEntries(){return this.firstInstructionsStaffEntries}get LastInstructionsStaffEntries(){return this.lastInstructionsStaffEntries}get FirstRepetitionInstructions(){return this.firstRepetitionInstructions}get LastRepetitionInstructions(){return this.lastRepetitionInstructions}getErrorInMeasure(t){return this.graphicalMeasureErrors[t]}setErrorInGraphicalMeasure(t,e){this.graphicalMeasureErrors[t]=e}getNextMeasure(t){return t[this.measureListIndex+1]}getPreviousMeasure(t){if(this.measureListIndex>1)return t[this.measureListIndex-1]}get Rules(){return this.rules}get VerticalMeasureList(){return this.verticalMeasureList}set VerticalMeasureList(t){this.verticalMeasureList=t}get TempoInBPM(){return this.tempoInBPM}set TempoInBPM(t){this.tempoInBPM=t}findOrCreateStaffEntry(t,e,i){let s,o;for(const e of this.verticalSourceStaffEntryContainers)if(e.Timestamp.Equals(t)){o=e;break}if(o)return o.StaffEntries[e]?s=o.StaffEntries[e]:(s=new r.SourceStaffEntry(o,i),o.StaffEntries[e]=s),{createdNewContainer:!1,staffEntry:s};const a=this.verticalSourceStaffEntryContainers[this.verticalSourceStaffEntryContainers.length-1];if(0===this.verticalSourceStaffEntryContainers.length||a.Timestamp.lt(t)){const o=new n.VerticalSourceStaffEntryContainer(this,t.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.push(o),s=new r.SourceStaffEntry(o,i),o.StaffEntries[e]=s}else for(let o=this.verticalSourceStaffEntryContainers.length-1;o>=0;o--){if(this.verticalSourceStaffEntryContainers[o].Timestamp.lt(t)){const a=new n.VerticalSourceStaffEntryContainer(this,t.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.splice(o+1,0,a),s=new r.SourceStaffEntry(a,i),a.StaffEntries[e]=s;break}if(0===o){const a=new n.VerticalSourceStaffEntryContainer(this,t.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.splice(o,0,a),s=new r.SourceStaffEntry(a,i),a.StaffEntries[e]=s;break}}return{createdNewContainer:!0,staffEntry:s}}findOrCreateVoiceEntry(t,e){let i,s=!1;for(const s of t.VoiceEntries)if(s.ParentVoice===e){i=s;break}return i||(i=new a.VoiceEntry(t.Timestamp,e,t),s=!0),{createdVoiceEntry:s,voiceEntry:i}}getPreviousSourceStaffEntryFromIndex(t,e){for(let i=e-1;i>=0;i--)if(this.verticalSourceStaffEntryContainers[i][t])return this.verticalSourceStaffEntryContainers[i][t]}getVerticalContainerIndexByTimestamp(t){for(let e=0,i=this.VerticalSourceStaffEntryContainers.length;e<i;++e)if(this.VerticalSourceStaffEntryContainers[e].Timestamp.Equals(t))return e;return-1}getVerticalContainerByTimestamp(t){for(let e=0,i=this.VerticalSourceStaffEntryContainers.length;e<i;++e){const i=this.VerticalSourceStaffEntryContainers[e];if(i.Timestamp.Equals(t))return i}}checkForEmptyVerticalContainer(t){let e=0;for(let i=0;i<this.completeNumberOfStaves;i++)this.verticalSourceStaffEntryContainers[t][i]||e++;e===this.completeNumberOfStaves&&this.verticalSourceStaffEntryContainers.splice(t,1)}reverseCheck(t,e){let i=new s.Fraction(0,1);const n=[];for(let e=0;e<t.Instruments.length;e++){let i=new s.Fraction(0,1);const r=t.getGlobalStaffIndexOfFirstStaff(t.Instruments[e]);for(let n=0;n<t.Instruments[e].Staves.length;n++){const t=this.getLastSourceStaffEntryForInstrument(r+n);if(void 0!==t&&!t.hasTie())for(let e=this.verticalSourceStaffEntryContainers.indexOf(t.VerticalContainerParent)-1;e>=0;e--){const t=this.verticalSourceStaffEntryContainers[e][r+n];if(void 0!==t&&t.hasTie()&&i.lt(s.Fraction.plus(t.Timestamp,t.calculateMaxNoteLength()))){i=s.Fraction.plus(t.Timestamp,t.calculateMaxNoteLength());break}}}n.push(i)}for(let t=0,e=n.length;t<e;++t){const e=n[t];i.lt(e)&&(i=e)}return s.Fraction.max(i,e)}calculateInstrumentsDuration(t,e){const i=[];for(let n=0;n<t.Instruments.length;n++){let r=new s.Fraction(0,1);const o=t.getGlobalStaffIndexOfFirstStaff(t.Instruments[n]);for(let e=0;e<t.Instruments[n].Staves.length;e++){const t=this.getLastSourceStaffEntryForInstrument(o+e);void 0!==t&&t.Timestamp&&r.lt(s.Fraction.plus(t.Timestamp,t.calculateMaxNoteLength()))&&(r=s.Fraction.plus(t.Timestamp,t.calculateMaxNoteLength()))}r.lt(e[n])&&(r=e[n]),i.push(r)}return i}getEntriesPerStaff(t){const e=[];for(const i of this.VerticalSourceStaffEntryContainers){const s=i.StaffEntries[t];s&&e.push(s)}return e}hasBeginInstructions(){for(let t=0,e=this.FirstInstructionsStaffEntries.length;t<e;t++){const e=this.FirstInstructionsStaffEntries[t];if(void 0!==e&&e.Instructions.length>0)return!0}return!1}beginsWithLineRepetition(){for(let t=0,e=this.FirstRepetitionInstructions.length;t<e;++t){const e=this.FirstRepetitionInstructions[t];if(e.type===o.RepetitionInstructionEnum.StartLine)return!0;if(void 0!==e.parentRepetition&&e===e.parentRepetition.startMarker&&!e.parentRepetition.FromWords)return!0}return!1}endsWithLineRepetition(){for(let t=0,e=this.LastRepetitionInstructions.length;t<e;++t){const e=this.LastRepetitionInstructions[t];if(e.type===o.RepetitionInstructionEnum.BackJumpLine)return!0;const i=e.parentRepetition;if(i&&!i.FromWords)for(let t=0,s=i.BackwardJumpInstructions.length;t<s;++t)if(e===i.BackwardJumpInstructions[t])return!0}return!1}beginsWithWordRepetition(){for(let t=0,e=this.FirstRepetitionInstructions.length;t<e;++t){const e=this.FirstRepetitionInstructions[t];if(void 0!==e.parentRepetition&&e===e.parentRepetition.startMarker&&e.parentRepetition.FromWords)return!0}return!1}endsWithWordRepetition(){for(let t=0,e=this.LastRepetitionInstructions.length;t<e;++t){const e=this.LastRepetitionInstructions[t],i=e.parentRepetition;if(i&&i.FromWords){for(let t=0,s=i.BackwardJumpInstructions.length;t<s;++t)if(e===i.BackwardJumpInstructions[t])return!0;if(e===i.forwardJumpInstruction)return!0}}return!1}beginsRepetitionEnding(){for(const t of this.FirstRepetitionInstructions)if(t.type===o.RepetitionInstructionEnum.Ending&&t.alignment===o.AlignmentType.Begin)return!0;return!1}endsRepetitionEnding(){for(const t of this.LastRepetitionInstructions)if(t.type===o.RepetitionInstructionEnum.Ending&&t.alignment===o.AlignmentType.End)return!0;return!1}getKeyInstruction(t){if(this.FirstInstructionsStaffEntries[t]){const e=this.FirstInstructionsStaffEntries[t];for(let t=0,i=e.Instructions.length;t<i;++t){const i=e.Instructions[t];if(i instanceof h.KeyInstruction)return i}}}getLastSourceStaffEntryForInstrument(t){let e;for(let i=this.verticalSourceStaffEntryContainers.length-1;i>=0&&(e=this.verticalSourceStaffEntryContainers[i].StaffEntries[t],!e);i--);return e}canBeReducedToMultiRest(){var t,e;if(this.firstRepetitionInstructions.length>0||this.lastRepetitionInstructions.length>0)return!1;let i=!0,s=!1;for(const t of this.verticalSourceStaffEntryContainers)if(t)for(const e of t.StaffEntries)if(e&&e.ParentStaff.ParentInstrument.Visible){if(e.ChordContainers.length>0)return!1;e.ParentStaff.hasLyrics&&(s=!0);for(const t of e.VoiceEntries){for(const e of t.Notes)if(!e.isRest()){i=!1;break}if(!i)break}}if(!i||s||this.hasMoodExpressions||this.tempoExpressions.length>0)return!1;for(const t of this.staffLinkedExpressions)if(t.length>0)return!1;for(const t of this.lastInstructionsStaffEntries)for(let e=0,i=null==t?void 0:t.Instructions.length;e<i;++e)if(t.Instructions[e]instanceof l.ClefInstruction)return!1;return(null===(t=this.Duration)||void 0===t?void 0:t.RealValue)===(null===(e=this.ActiveTimeSignature)||void 0===e?void 0:e.RealValue)}}},9050:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SourceStaffEntry=void 0;const s=i(1797),n=i(289),r=i(5198),o=i(3331);e.SourceStaffEntry=class{constructor(t,e){this.voiceEntries=[],this.instructions=[],this.chordSymbolContainers=[],this.verticalContainerParent=t,this.parentStaff=e}get ParentStaff(){return this.parentStaff}get VerticalContainerParent(){return this.verticalContainerParent}get Timestamp(){if(this.VerticalContainerParent)return this.VerticalContainerParent.Timestamp}get AbsoluteTimestamp(){if(this.VerticalContainerParent)return s.Fraction.plus(this.VerticalContainerParent.ParentMeasure.AbsoluteTimestamp,this.VerticalContainerParent.Timestamp)}get VoiceEntries(){return this.voiceEntries}set VoiceEntries(t){this.voiceEntries=t}get Link(){return this.staffEntryLink}set Link(t){this.staffEntryLink=t}get Instructions(){return this.instructions}set Instructions(t){this.instructions=t}get ChordContainers(){return this.chordSymbolContainers}set ChordContainers(t){this.chordSymbolContainers=t}removeAllInstructionsOfTypeClefInstruction(){let t=0,e=0;for(;t<this.instructions.length;)this.instructions[t]instanceof n.ClefInstruction?(this.instructions.splice(t,1),e++):t++;return e}removeFirstInstructionOfTypeClefInstruction(){for(let t=0;t<this.instructions.length;t++)if(this.instructions[t]instanceof n.ClefInstruction)return this.instructions.splice(t,1),!0;return!1}removeAllInstructionsOfTypeKeyInstruction(){let t=0,e=0;for(;t<this.instructions.length;)this.instructions[t]instanceof r.KeyInstruction?(this.instructions.splice(t,1),e++):t++;return e}removeFirstInstructionOfTypeKeyInstruction(){for(let t=0;t<this.instructions.length;t++)if(this.instructions[t]instanceof r.KeyInstruction)return this.instructions.splice(t,1),!0;return!1}removeAllInstructionsOfTypeRhythmInstruction(){let t=0,e=0;for(;t<this.instructions.length;)this.instructions[t]instanceof o.RhythmInstruction?(this.instructions.splice(t,1),e++):t++;return e}removeFirstInstructionOfTypeRhythmInstruction(){for(let t=0;t<this.instructions.length;t++)if(this.instructions[t]instanceof o.RhythmInstruction)return this.instructions.splice(t,1),!0;return!1}calculateMinNoteLength(){let t=new s.Fraction(Number.MAX_VALUE,1);for(let e=0,i=this.VoiceEntries.length;e<i;++e){const i=this.VoiceEntries[e];for(let e=0,s=i.Notes.length;e<s;++e){const s=i.Notes[e];s.Length.lt(t)&&(t=s.Length)}}return t}calculateMaxNoteLength(){let t=new s.Fraction(0,1);for(let e=0,i=this.VoiceEntries.length;e<i;++e){const i=this.VoiceEntries[e];for(let e=0,n=i.Notes.length;e<n;++e){const n=i.Notes[e];if(n.NoteTie){const e=s.Fraction.createFromFraction(n.Length);let i=!1;for(const t of n.NoteTie.Notes)t!==n?i&&e.Add(t.Length):i=!0;t.lt(e)&&(t=e)}else t.lt(n.Length)&&(t=n.Length)}}return t}hasNotes(){for(let t=0,e=this.VoiceEntries.length;t<e;++t)if(this.VoiceEntries[t].Notes.length>0)return!0;return!1}hasTie(){for(let t=0,e=this.VoiceEntries.length;t<e;++t)if(this.VoiceEntries[t].hasTie())return!0;return!1}findLinkedNotes(t){for(let e=0,i=this.voiceEntries.length;e<i;++e){const i=this.voiceEntries[e];for(let e=0,s=i.Notes.length;e<s;++e){const s=i.Notes[e];s.ParentStaffEntry===this&&t.push(s)}}}get hasOnlyRests(){for(const t of this.voiceEntries)for(const e of t.Notes)if(!e.isRest)return!1;return!0}}},0:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Staff=void 0,e.Staff=class{constructor(t,e){this.isTab=!1,this.voices=[],this.volume=1,this.stafflineCount=5,this.hasLyrics=!1,this.openTieDict={},this.parentInstrument=t,this.id=e,this.audible=!0,this.following=!0}get ParentInstrument(){return this.parentInstrument}set ParentInstrument(t){this.parentInstrument=t}get Voices(){return this.voices}get Id(){return this.id}get Volume(){return this.volume}set Volume(t){this.volume=t}get StafflineCount(){return this.stafflineCount}set StafflineCount(t){this.stafflineCount=t}}},4447:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StaffEntryLink=void 0,e.StaffEntryLink=class{constructor(t){this.linkStaffEntries=[],this.voiceEntry=t}get GetVoiceEntry(){return this.voiceEntry}get LinkStaffEntries(){return this.linkStaffEntries}set LinkStaffEntries(t){this.linkStaffEntries=t}}},2953:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TabNote=void 0;const s=i(5253);class n extends s.Note{constructor(t,e,i,s,n,r,o,a,l){super(t,e,i,s,n),this.stringNumberTab=r,this.fretNumber=o,this.bendArray=a,this.vibratoStroke=l}get StringNumberTab(){return this.stringNumberTab}get FretNumber(){return this.fretNumber}get BendArray(){return this.bendArray}get VibratoStroke(){return this.vibratoStroke}}e.TabNote=n},4555:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Tie=void 0;const n=i(1797),r=i(3748),o=s(i(2043));e.Tie=class{constructor(t,e){this.notes=[],this.TieNumber=1,this.TieDirection=r.PlacementEnum.NotYetDefined,this.NoteIndexToTieDirection={},this.AddNote(t),this.type=e}getTieDirection(t){if(!t)return this.TieDirection;for(let e=0;e<this.Notes.length;e++)if(this.Notes[e]===t){return this.NoteIndexToTieDirection[e]||this.TieDirection}return o.default.debug("tie.getTieDuration note not in tie.Notes"),this.TieDirection}get Notes(){return this.notes}get Type(){return this.type}get StartNote(){return this.notes[0]}get Duration(){const t=new n.Fraction;for(const e of this.notes)t.Add(e.Length);return t}get Pitch(){return this.StartNote.Pitch}AddNote(t){this.notes.push(t),t.NoteTie=this}}},8069:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Tuplet=void 0,e.Tuplet=class{constructor(t,e=!1){this.PlacementFromXml=!1,this.RenderTupletNumber=!0,this.notes=[],this.fractions=[],this.tupletLabelNumber=t,this.bracket=e}get TupletLabelNumber(){return this.tupletLabelNumber}set TupletLabelNumber(t){this.tupletLabelNumber=t}get Notes(){return this.notes}set Notes(t){this.notes=t}get Fractions(){return this.fractions}set Fractions(t){this.fractions=t}get Bracket(){return this.bracket}set Bracket(t){this.bracket=t}getNoteIndex(t){for(let e=this.notes.length-1;e>=0;e--)for(let i=0;i<this.notes[e].length;i++)if(t===this.notes[e][i])return e;return 0}}},141:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VerticalSourceStaffEntryContainer=void 0;const s=i(1797);e.VerticalSourceStaffEntryContainer=class{constructor(t,e,i){this.staffEntries=[],this.comments=[],this.timestamp=e,this.staffEntries=new Array(i),this.parentMeasure=t}$get$(t){return this.staffEntries[t]}$set$(t,e){this.staffEntries[t]=e}get Timestamp(){return this.timestamp}set Timestamp(t){this.timestamp=t}get StaffEntries(){return this.staffEntries}set StaffEntries(t){this.staffEntries=t}get Comments(){return this.comments}set Comments(t){this.comments=t}get ParentMeasure(){return this.parentMeasure}set ParentMeasure(t){this.parentMeasure=t}getAbsoluteTimestamp(){return s.Fraction.plus(this.timestamp,this.parentMeasure.AbsoluteTimestamp)}}},3884:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Voice=void 0,e.Voice=class{constructor(t,e){this.voiceEntries=[],this.volume=1,this.parent=t,this.visible=!0,this.audible=!0,this.following=!0,this.voiceId=e}get VoiceEntries(){return this.voiceEntries}get Parent(){return this.parent}get Visible(){return this.visible}set Visible(t){this.visible=t}get Audible(){return this.audible}set Audible(t){this.audible=t}get Following(){return this.following}set Following(t){this.following=t}get VoiceId(){return this.voiceId}get Volume(){return this.volume}set Volume(t){this.volume=t}}},908:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StemDirectionType=e.ArticulationEnum=e.VoiceEntry=void 0;const s=i(1797),n=i(5253),r=i(8640),o=i(5922),a=i(8640),l=i(1649);class h{constructor(t,e,i,s=!1,n=!1,r=!1){if(this.notes=[],this.articulations=[],this.technicalInstructions=[],this.lyricsEntries=new l.Dictionary,this.wantedStemDirection=u.Undefined,this.stemDirectionXml=u.Undefined,this.stemDirection=u.Undefined,this.timestamp=t,this.parentVoice=e,this.parentSourceStaffEntry=i,this.isGrace=s,this.graceAfterMainNote=!1,this.graceNoteSlash=n,this.graceSlur=r,void 0!==i){const t=i.VoiceEntries;-1===t.indexOf(this)&&t.push(this)}}get ParentSourceStaffEntry(){return this.parentSourceStaffEntry}get ParentVoice(){return this.parentVoice}get Timestamp(){return this.timestamp}set Timestamp(t){this.timestamp=t}get Notes(){return this.notes}get IsGrace(){return this.isGrace}set IsGrace(t){this.isGrace=t}get GraceAfterMainNote(){return this.graceAfterMainNote}set GraceAfterMainNote(t){this.graceAfterMainNote=t}get GraceNoteSlash(){return this.graceNoteSlash}set GraceNoteSlash(t){this.graceNoteSlash=t}get GraceSlur(){return this.graceSlur}set GraceSlur(t){this.graceSlur=t}get Articulations(){return this.articulations}set Articulations(t){this.articulations=t}get TechnicalInstructions(){return this.technicalInstructions}get LyricsEntries(){return this.lyricsEntries}get Arpeggio(){return this.arpeggio}set Arpeggio(t){this.arpeggio=t}get OrnamentContainer(){return this.ornamentContainer}set OrnamentContainer(t){this.ornamentContainer=t}set WantedStemDirection(t){this.wantedStemDirection=t}get WantedStemDirection(){return this.wantedStemDirection}set StemDirectionXml(t){this.stemDirectionXml=t}get StemDirectionXml(){return this.stemDirectionXml}set StemDirection(t){this.stemDirection=t}get StemDirection(){return this.stemDirection}get StemColorXml(){return this.stemColorXml}set StemColorXml(t){this.stemColorXml=t}get StemColor(){return this.stemColor}set StemColor(t){this.stemColor=t}hasArticulation(t){for(const e of this.articulations)if(e.Equals(t))return!0;return!1}static isSupportedArticulation(t){switch(t){case c.accent:case c.strongaccent:case c.softaccent:case c.invertedstrongaccent:case c.staccato:case c.staccatissimo:case c.spiccato:case c.tenuto:case c.fermata:case c.invertedfermata:case c.breathmark:case c.caesura:case c.lefthandpizzicato:case c.naturalharmonic:case c.snappizzicato:case c.upbow:case c.downbow:case c.bend:return!0;default:return!1}}hasTie(){for(let t=0,e=this.Notes.length;t<e;++t)if(this.Notes[t].NoteTie)return!0;return!1}hasSlur(){for(let t=0,e=this.Notes.length;t<e;++t)if(this.Notes[t].NoteSlurs.length>0)return!0;return!1}isStaccato(){for(const t of this.Articulations)if(t.articulationEnum===c.staccato)return!0;return!1}isAccent(){for(const t of this.Articulations)if(t.articulationEnum===c.accent||t.articulationEnum===c.strongaccent)return!0;return!1}getVerseNumberForLyricEntry(t){let e="1";return this.lyricsEntries.forEach(((i,s)=>{t===s&&(e=i)})),e}createVoiceEntriesForOrnament(t,e){t||(t=this);const i=[];if(!t.ornamentContainer)return;const n=this.notes[0],r=n.Length,l=t.ParentVoice,h=t.Timestamp;let c=s.Fraction.createFromFraction(h);switch(t.ornamentContainer.GetOrnament){case o.OrnamentEnum.Trill:{const o=new s.Fraction(r.Numerator,8*r.Denominator),u=n.Pitch.getTransposedPitch(1);let d=e.getAlterationForPitch(u);t.OrnamentContainer.AccidentalAbove!==a.AccidentalEnum.NONE&&(d=t.ornamentContainer.AccidentalAbove);for(let t=0;t<8;t++)c=s.Fraction.plus(h,new s.Fraction(t*o.Numerator,o.Denominator)),t%2==0?this.createBaseVoiceEntry(c,o,l,n,i):this.createAlteratedVoiceEntry(c,o,l,n.SourceMeasure,u,d,i);break}case o.OrnamentEnum.Turn:{const t=new s.Fraction(r.Numerator,4*r.Denominator),o=n.Pitch.getTransposedPitch(-1),a=e.getAlterationForPitch(o),h=n.Pitch.getTransposedPitch(1),u=e.getAlterationForPitch(h);this.createAlteratedVoiceEntry(c,t,l,n.SourceMeasure,h,u,i),c.Add(t),this.createBaseVoiceEntry(c,t,l,n,i),c.Add(t),this.createAlteratedVoiceEntry(c,t,l,n.SourceMeasure,o,a,i),c.Add(t),this.createBaseVoiceEntry(c,t,l,n,i);break}case o.OrnamentEnum.InvertedTurn:{const t=new s.Fraction(r.Numerator,4*r.Denominator),o=n.Pitch.getTransposedPitch(-1),a=e.getAlterationForPitch(o),h=n.Pitch.getTransposedPitch(1),u=e.getAlterationForPitch(h);this.createAlteratedVoiceEntry(c,t,l,n.SourceMeasure,o,a,i),c.Add(t),this.createBaseVoiceEntry(c,t,l,n,i),c.Add(t),this.createAlteratedVoiceEntry(c,t,l,n.SourceMeasure,h,u,i),c.Add(t),this.createBaseVoiceEntry(c,t,l,n,i);break}case o.OrnamentEnum.DelayedTurn:{const t=new s.Fraction(r.Numerator,2*r.Denominator),o=n.Pitch.getTransposedPitch(-1),a=e.getAlterationForPitch(o),u=n.Pitch.getTransposedPitch(1),d=e.getAlterationForPitch(u);this.createBaseVoiceEntry(c,t,l,n,i),c=s.Fraction.plus(h,t),t.Denominator=8*r.Denominator,this.createAlteratedVoiceEntry(c,t,l,n.SourceMeasure,u,d,i),c.Add(t),this.createBaseVoiceEntry(c,t,l,n,i),c.Add(t),this.createAlteratedVoiceEntry(c,t,l,n.SourceMeasure,o,a,i),c.Add(t),this.createBaseVoiceEntry(c,t,l,n,i);break}case o.OrnamentEnum.DelayedInvertedTurn:{const t=new s.Fraction(r.Numerator,2*r.Denominator),o=n.Pitch.getTransposedPitch(-1),a=e.getAlterationForPitch(o),u=n.Pitch.getTransposedPitch(1),d=e.getAlterationForPitch(u);this.createBaseVoiceEntry(c,t,l,n,i),c=s.Fraction.plus(h,t),t.Denominator=8*r.Denominator,this.createAlteratedVoiceEntry(c,t,l,n.SourceMeasure,o,a,i),c.Add(t),this.createBaseVoiceEntry(c,t,l,n,i),c.Add(t),this.createAlteratedVoiceEntry(c,t,l,n.SourceMeasure,u,d,i),c.Add(t),this.createBaseVoiceEntry(c,t,l,n,i);break}case o.OrnamentEnum.Mordent:{const t=new s.Fraction(r.Numerator,4*r.Denominator),o=n.Pitch.getTransposedPitch(1),a=e.getAlterationForPitch(o);this.createBaseVoiceEntry(c,t,l,n,i),c.Add(t),this.createAlteratedVoiceEntry(c,t,l,n.SourceMeasure,o,a,i),t.Denominator=2*r.Denominator,c=s.Fraction.plus(h,t),this.createBaseVoiceEntry(c,t,l,n,i);break}case o.OrnamentEnum.InvertedMordent:{const t=new s.Fraction(r.Numerator,4*r.Denominator),o=n.Pitch.getTransposedPitch(-1),a=e.getAlterationForPitch(o);this.createBaseVoiceEntry(c,t,l,n,i),c.Add(t),this.createAlteratedVoiceEntry(c,t,l,n.SourceMeasure,o,a,i),t.Denominator=2*r.Denominator,c=s.Fraction.plus(h,t),this.createBaseVoiceEntry(c,t,l,n,i);break}default:throw new RangeError}return i}createBaseVoiceEntry(t,e,i,s,o){const a=new h(t,i,s.ParentStaffEntry),l=new r.Pitch(s.Pitch.FundamentalNote,s.Pitch.Octave,s.Pitch.Accidental),c=new n.Note(a,void 0,e,l,s.SourceMeasure);a.Notes.push(c),o.push(a)}createAlteratedVoiceEntry(t,e,i,s,o,a,l){const c=new h(t,i,void 0),u=new r.Pitch(o.FundamentalNote,o.Octave,a),d=new n.Note(c,void 0,e,u,s);c.Notes.push(d),l.push(c)}}var c,u;e.VoiceEntry=h,function(t){t[t.accent=0]="accent",t[t.strongaccent=1]="strongaccent",t[t.softaccent=2]="softaccent",t[t.marcatoup=3]="marcatoup",t[t.marcatodown=4]="marcatodown",t[t.invertedstrongaccent=5]="invertedstrongaccent",t[t.staccato=6]="staccato",t[t.staccatissimo=7]="staccatissimo",t[t.spiccato=8]="spiccato",t[t.tenuto=9]="tenuto",t[t.fermata=10]="fermata",t[t.invertedfermata=11]="invertedfermata",t[t.breathmark=12]="breathmark",t[t.caesura=13]="caesura",t[t.lefthandpizzicato=14]="lefthandpizzicato",t[t.naturalharmonic=15]="naturalharmonic",t[t.snappizzicato=16]="snappizzicato",t[t.upbow=17]="upbow",t[t.downbow=18]="downbow",t[t.scoop=19]="scoop",t[t.plop=20]="plop",t[t.doit=21]="doit",t[t.falloff=22]="falloff",t[t.stress=23]="stress",t[t.unstress=24]="unstress",t[t.detachedlegato=25]="detachedlegato",t[t.otherarticulation=26]="otherarticulation",t[t.bend=27]="bend"}(c=e.ArticulationEnum||(e.ArticulationEnum={})),function(t){t[t.Undefined=-1]="Undefined",t[t.Up=0]="Up",t[t.Down=1]="Down",t[t.None=2]="None",t[t.Double=3]="Double"}(u=e.StemDirectionType||(e.StemDirectionType={}))},6550:function(t,e,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(t,e,i,s){void 0===s&&(s=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,s,n)}:function(t,e,i,s){void 0===s&&(s=i),t[s]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||s(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(3029),e),n(i(9224),e),n(i(4123),e),n(i(7198),e),n(i(2947),e),n(i(5253),e),n(i(766),e),n(i(2478),e),n(i(5922),e),n(i(5942),e),n(i(9050),e),n(i(0),e),n(i(4447),e),n(i(4555),e),n(i(8069),e),n(i(141),e),n(i(3884),e),n(i(908),e),n(i(6065),e),n(i(5253),e),n(i(2478),e),n(i(5942),e),n(i(9050),e),n(i(141),e),n(i(4555),e)},4761:function(t,e,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(t,e,i,s){void 0===s&&(s=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,s,n)}:function(t,e,i,s){void 0===s&&(s=i),t[s]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||s(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(1703),e),n(i(6842),e),n(i(884),e),n(i(2255),e),n(i(7514),e),n(i(5142),e),n(i(6550),e),n(i(4990),e),n(i(4257),e),n(i(9714),e),n(i(4759),e),n(i(4143),e)},3495:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AJAX=void 0,e.AJAX=class{static ajax(t,e=9e3){let i;const s=t.indexOf(".mxl")>-1?"text/plain; charset=x-user-defined":"application/xml";if(XMLHttpRequest)i=new XMLHttpRequest;else{if(!ActiveXObject)return Promise.reject(new Error("XMLHttp not supported."));i=new ActiveXObject("Microsoft.XMLHTTP")}return i.timeout=e,new Promise(((e,n)=>{i.onreadystatechange=()=>{i.readyState===XMLHttpRequest.DONE&&(200===i.status||0===i.status&&i.responseText?e(i.responseText):n(new Error("Could not retrieve requested URL "+i.status)))},i.ontimeout=t=>{n(new Error("Server request Timeout"))},i.overrideMimeType(s),i.open("GET",t,!0),i.send()}))}}},530:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Cursor=void 0;const s=i(1797);e.Cursor=class{constructor(t,e,i){this.hidden=!0,this.currentPageNumber=1,this.skipInvisibleNotes=!0,this.container=t,this.openSheetMusicDisplay=e,this.rules=this.openSheetMusicDisplay.EngravingRules,this.cursorOptions=i;let s=0;for(this.cursorElementId="cursorImg-0";document.getElementById(this.cursorElementId);)s++,this.cursorElementId=`cursorImg-${s}`;const n=document.createElement("img");n.id=this.cursorElementId,n.style.position="absolute",!0===this.cursorOptions.follow?(this.wantedZIndex="-1",n.style.zIndex=this.wantedZIndex):(this.wantedZIndex="-2",n.style.zIndex=this.wantedZIndex),this.cursorElement=n,this.container.appendChild(n)}adjustToBackgroundColor(){let t;t=this.rules.PageBackgroundColor?"1":this.wantedZIndex,this.cursorElement.style.zIndex=t}init(t,e){this.manager=t,this.graphic=e,this.reset(),this.hidden=!0,this.hide()}show(){this.hidden=!1,this.update(),this.adjustToBackgroundColor()}resetIterator(){if(!this.openSheetMusicDisplay.Sheet||!this.openSheetMusicDisplay.Sheet.SourceMeasures)return void console.log("OSMD.Cursor.resetIterator(): sheet or measures were null/undefined.");const t=this.openSheetMusicDisplay.Sheet.SourceMeasures.length-1;let e=this.rules.MinMeasureToDrawIndex;e=Math.min(e,t);let i=this.rules.MaxMeasureToDrawIndex;if(i=Math.min(i,t),this.openSheetMusicDisplay.Sheet&&this.openSheetMusicDisplay.Sheet.SourceMeasures.length>e&&(this.openSheetMusicDisplay.Sheet.SelectionStart=this.openSheetMusicDisplay.Sheet.SourceMeasures[e].AbsoluteTimestamp),this.openSheetMusicDisplay.Sheet&&this.openSheetMusicDisplay.Sheet.SourceMeasures.length>i){const t=this.openSheetMusicDisplay.Sheet.SourceMeasures[i];this.openSheetMusicDisplay.Sheet.SelectionEnd=s.Fraction.plus(t.AbsoluteTimestamp,t.Duration)}this.iterator=this.manager.getIterator(),this.iterator.SkipInvisibleNotes=this.skipInvisibleNotes}getStaffEntryFromVoiceEntry(t){const e=t.ParentSourceStaffEntry.VerticalContainerParent.ParentMeasure.measureListIndex,i=t.ParentSourceStaffEntry.ParentStaff.idInMusicSheet;return this.graphic.findGraphicalStaffEntryFromMeasureList(i,e,t.ParentSourceStaffEntry)}update(){if(this.hidden||void 0===this.hidden||null===this.hidden)return;this.updateCurrentPage();const t=this.iterator;let e,i=t.CurrentVisibleVoiceEntries(),s=t.CurrentMeasureIndex,n=0,r=0,o=0;if(0!==i.length||t.FrontReached||t.EndReached||(t.moveToPrevious(),i=t.CurrentVisibleVoiceEntries(),t.moveToNext()),t.FrontReached&&0===i.length){t.moveToNext(),i=t.CurrentVisibleVoiceEntries();const s=this.findVisibleGraphicalMeasure(t.CurrentMeasureIndex);n=s.PositionAndShape.AbsolutePosition.x,e=s.ParentMusicSystem,t.moveToPrevious()}else if(t.EndReached||!t.CurrentVoiceEntries||0===i.length){t.moveToPrevious(),i=t.CurrentVisibleVoiceEntries(),s=t.CurrentMeasureIndex;const r=this.findVisibleGraphicalMeasure(t.CurrentMeasureIndex);n=r.PositionAndShape.AbsolutePosition.x+r.PositionAndShape.Size.width,e=r.ParentMusicSystem,t.moveToNext()}else if(t.CurrentMeasure.isReducedToMultiRest){const i=this.findVisibleGraphicalMeasure(t.CurrentMeasureIndex),s=i.parentSourceMeasure.multipleRestMeasures,r=t.CurrentMeasure.multipleRestMeasureNumber/(s+1),o=i.PositionAndShape.Size.width-i.beginInstructionsWidth;n=i.PositionAndShape.AbsolutePosition.x+i.beginInstructionsWidth+r*o,e=i.ParentMusicSystem}else{const t=i.map((t=>this.getStaffEntryFromVoiceEntry(t))).sort(((t,e)=>{var i,s,n,r;return(null===(s=null===(i=null==t?void 0:t.PositionAndShape)||void 0===i?void 0:i.AbsolutePosition)||void 0===s?void 0:s.x)<=(null===(r=null===(n=null==e?void 0:e.PositionAndShape)||void 0===n?void 0:n.AbsolutePosition)||void 0===r?void 0:r.x)?-1:1}))[0];t&&(n=t.PositionAndShape.AbsolutePosition.x,e=t.parentMeasure.ParentMusicSystem)}if(!e)return;r=e.PositionAndShape.AbsolutePosition.y+e.StaffLines[0].PositionAndShape.RelativePosition.y;let a=e.PositionAndShape.AbsolutePosition.y;const l=e.StaffLines[e.StaffLines.length-1];l&&(a+=l.PositionAndShape.RelativePosition.y+l.StaffHeight),o=a-r;const h=this.graphic.findGraphicalMeasure(s,0).PositionAndShape;if(this.updateWidthAndStyle(h,n,r,o),this.openSheetMusicDisplay.FollowCursor&&this.cursorOptions.follow)if(this.openSheetMusicDisplay.EngravingRules.RenderSingleHorizontalStaffline)this.cursorElement.scrollIntoView({behavior:"smooth",inline:"center"});else{const t=this.cursorElement.getBoundingClientRect().top;this.cursorElement.scrollIntoView({behavior:t<1e3?"smooth":"auto",block:"center"})}this.cursorElement.style.display=""}findVisibleGraphicalMeasure(t){for(let t=0;t<this.graphic.NumberOfStaves;t++){const e=this.graphic.findGraphicalMeasure(this.iterator.CurrentMeasureIndex,t);if(null==e?void 0:e.ParentStaff.ParentInstrument.Visible)return e}}updateWidthAndStyle(t,e,i,s){const n=this.cursorElement;let r=0;switch(this.cursorOptions.type){case 1:n.style.top=10*i*this.openSheetMusicDisplay.zoom+"px",n.style.left=10*(e-1.5)*this.openSheetMusicDisplay.zoom+"px",n.height=10*s*this.openSheetMusicDisplay.zoom,r=5*this.openSheetMusicDisplay.zoom;break;case 2:n.style.top=10*(i-2.5)*this.openSheetMusicDisplay.zoom+"px",n.style.left=10*e*this.openSheetMusicDisplay.zoom+"px",n.height=15*this.openSheetMusicDisplay.zoom,r=5*this.openSheetMusicDisplay.zoom;break;case 3:n.style.top=10*t.AbsolutePosition.y*this.openSheetMusicDisplay.zoom+"px",n.style.left=10*t.AbsolutePosition.x*this.openSheetMusicDisplay.zoom+"px",n.height=10*s*this.openSheetMusicDisplay.zoom,r=10*t.Size.width*this.openSheetMusicDisplay.zoom;break;case 4:n.style.top=10*t.AbsolutePosition.y*this.openSheetMusicDisplay.zoom+"px",n.style.left=10*t.AbsolutePosition.x*this.openSheetMusicDisplay.zoom+"px",n.height=10*s*this.openSheetMusicDisplay.zoom,r=10*(e-t.AbsolutePosition.x)*this.openSheetMusicDisplay.zoom;break;default:n.style.top=10*i*this.openSheetMusicDisplay.zoom+"px",n.style.left=10*(e-1.5)*this.openSheetMusicDisplay.zoom+"px",n.height=10*s*this.openSheetMusicDisplay.zoom,r=30*this.openSheetMusicDisplay.zoom}r!==n.width&&(n.width=r,this.updateStyle(r,this.cursorOptions))}hide(){this.cursorElement.style.display="none",this.hidden=!0}previous(){this.iterator.moveToPreviousVisibleVoiceEntry(!1),this.update()}next(){this.iterator.moveToNextVisibleVoiceEntry(!1),this.update()}reset(){this.resetIterator(),this.update()}updateStyle(t,e){void 0!==e&&(this.cursorOptions=e);const i=document.createElement("canvas");i.width=this.cursorElement.width,i.height=1;const s=i.getContext("2d");s.globalAlpha=this.cursorOptions.alpha;const n=s.createLinearGradient(0,0,this.cursorElement.width,0);switch(this.cursorOptions.type){case 1:case 2:case 3:case 4:n.addColorStop(1,this.cursorOptions.color);break;default:n.addColorStop(0,"white"),n.addColorStop(.2,this.cursorOptions.color),n.addColorStop(.8,this.cursorOptions.color),n.addColorStop(1,"white")}s.fillStyle=n,s.fillRect(0,0,t,1),this.cursorElement.src=i.toDataURL("image/png")}get Iterator(){return this.iterator}get Hidden(){return this.hidden}VoicesUnderCursor(t){return this.iterator.CurrentVisibleVoiceEntries(t)}NotesUnderCursor(t){const e=this.VoicesUnderCursor(t),i=[];return e.forEach((t=>{i.push.apply(i,t.Notes)})),i}GNotesUnderCursor(t){const e=this.VoicesUnderCursor(t),i=[];return e.forEach((t=>{i.push(...t.Notes.map((t=>this.rules.GNote(t))))})),i}updateCurrentPage(){let t=this.iterator.currentTimeStamp;t.RealValue<0&&(t=new s.Fraction(0,0));for(const e of this.graphic.MusicPages)if(e.MusicSystems.last().GetSystemsLastTimeStamp().gt(t)){const t=e.PageNumber;return t!==this.currentPageNumber&&(this.container.removeChild(this.cursorElement),this.container=document.getElementById("osmdCanvasPage"+t),this.container.appendChild(this.cursorElement)),this.currentPageNumber=t}return 1}get SkipInvisibleNotes(){return this.skipInvisibleNotes}set SkipInvisibleNotes(t){this.skipInvisibleNotes=t,this.iterator.SkipInvisibleNotes=t}get CursorOptions(){return this.cursorOptions}set CursorOptions(t){this.cursorOptions=t}}},41:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OSMDOptions=e.SkyBottomLineBatchCalculatorBackendType=e.BackendType=e.FillEmptyMeasuresWithWholeRests=e.AlignRestOption=e.CursorType=void 0;const s=i(7459);var n,r,o,a,l;(l=e.CursorType||(e.CursorType={}))[l.Standard=0]="Standard",l[l.ThinLeft=1]="ThinLeft",l[l.ShortThinTopLeft=2]="ShortThinTopLeft",l[l.CurrentArea=3]="CurrentArea",l[l.CurrentAreaLeft=4]="CurrentAreaLeft",(a=e.AlignRestOption||(e.AlignRestOption={}))[a.Never=0]="Never",a[a.Always=1]="Always",a[a.Auto=2]="Auto",(o=e.FillEmptyMeasuresWithWholeRests||(e.FillEmptyMeasuresWithWholeRests={}))[o.No=0]="No",o[o.YesVisible=1]="YesVisible",o[o.YesInvisible=2]="YesInvisible",function(t){t[t.SVG=0]="SVG",t[t.Canvas=1]="Canvas"}(n=e.BackendType||(e.BackendType={})),(r=e.SkyBottomLineBatchCalculatorBackendType||(e.SkyBottomLineBatchCalculatorBackendType={}))[r.Plain=0]="Plain",r[r.WebGL=1]="WebGL",e.OSMDOptions=class{static OSMDOptionsStandard(){return{autoResize:!0,backend:"svg",drawingParameters:s.DrawingParametersEnum.default}}static BackendTypeFromString(t){return t&&"canvas"===t.toLowerCase()?n.Canvas:n.SVG}}},9629:function(t,e,i){"use strict";var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.OpenSheetMusicDisplay=void 0;const n=i(9228),r=i(8738),o=i(1372),a=i(4324),l=i(4040),h=i(5820),c=i(9505),u=i(4028),d=i(530),f=i(7056),m=i(3495),p=s(i(2043)),b=i(7459),g=i(41),S=i(1405),y=i(3748),E=i(1649),v=i(8155),x=i(8640);class _{constructor(t,e=g.OSMDOptions.OSMDOptionsStandard()){if(this.version="1.7.6-release",this.cursorsOptions=[],this.cursors=[],this.zoom=1,this.zoomUpdated=!1,this.loadUrlTimeout=5e3,"string"==typeof t?this.container=document.getElementById(t):t&&"appendChild"in t&&(this.container=t),!this.container)throw new Error("Please pass a valid div container to OpenSheetMusicDisplay");void 0===e.autoResize&&(e.autoResize=!0),this.backendType=g.BackendType.SVG,this.setOptions(e)}get cursor(){return this.cursors[0]}load(t,e="Untitled Score"){if(this.reset(),"string"==typeof t){const e=t,i=this;if("PK"===e.substr(0,4))return p.default.debug("[OSMD] This is a zip file, unpack it first: "+e),f.MXLHelper.MXLtoXMLstring(e).then((t=>i.load(t)),(t=>{throw p.default.debug(t),new Error("OpenSheetMusicDisplay: Invalid MXL file")}));if(""===e.substr(0,3))return p.default.debug("[OSMD] UTF with BOM detected, truncate first three bytes and pass along: "+e),i.load(e.substr(3));let s=e;if(/^\s/.test(s)&&(s=s.trim()),s.substr(0,6).includes("<?xml")){const e=this.OnXMLRead(s);p.default.debug("[OSMD] Finally parsing XML content, length: "+e.length),t=(new DOMParser).parseFromString(e,"application/xml")}else{if(s.length<2083)return p.default.debug("[OSMD] Retrieve the file at the given URL: "+s),m.AJAX.ajax(s,this.loadUrlTimeout).then((t=>i.load(t)),(t=>{throw t}));console.error("[OSMD] osmd.load(string): Could not process string. Did not find <?xml at beginning.")}}if(!t||!t.nodeName)return Promise.reject(new Error("OpenSheetMusicDisplay: The document which was provided is invalid"));const i=t,s=i.childNodes;let r;p.default.debug("[OSMD] load(), Document url: "+i.URL);for(let t=0,e=s.length;t<e;t+=1){const e=s[t];if(e.nodeType===Node.ELEMENT_NODE&&"score-partwise"===e.nodeName.toLowerCase()){r=e;break}}if(!r)return console.error("Could not parse MusicXML, no valid partwise element found"),Promise.reject(new Error("OpenSheetMusicDisplay: Document is not a valid 'partwise' MusicXML"));const a=new n.IXmlElement(r),l=new o.MusicSheetReader(void 0,this.rules);return this.sheet=l.createMusicSheet(a,e),void 0===this.sheet?Promise.reject(new Error("given music sheet was incomplete or could not be loaded.")):(p.default.info(`[OSMD] Loaded sheet ${this.sheet.TitleString} successfully.`),this.needBackendUpdate=!0,this.updateGraphic(),Promise.resolve({}))}updateGraphic(){const t=new r.VexFlowMusicSheetCalculator(this.rules);this.graphic=new a.GraphicalMusicSheet(this.sheet,t),this.drawingParameters.drawCursors&&this.cursors.forEach((t=>{t.init(this.sheet.MusicPartManager,this.graphic)}))}render(){var t;if(!this.graphic)throw new Error("OpenSheetMusicDisplay: Before rendering a music sheet, please load a MusicXML file");null===(t=this.drawer)||void 0===t||t.clear();let e=this.container.offsetWidth;this.rules.RenderSingleHorizontalStaffline&&(e=this.rules.SheetMaximumWidth),this.sheet.pageWidth=e/this.zoom/10,this.rules.PageFormat&&!this.rules.PageFormat.IsUndefined?(this.rules.PageHeight=this.sheet.pageWidth/this.rules.PageFormat.aspectRatio,p.default.debug("[OSMD] PageHeight: "+this.rules.PageHeight)):(p.default.debug("[OSMD] endless/undefined pageformat, id: "+this.rules.PageFormat.idString),this.rules.PageHeight=100001),this.graphic.reCalculate(),this.drawingParameters.drawCursors&&(this.graphic.Cursors.length=0),this.createOrRefreshRenderBackend(),this.needBackendUpdate=!1,this.drawer.setZoom(this.zoom),this.drawer.drawSheet(this.graphic),this.enableOrDisableCursors(this.drawingParameters.drawCursors),this.drawingParameters.drawCursors&&this.cursors.forEach((t=>{t.update()})),this.zoomUpdated=!1}createOrRefreshRenderBackend(){this.drawer&&this.drawer.Backends&&(this.drawer.Backends[0]&&this.drawer.Backends[0].removeAllChildrenFromContainer(this.container),this.drawer.Backends.clear()),this.drawingParameters.Rules=this.rules,this.drawer=new h.VexFlowMusicSheetDrawer(this.drawingParameters),this.drawer.drawableBoundingBoxElement=this.DrawBoundingBox,this.drawer.bottomLineVisible=this.drawBottomLine,this.drawer.skyLineVisible=this.drawSkyLine;let t,e=this.container.offsetWidth;this.rules.RenderSingleHorizontalStaffline&&(e=10*(this.EngravingRules.PageLeftMargin+this.graphic.MusicPages[0].PositionAndShape.Size.width+this.EngravingRules.PageRightMargin)*this.zoom);const i=32767;for(const s of this.graphic.MusicPages){if(s.PageNumber>this.rules.MaxPageToDrawNumber)break;const n=this.createBackend(this.backendType,s),r=" exceeds CanvasBackend limit of 32767. Cutting off score.";n.getOSMDBackendType()===g.BackendType.Canvas&&e>i&&(p.default.warn("[OSMD] Warning: width of "+e+r),e=i),this.rules.PageFormat&&!this.rules.PageFormat.IsUndefined?t=e/this.rules.PageFormat.aspectRatio:(t=s.PositionAndShape.Size.height,t+=this.rules.PageBottomMargin,n.getOSMDBackendType()===g.BackendType.Canvas&&(t+=.1),t+=s.PositionAndShape.BorderTop,this.rules.RenderTitle&&(t+=this.rules.TitleTopDistance),t*=10*this.zoom),n.getOSMDBackendType()===g.BackendType.Canvas&&t>i&&(p.default.warn("[OSMD] Warning: height of "+t+r),t=Math.min(t,i)),n.resize(e,t),n.clear(),n.getContext().setFillStyle(this.rules.DefaultColorMusic),n.getContext().setStrokeStyle(this.rules.DefaultColorMusic),this.drawer.Backends.push(n),this.graphic.drawer=this.drawer}}exportSVG(){var t;for(const e of null===(t=this.drawer)||void 0===t?void 0:t.Backends)e instanceof c.SvgVexFlowBackend&&e.export()}IsReadyToRender(){return void 0!==this.graphic}clear(){this.drawer.clear(),this.reset()}setOptions(t){if(this.rules||(this.rules=new S.EngravingRules),this.drawingParameters||t.drawingParameters?t.drawingParameters&&(this.drawingParameters?this.drawingParameters.DrawingParametersEnum=b.DrawingParametersEnum[t.drawingParameters.toLowerCase()]:this.drawingParameters=new b.DrawingParameters(b.DrawingParametersEnum[t.drawingParameters],this.rules)):this.drawingParameters=new b.DrawingParameters(b.DrawingParametersEnum.default,this.rules),null==t)return void p.default.warn("warning: osmd.setOptions() called without an options parameter, has no effect.\nexample usage: osmd.setOptions({drawCredits: false, drawPartNames: false})");this.OnXMLRead=function(t){return t},t.onXMLRead&&(this.OnXMLRead=t.onXMLRead);let e=!this.drawer||!this.drawer.Backends||this.drawer.Backends.length<1;if(void 0!==t.backend){const i=g.OSMDOptions.BackendTypeFromString(t.backend);e=e||this.backendType!==i,this.backendType=i}this.needBackendUpdate=e,void 0!==t.autoBeam&&(this.rules.AutoBeamNotes=t.autoBeam);const i=t.autoBeamOptions;if(i&&(void 0===i.maintain_stem_directions&&(i.maintain_stem_directions=!1),this.rules.AutoBeamOptions=i,i.groups&&i.groups.length))for(const t of i.groups)if(2!==t.length)throw new Error("Each fraction in autoBeamOptions.groups must be of length 2, e.g. [3,4] for beaming three fourths");void 0!==t.percussionOneLineCutoff&&(this.rules.PercussionOneLineCutoff=t.percussionOneLineCutoff),0!==this.rules.PercussionOneLineCutoff&&void 0!==t.percussionForceVoicesOneLineCutoff&&(this.rules.PercussionForceVoicesOneLineCutoff=t.percussionForceVoicesOneLineCutoff),void 0!==t.alignRests&&(this.rules.AlignRests=t.alignRests),void 0!==t.coloringMode&&this.setColoringMode(t),void 0!==t.coloringEnabled&&(this.rules.ColoringEnabled=t.coloringEnabled),void 0!==t.colorStemsLikeNoteheads&&(this.rules.ColorStemsLikeNoteheads=t.colorStemsLikeNoteheads),t.disableCursor&&(this.drawingParameters.drawCursors=!1),t.drawHiddenNotes&&(this.drawingParameters.drawHiddenNotes=!0),void 0!==t.drawCredits&&(this.drawingParameters.DrawCredits=t.drawCredits),void 0!==t.drawComposer&&(this.drawingParameters.DrawComposer=t.drawComposer),void 0!==t.drawTitle&&(this.drawingParameters.DrawTitle=t.drawTitle),void 0!==t.drawSubtitle&&(this.drawingParameters.DrawSubtitle=t.drawSubtitle),void 0!==t.drawLyricist&&(this.drawingParameters.DrawLyricist=t.drawLyricist),void 0!==t.drawMetronomeMarks&&(this.rules.MetronomeMarksDrawn=t.drawMetronomeMarks),void 0!==t.drawPartNames&&(this.drawingParameters.DrawPartNames=t.drawPartNames,t.drawPartAbbreviations||(this.rules.RenderPartAbbreviations=t.drawPartNames)),void 0!==t.drawPartAbbreviations&&(this.rules.RenderPartAbbreviations=t.drawPartAbbreviations),!1===t.drawFingerings&&(this.rules.RenderFingerings=!1),void 0!==t.drawMeasureNumbers&&(this.rules.RenderMeasureNumbers=t.drawMeasureNumbers),t.drawMeasureNumbersOnlyAtSystemStart&&(this.rules.RenderMeasureNumbersOnlyAtSystemStart=t.drawMeasureNumbersOnlyAtSystemStart),void 0!==t.drawLyrics&&(this.rules.RenderLyrics=t.drawLyrics),void 0!==t.drawTimeSignatures&&(this.rules.RenderTimeSignatures=t.drawTimeSignatures),void 0!==t.drawSlurs&&(this.rules.RenderSlurs=t.drawSlurs),void 0!==t.measureNumberInterval&&(this.rules.MeasureNumberLabelOffset=t.measureNumberInterval),void 0!==t.useXMLMeasureNumbers&&(this.rules.UseXMLMeasureNumbers=t.useXMLMeasureNumbers),void 0!==t.fingeringPosition&&(this.rules.FingeringPosition=y.AbstractExpression.PlacementEnumFromString(t.fingeringPosition)),void 0!==t.fingeringInsideStafflines&&(this.rules.FingeringInsideStafflines=t.fingeringInsideStafflines),void 0!==t.newSystemFromXML&&(this.rules.NewSystemAtXMLNewSystemAttribute=t.newSystemFromXML),void 0!==t.newSystemFromNewPageInXML&&(this.rules.NewSystemAtXMLNewPageAttribute=t.newSystemFromNewPageInXML),void 0!==t.newPageFromXML&&(this.rules.NewPageAtXMLNewPageAttribute=t.newPageFromXML),void 0!==t.fillEmptyMeasuresWithWholeRest&&(this.rules.FillEmptyMeasuresWithWholeRest=t.fillEmptyMeasuresWithWholeRest),void 0!==t.followCursor&&(this.FollowCursor=t.followCursor),void 0!==t.setWantedStemDirectionByXml&&(this.rules.SetWantedStemDirectionByXml=t.setWantedStemDirectionByXml),t.darkMode?(this.rules.applyDefaultColorMusic("#FFFFFF"),this.rules.PageBackgroundColor="#000000"):!1===t.darkMode&&(this.rules.applyDefaultColorMusic("#000000"),this.rules.PageBackgroundColor=void 0),t.defaultColorMusic&&this.rules.applyDefaultColorMusic(t.defaultColorMusic),t.defaultColorNotehead&&(this.rules.DefaultColorNotehead=t.defaultColorNotehead),t.defaultColorRest&&(this.rules.DefaultColorRest=t.defaultColorRest),t.defaultColorStem&&(this.rules.DefaultColorStem=t.defaultColorStem),t.defaultColorLabel&&(this.rules.DefaultColorLabel=t.defaultColorLabel),t.defaultColorTitle&&(this.rules.DefaultColorTitle=t.defaultColorTitle),t.defaultFontFamily&&(this.rules.DefaultFontFamily=t.defaultFontFamily),t.defaultFontStyle&&(this.rules.DefaultFontStyle=t.defaultFontStyle),t.drawUpToMeasureNumber&&(this.rules.MaxMeasureToDrawIndex=t.drawUpToMeasureNumber-1),t.drawFromMeasureNumber&&(this.rules.MinMeasureToDrawIndex=t.drawFromMeasureNumber-1),t.drawUpToPageNumber&&(this.rules.MaxPageToDrawNumber=t.drawUpToPageNumber),t.drawUpToSystemNumber&&(this.rules.MaxSystemToDrawNumber=t.drawUpToSystemNumber),t.tupletsRatioed&&(this.rules.TupletsRatioed=!0),t.tupletsBracketed&&(this.rules.TupletsBracketed=!0),t.tripletsBracketed&&(this.rules.TripletsBracketed=!0),t.autoResize?(this.resizeHandlerAttached||this.autoResize(),this.autoResizeEnabled=!0):!1===t.autoResize&&(this.autoResizeEnabled=!1),void 0!==t.pageFormat&&this.setPageFormat(t.pageFormat),void 0!==t.pageBackgroundColor&&(this.rules.PageBackgroundColor=t.pageBackgroundColor),void 0!==t.renderSingleHorizontalStaffline&&(this.rules.RenderSingleHorizontalStaffline=t.renderSingleHorizontalStaffline),void 0!==t.spacingFactorSoftmax&&(this.rules.SoftmaxFactorVexFlow=t.spacingFactorSoftmax),void 0!==t.spacingBetweenTextLines&&(this.rules.SpacingBetweenTextLines=t.spacingBetweenTextLines),void 0!==t.stretchLastSystemLine&&(this.rules.StretchLastSystemLine=t.stretchLastSystemLine),void 0!==t.autoGenerateMultipleRestMeasuresFromRestMeasures&&(this.rules.AutoGenerateMultipleRestMeasuresFromRestMeasures=t.autoGenerateMultipleRestMeasuresFromRestMeasures),void 0!==t.cursorsOptions?this.cursorsOptions=t.cursorsOptions:this.cursorsOptions=[{type:0,color:this.EngravingRules.DefaultColorCursor,alpha:.5,follow:!0}],void 0!==t.preferredSkyBottomLineBatchCalculatorBackend&&(this.rules.PreferredSkyBottomLineBatchCalculatorBackend=t.preferredSkyBottomLineBatchCalculatorBackend),void 0!==t.skyBottomLineBatchMinMeasures&&(this.rules.SkyBottomLineBatchMinMeasures=t.skyBottomLineBatchMinMeasures)}setColoringMode(t){if(t.coloringMode===b.ColoringModes.XML)return void(this.rules.ColoringMode=b.ColoringModes.XML);const e=[x.NoteEnum.C,x.NoteEnum.D,x.NoteEnum.E,x.NoteEnum.F,x.NoteEnum.G,x.NoteEnum.A,x.NoteEnum.B];let i;if(t.coloringMode===b.ColoringModes.CustomColorSet){if(!t.coloringSetCustom||8!==t.coloringSetCustom.length)throw new Error("Invalid amount of colors: With coloringModes.customColorSet, you have to provide a coloringSetCustom parameter (array) with 8 strings (C to B, rest note).");for(const e of t.coloringSetCustom)if(!/^\#[0-9a-fA-F]{6}$/.test(e))throw new Error("One of the color strings in options.coloringSetCustom was not a valid HTML Hex color:\n"+e);i=t.coloringSetCustom}else if(t.coloringMode===b.ColoringModes.AutoColoring){i=[];const t=Object.keys(v.AutoColorSet);for(let e=0;e<t.length;e++)i.push(v.AutoColorSet[t[e]])}const s=new E.Dictionary;for(let t=0;t<e.length;t++)s.setValue(e[t],i[t]);s.setValue(-1,i.last()),this.rules.ColoringSetCurrent=s,this.rules.ColoringMode=t.coloringMode}setLogLevel(t){switch(t){case"trace":p.default.setLevel(p.default.levels.TRACE);break;case"debug":p.default.setLevel(p.default.levels.DEBUG);break;case"info":p.default.setLevel(p.default.levels.INFO);break;case"warn":p.default.setLevel(p.default.levels.WARN);break;case"error":p.default.setLevel(p.default.levels.ERROR);break;case"silent":p.default.setLevel(p.default.levels.SILENT);break;default:p.default.warn(`Could not set log level to ${t}. Using warn instead.`),p.default.setLevel(p.default.levels.WARN)}}getLogLevel(){return p.default.getLevel()}reset(){this.drawingParameters.drawCursors&&this.cursors.forEach((t=>{t.hide()})),this.sheet=void 0,this.graphic=void 0,this.zoom=1}autoResize(){const t=this;this.handleResize((()=>{}),(()=>{var e;(null===(e=this.graphic)||void 0===e?void 0:e.GetCalculator)instanceof r.VexFlowMusicSheetCalculator&&(this.graphic.GetCalculator.beamsNeedUpdate=!0),t.IsReadyToRender()&&t.render()}))}handleResize(t,e){let i,s;const n=this;function r(){n.AutoResizeEnabled&&(i=(new Date).getTime(),s||(t(),i=(new Date).getTime(),s=window.setTimeout(o,200)))}function o(){s=void 0,window.clearTimeout(s),(new Date).getTime()-i<200?s=window.setTimeout(o,200):e()}window.attachEvent?window.attachEvent("onresize",r):window.addEventListener("resize",r),this.resizeHandlerAttached=!0,window.setTimeout(t,0),window.setTimeout(e,1)}enableOrDisableCursors(t){var e,i,s,n;if(this.drawingParameters.drawCursors=t,t)for(let t=0;t<this.cursorsOptions.length;t++){const r=null===(e=this.cursors[t])||void 0===e?void 0:e.Hidden,o=null===(i=this.cursors[t])||void 0===i?void 0:i.Iterator;null===(s=this.cursors[t])||void 0===s||s.hide();let a=null===(n=this.drawer)||void 0===n?void 0:n.Backends[0];if(a&&this.rules.RestoreCursorAfterRerender&&this.cursors[t]){const e=this.cursors[t].updateCurrentPage();a=this.drawer.Backends[e-1]}a&&a.getRenderElement()&&(this.cursors[t]=new d.Cursor(a.getRenderElement(),this,this.cursorsOptions[t])),this.sheet&&this.graphic&&this.cursors[t]&&this.cursors[t].init(this.sheet.MusicPartManager,this.graphic),this.rules.RestoreCursorAfterRerender&&(this.cursors[t].hidden=r,o&&(this.cursors[t].iterator=o,this.cursors[t].update()))}else this.cursors.forEach((t=>{t.hide()}))}createBackend(t,e){let i;return i=void 0===t||t===g.BackendType.SVG?new c.SvgVexFlowBackend(this.rules):new u.CanvasVexFlowBackend(this.rules),i.graphicalMusicPage=e,i.initialize(this.container,this.zoom),i}static StringToPageFormat(t){let e=S.PageFormat.UndefinedPageFormat;if(t.match("^[0-9]+x[0-9]+$")){const i=t.split("x"),s=Number.parseInt(i[0],10),n=Number.parseInt(i[1],10);s>0&&s<32768&&n>0&&n<32768&&(e=new S.PageFormat(s,n,`customPageFormat${t}`))}return t=(t=(t=t.replace(" ","_")).replace("Landscape","L")).replace("Portrait","P"),_.PageFormatStandards.hasOwnProperty(t)?(e=_.PageFormatStandards[t],e):e}setPageFormat(t){const e=_.StringToPageFormat(t);this.needBackendUpdate=!e.Equals(this.rules.PageFormat),this.rules.PageFormat=e}setCustomPageFormat(t,e){if(t>0&&e>0){const i=new S.PageFormat(t,e);this.rules.PageFormat=i}}set DrawSkyLine(t){this.drawSkyLine=t,this.drawer&&(this.drawer.skyLineVisible=t)}get DrawSkyLine(){return this.drawer.skyLineVisible}set DrawBottomLine(t){this.drawBottomLine=t,this.drawer&&(this.drawer.bottomLineVisible=t)}get DrawBottomLine(){return this.drawer.bottomLineVisible}set DrawBoundingBox(t){this.setDrawBoundingBox(t,!0)}get DrawBoundingBox(){return this.drawBoundingBox}setDrawBoundingBox(t,e=!1){this.drawBoundingBox=t,this.drawer&&(this.drawer.drawableBoundingBoxElement=t),e&&this.render()}get AutoResizeEnabled(){return this.autoResizeEnabled}set AutoResizeEnabled(t){this.autoResizeEnabled=t}get Zoom(){return this.zoom}set Zoom(t){var e;this.zoom=t,this.zoomUpdated=!0,(null===(e=this.graphic)||void 0===e?void 0:e.GetCalculator)instanceof r.VexFlowMusicSheetCalculator&&(this.graphic.GetCalculator.beamsNeedUpdate=this.zoomUpdated)}set FollowCursor(t){this.followCursor=t}get FollowCursor(){return this.followCursor}set TransposeCalculator(t){l.MusicSheetCalculator.transposeCalculator=t}get TransposeCalculator(){return l.MusicSheetCalculator.transposeCalculator}get Sheet(){return this.sheet}get Drawer(){return this.drawer}get GraphicSheet(){return this.graphic}get DrawingParameters(){return this.drawingParameters}get EngravingRules(){return this.rules}get Version(){return this.version}}e.OpenSheetMusicDisplay=_,_.PageFormatStandards={A3_L:new S.PageFormat(420,297,"A3_L"),A3_P:new S.PageFormat(297,420,"A3_P"),A4_L:new S.PageFormat(297,210,"A4_L"),A4_P:new S.PageFormat(210,297,"A4_P"),A5_L:new S.PageFormat(210,148,"A5_L"),A5_P:new S.PageFormat(148,210,"A5_P"),A6_L:new S.PageFormat(148,105,"A6_L"),A6_P:new S.PageFormat(105,148,"A6_P"),Endless:S.PageFormat.UndefinedPageFormat,Letter_L:new S.PageFormat(279.4,215.9,"Letter_L"),Letter_P:new S.PageFormat(215.9,279.4,"Letter_P")}},2861:function(t,e,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(t,e,i,s){void 0===s&&(s=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,s,n)}:function(t,e,i,s){void 0===s&&(s=i),t[s]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||s(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(3495),e),n(i(530),e),n(i(41),e),n(i(9629),e)},8265:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TransposeCalculator=void 0;const s=i(8918);class n{transposePitch(t,e,i){let r=s.NoteEnum.C,o=0,a=s.AccidentalEnum.NONE;const l=s.Pitch.CalculateTransposedHalfTone(t,i);let h=l.halftone,c=l.overflow;for(let e=0;e<n.noteEnums.length;e++){const i=n.noteEnums[e];if(i===h){const i=e;return r=n.noteEnums[i],o=t.Octave+c,a=s.AccidentalEnum.NONE,new s.Pitch(r,o,a)}if(i>h)break}for(let i=0;i<n.noteEnums.length;i++)if(n.noteEnums[i]>h){let l=i;const u=s.Pitch.HalfTonesFromAccidental(t.Accidental);for((u>0||0===u&&e.Key>=0)&&l--;l<0;)l+=7,h+=12,c--;for(;l>=7;)l-=7,h-=12,c++;r=n.noteEnums[l],a=s.Pitch.AccidentalFromHalfTones(h-r),o=t.Octave+c;break}return new s.Pitch(r,o,a)}transposeKey(t,e){let i=0,s=0;for(;i<n.keyMapping.length&&(s=n.keyMapping[i],s!==t.keyTypeOriginal);i++);let r=i+e;for(;r>=12;)r-=12;for(;r<0;)r+=12;t.Key=n.keyMapping[r],t.isTransposedBy=e}}e.TransposeCalculator=n,n.keyMapping=[0,-5,2,-3,4,-1,6,1,-4,3,-2,5],n.noteEnums=[s.NoteEnum.C,s.NoteEnum.D,s.NoteEnum.E,s.NoteEnum.F,s.NoteEnum.G,s.NoteEnum.A,s.NoteEnum.B]},5742:function(t,e,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(t,e,i,s){void 0===s&&(s=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,s,n)}:function(t,e,i,s){void 0===s&&(s=i),t[s]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||s(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(8265),e)},8447:function(t,e,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(t,e,i,s){void 0===s&&(s=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,s,n)}:function(t,e,i,s){void 0===s&&(s=i),t[s]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||s(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(5742),e)},2337:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CollectionUtil=void 0,Array.prototype.last||Object.defineProperty(Array.prototype,"last",{enumerable:!1,writable:!0,value:function(){return this[this.length-1]}}),Array.prototype.clear||Object.defineProperty(Array.prototype,"clear",{enumerable:!1,writable:!0,value:function(){this.length=0}}),Array.prototype.contains||Object.defineProperty(Array.prototype,"contains",{enumerable:!1,writable:!0,value:function(t){return-1!==this.indexOf(t)}}),e.CollectionUtil=class{static contains2(t,e){for(let i=0;i<t.length;i++)if(t[i]===e)return!0;return!1}static last(t){return t[t.length-1]}static flat(t){return[].concat(...t)}static removeDictElementIfTrue(t,e,i){const s=[];e.forEach((function(e,n){i(t,e,n)&&s.push(e)}));for(let t=0;t<s.length;t++)e.remove(s[t])}static getLastElement(t){return t[t.length-1]}static binarySearch(t,e,i,s=0,n=t.length-1){let r=1,o=-1;for(;s<=n&&(r=Math.floor((s+n)/2),r!==o);){const a=i(t[r],e);if(0===a)return r;a<0&&(s=r+1),0<a&&(n=r),o=r}return-r}}},4242:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PSMath=void 0;class i{static log(t,e){return Math.log(e)/Math.log(t)}static log10(t){return i.log(10,t)}static meanSimple(t){let e=0;for(let i=0;i<t.length;i++)e+=t[i];return e/t.length}static meanWeighted(t,e){if(t.length!==e.length||0===t.length)return 0;let i=0,s=0;for(let n=0;n<t.length;n++){const r=e[n];i+=t[n]*r,s+=r}return i/s}}e.PSMath=i},8559:function(t,e,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(t,e,i,s){void 0===s&&(s=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,s,n)}:function(t,e,i,s){void 0===s&&(s=i),t[s]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||s(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(2337),e),n(i(4242),e)},3607:function(t,e,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(t,e,i,s){void 0===s&&(s=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,s,n)}:function(t,e,i,s){void 0===s&&(s=i),t[s]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||s(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(2861),e),n(i(4761),e),n(i(8559),e),n(i(5205),e),n(i(8447),e)},8071:function(t,e,i){"use strict";var s,n=this&&this.__extends||(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e}(i(3176).default);e.default=r},3176:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i(9205),n=i(278),r=function(){function t(t){this.root=null,this.compare=t||s.defaultCompare,this.nElements=0}return t.prototype.add=function(t){return!s.isUndefined(t)&&null!==this.insertNode(this.createNode(t))&&(this.nElements++,!0)},t.prototype.clear=function(){this.root=null,this.nElements=0},t.prototype.isEmpty=function(){return 0===this.nElements},t.prototype.size=function(){return this.nElements},t.prototype.contains=function(t){return!s.isUndefined(t)&&null!==this.searchNode(this.root,t)},t.prototype.search=function(t){var e=this.searchNode(this.root,t);if(null!==e)return e.element},t.prototype.remove=function(t){var e=this.searchNode(this.root,t);return null!==e&&(this.removeNode(e),this.nElements--,!0)},t.prototype.inorderTraversal=function(t){this.inorderTraversalAux(this.root,t,{stop:!1})},t.prototype.preorderTraversal=function(t){this.preorderTraversalAux(this.root,t,{stop:!1})},t.prototype.postorderTraversal=function(t){this.postorderTraversalAux(this.root,t,{stop:!1})},t.prototype.levelTraversal=function(t){this.levelTraversalAux(this.root,t)},t.prototype.minimum=function(){if(!this.isEmpty()&&null!==this.root)return this.minimumAux(this.root).element},t.prototype.maximum=function(){if(!this.isEmpty()&&null!==this.root)return this.maximumAux(this.root).element},t.prototype.forEach=function(t){this.inorderTraversal(t)},t.prototype.toArray=function(){var t=[];return this.inorderTraversal((function(e){return t.push(e),!0})),t},t.prototype.height=function(){return this.heightAux(this.root)},t.prototype.searchNode=function(t,e){for(var i=1;null!==t&&0!==i;)(i=this.compare(e,t.element))<0?t=t.leftCh:i>0&&(t=t.rightCh);return t},t.prototype.transplant=function(t,e){null===t.parent?this.root=e:t===t.parent.leftCh?t.parent.leftCh=e:t.parent.rightCh=e,null!==e&&(e.parent=t.parent)},t.prototype.removeNode=function(t){if(null===t.leftCh)this.transplant(t,t.rightCh);else if(null===t.rightCh)this.transplant(t,t.leftCh);else{var e=this.minimumAux(t.rightCh);e.parent!==t&&(this.transplant(e,e.rightCh),e.rightCh=t.rightCh,e.rightCh.parent=e),this.transplant(t,e),e.leftCh=t.leftCh,e.leftCh.parent=e}},t.prototype.inorderTraversalAux=function(t,e,i){null===t||i.stop||(this.inorderTraversalAux(t.leftCh,e,i),i.stop||(i.stop=!1===e(t.element),i.stop||this.inorderTraversalAux(t.rightCh,e,i)))},t.prototype.levelTraversalAux=function(t,e){var i=new n.default;for(null!==t&&i.enqueue(t),t=i.dequeue()||null;null!=t;){if(!1===e(t.element))return;null!==t.leftCh&&i.enqueue(t.leftCh),null!==t.rightCh&&i.enqueue(t.rightCh),t=i.dequeue()||null}},t.prototype.preorderTraversalAux=function(t,e,i){null===t||i.stop||(i.stop=!1===e(t.element),i.stop||(this.preorderTraversalAux(t.leftCh,e,i),i.stop||this.preorderTraversalAux(t.rightCh,e,i)))},t.prototype.postorderTraversalAux=function(t,e,i){null===t||i.stop||(this.postorderTraversalAux(t.leftCh,e,i),i.stop||(this.postorderTraversalAux(t.rightCh,e,i),i.stop||(i.stop=!1===e(t.element))))},t.prototype.minimumAux=function(t){for(;null!=t&&null!==t.leftCh;)t=t.leftCh;return t},t.prototype.maximumAux=function(t){for(;null!=t&&null!==t.rightCh;)t=t.rightCh;return t},t.prototype.heightAux=function(t){return null===t?-1:Math.max(this.heightAux(t.leftCh),this.heightAux(t.rightCh))+1},t.prototype.insertNode=function(t){for(var e=null,i=this.root;null!==i;){var s=this.compare(t.element,i.element);if(0===s)return null;s<0?(e=i,i=i.leftCh):(e=i,i=i.rightCh)}return t.parent=e,null===e?this.root=t:this.compare(t.element,e.element)<0?e.leftCh=t:e.rightCh=t,t},t.prototype.createNode=function(t){return{element:t,leftCh:null,rightCh:null,parent:null}},t}();e.default=r},2070:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i(9205),n=i(8805),r=i(7818),o=function(){function t(t){this.toStrF=t||s.defaultToString,this.dictionary=new n.default(this.toStrF),this.nElements=0}return t.prototype.add=function(t,e){if(void 0===e&&(e=1),s.isUndefined(t)||e<=0)return!1;if(this.contains(t))this.dictionary.getValue(t).copies+=e;else{var i={value:t,copies:e};this.dictionary.setValue(t,i)}return this.nElements+=e,!0},t.prototype.count=function(t){return this.contains(t)?this.dictionary.getValue(t).copies:0},t.prototype.contains=function(t){return this.dictionary.containsKey(t)},t.prototype.remove=function(t,e){if(void 0===e&&(e=1),s.isUndefined(t)||e<=0)return!1;if(this.contains(t)){var i=this.dictionary.getValue(t);return e>i.copies?this.nElements-=i.copies:this.nElements-=e,i.copies-=e,i.copies<=0&&this.dictionary.remove(t),!0}return!1},t.prototype.toArray=function(){for(var t=[],e=0,i=this.dictionary.values();e<i.length;e++)for(var s=i[e],n=s.value,r=s.copies,o=0;o<r;o++)t.push(n);return t},t.prototype.toSet=function(){for(var t=new r.default(this.toStrF),e=0,i=this.dictionary.values();e<i.length;e++){var s=i[e].value;t.add(s)}return t},t.prototype.forEach=function(t){this.dictionary.forEach((function(e,i){for(var s=i.value,n=i.copies,r=0;r<n;r++)if(!1===t(s))return!1;return!0}))},t.prototype.size=function(){return this.nElements},t.prototype.isEmpty=function(){return 0===this.nElements},t.prototype.clear=function(){this.nElements=0,this.dictionary.clear()},t}();e.default=o},8805:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i(9205),n=function(){function t(t){this.table={},this.nElements=0,this.toStr=t||s.defaultToString}return t.prototype.getValue=function(t){var e=this.table["$"+this.toStr(t)];if(!s.isUndefined(e))return e.value},t.prototype.setValue=function(t,e){if(!s.isUndefined(t)&&!s.isUndefined(e)){var i,n="$"+this.toStr(t),r=this.table[n];return s.isUndefined(r)?(this.nElements++,i=void 0):i=r.value,this.table[n]={key:t,value:e},i}},t.prototype.remove=function(t){var e="$"+this.toStr(t),i=this.table[e];if(!s.isUndefined(i))return delete this.table[e],this.nElements--,i.value},t.prototype.keys=function(){var t=[];for(var e in this.table)if(s.has(this.table,e)){var i=this.table[e];t.push(i.key)}return t},t.prototype.values=function(){var t=[];for(var e in this.table)if(s.has(this.table,e)){var i=this.table[e];t.push(i.value)}return t},t.prototype.forEach=function(t){for(var e in this.table)if(s.has(this.table,e)){var i=this.table[e];if(!1===t(i.key,i.value))return}},t.prototype.containsKey=function(t){return!s.isUndefined(this.getValue(t))},t.prototype.clear=function(){this.table={},this.nElements=0},t.prototype.size=function(){return this.nElements},t.prototype.isEmpty=function(){return this.nElements<=0},t.prototype.toString=function(){var t="{";return this.forEach((function(e,i){t+="\n\t"+e+" : "+i})),t+"\n}"},t}();e.default=n},2734:function(t,e,i){"use strict";var s,n=this&&this.__extends||(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(8805),o=i(9205),a=function(t){function e(e,i){var s=t.call(this,i)||this;return s.defaultFactoryFunction=e,s}return n(e,t),e.prototype.setDefault=function(e,i){var s=t.prototype.getValue.call(this,e);return o.isUndefined(s)?(this.setValue(e,i),i):s},e.prototype.getValue=function(t){return this.setDefault(t,this.defaultFactoryFunction())},e}(r.default);e.default=a},2422:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i(9205),n=i(1229),r=function(){function t(t){this.data=[],this.compare=t||s.defaultCompare}return t.prototype.leftChildIndex=function(t){return 2*t+1},t.prototype.rightChildIndex=function(t){return 2*t+2},t.prototype.parentIndex=function(t){return Math.floor((t-1)/2)},t.prototype.minIndex=function(t,e){return e>=this.data.length?t>=this.data.length?-1:t:this.compare(this.data[t],this.data[e])<=0?t:e},t.prototype.siftUp=function(t){for(var e=this.parentIndex(t);t>0&&this.compare(this.data[e],this.data[t])>0;)n.swap(this.data,e,t),t=e,e=this.parentIndex(t)},t.prototype.siftDown=function(t){for(var e=this.minIndex(this.leftChildIndex(t),this.rightChildIndex(t));e>=0&&this.compare(this.data[t],this.data[e])>0;)n.swap(this.data,e,t),t=e,e=this.minIndex(this.leftChildIndex(t),this.rightChildIndex(t))},t.prototype.peek=function(){return this.data.length>0?this.data[0]:void 0},t.prototype.add=function(t){return!s.isUndefined(t)&&(this.data.push(t),this.siftUp(this.data.length-1),!0)},t.prototype.removeRoot=function(){if(this.data.length>0){var t=this.data[0];return this.data[0]=this.data[this.data.length-1],this.data.splice(this.data.length-1,1),this.data.length>0&&this.siftDown(0),t}},t.prototype.contains=function(t){var e=s.compareToEquals(this.compare);return n.contains(this.data,t,e)},t.prototype.size=function(){return this.data.length},t.prototype.isEmpty=function(){return this.data.length<=0},t.prototype.clear=function(){this.data.length=0},t.prototype.forEach=function(t){n.forEach(this.data,t)},t}();e.default=r},3272:function(t,e,i){"use strict";var s,n=this&&this.__extends||(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(8805),o=i(9205),a=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.unlink=function(){this.prev.next=this.next,this.next.prev=this.prev},t}(),l=function(){function t(){this.key=null,this.value=null}return t.prototype.unlink=function(){this.prev.next=this.next,this.next.prev=this.prev},t}(),h=function(t){function e(e){var i=t.call(this,e)||this;return i.head=new l,i.tail=new l,i.head.next=i.tail,i.tail.prev=i.head,i}return n(e,t),e.prototype.appendToTail=function(t){var e=this.tail.prev;e.next=t,t.prev=e,t.next=this.tail,this.tail.prev=t},e.prototype.getLinkedDictionaryPair=function(t){if(!o.isUndefined(t)){var e="$"+this.toStr(t);return this.table[e]}},e.prototype.getValue=function(t){var e=this.getLinkedDictionaryPair(t);if(!o.isUndefined(e))return e.value},e.prototype.remove=function(e){var i=this.getLinkedDictionaryPair(e);if(!o.isUndefined(i))return t.prototype.remove.call(this,e),i.unlink(),i.value},e.prototype.clear=function(){t.prototype.clear.call(this),this.head.next=this.tail,this.tail.prev=this.head},e.prototype.replace=function(t,e){var i="$"+this.toStr(e.key);e.next=t.next,e.prev=t.prev,this.remove(t.key),e.prev.next=e,e.next.prev=e,this.table[i]=e,++this.nElements},e.prototype.setValue=function(t,e){if(!o.isUndefined(t)&&!o.isUndefined(e)){var i=this.getLinkedDictionaryPair(t),s=new a(t,e),n="$"+this.toStr(t);return o.isUndefined(i)?(this.appendToTail(s),this.table[n]=s,void++this.nElements):(this.replace(i,s),i.value)}},e.prototype.keys=function(){var t=[];return this.forEach((function(e,i){t.push(e)})),t},e.prototype.values=function(){var t=[];return this.forEach((function(e,i){t.push(i)})),t},e.prototype.forEach=function(t){for(var e=this.head.next;e.next;){if(!1===t(e.key,e.value))return;e=e.next}},e}(r.default);e.default=h},5456:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i(9205),n=i(1229),r=function(){function t(){this.firstNode=null,this.lastNode=null,this.nElements=0}return t.prototype.add=function(t,e){if(s.isUndefined(e)&&(e=this.nElements),e<0||e>this.nElements||s.isUndefined(t))return!1;var i=this.createNode(t);if(0===this.nElements||null===this.lastNode)this.firstNode=i,this.lastNode=i;else if(e===this.nElements)this.lastNode.next=i,this.lastNode=i;else if(0===e)i.next=this.firstNode,this.firstNode=i;else{var n=this.nodeAtIndex(e-1);if(null===n)return!1;i.next=n.next,n.next=i}return this.nElements++,!0},t.prototype.first=function(){if(null!==this.firstNode)return this.firstNode.element},t.prototype.last=function(){if(null!==this.lastNode)return this.lastNode.element},t.prototype.elementAtIndex=function(t){var e=this.nodeAtIndex(t);if(null!==e)return e.element},t.prototype.indexOf=function(t,e){var i=e||s.defaultEquals;if(s.isUndefined(t))return-1;for(var n=this.firstNode,r=0;null!==n;){if(i(n.element,t))return r;r++,n=n.next}return-1},t.prototype.contains=function(t,e){return this.indexOf(t,e)>=0},t.prototype.remove=function(t,e){var i=e||s.defaultEquals;if(this.nElements<1||s.isUndefined(t))return!1;for(var n=null,r=this.firstNode;null!==r;){if(i(r.element,t))return null===n?(this.firstNode=r.next,r===this.lastNode&&(this.lastNode=null)):r===this.lastNode?(this.lastNode=n,n.next=r.next,r.next=null):(n.next=r.next,r.next=null),this.nElements--,!0;n=r,r=r.next}return!1},t.prototype.clear=function(){this.firstNode=null,this.lastNode=null,this.nElements=0},t.prototype.equals=function(e,i){var n=i||s.defaultEquals;return e instanceof t&&this.size()===e.size()&&this.equalsAux(this.firstNode,e.firstNode,n)},t.prototype.equalsAux=function(t,e,i){for(;null!==t&&null!==e;){if(!i(t.element,e.element))return!1;t=t.next,e=e.next}return!0},t.prototype.removeElementAtIndex=function(t){if(!(t<0||t>=this.nElements||null===this.firstNode||null===this.lastNode)){var e;if(1===this.nElements)e=this.firstNode.element,this.firstNode=null,this.lastNode=null;else{var i=this.nodeAtIndex(t-1);null===i?(e=this.firstNode.element,this.firstNode=this.firstNode.next):i.next===this.lastNode&&(e=this.lastNode.element,this.lastNode=i),null!==i&&null!==i.next&&(e=i.next.element,i.next=i.next.next)}return this.nElements--,e}},t.prototype.forEach=function(t){for(var e=this.firstNode;null!==e&&!1!==t(e.element);)e=e.next},t.prototype.reverse=function(){for(var t=null,e=this.firstNode,i=null;null!==e;)i=e.next,e.next=t,t=e,e=i;i=this.firstNode,this.firstNode=this.lastNode,this.lastNode=i},t.prototype.toArray=function(){for(var t=[],e=this.firstNode;null!==e;)t.push(e.element),e=e.next;return t},t.prototype.size=function(){return this.nElements},t.prototype.isEmpty=function(){return this.nElements<=0},t.prototype.toString=function(){return n.toString(this.toArray())},t.prototype.nodeAtIndex=function(t){if(t<0||t>=this.nElements)return null;if(t===this.nElements-1)return this.lastNode;for(var e=this.firstNode,i=0;i<t&&null!==e;i++)e=e.next;return e},t.prototype.createNode=function(t){return{element:t,next:null}},t}();e.default=r},6072:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i(9205),n=i(8805),r=i(1229),o=function(){function t(t,e,i){void 0===i&&(i=!1),this.dict=new n.default(t),this.equalsF=e||s.defaultEquals,this.allowDuplicate=i}return t.prototype.getValue=function(t){var e=this.dict.getValue(t);return s.isUndefined(e)?[]:r.copy(e)},t.prototype.setValue=function(t,e){if(s.isUndefined(t)||s.isUndefined(e))return!1;var i=this.dict.getValue(t);return s.isUndefined(i)?(this.dict.setValue(t,[e]),!0):!(!this.allowDuplicate&&r.contains(i,e,this.equalsF)||(i.push(e),0))},t.prototype.remove=function(t,e){if(s.isUndefined(e)){var i=this.dict.remove(t);return!s.isUndefined(i)}var n=this.dict.getValue(t);return!(s.isUndefined(n)||!r.remove(n,e,this.equalsF)||(0===n.length&&this.dict.remove(t),0))},t.prototype.keys=function(){return this.dict.keys()},t.prototype.values=function(){for(var t=[],e=0,i=this.dict.values();e<i.length;e++)for(var s=0,n=i[e];s<n.length;s++){var r=n[s];t.push(r)}return t},t.prototype.containsKey=function(t){return this.dict.containsKey(t)},t.prototype.clear=function(){this.dict.clear()},t.prototype.size=function(){return this.dict.size()},t.prototype.isEmpty=function(){return this.dict.isEmpty()},t}();e.default=o},1489:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.BEFORE=0]="BEFORE",t[t.AFTER=1]="AFTER",t[t.INSIDE_AT_END=2]="INSIDE_AT_END",t[t.INSIDE_AT_START=3]="INSIDE_AT_START"}(i||(i={}));var s=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.rootIds=t,this.nodes=e,this.initRootIds(),this.initNodes()}return t.prototype.initRootIds=function(){for(var t=0,e=this.rootIds;t<e.length;t++){var i=e[t];this.createEmptyNodeIfNotExist(i)}},t.prototype.initNodes=function(){for(var t in this.nodes)if(this.nodes.hasOwnProperty(t))for(var e=0,i=this.nodes[t];e<i.length;e++){var s=i[e];this.createEmptyNodeIfNotExist(s)}},t.prototype.createEmptyNodeIfNotExist=function(t){this.nodes[t]||(this.nodes[t]=[])},t.prototype.getRootIds=function(){return this.rootIds.slice()},t.prototype.getNodes=function(){var t={};for(var e in this.nodes)this.nodes.hasOwnProperty(e)&&(t[e]=this.nodes[e].slice());return t},t.prototype.getObject=function(){return{rootIds:this.getRootIds(),nodes:this.getNodes()}},t.prototype.toObject=function(){return this.getObject()},t.prototype.flatten=function(){for(var t=this,e=[],i=0;i<this.rootIds.length;i++){var s=this.rootIds[i];e.push({id:s,level:0,hasParent:!1,childrenCount:0}),l(s,this.nodes,e,0)}for(var n=0,r=e;n<r.length;n++){var o=r[n];o.childrenCount=(a=o.id,t.nodes[a]?t.nodes[a].length:0)}var a;return e;function l(t,e,i,s){if(void 0===s&&(s=0),t&&e&&i&&e[t]){s++;for(var n=e[t],r=0;r<n.length;r++){var o=n[r];i.push({id:o,level:s,hasParent:!0}),l(o,e,i,s)}s--}}},t.prototype.moveIdBeforeId=function(t,e){return this.moveId(t,e,i.BEFORE)},t.prototype.moveIdAfterId=function(t,e){return this.moveId(t,e,i.AFTER)},t.prototype.moveIdIntoId=function(t,e,s){return void 0===s&&(s=!0),s?this.moveId(t,e,i.INSIDE_AT_START):this.moveId(t,e,i.INSIDE_AT_END)},t.prototype.swapRootIdWithRootId=function(t,e){var i=this.findRootId(t),s=this.findRootId(e);this.swapRootPositionWithRootPosition(i,s)},t.prototype.swapRootPositionWithRootPosition=function(t,e){var i=this.rootIds[e];this.rootIds[e]=this.rootIds[t],this.rootIds[t]=i},t.prototype.deleteId=function(t){this.rootDeleteId(t),this.nodeAndSubNodesDelete(t),this.nodeRefrencesDelete(t)},t.prototype.insertIdBeforeId=function(t,e){var i=this.findRootId(t);for(var s in i>-1&&this.insertIdIntoRoot(e,i),this.nodes)if(this.nodes.hasOwnProperty(s)){var n=this.findNodeId(s,t);n>-1&&this.insertIdIntoNode(s,e,n)}},t.prototype.insertIdAfterId=function(t,e){var i=this.findRootId(t);for(var s in i>-1&&this.insertIdIntoRoot(e,i+1),this.nodes)if(this.nodes.hasOwnProperty(s)){var n=this.findNodeId(s,t);n>-1&&this.insertIdIntoNode(s,e,n+1)}},t.prototype.insertIdIntoId=function(t,e){this.nodeInsertAtEnd(t,e),this.nodes[e]=[]},t.prototype.insertIdIntoRoot=function(t,e){if(void 0===e)this.rootInsertAtEnd(t);else if(e<0){var i=this.rootIds.length;this.rootIds.splice(e+i+1,0,t)}else this.rootIds.splice(e,0,t);this.nodes[t]=this.nodes[t]||[]},t.prototype.insertIdIntoNode=function(t,e,i){if(this.nodes[t]=this.nodes[t]||[],this.nodes[e]=this.nodes[e]||[],void 0===i)this.nodeInsertAtEnd(t,e);else if(i<0){var s=this.nodes[t].length;this.nodes[t].splice(i+s+1,0,e)}else this.nodes[t].splice(i,0,e)},t.prototype.moveId=function(t,e,s){var n=t,r=this.findRootId(n);for(var o in this.nodes[e],this.nodes)if(this.nodes.hasOwnProperty(o)){this.findNodeId(o,e);break}var a=e,l=this.findRootId(a);for(var o in this.nodes[e],this.nodes)if(this.nodes.hasOwnProperty(o)){this.findNodeId(o,e);break}if(r>-1){if(l>-1)switch(this.rootDelete(r),l>r&&l--,s){case i.BEFORE:this.insertIdIntoRoot(n,l);break;case i.AFTER:this.insertIdIntoRoot(n,l+1);break;case i.INSIDE_AT_START:this.nodeInsertAtStart(a,n);break;case i.INSIDE_AT_END:this.nodeInsertAtEnd(a,n)}else for(var o in this.rootDelete(r),this.nodes)if(this.nodes.hasOwnProperty(o)&&(h=this.findNodeId(o,a))>-1){switch(s){case i.BEFORE:this.insertIdIntoNode(o,n,h);break;case i.AFTER:this.insertIdIntoNode(o,n,h+1);break;case i.INSIDE_AT_START:this.nodeInsertAtStart(a,n);break;case i.INSIDE_AT_END:this.nodeInsertAtEnd(a,n)}break}}else if(l>-1){for(var o in this.nodes)if(this.nodes.hasOwnProperty(o)&&(h=this.findNodeId(o,n))>-1){this.nodeDeleteAtIndex(o,h);break}switch(s){case i.BEFORE:this.insertIdIntoRoot(n,l);break;case i.AFTER:this.insertIdIntoRoot(n,l+1);break;case i.INSIDE_AT_START:this.nodeInsertAtStart(a,n);break;case i.INSIDE_AT_END:this.nodeInsertAtEnd(a,n)}}else{for(var o in this.nodes)if(this.nodes.hasOwnProperty(o)&&(h=this.findNodeId(o,n))>-1){this.nodeDeleteAtIndex(o,h);break}for(var o in this.nodes){var h;if(this.nodes.hasOwnProperty(o)&&(h=this.findNodeId(o,a))>-1){switch(s){case i.BEFORE:this.insertIdIntoNode(o,n,h);break;case i.AFTER:this.insertIdIntoNode(o,n,h+1);break;case i.INSIDE_AT_START:this.nodeInsertAtStart(a,n);break;case i.INSIDE_AT_END:this.nodeInsertAtEnd(a,n)}break}}}},t.prototype.swapArrayElements=function(t,e,i){var s=t[e];return t[e]=t[i],t[i]=s,t},t.prototype.rootDeleteId=function(t){var e=this.findRootId(t);e>-1&&this.rootDelete(e)},t.prototype.nodeAndSubNodesDelete=function(t){for(var e=[],i=0;i<this.nodes[t].length;i++){var s=this.nodes[t][i];this.nodeAndSubNodesDelete(s),e.push(t)}for(this.nodeDelete(t),i=0;i<e.length;i++)this.nodeDelete(e[i])},t.prototype.nodeRefrencesDelete=function(t){for(var e in this.nodes)if(this.nodes.hasOwnProperty(e))for(var i=0;i<this.nodes[e].length;i++)this.nodes[e][i]===t&&this.nodeDeleteAtIndex(e,i)},t.prototype.nodeDelete=function(t){delete this.nodes[t]},t.prototype.findRootId=function(t){return this.rootIds.indexOf(t)},t.prototype.findNodeId=function(t,e){return this.nodes[t].indexOf(e)},t.prototype.findNode=function(t){return this.nodes[t]},t.prototype.nodeInsertAtStart=function(t,e){this.nodes[t].unshift(e)},t.prototype.nodeInsertAtEnd=function(t,e){this.nodes[t].push(e)},t.prototype.rootDelete=function(t){this.rootIds.splice(t,1)},t.prototype.nodeDeleteAtIndex=function(t,e){this.nodes[t].splice(e,1)},t.prototype.rootInsertAtStart=function(t){this.rootIds.unshift(t)},t.prototype.rootInsertAtEnd=function(t){this.rootIds.push(t)},t}();e.default=s},5994:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i(9205),n=i(2422),r=function(){function t(t){this.heap=new n.default(s.reverseCompareFunction(t))}return t.prototype.enqueue=function(t){return this.heap.add(t)},t.prototype.add=function(t){return this.heap.add(t)},t.prototype.dequeue=function(){if(0!==this.heap.size()){var t=this.heap.peek();return this.heap.removeRoot(),t}},t.prototype.peek=function(){return this.heap.peek()},t.prototype.contains=function(t){return this.heap.contains(t)},t.prototype.isEmpty=function(){return this.heap.isEmpty()},t.prototype.size=function(){return this.heap.size()},t.prototype.clear=function(){this.heap.clear()},t.prototype.forEach=function(t){this.heap.forEach(t)},t}();e.default=r},278:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i(5456),n=function(){function t(){this.list=new s.default}return t.prototype.enqueue=function(t){return this.list.add(t)},t.prototype.add=function(t){return this.list.add(t)},t.prototype.dequeue=function(){if(0!==this.list.size()){var t=this.list.first();return this.list.removeElementAtIndex(0),t}},t.prototype.peek=function(){if(0!==this.list.size())return this.list.first()},t.prototype.size=function(){return this.list.size()},t.prototype.contains=function(t,e){return this.list.contains(t,e)},t.prototype.isEmpty=function(){return this.list.size()<=0},t.prototype.clear=function(){this.list.clear()},t.prototype.forEach=function(t){this.list.forEach(t)},t}();e.default=n},7818:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i(9205),n=i(1229),r=i(8805),o=function(){function t(t){this.dictionary=new r.default(t)}return t.prototype.contains=function(t){return this.dictionary.containsKey(t)},t.prototype.add=function(t){return!this.contains(t)&&!s.isUndefined(t)&&(this.dictionary.setValue(t,t),!0)},t.prototype.intersection=function(t){var e=this;this.forEach((function(i){return t.contains(i)||e.remove(i),!0}))},t.prototype.union=function(t){var e=this;t.forEach((function(t){return e.add(t),!0}))},t.prototype.difference=function(t){var e=this;t.forEach((function(t){return e.remove(t),!0}))},t.prototype.isSubsetOf=function(t){if(this.size()>t.size())return!1;var e=!0;return this.forEach((function(i){return!!t.contains(i)||(e=!1,!1)})),e},t.prototype.remove=function(t){return!!this.contains(t)&&(this.dictionary.remove(t),!0)},t.prototype.forEach=function(t){this.dictionary.forEach((function(e,i){return t(i)}))},t.prototype.toArray=function(){return this.dictionary.values()},t.prototype.isEmpty=function(){return this.dictionary.isEmpty()},t.prototype.size=function(){return this.dictionary.size()},t.prototype.clear=function(){this.dictionary.clear()},t.prototype.toString=function(){return n.toString(this.toArray())},t}();e.default=o},5669:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i(5456),n=function(){function t(){this.list=new s.default}return t.prototype.push=function(t){return this.list.add(t,0)},t.prototype.add=function(t){return this.list.add(t,0)},t.prototype.pop=function(){return this.list.removeElementAtIndex(0)},t.prototype.peek=function(){return this.list.first()},t.prototype.size=function(){return this.list.size()},t.prototype.contains=function(t,e){return this.list.contains(t,e)},t.prototype.isEmpty=function(){return this.list.isEmpty()},t.prototype.clear=function(){this.list.clear()},t.prototype.forEach=function(t){this.list.forEach(t)},t}();e.default=n},1229:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i(9205);function n(t,e,i){for(var n=i||s.defaultEquals,r=t.length,o=0;o<r;o++)if(n(t[o],e))return o;return-1}e.indexOf=n,e.lastIndexOf=function(t,e,i){for(var n=i||s.defaultEquals,r=t.length-1;r>=0;r--)if(n(t[r],e))return r;return-1},e.contains=function(t,e,i){return n(t,e,i)>=0},e.remove=function(t,e,i){var s=n(t,e,i);return!(s<0||(t.splice(s,1),0))},e.frequency=function(t,e,i){for(var n=i||s.defaultEquals,r=t.length,o=0,a=0;a<r;a++)n(t[a],e)&&o++;return o},e.equals=function(t,e,i){var n=i||s.defaultEquals;if(t.length!==e.length)return!1;for(var r=t.length,o=0;o<r;o++)if(!n(t[o],e[o]))return!1;return!0},e.copy=function(t){return t.concat()},e.swap=function(t,e,i){if(e<0||e>=t.length||i<0||i>=t.length)return!1;var s=t[e];return t[e]=t[i],t[i]=s,!0},e.toString=function(t){return"["+t.toString()+"]"},e.forEach=function(t,e){for(var i=0,s=t;i<s.length;i++)if(!1===e(s[i]))return}},1649:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i(1229);e.arrays=s;var n=i(2070);e.Bag=n.default;var r=i(8071);e.BSTree=r.default;var o=i(3176);e.BSTreeKV=o.default;var a=i(8805);e.Dictionary=a.default;var l=i(2422);e.Heap=l.default;var h=i(3272);e.LinkedDictionary=h.default;var c=i(5456);e.LinkedList=c.default;var u=i(6072);e.MultiDictionary=u.default;var d=i(2734);e.FactoryDictionary=d.default;var f=i(2734);e.DefaultDictionary=f.default;var m=i(278);e.Queue=m.default;var p=i(5994);e.PriorityQueue=p.default;var b=i(7818);e.Set=b.default;var g=i(5669);e.Stack=g.default;var S=i(1489);e.MultiRootTree=S.default;var y=i(9205);e.util=y},9205:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.prototype.hasOwnProperty;function s(t){return"function"==typeof t}function n(t){return void 0===t}function r(t){return"[object String]"===Object.prototype.toString.call(t)}e.has=function(t,e){return i.call(t,e)},e.defaultCompare=function(t,e){return t<e?-1:t===e?0:1},e.defaultEquals=function(t,e){return t===e},e.defaultToString=function(t){return null===t?"COLLECTION_NULL":n(t)?"COLLECTION_UNDEFINED":r(t)?"$s"+t:"$o"+t.toString()},e.makeString=function(t,i){if(void 0===i&&(i=","),null===t)return"COLLECTION_NULL";if(n(t))return"COLLECTION_UNDEFINED";if(r(t))return t.toString();var s="{",o=!0;for(var a in t)e.has(t,a)&&(o?o=!1:s+=i,s=s+a+":"+t[a]);return s+"}"},e.isFunction=s,e.isUndefined=n,e.isString=r,e.reverseCompareFunction=function(t){return n(t)||!s(t)?function(t,e){return t<e?1:t===e?0:-1}:function(e,i){return-1*t(e,i)}},e.compareToEquals=function(t){return function(e,i){return 0===t(e,i)}}},6368:(t,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>ue});const s=()=>{};s.L=(t,e)=>{if(!e)return;const i=Array.prototype.slice.call(e).join(" ");window.console.log(t+": "+i)},s.MakeException=t=>class extends Error{constructor(e,i){super(e),this.name=t,this.message=e,this.data=i}},s.RERR=s.RuntimeError=class{constructor(t,e){this.code=t,this.message=e}toString(){return"[RuntimeError] "+this.code+":"+this.message}},s.Merge=(t,e)=>{for(const i in e)t[i]=e[i];return t},s.Min=Math.min,s.Max=Math.max,s.forEach=(t,e)=>{for(let i=0;i<t.length;i++)e(t[i],i)},s.RoundN=(t,e)=>t%e>=e/2?parseInt(t/e,10)*e+e:parseInt(t/e,10)*e,s.MidLine=(t,e)=>{let i=e+(t-e)/2;return i%2>0&&(i=s.RoundN(10*i,5)/10),i},s.SortAndUnique=(t,e,i)=>{if(t.length>1){const s=[];let n;t.sort(e);for(let e=0;e<t.length;++e)0!==e&&i(t[e],n)||s.push(t[e]),n=t[e];return s}return t},s.Contains=(t,e)=>{let i=t.length;for(;i--;)if(t[i]===e)return!0;return!1},s.getCanvasContext=t=>{if(!t)throw new s.RERR("BadArgument","Invalid canvas selector: "+t);const e=document.getElementById(t);if(!e||!e.getContext)throw new s.RERR("UnsupportedBrowserError","This browser does not support HTML5 Canvas");return e.getContext("2d")},s.drawDot=(t,e,i,s="#55")=>{t.save(),t.setFillStyle(s),t.beginPath(),t.arc(e,i,3,0,2*Math.PI,!0),t.closePath(),t.fill(),t.restore()},s.BM=(t,e)=>{const i=(new Date).getTime();e();const n=(new Date).getTime()-i;s.L(t+n+"ms")},s.StackTrace=()=>(new Error).stack,s.W=(...t)=>{const e=t.join(" ");window.console.log("Warning: ",e,s.StackTrace())},(s.Prefix=t=>s.Prefix.prefix+t).prefix="vf-";class n{static GCD(t,e){if("number"!=typeof t||"number"!=typeof e)throw new s.RERR("BadArgument",`Invalid numbers: ${t}, ${e}`);let i;for(;0!==e;)i=e,e=t%e,t=i;return t}static LCM(t,e){return t*e/n.GCD(t,e)}static LCMM(t){if(0===t.length)return 0;if(1===t.length)return t[0];if(2===t.length)return n.LCM(t[0],t[1]);{const e=t[0];return t.shift(),n.LCM(e,n.LCMM(t))}}constructor(t,e){this.set(t,e)}set(t,e){return this.numerator=void 0===t?1:t,this.denominator=void 0===e?1:e,this}value(){return this.numerator/this.denominator}simplify(){let t=this.numerator,e=this.denominator;const i=n.GCD(t,e);return t/=i,e/=i,e<0&&(e=-e,t=-t),this.set(t,e)}add(t,e){let i,s;t instanceof n?(i=t.numerator,s=t.denominator):(i=void 0!==t?t:0,s=void 0!==e?e:1);const r=n.LCM(this.denominator,s),o=r/this.denominator,a=r/s,l=this.numerator*o+i*a;return this.set(l,r)}subtract(t,e){let i,s;t instanceof n?(i=t.numerator,s=t.denominator):(i=void 0!==t?t:0,s=void 0!==e?e:1);const r=n.LCM(this.denominator,s),o=r/this.denominator,a=r/s,l=this.numerator*o-i*a;return this.set(l,r)}multiply(t,e){let i,s;return t instanceof n?(i=t.numerator,s=t.denominator):(i=void 0!==t?t:1,s=void 0!==e?e:1),this.set(this.numerator*i,this.denominator*s)}divide(t,e){let i,s;return t instanceof n?(i=t.numerator,s=t.denominator):(i=void 0!==t?t:1,s=void 0!==e?e:1),this.set(this.numerator*s,this.denominator*i)}equals(t){const e=n.__compareA.copy(t).simplify(),i=n.__compareB.copy(this).simplify();return e.numerator===i.numerator&&e.denominator===i.denominator}greaterThan(t){const e=n.__compareB.copy(this);return e.subtract(t),e.numerator>0}greaterThanEquals(t){const e=n.__compareB.copy(this);return e.subtract(t),e.numerator>=0}lessThan(t){return!this.greaterThanEquals(t)}lessThanEquals(t){return!this.greaterThan(t)}clone(){return new n(this.numerator,this.denominator)}copy(t){return"number"==typeof t?this.set(t||0,1):this.set(t.numerator,t.denominator)}quotient(){return Math.floor(this.numerator/this.denominator)}fraction(){return this.numerator%this.denominator}abs(){return this.denominator=Math.abs(this.denominator),this.numerator=Math.abs(this.numerator),this}toString(){return this.numerator+"/"+this.denominator}toSimplifiedString(){return n.__tmp.copy(this).simplify().toString()}toMixedString(){let t="";const e=this.quotient(),i=n.__tmp.copy(this);return e<0?i.abs().fraction():i.fraction(),0!==e?(t+=e,0!==i.numerator&&(t+=" "+i.toSimplifiedString())):t=0===i.numerator?"0":i.toSimplifiedString(),t}parse(t){const e=t.split("/"),i=parseInt(e[0],10),s=e[1]?parseInt(e[1],10):1;return this.set(i,s)}}n.__compareA=new n,n.__compareB=new n,n.__tmp=new n;const r=s.MakeException("RegistryError");function o(t,e,i,s,n){t[e][i]||(t[e][i]={}),t[e][i][s]=n}class a{static get INDEXES(){return["type"]}constructor(){this.clear()}static enableDefaultRegistry(t){a.defaultRegistry=t}static getDefaultRegistry(){return a.defaultRegistry}static disableDefaultRegistry(){a.defaultRegistry=null}clear(){return this.index={id:{},type:{},class:{}},this}updateIndex({id:t,name:e,value:i,oldValue:s}){const n=this.getElementById(t);null!==s&&this.index[e][s]&&delete this.index[e][s][t],null!==i&&o(this.index,e,i,n.getAttribute("id"),n)}register(t,e){if(!(e=e||t.getAttribute("id")))throw new r("Can't add element without `id` attribute to registry",t);return t.setAttribute("id",e),o(this.index,"id",e,e,t),a.INDEXES.forEach((i=>{this.updateIndex({id:e,name:i,value:t.getAttribute(i),oldValue:null})})),t.onRegister(this),this}getElementById(t){return this.index.id[t]?this.index.id[t][t]:null}getElementsByAttribute(t,e){const i=this.index[t];return i&&i[e]?Object.keys(i[e]).map((t=>i[e][t])):[]}getElementsByType(t){return this.getElementsByAttribute("type",t)}getElementsByClass(t){return this.getElementsByAttribute("class",t)}onUpdate({id:t,name:e,value:i,oldValue:s}){return function(t,e){return t.filter((t=>t===e)).length>0}(a.INDEXES.concat(["id","class"]),e)?(this.updateIndex({id:t,name:e,value:i,oldValue:s}),this):this}}a.defaultRegistry=null;class l{static newID(){return"auto"+l.ID++}constructor({type:t}={}){this.attrs={id:l.newID(),el:null,type:t||"Base",classes:{}},this.boundingBox=null,this.context=null,this.rendered=!1,a.getDefaultRegistry()&&a.getDefaultRegistry().register(this)}setStyle(t){return this.style=t,this}getStyle(){return this.style}applyStyle(t=this.context,e=this.getStyle()){return e?(t.save(),e.shadowColor&&t.setShadowColor(e.shadowColor),e.shadowBlur&&t.setShadowBlur(e.shadowBlur),e.fillStyle&&t.setFillStyle(e.fillStyle),e.strokeStyle&&t.setStrokeStyle(e.strokeStyle),e.lineWidth&&t.setLineWidth(e.lineWidth),this):this}restoreStyle(t=this.context,e=this.getStyle()){return e?(t.restore(),this):this}drawWithStyle(){this.checkContext(),this.applyStyle(),this.draw(),this.restoreStyle()}hasClass(t){return!0===this.attrs.classes[t]}addClass(t){return this.attrs.classes[t]=!0,this.registry&&this.registry.onUpdate({id:this.getAttribute("id"),name:"class",value:t,oldValue:null}),this}removeClass(t){return delete this.attrs.classes[t],this.registry&&this.registry.onUpdate({id:this.getAttribute("id"),name:"class",value:null,oldValue:t}),this}onRegister(t){return this.registry=t,this}isRendered(){return this.rendered}setRendered(t=!0){return this.rendered=t,this}getAttributes(){return this.attrs}getAttribute(t){return this.attrs[t]}setAttribute(t,e){const i=this.attrs.id,s=this.attrs[t];return this.attrs[t]=e,this.registry&&this.registry.onUpdate({id:i,name:t,value:e,oldValue:s}),this}getContext(){return this.context}setContext(t){return this.context=t,this}getBoundingBox(){return this.boundingBox}checkContext(){if(!this.context)throw new s.RERR("NoContext","No rendering context attached to instance");return this.context}}l.ID=1e3;class h{constructor(t,e,i,s){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN,this.addPoint(t,e),this.addPoint(i,s)}width(){return this.x2-this.x1}height(){return this.y2-this.y1}addPoint(t,e){null!=t&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=t,this.x2=t),t<this.x1&&(this.x1=t),t>this.x2&&(this.x2=t)),null!=e&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),e<this.y1&&(this.y1=e),e>this.y2&&(this.y2=e))}addX(t){this.addPoint(t,null)}addY(t){this.addPoint(null,t)}addQuadraticCurve(t,e,i,s,n,r){const o=t+2/3*(i-t),a=e+2/3*(s-e),l=o+1/3*(n-t),h=a+1/3*(r-e);this.addBezierCurve(t,e,o,a,l,h,n,r)}addBezierCurve(t,e,i,s,n,r,o,a){const l=[t,e],h=[i,s],c=[n,r],u=[o,a];let d;this.addPoint(l[0],l[1]),this.addPoint(u[0],u[1]);const f=(t,e)=>Math.pow(1-t,3)*l[e]+3*Math.pow(1-t,2)*t*h[e]+3*(1-t)*Math.pow(t,2)*c[e]+Math.pow(t,3)*u[e];for(d=0;d<=1;d++){const t=6*l[d]-12*h[d]+6*c[d],e=-3*l[d]+9*h[d]-9*c[d]+3*u[d],i=3*h[d]-3*l[d];if(0===e){if(0===t)continue;const e=-i/t;0<e&&e<1&&(0===d&&this.addX(f(e,d)),1===d&&this.addY(f(e,d)));continue}const s=Math.pow(t,2)-4*i*e;if(s<0)continue;const n=(-t+Math.sqrt(s))/(2*e);0<n&&n<1&&(0===d&&this.addX(f(n,d)),1===d&&this.addY(f(n,d)));const r=(-t-Math.sqrt(s))/(2*e);0<r&&r<1&&(0===d&&this.addX(f(r,d)),1===d&&this.addY(f(r,d)))}}}class c{static copy(t){return new c(t.x,t.y,t.w,t.h)}constructor(t,e,i,s){this.x=t,this.y=e,this.w=i,this.h=s}getX(){return this.x}getY(){return this.y}getW(){return this.w}getH(){return this.h}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setW(t){return this.w=t,this}setH(t){return this.h=t,this}move(t,e){this.x+=t,this.y+=e}clone(){return c.copy(this)}mergeWith(t,e){const i=t,s=this.x<i.x?this.x:i.x,n=this.y<i.y?this.y:i.y,r=Math.max(this.x+this.w,i.x+i.w)-s,o=Math.max(this.y+this.h,i.y+i.h)-n;return this.x=s,this.y=n,this.w=r,this.h=o,e&&this.draw(e),this}draw(t,e,i){e||(e=0),i||(i=0),t.rect(this.x+e,this.y+i,this.w,this.h),t.stroke()}}const u={glyphs:{v0:{x_min:0,x_max:514.5,ha:525,o:"m 236 648 b 246 648 238 648 242 648 b 288 646 261 648 283 648 b 472 513 364 634 428 587 b 514 347 502 464 514 413 b 462 163 514 272 499 217 b 257 44 409 83 333 44 b 50 163 181 44 103 83 b 0 347 14 217 0 272 b 40 513 0 413 12 464 b 236 648 87 591 155 638 m 277 614 b 253 616 273 616 261 616 b 242 616 247 616 243 616 b 170 499 193 609 181 589 b 159 348 163 446 159 398 b 166 222 159 308 161 266 b 201 91 174 138 183 106 b 257 76 215 81 235 76 b 311 91 277 76 299 81 b 347 222 330 106 338 138 b 353 348 352 266 353 308 b 344 499 353 398 351 446 b 277 614 333 587 322 606 m 257 -1 l 258 -1 l 255 -1 l 257 -1 m 257 673 l 258 673 l 255 673 l 257 673 "},v1:{x_min:-1.359375,x_max:344.359375,ha:351,o:"m 126 637 l 129 638 l 198 638 l 266 638 l 269 635 b 274 631 272 634 273 632 l 277 627 l 277 395 b 279 156 277 230 277 161 b 329 88 281 123 295 106 b 344 69 341 81 344 79 b 337 55 344 62 343 59 l 333 54 l 197 54 l 61 54 l 58 55 b 50 69 53 59 50 62 b 65 88 50 79 53 81 b 80 97 72 91 74 93 b 117 156 103 113 112 129 b 117 345 117 161 117 222 l 117 528 l 100 503 l 38 406 b 14 383 24 384 23 383 b -1 398 5 383 -1 390 b 4 415 -1 403 1 409 b 16 437 5 416 10 426 l 72 539 l 100 596 b 121 632 119 631 119 631 b 126 637 122 634 125 635 m 171 -1 l 172 -1 l 170 -1 l 171 -1 m 171 673 l 172 673 l 170 673 l 171 673 "},v2:{x_min:-1.359375,x_max:458.6875,ha:468,o:"m 197 648 b 216 648 201 648 208 648 b 258 646 232 648 253 648 b 419 546 333 637 393 599 b 432 489 428 528 432 509 b 356 342 432 440 405 384 b 235 278 322 313 288 295 b 69 170 166 256 107 217 b 69 169 69 170 69 169 b 69 169 69 169 69 169 b 74 173 69 169 72 170 b 209 222 112 204 163 222 b 310 195 247 222 274 215 b 371 179 332 184 352 179 b 396 181 379 179 387 179 b 428 202 409 184 423 194 b 442 212 431 209 436 212 b 458 197 450 212 458 206 b 441 148 458 190 449 165 b 299 44 409 84 353 44 b 288 45 295 44 292 44 b 250 61 274 45 268 49 b 122 99 212 86 164 99 b 73 91 104 99 88 97 b 28 63 53 84 34 72 b 14 54 25 56 20 54 b 1 62 9 54 4 56 l -1 65 l -1 79 b 0 99 -1 91 0 95 b 2 113 1 102 2 108 b 164 309 20 197 81 272 b 285 470 232 341 277 398 b 287 487 287 476 287 481 b 171 595 287 551 239 595 b 155 595 166 595 160 595 b 142 592 145 594 142 594 b 145 589 142 592 142 591 b 179 527 168 576 179 551 b 132 455 179 496 163 467 b 104 451 122 452 112 451 b 27 530 62 451 27 487 b 29 555 27 538 27 546 b 197 648 44 601 115 639 m 228 -1 l 230 -1 l 227 -1 l 228 -1 m 228 673 l 230 673 l 227 673 l 228 673 "},v3:{x_min:-1.359375,x_max:409.6875,ha:418,o:"m 174 648 b 191 648 176 648 183 648 b 225 648 204 648 220 648 b 402 523 317 638 389 588 b 404 503 404 517 404 510 b 402 484 404 495 404 488 b 264 373 389 437 334 394 b 257 370 259 371 257 371 b 257 370 257 370 257 370 b 264 369 258 370 261 369 b 409 202 359 334 409 267 b 318 72 409 152 381 104 b 200 43 281 52 240 43 b 23 113 134 43 69 68 b 0 169 6 129 0 149 b 77 249 0 210 29 249 l 77 249 b 152 174 125 249 152 212 b 103 102 152 145 137 116 b 103 102 103 102 103 102 b 147 94 103 101 132 95 b 153 94 149 94 151 94 b 265 206 219 94 265 141 b 264 226 265 213 265 219 b 147 355 253 299 204 353 b 126 371 133 356 126 362 b 147 388 126 383 132 388 b 254 474 196 391 238 424 b 259 502 258 484 259 494 b 182 592 259 544 228 582 b 156 595 175 595 166 595 b 115 592 142 595 129 594 l 111 591 l 115 588 b 152 524 141 574 152 549 b 92 449 152 491 130 458 b 76 448 87 448 81 448 b -1 530 32 448 -1 488 b 20 581 -1 548 5 566 b 174 648 55 619 108 641 m 204 -1 l 205 -1 l 202 -1 l 204 -1 m 204 673 l 205 673 l 202 673 l 204 673 "},v4:{x_min:0,x_max:468.21875,ha:478,o:"m 174 637 b 232 638 175 638 189 638 b 277 638 245 638 259 638 l 378 638 l 381 635 b 389 623 386 632 389 627 b 382 609 389 617 386 613 b 366 589 381 606 372 598 l 313 528 l 245 451 l 209 410 l 155 348 l 84 267 b 59 240 72 252 59 240 b 59 240 59 240 59 240 b 151 238 59 238 68 238 l 242 238 l 242 303 b 243 371 242 369 242 370 b 289 426 245 374 254 385 l 303 441 l 317 456 l 338 483 l 360 506 l 371 520 b 386 527 375 526 381 527 b 400 519 392 527 397 524 b 401 440 401 516 401 514 b 401 377 401 423 401 402 l 401 238 l 426 238 b 453 237 449 238 450 238 b 465 217 461 234 465 226 b 460 202 465 212 464 206 b 426 197 454 197 453 197 l 401 197 l 401 180 b 451 88 402 129 412 109 b 468 69 465 81 468 79 b 461 55 468 62 466 59 l 458 54 l 321 54 l 185 54 l 182 55 b 175 69 176 59 175 62 b 191 88 175 79 176 81 b 240 180 230 109 240 129 l 240 197 l 125 197 b 73 195 104 195 87 195 b 8 197 10 195 9 197 b 0 212 2 199 0 205 b 0 212 0 212 0 212 b 20 242 0 219 0 219 b 163 610 104 344 163 492 b 174 637 163 628 166 634 m 234 -1 l 235 -1 l 232 -1 l 234 -1 m 234 673 l 235 673 l 232 673 l 234 673 "},v5:{x_min:0,x_max:409.6875,ha:418,o:"m 47 637 b 53 638 49 638 50 638 b 69 634 55 638 61 637 b 210 610 114 619 161 610 b 363 634 259 610 311 619 b 382 638 372 637 378 638 b 392 634 386 638 389 637 b 397 623 396 630 397 627 b 393 610 397 620 396 616 b 298 505 368 552 338 520 b 212 494 277 498 246 494 b 65 517 163 494 106 502 b 61 517 62 517 61 517 b 61 517 61 517 61 517 b 51 408 61 517 51 412 b 51 408 51 408 51 408 b 51 408 51 408 51 408 b 61 412 53 408 55 409 b 125 434 80 421 103 430 b 185 441 145 440 166 441 b 409 244 310 441 409 353 b 401 191 409 227 406 209 b 197 43 375 105 287 43 b 159 47 183 43 171 44 b 23 123 112 56 61 86 b 0 180 6 140 0 159 b 76 260 0 220 31 260 b 92 259 81 260 87 259 b 152 183 132 251 152 216 b 100 112 152 152 134 122 b 95 111 98 112 95 111 b 95 111 95 111 95 111 b 129 98 95 109 119 101 b 148 97 136 97 141 97 b 264 235 206 97 261 158 b 265 248 265 240 265 244 b 210 398 265 312 243 373 b 179 408 201 406 194 408 b 174 408 178 408 176 408 b 53 369 130 408 88 394 b 34 359 39 359 38 359 b 17 374 24 359 17 365 b 39 628 17 384 38 625 b 47 637 40 631 43 635 m 204 -1 l 205 -1 l 202 -1 l 204 -1 m 204 673 l 205 673 l 202 673 l 204 673 "},v6:{x_min:0,x_max:475.03125,ha:485,o:"m 255 648 b 274 648 259 648 266 648 b 314 646 288 648 307 648 b 450 555 374 637 438 594 b 454 530 453 546 454 538 b 375 451 454 485 416 451 b 328 467 359 451 343 455 b 300 526 310 483 300 503 b 352 598 300 557 319 589 b 356 599 355 598 356 599 b 352 602 356 599 355 601 b 288 616 330 612 308 616 b 210 584 257 616 230 605 b 164 433 189 559 174 508 b 160 374 163 415 160 381 b 160 374 160 374 160 374 b 160 374 160 374 160 374 b 168 377 160 374 164 376 b 258 395 200 390 228 395 b 366 367 294 395 328 387 b 475 223 436 333 475 283 b 472 197 475 215 473 206 b 349 65 462 141 419 95 b 259 43 317 51 288 43 b 167 69 230 43 200 52 b 4 290 80 113 20 195 b 0 349 1 309 0 328 b 20 467 0 391 6 433 b 255 648 58 563 155 637 m 269 363 b 257 363 265 363 261 363 b 210 345 236 363 220 356 b 186 226 196 324 186 272 b 187 198 186 216 186 206 b 213 95 191 151 202 112 b 257 76 221 83 238 76 b 270 77 261 76 266 76 b 321 156 299 81 310 99 b 329 229 326 183 329 206 b 321 301 329 252 326 274 b 269 363 311 342 298 359 m 236 -1 l 238 -1 l 235 -1 l 236 -1 m 236 673 l 238 673 l 235 673 l 236 673 "},v7:{x_min:0,x_max:442.359375,ha:451,o:"m 147 648 b 166 649 153 649 160 649 b 313 598 217 649 273 630 b 340 587 323 588 328 587 l 341 587 b 412 628 367 587 390 601 b 427 638 416 635 421 638 b 439 632 431 638 435 637 b 442 623 441 630 442 628 b 430 569 442 616 439 603 b 352 369 408 492 377 410 b 300 259 325 324 313 298 b 273 84 283 205 273 140 b 265 55 273 65 272 59 l 261 54 l 181 54 l 99 54 l 96 55 b 91 61 95 56 92 59 l 89 63 l 89 77 b 147 263 89 133 111 202 b 261 401 176 313 212 355 b 378 541 315 449 349 489 l 382 548 l 375 544 b 240 495 333 512 285 495 b 129 535 198 495 160 509 b 84 560 108 552 95 560 b 76 559 81 560 78 560 b 31 487 59 555 43 530 b 14 470 27 473 24 470 b 1 477 8 470 4 471 l 0 480 l 0 553 l 0 627 l 1 630 b 16 638 4 635 9 638 b 23 635 17 638 20 637 b 49 626 36 626 39 626 b 96 638 59 626 80 630 b 104 639 99 638 102 639 b 117 644 107 641 112 642 b 147 648 125 645 137 648 m 220 -1 l 221 -1 l 219 -1 l 220 -1 m 220 673 l 221 673 l 219 673 l 220 673 "},v8:{x_min:0,x_max:488.640625,ha:499,o:"m 217 648 b 245 649 225 648 235 649 b 453 516 343 649 430 595 b 458 478 455 503 458 491 b 412 370 458 440 441 398 b 411 369 412 369 411 369 b 415 365 411 367 412 367 b 488 231 462 331 488 281 b 472 165 488 208 483 186 b 243 43 434 86 338 43 b 63 104 178 43 112 62 b 0 233 20 140 0 186 b 73 365 0 283 24 331 l 77 369 l 72 374 b 29 476 42 406 29 441 b 217 648 29 557 103 635 m 258 605 b 242 606 253 605 247 606 b 157 552 198 606 157 580 b 160 541 157 548 159 544 b 319 413 176 503 242 452 l 337 403 l 338 406 b 359 476 352 428 359 452 b 258 605 359 537 318 595 m 138 326 b 130 330 134 328 130 330 b 130 330 130 330 130 330 b 107 305 127 330 112 313 b 84 231 91 281 84 256 b 243 86 84 156 151 86 b 249 87 245 86 246 87 b 347 156 303 88 347 120 b 344 172 347 162 345 167 b 156 319 325 227 257 281 b 138 326 151 322 144 324 m 243 -1 l 245 -1 l 242 -1 l 243 -1 m 243 673 l 245 673 l 242 673 l 243 673 "},v9:{x_min:0,x_max:475.03125,ha:485,o:"m 191 646 b 212 649 198 648 205 649 b 255 644 227 649 243 646 b 458 448 348 616 428 539 b 475 342 469 415 475 378 b 460 244 475 308 469 274 b 193 44 421 124 303 44 b 91 69 157 44 122 51 b 19 161 43 97 19 126 b 21 181 19 167 20 174 b 98 241 32 220 65 241 b 170 186 129 241 160 223 b 172 166 171 179 172 173 b 121 94 172 134 152 102 b 117 93 118 94 117 93 b 121 90 117 93 118 91 b 185 76 142 80 164 76 b 270 119 220 76 251 91 b 308 259 287 145 300 194 b 313 317 310 277 313 310 b 313 317 313 317 313 317 b 313 317 313 317 313 317 b 304 315 313 317 308 316 b 216 295 273 302 245 295 b 145 308 193 295 170 299 b 19 398 88 327 42 360 b 0 469 5 420 0 444 b 24 551 0 496 8 526 b 191 646 54 596 125 637 m 227 614 b 215 616 224 616 220 616 b 202 614 210 616 206 616 b 152 535 174 610 163 592 b 144 463 147 509 144 485 b 152 391 144 440 147 417 b 216 328 163 344 179 328 b 280 391 253 328 269 344 b 288 463 285 417 288 440 b 280 535 288 485 285 509 b 227 614 269 594 258 610 m 236 -1 l 238 -1 l 235 -1 l 236 -1 m 236 673 l 238 673 l 235 673 l 236 673 "},va:{x_min:-149.71875,x_max:148.359375,ha:151,o:"m -8 -1 b -1 0 -5 -1 -4 0 b 16 -11 5 0 13 -4 b 83 -186 17 -12 47 -90 l 148 -358 l 148 -363 b 127 -385 148 -376 138 -385 b 112 -378 122 -385 118 -383 b 54 -226 110 -374 114 -385 b 0 -81 24 -147 0 -81 b -55 -226 -1 -81 -25 -147 b -114 -378 -115 -385 -111 -374 b -129 -385 -119 -383 -123 -385 b -149 -363 -140 -385 -149 -376 l -149 -358 l -84 -186 b -19 -11 -49 -90 -19 -12 b -8 -1 -17 -8 -12 -4 "},vb:{x_min:0,x_max:428.75,ha:438,o:"m 262 186 b 273 186 266 186 272 186 b 274 186 273 186 274 186 b 285 186 274 186 280 186 b 428 48 375 181 428 122 b 386 -68 428 12 416 -29 b 155 -187 329 -145 236 -187 b 12 -111 92 -187 38 -162 b 0 -51 4 -91 0 -72 b 262 186 0 58 122 179 "},vc:{x_min:0,x_max:447.8125,ha:457,o:"m 0 86 l 0 173 l 223 173 l 447 173 l 447 86 l 447 0 l 223 0 l 0 0 l 0 86 "},vf:{x_min:0,x_max:370.21875,ha:378,o:"m 0 0 l 0 277 l 61 277 l 122 277 l 122 0 l 122 -278 l 61 -278 l 0 -278 l 0 0 m 246 -1 l 246 277 l 308 277 l 370 277 l 370 -1 l 370 -278 l 308 -278 l 246 -278 l 246 -1 "},v10:{x_min:0,x_max:559.421875,ha:571,o:"m 5 127 b 14 127 6 127 9 127 b 51 126 25 127 43 127 b 175 98 93 122 138 112 l 186 94 b 279 51 210 86 255 65 b 285 47 280 51 283 48 b 319 27 291 44 311 31 l 326 22 b 359 0 332 19 352 4 l 367 -6 b 371 -9 368 -6 370 -8 l 379 -15 b 387 -22 383 -18 386 -20 l 398 -30 l 411 -40 l 417 -47 l 427 -55 l 434 -61 b 441 -66 436 -62 439 -65 l 446 -72 l 453 -77 l 462 -87 b 558 -188 490 -113 549 -176 b 559 -195 559 -191 559 -194 b 548 -205 559 -201 555 -205 b 541 -204 547 -205 544 -205 b 534 -198 539 -201 536 -199 l 525 -191 b 481 -162 518 -187 490 -167 b 472 -155 477 -159 472 -156 b 468 -152 470 -155 469 -154 b 461 -149 466 -152 464 -151 b 428 -130 454 -145 441 -137 b 371 -99 413 -122 372 -99 b 363 -95 371 -99 367 -98 b 353 -91 357 -94 353 -91 b 348 -90 353 -91 352 -91 b 332 -81 343 -87 341 -86 b 27 -12 230 -37 127 -13 b 0 -5 4 -11 2 -11 b 0 58 0 -2 0 27 b 0 122 0 88 0 120 b 5 127 1 124 4 126 "},v11:{x_min:-155.171875,x_max:153.8125,ha:157,o:"m -137 353 b -130 353 -136 353 -133 353 b -112 349 -125 353 -119 352 b -100 342 -110 347 -104 344 b 0 317 -69 326 -35 317 b 111 349 38 317 76 328 b 129 353 117 352 123 353 b 153 327 142 353 153 344 b 144 302 153 320 153 317 b 27 6 93 226 50 113 b 21 -13 24 -11 24 -11 b 0 -26 17 -22 8 -26 b -24 -12 -9 -26 -19 -22 b -28 5 -24 -9 -27 -2 b -145 302 -53 117 -95 224 b -155 327 -155 317 -155 320 b -137 353 -155 340 -148 349 "},v18:{x_min:0,x_max:323.9375,ha:331,o:"m 217 535 b 225 537 220 537 221 537 b 245 524 235 537 242 533 l 246 521 l 247 390 l 247 258 l 273 265 b 306 270 288 269 299 270 b 322 259 315 270 319 267 b 323 208 323 256 323 233 b 322 158 323 184 323 159 b 288 140 318 148 315 147 b 247 130 254 131 247 130 b 247 65 247 130 247 104 b 247 20 247 51 247 36 l 247 -88 l 273 -81 b 306 -76 289 -77 299 -76 b 318 -81 311 -76 315 -77 b 323 -123 323 -87 323 -86 l 323 -138 l 323 -154 b 318 -195 323 -191 323 -190 b 269 -210 314 -199 315 -199 b 249 -216 259 -213 250 -216 l 247 -216 l 247 -349 l 246 -483 l 245 -487 b 225 -499 242 -495 234 -499 b 206 -487 219 -499 210 -495 l 205 -483 l 205 -355 l 205 -227 l 204 -227 l 181 -233 l 138 -244 b 117 -249 127 -247 117 -249 b 115 -385 115 -249 115 -256 l 115 -523 l 114 -526 b 95 -538 110 -534 102 -538 b 74 -526 87 -538 78 -534 l 73 -523 l 73 -391 b 72 -260 73 -269 73 -260 b 72 -260 72 -260 72 -260 b 19 -273 61 -263 23 -273 b 0 -260 10 -273 4 -267 b 0 -209 0 -256 0 -256 l 0 -162 l 1 -158 b 61 -134 5 -148 5 -148 l 73 -131 l 73 -22 b 72 86 73 79 73 86 b 72 86 72 86 72 86 b 19 74 61 83 23 74 b 0 86 10 74 4 79 b 0 137 0 90 0 90 l 0 184 l 1 188 b 61 212 5 198 5 198 l 73 215 l 73 348 l 73 481 l 74 485 b 95 498 78 492 87 498 b 103 495 98 498 100 496 b 114 485 107 494 111 489 l 115 481 l 115 353 l 115 226 l 121 226 b 159 235 123 227 141 231 l 198 247 l 205 248 l 205 384 l 205 521 l 206 524 b 217 535 209 528 212 533 m 205 9 b 205 119 205 70 205 119 l 205 119 b 182 113 204 119 194 116 l 138 102 b 117 97 127 99 117 97 b 115 -12 115 97 115 91 l 115 -122 l 121 -120 b 159 -111 123 -119 141 -115 l 198 -101 l 205 -98 l 205 9 "},v1b:{x_min:0,x_max:559.421875,ha:571,o:"m 544 204 b 548 204 545 204 547 204 b 559 194 555 204 559 199 b 559 190 559 192 559 191 b 530 156 559 188 556 184 b 462 86 510 134 481 104 b 453 76 458 81 454 77 l 446 70 l 441 65 b 434 59 439 63 436 61 l 427 54 b 409 37 426 51 416 44 b 392 23 398 29 394 26 b 387 19 389 22 387 20 b 379 13 386 19 383 16 l 371 8 l 367 5 l 359 -1 l 337 -16 b 285 -48 319 -29 298 -41 l 279 -52 b 186 -95 255 -66 210 -87 l 175 -99 b 23 -129 127 -117 68 -129 b 17 -129 20 -129 19 -129 b 1 -123 2 -129 2 -129 b 0 -49 0 -122 0 -83 b 0 4 0 -22 0 1 b 27 11 2 9 4 9 b 185 31 78 12 145 20 b 198 34 186 31 193 33 b 314 73 234 44 277 58 b 349 88 328 79 340 84 b 353 90 352 90 353 90 b 363 94 353 90 357 93 b 371 98 367 97 371 98 b 428 129 372 98 413 120 b 461 148 441 136 454 144 b 468 151 464 149 466 151 b 472 154 469 152 470 154 b 481 161 473 155 477 158 b 525 190 490 166 518 186 l 534 197 b 540 201 536 198 539 199 b 544 204 541 202 544 204 "},v1d:{x_min:0,x_max:619.3125,ha:632,o:"m 274 184 b 307 186 285 186 296 186 b 616 22 465 186 597 116 b 619 -1 617 13 619 5 b 308 -187 619 -104 483 -187 b 0 -1 133 -187 0 -102 b 5 36 0 11 1 23 b 274 184 29 115 141 176 m 289 161 b 272 162 284 162 277 162 b 171 41 209 162 171 108 b 205 -73 171 5 182 -34 b 345 -163 243 -133 298 -163 b 436 -98 385 -163 420 -142 b 446 -43 443 -80 446 -62 b 289 161 446 47 377 147 "},v1e:{x_min:-402.890625,x_max:401.53125,ha:410,o:"m -219 173 b -213 174 -217 174 -215 174 b -202 173 -209 174 -205 173 b -114 86 -200 172 -179 151 b -28 0 -66 37 -28 0 b 40 84 -28 0 2 37 b 117 174 111 173 110 172 b 122 174 118 174 119 174 b 132 173 125 174 129 173 b 295 11 134 172 171 134 l 307 -1 l 336 34 b 374 76 366 72 368 74 b 381 77 375 77 378 77 b 401 56 392 77 401 68 b 400 48 401 54 401 51 b 223 -172 397 41 230 -166 b 210 -176 220 -174 215 -176 b 201 -174 206 -176 204 -176 b 112 -87 198 -173 178 -152 b 27 0 65 -38 27 0 b -42 -86 27 0 -4 -38 b -118 -174 -112 -174 -111 -173 b -123 -176 -119 -176 -121 -176 b -133 -174 -126 -176 -130 -174 b -296 -12 -136 -173 -172 -137 l -308 0 l -337 -34 b -375 -77 -367 -73 -370 -76 b -382 -79 -377 -79 -379 -79 b -402 -58 -393 -79 -402 -69 b -401 -49 -402 -55 -402 -52 b -224 172 -398 -43 -228 167 b -219 173 -223 172 -220 173 "},v1f:{x_min:-340.28125,x_max:338.921875,ha:346,o:"m -32 520 b -29 521 -31 520 -31 521 b -23 519 -27 521 -24 520 b -20 513 -21 517 -20 516 b -21 506 -20 512 -20 509 b -31 474 -23 502 -27 488 l -53 402 l -66 352 l -68 349 l -57 349 b -32 351 -51 349 -40 351 b 123 370 19 352 74 359 b 137 371 127 370 133 371 b 170 356 152 371 164 366 b 171 355 170 355 170 355 b 216 366 174 355 183 358 b 280 378 268 377 266 377 b 287 378 283 378 284 378 b 332 349 307 378 322 369 b 338 319 336 341 338 330 b 332 301 338 310 336 302 b 242 280 329 299 246 280 b 242 280 242 280 242 280 b 235 288 236 280 235 283 b 235 292 235 290 235 291 b 236 302 236 297 236 299 b 220 337 236 316 230 330 l 216 340 l 210 335 b 159 276 189 322 172 301 b 118 149 152 265 156 274 b 81 34 84 36 85 36 b -8 13 78 33 -4 13 b -8 13 -8 13 -8 13 b -14 20 -12 15 -14 15 b -8 44 -14 24 -12 31 b -2 66 -5 55 -2 65 b -2 66 -2 66 -2 66 l -2 66 b -43 41 -2 66 -21 55 b -114 4 -98 8 -98 8 b -144 0 -123 0 -134 0 b -242 99 -197 0 -242 43 b -242 109 -242 102 -242 105 b -212 219 -240 122 -242 116 b -185 312 -197 270 -185 312 l -185 312 b -189 312 -185 312 -186 312 b -259 312 -200 312 -227 312 b -321 310 -291 312 -310 310 b -334 312 -330 310 -334 312 b -340 319 -338 313 -340 316 b -336 326 -340 322 -338 324 b -291 337 -334 326 -314 331 l -247 347 l -210 348 b -172 348 -190 348 -172 348 b -168 363 -172 348 -171 355 b -145 442 -151 424 -145 441 b -133 452 -144 444 -140 446 l -77 489 b -32 520 -53 506 -32 520 m 57 334 b 53 335 55 335 54 335 b 44 334 50 335 49 335 b -70 316 8 326 -28 320 b -78 309 -78 316 -78 316 b -108 202 -80 305 -88 274 b -141 81 -136 112 -141 93 b -140 74 -141 79 -141 77 b -117 49 -137 59 -127 49 b -107 52 -114 49 -110 51 b 16 127 -106 54 14 126 b 42 217 16 127 42 215 b 49 241 42 222 44 229 b 73 320 53 251 73 317 b 57 334 73 327 65 333 "},v20:{x_min:-571.671875,x_max:570.3125,ha:582,o:"m -559 351 b -551 352 -556 352 -553 352 b -530 338 -543 352 -533 348 b -529 169 -530 337 -529 291 l -529 1 l -507 27 l -441 112 b -382 174 -394 169 -390 174 b -378 174 -381 174 -379 174 b -281 86 -370 174 -375 179 b -196 0 -234 37 -196 0 b -126 84 -196 0 -164 37 b -50 174 -55 173 -57 172 b -44 174 -49 174 -47 174 b -35 173 -42 174 -38 173 b 53 86 -32 172 -12 151 b 138 0 100 37 138 0 b 208 84 140 0 170 37 b 284 174 279 173 279 172 b 289 174 285 174 288 174 b 300 173 294 174 298 173 b 462 11 303 172 340 134 l 475 -1 l 503 34 b 541 76 534 72 536 74 b 548 77 544 77 545 77 b 570 56 560 77 570 68 b 567 48 570 54 568 51 b 392 -172 564 41 397 -166 b 378 -176 387 -174 382 -176 b 368 -174 375 -176 371 -176 b 280 -87 367 -173 347 -152 b 194 0 234 -38 194 0 b 126 -86 194 0 163 -38 b 49 -174 54 -174 55 -173 b 44 -176 47 -176 46 -176 b 34 -174 40 -176 36 -174 b -54 -87 31 -173 10 -152 b -140 0 -102 -38 -140 0 b -209 -86 -140 0 -171 -38 b -285 -174 -280 -174 -279 -173 b -291 -176 -287 -176 -288 -176 b -300 -174 -294 -176 -298 -174 b -464 -11 -303 -173 -374 -102 l -476 0 l -506 -37 b -539 -76 -528 -65 -537 -74 b -551 -80 -543 -79 -547 -80 b -570 -68 -558 -80 -566 -76 l -571 -65 l -571 136 b -570 340 -571 331 -571 337 b -559 351 -568 344 -564 348 "},v22:{x_min:0,x_max:432.828125,ha:442,o:"m 209 186 b 213 187 210 187 212 187 b 216 187 215 187 216 187 b 224 174 216 186 220 180 b 420 -1 269 105 338 43 b 432 -12 431 -8 432 -9 b 421 -23 432 -15 432 -16 b 228 -180 345 -70 264 -137 b 219 -188 221 -188 221 -188 l 219 -188 b 208 -177 215 -188 215 -188 b 10 1 163 -106 93 -44 b 0 11 0 6 0 8 b 10 22 0 13 0 15 b 202 179 87 69 167 136 b 209 186 206 183 209 186 "},v23:{x_min:0,x_max:133.390625,ha:136,o:"m 54 66 b 65 68 58 68 61 68 b 122 37 88 68 110 56 b 133 -1 130 26 133 12 b 104 -58 133 -23 123 -44 b 66 -69 92 -65 78 -69 b 10 -38 44 -69 23 -58 b 0 -1 2 -27 0 -13 b 54 66 0 30 20 61 "},v25:{x_min:0,x_max:318.5,ha:325,o:"m 20 376 b 167 377 23 377 96 377 b 296 376 231 377 294 377 b 318 347 311 371 318 359 b 296 316 318 333 311 320 b 159 315 294 315 227 315 b 21 316 91 315 24 315 b 0 345 6 320 0 333 b 20 376 0 359 6 371 "},v26:{x_min:-21.78125,x_max:483.1875,ha:493,o:"m -8 631 b -1 632 -6 632 -4 632 b 19 620 8 632 16 628 b 20 383 20 616 20 616 l 20 148 l 21 151 b 140 199 59 183 102 199 b 206 179 164 199 187 192 l 210 176 l 210 396 l 210 617 l 212 621 b 231 632 216 628 223 632 b 250 620 239 632 247 628 b 251 383 251 616 251 616 l 251 148 l 254 151 b 370 199 291 183 332 199 b 415 191 385 199 400 197 b 483 84 458 176 483 134 b 461 0 483 58 476 29 b 332 -142 439 -40 411 -72 l 255 -215 b 231 -229 240 -229 239 -229 b 216 -223 224 -229 220 -227 b 210 -158 210 -217 210 -223 b 210 -120 210 -148 210 -136 l 210 -29 l 205 -34 b 100 -142 182 -65 159 -88 l 23 -215 b -1 -229 9 -229 6 -229 b -20 -216 -9 -229 -17 -224 l -21 -212 l -21 201 l -21 616 l -20 620 b -8 631 -17 624 -13 630 m 110 131 b 96 133 106 133 100 133 b 89 133 93 133 91 133 b 24 87 63 129 40 113 l 20 80 l 20 -37 l 20 -156 l 23 -152 b 144 81 96 -72 144 20 l 144 83 b 110 131 144 113 134 126 m 341 131 b 328 133 337 133 332 133 b 322 133 326 133 323 133 b 257 87 296 129 273 113 l 251 80 l 251 -37 l 251 -156 l 255 -152 b 375 81 328 -72 375 20 l 375 83 b 341 131 375 113 367 126 "},v27:{x_min:0,x_max:432.828125,ha:442,o:"m 208 184 b 213 187 209 186 212 187 b 224 176 217 187 221 183 b 245 147 225 172 235 159 b 419 -1 288 90 347 38 b 431 -8 424 -4 431 -8 b 432 -12 432 -9 432 -11 b 430 -18 432 -13 432 -16 b 364 -61 424 -20 383 -47 b 225 -183 307 -102 250 -152 b 223 -187 224 -184 223 -187 b 220 -188 221 -188 220 -188 b 208 -176 216 -188 210 -184 b 187 -148 205 -173 197 -159 b 12 0 144 -90 84 -38 b 0 11 4 5 0 8 b 16 24 0 13 4 18 b 183 158 83 69 141 115 b 208 184 194 169 198 173 m 183 105 b 176 113 181 109 176 113 b 172 109 176 113 175 112 b 92 45 149 90 117 62 l 88 41 l 102 31 b 247 -105 160 -6 210 -55 l 254 -115 l 257 -112 l 269 -102 b 340 -45 287 -87 319 -61 l 344 -43 l 330 -33 b 183 105 272 6 221 54 "},v28:{x_min:-73.5,x_max:72.140625,ha:74,o:"m -72 252 l -73 254 l 0 254 l 72 254 l 70 252 b 0 -1 70 248 0 -1 b -72 252 -1 -1 -72 248 "},v29:{x_min:-590.71875,x_max:589.359375,ha:601,o:"m 175 273 b 182 274 178 273 181 274 b 202 262 190 274 198 269 b 204 158 204 259 204 259 l 204 56 l 250 112 b 303 174 296 172 298 172 b 308 174 304 174 307 174 b 318 173 313 174 317 173 b 481 11 322 172 357 134 l 494 -1 l 522 34 b 560 76 553 72 555 74 b 567 77 563 77 564 77 b 589 56 579 77 589 68 b 586 48 589 54 588 51 b 411 -172 583 41 416 -166 b 397 -176 406 -174 401 -176 b 387 -174 393 -176 390 -176 b 299 -87 386 -173 366 -152 b 213 0 253 -38 213 0 b 208 -6 213 0 210 -2 l 204 -12 l 204 -147 b 204 -210 204 -173 204 -194 b 198 -292 204 -297 204 -287 b 183 -299 194 -297 189 -299 b 164 -287 175 -299 167 -295 b 163 -174 163 -284 163 -284 l 161 -63 l 119 -117 b 65 -176 76 -170 73 -176 b 61 -176 63 -176 62 -176 b -35 -87 51 -174 57 -180 b -121 0 -83 -38 -121 0 b -190 -86 -122 0 -152 -38 b -266 -174 -261 -174 -259 -173 b -272 -176 -268 -176 -270 -176 b -281 -174 -276 -176 -280 -174 b -371 -86 -284 -173 -304 -152 b -457 0 -417 -38 -457 0 l -457 0 b -477 -26 -457 0 -470 -16 b -548 -227 -524 -88 -548 -161 b -536 -303 -548 -254 -544 -280 b -533 -317 -534 -309 -533 -313 b -553 -338 -533 -330 -541 -338 b -577 -315 -566 -338 -571 -333 b -590 -227 -586 -287 -590 -258 b -518 -9 -590 -154 -564 -77 b -465 56 -509 2 -504 8 l -402 134 b -363 174 -374 170 -371 174 b -359 174 -362 174 -360 174 b -262 86 -351 174 -356 179 b -176 0 -216 37 -176 0 b -107 84 -176 0 -145 37 b -31 174 -36 173 -38 172 b -25 174 -29 174 -28 174 b -16 173 -23 174 -19 173 b 147 11 -13 172 35 123 l 157 -1 l 160 1 l 163 4 l 163 130 b 164 260 163 256 163 258 b 175 273 166 266 170 270 "},v2a:{x_min:-21.78125,x_max:366.140625,ha:374,o:"m 276 1378 b 284 1379 279 1379 281 1379 b 306 1360 292 1379 298 1374 b 352 1247 326 1326 343 1286 b 366 1139 362 1213 366 1175 b 347 1009 366 1093 359 1049 l 344 1002 l 347 992 b 352 971 348 986 351 977 b 366 863 362 936 366 899 b 347 732 366 818 359 773 l 344 725 l 347 716 b 352 695 348 710 351 700 b 366 588 362 659 366 623 b 223 262 366 464 314 345 b 189 233 212 252 212 252 b 35 76 126 183 73 129 b -1 16 20 56 2 27 b -19 4 -4 9 -12 4 l -21 4 l -21 137 l -21 270 l -17 270 b 186 344 59 281 134 308 b 319 606 270 399 319 499 b 317 650 319 620 319 635 l 315 659 l 314 655 b 223 537 288 607 258 570 b 189 509 212 528 212 528 b 35 352 126 459 73 405 b -1 292 20 333 2 303 b -19 280 -4 285 -12 280 l -21 280 l -21 413 l -21 546 l -17 546 b 186 620 59 557 134 584 b 319 882 270 675 319 775 b 317 925 319 896 319 911 l 315 935 l 314 931 b 223 813 288 884 258 846 b 189 785 212 805 212 805 b 35 628 126 735 73 681 b -1 569 20 609 2 580 b -19 556 -4 562 -12 556 l -21 556 l -21 689 l -21 823 l -17 823 b 202 907 68 835 152 867 b 319 1157 280 968 319 1061 b 270 1338 319 1218 303 1281 b 262 1358 264 1349 262 1353 b 262 1364 262 1360 262 1363 b 276 1378 265 1371 269 1376 "},v2c:{x_min:-597.53125,x_max:596.171875,ha:608,o:"m -413 173 b -408 174 -412 174 -409 174 b -397 173 -404 174 -400 173 b -308 86 -394 172 -374 151 b -223 0 -261 37 -223 0 b -153 84 -223 0 -191 37 b -77 174 -83 173 -84 172 b -72 174 -76 174 -74 174 b -62 173 -68 174 -63 173 b 25 86 -59 172 -39 151 b 112 0 73 37 111 0 b 181 84 112 0 144 37 b 257 174 251 173 251 172 b 262 174 258 174 261 174 b 273 173 266 174 270 173 b 436 9 276 172 347 101 l 447 -1 l 477 36 b 522 79 511 79 513 79 l 522 79 b 552 51 533 79 539 73 b 596 -112 582 6 596 -51 b 567 -262 596 -161 586 -213 b 539 -322 558 -287 544 -316 b 524 -327 534 -326 529 -327 b 504 -315 515 -327 507 -323 b 503 -308 503 -312 503 -309 b 511 -285 503 -302 504 -297 b 555 -113 540 -227 555 -169 b 544 -34 555 -86 551 -59 b 522 19 540 -16 530 8 l 521 22 l 481 -26 l 405 -122 b 353 -176 366 -172 362 -176 b 349 -176 352 -176 351 -176 b 253 -87 341 -176 347 -180 b 167 0 206 -38 167 0 b 99 -86 167 0 136 -38 b 21 -174 27 -174 28 -173 b 17 -176 20 -176 19 -176 b 6 -174 13 -176 9 -174 b -81 -87 4 -173 -14 -152 b -167 0 -129 -38 -167 0 b -236 -86 -167 0 -198 -38 b -313 -174 -307 -174 -306 -173 b -318 -176 -314 -176 -315 -176 b -328 -174 -321 -176 -325 -174 b -491 -12 -330 -173 -367 -137 l -503 0 l -530 -34 b -570 -77 -562 -73 -564 -76 b -577 -79 -571 -79 -574 -79 b -597 -58 -588 -79 -597 -69 b -596 -49 -597 -55 -597 -52 b -417 172 -593 -43 -423 167 b -413 173 -417 172 -415 173 "},v2d:{x_min:0,x_max:438.28125,ha:447,o:"m 212 190 b 219 191 213 191 216 191 b 236 176 225 191 228 190 b 419 18 277 105 341 49 b 436 5 431 13 434 11 b 438 -1 438 4 438 1 b 424 -16 438 -8 432 -13 b 356 -49 409 -20 379 -36 b 234 -180 306 -83 258 -133 b 219 -192 230 -188 224 -192 b 200 -176 213 -192 206 -187 b 9 -15 157 -102 89 -45 b 0 0 2 -12 0 -6 b 16 18 0 9 2 12 b 200 176 93 48 159 104 b 212 190 205 186 208 188 m 239 113 b 236 117 238 116 238 117 b 230 108 235 117 234 115 b 92 -15 196 58 140 8 b 88 -18 91 -16 88 -18 b 92 -20 88 -18 91 -19 b 198 -116 130 -43 166 -74 b 200 -117 200 -117 200 -117 b 201 -117 200 -117 201 -117 b 264 -43 212 -98 242 -62 b 345 15 288 -19 321 4 b 348 18 347 16 348 16 b 344 20 348 18 347 19 b 239 113 307 41 266 79 "},v2f:{x_min:-1.359375,x_max:680.5625,ha:694,o:"m 597 1042 b 604 1042 600 1042 602 1042 b 642 1002 627 1042 642 1022 b 619 966 642 988 635 974 b 439 927 574 942 503 927 l 426 927 l 426 921 b 430 838 428 893 430 866 b 345 480 430 696 398 560 b 179 391 307 423 249 391 b 156 392 171 391 164 392 b 138 394 149 394 142 394 b 103 434 115 396 103 416 b 129 471 103 451 111 466 b 141 474 133 473 137 474 b 172 459 153 474 164 469 b 181 455 175 456 176 455 b 187 456 182 455 185 455 b 253 520 212 460 234 483 b 315 836 294 605 315 714 b 311 928 315 867 314 898 b 302 945 310 943 311 942 b 245 953 283 950 262 953 b 130 891 193 953 149 931 b 84 860 119 870 102 860 b 36 905 61 860 39 877 b 36 910 36 907 36 909 b 80 970 36 931 50 949 b 249 1017 125 1000 187 1017 b 322 1009 273 1017 299 1014 l 341 1003 b 436 991 372 995 406 991 b 577 1031 495 991 545 1004 b 597 1042 583 1038 590 1041 m 416 360 b 424 360 419 360 421 360 b 481 309 454 360 479 338 b 503 145 484 280 495 199 b 585 -185 525 16 555 -106 b 630 -245 596 -213 613 -237 l 634 -247 l 638 -245 b 647 -244 641 -245 645 -244 b 680 -278 666 -244 680 -262 b 664 -308 680 -290 675 -301 b 638 -312 658 -310 650 -312 b 613 -309 631 -312 623 -310 b 477 -201 555 -303 502 -260 b 417 -2 460 -159 434 -72 b 416 5 417 1 416 5 b 416 5 416 5 416 5 b 411 -5 415 5 413 0 b 359 -97 397 -33 377 -70 b 353 -106 355 -102 353 -105 b 359 -112 353 -108 355 -109 b 409 -130 375 -123 390 -129 b 426 -134 420 -130 421 -131 b 431 -147 428 -137 431 -141 b 420 -162 431 -152 427 -159 b 382 -169 409 -166 396 -169 b 323 -155 363 -169 341 -165 l 317 -152 l 314 -155 b 62 -303 240 -240 148 -295 b 36 -305 55 -305 44 -305 b 23 -303 29 -305 24 -305 b -1 -273 6 -299 -1 -287 b 31 -240 -1 -256 10 -240 b 36 -240 32 -240 34 -240 b 42 -241 38 -241 39 -241 b 134 -204 63 -241 99 -226 b 367 288 265 -115 357 81 b 375 330 368 313 370 320 b 416 360 383 347 400 358 m 360 -359 b 379 -359 363 -359 371 -359 b 424 -360 396 -359 416 -359 b 646 -502 536 -373 624 -430 b 649 -527 649 -510 649 -519 b 530 -673 649 -578 604 -635 l 521 -677 l 529 -681 b 653 -811 592 -714 637 -762 b 660 -853 658 -827 660 -839 b 645 -911 660 -873 656 -892 b 426 -1021 608 -981 519 -1021 b 283 -989 377 -1021 328 -1011 b 235 -949 249 -972 239 -964 b 234 -936 234 -946 234 -941 b 234 -928 234 -934 234 -931 l 235 -925 l 234 -927 l 225 -934 b 87 -982 186 -966 138 -982 b 80 -982 85 -982 83 -982 b 55 -981 70 -981 58 -981 b 17 -943 32 -981 17 -964 b 54 -904 17 -921 35 -904 b 78 -914 62 -904 72 -909 l 83 -918 l 88 -918 b 190 -831 122 -918 166 -881 b 269 -506 242 -727 269 -612 b 268 -462 269 -492 269 -477 b 266 -449 266 -458 266 -452 b 265 -444 266 -445 266 -444 b 257 -446 264 -444 261 -445 b 132 -545 196 -470 152 -505 b 88 -573 122 -563 104 -573 b 39 -523 63 -573 39 -553 b 63 -476 39 -505 44 -494 b 360 -359 136 -408 235 -369 m 419 -424 b 393 -423 411 -423 406 -423 l 375 -423 l 377 -426 b 379 -439 377 -427 378 -434 b 383 -510 382 -463 383 -487 b 314 -811 383 -609 360 -710 b 266 -893 296 -850 285 -870 b 264 -898 265 -896 264 -898 l 264 -898 b 264 -898 264 -898 264 -898 b 268 -898 264 -898 266 -898 b 273 -898 270 -898 272 -898 b 300 -909 283 -898 291 -900 b 426 -957 340 -941 385 -957 b 476 -949 443 -957 460 -954 b 547 -853 522 -931 547 -893 b 485 -745 547 -816 526 -775 b 397 -707 460 -727 432 -714 b 366 -675 375 -703 366 -692 b 396 -642 366 -657 377 -645 b 530 -557 455 -637 511 -601 b 536 -527 534 -548 536 -537 b 419 -424 536 -480 490 -437 "},v30:{x_min:-21.78125,x_max:367.5,ha:375,o:"m 276 1900 b 284 1901 279 1900 281 1901 b 306 1883 291 1901 298 1896 b 367 1686 347 1825 367 1757 b 343 1558 367 1643 359 1600 l 338 1549 l 343 1537 b 367 1411 359 1497 367 1454 b 343 1282 367 1367 359 1324 l 338 1272 l 343 1261 b 367 1135 359 1221 367 1178 b 343 1007 367 1090 359 1047 l 338 996 l 343 985 b 367 859 359 945 367 902 b 343 731 367 814 359 771 l 338 720 l 343 709 b 367 582 359 667 367 626 b 289 362 367 503 340 426 b 239 312 276 345 259 330 b 29 77 152 237 76 152 b -1 18 14 54 2 30 b -19 4 -4 11 -12 4 l -21 4 l -21 133 l -20 260 l -13 262 b 98 299 17 269 62 284 b 111 305 103 302 110 305 b 167 334 123 310 156 327 b 319 595 264 391 319 491 b 313 659 319 616 318 638 b 310 667 311 664 311 667 b 307 663 310 667 308 666 b 240 588 289 637 269 614 b 16 331 141 505 62 413 b -1 294 8 316 1 302 b -19 280 -4 287 -12 280 l -21 280 l -21 408 l -20 537 l -13 538 b 98 576 17 545 62 560 b 111 581 103 578 110 581 b 167 610 123 587 156 603 b 319 871 264 667 319 767 b 313 935 319 892 318 913 b 310 942 311 941 311 942 b 307 939 310 942 308 941 b 240 864 289 913 269 889 b 16 607 141 781 62 689 b -1 570 8 592 1 578 b -19 556 -4 563 -12 556 l -21 556 l -21 684 l -20 813 l -13 814 b 98 852 17 821 62 836 b 111 857 103 855 110 857 b 167 886 123 863 156 880 b 319 1147 264 943 319 1043 b 313 1211 319 1168 318 1189 b 310 1218 311 1217 311 1218 b 307 1215 310 1218 308 1217 b 240 1140 289 1188 269 1165 b 16 884 141 1057 62 966 b -1 846 8 868 1 855 b -19 832 -4 839 -12 832 l -21 832 l -21 960 l -20 1089 l -13 1090 b 98 1128 17 1097 62 1111 b 111 1134 103 1131 110 1134 b 167 1163 123 1139 156 1156 b 319 1424 264 1220 319 1320 b 313 1486 319 1444 318 1465 b 310 1494 311 1493 311 1494 b 307 1492 310 1494 308 1493 b 240 1417 289 1464 269 1442 b 16 1160 141 1333 62 1242 b -1 1121 8 1145 1 1131 b -19 1109 -4 1115 -12 1109 l -21 1109 l -21 1236 l -20 1365 l -13 1367 b 98 1404 17 1374 62 1388 b 111 1410 103 1407 110 1410 b 250 1508 172 1437 215 1467 b 319 1701 296 1564 319 1633 b 270 1859 319 1757 303 1814 b 262 1882 265 1868 262 1875 b 276 1900 262 1890 266 1896 "},v31:{x_min:0,x_max:386.5625,ha:394,o:"m 0 173 l 0 347 l 193 347 l 386 347 l 386 173 l 386 0 l 193 0 l 0 0 l 0 173 "},v33:{x_min:-423.3125,x_max:421.9375,ha:431,o:"m -10 276 b -2 277 -8 277 -5 277 b 17 265 5 277 13 273 b 19 163 19 260 19 260 l 19 68 l 39 45 b 277 -95 122 -34 200 -81 b 289 -97 281 -97 285 -97 b 378 0 332 -97 371 -54 b 378 11 378 4 378 6 b 302 83 378 55 345 83 b 242 66 283 83 262 77 b 208 56 231 59 219 56 b 148 120 175 56 148 81 b 200 186 148 151 164 172 b 261 198 220 194 240 198 b 420 45 341 198 411 137 b 421 22 421 37 421 29 b 257 -198 421 -86 347 -188 b 242 -198 251 -198 247 -198 b 20 -105 181 -198 95 -163 l 19 -104 l 19 -183 b 19 -216 19 -195 19 -206 b 12 -273 19 -272 17 -267 b -2 -278 8 -277 2 -278 b -21 -266 -10 -278 -19 -274 b -23 -165 -23 -263 -23 -262 l -23 -69 l -44 -47 b -250 86 -117 23 -183 66 b -295 94 -270 93 -284 94 b -315 91 -302 94 -308 94 b -381 5 -356 81 -381 43 b -355 -56 -381 -16 -372 -40 b -299 -81 -338 -73 -319 -81 b -246 -68 -283 -81 -265 -77 b -212 -58 -234 -61 -223 -58 b -168 -77 -196 -58 -179 -65 b -151 -122 -156 -90 -151 -105 b -179 -174 -151 -141 -160 -162 b -239 -195 -194 -184 -217 -192 b -257 -197 -245 -195 -250 -197 b -423 -5 -349 -197 -423 -113 b -423 0 -423 -4 -423 -1 b -277 194 -420 97 -362 173 b -247 197 -268 197 -258 197 b -24 104 -185 197 -100 162 l -23 102 l -23 181 b -21 265 -23 260 -23 260 b -10 276 -20 269 -14 274 "},v34:{x_min:0,x_max:622.03125,ha:635,o:"m 398 417 b 406 419 401 419 404 419 b 427 398 417 419 427 409 b 427 391 427 395 427 392 b 34 -274 424 385 38 -272 b 20 -280 29 -278 25 -280 b 0 -259 9 -280 0 -270 b 0 -252 0 -256 0 -254 b 393 413 2 -247 389 410 b 398 417 394 415 397 416 m 592 417 b 600 419 594 419 597 419 b 622 398 611 419 622 409 b 620 391 622 395 620 392 b 227 -274 617 385 231 -272 b 213 -280 223 -278 219 -280 b 193 -259 202 -280 193 -270 b 194 -252 193 -256 193 -254 b 586 413 196 -247 582 410 b 592 417 588 415 590 416 "},v36:{x_min:-1.359375,x_max:1064.390625,ha:1086,o:"m 296 692 b 314 694 302 694 307 694 b 386 685 337 694 366 689 b 548 498 480 660 548 580 b 548 481 548 492 548 487 b 455 395 541 426 499 395 b 370 462 420 395 383 417 b 362 496 364 477 362 488 b 377 514 362 509 367 514 b 393 501 386 514 390 510 b 432 474 397 484 413 474 b 470 487 445 474 458 478 b 491 530 484 496 491 510 b 490 544 491 534 491 539 b 333 660 479 606 411 657 l 323 662 l 315 646 b 269 524 285 591 269 556 b 321 431 269 492 287 466 b 349 395 338 413 343 408 b 363 342 359 378 363 362 b 359 312 363 333 362 322 b 285 158 348 266 318 206 b 281 152 283 155 281 152 b 281 152 281 152 281 152 b 287 154 283 152 284 152 b 318 155 298 154 308 155 b 461 98 371 155 419 136 l 464 97 l 483 112 b 503 129 494 120 503 127 b 504 130 503 129 504 129 b 503 138 504 131 503 134 b 500 180 500 152 500 166 b 553 326 500 238 518 288 b 604 366 560 331 592 358 b 649 381 617 376 632 381 b 696 362 665 381 681 374 b 724 302 714 347 724 324 b 695 238 724 278 714 255 b 660 210 691 234 662 212 b 579 148 658 209 582 151 b 579 148 579 148 579 148 b 596 106 579 144 589 119 b 622 77 604 88 609 83 b 657 69 632 72 645 69 b 748 112 688 69 721 84 b 755 123 754 117 755 120 b 755 127 755 124 755 126 b 751 165 752 137 751 151 b 758 219 751 183 754 202 b 894 387 774 290 820 347 b 896 390 896 388 896 388 b 891 398 896 391 895 392 b 622 560 827 477 730 535 b 600 580 605 564 600 569 b 617 596 600 591 607 596 b 628 595 622 596 624 596 b 1057 248 846 552 1020 412 b 1064 191 1061 229 1064 209 b 922 0 1064 94 1005 9 b 902 -1 916 -1 909 -1 b 774 76 847 -1 800 26 b 769 83 770 81 770 83 b 769 81 769 83 769 83 b 627 -1 733 29 677 -1 b 548 27 597 -1 570 8 b 515 88 537 37 525 61 l 513 95 l 510 93 l 453 45 b 390 0 396 0 396 0 b 390 0 390 0 390 0 b 374 15 381 0 377 4 b 268 105 359 69 314 105 b 250 104 262 105 257 105 l 243 102 l 234 90 b 155 1 201 49 159 2 b 147 -1 152 0 149 -1 b 130 15 138 -1 130 6 b 132 20 130 18 132 19 b 136 31 133 22 134 27 b 220 131 149 74 178 109 b 231 137 225 134 230 136 b 302 278 280 202 302 244 b 265 335 302 299 295 309 b 209 442 234 363 213 402 b 209 455 209 446 209 451 b 279 648 209 502 232 564 l 285 659 l 283 659 b 176 627 238 653 210 645 b 57 477 111 594 66 538 b 55 459 55 471 55 464 b 72 409 55 437 61 415 b 93 403 78 405 87 403 b 152 467 123 403 151 431 b 168 488 153 483 157 488 b 185 462 181 488 185 483 l 185 460 b 137 344 183 409 168 369 b 78 322 119 328 98 322 b 13 360 50 322 25 335 b -1 426 4 380 -1 402 b 89 610 -1 488 32 559 b 296 692 147 659 210 685 m 926 348 b 921 353 924 351 922 353 b 914 348 920 353 918 351 b 823 167 857 306 823 237 b 828 124 823 154 826 138 b 890 31 837 79 862 40 b 896 31 892 31 894 31 b 956 104 916 31 940 59 b 970 191 965 129 970 159 b 966 241 970 208 969 224 b 926 348 959 277 945 313 m 627 326 b 619 326 624 326 622 326 b 598 316 611 326 604 323 b 568 215 579 288 568 255 b 568 208 568 213 568 210 b 571 183 570 195 570 184 l 571 183 b 594 201 571 183 582 191 l 634 231 b 660 259 653 247 656 248 b 664 278 662 266 664 272 b 627 326 664 299 649 320 "},v38:{x_min:-1.359375,x_max:651.96875,ha:665,o:"m 389 644 b 405 645 394 645 400 645 b 504 566 450 645 492 613 b 507 541 506 557 507 549 b 480 471 507 514 498 489 l 477 467 l 483 470 b 609 591 539 485 586 531 b 613 601 611 595 613 599 b 631 609 619 607 624 609 b 651 588 641 609 651 602 b 200 -946 651 584 204 -941 b 182 -957 197 -953 190 -957 b 163 -945 174 -957 166 -953 b 161 -939 161 -942 161 -942 b 217 -743 161 -931 170 -904 b 272 -555 247 -639 272 -555 b 272 -555 272 -555 272 -555 b 264 -560 272 -555 268 -557 b 140 -603 227 -589 182 -603 b 36 -567 102 -603 65 -592 b -1 -487 12 -548 -1 -517 b 17 -427 -1 -466 5 -445 b 103 -380 38 -395 70 -380 b 191 -433 137 -380 172 -398 b 205 -484 201 -448 205 -466 b 178 -553 205 -509 196 -535 l 175 -557 l 182 -555 b 307 -435 236 -539 284 -494 b 372 -213 308 -430 372 -215 b 372 -213 372 -213 372 -213 b 364 -219 372 -213 368 -216 b 240 -262 328 -247 283 -262 b 137 -226 202 -262 166 -249 b 99 -145 112 -206 99 -176 b 118 -84 99 -124 106 -104 b 204 -38 138 -54 171 -38 b 292 -91 238 -38 273 -56 b 306 -141 302 -106 306 -124 b 279 -212 306 -167 296 -194 l 276 -215 l 281 -213 b 408 -93 336 -198 385 -151 b 473 129 409 -88 473 127 b 473 129 473 129 473 129 b 465 122 473 129 469 126 b 341 80 428 94 383 80 b 236 115 303 80 266 91 b 200 195 213 136 200 165 b 217 256 200 217 206 238 b 304 303 239 287 272 303 b 393 249 338 303 374 285 b 406 199 402 234 406 217 b 379 129 406 173 397 148 l 377 126 l 382 127 b 509 248 436 142 485 190 b 574 470 510 254 574 469 b 574 470 574 470 574 470 b 566 464 574 470 570 467 b 442 421 529 435 484 421 b 337 458 404 421 367 433 b 300 537 313 478 300 508 b 389 644 300 585 334 635 "},v39:{x_min:-171.5,x_max:251.8125,ha:257,o:"m -8 631 b -1 632 -6 632 -4 632 b 19 620 8 632 16 628 b 20 553 20 616 20 614 b 20 491 20 503 20 491 l 20 491 b 153 535 47 501 149 535 b 174 514 167 535 174 524 b 164 496 174 508 171 501 b 92 470 164 495 132 484 l 20 445 l 20 390 b 20 363 20 378 20 370 b 20 333 20 340 20 333 l 20 333 b 153 377 47 344 149 377 b 174 356 167 377 174 367 b 164 338 174 349 171 342 b 92 312 164 338 132 326 l 20 288 l 20 219 l 20 148 l 21 151 b 137 199 59 183 99 199 b 182 191 152 199 167 197 b 251 84 227 176 251 134 b 228 0 251 58 243 29 b 100 -142 206 -40 178 -72 l 23 -215 b -1 -229 9 -229 6 -229 b -20 -216 -9 -229 -17 -224 b -21 30 -21 -212 -21 -212 b -21 273 -21 163 -21 273 b -84 252 -21 273 -50 263 b -152 230 -133 234 -145 230 b -157 231 -155 230 -156 231 b -171 252 -166 234 -171 244 b -160 270 -171 259 -167 266 b -27 316 -159 270 -93 294 l -21 319 l -21 374 b -21 431 -21 406 -21 431 b -84 409 -21 431 -50 421 b -152 388 -133 392 -145 388 b -157 390 -155 388 -156 388 b -171 409 -166 392 -171 401 b -160 428 -171 417 -167 424 b -27 474 -159 428 -93 451 l -21 476 l -21 546 b -20 620 -21 614 -21 616 b -8 631 -17 624 -13 630 m 110 131 b 96 133 106 133 100 133 b 89 133 93 133 91 133 b 24 87 63 129 40 113 l 20 80 l 20 -37 l 20 -156 l 23 -152 b 144 81 96 -72 144 20 l 144 83 b 110 131 144 113 134 126 "},v3b:{x_min:0,x_max:484.5625,ha:494,o:"m 228 245 b 239 247 234 247 239 247 b 243 247 240 247 242 247 b 303 238 257 247 287 242 b 484 -2 417 208 484 104 b 412 -177 484 -65 461 -127 b 243 -248 363 -226 303 -248 b 6 -63 138 -248 36 -180 b 0 -1 1 -41 0 -20 b 228 245 0 127 98 240 m 255 181 b 240 183 247 183 245 183 b 232 181 238 183 235 183 b 142 152 200 180 168 170 l 138 149 l 190 97 l 242 44 l 294 97 l 345 149 l 340 152 b 255 181 315 169 284 180 m 147 -54 l 197 -1 l 147 51 l 95 104 l 91 99 b 62 -1 72 70 62 34 b 66 -43 62 -15 63 -29 b 91 -101 72 -63 80 -84 l 95 -106 l 147 -54 m 393 99 b 389 104 390 102 389 104 b 337 51 389 104 366 80 l 285 -1 l 337 -54 l 389 -106 l 393 -101 b 421 -1 412 -72 421 -36 b 393 99 421 34 412 69 m 294 -98 b 242 -45 265 -69 242 -45 b 190 -98 242 -45 219 -69 l 138 -151 l 142 -154 b 242 -184 172 -174 206 -184 b 340 -154 276 -184 311 -174 l 345 -151 l 294 -98 "},v3c:{x_min:0,x_max:450.53125,ha:460,o:"m 189 302 b 204 303 193 302 198 303 b 303 224 250 303 292 270 b 306 199 304 216 306 208 b 279 129 306 173 296 147 l 276 126 l 281 127 b 408 249 337 142 385 190 b 412 259 409 254 412 258 b 430 267 417 265 423 267 b 450 247 441 267 450 259 b 200 -605 450 242 204 -599 b 182 -616 197 -612 190 -616 b 163 -602 174 -616 166 -610 b 161 -598 161 -601 161 -601 b 217 -402 161 -589 170 -562 b 272 -213 247 -298 272 -213 b 272 -213 272 -213 272 -213 b 264 -219 272 -213 268 -216 b 140 -262 227 -247 182 -262 b 36 -226 102 -262 65 -249 b 0 -145 12 -206 0 -176 b 17 -84 0 -124 5 -104 b 103 -38 38 -54 70 -38 b 191 -91 137 -38 172 -56 b 205 -141 201 -106 205 -124 b 178 -212 205 -167 196 -194 l 175 -215 l 182 -213 b 307 -93 236 -198 284 -151 b 372 129 308 -88 372 127 b 372 129 372 129 372 129 b 364 122 372 129 368 126 b 240 80 328 94 283 80 b 137 115 202 80 166 91 b 99 194 111 136 99 165 b 189 302 99 244 133 292 "},v3e:{x_min:0,x_max:406.96875,ha:415,o:"m 21 183 b 28 183 24 183 25 183 b 42 181 34 183 39 183 b 127 108 47 179 47 179 b 202 41 168 72 202 41 b 279 108 204 41 238 72 b 357 177 321 145 356 176 b 375 183 363 181 370 183 b 406 151 392 183 406 169 b 404 137 406 147 405 141 b 322 62 401 131 398 129 b 251 0 284 27 251 0 b 322 -63 251 -1 284 -29 b 404 -138 398 -130 401 -133 b 406 -152 405 -142 406 -148 b 375 -184 406 -170 392 -184 b 357 -179 370 -184 363 -183 b 279 -109 356 -177 321 -147 b 202 -43 238 -73 204 -43 b 127 -109 202 -43 168 -73 b 49 -179 85 -147 50 -177 b 31 -184 43 -183 36 -184 b 0 -152 13 -184 0 -170 b 2 -138 0 -148 0 -142 b 83 -63 5 -133 8 -130 b 155 0 122 -29 155 -1 b 83 62 155 0 122 27 b 8 129 43 97 10 127 b 0 151 2 136 0 144 b 21 183 0 165 8 177 "},v3f:{x_min:-24.5,x_max:317.140625,ha:324,o:"m -24 -147 l -24 -5 l -20 -5 b -1 -19 -12 -5 -4 -11 b 58 -123 6 -43 31 -86 b 196 -278 93 -173 134 -219 b 317 -570 274 -356 317 -460 b 294 -713 317 -617 308 -666 l 289 -724 l 294 -735 b 317 -873 308 -780 317 -827 b 235 -1132 317 -963 288 -1054 b 209 -1165 228 -1140 224 -1146 b 189 -1177 204 -1172 196 -1177 b 171 -1164 182 -1177 175 -1172 b 168 -1154 170 -1161 168 -1159 b 181 -1132 168 -1149 172 -1142 b 269 -891 238 -1064 269 -975 b 269 -881 269 -886 269 -884 b 262 -814 269 -857 265 -827 b 258 -800 261 -811 259 -806 b 142 -628 240 -731 198 -667 b -8 -589 112 -606 47 -589 b -20 -589 -13 -589 -19 -589 l -24 -589 l -24 -449 l -24 -308 l -20 -308 b -1 -322 -12 -308 -4 -313 b 58 -424 6 -345 31 -388 b 194 -580 93 -476 136 -523 b 259 -660 221 -606 245 -635 b 261 -663 259 -662 261 -663 b 264 -656 262 -663 262 -660 b 269 -587 268 -632 269 -610 b 264 -521 269 -566 268 -544 b 262 -512 264 -517 262 -513 b 258 -498 261 -509 259 -503 b 142 -326 240 -428 198 -365 b -8 -287 112 -303 47 -288 b -20 -287 -13 -287 -19 -287 l -24 -287 l -24 -147 "},v40:{x_min:-1.359375,x_max:436.921875,ha:446,o:"m 213 205 b 217 205 215 205 216 205 b 234 194 224 205 234 199 b 236 187 234 194 235 190 l 245 167 l 261 129 l 270 106 b 355 -61 294 54 329 -13 b 420 -163 381 -105 402 -138 b 436 -188 435 -184 436 -184 b 436 -191 436 -190 436 -190 b 421 -206 436 -201 431 -206 l 421 -206 l 416 -206 l 405 -201 b 217 -158 347 -172 283 -158 b 31 -201 153 -158 88 -172 l 20 -206 l 14 -206 l 14 -206 b 0 -191 5 -206 0 -201 b -1 -188 0 -190 -1 -190 b 14 -163 -1 -186 0 -184 b 95 -34 36 -136 72 -77 b 166 106 119 8 148 68 l 175 129 l 183 148 l 200 188 b 213 205 205 199 208 202 "},v41:{x_min:-1.359375,x_max:556.6875,ha:568,o:"m 294 322 b 318 323 299 322 308 323 b 360 320 334 323 352 322 b 526 217 430 310 490 273 b 543 166 537 202 543 184 b 447 70 543 117 503 70 b 445 70 447 70 446 70 b 359 159 394 72 359 113 b 368 201 359 173 362 187 b 442 245 382 229 412 245 b 455 244 446 245 451 245 b 460 244 458 244 460 244 b 460 244 460 244 460 244 b 454 248 460 244 458 245 b 325 291 417 276 372 291 b 285 287 313 291 299 290 b 144 -2 183 269 144 190 b 281 -290 144 -208 179 -280 b 304 -291 289 -291 298 -291 b 524 -105 412 -291 506 -212 b 541 -84 526 -88 530 -84 b 556 -101 551 -84 556 -90 b 549 -138 556 -111 553 -122 b 334 -322 521 -237 435 -310 b 302 -324 323 -323 313 -324 b 13 -101 172 -324 54 -234 b -1 -1 4 -68 -1 -34 b 294 322 -1 161 121 303 "},v42:{x_min:-348.4375,x_max:24.5,ha:25,o:"m -330 155 b -322 156 -329 156 -326 156 b -315 156 -319 156 -317 156 b -298 147 -311 155 -308 154 b -19 30 -224 98 -122 55 l 2 26 b 24 -1 17 22 24 13 b 2 -27 24 -15 17 -23 l -19 -31 b -298 -148 -122 -56 -224 -99 b -322 -158 -313 -158 -315 -158 b -348 -131 -338 -158 -348 -145 b -344 -117 -348 -127 -347 -122 b -328 -104 -341 -112 -338 -111 b -127 -8 -269 -65 -202 -33 b -106 0 -115 -4 -106 -1 b -127 6 -106 0 -115 2 b -328 102 -202 31 -269 63 b -344 116 -338 109 -341 111 b -348 130 -347 120 -348 124 b -330 155 -348 141 -341 152 "},v43:{x_min:-442.359375,x_max:441,ha:450,o:"m -31 487 b -1 488 -21 488 -10 488 b 434 104 216 488 397 330 b 441 27 438 79 441 47 b 439 12 441 20 439 15 b 419 0 435 4 427 0 b 404 5 413 0 408 1 b 398 30 400 11 398 13 b 0 351 390 213 213 351 b -59 348 -20 351 -39 349 b -400 30 -251 324 -393 191 b -405 5 -400 13 -401 11 b -420 0 -409 1 -415 0 b -441 12 -428 0 -436 4 b -442 27 -441 15 -442 20 b -435 104 -442 47 -439 79 b -31 487 -401 316 -235 474 m -13 131 b -1 133 -9 133 -5 133 b 51 105 19 133 39 123 b 61 70 58 95 61 83 b 51 34 61 58 58 45 b -1 6 39 16 19 6 b -46 27 -17 6 -34 13 b -62 69 -57 38 -62 54 b -13 131 -62 98 -44 124 "},v44:{x_min:-21.78125,x_max:251.8125,ha:257,o:"m -8 631 b -1 632 -6 632 -4 632 b 19 620 8 632 16 628 b 20 383 20 616 20 616 l 20 148 l 21 151 b 137 199 59 183 99 199 b 182 191 152 199 167 197 b 251 84 227 176 251 134 b 228 0 251 58 243 29 b 100 -142 206 -40 178 -72 l 23 -215 b 0 -229 9 -229 6 -229 b -20 -216 -9 -229 -17 -224 l -21 -212 l -21 201 l -21 616 l -20 620 b -8 631 -17 624 -13 630 m 110 131 b 96 133 106 133 100 133 b 89 133 93 133 91 133 b 24 87 63 129 40 113 l 20 80 l 20 -37 l 20 -156 l 23 -152 b 144 81 96 -72 144 20 l 144 83 b 110 131 144 113 134 126 "},v45:{x_min:-402.890625,x_max:401.53125,ha:410,o:"m -10 273 b -4 274 -9 273 -6 274 b 16 262 4 274 12 269 b 17 158 17 259 17 259 l 17 56 l 62 112 b 117 174 110 172 110 172 b 122 174 118 174 119 174 b 132 173 125 174 129 173 b 295 11 134 172 171 134 l 307 -1 l 336 34 b 374 76 366 72 368 74 b 381 77 375 77 378 77 b 401 56 392 77 401 68 b 400 48 401 54 401 51 b 223 -172 397 41 230 -166 b 210 -176 220 -174 215 -176 b 201 -174 206 -176 204 -176 b 112 -87 198 -173 178 -152 b 27 0 65 -38 27 0 b 21 -6 27 0 24 -2 l 17 -12 l 17 -147 b 17 -210 17 -173 17 -194 b 10 -292 17 -297 16 -287 b -2 -299 6 -297 2 -299 b -21 -287 -10 -299 -19 -295 b -24 -174 -23 -284 -23 -284 l -24 -63 l -66 -117 b -121 -176 -110 -170 -114 -176 b -125 -176 -122 -176 -123 -176 b -296 -12 -134 -174 -125 -184 l -308 0 l -337 -34 b -375 -77 -367 -73 -370 -76 b -382 -79 -377 -79 -379 -79 b -402 -58 -393 -79 -402 -69 b -401 -49 -402 -55 -402 -52 b -224 170 -398 -43 -231 165 b -212 174 -221 173 -216 174 b -202 173 -208 174 -205 174 b -39 11 -200 172 -151 122 l -28 -1 l -25 1 l -24 4 l -24 130 b -23 260 -24 256 -24 258 b -10 273 -20 266 -16 270 "},v46:{x_min:0,x_max:627.46875,ha:640,o:"m 306 190 b 314 191 308 191 311 191 b 326 184 318 191 322 190 l 336 173 b 510 52 377 127 442 80 b 515 49 513 51 515 49 b 611 16 537 40 579 24 b 627 0 624 13 627 9 b 607 -18 627 -11 624 -13 b 330 -181 490 -49 389 -109 b 314 -192 323 -190 319 -192 b 306 -191 311 -192 308 -192 b 294 -177 302 -188 302 -188 b 257 -140 287 -170 265 -148 b 19 -18 193 -84 114 -44 b 0 0 2 -13 0 -11 b 16 16 0 9 2 13 b 110 49 47 24 89 40 b 117 52 111 49 114 51 b 145 65 126 56 130 58 b 281 163 200 93 245 124 b 300 186 288 170 291 174 b 306 190 300 187 303 188 m 317 137 b 313 142 315 141 314 142 b 308 137 313 142 311 141 b 161 4 276 84 220 33 b 155 0 159 1 155 0 b 163 -4 155 0 159 -2 b 308 -138 220 -34 276 -84 b 313 -142 311 -141 313 -142 b 317 -138 314 -142 315 -141 b 464 -4 351 -84 406 -34 b 470 0 468 -2 470 0 b 464 4 470 0 468 1 b 317 137 406 33 351 84 "},v47:{x_min:-24.5,x_max:315.78125,ha:322,o:"m -24 -145 l -24 -5 l -20 -5 b 1 -26 -10 -5 -6 -9 b 175 -241 31 -86 96 -166 b 314 -548 259 -323 304 -420 b 315 -589 315 -555 315 -571 b 314 -630 315 -606 315 -623 b 298 -730 311 -664 306 -699 l 295 -742 l 296 -748 b 314 -850 304 -778 311 -813 b 315 -892 315 -857 315 -874 b 314 -932 315 -909 315 -925 b 298 -1032 311 -967 306 -1002 l 295 -1045 l 296 -1050 b 314 -1153 304 -1081 311 -1115 b 315 -1193 315 -1160 315 -1177 b 314 -1235 315 -1211 315 -1228 b 217 -1526 306 -1338 270 -1444 b 201 -1533 213 -1532 208 -1533 b 182 -1522 193 -1533 185 -1529 b 179 -1514 181 -1518 179 -1517 b 189 -1489 179 -1508 182 -1501 b 266 -1217 240 -1403 266 -1308 b 262 -1156 266 -1196 265 -1177 b 110 -907 247 -1043 190 -950 b 0 -889 87 -895 50 -889 l -1 -889 l -24 -889 l -24 -749 l -24 -610 l -20 -610 b 1 -631 -10 -610 -6 -614 b 175 -846 31 -691 96 -771 b 259 -956 213 -884 236 -914 b 265 -966 262 -961 264 -966 b 265 -966 265 -966 265 -966 b 265 -953 265 -964 265 -959 b 266 -920 266 -943 266 -932 b 262 -853 266 -898 265 -873 b 110 -605 247 -741 190 -648 b 0 -587 87 -592 50 -587 l -1 -587 l -24 -587 l -24 -448 l -24 -308 l -20 -308 b 1 -328 -10 -308 -6 -312 b 175 -544 31 -388 96 -469 b 259 -655 213 -581 236 -612 b 265 -663 262 -659 264 -663 b 265 -663 265 -663 265 -663 b 265 -650 265 -663 265 -657 b 266 -617 266 -641 266 -630 b 262 -551 266 -595 265 -570 b 110 -303 247 -438 190 -345 b 0 -284 87 -290 50 -284 l -1 -284 l -24 -284 l -24 -145 "},v49:{x_min:0,x_max:630.203125,ha:643,o:"m 308 204 b 314 205 310 205 313 205 b 326 201 319 205 323 204 b 355 154 328 199 338 180 b 401 83 362 142 392 95 l 409 72 b 431 41 412 66 424 49 b 619 -174 498 -51 570 -134 b 630 -192 626 -180 630 -186 b 626 -202 630 -195 628 -199 b 616 -206 623 -205 620 -206 b 552 -188 608 -206 592 -202 b 310 -155 488 -169 392 -155 b 268 -156 295 -155 281 -155 b 77 -188 197 -161 126 -173 b 13 -206 35 -202 20 -206 b 9 -206 12 -206 10 -206 b 0 -191 2 -202 0 -197 b 8 -176 0 -186 2 -180 b 204 49 58 -136 138 -43 l 220 72 l 227 83 b 295 188 245 108 281 166 b 308 204 299 197 304 202 m 315 147 b 314 147 315 147 314 147 b 314 147 314 147 314 147 b 306 129 314 145 310 138 l 296 105 b 281 72 292 97 284 77 l 274 56 b 181 -123 247 -4 212 -72 l 174 -134 l 176 -133 b 314 -123 215 -127 272 -123 b 451 -133 356 -123 413 -127 l 454 -134 l 449 -123 b 353 56 417 -72 381 -4 l 347 72 b 332 105 344 77 336 97 l 322 129 b 315 147 318 138 315 145 "},v4a:{x_min:70.78125,x_max:378.390625,ha:315,o:"m 246 373 b 254 373 249 373 251 373 b 372 324 303 373 360 351 b 378 302 377 317 378 309 b 338 251 378 278 362 255 b 328 249 334 249 332 249 b 283 294 303 249 283 270 b 288 315 283 301 284 308 b 289 319 289 317 289 319 b 289 319 289 319 289 319 b 283 320 289 320 287 320 b 270 322 279 322 274 322 b 206 288 242 322 215 308 b 206 283 206 287 206 285 b 257 223 206 267 230 238 b 284 206 272 213 277 210 b 351 90 328 173 351 130 b 340 47 351 74 348 59 b 205 -30 314 -2 264 -30 b 182 -29 198 -30 190 -30 b 84 15 147 -24 103 -5 b 70 48 74 24 70 36 b 108 99 70 70 85 94 b 121 102 112 101 117 102 b 167 56 147 102 167 80 b 159 31 167 48 164 40 l 156 26 l 157 26 b 190 20 167 22 178 20 b 220 26 201 20 212 22 b 258 65 243 34 258 51 b 257 70 258 66 258 69 b 204 126 249 94 234 109 b 114 258 148 158 114 209 b 125 302 114 273 118 288 b 246 373 147 342 193 370 "},v4b:{x_min:0,x_max:503.609375,ha:514,o:"m 274 430 b 277 430 276 430 277 430 b 310 394 296 430 310 415 b 308 383 310 391 308 387 b 306 367 307 381 307 374 b 236 120 298 305 272 210 b 40 -273 189 -5 125 -134 b 20 -287 35 -283 27 -287 b 5 -281 14 -287 9 -285 b 0 -267 1 -277 0 -273 b 9 -242 0 -262 2 -255 b 246 395 137 -12 232 242 b 274 430 249 416 257 427 m 468 430 b 472 430 469 430 470 430 b 503 394 490 430 503 415 b 502 383 503 391 503 387 b 499 367 502 381 500 374 b 431 120 491 305 465 210 b 234 -273 382 -5 318 -134 b 213 -287 228 -283 220 -287 b 198 -281 208 -287 202 -285 b 193 -267 194 -277 193 -273 b 202 -242 193 -262 196 -255 b 439 395 330 -12 426 242 b 468 430 442 416 451 427 "},v4d:{x_min:-311.6875,x_max:310.328125,ha:317,o:"m -9 388 b -2 390 -8 390 -5 390 b 5 388 1 390 4 390 b 19 378 10 387 16 383 b 23 333 23 371 23 371 b 24 298 23 299 24 298 b 81 276 34 298 65 285 b 213 91 145 240 190 177 b 224 24 217 76 224 36 b 257 24 224 24 235 24 b 299 19 292 24 292 24 b 310 -1 306 15 310 6 b 299 -23 310 -11 306 -19 b 257 -27 292 -27 292 -27 b 224 -29 235 -27 224 -29 b 213 -95 224 -40 217 -80 b 81 -280 190 -181 145 -244 b 24 -301 65 -290 34 -301 b 23 -335 24 -301 23 -303 l 23 -340 b 17 -381 23 -374 23 -374 b -1 -391 13 -388 5 -391 b -21 -381 -9 -391 -17 -388 b -27 -340 -27 -374 -27 -374 l -27 -335 b -28 -301 -27 -303 -27 -301 b -85 -280 -38 -301 -69 -290 b -217 -95 -149 -244 -194 -181 b -228 -29 -221 -80 -228 -40 b -259 -27 -228 -29 -238 -27 b -300 -23 -294 -27 -294 -27 b -311 -2 -307 -19 -311 -11 b -294 23 -311 8 -304 19 b -259 24 -291 23 -284 24 b -228 24 -239 24 -228 24 b -217 91 -228 36 -221 76 b -85 276 -194 177 -149 240 b -28 298 -69 285 -38 298 b -27 333 -27 298 -27 299 b -27 371 -27 362 -27 369 b -9 388 -24 378 -17 385 m -27 136 b -28 247 -27 197 -28 247 b -61 216 -31 247 -53 226 b -123 33 -95 172 -121 98 l -125 24 l -76 24 l -27 24 l -27 136 m 29 242 b 24 247 27 245 24 247 b 23 136 24 247 23 197 l 23 24 l 72 24 l 121 24 l 119 33 b 29 242 115 116 77 206 m -27 -140 l -27 -27 l -76 -27 l -125 -27 l -123 -36 b -61 -220 -121 -102 -95 -176 b -28 -251 -53 -230 -31 -251 b -27 -140 -28 -251 -27 -201 m 119 -36 l 121 -27 l 72 -27 l 23 -27 l 23 -140 b 24 -251 23 -201 24 -251 b 57 -220 27 -251 49 -230 b 119 -36 91 -176 117 -102 "},v4e:{x_min:0,x_max:239.5625,ha:244,o:"m 10 460 b 20 462 13 462 14 462 b 39 449 28 462 35 458 l 40 446 l 40 326 b 40 205 40 259 40 205 b 127 227 40 205 80 215 b 220 249 196 244 213 249 b 227 247 224 249 225 248 b 238 237 231 245 235 241 l 239 233 l 239 -106 l 239 -448 l 238 -451 b 219 -463 234 -459 225 -463 b 198 -451 210 -463 202 -459 l 197 -448 l 197 -324 b 197 -201 197 -248 197 -201 b 110 -223 196 -201 157 -210 b 17 -245 42 -240 24 -245 b 10 -242 13 -245 13 -244 b 0 -233 6 -241 2 -237 l 0 -230 l 0 108 l 0 446 l 0 449 b 10 460 2 453 6 458 m 197 22 b 197 70 197 41 197 58 b 196 116 197 113 197 116 l 196 116 b 118 97 196 116 160 106 l 40 77 l 40 -18 b 40 -112 40 -69 40 -112 l 119 -93 l 197 -73 l 197 22 "},v51:{x_min:-1.359375,x_max:455.96875,ha:465,o:"m 352 541 b 357 542 353 542 355 542 b 377 530 364 542 372 537 l 378 526 l 378 394 l 379 262 l 404 266 b 436 270 420 269 430 270 b 450 265 443 270 446 269 b 455 220 455 259 455 260 l 455 208 l 455 161 l 454 156 b 411 140 449 147 447 147 b 378 133 393 137 379 134 b 378 68 378 133 378 106 b 378 22 378 54 378 38 l 379 -87 l 404 -83 b 436 -79 420 -80 430 -79 b 450 -84 443 -79 446 -80 b 455 -129 455 -90 455 -88 l 455 -141 l 455 -188 l 454 -192 b 413 -209 449 -202 447 -202 b 382 -215 398 -212 383 -215 l 378 -215 l 378 -345 l 378 -380 b 375 -485 378 -484 378 -480 b 357 -494 371 -491 364 -494 b 340 -485 351 -494 344 -491 b 336 -383 337 -480 336 -484 l 336 -349 l 336 -223 l 334 -223 b 291 -231 334 -223 314 -227 l 247 -240 l 247 -371 l 246 -503 l 245 -506 b 225 -519 242 -514 234 -519 b 206 -506 219 -519 210 -514 l 205 -503 l 205 -376 l 205 -248 l 160 -256 l 115 -265 l 115 -396 l 115 -527 l 114 -531 b 95 -544 110 -539 102 -544 b 76 -531 87 -544 78 -539 l 73 -527 l 73 -399 b 73 -273 73 -330 73 -273 b 49 -277 73 -273 61 -274 b 17 -281 32 -280 24 -281 b 4 -276 10 -281 8 -280 b -1 -234 0 -269 -1 -272 b 0 -219 -1 -229 0 -224 l 0 -170 l 1 -167 b 10 -158 2 -163 6 -159 b 49 -149 13 -156 16 -155 l 73 -145 l 73 -34 b 73 76 73 26 73 76 b 49 72 73 76 61 74 b 17 68 32 69 24 68 b 4 73 10 68 8 69 b -1 115 0 80 -1 77 b 0 130 -1 120 0 124 l 0 179 l 1 181 b 10 191 2 186 6 190 b 49 199 13 192 16 194 l 73 204 l 73 338 b 73 374 73 352 73 365 b 77 483 73 484 73 477 b 95 492 81 489 88 492 b 111 483 100 492 107 489 b 115 378 115 477 115 483 l 115 342 b 117 212 115 223 115 212 b 204 229 117 212 200 227 l 205 229 l 205 365 l 205 502 l 206 505 b 225 517 210 513 219 517 b 245 505 234 517 242 513 l 246 502 l 247 369 l 247 237 l 249 237 b 336 254 253 238 336 254 b 337 390 336 254 337 302 l 337 526 l 338 530 b 352 541 341 535 347 539 m 336 15 b 336 126 336 102 336 126 l 336 126 b 291 117 336 126 315 122 l 247 109 l 247 -1 l 247 -112 l 249 -112 b 336 -95 253 -111 336 -95 b 336 15 336 -95 336 -56 m 205 -120 b 205 -55 205 -120 205 -93 b 205 -9 205 -41 205 -24 l 205 101 l 160 93 l 115 84 l 115 -26 b 115 -83 115 -49 115 -69 b 117 -137 115 -133 115 -137 b 205 -120 118 -137 204 -120 "},v52:{x_min:-10.890625,x_max:298.078125,ha:294,o:"m 138 473 b 142 474 140 473 141 474 b 164 459 148 474 153 470 b 191 402 183 442 191 423 b 181 353 191 388 187 371 b 178 349 179 352 178 349 b 179 348 178 348 179 348 b 185 349 181 348 182 348 b 255 376 210 355 234 363 b 272 381 264 381 266 381 b 298 355 287 381 298 370 b 288 330 298 348 298 345 b 171 34 238 254 194 141 b 166 13 168 16 168 16 b 144 1 161 5 152 1 b 121 15 134 1 125 5 b 115 33 119 18 117 24 b 0 330 91 145 49 252 b -10 355 -9 345 -10 348 b 13 381 -10 371 0 381 b 31 376 19 381 25 380 b 132 345 61 358 103 345 l 136 345 l 137 355 b 145 378 138 359 142 370 b 152 415 149 394 152 405 b 137 452 152 427 148 438 b 133 464 134 458 133 460 b 138 473 133 467 134 470 "},v53:{x_min:0,x_max:902.421875,ha:921,o:"m 17 240 b 24 241 19 241 21 241 b 32 240 28 241 31 241 b 46 229 38 238 43 234 b 50 88 50 223 50 237 b 50 -1 50 63 50 34 b 50 -90 50 -36 50 -65 b 46 -231 50 -238 50 -224 b 25 -242 42 -238 34 -242 b 0 -224 14 -242 4 -235 b 0 2 0 -222 0 -108 b 0 223 0 112 0 220 b 17 240 2 230 9 237 m 110 240 b 118 241 111 241 114 241 b 126 240 121 241 123 241 b 142 223 133 237 140 230 b 144 123 144 220 144 205 b 144 29 144 45 144 29 b 144 29 144 29 144 29 b 393 183 166 106 264 167 b 450 186 412 184 431 186 b 756 29 600 186 732 120 b 756 29 756 29 756 29 b 758 123 758 29 758 45 b 760 227 758 226 758 223 b 784 241 766 237 774 241 b 804 229 792 241 800 237 b 809 88 808 223 809 237 l 809 -1 l 809 -90 b 804 -231 809 -238 808 -224 b 784 -242 800 -238 792 -242 b 762 -231 775 -242 766 -238 b 758 -124 756 -224 758 -231 b 756 -30 758 -47 758 -30 b 756 -30 756 -30 756 -30 b 509 -184 736 -108 637 -169 b 450 -187 488 -187 469 -187 b 144 -30 300 -187 168 -122 b 144 -30 144 -30 144 -30 b 144 -124 144 -30 144 -47 b 140 -231 144 -231 144 -224 b 118 -242 134 -238 126 -242 b 92 -224 107 -242 96 -235 b 92 2 92 -222 92 -108 b 92 223 92 112 92 220 b 110 240 95 230 102 237 m 432 161 b 413 162 426 162 420 162 b 313 41 351 162 313 109 b 347 -73 313 5 323 -34 b 487 -163 385 -133 439 -163 b 578 -97 526 -163 562 -142 b 588 -43 585 -80 588 -62 b 432 161 588 47 518 147 m 868 240 b 876 241 869 241 872 241 b 884 240 879 241 882 241 b 898 229 890 238 894 234 b 902 88 902 223 902 237 l 902 -1 l 902 -90 b 898 -231 902 -238 902 -224 b 876 -242 892 -238 884 -242 b 852 -224 865 -242 854 -235 b 850 2 850 -222 850 -108 b 852 223 850 112 850 220 b 868 240 853 230 860 237 "},v54:{x_min:-24.5,x_max:317.140625,ha:324,o:"m -24 -161 l -24 -5 l -20 -5 b 0 -24 -9 -5 -2 -12 b 171 -315 21 -124 84 -233 b 317 -660 268 -406 317 -531 b 187 -1014 317 -782 274 -909 b 161 -1034 172 -1034 171 -1034 b 141 -1013 149 -1034 141 -1025 b 152 -991 141 -1004 142 -1002 b 266 -682 228 -899 266 -788 b 174 -430 266 -588 236 -498 b -23 -317 136 -388 66 -348 b -24 -161 -23 -316 -24 -285 "},v55:{x_min:0,x_max:551.25,ha:563,o:"m 289 644 b 304 645 294 645 299 645 b 404 566 349 645 392 613 b 406 541 405 557 406 549 b 379 471 406 514 397 489 l 377 467 l 382 470 b 509 591 438 485 485 531 b 513 601 510 595 513 599 b 530 609 518 607 524 609 b 551 588 540 609 551 602 b 200 -605 551 584 204 -599 b 182 -616 197 -612 190 -616 b 163 -602 174 -616 166 -610 b 161 -598 161 -601 161 -601 b 217 -402 161 -589 170 -562 b 272 -213 247 -298 272 -213 b 272 -213 272 -213 272 -213 b 264 -219 272 -213 268 -216 b 140 -262 227 -247 182 -262 b 36 -226 102 -262 65 -249 b 0 -145 12 -206 0 -176 b 17 -84 0 -124 5 -104 b 103 -38 38 -54 70 -38 b 191 -91 137 -38 172 -56 b 205 -141 201 -106 205 -124 b 178 -212 205 -167 196 -194 l 175 -215 l 182 -213 b 307 -93 236 -198 284 -151 b 372 129 308 -88 372 127 b 372 129 372 129 372 129 b 364 122 372 129 368 126 b 240 80 328 94 283 80 b 137 115 202 80 166 91 b 99 195 112 136 99 165 b 118 256 99 217 106 238 b 204 303 138 287 171 303 b 292 249 238 303 273 285 b 306 199 302 234 306 217 b 279 129 306 173 296 148 l 276 126 l 281 127 b 408 248 336 142 385 190 b 473 470 409 254 473 469 b 473 470 473 470 473 470 b 465 464 473 470 469 467 b 341 421 428 435 383 421 b 236 458 303 421 266 433 b 200 537 212 478 200 508 b 289 644 200 585 234 635 "},v58:{x_min:-21.78125,x_max:367.5,ha:375,o:"m 259 1553 b 265 1553 261 1553 264 1553 b 288 1540 272 1553 277 1550 b 367 1351 340 1493 367 1424 b 336 1221 367 1308 357 1263 l 332 1211 l 333 1208 b 367 1077 356 1170 367 1124 b 336 945 367 1032 357 986 l 332 935 l 333 932 b 367 800 356 893 367 848 b 336 669 367 756 357 710 l 332 659 l 333 656 b 367 523 356 617 367 571 b 345 412 367 485 360 446 b 231 273 322 356 284 310 b -1 19 121 195 27 93 b -17 4 -4 11 -10 5 l -21 4 l -21 134 l -21 265 l -17 265 b 133 291 20 265 96 278 b 318 537 245 328 318 433 b 307 603 318 559 315 582 b 303 614 304 612 304 614 b 298 609 302 614 300 613 b 231 549 281 589 258 567 b -1 295 121 471 27 369 b -17 280 -4 287 -10 281 l -21 280 l -21 410 l -21 541 l -17 541 b 133 567 20 541 96 555 b 318 813 245 605 318 709 b 307 880 318 835 315 859 b 303 891 304 888 304 891 b 298 885 302 891 300 888 b 231 825 281 866 258 843 b -1 571 121 748 27 645 b -17 556 -4 563 -10 557 l -21 556 l -21 687 l -21 817 l -17 817 b 133 843 20 817 96 830 b 318 1089 245 881 318 985 b 307 1156 318 1111 315 1134 b 303 1167 304 1164 304 1167 b 298 1161 302 1167 300 1164 b 231 1102 281 1140 258 1120 b -1 848 121 1024 27 921 b -17 832 -4 839 -10 834 l -21 832 l -21 963 l -21 1093 l -17 1093 b 114 1113 12 1093 78 1103 b 313 1314 215 1142 289 1218 b 318 1364 317 1331 318 1347 b 255 1511 318 1422 295 1478 b 243 1532 247 1519 243 1525 b 259 1553 243 1540 250 1550 "},v59:{x_min:0,x_max:464.140625,ha:474,o:"m 0 0 l 0 347 l 76 347 l 153 347 l 153 0 l 153 -348 l 76 -348 l 0 -348 l 0 0 m 308 -1 l 308 347 l 386 347 l 464 347 l 464 -1 l 464 -348 l 386 -348 l 308 -348 l 308 -1 "},v5a:{x_min:-171.5,x_max:170.140625,ha:174,o:"m -6 566 b 0 567 -5 567 -2 567 b 14 556 6 567 12 563 b 92 285 14 555 50 433 b 170 13 166 33 170 19 b 168 13 170 13 170 13 b 161 1 168 8 167 4 l 159 0 l 122 0 l 84 0 l 81 1 b 21 195 76 5 78 -5 b -32 381 -8 297 -32 381 b -87 197 -32 381 -57 298 b -141 8 -115 94 -140 9 b -155 0 -142 2 -149 0 b -171 15 -163 0 -171 5 b -14 556 -171 18 -24 528 b -6 566 -14 560 -10 564 "},v5b:{x_min:-441,x_max:439.640625,ha:449,o:"m -428 -2 b -421 0 -427 -1 -424 0 b -406 -6 -416 0 -409 -2 b -400 -31 -401 -12 -400 -15 b -1 -352 -392 -215 -215 -352 b 58 -349 19 -352 38 -351 b 398 -31 250 -326 392 -192 b 404 -6 398 -15 400 -12 b 419 -1 408 -2 413 -1 b 439 -13 427 -1 435 -5 b 439 -29 439 -16 439 -22 b 434 -105 439 -48 438 -80 b 0 -489 397 -333 213 -489 b -68 -484 -23 -489 -44 -488 b -441 -36 -280 -452 -436 -263 b -441 -30 -441 -34 -441 -31 b -428 -2 -441 -11 -439 -5 m -13 -9 b -1 -8 -9 -8 -5 -8 b 50 -36 19 -8 39 -19 b 61 -72 57 -47 61 -59 b 50 -106 61 -84 57 -97 b -1 -134 39 -124 19 -134 b -46 -115 -17 -134 -34 -129 b -62 -72 -57 -102 -62 -87 b -13 -9 -62 -44 -44 -16 "},v5c:{x_min:0,x_max:447.8125,ha:457,o:"m 0 -87 l 0 0 l 223 0 l 447 0 l 447 -87 l 447 -174 l 223 -174 l 0 -174 l 0 -87 "},v5d:{x_min:-1.359375,x_max:592.078125,ha:604,o:"m 280 692 b 295 694 283 692 289 694 b 310 692 300 694 307 692 b 357 630 340 684 357 657 b 336 580 357 612 351 594 b 311 538 321 566 311 549 b 352 492 311 512 330 492 b 366 495 357 492 362 492 b 397 553 390 503 397 517 b 415 603 397 576 402 591 b 460 623 427 617 443 623 b 509 599 479 623 498 614 b 522 559 518 587 522 573 b 494 506 522 538 513 519 b 451 495 481 498 473 496 b 415 488 432 495 426 494 b 394 449 404 483 394 464 b 394 448 394 448 394 448 l 394 440 l 397 433 b 428 409 404 420 413 413 b 438 408 431 408 435 408 b 479 431 450 408 462 415 b 528 455 495 448 510 455 b 548 452 534 455 541 453 b 592 391 577 442 592 416 b 549 331 592 365 577 340 b 528 327 541 328 534 327 b 479 351 510 327 495 335 b 438 374 464 367 450 374 b 417 369 431 374 424 373 b 394 333 402 360 394 348 b 400 312 394 326 396 319 b 451 287 408 294 420 288 b 513 258 484 285 499 278 b 522 223 519 247 522 234 b 461 159 522 190 496 159 b 449 161 457 159 453 159 b 397 229 416 167 397 191 b 366 288 397 265 390 278 b 352 290 362 290 357 290 b 315 262 336 290 321 280 b 311 245 313 256 311 251 b 334 204 311 233 318 220 b 355 170 348 190 351 184 b 357 152 356 166 357 159 b 355 136 357 147 356 140 b 295 88 345 104 321 88 b 232 152 264 88 232 112 b 255 204 232 174 238 186 b 279 244 273 222 279 231 l 279 245 b 238 290 279 270 259 290 b 224 288 234 290 228 290 b 193 229 200 278 193 265 b 141 161 193 191 174 167 b 129 159 137 159 133 159 b 68 223 93 159 68 190 b 77 258 68 234 70 247 b 138 287 91 278 106 285 b 185 302 166 287 175 291 b 196 333 193 312 196 323 b 174 369 196 347 187 360 b 152 374 166 373 159 374 b 111 351 140 374 126 367 b 62 327 95 335 80 327 b 51 328 58 327 54 327 b -1 391 16 334 -1 363 b 53 455 -1 420 17 449 b 62 455 57 455 59 455 b 111 431 80 455 95 448 b 152 408 127 415 140 408 b 161 409 155 408 159 408 b 193 433 176 413 186 420 l 196 440 l 196 448 b 196 451 196 449 196 449 b 190 471 196 459 194 463 b 137 495 182 489 167 495 l 134 495 l 134 495 b 68 560 95 495 68 521 b 129 623 68 596 95 623 b 144 621 134 623 138 623 b 193 553 175 614 193 589 b 224 495 193 517 200 503 b 238 492 228 492 234 492 b 279 538 259 492 279 512 b 254 580 279 549 269 566 b 232 630 239 594 232 612 b 280 692 232 657 250 684 m 307 456 b 295 458 303 458 299 458 b 230 391 258 458 230 426 b 236 360 230 381 231 371 b 295 324 249 337 272 324 b 353 360 318 324 341 337 b 360 391 357 370 360 381 b 307 456 360 421 340 451 "},v60:{x_min:-590.71875,x_max:589.359375,ha:601,o:"m -367 173 b -362 174 -366 174 -364 174 b -351 173 -357 174 -353 173 b -262 86 -348 172 -328 151 b -176 0 -216 37 -176 0 b -107 84 -176 0 -145 37 b -31 174 -36 173 -38 172 b -25 174 -29 174 -28 174 b -16 173 -23 174 -19 173 b 72 86 -13 172 6 151 b 157 0 119 37 157 0 b 227 84 159 0 189 37 b 303 174 298 173 296 172 b 308 174 304 174 307 174 b 318 173 313 174 317 173 b 481 11 322 172 357 134 l 494 -1 l 522 34 b 560 76 553 72 555 74 b 567 77 563 77 564 77 b 589 56 579 77 589 68 b 586 48 589 54 588 51 b 411 -172 583 41 416 -166 b 397 -176 406 -174 401 -176 b 387 -174 393 -176 390 -176 b 299 -87 386 -173 366 -152 b 213 0 253 -38 213 0 b 144 -86 213 0 182 -38 b 68 -174 73 -174 74 -173 b 62 -176 66 -176 65 -176 b 53 -174 59 -176 55 -174 b -35 -87 50 -173 29 -152 b -121 0 -83 -38 -121 0 b -190 -86 -122 0 -152 -38 b -266 -174 -261 -174 -259 -173 b -272 -176 -268 -176 -270 -176 b -281 -174 -276 -176 -280 -174 b -371 -86 -284 -173 -304 -152 b -457 0 -417 -38 -457 0 l -457 0 b -477 -26 -457 0 -470 -16 b -548 -227 -524 -88 -548 -161 b -536 -303 -548 -254 -544 -280 b -533 -317 -534 -309 -533 -313 b -553 -338 -533 -330 -541 -338 b -577 -315 -566 -338 -571 -333 b -590 -227 -586 -287 -590 -258 b -518 -9 -590 -154 -564 -77 b -465 56 -509 2 -504 8 l -402 134 b -367 173 -375 169 -372 172 "},v62:{x_min:46.28125,x_max:669.671875,ha:563,o:"m 183 376 b 189 376 185 376 187 376 b 212 374 197 376 208 376 b 265 337 234 369 253 355 b 274 317 268 331 273 320 b 274 316 274 317 274 316 b 280 323 276 316 276 319 b 311 358 288 337 299 348 b 319 366 315 360 318 365 b 356 376 326 373 340 376 b 382 371 364 376 374 374 b 428 337 400 366 417 352 b 436 317 431 331 436 320 b 438 316 436 317 436 316 b 442 323 438 316 439 319 b 475 358 451 337 462 348 b 483 366 477 360 481 365 b 518 376 488 373 503 376 b 544 373 528 376 536 376 b 604 285 579 360 604 326 b 597 249 604 273 601 258 b 543 63 596 247 544 70 b 541 54 543 61 541 55 b 540 44 540 51 540 47 b 552 23 540 33 545 23 b 552 23 552 23 552 23 b 647 126 586 29 627 72 b 658 138 651 136 653 138 b 660 138 660 138 660 138 b 669 129 666 137 669 136 b 654 88 669 122 665 109 b 562 -12 631 43 602 9 l 549 -19 b 521 -27 540 -24 530 -27 b 447 30 490 -27 458 -4 b 443 58 445 38 443 48 b 450 93 443 72 446 84 b 504 278 453 97 504 272 b 507 288 506 283 506 287 b 509 298 507 292 509 295 b 491 326 509 310 502 320 b 487 327 490 327 488 327 b 479 324 484 327 483 326 b 441 270 462 316 443 288 b 435 249 441 265 436 254 b 398 127 434 248 419 195 b 362 4 379 61 362 5 b 328 -1 359 -1 362 -1 b 314 -1 323 -1 319 -1 b 302 -1 310 -1 306 -1 b 266 4 266 -1 269 -1 b 265 6 265 5 265 5 b 303 144 265 13 272 34 b 343 278 325 216 343 276 b 344 288 343 281 344 285 b 345 298 345 291 345 295 b 330 326 345 310 340 320 b 323 327 328 327 325 327 b 317 324 322 327 321 326 b 279 270 300 316 281 288 b 273 249 279 265 274 254 b 236 127 272 248 255 195 b 200 4 216 61 200 5 b 164 -1 197 -1 198 -1 b 151 -1 161 -1 156 -1 b 140 -1 147 -1 142 -1 b 103 4 104 -1 106 -1 b 103 6 103 5 103 5 b 141 144 103 13 108 34 b 181 278 161 216 179 276 b 182 288 181 281 181 285 b 183 298 182 291 183 295 b 168 324 183 310 178 320 b 160 327 166 326 163 327 b 141 320 156 327 151 324 b 69 230 112 305 85 272 b 57 215 65 217 62 215 b 55 215 57 215 55 215 b 46 224 49 215 46 217 b 59 260 46 231 50 242 b 151 363 81 306 112 341 b 161 369 155 365 160 367 b 183 376 166 371 174 374 "},v68:{x_min:-597.53125,x_max:596.171875,ha:608,o:"m -533 324 b -525 327 -530 326 -528 327 b -504 305 -514 327 -504 317 b -504 305 -504 305 -504 305 b -513 284 -504 299 -504 299 b -556 112 -541 226 -556 167 b -545 33 -556 84 -552 58 b -524 -20 -541 15 -532 -9 l -522 -23 l -491 15 l -413 111 b -355 174 -367 169 -363 174 b -351 174 -353 174 -352 174 b -254 86 -343 174 -348 179 b -168 -1 -208 37 -168 -1 b -100 84 -168 -1 -137 37 b -23 173 -28 173 -29 172 b -19 174 -21 174 -20 174 b -8 173 -14 174 -10 173 b 155 11 -5 172 43 123 l 166 -1 l 168 1 l 170 4 l 170 130 b 171 260 170 256 170 258 b 191 274 175 269 183 274 b 205 267 196 274 201 272 b 212 158 212 262 210 273 l 212 56 l 257 112 b 311 173 304 172 304 172 b 317 174 313 174 314 174 b 326 173 319 174 323 173 b 490 11 329 172 366 134 l 502 -1 l 530 34 b 568 76 560 72 563 74 b 575 77 570 77 573 77 b 596 56 586 77 596 68 b 594 48 596 54 596 51 b 417 -172 592 41 424 -166 b 405 -176 415 -174 409 -176 b 396 -174 401 -176 398 -176 b 307 -87 393 -173 372 -152 b 221 -1 259 -38 221 -1 b 216 -6 221 -1 219 -2 l 212 -12 l 212 -147 b 212 -210 212 -173 212 -194 b 205 -292 212 -297 210 -287 b 191 -299 201 -297 196 -299 b 172 -287 183 -299 175 -295 b 170 -174 171 -284 171 -284 l 170 -63 l 127 -117 b 73 -176 84 -170 80 -176 b 68 -176 72 -176 70 -176 b -27 -87 59 -174 65 -180 b -114 0 -74 -38 -112 0 b -182 -86 -114 0 -145 -38 b -258 -174 -253 -174 -253 -173 b -264 -176 -259 -176 -262 -176 b -274 -174 -268 -176 -272 -174 b -438 -11 -277 -173 -348 -102 l -449 0 l -479 -37 b -524 -80 -513 -80 -514 -80 l -524 -80 b -553 -52 -534 -80 -540 -74 b -597 109 -583 -8 -597 48 b -560 280 -597 165 -585 224 b -533 324 -548 310 -540 322 "},v6c:{x_min:-1.359375,x_max:193.28125,ha:197,o:"m 78 233 b 87 233 81 233 84 233 b 187 140 132 233 174 195 b 193 102 190 127 193 115 b 43 -113 193 22 136 -62 b 27 -119 36 -116 31 -119 b 19 -108 21 -119 19 -115 b 29 -97 19 -102 20 -101 b 102 13 73 -72 102 -27 b 92 51 102 26 98 40 l 91 54 l 84 54 b 8 104 53 54 21 74 b -1 142 1 116 -1 130 b 78 233 -1 187 31 227 "},v6d:{x_min:-590.71875,x_max:589.359375,ha:601,o:"m 544 335 b 553 337 548 337 551 337 b 575 313 563 337 570 330 b 589 226 583 285 589 256 b 517 8 589 152 563 76 b 464 -58 507 -4 503 -9 l 401 -136 b 362 -176 372 -172 370 -176 b 357 -176 360 -176 359 -176 b 261 -87 349 -174 355 -180 b 175 0 215 -38 175 0 b 106 -86 175 0 144 -38 b 29 -174 35 -174 36 -173 b 24 -176 28 -176 27 -176 b 14 -174 21 -176 17 -174 b -73 -87 12 -173 -8 -152 b -159 0 -121 -38 -159 0 b -228 -86 -160 0 -190 -38 b -304 -174 -299 -174 -298 -173 b -310 -176 -306 -176 -308 -176 b -319 -174 -314 -176 -318 -174 b -483 -12 -323 -173 -359 -137 l -495 0 l -524 -34 b -562 -77 -553 -73 -556 -76 b -568 -79 -564 -79 -566 -79 b -590 -58 -581 -79 -590 -69 b -588 -49 -590 -55 -589 -52 b -412 170 -585 -43 -417 165 b -398 174 -408 173 -402 174 b -389 173 -394 174 -392 174 b -300 86 -387 172 -366 151 b -215 -1 -254 37 -215 -1 b -145 84 -215 -1 -183 37 b -69 173 -74 173 -76 172 b -63 174 -68 174 -66 174 b -54 173 -61 174 -57 173 b 34 86 -51 172 -31 151 b 119 -1 81 37 119 -1 b 189 84 121 -1 151 37 b 265 173 259 173 258 172 b 270 174 266 174 269 174 b 280 173 274 174 279 173 b 370 84 283 172 303 151 b 455 -1 416 37 455 -1 l 455 -1 b 476 24 455 -1 469 15 b 547 226 522 87 547 159 b 534 302 547 252 543 278 b 532 317 533 308 532 313 b 544 335 532 326 536 333 "},v6f:{x_min:-80.3125,x_max:78.9375,ha:81,o:"m 63 191 b 69 192 65 192 66 192 b 77 188 72 192 76 191 b 78 183 78 187 78 186 b 74 158 78 179 77 172 l 66 115 b 9 -161 49 30 10 -158 b -10 -187 6 -172 -1 -181 b -34 -194 -17 -191 -25 -194 b -80 -147 -58 -194 -80 -174 b -80 -141 -80 -144 -80 -142 b 9 70 -80 -134 -73 -117 l 49 163 b 63 191 59 188 61 190 "},v70:{x_min:0,x_max:436.921875,ha:446,o:"m 213 190 b 217 191 215 191 216 191 b 231 184 223 191 228 188 b 249 154 240 167 246 159 b 419 18 292 91 348 45 b 436 -1 435 11 436 8 b 424 -16 436 -9 434 -13 b 308 -87 394 -26 340 -59 b 231 -186 276 -117 257 -142 b 219 -192 228 -191 225 -192 b 198 -174 209 -192 208 -191 b 47 -33 161 -113 110 -63 b 10 -16 34 -26 17 -19 b 0 -1 2 -13 0 -9 b 17 18 0 8 1 11 b 198 173 95 48 156 101 b 213 190 206 187 208 188 "},v72:{x_min:-423.3125,x_max:421.9375,ha:431,o:"m -262 197 b -247 197 -257 197 -253 197 b -118 162 -210 197 -163 184 b 40 45 -61 134 -13 98 b 277 -95 119 -33 200 -81 b 289 -97 281 -97 285 -97 b 378 0 332 -97 371 -55 b 378 11 378 4 378 6 b 302 83 378 55 345 83 b 242 66 283 83 262 77 b 208 56 231 59 219 56 b 148 120 175 56 148 81 b 201 186 148 151 164 172 b 261 198 220 194 240 198 b 420 45 341 198 411 136 b 421 22 421 37 421 29 b 245 -199 421 -93 338 -199 b 238 -198 243 -199 240 -199 b -44 -47 148 -194 50 -141 b -250 86 -114 22 -183 66 b -295 94 -270 91 -283 94 b -315 91 -302 94 -307 94 b -381 4 -356 81 -381 43 b -355 -56 -381 -18 -372 -40 b -298 -81 -338 -73 -319 -81 b -246 -68 -283 -81 -265 -77 b -212 -58 -234 -61 -223 -58 b -178 -69 -200 -58 -189 -62 b -151 -122 -160 -81 -151 -101 b -171 -167 -151 -138 -157 -155 b -239 -195 -185 -181 -213 -192 b -257 -197 -245 -197 -250 -197 b -423 -5 -352 -197 -423 -109 b -412 65 -423 16 -419 40 b -262 197 -389 137 -329 188 "},v74:{x_min:-206.890625,x_max:428.75,ha:438,o:"m 389 -351 b 394 -351 390 -351 393 -351 b 428 -385 413 -351 428 -367 b 428 -394 428 -388 428 -391 b 394 -428 426 -406 421 -410 l 332 -473 l 269 -516 l 205 -560 l 141 -603 l 77 -648 l 13 -692 l -50 -737 l -114 -780 l -145 -802 b -171 -813 -157 -810 -163 -813 b -175 -813 -172 -813 -174 -813 b -206 -777 -194 -811 -206 -795 b -202 -760 -206 -771 -205 -766 b -87 -675 -197 -752 -206 -757 l -34 -639 l 83 -557 l 145 -514 l 209 -470 l 272 -427 b 389 -351 375 -356 381 -352 "},v75:{x_min:-149.71875,x_max:148.359375,ha:151,o:"m -137 381 b -130 383 -134 383 -133 383 b -111 371 -122 383 -114 378 b -55 224 -110 370 -85 305 b 0 80 -25 145 -1 80 b 54 224 0 80 24 145 b 112 377 114 384 110 373 b 127 384 118 381 122 384 b 148 362 138 384 148 374 l 148 356 l 83 183 b 16 9 47 88 17 11 b -1 0 12 2 5 0 b -14 5 -5 0 -10 1 b -84 183 -19 9 -13 -6 l -149 356 l -149 362 b -137 381 -149 371 -145 378 "},v78:{x_min:0,x_max:193.28125,ha:197,o:"m 85 514 b 95 517 88 517 89 517 b 114 505 103 517 110 513 l 115 502 l 115 376 b 115 249 115 306 115 249 b 141 258 117 249 127 252 l 167 266 l 172 266 b 190 254 181 265 187 262 l 193 251 l 193 202 l 193 188 b 187 147 193 149 191 152 b 147 130 183 142 182 141 l 115 119 l 115 9 b 115 -99 115 -51 115 -99 b 141 -91 115 -99 127 -95 b 171 -81 166 -81 167 -81 l 171 -81 b 191 -94 181 -81 189 -87 b 193 -142 191 -97 193 -120 b 191 -195 193 -167 191 -194 b 125 -227 187 -205 187 -204 l 115 -230 l 115 -366 l 115 -503 l 114 -506 b 95 -519 110 -514 102 -519 b 74 -506 87 -519 78 -514 l 73 -503 l 73 -374 b 73 -245 73 -260 73 -245 b 73 -245 73 -245 73 -245 b 55 -252 72 -245 63 -249 l 32 -260 b 19 -263 27 -262 23 -263 b 4 -256 13 -263 8 -260 b 0 -215 0 -251 0 -254 b 0 -199 0 -210 0 -206 l 0 -152 l 1 -149 b 8 -140 2 -145 5 -141 b 42 -127 9 -140 24 -133 l 73 -116 l 73 -5 b 73 23 73 4 73 15 b 73 105 73 70 73 105 b 49 97 73 105 61 101 b 17 88 32 91 23 88 b 4 95 10 88 8 91 b 0 137 0 101 0 98 b 0 151 0 141 0 145 l 0 199 l 1 202 b 43 224 5 212 5 212 l 73 234 l 73 367 l 73 502 l 74 505 b 85 514 77 509 81 513 "},v79:{x_min:-1.359375,x_max:899.703125,ha:918,o:"m 307 349 b 332 351 315 351 323 351 b 443 340 367 351 408 347 b 741 47 607 306 720 195 b 744 0 743 31 744 16 b 660 -303 744 -90 713 -206 b 28 -755 534 -531 304 -695 b 14 -756 23 -755 19 -756 b -1 -741 4 -756 -1 -750 b 21 -720 -1 -731 1 -728 b 567 -56 337 -601 548 -344 b 568 -11 568 -41 568 -24 b 442 285 568 129 525 233 b 325 319 406 308 367 319 b 93 177 232 319 137 266 b 84 154 91 170 84 155 b 84 154 84 154 84 154 b 88 156 84 154 85 155 b 159 177 110 170 134 177 b 257 134 194 177 231 162 b 294 41 281 108 294 73 b 171 -97 294 -24 246 -90 b 156 -98 166 -97 161 -98 b 6 74 73 -98 6 -22 b 6 80 6 76 6 79 b 307 349 10 223 141 340 m 839 215 b 845 216 841 216 842 216 b 862 213 852 216 860 215 b 899 163 887 206 899 184 b 872 117 899 145 890 127 b 847 111 865 112 856 111 b 808 130 833 111 818 117 b 796 162 800 140 796 151 b 839 215 796 187 812 212 m 839 -112 b 845 -112 841 -112 842 -112 b 862 -115 852 -112 860 -113 b 899 -165 887 -122 899 -144 b 872 -210 899 -183 890 -201 b 847 -217 865 -215 856 -217 b 808 -198 833 -217 818 -210 b 796 -165 800 -188 796 -177 b 839 -112 796 -140 812 -116 "},v7a:{x_min:-1.359375,x_max:386.5625,ha:394,o:"m 249 535 b 257 537 251 537 253 537 b 276 524 266 537 273 533 l 277 521 l 279 419 l 279 316 l 304 323 b 337 328 319 326 330 328 b 353 316 347 328 349 324 b 355 266 355 315 355 290 b 353 215 355 241 355 217 b 319 198 349 206 347 205 b 279 187 284 190 279 188 b 279 156 279 187 279 174 b 279 136 279 151 279 144 l 279 84 l 289 87 l 330 98 b 367 105 352 102 362 105 b 378 101 372 105 375 104 b 386 61 385 95 386 94 b 386 40 386 55 386 48 l 386 -5 l 385 -8 b 374 -19 383 -12 378 -18 b 291 -40 372 -19 347 -26 b 279 -43 284 -41 279 -43 b 279 -83 279 -43 279 -59 b 279 -95 279 -87 279 -91 l 279 -145 l 304 -140 b 337 -133 321 -136 330 -133 b 349 -140 343 -133 347 -136 b 355 -181 355 -145 355 -142 l 355 -197 l 355 -210 b 349 -252 355 -249 355 -247 b 300 -269 345 -258 347 -258 b 280 -274 291 -272 281 -273 l 279 -274 l 277 -378 l 277 -483 l 276 -487 b 257 -499 273 -495 265 -499 b 238 -487 249 -499 242 -495 l 236 -483 l 236 -384 l 236 -285 l 235 -285 l 212 -291 l 170 -301 b 148 -308 159 -305 148 -306 b 147 -415 147 -308 147 -313 l 147 -523 l 145 -526 b 126 -538 141 -534 133 -538 b 106 -526 118 -538 110 -534 l 104 -523 l 104 -420 b 103 -317 104 -326 104 -317 b 103 -317 103 -317 103 -317 b 50 -330 92 -322 54 -330 b 31 -317 42 -330 35 -326 b 29 -267 29 -315 29 -315 l 29 -219 l 32 -216 b 92 -192 36 -206 36 -206 l 104 -190 l 104 -138 b 103 -87 104 -91 104 -87 b 103 -87 103 -87 103 -87 b 88 -91 103 -87 96 -88 l 49 -101 b 17 -106 32 -105 23 -106 b 6 -102 13 -106 10 -105 b -1 -62 0 -97 -1 -95 b 0 -41 -1 -56 0 -49 l 0 4 l 1 6 b 10 16 2 11 6 15 b 91 37 12 18 38 24 l 104 41 l 104 93 b 103 144 104 140 104 144 b 103 144 103 144 103 144 b 50 131 92 141 54 131 b 31 144 42 131 35 137 b 29 195 29 147 29 148 l 29 242 l 32 245 b 92 269 36 255 36 255 l 104 273 l 104 377 l 104 481 l 106 485 b 126 498 110 492 118 498 b 134 495 129 498 132 496 b 145 485 138 494 142 489 l 147 481 l 147 383 l 147 283 l 152 284 b 190 294 155 285 171 290 l 230 303 l 236 305 l 236 413 l 236 521 l 238 524 b 249 535 240 528 243 533 m 236 126 b 235 177 236 154 236 177 l 235 177 b 213 172 235 177 225 174 l 170 161 b 147 155 157 158 147 155 b 147 124 147 155 147 142 b 147 102 147 117 147 111 l 147 52 l 153 54 l 228 72 l 236 74 l 236 126 m 236 -105 b 235 -54 236 -65 236 -54 l 235 -54 b 231 -55 235 -54 234 -54 b 172 -69 227 -55 204 -62 l 149 -76 l 147 -76 l 147 -127 l 147 -179 l 152 -177 b 190 -167 155 -177 171 -173 l 230 -158 l 236 -156 l 236 -105 "},v7c:{x_min:0,x_max:300.8125,ha:307,o:"m 49 505 b 53 506 50 505 51 506 b 70 496 58 506 62 503 b 81 485 73 492 78 488 l 96 473 l 111 459 l 122 449 l 134 438 l 182 396 l 255 330 b 292 291 292 298 292 298 l 292 290 l 292 284 l 283 270 b 209 36 234 197 209 113 b 288 -170 209 -44 235 -119 b 299 -184 295 -179 299 -181 b 300 -191 300 -187 300 -188 b 285 -206 300 -199 294 -206 b 280 -206 283 -206 281 -206 b 247 -201 270 -202 259 -201 b 176 -222 223 -201 197 -208 b 114 -340 136 -249 114 -292 b 172 -471 114 -384 134 -433 b 185 -492 182 -481 185 -487 b 181 -502 185 -496 183 -499 b 171 -508 176 -505 174 -508 b 152 -498 166 -508 160 -503 b 0 -284 65 -428 12 -352 b 0 -260 0 -278 0 -270 b 1 -238 0 -252 0 -242 b 148 -140 16 -177 73 -140 b 209 -148 167 -140 189 -142 b 215 -149 212 -148 215 -149 b 215 -149 215 -149 215 -149 l 215 -149 b 201 -136 215 -148 209 -142 l 157 -97 l 96 -41 b 17 34 21 24 17 29 b 17 37 17 36 17 36 b 17 38 17 37 17 38 b 25 56 17 44 17 44 b 110 298 81 131 110 219 b 46 474 110 367 88 431 b 38 491 40 480 38 487 b 49 505 38 498 42 502 "},v7d:{x_min:-1.359375,x_max:436.921875,ha:446,o:"m 213 205 b 217 205 215 205 216 205 b 234 194 224 205 234 199 b 236 187 234 194 235 190 l 245 167 l 261 129 l 270 106 b 355 -61 294 54 329 -13 b 420 -163 381 -105 402 -138 b 436 -188 435 -184 436 -184 b 436 -191 436 -190 436 -190 b 421 -206 436 -201 431 -206 l 421 -206 l 416 -206 l 405 -201 b 217 -158 347 -172 283 -158 b 31 -201 153 -158 88 -172 l 20 -206 l 14 -206 l 14 -206 b 0 -191 5 -206 0 -201 b -1 -188 0 -190 -1 -190 b 14 -163 -1 -186 0 -184 b 95 -34 36 -136 72 -77 b 166 106 119 8 148 68 l 175 129 l 183 148 l 200 188 b 213 205 205 199 208 202 "},v7f:{x_min:0,x_max:367.5,ha:375,o:"m 0 124 l 0 187 l 61 187 l 122 187 l 122 138 l 122 91 l 153 61 l 183 30 l 213 61 l 243 91 l 243 138 l 243 187 l 306 187 l 367 187 l 367 124 l 367 61 l 321 61 l 274 61 l 243 30 l 213 0 l 243 -31 l 274 -62 l 321 -62 l 367 -62 l 367 -124 l 367 -188 l 306 -188 l 243 -188 l 243 -140 l 243 -93 l 213 -62 l 183 -31 l 153 -62 l 122 -93 l 122 -140 l 122 -188 l 61 -188 l 0 -188 l 0 -124 l 0 -62 l 46 -62 l 92 -62 l 123 -31 l 153 0 l 123 30 l 92 61 l 46 61 l 0 61 l 0 124 "},v80:{x_min:29.9375,x_max:420.578125,ha:371,o:"m 115 345 b 221 347 117 345 166 347 b 411 345 306 347 409 345 b 420 330 416 342 420 335 b 415 319 420 326 419 321 b 178 118 397 303 179 118 b 178 117 178 118 178 117 b 181 117 178 117 178 117 b 189 117 182 117 185 117 b 193 117 190 117 191 117 b 247 98 215 117 232 111 b 296 75 266 83 280 76 b 302 75 299 75 300 75 b 322 91 311 75 315 79 b 322 91 322 91 322 91 b 322 91 322 91 322 91 b 319 91 322 91 321 91 b 313 90 318 90 315 90 b 283 107 300 90 288 97 b 277 126 279 114 277 121 b 319 167 277 149 295 167 b 319 167 319 167 319 167 b 362 118 347 167 362 147 b 355 82 362 108 359 96 b 311 33 349 65 340 55 b 224 1 284 12 253 1 b 194 5 213 1 204 2 b 168 18 183 8 178 11 b 110 36 151 30 130 36 b 57 15 88 36 68 29 b 47 11 54 12 51 11 b 31 20 40 11 34 13 b 29 26 31 22 29 25 b 68 66 29 36 39 45 b 285 250 73 71 281 248 b 285 250 285 250 285 250 b 231 252 285 252 261 252 b 137 250 190 252 141 250 b 93 227 122 248 110 241 b 78 220 88 222 83 220 b 66 227 74 220 70 222 b 63 234 65 229 63 231 b 85 291 63 241 69 252 b 115 345 108 342 108 344 "},v81:{x_min:0,x_max:428.75,ha:438,o:"m 262 186 b 273 186 266 186 272 186 b 274 186 273 186 274 186 b 285 186 274 186 280 186 b 428 48 375 181 428 122 b 386 -68 428 12 416 -29 b 155 -187 329 -145 236 -187 b 12 -111 92 -187 38 -162 b 0 -51 4 -91 0 -72 b 262 186 0 58 122 179 m 366 131 b 352 134 362 133 357 134 b 219 81 321 134 269 115 b 47 -111 126 23 50 -62 b 47 -112 47 -111 47 -112 b 77 -136 47 -129 58 -136 b 264 -45 118 -136 194 -101 b 382 109 336 12 382 76 b 366 131 382 120 377 129 "},v83:{x_min:-1.359375,x_max:847.96875,ha:865,o:"m 488 1499 b 495 1500 490 1500 492 1500 b 541 1465 507 1500 521 1490 b 679 1078 622 1372 679 1210 b 677 1050 679 1068 677 1060 b 477 642 668 893 604 764 l 443 609 l 431 596 l 431 592 l 438 562 l 449 508 l 460 458 b 481 355 475 390 481 355 b 481 355 481 355 481 355 b 490 356 481 355 485 355 b 528 358 495 356 511 358 b 558 356 540 358 552 356 b 839 95 699 338 808 237 b 847 22 845 72 847 47 b 631 -303 847 -113 766 -242 b 620 -309 623 -308 620 -309 l 620 -310 b 631 -359 620 -310 626 -333 l 646 -435 l 660 -496 b 672 -588 668 -535 672 -563 b 664 -653 672 -610 669 -630 b 383 -875 630 -792 509 -875 b 201 -810 321 -875 257 -855 b 129 -680 151 -768 129 -730 b 274 -530 129 -592 200 -530 b 351 -553 300 -530 326 -538 b 412 -669 393 -582 412 -626 b 287 -805 412 -735 366 -800 l 279 -805 l 285 -809 b 383 -830 318 -823 351 -830 b 586 -718 464 -830 540 -789 b 626 -584 612 -678 626 -631 b 619 -528 626 -566 623 -548 b 612 -495 619 -526 616 -510 b 577 -324 590 -387 577 -324 b 577 -324 577 -324 577 -324 b 568 -326 575 -324 571 -324 b 528 -334 558 -328 537 -333 b 465 -338 506 -337 485 -338 b 24 -11 269 -338 87 -206 b -1 145 8 41 -1 93 b 96 442 -1 249 32 351 b 322 714 166 541 236 626 l 352 745 l 345 782 l 332 843 l 315 921 b 303 984 310 950 304 978 b 295 1082 298 1017 295 1049 b 413 1426 295 1208 336 1329 b 488 1499 436 1456 477 1496 m 549 1301 b 541 1301 547 1301 544 1301 b 411 1207 500 1301 447 1263 b 355 1004 374 1152 355 1079 b 359 942 355 984 356 963 b 371 881 362 927 363 917 l 385 818 b 392 782 389 799 392 784 l 392 782 b 434 828 393 782 424 816 b 607 1165 534 941 594 1060 b 608 1193 608 1175 608 1183 b 597 1270 608 1224 604 1254 b 549 1301 589 1286 571 1299 m 398 528 b 393 555 396 542 393 553 b 392 555 393 555 393 555 b 317 470 390 555 347 505 b 190 298 266 408 212 334 b 127 70 148 227 127 148 b 155 -77 127 19 137 -30 b 468 -303 209 -216 333 -303 b 519 -299 484 -303 502 -302 b 568 -284 541 -295 568 -287 l 568 -284 b 563 -263 568 -284 566 -274 l 534 -120 l 511 -13 l 496 61 l 480 133 b 469 187 472 176 469 187 b 468 188 469 187 469 188 b 416 162 462 188 430 172 b 337 13 364 126 337 69 b 413 -124 337 -40 363 -93 b 428 -144 424 -131 428 -137 b 428 -149 428 -145 428 -148 b 409 -166 426 -161 419 -166 b 394 -162 405 -166 400 -165 b 240 77 302 -122 240 -27 l 240 77 b 430 342 240 197 315 301 l 436 344 l 426 394 l 398 528 m 548 194 b 526 195 540 195 532 195 b 519 195 524 195 521 195 l 514 195 l 518 177 l 539 79 l 552 15 l 566 -48 l 594 -187 l 605 -240 b 612 -266 609 -254 611 -266 b 612 -266 612 -266 612 -266 b 641 -248 613 -266 630 -256 b 744 -98 692 -212 730 -156 b 751 -40 749 -79 751 -59 b 548 194 751 76 665 181 "},v84:{x_min:25.859375,x_max:164.6875,ha:168,o:"m 34 369 b 40 370 35 370 38 370 b 59 353 49 370 50 367 b 164 40 122 254 155 158 b 164 0 164 33 164 16 b 164 -40 164 -16 164 -34 b 59 -353 155 -158 122 -254 b 40 -371 53 -366 47 -371 b 34 -370 38 -371 36 -370 b 25 -358 28 -367 25 -363 b 31 -337 25 -352 27 -347 b 92 0 72 -234 92 -117 b 31 335 92 116 72 233 b 25 356 27 345 25 352 b 34 369 25 363 28 366 "},v86:{x_min:-571.671875,x_max:570.3125,ha:582,o:"m -386 173 b -381 174 -385 174 -383 174 b -370 173 -377 174 -372 173 b -281 86 -367 172 -347 151 b -196 0 -235 37 -196 0 b -126 84 -196 0 -164 37 b -50 174 -55 173 -57 172 b -44 174 -49 174 -47 174 b -35 173 -42 174 -38 173 b 53 86 -32 172 -12 151 b 138 0 100 37 138 0 b 208 84 140 0 170 37 b 284 174 279 173 277 172 b 289 174 285 174 288 174 b 299 173 294 174 298 173 b 462 11 303 172 338 134 l 475 -1 l 503 34 b 541 76 534 72 536 74 b 548 77 544 77 545 77 b 570 56 560 77 570 68 b 567 48 570 54 568 51 b 392 -172 564 41 397 -166 b 378 -176 387 -174 382 -176 b 368 -174 374 -176 371 -176 b 280 -87 367 -173 345 -152 b 194 0 234 -38 194 0 b 125 -86 194 0 163 -38 b 49 -174 54 -174 55 -173 b 43 -176 47 -176 46 -176 b 34 -174 40 -176 36 -174 b -54 -87 31 -173 10 -152 b -140 0 -102 -38 -140 0 b -209 -86 -141 0 -171 -38 b -285 -174 -280 -174 -279 -173 b -291 -176 -287 -176 -289 -176 b -300 -174 -295 -176 -299 -174 b -464 -12 -304 -173 -340 -137 l -476 0 l -504 -34 b -543 -77 -534 -73 -537 -76 b -549 -79 -545 -79 -547 -79 b -571 -58 -562 -79 -571 -69 b -568 -49 -571 -55 -570 -52 b -392 172 -566 -43 -396 167 b -386 173 -390 172 -387 173 "},v8a:{x_min:-170.140625,x_max:168.78125,ha:172,o:"m -160 567 b -122 567 -159 567 -149 567 l -87 567 l -84 566 b -74 553 -78 563 -77 560 b -20 366 -73 551 -49 466 b 31 186 8 267 31 186 b 85 371 31 186 55 269 b 140 559 114 473 138 557 b 153 567 141 564 148 567 b 168 559 159 567 166 564 b 168 555 168 557 168 557 b 92 281 168 548 159 513 b 14 13 50 134 14 13 b 0 0 14 6 6 0 b -17 15 -8 0 -17 8 b -93 283 -17 15 -51 136 b -170 552 -166 533 -170 548 b -170 553 -170 552 -170 552 b -160 567 -170 560 -167 564 "},v8b:{x_min:0,x_max:319.859375,ha:326,o:"m 149 508 b 159 509 152 509 155 509 b 186 494 170 509 181 503 b 190 440 190 487 190 488 l 190 430 l 190 377 l 242 377 l 251 377 b 303 373 298 377 296 377 b 319 345 314 367 319 356 b 304 319 319 335 314 324 b 250 315 296 315 299 315 l 242 315 l 190 315 l 190 262 l 190 252 b 186 198 190 204 190 205 b 159 183 179 188 170 183 b 132 198 148 183 138 188 b 127 252 127 205 127 204 l 127 262 l 127 315 l 76 315 l 68 315 b 14 319 20 315 21 315 b 0 347 4 324 0 335 b 14 373 0 356 4 367 b 68 377 21 377 20 377 l 76 377 l 127 377 l 127 430 l 127 440 b 132 494 127 488 127 487 b 149 508 136 501 142 505 "},v8c:{x_min:-330.75,x_max:329.390625,ha:336,o:"m -133 483 b -117 484 -127 484 -122 484 b 31 373 -51 484 9 440 b 35 348 34 365 35 356 b -25 285 35 313 10 285 b -87 331 -55 285 -76 302 b -167 402 -100 376 -133 402 b -191 398 -175 402 -183 401 b -227 341 -215 388 -227 369 b -225 320 -227 334 -227 327 b -13 74 -209 230 -125 133 b 6 65 -4 70 5 66 l 9 63 l 10 65 b 117 231 12 68 40 112 l 189 341 l 242 424 b 268 460 262 456 264 458 b 283 464 273 463 277 464 b 308 438 296 464 308 453 l 308 437 b 287 396 308 430 308 428 l 95 98 l 59 43 l 58 41 l 65 37 b 253 -156 151 -8 217 -77 b 281 -285 272 -199 281 -244 b 148 -481 281 -381 231 -463 b 115 -485 137 -484 126 -485 b -32 -376 51 -485 -9 -442 b -36 -349 -35 -366 -36 -358 b 25 -287 -36 -315 -12 -287 b 85 -333 54 -287 74 -302 b 166 -403 99 -377 133 -403 b 190 -399 174 -403 182 -402 b 225 -342 215 -390 225 -370 b 224 -322 225 -335 225 -328 b 12 -76 208 -231 125 -134 b -8 -66 2 -72 -6 -68 l -10 -65 l -12 -66 b -118 -231 -13 -68 -42 -113 l -190 -342 l -243 -426 b -269 -462 -264 -458 -265 -458 b -284 -466 -274 -464 -279 -466 b -310 -440 -298 -466 -310 -455 l -310 -438 b -288 -398 -310 -430 -308 -430 l -96 -99 l -59 -44 l -59 -43 l -66 -38 b -281 284 -198 33 -281 158 l -281 284 b -133 483 -281 392 -220 474 m 254 177 b 266 179 258 177 262 179 b 319 149 287 179 307 167 b 329 115 326 140 329 127 b 319 79 329 102 326 90 b 268 51 307 61 287 51 b 221 72 250 51 234 58 b 205 115 210 84 205 99 b 254 177 205 142 223 170 m -281 -54 b -269 -52 -277 -52 -273 -52 b -223 -73 -253 -52 -235 -59 b -206 -116 -212 -84 -206 -101 b -216 -151 -206 -129 -209 -141 b -269 -179 -228 -170 -249 -179 b -314 -159 -285 -179 -302 -173 b -330 -116 -325 -147 -330 -131 b -281 -54 -330 -88 -313 -61 "},v8d:{x_min:-1.359375,x_max:255.890625,ha:261,o:"m 118 514 b 127 517 121 517 122 517 b 147 505 136 517 142 513 l 148 502 l 148 403 b 148 306 148 351 148 306 b 174 315 149 306 160 310 l 200 324 l 205 323 b 223 312 213 323 220 319 l 225 308 l 225 260 b 225 245 225 255 225 249 b 220 204 225 208 224 209 b 179 188 216 199 215 199 l 148 177 l 148 124 l 148 70 l 189 84 b 236 98 219 94 230 98 b 247 94 240 98 243 97 b 255 52 254 88 255 87 b 255 33 255 47 255 40 l 254 -12 l 253 -15 b 249 -22 253 -18 250 -20 l 245 -24 l 196 -41 l 148 -58 l 148 -108 b 148 -158 148 -136 148 -158 b 174 -148 148 -158 160 -154 b 204 -140 198 -140 200 -140 l 204 -140 b 224 -152 213 -140 221 -145 b 225 -201 224 -155 225 -177 b 224 -254 225 -226 224 -251 b 157 -284 220 -262 220 -262 l 148 -288 l 148 -395 l 148 -503 l 147 -506 b 127 -519 142 -514 134 -519 b 107 -506 119 -519 111 -514 l 106 -503 l 106 -403 b 106 -303 106 -316 106 -303 b 104 -303 104 -303 104 -303 b 88 -310 104 -303 96 -306 l 63 -319 b 51 -322 59 -320 55 -322 b 36 -315 46 -322 40 -319 b 31 -273 32 -309 31 -312 b 31 -258 31 -269 31 -263 l 31 -210 l 34 -206 b 40 -198 35 -204 38 -199 b 74 -186 42 -197 57 -191 l 106 -173 l 106 -123 b 106 -97 106 -112 106 -104 b 106 -72 106 -76 106 -72 b 104 -72 106 -72 106 -72 b 20 -99 89 -79 23 -99 b 0 -84 10 -99 2 -93 b -1 -37 0 -81 -1 -59 b 0 11 -1 -15 0 9 b 58 40 4 22 2 22 l 106 56 l 106 109 b 106 123 106 115 106 119 b 106 162 106 147 106 162 b 81 155 106 162 93 159 b 50 147 65 149 55 147 b 36 152 43 147 40 148 b 31 194 32 158 31 156 b 31 209 31 198 31 204 l 31 256 l 34 260 b 76 281 38 269 38 269 l 106 292 l 106 396 l 106 502 l 107 505 b 118 514 110 509 114 513 "},v8f:{x_min:-21.78125,x_max:362.0625,ha:369,o:"m 302 1031 b 308 1032 304 1032 307 1032 b 330 1016 318 1032 325 1027 b 362 867 351 970 362 920 b 340 738 362 824 353 780 l 336 727 l 340 717 b 362 591 355 677 362 634 b 257 323 362 496 325 401 b 204 272 243 306 227 290 b 20 56 129 206 66 133 b -1 18 12 44 0 22 b -19 4 -4 9 -12 4 l -21 4 l -21 140 l -21 276 l -12 277 b 167 333 61 288 127 309 b 319 598 262 388 319 491 b 311 664 319 620 317 642 l 310 673 l 304 664 b 204 548 279 620 250 587 b 20 333 129 483 66 409 b -1 292 12 320 0 298 b -19 280 -4 285 -12 280 l -21 280 l -21 416 l -21 552 l -12 553 b 167 609 61 564 127 585 b 319 874 264 666 319 770 b 294 992 319 914 311 954 b 288 1011 288 1004 288 1007 b 302 1031 288 1021 294 1028 "},v90:{x_min:-171.5,x_max:483.1875,ha:493,o:"m -8 631 b -1 632 -6 632 -4 632 b 19 620 8 632 16 628 b 20 495 20 616 20 616 b 20 373 20 427 20 373 b 115 410 20 373 63 390 l 210 448 l 210 531 b 212 620 210 614 210 616 b 231 632 215 628 223 632 b 246 627 236 632 242 631 b 251 541 251 620 251 628 l 251 463 l 315 489 b 387 514 368 509 381 514 b 393 513 390 514 392 514 b 406 494 402 510 406 502 b 397 476 406 487 404 480 b 323 446 396 474 363 462 l 251 417 l 251 283 l 251 148 l 254 151 b 370 199 291 183 332 199 b 415 191 385 199 400 197 b 483 84 458 176 483 134 b 461 0 483 58 476 29 b 332 -142 439 -40 411 -72 l 255 -215 b 231 -229 240 -229 239 -229 b 216 -223 224 -229 220 -227 b 210 -158 210 -217 210 -223 b 210 -120 210 -148 210 -136 l 210 -29 l 205 -34 b 100 -142 182 -65 159 -88 l 23 -215 b -1 -229 9 -229 6 -229 b -19 -217 -9 -229 -16 -224 l -20 -215 l -21 48 l -21 310 l -83 287 b -152 262 -133 266 -145 262 b -157 263 -153 262 -155 262 b -171 283 -166 266 -171 274 b -161 301 -171 290 -167 297 b -91 328 -160 302 -129 315 l -21 356 l -21 487 l -20 617 l -19 621 b -8 631 -17 626 -12 630 m 210 288 b 210 401 210 351 210 401 b 114 365 209 401 167 384 l 20 327 l 20 238 l 20 148 l 21 151 b 140 199 59 183 102 199 b 206 180 164 199 187 192 l 209 177 b 209 177 209 177 209 177 b 210 288 210 177 210 199 m 110 131 b 96 133 106 133 100 133 b 89 133 93 133 91 133 b 24 87 63 129 40 113 l 20 80 l 20 -37 l 20 -156 l 23 -152 b 144 81 96 -72 144 20 l 144 83 b 110 131 144 113 134 126 m 341 131 b 328 133 337 133 332 133 b 322 133 326 133 323 133 b 257 87 296 129 273 113 l 251 80 l 251 -37 l 251 -156 l 255 -152 b 375 81 328 -72 375 20 l 375 83 b 341 131 375 113 367 126 "},v92:{x_min:0,x_max:598.890625,ha:611,o:"m 62 181 b 77 183 66 183 72 183 b 91 181 83 183 88 183 b 202 131 100 180 106 177 l 299 87 l 394 131 b 517 183 499 181 502 183 b 519 183 517 183 518 183 b 598 104 567 183 598 144 b 577 49 598 84 592 65 b 518 15 567 38 563 37 b 484 0 499 6 484 0 b 518 -16 484 -1 499 -8 b 577 -51 563 -38 567 -40 b 598 -105 592 -66 598 -86 b 519 -184 598 -145 567 -184 b 517 -184 518 -184 517 -184 b 394 -133 502 -184 499 -183 l 299 -88 l 202 -133 b 81 -184 99 -183 95 -184 b 77 -184 80 -184 78 -184 b 0 -105 29 -184 0 -145 b 20 -51 0 -86 5 -66 b 80 -16 29 -40 34 -38 b 114 -1 98 -8 114 -1 b 80 15 114 0 98 6 b 20 49 34 37 29 38 b 0 104 6 65 0 84 b 62 181 0 140 23 174 m 88 134 b 74 136 85 134 80 136 b 68 134 72 136 69 136 b 46 104 54 130 46 117 b 55 81 46 95 49 88 b 149 34 59 76 53 80 b 224 -1 190 15 224 0 b 144 -38 224 -1 187 -18 b 54 -84 59 -79 58 -79 b 46 -105 49 -90 46 -98 b 76 -137 46 -122 58 -137 b 78 -137 77 -137 77 -137 b 194 -86 87 -137 76 -141 b 298 -36 250 -58 298 -36 b 298 -36 298 -36 298 -36 b 402 -84 299 -36 345 -58 b 518 -137 522 -141 510 -137 b 521 -137 519 -137 519 -137 b 551 -105 539 -137 551 -122 b 541 -83 551 -98 548 -90 b 447 -36 537 -77 544 -81 b 374 -1 406 -16 374 -1 b 447 34 374 0 406 15 b 541 81 544 80 537 76 b 551 104 548 88 551 97 b 521 136 551 120 539 136 b 518 136 519 136 519 136 b 517 136 518 136 517 136 l 517 136 b 402 83 511 136 511 136 b 298 34 345 56 299 34 b 298 34 298 34 298 34 b 194 84 298 34 250 56 b 88 134 137 111 89 133 "},v93:{x_min:0,x_max:438.28125,ha:447,o:"m 212 205 b 219 205 213 205 216 205 b 239 183 228 205 231 204 b 421 -163 298 40 363 -83 b 438 -191 434 -180 438 -186 b 436 -197 438 -192 438 -195 b 424 -206 434 -204 431 -206 b 406 -201 420 -206 415 -205 b 216 -156 347 -172 281 -156 b 23 -205 148 -156 80 -173 b 14 -206 20 -206 17 -206 b 0 -191 6 -206 0 -201 b 6 -176 0 -187 1 -183 b 202 192 63 -104 142 45 b 212 205 205 199 208 202 m 264 48 l 249 81 l 243 94 l 242 91 b 89 -126 208 36 137 -66 b 81 -138 85 -133 81 -138 b 81 -138 81 -138 81 -138 b 81 -138 81 -138 81 -138 b 95 -133 81 -138 87 -136 b 280 -94 156 -108 221 -94 b 334 -98 299 -94 317 -95 b 343 -99 338 -99 343 -99 b 343 -99 343 -99 343 -99 b 338 -94 343 -99 341 -97 b 264 48 318 -58 287 1 "},v94:{x_min:-149.71875,x_max:148.359375,ha:151,o:"m -9 215 b 0 217 -6 217 -4 217 b 19 205 8 217 14 213 b 20 142 20 202 20 201 l 20 84 l 23 84 b 144 -27 81 74 129 30 b 148 -66 147 -40 148 -54 b 36 -213 148 -134 103 -197 b 0 -219 24 -217 12 -219 b -145 -104 -68 -219 -129 -173 b -149 -68 -148 -91 -149 -79 b -24 84 -149 6 -98 74 l -21 84 l -21 142 b -19 205 -20 201 -20 202 b -9 215 -17 209 -13 213 m -21 -15 b -23 41 -21 37 -21 41 b -23 41 -23 41 -23 41 b -76 11 -35 40 -62 26 b -108 -65 -98 -11 -108 -38 b -1 -176 -108 -122 -65 -176 b 107 -65 63 -176 107 -122 b 74 11 107 -38 96 -11 b 20 41 61 26 32 41 b 20 -15 20 41 20 15 b 19 -74 20 -72 20 -72 b 0 -87 14 -83 6 -87 b -19 -74 -8 -87 -16 -83 b -21 -15 -20 -72 -20 -72 "},v95:{x_min:0,x_max:406.96875,ha:415,o:"m 55 181 b 70 183 61 183 66 183 b 111 170 85 183 99 179 b 160 130 115 167 137 149 l 202 95 l 245 130 b 319 181 299 176 302 179 b 334 183 325 183 330 183 b 406 109 375 183 406 148 b 401 81 406 99 405 91 b 348 24 394 65 390 59 b 318 -1 332 11 318 0 b 348 -26 318 -1 332 -12 b 401 -83 390 -61 394 -66 b 406 -111 405 -93 406 -101 b 334 -184 406 -149 375 -184 b 319 -183 330 -184 325 -184 b 245 -131 302 -180 299 -177 l 202 -97 l 160 -131 b 85 -183 107 -177 103 -180 b 70 -184 80 -184 76 -184 b 0 -111 31 -184 0 -149 b 4 -83 0 -101 1 -93 b 58 -26 10 -66 16 -61 b 88 -1 74 -12 88 -1 b 58 24 88 0 74 11 b 10 69 23 54 17 59 b 0 109 2 81 0 95 b 55 181 0 142 21 173 m 83 133 b 72 136 78 136 76 136 b 57 131 66 136 61 134 b 46 109 49 126 46 117 b 50 93 46 104 47 98 b 107 45 51 91 77 70 b 160 0 137 20 160 0 b 107 -47 160 -1 137 -22 b 50 -94 77 -72 51 -93 b 46 -111 47 -99 46 -105 b 59 -134 46 -120 50 -130 b 72 -137 62 -136 68 -137 b 83 -136 76 -137 80 -136 b 144 -84 84 -134 107 -116 b 202 -36 176 -58 202 -36 b 261 -84 202 -36 230 -58 b 323 -136 299 -116 321 -134 b 334 -137 326 -136 330 -137 b 345 -134 338 -137 343 -136 b 360 -111 355 -130 360 -120 b 355 -94 360 -105 359 -99 b 299 -47 353 -93 329 -72 b 245 0 269 -22 245 -1 b 299 45 245 0 269 20 b 355 93 329 70 353 91 b 360 109 359 98 360 104 b 345 133 360 119 355 129 b 334 136 343 134 338 136 b 323 134 330 136 326 134 b 261 83 321 133 299 115 b 202 34 230 56 202 34 b 144 83 202 34 176 56 b 83 133 106 115 84 133 "},v97:{x_min:-228.671875,x_max:227.3125,ha:232,o:"m -217 487 l -213 488 l 0 488 l 212 488 l 216 487 b 225 476 220 484 224 480 l 227 473 l 227 244 l 227 15 l 225 12 b 206 0 223 4 215 0 b 197 1 204 0 200 0 b 187 12 193 4 189 6 l 186 15 l 186 138 l 186 262 l -1 262 l -187 262 l -187 138 l -187 15 l -189 12 b -208 0 -193 4 -200 0 b -227 12 -216 0 -223 4 l -228 15 l -228 244 l -228 473 l -227 476 b -217 487 -225 480 -221 484 "},v9a:{x_min:-21.78125,x_max:367.5,ha:375,o:"m 230 1031 b 238 1032 232 1032 235 1032 b 259 1014 245 1032 251 1027 b 367 662 330 906 367 782 b 364 602 367 641 367 621 b 232 317 352 488 304 384 b 57 120 155 245 103 187 b -1 18 31 84 6 40 b -19 4 -4 11 -12 4 l -21 4 l -21 159 l -21 315 l -16 315 b 96 335 10 315 62 324 b 315 695 227 380 315 527 b 313 738 315 709 314 724 b 224 991 304 825 273 916 b 216 1013 219 999 216 1007 b 230 1031 216 1021 220 1028 "},v9b:{x_min:-24.5,x_max:313.0625,ha:319,o:"m -24 -133 l -24 -5 l -20 -5 b -1 -19 -12 -5 -4 -11 b 142 -213 13 -61 74 -144 b 258 -376 196 -269 230 -315 b 313 -605 295 -449 313 -528 b 292 -742 313 -652 306 -699 b 288 -752 289 -748 288 -752 b 288 -752 288 -752 288 -752 b 292 -764 289 -753 291 -757 b 313 -907 306 -811 313 -860 b 292 -1045 313 -954 306 -1002 b 288 -1054 289 -1050 288 -1054 b 288 -1054 288 -1054 288 -1054 b 292 -1067 289 -1054 291 -1060 b 313 -1210 306 -1113 313 -1161 b 292 -1346 313 -1257 306 -1304 b 288 -1357 289 -1353 288 -1357 b 288 -1357 288 -1357 288 -1357 b 292 -1368 289 -1357 291 -1363 b 313 -1512 306 -1415 313 -1464 b 292 -1648 313 -1560 306 -1605 b 288 -1660 289 -1654 288 -1660 b 288 -1660 288 -1660 288 -1660 b 292 -1671 289 -1660 291 -1665 b 313 -1814 306 -1719 313 -1766 b 250 -2040 313 -1897 291 -1977 b 232 -2062 238 -2057 236 -2059 b 221 -2065 230 -2063 225 -2065 b 200 -2045 210 -2065 201 -2057 b 200 -2043 200 -2044 200 -2044 b 208 -2026 200 -2037 202 -2034 b 269 -1826 249 -1966 269 -1897 b 153 -1544 269 -1726 230 -1625 b -9 -1472 115 -1506 58 -1481 b -21 -1471 -14 -1471 -19 -1471 l -24 -1471 l -24 -1343 l -24 -1215 l -20 -1215 b -1 -1229 -12 -1215 -4 -1221 b 142 -1424 13 -1270 74 -1353 b 257 -1582 196 -1478 228 -1524 b 264 -1594 261 -1589 264 -1594 l 264 -1594 b 265 -1582 264 -1594 264 -1589 b 270 -1525 268 -1562 270 -1544 b 153 -1243 270 -1424 228 -1321 b -9 -1170 115 -1203 58 -1178 b -21 -1168 -14 -1170 -19 -1168 l -24 -1168 l -24 -1041 l -24 -913 l -20 -913 b -1 -927 -12 -913 -4 -918 b 142 -1121 13 -967 74 -1050 b 257 -1281 196 -1175 228 -1221 b 264 -1292 261 -1286 264 -1292 l 264 -1292 b 265 -1279 264 -1292 264 -1286 b 270 -1222 268 -1261 270 -1242 b 153 -941 270 -1121 228 -1018 b -9 -867 115 -900 58 -875 b -21 -866 -14 -867 -19 -866 l -24 -866 l -24 -738 l -24 -610 l -20 -610 b -1 -624 -12 -610 -4 -616 b 142 -818 13 -664 74 -749 b 257 -978 196 -873 228 -918 b 264 -989 261 -984 264 -989 l 264 -989 b 265 -977 264 -989 264 -984 b 270 -920 268 -959 270 -939 b 153 -638 270 -818 228 -716 b -9 -564 115 -598 58 -573 b -21 -563 -14 -564 -19 -563 l -24 -563 l -24 -435 l -24 -308 l -20 -308 b -1 -322 -12 -308 -4 -313 b 142 -516 13 -363 74 -446 b 257 -675 196 -571 228 -616 b 264 -687 261 -681 264 -687 l 264 -687 b 265 -674 264 -687 264 -681 b 270 -617 268 -656 270 -637 b 153 -335 270 -516 228 -413 b -9 -262 115 -295 58 -270 b -21 -260 -14 -262 -19 -260 l -24 -260 l -24 -133 "},v9c:{x_min:-166.0625,x_max:-25.859375,ha:0,o:"m -49 369 b -42 370 -46 369 -44 370 b -27 360 -36 370 -29 366 b -25 355 -27 359 -25 358 b -32 335 -25 351 -28 347 b -92 52 -66 248 -87 159 b -93 -1 -93 43 -93 20 b -92 -54 -93 -23 -93 -45 b -32 -337 -85 -162 -66 -251 b -25 -355 -27 -349 -25 -352 b -42 -371 -25 -365 -32 -371 b -61 -353 -50 -371 -51 -369 b -163 -63 -119 -262 -153 -165 b -166 -1 -166 -37 -166 -31 b -163 62 -166 30 -166 36 b -61 352 -153 163 -119 260 b -49 369 -54 365 -51 366 "},v9e:{x_min:0,x_max:607.0625,ha:619,o:"m 243 631 b 250 632 246 632 249 632 b 270 620 259 632 268 628 l 272 616 l 272 201 l 272 -212 l 270 -216 b 251 -229 268 -224 259 -229 b 227 -215 243 -229 240 -229 l 151 -142 b 32 -16 81 -80 53 -49 b 0 84 9 18 0 52 b 111 199 0 149 42 199 b 137 197 119 199 127 198 b 228 151 168 191 197 177 l 231 148 l 231 383 b 232 620 231 616 231 616 b 243 631 234 624 238 630 m 168 131 b 152 133 163 133 157 133 b 107 102 130 133 111 120 b 106 86 107 97 106 91 b 111 41 106 73 108 56 b 227 -152 125 -13 171 -90 l 231 -156 l 231 -37 l 231 80 l 225 87 b 168 131 210 111 190 126 m 347 631 b 353 632 348 632 351 632 b 374 620 363 632 371 628 b 375 383 375 616 375 616 l 375 148 l 377 151 b 492 199 415 183 454 199 b 537 191 507 199 522 197 b 607 84 582 176 607 134 b 583 0 607 58 598 29 b 455 -142 562 -40 533 -72 l 378 -215 b 355 -229 364 -229 362 -229 b 334 -216 345 -229 337 -224 l 333 -212 l 333 201 l 333 616 l 334 620 b 347 631 337 624 341 630 m 465 131 b 451 133 461 133 455 133 b 445 133 449 133 446 133 b 379 87 419 129 396 113 l 375 80 l 375 -37 l 375 -156 l 378 -152 b 499 81 451 -72 499 20 l 499 83 b 465 131 499 113 490 126 "},va3:{x_min:58.53125,x_max:228.671875,ha:294,o:"m 138 371 b 142 373 140 371 141 373 b 178 342 149 373 156 366 b 228 251 217 297 228 278 b 228 244 228 248 228 247 b 176 147 227 212 212 184 b 123 73 152 122 132 93 b 121 62 122 70 121 66 b 145 13 121 48 129 31 b 153 -2 151 6 153 1 b 149 -9 153 -5 152 -6 b 144 -11 148 -11 145 -11 b 129 -1 140 -11 136 -8 b 61 87 89 37 68 68 b 58 113 59 95 58 105 b 110 215 58 144 74 177 b 163 287 134 240 155 269 b 166 299 166 291 166 295 b 141 348 166 313 157 330 b 133 360 134 356 133 358 b 133 363 133 362 133 362 b 138 371 133 367 136 370 "},va5:{x_min:0,x_max:349.8125,ha:357,o:"m 88 302 b 103 303 93 302 98 303 b 202 224 149 303 191 270 b 205 199 204 216 205 208 b 178 129 205 173 196 147 l 175 126 l 182 127 b 307 249 236 142 284 190 b 313 259 308 254 311 258 b 329 267 317 265 323 267 b 349 247 340 267 349 259 b 201 -263 349 242 204 -258 b 182 -273 197 -270 190 -273 b 163 -260 174 -273 166 -269 b 161 -256 161 -259 161 -258 b 217 -59 161 -248 170 -220 b 272 129 247 43 272 127 b 272 129 272 129 272 129 b 264 122 272 129 268 126 b 140 80 227 94 183 80 b 36 115 102 80 65 91 b 0 194 10 136 0 165 b 88 302 0 244 32 292 "},va9:{x_min:-24.5,x_max:314.421875,ha:321,o:"m -24 -145 l -24 -5 l -20 -5 b 0 -23 -9 -5 -2 -12 b 27 -87 4 -38 14 -66 b 138 -220 53 -136 88 -177 b 235 -328 179 -255 208 -288 b 314 -592 287 -409 314 -501 b 292 -732 314 -639 307 -687 l 289 -742 l 294 -756 b 314 -896 307 -802 314 -849 b 292 -1035 314 -943 307 -991 l 289 -1045 l 294 -1057 b 314 -1197 307 -1104 314 -1152 b 292 -1338 314 -1246 307 -1292 l 289 -1347 l 294 -1360 b 314 -1500 307 -1407 314 -1454 b 273 -1689 314 -1565 300 -1628 b 250 -1712 265 -1710 261 -1712 b 228 -1691 236 -1712 228 -1704 l 228 -1685 l 234 -1675 b 270 -1507 258 -1621 270 -1564 b 98 -1193 270 -1381 209 -1261 b 40 -1174 76 -1179 58 -1174 b -10 -1189 24 -1174 8 -1178 b -20 -1192 -14 -1192 -16 -1192 l -24 -1192 l -24 -1052 l -24 -913 l -20 -913 b 0 -931 -9 -913 -2 -920 b 27 -995 4 -946 14 -974 b 138 -1128 53 -1043 88 -1085 b 257 -1275 190 -1172 228 -1220 b 262 -1283 259 -1279 262 -1283 l 262 -1283 b 269 -1249 264 -1282 268 -1260 b 270 -1206 270 -1233 270 -1220 b 98 -891 270 -1075 206 -957 b 40 -871 76 -877 58 -871 b -10 -886 24 -871 8 -875 b -20 -889 -14 -889 -16 -889 l -24 -889 l -24 -749 l -24 -610 l -20 -610 b 0 -628 -9 -610 -2 -617 b 27 -692 4 -644 14 -671 b 138 -825 53 -741 88 -782 b 257 -973 190 -870 228 -917 b 262 -981 259 -977 262 -981 l 262 -981 b 269 -946 264 -979 268 -957 b 270 -903 270 -931 270 -917 b 98 -588 270 -774 206 -655 b 40 -569 76 -574 58 -569 b -10 -584 24 -569 8 -574 b -20 -587 -14 -587 -16 -587 l -24 -587 l -24 -448 l -24 -308 l -20 -308 b 0 -326 -9 -308 -2 -315 b 27 -390 4 -341 14 -369 b 138 -523 53 -438 88 -480 b 257 -670 190 -567 228 -614 b 262 -678 259 -674 262 -678 b 262 -678 262 -678 262 -678 b 269 -644 264 -677 268 -656 b 270 -601 270 -628 270 -614 b 98 -285 270 -471 206 -352 b 40 -266 76 -273 58 -266 b -10 -281 24 -266 8 -272 b -20 -284 -14 -284 -16 -284 l -24 -284 l -24 -145 "},vaa:{x_min:-1.359375,x_max:752.703125,ha:768,o:"m 490 985 b 504 986 495 986 500 986 b 604 907 551 986 593 954 b 607 884 607 900 607 892 b 581 813 607 857 597 831 l 578 810 l 583 811 b 710 932 638 827 687 873 b 714 943 711 936 713 942 b 730 952 720 949 725 952 b 752 931 741 952 752 943 b 200 -946 752 927 204 -941 b 182 -957 197 -953 190 -957 b 163 -945 174 -957 166 -953 b 161 -939 161 -942 161 -942 b 217 -743 161 -931 170 -904 b 272 -555 247 -639 272 -555 b 272 -555 272 -555 272 -555 b 264 -560 272 -555 268 -557 b 140 -603 227 -589 182 -603 b 36 -567 102 -603 65 -592 b -1 -487 12 -548 -1 -517 b 17 -427 -1 -466 5 -445 b 103 -380 38 -395 70 -380 b 191 -433 137 -380 172 -398 b 205 -484 201 -448 205 -466 b 178 -553 205 -509 196 -535 l 175 -557 l 182 -555 b 307 -435 236 -539 284 -494 b 372 -213 308 -430 372 -215 b 372 -213 372 -213 372 -213 b 364 -219 372 -213 368 -216 b 240 -262 328 -247 283 -262 b 137 -226 202 -262 166 -249 b 99 -145 112 -206 99 -176 b 118 -84 99 -124 106 -104 b 204 -38 138 -54 171 -38 b 292 -91 238 -38 273 -56 b 306 -141 302 -106 306 -124 b 279 -212 306 -167 296 -194 l 276 -215 l 281 -213 b 408 -93 336 -198 385 -151 b 473 129 409 -88 473 127 b 473 129 473 129 473 129 b 465 122 473 129 469 126 b 341 80 428 94 383 80 b 236 115 303 80 266 91 b 200 195 213 136 200 165 b 217 256 200 217 206 238 b 304 303 239 287 272 303 b 393 249 338 303 374 285 b 406 199 402 234 406 217 b 379 129 406 173 397 148 l 377 126 l 382 127 b 509 248 436 142 485 190 b 574 470 510 254 574 469 b 574 470 574 470 574 470 b 566 464 574 470 570 467 b 442 421 529 435 484 421 b 337 458 404 421 367 433 b 300 538 314 477 300 508 b 318 598 300 559 306 580 b 404 645 340 630 372 645 b 494 592 439 645 475 627 b 507 541 502 577 507 559 b 480 471 507 516 498 489 l 477 467 l 483 470 b 608 589 537 485 586 531 b 675 811 611 595 675 810 b 675 811 675 811 675 811 b 666 806 675 811 671 809 b 543 763 628 777 585 763 b 438 799 504 763 468 775 b 401 878 412 820 401 849 b 490 985 401 928 434 977 "},vab:{x_min:0,x_max:272.21875,ha:278,o:"m 243 631 b 250 632 246 632 249 632 b 270 620 259 632 268 628 l 272 616 l 272 201 l 272 -212 l 270 -216 b 251 -229 268 -224 259 -229 b 227 -215 243 -229 240 -229 l 151 -142 b 32 -16 81 -80 53 -49 b 0 84 9 18 0 52 b 111 199 0 149 42 199 b 137 197 119 199 127 198 b 228 151 168 191 197 177 l 231 148 l 231 383 b 232 620 231 616 231 616 b 243 631 234 624 238 630 m 168 131 b 152 133 163 133 157 133 b 107 102 130 133 111 120 b 106 86 107 97 106 91 b 111 41 106 73 108 56 b 227 -152 125 -13 171 -90 l 231 -156 l 231 -37 l 231 80 l 225 87 b 168 131 210 111 190 126 "},vad:{x_min:0,x_max:873.828125,ha:892,o:"m 0 0 l 0 703 l 81 703 l 164 703 l 164 0 l 164 -705 l 81 -705 l 0 -705 l 0 0 m 225 0 l 225 703 l 246 703 l 268 703 l 268 366 l 268 30 l 274 36 b 314 79 284 44 302 63 b 413 302 357 137 392 213 b 432 327 419 324 421 327 b 449 306 443 327 447 322 b 611 115 457 195 529 115 b 651 122 624 115 638 117 b 728 316 705 140 724 188 b 729 388 728 342 729 366 b 671 635 729 533 711 602 b 581 662 649 652 616 662 b 477 637 545 662 510 653 l 475 635 l 477 634 b 503 627 488 632 495 631 b 545 556 532 612 545 584 b 491 480 545 524 526 491 b 465 474 481 476 473 474 b 379 563 417 474 379 516 b 389 602 379 576 382 588 b 541 691 409 641 479 681 b 582 694 555 692 568 694 b 865 462 714 694 834 598 b 873 392 871 440 873 416 b 865 317 873 367 871 341 b 639 84 839 194 748 101 b 612 83 630 83 620 83 b 511 116 577 83 543 94 b 504 120 509 119 506 120 b 504 120 504 120 504 120 b 469 59 504 120 488 93 l 432 -1 l 469 -61 b 504 -122 488 -94 504 -122 b 504 -122 504 -122 504 -122 b 511 -117 506 -122 509 -120 b 612 -84 543 -95 577 -84 b 665 -91 630 -84 647 -87 b 869 -338 771 -122 850 -216 b 873 -392 872 -356 873 -374 b 798 -595 873 -469 847 -539 b 581 -695 741 -662 660 -695 b 406 -626 517 -695 454 -671 b 381 -563 389 -607 381 -585 b 465 -477 381 -519 413 -477 b 545 -559 514 -477 545 -519 b 503 -628 545 -587 532 -613 b 477 -635 495 -632 488 -634 l 475 -637 l 477 -638 b 581 -663 510 -655 545 -663 b 671 -637 616 -663 649 -653 b 729 -391 711 -603 729 -534 b 728 -317 729 -367 728 -344 b 623 -117 722 -173 698 -124 b 611 -116 619 -116 615 -116 b 449 -308 528 -116 457 -198 b 432 -328 447 -323 443 -328 b 413 -303 421 -328 419 -326 b 314 -80 392 -215 357 -138 b 274 -37 302 -65 284 -45 l 268 -31 l 268 -367 l 268 -705 l 246 -705 l 225 -705 l 225 0 "},vb1:{x_min:78.9375,x_max:485.921875,ha:417,o:"m 362 378 b 378 380 367 380 372 380 b 472 348 415 380 453 367 b 485 315 481 338 485 327 b 462 273 485 298 477 281 b 439 267 454 269 446 267 b 398 290 424 267 409 274 b 344 319 385 309 364 319 b 281 269 315 319 289 301 b 279 262 280 266 279 262 b 276 256 279 260 277 258 b 274 249 276 254 274 251 b 238 127 273 248 257 192 b 201 4 217 61 201 5 b 166 -1 198 -1 200 -1 b 153 -1 163 -1 157 -1 b 141 -1 148 -1 144 -1 b 104 4 106 -1 107 -1 b 104 6 104 5 104 5 b 142 144 104 13 110 34 b 182 278 164 219 181 276 b 183 288 182 281 182 285 b 185 302 185 292 185 298 b 164 330 185 317 176 328 b 159 330 163 330 161 330 b 102 302 140 330 119 320 b 91 294 95 295 93 294 b 88 294 91 294 89 294 b 78 303 83 294 78 298 b 81 312 78 306 78 309 b 200 373 106 347 160 373 b 215 371 205 373 209 371 b 266 335 235 367 254 353 b 269 331 268 333 269 331 b 269 331 269 331 269 331 b 273 335 269 331 270 334 b 362 378 298 359 330 376 "},vb3:{x_min:0,x_max:227.3125,ha:232,o:"m 91 213 b 100 215 93 215 96 215 b 227 58 167 215 224 144 b 227 52 227 56 227 54 b 61 -201 227 -43 164 -138 b 29 -216 44 -212 36 -216 b 23 -210 27 -216 24 -213 b 21 -205 21 -208 21 -206 b 34 -192 21 -201 25 -197 b 122 -55 89 -161 122 -106 b 104 6 122 -33 117 -12 l 103 9 l 96 9 b 4 79 57 9 17 38 b 0 112 1 90 0 101 b 91 213 0 163 36 209 "},vb4:{x_min:-597.53125,x_max:596.171875,ha:608,o:"m -533 324 b -525 327 -530 326 -528 327 b -504 305 -514 327 -504 317 b -504 305 -504 305 -504 305 b -513 284 -504 299 -504 299 b -556 112 -541 226 -556 167 b -545 33 -556 84 -552 58 b -524 -20 -541 15 -532 -9 l -522 -23 l -491 15 l -413 111 b -355 174 -367 169 -363 174 b -351 174 -353 174 -352 174 b -254 86 -343 174 -348 179 b -168 -1 -208 37 -168 -1 b -100 84 -168 -1 -137 37 b -23 173 -28 173 -29 172 b -19 174 -21 174 -20 174 b -8 173 -14 174 -10 173 b 80 86 -5 172 13 151 b 166 -1 127 37 166 -1 b 235 84 166 -1 197 37 b 311 173 306 173 304 172 b 317 174 313 174 314 174 b 326 173 319 174 323 173 b 490 11 329 172 366 134 l 502 -1 l 530 34 b 568 76 560 72 563 74 b 575 77 570 77 573 77 b 596 56 586 77 596 68 b 594 48 596 54 596 51 b 417 -172 592 41 424 -166 b 405 -176 415 -174 409 -176 b 396 -174 401 -176 398 -176 b 307 -87 393 -173 372 -152 b 221 -1 259 -38 221 -1 b 152 -86 221 -1 190 -38 b 76 -176 81 -174 83 -173 b 70 -176 74 -176 73 -176 b 61 -174 66 -176 62 -174 b -27 -87 58 -173 38 -152 b -114 -1 -74 -38 -112 -1 b -182 -86 -114 -1 -145 -38 b -258 -176 -253 -174 -253 -173 b -264 -176 -259 -176 -262 -176 b -274 -174 -268 -176 -272 -174 b -438 -11 -277 -173 -348 -102 l -449 0 l -479 -37 b -524 -80 -513 -80 -514 -80 l -524 -80 b -553 -52 -534 -80 -540 -74 b -597 109 -583 -8 -597 48 b -560 280 -597 165 -585 224 b -533 324 -548 310 -540 322 "},vb6:{x_min:0,x_max:556.6875,ha:568,o:"m 289 545 b 298 546 292 545 295 546 b 318 533 306 546 315 541 b 319 428 319 530 319 528 l 319 327 l 334 327 b 526 223 412 326 485 285 b 543 172 537 206 543 190 b 447 76 543 122 503 76 b 445 76 446 76 446 76 b 359 165 394 77 359 119 b 368 205 359 179 362 192 b 441 251 382 233 412 251 b 455 249 446 251 451 251 b 460 248 458 249 460 248 b 460 248 460 248 460 248 b 454 254 460 249 458 251 b 334 295 419 280 378 294 l 319 295 l 319 4 l 319 -287 l 321 -285 b 328 -285 322 -285 325 -285 b 524 -99 424 -277 507 -198 b 541 -79 526 -84 530 -79 b 556 -97 551 -79 556 -84 b 548 -133 556 -105 553 -117 b 334 -317 521 -233 434 -306 b 322 -319 329 -317 323 -317 l 319 -319 l 319 -424 b 319 -471 319 -444 319 -459 b 313 -541 319 -544 318 -535 b 298 -548 308 -545 303 -548 b 279 -534 289 -548 281 -542 b 277 -424 277 -531 277 -530 l 277 -317 l 273 -317 b 13 -95 153 -305 51 -217 b 0 2 4 -62 0 -29 b 182 295 0 126 66 238 b 274 324 210 309 249 320 l 277 324 l 277 427 b 279 533 277 528 277 530 b 289 545 281 538 285 542 m 277 2 b 277 291 277 161 277 291 b 268 288 277 291 273 290 b 144 1 179 265 144 184 b 276 -284 144 -199 175 -267 l 277 -285 l 277 2 "},vb7:{x_min:-176.9375,x_max:251.8125,ha:257,o:"m -8 631 b -1 632 -6 632 -4 632 b 19 620 8 632 16 628 b 20 503 20 616 20 614 b 20 391 20 442 20 391 b 84 424 20 391 49 406 l 147 456 l 152 456 b 153 456 153 456 153 456 b 175 435 166 456 175 446 b 172 427 175 433 174 430 b 92 380 170 420 172 421 l 20 342 l 20 245 l 20 148 l 21 151 b 137 199 59 183 99 199 b 182 191 152 199 167 197 b 251 84 227 176 251 134 b 228 0 251 58 243 29 b 100 -142 206 -40 178 -72 l 23 -215 b 0 -229 9 -229 6 -229 b -20 -216 -9 -229 -17 -224 b -21 54 -21 -212 -21 -212 b -21 322 -21 201 -21 322 b -85 290 -21 322 -50 308 l -148 256 l -153 256 b -155 256 -155 256 -155 256 b -176 277 -167 256 -176 266 b -174 285 -176 280 -175 283 b -93 333 -171 294 -174 292 l -21 370 l -21 494 b -20 620 -21 616 -21 616 b -8 631 -17 624 -13 630 m 110 131 b 96 133 106 133 100 133 b 89 133 93 133 91 133 b 24 87 63 129 40 113 l 20 80 l 20 -37 l 20 -156 l 23 -152 b 144 81 96 -72 144 20 l 144 83 b 110 131 144 113 134 126 "},vb9:{x_min:-122.5,x_max:121.140625,ha:124,o:"m -16 145 b 0 147 -10 147 -5 147 b 121 -1 66 147 121 77 b 114 -49 121 -16 118 -33 b -1 -148 95 -112 47 -148 b -85 -106 -31 -148 -61 -134 b -122 -1 -110 -76 -122 -38 b -16 145 -122 68 -81 134 m 12 111 b 0 113 8 113 4 113 b -68 22 -29 113 -61 73 b -70 0 -69 15 -70 6 b -13 -113 -70 -49 -47 -98 b -1 -115 -9 -115 -5 -115 b 63 -40 24 -115 53 -83 b 68 -1 66 -27 68 -15 b 12 111 68 48 46 97 "},vba:{x_min:-118.421875,x_max:597.53125,ha:381,o:"m 460 574 b 464 574 461 574 462 574 b 488 574 470 574 481 574 b 500 573 491 574 498 574 b 594 503 543 570 588 538 b 597 488 596 498 597 494 b 528 417 597 449 564 417 b 502 423 519 417 510 419 b 465 481 477 434 465 458 b 488 528 465 499 472 516 b 490 530 490 530 490 530 b 490 530 490 530 490 530 b 468 517 488 530 475 523 b 349 340 419 485 377 420 b 347 330 348 334 347 330 b 383 328 347 328 363 328 b 428 326 423 328 424 328 b 442 302 438 320 442 312 b 430 281 442 294 438 285 b 385 276 424 277 426 276 l 377 276 l 332 276 l 330 269 b 178 -117 303 126 250 -9 b 1 -249 129 -194 69 -237 b -20 -251 -6 -251 -13 -251 b -114 -187 -65 -251 -100 -227 b -118 -156 -117 -177 -118 -166 b -51 -84 -118 -116 -91 -84 b -31 -87 -46 -84 -39 -86 b 16 -152 0 -95 16 -124 b -12 -205 16 -173 8 -194 b -16 -208 -14 -206 -16 -208 b -14 -208 -16 -208 -14 -208 b -9 -206 -14 -208 -12 -208 b 74 -124 23 -197 54 -166 b 172 224 98 -79 125 22 b 185 276 178 252 183 274 b 185 276 185 276 185 276 b 141 276 185 276 181 276 b 91 280 96 276 96 276 b 77 302 83 285 77 294 b 91 326 77 312 83 320 b 148 328 95 328 96 328 l 198 330 l 202 341 b 460 574 249 473 351 566 "},vbf:{x_min:-53.078125,x_max:513.140625,ha:485,o:"m 185 383 b 196 384 187 383 191 384 b 277 334 230 384 259 365 b 288 301 281 324 288 306 b 288 297 288 298 288 297 b 294 302 289 297 291 299 b 394 370 323 338 367 367 b 404 371 398 370 401 371 b 510 272 453 371 498 328 b 513 237 513 262 513 251 b 507 172 513 217 511 192 b 326 -34 487 59 412 -26 b 314 -36 322 -36 318 -36 b 274 -24 298 -36 283 -31 l 265 -16 b 224 44 246 -1 232 20 b 223 49 224 47 223 49 b 223 49 223 49 223 49 b 149 -197 221 48 149 -194 b 149 -198 149 -197 149 -198 b 170 -210 149 -202 155 -205 b 187 -215 174 -210 175 -212 b 204 -231 201 -219 204 -222 b 197 -245 204 -240 202 -242 l 194 -248 l 76 -248 l -42 -248 l -46 -245 b -53 -231 -51 -242 -53 -240 b -35 -215 -53 -222 -49 -217 b -13 -210 -21 -212 -20 -212 b -6 -208 -10 -209 -8 -208 b 0 -206 -6 -208 -2 -206 b 25 -188 13 -201 21 -195 b 163 280 28 -183 163 276 b 166 291 163 283 164 287 b 167 302 167 295 167 299 b 155 324 167 315 161 324 b 155 324 155 324 155 324 b 65 230 125 322 85 280 b 53 215 61 217 58 215 b 51 215 53 215 51 215 b 42 224 46 215 42 217 b 57 263 42 231 47 244 b 140 360 77 305 104 337 b 152 370 144 365 149 369 b 185 383 157 376 172 381 m 374 306 b 366 308 371 308 368 308 b 300 273 348 308 321 294 b 284 254 288 262 287 259 b 280 242 283 249 281 245 b 257 169 279 240 270 213 l 236 98 l 236 93 b 251 48 238 77 243 61 b 279 27 258 37 272 27 b 281 27 279 27 280 27 b 291 31 281 27 287 30 b 396 170 334 52 378 109 b 406 247 402 197 406 224 b 401 277 406 259 405 270 b 374 306 397 290 383 303 "},vc3:{x_min:-10.890625,x_max:299.4375,ha:294,o:"m 136 460 b 142 462 137 462 140 462 b 166 449 152 462 161 456 b 171 428 168 446 168 445 b 288 131 194 322 238 209 b 298 115 295 120 296 117 b 299 106 298 112 299 109 b 273 81 299 91 287 81 b 255 86 268 81 261 83 b 155 116 225 104 183 116 l 152 116 l 149 108 b 141 83 148 102 144 91 b 134 48 137 69 134 58 b 149 9 134 34 140 24 b 153 -1 152 5 153 1 b 149 -9 153 -5 152 -6 b 144 -11 148 -11 147 -11 b 122 2 138 -11 133 -6 b 95 61 104 20 95 38 b 107 108 95 74 99 90 b 108 113 107 111 108 112 b 107 113 108 113 108 113 b 102 113 106 113 104 113 b 31 86 76 108 53 98 b 14 80 24 81 20 80 b -10 106 0 80 -10 91 b 0 131 -10 115 -9 116 b 115 430 49 209 91 317 b 136 460 119 451 123 456 "},vd0:{x_min:-10.890625,x_max:299.4375,ha:294,o:"m 44 174 b 51 174 47 174 49 174 b 68 173 55 174 61 174 l 287 112 l 551 40 b 615 20 617 22 609 23 b 626 0 622 16 626 8 b 615 -22 626 -9 622 -18 b 613 -23 613 -23 613 -23 b 613 -23 613 -23 613 -23 b 287 -113 613 -24 597 -29 l 68 -174 b 53 -176 61 -176 57 -176 b 39 -172 47 -176 43 -174 b 27 -151 31 -167 27 -159 b 39 -129 27 -141 31 -133 b 230 -74 43 -124 20 -131 l 370 -36 l 468 -9 b 498 0 484 -4 498 -1 b 468 8 498 0 484 2 l 370 34 l 230 73 b 40 126 28 129 43 124 b 27 149 31 131 27 140 b 44 174 27 161 34 170 m 205 110 l 205 300 b 205 330 245 330 245 300 l 245 300 l 245 -300 b 245 -330 205 -330 205 -300 l 205 -300 l 205 110 l 345 90 m 345 90 l 345 330 b 345 360 385 360 385 330 l 385 330 l 385 -270 b 385 -300 345 -300 345 -270 l 345 -270 l 345 90 "},vd1:{x_min:-20,x_max:320,ha:257,o:"m -8 200 b -8 210 8 200 16 200 l 20 148 -199 l 23 -615 b 0 -629 9 -629 6 -629 l -21 -612 l -21 -201 l -21 216 l -20 200 m 16 200 l 310 0 l 240 0 l 16 140 l 16 -120 l 240 0 l 310 0 l 16 -200 "},vd2:{x_min:0,x_max:430.75,ha:386,o:"m 0 200 l 0 -200 l 430 -200 l 430 200 l 0 200 "},vd3:{x_min:0,x_max:430.75,ha:386,o:"m 0 200 l 0 -200 l 430 -200 l 430 200 l 0 200 l 50 150 l 380 150 l 380 -150 l 50 -150 l 50 150 "},vd4:{x_min:0,x_max:430.75,ha:360,o:"m 0 150 l 0 -150 l 430 -150 l 430 150 l 0 150 "},vd5:{x_min:0,x_max:430.75,ha:360,o:"m 0 150 l 0 -150 l 430 -150 l 430 150 l 0 150 l 50 100 l 380 100 l 380 -100 l 50 -100 l 50 100"},vd6:{x_min:0,x_max:430.75,ha:360,o:"m -146 537 b -138 538 -143 538 -141 538 b -118 525 -129 538 -121 533 b -117 390 -117 522 -117 521 b -115 259 -117 268 -117 259 b -115 259 -115 259 -115 259 b -59 272 -104 263 -62 272 b -39 259 -50 272 -42 267 b -37 209 -38 257 -37 233 b -39 159 -37 185 -38 162 b -85 138 -43 149 -44 149 l -117 131 l -117 21 b -115 -88 -117 -80 -117 -88 b -115 -88 -115 -88 -115 -88 b -59 -75 -104 -84 -62 -75 b -44 -81 -52 -75 -48 -77 b -38 -124 -38 -87 -38 -85 b -38 -138 -38 -124 -38 -138 b -38 -152 -38 -138 -38 -152 b -44 -195 -38 -191 -38 -190 b -85 -209 -48 -200 -48 -200 l -117 -217 l -117 -349 b -118 -486 -117 -481 -117 -482 b -138 -499 -121 -494 -129 -499 b -153 -493 -143 -499 -149 -497 b -159 -415 -158 -487 -159 -496 b -159 -355 -159 -398 -159 -379 b -159 -227 -159 -284 -159 -227 b -205 -238 -159 -227 -180 -232 b -250 -249 -230 -244 -250 -249 b -251 -386 -251 -249 -251 -311 b -252 -525 -251 -521 -251 -522 b -272 -538 -255 -534 -264 -538 b -287 -532 -277 -538 -283 -536 b -293 -452 -292 -527 -293 -536 b -293 -391 -293 -436 -293 -415 b -294 -260 -293 -269 -293 -260 b -294 -260 -294 -260 -294 -260 b -348 -272 -306 -264 -345 -272 b -368 -259 -357 -272 -365 -267 b -369 -209 -369 -257 -369 -233 b -368 -159 -369 -185 -369 -162 b -323 -139 -364 -149 -362 -148 l -293 -131 l -293 -22 b -294 87 -293 80 -293 87 b -294 87 -294 87 -294 87 b -348 75 -306 84 -345 75 b -368 88 -357 75 -365 80 b -369 138 -369 91 -369 114 b -368 188 -369 162 -369 186 b -323 209 -364 198 -362 199 l -293 216 l -293 349 b -292 486 -293 481 -293 482 b -272 499 -288 494 -280 499 b -257 493 -266 499 -261 497 b -251 414 -251 487 -251 496 b -251 354 -251 398 -251 378 b -251 226 -251 284 -251 226 b -205 238 -250 226 -230 231 b -159 249 -180 244 -159 249 b -159 385 -159 249 -159 310 b -157 525 -159 521 -159 522 b -146 537 -156 530 -151 535 z m -159 11 b -159 120 -159 98 -159 120 l -159 120 b -175 116 -160 120 -167 119 b -221 105 -184 114 -204 109 l -251 98 l -251 -12 b -251 -121 -251 -72 -251 -121 b -205 -110 -250 -121 -230 -116 b -159 -99 -180 -104 -159 -99 b -159 11 -159 -99 -159 -49 z m 89 517 b 97 519 92 518 94 519 b 117 505 106 519 114 513 b 119 376 119 502 119 501 l 119 249 l 145 258 b 176 267 169 266 172 267 b 177 267 176 267 177 267 b 196 255 186 267 192 263 l 197 252 l 197 205 b 197 181 197 195 197 187 b 193 149 197 153 197 153 b 152 131 190 144 187 143 l 119 120 l 119 10 b 119 -100 119 -62 119 -100 b 145 -91 120 -100 131 -96 b 173 -82 159 -86 171 -82 b 176 -81 174 -81 175 -81 b 196 -94 185 -81 193 -87 b 198 -151 197 -97 198 -125 b 197 -194 198 -172 197 -192 b 153 -218 193 -203 192 -204 l 119 -230 l 119 -367 l 118 -504 l 117 -507 b 97 -519 113 -514 105 -519 b 82 -512 92 -519 87 -517 b 76 -434 77 -507 76 -516 b 76 -374 76 -418 76 -398 b 76 -245 76 -303 76 -245 b 52 -254 76 -245 65 -249 b 19 -263 34 -260 25 -263 b 6 -257 13 -263 10 -261 b 0 -214 0 -251 0 -253 b 0 -200 0 -210 0 -205 b 0 -188 0 -196 0 -192 b 6 -143 0 -147 0 -149 b 46 -126 10 -139 10 -139 l 76 -115 l 76 -5 b 76 106 76 56 76 106 b 51 98 76 106 64 102 b 18 89 34 92 25 89 b 6 95 13 89 10 91 b 0 139 0 101 0 99 b 0 153 0 143 0 148 b 0 179 0 163 0 172 b 44 225 0 215 3 211 l 76 236 l 76 369 b 78 505 76 501 76 502 b 89 517 80 510 85 515 z "},vd7:{x_min:0,x_max:430.75,ha:360,o:"m 283 633 b 291 634 286 634 289 634 b 311 621 300 634 308 629 b 313 505 313 618 313 617 b 313 393 313 443 313 393 b 378 425 313 393 343 407 l 443 458 l 448 458 b 449 458 449 458 449 458 b 471 437 462 458 471 448 b 469 429 471 434 470 432 b 387 382 466 421 469 423 l 313 344 l 313 247 l 313 150 l 315 152 b 433 201 353 184 394 201 b 479 193 448 201 464 198 b 549 86 524 177 549 135 b 526 1 549 59 541 29 b 395 -143 504 -39 475 -71 b 316 -214 351 -182 341 -191 b 292 -229 302 -228 300 -229 b 272 -216 283 -229 275 -224 b 271 55 271 -212 271 -212 b 270 323 271 203 270 323 b 205 291 270 323 241 308 l 140 258 l 135 258 b 134 258 135 258 134 258 b 112 279 121 258 112 267 b 114 287 112 281 113 284 b 196 334 117 295 114 293 l 271 371 l 271 495 b 272 621 271 617 271 618 b 283 633 274 626 279 631 z m 404 133 b 391 134 400 134 395 134 b 384 134 388 134 386 134 b 318 88 358 130 335 114 l 313 81 l 313 -37 l 313 -156 l 316 -152 b 439 83 391 -71 439 22 l 439 84 b 404 133 439 115 430 128 z m -8 633 l -8 633 b 0 634 -6 634 -3 634 b 20 621 8 634 17 629 b 21 384 21 618 21 617 l 21 150 l 24 152 b 141 201 62 184 102 201 b 187 193 157 201 172 198 b 257 86 232 177 257 135 b 234 1 257 59 250 29 b 103 -143 212 -39 183 -71 b 24 -214 60 -182 49 -191 b 0 -229 10 -228 8 -229 b -20 -216 -9 -229 -17 -224 l -21 -212 l -21 203 l -21 618 l -20 621 b -8 633 -18 626 -13 631 z m 113 133 l 113 133 b 99 134 109 134 103 134 b 93 134 97 134 94 134 b 26 88 66 130 43 114 l 21 81 l 21 -37 l 21 -156 l 25 -152 b 148 83 99 -71 148 22 l 148 84 b 113 133 148 115 138 128 z "}},cssFontWeight:"normal",ascender:1903,underlinePosition:-125,cssFontStyle:"normal",boundingBox:{yMin:-2065.375,xMin:-695.53125,yMax:1901.578125,xMax:1159.671875},resolution:1e3,descender:-2066,familyName:"VexFlow-18",lineHeight:4093,underlineThickness:50};function d(t,e,i,s,n,r){let o,a,l,h=0;function c(){return e+t[h++]*s}function u(){return i+t[h++]*n}for(;h<t.length;)switch(o=t[h++],o){case"m":case"l":r[o](c(),u());break;case"q":a=c(),l=u(),r.q(c(),u(),a,l);break;case"b":a=c(),l=u(),r.b(c(),u(),c(),u(),a,l)}}class f extends l{static loadMetrics(t,e,i){const n=t.glyphs[e];if(!n)throw new s.RERR("BadGlyph",`Glyph ${e} does not exist in font.`);const r=n.x_min,o=n.x_max,a=n.ha;let l;if(n.o)return i?n.cached_outline?l=n.cached_outline:(l=n.o.split(" "),n.cached_outline=l):(n.cached_outline&&delete n.cached_outline,l=n.o.split(" ")),{x_min:r,x_max:o,ha:a,outline:l};throw new s.RERR("BadGlyph",`Glyph ${e} has no outline defined.`)}static renderGlyph(t,e,i,s,n,r){const o=72*s/(100*u.resolution),a=f.loadMetrics(u,n,!r);f.renderOutline(t,a.outline,o,e,i)}static renderOutline(t,e,i,s,n){t.beginPath(),t.moveTo(s,n),d(e,s,n,i,-i,{m:t.moveTo.bind(t),l:t.lineTo.bind(t),q:t.quadraticCurveTo.bind(t),b:t.bezierCurveTo.bind(t)}),t.fill()}static getOutlineBoundingBox(t,e,i,s){const n=new h;return d(t,i,s,e,-e,{m:n.addPoint.bind(n),l:n.addPoint.bind(n),q:n.addQuadraticCurve.bind(n),b:n.addBezierCurve.bind(n)}),new c(n.x1,n.y1,n.width(),n.height())}constructor(t,e,i){super(),this.setAttribute("type","Glyph"),this.code=t,this.point=e,this.options={cache:!0,font:u},this.metrics=null,this.x_shift=0,this.y_shift=0,this.originShift={x:0,y:0},i?this.setOptions(i):this.reset()}setOptions(t){s.Merge(this.options,t),this.reset()}setPoint(t){return this.point=t,this}setStave(t){return this.stave=t,this}setXShift(t){return this.x_shift=t,this}setYShift(t){return this.y_shift=t,this}reset(){this.scale=72*this.point/(100*this.options.font.resolution),this.metrics=f.loadMetrics(this.options.font,this.code,this.options.cache),this.bbox=f.getOutlineBoundingBox(this.metrics.outline,this.scale,0,0)}getMetrics(){if(!this.metrics)throw new s.RuntimeError("BadGlyph",`Glyph ${this.code} is not initialized.`);return{x_min:this.metrics.x_min*this.scale,x_max:this.metrics.x_max*this.scale,width:this.bbox.getW(),height:this.bbox.getH()}}setOriginX(t){const{bbox:e}=this,i=(t-Math.abs(e.getX()/e.getW()))*e.getW();this.originShift.x=-i}setOriginY(t){const{bbox:e}=this,i=(t-Math.abs(e.getY()/e.getH()))*e.getH();this.originShift.y=-i}setOrigin(t,e){this.setOriginX(t),this.setOriginY(e)}render(t,e,i){if(!this.metrics)throw new s.RuntimeError("BadGlyph",`Glyph ${this.code} is not initialized.`);const n=this.metrics.outline,r=this.scale;this.setRendered(),this.applyStyle(t),f.renderOutline(t,n,r,e+this.originShift.x,i+this.originShift.y),this.restoreStyle(t)}renderToStave(t){if(this.checkContext(),!this.metrics)throw new s.RuntimeError("BadGlyph",`Glyph ${this.code} is not initialized.`);if(!this.stave)throw new s.RuntimeError("GlyphError","No valid stave");const e=this.metrics.outline,i=this.scale;this.setRendered(),this.applyStyle(),f.renderOutline(this.context,e,i,t+this.x_shift,this.stave.getYForGlyphs()+this.y_shift),this.restoreStyle()}}const m={STEM_WIDTH:1.5,STEM_HEIGHT:35,STAVE_LINE_THICKNESS:1,RESOLUTION:16384,DEFAULT_NOTATION_FONT_SCALE:39,DEFAULT_TABLATURE_FONT_SCALE:39,SLASH_NOTEHEAD_WIDTH:15,TEXT_HEIGHT_OFFSET_HACK:1,IsKerned:!0,clefProperties:t=>{if(!t)throw new s.RERR("BadArgument","Invalid clef: "+t);const e=m.clefProperties.values[t];if(!e)throw new s.RERR("BadArgument","Invalid clef: "+t);return e}};m.clefProperties.values={treble:{line_shift:0},bass:{line_shift:6},tenor:{line_shift:4},alto:{line_shift:3},soprano:{line_shift:1},percussion:{line_shift:0},"mezzo-soprano":{line_shift:2},"baritone-c":{line_shift:5},"baritone-f":{line_shift:5},subbass:{line_shift:7},french:{line_shift:-1}},m.keyProperties=(t,e,i)=>{void 0===e&&(e="treble");const n={octave_shift:0};"object"==typeof i&&s.Merge(n,i);const r=t.split("/");if(r.length<2)throw new s.RERR("BadArguments",`Key must have note + octave and an optional glyph: ${t}`);const o=r[0].toUpperCase(),a=m.keyProperties.note_values[o];if(!a)throw new s.RERR("BadArguments","Invalid key name: "+o);a.octave&&(r[1]=a.octave);let l=parseInt(r[1],10);l+=-1*n.octave_shift;let h=(7*l-28+a.index)/2;h+=m.clefProperties(e).line_shift;let c=0;h<=0&&2*h%2==0&&(c=1),h>=6&&2*h%2==0&&(c=-1);const u=void 0!==a.int_val?12*l+a.int_val:null,d=a.code,f=a.shift_right;let p={};if(r.length>2&&r[2]){const t=r[2].toUpperCase();p=m.keyProperties.customNoteHeads[t]||{}}return{key:o,octave:l,line:h,int_value:u,accidental:a.accidental,code:d,stroke:c,shift_right:f,displaced:!1,...p}},m.keyProperties.note_values={C:{index:0,int_val:0,accidental:null},CN:{index:0,int_val:0,accidental:"n"},"C#":{index:0,int_val:1,accidental:"#"},"C##":{index:0,int_val:2,accidental:"##"},CB:{index:0,int_val:-1,accidental:"b"},CBB:{index:0,int_val:-2,accidental:"bb"},D:{index:1,int_val:2,accidental:null},DN:{index:1,int_val:2,accidental:"n"},"D#":{index:1,int_val:3,accidental:"#"},"D##":{index:1,int_val:4,accidental:"##"},DB:{index:1,int_val:1,accidental:"b"},DBB:{index:1,int_val:0,accidental:"bb"},E:{index:2,int_val:4,accidental:null},EN:{index:2,int_val:4,accidental:"n"},"E#":{index:2,int_val:5,accidental:"#"},"E##":{index:2,int_val:6,accidental:"##"},EB:{index:2,int_val:3,accidental:"b"},EBB:{index:2,int_val:2,accidental:"bb"},F:{index:3,int_val:5,accidental:null},FN:{index:3,int_val:5,accidental:"n"},"F#":{index:3,int_val:6,accidental:"#"},"F##":{index:3,int_val:7,accidental:"##"},FB:{index:3,int_val:4,accidental:"b"},FBB:{index:3,int_val:3,accidental:"bb"},G:{index:4,int_val:7,accidental:null},GN:{index:4,int_val:7,accidental:"n"},"G#":{index:4,int_val:8,accidental:"#"},"G##":{index:4,int_val:9,accidental:"##"},GB:{index:4,int_val:6,accidental:"b"},GBB:{index:4,int_val:5,accidental:"bb"},A:{index:5,int_val:9,accidental:null},AN:{index:5,int_val:9,accidental:"n"},"A#":{index:5,int_val:10,accidental:"#"},"A##":{index:5,int_val:11,accidental:"##"},AB:{index:5,int_val:8,accidental:"b"},ABB:{index:5,int_val:7,accidental:"bb"},B:{index:6,int_val:11,accidental:null},BN:{index:6,int_val:11,accidental:"n"},"B#":{index:6,int_val:12,accidental:"#"},"B##":{index:6,int_val:13,accidental:"##"},BB:{index:6,int_val:10,accidental:"b"},BBB:{index:6,int_val:9,accidental:"bb"},R:{index:6,int_val:9,rest:!0},X:{index:6,accidental:"",octave:4,code:"v3e",shift_right:5.5}},m.keyProperties.customNoteHeads={D0:{code:"v27",shift_right:0,stem_up_x_offset:0,stem_down_x_offset:0,stem_up_y_offset:-1,stem_down_y_offset:0},D1:{code:"v2d",shift_right:-.5},D2:{code:"v22",shift_right:-.5},D3:{code:"v70",shift_right:-.5},T0:{code:"v49",shift_right:-2,stem_up_y_offset:-4,stem_down_y_offset:4},T1:{code:"v93",shift_right:.5,stem_up_y_offset:-4,stem_down_y_offset:4},T2:{code:"v40",shift_right:.5,stem_up_y_offset:-4,stem_down_y_offset:4},T3:{code:"v7d",shift_right:.5,stem_up_y_offset:-4,stem_down_y_offset:4},X0:{code:"v92",stem_up_x_offset:-2,stem_down_x_offset:0,stem_up_y_offset:4,stem_down_y_offset:4},X1:{code:"v95",shift_right:-.5,stem_up_y_offset:4,stem_down_y_offset:4},X2:{code:"v3e",shift_right:.5,stem_up_y_offset:4,stem_down_y_offset:4},X3:{code:"v3b",shift_right:0,stem_up_x_offset:-1.2,stem_down_x_offset:0,stem_up_y_offset:-1,stem_down_y_offset:2},S1:{code:"vd3",shift_right:0},S2:{code:"vd2",shift_right:0},R1:{code:"vd5",shift_right:0},R2:{code:"vd4",shift_right:0}},m.integerToNote=t=>{if(void 0===t)throw new s.RERR("BadArguments","Undefined integer for integerToNote");if(t<-2)throw new s.RERR("BadArguments",`integerToNote requires integer > -2: ${t}`);const e=m.integerToNote.table[t];if(!e)throw new s.RERR("BadArguments",`Unknown note value for integer: ${t}`);return e},m.integerToNote.table={0:"C",1:"C#",2:"D",3:"D#",4:"E",5:"F",6:"F#",7:"G",8:"G#",9:"A",10:"A#",11:"B"},m.tabToGlyph=(t,e=1)=>{let i=null,s=0,n=0;if("X"===t.toString().toUpperCase()){const t=new f("v7f",m.DEFAULT_TABLATURE_FONT_SCALE).getMetrics();i="v7f",s=t.width,n=-t.height/2}else s=m.textWidth(t.toString());return{text:t,code:i,getWidth:()=>s*e,shift_y:n}},m.textWidth=t=>7*t.toString().length,m.articulationCodes=t=>m.articulationCodes.articulations[t],m.articulationCodes.articulations={"a.":{code:"v23",between_lines:!0},av:{code:"v28",between_lines:!0},"a>":{code:"v42",between_lines:!0},"a-":{code:"v25",between_lines:!0},"a^":{code:"va",between_lines:!1},"a+":{code:"v8b",between_lines:!1},ao:{code:"v94",between_lines:!1},ah:{code:"vb9",between_lines:!1},"a@a":{code:"v43",between_lines:!1},"a@u":{code:"v5b",between_lines:!1},"a|":{code:"v75",between_lines:!1},am:{code:"v97",between_lines:!1},"a,":{code:"vb3",between_lines:!1}},m.accidentalCodes=t=>m.accidentalCodes.accidentals[t],m.accidentalCodes.accidentals={"#":{code:"v18",parenRightPaddingAdjustment:-1},"##":{code:"v7f",parenRightPaddingAdjustment:-1},b:{code:"v44",parenRightPaddingAdjustment:-2},bb:{code:"v26",parenRightPaddingAdjustment:-2},n:{code:"v4e",parenRightPaddingAdjustment:-1},"{":{code:"v9c",parenRightPaddingAdjustment:-1},"}":{code:"v84",parenRightPaddingAdjustment:-1},db:{code:"v9e",parenRightPaddingAdjustment:-1},d:{code:"vab",parenRightPaddingAdjustment:0},bbs:{code:"v90",parenRightPaddingAdjustment:-1},"++":{code:"v51",parenRightPaddingAdjustment:-1},"+":{code:"v78",parenRightPaddingAdjustment:-1},"+-":{code:"v8d",parenRightPaddingAdjustment:-1},"++-":{code:"v7a",parenRightPaddingAdjustment:-1},bs:{code:"vb7",parenRightPaddingAdjustment:-1},bss:{code:"v39",parenRightPaddingAdjustment:-1},o:{code:"vd0",parenRightPaddingAdjustment:-1},k:{code:"vd1",parenRightPaddingAdjustment:-1},ashs:{code:"vd6",parenRightPaddingAdjustment:-1},afhf:{code:"vd7",parenRightPaddingAdjustment:-1}},m.accidentalColumnsTable={1:{a:[1],b:[1]},2:{a:[1,2]},3:{a:[1,3,2],b:[1,2,1],second_on_bottom:[1,2,3]},4:{a:[1,3,4,2],b:[1,2,3,1],spaced_out_tetrachord:[1,2,1,2]},5:{a:[1,3,5,4,2],b:[1,2,4,3,1],spaced_out_pentachord:[1,2,3,2,1],very_spaced_out_pentachord:[1,2,1,2,1]},6:{a:[1,3,5,6,4,2],b:[1,2,4,5,3,1],spaced_out_hexachord:[1,3,2,1,3,2],very_spaced_out_hexachord:[1,2,1,2,1,2]}},m.ornamentCodes=t=>m.ornamentCodes.ornaments[t],m.ornamentCodes.ornaments={mordent:{code:"v1e"},mordent_inverted:{code:"v45"},turn:{code:"v72"},turn_inverted:{code:"v33"},tr:{code:"v1f"},upprall:{code:"v60"},downprall:{code:"vb4"},prallup:{code:"v6d"},pralldown:{code:"v2c"},upmordent:{code:"v29"},downmordent:{code:"v68"},lineprall:{code:"v20"},prallprall:{code:"v86"}},m.keySignature=t=>{const e=m.keySignature.keySpecs[t];if(!e)throw new s.RERR("BadKeySignature",`Bad key signature spec: '${t}'`);if(!e.acc)return[];const i=m.keySignature.accidentalList(e.acc),n=[];for(let t=0;t<e.num;++t){const s=i[t];n.push({type:e.acc,line:s})}return n},m.keySignature.keySpecs={C:{acc:null,num:0},Am:{acc:null,num:0},F:{acc:"b",num:1},Dm:{acc:"b",num:1},Bb:{acc:"b",num:2},Gm:{acc:"b",num:2},Eb:{acc:"b",num:3},Cm:{acc:"b",num:3},Ab:{acc:"b",num:4},Fm:{acc:"b",num:4},Db:{acc:"b",num:5},Bbm:{acc:"b",num:5},Gb:{acc:"b",num:6},Ebm:{acc:"b",num:6},Cb:{acc:"b",num:7},Abm:{acc:"b",num:7},G:{acc:"#",num:1},Em:{acc:"#",num:1},D:{acc:"#",num:2},Bm:{acc:"#",num:2},A:{acc:"#",num:3},"F#m":{acc:"#",num:3},E:{acc:"#",num:4},"C#m":{acc:"#",num:4},B:{acc:"#",num:5},"G#m":{acc:"#",num:5},"F#":{acc:"#",num:6},"D#m":{acc:"#",num:6},"C#":{acc:"#",num:7},"A#m":{acc:"#",num:7}},m.unicode={sharp:String.fromCharCode(parseInt("266F",16)),flat:String.fromCharCode(parseInt("266D",16)),natural:String.fromCharCode(parseInt("266E",16)),triangle:String.fromCharCode(parseInt("25B3",16)),"o-with-slash":String.fromCharCode(parseInt("00F8",16)),degrees:String.fromCharCode(parseInt("00B0",16)),circle:String.fromCharCode(parseInt("25CB",16))},m.keySignature.accidentalList=t=>({b:[2,.5,2.5,1,3,1.5,3.5],"#":[0,1.5,-.5,1,2.5,.5,2]}[t]),m.parseNoteDurationString=t=>{if("string"!=typeof t)return null;const e=/(\d*\/?\d+|[a-z])(d*)([nrhms]|$)/.exec(t);if(!e)return null;const i=e[1],s=e[2].length;let n=e[3];return 0===n.length&&(n="n"),{duration:i,dots:s,type:n}},m.parseNoteStruct=t=>{const e=t.duration,i=m.parseNoteDurationString(e);if(!i)return null;let s=m.durationToTicks(i.duration);if(null==s)return null;let n=t.type;const r=[];if(n){if(!m.getGlyphProps.validTypes[n])return null}else n=i.type||"n",void 0!==t.keys&&t.keys.forEach(((t,e)=>{const i=t.split("/");i&&3===i.length&&(r[e]=i[2])}));const o=t.dots?t.dots:i.dots;if("number"!=typeof o)return null;let a=s;for(let t=0;t<o;t++){if(a<=1)return null;a/=2,s+=a}return{duration:i.duration,type:n,customTypes:r,dots:o,ticks:s}},m.sanitizeDuration=t=>{const e=m.durationAliases[t];if(void 0!==e&&(t=e),void 0===m.durationToTicks.durations[t])throw new s.RERR("BadArguments",`The provided duration is not valid: ${t}`);return t},m.durationToFraction=t=>(new n).parse(m.sanitizeDuration(t)),m.durationToNumber=t=>m.durationToFraction(t).value(),m.durationToTicks=t=>{t=m.sanitizeDuration(t);const e=m.durationToTicks.durations[t];return void 0===e?null:e},m.durationToTicks.durations={"1/2":2*m.RESOLUTION,1:m.RESOLUTION/1,2:m.RESOLUTION/2,4:m.RESOLUTION/4,8:m.RESOLUTION/8,16:m.RESOLUTION/16,32:m.RESOLUTION/32,64:m.RESOLUTION/64,128:m.RESOLUTION/128,256:m.RESOLUTION/256},m.durationAliases={w:"1",h:"2",q:"4",b:"256"},m.getGlyphProps=(t,e)=>{t=m.sanitizeDuration(t);const i=m.getGlyphProps.duration_codes[t];if(void 0===i)return null;e||(e="n");let s=i.type[e];if(void 0===s){const t=m.keyProperties.customNoteHeads[e.toUpperCase()];if(void 0===t)return null;s={code_head:t.code,...t}}return{...i.common,...s}},m.getGlyphProps.validTypes={n:{name:"note"},r:{name:"rest"},h:{name:"harmonic"},m:{name:"muted"},s:{name:"slash"}},m.getGlyphProps.duration_codes={"1/2":{common:{getWidth(t=m.DEFAULT_NOTATION_FONT_SCALE){return new f(this.code_head||"v53",t).getMetrics().width},stem:!1,stem_offset:0,flag:!1,stem_up_extension:-m.STEM_HEIGHT,stem_down_extension:-m.STEM_HEIGHT,tabnote_stem_up_extension:-m.STEM_HEIGHT,tabnote_stem_down_extension:-m.STEM_HEIGHT,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"v53"},h:{code_head:"v59"},m:{code_head:"vf",stem_offset:0},r:{code_head:"v31",rest:!0,position:"B/5",dot_shiftY:.5},s:{getWidth:()=>m.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},1:{common:{getWidth(t=m.DEFAULT_NOTATION_FONT_SCALE){return new f(this.code_head||"v1d",t).getMetrics().width},stem:!1,stem_offset:0,flag:!1,stem_up_extension:-m.STEM_HEIGHT,stem_down_extension:-m.STEM_HEIGHT,tabnote_stem_up_extension:-m.STEM_HEIGHT,tabnote_stem_down_extension:-m.STEM_HEIGHT,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"v1d"},h:{code_head:"v46"},m:{code_head:"v92",stem_offset:-3},r:{code_head:"v5c",rest:!0,position:"D/5",dot_shiftY:.5},s:{getWidth:()=>m.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},2:{common:{getWidth(t=m.DEFAULT_NOTATION_FONT_SCALE){return new f(this.code_head||"v81",t).getMetrics().width},stem:!0,stem_offset:0,flag:!1,stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"v81"},h:{code_head:"v2d"},m:{code_head:"v95",stem_offset:-3},r:{code_head:"vc",stem:!1,rest:!0,position:"B/4",dot_shiftY:-.5},s:{getWidth:()=>m.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},4:{common:{getWidth(t=m.DEFAULT_NOTATION_FONT_SCALE){return new f(this.code_head||"vb",t).getMetrics().width},stem:!0,stem_offset:0,flag:!1,stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e",stem_offset:-3},r:{code_head:"v7c",stem:!1,rest:!0,position:"B/4",dot_shiftY:-.5,line_above:1.5,line_below:1.5},s:{getWidth:()=>m.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},8:{common:{getWidth(t=m.DEFAULT_NOTATION_FONT_SCALE){return new f(this.code_head||"vb",t).getMetrics().width},stem:!0,stem_offset:0,flag:!0,beam_count:1,code_flag_upstem:"v54",code_flag_downstem:"v9a",stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"va5",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-.5,line_above:1,line_below:1},s:{getWidth:()=>m.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},16:{common:{beam_count:2,getWidth(t=m.DEFAULT_NOTATION_FONT_SCALE){return new f(this.code_head||"vb",t).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"v3f",code_flag_downstem:"v8f",stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"v3c",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-.5,line_above:1,line_below:2},s:{getWidth:()=>m.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},32:{common:{beam_count:3,getWidth(t=m.DEFAULT_NOTATION_FONT_SCALE){return new f(this.code_head||"vb",t).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"v47",code_flag_downstem:"v2a",stem_up_extension:9,stem_down_extension:9,tabnote_stem_up_extension:8,tabnote_stem_down_extension:5,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"v55",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-1.5,line_above:2,line_below:2},s:{getWidth:()=>m.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},64:{common:{beam_count:4,getWidth(t=m.DEFAULT_NOTATION_FONT_SCALE){return new f(this.code_head||"vb",t).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"va9",code_flag_downstem:"v58",stem_up_extension:13,stem_down_extension:13,tabnote_stem_up_extension:12,tabnote_stem_down_extension:9,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"v38",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-1.5,line_above:2,line_below:3},s:{getWidth:()=>m.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},128:{common:{beam_count:5,getWidth(t=m.DEFAULT_NOTATION_FONT_SCALE){return new f(this.code_head||"vb",t).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"v9b",code_flag_downstem:"v30",stem_up_extension:22,stem_down_extension:22,tabnote_stem_up_extension:21,tabnote_stem_down_extension:18,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"vaa",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:1.5,line_above:3,line_below:3},s:{getWidth:()=>m.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}}},m.smufl={},m.smufl.to_code_points={bracketTop:"v1b",bracketBottom:"v10",barlineTick:"v6f",segno:"v8c",coda:"v4d",gClef:"v83",cClef:"vad",fClef:"v79",unpitchedPercussionClef1:"v59","6stringTabClef":"v2f",timeSig0:"v0",timeSig1:"v1",timeSig2:"v2",timeSig3:"v3",timeSig4:"v4",timeSig5:"v5",timeSig6:"v6",timeSig7:"v7",timeSig8:"v8",timeSig9:"v9",timeSigCommon:"v41",timeSigCutCommon:"vb6",noteheadDoubleWhole:"v53",noteheadWhole:"v1d",noteheadHalf:"v81",noteheadBlack:"vb",noteheadXWhole:"v92",noteheadXHalf:"v95",noteheadXBlack:"v3e",noteheadCircleX:"v3b",noteheadTriangleUpWhole:"v49",noteheadTriangleUpHalf:"v93",noteheadTriangleUpBlack:"v40",noteheadDiamondWhole:"v46",noteheadDiamondHalf:"v2d",noteheadDiamondBlack:"v22",augmentationDot:"v23",tremolo1:"v74",flag8thUp:"v54",flag8thDown:"v9a",flag16thUp:"v3f",flag16thDown:"v8f",flag32ndUp:"v47",flag32ndDown:"v2a",flag64thUp:"va9",flag64thDown:"v58",flag128thUp:"v9b",flag128thDown:"v30",accidentalFlat:"v44",accidentalNatural:"v4e",accidentalSharp:"v18",accidentalDoubleSharp:"v7f",accidentalDoubleFlat:"v26",accidentalParensLeft:"v9c",accidentalParensRight:"v84",accidentalQuarterToneFlatStein:"vab",accidentalThreeQuarterTonesFlatZimmermann:"v9e",accidentalQuarterToneSharpStein:"v78",accidentalThreeQuarterTonesSharpStein:"v51",accidentalBuyukMucennebFlat:"v39",accidentalBakiyeFlat:"vb7",accidentalKomaSharp:"v51",accidentalKucukMucennebSharp:"v8d",accidentalKoron:"vd1",accidentalSori:"vd0",articAccentAbove:"v42",articAccentBelow:"v42",articTenutoAbove:"v25",articTenutoBelow:"v25",articStaccatoAbove:"v23",articStaccatoBelow:"v23",articStaccatissimoAbove:"v28",articMarcatoAbove:"va",fermataAbove:"v43",fermataBelow:"v5b",breathMarkComma:"v6c",breathMarkUpbow:"v8a",caesura:"v34",caesuraCurved:"v4b",restMaxima:"v59",restDoubleWhole:"v31",restWhole:"v5c",restHalf:"vc",restQuarter:"v7c",rest8th:"va5",rest16th:"v3c",rest32nd:"v55",rest64th:"v38",rest128th:"vaa",dynamicPiano:"vbf",dynamicMezzo:"v62",dynamicForte:"vba",dynamicRinforzando:"vba",dynamicSforzando:"v4a",dynamicZ:"v80",ornamentTrill:"v1f",ornamentTurn:"v72",ornamentTurnSlash:"v33",ornamentMordent:"v45",ornamentMordentInverted:"v1e",ornamentTremblement:"v86",ornamentPrecompAppoggTrill:"v20",ornamentPrecompSlideTrillDAnglebert:"v60",ornamentPrecompSlideTrillBach:"v29",ornamentPrecompTrillSuffixDandrieu:"v6d",ornamentPrecompDoubleCadenceUpperPrefix:"vb4",ornamentPrecompDoubleCadenceUpperPrefixTurn:"v68",ornamentPrecompTrillLowerSuffix:"v2c",stringsDownBow:"v94",stringsUpBow:"v75",stringsHarmonic:"vb9",pluckedSnapPizzicatoAbove:"v94",pluckedLeftHandPizzicato:"v8b",keyboardPedalPed:"v36",keyboardPedalUp:"v5d",pictChokeCymbal:"vb3",wiggleArpeggiatoUp:"va3",arrowheadBlackUp:"vc3",arrowheadBlackDown:"v52"},m.TIME4_4={num_beats:4,beat_value:4,resolution:m.RESOLUTION};class p{static get WIDTH(){return 600}static get HEIGHT(){return 400}static get CANVAS_BROWSER_SIZE_LIMIT(){return 32767}static SanitizeCanvasDims(t,e){return Math.max(t,e)>this.CANVAS_BROWSER_SIZE_LIMIT&&(s.W("Canvas dimensions exceed browser limit. Cropping to "+this.CANVAS_BROWSER_SIZE_LIMIT),t>this.CANVAS_BROWSER_SIZE_LIMIT&&(t=this.CANVAS_BROWSER_SIZE_LIMIT),e>this.CANVAS_BROWSER_SIZE_LIMIT&&(e=this.CANVAS_BROWSER_SIZE_LIMIT)),[t,e]}constructor(t){this.vexFlowCanvasContext=t,t.canvas?this.canvas=t.canvas:this.canvas={width:p.WIDTH,height:p.HEIGHT}}clear(){this.vexFlowCanvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}openGroup(){}closeGroup(){}add(){}setFont(t,e,i){return this.vexFlowCanvasContext.font=(i||"")+" "+e+"pt "+t,this}setRawFont(t){return this.vexFlowCanvasContext.font=t,this}setFillStyle(t){return this.vexFlowCanvasContext.fillStyle=t,this}setBackgroundFillStyle(t){return this.background_fillStyle=t,this}setStrokeStyle(t){return this.vexFlowCanvasContext.strokeStyle=t,this}setShadowColor(t){return this.vexFlowCanvasContext.shadowColor=t,this}setShadowBlur(t){return this.vexFlowCanvasContext.shadowBlur=t,this}setLineWidth(t){return this.vexFlowCanvasContext.lineWidth=t,this}setLineCap(t){return this.vexFlowCanvasContext.lineCap=t,this}setLineDash(t){return this.vexFlowCanvasContext.lineDash=t,this}scale(t,e){return this.vexFlowCanvasContext.scale(parseFloat(t),parseFloat(e))}resize(t,e){return[t,e]=this.SanitizeCanvasDims(parseInt(t,10),parseInt(e,10)),this.vexFlowCanvasContext.resize(t,e)}rect(t,e,i,s){return this.vexFlowCanvasContext.rect(t,e,i,s)}fillRect(t,e,i,s){return this.vexFlowCanvasContext.fillRect(t,e,i,s)}clearRect(t,e,i,s){return this.vexFlowCanvasContext.clearRect(t,e,i,s)}beginPath(){return this.vexFlowCanvasContext.beginPath()}moveTo(t,e){return this.vexFlowCanvasContext.moveTo(t,e)}lineTo(t,e){return this.vexFlowCanvasContext.lineTo(t,e)}bezierCurveTo(t,e,i,s,n,r){return this.vexFlowCanvasContext.bezierCurveTo(t,e,i,s,n,r)}quadraticCurveTo(t,e,i,s){return this.vexFlowCanvasContext.quadraticCurveTo(t,e,i,s)}arc(t,e,i,s,n,r){return this.vexFlowCanvasContext.arc(t,e,i,s,n,r)}glow(){return this.vexFlowCanvasContext.glow()}fill(){return this.vexFlowCanvasContext.fill()}stroke(){return this.vexFlowCanvasContext.stroke()}closePath(){return this.vexFlowCanvasContext.closePath()}measureText(t){return this.vexFlowCanvasContext.measureText(t)}fillText(t,e,i){return this.vexFlowCanvasContext.fillText(t,e,i)}save(){return this.vexFlowCanvasContext.save()}restore(){return this.vexFlowCanvasContext.restore()}}class b{constructor(t){this.element=t,this.paper=Raphael(t),this.path="",this.pen={x:0,y:0},this.lineWidth=1,this.state={scale:{x:1,y:1},font_family:"Arial",font_size:8,font_weight:800},this.attributes={"stroke-width":.3,fill:"black",stroke:"black",font:"10pt Arial"},this.background_attributes={"stroke-width":0,fill:"white",stroke:"white",font:"10pt Arial"},this.shadow_attributes={width:0,color:"black"},this.state_stack=[]}openGroup(){}closeGroup(){}add(){}setFont(t,e,i){return this.state.font_family=t,this.state.font_size=e,this.state.font_weight=i,this.attributes.font=(this.state.font_weight||"")+" "+this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this}setRawFont(t){return this.attributes.font=t,this}setFillStyle(t){return this.attributes.fill=t,this}setBackgroundFillStyle(t){return this.background_attributes.fill=t,this.background_attributes.stroke=t,this}setStrokeStyle(t){return this.attributes.stroke=t,this}setShadowColor(t){return this.shadow_attributes.color=t,this}setShadowBlur(t){return this.shadow_attributes.width=t,this}setLineWidth(t){this.attributes["stroke-width"]=t,this.lineWidth=t}setLineDash(){return this}setLineCap(){return this}scale(t,e){return this.state.scale={x:t,y:e},this.attributes.transform="S"+t+","+e+",0,0",this.attributes.scale=t+","+e+",0,0",this.attributes.font=this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this.background_attributes.transform="S"+t+","+e+",0,0",this.background_attributes.font=this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this}clear(){this.paper.clear()}resize(t,e){return this.element.style.width=t,this.paper.setSize(t,e),this}setViewBox(t){this.paper.canvas.setAttribute("viewBox",t)}rect(t,e,i,s){return s<0&&(e+=s,s=-s),this.paper.rect(t,e,i-.5,s-.5).attr(this.attributes).attr("fill","none").attr("stroke-width",this.lineWidth),this}fillRect(t,e,i,s){return s<0&&(e+=s,s=-s),this.paper.rect(t,e,i-.5,s-.5).attr(this.attributes),this}clearRect(t,e,i,s){return s<0&&(e+=s,s=-s),this.paper.rect(t,e,i-.5,s-.5).attr(this.background_attributes),this}beginPath(){return this.path="",this.pen.x=0,this.pen.y=0,this}moveTo(t,e){return this.path+="M"+t+","+e,this.pen.x=t,this.pen.y=e,this}lineTo(t,e){return this.path+="L"+t+","+e,this.pen.x=t,this.pen.y=e,this}bezierCurveTo(t,e,i,s,n,r){return this.path+="C"+t+","+e+","+i+","+s+","+n+","+r,this.pen.x=n,this.pen.y=r,this}quadraticCurveTo(t,e,i,s){return this.path+="Q"+t+","+e+","+i+","+s,this.pen.x=i,this.pen.y=s,this}arc(t,e,i,s,n,r){function o(t){for(;t<0;)t+=2*Math.PI;for(;t>2*Math.PI;)t-=2*Math.PI;return t}if((s=o(s))>(n=o(n))){const t=s;s=n,n=t,r=!r}const a=n-s;return a>Math.PI?(this.arcHelper(t,e,i,s,s+a/2,r),this.arcHelper(t,e,i,s+a/2,n,r)):this.arcHelper(t,e,i,s,n,r),this}arcHelper(t,e,i,s,n,r){const o=t+i*Math.cos(s),a=e+i*Math.sin(s),l=t+i*Math.cos(n),h=e+i*Math.sin(n);let c=0,u=0;r?(u=1,n-s<Math.PI&&(c=1)):n-s>Math.PI&&(c=1),this.path+="M"+o+","+a+",A"+i+","+i+",0,"+c+","+u+","+l+","+h+"M"+this.pen.x+","+this.pen.y}glow(){const t=this.paper.set();if(this.shadow_attributes.width>0){const e=this.shadow_attributes,i=e.width/2;for(let s=1;s<=i;s++)t.push(this.paper.path(this.path).attr({stroke:e.color,"stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(e.width/i*s).toFixed(3),opacity:+((e.opacity||.3)/i).toFixed(3),transform:this.attributes.transform,scale:this.attributes.scale}))}return t}fill(){const t=this.paper.path(this.path).attr(this.attributes).attr("stroke-width",0);return this.glow(t),this}stroke(){const t=this.lineWidth*(this.state.scale.x+this.state.scale.y)/2,e=this.paper.path(this.path).attr(this.attributes).attr("fill","none").attr("stroke-width",t);return this.glow(e),this}closePath(){return this.path+="Z",this}measureText(t){const e=this.paper.text(0,0,t).attr(this.attributes).attr("fill","none").attr("stroke","none"),i=e.getBBox();return e.remove(),{width:i.width,height:i.height}}fillText(t,e,i){return this.paper.text(e+this.measureText(t).width/2,i-this.state.font_size/(2.25*this.state.scale.y),t).attr(this.attributes),this}save(){return this.state_stack.push({state:{font_family:this.state.font_family},attributes:{font:this.attributes.font,fill:this.attributes.fill,stroke:this.attributes.stroke,"stroke-width":this.attributes["stroke-width"]},shadow_attributes:{width:this.shadow_attributes.width,color:this.shadow_attributes.color}}),this}restore(){const t=this.state_stack.pop();return this.state.font_family=t.state.font_family,this.attributes.font=t.attributes.font,this.attributes.fill=t.attributes.fill,this.attributes.stroke=t.attributes.stroke,this.attributes["stroke-width"]=t.attributes["stroke-width"],this.shadow_attributes.width=t.shadow_attributes.width,this.shadow_attributes.color=t.shadow_attributes.color,this}}const g={path:{x:!0,y:!0,width:!0,height:!0},rect:{},text:{width:!0,height:!0}};{const t={"font-family":!0,"font-weight":!0,"font-style":!0,"font-size":!0};s.Merge(g.rect,t),s.Merge(g.path,t)}class S{constructor(t){this.element=t,this.svgNS="http://www.w3.org/2000/svg";const e=this.create("svg");this.element.appendChild(e),this.svg=e,this.groups=[this.svg],this.parent=this.svg,this.path="",this.pen={x:NaN,y:NaN},this.lineWidth=1,this.state={scale:{x:1,y:1},"font-family":"Arial","font-size":"8pt","font-weight":"normal"},this.attributes={"stroke-width":.3,fill:"black",stroke:"black","stroke-dasharray":"none","font-family":"Arial","font-size":"10pt","font-weight":"normal","font-style":"normal"},this.background_attributes={"stroke-width":0,fill:"white",stroke:"white","stroke-dasharray":"none","font-family":"Arial","font-size":"10pt","font-weight":"normal","font-style":"normal"},this.shadow_attributes={width:0,color:"black"},this.state_stack=[],this.iePolyfill()}create(t){return document.createElementNS(this.svgNS,t)}openGroup(t,e,i){const n=this.create("g");return this.groups.push(n),this.parent.appendChild(n),this.parent=n,t&&n.setAttribute("class",s.Prefix(t)),e&&n.setAttribute("id",s.Prefix(e)),i&&i.pointerBBox&&n.setAttribute("pointer-events","bounding-box"),n}closeGroup(){this.groups.pop(),this.parent=this.groups[this.groups.length-1]}add(t){this.parent.appendChild(t)}iePolyfill(){"undefined"!=typeof navigator&&(this.ie=/MSIE 9/i.test(navigator.userAgent)||/MSIE 10/i.test(navigator.userAgent)||/rv:11\.0/i.test(navigator.userAgent)||/Trident/i.test(navigator.userAgent))}setFont(t,e,i){let n=!1,r=!1,o="normal";"string"==typeof i&&(-1!==i.indexOf("italic")&&(i=i.replace(/italic/g,""),r=!0),-1!==i.indexOf("bold")&&(i=i.replace(/bold/g,""),n=!0),i=i.replace(/ /g,"")),o=r?"italic":o;const a={"font-family":t,"font-size":e+"pt","font-weight":i=void 0===(i=n?"bold":i)||""===i?"normal":i,"font-style":o};return this.fontSize=Number(e),s.Merge(this.attributes,a),s.Merge(this.state,a),this}setRawFont(t){const e=(t=t.trim()).split(" ");return this.attributes["font-family"]=e[1],this.state["font-family"]=e[1],this.attributes["font-size"]=e[0],this.state["font-size"]=e[0],this.fontSize=Number(e[0].match(/\d+/)),this}setFillStyle(t){return this.attributes.fill=t,this}setBackgroundFillStyle(t){return this.background_attributes.fill=t,this.background_attributes.stroke=t,this}setStrokeStyle(t){return this.attributes.stroke=t,this}setShadowColor(t){return this.shadow_attributes.color=t,this}setShadowBlur(t){return this.shadow_attributes.width=t,this}setLineWidth(t){this.attributes["stroke-width"]=t,this.lineWidth=t}setLineDash(t){if("[object Array]"===Object.prototype.toString.call(t))return t=t.join(", "),this.attributes["stroke-dasharray"]=t,this;throw new s.RERR("ArgumentError","lineDash must be an array of integers.")}setLineCap(t){return this.attributes["stroke-linecap"]=t,this}resize(t,e){this.width=t,this.height=e,this.element.style.width=t;const i={width:t,height:e};return this.applyAttributes(this.svg,i),this.scale(this.state.scale.x,this.state.scale.y),this}scale(t,e){this.state.scale={x:t,y:e};const i=this.width/t,s=this.height/e;return this.setViewBox(0,0,i,s),this}setViewBox(...t){if(1===t.length){const[e]=t;this.svg.setAttribute("viewBox",e)}else{const[e,i,s,n]=t,r=e+" "+i+" "+s+" "+n;this.svg.setAttribute("viewBox",r)}}applyAttributes(t,e){const i=g[t.nodeName];return Object.keys(e).forEach((s=>{i&&i[s]||t.setAttributeNS(null,s,e[s])})),t}clear(){for(;this.svg.lastChild;)this.svg.removeChild(this.svg.lastChild);this.scale(this.state.scale.x,this.state.scale.y)}rect(t,e,i,n,r){n<0&&(e+=n,n*=-1);const o=this.create("rect");return void 0===r&&(r={fill:"none","stroke-width":this.lineWidth,stroke:this.attributes.stroke}),s.Merge(r,{x:t,y:e,width:i,height:n}),this.applyAttributes(o,r),this.add(o),this}fillRect(t,e,i,s){return s<0&&(e+=s,s*=-1),this.rect(t,e,i,s,this.attributes),this}clearRect(t,e,i,s){return this.rect(t,e,i,s,this.background_attributes),this}beginPath(){return this.path="",this.pen.x=NaN,this.pen.y=NaN,this}moveTo(t,e){return this.path+="M"+t+" "+e,this.pen.x=t,this.pen.y=e,this}lineTo(t,e){return this.path+="L"+t+" "+e,this.pen.x=t,this.pen.y=e,this}bezierCurveTo(t,e,i,s,n,r){return this.path+="C"+t+" "+e+","+i+" "+s+","+n+" "+r,this.pen.x=n,this.pen.y=r,this}quadraticCurveTo(t,e,i,s){return this.path+="Q"+t+" "+e+","+i+" "+s,this.pen.x=i,this.pen.y=s,this}arc(t,e,i,s,n,r){function o(t){for(;t<0;)t+=2*Math.PI;for(;t>2*Math.PI;)t-=2*Math.PI;return t}if((s=o(s))>(n=o(n))){const t=s;s=n,n=t,r=!r}const a=n-s;return a>Math.PI?(this.arcHelper(t,e,i,s,s+a/2,r),this.arcHelper(t,e,i,s+a/2,n,r)):this.arcHelper(t,e,i,s,n,r),this}arcHelper(t,e,i,s,n,r){const o=t+i*Math.cos(s),a=e+i*Math.sin(s),l=t+i*Math.cos(n),h=e+i*Math.sin(n);let c=0,u=0;r?(u=1,n-s<Math.PI&&(c=1)):n-s>Math.PI&&(c=1),this.path+="M"+o+" "+a+" A"+i+" "+i+" 0 "+c+" "+u+" "+l+" "+h,isNaN(this.pen.x)||isNaN(this.pen.y)||(this.peth+="M"+this.pen.x+" "+this.pen.y)}closePath(){return this.path+="Z",this}glow(){if(this.shadow_attributes.width>0){const t=this.shadow_attributes,e=t.width/2;for(let i=1;i<=e;i++){const s={stroke:t.color,"stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(.4*t.width/e*i).toFixed(3),opacity:+((t.opacity||.3)/e).toFixed(3)},n=this.create("path");s.d=this.path,this.applyAttributes(n,s),this.add(n)}}return this}fill(t){this.glow();const e=this.create("path");let i=t;return void 0===t?(s.Merge(t={},this.attributes),t.stroke="none",i=t):(i=t,s.Merge(i,this.attributes),t.class&&(i.class=t.class),t.id&&(i.id=t.id)),t.d=this.path,this.applyAttributes(e,t),this.add(e),this}stroke(t){this.glow();const e=this.create("path"),i={};return s.Merge(i,this.attributes),t&&s.Merge(i,t),i.fill="none",i["stroke-width"]=this.lineWidth,i.d=this.path,this.applyAttributes(e,i),this.add(e),this}measureText(t){const e=this.create("text");if("function"!=typeof e.getBBox)return{x:0,y:0,width:0,height:0};e.textContent=t,this.applyAttributes(e,this.attributes),this.svg.appendChild(e);let i=e.getBBox();return this.ie&&""!==t&&"italic"===this.attributes["font-style"]&&(i=this.ieMeasureTextFix(i,t)),this.svg.removeChild(e),i}ieMeasureTextFix(t){const e=1.196*Number(this.fontSize)+1.9598,i=t.width-e,s=t.height-1.5;return{x:t.x,y:t.y,width:i,height:s}}fillText(t,e,i){if(!t||t.length<=0)return;const n={};s.Merge(n,this.attributes),n.stroke="none",n.x=e,n.y=i;const r=this.create("text");r.textContent=t,this.applyAttributes(r,n),this.add(r)}save(){return this.state_stack.push({state:{"font-family":this.state["font-family"],"font-weight":this.state["font-weight"],"font-style":this.state["font-style"],"font-size":this.state["font-size"],scale:this.state.scale},attributes:{"font-family":this.attributes["font-family"],"font-weight":this.attributes["font-weight"],"font-style":this.attributes["font-style"],"font-size":this.attributes["font-size"],fill:this.attributes.fill,stroke:this.attributes.stroke,"stroke-width":this.attributes["stroke-width"],"stroke-dasharray":this.attributes["stroke-dasharray"]},shadow_attributes:{width:this.shadow_attributes.width,color:this.shadow_attributes.color},lineWidth:this.lineWidth}),this}restore(){const t=this.state_stack.pop();return this.state["font-family"]=t.state["font-family"],this.state["font-weight"]=t.state["font-weight"],this.state["font-style"]=t.state["font-style"],this.state["font-size"]=t.state["font-size"],this.state.scale=t.state.scale,this.attributes["font-family"]=t.attributes["font-family"],this.attributes["font-weight"]=t.attributes["font-weight"],this.attributes["font-style"]=t.attributes["font-style"],this.attributes["font-size"]=t.attributes["font-size"],this.attributes.fill=t.attributes.fill,this.attributes.stroke=t.attributes.stroke,this.attributes["stroke-width"]=t.attributes["stroke-width"],this.attributes["stroke-dasharray"]=t.attributes["stroke-dasharray"],this.shadow_attributes.width=t.shadow_attributes.width,this.shadow_attributes.color=t.shadow_attributes.color,this.lineWidth=t.lineWidth,this}}let y=null;class E{static get Backends(){return{CANVAS:1,RAPHAEL:2,SVG:3,VML:4}}static get LineEndType(){return{NONE:1,UP:2,DOWN:3}}static get USE_CANVAS_PROXY(){return!1}static get lastContext(){return y}static set lastContext(t){y=t}static buildContext(t,e,i,s,n){const r=new E(t,e);i&&s&&r.resize(i,s),n||(n="#FFF");const o=r.getContext();return o.setBackgroundFillStyle(n),E.lastContext=o,o}static getCanvasContext(t,e,i,s){return E.buildContext(t,E.Backends.CANVAS,e,i,s)}static getRaphaelContext(t,e,i,s){return E.buildContext(t,E.Backends.RAPHAEL,e,i,s)}static getSVGContext(t,e,i,s){return E.buildContext(t,E.Backends.SVG,e,i,s)}static bolsterCanvasContext(t){return E.USE_CANVAS_PROXY?new p(t):(t.vexFlowCanvasContext=t,["clear","setFont","setRawFont","setFillStyle","setBackgroundFillStyle","setStrokeStyle","setShadowColor","setShadowBlur","setLineWidth","setLineCap","setLineDash","openGroup","closeGroup","getGroup"].forEach((e=>{t[e]=t[e]||p.prototype[e]})),t)}static drawDashedLine(t,e,i,s,n,r){t.beginPath();const o=s-e,a=n-i,l=Math.atan2(a,o);let h=e,c=i;t.moveTo(e,i);let u=0,d=!0;for(;!(o<0?h<=s:h>=s)||!(a<0?c<=n:c>=n);){const e=r[u++%r.length],i=h+Math.cos(l)*e;h=o<0?Math.max(s,i):Math.min(s,i);const f=c+Math.sin(l)*e;c=a<0?Math.max(n,f):Math.min(n,f),d?t.lineTo(h,c):t.moveTo(h,c),d=!d}t.closePath(),t.stroke()}constructor(t,e){if(this.elementId=t,!this.elementId)throw new s.RERR("BadArgument","Invalid id for renderer.");if(this.element=document.getElementById(t),this.element||(this.element=t),this.ctx=null,this.paper=null,this.backend=e,this.backend===E.Backends.CANVAS){if(!this.element.getContext)throw new s.RERR("BadElement",`Can't get canvas context from element: ${t}`);this.ctx=E.bolsterCanvasContext(this.element.getContext("2d",{willReadFrequently:!0}))}else if(this.backend===E.Backends.RAPHAEL)this.ctx=new b(this.element);else{if(this.backend!==E.Backends.SVG)throw new s.RERR("InvalidBackend",`No support for backend: ${this.backend}`);this.ctx=new S(this.element)}}resize(t,e){if(this.backend===E.Backends.CANVAS){if(!this.element.getContext)throw new s.RERR("BadElement",`Can't get canvas context from element: ${this.elementId}`);[t,e]=p.SanitizeCanvasDims(t,e);const i=window.devicePixelRatio||1;this.element.width=t*i,this.element.height=e*i,this.element.style.width=t+"px",this.element.style.height=e+"px",this.ctx=E.bolsterCanvasContext(this.element.getContext("2d",{willReadFrequently:!0})),this.ctx.scale(i,i)}else this.ctx.resize(t,e);return this}getContext(){return this.ctx}}class v extends l{static get CATEGORY(){return"stem"}static get UP(){return 1}static get DOWN(){return-1}static get WIDTH(){return m.STEM_WIDTH}static get HEIGHT(){return m.STEM_HEIGHT}constructor(t={}){super(),this.setAttribute("type","Stem"),this.x_begin=t.x_begin||0,this.x_end=t.x_end||0,this.y_top=t.y_top||0,this.y_bottom=t.y_bottom||0,this.stem_extension=t.stem_extension||0,this.stem_direction=t.stem_direction||0,this.hide=t.hide||!1,this.isStemlet=t.isStemlet||!1,this.stemletHeight=t.stemletHeight||0,this.renderHeightAdjustment=0,this.setOptions(t)}setOptions(t){this.stem_up_y_offset=t.stem_up_y_offset||0,this.stem_down_y_offset=t.stem_down_y_offset||0}setNoteHeadXBounds(t,e){return this.x_begin=t,this.x_end=e,this}setDirection(t){this.stem_direction=t}setExtension(t){this.stem_extension=t}getExtension(){return this.stem_extension}setYBounds(t,e){this.y_top=t,this.y_bottom=e}getCategory(){return v.CATEGORY}getHeight(){const t=this.stem_direction===v.UP?this.stem_up_y_offset:this.stem_down_y_offset;return(this.y_bottom-this.y_top)*this.stem_direction+(v.HEIGHT-t+this.stem_extension)*this.stem_direction}getBoundingBox(){throw new s.RERR("NotImplemented","getBoundingBox() not implemented.")}getExtents(){const t=this.stem_direction===v.UP,e=[this.y_top,this.y_bottom],i=v.HEIGHT+this.stem_extension,s=(t?Math.min:Math.max)(...e),n=(t?Math.max:Math.min)(...e);return{topY:s+i*-this.stem_direction,baseY:n}}setVisibility(t){return this.hide=!t,this}setStemlet(t,e){return this.isStemlet=t,this.stemletHeight=e,this}draw(){if(this.setRendered(),this.hide)return;const t=this.checkContext();let e,i;const n=this.stem_direction;n===v.DOWN?(e=this.x_begin,i=this.y_top+this.stem_down_y_offset):(e=this.x_end,i=this.y_bottom-this.stem_up_y_offset);const r=this.getHeight();!function(...t){v.DEBUG&&s.L("Vex.Flow.Stem",t)}("Rendering stem - ","Top Y: ",this.y_top,"Bottom Y: ",this.y_bottom);const o=this.isStemlet?r-this.stemletHeight*this.stem_direction:0;if(t.save(),this.applyStyle(t),t.beginPath(),t.setLineWidth(v.WIDTH),t.moveTo(e,i-o),t.lineTo(e,i-r-this.renderHeightAdjustment*n),t.svg){const e={class:s.Prefix("stem")};this.id&&(e.id=this.id),t.stroke(e)}else t.stroke();this.restoreStyle(t),t.restore()}}class x extends l{static get LOCATION_TOP(){return 1}static get LOCATION_BOTTOM(){return-1}static get NESTING_OFFSET(){return 15}constructor(t,e){if(super(),this.setAttribute("type","Tuplet"),!t||!t.length)throw new s.RuntimeError("BadArguments","No notes provided for tuplet.");this.options=s.Merge({},e),this.notes=t,this.num_notes="num_notes"in this.options?this.options.num_notes:t.length,this.options.beats_occupied&&this.beatsOccupiedDeprecationWarning(),this.notes_occupied=this.options.notes_occupied||this.options.beats_occupied||2,"bracketed"in this.options?this.bracketed=this.options.bracketed:this.bracketed=t.some((t=>null===t.beam)),this.ratioed="ratioed"in this.options?this.options.ratioed:Math.abs(this.notes_occupied-this.num_notes)>1,this.point=28,this.y_pos=16,this.x_pos=100,this.width=200,this.location=this.options.location||x.LOCATION_TOP,ut.AlignRestsToNotes(t,!0,!0),this.resolveGlyphs(),this.attach()}attach(){for(let t=0;t<this.notes.length;t++)this.notes[t].setTuplet(this)}detach(){for(let t=0;t<this.notes.length;t++)this.notes[t].resetTuplet(this)}setBracketed(t){return this.bracketed=!!t,this}setRatioed(t){return this.ratioed=!!t,this}setTupletLocation(t){if(t){if(t!==x.LOCATION_TOP&&t!==x.LOCATION_BOTTOM)throw new s.RERR("BadArgument","Invalid tuplet location: "+t)}else t=x.LOCATION_TOP;return this.location=t,this}getNotes(){return this.notes}getNoteCount(){return this.num_notes}beatsOccupiedDeprecationWarning(){const t=["beats_occupied has been deprecated as an ","option for tuplets. Please use notes_occupied ","instead. Calls to getBeatsOccupied and ","setBeatsOccupied should now be routed to ","getNotesOccupied and setNotesOccupied instead"].join("");console&&console.warn?console.warn(t):console&&console.log(t)}getBeatsOccupied(){return this.beatsOccupiedDeprecationWarning(),this.getNotesOccupied()}setBeatsOccupied(t){return this.beatsOccupiedDeprecationWarning(),this.setNotesOccupied(t)}getNotesOccupied(){return this.notes_occupied}setNotesOccupied(t){this.detach(),this.notes_occupied=t,this.resolveGlyphs(),this.attach()}resolveGlyphs(){this.numerator_glyphs=[];let t=this.num_notes;for(;t>=1;)this.numerator_glyphs.unshift(new f("v"+t%10,this.point)),t=parseInt(t/10,10);for(this.denom_glyphs=[],t=this.notes_occupied;t>=1;)this.denom_glyphs.unshift(new f("v"+t%10,this.point)),t=parseInt(t/10,10)}getNestedTupletCount(){const t=this.location,e=this.notes[0];let i=n(e,t),s=n(e,t);function n(t,e){return t.tupletStack.filter((t=>t.location===e)).length}return this.notes.forEach((e=>{const r=n(e,t);i=r>i?r:i,s=r<s?r:s})),i-s}getYPosition(){const t=this.getNestedTupletCount()*x.NESTING_OFFSET*-this.location,e=this.options.y_offset||0,i=this.notes[0];let s;if(this.location===x.LOCATION_TOP){s=i.getStave().getYForLine(0)-15;for(let t=0;t<this.notes.length;++t){const e=this.notes[t].getStemDirection()===v.UP?this.notes[t].getStemExtents().topY-10:this.notes[t].getStemExtents().baseY-20;e<s&&(s=e)}}else{s=i.getStave().getYForLine(4)+20;for(let t=0;t<this.notes.length;++t){const e=this.notes[t].getStemDirection()===v.UP?this.notes[t].getStemExtents().baseY+20:this.notes[t].getStemExtents().topY+10;e>s&&(s=e)}}return s+t+e}draw(){this.checkContext(),this.setRendered();const t=this.notes[0],e=this.notes[this.notes.length-1];this.bracketed?(this.x_pos=t.getTieLeftX()-5,this.width=e.getTieRightX()-this.x_pos+5):(this.x_pos=t.getStemX(),this.width=e.getStemX()-this.x_pos),this.y_pos=this.getYPosition();const i=(t,e)=>t+e.getMetrics().width;let s=this.numerator_glyphs.reduce(i,0);this.ratioed&&(s=this.denom_glyphs.reduce(i,s),s+=.32*this.point);const n=this.x_pos+this.width/2-s/2;if(this.bracketed){const t=this.width/2-s/2-5;t>0&&(this.context.fillRect(this.x_pos,this.y_pos,t,1),this.context.fillRect(this.x_pos+this.width/2+s/2+5,this.y_pos,t,1),this.context.fillRect(this.x_pos,this.y_pos+(this.location===x.LOCATION_BOTTOM),1,10*this.location),this.context.fillRect(this.x_pos+this.width,this.y_pos+(this.location===x.LOCATION_BOTTOM),1,10*this.location))}if(!1!==this.RenderTupletNumber){let t=0;this.numerator_glyphs.forEach((e=>{e.render(this.context,n+t,this.y_pos+this.point/3-2),t+=e.getMetrics().width}))}if(this.ratioed){const t=n+x_offset+.16*this.point,e=.06*this.point;this.context.beginPath(),this.context.arc(t,this.y_pos-.08*this.point,e,0,2*Math.PI,!0),this.context.closePath(),this.context.fill(),this.context.beginPath(),this.context.arc(t,this.y_pos+.12*this.point,e,0,2*Math.PI,!0),this.context.closePath(),this.context.fill(),x_offset+=.32*this.point,this.denom_glyphs.forEach((t=>{t.render(this.context,n+x_offset,this.y_pos+this.point/3-2),x_offset+=t.getMetrics().width}))}}}function _(t){let e=0;return t.forEach((t=>{t.keyProps&&t.keyProps.forEach((t=>{e+=t.line-3}))})),e>=0?v.DOWN:v.UP}const M="L",w="B";class P extends l{static getDefaultBeamGroups(t){t&&"c"!==t||(t="4/4");const e={"1/2":["1/2"],"2/2":["1/2"],"3/2":["1/2"],"4/2":["1/2"],"1/4":["1/4"],"2/4":["1/4"],"3/4":["1/4"],"4/4":["1/4"],"1/8":["1/8"],"2/8":["2/8"],"3/8":["3/8"],"4/8":["2/8"],"1/16":["1/16"],"2/16":["2/16"],"3/16":["3/16"],"4/16":["2/16"]}[t];if(void 0!==e)return e.map((t=>(new n).parse(t)));{const e=parseInt(t.split("/")[0],10),i=parseInt(t.split("/")[1],10);if(e%3==0)return[new n(3,i)];if(i>4)return[new n(2,i)];if(i<=4)return[new n(1,i)]}return[new n(1,4)]}static applyAndGetBeams(t,e,i){return P.generateBeams(t.getTickables(),{groups:i,stem_direction:e})}static generateBeams(t,e){e||(e={}),e.groups&&e.groups.length||(e.groups=[new n(2,8)]);const i=e.groups.map((t=>{if(!t.multiply)throw new s.RuntimeError("InvalidBeamGroups","The beam groups must be an array of Vex.Flow.Fractions");return t.clone().multiply(m.RESOLUTION,1)})),r=t;let o=0,a=[],l=[];function h(){i.length-1>o?o+=1:o=0}!function(){let t=[];r.forEach((e=>{if(t=[],e.shouldIgnoreTicks())return a.push(l),void(l=t);l.push(e);const s=i[o].clone(),r=l.reduce(((t,e)=>e.getTicks().clone().add(t)),new n(0,1)),c=m.durationToNumber(e.duration)<8;c&&e.tuplet&&(s.numerator*=2),r.greaterThan(s)?(c||t.push(l.pop()),a.push(l),l=t,h()):r.equals(s)&&(a.push(l),l=t,h())})),l.length>0&&a.push(l)}(),function(){const t=[];a.forEach((i=>{let s=[];i.forEach(((i,n,r)=>{const o=0===n||n===r.length-1,a=r[n-1],l=!e.beam_rests&&i.isRest(),h=e.beam_rests&&e.beam_middle_only&&i.isRest()&&o;let c=!1;if(e.maintain_stem_directions&&a&&!i.isRest()&&!a.isRest()){const t=a.getStemDirection();c=i.getStemDirection()!==t}const u=parseInt(i.duration,10)<8;l||h||c||u?(s.length>0&&t.push(s),s=c?[i]:[]):s.push(i)})),s.length>0&&t.push(s)})),a=t}(),a.forEach((t=>{let i;if(e.maintain_stem_directions){const e=function(t){for(let e=0;e<t.length;e++){const i=t[e];if(!i.isRest())return i}return!1}(t);i=e?e.getStemDirection():v.UP}else i=e.stem_direction?e.stem_direction:_(t);!function(t,e){t.forEach((t=>{t.setStemDirection(e)}))}(t,i)}));const c=a.filter((t=>{if(t.length>1){let e=!0;return t.forEach((t=>{t.getIntrinsicTicks()>=m.durationToTicks("4")&&(e=!1)})),e}return!1})),u=function(){const t=[];return a.forEach((e=>{let i=null;e.forEach((e=>{e.tuplet&&i!==e.tuplet&&(i=e.tuplet,t.push(i))}))})),t}(),d=[];return c.forEach((t=>{const i=new P(t);e.show_stemlets&&(i.render_options.show_stemlets=!0),e.secondary_breaks&&(i.render_options.secondary_break_ticks=m.durationToTicks(e.secondary_breaks)),!0===e.flat_beams&&(i.render_options.flat_beams=!0,i.render_options.flat_beam_offset=e.flat_beam_offset),d.push(i)})),u.forEach((t=>{const e=t.notes[0].stem_direction===v.DOWN?x.LOCATION_BOTTOM:x.LOCATION_TOP;t.setTupletLocation(e);let i=!1;for(let e=0;e<t.notes.length;e++)if(null===t.notes[e].beam){i=!0;break}t.setBracketed(i)})),d}constructor(t,e){if(super(),this.setAttribute("type","Beam"),!t||t===[])throw new s.RuntimeError("BadArguments","No notes provided for beam.");if(1===t.length)throw new s.RuntimeError("BadArguments","Too few notes for beam.");if(this.ticks=t[0].getIntrinsicTicks(),this.ticks>=m.durationToTicks("4"))throw new s.RuntimeError("BadArguments","Beams can only be applied to notes shorter than a quarter note.");let i,n;for(this.stem_direction=v.UP,i=0;i<t.length;++i)if(n=t[i],n.hasStem()){this.stem_direction=n.getStemDirection();break}let r=this.stem_direction;if(e&&"stavenotes"===t[0].getCategory())r=_(t);else if(e&&"tabnotes"===t[0].getCategory()){const e=t.reduce(((t,e)=>t+e.stem_direction),0);r=e>-1?v.UP:v.DOWN}for(i=0;i<t.length;++i)n=t[i],e&&(n.setStemDirection(r),this.stem_direction=r),n.setBeam(this);this.postFormatted=!1,this.notes=t,this.beam_count=this.getBeamCount(),this.break_on_indices=[],this.render_options={beam_width:5,max_slope:.25,min_slope:-.25,slope_iterations:20,slope_cost:100,show_stemlets:!1,stemlet_extension:7,partial_beam_length:10,flat_beams:!1,min_flat_beam_offset:15}}getNotes(){return this.notes}getBeamCount(){return this.notes.map((t=>t.getGlyph().beam_count)).reduce(((t,e)=>e>t?e:t))}breakSecondaryAt(t){return this.break_on_indices=t,this}getSlopeY(t,e,i,s){return i+(t-e)*s}calculateSlope(){const{notes:t,stem_direction:e,render_options:{max_slope:i,min_slope:s,slope_iterations:n,slope_cost:r}}=this,o=t[0],a=((t,e)=>{const i=t.getStemExtents().topY,s=t.getStemX();return(e.getStemExtents().topY-i)/(e.getStemX()-s)})(o,t[t.length-1]),l=(i-s)/n;let h=Number.MAX_VALUE,c=0,u=0;for(let n=s;n<=i;n+=l){let i=0,s=0;for(let r=1;r<t.length;++r){const a=t[r],l=this.getSlopeY(a.getStemX(),o.getStemX(),o.getStemExtents().topY,n)+s,h=a.getStemExtents().topY;if(h*e<l*e){const t=Math.abs(h-l);s+=t*-e,i+=t*r}else i+=(h-l)*e}const l=a/2,d=r*Math.abs(l-n)+Math.abs(i);d<h&&(h=d,c=n,u=s)}this.slope=c,this.y_shift=u}calculateFlatSlope(){const{notes:t,stem_direction:e,render_options:{beam_width:i,min_flat_beam_offset:s,flat_beam_offset:n}}=this;let r=0,o=0,a=0,l=0;for(let i=0;i<t.length;i++){const s=t[i],n=s.getStemExtents().topY;r+=n,e===v.DOWN&&l<n?(l=n,o=Math.max(...s.getYs()),a=s.getBeamCount()):e===v.UP&&(0===l||l>n)&&(l=n,o=Math.min(...s.getYs()),a=s.getBeamCount())}let h=r/t.length;const c=s+a*(1.5*i),u=o+c*-e;e===v.DOWN&&h<u?h=o+c:e===v.UP&&h>u&&(h=o-c),n+this.render_options.flat_beam_offset_per_beam>0?(e===v.DOWN&&h>n&&!this.render_options.flat_beams||e===v.UP&&h<n&&!this.render_options.flat_beams)&&(this.render_options.flat_beam_offset=h):this.render_options.flat_beam_offset=h,this.slope=0,this.y_shift=0}getBeamYToDraw(){let t=this.notes[0].getStemExtents().topY;if(this.render_options.flat_beams&&this.render_options.flat_beam_offset+this.render_options.flat_beam_offset_per_beam>0){let e=this.render_options.flat_beam_offset;this.render_options.flat_beam_offset_per_beam&&(e+=this.render_options.flat_beam_offset_per_beam*this.getBeamCount());let i=this.notes[0].note_heads[0].y;const s=this.stem_direction>0?Math.min:Math.max;for(const t of this.notes)for(const e of t.note_heads)i=s(i,e.y);t=i+e*-this.stem_direction}return t}applyStemExtensions(){const{notes:t,slope:e,y_shift:i,stem_direction:s,beam_count:n,render_options:{show_stemlets:r,stemlet_extension:o,beam_width:a}}=this,l=t[0],h=this.getBeamYToDraw(),c=l.getStemX();for(let l=0;l<t.length;++l){const u=t[l],d=u.getStemX(),{topY:f}=u.getStemExtents(),m=this.getSlopeY(d,c,h,e)+i,p=u.getStem().getExtension(),b=s===v.UP?f-m:m-f;if(u.stem.setExtension(p+b),u.stem.renderHeightAdjustment=-v.WIDTH/2,u.isRest()&&r){const t=(n-1)*a*1.5+a;u.stem.setVisibility(!0).setStemlet(!0,t+o)}}}lookupBeamDirection(t,e,i,s){if("4"===t)return M;const n=""+m.durationToNumber(t)/2,r=e<m.durationToTicks(n),o=s<m.durationToTicks(n),a=i<m.durationToTicks(n);return r&&o&&a?w:r&&!o&&a?M:!r&&o&&a?"R":this.lookupBeamDirection(n,e,i,s)}getBeamLines(t){const e=m.durationToTicks(t),i=[];let s=!1,n=null;const r=this.render_options.partial_beam_length;let o=!1,a=0;for(let l=0;l<this.notes.length;++l){const h=this.notes[l];a+=h.ticks.value();let c=!1;parseInt(t,10)>=8&&(c=-1!==this.break_on_indices.indexOf(l),this.render_options.secondary_break_ticks&&a>=this.render_options.secondary_break_ticks&&(a=0,c=!0));const u=h.getIntrinsicTicks()<e,d=h.getStemX()-v.WIDTH/2,f=this.notes[l-1],m=this.notes[l+1],p=m&&m.getIntrinsicTicks()<e,b=f&&f.getIntrinsicTicks()<e,g=f&&m&&u&&!b&&!p;if(u)if(s)n=i[i.length-1],n.end=d,c&&(s=!1,m&&!p&&null===n.end&&(n.end=n.start-r));else{if(n={start:d,end:null,start_note:h},s=!0,g){const e=f.getIntrinsicTicks(),i=m.getIntrinsicTicks(),s=h.getIntrinsicTicks(),o=this.lookupBeamDirection(t,e,s,i);[M,w].includes(o)?n.end=n.start-r:n.end=n.start+r}else p?c&&(n.end=n.start-r,s=!1):n.end=(o||0===l)&&m?n.start+r:n.start-r;i.push(n)}else s=!1;o=c}const l=i[i.length-1];return l&&null===l.end&&(l.end=l.start-r),i}drawStems(){this.notes.forEach((t=>{t.getStem()&&(this.context.openGroup("stem",t.getAttribute("id")+"-stem"),t.getStem().setContext(this.context).draw(),this.context.closeGroup())}),this)}drawBeamLines(){this.checkContext();const t=["4","8","16","32","64"],e=this.notes[0];let i=this.getBeamYToDraw();const s=e.getStemX(),n=this.render_options.beam_width*this.stem_direction,r={};for(const t of this.notes)r[t.getAttribute("id")]=0;for(let e=0;e<t.length;++e){const o=t[e],a=this.getBeamLines(o);for(let t=0;t<a.length;++t){const e=a[t],o=e.start,l=e.start_note.getAttribute("id"),h=r[l];r[l]++;const c=this.getSlopeY(o,s,i,this.slope),u=e.end,d=this.getSlopeY(u,s,i,this.slope),f=l;this.context.openGroup("beam",`${f}-beam${h}`),this.context.beginPath(),this.context.moveTo(o,c),this.context.lineTo(o,c+n),this.context.lineTo(u+1,d+n),this.context.lineTo(u+1,d),this.context.closePath(),this.context.fill(),this.context.closeGroup()}i+=1.5*n}}preFormat(){return this}postFormat(){this.postFormatted||("tabnotes"===this.notes[0].getCategory()||this.render_options.flat_beams?this.calculateFlatSlope():this.calculateSlope(),this.applyStemExtensions(),this.postFormatted=!0)}draw(){this.checkContext(),this.setRendered(),this.unbeamable||(this.postFormatted||this.postFormat(),this.drawStems(),this.applyStyle(),this.drawBeamLines(),this.restoreStyle())}}class T extends l{static get Mode(){return{STRICT:1,SOFT:2,FULL:3}}constructor(t){if(super(),this.setAttribute("type","Voice"),"string"==typeof t){const e=t.match(/(\d+)\/(\d+)/);e&&(t={num_beats:e[1],beat_value:e[2],resolution:m.RESOLUTION})}this.time=s.Merge({num_beats:4,beat_value:4,resolution:m.RESOLUTION},t),this.totalTicks=new n(this.time.num_beats*(this.time.resolution/this.time.beat_value),1),this.resolutionMultiplier=1,this.tickables=[],this.ticksUsed=new n(0,1),this.smallestTickCount=this.totalTicks.clone(),this.largestTickWidth=0,this.stave=null,this.mode=T.Mode.STRICT,this.voiceGroup=null}getTotalTicks(){return this.totalTicks}getTicksUsed(){return this.ticksUsed}getLargestTickWidth(){return this.largestTickWidth}getSmallestTickCount(){return this.smallestTickCount}getTickables(){return this.tickables}getMode(){return this.mode}setMode(t){return this.mode=t,this}getResolutionMultiplier(){return this.resolutionMultiplier}getActualResolution(){return this.resolutionMultiplier*this.time.resolution}setStave(t){return this.stave=t,this.boundingBox=null,this}getBoundingBox(){let t,e,i,n;if(!this.boundingBox){if(!this.stave)throw new s.RERR("NoStave","Can't get bounding box without stave.");for(t=this.stave,e=null,n=0;n<this.tickables.length;++n)this.tickables[n].setStave(t),i=this.tickables[n].getBoundingBox(),i&&(e=e?e.mergeWith(i):i);this.boundingBox=e}return this.boundingBox}getVoiceGroup(){if(!this.voiceGroup)throw new s.RERR("NoVoiceGroup","No voice group for voice.");return this.voiceGroup}setVoiceGroup(t){return this.voiceGroup=t,this}setStrict(t){return this.mode=t?T.Mode.STRICT:T.Mode.SOFT,this}isComplete(){return this.mode!==T.Mode.STRICT&&this.mode!==T.Mode.FULL||this.ticksUsed.equals(this.totalTicks)}addTickable(t){if(!t.shouldIgnoreTicks()){const e=t.getTicks();if(this.ticksUsed.add(e),(this.mode===T.Mode.STRICT||this.mode===T.Mode.FULL)&&this.ticksUsed.greaterThan(this.totalTicks))throw this.ticksUsed.subtract(e),new s.RERR("BadArgument","Too many ticks.");e.lessThan(this.smallestTickCount)&&(this.smallestTickCount=e.clone()),this.resolutionMultiplier=this.ticksUsed.denominator,this.totalTicks.add(0,this.ticksUsed.denominator)}return this.tickables.push(t),t.setVoice(this),this}addTickables(t){for(let e=0;e<t.length;++e)this.addTickable(t[e]);return this}preFormat(){return this.preFormatted||(this.tickables.forEach((t=>{t.getStave()||t.setStave(this.stave)})),this.preFormatted=!0),this}draw(t=this.context,e=this.stave){this.setRendered();let i=null;for(let n=0;n<this.tickables.length;++n){const r=this.tickables[n];if(e&&r.setStave(e),!r.getStave())throw new s.RuntimeError("MissingStave","The voice cannot draw tickables without staves.");if(0===n&&(i=r.getBoundingBox()),n>0&&i){const t=r.getBoundingBox();t&&i.mergeWith(t)}r.setContext(t),r.drawWithStyle()}this.boundingBox=i}}function L(t,e,i,n,r){if(e!==A.type.BOLD_DOUBLE_LEFT&&e!==A.type.BOLD_DOUBLE_RIGHT)throw new s.RERR("InvalidConnector","A REPEAT_BEGIN or REPEAT_END type must be provided.");let o=3,a=3.5;e===A.type.BOLD_DOUBLE_RIGHT&&(o=-5,a=3),t.fillRect(i+o,n,1,r-n),t.fillRect(i-2,n,a,r-n)}class A extends l{static get type(){return{SINGLE_RIGHT:0,SINGLE_LEFT:1,SINGLE:1,DOUBLE:2,BRACE:3,BRACKET:4,BOLD_DOUBLE_LEFT:5,BOLD_DOUBLE_RIGHT:6,THIN_DOUBLE:7,NONE:8}}static get typeString(){return{singleRight:A.type.SINGLE_RIGHT,singleLeft:A.type.SINGLE_LEFT,single:A.type.SINGLE,double:A.type.DOUBLE,brace:A.type.BRACE,bracket:A.type.BRACKET,boldDoubleLeft:A.type.BOLD_DOUBLE_LEFT,boldDoubleRight:A.type.BOLD_DOUBLE_RIGHT,thinDouble:A.type.THIN_DOUBLE,none:A.type.NONE}}constructor(t,e){super(),this.setAttribute("type","StaveConnector"),this.thickness=m.STAVE_LINE_THICKNESS,this.width=3,this.top_stave=t,this.bottom_stave=e,this.type=A.type.DOUBLE,this.font={family:"times",size:16,weight:"normal"},this.x_shift=0,this.texts=[]}setType(t){return(t="string"==typeof t?A.typeString[t]:t)>=A.type.SINGLE_RIGHT&&t<=A.type.NONE&&(this.type=t),this}setText(t,e){return this.texts.push({content:t,options:s.Merge({shift_x:0,shift_y:0},e)}),this}setFont(t){s.Merge(this.font,t)}setXShift(t){if("number"!=typeof t)throw s.RERR("InvalidType","x_shift must be a Number");return this.x_shift=t,this}draw(){const t=this.checkContext();this.setRendered();let e=this.top_stave.getYForLine(0),i=this.bottom_stave.getYForLine(this.bottom_stave.getNumLines()-1)+this.thickness,n=this.width,r=this.top_stave.getX();(this.type===A.type.SINGLE_RIGHT||this.type===A.type.BOLD_DOUBLE_RIGHT||this.type===A.type.THIN_DOUBLE)&&(r=this.top_stave.getX()+this.top_stave.width);let o=i-e;switch(this.type){case A.type.SINGLE:case A.type.SINGLE_LEFT:case A.type.SINGLE_RIGHT:n=1;break;case A.type.DOUBLE:r-=this.width+2;break;case A.type.BRACE:{n=12;const s=this.top_stave.getX()-2+this.x_shift,r=e,a=s,l=i,h=s-n,c=r+o/2,u=h-.9*n,d=r+.2*o,f=s+1.1*n,m=c-.135*o,p=f,b=c+.135*o,g=u,S=l-.2*o,y=h-n,E=S,v=s+.4*n,x=c+.135*o,_=v,M=c-.135*o,w=y,P=d;t.beginPath(),t.moveTo(s,r),t.bezierCurveTo(u,d,f,m,h,c),t.bezierCurveTo(p,b,g,S,a,l),t.bezierCurveTo(y,E,v,x,h,c),t.bezierCurveTo(_,M,w,P,s,r),t.fill(),t.stroke();break}case A.type.BRACKET:e-=4,i+=4,o=i-e,f.renderGlyph(t,r-5,e-3,40,"v1b",!0),f.renderGlyph(t,r-5,i+3,40,"v10",!0),r-=this.width+2;break;case A.type.BOLD_DOUBLE_LEFT:L(t,this.type,r+this.x_shift,e,i);break;case A.type.BOLD_DOUBLE_RIGHT:L(t,this.type,r,e,i);break;case A.type.THIN_DOUBLE:n=1;break;case A.type.NONE:break;default:throw new s.RERR("InvalidType",`The provided StaveConnector.type (${this.type}) is invalid`)}this.type!==A.type.BRACE&&this.type!==A.type.BOLD_DOUBLE_LEFT&&this.type!==A.type.BOLD_DOUBLE_RIGHT&&this.type!==A.type.NONE&&t.fillRect(r,e,n,o),this.type===A.type.THIN_DOUBLE&&t.fillRect(r-3,e,n,o),t.save(),t.lineWidth=2,t.setFont(this.font.family,this.font.size,this.font.weight);for(let e=0;e<this.texts.length;e++){const i=this.texts[e],s=t.measureText(""+i.content).width,n=this.top_stave.getX()-s-24+i.options.shift_x,r=(this.top_stave.getYForLine(0)+this.bottom_stave.getBottomLineY())/2+i.options.shift_y;t.fillText(""+i.content,n,r+4)}t.restore()}}class C extends l{constructor(){super(),this.setAttribute("type","Tickable"),this.ticks=new n(0,1),this.intrinsicTicks=0,this.tickMultiplier=new n(1,1),this.width=0,this.x_shift=0,this.voice=null,this.tickContext=null,this.modifierContext=null,this.modifiers=[],this.preFormatted=!1,this.postFormatted=!1,this.tuplet=null,this.tupletStack=[],this.align_center=!1,this.center_x_shift=0,this.ignore_ticks=!1,this.formatterMetrics={freedom:{left:0,right:0},duration:"",iterations:0,space:{used:0,mean:0,deviation:0}}}reset(){return this}getTicks(){return this.ticks}shouldIgnoreTicks(){return this.ignore_ticks}getWidth(){return this.width}getFormatterMetrics(){return this.formatterMetrics}setXShift(t){this.x_shift=t}getCenterXShift(){return this.isCenterAligned()?this.center_x_shift:0}isCenterAligned(){return this.align_center}setCenterAlignment(t){return this.align_center=t,this}getVoice(){if(!this.voice)throw new s.RERR("NoVoice","Tickable has no voice.");return this.voice}setVoice(t){this.voice=t}getTuplet(){return this.tuplet}resetTuplet(t){let e,i;if(t){const s=this.tupletStack.indexOf(t);return-1!==s&&(this.tupletStack.splice(s,1),e=t.getNoteCount(),i=t.getNotesOccupied(),this.applyTickMultiplier(e,i)),this}for(;this.tupletStack.length;)e=(t=this.tupletStack.pop()).getNoteCount(),i=t.getNotesOccupied(),this.applyTickMultiplier(e,i);return this}setTuplet(t){if(t){this.tupletStack.push(t);const e=t.getNoteCount(),i=t.getNotesOccupied();this.applyTickMultiplier(i,e)}return this.tuplet=t,this}addToModifierContext(t){this.modifierContext=t,this.preFormatted=!1}addModifier(t){return this.modifiers.push(t),this.preFormatted=!1,this}getModifiers(){return this.modifiers}setTickContext(t){this.tickContext=t,this.preFormatted=!1}preFormat(){this.preFormatted||(this.width=0,this.modifierContext&&(this.modifierContext.preFormat(),this.width+=this.modifierContext.getWidth()))}postFormat(){return this.postFormatted||(this.postFormatted=!0),this}getIntrinsicTicks(){return this.intrinsicTicks}setIntrinsicTicks(t){this.intrinsicTicks=t,this.ticks=this.tickMultiplier.clone().multiply(this.intrinsicTicks)}getTickMultiplier(){return this.tickMultiplier}applyTickMultiplier(t,e){this.tickMultiplier.multiply(t,e),this.ticks=this.tickMultiplier.clone().multiply(this.intrinsicTicks)}setDuration(t){const e=t.numerator*(m.RESOLUTION/t.denominator);this.ticks=this.tickMultiplier.clone().multiply(e),this.intrinsicTicks=this.ticks.value()}}class I extends C{static get CATEGORY(){return"note"}static get STAVEPADDING(){return 12}static plotMetrics(t,e,i){const n=e.getMetrics(),r=e.getAbsoluteX()-n.modLeftPx-n.extraLeftPx,o=e.getAbsoluteX()-n.extraLeftPx,a=e.getAbsoluteX(),l=e.getAbsoluteX()+n.noteWidth,h=e.getAbsoluteX()+n.noteWidth+n.extraRightPx,c=e.getAbsoluteX()+n.noteWidth+n.extraRightPx+n.modRightPx,u=c+e.getFormatterMetrics().freedom.right,d=c-r;t.save(),t.setFont("Arial",8,""),t.fillText(Math.round(d)+"px",r+e.getXShift(),i);const f=i+7;function m(i,s,n,r=f){t.beginPath(),t.setStrokeStyle(n),t.setFillStyle(n),t.setLineWidth(3),t.moveTo(i+e.getXShift(),r),t.lineTo(s+e.getXShift(),r),t.stroke()}m(r,o,"red"),m(o,a,"#999"),m(a,l,"green"),m(l,h,"#999"),m(h,c,"red"),m(c,u,"#DD0"),m(r-e.getXShift(),r,"#BBB"),s.drawDot(t,a+e.getXShift(),f,"blue");const p=e.getFormatterMetrics();if(p.iterations>0){const s=p.space.deviation,n=s>=0?"+":"";t.setFillStyle("red"),t.fillText(n+Math.round(s),a+e.getXShift(),i-10)}t.restore()}constructor(t){if(super(),this.setAttribute("type","Note"),!t)throw new s.RuntimeError("BadArguments","Note must have valid initialization data to identify duration and type.");const e=m.parseNoteStruct(t);if(!e)throw new s.RuntimeError("BadArguments",`Invalid note initialization object: ${JSON.stringify(t)}`);if(this.duration=e.duration,this.dots=e.dots,this.noteType=e.type,this.customTypes=e.customTypes,t.duration_override?this.setDuration(t.duration_override):this.setIntrinsicTicks(e.ticks),this.modifiers=[],this.glyph=m.getGlyphProps(this.duration,this.noteType),this.customGlyphs=this.customTypes.map((t=>m.getGlyphProps(this.duration,t))),this.positions&&("object"!=typeof this.positions||!this.positions.length))throw new s.RuntimeError("BadArguments","Note keys must be array type.");this.playNote=null,this.tickContext=null,this.modifierContext=null,this.ignore_ticks=!1,this.width=0,this.extraLeftPx=0,this.extraRightPx=0,this.x_shift=0,this.left_modPx=0,this.right_modPx=0,this.voice=null,this.preFormatted=!1,this.ys=[],t.align_center&&this.setCenterAlignment(t.align_center),this.stave=null,this.render_options={annotation_spacing:5,stave_padding:I.STAVEPADDING}}getPlayNote(){return this.playNote}setPlayNote(t){return this.playNote=t,this}isRest(){return!1}addStroke(t,e){return e.setNote(this),e.setIndex(t),this.modifiers.push(e),this.setPreFormatted(!1),this}getStave(){return this.stave}setStave(t){return this.stave=t,this.setYs([t.getYForLine(0)]),this.context=this.stave.context,this}getCategory(){return I.CATEGORY}setContext(t){return this.context=t,this}getExtraLeftPx(){return this.extraLeftPx}getExtraRightPx(){return this.extraRightPx}setExtraLeftPx(t){return this.extraLeftPx=t,this}setExtraRightPx(t){return this.extraRightPx=t,this}shouldIgnoreTicks(){return this.ignore_ticks}getLineNumber(){return 0}getLineForRest(){return 0}getGlyph(){return this.glyph}getGlyphWidth(){return this.glyph.getWidth(this.render_options.glyph_font_scale)}setYs(t){return this.ys=t,this}getYs(){if(0===this.ys.length)throw new s.RERR("NoYValues","No Y-values calculated for this note.");return this.ys}getYForTopText(t){if(!this.stave)throw new s.RERR("NoStave","No stave attached to this note.");return this.stave.getYForTopText(t)}getBoundingBox(){return null}getVoice(){if(!this.voice)throw new s.RERR("NoVoice","Note has no voice.");return this.voice}setVoice(t){return this.voice=t,this.preFormatted=!1,this}getTickContext(){return this.tickContext}setTickContext(t){return this.tickContext=t,this.preFormatted=!1,this}getDuration(){return this.duration}isDotted(){return this.dots>0}hasStem(){return!1}getDots(){return this.dots}getNoteType(){return this.noteType}setBeam(){return this}setModifierContext(t){return this.modifierContext=t,this}addModifier(t,e=0){return t.setNote(this),t.setIndex(e),this.modifiers.push(t),this.setPreFormatted(!1),this}getModifierStartXY(){if(!this.preFormatted)throw new s.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");return{x:this.getAbsoluteX(),y:this.ys[0]}}getMetrics(){if(!this.preFormatted)throw new s.RERR("UnformattedNote","Can't call getMetrics on an unformatted note.");let t=0,e=0;null!=this.modifierContext&&(t=this.modifierContext.state.left_shift,e=this.modifierContext.state.right_shift);const i=this.getWidth();return{width:i,noteWidth:i-t-e-this.extraLeftPx-this.extraRightPx,left_shift:this.x_shift,modLeftPx:t,modRightPx:e,extraLeftPx:this.extraLeftPx,extraRightPx:this.extraRightPx}}setWidth(t){this.width=t}getWidth(){if(!this.preFormatted)throw new s.RERR("UnformattedNote","Can't call GetWidth on an unformatted note.");return this.width+(this.modifierContext?this.modifierContext.getWidth():0)}setXShift(t){return this.x_shift=t,this}getXShift(){return this.x_shift}getX(){if(!this.tickContext)throw new s.RERR("NoTickContext","Note needs a TickContext assigned for an X-Value");return this.tickContext.getX()+this.x_shift}getAbsoluteX(){if(!this.tickContext)throw new s.RERR("NoTickContext","Note needs a TickContext assigned for an X-Value");let t=this.tickContext.getX();return this.stave&&(t+=this.stave.getNoteStartX()+this.render_options.stave_padding),this.isCenterAligned()&&(t+=this.getCenterXShift()),t}setPreFormatted(t){if(this.preFormatted=t,this.preFormatted){const t=this.tickContext.getExtraPx();this.left_modPx=Math.max(this.left_modPx,t.left),this.right_modPx=Math.max(this.right_modPx,t.right)}}}class R extends I{static get CATEGORY(){return"notehead"}constructor(t){if(super(t),this.setAttribute("type","NoteHead"),this.index=t.index,this.x=t.x||0,this.y=t.y||0,this.note_type=t.note_type,this.duration=t.duration,this.displaced=t.displaced||!1,this.stem_direction=t.stem_direction||O.STEM_UP,this.line=t.line,this.glyph=m.getGlyphProps(this.duration,this.note_type),!this.glyph)throw new s.RuntimeError("BadArguments",`No glyph found for duration '${this.duration}' and type '${this.note_type}'`);this.glyph_code=this.glyph.code_head,this.x_shift=t.x_shift||0,t.custom_glyph_code&&(this.custom_glyph=!0,this.glyph_code=t.custom_glyph_code,this.stem_up_x_offset=t.stem_up_x_offset||0,this.stem_down_x_offset=t.stem_down_x_offset||0),this.style=t.style,this.slashed=t.slashed,s.Merge(this.render_options,{glyph_font_scale:t.glyph_font_scale||m.DEFAULT_NOTATION_FONT_SCALE,stroke_px:3}),this.setWidth(this.glyph.getWidth(this.render_options.glyph_font_scale))}getCategory(){return R.CATEGORY}getWidth(){return this.width}isDisplaced(){return!0===this.displaced}getGlyph(){return this.glyph}setX(t){return this.x=t,this}getY(){return this.y}setY(t){return this.y=t,this}getLine(){return this.line}setLine(t){return this.line=t,this}getAbsoluteX(){const t=this.preFormatted?super.getAbsoluteX():this.x,e=v.WIDTH/2;return t+(this.displaced?(this.width-e)*this.stem_direction:0)}getBoundingBox(){if(!this.preFormatted)throw new s.RERR("UnformattedNote","Can't call getBoundingBox on an unformatted note.");const t=this.stave.getSpacingBetweenLines(),e=t/2,i=this.y-e;return new m.BoundingBox(this.getAbsoluteX(),i,this.width,t)}setStave(t){const e=this.getLine();return this.stave=t,this.setY(t.getYForNote(e)),this.context=this.stave.context,this}preFormat(){if(this.preFormatted)return this;const t=this.getWidth()+this.extraLeftPx+this.extraRightPx;return this.setWidth(t),this.setPreFormatted(!0),this}draw(){this.checkContext(),this.setRendered();const t=this.context;let e=this.getAbsoluteX();this.custom_glyph&&(e+=this.stem_direction===v.UP?this.stem_up_x_offset:this.stem_down_x_offset);const i=this.y;!function(...t){R.DEBUG&&s.L("Vex.Flow.NoteHead",t)}("Drawing note head '",this.note_type,this.duration,"' at",e,i);const n=this.stem_direction,r=this.render_options.glyph_font_scale;if(this.style&&this.applyStyle(t),"s"===this.note_type){const s=this.stave.getSpacingBetweenLines();!function(t,e,i,s,n,r){const o=m.SLASH_NOTEHEAD_WIDTH;t.save(),t.setLineWidth(m.STEM_WIDTH);let a=!1;if(m.durationToNumber(e)>2&&(a=!0),a||(i-=m.STEM_WIDTH/2*n),t.beginPath(),t.moveTo(i,s+r),t.lineTo(i,s+1),t.lineTo(i+o,s-r),t.lineTo(i+o,s),t.lineTo(i,s+r),t.closePath(),a?t.fill():t.stroke(),m.durationToFraction(e).equals(.5)){const e=[-3,-1,o+1,o+3];for(let n=0;n<e.length;n++)t.beginPath(),t.moveTo(i+e[n],s-10),t.lineTo(i+e[n],s+11),t.stroke()}t.restore()}(t,this.duration,e,i,n,s)}else f.renderGlyph(t,e,i,r,this.glyph_code);this.style&&this.restoreStyle(t)}}class N extends I{constructor(t){super(t),this.setAttribute("type","StemmableNote"),this.stem=null,this.stemExtensionOverride=null,this.beam=null,this.renderFlag=!0}getStem(){return this.stem}setStem(t){return this.stem=t,this}buildStem(){const t=new v;return this.setStem(t),this}buildFlag(){const{glyph:t,beam:e}=this,i=null===e&&this.renderFlag;if(t&&t.flag&&i){const e=this.getStemDirection()===v.DOWN?t.code_flag_downstem:t.code_flag_upstem;this.flag=new f(e,this.render_options.glyph_font_scale)}}getTopGlyph(){return this.getStemDirection()===v.DOWN?this.customGlyphs[this.customGlyphs.length-1]:this.customGlyphs[0]}getStemLength(){return v.HEIGHT+this.getStemExtension()}getBeamCount(){const t=this.getGlyph();return t?t.beam_count:0}getStemMinumumLength(){let t=m.durationToFraction(this.duration).value()<=1?0:20;switch(this.duration){case"8":null==this.beam&&(t=35);break;case"16":t=null==this.beam?35:25;break;case"32":t=null==this.beam?45:35;break;case"64":t=null==this.beam?50:40;break;case"128":t=null==this.beam?55:45}return t}getStemDirection(){return this.stem_direction}setStemDirection(t){if(t||(t=v.UP),t!==v.UP&&t!==v.DOWN)throw new s.RERR("BadArgument",`Invalid stem direction: ${t}`);if(this.stem_direction=t,this.stem){this.stem.setDirection(t),this.stem.setExtension(this.getStemExtension());const e=this.getTopGlyph()||this.getGlyph();this.stem.setOptions({stem_up_y_offset:e.stem_up_y_offset,stem_down_y_offset:e.stem_down_y_offset})}return this.reset(),this.flag&&this.renderFlag&&this.buildFlag(),this.beam=null,this.preFormatted&&this.preFormat(),this}getStemX(){const t=this.getAbsoluteX()+this.x_shift,e=this.getAbsoluteX()+this.x_shift+this.getGlyphWidth();return this.stem_direction===v.DOWN?t:e}getCenterGlyphX(){return this.getAbsoluteX()+this.x_shift+this.getGlyphWidth()/2}getStemExtension(){const t=this.getGlyph();return null!=this.stemExtensionOverride?this.stemExtensionOverride:t?1===this.getStemDirection()?t.stem_up_extension:t.stem_down_extension:0}setStemLength(t){return this.stemExtensionOverride=t-v.HEIGHT,this}getStemExtents(){return this.stem.getExtents()}setBeam(t){return this.beam=t,this}getYForTopText(t){const e=this.getStemExtents();return this.hasStem()?Math.min(this.stave.getYForTopText(t),e.topY-this.render_options.annotation_spacing*(t+1)):this.stave.getYForTopText(t)}getYForBottomText(t){const e=this.getStemExtents();return this.hasStem()?Math.max(this.stave.getYForTopText(t),e.baseY+this.render_options.annotation_spacing*t):this.stave.getYForBottomText(t)}hasFlag(){return this.renderFlag&&m.getGlyphProps(this.duration).flag&&!this.beam}postFormat(){return this.beam&&this.beam.postFormat(),this.postFormatted=!0,this}drawStem(t){this.checkContext(),this.setRendered(),this.setStem(new v(t)),this.stem.setContext(this.context).draw()}}class B extends l{static get CATEGORY(){return"none"}static get Position(){return{LEFT:1,RIGHT:2,ABOVE:3,BELOW:4}}static get PositionString(){return{above:B.Position.ABOVE,below:B.Position.BELOW,left:B.Position.LEFT,right:B.Position.RIGHT}}constructor(){super(),this.setAttribute("type","Modifier"),this.width=0,this.note=null,this.index=null,this.text_line=0,this.position=B.Position.LEFT,this.modifier_context=null,this.x_shift=0,this.y_shift=0,this.spacingFromNextModifier=0}getCategory(){return B.CATEGORY}getWidth(){return this.width}setWidth(t){return this.width=t,this}getNote(){return this.note}setNote(t){return this.note=t,this}getIndex(){return this.index}setIndex(t){return this.index=t,this}getModifierContext(){return this.modifier_context}setModifierContext(t){return this.modifier_context=t,this}getPosition(){return this.position}setPosition(t){return this.position="string"==typeof t?B.PositionString[t]:t,this}setTextLine(t){return this.text_line=t,this}setYShift(t){return this.y_shift=t,this}setSpacingFromNextModifier(t){this.spacingFromNextModifier=t}getSpacingFromNextModifier(){return this.spacingFromNextModifier}setXShift(t){this.x_shift=0,this.position===B.Position.LEFT?this.x_shift-=t:this.x_shift+=t}getXShift(){return this.x_shift}draw(){throw this.checkContext(),new s.RERR("MethodNotImplemented","draw() not implemented for this modifier.")}alignSubNotesWithNote(t,e){const i=e.getTickContext(),s=i.getExtraPx(),n=i.getX()-s.left-s.extraLeft+this.getSpacingFromNextModifier();t.forEach((t=>{const i=t.getTickContext();t.setStave(e.stave),i.setXOffset(n)}))}}class F extends B{static get CATEGORY(){return"dots"}static format(t,e){const i=e.right_shift;if(!t||0===t.length)return!1;const s=[],n={};for(let e=0;e<t.length;++e){const i=t[e],r=i.getNote();let o,a;"function"==typeof r.getKeyProps?(o=r.getKeyProps()[i.getIndex()],a=o.displaced?r.getExtraRightPx():0):(o={line:.5},a=0);const l=r.getAttribute("id");s.push({line:o.line,note:r,note_id:l,dot:i}),n[l]=Math.max(n[l]||a,a)}s.sort(((t,e)=>e.line-t.line));let r=i,o=0,a=null,l=null,h=null,c=0;for(let t=0;t<s.length;++t){const{dot:e,note:i,note_id:u,line:d}=s[t];d===a&&i===l||(r=n[u]),i.isRest()||d===a||(.5===Math.abs(d%1)?c=0:(c=.5,null==l||l.isRest()||a-d!=.5?d+c===h&&(c=-.5):c=-.5)),i.isRest()?e.dot_shiftY+=-c:e.dot_shiftY=-c,h=d+c,e.setXShift(r),r+=e.getWidth()+1,o=r>o?r:o,a=d,l=i}return e.right_shift+=o,!0}constructor(){super(),this.setAttribute("type","Dot"),this.note=null,this.index=null,this.position=B.Position.RIGHT,this.radius=2,this.setWidth(5),this.dot_shiftY=0}getCategory(){return F.CATEGORY}setNote(t){this.note=t,"gracenotes"===this.note.getCategory()&&(this.radius*=.5,this.setWidth(3))}setDotShiftY(t){return this.dot_shiftY=t,this}draw(){if(this.checkContext(),this.setRendered(),!this.note||null===this.index)throw new s.RERR("NoAttachedNote","Can't draw dot without a note and index.");const t=this.note.stave.options.spacing_between_lines_px,e=this.note.getModifierStartXY(this.position,this.index,{forceFlagRight:!0});"tabnotes"===this.note.getCategory()&&(e.y=this.note.getStemExtents().baseY);const i=e.x+this.x_shift+this.width-this.radius,n=e.y+this.y_shift+this.dot_shiftY*t,r=this.context;r.beginPath(),r.arc(i,n,this.radius,0,2*Math.PI,!1),r.fill()}}function D(t,e,i){const s=(e.isrest?0:1)*i;t.line+=s,t.maxLine+=s,t.minLine+=s,t.note.setKeyLine(0,t.note.getKeyLine(0)+s)}class O extends N{static get CATEGORY(){return"stavenotes"}static get STEM_UP(){return v.UP}static get STEM_DOWN(){return v.DOWN}static get DEFAULT_LEDGER_LINE_OFFSET(){return 3}static format(t,e){if(!t||t.length<2)return!1;const i=[],n=t[0].stagger_same_whole_notes;for(let e=0;e<t.length;e++){const s=t[e].getKeyProps(),n=s[0].line;let r=s[s.length-1].line;const o=t[e].getStemDirection(),a=t[e].getStemLength()/10,l=t[e].getStemMinumumLength()/10;let h;t[e].isRest()?(h=n+t[e].glyph.line_above,r=n-t[e].glyph.line_below):(h=1===o?s[s.length-1].line+a:s[s.length-1].line,r=1===o?s[0].line:s[0].line-a),i.push({line:s[0].line,maxLine:h,minLine:r,isrest:t[e].isRest(),stemDirection:o,stemMax:a,stemMin:l,voice_shift:t[e].getVoiceShiftWidth(),is_displaced:t[e].isDisplaced(),note:t[e]})}const r=i.length;let o=i[0];const a=r>2?i[1]:null;let l=r>2?i[2]:i[1];2===r&&-1===o.stemDirection&&1===l.stemDirection&&(o=i[1],l=i[0]);const h=Math.max(o.voice_shift,l.voice_shift);let c,u=0;if(2===r){const t=o.stemDirection===l.stemDirection?0:.5;if(o.stemDirection===l.stemDirection&&o.minLine<=l.maxLine&&(o.isrest||(c=Math.abs(o.line-(l.maxLine+.5)),c=Math.max(c,o.stemMin),o.minLine=o.line-c,o.note.setStemLength(10*c))),o.minLine<=l.maxLine+t)if(o.isrest)D(o,l,1);else if(l.isrest)D(l,o,-1);else{u=h;const t=Math.abs(o.line-l.line);let e=0,i=0;"h"===o.note.duration?e++:"w"===o.note.duration&&i++,"h"===l.note.duration?e++:"w"===l.note.duration&&i++;let s=1===e||1===i||o.note.dots!==l.note.dots;if(n&&(s=s||2===i),0===t&&s){if(l.note.setXShift(u),o.note.dots>0){let t=0;for(const e of o.note.modifiers)if(e instanceof F&&(t++,e.setYShift(-10*(l.maxLine-o.line+1)),t===o.note.dots))break}}else t<1&&t>0?l.note.setXShift(u):o.note.voice!==l.note.voice&&o.stemDirection===l.stemDirection&&(o.line>l.line?1===o.stemDirection?l.note.renderFlag=!1:o.note.renderFlag=!1:l.line>o.line?1===l.stemDirection?o.note.renderFlag=!1:l.note.renderFlag=!1:1===l.stemDirection&&(l.stemDirection=-1,l.note.setStemDirection(-1)))}return!0}return null!==a&&a.minLine<l.maxLine+.5&&(a.isrest||(c=Math.abs(a.line-(l.maxLine+.5)),c=Math.max(c,a.stemMin),a.minLine=a.line-c,a.note.setStemLength(10*c))),a.isrest&&!o.isrest&&!l.isrest&&(o.minLine<=a.maxLine||a.minLine<=l.maxLine)?(a.maxLine-a.minLine<o.minLine-l.maxLine?function(t,e,i){const n=t.line-s.MidLine(e.minLine,i.maxLine);t.note.setKeyLine(0,t.note.getKeyLine(0)-n),t.line-=n,t.maxLine-=n,t.minLine-=n}(a,o,l):(u=h+3,a.note.setXShift(u)),!0):o.isrest&&a.isrest&&l.isrest?(D(o,a,1),D(l,a,-1),!0):(a.isrest&&o.isrest&&a.minLine<=l.maxLine&&D(a,l,1),a.isrest&&l.isrest&&o.minLine<=a.maxLine&&D(a,o,-1),o.isrest&&o.minLine<=a.maxLine&&D(o,a,1),l.isrest&&a.minLine<=l.maxLine&&D(l,a,-1),(!o.isrest&&!a.isrest&&o.minLine<=a.maxLine+.5||!a.isrest&&!l.isrest&&a.minLine<=l.maxLine)&&(u=h+3,a.note.setXShift(u)),!0)}static formatByY(t,e){let i=!0;for(let e=0;e<t.length;e++)i=i&&null!=t[e].getStave();if(!i)throw new s.RERR("Stave Missing","All notes must have a stave - Vex.Flow.ModifierContext.formatMultiVoice!");let n=0;for(let e=0;e<t.length-1;e++){let i=t[e],s=t[e+1];i.maxLine<s.maxLine&&(i=t[e+1],s=t[e]);const r=i.getKeyProps(),o=s.getKeyProps(),a=.5,l=i.getStave().getYForLine(5-r[0].line+a);s.getStave().getYForLine(5-o[o.length-1].line-a)-l<0&&i.voice===s.voice&&(n=i.getVoiceShiftWidth()+2,s.setXShift(n))}e.right_shift+=n}static postFormat(t){return!!t&&(t.forEach((t=>t.postFormat())),!0)}constructor(t){if(super(t),this.setAttribute("type","StaveNote"),this.keys=t.keys,this.clef=t.clef,this.octave_shift=t.octave_shift,this.beam=null,this.glyph=m.getGlyphProps(this.duration,this.noteType),!this.glyph)throw new s.RuntimeError("BadArguments",`Invalid note initialization data (No glyph found): ${JSON.stringify(t)}`);this.displaced=!1,this.dot_shiftY=0,this.addDotsCount=0,this.keyProps=[],this.use_default_head_x=!1,this.note_heads=[],this.modifiers=[],s.Merge(this.render_options,{glyph_font_scale:t.glyph_font_scale||m.DEFAULT_NOTATION_FONT_SCALE,stroke_px:t.stroke_px||O.DEFAULT_LEDGER_LINE_OFFSET}),this.calculateKeyProps(),this.buildStem(),t.auto_stem?this.autoStem():this.setStemDirection(t.stem_direction),this.reset(),this.buildFlag()}reset(){super.reset();const t=this.note_heads.map((t=>t.getStyle())),e=[];this.note_heads.forEach((t=>e.push(t.note_type))),this.buildNoteHeads(),this.note_heads.forEach(((i,s)=>{i.setStyle(t[s]),e[s]&&(i.note_type=e[s])})),this.stave&&this.note_heads.forEach((t=>t.setStave(this.stave))),this.calcExtraPx()}setBeam(t){return this.beam=t,this.calcExtraPx(),this}getCategory(){return O.CATEGORY}buildStem(){this.setStem(new v({hide:!!this.isRest()})),this.stem.id=s.Prefix(`${this.getAttribute("id")}-stem`)}buildNoteHeads(){this.note_heads=[];const t=this.getStemDirection(),e=this.getKeys();let i,s,n,r=null,o=null,a=!1;t===v.UP?(i=0,s=e.length,n=1):t===v.DOWN&&(i=e.length-1,s=-1,n=-1);for(let e=i;e!==s;e+=n){const i=this.keyProps[e],s=i.line;null===r?r=s:(o=Math.abs(r-s),0===o||.5===o?a=!a:(a=!1,this.use_default_head_x=!0)),r=s;const n=new R({duration:this.duration,note_type:this.noteType,displaced:a,stem_direction:t,custom_glyph_code:i.code,glyph_font_scale:this.render_options.glyph_font_scale,x_shift:i.shift_right,stem_up_x_offset:i.stem_up_x_offset,stem_down_x_offset:i.stem_down_x_offset,line:i.line});this.note_heads[e]=n}}autoStem(){this.minLine=this.keyProps[0].line,this.maxLine=this.keyProps[this.keyProps.length-1].line;const t=(this.minLine+this.maxLine)/2<3?v.UP:v.DOWN;this.setStemDirection(t)}calculateKeyProps(){let t=null;for(let e=0;e<this.keys.length;++e){const i=this.keys[e];this.glyph.rest&&(this.glyph.position=i);const n={octave_shift:this.octave_shift||0},r=m.keyProperties(i,this.clef,n);if(!r)throw new s.RuntimeError("BadArguments",`Invalid key for note properties: ${i}`);"R"===r.key&&("1"===this.duration||"w"===this.duration?r.line=4:r.line=3);const o=r.line;null===t?t=o:.5===Math.abs(t-o)&&(this.displaced=!0,r.displaced=!0,this.keyProps.length>0&&(this.keyProps[e-1].displaced=!0)),t=o,this.keyProps.push(r)}t=-1/0,this.keyProps.forEach((e=>{e.line<t&&s.W("Unsorted keys in note will be sorted. See https://github.com/0xfe/vexflow/issues/104 for details."),t=e.line})),this.keyProps.sort(((t,e)=>t.line-e.line))}getBoundingBox(){if(!this.preFormatted)throw new s.RERR("UnformattedNote","Can't call getBoundingBox on an unformatted note.");const{width:t,modLeftPx:e,extraLeftPx:i}=this.getMetrics(),n=this.getAbsoluteX()-e-i;let r=0,o=0;const a=this.getStave().getSpacingBetweenLines()/2,l=2*a;if(this.isRest()){const t=this.ys[0],e=m.durationToFraction(this.duration);e.equals(1)||e.equals(2)?(r=t-a,o=t+a):(r=t-this.glyph.line_above*l,o=t+this.glyph.line_below*l)}else if(this.glyph.stem){const t=this.getStemExtents();t.baseY+=a*this.stem_direction,r=Math.min(t.topY,t.baseY),o=Math.max(t.topY,t.baseY)}else{r=null,o=null;for(let t=0;t<this.ys.length;++t){const e=this.ys[t];0===t?(r=e,o=e):(r=Math.min(e,r),o=Math.max(e,o))}r-=a,o+=a}return new c(n,r,t,o-r)}getLineNumber(t){if(!this.keyProps.length)throw new s.RERR("NoKeyProps","Can't get bottom note line, because note is not initialized properly.");let e=this.keyProps[0].line;for(let i=0;i<this.keyProps.length;i++){const s=this.keyProps[i].line;t?s>e&&(e=s):s<e&&(e=s)}return e}isRest(){return this.glyph.rest}isChord(){return!this.isRest()&&this.keys.length>1}hasStem(){return this.glyph.stem}hasFlag(){return super.hasFlag()&&!this.isRest()&&this.renderFlag}getStemX(){return"r"===this.noteType?this.getCenterGlyphX():super.getStemX()+v.WIDTH/(2*-this.getStemDirection())}getYForTopText(t){const e=this.getStemExtents();return Math.min(this.stave.getYForTopText(t),e.topY-this.render_options.annotation_spacing*(t+1))}getYForBottomText(t){const e=this.getStemExtents();return Math.max(this.stave.getYForTopText(t),e.baseY+this.render_options.annotation_spacing*t)}setStave(t){super.setStave(t);const e=this.note_heads.map((e=>(e.setStave(t),e.getY())));if(this.setYs(e),this.stem){const{y_top:t,y_bottom:e}=this.getNoteHeadBounds();this.stem.setYBounds(t,e)}return this}getKeys(){return this.keys}getKeyProps(){return this.keyProps}isDisplaced(){return this.displaced}setNoteDisplaced(t){return this.displaced=t,this}getTieRightX(){let t=this.getAbsoluteX();return t+=this.getGlyphWidth()+this.x_shift+this.extraRightPx,this.modifierContext&&(t+=this.modifierContext.getExtraRightPx()),t}getTieLeftX(){let t=this.getAbsoluteX();return t+=this.x_shift-this.extraLeftPx,t}getLineForRest(){let t=this.keyProps[0].line;if(this.keyProps.length>1){const e=this.keyProps[this.keyProps.length-1].line,i=Math.max(t,e),n=Math.min(t,e);t=s.MidLine(i,n)}return t}getModifierStartXY(t,e,i){if(i=i||{},!this.preFormatted)throw new s.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");if(0===this.ys.length)throw new s.RERR("NoYValues","No Y-Values calculated for this note.");const{ABOVE:n,BELOW:r,LEFT:o,RIGHT:a}=B.Position;let l=0;return t===o?l=-2:t===a?(l=this.getGlyphWidth()+this.x_shift+2,this.stem_direction===v.UP&&this.hasFlag()&&(i.forceFlagRight||((t,e)=>e===(t.getStemDirection()===v.UP?t.keyProps.length-1:0))(this,e))&&(l+=this.flag.getMetrics().width)):t!==r&&t!==n||(l=this.getGlyphWidth()/2),{x:this.getAbsoluteX()+l,y:this.ys[e]}}setStyle(t){super.setStyle(t),this.note_heads.forEach((e=>e.setStyle(t))),this.stem&&this.stem.setStyle(t)}setStemStyle(t){this.stem&&this.getStem().setStyle(t)}getStemStyle(){return this.stem.getStyle()}setLedgerLineStyle(t){this.ledgerLineStyle=t}getLedgerLineStyle(){return this.ledgerLineStyle}setFlagStyle(t){this.flagStyle=t}getFlagStyle(){return this.flagStyle}setKeyStyle(t,e){return this.note_heads[t].setStyle(e),this}setKeyLine(t,e){return this.keyProps[t].line=e,this.reset(),this}getKeyLine(t){return this.keyProps[t].line}addToModifierContext(t){this.setModifierContext(t);for(let t=0;t<this.modifiers.length;++t)this.modifierContext.addModifier(this.modifiers[t]);return this.modifierContext.addModifier(this),this.setPreFormatted(!1),this}addModifier(t,e){return e.setNote(this),e.setIndex(t),this.modifiers.push(e),this.setPreFormatted(!1),this}addAccidental(t,e){return this.addModifier(t,e)}addArticulation(t,e){return this.addModifier(t,e)}addAnnotation(t,e){return this.addModifier(t,e)}addDot(t){const e=new F;return e.setDotShiftY(this.glyph.dot_shiftY),this.addDotsCount++,this.addModifier(t,e)}addDotToAll(){for(let t=0;t<this.keys.length;++t)this.addDot(t);return this}getAccidentals(){return this.modifierContext.getModifiers("accidentals")}getDots(){return this.modifierContext.getModifiers("dots")}getVoiceShiftWidth(){return this.getGlyphWidth()*(this.displaced?2:1)}calcExtraPx(){this.setExtraLeftPx(this.displaced&&this.stem_direction===v.DOWN?this.getGlyphWidth():0),this.setExtraRightPx(!this.hasFlag()&&this.displaced&&this.stem_direction===v.UP?this.getGlyphWidth():0)}preFormat(){if(this.preFormatted)return;this.modifierContext&&this.modifierContext.preFormat();let t=this.getGlyphWidth()+this.extraLeftPx+this.extraRightPx;this.renderFlag&&this.glyph.flag&&null===this.beam&&this.stem_direction===v.UP&&(t+=this.getGlyphWidth()),this.setWidth(t),this.setPreFormatted(!0)}getNoteHeadBounds(){let t=null,e=null,i=null,s=null,n=this.stave.getNumLines(),r=1,o=!1,a=!1,l=n,h=r;return this.note_heads.forEach((c=>{const u=c.getLine(),d=c.getY();(null===t||d<t)&&(t=d),(null===e||d>e)&&(e=d),null===s&&c.isDisplaced()&&(s=c.getAbsoluteX()),null!==i||c.isDisplaced()||(i=c.getAbsoluteX()),n=u>n?u:n,r=u<r?u:r,c.isDisplaced()?(o=!1===o?u:Math.max(u,o),a=!1===a?u:Math.min(u,a)):(l=Math.max(u,l),h=Math.min(u,h))}),this),{y_top:t,y_bottom:e,displaced_x:s,non_displaced_x:i,highest_line:n,lowest_line:r,highest_displaced_line:o,lowest_displaced_line:a,highest_non_displaced_line:l,lowest_non_displaced_line:h}}getNoteHeadBeginX(){return this.getAbsoluteX()+this.x_shift}getNoteHeadEndX(){return this.getNoteHeadBeginX()+this.getGlyphWidth()}drawLedgerLines(){const{stave:t,glyph:e,render_options:{stroke_px:i},context:n}=this,r=e.getWidth()+2*i,o=2*(e.getWidth()+i)-v.WIDTH/2;if(this.isRest())return;if(!n)throw new s.RERR("NoCanvasContext","Can't draw without a canvas context.");const{highest_line:a,lowest_line:l,highest_displaced_line:h,highest_non_displaced_line:c,lowest_displaced_line:u,lowest_non_displaced_line:d,displaced_x:f,non_displaced_x:m}=this.getNoteHeadBounds(),p=Math.min(f,m),b=(t,e,s)=>{let a;a=s&&e?p-i:e?m-i:f-i;const l=e&&s?o:r;n.beginPath(),n.moveTo(a,t),n.lineTo(a+l,t),n.stroke()},g={...t.getStyle()||{},...this.getLedgerLineStyle()||{}};this.applyStyle(n,g);for(let e=6;e<=a;++e){const i=null!==m&&e<=c,s=null!==f&&e<=h;b(t.getYForNote(e),i,s)}for(let e=0;e>=l;--e){const i=null!==m&&e>=d,s=null!==f&&e>=u;b(t.getYForNote(e),i,s)}this.restoreStyle(n,g)}drawModifiers(){if(!this.context)throw new s.RERR("NoCanvasContext","Can't draw without a canvas context.");const t=this.context;t.openGroup("modifiers");for(let e=0;e<this.modifiers.length;e++){const i=this.modifiers[e],s=this.note_heads[i.getIndex()],n=s.getStyle();s.applyStyle(t,n),i.setContext(t),i.drawWithStyle(),s.restoreStyle(t,n)}t.closeGroup()}drawFlag(){const{stem:t,beam:e,context:i}=this;if(!i)throw new s.RERR("NoCanvasContext","Can't draw without a canvas context.");const n=null===e&&this.renderFlag;if(this.getGlyph().flag&&n){const{y_top:e,y_bottom:s}=this.getNoteHeadBounds(),n=t.getHeight(),r=this.getStemX(),o=this.getStemDirection()===v.DOWN?e-n+2:s-n-2;i.openGroup("flag",null,{pointerBBox:!0}),this.applyStyle(i,this.getFlagStyle()||!1),this.flag.render(i,r,o),this.restoreStyle(i,this.getFlagStyle()||!1),i.closeGroup()}}drawNoteHeads(){this.note_heads.forEach((t=>{this.context.openGroup("notehead",null,{pointerBBox:!0}),t.setContext(this.context).draw(),this.context.closeGroup()}))}drawStem(t){if(!this.context)throw new s.RERR("NoCanvasContext","Can't draw without a canvas context.");t&&this.setStem(new v(t)),this.stem.id=s.Prefix(`${this.getAttribute("id")}-stem`),this.stem&&(this.context.openGroup("stem",null,{pointerBBox:!0}),this.stem.setContext(this.context).draw(),this.context.closeGroup())}draw(){if(!this.context)throw new s.RERR("NoCanvasContext","Can't draw without a canvas context.");if(!this.stave)throw new s.RERR("NoStave","Can't draw without a stave.");if(0===this.ys.length)throw new s.RERR("NoYValues","Can't draw note without Y values.");const t=this.getNoteHeadBeginX(),e=this.hasStem()&&!this.beam;if(this.note_heads.forEach((e=>e.setX(t))),this.stem){const t=this.getStemX();this.stem.setNoteHeadXBounds(t,t)}!function(...t){O.DEBUG&&s.L("Vex.Flow.StaveNote",t)}("Rendering ",this.isChord()?"chord :":"note :",this.keys),this.drawLedgerLines(),this.applyStyle(),this.setAttribute("el",this.context.openGroup("stavenote",this.getAttribute("id"))),this.context.openGroup("note",null,{pointerBBox:!0}),e&&this.drawStem(),this.drawNoteHeads(),this.drawFlag(),this.context.closeGroup(),this.drawModifiers(),this.context.closeGroup(),this.restoreStyle(),this.setRendered()}}class k extends B{static get CATEGORY(){return"frethandfinger"}static format(t,e){const{left_shift:i,right_shift:s}=e;if(!t||0===t.length)return!1;const n=[];let r=null,o=0,a=0;for(let e=0;e<t.length;++e){const l=t[e],h=l.getNote(),c=l.getPosition(),u=h.getKeyProps()[l.getIndex()];if(h!==r){for(let t=0;t<h.keys.length;++t){const e=h.getKeyProps()[t];0===i&&(o=e.displaced?h.getExtraLeftPx():o),0===s&&(a=e.displaced?h.getExtraRightPx():a)}r=h}n.push({note:h,num:l,pos:c,line:u.line,shiftL:o,shiftR:a})}n.sort(((t,e)=>e.line-t.line));let l=0,h=0,c=0,u=0,d=null,f=null;for(let t=0;t<n.length;++t){let e=0;const{note:r,pos:o,num:m,line:p,shiftL:b,shiftR:g}=n[t];p===d&&r===f||(l=i+b,h=s+g);const S=m.getWidth()+1;o===B.Position.LEFT?(m.setXShift(i+l),e=i+S,c=e>c?e:c):o===B.Position.RIGHT&&(m.setXShift(h),e=a+S,u=e>u?e:u),d=p,f=r}return e.left_shift+=c,e.right_shift+=u,!0}constructor(t){super(),this.setAttribute("type","FretHandFinger"),this.note=null,this.index=null,this.finger=t,this.width=7,this.position=B.Position.LEFT,this.x_shift=0,this.y_shift=0,this.x_offset=0,this.y_offset=0,this.font={family:"sans-serif",size:9,weight:"bold"}}getCategory(){return k.CATEGORY}setFretHandFinger(t){return this.finger=t,this}setOffsetX(t){return this.x_offset=t,this}setOffsetY(t){return this.y_offset=t,this}draw(){if(this.checkContext(),!this.note||null==this.index)throw new s.RERR("NoAttachedNote","Can't draw string number without a note and index.");this.setRendered();const t=this.context,e=this.note.getModifierStartXY(this.position,this.index);let i=e.x+this.x_shift+this.x_offset,n=e.y+this.y_shift+this.y_offset+5;switch(this.position){case B.Position.ABOVE:i-=4,n-=12;break;case B.Position.BELOW:i-=2,n+=10;break;case B.Position.LEFT:i-=this.width;break;case B.Position.RIGHT:i+=1;break;default:throw new s.RERR("InvalidPostion",`The position ${this.position} does not exist`)}t.save(),t.setFont(this.font.family,this.font.size,this.font.weight),t.fillText(""+this.finger,i,n),t.restore()}}class V{static get NUM_TONES(){return 12}static get roots(){return["c","d","e","f","g","a","b"]}static get root_values(){return[0,2,4,5,7,9,11]}static get root_indices(){return{c:0,d:1,e:2,f:3,g:4,a:5,b:6}}static get canonical_notes(){return["c","c#","d","d#","e","f","f#","g","g#","a","a#","b"]}static get diatonic_intervals(){return["unison","m2","M2","m3","M3","p4","dim5","p5","m6","M6","b7","M7","octave"]}static get diatonic_accidentals(){return{unison:{note:0,accidental:0},m2:{note:1,accidental:-1},M2:{note:1,accidental:0},m3:{note:2,accidental:-1},M3:{note:2,accidental:0},p4:{note:3,accidental:0},dim5:{note:4,accidental:-1},p5:{note:4,accidental:0},m6:{note:5,accidental:-1},M6:{note:5,accidental:0},b7:{note:6,accidental:-1},M7:{note:6,accidental:0},octave:{note:7,accidental:0}}}static get intervals(){return{u:0,unison:0,m2:1,b2:1,min2:1,S:1,H:1,2:2,M2:2,maj2:2,T:2,W:2,m3:3,b3:3,min3:3,M3:4,3:4,maj3:4,4:5,p4:5,"#4":6,b5:6,aug4:6,dim5:6,5:7,p5:7,"#5":8,b6:8,aug5:8,6:9,M6:9,maj6:9,b7:10,m7:10,min7:10,dom7:10,M7:11,maj7:11,8:12,octave:12}}static get scales(){return{major:[2,2,1,2,2,2,1],dorian:[2,1,2,2,2,1,2],mixolydian:[2,2,1,2,2,1,2],minor:[2,1,2,2,1,2,2]}}static get scaleTypes(){return{M:V.scales.major,m:V.scales.minor}}static get accidentals(){return["bb","b","n","#","##"]}static get noteValues(){return{c:{root_index:0,int_val:0},cn:{root_index:0,int_val:0},"c#":{root_index:0,int_val:1},"c##":{root_index:0,int_val:2},cb:{root_index:0,int_val:11},cbb:{root_index:0,int_val:10},d:{root_index:1,int_val:2},dn:{root_index:1,int_val:2},"d#":{root_index:1,int_val:3},"d##":{root_index:1,int_val:4},db:{root_index:1,int_val:1},dbb:{root_index:1,int_val:0},e:{root_index:2,int_val:4},en:{root_index:2,int_val:4},"e#":{root_index:2,int_val:5},"e##":{root_index:2,int_val:6},eb:{root_index:2,int_val:3},ebb:{root_index:2,int_val:2},f:{root_index:3,int_val:5},fn:{root_index:3,int_val:5},"f#":{root_index:3,int_val:6},"f##":{root_index:3,int_val:7},fb:{root_index:3,int_val:4},fbb:{root_index:3,int_val:3},g:{root_index:4,int_val:7},gn:{root_index:4,int_val:7},"g#":{root_index:4,int_val:8},"g##":{root_index:4,int_val:9},gb:{root_index:4,int_val:6},gbb:{root_index:4,int_val:5},a:{root_index:5,int_val:9},an:{root_index:5,int_val:9},"a#":{root_index:5,int_val:10},"a##":{root_index:5,int_val:11},ab:{root_index:5,int_val:8},abb:{root_index:5,int_val:7},b:{root_index:6,int_val:11},bn:{root_index:6,int_val:11},"b#":{root_index:6,int_val:0},"b##":{root_index:6,int_val:1},bb:{root_index:6,int_val:10},bbb:{root_index:6,int_val:9}}}isValidNoteValue(t){return!(null==t||t<0||t>=V.NUM_TONES)}isValidIntervalValue(t){return this.isValidNoteValue(t)}getNoteParts(t){if(!t||t.length<1)throw new s.RERR("BadArguments","Invalid note name: "+t);if(t.length>3)throw new s.RERR("BadArguments","Invalid note name: "+t);const e=t.toLowerCase(),i=/^([cdefgab])(b|bb|n|#|##)?$/.exec(e);if(null!=i)return{root:i[1],accidental:i[2]};throw new s.RERR("BadArguments","Invalid note name: "+t)}getKeyParts(t){if(!t||t.length<1)throw new s.RERR("BadArguments","Invalid key: "+t);const e=t.toLowerCase(),i=/^([cdefgab])(b|#)?(mel|harm|m|M)?$/.exec(e);if(null!=i){const t=i[1],e=i[2];let s=i[3];return s||(s="M"),{root:t,accidental:e,type:s}}throw new s.RERR("BadArguments",`Invalid key: ${t}`)}getNoteValue(t){const e=V.noteValues[t];if(null==e)throw new s.RERR("BadArguments",`Invalid note name: ${t}`);return e.int_val}getIntervalValue(t){const e=V.intervals[t];if(null==e)throw new s.RERR("BadArguments",`Invalid interval name: ${t}`);return e}getCanonicalNoteName(t){if(!this.isValidNoteValue(t))throw new s.RERR("BadArguments",`Invalid note value: ${t}`);return V.canonical_notes[t]}getCanonicalIntervalName(t){if(!this.isValidIntervalValue(t))throw new s.RERR("BadArguments",`Invalid interval value: ${t}`);return V.diatonic_intervals[t]}getRelativeNoteValue(t,e,i){if(null==i&&(i=1),1!==i&&-1!==i)throw new s.RERR("BadArguments",`Invalid direction: ${i}`);let n=(t+i*e)%V.NUM_TONES;return n<0&&(n+=V.NUM_TONES),n}getRelativeNoteName(t,e){const i=this.getNoteParts(t),n=this.getNoteValue(i.root);let r=e-n;if(Math.abs(r)>V.NUM_TONES-3){let i=1;r>0&&(i=-1);const o=(e+1+(n+1))%V.NUM_TONES*i;if(Math.abs(o)>2)throw new s.RERR("BadArguments",`Notes not related: ${t}, ${e})`);r=o}if(Math.abs(r)>2)throw new s.RERR("BadArguments",`Notes not related: ${t}, ${e})`);let o=i.root;if(r>0)for(let t=1;t<=r;++t)o+="#";else if(r<0)for(let t=-1;t>=r;--t)o+="b";return o}getScaleTones(t,e){const i=[t];let s=t;for(let n=0;n<e.length;n+=1)s=this.getRelativeNoteValue(s,e[n]),s!==t&&i.push(s);return i}getIntervalBetween(t,e,i){if(null==i&&(i=1),1!==i&&-1!==i)throw new s.RERR("BadArguments",`Invalid direction: ${i}`);if(!this.isValidNoteValue(t)||!this.isValidNoteValue(e))throw new s.RERR("BadArguments",`Invalid notes: ${t}, ${e}`);let n=1===i?e-t:t-e;return n<0&&(n+=V.NUM_TONES),n}createScaleMap(t){const e=this.getKeyParts(t),i=V.scaleTypes[e.type];let n=e.root;if(e.accidental&&(n+=e.accidental),!i)throw new s.RERR("BadArguments","Unsupported key type: "+t);const r=this.getScaleTones(this.getNoteValue(n),i),o=V.root_indices[e.root],a={};for(let t=0;t<V.roots.length;++t){const e=(o+t)%V.roots.length,i=V.roots[e];let s=this.getRelativeNoteName(i,r[t]);1===s.length&&(s+="n"),a[i]=s}return a}}function G(...t){U.DEBUG&&s.L("Vex.Flow.Accidental",t)}const W=t=>t.getMetrics().width;class U extends B{static get CATEGORY(){return"accidentals"}static format(t,e){const i=e.left_shift+1;if(!t||0===t.length)return;const s=[];let n,r=null,o=0;for(let e=0;e<t.length;++e){const i=t[e],a=i.getNote(),l=a.getStave(),h=a.getKeyProps()[i.getIndex()];if(a!==r){for(let t=0;t<a.keys.length;++t)n=a.getKeyProps()[t],o=n.displaced?a.getExtraLeftPx():o;r=a}if(null!==l){const t=l.options.spacing_between_lines_px,e=l.getYForLine(h.line),n=Math.round(e/t*2)/2;s.push({y:e,line:n,shift:o,acc:i,lineSpace:t})}else s.push({line:h.line,shift:o,acc:i})}s.sort(((t,e)=>e.line-t.line));const a=[];let l=0,h=null;for(let t=0;t<s.length;t++){const e=s[t];null!==h&&h===e.line||a.push({line:e.line,flatLine:!0,dblSharpLine:!0,numAcc:0,width:0}),"b"!==e.acc.type&&"bb"!==e.acc.type&&(a[a.length-1].flatLine=!1),"##"!==e.acc.type&&(a[a.length-1].dblSharpLine=!1),a[a.length-1].numAcc++,a[a.length-1].width+=e.acc.getWidth()+3,l=e.shift>l?e.shift:l,h=e.line}let c=0;for(let t=0;t<a.length;t++){let e=!1;const i=t;let s=t;for(;s+1<a.length&&!e;)this.checkCollision(a[s],a[s+1])?s++:e=!0;const n=t=>a[i+t],r=t=>t.map(n),o=(t,e)=>{const[i,s]=r([t,e]).map((t=>t.line));return i-s},l=(...t)=>t.map(r).every((t=>!this.checkCollision(...t))),h=s-i+1;let u,d,f=this.checkCollision(a[i],a[s])?"a":"b";switch(h){case 3:"a"===f&&.5===o(1,2)&&.5!==o(0,1)&&(f="second_on_bottom");break;case 4:l([0,2],[1,3])&&(f="spaced_out_tetrachord");break;case 5:"b"===f&&l([1,3])&&(f="spaced_out_pentachord",l([0,2],[2,4])&&(f="very_spaced_out_pentachord"));break;case 6:l([0,3],[1,4],[2,5])&&(f="spaced_out_hexachord"),l([0,2],[2,4],[1,3],[3,5])&&(f="very_spaced_out_hexachord")}if(h>=7){let e=2,i=!0;for(;!0===i;){i=!1;for(let t=0;t+e<a.length;t++)if(this.checkCollision(a[t],a[t+e])){i=!0,e++;break}}for(u=t;u<=s;u++)d=(u-t)%e+1,a[u].column=d,c=c>d?c:d}else for(u=t;u<=s;u++)d=m.accidentalColumnsTable[h][f][u-t],a[u].column=d,c=c>d?c:d;t=s}const u=[],d=[];for(let t=0;t<=c;t++)u[t]=0,d[t]=0;u[0]=l+i,d[0]=l+i,a.forEach((t=>{t.width>u[t.column]&&(u[t.column]=t.width)}));for(let t=1;t<u.length;t++)d[t]=u[t]+d[t-1];const f=d[d.length-1];let p=0;a.forEach((t=>{let e=0;const i=p+t.numAcc;for(;p<i;p++){const i=d[t.column-1]+e;s[p].acc.setXShift(i),e+=s[p].acc.getWidth()+3,G("Line, accCount, shift: ",t.line,p,i)}})),e.left_shift+=f}static checkCollision(t,e){let i=e.line-t.line,s=3;i>0?(s=e.flatLine||e.dblSharpLine?2.5:3,t.dblSharpLine&&(i-=.5)):(s=t.flatLine||t.dblSharpLine?2.5:3,e.dblSharpLine&&(i-=.5));const n=Math.abs(i)<s;return G("Line_1, Line_2, Collision: ",t.line,e.line,n),n}static applyAccidentals(t,e){const i=[],s={};t.forEach((t=>{const e=new n(0,1);t.getTickables().forEach((t=>{if(t.shouldIgnoreTicks())return;const n=s[e.value()];n?n.push(t):(i.push(e.value()),s[e.value()]=[t]),e.add(t.getTicks())}))}));const r=new V;e||(e="C");const o=r.createScaleMap(e);i.forEach((t=>{const e=s[t],i=[],n=t=>{t.isRest()||t.shouldIgnoreTicks()||(t.keys.forEach(((e,s)=>{const n=r.getNoteParts(e.split("/")[0]),a=n.accidental||"n",l=n.root+a,h=o[n.root]===l,c=i.indexOf(l)>-1;if(!h||h&&c){o[n.root]=l;const e=new U(a);t.addAccidental(s,e),i.push(l)}})),t.getModifiers().forEach((t=>{"gracenotegroups"===t.getCategory()&&t.getGraceNotes().forEach(n)})))};e.forEach(n)}))}constructor(t=null){if(super(),this.setAttribute("type","Accidental"),G("New accidental: ",t),this.note=null,this.index=null,this.type=t,this.position=B.Position.LEFT,this.render_options={font_scale:38,stroke_px:3,parenLeftPadding:2,parenRightPadding:2},this.accidental=m.accidentalCodes(this.type),!this.accidental)throw new s.RERR("ArgumentError",`Unknown accidental type: ${t}`);this.cautionary=!1,this.parenLeft=null,this.parenRight=null,this.reset()}reset(){const t=this.render_options.font_scale;this.glyph=new f(this.accidental.code,t),this.glyph.setOriginX(1),this.cautionary&&(this.parenLeft=new f(m.accidentalCodes("{").code,t),this.parenRight=new f(m.accidentalCodes("}").code,t),this.parenLeft.setOriginX(1),this.parenRight.setOriginX(1))}getCategory(){return U.CATEGORY}getWidth(){const t=this.cautionary?W(this.parenLeft)+W(this.parenRight)+this.render_options.parenLeftPadding+this.render_options.parenRightPadding:0;return W(this.glyph)+t}setNote(t){if(!t)throw new s.RERR("ArgumentError",`Bad note value: ${t}`);this.note=t,"gracenotes"===this.note.getCategory()&&(this.render_options.font_scale=25,this.reset())}setAsCautionary(){return this.cautionary=!0,this.render_options.font_scale=28,this.reset(),this}draw(){const{context:t,type:e,position:i,note:n,index:r,cautionary:o,x_shift:a,y_shift:l,glyph:h,parenLeft:c,parenRight:u,render_options:{parenLeftPadding:d,parenRightPadding:f}}=this;if(this.checkContext(),!n||null==r)throw new s.RERR("NoAttachedNote","Can't draw accidental without a note and index.");const m=n.getModifierStartXY(i,r);let p=m.x+a;const b=m.y+l;G("Rendering: ",e,p,b),o?(u.render(t,p,b),p-=W(u),p-=f,p-=this.accidental.parenRightPaddingAdjustment,h.render(t,p,b),p-=W(h),p-=d,c.render(t,p,b)):h.render(t,p,b),this.setRendered()}}class z extends B{static get CATEGORY(){return"notesubgroup"}static format(t,e){if(!t||0===t.length)return!1;let i=0;for(let e=0;e<t.length;++e){const s=t[e];s.preFormat(),i+=s.getWidth()}return e.left_shift+=i,!0}constructor(t){return super(),this.setAttribute("type","NoteSubGroup"),this.note=null,this.index=null,this.position=B.Position.LEFT,this.subNotes=t,this.subNotes.forEach((t=>{t.ignore_ticks=!1})),this.width=0,this.preFormatted=!1,this.formatter=new ut,this.voice=new T({num_beats:4,beat_value:4,resolution:m.RESOLUTION}).setStrict(!1),this.voice.addTickables(this.subNotes),this}getCategory(){return z.CATEGORY}preFormat(){this.preFormatted||(this.formatter.joinVoices([this.voice]).format([this.voice],0),this.setWidth(this.formatter.getMinTotalWidth()),this.preFormatted=!0)}setNote(t){this.note=t}setWidth(t){this.width=t}getWidth(){return this.width}draw(){this.checkContext();const t=this.getNote();if(!t||null===this.index)throw new s.RuntimeError("NoAttachedNote","Can't draw notes without a parent note and parent note index.");this.setRendered(),this.alignSubNotesWithNote(this.subNotes,t),this.subNotes.forEach((t=>t.setContext(this.context).drawWithStyle()))}}class H extends l{constructor(t,e){super(),this.setAttribute("type","StaveTie"),this.notes=t,this.context=null,this.text=e,this.direction=null,this.render_options={cp1:8,cp2:12,text_shift_x:0,first_x_shift:0,last_x_shift:0,y_shift:7,tie_spacing:0,font:{family:"Arial",size:10,style:""}},this.font=this.render_options.font,this.setNotes(t)}setFont(t){return this.font=t,this}setDirection(t){return this.direction=t,this}setNotes(t){if(!t.first_note&&!t.last_note)throw new s.RuntimeError("BadArguments","Tie needs to have either first_note or last_note set.");if(t.first_indices||(t.first_indices=[0]),t.last_indices||(t.last_indices=[0]),t.first_indices.length!==t.last_indices.length)throw new s.RuntimeError("BadArguments","Tied notes must have similar index sizes");return this.first_note=t.first_note,this.first_indices=t.first_indices,this.last_note=t.last_note,this.last_indices=t.last_indices,this}isPartial(){return!this.first_note||!this.last_note}renderTie(t){if(0===t.first_ys.length||0===t.last_ys.length)throw new s.RERR("BadArguments","No Y-values to render");const e=this.context;let i=this.render_options.cp1,n=this.render_options.cp2;Math.abs(t.last_x_px-t.first_x_px)<10&&(i=2,n=8);const r=this.render_options.first_x_shift,o=this.render_options.last_x_shift,a=this.render_options.y_shift*t.direction;for(let l=0;l<this.first_indices.length;++l){const h=(t.last_x_px+o+(t.first_x_px+r))/2,c=t.first_ys[this.first_indices[l]]+a,u=t.last_ys[this.last_indices[l]]+a;if(isNaN(c)||isNaN(u))throw new s.RERR("BadArguments","Bad indices for tie rendering.");const d=(c+u)/2+i*t.direction,f=(c+u)/2+n*t.direction;let m;this.first_note&&(m=this.first_note.getAttribute("id")+"-tie"),this.setAttribute("el",e.openGroup("stavetie",m)),e.beginPath(),e.moveTo(t.first_x_px+r,c),e.quadraticCurveTo(h,d,t.last_x_px+o,u),e.quadraticCurveTo(h,f,t.first_x_px+r,c),e.closePath(),e.fill(),e.closeGroup()}}renderText(t,e){if(!this.text)return;let i=(t+e)/2;i-=this.context.measureText(this.text).width/2,this.context.save(),this.context.setFont(this.font.family,this.font.size,this.font.style),this.context.fillText(this.text,i+this.render_options.text_shift_x,(this.first_note||this.last_note).getStave().getYForTopText()-1),this.context.restore()}draw(){this.checkContext(),this.setRendered();const t=this.first_note,e=this.last_note;let i,s,n,r,o;return t?(i=t.getTieRightX()+this.render_options.tie_spacing,o=t.getStemDirection(),n=t.getYs()):(i=e.getStave().getTieStartX(),n=e.getYs(),this.first_indices=this.last_indices),e?(s=e.getTieLeftX()+this.render_options.tie_spacing,o=e.getStemDirection(),r=e.getYs()):(s=t.getStave().getTieEndX(),r=t.getYs(),this.last_indices=this.first_indices),this.direction&&(o=this.direction),this.renderTie({first_x_px:i,last_x_px:s,first_ys:n,last_ys:r,direction:o}),this.renderText(i,s),!0}}class X extends H{static createHammeron(t){return new X(t,"H")}static createPulloff(t){return new X(t,"P")}constructor(t,e){super(t,e),this.setAttribute("type","TabTie"),this.render_options.cp1=9,this.render_options.cp2=11,this.render_options.y_shift=3,this.setNotes(t)}draw(){this.checkContext(),this.setRendered();const t=this.first_note,e=this.last_note;let i,s,n,r;return t?(i=t.getTieRightX()+this.render_options.tie_spacing,n=t.getYs()):(i=e.getStave().getTieStartX(),n=e.getYs(),this.first_indices=this.last_indices),e?(s=e.getTieLeftX()+this.render_options.tie_spacing,r=e.getYs()):(s=t.getStave().getTieEndX(),r=t.getYs(),this.last_indices=this.first_indices),this.renderTie({first_x_px:i,last_x_px:s,first_ys:n,last_ys:r,direction:-1}),this.renderText(i,s),!0}}class j extends B{static get CATEGORY(){return"gracenotegroups"}static format(t,e){if(!t||0===t.length)return!1;const i=[];let s=null,n=0;for(let e=0;e<t.length;++e){const r=t[e],o=r.getNote(),a=o.getCategory()===O.CATEGORY;let l=0;if(a&&null!==r.spacing&&void 0!==r.spacing&&(l=r.spacing),a&&o!==s){for(let t=0;t<o.keys.length;++t)n=o.getKeyProps()[t].displaced?o.getExtraLeftPx():n;s=o}i.push({shift:n,gracenote_group:r,spacing:l})}let r,o=i[0].shift;for(let t=0;t<i.length;++t){const e=i[t].gracenote_group;e.preFormat(),r=e.getWidth()+i[t].spacing,o=Math.max(r,o)}for(let t=0;t<i.length;++t){const e=i[t].gracenote_group;r=e.getWidth()+i[t].spacing,e.setSpacingFromNextModifier(o-Math.min(r,o))}return e.left_shift+=o,!0}constructor(t,e){return super(),this.setAttribute("type","GraceNoteGroup"),this.note=null,this.index=null,this.position=B.Position.LEFT,this.grace_notes=t,this.width=0,this.preFormatted=!1,this.show_slur=e,this.slur=null,this.formatter=new ut,this.voice=new T({num_beats:4,beat_value:4,resolution:m.RESOLUTION}).setStrict(!1),this.render_options={slur_y_shift:0},this.beams=[],this.voice.addTickables(this.grace_notes),this}getCategory(){return j.CATEGORY}preFormat(){this.preFormatted||(this.formatter.joinVoices([this.voice]).format([this.voice],0),this.setWidth(this.formatter.getMinTotalWidth()),this.preFormatted=!0)}beamNotes(t){if((t=t||this.grace_notes).length>1){const e=new P(t);e.render_options.beam_width=3,e.render_options.partial_beam_length=4,this.beams.push(e)}return this}setNote(t){this.note=t}setWidth(t){this.width=t}getWidth(){return this.width}getGraceNotes(){return this.grace_notes}draw(){this.checkContext();const t=this.getNote();if(function(...t){j.DEBUG&&s.L("Vex.Flow.GraceNoteGroup",t)}("Drawing grace note group for:",t),!t||null===this.index)throw new s.RuntimeError("NoAttachedNote","Can't draw grace note without a parent note and parent note index.");if(this.setRendered(),this.alignSubNotesWithNote(this.getGraceNotes(),t),this.grace_notes.forEach((t=>{t.setContext(this.context).draw()})),this.beams.forEach((t=>{t.setContext(this.context).draw()})),this.show_slur){const e=this.getNote().getCategory()===O.CATEGORY,i=e?H:X;this.slur=new i({last_note:this.grace_notes[0],first_note:t,first_indices:[0],last_indices:[0]}),this.slur.render_options.cp2=12,this.slur.render_options.y_shift=(e?7:5)+this.render_options.slur_y_shift,this.slur.setContext(this.context).draw()}}}class Y extends B{static get CATEGORY(){return"strokes"}static get Type(){return{BRUSH_DOWN:1,BRUSH_UP:2,ROLL_DOWN:3,ROLL_UP:4,RASQUEDO_DOWN:5,RASQUEDO_UP:6,ARPEGGIO_DIRECTIONLESS:7}}static format(t,e){const i=e.left_shift;if(!t||0===t.length)return this;const s=t.map((t=>{const e=t.getNote();if(e instanceof O){const{line:i,displaced:s}=e.getKeyProps()[t.getIndex()];return{line:i,shift:s?e.getExtraLeftPx():0,stroke:t}}{const{str:i}=e.getPositions()[t.getIndex()];return{line:i,shift:0,stroke:t}}})),n=i,r=s.reduce(((t,{stroke:e,shift:i})=>(e.setXShift(n+i),Math.max(e.getWidth()+0,t))),0);return e.left_shift+=r,!0}constructor(t,e){super(),this.setAttribute("type","Stroke"),this.note=null,this.options=s.Merge({},e),this.all_voices=!("all_voices"in this.options)||this.options.all_voices,this.note_end=null,this.index=null,this.type=t,this.position=B.Position.LEFT,this.render_options={font_scale:38,stroke_px:3,stroke_spacing:10},this.font={family:"serif",size:10,weight:"bold italic"},this.setXShift(0),this.setWidth(10)}getCategory(){return Y.CATEGORY}getPosition(){return this.position}addEndNote(t){return this.note_end=t,this}draw(){if(this.checkContext(),this.setRendered(),!this.note||null==this.index)throw new s.RERR("NoAttachedNote","Can't draw stroke without a note and index.");const t=this.note.getModifierStartXY(this.position,this.index);let e=this.note.getYs(),i=t.y,n=t.y;const r=t.x-5,o=this.note.stave.options.spacing_between_lines_px,a=this.getModifierContext().getModifiers(this.note.getCategory());for(let t=0;t<a.length;t++){e=a[t].getYs();for(let r=0;r<e.length;r++)(this.note===a[t]||this.all_voices)&&(i=s.Min(i,e[r]),n=s.Max(n,e[r]))}let l,h,c,u,d;switch(this.type){case Y.Type.BRUSH_DOWN:l="vc3",h=-3,c=i-o/2+10,n+=o/2;break;case Y.Type.BRUSH_UP:l="v11",h=.5,c=n+o/2,i-=o/2;break;case Y.Type.ROLL_DOWN:case Y.Type.RASQUEDO_DOWN:l="vc3",h=-3,u=this.x_shift+h-2,this.note instanceof O?(i+=1.5*o,n+=(n-i)%2!=0?.5*o:o,c=i-o,d=n+o+2):(i+=1.5*o,n+=o,c=i-.75*o,d=n+.25*o);break;case Y.Type.ROLL_UP:case Y.Type.RASQUEDO_UP:l="v52",h=-4,u=this.x_shift+h-1,this.note instanceof O?(c=o/2,i+=.5*o,(n-i)%2==0&&(n+=o/2),c=n+.5*o,d=i-1.25*o):(i+=.25*o,n+=.5*o,c=n+.25*o,d=i-o);break;case Y.Type.ARPEGGIO_DIRECTIONLESS:i+=.5*o,n+=o;break;default:throw new s.RERR("InvalidType",`The stroke type ${this.type} does not exist`)}if(this.type===Y.Type.BRUSH_DOWN||this.type===Y.Type.BRUSH_UP)this.context.fillRect(r+this.x_shift,i,1,n-i);else if(this.note instanceof O)for(let t=i;t<=n;t+=o)f.renderGlyph(this.context,r+this.x_shift-4,t,this.render_options.font_scale,"va3");else{let t;for(t=i;t<=n;t+=10)f.renderGlyph(this.context,r+this.x_shift-4,t,this.render_options.font_scale,"va3");this.type===Y.Type.RASQUEDO_DOWN&&(d=t+.25*o)}this.type!==Y.Type.ARPEGGIO_DIRECTIONLESS&&(f.renderGlyph(this.context,r+this.x_shift+h,c,this.render_options.font_scale,l),this.type!==Y.Type.RASQUEDO_DOWN&&this.type!==Y.Type.RASQUEDO_UP||(this.context.save(),this.context.setFont(this.font.family,this.font.size,this.font.weight),this.context.fillText("R",r+u,d),this.context.restore()))}}class K extends B{static get CATEGORY(){return"stringnumber"}static format(t,e){const i=e.left_shift,s=e.right_shift;if(!t||0===t.length)return this;const n=[];let r,o,a,l,h,c=null,u=0,d=0;for(r=0;r<t.length;++r)for(o=t[r],a=o.getNote(),r=0;r<t.length;++r){o=t[r],a=o.getNote(),l=o.getPosition();const e=a.getKeyProps()[o.getIndex()];if(a!==c){for(let t=0;t<a.keys.length;++t)h=a.getKeyProps()[t],0===i&&(u=h.displaced?a.getExtraLeftPx():u),0===s&&(d=h.displaced?a.getExtraRightPx():d);c=a}n.push({pos:l,note:a,num:o,line:e.line,shiftL:u,shiftR:d})}n.sort(((t,e)=>e.line-t.line));let f=0,m=0,p=0,b=0,g=null,S=null;for(r=0;r<n.length;++r){let t=0;a=n[r].note,l=n[r].pos,o=n[r].num;const e=n[r].line,h=n[r].shiftL,c=n[r].shiftR;e===g&&a===S||(f=i+h,m=s+c);const d=o.getWidth()+1;l===B.Position.LEFT?(o.setXShift(i),t=u+d,p=t>p?t:p):l===B.Position.RIGHT&&(o.setXShift(m),t+=d,b=t>b?t:b),g=e,S=a}return e.left_shift+=p,e.right_shift+=b,!0}constructor(t){super(),this.setAttribute("type","StringNumber"),this.note=null,this.last_note=null,this.index=null,this.string_number=t,this.setWidth(20),this.position=B.Position.ABOVE,this.x_shift=0,this.y_shift=0,this.x_offset=0,this.y_offset=0,this.dashed=!0,this.leg=E.LineEndType.NONE,this.radius=8,this.font={family:"sans-serif",size:10,weight:"bold"}}getCategory(){return K.CATEGORY}getNote(){return this.note}setNote(t){return this.note=t,this}getIndex(){return this.index}setIndex(t){return this.index=t,this}setLineEndType(t){return t>=E.LineEndType.NONE&&t<=E.LineEndType.DOWN&&(this.leg=t),this}setStringNumber(t){return this.string_number=t,this}setOffsetX(t){return this.x_offset=t,this}setOffsetY(t){return this.y_offset=t,this}setLastNote(t){return this.last_note=t,this}setDashed(t){return this.dashed=t,this}draw(){const t=this.checkContext();if(!this.note||null==this.index)throw new s.RERR("NoAttachedNote","Can't draw string number without a note and index.");this.setRendered();const e=this.note.stave.options.spacing_between_lines_px,i=this.note.getModifierStartXY(this.position,this.index);let n=i.x+this.x_shift+this.x_offset,r=i.y+this.y_shift+this.y_offset;switch(this.position){case B.Position.ABOVE:case B.Position.BELOW:{const t=this.note.getStemExtents();let s=t.topY,n=t.baseY+2;this.note.stem_direction===O.STEM_DOWN&&(s=t.baseY,n=t.topY-2),r=this.position===B.Position.ABOVE?this.note.hasStem()?s-1.75*e:i.y-1.75*e:this.note.hasStem()?n+1.5*e:i.y+1.75*e,r+=this.y_shift+this.y_offset;break}case B.Position.LEFT:n-=this.radius/2+5;break;case B.Position.RIGHT:n+=this.radius/2+6;break;default:throw new s.RERR("InvalidPosition",`The position ${this.position} is invalid`)}t.save(),t.beginPath(),t.arc(n,r,this.radius,0,2*Math.PI,!1),t.lineWidth=1.5,t.stroke(),t.setFont(this.font.family,this.font.size,this.font.weight);const o=n-t.measureText(this.string_number).width/2;if(t.fillText(""+this.string_number,o,r+4.5),null!=this.last_note){const e=this.last_note.getStemX()-this.note.getX()+5;let i,s;switch(t.strokeStyle="#000000",t.lineCap="round",t.lineWidth=.6,this.dashed?E.drawDashedLine(t,n+10,r,n+e,r,[3,3]):E.drawDashedLine(t,n+10,r,n+e,r,[3,0]),this.leg){case E.LineEndType.UP:i=-10,s=this.dashed?[3,3]:[3,0],E.drawDashedLine(t,n+e,r,n+e,r+i,s);break;case E.LineEndType.DOWN:i=10,s=this.dashed?[3,3]:[3,0],E.drawDashedLine(t,n+e,r,n+e,r+i,s)}}t.restore()}}class q extends C{static getNextContext(t){const e=t.tContexts,i=e.indexOf(t);return e[i+1]}constructor(){super(),this.setAttribute("type","TickContext"),this.currentTick=new n(0,1),this.maxTicks=new n(0,1),this.minTicks=null,this.padding=3,this.x=0,this.xBase=0,this.xOffset=0,this.tickables=[],this.notePx=0,this.extraLeftPx=0,this.extraRightPx=0,this.tContexts=[]}getX(){return this.x}setX(t){return this.x=t,this.xBase=t,this.xOffset=0,this}getXBase(){return this.xBase}setXBase(t){this.xBase=t,this.x=t+this.xOffset}getXOffset(){return this.xOffset}setXOffset(t){this.xOffset=t,this.x=this.xBase+t}getWidth(){return this.width+2*this.padding}setPadding(t){return this.padding=t,this}getMaxTicks(){return this.maxTicks}getMinTicks(){return this.minTicks}getTickables(){return this.tickables}getCenterAlignedTickables(){return this.tickables.filter((t=>t.isCenterAligned()))}getMetrics(){const{width:t,notePx:e,extraLeftPx:i,extraRightPx:s}=this;return{width:t,notePx:e,extraLeftPx:i,extraRightPx:s}}getCurrentTick(){return this.currentTick}setCurrentTick(t){this.currentTick=t,this.preFormatted=!1}getExtraPx(){let t=0,e=0,i=0,s=0;for(let n=0;n<this.tickables.length;n++){i=Math.max(this.tickables[n].extraLeftPx||0,i),s=Math.max(this.tickables[n].extraRightPx||0,s);const r=this.tickables[n].modifierContext;r&&null!=r&&(t=Math.max(t,r.state.left_shift),e=Math.max(e,r.state.right_shift))}return{left:t,right:e,extraLeft:i,extraRight:s}}addTickable(t){if(!t)throw new s.RERR("BadArgument","Invalid tickable added.");if(!t.shouldIgnoreTicks()){this.ignore_ticks=!1;const e=t.getTicks();e.greaterThan(this.maxTicks)&&(this.maxTicks=e.clone()),(null==this.minTicks||e.lessThan(this.minTicks))&&(this.minTicks=e.clone())}return t.setTickContext(this),this.tickables.push(t),this.preFormatted=!1,this}preFormat(){if(this.preFormatted)return this;for(let t=0;t<this.tickables.length;++t){const e=this.tickables[t];e.preFormat();const i=e.getMetrics();this.extraLeftPx=Math.max(this.extraLeftPx,i.extraLeftPx+i.modLeftPx),this.extraRightPx=Math.max(this.extraRightPx,i.extraRightPx+i.modRightPx),this.notePx=Math.max(this.notePx,i.noteWidth),this.width=this.notePx+this.extraLeftPx+this.extraRightPx}return this}postFormat(){return this.postFormatted||(this.postFormatted=!0),this}}const{ABOVE:$,BELOW:J}=B.Position,Z=(t,e)=>.5*t(e/.5),Q=(t,e)=>e===$?t<=5:t>=1,tt=(t,e)=>Q(t,e)?e===$?Math.ceil:Math.floor:Math.round,et=t=>{const e=t.getCategory();return"stavenotes"===e||"gracenotes"===e};class it extends B{static get CATEGORY(){return"articulations"}static get INITIAL_OFFSET(){return-.5}static format(t,e){if(!t||0===t.length)return!1;const i=(t,e,i)=>Z(tt(e,i),t.glyph.getMetrics().height/10+.5);t.filter((t=>t.getPosition()===$)).forEach((t=>{t.setTextLine(e.top_text_line),e.top_text_line+=i(t,e.top_text_line,$)})),t.filter((t=>t.getPosition()===J)).forEach((t=>{t.setTextLine(e.text_line),e.text_line+=i(t,e.text_line,J)}));const s=t.map((t=>t.getWidth())).reduce(((t,e)=>Math.max(e,t)));return e.left_shift+=s/2,e.right_shift+=s/2,!0}static easyScoreHook({articulations:t},e,i){if(!t)return;const s={staccato:"a.",tenuto:"a-"};t.split(",").map((t=>t.trim().split("."))).map((([t,e])=>{const n={type:s[t]};return e&&(n.position=B.PositionString[e]),i.getFactory().Articulation(n)})).map((t=>e.addModifier(0,t)))}constructor(t){if(super(),this.setAttribute("type","Articulation"),this.note=null,this.index=null,this.type=t,this.position=J,this.render_options={font_scale:38},this.breathMarkDistance=.8,this.articulation=m.articulationCodes(this.type),"abr"===this.type&&(this.articulation={code:"v6c",between_lines:!1}),!this.articulation)throw new s.RERR("ArgumentError",`Articulation not found: ${this.type}`);this.glyph=new f(this.articulation.code,this.render_options.font_scale),this.setWidth(this.glyph.getMetrics().width)}getCategory(){return it.CATEGORY}draw(){const{note:t,index:e,position:i,glyph:n,articulation:{between_lines:r},text_line:o,context:a}=this;if(this.checkContext(),!t||null==e)throw new s.RERR("NoAttachedNote","Can't draw Articulation without a note and index.");this.setRendered();const l=t.getStave(),h=l.getSpacingBetweenLines(),c="tabnotes"===t.getCategory();let{x:u}=t.getModifierStartXY(i,e);if("abr"===this.type){let e=0;const i=t.getTickContext(),s=q.getNextContext(i),n=t.getTickContext().getX();if(s)e=(s.getX()-n)*this.breathMarkDistance;else{const i=t.getStave();e=(i.getX()+i.getWidth()-n)*this.breathMarkDistance}u+=e}const d=this.getXShift();d&&(u+=d);const f=!r||c,m=((t,e)=>{const i=e===$&&t.getStemDirection()===v.UP||e===J&&t.getStemDirection()===v.DOWN;return et(t)?t.hasStem()&&i?.5:1:t.hasStem()&&i?1:0})(t,i);let p={[$]:()=>{n.setOrigin(.5,1);const e=((t,e)=>{const i=t.getStave(),n=t.getStemDirection(),{topY:r,baseY:o}=t.getStemExtents();if(et(t))return t.hasStem()?n===v.UP?r:o:Math.min(...t.getYs());if("tabnotes"===t.getCategory())return t.hasStem()&&n===v.UP?r:i.getYForTopText(e);throw new s.RERR("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")})(t,o)-(o+m)*h;return f?Math.min(l.getYForTopText(it.INITIAL_OFFSET),e):e},[J]:()=>{n.setOrigin(.5,0);const e=((t,e)=>{const i=t.getStave(),n=t.getStemDirection(),{topY:r,baseY:o}=t.getStemExtents();if(et(t))return t.hasStem()?n===v.UP?o:r:Math.max(...t.getYs());if("tabnotes"===t.getCategory())return t.hasStem()?n===v.UP?i.getYForBottomText(e):r:i.getYForBottomText(e);throw new s.RERR("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")})(t,o)+(o+m)*h;return f?Math.max(l.getYForBottomText(it.INITIAL_OFFSET),e):e}}[i]();if(this.y_shift&&(p+=this.y_shift),!c){const s=i===$?-1:1,o=c?t.positions[e].str:t.getKeyProps()[e].line,a=(t.getYs()[e]-p)/h+o,l=((t,e,i,s)=>{const n=Z(tt(e,i),e);return t&&Q(n,i)&&n%1==0?n+.5*-s:n})(r,a,i,s);Q(l,i)&&n.setOrigin(.5,.5),p+=Math.abs(l-a)*h*s}!function(...t){it.DEBUG&&s.L("Vex.Flow.Articulation",t)}(`Rendering articulation at (x: ${u}, y: ${p})`),n.render(a,u,p)}}class st extends B{static get CATEGORY(){return"ornaments"}static format(t,e){if(!t||0===t.length)return!1;let i=0;for(let s=0;s<t.length;++s){const n=t[s],r=2;i=Math.max(n.getWidth(),i),n.getPosition()===B.Position.ABOVE?(n.setTextLine(e.top_text_line),e.top_text_line+=r):(n.setTextLine(e.text_line),e.text_line+=r)}return e.left_shift+=i/2,e.right_shift+=i/2,!0}constructor(t){if(super(),this.setAttribute("type","Ornament"),this.note=null,this.index=null,this.type=t,this.position=B.Position.ABOVE,this.delayed=!1,this.accidentalUpper=null,this.accidentalLower=null,this.render_options={font_scale:38,accidentalLowerPadding:3,accidentalUpperPadding:3},this.ornament=m.ornamentCodes(this.type),!this.ornament)throw new s.RERR("ArgumentError",`Ornament not found: '${this.type}'`);this.glyph=new f(this.ornament.code,this.render_options.font_scale),this.glyph.setOrigin(.5,1)}getCategory(){return st.CATEGORY}setDelayed(t){return this.delayed=t,this}setUpperAccidental(t){const e=this.render_options.font_scale/1.3;return this.accidentalUpper=new f(m.accidentalCodes(t).code,e),this.accidentalUpper.setOrigin(.5,1),this}setLowerAccidental(t){const e=this.render_options.font_scale/1.3;return this.accidentalLower=new f(m.accidentalCodes(t).code,e),this.accidentalLower.setOrigin(.5,1),this}draw(){if(this.checkContext(),!this.note||null==this.index)throw new s.RERR("NoAttachedNote","Can't draw Ornament without a note and index.");this.setRendered();const t=this.context,e=this.note.getStemDirection(),i=this.note.getStave(),n=this.note.getStem().getExtents();let r=e===O.STEM_DOWN?n.baseY:n.topY;"tabnotes"===this.note.getCategory()&&(this.note.hasStem()?e===O.STEM_DOWN&&(r=i.getYForTopText(this.text_line)):r=i.getYForTopText(this.text_line));const o=e===O.STEM_DOWN,a=i.getSpacingBetweenLines();let l=1;!o&&this.note.beam&&(l+=.5);const h=r-a*(this.text_line+l);let c=this.note.getModifierStartXY(this.position,this.index).x,u=Math.min(i.getYForTopText(this.text_line),h);if(u+=this.y_shift,this.delayed){let t=0;if(void 0!==this.delayXShift)t=this.delayXShift;else{t+=this.glyph.getMetrics().width/2;const e=q.getNextContext(this.note.getTickContext());t+=e?.5*(e.getX()-c):.5*(i.x+i.width-c),this.delayXShift=t}c+=t}!function(...t){st.DEBUG&&s.L("Vex.Flow.Ornament",t)}("Rendering ornament: ",this.ornament,c,u),this.accidentalLower&&(this.accidentalLower.render(t,c,u),u-=this.accidentalLower.getMetrics().height,u-=this.render_options.accidentalLowerPadding),this.glyph.render(t,c,u),u-=this.glyph.getMetrics().height,this.accidentalUpper&&(u-=this.render_options.accidentalUpperPadding,this.accidentalUpper.render(t,c,u))}}class nt extends B{static get CATEGORY(){return"annotations"}static get Justify(){return{LEFT:1,CENTER:2,RIGHT:3,CENTER_STEM:4}}static get JustifyString(){return{left:nt.Justify.LEFT,right:nt.Justify.RIGHT,center:nt.Justify.CENTER,centerStem:nt.Justify.CENTER_STEM}}static get VerticalJustify(){return{TOP:1,CENTER:2,BOTTOM:3,CENTER_STEM:4}}static get VerticalJustifyString(){return{above:nt.VerticalJustify.TOP,top:nt.VerticalJustify.TOP,below:nt.VerticalJustify.BOTTOM,bottom:nt.VerticalJustify.BOTTOM,center:nt.VerticalJustify.CENTER,centerStem:nt.VerticalJustify.CENTER_STEM}}static format(t,e){if(!t||0===t.length)return!1;let i=0;for(let s=0;s<t.length;++s){const n=t[s];i=Math.max(n.getWidth(),i),n.getPosition()===B.Position.ABOVE?(n.setTextLine(e.top_text_line),e.top_text_line++):(n.setTextLine(e.text_line),e.text_line++)}return e.left_shift+=i/2,e.right_shift+=i/2,!0}constructor(t){super(),this.setAttribute("type","Annotation"),this.note=null,this.index=null,this.text=t,this.justification=nt.Justify.CENTER,this.vert_justification=nt.VerticalJustify.TOP,this.font={family:"Arial",size:10,weight:""},this.setWidth(m.textWidth(t))}getCategory(){return nt.CATEGORY}setFont(t,e,i){return this.font={family:t,size:e,weight:i},this}setVerticalJustification(t){return this.vert_justification="string"==typeof t?nt.VerticalJustifyString[t]:t,this}getJustification(){return this.justification}setJustification(t){return this.justification="string"==typeof t?nt.JustifyString[t]:t,this}draw(){if(this.checkContext(),!this.note)throw new s.RERR("NoNoteForAnnotation","Can't draw text annotation without an attached note.");this.setRendered();const t=this.note.getModifierStartXY(B.Position.ABOVE,this.index);this.context.save(),this.context.setFont(this.font.family,this.font.size,this.font.weight);const e=this.context.measureText(this.text).width,i=this.context.measureText("m").width;let n,r,o,a;n=this.justification===nt.Justify.LEFT?t.x:this.justification===nt.Justify.RIGHT?t.x-e:this.justification===nt.Justify.CENTER?t.x-e/2:this.note.getStemX()-e/2;const l=this.note.hasStem(),h=this.note.getStave();if(l&&(o=this.note.getStem().getExtents(),a=h.getSpacingBetweenLines()),this.vert_justification===nt.VerticalJustify.BOTTOM){if(r=h.getYForBottomText(this.text_line+m.TEXT_HEIGHT_OFFSET_HACK),l){const t=1===this.note.getStemDirection()?o.baseY:o.topY;r=Math.max(r,t+a*(this.text_line+2))}}else if(this.vert_justification===nt.VerticalJustify.CENTER){const t=this.note.getYForTopText(this.text_line)-1;r=t+(h.getYForBottomText(this.text_line)-t)/2+i/2}else if(this.vert_justification===nt.VerticalJustify.TOP)r=Math.min(h.getYForTopText(this.text_line),this.note.getYs()[0]-10),l&&(r=Math.min(r,o.topY-5-a*this.text_line));else{const t=this.note.getStemExtents();r=t.topY+(t.baseY-t.topY)/2+i/2}!function(...t){nt.DEBUG&&s.L("Vex.Flow.Annotation",t)}("Rendering annotation: ",this.text,n,r),this.context.fillText(this.text,n,r),this.context.restore()}}class rt extends B{static get CATEGORY(){return"bends"}static get UP(){return 0}static get DOWN(){return 1}static format(t,e){if(!t||0===t.length)return!1;let i=0;const s=e.top_text_line;for(let e=0;e<t.length;++e){const n=t[e];n.setXShift(i),i=n.getWidth(),n.setTextLine(s)}return e.right_shift+=i,e.top_text_line+=1,!0}constructor(t,e,i){super(),this.setAttribute("type","Bend"),this.text=t,this.x_shift=0,this.release=e||!1,this.font="10pt Arial",this.render_options={line_width:1.5,line_style:"#777777",bend_width:8,release_width:8},i?this.phrase=i:(this.phrase=[{type:rt.UP,text:this.text}],this.release&&this.phrase.push({type:rt.DOWN,text:""})),this.updateWidth()}getCategory(){return rt.CATEGORY}setXShift(t){this.x_shift=t,this.updateWidth()}setFont(t){return this.font=t,this}getText(){return this.text}updateWidth(){const t=this;function e(e){let i;return i=t.context?t.context.measureText(e).width:m.textWidth(e),i}let i=0;for(let t=0;t<this.phrase.length;++t){const n=this.phrase[t];if("width"in n)i+=n.width;else{const t=n.type===rt.UP?this.render_options.bend_width:this.render_options.release_width;n.width=s.Max(t,e(n.text))+3,n.draw_width=n.width/2,i+=n.width}}return this.setWidth(i+this.x_shift),this}draw(){if(this.checkContext(),!this.note||null==this.index)throw new s.RERR("NoNoteForBend","Can't draw bend without a note or index.");this.setRendered();const t=this.note.getModifierStartXY(B.Position.RIGHT,this.index);t.x+=3,t.y+=.5;const e=this.x_shift,i=this.context,n=this.note.getStave().getYForTopText(this.text_line)+3,r=this.note.getStave().getYForTopText(this.text_line)-1,o=this;function a(t,e,s,n){const r=t+s,a=e;i.save(),i.beginPath(),i.setLineWidth(o.render_options.line_width),i.setStrokeStyle(o.render_options.line_style),i.setFillStyle(o.render_options.line_style),i.moveTo(t,e),i.quadraticCurveTo(r,a,t+s,n),i.stroke(),i.restore()}function l(t,e,s,n){i.save(),i.beginPath(),i.setLineWidth(o.render_options.line_width),i.setStrokeStyle(o.render_options.line_style),i.setFillStyle(o.render_options.line_style),i.moveTo(t,n),i.quadraticCurveTo(t+s,n,t+s,e),i.stroke(),i.restore()}function h(t,e,s){const n=s||1;i.beginPath(),i.moveTo(t,e),i.lineTo(t-4,e+4*n),i.lineTo(t+4,e+4*n),i.closePath(),i.fill()}function c(t,e){i.save(),i.setRawFont(o.font);const s=t-i.measureText(e).width/2;i.fillText(e,s,r),i.restore()}let u=null,d=0;for(let i=0;i<this.phrase.length;++i){const s=this.phrase[i];0===i&&(s.draw_width+=e),d=s.draw_width+(u?u.draw_width:0)-(1===i?e:0),s.type===rt.UP&&(u&&u.type===rt.UP&&h(t.x,n),a(t.x,t.y,d,n)),s.type===rt.DOWN&&(u&&u.type===rt.UP&&l(t.x,t.y,d,n),u&&u.type===rt.DOWN&&(h(t.x,t.y,-1),l(t.x,t.y,d,n)),null===u&&(d=s.draw_width,l(t.x,t.y,d,n))),c(t.x+d,s.text),u=s,u.x=t.x,t.x+=d}u.type===rt.UP?h(u.x+d,n):u.type===rt.DOWN&&h(u.x+d,t.y,-1)}}class ot extends B{static get CATEGORY(){return"vibratos"}static format(t,e,i){if(!t||0===t.length)return!1;let s=e.top_text_line,n=0,r=e.right_shift-7;const o=i.getModifiers(rt.CATEGORY);o&&o.length>0&&s--;for(let e=0;e<t.length;++e){const i=t[e];i.setXShift(r),i.setTextLine(s),n+=i.getWidth(),r+=n}return e.right_shift+=n,e.top_text_line+=1,!0}constructor(){super(),this.setAttribute("type","Vibrato"),this.position=B.Position.RIGHT,this.render_options={harsh:!1,vibrato_width:20,wave_height:6,wave_width:4,wave_girth:2},this.setVibratoWidth(this.render_options.vibrato_width)}getCategory(){return ot.CATEGORY}setHarsh(t){return this.render_options.harsh=t,this}setVibratoWidth(t){return this.render_options.vibrato_width=t,this.setWidth(t),this}draw(){const t=this.checkContext();if(!this.note)throw new s.RERR("NoNoteForVibrato","Can't draw vibrato without an attached note.");this.setRendered();const e=this.note.getModifierStartXY(B.Position.RIGHT,this.index).x+this.x_shift,i=this.note.getYForTopText(this.text_line)+2;ot.renderVibrato(t,e,i,this.render_options)}static renderVibrato(t,e,i,s){const{harsh:n,vibrato_width:r,wave_width:o,wave_girth:a,wave_height:l}=s,h=r/o;let c;if(t.beginPath(),n){for(t.moveTo(e,i+a+1),c=0;c<h/2;++c)t.lineTo(e+o,i-l/2),e+=o,t.lineTo(e+o,i+l/2),e+=o;for(c=0;c<h/2;++c)t.lineTo(e-o,i-l/2+a+1),e-=o,t.lineTo(e-o,i+l/2+a+1),e-=o;t.fill()}else{for(t.moveTo(e,i+a),c=0;c<h/2;++c)t.quadraticCurveTo(e+o/2,i-l/2,e+o,i),e+=o,t.quadraticCurveTo(e+o/2,i+l/2,e+o,i),e+=o;for(c=0;c<h/2;++c)t.quadraticCurveTo(e-o/2,i+l/2+a,e-o,i+a),e-=o,t.quadraticCurveTo(e-o/2,i-l/2+a,e-o,i+a),e-=o;t.fill()}}}function at(...t){lt.DEBUG&&s.L("Vex.Flow.ModifierContext",t)}class lt{constructor(){this.modifiers={},this.preFormatted=!1,this.postFormatted=!1,this.width=0,this.spacing=0,this.state={left_shift:0,right_shift:0,text_line:0,top_text_line:0},this.PREFORMAT=[O,F,k,U,Y,j,z,K,it,st,nt,rt,ot],this.POSTFORMAT=[O]}addModifier(t){const e=t.getCategory();return this.modifiers[e]||(this.modifiers[e]=[]),this.modifiers[e].push(t),t.setModifierContext(this),this.preFormatted=!1,this}getModifiers(t){return this.modifiers[t]}getWidth(){return this.width}getExtraLeftPx(){return this.state.left_shift}getExtraRightPx(){return this.state.right_shift}getState(){return this.state}getMetrics(){if(!this.formatted)throw new s.RERR("UnformattedModifier","Unformatted modifier has no metrics.");return{width:this.state.left_shift+this.state.right_shift+this.spacing,spacing:this.spacing,extra_left_px:this.state.left_shift,extra_right_px:this.state.right_shift}}preFormat(){this.preFormatted||(this.PREFORMAT.forEach((t=>{at("Preformatting ModifierContext: ",t.CATEGORY),t.format(this.getModifiers(t.CATEGORY),this.state,this)})),this.width=this.state.left_shift+this.state.right_shift,this.preFormatted=!0)}postFormat(){this.postFormatted||this.POSTFORMAT.forEach((t=>{at("Postformatting ModifierContext: ",t.CATEGORY),t.postFormat(this.getModifiers(t.CATEGORY),this)}))}}function ht(t,e,i,n){let r=e;for(i+=1;i<t.length;i+=1){const e=t[i];if(!e.isRest()&&!e.shouldIgnoreTicks()){r=e.getLineForRest();break}}if(n&&e!==r){const t=Math.max(e,r),i=Math.min(e,r);r=s.MidLine(t,i)}return r}function ct(t,e,i){if(!t||!t.length)throw new s.RERR("BadArgument","No voices to format");t[0].getTotalTicks();const r=t.reduce(((t,e)=>{if(e.getMode()===T.Mode.STRICT&&!e.isComplete())throw new s.RERR("IncompleteVoice","Voice does not have enough notes.");return Math.max(t,n.LCM(t,e.getResolutionMultiplier()))}),1),o={},a=[],l=[];return t.forEach((t=>{const s=new n(0,r);t.getTickables().forEach((t=>{const n=s.numerator;if(!o[n]){const t=new e;l.push(t),o[n]=t}i(t,o[n]),a.push(n),s.add(t.getTicks())}))})),{map:o,array:l,list:s.SortAndUnique(a,((t,e)=>t-e),((t,e)=>t===e)),resolutionMultiplier:r}}class ut{static SimpleFormat(t,e=0,{paddingBetween:i=10}={}){t.reduce(((t,e)=>{e.addToModifierContext(new lt);const s=(new q).addTickable(e).preFormat(),n=s.getExtraPx();return s.setX(t+n.left),t+s.getWidth()+n.right+i}),e)}static plotDebugging(t,e,i,s,n){const r=i+I.STAVEPADDING,o=e.contextGaps;t.save(),t.setFont("Arial",8,""),o.gaps.forEach((e=>{var i,o,a;i=r+e.x1,o=r+e.x2,a="#aaa",t.beginPath(),t.setStrokeStyle(a),t.setFillStyle(a),t.setLineWidth(1),t.fillRect(i,s,o-i,n-s),t.fillText(Math.round(e.x2-e.x1),r+e.x1,n+12)})),t.fillText(Math.round(o.total)+"px",r-20,n+12),t.setFillStyle("red"),t.fillText("Loss: "+e.lossHistory.map((t=>Math.round(t))),r-20,n+22),t.restore()}static FormatAndDraw(t,e,i,n){const r={auto_beam:!1,align_rests:!1};"object"==typeof n?s.Merge(r,n):"boolean"==typeof n&&(r.auto_beam=n);const o=new T(m.TIME4_4).setMode(T.Mode.SOFT).addTickables(i),a=r.auto_beam?P.applyAndGetBeams(o):[];return(new ut).joinVoices([o],{align_rests:r.align_rests}).formatToStave([o],e,{align_rests:r.align_rests,stave:e}),o.setStave(e).draw(t,e),a.forEach((e=>e.setContext(t).draw())),o.getBoundingBox()}static FormatAndDrawTab(t,e,i,n,r,o,a){const l={auto_beam:o,align_rests:!1};"object"==typeof a?s.Merge(l,a):"boolean"==typeof a&&(l.auto_beam=a);const h=new T(m.TIME4_4).setMode(T.Mode.SOFT).addTickables(r),c=new T(m.TIME4_4).setMode(T.Mode.SOFT).addTickables(n),u=l.auto_beam?P.applyAndGetBeams(h):[];(new ut).joinVoices([h],{align_rests:l.align_rests}).joinVoices([c]).formatToStave([h,c],i,{align_rests:l.align_rests}),h.draw(t,i),c.draw(t,e),u.forEach((e=>e.setContext(t).draw())),new A(i,e).setContext(t).draw()}static AlignRestsToNotes(t,e,i){return t.forEach(((s,n)=>{if(s instanceof O&&s.isRest()){if(s.tuplet&&!i)return;const r=s.getGlyph().position.toUpperCase();if("R/4"!==r&&"B/4"!==r)return;if(e||null!=s.beam){const e=s.getKeyProps()[0];if(0===n)e.line=ht(t,e.line,n,!1),s.setKeyLine(0,e.line);else if(n>0&&n<t.length){let i;t[n-1].isRest()?(i=t[n-1].getKeyProps()[0].line,e.line=i):(i=t[n-1].getLineForRest(),e.line=ht(t,i,n,!0)),s.setKeyLine(0,e.line)}}}})),this}constructor(){this.minTotalWidth=0,this.hasMinTotalWidth=!1,this.totalTicks=new n(0,1),this.tickContexts=null,this.modiferContexts=null,this.contextGaps={total:0,gaps:[]},this.voices=[]}alignRests(t,e){if(!t||!t.length)throw new s.RERR("BadArgument","No voices to format rests");t.forEach((t=>ut.AlignRestsToNotes(t.getTickables(),e)))}preCalculateMinTotalWidth(t){if(this.hasMinTotalWidth)return this.minTotalWidth;if(!this.tickContexts){if(!t)throw new s.RERR("BadArgument","'voices' required to run preCalculateMinTotalWidth");this.createTickContexts(t)}const{list:e,map:i}=this.tickContexts;return this.minTotalWidth=e.map((t=>{const e=i[t];return e.preFormat(),e.getWidth()})).reduce(((t,e)=>t+e),0),this.hasMinTotalWidth=!0,this.minTotalWidth}getMinTotalWidth(){if(!this.hasMinTotalWidth)throw new s.RERR("NoMinTotalWidth","Call 'preCalculateMinTotalWidth' or 'preFormat' before calling 'getMinTotalWidth'");return this.minTotalWidth}createModifierContexts(t){const e=ct(t,lt,((t,e)=>t.addToModifierContext(e)));return this.modiferContexts=e,e}createTickContexts(t){const e=ct(t,q,((t,e)=>e.addTickable(t)));return e.array.forEach((t=>{t.tContexts=e.array})),this.totalTicks=t[0].getTicksUsed().clone(),this.tickContexts=e,e}preFormat(t=0,e,i,s){const n=this.tickContexts,{list:r,map:o,resolutionMultiplier:a}=n;i&&s&&i.forEach((t=>t.setStave(s).preFormat()));let l=0,h=0;const c=t/2;if(this.minTotalWidth=0,r.forEach((t=>{const i=o[t];e&&i.setContext(e),i.preFormat();const s=i.getWidth();this.minTotalWidth+=s;const n=i.getMetrics();l=l+h+n.extraLeftPx,i.setX(l),h=s-n.extraLeftPx})),this.minTotalWidth=l+h,this.hasMinTotalWidth=!0,t<=0)return;const u=(t-this.minTotalWidth)/(this.totalTicks.value()*a);let d=0;r.forEach(((t,e)=>{const i=r[e-1]||0,s=o[t];d+=(t-i)*u,s.setX(s.getX()+d),s.getCenterAlignedTickables().forEach((t=>{t.center_x_shift=c-s.getX()}))})),1!==r.length&&(this.justifyWidth=t,this.lossHistory=[],this.evaluate())}evaluate(){const t=this.justifyWidth;this.contextGaps={total:0,gaps:[]},this.tickContexts.list.forEach(((t,e)=>{if(0===e)return;const i=this.tickContexts.list[e-1],s=this.tickContexts.map[i],n=this.tickContexts.map[t],r=s.getMetrics(),o=s.getX()+r.width,a=n.getX(),l=a-o;this.contextGaps.total+=l,this.contextGaps.gaps.push({x1:o,x2:a}),n.getFormatterMetrics().freedom.left=l,s.getFormatterMetrics().freedom.right=l}));const e=this.durationStats={};this.voices.forEach((i=>{i.getTickables().forEach(((i,s,n)=>{const r=i.getTicks().clone().simplify().toString(),o=i.getMetrics(),a=i.getFormatterMetrics(),l=i.getX()+o.noteWidth+o.modRightPx+o.extraRightPx;let h=0;if(s<n.length-1){const t=n[s+1],e=t.getMetrics();h=t.getX()-e.modLeftPx-e.extraLeftPx-l,a.space.used=t.getX()-i.getX(),t.getFormatterMetrics().freedom.left=h}else h=t-l,a.space.used=t-i.getX();a.freedom.right=h,function(t,i){const s=e[t];void 0===s?e[t]={mean:i,count:1}:(s.count+=1,s.mean=(s.mean+i)/2)}(r,a.space.used)}))}));let i=0;return this.voices.forEach((t=>{t.getTickables().forEach((t=>{const s=t.getTicks().clone().simplify().toString(),n=t.getFormatterMetrics();n.iterations+=1,n.space.deviation=n.space.used-e[s].mean,n.duration=s,n.space.mean=e[s].mean,i+=Math.pow(e[s].mean,2)}))})),this.totalCost=Math.sqrt(i),this.lossHistory.push(this.totalCost),this}tune(){let t=0;return this.tickContexts.list.forEach(((e,i,s)=>{const n=this.tickContexts.map[e],r=i>0?this.tickContexts.map[s[i-1]]:null,o=i<s.length-1?this.tickContexts.map[s[i+1]]:null;!function(t,e,i,s){t.setX(t.getX()+s),t.getFormatterMetrics().freedom.left+=s,t.getFormatterMetrics().freedom.right-=s,e&&(e.getFormatterMetrics().freedom.right+=s),i&&(i.getFormatterMetrics().freedom.left-=s)}(n,r,o,t);const a=-n.getTickables().map((t=>t.getFormatterMetrics().space.deviation)).reduce(((t,e)=>t+e));a>0?t=-Math.min(n.getFormatterMetrics().freedom.right,Math.abs(a)):a<0&&(t=o?Math.min(o.getFormatterMetrics().freedom.right,Math.abs(a)):0);const l=Math.min(5,Math.abs(t));t=t>0?l:-l})),this.evaluate()}postFormat(){const t=t=>t.list.forEach((e=>t.map[e].postFormat()));return t(this.modiferContexts),t(this.tickContexts),this}joinVoices(t){return this.createModifierContexts(t),this.hasMinTotalWidth=!1,this}format(t,e,i){const n={align_rests:!1,context:null,stave:null};return s.Merge(n,i),this.voices=t,this.alignRests(t,n.align_rests),this.createTickContexts(t),this.preFormat(e,n.context,t,n.stave),n.stave&&this.postFormat(),this}formatToStave(t,e,i){const n=e.getNoteEndX()-e.getNoteStartX()-10;!function(...t){ut.DEBUG&&s.L("Vex.Flow.Formatter",t)}("Formatting voices to width: ",n);const r={context:e.getContext()};return s.Merge(r,i),this.format(t,n,r)}}class dt extends l{static get Position(){return{LEFT:1,RIGHT:2,ABOVE:3,BELOW:4,BEGIN:5,END:6}}constructor(){super(),this.setAttribute("type","StaveModifier"),this.padding=10,this.position=dt.Position.ABOVE,this.layoutMetrics=null}getPosition(){return this.position}setPosition(t){return this.position=t,this}getStave(){return this.stave}setStave(t){return this.stave=t,this}getWidth(){return this.width}setWidth(t){return this.width=t,this}getX(){return this.x}setX(t){return this.x=t,this}getCategory(){return""}makeSpacer(t){return{getContext:()=>!0,setStave(){},renderToStave(){},getMetrics:()=>({width:t})}}placeGlyphOnLine(t,e,i){t.setYShift(e.getYForLine(i)-e.getYForGlyphs())}getPadding(t){return void 0!==t&&t<2?0:this.padding}setPadding(t){return this.padding=t,this}setLayoutMetrics(t){return this.layoutMetrics=t,this}getLayoutMetrics(){return this.layoutMetrics}}class ft extends dt{static get CATEGORY(){return"barlines"}static get type(){return{SINGLE:1,DOUBLE:2,END:3,REPEAT_BEGIN:4,REPEAT_END:5,REPEAT_BOTH:6,NONE:7}}static get typeString(){return{single:ft.type.SINGLE,double:ft.type.DOUBLE,end:ft.type.END,repeatBegin:ft.type.REPEAT_BEGIN,repeatEnd:ft.type.REPEAT_END,repeatBoth:ft.type.REPEAT_BOTH,none:ft.type.NONE}}constructor(t){super(),this.setAttribute("type","Barline"),this.thickness=m.STAVE_LINE_THICKNESS;const e=ft.type;this.widths={},this.widths[e.SINGLE]=5,this.widths[e.DOUBLE]=5,this.widths[e.END]=5,this.widths[e.REPEAT_BEGIN]=5,this.widths[e.REPEAT_END]=5,this.widths[e.REPEAT_BOTH]=5,this.widths[e.NONE]=5,this.paddings={},this.paddings[e.SINGLE]=0,this.paddings[e.DOUBLE]=0,this.paddings[e.END]=0,this.paddings[e.REPEAT_BEGIN]=15,this.paddings[e.REPEAT_END]=15,this.paddings[e.REPEAT_BOTH]=15,this.paddings[e.NONE]=0,this.layoutMetricsMap={},this.layoutMetricsMap[e.SINGLE]={xMin:0,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.DOUBLE]={xMin:-3,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.END]={xMin:-5,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.REPEAT_END]={xMin:-10,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.REPEAT_BEGIN]={xMin:-2,xMax:10,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.REPEAT_BOTH]={xMin:-10,xMax:10,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.NONE]={xMin:0,xMax:0,paddingLeft:5,paddingRight:5},this.setPosition(dt.Position.BEGIN),this.setType(t)}getCategory(){return ft.CATEGORY}getType(){return this.type}setType(t){return this.type="string"==typeof t?ft.typeString[t]:t,this.setWidth(this.widths[this.type]),this.setPadding(this.paddings[this.type]),this.setLayoutMetrics(this.layoutMetricsMap[this.type]),this}draw(t){switch(t.checkContext(),this.setRendered(),this.type){case ft.type.SINGLE:this.drawVerticalBar(t,this.x,!1);break;case ft.type.DOUBLE:this.drawVerticalBar(t,this.x,!0);break;case ft.type.END:this.drawVerticalEndBar(t,this.x);break;case ft.type.REPEAT_BEGIN:this.drawRepeatBar(t,this.x,!0),t.getX()!==this.x&&this.drawVerticalBar(t,t.getX());break;case ft.type.REPEAT_END:this.drawRepeatBar(t,this.x,!1);break;case ft.type.REPEAT_BOTH:this.drawRepeatBar(t,this.x,!1),this.drawRepeatBar(t,this.x,!0)}}drawVerticalBar(t,e,i){t.checkContext();const s=t.getTopLineTopY(),n=t.getBottomLineBottomY();i&&t.context.fillRect(e-3,s,1,n-s),t.context.fillRect(e,s,1,n-s)}drawVerticalEndBar(t,e){t.checkContext();const i=t.getTopLineTopY(),s=t.getBottomLineBottomY();t.context.fillRect(e-5,i,1,s-i),t.context.fillRect(e-2,i,3,s-i)}drawRepeatBar(t,e,i){t.checkContext();const s=t.getTopLineTopY(),n=t.getBottomLineBottomY();let r=3;i||(r=-5),t.context.fillRect(e+r,s,1,n-s),t.context.fillRect(e-2,s,3,n-s),i?r+=4:r-=4;const o=e+r+1;let a=(t.getNumLines()-1)*t.getSpacingBetweenLines();a=a/2-t.getSpacingBetweenLines()/2;let l=s+a+1;t.context.beginPath(),t.context.arc(o,l,2,0,2*Math.PI,!1),t.context.fill(),l+=t.getSpacingBetweenLines(),t.context.beginPath(),t.context.arc(o,l,2,0,2*Math.PI,!1),t.context.fill()}}class mt extends dt{static get CATEGORY(){return"repetitions"}static get type(){return{NONE:1,CODA_LEFT:2,CODA_RIGHT:3,SEGNO_LEFT:4,SEGNO_RIGHT:5,DC:6,DC_AL_CODA:7,DC_AL_FINE:8,DS:9,DS_AL_CODA:10,DS_AL_FINE:11,FINE:12,TO_CODA:13}}constructor(t,e,i){super(),this.setAttribute("type","Repetition"),this.symbol_type=t,this.x=e,this.x_shift=0,this.y_shift=i,this.font={family:"times",size:12,weight:"bold italic"}}getCategory(){return mt.CATEGORY}setShiftX(t){return this.x_shift=t,this}setShiftY(t){return this.y_shift=t,this}setX(t){return this.x=t,this}draw(t,e){switch(this.setRendered(),this.symbol_type){case mt.type.CODA_RIGHT:this.drawCodaFixed(t,e+t.width);break;case mt.type.CODA_LEFT:this.drawSymbolText(t,e,"Coda",!0);break;case mt.type.SEGNO_LEFT:this.drawSignoFixed(t,e);break;case mt.type.SEGNO_RIGHT:this.drawSignoFixed(t,e+t.width);break;case mt.type.DC:this.drawSymbolText(t,e,"D.C.",!1);break;case mt.type.DC_AL_CODA:this.drawSymbolText(t,e,"D.C. al",!0);break;case mt.type.DC_AL_FINE:this.drawSymbolText(t,e,"D.C. al Fine",!1);break;case mt.type.DS:this.drawSymbolText(t,e,"D.S.",!1);break;case mt.type.DS_AL_CODA:this.drawSymbolText(t,e,"D.S. al",!0);break;case mt.type.DS_AL_FINE:this.drawSymbolText(t,e,"D.S. al Fine",!1);break;case mt.type.FINE:this.drawSymbolText(t,e,"Fine",!1);break;case mt.type.TO_CODA:this.drawSymbolText(t,e,"To",!0)}return this}drawCodaFixed(t,e){const i=t.getYForTopText(t.options.num_lines)+this.y_shift;return f.renderGlyph(t.context,this.x+e+this.x_shift,i+25,40,"v4d",!0),this}drawSignoFixed(t,e){const i=t.getYForTopText(t.options.num_lines)+this.y_shift;return f.renderGlyph(t.context,this.x+e+this.x_shift,i+25,30,"v8c",!0),this}drawSymbolText(t,e,i,s){const n=t.checkContext();n.save(),n.setFont(this.font.family,this.font.size,this.font.weight);let r=0+this.x_shift,o=e+this.x_shift;if(this.symbol_type===mt.type.CODA_LEFT?(r=this.x+this.x_shift,o=r+n.measureText(i).width+12):(this.x_shift=-(r+n.measureText(i).width+12+t.options.vertical_bar_width+12),r=this.x+this.x_shift+t.options.vertical_bar_width,o=r+n.measureText(i).width+12),this.xShiftAsPercentOfStaveWidth){const e=t.width*this.xShiftAsPercentOfStaveWidth;this.symbol_type!==mt.type.DC_AL_FINE&&this.symbol_type!==mt.type.FINE&&this.symbol_type!==mt.type.DC&&this.symbol_type!==mt.type.DS_AL_FINE&&this.symbol_type!==mt.type.DS&&this.symbol_type!==mt.type.FINE||(r+=e)}const a=t.getYForTopText(t.options.num_lines)+this.y_shift+25;return s&&f.renderGlyph(n,o,a,40,"v4d",!0),n.fillText(i,r,a+5),n.restore(),this}}class pt extends dt{static get CATEGORY(){return"stavesection"}constructor(t,e,i){super(),this.setAttribute("type","StaveSection"),this.setWidth(16),this.section=t,this.x=e,this.shift_x=0,this.shift_y=i,this.font={family:"sans-serif",size:12,weight:"bold"}}getCategory(){return pt.CATEGORY}setStaveSection(t){return this.section=t,this}setShiftX(t){return this.shift_x=t,this}setShiftY(t){return this.shift_y=t,this}draw(t,e){const i=t.checkContext();this.setRendered(),i.save(),i.lineWidth=2,i.setFont(this.font.family,this.font.size,this.font.weight);const s=i.measureText(""+this.section),n=s.width;let r=s.height;!r&&s.emHeightAscent>=0&&(r=s.emHeightAscent+2),r||(r=s.fontBoundingBoxAscent+3);let o=n+6;o<18&&(o=18);const a=r+this.font.size/10,l=t.getYForTopText(3)+19-1.15*a+this.shift_y;let h=this.x+e;return i.beginPath(),i.lineWidth=2,i.rect(h,l+r/4,o,a),i.stroke(),h+=(o-n)/2,i.fillText(""+this.section,h,l+a),i.restore(),this}}class bt extends dt{static get CATEGORY(){return"stavetempo"}constructor(t,e,i){super(),this.setAttribute("type","StaveTempo"),this.tempo=t,this.position=B.Position.ABOVE,this.x=e,this.shift_x=10,this.shift_y=i,this.font={family:"times",size:14,weight:"bold"},this.render_options={glyph_font_scale:30}}getCategory(){return bt.CATEGORY}setTempo(t){return this.tempo=t,this}setShiftX(t){return this.shift_x=t,this}setShiftY(t){return this.shift_y=t,this}draw(t,e){const i=t.checkContext();this.setRendered();const s=this.render_options,n=s.glyph_font_scale/38,r=this.tempo.name,o=this.tempo.duration,a=this.tempo.dots,l=this.tempo.bpm,h=this.font;let c=this.x+this.shift_x+e;const u=t.getYForTopText(1)+this.shift_y;if(i.save(),r&&(i.setFont(h.family,h.size,h.weight),i.fillText(r,c,u),c+=i.measureText(r).width),o&&l){i.setFont(h.family,h.size,"normal"),r&&(c+=i.measureText(" ").width,i.fillText("(",c,u),c+=i.measureText("(").width);const t=m.getGlyphProps(o);if(c+=3*n,f.renderGlyph(i,c,u,s.glyph_font_scale,t.code_head),c+=t.getWidth()*n,t.stem){let e=30;t.beam_count&&(e+=3*(t.beam_count-1)),e*=n;const r=u-e;i.fillRect(c-n,r,n,e),t.flag&&(f.renderGlyph(i,c,r,s.glyph_font_scale,t.code_flag_upstem),a||(c+=6*n))}for(let t=0;t<a;t++)c+=6*n,i.beginPath(),i.arc(c,u+2*n,2*n,0,2*Math.PI,!1),i.fill();i.fillText(" = "+l+(r?")":""),c+3*n,u)}return i.restore(),this}}class gt extends I{static get Justification(){return{LEFT:1,CENTER:2,RIGHT:3}}static get GLYPHS(){return{segno:{code:"v8c",point:40,x_shift:0,y_shift:-10},tr:{code:"v1f",point:40,x_shift:0,y_shift:0},mordent_upper:{code:"v1e",point:40,x_shift:0,y_shift:0},mordent_lower:{code:"v45",point:40,x_shift:0,y_shift:0},f:{code:"vba",point:40,x_shift:0,y_shift:0},p:{code:"vbf",point:40,x_shift:0,y_shift:0},m:{code:"v62",point:40,x_shift:0,y_shift:0},s:{code:"v4a",point:40,x_shift:0,y_shift:0},z:{code:"v80",point:40,x_shift:0,y_shift:0},coda:{code:"v4d",point:40,x_shift:0,y_shift:-8},pedal_open:{code:"v36",point:40,x_shift:0,y_shift:0},pedal_close:{code:"v5d",point:40,x_shift:0,y_shift:3},caesura_straight:{code:"v34",point:40,x_shift:0,y_shift:2},caesura_curved:{code:"v4b",point:40,x_shift:0,y_shift:2},breath:{code:"v6c",point:40,x_shift:0,y_shift:0},tick:{code:"v6f",point:50,x_shift:0,y_shift:0},turn:{code:"v72",point:40,x_shift:0,y_shift:0},turn_inverted:{code:"v33",point:40,x_shift:0,y_shift:0},mordent:{code:"v1e",point:40,x_shift:0,y_shift:0}}}constructor(t){if(super(t),this.setAttribute("type","TextNote"),this.text=t.text,this.superscript=t.superscript,this.subscript=t.subscript,this.glyph_type=t.glyph,this.glyph=null,this.font={family:"Arial",size:12,weight:""},t.font&&(this.font=t.font),this.glyph_type){const t=gt.GLYPHS[this.glyph_type];if(!t)throw new s.RERR("Invalid glyph type: "+this.glyph_type);this.glyph=new f(t.code,t.point,{cache:!1}),t.width?this.setWidth(t.width):this.setWidth(this.glyph.getMetrics().width),this.glyph_struct=t}else this.setWidth(m.textWidth(this.text));this.line=t.line||0,this.smooth=t.smooth||!1,this.ignore_ticks=t.ignore_ticks||!1,this.justification=gt.Justification.LEFT}setJustification(t){return this.justification=t,this}setLine(t){return this.line=t,this}preFormat(){this.checkContext(),this.preFormatted||(this.smooth?this.setWidth(0):this.glyph||this.setWidth(this.context.measureText(this.text).width),this.justification===gt.Justification.CENTER?this.extraLeftPx=this.width/2:this.justification===gt.Justification.RIGHT&&(this.extraLeftPx=this.width),this.setPreFormatted(!0))}draw(){if(this.checkContext(),!this.stave)throw new s.RERR("NoStave","Can't draw without a stave.");this.setRendered();const t=this.context;let e,i=this.getAbsoluteX();if(this.justification===gt.Justification.CENTER?i-=this.getWidth()/2:this.justification===gt.Justification.RIGHT&&(i-=this.getWidth()),this.glyph)e=this.stave.getYForLine(this.line+-3),this.glyph.render(this.context,i+this.glyph_struct.x_shift,e+this.glyph_struct.y_shift);else{e=this.stave.getYForLine(this.line+-3),this.applyStyle(t),t.setFont(this.font.family,this.font.size,this.font.weight),t.fillText(this.text,i,e);const s=t.measureText("M").width,n=t.measureText(this.text).width;this.superscript&&(t.setFont(this.font.family,this.font.size/1.3,this.font.weight),t.fillText(this.superscript,i+n+2,e-s/2.2)),this.subscript&&(t.setFont(this.font.family,this.font.size/1.3,this.font.weight),t.fillText(this.subscript,i+n+2,e+s/2.2-1)),this.restoreStyle(t)}}}class St extends dt{static get CATEGORY(){return"stavetext"}constructor(t,e,i){super(),this.setAttribute("type","StaveText"),this.setWidth(16),this.text=t,this.position=e,this.options={shift_x:0,shift_y:0,justification:gt.Justification.CENTER},s.Merge(this.options,i),this.font={family:"times",size:16,weight:"normal"}}getCategory(){return St.CATEGORY}setStaveText(t){return this.text=t,this}setShiftX(t){return this.shift_x=t,this}setShiftY(t){return this.shift_y=t,this}setFont(t){s.Merge(this.font,t)}setText(t){this.text=t}draw(t){const e=t.checkContext();this.setRendered(),e.save(),e.lineWidth=2,e.setFont(this.font.family,this.font.size,this.font.weight);const i=e.measureText(""+this.text).width;let n,r;const o=dt.Position,a=gt.Justification;switch(this.position){case o.LEFT:case o.RIGHT:r=(t.getYForLine(0)+t.getBottomLineY())/2+this.options.shift_y,n=this.position===o.LEFT?t.getX()-i-24+this.options.shift_x:t.getX()+t.getWidth()+24+this.options.shift_x;break;case o.ABOVE:case o.BELOW:n=t.getX()+this.options.shift_x,this.options.justification===a.CENTER?n+=t.getWidth()/2-i/2:this.options.justification===a.RIGHT&&(n+=t.getWidth()-i),r=this.position===o.ABOVE?t.getYForTopText(2)+this.options.shift_y:t.getYForBottomText(2)+this.options.shift_y;break;default:throw new s.RERR("InvalidPosition","Value Must be in Modifier.Position.")}return e.fillText(""+this.text,n,r+4),e.restore(),this}}class yt extends dt{static get CATEGORY(){return"clefs"}static get types(){return{treble:{code:"v83",line:3},bass:{code:"v79",line:1},alto:{code:"vad",line:2},tenor:{code:"vad",line:1},percussion:{code:"v59",line:2},soprano:{code:"vad",line:4},"mezzo-soprano":{code:"vad",line:3},"baritone-c":{code:"vad",line:0},"baritone-f":{code:"v79",line:2},subbass:{code:"v79",line:0},french:{code:"v83",line:4},tab:{code:"v2f"}}}static get sizes(){return{default:{point:40,width:26},small:{point:32,width:20}}}static get annotations(){return{"8va":{code:"v8",sizes:{default:{point:20,attachments:{treble:{line:-1.2,x_shift:11}}},small:{point:18,attachments:{treble:{line:-.4,x_shift:8}}}}},"8vb":{code:"v8",sizes:{default:{point:20,attachments:{treble:{line:6.3,x_shift:10},bass:{line:4,x_shift:1}}},small:{point:18,attachments:{treble:{line:5.8,x_shift:6},bass:{line:3.5,x_shift:.5}}}}}}}constructor(t,e,i){super(),this.setAttribute("type","Clef"),this.setPosition(dt.Position.BEGIN),this.setType(t,e,i),this.setWidth(yt.sizes[this.size].width),function(...t){yt.DEBUG&&s.L("Vex.Flow.Clef",t)}("Creating clef:",t)}getCategory(){return yt.CATEGORY}setType(t,e,i){if(this.type=t,this.clef=yt.types[t],this.size=void 0===e?"default":e,this.clef.point=yt.sizes[this.size].point,this.glyph=new f(this.clef.code,this.clef.point),void 0!==i){const t=yt.annotations[i];this.annotation={code:t.code,point:t.sizes[this.size].point,line:t.sizes[this.size].attachments[this.type].line,x_shift:t.sizes[this.size].attachments[this.type].x_shift},this.attachment=new f(this.annotation.code,this.annotation.point),this.attachment.metrics.x_max=0,this.attachment.setXShift(this.annotation.x_shift)}else this.annotation=void 0;return this}getWidth(){if("tab"===this.type&&!this.stave)throw new s.RERR("ClefError","Can't get width without stave.");return this.width}setStave(t){if(this.stave=t,"tab"!==this.type)return this;let e,i;const n=this.stave.getOptions().num_lines;switch(n){case 8:e=55,i=14;break;case 7:e=47,i=8;break;case 6:e=40,i=1;break;case 5:e=30,i=-6;break;case 4:e=23,i=-12;break;default:throw new s.RERR("ClefError",`Invalid number of lines: ${n}`)}return this.glyph.setPoint(e),this.glyph.setYShift(i),this}draw(){if(!this.x)throw new s.RERR("ClefError","Can't draw clef without x.");if(!this.stave)throw new s.RERR("ClefError","Can't draw clef without stave.");this.setRendered(),this.glyph.setStave(this.stave),this.glyph.setContext(this.stave.context),void 0!==this.clef.line&&this.placeGlyphOnLine(this.glyph,this.stave,this.clef.line),this.stave.context.openGroup("clef"),this.glyph.renderToStave(this.x),void 0!==this.annotation&&(this.placeGlyphOnLine(this.attachment,this.stave,this.annotation.line),this.attachment.setStave(this.stave),this.attachment.setContext(this.stave.context),this.attachment.renderToStave(this.x)),this.stave.context.closeGroup()}}class Et extends dt{static get CATEGORY(){return"keysignatures"}static get accidentalSpacing(){return{"#":{above:6,below:4},b:{above:4,below:7},n:{above:4,below:1},"##":{above:6,below:4},bb:{above:4,below:7},db:{above:4,below:7},d:{above:4,below:7},bbs:{above:4,below:7},"++":{above:6,below:4},"+":{above:6,below:4},"+-":{above:6,below:4},"++-":{above:6,below:4},bs:{above:4,below:10},bss:{above:4,below:10}}}constructor(t,e,i){super(),this.setAttribute("type","KeySignature"),this.setKeySig(t,e,i),this.setPosition(dt.Position.BEGIN),this.glyphFontScale=38,this.glyphs=[],this.xPositions=[],this.paddingForced=!1}getCategory(){return Et.CATEGORY}convertToGlyph(t,e){const i=m.accidentalCodes(t.type),s=new f(i.code,this.glyphFontScale);let n=1;if("n"===t.type&&e){const i=Et.accidentalSpacing[e.type];i&&(n=e.line>=t.line?i.above:i.below)}this.placeGlyphOnLine(s,this.stave,t.line),this.glyphs.push(s);const r=this.xPositions[this.xPositions.length-1],o=s.getMetrics().width+n;this.xPositions.push(r+o),this.width+=o}cancelKey(t){return this.formatted=!1,this.cancelKeySpec=t,this}convertToCancelAccList(t){const e=m.keySignature(t),i=this.accList.length>0&&e.length>0&&e[0].type!==this.accList[0].type,s=i?e.length:e.length-this.accList.length;if(s<1)return;const n=[];for(let t=0;t<s;t++){let r=t;i||(r=e.length-s+t);const o=e[r];n.push({type:"n",line:o.line})}return this.accList=n.concat(this.accList),{accList:n,type:e[0].type}}addToStave(t){return this.paddingForced=!0,t.addModifier(this),this}convertAccLines(t,e,i=this.accList){let s,n,r=0;switch(t){case"soprano":"#"===e?s=[2.5,.5,2,0,1.5,-.5,1]:r=-1;break;case"mezzo-soprano":"b"===e?s=[0,2,.5,2.5,1,3,1.5]:r=1.5;break;case"alto":r=.5;break;case"tenor":"#"===e?s=[3,1,2.5,.5,2,0,1.5]:r=-.5;break;case"baritone-f":case"baritone-c":"b"===e?s=[.5,2.5,1,3,1.5,3.5,2]:r=2;break;case"bass":case"french":r=1}if(void 0!==s)for(n=0;n<i.length;++n)i[n].line=s[n];else if(0!==r)for(n=0;n<i.length;++n)i[n].line+=r}getPadding(t){return this.formatted||this.format(),0===this.glyphs.length||!this.paddingForced&&t<2?0:this.padding}getWidth(){return this.formatted||this.format(),this.width}setKeySig(t,e,i){return this.formatted=!1,this.keySpec=t,this.cancelKeySpec=e,this.alterKeySpec=i,this}alterKey(t){return this.formatted=!1,this.alterKeySpec=t,this}convertToAlterAccList(t){const e=Math.min(t.length,this.accList.length);for(let i=0;i<e;++i)t[i]&&(this.accList[i].type=t[i])}format(){if(!this.stave)throw new s.RERR("KeySignatureError","Can't draw key signature without stave.");this.width=0,this.glyphs=[],this.xPositions=[0],this.accList=m.keySignature(this.keySpec);const t=this.accList,e=t.length>0?t[0].type:null;let i;if(this.cancelKeySpec&&(i=this.convertToCancelAccList(this.cancelKeySpec)),this.alterKeySpec&&this.convertToAlterAccList(this.alterKeySpec),this.accList.length>0){const s=(this.position===dt.Position.END?this.stave.endClef:this.stave.clef)||this.stave.clef;i&&this.convertAccLines(s,i.type,i.accList),this.convertAccLines(s,e,t);for(let t=0;t<this.accList.length;++t)this.convertToGlyph(this.accList[t],this.accList[t+1])}this.formatted=!0}draw(){if(!this.x)throw new s.RERR("KeySignatureError","Can't draw key signature without x.");if(!this.stave)throw new s.RERR("KeySignatureError","Can't draw key signature without stave.");if(this.formatted||this.format(),this.setRendered(),this.glyphs.length>0){this.stave.context.openGroup("keysignature");for(let t=0;t<this.glyphs.length;t++){const e=this.glyphs[t],i=this.x+this.xPositions[t];e.setStave(this.stave),e.setContext(this.stave.context),e.renderToStave(i)}this.stave.context.closeGroup()}}}class vt extends dt{static get CATEGORY(){return"timesignatures"}static get glyphs(){return{C:{code:"v41",point:40,line:2},"C|":{code:"vb6",point:40,line:2}}}constructor(t=null,e=15,i=!0){if(super(),this.setAttribute("type","TimeSignature"),this.validate_args=i,null===t)return;const s=e;this.point=40,this.topLine=2,this.bottomLine=4,this.setPosition(dt.Position.BEGIN),this.setTimeSig(t),this.setWidth(this.timeSig.glyph.getMetrics().width),this.setPadding(s)}getCategory(){return vt.CATEGORY}parseTimeSpec(t){if("C"===t||"C|"===t){const{line:e,code:i,point:s}=vt.glyphs[t];return{line:e,num:!1,glyph:new f(i,s)}}this.validate_args&&(t=>{const e=t.split("/").filter((t=>""!==t));if(2!==e.length)throw new s.RERR("BadTimeSignature",`Invalid time spec: ${t}. Must be in the form "<numerator>/<denominator>"`);e.forEach((e=>{if(isNaN(Number(e)))throw new s.RERR("BadTimeSignature",`Invalid time spec: ${t}. Must contain two valid numbers.`)}))})(t);const[e,i]=t.split("/").map((t=>t.split("")));return{num:!0,glyph:this.makeTimeSignatureGlyph(e,i)}}makeTimeSignatureGlyph(t,e){const i=new f("v0",this.point);i.topGlyphs=[],i.botGlyphs=[];let s=0;for(let e=0;e<t.length;++e){const n=t[e],r=new f("v"+n,this.point);i.topGlyphs.push(r),s+=r.getMetrics().width}let n=0;for(let t=0;t<e.length;++t){const s=e[t],r=new f("v"+s,this.point);i.botGlyphs.push(r),n+=r.getMetrics().width}const r=s>n?s:n,o=i.getMetrics().x_min;i.getMetrics=()=>({x_min:o,x_max:o+r,width:r});const a=(r-s)/2,l=(r-n)/2,h=this;return i.renderToStave=function(t){let e=t+a;for(let t=0;t<this.topGlyphs.length;++t){const i=this.topGlyphs[t];f.renderOutline(this.context,i.metrics.outline,i.scale,e+i.x_shift,this.stave.getYForLine(h.topLine)),e+=i.getMetrics().width}e=t+l;for(let t=0;t<this.botGlyphs.length;++t){const i=this.botGlyphs[t];h.placeGlyphOnLine(i,this.stave,i.line),f.renderOutline(this.context,i.metrics.outline,i.scale,e+i.x_shift,this.stave.getYForLine(h.bottomLine)),e+=i.getMetrics().width}},i}getTimeSig(){return this.timeSig}setTimeSig(t){return this.timeSig=this.parseTimeSpec(t),this}draw(){if(!this.x)throw new s.RERR("TimeSignatureError","Can't draw time signature without x.");if(!this.stave)throw new s.RERR("TimeSignatureError","Can't draw time signature without stave.");this.setRendered(),this.timeSig.glyph.setStave(this.stave),this.timeSig.glyph.setContext(this.stave.context),this.placeGlyphOnLine(this.timeSig.glyph,this.stave,this.timeSig.line),this.timeSig.glyph.renderToStave(this.x)}}class xt extends dt{static get CATEGORY(){return"voltas"}static get type(){return{NONE:1,BEGIN:2,MID:3,END:4,BEGIN_END:5}}constructor(t,e,i,s){super(),this.setAttribute("type","Volta"),this.volta=t,this.x=i,this.y_shift=s,this.number=e,this.font={family:"sans-serif",size:9,weight:"bold"}}getCategory(){return xt.CATEGORY}setShiftY(t){return this.y_shift=t,this}draw(t,e){const i=t.checkContext();this.setRendered();let s=t.width-e;const n=t.getYForTopText(t.options.num_lines)+this.y_shift,r=1.5*t.options.spacing_between_lines_px;switch(this.volta){case xt.type.BEGIN:i.fillRect(this.x+e,n,1,r);break;case xt.type.END:s-=5,i.fillRect(this.x+e+s,n,1,r);break;case xt.type.BEGIN_END:s-=3,i.fillRect(this.x+e,n,1,r),i.fillRect(this.x+e+s,n,1,r)}return this.volta!==xt.type.BEGIN&&this.volta!==xt.type.BEGIN_END||(i.save(),i.setFont(this.font.family,this.font.size,this.font.weight),i.fillText(this.number,this.x+e+5,n+15),i.restore()),i.fillRect(this.x+e,n,s,1),this}}class _t extends l{constructor(t,e,i,n){super(),this.setAttribute("type","Stave"),this.x=t,this.y=e,this.width=i,this.formatted=!1,this.setStartX(t+5),this.end_x=t+i,this.modifiers=[],this.measure=0,this.clef="treble",this.endClef=void 0,this.font={family:"sans-serif",size:8,weight:""},this.options={vertical_bar_width:10,glyph_spacing_px:10,num_lines:5,fill_style:"#999999",left_bar:!0,right_bar:!0,spacing_between_lines_px:10,space_above_staff_ln:4,space_below_staff_ln:4,top_text_position:1},this.bounds={x:this.x,y:this.y,w:this.width,h:0},s.Merge(this.options,n),this.resetLines();const r=ft.type;this.addModifier(new ft(this.options.left_bar?r.SINGLE:r.NONE)),this.addEndModifier(new ft(this.options.right_bar?r.SINGLE:r.NONE))}space(t){return this.options.spacing_between_lines_px*t}resetLines(){this.options.line_config=[];for(let t=0;t<this.options.num_lines;t++)this.options.line_config.push({visible:!0});this.height=(this.options.num_lines+this.options.space_above_staff_ln)*this.options.spacing_between_lines_px,this.options.bottom_text_position=this.options.num_lines}getOptions(){return this.options}setNoteStartX(t){this.formatted||this.format(),this.setStartX(t);const e=this.modifiers[0];return e.setX(this.start_x-e.getWidth()),this}setStartX(t){this.start_x=t}getNoteStartX(){return this.formatted||this.format(),this.start_x}getNoteEndX(){return this.formatted||this.format(),this.end_x}getTieStartX(){return this.start_x}getTieEndX(){return this.x+this.width}getX(){return this.x}getNumLines(){return this.options.num_lines}setNumLines(t){return this.options.num_lines=parseInt(t,10),this.resetLines(),this}setY(t){return this.y=t,this}getTopLineTopY(){return this.getYForLine(0)-m.STAVE_LINE_THICKNESS/2}getBottomLineBottomY(){return this.getYForLine(this.getNumLines()-1)+m.STAVE_LINE_THICKNESS/2}setX(t){const e=t-this.x;this.formatted=!1,this.x=t,this.start_x+=e,this.end_x+=e;for(let t=0;t<this.modifiers.length;t++){const i=this.modifiers[t];void 0!==i.x&&(i.x+=e)}return this}setWidth(t){return this.formatted=!1,this.width=t,this.end_x=this.x+t,this}getWidth(){return this.width}getStyle(){return{fillStyle:this.options.fill_style,strokeStyle:this.options.fill_style,lineWidth:m.STAVE_LINE_THICKNESS,...this.style||{}}}setMeasure(t){return this.measure=t,this}getModifierXShift(t=0){if("number"!=typeof t)throw new s.RERR("InvalidIndex","Must be of number type");if(this.formatted||this.format(),1===this.getModifiers(dt.Position.BEGIN).length)return 0;let e=this.start_x-this.x;const i=this.modifiers[0];return i.getType()===ft.type.REPEAT_BEGIN&&e>i.getWidth()&&(e-=i.getWidth()),e}setRepetitionTypeLeft(t,e){return this.modifiers.push(new mt(t,this.x,e)),this}setRepetitionTypeRight(t,e){return this.modifiers.push(new mt(t,this.x,e)),this}setVoltaType(t,e,i){return this.modifiers.push(new xt(t,e,this.x,i)),this}setSection(t,e,i=0,s=12){const n=new pt(t,this.x+i,e);return n.font.size=s,this.modifiers.push(n),this}setTempo(t,e){return this.modifiers.push(new bt(t,this.x,e)),this}setText(t,e,i){return this.modifiers.push(new St(t,e,i)),this}getHeight(){return this.height}getSpacingBetweenLines(){return this.options.spacing_between_lines_px}getBoundingBox(){return new c(this.x,this.y,this.width,this.getBottomY()-this.y)}getBottomY(){const t=this.options,e=t.spacing_between_lines_px;return this.getYForLine(t.num_lines)+t.space_below_staff_ln*e}getBottomLineY(){return this.getYForLine(this.options.num_lines)}getYForLine(t){const e=this.options,i=e.spacing_between_lines_px,s=e.space_above_staff_ln;return this.y+t*i+s*i}getLineForY(t){const e=this.options,i=e.spacing_between_lines_px,s=e.space_above_staff_ln;return(t-this.y)/i-s}getYForTopText(t){const e=t||0;return this.getYForLine(-e-this.options.top_text_position)}getYForBottomText(t){const e=t||0;return this.getYForLine(this.options.bottom_text_position+e)}getYForNote(t){const e=this.options,i=e.spacing_between_lines_px,s=e.space_above_staff_ln;return this.y+s*i+5*i-t*i}getYForGlyphs(){return this.getYForLine(3)}addModifier(t,e){return void 0!==e&&t.setPosition(e),t.setStave(this),this.formatted=!1,this.modifiers.push(t),this}addEndModifier(t){return this.addModifier(t,dt.Position.END),this}setBegBarType(t){const{SINGLE:e,REPEAT_BEGIN:i,NONE:s}=ft.type;return t!==e&&t!==i&&t!==s||(this.modifiers[0].setType(t),this.formatted=!1),this}setEndBarType(t){return t!==ft.type.REPEAT_BEGIN&&(this.modifiers[1].setType(t),this.formatted=!1),this}setClef(t,e,i,s){void 0===s&&(s=dt.Position.BEGIN),s===dt.Position.END?this.endClef=t:this.clef=t;const n=this.getModifiers(s,yt.CATEGORY);return 0===n.length?this.addClef(t,e,i,s):n[0].setType(t,e,i),this}setEndClef(t,e,i){return this.setClef(t,e,i,dt.Position.END),this}setKeySignature(t,e,i){void 0===i&&(i=dt.Position.BEGIN);const s=this.getModifiers(i,Et.CATEGORY);return 0===s.length?this.addKeySignature(t,e,i):s[0].setKeySig(t,e),this}setEndKeySignature(t,e){return this.setKeySignature(t,e,dt.Position.END),this}setTimeSignature(t,e,i){void 0===i&&(i=dt.Position.BEGIN);const s=this.getModifiers(i,vt.CATEGORY);return 0===s.length?this.addTimeSignature(t,e,i):s[0].setTimeSig(t),this}setEndTimeSignature(t,e){return this.setTimeSignature(t,e,dt.Position.END),this}addKeySignature(t,e,i){return void 0===i&&(i=dt.Position.BEGIN),this.addModifier(new Et(t,e).setPosition(i),i),this}addClef(t,e,i,s){return void 0===s||s===dt.Position.BEGIN?this.clef=t:s===dt.Position.END&&(this.endClef=t),this.addModifier(new yt(t,e,i),s),this}addEndClef(t,e,i){return this.addClef(t,e,i,dt.Position.END),this}addTimeSignature(t,e,i){return this.addModifier(new vt(t,e),i),this}addEndTimeSignature(t,e){return this.addTimeSignature(t,e,dt.Position.END),this}addTrebleGlyph(){return this.addClef("treble"),this}getModifiers(t,e){return void 0===t&&void 0===e?this.modifiers:this.modifiers.filter((i=>!(void 0!==t&&t!==i.getPosition()||void 0!==e&&e!==i.getCategory())))}sortByCategory(t,e){for(let i=t.length-1;i>=0;i--)for(let s=0;s<i;s++)if(e[t[s].getCategory()]>e[t[s+1].getCategory()]){const e=t[s];t[s]=t[s+1],t[s+1]=e}}format(){const t=this.modifiers[0],e=this.modifiers[1],i=this.getModifiers(dt.Position.BEGIN),s=this.getModifiers(dt.Position.END);let n,r,o;this.sortByCategory(i,{barlines:0,clefs:1,keysignatures:2,timesignatures:3}),this.sortByCategory(s,{timesignatures:0,keysignatures:1,barlines:2,clefs:3}),i.length>1&&t.getType()===ft.type.REPEAT_BEGIN&&(i.push(i.splice(0,1)[0]),i.splice(0,0,new ft(ft.type.SINGLE))),s.indexOf(e)>0&&s.splice(0,0,new ft(ft.type.NONE));let a=0,l=this.x;for(let t=0;t<i.length;t++)o=i[t],r=o.getPadding(t+a),n=o.getWidth(),isNaN(n)&&(o.setWidth(10),n=10),l+=r,o.setX(l),l+=n,r+n===0&&a--;this.setStartX(l),l=this.x+this.width;const h={left:0,right:0,paddingRight:0,paddingLeft:0};let c=0;for(let t=0;t<s.length;t++){o=s[t],c="barlines"===o.getCategory()?t:c,h.right=0,h.left=0,h.paddingRight=0,h.paddingLeft=0;const e=o.getLayoutMetrics();e?(0!==t&&(h.right=e.xMax||0,h.paddingRight=e.paddingRight||0),h.left=-e.xMin||0,h.paddingLeft=e.paddingLeft||0,t===s.length-1&&(h.paddingLeft=0)):(h.paddingRight=o.getPadding(t-c)||0,0!==t&&(h.right=o.getWidth()||0),0===t&&(h.left=o.getWidth()||0)),l-=h.paddingRight,l-=h.right,o.setX(l),l-=h.left,l-=h.paddingLeft}this.end_x=1===s.length?this.x+this.width:l,this.formatted=!0}draw(){this.checkContext(),this.setRendered(),this.formatted||this.format();const t=this.options.num_lines,e=this.width,i=this.x;let s;for(let n=0;n<t;n++)s=this.getYForLine(n),this.applyStyle(),this.options.line_config[n].visible&&(this.context.beginPath(),this.context.moveTo(i,s),this.context.lineTo(i+e,s),this.context.stroke()),this.restoreStyle();for(let t=0;t<this.modifiers.length;t++)"function"==typeof this.modifiers[t].draw&&(this.modifiers[t].applyStyle(this.context),this.modifiers[t].draw(this,this.getModifierXShift(t)),this.modifiers[t].restoreStyle(this.context));if(this.measure>0){this.context.save(),this.context.setFont(this.font.family,this.font.size,this.font.weight);const t=this.context.measureText(""+this.measure).width;s=this.getYForTopText(0)+3,this.context.fillText(""+this.measure,this.x-t/2,s),this.context.restore()}return this}drawVertical(t,e){this.drawVerticalFixed(this.x+t,e)}drawVerticalFixed(t,e){this.checkContext();const i=this.getYForLine(0),s=this.getYForLine(this.options.num_lines-1);e&&this.context.fillRect(t-3,i,1,s-i+1),this.context.fillRect(t,i,1,s-i+1)}drawVerticalBar(t){this.drawVerticalBarFixed(this.x+t,!1)}drawVerticalBarFixed(t){this.checkContext();const e=this.getYForLine(0),i=this.getYForLine(this.options.num_lines-1);this.context.fillRect(t,e,1,i-e+1)}getConfigForLines(){return this.options.line_config}setConfigForLine(t,e){if(t>=this.options.num_lines||t<0)throw new s.RERR("StaveConfigError","The line number must be within the range of the number of lines in the Stave.");if(void 0===e.visible)throw new s.RERR("StaveConfigError","The line configuration object is missing the 'visible' property.");if("boolean"!=typeof e.visible)throw new s.RERR("StaveConfigError","The line configuration objects 'visible' property must be true or false.");return this.options.line_config[t]=e,this}setConfigForLines(t){if(t.length!==this.options.num_lines)throw new s.RERR("StaveConfigError","The length of the lines configuration array must match the number of lines in the Stave");for(const e in t)t[e]||(t[e]=this.options.line_config[e]),s.Merge(this.options.line_config[e],t[e]);return this.options.line_config=t,this}}class Mt extends _t{constructor(t,e,i,n){const r={spacing_between_lines_px:13,num_lines:6,top_text_position:1};s.Merge(r,n),super(t,e,i,r),this.setAttribute("type","TabStave")}getYForGlyphs(){return this.getYForLine(2.5)}addTabGlyph(){return this.addClef("tab"),this}}class wt extends N{static get CATEGORY(){return"tabnotes"}constructor(t,e){if(super(t),this.setAttribute("type","TabNote"),this.ghost=!1,this.positions=t.positions,s.Merge(this.render_options,{glyph_font_scale:m.DEFAULT_TABLATURE_FONT_SCALE,draw_stem:e,draw_dots:e,draw_stem_through_stave:!1,y_shift:0,scale:1,font:"10pt Arial"}),this.glyph=m.getGlyphProps(this.duration,this.noteType),!this.glyph)throw new s.RuntimeError("BadArguments",`Invalid note initialization data (No glyph found): ${JSON.stringify(t)}`);this.buildStem(),t.stem_direction?this.setStemDirection(t.stem_direction):this.setStemDirection(v.UP),this.ghost=!1,this.updateWidth()}reset(){this.stave&&this.setStave(this.stave)}getCategory(){return wt.CATEGORY}setGhost(t){return this.ghost=t,this.updateWidth(),this}hasStem(){return this.render_options.draw_stem}getStemExtension(){const t=this.getGlyph();return null!=this.stem_extension_override?this.stem_extension_override:t?1===this.getStemDirection()?t.tabnote_stem_up_extension:t.tabnote_stem_down_extension:0}addDot(){const t=new F;return this.dots+=1,this.addModifier(t,0)}updateWidth(){this.glyphs=[],this.width=0;for(let t=0;t<this.positions.length;++t){let e=this.positions[t].fret;this.ghost&&(e="("+e+")");const i=m.tabToGlyph(e,this.render_options.scale);this.glyphs.push(i),this.width=Math.max(i.getWidth(),this.width)}this.glyph.getWidth=()=>this.width}setStave(t){let e;if(super.setStave(t),this.context=t.context,this.context){const t=this.context;for(this.width=0,e=0;e<this.glyphs.length;++e){const i=this.glyphs[e],s=""+i.text;"X"!==s.toUpperCase()&&(t.save(),t.setRawFont(this.render_options.font),i.width=t.measureText(s).width,t.restore(),i.getWidth=()=>i.width),this.width=Math.max(i.getWidth(),this.width)}this.glyph.getWidth=()=>this.width}const i=this.positions.map((({str:e})=>t.getYForLine(e-1)));return this.setYs(i),this.stem&&this.stem.setYBounds(this.getStemY(),this.getStemY()),this}getPositions(){return this.positions}addToModifierContext(t){this.setModifierContext(t);for(let t=0;t<this.modifiers.length;++t)this.modifierContext.addModifier(this.modifiers[t]);return this.modifierContext.addModifier(this),this.preFormatted=!1,this}getTieRightX(){let t=this.getAbsoluteX();return t+=this.glyph.getWidth()/2,t+=-this.width/2+this.width+2,t}getTieLeftX(){let t=this.getAbsoluteX();return t+=this.glyph.getWidth()/2,t-=this.width/2+2,t}getModifierStartXY(t,e){if(!this.preFormatted)throw new s.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");if(0===this.ys.length)throw new s.RERR("NoYValues","No Y-Values calculated for this note.");let i=0;return t===B.Position.LEFT?i=-2:t===B.Position.RIGHT?i=this.width+2:t!==B.Position.BELOW&&t!==B.Position.ABOVE||(i=this.glyph.getWidth()/2),{x:this.getAbsoluteX()+i,y:this.ys[e]}}getLineForRest(){return this.positions[0].str}preFormat(){this.preFormatted||(this.modifierContext&&this.modifierContext.preFormat(),this.setPreFormatted(!0))}getStemX(){return this.getCenterGlyphX()}getStemY(){const t=this.stave.getNumLines()-.5,e=v.UP===this.stem_direction?-.5:t;return this.stave.getYForLine(e)}getStemExtents(){return this.stem.getExtents()}drawFlag(){const{beam:t,glyph:e,context:i,stem:s,stem_direction:n,render_options:{draw_stem:r,glyph_font_scale:o}}=this,a=null==t&&r;if(e.flag&&a){const t=this.getStemX()+1,r=this.getStemY()-s.getHeight(),a=n===v.DOWN?e.code_flag_downstem:e.code_flag_upstem;f.renderGlyph(i,t,r,o,a)}}drawModifiers(){this.modifiers.forEach((t=>{("dots"!==t.getCategory()||this.render_options.draw_dots)&&(t.setContext(this.context),t.drawWithStyle())}))}drawStemThrough(){const t=this.getStemX(),e=this.getStemY(),i=this.context,s=this.render_options.draw_stem_through_stave;if(this.render_options.draw_stem&&s){const s=function(t,e){const i=[];let s=[];for(let n=1;n<=t;n++)e.indexOf(n)>-1?(i.push(s),s=[]):s.push(n);return s.length>0&&i.push(s),i}(this.stave.getNumLines(),this.positions.map((t=>t.str))),n=function(t,e,i,s){const n=1!==s,r=-1!==s,o=i.getSpacingBetweenLines(),a=i.getNumLines(),l=[];return e.forEach((e=>{const h=e.indexOf(a)>-1,c=e.indexOf(1)>-1;if(n&&c||r&&h)return;1===e.length&&e.push(e[0]);const u=[];e.forEach(((e,n,r)=>{const l=1===e,h=e===a;let c=i.getYForLine(e-1);0!==n||l?n!==r.length-1||h||(c+=o/2-1):c-=o/2-1,u.push(c),1===s&&l?u.push(t-2):-1===s&&h&&u.push(t+2)})),l.push(u.sort(((t,e)=>t-e)))})),l}(e,s,this.getStave(),this.getStemDirection());i.save(),i.setLineWidth(v.WIDTH),n.forEach((e=>{0!==e.length&&(i.beginPath(),i.moveTo(t,e[0]),i.lineTo(t,e[e.length-1]),i.stroke(),i.closePath())})),i.restore()}}drawPositions(){const t=this.context,e=this.getAbsoluteX(),i=this.ys;for(let s=0;s<this.positions.length;++s){const n=i[s]+this.render_options.y_shift,r=this.glyphs[s];let o=r.getWidth();0===o&&r.text&&r.text.toString()&&r.text.toString().length&&(o=7*r.text.toString().length);let a=this.glyph.getWidth();0===a&&(a=o);const l=e+a/2-o/2;if(t.clearRect(l-2,n-3,o+4,6),r.code)f.renderGlyph(t,l,n,this.render_options.glyph_font_scale*this.render_options.scale,r.code);else{t.save(),t.setRawFont(this.render_options.font);const e=r.text.toString();t.fillText(e,l,n+5*this.render_options.scale),t.restore()}}}draw(){if(this.checkContext(),!this.stave)throw new s.RERR("NoStave","Can't draw without a stave.");if(0===this.ys.length)throw new s.RERR("NoYValues","Can't draw note without Y values.");this.setRendered();const t=null==this.beam&&this.render_options.draw_stem;this.context.openGroup("tabnote",this.getAttribute("id"),{pointerBBox:!0}),this.drawPositions(),this.drawStemThrough();const e=this.getStemX();this.stem.setNoteHeadXBounds(e,e),t&&(this.context.openGroup("stem",null,{pointerBBox:!0}),this.stem.setContext(this.context).draw(),this.context.closeGroup()),this.drawFlag(),this.drawModifiers(),this.context.closeGroup()}}class Pt extends l{constructor(t){super(),this.setAttribute("type","VibratoBracket"),this.start=t.start,this.stop=t.stop,this.line=1,this.render_options={harsh:!1,wave_height:6,wave_width:4,wave_girth:2}}setLine(t){return this.line=t,this}setHarsh(t){return this.render_options.harsh=t,this}draw(){const t=this.context;this.setRendered();const e=this.start?this.start.getStave().getYForTopText(this.line):this.stop.getStave().getYForTopText(this.line),i=this.start?this.start.getAbsoluteX():this.stop.getStave().getTieStartX(),n=this.stop?this.stop.getAbsoluteX()-this.stop.getWidth()-5:this.start.getStave().getTieEndX()-10;this.render_options.vibrato_width=n-i,function(...t){Pt.DEBUG&&s.L("Vex.Flow.VibratoBracket",t)}("Rendering VibratoBracket: start_x:",i,"stop_x:",n,"y:",e),ot.renderVibrato(t,i,e,this.render_options)}}let Tt;function Lt(){if(!Tt){const t=new R({duration:"w",note_type:"r"});Tt={glyph_font_scale:t.render_options.glyph_font_scale,glyph_code:t.glyph_code,width:t.getWidth()}}return Tt}class At extends l{constructor(t,e){super(),this.setAttribute("type","MultiMeasureRest"),this.render_options={show_number:!0,number_line:-.5,number_glyph_point:40,padding_left:void 0,padding_right:void 0,line:2,spacing_between_lines_px:10,line_thickness:void 0,serif_thickness:2,use_symbols:!1,symbol_spacing:void 0,semibrave_rest_glyph_scale:m.DEFAULT_NOTATION_FONT_SCALE},s.Merge(this.render_options,e),this.number_of_measures=t,this.xs={left:NaN,right:NaN}}getXs(){return this.xs}setStave(t){return this.stave=t,this}getStave(){return this.stave}drawLine(t,e,i,s){const n=this.stave.getYForLine(this.render_options.line),r=.1*(i-e);e+=r,i-=r;const o=this.render_options.serif_thickness;let a=.25*s;isNaN(this.render_options.line_thickness)||(a=.5*this.render_options.line_thickness),t.save(),t.beginPath(),t.moveTo(e,n-s),t.lineTo(e+o,n-s),t.lineTo(e+o,n-a),t.lineTo(i-o,n-a),t.lineTo(i-o,n-s),t.lineTo(i,n-s),t.lineTo(i,n+s),t.lineTo(i-o,n+s),t.lineTo(i-o,n+a),t.lineTo(e+o,n+a),t.lineTo(e+o,n+s),t.lineTo(e,n+s),t.closePath(),t.fill()}drawSymbols(t,e,i,s){const n=Math.floor(this.number_of_measures/4),r=this.number_of_measures%4,o=Math.floor(r/2),a=r%2,l=Lt(),h=l.width*(this.render_options.semibrave_rest_glyph_scale/l.glyph_font_scale),c={2:{width:.5*h,height:s},1:{width:h}};let u=1.35*h;isNaN(this.render_options.symbol_spacing)||(u=this.render_options.symbol_spacing);let d=e+.5*(i-e)-.5*(n*c[2].width+o*c[2].width+a*c[1].width+(n+o+a-1)*u);const m=this.stave.getYForLine(this.render_options.line-1),p=this.stave.getYForLine(this.render_options.line),b=this.stave.getYForLine(this.render_options.line+1);t.save(),t.setStrokeStyle("none"),t.setLineWidth(0);for(let e=0;e<n;++e)t.fillRect(d,p-c[2].height,c[2].width,c[2].height),t.fillRect(d,b-c[2].height,c[2].width,c[2].height),d+=c[2].width+u;for(let e=0;e<o;++e)t.fillRect(d,p-c[2].height,c[2].width,c[2].height),d+=c[2].width+u;for(let e=0;e<a;++e)f.renderGlyph(t,d,m,this.render_options.semibrave_rest_glyph_scale,l.glyph_code),d+=c[1].width+u;t.restore()}draw(){this.checkContext(),this.setRendered();const t=this.context,e=this.stave,i=this.render_options.spacing_between_lines_px;let s=e.getNoteStartX(),n=e.getNoteEndX();const r=e.getModifiers(dt.Position.BEGIN);if(1===r.length&&"barlines"===r[0].getCategory()&&(s-=r[0].getWidth()),isNaN(this.render_options.padding_left)||(s=e.getX()+this.render_options.padding_left),isNaN(this.render_options.padding_right)||(n=e.getX()+e.getWidth()-this.render_options.padding_right),this.xs.left=s,this.xs.right=n,this.render_options.use_symbols?this.drawSymbols(t,s,n,i):this.drawLine(t,s,n,i),this.render_options.show_number){const i="/"+this.number_of_measures,r=new vt(null,void 0,!1);r.point=this.render_options.number_glyph_point,r.setTimeSig(i),r.setStave(e),r.x=s+.5*(n-s)-.5*r.timeSig.glyph.getMetrics().width,r.bottomLine=this.render_options.number_line,r.setContext(t).draw()}}}class Ct extends I{static get CATEGORY(){return"clefnote"}constructor(t,e,i){super({duration:"b"}),this.setAttribute("type","ClefNote"),this.setType(t,e,i),this.ignore_ticks=!0}setType(t,e,i){return this.type=t,this.clef_obj=new yt(t,e,i),this.clef=this.clef_obj.clef,this.glyph=new f(this.clef.code,this.clef.point),this.setWidth(this.glyph.getMetrics().width),this}getClef(){return this.clef}setContext(t){return this.context=t,this.glyph.setContext(this.context),this}getBoundingBox(){return super.getBoundingBox()}addToModifierContext(){return this}getCategory(){return Ct.CATEGORY}preFormat(){return this.setPreFormatted(!0),this}draw(){if(!this.stave)throw new s.RERR("NoStave","Can't draw without a stave.");this.glyph.getContext()||this.glyph.setContext(this.context),this.setRendered();const t=this.getAbsoluteX();if(this.glyph.setStave(this.stave),this.glyph.setYShift(this.stave.getYForLine(this.clef.line)-this.stave.getYForGlyphs()),this.glyph.renderToStave(t),void 0!==this.clef_obj.annotation){const e=new f(this.clef_obj.annotation.code,this.clef_obj.annotation.point);e.getContext()||e.setContext(this.context),e.setStave(this.stave),e.setYShift(this.stave.getYForLine(this.clef_obj.annotation.line)-this.stave.getYForGlyphs()),e.setXShift(this.clef_obj.annotation.x_shift),e.renderToStave(t)}}}class It extends I{constructor(t,e,i){super({duration:"b"}),this.setAttribute("type","KeySigNote"),this.keySignature=new Et(t,e,i),this.ignore_ticks=!0}getBoundingBox(){return super.getBoundingBox()}addToModifierContext(){return this}preFormat(){return this.setPreFormatted(!0),this.keySignature.setStave(this.stave),this.keySignature.format(),this.setWidth(this.keySignature.width),this}draw(){this.stave.checkContext(),this.setRendered(),this.keySignature.x=this.getAbsoluteX(),this.keySignature.setContext(this.context),this.keySignature.draw()}}class Rt extends I{constructor(t,e){super({duration:"b"}),this.setAttribute("type","TimeSigNote");const i=new vt(t,e);this.timeSig=i.getTimeSig(),this.setWidth(this.timeSig.glyph.getMetrics().width),this.ignore_ticks=!0}getBoundingBox(){return super.getBoundingBox()}addToModifierContext(){return this}preFormat(){return this.setPreFormatted(!0),this}draw(){this.stave.checkContext(),this.setRendered(),this.timeSig.glyph.getContext()||this.timeSig.glyph.setContext(this.context),this.timeSig.glyph.setStave(this.stave),this.timeSig.glyph.setYShift(this.stave.getYForLine(this.timeSig.line)-this.stave.getYForGlyphs()),this.timeSig.glyph.renderToStave(this.getAbsoluteX())}}class Nt extends X{static get SLIDE_UP(){return 1}static get SLIDE_DOWN(){return-1}static createSlideUp(t){return new Nt(t,Nt.SLIDE_UP)}static createSlideDown(t){return new Nt(t,Nt.SLIDE_DOWN)}constructor(t,e){if(super(t,"sl."),this.setAttribute("type","TabSlide"),!e){const i=t.first_note.getPositions()[0].fret,s=t.last_note.getPositions()[0].fret;e=parseInt(i,10)>parseInt(s,10)?Nt.SLIDE_DOWN:Nt.SLIDE_UP}this.slide_direction=e,this.render_options.cp1=11,this.render_options.cp2=14,this.render_options.y_shift=.5,this.setFont({font:"Times",size:10,style:"bold italic"}),this.setNotes(t)}renderTie(t){if(0===t.first_ys.length||0===t.last_ys.length)throw new s.RERR("BadArguments","No Y-values to render");const e=this.context,i=t.first_x_px,n=t.first_ys,r=t.last_x_px,o=this.slide_direction;if(o!==Nt.SLIDE_UP&&o!==Nt.SLIDE_DOWN)throw new s.RERR("BadSlide","Invalid slide direction");for(let t=0;t<this.first_indices.length;++t){const a=n[this.first_indices[t]]+this.render_options.y_shift;if(isNaN(a))throw new s.RERR("BadArguments","Bad indices for slide rendering.");e.beginPath(),e.moveTo(i,a+3*o),e.lineTo(r,a-3*o),e.closePath(),e.stroke()}this.setRendered()}}class Bt extends O{static get CATEGORY(){return"gracenotes"}static get LEDGER_LINE_OFFSET(){return 2}static get SCALE(){return.66}constructor(t){super(Object.assign(t,{glyph_font_scale:m.DEFAULT_NOTATION_FONT_SCALE*Bt.SCALE,stroke_px:Bt.LEDGER_LINE_OFFSET})),this.setAttribute("type","GraceNote"),this.slash=t.slash,this.slur=!0,this.buildNoteHeads(),this.width=3}getStemExtension(){if(null!=this.stem_extension_override)return this.stem_extension_override;const t=this.getGlyph();if(t){let e=super.getStemExtension();if(t.stem){const t=this.getStaveNoteScale();e=(v.HEIGHT+e)*t-v.HEIGHT}return e}return 0}getCategory(){return Bt.CATEGORY}getStaveNoteScale(){return this.render_options.glyph_font_scale/m.DEFAULT_NOTATION_FONT_SCALE}draw(){super.draw(),this.setRendered();const t=this.stem;if(this.slash&&t){const e=this.getStaveNoteScale(),i=e/.66;let s;const n=this.beam;if(n)n.postFormatted||n.postFormat(),s=this.calcBeamedNotesSlashBBox(8*i,8*i,{stem:6*i,beam:5*i});else{const n=this.getStemDirection(),r=this.getNoteHeadBounds(),o=t.getHeight();let a=this.getAbsoluteX(),l=n===m.Stem.DOWN?r.y_top-o:r.y_bottom-o;const h=n===m.Stem.DOWN?this.glyph.stem_down_extension:this.glyph.stem_up_extension;let c=m.STEM_HEIGHT;c-=c/2.8,c+=h,l+=c*e*n;const u=n===m.Stem.UP?{x1:1,y1:0,x2:13,y2:-9}:{x1:-4,y1:1,x2:13,y2:9};a+=u.x1*i,l+=u.y1*i,s={x1:a,y1:l,x2:a+u.x2*i,y2:l+u.y2*i}}const r=this.context;r.save(),r.setLineWidth(1*i),r.beginPath(),r.moveTo(s.x1,s.y1),r.lineTo(s.x2,s.y2),r.closePath(),r.stroke(),r.restore()}}calcBeamedNotesSlashBBox(t,e,i){const s=this.beam,n=s.slope,r=s.notes[s.notes.length-1]===this?-1:1,o=Math.atan(n*r),a=Math.cos(o)*e,l=Math.sin(o)*e;t*=this.getStemDirection();const h=Math.atan((l-t)/a),c=Math.cos(h)*i.stem*r,u=Math.sin(h)*i.stem,d=Math.cos(h)*i.beam*r,f=Math.sin(h)*i.beam,m=this.getStemX(),p=s.notes[0].getStemX(),b=this.beam.getBeamYToDraw()+(m-p)*n;return{x1:m-c,y1:b+t-u,x2:m+a*r+d,y2:b+l+f}}}class Ft extends wt{static get CATEGORY(){return"gracetabnotes"}constructor(t){super(t,!1),this.setAttribute("type","GraceTabNote"),s.Merge(this.render_options,{y_shift:.3,scale:.6,font:"7.5pt Arial"}),this.updateWidth()}getCategory(){return Ft.CATEGORY}draw(){super.draw(),this.setRendered()}}class Dt{static get names(){return{standard:"E/5,B/4,G/4,D/4,A/3,E/3",dagdad:"D/5,A/4,G/4,D/4,A/3,D/3",dropd:"E/5,B/4,G/4,D/4,A/3,D/3",eb:"Eb/5,Bb/4,Gb/4,Db/4,Ab/3,Db/3",standardBanjo:"D/5,B/4,G/4,D/4,G/5"}}constructor(t="E/5,B/4,G/4,D/4,A/3,E/3,B/2,E/2"){this.setTuning(t)}noteToInteger(t){return m.keyProperties(t).int_value}setTuning(t){Dt.names[t]&&(t=Dt.names[t]),this.tuningString=t,this.tuningValues=[],this.numStrings=0;const e=t.split(/\s*,\s*/);if(0===e.length)throw new s.RERR("BadArguments","Invalid tuning string: "+t);this.numStrings=e.length;for(let t=0;t<this.numStrings;++t)this.tuningValues[t]=this.noteToInteger(e[t])}getValueForString(t){const e=parseInt(t,10);if(e<1||e>this.numStrings)throw new s.RERR("BadArguments",`String number must be between 1 and ${this.numStrings}:${t}`);return this.tuningValues[e-1]}getValueForFret(t,e){const i=this.getValueForString(e),n=parseInt(t,10);if(n<0)throw new s.RERR("BadArguments","Fret number must be 0 or higher: "+t);return i+n}getNoteForFret(t,e){const i=this.getValueForFret(t,e),s=Math.floor(i/12),n=i%12;return m.integerToNote(n)+"/"+s}}class Ot extends l{static get type(){return{CRESC:1,DECRESC:2}}static FormatByTicksAndDraw(t,e,i,n,r,o){const a=e.pixelsPerTick;if(null==a)throw new s.RuntimeError("BadArguments","A valid Formatter must be provide to draw offsets by ticks.");const l=a*o.left_shift_ticks,h=a*o.right_shift_ticks,c={height:o.height,y_shift:o.y_shift,left_shift_px:l,right_shift_px:h};new Ot({first_note:i.first_note,last_note:i.last_note},n).setContext(t).setRenderOptions(c).setPosition(r).draw()}constructor(t,e){super(),this.setAttribute("type","StaveHairpin"),this.notes=t,this.hairpin=e,this.position=B.Position.BELOW,this.render_options={height:10,y_shift:0,left_shift_px:0,right_shift_px:0},this.setNotes(t)}setPosition(t){return t!==B.Position.ABOVE&&t!==B.Position.BELOW||(this.position=t),this}setRenderOptions(t){return null!=t.height&&null!=t.y_shift&&null!=t.left_shift_px&&null!=t.right_shift_px&&(this.render_options=t),this}setNotes(t){if(!t.first_note&&!t.last_note)throw new s.RuntimeError("BadArguments","Hairpin needs to have either first_note or last_note set.");return this.first_note=t.first_note,this.last_note=t.last_note,this}renderHairpin(t){const e=this.checkContext();let i=this.render_options.y_shift+20,s=t.first_y;this.position===B.Position.ABOVE&&(i=30-i,s=t.first_y-t.staff_height);const n=this.render_options.left_shift_px,r=this.render_options.right_shift_px;switch(e.beginPath(),this.hairpin){case Ot.type.CRESC:e.moveTo(t.last_x+r,s+i),e.lineTo(t.first_x+n,s+this.render_options.height/2+i),e.lineTo(t.last_x+r,s+this.render_options.height+i);break;case Ot.type.DECRESC:e.moveTo(t.first_x+n,s+i),e.lineTo(t.last_x+r,s+this.render_options.height/2+i),e.lineTo(t.first_x+n,s+this.render_options.height+i)}e.stroke(),e.closePath()}draw(){this.checkContext(),this.setRendered();const t=this.first_note,e=this.last_note,i=t.getModifierStartXY(this.position,0),s=e.getModifierStartXY(this.position,0);return this.renderHairpin({first_x:i.x,last_x:s.x,first_y:t.getStave().y+t.getStave().height,last_y:e.getStave().y+e.getStave().height,staff_height:t.getStave().height}),!0}}class kt extends l{static get Position(){return{NEAR_HEAD:1,NEAR_TOP:2}}static get PositionString(){return{nearHead:kt.Position.NEAR_HEAD,nearTop:kt.Position.NEAR_TOP}}constructor(t,e,i){super(),this.setAttribute("type","Curve"),this.render_options={spacing:2,thickness:2,x_shift:0,y_shift:10,position:kt.Position.NEAR_HEAD,position_end:kt.Position.NEAR_HEAD,invert:!1,cps:[{x:0,y:10},{x:0,y:10}]},s.Merge(this.render_options,i),this.setNotes(t,e)}setNotes(t,e){if(!t&&!e)throw new s.RuntimeError("BadArguments","Curve needs to have either first_note or last_note set.");return this.from=t,this.to=e,this}isPartial(){return!this.from||!this.to}renderCurve(t){const e=this.context,i=this.render_options.cps,s=this.render_options.x_shift,n=this.render_options.y_shift*t.direction,r=t.first_x+s,o=t.first_y+n,a=t.last_x-s,l=t.last_y+n,h=this.render_options.thickness,c=(a-r)/(i.length+2);e.beginPath(),e.moveTo(r,o),e.bezierCurveTo(r+c+i[0].x,o+i[0].y*t.direction,a-c+i[1].x,l+i[1].y*t.direction,a,l),e.bezierCurveTo(a-c+i[1].x,l+(i[1].y+h)*t.direction,r+c+i[0].x,o+(i[0].y+h)*t.direction,r,o),e.stroke(),e.closePath(),e.fill()}draw(){this.checkContext(),this.setRendered();const t=this.from,e=this.to;let i,s,n,r,o,a="baseY",l="baseY";function h(t){return"string"==typeof t?kt.PositionString[t]:t}const c=h(this.render_options.position),u=h(this.render_options.position_end);return c===kt.Position.NEAR_TOP&&(a="topY",l="topY"),u===kt.Position.NEAR_HEAD?l="baseY":u===kt.Position.NEAR_TOP&&(l="topY"),t?(i=t.getTieRightX(),o=t.getStemDirection(),n=t.getStemExtents()[a]):(i=e.getStave().getTieStartX(),n=e.getStemExtents()[a]),e?(s=e.getTieLeftX(),o=e.getStemDirection(),r=e.getStemExtents()[l]):(s=t.getStave().getTieEndX(),r=t.getStemExtents()[l]),this.renderCurve({first_x:i,last_x:s,first_y:n,last_y:r,direction:o*(!0===this.render_options.invert?-1:1)}),!0}}function Vt(...t){Gt.DEBUG&&s.L("Vex.Flow.TextDynamics",t)}class Gt extends I{static get GLYPHS(){return{f:{code:"vba",width:12},p:{code:"vbf",width:14},m:{code:"v62",width:17},s:{code:"v4a",width:10},z:{code:"v80",width:12},r:{code:"vb1",width:12}}}constructor(t){super(t),this.setAttribute("type","TextDynamics"),this.sequence=t.text.toLowerCase(),this.line=t.line||0,this.glyphs=[],s.Merge(this.render_options,{glyph_font_size:40}),Vt("New Dynamics Text: ",this.sequence)}setLine(t){return this.line=t,this}preFormat(){let t=0;return this.sequence.split("").forEach((e=>{const i=Gt.GLYPHS[e];if(!i)throw new s.RERR("Invalid dynamics character: "+e);const n=this.render_options.glyph_font_size,r=new f(i.code,n);this.glyphs.push(r),t+=i.width})),this.setWidth(t),this.preFormatted=!0,this}draw(){this.setRendered();const t=this.getAbsoluteX(),e=this.stave.getYForLine(this.line+-3);Vt("Rendering Dynamics: ",this.sequence);let i=t;this.glyphs.forEach(((t,s)=>{const n=this.sequence[s];t.render(this.context,i,e),i+=Gt.GLYPHS[n].width}))}}function Wt(t,e,i,s,n,r,o){t.beginPath(),t.moveTo(e,i),t.lineTo(s,n),t.lineTo(r,o),t.lineTo(e,i),t.closePath(),t.fill()}class Ut extends l{static get TextVerticalPosition(){return{TOP:1,BOTTOM:2}}static get TextJustification(){return{LEFT:1,CENTER:2,RIGHT:3}}constructor(t){super(),this.setAttribute("type","StaveLine"),this.notes=t,this.text="",this.font={family:"Arial",size:10,weight:""},this.render_options={padding_left:4,padding_right:3,line_width:1,line_dash:null,rounded_end:!0,color:null,draw_start_arrow:!1,draw_end_arrow:!1,arrowhead_length:10,arrowhead_angle:Math.PI/8,text_position_vertical:Ut.TextVerticalPosition.TOP,text_justification:Ut.TextJustification.CENTER},this.setNotes(t)}setFont(t){return this.font=t,this}setText(t){return this.text=t,this}setNotes(t){if(!t.first_note&&!t.last_note)throw new s.RuntimeError("BadArguments","Notes needs to have either first_note or last_note set.");if(t.first_indices||(t.first_indices=[0]),t.last_indices||(t.last_indices=[0]),t.first_indices.length!==t.last_indices.length)throw new s.RuntimeError("BadArguments","Connected notes must have similar index sizes");return this.first_note=t.first_note,this.first_indices=t.first_indices,this.last_note=t.last_note,this.last_indices=t.last_indices,this}applyLineStyle(){const t=this.checkContext(),e=this.render_options;e.line_dash&&t.setLineDash(e.line_dash),e.line_width&&t.setLineWidth(e.line_width),e.rounded_end?t.setLineCap("round"):t.setLineCap("square")}applyFontStyle(){const t=this.checkContext();this.font&&t.setFont(this.font.family,this.font.size,this.font.weight),this.render_options.color&&(t.setStrokeStyle(this.render_options.color),t.setFillStyle(this.render_options.color))}draw(){const t=this.checkContext();this.setRendered();const e=this.first_note,i=this.last_note,s=this.render_options;let n,r;t.save(),this.applyLineStyle(),this.first_indices.forEach(((o,a)=>{const l=this.last_indices[a];n=e.getModifierStartXY(2,o),r=i.getModifierStartXY(1,l);const h=n.y>r.y;n.x+=e.getMetrics().modRightPx+s.padding_left,r.x-=i.getMetrics().modLeftPx+s.padding_right;const c=e.getGlyph().getWidth();e.getKeyProps()[o].displaced&&1===e.getStemDirection()&&(n.x+=c+s.padding_left),i.getKeyProps()[l].displaced&&-1===i.getStemDirection()&&(r.x-=c+s.padding_right),n.y+=h?-3:1,r.y+=h?2:0,function(t,e,i,s){const n=s.draw_start_arrow&&s.draw_end_arrow,r=e.x,o=e.y,a=i.x,l=i.y,h=Math.sqrt((a-r)*(a-r)+(l-o)*(l-o)),c=(h-s.arrowhead_length/3)/h;let u,d,f,m;s.draw_end_arrow||n?(u=Math.round(r+(a-r)*c),d=Math.round(o+(l-o)*c)):(u=a,d=l),s.draw_start_arrow||n?(f=r+(a-r)*(1-c),m=o+(l-o)*(1-c)):(f=r,m=o),s.color&&(t.setStrokeStyle(s.color),t.setFillStyle(s.color)),t.beginPath(),t.moveTo(f,m),t.lineTo(u,d),t.stroke(),t.closePath();const p=Math.atan2(l-o,a-r),b=Math.abs(s.arrowhead_length/Math.cos(s.arrowhead_angle));let g,S,y,E,v,x;(s.draw_end_arrow||n)&&(g=p+Math.PI+s.arrowhead_angle,y=a+Math.cos(g)*b,E=l+Math.sin(g)*b,S=p+Math.PI-s.arrowhead_angle,v=a+Math.cos(S)*b,x=l+Math.sin(S)*b,Wt(t,y,E,a,l,v,x)),(s.draw_start_arrow||n)&&(g=p+s.arrowhead_angle,y=r+Math.cos(g)*b,E=o+Math.sin(g)*b,S=p-s.arrowhead_angle,v=r+Math.cos(S)*b,x=o+Math.sin(S)*b,Wt(t,y,E,r,o,v,x))}(t,n,r,this.render_options)})),t.restore();const o=t.measureText(this.text).width,a=s.text_justification;let l,h=0;a===Ut.TextJustification.LEFT?h=n.x:a===Ut.TextJustification.CENTER?h=(r.x-n.x)/2+n.x-o/2:a===Ut.TextJustification.RIGHT&&(h=r.x-o);const c=s.text_position_vertical;return c===Ut.TextVerticalPosition.TOP?l=e.getStave().getYForTopText():c===Ut.TextVerticalPosition.BOTTOM&&(l=e.getStave().getYForBottomText(m.TEXT_HEIGHT_OFFSET_HACK)),t.save(),this.applyFontStyle(),t.fillText(this.text,h,l),t.restore(),this}}function zt(t,e,i,s,n){const r=Ht.GLYPHS[t];new f(r.code,n).render(e,i+r.x_shift,s+r.y_shift)}class Ht extends l{static get GLYPHS(){return{pedal_depress:{code:"v36",x_shift:-10,y_shift:0},pedal_release:{code:"v5d",x_shift:-2,y_shift:3}}}static get Styles(){return{TEXT:1,BRACKET:2,MIXED:3,MIXED_OPEN_END:4,BRACKET_OPEN_BEGIN:5,BRACKET_OPEN_END:6,BRACKET_OPEN_BOTH:7}}static get StylesString(){return{text:Ht.Styles.TEXT,bracket:Ht.Styles.BRACKET,mixed:Ht.Styles.MIXED,mixed_open_end:Ht.Styles.MIXED_OPEN_END,bracket_open_begin:Ht.Styles.BRACKET_OPEN_BEGIN,bracket_open_end:Ht.Styles.BRACKET_OPEN_END,bracket_open_both:Ht.Styles.BRACKET_OPEN_BOTH}}static createSustain(t){return new Ht(t)}static createSostenuto(t){const e=new Ht(t);return e.setStyle(Ht.Styles.MIXED),e.setCustomText("Sost. Ped."),e}static createUnaCorda(t){const e=new Ht(t);return e.setStyle(Ht.Styles.TEXT),e.setCustomText("una corda","tre corda"),e}constructor(t){super(),this.setAttribute("type","PedalMarking"),this.EndsStave=!1,this.ChangeBegin=!1,this.ChangeEnd=!1,this.notes=t,this.style=Ht.TEXT,this.line=0,this.custom_depress_text="",this.custom_release_text="",this.font={family:"Times New Roman",size:12,weight:"italic bold"},this.render_options={bracket_height:10,text_margin_right:6,bracket_line_width:1,glyph_point_size:40,color:"black"}}setEndStave(t){if(this.endStave=t,this.endStaveAddedWidth=0,this.startMargin=0,this.endMargin=0,Array.isArray(this.endStave.modifiers))for(let t=0;t<this.endStave.modifiers.length;t++){let e=this.endStave.modifiers[t];e&&e.position===dt.Position.END&&e.width&&(this.endStaveAddedWidth+=e.width)}}setCustomText(t,e){return this.custom_depress_text=t||"",this.custom_release_text=e||"",this}setStyle(t){if(t<1&&t>3)throw new s.RERR("InvalidParameter","The style must be one found in PedalMarking.Styles");return this.style=t,this}setLine(t){return this.line=t,this}drawBracketed(){const t=this.context;let e,i,s=!1;const n=this;this.notes.forEach(((r,o,a)=>{s=!s;let l=0;if(r?(l=r.getNoteHeadBeginX(),this.BeginsStave&&(l=r.getStave().getNoteStartX())):l=this.endStave.end_x+this.endStaveAddedWidth,this.EndsStave)s?this.ChangeBegin&&(l=r.getAbsoluteX()):(l=r?this.ChangeEnd?r.getAbsoluteX():r.getStave().end_x+this.endStaveAddedWidth-n.render_options.text_margin_right:this.endStave.end_x+this.endStaveAddedWidth-n.render_options.text_margin_right,this.endMargin=-n.render_options.text_margin_right);else if(r)if(s)this.ChangeBegin&&(l=r.getAbsoluteX());else switch(n.style){case Ht.Styles.BRACKET_OPEN_END:case Ht.Styles.BRACKET_OPEN_BOTH:case Ht.Styles.MIXED_OPEN_END:l=r.getNoteHeadEndX();break;default:this.ChangeEnd?l=r.getAbsoluteX():(l=r.getNoteHeadBeginX()-n.render_options.text_margin_right,this.startMargin=-n.render_options.text_margin_right)}let h=this.endStave;r&&(h=r.getStave());let c=h.getYForBottomText(n.line+3);i&&i>c&&(c=i);const u=a[o+1]===r,d=a[o-1]===r;let f=0;if(s)if(f=d?5:0,n.style!==Ht.Styles.MIXED&&n.style!==Ht.Styles.MIXED_OPEN_END||d)t.beginPath(),n.style===Ht.Styles.BRACKET_OPEN_BEGIN||n.style===Ht.Styles.BRACKET_OPEN_BOTH?t.moveTo(l+f,c):(this.ChangeBegin&&(l+=5),t.moveTo(l,c-n.render_options.bracket_height),this.ChangeBegin&&(l+=5),t.lineTo(l+f,c)),t.stroke(),t.closePath();else if(n.custom_depress_text){const e=t.measureText(n.custom_depress_text).width;t.fillText(n.custom_depress_text,l-e/2,c),f=e/2+n.render_options.text_margin_right}else zt("pedal_depress",t,l,c,n.render_options.glyph_point_size),f=20+n.render_options.text_margin_right;else f=u&&!this.EndsStave?-5:0,t.beginPath(),t.moveTo(e,i),t.lineTo(l+f,c),n.style!==Ht.Styles.BRACKET_OPEN_END&&n.style!==Ht.Styles.MIXED_OPEN_END&&n.style!==Ht.Styles.BRACKET_OPEN_BOTH&&(this.ChangeEnd&&(l+=5),t.lineTo(l,c-n.render_options.bracket_height)),t.stroke(),t.closePath();e=l+f,i=c}))}drawText(){const t=this.context;let e=!1;const i=this,s=i.render_options.glyph_point_size;this.notes.forEach((n=>{e=!e;const r=n.getStave(),o=n.getAbsoluteX(),a=r.getYForBottomText(i.line+3);let l=0;e?i.custom_depress_text?(l=t.measureText(i.custom_depress_text).width,t.fillText(i.custom_depress_text,o-l/2,a)):zt("pedal_depress",t,o,a,s):i.custom_release_text?(l=t.measureText(i.custom_release_text).width,t.fillText(i.custom_release_text,o-l/2,a)):zt("pedal_release",t,o,a,s)}))}draw(){const t=this.checkContext();this.setRendered(),t.save(),t.setStrokeStyle(this.render_options.color),t.setFillStyle(this.render_options.color),t.setFont(this.font.family,this.font.size,this.font.weight),Ht.DEBUG&&s.L("Vex.Flow.PedalMarking",["Rendering Pedal Marking"]),this.style===Ht.Styles.BRACKET||this.style===Ht.Styles.MIXED||this.style===Ht.Styles.MIXED_OPEN_END||this.style===Ht.Styles.BRACKET_OPEN_BEGIN||this.style===Ht.Styles.BRACKET_OPEN_END||this.style===Ht.Styles.BRACKET_OPEN_BOTH?(t.setLineWidth(this.render_options.bracket_line_width),this.drawBracketed()):this.style===Ht.Styles.TEXT&&this.drawText(),t.restore()}}class Xt extends l{static get Positions(){return{TOP:1,BOTTOM:-1}}static get PositionString(){return{top:Xt.Positions.TOP,bottom:Xt.Positions.BOTTOM}}constructor({start:t,stop:e,text:i="",superscript:s="",position:n=Xt.Positions.TOP}){super(),this.setAttribute("type","TextBracket"),this.start=t,this.stop=e,this.text=i,this.superscript=s,this.position="string"==typeof n?Xt.PositionString[n]:n,this.line=1,this.font={family:"Serif",size:15,weight:"italic"},this.render_options={dashed:!0,dash:[5],color:"black",line_width:1,show_bracket:!0,bracket_height:8,underline_superscript:!0}}applyStyle(t){return t.setFont(this.font.family,this.font.size,this.font.weight),t.setStrokeStyle(this.render_options.color),t.setFillStyle(this.render_options.color),t.setLineWidth(this.render_options.line_width),this}setDashed(t,e){return this.render_options.dashed=t,e&&(this.render_options.dash=e),this}setFont(t){return this.font={...this.font,...t},this}setLine(t){return this.line=t,this}draw(){const t=this.context;this.setRendered();let e=0;switch(this.position){case Xt.Positions.TOP:e=this.start.getStave().getYForTopText(this.line);break;case Xt.Positions.BOTTOM:e=this.start.getStave().getYForBottomText(this.line+m.TEXT_HEIGHT_OFFSET_HACK);break;default:throw new s.RERR("InvalidPosition",`The position ${this.position} is invalid`)}const i={x:this.start.getAbsoluteX(),y:e},n={x:this.stop.getAbsoluteX(),y:e};!function(...t){Xt.DEBUG&&s.L("Vex.Flow.TextBracket",t)}("Rendering TextBracket: start:",i,"stop:",n,"y:",e);const r=this.render_options.bracket_height*this.position;t.save(),this.applyStyle(t),t.fillText(this.text,i.x,i.y);const o=t.measureText(this.text).width,a=t.measureText("M").width,l=i.y-a/2.5;t.setFont(this.font.family,this.font.size/1.4,this.font.weight),t.fillText(this.superscript,i.x+o+1,l);const h=t.measureText(this.superscript).width,c=t.measureText("M").width;let u=i.x,d=l;const f=n.x+this.stop.getGlyph().getWidth();this.position===Xt.Positions.TOP?(u+=o+h+5,d-=c/2.7):this.position===Xt.Positions.BOTTOM&&(d+=c/2.7,u+=o+2,this.render_options.underline_superscript||(u+=h)),this.render_options.dashed?(E.drawDashedLine(t,u,d,f,d,this.render_options.dash),this.render_options.show_bracket&&E.drawDashedLine(t,f,d+1*this.position,f,d+r,this.render_options.dash)):(t.beginPath(),t.moveTo(u,d),t.lineTo(f,d),this.render_options.show_bracket&&t.lineTo(f,d+r),t.stroke(),t.closePath()),t.restore()}}class jt extends I{constructor(t=ft.type.SINGLE){super({duration:"b"}),this.setAttribute("type","BarNote"),this.metrics={widths:{}};const e=ft.type;this.metrics.widths={[e.SINGLE]:8,[e.DOUBLE]:12,[e.END]:15,[e.REPEAT_BEGIN]:14,[e.REPEAT_END]:14,[e.REPEAT_BOTH]:18,[e.NONE]:0},this.ignore_ticks=!0,this.setType(t)}getType(){return this.type}setType(t){return this.type="string"==typeof t?ft.typeString[t]:t,this.setWidth(this.metrics.widths[this.type]),this}getBoundingBox(){return super.getBoundingBox()}addToModifierContext(){return this}preFormat(){return this.setPreFormatted(!0),this}draw(){if(this.checkContext(),!this.stave)throw new s.RERR("NoStave","Can't draw without a stave.");!function(...t){jt.DEBUG&&s.L("Vex.Flow.BarNote",t)}("Rendering bar line at: ",this.getAbsoluteX());const t=new ft(this.type);t.setX(this.getAbsoluteX()),t.draw(this.stave),this.setRendered()}}class Yt extends N{constructor(t){if(!t)throw new s.RuntimeError("BadArguments","Ghost note must have valid initialization data to identify duration.");let e;if("string"==typeof t)e={duration:t};else{if("object"!=typeof t)throw new s.RuntimeError("BadArguments","Ghost note must have valid initialization data to identify duration.");e=t}super(e),this.setAttribute("type","GhostNote"),this.setWidth(0)}isRest(){return!0}setStave(t){super.setStave(t)}addToModifierContext(){return this}preFormat(){return this.setPreFormatted(!0),this}draw(){if(!this.stave)throw new s.RERR("NoStave","Can't draw without a stave.");this.setRendered();for(let t=0;t<this.modifiers.length;++t){const e=this.modifiers[t];e.setContext(this.context),e.drawWithStyle()}}}class Kt extends B{static get CATEGORY(){return"tremolo"}static get YOFFSETSTEMUP(){return-9}static get YOFFSETSTEMDOWN(){return-21}static get XOFFSETSTEMUP(){return 6}static get XOFFSETSTEMDOWN(){return-2}constructor(t){super(),this.setAttribute("type","Tremolo"),this.num=t,this.note=null,this.index=null,this.position=B.Position.CENTER,this.code="v74",this.y_spacing_scale=1,this.extra_stroke_scale=1,this.y_offset_for_beam=5}getCategory(){return Kt.CATEGORY}draw(){if(this.checkContext(),!this.note||null==this.index)throw new s.RERR("NoAttachedNote","Can't draw Tremolo without a note and index.");this.setRendered();const t=this.note.getStemDirection();this.y_spacing=4*t*this.y_spacing_scale;let e=this.note.getModifierStartXY(this.position,this.index).x,i=this.note.stem.getExtents().topY,n="gracenotes"===this.note.getCategory()?Bt.SCALE:1;n*=this.extra_stroke_scale,i+=t<0?Kt.YOFFSETSTEMDOWN*n:Kt.YOFFSETSTEMUP*n,this.note.beam&&(i+=this.y_offset_for_beam*t),this.font={family:"Arial",size:16*n,weight:""},this.render_options={font_scale:35*n,stroke_px:3,stroke_spacing:10*n},e+=t<0?Kt.XOFFSETSTEMDOWN:Kt.XOFFSETSTEMUP;for(let t=0;t<this.num;++t)f.renderGlyph(this.context,e,i,this.render_options.font_scale,this.code),i+=this.y_spacing}}class qt extends I{constructor(t){super(t),this.setAttribute("type","Crescendo"),this.decrescendo=!1,this.line=t.line||0,this.height=15,s.Merge(this.render_options,{extend_left:0,extend_right:0,y_shift:0})}setLine(t){return this.line=t,this}setHeight(t){return this.height=t,this}setDecrescendo(t){return this.decrescendo=t,this}preFormat(){return this.preFormatted=!0,this}draw(){this.checkContext(),this.setRendered();const t=this.getTickContext(),e=q.getNextContext(t),i=this.getAbsoluteX(),n=e?e.getX():this.stave.x+this.stave.width,r=this.stave.getYForLine(this.line+-3)+1;!function(...t){qt.DEBUG&&s.L("Vex.Flow.Crescendo",t)}("Drawing ",this.decrescendo?"decrescendo ":"crescendo ",this.height,"x",i-n),function(t,e){const i=e.begin_x,s=e.end_x,n=e.y,r=e.height/2;t.beginPath(),e.reverse?(t.moveTo(i,n-r),t.lineTo(s,n),t.lineTo(i,n+r)):(t.moveTo(s,n-r),t.lineTo(i,n),t.lineTo(s,n+r)),t.stroke(),t.closePath()}(this.context,{begin_x:i-this.render_options.extend_left,end_x:n+this.render_options.extend_right,y:r+this.render_options.y_shift,height:this.height,reverse:this.decrescendo})}}const $t=s.MakeException("ParserError");function Jt(t){return void 0!==t.matchedString?t.matchedString:t.results?Jt(t.results):1===t.length?Jt(t[0]):0===t.length?null:t.map(Jt)}class Zt{constructor(t){this.grammar=t}parse(t){this.line=t,this.pos=0,this.errorPos=-1;const e=this.expect(this.grammar.begin());return e.errorPos=this.errorPos,e}matchFail(t){-1===this.errorPos&&(this.errorPos=this.pos),this.pos=t}matchSuccess(){this.errorPos=-1}matchToken(t,e=!1){const i=e?new RegExp("^(("+t+"))"):new RegExp("^(("+t+")\\s*)"),s=this.line.slice(this.pos).match(i);return null!==s?{success:!0,matchedString:s[2],incrementPos:s[1].length,pos:this.pos}:{success:!1,pos:this.pos}}expectOne(t,e=!1){const i=[],s=this.pos;let n=!0,r=!1;e=!0===e||!0===t.maybe;for(let e=0;e<t.expect.length;e++){const s=t.expect[e],o=this.pos,a=this.expect(s);if(a.success){if(i.push(a),r=!0,t.or)break}else if(n=!1,!t.or){this.pos=o;break}}const o=t.or&&r||n,a=o||!0===e;return e&&!o&&(this.pos=s),a?this.matchSuccess():this.matchFail(s),{success:a,results:i,numMatches:o?1:0}}expectOneOrMore(t,e=!1){const i=[],s=this.pos;let n=0,r=!0;do{const e=this.expectOne(t);e.success?(n++,i.push(e.results)):r=!1}while(r);const o=n>0||!0===e;return!e||n>0||(this.pos=s),o?this.matchSuccess():this.matchFail(s),{success:o,results:i,numMatches:n}}expectZeroOrMore(t){return this.expectOneOrMore(t,!0)}expect(t){let e;if(function(...t){Zt.DEBUG&&s.L("Vex.Flow.Parser",t)}("Evaluating rules:",t),!t)throw new $t("Invalid Rule: "+t,t);const i=t.bind(this.grammar)();if(i.token)e=this.matchToken(i.token,!0===i.noSpace),e.success&&(this.pos+=e.incrementPos);else{if(!i.expect)throw new $t("Bad grammar! No `token` or `expect` property",i);e=i.oneOrMore?this.expectOneOrMore(i):i.zeroOrMore?this.expectZeroOrMore(i):this.expectOne(i)}return e.matches=[],e.results&&e.results.forEach((t=>e.matches.push(Jt(t)))),i.run&&e.success&&i.run(e),e}}function Qt(...t){re.DEBUG&&s.L("Vex.Flow.EasyScore",t)}const te=s.MakeException("EasyScoreError");class ee{constructor(t){this.builder=t}begin(){return this.LINE}LINE(){return{expect:[this.PIECE,this.PIECES,this.EOL]}}PIECE(){return{expect:[this.CHORDORNOTE,this.PARAMS],run:()=>this.builder.commitPiece()}}PIECES(){return{expect:[this.COMMA,this.PIECE],zeroOrMore:!0}}PARAMS(){return{expect:[this.DURATION,this.TYPE,this.DOTS,this.OPTS]}}CHORDORNOTE(){return{expect:[this.CHORD,this.SINGLENOTE],or:!0}}CHORD(){return{expect:[this.LPAREN,this.NOTES,this.RPAREN],run:t=>this.builder.addChord(t.matches[1])}}NOTES(){return{expect:[this.NOTE],oneOrMore:!0}}NOTE(){return{expect:[this.NOTENAME,this.ACCIDENTAL,this.OCTAVE]}}SINGLENOTE(){return{expect:[this.NOTENAME,this.ACCIDENTAL,this.OCTAVE],run:t=>this.builder.addSingleNote(t.matches[0],t.matches[1],t.matches[2])}}ACCIDENTAL(){return{expect:[this.ACCIDENTALS],maybe:!0}}DOTS(){return{expect:[this.DOT],zeroOrMore:!0,run:t=>this.builder.setNoteDots(t.matches[0])}}TYPE(){return{expect:[this.SLASH,this.MAYBESLASH,this.TYPES],maybe:!0,run:t=>this.builder.setNoteType(t.matches[2])}}DURATION(){return{expect:[this.SLASH,this.DURATIONS],maybe:!0,run:t=>this.builder.setNoteDuration(t.matches[1])}}OPTS(){return{expect:[this.LBRACKET,this.KEYVAL,this.KEYVALS,this.RBRACKET],maybe:!0}}KEYVALS(){return{expect:[this.COMMA,this.KEYVAL],zeroOrMore:!0}}KEYVAL(){return{expect:[this.KEY,this.EQUALS,this.VAL],run:t=>this.builder.addNoteOption(t.matches[0],t.matches[2].slice(1,-1))}}VAL(){return{expect:[this.SVAL,this.DVAL],or:!0}}KEY(){return{token:"[a-zA-Z][a-zA-Z0-9]*"}}DVAL(){return{token:'["][^"]*["]'}}SVAL(){return{token:"['][^']*[']"}}NOTENAME(){return{token:"[a-gA-G]"}}OCTAVE(){return{token:"[0-9]+"}}ACCIDENTALS(){return{token:"bbs|bb|bss|bs|b|db|d|##|#|n|\\+\\+-|\\+-|\\+\\+|\\+|k|o"}}DURATIONS(){return{token:"[0-9whq]+"}}TYPES(){return{token:"[rRsSxX]"}}LPAREN(){return{token:"[(]"}}RPAREN(){return{token:"[)]"}}COMMA(){return{token:"[,]"}}DOT(){return{token:"[.]"}}SLASH(){return{token:"[/]"}}MAYBESLASH(){return{token:"[/]?"}}EQUALS(){return{token:"[=]"}}LBRACKET(){return{token:"\\["}}RBRACKET(){return{token:"\\]"}}EOL(){return{token:"$"}}}class ie{constructor(t){this.factory=t,this.commitHooks=[],this.reset()}reset(t={}){this.options={stem:"auto",clef:"treble"},this.elements={notes:[],accidentals:[]},this.rollingDuration="8",this.resetPiece(),Object.assign(this.options,t)}getFactory(){return this.factory}getElements(){return this.elements}addCommitHook(t){this.commitHooks.push(t)}resetPiece(){Qt("resetPiece"),this.piece={chord:[],duration:this.rollingDuration,dots:0,type:void 0,options:{}}}setNoteDots(t){Qt("setNoteDots:",t),t&&(this.piece.dots=t.length)}setNoteDuration(t){Qt("setNoteDuration:",t),this.rollingDuration=this.piece.duration=t||this.rollingDuration}setNoteType(t){Qt("setNoteType:",t),t&&(this.piece.type=t)}addNoteOption(t,e){Qt("addNoteOption: key:",t,"value:",e),this.piece.options[t]=e}addNote(t,e,i){Qt("addNote:",t,e,i),this.piece.chord.push({key:t,accid:e,octave:i})}addSingleNote(t,e,i){Qt("addSingleNote:",t,e,i),this.addNote(t,e,i)}addChord(t){Qt("startChord"),"object"!=typeof t[0]?this.addSingleNote(t[0]):t.forEach((t=>{t&&this.addNote(...t)})),Qt("endChord")}commitPiece(){Qt("commitPiece");const{factory:t}=this;if(!t)return;const e={...this.options,...this.piece.options},{stem:i,clef:s}=e,n="auto"===i.toLowerCase(),r=n||"up"!==i.toLowerCase()?O.STEM_DOWN:O.STEM_UP,{chord:o,duration:a,dots:l,type:h}=this.piece,c=o.map((t=>t.key+"/"+t.octave)),u=t.StaveNote({keys:c,duration:a,dots:l,type:h,clef:s,auto_stem:n});n||u.setStemDirection(r);const d=o.map((t=>t.accid||null));d.forEach(((e,i)=>{e&&u.addAccidental(i,t.Accidental({type:e}))}));for(let t=0;t<l;t++)u.addDotToAll();this.commitHooks.forEach((t=>t(e,u,this))),this.elements.notes.push(u),this.elements.accidentals.concat(d),this.resetPiece()}}function se({id:t},e){void 0!==t&&e.setAttribute("id",t)}function ne(t,e){t.class&&t.class.split(/\s*,\s*/).forEach((t=>e.addClass(t)))}class re{constructor(t={}){this.setOptions(t),this.defaults={clef:"treble",time:"4/4",stem:"auto"}}set(t){return Object.assign(this.defaults,t),this}setOptions(t){return this.options={factory:null,builder:null,commitHooks:[se,ne,it.easyScoreHook],throwOnError:!1,...t},this.factory=this.options.factory,this.builder=this.options.builder||new ie(this.factory),this.grammar=new ee(this.builder),this.parser=new Zt(this.grammar),this.options.commitHooks.forEach((t=>this.addCommitHook(t))),this}setContext(t){return this.factory&&this.factory.setContext(t),this}parse(t,e={}){this.builder.reset(e);const i=this.parser.parse(t);if(!i.success&&this.options.throwOnError)throw new te("Error parsing line: "+t,i);return i}beam(t,e={}){return this.factory.Beam({notes:t,options:e}),t}tuplet(t,e={}){return this.factory.Tuplet({notes:t,options:e}),t}notes(t,e={}){return e={clef:this.defaults.clef,stem:this.defaults.stem,...e},this.parse(t,e),this.builder.getElements().notes}voice(t,e){return e={time:this.defaults.time,...e},this.factory.Voice(e).addTickables(t)}addCommitHook(t){return this.builder.addCommitHook(t)}}const oe=s.MakeException("FactoryError");function ae(t={},e){const i=e.options;return(t=Object.assign(e,t)).options=Object.assign(i,t.options),t}class le{constructor(t){!function(...t){le.DEBUG&&s.L("Vex.Flow.Factory",t)}("New factory: ",t);const e={stave:{space:10},renderer:{context:null,elementId:"",backend:E.Backends.SVG,width:500,height:200,background:"#FFF"},font:{face:"Arial",point:10,style:""}};this.options=e,this.setOptions(t)}static newFromElementId(t,e=500,i=200){return new le({renderer:{elementId:t,width:e,height:i}})}reset(){this.renderQ=[],this.systems=[],this.staves=[],this.voices=[],this.stave=null}getOptions(){return this.options}setOptions(t){for(const e of["stave","renderer","font"])Object.assign(this.options[e],t[e]);(null!==this.options.renderer.elementId||this.options.renderer.context)&&this.initRenderer(),this.reset()}initRenderer(){const{elementId:t,backend:e,width:i,height:s,background:n}=this.options.renderer;if(""===t)throw new oe("HTML DOM element not set in Factory");this.context=E.buildContext(t,e,i,s,n)}getContext(){return this.context}setContext(t){return this.context=t,this}getStave(){return this.stave}getVoices(){return this.voices}space(t){return this.options.stave.space*t}Stave(t){t=ae(t,{x:0,y:0,width:this.options.renderer.width-this.space(1),options:{spacing_between_lines_px:this.options.stave.space}});const e=new _t(t.x,t.y,t.width,t.options);return this.staves.push(e),e.setContext(this.context),this.stave=e,e}TabStave(t){t=ae(t,{x:0,y:0,width:this.options.renderer.width-this.space(1),options:{spacing_between_lines_px:1.3*this.options.stave.space}});const e=new Mt(t.x,t.y,t.width,t.options);return this.staves.push(e),e.setContext(this.context),this.stave=e,e}StaveNote(t){const e=new O(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}GhostNote(t){const e=new Yt(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}TextNote(t){const e=new gt(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}BarNote(t){t=ae(t,{type:"single",options:{}});const e=new jt(t.type);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}ClefNote(t){t=ae(t,{type:"treble",options:{size:"default"}});const e=new Ct(t.type,t.options.size,t.options.annotation);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}TimeSigNote(t){t=ae(t,{time:"4/4",options:{}});const e=new Rt(t.time);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}KeySigNote(t){const e=new It(t.key,t.cancelKey,t.alterKey);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}TabNote(t){const e=new wt(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}GraceNote(t){const e=new Bt(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),e}GraceNoteGroup(t){const e=new j(t.notes,t.slur);return e.setContext(this.context),e}Accidental(t){t=ae(t,{type:null,options:{}});const e=new U(t.type);return e.setContext(this.context),e}Annotation(t){t=ae(t,{text:"p",vJustify:"below",hJustify:"center",fontFamily:"Times",fontSize:14,fontWeight:"bold italic",options:{}});const e=new nt(t.text);return e.setJustification(t.hJustify),e.setVerticalJustification(t.vJustify),e.setFont(t.fontFamily,t.fontSize,t.fontWeight),e.setContext(this.context),e}Articulation(t){t=ae(t,{type:"a.",position:"above",options:{}});const e=new it(t.type);return e.setPosition(t.position),e.setContext(this.context),e}TextDynamics(t){t=ae(t,{text:"p",duration:"q",dots:0,line:0,options:{}});const e=new Gt({text:t.text,line:t.line,duration:t.duration,dots:t.dots});return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}Fingering(t){t=ae(t,{number:"0",position:"left",options:{}});const e=new k(t.number);return e.setPosition(t.position),e.setContext(this.context),e}StringNumber(t){t=ae(t,{number:"0",position:"left",options:{}});const e=new K(t.number);return e.setPosition(t.position),e.setContext(this.context),e}TickContext(){return(new q).setContext(this.context)}ModifierContext(){return new lt}MultiMeasureRest(t){const e=new At(t.number_of_measures,t);return e.setContext(this.context),this.renderQ.push(e),e}Voice(t){t=ae(t,{time:"4/4",options:{}});const e=new T(t.time);return this.voices.push(e),e}StaveConnector(t){t=ae(t,{top_stave:null,bottom_stave:null,type:"double",options:{}});const e=new A(t.top_stave,t.bottom_stave);return e.setType(t.type).setContext(this.context),this.renderQ.push(e),e}Formatter(){return new ut}Tuplet(t){t=ae(t,{notes:[],options:{}});const e=new x(t.notes,t.options).setContext(this.context);return this.renderQ.push(e),e}Beam(t){t=ae(t,{notes:[],options:{autoStem:!1,secondaryBeamBreaks:[]}});const e=new P(t.notes,t.options.autoStem).setContext(this.context);return e.breakSecondaryAt(t.options.secondaryBeamBreaks),this.renderQ.push(e),e}Curve(t){t=ae(t,{from:null,to:null,options:{}});const e=new kt(t.from,t.to,t.options).setContext(this.context);return this.renderQ.push(e),e}StaveTie(t){t=ae(t,{from:null,to:null,first_indices:[0],last_indices:[0],text:null,options:{direction:void 0}});const e=new H({first_note:t.from,last_note:t.to,first_indices:t.first_indices,last_indices:t.last_indices},t.text);return t.options.direction&&e.setDirection(t.options.direction),e.setContext(this.context),this.renderQ.push(e),e}StaveLine(t){t=ae(t,{from:null,to:null,first_indices:[0],last_indices:[0],options:{}});const e=new Ut({first_note:t.from,last_note:t.to,first_indices:t.first_indices,last_indices:t.last_indices});return t.options.text&&e.setText(t.options.text),t.options.font&&e.setFont(t.options.font),e.setContext(this.context),this.renderQ.push(e),e}VibratoBracket(t){t=ae(t,{from:null,to:null,options:{harsh:!1}});const e=new Pt({start:t.from,stop:t.to});return t.options.line&&e.setLine(t.options.line),t.options.harsh&&e.setHarsh(t.options.harsh),e.setContext(this.context),this.renderQ.push(e),e}TextBracket(t){t=ae(t,{from:null,to:null,text:"",options:{superscript:"",position:1}});const e=new Xt({start:t.from,stop:t.to,text:t.text,superscript:t.options.superscript,position:t.options.position});return t.options.line&&e.setLine(t.options.line),t.options.font&&e.setFont(t.options.font),e.setContext(this.context),this.renderQ.push(e),e}System(t={}){t.factory=this;const e=new ce(t).setContext(this.context);return this.systems.push(e),e}EasyScore(t={}){return t.factory=this,new re(t)}PedalMarking(t={}){t=ae(t,{notes:[],options:{style:"mixed"}});const e=new Ht(t.notes);return e.setStyle(Ht.StylesString[t.options.style]),e.setContext(this.context),this.renderQ.push(e),e}NoteSubGroup(t={}){t=ae(t,{notes:[],options:{}});const e=new z(t.notes);return e.setContext(this.context),e}draw(){this.systems.forEach((t=>t.setContext(this.context).format())),this.staves.forEach((t=>t.setContext(this.context).draw())),this.voices.forEach((t=>t.setContext(this.context).draw())),this.renderQ.forEach((t=>{t.isRendered()||t.setContext(this.context).draw()})),this.systems.forEach((t=>t.setContext(this.context).draw())),this.reset()}}function he(t,e){const i=e.options;return(t=Object.assign(e,t)).options=Object.assign(i,t.options),t}class ce extends l{constructor(t={}){super(),this.setAttribute("type","System"),this.setOptions(t),this.parts=[]}setOptions(t={}){this.options=he(t,{x:10,y:10,width:500,connector:null,spaceBetweenStaves:12,factory:null,debugFormatter:!1,formatIterations:0,options:{}}),this.factory=this.options.factory||new le({renderer:{el:null}})}setContext(t){return super.setContext(t),this.factory.setContext(t),this}addConnector(t="double"){return this.connector=this.factory.StaveConnector({top_stave:this.parts[0].stave,bottom_stave:this.parts[this.parts.length-1].stave,type:t}),this.connector}addStave(t){return(t=he(t,{stave:null,voices:[],spaceAbove:0,spaceBelow:0,debugNoteMetrics:!1,options:{left_bar:!1}})).stave||(t.stave=this.factory.Stave({x:this.options.x,y:this.options.y,width:this.options.width,options:t.options})),t.voices.forEach((e=>e.setContext(this.context).setStave(t.stave).getTickables().forEach((e=>e.setStave(t.stave))))),this.parts.push(t),t.stave}format(){const t=new ut;this.formatter=t;let e=this.options.y,i=0,s=[];const n=[];this.parts.forEach((r=>{e+=r.stave.space(r.spaceAbove),r.stave.setY(e),t.joinVoices(r.voices),e+=r.stave.space(r.spaceBelow),e+=r.stave.space(this.options.spaceBetweenStaves),r.debugNoteMetrics&&(n.push({y:e,voice:r.voices[0]}),e+=15),s=s.concat(r.voices),i=Math.max(i,r.stave.getNoteStartX())})),this.parts.forEach((t=>t.stave.setNoteStartX(i)));const r=this.options.width-(i-this.options.x)-I.STAVEPADDING;t.format(s,r);for(let e=0;e<this.options.formatIterations;e++)t.tune();this.startX=i,this.debugNoteMetricsYs=n,this.lastY=e}draw(){const t=this.checkContext();this.setRendered(),this.options.debugFormatter&&ut.plotDebugging(t,this.formatter,this.startX,this.options.y,this.lastY),this.debugNoteMetricsYs.forEach((e=>{e.voice.getTickables().forEach((i=>I.plotMetrics(t,i,e.y)))}))}}(s.Flow=m).Element=l,s.Flow.Fraction=n,s.Flow.Renderer=E,s.Flow.Formatter=ut,s.Flow.Music=V,s.Flow.Glyph=f,s.Flow.Stave=_t,s.Flow.StaveNote=O,s.Flow.StaveModifier=dt,s.Flow.StaveTempo=bt,s.Flow.Voice=T,s.Flow.Accidental=U,s.Flow.Beam=P,s.Flow.StaveTie=H,s.Flow.TabStave=Mt,s.Flow.TabNote=wt,s.Flow.Bend=rt,s.Flow.Vibrato=ot,s.Flow.VibratoBracket=Pt,s.Flow.Note=I,s.Flow.ModifierContext=lt,s.Flow.MultiMeasureRest=At,s.Flow.TickContext=q,s.Flow.Articulation=it,s.Flow.Annotation=nt,s.Flow.Barline=ft,s.Flow.NoteHead=R,s.Flow.StaveConnector=A,s.Flow.ClefNote=Ct,s.Flow.KeySignature=Et,s.Flow.KeySigNote=It,s.Flow.TimeSignature=vt,s.Flow.TimeSigNote=Rt,s.Flow.Stem=v,s.Flow.TabTie=X,s.Flow.Clef=yt,s.Flow.Dot=F,s.Flow.Modifier=B,s.Flow.TabSlide=Nt,s.Flow.Tuplet=x,s.Flow.GraceNote=Bt,s.Flow.GraceTabNote=Ft,s.Flow.Tuning=Dt,s.Flow.KeyManager=class{constructor(t){this.music=new V,this.setKey(t)}setKey(t){return this.key=t,this.reset(),this}getKey(){return this.key}reset(){if(this.keyParts=this.music.getKeyParts(this.key),this.keyString=this.keyParts.root,this.keyParts.accidental&&(this.keyString+=this.keyParts.accidental),!V.scaleTypes[this.keyParts.type])throw new s.RERR("BadArguments",`Unsupported key type: ${this.key}`);this.scale=this.music.getScaleTones(this.music.getNoteValue(this.keyString),V.scaleTypes[this.keyParts.type]),this.scaleMap={},this.scaleMapByValue={},this.originalScaleMapByValue={};const t=V.root_indices[this.keyParts.root];for(let e=0;e<V.roots.length;++e){const i=(t+e)%V.roots.length,s=V.roots[i],n=this.music.getRelativeNoteName(s,this.scale[e]);this.scaleMap[s]=n,this.scaleMapByValue[this.scale[e]]=n,this.originalScaleMapByValue[this.scale[e]]=n}return this}getAccidental(t){const e=this.music.getKeyParts(t).root,i=this.music.getNoteParts(this.scaleMap[e]);return{note:this.scaleMap[e],accidental:i.accidental}}selectNote(t){t=t.toLowerCase();const e=this.music.getNoteParts(t),i=this.scaleMap[e.root],s=this.music.getNoteParts(i);if(i===t)return{note:i,accidental:e.accidental,change:!1};const n=this.scaleMapByValue[this.music.getNoteValue(t)];if(null!=n)return{note:n,accidental:this.music.getNoteParts(n).accidental,change:!1};const r=this.originalScaleMapByValue[this.music.getNoteValue(t)];return null!=r?(this.scaleMap[s.root]=r,delete this.scaleMapByValue[this.music.getNoteValue(i)],this.scaleMapByValue[this.music.getNoteValue(t)]=r,{note:r,accidental:this.music.getNoteParts(r).accidental,change:!0}):s.root===t?(delete this.scaleMapByValue[this.music.getNoteValue(this.scaleMap[e.root])],this.scaleMapByValue[this.music.getNoteValue(s.root)]=s.root,this.scaleMap[s.root]=s.root,{note:s.root,accidental:null,change:!0}):(delete this.scaleMapByValue[this.music.getNoteValue(this.scaleMap[e.root])],this.scaleMapByValue[this.music.getNoteValue(t)]=t,delete this.scaleMap[s.root],this.scaleMap[s.root]=t,{note:t,accidental:e.accidental,change:!0})}},s.Flow.StaveHairpin=Ot,s.Flow.BoundingBox=c,s.Flow.Stroke=Y,s.Flow.TextNote=gt,s.Flow.Curve=kt,s.Flow.TextDynamics=Gt,s.Flow.StaveLine=Ut,s.Flow.Ornament=st,s.Flow.PedalMarking=Ht,s.Flow.TextBracket=Xt,s.Flow.FretHandFinger=k,s.Flow.Repetition=mt,s.Flow.BarNote=jt,s.Flow.GhostNote=Yt,s.Flow.NoteSubGroup=z,s.Flow.GraceNoteGroup=j,s.Flow.Tremolo=Kt,s.Flow.StringNumber=K,s.Flow.Crescendo=qt,s.Flow.Volta=xt,s.Flow.Font=u,s.Flow.System=ce,s.Flow.Factory=le,s.Flow.Parser=Zt,s.Flow.EasyScore=re,s.Flow.Registry=a;const ue=s},6150:t=>{"use strict";t.exports="precision mediump float;\nuniform sampler2D u_image;\nvarying vec4 v_position;\n\n#define NUM_ROWS 5\n#define ELEMENT_HEIGHT 300\n\nvoid main() {\n const float halfPixel = 1.0 / float(ELEMENT_HEIGHT * 2);\n\n vec2 absolutePosition = (v_position.xy + vec2(1.0)) / vec2(2.0);\n float absX = absolutePosition.x;\n float absY = absolutePosition.y;\n\n int skyLine = 0;\n for (int i = 0; i < ELEMENT_HEIGHT; ++i) {\n float ratioY = float(i) / float(ELEMENT_HEIGHT);\n float relY = (ratioY - 0.5 + halfPixel) / float(NUM_ROWS);\n float x = absX;\n float y = absY + relY;\n\n float currentAlpha = texture2D(u_image, vec2(x, y)).a;\n if (currentAlpha > 0.0) {\n skyLine = i;\n break;\n }\n }\n\n int bottomLine = ELEMENT_HEIGHT;\n for (int i = ELEMENT_HEIGHT - 1; i >= 0; --i) {\n float ratioY = float(i) / float(ELEMENT_HEIGHT);\n float relY = (ratioY - 0.5 + halfPixel) / float(NUM_ROWS);\n float x = absX;\n float y = absY + relY;\n\n float currentAlpha = texture2D(u_image, vec2(x, y)).a;\n if (currentAlpha > 0.0) {\n bottomLine = i;\n break;\n }\n }\n\n int r = skyLine;\n if (r > 256) {\n r -= 256;\n }\n int g = bottomLine;\n if (g > 256) {\n g -= 256;\n }\n int b = (skyLine / 256 * 16) + (bottomLine / 256);\n\n gl_FragColor = vec4(float(r) / 255.0, float(g) / 255.0, float(b) / 255.0, 1.0);\n}\n"},6357:t=>{"use strict";t.exports="attribute vec4 a_position;\nvarying vec4 v_position;\n\nvoid main() {\n gl_Position = a_position;\n v_position = a_position;\n}\n"}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={exports:{}};return t[s].call(r.exports,r,r.exports,i),r.exports}return i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i(3607)})()));
  3. //# sourceMappingURL=opensheetmusicdisplay.min.js.map