forked from bbloomf/jgabc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexsurge.min.js
8 lines (8 loc) · 192 KB
/
exsurge.min.js
1
2
3
4
5
6
7
8
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("exsurge",[],e):"object"==typeof exports?exports.exsurge=e():t.exsurge=e()}(this,function(){return function(t){function e(n){if(i[n])return i[n].exports;var s=i[n]={exports:{},id:n,loaded:!1};return t[n].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(1);Object.keys(n).forEach(function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})});var s=i(2);Object.keys(s).forEach(function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return s[t]}})});var o=i(3);Object.keys(o).forEach(function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}})});var A=i(4);Object.keys(A).forEach(function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return A[t]}})});var a=i(6);Object.keys(a).forEach(function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return a[t]}})});var r=i(9);Object.keys(r).forEach(function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}})});var h=i(10);Object.keys(h).forEach(function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return h[t]}})});var u=i(8);Object.keys(u).forEach(function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return u[t]}})});var l=i(11);if(Object.keys(l).forEach(function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return l[t]}})}),"undefined"!=typeof document&&document.registerElement){var c=Object.create(HTMLElement.prototype);c.createdCallback=function(){var t=new A.ChantContext;t.setFont("'Crimson Text', serif",19.2);var e=!0,i=this.getAttribute("use-drop-cap");"false"===i&&(e=!1);var n=l.Gabc.loadChantScore(t,this.innerText,e),s=this.getAttribute("annotation");s&&(n.annotation=new A.Annotation(t,s));var o=this,a=0,r=function(){var e=o.parentElement.clientWidth;a!==e&&(a=e,n.performLayout(t,function(){n.layoutChantLines(t,a,function(){o.appendElement(n.createSvgNode(t))})}))};r(),window.addEventListener?window.addEventListener("resize",r,!1):window.attachEvent&&window.attachEvent("onresize",r)},c.attachedCallback=function(){},document.registerElement("chant-visual",{prototype:c})}},function(t,e){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t){return t}function s(t){return g.ToDeviceIndependent(t,g.Centimeters)}function o(t){return g.ToDeviceIndependent(t,g.Millimeters)}function A(t){return g.ToDeviceIndependent(t,g.Inches)}function a(t){return g.FromDeviceIndependent(t,g.Centimeters)}function r(t){return g.FromDeviceIndependent(t,g.Millimeters)}function h(t){return g.FromDeviceIndependent(t,g.Inches)}function u(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return t()+t()}function l(t){return Object.keys(t).map(function(e){return e+": "+t[e]+";"}).join("")}Object.defineProperty(e,"__esModule",{value:!0});var c=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}();e.DeviceIndependent=n,e.Centimeters=s,e.Millimeters=o,e.Inches=A,e.ToCentimeters=a,e.ToMillimeters=r,e.ToInches=h,e.generateRandomGuid=u,e.getCssForProperties=l;var g=e.Units={DeviceIndepenedent:0,Centimeters:1,Millimeters:2,Inches:3,DIU_PER_INCH:96,DIU_PER_CENTIMETER:96/2.54,ToDeviceIndependent:function(t,e){switch(e){case s:return t*DIU_PER_CENTIMETER;case o:return t*DIU_PER_CENTIMETER/10;case A:return t*DIU_PER_INCH;default:return t}},FromDeviceIndependent:function(t,e){switch(e){case s:return t/DIU_PER_CENTIMETER;case o:return t/DIU_PER_CENTIMETER*10;case A:return t/DIU_PER_INCH;default:return t}},StringToUnitsType:function(t){switch(t.ToLower()){case"in":case"inches":return A;case"cm":case"centimeters":return s;case"mm":case"millimeters":return o;case"di":case"device-independent":return DeviceIndepenedent;default:return DeviceIndepenedent}},UnitsTypeToString:function(t){switch(t){case A:return"in";case s:return"cm";case o:return"mm";case DeviceIndepenedent:return"device-independent";default:return"device-independent"}}},d=e.Point=function(){function t(e,n){i(this,t),this.x="undefined"!=typeof e?e:0,this.y="undefined"!=typeof n?n:0}return c(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"equals",value:function(t){return this.x===t.x&&this.y===t.y}}]),t}(),f=(e.Rect=function(){function t(e,n,s,o){i(this,t),this.x="undefined"!=typeof e?e:1/0,this.y="undefined"!=typeof n?n:1/0,this.width="undefined"!=typeof s?s:-(1/0),this.height="undefined"!=typeof o?o:-(1/0)}return c(t,[{key:"clone",value:function(){return new t(this.x,this.y,this.width,this.height)}},{key:"isEmpty",value:function(){return this.x===1/0&&this.y===1/0&&this.width===-(1/0)&&this.height===-(1/0)}},{key:"right",value:function(){return this.x+this.width}},{key:"bottom",value:function(){return this.y+this.height}},{key:"equals",value:function(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}},{key:"contains",value:function(t){return t instanceof d?t.x>=this.x&&t.x<=this.x+this.width&&t.y>=this.y&&t.y<=this.y+this.height:this.x<=t.x&&this.x+this.width>=t.x+t.width&&this.y<=t.y&&this.y+this.height>=t.y+t.height}},{key:"union",value:function(t){var e=Math.max(this.x+this.width,t.x+t.width),i=Math.max(this.y+this.height,t.y+t.height);this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.width=e-this.x,this.height=i-this.y}}]),t}(),e.Margins=function(){function t(e,n,s,o){i(this,t),this.left="undefined"!=typeof e?e:0,this.top="undefined"!=typeof n?n:0,this.right="undefined"!=typeof s?s:0,this.bottom="undefined"!=typeof o?o:0}return c(t,[{key:"clone",value:function(){return new t(this.left,this.top,this.right,this.bottom)}},{key:"equals",value:function(t){return this.left===t.left&&this.top===t.top&&this.right===t.right&&this.bottom===t.bottom}}]),t}(),e.Size=function(){function t(e,n){i(this,t),this.width="undefined"!=typeof e?e:0,this.height="undefined"!=typeof n?n:0}return c(t,[{key:"clone",value:function(){return new t(this.width,this.height)}},{key:"equals",value:function(t){return this.width===t.width&&this.height===t.height}}]),t}(),e.Step={Do:0,Du:1,Re:2,Me:3,Mi:4,Fa:5,Fu:6,So:7,La:9,Te:10,Ti:11}),p=[0,0,1,1,2,3,3,4,4,5,6,6],y=[f.Do,f.Re,f.Mi,f.Fa,f.So,f.La,f.Ti];e.Pitch=function(){function t(e,n){i(this,t),"undefined"==typeof n&&(n=Math.floor(e/12),e%=12),this.step=e,this.octave=n}return c(t,[{key:"toInt",value:function(){return 12*this.octave+this.step}},{key:"transpose",value:function(e){return new t(this.toInt()+e)}},{key:"isHigherThan",value:function(t){return this.toInt()>t.toInt()}},{key:"isLowerThan",value:function(t){return this.toInt()<t.toInt()}},{key:"equals",value:function(t){return this.toInt()===t.toInt()}}],[{key:"stepToStaffOffset",value:function(t){return p[t]}},{key:"staffOffsetToStep",value:function(t){for(;0>t;)t=y.length+t;return y[t%y.length]}}]),t}()},function(t,e,i){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e["default"]=t,e}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function A(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Spanish=e.Latin=e.Language=void 0;var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=i(1),h=(n(r),e.Language=function(){function t(e){A(this,t),this.name="undefined"!=typeof e?e:"<unknown>"}return a(t,[{key:"syllabify",value:function(t){var e=[];if("undefined"==typeof t||""===t)return e;for(var i=t.split(/[\s]+/),n=0,s=i.length;s>n;n++)e.push(this.syllabifyWord(i[n]));return e}}]),t}());e.Latin=function(t){function e(){A(this,e);var t=s(this,Object.getPrototypeOf(e).call(this,"Latin"));t.diphthongs=["ae","au","oe","aé","áu","oé"],t.possibleDiphthongs=t.diphthongs.concat(["ei","eu","ui","éi","éu","úi"]),t.regexVowel=/(i|(?:[qg]|^)u)?([eé][iu]|[uú]i|[ao][eé]|[aá]u|[aeiouáéíóúäëïöüāēīōūăĕĭŏŭåe̊o̊ůæœǽyýÿ])/i;var i=new Object;return i.huius=["hui","us"],i.cuius=["cui","us"],i.huic=["huic"],i.cui=["cui"],i.hui=["hui"],i.euge=["eu","ge"],i.seu=["seu"],t.vowels=["a","e","i","o","u","á","é","í","ó","ú","ä","ë","ï","ö","ü","ā","ē","ī","ō","ū","ă","ĕ","ĭ","ŏ","ŭ","å","e̊","o̊","ů","æ","œ","ǽ","y","ý","ÿ"],t.vowelsThatMightBeConsonants=["i","u"],t.muteConsonantsAndF=["b","c","d","g","p","t","f"],t.liquidConsonants=["l","r"],t}return o(e,t),a(e,[{key:"isVowel",value:function(t){for(var e=0,i=this.vowels.length;i>e;e++)if(this.vowels[e]===t)return!0;return!1}},{key:"isVowelThatMightBeConsonant",value:function(t){for(var e=0,i=this.vowelsThatMightBeConsonants.length;i>e;e++)if(this.vowelsThatMightBeConsonants[e]===t)return!0;return!1}},{key:"isVowelActingAsConsonant",value:function(t){return this.isVowelThatMightBeConsonant(t[0])&&this.isVowel(t[1])}},{key:"isMuteConsonantOrF",value:function(t){for(var e=0,i=this.muteConsonantsAndF.length;i>e;e++)if(this.muteConsonantsAndF[e]===t)return!0;return!1}},{key:"isLiquidConsonant",value:function(t){for(var e=0,i=this.liquidConsonants.length;i>e;e++)if(this.liquidConsonants[e]===t)return!0;return!1}},{key:"isDiphthong",value:function(t){for(var e=0,i=this.diphthongs.length;i>e;e++)if(this.diphthongs[e]===t)return!0;return!1}},{key:"isPossibleDiphthong",value:function(t){for(var e=0,i=this.possibleDiphthongs.length;i>e;e++)if(this.possibleDiphthongs[e]===t)return!0;return!1}},{key:"syllabifyWord",value:function(t){for(var e,i,n,s=[],o=!1,A=!1,a=t.toLowerCase(),r=0,h=function(e){o&&(s.push(t.substr(r,e)),r+=e),o=!1},u=0,l=a.length;l>u;u++){e=a[u],i="*",n=l>u+1,n&&(i=a[u+1]);var c=this.isVowel(e);"i"===e&&(0===u&&n&&this.isVowel(i)?c=!1:A&&n&&this.isVowel(i)&&(c=!1)),"-"===e?(o=!0,A=!1,h(u-r),r++):c?(o=!0,A&&!this.isDiphthong(a[u-1]+""+e)&&(h(u-r),o=!0),A=!0):n&&("q"===e&&"u"===i||"h"===i&&("c"===e||"p"===e||"t"===e)?(h(u-r),u++):A&&this.isVowel(i)?h(u-r):this.isMuteConsonantOrF(e)&&this.isLiquidConsonant(i)?h(u-r):o&&h(u+1-r),A=!1)}return o?s.push(t.substr(r)):r>0&&(s[s.length-1]+=t.substr(r)),s}},{key:"findVowelSegment",value:function(t,e){var i=this.regexVowel.exec(t.slice(e));return i?(i[1]&&(i.index+=i[1].length),{found:!0,startIndex:e+i.index,length:i[2].length}):{found:!1,startIndex:-1,length:-1}}}]),e}(h),e.Spanish=function(t){function e(){A(this,e);var t=s(this,Object.getPrototypeOf(e).call(this,"Spanish"));return t.vowels=["a","e","i","o","u","y","á","é","í","ó","ú","ü"],t.weakVowels=["i","u","ü","y"],t.strongVowels=["a","e","o","á","é","í","ó","ú"],t.diphthongs=["ai","ei","oi","ui","ia","ie","io","iu","au","eu","ou","ua","ue","uo","ái","éi","ói","úi","iá","ié","ió","iú","áu","éu","óu","uá","ué","uó","üe","üi"],t.uDiphthongExceptions=["gue","gui","qua","que","qui","quo"],t}return o(e,t),a(e,[{key:"isVowel",value:function(t){for(var e=0,i=this.vowels.length;i>e;e++)if(this.vowels[e]===t)return!0;return!1}},{key:"isWeakVowel",value:function(t){for(var e=0,i=this.weakVowels.length;i>e;e++)if(this.weakVowels[e]===t)return!0;return!1}},{key:"isStrongVowel",value:function(t){for(var e=0,i=this.strongVowels.length;i>e;e++)if(this.strongVowels[e]===t)return!0;return!1}},{key:"isDiphthong",value:function(t){for(var e=0,i=this.diphthongs.length;i>e;e++)if(this.diphthongs[e]===t)return!0;return!1}},{key:"createSyllable",value:function(t){return t}},{key:"syllabifyWord",value:function(t){for(var e=[],i=!1,n=!1,s=!1,o=0,A=0;A<t.length;A++){var a=t[A].toLowerCase();if(this.isVowel(a)){i=!0;var r=this.isStrongVowel(a);n&&r&&s&&(e.push(this.createSyllable(t.substr(o,A-o))),o=A),n=!0,s=r}else{if(i){if("-"===t[A])e.push(this.createSyllable(t.substr(o,A-o))),o=++A;else{for(var h,u=1,l=A+1;l<t.length&&!this.isVowel(t[l]);l++)u++;1===u?(e.push(this.createSyllable(t.substr(o,A-o))),o=A):2===u?(h=t[A+1].toLowerCase(),"l"===h||"r"===h||"c"===a&&"h"===h?(e.push(this.createSyllable(t.substr(o,A-o))),o=A++):(e.push(this.createSyllable(t.substr(o,++A-o))),o=A)):3===u?(h=t[A+1].toLowerCase(),"s"===h?(A+=2,e.push(this.createSyllable(t.substr(o,A-o)))):e.push(this.createSyllable(t.substr(o,++A-o))),o=A):4===u&&(e.push(this.createSyllable(t.substr(o,A-o+2))),o=A+2,A+=3)}i=!1}else;n=!1}}return i?e.push(t.substr(o)):o>0?e[e.length-1]+=t.substr(o):0===e.length&&e.push(this.createSyllable(t)),e}},{key:"findVowelSegment",value:function(t,e){var i,n,s,o=t.toLowerCase();for(i=0,n=this.diphthongs.length;n>i;i++){var A=this.diphthongs[i];if(s=o.indexOf(A,e),s>=0){if("u"===A[0]&&s>0){var a=t.substr(s-1,3).toLowerCase();for(j=0,endj=this.uDiphthongExceptions.length;i<endj;j++)if(a===this.uDiphthongExceptions[j])return this.findVowelSegment(t,s+1)}return{found:!0,startIndex:s,length:A.length}}}for(i=0,n=this.vowels.length;n>i;i++)if(s=o.indexOf(this.vowels[i],e),s>=0)return{found:!0,startIndex:s,length:1};return{found:!1,startIndex:-1,length:-1}}}]),e}(h)},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.Glyphs={None:{paths:[{type:"positive",data:""}],bounds:{x:0,y:0,width:0,height:0},origin:{x:0,y:0},align:"left"},AcuteAccent:{paths:[{type:"positive",data:"M4 0C-.614.52-.614.52-.803-3.182l60.768-108.422c4.52-7.182 10.543-13.67 18.075-13.67 5.27 0 14.31 1.264 23.346 7.793 7.53 5.223 8.803 11.752 8.803 16.975 0 3.917-.52 11.1-8.05 17.628L4 0z"}],bounds:{x:0,y:0,width:110.992,height:125.794},origin:{x:.803,y:125.274},align:"left"},Stropha:{paths:[{type:"positive",data:"M1.22-73.438c4.165 13.02 12.238 27.084 24.217 42.188L49.657 0 34.812 27.344C18.666 55.47-.084 72.396-21.438 78.124c4.687-3.645 7.03-8.593 7.03-14.843 0-8.853-4.947-20.572-14.843-35.155L-48 0 1.22-73.438z"}],bounds:{x:0,y:0,width:97.657,height:151.562},origin:{x:48,y:73.438},align:"left"},BeginningAscLiquescent:{paths:[{type:"positive",data:"M-50 43.688V-61c4.167 7.292 12.76 10.938 25.78 10.938 9.376 0 20.053-1.563 32.032-4.688C31.773-60.48 45.833-71.677 50-88.344v117.97C43.75 42.645 32.812 51.5 17.187 56.186-.52 61.398-15.886 64-28.906 64-42.97 64-50 57.23-50 43.687z"}],bounds:{x:0,y:0,width:100,height:152.344},origin:{x:50,y:88.344},align:"left"},BeginningDesLiquescent:{paths:[{type:"positive",data:"M-50-56.03c0-13.022 7.03-19.532 21.094-19.532 13.02 0 28.385 2.604 46.093 7.812C32.813-63.583 43.75-54.73 50-41.187V76C45.833 59.854 31.77 48.656 7.812 42.406c-11.98-3.125-22.656-4.687-32.03-4.687-13.022 0-21.615 3.905-25.782 11.718v-105.47z"}],bounds:{x:0,y:0,width:100,height:151.562},origin:{x:50,y:75.562},align:"left"},CustosDescLong:{paths:[{type:"positive",data:"M39.063 273.472c5.73.52 7.29-6.25 4.687-20.312V-65.59c-13.542 2.083-24.22 5.468-32.03 10.156C3.905-50.226 0-43.714 0-35.904V71.91c5.73-5.21 10.677-8.594 14.844-10.157 5.73-1.562 12.24-2.343 19.53-2.343v196.875c0 11.458 1.563 17.187 4.688 17.187"}],bounds:{x:0,y:0,width:46.353,height:339.582},origin:{x:0,y:65.59},align:"left"},CustosDescShort:{paths:[{type:"positive",data:"M34.375 191.923c0 8.333 1.563 12.24 4.688 11.72 3.125-.522 4.687-7.033 4.687-19.533v-250c-13.542 2.084-24.22 5.47-32.03 10.157C3.905-50.525 0-44.015 0-36.203V71.61c5.73-5.208 10.677-8.593 14.844-10.156 5.73-1.562 12.24-2.344 19.53-2.344v132.813z"}],bounds:{x:0,y:0,width:43.75,height:270.053},origin:{x:0,y:65.89},align:"left"},CustosLong:{paths:[{type:"positive",data:"M39.063-269.562c5.73-.52 7.29 6.25 4.687 20.312V69.5c-13.542-2.083-24.22-5.47-32.03-10.156C3.905 54.134 0 47.624 0 39.812V-68c5.73 5.208 10.677 8.594 14.844 10.156 5.73 1.563 12.24 2.344 19.53 2.344v-196.875c0-11.458 1.563-17.187 4.688-17.187z"}],bounds:{x:0,y:0,width:46.353,height:339.582},origin:{x:0,y:270.082},align:"left"},CustosShort:{paths:[{type:"positive",data:"M34.375-188.125c0-8.333 1.563-12.24 4.688-11.72 3.125.522 4.687 7.033 4.687 19.532v250c-13.542-2.083-24.22-5.468-32.03-10.156C3.905 54.324 0 47.813 0 40V-67.813c5.73 5.21 10.677 8.594 14.844 10.157 5.73 1.562 12.24 2.344 19.53 2.343v-132.812z"}],bounds:{x:0,y:0,width:43.75,height:270.052},origin:{x:0,y:200.365},align:"left"},DoClef:{paths:[{type:"positive",data:"M0 98.406V-97.688C0-118 5.99-134.275 17.97-146.516c11.978-12.24 27.603-18.36 46.874-18.36 10.937 0 19.53 3.126 25.78 9.376s9.376 14.583 9.376 25v107.813l-6.25-5.47c-4.167-3.645-10.287-7.42-18.36-11.327-8.072-3.907-16.796-5.86-26.17-5.86-11.46 0-21.486 4.427-30.08 13.282-8.593 8.854-12.89 19.53-12.89 32.03s4.297 23.308 12.89 32.423c8.594 9.115 18.62 13.672 30.08 13.672 9.374 0 18.098-1.822 26.17-5.468 8.073-3.646 14.193-7.292 18.36-10.938l6.25-6.25V132c0 9.896-3.125 18.1-9.375 24.61-6.25 6.51-14.844 9.765-25.78 9.765-19.272 0-34.897-6.25-46.876-18.75C5.99 135.125 0 118.72 0 98.405z"}],bounds:{x:0,y:0,width:100,height:331.251},origin:{x:0,y:164.876},align:"left"},FaClef:{paths:[{type:"positive",data:"M85.156-32v193.75c0 9.375-1.562 14.323-4.687 14.844-1.564 0-2.605-.52-3.126-1.563-.52-1.04-.782-2.603-.78-4.686V56.28c-8.335-8.332-19.793-12.5-34.376-12.5-17.71 0-31.77 3.907-42.188 11.72V-32c0-18.23 14.193-27.344 42.578-27.344 28.385 0 42.578 9.115 42.578 27.344zM98.438 93V-92.156c0-19.27 5.73-34.896 17.187-46.875 11.458-11.98 26.562-17.97 45.313-17.97 10.937 0 19.14 2.865 24.61 8.594 5.467 5.73 8.202 13.542 8.202 23.437v103.126l-5.47-4.687c-3.645-3.647-9.374-7.293-17.186-10.94-7.813-3.645-15.886-5.467-24.22-5.468-11.978 0-22.004 4.167-30.077 12.5-8.073 8.334-12.11 18.36-12.11 30.08 0 11.717 4.037 22.004 12.11 30.858s18.1 13.28 30.078 13.28c8.333 0 16.406-1.822 24.22-5.468 7.81-3.645 13.54-7.03 17.186-10.156l5.47-5.468V125.81c0 9.896-2.865 17.84-8.594 23.83-5.73 5.988-13.802 8.983-24.22 8.983-18.75 0-33.853-6.12-45.31-18.36-11.46-12.24-17.19-27.994-17.19-47.265z"}],bounds:{x:0,y:0,width:193.752,height:333.595},origin:{x:.001,y:157.001},align:"left"},Flat:{paths:[{type:"positive",data:"M7.813-204.406c4.166 0 6.25 5.208 6.25 15.625L12.5-10.657C33.854 13.302 54.167 25.28 73.438 25.28c9.374 0 14.062-4.686 14.062-14.06 0-6.25-1.042-11.72-3.125-16.407-2.083-4.688-7.03-9.766-14.844-15.235-7.81-5.47-13.02-8.984-15.624-10.547L27.344-45.81V-80.97c17.187 0 33.073 4.82 47.656 14.454C89.583-56.88 96.875-47.376 96.875-38c0 67.708-.26 101.562-.78 101.563-38.543 0-69.532-12.24-92.97-36.72C0-52.322-1.042-123.936 0-188c0-10.937 2.604-16.406 7.813-16.406z"}],bounds:{x:0,y:0,width:97.917,height:267.969},origin:{x:1.042,y:204.406},align:"left"},Mora:{paths:[{type:"positive",data:"M47.478-24c6.957 0 12.793 2.288 17.49 6.883C69.662-12.52 72-6.904 72-.267c0 6.64-2.337 12.352-7.033 17.118C60.27 21.618 54.435 24 47.477 24c-6.26 0-11.748-2.383-16.444-7.15C26.337 12.086 24 6.374 24-.265c0-6.638 2.337-12.255 7.033-16.85C35.73-21.713 41.217-24 47.478-24z"}],bounds:{x:0,y:0,width:48,height:48},origin:{x:-24,y:24},align:"left"},Natural:{paths:[{type:"positive",data:"M7.906-166.563c-2.864 0-5.614.52-8.218 1.563v13.28l.78 56.25.782 78.907v85.157c.52 3.646 2.604 5.73 6.25 6.25l23.438-3.906 23.437-3.907v29.69c0 42.186-.26 63.54-.78 64.06l6.25 2.345c1.04.52 2.082.78 3.124.78 2.603 0 4.947-1.3 7.03-3.905L67.656-71.25c-.52-2.604-2.083-3.906-4.687-3.906-7.814 0-17.19 1.04-28.126 3.125l-19.53 3.124.78-38.28V-165c-2.604-1.042-5.323-1.562-8.188-1.563zM55.938-40v71.875l-41.407 7.03c0-48.436.262-72.655.783-72.655L55.938-40z"}],bounds:{x:0,y:0,width:70.311,height:330.469},origin:{x:.312,y:166.563},align:"left"},Sharp:{paths:[{type:"positive",data:"m41.725,-73.773c-5.421,-0.241-10.878,5.856-6.549,12.357L67.061,-20.473 61.264,-12.5 13.436,-71.199c-5.634,-5.934-16.988,1.032-11.232,9.783L50.756,0.182 2.203,61.416c-6.745,7.984 3.442,17.859 11.232,9.783L61.264,12.5l5.797,7.973-31.885,40.943c-5.578,6.844 5.588,16.005 11.594,9.783L77.568,33.154 108.367,71.199c4.894,6.717 17.343,-1.575 11.232,-9.783L87.715,20.473 93.873,12.5 141.34,71.199c6.725,7.67 17.509,-2.248 11.596,-9.783L104.02,0.182 152.936,-61.416c5.52,-7.02-5.541,-16.309-11.596,-9.783L93.873,-12.5l-6.158,-7.973 31.884766,-40.943c5.407,-7.045-5.505,-15.924-11.232,-9.783L77.568,-33.154 46.77,-71.199c-1.435,-1.708-3.238,-2.494-5.044922,-2.574zM77.568,-8.516 84.09,0.182 77.568,8.516 70.684,0.182Z"}],bounds:{x:0,y:0,width:154.646,height:147.987},origin:{x:0,y:74.098},align:"left"},OriscusAsc:{paths:[{type:"positive",data:"M50 30.25c0 12.5-3.125 21.354-9.375 26.562-3.125 2.605-7.813 3.907-14.063 3.907-3.125 0-5.99-.522-8.593-1.564-2.605-1.04-5.6-2.474-8.986-4.297C5.6 53.035 2.734 51.603.39 50.56c-2.343-1.04-5.338-2.474-8.984-4.296-3.646-1.823-6.77-3.256-9.375-4.297-2.603-1.043-5.468-1.564-8.593-1.564-6.25 0-10.937 1.563-14.062 4.688C-46.875 50.824-50 59.677-50 71.656v-106.25c0-13.02 3.125-21.875 9.375-26.562 3.125-2.604 7.813-3.906 14.063-3.907 3.125 0 5.99.52 8.593 1.563 2.605 1.042 5.73 2.474 9.376 4.297 3.646 1.823 6.51 2.995 8.594 3.516l10.938 5.468c6.25 3.126 11.458 4.69 15.624 4.69 6.25 0 10.938-1.564 14.063-4.69C46.875-55.426 50-64.02 50-76V30.25z"}],bounds:{x:0,y:0,width:100,height:147.656},origin:{x:50,y:76},align:"left"},OriscusDes:{paths:[{type:"positive",data:"M-50 30.844v-106.25c0 11.458 3.125 20.052 9.375 25.78 3.125 3.126 7.813 4.69 14.063 4.688 4.687 0 13.41-3.255 26.17-9.765 12.762-6.51 21.746-9.766 26.954-9.766 6.25 0 10.938 1.303 14.063 3.907C46.875-55.874 50-47.02 50-34V72.25c0-11.98-3.125-20.833-9.375-26.563C37.5 42.563 32.812 41 26.562 41 21.875 41 13.023 44.385 0 51.156c-4.167 2.604-8.594 4.948-13.28 7.032-4.69 2.083-9.116 3.124-13.283 3.124-6.25 0-10.937-1.302-14.062-3.906C-46.875 52.198-50 43.344-50 30.844z"}],bounds:{x:0,y:0,width:100,height:147.656},origin:{x:50,y:75.406},align:"left"},OriscusLiquescent:{paths:[{type:"positive",data:"M 19.055,78.887 C 20.242,78.487 21.532,77.890 22.925,77.097 24.318,76.304 26.700882,74.417 30.074,71.438 33.447,68.458 36.524,64.985 39.303,61.019 42.083,57.052 44.563,51.396 46.743,44.05 48.923,36.704 50.013,28.671 50.013,19.950525 L 50.013,-34.226 C 50.013,-54.464 42.074,-64.584 26.195,-64.584 20.248,-64.584 11.519,-61.410 0.007,-55.064 -11.506,-48.717 -20.235,-45.544 -26.182,-45.544 -34.515,-45.544 -40.568,-48.520 -44.340791,-54.473 -48.114,-60.426 -50.000,-67.369 -50.000,-75.303 L -50.000,30.07 C -50.000,49.909 -42.060754,59.829 -26.182,59.829 -21.023,59.829 -12.39,56.455 -0.284,49.709 11.822,42.963 20.648,39.59 26.195,39.59 29.369,40.777 30.362,44.25 29.17479,50.009 27.988,55.768 26.001,62.020829 23.216,68.767 z"}],bounds:{x:0,y:0,width:100,height:147.656},origin:{x:50,y:75.406},align:"left"},PodatusLower:{paths:[{type:"positive",data:"M-4.688-30.28c22.396 0 34.636-.262 36.72-.782 5.728-1.563 8.593-5.21 8.593-10.938H50v97.656c0 2.604-1.302 4.167-3.906 4.688-5.21.52-21.355.78-48.438.78-23.958 0-38.54-.26-43.75-.78-2.604 0-3.906-1.302-3.906-3.906v-82.032c0-3.646 1.302-5.468 3.906-5.468h2.344c2.604.52 15.625.78 39.063.78z"}],bounds:{x:0,y:0,width:100,height:103.124},origin:{x:50,y:42},align:"left"},PodatusUpper:{paths:[{type:"positive",data:"M-46.094-63.78c13.542 0 24.61 2.473 33.203 7.42C-4.298-51.41 0-43.99 0-34.093V62h-9.375c0-10.938-2.604-19.14-7.812-24.61-5.21-5.468-14.844-8.203-28.907-8.202-18.23 0-33.333 4.166-45.312 12.5v-75.782c0-19.79 15.104-29.687 45.312-29.687z"}],bounds:{x:0,y:0,width:91.406,height:125.781},origin:{x:91.406,y:63.781},align:"right"},Porrectus1:{paths:[{type:"positive",data:"M233.594 162.875c-58.855 0-107.032-6.25-144.53-18.75C34.895 125.895-11.46 99.855-50 66V-52.75C-21.354-24.625 26.302 6.885 92.97 41.78 123.697 57.928 163.54 66 212.5 66c21.354 0 34.635-9.896 39.844-29.688V151.94c0 7.29-6.25 10.937-18.75 10.937z"}],bounds:{x:0,y:0,width:302.344,height:215.627},origin:{x:50,y:52.75},align:"left"},Porrectus2:{paths:[{type:"positive",data:"M309.375 259.375c-50.52 0-110.938-22.396-181.25-67.188C48.437 141.667-10.938 94.272-50 50V-68.75C0-3.125 60.417 52.083 131.25 96.875c58.333 36.98 110.677 58.854 157.03 65.625h7.033c16.145 0 26.822-9.896 32.03-29.688v114.844c0 7.812-5.99 11.72-17.968 11.72z"}],bounds:{x:0,y:0,width:377.343,height:328.126},origin:{x:50,y:68.75},align:"left"},Porrectus3:{paths:[{type:"positive",data:"M309.375 355.78c-48.96-16.666-109.115-55.468-180.47-116.405C79.428 198.23 19.793 134.687-50 48.75V-70C20 40 94.104 103.79 135.25 148.063 190 200 230 230 288.28 258.906c4.168 2.083 8.334 3.125 12.5 3.125 12.5 0 21.355-10.937 26.564-32.81v114.06c0 9.376-3.386 14.063-10.156 14.064-2.084 0-4.688-.522-7.813-1.563z"}],bounds:{x:0,y:0,width:377.344,height:427.345},origin:{x:50,y:70},align:"left"},Porrectus4:{paths:[{type:"positive",data:"M350 453.438c-52.754-22.397-120-77.345-201.74-164.844C90.87 227.656 24.784 147.708-50 48.75V-70C-8.84-1.25 58.406 86.51 151.74 193.28c60.868 69.793 119.13 124.22 174.782 163.282 5.797 3.646 11.014 5.47 15.652 5.47 12.173 0 21.45-11.72 27.826-35.157V441.72c0 9.373-3.19 14.06-9.565 14.06-2.9 0-6.377-.78-10.435-2.342z"}],bounds:{x:0,y:0,width:420,height:525.78},origin:{x:50,y:70},align:"left"},PunctumCavum:{paths:[{type:"positive",data:"M0-60.906c33.333 0 50 9.635 50 28.906v94.53C39.062 51.595 22.396 46.126 0 46.126s-39.063 5.47-50 16.406V-32c0-19.27 16.667-28.906 50-28.906z"},{type:"negative",data:"M.08-42.56c9.585.206 20.126.53 27.954 6.822 4.96 3.9 4.71 10.792 4.574 16.482v51.278C22.09 27.066 7.283 26.072.168 26.01c-7.72.23-21.895.935-32.616 4.674.04-19.197-.083-38.395.064-57.59.567-7.5 7.834-12.33 14.62-13.774 5.818-1.498 11.857-1.86 17.844-1.88z"}],bounds:{x:0,y:0,width:100,height:123.438},origin:{x:50,y:60.906},align:"left"},PunctumQuadratum:{paths:[{type:"positive",data:"M0-60.906c33.333 0 50 9.635 50 28.906v94.53C39.062 51.595 22.396 46.126 0 46.126s-39.063 5.47-50 16.406V-32c0-19.27 16.667-28.906 50-28.906z"}],bounds:{x:0,y:0,width:100,height:123.438},origin:{x:50,y:60.906},align:"left"},PunctumQuadratumAscLiquescent:{paths:[{type:"positive",data:"M-50 43.688V-61c4.167 7.292 12.76 10.938 25.78 10.938 9.376 0 20.053-1.563 32.032-4.688C31.773-60.48 45.833-71.677 50-88.344v117.97C43.75 42.645 32.812 51.5 17.187 56.186-.52 61.398-15.886 64-28.906 64-42.97 64-50 57.23-50 43.687z"}],bounds:{x:0,y:0,width:100,height:152.344},origin:{x:50,y:88.344},align:"left"},PunctumQuadratumDesLiquescent:{paths:[{type:"positive",data:"M-50-56.03c0-13.022 7.03-19.532 21.094-19.532 13.02 0 28.385 2.604 46.093 7.812C32.813-63.583 43.75-54.73 50-41.187V76C45.833 59.854 31.77 48.656 7.812 42.406c-11.98-3.125-22.656-4.687-32.03-4.687-13.022 0-21.615 3.905-25.782 11.718v-105.47z"}],bounds:{x:0,y:0,width:100,height:151.562},origin:{x:50,y:75.562},align:"left"},PunctumInclinatum:{paths:[{type:"positive",data:"M0-75.78L50 0 0 75-50 0 0-75.78z"}],bounds:{x:0,y:0,width:100,height:150.78},origin:{x:50,y:75.78},align:"left"},PunctumInclinatumLiquescent:{paths:[{type:"positive",data:"M 0,-53.164 35,-0.117 0,52.383 -35,-0.117 0,-53.164 z"}],bounds:{x:0,y:0,width:100,height:105.546},origin:{x:50,y:53.164},align:"left"},Quilisma:{paths:[{type:"positive",data:"M-50 34.938V-51c5.73 20.833 13.02 31.25 21.875 31.25 7.813 0 12.5-15.625 14.063-46.875 3.645 12.5 6.9 21.224 9.765 26.172s6.9 7.422 12.11 7.422c5.208 0 9.374-14.324 12.5-42.97 5.73 22.917 10.677 34.375 14.843 34.375 5.73 0 10.677-15.885 14.844-47.656v100c0 17.707-3.125 26.56-9.375 26.56-4.688 0-9.115-5.988-13.28-17.968-2.085 21.875-8.074 32.813-17.97 32.813-7.813 0-16.146-7.292-25-21.875-4.688 20.312-10.677 30.47-17.97 30.47-5.207 0-9.244-2.605-12.108-7.814C-48.568 47.698-50 41.708-50 34.938z"}],bounds:{x:0,y:0,width:100,height:150},origin:{x:50,y:89.282},align:"left"},TerminatingAscLiquescent:{paths:[{type:"positive",data:"M-9.375 40.22c0-11.98-4.948-17.97-14.844-17.97-10.936 0-19.53 3.646-25.78 10.938v-53.126c0-6.77 2.604-12.76 7.813-17.968 5.208-5.21 10.677-8.594 16.406-10.157 2.603-.52 5.207-.78 7.81-.78 3.647 0 7.032.78 10.157 2.343C-2.603-43.896 0-39.73 0-34V73.03h-9.375V40.22z"}],bounds:{x:0,y:0,width:49.999,height:121.873},origin:{x:49.999,y:48.843},align:"right"},TerminatingDesLiquescent:{paths:[{type:"positive",data:"M-9.375-48.156V-80.97H0V26.845c0 5.73-2.604 9.896-7.813 12.5-3.125 1.562-6.51 2.343-10.156 2.343-2.603 0-5.207-.26-7.81-.78-5.73-1.563-11.2-4.95-16.407-10.157C-47.398 25.542-50 19.292-50 12v-52.344c6.25 7.292 14.844 10.938 25.78 10.938 9.897 0 14.845-6.25 14.845-18.75z"}],bounds:{x:0,y:0,width:50,height:122.658},origin:{x:50,y:80.97},align:"right"},VerticalEpisemaAbove:{paths:[{type:"positive",data:"M-8-4c2 3 6 4 8 4s6-1 8-4v-52c-2-3-6-4-8-4s-6 1-8 4z"}],bounds:{x:0,y:0,width:16,height:60},origin:{x:8,y:60},align:"left"},VerticalEpisemaBelow:{paths:[{type:"positive",data:"M-8 56c2 3 6 4 8 4s6-1 8-4v-52c-2-3-6-4-8-4s-6 1-8 4z"}],bounds:{x:0,y:0,width:16,height:60},origin:{x:8,y:0},align:"left"},VirgaLong:{paths:[{type:"positive",data:"M50-38v285.156c0 6.77-2.344 10.937-7.03 12.5-1.564 0-2.605-.78-3.126-2.344-.52-1.562-.782-10.156-.782-25.78V54.186C29.168 45.334 16.146 40.907 0 40.907c-22.917 0-39.583 5.208-50 15.624V-38c0-19.27 16.667-28.906 50-28.906S50-57.27 50-38z"}],bounds:{x:0,y:0,width:100,height:326.562},origin:{x:50,y:66.906},align:"left"},VirgaShort:{paths:[{type:"positive",data:"M50-38v211.72c0 7.29-2.344 11.457-7.03 12.5-1.564 0-2.606-.783-3.126-2.345-.52-1.563-.782-10.156-.782-25.78V54.187C29.167 45.332 16.146 40.906 0 40.906c-22.917 0-39.583 5.21-50 15.625V-38c0-19.27 16.667-28.906 50-28.906S50-57.27 50-38z"}],bounds:{x:0,y:0,width:100,height:253.126},origin:{x:50,y:66.906},align:"left"},Virgula:{paths:[{type:"positive",data:"M8.178-55.66c0-22.137 12.092-33.2 36.287-33.2 11.835 0 23.53 5.66 35.108 16.98C91.15-60.547 96.94-41.766 96.94-15.534c0 53.515-31.646 87.487-94.937 101.895-2.048-2.06-3.077-5.146-3.077-9.273 0-1.03.247-1.8.76-2.316 42.71-19.027 64.075-41.678 64.075-67.92 0-11.322-2.325-20.326-6.945-27.016-4.62-6.69-9.52-11.052-14.676-13.11-5.147-2.048-11.836-3.85-20.07-5.403C12.81-39.707 8.18-45.37 8.18-55.66z"}],bounds:{x:0,y:0,width:98.014,height:175.221},origin:{x:1.074,y:88.86},align:"left"}}},function(t,e,i){"use strict";function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function A(t,e){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];this.symbol=t,this.startIndex=e,this.properties=i}Object.defineProperty(e,"__esModule",{value:!0}),e.ChantNotationElement=e.Annotations=e.Annotation=e.DropCap=e.TranslationText=e.AboveLinesText=e.Lyric=e.LyricArray=e.LyricType=e.TextElement=e.CurlyBraceVisualizer=e.RoundBraceVisualizer=e.GlyphVisualizer=e.VirgaLineVisualizer=e.NeumeLineVisualizer=e.DividerLineVisualizer=e.ChantLayoutElement=e.ChantContext=e.TextMeasuringStrategy=e.QuickSvg=e.GlyphCode=void 0;var a=function G(t,e,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var s=Object.getPrototypeOf(t);return null===s?void 0:G(s,e,i)}if("value"in n)return n.value;
var o=n.get;if(void 0!==o)return o.call(i)},r=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),h=i(1),u=i(3),l=i(2),c=i(5),g=e.GlyphCode={None:"None",AcuteAccent:"AcuteAccent",Stropha:"Stropha",StrophaLiquescent:"StrophaLiquescent",BeginningAscLiquescent:"BeginningAscLiquescent",BeginningDesLiquescent:"BeginningDesLiquescent",CustosDescLong:"CustosDescLong",CustosDescShort:"CustosDescShort",CustosLong:"CustosLong",CustosShort:"CustosShort",DoClef:"DoClef",FaClef:"FaClef",Flat:"Flat",Mora:"Mora",Natural:"Natural",OriscusAsc:"OriscusAsc",OriscusDes:"OriscusDes",OriscusLiquescent:"OriscusLiquescent",PodatusLower:"PodatusLower",PodatusUpper:"PodatusUpper",Porrectus1:"Porrectus1",Porrectus2:"Porrectus2",Porrectus3:"Porrectus3",Porrectus4:"Porrectus4",PunctumCavum:"PunctumCavum",PunctumQuadratum:"PunctumQuadratum",PunctumQuadratumAscLiquescent:"PunctumQuadratumAscLiquescent",PunctumQuadratumDesLiquescent:"PunctumQuadratumDesLiquescent",PunctumInclinatum:"PunctumInclinatum",PunctumInclinatumLiquescent:"PunctumInclinatumLiquescent",Quilisma:"Quilisma",Sharp:"Sharp",TerminatingAscLiquescent:"TerminatingAscLiquescent",TerminatingDesLiquescent:"TerminatingDesLiquescent",VerticalEpisemaAbove:"VerticalEpisemaAbove",VerticalEpisemaBelow:"VerticalEpisemaBelow",VirgaLong:"VirgaLong",VirgaShort:"VirgaShort",Virgula:"Virgula",UpperBrace:"UpperBrace"},d=e.QuickSvg={ns:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xlink:"http://www.w3.org/1999/xlink",svg:function(t,e){var i=document.createElementNS(this.ns,"svg");i.setAttribute("xmlns",this.ns),i.setAttribute("version","1.1"),i.setAttributeNS(this.xmlns,"xmlns:xlink",this.xlink),i.setAttribute("width",t),i.setAttribute("height",e);var n=document.createElementNS(this.ns,"defs");return i.appendChild(n),i.defs=n,i.clearNotations=function(){for(i.removeChild(n);i.hasChildNodes();)i.removeChild(i.lastChild);i.appendChild(n)},i},rect:function(t,e){var i=document.createElementNS(this.ns,"rect");return i.setAttribute("width",t),i.setAttribute("height",e),i},line:function(t,e,i,n){var s=document.createElementNS(this.ns,"line");return s.setAttribute("x1",t),s.setAttribute("y1",e),s.setAttribute("x2",i),s.setAttribute("y2",n),s},g:function(){var t=document.createElementNS(this.ns,"g");return t},text:function(){var t=document.createElementNS(this.ns,"text");return t},tspan:function(t){var e=document.createElementNS(this.ns,"tspan");return e.textContent=t,e},use:function(t){var e=document.createElementNS(this.ns,"use");return e.setAttributeNS(this.xlink,"xlink:href","#"+t),e},svgFragmentForGlyph:function(t){for(var e="",i=0;i<t.paths.length;++i){var n=t.paths[i];e+=d.createFragment(n.data?"path":"g",{d:n.data||void 0,fill:"negative"===n.type?"#fff":void 0})}return e},nodesForGlyph:function(t){for(var e=[],i=0;i<t.paths.length;++i){var n=t.paths[i];e.push(d.createNode(n.data?"path":"g",{d:n.data||void 0,fill:"negative"===n.type?"#fff":void 0}))}return e},createNode:function(t,e,i){var n=document.createElementNS(this.ns,t);e&&e.source&&(n.source=e.source,delete e.source);for(var s in e)if(e.hasOwnProperty(s)&&"undefined"!=typeof e[s]){var o=e[s],A=s.match(/^([^:]+):([^:]+)$/);A?n.setAttributeNS(this[A[1]],A[2],o):n.setAttribute(s,o)}if(i)if("string"==typeof i)n.textContent=i;else if(i.constructor===[].constructor)for(var a=0;a<i.length;++a)n.appendChild(i[a]);else n.appendChild(i);return n},createFragment:function(t,e,i){void 0!==i&&null!==i||(i="");var n="<"+t+" ";for(var s in e)e.hasOwnProperty(s)&&"undefined"!=typeof e[s]&&(n+=s+'="'+e[s]+'" ');return n+=">"+i+"</"+t+">"},parseFragment:function(t){var e=document.createElement("svg");if(t){var i=this.g();e.innerHTML="<svg>"+t.replace(/\n/,"").replace(/<(\w+)([^<]+?)\/>/g,"<$1$2></$1>")+"</svg>";for(var n=0,s=e.firstChild.childNodes.length;s>n;n++)i.appendChild(e.firstChild.firstChild);return i}},translate:function(t,e,i){return t.setAttribute("transform","translate("+e+","+i+")"),t},scale:function(t,e,i){return t.setAttribute("transform","scale("+e+","+i+")"),t}},f=e.TextMeasuringStrategy={Svg:0,Canvas:1},p=(e.ChantContext=function(){function t(){var e=arguments.length<=0||void 0===arguments[0]?f.Svg:arguments[0];o(this,t),this.textMeasuringStrategy=e,this.defs={},this.makeDefs=[],this.defsNode=d.createNode("defs"),this.lyricTextSize=16,this.lyricTextFont="'Palatino Linotype', 'Book Antiqua', Palatino, serif",this.lyricTextColor="#000",this.rubricColor="#d00",this.specialCharProperties={"font-family":"'Exsurge Characters'",fill:this.rubricColor},this.textBeforeSpecialChar="",this.textAfterSpecialChar=".",this.specialCharText=function(t){return t},this.fontStyleDictionary={"*":{"font-weight":"bold"},_:{"font-style":"italic"},"^":{fill:this.rubricColor},"%":{"font-variant":"small-caps","font-feature-settings":"'smcp'","-webkit-font-feature-settings":"'smcp'"}},this.alTextSize=this.lyricTextSize,this.alTextFont=this.lyricTextFont,this.alTextColor=this.lyricTextColor,this.alTextStyle="_",this.translationTextSize=this.lyricTextSize,this.translationTextFont=this.lyricTextFont,this.translationTextColor=this.lyricTextColor,this.translationTextStyle="_",this.dropCapTextSize=64,this.dropCapTextFont=this.lyricTextFont,this.dropCapTextColor=this.lyricTextColor,this.dropCapPadding=1,this.annotationTextSize=13,this.annotationTextFont=this.lyricTextFont,this.annotationTextColor=this.lyricTextColor,this.annotationPadding=1,this.minLedgerSeparation=2,this.minSpaceAboveStaff=1,this.minSpaceBelowStaff=2,this.glyphPunctumWidth=u.Glyphs.PunctumQuadratum.bounds.width,this.glyphPunctumHeight=u.Glyphs.PunctumQuadratum.bounds.height,this.maxExtraSpaceInStaffIntervals=.5,this.activeClef=null,this.neumeLineColor="#000",this.staffLineColor="#000",this.dividerLineColor="#000",this.defaultLanguage=new l.Latin,this.canvas=document.createElement("canvas"),this.canvasCtxt=this.canvas.getContext("2d"),this.pixelRatio=window.devicePixelRatio||1,e===f.Svg&&(this.svgTextMeasurer=d.svg(0,0),this.svgTextMeasurer.setAttribute("id","TextMeasurer"),this.svgTextMeasurer.setAttribute("style","position:absolute"),document.body.insertBefore(this.svgTextMeasurer,document.body.firstChild)),this.syllableConnector="-",this.scaleDefs=!0,this.setGlyphScaling(1/16),this.interSyllabicMultiplier=2.5,this.accidentalSpaceMultiplier=2,this.interVerbalMultiplier=1,this.drawGuides=!1,this.drawDebuggingBounds=!0,this.activeNotations=null,this.currNotationIndex=-1,this.condensingTolerance=.3,this.autoColor=!0,this.insertFontsInDoc()}return r(t,[{key:"setFont",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?16:arguments[1];this.lyricTextSize=e,this.lyricTextFont=t,this.alTextSize=e,this.alTextFont=t,this.translationTextSize=e,this.translationTextFont=t,this.dropCapTextSize=4*e,this.dropCapTextFont=t,this.annotationTextSize=2*e/3,this.annotationTextFont=t}},{key:"setRubricColor",value:function(t){this.rubricColor=t,this.specialCharProperties.fill=t,this.fontStyleDictionary["^"].fill=t}},{key:"setScaleDefs",value:function(t){t=!!t,this.scaleDefs!==t&&(this.scaleDefs=t,this.setGlyphScaling(this.glyphScaling))}},{key:"createStyleCss",value:function(){for(var t=["lyric","aboveLinesText","translation","dropCap","annotation"],e="",i=0;i<t.length;++i){var n=1===i?"al":t[i],s=this[n+"TextColor"],o=this[n+"TextFont"],A=this[n+"TextSize"];e+="."+t[i]+"{fill:"+s+";font-family:"+o+";font-size:"+A+"px;font-kerning:normal}"}return e}},{key:"createStyleNode",value:function(){var t=d.createNode("style",{});return t.textContent=this.createStyleCss(this),t}},{key:"createStyle",value:function(){return"<style>"+this.createStyleCss(this)+"</style>"}},{key:"updateHyphenWidth",value:function(){var t=new C(this,this.syllableConnector,m.SingleSyllable),e=this.minLyricWordSpacing/(this.hyphenWidth||this.minLyricWordSpacing)||1;this.hyphenWidth=t.bounds.width,this.minLyricWordSpacing=e*this.hyphenWidth}},{key:"setGlyphScaling",value:function(t){for(this.glyphScaling=t,this.staffInterval=this.glyphPunctumWidth*this.glyphScaling,this.staffLineWeight=Math.round(this.staffInterval/8),this.neumeLineWeight=this.staffLineWeight,this.dividerLineWeight=this.neumeLineWeight,this.episemaLineWeight=1.25*this.neumeLineWeight,this.updateHyphenWidth(),this.intraNeumeSpacing=this.staffInterval/2;this.defsNode.firstChild;)this.defsNode.removeChild(this.defsNode.firstChild);for(var e=0;e<this.makeDefs.length;++e)this.makeDefs[e]()}},{key:"calculateHeightFromStaffPosition",value:function(t){return-t*this.staffInterval}},{key:"insertFontsInDoc",value:function(){var t=document.getElementById("exsurge-fonts");null===t&&(t=document.createElement("style"),t.id="exsurge-fonts",t.appendChild(document.createTextNode("@font-face{font-family: 'Exsurge Characters';font-weight: normal;font-style: normal;src: url("+c+") format('opentype');}")),document.head.appendChild(t))}},{key:"findNextNeume",value:function(){if("undefined"==typeof this.currNotationIndex)throw"findNextNeume() called without a valid currNotationIndex set";for(var t=this.currNotationIndex+1;t<this.notations.length;t++){var e=this.notations[t];if(e.isNeume&&!e.hasNoWidth)return e}return null}},{key:"setCanvasSize",value:function(t,e){var i=arguments.length<=2||void 0===arguments[2]?1:arguments[2];this.canvas.style.width=t*i+"px",this.canvas.style.height=e*i+"px",i*=this.pixelRatio,this.canvas.width=t*i,this.canvas.height=e*i,this.canvasCtxt.setTransform(i,0,0,i,0,0)}}]),t}(),e.ChantLayoutElement=function(){function t(){o(this,t),this.bounds=new h.Rect,this.origin=new h.Point(0,0),this.selected=!1,this.highlighted=!1}return r(t,[{key:"draw",value:function(t){throw"ChantLayout Elements must implement draw(ctxt)"}},{key:"createSvgNode",value:function(t){throw"ChantLayout Elements must implement createSvgNode(ctxt)"}},{key:"createSvgFragment",value:function(t){throw"ChantLayout Elements must implement createSvgFragment(ctxt)"}}]),t}()),y=(e.DividerLineVisualizer=function(t){function e(t,i,s){o(this,e);var A=n(this,Object.getPrototypeOf(e).call(this)),a=t.calculateHeightFromStaffPosition(i),r=t.calculateHeightFromStaffPosition(s);if(a>r){var h=a;a=r,r=h}return A.bounds.x=0,A.bounds.y=a,A.bounds.width=t.dividerLineWeight,A.bounds.height=r-a,A.origin.x=A.bounds.width/2,A.origin.y=a,A}return s(e,t),r(e,[{key:"draw",value:function(t){var e=t.canvasCtxt;e.fillStyle=t.dividerLineColor,e.fillRect(this.bounds.x,this.bounds.y,t.dividerLineWeight,this.bounds.height)}},{key:"createSvgNode",value:function(t){return d.createNode("rect",{x:this.bounds.x,y:this.bounds.y,width:t.dividerLineWeight,height:this.bounds.height,fill:t.dividerLineColor,"class":"dividerLine"})}},{key:"createSvgFragment",value:function(t){return d.createFragment("rect",{x:this.bounds.x,y:this.bounds.y,width:t.dividerLineWeight,height:this.bounds.height,fill:t.dividerLineColor,"class":"dividerLine"})}}]),e}(p),e.NeumeLineVisualizer=function(t){function e(t,i,s,A){o(this,e);var a=n(this,Object.getPrototypeOf(e).call(this)),r=i.staffPosition,h=s.staffPosition;if(h>r){var u=r;r=h,h=u}var l=t.calculateHeightFromStaffPosition(r),c=0;return A&&(r-h===1&&Math.abs(r)%2===1&&h>-3&&h--,c+=t.glyphPunctumHeight*t.glyphScaling/2.2),c+=t.calculateHeightFromStaffPosition(h),a.bounds.x=0,a.bounds.y=l,a.bounds.width=t.neumeLineWeight,a.bounds.height=c-l,a.origin.x=0,a.origin.y=0,a}return s(e,t),r(e,[{key:"draw",value:function(t){var e=t.canvasCtxt;e.fillStyle=t.neumeLineColor,e.fillRect(this.bounds.x,this.bounds.y,t.neumeLineWeight,this.bounds.height)}},{key:"createSvgNode",value:function(t){return d.createNode("rect",{x:this.bounds.x,y:this.bounds.y,width:t.neumeLineWeight,height:this.bounds.height,fill:t.neumeLineColor,"class":"neumeLine"})}},{key:"createSvgFragment",value:function(t){return d.createFragment("rect",{x:this.bounds.x,y:this.bounds.y,width:t.neumeLineWeight,height:this.bounds.height,fill:t.neumeLineColor,"class":"neumeLine"})}}]),e}(p),e.VirgaLineVisualizer=function(t){function e(t,i){o(this,e);var s,A=n(this,Object.getPrototypeOf(e).call(this)),a=i.staffPosition,r=t.calculateHeightFromStaffPosition(a);return s=0===Math.abs(a%2)?r+1.8*t.staffInterval:r+2.7*t.staffInterval,A.bounds.x=0,A.bounds.y=r,A.bounds.width=t.neumeLineWeight,A.bounds.height=s-r,A.origin.x=0,A.origin.y=0,A}return s(e,t),r(e,[{key:"draw",value:function(t){var e=t.canvasCtxt;e.fillStyle=t.neumeLineColor,e.fillRect(this.bounds.x,this.bounds.y,t.neumeLineWeight,this.bounds.height)}},{key:"createSvgNode",value:function(t){return d.createNode("rect",{x:this.bounds.x,y:this.bounds.y,width:t.neumeLineWeight,height:this.bounds.height,fill:t.neumeLineColor,"class":"neumeLine"})}},{key:"createSvgFragment",value:function(t){return d.createFragment("rect",{x:this.bounds.x,y:this.bounds.y,width:t.neumeLineWeight,height:this.bounds.height,fill:t.neumeLineColor,"class":"neumeLine"})}}]),e}(p),e.GlyphVisualizer=function(t){function e(t,i){o(this,e);var s=n(this,Object.getPrototypeOf(e).call(this));return s.glyph=null,s.setGlyph(t,i),s}return s(e,t),r(e,[{key:"setGlyph",value:function(t,e){var i=this;if(this.glyphCode!==e){if("undefined"==typeof e||null===e||""===e?this.glyphCode=g.None:this.glyphCode=e,this.glyph=u.Glyphs[this.glyphCode],!t.defs.hasOwnProperty(this.glyphCode)){var n=function(){var e={id:i.glyphCode,"class":"glyph"};t.scaleDefs===!0&&(e.transform="scale("+t.glyphScaling+")"),t.defs[i.glyphCode]=d.createFragment("g",e,d.svgFragmentForGlyph(i.glyph)),t.defsNode.appendChild(d.createNode("g",e,d.nodesForGlyph(i.glyph)))};n(),t.makeDefs.push(n)}this.align=this.glyph.align,this.origin.x=this.glyph.origin.x*t.glyphScaling,this.origin.y=this.glyph.origin.y*t.glyphScaling,this.bounds.x=0,this.bounds.y=-this.origin.y,this.bounds.width=this.glyph.bounds.width*t.glyphScaling,this.bounds.height=this.glyph.bounds.height*t.glyphScaling}}},{key:"setStaffPosition",value:function(t,e){this.bounds.y+=t.calculateHeightFromStaffPosition(e)}},{key:"draw",value:function(t){var e=t.canvasCtxt,i=this.bounds.x+this.origin.x,n=this.bounds.y+this.origin.y;e.translate(i,n),e.scale(t.glyphScaling,t.glyphScaling);for(var s=0;s<this.glyph.paths.length;s++){var o=this.glyph.paths[s];e.fillStyle="negative"===o.type?"#fff":t.neumeLineColor,e.fill(new Path2D(o.data))}e.scale(1/t.glyphScaling,1/t.glyphScaling),e.translate(-i,-n)}},{key:"getSvgAttributes",value:function(t,e){var i={"source-index":e.sourceIndex,"xlink:href":"#"+this.glyphCode};return t.scaleDefs===!0?(i.x=this.bounds.x+this.origin.x,i.y=this.bounds.y+this.origin.y):(i.x=(this.bounds.x+this.origin.x)/t.glyphScaling,i.y=(this.bounds.y+this.origin.y)/t.glyphScaling,i.transform="scale("+t.glyphScaling+")"),i}},{key:"createSvgNode",value:function(t,e){var i=this.getSvgAttributes(t,e);return i.source=e,d.createNode("use",i)}},{key:"createSvgFragment",value:function(t,e){return d.createFragment("use",this.getSvgAttributes(t,e))}}]),e}(p)),B=(e.RoundBraceVisualizer=function(t){function e(t,i,s,A,a){o(this,e);var r=n(this,Object.getPrototypeOf(e).call(this));if(i>s){var u=i;i=s,s=u}return r.isAbove=a,r.braceHeight=3*t.staffInterval/2,r.bounds=new h.Rect(i,a?A-r.braceHeight:A,s-i,r.braceHeight),r.origin.x=0,r.origin.y=0,r}return s(e,t),r(e,[{key:"createSvgNode",value:function(t){var e=d.createNode("path",{d:this.generatePathString(),stroke:t.neumeLineColor,"stroke-width":t.staffLineWeight+"px",fill:"none","class":"brace"});return this.acuteAccent?d.createNode("g",{"class":"accentedBrace"},[e,this.acuteAccent.createSvgNode(t)]):e}},{key:"createSvgFragment",value:function(t){var e=d.createFragment("path",{d:this.generatePathString(),stroke:t.neumeLineColor,"stroke-width":t.staffLineWeight+"px",fill:"none","class":"brace"});return this.acuteAccent?(e+=this.acuteAccent.createSvgFragment(t),d.createFragment("g",{"class":"accentedBrace"},e)):e}},{key:"generatePathString",value:function(){var t,e,i,n=this.bounds.x,s=this.bounds.right(),o=this.bounds.width;e=o/6,i=this.bounds.height,this.isAbove?(t=this.bounds.bottom(),i=-i):t=this.bounds.y;var A=n+e,a=t+i,r=s-e,h=2;return"M "+n.toFixed(h)+" "+t.toFixed(h)+" C "+A.toFixed(h)+" "+a.toFixed(h)+" "+r.toFixed(h)+" "+a.toFixed(h)+" "+s.toFixed(h)+" "+t.toFixed(h)}}]),e}(p),e.CurlyBraceVisualizer=function(t){function e(t,i,s,A){var a=arguments.length<=4||void 0===arguments[4]?!0:arguments[4],r=arguments.length<=5||void 0===arguments[5]?!1:arguments[5];o(this,e);var u=n(this,Object.getPrototypeOf(e).call(this));if(i>s){var l=i;i=s,s=l}u.isAbove=a,u.braceHeight=t.staffInterval/2,a&&(A-=u.braceHeight);var c=new h.Rect(i,A,s-i,u.braceHeight);return r&&a&&(u.acuteAccent=new y(t,g.AcuteAccent),u.acuteAccent.bounds.x+=c.x+(s-i)/2,u.acuteAccent.bounds.y+=c.y-t.staffInterval/4,c.union(u.acuteAccent.bounds)),u.bounds=c,u.origin.x=0,u.origin.y=0,u}return s(e,t),r(e,[{key:"createSvgNode",value:function(t){var e=d.createNode("path",{d:this.generatePathString(),stroke:t.neumeLineColor,"stroke-width":t.staffLineWeight+"px",fill:"none","class":"brace"});return this.acuteAccent?d.createNode("g",{"class":"accentedBrace"},[e,this.acuteAccent.createSvgFragment(t)]):e}},{key:"createSvgFragment",value:function(t){var e=d.createFragment("path",{d:this.generatePathString(),stroke:t.neumeLineColor,"stroke-width":t.staffLineWeight+"px",fill:"none","class":"brace"});return this.acuteAccent?(e+=this.acuteAccent.createSvgFragment(t),d.createFragment("g",{"class":"accentedBrace"},e)):e}},{key:"generatePathString",value:function(){var t,e,i=.6,n=this.bounds.x,s=this.bounds.right(),o=this.bounds.width;this.isAbove?(t=this.bounds.bottom(),e=-this.braceHeight):(t=this.bounds.y,e=this.braceHeight);var A=t+i*e,a=n+.25*o,r=t+(1-i)*e,h=n+.5*o,u=t+e,l=t+i*e,c=n+.75*o,g=t+(1-i)*e,d=2;return"M "+n.toFixed(d)+" "+t.toFixed(d)+" Q "+n.toFixed(d)+" "+A.toFixed(d)+" "+a.toFixed(d)+" "+r.toFixed(d)+" T "+h.toFixed(d)+" "+u.toFixed(d)+" M "+s.toFixed(d)+" "+t.toFixed(d)+" Q "+s.toFixed(d)+" "+l.toFixed(d)+" "+c.toFixed(d)+" "+g.toFixed(d)+" T "+h.toFixed(d)+" "+u.toFixed(d)}}]),e}(p),function(t,e){"undefined"!=typeof e&&null!==e||(e={}),this.text=t,this.properties=e});A.createStackFrame=function(t,e,i){return new A(e,i,t.fontStyleDictionary[e])};var v={"&":"&","<":"<",">":">"},b=e.TextElement=function(t){function e(t,i,s,A,a,r){o(this,e);var h=n(this,Object.getPrototypeOf(e).call(this));return h.bounds.x=0,h.bounds.y=0,h.bounds.width=0,h.bounds.height=0,h.origin.x=0,h.origin.y=0,h.fontFamily=s,h.fontSize=A,h.textAnchor=a,h.sourceIndex=r,h.dominantBaseline="baseline",h.generateSpansFromText(t,i),h.recalculateMetrics(t),h}return s(e,t),r(e,[{key:"generateSpansFromText",value:function(t,e){var i=this;if(e=e.replace(/\s+/g," "),this.text="",this.spans=[],"*"===e||"†"===e)return void this.spans.push(new B(e));for(var n=[],s=0,o=function(t,e){return t.Symbol===e},a=function(t,e){if(""!==t||i.dropCap){i.text+=t;for(var s={},o=0;o<n.length;o++)Object.assign(s,n[o].properties);e&&Object.assign(s,e),i.spans.push(new B(t,s))}},r=/\\?([arv])(?:bar|\/\.)|([*_^%])(?=(?:(.+?)\2)?)/gi,h=null;h=r.exec(e);){var u=h[2];if(h[1])a(t.textBeforeSpecialChar+t.specialCharText(h[1])+t.textAfterSpecialChar,t.specialCharProperties);else if(0===n.length){if("*"===u&&!h[3])continue;a(e.substring(s,h.index)),n.push(A.createStackFrame(t,u,h.index))}else if(n[n.length-1].symbol===u)a(e.substring(s,h.index)),n.pop();else{if(n.filter(o).length>0){s=n[n.length-1].startIndex,n.pop();continue}if("*"===u&&!h[3])continue;a(e.substring(s,h.index)),n.push(A.createStackFrame(t,u,h.index))}s=h.index+h[0].length}s<e.length&&a(e.substring(s,e.length)),0===this.spans.length&&a(e)}},{key:"getCanvasFontForProperties",value:function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],e="";return"italic"===t["font-style"]&&(e+="italic "),"small-caps"===t["font-variant"]&&(e+="small-caps "),"bold"===t["font-weight"]&&(e+="bold "),e+=(t["font-size"]||this.fontSize*(this.resize||1)+"px")+" ",e+=t["font-family"]||this.fontFamily}},{key:"measureSubstring",value:function(t,e){if(0===e)return 0;if(e||(e=1/0),0>e){var i=-e;e=1/0}for(var n=t.canvasCtxt,s=0,o=[],A=[this.spans[0]],a=0,r=0;r<this.spans.length;r++){var h=this.spans[r],u=h.text.slice(0,e-a);if(h.properties.newLine){if(i||this.rightAligned!==!0||e!==1/0){if(0===--i)break}else A[A.length-1].properties.xOffset=this.firstLineMaxWidth-s,A.push(h);o.push(s),s=0}n.font=this.getCanvasFontForProperties(h.properties);var l=n.measureText(u,this.bounds.x,this.bounds.y);if(s+=l.width,a+=u.length,a===e)break}return!i&&s&&A.length&&this.rightAligned===!0&&e===1/0&&(A[A.length-1].properties.xOffset=this.firstLineMaxWidth-s),Math.max.apply(Math,[s].concat(o))}},{key:"recalculateMetrics",value:function(t){if(this.bounds.x=0,this.bounds.y=0,this.origin.x=0,t.textMeasuringStrategy===f.Svg){for(;t.svgTextMeasurer.firstChild;)t.svgTextMeasurer.removeChild(t.svgTextMeasurer.firstChild);t.svgTextMeasurer.appendChild(this.createSvgNode(t)),t.svgTextMeasurer.appendChild(t.createStyleNode());var e=t.svgTextMeasurer.firstChild.getBBox();this.bounds.width=e.width,this.bounds.height=e.height,this.origin.y=-e.y}else if(t.textMeasuringStrategy===f.Canvas){var i=this.spans.reduce(function(t,e){return t+(e.properties.newLine?1:0)},1);this.bounds.width=this.measureSubstring(t,this.rightAligned?-1:void 0),this.bounds.height=this.fontSize*Math.min(1,i+.2),this.origin.y=this.fontSize}}},{key:"setMaxWidth",value:function(t,e){var i=arguments.length<=2||void 0===arguments[2]?e:arguments[2];if(this.spans.filter(function(t){return t.properties.newLine}).length&&this.recalculateMetrics(t),this.bounds.width>e){this.maxWidth=e;var n=e/this.bounds.width;if(n>=.85)this.resize=n,console.info(n,this.text);else{0>i&&(i=e),this.firstLineMaxWidth=i;for(var s,o=0,A=null,a=/\s+|$/g,r=i;(s=a.exec(this.text))&&(!A||s.index>A.index);){var h=this.measureSubstring(t,s.index);if(h>r&&A){for(var u,l=0,c=0;c<A.index&&l<this.spans.length;){var g=this.spans[l++];c+=g.text.length+(g.properties.newLine?1:0)}if(c>A.index){var d=this.spans[--l];c-=d.text.length}var f=this.spans[l],p=f.text.slice(0,A.index-c),y=f.text.slice(A.index+A[0].length-c),v=[];if(this.rightAligned=r===i&&i!==e,p&&v.push(new B(p,f.properties)),y?v.push(new B(y,Object.assign({},f.properties,{newLine:!0}))):this.spans[l+1]&&(this.spans[l+1].properties.newLine=!0),(u=this.spans).splice.apply(u,[l,1].concat(v)),this.needsLayout=!0,r=e,s.index===this.text.length||this.measureSubstring(t)<=e)break;h=0,s=A=null}o=h,A=s}}this.recalculateMetrics(t,!1)}}},{key:"getCssClasses",value:function(){return""}},{key:"getExtraStyleProperties",value:function(t){return{}}},{key:"draw",value:function(t){var e=t.canvasCtxt;"middle"===this.textAnchor?e.textAlign="center":e.textAlign="start";for(var i=0,n=0,s=0;s<this.spans.length;s++){var o=this.spans[s],A=o.properties.xOffset||0;o.properties.newLine?(e.translate(i+A,this.fontSize),i=-A,n-=this.fontSize):A&&(e.translate(i+A,0),i=-A);var a=Object.assign({},this.getExtraStyleProperties(t),o.properties);e.font=this.getCanvasFontForProperties(a),e.fillStyle=a.fill||"#000",e.fillText(o.text,this.bounds.x,this.bounds.y,o.properties.textLength||void 0);var r=e.measureText(o.text,this.bounds.x,this.bounds.y);i-=r.width,e.translate(r.width,0)}e.translate(i,n)}},{key:"createSvgNode",value:function(t){for(var e=[],i=0;i<this.spans.length;i++){var n=this.spans[i],s={};if(s.style=(0,h.getCssForProperties)(n.properties),n.properties.newLine){var o=n.properties.xOffset||0;s.dy="1em",s.x=this.bounds.x+o}else n.properties.xOffset&&(s.x=this.bounds.x+n.properties.xOffset);n.properties.textLength&&(s.textLength=n.properties.textLength,s.lengthAdjust="spacingAndGlyphs",s.y=this.bounds.y),this.resize&&(s["font-size"]=n.properties["font-size"]||this.fontSize*this.resize),e.push(d.createNode("tspan",s,n.text))}var A=(0,h.getCssForProperties)(this.getExtraStyleProperties(t));return d.createNode("text",{source:this,"source-index":this.sourceIndex,x:this.bounds.x,y:this.bounds.y,"class":this.getCssClasses().trim(),"text-anchor":this.textAnchor,style:A},e)}},{key:"createSvgFragment",value:function(t){for(var i="",n=0;n<this.spans.length;n++){var s=this.spans[n],o={};if(o.style=(0,h.getCssForProperties)(s.properties),s.properties.newLine){var A=s.properties.xOffset||0;o.dy="1em",o.x=this.bounds.x+A}else s.properties.xOffset&&(o.x=this.bounds.x+s.properties.xOffset);s.properties.textLength&&(o.textLength=s.properties.textLength,o.lengthAdjust="spacingAndGlyphs",o.y=this.bounds.y),this.resize&&(o["font-size"]=s.properties["font-size"]||this.fontSize*this.resize),i+=d.createFragment("tspan",o,e.escapeForTspan(s.text))}var a=(0,h.getCssForProperties)(this.getExtraStyleProperties(t));return d.createFragment("text",{"source-index":this.sourceIndex,x:this.bounds.x,y:this.bounds.y,"class":this.getCssClasses().trim(),"text-anchor":this.textAnchor,style:a},i)}}],[{key:"escapeForTspan",value:function(t){return String(t).replace(/[&<>]/g,function(t){return v[t]})}}]),e}(p),m=e.LyricType={SingleSyllable:0,BeginningSyllable:1,MiddleSyllable:2,EndingSyllable:3,Directive:4},C=(e.LyricArray={getLeft:function(t){if(0===t.length)return NaN;for(var e=Number.MAX_VALUE,i=0;i<t.length;i++)t[i]&&(e=Math.min(e,t[i].notation.bounds.x+t[i].bounds.x));return e},getRight:function(t,e){if(0===t.length)return NaN;for(var i=Number.MIN_VALUE,n=0;n<t.length;n++){var s=t[n];s&&(i=Math.max(i,s.notation.bounds.x+s.bounds.x+s.bounds.width+(e&&s.allowsConnector()&&!s.needsConnector?s.getConnectorWidth():0)))}return i},hasOnlyOneLyric:function(t){return 1===t.filter(function(t){return t.originalText}).length},indexOfLyric:function(t){return t.indexOf(t.filter(function(t){return t.originalText})[0])},mergeIn:function(t,e){for(var i=0;i<e.length;++i)!e[i].originalText&&t[i]||(t[i]=e[i])},mergeInArray:function(t,e){for(var i=0;i<e.length;++i)this.mergeIn(t,e[i].lyrics)},setNotation:function(t,e){e.lyrics=t;for(var i=0;i<t.length;++i)t[i].notation=e}},e.Lyric=function(t){function e(t,i,s,A,a,r){o(this,e);var h=n(this,Object.getPrototypeOf(e).call(this,t,(t.lyricTextStyle||"")+i,t.lyricTextFont,t.lyricTextSize,"start",r));return h.originalText=i,h.notation=A,h.notations=a,"undefined"==typeof s||null===s||""===s?h.lyricType=m.SingleSyllable:h.lyricType=s,h.centerStartIndex=-1,h.centerLength=i.length,h.needsConnector=!1,h.language=null,h.allowsConnector&&(h.connectorSpan=new B(t.syllableConnector)),h}return s(e,t),r(e,[{key:"allowsConnector",value:function(){return this.lyricType===m.BeginningSyllable||this.lyricType===m.MiddleSyllable}},{key:"setForceConnector",value:function(t){this.forceConnector=t&&this.allowsConnector()}},{key:"setNeedsConnector",value:function(t,e){if(t===!0||this.forceConnector)this.needsConnector=!0,"undefined"!=typeof e?this.setConnectorWidth(e):this.bounds.width=this.widthWithoutConnector+this.getConnectorWidth(),this.spans.length>0&&this.spans[this.spans.length-1]!==this.connectorSpan&&this.spans.push(this.connectorSpan);else{this.connectorWidth=0,this.needsConnector=!1,this.bounds.width=this.widthWithoutConnector;var i=this.spans.pop();i&&i!==this.connectorSpan&&this.spans.push(i)}}},{key:"setConnectorWidth",value:function(t){this.connectorWidth=t,this.connectorSpan.properties.textLength=t,this.needsConnector&&(this.bounds.width=this.widthWithoutConnector+this.getConnectorWidth())}},{key:"getConnectorWidth",value:function(){return this.connectorWidth||this.defaultConnectorWidth}},{key:"generateSpansFromText",value:function(t,i){a(Object.getPrototypeOf(e.prototype),"generateSpansFromText",this).call(this,t,i)}},{key:"getLeft",value:function(){return this.notation.bounds.x+this.bounds.x}},{key:"getRight",value:function(t){return this.notation.bounds.x+this.bounds.x+this.bounds.width}},{key:"recalculateMetrics",value:function(t){var i=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];i&&(delete this.maxWidth,delete this.firstLineMaxWidth,delete this.rightAligned,delete this.resize,this.spans.forEach(function(t){delete t.properties.xOffset,t.properties.newLine&&(delete t.properties.newLine,t.text=" "+t.text)})),a(Object.getPrototypeOf(e.prototype),"recalculateMetrics",this).call(this,t),this.widthWithoutConnector=this.bounds.width,this.connectorWidth=0,this.defaultConnectorWidth=t.hyphenWidth,this.setNeedsConnector();var n,s,o=this.language||t.defaultLanguage,A=this.widthWithoutConnector/2;if(this.centerStartIndex>=0&&(this.centerStartIndex>=this.text.length||this.centerLength<0||this.centerStartIndex+this.centerLength>this.text.length)&&(this.centerStartIndex=-1),0===this.text.length)this.dropCap&&this.originalText&&(A=t.hyphenWidth/2);else if(this.centerStartIndex>=0)t.textMeasuringStrategy===f.Svg?(n=t.svgTextMeasurer.firstChild.getSubStringLength(0,this.centerStartIndex),s=t.svgTextMeasurer.firstChild.getSubStringLength(0,this.centerStartIndex+this.centerLength)):t.textMeasuringStrategy===f.Canvas&&(n=this.measureSubstring(t,this.centerStartIndex),s=this.measureSubstring(t,this.centerStartIndex+this.centerLength)),A=n+(s-n)/2;else if(this.lyricType!==m.Directive){var r=this.text.lastIndexOf(" ")+1;r>0&&!this.text.slice(r).match(/[a-záéíóúýäëïöüÿàèìòùỳāēīōūȳăĕĭŏŭ]/i)&&(r=0);var h=o.findVowelSegment(this.text,r);if(h.found!==!0){var u=this.text.slice(r).match(/[a-z]+/i);u?(h.startIndex=r+u.index,h.length=u[0].length):(h.startIndex=r,h.length=this.text.length-r)}t.textMeasuringStrategy===f.Svg?(n=t.svgTextMeasurer.firstChild.getSubStringLength(0,h.startIndex),s=t.svgTextMeasurer.firstChild.getSubStringLength(0,h.startIndex+h.length)):t.textMeasuringStrategy===f.Canvas&&(n=this.measureSubstring(t,h.startIndex),s=this.measureSubstring(t,h.startIndex+h.length)),A=n+(s-n)/2}this.bounds.x=-A,this.bounds.y=0,this.origin.x=A}},{key:"generateDropCap",value:function(t){if(this.dropCap)return this.dropCap;var e=this.dropCap=new w(t,this.originalText.substring(0,1),this.sourceIndex);return this.sourceIndex++,this.generateSpansFromText(t,this.originalText.substring(1)),this.centerStartIndex--,e}},{key:"getCssClasses",value:function(){var t="lyric ";return this.lyricType===m.Directive&&(t+="directive "),t+a(Object.getPrototypeOf(e.prototype),"getCssClasses",this).call(this)}},{key:"getExtraStyleProperties",value:function(t){var i=a(Object.getPrototypeOf(e.prototype),"getExtraStyleProperties",this).call(this);return this.lyricType===m.Directive&&t.autoColor===!0&&(i=Object.assign({},i,{fill:t.rubricColor})),i}},{key:"createSvgNode",value:function(t){return a(Object.getPrototypeOf(e.prototype),"createSvgNode",this).call(this,t)}},{key:"createSvgFragment",value:function(t){return a(Object.getPrototypeOf(e.prototype),"createSvgFragment",this).call(this,t)}}]),e}(b)),w=(e.AboveLinesText=function(t){function e(t,i,s){o(this,e);var A=n(this,Object.getPrototypeOf(e).call(this,t,(t.alTextStyle||"")+i,t.alTextFont,t.alTextSize,"start",s));return A.padding=t.staffInterval/2,A}return s(e,t),r(e,[{key:"getCssClasses",value:function(){return"aboveLinesText "+a(Object.getPrototypeOf(e.prototype),"getCssClasses",this).call(this)}}]),e}(b),e.TranslationText=function(t){function e(t,i,s){o(this,e);var A="start";"/"===i?(i="",A="end"):i=(t.translationTextStyle||"")+i;var a=n(this,Object.getPrototypeOf(e).call(this,t,i,t.translationTextFont,t.translationTextSize,A,s));return a.padding=t.staffInterval/2,a}return s(e,t),r(e,[{key:"getCssClasses",value:function(){return"translation "+a(Object.getPrototypeOf(e.prototype),"getCssClasses",this).call(this)}}]),e}(b),e.DropCap=function(t){function e(t,i,s){o(this,e);var A=n(this,Object.getPrototypeOf(e).call(this,t,i,(t.dropCapTextStyle||"")+t.dropCapTextFont,t.dropCapTextSize,"middle",s));return A.padding=t.staffInterval*t.dropCapPadding,A}return s(e,t),r(e,[{key:"getCssClasses",value:function(){return"dropCap "+a(Object.getPrototypeOf(e.prototype),"getCssClasses",this).call(this)}}]),e}(b)),x=e.Annotation=function(t){function e(t,i){o(this,e);var s=n(this,Object.getPrototypeOf(e).call(this,t,(t.annotationTextStyle||"")+i,t.annotationTextFont,t.annotationTextSize,"middle"));
return s.padding=t.staffInterval*t.annotationPadding,s.dominantBaseline="hanging",s}return s(e,t),r(e,[{key:"getCssClasses",value:function(){return"annotation "+a(Object.getPrototypeOf(e.prototype),"getCssClasses",this).call(this)}}]),e}(b);e.Annotations=function(t){function e(t){o(this,e);for(var i=n(this,Object.getPrototypeOf(e).call(this)),s=arguments.length,A=Array(s>1?s-1:0),a=1;s>a;a++)A[a-1]=arguments[a];return i.annotations=A.map(function(e){return new x(t,e)}),i.padding=Math.max.apply(null,i.annotations.map(function(t){return t.padding})),i}return s(e,t),r(e,[{key:"updateBounds",value:function(t){t||(t=1);for(var e=0;e<this.annotations.length;++e){var i=this.annotations[e];i.bounds.x+=this.bounds.x*t,i.bounds.y+=this.bounds.y*t}}},{key:"recalculateMetrics",value:function(t){this.bounds.x=0,this.bounds.y=0,this.bounds.width=0,this.bounds.height=0,this.origin.x=0,this.origin.y=0;for(var e=0;e<this.annotations.length;++e){var i=this.annotations[e];i.recalculateMetrics(t),this.bounds.width=Math.max(this.bounds.width,i.bounds.width),i.bounds.y+=this.bounds.height,this.bounds.height+=i.bounds.height/1.2,this.origin.y=this.origin.y||i.origin.y}}},{key:"draw",value:function(t){this.updateBounds(),this.annotations.forEach(function(e){e.draw(t)}),this.updateBounds(-1)}},{key:"createSvgNode",value:function(t){this.updateBounds();var e=this.annotations.map(function(e){return e.createSvgNode(t)});return this.updateBounds(-1),e}},{key:"createSvgFragment",value:function(t){this.updateBounds();var e=this.annotations.map(function(e){return e.createSvgFragment(t)}).join("");return this.updateBounds(-1),e}}]),e}(p),e.ChantNotationElement=function(t){function e(){o(this,e);var t=n(this,Object.getPrototypeOf(e).call(this));return t.leadingSpace=0,t.trailingSpace=-1,t.keepWithNext=!1,t.needsLayout=!0,t.lyrics=[],t.score=null,t.line=null,t.visualizers=[],t}return s(e,t),r(e,[{key:"hasLyrics",value:function(){return 0!==this.lyrics.length}},{key:"getAllLyricsLeft",value:function(){if(0===this.lyrics.length)return this.bounds.right();for(var t=Number.MAX_VALUE,e=0;e<this.lyrics.length;e++)this.lyrics[e]&&(t=Math.min(t,this.lyrics[e].bounds.x));return this.bounds.x+t}},{key:"getAllLyricsRight",value:function(){if(0===this.lyrics.length)return this.bounds.x;for(var t=Number.MIN_VALUE,e=0;e<this.lyrics.length;e++)this.lyrics[e]&&(t=Math.max(t,this.lyrics[e].bounds.x+this.lyrics[e].bounds.width));return this.bounds.x+t}},{key:"addVisualizer",value:function(t){t.ignoreBounds||(this.bounds.isEmpty()?this.bounds=t.bounds.clone():this.bounds.union(t.bounds)),this.visualizers.push(t)}},{key:"prependVisualizer",value:function(t){this.bounds.isEmpty()?this.bounds=t.bounds.clone():this.bounds.union(t.bounds),this.visualizers.unshift(t)}},{key:"performLayout",value:function(t){this.trailingSpace<0&&(this.trailingSpace=t.intraNeumeSpacing*t.interSyllabicMultiplier),this.visualizers=[],this.bounds=new h.Rect(1/0,1/0,-(1/0),-(1/0));for(var e=0;e<this.lyrics.length;e++)this.lyrics[e].recalculateMetrics(t);if(this.alText)for(e=0;e<this.alText.length;e++)this.alText[e].recalculateMetrics(t);if(this.translationText)for(e=0;e<this.translationText.length;e++)this.translationText[e].recalculateMetrics(t)}},{key:"resetDependencies",value:function(){}},{key:"finishLayout",value:function(t){this.bounds.x=0;for(var e=0;e<this.lyrics.length;e++)this.lyrics[e].bounds.x=this.origin.x-this.lyrics[e].origin.x;this.needsLayout=!1}},{key:"draw",value:function(t){var e=t.canvasCtxt;e.translate(this.bounds.x,0);for(var i=0;i<this.visualizers.length;i++)this.visualizers[i].draw(t);for(i=0;i<this.lyrics.length;i++)this.lyrics[i].draw(t);if(this.translationText)for(i=0;i<this.translationText.length;i++)this.translationText[i].draw(t);if(this.alText)for(i=0;i<this.alText.length;i++)this.alText[i].draw(t);e.translate(-this.bounds.x,0)}},{key:"createSvgNode",value:function(t){for(var e=[],i=0;i<this.visualizers.length;i++)e.push(this.visualizers[i].createSvgNode(t,this));for(e.length&&(e=[d.createNode("g",{"class":"Notations"},e)]),i=0;i<this.lyrics.length;i++)e.push(this.lyrics[i].createSvgNode(t));if(this.translationText)for(i=0;i<this.translationText.length;i++)e.push(this.translationText[i].createSvgNode(t));if(this.alText)for(i=0;i<this.alText.length;i++)e.push(this.alText[i].createSvgNode(t));return d.createNode("g",{source:this,"class":"ChantNotationElement "+this.constructor.name,transform:"translate("+this.bounds.x+",0)"},e)}},{key:"createSvgFragment",value:function(t){for(var e="",i=0;i<this.visualizers.length;i++)e+=this.visualizers[i].createSvgFragment(t,this);for(i=0;i<this.lyrics.length;i++)e+=this.lyrics[i].createSvgFragment(t);if(this.translationText)for(i=0;i<this.translationText.length;i++)e+=this.translationText[i].createSvgFragment(t);if(this.alText)for(i=0;i<this.alText.length;i++)e+=this.alText[i].createSvgFragment(t);return d.createFragment("g",{"class":"ChantNotationElement "+this.constructor.name,transform:"translate("+this.bounds.x+",0)"},e)}}]),e}(p)},function(t,e){t.exports="data:font/opentype;base64,AAEAAAATAQAABAAwRFNJRwAAAAEAAENkAAAACEdERUYAbgADAABDbAAAABhHUE9TTxtiswAAQ4QAAAE8R1NVQjtgWB4AAETAAAAAlk9TLzJKLTibAAABuAAAAGBjbWFwCRIK1gAAA4gAAAEEY3Z0IAGGB0cAAAZ0AAAAGmZwZ20GWZw3AAAEjAAAAXNnYXNwABcACAAAQ1QAAAAQZ2x5ZhRQNO4AAAdQAAAEzGhlYWQKMl2QAAABPAAAADZoaGVhDC0CmQAAAXQAAAAkaG10eB67AO4AAAIYAAABbmtlcm4E1wS9AAAMHAAAAMZsb2NhLQ4u0gAABpAAAADAbWF4cAJtAJoAAAGYAAAAIG5hbWUmgJC3AAAM5AAANY5wb3N0CJUJxAAAQnQAAADgcHJlcNTHuIYAAAYAAAAAcgABAAAAAQAArr24P18PPPUAGwgAAAAAANLrfC8AAAAA0uuXUgAA/vAFLAYhAAAACQACAAAAAAAAAAEAAAb+/bwAAAUzAAD/UQUsAAEAAAAAAAAAAAAAAAAAAABYAAEAAABfAE4AAwAAAAAAAQAAAAAACgAAAgAASwAAAAAAAwNBAZAABQAAA1gDWAAABLADWANYAAAEsABkAfQAAAIABQMGAAACAAQAAAABAAAAAAAAAAAAAAAAICAgIABAACEAfgb+/bwAAAb+AkQAAAABAAAAAAOiBOwAAAAgAAIDMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAHVAIMDMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAAEwwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAR9ACkDMwAAAzMAAAMzAAAFMwA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QAEEAUgBUAEkAQwBVAEwAQQBSACAAUABVAFIAUABPAFMARQAgAEEATgBEACAATgBPAE4ASQBOAEYAUgBJAE4ARwBFAE0ARQBOAFQAIABPAEYAIABDAE8AUABZAFIASQBHAEgAVAAsACAAUABBAFQARQBOAFQALAAgAFQAUgBBAEQARQBNAEEAUgBLACwAIABPAFIAIABPAFQASABFAFIAIABSAEkARwBIAFQALgAgAEkATgAgAE4ATwAgAEUAVgBFAE4AVAAgAFMASABBAEwATAAgAFQASABFACAAQwBPAFAAWQBSAEkARwBIAFQAIABIAE8ATABEAEUAUgAgAEIARQAgAEwASQBBAEIATABFACAARgBPAFIAIABBAE4AWQAgAEMATABBAEkATQAsACAARABBAE0AQQBHAEUAUwAgAE8AUgAgAE8AVABIAEUAUgAgAEwASQBBAEIASQBMAEkAVABZACwAIABJAE4AQwBMAFUARABJAE4ARwAgAEEATgBZACAARwBFAE4ARQBSAEEATAAsACAAUwBQAEUAQwBJAEEATAAsACAASQBOAEQASQBSAEUAQwBUACwAIABJAE4AQwBJAEQARQBOAFQAQQBMACwAIABPAFIAIABDAE8ATgBTAEUAUQBVAEUATgBUAEkAQQBMACAARABBAE0AQQBHAEUAUwAsACAAVwBIAEUAVABIAEUAUgAgAEkATgAgAEEATgAgAEEAQwBUAEkATwBOACAATwBGACAAQwBPAE4AVABSAEEAQwBUACwAIABUAE8AUgBUACAATwBSACAATwBUAEgARQBSAFcASQBTAEUALAAgAEEAUgBJAFMASQBOAEcAIABGAFIATwBNACwAIABPAFUAVAAgAE8ARgAgAFQASABFACAAVQBTAEUAIABPAFIAIABJAE4AQQBCAEkATABJAFQAWQAgAFQATwAgAFUAUwBFACAAVABIAEUAIABGAE8ATgBUACAAUwBPAEYAVABXAEEAUgBFACAATwBSACAARgBSAE8ATQAgAE8AVABIAEUAUgAgAEQARQBBAEwASQBOAEcAUwAgAEkATgAgAFQASABFACAARgBPAE4AVAAgAFMATwBGAFQAVwBBAFIARQAuAAAAAgAAAAAAAP8GAGQAAAAAAAAAAAAAAAAAAAAAAAAAAABfAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgAGQAaABsAHAAdAB4AHwAgACEAIgAjACQAJQAmACcAKAApACoAKwAsAC0ALgAvADAAMQAyADMANAA1ADYANwA4ADkAOgA7ADwAPQA+AD8AQABBAEIAQwBEAEUARgBHAEgASQBKAEsATABNAE4ATwBQAFEAUgBTAFQAVQBWAFcAWABZAFoAWwBcAF0AXgBfAGAAYQAAAAMACAACABAAAf//AAIAAAABAAAAAAABAAAADgAAAAAAAAAAAAIAAQAAAF4AAQABAAAACgBKAGQAAmN5cmwADmxhdG4AGAAEAAAAAP//AAAAEAACSVBBIAAaVklUIAAiAAD//wACAAEAAAAA//8AAQABAAD//wAAAAJrZXJuAA5tYXJrABQAAAABAAEAAAABAAAAAgAGAA4ABAAEAAEAEAACAAAAAQAsAAEADAAQAAAAIAAiAAIAAAABAAYAIQAyADYAQQBSAFYAAAAGAAEAjgAEAAAABgAWADAASgBkAHIAgAAGAA7/nAAhADYAQQA2ADIADQA2//IAUgAXAAYADv+cACEAWABBAFgAMgChADYAvQBSAE8ABgAO/nAAIf6TAEH+kwAy//kANgAOAFL/YQADAA7/nABSABcAVv/VAAMADv+cAFIANgBWAEwAAwAO/nAAUgAJAFYAGQABAAYAIQAyADYAQQBSAFYAAQAAAAoATgBoAAJjeXJsAA5sYXRuABoABAAAAAD//wABAAAAEAACSVBBIAAaVklUIAAiAAD//wACAAAAAQAA//8AAQAAAAD//wABAAAAAmFhbHQADnNtY3AAFAAAAAEAAAAAAAEAAAABAAQAAwAAAAEACAABABgAAwAMABAAFAABAEEAAQBSAAEAVgABAAMAIQAyADYAAA=="},function(t,e,i){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e["default"]=t,e}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function A(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.ChantDocument=e.ChantScore=e.ChantMapping=e.ChantLineBreak=e.TextOnly=e.FaClef=e.DoClef=e.Clef=e.Note=e.NoteShapeModifiers=e.NoteShape=e.LiquescentType=void 0;var a=function b(t,e,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var s=Object.getPrototypeOf(t);return null===s?void 0:b(s,e,i)}if("value"in n)return n.value;var o=n.get;if(void 0!==o)return o.call(i)},r=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),h=i(1),u=(n(h),i(4)),l=i(7),c=(i(10),i(9),i(11)),g=e.LiquescentType={None:0,Large:1,Small:2,Ascending:4,Descending:8,InitioDebilis:16,LargeAscending:5,LargeDescending:9,SmallAscending:6,SmallDescending:10},d=e.NoteShape={Default:0,Virga:1,Inclinatum:2,Quilisma:3,Stropha:4,Oriscus:5},f=e.NoteShapeModifiers={None:0,Ascending:1,Descending:2,Cavum:4,Stemmed:8},p=(e.Note=function(t){function e(t){s(this,e);var i=o(this,Object.getPrototypeOf(e).call(this));return"undefined"!=typeof t?i.pitch=t:i.pitch=null,i.glyphVisualizer=null,i.staffPosition=0,i.liquescent=g.None,i.shape=d.Default,i.shapeModifiers=f.None,i.neume=null,i.episemata=[],i.morae=[],i}return A(e,t),r(e,[{key:"setGlyph",value:function(t,e){this.glyphVisualizer?this.glyphVisualizer.setGlyph(t,e):this.glyphVisualizer=new u.GlyphVisualizer(t,e),this.glyphVisualizer.setStaffPosition(t,this.staffPosition),this.bounds.x=this.glyphVisualizer.bounds.x,this.bounds.y=this.glyphVisualizer.bounds.y,this.bounds.width=this.glyphVisualizer.bounds.width,this.bounds.height=this.glyphVisualizer.bounds.height,this.origin.x=this.glyphVisualizer.origin.x,this.origin.y=this.glyphVisualizer.origin.y}},{key:"shapeModifierMatches",value:function(t){return t===f.None?this.shapeModifier===f.None:this.shapeModifier&0!==t}},{key:"draw",value:function(t){this.glyphVisualizer.bounds.x=this.bounds.x,this.glyphVisualizer.bounds.y=this.bounds.y,this.glyphVisualizer.draw(t)}},{key:"createSvgNode",value:function(t){return this.glyphVisualizer.bounds.x=this.bounds.x,this.glyphVisualizer.bounds.y=this.bounds.y,this.svgNode=this.glyphVisualizer.createSvgNode(t,this),this.svgNode}},{key:"createSvgFragment",value:function(t){return this.glyphVisualizer.bounds.x=this.bounds.x,this.glyphVisualizer.bounds.y=this.bounds.y,this.glyphVisualizer.createSvgFragment(t,this);
}}]),e}(u.ChantLayoutElement),e.Clef=function(t){function e(t,i){var n=arguments.length<=2||void 0===arguments[2]?null:arguments[2];s(this,e);var A=o(this,Object.getPrototypeOf(e).call(this));return A.isClef=!0,A.staffPosition=t,A.octave=i,A.defaultAccidental=n,A.activeAccidental=n,A.keepWithNext=!0,A}return A(e,t),r(e,[{key:"resetAccidentals",value:function(){this.activeAccidental=this.defaultAccidental}},{key:"pitchToStaffPosition",value:function(t){}},{key:"performLayout",value:function(t){t.activeClef=this,this.defaultAccidental&&this.defaultAccidental.performLayout(t),a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t)}},{key:"finishLayout",value:function(t){if(this.defaultAccidental){var i=this.defaultAccidental.createGlyphVisualizer(t);i.bounds.x+=this.visualizers[0].bounds.right()+t.intraNeumeSpacing,this.addVisualizer(i)}a(Object.getPrototypeOf(e.prototype),"finishLayout",this).call(this,t)}}],[{key:"default",value:function(){return B}}]),e}(u.ChantNotationElement)),y=e.DoClef=function(t){function e(t,i){var n=arguments.length<=2||void 0===arguments[2]?null:arguments[2];s(this,e);var A=o(this,Object.getPrototypeOf(e).call(this,t,i,n));return A.leadingSpace=0,A}return A(e,t),r(e,[{key:"pitchToStaffPosition",value:function(t){return 7*(t.octave-this.octave)+this.staffPosition+h.Pitch.stepToStaffOffset(t.step)-h.Pitch.stepToStaffOffset(h.Step.Do)}},{key:"staffPositionToPitch",value:function(t){var e=t-this.staffPosition,i=Math.floor(e/7),n=h.Pitch.staffOffsetToStep(e);return this.activeAccidental&&this.activeAccidental.staffPosition===t&&(n+=this.activeAccidental.accidentalType),new h.Pitch(n,this.octave+i)}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t);var i=new u.GlyphVisualizer(t,u.GlyphCode.DoClef);i.setStaffPosition(t,this.staffPosition),this.addVisualizer(i),this.finishLayout(t)}},{key:"clone",value:function(){return new e(this.staffPosition,this.octave,this.defaultAccidental)}}]),e}(p),B=new y(1,2),v=(e.FaClef=function(t){function e(t,i){var n=arguments.length<=2||void 0===arguments[2]?null:arguments[2];s(this,e);var A=o(this,Object.getPrototypeOf(e).call(this,t,i,n));return A.octave=i,A.leadingSpace=0,A}return A(e,t),r(e,[{key:"pitchToStaffPosition",value:function(t){return 7*(t.octave-this.octave)+this.staffPosition+h.Pitch.stepToStaffOffset(t.step)-h.Pitch.stepToStaffOffset(h.Step.Fa)}},{key:"staffPositionToPitch",value:function(t){var e=t-this.staffPosition+3,i=Math.floor(e/7),n=h.Pitch.staffOffsetToStep(e);return this.activeAccidental&&this.activeAccidental.staffPosition===t&&(n+=this.activeAccidental.accidentalType),new h.Pitch(n,this.octave+i)}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t);var i=new u.GlyphVisualizer(t,u.GlyphCode.FaClef);i.setStaffPosition(t,this.staffPosition),this.addVisualizer(i),this.finishLayout(t)}},{key:"clone",value:function(){return new e(this.staffPosition,this.octave,this.defaultAccidental)}}]),e}(p),e.TextOnly=function(t){function e(){s(this,e);var t=o(this,Object.getPrototypeOf(e).call(this));return t.trailingSpace=0,t}return A(e,t),r(e,[{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t),this.addVisualizer(new u.GlyphVisualizer(t,u.GlyphCode.None)),this.origin.x=0,this.origin.y=0,this.finishLayout(t)}}]),e}(u.ChantNotationElement),e.ChantLineBreak=function(t){function e(t){s(this,e);var i=o(this,Object.getPrototypeOf(e).call(this));return i.justify=t,i}return A(e,t),r(e,[{key:"performLayout",value:function(t){this.bounds=new h.Rect(0,0,0,0)}},{key:"clone",value:function(){var t=new e;return t.justify=this.justify,t}}]),e}(u.ChantNotationElement),e.ChantMapping=function m(t,e,i){s(this,m),this.source=t,this.notations=e,this.sourceIndex=i},e.ChantScore=function(){function t(e){var i=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],n=arguments[2];s(this,t),this.mappings=i,this.lines=[],this.notes=[],this.startingClef=null,this.useDropCap=n,this.dropCap=null,this.annotation=null,this.compiled=!1,this.autoColoring=!0,this.needsLayout=!0,this.bounds=new h.Rect,this.updateNotations(e)}return r(t,[{key:"updateNotations",value:function(t){var e,i,n,s;for(this.notations=[],e=0;e<this.mappings.length;e++)for(n=this.mappings[e],i=0;i<n.notations.length;i++)s=n.notations[i],s.score=this,s.mapping=n,this.notations.push(s);this.startingClef=null;var o=new y(1,2);for(e=0;e<this.notations.length;e++){if(this.notations[e].isNeume){this.startingClef=o;break}if(this.notations[e].isClef){this.startingClef=this.notations[e],this.notations.splice(e,1);break}}this.startingClef||(this.startingClef=o),this.useDropCap&&this.recreateDropCap(t),this.needsLayout=!0}},{key:"recreateDropCap",value:function(t){for(var e=0;e<this.notations.length;e++)if(this.notations[e].hasLyrics()&&null!==this.notations[e].lyrics[0])return void(this.dropCap=this.notations[e].lyrics[0].generateDropCap(t))}},{key:"performLayout",value:function(t){if(this.needsLayout!==!1){t.updateHyphenWidth(),t.activeClef=this.startingClef,t.notations=this.notations,t.currNotationIndex=0,this.dropCap&&this.dropCap.recalculateMetrics(t),this.annotation&&this.annotation.recalculateMetrics(t);for(var e=0;e<this.notations.length;e++){var i=this.notations[e];i.needsLayout&&(t.currNotationIndex=e,i.performLayout(t))}this.needsLayout=!1}}},{key:"performLayoutAsync",value:function(t,e){var i=this;return this.needsLayout===!1?void(e&&setTimeout(function(){return e()},0)):(t.updateHyphenWidth(),t.hyphenWidth/t.lyricTextSize>.6?void setTimeout(function(){i.performLayoutAsync(t,e)},100):(t.activeClef=this.startingClef,t.notations=this.notations,t.currNotationIndex=0,this.dropCap&&this.dropCap.recalculateMetrics(t),this.annotation&&this.annotation.recalculateMetrics(t),void setTimeout(function(){return i.layoutElementsAsync(t,0,e)},0)))}},{key:"layoutElementsAsync",value:function(t,e,i){var n=this;if(e>=this.notations.length)return this.needsLayout=!1,void(i&&setTimeout(function(){return i()},0));0===e&&(t.activeClef=this.startingClef);var s=(new Date).getTime()+50;do{var o=this.notations[e];o.needsLayout&&(t.currNotationIndex=e,o.performLayout(t)),e++}while(e<this.notations.length&&(new Date).getTime()<s);setTimeout(function(){return n.layoutElementsAsync(t,e,i)},0)}},{key:"layoutChantLines",value:function(t,e,i){this.lines=[];var n=0,s=0;t.activeClef=this.startingClef;do{var o=new l.ChantLine(this);o.buildFromChantNotationIndex(t,s,e),s=o.notationsStartIndex+o.numNotationsOnLine,o.performLayout(t),this.lines.push(o),o.bounds.y=-o.bounds.y+n,n+=o.bounds.height+1.5*t.staffInterval}while(s<this.notations.length);var A=this.lines[this.lines.length-1];this.bounds.x=0,this.bounds.y=0,this.bounds.width=A.bounds.width,this.bounds.height=n,i&&i(this)}},{key:"draw",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?1:arguments[1],i=t.canvasCtxt;i.clearRect(0,0,t.canvas.width,t.canvas.height),t.setCanvasSize(this.bounds.width,this.bounds.height,e),i.translate(this.bounds.x,this.bounds.y);for(var n=0;n<this.lines.length;n++)this.lines[n].draw(t);i.translate(-this.bounds.x,-this.bounds.y)}},{key:"createSvgNode",value:function(t){var e=[t.defsNode.cloneNode(!0)];e[0].appendChild(t.createStyleNode());for(var i=0;i<this.lines.length;i++)e.push(this.lines[i].createSvgNode(t));return e=u.QuickSvg.createNode("g",{},e),e=u.QuickSvg.createNode("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1","class":"ChantScore",width:this.bounds.width,height:this.bounds.height,viewBox:[0,0,this.bounds.width,this.bounds.height].join(" ")},e),e.source=this,this.svg=e,e}},{key:"createSvg",value:function(t){var e="";for(var i in t.defs)t.defs.hasOwnProperty(i)&&(e+=t.defs[i]);e+=t.createStyle(),e=u.QuickSvg.createFragment("defs",{},e);for(var n=0;n<this.lines.length;n++)e+=this.lines[n].createSvgFragment(t);return e=u.QuickSvg.createFragment("g",{},e),e=u.QuickSvg.createFragment("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink","class":"ChantScore",width:this.bounds.width,height:this.bounds.height},e)}},{key:"createSvgNodeForEachLine",value:function(t){for(var e=[],i=0,n=0;n<this.lines.length;n++){var s=[t.defsNode.cloneNode(!0),this.lines[n].createSvgNode(t,i)];s[0].appendChild(t.createStyleNode());var o=this.lines[n].bounds.height+1.5*t.staffInterval;s=u.QuickSvg.createNode("g",{},s),s=u.QuickSvg.createNode("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1","class":"ChantScore",width:this.bounds.width,height:o,viewBox:[0,0,this.bounds.width,o].join(" ")},s),e.push(s),i+=o}return e}},{key:"createSvgForEachLine",value:function(t){var e="",i="";for(var n in t.defs)t.defs.hasOwnProperty(n)&&(i+=t.defs[n]);i+=t.createStyle(),i=u.QuickSvg.createFragment("defs",{},i);for(var s=0,o=0;o<this.lines.length;o++){var A=i+this.lines[o].createSvgFragment(t,s),a=this.lines[o].bounds.height+1.5*t.staffInterval;A=u.QuickSvg.createFragment("g",{},A),A=u.QuickSvg.createFragment("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink","class":"ChantScore",width:this.bounds.width,height:a},A),e+=A,s+=a}return e}},{key:"unserializeFromJson",value:function(t){this.autoColoring=t["auto-coloring"],null!==t.annotation&&""!==t.annotation?this.annotation=new u.Annotation(ctxt,t.annotation):this.annotation=null;var e="auto"===t["drop-cap"];c.Gabc.parseChantNotations(t.notations,this,e)}},{key:"serializeToJson",value:function(){var t={};return t.type="score",t["auto-coloring"]=!0,null!==this.annotation?t.annotation=this.annotation.unsanitizedText:t.annotation="",t}}]),t}());e.ChantDocument=function(){function t(){s(this,t);var e={layout:{units:"mm","default-font":{"font-family":"Crimson","font-size":14},page:{width:8.5,height:11,"margin-left":0,"margin-top":0,"margin-right":0,"margin-bottom":0}},scores:[]};this.copyLayout(this,e),this.scores=e.scores}return r(t,[{key:"copyLayout",value:function(t,e){t.layout={units:e.layout.units,"default-font":{"font-family":e.layout["default-font"]["font-family"],"font-size":e.layout["default-font"]["font-size"]},page:{width:e.layout.page.width,height:e.layout.page.height,"margin-left":e.layout.page["margin-left"],"margin-top":e.layout.page["margin-top"],"margin-right":e.layout.page["margin-right"],"margin-bottom":e.layout.page["margin-bottom"]}}}},{key:"unserializeFromJson",value:function(t){this.copyLayout(this,t),this.scores=[];for(var e=0;e<t.scores.length;e++){var i=new v;i.unserializeFromJson(t.scores[e]),this.scores.push(i)}}},{key:"serializeToJson",value:function(){var t={};this.copyLayout(t,this),t.scores=[];for(var e=0;e<this.scores.length;e++)t.scores.push(this.scores[e].serializeToJson());return t}}]),t}()},function(t,e,i){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e["default"]=t,e}function s(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function A(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.ChantLine=void 0;var r=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),h=i(1),u=(n(h),i(8)),l=(n(u),i(4)),c=i(6),g=i(3),d=i(10),f=i(9);e.ChantLine=function(t){function e(t){o(this,e);var i=A(this,Object.getPrototypeOf(e).call(this));return i.score=t,i.notationsStartIndex=0,i.numNotationsOnLine=0,i.notationBounds=null,i.staffLeft=0,i.staffRight=0,i.startingClef=null,i.custos=null,i.justify=!0,i.ledgerLines=[],i.braces=[],i.nextLine=null,i.previousLine=null,i.lyricLineHeight=0,i.lyricLineBaseline=0,i.numLyricLines=0,i.spaceAfterNotations=0,i.spaceBetweenTextTracks=0,i.lastLyrics=[],i}return a(e,t),r(e,[{key:"performLayout",value:function(t){this.notationBounds=new h.Rect(this.staffLeft,-(3.1+t.minSpaceAboveStaff)*t.staffInterval,this.staffRight-this.staffLeft,(6.2+t.minSpaceAboveStaff)*t.staffInterval);var e,i=this.score.notations,n=null===this.extraTextOnlyIndex?this.notationsStartIndex+this.numNotationsOnLine:this.extraTextOnlyIndex,s=this.notationsStartIndex+this.numNotationsOnLine,o=null;for(this.notationBounds.union(this.startingClef.bounds),this.lyricLineHeight=0,this.lyricLineBaseline=0,this.numLyricLines=0,this.altLineHeight=0,this.altLineBaseline=0,this.numAltLines=0,this.translationLineHeight=0,this.translationLineBaseline=0,this.numTranslationLines=0,e=this.notationsStartIndex;n>e;e++)o=i[e],this.notationBounds.union(o.bounds),o.lyrics.length&&(this.numLyricLines<o.lyrics.length||this.numLyricLines>0&&this.lyricLineHeight*this.lyricLineBaseline===0)&&(o.lyrics[0].bounds.height>this.lyricLineHeight&&(this.lyricLineHeight=o.lyrics[0].bounds.height),o.lyrics[0].origin.y>this.lyricLineBaseline&&(this.lyricLineBaseline=o.lyrics[0].origin.y),o.lyrics.length>this.numLyricLines&&(this.numLyricLines=o.lyrics.length)),o.alText&&this.numAltLines<o.alText.length&&(o.alText[0].bounds.height>this.altLineHeight&&(this.altLineHeight=o.alText[0].bounds.height),o.alText[0].origin.y>this.altLineBaseline&&(this.altLineBaseline=o.alText[0].origin.y),o.alText.length>this.numAltLines&&(this.numAltLines=o.alText.length)),o.translationText&&this.numTranslationLines<o.translationText.length&&(o.translationText[0].bounds.height>this.translationLineHeight&&(this.translationLineHeight=o.translationText[0].bounds.height),o.translationText[0].origin.y>this.translationLineBaseline&&(this.translationLineBaseline=o.translationText[0].origin.y),o.translationText.length>this.numTranslationLines&&(this.numTranslationLines=o.translationText.length));for(this.custos&&this.notationBounds.union(this.custos.bounds),e=0;e<this.braces.length;e++)this.notationBounds.union(this.braces[e].bounds);for(e=this.notationsStartIndex;n>e;e++){o=i[e];for(var A=this.notationBounds.y+this.notationBounds.height,a=0;a<o.lyrics.length;a++)o.lyrics[a].bounds.y=A+this.lyricLineBaseline,A+=this.lyricLineHeight;if(o.translationText)for(a=0;a<o.translationText.length;a++)o.translationText[a].bounds.y=A+this.translationLineBaseline,A+=this.translationLineHeight;if(o.alText)for(A=this.notationBounds.y-2,a=0;a<o.alText.length;a++)A-=this.altLineHeight,o.alText[a].bounds.y=A+this.altLineBaseline}this.extraTextOnlyHeight=0;var r=this.extraTextOnlyLyricIndex;if(null===this.extraTextOnlyIndex){var u=i[n-1];u.constructor===c.ChantLineBreak&&(u=i[n-2]),u.constructor===c.TextOnly&&1===u.lyrics.length&&u.lyrics[0].bounds.height>this.lyricLineHeight&&(this.extraTextOnlyHeight=u.lyrics[r].bounds.height-this.lyricLineHeight)}else{var l=null,g=0;for(A=this.notationBounds.y+this.notationBounds.height+(this.numLyricLines-1)*this.lyricLineHeight,A+=this.numTranslationLines*this.translationLineHeight,e=this.extraTextOnlyIndex;s>e;e++)o=i[e],o.lyrics[r]&&(l=o.lyrics[r],l.lineWidth&&(g=this.staffRight-l.lineWidth),l.bounds.y=l.origin.y+A+this.lyricLineBaseline,o.bounds.x+=g);l&&(this.extraTextOnlyHeight=l.origin.y+l.bounds.height-1.2*l.fontSize)}if(this.startingClef.hasLyrics())for(A=this.notationBounds.y+this.notationBounds.height,a=0;a<this.startingClef.lyrics.length;a++)this.startingClef.lyrics[a].bounds.y=A+this.lyricLineBaseline,A+=this.lyricLineHeight;if(0===this.notationsStartIndex){if(null!==this.score.dropCap){var d;d=this.notationBounds.y+this.notationBounds.height+this.lyricLineBaseline,this.score.dropCap.bounds.x=this.staffLeft/2,this.score.dropCap.bounds.y=d}if(null!==this.score.annotation){if(this.score.annotation.bounds.x=this.staffLeft/2,this.score.annotation.bounds.y=3*-t.staffInterval,null!==this.score.dropCap){var f=this.score.dropCap.bounds.y-this.score.annotation.bounds.height-.65*this.score.dropCap.fontSize;f<this.score.annotation.bounds.y?this.score.annotation.bounds.y=f:this.score.annotation.bounds.y=(this.score.annotation.bounds.y+f)/2;var p=this.score.annotation.bounds.y-this.notationBounds.y;0>p&&(this.notationBounds.y=this.score.annotation.bounds.y,this.notationBounds.height-=p)}this.score.annotation.bounds.y+=.65*this.score.annotation.origin.y}}this.notationBounds.height+=Math.max(t.minSpaceBelowStaff*t.staffInterval,this.lyricLineHeight*this.numLyricLines+this.altLineHeight*this.numAltLines+this.translationLineHeight*this.numTranslationLines+this.extraTextOnlyHeight);var y=this.notationBounds.height;this.notationBounds.y-=2+this.altLineHeight*this.numAltLines,this.bounds.x=0,this.bounds.y=this.notationBounds.y,this.bounds.width=this.notationBounds.right(),this.bounds.height=y,this.origin=new h.Point(this.staffLeft,-this.notationBounds.y)}},{key:"draw",value:function(t){var e=t.canvasCtxt;e.translate(this.bounds.x,this.bounds.y);var i,n,s=this.staffLeft,o=this.staffRight;for(e.lineWidth=t.staffLineWeight,e.strokeStyle=t.staffLineColor,i=-3;3>=i;i+=2)n=t.staffInterval*i,e.beginPath(),e.moveTo(s,n),e.lineTo(o,n),e.stroke();for(i=0;i<this.ledgerLines.length;i++){var A=this.ledgerLines[i];n=t.calculateHeightFromStaffPosition(A.staffPosition),e.beginPath(),e.moveTo(A.x1,n),e.lineTo(A.x2,n),e.stroke()}0===this.notationsStartIndex&&(null!==this.score.dropCap&&this.score.dropCap.draw(t),null!==this.score.annotation&&this.score.annotation.draw(t));var a=this.score.notations,r=this.notationsStartIndex+this.numNotationsOnLine;for(i=this.notationsStartIndex;r>i;i++)a[i].draw(t);this.startingClef.draw(t),this.custos&&this.custos.draw(t),e.translate(-this.bounds.x,-this.bounds.y)}},{key:"createSvgNode",value:function(t){var e,i=arguments.length<=1||void 0===arguments[1]?0:arguments[1],n=[],s=this.staffLeft,o=this.staffRight;for(e=-3;3>=e;e+=2)n.push(l.QuickSvg.createNode("line",{x1:s,y1:t.staffInterval*e,x2:o,y2:t.staffInterval*e,stroke:t.staffLineColor,"stroke-width":t.staffLineWeight,"class":"staffLine"}));for(e=0;e<this.ledgerLines.length;e++){var A=this.ledgerLines[e],a=t.calculateHeightFromStaffPosition(A.staffPosition);n.push(l.QuickSvg.createNode("line",{x1:A.x1,y1:a,x2:A.x2,y2:a,stroke:t.staffLineColor,"stroke-width":t.staffLineWeight,"class":"ledgerLine"}))}for(e=0;e<this.braces.length;e++)n.push(this.braces[e].createSvgNode(t));0===this.notationsStartIndex&&(null!==this.score.dropCap&&n.push(this.score.dropCap.createSvgNode(t)),null!==this.score.annotation&&(n=n.concat(this.score.annotation.createSvgNode(t)))),n.push(this.startingClef.createSvgNode(t));var r=this.score.notations,h=this.notationsStartIndex+this.numNotationsOnLine;for(e=this.notationsStartIndex;h>e;e++)n.push(r[e].createSvgNode(t));return this.custos&&n.push(this.custos.createSvgNode(t)),l.QuickSvg.createNode("g",{"class":"chantLine",transform:"translate("+this.bounds.x+","+(this.bounds.y-i)+")"},n)}},{key:"createSvgFragment",value:function(t){var e,i=arguments.length<=1||void 0===arguments[1]?0:arguments[1],n="",s=this.staffLeft,o=this.staffRight;for(e=-3;3>=e;e+=2)n+=l.QuickSvg.createFragment("line",{x1:s,y1:t.staffInterval*e,x2:o,y2:t.staffInterval*e,stroke:t.staffLineColor,"stroke-width":t.staffLineWeight,"class":"staffLine"});for(e=0;e<this.ledgerLines.length;e++){var A=this.ledgerLines[e],a=t.calculateHeightFromStaffPosition(A.staffPosition);n+=l.QuickSvg.createFragment("line",{x1:A.x1,y1:a,x2:A.x2,y2:a,stroke:t.staffLineColor,"stroke-width":t.staffLineWeight,"class":"ledgerLine"})}for(e=0;e<this.braces.length;e++)n+=this.braces[e].createSvgFragment(t);0===this.notationsStartIndex&&(null!==this.score.dropCap&&(n+=this.score.dropCap.createSvgFragment(t)),null!==this.score.annotation&&(n+=this.score.annotation.createSvgFragment(t))),n+=this.startingClef.createSvgFragment(t);var r=this.score.notations,h=this.notationsStartIndex+this.numNotationsOnLine;for(e=this.notationsStartIndex;h>e;e++)n+=r[e].createSvgFragment(t);return this.custos&&(n+=this.custos.createSvgFragment(t)),l.QuickSvg.createFragment("g",{"class":"chantLine",transform:"translate("+this.bounds.x+","+(this.bounds.y-i)+")"},n)}},{key:"generateCurlyBraceDrawable",value:function(t,e,i,n,s){var o;o=s?-t.staffInterval/2:t.staffInterval/2;var A=.6,a=i-e,r=e,h=n+A*o,u=e+.25*a,c=n+(1-A)*o,g=e+.5*a,d=n+o,f=i,p=n+A*o,y=e+.75*a,B=n+(1-A)*o,v="M "+e+" "+n+" Q "+r+" "+h+" "+u+" "+c+" T "+g+" "+d+" M "+i+" "+n+" Q "+f+" "+p+" "+y+" "+B+" T "+g+" "+d;return l.QuickSvg.createFragment("path",{d:v,stroke:t.neumeLineColor,"stroke-width":t.neumeLineWeight+"px",fill:"none"})}},{key:"buildFromChantNotationIndex",value:function(t,e,i){var n=this.score.notations,s=null,o=null,A=null,a=[],r=[];if(this.notationsStartIndex=e,this.numNotationsOnLine=0,this.staffLeft=0,this.paddingLeft=0,this.extraTextOnlyIndex=null,this.extraTextOnlyLyricIndex=0,i>0?this.staffRight=i:this.staffRight=1/0,0===this.notationsStartIndex){var h=0;null!==this.score.dropCap&&(h=this.score.dropCap.bounds.width+2*this.score.dropCap.padding),null!==this.score.annotation&&(h=Math.max(h,this.score.annotation.bounds.width+2*this.score.annotation.padding)),this.staffLeft+=h,null!==this.score.dropCap&&(this.paddingLeft=(h-this.score.dropCap.bounds.width)/2)}else if(o=n[e-1],o.constructor===d.DoubleBar&&o.hasLyrics()&&(o.lyrics.length>1||!o.lyrics[0].text.match(/^(i\.?)+j\.?/))){s=o.lyrics.map(function(e){var i=new l.Lyric(t,e.originalText,e.lyricType,e.notation,e.notations,e.sourceIndex);return i.elidesToNext=e.elidesToNext,e.bounds.y=Number.MAX_SAFE_INTEGER,i});var u=s.map(function(t){return t.bounds.x}).reduce(function(t,e){return e>t?t:e});s.forEach(function(t){t.bounds.x-=u})}n[e].isClef&&(t.activeClef=n[e].clone(),e++,this.notationsStartIndex++),this.startingClef=t.activeClef.clone(),this.startingClef.performLayout(t),this.startingClef.bounds.x=this.staffLeft;var f=this.startingClef;s&&l.LyricArray.setNotation(s,f);var p,y,B=this.staffRight-g.Glyphs.CustosLong.bounds.width*t.glyphScaling,v=null,b=n.length-1;f.hasLyrics()&&l.LyricArray.mergeIn(this.lastLyrics,f.lyrics),t.lastStartBrace&&!t.lastStartBrace.note&&(t.lastStartBrace.note=this.startingClef);var m,C;for(p=e;b>=p;p++){o=f,f.constructor!==c.TextOnly&&(A=f),f=n[p];var w;w=p===b||f.constructor===d.Custos||o.constructor===d.Custos&&f.isDivider||f.constructor===c.ChantLineBreak&&A.constructor===d.Custos?this.staffRight:p===b-1?Math.max(B,this.staffRight-n[b].bounds.width):B;var x=!f.isDivider&&f.constructor!==c.ChantLineBreak&&f.constructor!==d.Custos&&b-p>1&&!A.keepWithNext&&A.bounds.right()>=B;x=x||null!==this.extraTextOnlyIndex&&f.constructor!==c.TextOnly&&f.constructor!==c.ChantLineBreak&&f.constructor!==d.Custos&&f.hasLyrics(),f.constructor===c.TextOnly&&o===A&&(m=this.lastLyrics.slice(),C=p),f.hasLyrics()&&f.lyrics[0].needsLayout&&f.lyrics[0].recalculateMetrics(t);var G,Q=!x&&this.positionNotationElement(t,this.lastLyrics,A,f,w,r),I=f.constructor===c.TextOnly&&l.LyricArray.hasOnlyOneLyric(f.lyrics)&&(Q===!1||null!==this.extraTextOnlyIndex);if(I&&null===this.extraTextOnlyIndex&&(G=l.LyricArray.indexOfLyric(f.lyrics),C===p)){var L=n[p].lyrics[G].text;if(L.length<=1){var S=n[p+1];I=S&&S.constructor===c.TextOnly&&S.lyrics[G]&&S.lyrics[G].text.length>0}}if(I){var k;if(G=this.extraTextOnlyLyricIndex,null===this.extraTextOnlyIndex){this.extraTextOnlyIndex=C,G=this.extraTextOnlyLyricIndex=l.LyricArray.indexOfLyric(f.lyrics),this.lastLyricsBeforeTextOnly=m,this.lastLyrics=[],p=C-1,this.numNotationsOnLine=C-this.notationsStartIndex,n[C].lyrics[G].origin.y=0;continue}p!==this.extraTextOnlyIndex&&(f.lyrics[G].origin.y=this.lastLyrics[G].origin.y),delete f.lyrics[G].lineWidth,Q&&p!==this.extraTextOnlyIndex||(f.bounds.x=f.lyrics[G].origin.x,f.lyrics[G].origin.y+=(this.lastLyrics[G]||f.lyrics[G]).bounds.height,f.lyrics[G].setMaxWidth(t,this.staffRight,this.staffRight-(l.LyricArray.getRight(this.lastLyrics)+t.minLyricWordSpacing||0)),k=f),k&&(k.lyrics[G].lineWidth=f.lyrics[G].getRight())}else if(Q===!1){for(;this.numNotationsOnLine>0&&(f.isDivider||f.constructor===d.Custos);)f=n[--p],this.numNotationsOnLine--;for(v&&console.info(n[p-1],v),y=p-1;y>this.notationsStartIndex;y--){var E=n[y];if(f=n[y+1],E.firstWithNoWidth)this.numNotationsOnLine--;else if(v)this.numNotationsOnLine--,E===v&&(v=null);else if(!f||!f.notes||f.notes[0].shape!==c.NoteShape.Quilisma&&f.notes[0].shape!==c.NoteShape.Inclinatum){if(E.keepWithNext!==!0)break;E.allowLineBreakBeforeNext&&!this.maxNumNotationsOnLine&&(this.maxNumNotationsOnLine=this.numNotationsOnLine),this.numNotationsOnLine--}else this.numNotationsOnLine--}if(0===this.numNotationsOnLine&&(numNotationsOnLine=1),f=this.findNeumesToJustify(a),this.lastLyrics=a,this.maxNumNotationsOnLine){var M=this.getWhitespaceOnRight(t);M/this.toJustify.length>t.staffInterval*t.maxExtraSpaceInStaffIntervals&&(l.LyricArray.mergeInArray(a,n.slice(this.notationsStartIndex+this.numNotationsOnLine,this.notationsStartIndex+this.maxNumNotationsOnLine)),this.numNotationsOnLine=this.maxNumNotationsOnLine,delete this.maxNumNotationsOnLine)}var T=this.score.notations[null===this.extraTextOnlyIndex?this.notationsStartIndex+this.numNotationsOnLine:this.extraTextOnlyIndex];if(T&&T.hasLyrics()&&(T.lyrics[0].lyricType===l.LyricType.BeginningSyllable||T.lyrics[0].lyricType===l.LyricType.SingleSyllable)&&this.toJustify.push(this.custos),n[y].isDivider&&n[y-1].constructor===d.Custos){for(a=[],p=y-2;p>=this.notationsStartIndex;p--)if(n[p].hasLyrics()){l.LyricArray.mergeIn(a,n[p].lyrics);break}r.sum-=r.pop().condensable,r.sum-=r.pop().condensable,this.positionNotationElement(t,a,n[y-2],n[y],this.staffRight,r),this.custos=n[y-1],this.custos.bounds.x=this.staffRight-this.custos.bounds.width-this.custos.leadingSpace}break}if(f.hasLyrics()&&l.LyricArray.mergeIn(this.lastLyrics,f.lyrics),v&&f===v.translationText[0].endNeume?v=null:f.translationText&&f.translationText.length&&f.translationText[0].endNeume&&(v=f),f.line=this,this.numNotationsOnLine++,f.isClef&&(t.activeClef=f),f.constructor===c.ChantLineBreak&&i>0){this.justify=f.justify||null!==this.extraTextOnlyIndex,this.justify&&this.findNeumesToJustify(a);break}f.constructor===d.Custos?this.custos=f:f.isNeume&&(this.custos=null)}for(var P=this.notationsStartIndex+this.numNotationsOnLine-1,H=n[P];P&&(H.constructor===c.ChantLineBreak||H.constructor===d.Custos||H.constructor===c.TextOnly);)H=n[--P];var N=this.notationsStartIndex+this.numNotationsOnLine===n.length;if((this.justify&&null!==this.extraTextOnlyIndex||i>0&&N)&&(this.toJustify||this.findNeumesToJustify(a),this.justify=(!N||H.isDivider)&&this.getWhitespaceOnRight(t)/(this.toJustify.length||1)<=t.staffInterval*t.maxExtraSpaceInStaffIntervals),!this.custos)for(p=this.notationsStartIndex+this.numNotationsOnLine;p<n.length;p++){var O=n[p];if(O.isNeume){this.custos=new d.Custos(!0),t.currNotationIndex=p-1,this.custos.performLayout(t),this.justify?this.custos.bounds.x=this.staffRight-this.custos.bounds.width-this.custos.leadingSpace:this.custos.bounds.x=A.bounds.right()+A.trailingSpace;break}}if(this.lastLyricsBeforeTextOnly&&(this.lastLyrics=this.lastLyricsBeforeTextOnly,delete this.lastLyricsBeforeTextOnly),i>0){var F=this.getWhitespaceOnRight(),Z=this.staffRight;0>F&&(Z-=F)}for(p=0;this.lastLyrics&&this.lastLyrics[p];){var V=this.lastLyrics[p];if(V.allowsConnector()&&(V.setNeedsConnector(!0,0),i>0&&t.minLyricWordSpacing<t.hyphenWidth&&(F=Z-V.getRight(),0>F))){var U=Math.max(t.hyphenWidth+F,this.lastLyrics.length>1?t.intraNeumeSpacing:t.minLyricWordSpacing);V.setConnectorWidth(U)}++p}0>=i&&(this.staffRight=n[this.notationsStartIndex+this.numNotationsOnLine-1].bounds.right(),this.justify=!1),this.justifyElements(t,this.justify,r),this.centerDividers(),this.finishLayout(t)}},{key:"centerDividers",value:function(){for(var t,e=null===this.extraTextOnlyIndex?this.notationsStartIndex+this.numNotationsOnLine:this.extraTextOnlyIndex,i=this.notationsStartIndex;e>i;i++)if(t=this.score.notations[i],t&&t.isDivider){var n=1,s=this.score.notations[i-n],o=i+n===e?this.custos:this.score.notations[i+n];if(s===o&&o===this.custos)s=this.score.notations[i-2];else{for(;o&&o.constructor===c.TextOnly;)n++,o=i+n===e?this.custos:this.score.notations[i+n];for(n=1;s&&s.constructor===c.TextOnly;){if(n++,i-n<this.notationsStartIndex){s=null;break}s=this.score.notations[i-n]}}if(s&&o){var A=t.bounds.x;if(t.bounds.x=(s.bounds.right()+o.bounds.x-t.bounds.width)/2,t.hasLyrics()){var a=A-t.bounds.x;for(n=t.lyrics.length-1;n>=0;n--)t.lyrics[n].bounds.x+=a,t.lyrics[n].needsLayout=!0}}else i!==e-1||!this.justify||t.constructor!==d.DoubleBar&&t.constructor!==d.FullBar||(t.bounds.x=this.staffRight-t.bounds.width)}}},{key:"findNeumesToJustify",value:function(t){this.toJustify=[];for(var e,i=null,n=null,s=null,o=null===this.extraTextOnlyIndex?this.notationsStartIndex+this.numNotationsOnLine:this.extraTextOnlyIndex,A=this.notationsStartIndex;o>A;A++){e=s,i=this.score.notations[A],n=i.isAccidental&&this.score.notations[++A],s=n||i;var a=s.hasLyrics();i&&e&&(null!==e&&(l.LyricArray.mergeIn(t,e.lyrics),e.keepWithNext===!0)||!i.isDivider&&t.length&&t[0].allowsConnector()&&a||s.constructor!==c.ChantLineBreak&&(s!==this.custos||a)&&(0===A&&this.score.useDropCap&&a||this.toJustify.push(i)))}return null!==s&&l.LyricArray.mergeIn(t,s.lyrics),s}},{key:"getWhitespaceOnRight",value:function(t){var e=this.score.notations,i=null===this.extraTextOnlyIndex?this.notationsStartIndex+this.numNotationsOnLine:this.extraTextOnlyIndex,n=e[i-1],s=n?n.bounds.right()+n.trailingSpace:0,o=this.lastLyricsBeforeTextOnly||this.lastLyrics,A=o.length?l.LyricArray.getRight(o):0;return this.custos?(s+=this.custos.bounds.width+this.custos.leadingSpace,this.custos.hasLyrics()&&(A=l.LyricArray.getRight(this.custos.lyrics))):t&&i<e.length&&(s+=g.Glyphs.CustosLong.bounds.width*t.glyphScaling),this.staffRight-Math.max(A,s)}},{key:"justifyElements",value:function(t,e,i){var n,s=this.toJustify||[],o=this.score.notations,A=this.notationsStartIndex+this.numNotationsOnLine,a=o[this.notationsStartIndex+this.numNotationsOnLine-1],r=this.staffRight<1/0&&this.custos&&a.keepWithNext&&this.custos.bounds.x-a.bounds.right()-a.trailingSpace;if(r>0){for(n=0;this.lastLyrics&&this.lastLyrics[n];){var h=this.lastLyrics[n];if(h.allowsConnector()){var u=h.getConnectorWidth();if(t.minLyricWordSpacing<u){var g=Math.max(u-r,this.lastLyrics.length>1?t.intraNeumeSpacing:t.minLyricWordSpacing);h.setConnectorWidth(g)}}++n}this.custos.bounds.x=a.bounds.right()+a.trailingSpace}var d=this.getWhitespaceOnRight();if(!(Math.abs(d)<.5||d>0&&(e&&0===s.length||!e))){this.condensableSpaces=i;var f,p,y=0,B=d/s.length,v=0,b=0;0>d&&(s=i.filter(function(t){return t.condensable>0}),v=d/i.sum,B=0);var m=s[b++],C=!1;for(n=this.notationsStartIndex;A>n;n++)p=f,f=o[n],null!==this.extraTextOnlyIndex&&n>=this.extraTextOnlyIndex&&f.constructor===c.TextOnly||(v||f!==this.custos?(v?m&&m.notation===f&&(y+=v*m.condensable,m=s[b++]):m===f?(p.hasNoWidth?C=!0:y+=B,m=s[b++]):C&&!p.hasNoWidth&&(C=!1,y+=B),f.bounds.x+=y):f.hasLyrics()?(f.bounds.x=Math.min(f.bounds.x+(this.staffRight-l.LyricArray.getRight(f.lyrics)),this.staffRight-f.bounds.width),y+=B):f.bounds.x=Math.min(f.bounds.x+y,this.staffRight-f.bounds.width));r>0&&(this.custos.bounds.x=a.bounds.right()+a.trailingSpace)}}},{key:"handleEndBrace",value:function(t,e,i){var n=t.lastStartBrace;if(n){var o,A=n.notationIndex,a=this.score.notations,r=t.intraNeumeSpacing/2,h=n.note;o=n.isAbove?Math.min.apply(Math,[t.calculateHeightFromStaffPosition(4)].concat(s([h,e].concat(a.slice(A,i+1)).map(function(t){return t.bounds.y-r;
})))):Math.max.apply(Math,[t.calculateHeightFromStaffPosition(-4)].concat(s([h,e].concat(a.slice(A,i+1)).map(function(t){return t.bounds.bottom()+r}))));var u=!1;n.shape===f.BraceShape.RoundBrace?this.braces.push(new l.RoundBraceVisualizer(t,n.getAttachmentX(h),e.braceEnd.getAttachmentX(e),o,n.isAbove)):(n.shape===f.BraceShape.AccentedCurlyBrace&&(u=!0),this.braces.push(new l.CurlyBraceVisualizer(t,n.getAttachmentX(h),e.braceEnd.getAttachmentX(e),o,n.isAbove,u))),delete t.lastStartBrace}}},{key:"finishLayout",value:function(t){var e=this;this.ledgerLines=[];for(var i=this.score.notations,n=this.notationsStartIndex+this.numNotationsOnLine,o=function(i){var n=arguments.length<=1||void 0===arguments[1]?i:arguments[1],s=arguments.length<=2||void 0===arguments[2]?i.staffPosition:arguments[2],o=arguments.length<=3||void 0===arguments[3]?i.neume?i.neume.bounds.x:0:arguments[3];if(s>=5||-5>=s){var A=o+i.bounds.x-t.intraNeumeSpacing,a=o+n.bounds.x+n.bounds.width+t.intraNeumeSpacing;s-=s>0?(s-1)%2:(s+1)%2;var r=t.staffInterval*t.minLedgerSeparation;if(e.ledgerLines.length>0&&e.ledgerLines[e.ledgerLines.length-1].x2+r>=A){var h=(A-e.ledgerLines[e.ledgerLines.length-1].x2)/2;e.ledgerLines[e.ledgerLines.length-1].x2+=h,A-=h}a>e.staffRight&&(a=e.staffRight),e.ledgerLines.push({x1:A,x2:a,staffPosition:s})}},A=[],a=null,r=Number.MAX_VALUE,h=Number.MIN_VALUE,u=function(i,n,s){i.setMaxWidth(t,e.staffRight),i.bounds.x=0,s&&(i.bounds.x=(i.bounds.x+s-i.bounds.width)/2);var o=n.bounds.x+i.bounds.right()-e.staffRight;o>0&&(i.bounds.x-=o),n.bounds.x+i.bounds.x<0&&(i.bounds.x=-n.bounds.x)},c=this.notationsStartIndex;n>c;c++){var g=i[c];if(r=Math.min(r,g.bounds.y),h=Math.max(h,g.bounds.bottom()),g.constructor!==d.Custos){if(g.alText)for(var p=0;p<g.alText.length;p++)u(g.alText[p],g);if(g.translationText)for(p=0;p<g.translationText.length;p++){var y=g.translationText[p];if(y.endNeume){var B=y.endNeume.hasLyrics()?y.endNeume.bounds.x+Math.max.apply(Math,s(y.endNeume.lyrics.map(function(t){return t.bounds.right()}))):y.endNeume.bounds.right();B-=g.bounds.x,u(y,g,B)}else u(y,g)}if(g.isNeume){for(p=0;p<g.ledgerLines.length;p++){var v=g.ledgerLines[p];o(v.element,v.endElem,v.staffPosition)}for(p=0;p<g.notes.length;p++){var b,m=g.notes[p];for(0===m.episemata.length&&(A=[]),b=0;b<m.episemata.length;b++){var C=m.episemata[b],w=0;if(A.length>0&&(w=g.bounds.x+C.bounds.x-(A[A.length-1].note.neume.bounds.x+A[A.length-1].bounds.right())),0===A.length||A[A.length-1].positionHint!==C.positionHint||A[A.length-1].terminating===!0||A[A.length-1].alignment===f.HorizontalEpisemaAlignment.Left||A[A.length-1].alignment===f.HorizontalEpisemaAlignment.Center||C.alignment===f.HorizontalEpisemaAlignment.Right||C.alignment===f.HorizontalEpisemaAlignment.Center||w>2*t.intraNeumeSpacing&&m.glyphVisualizer.glyphCode!==l.GlyphCode.None)A=[C];else{var x;if(x=C.positionHint===f.MarkingPositionHint.Below?Math.max(C.bounds.y,A[A.length-1].bounds.y):Math.min(C.bounds.y,A[A.length-1].bounds.y),C.bounds.y!==x)C.bounds.y=x;else for(var G=0;G<A.length;G++)A[G].bounds.y=x;var Q=g.bounds.x+C.bounds.x-(A[A.length-1].note.neume.bounds.x+A[A.length-1].bounds.x);0>Q&&(Q*=-1,A[A.length-1].bounds.x-=Q),A[A.length-1].bounds.width=Q,A.push(C)}}m.braceEnd&&this.handleEndBrace(t,m,c),m.braceStart&&(t.lastStartBrace=a=m.braceStart,a.notationIndex=c)}}}else o(g)}if(null!==a&&this.custos){var I=i[n],L=I.notes&&I.notes[0],S=i[n+1],k=S&&S.notes&&S.notes[0],E=L&&L.braceEnd||I.isAccidental&&k&&k.braceEnd;E?(this.custos.braceEnd=E,this.handleEndBrace(t,this.custos,c)):(this.braceStart=a,this.custos.braceEnd=new f.BracePoint(this.custos,a.isAbove,a.shape,f.BraceAttachment.Right),this.handleEndBrace(t,this.custos,c-1),t.lastStartBrace=new f.BracePoint(null,a.isAbove,a.shape,f.BraceAttachment.Left),t.lastStartBrace.notationIndex=c)}this.custos&&o(this.custos)}},{key:"positionNotationElement",value:function(t,e,i,n,s){var o=arguments.length<=5||void 0===arguments[5]?[]:arguments[5];o.hasOwnProperty("sum")||(o.sum=0);var A,a={notation:n},r=!1;if(n.hasNoWidth&&n.firstWithNoWidth!==n||!i.firstWithNoWidth?n.bounds.x=i.bounds.right():(n.bounds.x=i.firstWithNoWidth.bounds.x,r=!0),n.constructor===c.TextOnly&&null===this.extraTextOnlyIndex||!n.hasLyrics()&&i.trailingSpace<0?(n.trailingSpace=i.trailingSpace,n.hasLyrics()&&(n.trailingSpace-=n.lyrics[0].bounds.width),n.constructor===c.TextOnly&&1===n.lyrics.length&&n.lyrics[0].setMaxWidth(t,this.staffRight,this.staffRight-l.LyricArray.getRight(e)-t.minLyricWordSpacing)):r||(n.bounds.x+=i.trailingSpace),n.hasLyrics()&&!i.isDivider&&!i.isAccidental&&this.numNotationsOnLine>0&&(n.lyrics[0].lyricType===l.LyricType.SingleSyllable||n.lyrics[0].lyricType===l.LyricType.BeginningSyllable)&&(n.bounds.x+=t.intraNeumeSpacing*t.interVerbalMultiplier),n.hasNoWidth||r?a.total=a.condensable=0:null!==this.extraTextOnlyIndex&&n.constructor===c.TextOnly?(n.bounds.x=0,a.total=a.condensable=0):(a.total=n.bounds.x-i.bounds.right(),a.condensable=a.total*t.condensingTolerance),0===e.length){var h=n.bounds.right()+n.trailingSpace;for(A=0;A<n.lyrics.length;A++){var u=n.lyrics[A],g=u.allowsConnector()&&u.dropCap&&u.originalText&&!u.text;u.setNeedsConnector(g);var d=this.staffLeft-this.paddingLeft;u.getLeft()<d&&(n.bounds.x-=u.getLeft()-d),a.condensable=Math.min(a.condensable,u.getLeft()-d),h=Math.max(h,u.getRight())}return h>s+o.sum+a.condensable?!1:(o.push(a),o.sum+=a.condensable,!0)}if(n.firstOfSyllable&&e.length&&!n.hasLyrics()&&(n.bounds.x=Math.max(n.bounds.x,e[0].getRight()),a.total=n.bounds.x-i.bounds.right(),a.condensable=a.total*t.condensingTolerance),n.hasLyrics()===!1)return n.bounds.right()+n.trailingSpace>s+o.sum+a.condensable?!1:(o.push(a),o.sum+=a.condensable,!0);do{var f=!1,p=!1,y=function(){if(!n.lyrics[A].originalText)return"continue";B=0;var i=[],s=null;if(A<e.length&&e[A]){B=e[A].getRight();var r=o.map(function(t){return t.notation}).lastIndexOf(e[A].notation);i=o.slice(r+1),i.sum=i.map(function(t){return t.condensable}).reduce(function(t,e){return t+e},0)}if(n.lyrics[A].setNeedsConnector(!1),v=n.lyrics[A].getLeft(),e[A]&&e[A].allowsConnector()!==!1)if(B+.1>v-i.sum-a.condensable){var h=B-v;-.1>h&&!function(){var t=h/(i.sum+a.condensable),e=0;i.forEach(function(i){e+=t*i.condensable,i.notation.bounds.x+=e})}(),n.bounds.x+=h,s=0,p=!0,f=h>.5}else if(t.minLyricWordSpacing<t.hyphenWidth&&(b=v-B,b<t.hyphenWidth&&(m=e.length>1?t.intraNeumeSpacing:t.minLyricWordSpacing,e[A].setConnectorWidth(Math.max(m,b)))),e[A].setNeedsConnector(!0),B=e[A].getRight(),B+.1>v){var u=B-v;n.bounds.x+=u,s=0,f=u>.5}else s=v-B;else if(B+t.minLyricWordSpacing>v){var l=B+t.minLyricWordSpacing-v;n.bounds.x+=l,s=0,f=l>.5}else s=v-B-t.minLyricWordSpacing;if(null!==s&&s<i.sum+a.condensable){var c=i.length+1;a.condensable=s/c,i.sum&&(s-=a.condensable,i.forEach(function(t){t.condensable=s*(t.condensable/i.sum)}),o.sum=o.map(function(t){return t.condensable}).reduce(function(t,e){return t+e},0))}};for(A=0;A<n.lyrics.length;A++){var B,v,b,m;y()}}while(n.lyrics.length>1&&f&&p);for(A=Math.min(n.lyrics.length,e.length)-1;A>=0;A--){var C=e[A];C.needsConnector&&C.connectorWidth&&(v=n.lyrics[A].getLeft(),B=C.getRight()-C.connectorWidth,b=v-B,b>=t.hyphenWidth&&(b=0),C.setConnectorWidth(b))}if(n.bounds.right()+n.trailingSpace<s+o.sum+a.condensable&&l.LyricArray.getRight(n.lyrics,!0)<=this.staffRight+o.sum+a.condensable){if(i.isAccidental){var w=n.bounds.x-i.bounds.width-i.trailingSpace-i.bounds.x;if(i.bounds.x+=w,Math.abs(w)>.1){var x=o[o.length-1];o.sum-=x.condensable,x.condensable=0}}return o.push(a),o.sum+=a.condensable,!0}return!1}}]),e}(l.ChantLayoutElement)},function(t,e,i){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e["default"]=t,e}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function A(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Virga=e.Tristropha=e.TorculusResupinusFlexus=e.TorculusResupinus=e.Torculus=e.ScandicusFlexus=e.Scandicus=e.SalicusFlexus=e.Salicus=e.Punctum=e.PunctaInclinata=e.PorrectusFlexus=e.Porrectus=e.Podatus=e.PesSubpunctis=e.PesQuassus=e.Oriscus=e.Distropha=e.Clivis=e.Climacus=e.Trivirga=e.Bivirga=e.Apostropha=e.Neume=void 0;var a=function y(t,e,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var s=Object.getPrototypeOf(t);return null===s?void 0:y(s,e,i)}if("value"in n)return n.value;var o=n.get;if(void 0!==o)return o.call(i)},r=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),h=i(1),u=(n(h),i(4)),l=i(6),c=i(9),g=i(3),d=function(){function t(e,i){var n=arguments.length<=2||void 0===arguments[2]?0:arguments[2];A(this,t),this.ctxt=e,this.neume=i,this.x=n,this.lastNote=null,this.lineIsHanging=!1,this.minX=0}return r(t,[{key:"lineFrom",value:function(t){var e=this.ctxt.notations[this.ctxt.currNotationIndex-1];return 0===this.x&&e&&e.notes&&0===e.trailingSpace?(this.lastNote=e.notes.slice(-1)[0],this.minX=-this.ctxt.neumeLineWeight):(this.lastNote=t,this.lineIsHanging=!0),this}},{key:"noteAt",value:function(t,e){var i=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];if(!t)throw"NeumeBuilder.noteAt: note must be a valid note";if(!e)throw"NeumeBuilder.noteAt: glyph must be a valid glyph code";t.setGlyph(this.ctxt,e);var n="right"===t.glyphVisualizer.align,s=i&&null!==this.lastNote&&(this.lineIsHanging||this.lastNote.glyphVisualizer&&"right"===this.lastNote.glyphVisualizer.align||Math.abs(this.lastNote.staffPosition-t.staffPosition)>1);if(s){var o=new u.NeumeLineVisualizer(this.ctxt,this.lastNote,t,this.lineIsHanging);this.neume.addVisualizer(o),o.bounds.x=Math.max(this.minX,this.x-o.bounds.width),n||(this.x=o.bounds.x)}return n&&this.lastNote?t.bounds.x=this.x-t.bounds.width:(t.bounds.x=this.x,this.x+=t.bounds.width),this.neume.addVisualizer(t),this.lastNote=t,this.lineIsHanging=!1,this}},{key:"virgaAt",value:function(t){arguments.length<=1||void 0===arguments[1]?!0:arguments[1];this.noteAt(t,u.GlyphCode.PunctumQuadratum);var e=new u.VirgaLineVisualizer(this.ctxt,t);return this.x-=e.bounds.width,e.bounds.x=this.x,this.neume.addVisualizer(e),this.lastNote=t,this.lineIsHanging=!1,this}},{key:"advanceBy",value:function(t){return this.lastNote=null,this.lineIsHanging=!1,this.x+=t,this}},{key:"withLineEndingAt",value:function(t){if(null!==this.lastNote){var e=new u.NeumeLineVisualizer(this.ctxt,this.lastNote,t,!0);return this.neume.addVisualizer(e),this.x-=e.bounds.width,e.bounds.x=this.x,this.neume.addVisualizer(e),this.lastNote=t,this}}},{key:"withPodatus",value:function(t,e){var i,n;return t.liquescent===l.LiquescentType.InitioDebilis?(i=e.liquescent===l.LiquescentType.None?u.GlyphCode.PunctumQuadratum:u.GlyphCode.PunctumQuadratumDesLiquescent,n=u.GlyphCode.TerminatingDesLiquescent):e.liquescent&l.LiquescentType.Small?(n=u.GlyphCode.BeginningAscLiquescent,i=u.GlyphCode.TerminatingAscLiquescent):e.liquescent&l.LiquescentType.Ascending?(n=u.GlyphCode.PunctumQuadratum,i=u.GlyphCode.PunctumQuadratumAscLiquescent):e.liquescent&l.LiquescentType.Descending?(n=u.GlyphCode.PunctumQuadratum,i=u.GlyphCode.PunctumQuadratumDesLiquescent):(n=u.GlyphCode.PodatusLower,i=u.GlyphCode.PodatusUpper),t.shape===l.NoteShape.Quilisma&&(n=u.GlyphCode.Quilisma),this.noteAt(t,n).noteAt(e,i),this.lastNote=null,this}},{key:"withClivis",value:function(t,e){var i;return t.shape===l.NoteShape.Oriscus?this.noteAt(t,u.GlyphCode.OriscusDes,!1):this.lineFrom(e).noteAt(t,u.GlyphCode.PunctumQuadratum),i=e.liquescent&l.LiquescentType.Small?u.GlyphCode.TerminatingDesLiquescent:e.liquescent===l.LiquescentType.Ascending?u.GlyphCode.PunctumQuadratumAscLiquescent:e.liquescent===l.LiquescentType.Descending?u.GlyphCode.PunctumQuadratumDesLiquescent:u.GlyphCode.PunctumQuadratum,this.noteAt(e,i),this.lastNote=null,this}},{key:"withInclinata",value:function(t){for(var e=t[0].staffPosition,i=t[0].staffPosition,n=g.Glyphs.PunctumInclinatum.bounds.width*this.ctxt.glyphScaling,s=0;s<t.length;s++,i=e){var o=t[s];o.liquescent&l.LiquescentType.Small?o.setGlyph(this.ctxt,u.GlyphCode.PunctumInclinatumLiquescent):o.liquescent&l.LiquescentType.Large?o.setGlyph(this.ctxt,u.GlyphCode.Stropha):o.setGlyph(this.ctxt,u.GlyphCode.PunctumInclinatum),e=o.staffPosition;var A=Math.abs(i-e);switch(A){case 0:A=1.1;break;default:A*=2/3}s>0&&(this.x+=n*A),o.bounds.x=this.x,this.neume.addVisualizer(o)}return this}},{key:"withPorrectusSwash",value:function(t,e){var i=null!==this.lastNote&&(this.lineIsHanging||this.lastNote.glyphVisualizer&&"right"===this.lastNote.glyphVisualizer.align||Math.abs(this.lastNote.staffPosition-t.staffPosition)>1);if(i){var n=new u.NeumeLineVisualizer(this.ctxt,this.lastNote,t,this.lineIsHanging);this.x=Math.max(this.minX,this.x-n.bounds.width),n.bounds.x=this.x,this.neume.addVisualizer(n)}var s;switch(t.staffPosition-e.staffPosition){case 1:s=u.GlyphCode.Porrectus1;break;case 2:s=u.GlyphCode.Porrectus2;break;case 3:s=u.GlyphCode.Porrectus3;break;case 4:s=u.GlyphCode.Porrectus4;break;default:s=u.GlyphCode.None}return t.setGlyph(this.ctxt,s),t.bounds.x=this.x,e.setGlyph(this.ctxt,u.GlyphCode.None),this.x=t.bounds.right(),e.bounds.x=this.x-e.bounds.width,this.neume.addVisualizer(t),this.neume.addVisualizer(e),this.lastNote=e,this.lineIsHanging=!1,this}}]),t}(),f=e.Neume=function(t){function e(){var t=arguments.length<=0||void 0===arguments[0]?[]:arguments[0];A(this,e);var i=s(this,Object.getPrototypeOf(e).call(this));i.isNeume=!0,i.notes=t;for(var n=0;n<t.length;n++)t[n].neume=i;return i}return o(e,t),r(e,[{key:"addNote",value:function(t){t.neume=this,this.notes.push(t)}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t)}},{key:"finishLayout",value:function(t){this.ledgerLines=this.requiresLedgerLine(),this.positionMarkings();for(var i=0;i<this.notes.length;i++){var n,s=this.notes[i];for(n=0;n<s.episemata.length;n++)s.episemata[n].performLayout(t),this.addVisualizer(s.episemata[n]);for(n=0;n<s.morae.length;n++)s.morae[n].performLayout(t),this.addVisualizer(s.morae[n]);s.ictus&&(s.ictus.performLayout(t),this.addVisualizer(s.ictus)),s.acuteAccent&&(s.acuteAccent.performLayout(t),this.addVisualizer(s.acuteAccent))}this.origin.x=this.notes[0].origin.x,this.origin.y=this.notes[0].origin.y,a(Object.getPrototypeOf(e.prototype),"finishLayout",this).call(this,t)}},{key:"requiresLedgerLine",value:function(){var t=!1,e=!1,i=!1,n=!1,s=[];if(!this.notes)return s;for(var o=0;o<this.notes.length;++o){var A=this.notes[o],a=A.staffPosition;if(a>=4){if(e=e||a>=5,t===!1&&(t=Math.max(0,o-1)),a>=5)continue}else if(-4>=a&&(n=n||-5>=a,i===!1&&(i=Math.max(0,o-1)),-5>=a))continue;if(e||n){var r=o;s.push({element:this.notes[t||i||0],endElem:this.notes[r],staffPosition:e?5:-5}),t=i=e=n=!1}}return(e||n)&&s.push({element:this.notes[t||i||0],endElem:this.notes[this.notes.length-1],staffPosition:e?5:-5}),s}},{key:"resetDependencies",value:function(){}},{key:"build",value:function(t){return new d(t,this)}},{key:"positionEpisemata",value:function(t,e){var i;for(i=0;i<t.episemata.length;i++)t.episemata[i].positionHint===c.MarkingPositionHint.Default&&(t.episemata[i].positionHint=e);return t.episemata.length}},{key:"positionEpisemataAbove",value:function(t){return this.positionEpisemata(t,c.MarkingPositionHint.Above)}},{key:"positionEpisemataBelow",value:function(t){return this.positionEpisemata(t,c.MarkingPositionHint.Below)}},{key:"positionPodatusEpisemata",value:function(t,e){this.positionEpisemataBelow(t),this.positionEpisemataAbove(e)}},{key:"positionInclinataMorae",value:function(t){if(t=t.slice(-2),!(t.length<2||t[1].staffPosition>t[0].staffPosition)){var e,i=t[1],n=t[0];1===Math.abs(i.staffPosition%2)&&n.staffPosition-i.staffPosition===1&&i.morae.length>0&&(e=i.morae.slice(-1)[0],e.positionHint===c.MarkingPositionHint.Default&&(e.positionHint=c.MarkingPositionHint.Below))}}},{key:"positionPodatusMorae",value:function(t,e){var i;1===Math.abs(t.staffPosition%2)&&(1===t.morae.length?i=t.morae[0]:e.morae.length>1&&(i=e.morae[0]),i&&i.positionHint===c.MarkingPositionHint.Default&&(i.positionHint=c.MarkingPositionHint.Below)),t.morae.length>0&&0===e.morae.length&&(t.morae[0].ignoreBounds=!0)}},{key:"positionPodatusMarkings",value:function(t,e){this.positionPodatusEpisemata(t,e),this.positionPodatusMorae(t,e)}},{key:"positionTorculusMarkings",value:function(t,e,i){var n=this.positionClivisMarkings(e,i);return n=this.positionEpisemata(t,n?c.MarkingPositionHint.Above:c.MarkingPositionHint.Below)&&n}},{key:"positionClivisMorae",value:function(t,e){var i=t.morae.concat(e.morae);e.morae.length&&(i.length>1&&(i[0].horizontalOffset+=e.bounds.right()-t.bounds.right()),t.staffPosition-e.staffPosition===1&&1===Math.abs(e.staffPosition%2)&&(i.slice(-1)[0].positionHint=c.MarkingPositionHint.Below))}},{key:"positionClivisEpisemata",value:function(t,e){var i=this.positionEpisemataAbove(t);return this.positionEpisemata(e,i?c.MarkingPositionHint.Above:c.MarkingPositionHint.Below),i}},{key:"positionClivisMarkings",value:function(t,e){return this.positionClivisMorae(t,e),this.positionClivisEpisemata(t,e)}},{key:"positionPorrectusMarkings",value:function(t,e,i){this.positionClivisEpisemata(t,e),this.positionPodatusMarkings(e,i)}},{key:"positionPorrectusFlexusMarkings",value:function(t,e,i,n){var s=this.positionEpisemataAbove(t);s=this.positionClivisMarkings(i,n)||s,this.positionEpisemata(e,s?c.MarkingPositionHint.Above:c.MarkingPositionHint.Below)}},{key:"positionMarkings",value:function(){}}]),e}(u.ChantNotationElement),p=e.Apostropha=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),r(e,[{key:"positionMarkings",value:function(){for(var t=c.MarkingPositionHint.Above,e=0;e<this.notes[0].episemata.length;e++)this.notes[0].episemata[e].positionHint===c.MarkingPositionHint.Default?this.notes[0].episemata[e].positionHint=t:t=this.notes[0].episemata[e].positionHint,t=t===c.MarkingPositionHint.Above?c.MarkingPositionHint.Below:c.MarkingPositionHint.Above}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t),this.build(t).noteAt(this.notes[0],e.getNoteGlyphCode(this.notes[0])),this.finishLayout(t)}}],[{key:"getNoteGlyphCode",value:function(t){return t.shape===l.NoteShape.Stropha?u.GlyphCode.Stropha:t.liquescent&l.LiquescentType.Ascending?u.GlyphCode.PunctumQuadratumAscLiquescent:t.liquescent&l.LiquescentType.Descending?u.GlyphCode.PunctumQuadratumDesLiquescent:t.shapeModifiers&l.NoteShapeModifiers.Cavum?u.GlyphCode.PunctumCavum:u.GlyphCode.PunctumQuadratum}}]),e}(f);e.Bivirga=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),r(e,[{key:"positionMarkings",value:function(){this.positionEpisemataAbove(this.notes[0]),this.positionEpisemataAbove(this.notes[1])}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t),this.build(t).virgaAt(this.notes[0]).advanceBy(t.intraNeumeSpacing).virgaAt(this.notes[1]),this.finishLayout(t)}}]),e}(f),e.Trivirga=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),r(e,[{key:"positionMarkings",value:function(){this.positionEpisemataAbove(this.notes[0]),this.positionEpisemataAbove(this.notes[1]),this.positionEpisemataAbove(this.notes[2])}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t),this.build(t).virgaAt(this.notes[0]).advanceBy(t.intraNeumeSpacing).virgaAt(this.notes[1]).advanceBy(t.intraNeumeSpacing).virgaAt(this.notes[2]),this.finishLayout(t)}}]),e}(f),e.Climacus=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),r(e,[{key:"positionMarkings",value:function(){for(var t=0;t<this.notes.length;t++)this.positionEpisemataAbove(this.notes[t]);this.positionInclinataMorae(this.notes)}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t),this.build(t).virgaAt(this.notes[0]).advanceBy(t.intraNeumeSpacing).withInclinata(this.notes.slice(1)),this.finishLayout(t)}}]),e}(f),e.Clivis=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),r(e,[{key:"positionMarkings",value:function(){this.positionClivisMarkings(this.notes[0],this.notes[1])}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t);var i=this.notes[0],n=this.notes[1];this.build(t).withClivis(i,n),this.finishLayout(t)}}]),e}(f),e.Distropha=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),r(e,[{key:"positionMarkings",value:function(){this.positionEpisemataAbove(this.notes[0]),this.positionEpisemataAbove(this.notes[1])}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t),this.build(t).noteAt(this.notes[0],p.getNoteGlyphCode(this.notes[0])).advanceBy(t.intraNeumeSpacing).noteAt(this.notes[1],p.getNoteGlyphCode(this.notes[1])),this.finishLayout(t)}}]),e}(f),e.Oriscus=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),r(e,[{key:"positionMarkings",value:function(){this.positionEpisemataAbove(this.notes[0])}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t);var i,n=this.notes[0];if(n.liquescent!==l.LiquescentType.None)i=u.GlyphCode.OriscusLiquescent;else if(n.shapeModifiers&l.NoteShapeModifiers.Ascending)i=u.GlyphCode.OriscusAsc;else if(n.shapeModifiers&l.NoteShapeModifiers.Descending)i=u.GlyphCode.OriscusDes;else{i=u.GlyphCode.OriscusDes;var s=t.findNextNeume();if(s){var o=t.activeClef.pitchToStaffPosition(s.notes[0].pitch);o>n.staffPosition&&(i=u.GlyphCode.OriscusAsc)}}this.build(t).noteAt(n,i),this.finishLayout(t)}},{key:"resetDependencies",value:function(){this.notes[0].shapeModifiers&l.NoteShapeModifiers.Ascending||this.notes[0].shapeModifiers&l.NoteShapeModifiers.Descending||(this.needsLayout=!0)}}]),e}(f),e.PesQuassus=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),r(e,[{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t);var i,n=this.notes[0],s=this.notes[1],o=n.staffPosition,A=s.staffPosition;i=n.shape===l.NoteShape.Oriscus?u.GlyphCode.OriscusAsc:u.GlyphCode.PunctumQuadratum;var r=this.build(t).noteAt(n,i);A-o===1?r.virgaAt(s):s.liquescent===l.LiquescentType.LargeDescending?r.noteAt(s,u.GlyphCode.PunctumQuadratumDesLiquescent).withLineEndingAt(n):r.noteAt(s,u.GlyphCode.PunctumQuadratum).withLineEndingAt(n),this.finishLayout(t)}}]),e}(f),e.PesSubpunctis=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),r(e,[{key:"positionMarkings",value:function(){this.positionPodatusEpisemata(this.notes[0],this.notes[1]);for(var t=2;t<this.notes.length;++t)this.positionEpisemataAbove(this.notes[t]);this.positionInclinataMorae(this.notes.slice(1))}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t),this.build(t).withPodatus(this.notes[0],this.notes[1]).advanceBy(.68*t.intraNeumeSpacing).withInclinata(this.notes.slice(2)),this.finishLayout(t)}}]),e}(f),e.Podatus=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),r(e,[{key:"positionMarkings",value:function(){this.positionPodatusMarkings(this.notes[0],this.notes[1])}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t),this.build(t).withPodatus(this.notes[0],this.notes[1]),this.finishLayout(t)}}]),e}(f),e.Porrectus=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),r(e,[{key:"positionMarkings",value:function(){this.positionPorrectusMarkings(this.notes[0],this.notes[1],this.notes[2])}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t);var i,n=this.notes[0],s=this.notes[1],o=this.notes[2];i=o.liquescent&l.LiquescentType.Small?u.GlyphCode.TerminatingAscLiquescent:o.liquescent&l.LiquescentType.Descending?u.GlyphCode.PunctumQuadratumDesLiquescent:u.GlyphCode.PodatusUpper,this.build(t).lineFrom(s).withPorrectusSwash(n,s).noteAt(o,i),this.finishLayout(t)}}]),e}(f),e.PorrectusFlexus=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),r(e,[{key:"positionMarkings",value:function(){this.positionPorrectusFlexusMarkings(this.notes[0],this.notes[1],this.notes[2],this.notes[3])}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t);var i,n=this.notes[0],s=this.notes[1],o=this.notes[2],A=this.notes[3],r=u.GlyphCode.PunctumQuadratum;A.liquescent&l.LiquescentType.Small?(r=u.GlyphCode.PunctumQuadratumDesLiquescent,i=u.GlyphCode.TerminatingDesLiquescent):i=A.liquescent&l.LiquescentType.Ascending?u.GlyphCode.PunctumQuadratumAscLiquescent:A.liquescent&l.LiquescentType.Descending?u.GlyphCode.PunctumQuadratumDesLiquescent:u.GlyphCode.PunctumQuadratum,this.build(t).lineFrom(s).withPorrectusSwash(n,s).noteAt(o,r).noteAt(A,i),this.finishLayout(t)}}]),e}(f),e.PunctaInclinata=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),r(e,[{key:"positionMarkings",value:function(){this.positionInclinataMorae(this.notes)}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t),this.build(t).withInclinata(this.notes),this.finishLayout(t)}}]),e}(f),e.Punctum=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),r(e,[{key:"positionMarkings",value:function(){this.positionEpisemataAbove(this.notes[0])}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t);var i=this.notes[0],n=u.GlyphCode.PunctumQuadratum;i.liquescent!==l.LiquescentType.None?i.shape===l.NoteShape.Inclinatum?n=u.GlyphCode.PunctumInclinatumLiquescent:i.shape===l.NoteShape.Oriscus?n=u.GlyphCode.OriscusLiquescent:i.liquescent&l.LiquescentType.Ascending?n=u.GlyphCode.PunctumQuadratumAscLiquescent:i.liquescent&l.LiquescentType.Descending&&(n=u.GlyphCode.PunctumQuadratumDesLiquescent):n=i.shapeModifiers&l.NoteShapeModifiers.Cavum?u.GlyphCode.PunctumCavum:i.shape===l.NoteShape.Inclinatum?u.GlyphCode.PunctumInclinatum:i.shape===l.NoteShape.Quilisma?u.GlyphCode.Quilisma:u.GlyphCode.PunctumQuadratum,this.build(t).noteAt(i,n),this.finishLayout(t)}}]),e}(f),e.Salicus=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),r(e,[{key:"positionMarkings",value:function(){for(var t=0;t<this.notes.length;t++)this.positionEpisemataBelow(this.notes[t])}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t);var i=this.notes[0],n=this.notes[1],s=this.notes[2],o=this.build(t).noteAt(i,u.GlyphCode.PunctumQuadratum);n.shapeModifiers&l.NoteShapeModifiers.Stemmed||o.advanceBy(t.intraNeumeSpacing),o.noteAt(n,u.GlyphCode.OriscusAsc),s.liquescent&l.LiquescentType.Small?o.noteAt(s,u.GlyphCode.TerminatingAscLiquescent):s.liquescent===l.LiquescentType.Ascending?o.noteAt(s,u.GlyphCode.PunctumQuadratumAscLiquescent):s.liquescent===l.LiquescentType.Descending?o.noteAt(s,u.GlyphCode.PunctumQuadratumDesLiquescent):o.virgaAt(s),this.finishLayout(t)}}]),e}(f),e.SalicusFlexus=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),r(e,[{key:"positionMarkings",value:function(){var t=this.positionTorculusMarkings(this.notes[1],this.notes[2],this.notes[3]);this.positionEpisemata(this.notes[0],t?c.MarkingPositionHint.Above:c.MarkingPositionHint.Below)}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t);var i=this.notes[0],n=this.notes[1],s=this.notes[2],o=this.notes[3],A=this.build(t).noteAt(i,u.GlyphCode.PunctumQuadratum);n.shapeModifiers&l.NoteShapeModifiers.Stemmed||A.advanceBy(t.intraNeumeSpacing),A.noteAt(n,u.GlyphCode.OriscusAsc),o.liquescent&l.LiquescentType.Small?A.noteAt(s,u.GlyphCode.PunctumQuadratumDesLiquescent):A.noteAt(s,u.GlyphCode.PunctumQuadratum),o.liquescent&l.LiquescentType.Small?A.noteAt(o,u.GlyphCode.TerminatingDesLiquescent):o.liquescent&l.LiquescentType.Ascending?A.noteAt(o,u.GlyphCode.PunctumQuadratumAscLiquescent):o.liquescent&l.LiquescentType.Descending?A.noteAt(o,u.GlyphCode.PunctumQuadratumDesLiquescent):A.noteAt(o,u.GlyphCode.PunctumQuadratum),this.finishLayout(t)}}]),e}(f),e.Scandicus=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),r(e,[{key:"positionMarkings",value:function(){this.notes[2].shape===l.NoteShape.Virga?(this.positionPodatusMarkings(this.notes[0],this.notes[1]),this.positionEpisemataAbove(this.notes[2])):(this.positionEpisemataBelow(this.notes[0]),this.positionPodatusMarkings(this.notes[1],this.notes[2]))}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t);var i=this.notes[0],n=this.notes[1],s=this.notes[2];s.shape===l.NoteShape.Virga?this.build(t).withPodatus(i,n).virgaAt(s):this.build(t).noteAt(i,i.shape===l.NoteShape.Quilisma?u.GlyphCode.Quilisma:u.GlyphCode.PunctumQuadratum).withPodatus(n,s),this.finishLayout(t)}}]),e}(f),e.ScandicusFlexus=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),r(e,[{key:"positionMarkings",value:function(){this.notes[2].shape===l.NoteShape.Virga?(this.positionPodatusMarkings(this.notes[0],this.notes[1]),this.positionClivisMarkings(this.notes[2],this.notes[3])):(this.positionEpisemataBelow(this.notes[0]),this.positionPodatusMarkings(this.notes[1],this.notes[2]),this.positionEpisemataAbove(this.notes[3]))}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t);var i=this.notes[0],n=this.notes[1],s=this.notes[2],o=this.notes[3];if(s.shape===l.NoteShape.Virga)this.build(t).withPodatus(i,n).advanceBy(t.intraNeumeSpacing).withClivis(s,o);else{var A=u.GlyphCode.PunctumQuadratum;o.liquescent&l.LiquescentType.Ascending?A=u.GlyphCode.PunctumQuadratumAscLiquescent:o.liquescent&l.LiquescentType.Descending&&(A=u.GlyphCode.PunctumQuadratumDesLiquescent),this.build(t).noteAt(i,u.GlyphCode.PunctumQuadratum).withPodatus(n,s).advanceBy(t.intraNeumeSpacing).noteAt(o,A)}this.finishLayout(t)}}]),e}(f),e.Torculus=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),r(e,[{key:"positionMarkings",value:function(){this.positionTorculusMarkings(this.notes[0],this.notes[1],this.notes[2])}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t);var i,n,s=this.notes[0],o=this.notes[1],A=this.notes[2];i=s.liquescent===l.LiquescentType.InitioDebilis?u.GlyphCode.TerminatingDesLiquescent:s.shape===l.NoteShape.Quilisma?u.GlyphCode.Quilisma:u.GlyphCode.PunctumQuadratum,
n=A.liquescent&l.LiquescentType.Small?u.GlyphCode.TerminatingDesLiquescent:A.liquescent&l.LiquescentType.Ascending?u.GlyphCode.PunctumQuadratumAscLiquescent:A.liquescent&l.LiquescentType.Descending?u.GlyphCode.PunctumQuadratumDesLiquescent:u.GlyphCode.PunctumQuadratum,this.build(t).noteAt(s,i).noteAt(o,u.GlyphCode.PunctumQuadratum).noteAt(A,n),this.finishLayout(t)}}]),e}(f),e.TorculusResupinus=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),r(e,[{key:"positionMarkings",value:function(){this.positionPorrectusMarkings(this.notes[1],this.notes[2],this.notes[3]),this.positionClivisEpisemata(this.notes[1],this.notes[0])}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t);var i,n,s=this.notes[0],o=this.notes[1],A=this.notes[2],r=this.notes[3];i=s.liquescent===l.LiquescentType.InitioDebilis?u.GlyphCode.TerminatingDesLiquescent:s.shape===l.NoteShape.Quilisma?u.GlyphCode.Quilisma:u.GlyphCode.PunctumQuadratum,n=r.liquescent&l.LiquescentType.Small?u.GlyphCode.TerminatingAscLiquescent:A.liquescent&l.LiquescentType.Descending?u.GlyphCode.PunctumQuadratumDesLiquescent:u.GlyphCode.PodatusUpper,this.build(t).noteAt(s,i).withPorrectusSwash(o,A).noteAt(r,n),this.finishLayout(t)}}]),e}(f),e.TorculusResupinusFlexus=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),r(e,[{key:"positionMarkings",value:function(){this.positionPorrectusFlexusMarkings(this.notes[1],this.notes[2],this.notes[3],this.notes[4]),this.positionClivisEpisemata(this.notes[1],this.notes[0])}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t);var i,n,s=this.notes[0],o=this.notes[1],A=this.notes[2],r=this.notes[3],h=this.notes[4],c=u.GlyphCode.PunctumQuadratum;i=s.liquescent===l.LiquescentType.InitioDebilis?u.GlyphCode.TerminatingDesLiquescent:s.shape===l.NoteShape.Quilisma?u.GlyphCode.Quilisma:u.GlyphCode.PunctumQuadratum,h.liquescent&l.LiquescentType.Small?(c=u.GlyphCode.PunctumQuadratumDesLiquescent,n=u.GlyphCode.TerminatingDesLiquescent):n=h.liquescent&l.LiquescentType.Ascending?u.GlyphCode.PunctumQuadratumAscLiquescent:h.liquescent&l.LiquescentType.Descending?u.GlyphCode.PunctumQuadratumDesLiquescent:u.GlyphCode.PunctumQuadratum,this.build(t).noteAt(s,i).withPorrectusSwash(o,A).noteAt(r,c).noteAt(h,n),this.finishLayout(t)}}]),e}(f),e.Tristropha=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),r(e,[{key:"positionMarkings",value:function(){this.positionEpisemataAbove(this.notes[0]),this.positionEpisemataAbove(this.notes[1]),this.positionEpisemataAbove(this.notes[2])}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t),this.build(t).noteAt(this.notes[0],p.getNoteGlyphCode(this.notes[0])).advanceBy(t.intraNeumeSpacing).noteAt(this.notes[1],p.getNoteGlyphCode(this.notes[1])).advanceBy(t.intraNeumeSpacing).noteAt(this.notes[2],p.getNoteGlyphCode(this.notes[2])),this.finishLayout(t)}}]),e}(f),e.Virga=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),r(e,[{key:"positionMarkings",value:function(){this.positionEpisemataAbove(this.notes[0])}},{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t),this.build(t).virgaAt(this.notes[0]),this.finishLayout(t)}}]),e}(f)},function(t,e,i){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e["default"]=t,e}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function A(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.BracePoint=e.BraceAttachment=e.BraceShape=e.Mora=e.Ictus=e.HorizontalEpisema=e.HorizontalEpisemaAlignment=e.AcuteAccent=e.MarkingPositionHint=void 0;var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=i(1),h=(n(r),i(4)),u=i(6),l=e.MarkingPositionHint={Default:0,Above:1,Below:2},c=(e.AcuteAccent=function(t){function e(t,i){s(this,e);var n=o(this,Object.getPrototypeOf(e).call(this,t,h.GlyphCode.AcuteAccent));return n.note=i,n.positionHint=l.Above,n}return A(e,t),a(e,[{key:"performLayout",value:function(t){this.bounds.x+=this.bounds.width/2,this.setStaffPosition(t,Math.max(this.note.staffPosition+1,4))}}]),e}(h.GlyphVisualizer),e.HorizontalEpisemaAlignment={Default:0,Left:1,Center:2,Right:3}),g=(e.HorizontalEpisema=function(t){function e(t){s(this,e);var i=o(this,Object.getPrototypeOf(e).call(this));return i.note=t,i.positionHint=l.Default,i.terminating=!1,i.alignment=c.Default,i}return A(e,t),a(e,[{key:"performLayout",value:function(t){var e,i=0,n=.25*t.staffInterval,s=this.note.glyphVisualizer.glyphCode,o=this.note.neume.ledgerLines[0]||{},A=!1;if(s===h.GlyphCode.PunctumInclinatum){var a=this.note.neume.notes,r=a.indexOf(this.note),u=a[r-1];u&&u.glyphVisualizer.glyphCode===h.GlyphCode.PunctumInclinatum&&u.staffPosition-this.note.staffPosition===1&&(A=!0)}this.positionHint===l.Below?(i=this.note.bounds.bottom()+n,s===h.GlyphCode.None&&(i+=t.staffInterval/2),e=Math.ceil(i/t.staffInterval),e%2===0?e=(e+.75+(i-n)/t.staffInterval)/2:(e=(2*Math.ceil(1.5*i/t.staffInterval-.5)+1)/3,Math.abs(e)%2===1&&(e+=Math.abs(e)<4||o.staffPosition===-e?2/3:1/3))):(i=this.note.bounds.y-n,e=Math.floor(i/t.staffInterval),e%2===0?e=(e-.75+(i+n)/t.staffInterval)/2:(e=(2*Math.floor(1.5*i/t.staffInterval-.5)+1)/3,Math.abs(e)%2===1&&(e-=Math.abs(e)<4||o.staffPosition===-e?2/3:1/3))),i=e*t.staffInterval;var g=this.note.bounds.width,d=this.note.bounds.x;s===h.GlyphCode.Porrectus1||s===h.GlyphCode.Porrectus2||s===h.GlyphCode.Porrectus3||s===h.GlyphCode.Porrectus4?g=t.staffInterval:s===h.GlyphCode.None?(g=t.staffInterval,d-=g):A?(g*=2/3,d+=.5*g):s===h.GlyphCode.PunctumInclinatumLiquescent&&(g*=2/3,d+=.25*g),this.alignment===c.Left?g*=.8:this.alignment===c.Center?(d+=.1*g,g*=.8):this.alignment===c.Right&&(d+=.2*g,g*=.8),this.bounds.x=d,this.bounds.y=i-t.episemaLineWeight/2,this.bounds.width=g,this.bounds.height=t.episemaLineWeight,this.origin.x=0,this.origin.y=0}},{key:"draw",value:function(t){var e=t.canvasCtxt;e.fillStyle=t.neumeLineColor,e.fillRect(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height)}},{key:"createSvgNode",value:function(t){return h.QuickSvg.createNode("rect",{x:this.bounds.x,y:this.bounds.y,width:this.bounds.width,height:this.bounds.height,fill:t.neumeLineColor,"class":"horizontalEpisema"})}},{key:"createSvgFragment",value:function(t){return h.QuickSvg.createFragment("rect",{x:this.bounds.x,y:this.bounds.y,width:this.bounds.width,height:this.bounds.height,fill:t.neumeLineColor,"class":"horizontalEpisema"})}}]),e}(h.ChantLayoutElement),e.Ictus=function(t){function e(t,i){s(this,e);var n=o(this,Object.getPrototypeOf(e).call(this,t,h.GlyphCode.VerticalEpisemaAbove));return n.note=i,n.positionHint=l.Default,n}return A(e,t),a(e,[{key:"performLayout",value:function(t){var e,i=this.note.glyphVisualizer.glyphCode,n=this.positionHint||l.Below,s=this.note.staffPosition+(n===l.Above?1:-1),o=this.note.episemata.length>0&&(this.note.episemata[0].positionHint||l.Above)===n,A=1,a=-.2,r=0,u=s%2&&(Math.abs(s)<4||(this.note.neume.ledgerLines[0]||{}).staffPosition===s);i===h.GlyphCode.Porrectus1||i===h.GlyphCode.Porrectus2||i===h.GlyphCode.Porrectus3||i===h.GlyphCode.Porrectus4?e=t.staffInterval/2:i===h.GlyphCode.None?e=-t.staffInterval/2:(e=this.note.bounds.width/2,i!==h.GlyphCode.PunctumInclinatum||u||o||(r=.3)),this.positionHint===l.Above?(i=h.GlyphCode.VerticalEpisemaAbove,A*=-1):i=h.GlyphCode.VerticalEpisemaBelow,o&&(r=.4),A*=t.staffInterval*(r+(u?.3:a)),this.setGlyph(t,i),this.setStaffPosition(t,s),this.bounds.x=this.note.bounds.x+e-this.origin.x,this.bounds.y+=A}}]),e}(h.GlyphVisualizer),e.Mora=function(t){function e(t,i){s(this,e);var n=o(this,Object.getPrototypeOf(e).call(this,t,h.GlyphCode.Mora));return n.note=i,n.positionHint=l.Default,n.horizontalOffset=t.staffInterval/2+n.origin.x,n}return A(e,t),a(e,[{key:"performLayout",value:function(t){var e=this.note.staffPosition;this.setStaffPosition(t,e);var i=0;if(this.horizontalOffset===t.staffInterval/2+this.origin.x){var n,s=this.note.neume.notes.indexOf(this.note);if(s>=0)if(++s,this.note.neume.notes.length>s)n=this.note.neume.notes[s],n.bounds.right()>this.note.bounds.right()?this.horizontalOffset=(n.bounds.right()-this.note.bounds.right()-this.bounds.right())/2:n=null;else if(this.note.neume.notes.length===s)if(0===this.note.neume.trailingSpace){var o=this.note.neume.score.notations.indexOf(this.note.neume);if(o>=0){var A=this.note.neume.score.notations[o+1];A&&A.notes&&(n=A.notes[0])}}else this.note.shape!==u.NoteShape.Inclinatum&&(this.note.neume.trailingSpace+=this.origin.x)}this.positionHint===l.Above?i-=e%2===0?1.75*t.staffInterval:.75*t.staffInterval:this.positionHint===l.Below?i+=e%2===0?1.75*t.staffInterval:.75*t.staffInterval:e%2===0?n&&n.staffPosition===e-1&&(i-=.25*t.staffInterval):i-=.75*t.staffInterval,this.bounds.x+=this.horizontalOffset+this.note.bounds.right(),this.bounds.y+=i}}]),e}(h.GlyphVisualizer),e.BraceShape={RoundBrace:0,CurlyBrace:1,AccentedCurlyBrace:2},e.BraceAttachment={Left:0,Right:1});e.BracePoint=function(t){function e(t,i,n,A){s(this,e);var a=o(this,Object.getPrototypeOf(e).call(this));return a.note=t,a.isAbove=i,a.shape=n,a.attachment=A,a}return A(e,t),a(e,[{key:"getAttachmentX",value:function(t){return t||(t=this.note),this.attachment===g.Left?(t.neume?t.neume.bounds.x:0)+t.bounds.x:(t.neume?t.neume.bounds.x:0)+t.bounds.right()}}]),e}(h.ChantLayoutElement)},function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.Virgula=e.Accidental=e.AccidentalType=e.DoubleBar=e.DominicanBar=e.FullBar=e.HalfBar=e.QuarterBar=e.Divider=e.Custos=void 0;var A=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),a=function c(t,e,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var s=Object.getPrototypeOf(t);return null===s?void 0:c(s,e,i)}if("value"in n)return n.value;var o=n.get;if(void 0!==o)return o.call(i)},r=i(1),h=i(4),u=(e.Custos=function(t){function e(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0];n(this,e);var i=s(this,Object.getPrototypeOf(e).call(this));return i.auto=t,i.staffPosition=0,i}return o(e,t),A(e,[{key:"performLayout",value:function(t){if(a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t),this.auto){var i=t.findNextNeume();for(i&&(this.staffPosition=t.activeClef.pitchToStaffPosition(i.notes[0].pitch));this.staffPosition<-6;)this.staffPosition+=7;for(;this.staffPosition>6;)this.staffPosition-=7}var n=new h.GlyphVisualizer(t,e.getGlyphCode(this.staffPosition));n.setStaffPosition(t,this.staffPosition),this.addVisualizer(n),this.finishLayout(t)}},{key:"resetDependencies",value:function(){this.auto&&(this.needsLayout=!0)}}],[{key:"getGlyphCode",value:function(t){return 2>=t?Math.abs(t)%2===1?h.GlyphCode.CustosLong:h.GlyphCode.CustosShort:Math.abs(t)%2===1?h.GlyphCode.CustosDescLong:h.GlyphCode.CustosDescShort}}]),e}(h.ChantNotationElement),e.Divider=function(t){function e(){n(this,e);var t=s(this,Object.getPrototypeOf(e).call(this));return t.isDivider=!0,t.resetsAccidentals=!0,t}return o(e,t),e}(h.ChantNotationElement)),l=(e.QuarterBar=function(t){function e(){return n(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),A(e,[{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t),this.addVisualizer(new h.DividerLineVisualizer(t,2,4)),this.origin.x=this.bounds.width/2,this.finishLayout(t)}}]),e}(u),e.HalfBar=function(t){function e(){return n(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),A(e,[{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t),this.addVisualizer(new h.DividerLineVisualizer(t,-2,2)),this.origin.x=this.bounds.width/2,this.finishLayout(t)}}]),e}(u),e.FullBar=function(t){function e(){return n(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),A(e,[{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t),this.addVisualizer(new h.DividerLineVisualizer(t,-3,3)),this.origin.x=this.bounds.width/2,this.finishLayout(t)}}]),e}(u),e.DominicanBar=function(t){function e(t){n(this,e);var i=s(this,Object.getPrototypeOf(e).call(this));t--;var o=t%2;return i.staffPosition=t-2*o,i}return o(e,t),A(e,[{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t),this.addVisualizer(new h.DividerLineVisualizer(t,this.staffPosition-3,this.staffPosition)),this.origin.x=this.bounds.width/2,this.finishLayout(t)}}]),e}(u),e.DoubleBar=function(t){function e(){return n(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),A(e,[{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t);var i=new h.DividerLineVisualizer(t,-3,3);i.bounds.x=0,this.addVisualizer(i);var n=new h.DividerLineVisualizer(t,-3,3);n.bounds.x=2*t.intraNeumeSpacing-n.bounds.width,this.addVisualizer(n),this.origin.x=this.bounds.width/2,this.finishLayout(t)}}]),e}(u),e.AccidentalType={Flat:-1,Natural:0,Sharp:1});e.Accidental=function(t){function e(t,i){n(this,e);var o=s(this,Object.getPrototypeOf(e).call(this));return o.isAccidental=!0,o.keepWithNext=!0,o.staffPosition=t,o.accidentalType=i,o}return o(e,t),A(e,[{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t),this.addVisualizer(this.createGlyphVisualizer(t)),this.finishLayout(t)}},{key:"createGlyphVisualizer",value:function(t){var e=h.GlyphCode.Flat;switch(this.accidentalType){case l.Natural:e=h.GlyphCode.Natural;break;case l.Sharp:e=h.GlyphCode.Sharp;break;default:e=h.GlyphCode.Flat}var i=new h.GlyphVisualizer(t,e);return i.setStaffPosition(t,this.staffPosition),i}},{key:"adjustStep",value:function(t){switch(this.accidentalType){case l.Flat:if(t===r.Step.Ti)return r.Step.Te;if(t===r.Step.Mi)return r.Step.Me;break;case l.Sharp:if(t===r.Step.Do)return r.Step.Du;if(t===r.Step.Fa)return r.Step.Fu;break;case l.Natural:if(t===r.Step.Te)return r.Step.Ti;if(t===r.Step.Me)return r.Step.Mi;if(t===r.Step.Du)return r.Step.Do;if(t===r.Step.Fu)return r.Step.Fa}return t}},{key:"applyToPitch",value:function(t){this.pitch.octave===t.octave&&(t.step=this.adjustStep(t.step))}}]),e}(h.ChantNotationElement),e.Virgula=function(t){function e(){n(this,e);var t=s(this,Object.getPrototypeOf(e).call(this));return t.resetsAccidentals=!1,t.staffPosition=3,t}return o(e,t),A(e,[{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t);var i=new h.GlyphVisualizer(t,h.GlyphCode.Virgula);i.setStaffPosition(t,this.staffPosition),this.addVisualizer(i),this.origin.x=this.bounds.width/2,this.finishLayout(t)}}]),e}(u)},function(t,e,i){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e["default"]=t,e}function s(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Gabc=void 0;var A=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),a=i(1),r=i(4),h=i(6),u=i(9),l=n(u),c=i(10),g=n(c),d=i(8),f=n(d),p=/(?=.)((?:[^(])*)(?:\(?([^)]*)\)?)?/g,y=/<alt>(.*?)<\/alt>/g,B=/\[(alt:)?(.*?)\]/g,v=/z0|z|Z|::|:|[,;][1-6]?|`|[cf][1-4]|cb3|cb4|\/\/|\/| |\!|-?[a-mA-M][oOwWvVrRsxy#~\+><_\.'012345]*(?:\[[^\]]*\]?)*|\{([^}]+)\}?/g,b=1,m=/^([a-z]+):(.*)/,C=/([ou])(b|cb|cba):([01])(?:([{}])|;(\d*(?:\.\d+)?)mm)/;e.Gabc=function(){function t(){o(this,t)}return A(t,null,[{key:"createMappingsFromSource",value:function(t,e){var i=this.splitWords(e);t.activeClef=h.Clef["default"]();var n=this.createMappingsFromWords(t,i,function(e){return t.activeClef=e});return n.length>0&&n[n.length-1].notations.length>0&&(n[n.length-1].notations[n[n.length-1].notations.length-1].trailingSpace=0),n}},{key:"diffDescriptorsAndNewWords",value:function(t,e){var i,n={};for(i=0;i<t.length;i++)n[t[i].source]=n[t[i].source]||[],n[t[i].source].push(i);var s,o,A,a,r=[];for(s=o=A=0,a=0;a<e.length;a++){var h=[];for(n[e[a]]=n[e[a]]||[],i=0;i<n[e[a]].length;i++){var u=n[e[a]][i];h[u]=(u&&r[u-1]||0)+1,h[u]>A&&(A=h[u],s=u-A+1,o=a-A+1)}r=h}if(0===A){var l=[];return t.length&&l.push(["-",t]),e.length&&l.push(["+",e]),l}return[].concat(this.diffDescriptorsAndNewWords(t.slice(0,s),e.slice(0,o)),[["=",e.slice(o,o+A)]],this.diffDescriptorsAndNewWords(t.slice(s+A),e.slice(o+A)))}},{key:"updateMappingsFromSource",value:function(t,e,i){e.pop();var n,s,o,A,a=this.splitWords(i),u=this.diffDescriptorsAndNewWords(e,a),c=0,g=0,d=0;t.activeClef=h.Clef["default"]();for(var f=0;f<u.length;f++){var p=u[f][0],y=u[f][1],B=[];if(c>0&&(g=e[c-1].sourceIndex+e[c-1].source.length+1),"="===p){var v=g-e[c].sourceIndex;for(n=0;n<y.length;n++,c++)for(A=e[c],A.sourceIndex+=v,s=0;s<A.notations.length;s++){var b=A.notations[s],m=A.notations[s-1]&&A.notations[s-1].isAccidental;if(b.resetDependencies(),b.isClef&&(t.activeClef=e[c].notations[s]),b.isAccidental?t.activeClef.activeAccidental=b:(b.resetsAccidentals||!m&&b.hasLyrics()&&b.lyrics[0].lyricType<=r.LyricType.BeginningSyllable)&&t.activeClef.resetAccidentals(),b.notes)for(o=0;o<b.notes.length;++o){var C=b.notes[o];C.sourceIndex+=v,C.pitch=t.activeClef.staffPositionToPitch(C.staffPosition),C.braceEnd&&C.braceEnd.automatic&&delete C.braceEnd,!this.needToEndBrace||C.braceStart||C.braceEnd?C.braceStart&&C.braceStart.automatic&&(this.needToEndBrace=C.braceStart):(C.braceEnd=new l.BracePoint(C,this.needToEndBrace.isAbove,this.needToEndBrace.shape,this.needToEndBrace.attachment===l.BraceAttachment.Left?l.BraceAttachment.Right:l.BraceAttachment.Left),C.braceEnd.automatic=!0,delete this.needToEndBrace)}if(b.translationText){for(o=0;o<b.translationText.length;++o){var w=b.translationText[o];if(delete w.endNeume,b.translationText[o].sourceIndex+=v,"end"===w.textAnchor&&B[0]){var x=B[0].translationText[o];x&&(x.endNeume=b)}}B[0]=b}if(v){for("number"==typeof b.sourceIndex&&(b.sourceIndex+=v),o=0;o<b.lyrics.length;++o)b.lyrics[o].sourceIndex+=v;if(b.alText)for(o=0;o<b.alText.length;++o)b.alText[o].sourceIndex+=v}}}else if("-"===p)e.splice(c,y.length);else if("+"===p)for(n=0;n<y.length;n++){for(d=y[n].length+1,A=this.createMappingFromWord(t,y[n],g,B),s=0;s<A.notations.length;s++)A.notations[s].isClef&&(t.activeClef=A.notations[s]);e.splice(c++,0,A),g+=d}}e.length>0&&e[e.length-1].notations.length>0&&(e[e.length-1].notations[e[e.length-1].notations.length-1].trailingSpace=0)}},{key:"createMappingsFromWords",value:function(t,e){for(var i=[],n=0,s=0,o=[],A=0;A<e.length;A++){n+=s,s=e[A].length+1;var a=e[A].trim();if(""!==a){var r=this.createMappingFromWord(t,a,n,o);r&&i.push(r)}}return i}},{key:"createMappingFromWord",value:function(t,e,i,n){for(var o=[],A=[],a=0,u=function(e,i){return new r.AboveLinesText(t,e,i)};c=p.exec(e);)o.push(c);for(var l=0;l<o.length;l++){var c=o[l],g=c[1].replace(/^\s+/,"").replace(/~/g," "),d=[],f=[],v=c[2];0===a&&/[a-z]/i.test(g)&&/[a-m]/i.test(v)&&t.activeClef.resetAccidentals();var b=this.parseNotations(t,v,i+c.index+c[1].length+1);if(0!==b.length){b[0].firstOfSyllable=!!g,A.push.apply(A,s(b));for(var m=y.exec();m=y.exec(g);){var C=m.index;g=g.slice(0,C)+g.slice(C+m[0].length),d.push(u(m[1],i+C+5)),y.exec()}for(m=B.exec();m=B.exec(g);){var w=m.index;g=g.slice(0,w)+g.slice(w+m[0].length),w+=i+1,m[1]?d.push(new r.AboveLinesText(t,m[2],w+m[1].length)):f.push(new r.TranslationText(t,m[2],w)),B.exec()}if(""!==g||0!==d.length){for(var x=null,G=0;G<b.length;G++){var Q=b[G];if(!(Q.isAccidental&&G+1<b.length)){x=Q;break}}if(null===x)return new h.ChantMapping(e,A,i);if(d.length&&(x.alText=d),f.length){for(x.translationText=f,G=0;G<f.length;++G){var I=f[G];if("end"===I.textAnchor&&n[0]){var L=n[0].translationText[G];L&&(L.endNeume=x)}}n[0]=x}if(""!==g){var S;S=Q.isNeume||Q.constructor===h.TextOnly?0===a&&l===o.length-1?r.LyricType.SingleSyllable:0===a&&l<o.length-1?r.LyricType.BeginningSyllable:l===o.length-1?r.LyricType.EndingSyllable:r.LyricType.MiddleSyllable:r.LyricType.Directive,a++;var k=this.createSyllableLyrics(t,g,S,x,b,i+c.index);null!==k&&0!==k.length&&(x.lyrics=k)}}}}return new h.ChantMapping(e,A,i)}},{key:"createSyllableLyrics",value:function(t,e,i,n,s,o){for(var A=[],a=e.split("|"),h=0;h<a.length;h++){var u=a[h];h>0&&(u.match(/\s$/)?(u=u.replace(/s+$/,""),i=r.LyricType.EndingSyllable):i=r.LyricType.MiddleSyllable);var l=u.indexOf("{"),c=0;if(l>=0){var g=u.indexOf("}");g>=0&&g>l?(c=g-l-1,u=u.substring(0,l)+u.substring(l+1,g)+u.substring(g+1,u.length)):l=-1}var d=this.makeLyric(t,u,i,n,s,o);l>=0&&(d.centerStartIndex=l,d.centerLength=c),A.push(d)}return n.lyrics=A,A}},{key:"makeLyric",value:function(t,e,i,n,s,o){var A=!1,a=!1;e.length>1&&("-"===e[e.length-1]?(a=!0,i===r.LyricType.EndingSyllable?i=r.LyricType.MiddleSyllable:i===r.LyricType.SingleSyllable&&(i=r.LyricType.BeginningSyllable),e=e.slice(0,-1)):" "===e[e.length-1]?(i===r.LyricType.MiddleSyllable?i=r.LyricType.EndingSyllable:i===r.LyricType.BeginningSyllable&&(i=r.LyricType.SingleSyllable),e=e.slice(0,-1)):"_"===e[e.length-1]&&(A=!0,e=e.slice(0,-1))),e.match(/^(?:[*†]+|i+j|\d+)\.?$/)&&(i=r.LyricType.Directive);var h=new r.Lyric(t,e,i,n,s,o);return h.elidesToNext=A,a&&h.setForceConnector(!0),h}},{key:"parseNotations",value:function(t,e,i){var n=this;if(!e)return[new h.TextOnly];for(var o,A=i,a=[],r=[],u=-1,l=function(e){if(r.length>0){for(var s=n.createNeumesFromNotes(t,r,u),o=0;o<s.length;o++)a.push(s[o]);r=[]}if(u=-1,null!==e){var A=a[a.length-1];e.sourceIndex=i,e.isClef?(t.activeClef=e,A&&A.trailingSpace<0&&A.isDivider&&(A.trailingSpace=t.intraNeumeSpacing*t.accidentalSpaceMultiplier)):e.isAccidental?t.activeClef.activeAccidental=e:e.trailingSpace<0&&e instanceof g.Custos?e.trailingSpace=t.intraNeumeSpacing*t.accidentalSpaceMultiplier:e.resetsAccidentals&&t.activeClef.resetAccidentals(),a.push(e)}},c=new RegExp(v.source,"g");o=c.exec(e);){i=A+o.index;var d=o[0];switch(d){case",":l(new g.QuarterBar);break;case"`":l(new g.Virgula);break;case";":l(new g.HalfBar);break;case";1":case";2":case";3":case";4":case";5":case";6":case",1":case",2":case",3":case",4":case",5":case",6":l(new g.DominicanBar(parseInt(d[1],10)));break;case":":l(new g.FullBar);break;case"::":l(new g.DoubleBar);break;case"c1":l(t.activeClef=new h.DoClef(-3,2));break;case"c2":l(t.activeClef=new h.DoClef(-1,2));break;case"c3":l(t.activeClef=new h.DoClef(1,2));break;case"c4":l(t.activeClef=new h.DoClef(3,2));break;case"f1":l(t.activeClef=new h.FaClef(-3,2));break;case"f2":l(t.activeClef=new h.FaClef(-1,2));break;case"f3":l(t.activeClef=new h.FaClef(1,2));break;case"f4":l(t.activeClef=new h.FaClef(3,2));break;case"cb3":l(t.activeClef=new h.DoClef(1,2,new g.Accidental(0,g.AccidentalType.Flat)));break;case"cb4":l(t.activeClef=new h.DoClef(3,2,new g.Accidental(2,g.AccidentalType.Flat)));break;case"z":l(new h.ChantLineBreak(!0));break;case"Z":l(new h.ChantLineBreak(!1));break;case"z0":l(new g.Custos(!0));break;case"!":u=0,l(null);break;case"/":u=t.intraNeumeSpacing,l(null);break;case"//":u=2*t.intraNeumeSpacing,l(null);break;case" ":u=2*t.intraNeumeSpacing,l(null);break;default:if(d.length>1&&"+"===d[1]){var f=new g.Custos;f.staffPosition=this.gabcHeightToExsurgeHeight(d[0]),l(f)}else if(d.length>1&&/[xy#]/.test(d[1])){var p;switch(d[1]){case"y":p=g.AccidentalType.Natural;break;case"#":p=g.AccidentalType.Sharp;break;default:p=g.AccidentalType.Flat}var y=[];this.createNoteFromData(t,t.activeClef,d,y,i);var B=new g.Accidental(y[0].staffPosition,p);B.pitch=this.gabcHeightToExsurgePitch(t.activeClef,d[0]),B.sourceIndex=i,B.trailingSpace=t.intraNeumeSpacing*t.accidentalSpaceMultiplier,t.activeClef.activeAccidental=B,l(B)}else d.length>1&&"{"===d[0]?!function(){u=0,l(null);var e=n.parseNotations(t,o[b],i+1);e.forEach(function(t){t.hasNoWidth=!0,t.firstWithNoWidth=e[0]}),a.push.apply(a,s(e))}():this.createNoteFromData(t,t.activeClef,d,r,i)}}return l(null),a}},{key:"createNeumesFromNotes",value:function(t,e,i){for(var n=[],s=0,o=0,A=function(i,A){var r,u=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];if(r=A?o:u?o-1:o-2,!(0>r)){for(;r>=s;){var l=e[s++];i.addNote(l),l.alText&&(i.alText||(i.alText=[]),i.alText.push(l.alText))}return n.push(i),A===!1&&(o--,u===!1&&o--,i.keepWithNext=!0,e[o+1].shape===h.NoteShape.Quilisma?i.trailingSpace=0:(i.trailingSpace=t.intraNeumeSpacing,i.allowLineBreakBeforeNext=!0)),a}},a={neume:function(){return new f.Punctum},handle:function(t,e){return t.shape===h.NoteShape.Virga?w:t.shape===h.NoteShape.Stropha?G:t.shape===h.NoteShape.Oriscus?c:t.shape===h.NoteShape.Inclinatum?u:t.shapeModifiers&h.NoteShapeModifiers.Cavum?A(new f.Punctum,!0):r}},r={neume:function(){return new f.Punctum},handle:function(t,e,i){if(t.shape){var n=new f.Punctum,s=A(n,!1);return t.staffPosition>e.staffPosition&&(t.staffPosition%2===1||e.staffPosition!==t.staffPosition-1||!e.morae||0===e.morae.length)&&(n.trailingSpace=0),s}return t.staffPosition>e.staffPosition?(t.ictus&&(t.ictus.positionHint=l.MarkingPositionHint.Above),g):t.staffPosition<e.staffPosition?(e.ictus&&(e.ictus.positionHint=l.MarkingPositionHint.Above),t.shape===h.NoteShape.Inclinatum?p:d):e.morae&&e.morae.length?A(new f.Punctum,!1):Q}},u={neume:function(){return new f.PunctaInclinata},handle:function(){return M.shape!==h.NoteShape.Inclinatum?A(new f.PunctaInclinata,!1):u}},c={neume:function(){return new f.Oriscus},handle:function(t,e){if(t.shape!==h.NoteShape.Default){var i=new f.Oriscus,n=A(i,!1);return t.staffPosition>e.staffPosition&&(t.staffPosition%2===1||e.staffPosition!==t.staffPosition-1||!e.morae||0===e.morae.length)&&(i.trailingSpace=0),n}return t.staffPosition>e.staffPosition?(e.shapeModifiers|=h.NoteShapeModifiers.Ascending,A(new f.PesQuassus,!0)):t.staffPosition<e.staffPosition?(e.shapeModifiers|=h.NoteShapeModifiers.Descending,A(new f.Clivis,!0)):void 0}},g={neume:function(){return new f.Podatus},handle:function(t,e){return t.staffPosition>e.staffPosition?(t.ictus&&(t.ictus.positionHint=l.MarkingPositionHint.Above),e.ictus&&(e.ictus.positionHint=l.MarkingPositionHint.Below),e.shape===h.NoteShape.Oriscus?v:m):t.staffPosition<e.staffPosition?t.shape===h.NoteShape.Inclinatum?B:L:A(new f.Podatus,!1)}},d={neume:function(){return new f.Clivis},handle:function(t,e){return t.shape===h.NoteShape.Default&&t.staffPosition>e.staffPosition?(t.ictus&&(t.ictus.positionHint=l.MarkingPositionHint.Above),y):A(new f.Clivis,!1)}},p={neume:function(){return new f.Climacus},handle:function(t,e){return t.shape!==h.NoteShape.Inclinatum?A(new f.Climacus,!1):k}},y={neume:function(){return new f.Porrectus},handle:function(t,e){return t.shape===h.NoteShape.Default&&t.staffPosition<e.staffPosition?A(new f.PorrectusFlexus,!0):A(new f.Porrectus,!1)}},B={neume:function(){return new f.PesSubpunctis},handle:function(t,e){return t.shape!==h.NoteShape.Inclinatum?A(new f.PesSubpunctis,!1):k}},v={neume:function(){return new f.Salicus},handle:function(t,e){return t.staffPosition<e.staffPosition?b:A(new f.Salicus,!1)}},b={neume:function(){return new f.SalicusFlexus},handle:function(t,e){return A(new f.SalicusFlexus,!1)}},m={neume:function(){return new f.Scandicus},handle:function(t,e){return e.shape===h.NoteShape.Virga&&t.shape===h.NoteShape.Inclinatum&&t.staffPosition<e.staffPosition?A(new f.Podatus,!1,!1):t.shape===h.NoteShape.Default&&t.staffPosition<e.staffPosition?C:A(new f.Scandicus,!1)}},C={neume:function(){return new f.ScandicusFlexus},handle:function(t,e){return A(new f.ScandicusFlexus,!1)}},w={neume:function(){return new f.Virga},handle:function(t,e){return t.shape===h.NoteShape.Inclinatum&&t.staffPosition<e.staffPosition?p:t.shape===h.NoteShape.Virga&&t.staffPosition===e.staffPosition?x:A(new f.Virga,!1)}},x={neume:function(){return new f.Bivirga},handle:function(t,e){return t.shape===h.NoteShape.Virga&&t.staffPosition===e.staffPosition?A(new f.Trivirga,!0):A(new f.Bivirga,!1)}},G={neume:function(){return new f.Apostropha},handle:function(t,e){return t.staffPosition===e.staffPosition?Q:A(new f.Apostropha,!1)}},Q={neume:function(){return new f.Distropha},handle:function(t,e){return t.staffPosition===e.staffPosition?e.morae&&e.morae.length?A(new f.Distropha,!1):I:A(new f.Apostropha,!1,!1)}},I={neume:function(){return new f.Tristropha},handle:function(t,e){return A(new f.Distropha,!1,!1)}},L={neume:function(){return new f.Torculus},handle:function(t,e){return t.shape===h.NoteShape.Default&&t.staffPosition>e.staffPosition?(t.ictus&&(t.ictus.positionHint=l.MarkingPositionHint.Above),S):A(new f.Torculus,!1)}},S={neume:function(){return new f.TorculusResupinus},handle:function(t,e){return t.shape===h.NoteShape.Default&&t.staffPosition<e.staffPosition?A(new f.TorculusResupinusFlexus,!0):A(new f.TorculusResupinus,!1)}},k=a;o<e.length;){var E=o>0?e[o-1]:null,M=e[o];k=k.handle(M,E,e.length-1-o),o===e.length-1&&k!==a&&A(k.neume(),!0),o++}return n.length>0&&i>=0&&(n[n.length-1].trailingSpace=i,n[n.length-1].keepWithNext=!0,i>=t.intraNeumeSpacing&&(n[n.length-1].allowLineBreakBeforeNext=n[n.length-1].keepWithNext=!0)),n}},{key:"createNoteFromData",value:function(t,e,i,n,s){var o=new h.Note;if(o.sourceIndex=s,i.length<1)throw"Invalid note data: "+i;if("-"===i[0]&&(o.liquescent=h.LiquescentType.InitioDebilis,i=i.substring(1)),i.length<1)throw"Invalid note data: "+i;var A=this.gabcHeightToExsurgePitch(e,i[0]);i[0]===i[0].toUpperCase()&&(o.shape=h.NoteShape.Inclinatum),o.staffPosition=this.gabcHeightToExsurgeHeight(i[0]),o.pitch=A;for(var r,u=n.length,c=o,g=1;g<i.length;g++){var d=i[g],f="\x00",p=g+1<i.length;switch(p&&(f=i[g+1]),d){case".":if(r=null,o.morae.length>0&&n.length){var y=n.slice(-1)[0],B=o.morae.slice(-1)[0];B.note=y}r=new l.Mora(t,o),p&&"1"===f?r.positionHint=l.MarkingPositionHint.Above:p&&"0"===f&&(r.positionHint=l.MarkingPositionHint.Below),o.morae.push(r);break;case"_":var v=!1;for(r=new l.HorizontalEpisema(c);p;){if("0"===f)r.positionHint=l.MarkingPositionHint.Below;else if("1"===f)r.positionHint=l.MarkingPositionHint.Above;else if("2"===f)r.terminating=!0;else if("3"===f)r.alignment=l.HorizontalEpisemaAlignment.Left;else if("4"===f)r.alignment=l.HorizontalEpisemaAlignment.Center;else{
if("5"!==f)break;r.alignment=l.HorizontalEpisemaAlignment.Right}r.alignment!==l.HorizontalEpisemaAlignment.Default&&r.positionHint!==l.MarkingPositionHint.Below&&(v=!0),g++,p=g+1<i.length,p&&(f=i[g+1])}c&&c.episemata.push(r),c===o&&v?c=o:u>=0&&n.length>0&&(c=n[--u]);break;case"'":r=new l.Ictus(t,o),p&&"1"===f?r.positionHint=l.MarkingPositionHint.Above:p&&"0"===f?r.positionHint=l.MarkingPositionHint.Below:o.shape===h.NoteShape.Virga&&(r.positionHint=l.MarkingPositionHint.Above),o.ictus=r;break;case"r":p&&"1"===f?(o.acuteAccent=new l.AcuteAccent(t,o),g++):o.shapeModifiers|=h.NoteShapeModifiers.Cavum;break;case"s":if(o.shape===h.NoteShape.Stropha){var b=new h.Note;b.sourceIndex=s+g,b.staffPosition=o.staffPosition,b.pitch=o.pitch,n.push(o),o=b,u++}o.shape=h.NoteShape.Stropha;break;case"v":if(o.shape===h.NoteShape.Virga){var m=new h.Note;m.sourceIndex=s+g,m.staffPosition=o.staffPosition,m.pitch=o.pitch,n.push(o),o=m,u++}o.shape=h.NoteShape.Virga;break;case"w":o.shape=h.NoteShape.Quilisma;break;case"o":o.shape=h.NoteShape.Oriscus,p&&"<"===f?(o.shapeModifiers|=h.NoteShapeModifiers.Ascending,g++):p&&">"===f&&(o.shapeModifiers|=h.NoteShapeModifiers.Descending,g++);break;case"O":o.shape=h.NoteShape.Oriscus,p&&"<"===f?(o.shapeModifiers|=h.NoteShapeModifiers.Ascending|h.NoteShapeModifiers.Stemmed,g++):p&&">"===f?(o.shapeModifiers|=h.NoteShapeModifiers.Descending|h.NoteShapeModifiers.Stemmed,g++):o.shapeModifiers|=h.NoteShapeModifiers.Stemmed;break;case"~":o.shape===h.NoteShape.Inclinatum?o.liquescent|=h.LiquescentType.Small:o.shape===h.NoteShape.Oriscus?o.liquescent|=h.LiquescentType.Large:o.liquescent|=h.LiquescentType.Small;break;case"<":o.liquescent|=h.LiquescentType.Ascending;break;case">":o.liquescent|=h.LiquescentType.Descending;break;case"x":o.pitch.step===a.Step.Mi?o.pitch.step=a.Step.Me:o.pitch.step===a.Step.Ti&&(o.pitch.step=a.Step.Te);break;case"y":o.pitch.step===a.Step.Te?o.pitch.step=a.Step.Ti:o.pitch.step===a.Step.Me?o.pitch.step=a.Step.Mi:o.pitch.step===a.Step.Du?o.pitch.step=a.Step.Do:o.pitch.step===a.Step.Fu&&(o.pitch.step=a.Step.Fa);break;case"#":o.pitch.step===a.Step.Do?o.pitch.step=a.Step.Du:o.pitch.step===a.Step.Fa&&(o.pitch.step=a.Step.Fu);break;case"[":for(var C=++g;g<i.length&&"]"!==i[g];)g++;this.processInstructionForNote(t,o,i.substring(C,g),C)}}!this.needToEndBrace||o.braceStart||o.braceEnd||/[xy#]/.test(d)||(o.braceEnd=new l.BracePoint(o,this.needToEndBrace.isAbove,this.needToEndBrace.shape,this.needToEndBrace.attachment===l.BraceAttachment.Left?l.BraceAttachment.Right:l.BraceAttachment.Left),o.braceEnd.automatic=!0,delete this.needToEndBrace),n.push(o)}},{key:"processInstructionForNote",value:function(t,e,i,n){var s=i.match(m);if(null!==s){var o=s[1],A=s[2];switch(o){case"cs":return;case"alt":return e.alText=new r.AboveLinesText(t,A,e.sourceIndex+n),void(e.alText.alignToNote=!0)}if(s=i.match(C),null!==s){var a="o"===s[1],h=l.BraceShape.CurlyBrace;switch(s[2]){case"b":h=l.BraceShape.RoundBrace;break;case"cb":h=l.BraceShape.CurlyBrace;break;case"cba":h=l.BraceShape.AccentedCurlyBrace}var u="1"===s[3]?l.BraceAttachment.Left:l.BraceAttachment.Right;"{"===s[4]||s[5]?e.braceStart=new l.BracePoint(e,a,h,u):e.braceEnd=new l.BracePoint(e,a,h,u),s[5]&&(e.braceStart.automatic=!0,this.needToEndBrace=e.braceStart)}}}},{key:"splitWords",value:function(t){return t=t.trim().replace(/\s/g," ").replace(/\) (?=[^\)]*(?:\(|$))/g,")\n"),t.split(/\n/g)}},{key:"parseSource",value:function(t){return this.parseWords(this.splitWords(t))}},{key:"parseWords",value:function(t){for(var e=[],i=0;i<t.length;i++)e.push(this.parseWord(t[i]));return e}},{key:"parseWord",value:function(t){var e=[],i=[];for(e.wordLength=t.length;s=p.exec(t);)i.push(s);for(var n=0;n<i.length;n++){var s=i[n],o=s[1].trim().split("|"),A=s[2];e.push({notations:A,lyrics:o})}return e}},{key:"gabcHeightToExsurgeHeight",value:function(t){return t.toLowerCase().charCodeAt(0)-"a".charCodeAt(0)-6}},{key:"gabcHeightToExsurgePitch",value:function(t,e){var i=this.gabcHeightToExsurgeHeight(e),n=t.staffPositionToPitch(i);return n}}]),t}()}])});
//# sourceMappingURL=exsurge.min.js.map