/*! For license information please see opensheetmusicdisplay.min.js.LICENSE.txt */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.opensheetmusicdisplay=e():t.opensheetmusicdisplay=e()}(this,(()=>(()=>{var t={5179:(t,e,i)=>{"use strict";i.d(e,{B:()=>r});var n=i(655),s=i(6308),r=function(){function t(t,e){for(var i=[],s=2;s{"use strict";i.d(e,{K:()=>n});var n=function(){function t(t){void 0===t&&(t={}),this.adapter=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}()},9397:(t,e,i)=>{"use strict";function n(t){return void 0===t&&(t=window),!!function(t){void 0===t&&(t=window);var e=!1;try{var i={get passive(){return e=!0,!1}},n=function(){};t.document.addEventListener("test",n,i),t.document.removeEventListener("test",n,i)}catch(t){e=!1}return e}(t)&&{passive:!0}}i.d(e,{K:()=>n})},7474:(t,e,i)=>{"use strict";i.r(e),i.d(e,{MDCIconButtonToggle:()=>v,MDCIconButtonToggleFoundation:()=>y,cssClasses:()=>g,strings:()=>b});var n=i(655),s=i(5179),r=i(9397);var o,a=i(6308),l={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},h={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},u={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300},c=["touchstart","pointerdown","mousedown","keydown"],d=["touchend","pointerup","mouseup","contextmenu"],p=[],f=function(t){function e(i){var s=t.call(this,(0,n.pi)((0,n.pi)({},e.defaultAdapter),i))||this;return s.activationAnimationHasEnded_=!1,s.activationTimer_=0,s.fgDeactivationRemovalTimer_=0,s.fgScale_="0",s.frame_={width:0,height:0},s.initialSize_=0,s.layoutFrame_=0,s.maxRadius_=0,s.unboundedCoords_={left:0,top:0},s.activationState_=s.defaultActivationState_(),s.activationTimerCallback_=function(){s.activationAnimationHasEnded_=!0,s.runDeactivationUXLogicIfReady_()},s.activateHandler_=function(t){return s.activate_(t)},s.deactivateHandler_=function(){return s.deactivate_()},s.focusHandler_=function(){return s.handleFocus()},s.blurHandler_=function(){return s.handleBlur()},s.resizeHandler_=function(){return s.layout()},s}return(0,n.ZT)(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return l},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return h},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return u},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){var t=this,i=this.supportsPressRipple_();if(this.registerRootHandlers_(i),i){var n=e.cssClasses,s=n.ROOT,r=n.UNBOUNDED;requestAnimationFrame((function(){t.adapter.addClass(s),t.adapter.isUnbounded()&&(t.adapter.addClass(r),t.layoutInternal_())}))}},e.prototype.destroy=function(){var t=this;if(this.supportsPressRipple_()){this.activationTimer_&&(clearTimeout(this.activationTimer_),this.activationTimer_=0,this.adapter.removeClass(e.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer_&&(clearTimeout(this.fgDeactivationRemovalTimer_),this.fgDeactivationRemovalTimer_=0,this.adapter.removeClass(e.cssClasses.FG_DEACTIVATION));var i=e.cssClasses,n=i.ROOT,s=i.UNBOUNDED;requestAnimationFrame((function(){t.adapter.removeClass(n),t.adapter.removeClass(s),t.removeCssVars_()}))}this.deregisterRootHandlers_(),this.deregisterDeactivationHandlers_()},e.prototype.activate=function(t){this.activate_(t)},e.prototype.deactivate=function(){this.deactivate_()},e.prototype.layout=function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame((function(){t.layoutInternal_(),t.layoutFrame_=0}))},e.prototype.setUnbounded=function(t){var i=e.cssClasses.UNBOUNDED;t?this.adapter.addClass(i):this.adapter.removeClass(i)},e.prototype.handleFocus=function(){var t=this;requestAnimationFrame((function(){return t.adapter.addClass(e.cssClasses.BG_FOCUSED)}))},e.prototype.handleBlur=function(){var t=this;requestAnimationFrame((function(){return t.adapter.removeClass(e.cssClasses.BG_FOCUSED)}))},e.prototype.supportsPressRipple_=function(){return this.adapter.browserSupportsCssVars()},e.prototype.defaultActivationState_=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},e.prototype.registerRootHandlers_=function(t){var e=this;t&&(c.forEach((function(t){e.adapter.registerInteractionHandler(t,e.activateHandler_)})),this.adapter.isUnbounded()&&this.adapter.registerResizeHandler(this.resizeHandler_)),this.adapter.registerInteractionHandler("focus",this.focusHandler_),this.adapter.registerInteractionHandler("blur",this.blurHandler_)},e.prototype.registerDeactivationHandlers_=function(t){var e=this;"keydown"===t.type?this.adapter.registerInteractionHandler("keyup",this.deactivateHandler_):d.forEach((function(t){e.adapter.registerDocumentInteractionHandler(t,e.deactivateHandler_)}))},e.prototype.deregisterRootHandlers_=function(){var t=this;c.forEach((function(e){t.adapter.deregisterInteractionHandler(e,t.activateHandler_)})),this.adapter.deregisterInteractionHandler("focus",this.focusHandler_),this.adapter.deregisterInteractionHandler("blur",this.blurHandler_),this.adapter.isUnbounded()&&this.adapter.deregisterResizeHandler(this.resizeHandler_)},e.prototype.deregisterDeactivationHandlers_=function(){var t=this;this.adapter.deregisterInteractionHandler("keyup",this.deactivateHandler_),d.forEach((function(e){t.adapter.deregisterDocumentInteractionHandler(e,t.deactivateHandler_)}))},e.prototype.removeCssVars_=function(){var t=this,i=e.strings;Object.keys(i).forEach((function(e){0===e.indexOf("VAR_")&&t.adapter.updateCssVariable(i[e],null)}))},e.prototype.activate_=function(t){var e=this;if(!this.adapter.isSurfaceDisabled()){var i=this.activationState_;if(!i.isActivated){var n=this.previousActivationEvent_;n&&void 0!==t&&n.type!==t.type||(i.isActivated=!0,i.isProgrammatic=void 0===t,i.activationEvent=t,i.wasActivatedByPointer=!i.isProgrammatic&&void 0!==t&&("mousedown"===t.type||"touchstart"===t.type||"pointerdown"===t.type),void 0!==t&&p.length>0&&p.some((function(t){return e.adapter.containsEventTarget(t)}))?this.resetActivationState_():(void 0!==t&&(p.push(t.target),this.registerDeactivationHandlers_(t)),i.wasElementMadeActive=this.checkElementMadeActive_(t),i.wasElementMadeActive&&this.animateActivation_(),requestAnimationFrame((function(){p=[],i.wasElementMadeActive||void 0===t||" "!==t.key&&32!==t.keyCode||(i.wasElementMadeActive=e.checkElementMadeActive_(t),i.wasElementMadeActive&&e.animateActivation_()),i.wasElementMadeActive||(e.activationState_=e.defaultActivationState_())}))))}}},e.prototype.checkElementMadeActive_=function(t){return void 0===t||"keydown"!==t.type||this.adapter.isSurfaceActive()},e.prototype.animateActivation_=function(){var t=this,i=e.strings,n=i.VAR_FG_TRANSLATE_START,s=i.VAR_FG_TRANSLATE_END,r=e.cssClasses,o=r.FG_DEACTIVATION,a=r.FG_ACTIVATION,l=e.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal_();var h="",u="";if(!this.adapter.isUnbounded()){var c=this.getFgTranslationCoordinates_(),d=c.startPoint,p=c.endPoint;h=d.x+"px, "+d.y+"px",u=p.x+"px, "+p.y+"px"}this.adapter.updateCssVariable(n,h),this.adapter.updateCssVariable(s,u),clearTimeout(this.activationTimer_),clearTimeout(this.fgDeactivationRemovalTimer_),this.rmBoundedActivationClasses_(),this.adapter.removeClass(o),this.adapter.computeBoundingRect(),this.adapter.addClass(a),this.activationTimer_=setTimeout((function(){return t.activationTimerCallback_()}),l)},e.prototype.getFgTranslationCoordinates_=function(){var t,e=this.activationState_,i=e.activationEvent;return{startPoint:t={x:(t=e.wasActivatedByPointer?function(t,e,i){if(!t)return{x:0,y:0};var n,s,r=e.x,o=e.y,a=r+i.left,l=o+i.top;if("touchstart"===t.type){var h=t;n=h.changedTouches[0].pageX-a,s=h.changedTouches[0].pageY-l}else{var u=t;n=u.pageX-a,s=u.pageY-l}return{x:n,y:s}}(i,this.adapter.getWindowPageOffset(),this.adapter.computeBoundingRect()):{x:this.frame_.width/2,y:this.frame_.height/2}).x-this.initialSize_/2,y:t.y-this.initialSize_/2},endPoint:{x:this.frame_.width/2-this.initialSize_/2,y:this.frame_.height/2-this.initialSize_/2}}},e.prototype.runDeactivationUXLogicIfReady_=function(){var t=this,i=e.cssClasses.FG_DEACTIVATION,n=this.activationState_,s=n.hasDeactivationUXRun,r=n.isActivated;(s||!r)&&this.activationAnimationHasEnded_&&(this.rmBoundedActivationClasses_(),this.adapter.addClass(i),this.fgDeactivationRemovalTimer_=setTimeout((function(){t.adapter.removeClass(i)}),u.FG_DEACTIVATION_MS))},e.prototype.rmBoundedActivationClasses_=function(){var t=e.cssClasses.FG_ACTIVATION;this.adapter.removeClass(t),this.activationAnimationHasEnded_=!1,this.adapter.computeBoundingRect()},e.prototype.resetActivationState_=function(){var t=this;this.previousActivationEvent_=this.activationState_.activationEvent,this.activationState_=this.defaultActivationState_(),setTimeout((function(){return t.previousActivationEvent_=void 0}),e.numbers.TAP_DELAY_MS)},e.prototype.deactivate_=function(){var t=this,e=this.activationState_;if(e.isActivated){var i=(0,n.pi)({},e);e.isProgrammatic?(requestAnimationFrame((function(){return t.animateDeactivation_(i)})),this.resetActivationState_()):(this.deregisterDeactivationHandlers_(),requestAnimationFrame((function(){t.activationState_.hasDeactivationUXRun=!0,t.animateDeactivation_(i),t.resetActivationState_()})))}},e.prototype.animateDeactivation_=function(t){var e=t.wasActivatedByPointer,i=t.wasElementMadeActive;(e||i)&&this.runDeactivationUXLogicIfReady_()},e.prototype.layoutInternal_=function(){this.frame_=this.adapter.computeBoundingRect();var t=Math.max(this.frame_.height,this.frame_.width);this.maxRadius_=this.adapter.isUnbounded()?t:Math.sqrt(Math.pow(this.frame_.width,2)+Math.pow(this.frame_.height,2))+e.numbers.PADDING;var i=Math.floor(t*e.numbers.INITIAL_ORIGIN_SCALE);this.adapter.isUnbounded()&&i%2!=0?this.initialSize_=i-1:this.initialSize_=i,this.fgScale_=""+this.maxRadius_/this.initialSize_,this.updateLayoutCssVars_()},e.prototype.updateLayoutCssVars_=function(){var t=e.strings,i=t.VAR_FG_SIZE,n=t.VAR_LEFT,s=t.VAR_TOP,r=t.VAR_FG_SCALE;this.adapter.updateCssVariable(i,this.initialSize_+"px"),this.adapter.updateCssVariable(r,this.fgScale_),this.adapter.isUnbounded()&&(this.unboundedCoords_={left:Math.round(this.frame_.width/2-this.initialSize_/2),top:Math.round(this.frame_.height/2-this.initialSize_/2)},this.adapter.updateCssVariable(n,this.unboundedCoords_.left+"px"),this.adapter.updateCssVariable(s,this.unboundedCoords_.top+"px"))},e}(a.K),m=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.disabled=!1,e}return(0,n.ZT)(e,t),e.attachTo=function(t,i){void 0===i&&(i={isUnbounded:void 0});var n=new e(t);return void 0!==i.isUnbounded&&(n.unbounded=i.isUnbounded),n},e.createAdapter=function(t){return{addClass:function(e){return t.root.classList.add(e)},browserSupportsCssVars:function(){return function(t,e){void 0===e&&(e=!1);var i,n=window.CSS;if("boolean"==typeof o&&!e)return o;if(!n||"function"!=typeof n.supports)return!1;var s=n.supports("--css-vars","yes"),r=n.supports("(--css-vars: yes)")&&n.supports("color","#00000000");return i=s||r,e||(o=i),i}()},computeBoundingRect:function(){return t.root.getBoundingClientRect()},containsEventTarget:function(e){return t.root.contains(e)},deregisterDocumentInteractionHandler:function(t,e){return document.documentElement.removeEventListener(t,e,(0,r.K)())},deregisterInteractionHandler:function(e,i){return t.root.removeEventListener(e,i,(0,r.K)())},deregisterResizeHandler:function(t){return window.removeEventListener("resize",t)},getWindowPageOffset:function(){return{x:window.pageXOffset,y:window.pageYOffset}},isSurfaceActive:function(){return e=t.root,i=":active",(e.matches||e.webkitMatchesSelector||e.msMatchesSelector).call(e,i);var e,i},isSurfaceDisabled:function(){return Boolean(t.disabled)},isUnbounded:function(){return Boolean(t.unbounded)},registerDocumentInteractionHandler:function(t,e){return document.documentElement.addEventListener(t,e,(0,r.K)())},registerInteractionHandler:function(e,i){return t.root.addEventListener(e,i,(0,r.K)())},registerResizeHandler:function(t){return window.addEventListener("resize",t)},removeClass:function(e){return t.root.classList.remove(e)},updateCssVariable:function(e,i){return t.root.style.setProperty(e,i)}}},Object.defineProperty(e.prototype,"unbounded",{get:function(){return Boolean(this.unbounded_)},set:function(t){this.unbounded_=Boolean(t),this.setUnbounded_()},enumerable:!0,configurable:!0}),e.prototype.activate=function(){this.foundation.activate()},e.prototype.deactivate=function(){this.foundation.deactivate()},e.prototype.layout=function(){this.foundation.layout()},e.prototype.getDefaultFoundation=function(){return new f(e.createAdapter(this))},e.prototype.initialSyncWithDOM=function(){var t=this.root;this.unbounded="mdcRippleIsUnbounded"in t.dataset},e.prototype.setUnbounded_=function(){this.foundation.setUnbounded(Boolean(this.unbounded_))},e}(s.B),g={ICON_BUTTON_ON:"mdc-icon-button--on",ROOT:"mdc-icon-button"},b={ARIA_LABEL:"aria-label",ARIA_PRESSED:"aria-pressed",DATA_ARIA_LABEL_OFF:"data-aria-label-off",DATA_ARIA_LABEL_ON:"data-aria-label-on",CHANGE_EVENT:"MDCIconButtonToggle:change"},y=function(t){function e(i){var s=t.call(this,(0,n.pi)((0,n.pi)({},e.defaultAdapter),i))||this;return s.hasToggledAriaLabel=!1,s}return(0,n.ZT)(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return g},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return b},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},hasClass:function(){return!1},notifyChange:function(){},removeClass:function(){},getAttr:function(){return null},setAttr:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){var t=this.adapter.getAttr(b.DATA_ARIA_LABEL_ON),e=this.adapter.getAttr(b.DATA_ARIA_LABEL_OFF);if(t&&e){if(null!==this.adapter.getAttr(b.ARIA_PRESSED))throw new Error("MDCIconButtonToggleFoundation: Button should not set `aria-pressed` if it has a toggled aria label.");this.hasToggledAriaLabel=!0}else this.adapter.setAttr(b.ARIA_PRESSED,String(this.isOn()))},e.prototype.handleClick=function(){this.toggle(),this.adapter.notifyChange({isOn:this.isOn()})},e.prototype.isOn=function(){return this.adapter.hasClass(g.ICON_BUTTON_ON)},e.prototype.toggle=function(t){if(void 0===t&&(t=!this.isOn()),t?this.adapter.addClass(g.ICON_BUTTON_ON):this.adapter.removeClass(g.ICON_BUTTON_ON),this.hasToggledAriaLabel){var e=t?this.adapter.getAttr(b.DATA_ARIA_LABEL_ON):this.adapter.getAttr(b.DATA_ARIA_LABEL_OFF);this.adapter.setAttr(b.ARIA_LABEL,e||"")}else this.adapter.setAttr(b.ARIA_PRESSED,""+t)},e}(a.K),S=y.strings,v=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rippleComponent=e.createRipple(),e}return(0,n.ZT)(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialSyncWithDOM=function(){var t=this;this.handleClick=function(){t.foundation.handleClick()},this.listen("click",this.handleClick)},e.prototype.destroy=function(){this.unlisten("click",this.handleClick),this.ripple.destroy(),t.prototype.destroy.call(this)},e.prototype.getDefaultFoundation=function(){var t=this;return new y({addClass:function(e){return t.root.classList.add(e)},hasClass:function(e){return t.root.classList.contains(e)},notifyChange:function(e){t.emit(S.CHANGE_EVENT,e)},removeClass:function(e){return t.root.classList.remove(e)},getAttr:function(e){return t.root.getAttribute(e)},setAttr:function(e,i){return t.root.setAttribute(e,i)}})},Object.defineProperty(e.prototype,"ripple",{get:function(){return this.rippleComponent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"on",{get:function(){return this.foundation.isOn()},set:function(t){this.foundation.toggle(t)},enumerable:!0,configurable:!0}),e.prototype.createRipple=function(){var t=new m(this.root);return t.unbounded=!0,t},e}(s.B)},5088:(t,e,i)=>{"use strict";i.r(e),i.d(e,{MDCSlider:()=>T,MDCSliderFoundation:()=>P,cssClasses:()=>o,numbers:()=>l,strings:()=>a});var n=i(655),s=i(5179),r=i(9397),o={ACTIVE:"mdc-slider--active",DISABLED:"mdc-slider--disabled",DISCRETE:"mdc-slider--discrete",FOCUS:"mdc-slider--focus",HAS_TRACK_MARKER:"mdc-slider--display-markers",IN_TRANSIT:"mdc-slider--in-transit",IS_DISCRETE:"mdc-slider--discrete",DISABLE_TOUCH_ACTION:"mdc-slider--disable-touch-action"},a={ARIA_DISABLED:"aria-disabled",ARIA_VALUEMAX:"aria-valuemax",ARIA_VALUEMIN:"aria-valuemin",ARIA_VALUENOW:"aria-valuenow",CHANGE_EVENT:"MDCSlider:change",INPUT_EVENT:"MDCSlider:input",PIN_VALUE_MARKER_SELECTOR:".mdc-slider__pin-value-marker",STEP_DATA_ATTR:"data-step",THUMB_CONTAINER_SELECTOR:".mdc-slider__thumb-container",TRACK_MARKER_CONTAINER_SELECTOR:".mdc-slider__track-marker-container",TRACK_SELECTOR:".mdc-slider__track"},l={PAGE_FACTOR:4},h={animation:{prefixed:"-webkit-animation",standard:"animation"},transform:{prefixed:"-webkit-transform",standard:"transform"},transition:{prefixed:"-webkit-transition",standard:"transition"}},u={animationend:{cssProperty:"animation",prefixed:"webkitAnimationEnd",standard:"animationend"},animationiteration:{cssProperty:"animation",prefixed:"webkitAnimationIteration",standard:"animationiteration"},animationstart:{cssProperty:"animation",prefixed:"webkitAnimationStart",standard:"animationstart"},transitionend:{cssProperty:"transition",prefixed:"webkitTransitionEnd",standard:"transitionend"}};function c(t){return Boolean(t.document)&&"function"==typeof t.document.createElement}var d=i(6308),p="undefined"!=typeof window,f=p&&!!window.PointerEvent,m=f?["pointerdown"]:["mousedown","touchstart"],g=f?["pointerup"]:["mouseup","touchend"],b={mousedown:"mousemove",pointerdown:"pointermove",touchstart:"touchmove"},y="ArrowDown",S="ArrowLeft",v="ArrowRight",_="ArrowUp",x="End",E="Home",M="PageDown",w="PageUp",P=function(t){function e(i){var s=t.call(this,(0,n.pi)((0,n.pi)({},e.defaultAdapter),i))||this;return s.savedTabIndex_=NaN,s.active_=!1,s.inTransit_=!1,s.isDiscrete_=!1,s.hasTrackMarker_=!1,s.handlingThumbTargetEvt_=!1,s.min_=0,s.max_=100,s.step_=0,s.value_=0,s.disabled_=!1,s.preventFocusState_=!1,s.thumbContainerPointerHandler_=function(){return s.handlingThumbTargetEvt_=!0},s.interactionStartHandler_=function(t){return s.handleDown_(t)},s.keydownHandler_=function(t){return s.handleKeydown_(t)},s.focusHandler_=function(){return s.handleFocus_()},s.blurHandler_=function(){return s.handleBlur_()},s.resizeHandler_=function(){return s.layout()},s}return(0,n.ZT)(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return o},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return a},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return l},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{hasClass:function(){return!1},addClass:function(){},removeClass:function(){},getAttribute:function(){return null},setAttribute:function(){},removeAttribute:function(){},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},getTabIndex:function(){return 0},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){},registerThumbContainerInteractionHandler:function(){},deregisterThumbContainerInteractionHandler:function(){},registerBodyInteractionHandler:function(){},deregisterBodyInteractionHandler:function(){},registerResizeHandler:function(){},deregisterResizeHandler:function(){},notifyInput:function(){},notifyChange:function(){},setThumbContainerStyleProperty:function(){},setTrackStyleProperty:function(){},setMarkerValue:function(){},setTrackMarkers:function(){},isRTL:function(){return!1}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){var t=this;this.isDiscrete_=this.adapter.hasClass(o.IS_DISCRETE),this.hasTrackMarker_=this.adapter.hasClass(o.HAS_TRACK_MARKER),m.forEach((function(e){t.adapter.registerInteractionHandler(e,t.interactionStartHandler_),t.adapter.registerThumbContainerInteractionHandler(e,t.thumbContainerPointerHandler_)})),f&&this.adapter.addClass(o.DISABLE_TOUCH_ACTION),this.adapter.registerInteractionHandler("keydown",this.keydownHandler_),this.adapter.registerInteractionHandler("focus",this.focusHandler_),this.adapter.registerInteractionHandler("blur",this.blurHandler_),this.adapter.registerResizeHandler(this.resizeHandler_),this.layout(),this.isDiscrete_&&0===this.getStep()&&(this.step_=1)},e.prototype.destroy=function(){var t=this;m.forEach((function(e){t.adapter.deregisterInteractionHandler(e,t.interactionStartHandler_),t.adapter.deregisterThumbContainerInteractionHandler(e,t.thumbContainerPointerHandler_)})),this.adapter.deregisterInteractionHandler("keydown",this.keydownHandler_),this.adapter.deregisterInteractionHandler("focus",this.focusHandler_),this.adapter.deregisterInteractionHandler("blur",this.blurHandler_),this.adapter.deregisterResizeHandler(this.resizeHandler_)},e.prototype.setupTrackMarker=function(){this.isDiscrete_&&this.hasTrackMarker_&&0!==this.getStep()&&this.adapter.setTrackMarkers(this.getStep(),this.getMax(),this.getMin())},e.prototype.layout=function(){this.rect_=this.adapter.computeBoundingRect(),this.updateUIForCurrentValue_()},e.prototype.getValue=function(){return this.value_},e.prototype.setValue=function(t){this.setValue_(t,!1)},e.prototype.getMax=function(){return this.max_},e.prototype.setMax=function(t){if(tthis.max_)throw new Error("Cannot set min to be greater than the slider's maximum value");this.min_=t,this.setValue_(this.value_,!1,!0),this.adapter.setAttribute(a.ARIA_VALUEMIN,String(this.min_)),this.setupTrackMarker()},e.prototype.getStep=function(){return this.step_},e.prototype.setStep=function(t){if(t<0)throw new Error("Step cannot be set to a negative number");this.isDiscrete_&&("number"!=typeof t||t<1)&&(t=1),this.step_=t,this.setValue_(this.value_,!1,!0),this.setupTrackMarker()},e.prototype.isDisabled=function(){return this.disabled_},e.prototype.setDisabled=function(t){this.disabled_=t,this.toggleClass_(o.DISABLED,this.disabled_),this.disabled_?(this.savedTabIndex_=this.adapter.getTabIndex(),this.adapter.setAttribute(a.ARIA_DISABLED,"true"),this.adapter.removeAttribute("tabindex")):(this.adapter.removeAttribute(a.ARIA_DISABLED),isNaN(this.savedTabIndex_)||this.adapter.setAttribute("tabindex",String(this.savedTabIndex_)))},e.prototype.handleDown_=function(t){var e=this;if(!this.disabled_){this.preventFocusState_=!0,this.setInTransit_(!this.handlingThumbTargetEvt_),this.handlingThumbTargetEvt_=!1,this.setActive_(!0);var i=function(t){e.handleMove_(t)},n=b[t.type],s=function(){e.handleUp_(),e.adapter.deregisterBodyInteractionHandler(n,i),g.forEach((function(t){return e.adapter.deregisterBodyInteractionHandler(t,s)}))};this.adapter.registerBodyInteractionHandler(n,i),g.forEach((function(t){return e.adapter.registerBodyInteractionHandler(t,s)})),this.setValueFromEvt_(t)}},e.prototype.handleMove_=function(t){t.preventDefault(),this.setValueFromEvt_(t)},e.prototype.handleUp_=function(){this.setActive_(!1),this.adapter.notifyChange()},e.prototype.getClientX_=function(t){return t.targetTouches&&t.targetTouches.length>0?t.targetTouches[0].clientX:t.clientX},e.prototype.setValueFromEvt_=function(t){var e=this.getClientX_(t),i=this.computeValueFromClientX_(e);this.setValue_(i,!0)},e.prototype.computeValueFromClientX_=function(t){var e=this.max_,i=this.min_,n=(t-this.rect_.left)/this.rect_.width;return this.adapter.isRTL()&&(n=1-n),i+n*(e-i)},e.prototype.handleKeydown_=function(t){var e=this.getKeyId_(t),i=this.getValueForKeyId_(e);isNaN(i)||(t.preventDefault(),this.adapter.addClass(o.FOCUS),this.setValue_(i,!0),this.adapter.notifyChange())},e.prototype.getKeyId_=function(t){return t.key===S||37===t.keyCode?S:t.key===v||39===t.keyCode?v:t.key===_||38===t.keyCode?_:t.key===y||40===t.keyCode?y:t.key===E||36===t.keyCode?E:t.key===x||35===t.keyCode?x:t.key===w||33===t.keyCode?w:t.key===M||34===t.keyCode?M:""},e.prototype.getValueForKeyId_=function(t){var e=this,i=e.max_,n=e.min_,s=e.step_||(i-n)/100;switch(this.adapter.isRTL()&&(t===S||t===v)&&(s=-s),t){case S:case y:return this.value_-s;case v:case _:return this.value_+s;case E:return this.min_;case x:return this.max_;case w:return this.value_+s*l.PAGE_FACTOR;case M:return this.value_-s*l.PAGE_FACTOR;default:return NaN}},e.prototype.handleFocus_=function(){this.preventFocusState_||this.adapter.addClass(o.FOCUS)},e.prototype.handleBlur_=function(){this.preventFocusState_=!1,this.adapter.removeClass(o.FOCUS)},e.prototype.setValue_=function(t,e,i){if(void 0===i&&(i=!1),t!==this.value_||i){var n=this.min_,s=this.max_,r=t===n||t===s;this.step_&&!r&&(t=this.quantize_(t)),ts&&(t=s),t=t||0,this.value_=t,this.adapter.setAttribute(a.ARIA_VALUENOW,String(this.value_)),this.updateUIForCurrentValue_(),e&&(this.adapter.notifyInput(),this.isDiscrete_&&this.adapter.setMarkerValue(t))}},e.prototype.quantize_=function(t){return Math.round(t/this.step_)*this.step_},e.prototype.updateUIForCurrentValue_=function(){var t=this,e=this,i=e.max_,n=e.min_,s=(e.value_-n)/(i-n),r=s*this.rect_.width;this.adapter.isRTL()&&(r=this.rect_.width-r);var o=p?function(t,e){if(c(t)&&e in h){var i=t.document.createElement("div"),n=h[e],s=n.standard,r=n.prefixed;return s in i.style?s:r}return e}(window,"transform"):"transform",a=p?function(t,e){if(c(t)&&e in u){var i=t.document.createElement("div"),n=u[e],s=n.standard,r=n.prefixed;return n.cssProperty in i.style?s:r}return e}(window,"transitionend"):"transitionend";if(this.inTransit_){var l=function(){t.setInTransit_(!1),t.adapter.deregisterThumbContainerInteractionHandler(a,l)};this.adapter.registerThumbContainerInteractionHandler(a,l)}requestAnimationFrame((function(){t.adapter.setThumbContainerStyleProperty(o,"translateX("+r+"px) translateX(-50%)"),t.adapter.setTrackStyleProperty(o,"scaleX("+s+")")}))},e.prototype.setActive_=function(t){this.active_=t,this.toggleClass_(o.ACTIVE,this.active_)},e.prototype.setInTransit_=function(t){this.inTransit_=t,this.toggleClass_(o.IN_TRANSIT,this.inTransit_)},e.prototype.toggleClass_=function(t,e){e?this.adapter.addClass(t):this.adapter.removeClass(t)},e}(d.K),T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,n.ZT)(e,t),e.attachTo=function(t){return new e(t)},Object.defineProperty(e.prototype,"value",{get:function(){return this.foundation.getValue()},set:function(t){this.foundation.setValue(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"min",{get:function(){return this.foundation.getMin()},set:function(t){this.foundation.setMin(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"max",{get:function(){return this.foundation.getMax()},set:function(t){this.foundation.setMax(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"step",{get:function(){return this.foundation.getStep()},set:function(t){this.foundation.setStep(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return this.foundation.isDisabled()},set:function(t){this.foundation.setDisabled(t)},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){this.thumbContainer_=this.root.querySelector(a.THUMB_CONTAINER_SELECTOR),this.track_=this.root.querySelector(a.TRACK_SELECTOR),this.pinValueMarker_=this.root.querySelector(a.PIN_VALUE_MARKER_SELECTOR),this.trackMarkerContainer_=this.root.querySelector(a.TRACK_MARKER_CONTAINER_SELECTOR)},e.prototype.getDefaultFoundation=function(){var t=this;return new P({hasClass:function(e){return t.root.classList.contains(e)},addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},getAttribute:function(e){return t.root.getAttribute(e)},setAttribute:function(e,i){return t.root.setAttribute(e,i)},removeAttribute:function(e){return t.root.removeAttribute(e)},computeBoundingRect:function(){return t.root.getBoundingClientRect()},getTabIndex:function(){return t.root.tabIndex},registerInteractionHandler:function(e,i){return t.listen(e,i,(0,r.K)())},deregisterInteractionHandler:function(e,i){return t.unlisten(e,i,(0,r.K)())},registerThumbContainerInteractionHandler:function(e,i){t.thumbContainer_.addEventListener(e,i,(0,r.K)())},deregisterThumbContainerInteractionHandler:function(e,i){t.thumbContainer_.removeEventListener(e,i,(0,r.K)())},registerBodyInteractionHandler:function(t,e){return document.body.addEventListener(t,e)},deregisterBodyInteractionHandler:function(t,e){return document.body.removeEventListener(t,e)},registerResizeHandler:function(t){return window.addEventListener("resize",t)},deregisterResizeHandler:function(t){return window.removeEventListener("resize",t)},notifyInput:function(){return t.emit(a.INPUT_EVENT,t)},notifyChange:function(){return t.emit(a.CHANGE_EVENT,t)},setThumbContainerStyleProperty:function(e,i){t.thumbContainer_.style.setProperty(e,i)},setTrackStyleProperty:function(e,i){return t.track_.style.setProperty(e,i)},setMarkerValue:function(e){return t.pinValueMarker_.innerText=e.toLocaleString()},setTrackMarkers:function(e,i,n){var s=e.toLocaleString(),r="linear-gradient(to right, currentColor 2px, transparent 0) 0 center / calc((100% - 2px) / (("+i.toLocaleString()+" - "+n.toLocaleString()+") / "+s+")) 100% repeat-x";t.trackMarkerContainer_.style.setProperty("background",r)},isRTL:function(){return"rtl"===getComputedStyle(t.root).direction}})},e.prototype.initialSyncWithDOM=function(){var t=this.parseFloat_(this.root.getAttribute(a.ARIA_VALUENOW),this.value),e=this.parseFloat_(this.root.getAttribute(a.ARIA_VALUEMIN),this.min),i=this.parseFloat_(this.root.getAttribute(a.ARIA_VALUEMAX),this.max);e>=this.max?(this.max=i,this.min=e):(this.min=e,this.max=i),this.step=this.parseFloat_(this.root.getAttribute(a.STEP_DATA_ATTR),this.step),this.value=t,this.disabled=this.root.hasAttribute(a.ARIA_DISABLED)&&"false"!==this.root.getAttribute(a.ARIA_DISABLED),this.foundation.setupTrackMarker()},e.prototype.layout=function(){this.foundation.layout()},e.prototype.stepUp=function(t){void 0===t&&(t=this.step||1),this.value+=t},e.prototype.stepDown=function(t){void 0===t&&(t=this.step||1),this.value-=t},e.prototype.parseFloat_=function(t,e){var i=parseFloat(t);return"number"==typeof i&&isFinite(i)?i:e},e}(s.B)},7729:t=>{t.exports=function(t){var s=t.createGain(),r=s._voltage=function(t){var e=t.createBufferSource(),n=t.createBuffer(1,2,t.sampleRate);return n.getChannelData(0).set(i),e.buffer=n,e.loop=!0,e}(t),o=n(r),a=n(r),l=n(r);return s._startAmount=n(a),s._endAmount=n(l),s._multiplier=n(o),s._multiplier.connect(s),s._startAmount.connect(s),s._endAmount.connect(s),s.value=o.gain,s.startValue=a.gain,s.endValue=l.gain,s.startValue.value=0,s.endValue.value=0,Object.defineProperties(s,e),s};var e={attack:{value:0,writable:!0},decay:{value:0,writable:!0},sustain:{value:1,writable:!0},release:{value:0,writable:!0},getReleaseDuration:{value:function(){return this.release}},start:{value:function(t){var e=this._multiplier.gain,i=this._startAmount.gain,n=this._endAmount.gain;this._voltage.start(t),this._decayFrom=this._decayFrom=t+this.attack,this._startedAt=t;var r=this.sustain;e.cancelScheduledValues(t),i.cancelScheduledValues(t),n.cancelScheduledValues(t),n.setValueAtTime(0,t),this.attack?(e.setValueAtTime(0,t),e.linearRampToValueAtTime(1,t+this.attack),i.setValueAtTime(1,t),i.linearRampToValueAtTime(0,t+this.attack)):(e.setValueAtTime(1,t),i.setValueAtTime(0,t)),this.decay&&e.setTargetAtTime(r,this._decayFrom,s(this.decay))}},stop:{value:function(t,e){e&&(t-=this.release);var i=t+this.release;if(this.release){var n=this._multiplier.gain,r=this._startAmount.gain,o=this._endAmount.gain;n.cancelScheduledValues(t),r.cancelScheduledValues(t),o.cancelScheduledValues(t);var a=s(this.release);if(this.attack&&t=1&&(r=1),r}(0,0,this._startedAt,this._decayFrom,t);n.linearRampToValueAtTime(l,t),r.linearRampToValueAtTime(1-l,t),r.setTargetAtTime(0,t,a)}o.setTargetAtTime(1,t,a),n.setTargetAtTime(0,t,a)}return this._voltage.stop(i),i}},onended:{get:function(){return this._voltage.onended},set:function(t){this._voltage.onended=t}}},i=new Float32Array([1,1]);function n(t){var e=t.context.createGain();return t.connect(e),e}function s(t){return Math.log(t+1)/Math.log(100)}},4158:t=>{"use strict";t.exports={decode:function(t,e){for(var i,n,s,r=t.replace(/[^A-Za-z0-9\+\/]/g,""),o=r.length,a=e?Math.ceil((3*o+1>>2)/e)*e:3*o+1>>2,l=new Uint8Array(a),h=0,u=0,c=0;c64&&s<91?s-65:s>96&&s<123?s-71:s>47&&s<58?s+4:43===s?62:47===s?63:0)<<18-6*n,3===n||o-c==1){for(i=0;i<3&&u>>(16>>>i&24)&255;h=0}return l}}},9799:t=>{"use strict";t.exports=function(t,e){return new Promise((function(i,n){var s=new XMLHttpRequest;e&&(s.responseType=e),s.open("GET",t),s.onload=function(){200===s.status?i(s.response):n(Error(s.statusText))},s.onerror=function(){n(Error("Network Error"))},s.send()}))}},7665:(t,e,i)=>{"use strict";var n=i(4158),s=i(9799);function r(t){return function(e){return"string"==typeof e&&t.test(e)}}function o(t,e){return"string"==typeof t?t+e:"function"==typeof t?t(e):e}function a(t,e,i,n){var s,r=e instanceof ArrayBuffer?l:h(e)?u:(s=e)&&"function"==typeof s.then?c:d(e)?p:function(t){return t&&"object"==typeof t}(e)?f:m(e)?g:b(e)?y:S(e)?v:null;return r?r(t,e,i||{}):n?Promise.resolve(n):Promise.reject("Source not valid ("+e+")")}function l(t,e,i){return new Promise((function(i,n){t.decodeAudioData(e,(function(t){i(t)}),(function(){n("Can't decode audio data ("+e.slice(0,30)+"...)")}))}))}a.fetch=s;var h=r(/\.(mp3|wav|ogg)(\?.*)?$/i);function u(t,e,i){var n=o(i.from,e);return a(t,a.fetch(n,"arraybuffer"),i)}function c(t,e,i){return e.then((function(e){return a(t,e,i)}))}var d=Array.isArray;function p(t,e,i){return Promise.all(e.map((function(e){return a(t,e,i,e)})))}function f(t,e,i){var n={},s=Object.keys(e).map((function(s){if(i.only&&-1===i.only.indexOf(s))return null;var r=e[s];return a(t,r,i,r).then((function(t){n[s]=t}))}));return Promise.all(s).then((function(){return n}))}var m=r(/\.json(\?.*)?$/i);function g(t,e,i){var n=o(i.from,e);return a(t,a.fetch(n,"text").then(JSON.parse),i)}var b=r(/^data:audio/);function y(t,e,i){var s=e.indexOf(",");return a(t,n.decode(e.slice(s+1)).buffer,i)}var S=r(/\.js(\?.*)?$/i);function v(t,e,i){var n=o(i.from,e);return a(t,a.fetch(n,"text").then(_),i)}function _(t){var e=t.indexOf("MIDI.Soundfont.");if(e<0)throw Error("Invalid MIDI.js Soundfont format");e=t.indexOf("=",e)+2;var i=t.lastIndexOf(",");return JSON.parse(t.slice(e,i)+"}")}t.exports&&(t.exports=a),"undefined"!=typeof window&&(window.loadAudio=a)},5382:function(t,e,i){!function(t,e,i,n){"use strict";var s=function(t,e,i){return{endTime:e,insertTime:i,type:"exponentialRampToValue",value:t}},r=function(t,e,i){return{endTime:e,insertTime:i,type:"linearRampToValue",value:t}},o=function(t,e){return{startTime:e,type:"setValue",value:t}},a=function(t,e,i){return{duration:i,startTime:e,type:"setValueCurve",values:t}},l=function(t,e,i){var n=i.startTime,s=i.target,r=i.timeConstant;return s+(e-s)*Math.exp((n-t)/r)},h=function(t){return"exponentialRampToValue"===t.type},u=function(t){return"linearRampToValue"===t.type},c=function(t){return h(t)||u(t)},d=function(t){return"setValue"===t.type},p=function(t){return"setValueCurve"===t.type},f=function t(e,i,n,s){var r=e[i];return void 0===r?s:c(r)||d(r)?r.value:p(r)?r.values[r.values.length-1]:l(n,t(e,i-1,r.startTime,s),r)},m=function(t,e,i,n,s){return void 0===i?[n.insertTime,s]:c(i)?[i.endTime,i.value]:d(i)?[i.startTime,i.value]:p(i)?[i.startTime+i.duration,i.values[i.values.length-1]]:[i.startTime,f(t,e-1,i.startTime,s)]},g=function(t){return"cancelAndHold"===t.type},b=function(t){return"cancelScheduledValues"===t.type},y=function(t){return g(t)||b(t)?t.cancelTime:h(t)||u(t)?t.endTime:t.startTime},S=function(t,e,i,n){var s=n.endTime,r=n.value;return i===r?r:0=e:y(i)>=e})),n=this._automationEvents[i];if(-1!==i&&(this._automationEvents=this._automationEvents.slice(0,i)),g(t)){var l=this._automationEvents[this._automationEvents.length-1];if(void 0!==n&&c(n)){if(void 0!==l&&x(l))throw new Error("The internal list is malformed.");var d=void 0===l?n.insertTime:p(l)?l.startTime+l.duration:y(l),f=void 0===l?this._defaultValue:p(l)?l.values[l.values.length-1]:l.value,m=h(n)?S(e,d,f,n):v(e,d,f,n),_=h(n)?s(m,e,this._currenTime):r(m,e,this._currenTime);this._automationEvents.push(_)}if(void 0!==l&&x(l)&&this._automationEvents.push(o(this.getValue(e),e)),void 0!==l&&p(l)&&l.startTime+l.duration>e){var E=e-l.startTime,M=(l.values.length-1)/l.duration,w=Math.max(2,1+Math.ceil(E*M)),P=E/(w-1)*M,T=l.values.slice(0,w);if(P<1)for(var C=1;Ce})),L=-1===I?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[I-1];if(void 0!==L&&p(L)&&y(L)+L.duration>e)return!1;var R=h(t)?s(t.value,t.endTime,this._currenTime):u(t)?r(t.value,e,this._currenTime):t;if(-1===I)this._automationEvents.push(R);else{if(p(t)&&e+t.duration>y(this._automationEvents[I]))return!1;this._automationEvents.splice(I,0,R)}}return!0}},{key:"flush",value:function(t){var e=this._automationEvents.findIndex((function(e){return y(e)>t}));if(e>1){var i=this._automationEvents.slice(e-1),n=i[0];x(n)&&i.unshift(o(f(this._automationEvents,e-2,n.startTime,this._defaultValue),n.startTime)),this._automationEvents=i}}},{key:"getValue",value:function(t){if(0===this._automationEvents.length)return this._defaultValue;var i=this._automationEvents.findIndex((function(e){return y(e)>t})),n=this._automationEvents[i],s=(-1===i?this._automationEvents.length:i)-1,r=this._automationEvents[s];if(void 0!==r&&x(r)&&(void 0===n||!c(n)||n.insertTime>t))return l(t,f(this._automationEvents,s-1,r.startTime,this._defaultValue),r);if(void 0!==r&&d(r)&&(void 0===n||!c(n)))return r.value;if(void 0!==r&&p(r)&&(void 0===n||!c(n)||r.startTime+r.duration>t))return t= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};var c="[object Object]";n.prototype={constructor:n,logger:h.default,log:h.default.log,registerHelper:function(t,e){if(r.toString.call(t)===c){if(e)throw new o.default("Arg not supported with multiple helpers");r.extend(this.helpers,t)}else this.helpers[t]=e},unregisterHelper:function(t){delete this.helpers[t]},registerPartial:function(t,e){if(r.toString.call(t)===c)r.extend(this.partials,t);else{if(void 0===e)throw new o.default('Attempting to register a partial called "'+t+'" as undefined');this.partials[t]=e}},unregisterPartial:function(t){delete this.partials[t]},registerDecorator:function(t,e){if(r.toString.call(t)===c){if(e)throw new o.default("Arg not supported with multiple decorators");r.extend(this.decorators,t)}else this.decorators[t]=e},unregisterDecorator:function(t){delete this.decorators[t]},resetLoggedPropertyAccesses:function(){u.resetLoggedProperties()}};var d=h.default.log;e.log=d,e.createFrame=r.createFrame,e.logger=h.default},function(t,e){"use strict";function i(t){return s[t]}function n(t){for(var e=1;e":">",'"':""","'":"'","`":"`","=":"="},r=/[&<>"'`=]/g,o=/[&<>"'`=]/,a=Object.prototype.toString;e.toString=a;var l=function(t){return"function"==typeof t};l(/x/)&&(e.isFunction=l=function(t){return"function"==typeof t&&"[object Function]"===a.call(t)}),e.isFunction=l;var h=Array.isArray||function(t){return!(!t||"object"!=typeof t)&&"[object Array]"===a.call(t)};e.isArray=h},function(t,e,i){"use strict";function n(t,e){var i=e&&e.loc,o=void 0,a=void 0,l=void 0,h=void 0;i&&(o=i.start.line,a=i.end.line,l=i.start.column,h=i.end.column,t+=" - "+o+":"+l);for(var u=Error.prototype.constructor.call(this,t),c=0;c0?(i.ids&&(i.ids=[i.name]),t.helpers.each(e,i)):s(this);if(i.data&&i.ids){var o=n.createFrame(i.data);o.contextPath=n.appendContextPath(i.data.contextPath,i.name),i={data:o}}return r(e,i)}))},t.exports=e.default},function(t,e,i){"use strict";var n=i(13).default,s=i(43).default,r=i(55).default,o=i(60).default,a=i(1).default;e.__esModule=!0;var l=i(5),h=a(i(6));e.default=function(t){t.registerHelper("each",(function(t,e){function i(e,i,n){p&&(p.key=e,p.index=i,p.first=0===i,p.last=!!n,f&&(p.contextPath=f+e)),d+=a(t[e],{data:p,blockParams:l.blockParams([t[e],e],[f+e,null])})}if(!e)throw new h.default("Must pass iterator to #each");var a=e.fn,u=e.inverse,c=0,d="",p=void 0,f=void 0;if(e.data&&e.ids&&(f=l.appendContextPath(e.data.contextPath,e.ids[0])+"."),l.isFunction(t)&&(t=t.call(this)),e.data&&(p=l.createFrame(e.data)),t&&"object"==typeof t)if(l.isArray(t))for(var m=t.length;cs;)F(t,i=n[s++],e[i]);return t},G=function(t,e){return void 0===e?E(t):V(E(t),e)},W=function(t){var e=I.call(this,t);return!(e||!r(this,t)||!r(R,t)||r(this,A)&&this[A][t])||e},U=function(t,e){var i=_(t=S(t),e);return!i||!r(R,e)||r(t,A)&&t[A][e]||(i.enumerable=!0),i},H=function(t){for(var e,i=M(S(t)),n=[],s=0;i.length>s;)r(R,e=i[s++])||e==A||n.push(e);return n},z=function(t){for(var e,i=M(S(t)),n=[],s=0;i.length>s;)r(R,e=i[s++])&&n.push(R[e]);return n},j=h((function(){var t=w();return"[null]"!=T([t])||"{}"!=T({a:t})||"{}"!=T(Object(t))}));N||(w=function(){if(B(this))throw TypeError("Symbol is not a constructor");return D(d(arguments.length>0?arguments[0]:void 0))},l(w.prototype,"toString",(function(){return this._k})),B=function(t){return t instanceof w},n.create=G,n.isEnum=W,n.getDesc=U,n.setDesc=F,n.setDescs=V,n.getNames=m.get=H,n.getSymbols=z,o&&!i(41)&&l(k,"propertyIsEnumerable",W,!0));var X={for:function(t){return r(L,t+="")?L[t]:L[t]=w(t)},keyFor:function(t){return f(L,t)},useSetter:function(){C=!0},useSimple:function(){C=!1}};n.each.call("hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),(function(t){var e=p(t);X[t]=N?e:D(e)})),C=!0,a(a.G+a.W,{Symbol:w}),a(a.S,"Symbol",X),a(a.S+a.F*!N,"Object",{create:G,defineProperty:F,defineProperties:V,getOwnPropertyDescriptor:U,getOwnPropertyNames:H,getOwnPropertySymbols:z}),P&&a(a.S+a.F*(!N||j),"JSON",{stringify:function(t){if(void 0!==t&&!B(t)){for(var e,i,n=[t],s=1,r=arguments;r.length>s;)n.push(r[s++]);return"function"==typeof(e=n[1])&&(i=e),!i&&b(e)||(e=function(t,e){if(i&&(e=i.call(this,t,e)),!B(e))return e}),n[1]=e,T.apply(P,n)}}}),c(w,"Symbol"),c(Math,"Math",!0),c(s.JSON,"JSON",!0)},function(t,e){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,e){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},function(t,e,i){t.exports=!i(19)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,i){var n=i(16),s=i(21),r=i(22),o="prototype",a=function(t,e,i){var l,h,u,c=t&a.F,d=t&a.G,p=t&a.S,f=t&a.P,m=t&a.B,g=t&a.W,b=d?s:s[e]||(s[e]={}),y=d?n:p?n[e]:(n[e]||{})[o];for(l in d&&(i=e),i)(h=!c&&y&&l in y)&&l in b||(u=h?y[l]:i[l],b[l]=d&&"function"!=typeof y[l]?i[l]:m&&h?r(u,n):g&&y[l]==u?function(t){var e=function(e){return this instanceof t?new t(e):t(e)};return e[o]=t[o],e}(u):f&&"function"==typeof u?r(Function.call,u):u,f&&((b[o]||(b[o]={}))[l]=u))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,t.exports=a},function(t,e){var i=t.exports={version:"1.2.6"};"number"==typeof __e&&(__e=i)},function(t,e,i){var n=i(23);t.exports=function(t,e,i){if(n(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,n){return t.call(e,i,n)};case 3:return function(i,n,s){return t.call(e,i,n,s)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,i){t.exports=i(25)},function(t,e,i){var n=i(9),s=i(26);t.exports=i(18)?function(t,e,i){return n.setDesc(t,e,s(1,i))}:function(t,e,i){return t[e]=i,t}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,i){var n=i(16),s="__core-js_shared__",r=n[s]||(n[s]={});t.exports=function(t){return r[t]||(r[t]={})}},function(t,e,i){var n=i(9).setDesc,s=i(17),r=i(29)("toStringTag");t.exports=function(t,e,i){t&&!s(t=i?t:t.prototype,r)&&n(t,r,{configurable:!0,value:e})}},function(t,e,i){var n=i(27)("wks"),s=i(30),r=i(16).Symbol;t.exports=function(t){return n[t]||(n[t]=r&&r[t]||(r||s)("Symbol."+t))}},function(t,e){var i=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++i+n).toString(36))}},function(t,e,i){var n=i(9),s=i(32);t.exports=function(t,e){for(var i,r=s(t),o=n.getKeys(r),a=o.length,l=0;a>l;)if(r[i=o[l++]]===e)return i}},function(t,e,i){var n=i(33),s=i(35);t.exports=function(t){return n(s(t))}},function(t,e,i){var n=i(34);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==n(t)?t.split(""):Object(t)}},function(t,e){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,i){var n=i(32),s=i(9).getNames,r={}.toString,o="object"==typeof window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.get=function(t){return o&&"[object Window]"==r.call(t)?function(t){try{return s(t)}catch(t){return o.slice()}}(t):s(n(t))}},function(t,e,i){var n=i(9);t.exports=function(t){var e=n.getKeys(t),i=n.getSymbols;if(i)for(var s,r=i(t),o=n.isEnum,a=0;r.length>a;)o.call(t,s=r[a++])&&e.push(s);return e}},function(t,e,i){var n=i(34);t.exports=Array.isArray||function(t){return"Array"==n(t)}},function(t,e,i){var n=i(40);t.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports=!0},function(t,e){},function(t,e,i){t.exports={default:i(44),__esModule:!0}},function(t,e,i){i(45),i(51),t.exports=i(29)("iterator")},function(t,e,i){"use strict";var n=i(46)(!0);i(48)(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,i=this._i;return i>=e.length?{value:void 0,done:!0}:(t=n(e,i),this._i+=t.length,{value:t,done:!1})}))},function(t,e,i){var n=i(47),s=i(35);t.exports=function(t){return function(e,i){var r,o,a=String(s(e)),l=n(i),h=a.length;return l<0||l>=h?t?"":void 0:(r=a.charCodeAt(l))<55296||r>56319||l+1===h||(o=a.charCodeAt(l+1))<56320||o>57343?t?a.charAt(l):r:t?a.slice(l,l+2):o-56320+(r-55296<<10)+65536}}},function(t,e){var i=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:i)(t)}},function(t,e,i){"use strict";var n=i(41),s=i(20),r=i(24),o=i(25),a=i(17),l=i(49),h=i(50),u=i(28),c=i(9).getProto,d=i(29)("iterator"),p=!([].keys&&"next"in[].keys()),f="@@iterator",m="keys",g="values",b=function(){return this};t.exports=function(t,e,i,y,S,v,_){h(i,e,y);var x,E,M=function(t){if(!p&&t in C)return C[t];switch(t){case m:case g:return function(){return new i(this,t)}}return function(){return new i(this,t)}},w=e+" Iterator",P=S==g,T=!1,C=t.prototype,A=C[d]||C[f]||S&&C[S],I=A||M(S);if(A){var L=c(I.call(new t));u(L,w,!0),!n&&a(C,f)&&o(L,d,b),P&&A.name!==g&&(T=!0,I=function(){return A.call(this)})}if(n&&!_||!p&&!T&&C[d]||o(C,d,I),l[e]=I,l[w]=b,S)if(x={values:P?I:M(g),keys:v?I:M(m),entries:P?M("entries"):I},_)for(E in x)E in C||r(C,E,x[E]);else s(s.P+s.F*(p||T),e,x);return x}},function(t,e){t.exports={}},function(t,e,i){"use strict";var n=i(9),s=i(26),r=i(28),o={};i(25)(o,i(29)("iterator"),(function(){return this})),t.exports=function(t,e,i){t.prototype=n.create(o,{next:s(1,i)}),r(t,e+" Iterator")}},function(t,e,i){i(52);var n=i(49);n.NodeList=n.HTMLCollection=n.Array},function(t,e,i){"use strict";var n=i(53),s=i(54),r=i(49),o=i(32);t.exports=i(48)(Array,"Array",(function(t,e){this._t=o(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,i=this._i++;return!t||i>=t.length?(this._t=void 0,s(1)):s(0,"keys"==e?i:"values"==e?t[i]:[i,t[i]])}),"values"),r.Arguments=r.Array,n("keys"),n("values"),n("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,i){t.exports={default:i(56),__esModule:!0}},function(t,e,i){i(51),i(45),t.exports=i(57)},function(t,e,i){var n=i(39),s=i(58);t.exports=i(21).getIterator=function(t){var e=s(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return n(e.call(t))}},function(t,e,i){var n=i(59),s=i(29)("iterator"),r=i(49);t.exports=i(21).getIteratorMethod=function(t){if(null!=t)return t[s]||t["@@iterator"]||r[n(t)]}},function(t,e,i){var n=i(34),s=i(29)("toStringTag"),r="Arguments"==n(function(){return arguments}());t.exports=function(t){var e,i,o;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=(e=Object(t))[s])?i:r?n(e):"Object"==(o=n(e))&&"function"==typeof e.callee?"Arguments":o}},function(t,e,i){t.exports={default:i(61),__esModule:!0}},function(t,e,i){i(62),t.exports=i(21).Object.keys},function(t,e,i){var n=i(63);i(64)("keys",(function(t){return function(e){return t(n(e))}}))},function(t,e,i){var n=i(35);t.exports=function(t){return Object(n(t))}},function(t,e,i){var n=i(20),s=i(21),r=i(19);t.exports=function(t,e){var i=(s.Object||{})[t]||Object[t],o={};o[t]=e(i),n(n.S+n.F*r((function(){i(1)})),"Object",o)}},function(t,e,i){"use strict";var n=i(1).default;e.__esModule=!0;var s=n(i(6));e.default=function(t){t.registerHelper("helperMissing",(function(){if(1!==arguments.length)throw new s.default('Missing helper: "'+arguments[arguments.length-1].name+'"')}))},t.exports=e.default},function(t,e,i){"use strict";var n=i(1).default;e.__esModule=!0;var s=i(5),r=n(i(6));e.default=function(t){t.registerHelper("if",(function(t,e){if(2!=arguments.length)throw new r.default("#if requires exactly one argument");return s.isFunction(t)&&(t=t.call(this)),!e.hash.includeZero&&!t||s.isEmpty(t)?e.inverse(this):e.fn(this)})),t.registerHelper("unless",(function(e,i){if(2!=arguments.length)throw new r.default("#unless requires exactly one argument");return t.helpers.if.call(this,e,{fn:i.inverse,inverse:i.fn,hash:i.hash})}))},t.exports=e.default},function(t,e){"use strict";e.__esModule=!0,e.default=function(t){t.registerHelper("log",(function(){for(var e=[void 0],i=arguments[arguments.length-1],n=0;n=0?e:parseInt(t,10)}return t},log:function(t){if(t=s.lookupLevel(t),"undefined"!=typeof console&&s.lookupLevel(s.level)<=t){var e=s.methodMap[t];console[e]||(e="log");for(var i=arguments.length,n=Array(i>1?i-1:0),r=1;r=d.LAST_COMPATIBLE_COMPILER_REVISION&&e<=d.COMPILER_REVISION)){if(e2&&_.push("'"+this.terminals_[y]+"'");E=this.lexer.showPosition?"Parse error on line "+(l+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+_.join(", ")+", got '"+(this.terminals_[p]||p)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==p?"end of input":"'"+(this.terminals_[p]||p)+"'"),this.parseError(E,{text:this.lexer.match,token:this.terminals_[p]||p,line:this.lexer.yylineno,loc:c,expected:_})}}if(g[0]instanceof Array&&g.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+p);switch(g[0]){case 1:n.push(p),s.push(this.lexer.yytext),r.push(this.lexer.yylloc),n.push(g[1]),p=null,f?(p=f,f=null):(h=this.lexer.yyleng,a=this.lexer.yytext,l=this.lexer.yylineno,c=this.lexer.yylloc,u>0&&u--);break;case 2:if(S=this.productions_[g[1]][1],x.$=s[s.length-S],x._$={first_line:r[r.length-(S||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(S||1)].first_column,last_column:r[r.length-1].last_column},d&&(x._$.range=[r[r.length-(S||1)].range[0],r[r.length-1].range[1]]),void 0!==(b=this.performAction.call(x,a,h,l,this.yy,g[1],s,r)))return b;S&&(n=n.slice(0,-1*S*2),s=s.slice(0,-1*S),r=r.slice(0,-1*S)),n.push(this.productions_[g[1]][0]),s.push(x.$),r.push(x._$),v=o[n[n.length-2]][n[n.length-1]],n.push(v);break;case 3:return!0}}return!0}},i=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t){return this._input=t,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e-1),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this},more:function(){return this._more=!0,this},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},next:function(){if(this.done)return this.EOF;var t,e,i,n,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),o=0;oe[0].length)||(e=i,n=o,this.options.flex));o++);return e?((s=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],t=this.performAction.call(this,this.yy,this,r[n],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),t||void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return void 0!==t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(t){this.begin(t)},options:{},performAction:function(t,e,i,n){function s(t,i){return e.yytext=e.yytext.substring(t,e.yyleng-i+t)}switch(i){case 0:if("\\\\"===e.yytext.slice(-2)?(s(0,1),this.begin("mu")):"\\"===e.yytext.slice(-1)?(s(0,1),this.begin("emu")):this.begin("mu"),e.yytext)return 15;break;case 1:case 5:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(s(5,9),"END_RAW_BLOCK");case 6:case 22:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:case 23:return 48;case 21:this.unput(e.yytext),this.popState(),this.begin("com");break;case 24:return 73;case 25:case 26:case 41:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return e.yytext=s(1,2).replace(/\\"/g,'"'),80;case 32:return e.yytext=s(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 42:return e.yytext=e.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},rules:[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],conditions:{mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}}};return t}();return e.lexer=i,t.prototype=e,e.Parser=t,new t}();e.default=i,t.exports=e.default},function(t,e,i){"use strict";function n(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=t}function s(t,e,i){void 0===e&&(e=t.length);var n=t[e-1],s=t[e-2];return n?"ContentStatement"===n.type?(s||!i?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(n.original):void 0:i}function r(t,e,i){void 0===e&&(e=-1);var n=t[e+1],s=t[e+2];return n?"ContentStatement"===n.type?(s||!i?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(n.original):void 0:i}function o(t,e,i){var n=t[null==e?0:e+1];if(n&&"ContentStatement"===n.type&&(i||!n.rightStripped)){var s=n.value;n.value=n.value.replace(i?/^\s+/:/^[ \t]*\r?\n?/,""),n.rightStripped=n.value!==s}}function a(t,e,i){var n=t[null==e?t.length-1:e-1];if(n&&"ContentStatement"===n.type&&(i||!n.leftStripped)){var s=n.value;return n.value=n.value.replace(i?/\s+$/:/[ \t]+$/,""),n.leftStripped=n.value!==s,n.leftStripped}}var l=i(1).default;e.__esModule=!0;var h=l(i(88));n.prototype=new h.default,n.prototype.Program=function(t){var e=!this.options.ignoreStandalone,i=!this.isRootSeen;this.isRootSeen=!0;for(var n=t.body,l=0,h=n.length;l0)throw new r.default("Invalid path: "+n,{loc:i});".."===h&&o++}}return{type:"PathExpression",data:t,depth:o,parts:s,original:n,loc:i}},e.prepareMustache=function(t,e,i,n,s,r){var o=n.charAt(3)||n.charAt(2),a="{"!==o&&"&"!==o;return{type:/\*/.test(n)?"Decorator":"MustacheStatement",path:t,params:e,hash:i,escaped:a,strip:s,loc:this.locInfo(r)}},e.prepareRawBlock=function(t,e,i,s){n(t,i);var r={type:"Program",body:e,strip:{},loc:s=this.locInfo(s)};return{type:"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:r,openStrip:{},inverseStrip:{},closeStrip:{},loc:s}},e.prepareBlock=function(t,e,i,s,o,a){s&&s.path&&n(t,s);var l=/\*/.test(t.open);e.blockParams=t.blockParams;var h=void 0,u=void 0;if(i){if(l)throw new r.default("Unexpected inverse block on decorator",i);i.chain&&(i.program.body[0].closeStrip=s.strip),u=i.strip,h=i.program}return o&&(o=h,h=e,e=o),{type:l?"DecoratorBlock":"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:e,inverse:h,openStrip:t.strip,inverseStrip:u,closeStrip:s&&s.strip,loc:this.locInfo(a)}},e.prepareProgram=function(t,e){if(!e&&t.length){var i=t[0].loc,n=t[t.length-1].loc;i&&n&&(e={source:i.source,start:{line:i.start.line,column:i.start.column},end:{line:n.end.line,column:n.end.column}})}return{type:"Program",body:t,strip:{},loc:e}},e.preparePartialBlock=function(t,e,i,s){return n(t,i),{type:"PartialBlockStatement",name:t.path,params:t.params,hash:t.hash,program:e,openStrip:t.strip,closeStrip:i&&i.strip,loc:this.locInfo(s)}};var r=s(i(6))},function(t,e,i){"use strict";function n(){}function s(t,e){if(t===e)return!0;if(h.isArray(t)&&h.isArray(e)&&t.length===e.length){for(var i=0;i1)throw new l.default("Unsupported number of partial arguments: "+i.length,t);i.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):i.push({type:"PathExpression",parts:[],depth:0}));var n=t.name.original,s="SubExpression"===t.name.type;s&&this.accept(t.name),this.setupFullMustacheParams(t,e,void 0,!0);var r=t.indent||"";this.options.preventIndent&&r&&(this.opcode("appendContent",r),r=""),this.opcode("invokePartial",s,n,r),this.opcode("append")},PartialBlockStatement:function(t){this.PartialStatement(t)},MustacheStatement:function(t){this.SubExpression(t),t.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(t){this.DecoratorBlock(t)},ContentStatement:function(t){t.value&&this.opcode("appendContent",t.value)},CommentStatement:function(){},SubExpression:function(t){r(t);var e=this.classifySexpr(t);"simple"===e?this.simpleSexpr(t):"helper"===e?this.helperSexpr(t):this.ambiguousSexpr(t)},ambiguousSexpr:function(t,e,i){var n=t.path,s=n.parts[0],r=null!=e||null!=i;this.opcode("getContext",n.depth),this.opcode("pushProgram",e),this.opcode("pushProgram",i),n.strict=!0,this.accept(n),this.opcode("invokeAmbiguous",s,r)},simpleSexpr:function(t){var e=t.path;e.strict=!0,this.accept(e),this.opcode("resolvePossibleLambda")},helperSexpr:function(t,e,i){var n=this.setupFullMustacheParams(t,e,i),s=t.path,r=s.parts[0];if(this.options.knownHelpers[r])this.opcode("invokeKnownHelper",n.length,r);else{if(this.options.knownHelpersOnly)throw new l.default("You specified knownHelpersOnly, but used the unknown helper "+r,t);s.strict=!0,s.falsy=!0,this.accept(s),this.opcode("invokeHelper",n.length,s.original,u.default.helpers.simpleId(s))}},PathExpression:function(t){this.addDepth(t.depth),this.opcode("getContext",t.depth);var e=t.parts[0],i=u.default.helpers.scopedId(t),n=!t.depth&&!i&&this.blockParamIndex(e);n?this.opcode("lookupBlockParam",n,t.parts):e?t.data?(this.options.data=!0,this.opcode("lookupData",t.depth,t.parts,t.strict)):this.opcode("lookupOnContext",t.parts,t.falsy,t.strict,i):this.opcode("pushContext")},StringLiteral:function(t){this.opcode("pushString",t.value)},NumberLiteral:function(t){this.opcode("pushLiteral",t.value)},BooleanLiteral:function(t){this.opcode("pushLiteral",t.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(t){var e=t.pairs,i=0,n=e.length;for(this.opcode("pushHash");i=0)return[e,s]}}}},function(t,e,i){"use strict";function n(t){this.value=t}function s(){}var r=i(60).default,o=i(1).default;e.__esModule=!0;var a=i(4),l=o(i(6)),h=i(5),u=o(i(92));s.prototype={nameLookup:function(t,e){return this.internalNameLookup(t,e)},depthedLookup:function(t){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(t),")"]},compilerInfo:function(){var t=a.COMPILER_REVISION;return[t,a.REVISION_CHANGES[t]]},appendToBuffer:function(t,e,i){return h.isArray(t)||(t=[t]),t=this.source.wrap(t,e),this.environment.isSimple?["return ",t,";"]:i?["buffer += ",t,";"]:(t.appendToBuffer=!0,t)},initializeBuffer:function(){return this.quotedString("")},internalNameLookup:function(t,e){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",t,",",JSON.stringify(e),")"]},lookupPropertyFunctionIsUsed:!1,compile:function(t,e,i,n){this.environment=t,this.options=e,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!n,this.name=this.environment.name,this.isChild=!!i,this.context=i||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(t,e),this.useDepths=this.useDepths||t.useDepths||t.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||t.useBlockParams;var s=t.opcodes,r=void 0,o=void 0,a=void 0,h=void 0;for(a=0,h=s.length;a0&&(i+=", "+n.join(", "));var s=0;r(this.aliases).forEach((function(t){var n=e.aliases[t];n.children&&n.referenceCount>1&&(i+=", alias"+ ++s+"="+t,n.children[0]="alias"+s)})),this.lookupPropertyFunctionIsUsed&&(i+=", "+this.lookupPropertyFunctionVarDeclaration());var o=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&o.push("blockParams"),this.useDepths&&o.push("depths");var a=this.mergeSource(i);return t?(o.push(a),Function.apply(this,o)):this.source.wrap(["function(",o.join(","),") {\n ",a,"}"])},mergeSource:function(t){var e=this.environment.isSimple,i=!this.forceBuffer,n=void 0,s=void 0,r=void 0,o=void 0;return this.source.each((function(t){t.appendToBuffer?(r?t.prepend(" + "):r=t,o=t):(r&&(s?r.prepend("buffer += "):n=!0,o.add(";"),r=o=void 0),s=!0,e||(i=!1))})),i?r?(r.prepend("return "),o.add(";")):s||this.source.push('return "";'):(t+=", buffer = "+(n?"":this.initializeBuffer()),r?(r.prepend("return buffer + "),o.add(";")):this.source.push("return buffer;")),t&&this.source.prepend("var "+t.substring(2)+(n?"":";\n")),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return"\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n ".trim()},blockValue:function(t){var e=this.aliasable("container.hooks.blockHelperMissing"),i=[this.contextName(0)];this.setupHelperArgs(t,0,i);var n=this.popStack();i.splice(1,0,n),this.push(this.source.functionCall(e,"call",i))},ambiguousBlockValue:function(){var t=this.aliasable("container.hooks.blockHelperMissing"),e=[this.contextName(0)];this.setupHelperArgs("",0,e,!0),this.flushInline();var i=this.topStack();e.splice(1,0,i),this.pushSource(["if (!",this.lastHelper,") { ",i," = ",this.source.functionCall(t,"call",e),"}"])},appendContent:function(t){this.pendingContent?t=this.pendingContent+t:this.pendingLocation=this.source.currentLocation,this.pendingContent=t},append:function(){if(this.isInline())this.replaceStack((function(t){return[" != null ? ",t,' : ""']})),this.pushSource(this.appendToBuffer(this.popStack()));else{var t=this.popStack();this.pushSource(["if (",t," != null) { ",this.appendToBuffer(t,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(t){this.lastContext=t},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(t,e,i,n){var s=0;n||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(t[s++])),this.resolvePath("context",t,s,e,i)},lookupBlockParam:function(t,e){this.useBlockParams=!0,this.push(["blockParams[",t[0],"][",t[1],"]"]),this.resolvePath("context",e,1)},lookupData:function(t,e,i){t?this.pushStackLiteral("container.data(data, "+t+")"):this.pushStackLiteral("data"),this.resolvePath("data",e,0,!0,i)},resolvePath:function(t,e,i,n,s){var r=this;if(this.options.strict||this.options.assumeObjects)this.push(function(t,e,i,n,s){var r=e.popStack(),o=i.length;for(t&&o--;nthis.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var t=this.inlineStack;this.inlineStack=[];for(var e=0,i=t.length;e{t.exports=function t(e,i,n){function s(o,a){if(!i[o]){if(!e[o]){if(r)return r(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var h=i[o]={exports:{}};e[o][0].call(h.exports,(function(t){return s(e[o][1][t]||t)}),h,h.exports,t,e,i,n)}return i[o].exports}for(var r=void 0,o=0;o>2,a=(3&e)<<4|i>>4,l=1>6:64,h=2>4,i=(15&o)<<4|(a=r.indexOf(t.charAt(h++)))>>2,n=(3&a)<<6|(l=r.indexOf(t.charAt(h++))),d[u++]=e,64!==a&&(d[u++]=i),64!==l&&(d[u++]=n);return d}},{"./support":30,"./utils":32}],2:[function(t,e,i){"use strict";var n=t("./external"),s=t("./stream/DataWorker"),r=t("./stream/Crc32Probe"),o=t("./stream/DataLengthProbe");function a(t,e,i,n,s){this.compressedSize=t,this.uncompressedSize=e,this.crc32=i,this.compression=n,this.compressedContent=s}a.prototype={getContentWorker:function(){var t=new s(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),e=this;return t.on("end",(function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new s(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(t,e,i){return t.pipe(new r).pipe(new o("uncompressedSize")).pipe(e.compressWorker(i)).pipe(new o("compressedSize")).withStreamInfo("compression",e)},e.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,i){"use strict";var n=t("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(t){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},i.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,i){"use strict";var n=t("./utils"),s=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==n.getTypeOf(t)?function(t,e,i,n){var r=s,o=0+i;t^=-1;for(var a=0;a>>8^r[255&(t^e[a])];return-1^t}(0|e,t,t.length):function(t,e,i,n){var r=s,o=0+i;t^=-1;for(var a=0;a>>8^r[255&(t^e.charCodeAt(a))];return-1^t}(0|e,t,t.length):0}},{"./utils":32}],5:[function(t,e,i){"use strict";i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(t,e,i){"use strict";var n;n="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:n}},{lie:37}],7:[function(t,e,i){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,s=t("pako"),r=t("./utils"),o=t("./stream/GenericWorker"),a=n?"uint8array":"array";function l(t,e){o.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}i.magic="\b\0",r.inherits(l,o),l.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(r.transformTo(a,t.data),!1)},l.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},i.compressWorker=function(t){return new l("Deflate",t)},i.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,i){"use strict";function n(t,e){var i,n="";for(i=0;i>>=8;return n}function s(t,e,i,s,o,u){var c,d,p=t.file,f=t.compression,m=u!==a.utf8encode,g=r.transformTo("string",u(p.name)),b=r.transformTo("string",a.utf8encode(p.name)),y=p.comment,S=r.transformTo("string",u(y)),v=r.transformTo("string",a.utf8encode(y)),_=b.length!==p.name.length,x=v.length!==y.length,E="",M="",w="",P=p.dir,T=p.date,C={crc32:0,compressedSize:0,uncompressedSize:0};e&&!i||(C.crc32=t.crc32,C.compressedSize=t.compressedSize,C.uncompressedSize=t.uncompressedSize);var A=0;e&&(A|=8),m||!_&&!x||(A|=2048);var I=0,L=0;P&&(I|=16),"UNIX"===o?(L=798,I|=function(t,e){var i=t;return t||(i=e?16893:33204),(65535&i)<<16}(p.unixPermissions,P)):(L=20,I|=function(t){return 63&(t||0)}(p.dosPermissions)),c=T.getUTCHours(),c<<=6,c|=T.getUTCMinutes(),c<<=5,c|=T.getUTCSeconds()/2,d=T.getUTCFullYear()-1980,d<<=4,d|=T.getUTCMonth()+1,d<<=5,d|=T.getUTCDate(),_&&(M=n(1,1)+n(l(g),4)+b,E+="up"+n(M.length,2)+M),x&&(w=n(1,1)+n(l(S),4)+v,E+="uc"+n(w.length,2)+w);var R="";return R+="\n\0",R+=n(A,2),R+=f.magic,R+=n(c,2),R+=n(d,2),R+=n(C.crc32,4),R+=n(C.compressedSize,4),R+=n(C.uncompressedSize,4),R+=n(g.length,2),R+=n(E.length,2),{fileRecord:h.LOCAL_FILE_HEADER+R+g+E,dirRecord:h.CENTRAL_FILE_HEADER+n(L,2)+R+n(S.length,2)+"\0\0\0\0"+n(I,4)+n(s,4)+g+E+S}}var r=t("../utils"),o=t("../stream/GenericWorker"),a=t("../utf8"),l=t("../crc32"),h=t("../signature");function u(t,e,i,n){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=i,this.encodeFileName=n,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(u,o),u.prototype.push=function(t){var e=t.meta.percent||0,i=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,o.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:i?(e+100*(i-n-1))/i:100}}))},u.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var i=s(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:i.fileRecord,meta:{percent:0}})}else this.accumulate=!0},u.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,i=s(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(i.dirRecord),e)this.push({data:function(t){return h.DATA_DESCRIPTOR+n(t.crc32,4)+n(t.compressedSize,4)+n(t.uncompressedSize,4)}(t),meta:{percent:100}});else for(this.push({data:i.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},u.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e=this.index;e--)i=(i<<8)+this.byteAt(e);return this.index+=t,i},readString:function(t){return n.transformTo("string",this.readData(t))},readData:function(t){},lastIndexOfSignature:function(t){},readAndCheckSignature:function(t){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=s},{"../utils":32}],19:[function(t,e,i){"use strict";var n=t("./Uint8ArrayReader");function s(t){n.call(this,t)}t("../utils").inherits(s,n),s.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,i){"use strict";var n=t("./DataReader");function s(t){n.call(this,t)}t("../utils").inherits(s,n),s.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},s.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},s.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},s.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=s},{"../utils":32,"./DataReader":18}],21:[function(t,e,i){"use strict";var n=t("./ArrayReader");function s(t){n.call(this,t)}t("../utils").inherits(s,n),s.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,i){"use strict";var n=t("../utils"),s=t("../support"),r=t("./ArrayReader"),o=t("./StringReader"),a=t("./NodeBufferReader"),l=t("./Uint8ArrayReader");e.exports=function(t){var e=n.getTypeOf(t);return n.checkSupport(e),"string"!==e||s.uint8array?"nodebuffer"===e?new a(t):s.uint8array?new l(n.transformTo("uint8array",t)):new r(n.transformTo("array",t)):new o(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,i){"use strict";i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,e,i){"use strict";var n=t("./GenericWorker"),s=t("../utils");function r(t){n.call(this,"ConvertWorker to "+t),this.destType=t}s.inherits(r,n),r.prototype.processChunk=function(t){this.push({data:s.transformTo(this.destType,t.data),meta:t.meta})},e.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,i){"use strict";var n=t("./GenericWorker"),s=t("../crc32");function r(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(r,n),r.prototype.processChunk=function(t){this.streamInfo.crc32=s(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,i){"use strict";var n=t("../utils"),s=t("./GenericWorker");function r(t){s.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}n.inherits(r,s),r.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}s.prototype.processChunk.call(this,t)},e.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,i){"use strict";var n=t("../utils"),s=t("./GenericWorker");function r(t){s.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=n.getTypeOf(t),e.isPaused||e._tickAndRepeat()}),(function(t){e.error(t)}))}n.inherits(r,s),r.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,i){"use strict";function n(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var i=0;i "+t:t}},e.exports=n},{}],29:[function(t,e,i){"use strict";var n=t("../utils"),s=t("./ConvertWorker"),r=t("./GenericWorker"),o=t("../base64"),a=t("../support"),l=t("../external"),h=null;if(a.nodestream)try{h=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function u(t,e,i){var o=e;switch(e){case"blob":case"arraybuffer":o="uint8array";break;case"base64":o="string"}try{this._internalType=o,this._outputType=e,this._mimeType=i,n.checkSupport(o),this._worker=t.pipe(new s(o)),t.lock()}catch(t){this._worker=new r("error"),this._worker.error(t)}}u.prototype={accumulate:function(t){return function(t,e){return new l.Promise((function(i,s){var r=[],a=t._internalType,l=t._outputType,h=t._mimeType;t.on("data",(function(t,i){r.push(t),e&&e(i)})).on("error",(function(t){r=[],s(t)})).on("end",(function(){try{var t=function(t,e,i){switch(t){case"blob":return n.newBlob(n.transformTo("arraybuffer",e),i);case"base64":return o.encode(e);default:return n.transformTo(t,e)}}(l,function(t,e){var i,n=0,s=null,r=0;for(i=0;i>>6:(i<65536?e[o++]=224|i>>>12:(e[o++]=240|i>>>18,e[o++]=128|i>>>12&63),e[o++]=128|i>>>6&63),e[o++]=128|63&i);return e}(t)},i.utf8decode=function(t){return s.nodebuffer?n.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,i,s,r,o=t.length,l=new Array(2*o);for(e=i=0;e>10&1023,l[i++]=56320|1023&s)}return l.length!==i&&(l.subarray?l=l.subarray(0,i):l.length=i),n.applyFromCharCode(l)}(t=n.transformTo(s.uint8array?"uint8array":"array",t))},n.inherits(h,o),h.prototype.processChunk=function(t){var e=n.transformTo(s.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var r=e;(e=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),e.set(r,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var o=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;0<=i&&128==(192&t[i]);)i--;return i<0||0===i?e:i+a[t[i]]>e?i:e}(e),l=e;o!==e.length&&(s.uint8array?(l=e.subarray(0,o),this.leftOver=e.subarray(o,e.length)):(l=e.slice(0,o),this.leftOver=e.slice(o,e.length))),this.push({data:i.utf8decode(l),meta:t.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=h,n.inherits(u,o),u.prototype.processChunk=function(t){this.push({data:i.utf8encode(t.data),meta:t.meta})},i.Utf8EncodeWorker=u},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,i){"use strict";var n=t("./support"),s=t("./base64"),r=t("./nodejsUtils"),o=t("set-immediate-shim"),a=t("./external");function l(t){return t}function h(t,e){for(var i=0;i>8;this.dir=!!(16&this.externalFileAttributes),0==t&&(this.dosPermissions=63&this.externalFileAttributes),3==t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(t){if(this.extraFields[1]){var e=n(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(t){var e,i,n,s=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4>>6:(i<65536?e[o++]=224|i>>>12:(e[o++]=240|i>>>18,e[o++]=128|i>>>12&63),e[o++]=128|i>>>6&63),e[o++]=128|63&i);return e},i.buf2binstring=function(t){return l(t,t.length)},i.binstring2buf=function(t){for(var e=new n.Buf8(t.length),i=0,s=e.length;i>10&1023,h[n++]=56320|1023&s)}return l(h,n)},i.utf8border=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;0<=i&&128==(192&t[i]);)i--;return i<0||0===i?e:i+o[t[i]]>e?i:e}},{"./common":41}],43:[function(t,e,i){"use strict";e.exports=function(t,e,i,n){for(var s=65535&t|0,r=t>>>16&65535|0,o=0;0!==i;){for(i-=o=2e3>>1:t>>>1;e[i]=t}return e}();e.exports=function(t,e,i,s){var r=n,o=s+i;t^=-1;for(var a=s;a>>8^r[255&(t^e[a])];return-1^t}},{}],46:[function(t,e,i){"use strict";var n,s=t("../utils/common"),r=t("./trees"),o=t("./adler32"),a=t("./crc32"),l=t("./messages"),h=0,u=0,c=-2,d=2,p=8,f=286,m=30,g=19,b=2*f+1,y=15,S=3,v=258,_=v+S+1,x=42,E=113;function M(t,e){return t.msg=l[e],e}function w(t){return(t<<1)-(4t.avail_out&&(i=t.avail_out),0!==i&&(s.arraySet(t.output,e.pending_buf,e.pending_out,i,t.next_out),t.next_out+=i,e.pending_out+=i,t.total_out+=i,t.avail_out-=i,e.pending-=i,0===e.pending&&(e.pending_out=0))}function C(t,e){r._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,T(t.strm)}function A(t,e){t.pending_buf[t.pending++]=e}function I(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function L(t,e){var i,n,s=t.max_chain_length,r=t.strstart,o=t.prev_length,a=t.nice_match,l=t.strstart>t.w_size-_?t.strstart-(t.w_size-_):0,h=t.window,u=t.w_mask,c=t.prev,d=t.strstart+v,p=h[r+o-1],f=h[r+o];t.prev_length>=t.good_match&&(s>>=2),a>t.lookahead&&(a=t.lookahead);do{if(h[(i=e)+o]===f&&h[i+o-1]===p&&h[i]===h[r]&&h[++i]===h[r+1]){r+=2,i++;do{}while(h[++r]===h[++i]&&h[++r]===h[++i]&&h[++r]===h[++i]&&h[++r]===h[++i]&&h[++r]===h[++i]&&h[++r]===h[++i]&&h[++r]===h[++i]&&h[++r]===h[++i]&&rl&&0!=--s);return o<=t.lookahead?o:t.lookahead}function R(t){var e,i,n,r,l,h,u,c,d,p,f=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=f+(f-_)){for(s.arraySet(t.window,t.window,f,f,0),t.match_start-=f,t.strstart-=f,t.block_start-=f,e=i=t.hash_size;n=t.head[--e],t.head[e]=f<=n?n-f:0,--i;);for(e=i=f;n=t.prev[--e],t.prev[e]=f<=n?n-f:0,--i;);r+=f}if(0===t.strm.avail_in)break;if(h=t.strm,u=t.window,c=t.strstart+t.lookahead,p=void 0,(d=r)<(p=h.avail_in)&&(p=d),i=0===p?0:(h.avail_in-=p,s.arraySet(u,h.input,h.next_in,p,c),1===h.state.wrap?h.adler=o(h.adler,u,p,c):2===h.state.wrap&&(h.adler=a(h.adler,u,p,c)),h.next_in+=p,h.total_in+=p,p),t.lookahead+=i,t.lookahead+t.insert>=S)for(l=t.strstart-t.insert,t.ins_h=t.window[l],t.ins_h=(t.ins_h<=S&&(t.ins_h=(t.ins_h<=S)if(n=r._tr_tally(t,t.strstart-t.match_start,t.match_length-S),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=S){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<=S&&(t.ins_h=(t.ins_h<=S&&t.match_length<=t.prev_length){for(s=t.strstart+t.lookahead-S,n=r._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-S),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=s&&(t.ins_h=(t.ins_h<t.pending_buf_size-5&&(i=t.pending_buf_size-5);;){if(t.lookahead<=1){if(R(t),0===t.lookahead&&e===h)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+i;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,C(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-_&&(C(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(C(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(C(t,!1),t.strm.avail_out),1)})),new O(4,4,8,4,N),new O(4,5,16,8,N),new O(4,6,32,32,N),new O(4,4,16,16,k),new O(8,16,32,32,k),new O(8,16,128,128,k),new O(8,32,128,256,k),new O(32,128,258,1024,k),new O(32,258,258,4096,k)],i.deflateInit=function(t,e){return V(t,e,p,15,8,0)},i.deflateInit2=V,i.deflateReset=F,i.deflateResetKeep=B,i.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?c:(t.state.gzhead=e,u):c},i.deflate=function(t,e){var i,s,o,l;if(!t||!t.state||5>8&255),A(s,s.gzhead.time>>16&255),A(s,s.gzhead.time>>24&255),A(s,9===s.level?2:2<=s.strategy||s.level<2?4:0),A(s,255&s.gzhead.os),s.gzhead.extra&&s.gzhead.extra.length&&(A(s,255&s.gzhead.extra.length),A(s,s.gzhead.extra.length>>8&255)),s.gzhead.hcrc&&(t.adler=a(t.adler,s.pending_buf,s.pending,0)),s.gzindex=0,s.status=69):(A(s,0),A(s,0),A(s,0),A(s,0),A(s,0),A(s,9===s.level?2:2<=s.strategy||s.level<2?4:0),A(s,3),s.status=E);else{var d=p+(s.w_bits-8<<4)<<8;d|=(2<=s.strategy||s.level<2?0:s.level<6?1:6===s.level?2:3)<<6,0!==s.strstart&&(d|=32),d+=31-d%31,s.status=E,I(s,d),0!==s.strstart&&(I(s,t.adler>>>16),I(s,65535&t.adler)),t.adler=1}if(69===s.status)if(s.gzhead.extra){for(o=s.pending;s.gzindex<(65535&s.gzhead.extra.length)&&(s.pending!==s.pending_buf_size||(s.gzhead.hcrc&&s.pending>o&&(t.adler=a(t.adler,s.pending_buf,s.pending-o,o)),T(t),o=s.pending,s.pending!==s.pending_buf_size));)A(s,255&s.gzhead.extra[s.gzindex]),s.gzindex++;s.gzhead.hcrc&&s.pending>o&&(t.adler=a(t.adler,s.pending_buf,s.pending-o,o)),s.gzindex===s.gzhead.extra.length&&(s.gzindex=0,s.status=73)}else s.status=73;if(73===s.status)if(s.gzhead.name){o=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>o&&(t.adler=a(t.adler,s.pending_buf,s.pending-o,o)),T(t),o=s.pending,s.pending===s.pending_buf_size)){l=1;break}l=s.gzindexo&&(t.adler=a(t.adler,s.pending_buf,s.pending-o,o)),0===l&&(s.gzindex=0,s.status=91)}else s.status=91;if(91===s.status)if(s.gzhead.comment){o=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>o&&(t.adler=a(t.adler,s.pending_buf,s.pending-o,o)),T(t),o=s.pending,s.pending===s.pending_buf_size)){l=1;break}l=s.gzindexo&&(t.adler=a(t.adler,s.pending_buf,s.pending-o,o)),0===l&&(s.status=103)}else s.status=103;if(103===s.status&&(s.gzhead.hcrc?(s.pending+2>s.pending_buf_size&&T(t),s.pending+2<=s.pending_buf_size&&(A(s,255&t.adler),A(s,t.adler>>8&255),t.adler=0,s.status=E)):s.status=E),0!==s.pending){if(T(t),0===t.avail_out)return s.last_flush=-1,u}else if(0===t.avail_in&&w(e)<=w(i)&&4!==e)return M(t,-5);if(666===s.status&&0!==t.avail_in)return M(t,-5);if(0!==t.avail_in||0!==s.lookahead||e!==h&&666!==s.status){var f=2===s.strategy?function(t,e){for(var i;;){if(0===t.lookahead&&(R(t),0===t.lookahead)){if(e===h)return 1;break}if(t.match_length=0,i=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,i&&(C(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(C(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(C(t,!1),0===t.strm.avail_out)?1:2}(s,e):3===s.strategy?function(t,e){for(var i,n,s,o,a=t.window;;){if(t.lookahead<=v){if(R(t),t.lookahead<=v&&e===h)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=S&&0t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=S?(i=r._tr_tally(t,1,t.match_length-S),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(i=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),i&&(C(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(C(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(C(t,!1),0===t.strm.avail_out)?1:2}(s,e):n[s.level].func(s,e);if(3!==f&&4!==f||(s.status=666),1===f||3===f)return 0===t.avail_out&&(s.last_flush=-1),u;if(2===f&&(1===e?r._tr_align(s):5!==e&&(r._tr_stored_block(s,0,0,!1),3===e&&(P(s.head),0===s.lookahead&&(s.strstart=0,s.block_start=0,s.insert=0))),T(t),0===t.avail_out))return s.last_flush=-1,u}return 4!==e?u:s.wrap<=0?1:(2===s.wrap?(A(s,255&t.adler),A(s,t.adler>>8&255),A(s,t.adler>>16&255),A(s,t.adler>>24&255),A(s,255&t.total_in),A(s,t.total_in>>8&255),A(s,t.total_in>>16&255),A(s,t.total_in>>24&255)):(I(s,t.adler>>>16),I(s,65535&t.adler)),T(t),0=i.w_size&&(0===a&&(P(i.head),i.strstart=0,i.block_start=0,i.insert=0),p=new s.Buf8(i.w_size),s.arraySet(p,e,f-i.w_size,i.w_size,0),e=p,f=i.w_size),l=t.avail_in,h=t.next_in,d=t.input,t.avail_in=f,t.next_in=0,t.input=e,R(i);i.lookahead>=S;){for(n=i.strstart,r=i.lookahead-(S-1);i.ins_h=(i.ins_h<>>=v=S>>>24,f-=v,0==(v=S>>>16&255))P[r++]=65535&S;else{if(!(16&v)){if(0==(64&v)){S=m[(65535&S)+(p&(1<>>=v,f-=v),f<15&&(p+=w[n++]<>>=v=S>>>24,f-=v,!(16&(v=S>>>16&255))){if(0==(64&v)){S=g[(65535&S)+(p&(1<>>=v,f-=v,(v=r-o)>3,p&=(1<<(f-=_<<3))-1,t.next_in=n,t.next_out=r,t.avail_in=n>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function f(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function m(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=u,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(c),e.distcode=e.distdyn=new n.Buf32(d),e.sane=1,e.back=-1,l):h}function g(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,m(t)):h}function b(t,e){var i,n;return t&&t.state?(n=t.state,e<0?(i=0,e=-e):(i=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15=o.wsize?(n.arraySet(o.window,e,i-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(s<(r=o.wsize-o.wnext)&&(r=s),n.arraySet(o.window,e,i-s,r,o.wnext),(s-=r)?(n.arraySet(o.window,e,i-s,s,0),o.wnext=s,o.whave=o.wsize):(o.wnext+=r,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,i.check=r(i.check,F,2,0),S=y=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&y)<<8)+(y>>8))%31){t.msg="incorrect header check",i.mode=30;break}if(8!=(15&y)){t.msg="unknown compression method",i.mode=30;break}if(S-=4,N=8+(15&(y>>>=4)),0===i.wbits)i.wbits=N;else if(N>i.wbits){t.msg="invalid window size",i.mode=30;break}i.dmax=1<>8&1),512&i.flags&&(F[0]=255&y,F[1]=y>>>8&255,i.check=r(i.check,F,2,0)),S=y=0,i.mode=3;case 3:for(;S<32;){if(0===g)break t;g--,y+=c[f++]<>>8&255,F[2]=y>>>16&255,F[3]=y>>>24&255,i.check=r(i.check,F,4,0)),S=y=0,i.mode=4;case 4:for(;S<16;){if(0===g)break t;g--,y+=c[f++]<>8),512&i.flags&&(F[0]=255&y,F[1]=y>>>8&255,i.check=r(i.check,F,2,0)),S=y=0,i.mode=5;case 5:if(1024&i.flags){for(;S<16;){if(0===g)break t;g--,y+=c[f++]<>>8&255,i.check=r(i.check,F,2,0)),S=y=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&(g<(M=i.length)&&(M=g),M&&(i.head&&(N=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),n.arraySet(i.head.extra,c,f,M,N)),512&i.flags&&(i.check=r(i.check,c,M,f)),g-=M,f+=M,i.length-=M),i.length))break t;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===g)break t;for(M=0;N=c[f+M++],i.head&&N&&i.length<65536&&(i.head.name+=String.fromCharCode(N)),N&&M>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=12;break;case 10:for(;S<32;){if(0===g)break t;g--,y+=c[f++]<>>=7&S,S-=7&S,i.mode=27;break}for(;S<3;){if(0===g)break t;g--,y+=c[f++]<>>=1)){case 0:i.mode=14;break;case 1:if(x(i),i.mode=20,6!==e)break;y>>>=2,S-=2;break t;case 2:i.mode=17;break;case 3:t.msg="invalid block type",i.mode=30}y>>>=2,S-=2;break;case 14:for(y>>>=7&S,S-=7&S;S<32;){if(0===g)break t;g--,y+=c[f++]<>>16^65535)){t.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&y,S=y=0,i.mode=15,6===e)break t;case 15:i.mode=16;case 16:if(M=i.length){if(g>>=5,S-=5,i.ndist=1+(31&y),y>>>=5,S-=5,i.ncode=4+(15&y),y>>>=4,S-=4,286>>=3,S-=3}for(;i.have<19;)i.lens[V[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,O={bits:i.lenbits},k=a(0,i.lens,0,19,i.lencode,0,i.work,O),i.lenbits=O.bits,k){t.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have>>16&255,A=65535&B,!((T=B>>>24)<=S);){if(0===g)break t;g--,y+=c[f++]<>>=T,S-=T,i.lens[i.have++]=A;else{if(16===A){for(D=T+2;S>>=T,S-=T,0===i.have){t.msg="invalid bit length repeat",i.mode=30;break}N=i.lens[i.have-1],M=3+(3&y),y>>>=2,S-=2}else if(17===A){for(D=T+3;S>>=T)),y>>>=3,S-=3}else{for(D=T+7;S>>=T)),y>>>=7,S-=7}if(i.have+M>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=30;break}for(;M--;)i.lens[i.have++]=N}}if(30===i.mode)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=30;break}if(i.lenbits=9,O={bits:i.lenbits},k=a(1,i.lens,0,i.nlen,i.lencode,0,i.work,O),i.lenbits=O.bits,k){t.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,O={bits:i.distbits},k=a(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,O),i.distbits=O.bits,k){t.msg="invalid distances set",i.mode=30;break}if(i.mode=20,6===e)break t;case 20:i.mode=21;case 21:if(6<=g&&258<=b){t.next_out=m,t.avail_out=b,t.next_in=f,t.avail_in=g,i.hold=y,i.bits=S,o(t,_),m=t.next_out,d=t.output,b=t.avail_out,f=t.next_in,c=t.input,g=t.avail_in,y=i.hold,S=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;C=(B=i.lencode[y&(1<>>16&255,A=65535&B,!((T=B>>>24)<=S);){if(0===g)break t;g--,y+=c[f++]<>I)])>>>16&255,A=65535&B,!(I+(T=B>>>24)<=S);){if(0===g)break t;g--,y+=c[f++]<>>=I,S-=I,i.back+=I}if(y>>>=T,S-=T,i.back+=T,i.length=A,0===C){i.mode=26;break}if(32&C){i.back=-1,i.mode=12;break}if(64&C){t.msg="invalid literal/length code",i.mode=30;break}i.extra=15&C,i.mode=22;case 22:if(i.extra){for(D=i.extra;S>>=i.extra,S-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;C=(B=i.distcode[y&(1<>>16&255,A=65535&B,!((T=B>>>24)<=S);){if(0===g)break t;g--,y+=c[f++]<>I)])>>>16&255,A=65535&B,!(I+(T=B>>>24)<=S);){if(0===g)break t;g--,y+=c[f++]<>>=I,S-=I,i.back+=I}if(y>>>=T,S-=T,i.back+=T,64&C){t.msg="invalid distance code",i.mode=30;break}i.offset=A,i.extra=15&C,i.mode=24;case 24:if(i.extra){for(D=i.extra;S>>=i.extra,S-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=30;break}i.mode=25;case 25:if(0===b)break t;if(M=_-b,i.offset>M){if((M=i.offset-M)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=30;break}w=M>i.wnext?(M-=i.wnext,i.wsize-M):i.wnext-M,M>i.length&&(M=i.length),P=i.window}else P=d,w=m-i.offset,M=i.length;for(by?(v=B[F+c[M]],N[k+c[M]]):(v=96,0),p=1<>A)+(f-=p)]=S<<24|v<<16|_|0,0!==f;);for(p=1<>=1;if(0!==p?(R&=p-1,R+=p):R=0,M++,0==--O[E]){if(E===P)break;E=e[i+c[M]]}if(T>>7)]}function P(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function T(t,e,i){t.bi_valid>h-i?(t.bi_buf|=e<>h-t.bi_valid,t.bi_valid+=i-h):(t.bi_buf|=e<>>=1,i<<=1,0<--e;);return i>>>1}function I(t,e,i){var n,s,r=new Array(l+1),o=0;for(n=1;n<=l;n++)r[n]=o=o+i[n-1]<<1;for(s=0;s<=e;s++){var a=t[2*s+1];0!==a&&(t[2*s]=A(r[a]++,a))}}function L(t){var e;for(e=0;e>1;1<=i;i--)k(t,r,i);for(s=h;i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],k(t,r,1),n=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=n,r[2*s]=r[2*i]+r[2*n],t.depth[s]=(t.depth[i]>=t.depth[n]?t.depth[i]:t.depth[n])+1,r[2*i+1]=r[2*n+1]=s,t.heap[1]=s++,k(t,r,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var i,n,s,r,o,a,h=e.dyn_tree,u=e.max_code,c=e.stat_desc.static_tree,d=e.stat_desc.has_stree,p=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,m=e.stat_desc.max_length,g=0;for(r=0;r<=l;r++)t.bl_count[r]=0;for(h[2*t.heap[t.heap_max]+1]=0,i=t.heap_max+1;i<573;i++)m<(r=h[2*h[2*(n=t.heap[i])+1]+1]+1)&&(r=m,g++),h[2*n+1]=r,u>=7;n>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e>>3,(o=t.static_len+3+7>>>3)<=s&&(s=o)):s=o=i+5,i+4<=s&&-1!==e?G(t,e,i,n):4===t.strategy||o===s?(T(t,2+(n?1:0),3),O(t,f,m)):(T(t,4+(n?1:0),3),function(t,e,i,n){var s;for(T(t,e-257,5),T(t,i-1,5),T(t,n-4,4),s=0;s>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(b[i]+r+1)]++,t.dyn_dtree[2*w(e)]++),t.last_lit===t.lit_bufsize-1},i._tr_align=function(t){T(t,2,3),C(t,256,f),function(t){16===t.bi_valid?(P(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},{"../utils/common":41}],53:[function(t,e,i){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,e,i){"use strict";e.exports="function"==typeof setImmediate?setImmediate:function(){var t=[].slice.apply(arguments);t.splice(1,0,0),setTimeout.apply(null,t)}},{}]},{},[10])(10)},2043:function(t,e,i){var n,s;!function(r,o){"use strict";n=function(){var t=function(){},e="undefined",i=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"];function s(t,e){var i=t[e];if("function"==typeof i.bind)return i.bind(t);try{return Function.prototype.bind.call(i,t)}catch(e){return function(){return Function.prototype.apply.apply(i,[t,arguments])}}}function r(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function o(e,i){for(var s=0;s=0&&i<=a.levels.SILENT))throw"log.setLevel() called with invalid level: "+i;if(r=i,!1!==s&&function(t){var i=(n[t]||"silent").toUpperCase();if(typeof window!==e&&h){try{return void(window.localStorage[h]=i)}catch(t){}try{window.document.cookie=encodeURIComponent(h)+"="+i+";"}catch(t){}}}(i),o.call(a,i,t),typeof console===e&&i{t.exports=function t(e,i,n){function s(o,a){if(!i[o]){if(!e[o]){if(r)return r(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var h=i[o]={exports:{}};e[o][0].call(h.exports,(function(t){return s(e[o][1][t]||t)}),h,h.exports,t,e,i,n)}return i[o].exports}for(var r=void 0,o=0;o{"use strict";function n(t,e){return Array(e+1).join(t)}function s(t){return"number"==typeof t}function r(t,e){return Math.pow(2,(t-69)/12)*(e||440)}i.r(e),i.d(e,{acc:()=>m,alt:()=>y,build:()=>c,chroma:()=>S,freq:()=>p,letter:()=>f,midi:()=>d,oct:()=>v,parse:()=>h,pc:()=>g,regex:()=>a,step:()=>b});var o=/^([a-gA-G])(#{1,}|b{1,}|x{1,}|)(-?\d*)\s*(.*)\s*$/;function a(){return o}var l=[0,2,4,5,7,9,11];function h(t,e,i){if("string"!=typeof t)return null;var n=o.exec(t);if(!n||!e&&n[4])return null;var s={letter:n[1].toUpperCase(),acc:n[2].replace(/x/g,"##")};s.pc=s.letter+s.acc,s.step=(s.letter.charCodeAt(0)+3)%7,s.alt="b"===s.acc[0]?-s.acc.length:s.acc.length;var a=l[s.step]+s.alt;return s.chroma=a<0?12+a:a%12,n[3]&&(s.oct=+n[3],s.midi=a+12*(s.oct+1),s.freq=r(s.midi,i)),e&&(s.tonicOf=n[4]),s}var u="CDEFGAB";function c(t,e,i){return null==t?null:t.step?c(t.step,t.alt,t.oct):t<0||t>6?null:u.charAt(t)+(s(r=e)?r<0?n("b",-r):n("#",r):"")+function(t){return s(t)?""+t:""}(i);var r}function d(t){if((s(t)||"string"==typeof t)&&t>=0&&t<128)return+t;var e=h(t);return e&&void 0!==e.midi?e.midi:null}function p(t,e){var i=d(t);return null===i?null:r(i,e)}function f(t){return(h(t)||{}).letter}function m(t){return(h(t)||{}).acc}function g(t){return(h(t)||{}).pc}function b(t){return(h(t)||{}).step}function y(t){return(h(t)||{}).alt}function S(t){return(h(t)||{}).chroma}function v(t){return(h(t)||{}).oct}},9316:t=>{t.exports=function(t){return t.on=function(e,i){if(1===arguments.length&&"function"==typeof e)return t.on("event",e);var n,s,r="on"+e,o=t[r];return t[r]=o?(n=o,s=i,function(t,e,i,r){n(t,e,i,r),s(t,e,i,r)}):i,t},t}},224:(t,e,i)=>{"use strict";var n=i(9451),s=i(9316),r=i(3861),o=i(6041),a=i(1549);function l(t,e,i){return a(o(r(s(n(t,e,i)))))}t.exports&&(t.exports=l),"undefined"!=typeof window&&(window.SamplePlayer=l)},1549:(t,e,i)=>{var n=i(2846);t.exports=function(t){return t.listenToMidi=function(e,i){var s={},r=i||{},o=r.gain||function(t){return t/127};return e.onmidimessage=function(e){var i=e.messageType?e:n(e);if("noteon"===i.messageType&&0===i.velocity&&(i.messageType="noteoff"),!r.channel||i.channel===r.channel)switch(i.messageType){case"noteon":s[i.key]=t.play(i.key,0,{gain:o(i.velocity)});break;case"noteoff":s[i.key]&&(s[i.key].stop(),delete s[i.key])}},t},t}},3861:(t,e,i)=>{"use strict";var n=i(9046),s=function(t){return function(t){return null!==t&&t!==[]&&t>=0&&t<129}(t)?+t:n.midi(t)};t.exports=function(t){if(t.buffers){var e=t.opts.map,i="function"==typeof e?e:s,n=function(t){return t?i(t)||t:null};t.buffers=function(t,e){return Object.keys(t).reduce((function(i,n){return i[e(n)]=t[n],i}),{})}(t.buffers,n);var r=t.start;t.start=function(t,e,i){var s=n(t),o=s%1;return o&&(s=Math.floor(s),i=Object.assign(i||{},{cents:Math.floor(100*o)})),r(s,e,i)}}return t}},9451:(t,e,i)=>{"use strict";var n=i(7729),s={},r={gain:1,attack:.01,decay:.1,sustain:.9,release:.3,loop:!1,cents:0,loopStart:0,loopEnd:0};function o(t){return"number"==typeof t}var a=["attack","decay","sustain","release"];t.exports=function(t,e,i){var l=!1,h=0,u={},c=t.createGain();c.gain.value=1;var d=Object.assign({},r,i),p={context:t,out:c,opts:d};return e instanceof AudioBuffer?p.buffer=e:p.buffers=e,p.start=function(e,i,n){if(p.buffer&&null!==e)return p.start(null,e,i);var r=e?p.buffers[e]:p.buffer;if(r){if(l){var o=n||s;i=Math.max(t.currentTime,i||0),p.emit("start",i,e,o);var a=f(e,r,o);return a.id=function(e,i){return i.id=h++,u[i.id]=i,i.source.onended=function(){var e=t.currentTime;i.source.disconnect(),i.env.disconnect(),i.disconnect(),p.emit("ended",e,i.id,i)},i.id}(0,a),a.env.start(i),a.source.start(i),p.emit("started",i,a.id,a),o.duration&&a.stop(i+o.duration),a}console.warn("SamplePlayer not connected to any node.")}else console.warn("Buffer "+e+" not found.")},p.play=function(t,e,i){return p.start(t,e,i)},p.stop=function(t,e){var i;return(e=e||Object.keys(u)).map((function(e){return(i=u[e])?(i.stop(t),i.id):null}))},p.connect=function(t){return l=!0,c.connect(t),p},p.emit=function(t,e,i,n){p.onevent&&p.onevent(t,e,i,n);var s=p["on"+t];s&&s(e,i,n)},p;function f(e,i,s){var r,l=t.createGain();return l.gain.value=0,l.connect(c),l.env=function(t,e,i){var s=n(t),r=e.adsr||i.adsr;return a.forEach((function(t,n){s[t]=r?r[n]:e[t]||i[t]})),s.value.value=o(e.gain)?e.gain:o(i.gain)?i.gain:1,s}(t,s,d),l.env.connect(l.gain),l.source=t.createBufferSource(),l.source.buffer=i,l.source.connect(l),l.source.loop=s.loop||d.loop,l.source.playbackRate.value=(r=s.cents||d.cents)?Math.pow(2,r/1200):1,l.source.loopStart=s.loopStart||d.loopStart,l.source.loopEnd=s.loopEnd||d.loopEnd,l.stop=function(i){var n=i||t.currentTime;p.emit("stop",n,e);var s=l.env.stop(n);l.source.stop(s)},l}}},6041:t=>{"use strict";var e=Array.isArray,i={};t.exports=function(t){return t.schedule=function(n,s){var r,o,a,l,h=t.context.currentTime,u=n{"use strict";var e=/^([a-gA-G])(#{1,}|b{1,}|x{1,}|)(-?\d*)\s*(.*)\s*$/,i=[0,2,4,5,7,9,11];function n(t,n,r){if("string"!=typeof t)return null;var o=e.exec(t);if(!o||!n&&o[4])return null;var a={letter:o[1].toUpperCase(),acc:o[2].replace(/x/g,"##")};return a.pc=a.letter+a.acc,a.step=(a.letter.charCodeAt(0)+3)%7,a.alt="b"===a.acc[0]?-a.acc.length:a.acc.length,a.chroma=i[a.step]+a.alt,o[3]&&(a.oct=+o[3],a.midi=a.chroma+12*(a.oct+1),a.freq=s(a.midi,r)),n&&(a.tonicOf=o[4]),a}function s(t,e){return Math.pow(2,(t-69)/12)*(e||440)}var r={parse:n,regex:function(){return e},midiToFreq:s};["letter","acc","pc","step","alt","chroma","oct","midi","freq"].forEach((function(t){r[t]=function(e){var i=n(e);return i&&void 0!==i[t]?i[t]:null}})),t.exports=r},8346:(t,e,i)=>{"use strict";var n=i(7665),s=i(224);function r(t){return/\.js(\?.*)?$/i.test(t)}function o(t,e,i){return"https://gleitz.github.io/midi-js-soundfonts/"+(e="FluidR3_GM"===e?e:"MusyngKite")+"/"+t+"-"+(i="ogg"===i?i:"mp3")+".js"}var a=i(975);a.instrument=function t(e,i,a){if(1===arguments.length)return function(i,n){return t(e,i,n)};var l=a||{},h=l.isSoundfontURL||r,u=l.nameToUrl||o,c=h(i)?i:u(i,l.soundfont,l.format);return n(e,c,{only:l.only||l.notes}).then((function(t){var n=s(e,t,l).connect(l.destination?l.destination:e.destination);return n.url=c,n.name=i,n}))},a.nameToUrl=o,t.exports&&(t.exports=a),"undefined"!=typeof window&&(window.Soundfont=a)},975:(t,e,i)=>{"use strict";var n=i(8681);function s(t,e){if(console.warn("new Soundfont() is deprected"),console.log("Please use Soundfont.instrument() instead of new Soundfont().instrument()"),!(this instanceof s))return new s(t);this.nameToUrl=e||s.nameToUrl,this.ctx=t,this.instruments={},this.promises=[]}function r(t,e){return e=e||{},function(i,s,r,o){console.warn("The oscillator player is deprecated."),console.log("Starting with version 0.9.0 you will have to wait until the soundfont is loaded to play sounds.");var a=i>0&&i<129?+i:n.midi(i),l=a?n.midiToFreq(a,440):null;if(l){r=r||.2;var h=(o=o||{}).destination||e.destination||t.destination,u=o.vcoType||e.vcoType||"sine",c=o.gain||e.gain||.4,d=t.createOscillator();d.type=u,d.frequency.value=l;var p=t.createGain();return p.gain.value=c,d.connect(p),p.connect(h),d.start(s),r>0&&d.stop(s+r),d}}}s.prototype.onready=function(t){console.warn("deprecated API"),console.log("Please use Promise.all(Soundfont.instrument(), Soundfont.instrument()).then() instead of new Soundfont().onready()"),Promise.all(this.promises).then(t)},s.prototype.instrument=function(t,e){console.warn("new Soundfont().instrument() is deprecated."),console.log("Please use Soundfont.instrument() instead.");var i=this.ctx;if((t=t||"default")in this.instruments)return this.instruments[t];var n={name:t,play:r(i,e)};if(this.instruments[t]=n,"default"!==t){var o=s.instrument(i,t,e).then((function(t){return n.play=t.play,n}));this.promises.push(o),n.onready=function(t){console.warn("onready is deprecated. Use Soundfont.instrument().then()"),o.then(t)}}else n.onready=function(t){console.warn("onready is deprecated. Use Soundfont.instrument().then()"),t()};return n},s.loadBuffers=function(t,e,i){return console.warn("Soundfont.loadBuffers is deprecate."),console.log("Use Soundfont.instrument(..) and get buffers properties from the result."),s.instrument(t,e,i).then((function(t){return t.buffers}))},s.noteToMidi=n.midi,t.exports=s},807:(t,e,i)=>{"use strict";i.r(e),i.d(e,{AnalyserNode:()=>Fe,AudioBuffer:()=>je,AudioBufferSourceNode:()=>ti,AudioContext:()=>dn,AudioWorkletNode:()=>wn,BiquadFilterNode:()=>si,ChannelMergerNode:()=>hi,ChannelSplitterNode:()=>ci,ConstantSourceNode:()=>mi,ConvolverNode:()=>yi,DelayNode:()=>vi,DynamicsCompressorNode:()=>Ei,GainNode:()=>wi,IIRFilterNode:()=>Ii,MediaElementAudioSourceNode:()=>an,MediaStreamAudioDestinationNode:()=>ln,MediaStreamAudioSourceNode:()=>hn,MediaStreamTrackAudioSourceNode:()=>cn,MinimalAudioContext:()=>Pn,MinimalOfflineAudioContext:()=>An,OfflineAudioContext:()=>In,OscillatorNode:()=>Di,PannerNode:()=>Hi,PeriodicWave:()=>ji,StereoPannerNode:()=>qi,WaveShaperNode:()=>$i,addAudioWorkletModule:()=>nn,decodeAudioData:()=>rn,isAnyAudioContext:()=>Ln,isAnyAudioNode:()=>Rn,isAnyAudioParam:()=>Nn,isAnyOfflineAudioContext:()=>kn,isSupported:()=>On});var n=i(5382);const s=new WeakSet,r=new WeakMap,o=new WeakMap,a=new WeakMap,l=new WeakMap,h=new WeakMap,u=new WeakMap,c=new WeakMap,d=new WeakMap,p=new WeakMap,f={construct:()=>f},m=/^import(?:(?:[\s]+[\w]+|(?:[\s]+[\w]+[\s]*,)?[\s]*\{[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?(?:[\s]*,[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?)*[\s]*}|(?:[\s]+[\w]+[\s]*,)?[\s]*\*[\s]+as[\s]+[\w]+)[\s]+from)?(?:[\s]*)("([^"\\]|\\.)+"|'([^'\\]|\\.)+')(?:[\s]*);?/,g=(t,e)=>{const i=[];let n=t.replace(/^[\s]+/,""),s=n.match(m);for(;null!==s;){const t=s[1].slice(1,-1),r=s[0].replace(/([\s]+)?;?$/,"").replace(t,new URL(t,e).toString());i.push(r),n=n.slice(s[0].length).replace(/^[\s]+/,""),s=n.match(m)}return[i.join(";"),n]},b=t=>{if(void 0!==t&&!Array.isArray(t))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},y=t=>{if(!(t=>{try{new new Proxy(t,f)}catch{return!1}return!0})(t))throw new TypeError("The given value for processorCtor should be a constructor.");if(null===t.prototype||"object"!=typeof t.prototype)throw new TypeError("The given value for processorCtor should have a prototype.")},S=(t,e)=>{const i=t.get(e);if(void 0===i)throw new Error("A value with the given key could not be found.");return i},v=(t,e)=>{const i=Array.from(t).filter(e);if(i.length>1)throw Error("More than one element was found.");if(0===i.length)throw Error("No element was found.");const[n]=i;return t.delete(n),n},_=(t,e,i,n)=>{const s=S(t,e),r=v(s,(t=>t[0]===i&&t[1]===n));return 0===s.size&&t.delete(e),r},x=t=>S(u,t),E=t=>{if(s.has(t))throw new Error("The AudioNode is already stored.");s.add(t),x(t).forEach((t=>t(!0)))},M=t=>"port"in t,w=t=>{if(!s.has(t))throw new Error("The AudioNode is not stored.");s.delete(t),x(t).forEach((t=>t(!1)))},P=(t,e)=>{!M(t)&&e.every((t=>0===t.size))&&w(t)},T={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},C=(t,e)=>t.context===e,A=t=>{try{t.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},I=()=>new DOMException("","IndexSizeError"),L=t=>{var e;t.getChannelData=(e=t.getChannelData,i=>{try{return e.call(t,i)}catch(t){if(12===t.code)throw I();throw t}})},R={numberOfChannels:1},N=-34028234663852886e22,k=-N,O=t=>s.has(t),D={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},B=t=>S(r,t),F=t=>S(a,t),V=(t,e)=>{const{activeInputs:i}=B(t);i.forEach((i=>i.forEach((([i])=>{e.includes(t)||V(i,[...e,t])}))));const n=(t=>"playbackRate"in t)(t)?[t.playbackRate]:M(t)?Array.from(t.parameters.values()):(t=>"frequency"in t&&"gain"in t)(t)?[t.Q,t.detune,t.frequency,t.gain]:(t=>"offset"in t)(t)?[t.offset]:(t=>!("frequency"in t)&&"gain"in t)(t)?[t.gain]:(t=>"detune"in t&&"frequency"in t)(t)?[t.detune,t.frequency]:(t=>"pan"in t)(t)?[t.pan]:[];for(const t of n){const i=F(t);void 0!==i&&i.activeInputs.forEach((([t])=>V(t,e)))}O(t)&&w(t)},G=t=>{V(t.destination,[])},W=t=>void 0===t||"number"==typeof t||"string"==typeof t&&("balanced"===t||"interactive"===t||"playback"===t),U=t=>"context"in t,H=t=>U(t[0]),z=(t,e,i,n)=>{for(const e of t)if(i(e)){if(n)return!1;throw Error("The set contains at least one similar element.")}return t.add(e),!0},j=(t,e,[i,n],s)=>{z(t,[e,i,n],(t=>t[0]===e&&t[1]===i),s)},X=(t,[e,i,n],s)=>{const r=t.get(e);void 0===r?t.set(e,new Set([[i,n]])):z(r,[i,n],(t=>t[0]===i),s)},Y=t=>"inputs"in t,K=(t,e,i,n)=>{if(Y(e)){const s=e.inputs[n];return t.connect(s,i,0),[s,i,0]}return t.connect(e,i,n),[e,i,n]},q=(t,e,i)=>{for(const n of t)if(n[0]===e&&n[1]===i)return t.delete(n),n;return null},Z=(t,e)=>{if(!x(t).delete(e))throw new Error("Missing the expected event listener.")},$=(t,e,i)=>{const n=S(t,e),s=v(n,(t=>t[0]===i));return 0===n.size&&t.delete(e),s},J=(t,e,i,n)=>{Y(e)?t.disconnect(e.inputs[n],i,0):t.disconnect(e,i,n)},Q=t=>S(o,t),tt=t=>S(l,t),et=t=>c.has(t),it=t=>!s.has(t),nt=(t,e)=>new Promise((i=>{if(null!==e)i(!0);else{const e=t.createScriptProcessor(256,1,1),n=t.createGain(),s=t.createBuffer(1,2,44100),r=s.getChannelData(0);r[0]=1,r[1]=1;const o=t.createBufferSource();o.buffer=s,o.loop=!0,o.connect(e).connect(t.destination),o.connect(n),o.disconnect(n),e.onaudioprocess=n=>{const s=n.inputBuffer.getChannelData(0);Array.prototype.some.call(s,(t=>1===t))?i(!0):i(!1),o.stop(),e.onaudioprocess=null,o.disconnect(e),e.disconnect(t.destination)},o.start()}})),st=(t,e)=>{const i=new Map;for(const e of t)for(const t of e){const e=i.get(t);i.set(t,void 0===e?1:e+1)}i.forEach(((t,i)=>e(i,t)))},rt=t=>"context"in t,ot=t=>{const e=new Map;var i,n;t.connect=(i=t.connect.bind(t),(t,n=0,s=0)=>{const r=rt(t)?i(t,n,s):i(t,n),o=e.get(t);return void 0===o?e.set(t,[{input:s,output:n}]):o.every((t=>t.input!==s||t.output!==n))&&o.push({input:s,output:n}),r}),t.disconnect=(n=t.disconnect,(i,s,r)=>{if(n.apply(t),void 0===i)e.clear();else if("number"==typeof i)for(const[t,n]of e){const s=n.filter((t=>t.output!==i));0===s.length?e.delete(t):e.set(t,s)}else if(e.has(i))if(void 0===s)e.delete(i);else{const t=e.get(i);if(void 0!==t){const n=t.filter((t=>t.output!==s&&(t.input!==r||void 0===r)));0===n.length?e.delete(i):e.set(i,n)}}for(const[i,n]of e)n.forEach((e=>{rt(i)?t.connect(i,e.output,e.input):t.connect(i,e.output)}))})},at=(t,e,i,n,s)=>{const[r,o]=((t,e,i,n)=>{const{activeInputs:s,passiveInputs:r}=B(e),o=q(s[n],t,i);return null===o?[_(r,t,i,n)[2],!1]:[o[2],!0]})(t,i,n,s);if(null!==r&&(Z(t,r),!o||e||et(t)||J(Q(t),Q(i),n,s)),O(i)){const{activeInputs:t}=B(i);P(i,t)}},lt=(t,e,i,n)=>{const[s,r]=((t,e,i)=>{const{activeInputs:n,passiveInputs:s}=F(e),r=q(n,t,i);return null===r?[$(s,t,i)[1],!1]:[r[2],!0]})(t,i,n);null!==s&&(Z(t,s),!r||e||et(t)||Q(t).disconnect(tt(i),n))};class ht{constructor(t){this._map=new Map(t)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(t,e=null){return this._map.forEach(((i,n)=>t.call(e,i,n,this)))}get(t){return this._map.get(t)}has(t){return this._map.has(t)}keys(){return this._map.keys()}values(){return this._map.values()}}const ut={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}};function ct(t,e,i,n,s){if("function"==typeof t.copyFromChannel)0===e[i].byteLength&&(e[i]=new Float32Array(128)),t.copyFromChannel(e[i],n,s);else{const r=t.getChannelData(n);if(0===e[i].byteLength)e[i]=r.slice(s,s+128);else{const t=new Float32Array(r.buffer,s*Float32Array.BYTES_PER_ELEMENT,128);e[i].set(t)}}}const dt=(t,e,i,n,s)=>{"function"==typeof t.copyToChannel?0!==e[i].byteLength&&t.copyToChannel(e[i],n,s):0!==e[i].byteLength&&t.getChannelData(n).set(e[i],s)},pt=(t,e)=>{const i=[];for(let n=0;n{const a=null===e?128*Math.ceil(t.context.length/128):e.length,l=n.channelCount*n.numberOfInputs,h=s.reduce(((t,e)=>t+e),0),u=0===h?null:i.createBuffer(h,a,i.sampleRate);if(void 0===r)throw new Error("Missing the processor constructor.");const c=B(t),d=await((t,e)=>{const i=S(p,t),n=Q(e);return S(i,n)})(i,t),f=pt(n.numberOfInputs,n.channelCount),m=pt(n.numberOfOutputs,s),g=Array.from(t.parameters.keys()).reduce(((t,e)=>({...t,[e]:new Float32Array(128)})),{});for(let h=0;h0&&null!==e)for(let t=0;t{ct(e,g,t,l+i,h)}));for(let t=0;t0===c.activeInputs[e].size?[]:t)),e=o(h/i.sampleRate,i.sampleRate,(()=>d.process(t,m,g)));if(null!==u)for(let t=0,e=0;t{const{port1:e,port2:i}=new MessageChannel;return new Promise((n=>{const s=()=>{i.onmessage=null,e.close(),i.close(),n()};i.onmessage=()=>s();try{e.postMessage(t,[t])}catch{}finally{s()}}))},_t={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},xt=(t,e,i)=>{const n=e[i];if(void 0===n)throw t();return n},Et={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},Mt={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},wt=()=>new DOMException("","InvalidStateError"),Pt=()=>new DOMException("","InvalidAccessError"),Tt={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},Ct=(t,e,i,n,s,r,o,a,l,h,u)=>{const c=h.length;let d=a;for(let a=0;a{const e=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{const i=t.decodeAudioData(e.buffer,(()=>{}));return void 0!==i&&(i.catch((()=>{})),!0)}catch{}return!1},Lt={numberOfChannels:1},Rt=(t,e,i)=>{const n=e[i];void 0!==n&&n!==t[i]&&(t[i]=n)},Nt=(t,e)=>{Rt(t,e,"channelCount"),Rt(t,e,"channelCountMode"),Rt(t,e,"channelInterpretation")},kt=t=>"function"==typeof t.getFloatTimeDomainData,Ot=(t,e,i)=>{const n=e[i];void 0!==n&&n!==t[i].value&&(t[i].value=n)},Dt=t=>{var e;t.start=(e=t.start,(i=0,n=0,s)=>{if("number"==typeof s&&s<0||n<0||i<0)throw new RangeError("The parameters can't be negative.");e.call(t,i,n,s)})},Bt=t=>{var e;t.stop=(e=t.stop,(i=0)=>{if(i<0)throw new RangeError("The parameter can't be negative.");e.call(t,i)})},Ft=(t,e)=>null===t?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(t*e))))),Vt=(t,e)=>{const i=t.createBiquadFilter();return Nt(i,e),Ot(i,e,"Q"),Ot(i,e,"detune"),Ot(i,e,"frequency"),Ot(i,e,"gain"),Rt(i,e,"type"),i},Gt=(t,e)=>{const i=t.createChannelSplitter(e.numberOfOutputs);return Nt(i,e),(t=>{const e=t.numberOfOutputs;Object.defineProperty(t,"channelCount",{get:()=>e,set:t=>{if(t!==e)throw wt()}}),Object.defineProperty(t,"channelCountMode",{get:()=>"explicit",set:t=>{if("explicit"!==t)throw wt()}}),Object.defineProperty(t,"channelInterpretation",{get:()=>"discrete",set:t=>{if("discrete"!==t)throw wt()}})})(i),i},Wt=(t,e)=>(t.connect=e.connect.bind(e),t.disconnect=e.disconnect.bind(e),t),Ut=(t,e)=>{const i=t.createDelay(e.maxDelayTime);return Nt(i,e),Ot(i,e,"delayTime"),i},Ht=(t,e)=>{const i=t.createGain();return Nt(i,e),Ot(i,e,"gain"),i};function zt(t,e){const i=e[0]*e[0]+e[1]*e[1];return[(t[0]*e[0]+t[1]*e[1])/i,(t[1]*e[0]-t[0]*e[1])/i]}function jt(t,e){let i=[0,0];for(let r=t.length-1;r>=0;r-=1)s=e,i=[(n=i)[0]*s[0]-n[1]*s[1],n[0]*s[1]+n[1]*s[0]],i[0]+=t[r];var n,s;return i}const Xt=(t,e,i,n)=>t.createScriptProcessor(e,i,n),Yt=()=>new DOMException("","NotSupportedError"),Kt={numberOfChannels:1},qt={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},Zt={channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:1,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1},$t={disableNormalization:!1},Jt={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},Qt=()=>new DOMException("","UnknownError"),te={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},ee=(t,e,i)=>void 0===t.copyFromChannel?t.getChannelData(i)[0]:(t.copyFromChannel(e,i),e[0]),ie=t=>{if(null===t)return!1;const e=t.length;return e%2!=0?0!==t[Math.floor(e/2)]:t[e/2-1]+t[e/2]!==0},ne=(t,e,i,n)=>{let s=t;for(;!s.hasOwnProperty(e);)s=Object.getPrototypeOf(s);const{get:r,set:o}=Object.getOwnPropertyDescriptor(s,e);Object.defineProperty(t,e,{get:i(r),set:n(o)})},se=(t,e,i)=>{try{t.setValueAtTime(e,i)}catch(n){if(9!==n.code)throw n;se(t,e,i+1e-7)}},re=t=>{const e=t.createOscillator();try{e.start(-1)}catch(t){return t instanceof RangeError}return!1},oe=t=>{const e=t.createBuffer(1,1,44100),i=t.createBufferSource();i.buffer=e,i.start(),i.stop();try{return i.stop(),!0}catch{return!1}},ae=t=>{const e=t.createOscillator();try{e.stop(-1)}catch(t){return t instanceof RangeError}return!1},le=()=>{try{new DOMException}catch{return!1}return!0},he=()=>new Promise((t=>{const e=new ArrayBuffer(0),{port1:i,port2:n}=new MessageChannel;i.onmessage=({data:e})=>t(null!==e),n.postMessage(e,[e])})),ue=(t,e)=>{const i=e.createGain();t.connect(i);const n=(s=t.disconnect,()=>{s.call(t,i),t.removeEventListener("ended",n)});var s;t.addEventListener("ended",n),Wt(t,i),t.stop=(e=>{let n=!1;return(s=0)=>{if(n)try{e.call(t,s)}catch{i.gain.setValueAtTime(0,s)}else e.call(t,s),n=!0}})(t.stop)},ce=(t,e)=>i=>{const n={value:t};return Object.defineProperties(i,{currentTarget:n,target:n}),"function"==typeof e?e.call(t,i):e.handleEvent.call(t,i)},de=(t=>(e,i,[n,s,r],o)=>{t(e[s],[i,n,r],(t=>t[0]===i&&t[1]===n),o)})(z),pe=(t=>(e,i,[n,s,r],o)=>{const a=e.get(n);void 0===a?e.set(n,new Set([[s,i,r]])):t(a,[s,i,r],(t=>t[0]===s&&t[1]===i),o)})(z),fe=(t=>(e,i,n,s)=>t(e[s],(t=>t[0]===i&&t[1]===n)))(v),me=new WeakMap,ge=(t=>e=>{var i;return null!==(i=t.get(e))&&void 0!==i?i:0})(me),be=(ye=new Map,Se=new WeakMap,(t,e)=>{const i=Se.get(t);if(void 0!==i)return i;const n=ye.get(t);if(void 0!==n)return n;try{const i=e();return i instanceof Promise?(ye.set(t,i),i.catch((()=>!1)).then((e=>(ye.delete(t),Se.set(t,e),e)))):(Se.set(t,i),i)}catch{return Se.set(t,!1),!1}});var ye,Se;const ve="undefined"==typeof window?null:window,_e=((t,e)=>(i,n)=>{const s=i.createAnalyser();if(Nt(s,n),!(n.maxDecibels>n.minDecibels))throw e();return Rt(s,n,"fftSize"),Rt(s,n,"maxDecibels"),Rt(s,n,"minDecibels"),Rt(s,n,"smoothingTimeConstant"),t(kt,(()=>kt(s)))||(t=>{t.getFloatTimeDomainData=e=>{const i=new Uint8Array(e.length);t.getByteTimeDomainData(i);const n=Math.max(i.length,t.fftSize);for(let t=0;te=>{const i=t(e);if(null===i.renderer)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return i.renderer})(B),Ee=((t,e,i)=>async(n,s,r)=>{const o=t(n);await Promise.all(o.activeInputs.map(((t,o)=>Array.from(t).map((async([t,a])=>{const l=e(t),h=await l.render(t,s),u=n.context.destination;i(t)||n===u&&i(n)||h.connect(r,a,o)})))).reduce(((t,e)=>[...t,...e]),[]))})(B,xe,et),Me=((t,e,i)=>()=>{const n=new WeakMap;return{render(s,r){const o=n.get(r);return void 0!==o?Promise.resolve(o):(async(s,r)=>{let o=e(s);if(!C(o,r)){const e={channelCount:o.channelCount,channelCountMode:o.channelCountMode,channelInterpretation:o.channelInterpretation,fftSize:o.fftSize,maxDecibels:o.maxDecibels,minDecibels:o.minDecibels,smoothingTimeConstant:o.smoothingTimeConstant};o=t(r,e)}return n.set(r,o),await i(s,r,o),o})(s,r)}}})(_e,Q,Ee),we=(Pe=h,t=>{const e=Pe.get(t);if(void 0===e)throw wt();return e});var Pe;const Te=(t=>null===t?null:t.hasOwnProperty("OfflineAudioContext")?t.OfflineAudioContext:t.hasOwnProperty("webkitOfflineAudioContext")?t.webkitOfflineAudioContext:null)(ve),Ce=(t=>e=>null!==t&&e instanceof t)(Te),Ae=new WeakMap,Ie=(t=>class{constructor(t){this._nativeEventTarget=t,this._listeners=new WeakMap}addEventListener(e,i,n){if(null!==i){let s=this._listeners.get(i);void 0===s&&(s=t(this,i),"function"==typeof i&&this._listeners.set(i,s)),this._nativeEventTarget.addEventListener(e,s,n)}}dispatchEvent(t){return this._nativeEventTarget.dispatchEvent(t)}removeEventListener(t,e,i){const n=null===e?void 0:this._listeners.get(e);this._nativeEventTarget.removeEventListener(t,void 0===n?null:n,i)}})(ce),Le=(t=>null===t?null:t.hasOwnProperty("AudioContext")?t.AudioContext:t.hasOwnProperty("webkitAudioContext")?t.webkitAudioContext:null)(ve),Re=(t=>e=>null!==t&&e instanceof t)(Le),Ne=(t=>e=>null!==t&&"function"==typeof t.AudioNode&&e instanceof t.AudioNode)(ve),ke=(t=>e=>null!==t&&"function"==typeof t.AudioParam&&e instanceof t.AudioParam)(ve),Oe=(t=>null===t?null:t.hasOwnProperty("AudioWorkletNode")?t.AudioWorkletNode:null)(ve),De=((t,e,i,n,s,r,a,l,h,c,d,p,f,m,g,b)=>class extends c{constructor(e,n,s,r){super(s),this._context=e,this._nativeAudioNode=s;const a=d(e);p(a)&&!0!==i(nt,(()=>nt(a,b)))&&ot(s),o.set(this,s),u.set(this,new Set),"closed"!==e.state&&n&&E(this),t(this,r,s)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(t){this._nativeAudioNode.channelCount=t}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(t){this._nativeAudioNode.channelCountMode=t}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(t){this._nativeAudioNode.channelInterpretation=t}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(t,i=0,o=0){if(i<0||i>=this._nativeAudioNode.numberOfOutputs)throw s();const l=d(this._context),u=g(l);if(f(t)||m(t))throw r();if(U(t)){const s=Q(t);try{const e=K(this._nativeAudioNode,s,i,o),n=it(this);(u||n)&&this._nativeAudioNode.disconnect(...e),"closed"!==this.context.state&&!n&&it(t)&&E(t)}catch(t){if(12===t.code)throw r();throw t}if(e(this,t,i,o,u)){const e=h([this],t);st(e,n(u))}return t}const c=tt(t);if("playbackRate"===c.name&&1024===c.maxValue)throw a();try{this._nativeAudioNode.connect(c,i),(u||it(this))&&this._nativeAudioNode.disconnect(c,i)}catch(t){if(12===t.code)throw r();throw t}if(((t,e,i,n)=>{const{activeInputs:s,passiveInputs:r}=F(e),{outputs:o}=B(t),a=x(t),l=o=>{const a=Q(t),l=tt(e);if(o){const e=$(r,t,i);j(s,t,e,!1),n||et(t)||a.connect(l,i)}else{const e=((t,e,i)=>v(t,(t=>t[0]===e&&t[1]===i)))(s,t,i);X(r,e,!1),n||et(t)||a.disconnect(l,i)}};return!!z(o,[e,i],(t=>t[0]===e&&t[1]===i),!0)&&(a.add(l),O(t)?j(s,t,[i,l],!0):X(r,[t,i,l],!0),!0)})(this,t,i,u)){const e=h([this],t);st(e,n(u))}}disconnect(t,e,i){let n;const o=d(this._context),a=g(o);if(void 0===t)n=((t,e)=>{const i=B(t),n=[];for(const s of i.outputs)H(s)?at(t,e,...s):lt(t,e,...s),n.push(s[0]);return i.outputs.clear(),n})(this,a);else if("number"==typeof t){if(t<0||t>=this.numberOfOutputs)throw s();n=((t,e,i)=>{const n=B(t),s=[];for(const r of n.outputs)r[1]===i&&(H(r)?at(t,e,...r):lt(t,e,...r),s.push(r[0]),n.outputs.delete(r));return s})(this,a,t)}else{if(void 0!==e&&(e<0||e>=this.numberOfOutputs))throw s();if(U(t)&&void 0!==i&&(i<0||i>=t.numberOfInputs))throw s();if(n=((t,e,i,n,s)=>{const r=B(t);return Array.from(r.outputs).filter((t=>!(t[0]!==i||void 0!==n&&t[1]!==n||void 0!==s&&t[2]!==s))).map((i=>(H(i)?at(t,e,...i):lt(t,e,...i),r.outputs.delete(i),i[0])))})(this,a,t,e,i),0===n.length)throw r()}for(const t of n){const e=h([this],t);st(e,l)}}})((Be=r,(t,e,i)=>{const n=[];for(let t=0;t{const p=new WeakMap;return(f,m,g,b,y)=>{const{activeInputs:S,passiveInputs:v}=r(m),{outputs:x}=r(f),M=a(f),w=r=>{const a=l(m),h=l(f);if(r){const e=_(v,f,g,b);t(S,f,e,!1),y||c(f)||i(h,a,g,b),d(m)&&E(m)}else{const t=n(S,f,g,b);e(v,b,t,!1),y||c(f)||s(h,a,g,b);const i=o(m);if(0===i)u(m)&&P(m,S);else{const t=p.get(m);void 0!==t&&clearTimeout(t),p.set(m,setTimeout((()=>{u(m)&&P(m,S)}),1e3*i))}}};return!!h(x,[m,g,b],(t=>t[0]===m&&t[1]===g&&t[2]===b),!0)&&(M.add(w),u(f)?t(S,f,[g,b,w],!0):e(v,b,[f,g,w],!0),!0)}})(de,pe,K,fe,J,B,ge,x,Q,z,O,et,it),be,((t,e,i,n,s,r)=>o=>(a,l)=>{const h=t.get(a);if(void 0===h){if(!o&&r(a)){const t=n(a),{outputs:r}=i(a);for(const i of r)if(H(i)){const s=n(i[0]);e(t,s,i[1],i[2])}else{const e=s(i[0]);t.disconnect(e,i[1])}}t.set(a,l)}else t.set(a,h+l)})(c,J,B,Q,tt,O),I,Pt,Yt,((t,e,i,n,s,r,o,a)=>(l,h)=>{const u=e.get(l);if(void 0===u)throw new Error("Missing the expected cycle count.");const c=r(l.context),d=a(c);if(u===h){if(e.delete(l),!d&&o(l)){const e=n(l),{outputs:r}=i(l);for(const i of r)if(H(i)){const s=n(i[0]);t(e,s,i[1],i[2])}else{const t=s(i[0]);e.connect(t,i[1])}}}else e.set(l,u-h)})(K,c,B,Q,tt,we,O,Ce),((t,e,i)=>function n(s,r){const o=U(r)?r:i(t,r);if((t=>"delayTime"in t)(o))return[];if(s[0]===o)return[s];if(s.includes(o))return[];const{outputs:a}=e(o);return Array.from(a).map((t=>n([...s,o],t[0]))).reduce(((t,e)=>t.concat(e)),[])})(Ae,B,S),Ie,we,Re,Ne,ke,Ce,Oe);var Be;const Fe=((t,e,i,n,s,r)=>class extends t{constructor(t,i){const o=s(t),a={...T,...i},l=n(o,a);super(t,!1,l,r(o)?e():null),this._nativeAnalyserNode=l}get fftSize(){return this._nativeAnalyserNode.fftSize}set fftSize(t){this._nativeAnalyserNode.fftSize=t}get frequencyBinCount(){return this._nativeAnalyserNode.frequencyBinCount}get maxDecibels(){return this._nativeAnalyserNode.maxDecibels}set maxDecibels(t){const e=this._nativeAnalyserNode.maxDecibels;if(this._nativeAnalyserNode.maxDecibels=t,!(t>this._nativeAnalyserNode.minDecibels))throw this._nativeAnalyserNode.maxDecibels=e,i()}get minDecibels(){return this._nativeAnalyserNode.minDecibels}set minDecibels(t){const e=this._nativeAnalyserNode.minDecibels;if(this._nativeAnalyserNode.minDecibels=t,!(this._nativeAnalyserNode.maxDecibels>t))throw this._nativeAnalyserNode.minDecibels=e,i()}get smoothingTimeConstant(){return this._nativeAnalyserNode.smoothingTimeConstant}set smoothingTimeConstant(t){this._nativeAnalyserNode.smoothingTimeConstant=t}getByteFrequencyData(t){this._nativeAnalyserNode.getByteFrequencyData(t)}getByteTimeDomainData(t){this._nativeAnalyserNode.getByteTimeDomainData(t)}getFloatFrequencyData(t){this._nativeAnalyserNode.getFloatFrequencyData(t)}getFloatTimeDomainData(t){this._nativeAnalyserNode.getFloatTimeDomainData(t)}})(De,Me,I,_e,we,Ce),Ve=new WeakSet,Ge=(t=>null===t?null:t.hasOwnProperty("AudioBuffer")?t.AudioBuffer:null)(ve),We=(Ue=new Uint32Array(1),t=>(Ue[0]=t,Ue[0]));var Ue;const He=((t,e)=>i=>{i.copyFromChannel=(n,s,r=0)=>{const o=t(r),a=t(s);if(a>=i.numberOfChannels)throw e();const l=i.length,h=i.getChannelData(a),u=n.length;for(let t=o<0?-o:0;t+o{const o=t(r),a=t(s);if(a>=i.numberOfChannels)throw e();const l=i.length,h=i.getChannelData(a),u=n.length;for(let t=o<0?-o:0;t+oe=>{e.copyFromChannel=(i=>(n,s,r=0)=>{const o=t(r),a=t(s);if(o(n,s,r=0)=>{const o=t(r),a=t(s);if(o{let l=null;return class h{constructor(h){if(null===s)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:u,numberOfChannels:c,sampleRate:d}={...R,...h};null===l&&(l=new s(1,1,44100));const p=null!==n&&e(r,r)?new n({length:u,numberOfChannels:c,sampleRate:d}):l.createBuffer(c,u,d);if(0===p.numberOfChannels)throw i();return"function"!=typeof p.copyFromChannel?(o(p),L(p)):e(A,(()=>A(p)))||a(p),t.add(p),p}static[Symbol.hasInstance](e){return null!==e&&"object"==typeof e&&Object.getPrototypeOf(e)===h.prototype||t.has(e)}}})(Ve,be,Yt,Ge,Te,(t=>()=>{if(null===t)return!1;try{new t({length:1,sampleRate:44100})}catch{return!1}return!0})(Ge),He,ze),Xe=(t=>(e,i)=>{const n=t(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});i.connect(n).connect(e.destination);const s=()=>{i.removeEventListener("ended",s),i.disconnect(n),n.disconnect()};i.addEventListener("ended",s)})(Ht),Ye=((t,e,i)=>async(n,s,r)=>{const o=e(n);await Promise.all(Array.from(o.activeInputs).map((async([e,n])=>{const o=t(e),a=await o.render(e,s);i(e)||a.connect(r,n)})))})(xe,F,et),Ke=(t=>(e,i,n)=>t(i,e,n))(Ye),qe=((t,e,i,n,s,r,o,a,l,h,u)=>(l,c)=>{const d=l.createBufferSource();return Nt(d,c),Ot(d,c,"playbackRate"),Rt(d,c,"buffer"),Rt(d,c,"loop"),Rt(d,c,"loopEnd"),Rt(d,c,"loopStart"),e(i,(()=>i(l)))||(t=>{t.start=(e=>{let i=!1;return(n=0,s=0,r)=>{if(i)throw wt();e.call(t,n,s,r),i=!0}})(t.start)})(d),e(n,(()=>n(l)))||(t=>{var e;t.start=(e=t.start,(i=0,n=0,s)=>{const r=t.buffer,o=null===r?n:Math.min(r.duration,n);null!==r&&o>r.duration-.5/t.context.sampleRate?e.call(t,i,0,0):e.call(t,i,o,s)})})(d),e(s,(()=>s(l)))||h(d,l),e(r,(()=>r(l)))||Dt(d),e(o,(()=>o(l)))||u(d,l),e(a,(()=>a(l)))||Bt(d),t(l,d),d})(Xe,be,(t=>{const e=t.createBufferSource();e.start();try{e.start()}catch{return!0}return!1}),(t=>{const e=t.createBufferSource(),i=t.createBuffer(1,1,44100);e.buffer=i;try{e.start(0,1)}catch{return!1}return!0}),(t=>{const e=t.createBufferSource();e.start();try{e.stop()}catch{return!1}return!0}),re,oe,ae,0,(t=>(e,i)=>{const n=i.createBuffer(1,1,44100);null===e.buffer&&(e.buffer=n),t(e,"buffer",(t=>()=>{const i=t.call(e);return i===n?null:i}),(t=>i=>t.call(e,null===i?n:i)))})(ne),ue),Ze=((t,e)=>(i,n,s)=>(t(n).replay(s),e(n,i,s)))((t=>e=>{const i=t(e);if(null===i.renderer)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return i.renderer})(F),Ye),$e=((t,e,i,n,s)=>()=>{const r=new WeakMap;let o=null,a=null;return{set start(t){o=t},set stop(t){a=t},render(l,h){const u=r.get(h);return void 0!==u?Promise.resolve(u):(async(l,h)=>{let u=i(l);const c=C(u,h);if(!c){const t={buffer:u.buffer,channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,loop:u.loop,loopEnd:u.loopEnd,loopStart:u.loopStart,playbackRate:u.playbackRate.value};u=e(h,t),null!==o&&u.start(...o),null!==a&&u.stop(a)}return r.set(h,u),c?await t(h,l.playbackRate,u.playbackRate):await n(h,l.playbackRate,u.playbackRate),await s(l,h,u),u})(l,h)}}})(Ke,qe,Q,Ze,Ee),Je=((t,e,i,s,r,o,a,l,h,u,c,d,p)=>(s,f,m,g=null,b=null)=>{const y=m.value,S=new n.AutomationEventList(y),v=f?(t=>({replay(e){for(const i of t)if("exponentialRampToValue"===i.type){const{endTime:t,value:n}=i;e.exponentialRampToValueAtTime(n,t)}else if("linearRampToValue"===i.type){const{endTime:t,value:n}=i;e.linearRampToValueAtTime(n,t)}else if("setTarget"===i.type){const{startTime:t,target:n,timeConstant:s}=i;e.setTargetAtTime(n,t,s)}else if("setValue"===i.type){const{startTime:t,value:n}=i;e.setValueAtTime(n,t)}else{if("setValueCurve"!==i.type)throw new Error("Can't apply an unknown automation.");{const{duration:t,startTime:n,values:s}=i;e.setValueCurveAtTime(s,n,t)}}}}))(S):null,_={get defaultValue(){return y},get maxValue(){return null===g?m.maxValue:g},get minValue(){return null===b?m.minValue:b},get value(){return m.value},set value(t){m.value=t,_.setValueAtTime(t,s.context.currentTime)},cancelAndHoldAtTime(t){if("function"==typeof m.cancelAndHoldAtTime)null===v&&S.flush(s.context.currentTime),S.add(r(t)),m.cancelAndHoldAtTime(t);else{const e=Array.from(S).pop();null===v&&S.flush(s.context.currentTime),S.add(r(t));const i=Array.from(S).pop();m.cancelScheduledValues(t),e!==i&&void 0!==i&&("exponentialRampToValue"===i.type?m.exponentialRampToValueAtTime(i.value,i.endTime):"linearRampToValue"===i.type?m.linearRampToValueAtTime(i.value,i.endTime):"setValue"===i.type?m.setValueAtTime(i.value,i.startTime):"setValueCurve"===i.type&&m.setValueCurveAtTime(i.values,i.startTime,i.duration))}return _},cancelScheduledValues:t=>(null===v&&S.flush(s.context.currentTime),S.add(o(t)),m.cancelScheduledValues(t),_),exponentialRampToValueAtTime(t,e){if(0===t)throw new RangeError;if(!Number.isFinite(e)||e<0)throw new RangeError;const i=s.context.currentTime;return null===v&&S.flush(i),0===Array.from(S).length&&(S.add(u(y,i)),m.setValueAtTime(y,i)),S.add(a(t,e)),m.exponentialRampToValueAtTime(t,e),_},linearRampToValueAtTime(t,e){const i=s.context.currentTime;return null===v&&S.flush(i),0===Array.from(S).length&&(S.add(u(y,i)),m.setValueAtTime(y,i)),S.add(l(t,e)),m.linearRampToValueAtTime(t,e),_},setTargetAtTime:(t,e,i)=>(null===v&&S.flush(s.context.currentTime),S.add(h(t,e,i)),m.setTargetAtTime(t,e,i),_),setValueAtTime:(t,e)=>(null===v&&S.flush(s.context.currentTime),S.add(u(t,e)),m.setValueAtTime(t,e),_),setValueCurveAtTime(t,e,i){const n=t instanceof Float32Array?t:new Float32Array(t);if(null!==d&&"webkitAudioContext"===d.name){const t=e+i,r=s.context.sampleRate,o=Math.ceil(e*r),a=Math.floor(t*r),l=a-o,h=new Float32Array(l);for(let t=0;t{Qe.set(t,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:e})}),Ae,l,0,n.createCancelAndHoldAutomationEvent,n.createCancelScheduledValuesAutomationEvent,n.createExponentialRampToValueAutomationEvent,n.createLinearRampToValueAutomationEvent,n.createSetTargetAutomationEvent,n.createSetValueAutomationEvent,n.createSetValueCurveAutomationEvent,Le,se);var Qe;const ti=((t,e,i,n,s,r,o,a)=>class extends t{constructor(t,n){const a=r(t),l={...D,...n},h=s(a,l),u=o(a),c=u?e():null;super(t,!1,h,c),this._audioBufferSourceNodeRenderer=c,this._isBufferNullified=!1,this._isBufferSet=null!==l.buffer,this._nativeAudioBufferSourceNode=h,this._onended=null,this._playbackRate=i(this,u,h.playbackRate,k,N)}get buffer(){return this._isBufferNullified?null:this._nativeAudioBufferSourceNode.buffer}set buffer(t){if(this._nativeAudioBufferSourceNode.buffer=t,null!==t){if(this._isBufferSet)throw n();this._isBufferSet=!0}}get loop(){return this._nativeAudioBufferSourceNode.loop}set loop(t){this._nativeAudioBufferSourceNode.loop=t}get loopEnd(){return this._nativeAudioBufferSourceNode.loopEnd}set loopEnd(t){this._nativeAudioBufferSourceNode.loopEnd=t}get loopStart(){return this._nativeAudioBufferSourceNode.loopStart}set loopStart(t){this._nativeAudioBufferSourceNode.loopStart=t}get onended(){return this._onended}set onended(t){const e="function"==typeof t?a(this,t):null;this._nativeAudioBufferSourceNode.onended=e;const i=this._nativeAudioBufferSourceNode.onended;this._onended=null!==i&&i===e?t:i}get playbackRate(){return this._playbackRate}start(t=0,e=0,i){if(this._nativeAudioBufferSourceNode.start(t,e,i),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.start=void 0===i?[t,e]:[t,e,i]),"closed"!==this.context.state){E(this);const t=()=>{this._nativeAudioBufferSourceNode.removeEventListener("ended",t),O(this)&&w(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",t)}}stop(t=0){this._nativeAudioBufferSourceNode.stop(t),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.stop=t)}})(De,$e,Je,wt,qe,we,Ce,ce),ei=((t,e,i,n,s,r,o,a)=>class extends t{constructor(t,e){const i=r(t),n=o(i),l=s(i,e,n);super(t,!1,l,n?(t=>{const e=new WeakMap;return{render(i,n){const s=e.get(n);return void 0!==s?Promise.resolve(s):(async(i,n)=>{const s=n.destination;return e.set(n,s),await t(i,n,s),s})(i,n)}}})(a):null),this._isNodeOfNativeOfflineAudioContext=n,this._nativeAudioDestinationNode=l}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(t){if(this._isNodeOfNativeOfflineAudioContext)throw n();if(t>this._nativeAudioDestinationNode.maxChannelCount)throw i();this._nativeAudioDestinationNode.channelCount=t}get channelCountMode(){return this._nativeAudioDestinationNode.channelCountMode}set channelCountMode(t){if(this._isNodeOfNativeOfflineAudioContext)throw n();this._nativeAudioDestinationNode.channelCountMode=t}get maxChannelCount(){return this._nativeAudioDestinationNode.maxChannelCount}})(De,0,I,wt,((t,e)=>(i,n,s)=>{const r=i.destination;if(r.channelCount!==n)try{r.channelCount=n}catch{}s&&"explicit"!==r.channelCountMode&&(r.channelCountMode="explicit"),0===r.maxChannelCount&&Object.defineProperty(r,"maxChannelCount",{value:n});const o=t(i,{channelCount:n,channelCountMode:r.channelCountMode,channelInterpretation:r.channelInterpretation,gain:1});return e(o,"channelCount",(t=>()=>t.call(o)),(t=>e=>{t.call(o,e);try{r.channelCount=e}catch(t){if(e>r.maxChannelCount)throw t}})),e(o,"channelCountMode",(t=>()=>t.call(o)),(t=>e=>{t.call(o,e),r.channelCountMode=e})),e(o,"channelInterpretation",(t=>()=>t.call(o)),(t=>e=>{t.call(o,e),r.channelInterpretation=e})),Object.defineProperty(o,"maxChannelCount",{get:()=>r.maxChannelCount}),o.connect(r),o})(Ht,ne),we,Ce,Ee),ii=((t,e,i,n,s)=>()=>{const r=new WeakMap;return{render(o,a){const l=r.get(a);return void 0!==l?Promise.resolve(l):(async(o,a)=>{let l=i(o);const h=C(l,a);if(!h){const t={Q:l.Q.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,detune:l.detune.value,frequency:l.frequency.value,gain:l.gain.value,type:l.type};l=e(a,t)}return r.set(a,l),h?(await t(a,o.Q,l.Q),await t(a,o.detune,l.detune),await t(a,o.frequency,l.frequency),await t(a,o.gain,l.gain)):(await n(a,o.Q,l.Q),await n(a,o.detune,l.detune),await n(a,o.frequency,l.frequency),await n(a,o.gain,l.gain)),await s(o,a,l),l})(o,a)}}})(Ke,Vt,Q,Ze,Ee),ni=(t=>(e,i)=>t.set(e,i))(me),si=((t,e,i,n,s,r,o,a)=>class extends t{constructor(t,n){const l=r(t),h={...mt,...n},u=s(l,h),c=o(l);super(t,!1,u,c?i():null),this._Q=e(this,c,u.Q,k,N),this._detune=e(this,c,u.detune,1200*Math.log2(k),-1200*Math.log2(k)),this._frequency=e(this,c,u.frequency,t.sampleRate/2,0),this._gain=e(this,c,u.gain,40*Math.log10(k),N),this._nativeBiquadFilterNode=u,a(this,1)}get detune(){return this._detune}get frequency(){return this._frequency}get gain(){return this._gain}get Q(){return this._Q}get type(){return this._nativeBiquadFilterNode.type}set type(t){this._nativeBiquadFilterNode.type=t}getFrequencyResponse(t,e,i){try{this._nativeBiquadFilterNode.getFrequencyResponse(t,e,i)}catch(t){if(11===t.code)throw n();throw t}if(t.length!==e.length||e.length!==i.length)throw n()}})(De,Je,ii,Pt,Vt,we,Ce,ni),ri=((t,e)=>(i,n,s)=>{const r=new Set;var o,a;return i.connect=(o=i.connect,(s,a=0,l=0)=>{const h=0===r.size;if(e(s))return o.call(i,s,a,l),t(r,[s,a,l],(t=>t[0]===s&&t[1]===a&&t[2]===l),!0),h&&n(),s;o.call(i,s,a),t(r,[s,a],(t=>t[0]===s&&t[1]===a),!0),h&&n()}),i.disconnect=(a=i.disconnect,(t,n,o)=>{const l=r.size>0;if(void 0===t)a.apply(i),r.clear();else if("number"==typeof t){a.call(i,t);for(const e of r)e[1]===t&&r.delete(e)}else{e(t)?a.call(i,t,n,o):a.call(i,t,n);for(const e of r)e[0]!==t||void 0!==n&&e[1]!==n||void 0!==o&&e[2]!==o||r.delete(e)}const h=0===r.size;l&&h&&s()}),i})(z,Ne),oi=((t,e)=>(i,n)=>{n.channelCount=1,n.channelCountMode="explicit",Object.defineProperty(n,"channelCount",{get:()=>1,set:()=>{throw t()}}),Object.defineProperty(n,"channelCountMode",{get:()=>"explicit",set:()=>{throw t()}});const s=i.createBufferSource();e(n,(()=>{const t=n.numberOfInputs;for(let e=0;es.disconnect(n)))})(wt,ri),ai=((t,e)=>(i,n)=>{const s=i.createChannelMerger(n.numberOfInputs);return null!==t&&"webkitAudioContext"===t.name&&e(i,s),Nt(s,n),s})(Le,oi),li=((t,e,i)=>()=>{const n=new WeakMap;return{render(s,r){const o=n.get(r);return void 0!==o?Promise.resolve(o):(async(s,r)=>{let o=e(s);if(!C(o,r)){const e={channelCount:o.channelCount,channelCountMode:o.channelCountMode,channelInterpretation:o.channelInterpretation,numberOfInputs:o.numberOfInputs};o=t(r,e)}return n.set(r,o),await i(s,r,o),o})(s,r)}}})(ai,Q,Ee),hi=((t,e,i,n,s)=>class extends t{constructor(t,r){const o=n(t),a={...gt,...r};super(t,!1,i(o,a),s(o)?e():null)}})(De,li,ai,we,Ce),ui=((t,e,i)=>()=>{const n=new WeakMap;return{render(s,r){const o=n.get(r);return void 0!==o?Promise.resolve(o):(async(s,r)=>{let o=e(s);if(!C(o,r)){const e={channelCount:o.channelCount,channelCountMode:o.channelCountMode,channelInterpretation:o.channelInterpretation,numberOfOutputs:o.numberOfOutputs};o=t(r,e)}return n.set(r,o),await i(s,r,o),o})(s,r)}}})(Gt,Q,Ee),ci=((t,e,i,n,s,r)=>class extends t{constructor(t,r){const o=n(t),a=(t=>({...t,channelCount:t.numberOfOutputs}))({...bt,...r});super(t,!1,i(o,a),s(o)?e():null)}})(De,ui,Gt,we,Ce),di=((t,e,i,n)=>(s,{offset:r,...o})=>{const a=s.createBuffer(1,2,44100),l=e(s,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),h=i(s,{...o,gain:r}),u=a.getChannelData(0);u[0]=1,u[1]=1,l.buffer=a,l.loop=!0;const c={get bufferSize(){},get channelCount(){return h.channelCount},set channelCount(t){h.channelCount=t},get channelCountMode(){return h.channelCountMode},set channelCountMode(t){h.channelCountMode=t},get channelInterpretation(){return h.channelInterpretation},set channelInterpretation(t){h.channelInterpretation=t},get context(){return h.context},get inputs(){return[]},get numberOfInputs(){return l.numberOfInputs},get numberOfOutputs(){return h.numberOfOutputs},get offset(){return h.gain},get onended(){return l.onended},set onended(t){l.onended=t},addEventListener:(...t)=>l.addEventListener(t[0],t[1],t[2]),dispatchEvent:(...t)=>l.dispatchEvent(t[0]),removeEventListener:(...t)=>l.removeEventListener(t[0],t[1],t[2]),start(t=0){l.start.call(l,t)},stop(t=0){l.stop.call(l,t)}};return t(s,l),n(Wt(c,h),(()=>l.connect(h)),(()=>l.disconnect(h)))})(Xe,qe,Ht,ri),pi=((t,e,i,n,s)=>(r,o)=>{if(void 0===r.createConstantSource)return i(r,o);const a=r.createConstantSource();return Nt(a,o),Ot(a,o,"offset"),e(n,(()=>n(r)))||Dt(a),e(s,(()=>s(r)))||Bt(a),t(r,a),a})(Xe,be,di,re,ae),fi=((t,e,i,n,s)=>()=>{const r=new WeakMap;let o=null,a=null;return{set start(t){o=t},set stop(t){a=t},render(l,h){const u=r.get(h);return void 0!==u?Promise.resolve(u):(async(l,h)=>{let u=i(l);const c=C(u,h);if(!c){const t={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,offset:u.offset.value};u=e(h,t),null!==o&&u.start(o),null!==a&&u.stop(a)}return r.set(h,u),c?await t(h,l.offset,u.offset):await n(h,l.offset,u.offset),await s(l,h,u),u})(l,h)}}})(Ke,pi,Q,Ze,Ee),mi=((t,e,i,n,s,r,o)=>class extends t{constructor(t,o){const a=s(t),l={...yt,...o},h=n(a,l),u=r(a),c=u?i():null;super(t,!1,h,c),this._constantSourceNodeRenderer=c,this._nativeConstantSourceNode=h,this._offset=e(this,u,h.offset,k,N),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(t){const e="function"==typeof t?o(this,t):null;this._nativeConstantSourceNode.onended=e;const i=this._nativeConstantSourceNode.onended;this._onended=null!==i&&i===e?t:i}start(t=0){if(this._nativeConstantSourceNode.start(t),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.start=t),"closed"!==this.context.state){E(this);const t=()=>{this._nativeConstantSourceNode.removeEventListener("ended",t),O(this)&&w(this)};this._nativeConstantSourceNode.addEventListener("ended",t)}}stop(t=0){this._nativeConstantSourceNode.stop(t),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.stop=t)}})(De,Je,fi,pi,we,Ce,ce),gi=((t,e)=>(i,n)=>{const s=i.createConvolver();if(Nt(s,n),n.disableNormalization===s.normalize&&(s.normalize=!n.disableNormalization),Rt(s,n,"buffer"),n.channelCount>2)throw t();if(e(s,"channelCount",(t=>()=>t.call(s)),(e=>i=>{if(i>2)throw t();return e.call(s,i)})),"max"===n.channelCountMode)throw t();return e(s,"channelCountMode",(t=>()=>t.call(s)),(e=>i=>{if("max"===i)throw t();return e.call(s,i)})),s})(Yt,ne),bi=((t,e,i)=>()=>{const n=new WeakMap;return{render(s,r){const o=n.get(r);return void 0!==o?Promise.resolve(o):(async(s,r)=>{let o=e(s);if(!C(o,r)){const e={buffer:o.buffer,channelCount:o.channelCount,channelCountMode:o.channelCountMode,channelInterpretation:o.channelInterpretation,disableNormalization:!o.normalize};o=t(r,e)}return n.set(r,o),Y(o)?await i(s,r,o.inputs[0]):await i(s,r,o),o})(s,r)}}})(gi,Q,Ee),yi=((t,e,i,n,s,r)=>class extends t{constructor(t,o){const a=n(t),l={...St,...o},h=i(a,l);super(t,!1,h,s(a)?e():null),this._isBufferNullified=!1,this._nativeConvolverNode=h,null!==l.buffer&&r(this,l.buffer.duration)}get buffer(){return this._isBufferNullified?null:this._nativeConvolverNode.buffer}set buffer(t){if(this._nativeConvolverNode.buffer=t,null===t&&null!==this._nativeConvolverNode.buffer){const t=this._nativeConvolverNode.context;this._nativeConvolverNode.buffer=t.createBuffer(1,1,t.sampleRate),this._isBufferNullified=!0,r(this,0)}else this._isBufferNullified=!1,r(this,null===this._nativeConvolverNode.buffer?0:this._nativeConvolverNode.buffer.duration)}get normalize(){return this._nativeConvolverNode.normalize}set normalize(t){this._nativeConvolverNode.normalize=t}})(De,bi,gi,we,Ce,ni),Si=((t,e,i,n,s)=>r=>{const o=new WeakMap;return{render(a,l){const h=o.get(l);return void 0!==h?Promise.resolve(h):(async(a,l)=>{let h=i(a);const u=C(h,l);if(!u){const t={channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation,delayTime:h.delayTime.value,maxDelayTime:r};h=e(l,t)}return o.set(l,h),u?await t(l,a.delayTime,h.delayTime):await n(l,a.delayTime,h.delayTime),await s(a,l,h),h})(a,l)}}})(Ke,Ut,Q,Ze,Ee),vi=((t,e,i,n,s,r,o)=>class extends t{constructor(t,a){const l=s(t),h={..._t,...a},u=n(l,h),c=r(l);super(t,!1,u,c?i(h.maxDelayTime):null),this._delayTime=e(this,c,u.delayTime),o(this,h.maxDelayTime)}get delayTime(){return this._delayTime}})(De,Je,Si,Ut,we,Ce,ni),_i=(t=>(e,i)=>{const n=e.createDynamicsCompressor();if(Nt(n,i),i.channelCount>2)throw t();if("max"===i.channelCountMode)throw t();return Ot(n,i,"attack"),Ot(n,i,"knee"),Ot(n,i,"ratio"),Ot(n,i,"release"),Ot(n,i,"threshold"),n})(Yt),xi=((t,e,i,n,s)=>()=>{const r=new WeakMap;return{render(o,a){const l=r.get(a);return void 0!==l?Promise.resolve(l):(async(o,a)=>{let l=i(o);const h=C(l,a);if(!h){const t={attack:l.attack.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,knee:l.knee.value,ratio:l.ratio.value,release:l.release.value,threshold:l.threshold.value};l=e(a,t)}return r.set(a,l),h?(await t(a,o.attack,l.attack),await t(a,o.knee,l.knee),await t(a,o.ratio,l.ratio),await t(a,o.release,l.release),await t(a,o.threshold,l.threshold)):(await n(a,o.attack,l.attack),await n(a,o.knee,l.knee),await n(a,o.ratio,l.ratio),await n(a,o.release,l.release),await n(a,o.threshold,l.threshold)),await s(o,a,l),l})(o,a)}}})(Ke,_i,Q,Ze,Ee),Ei=((t,e,i,n,s,r,o,a)=>class extends t{constructor(t,s){const l=r(t),h={...Et,...s},u=n(l,h),c=o(l);super(t,!1,u,c?i():null),this._attack=e(this,c,u.attack),this._knee=e(this,c,u.knee),this._nativeDynamicsCompressorNode=u,this._ratio=e(this,c,u.ratio),this._release=e(this,c,u.release),this._threshold=e(this,c,u.threshold),a(this,.006)}get attack(){return this._attack}get channelCount(){return this._nativeDynamicsCompressorNode.channelCount}set channelCount(t){const e=this._nativeDynamicsCompressorNode.channelCount;if(this._nativeDynamicsCompressorNode.channelCount=t,t>2)throw this._nativeDynamicsCompressorNode.channelCount=e,s()}get channelCountMode(){return this._nativeDynamicsCompressorNode.channelCountMode}set channelCountMode(t){const e=this._nativeDynamicsCompressorNode.channelCountMode;if(this._nativeDynamicsCompressorNode.channelCountMode=t,"max"===t)throw this._nativeDynamicsCompressorNode.channelCountMode=e,s()}get knee(){return this._knee}get ratio(){return this._ratio}get reduction(){return"number"==typeof this._nativeDynamicsCompressorNode.reduction.value?this._nativeDynamicsCompressorNode.reduction.value:this._nativeDynamicsCompressorNode.reduction}get release(){return this._release}get threshold(){return this._threshold}})(De,Je,xi,_i,Yt,we,Ce,ni),Mi=((t,e,i,n,s)=>()=>{const r=new WeakMap;return{render(o,a){const l=r.get(a);return void 0!==l?Promise.resolve(l):(async(o,a)=>{let l=i(o);const h=C(l,a);if(!h){const t={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,gain:l.gain.value};l=e(a,t)}return r.set(a,l),h?await t(a,o.gain,l.gain):await n(a,o.gain,l.gain),await s(o,a,l),l})(o,a)}}})(Ke,Ht,Q,Ze,Ee),wi=((t,e,i,n,s,r)=>class extends t{constructor(t,o){const a=s(t),l={...Mt,...o},h=n(a,l),u=r(a);super(t,!1,h,u?i():null),this._gain=e(this,u,h.gain,k,N)}get gain(){return this._gain}})(De,Je,Mi,Ht,we,Ce),Pi=((t,e,i,n)=>(s,r,{channelCount:o,channelCountMode:a,channelInterpretation:l,feedback:h,feedforward:u})=>{const c=Ft(r,s.sampleRate),d=h instanceof Float64Array?h:new Float64Array(h),p=u instanceof Float64Array?u:new Float64Array(u),f=d.length,m=p.length,g=Math.min(f,m);if(0===f||f>20)throw n();if(0===d[0])throw e();if(0===m||m>20)throw n();if(0===p[0])throw e();if(1!==d[0]){for(let t=0;t{const e=t.inputBuffer,i=t.outputBuffer,n=e.numberOfChannels;for(let t=0;tb.addEventListener(t[0],t[1],t[2]),dispatchEvent:(...t)=>b.dispatchEvent(t[0]),getFrequencyResponse(e,i,n){if(e.length!==i.length||i.length!==n.length)throw t();const s=e.length;for(let t=0;tb.removeEventListener(t[0],t[1],t[2])},b)})(Pt,wt,Xt,Yt),Ti=((t,e,i,n)=>s=>t(It,(()=>It(s)))?Promise.resolve(t(n,n)).then((t=>{if(!t){const t=i(s,512,0,1);s.oncomplete=()=>{t.onaudioprocess=null,t.disconnect()},t.onaudioprocess=()=>s.currentTime,t.connect(s.destination)}return s.startRendering()})):new Promise((t=>{const i=e(s,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});s.oncomplete=e=>{i.disconnect(),t(e.renderedBuffer)},i.connect(s.destination),s.startRendering()})))(be,Ht,Xt,((t,e)=>()=>{if(null===e)return Promise.resolve(!1);const i=new e(1,1,44100),n=t(i,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise((t=>{i.oncomplete=()=>{n.disconnect(),t(0!==i.currentTime)},i.startRendering()}))})(Ht,Te)),Ci=((t,e,i,n,s)=>(r,o)=>{const a=new WeakMap;let l=null;return{render(h,u){const c=a.get(u);return void 0!==c?Promise.resolve(c):(async(h,u)=>{let c=null,d=e(h);const p=C(d,u);if(void 0===u.createIIRFilter?c=t(u,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):p||(d=u.createIIRFilter(o,r)),a.set(u,null===c?d:c),null!==c){if(null===l){if(null===i)throw new Error("Missing the native OfflineAudioContext constructor.");const t=new i(h.context.destination.channelCount,h.context.length,u.sampleRate);l=(async()=>(await n(h,t,t.destination),((t,e,i,n)=>{const s=i instanceof Float64Array?i:new Float64Array(i),r=n instanceof Float64Array?n:new Float64Array(n),o=s.length,a=r.length,l=Math.min(o,a);if(1!==s[0]){for(let t=0;t(e,i,n)=>{if(void 0===e.createIIRFilter)return t(e,i,n);const s=e.createIIRFilter(n.feedforward,n.feedback);return Nt(s,n),s})(Pi),Ii=((t,e,i,n,s,r)=>class extends t{constructor(t,o){const a=n(t),l=s(a),h={...Tt,...o},u=e(a,l?null:t.baseLatency,h);super(t,!1,u,l?i(h.feedback,h.feedforward):null),(t=>{var e;t.getFrequencyResponse=(e=t.getFrequencyResponse,(i,n,s)=>{if(i.length!==n.length||n.length!==s.length)throw Pt();return e.call(t,i,n,s)})})(u),this._nativeIIRFilterNode=u,r(this,1)}getFrequencyResponse(t,e,i){return this._nativeIIRFilterNode.getFrequencyResponse(t,e,i)}})(De,Ai,Ci,we,Ce,ni),Li=((t,e,i,n,s,r,o,a)=>(l,h)=>{const u=h.listener,{forwardX:c,forwardY:d,forwardZ:p,positionX:f,positionY:m,positionZ:g,upX:b,upY:y,upZ:S}=void 0===u.forwardX?(()=>{const c=new Float32Array(1),d=e(h,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),p=o(h);let f=!1,m=[0,0,-1,0,1,0],g=[0,0,0];const b=()=>{if(f)return;f=!0;const t=n(h,256,9,0);t.onaudioprocess=({inputBuffer:t})=>{const e=[r(t,c,0),r(t,c,1),r(t,c,2),r(t,c,3),r(t,c,4),r(t,c,5)];e.some(((t,e)=>t!==m[e]))&&(u.setOrientation(...e),m=e);const i=[r(t,c,6),r(t,c,7),r(t,c,8)];i.some(((t,e)=>t!==g[e]))&&(u.setPosition(...i),g=i)},d.connect(t)},y=t=>e=>{e!==m[t]&&(m[t]=e,u.setOrientation(...m))},S=t=>e=>{e!==g[t]&&(g[t]=e,u.setPosition(...g))},v=(e,n,r)=>{const o=i(h,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:n});o.connect(d,0,e),o.start(),Object.defineProperty(o.offset,"defaultValue",{get:()=>n});const u=t({context:l},p,o.offset,k,N);var c,f,m,g,y,S,v;return a(u,"value",(t=>()=>t.call(u)),(t=>e=>{try{t.call(u,e)}catch(t){if(9!==t.code)throw t}b(),p&&r(e)})),u.cancelAndHoldAtTime=(c=u.cancelAndHoldAtTime,p?()=>{throw s()}:(...t)=>{const e=c.apply(u,t);return b(),e}),u.cancelScheduledValues=(f=u.cancelScheduledValues,p?()=>{throw s()}:(...t)=>{const e=f.apply(u,t);return b(),e}),u.exponentialRampToValueAtTime=(m=u.exponentialRampToValueAtTime,p?()=>{throw s()}:(...t)=>{const e=m.apply(u,t);return b(),e}),u.linearRampToValueAtTime=(g=u.linearRampToValueAtTime,p?()=>{throw s()}:(...t)=>{const e=g.apply(u,t);return b(),e}),u.setTargetAtTime=(y=u.setTargetAtTime,p?()=>{throw s()}:(...t)=>{const e=y.apply(u,t);return b(),e}),u.setValueAtTime=(S=u.setValueAtTime,p?()=>{throw s()}:(...t)=>{const e=S.apply(u,t);return b(),e}),u.setValueCurveAtTime=(v=u.setValueCurveAtTime,p?()=>{throw s()}:(...t)=>{const e=v.apply(u,t);return b(),e}),u};return{forwardX:v(0,0,y(0)),forwardY:v(1,0,y(1)),forwardZ:v(2,-1,y(2)),positionX:v(6,0,S(0)),positionY:v(7,0,S(1)),positionZ:v(8,0,S(2)),upX:v(3,0,y(3)),upY:v(4,1,y(4)),upZ:v(5,0,y(5))}})():u;return{get forwardX(){return c},get forwardY(){return d},get forwardZ(){return p},get positionX(){return f},get positionY(){return m},get positionZ(){return g},get upX(){return b},get upY(){return y},get upZ(){return S}}})(Je,ai,pi,Xt,Yt,ee,Ce,ne),Ri=new WeakMap,Ni=((t,e,i,n,s,r)=>class extends i{constructor(i,r){super(i),this._nativeContext=i,h.set(this,i),n(i)&&s.set(i,new Set),this._destination=new t(this,r),this._listener=e(this,i),this._onstatechange=null}get currentTime(){return this._nativeContext.currentTime}get destination(){return this._destination}get listener(){return this._listener}get onstatechange(){return this._onstatechange}set onstatechange(t){const e="function"==typeof t?r(this,t):null;this._nativeContext.onstatechange=e;const i=this._nativeContext.onstatechange;this._onstatechange=null!==i&&i===e?t:i}get sampleRate(){return this._nativeContext.sampleRate}get state(){return this._nativeContext.state}})(ei,Li,Ie,Ce,Ri,ce),ki=((t,e,i,n,s,r)=>(o,a)=>{const l=o.createOscillator();return Nt(l,a),Ot(l,a,"detune"),Ot(l,a,"frequency"),void 0!==a.periodicWave?l.setPeriodicWave(a.periodicWave):Rt(l,a,"type"),e(i,(()=>i(o)))||Dt(l),e(n,(()=>n(o)))||r(l,o),e(s,(()=>s(o)))||Bt(l),t(o,l),l})(Xe,be,re,oe,ae,ue),Oi=((t,e,i,n,s)=>()=>{const r=new WeakMap;let o=null,a=null,l=null;return{set periodicWave(t){o=t},set start(t){a=t},set stop(t){l=t},render(h,u){const c=r.get(u);return void 0!==c?Promise.resolve(c):(async(h,u)=>{let c=i(h);const d=C(c,u);if(!d){const t={channelCount:c.channelCount,channelCountMode:c.channelCountMode,channelInterpretation:c.channelInterpretation,detune:c.detune.value,frequency:c.frequency.value,periodicWave:null===o?void 0:o,type:c.type};c=e(u,t),null!==a&&c.start(a),null!==l&&c.stop(l)}return r.set(u,c),d?(await t(u,h.detune,c.detune),await t(u,h.frequency,c.frequency)):(await n(u,h.detune,c.detune),await n(u,h.frequency,c.frequency)),await s(h,u,c),c})(h,u)}}})(Ke,ki,Q,Ze,Ee),Di=((t,e,i,n,s,r,o)=>class extends t{constructor(t,o){const a=s(t),l={...qt,...o},h=i(a,l),u=r(a),c=u?n():null,d=t.sampleRate/2;super(t,!1,h,c),this._detune=e(this,u,h.detune,153600,-153600),this._frequency=e(this,u,h.frequency,d,-d),this._nativeOscillatorNode=h,this._onended=null,this._oscillatorNodeRenderer=c,null!==this._oscillatorNodeRenderer&&void 0!==l.periodicWave&&(this._oscillatorNodeRenderer.periodicWave=l.periodicWave)}get detune(){return this._detune}get frequency(){return this._frequency}get onended(){return this._onended}set onended(t){const e="function"==typeof t?o(this,t):null;this._nativeOscillatorNode.onended=e;const i=this._nativeOscillatorNode.onended;this._onended=null!==i&&i===e?t:i}get type(){return this._nativeOscillatorNode.type}set type(t){this._nativeOscillatorNode.type=t,null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=null)}setPeriodicWave(t){this._nativeOscillatorNode.setPeriodicWave(t),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=t)}start(t=0){if(this._nativeOscillatorNode.start(t),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.start=t),"closed"!==this.context.state){E(this);const t=()=>{this._nativeOscillatorNode.removeEventListener("ended",t),O(this)&&w(this)};this._nativeOscillatorNode.addEventListener("ended",t)}}stop(t=0){this._nativeOscillatorNode.stop(t),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.stop=t)}})(De,Je,ki,Oi,we,Ce,ce),Bi=(t=>(e,i)=>{const n=t(e,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),s=e.createBuffer(1,2,44100);return n.buffer=s,n.loop=!0,n.connect(i),n.start(),()=>{n.stop(),n.disconnect(i)}})(qe),Fi=((t,e,i,n,s)=>(r,{curve:o,oversample:a,...l})=>{const h=r.createWaveShaper(),u=r.createWaveShaper();Nt(h,l),Nt(u,l);const c=i(r,{...l,gain:1}),d=i(r,{...l,gain:-1}),p=i(r,{...l,gain:1}),f=i(r,{...l,gain:-1});let m=null,g=!1,b=null;const y={get bufferSize(){},get channelCount(){return h.channelCount},set channelCount(t){c.channelCount=t,d.channelCount=t,h.channelCount=t,p.channelCount=t,u.channelCount=t,f.channelCount=t},get channelCountMode(){return h.channelCountMode},set channelCountMode(t){c.channelCountMode=t,d.channelCountMode=t,h.channelCountMode=t,p.channelCountMode=t,u.channelCountMode=t,f.channelCountMode=t},get channelInterpretation(){return h.channelInterpretation},set channelInterpretation(t){c.channelInterpretation=t,d.channelInterpretation=t,h.channelInterpretation=t,p.channelInterpretation=t,u.channelInterpretation=t,f.channelInterpretation=t},get context(){return h.context},get curve(){return b},set curve(i){if(null!==i&&i.length<2)throw e();if(null===i)h.curve=i,u.curve=i;else{const t=i.length,e=new Float32Array(t+2-t%2),n=new Float32Array(t+2-t%2);e[0]=i[0],n[0]=-i[t-1];const s=Math.ceil((t+1)/2),r=(t+1)/2-1;for(let o=1;oc.addEventListener(t[0],t[1],t[2]),dispatchEvent:(...t)=>c.dispatchEvent(t[0]),removeEventListener:(...t)=>c.removeEventListener(t[0],t[1],t[2])};return null!==o&&(y.curve=o instanceof Float32Array?o:new Float32Array(o)),a!==y.oversample&&(y.oversample=a),s(Wt(y,p),(()=>{c.connect(h).connect(p),c.connect(d).connect(u).connect(f).connect(p),g=!0,n(b)&&(m=t(r,c))}),(()=>{c.disconnect(h),h.disconnect(p),c.disconnect(d),d.disconnect(u),u.disconnect(f),f.disconnect(p),g=!1,null!==m&&(m(),m=null)}))})(Bi,wt,Ht,ie,ri),Vi=((t,e,i,n,s,r,o)=>(a,l)=>{const h=a.createWaveShaper();if(null!==r&&"webkitAudioContext"===r.name&&void 0===a.createGain().gain.automationRate)return i(a,l);Nt(h,l);const u=null===l.curve||l.curve instanceof Float32Array?l.curve:new Float32Array(l.curve);if(null!==u&&u.length<2)throw e();Rt(h,{curve:u},"curve"),Rt(h,l,"oversample");let c=null,d=!1;return o(h,"curve",(t=>()=>t.call(h)),(e=>i=>(e.call(h,i),d&&(n(i)&&null===c?c=t(a,h):n(i)||null===c||(c(),c=null)),i))),s(h,(()=>{d=!0,n(h.curve)&&(c=t(a,h))}),(()=>{d=!1,null!==c&&(c(),c=null)}))})(Bi,wt,Fi,ie,ri,Le,ne),Gi=((t,e,i,n,s,r,o,a,l,h)=>(u,{coneInnerAngle:c,coneOuterAngle:d,coneOuterGain:p,distanceModel:f,maxDistance:m,orientationX:g,orientationY:b,orientationZ:y,panningModel:S,positionX:v,positionY:_,positionZ:x,refDistance:E,rolloffFactor:M,...w})=>{const P=u.createPanner();if(w.channelCount>2)throw o();if("max"===w.channelCountMode)throw o();Nt(P,w);const T={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},C=i(u,{...T,channelInterpretation:"speakers",numberOfInputs:6}),A=n(u,{...w,gain:1}),I=n(u,{...T,gain:1}),L=n(u,{...T,gain:0}),R=n(u,{...T,gain:0}),N=n(u,{...T,gain:0}),k=n(u,{...T,gain:0}),O=n(u,{...T,gain:0}),D=s(u,256,6,1),B=r(u,{...T,curve:new Float32Array([1,1]),oversample:"none"});let F=[g,b,y],V=[v,_,x];const G=new Float32Array(1);D.onaudioprocess=({inputBuffer:t})=>{const e=[l(t,G,0),l(t,G,1),l(t,G,2)];e.some(((t,e)=>t!==F[e]))&&(P.setOrientation(...e),F=e);const i=[l(t,G,3),l(t,G,4),l(t,G,5)];i.some(((t,e)=>t!==V[e]))&&(P.setPosition(...i),V=i)},Object.defineProperty(L.gain,"defaultValue",{get:()=>0}),Object.defineProperty(R.gain,"defaultValue",{get:()=>0}),Object.defineProperty(N.gain,"defaultValue",{get:()=>0}),Object.defineProperty(k.gain,"defaultValue",{get:()=>0}),Object.defineProperty(O.gain,"defaultValue",{get:()=>0});const W={get bufferSize(){},get channelCount(){return P.channelCount},set channelCount(t){if(t>2)throw o();A.channelCount=t,P.channelCount=t},get channelCountMode(){return P.channelCountMode},set channelCountMode(t){if("max"===t)throw o();A.channelCountMode=t,P.channelCountMode=t},get channelInterpretation(){return P.channelInterpretation},set channelInterpretation(t){A.channelInterpretation=t,P.channelInterpretation=t},get coneInnerAngle(){return P.coneInnerAngle},set coneInnerAngle(t){P.coneInnerAngle=t},get coneOuterAngle(){return P.coneOuterAngle},set coneOuterAngle(t){P.coneOuterAngle=t},get coneOuterGain(){return P.coneOuterGain},set coneOuterGain(t){if(t<0||t>1)throw e();P.coneOuterGain=t},get context(){return P.context},get distanceModel(){return P.distanceModel},set distanceModel(t){P.distanceModel=t},get inputs(){return[A]},get maxDistance(){return P.maxDistance},set maxDistance(t){if(t<0)throw new RangeError;P.maxDistance=t},get numberOfInputs(){return P.numberOfInputs},get numberOfOutputs(){return P.numberOfOutputs},get orientationX(){return I.gain},get orientationY(){return L.gain},get orientationZ(){return R.gain},get panningModel(){return P.panningModel},set panningModel(t){P.panningModel=t},get positionX(){return N.gain},get positionY(){return k.gain},get positionZ(){return O.gain},get refDistance(){return P.refDistance},set refDistance(t){if(t<0)throw new RangeError;P.refDistance=t},get rolloffFactor(){return P.rolloffFactor},set rolloffFactor(t){if(t<0)throw new RangeError;P.rolloffFactor=t},addEventListener:(...t)=>A.addEventListener(t[0],t[1],t[2]),dispatchEvent:(...t)=>A.dispatchEvent(t[0]),removeEventListener:(...t)=>A.removeEventListener(t[0],t[1],t[2])};return c!==W.coneInnerAngle&&(W.coneInnerAngle=c),d!==W.coneOuterAngle&&(W.coneOuterAngle=d),p!==W.coneOuterGain&&(W.coneOuterGain=p),f!==W.distanceModel&&(W.distanceModel=f),m!==W.maxDistance&&(W.maxDistance=m),g!==W.orientationX.value&&(W.orientationX.value=g),b!==W.orientationY.value&&(W.orientationY.value=b),y!==W.orientationZ.value&&(W.orientationZ.value=y),S!==W.panningModel&&(W.panningModel=S),v!==W.positionX.value&&(W.positionX.value=v),_!==W.positionY.value&&(W.positionY.value=_),x!==W.positionZ.value&&(W.positionZ.value=x),E!==W.refDistance&&(W.refDistance=E),M!==W.rolloffFactor&&(W.rolloffFactor=M),1===F[0]&&0===F[1]&&0===F[2]||P.setOrientation(...F),0===V[0]&&0===V[1]&&0===V[2]||P.setPosition(...V),h(Wt(W,P),(()=>{A.connect(P),t(A,B,0,0),B.connect(I).connect(C,0,0),B.connect(L).connect(C,0,1),B.connect(R).connect(C,0,2),B.connect(N).connect(C,0,3),B.connect(k).connect(C,0,4),B.connect(O).connect(C,0,5),C.connect(D).connect(u.destination)}),(()=>{A.disconnect(P),a(A,B,0,0),B.disconnect(I),I.disconnect(C),B.disconnect(L),L.disconnect(C),B.disconnect(R),R.disconnect(C),B.disconnect(N),N.disconnect(C),B.disconnect(k),k.disconnect(C),B.disconnect(O),O.disconnect(C),C.disconnect(D),D.disconnect(u.destination)}))})(K,wt,ai,Ht,Xt,Vi,Yt,J,ee,ri),Wi=(t=>(e,i)=>{const n=e.createPanner();return void 0===n.orientationX?t(e,i):(Nt(n,i),Ot(n,i,"orientationX"),Ot(n,i,"orientationY"),Ot(n,i,"orientationZ"),Ot(n,i,"positionX"),Ot(n,i,"positionY"),Ot(n,i,"positionZ"),Rt(n,i,"coneInnerAngle"),Rt(n,i,"coneOuterAngle"),Rt(n,i,"coneOuterGain"),Rt(n,i,"distanceModel"),Rt(n,i,"maxDistance"),Rt(n,i,"panningModel"),Rt(n,i,"refDistance"),Rt(n,i,"rolloffFactor"),n)})(Gi),Ui=((t,e,i,n,s,r,o,a,l,h)=>()=>{const u=new WeakMap;let c=null;return{render(d,p){const f=u.get(p);return void 0!==f?Promise.resolve(f):(async(d,p)=>{let f=null,m=r(d);const g={channelCount:m.channelCount,channelCountMode:m.channelCountMode,channelInterpretation:m.channelInterpretation},b={...g,coneInnerAngle:m.coneInnerAngle,coneOuterAngle:m.coneOuterAngle,coneOuterGain:m.coneOuterGain,distanceModel:m.distanceModel,maxDistance:m.maxDistance,panningModel:m.panningModel,refDistance:m.refDistance,rolloffFactor:m.rolloffFactor},y=C(m,p);if("bufferSize"in m)f=n(p,{...g,gain:1});else if(!y){const t={...b,orientationX:m.orientationX.value,orientationY:m.orientationY.value,orientationZ:m.orientationZ.value,positionX:m.positionX.value,positionY:m.positionY.value,positionZ:m.positionZ.value};m=s(p,t)}if(u.set(p,null===f?m:f),null!==f){if(null===c){if(null===o)throw new Error("Missing the native OfflineAudioContext constructor.");const t=new o(6,d.context.length,p.sampleRate),n=e(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});n.connect(t.destination),c=(async()=>{const e=await Promise.all([d.orientationX,d.orientationY,d.orientationZ,d.positionX,d.positionY,d.positionZ].map((async(e,n)=>{const s=i(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:0===n?1:0});return await a(t,e,s.offset),s})));for(let t=0;t<6;t+=1)e[t].connect(n,0,t),e[t].start(0);return h(t)})()}const t=await c,r=n(p,{...g,gain:1});await l(d,p,r);const u=[];for(let e=0;et!==m[e]))||i.some(((t,e)=>t!==y[e]))){m=t,y=i;const o=e/p.sampleRate;S.gain.setValueAtTime(0,o),S=n(p,{...g,gain:0}),v=s(p,{...b,orientationX:m[0],orientationY:m[1],orientationZ:m[2],positionX:y[0],positionY:y[1],positionZ:y[2]}),S.gain.setValueAtTime(1,o),r.connect(S).connect(v.inputs[0]),v.connect(f)}}return f}return y?(await t(p,d.orientationX,m.orientationX),await t(p,d.orientationY,m.orientationY),await t(p,d.orientationZ,m.orientationZ),await t(p,d.positionX,m.positionX),await t(p,d.positionY,m.positionY),await t(p,d.positionZ,m.positionZ)):(await a(p,d.orientationX,m.orientationX),await a(p,d.orientationY,m.orientationY),await a(p,d.orientationZ,m.orientationZ),await a(p,d.positionX,m.positionX),await a(p,d.positionY,m.positionY),await a(p,d.positionZ,m.positionZ)),Y(m)?await l(d,p,m.inputs[0]):await l(d,p,m),m})(d,p)}}})(Ke,ai,pi,Ht,Wi,Q,Te,Ze,Ee,Ti),Hi=((t,e,i,n,s,r,o)=>class extends t{constructor(t,a){const l=s(t),h={...Zt,...a},u=i(l,h),c=r(l);super(t,!1,u,c?n():null),this._nativePannerNode=u,this._orientationX=e(this,c,u.orientationX,k,N),this._orientationY=e(this,c,u.orientationY,k,N),this._orientationZ=e(this,c,u.orientationZ,k,N),this._positionX=e(this,c,u.positionX,k,N),this._positionY=e(this,c,u.positionY,k,N),this._positionZ=e(this,c,u.positionZ,k,N),o(this,1)}get coneInnerAngle(){return this._nativePannerNode.coneInnerAngle}set coneInnerAngle(t){this._nativePannerNode.coneInnerAngle=t}get coneOuterAngle(){return this._nativePannerNode.coneOuterAngle}set coneOuterAngle(t){this._nativePannerNode.coneOuterAngle=t}get coneOuterGain(){return this._nativePannerNode.coneOuterGain}set coneOuterGain(t){this._nativePannerNode.coneOuterGain=t}get distanceModel(){return this._nativePannerNode.distanceModel}set distanceModel(t){this._nativePannerNode.distanceModel=t}get maxDistance(){return this._nativePannerNode.maxDistance}set maxDistance(t){this._nativePannerNode.maxDistance=t}get orientationX(){return this._orientationX}get orientationY(){return this._orientationY}get orientationZ(){return this._orientationZ}get panningModel(){return this._nativePannerNode.panningModel}set panningModel(t){this._nativePannerNode.panningModel=t}get positionX(){return this._positionX}get positionY(){return this._positionY}get positionZ(){return this._positionZ}get refDistance(){return this._nativePannerNode.refDistance}set refDistance(t){this._nativePannerNode.refDistance=t}get rolloffFactor(){return this._nativePannerNode.rolloffFactor}set rolloffFactor(t){this._nativePannerNode.rolloffFactor=t}})(De,Je,Wi,Ui,we,Ce,ni),zi=(t=>(e,{disableNormalization:i,imag:n,real:s})=>{const r=n instanceof Float32Array?n:new Float32Array(n),o=s instanceof Float32Array?s:new Float32Array(s),a=e.createPeriodicWave(o,r,{disableNormalization:i});if(Array.from(n).length<2)throw t();return a})(I),ji=((t,e,i,n)=>class n{constructor(n,s){const r=e(n),o=(t=>{const{imag:e,real:i}=t;return void 0===e?void 0===i?{...t,imag:[0,0],real:[0,0]}:{...t,imag:Array.from(i,(()=>0)),real:i}:void 0===i?{...t,imag:e,real:Array.from(e,(()=>0))}:{...t,imag:e,real:i}})({...$t,...s}),a=t(r,o);return i.add(a),a}static[Symbol.hasInstance](t){return null!==t&&"object"==typeof t&&Object.getPrototypeOf(t)===n.prototype||i.has(t)}})(zi,we,new WeakSet),Xi=((t,e,i,n,s,r)=>{const o=16385,a=new Float32Array([1,1]),l=Math.PI/2,h={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},u={...h,oversample:"none"},c=(t,r,c,d,p)=>{if(1===r)return((t,e,s,r)=>{const c=new Float32Array(o),d=new Float32Array(o);for(let t=0;t{const d=new Float32Array(o),p=new Float32Array(o),f=new Float32Array(o),m=new Float32Array(o),g=Math.floor(8192.5);for(let t=0;tg){const e=(t-g)/(16384-g)*l;d[t]=Math.cos(e),p[t]=Math.sin(e),f[t]=0,m[t]=1}else{const e=t/(16384-g)*l;d[t]=1,p[t]=0,f[t]=Math.cos(e),m[t]=Math.sin(e)}const b=e(t,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),y=i(t,{...h,gain:0}),S=n(t,{...u,curve:d}),v=i(t,{...h,gain:0}),_=n(t,{...u,curve:p}),x=n(t,{...u,curve:a}),E=i(t,{...h,gain:0}),M=n(t,{...u,curve:f}),w=i(t,{...h,gain:0}),P=n(t,{...u,curve:m});return{connectGraph(){s.connect(b),s.connect(void 0===x.inputs?x:x.inputs[0]),b.connect(y,0),b.connect(v,0),b.connect(E,1),b.connect(w,1),x.connect(r),r.connect(void 0===S.inputs?S:S.inputs[0]),r.connect(void 0===_.inputs?_:_.inputs[0]),r.connect(void 0===M.inputs?M:M.inputs[0]),r.connect(void 0===P.inputs?P:P.inputs[0]),S.connect(y.gain),_.connect(v.gain),M.connect(E.gain),P.connect(w.gain),y.connect(c,0,0),E.connect(c,0,0),v.connect(c,0,1),w.connect(c,0,1)},disconnectGraph(){s.disconnect(b),s.disconnect(void 0===x.inputs?x:x.inputs[0]),b.disconnect(y,0),b.disconnect(v,0),b.disconnect(E,1),b.disconnect(w,1),x.disconnect(r),r.disconnect(void 0===S.inputs?S:S.inputs[0]),r.disconnect(void 0===_.inputs?_:_.inputs[0]),r.disconnect(void 0===M.inputs?M:M.inputs[0]),r.disconnect(void 0===P.inputs?P:P.inputs[0]),S.disconnect(y.gain),_.disconnect(v.gain),M.disconnect(E.gain),P.disconnect(w.gain),y.disconnect(c,0,0),E.disconnect(c,0,0),v.disconnect(c,0,1),w.disconnect(c,0,1)}}})(t,c,d,p);throw s()};return(e,{channelCount:n,channelCountMode:o,pan:a,...l})=>{if("max"===o)throw s();const h=t(e,{...l,channelCount:1,channelCountMode:o,numberOfInputs:2}),u=i(e,{...l,channelCount:n,channelCountMode:o,gain:1}),d=i(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:a});let{connectGraph:p,disconnectGraph:f}=c(e,n,u,d,h);Object.defineProperty(d.gain,"defaultValue",{get:()=>0}),Object.defineProperty(d.gain,"maxValue",{get:()=>1}),Object.defineProperty(d.gain,"minValue",{get:()=>-1});const m={get bufferSize(){},get channelCount(){return u.channelCount},set channelCount(t){u.channelCount!==t&&(g&&f(),({connectGraph:p,disconnectGraph:f}=c(e,t,u,d,h)),g&&p()),u.channelCount=t},get channelCountMode(){return u.channelCountMode},set channelCountMode(t){if("clamped-max"===t||"max"===t)throw s();u.channelCountMode=t},get channelInterpretation(){return u.channelInterpretation},set channelInterpretation(t){u.channelInterpretation=t},get context(){return u.context},get inputs(){return[u]},get numberOfInputs(){return u.numberOfInputs},get numberOfOutputs(){return u.numberOfOutputs},get pan(){return d.gain},addEventListener:(...t)=>u.addEventListener(t[0],t[1],t[2]),dispatchEvent:(...t)=>u.dispatchEvent(t[0]),removeEventListener:(...t)=>u.removeEventListener(t[0],t[1],t[2])};let g=!1;return r(Wt(m,h),(()=>{p(),g=!0}),(()=>{f(),g=!1}))}})(ai,Gt,Ht,Vi,Yt,ri),Yi=((t,e)=>(i,n)=>{const s=n.channelCountMode;if("clamped-max"===s)throw e();if(void 0===i.createStereoPanner)return t(i,n);const r=i.createStereoPanner();return Nt(r,n),Ot(r,n,"pan"),Object.defineProperty(r,"channelCountMode",{get:()=>s,set:t=>{if(t!==s)throw e()}}),r})(Xi,Yt),Ki=((t,e,i,n,s)=>()=>{const r=new WeakMap;return{render(o,a){const l=r.get(a);return void 0!==l?Promise.resolve(l):(async(o,a)=>{let l=i(o);const h=C(l,a);if(!h){const t={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,pan:l.pan.value};l=e(a,t)}return r.set(a,l),h?await t(a,o.pan,l.pan):await n(a,o.pan,l.pan),Y(l)?await s(o,a,l.inputs[0]):await s(o,a,l),l})(o,a)}}})(Ke,Yi,Q,Ze,Ee),qi=((t,e,i,n,s,r)=>class extends t{constructor(t,o){const a=s(t),l={...Jt,...o},h=i(a,l),u=r(a);super(t,!1,h,u?n():null),this._pan=e(this,u,h.pan)}get pan(){return this._pan}})(De,Je,Yi,Ki,we,Ce),Zi=((t,e,i)=>()=>{const n=new WeakMap;return{render(s,r){const o=n.get(r);return void 0!==o?Promise.resolve(o):(async(s,r)=>{let o=e(s);if(!C(o,r)){const e={channelCount:o.channelCount,channelCountMode:o.channelCountMode,channelInterpretation:o.channelInterpretation,curve:o.curve,oversample:o.oversample};o=t(r,e)}return n.set(r,o),Y(o)?await i(s,r,o.inputs[0]):await i(s,r,o),o})(s,r)}}})(Vi,Q,Ee),$i=((t,e,i,n,s,r,o)=>class extends t{constructor(t,e){const a=s(t),l={...te,...e},h=i(a,l);super(t,!0,h,r(a)?n():null),this._isCurveNullified=!1,this._nativeWaveShaperNode=h,o(this,1)}get curve(){return this._isCurveNullified?null:this._nativeWaveShaperNode.curve}set curve(t){if(null===t)this._isCurveNullified=!0,this._nativeWaveShaperNode.curve=new Float32Array([0,0]);else{if(t.length<2)throw e();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=t}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(t){this._nativeWaveShaperNode.oversample=t}})(De,wt,Vi,Zi,we,Ce,ni),Ji=(t=>null!==t&&t.isSecureContext)(ve),Qi=(t=>(e,i,n)=>{Object.defineProperties(t,{currentFrame:{configurable:!0,get:()=>Math.round(e*i)},currentTime:{configurable:!0,get:()=>e}});try{return n()}finally{null!==t&&(delete t.currentFrame,delete t.currentTime)}})(ve),tn=new WeakMap,en=((t,e)=>i=>{let n=t.get(i);if(void 0!==n)return n;if(null===e)throw new Error("Missing the native OfflineAudioContext constructor.");return n=new e(1,1,44100),t.set(i,n),n})(tn,Te),nn=Ji?((t,e,i,n,s,r,o,a,l,h,u,c,p)=>{let f=0;return(m,S,v={credentials:"omit"})=>{const _=u.get(m);if(void 0!==_&&_.has(S))return Promise.resolve();const x=h.get(m);if(void 0!==x){const t=x.get(S);if(void 0!==t)return t}const E=r(m),M=void 0===E.audioWorklet?s(S).then((([t,e])=>{const[n,s]=g(t,e);return i(`${n};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${s}\n})})(window,'_AWGS')`)})).then((()=>{const t=p._AWGS.pop();if(void 0===t)throw new SyntaxError;n(E.currentTime,E.sampleRate,(()=>t(class{},void 0,((t,i)=>{if(""===t.trim())throw e();const n=d.get(E);if(void 0!==n){if(n.has(t))throw e();y(i),b(i.parameterDescriptors),n.set(t,i)}else y(i),b(i.parameterDescriptors),d.set(E,new Map([[t,i]]))}),E.sampleRate,void 0,void 0)))})):Promise.all([s(S),Promise.resolve(t(c,c))]).then((([[t,e],i])=>{const n=f+1;f=n;const[s,r]=g(t,e),h=new Blob([`${s};((AudioWorkletProcessor,registerProcessor)=>{${r}\n})(${i?"AudioWorkletProcessor":"class extends AudioWorkletProcessor {__b=new WeakSet();constructor(){super();(p=>p.postMessage=(q=>(m,t)=>q.call(p,m,t?t.filter(u=>!this.__b.has(u)):t))(p.postMessage))(this.port)}}"},(n,p)=>registerProcessor(n,class extends p{${i?"":"__c = (a) => a.forEach(e=>this.__b.add(e.buffer));"}process(i,o,p){${i?"":"i.forEach(this.__c);o.forEach(this.__c);this.__c(Object.values(p));"}return super.process(i.map(j=>j.some(k=>k.length===0)?[]:j),o,p)}}));registerProcessor('__sac${n}',class extends AudioWorkletProcessor{process(){return !1}})`],{type:"application/javascript; charset=utf-8"}),u=URL.createObjectURL(h);return E.audioWorklet.addModule(u,v).then((()=>{if(a(E))return E;const t=o(E);return t.audioWorklet.addModule(u,v).then((()=>t))})).then((t=>{if(null===l)throw new SyntaxError;try{new l(t,`__sac${n}`)}catch{throw new SyntaxError}})).finally((()=>URL.revokeObjectURL(u)))}));return void 0===x?h.set(m,new Map([[S,M]])):x.set(S,M),M.then((()=>{const t=u.get(m);void 0===t?u.set(m,new Set([S])):t.add(S)})).finally((()=>{const t=h.get(m);void 0!==t&&t.delete(S)})),M}})(be,Yt,(t=>e=>new Promise(((i,n)=>{if(null===t)return void n(new SyntaxError);const s=t.document.head;if(null===s)n(new SyntaxError);else{const r=t.document.createElement("script"),o=new Blob([e],{type:"application/javascript"}),a=URL.createObjectURL(o),l=t.onerror,h=()=>{t.onerror=l,URL.revokeObjectURL(a)};t.onerror=(e,i,s,r,o)=>i===a||i===t.location.href&&1===s&&1===r?(h(),n(o),!1):null!==l?l(e,i,s,r,o):void 0,r.onerror=()=>{h(),n(new SyntaxError)},r.onload=()=>{h(),i()},r.src=a,r.type="module",s.appendChild(r)}})))(ve),Qi,(async t=>{try{const e=await fetch(t);if(e.ok)return[await e.text(),e.url]}catch{}throw new DOMException("","AbortError")}),we,en,Ce,Oe,new WeakMap,new WeakMap,((t,e)=>async()=>{if(null===t)return!0;if(null===e)return!1;const i=new Blob(['class A extends AudioWorkletProcessor{process(i){this.port.postMessage(i,[i[0][0].buffer])}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),n=new e(1,128,44100),s=URL.createObjectURL(i);let r=!1,o=!1;try{await n.audioWorklet.addModule(s);const e=new t(n,"a",{numberOfOutputs:0}),i=n.createOscillator();e.port.onmessage=()=>r=!0,e.onprocessorerror=()=>o=!0,i.connect(e),i.start(0),await n.startRendering(),await new Promise((t=>setTimeout(t)))}catch{}finally{URL.revokeObjectURL(s)}return r&&!o})(Oe,Te),ve):void 0,sn=((t,e)=>i=>t(i)||e(i))(Re,Ce),rn=((t,e,i,n,s,r,o,a,l,h,u)=>(i,n)=>{const c=o(i)?i:r(i);if(s.has(n)){const t=new DOMException("","DataCloneError");return Promise.reject(t)}try{s.add(n)}catch{}return e(l,(()=>l(c)))?c.decodeAudioData(n).then((i=>(vt(n).catch((()=>{})),e(a,(()=>a(i)))||u(i),t.add(i),i))):new Promise(((e,i)=>{const s=async()=>{try{await vt(n)}catch{}},r=t=>{i(t),s()};try{c.decodeAudioData(n,(i=>{"function"!=typeof i.copyFromChannel&&(h(i),L(i)),t.add(i),s().then((()=>e(i)))}),(t=>{r(null===t?new DOMException("","EncodingError"):t)}))}catch(t){r(t)}}))})(Ve,be,0,0,new WeakSet,we,sn,A,It,He,ze),on=((t,e,i,n,s,r,o,a,l,h,u,c,d,p,f,m,g,b,y,S)=>class extends f{constructor(e,i){super(e,i),this._nativeContext=e,this._audioWorklet=void 0===t?void 0:{addModule:(e,i)=>t(this,e,i)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new e(this)}createBiquadFilter(){return new s(this)}createBuffer(t,e,n){return new i({length:e,numberOfChannels:t,sampleRate:n})}createBufferSource(){return new n(this)}createChannelMerger(t=6){return new r(this,{numberOfInputs:t})}createChannelSplitter(t=6){return new o(this,{numberOfOutputs:t})}createConstantSource(){return new a(this)}createConvolver(){return new l(this)}createDelay(t=1){return new u(this,{maxDelayTime:t})}createDynamicsCompressor(){return new c(this)}createGain(){return new d(this)}createIIRFilter(t,e){return new p(this,{feedback:e,feedforward:t})}createOscillator(){return new m(this)}createPanner(){return new g(this)}createPeriodicWave(t,e,i={disableNormalization:!1}){return new b(this,{...i,imag:e,real:t})}createStereoPanner(){return new y(this)}createWaveShaper(){return new S(this)}decodeAudioData(t,e,i){return h(this._nativeContext,t).then((t=>("function"==typeof e&&e(t),t)),(t=>{throw"function"==typeof i&&i(t),t}))}})(nn,Fe,je,ti,si,hi,ci,mi,yi,rn,vi,Ei,wi,Ii,Ni,Di,Hi,ji,qi,$i),an=((t,e,i,n)=>class extends t{constructor(t,e){const s=i(t),r=((t,e)=>t.createMediaElementSource(e.mediaElement))(s,e);if(n(s))throw TypeError();super(t,!0,r,null),this._nativeMediaElementAudioSourceNode=r}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}})(De,0,we,Ce),ln=((t,e,i,n)=>class extends t{constructor(t,e){const s=i(t);if(n(s))throw new TypeError;const r=((t,e)=>{const i=t.createMediaStreamDestination();return Nt(i,e),1===i.numberOfOutputs&&Object.defineProperty(i,"numberOfOutputs",{get:()=>0}),i})(s,{...At,...e});super(t,!1,r,null),this._nativeMediaStreamAudioDestinationNode=r}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}})(De,0,we,Ce),hn=((t,e,i,n)=>class extends t{constructor(t,e){const s=i(t),r=((t,{mediaStream:e})=>{const i=e.getAudioTracks();i.sort(((t,e)=>t.ide.id?1:0));const n=i.slice(0,1),s=t.createMediaStreamSource(new MediaStream(n));return Object.defineProperty(s,"mediaStream",{value:e}),s})(s,e);if(n(s))throw new TypeError;super(t,!0,r,null),this._nativeMediaStreamAudioSourceNode=r}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}})(De,0,we,Ce),un=((t,e)=>(i,{mediaStreamTrack:n})=>{if("function"==typeof i.createMediaStreamTrackSource)return i.createMediaStreamTrackSource(n);const s=new MediaStream([n]),r=i.createMediaStreamSource(s);if("audio"!==n.kind)throw t();if(e(i))throw new TypeError;return r})(wt,Ce),cn=((t,e,i)=>class extends t{constructor(t,n){const s=i(t);super(t,!0,e(s,n),null)}})(De,un,we),dn=((t,e,i,n,s,r,o,a,l)=>class extends t{constructor(t={}){if(null===l)throw new Error("Missing the native AudioContext constructor.");let e;try{e=new l(t)}catch(t){if(12===t.code&&"sampleRate is not in range"===t.message)throw i();throw t}if(null===e)throw n();if(!W(t.latencyHint))throw new TypeError(`The provided value '${t.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(void 0!==t.sampleRate&&e.sampleRate!==t.sampleRate)throw i();super(e,2);const{latencyHint:s}=t,{sampleRate:r}=e;if(this._baseLatency="number"==typeof e.baseLatency?e.baseLatency:"balanced"===s?512/r:"interactive"===s||void 0===s?256/r:"playback"===s?1024/r:128*Math.max(2,Math.min(128,Math.round(s*r/128)))/r,this._nativeAudioContext=e,"webkitAudioContext"===l.name?(this._nativeGainNode=e.createGain(),this._nativeOscillatorNode=e.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(e.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,"running"===e.state){this._state="suspended";const t=()=>{"suspended"===this._state&&(this._state=null),e.removeEventListener("statechange",t)};e.addEventListener("statechange",t)}}get baseLatency(){return this._baseLatency}get state(){return null!==this._state?this._state:this._nativeAudioContext.state}close(){return"closed"===this.state?this._nativeAudioContext.close().then((()=>{throw e()})):("suspended"===this._state&&(this._state=null),this._nativeAudioContext.close().then((()=>{null!==this._nativeGainNode&&null!==this._nativeOscillatorNode&&(this._nativeOscillatorNode.stop(),this._nativeGainNode.disconnect(),this._nativeOscillatorNode.disconnect()),G(this)})))}createMediaElementSource(t){return new s(this,{mediaElement:t})}createMediaStreamDestination(){return new r(this)}createMediaStreamSource(t){return new o(this,{mediaStream:t})}createMediaStreamTrackSource(t){return new a(this,{mediaStreamTrack:t})}resume(){return"suspended"===this._state?new Promise(((t,e)=>{const i=()=>{this._nativeAudioContext.removeEventListener("statechange",i),"running"===this._nativeAudioContext.state?t():this.resume().then(t,e)};this._nativeAudioContext.addEventListener("statechange",i)})):this._nativeAudioContext.resume().catch((t=>{if(void 0===t||15===t.code)throw e();throw t}))}suspend(){return this._nativeAudioContext.suspend().catch((t=>{if(void 0===t)throw e();throw t}))}})(on,wt,Yt,Qt,an,ln,hn,cn,Le),pn=(t=>e=>{const i=t.get(e);if(void 0===i)throw new Error("The context has no set of AudioWorkletNodes.");return i})(Ri),fn=(t=>(e,i)=>{t(e).add(i)})(pn),mn=(t=>(e,i,n=0,s=0)=>{const r=e[n];if(void 0===r)throw t();return rt(i)?r.connect(i,0,s):r.connect(i,0)})(I),gn=(t=>(e,i)=>{t(e).delete(i)})(pn),bn=(t=>(e,i=void 0,n=void 0,s=0)=>void 0===i?e.forEach((t=>t.disconnect())):"number"==typeof i?xt(t,e,i).disconnect():rt(i)?void 0===n?e.forEach((t=>t.disconnect(i))):void 0===s?xt(t,e,n).disconnect(i,0):xt(t,e,n).disconnect(i,0,s):void 0===n?e.forEach((t=>t.disconnect(i))):xt(t,e,n).disconnect(i,0))(I),yn=new WeakMap,Sn=((t,e)=>i=>e(t,i))(yn,S),vn=((t,e,i,n,s,r,o,a,l,h,u,c,d)=>(f,m,g,b)=>{if(0===b.numberOfInputs&&0===b.numberOfOutputs)throw l();const y=Array.isArray(b.outputChannelCount)?b.outputChannelCount:Array.from(b.outputChannelCount);if(y.some((t=>t<1)))throw l();if(y.length!==b.numberOfOutputs)throw e();if("explicit"!==b.channelCountMode)throw l();const S=b.channelCount*b.numberOfInputs,v=y.reduce(((t,e)=>t+e),0),_=void 0===g.parameterDescriptors?0:g.parameterDescriptors.length;if(S+_>6||v>6)throw l();const x=new MessageChannel,E=[],M=[];for(let t=0;tvoid 0===t?0:t},maxValue:{get:()=>void 0===e?k:e},minValue:{get:()=>void 0===i?N:i}}),w.push(s)}const P=n(f,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,S+_)}),T=Ft(m,f.sampleRate),C=a(f,T,S+_,Math.max(1,v)),A=s(f,{channelCount:Math.max(1,v),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,v)}),I=[];for(let t=0;t{const i=w[e];return i.connect(P,0,S+e),i.start(0),[t,i.offset]})));P.connect(C);let R=b.channelInterpretation,O=null;const D=0===b.numberOfOutputs?[C]:I,B={get bufferSize(){return T},get channelCount(){return b.channelCount},set channelCount(t){throw i()},get channelCountMode(){return b.channelCountMode},set channelCountMode(t){throw i()},get channelInterpretation(){return R},set channelInterpretation(t){for(const e of E)e.channelInterpretation=t;R=t},get context(){return C.context},get inputs(){return E},get numberOfInputs(){return b.numberOfInputs},get numberOfOutputs(){return b.numberOfOutputs},get onprocessorerror(){return O},set onprocessorerror(t){"function"==typeof O&&B.removeEventListener("processorerror",O),O="function"==typeof t?t:null,"function"==typeof O&&B.addEventListener("processorerror",O)},get parameters(){return L},get port(){return x.port2},addEventListener:(...t)=>C.addEventListener(t[0],t[1],t[2]),connect:t.bind(null,D),disconnect:h.bind(null,D),dispatchEvent:(...t)=>C.dispatchEvent(t[0]),removeEventListener:(...t)=>C.removeEventListener(t[0],t[1],t[2])},F=new Map;var V,G;x.port1.addEventListener=(V=x.port1.addEventListener,(...t)=>{if("message"===t[0]){const e="function"==typeof t[1]?t[1]:"object"==typeof t[1]&&null!==t[1]&&"function"==typeof t[1].handleEvent?t[1].handleEvent:null;if(null!==e){const i=F.get(t[1]);void 0!==i?t[1]=i:(t[1]=t=>{u(f.currentTime,f.sampleRate,(()=>e(t)))},F.set(e,t[1]))}}return V.call(x.port1,t[0],t[1],t[2])}),x.port1.removeEventListener=(G=x.port1.removeEventListener,(...t)=>{if("message"===t[0]){const e=F.get(t[1]);void 0!==e&&(F.delete(t[1]),t[1]=e)}return G.call(x.port1,t[0],t[1],t[2])});let W=null;Object.defineProperty(x.port1,"onmessage",{get:()=>W,set:t=>{"function"==typeof W&&x.port1.removeEventListener("message",W),W="function"==typeof t?t:null,"function"==typeof W&&(x.port1.addEventListener("message",W),x.port1.start())}}),g.prototype.port=x.port1;let U=null;const H=((t,e,i,n)=>{let s=p.get(t);void 0===s&&(s=new WeakMap,p.set(t,s));const r=(async(t,e)=>{const i=await(t=>new Promise(((e,i)=>{const{port1:n,port2:s}=new MessageChannel;n.onmessage=({data:t})=>{n.close(),s.close(),e(t)},n.onmessageerror=({data:t})=>{n.close(),s.close(),i(t)},s.postMessage(t)})))(e);return new t(i)})(i,n);return s.set(e,r),r})(f,B,g,b);H.then((t=>U=t));const z=pt(b.numberOfInputs,b.channelCount),j=pt(b.numberOfOutputs,y),X=void 0===g.parameterDescriptors?[]:g.parameterDescriptors.reduce(((t,{name:e})=>({...t,[e]:new Float32Array(128)})),{});let Y=!0;const K=()=>{b.numberOfOutputs>0&&C.disconnect(A);for(let t=0,e=0;t{if(null!==U){const i=c(B);for(let n=0;n{ct(t,X,e,S+i,n)}));for(let t=0;t{if(i[e].size>0)return q.set(e,T/128),t;const n=q.get(e);return void 0===n?[]:(t.every((t=>t.every((t=>0===t))))&&(1===n?q.delete(e):q.set(e,n-1)),t)})),s=u(f.currentTime+n/f.sampleRate,f.sampleRate,(()=>U.process(t,j,X)));Y=s;for(let t=0,i=0;tC.connect($).connect(f.destination),Q=()=>{C.disconnect($),$.disconnect()};return J(),d(B,(()=>{if(Y){Q(),b.numberOfOutputs>0&&C.connect(A);for(let t=0,e=0;t{Y&&(J(),K()),Z=!1}))})(mn,I,wt,ai,Gt,pi,Ht,Xt,Yt,bn,Qi,Sn,ri),_n=((t,e,i,n,s)=>(r,o,a,l,h,u)=>{if(null!==a)try{const e=new a(r,l,u),n=new Map;let o=null;if(Object.defineProperties(e,{channelCount:{get:()=>u.channelCount,set:()=>{throw t()}},channelCountMode:{get:()=>"explicit",set:()=>{throw t()}},onprocessorerror:{get:()=>o,set:t=>{"function"==typeof o&&e.removeEventListener("processorerror",o),o="function"==typeof t?t:null,"function"==typeof o&&e.addEventListener("processorerror",o)}}}),e.addEventListener=(d=e.addEventListener,(...t)=>{if("processorerror"===t[0]){const e="function"==typeof t[1]?t[1]:"object"==typeof t[1]&&null!==t[1]&&"function"==typeof t[1].handleEvent?t[1].handleEvent:null;if(null!==e){const i=n.get(t[1]);void 0!==i?t[1]=i:(t[1]=i=>{"error"===i.type?(Object.defineProperties(i,{type:{value:"processorerror"}}),e(i)):e(new ErrorEvent(t[0],{...i}))},n.set(e,t[1]))}}return d.call(e,"error",t[1],t[2]),d.call(e,...t)}),e.removeEventListener=(c=e.removeEventListener,(...t)=>{if("processorerror"===t[0]){const e=n.get(t[1]);void 0!==e&&(n.delete(t[1]),t[1]=e)}return c.call(e,"error",t[1],t[2]),c.call(e,t[0],t[1],t[2])}),0!==u.numberOfOutputs){const t=i(r,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return e.connect(t).connect(r.destination),s(e,(()=>t.disconnect()),(()=>t.connect(r.destination)))}return e}catch(t){if(11===t.code)throw n();throw t}var c,d;if(void 0===h)throw n();return(t=>{const{port1:e}=new MessageChannel;try{e.postMessage(t)}finally{e.close()}})(u),e(r,o,h,u)})(wt,vn,Ht,Yt,ri),xn=((t,e,i,n,s,r,o,a,l,h,u,c,d,p,f,m)=>(g,b,y)=>{const S=new WeakMap;let v=null;return{render(_,x){a(x,_);const E=S.get(x);return void 0!==E?Promise.resolve(E):(async(a,_)=>{let x=u(a),E=null;const M=C(x,_),w=Array.isArray(b.outputChannelCount)?b.outputChannelCount:Array.from(b.outputChannelCount);if(null===c){const t=w.reduce(((t,e)=>t+e),0),i=s(_,{channelCount:Math.max(1,t),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,t)}),r=[];for(let t=0;t{const l=new d(i,128*Math.ceil(a.context.length/128),_.sampleRate),h=[],u=[];for(let t=0;t{const e=r(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:t.value});return await p(l,t,e.offset),e}))),g=n(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,t+e)});for(let t=0;tf(a,l,t)))),m(l)};v=ft(a,0===i?null:await l(),_,b,w,y,h)}const t=await v,e=i(_,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[l,u,c]=E;null!==t&&(e.buffer=t,e.start(0)),e.connect(l);for(let t=0,e=0;te=>t.get(e))(tn),Mn=(t=>(e,i)=>{t.set(e,i)})(yn),wn=Ji?((t,e,i,n,s,r,o,a,l,h,u,c,p,f)=>class extends e{constructor(e,u,p){var f;const m=a(e),g=l(m),b=(t=>({...t,outputChannelCount:void 0!==t.outputChannelCount?t.outputChannelCount:1===t.numberOfInputs&&1===t.numberOfOutputs?[t.channelCount]:Array.from({length:t.numberOfOutputs},(()=>1))}))({...ut,...p});(t=>{const{port1:e,port2:i}=new MessageChannel;try{e.postMessage(t)}finally{e.close(),i.close()}})(b);const y=d.get(m),S=null==y?void 0:y.get(u),v=g||"closed"!==m.state?m:null!==(f=o(m))&&void 0!==f?f:m,_=s(v,g?null:e.baseLatency,h,u,S,b);super(e,!0,_,g?n(u,b,S):null);const x=[];_.parameters.forEach(((t,e)=>{const n=i(this,g,t);x.push([e,n])})),this._nativeAudioWorkletNode=_,this._onprocessorerror=null,this._parameters=new ht(x),g&&t(m,this);const{activeInputs:E}=r(this);c(_,E)}get onprocessorerror(){return this._onprocessorerror}set onprocessorerror(t){const e="function"==typeof t?f(this,t):null;this._nativeAudioWorkletNode.onprocessorerror=e;const i=this._nativeAudioWorkletNode.onprocessorerror;this._onprocessorerror=null!==i&&i===e?t:i}get parameters(){return null===this._parameters?this._nativeAudioWorkletNode.parameters:this._parameters}get port(){return this._nativeAudioWorkletNode.port}})(fn,De,Je,xn,_n,B,En,we,Ce,Oe,0,Mn,0,ce):void 0,Pn=((t,e,i,n,s)=>class extends n{constructor(t={}){if(null===s)throw new Error("Missing the native AudioContext constructor.");let n;try{n=new s(t)}catch(t){if(12===t.code&&"sampleRate is not in range"===t.message)throw e();throw t}if(null===n)throw i();if(!W(t.latencyHint))throw new TypeError(`The provided value '${t.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(void 0!==t.sampleRate&&n.sampleRate!==t.sampleRate)throw e();super(n,2);const{latencyHint:r}=t,{sampleRate:o}=n;if(this._baseLatency="number"==typeof n.baseLatency?n.baseLatency:"balanced"===r?512/o:"interactive"===r||void 0===r?256/o:"playback"===r?1024/o:128*Math.max(2,Math.min(128,Math.round(r*o/128)))/o,this._nativeAudioContext=n,"webkitAudioContext"===s.name?(this._nativeGainNode=n.createGain(),this._nativeOscillatorNode=n.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(n.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,"running"===n.state){this._state="suspended";const t=()=>{"suspended"===this._state&&(this._state=null),n.removeEventListener("statechange",t)};n.addEventListener("statechange",t)}}get baseLatency(){return this._baseLatency}get state(){return null!==this._state?this._state:this._nativeAudioContext.state}close(){return"closed"===this.state?this._nativeAudioContext.close().then((()=>{throw t()})):("suspended"===this._state&&(this._state=null),this._nativeAudioContext.close().then((()=>{null!==this._nativeGainNode&&null!==this._nativeOscillatorNode&&(this._nativeOscillatorNode.stop(),this._nativeGainNode.disconnect(),this._nativeOscillatorNode.disconnect()),G(this)})))}resume(){return"suspended"===this._state?new Promise(((t,e)=>{const i=()=>{this._nativeAudioContext.removeEventListener("statechange",i),"running"===this._nativeAudioContext.state?t():this.resume().then(t,e)};this._nativeAudioContext.addEventListener("statechange",i)})):this._nativeAudioContext.resume().catch((e=>{if(void 0===e||15===e.code)throw t();throw e}))}suspend(){return this._nativeAudioContext.suspend().catch((e=>{if(void 0===e)throw t();throw e}))}})(wt,Yt,Qt,Ni,Le),Tn=((t,e)=>(i,n,s)=>{if(null===e)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new e(i,n,s)}catch(e){if("SyntaxError"===e.name)throw t();throw e}})(Yt,Te),Cn=((t,e,i,n,s,r,o,a)=>(l,h)=>i(l).render(l,h).then((()=>Promise.all(Array.from(n(h)).map((t=>i(t).render(t,h)))))).then((()=>s(h))).then((i=>("function"!=typeof i.copyFromChannel?(o(i),L(i)):e(r,(()=>r(i)))||a(i),t.add(i),i))))(Ve,be,xe,pn,Ti,A,He,ze),An=((t,e,i,n,s)=>class extends n{constructor(e){const{length:n,numberOfChannels:s,sampleRate:r}={...Lt,...e},o=i(s,n,r);t(It,(()=>It(o)))||o.addEventListener("statechange",(()=>{let t=0;const e=i=>{"running"===this._state&&(t>0?(o.removeEventListener("statechange",e),i.stopImmediatePropagation(),this._waitForThePromiseToSettle(i)):t+=1)};return e})()),super(o,s),this._length=n,this._nativeOfflineAudioContext=o,this._state=null}get length(){return void 0===this._nativeOfflineAudioContext.length?this._length:this._nativeOfflineAudioContext.length}get state(){return null===this._state?this._nativeOfflineAudioContext.state:this._state}startRendering(){return"running"===this._state?Promise.reject(e()):(this._state="running",s(this.destination,this._nativeOfflineAudioContext).finally((()=>{this._state=null,G(this)})))}_waitForThePromiseToSettle(t){null===this._state?this._nativeOfflineAudioContext.dispatchEvent(t):setTimeout((()=>this._waitForThePromiseToSettle(t)))}})(be,wt,Tn,Ni,Cn),In=((t,e,i,n,s)=>class extends t{constructor(t,i,s){let r;if("number"==typeof t&&void 0!==i&&void 0!==s)r={length:i,numberOfChannels:t,sampleRate:s};else{if("object"!=typeof t)throw new Error("The given parameters are not valid.");r=t}const{length:o,numberOfChannels:a,sampleRate:l}={...Kt,...r},h=n(a,o,l);e(It,(()=>It(h)))||h.addEventListener("statechange",(()=>{let t=0;const e=i=>{"running"===this._state&&(t>0?(h.removeEventListener("statechange",e),i.stopImmediatePropagation(),this._waitForThePromiseToSettle(i)):t+=1)};return e})()),super(h,a),this._length=o,this._nativeOfflineAudioContext=h,this._state=null}get length(){return void 0===this._nativeOfflineAudioContext.length?this._length:this._nativeOfflineAudioContext.length}get state(){return null===this._state?this._nativeOfflineAudioContext.state:this._state}startRendering(){return"running"===this._state?Promise.reject(i()):(this._state="running",s(this.destination,this._nativeOfflineAudioContext).finally((()=>{this._state=null,G(this)})))}_waitForThePromiseToSettle(t){null===this._state?this._nativeOfflineAudioContext.dispatchEvent(t):setTimeout((()=>this._waitForThePromiseToSettle(t)))}})(on,be,wt,Tn,Cn),Ln=((t,e)=>i=>{const n=t.get(i);return e(n)||e(i)})(h,Re),Rn=((t,e)=>i=>t.has(i)||e(i))(o,Ne),Nn=((t,e)=>i=>t.has(i)||e(i))(l,ke),kn=((t,e)=>i=>{const n=t.get(i);return e(n)||e(i)})(h,Ce),On=()=>(async(t,e,i,n,s,r,o,a,l,h,u,c,d,p,f,m)=>!!(t(e,e)&&t(i,i)&&t(s,s)&&t(r,r)&&t(a,a)&&t(l,l)&&t(h,h)&&t(u,u)&&t(c,c)&&t(d,d)&&t(p,p))&&(await Promise.all([t(n,n),t(o,o),t(f,f),t(m,m)])).every((t=>t)))(be,(t=>()=>{if(null===t)return!1;const e=new t(1,1,44100).createBuffer(1,1,44100);if(void 0===e.copyToChannel)return!0;const i=new Float32Array(2);try{e.copyFromChannel(i,0,0)}catch{return!1}return!0})(Te),(t=>()=>{if(null===t)return!1;if(void 0!==t.prototype&&void 0!==t.prototype.close)return!0;const e=new t,i=void 0!==e.close;try{e.close()}catch{}return i})(Le),(t=>()=>{if(null===t)return Promise.resolve(!1);const e=new t(1,1,44100);return new Promise((t=>{let i=!0;const n=n=>{i&&(i=!1,e.startRendering(),t(n instanceof TypeError))};let s;try{s=e.decodeAudioData(null,(()=>{}),n)}catch(t){n(t)}void 0!==s&&s.catch(n)}))})(Te),(t=>()=>{if(null===t)return!1;let e;try{e=new t({latencyHint:"balanced"})}catch{return!1}return e.close(),!0})(Le),(t=>()=>{if(null===t)return!1;const e=new t(1,1,44100).createGain(),i=e.connect(e)===e;return e.disconnect(e),i})(Te),((t,e)=>async()=>{if(null===t)return!0;if(null===e)return!1;const i=new Blob(['let c,p;class A extends AudioWorkletProcessor{constructor(){super();this.port.onmessage=(e)=>{p=e.data;p.onmessage=()=>{p.postMessage(c);p.close()};this.port.postMessage(0)}}process(){c=1}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),n=new MessageChannel,s=new e(1,128,44100),r=URL.createObjectURL(i);let o=!1;try{await s.audioWorklet.addModule(r);const e=new t(s,"a",{numberOfOutputs:0}),i=s.createOscillator();await new Promise((t=>{e.port.onmessage=()=>t(),e.port.postMessage(n.port2,[n.port2])})),e.port.onmessage=()=>o=!0,i.connect(e),i.start(0),await s.startRendering(),o=await new Promise((t=>{n.port1.onmessage=({data:e})=>t(1===e),n.port1.postMessage(0)}))}catch{}finally{n.port1.close(),URL.revokeObjectURL(r)}return o})(Oe,Te),(t=>()=>{if(null===t)return!1;const e=new t(1,1,44100).createChannelMerger();if("max"===e.channelCountMode)return!0;try{e.channelCount=2}catch{return!0}return!1})(Te),(t=>()=>{if(null===t)return!1;const e=new t(1,1,44100);return void 0===e.createConstantSource||e.createConstantSource().offset.maxValue!==Number.POSITIVE_INFINITY})(Te),(t=>()=>{if(null===t)return!1;const e=new t(1,1,44100),i=e.createConvolver();i.buffer=e.createBuffer(1,1,e.sampleRate);try{i.buffer=e.createBuffer(1,1,e.sampleRate)}catch{return!1}return!0})(Te),(t=>()=>{if(null===t)return!1;const e=new t(1,1,44100).createConvolver();try{e.channelCount=1}catch{return!1}return!0})(Te),le,(t=>()=>null!==t&&t.hasOwnProperty("isSecureContext"))(ve),(t=>()=>{if(null===t)return!1;const e=new t;try{return e.createMediaStreamSource(new MediaStream),!1}catch(t){return!0}finally{e.close()}})(Le),(t=>()=>{if(null===t)return Promise.resolve(!1);const e=new t(1,1,44100);if(void 0===e.createStereoPanner)return Promise.resolve(!0);if(void 0===e.createConstantSource)return Promise.resolve(!0);const i=e.createConstantSource(),n=e.createStereoPanner();return i.channelCount=1,i.offset.value=1,n.channelCount=1,i.start(),i.connect(n).connect(e.destination),e.startRendering().then((t=>1!==t.getChannelData(0)[0]))})(Te),he)},8151:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CursorPosChangedData=void 0,e.CursorPosChangedData=class{constructor(t=0,e=void 0,i=0,n=void 0,s=0){this.ResetOccurred=!1,this.CurrentMeasureIndex=t,this.CurrentRepetition=e,this.CurrentRepetitionIteration=i,this.PredictedPosition=n,this.CurrentBpm=s}}},1797:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Fraction=void 0;class i{constructor(t=0,e=1,i=0,n=!0){this.numerator=0,this.denominator=1,this.wholeValue=0,this.numerator=t,this.denominator=e,this.wholeValue=i,n&&this.simplify(),this.setRealValue()}static max(t,e){return t.RealValue>e.RealValue?t:e}static Equal(t,e){return t.wholeValue===e.wholeValue&&t.Denominator===e.Denominator&&t.Numerator===e.Numerator}static createFromFraction(t){return new i(t.numerator,t.denominator,t.wholeValue,!1)}static plus(t,e){const i=t.clone();return i.Add(e),i}static minus(t,e){const i=t.clone();return i.Sub(e),i}static multiply(t,e){return new i((t.wholeValue*t.denominator+t.numerator)*(e.wholeValue*e.denominator+e.numerator),t.denominator*e.denominator)}static greatestCommonDenominator(t,e){if(0===t)return e;if(1===e)return 1;for(;Math.abs(e)>1e-8;)t>e?t-=e:e-=t;return Math.round(t)}toString(){let t=this.numerator+"/"+this.denominator;return 0!==this.wholeValue&&(t=this.wholeValue+" "+t),t}clone(){return new i(this.numerator,this.denominator,this.wholeValue,!1)}get Numerator(){return this.numerator}set Numerator(t){this.numerator!==t&&(this.numerator=t,this.simplify(),this.setRealValue())}get Denominator(){return this.denominator}set Denominator(t){this.denominator!==t&&(this.denominator=t,0!==this.numerator&&this.simplify(),this.setRealValue())}get WholeValue(){return this.wholeValue}set WholeValue(t){this.wholeValue!==t&&(this.wholeValue=t,this.setRealValue())}GetExpandedNumerator(){return this.wholeValue*this.denominator+this.numerator}calculateNumberOfNeededDots(){let t=1,e=2;const i=this.GetExpandedNumerator();for(;et;)e.Numerator++;if(this.numerator>this.denominator){const n=new i(this.numerator-1,this.denominator,this.wholeValue);for(;n.Denominator>t;)n.Numerator--;if(n.Denominatori.maximumAllowedNumber){const t=this.denominator/i.maximumAllowedNumber;this.numerator=Math.round(this.numerator/t),this.denominator=Math.round(this.denominator/t)}if(this.numerator>i.maximumAllowedNumber){const t=this.numerator/i.maximumAllowedNumber;this.numerator=Math.round(this.numerator/t),this.denominator=Math.round(this.denominator/t)}}isOnBeat(t){const e=this.distanceFromBeat(t);return Math.abs(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Matrix2D=void 0;const n=i(9086);class s{constructor(){this.matrix=[];for(let t=0;t<2;t++){this.matrix[t]=[];for(let e=0;e<2;e++)this.matrix[t][e]=0}}static getRotationMatrix(t){const e=new s,i=Math.cos(t),n=Math.sin(t);return e.matrix[0][0]=i,e.matrix[0][1]=-n,e.matrix[1][0]=n,e.matrix[1][1]=i,e}scalarMultiplication(t){for(let e=0;e<2;e++)for(let i=0;i<2;i++)this.matrix[e][i]*=t}getTransposeMatrix(){const t=new s;for(let e=0;e<2;e++)for(let i=0;i<2;i++)t.matrix[e][i]=this.matrix[i][e];return t}vectorMultiplication(t){const e=new n.PointF2D;return e.x=t.x*this.matrix[0][0]+t.y*this.matrix[0][1],e.y=t.x*this.matrix[1][0]+t.y*this.matrix[1][1],e}}e.Matrix2D=s},9651:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSheetErrors=void 0,e.MusicSheetErrors=class{constructor(){this.measureErrors={},this.errors=[],this.tempErrors=[]}finalizeMeasure(t){let e=this.measureErrors[t];e||(e=[]),this.measureErrors[t]=e.concat(this.tempErrors),this.tempErrors=[]}pushMeasureError(t){this.tempErrors.push(t)}push(t){this.errors.push(t)}}},9855:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OSMDColor=void 0;class i{constructor(t,e,i){this.alpha=255,this.red=t,this.green=e,this.blue=i}static get Black(){return new i(0,0,0)}static get DeepSkyBlue(){return new i(0,191,255)}static get Green(){return new i(20,160,20)}static get Magenta(){return new i(255,0,255)}static get Orange(){return new i(255,128,0)}static get Red(){return new i(240,20,20)}static get Disabled(){return new i(225,225,225)}static get DarkBlue(){return new i(0,0,140)}static get Debug1(){return new i(200,0,140)}static get Debug2(){return new i(100,100,200)}static get Debug3(){return new i(0,50,140)}toHexString(){let t=(256|this.red).toString(16).slice(1)+(256|this.green).toString(16).slice(1)+(256|this.blue).toString(16).slice(1);return t+=(256|this.alpha).toString(16).slice(1),"#"+t}toString(){return"rgba("+this.red+","+this.green+","+this.blue+","+this.alpha+")"}}e.OSMDColor=i},8640:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Pitch=e.AccidentalEnum=e.NoteEnum=void 0;const i={"-2":[4,12,23],"-7":[13],"-9":[6],12:[5,116,55]};var n,s;!function(t){t[t.C=0]="C",t[t.D=2]="D",t[t.E=4]="E",t[t.F=5]="F",t[t.G=7]="G",t[t.A=9]="A",t[t.B=11]="B"}(n=e.NoteEnum||(e.NoteEnum={})),function(t){t[t.SHARP=0]="SHARP",t[t.FLAT=1]="FLAT",t[t.NONE=2]="NONE",t[t.NATURAL=3]="NATURAL",t[t.DOUBLESHARP=4]="DOUBLESHARP",t[t.DOUBLEFLAT=5]="DOUBLEFLAT",t[t.TRIPLESHARP=6]="TRIPLESHARP",t[t.TRIPLEFLAT=7]="TRIPLEFLAT",t[t.QUARTERTONESHARP=8]="QUARTERTONESHARP",t[t.QUARTERTONEFLAT=9]="QUARTERTONEFLAT",t[t.SLASHFLAT=10]="SLASHFLAT",t[t.THREEQUARTERSSHARP=11]="THREEQUARTERSSHARP",t[t.THREEQUARTERSFLAT=12]="THREEQUARTERSFLAT",t[t.SLASHQUARTERSHARP=13]="SLASHQUARTERSHARP",t[t.SLASHSHARP=14]="SLASHSHARP",t[t.DOUBLESLASHFLAT=15]="DOUBLESLASHFLAT",t[t.SORI=16]="SORI",t[t.KORON=17]="KORON"}(s=e.AccidentalEnum||(e.AccidentalEnum={}));class r{constructor(t,e,i,n=void 0){this.accidental=s.NONE,this.fundamentalNote=t,this.octave=e,this.accidental=i,this.accidentalXml=n,this.halfTone=t+12*(e+r.octXmlDiff)+r.HalfTonesFromAccidental(i),this.frequency=r.calcFrequency(this),this.nextFrequency=r.calcFrequency(this,"next"),this.prevFrequency=r.calcFrequency(this,"prev")}static getNoteEnumString(t){switch(t){case n.C:return"C";case n.D:return"D";case n.E:return"E";case n.F:return"F";case n.G:return"G";case n.A:return"A";case n.B:return"B";default:return""}}static lineShiftFromNoteEnum(t,e){if(0===e)return[t,0];const i=r.pitchEnumValues,n=i.indexOf(t);let s=0,o=(n+e)%i.length;return n+e>i.length-1&&(s=1),o<0&&(o=i.length+o,s=-1),[i[o],s]}static CalculateTransposedHalfTone(t,e){const i=t.fundamentalNote+t.AccidentalHalfTones+e;return r.WrapAroundCheck(i,12)}static WrapAroundCheck(t,e){let i=0;for(;t<0;)t+=e,i--;for(;t>=e;)t-=e,i++;return{overflow:i,halftone:t}}static calcFrequency(t,e){let s,o=0;if(t instanceof r){const e=t;o=e.octave-1,s=e.fundamentalNote-n.A+e.AccidentalHalfTones}else"number"==typeof t&&(s=t-57);const a=window.DYSubjectId;let l=0;"COLEXIU"===window.DYEnvironment&&(i[12]=[120]);for(const t in i)if(Object.prototype.hasOwnProperty.call(i,t)&&i[t].includes(a)){l=parseFloat(t);break}5!==a&&55!==a||window.needPitchVoice||(l=0);let h=s+l;return"next"===e&&h++,"prev"===e&&h--,442*Math.pow(2,o)*Math.pow(2,h/12)}static calcFractionalKey(t){return Math.log(t/440)/Math.LN10*r.halftoneFactor+57}static fromFrequency(t){const e=r.calcFractionalKey(t)+.5,i=Math.floor(e/12)-r.octXmlDiff,n=Math.floor(e)%12;let o=n,a=s.NONE;return-1===this.pitchEnumValues.indexOf(o)&&(o=n-1,a=s.SHARP),new r(o,i,a)}static fromHalftone(t){const e=Math.floor(t/12)-r.octXmlDiff,i=t%12;let n=i,o=s.NONE;return-1===this.pitchEnumValues.indexOf(n)&&(n=i-1,o=s.SHARP),new r(n,e,o)}static ceiling(t){let e=t%=12;return-1===this.pitchEnumValues.indexOf(e)&&(e=t+1),e}static floor(t){let e=t%=12;return-1===this.pitchEnumValues.indexOf(e)&&(e=t-1),e}static HalfTonesFromAccidental(t){switch(t){case s.NONE:return 0;case s.SHARP:return 1;case s.FLAT:return-1;case s.NATURAL:return 0;case s.DOUBLESHARP:return 2;case s.DOUBLEFLAT:return-2;case s.TRIPLESHARP:return 3;case s.TRIPLEFLAT:return-3;case s.QUARTERTONESHARP:return.5;case s.QUARTERTONEFLAT:return-.5;case s.SLASHFLAT:return-.51;case s.THREEQUARTERSSHARP:return 1.5;case s.THREEQUARTERSFLAT:return-1.5;case s.SLASHQUARTERSHARP:return.0013;case s.SLASHSHARP:return.0014;case s.DOUBLESLASHFLAT:return-.0015;case s.SORI:return.0016;case s.KORON:return.0017;default:throw new Error("Unhandled AccidentalEnum value")}}static AccidentalFromHalfTones(t){switch(t){case 0:return s.NONE;case 1:return s.SHARP;case-1:return s.FLAT;case 2:return s.DOUBLESHARP;case-2:return s.DOUBLEFLAT;case 3:return s.TRIPLESHARP;case-3:return s.TRIPLEFLAT;case.5:return s.QUARTERTONESHARP;case-.5:return s.QUARTERTONEFLAT;case 1.5:return s.THREEQUARTERSSHARP;case-1.5:return s.THREEQUARTERSFLAT;default:return t>0&&t<1?s.QUARTERTONESHARP:t<0&&t>-1?s.QUARTERTONEFLAT:s.QUARTERTONESHARP}}static accidentalVexflow(t){let e;switch(t){case s.NATURAL:e="n";break;case s.FLAT:e="b";break;case s.SHARP:e="#";break;case s.DOUBLESHARP:e="##";break;case s.TRIPLESHARP:e="###";break;case s.DOUBLEFLAT:e="bb";break;case s.TRIPLEFLAT:e="bbs";break;case s.QUARTERTONESHARP:e="+";break;case s.QUARTERTONEFLAT:e="d";break;case s.SLASHFLAT:e="bs";break;case s.THREEQUARTERSSHARP:e="++";break;case s.THREEQUARTERSFLAT:e="db";break;case s.SLASHQUARTERSHARP:e="+-";break;case s.SLASHSHARP:e="++-";break;case s.DOUBLESLASHFLAT:e="bss";break;case s.SORI:e="o";break;case s.KORON:e="k"}return e}get AccidentalHalfTones(){return r.HalfTonesFromAccidental(this.accidental)}get Octave(){return this.octave}get FundamentalNote(){return this.fundamentalNote}get Accidental(){return this.accidental}get AccidentalXml(){return this.accidentalXml}get Frequency(){return this.frequency}static get OctaveXmlDifference(){return r.octXmlDiff}getHalfTone(){return this.halfTone}getTransposedPitch(t){if(t>12)throw new Error("rewrite this method to handle bigger octave changes or don't use is with bigger octave changes!");return t>0?this.getHigherPitchByTransposeFactor(t):t<0?this.getLowerPitchByTransposeFactor(-t):this}DoEnharmonicChange(){switch(this.accidental){case s.FLAT:case s.DOUBLEFLAT:this.fundamentalNote=this.getPreviousFundamentalNote(this.fundamentalNote),this.accidental=r.AccidentalFromHalfTones(this.halfTone-(this.fundamentalNote+12*(this.octave+r.octXmlDiff)));break;case s.SHARP:case s.DOUBLESHARP:this.fundamentalNote=this.getNextFundamentalNote(this.fundamentalNote),this.accidental=r.AccidentalFromHalfTones(this.halfTone-(this.fundamentalNote+12*(this.octave+r.octXmlDiff)));break;default:return}}ToString(){let t=r.accidentalVexflow(this.accidental);return t||(t=""),"Key: "+r.getNoteEnumString(this.fundamentalNote)+t+", Note: "+this.fundamentalNote+", octave: "+this.octave.toString()}OperatorEquals(t){const e=this;return!(!e||!t)&&e.FundamentalNote===t.FundamentalNote&&e.Octave===t.Octave&&e.Accidental===t.Accidental}OperatorNotEqual(t){return!(this===t)}OperatorFundamentalGreaterThan(t){const e=this;return e.Octave===t.Octave?e.FundamentalNote>t.FundamentalNote:e.Octave>t.Octave}OperatorFundamentalLessThan(t){const e=this;return e.Octave===t.Octave?e.FundamentalNoter.pitchEnumValues.length-1?(i=r.pitchEnumValues[e+t-r.pitchEnumValues.length],n++):i=r.pitchEnumValues[e+t],new r(i,n,s.NONE)}getLowerPitchByTransposeFactor(t){const e=r.pitchEnumValues.indexOf(this.fundamentalNote);let i,n=this.octave;return e-t<0?(i=r.pitchEnumValues[r.pitchEnumValues.length+e-t],n--):i=r.pitchEnumValues[e-t],new r(i,n,s.NONE)}getNextFundamentalNote(t){let e=r.pitchEnumValues.indexOf(t);return e=(e+1)%r.pitchEnumValues.length,r.pitchEnumValues[e]}getPreviousFundamentalNote(t){const e=r.pitchEnumValues.indexOf(t);return e>0?r.pitchEnumValues[e-1]:r.pitchEnumValues[r.pitchEnumValues.length-1]}}e.Pitch=r,r.pitchEnumValues=[n.C,n.D,n.E,n.F,n.G,n.A,n.B],r.halftoneFactor=12/(Math.LN2/Math.LN10),r.octXmlDiff=3},7359:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PlaybackSettings=void 0;const n=i(1797);class s{constructor(t=new n.Fraction,e=0){this.rhythm=t,this.beatsPerMinute=e,this.beatLengthInMilliseconds=6e4/e,this.beatRealValue=1/4}static createFrom(t){return new s(t.Rhythm,t.BeatsPerMinute)}get BeatsPerMinute(){return this.beatsPerMinute}set BeatsPerMinute(t){this.beatsPerMinute=t,this.beatLengthInMilliseconds=6e4/this.beatsPerMinute}get Rhythm(){return this.rhythm}set Rhythm(t){this.rhythm=t}get BeatRealValue(){return this.beatRealValue}get BeatLengthInMilliseconds(){return this.beatLengthInMilliseconds}getDurationInMilliseconds(t){return("number"==typeof t?t:t.RealValue)*this.BeatLengthInMilliseconds/this.beatRealValue}getDurationAsNoteDuration(t,e=1024){const i=t/this.BeatLengthInMilliseconds;let s=Math.floor(i);const r=new n.Fraction(s,4),o=i-s;return s=Math.round(o/(1/e)/4),0===s&&t>0&&(s=1),r.Add(new n.Fraction(s,e)),r}}e.PlaybackSettings=s},9086:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PointF2D=void 0;class i{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}static get Empty(){return new i}static pointsAreEqual(t,e){return t.x===e.x&&t.y===e.y}ToString(){return"["+this.x+", "+this.y+"]"}}e.PointF2D=i},3278:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RectangleF2D=void 0;const n=i(739),s=i(9086);class r{constructor(t,e,i,n){this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=i,this.height=n}static createFromLocationAndSize(t,e){return new r(t.x,t.y,e.width,e.height)}get Location(){return new s.PointF2D(this.x,this.y)}get Size(){return new n.SizeF2D(this.width,this.height)}}e.RectangleF2D=r},739:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SizeF2D=void 0,e.SizeF2D=class{constructor(t=0,e=0){this.width=t,this.height=e}}},8918:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(1797),e),s(i(8363),e),s(i(9651),e),s(i(9855),e),s(i(8640),e),s(i(9086),e),s(i(3278),e),s(i(739),e)},1394:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(556),e)},556:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isTopFont=e.isSpecialMark=e.isGradientWords=e.formatSpeedKeyword=e.isSpeedHiddenKeyword=e.isSpeedKeyword=e.SpeedHiddenKeyword=e.SpeedKeyword=e.SpecialWords=e.GRADIENT_SPEED_RESET_TAG=e.GRADIENT_SPEED_CLOSE_TAG=e.GradientWords=e.HideWords=e.SpecialMarks=e.SpeedTag=void 0;const n=i(1274);e.SpeedTag={Grava:40,Largo:46,Lento:52,Adagio:56,Larghetto:60,Andante:66,Anderato:69,Andantino:69,Moderato:88,Allegretto:108,"Allegro Moderato":108,Allegro:132,Vivace:152,Vivo:160,Vivacissimo:168,Presto:184,Prestissimo:208},e.SpecialMarks=["纯律","纯律结束"],e.HideWords=["跳过下一个","b","#","§","º","X"],e.GradientWords=["poco rit.","rall.","rit.","accel.","molto rit.","molto rall","lentando","poco accel.","calando"],e.GRADIENT_SPEED_CLOSE_TAG="结束范围速度",e.GRADIENT_SPEED_RESET_TAG="a tempo",e.SpecialWords=[e.GRADIENT_SPEED_CLOSE_TAG],e.SpeedKeyword="速度 ",e.SpeedHiddenKeyword="仅文本速度 ",e.isSpeedKeyword=function(t){return 0===t.indexOf(e.SpeedKeyword)},e.isSpeedHiddenKeyword=function(t){return 0===t.indexOf(e.SpeedHiddenKeyword)},e.formatSpeedKeyword=function(t){return t.replace(e.SpeedHiddenKeyword,"").replace(e.SpeedKeyword,"")},e.isGradientWords=function(t){return e.GradientWords.includes(t)},e.isSpecialMark=function(t){return[...Object.keys(e.SpeedTag),...e.SpecialMarks,...e.SpecialWords,...e.HideWords].map((t=>t.trim().toLocaleUpperCase())).includes(t.toLocaleUpperCase().trim())},e.isTopFont=function(t){return[n.TextAlignmentEnum.CenterTop,n.TextAlignmentEnum.RightTop].includes(t)}},2562:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.FontStyleString=e.FontStyles=void 0,(i=e.FontStyles||(e.FontStyles={}))[i.Regular=0]="Regular",i[i.Bold=1]="Bold",i[i.Italic=2]="Italic",i[i.BoldItalic=3]="BoldItalic",i[i.Underlined=4]="Underlined",e.FontStyleString={Bold:1,BoldItalic:3,Italic:2,Regular:0,Underlined:4}},96:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.FontStringNames=e.FontString=e.Fonts=void 0,(i=e.Fonts||(e.Fonts={}))[i.TimesNewRoman=0]="TimesNewRoman",i[i.Kokila=1]="Kokila",i[i.Gonville=2]="Gonville",e.FontString={Gonville:2,Kokila:1,TimesNewRoman:0},e.FontStringNames={0:"Times New Roman",1:"Kokila",2:"Gonville"}},4112:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.InteractionType=void 0,(i=e.InteractionType||(e.InteractionType={}))[i.SingleTouch=0]="SingleTouch",i[i.DoubleTouch=1]="DoubleTouch",i[i.TouchUp=2]="TouchUp",i[i.TouchDown=3]="TouchDown",i[i.Move=4]="Move"},2406:(t,e)=>{"use strict";var i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.MessageBoxType=e.PlaybackState=void 0,(n=e.PlaybackState||(e.PlaybackState={}))[n.Stopped=0]="Stopped",n[n.Running=1]="Running",(i=e.MessageBoxType||(e.MessageBoxType={}))[i.Info=0]="Info",i[i.Warning=1]="Warning",i[i.Error=2]="Error"},1274:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.TextAlignment=e.TextAlignmentEnum=void 0,function(t){t[t.LeftTop=0]="LeftTop",t[t.LeftCenter=1]="LeftCenter",t[t.LeftBottom=2]="LeftBottom",t[t.CenterTop=3]="CenterTop",t[t.CenterCenter=4]="CenterCenter",t[t.CenterBottom=5]="CenterBottom",t[t.RightTop=6]="RightTop",t[t.RightCenter=7]="RightCenter",t[t.RightBottom=8]="RightBottom"}(i=e.TextAlignmentEnum||(e.TextAlignmentEnum={})),e.TextAlignment=class{static IsLeft(t){return t===i.LeftTop||t===i.LeftCenter||t===i.LeftBottom}static IsCenterAligned(t){return t===i.CenterTop||t===i.CenterCenter||t===i.CenterBottom}static IsRight(t){return t===i.RightTop||t===i.RightCenter||t===i.RightBottom}}},7119:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.TieTypes=void 0,(i=e.TieTypes||(e.TieTypes={})).SIMPLE="",i.HAMMERON="H",i.PULLOFF="P",i.SLIDE="S",i.TAPPING="T"},5544:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(2562),e),s(i(96),e),s(i(1274),e),s(i(7119),e),s(i(2406),e)},7056:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.MXLHelper=void 0;const s=i(9228),r=n(i(5733)),o=n(i(2043));e.MXLHelper=class{static MXLtoIXmlElement(t){const e=new r.default;return e.loadAsync(t).then((t=>e.file("META-INF/container.xml").async("text")),(t=>{throw t})).then((t=>{const i=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("rootfile")[0].getAttribute("full-path");return e.file(i).async("text")}),(t=>{throw t})).then((t=>{const e=(new DOMParser).parseFromString(t,"text/xml"),i=new s.IXmlElement(e.documentElement);return Promise.resolve(i)}),(t=>{throw t})).then((t=>t),(t=>{throw new Error("extractSheetFromMxl: "+t.message)}))}static MXLtoXMLstring(t){const e=new r.default;return e.loadAsync(t).then((t=>e.file("META-INF/container.xml").async("text")),(t=>{throw o.default.error(t),t})).then((t=>{const i=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("rootfile")[0].getAttribute("full-path");return e.file(i).async("text")}),(t=>{throw t}))}}},9228:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IXmlElement=void 0;class i{constructor(t){if(this.hasAttributes=!1,!t)throw new Error("IXmlElement: expected Element, got undefined");this.elem=t,this.name=t.nodeName.toLowerCase(),t.hasAttributes()&&(this.hasAttributes=!0,this.firstAttribute=t.attributes[0]),this.hasElements=t.hasChildNodes(),1===t.childNodes.length&&t.childNodes[0].nodeType===Node.TEXT_NODE?this.value=t.childNodes[0].nodeValue:this.value=""}attribute(t){return this.elem.attributes.getNamedItem(t)}attributes(){if(!this.attrs){const t=this.elem.attributes,e=[];for(let i=0;i{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AClassHierarchyTrackable=void 0,e.AClassHierarchyTrackable=class{isInstanceOfClass(t){let e=this.constructor.prototype;for(;e;){if(t===e.constructor.name)return!0;e=e.__proto__}return!1}}},834:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},2245:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},5015:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},2890:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},7596:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},5569:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},5627:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},9888:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},3582:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},8282:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},702:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},7872:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},5028:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},7331:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(9733),e),s(i(834),e),s(i(2245),e),s(i(5015),e),s(i(2890),e),s(i(7596),e),s(i(5569),e),s(i(5627),e),s(i(9888),e),s(i(3582),e),s(i(8282),e),s(i(702),e),s(i(7872),e),s(i(5028),e)},1211:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StringUtil=void 0,e.StringUtil=class{static StringContainsSeparatedWord(t,e,i=!1){return new RegExp("( |^)"+e+"([ .]|$)",i?"i":void 0).test(t)}}},9986:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextTranslation=void 0;class i{static translateText(t,e){return void 0===i.DefaultTextTranslation?e:i.DefaultTextTranslation.translate(t,e)}translate(t,e){return e}}e.TextTranslation=i},5199:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(1211),e)},5205:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(8918),e),s(i(5544),e),s(i(9633),e),s(i(7331),e),s(i(5199),e),s(i(1394),e),s(i(5199),e)},415:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractDisplayInteractionManager=void 0,e.AbstractDisplayInteractionManager=class{constructor(){this.listeners=[],this.zoomGestureActive=!1,this.touchCount=0,this.touchActive=!1,this.touchMoving=!1,this.displayWidth=1,this.displayHeight=1,this.displayDpi=96,this.maxNumerOfFingers=2,this.movementThreshInch=.075,this.interactionWasZoomGesture=!1}addListener(t){this.listeners.push(t)}get ZoomGestureActive(){return this.zoomGestureActive}get WasZoomGestureActive(){return this.interactionWasZoomGesture}displaySizeChanged(t,e){this.displayWidth=t,this.displayHeight=e;for(const t of this.listeners)t.displaySizeChanged(this.displayWidth,this.displayHeight)}Dispose(){this.dispose()}Initialize(){this.initialize()}get DisplayDpi(){return this.displayDpi}get TouchActive(){return this.touchActive}get TouchMoving(){return this.touchMoving}touchDown(t,e,i){this.interactionWasZoomGesture=!1;const n=t/this.displayWidth,s=e/this.displayHeight;this.lastRelPosX=n,this.lastRelPosY=s,this.lastPixelX=t,this.lastPixelY=e,this.touchActive=!0,this.touchMoving=!1,this.touchCount=Math.min(this.touchCount+1,this.maxNumerOfFingers);for(const t of this.listeners)t.mouseDown(n,s,!i)}move(t,e){if(this.touchActive&&!this.zoomGestureActive){const i=t/this.displayWidth,n=e/this.displayHeight,s=i-this.lastRelPosX,r=n-this.lastRelPosY;this.touchMoving=!0;for(const t of this.listeners)t.mouseMove(i,n,s,r)}}zoomGestureStarted(){this.zoomGestureActive=!0}zoomGestureCompleted(){this.zoomGestureActive=!1,this.interactionWasZoomGesture=!0}zoomGestureMove(t){this.zoomGestureActive&&this.listeners.forEach((function(e){e.zoom(t)}))}touchUp(t,e){this.touchActive=!1,this.touchMoving=!1,this.touchCount=Math.max(0,this.touchCount-1);const i=t/this.displayWidth,n=e/this.displayHeight;for(const t of this.listeners)t.mouseUp(i,n)}click(t,e){if(!this.mouseDidMove(this.lastPixelX,t,this.lastPixelY,e)&&!this.ZoomGestureActive){const i=t/this.displayWidth,n=e/this.displayHeight;for(const t of this.listeners)t.positionTouched(i,n)}}doubleClick(t,e){if(!this.mouseDidMove(this.lastPixelX,t,this.lastPixelY,e)&&!this.ZoomGestureActive){const i=t/this.displayWidth,n=e/this.displayHeight;for(const t of this.listeners)t.positionDoubleTouched(i,n)}}mouseDidMove(t,e,i,n){const s=Math.abs(t-e)/this.displayDpi,r=Math.abs(i-n)/this.displayDpi;return s>this.movementThreshInch||r>this.movementThreshInch}}},6045:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractZoomView=void 0,e.AbstractZoomView=class{constructor(t){this.aspectRatio=1,this.zoomViews=[],this.mouseZoomMode=!1,this.autoScrollY=!0,this.displayInteractionManager=t,this.displayInteractionManager.addListener(this),this.offsetXMin=Number.MIN_VALUE,this.offsetYMin=Number.MIN_VALUE,this.rangeXMin=1,this.rangeYMin=1,this.offsetXMax=Number.MAX_VALUE,this.offsetYMax=Number.MAX_VALUE,this.rangeXMax=1e9,this.rangeYMax=1e9,this.XScrollingEnabled=!1,this.YScrollingEnabled=!0}positionTouched(t,e){if(!this.convertToUnitsReady())return;const i=this.getPositionInUnits(t,e);this.unitPosTouched(i,t,e)}get TouchActive(){return this.displayInteractionManager.TouchActive}get TouchMoving(){return this.displayInteractionManager.TouchMoving}positionDoubleTouched(t,e){if(!this.convertToUnitsReady())return;const i=this.getPositionInUnits(t,e);this.unitPosDoubleTouched(i,t,e)}get UsesManuallyControlledZoomMode(){return this.usesManuallyControlledZoomMode}set UsesManuallyControlledZoomMode(t){this.usesManuallyControlledZoomMode=t}mouseDown(t,e,i=!1){if(!this.convertToUnitsReady())return;this.selectScrollControllerY(!1),this.lastRangeX=Math.max(1,this.RangeX),this.lastRangeY=Math.max(1,this.RangeY),this.lastOffsetX=this.OffsetX,this.lastOffsetY=this.OffsetY;const n=this.getPositionInUnits(t,e);this.unitPosTouchDown(n,t,e),this.usesManuallyControlledZoomMode||(this.mouseZoomMode=!!i)}mouseUp(t,e){const i=this.getPositionInUnits(t,e);this.unitPosTouchUp(i,t,e)}mouseMove(t,e,i,n){this.mouseZoomMode?(Math.abs(i-0)>1e-8&&(this.RangeX=Math.abs(this.lastRangeX/(1+i))),!this.lockRanges&&Math.abs(n-0)>1e-8&&(this.RangeY=Math.abs(this.lastRangeY/(1-n)))):(Math.abs(i-0)>1e-8&&(this.OffsetX=this.lastOffsetX-i*this.RangeX),Math.abs(n-0)>1e-8&&(this.OffsetY=this.lastOffsetY-n*this.RangeY));const s=this.getPositionInUnits(t,e);this.unitPosMove(s,t,e)}zoom(t){this.RangeX=Math.abs(this.lastRangeX/t)}addZoomView(t){this.zoomViews.push(t)}get OffsetX(){return this.offsetX}set OffsetX(t){this.offsetX=Math.min(this.offsetXMax,Math.max(this.offsetXMin,t));for(const t of this.zoomViews)t.viewportXChanged(this.offsetX,this.RangeX)}get OffsetY(){return this.offsetY}set OffsetY(t){this.offsetY=t,this.offsetY>this.offsetYMax?this.offsetY=this.offsetYMax:this.offsetY{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PlaybackCursorUserInteractionManager=void 0;const n=i(4112);e.PlaybackCursorUserInteractionManager=class{constructor(t,e){this.graphic=t}userDisplayInteraction(t,e,i){if(i===n.InteractionType.SingleTouch){const t=this.graphic.GetNearestVoiceEntry(e);console.log(t)}}}},56:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ScreenViewingRegion=void 0;const n=i(4759),s=i(8918);class r{constructor(t,e,i,s){this.psi=new n.BoundingBox(void 0),this.displaySizeInPixel=t,this.RelativeDisplaySize=e,this.RelativeDisplayPosition=i,this.WidthInUnits=s}static createWithRelativeDefaults(t,e){return new r(t,new s.SizeF2D(1,1),new s.PointF2D(0,0),e)}static createWithDefaults(){return new r(new s.SizeF2D(1,1),new s.SizeF2D(1,1),new s.PointF2D(0,0),1)}get UpperLeftPositionInUnits(){return this.psi.AbsolutePosition}set UpperLeftPositionInUnits(t){this.psi.AbsolutePosition=t}get DisplaySizeInPixel(){return this.displaySizeInPixel}set DisplaySizeInPixel(t){this.displaySizeInPixel=t,this.regionSizeInPixel=new s.SizeF2D(this.displaySizeInPixel.width*this.relativeRegionSize.width,this.displaySizeInPixel.height*this.relativeRegionSize.height),this.recalculateDependentVariables()}get RelativeDisplaySize(){return this.relativeRegionSize}set RelativeDisplaySize(t){this.relativeRegionSize=t,this.regionSizeInPixel=new s.SizeF2D(this.displaySizeInPixel.width*this.relativeRegionSize.width,this.displaySizeInPixel.height*this.relativeRegionSize.height),this.recalculateDependentVariables()}get RegionSizeInPixel(){return this.regionSizeInPixel}get WidthInUnits(){return this.psi.BorderRight}set WidthInUnits(t){this.psi.BorderRight=t,this.recalculateDependentVariables()}get ViewRegionInUnits(){return new s.SizeF2D(this.psi.BorderRight,this.psi.BorderBottom)}isVisible(t,e){const i=this.psi.collisionDetection(t);return this.psi.liesInsideBorders(t),i}isInsideDisplayArea(t,e){return this.RelativeDisplayPosition.x<=t&&t<=this.RelativeDisplayPosition.x+this.RelativeDisplaySize.width&&this.RelativeDisplayPosition.y<=e&&e<=this.RelativeDisplayPosition.y+this.RelativeDisplaySize.height}transformToUnitCoordinates(t){return new s.PointF2D(this.UpperLeftPositionInUnits.x+this.ViewRegionInUnits.width*((t.x-this.RelativeDisplayPosition.x)/this.RelativeDisplaySize.width),this.UpperLeftPositionInUnits.y+this.ViewRegionInUnits.height*((t.y-this.RelativeDisplayPosition.y)/this.RelativeDisplaySize.height))}transformLengthXToUnitCoordinates(t){return t/this.horizontalUnitToPixelRatio}transformLengthYToUnitCoordinates(t){return t/this.verticalUnitToPixelRatio}recalculateDependentVariables(){const t=this.regionSizeInPixel.width/this.regionSizeInPixel.height;this.psi.BorderBottom=this.psi.BorderRight/t,this.horizontalUnitToPixelRatio=this.regionSizeInPixel.width/this.ViewRegionInUnits.width,this.verticalUnitToPixelRatio=this.regionSizeInPixel.height/this.ViewRegionInUnits.height}}e.ScreenViewingRegion=r},7969:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SheetRenderingManager=void 0;const n=i(56),s=i(8918),r=i(6045),o=i(4112),a=i(7108);class l extends r.AbstractZoomView{constructor(t,e){super(t),this.mainViewingRegion=n.ScreenViewingRegion.createWithDefaults(),this.tryAgainToRenderCount=0,this.yOffsetMouseDown=Number.MIN_VALUE,this.unlockCursorDistancePixel=50,this.relativeTopPosition=.06,this.internalPreviewImageScale=3,this.listeners=[],this.LockDisplayToCursor=!0,this.ZoomActive=!1,this.rules=e,this.addZoomView(this),this.lockRanges=!0,this.TopBarHeightInPixel=70,this.BottomBarHeightInPixel=0,this.rules.UseDefaultVoiceInteractionListener&&this.listeners.push(new a.VoiceEntryInteractionListener(this))}addListener(t){this.listeners.push(t)}get Listeners(){return this.listeners}convertToUnitsReady(){return void 0!==this.graphicalMusicSheet}unitPosTouched(t,e,i){if(!this.SingleTouchDisabled){const n=new s.PointF2D(e,i);this.handleUserDisplayInteraction(n,t,o.InteractionType.SingleTouch)}}unitPosDoubleTouched(t,e,i){if(!this.DoubleTouchDisabled){const n=new s.PointF2D(e,i);this.handleUserDisplayInteraction(n,t,o.InteractionType.DoubleTouch)}}unitPosTouchDown(t,e,i){const n=new s.PointF2D(e,i);this.handleUserDisplayInteraction(n,t,o.InteractionType.TouchDown),this.yOffsetMouseDown=t.y}unitPosTouchUp(t,e,i){const n=new s.PointF2D(e,i);this.handleUserDisplayInteraction(n,t,o.InteractionType.TouchUp),!1===this.displayInteractionManager.WasZoomGestureActive&&this.unlockFromCursorIfNecessary(t),this.yOffsetMouseDown=Number.MIN_VALUE}unitPosMove(t,e,i){const n=new s.PointF2D(e,i);this.handleUserDisplayInteraction(n,t,o.InteractionType.Move),this.unlockFromCursorIfNecessary(t)}get MainViewingRegion(){return this.mainViewingRegion}setMusicSheet(t){this.graphicalMusicSheet=t,this.adaptDisplayLimitsToSheet(),this.setYOffset(0,!0)}viewportXChanged(t,e){void 0!==this.graphicalMusicSheet&&this.horizontalViewportChanged(t,e)}viewportYChanged(t,e){void 0!==this.graphicalMusicSheet&&(this.yOffsetMouseDown<=Number.MIN_VALUE+.5&&(this.yOffsetMouseDown=t),this.verticalViewportChanged(t,e))}displaySizeChanged(t,e){super.viewSizeChanged(t,e),Math.abs(t-0)<1e-7||Math.abs(e-0)<1e-7||(void 0!==this.graphicalMusicSheet&&this.graphicalMusicSheet.EnforceRedrawOfMusicSystems(),this.mainViewingRegion.DisplaySizeInPixel=new s.SizeF2D(t,e),this.adaptDisplayLimitsToSheet())}calcDisplayYPosition(t){return t.PositionAndShape.AbsolutePosition.y+t.PositionAndShape.BorderMarginTop-this.topBarHeightInUnits()-this.relativeTopPosition*this.heightWithoutTopBottomBarsInUnits()}yPositionForLastSystem(t){return t.PositionAndShape.AbsolutePosition.y+t.PositionAndShape.BorderMarginBottom-this.topBarHeightInUnits()-(1-this.relativeTopPosition)*this.heightWithoutTopBottomBarsInUnits()}scorePositionChanged(t,e,i,n,s,r){const o=this.calcDisplayYPosition(n);this.setYPosition(o,r)}setXPosition(t,e){this.LockDisplayToCursor&&this.setXOffset(t,e)}setYPosition(t,e){this.LockDisplayToCursor&&this.setYOffset(t,e)}get DrawingParameters(){return this.musicSheetDrawer.drawingParameters}topBarHeightInUnits(){return this.mainViewingRegion.transformLengthYToUnitCoordinates(this.TopBarHeightInPixel)}bottomBarHeightInUnits(){return this.mainViewingRegion.transformLengthYToUnitCoordinates(this.BottomBarHeightInPixel)}heightWithoutTopBottomBarsInUnits(){return this.mainViewingRegion.ViewRegionInUnits.height-this.topBarHeightInUnits()-this.bottomBarHeightInUnits()}activePositionToBottomBarHeight(){return(this.mainViewingRegion.ViewRegionInUnits.height-this.topBarHeightInUnits()-this.bottomBarHeightInUnits())*(1-2*this.relativeTopPosition)}getClickPosition(t,e){return this.mainViewingRegion.transformToUnitCoordinates(new s.PointF2D(t,e))}graphicalObjectIsVisible(t){return this.mainViewingRegion.isVisible(t,!1)}adaptDisplayLimitsToSheet(){if(void 0===this.graphicalMusicSheet||0===this.graphicalMusicSheet.MusicPages.length||0===this.graphicalMusicSheet.MusicPages[0].MusicSystems.length)return;this.offsetXMin=0,this.rangeXMin=this.graphicalMusicSheet.MinAllowedSystemWidth,this.rangeXMax=300,this.offsetYMin=-.3*this.RangeY;const t=this.graphicalMusicSheet.MusicPages.last().PositionAndShape;this.offsetYMax=Math.max(0,t.BorderMarginBottom-.7*this.RangeY),this.OffsetY>this.offsetYMax&&this.setYOffset(this.offsetYMax,!0)}horizontalViewportChanged(t,e){this.mainViewingRegion.WidthInUnits!==e&&(this.mainViewingRegion.WidthInUnits=e)}verticalViewportChanged(t,e){this.mainViewingRegion.UpperLeftPositionInUnits=new s.PointF2D(this.mainViewingRegion.UpperLeftPositionInUnits.x,t)}unlockFromCursorIfNecessary(t){!1===this.LockDisplayToCursor||this.ZoomActive||this.displayInteractionManager.ZoomGestureActive||this.displayInteractionManager.WasZoomGestureActive||Math.abs((t.y-this.yOffsetMouseDown)*this.mainViewingRegion.RegionSizeInPixel.height/this.mainViewingRegion.ViewRegionInUnits.height)>this.unlockCursorDistancePixel&&(this.LockDisplayToCursor=!1)}getPositionInUnits(t,e){return this.mainViewingRegion.transformToUnitCoordinates(new s.PointF2D(t,e))}handleUserDisplayInteraction(t,e,i){switch(i){case o.InteractionType.TouchDown:case o.InteractionType.SingleTouch:case o.InteractionType.DoubleTouch:{const t=this.graphicalMusicSheet.GetNearestVoiceEntry(e);if(t){const e=new CustomEvent("note-click",{detail:Object.assign(Object.assign({},t),{setAvtivePlay:()=>{var e,i;if(void 0!==t.parentStaffEntry.parentVerticalContainer){const n=t.parentStaffEntry.parentVerticalContainer.AbsoluteTimestamp;this.setStartPosition(n),void 0!==(null===(e=t.notes[0])||void 0===e?void 0:e.sourceNote.Pitch)&&(console.log("playback clicked note",t.parentVoiceEntry),null===(i=this.PlaybackManager)||void 0===i||i.playVoiceEntry(t.parentVoiceEntry))}}})});window.dispatchEvent(e)}}case o.InteractionType.TouchUp:case o.InteractionType.TouchDown:case o.InteractionType.Move:for(const n of this.listeners)n.userDisplayInteraction(t,e,i);break;default:throw new Error("type")}}setStartPosition(t){var e;void 0!==this.graphicalMusicSheet&&(this.graphicalMusicSheet.ParentMusicSheet.SelectionStart=t,null===(e=this.PlaybackManager)||void 0===e||e.reset())}get GraphicalMusicSheet(){return this.graphicalMusicSheet}}e.SheetRenderingManager=l},7108:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VoiceEntryInteractionListener=void 0;const n=i(4112);e.VoiceEntryInteractionListener=class{constructor(t){this.renderingManager=t}userDisplayInteraction(t,e,i){var s,r;switch(i){case n.InteractionType.TouchDown:case n.InteractionType.SingleTouch:case n.InteractionType.DoubleTouch:{const t=this.renderingManager.GraphicalMusicSheet.GetNearestVoiceEntry(e);t&&void 0!==t.parentStaffEntry.parentVerticalContainer&&void 0!==(null===(s=t.notes[0])||void 0===s?void 0:s.sourceNote.Pitch)&&(null===(r=this.renderingManager.PlaybackManager)||void 0===r||r.playVoiceEntry(t.parentVoiceEntry));break}}}}},4821:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebDisplayInteractionManager=void 0;const n=i(415),s=i(9086),r=i(1649);class o extends n.AbstractDisplayInteractionManager{constructor(t){super(),this.fullOffsetLeft=0,this.fullOffsetTop=0,this.fullScrollTop=0,this.fullScrollLeft=0,this.parentScrollMap=new Map,this.scrollCallbackMap=new Map,this.timeout=void 0,this.resizeObserver=void 0,this.EventCallbackMap=new r.Dictionary,this.DOUBLE_CLICK_WINDOW=200,this.lastClick=0,this.osmdSheetMusicContainer=t,this.listenForInteractions()}get FullOffsetTop(){return this.fullOffsetTop}get FullScrollTop(){return this.fullScrollTop}get FullOffsetLeft(){return this.fullOffsetLeft}get FullScrollLeft(){return this.fullScrollLeft}static resizeCallback(t,e){clearTimeout(e.timeout),e.timeout=setTimeout((()=>{e.fullOffsetLeft=0,e.fullOffsetTop=0;let t=e.osmdSheetMusicContainer;for(;t;)e.fullOffsetLeft+=t.offsetLeft,e.fullOffsetTop+=t.offsetTop,t=t.offsetParent;e.resizeEventListener(),e.deregisterScrollOffsets(),e.registerScrollOffsets()}),500)}registerScrollOffsets(){let t=this.osmdSheetMusicContainer;this.fullScrollTop=0,this.fullScrollLeft=0;const e=this;for(;t&&t!==document.documentElement;){if(this.parentScrollMap.set(t,[t.scrollTop,t.scrollLeft]),this.fullScrollLeft+=t.scrollLeft,this.fullScrollTop+=t.scrollTop,t.scrollHeight>t.clientHeight){const i=function(t){const i=e.parentScrollMap.get(this),n=i[0],s=i[1];e.fullScrollTop=e.fullScrollTop-n+this.scrollTop,e.fullScrollLeft=e.fullScrollLeft-s+this.scrollLeft,e.parentScrollMap.set(this,[this.scrollTop,this.scrollLeft])};this.scrollCallbackMap.set(t,i),t.addEventListener("scroll",i)}t=t.parentElement}}deregisterScrollOffsets(){for(const t of this.scrollCallbackMap.keys())t.removeEventListener("scroll",this.scrollCallbackMap.get(t));this.scrollCallbackMap.clear()}initialize(){this.fullOffsetLeft=0,this.fullOffsetTop=0;let t=this.osmdSheetMusicContainer;const e=[],i=this;for(window.ResizeObserver&&(this.resizeObserver=new ResizeObserver((t=>{o.resizeCallback(t,i)})));t;)this.fullOffsetLeft+=t.offsetLeft,this.fullOffsetTop+=t.offsetTop,this.resizeObserver?this.resizeObserver.observe(t):e.push(t),t=t.offsetParent;if(this.resizeObserver)this.disposeResizeListener=()=>{i.resizeObserver.disconnect(),i.resizeObserver=void 0};else{let t=()=>{o.resizeCallback(e,i)};window.addEventListener("resize",t),this.disposeResizeListener=()=>{window.removeEventListener("resize",t),t=void 0}}i.registerScrollOffsets()}dispose(){this.disposeResizeListener();for(const t of this.EventCallbackMap.keys()){const e=this.EventCallbackMap.getValue(t);e[0].removeEventListener(t,e[1])}this.EventCallbackMap.clear(),this.deregisterScrollOffsets(),this.scrollCallbackMap.clear(),this.parentScrollMap.clear()}isTouch(){if("ontouchstart"in window||window.DocumentTouch)return!0;if(!window.matchMedia)return!1;const t=["(",["-webkit-","-moz-","-o-","-ms-"].join("touch-enabled),("),"heartz",")"].join("");return window.matchMedia(t).matches}get downEventName(){return this.isTouch()?"touchstart":"mousedown"}get moveEventName(){return this.isTouch()?"touchmove":"mousemove"}listenForInteractions(){const t=this.downEventListener.bind(this),e=this.touchEndEventListener.bind(this),i=this.moveEventListener.bind(this);this.osmdSheetMusicContainer.addEventListener("mousedown",t),this.osmdSheetMusicContainer.addEventListener("touchend",e),document.addEventListener(this.moveEventName,i),this.EventCallbackMap.setValue("mousedown",[this.osmdSheetMusicContainer,t]),this.EventCallbackMap.setValue("touchend",[this.osmdSheetMusicContainer,e]),this.EventCallbackMap.setValue(this.moveEventName,[document,i])}downEventListener(t){const e=(new Date).getTime(),i=e-this.lastClick;clearTimeout(this.clickTimeout);let n=0,s=0;this.isTouch()&&t instanceof TouchEvent?(n=t.touches[0].pageX,s=t.touches[0].pageY):t instanceof MouseEvent&&(n=t.pageX,s=t.pageY);const r=this.getOffsetCoordinates(n,s);if(i0)this.doubleClick(r.x,r.y);else{const t=this;this.clickTimeout=setTimeout((function(){clearTimeout(this.clickTimeout),t.isTouch()?t.touchDown(r.x,r.y,void 0):t.click(r.x,r.y)}),this.DOUBLE_CLICK_WINDOW)}this.lastClick=e}moveEventListener(t){let e=0,i=0;if(this.isTouch()&&t instanceof TouchEvent){let n;t.touches&&t.touches.length>0?n=t.touches[0]:t.changedTouches&&t.changedTouches.length>0&&(n=t.changedTouches[0]),e=null==n?void 0:n.clientX,i=null==n?void 0:n.clientY}else t instanceof MouseEvent&&(e=t.clientX,i=t.clientY);const n=this.getOffsetCoordinates(e,i);this.move(n.x,n.y)}touchEndEventListener(t){let e;t.touches&&t.touches.length>0?e=t.touches[0]:t.changedTouches&&t.changedTouches.length>0&&(e=t.changedTouches[0]);const i=this.getOffsetCoordinates(null==e?void 0:e.pageX,null==e?void 0:e.pageY);this.touchUp(i.x,i.y)}resizeEventListener(){this.displaySizeChanged(this.osmdSheetMusicContainer.clientWidth,this.osmdSheetMusicContainer.clientHeight)}getOffsetCoordinates(t,e){const i=t-this.fullOffsetLeft+this.fullScrollLeft,n=e-this.fullOffsetTop+this.fullScrollTop;return new s.PointF2D(i,n)}}e.WebDisplayInteractionManager=o},2660:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebSheetRenderingManager=void 0;const n=i(7969);class s extends n.SheetRenderingManager{mouseMove(t,e,i,n){const s=this.getPositionInUnits(t,e);this.unitPosMove(s,t,e)}}e.WebSheetRenderingManager=s},2571:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(415),e),s(i(6045),e),s(i(7570),e),s(i(56),e),s(i(7969),e),s(i(4821),e)},1703:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidEnumArgumentException=e.ArgumentOutOfRangeException=e.MusicSheetReadingException=void 0,e.MusicSheetReadingException=class{constructor(t,e){this.message=t,e&&(this.message+=" "+e.toString())}},e.ArgumentOutOfRangeException=class{constructor(t){this.message=t}},e.InvalidEnumArgumentException=class{constructor(t){this.message=t}}},6791:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractGraphicalExpression=void 0;const n=i(4785),s=i(8911);class r extends n.GraphicalObject{constructor(t,e,i){super(),this.expression=e,this.parentMeasure=i,this.boundingBox=new s.BoundingBox(this,t.PositionAndShape),this.parentStaffLine=t,this.parentStaffLine.AbstractExpressions.push(this),this.rules=t.ParentMusicSystem.rules}get Label(){return this.label}get ParentStaffLine(){return this.parentStaffLine}get SourceExpression(){return this.expression}get Placement(){return this.expression.Placement}}e.AbstractGraphicalExpression=r},6055:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractGraphicalInstruction=void 0;const n=i(4785);class s extends n.GraphicalObject{constructor(t){super(),this.parent=t}get Parent(){return this.parent}set Parent(t){this.parent=t}}e.AbstractGraphicalInstruction=s},1070:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AccidentalCalculator=void 0;const n=i(8640),s=i(8640),r=i(1649),o=i(4040);e.AccidentalCalculator=class{constructor(){this.keySignatureNoteAlterationsDict=new r.Dictionary,this.currentAlterationsComparedToKeyInstructionList=[],this.currentInMeasureNoteAlterationsDict=new r.Dictionary}get ActiveKeyInstruction(){return this.activeKeyInstruction}set ActiveKeyInstruction(t){this.activeKeyInstruction=t,this.reactOnKeyInstructionChange()}doCalculationsAtEndOfMeasure(){this.currentInMeasureNoteAlterationsDict.clear(),this.currentAlterationsComparedToKeyInstructionList.clear();for(const t of this.keySignatureNoteAlterationsDict.keys())this.currentInMeasureNoteAlterationsDict.setValue(t,this.keySignatureNoteAlterationsDict.getValue(t))}checkAccidental(t,e){if(!e)return;const i=e.FundamentalNote+12*e.Octave,r=this.currentAlterationsComparedToKeyInstructionList.indexOf(i)>=0;if(this.currentInMeasureNoteAlterationsDict.containsKey(i)){if(r&&this.currentAlterationsComparedToKeyInstructionList.splice(this.currentAlterationsComparedToKeyInstructionList.indexOf(i),1),this.currentInMeasureNoteAlterationsDict.getValue(i)!==e.AccidentalHalfTones){this.keySignatureNoteAlterationsDict.containsKey(i)&&this.keySignatureNoteAlterationsDict.getValue(i)!==e.AccidentalHalfTones?(this.currentAlterationsComparedToKeyInstructionList.push(i),this.currentInMeasureNoteAlterationsDict.setValue(i,e.AccidentalHalfTones)):e.Accidental!==n.AccidentalEnum.NONE&&this.currentInMeasureNoteAlterationsDict.remove(i);const r=this.currentInMeasureNoteAlterationsDict.getValue(i);if(e.Accidental===n.AccidentalEnum.NONE&&(e=.5===Math.abs(r)?new s.Pitch(e.FundamentalNote,e.Octave,n.AccidentalEnum.NONE):new s.Pitch(e.FundamentalNote,e.Octave,n.AccidentalEnum.NATURAL)),this.isAlterAmbiguousAccidental(e.Accidental)&&!e.AccidentalXml)return;o.MusicSheetCalculator.symbolFactory.addGraphicalAccidental(t,e)}}else if(e.Accidental!==n.AccidentalEnum.NONE){if(r||this.currentAlterationsComparedToKeyInstructionList.push(i),this.currentInMeasureNoteAlterationsDict.setValue(i,e.AccidentalHalfTones),this.isAlterAmbiguousAccidental(e.Accidental)&&!e.AccidentalXml)return;o.MusicSheetCalculator.symbolFactory.addGraphicalAccidental(t,e)}else r&&(e=new s.Pitch(e.FundamentalNote,e.Octave,n.AccidentalEnum.NATURAL),this.currentAlterationsComparedToKeyInstructionList.splice(this.currentAlterationsComparedToKeyInstructionList.indexOf(i),1),o.MusicSheetCalculator.symbolFactory.addGraphicalAccidental(t,e))}isAlterAmbiguousAccidental(t){return t===n.AccidentalEnum.SLASHFLAT||t===n.AccidentalEnum.QUARTERTONEFLAT}reactOnKeyInstructionChange(){const t=this.activeKeyInstruction.AlteratedNotes;let e;e=this.activeKeyInstruction.Key>0?n.AccidentalEnum.SHARP:n.AccidentalEnum.FLAT,this.keySignatureNoteAlterationsDict.clear(),this.currentAlterationsComparedToKeyInstructionList.length=0;for(let i=-9;i<9;i++)for(let n=0;nthis.borderLeft?this.borderLeft:this.borderMarginLeft}set BorderMarginLeft(t){this.borderMarginLeft=t,this.calculateMarginRectangle()}get BorderMarginRight(){return this.borderMarginRightthis.borderTop?this.borderTop:this.borderMarginTop}set BorderMarginTop(t){this.borderMarginTop=t,this.calculateMarginRectangle()}get BorderMarginBottom(){return this.borderMarginBottom-1&&this.parent.ChildElements.splice(t,1)}this.parent=t,(null===(i=null===(e=this.parent)||void 0===e?void 0:e.ChildElements)||void 0===i?void 0:i.indexOf(this))>-1?s.default.error("BoundingBox of "+this.dataObject.constructor.name+" already in children list of "+this.parent.dataObject.constructor.name+"'s BoundingBox"):null===(r=null===(n=this.parent)||void 0===n?void 0:n.ChildElements)||void 0===r||r.push(this)}get DataObject(){return this.dataObject}get Center(){return new o.PointF2D(this.RelativePosition.x+(this.BorderMarginRight+this.BorderMarginLeft),this.RelativePosition.y+(this.BorderMarginBottom+this.BorderMarginTop))}setAbsolutePositionFromParent(){this.parent?(this.absolutePosition.x=this.parent.AbsolutePosition.x+this.relativePosition.x,this.absolutePosition.y=this.parent.AbsolutePosition.y+this.relativePosition.y):this.absolutePosition=this.relativePosition}calculateAbsolutePosition(){this.absolutePosition.x=this.relativePosition.x,this.absolutePosition.y=this.relativePosition.y;let t=this.parent;for(;t;)this.absolutePosition.x+=t.relativePosition.x,this.absolutePosition.y+=t.relativePosition.y,t=t.parent}calculateAbsolutePositionsRecursiveWithoutTopelement(){this.absolutePosition.x=0,this.absolutePosition.y=0;for(let t=0,e=this.ChildElements.length;t.001;break;case p.Up:case p.Down:n=this.relativePosition.y,t.calculateMarginPositionAlongDirection(this,e),s=Math.abs(n-this.relativePosition.y)>.001;break;default:throw new r.ArgumentOutOfRangeException("direction")}}while(s)}collisionDetection(t){const e=Math.min(this.AbsolutePosition.x+this.borderRight,t.absolutePosition.x+t.borderRight)-Math.max(this.AbsolutePosition.x+this.borderLeft,t.absolutePosition.x+t.borderLeft),i=Math.min(this.AbsolutePosition.y+this.borderBottom,t.absolutePosition.y+t.borderBottom)-Math.max(this.AbsolutePosition.y+this.borderTop,t.absolutePosition.y+t.borderTop);return e>0&&i>0}liesInsideBorders(t){const e=this.AbsolutePosition.x+this.borderLeft<=t.absolutePosition.x+t.borderLeft&&t.absolutePosition.x+t.borderLeft<=this.AbsolutePosition.x+this.borderRight,i=this.AbsolutePosition.x+this.borderLeft<=t.absolutePosition.x+t.borderRight&&t.absolutePosition.x+t.borderRight<=this.AbsolutePosition.x+this.borderRight;if(e&&i){const e=this.AbsolutePosition.y+this.borderTop<=t.absolutePosition.y+t.borderTop&&t.absolutePosition.y+t.borderTop<=this.AbsolutePosition.y+this.borderBottom,i=this.AbsolutePosition.y+this.borderTop<=t.absolutePosition.y+t.borderBottom&&t.absolutePosition.y+t.borderBottom<=this.AbsolutePosition.y+this.borderBottom;if(e&&i)return!0}return!1}pointLiesInsideBorders(t){return this.AbsolutePosition.x+this.borderLeft<=t.x&&t.x<=this.AbsolutePosition.x+this.borderRight&&this.AbsolutePosition.y+this.borderTop<=t.y&&t.y<=this.AbsolutePosition.y+this.borderBottom}marginCollisionDetection(t){const e=Math.min(this.AbsolutePosition.x+this.borderMarginRight,t.absolutePosition.x+t.borderMarginRight)-Math.max(this.AbsolutePosition.x+this.borderMarginLeft,t.absolutePosition.x+t.borderMarginLeft),i=Math.min(this.AbsolutePosition.y+this.borderMarginBottom,t.absolutePosition.y+t.borderMarginBottom)-Math.max(this.AbsolutePosition.y+this.borderMarginTop,t.absolutePosition.y+t.borderMarginTop);return e>0&&i>0}liesInsideMargins(t){const e=this.AbsolutePosition.x+this.borderMarginLeft<=t.absolutePosition.x+t.borderMarginLeft&&t.absolutePosition.x+t.borderMarginLeft<=this.AbsolutePosition.x+this.borderMarginRight,i=this.AbsolutePosition.x+this.borderMarginLeft<=t.absolutePosition.x+t.borderMarginRight&&t.absolutePosition.x+t.borderMarginRight<=this.AbsolutePosition.x+this.borderMarginRight;if(e&&i){const e=this.AbsolutePosition.y+this.borderMarginTop<=t.absolutePosition.y+t.borderMarginTop&&t.absolutePosition.y+t.borderMarginTop<=this.AbsolutePosition.y+this.borderMarginBottom,i=this.AbsolutePosition.y+this.borderMarginTop<=t.absolutePosition.y+t.borderMarginBottom&&t.absolutePosition.y+t.borderMarginBottom<=this.AbsolutePosition.y+this.borderMarginBottom;if(e&&i)return!0}return!1}pointLiesInsideMargins(t){return this.AbsolutePosition.x+this.borderMarginLeft<=t.x&&t.x<=this.AbsolutePosition.x+this.borderMarginRight&&this.AbsolutePosition.y+this.borderMarginTop<=t.y&&t.y<=this.AbsolutePosition.y+this.borderMarginBottom}computeNonOverlappingPosition(t,e,i){this.RelativePosition=new o.PointF2D(i.x,i.y),this.setAbsolutePositionFromParent();let n=0,s=!1;do{switch(e){case p.Left:case p.Right:n=this.relativePosition.x,t.calculatePositionAlongDirection(this,e),s=Math.abs(n-this.relativePosition.x)>1e-4;break;case p.Up:case p.Down:n=this.relativePosition.y,t.calculatePositionAlongDirection(this,e),s=Math.abs(n-this.relativePosition.y)>1e-4;break;default:throw new r.ArgumentOutOfRangeException("direction")}}while(s)}getClickedObjectOfType(t){const e=this.dataObject;if(this.pointLiesInsideBorders(t)&&e)return e;for(let e=0,i=this.childElements.length;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Clickable=void 0;const n=i(4785);class s extends n.GraphicalObject{}e.Clickable=s},8155:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AutoColorSet=e.NoteState=e.GraphicalLayers=e.StyleSets=e.OUTLINE_AND_FILL_STYLE_DICT=e.OutlineAndFillStyleEnum=void 0;const n=i(1649);var s,r,o,a,l;!function(t){t[t.BaseWritingColor=0]="BaseWritingColor",t[t.FollowingCursor=1]="FollowingCursor",t[t.AlternativeFollowingCursor=2]="AlternativeFollowingCursor",t[t.PlaybackCursor=3]="PlaybackCursor",t[t.Highlighted=4]="Highlighted",t[t.ErrorUnderlay=5]="ErrorUnderlay",t[t.Selected=6]="Selected",t[t.SelectionSymbol=7]="SelectionSymbol",t[t.DebugColor1=8]="DebugColor1",t[t.DebugColor2=9]="DebugColor2",t[t.DebugColor3=10]="DebugColor3",t[t.SplitScreenDivision=11]="SplitScreenDivision",t[t.GreyTransparentOverlay=12]="GreyTransparentOverlay",t[t.MarkedArea1=13]="MarkedArea1",t[t.MarkedArea2=14]="MarkedArea2",t[t.MarkedArea3=15]="MarkedArea3",t[t.MarkedArea4=16]="MarkedArea4",t[t.MarkedArea5=17]="MarkedArea5",t[t.MarkedArea6=18]="MarkedArea6",t[t.MarkedArea7=19]="MarkedArea7",t[t.MarkedArea8=20]="MarkedArea8",t[t.MarkedArea9=21]="MarkedArea9",t[t.MarkedArea10=22]="MarkedArea10",t[t.Comment1=23]="Comment1",t[t.Comment2=24]="Comment2",t[t.Comment3=25]="Comment3",t[t.Comment4=26]="Comment4",t[t.Comment5=27]="Comment5",t[t.Comment6=28]="Comment6",t[t.Comment7=29]="Comment7",t[t.Comment8=30]="Comment8",t[t.Comment9=31]="Comment9",t[t.Comment10=32]="Comment10"}(s=e.OutlineAndFillStyleEnum||(e.OutlineAndFillStyleEnum={})),e.OUTLINE_AND_FILL_STYLE_DICT=new n.Dictionary,e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.BaseWritingColor,"Thistle"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.FollowingCursor,"Aqua"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.AlternativeFollowingCursor,"Azure"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.PlaybackCursor,"Bisque"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Highlighted,"CadetBlue"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.ErrorUnderlay,"DarkBlue"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Selected,"DarkGoldenRod"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.SelectionSymbol,"BlanchedAlmond"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.DebugColor1,"Chartreuse"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.DebugColor2,"DarkGreen"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.DebugColor3,"DarkOrange"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.SplitScreenDivision,"FireBrick"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.GreyTransparentOverlay,"DarkSalmon"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea1,"DarkSeaGreen"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea2,"DarkOrchid"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea3,"Aquamarine"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea4,"DarkKhaki"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea5,"ForestGreen"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea6,"AliceBlue"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea7,"DeepPink"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea8,"Coral"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea9,"DarkOliveGreen"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea10,"Chocolate"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment1,"DodgerBlue"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment2,"Blue"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment3,"Beige"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment4,"Crimson"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment5,"Fuchsia"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment6,"Brown"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment7,"BlanchedAlmond"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment8,"CornflowerBlue"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment9,"Cornsilk"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment10,"DarkGrey"),(l=e.StyleSets||(e.StyleSets={}))[l.MarkedArea=0]="MarkedArea",l[l.Comment=1]="Comment",(a=e.GraphicalLayers||(e.GraphicalLayers={}))[a.Background=0]="Background",a[a.Highlight=1]="Highlight",a[a.MeasureError=2]="MeasureError",a[a.SelectionSymbol=3]="SelectionSymbol",a[a.Cursor=4]="Cursor",a[a.PSI_Debug=5]="PSI_Debug",a[a.Notes=6]="Notes",a[a.Comment=7]="Comment",a[a.Debug_above=8]="Debug_above",(o=e.NoteState||(e.NoteState={}))[o.Normal=0]="Normal",o[o.Selected=1]="Selected",o[o.Follow_Confirmed=2]="Follow_Confirmed",o[o.QFeedback_NotFound=3]="QFeedback_NotFound",o[o.QFeedback_OK=4]="QFeedback_OK",o[o.QFeedback_Perfect=5]="QFeedback_Perfect",o[o.Debug1=6]="Debug1",o[o.Debug2=7]="Debug2",o[o.Debug3=8]="Debug3",(r=e.AutoColorSet||(e.AutoColorSet={})).C="#d82c6b",r.D="#F89D15",r.E="#FFE21A",r.F="#4dbd5c",r.G="#009D96",r.A="#43469d",r.B="#76429c",r.Rest="#000000"},5074:(t,e)=>{"use strict";var i,n,s;Object.defineProperty(e,"__esModule",{value:!0}),e.PhonicScoreModes=e.MusicSymbolDrawingStyle=e.DrawingMode=void 0,(s=e.DrawingMode||(e.DrawingMode={}))[s.All=0]="All",s[s.NoOverlays=1]="NoOverlays",s[s.Leadsheet=2]="Leadsheet",(n=e.MusicSymbolDrawingStyle||(e.MusicSymbolDrawingStyle={}))[n.Normal=0]="Normal",n[n.Disabled=1]="Disabled",n[n.Selected=2]="Selected",n[n.Clickable=3]="Clickable",n[n.PlaybackSymbols=4]="PlaybackSymbols",n[n.FollowSymbols=5]="FollowSymbols",n[n.QFeedbackNotFound=6]="QFeedbackNotFound",n[n.QFeedbackOk=7]="QFeedbackOk",n[n.QFeedbackPerfect=8]="QFeedbackPerfect",n[n.Debug1=9]="Debug1",n[n.Debug2=10]="Debug2",n[n.Debug3=11]="Debug3",(i=e.PhonicScoreModes||(e.PhonicScoreModes={}))[i.Following=0]="Following",i[i.Midi=1]="Midi",i[i.Manual=2]="Manual"},7459:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DrawingParameters=e.DrawingParametersEnum=e.ColoringModes=void 0;const n=i(1405),s=i(3748);var r,o;(o=e.ColoringModes||(e.ColoringModes={}))[o.XML=0]="XML",o[o.AutoColoring=1]="AutoColoring",o[o.CustomColorSet=2]="CustomColorSet",function(t){t.allon="allon",t.compact="compact",t.compacttight="compacttight",t.default="default",t.leadsheet="leadsheet",t.preview="preview",t.thumbnail="thumbnail"}(r=e.DrawingParametersEnum||(e.DrawingParametersEnum={})),e.DrawingParameters=class{constructor(t=r.default){this.rules=new n.EngravingRules,this.drawCursors=!0,this.drawTitle=!0,this.drawSubtitle=!0,this.drawLyricist=!0,this.drawComposer=!0,this.drawCredits=!0,this.drawPartNames=!0,this.fingeringPosition=s.PlacementEnum.Left,this.drawHiddenNotes=!1,this.DrawingParametersEnum=t}set DrawingParametersEnum(t){switch(this.drawingParametersEnum=t,t){case r.allon:this.setForAllOn();break;case r.thumbnail:this.setForThumbnail();break;case r.leadsheet:this.setForLeadsheet();break;case r.compact:this.setForCompactMode();break;case r.compacttight:this.setForCompactTightMode();break;case r.default:default:this.setForDefault()}}get DrawingParametersEnum(){return this.drawingParametersEnum}setForAllOn(){this.drawHighlights=!0,this.drawErrors=!0,this.drawSelectionStartSymbol=!0,this.drawSelectionEndSymbol=!0,this.drawCursors=!0,this.drawActivitySymbols=!0,this.drawScrollIndicator=!0,this.drawAnnotations=!0,this.drawComments=!0,this.drawMarkedAreas=!0,this.DrawTitle=!0,this.DrawSubtitle=!0,this.DrawComposer=!0,this.DrawLyricist=!0,this.drawCredits=!0,this.DrawPartNames=!0,this.drawHiddenNotes=!0,this.rules.CompactMode=!1}setForDefault(){this.rules.loadDefaultValues(),this.setForAllOn(),this.drawHiddenNotes=!1}setForThumbnail(){this.drawHighlights=!1,this.drawErrors=!1,this.drawSelectionStartSymbol=!1,this.drawSelectionStartSymbol=!1,this.drawCursors=!1,this.drawActivitySymbols=!1,this.drawScrollIndicator=!1,this.drawAnnotations=!0,this.drawComments=!0,this.drawMarkedAreas=!0,this.drawHiddenNotes=!1}setForCompactMode(){this.rules.CompactMode=!0,this.DrawCredits=!1,this.drawHiddenNotes=!1}setForCompactTightMode(){this.setForCompactMode(),this.DrawPartNames=!1,this.rules.VoiceSpacingMultiplierVexflow=.65,this.rules.VoiceSpacingAddendVexflow=2,this.rules.MinSkyBottomDistBetweenStaves=1,this.rules.MinSkyBottomDistBetweenSystems=1,this.rules.BetweenStaffDistance=2.5,this.rules.StaffDistance=3.5,this.rules.MinimumDistanceBetweenSystems=1,this.rules.PageBottomMargin=0,this.rules.PageLeftMargin=2,this.rules.PageRightMargin=2}setForLeadsheet(){this.drawHighlights=!1,this.drawErrors=!1,this.drawSelectionStartSymbol=!0,this.drawSelectionEndSymbol=!0,this.drawCursors=!0,this.drawActivitySymbols=!1,this.drawScrollIndicator=!0,this.drawAnnotations=!0,this.drawComments=!0,this.drawMarkedAreas=!0}get DrawCredits(){return this.drawCredits}set DrawCredits(t){this.drawCredits=t,this.DrawComposer=t,this.DrawTitle=t,this.DrawSubtitle=t,this.DrawLyricist=t}get DrawTitle(){return this.drawTitle}set DrawTitle(t){this.drawTitle=t,this.rules.RenderTitle=t,t||(this.DrawSubtitle=!1)}get DrawSubtitle(){return this.drawSubtitle}set DrawSubtitle(t){this.drawSubtitle=t,this.rules.RenderSubtitle=t,t&&(this.DrawTitle=!0)}get DrawComposer(){return this.drawComposer}set DrawComposer(t){this.drawComposer=t,this.rules.RenderComposer=t}get DrawLyricist(){return this.drawLyricist}set DrawLyricist(t){this.drawLyricist=t,this.rules.RenderLyricist=t}get DrawPartNames(){return this.drawPartNames}set DrawPartNames(t){this.drawPartNames=t,this.rules.RenderPartNames=t,this.rules.RenderPartNames||(this.rules.RenderPartAbbreviations=!1)}get FingeringPosition(){return this.fingeringPosition}set FingeringPosition(t){this.fingeringPosition=t,this.rules.FingeringPosition=t}get Rules(){return this.rules}set Rules(t){this.rules=t}}},1405:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.PageFormat=e.EngravingRules=void 0;const s=i(599),r=n(i(2043)),o=i(1274),a=i(3748),l=i(41),h=i(7459),u=i(1649),c=i(5544),d=i(4123),p=i(3486);class f{constructor(){this.DYSlursStartingAtSameStaffEntryYOffset=0,this.DYMinNoteWidth=0,this.DYWorkId=0,this.DYWorkSpecial=!1,this.DYContainerId="osmdCanvasPage",this.DYSVGContainerId="osmdSvgPage",this.DYMusicScoreType="staff",this.DYMusicClientType="",this.NoteDistances=[1,1,1.3,1.6,2,2.5,3,4],this.NoteDistancesScalingFactors=[1,2,4,8,16,32,64,128],this.DurationDistanceDict={},this.DurationScalingDistanceDict={},this.NoteToGraphicalNoteMapObjectCount=0,this.PlayAlreadyStartedNotesFromCursorPosition=!1,this.PlaybackSkipNotesSafetyInterval=.02,this.UseDefaultVoiceInteractionListener=!0,this.loadDefaultValues()}loadDefaultValues(){this.SamplingUnit=3*f.unit,this.MpatMode=!0,this.SheetTitleHeight=4,this.SheetSubtitleHeight=2,this.SheetMinimumDistanceBetweenTitleAndSubtitle=1,this.SheetComposerHeight=2,this.SheetAuthorHeight=2,this.CompactMode=!1,this.PagePlacementEnum=s.PagePlacementEnum.Down,this.PageHeight=100001,this.PageTopMargin=5,this.PageTopMarginNarrow=0,this.PageBottomMargin=5,this.PageLeftMargin=5,this.PageRightMargin=5,this.TitleTopDistance=5,this.TitleBottomDistance=1,this.StaffDistance=7,this.BetweenStaffDistance=5,this.MinimumStaffLineDistance=4,this.MinSkyBottomDistBetweenStaves=1,this.StaffHeight=4,this.TabStaffInterlineHeight=1.1111,this.BetweenStaffLinesDistance=f.unit,this.SystemLeftMargin=0,this.SystemRightMargin=0,this.SystemLabelsRightMargin=2,this.SystemComposerDistance=2,this.InstrumentLabelTextHeight=2,this.MinimumDistanceBetweenSystems=7,this.MinSkyBottomDistBetweenSystems=5,this.LastSystemMaxScalingFactor=1.4,this.AutoBeamNotes=!1,this.AutoBeamOptions={beam_middle_rests_only:!1,beam_rests:!1,maintain_stem_directions:!1},this.AutoBeamTabs=!1,this.BeamWidth=f.unit/2,this.BeamSpaceWidth=f.unit/3,this.BeamForwardLength=1.25*f.unit,this.FlatBeams=!1,this.FlatBeamOffset=20,this.FlatBeamOffsetPerBeam=10,this.ClefLeftMargin=.5,this.ClefRightMargin=.75,this.PercussionOneLineCutoff=3,this.PercussionForceVoicesOneLineCutoff=1,this.PercussionUseXMLDisplayStep=!0,this.PercussionXMLDisplayStepNoteValueShift=0,this.PercussionOneLineXMLDisplayStepOctaveOffset=0,this.BetweenKeySymbolsDistance=.2,this.KeyRightMargin=.75,this.RhythmRightMargin=1.25,this.ShowRhythmAgainAfterPartEndOrFinalBarline=!0,this.NewPartAndSystemAfterFinalBarline=!1,this.InStaffClefScalingFactor=.8,this.DistanceBetweenNaturalAndSymbolWhenCancelling=.4,this.NoteHelperLinesOffset=.25,this.MeasureLeftMargin=.7,this.MeasureRightMargin=0,this.DistanceBetweenLastInstructionAndRepetitionBarline=1,this.ArpeggioDistance=.6,this.StaccatoShorteningFactor=2,this.IdealStemLength=3,this.StemNoteHeadBorderYOffset=.2,this.StemMargin=.2,this.StemMinLength=2.5,this.StemMaxLength=4.5,this.BeamSlopeMaxAngle=10,this.StemMinAllowedDistanceBetweenNoteHeadAndBeamLine=1,this.SetWantedStemDirectionByXml=!0,this.GraceNoteScalingFactor=.6,this.GraceNoteXOffset=.2,this.WedgeOpeningLength=1.2,this.WedgeMeasureEndOpeningLength=.75,this.WedgeMeasureBeginOpeningLength=.75,this.WedgePlacementAboveY=-1.5,this.WedgePlacementBelowY=1.5,this.WedgeHorizontalMargin=.6,this.WedgeVerticalMargin=.5,this.DistanceOffsetBetweenTwoHorizontallyCrossedWedges=.3,this.WedgeMinLength=2,this.WedgeEndDistanceBetweenTimestampsFactor=1.75,this.DistanceBetweenAdjacentDynamics=.75,this.TempoChangeMeasureValidity=4,this.TempoContinousFactor=.7,this.StaccatoScalingFactor=.8,this.BetweenDotsDistance=.8,this.OrnamentAccidentalScalingFactor=.65,this.ChordSymbolTextHeight=2,this.ChordSymbolTextAlignment=o.TextAlignmentEnum.LeftBottom,this.ChordSymbolRelativeXOffset=-1,this.ChordSymbolXSpacing=1,this.ChordOverlapAllowedIntoNextMeasure=0,this.ChordSymbolYOffset=.1,this.ChordSymbolYPadding=0,this.ChordSymbolYAlignment=!0,this.ChordSymbolYAlignmentScope="staffline",this.ChordSymbolLabelTexts=new u.Dictionary,this.resetChordSymbolLabelTexts(this.ChordSymbolLabelTexts),this.CustomChords=[],this.resetChordNames(),this.RepetitionSymbolsYOffset=0,this.RehearsalMarkXOffsetDefault=10,this.RehearsalMarkXOffset=0,this.RehearsalMarkXOffsetSystemStartMeasure=-20,this.RehearsalMarkYOffsetDefault=-15,this.RehearsalMarkYOffset=0,this.RehearsalMarkFontSize=10,this.MeasureNumberLabelHeight=1.5*f.unit,this.MeasureNumberLabelOffset=2,this.MeasureNumberLabelXOffset=-.5,this.TupletsRatioed=!1,this.TupletsBracketed=!1,this.TripletsBracketed=!1,this.TupletNumberLabelHeight=1.5*f.unit,this.TupletNumberYOffset=.5,this.LabelMarginBorderFactor=.1,this.TupletVerticalLineLength=.5,this.TupletNumbersInTabs=!1,this.SlurPlacementFromXML=!0,this.BezierCurveStepSize=1e3,this.calculateCurveParametersArrays(),this.TieGhostObjectWidth=.75,this.TieYPositionOffsetFactor=.3,this.MinimumNeededXspaceForTieGhostObject=1,this.TieHeightMinimum=.28,this.TieHeightMaximum=1.2,this.TieHeightInterpolationK=.0288,this.TieHeightInterpolationD=.136,this.SlurNoteHeadYOffset=.5,this.SlurStemXOffset=.3,this.SlurSlopeMaxAngle=15,this.SlurTangentMinAngle=30,this.SlurTangentMaxAngle=80,this.SlurHeightFactor=1,this.SlurHeightFlattenLongSlursFactorByWidth=.24,this.SlurHeightFlattenLongSlursFactorByAngle=.36,this.SlurHeightFlattenLongSlursCutoffAngle=47,this.SlurHeightFlattenLongSlursCutoffWidth=16,this.SlursStartingAtSameStaffEntryYOffset=.8,this.SlurMaximumYControlPointDistance=void 0,this.RepetitionEndingLabelHeight=2,this.RepetitionEndingLabelXOffset=.5,this.RepetitionEndingLabelYOffset=.3,this.RepetitionEndingLineYLowerOffset=.5,this.RepetitionEndingLineYUpperOffset=.3,this.VoltaOffset=2.5,this.LyricsAlignmentStandard=o.TextAlignmentEnum.LeftBottom,this.LyricsHeight=2,this.LyricsYOffsetToStaffHeight=0,this.VerticalBetweenLyricsDistance=.5,this.HorizontalBetweenLyricsDistance=.2,this.BetweenSyllableMaximumDistance=10,this.BetweenSyllableMinimumDistance=.5,this.LyricOverlapAllowedIntoNextMeasure=3.4,this.MinimumDistanceBetweenDashes=10,this.MaximumLyricsElongationFactor=2.5,this.InstantaneousTempoTextHeight=2.3,this.ContinuousDynamicTextHeight=2.3,this.MoodTextHeight=2.3,this.UnknownTextHeight=2,this.ContinuousTempoTextHeight=2.3,this.DynamicExpressionMaxDistance=2,this.DynamicExpressionSpacer=.5,this.VexFlowDefaultNotationFontScale=39,this.VexFlowDefaultTabFontScale=39,this.TremoloStrokeScale=1,this.TremoloYSpacingScale=1,this.StemWidth=.15,this.StaffLineWidth=.1,this.StaffLineColor=void 0,this.LedgerLineWidth=1,this.LedgerLineStrokeStyle=void 0,this.LedgerLineColorDefault="#000000",this.WedgeLineWidth=.12,this.TupletLineWidth=.12,this.LyricUnderscoreLineWidth=.12,this.SystemThinLineWidth=.12,this.SystemBoldLineWidth=f.unit/2,this.SystemRepetitionEndingLineWidth=.12,this.SystemDotWidth=f.unit/2,this.DistanceBetweenVerticalSystemLines=.35,this.DistanceBetweenDotAndLine=.7,this.RepeatEndStartPadding=2,this.OctaveShiftLineWidth=.12,this.OctaveShiftVerticalLineLength=f.unit,this.GraceLineWidth=this.StaffLineWidth*this.GraceNoteScalingFactor,this.MultipleRestMeasureDefaultWidth=4,this.MinimumCrossedBeamDifferenceMargin=1e-4,this.SheetMaximumWidth=32767,this.VoiceSpacingMultiplierVexflow=.85,this.VoiceSpacingAddendVexflow=3,this.PickupMeasureWidthMultiplier=1,this.DisplacedNoteMargin=.1,this.MinNoteDistance=2,this.SubMeasureXSpacingThreshold=35,this.MeasureDynamicsMaxScalingFactor=2.5,this.WholeRestXShiftVexflow=-1.5,this.MetronomeMarksDrawn=!0,this.MetronomeMarkXShift=-6,this.MetronomeMarkYShift=-.5,this.SoftmaxFactorVexFlow=15,this.StaggerSameWholeNotes=!0,this.AlignRests=l.AlignRestOption.Never,this.RestCollisionYPadding=0,this.FillEmptyMeasuresWithWholeRest=l.FillEmptyMeasuresWithWholeRests.No,this.ArpeggiosGoAcrossVoices=!1,this.RenderArpeggios=!0,this.RenderSlurs=!0,this.ColoringMode=h.ColoringModes.XML,this.ColoringEnabled=!0,this.ColorStemsLikeNoteheads=!1,this.ColorBeams=!0,this.ColorFlags=!0,this.applyDefaultColorMusic("#000000"),this.DefaultColorCursor="#33e02f",this.DefaultFontFamily="Times New Roman",this.DefaultFontStyle=c.FontStyles.Regular,this.DefaultVexFlowNoteFont="gonville",this.MaxMeasureToDrawIndex=Number.MAX_VALUE,this.MinMeasureToDrawIndex=0,this.MaxSystemToDrawNumber=Number.MAX_VALUE,this.MaxPageToDrawNumber=Number.MAX_VALUE,this.RenderComposer=!0,this.RenderTitle=!0,this.RenderSubtitle=!0,this.RenderLyricist=!0,this.RenderPartNames=!0,this.RenderPartAbbreviations=!0,this.RenderFingerings=!0,this.RenderMeasureNumbers=!0,this.RenderMeasureNumbersOnlyAtSystemStart=!1,this.UseXMLMeasureNumbers=!0,this.RenderLyrics=!0,this.RenderChordSymbols=!0,this.RenderMultipleRestMeasures=!0,this.AutoGenerateMutipleRestMeasuresFromRestMeasures=!0,this.RenderRehearsalMarks=!0,this.RenderClefsAtBeginningOfStaffline=!0,this.RenderKeySignatures=!0,this.RenderTimeSignatures=!0,this.ArticulationPlacementFromXML=!0,this.FingeringPosition=a.PlacementEnum.AboveOrBelow,this.FingeringPositionFromXML=!0,this.FingeringPositionGrace=a.PlacementEnum.Left,this.FingeringInsideStafflines=!1,this.FingeringLabelFontHeight=1.7,this.FingeringOffsetX=0,this.FingeringOffsetY=0,this.FingeringPaddingY=-.2,this.FingeringTextSize=1.5,this.RenderStringNumbersClassical=!0,this.StringNumberOffsetY=0,this.NewSystemAtXMLNewSystemAttribute=!1,this.NewPageAtXMLNewPageAttribute=!1,this.RestoreCursorAfterRerender=!0,this.StretchLastSystemLine=!1,f.FixStafflineBoundingBox=!1,this.PageFormat=m.UndefinedPageFormat,this.PageBackgroundColor=void 0,this.PerformanceMode=!1,this.RenderSingleHorizontalStaffline=!1,this.SpacingBetweenTextLines=0,this.NoteToGraphicalNoteMap=new u.Dictionary,this.NoteToGraphicalNoteMapObjectCount=0;try{this.MaxInstructionsConstValue=this.ClefLeftMargin+this.ClefRightMargin+this.KeyRightMargin+this.RhythmRightMargin+11}catch(t){r.default.info("EngravingRules()",t)}this.MpatMode&&(this.NewPartAndSystemAfterFinalBarline=!0)}applyDefaultColorMusic(t){this.DefaultColorMusic=t,this.DefaultColorNotehead=this.DefaultColorMusic,this.DefaultColorRest=this.DefaultColorNotehead,this.DefaultColorStem=this.DefaultColorNotehead,this.DefaultColorLabel=this.DefaultColorNotehead,this.DefaultColorTitle=this.DefaultColorNotehead,this.LedgerLineColorDefault=this.DefaultColorNotehead}addGraphicalNoteToNoteMap(t,e){t.NoteToGraphicalNoteObjectId=this.NoteToGraphicalNoteMapObjectCount,this.NoteToGraphicalNoteMap.setValue(t.NoteToGraphicalNoteObjectId,e),this.NoteToGraphicalNoteMapObjectCount++}GNote(t){return p.GraphicalNote.FromNote(t,this)}clearMusicSheetObjects(){this.NoteToGraphicalNoteMap=new u.Dictionary,this.NoteToGraphicalNoteMapObjectCount=0}setChordSymbolLabelText(t,e){this.ChordSymbolLabelTexts.setValue(t,e)}resetChordSymbolLabelTexts(t){return t.setValue(d.ChordSymbolEnum.minor,"m"),t.setValue(d.ChordSymbolEnum.augmented,"aug"),t.setValue(d.ChordSymbolEnum.diminished,"dim"),t.setValue(d.ChordSymbolEnum.dominant,"7"),t.setValue(d.ChordSymbolEnum.majorseventh,"maj7"),t.setValue(d.ChordSymbolEnum.minorseventh,"m7"),t.setValue(d.ChordSymbolEnum.diminishedseventh,"dim7"),t.setValue(d.ChordSymbolEnum.augmentedseventh,"aug7"),t.setValue(d.ChordSymbolEnum.halfdiminished,"m7b5"),t.setValue(d.ChordSymbolEnum.majorminor,"m(maj7)"),t.setValue(d.ChordSymbolEnum.majorsixth,"maj6"),t.setValue(d.ChordSymbolEnum.minorsixth,"m6"),t.setValue(d.ChordSymbolEnum.dominantninth,"9"),t.setValue(d.ChordSymbolEnum.majorninth,"maj9"),t.setValue(d.ChordSymbolEnum.minorninth,"m9"),t.setValue(d.ChordSymbolEnum.dominant11th,"11"),t.setValue(d.ChordSymbolEnum.major11th,"maj11"),t.setValue(d.ChordSymbolEnum.minor11th,"m11"),t.setValue(d.ChordSymbolEnum.dominant13th,"13"),t.setValue(d.ChordSymbolEnum.major13th,"maj13"),t.setValue(d.ChordSymbolEnum.minor13th,"m13"),t.setValue(d.ChordSymbolEnum.suspendedsecond,"sus2"),t.setValue(d.ChordSymbolEnum.suspendedfourth,"sus4"),t.setValue(d.ChordSymbolEnum.power,"5"),t.setValue(d.ChordSymbolEnum.none,"N.C."),t}addChordName(t,e,i,n,s){if(void 0!==d.ChordSymbolEnum[e]){const r={adds:i,alts:n,subs:s};this.CustomChords.push(d.CustomChord.createCustomChord(t,d.ChordSymbolEnum[e],r))}}renameChord(t,e){d.CustomChord.renameCustomChord(t,e,this.CustomChords)}resetChordNames(){this.addChordName("alt","major",["#5","b9","#9"],["b5"],[]),this.addChordName("7alt","dominant",["#5","b9","#9"],["b5"],[]),this.addChordName("7sus4","dominant",["4"],[],["3"]),this.addChordName("7sus4","suspendedfourth",["7"],[],[]),this.addChordName("9sus4","dominantninth",["4"],[],["3"]),this.addChordName("9sus4","suspendedfourth",["9"],[],[]),this.addChordName("11sus4","dominant11th",["4"],[],["3"]),this.addChordName("11sus4","suspendedfourth",["11"],[],[]),this.addChordName("13sus4","dominant13th",["4"],[],["3"]),this.addChordName("13sus4","suspendedfourth",["13"],[],[]),this.addChordName("7sus2","dominant",["2"],[],["3"]),this.addChordName("7sus2","suspendedsecond",["7"],[],[]),this.addChordName("m7b5","minorseventh",[],["b5"],[]),this.addChordName("9sus2","dominantninth",["2"],[],["3"]),this.addChordName("9sus2","suspendedsecond",["9"],[],[]),this.addChordName("11sus2","dominant11th",["2"],[],["3"]),this.addChordName("11sus2","suspendedsecond",["11"],[],[]),this.addChordName("13sus2","dominant13th",["2"],[],["3"]),this.addChordName("13sus2","suspendedsecond",["13"],[],[]),this.addChordName("m(maj9)","majorminor",["9"],[],[]),this.addChordName("m(maj11)","majorminor",["11"],[],[]),this.addChordName("m(maj13)","majorminor",["13"],[],[]),this.addChordName("69","majorsixth",["9"],[],[]),this.addChordName("mi69","minorsixth",["9"],[],[])}calculateCurveParametersArrays(){this.TPower3=new Array(this.BezierCurveStepSize),this.OneMinusTPower3=new Array(this.BezierCurveStepSize),this.FactorOne=new Array(this.BezierCurveStepSize),this.FactorTwo=new Array(this.BezierCurveStepSize);for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalChordSymbolContainer=void 0;const n=i(2255),s=i(9946),r=i(4123),o=i(8911),a=i(4785),l=i(9086);class h extends a.GraphicalObject{constructor(t,e,i,n,s,r){super(),this.chordSymbolContainer=t,this.boundingBox=new o.BoundingBox(this,e),this.rules=r,this.calculateLabel(i,s,n)}get GetChordSymbolContainer(){return this.chordSymbolContainer}get GraphicalLabel(){return this.graphicalLabel}calculateLabel(t,e,i){const o=r.ChordSymbolContainer.calculateChordText(this.chordSymbolContainer,e,i);this.graphicalLabel=new s.GraphicalLabel(new n.Label(o),t,this.rules.ChordSymbolTextAlignment,this.rules,this.boundingBox),this.graphicalLabel.PositionAndShape.RelativePosition=new l.PointF2D(this.rules.ChordSymbolRelativeXOffset,0),this.graphicalLabel.Label.colorDefault=this.rules.DefaultColorChordSymbol}}e.GraphicalChordSymbolContainer=h},374:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalContinuousDynamicExpression=void 0;const s=i(6729),r=i(7839),o=i(9086),a=i(6791),l=i(3748),h=n(i(2043));class u extends a.AbstractGraphicalExpression{constructor(t,e,i){super(e,t,i),this.lines=[],this.isSplittedPart=!1,this.notToBeRemoved=!1}get StartMeasure(){return this.startMeasure}set StartMeasure(t){this.startMeasure=t}get EndMeasure(){return this.endMeasure}set EndMeasure(t){this.endMeasure=t}get EndStaffLine(){return this.endMeasure?this.endMeasure.ParentStaffLine:void 0}get IsSplittedPart(){return this.isSplittedPart}set IsSplittedPart(t){this.isSplittedPart=t}get IsVerbal(){return this.ContinuousDynamic.Label&&this.ContinuousDynamic.Label.length>0}get NotToBeRemoved(){return this.notToBeRemoved}set NotToBeRemoved(t){this.notToBeRemoved=t}get Lines(){return this.lines}get ContinuousDynamic(){return this.SourceExpression}updateSkyBottomLine(){var t;const e=this.parentStaffLine.SkyBottomLineCalculator,i=this.IsVerbal?this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginLeft:0,n=this.IsVerbal?this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginRight:0;switch(!this.IsVerbal&&this.lines.length<2&&h.default.warn("Not enough lines for SkyBottomLine calculation"),this.IsVerbal||this.ContinuousDynamic.DynamicType!==r.ContDynamicEnum.crescendo&&this.ContinuousDynamic.DynamicType!==r.ContDynamicEnum.diminuendo&&h.default.warn("GraphicalContinuousDynamicExpression.updateSkyBottomLine(): unhandled continuous dynamic type. start measure: "+(null===(t=this.startMeasure)||void 0===t?void 0:t.MeasureNumber)),this.Placement){case l.PlacementEnum.Above:if(this.IsVerbal){const t=this.label.PositionAndShape.BorderMarginTop+this.label.PositionAndShape.RelativePosition.y;e.updateSkyLineInRange(i,n,t)}else this.ContinuousDynamic.DynamicType===r.ContDynamicEnum.crescendo?e.updateSkyLineWithWedge(this.lines[0].Start,this.lines[0].End):this.ContinuousDynamic.DynamicType===r.ContDynamicEnum.diminuendo&&e.updateSkyLineWithWedge(this.lines[0].End,this.lines[0].Start);break;case l.PlacementEnum.Below:if(this.IsVerbal){const t=this.label.PositionAndShape.BorderMarginBottom+this.label.PositionAndShape.RelativePosition.y;e.updateBottomLineInRange(i,n,t)}else this.ContinuousDynamic.DynamicType===r.ContDynamicEnum.crescendo?e.updateBottomLineWithWedge(this.lines[1].Start,this.lines[1].End):this.ContinuousDynamic.DynamicType===r.ContDynamicEnum.diminuendo&&e.updateBottomLineWithWedge(this.lines[1].End,this.lines[1].Start);break;default:h.default.error("Placement for GraphicalContinuousDynamicExpression is unknown")}}createCrescendoLines(t,e,i,n=this.rules.WedgeOpeningLength,s=this.rules.WedgeLineWidth){const r=new o.PointF2D(t,i),a=new o.PointF2D(e,i-n/2),l=new o.PointF2D(e,i+n/2);this.addWedgeLines(r,a,l,s)}createFirstHalfCrescendoLines(t,e,i,n=this.rules.WedgeMeasureEndOpeningLength,s=this.rules.WedgeLineWidth){const r=new o.PointF2D(t,i),a=new o.PointF2D(e,i-n/2),l=new o.PointF2D(e,i+n/2);this.addWedgeLines(r,a,l,s)}createSecondHalfCrescendoLines(t,e,i,n=this.rules.WedgeMeasureBeginOpeningLength,s=this.rules.WedgeOpeningLength,r=this.rules.WedgeLineWidth){const a=new o.PointF2D(t,i-n/2),l=new o.PointF2D(t,i+n/2),h=new o.PointF2D(e,i-s/2),u=new o.PointF2D(e,i+s/2);this.addDoubleLines(a,h,l,u,r)}recalculateCrescendoLines(t,e,i){const n=Math.abs(this.lines[0].Start.y-this.lines[1].Start.y)>1e-4;this.lines.clear(),n?this.createSecondHalfCrescendoLines(t,e,i):this.isSplittedPart?this.createFirstHalfCrescendoLines(t,e,i):this.createCrescendoLines(t,e,i)}createDiminuendoLines(t,e,i,n=this.rules.WedgeOpeningLength,s=this.rules.WedgeLineWidth){const r=new o.PointF2D(t,i-n/2),a=new o.PointF2D(t,i+n/2),l=new o.PointF2D(e,i);this.addWedgeLines(l,r,a,s)}createFirstHalfDiminuendoLines(t,e,i,n=this.rules.WedgeOpeningLength,s=this.rules.WedgeMeasureEndOpeningLength,r=this.rules.WedgeLineWidth){const a=new o.PointF2D(t,i-n/2),l=new o.PointF2D(t,i+n/2),h=new o.PointF2D(e,i-s/2),u=new o.PointF2D(e,i+s/2);this.addDoubleLines(a,h,l,u,r)}createSecondHalfDiminuendoLines(t,e,i,n=this.rules.WedgeMeasureBeginOpeningLength,s=this.rules.WedgeLineWidth){const r=new o.PointF2D(t,i-n/2),a=new o.PointF2D(t,i+n/2),l=new o.PointF2D(e,i);this.addWedgeLines(l,r,a,s)}recalculateDiminuendoLines(t,e,i){const n=Math.abs(this.lines[0].End.y-this.lines[1].End.y)>1e-4;this.lines.clear(),n?this.createFirstHalfDiminuendoLines(t,e,i):this.isSplittedPart?this.createSecondHalfDiminuendoLines(t,e,i):this.createDiminuendoLines(t,e,i)}calcPsi(){this.IsVerbal?this.PositionAndShape.calculateBoundingBox():(this.PositionAndShape.RelativePosition=this.lines[0].Start,this.PositionAndShape.BorderMarginTop=this.lines[0].End.y-this.lines[0].Start.y,this.PositionAndShape.BorderMarginBottom=this.lines[1].End.y-this.lines[1].Start.y,this.PositionAndShape.Center.y=(this.PositionAndShape.BorderMarginTop+this.PositionAndShape.BorderMarginBottom)/2,this.ContinuousDynamic.DynamicType===r.ContDynamicEnum.crescendo?(this.PositionAndShape.BorderMarginLeft=0,this.PositionAndShape.BorderMarginRight=this.lines[0].End.x-this.lines[0].Start.x):(this.PositionAndShape.BorderMarginLeft=this.lines[0].End.x-this.lines[0].Start.x,this.PositionAndShape.BorderMarginRight=0))}cleanUp(){this.lines.clear()}shiftYPosition(t){this.IsVerbal?(this.PositionAndShape.RelativePosition.y+=t,this.PositionAndShape.calculateBoundingBox()):(this.lines[0].Start.y+=t,this.lines[0].End.y+=t,this.lines[1].End.y+=t)}squeeze(t){this.IsVerbal||Math.abs(this.lines[0].End.x-this.lines[0].Start.x)0?this.lines[0].Start.x+=t:(this.lines[0].End.x+=t,this.lines[1].End.x+=t):t<0?this.lines[0].Start.x+=t:(this.lines[0].End.x+=t,this.lines[1].End.x+=t),this.calcPsi())}addWedgeLines(t,e,i,n){const r=new s.GraphicalLine(t,e,n),o=new s.GraphicalLine(t,i,n);this.lines.push(r),this.lines.push(o)}addDoubleLines(t,e,i,n,r){const o=new s.GraphicalLine(t,e,r),a=new s.GraphicalLine(i,n,r);this.lines.push(o),this.lines.push(a)}}e.GraphicalContinuousDynamicExpression=u},5330:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalCurve=void 0;const n=i(9086);class s{constructor(){s.tPow3=new Array(s.bezierCurveStepSize),s.oneMinusTPow3=new Array(s.bezierCurveStepSize),s.bezierFactorOne=new Array(s.bezierCurveStepSize),s.bezierFactorTwo=new Array(s.bezierCurveStepSize);for(let t=0;t=s.bezierCurveStepSize?new n.PointF2D:new n.PointF2D(s.oneMinusTPow3[e]*this.bezierStartPt.x+s.bezierFactorOne[e]*this.bezierStartControlPt.x+s.bezierFactorTwo[e]*this.bezierEndControlPt.x+s.tPow3[e]*this.bezierEndPt.x,s.oneMinusTPow3[e]*this.bezierStartPt.y+s.bezierFactorOne[e]*this.bezierStartControlPt.y+s.bezierFactorTwo[e]*this.bezierEndControlPt.y+s.tPow3[e]*this.bezierEndPt.y)}}e.GraphicalCurve=s,s.bezierCurveStepSize=1e3},9428:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalInstantaneousDynamicExpression=void 0;const s=i(6791),r=i(3748),o=n(i(2043));class a extends s.AbstractGraphicalExpression{constructor(t,e,i){super(e,t,i.parentSourceMeasure),this.mInstantaneousDynamicExpression=t,this.mMeasure=i}updateSkyBottomLine(){const t=this.parentStaffLine.SkyBottomLineCalculator,e=this.PositionAndShape.RelativePosition.x+this.PositionAndShape.BorderMarginLeft,i=this.PositionAndShape.RelativePosition.x+this.PositionAndShape.BorderMarginRight;let n=0;switch(this.Placement){case r.PlacementEnum.Above:n=this.PositionAndShape.RelativePosition.y+this.PositionAndShape.BorderMarginTop,t.updateSkyLineInRange(e,i,n);break;case r.PlacementEnum.Below:n=this.PositionAndShape.RelativePosition.y+this.PositionAndShape.BorderMarginBottom,t.updateBottomLineInRange(e,i,n);break;default:o.default.error("Placement for GraphicalInstantaneousDynamicExpression is unknown")}}}e.GraphicalInstantaneousDynamicExpression=a},5277:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalInstantaneousTempoExpression=void 0;const n=i(6791);class s extends n.AbstractGraphicalExpression{constructor(t,e){super(e.PositionAndShape.Parent.DataObject,t,t.parentMeasure),this.label=e}get GraphicalLabel(){return this.label}updateSkyBottomLine(){}}e.GraphicalInstantaneousTempoExpression=s},9946:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalLabel=void 0;const n=i(1274),s=i(8911),r=i(4278),o=i(4040);class a extends r.Clickable{constructor(t,e,i,n,r=void 0){super(),this.label=t,this.boundingBox=new s.BoundingBox(this,r),this.label.fontHeight=e,this.label.textAlignment=i,this.rules=n,this.rules.MpatMode&&"TRIO"===this.label.text&&(this.label.fontFamily="Arial")}get Label(){return this.label}toString(){return`${this.label.text} (${this.boundingBox.RelativePosition.x},${this.boundingBox.RelativePosition.y})`}setLabelPositionAndShapeBorders(){var t,e;if(""===this.Label.text.trim())return;this.TextLines=[];const i=null!==(e=null===(t=this.rules)||void 0===t?void 0:t.LabelMarginBorderFactor)&&void 0!==e?e:.1,s=this.Label.text.split(/[\n\r]+/g),r=s.length;let a=0;for(let t=0;t0&&this.TextLines.length>1&&(l+=this.rules.SpacingBetweenTextLines*r/10);const h=this.PositionAndShape;switch(this.Label.textAlignment){case n.TextAlignmentEnum.CenterBottom:h.BorderTop=-l,h.BorderLeft=-a/2,h.BorderBottom=0,h.BorderRight=a/2;break;case n.TextAlignmentEnum.CenterCenter:h.BorderTop=-l/2,h.BorderLeft=-a/2,h.BorderBottom=l/2,h.BorderRight=a/2;break;case n.TextAlignmentEnum.CenterTop:h.BorderTop=0,h.BorderLeft=-a/2,h.BorderBottom=l,h.BorderRight=a/2;break;case n.TextAlignmentEnum.LeftBottom:h.BorderTop=-l,h.BorderLeft=0,h.BorderBottom=0,h.BorderRight=a;break;case n.TextAlignmentEnum.LeftCenter:h.BorderTop=-l/2,h.BorderLeft=0,h.BorderBottom=l/2,h.BorderRight=a;break;case n.TextAlignmentEnum.LeftTop:h.BorderTop=0,h.BorderLeft=0,h.BorderBottom=l,h.BorderRight=a;break;case n.TextAlignmentEnum.RightBottom:h.BorderTop=-l,h.BorderLeft=-a,h.BorderBottom=0,h.BorderRight=0;break;case n.TextAlignmentEnum.RightCenter:h.BorderTop=-l/2,h.BorderLeft=-a,h.BorderBottom=l/2,h.BorderRight=0;break;case n.TextAlignmentEnum.RightTop:h.BorderTop=0,h.BorderLeft=-a,h.BorderBottom=l,h.BorderRight=0}h.BorderMarginTop=h.BorderTop-l*i,h.BorderMarginLeft=h.BorderLeft-l*i,h.BorderMarginBottom=h.BorderBottom+l*i,h.BorderMarginRight=h.BorderRight+l*i}}e.GraphicalLabel=a},6729:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalLine=void 0;const n=i(8155);e.GraphicalLine=class{constructor(t,e,i=0,s=n.OutlineAndFillStyleEnum.BaseWritingColor,r=void 0){this.start=t,this.end=e,this.width=i,this.styleId=s,this.colorHex=r}get Start(){return this.start}set Start(t){this.start=t}get End(){return this.end}set End(t){this.end=t}get Width(){return this.width}set Width(t){this.width=t}}},5091:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalLyricEntry=void 0;const n=i(9946),s=i(2255),r=i(9086),o=i(1274);e.GraphicalLyricEntry=class{constructor(t,e,i,a){this.lyricsEntry=t,this.graphicalStaffEntry=e;const l=e.parentMeasure.parentSourceMeasure.Rules.LyricsAlignmentStandard;t.Text.length>=4&&t.Parent.Notes[0].Length.Denominator>4&&o.TextAlignmentEnum.LeftBottom;const h=new s.Label(t.Text);this.graphicalLabel=new n.GraphicalLabel(h,i,l,this.graphicalStaffEntry.parentMeasure.parentSourceMeasure.Rules,e.PositionAndShape),this.graphicalLabel.PositionAndShape.RelativePosition=new r.PointF2D(0,a),l===o.TextAlignmentEnum.LeftBottom&&(this.graphicalLabel.PositionAndShape.RelativePosition.x-=1)}get LyricsEntry(){return this.lyricsEntry}get ParentLyricWord(){return this.graphicalLyricWord}set ParentLyricWord(t){this.graphicalLyricWord=t}get GraphicalLabel(){return this.graphicalLabel}set GraphicalLabel(t){this.graphicalLabel=t}get StaffEntryParent(){return this.graphicalStaffEntry}set StaffEntryParent(t){this.graphicalStaffEntry=t}}},8720:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalLyricWord=void 0,e.GraphicalLyricWord=class{constructor(t){this.graphicalLyricsEntries=[],this.lyricWord=t,this.initialize()}get GetLyricWord(){return this.lyricWord}get GraphicalLyricsEntries(){return this.graphicalLyricsEntries}set GraphicalLyricsEntries(t){this.graphicalLyricsEntries=t}isFilled(){for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalMarkedArea=void 0,e.GraphicalMarkedArea=class{constructor(t,e=void 0,i=void 0,n=void 0){this.systemRectangle=t,this.labelRectangle=e,this.label=i,this.settings=n}}},1513:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalMeasure=void 0;const n=i(4785),s=i(1797),r=i(8911),o=i(9086);class a extends n.GraphicalObject{constructor(t=void 0,e=void 0,i=void 0){super(),this.hasOnlyRests=!1,this.measureNumber=-1,this.ShowTimeSignature=!0,this.parentStaff=t,this.parentSourceMeasure=e,this.parentStaffLine=i,i?(this.parentStaff=i.ParentStaff,this.PositionAndShape=new r.BoundingBox(this,i.PositionAndShape)):this.PositionAndShape=new r.BoundingBox(this),this.PositionAndShape.BorderBottom=4,this.parentSourceMeasure&&(this.measureNumber=this.parentSourceMeasure.MeasureNumber),this.staffEntries=[]}get ParentStaff(){return this.parentStaff}get ParentMusicSystem(){return this.parentMusicSystem}set ParentMusicSystem(t){this.parentMusicSystem=t}get MeasureNumber(){return this.measureNumber}get FirstInstructionStaffEntry(){return this.firstInstructionStaffEntry}set FirstInstructionStaffEntry(t){this.firstInstructionStaffEntry=t}get LastInstructionStaffEntry(){return this.lastInstructionStaffEntry}set LastInstructionStaffEntry(t){this.lastInstructionStaffEntry=t}get ParentStaffLine(){return this.parentStaffLine}set ParentStaffLine(t){this.parentStaffLine=t,this.parentStaffLine&&(this.PositionAndShape.Parent=this.parentStaffLine.PositionAndShape)}resetLayout(){throw new Error("not implemented")}getLineWidth(t){throw new Error("not implemented")}addClefAtBegin(t){throw new Error("not implemented")}addKeyAtBegin(t,e,i){throw new Error("not implemented")}addRhythmAtBegin(t){throw new Error("not implemented")}addClefAtEnd(t,e=!0){throw new Error("not implemented")}setPositionInStaffline(t){this.PositionAndShape.RelativePosition=new o.PointF2D(t,0)}setWidth(t){this.PositionAndShape.BorderRight=t}layoutSymbols(){throw new Error("not implemented")}findGraphicalStaffEntryFromTimestamp(t){var e;for(let i=0,n=this.staffEntries.length;i1}isVisible(){return this.ParentStaff.ParentInstrument.Visible}getGraphicalMeasureDurationFromStaffEntries(){let t=new s.Fraction(0,1);const e=[];for(let t=0,i=this.staffEntries.length;t0&&r.Add(e.notes[0].graphicalNoteLength);t.lt(r)&&(t=s.Fraction.createFromFraction(r))}return t}addGraphicalStaffEntry(t){this.staffEntries.push(t)}addGraphicalStaffEntryAtTimestamp(t){if(t)if(0===this.staffEntries.length||this.staffEntries[this.staffEntries.length-1].relInMeasureTimestamp.lt(t.relInMeasureTimestamp))this.staffEntries.push(t);else for(let e=this.staffEntries.length-1;e>=0;e--){if(this.staffEntries[e].relInMeasureTimestamp.lt(t.relInMeasureTimestamp)){this.staffEntries.splice(e+1,0,t);break}0===e&&this.staffEntries.splice(e,0,t)}}isPianoRightHand(){return this.isUpperStaffOfInstrument()}isPianoLeftHand(){return this.isLowerStaffOfInstrument()}isUpperStaffOfInstrument(){return 1===this.parentStaff.ParentInstrument.Staves.length||this.ParentStaff===this.parentStaff.ParentInstrument.Staves[0]}isLowerStaffOfInstrument(){return 1!==this.parentStaff.ParentInstrument.Staves.length&&this.ParentStaff===this.ParentStaff.ParentInstrument.Staves.last()}beginsWithLineRepetition(){const t=this.parentSourceMeasure;return!!t&&t.beginsWithLineRepetition()}endsWithLineRepetition(){const t=this.parentSourceMeasure;return!!t&&t.endsWithLineRepetition()}beginsWithWordRepetition(){const t=this.parentSourceMeasure;return!!t&&t.beginsWithWordRepetition()}endsWithWordRepetition(){const t=this.parentSourceMeasure;return!!t&&t.endsWithWordRepetition()}getTransposedHalftones(){return this.parentStaff.ParentInstrument.GetMusicSheet.Transpose+this.parentStaff.ParentInstrument.Transpose}}e.GraphicalMeasure=a},599:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PagePlacementEnum=e.GraphicalMusicPage=void 0;const n=i(8911),s=i(4785),r=i(9086);class o extends s.GraphicalObject{constructor(t){super(),this.musicSystems=[],this.labels=[],this.parent=t,this.boundingBox=new n.BoundingBox(this,void 0)}get MusicSystems(){return this.musicSystems}set MusicSystems(t){this.musicSystems=t}get Labels(){return this.labels}set Labels(t){this.labels=t}get Parent(){return this.parent}set Parent(t){this.parent=t}get PageNumber(){return this.pageNumber}set PageNumber(t){this.pageNumber=t}setMusicPageAbsolutePosition(t,e){return new r.PointF2D(0,0)}}var a;e.GraphicalMusicPage=o,(a=e.PagePlacementEnum||(e.PagePlacementEnum={}))[a.Down=0]="Down",a[a.Right=1]="Right",a[a.RightDown=2]="RightDown"},4324:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SystemImageProperties=e.GraphicalMusicSheet=void 0;const s=i(525),r=i(6729),o=i(9086),a=i(289),l=i(5198),h=i(1797),u=i(8911),c=n(i(2043)),d=i(2337),p=i(4278),f=i(5974),m=i(4785);e.GraphicalMusicSheet=class{constructor(t,e){this.musicPages=[],this.measureList=[],this.verticalGraphicalStaffEntryContainers=[],this.cursors=[],this.leadSheet=!1,this.musicSheet=t,this.numberOfStaves=this.musicSheet.Staves.length,this.calculator=e,this.calculator.initialize(this)}get ParentMusicSheet(){return this.musicSheet}get GetCalculator(){return this.calculator}get JianpuKeySignature(){return this.jianpuKeySignature}set JianpuKeySignature(t){this.jianpuKeySignature=t}get MusicPages(){return this.musicPages}set MusicPages(t){this.musicPages=t}get MeasureList(){return this.measureList}set MeasureList(t){this.measureList=t}get VerticalGraphicalStaffEntryContainers(){return this.verticalGraphicalStaffEntryContainers}set VerticalGraphicalStaffEntryContainers(t){this.verticalGraphicalStaffEntryContainers=t}get Title(){return this.title}set Title(t){this.title=t}get Subtitle(){return this.subtitle}set Subtitle(t){this.subtitle=t}get Composer(){return this.composer}set Composer(t){this.composer=t}get Lyricist(){return this.lyricist}set Lyricist(t){this.lyricist=t}get Cursors(){return this.cursors}get SelectionStartSymbol(){return this.selectionStartSymbol}get SelectionEndSymbol(){return this.selectionEndSymbol}get MinAllowedSystemWidth(){return this.minAllowedSystemWidth}set MinAllowedSystemWidth(t){this.minAllowedSystemWidth=t}get NumberOfStaves(){return this.numberOfStaves}get LeadSheet(){return this.leadSheet}set LeadSheet(t){this.leadSheet=t}static transformRelativeToAbsolutePosition(t){for(let e=0;e=0;i--){const t=this.measureList[i][e];if(t)return t}}findGraphicalStaffEntryFromMeasureList(t,e,i){for(let n=e;n0)return i.staffEntries[0]}}getFirstVisibleMeasuresListFromIndices(t,e){const i=[],n=this.measureList[0].length;for(let s=t;s<=e;s++)for(let t=0;t=0;e--){if(this.verticalGraphicalStaffEntryContainers[e].AbsoluteTimestamp.lt(t)){const i=new s.VerticalGraphicalStaffEntryContainer(this.numberOfStaves,t);return this.verticalGraphicalStaffEntryContainers.splice(e+1,0,i),i}if(this.verticalGraphicalStaffEntryContainers[e].AbsoluteTimestamp.Equals(t))return this.verticalGraphicalStaffEntryContainers[e]}}GetVerticalContainerFromTimestamp(t,e=0){const i=d.CollectionUtil.binarySearch(this.verticalGraphicalStaffEntryContainers,new s.VerticalGraphicalStaffEntryContainer(0,t),s.VerticalGraphicalStaffEntryContainer.compareByTimestamp,e);if(i>=0)return this.verticalGraphicalStaffEntryContainers[i]}GetInterpolatedIndexInVerticalContainers(t){const e=this.verticalGraphicalStaffEntryContainers;let i,n,s=0,r=e.length-1;if(t.lte(e[e.length-1].AbsoluteTimestamp)){for(;r-s>1;){const i=Math.floor((r+s)/2);if(e[s].AbsoluteTimestamp.Equals(t)){r=s;break}if(e[r].AbsoluteTimestamp.Equals(t)){s=r;break}if(e[i].AbsoluteTimestamp.Equals(t))return this.verticalGraphicalStaffEntryContainers.indexOf(e[i]);t.lt(e[i].AbsoluteTimestamp)?r=i:s=i}if(s===r)return this.verticalGraphicalStaffEntryContainers.indexOf(e[s]);i=e[s].AbsoluteTimestamp,n=e[r].AbsoluteTimestamp}else i=e[e.length-1].AbsoluteTimestamp,n=h.Fraction.plus(this.getLongestStaffEntryDuration(e.length-1),i),r=e.length;const o=n.RealValue-i.RealValue,a=r-(n.RealValue-t.RealValue)/o;return Math.min(a,this.verticalGraphicalStaffEntryContainers.length)}getVisibleStavesIndicesFromSourceMeasure(t){const e=[],i=[];for(let i=0,n=t.length;i{var e;return void 0!==(null===(e=t.parentStaffEntry)||void 0===e?void 0:e.relInMeasureTimestamp)}))}GetNearestNote(t,e){const i=this.GetNearestVoiceEntry(t);if(!i)return;let n,s=Number.MAX_SAFE_INTEGER;for(const e of i.notes){const i=e.PositionAndShape.AbsolutePosition.y,r=Math.abs(e.PositionAndShape.AbsolutePosition.x-t.x),o=Math.abs(i-t.y);r+on.PositionAndShape.RelativePosition.x&&(i=n):i=n)}}catch(t){c.default.info("GraphicalMusicSheet.getStaffEntry",t)}return i}GetPreviousVisibleContainerIndex(t){for(let e=t-1;e>=0;e--){const t=this.verticalGraphicalStaffEntryContainers[e].StaffEntries;for(let i=0,n=t.length;i=0;t--)if(i=this.getStaffEntry(t),i){if(!e)return i;if(i.sourceStaffEntry.ParentStaff.ParentInstrument.Visible)return i}}findClosestRightStaffEntry(t,e){let i;for(let n=Math.max(0,Math.ceil(t));n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalNote=void 0;const n=i(8640),s=i(4785),r=i(4040),o=i(8911);class a extends s.GraphicalObject{constructor(t,e,i,s=void 0){super(),this.DrawnAccidental=n.AccidentalEnum.NONE,this.lineShift=0,this.sourceNote=t,this.parentVoiceEntry=e,this.PositionAndShape=new o.BoundingBox(this,e.PositionAndShape),this.graphicalNoteLength=s||t.Length,this.numberOfDots=this.calculateNumberOfNeededDots(this.graphicalNoteLength),this.rules=i,this.rules.addGraphicalNoteToNoteMap(t,this)}Transpose(t,e,i,n){let s=this.sourceNote.Pitch;return r.MusicSheetCalculator.transposeCalculator&&(s=r.MusicSheetCalculator.transposeCalculator.transposePitch(this.sourceNote.Pitch,t,i)),s}calculateNumberOfNeededDots(t){return this.sourceNote&&this.sourceNote.NoteTuplet?0:t.calculateNumberOfNeededDots()}get ParentMusicPage(){return this.parentVoiceEntry.parentStaffEntry.parentMeasure.ParentMusicSystem.Parent}static FromNote(t,e){return e.NoteToGraphicalNoteMap.getValue(t.NoteToGraphicalNoteObjectId)}}e.GraphicalNote=a},4785:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalObject=void 0;const n=i(9733);class s extends n.AClassHierarchyTrackable{get PositionAndShape(){return this.boundingBox}set PositionAndShape(t){this.boundingBox=t}}e.GraphicalObject=s},873:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalOctaveShift=void 0;const n=i(4785),s=i(5853),r=i(8911),o=i(158),a=i(1703);class l extends n.GraphicalObject{constructor(t,e){super(),this.getOctaveShift=t,this.setSymbol(),this.PositionAndShape=new r.BoundingBox(this,e)}setSymbol(){switch(this.getOctaveShift.Type){case s.OctaveEnum.VA8:this.octaveSymbol=o.MusicSymbol.VA8;break;case s.OctaveEnum.VB8:this.octaveSymbol=o.MusicSymbol.VB8;break;case s.OctaveEnum.MA15:this.octaveSymbol=o.MusicSymbol.MA15;break;case s.OctaveEnum.MB15:this.octaveSymbol=o.MusicSymbol.MB15;break;default:throw new a.ArgumentOutOfRangeException("")}}}e.GraphicalOctaveShift=l},4082:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalPedal=void 0;const n=i(4785),s=i(8911),r=i(158);class o extends n.GraphicalObject{constructor(t,e){super(),this.getPedal=t,this.setSymbol(),this.PositionAndShape=new s.BoundingBox(this,e)}setSymbol(){!this.getPedal.IsLine&&this.getPedal.IsSign?this.pedalSymbol=r.MusicSymbol.PEDAL_SYMBOL:this.getPedal.IsLine&&this.getPedal.IsSign?this.pedalSymbol=r.MusicSymbol.PEDAL_MIXED:this.pedalSymbol=r.MusicSymbol.PEDAL_BRACKET}}e.GraphicalPedal=o},3411:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalRectangle=void 0;const n=i(8911),s=i(4785);class r extends s.GraphicalObject{constructor(t,e,i,s){super(),this.boundingBox=new n.BoundingBox(i),this.boundingBox.RelativePosition=t,this.boundingBox.BorderRight=e.x-t.x,this.boundingBox.BorderBottom=e.y-t.y,this.style=s}}e.GraphicalRectangle=r},9876:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalSlur=void 0;const n=i(9086),s=i(5330),r=i(3748),o=i(8363),a=i(2947),l=i(1797),h=i(908);class u extends s.GraphicalCurve{constructor(t,e){super(),this.staffEntries=[],this.slur=t,this.rules=e}static Compare(t,e){if(t.staffEntries.length<1)return-1;if(e.staffEntries.length<1)return 1;const i=l.Fraction.minus(t.staffEntries[t.staffEntries.length-1].getAbsoluteTimestamp(),t.staffEntries[0].getAbsoluteTimestamp()),n=l.Fraction.minus(e.staffEntries[e.staffEntries.length-1].getAbsoluteTimestamp(),e.staffEntries[0].getAbsoluteTimestamp());return i.RealValue>n.RealValue?1:n.RealValue>i.RealValue?-1:0}calculateCurve(t){const e=this.staffEntries[0],i=this.staffEntries[this.staffEntries.length-1];let s=e.findGraphicalNoteFromNote(this.slur.StartNote);!s&&this.graceStart&&(s=e.findGraphicalNoteFromGraceNote(this.slur.StartNote)),s||(s=e.findEndTieGraphicalNoteFromNoteWithStartingSlur(this.slur.StartNote,this.slur));let a=i.findGraphicalNoteFromNote(this.slur.EndNote);!a&&this.graceEnd&&(a=i.findGraphicalNoteFromGraceNote(this.slur.EndNote));const l=e.parentMeasure.ParentStaffLine,h=l.SkyBottomLineCalculator;this.calculatePlacement(h,l);const u=this.calculateStartAndEnd(s,a,l,t,h),c=u.startX,d=u.endX;let p=u.startY,f=u.endY;const m=t.SlurTangentMinAngle,g=t.SlurTangentMaxAngle;let b;if(this.placement===r.PlacementEnum.Above){p-=t.SlurNoteHeadYOffset,f-=t.SlurNoteHeadYOffset;const e=new n.PointF2D(this.staffEntries[0].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[0].PositionAndShape.RelativePosition.x,p);s?e.x+=this.staffEntries[0].PositionAndShape.BorderRight:e.x=this.staffEntries[0].parentMeasure.beginInstructionsWidth,this.graceStart&&(e.x+=i.PositionAndShape.RelativePosition.x);const r=new n.PointF2D(this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].PositionAndShape.RelativePosition.x,f);if(a?r.x+=this.staffEntries[this.staffEntries.length-1].PositionAndShape.BorderLeft:r.x=this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.Size.width,this.graceEnd&&(r.x+=i.staffEntryParent.PositionAndShape.RelativePosition.x),b=this.calculateTopPoints(e,r,l,h),0===b.length){const t=new n.PointF2D((r.x-e.x)/2+e.x,(r.y-e.y)/2+e.y);b.push(t)}const u=Math.atan((f-p)/(d-c)),y=new n.PointF2D(0,0);let S=new n.PointF2D(d-c,-(f-p));const v=o.Matrix2D.getRotationMatrix(u),_=v.getTransposeMatrix();S=v.vectorMultiplication(S);const x=this.calculateTranslatedAndRotatedPointListAbove(b,c,p,v);let E=this.calculateMaxLeftSlope(x,y,S),M=this.calculateMaxRightSlope(x,y,S);const w=y.y-y.x*E,P=S.y-S.x*M,T=new n.PointF2D;let C=!1;Math.abs(Math.abs(E)-Math.abs(M))<1e-4?(T.x=S.x/2,T.y=0,C=!0):(T.x=(P-w)/(E-M),T.y=E*T.x+w);const A=this.calculateHeightWidthRatio(S.x,x);let I=0,L=0;if(Math.abs(A)>.001){const t=Math.abs(E/(2*A)),e=Math.abs(E);I=Math.max(0,e*(Math.min(10,t-1)/10)),E-=I;const i=Math.abs(M/(2*A)),n=Math.abs(M);L=Math.max(0,n*(Math.min(10,i-1)/10)),M+=L}let R=m,N=-m;if(!C){const t=this.calculateAngles(m,E,M,g);R=t.startAngle,N=t.endAngle}const k=this.calculateControlPoints(S.x,R,N,x,A,p,f);let O=k.startControlPoint,D=k.endControlPoint;O=_.vectorMultiplication(O),O.x+=c,O.y=-O.y+p,D=_.vectorMultiplication(D),D.x+=c,D.y=-D.y+p,this.bezierStartPt=new n.PointF2D(c,p-I),this.bezierStartControlPt=new n.PointF2D(O.x,O.y-I),this.bezierEndControlPt=new n.PointF2D(D.x,D.y-L),this.bezierEndPt=new n.PointF2D(d,f-L);const B=l.SkyLine.length,F=h.getLeftIndexForPointX(this.bezierStartPt.x,B),V=h.getLeftIndexForPointX(this.bezierEndPt.x,B),G=this.bezierEndPt.x-this.bezierStartPt.x,W=h.SamplingUnit;for(let t=F;t=F&&(l.SkyLine[n]=Math.min(l.SkyLine[n],i.y)),n++,n.001){const t=Math.abs(E/(2*A)),e=Math.abs(E);I=Math.max(0,e*(Math.min(10,t-1)/10)),E-=I;const i=Math.abs(M/(2*A)),n=Math.abs(M);L=Math.max(0,n*(Math.min(10,i-1)/10)),M+=L}let R=m,N=-m;if(!C){const t=this.calculateAngles(m,E,M,g);R=t.startAngle,N=t.endAngle}const k=this.calculateControlPoints(S.x,R,N,x,A,p,f);let O=k.startControlPoint,D=k.endControlPoint;O=_.vectorMultiplication(O),O.x+=c,O.y+=p,D=_.vectorMultiplication(D),D.x+=c,D.y+=p,this.bezierStartPt=new n.PointF2D(c,p+I),this.bezierStartControlPt=new n.PointF2D(O.x,O.y+I),this.bezierEndControlPt=new n.PointF2D(D.x,D.y+L),this.bezierEndPt=new n.PointF2D(d,f+L);const B=l.BottomLine.length,F=h.getLeftIndexForPointX(this.bezierStartPt.x,B),V=h.getLeftIndexForPointX(this.bezierEndPt.x,B),G=this.bezierEndPt.x-this.bezierStartPt.x,W=h.SamplingUnit;for(let t=F;t=F&&(l.BottomLine[n]=Math.max(l.BottomLine[n],i.y)),n++,n0)return void(this.placement=r.PlacementEnum.Above);const i=this.staffEntries[0],n=this.staffEntries[this.staffEntries.length-1],s=i.graphicalVoiceEntries[0].parentVoiceEntry.StemDirection;if(s===n.graphicalVoiceEntries[0].parentVoiceEntry.StemDirection)this.placement=s===h.StemDirectionType.Up?r.PlacementEnum.Below:r.PlacementEnum.Above;else{let s=i.PositionAndShape.BorderLeft+i.PositionAndShape.RelativePosition.x+i.parentMeasure.PositionAndShape.RelativePosition.x,o=n.PositionAndShape.BorderRight+n.PositionAndShape.RelativePosition.x+n.parentMeasure.PositionAndShape.RelativePosition.x;this.graceStart&&(s+=n.PositionAndShape.RelativePosition.x),this.graceEnd&&(o+=n.staffEntryParent.PositionAndShape.RelativePosition.x);const a=-1*t.getSkyLineMinInRange(s,o),l=t.getBottomLineMaxInRange(s,o)-e.StaffHeight;this.placement=l>a?r.PlacementEnum.Above:r.PlacementEnum.Below}}calculateTopPoints(t,e,i,s){const r=[];let o=s.getRightIndexForPointX(t.x,i.SkyLine.length),a=s.getLeftIndexForPointX(e.x,i.SkyLine.length);o<0&&(o=0),a>=i.SkyLine.length&&(a=i.SkyLine.length-1);for(let t=o;t=i.BottomLine.length&&(a=i.BottomLine.length-1);for(let t=o;tc&&t>d&&(h+=t/70*this.rules.SlurHeightFlattenLongSlursFactorByWidth,h*=1+e/30*this.rules.SlurHeightFlattenLongSlursFactorByAngle,l/=h);const p=Math.min(.5,Math.max(.1,1.7*e/80*l*Math.pow(Math.max(r,.05),.4))),f=Math.min(.5,Math.max(.1,1.7*-i/80*l*Math.pow(Math.max(r,.05),.4))),m=new n.PointF2D;m.x=t*p*Math.cos(e*u.degreesToRadiansFactor),m.y=t*p*Math.sin(e*u.degreesToRadiansFactor);const g=new n.PointF2D;g.x=t-t*f*Math.cos(i*u.degreesToRadiansFactor),g.y=-t*f*Math.sin(i*u.degreesToRadiansFactor);let b=m.y-g.y;for(;this.rules.SlurMaximumYControlPointDistance&&Math.abs(b)>this.rules.SlurMaximumYControlPointDistance;)b<0?(m.y+=1,g.y-=1):(m.y-=1,g.y+=1),b=m.y-g.y;return{startControlPoint:m,endControlPoint:g}}calculateAngles(t,e,i,n){let s=Math.atan(e)/u.degreesToRadiansFactor;e>0?s+=20:s-=20;let r=Math.atan(i)/u.degreesToRadiansFactor;return i<0?r-=20:r+=20,{startAngle:Math.min(Math.max(t,s),n),endAngle:Math.max(Math.min(-t,r),-n)}}}e.GraphicalSlur=u,u.degreesToRadiansFactor=Math.PI/180},3023:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalStaffEntry=void 0;const n=i(8911),s=i(1797),r=i(4785),o=i(2337),a=i(4040);class l extends r.GraphicalObject{constructor(t,e=void 0,i=void 0){super(),this.graphicalChordContainers=[],this.tabStaffEntry=void 0,this.MaxAccidentals=0,this.graphicalInstructions=[],this.ties=[],this.graphicalTies=[],this.lyricsEntries=[],this.parentMeasure=t,this.graphicalVoiceEntries=[],this.sourceStaffEntry=e,i?(this.staffEntryParent=i,this.parentVerticalContainer=i.parentVerticalContainer,this.PositionAndShape=new n.BoundingBox(this,i.PositionAndShape)):this.PositionAndShape=new n.BoundingBox(this,t.PositionAndShape),e&&(this.relInMeasureTimestamp=e.Timestamp),this.FingeringEntries=[]}get GraphicalInstructions(){return this.graphicalInstructions}get GraphicalTies(){return this.graphicalTies}get LyricsEntries(){return this.lyricsEntries}set LyricsEntries(t){this.lyricsEntries=t}getAbsoluteTimestamp(){const t=this.parentMeasure.parentSourceMeasure.AbsoluteTimestamp.clone();return this.relInMeasureTimestamp&&t.Add(this.relInMeasureTimestamp),t}findTieGraphicalNoteFromNote(t){var e;const i=(null===(e=window.GYM)||void 0===e?void 0:e.graceCustom)||!1;for(const e of this.graphicalVoiceEntries)for(const n of e.notes){const e=n.sourceNote;if(i){if(t.NoteToGraphicalNoteObjectId==e.NoteToGraphicalNoteObjectId)return n}else if(!e.isRest()&&e.Pitch.FundamentalNote===t.Pitch.FundamentalNote&&e.Pitch.Octave===t.Pitch.Octave&&e.getAbsoluteTimestamp().Equals(t.getAbsoluteTimestamp()))return n}}findEndTieGraphicalNoteFromNoteWithStartingSlur(t,e){if(t)for(const i of this.graphicalVoiceEntries)if(i.parentVoiceEntry===t.ParentVoiceEntry)for(const t of i.notes){const i=t.sourceNote;if(i.NoteTie&&-1!==i.NoteSlurs.indexOf(e))return t}}findGraphicalNoteFromGraceNote(t){if(t)for(const e of this.graphicalVoiceEntries)if(e.parentVoiceEntry===t.ParentVoiceEntry)for(const i of e.notes)if(i.sourceNote===t)return i}findGraphicalNoteFromNote(t){if(t)for(const e of this.graphicalVoiceEntries)if(e.parentVoiceEntry===t.ParentVoiceEntry)for(const i of e.notes)if(i.sourceNote===t&&this.getAbsoluteTimestamp().Equals(t.getAbsoluteTimestamp()))return i}getGraphicalNoteDurationFromVoice(t){for(const e of this.graphicalVoiceEntries)if(e.parentVoiceEntry.ParentVoice===t)return e.notes[0].graphicalNoteLength;return new s.Fraction(0,1)}findVoiceEntryGraphicalNotes(t){for(const e of this.graphicalVoiceEntries)if(e.parentVoiceEntry===t)return e.notes}isVoiceEntryPartOfLinkedVoiceEntry(t){if(this.sourceStaffEntry.Link)for(let e=0,i=this.sourceStaffEntry.Link.LinkStaffEntries.length;e0&&(t=e)}return t}findStaffEntryMaxNoteLength(){let t=new s.Fraction(0,1);for(const e of this.graphicalVoiceEntries)for(const i of e.notes){const e=i.graphicalNoteLength;t.lt(e)&&e.GetExpandedNumerator()>0&&(t=e)}return t}findOrCreateGraphicalVoiceEntry(t){for(const e of this.graphicalVoiceEntries)if(e.parentVoiceEntry===t)return e;const e=a.MusicSheetCalculator.symbolFactory.createVoiceEntry(t,this);return this.graphicalVoiceEntries.push(e),e}findOrCreateGraphicalVoiceEntryFromGraphicalNote(t){for(const e of this.graphicalVoiceEntries)if(e===t.parentVoiceEntry)return e;const e=a.MusicSheetCalculator.symbolFactory.createVoiceEntry(t.sourceNote.ParentVoiceEntry,this);return this.graphicalVoiceEntries.push(e),e}addGraphicalNoteToListAtCorrectYPosition(t,e){const i=t.notes;if(0===i.length||e.PositionAndShape.RelativePosition.y=0;t--){if(i[t].PositionAndShape.RelativePosition.y>e.PositionAndShape.RelativePosition.y){i.splice(t+1,0,e);break}if(0===t){i.splice(0,0,e);break}}}hasOnlyRests(){for(const t of this.graphicalVoiceEntries)for(const e of t.notes)if(!e.sourceNote.isRest())return!1;return!0}getSkylineMin(){var t;const e=null===(t=this.parentMeasure)||void 0===t?void 0:t.ParentStaffLine.SkyBottomLineCalculator;if(!e)return;const[i,n]=this.getAbsoluteStartAndEnd();return e.getSkyLineMinInRange(i,n)}getHighestYAtEntry(){return this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.y+this.getSkylineMin()}getLowestYAtEntry(){return this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.y+this.getBottomlineMax()}getBottomlineMax(){var t;const e=null===(t=this.parentMeasure)||void 0===t?void 0:t.ParentStaffLine.SkyBottomLineCalculator;if(!e)return;const[i,n]=this.getAbsoluteStartAndEnd();return e.getBottomLineMaxInRange(i,n)}getAbsoluteStartAndEnd(){let t=this.PositionAndShape.AbsolutePosition.x;return t-=this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.x,[t,t+this.PositionAndShape.Size.width]}}e.GraphicalStaffEntry=l},8898:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalStaffEntryLink=void 0,e.GraphicalStaffEntryLink=class{constructor(t){this.graphicalLinkedStaffEntries=[],this.staffEntryLink=t,this.initialize()}get GetStaffEntryLink(){return this.staffEntryLink}get GraphicalLinkedStaffEntries(){return this.graphicalLinkedStaffEntries}set GraphicalLinkedStaffEntries(t){this.graphicalLinkedStaffEntries=t}isFilled(){for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalTie=void 0,e.GraphicalTie=class{constructor(t,e=void 0,i=void 0){this.tie=t,this.startNote=e,this.endNote=i}get SVGElement(){return this.vfTie.getAttribute("el")}get GetTie(){return this.tie}get StartNote(){return this.startNote}get Tie(){return this.tie}set StartNote(t){this.startNote=t}get EndNote(){return this.endNote}set EndNote(t){this.endNote=t}}},4462:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalUnknownExpression=void 0;const s=i(6791),r=i(3748),o=n(i(2043));class a extends s.AbstractGraphicalExpression{constructor(t,e,i,n,s=void 0){super(t,new r.AbstractExpression(i),n),this.label=e,this.sourceMultiExpression=s}updateSkyBottomLine(){const t=this.parentStaffLine.SkyBottomLineCalculator,e=this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginLeft,i=this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginRight;switch(this.Placement){case r.PlacementEnum.Above:const n=this.label.PositionAndShape.BorderMarginTop+this.label.PositionAndShape.RelativePosition.y;t.updateSkyLineInRange(e,i,n);break;case r.PlacementEnum.Below:const s=this.label.PositionAndShape.BorderMarginBottom+this.label.PositionAndShape.RelativePosition.y;t.updateBottomLineInRange(e,i,s);break;default:o.default.error("Placement for GraphicalUnknownExpression is unknown")}}}e.GraphicalUnknownExpression=a},5974:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalVoiceEntry=void 0;const n=i(4785),s=i(8911),r=i(1405);class o extends n.GraphicalObject{constructor(t,e){super(),this.parentVoiceEntry=t,this.parentStaffEntry=e,this.PositionAndShape=new s.BoundingBox(this,e?e.PositionAndShape:void 0,!0),this.notes=[],this.rules=e?e.parentMeasure.parentSourceMeasure.Rules:new r.EngravingRules}sort(){return this.notes.sort(((t,e)=>{var i,n,s,r;return(null!==(n=null===(i=e.sourceNote.Pitch)||void 0===i?void 0:i.getHalfTone())&&void 0!==n?n:0)-(null!==(r=null===(s=t.sourceNote.Pitch)||void 0===s?void 0:s.getHalfTone())&&void 0!==r?r:0)})),this.notes}sortForVexflow(){return this.notes.sort(((t,e)=>{var i,n,s;return(null!==(n=null===(i=t.sourceNote.Pitch)||void 0===i?void 0:i.getHalfTone())&&void 0!==n?n:0)-(null!==(s=e.sourceNote.Pitch.getHalfTone())&&void 0!==s?s:0)})),this.notes}color(){}}e.GraphicalVoiceEntry=o},8682:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalWavyLine=void 0;const n=i(8911),s=i(4785);class r extends s.GraphicalObject{constructor(t,e){super(),this.getWavyLine=t,this.PositionAndShape=new n.BoundingBox(this,e)}}e.GraphicalWavyLine=r},8823:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},642:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.JustifiedMusicSystemBuilder=void 0;const n=i(5623);class s extends n.MusicSystemBuilder{buildMusicSystems(){var t,e;this.currentSystemParams=new n.SystemBuildParameters;const i=[];let s=0,r=-1;for(let t=0,e=this.measureList.length;t0?(r=t-1,i.push({startIndex:s,endIndex:r}),s=t):n.HasEndLine&&this.rules.NewPartAndSystemAfterFinalBarline&&(r=t,i.push({startIndex:s,endIndex:r}),s=t+1)}s0?Number(t):6,f===t||p+s>r&&f%2==0?(a.push(f),p=n,f=1):f++}else p>r?(a.push(f),p=n,f=1):f++;m=n>r?t+1:Math.ceil(m),c===m?d+=1:(o.push(d),c=m,d=1)}o.push(d),a.push(f),a=a.filter(Boolean)}return a.length>1&&1===a[a.length-1]&&(a[a.length-2]=a[a.length-2]-1,a[a.length-1]=a[a.length-1]+1),console.log(a,o),this.buildPreparedMusicSystems(a)}buildPreparedMusicSystems(t){let e=!1;this.currentSystemParams=new n.SystemBuildParameters,this.currentSystemParams.currentSystem=this.initMusicSystem();for(let i=0,n=this.measureList.length;i0&&this.rules.RenderMultipleRestMeasures){a.isReducedToMultiRest=!0,a.multipleRestMeasureNumber=1;const i=a.multipleRestMeasures-1;r+=i;for(let n=1;n<=i;n++){const i=t.SourceMeasures[a.MeasureNumber-1+n];i.multipleRestMeasureNumber=n+1,i.isReducedToMultiRest=!0,e.push([void 0])}}}if(this.rules.AutoGenerateMutipleRestMeasuresFromRestMeasures&&this.rules.RenderMultipleRestMeasures){let r,a=0;for(let l=0,h=t.SourceMeasures.length;l0){r.isReducedToMultiRest=!0,r.multipleRestMeasureNumber=1,a++,h.multipleRestMeasureNumber=a,h.isReducedToMultiRest=!0;for(let t=0;t1){r.multipleRestMeasures=a;const t=this.createGraphicalMeasuresForSourceMeasure(r,i,s,o,n);e[r.measureListIndex]=t,a=0,r=void 0}else a=0,r=void 0}if(a>1){r.multipleRestMeasures=a,r.isReducedToMultiRest=!0;const t=this.createGraphicalMeasuresForSourceMeasure(r,i,s,o,n);e[r.measureListIndex]=t,a=0,r=void 0}}const l=n.map((t=>t.ClefType===a.ClefEnum.percussion));this.handleStaffEntries(l),this.calculateVerticalContainersList(),this.setIndicesToVerticalGraphicalContainers()}calculate(){this.musicSystems=[],this.clearSystemsAndMeasures(),this.clearRecreatedObjects(),this.createGraphicalTies(),this.calculateSheetLabelBoundingBoxes(),this.calculateXLayout(this.graphicalMusicSheet,this.maxInstrNameLabelLength()),this.graphicalMusicSheet.MusicPages.length=0,this.calculateMusicSystems(),s.GraphicalMusicSheet.transformRelativeToAbsolutePosition(this.graphicalMusicSheet)}calculateXLayout(t,e){let i=0;const n=this.rules.MaxInstructionsConstValue;if(this.graphicalMusicSheet.MeasureList.length>0){let t=this.graphicalMusicSheet.MeasureList[0],s=this.calculateMeasureXLayout(t);s=this.calculateMeasureWidthFromStaffEntries(t,s),F.setMeasuresMinStaffEntriesWidth(t,s),i=1.2*s+e+n;for(let e=1;e0)return;const r=e.Measures[s];0!==r.MeasureNumber&&1!==r.MeasureNumber||(i=r.MeasureNumber),n=r!==e.Measures[0]&&this.rules.MeasureNumberLabelXOffset?this.rules.MeasureNumberLabelXOffset:0;const o=this.rules.UseXMLMeasureNumbers&&1===r.MeasureNumber&&1!==r.parentSourceMeasure.getPrintedMeasureNumber();((r.MeasureNumber===i||r.MeasureNumber>=i+this.rules.MeasureNumberLabelOffset)&&!r.parentSourceMeasure.ImplicitMeasure||o)&&((1!==r.MeasureNumber||1===r.MeasureNumber&&r!==e.Measures[0]||o)&&this.calculateSingleMeasureNumberPlacement(r,e,t,n),i=r.MeasureNumber)}}calculateSingleMeasureNumberPlacement(t,e,i,n=0){const s=t.parentSourceMeasure.getPrintedMeasureNumber().toString(),r=new P.Label(s),o=new m.GraphicalLabel(r,this.rules.MeasureNumberLabelHeight,g.TextAlignmentEnum.LeftBottom,this.rules),a=e.SkyBottomLineCalculator;o.setLabelPositionAndShapeBorders(),o.PositionAndShape.Parent=i.PositionAndShape;const l=e.PositionAndShape.RelativePosition.x+t.PositionAndShape.RelativePosition.x-o.PositionAndShape.BorderMarginLeft+n;let h,u=l,c=l-o.PositionAndShape.BorderLeft+o.PositionAndShape.BorderRight;u-=e.PositionAndShape.RelativePosition.x,c-=e.PositionAndShape.RelativePosition.x;const d=u+.5,f=c-.5,b=a.getSkyLineMinInRange(d,f);if(t===e.Measures[0]){let t=0;if(i.GroupBrackets.length>0)for(const e of i.GroupBrackets)t=Math.min(t,e.PositionAndShape.BorderTop);h=Math.min(b,t)}else h=b;h=Math.min(0,h),o.PositionAndShape.RelativePosition=new p.PointF2D(l,h),i.MeasureNumberLabels.push(o)}calculateMeasureNumberSkyline(t){const e=t.StaffLines[0];for(const i of t.MeasureNumberLabels){let t=i.PositionAndShape.RelativePosition.x,n=t-i.PositionAndShape.BorderLeft+i.PositionAndShape.BorderRight;t-=e.PositionAndShape.RelativePosition.x,n-=e.PositionAndShape.RelativePosition.x,e.SkyBottomLineCalculator.updateSkyLineInRange(t,n,i.PositionAndShape.RelativePosition.y+i.PositionAndShape.BorderMarginTop)}}layoutGraphicalTie(t,e,i){throw new Error(this.abstractNotImplementedErrorMessage)}calculateSingleStaffLineLyricsPosition(t,e){let i=0,n=this.rules.StaffHeight;const s=[],r=t.SkyBottomLineCalculator;let o=t.Measures.length;for(let e=0;e0){s.push(e),i=Math.max(i,e.LyricsEntries.length);const t=e.PositionAndShape.RelativePosition.x+a.x;let o=Number.MAX_VALUE,l=Number.MIN_VALUE;for(let i=0;i0){const e=t.PositionAndShape.Size.width;let i=s[0].PositionAndShape.RelativePosition.x+s[0].PositionAndShape.BorderMarginLeft+s[0].parentMeasure.PositionAndShape.RelativePosition.x;i=i>e?e:i,r.updateBottomLineInRange(i,e,a)}return s}calculateLyricsExtendsAndDashes(t){for(let e=0,i=t.length;e0||t.UnknownList.length>0){let e="";for(let i=0,n=t.EntriesList.length;it.length-1&&(E.default.debug("minimum measure to draw index out of range. resetting min measure index to limit."),this.rules.MinMeasureToDrawIndex=t.length-1);const e=[];for(let i=this.rules.MinMeasureToDrawIndex,n=t.length;i0)&&(i=t.getSkyLineMinInRange(a,l));let h=0;0===n?(h+=this.rules.ChordSymbolYOffset,h+=.1):h+=this.rules.ChordSymbolYPadding,h*=-1;const u=s.GraphicalLabel;u.PositionAndShape.RelativePosition.y=i+h,u.setLabelPositionAndShapeBorders(),u.PositionAndShape.calculateBoundingBox(),t.updateSkyLineInRange(a,l,i+u.PositionAndShape.BorderMarginTop)}}}}calculateAlignedChordSymbolsOffset(t,e){let i=Number.MAX_SAFE_INTEGER;for(const n of t)for(const t of n.graphicalChordContainers){const s=n.PositionAndShape,r=t.PositionAndShape,o=r.BorderMarginLeft+s.AbsolutePosition.x,a=r.BorderMarginRight+s.AbsolutePosition.x;i=Math.min(i,e.getSkyLineMinInRange(o,a))}return i}layoutMeasureWithWholeRest(t,e,i){}layoutBeams(t){}layoutArticulationMarks(t,e,i){}layoutOrnament(t,e,i){}calculateRestNotePlacementWithinGraphicalBeam(t,e,i,n,s){}calculateTupletNumbers(){}calculateSlurs(){}calculateDynamicExpressionsForMultiExpression(t,e,i){}calculateGraphicalVerbalContinuousDynamic(t,e){const i=t.Label,n=e.x+i.PositionAndShape.BorderMarginLeft,s=e.x+i.PositionAndShape.BorderMarginRight,r=t.ContinuousDynamic.Placement,o=t.ParentStaffLine.SkyBottomLineCalculator;let a;r===C.PlacementEnum.Below?(a=o.getBottomLineMaxInRange(n,s),i.PositionAndShape.RelativePosition=new p.PointF2D(e.x,a-i.PositionAndShape.BorderMarginTop)):(a=o.getSkyLineMinInRange(n,s),i.PositionAndShape.RelativePosition=new p.PointF2D(e.x,a-i.PositionAndShape.BorderMarginBottom))}calculateGraphicalContinuousDynamic(t,e){var i,n,s;const o=t.ParentStaffLine.ParentStaff.idInMusicSheet,a=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(t.ContinuousDynamic.EndMultiExpression.SourceMeasureParent,o);if(!a)return void E.default.warn("MusicSheetCalculator.calculateGraphicalContinuousDynamic: No endMeasure found");t.EndMeasure=a;const l=t.ParentStaffLine,h=a.ParentStaffLine,u=h&&l===h;let c=!1;h?c=null==h?void 0:h.isPartOfMultiStaffInstrument():l&&(c=null==l?void 0:l.isPartOfMultiStaffInstrument());const d=r.Fraction.createFromFraction(t.ContinuousDynamic.EndMultiExpression.AbsoluteTimestamp),p=this.graphicalMusicSheet.GetVerticalContainerFromTimestamp(d),f=p.getFirstNonNullStaffEntry().parentMeasure,m=f.PositionAndShape.AbsolutePosition.x+f.PositionAndShape.BorderRight;let g=new r.Fraction(0,0,0);for(const t of p.StaffEntries){const e=null===(i=null==t?void 0:t.sourceStaffEntry)||void 0===i?void 0:i.calculateMaxNoteLength();(null==e?void 0:e.gt(g))&&(g=e)}const b=this.getRelativePositionInStaffLineFromTimestamp(d,o,h,c,0),y=r.Fraction.plus(d,g),S=this.getRelativePositionInStaffLineFromTimestamp(y,o,h,c,0);S.x>b.x&&S.xx){const t=_.StaffLines[e].PositionAndShape.RelativePosition.y-l.PositionAndShape.RelativePosition.y-this.rules.StaffHeight;O=this.rules.StaffHeight+t/2}else O=this.rules.WedgePlacementBelowY;O-=this.rules.WedgeOpeningLength/2,u||(D=O);let i=M.getBottomLineMaxInRange(A,L);i>O&&(O=i);const n=!1;if(x<_.StaffLines.length-1){const i=l.findClosestStaffEntry(L),s=l.findClosestStaffEntry(A);if(s&&i&&(s.parentVerticalContainer,n)){const i=_.StaffLines[e],n=i.SkyBottomLineCalculator.getSkyLineMinInRange(A,L),s=i.PositionAndShape.RelativePosition.y-l.PositionAndShape.RelativePosition.y+n;O=s-this.rules.WedgeOpeningLength>this.rules.StaffHeight?s-this.rules.WedgeVerticalMargin:this.rules.StaffHeight+this.rules.WedgeOpeningLength,t.NotToBeRemoved=!0}}u||(i=h.SkyBottomLineCalculator.getBottomLineMaxInRange(I,k),i>D&&(D=i),D+=this.rules.WedgeOpeningLength/2,D+=this.rules.WedgeVerticalMargin),n||(O+=this.rules.WedgeOpeningLength/2,O+=this.rules.WedgeVerticalMargin)}else if(w===C.PlacementEnum.Above){if(1===l.ParentStaff.ParentInstrument.Staves.length)O=this.rules.WedgePlacementAboveY;else{let t=0;x>0&&(t=x-1);const e=_.StaffLines[t];O=-(l.PositionAndShape.RelativePosition.y-e.PositionAndShape.RelativePosition.y-this.rules.StaffHeight)/2}O+=this.rules.WedgeOpeningLength/2,u||(D=O);let t=M.getSkyLineMinInRange(A,L);t1&&x>0){const t=l.findClosestStaffEntry(A),i=l.findClosestStaffEntry(L);if(t&&i){t.parentVerticalContainer;const i=x-1;if(e){const t=_.StaffLines[i],e=t.SkyBottomLineCalculator.getBottomLineMaxInRange(A,L);O=(l.PositionAndShape.RelativePosition.y-t.PositionAndShape.RelativePosition.y-e-this.rules.StaffHeight)/2+this.rules.StaffHeight}}}u||(t=h.SkyBottomLineCalculator.getSkyLineMinInRange(I,k),t-s/2?-s/2:i-t.PositionAndShape.BorderMarginBottom}else a=i-t.PositionAndShape.BorderMarginBottom;t.PositionAndShape.RelativePosition=new p.PointF2D(e.x,a)}else if(t.Placement===C.PlacementEnum.Below){const i=o.getBottomLineMaxInRange(s,r),l=n.ParentStaff.ParentInstrument.Staves[n.ParentStaff.ParentInstrument.Staves.length-1];if(n.isPartOfMultiStaffInstrument()&&n.ParentStaff!==l){const e=n.ParentMusicSystem.StaffLines[n.ParentMusicSystem.StaffLines.indexOf(n)+1].PositionAndShape.RelativePosition.y-n.PositionAndShape.RelativePosition.y-this.rules.StaffHeight;a=i+t.PositionAndShape.BorderMarginBottomt.PositionAndShape.Size.width&&(d=t.PositionAndShape.Size.width-this.rules.MeasureRightMargin,c=d-l.PositionAndShape.MarginSize.width,e.x=c-l.PositionAndShape.BorderMarginLeft);const f=t.SkyBottomLineCalculator;return u=s===C.PlacementEnum.Below?f.getBottomLineMaxInRange(c,d):f.getSkyLineMinInRange(c,d),l.PositionAndShape.RelativePosition=new p.PointF2D(e.x,u),s===C.PlacementEnum.Below?f.updateBottomLineInRange(c,d,l.PositionAndShape.BorderMarginBottom+u):f.updateSkyLineInRange(c,d,l.PositionAndShape.BorderMarginTop+u),l}calculateTempoExpressionsForMultiTempoExpression(t,e,i,n){B={};const s=r.Fraction.plus(t.AbsoluteTimestamp,e.Timestamp),o=this.graphicalMusicSheet.MeasureList[i];let a=new p.PointF2D;if(e.ContinuousTempo||e.InstantaneousTempo){if(this.rules.MinMeasureToDrawIndex>0)return;if(!o[0])return;let r=o[0].ParentStaffLine,l=o[0].PositionAndShape.RelativePosition.x,h=0;for(let t=0;t0){r=o[t].ParentStaffLine,l=o[t].PositionAndShape.RelativePosition.x,h=t;break}if(a=this.getRelativePositionInStaffLineFromTimestamp(s,h,r,r.isPartOfMultiStaffInstrument(),l),e.EntriesList.length>0&&e.EntriesList[0].Expression instanceof I.InstantaneousTempoExpression&&(e.EntriesList[0].Expression.Placement=C.PlacementEnum.Above,r.Measures[0].staffEntries.length>0&&0===Math.abs(a.x-r.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x)&&r.ParentMusicSystem===this.musicSystems[0])){const t=r.Measures[0].FirstInstructionStaffEntry;if(t){const e=t.GraphicalInstructions.last();a.x=e.PositionAndShape.RelativePosition.x}this.rules.CompactMode&&(a.x=r.PositionAndShape.RelativePosition.x+r.Measures[0].PositionAndShape.RelativePosition.x)}for(const s of e.EntriesList){let o=g.TextAlignmentEnum.CenterBottom;this.rules.CompactMode&&(o=g.TextAlignmentEnum.LeftBottom);const l=this.calculateLabel(r,a,s.label,e.getFontstyleOfFirstEntry(),s.Expression.Placement,this.rules.UnknownTextHeight,o);if(s.Expression instanceof I.InstantaneousTempoExpression){for(const t of r.AbstractExpressions)t instanceof A.GraphicalInstantaneousTempoExpression&&(t.SourceExpression.Label,s.Expression.Label);new A.GraphicalInstantaneousTempoExpression(s.Expression,l).ParentStaffLine||E.default.warn("Adding staffline didn't work"),s.Expression.Enum===I.TempoEnum.metronomeMark&&(B[i]=s.Expression)}else s.Expression,L.ContinuousTempoExpression;if(n===t.TempoExpressions.length-1)for(const t of Object.values(B))this.createMetronomeMark(t,i)}}}createMetronomeMark(t,e){throw new Error(this.abstractNotImplementedErrorMessage)}graphicalMeasureCreatedCalculations(t){}clearSystemsAndMeasures(){for(let t=0,e=this.graphicalMusicSheet.MusicPages.length;t-1&&i.PositionAndShape.ChildElements.splice(t,1),i.FirstInstructionStaffEntry=void 0,i.beginInstructionsWidth=0}if(i.LastInstructionStaffEntry){const t=i.PositionAndShape.ChildElements.indexOf(i.LastInstructionStaffEntry.PositionAndShape);t>-1&&i.PositionAndShape.ChildElements.splice(t,1),i.LastInstructionStaffEntry=void 0,i.endInstructionsWidth=0}}e.Measures=[],e.PositionAndShape.ChildElements=[]}i.StaffLines.length=0,i.PositionAndShape.ChildElements=[]}e.MusicSystems=[],e.PositionAndShape.ChildElements=[]}this.graphicalMusicSheet.MusicPages=[]}handleVoiceEntry(t,e,i,n,s,r,o,a,l,h=void 0,u=void 0){t.StemDirectionXml!==c.StemDirectionType.Undefined&&this.rules.SetWantedStemDirectionByXml&&void 0!==t.StemDirectionXml?t.WantedStemDirection=t.StemDirectionXml:this.calculateStemDirectionFromVoices(t);const d=e.findOrCreateGraphicalVoiceEntry(t);d.octaveShiftValue=a;const p=e.tabStaffEntry;let f;p&&(f=p.findOrCreateGraphicalVoiceEntry(t));for(let n=0,l=t.Notes.length;n-1)continue;let c;if(t.IsGrace?c=F.symbolFactory.createGraceNote(l,d,s,this.rules,a):(c=F.symbolFactory.createNote(l,d,s,a,this.rules,void 0),F.stafflineNoteCalculator.trackNote(c)),l.Pitch&&this.checkNoteForAccidental(c,i,s,a),this.resetYPositionForLeadSheet(c.PositionAndShape),e.addGraphicalNoteToListAtCorrectYPosition(d,c),c.PositionAndShape.calculateBoundingBox(),this.leadSheet||(void 0!==l.NoteBeam&&l.PrintObject&&this.handleBeam(c,l.NoteBeam,o),void 0!==l.NoteTuplet&&l.PrintObject&&this.handleTuplet(c,l.NoteTuplet,r)),f){const t=F.symbolFactory.createNote(l,f,s,a,this.rules,void 0);p.addGraphicalNoteToListAtCorrectYPosition(f,t),t.PositionAndShape.calculateBoundingBox(),this.leadSheet||l.NoteTuplet&&this.handleTuplet(t,l.NoteTuplet,r)}}return t.Articulations.length>0&&this.handleVoiceEntryArticulations(t.Articulations,t,e),t.TechnicalInstructions.length>0&&this.handleVoiceEntryTechnicalInstructions(t.TechnicalInstructions,t,e),t.LyricsEntries.size()>0&&this.handleVoiceEntryLyrics(t,e,n),t.OrnamentContainer&&this.handleVoiceEntryOrnaments(t.OrnamentContainer,t,e),a}resetYPositionForLeadSheet(t){this.leadSheet&&(t.RelativePosition=new p.PointF2D(t.RelativePosition.x,0))}layoutVoiceEntries(t,e){if(t.PositionAndShape.RelativePosition=new p.PointF2D(0,0),!this.leadSheet)for(const e of t.graphicalVoiceEntries){const i=e.notes;if(0===i.length)continue;const n=i[0].sourceNote.ParentVoiceEntry,s=void 0!==i[0].sourceNote.Pitch;this.layoutVoiceEntry(n,i,t,s)}}maxInstrNameLabelLength(){var t;let e=0;for(const i of this.graphicalMusicSheet.ParentMusicSheet.Instruments)if((null===(t=i.NameLabel)||void 0===t?void 0:t.print)&&i.Voices.length>0&&i.Voices[0].Visible){let t=i.NameLabel;this.rules.RenderPartNames||(t=new P.Label("",t.textAlignment,t.font));const n=new m.GraphicalLabel(t,this.rules.InstrumentLabelTextHeight,g.TextAlignmentEnum.LeftCenter,this.rules);n.setLabelPositionAndShapeBorders(),e=Math.max(e,n.PositionAndShape.MarginSize.width)}return this.rules.RenderPartNames?e:0}calculateSheetLabelBoundingBoxes(){var t;const e=this.graphicalMusicSheet.ParentMusicSheet,i=this.rules.DefaultColorTitle;if(void 0!==e.Title&&this.rules.RenderTitle){const t=new m.GraphicalLabel(e.Title,this.rules.SheetTitleHeight,g.TextAlignmentEnum.CenterBottom,this.rules);t.Label.IsCreditLabel=!0,t.Label.colorDefault=i,this.graphicalMusicSheet.Title=t,t.setLabelPositionAndShapeBorders()}else this.rules.RenderTitle||(this.graphicalMusicSheet.Title=void 0);if(void 0!==e.Subtitle&&this.rules.RenderSubtitle){const t=new m.GraphicalLabel(e.Subtitle,this.rules.SheetSubtitleHeight,g.TextAlignmentEnum.CenterCenter,this.rules);t.Label.IsCreditLabel=!0,t.Label.colorDefault=i,this.graphicalMusicSheet.Subtitle=t,t.setLabelPositionAndShapeBorders()}else this.rules.RenderSubtitle||(this.graphicalMusicSheet.Subtitle=void 0);if(void 0!==e.Composer&&this.rules.RenderComposer){const t=new m.GraphicalLabel(e.Composer,this.rules.SheetComposerHeight,g.TextAlignmentEnum.RightCenter,this.rules);t.Label.IsCreditLabel=!0,t.Label.colorDefault=i,this.graphicalMusicSheet.Composer=t,t.setLabelPositionAndShapeBorders()}else this.rules.RenderComposer||(this.graphicalMusicSheet.Composer=void 0);if(void 0!==e.Lyricist&&this.rules.RenderLyricist){const t=new m.GraphicalLabel(e.Lyricist,this.rules.SheetAuthorHeight,g.TextAlignmentEnum.LeftCenter,this.rules);t.Label.IsCreditLabel=!0,t.Label.colorDefault=i,this.graphicalMusicSheet.Lyricist=t,t.setLabelPositionAndShapeBorders()}else this.rules.RenderLyricist||(this.graphicalMusicSheet.Lyricist=void 0);const n=null===(t=this.graphicalMusicSheet.musicSheet.sourceMeasures)||void 0===t?void 0:t[0];if(n&&n.FirstInstructionsStaffEntries.length>0){const t=n.FirstInstructionsStaffEntries[0];let s,r,o;for(let e=0,i=t.Instructions.length;e0&&1===t.graphicalVoiceEntries[0].notes.length){const i=t.graphicalVoiceEntries[0].notes[0];!i.sourceNote.Pitch&&new r.Fraction(1,2).lt(i.sourceNote.Length)&&this.layoutMeasureWithWholeRest(i,t,e)}}}}}}optimizeRestNotePlacement(t,e){if(0===t.graphicalVoiceEntries.length)return;const i=t.graphicalVoiceEntries[0].notes;if(0===i.length)return;const n=i[0],s=n.sourceNote.isRest();if(2===t.graphicalVoiceEntries.length){let e=!1;const i=t.graphicalVoiceEntries[1].notes;i.length>0&&(e=i[0].sourceNote.isRest()),s&&e?this.calculateTwoRestNotesPlacementWithCollisionDetection(t):(s||e)&&this.calculateRestNotePlacementWithCollisionDetectionFromGraphicalNote(t)}else if(s&&t!==e.staffEntries[0]&&t!==e.staffEntries[e.staffEntries.length-1]){const i=e.staffEntries.indexOf(t),s=e.staffEntries[i-1],r=e.staffEntries[i+1];if(1===s.graphicalVoiceEntries.length){const e=s.graphicalVoiceEntries[0].notes[0];if(void 0!==e.sourceNote.NoteBeam&&1===r.graphicalVoiceEntries.length){const i=r.graphicalVoiceEntries[0].notes[0];void 0!==i.sourceNote.NoteBeam&&e.sourceNote.NoteBeam===i.sourceNote.NoteBeam&&(this.calculateRestNotePlacementWithinGraphicalBeam(t,n,e,r,i),t.PositionAndShape.calculateBoundingBox())}}}}getRelativePositionInStaffLineFromTimestamp(t,e,i,n,s=0){let o,a,l=new p.PointF2D;const h=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length,u=this.graphicalMusicSheet.GetInterpolatedIndexInVerticalContainers(t),c=Math.min(Math.floor(u),h-1),d=Math.min(Math.ceil(u),h-1);if(c<0||e<0)return l;if(o=this.getFirstLeftNotNullStaffEntryFromContainer(c,e,n),a=this.getFirstRightNotNullStaffEntryFromContainer(d,e,n),o&&a){let e=o.parentMeasure.PositionAndShape.RelativePosition.x;s>0&&(e=s);let n=o.PositionAndShape.RelativePosition.x+e,h=a.PositionAndShape.RelativePosition.x+a.parentMeasure.PositionAndShape.RelativePosition.x;s>0&&(h=a.PositionAndShape.RelativePosition.x+e);let u=0;if(o!==a){const e=o.getAbsoluteTimestamp(),i=a.getAbsoluteTimestamp();u=r.Fraction.minus(t,e).RealValue/r.Fraction.minus(i,e).RealValue}o.parentMeasure.ParentStaffLine!==a.parentMeasure.ParentStaffLine&&(o.parentMeasure.ParentStaffLine===i?h=i.PositionAndShape.Size.width:n=i.PositionAndShape.RelativePosition.x),l=new p.PointF2D(n+(h-n)*u,0)}return l}getRelativeXPositionFromTimestamp(t){const e=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length,i=this.graphicalMusicSheet.GetInterpolatedIndexInVerticalContainers(t),n=Math.max(0,Math.min(Math.round(i),e-1)),s=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[n].getFirstNonNullStaffEntry();return s.PositionAndShape.RelativePosition.x+s.parentMeasure.PositionAndShape.RelativePosition.x}calculatePageLabels(t){var e;this.rules.RenderSingleHorizontalStaffline&&(t.PositionAndShape.BorderRight=t.PositionAndShape.Size.width,t.PositionAndShape.calculateBoundingBox(),this.graphicalMusicSheet.ParentMusicSheet.pageWidth=t.PositionAndShape.Size.width);let i=10;if(t.MusicSystems.length>0){const e=t.MusicSystems[0];i=e.PositionAndShape.RelativePosition.y+e.PositionAndShape.BorderTop}if(this.graphicalMusicSheet.Title){const e=this.graphicalMusicSheet.Title;e.PositionAndShape.Parent=t.PositionAndShape;const i=new p.PointF2D;i.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth/2,i.y=this.rules.TitleTopDistance+this.rules.SheetTitleHeight,e.PositionAndShape.RelativePosition=i,t.Labels.push(e)}if(this.graphicalMusicSheet.Subtitle){const e=this.graphicalMusicSheet.Subtitle;e.PositionAndShape.Parent=t.PositionAndShape;const i=new p.PointF2D;i.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth/2,i.y=this.rules.TitleTopDistance+this.rules.SheetTitleHeight+this.rules.SheetMinimumDistanceBetweenTitleAndSubtitle,e.PositionAndShape.RelativePosition=i,t.Labels.push(e)}const n=this.graphicalMusicSheet.Composer;let s;if(n){n.PositionAndShape.Parent=t.PositionAndShape,n.setLabelPositionAndShapeBorders();const r=new p.PointF2D;r.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth-this.rules.PageRightMargin,r.y=i,r.y-=this.rules.SystemComposerDistance;const o=null===(e=n.TextLines)||void 0===e?void 0:e.length;o>1&&(r.y-=n.PositionAndShape.BorderBottom*(o-1)/o),s=r.y,n.PositionAndShape.RelativePosition=r,t.Labels.push(n)}const r=this.graphicalMusicSheet.Lyricist;if(r){r.PositionAndShape.Parent=t.PositionAndShape,r.setLabelPositionAndShapeBorders();const e=new p.PointF2D;e.x=this.rules.PageLeftMargin,e.y=i,e.y+=r.PositionAndShape.BorderBottom,e.y=Math.min(e.y,null!=s?s:Number.MAX_SAFE_INTEGER),r.PositionAndShape.RelativePosition=e,t.Labels.push(r)}}createGraphicalTies(){for(let t=0;t=0&&this.staffEntriesWithGraphicalTies.push(a)}a=r}}setTieDirections(t){if(!t)return;const e=t.ties;if(e.length>1){let t;for(const i of e){const e=i.Notes[0];(!t||e.Pitch.getHalfTone()>t.Pitch.getHalfTone())&&(t=e)}for(const i of e)i.TieDirection===C.PlacementEnum.NotYetDefined&&(i.Notes[0]===t?i.TieDirection=C.PlacementEnum.Above:i.TieDirection=C.PlacementEnum.Below)}}createAccidentalCalculators(){const t=[],e=this.graphicalMusicSheet.ParentMusicSheet.getFirstSourceMeasure();if(e)for(let i=0;i1)return;w=F.symbolFactory.createGraphicalMeasure(t,M)}if(w.hasError=t.getErrorInMeasure(d),t.FirstInstructionsStaffEntries[d])for(let e=0,i=t.FirstInstructionsStaffEntries[d].Instructions.length;e0){const e=o.Instructions[0];F.symbolFactory.createInStaffClef(t,e)}this.rules.RenderChordSymbols&&(null===(E=o.ChordContainers)||void 0===E?void 0:E.length)>0&&(o.ParentStaff.ParentInstrument.HasChordSymbols=!0,F.symbolFactory.createChordSymbols(o,t,n.ActiveKeyInstruction,this.graphicalMusicSheet.ParentMusicSheet.Transpose))}}if(n.doCalculationsAtEndOfMeasure(),t.LastInstructionsStaffEntries[d]){const e=t.LastInstructionsStaffEntries[d];for(let t=0,i=e.Instructions.length;t=1&&0===w.staffEntries.length){const e=new f.SourceStaffEntry(new T.VerticalSourceStaffEntryContainer(w.parentSourceMeasure,w.parentSourceMeasure.AbsoluteTimestamp,w.parentSourceMeasure.CompleteNumberOfStaves),M),i=new c.VoiceEntry(new r.Fraction(0,1),M.Voices[0],e),n=new o.Note(i,e,r.Fraction.createFromFraction(t.Duration),void 0,t);n.PrintObject=this.rules.FillEmptyMeasuresWithWholeRest===k.FillEmptyMeasuresWithWholeRests.YesVisible,i.addNote(n);const s=F.symbolFactory.createStaffEntry(e,w);w.addGraphicalStaffEntry(s),s.relInMeasureTimestamp=i.Timestamp;const l=F.symbolFactory.createVoiceEntry(i,s);s.graphicalVoiceEntries.push(l);const h=F.symbolFactory.createNote(n,l,new a.ClefInstruction,u.OctaveEnum.NONE,void 0);F.stafflineNoteCalculator.trackNote(h),l.notes.push(h)}w.hasOnlyRests=!0;for(const t of w.staffEntries)if(w.hasOnlyRests=t.hasOnlyRests(),!w.hasOnlyRests)break;return w}checkNoteForAccidental(t,e,i,n){let s=t.sourceNote.Pitch;const r=t.parentVoiceEntry.parentStaffEntry.parentMeasure.getTransposedHalftones();0!==r&&t.sourceNote.ParentStaffEntry.ParentStaff.ParentInstrument.MidiInstrumentId!==x.MidiInstrument.Percussion&&(s=t.Transpose(e.ActiveKeyInstruction,i,r,n),t.sourceNote.TransposedPitch=s),t.sourceNote.halfTone=s.getHalfTone(),e.checkAccidental(t,s)}handleStaffEntries(t){for(let e=0,i=this.graphicalMusicSheet.MeasureList.length;e0&&t.graphicalVoiceEntries[0].notes.length>0&&(this.layoutVoiceEntries(t,e),this.layoutStaffEntry(t));this.graphicalMeasureCreatedCalculations(n)}}}}calculateSkyBottomLines(){for(const t of this.musicSystems)for(const e of t.StaffLines)e.SkyBottomLineCalculator.calculateLines()}calculateExpressionAlignements(){}calculateStaffEntryArticulationMarks(){for(let t=0,e=this.musicSystems.length;t0&&this.layoutArticulationMarks(e.Articulations,e,i)}}}}}}calculateOrnaments(){for(let t=0,e=this.musicSystems.length;t0&&e.LyricVersesNumbers.sort()}for(let e=0,i=this.musicSystems.length;e=0&&(n=e.GraphicalLyricsEntries[i+1]),!n)return;const s=t.StaffEntryParent.parentMeasure.ParentStaffLine,r=n.StaffEntryParent.parentMeasure.ParentStaffLine,o=t.StaffEntryParent,a=n.StaffEntryParent;if(t.StaffEntryParent.parentMeasure.ParentStaffLine===n.StaffEntryParent.parentMeasure.ParentStaffLine){const e=o.parentMeasure.PositionAndShape.RelativePosition.x+o.PositionAndShape.RelativePosition.x+t.GraphicalLabel.PositionAndShape.RelativePosition.x+t.GraphicalLabel.PositionAndShape.BorderMarginRight,i=a.parentMeasure.PositionAndShape.RelativePosition.x+a.PositionAndShape.RelativePosition.x+t.GraphicalLabel.PositionAndShape.RelativePosition.x+n.GraphicalLabel.PositionAndShape.BorderMarginLeft,r=t.GraphicalLabel.PositionAndShape.RelativePosition.y;let l=1;i-e>3*this.rules.MinimumDistanceBetweenDashes&&(l=Math.floor((i-e)/this.rules.MinimumDistanceBetweenDashes)-1),1===l?this.calculateSingleDashForLyricWord(s,e,i,r):this.calculateDashes(s,e,i,r)}else{const e=o.parentMeasure.PositionAndShape.RelativePosition.x+o.PositionAndShape.RelativePosition.x+t.GraphicalLabel.PositionAndShape.BorderMarginRight,i=s.Measures[s.Measures.length-1],l=i.PositionAndShape.RelativePosition.x+i.PositionAndShape.Size.width;let h=t.GraphicalLabel.PositionAndShape.RelativePosition.y;if(this.calculateDashes(s,e,l,h),r&&r.Measures[0]&&a.parentMeasure.ParentStaffLine&&(a!==a.parentMeasure.staffEntries[0]||a.parentMeasure!==a.parentMeasure.ParentStaffLine.Measures[0])){const t=r.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x,e=a.parentMeasure.PositionAndShape.RelativePosition.x+a.PositionAndShape.RelativePosition.x+n.GraphicalLabel.PositionAndShape.BorderMarginLeft;h=n.GraphicalLabel.PositionAndShape.RelativePosition.y,this.calculateDashes(r,t,e,h)}}}calculateDashes(t,e,i,n){let s=i-e;if(s<3*this.rules.MinimumDistanceBetweenDashes)this.calculateSingleDashForLyricWord(t,e,i,n);else{const r=Math.floor(s/this.rules.MinimumDistanceBetweenDashes)-1,o=s/(r+1);let a=0;for(e+=o,i-=o;a<=Math.floor(r/2)&&i>e;)s=this.calculateRightAndLeftDashesForLyricWord(t,e,i,n),e+=o,i-=o,a++;s>2*o&&this.calculateSingleDashForLyricWord(t,e,i,n)}}calculateSingleDashForLyricWord(t,e,i,n){const s=new P.Label("-"),r=new m.GraphicalLabel(s,this.rules.LyricsHeight,g.TextAlignmentEnum.CenterBottom,this.rules);r.setLabelPositionAndShapeBorders(),t.LyricsDashes.push(r),-1===this.staffLinesWithLyricWords.indexOf(t)&&this.staffLinesWithLyricWords.push(t),r.PositionAndShape.Parent=t.PositionAndShape;const o=new p.PointF2D(e+(i-e)/2,n);r.PositionAndShape.RelativePosition=o}calculateLyricExtend(t){let e=t.GraphicalLabel.PositionAndShape.RelativePosition.y;const i=t.StaffEntryParent,n=i.parentMeasure.ParentStaffLine;let s,r;const o=i.parentMeasure.ParentStaff.idInMusicSheet;for(let t=i.parentVerticalContainer.Index+1;t0)break;s=e,r=s.parentMeasure.ParentStaffLine,r||(r=i.parentMeasure.ParentStaffLine)}}if(s&&r)if(n===r&&s.parentMeasure.ParentStaffLine){const r=i.parentMeasure.PositionAndShape.RelativePosition.x+i.PositionAndShape.RelativePosition.x+t.GraphicalLabel.PositionAndShape.BorderMarginRight,o=s.parentMeasure.PositionAndShape.RelativePosition.x+s.PositionAndShape.RelativePosition.x+s.PositionAndShape.BorderMarginRight;e-=t.GraphicalLabel.PositionAndShape.Size.height/4,this.calculateSingleLyricWordWithUnderscore(n,r,o,e)}else{const o=n.Measures[n.Measures.length-1].PositionAndShape,a=i.parentMeasure.PositionAndShape.RelativePosition.x+i.PositionAndShape.RelativePosition.x+t.GraphicalLabel.PositionAndShape.BorderMarginRight,l=o.RelativePosition.x+o.Size.width;if(e-=t.GraphicalLabel.PositionAndShape.Size.height/4,this.calculateSingleLyricWordWithUnderscore(n,a,l,e),!s)return;if(s.parentMeasure.ParentStaffLine&&s.parentMeasure.staffEntries&&(s!==s.parentMeasure.staffEntries[0]||s.parentMeasure!==s.parentMeasure.ParentStaffLine.Measures[0])){const t=r.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x,i=s.parentMeasure.PositionAndShape.RelativePosition.x+s.PositionAndShape.RelativePosition.x+s.PositionAndShape.BorderMarginRight;this.calculateSingleLyricWordWithUnderscore(r,t,i,e)}}}calculateSingleLyricWordWithUnderscore(t,e,i,n){const s=new p.PointF2D(e,n),r=new p.PointF2D(i,n),o=new w.GraphicalLine(s,r,this.rules.LyricUnderscoreLineWidth);t.LyricLines.push(o),-1===this.staffLinesWithLyricWords.indexOf(t)&&this.staffLinesWithLyricWords.push(t)}calculateRightAndLeftDashesForLyricWord(t,e,i,n){const s=new P.Label("-"),r=new m.GraphicalLabel(s,this.rules.LyricsHeight,g.TextAlignmentEnum.CenterBottom,this.rules);r.setLabelPositionAndShapeBorders(),t.LyricsDashes.push(r),-1===this.staffLinesWithLyricWords.indexOf(t)&&this.staffLinesWithLyricWords.push(t),r.PositionAndShape.Parent=t.PositionAndShape;const o=new p.PointF2D(e,n);r.PositionAndShape.RelativePosition=o;const a=new P.Label("-"),l=new m.GraphicalLabel(a,this.rules.LyricsHeight,g.TextAlignmentEnum.CenterBottom,this.rules);l.setLabelPositionAndShapeBorders(),t.LyricsDashes.push(l),l.PositionAndShape.Parent=t.PositionAndShape;const h=new p.PointF2D(i,n);return l.PositionAndShape.RelativePosition=h,l.PositionAndShape.RelativePosition.x-r.PositionAndShape.RelativePosition.x}calculateDynamicExpressions(){const t=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,this.rules.MaxMeasureToDrawIndex);for(let e=Math.min(this.rules.MinMeasureToDrawIndex,this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length);e<=t;e++){const t=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[e];this.dynamicExpressionMap.clear();for(let i=0;i=0;i--)if(null===(s=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[i])||void 0===s?void 0:s.StaffEntries[e])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[i].StaffEntries[e]}getFirstRightNotNullStaffEntryFromContainer(t,e,i){var n,s;if(null===(n=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[t])||void 0===n?void 0:n.StaffEntries[e])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[t].StaffEntries[e];for(let i=t+1;i0||e.StaffLinkedExpressions[i][n].UnknownList.length>0)&&this.calculateMoodAndUnknownExpression(e.StaffLinkedExpressions[i][n],t,i)}}calculateStemDirectionFromVoices(t){if(void 0!==t.ParentSourceStaffEntry.Link)return t===t.ParentSourceStaffEntry.VoiceEntries[0]?void(t.WantedStemDirection=c.StemDirectionType.Up):void(t.WantedStemDirection=c.StemDirectionType.Down);t.ParentVoice instanceof y.LinkedVoice?t.WantedStemDirection=c.StemDirectionType.Down:t.ParentSourceStaffEntry.VoiceEntries.length>1&&(t.WantedStemDirection=c.StemDirectionType.Up)}setBeamNotesWantedStemDirections(t){if(!(t.Notes.length>0))return;const e=t.Notes[0].NoteBeam;if(e)for(const i of e.Notes)if(i.ParentVoiceEntry.WantedStemDirection!==c.StemDirectionType.Undefined&&i.ParentVoiceEntry.ParentSourceStaffEntry.ParentStaff.Id===t.ParentSourceStaffEntry.ParentStaff.Id){t.WantedStemDirection=i.ParentVoiceEntry.WantedStemDirection;break}}}e.MusicSheetCalculator=F},1494:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSheetDrawer=e.LabelRenderSpecs=void 0;const n=i(8911),s=i(8155),r=i(6729),o=i(3278),a=i(9086),l=i(9946),h=i(2255),u=i(556),c=i(1274),d=i(1703),p=i(158),f=i(5074);class m{}e.LabelRenderSpecs=m,e.MusicSheetDrawer=class{constructor(t,e){this.drawableBoundingBoxElement="None",this.skyLineVisible=!1,this.bottomLineVisible=!1,this.phonicScoreMode=f.PhonicScoreModes.Manual,this.textMeasurer=t,this.splitScreenLineColor=-1,this.drawingParameters=e,this.rules=e.Rules}set Mode(t){this.phonicScoreMode=t}drawSheet(t){if(this.graphicalMusicSheet=t,this.rules=t.ParentMusicSheet.Rules,this.drawSplitScreenLine(),this.drawingParameters.drawCursors)for(const e of t.Cursors){if(!e)continue;const t=new n.BoundingBox(e);t.AbsolutePosition=e.Start,t.BorderBottom=e.End.y-e.Start.y,t.BorderRight=e.Width/2,t.BorderLeft=-e.Width/2,this.isVisible(t)&&this.drawLineAsVerticalRectangle(e,s.GraphicalLayers.Cursor)}this.drawingParameters.drawScrollIndicator&&this.drawScrollIndicator();const e=Math.min(this.graphicalMusicSheet.MusicPages.length,this.rules.MaxPageToDrawNumber);for(let t=0;tt[0])).filter(Boolean))||[],i=[];let s=!1;for(let r=0;rt.x-e.x)))||void 0===p?void 0:p[0])||void 0===f?void 0:f.measure;break}}}catch(t){console.log("🚀 ~ error",t)}let s=0;s=n?(null===(m=n.stave)||void 0===m?void 0:m.end_x)||0:(null===(g=S.sourceNote.SourceMeasure.VerticalMeasureList[0])||void 0===g?void 0:g.getVFStave()).end_x;const u=0;_.ScreenPosition.x=s,_.ScreenPosition.y=0===e?10*(t.PositionAndShape.Parent.AbsolutePosition.y-3-u):10*e}const M=["C","G","D","A","E","B","F#","C#","G#","F","Bb","Eb","Ab","Db","Gb","Cb","Fb","D#","A#","E#"];M.includes(v.text)&&(_.ScreenPosition.y=10*(t.PositionAndShape.Parent.AbsolutePosition.y+t.PositionAndShape.Parent.BorderTop+t.PositionAndShape.Parent.BorderMarginTop)),["play","listen"].includes(v.text.toLocaleLowerCase())&&v.textAlignment===c.TextAlignmentEnum.LeftBottom&&(_.ScreenPosition.y=10*(t.PositionAndShape.Parent.AbsolutePosition.y-1+t.PositionAndShape.Parent.BorderBottom));const w=["ffp","p-f","sfzp","szf","sffzp"];for(let t=0;t0&&((0,u.isTopFont)(t.Label.textAlignment)||[c.TextAlignmentEnum.CenterBottom].includes(t.Label.textAlignment))){let e=-1,i=!1;for(const n of(null==E?void 0:E.AbstractExpressions)||[])if(n.Label===t?e=null===(b=null==n?void 0:n.parentMeasure)||void 0===b?void 0:b.measureListIndex:(null===(y=n.expression)||void 0===y?void 0:y.TempoInBpm)&&(i=n.expression.TempoInBpm>0),i&&e>-1){_.ScreenPosition.y-=40;break}}"jianpu"===this.rules.DYMusicScoreType?isNaN(parseInt(t.Label.text,10))&&this.renderLabel(t,e,_):this.renderLabel(t,e,_)}calculateLabel(t){const e=new m,i=t.Label,s=new n.BoundingBox(this);s.AbsolutePosition.x=t.PositionAndShape.AbsolutePosition.x,s.AbsolutePosition.y=t.PositionAndShape.AbsolutePosition.y||t.PositionAndShape.Parent.AbsolutePosition.y,e.ScreenPosition=this.applyScreenTransformation(s.AbsolutePosition),e.FontHeightInPixel=this.calculatePixelDistance(i.fontHeight);const r=this.calculatePixelDistance(t.PositionAndShape.Size.width);switch(e.BitmapWidth=Math.ceil(r),e.BitmapHeight=t.TextLines?Math.ceil(e.FontHeightInPixel*(.2+t.TextLines.length)):10,i.textAlignment){case c.TextAlignmentEnum.LeftTop:e.ScreenPosition.x-=e.BitmapWidth/2,e.ScreenPosition.y+=1.5*e.BitmapHeight;break;case c.TextAlignmentEnum.LeftCenter:e.ScreenPosition.y-=e.BitmapHeight/2;break;case c.TextAlignmentEnum.LeftBottom:e.ScreenPosition.y-=e.BitmapHeight;break;case c.TextAlignmentEnum.CenterTop:e.ScreenPosition.x-=e.BitmapWidth/2;break;case c.TextAlignmentEnum.CenterCenter:e.ScreenPosition.x-=e.BitmapWidth/2,e.ScreenPosition.y-=e.BitmapHeight/2;break;case c.TextAlignmentEnum.CenterBottom:e.ScreenPosition.x-=e.BitmapWidth/2,e.ScreenPosition.y-=e.BitmapHeight;break;case c.TextAlignmentEnum.RightTop:e.ScreenPosition.x-=e.BitmapWidth;break;case c.TextAlignmentEnum.RightCenter:e.ScreenPosition.x-=e.BitmapWidth,e.ScreenPosition.y-=e.BitmapHeight/2;break;case c.TextAlignmentEnum.RightBottom:e.ScreenPosition.x-=e.BitmapWidth,e.ScreenPosition.y-=e.BitmapHeight;break;default:throw new d.ArgumentOutOfRangeException("")}return e}applyScreenTransformations(t){const e=[];for(const i of t)e.push(this.applyScreenTransformation(i));return e}drawSplitScreenLine(){}renderRectangle(t,e,i,n=void 0,s=1){throw new Error("not implemented")}drawScrollIndicator(){}drawSelectionStartSymbol(t){}drawSelectionEndSymbol(t){}renderLabel(t,e,i){throw new Error("not implemented")}renderSystemToScreen(t,e,i){}drawSkyLine(t){}drawBottomLine(t){}drawInstrumentBrace(t,e){}drawGroupBracket(t,e){}isVisible(t){return!0}drawMusicSystem(t){const e=this.getSystemAbsBoundingRect(t),i=this.getSytemBoundingBoxInPixels(e);this.drawMusicSystemComponents(t,i,e)}getSytemBoundingBoxInPixels(t){const e=this.applyScreenTransformationForRect(t);return e.x=Math.round(e.x),e.y=Math.round(e.y),e}getSystemAbsBoundingRect(t){const e=t.PositionAndShape.BoundingRectangle;return new o.RectangleF2D(t.PositionAndShape.AbsolutePosition.x+t.PositionAndShape.BorderLeft-1,t.PositionAndShape.AbsolutePosition.y+t.PositionAndShape.BorderTop-1,e.width+6,e.height+2)}drawMusicSystemComponents(t,e,i){const n=this.graphicalMusicSheet.SelectionStartSymbol,r=this.graphicalMusicSheet.SelectionEndSymbol;this.drawingParameters.drawSelectionStartSymbol&&void 0!==n&&this.isVisible(n.PositionAndShape)&&this.drawSelectionStartSymbol(n),this.drawingParameters.drawSelectionEndSymbol&&void 0!==r&&this.isVisible(r.PositionAndShape)&&this.drawSelectionEndSymbol(r);for(const e of t.StaffLines)this.drawStaffLine(e),this.rules.RenderLyrics&&(e.LyricsDashes.length>0&&this.drawDashes(e.LyricsDashes),e.LyricLines.length>0&&this.drawLyricLines(e.LyricLines,e));for(const e of t.SystemLines)this.drawSystemLineObject(e);if(t.Parent===t.Parent.Parent.MusicPages[0])for(const e of t.Labels)e.SVGNode=this.drawLabel(e,s.GraphicalLayers.Notes);const o=this.graphicalMusicSheet.ParentMusicSheet.Instruments,a=o.filter((t=>t.Visible)).length;for(const e of t.InstrumentBrackets)this.drawInstrumentBrace(e,t);if(o.length>0)if(a>1)for(const e of t.GroupBrackets)this.drawGroupBracket(e,t);else for(const e of t.GroupBrackets)e.Visible=!1;if(!this.leadSheet)for(const e of t.MeasureNumberLabels)e.SVGNode=this.drawLabel(e,s.GraphicalLayers.Notes);for(const e of t.StaffLines)this.drawStaffLineSymbols(e);this.drawingParameters.drawMarkedAreas&&this.drawMarkedAreas(t)}activateSystemRendering(t,e,i,n){return!0}drawSystemLineObject(t){}drawStaffLine(t){for(const e of t.Measures)this.drawMeasure(e);this.rules.RenderLyrics&&t.LyricsDashes.length>0&&this.drawDashes(t.LyricsDashes),this.drawOctaveShifts(t),this.drawPedals(t),this.drawWavyLines(t),this.drawExpressions(t),this.skyLineVisible&&this.drawSkyLine(t),this.bottomLineVisible&&this.drawBottomLine(t)}drawLyricLines(t,e){e.LyricLines.forEach((t=>{t.Start.y+=e.PositionAndShape.AbsolutePosition.y,t.End.y+=e.PositionAndShape.AbsolutePosition.y,t.Start.x+=e.PositionAndShape.AbsolutePosition.x,t.End.x+=e.PositionAndShape.AbsolutePosition.x,this.drawGraphicalLine(t,this.rules.LyricUnderscoreLineWidth)}))}drawExpressions(t){}drawGraphicalLine(t,e,i="black"){return this.drawLine(t.Start,t.End,i,e)}drawLine(t,e,i="#FF0000FF",n){}drawDashes(t){t.forEach((t=>t.SVGNode=this.drawLabel(t,s.GraphicalLayers.Notes)))}drawOctaveShifts(t){}drawStaffLines(t){if(t.StaffLines){const e=t.PositionAndShape.AbsolutePosition;for(let i=0;i<5;i++)this.drawLineAsHorizontalRectangleWithOffset(t.StaffLines[i],e,s.GraphicalLayers.Notes)}}drawSymbol(t,e,i,n=1,r=s.GraphicalLayers.Notes){}get leadSheet(){return this.graphicalMusicSheet.LeadSheet}set leadSheet(t){this.graphicalMusicSheet.LeadSheet=t}drawPage(t){if(this.isVisible(t.PositionAndShape)){for(const e of t.MusicSystems)this.isVisible(e.PositionAndShape)&&this.drawMusicSystem(e);if(t===t.Parent.MusicPages[0])for(const e of t.Labels)e.SVGNode=this.drawLabel(e,s.GraphicalLayers.Notes);this.drawableBoundingBoxElement&&this.drawBoundingBoxes(t.PositionAndShape,0,this.drawableBoundingBoxElement)}}drawBoundingBoxes(t,e=0,i="all"){const n=t.DataObject.constructor.name;let s=!1;"all"===i&&(s=!0),(s||n===i)&&this.drawBoundingBox(t,void 0,!0,n,e),e++,t.ChildElements.forEach((t=>this.drawBoundingBoxes(t,e,i)))}drawBoundingBox(t,e=void 0,i=!1,n=void 0,u=0){let d=new o.RectangleF2D(t.AbsolutePosition.x+t.BorderMarginLeft,t.AbsolutePosition.y+t.BorderMarginTop,t.BorderMarginRight-t.BorderMarginLeft,t.BorderMarginBottom-t.BorderMarginTop);i&&(this.drawLineAsHorizontalRectangle(new r.GraphicalLine(new a.PointF2D(t.AbsolutePosition.x-1,t.AbsolutePosition.y),new a.PointF2D(t.AbsolutePosition.x+1,t.AbsolutePosition.y),.1,s.OutlineAndFillStyleEnum.BaseWritingColor,e),u-1),this.drawLineAsVerticalRectangle(new r.GraphicalLine(new a.PointF2D(t.AbsolutePosition.x,t.AbsolutePosition.y-1),new a.PointF2D(t.AbsolutePosition.x,t.AbsolutePosition.y+1),.1,s.OutlineAndFillStyleEnum.BaseWritingColor,e),u-1)),d=this.applyScreenTransformationForRect(d);const p=this.renderRectangle(d,s.GraphicalLayers.Background,u,e,.5);if(n){const t=new h.Label(n),e=new m;e.BitmapWidth=d.width,e.BitmapHeight=d.height,e.FontHeightInPixel=d.height,e.ScreenPosition=new a.PointF2D(d.x,d.y+12),this.renderLabel(new l.GraphicalLabel(t,.8,c.TextAlignmentEnum.CenterCenter,this.rules),u,e)}return p}drawMarkedAreas(t){for(const e of t.GraphicalMarkedAreas)e&&(e.systemRectangle&&this.drawRectangle(e.systemRectangle,s.GraphicalLayers.Background),e.settings&&(e.settings.SVGNode=this.drawLabel(e.settings,s.GraphicalLayers.Comment)),e.labelRectangle&&this.drawRectangle(e.labelRectangle,s.GraphicalLayers.Background),e.label&&(e.label.SVGNode=this.drawLabel(e.label,s.GraphicalLayers.Comment)))}drawStaffLineSymbols(t){const e=t.ParentStaff.ParentInstrument,i=t.PositionAndShape.AbsolutePosition.x,n=t.PositionAndShape.AbsolutePosition.y+2,o=t.PositionAndShape.BorderRight;e.highlight&&this.drawingParameters.drawHighlights&&this.drawLineAsHorizontalRectangle(new r.GraphicalLine(new a.PointF2D(i,n),new a.PointF2D(i+o,n),4,s.OutlineAndFillStyleEnum.Highlighted),s.GraphicalLayers.Highlight);let l=f.MusicSymbolDrawingStyle.Disabled,h=p.MusicSymbol.PLAY,u=this.drawingParameters.drawActivitySymbols;switch(this.phonicScoreMode){case f.PhonicScoreModes.Midi:h=p.MusicSymbol.PLAY,this.midiPlaybackAvailable&&t.ParentStaff.audible&&(l=f.MusicSymbolDrawingStyle.PlaybackSymbols);break;case f.PhonicScoreModes.Following:h=p.MusicSymbol.MIC,t.ParentStaff.following&&(l=f.MusicSymbolDrawingStyle.FollowSymbols);break;default:u=!1}if(u){const t=new a.PointF2D(i+o+2,n);this.drawSymbol(h,l,t)}if(this.drawingParameters.drawErrors)for(const e of t.Measures){const t=e.PositionAndShape,i=t.AbsolutePosition.x,n=t.AbsolutePosition.y+2;e.hasError&&this.graphicalMusicSheet.ParentMusicSheet.DrawErroneousMeasures&&this.drawLineAsHorizontalRectangle(new r.GraphicalLine(new a.PointF2D(i,n),new a.PointF2D(i+t.BorderRight,n),4,s.OutlineAndFillStyleEnum.ErrorUnderlay),s.GraphicalLayers.MeasureError)}}}},158:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSymbol=void 0,(i=e.MusicSymbol||(e.MusicSymbol={}))[i.Unused_first_Symbol=0]="Unused_first_Symbol",i[i.BLACK_HEAD=1]="BLACK_HEAD",i[i.UPWARDS_TAIL=2]="UPWARDS_TAIL",i[i.DOWNWARDS_TAIL=3]="DOWNWARDS_TAIL",i[i.UPWARDS_DOUBLE_TAIL=4]="UPWARDS_DOUBLE_TAIL",i[i.DOWNWARDS_DOUBLE_TAIL=5]="DOWNWARDS_DOUBLE_TAIL",i[i.UPWARDS_TRIPLE_TAIL=6]="UPWARDS_TRIPLE_TAIL",i[i.DOWNWARDS_TRIPLE_TAIL=7]="DOWNWARDS_TRIPLE_TAIL",i[i.UPWARDS_QUAD_TAIL=8]="UPWARDS_QUAD_TAIL",i[i.DOWNWARDS_QUAD_TAIL=9]="DOWNWARDS_QUAD_TAIL",i[i.ROUND_HEAD=10]="ROUND_HEAD",i[i.WHITE_HEAD=11]="WHITE_HEAD",i[i.G_CLEF=12]="G_CLEF",i[i.F_CLEF=13]="F_CLEF",i[i.C_CLEF=14]="C_CLEF",i[i.BREVE=15]="BREVE",i[i.BREVE_REST=16]="BREVE_REST",i[i.COMMON_TIME=17]="COMMON_TIME",i[i.CUT_TIME=18]="CUT_TIME",i[i.WHOLE_REST=19]="WHOLE_REST",i[i.HALF_REST=20]="HALF_REST",i[i.QUARTER_REST=21]="QUARTER_REST",i[i.EIGHTH_REST=22]="EIGHTH_REST",i[i.SIXTEENTH_REST=23]="SIXTEENTH_REST",i[i.THIRTYSECOND_REST=24]="THIRTYSECOND_REST",i[i.SIXTYFOURTH_REST=25]="SIXTYFOURTH_REST",i[i.FLAT=26]="FLAT",i[i.SHARP=27]="SHARP",i[i.NATURAL=28]="NATURAL",i[i.DOUBLE_FLAT=29]="DOUBLE_FLAT",i[i.DOUBLE_SHARP=30]="DOUBLE_SHARP",i[i.ZERO=31]="ZERO",i[i.ONE=32]="ONE",i[i.TWO=33]="TWO",i[i.THREE=34]="THREE",i[i.FOUR=35]="FOUR",i[i.FIVE=36]="FIVE",i[i.SIX=37]="SIX",i[i.SEVEN=38]="SEVEN",i[i.EIGHT=39]="EIGHT",i[i.NINE=40]="NINE",i[i.DOT=41]="DOT",i[i.FERMATA=42]="FERMATA",i[i.INVERTED_FERMATA=43]="INVERTED_FERMATA",i[i.SPICCATO=44]="SPICCATO",i[i.TENUTO=45]="TENUTO",i[i.MARCATO=46]="MARCATO",i[i.MARCATISSIMO=47]="MARCATISSIMO",i[i.INVERTED_MARCATISSIMO=48]="INVERTED_MARCATISSIMO",i[i.P=49]="P",i[i.F=50]="F",i[i.S=51]="S",i[i.Z=52]="Z",i[i.M=53]="M",i[i.R=54]="R",i[i.SEGNO=55]="SEGNO",i[i.CODA=56]="CODA",i[i.DRUM_CLEF=57]="DRUM_CLEF",i[i.G_CLEF_SUB8=58]="G_CLEF_SUB8",i[i.G_CLEF_SUPER8=59]="G_CLEF_SUPER8",i[i.G_CLEF_SUB15=60]="G_CLEF_SUB15",i[i.G_CLEF_SUPER15=61]="G_CLEF_SUPER15",i[i.F_CLEF_SUB8=62]="F_CLEF_SUB8",i[i.F_CLEF_SUPER8=63]="F_CLEF_SUPER8",i[i.F_CLEF_SUB15=64]="F_CLEF_SUB15",i[i.F_CLEF_SUPER15=65]="F_CLEF_SUPER15",i[i.DOWN_BOW=66]="DOWN_BOW",i[i.MORDENT=67]="MORDENT",i[i.INVERTED_MORDENT=68]="INVERTED_MORDENT",i[i.TURN=69]="TURN",i[i.INVERTED_TURN=70]="INVERTED_TURN",i[i.LEFTHAND_PIZZICATO=71]="LEFTHAND_PIZZICATO",i[i.RELEASE_PED=72]="RELEASE_PED",i[i.ENGAGE_PED=73]="ENGAGE_PED",i[i.VA8=74]="VA8",i[i.VB8=75]="VB8",i[i.TRILL=76]="TRILL",i[i.MA15=77]="MA15",i[i.MB15=78]="MB15",i[i.HIGH=79]="HIGH",i[i.PLAY=80]="PLAY",i[i.MIC=81]="MIC",i[i.SNAP_PIZZICATO=82]="SNAP_PIZZICATO",i[i.NATURAL_HARMONIC=83]="NATURAL_HARMONIC",i[i.EditPen=84]="EditPen",i[i.PEDAL_BRACKET=85]="PEDAL_BRACKET",i[i.PEDAL_MIXED=86]="PEDAL_MIXED",i[i.PEDAL_SYMBOL=87]="PEDAL_SYMBOL"},7142:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSystem=void 0;const s=i(6842),r=i(8911),o=i(1797),a=i(1274),l=i(9946),h=i(4785),u=i(9086),c=i(6894),d=n(i(8805)),p=i(1225),f=i(2255);class m extends h.GraphicalObject{constructor(t){super(),this.needsToBeRedrawn=!0,this.staffLines=[],this.graphicalMeasures=[],this.labels=new d.default,this.measureNumberLabels=[],this.objectsToRedraw=[],this.instrumentBrackets=[],this.groupBrackets=[],this.graphicalMarkedAreas=[],this.systemLines=[],this.breaksPage=!1,this.id=t,this.boundingBox=new r.BoundingBox(this),this.maxLabelLength=0}get Parent(){return this.parent}set Parent(t){if(this.parent){const t=this.parent.MusicSystems.indexOf(this,0);t>-1&&this.parent.MusicSystems.splice(t,1)}this.parent=t,this.boundingBox.Parent=t.PositionAndShape}get NextSystem(){const t=this.Parent.MusicSystems.indexOf(this);return t!==this.Parent.MusicSystems.length?this.Parent.MusicSystems[t+1]:void 0}get StaffLines(){return this.staffLines}get GraphicalMeasures(){return this.graphicalMeasures}get MeasureNumberLabels(){return this.measureNumberLabels}get Labels(){return this.labels.values()}get ObjectsToRedraw(){return this.objectsToRedraw}get InstrumentBrackets(){return this.instrumentBrackets}get GroupBrackets(){return this.groupBrackets}get GraphicalMarkedAreas(){return this.graphicalMarkedAreas}get SystemLines(){return this.systemLines}get Id(){return this.id}createSystemLeftLine(t,e,i){let n=-t/2;i&&(n=this.maxLabelLength+e-t/2);const s=this.staffLines[0].Measures[0];let r;this.staffLines.length>1&&(r=this.staffLines[this.staffLines.length-1].Measures[0]);const o=this.createSystemLine(n,t,c.SystemLinesEnum.SingleThin,p.SystemLinePosition.MeasureBegin,this,s,r);this.SystemLines.push(o),o.PositionAndShape.RelativePosition=new u.PointF2D(n,0),o.PositionAndShape.BorderLeft=0,o.PositionAndShape.BorderRight=t,o.PositionAndShape.BorderTop=0,o.PositionAndShape.BorderBottom=this.boundingBox.Size.height,this.createLinesForSystemLine(o)}createVerticalLineForMeasure(t,e,i,n,s,r){const o=r.ParentStaffLine,a=new u.PointF2D(o.PositionAndShape.RelativePosition.x,o.PositionAndShape.RelativePosition.y),l=o.ParentStaff.ParentInstrument.Staves;if(o.ParentStaff===l[0]){let h;l.length>1&&(h=this.getBottomStaffLine(o).Measures[s]);const c=this.createSystemLine(t,e,i,n,this,r,h),d=a.x+t;c.PositionAndShape.RelativePosition=new u.PointF2D(d,0),c.PositionAndShape.BorderLeft=0,c.PositionAndShape.BorderRight=e,this.SystemLines.push(c)}}setYPositionsToVerticalLineObjectsAndCreateLines(t){}calculateBorders(t){}alignBeginInstructions(){}GetLeftBorderAbsoluteXPosition(){return this.StaffLines[0].PositionAndShape.AbsolutePosition.x+this.StaffLines[0].Measures[0].beginInstructionsWidth}GetRightBorderAbsoluteXPosition(){return this.StaffLines[0].PositionAndShape.AbsolutePosition.x+this.StaffLines[0].StaffLines[0].End.x}AddGraphicalMeasures(t){for(let e=0,i=t.length;e1){let t,e;for(let n=0,s=this.staffLines.length;nthis.maxLabelLength&&(this.maxLabelLength=i.PositionAndShape.Size.width,e=r)}this.updateMusicSystemStaffLineXPosition(e)}setMusicSystemLabelsYPosition(){this.labels.forEach(((t,e)=>{let i=0,n=0;for(let e=0;e0&&(e.PositionAndShape.RelativePosition=new u.PointF2D(0,i/n+2))}))}checkStaffEntriesForStaffEntryLink(){let t=!1,e=!1;for(let i=0;i=0;i--){if(e=t.InstrumentalGroups[i],!(e instanceof s.Instrument))return this.findLastVisibleInstrumentInInstrumentalGroup(e);if(!0===e.Visible)return e}}updateMusicSystemStaffLineXPosition(t){for(let e=0,i=this.StaffLines.length;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MeasureBuildParameters=e.SystemBuildParameters=e.MusicSystemBuilder=void 0;const n=i(599),s=i(3331),r=i(5198),o=i(289),a=i(9086),l=i(6729),h=i(6894),u=i(4040),c=i(289),d=i(2337),p=i(1225),f=i(2343);e.MusicSystemBuilder=class{constructor(){this.musicSystems=[],this.globalSystemIndex=0,this.leadSheet=!1}initialize(t,e,i){this.leadSheet=t.LeadSheet,this.graphicalMusicSheet=t,this.rules=this.graphicalMusicSheet.ParentMusicSheet.Rules,this.measureList=e,this.numberOfVisibleStaffLines=i,this.activeRhythm=new Array(this.numberOfVisibleStaffLines),this.activeKeys=new Array(this.numberOfVisibleStaffLines),this.activeClefs=new Array(this.numberOfVisibleStaffLines),this.initializeActiveInstructions(this.measureList[0])}buildMusicSystems(){var t,e,i;const n=this.getFullPageSystemWidth();let s=!1;this.measureListIndex=0,this.currentSystemParams=new m,this.currentSystemParams.currentSystem=this.initMusicSystem();let r=0,o=0;for(;this.measureListIndex0){if(this.rules.MaxSystemToDrawNumber===this.musicSystems.length)return this.finalizeCurrentSystem(this.measureList[this.measureList.length-1],!this.rules.StretchLastSystemLine,!1),this.musicSystems;this.finalizeCurrentAndCreateNewSystem(this.measureList[this.measureList.length-1],!this.rules.StretchLastSystemLine,!1)}return this.musicSystems}calculateSystemYLayout(){for(const t of this.musicSystems)this.optimizeDistanceBetweenStaffLines(t);this.calculateMusicSystemsRelativePositions()}setMeasureWidth(t,e,i,n){for(let s=0,r=t.length;s0&&(r.beginInstructionsWidth=i),n>0&&(r.endInstructionsWidth=n)}}finalizeCurrentAndCreateNewSystem(t,e=!1,i=!0,n=!1){this.finalizeCurrentSystem(t,e,i,n),this.currentSystemParams=new m,void 0!==t&&this.measureListIndex=1){const e=this.currentSystemParams.currentSystem.GraphicalMeasures[this.currentSystemParams.currentSystem.GraphicalMeasures.length-1];let i=0;const n=t[t.length-1];n.endLine===h.SystemLinesEnum.DotsBoldBoldDots&&(n.endLine=h.SystemLinesEnum.DotsThinBold,i=e[0].getLineWidth(h.SystemLinesEnum.DotsBoldBoldDots)/2-e[0].getLineWidth(h.SystemLinesEnum.DotsThinBold)),this.currentSystemParams.currentSystemFixWidth-=i;for(let t=0,n=e.length;t1){r=!0;break}let o=0;for(let e=0;e=0&&this.measureList[i]){const e=null===(p=this.measureList[i][0])||void 0===p?void 0:p.parentSourceMeasure;(null==e?void 0:e.ImplicitMeasure)&&(null==e?void 0:e.RhythmPrinted)&&(t=!1)}t&&(e.addRhythmAtBegin(g),e.parentSourceMeasure.RhythmPrinted=g,_=!0)}return(S||v||_)&&(b+=e.beginInstructionsWidth,_&&(b+=this.rules.RhythmRightMargin)),b}addInstructionsAtMeasureEnd(t,e,i){if(!t||!t.Instructions||0===t.Instructions.length)return 0;for(let n=0,s=t.Instructions.length;n0&&(this.currentSystemParams.systemMeasures.push({beginLine:h.SystemLinesEnum.None,endLine:h.SystemLinesEnum.None}),this.currentSystemParams.currentWidth+=n,this.currentSystemParams.currentSystemFixWidth+=n)}addExtraInstructionMeasure(t,e,i){const n=this.currentSystemParams.currentSystem,s=u.MusicSheetCalculator.symbolFactory.createExtraGraphicalMeasure(n.StaffLines[t]);[].push(s),e&&s.addKeyAtBegin(e,this.activeKeys[t],this.activeClefs[t]),void 0!==i&&i.PrintObject&&s.addRhythmAtBegin(i),s.PositionAndShape.BorderLeft=0,s.PositionAndShape.BorderTop=0,s.PositionAndShape.BorderBottom=this.rules.StaffHeight;const r=this.rules.MeasureLeftMargin+s.beginInstructionsWidth+this.rules.MeasureRightMargin;return s.PositionAndShape.BorderRight=r,n.StaffLines[t].Measures.push(s),r}addStaveMeasuresToSystem(t){if(t[0]){const e=[];for(let i=0;i1){const t=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,i.measureListIndex+i.multipleRestMeasures-1);i=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[t]}}finally{}const n=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures,s=n[this.measureListIndex];let r=!1;return s.allRests&&(r=null===(e=null===(t=n[this.measureListIndex+s.multipleRestMeasures-1])||void 0===t?void 0:t.endsWithLineRepetition)||void 0===e?void 0:e.call(t)),this.nextMeasureBeginsLineRepetition()&&this.thisMeasureEndsLineRepetition()?h.SystemLinesEnum.DotsBoldBoldDots:this.thisMeasureEndsLineRepetition()||r?h.SystemLinesEnum.DotsThinBold:this.nextMeasureHasKeyInstructionChange()||this.thisMeasureEndsWordRepetition()||this.nextMeasureBeginsWordRepetition()?h.SystemLinesEnum.DoubleThin:i&&void 0!==i.endingBarStyleEnum?i.endingBarStyleEnum:h.SystemLinesEnum.SingleThin}getLineWidth(t,e,i){let n=t.getLineWidth(e);return e===h.SystemLinesEnum.DotsBoldBoldDots&&(n/=2),i&&e===h.SystemLinesEnum.BoldThinDots&&(n+=this.rules.DistanceBetweenLastInstructionAndRepetitionBarline),n}previousMeasureEndsLineRepetition(){if(0===this.measureListIndex)return!1;for(let t=0,e=this.measureList[this.measureListIndex-1].length;t=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length||!this.measureList[t])return!1;for(let e=0,i=this.measureList[t].length;e=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length||t>this.measureList.length-1)return!1;for(let e=0,i=this.measureList[t].length;e1)for(let t=1;tr&&(r=n)}for(let o=0;othis.rules.PageHeight-this.rules.PageBottomMargin&&(s++,s<=4&&console.log(`warning: could not fit a single system on page ${e.PageNumber} and measure number ${n.GraphicalMeasures[0][0].MeasureNumber}.\n The PageFormat may be too small for this sheet."\n Will not give further warnings for all pages, only total.`))}else{const s=this.musicSystems[o-1],l=s.StaffLines[s.StaffLines.length-1],h=l.PositionAndShape;let u=this.findRequiredDistanceWithSkyBottomLine(s,n);u=Math.max(r,u),u+=this.rules.MinSkyBottomDistBetweenSystems,"GYM"===(null===(t=null===window||void 0===window?void 0:window.appName)||void 0===t?void 0:t.toLocaleUpperCase())&&(u=u<16?16:u);const c=this.hasExpressionCounts(n);c.TempoCount>0&&this.rules.MetronomeMarksDrawn&&(u+=2),c.OtherCount>0&&this.rules.MetronomeMarksDrawn&&(u+=2),u=Math.max(u,this.rules.MinimumDistanceBetweenSystems+l.StaffHeight);const d=i+h.RelativePosition.y+u,p=d+n.PositionAndShape.BorderMarginBottom;if(this.rules.NewPageAtXMLNewPageAttribute&&s.breaksPage||!(p0&&console.log(`total amount of pages that couldn't fit a single music system: ${s} of ${e.PageNumber}`)}findRequiredDistanceWithSkyBottomLine(t,e){const i=t.StaffLines[t.StaffLines.length-1],n=e.StaffLines[0],s=i.BottomLine,r=n.SkyLine,o=i.PositionAndShape,a=n.PositionAndShape,l=1/this.rules.SamplingUnit;let h=0;for(let t=0;t=r.length)break;const n=Math.max(0,i-6),u=Math.min(r.length-1,i+6);let c=0;for(let t=n;t<=u;t++)c=Math.min(c,r[t]);const d=e-c;h=Math.max(d,h)}return 0===h&&(h=o.BorderBottom-a.BorderTop),h}};class m{constructor(){this.systemMeasures=[],this.systemMeasureIndex=0,this.currentWidth=0,this.currentSystemFixWidth=0,this.currentSystemVarWidth=0,this.maxLabelLength=0}IsSystemStartMeasure(){return 0===this.systemMeasureIndex}}e.SystemBuildParameters=m,e.MeasureBuildParameters=class{}},4574:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OctaveShiftParams=void 0,e.OctaveShiftParams=class{constructor(t,e,i){this.getOpenOctaveShift=t,this.getAbsoluteStartTimestamp=e,this.getAbsoluteEndTimestamp=i}}},9067:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionEndSymbol=void 0;const n=i(4785),s=i(8155),r=i(9086),o=i(8911),a=i(6729),l=i(2337);class h extends n.GraphicalObject{constructor(t,e){super();const i=e,n=t.PositionAndShape.AbsolutePosition.y,h=l.CollectionUtil.last(t.StaffLines).PositionAndShape.RelativePosition.y+4;this.verticalLine=new a.GraphicalLine(new r.PointF2D(i,n),new r.PointF2D(i,n+h),.4,s.OutlineAndFillStyleEnum.SelectionSymbol);for(let e=0,s=t.StaffLines.length;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionStartSymbol=void 0;const n=i(9086),s=i(8155),r=i(6729),o=i(4785),a=i(8911),l=i(2337);class h extends o.GraphicalObject{constructor(t,e){super();const i=e,o=t.PositionAndShape.AbsolutePosition.y,h=l.CollectionUtil.last(t.StaffLines).PositionAndShape.RelativePosition.y+4;this.verticalLine=new r.GraphicalLine(new n.PointF2D(i,o),new n.PointF2D(i,o+h),.4,s.OutlineAndFillStyleEnum.SelectionSymbol);for(let e=0,s=t.StaffLines.length;e0||t.IsExtraGraphicalMeasure||(o.default.warn("SkyBottomLineCalculator: width not > 0 in measure "+t.MeasureNumber),n=50),!(n>=50)&&t.IsExtraGraphicalMeasure)continue;e.initializeHeadless(n);const s=e.getContext(),r=e.getCanvas();n=r.width;const a=r.height;"jianpu"===this.mRules.DYMusicScoreType?i.setY(i.y-50):i.setY(i.y+100);const l=i.getWidth();i.setWidth(n),t.format(),i.setWidth(l);try{t.draw(s)}catch(t){o.default.warn("SkyBottomLineCalculator.calculateLines.draw",t)}const h=s.getImageData(0,0,n,a),u=4,c=Math.max(Math.ceil(t.PositionAndShape.Size.width*this.mRules.SamplingUnit),1),d=new Array(c),p=new Array(c);for(let t=0;t0){d[t]=e;break}}for(let e=a;e>0;e--){const i=e*n*u+t*u;if(h.data[i+3]>0){p[t]=e;break}}}for(let t=0;t(t-Math.max(...this.mSkyLine))/r.unitInPixels+this.StaffLineParent.TopLineOffset)),this.mBottomLine=this.mBottomLine.map((t=>(t-Math.min(...this.mBottomLine))/r.unitInPixels+this.StaffLineParent.BottomLineOffset))}findPreviousValidNumber(t,e){for(let i=t;i>=0;i--)if(!isNaN(e[i]))return e[i];return 0}findNextValidNumber(t,e){if(t>=e.length)return e[t-1];for(let i=t;i=this.BottomLine.length&&(i=this.BottomLine.length-1),n<0&&(n=0),n>=this.BottomLine.length&&(n=this.BottomLine.length),this.SkyLine[i]=t.y;for(let t=i+1;t=this.BottomLine.length&&(i=this.BottomLine.length-1),n<0&&(n=0),n>=this.BottomLine.length&&(n=this.BottomLine.length),this.BottomLine[i]=t.y;for(let t=i+1;tt))}setBottomLineWithValue(t){this.BottomLine.forEach((e=>t))}getLeftIndexForPointX(t,e){const i=Math.floor(t*this.SamplingUnit);return i<0?0:i>=e?e-1:i}getRightIndexForPointX(t,e){const i=Math.ceil(t*this.SamplingUnit);return i<0?0:i>=e?e-1:i}updateStaffLineBorders(){this.mStaffLineParent.PositionAndShape.BorderTop=this.getSkyLineMin(),this.mStaffLineParent.PositionAndShape.BorderMarginTop=this.getSkyLineMin(),this.mStaffLineParent.PositionAndShape.BorderBottom=this.getBottomLineMax(),this.mStaffLineParent.PositionAndShape.BorderMarginBottom=this.getBottomLineMax()}getSkyLineMin(){return Math.min(...this.SkyLine.filter((t=>!isNaN(t))))}getSkyLineMinAtPoint(t){const e=Math.round(t*this.SamplingUnit);return this.mSkyLine[e]}getSkyLineMinInRange(t,e){return this.getMinInRange(this.SkyLine,t,e)}getBottomLineMax(){return Math.max(...this.BottomLine.filter((t=>!isNaN(t))))}getBottomLineMaxAtPoint(t){const e=Math.round(t*this.SamplingUnit);return this.mBottomLine[e]}getBottomLineMaxInRange(t,e){return this.getMaxInRange(this.BottomLine,t,e)}getBottomLineMaxInBoundingBox(t){const e=Math.floor(t.AbsolutePosition.x+t.BorderLeft),i=Math.ceil(t.AbsolutePosition.x+t.BorderRight);return this.getMaxInRange(this.mBottomLine,e,i)}updateWithBoundingBoxRecursively(t){if(t.ChildElements&&t.ChildElements.length>0)for(const e of t.ChildElements)this.updateWithBoundingBoxRecursively(e);else{const e=t.BorderTop+t.AbsolutePosition.y,i=t.BorderBottom+t.AbsolutePosition.y;if(e<0){const i=Math.floor(t.AbsolutePosition.x+t.BorderLeft),n=Math.ceil(t.AbsolutePosition.x+t.BorderRight);this.updateInRange(this.mSkyLine,i,n,e)}else if(i>this.StaffLineParent.StaffHeight){const e=Math.floor(t.AbsolutePosition.x+t.BorderLeft),n=Math.ceil(t.AbsolutePosition.x+t.BorderRight);this.updateInRange(this.mBottomLine,e,n,i)}}}updateInRange(t,e=0,i=t.length,n=0){if(e=Math.floor(e*this.SamplingUnit),(i=Math.ceil(i*this.SamplingUnit))t.length&&(i=t.length);for(let s=e;sMath.abs(t[s])?n:t[s]}setInRange(t,e=0,i=t.length,n=0){if(e=Math.floor(e*this.SamplingUnit),(i=Math.ceil(i*this.SamplingUnit))t.length&&(i=t.length);for(let s=e;s=t.length&&(e=t.length-1),i<0&&(i=0),i>=t.length&&(i=t.length),e>=0&&i<=t.length?Math.min(...t.slice(e,i+1)):void 0):Number.MAX_VALUE}getMaxInRange(t,e,i){return e=Math.floor(e*this.SamplingUnit),i=Math.ceil(i*this.SamplingUnit),t?(e<0&&(e=0),e>=t.length&&(e=t.length-1),i<0&&(i=0),i>=t.length&&(i=t.length),e>=0&&i<=t.length?Math.max(...t.slice(e,i+1)):void 0):Number.MIN_VALUE}get SamplingUnit(){return this.mRules.SamplingUnit}get StaffLineParent(){return this.mStaffLineParent}get SkyLine(){return this.mSkyLine}get BottomLine(){return this.mBottomLine}}},8965:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SkyBottomLineCalculatorSVG=void 0;const s=i(6040),r=n(i(8011)),o=i(5820),a=i(9505);class l extends s.SkyBottomLineCalculator{recursiveUpdate(t,e,i,n){const s=t.getBBox(),a=s.y/o.unitInPixels,l=s.height/o.unitInPixels+a,[h,u]=n;if(ae.bottom)switch(t.tagName.toLowerCase()){case"g":for(const s of t.children)this.recursiveUpdate(s,e,i,n);break;case"circle":case"rect":case"line":case"path":let c=Math.floor((s.x-i.x)/o.unitInPixels*this.mRules.SamplingUnit);const d=c+Math.ceil(s.width/o.unitInPixels*this.mRules.SamplingUnit);if(t.parentElement.classList.contains("vf-beams")&&t.hasAttribute("d")){const e=(0,r.default)(t.getAttribute("d"));if(5===e.length){const t=e[0],i=e[3],n=(i.end.y-t.end.y)/(i.end.x-t.end.x);let s=t.end.y/o.unitInPixels;for(;c<=d;c++)su[c]&&(u[c]=s),s+=n/this.mRules.SamplingUnit}}else for(;c<=d;c++)au[c]&&(u[c]=l)}}calculateLinesForMeasure(t,e){var i,n,s;const r=e.getBBox(),a=Math.max(Math.round(t.PositionAndShape.Size.width*this.mRules.SamplingUnit),1),l=r.height/o.unitInPixels,h=e.getElementsByClassName("vf-stave")[0].getBBox();let u=(null==h?void 0:h.height)/o.unitInPixels,c=(null==h?void 0:h.y)/o.unitInPixels;const d=t.getVFStave();let p=((null===(i=d.options)||void 0===i?void 0:i.num_lines)?d.options.num_lines:5)-1,f=-1,m=0;const g=[p];for(const t of null===(n=d.options)||void 0===n?void 0:n.line_config)t.visible?(-1===f&&(f=m),g.push(m)):p--,m++;-1===f&&(f=0),p=g.pop()-f;const b=null===(s=d.options)||void 0===s?void 0:s.spacing_between_lines_px,y=p*b/o.unitInPixels;u-y>.2&&(u=y,c=f*b/o.unitInPixels);const S=c+u,v=new Array(a).fill(c),_=new Array(a).fill(S),x=[v,_];if(l>u)for(const t of e.children)this.recursiveUpdate(t,{top:c,bottom:S},r,[v,_]);return x}calculateLines(){this.mSkyLine=[],this.mBottomLine=[];const t=document.createElement("div");document.body.append(t);const e=new a.SvgVexFlowBackend(this.mRules);e.initialize(t,1,"0");const i=e.getContext(),n=i.openGroup();n.classList.add("staffline");for(const t of this.StaffLineParent.Measures){t.PositionAndShape.calculateAbsolutePositionsRecursive(0,0),t.setAbsoluteCoordinates(t.PositionAndShape.AbsolutePosition.x*o.unitInPixels,t.PositionAndShape.AbsolutePosition.y*o.unitInPixels);const e=t.draw(i),[n,s]=this.calculateLinesForMeasure(t,e);this.mSkyLine.push(...n),this.mBottomLine.push(...s)}i.closeGroup();for(const t of n.getElementsByClassName("vf-ties"))for(const e of t.childNodes)if("path"===e.nodeName.toLowerCase()){const t=e.getBBox();let i=Math.floor(t.x/o.unitInPixels*this.mRules.SamplingUnit);const n=i+Math.ceil(t.width/o.unitInPixels*this.mRules.SamplingUnit),s=t.y/o.unitInPixels,r=t.height/o.unitInPixels+s;for(;i<=n;i++)sthis.mBottomLine[i]&&(this.mBottomLine[i]=r)}e.clear(),t.remove()}}e.SkyBottomLineCalculatorSVG=l},9953:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StaffLine=void 0;const n=i(8911),s=i(4785),r=i(4196),o=i(9086),a=i(4040);class l extends s.GraphicalObject{constructor(t,e){super(),this.measures=[],this.staffLines=new Array(5),this.octaveShifts=[],this.lyricLines=[],this.lyricsDashes=[],this.abstractExpressions=[],this.graphicalSlurs=[],this.Pedals=[],this.WavyLines=[],this.parentMusicSystem=t,this.parentStaff=e,this.boundingBox=new n.BoundingBox(this,t.PositionAndShape),this.skyBottomLine=a.MusicSheetCalculator.symbolFactory.createSkyBottomLineCalculator(this),this.staffHeight=this.parentMusicSystem.rules.StaffHeight,this.topLineOffset=0,this.bottomLineOffset=4,this.calculateStaffLineOffsets()}calculateStaffLineOffsets(){if(this.ParentStaff.isTab)5===this.ParentStaff.StafflineCount?this.staffHeight=this.bottomLineOffset=6*this.ParentStaff.ParentInstrument.GetMusicSheet.Rules.TabStaffInterlineHeight:this.staffHeight=this.bottomLineOffset=this.ParentStaff.ParentInstrument.GetMusicSheet.Rules.TabStaffInterlineHeight*this.ParentStaff.StafflineCount;else switch(this.ParentStaff.StafflineCount){case 4:this.bottomLineOffset=1;break;case 3:this.topLineOffset=1,this.bottomLineOffset=1;break;case 2:this.topLineOffset=2,this.bottomLineOffset=1;break;case 1:this.topLineOffset=2,this.bottomLineOffset=2}}get Measures(){return this.measures}set Measures(t){this.measures=t}get StaffLines(){return this.staffLines}set StaffLines(t){this.staffLines=t}get Index(){return this.parentMusicSystem.StaffLines.indexOf(this)}get NextStaffLine(){const t=this.Index;return t!==this.parentMusicSystem.StaffLines.length?this.parentMusicSystem.StaffLines[t+1]:void 0}get LyricLines(){return this.lyricLines}get AbstractExpressions(){return this.abstractExpressions}set AbstractExpressions(t){this.abstractExpressions=t}set LyricLines(t){this.lyricLines=t}get LyricsDashes(){return this.lyricsDashes}set LyricsDashes(t){this.lyricsDashes=t}get ParentMusicSystem(){return this.parentMusicSystem}set ParentMusicSystem(t){this.parentMusicSystem=t}get ParentStaff(){return this.parentStaff}set ParentStaff(t){this.parentStaff=t}get SkyBottomLineCalculator(){return this.skyBottomLine}get SkyLine(){return this.skyBottomLine.SkyLine}get BottomLine(){return this.skyBottomLine.BottomLine}get OctaveShifts(){return this.octaveShifts}set OctaveShifts(t){this.octaveShifts=t}get StaffHeight(){return this.staffHeight}get TopLineOffset(){return this.topLineOffset}get BottomLineOffset(){return this.bottomLineOffset}get GraphicalSlurs(){return this.graphicalSlurs}addSlurToStaffline(t){this.graphicalSlurs.push(t)}addActivitySymbolClickArea(){const t=new r.StaffLineActivitySymbol(this),e=this.PositionAndShape;t.PositionAndShape.RelativePosition=new o.PointF2D(e.RelativePosition.x+e.BorderRight+.5,e.RelativePosition.y+.5),t.PositionAndShape.Parent=this.parentMusicSystem.PositionAndShape}isPartOfMultiStaffInstrument(){return this.parentStaff.ParentInstrument.Staves.length>1}findClosestStaffEntry(t){let e;for(let i=0,n=this.Measures.length;i{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StaffLineActivitySymbol=void 0;const n=i(4785),s=i(8911);class r extends n.GraphicalObject{constructor(t){super(),this.parentStaffLine=t;const e=t.PositionAndShape;this.boundingBox=new s.BoundingBox(this,e),this.boundingBox.BorderRight=6,this.boundingBox.BorderBottom=4.5,this.boundingBox.BorderLeft=-1.5,this.boundingBox.BorderTop=-1.5}}e.StaffLineActivitySymbol=r},7771:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SystemLine=void 0;const n=i(6894),s=i(8911),r=i(4785);class o extends r.GraphicalObject{constructor(t,e,i,n,r=void 0){super(),this.lineType=t,this.linePosition=e,this.parentMusicSystem=i,this.topMeasure=n,this.bottomMeasure=r,this.parentTopStaffLine=null==n?void 0:n.ParentStaffLine,this.boundingBox=new s.BoundingBox(this,i.PositionAndShape)}static getObjectWidthForLineType(t,e){switch(e){case n.SystemLinesEnum.SingleThin:return t.SystemThinLineWidth;case n.SystemLinesEnum.DoubleThin:return 2*t.SystemThinLineWidth+t.DistanceBetweenVerticalSystemLines;case n.SystemLinesEnum.ThinBold:return t.SystemThinLineWidth+t.SystemBoldLineWidth+t.DistanceBetweenVerticalSystemLines;case n.SystemLinesEnum.BoldThinDots:case n.SystemLinesEnum.DotsThinBold:return t.SystemThinLineWidth+t.SystemBoldLineWidth+t.DistanceBetweenVerticalSystemLines+t.SystemDotWidth+t.DistanceBetweenDotAndLine;case n.SystemLinesEnum.DotsBoldBoldDots:return 2*t.SystemBoldLineWidth+2*t.SystemDotWidth+2*t.DistanceBetweenDotAndLine+t.DistanceBetweenVerticalSystemLines;default:return 0}}}e.SystemLine=o},1225:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.SystemLinePosition=void 0,(i=e.SystemLinePosition||(e.SystemLinePosition={}))[i.MeasureBegin=0]="MeasureBegin",i[i.MeasureEnd=1]="MeasureEnd"},6894:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.SystemLinesEnumHelper=e.SystemLinesEnum=void 0,function(t){t[t.SingleThin=0]="SingleThin",t[t.DoubleThin=1]="DoubleThin",t[t.ThinBold=2]="ThinBold",t[t.BoldThinDots=3]="BoldThinDots",t[t.DotsThinBold=4]="DotsThinBold",t[t.DotsBoldBoldDots=5]="DotsBoldBoldDots",t[t.None=6]="None",t[t.Dotted=7]="Dotted",t[t.Dashed=8]="Dashed",t[t.Bold=9]="Bold",t[t.BoldThin=10]="BoldThin",t[t.DoubleBold=11]="DoubleBold",t[t.Tick=12]="Tick",t[t.Short=13]="Short"}(i=e.SystemLinesEnum||(e.SystemLinesEnum={})),e.SystemLinesEnumHelper=class{static xmlBarlineStyleToSystemLinesEnum(t){return"regular"===t?i.SingleThin:"dotted"===t?i.Dotted:"dashed"===t?i.Dashed:"heavy"===t?i.Bold:"light-light"===t?i.DoubleThin:"light-heavy"===t?i.ThinBold:"heavy-light"===t?i.BoldThin:"heavy-heavy"===t?i.DoubleBold:"tick"===t?i.Tick:"short"===t?i.Short:"none"===t?i.None:i.SingleThin}}},525:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VerticalGraphicalStaffEntryContainer=void 0,e.VerticalGraphicalStaffEntryContainer=class{constructor(t,e){this.staffEntries=[],this.absoluteTimestamp=e,this.staffEntries=new Array(t)}get Index(){return this.index}set Index(t){this.index=t}get AbsoluteTimestamp(){return this.absoluteTimestamp}get StaffEntries(){return this.staffEntries}set StaffEntries(t){this.staffEntries=t}static compareByTimestamp(t,e){const i=t.absoluteTimestamp.RealValue,n=e.absoluteTimestamp.RealValue;return in?1:0}getFirstNonNullStaffEntry(){for(let t=0,e=this.staffEntries.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AlignmentManager=void 0;const n=i(9344),s=i(9086);e.AlignmentManager=class{constructor(t){this.parentStaffline=t,this.rules=this.parentStaffline.ParentMusicSystem.rules}alignDynamicExpressions(){var t,e,i,s;const r=[];let o=new Array;for(let i=0;i0){const e=t.map((t=>t.PositionAndShape.Center.y)),r=Math.max(...e),o=(null===(i=window.GYM)||void 0===i?void 0:i.noNeedContinuousDynamic)||!1,a=(null===(s=window.GYM)||void 0===s?void 0:s.noNeedGraphicalContinuousDynamic)||!1;for(let i=0;i0?t[i-1]:void 0;if(e){const t=this.getOverlap(s.PositionAndShape,e.PositionAndShape);s.squeeze(-(t.x+this.rules.DynamicExpressionSpacer))}if(n){const t=this.getOverlap(n.PositionAndShape,s.PositionAndShape);s.squeeze(t.x+this.rules.DynamicExpressionSpacer)}}}}}getDistance(t,e){const i=t.RelativePosition.x+t.BorderMarginRight,n=e.RelativePosition.x+e.BorderMarginLeft,r=t.RelativePosition.y+t.BorderMarginBottom,o=e.RelativePosition.y+e.BorderMarginTop;return new s.PointF2D(n-i,o-r)}getOverlap(t,e){return new s.PointF2D(t.RelativePosition.x+t.BorderMarginRight-(e.RelativePosition.x+e.BorderMarginLeft),t.RelativePosition.y+t.BorderMarginBottom-(e.RelativePosition.y+e.BorderMarginTop))}}},4028:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasVexFlowBackend=void 0;var s=n(i(9124)).default.Flow;const r=i(709),o=i(8129),a=i(41),l=i(599);class h extends r.VexFlowBackend{constructor(t){super(),this.rules=t}getVexflowBackendType(){return s.Renderer.Backends.CANVAS}getOSMDBackendType(){return a.BackendType.Canvas}getCanvasSize(){var t;return null===(t=document.getElementById(this.rules.DYContainerId+this.graphicalMusicPage.PageNumber))||void 0===t?void 0:t.offsetHeight}initialize(t,e){this.zoom=e,this.canvas=document.createElement("canvas"),this.graphicalMusicPage||(this.graphicalMusicPage=new l.GraphicalMusicPage(void 0),this.graphicalMusicPage.PageNumber=1),this.canvas.id="osmdCanvasVexFlowBackendCanvas"+this.graphicalMusicPage.PageNumber,this.inner=document.createElement("div"),this.inner.id=this.rules.DYContainerId+this.graphicalMusicPage.PageNumber,this.inner.style.position="relative",this.canvas.style.zIndex="0",this.inner.appendChild(this.canvas),t.appendChild(this.inner),this.renderer=new s.Renderer(this.canvas,this.getVexflowBackendType()),this.ctx=this.renderer.getContext()}initializeHeadless(t=300,e=300){this.graphicalMusicPage||(this.graphicalMusicPage=new l.GraphicalMusicPage(void 0),this.graphicalMusicPage.PageNumber=1),this.canvas=document.createElement("canvas"),this.canvas.width=t,this.canvas.height=e,this.renderer=new s.Renderer(this.canvas,this.getVexflowBackendType()),this.ctx=this.renderer.getContext()}getContext(){return this.ctx}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.rules.PageBackgroundColor&&(this.ctx.save(),this.ctx.setFillStyle(this.rules.PageBackgroundColor),this.zoom=1,this.ctx.fillRect(0,0,this.canvas.width/this.zoom,this.canvas.height/this.zoom),this.ctx.restore())}scale(t){this.ctx.scale(t,t)}translate(t,e){this.CanvasRenderingCtx.translate(t,e)}renderText(t,e,i,n,s,r,a=void 0,l=void 0){const h=this.CanvasRenderingCtx.font;this.CanvasRenderingCtx.save(),this.CanvasRenderingCtx.font=o.VexFlowConverter.font(t,e,i,this.rules,l),this.CanvasRenderingCtx.fillStyle=a,this.CanvasRenderingCtx.strokeStyle=a,this.CanvasRenderingCtx.fillText(n,r.x,r.y+s),this.CanvasRenderingCtx.restore(),this.CanvasRenderingCtx.font=h}renderRectangle(t,e,i,n=1){const s=this.CanvasRenderingCtx.fillStyle;this.CanvasRenderingCtx.fillStyle=i||o.VexFlowConverter.style(e),this.CanvasRenderingCtx.globalAlpha=n,this.ctx.fillRect(t.x,t.y,t.width,t.height),this.CanvasRenderingCtx.fillStyle=s,this.CanvasRenderingCtx.globalAlpha=1}renderLine(t,e,i="#FF0000FF",n=2){const s=this.CanvasRenderingCtx.strokeStyle;this.CanvasRenderingCtx.strokeStyle=i,this.CanvasRenderingCtx.beginPath(),this.CanvasRenderingCtx.moveTo(t.x,t.y),this.CanvasRenderingCtx.lineTo(e.x,e.y),this.CanvasRenderingCtx.stroke(),this.CanvasRenderingCtx.strokeStyle=s}renderCurve(t){this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.bezierCurveTo(t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y),this.ctx.lineTo(t[7].x,t[7].y),this.ctx.bezierCurveTo(t[6].x,t[6].y,t[5].x,t[5].y,t[4].x,t[4].y),this.ctx.lineTo(t[0].x,t[0].y),this.ctx.closePath(),this.ctx.fill()}get CanvasRenderingCtx(){return this.ctx.vexFlowCanvasContext}}e.CanvasVexFlowBackend=h},9505:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SvgVexFlowBackend=void 0;const s=n(i(9124));var r=s.default.Flow;const o=i(709),a=i(8129),l=i(2562),h=i(41),u=n(i(2043));class c extends o.VexFlowBackend{constructor(t){super(),this.rules=t}getVexflowBackendType(){return r.Renderer.Backends.SVG}getOSMDBackendType(){return h.BackendType.SVG}getCanvasSize(){var t;return null===(t=document.getElementById(this.rules.DYContainerId+this.graphicalMusicPage.PageNumber))||void 0===t?void 0:t.offsetHeight}initialize(t,e,i=void 0){this.zoom=e,this.canvas=document.createElement("div"),i||(i=this.graphicalMusicPage?this.graphicalMusicPage.PageNumber.toString():"1"),this.canvas.id=this.rules.DYContainerId+i,this.inner=this.canvas,this.inner.style.position="relative",this.canvas.style.zIndex="0",t.appendChild(this.inner),this.renderer=new s.default.Flow.Renderer(this.canvas,this.getVexflowBackendType()),this.ctx=this.renderer.getContext(),this.ctx.svg.id=this.rules.DYSVGContainerId+i}getContext(){return this.ctx}getSvgElement(){return this.ctx.svg}removeNode(t){var e;const i=null===(e=this.ctx)||void 0===e?void 0:e.svg;if(!i)return!1;try{i.removeChild(t)}catch(t){return u.default.error(t),!1}return!0}clear(){if(!this.ctx)return;const t=this.ctx.svg;for(;t.lastChild;)t.removeChild(t.lastChild);this.rules.PageBackgroundColor&&(this.ctx.svg.style["background-color"]=this.rules.PageBackgroundColor)}scale(t){this.ctx.scale(t,t)}translate(t,e){}renderText(t,e,i,n,s,r,o=void 0,h=void 0){this.ctx.save();const u=this.ctx.openGroup("text");o&&(this.ctx.attributes.fill=o,this.ctx.attributes.stroke=o);let c=h;h&&"default"!==h||(c=this.rules.DefaultFontFamily),this.ctx.setFont(c,t,a.VexFlowConverter.fontStyle(e)),this.ctx.attributes["font-size"]=`${t}px`,this.ctx.state["font-size"]=`${t}px`;let d="normal",p="normal";switch(e){case l.FontStyles.Bold:d="bold";break;case l.FontStyles.Italic:p="italic";break;case l.FontStyles.BoldItalic:d="bold",p="italic";break;default:d="normal"}return this.ctx.attributes["font-weight"]=d,this.ctx.state["font-weight"]=d,this.ctx.attributes["font-style"]=p,this.ctx.state["font-style"]=p,this.ctx.fillText(n,r.x,r.y+s),this.ctx.closeGroup(),this.ctx.restore(),u}renderRectangle(t,e,i,n=1){this.ctx.save();const s=this.ctx.openGroup("rect");return this.ctx.attributes.fill=i||a.VexFlowConverter.style(e),this.ctx.attributes["fill-opacity"]=n,this.ctx.fillRect(t.x,t.y,t.width,t.height),this.ctx.restore(),this.ctx.attributes["fill-opacity"]=1,this.ctx.closeGroup(),s}renderLine(t,e,i="#FF0000FF",n=2){this.ctx.save();const s=this.ctx.openGroup("line");return this.ctx.beginPath(),this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(e.x,e.y),this.ctx.attributes.stroke=i,this.ctx.lineWidth=n,this.ctx.stroke(),this.ctx.closeGroup(),this.ctx.restore(),s}renderCurve(t){const e=this.ctx.openGroup("curve");return this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.bezierCurveTo(t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y),this.ctx.lineTo(t[7].x,t[7].y),this.ctx.bezierCurveTo(t[6].x,t[6].y,t[5].x,t[5].y,t[4].x,t[4].y),this.ctx.lineTo(t[0].x,t[0].y),this.ctx.closePath(),this.ctx.fill(),this.ctx.closeGroup(),e}export(){const t=this.ctx.svg.cloneNode(!0),e=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),i=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",e);i.replaceChild(t,i.documentElement);const n=(new XMLSerializer).serializeToString(i),s=document.createElement("a");s.href="data:image/svg+xml; charset=utf8, "+encodeURIComponent(n.replace(/>\n\r<")),s.download="opensheetmusicdisplay_download.svg",s.innerHTML=window.location.href+"/download",document.body.appendChild(s)}}e.SvgVexFlowBackend=c},709:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowBackend=e.VexFlowBackends=void 0;var s=n(i(9124)).default.Flow;e.VexFlowBackends=class{},e.VexFlowBackend=class{getInnerElement(){return this.inner}getCanvas(){return this.canvas}getRenderElement(){let t=this.canvas;return this.getVexflowBackendType()===s.Renderer.Backends.CANVAS&&(t=this.inner),t}getRenderer(){return this.renderer}removeAllChildrenFromContainer(t){for(;0!==t.children.length;)t.removeChild(t.children.item(0))}removeFromContainer(t){const e=this.getRenderElement();for(let i=0;i{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowContinuousDynamicExpression=void 0;const n=i(374),s=i(9946),r=i(2255),o=i(1274),a=i(2562);class l extends n.GraphicalContinuousDynamicExpression{constructor(t,e,i,n){if(super(t,e,i),this.IsVerbal){const e=new r.Label(t.Label);this.label=new s.GraphicalLabel(e,n||this.rules.ContinuousDynamicTextHeight,o.TextAlignmentEnum.LeftCenter,this.rules,this.PositionAndShape),this.label.Label.fontStyle=a.FontStyles.Italic,this.label.setLabelPositionAndShapeBorders(),this.PositionAndShape.calculateBoundingBox()}}}e.VexFlowContinuousDynamicExpression=l},8129:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowConverter=void 0;var s=n(i(9124)).default.Flow;const r=i(289),o=i(8640),a=i(1797),l=i(3331),h=i(5198),u=i(5198),c=i(8640),d=i(8640),p=i(6894),f=i(2562),m=i(96),g=i(8155),b=n(i(2043)),y=i(908),S=i(1225),v=i(5922),_=i(766),x=i(5820),E=i(3544),M=i(3029),w=i(3748);class P{static durations(t,e){const i=[],n=t.clone();for(;n.RealValue>0;){const t=n.RealValue;if(t>=2)i.push("1/2"),n.Sub(new a.Fraction(2,1));else if(t>=1)i.push("w"),n.Sub(new a.Fraction(1,1));else if(t<1&&t>=.5){if(e&&t>.5)return["w"];i.push("h"),n.Sub(new a.Fraction(1,2))}else if(t<.5&&t>=.25){if(e&&t>.25)return["h"];i.push("q"),n.Sub(new a.Fraction(1,4))}else if(t<.25&&t>=.125){if(e&&t>.125)return["q"];i.push("8"),n.Sub(new a.Fraction(1,8))}else if(t<.125&&t>=.0625){if(e&&t>.0625)return["8"];i.push("16"),n.Sub(new a.Fraction(1,16))}else if(t<.0625&&t>=.03125){if(e&&t>.03125)return["16"];i.push("32"),n.Sub(new a.Fraction(1,32))}else if(t<.03125&&t>=.015625){if(e&&t>.015625)return["32"];i.push("64"),n.Sub(new a.Fraction(1,64))}else{if(e)return["64"];i.push("128"),n.Sub(new a.Fraction(1,128))}}return i}static pitch(t,e,i,n=void 0,s=void 0){let a=s;void 0===s&&(a=3),e&&void 0===s&&(a=0,i.ClefType===r.ClefEnum.F&&(a=2),i.ClefType===r.ClefEnum.C&&(a=2));const l=d.NoteEnum[t.FundamentalNote].toLowerCase(),h=o.Pitch.accidentalVexflow(t.Accidental),u=t.Octave-i.OctaveOffset+a;let c="";return n&&(c=this.NoteHeadCode(n)),[l+"n/"+u+c,h,i]}static restToNotePitch(t,e){let i=t.Octave;switch(e){case r.ClefEnum.C:case r.ClefEnum.F:i+=2;case r.ClefEnum.G:}return new o.Pitch(t.FundamentalNote,i,c.AccidentalEnum.NONE)}static NoteHeadCode(t){const e=t.Filled?"2":"1";switch(t.Shape){case _.NoteHeadShape.NORMAL:return"";case _.NoteHeadShape.DIAMOND:return"/D"+e;case _.NoteHeadShape.TRIANGLE:return"/T"+e;case _.NoteHeadShape.X:return"/X"+e;case _.NoteHeadShape.CIRCLEX:return"/X3";case _.NoteHeadShape.RECTANGLE:return"/R"+e;case _.NoteHeadShape.SQUARE:return"/S"+e;case _.NoteHeadShape.SLASH:default:return""}}static GhostNotes(t){const e=[],i=P.durations(t,!1);for(const t of i)e.push(new s.GhostNote({duration:t}));return e}static StaveNote(t){var e,i,n,l,u,c,d,p,f,m,g,b,S,v,M,w,T;t.sortForVexflow();const C=t.notes,A=t.parentStaffEntry.parentMeasure.parentSourceMeasure.Rules,I=C[0];let L,R=[];const N=[],k=I.graphicalNoteLength,O=void 0!==I.sourceNote.NoteTuplet;let D,B=P.durations(k,O)[0];void 0!==I.sourceNote.TypeLength&&I.sourceNote.TypeLength!==k&&0!==I.sourceNote.TypeLength.RealValue&&(B=P.durations(I.sourceNote.TypeLength,O)[0],I.numberOfDots=I.sourceNote.DotsXml);let F,V,G=I.numberOfDots,W=!1,U=0,H=!1,z=!1;for(const t of C){if(G=1&&e.length-1>=a+1&&(r=null===(u=null===(l=e[a-1])||void 0===l?void 0:l.graphicalVoiceEntries[0])||void 0===u?void 0:u.parentVoiceEntry,o=null===(d=null===(c=e[a+1])||void 0===c?void 0:c.graphicalVoiceEntries[0])||void 0===d?void 0:d.parentVoiceEntry,r&&o)){const e=r.Notes[0],i=o.Notes[0];if((null===(p=e.NoteBeam)||void 0===p?void 0:p.Notes.includes(i))&&1!==i.ParentStaffEntry.ParentStaff.StafflineCount){const e=r.Notes.last().Pitch,i=t.Clef(),n=P.pitch(P.restToNotePitch(e.getTransposedPitch(-2),i.ClefType),!1,i);4===e.FundamentalNote&&(R=[n[0]])}}}}if(k.RealValue===t.sourceNote.SourceMeasure.ActiveTimeSignature.RealValue&&(R="staff"===A.DYMusicScoreType?["d/5"]:["R/5"],B="w",G=0,W=!0,U=A.WholeRestXShiftVexflow*x.unitInPixels),[...t.sourceNote.ParentStaff.Voices].filter((t=>1!=(null==t?void 0:t.VoiceId))).length){const e=t.parentVoiceEntry.parentStaffEntry.graphicalVoiceEntries,i=t.parentVoiceEntry.parentVoiceEntry.ParentVoice.VoiceId;let n,s;for(const r of e)for(const e of r.notes){if(e===t||e.sourceNote.isRest()||!e.sourceNote.PrintObject){t.lineShift=-2;continue}const r=e.parentVoiceEntry.parentVoiceEntry.WantedStemDirection,o=1===i||5===i,a=o?1:-1,l=e.sourceNote.Pitch.getHalfTone();(!n||1===a&&l>n||-1===a&&l0){let e=3;const i=t.Clef();switch(i.ClefType){case r.ClefEnum.F:e=5;break;case r.ClefEnum.C:e=4}F=o.Pitch.fromHalftone(n),R=[P.pitch(F,!0,i,void 0,e)[0]]}}break}t.sourceNote.Notehead&&t.sourceNote.Notehead.Shape===_.NoteHeadShape.SLASH&&(H=!0);const s=t.vfpitch;if(null===(m=null===(f=s[2])||void 0===f?void 0:f.Parent)||void 0===m?void 0:m.Instructions)for(let t=0,e=s[2].Parent.Instructions.length;t1&&1==t.notes[0].sourceNote.ParentVoiceEntry.ParentVoice.VoiceId&&(V.getKeyProps()[0].line=4.5);const K=null===(v=window.GYM)||void 0===v?void 0:v.customBassDrum;if(K&&V.isRest()&&("q"===V.getDuration()&&(V.getKeyProps()[0].line=K),"h"===V.getDuration()&&(V.getKeyProps()[0].line=K-1)),V.getKeyProps().forEach((({line:e},i)=>t.notes[i].staffLine=e)),(A.LedgerLineWidth||A.LedgerLineStrokeStyle)&&(V.ledgerLineStyle||(V.ledgerLineStyle={}),A.LedgerLineWidth&&(V.ledgerLineStyle.lineWidth=A.LedgerLineWidth),A.LedgerLineStrokeStyle&&(V.ledgerLineStyle.strokeStyle=A.LedgerLineStrokeStyle)),A.ColoringEnabled){const e=A.DefaultColorStem;let i=t.parentVoiceEntry.StemColor;!i&&e&&(i=e);const n={fillStyle:i,strokeStyle:i};i&&(V.setStemStyle(n),V.flag&&A.ColorFlags&&V.setFlagStyle(n))}if(V.x_shift=U,t.parentVoiceEntry.IsGrace&&t.notes[0].sourceNote.NoteBeam&&(t.parentVoiceEntry.WantedStemDirection=t.notes[0].sourceNote.NoteBeam.Notes[0].ParentVoiceEntry.WantedStemDirection),t.parentVoiceEntry){let e=t.parentVoiceEntry.WantedStemDirection;const i=(null===(M=window.GYM)||void 0===M?void 0:M.stemDirectionNote)||[],n=null==i?void 0:i.find((e=>e.id===t.notes[0].sourceNote.NoteToGraphicalNoteObjectId));n&&"number"==typeof(null==n?void 0:n.direction)&&(e=n.direction);const r=window.DYMusicalOrientation;switch(e=void 0!==r?r:e,e){case y.StemDirectionType.Up:V.setStemDirection(s.Stem.UP),t.parentVoiceEntry.StemDirection=y.StemDirectionType.Up;break;case y.StemDirectionType.Down:V.setStemDirection(s.Stem.DOWN),t.parentVoiceEntry.StemDirection=y.StemDirectionType.Down}}for(let t=0,e=C.length;t0&&"single"===i){const i=new s.Tremolo(e);i.extra_stroke_scale=A.TremoloStrokeScale,i.y_spacing_scale=A.TremoloYSpacingScale,V&&"w"===V.duration&&V.stem.setExtension(-9),V.addModifier(t,i)}if(e>0&&"start"===i&&this.noteTremoloList.push(V),e>0&&"stop"===i){if(this.noteTremoloList.push(V),this.noteTremoloList.filter((t=>"w"===t.duration)).length===this.noteTremoloList.length)try{this.noteTremoloList[0].keyProps&&this.noteTremoloList[1].keyProps&&(null===(w=(this.noteTremoloList[0].keyProps[0].line>this.noteTremoloList[1].keyProps[0].line?this.noteTremoloList[1]:this.noteTremoloList[0]).stem)||void 0===w||w.setResetHeight(30))}catch(t){console.error("设置都是全音符,stem的高度失败")}const i=new s.Tremolo(e,[...this.noteTremoloList]);i.extra_stroke_scale=1.2,i.y_spacing_scale=1.2,i.x_shift=-30,V.addModifier(t,i),this.noteTremoloList=[]}this.glissandoList.length&&(V.setVibrato(this.glissandoList[0].vfnote[0]),this.glissandoList=[]),"start"===C[t].sourceNote.glissandoType&&this.glissandoList.push(C[t])}if(this.slideNote){try{V.setSlideNote(this.slideNote)}catch(t){console.error(t)}this.slideNote=null}if("start"===t.notes[0].sourceNote.slideType&&(this.slideNote=V),.25===X.Length.RealValue&&X.Notehead&&!1===X.Notehead.Filled){const t=V.getKeyProps();for(let e=0;e1){let t=V.getKeyProps().filter((t=>!t.code&&t.line>3));(null===(T=window.GYM)||void 0===T?void 0:T.stemDirectionNote)||t.length!==R.length||V.setStemDirection(-1)}"jianpu"===A.DYMusicScoreType&&window&&window.sett&&window.sett.keySignature&&V.addAccidental(0,new s.Accidental("#"));try{const t=["b","#","§","º","X"],e={b:"b","#":"#","§":"n",º:"bb",X:"##"};for(const i of C){const n=i.sourceNote.voiceEntry.Timestamp;for(const r of i.sourceNote.SourceMeasure.StaffLinkedExpressions)for(const i of r){const r=a.Fraction.Equal(n,i.Timestamp),o=i.EntriesList.map((t=>t.label)).filter((e=>t.includes(e))).map((t=>e[t]));if(r){for(const t of o)t&&V.addAnnotation(0,new s.Annotation(t));break}}}}catch(t){}return V}static generateArticulations(t,e,i){var n,r,o,a,l,h;if(t&&"GhostNote"!==t.getAttribute("type"))for(const u of e){let e,c=s.Modifier.Position.ABOVE;t.getStemDirection()===s.Stem.UP&&(c=s.Modifier.Position.BELOW);const d=u.articulationEnum;switch(i.ArticulationPlacementFromXML&&(u.placement===w.PlacementEnum.Above?c=s.Modifier.Position.ABOVE:u.placement===w.PlacementEnum.Below&&(c=s.Modifier.Position.BELOW)),d){case y.ArticulationEnum.accent:e=new s.Articulation("a>");break;case y.ArticulationEnum.downbow:e=new s.Articulation("am"),void 0===u.placement&&(c=s.Modifier.Position.ABOVE);break;case y.ArticulationEnum.fermata:e=new s.Articulation("a@a"),c=s.Modifier.Position.ABOVE;break;case y.ArticulationEnum.marcatodown:e=new s.Articulation("a|");break;case y.ArticulationEnum.marcatoup:e=new s.Articulation("a^");break;case y.ArticulationEnum.invertedfermata:e=new s.Articulation("a@u"),c=s.Modifier.Position.BELOW;break;case y.ArticulationEnum.lefthandpizzicato:e=new s.Articulation("a+");break;case y.ArticulationEnum.naturalharmonic:e=new s.Articulation("ah");break;case y.ArticulationEnum.snappizzicato:e=new s.Articulation("ao");break;case y.ArticulationEnum.staccatissimo:e=new s.Articulation("av");break;case y.ArticulationEnum.staccato:e=new s.Articulation("a.");break;case y.ArticulationEnum.tenuto:e=new s.Articulation("a-");break;case y.ArticulationEnum.upbow:e=new s.Articulation("a|"),void 0===u.placement&&(c=s.Modifier.Position.ABOVE);break;case y.ArticulationEnum.strongaccent:e=new s.Articulation("a^")}e&&(!t.hasStem()&&!t.isRest()&&d==y.ArticulationEnum.accent&&t.getLineNumber()>=3&&(c=s.Modifier.Position.ABOVE,(null===(r=null===(n=null==t?void 0:t.modifiers)||void 0===n?void 0:n.filter((t=>["TREMOLO"].includes(t.getCategory().toLocaleUpperCase()))))||void 0===r?void 0:r.length)&&e.setYShift(-16)),d===y.ArticulationEnum.strongaccent&&(c=s.Modifier.Position.ABOVE,(null===(o=window.GYM)||void 0===o?void 0:o.customArtPosition)&&(1===t.getStemDirection()?c=s.Modifier.Position.ABOVE:(c=s.Modifier.Position.BELOW,e=new s.Articulation("a|")))),(null===(a=window.GYM)||void 0===a?void 0:a.customAccentItem)&&d===y.ArticulationEnum.accent&&(c=s.Modifier.Position.ABOVE),!(null===(l=window.GYM)||void 0===l?void 0:l.customLefthandpizzicatoItem)||d!==y.ArticulationEnum.lefthandpizzicato&&d!==y.ArticulationEnum.naturalharmonic||(c=s.Modifier.Position.ABOVE),d===y.ArticulationEnum.tenuto&&"w"===t.getDuration()&&(null===(h=window.GYM)||void 0===h?void 0:h.customTenutoItem)&&(c=s.Modifier.Position.ABOVE),e.setPosition(c),t.addModifier(0,e))}}static generateOrnaments(t,e){let i,n=s.Modifier.Position.ABOVE;switch(e.placement===w.PlacementEnum.Below&&(n=s.Modifier.Position.BELOW),e.GetOrnament){case v.OrnamentEnum.DelayedInvertedTurn:i=new s.Ornament("turn_inverted"),i.setDelayed(!0);break;case v.OrnamentEnum.DelayedTurn:i=new s.Ornament("turn"),i.setDelayed(!0);break;case v.OrnamentEnum.InvertedMordent:i=new s.Ornament("mordent"),i.setDelayed(!1);break;case v.OrnamentEnum.InvertedTurn:i=new s.Ornament("turn_inverted"),i.setDelayed(!1);break;case v.OrnamentEnum.Mordent:i=new s.Ornament("mordent_inverted"),i.setDelayed(!1);break;case v.OrnamentEnum.Trill:i=new s.Ornament("tr"),i.setDelayed(!1);break;case v.OrnamentEnum.Turn:i=new s.Ornament("turn"),i.setDelayed(!1);break;default:return void b.default.warn("unhandled OrnamentEnum type: "+e.GetOrnament)}i&&(e.AccidentalBelow!==c.AccidentalEnum.NONE&&i.setLowerAccidental(o.Pitch.accidentalVexflow(e.AccidentalBelow)),e.AccidentalAbove!==c.AccidentalEnum.NONE&&i.setUpperAccidental(o.Pitch.accidentalVexflow(e.AccidentalAbove)),i.setPosition(n),t.addModifier(0,i))}static StrokeTypeFromArpeggioType(t){switch(t){case M.ArpeggioType.ARPEGGIO_DIRECTIONLESS:return s.Stroke.Type.ARPEGGIO_DIRECTIONLESS;case M.ArpeggioType.BRUSH_DOWN:return s.Stroke.Type.BRUSH_UP;case M.ArpeggioType.BRUSH_UP:return s.Stroke.Type.BRUSH_DOWN;case M.ArpeggioType.RASQUEDO_DOWN:return s.Stroke.Type.RASQUEDO_UP;case M.ArpeggioType.RASQUEDO_UP:return s.Stroke.Type.RASQUEDO_DOWN;case M.ArpeggioType.ROLL_DOWN:return s.Stroke.Type.ROLL_UP;case M.ArpeggioType.ROLL_UP:return s.Stroke.Type.ROLL_DOWN;default:return s.Stroke.Type.ARPEGGIO_DIRECTIONLESS}}static CreateTabNote(t){const e=[],i=t.notes.reverse(),n=[],r=t.notes[0].graphicalNoteLength,o=void 0!==t.notes[0].sourceNote.NoteTuplet;let a=P.durations(r,o)[0],l=0;for(const i of t.notes){const t=i.sourceNote,r={str:t.StringNumberTab,fret:t.FretNumber};e.push(r),t.BendArray&&t.BendArray.forEach((function(t){let e;const i=t.bendalter-r.fret;e=i>1?"Full":1===i?"1/2":"1/4","up"===t.direction?n.push({type:s.Bend.UP,text:e,width:10}):n.push({type:s.Bend.DOWN,text:e,width:10})})),l{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowGraphicalNote=void 0;const n=i(3486),s=i(8129),r=i(5853);class o extends n.GraphicalNote{constructor(t,e,i,n=r.OctaveEnum.NONE,o,a=void 0){if(super(t,e,o,a),this.clef=i,this.octaveShift=n,t.Pitch){const e=t.isRest()?t.Pitch:r.OctaveShift.getPitchFromOctaveShift(t.Pitch,n);this.vfpitch=s.VexFlowConverter.pitch(e,t.isRest(),this.clef,this.sourceNote.Notehead),this.vfpitch[1]=void 0}}setAccidental(t){const e=this.drawPitch(t);this.vfpitch=s.VexFlowConverter.pitch(e,this.sourceNote.isRest(),this.clef,this.sourceNote.Notehead),this.DrawnAccidental=e.Accidental}drawPitch(t){return r.OctaveShift.getPitchFromOctaveShift(t,this.octaveShift)}Transpose(t,e,i,n){const o=super.Transpose(t,e,i,n),a=r.OctaveShift.getPitchFromOctaveShift(o,this.octaveShift);return this.vfpitch=s.VexFlowConverter.pitch(a,this.sourceNote.isRest(),this.clef,this.sourceNote.Notehead),this.vfpitch[1]=void 0,a}setIndex(t,e){this.vfnote=[t,e],this.vfnoteIndex=e}notehead(t=void 0){let e=t;e||(e=this.vfnote[0]);const i=e.note_heads;return i&&i.length>this.vfnoteIndex&&i[this.vfnoteIndex]?e.note_heads[this.vfnoteIndex]:{line:0}}Clef(){return this.clef}getSVGId(){if(this.vfnote)return this.vfnote[0].getAttribute("id")}getSVGGElement(){if(this.vfnote)return this.vfnote[0].getAttribute("el")}getStemSVG(){return document.getElementById("vf-"+this.getSVGId()+"-stem")}getBeamSVGs(){const t=[];for(let e=0;;e++){const i=document.getElementById(`vf-${this.getSVGId()}-beam${e}`);if(!i)break;t.push(i)}return t}}e.VexFlowGraphicalNote=o},8144:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowGraphicalSymbolFactory=void 0;var s=n(i(9124)).default.Flow;const r=i(8494),o=i(7330),a=i(9252),l=i(5853),h=i(4679),u=i(4146),c=i(5460),d=i(8129),p=i(8790),f=i(4828),m=i(4405),g=i(6040),b=i(8965);e.VexFlowGraphicalSymbolFactory=class{constructor(){this.hasBBox=!1,void 0!==document.createElementNS("http://www.w3.org/2000/svg","g").getBBox&&(this.hasBBox=!0)}createMusicSystem(t,e){return new r.VexFlowMusicSystem(t,e)}createStaffLine(t,e){return new f.VexFlowStaffLine(t,e)}createSkyBottomLineCalculator(t){return t.ParentMusicSystem.rules.PerformanceMode&&this.hasBBox?new b.SkyBottomLineCalculatorSVG(t):new g.SkyBottomLineCalculator(t)}createGraphicalMeasure(t,e,i=!1){return new o.VexFlowMeasure(e,t,void 0)}createMultiRestMeasure(t,e,i){return new m.VexFlowMultiRestMeasure(e,t,i)}createTabStaffMeasure(t,e){return new p.VexFlowTabMeasure(e,t)}createExtraGraphicalMeasure(t){const e=new o.VexFlowMeasure(t.ParentStaff,void 0,t);return e.IsExtraGraphicalMeasure=!0,e.ExtraGraphicalMeasurePreviousMeasure=t.Measures.last(),e}createStaffEntry(t,e){return new a.VexFlowStaffEntry(e,t,void 0)}createVoiceEntry(t,e){return new c.VexFlowVoiceEntry(t,e)}createNote(t,e,i,n=l.OctaveEnum.NONE,s,r=void 0){return new h.VexFlowGraphicalNote(t,e,i,n,s,r)}createGraceNote(t,e,i,n,s=l.OctaveEnum.NONE){return new h.VexFlowGraphicalNote(t,e,i,s,n)}addGraphicalAccidental(t,e){t.setAccidental(e)}addFermataAtTiedEndNote(t,e){}createInStaffClef(t,e){const i=t,n=d.VexFlowConverter.Clef(e,"small");i.vfClefBefore=new s.ClefNote(n.type,n.size,n.annotation)}createChordSymbols(t,e,i,n){const s=e.parentMeasure.parentSourceMeasure.Rules;let r=0;const o=s.ChordSymbolXSpacing;for(const a of t.ChordContainers){const t=new u.GraphicalChordSymbolContainer(a,e.PositionAndShape,s.ChordSymbolTextHeight,i,n,e.parentMeasure.parentSourceMeasure.Rules),l=t.GraphicalLabel;l.PositionAndShape.RelativePosition.y-=s.ChordSymbolYOffset,l.PositionAndShape.RelativePosition.x+=r,l.setLabelPositionAndShapeBorders(),t.PositionAndShape.calculateBoundingBox(),e.graphicalChordContainers.push(t),r+=l.PositionAndShape.Size.width+o}}createGraphicalTechnicalInstruction(t,e){}}},6351:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowInstantaneousDynamicExpression=void 0;const n=i(9428),s=i(9793),r=i(9946),o=i(2255),a=i(1274),l=i(2562);class h extends n.GraphicalInstantaneousDynamicExpression{constructor(t,e,i){super(t,e,i);const n=new o.Label(this.Expression);this.label=new r.GraphicalLabel(n,this.rules.ContinuousDynamicTextHeight,a.TextAlignmentEnum.CenterCenter,this.rules,this.PositionAndShape),this.label.Label.fontStyle=l.FontStyles.BoldItalic,this.label.setLabelPositionAndShapeBorders(),this.PositionAndShape.calculateBoundingBox()}get InstantaneousDynamic(){return this.mInstantaneousDynamicExpression}get Expression(){return s.DynamicEnum[this.mInstantaneousDynamicExpression.DynEnum]}}e.VexFlowInstantaneousDynamicExpression=h},8939:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowInstrumentBrace=void 0;var s=n(i(9124)).default.Flow;const r=i(5575);class o extends r.VexFlowInstrumentBracket{constructor(t,e,i=0){super(t,e,i),this.vexflowConnector.setType(s.StaveConnector.type.BRACE)}}e.VexFlowInstrumentBrace=o},5575:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowInstrumentBracket=void 0;var s=n(i(9124)).default.Flow;const r=i(4785),o=i(8911),a=i(5820);class l extends r.GraphicalObject{constructor(t,e,i=0){super(),this.Visible=!0,this.PositionAndShape=new o.BoundingBox(this,t.ParentMusicSystem.PositionAndShape);const n=t.Measures[0],r=e.Measures[0];this.addConnector(n.getVFStave(),r.getVFStave(),s.StaveConnector.type.BRACKET,i)}draw(t){this.Visible&&this.vexflowConnector.setContext(t).draw();const e=this.vexflowConnector,i=e.top_stave.getYForLine(0),n=e.bottom_stave.getYForLine(e.bottom_stave.getNumLines()-1)+e.thickness;this.PositionAndShape.AbsolutePosition.x=(e.top_stave.getX()-2+e.x_shift)/a.unitInPixels,this.PositionAndShape.AbsolutePosition.y=i/a.unitInPixels,this.PositionAndShape.Size.height=(n-i)/a.unitInPixels,this.PositionAndShape.Size.width=12/a.unitInPixels}addConnector(t,e,i,n){this.vexflowConnector=new s.StaveConnector(t,e).setType(i).setXShift(-5*n)}}e.VexFlowInstrumentBracket=l},7330:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.StavePositionEnum=e.VexFlowMeasure=void 0;var s=n(i(9124)).default.Flow;const r=i(1513),o=i(6894),a=i(289),l=i(8129);var h=s.NoteSubGroup;const u=n(i(2043)),c=i(5820),d=i(6189),p=i(1225),f=i(908),m=i(5460),g=i(1797),b=i(3748),y=i(2478);class S extends r.GraphicalMeasure{constructor(t,e=void 0,i=void 0){super(t,e,i),this.isTabMeasure=!1,this.octaveOffset=3,this.vfVoices={},this.vfTies=[],this.vfRepetitionWords=[],this.connectors=[],this.beams={},this.tuplets={},this.vftuplets={},this.minimumStaffEntriesWidth=-1,i?this.rules=i.ParentMusicSystem.rules:e&&(this.rules=e.Rules),this.resetLayout()}setAbsoluteCoordinates(t,e){this.stave.setX(t).setY(e)}resetLayout(){this.stave=new s.Stave(0,0,0,{fill_style:this.rules.StaffLineColor,space_above_staff_ln:0,space_below_staff_ln:0,DYMusicScoreType:this.rules.DYMusicScoreType}),this.stave.MeasureNumber=this.MeasureNumber,this.ParentStaff&&this.setLineNumber(this.ParentStaff.StafflineCount),this.stave.setBegBarType(s.Barline.type.NONE),this.parentSourceMeasure&&this.parentSourceMeasure.endingBarStyleEnum===o.SystemLinesEnum.None&&this.stave.setEndBarType(s.Barline.type.NONE),this.updateInstructionWidth()}clean(){this.vfTies.length=0,this.connectors=[],this.resetLayout()}getLineWidth(t){switch(t){case o.SystemLinesEnum.SingleThin:case o.SystemLinesEnum.DoubleThin:case o.SystemLinesEnum.ThinBold:return 5/c.unitInPixels;case o.SystemLinesEnum.BoldThinDots:case o.SystemLinesEnum.DotsThinBold:return 10/c.unitInPixels;case o.SystemLinesEnum.DotsBoldBoldDots:return 10/c.unitInPixels+this.rules.RepeatEndStartPadding;default:return 0}}addClefAtBegin(t){if(this.rules.RenderClefsAtBeginningOfStaffline){if(this.octaveOffset=t.OctaveOffset,"jianpu"!==this.rules.DYMusicScoreType)if(t.ClefType===a.ClefEnum.TAB)this.stave.addClef("tab",void 0,void 0,void 0);else{const e=l.VexFlowConverter.Clef(t,"default");this.stave.addClef(e.type,e.size,e.annotation,s.StaveModifier.Position.BEGIN)}this.updateInstructionWidth()}}setLineNumber(t){5!==t&&(0===t?(this.stave.setNumLines(0),this.stave.getBottomLineY=function(){return this.getYForLine(this.options.num_lines)}):1===t?(this.stave.options.line_config=[{visible:!1},{visible:!1},{visible:!0},{visible:!1},{visible:!1}],this.stave.getBottomLineY=function(){return this.getYForLine(2)}):2===t?(this.stave.options.line_config=[{visible:!1},{visible:!1},{visible:!0},{visible:!0},{visible:!1}],this.stave.getBottomLineY=function(){return this.getYForLine(3)}):3===t?(this.stave.options.line_config=[{visible:!1},{visible:!0},{visible:!0},{visible:!0},{visible:!1}],this.stave.getBottomLineY=function(){return this.getYForLine(2)}):(this.stave.setNumLines(t),this.stave.getBottomLineY=function(){return this.getYForLine(this.options.num_lines)}))}addKeyAtBegin(t,e,i){this.rules.RenderKeySignatures&&(this.stave.setKeySignature(l.VexFlowConverter.keySignature(t),l.VexFlowConverter.keySignature(e),void 0),this.updateInstructionWidth())}addRhythmAtBegin(t){const e=l.VexFlowConverter.TimeSignature(t);this.stave.addModifier(e,s.StaveModifier.Position.BEGIN,{numerator:t.Rhythm.Numerator,denominator:t.Rhythm.Denominator}),this.ShowTimeSignature||e.setStyle({fillStyle:"#00000000"}),this.updateInstructionWidth()}addClefAtEnd(t,e=!0){const i=l.VexFlowConverter.Clef(t,"small");if(e||!this.stave.endClef){this.stave.setEndClef(i.type,i.size,i.annotation);for(const t of this.stave.getModifiers())if(e){const e=t.originalStrokeStyle,i=t.originalFillStyle;t.getStyle()&&(e&&i?(t.getStyle().strokeStyle=e,t.getStyle().fillStyle=i):(t.getStyle().strokeStyle=null,t.getStyle().fillStyle=null))}else if("clefs"===t.getCategory()&&t.getPosition()===s.StaveModifier.Position.END&&t.type===i.type){const e="#12345600",i=t.getStyle();i&&(t.originalStrokeStyle=i.strokeStyle,t.originalFillStyle=i.fillStyle),t.setStyle({strokeStyle:e,fillStyle:e})}return this.parentSourceMeasure.hasEndClef=!0,this.updateInstructionWidth()}}addMeasureLine(t,e,i=!0){switch(e){case p.SystemLinePosition.MeasureBegin:t===o.SystemLinesEnum.BoldThinDots&&(i||(this.stave.modifiers[0].draw=function(t){switch(t.checkContext(),this.setRendered(),this.type){case s.Barline.type.SINGLE:this.drawVerticalBar(t,this.x,!1);break;case s.Barline.type.DOUBLE:this.drawVerticalBar(t,this.x,!0);break;case s.Barline.type.END:this.drawVerticalEndBar(t,this.x);break;case s.Barline.type.REPEAT_BEGIN:this.drawRepeatBar(t,this.x,!0);break;case s.Barline.type.REPEAT_END:this.drawRepeatBar(t,this.x,!1);break;case s.Barline.type.REPEAT_BOTH:this.drawRepeatBar(t,this.x,!1),this.drawRepeatBar(t,this.x,!0)}}),this.stave.setBegBarType(s.Barline.type.REPEAT_BEGIN));break;case p.SystemLinePosition.MeasureEnd:switch(t){case o.SystemLinesEnum.DotsBoldBoldDots:this.stave.setEndBarType(s.Barline.type.REPEAT_BOTH);break;case o.SystemLinesEnum.DotsThinBold:this.stave.setEndBarType(s.Barline.type.REPEAT_END);break;case o.SystemLinesEnum.DoubleThin:this.stave.setEndBarType(s.Barline.type.DOUBLE);break;case o.SystemLinesEnum.ThinBold:this.stave.setEndBarType(s.Barline.type.END);break;case o.SystemLinesEnum.None:this.stave.setEndBarType(s.Barline.type.NONE)}}}addMeasureNumber(){const t=this.MeasureNumber.toString(),e=v.ABOVE;this.stave.setText(t,e,{justification:1,shift_x:0,shift_y:0})}addWordRepetition(t){let e,i=s.StaveModifier.Position.END;const n=this.beginInstructionsWidth;switch(t.type){case d.RepetitionInstructionEnum.Segno:e=s.Repetition.type.SEGNO_LEFT,i=s.StaveModifier.Position.LEFT;break;case d.RepetitionInstructionEnum.Coda:e=s.Repetition.type.CODA_LEFT,i=s.StaveModifier.Position.LEFT;break;case d.RepetitionInstructionEnum.DaCapo:e=s.Repetition.type.DC;break;case d.RepetitionInstructionEnum.DalSegno:e=s.Repetition.type.DS;break;case d.RepetitionInstructionEnum.Fine:e=s.Repetition.type.FINE;break;case d.RepetitionInstructionEnum.ToCoda:e=s.Repetition.type.TO_CODA;break;case d.RepetitionInstructionEnum.DaCapoAlFine:e=s.Repetition.type.DC_AL_FINE;break;case d.RepetitionInstructionEnum.DaCapoAlCoda:e=s.Repetition.type.DC_AL_CODA;break;case d.RepetitionInstructionEnum.DalSegnoAlFine:e=s.Repetition.type.DS_AL_FINE;break;case d.RepetitionInstructionEnum.DalSegnoAlCoda:e=s.Repetition.type.DS_AL_CODA}if(e){if(this.stave.getModifiers().find((t=>t.symbol_type===e)))return;const t=new s.Repetition(e,n,-this.rules.RepetitionSymbolsYOffset);this.stave.addModifier(t,i)}else this.addVolta(t)}addVolta(t){var e;let i=s.Volta.type.BEGIN;if(t.type===d.RepetitionInstructionEnum.Ending){switch(t.alignment){case d.AlignmentType.Begin:i=this.parentSourceMeasure.endsRepetitionEnding()?s.Volta.type.BEGIN_END:s.Volta.type.BEGIN;break;case d.AlignmentType.End:if(this.parentSourceMeasure.beginsRepetitionEnding())return;i=s.Volta.type.END}const n=this.ParentStaffLine.SkyBottomLineCalculator,r=this.PositionAndShape.AbsolutePosition.x+this.PositionAndShape.BorderMarginLeft+.4,o=Math.max(this.PositionAndShape.AbsolutePosition.x+this.PositionAndShape.BorderMarginRight,r+.4),a=n.getSkyLineMinInRange(r,o)-2;let l,h=-6.1+this.rules.VoltaOffset,u=this.rules.VoltaOffset;a0){u.default.trace(`Ghost Found in between (measure ${this.MeasureNumber})`);const e=this.createGhostGves(n);i.splice(t,0,...e),t+=e.length}}else{const e=g.Fraction.minus(s,this.parentSourceMeasure.AbsoluteTimestamp);if(e.RealValue>0){u.default.trace(`Ghost Found at start (measure ${this.MeasureNumber})`);const n=this.createGhostGves(e);i.splice(0,0,...n),t+=n.length}}e=r}const n=g.Fraction.plus(this.parentSourceMeasure.AbsoluteTimestamp,this.parentSourceMeasure.Duration),s=g.Fraction.minus(n,e);if(s.RealValue>0){u.default.trace(`Ghost Found at end (measure ${this.MeasureNumber})`);const t=this.createGhostGves(s);i=i.concat(t)}return i}createGhostGves(t){const e=l.VexFlowConverter.GhostNotes(t),i=[];for(const t of e){const e=new m.VexFlowVoiceEntry(void 0,void 0);e.vfStaveNote=t,i.push(e)}return i}handleBeam(t,e){const i=t.sourceNote.ParentVoiceEntry.ParentVoice.VoiceId;let n,s=this.beams[i];s||(s=this.beams[i]=[]);for(const t of s)t[0]===e&&(n=t);n||(n=[e,[]],s.push(n));const r=t.parentVoiceEntry;n[1].indexOf(r)<0&&n[1].push(r)}handleTuplet(t,e){const i=t.sourceNote.ParentVoiceEntry.ParentVoice.VoiceId;e=t.sourceNote.NoteTuplet;let n,s=this.tuplets[i];s||(s=this.tuplets[i]=[]);for(const t of s)t[0]===e&&(n=t);n||(n=[e,[]],s.push(n));const r=t.parentVoiceEntry;n[1].indexOf(r)<0&&n[1].push(r)}finalizeBeams(){this.vfbeams={};const t=[];for(const e in this.beams)if(this.beams.hasOwnProperty(e)){let i=this.vfbeams[e];i||(i=this.vfbeams[e]=[]);for(const n of this.beams[e]){let e=!1;for(const t of n[0].Notes)if(t.Length.RealValue>=new g.Fraction(1,4).RealValue&&(!t.TypeLength||t.TypeLength.RealValue>.125)){e=!0;break}if(e){u.default.debug("Beam between note >= quarter, likely tremolo, currently unsupported. continuing.");continue}const r=[],o=n[0],a=n[1];let l=!0;for(const t of a)t.parentVoiceEntry.ParentVoice===o.Notes[0].ParentVoiceEntry.ParentVoice&&(l=t.parentVoiceEntry.WantedStemDirection===f.StemDirectionType.Undefined);let h,c=!1;const d=[];for(const e of a){const i=e.vfStaveNote;i&&(r.push(i),t.push(i)),e.parentVoiceEntry.IsGrace&&(c=!0),e.parentVoiceEntry.StemColor&&this.rules.ColoringEnabled&&d.push(e.parentVoiceEntry.StemColor)}if(r.length>1){const t=new s.Beam(r,l);if(c&&(t.render_options.beam_width=3,t.render_options.partial_beam_length=4),d.length>=2&&this.rules.ColorBeams){h=d[0];for(const t of d)if(t!==h){h=void 0;break}t.setStyle({fillStyle:h,strokeStyle:h})}this.rules.FlatBeams&&(t.render_options.flat_beams=!0,t.render_options.flat_beam_offset=this.rules.FlatBeamOffset,t.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),i.push(t)}else u.default.debug("Warning! Beam with no notes!")}}this.rules.AutoBeamNotes&&this.autoBeamNotes(t)}autoBeamNotes(t){if(!this.rules.AutoBeamTabs&&this.isTabMeasure)return;let e,i=[],n=[],r=[];this.autoTupletVfBeams=[];const o=[];this.autoVfBeams=[];let a=this.parentSourceMeasure.ActiveTimeSignature;a||(a=this.parentSourceMeasure.Duration);for(const l of this.staffEntries)for(const h of l.graphicalVoiceEntries){const u=h.vfStaveNote,c=h.notes[0],d=l.relInMeasureTimestamp.isOnBeat(a),p=n.length>=2,f=c.sourceNote.Length.RealValue-new g.Fraction(1,4).RealValue>-g.Fraction.FloatInaccuracyTolerance,m=h.parentVoiceEntry.IsGrace||f||t.contains(u);if(m||d){if(p){for(const t of n)i.push(t);o.push(i.slice()),i=[]}if(n=[],m)continue}const b=h.notes[0].sourceNote.NoteTuplet;if(b){let t=!1;for(const e of b.Notes){for(const i of e)if(i.NoteTypeXml>=y.NoteType.QUARTER||i.ParentVoiceEntry.IsGrace||i.isRest()&&!this.rules.AutoBeamOptions.beam_rests){t=!0;break}if(t)break}if(e){if(e!==b){if(r.length>1){const t=new s.Beam(r,!0);this.rules.FlatBeams&&(t.render_options.flat_beams=!0,t.render_options.flat_beam_offset=this.rules.FlatBeamOffset,t.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoTupletVfBeams.push(t)}r=[],e=b}}else e=b;t||r.push(u)}else e=void 0,n.push(u)}if(r.length>=2){const t=new s.Beam(r,!0);this.rules.FlatBeams&&(t.render_options.flat_beams=!0,t.render_options.flat_beam_offset=this.rules.FlatBeamOffset,t.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoTupletVfBeams.push(t)}if(n.length>=2){for(const t of n)i.push(t);o.push(i)}const l=this.rules.AutoBeamOptions,h={beam_middle_only:l.beam_middle_rests_only,beam_rests:l.beam_rests,maintain_stem_directions:l.maintain_stem_directions};if(l.groups&&l.groups.length){const t=[];for(const e of l.groups)t.push(new s.Fraction(e[0],e[1]));h.groups=t}for(const t of o){const e=s.Beam.generateBeams(t,h);for(const t of e)this.rules.FlatBeams&&(t.render_options.flat_beams=!0,t.render_options.flat_beam_offset=this.rules.FlatBeamOffset,t.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoVfBeams.push(t)}}finalizeTuplets(){this.vftuplets={};for(const t in this.tuplets)if(this.tuplets.hasOwnProperty(t)){let e=this.vftuplets[t];e||(e=this.vftuplets[t]=[]);for(const i of this.tuplets[t]){const t=[],n=i[1];for(const e of n)t.push(e.vfStaveNote);if(t.length>1){const n=i[0],r=n.Notes[0][0].NormalNotes,o=n.Bracket||3===n.TupletLabelNumber&&this.rules.TripletsBracketed||3!==n.TupletLabelNumber&&this.rules.TupletsBracketed;let a=s.Tuplet.LOCATION_TOP;n.tupletLabelNumberPlacement===b.PlacementEnum.Below&&(a=s.Tuplet.LOCATION_BOTTOM),e.push(new s.Tuplet(t,{bracketed:o,location:a,notes_occupied:r,num_notes:n.TupletLabelNumber,ratioed:this.rules.TupletsRatioed}))}else u.default.debug("Warning! Tuplet with no notes! Trying to ignore, but this is a serious problem.")}}}layoutStaffEntry(t){}graphicalMeasureCreatedCalculations(){let t,e=[];const i=[];for(const n of this.staffEntries){t=!1,e=[];for(const r of n.graphicalVoiceEntries)if(r.parentVoiceEntry.IsGrace)e.push(r),i.push(r),t||(t=r.parentVoiceEntry.GraceSlur);else if(r.vfStaveNote=l.VexFlowConverter.StaveNote(r),e.length>0){const i=[];for(let t=0;t0&&(n.GraceSlash=!1);const s=l.VexFlowConverter.StaveNote(n);n.vfStaveNote=s,i.push(s)}const n=new s.GraceNoteGroup(i,t);r.vfStaveNote.addModifier(0,n),e=[]}}if(e.length>0)for(const t of e)t.vfStaveNote=l.VexFlowConverter.StaveNote(t),t.parentVoiceEntry.GraceAfterMainNote=!0;this.finalizeBeams(),this.finalizeTuplets();const n=this.getVoicesWithinMeasure();if(this.rules.RenderFingerings)for(const t of this.staffEntries)t.setModifierXOffsets();for(const t of n){if(!t)continue;this.vfVoices[t.VoiceId]=new s.Voice({beat_value:this.parentSourceMeasure.Duration.Denominator,num_beats:this.parentSourceMeasure.Duration.Numerator,resolution:s.RESOLUTION}).setMode(s.Voice.Mode.SOFT);const e=this.getRestFilledVexFlowStaveNotesPerVoice(t);for(const i of e){if(i.parentVoiceEntry&&i.parentVoiceEntry.IsGrace&&!i.parentVoiceEntry.GraceAfterMainNote)continue;const e=i;if(0===e.vfStaveNote.ticks.denominator)continue;if(0===i.notes.length||!i.notes[0]||!i.notes[0].sourceNote.PrintObject){this.vfVoices[t.VoiceId].addTickable(e.vfStaveNote);continue}const n=e.parentStaffEntry;if(n&&n.vfClefBefore){const t=new h([n.vfClefBefore]);e.vfStaveNote.getCategory&&"stavenotes"===e.vfStaveNote.getCategory()&&e.vfStaveNote.addModifier(0,t)}i.parentVoiceEntry&&this.rules.RenderFingerings&&(this.rules.FingeringPosition!==b.PlacementEnum.Left&&this.rules.FingeringPosition!==b.PlacementEnum.Right||this.createFingerings(i),this.createStringNumber(i)),this.createArpeggio(i),this.vfVoices[t.VoiceId].addTickable(e.vfStaveNote)}}this.setStemDirectionFromVexFlow();for(const t of i)this.createFingerings(t),this.createStringNumber(t),this.createArpeggio(t);this.createArticulations(),this.createOrnaments()}createArpeggio(t){if(t.parentVoiceEntry&&t.parentVoiceEntry.Arpeggio){const e=t.parentVoiceEntry.Arpeggio;if(t.notes&&t.notes.length>1){const i=l.VexFlowConverter.StrokeTypeFromArpeggioType(e.type),n=new s.Stroke(i,{all_voices:this.rules.ArpeggiosGoAcrossVoices});this.rules.RenderArpeggios&&t.vfStaveNote.addStroke(0,n)}else u.default.debug(`[OSMD] arpeggio in measure ${this.MeasureNumber} could not be drawn.\n voice entry had less than two notes, arpeggio is likely between voice entries, not currently supported in Vexflow.`)}}setStemDirectionFromVexFlow(){for(const t of this.staffEntries)for(const e of t.graphicalVoiceEntries)for(const t of e.notes){const i=t.vfnote;if(i&&i[0])switch(i[0].getStemDirection()){case s.Stem.UP:e.parentVoiceEntry.StemDirection=f.StemDirectionType.Up;break;case s.Stem.DOWN:e.parentVoiceEntry.StemDirection=f.StemDirectionType.Down}}}createArticulations(){for(let t=0,e=this.staffEntries.length;t1||t.parentStaffEntry.graphicalVoiceEntries.length>1?l=s.StaveModifier.Position.LEFT:0===e.idInMusicSheet?(l=s.StaveModifier.Position.ABOVE,a=b.PlacementEnum.Above):(l=s.StaveModifier.Position.BELOW,a=b.PlacementEnum.Below)}const u=new s.FretHandFinger(o.value);if(u.setPosition(l),u.setOffsetX(h),a===b.PlacementEnum.Above||a===b.PlacementEnum.Below){const t=a===b.PlacementEnum.Above?-1:1,r=a===b.PlacementEnum.Above?n:i-1-n;if(this.rules.FingeringInsideStafflines&&i>1){const e=u.getWidth()/2,n=2.5*i;u.setOffsetY(t*(r+n)*e)}else if(!this.rules.FingeringInsideStafflines){const i=new s.StringNumber(o.value);i.radius=0,i.setPosition(l),i.setOffsetY(t*r*i.getWidth()*2/3),e.vfStaveNote.addModifier(n,i);continue}}e.vfStaveNote.addModifier(n,u)}}createStringNumber(t){if(!this.rules.RenderStringNumbersClassical)return;const e=t;t.notes.forEach(((i,n)=>{const r=i.sourceNote.StringInstruction;if(r){let o=r.value;switch(o){case"1":o="I";break;case"2":o="II";break;case"3":o="III";break;case"4":o="IV";break;case"5":o="V";break;case"6":o="VI"}const a=new s.StringNumber(o);a.radius=0;const l=-this.rules.StringNumberOffsetY;t.notes.length>1||t.parentStaffEntry.graphicalVoiceEntries.length>1?(a.setOffsetX(13*i.baseStringNumberXOffset),a.setPosition(s.Modifier.Position.RIGHT)):a.setPosition(s.Modifier.Position.ABOVE),a.setOffsetY(l),e.vfStaveNote.addModifier(n,a)}}))}lineTo(t,e){const i=new s.StaveConnector(t.getVFStave(),this.stave);i.setType(e),this.connectors.push(i)}getVFStave(){return this.stave}updateInstructionWidth(){let t=0,e=0;const i=this.stave.getModifiers();for(const n of i)n.getPosition()===v.BEGIN?t+=n.getWidth()+n.getPadding(void 0):n.getPosition()===v.END&&(e+=n.getWidth()+n.getPadding(void 0));this.beginInstructionsWidth=(null!=t?t:0)/c.unitInPixels,this.endInstructionsWidth=(null!=e?e:0)/c.unitInPixels}addStaveTie(t,e){this.vfTies.push(t),e.vfTie=t}}var v;e.VexFlowMeasure=S,function(t){t[t.LEFT=1]="LEFT",t[t.RIGHT=2]="RIGHT",t[t.ABOVE=3]="ABOVE",t[t.BELOW=4]="BELOW",t[t.BEGIN=5]="BEGIN",t[t.END=6]="END"}(v=e.StavePositionEnum||(e.StavePositionEnum={}))},4405:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowMultiRestMeasure=void 0;var s=n(i(9124)).default.Flow;const r=i(7330);class o extends r.VexFlowMeasure{constructor(t,e=void 0,i=void 0){super(t,e,i),this.minimumStaffEntriesWidth=-1,i?this.rules=i.ParentMusicSystem.rules:e&&(this.rules=e.Rules),this.resetLayout(),this.multiRestElement=new s.MultiMeasureRest(e.multipleRestMeasures,{})}draw(t){var e,i,n,s,r;const o=t.openGroup();null===(e=null==o?void 0:o.classList)||void 0===e||e.add("vf-measure");const a=t.openGroup();null===(i=null==a?void 0:a.classList)||void 0===i||i.add("vf-stave"),null==a||a.setAttribute("id",null===(s=null===(n=this.stave)||void 0===n?void 0:n.attrs)||void 0===s?void 0:s.id),this.stave.setContext(t).draw(),t.closeGroup();const l=t.openGroup();null===(r=null==l?void 0:l.classList)||void 0===r||r.add("vf-voices"),this.multiRestElement.setStave(this.stave),this.multiRestElement.setContext(t),this.multiRestElement.draw(),t.closeGroup();for(const e of this.connectors)e.setContext(t).draw();return t.closeGroup(),o}format(){}getVoicesWithinMeasure(){return[]}getGraphicalVoiceEntriesPerVoice(t){return[]}getRestFilledVexFlowStaveNotesPerVoice(t){return[]}handleBeam(t,e){}handleTuplet(t,e){}finalizeBeams(){}finalizeTuplets(){}layoutStaffEntry(t){}graphicalMeasureCreatedCalculations(){}createArticulations(){}createOrnaments(){}createFingerings(t){}getVFStave(){return this.stave}}e.VexFlowMultiRestMeasure=o},8738:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowMusicSheetCalculator=void 0;const s=i(4040),r=i(8144),o=i(5309),a=i(5922),l=i(2942),h=n(i(9124));var u=h.default.Flow;const c=n(i(2043)),d=i(5820),p=i(5091),f=i(8720),m=i(9520),g=i(6351),b=i(556),y=i(1274),S=i(9876),v=i(9344),_=i(9667),x=i(41),E=i(7781),M=i(2478),w=i(8129),P=i(2343),T=i(3010),C=i(158),A=i(448),I=i(4462);class L extends s.MusicSheetCalculator{constructor(t){var e,i,n,o,a,u,c,d;super(),this.beamsNeedUpdate=!1,this.rules=t,s.MusicSheetCalculator.symbolFactory=new r.VexFlowGraphicalSymbolFactory,s.MusicSheetCalculator.TextMeasurer=new l.VexFlowTextMeasurer(this.rules),s.MusicSheetCalculator.stafflineNoteCalculator=new E.VexflowStafflineNoteCalculator(this.rules),"gonville"===(null===(e=this.rules.DefaultVexFlowNoteFont)||void 0===e?void 0:e.toLowerCase())?h.default.Flow.DEFAULT_FONT_STACK=[null===(i=h.default.Flow.Fonts)||void 0===i?void 0:i.Gonville,null===(n=h.default.Flow.Fonts)||void 0===n?void 0:n.Bravura,null===(o=h.default.Flow.Fonts)||void 0===o?void 0:o.Custom]:"petaluma"===(null===(a=this.rules.DefaultVexFlowNoteFont)||void 0===a?void 0:a.toLowerCase())&&(h.default.Flow.DEFAULT_FONT_STACK=[null===(u=h.default.Flow.Fonts)||void 0===u?void 0:u.Petaluma,null===(c=h.default.Flow.Fonts)||void 0===c?void 0:c.Gonville,null===(d=h.default.Flow.Fonts)||void 0===d?void 0:d.Bravura])}clearRecreatedObjects(){super.clearRecreatedObjects(),s.MusicSheetCalculator.stafflineNoteCalculator=new E.VexflowStafflineNoteCalculator(this.rules);for(const t of this.graphicalMusicSheet.MeasureList)for(const e of t)null==e||e.clean()}formatMeasures(){for(const t of this.graphicalMusicSheet.MeasureList)if(t&&t[0]){t[0].format();for(const e of t){for(const t of e.staffEntries)t.calculateXPosition();e.finalizeBeams()}}this.beamsNeedUpdate=!1}calculateMeasureXLayout(t){const e=[];for(const i of t)i&&e.push(i);if(0===e.length)return 0;t=e;const i=[],n=new u.Formatter({softmaxFactor:this.rules.SoftmaxFactorVexFlow});let r=t[0].staffEntries.length,o=1;for(const e of t){if(!e)continue;let t=0;for(const i of e.staffEntries)t+=i.setMaxAccidentals();e.parentSourceMeasure.ImplicitMeasure&&(r=Math.max(e.staffEntries.length,r),o=Math.max(e.staffEntries.length+t,o));const s=e.vfVoices,a=[];for(const t in s)s.hasOwnProperty(t)&&(a.push(s[t]),i.push(s[t]));0!==a.length?n.joinVoices(a):c.default.debug("Found a measure with no voices. Continuing anyway.",s)}let a=12;const l=t[0].parentSourceMeasure;if(i.length>0){a=n.preCalculateMinTotalWidth(i)/d.unitInPixels*this.rules.VoiceSpacingMultiplierVexflow+this.rules.VoiceSpacingAddendVexflow+.3*r,(null==l?void 0:l.ImplicitMeasure)&&(a=l.Duration.RealValue/l.ActiveTimeSignature.RealValue*a,r>1&&(a+=.3*o*1.5),a*=this.rules.PickupMeasureWidthMultiplier),s.MusicSheetCalculator.setMeasuresMinStaffEntriesWidth(t,a);const e=(t,e)=>{n.formatToStave(i,e.getVFStave())},h=(t,e)=>{n.formatToStave(i,e.getVFStave(),{align_rests:!0,context:void 0})};for(const i of t){if(this.rules.AlignRests===x.AlignRestOption.Never)i.formatVoices=e;else if(this.rules.AlignRests===x.AlignRestOption.Always)i.formatVoices=h;else if(this.rules.AlignRests===x.AlignRestOption.Auto){let t=!1;for(const e of i.staffEntries){let i=0,n=0;for(const s of e.graphicalVoiceEntries)if(s.parentVoiceEntry.IsGrace||s&&s.notes&&s.notes[0]&&s.notes[0].sourceNote&&s.notes[0].sourceNote.PrintObject&&i++,s&&s.notes&&s.notes[0]&&s.notes[0].sourceNote&&s.notes[0].sourceNote.isRest()&&s.notes[0].sourceNote.PrintObject&&n++,i>1&&n>=1){t=!0;break}if(t)break}i.formatVoices=t?h:e}if(i===t[0]){const t=i;t.formatVoices(a*d.unitInPixels,t)}}}for(const e of t)if(e)for(const t of e.staffEntries)t.calculateXPosition();for(const e of t){if(!e)continue;const t=e.vfVoices,i=[];for(const e in t)t.hasOwnProperty(e)&&i.push(t[e]);0!==i.length?n.joinVoices(i):c.default.debug("Found a measure with no voices. Continuing anyway.",t)}return a}calculateElongationFactor(t,e,i,n,s,r,o,a){let l=s,h=0;for(const u of t){const t=u.GraphicalLabel.Label.textAlignment;let c=o,d=a;if(u instanceof p.GraphicalLyricEntry&&u.ParentLyricWord){u.LyricsEntry.SyllableIndex>0&&(c=this.rules.BetweenSyllableMinimumDistance,y.TextAlignment.IsCenterAligned(t)&&(c+=1));const e=u.ParentLyricWord.GetLyricWord.Syllables;e.length>1&&u.LyricsEntry.SyllableIndex4&&(w*=1.1)):i[h]&&(w=b/S),E=Math.max(M,w),l=Math.max(l,E);let P=Math.max(b-S||0,0);i[h]&&(P+=i[h].cumulativeOverlap),i[h]={cumulativeOverlap:P,extend:u instanceof p.GraphicalLyricEntry&&u.LyricsEntry.extend,labelWidth:m,measureNumber:r,sourceNoteDuration:u instanceof p.GraphicalLyricEntry&&u.LyricsEntry&&u.LyricsEntry.Parent.Notes[0].Length,text:u instanceof p.GraphicalLyricEntry?u.LyricsEntry.Text:u.GraphicalLabel.Label.text,xPosition:g},h++}return l}calculateElongationFactorFromStaffEntries(t,e,i,n){let s=i;const r={},o={};for(const i of t)i.LyricsEntries.length>0&&(s=this.calculateElongationFactor(i.LyricsEntries,i,r,e,s,n,this.rules.HorizontalBetweenLyricsDistance,this.rules.LyricOverlapAllowedIntoNextMeasure)),i.graphicalChordContainers.length>0&&(s=this.calculateElongationFactor(i.graphicalChordContainers,i,o,e,s,n,this.rules.ChordSymbolXSpacing,this.rules.ChordOverlapAllowedIntoNextMeasure));return s}calculateMeasureWidthFromStaffEntries(t,e){var i;let n=1;if(!(null===(i=window.GYM)||void 0===i?void 0:i.multitrack))for(const i of t)i&&0!==i.staffEntries.length&&(n=this.calculateElongationFactorFromStaffEntries(i.staffEntries,e,n,i.MeasureNumber),n=1);return n=Math.min(n,this.rules.MaximumLyricsElongationFactor),e*n}createGraphicalTie(t,e,i,n,s){return new o.GraphicalTie(t,n,s)}updateStaffLineBorders(t){t.SkyBottomLineCalculator.updateStaffLineBorders()}graphicalMeasureCreatedCalculations(t){t.rules=this.rules,t.graphicalMeasureCreatedCalculations()}layoutVoiceEntry(t,e,i,n){for(let t=0;t=2&&(d=h.vfnote[0],f=h.vfnote[1]);let m=0;if(c&&c.vfnote&&c.vfnote.length>=2&&(p=c.vfnote[0],m=c.vfnote[1]),e){if(d){const e=new u.StaveTie({first_indices:[f],first_note:d}),i=h.parentVoiceEntry.parentStaffEntry.parentMeasure;if(p){"w"===p.getDuration()&&(null===(s=null===(n=p.keyProps)||void 0===n?void 0:n[0])||void 0===s?void 0:s.line)>=3&&p.setStemDirection(-1);let t=(null===(r=window.GYM)||void 0===r?void 0:r.tieDirection)||0;1===Math.abs(t)&&((null===(a=null===(o=p.keyProps)||void 0===o?void 0:o[0])||void 0===a?void 0:a.line)>=3?p.setStemDirection(-t):p.setStemDirection(t)),null==e||e.setDirection(p.getStemDirection())}if(i.vfTies.length>0){const t=i.vfTies[0].direction;null==e||e.setDirection(t?-t:1)}i.addStaveTie(e,t)}if(p){const e=new u.StaveTie({last_indices:[m],last_note:p}),i=c.parentVoiceEntry.parentStaffEntry.parentMeasure;if(i.vfTies.length>0){const t=i.vfTies[0].direction;null==e||e.setDirection(t?-t:1)}i.addStaveTie(e,t)}}else if(d||p){let e;if(i)if("S"===t.Tie.Type){const i=t.StartNote.sourceNote,n=t.EndNote.sourceNote;let s=1;i.FretNumber>n.FretNumber&&(s=-1),e=new u.TabSlide({first_indices:[f],first_note:d,last_indices:[m],last_note:p},s)}else e=new u.TabTie({first_indices:[f],first_note:d,last_indices:[m],last_note:p},t.Tie.Type);else{e=new u.StaveTie({first_indices:[f],first_note:d,last_indices:[m],last_note:p});const i=t.Tie.getTieDirection(h.sourceNote);i===P.PlacementEnum.Below?e.setDirection(1):i===P.PlacementEnum.Above&&e.setDirection(-1);try{Math.abs((null==d?void 0:d.getTieRightX())-(null==p?void 0:p.getTieLeftX()))<10&&(e.render_options.first_x_shift=-3,e.render_options.last_x_shift=3)}catch(t){console.log(t)}}const n=c.parentVoiceEntry.parentStaffEntry.parentMeasure,s=(null===(l=window.GYM)||void 0===l?void 0:l.graceCustom)||!1;s&&e.setDirection(s.direction),n.addStaveTie(e,t)}}calculateDynamicExpressionsForMultiExpression(t,e,i){if(ethis.rules.MaxMeasureToDrawIndex)return;const n=t.AbsoluteTimestamp,s=this.graphicalMusicSheet.MeasureList[e],r=s[i].ParentStaffLine,o=s[i];if(!r)return;const a=this.getRelativePositionInStaffLineFromTimestamp(n,i,r,null==r?void 0:r.isPartOfMultiStaffInstrument());if(a.x<=0&&(a.x=o.beginInstructionsWidth+this.rules.RhythmRightMargin),t.InstantaneousDynamic){const e=new g.VexFlowInstantaneousDynamicExpression(t.InstantaneousDynamic,r,o);this.calculateGraphicalInstantaneousDynamicExpression(e,a,n),this.dynamicExpressionMap.set(n.RealValue,e.PositionAndShape)}if(t.StartingContinuousDynamic){const e=t.StartingContinuousDynamic,i=new v.VexFlowContinuousDynamicExpression(t.StartingContinuousDynamic,r,o.parentSourceMeasure);if(i.StartMeasure=o,!i.IsVerbal&&e.EndMultiExpression)try{this.calculateGraphicalContinuousDynamic(i,a),i.updateSkyBottomLine()}catch(t){}else i.IsVerbal?this.calculateGraphicalVerbalContinuousDynamic(i,a):c.default.warn("This continuous dynamic is not covered. measure"+t.SourceMeasureParent.MeasureNumber)}}createMetronomeMark(t,e){var i,n,s,r,o,a,l,h,u;const c=Math.max(t.ParentMultiTempoExpression.SourceMeasureParent.MeasureNumber-1,0),p=e||c,f=Math.max(t.StaffNumber-1,0),m=this.graphicalMusicSheet.MeasureList[p][f].getVFStave();let g="q";if(t.beatUnit){const e=M.NoteTypeHandler.getNoteDurationFromType(t.beatUnit);g=w.VexFlowConverter.durations(e,!1)[0]}let y=this.rules.MetronomeMarkYShift,S=!1;const v=[];if(t.parentMeasure){for(const e of t.parentMeasure.StaffLinkedExpressions)for(const t of e)t&&t instanceof P.UnknownExpression&&v.push(t);for(const e of t.parentMeasure.TempoExpressions){const n=(null===(i=e.InstantaneousTempo)||void 0===i?void 0:i.Enum)===_.TempoEnum.metronomeMark;if(!t.beatUnit&&e.InstantaneousTempo.beatUnit){const e=M.NoteTypeHandler.getNoteDurationFromType(t.beatUnit);g=w.VexFlowConverter.durations(e,!1)[0]}if(e.getPlacementOfFirstEntry()===P.PlacementEnum.Above&&!n){S=!0;break}}}S&&(y-=1.4);const x=null===(n=this.graphicalMusicSheet.MeasureList[0][0].ParentStaffLine)||void 0===n?void 0:n.SkyLine;let E=t.TempoInBpm,T="",C="",A="";for(const t of this.graphicalMusicSheet.MeasureList[p][f].parentSourceMeasure.TempoExpressions){if(C=t.CombinedExpressionsText,(0,b.isSpecialMark)(t.CombinedExpressionsText)){T=t.CombinedExpressionsText;break}if((0,b.isSpeedKeyword)(t.CombinedExpressionsText)||(0,b.isSpeedHiddenKeyword)(t.CombinedExpressionsText)){T=(0,b.formatSpeedKeyword)(t.CombinedExpressionsText),E=t.sourceMeasure.TempoInBPM,(0,b.isSpeedKeyword)(t.CombinedExpressionsText)&&(A=g);break}}const I={bpm:t.TempoInBpm,dots:t.dotted,duration:g,name:T};T&&(I.bpm=E/(I.dots?1.5:1),(0,b.isSpeedKeyword)(C)?I.duration=A:E!==b.SpeedTag[T]&&b.SpeedTag[T]||(I.duration=""));const L=(null===(r=null===(s=this.graphicalMusicSheet.MeasureList[p][f].vfVoices)||void 0===s?void 0:s[1])||void 0===r?void 0:r.boundingBox.y)||0;if(this.rules.MetronomeMarksDrawn){if(x){const t=(null===(a=null===(o=this.graphicalMusicSheet.MeasureList[0])||void 0===o?void 0:o[f])||void 0===a?void 0:a.ParentStaffLine).Measures.map((t=>t.MeasureNumber-1));if(L&&t.includes(p)&&((0,b.isSpeedKeyword)(C)||(0,b.isSpeedHiddenKeyword)(C))){const t=x.slice(0,9);let e=Math.min(...t);e=e<0?e-1:e,y+=e}t.includes(p)&&v.length?x[0]=Math.min(x[0],-4.5+y-4):x[0]=Math.min(x[0],-4.5+y)}m.options.line_config.reduce(((t,e)=>(e.visible&&t++,t)),0)<5&&(y-=2),m.setTempo(I,y*d.unitInPixels);let e=0;try{e+=(null===(u=null===(h=null===(l=this.graphicalMusicSheet.MeasureList[p][f])||void 0===l?void 0:l.vfVoices)||void 0===h?void 0:h[1])||void 0===u?void 0:u.getTickables())[t.parentMeasure.metronomeNoteIndex].getBoundingBox().getX()-m.getNoteStartX()}catch(t){}m.getModifiers()[m.getModifiers().length-1].setShiftX(e)}}calculateRehearsalMark(t){var e,i,n,s,r,o,a,l;const h=t.rehearsalExpression;if(!h)return;const u=null===(n=null===(i=null===(e=t.VerticalMeasureList)||void 0===e?void 0:e[0])||void 0===i?void 0:i.getVFStave)||void 0===n?void 0:n.call(i);if(!u)return;const c=-this.rules.RehearsalMarkYOffsetDefault-this.rules.RehearsalMarkYOffset;let d=this.rules.RehearsalMarkXOffsetDefault+this.rules.RehearsalMarkXOffset;t.IsSystemStartMeasure&&(d+=this.rules.RehearsalMarkXOffsetSystemStartMeasure);const p=this.rules.RehearsalMarkFontSize,f=u.getModifiers(),m=f.find((t=>"repetitions"===t.getCategory().toLocaleLowerCase()));if(m&&m.setShiftY(m.y_shift-10),u.setSection(h.label,c,d,p),null===(r=null===(s=t.VerticalMeasureList)||void 0===s?void 0:s[0])||void 0===r?void 0:r.ParentStaffLine.AbstractExpressions){const e=f.find((t=>"stavesection"===t.getCategory().toLocaleLowerCase()));for(let i of(null===(l=null===(a=null===(o=null==t?void 0:t.VerticalMeasureList)||void 0===o?void 0:o[0])||void 0===a?void 0:a.ParentStaffLine)||void 0===l?void 0:l.AbstractExpressions)||[])i instanceof I.GraphicalUnknownExpression&&(e&&(i.Label.PositionAndShape.RelativePosition.y-=.5),m&&(i.Label.PositionAndShape.RelativePosition.y-=1.7))}}calculateSingleOctaveShift(t,e,i,n){var s;const r=e.OctaveShiftStart,o=r.ParentStartMultiExpression.Timestamp,a=null===(s=r.ParentEndMultiExpression)||void 0===s?void 0:s.Timestamp,l=this.rules.MinMeasureToDrawIndex,h=this.rules.MaxMeasureToDrawIndex;let u,d,p=this.graphicalMusicSheet.MeasureList[i][n].ParentStaffLine;if(p||(p=this.graphicalMusicSheet.MeasureList[l][n].ParentStaffLine),u=r.ParentEndMultiExpression?this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(r.ParentEndMultiExpression.SourceMeasureParent,n):this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(n,!0),u.MeasureNumber>h+1&&(u=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(n,!0)),d=r.ParentEndMultiExpression?this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(r.ParentStartMultiExpression.SourceMeasureParent,n):this.graphicalMusicSheet.MeasureList[l][n],d.MeasureNumberh||u.parentSourceMeasure.measureListIndexh)return;let f=u.ParentStaffLine;if(f||(f=p),u&&p&&f){const t=new m.VexFlowOctaveShift(r,p.PositionAndShape);if(!t.startNote){let e;for(const t of d.staffEntries)if(t){e=t;break}if(!e)return;if(t.setStartNote(e),!t.startNote)return}if(!t.endNote){let e;for(let t=u.staffEntries.length-1;t>=0;t++)if(u.staffEntries[t]){e=u.staffEntries[t];break}if(t.setEndNote(e),!t.endNote)return}let e=d.findGraphicalStaffEntryFromTimestamp(o);e||(e=d.staffEntries[0]);let i=u.findGraphicalStaffEntryFromTimestamp(a);if(i||(i=u.staffEntries[u.staffEntries.length-1]),t.setStartNote(e),f!==p){t.endsOnDifferentStaffLine=!0;let s=p.Measures[p.Measures.length-1];void 0===s&&(s=u);const o=s.staffEntries[s.staffEntries.length-1];t.setEndNote(o);const a=f.ParentMusicSystem.Id-p.ParentMusicSystem.Id;if(a>0)for(let t=p.ParentMusicSystem.Id;th+1&&(u=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(n,!0)),r.ParentEndMultiExpression?d=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(r.ParentStartMultiExpression.SourceMeasureParent,n):(d=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(r.ParentStartMultiExpression.SourceMeasureParent,n),d||(d=this.graphicalMusicSheet.MeasureList[l][n])),d.MeasureNumberh||u.parentSourceMeasure.measureListIndexh)return;let f=u.ParentStaffLine;if(f||(f=p),u&&p&&f){let t=!1;p!==f&&(t=!0);const e=new T.VexFlowPedal(r,p.PositionAndShape,!1,t);let i=d.findGraphicalStaffEntryFromTimestamp(o);i||(i=d.staffEntries[0]);let s=u.findGraphicalStaffEntryFromTimestamp(a);if(s||(s=u.staffEntries[u.staffEntries.length-1]),!e.setStartNote(i))return;if(f!==p)if(e.pedalSymbol===C.MusicSymbol.PEDAL_SYMBOL){e.setEndNote(s),e.setEndMeasure(u),e.ReleaseText=" ",e.CalculateBoundingBox(),this.calculatePedalSkyBottomLine(e.startVfVoiceEntry,e.endVfVoiceEntry,e,p);const t=f.Measures[0],i=new T.VexFlowPedal(r,t.PositionAndShape),n=t.staffEntries[0];if(!i.setStartNote(n))return;i.setEndNote(s),e.setEndMeasure(u),f.Pedals.push(i),i.CalculateBoundingBox(),i.DepressText=" ",this.calculatePedalSkyBottomLine(i.startVfVoiceEntry,i.endVfVoiceEntry,i,f)}else{let t=p.Measures[p.Measures.length-1];void 0===t&&(t=u);const i=t.staffEntries[t.staffEntries.length-1];e.setEndNote(i),e.setEndMeasure(u),e.ChangeEnd=!1;const o=f.ParentMusicSystem.Id-p.ParentMusicSystem.Id;if(o>0){let t=1;for(let i=p.ParentMusicSystem.Id;iu+1&&(d=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(n,!0)),p=o.ParentEndMultiExpression?this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(o.ParentStartMultiExpression.SourceMeasureParent,n):this.graphicalMusicSheet.MeasureList[h][n],p.MeasureNumberu||d.parentSourceMeasure.measureListIndexu)return;let m=d.ParentStaffLine;if(m||(m=f),d&&f&&m){const t=new A.VexflowVibratoBracket(o,f.PositionAndShape,p.ParentStaff.isTab);let e=p.findGraphicalStaffEntryFromTimestamp(a);e||(e=p.staffEntries[0]);let i=d.findGraphicalStaffEntryFromTimestamp(l);if(i||(i=d.staffEntries[d.staffEntries.length-1]),t.setStartNote(e),m!==f){let e=f.Measures[f.Measures.length-1];void 0===e&&(e=d);const s=e.staffEntries[e.staffEntries.length-1];if(t.setEndNote(s),m.ParentMusicSystem.Id-f.ParentMusicSystem.Id>0)for(let t=f.ParentMusicSystem.Id;tf){const t=f;f=m,m=t}n.SkyBottomLineCalculator.updateBottomLineInRange(m,f,g+t)}for(const t of n.Pedals){const e=t,i=e.getPedalMarking();if(g>i.line+3+(n.StaffLines.length-1)){const t=i.render_options.text_margin_right/10;let s,l=e.startVfVoiceEntry.PositionAndShape.AbsolutePosition.x-t;e.setLine(g-3-(n.StaffLines.length-1));let h=null===(r=e.endVfVoiceEntry)||void 0===r?void 0:r.PositionAndShape;if(h||(h=e.endMeasure.PositionAndShape),e.EndSymbolPositionAndShape){const e=c.render_options.glyph_point_size/20;s=l+3.4;const i=h.AbsolutePosition.x-t,r=i+1.5;n.SkyBottomLineCalculator.updateBottomLineInRange(l,s,g+e),n.SkyBottomLineCalculator.updateBottomLineInRange(i,r,g+e)}else{const r=i.render_options.bracket_height/10;if(i.EndsStave)s=h.AbsolutePosition.x+h.Size.width-t;else switch(c.style){case u.BRACKET_OPEN_END:case u.BRACKET_OPEN_BOTH:case u.MIXED_OPEN_END:s=h.AbsolutePosition.x+h.BorderRight-t;break;default:s=h.AbsolutePosition.x+h.BorderLeft-t}const d=null===(a=null===(o=e.endVfVoiceEntry)||void 0===o?void 0:o.parentStaffEntry)||void 0===a?void 0:a.vfClefBefore;if(d&&(s+=d.getWidth()/10),l>s){const t=l;l=s,s=t}n.SkyBottomLineCalculator.updateBottomLineInRange(l,s,g+r)}}}}calculateOctaveShiftSkyBottomLine(t,e,i,n){if(!e)return void c.default.warn("octaveshift: no endStaffEntry");let s=t.PositionAndShape.Size.width,r=e.PositionAndShape.Size.width;t.hasOnlyRests()?s=-s:s/=2,e.hasOnlyRests()?r*=2:r/=2,t===e&&(r*=2);const o=t.PositionAndShape.AbsolutePosition.x-s,a=e.PositionAndShape.AbsolutePosition.x+r;i.PositionAndShape.Size.width=o-a;const l=i.getTextBracket(),h=l.font.size/10;if(l.position===u.TextBracket.Positions.TOP){const t=Math.ceil(n.SkyBottomLineCalculator.getSkyLineMinInRange(o,a));if(t===1/0)return;l.start.getStave().options.top_text_position=Math.abs(t),n.SkyBottomLineCalculator.updateSkyLineInRange(o,a,t-2*h)}else{const i=n.SkyBottomLineCalculator.getBottomLineMaxInRange(o,a);if(i===1/0)return;l.start.getStave().options.bottom_text_position=i,t.parentMeasure!==e.parentMeasure&&(l.stop.getStave().options.bottom_text_position=i),n.SkyBottomLineCalculator.updateBottomLineInRange(o,a,i+1.5*h)}}calculateWordRepetitionInstruction(t,e){let i;const n=this.graphicalMusicSheet.MeasureList[e];for(let t=0,e=n.length;t{t.updateSkyBottomLine()}))}catch(t){}}handleTiedGraphicalNote(t,e,i,n,s,r,o,a){}handleBeam(t,e,i){t.parentVoiceEntry.parentStaffEntry.parentMeasure.handleBeam(t,e)}handleVoiceEntryLyrics(t,e,i){t.LyricsEntries.forEach(((t,n)=>{const s=new p.GraphicalLyricEntry(n,e,this.rules.LyricsHeight,this.rules.StaffHeight);if(e.LyricsEntries.push(s),s.GraphicalLabel.setLabelPositionAndShapeBorders(),n.Word){const t=n.Word.Syllables.indexOf(n);let e=i.indexOf(n.Word);if(-1===e&&(i.push(n.Word),e=i.indexOf(n.Word)),0===this.graphicalLyricWords.length||e>this.graphicalLyricWords.length-1){const e=new f.GraphicalLyricWord(n.Word);s.ParentLyricWord=e,e.GraphicalLyricsEntries[t]=s,this.graphicalLyricWords.push(e)}else{const n=this.graphicalLyricWords[e];s.ParentLyricWord=n,n.GraphicalLyricsEntries[t]=s,n.isFilled()&&(i.splice(e,1),this.graphicalLyricWords.splice(this.graphicalLyricWords.indexOf(n),1))}}}))}handleVoiceEntryOrnaments(t,e,i){}handleVoiceEntryArticulations(t,e,i){}handleVoiceEntryTechnicalInstructions(t,e,i){}handleTuplet(t,e,i){t.parentVoiceEntry.parentStaffEntry.parentMeasure.handleTuplet(t,e)}findIndexGraphicalSlurFromSlur(t,e){for(let i=0;i=0){const t=e[i];-1===t.staffEntries.indexOf(n)&&t.staffEntries.push(n),e.splice(i,1)}}}for(const t of e)-1===t.staffEntries.indexOf(n)&&t.staffEntries.push(n)}}for(const t of this.musicSystems)for(const e of t.StaffLines){const t=e.GraphicalSlurs.sort(S.GraphicalSlur.Compare);for(const e of t)e.slur.isCrossed()||e.calculateCurve(this.rules)}}}e.VexFlowMusicSheetCalculator=L},5820:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowMusicSheetDrawer=e.unitInPixels=void 0;const s=n(i(9124)),r=i(1494),o=i(3278),a=i(9086),l=i(2942),h=i(8155),u=i(3748),c=i(5277),d=i(9428),p=n(i(2043)),f=i(374),m=i(7459),g=i(4462);e.unitInPixels=10;class b extends r.MusicSheetDrawer{constructor(t=new m.DrawingParameters){super(new l.VexFlowTextMeasurer(t.Rules),t),this.backends=[],this.zoom=1,this.pageIdx=0,this.getDotId=(t,e)=>e?String(t.Label.PositionAndShape.RelativePosition[e]):String(t.Label.PositionAndShape.RelativePosition.x)+String(t.Label.PositionAndShape.RelativePosition.y),this.hasDot=(t,e,i,n)=>{const s=e||Object.values(n);for(const e of s){if(i)return t.x===e.x&&t.y===e.y;if(t.x===e.x)return!0}return!1}}get Zoom(){return this.zoom}get Backends(){return this.backends}initializeBackendForPage(t){this.backend=this.backends[t.PageNumber-1]}drawSheet(t){var i,n,r;"gonville"===this.rules.DefaultVexFlowNoteFont&&(s.default.Flow.DEFAULT_FONT_STACK=[null===(i=s.default.Flow.Fonts)||void 0===i?void 0:i.Gonville,null===(n=s.default.Flow.Fonts)||void 0===n?void 0:n.Bravura,null===(r=s.default.Flow.Fonts)||void 0===r?void 0:r.Custom]),s.default.Flow.STAVE_LINE_THICKNESS=this.rules.StaffLineWidth*e.unitInPixels,s.default.Flow.STEM_WIDTH=this.rules.StemWidth*e.unitInPixels,s.default.Flow.DEFAULT_NOTATION_FONT_SCALE=this.rules.VexFlowDefaultNotationFontScale,s.default.Flow.DEFAULT_TAB_FONT_SCALE=this.rules.VexFlowDefaultTabFontScale,this.pageIdx=0;for(const e of t.MusicPages){if(e.PageNumber>this.rules.MaxPageToDrawNumber)break;const t=this.backends[this.pageIdx];t.graphicalMusicPage=e,t.scale(this.zoom),this.pageIdx+=1}this.pageIdx=0,this.backend=this.backends[0],super.drawSheet(t)}drawPage(t){t&&(this.backend=this.backends[t.PageNumber-1],super.drawPage(t),this.pageIdx+=1)}clear(){for(const t of this.backends)t.clear()}setZoom(t){this.zoom=t}calculatePixelDistance(t){return t*e.unitInPixels}drawStaffLine(t){const e=this.backend.getContext().openGroup();e&&e.classList.add("staffline"),super.drawStaffLine(t);const i=t.PositionAndShape.AbsolutePosition;this.rules.RenderSlurs&&this.drawSlurs(t,i),this.backend.getContext().closeGroup()}drawSlurs(t,e){var i,n,s,r;const o=null===(i=window.GYM)||void 0===i?void 0:i.vfcurveItem;for(let i=0;i(!t.index||t.index===i)&&t.MeasureNumberXML==a.staffEntries[a.staffEntries.length-1].parentMeasure.MeasureNumber));t&&(a.bezierEndControlPt.y+=(null===(n=null==t?void 0:t.bezierEndControlPt)||void 0===n?void 0:n.y)?t.bezierEndControlPt.y:0,a.bezierEndPt.y+=(null===(s=null==t?void 0:t.bezierEndPt)||void 0===s?void 0:s.y)?t.bezierEndPt.y:0,a.bezierStartControlPt.y+=(null===(r=null==t?void 0:t.bezierStartControlPt)||void 0===r?void 0:r.y)?t.bezierStartControlPt.y:0)}catch(t){console.log(t)}this.drawSlur(a,e)}}}drawSlur(t,e){const i=[];let n,s,r,o;"jianpu"===this.rules.DYMusicScoreType?((t.placement>0||t.bezierStartPt.y>0)&&(t.bezierStartPt.y=-.8,t.bezierStartControlPt.y=-2.5),n=new a.PointF2D(t.bezierStartPt.x+e.x,t.bezierStartPt.y+e.y),s=new a.PointF2D(t.bezierStartControlPt.x+e.x,t.bezierStartControlPt.y+e.y),r=new a.PointF2D(t.bezierEndControlPt.x+e.x,t.bezierStartControlPt.y+e.y),o=new a.PointF2D(t.bezierEndPt.x+e.x,t.bezierStartPt.y+e.y)):(n=new a.PointF2D(t.bezierStartPt.x+e.x,t.bezierStartPt.y+e.y),s=new a.PointF2D(t.bezierStartControlPt.x+e.x,t.bezierStartControlPt.y+e.y),r=new a.PointF2D(t.bezierEndControlPt.x+e.x,t.bezierEndControlPt.y+e.y),o=new a.PointF2D(t.bezierEndPt.x+e.x,t.bezierEndPt.y+e.y)),i.push(this.applyScreenTransformation(n)),i.push(this.applyScreenTransformation(s)),i.push(this.applyScreenTransformation(r)),i.push(this.applyScreenTransformation(o)),t.placement===u.PlacementEnum.Above?(n.y-=.05,s.y-=.3,r.y-=.3,o.y-=.05):(n.y+=.05,s.y+=.3,r.y+=.3,o.y+=.05),i.push(this.applyScreenTransformation(n)),i.push(this.applyScreenTransformation(s)),i.push(this.applyScreenTransformation(r)),i.push(this.applyScreenTransformation(o)),t.SVGElement=this.backend.renderCurve(i)}drawMeasure(t){t.setAbsoluteCoordinates(t.PositionAndShape.AbsolutePosition.x*e.unitInPixels,t.PositionAndShape.AbsolutePosition.y*e.unitInPixels);const i=this.backend.getContext();try{t.draw(i)}catch(t){p.default.warn("VexFlowMusicSheetDrawer.drawMeasure",t)}for(const e of t.staffEntries)this.drawStaffEntry(e)}drawLine(t,i,n="#FF0000FF",s=.2){return t=this.applyScreenTransformation(t),i=this.applyScreenTransformation(i),this.backend.renderLine(t,i,n,s*e.unitInPixels)}DrawOverlayLine(t,i,n,s="#FF0000FF",r=.2){if(!n.PageNumber||n.PageNumber>this.backends.length||n.PageNumber<1)return void console.log("VexFlowMusicSheetDrawer.drawOverlayLine: invalid page number / music page number doesn't correspond to an existing backend.");const o=n.PageNumber-1,a=this.backends[o];return t=this.applyScreenTransformation(t),i=this.applyScreenTransformation(i),a.renderLine(t,i,s,r*e.unitInPixels)}drawSkyLine(t){const e=t.PositionAndShape.AbsolutePosition,i=t.PositionAndShape.Size.width;this.drawSampledLine(t.SkyLine,e,i)}drawBottomLine(t){const e=new a.PointF2D(t.PositionAndShape.AbsolutePosition.x,t.PositionAndShape.AbsolutePosition.y),i=t.PositionAndShape.Size.width;this.drawSampledLine(t.BottomLine,e,i,"#0000FFFF")}drawSampledLine(t,e,i,n="#FF0000FF"){const s=[];let r=0;for(let e=0;e0){const e=this.rules.SamplingUnit;let r,l,h=new a.PointF2D(o.x,o.y),u=new a.PointF2D(s[0]/e+o.x,o.y);this.drawLine(h,u,n),t[0]>=0&&(r=new a.PointF2D(s[0]/e+o.x,o.y),l=new a.PointF2D(s[0]/e+o.x,o.y+t[s[0]]),this.drawLine(r,l,n));for(let i=1;i0)for(const e of t.FingeringEntries)e.SVGNode=this.drawLabel(e,h.GraphicalLayers.Notes);if(void 0!==t.graphicalChordContainers&&t.graphicalChordContainers.length>0)for(const e of t.graphicalChordContainers){const t=e.GraphicalLabel;t.SVGNode=this.drawLabel(t,h.GraphicalLayers.Notes)}this.rules.RenderLyrics&&t.LyricsEntries.length>0&&this.drawLyrics(t.LyricsEntries,h.GraphicalLayers.Notes)}drawLyrics(t,e){t.forEach((t=>{const i=t.GraphicalLabel;i.SVGNode=this.drawLabel(i,e)}))}drawInstrumentBrace(t,e){t.draw(this.backend.getContext())}drawGroupBracket(t,e){t.draw(this.backend.getContext())}drawOctaveShifts(t){for(const e of t.OctaveShifts)if(e){const t=e,i=this.backend.getContext(),n=t.getTextBracket();n.setContext(i);try{n.draw()}catch(t){p.default.warn(t)}}}drawPedals(t){for(const e of t.Pedals)if(e){const t=e,i=this.backend.getContext(),n=t.getPedalMarking();n.setContext(i),n.draw()}}drawWavyLines(t){for(const e of t.WavyLines)if(e){const t=e,i=this.backend.getContext(),n=t.getVibratoBracket();n.setContext(i),n.draw()}}getMaxExpressionsYAndDots(t){var e,i;const n=[];let s=0;for(const e of t.measures)n.push(e.measureNumber);const r={},o={},a={};for(const e of t.AbstractExpressions)if(e instanceof g.GraphicalUnknownExpression&&n.includes(e.parentMeasure.MeasureNumber)){const t=this.getDotId(e),i=this.getDotId(e,"x");o[t]||(o[t]=[]),a[i]||(a[i]=[]),this.hasDot(e.Label.PositionAndShape.RelativePosition,o[t],!0)||(o[t].push(e.Label.PositionAndShape.RelativePosition),a[i].push(e.Label.PositionAndShape.RelativePosition)),r[t]=e.Label.PositionAndShape.RelativePosition}let l=0;for(const r of t.AbstractExpressions){const t=null===(e=r.parentMeasure)||void 0===e?void 0:e.MeasureNumber;if(r instanceof g.GraphicalUnknownExpression&&n.includes(t)){const e=null===(i=r.parentMeasure.verticalMeasureList[0])||void 0===i?void 0:i.stave,n=(null==e?void 0:e.end_x)-(null==e?void 0:e.x),o=this.getDotId(r,"x");if(1===(a[o]||[]).length&&l!==t){const t=r.Label.PositionAndShape.AbsolutePosition.y;s=0===s?t:Math.min(s,t)}1!==(a[o]||[]).length&&n/10Number.EPSILON){let e=Math.min(...t.Lines.map((t=>t.Start.x))),i=Math.min(...t.Lines.map((t=>t.Start.y)));t.Lines[0].Start.x=e,t.Lines[1].Start.x=e,t.Lines[0].Start.y=i+this.rules.WedgeOpeningLength/2,t.Lines[1].Start.y=i+2*this.rules.WedgeOpeningLength,t.Lines[0].End.y+=this.rules.WedgeOpeningLength/2,t.Lines[1].End.y+=this.rules.WedgeOpeningLength}}catch(t){}const e=this.backend.getContext();e.openGroup("lineGroup");for(const e of t.Lines){const i=new a.PointF2D(t.ParentStaffLine.PositionAndShape.AbsolutePosition.x+e.Start.x,t.ParentStaffLine.PositionAndShape.AbsolutePosition.y+e.Start.y),n=new a.PointF2D(t.ParentStaffLine.PositionAndShape.AbsolutePosition.x+e.End.x,t.ParentStaffLine.PositionAndShape.AbsolutePosition.y+e.End.y);this.drawLine(i,n,"black",e.Width)}e.closeGroup()}}renderLabel(t,e,i){return this._renderLabel(t,i)}_renderLabel(t,i){var n;if(!t.Label.print)return;const s=t.Label.fontHeight*e.unitInPixels,{font:r}=t.Label;let o;this.rules.ColoringEnabled&&(o=t.Label.colorDefault,t.Label.color&&(o=t.Label.color.toString()),o||(o=this.rules.DefaultColorLabel));let l,{fontStyle:h,fontFamily:u}=t.Label;h||(h=this.rules.DefaultFontStyle),u||(u=this.rules.DefaultFontFamily);for(let e=0;e<(null===(n=t.TextLines)||void 0===n?void 0:n.length);e++){const n=t.TextLines[e],u=this.calculatePixelDistance(n.xOffset),c=new a.PointF2D(i.ScreenPosition.x+u,i.ScreenPosition.y),d=this.backend.renderText(s,h,r,n.text,i.FontHeightInPixel,c,o,t.Label.fontFamily);l?l.appendChild(d):l=d,i.ScreenPosition.y=i.ScreenPosition.y+i.FontHeightInPixel,t.TextLines.length>1&&(i.ScreenPosition.y+=this.rules.SpacingBetweenTextLines)}return l}renderRectangle(t,e,i,n,s){return this.backend.renderRectangle(t,i,n,s)}applyScreenTransformation(t){return new a.PointF2D(t.x*e.unitInPixels,t.y*e.unitInPixels)}applyScreenTransformationForRect(t){return new o.RectangleF2D(t.x*e.unitInPixels,t.y*e.unitInPixels,t.width*e.unitInPixels,t.height*e.unitInPixels)}}e.VexFlowMusicSheetDrawer=b},8494:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowMusicSystem=void 0;const n=i(7142),s=i(6894),r=i(7771),o=i(8129),a=i(5575),l=i(8939);class h extends n.MusicSystem{constructor(t,e){super(t),this.rules=e}calculateBorders(t){if(0===this.staffLines.length)return;const e=this.calcBracketsWidth();this.boundingBox.BorderLeft=-e,this.boundingBox.BorderMarginLeft=-e,this.boundingBox.XBordersHaveBeenSet=!0;const i=this.staffLines[0].SkyBottomLineCalculator.getSkyLineMin();this.boundingBox.BorderTop=i,this.boundingBox.BorderMarginTop=i;const n=this.staffLines[this.staffLines.length-1],s=n.SkyBottomLineCalculator.getBottomLineMax()+n.PositionAndShape.RelativePosition.y;this.boundingBox.BorderBottom=s,this.boundingBox.BorderMarginBottom=s,this.boundingBox.XBordersHaveBeenSet=!0,this.boundingBox.YBordersHaveBeenSet=!0}createSystemLine(t,e,i,n,a,l,h=void 0){const u=l;let c=!1;if(h&&(c=!0,h.lineTo(l,o.VexFlowConverter.line(i,n)),h.addMeasureLine(i,n),i===s.SystemLinesEnum.DotsBoldBoldDots)){const t=h.ParentStaffLine.Measures.indexOf(h)+1,e=h.ParentStaffLine.Measures[t],i=l.ParentStaffLine.Measures[t];e&&i&&(e.lineTo(i,o.VexFlowConverter.line(s.SystemLinesEnum.BoldThinDots,n)),e.addMeasureLine(s.SystemLinesEnum.BoldThinDots,n))}return u&&u.addMeasureLine(i,n,c),new r.SystemLine(i,n,this,l,h)}createInstrumentBracket(t,e){const i=t,n=e,s=new l.VexFlowInstrumentBrace(i,n);this.InstrumentBrackets.push(s)}createGroupBracket(t,e,i){const n=t,s=e;if(0===i){const t=new a.VexFlowInstrumentBracket(n,s,i);this.GroupBrackets.push(t)}else{const t=new l.VexFlowInstrumentBrace(n,s,i);this.GroupBrackets.push(t)}}}e.VexFlowMusicSystem=h},9520:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowOctaveShift=void 0;var s=n(i(9124)).default.Flow;const r=i(873),o=i(5853),a=n(i(2043));class l extends r.GraphicalOctaveShift{constructor(t,e){switch(super(t,e),t.Type){case o.OctaveEnum.VA8:this.position=s.TextBracket.Positions.TOP,this.supscript="va",this.text="8";break;case o.OctaveEnum.MA15:this.position=s.TextBracket.Positions.TOP,this.supscript="ma",this.text="15";break;case o.OctaveEnum.VB8:this.position=s.TextBracket.Positions.BOTTOM,this.supscript="vb",this.text="8";break;case o.OctaveEnum.MB15:this.position=s.TextBracket.Positions.BOTTOM,this.supscript="mb",this.text="15";break;default:a.default.error("Unknown or NONE octaveshift. This should not be called!")}}setStartNote(t){for(const e of t.graphicalVoiceEntries){const t=e;if(null==t?void 0:t.vfStaveNote)return this.startNote=t.vfStaveNote,!0}return!1}setEndNote(t){for(const e of t.graphicalVoiceEntries){const t=e;if(null==t?void 0:t.vfStaveNote)return this.endNote=t.vfStaveNote,!0}return!1}getTextBracket(){return new s.TextBracket({position:this.position,start:this.startNote,stop:this.endNote,superscript:this.supscript,text:this.text})}}e.VexFlowOctaveShift=l},3010:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowPedal=void 0;const s=n(i(9124)),r=i(8911),o=i(4082),a=i(158);class l extends o.GraphicalPedal{constructor(t,e,i=!1,n=!1){switch(super(t,e),this.vfStyle=s.default.Flow.PedalMarking.Styles.BRACKET,this.ChangeBegin=!1,this.ChangeEnd=!1,this.line=-3,this.EndSymbolPositionAndShape=void 0,this.ChangeBegin=t.ChangeBegin,this.ChangeEnd=t.ChangeEnd,this.pedalSymbol){case a.MusicSymbol.PEDAL_SYMBOL:this.vfStyle=s.default.Flow.PedalMarking.Styles.TEXT,this.EndSymbolPositionAndShape=new r.BoundingBox(this,e);break;case a.MusicSymbol.PEDAL_MIXED:this.vfStyle=i&&n?s.default.Flow.PedalMarking.Styles.BRACKET_OPEN_BOTH:i?s.default.Flow.PedalMarking.Styles.BRACKET_OPEN_BEGIN:n?s.default.Flow.PedalMarking.Styles.MIXED_OPEN_END:s.default.Flow.PedalMarking.Styles.MIXED;break;case a.MusicSymbol.PEDAL_BRACKET:default:this.vfStyle=i&&n?s.default.Flow.PedalMarking.Styles.BRACKET_OPEN_BOTH:i?s.default.Flow.PedalMarking.Styles.BRACKET_OPEN_BEGIN:n?s.default.Flow.PedalMarking.Styles.BRACKET_OPEN_END:s.default.Flow.PedalMarking.Styles.BRACKET}}setStartNote(t){if(!t)return!1;for(const e of t.graphicalVoiceEntries){const t=e;if(null==t?void 0:t.vfStaveNote)return this.startNote=t.vfStaveNote,this.startVfVoiceEntry=t,!0}return!1}setEndNote(t){if(!t)return!1;for(const e of t.graphicalVoiceEntries){const t=e;if(null==t?void 0:t.vfStaveNote)return this.endNote=t.vfStaveNote,this.endVfVoiceEntry=t,!0}return!1}setEndMeasure(t){this.endMeasure=t}CalculateBoundingBox(){}setLine(t){this.line=t}getPedalMarking(){var t,e,i,n;const r=new s.default.Flow.PedalMarking([this.startNote,this.endNote]);return this.endMeasure&&r.setEndStave(this.endMeasure.getVFStave()),r.setStyle(this.vfStyle),r.setLine(this.line),r.setCustomText(this.DepressText,this.ReleaseText),(null===(t=this.endVfVoiceEntry)||void 0===t?void 0:t.parentStaffEntry)!==(null===(n=null===(i=null===(e=this.endVfVoiceEntry)||void 0===e?void 0:e.parentStaffEntry)||void 0===i?void 0:i.parentMeasure)||void 0===n?void 0:n.staffEntries.last())&&this.endVfVoiceEntry||(r.EndsStave=!0),r.ChangeBegin=this.ChangeBegin,r.ChangeEnd=this.ChangeEnd,r}}e.VexFlowPedal=l},8041:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowSlur=e.CurvePositionEnum=void 0;var s,r=n(i(9124)).default.Flow;!function(t){t[t.NEAR_HEAD=1]="NEAR_HEAD",t[t.NEAR_TOP=2]="NEAR_TOP"}(s=e.CurvePositionEnum||(e.CurvePositionEnum={}));class o{constructor(t){this.vfStartNote=void 0,this.vfEndNote=void 0,this.parentSlur=t}static createFromVexflowSlur(t){return new o(t.parentSlur)}get vfSlur(){return this.parentSlur}curve_Options(){return{cps:[{x:0,y:10},{x:0,y:10}],invert:!1,position:s.NEAR_TOP,position_end:s.NEAR_TOP,spacing:2,thickness:2,x_shift:0,y_shift:10}}createVexFlowCurve(){this.vfCurve=new r.Curve(this.vfStartNote,this.vfEndNote,void 0)}}e.VexFlowSlur=o},9252:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowStaffEntry=void 0;var s=n(i(9124)).default.Flow;const r=i(3023),o=i(5820),a=i(8640),l=i(6550);class h extends r.GraphicalStaffEntry{constructor(t,e,i){super(t,e,i)}calculateXPosition(){const t=this.parentMeasure.getVFStave();let e=0;for(const i of this.graphicalVoiceEntries)if(i.vfStaveNote){if(i.vfStaveNote.setStave(t),t&&t.getLines&&1===t.getLines()&&i.vfStaveNote.getStemDirection()<0&&(i.vfStaveNote.setStemDirection(s.Stem.UP),i.parentVoiceEntry.StemDirection=l.StemDirectionType.Up),t&&t.getLines&&1===t.getLines()&&(window.DYMusicalOrientation=0),!i.vfStaveNote.preFormatted)continue;i.applyBordersFromVexflow(),this.parentMeasure.ParentStaff.isTab?this.PositionAndShape.RelativePosition.x=(i.vfStaveNote.getAbsoluteX()+i.vfStaveNote.glyph.getWidth())/o.unitInPixels:this.PositionAndShape.RelativePosition.x=i.vfStaveNote.getBoundingBox().getX()/o.unitInPixels;const n=i.notes[0].sourceNote;n.isRest()&&n.Length.RealValue===this.parentMeasure.parentSourceMeasure.ActiveTimeSignature.RealValue&&(this.PositionAndShape.RelativePosition.x+=this.parentMeasure.parentSourceMeasure.Rules.WholeRestXShiftVexflow-.1,i.PositionAndShape.BorderLeft=-.7,i.PositionAndShape.BorderRight=.7),i.PositionAndShape.BorderLeftt.staffLine)),i=this.calculateModifierXOffsets(e,1),n=this.calculateModifierXOffsets(e,.5);t.forEach(((t,e)=>{t.baseFingeringXOffset=n[e],t.baseStringNumberXOffset=i[e]}))}calculateModifierXOffsets(t,e){const i=[];for(let n=0;n=0;o--){if(Math.abs(t[n]-t[o])<=e&&s===i[o]){s++,r=!0;break}r=!1}i.push(s)}return i}}e.VexFlowStaffEntry=h},4828:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowStaffLine=void 0;const n=i(9953),s=i(449);class r extends n.StaffLine{constructor(t,e){super(t,e),this.slursInVFStaffLine=[],this.alignmentManager=new s.AlignmentManager(this)}get SlursInVFStaffLine(){return this.slursInVFStaffLine}addVFSlurToVFStaffline(t){this.slursInVFStaffLine.push(t)}get AlignmentManager(){return this.alignmentManager}}e.VexFlowStaffLine=r},8790:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowTabMeasure=void 0;var s=n(i(9124)).default.Flow;const r=i(7330),o=i(8129),a=n(i(2043));class l extends r.VexFlowMeasure{constructor(t,e=void 0,i=void 0){super(t,e,i),this.isTabMeasure=!0}resetLayout(){var t;const e=null!==(t=this.ParentStaff.StafflineCount)&&void 0!==t?t:6;this.stave=new s.TabStave(0,0,0,{space_above_staff_ln:0,space_below_staff_ln:0,num_lines:e}),this.updateInstructionWidth()}graphicalMeasureCreatedCalculations(){for(let t=0,e=this.staffEntries.length;t1){const i=o.VexFlowConverter.StrokeTypeFromArpeggioType(e.type),n=new s.Stroke(i,{all_voices:this.rules.ArpeggiosGoAcrossVoices});this.rules.RenderArpeggios&&t.vfStaveNote.addStroke(0,n)}else a.default.debug(`[OSMD] arpeggio in measure ${this.MeasureNumber} could not be drawn.\n voice entry had less than two notes, arpeggio is likely between voice entries, not currently supported in Vexflow.`)}this.vfVoices[e.VoiceId].addTickable(t.vfStaveNote)}else this.vfVoices[e.VoiceId].addTickable(t.vfStaveNote)}}}}e.VexFlowTabMeasure=l},2942:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowTextMeasurer=void 0;const n=i(8129);e.VexFlowTextMeasurer=class{constructor(t){this.fontSize=20,this.fontSizeStandard=this.fontSize;const e=document.createElement("canvas");this.context=e.getContext("2d"),this.rules=t}computeTextWidthToHeightRatio(t,e,i,s=void 0,r=this.fontSize){return this.context.font=n.VexFlowConverter.font(r,i,e,this.rules,s),this.context.measureText(t).width/r}setFontSize(t=this.fontSizeStandard){return this.fontSize=t,t}}},5460:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowVoiceEntry=void 0;const n=i(5974),s=i(5820),r=i(7459);class o extends n.GraphicalVoiceEntry{constructor(t,e){super(t,e)}applyBordersFromVexflow(){const t=this.vfStaveNote;if(!t.getNoteHeadBeginX)return;const e=t.getBoundingBox(),i=t.getNoteHeadBeginX()-e.x;this.PositionAndShape.RelativePosition.y=e.y/s.unitInPixels,this.PositionAndShape.BorderTop=0,this.PositionAndShape.BorderBottom=e.h/s.unitInPixels,this.PositionAndShape.BorderLeft=-(i+t.width/2)/s.unitInPixels,this.PositionAndShape.BorderRight=(e.w-i)/s.unitInPixels}set vfStaveNote(t){this.mVexFlowStaveNote=t}get vfStaveNote(){return this.mVexFlowStaveNote}color(){var t;const e=this.rules.DefaultColorNotehead,i=this.rules.DefaultColorRest,n=this.rules.DefaultColorStem,s="#00000000";let o,a;const l=this.vfStaveNote;for(let n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VexflowStafflineNoteCalculator=void 0;const n=i(8640),s=i(4679),r=i(1649),o=i(289),a=i(908);class l{constructor(t){this.staffPitchListMapping=new r.Dictionary,this.baseLineNote=n.NoteEnum.B,this.baseLineOctave=1,this.rules=t}trackNote(t){if(!(t instanceof s.VexFlowGraphicalNote)||t.Clef().ClefType!==o.ClefEnum.percussion||t.sourceNote.isRest()||0===this.rules.PercussionOneLineCutoff||-1===this.rules.PercussionForceVoicesOneLineCutoff)return;const e=t.parentVoiceEntry.parentStaffEntry.sourceStaffEntry.ParentStaff.idInMusicSheet;let i;this.staffPitchListMapping.containsKey(e)||this.staffPitchListMapping.setValue(e,new Array),i=this.staffPitchListMapping.getValue(e);const n=t.sourceNote.Pitch;l.findOrInsert(i,n)}static PitchIndexOf(t,e,i=0){if(i>t.length-1)return-1;for(let n=i;nthis.rules.PercussionOneLineCutoff&&!r)return t;const o=t,h=t.sourceNote.Pitch;let u=this.baseLineNote,c=this.baseLineOctave;if(this.rules.PercussionUseXMLDisplayStep&&void 0!==t.sourceNote.displayStepUnpitched&&(u=t.sourceNote.displayStepUnpitched,c=t.sourceNote.displayOctaveUnpitched+this.rules.PercussionOneLineXMLDisplayStepOctaveOffset),i.length<=this.rules.PercussionForceVoicesOneLineCutoff)o.setAccidental(new n.Pitch(u,c,h.Accidental));else{const t=l.PitchIndexOf(i,h);if(t>-1){const e=Math.ceil(i.length/2);if(!this.rules.PercussionUseXMLDisplayStep)if(t>=e)switch(c=2,(t-e)%5){case 1:u=n.NoteEnum.E;break;case 2:u=n.NoteEnum.G;break;case 3:u=n.NoteEnum.B;break;case 4:u=n.NoteEnum.D,c=3;break;default:u=n.NoteEnum.C}else switch(t%5){case 1:u=n.NoteEnum.F;break;case 2:u=n.NoteEnum.D;break;case 3:u=n.NoteEnum.B,c=0;break;case 4:u=n.NoteEnum.G,c=0;break;default:u=n.NoteEnum.A}const s=new n.Pitch(u,c,h.Accidental);o.setAccidental(s);const r=o.parentVoiceEntry.parentVoiceEntry;!this.rules.SetWantedStemDirectionByXml&&r.Notes.length<2&&(s.Octave>this.baseLineOctave||s.FundamentalNote===this.baseLineNote&&s.Octave===this.baseLineOctave?o.parentVoiceEntry.parentVoiceEntry.WantedStemDirection=a.StemDirectionType.Up:o.parentVoiceEntry.parentVoiceEntry.WantedStemDirection=a.StemDirectionType.Down)}}return o}getStafflineUniquePositionCount(t){return this.staffPitchListMapping.containsKey(t)?this.staffPitchListMapping.getValue(t).length:0}}e.VexflowStafflineNoteCalculator=l},448:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexflowVibratoBracket=void 0;const s=i(8682),r=n(i(9124));class o extends s.GraphicalWavyLine{constructor(t,e,i=!1){super(t,e),this.line=1,this.isVibrato=!1,this.toEndOfStopStave=!1,this.isVibrato=i}get ToEndOfStopStave(){return this.toEndOfStopStave}setStartNote(t){for(const e of t.graphicalVoiceEntries){const t=e;if(null==t?void 0:t.vfStaveNote)return this.startNote=t.vfStaveNote,this.startVfVoiceEntry=t,!0}return!1}setEndNote(t){for(const e of t.graphicalVoiceEntries){const t=e;if(null==t?void 0:t.vfStaveNote){this.endNote=t.vfStaveNote,this.endVfVoiceEntry=t;const e=this.endVfVoiceEntry.parentStaffEntry.parentMeasure.staffEntries,i=e[e.length-1];return this.toEndOfStopStave=i===this.endVfVoiceEntry.parentStaffEntry,!0}}return!1}CalculateBoundingBox(){const t=this.getVibratoBracket();this.boundingBox.Size.height=.2*t.render_options.wave_height}getVibratoBracket(){const t=new r.default.Flow.VibratoBracket({start:this.startNote,stop:this.endNote,toEndOfStopStave:this.toEndOfStopStave});return t.setLine(this.line),this.isVibrato?t.render_options.vibrato_width=20:t.render_options.wave_girth=4,t}}e.VexflowVibratoBracket=o},9839:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(449),e),s(i(4028),e),s(i(9505),e),s(i(709),e),s(i(9344),e),s(i(8129),e),s(i(4679),e),s(i(8144),e),s(i(6351),e),s(i(8939),e),s(i(5575),e),s(i(7330),e),s(i(4405),e),s(i(8738),e),s(i(5820),e),s(i(8494),e),s(i(9520),e),s(i(8041),e),s(i(9252),e),s(i(4828),e),s(i(7781),e),s(i(8790),e),s(i(2942),e),s(i(5460),e)},4759:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(6791),e),s(i(6055),e),s(i(1070),e),s(i(449),e),s(i(8911),e),s(i(4278),e),s(i(8155),e),s(i(5074),e),s(i(7459),e),s(i(1405),e),s(i(4146),e),s(i(374),e),s(i(5330),e),s(i(9428),e),s(i(5277),e),s(i(9946),e),s(i(6729),e),s(i(5091),e),s(i(8720),e),s(i(7963),e),s(i(1513),e),s(i(599),e),s(i(4324),e),s(i(3486),e),s(i(4785),e),s(i(873),e),s(i(3411),e),s(i(9876),e),s(i(3023),e),s(i(8898),e),s(i(5309),e),s(i(5974),e),s(i(8823),e),s(i(4040),e),s(i(1494),e),s(i(158),e),s(i(7142),e),s(i(5623),e),s(i(4574),e),s(i(9067),e),s(i(3501),e),s(i(6040),e),s(i(9953),e),s(i(4196),e),s(i(7771),e),s(i(1225),e),s(i(6894),e),s(i(525),e),s(i(9839),e)},6842:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Instrument=void 0;const n=i(884),s=i(2255),r=i(0);class o extends n.InstrumentalGroup{constructor(t,e,i,n){super(void 0,i,n),this.Transpose=0,this.voices=[],this.staves=[],this.hasLyrics=!1,this.hasChordSymbols=!1,this.playbackTranspose=0,this.lyricVersesNumbers=[],this.subInstruments=[],this.id=t,this.idString=e,this.nameLabel=new s.Label(e)}get Voices(){return this.voices}get Staves(){return this.staves}get NameLabel(){return this.nameLabel}get HasLyrics(){return this.hasLyrics}set HasLyrics(t){this.hasLyrics=t}get HasChordSymbols(){return this.hasChordSymbols}set HasChordSymbols(t){this.hasChordSymbols=t}get LyricVersesNumbers(){return this.lyricVersesNumbers}set LyricVersesNumbers(t){this.lyricVersesNumbers=t}get Name(){return this.nameLabel.text}set Name(t){this.nameLabel.text=t}get IdString(){return this.idString}get Id(){return this.id}get MidiInstrumentId(){return this.subInstruments[0].midiInstrumentID}set MidiInstrumentId(t){this.subInstruments[0].midiInstrumentID=t}get Volume(){return this.subInstruments[0].volume}set Volume(t){for(let e=0,i=this.subInstruments.length;e0&&this.Voices[0].Visible}set Visible(t){for(let e=0,i=this.Voices.length;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InstrumentalGroup=void 0,e.InstrumentalGroup=class{constructor(t,e,i){this.instrumentalGroups=[],this.name=t,this.musicSheet=e,this.parent=i}get InstrumentalGroups(){return this.instrumentalGroups}get Parent(){return this.parent}get Name(){return this.name}set Name(t){this.name=t}get GetMusicSheet(){return this.musicSheet}}},7181:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&n(e,t,i);return s(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.AUIController=void 0;const o=r(i(177));e.AUIController=class{constructor(t=document.body,e=!1,i="beforeend"){this.eventListeners=[],this.parentElement=t,this.insertLocation=i,this.isTouchDevice=e,this.initialize()}addListener(t){this.eventListeners.push(t)}generateHtmlTemplate(t,e={}){return o.compile(t)(e)}generateAndInsertHtmlTemplate(t,e={},i=this.insertLocation,n=this.parentElement){const s=this.generateHtmlTemplate(t,e);n.insertAdjacentHTML(i,s)}get downEventName(){return this.isTouchDevice?"ontouchstart":"onmousedown"}get upEventName(){return this.isTouchDevice?"ontouchend":"onmouseup"}get moveEventName(){return this.isTouchDevice?"ontouchmove":"onmousemove"}}},9603:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},7058:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6287:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4543:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4207:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6331:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ITextTranslation=void 0,e.ITextTranslation=class{static translateText(t,e){if(!this.defaultTextTranslation)return e}}},9984:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4854:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4143:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(9603),e),s(i(7058),e),s(i(6287),e),s(i(4207),e),s(i(6331),e),s(i(9984),e),s(i(7181),e),s(i(4854),e),s(i(4543),e)},2255:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Label=void 0;const n=i(1274),s=i(96);e.Label=class{constructor(t="",e=n.TextAlignmentEnum.CenterBottom,i=void 0,s=!0){this.IsCreditLabel=!1,this.text=t,this.print=s,this.textAlignment=e,this.font=i,this.fontFamily=void 0}set font(t){this.fontEnumValue=t,this.fontFamily=s.FontStringNames[t]}get font(){return this.fontEnumValue}ToString(){return this.text}}},5278:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TimestampTransform=e.MusicPartManager=void 0;const n=i(1797),s=i(301);e.MusicPartManager=class{constructor(t){this.musicSheet=t}reInit(){this.init()}init(){this.parts=this.musicSheet.Repetitions.slice(),this.sheetStart=this.musicSheet.SelectionStart=new n.Fraction(0,1),this.sheetEnd=this.musicSheet.SelectionEnd=this.musicSheet.SheetEndTimestamp,this.calcMapping()}getCurrentRepetitionTimestampTransform(t){let e;for(let i=this.timestamps.length-1;i>=0;i--)if(e=this.timestamps[i],t.gte(e.from))return e;return this.timestamps[0]}absoluteEnrolledToSheetTimestamp(t){if(0===this.timestamps.length)return t;const e=this.getCurrentRepetitionTimestampTransform(t);return n.Fraction.plus(t,n.Fraction.minus(e.to,e.from))}get Parts(){return this.parts}get MusicSheet(){return this.musicSheet}getIterator(t){return t?new s.MusicPartManagerIterator(this.musicSheet,t,void 0):new s.MusicPartManagerIterator(this.musicSheet,this.musicSheet.SelectionStart,this.musicSheet.SelectionEnd)}setSelectionStart(t){this.musicSheet.SelectionStart=t,this.musicSheet.SelectionEnd=void 0}setSelectionRange(t,e){this.musicSheet.SelectionStart=null!=t?t:this.sheetStart,this.musicSheet.SelectionEnd=null!=e?e:this.sheetEnd}calcMapping(){this.timestamps=[];const t=this.getIterator();let e=t.CurrentRepetition,i=new r(t.CurrentEnrolledTimestamp.clone(),t.CurrentSourceTimestamp.clone(),void 0,0);for(this.timestamps.push(i);!t.EndReached;){if(t.JumpOccurred||e!==t.CurrentRepetition){if(e=t.CurrentRepetition,t.backJumpOccurred){const e=t.JumpResponsibleRepetition;i.nextBackJump=t.CurrentEnrolledTimestamp,i.curRepetition=e,i.curRepetitionIteration=t.CurrentJumpResponsibleRepetitionIterationBeforeJump;for(let t=this.timestamps.length-2;t>=0&&!e.AbsoluteTimestamp.gt(this.timestamps[t].to)&&!this.timestamps[t].curRepetition;t--)this.timestamps[t].nextBackJump=i.nextBackJump,this.timestamps[t].curRepetition=e,this.timestamps[t].curRepetitionIteration=i.curRepetitionIteration}i=new r(t.CurrentEnrolledTimestamp.clone(),t.CurrentSourceTimestamp.clone(),void 0,0),this.timestamps.push(i)}t.moveToNext()}}};class r{constructor(t,e,i,n){this.from=t,this.to=e,this.curRepetition=i,this.curRepetitionIteration=n,this.nextBackJump=void 0,this.nextForwardJump=void 0}}e.TimestampTransform=r},301:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.MusicPartManagerIterator=void 0;const s=i(1797),r=i(5356),o=i(3331),a=i(7839),l=n(i(2043));class h{constructor(t,e,i){this.currentMeasureIndex=0,this.currentPartIndex=0,this.currentVoiceEntryIndex=-1,this.currentDynamicEntryIndex=0,this.currentTempoEntryIndex=0,this.currentDynamicChangingExpressions=[],this.repetitionIterationCountDictKeys=[],this.repetitionIterationCountDictValues=[],this.currentRepetition=void 0,this.endReached=!1,this.frontReached=!1,this.currentTimeStamp=new s.Fraction(0,1),this.currentEnrolledMeasureTimestamp=new s.Fraction(0,1),this.currentRelativeInMeasureTimestamp=new s.Fraction(0,1),this.currentVerticalContainerInMeasureTimestamp=new s.Fraction(0,1),this.jumpResponsibleRepetition=void 0,this.activeDynamicExpressions=[];try{this.frontReached=!0,this.musicSheet=t,this.currentBpm=t.userStartTempoInBPM,this.currentVoiceEntries=void 0,this.frontReached=!1;for(const t of this.musicSheet.Repetitions)this.setRepetitionIterationCount(t,1);for(let e=0;e=this.JumpResponsibleRepetition.StartIndex&&i.EndIndex<=this.JumpResponsibleRepetition.EndIndex&&this.resetRepetitionIterationCount(i)}}handleRepetitionsAtMeasureEnd(){for(let t=0,e=this.currentMeasure.LastRepetitionInstructions.length;t-1&&this.getRepetitionIterationCount(i)=this.JumpResponsibleRepetition.StartIndex&&i.EndIndex<=this.JumpResponsibleRepetition.EndIndex&&this.resetRepetitionIterationCount(i),this.repetitionIterationCountDictKeys.contains(i))){const t=i.getForwardJumpTargetForIteration(this.getRepetitionIterationCount(i));if(t>=0)return this.currentMeasureIndex=t,this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex],this.currentVoiceEntryIndex=-1,this.jumpResponsibleRepetition=i,void(this.forwardJumpOccurred=!0);-2===t&&(this.endReached=!0)}}}this.currentMeasureIndex++,void 0!==this.JumpResponsibleRepetition&&this.currentMeasureIndex>this.JumpResponsibleRepetition.EndIndex&&(this.jumpResponsibleRepetition=void 0)}doBackJump(t){this.currentMeasureIndex=t.getBackwardJumpTarget(),this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex],this.currentVoiceEntryIndex=-1,this.incrementRepetitionIterationCount(t),this.jumpResponsibleRepetition=t,this.backJumpOccurred=!0}activateCurrentRhythmInstructions(){if(void 0!==this.currentMeasure&&this.currentMeasure.FirstInstructionsStaffEntries.length>0&&void 0!==this.currentMeasure.FirstInstructionsStaffEntries[0]){const t=this.currentMeasure.FirstInstructionsStaffEntries[0].Instructions;for(let e=0,i=t.length;e0&&(this.currentDynamicEntryIndex>=t.length||t[this.currentDynamicEntryIndex].parMultiExpression().AbsoluteTimestamp.gte(this.CurrentSourceTimestamp));)this.currentDynamicEntryIndex--;for(;this.currentDynamicEntryIndex0&&(this.currentTempoEntryIndex>=e.length||e[this.currentTempoEntryIndex].AbsoluteTimestamp.gte(this.CurrentSourceTimestamp));)this.currentTempoEntryIndex--;for(;this.currentTempoEntryIndex=0&&this.currentVoiceEntryIndex=0&&this.currentMeasureIndex0){if(!t)return!0;for(let t=0,i=e.length;t0){const t=this.TimestampSortedTempoExpressionsList[0];if(t.InstantaneousTempo)return t.InstantaneousTempo.TempoInBpm;if(t.ContinuousTempo)return t.ContinuousTempo.StartTempo}return this.userStartTempoInBPM}get Errors(){return this.musicSheetErrors.measureErrors}get FirstMeasureNumber(){try{return this.getFirstSourceMeasure().MeasureNumber}catch(t){return d.default.info("MusicSheet.FirstMeasureNumber: ",t),0}}get LastMeasureNumber(){try{return this.getLastSourceMeasure().MeasureNumber}catch(t){return d.default.info("MusicSheet.LastMeasureNumber: ",t),0}}get CurrentEnrolledPosition(){return this.currentEnrolledPosition.clone()}set CurrentEnrolledPosition(t){this.currentEnrolledPosition=t.clone()}get Transpose(){return this.transpose}set Transpose(t){this.transpose=t}get FullNameString(){return this.ComposerString+" "+this.TitleString}get IdString(){return this.idString}set IdString(t){this.idString=t}getEnrolledSelectionStartTimeStampWorkaround(){const t=this.MusicPartManager.getIterator(this.SelectionStart);return s.Fraction.createFromFraction(t.CurrentEnrolledTimestamp)}get SheetEndTimestamp(){const t=this.getLastSourceMeasure();return s.Fraction.plus(t.AbsoluteTimestamp,t.Duration)}getSourceMeasureFromTimeStamp(t){for(let e=0,i=this.sourceMeasures.length;e0&&i.Voices[0].Visible&&t.push(i)}return t}}e.MusicSheet=m,m.defaultTitle="[no title given]"},6656:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MappingSourceMusicPart=void 0,e.MappingSourceMusicPart=class{constructor(t,e,i,n=-1,s=!1){this.repetitionRun=-1,this.sourceMusicPart=t,this.parentPartListEntry=i,this.startTimestamp=e.clone(),this.repetitionRun=n,this.parentRepetition=i,this.isEnding=s}get IsRepetition(){return void 0!==this.parentRepetition}get IsEnding(){return this.isEnding}get IsLastRepetitionRun(){return this.IsRepetition&&this.repetitionRun+1===this.parentRepetition.UserNumberOfRepetitions}get RepetitionRun(){return this.repetitionRun}get ParentPartListEntry(){return this.parentPartListEntry}get SourceMusicPart(){return this.sourceMusicPart}get StartTimestamp(){return this.startTimestamp}CompareTo(t){return t?this.startTimestamp.CompareTo(t.startTimestamp):1}}},3766:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PartListEntry=void 0,e.PartListEntry=class{constructor(t){this.enrolledTimestamps=[],this.visible=!0,this.musicSheet=t}get Visible(){return this.visible}set Visible(t){this.visible=t}getFirstSourceMeasure(){return this.musicSheet.SourceMeasures[this.startIndex]}getLastSourceMeasure(){return this.musicSheet.SourceMeasures[this.endIndex]}}},1717:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.RepetitionEndingPart=e.Repetition=void 0;const s=i(8817),r=i(1797),o=i(3766),a=n(i(2043));class l extends o.PartListEntry{constructor(t,e=!1){super(t),this.backwardJumpInstructions=[],this.endingParts=[],this.endingIndexDict={},this.userNumberOfRepetitions=0,this.visibles=[],this.fromWords=!1,this.repetitonIterationOrder=[],this.numberOfEndings=1,this.musicSheet2=t,this.virtualOverallRepetition=e}get BackwardJumpInstructions(){return this.backwardJumpInstructions}get EndingIndexDict(){return this.endingIndexDict}get EndingParts(){return this.endingParts}get Visibles(){return this.visibles}set Visibles(t){this.visibles=t}get DefaultNumberOfRepetitions(){let t=2;return this.virtualOverallRepetition&&(t=1),Math.max(t,Object.keys(this.endingIndexDict).length,this.checkRepetitionForMultipleLyricVerses())}get UserNumberOfRepetitions(){return this.userNumberOfRepetitions}set UserNumberOfRepetitions(t){this.userNumberOfRepetitions=t,this.repetitonIterationOrder=[];const e=this.userNumberOfRepetitions-this.NumberOfEndings;for(let t=1;t<=this.userNumberOfRepetitions;t++)t<=e?this.repetitonIterationOrder.push(1):this.repetitonIterationOrder.push(t-e)}getForwardJumpTargetForIteration(t){const e=this.repetitonIterationOrder[t-1];return this.endingIndexDict[e]?this.endingIndexDict[e].part.StartIndex:-1}getBackwardJumpTarget(){return this.startMarker.measureIndex}setEndingsStartIndex(t,e){const i=new h(new s.SourceMusicPart(this.musicSheet2,e,e));this.endingParts.push(i);for(const e of t)try{this.endingIndexDict[e]=i,i.endingIndices.push(e),this.numberOfEndings{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SourceMusicPart=void 0;const n=i(3766),s=i(1797);class r extends n.PartListEntry{constructor(t,e,i){super(t),this.musicSheet=t,this.startIndex=e,this.endIndex=i}get MeasuresCount(){return this.endIndex-this.startIndex+1}get StartIndex(){return this.startIndex}get EndIndex(){return this.endIndex}get ParentRepetition(){return this.parentRepetition}set ParentRepetition(t){this.parentRepetition=t}get AbsoluteTimestamp(){return s.Fraction.createFromFraction(this.musicSheet.SourceMeasures[this.startIndex].AbsoluteTimestamp)}setStartIndex(t){this.startIndex=t}setEndIndex(t){this.endIndex=t}}e.SourceMusicPart=r},4990:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(6656),e),s(i(3766),e),s(i(1717),e),s(i(8817),e)},4170:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PlaybackEntry=void 0;const n=i(8918),s=i(6591);e.PlaybackEntry=class{constructor(t){this.notes=[],this.TimestampShift=new n.Fraction,this.parentVoiceEntry=t;for(const e of t.Notes)this.Notes.push(new s.PlaybackNote(this,e))}get ParentVoiceEntry(){return this.parentVoiceEntry}get Notes(){return this.notes}get Length(){if(this.Notes.length>0)return this.Notes[0].Length}set Length(t){for(const e of this.Notes)e.Length=t}get HasNotes(){return this.Notes.length>0}}},9822:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PlaybackIterator=void 0;const n=i(1649),s=i(1566);e.PlaybackIterator=class{constructor(t){this.voiceCursors=new n.Dictionary,this.musicSheet=t;for(const e of t.PlaybackDataDict.keys()){const i=new s.VoicePlaybackData(e,t.PlaybackDataDict.getValue(e),t.Rules);this.voiceCursors.setValue(e,i)}this.Reset()}get NextEntryTimestamp(){return this.nextEntryTimestamp}get DueEntries(){return this.dueEntries}Update(t){const e=[];let i;for(const n of this.voiceCursors.values()){const s=n.update(t);e.push(...n.DueEntries),void 0!==s&&(void 0===i||i.RealValue>s.RealValue)&&(i=s)}return this.nextEntryTimestamp=i,this.dueEntries=e,this.DueEntries}Reset(){this.nextEntryTimestamp=void 0;const t=[];let e;for(const i of this.voiceCursors.values()){const n=i.reset(this.musicSheet.SelectionStart);t.push(...i.DueEntries),void 0!==n&&(void 0===e||e.RealValue>n.RealValue)&&(e=n)}return this.nextEntryTimestamp=e,this.dueEntries=t,this.nextEntryTimestamp}}},6591:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PlaybackNote=void 0;const n=i(6550),s=i(8918);class r{constructor(t,e){if(this.parentEntry=t,this.parentNote=e,this.ParentNote.PlaybackNote=this,this.Length=this.ParentNote.Length,void 0!==e.Pitch){const t=this.ParentNote.ParentStaff.ParentInstrument.MidiInstrumentId===n.MidiInstrument.Percussion;this.MidiKey=t?r.noteToMidiDrumKey(e):e.Pitch.getHalfTone()+12}else this.MidiKey=0}setLength(){void 0!==this.ParentNote.NoteTie&&this.ParentNote.NoteTie.StartNote===this.ParentNote&&(this.Length=this.ParentNote.NoteTie.Duration)}get ParentEntry(){return this.parentEntry}get ParentNote(){return this.parentNote}static noteToMidiDrumKey(t){var e;const i=t.Pitch.getHalfTone()-12,r=null===(e=t.Notehead)||void 0===e?void 0:e.Shape;switch(t.Pitch.Octave){case 1:switch(t.Pitch.FundamentalNote){case s.NoteEnum.D:return 44;case s.NoteEnum.E:return 35;case s.NoteEnum.F:return 36;case s.NoteEnum.G:return 41;case s.NoteEnum.A:return 43;case s.NoteEnum.B:return r===n.NoteHeadShape.TRIANGLE?54:47;default:return i}case 2:switch(t.Pitch.FundamentalNote){case s.NoteEnum.C:return r===n.NoteHeadShape.X?37:38;case s.NoteEnum.D:return r===n.NoteHeadShape.X?59:48;case s.NoteEnum.E:switch(r){case n.NoteHeadShape.X:return 42;case n.NoteHeadShape.CIRCLEX:return 46;case n.NoteHeadShape.TRIANGLE:return 56;default:return 50}case s.NoteEnum.F:return r===n.NoteHeadShape.DIAMOND?53:51;case s.NoteEnum.G:switch(r){case n.NoteHeadShape.CIRCLEX:case n.NoteHeadShape.DIAMOND:return 46;default:return 42}case s.NoteEnum.A:return 49;case s.NoteEnum.B:return 57;default:return i}case 3:return t.Pitch.FundamentalNote===s.NoteEnum.C?r===n.NoteHeadShape.CIRCLEX?52:55:i;default:return i}}}e.PlaybackNote=r},1596:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PlaybackNoteGenerator=void 0;const n=i(4257),s=i(8918);class r{calculate(t){const e=new n.MusicPartManagerIterator(t);for(;!e.EndReached;){const i=e.CurrentEnrolledTimestamp,n=e.CurrentAudibleVoiceEntries();for(const e of n)this.handleVoiceEntry(t,e,i);e.moveToNext()}}handleVoiceEntry(t,e,i){if(e.IsGrace)return;const n=e.ParentVoice;let o;t.PlaybackDataDict.containsKey(n)?o=t.PlaybackDataDict.getValue(n):(o=[],t.PlaybackDataDict.setValue(n,o));for(const t of e.PlaybackEntries)if(t.HasNotes){for(const e of t.Notes)e.setLength();const e=s.Fraction.plus(i,t.TimestampShift);r.addEntrySorted(o,t,e)}}static addEntrySorted(t,e,i){if(0===t.length)t.push({enrolledTimestamp:i,playbackEntry:e});else for(let n=t.length-1;n>=0;n--){const s=t[n];if(i.RealValue>s.enrolledTimestamp.RealValue){if(n===t.length-1){t.push({enrolledTimestamp:i,playbackEntry:e});break}t.splice(n+1,0,{enrolledTimestamp:i,playbackEntry:e});break}}}}e.PlaybackNoteGenerator=r},1566:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VoicePlaybackData=void 0;const n=i(8918);e.VoicePlaybackData=class{constructor(t,e,i){this.playbackEntries=[],this.dueEntries=[],this.parentVoice=t,this.playbackEntries=e,this.rules=i}get ParentVoice(){return this.parentVoice}get PlaybackEntries(){return this.playbackEntries}get DueEntries(){return this.dueEntries}get NextEntryTimestamp(){return this.nextEntryTimestamp}isAudible(){return this.ParentVoice.Audible}reset(t){if(this.playbackIndex=0,this.nextEntryTimestamp=void 0,this.dueEntries.clear(),!this.ParentVoice.Audible)return void(this.playbackIndex=0);let e=!1;for(let i=this.playbackIndex;it.RealValue){this.nextEntryTimestamp=n.enrolledTimestamp,this.playbackIndex=Math.max(0,i-1),e=!0;break}}return!e&&this.playbackEntries.length>0&&(this.playbackIndex=this.playbackEntries.length-1),this.nextEntryTimestamp}update(t){if(this.nextEntryTimestamp=void 0,this.dueEntries.clear(),this.ParentVoice.Audible){for(let e=this.playbackIndex;et.RealValue){this.nextEntryTimestamp=i.enrolledTimestamp,this.playbackIndex=e;break}const n=i.enrolledTimestamp.clone();if(n.Add(i.playbackEntry.Notes[0].Length),i.enrolledTimestamp.lt(t)){if(!this.rules.PlayAlreadyStartedNotesFromCursorPosition){const e=this.rules.PlaybackSkipNotesSafetyInterval;if(Math.abs(i.enrolledTimestamp.RealValue-t.RealValue)>e)continue}if(n.lt(t))continue}this.dueEntries.push(i)}if(void 0===this.nextEntryTimestamp){if(this.playbackEntries.length>0){const e=this.playbackEntries.last(),i=n.Fraction.plus(e.enrolledTimestamp,e.playbackEntry.Length);i.RealValue>t.RealValue&&(this.nextEntryTimestamp=i)}this.playbackIndex=Number.MAX_SAFE_INTEGER}return this.nextEntryTimestamp}}}},1295:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(1596),e)},2393:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.InstrumentReader=void 0;const s=i(8109),r=i(9050),o=i(289),a=i(5198),l=i(3331),h=i(1797),u=i(556),c=i(6331),d=i(1703),p=i(289),f=i(3331),m=i(5198),g=n(i(2043)),b=i(289),y=i(2905),S=i(4671),v=i(3755),_=i(908),x=i(2478),E=i(6894);e.InstrumentReader=class{constructor(t,e,i,n){this.voiceGeneratorsDict={},this.staffMainVoiceGeneratorDict={},this.divisions=0,this.currentClefNumber=1,this.currentXmlMeasureIndex=0,this.activeKeyHasBeenInitialized=!1,this.abstractInstructions=[],this.openChordSymbolContainers=[],this.soundTempos=new Map,this.xmlNotes=[],this.repetitionInstructionReader=e,this.xmlMeasureList=i,this.musicSheet=n.GetMusicSheet,this.instrument=n,this.activeClefs=new Array(n.Staves.length),this.activeClefsHaveBeenInitialized=new Array(n.Staves.length);for(let t=0;t=this.xmlMeasureList.length)return!1;this.currentMeasure=t,this.followingMultirestMeasures=Math.max(this.followingMultirestMeasures-1,0),this.inSourceMeasureInstrumentIndex=this.musicSheet.getGlobalStaffIndexOfFirstStaff(this.instrument),this.repetitionInstructionReader&&this.repetitionInstructionReader.prepareReadingMeasure(t,this.currentXmlMeasureIndex);let S=new h.Fraction(0,1),v=new h.Fraction(0,1),M=!1;this.maxTieNoteFraction=new h.Fraction(0,1);let w=!1;const P=[];let T=!1;try{const C=this.xmlMeasureList[this.currentXmlMeasureIndex],A=C.elements();if(t.Rules.UseXMLMeasureNumbers&&!Number.isInteger(t.MeasureNumberXML)){const e=parseInt(null===(n=C.attribute("number"))||void 0===n?void 0:n.value,10);Number.isInteger(e)&&(t.MeasureNumberXML=e)}let I;for(let n=0;n0&&(I=A[n-1]),"print"===C.name){const e=C.attribute("new-system");"yes"===(null==e?void 0:e.value)&&(t.printNewSystemXml=!0);const i=C.attribute("new-page");"yes"===(null==i?void 0:i.value)&&(t.printNewPageXml=!0)}else if("note"===C.name){C.element("grace")||(this.xmlNotes.push(C),P.push(C));let t=!0;"no"===(null===(s=C.attribute("print-object"))||void 0===s?void 0:s.value)&&(t=!1);let n=1;this.instrument.Staves.length>1&&C.element("staff")&&(n=parseInt(C.element("staff").value,10),isNaN(n)&&(g.default.debug("InstrumentReader.readNextXmlMeasure.get staff number"),n=1)),this.currentStaff=this.instrument.Staves[n-1];const r=void 0!==C.element("chord");if(C.element("voice")){const t=parseInt(C.element("voice").value,10);this.currentVoiceGenerator=this.getOrCreateVoiceGenerator(t,n-1)}else r&&this.currentVoiceGenerator||(this.currentVoiceGenerator=this.getOrCreateVoiceGenerator(1,n-1));let o,a=0,l=new h.Fraction(0,1),u=2,d=!1;if(C.element("duration")){if(a=parseInt(C.element("duration").value,10),isNaN(a)){const t=c.ITextTranslation.translateText("ReaderErrorMessages/NoteDurationError","Invalid Note Duration.");this.musicSheet.SheetErrors.pushMeasureError(t),g.default.debug("InstrumentReader.readNextXmlMeasure",t);continue}if(l=new h.Fraction(a,4*this.divisions),0===a?l=this.getNoteDurationFromTypeNode(C):o=this.getNoteDurationFromTypeNode(C),C.element("time-modification")){l=this.getNoteDurationForTuplet(C);const t=C.element("time-modification");(null==t?void 0:t.element("normal-notes"))&&(u=parseInt(t.element("normal-notes").value,10)),d=!0}}const p=void 0!==C.element("rest"),f=C.element("notations"),m=void 0!==C.element("grace")||0===a||r&&w;let b=!1,y=!1;if(m){const t=C.element("duration"),e=C.element("grace");e&&e.attributes()&&e.attribute("slash")&&"yes"===e.attribute("slash").value&&(b=!0),t||(l=this.getNoteDurationFromTypeNode(C));const i=C.element("notations");i&&i.element("slur")&&(y=!0)}let E=!1;C.element("cue")&&(E=!0);const M=C.element("type");let T=x.NoteType.UNDEFINED;if(M){const t=M.attribute("size");"cue"===(null==t?void 0:t.value)&&(E=!0),T=x.NoteTypeHandler.StringToNoteType(M.value)}let A,I=_.StemDirectionType.Undefined;const L=C.element("stem");if(L){switch(L.value){case"down":I=_.StemDirectionType.Down;break;case"up":I=_.StemDirectionType.Up;break;case"double":I=_.StemDirectionType.Double;break;case"none":I=_.StemDirectionType.None;break;default:I=_.StemDirectionType.Undefined}const t=L.attribute("color");t&&(A=this.parseXmlColor(t.value))}let R,N=0,k="",O="",D="";if(f){const t=f.element("ornaments");if(t){const e=t.element("tremolo");if(e){const t=e.attribute("type");if(k=t.value,t){const i=parseInt(e.value,10);i>0&&(N=i),"start"!==t.value&&"stop"!==t.value||(l=new h.Fraction(parseInt(C.element("duration").value,10),4*this.divisions))}}const i=t.elements("wavy-line");if(void 0!==i)for(const t of i){const e=this.expressionReaders[this.readExpressionStaffNumber(C)-1];e&&(e.readExpressionParameters(t,this.instrument,this.divisions,S,v,this.currentMeasure.MeasureNumber,!1),e.addWavyLine(t,this.currentMeasure,S,v))}}f.elements("glissando").find((t=>"start"===t.attribute("type").value))&&(O="start");f.elements("slide").find((t=>"start"===t.attribute("type").value))&&(D="start")}const B=C.element("notehead");if(B){const t=B.attribute("color");t&&(R=this.parseXmlColor(t.value))}let F;const V=C.attribute("color");V&&(F=this.parseXmlColor(V.value),R||(R=F),A||(A=F));let G=S.clone();r&&(G=v.clone()),this.currentStaffEntry=this.currentMeasure.findOrCreateStaffEntry(G,this.inSourceMeasureInstrumentIndex+n-1,this.currentStaff).staffEntry,(!this.currentVoiceGenerator.hasVoiceEntry()||!r&&!m&&!w||m&&!w||m&&!r||!m&&w)&&this.currentVoiceGenerator.createVoiceEntry(G,this.currentStaffEntry,this.activeKey,this.ActiveRhythm,m,b,y),m||r||(v=S.clone(),S.Add(l)),r&&void 0!==this.currentStaffEntry&&this.currentStaffEntry.ParentStaff!==this.currentStaff&&(this.currentStaffEntry=this.currentVoiceGenerator.checkForStaffEntryLink(this.inSourceMeasureInstrumentIndex+n-1,this.currentStaff,this.currentStaffEntry,this.currentMeasure));const W=void 0!==this.currentStaffEntry&&void 0!==this.currentStaffEntry.Timestamp&&this.currentStaffEntry.Timestamp.Equals(new h.Fraction(0,1))&&!this.currentStaffEntry.hasNotes();this.saveAbstractInstructionList(this.instrument.Staves.length,W),0!==this.openChordSymbolContainers.length&&(this.currentStaffEntry.ChordContainers=this.openChordSymbolContainers,this.openChordSymbolContainers=[]),this.activeRhythm,d||m||(l=new h.Fraction(a,4*this.divisions));const U=C.elements("dot").length;if(this.currentVoiceGenerator.read(C,l,o,T,u,p,this.currentStaffEntry,this.currentMeasure,e,this.maxTieNoteFraction,r,i,t,E,m,I,N,A,R,U,k,O,D),void 0!==f&&f.element("dynamics")){const t=this.expressionReaders[this.readExpressionStaffNumber(C)-1];t&&(t.readExpressionParameters(C,this.instrument,this.divisions,S,v,this.currentMeasure.MeasureNumber,!1),t.read(C,this.currentMeasure,v,void 0,P.length))}w=m}else if("attributes"===C.name){const e=C.element("divisions");if(e&&(this.divisions=parseInt(e.value,10),isNaN(this.divisions))){const t=c.ITextTranslation.translateText("ReaderErrorMessages/DivisionError","Invalid divisions value at Instrument: ");if(g.default.debug("InstrumentReader.readNextXmlMeasure",t),this.divisions=this.readDivisionsFromNotes(),!(this.divisions>0))throw M=!0,new d.MusicSheetReadingException(t+this.instrument.Name);this.musicSheet.SheetErrors.push(t+this.instrument.Name)}if(!C.element("divisions")&&0===this.divisions&&0===this.currentXmlMeasureIndex){const t=c.ITextTranslation.translateText("ReaderErrorMessages/DivisionError","Invalid divisions value at Instrument: ");if(this.divisions=this.readDivisionsFromNotes(),!(this.divisions>0))throw M=!0,new d.MusicSheetReadingException(t+this.instrument.Name);this.musicSheet.SheetErrors.push(t+this.instrument.Name)}this.addAbstractInstruction(C,i,I,S.clone()),S.Equals(new h.Fraction(0,1))&&this.isAttributesNodeAtBeginOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex],C)&&this.saveAbstractInstructionList(this.instrument.Staves.length,!0),this.isAttributesNodeAtEndOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex],C)&&this.saveClefInstructionAtEndOfMeasure();const n=C.elements("staff-details");for(const t of n){const e=t.element("staff-lines");if(e){let i=1;const n=t.attribute("number");n&&(i=parseInt(n.value,10)),this.instrument.Staves[i-1].StafflineCount=parseInt(e.value,10)}}const s=C.element("measure-style");if(s){const e=s.element("multiple-rest");if(e){const i=e.value;let n=0;try{n=Number.parseInt(i,10),void 0!==t.multipleRestMeasures&&n!==t.multipleRestMeasures?t.multipleRestMeasures=0:(t.multipleRestMeasures=n,this.currentMultirestStartMeasure=t,this.followingMultirestMeasures=n+1)}catch(t){console.log("multirest parse error: "+t)}}}const r=C.element("clef");if(r){const t=r.element("clef-octave-change");t&&0!==Number(null==t?void 0:t.value)||(window.needPitchVoice=!0)}}else if("forward"===C.name){const t=parseInt(C.element("duration").value,10);S.Add(new h.Fraction(t,4*this.divisions))}else if("backup"===C.name){const t=parseInt(C.element("duration").value,10);S.Sub(new h.Fraction(t,4*this.divisions)),S.IsNegative()&&(S=new h.Fraction(0,1)),v.Sub(new h.Fraction(t,4*this.divisions)),v.IsNegative()&&(v=new h.Fraction(0,1))}else if("direction"===C.name){const t=C.elements("direction-type"),e=C.element("direction-type");let i=Math.min(1,S.RealValue);void 0!==this.activeRhythm&&this.activeRhythm.Rhythm&&(i/=this.activeRhythm.Rhythm.RealValue);let n=!1;if(this.repetitionInstructionReader&&(n=this.repetitionInstructionReader.handleRepetitionInstructionsFromWordsOrSymbols(e,i)),!n){let i=this.expressionReaders[0];const n=this.readExpressionStaffNumber(C)-1;if(nnull==t?void 0:t.toLocaleLowerCase())).includes(null===(r=n.value)||void 0===r?void 0:r.toLocaleLowerCase())&&(this.currentGradualChangeMeasure=this.currentMeasure,this.currentMeasure.speedInfo={startWord:null===(o=n.value)||void 0===o?void 0:o.toLocaleLowerCase(),startXmlNoteIndex:P.length,endXmlNoteIndex:0,resetXmlNoteIndex:0,startMeasureListIndex:this.currentXmlMeasureIndex,endMeasureListIndex:0,resetMeasureListIndex:0},this.xmlNotes=[]),n.value.startsWith(u.GRADIENT_SPEED_CLOSE_TAG)&&(null===(a=this.currentGradualChangeMeasure)||void 0===a?void 0:a.speedInfo)&&(this.currentGradualChangeMeasure.speedInfo=Object.assign(Object.assign({},this.currentGradualChangeMeasure.speedInfo),{endXmlNoteIndex:this.xmlNotes.length,endMeasureListIndex:this.currentXmlMeasureIndex})),(null===(l=n.value)||void 0===l?void 0:l.toLocaleLowerCase())==="a tempo".toLocaleLowerCase()&&(null===(p=this.currentGradualChangeMeasure)||void 0===p?void 0:p.speedInfo)){const{endXmlNoteIndex:t,resetXmlNoteIndex:e,endMeasureListIndex:i}=this.currentGradualChangeMeasure.speedInfo;0===e&&(this.currentGradualChangeMeasure.speedInfo=Object.assign(Object.assign({},this.currentGradualChangeMeasure.speedInfo),{endXmlNoteIndex:t||this.xmlNotes.length,endMeasureListIndex:i||this.currentXmlMeasureIndex,resetXmlNoteIndex:this.xmlNotes.length,resetMeasureListIndex:this.currentXmlMeasureIndex})),this.xmlNotes=[]}T=!(!n.value||"hiddenspeed"!==n.value.toLocaleLowerCase())}if(t.find((t=>t.element("metronome")))&&(null===(f=this.currentGradualChangeMeasure)||void 0===f?void 0:f.speedInfo)){const{endXmlNoteIndex:t,resetXmlNoteIndex:e,endMeasureListIndex:i}=this.currentGradualChangeMeasure.speedInfo;0===e&&(this.currentGradualChangeMeasure.speedInfo=Object.assign(Object.assign({},this.currentGradualChangeMeasure.speedInfo),{endXmlNoteIndex:t||this.xmlNotes.length,endMeasureListIndex:i||this.currentXmlMeasureIndex,resetXmlNoteIndex:this.xmlNotes.length,resetMeasureListIndex:this.currentXmlMeasureIndex})),this.xmlNotes=[]}i.readExpressionParameters(C,this.instrument,this.divisions,S,v,this.currentMeasure.MeasureNumber,!1),i.read(C,this.currentMeasure,S,v.clone(),P.length,T)}}}else if("barline"===C.name){this.repetitionInstructionReader&&this.repetitionInstructionReader.handleLineRepetitionInstructions(C)&&(this.currentMeasure.HasEndLine=!0);const t=C.attribute("location");if(n===A.length-1||t&&"right"===t.value){const t=null===(m=C.element("bar-style"))||void 0===m?void 0:m.value;if(t&&(this.currentMeasure.endingBarStyleXml=t,this.currentMeasure.endingBarStyleEnum=E.SystemLinesEnumHelper.xmlBarlineStyleToSystemLinesEnum(t),null===(b=this.currentGradualChangeMeasure)||void 0===b?void 0:b.speedInfo)){const{endXmlNoteIndex:t,resetXmlNoteIndex:e,endMeasureListIndex:i}=this.currentGradualChangeMeasure.speedInfo;0===e&&(this.currentGradualChangeMeasure.speedInfo=Object.assign(Object.assign({},this.currentGradualChangeMeasure.speedInfo),{endXmlNoteIndex:t||this.xmlNotes.length,endMeasureListIndex:i||this.currentXmlMeasureIndex,resetXmlNoteIndex:this.xmlNotes.length,resetMeasureListIndex:this.currentXmlMeasureIndex})),this.currentGradualChangeMeasure=void 0,this.xmlNotes=[]}}}else if("sound"===C.name)try{if(C.attribute("tempo")){const t=parseFloat(C.attribute("tempo").value);C.element("offset")&&(this.soundTempos.has(this.currentXmlMeasureIndex)||this.soundTempos.set(this.currentXmlMeasureIndex,[]),this.soundTempos.get(this.currentXmlMeasureIndex).push(t)),0===this.currentXmlMeasureIndex&&(this.musicSheet.DefaultStartTempoInBpm=t,this.musicSheet.HasBPMInfo=!0)}}catch(t){g.default.debug("InstrumentReader.readTempoInstruction",t)}else"harmony"===C.name&&this.openChordSymbolContainers.push(y.ChordSymbolReader.readChordSymbol(C,this.musicSheet,this.activeKey))}for(const t in this.voiceGeneratorsDict)this.voiceGeneratorsDict.hasOwnProperty(t)&&this.voiceGeneratorsDict[t].checkForOpenBeam();if(this.currentXmlMeasureIndex===this.xmlMeasureList.length-1){for(let t=0;t{this.voiceGeneratorsDict[t].finalizeReadingMeasure()})),this.musicSheet.HasBPMInfo?0===t.TempoInBPM&&this.previousMeasure&&(this.currentMeasure.TempoInBPM=this.previousMeasure.TempoInBPM):this.currentMeasure.TempoInBPM=120,this.currentMeasure.TempoInBPM||(this.currentMeasure.TempoInBPM=this.musicSheet.DefaultStartTempoInBpm)}catch(t){if(M)throw new d.MusicSheetReadingException(t.Message);const e=c.ITextTranslation.translateText("ReaderErrorMessages/MeasureError","Error while reading Measure.");this.musicSheet.SheetErrors.pushMeasureError(e),g.default.debug("InstrumentReader.readNextXmlMeasure",e,t)}return this.previousMeasure=this.currentMeasure,this.currentXmlMeasureIndex+=1,!0}parseXmlColor(t){if(t)return 7===t.length?t:9===t.length?"#"+t.substr(3):void 0}doCalculationsAfterDurationHasBeenSet(){for(const t in this.voiceGeneratorsDict)this.voiceGeneratorsDict.hasOwnProperty(t)&&this.voiceGeneratorsDict[t].checkOpenTies()}getOrCreateVoiceGenerator(t,e){const i=this.instrument.Staves[e];let n=this.voiceGeneratorsDict[t];if(n)-1===i.Voices.indexOf(n.GetVoice)&&i.Voices.push(n.GetVoice);else{const r=this.staffMainVoiceGeneratorDict[e];r?(n=new s.VoiceGenerator(this.pluginManager,i,t,this.slurReader,r.GetVoice),i.Voices.push(n.GetVoice),this.voiceGeneratorsDict[t]=n):(n=new s.VoiceGenerator(this.pluginManager,i,t,this.slurReader),i.Voices.push(n.GetVoice),this.voiceGeneratorsDict[t]=n,this.staffMainVoiceGeneratorDict[e]=n)}return n}createExpressionGenerators(t){this.expressionReaders=new Array(t);for(let e=0;e0?this.musicSheet.SourceMeasures[0]:this.currentMeasure;const i=new o.ClefInstruction(p.ClefEnum.G,0,2);let n;e.FirstInstructionsStaffEntries[t]?(n=e.FirstInstructionsStaffEntries[t],n.removeFirstInstructionOfTypeClefInstruction()):(n=new r.SourceStaffEntry(void 0,void 0),e.FirstInstructionsStaffEntries[t]=n),i.Parent=n,n.Instructions.splice(0,0,i)}createDefaultKeyInstruction(){let t;t=this.musicSheet.SourceMeasures.length>0?this.musicSheet.SourceMeasures[0]:this.currentMeasure;const e=new a.KeyInstruction(void 0,0,m.KeyEnum.major);for(let i=this.inSourceMeasureInstrumentIndex;i0&&"backup"===i[n-1].name)return!0;let s=-1;for(let t=0;t0||s<0}isAttributesNodeAtEndOfMeasure(t,e){const i=t.elements().slice();let n=0;for(let t=0;ts}getNoteDurationFromTypeNode(t){const e=t.element("type");if(e){const t=e.value;return x.NoteTypeHandler.getNoteDurationFromType(t)}return new h.Fraction(0,4*this.divisions)}addAbstractInstruction(t,e,i,n){if(t.element("divisions")&&1===t.elements().length)return;const s=t.element("transpose");if(s){const t=s.element("chromatic");t&&(this.instrument.PlaybackTranspose=parseInt(t.value,10))}const r=t.elements("clef");let u;if(r.length>0)for(let t=0,e=r.length;t using default clef line."),this.musicSheet.SheetErrors.pushMeasureError(u),s=2,g.default.debug("InstrumentReader.addAbstractInstruction",u,t)}const d=e.element("sign");if(d)try{i=p.ClefEnum[d.value],o.ClefInstruction.isSupportedClef(i)||(u=c.ITextTranslation.translateText("ReaderErrorMessages/ClefError","Unsupported clef found -> using default clef."),this.musicSheet.SheetErrors.pushMeasureError(u),i=p.ClefEnum.G,s=2),i===p.ClefEnum.TAB&&(l=-1)}catch(t){u=c.ITextTranslation.translateText("ReaderErrorMessages/ClefError","Invalid clef found -> using default clef."),this.musicSheet.SheetErrors.pushMeasureError(u),i=p.ClefEnum.G,s=2,g.default.debug("InstrumentReader.addAbstractInstruction",u,t)}const f=e.element("clef-octave-change");if(f)try{l=parseInt(f.value,10)}catch(t){u=c.ITextTranslation.translateText("ReaderErrorMessages/ClefOctaveError","Invalid clef octave found -> using default clef octave."),this.musicSheet.SheetErrors.pushMeasureError(u),l=0}if(e.hasAttributes&&e.attribute("number"))try{a=parseInt(e.attribute("number").value,10),a>this.currentClefNumber&&(a=this.currentClefNumber),this.currentClefNumber=a+1}catch(t){u=c.ITextTranslation.translateText("ReaderErrorMessages/ClefError","Invalid clef found -> using default clef."),this.musicSheet.SheetErrors.pushMeasureError(u),a=1,this.currentClefNumber=a+1}const m=new o.ClefInstruction(i,l,s);this.abstractInstructions.push([a,m,n])}if(void 0!==t.element("key")&&this.instrument.MidiInstrumentId!==b.MidiInstrument.Percussion){let e=0;const i=t.element("key").element("fifths");if(i)try{e=parseInt(i.value,10)}catch(t){u=c.ITextTranslation.translateText("ReaderErrorMessages/KeyError","Invalid key found -> set to default."),this.musicSheet.SheetErrors.pushMeasureError(u),e=0,g.default.debug("InstrumentReader.addAbstractInstruction",u,t)}let s=m.KeyEnum.none,r=t.element("key");if(r&&(r=r.element("mode")),r)try{s=m.KeyEnum[r.value]}catch(t){u=c.ITextTranslation.translateText("ReaderErrorMessages/KeyError","Invalid key found -> set to default."),this.musicSheet.SheetErrors.pushMeasureError(u),s=m.KeyEnum.major,g.default.debug("InstrumentReader.addAbstractInstruction",u,t)}const o=new a.KeyInstruction(void 0,e,s);this.abstractInstructions.push([1,o,n])}if(t.element("time")){const e=t.element("time");let i=f.RhythmSymbolEnum.NONE,s=!0;if(void 0!==e&&e.hasAttributes){const t=e.attribute("symbol");t&&("common"===t.value?i=f.RhythmSymbolEnum.COMMON:"cut"===t.value&&(i=f.RhythmSymbolEnum.CUT));const n=e.attribute("print-object");n&&"no"===n.value&&(s=!1)}let r=0,o=0;const a=e&&void 0!==e.element("senza-misura"),d=t.elements("time"),p=[],m=[];for(let t=0,e=d.length;t0&&void 0!==m&&p.length===m.length){const t=p.length,e=new Array(t);let i=0;for(let n=0;n set to default."),this.musicSheet.SheetErrors.pushMeasureError(u),r=4,o=4,g.default.debug("InstrumentReader.addAbstractInstruction",u,t)}const e=new l.RhythmInstruction(new h.Fraction(r,o,0,!1),i);e.PrintObject=s,this.abstractInstructions.push([1,e,n])}}}saveAbstractInstructionList(t,e){for(let i=this.abstractInstructions.length-1;i>=0;i--){const n=this.abstractInstructions[i],s=n[0],h=n[1],u=n[2];if(h instanceof o.ClefInstruction){const t=h;if(0===this.currentXmlMeasureIndex||s<=this.activeClefs.length&&t!==this.activeClefs[s-1])if(e||void 0===this.currentStaffEntry||this.currentStaffEntry.hasNotes()||s-1!==this.instrument.Staves.indexOf(this.currentStaffEntry.ParentStaff))if(e){if(0!==u.RealValue)continue;let e;if(this.currentMeasure){const n=t,a=this.inSourceMeasureInstrumentIndex+s-1,l=this.currentMeasure.FirstInstructionsStaffEntries[a];if(0===this.currentXmlMeasureIndex)if(l)if(void 0===this.currentMeasure.FirstInstructionsStaffEntries[a]||l.Instructions[0]instanceof o.ClefInstruction){const t=new r.SourceStaffEntry(void 0,void 0);this.currentMeasure.LastInstructionsStaffEntries[a]=t,n.Parent=t,t.Instructions.push(n)}else e=l,n.Parent=e,e.removeFirstInstructionOfTypeClefInstruction(),e.Instructions.splice(0,0,n),this.activeClefsHaveBeenInitialized[s-1]=!0;else e=new r.SourceStaffEntry(void 0,void 0),this.currentMeasure.FirstInstructionsStaffEntries[a]=e,n.Parent=e,e.Instructions.push(n),this.activeClefsHaveBeenInitialized[s-1]=!0;else if(this.activeClefsHaveBeenInitialized[s-1]){let t=this.previousMeasure;this.followingMultirestMeasures>0&&this.currentMeasure.Rules.RenderMultipleRestMeasures&&(t=this.currentMultirestStartMeasure);const e=new r.SourceStaffEntry(void 0,void 0);t.LastInstructionsStaffEntries[a]=e,n.Parent=e,e.Instructions.push(n)}else{const t=this.musicSheet.SourceMeasures[0];t.FirstInstructionsStaffEntries[a]?(e=t.FirstInstructionsStaffEntries[a],e.removeFirstInstructionOfTypeClefInstruction()):e=new r.SourceStaffEntry(void 0,void 0),n.Parent=e,e.Instructions.splice(0,0,n),this.activeClefsHaveBeenInitialized[s-1]=!0}this.activeClefs[s-1]=t,this.abstractInstructions.splice(i,1)}}else{let e;const n=this.activeRhythm.Rhythm;n.RealValue>0&&u.RealValue/n.RealValue>.9&&(this.currentMeasure.LastInstructionsStaffEntries[s-1]||(this.currentMeasure.LastInstructionsStaffEntries[s-1]=new r.SourceStaffEntry(void 0,this.instrument.Staves[s-1])),e=this.currentMeasure.LastInstructionsStaffEntries[s-1]),e&&(t.Parent=e,e.Instructions.push(t),this.activeClefs[s-1]=t,this.abstractInstructions.splice(i,1))}else{const e=t,n=this.currentStaffEntry;if(u&&Math.abs(u.RealValue-n.Timestamp.RealValue)>.01)continue;e.Parent=n,n.removeFirstInstructionOfTypeClefInstruction(),n.Instructions.push(e),this.activeClefs[s-1]=t,this.abstractInstructions.splice(i,1)}else s<=this.activeClefs.length&&t===this.activeClefs[s-1]&&this.abstractInstructions.splice(i,1)}if(h instanceof a.KeyInstruction){const e=h;if(this.activeKey&&this.activeKey.Key===e.Key)this.abstractInstructions.splice(i,1);else{let n;if(this.activeKey=e,this.abstractInstructions.splice(i,1),this.activeKeyHasBeenInitialized?n=this.currentMeasure:(this.activeKeyHasBeenInitialized=!0,n=this.currentXmlMeasureIndex>0?this.musicSheet.SourceMeasures[0]:this.currentMeasure),n)for(let i=this.inSourceMeasureInstrumentIndex;i=0;t--){const e=this.abstractInstructions[t][0],i=this.abstractInstructions[t][1];if(i instanceof o.ClefInstruction){const n=i;if(!this.activeClefs[e-1]||n.ClefType!==this.activeClefs[e-1].ClefType||n.ClefType===this.activeClefs[e-1].ClefType&&n.Line!==this.activeClefs[e-1].Line){const i=new r.SourceStaffEntry(void 0,void 0);this.currentMeasure.LastInstructionsStaffEntries[this.inSourceMeasureInstrumentIndex+e-1]=i;const s=n;s.Parent=i,i.Instructions.push(s),this.activeClefs[e-1]=n,this.abstractInstructions.splice(t,1)}}}}getNoteDurationForTuplet(t){let e=new h.Fraction(0,1);const i=this.getNoteDurationFromTypeNode(t);if(t.element("time-modification")){const n=t.element("time-modification");if(n&&void 0!==n.element("actual-notes")&&n.element("normal-notes")){const t=n.element("actual-notes"),s=n.element("normal-notes");if(void 0!==t&&s){const n=parseInt(t.value,10),r=parseInt(s.value,10);e=new h.Fraction(r*i.Numerator,n*i.Denominator)}}}return e}readExpressionStaffNumber(t){let e=1;if(t.element("staff")){const i=t.element("staff");if(i)try{e=parseInt(i.value,10)}catch(t){const i=c.ITextTranslation.translateText("ReaderErrorMessages/ExpressionStaffError","Invalid Expression staff number -> set to default.");this.musicSheet.SheetErrors.pushMeasureError(i),e=1,g.default.debug("InstrumentReader.readExpressionStaffNumber",i,t)}}return e}readDivisionsFromNotes(){let t=0,e=this.currentXmlMeasureIndex,i=!1;for(;!i;){const n=this.xmlMeasureList[e].elements();for(let e=0,s=n.length;e0){i=!0;break}}if(0===t&&(e++,e===this.xmlMeasureList.length)){const t=c.ITextTranslation.translateText("ReaderErrorMEssages/DivisionsError","Invalid divisions value at Instrument: ");throw new d.MusicSheetReadingException(t+this.instrument.Name)}}return t}}},1372:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSheetReader=void 0;const s=i(7514),r=i(5942),o=i(1797),a=i(2393),l=i(6842),h=i(6331),u=i(1703),c=n(i(2043)),d=i(3331),p=i(3331),f=i(9050),m=i(884),g=i(5142),b=i(289),y=i(2255),S=i(8736),v=i(1405),_=i(2458);class x{constructor(t=void 0,e=new v.EngravingRules){this.completeNumberOfStaves=0,this.pluginManager=new _.ReaderPluginManager,this.afterSheetReadingModules=t||[],this.repetitionInstructionReader=S.MusicSymbolModuleFactory.createRepetitionInstructionReader(),this.repetitionCalculator=S.MusicSymbolModuleFactory.createRepetitionCalculator(),this.rules=e}get PluginManager(){return this.pluginManager}get CompleteNumberOfStaves(){return this.completeNumberOfStaves}static doCalculationsAfterDurationHasBeenSet(t){for(const e of t)e.doCalculationsAfterDurationHasBeenSet()}createMusicSheet(t,e){try{return this._createMusicSheet(t,e)}catch(t){return void c.default.error("MusicSheetReader.CreateMusicSheet",t)}}_removeFromArray(t,e){const i=t.indexOf(e);-1!==i&&t.splice(i,1)}trimString(t){return t.replace(/^\s+|\s+$/g,"")}_lastElement(t){return t[t.length-1]}_createMusicSheet(t,e){var i;const n=[];let a=0;if(this.musicSheet=new s.MusicSheet,this.musicSheet.Path=e,this.musicSheet.Rules=this.rules,!t)throw new u.MusicSheetReadingException("Undefined root element");this.pushSheetLabels(t,e);const l=t.element("part-list");if(!l)throw new u.MusicSheetReadingException("Undefined partListNode");const c=t.elements("part"),d=l.elements();this.initializeReading(d,c,n);let p=!0;this.currentFraction=new o.Fraction(0,1);let f=!1,m=t.element("identification");for(m&&(m=m.element("encoding")),m&&(m=m.element("software")),void 0!==m&&"Guitar Pro 5"===m.value&&(f=!0);p;){void 0!==this.currentMeasure&&this.currentMeasure.HasEndLine&&this.rules.NewPartAndSystemAfterFinalBarline&&(a=0),this.currentMeasure=new r.SourceMeasure(this.completeNumberOfStaves,this.musicSheet.Rules);for(const t of n)try{p=p&&t.readNextXmlMeasure(this.currentMeasure,this.currentFraction,f)}catch(t){const e=h.ITextTranslation.translateText("ReaderErrorMessages/InstrumentError","Error while reading instruments.");throw new u.MusicSheetReadingException(e,t)}p&&(this.musicSheet.addMeasure(this.currentMeasure),this.checkIfRhythmInstructionsAreSetAndEqual(n),this.checkSourceMeasureForNullEntries(),a=this.setSourceMeasureDuration(n,a),x.doCalculationsAfterDurationHasBeenSet(n),this.currentMeasure.AbsoluteTimestamp=this.currentFraction.clone(),this.musicSheet.SheetErrors.finalizeMeasure(this.currentMeasure.MeasureNumber),this.currentFraction.Add(this.currentMeasure.Duration),this.previousMeasure=this.currentMeasure,this.musicSheet.SoundTempos=null===(i=n[0])||void 0===i?void 0:i.SoundTempos)}this.repetitionInstructionReader&&(this.repetitionInstructionReader.removeRedundantInstructions(),this.repetitionCalculator&&this.repetitionCalculator.calculateRepetitions(this.musicSheet,this.repetitionInstructionReader.repetitionInstructions)),0===this.musicSheet.DefaultStartTempoInBpm&&(this.musicSheet.DefaultStartTempoInBpm=100),this.musicSheet.checkForInstrumentWithNoVoice(),this.musicSheet.fillStaffList();for(let t=0,e=this.afterSheetReadingModules.length;ti){if(this.areRhythmInstructionsMixed(e)&&s.SymbolEnum!==p.RhythmSymbolEnum.NONE)continue;i=s.Rhythm.RealValue,n=e.indexOf(s)}}if(e.length>0&&e.lengtht.Denominator){const i=e.Denominator/t.Denominator;t.expand(i)}}checkIfMeasureIsImplicit(t,e){return!(this.previousMeasure||!t.lt(e))||!!this.previousMeasure&&o.Fraction.plus(this.previousMeasure.Duration,t).Equals(e)}allInstrumentsHaveSameDuration(t,e){let i=0;for(let n=0,s=t.length;n=0;t--)for(let e=this.currentMeasure.VerticalSourceStaffEntryContainers[t].StaffEntries.length-1;e>=0;e--){const i=this.currentMeasure.VerticalSourceStaffEntryContainers[t].StaffEntries[e];if(i)for(let t=i.VoiceEntries.length-1;t>=0;t--){const e=i.VoiceEntries[t];0===e.Notes.length&&(this._removeFromArray(e.ParentVoice.VoiceEntries,e),this._removeFromArray(i.VoiceEntries,e))}void 0!==i&&0===i.VoiceEntries.length&&(this.currentMeasure.VerticalSourceStaffEntryContainers[t].StaffEntries[e]=void 0)}for(let t=this.currentMeasure.VerticalSourceStaffEntryContainers.length-1;t>=0;t--){let e=0;for(let i=0,n=this.currentMeasure.VerticalSourceStaffEntryContainers[t].StaffEntries.length;in){if(!this.musicSheet.Title){const e=t.attribute("font-size").value,i=parseFloat(e);a0&&s.MidiInstrumentId!==b.MidiInstrument.Percussion&&(t.midiInstrumentID=Math.max(0,parseInt(n.value,10)-1));else if("midi-unpitched"===n.name)t.fixedKey=Math.max(0,parseInt(n.value,10));else if("volume"===n.name)try{const e=parseFloat(n.value);t.volume=e/127}catch(t){c.default.debug("ExpressionReader.readExpressionParameters","read volume",t)}else if("pan"===n.name)try{const e=parseFloat(n.value);t.pan=e/64}catch(t){c.default.debug("ExpressionReader.readExpressionParameters","read pan",t)}}catch(t){c.default.info("MusicSheetReader.createInstrumentGroups midi settings: ",t)}}}}catch(t){c.default.info("MusicSheetReader.createInstrumentGroups: ",t)}}if(0===s.SubInstruments.length){const t=new g.SubInstrument(s);s.SubInstruments.push(t)}i[t]=s,n?(n.InstrumentalGroups.push(s),this.musicSheet.Instruments.push(s)):(this.musicSheet.InstrumentalGroups.push(s),this.musicSheet.Instruments.push(s))}else if("part-group"===r.name&&"start"===r.attribute("type").value){const t=new m.InstrumentalGroup("group",this.musicSheet,n);n?n.InstrumentalGroups.push(t):this.musicSheet.InstrumentalGroups.push(t),n=t}else if("part-group"===r.name&&"stop"===r.attribute("type").value&&n){if(1===n.InstrumentalGroups.length){const t=n.InstrumentalGroups[0];n.Parent?(n.Parent.InstrumentalGroups.push(t),this._removeFromArray(n.Parent.InstrumentalGroups,n)):(this.musicSheet.InstrumentalGroups.push(t),this._removeFromArray(this.musicSheet.InstrumentalGroups,n))}n=n.Parent}}}catch(t){const e=h.ITextTranslation.translateText("ReaderErrorMessages/InstrumentError","Error while reading Instruments");throw new u.MusicSheetReadingException(e,t)}for(let t=0,e=this.musicSheet.Instruments.length;t0){const i=t[0];if(i){let t=i.element("attributes");t&&(t=t.element("staves")),t?e+=parseInt(t.value,10):e++}}}if(isNaN(e)||e<=0){const t=h.ITextTranslation.translateText("ReaderErrorMessages/StaffError","Invalid number of staves.");throw new u.MusicSheetReadingException(t)}return e}getInstrumentNumberOfStavesFromXml(t){let e=0;const i=t.element("measure");if(i){const t=i.element("attributes");let n;t&&(n=t.element("staves")),e=t&&n?parseInt(n.value,10):1}if(isNaN(e)||e<=0){const t=h.ITextTranslation.translateText("ReaderErrorMessages/StaffError","Invalid number of Staves.");throw new u.MusicSheetReadingException(t)}return e}}e.MusicSheetReader=x},8736:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSymbolModuleFactory=void 0;const n=i(9934),s=i(6789);e.MusicSymbolModuleFactory=class{static createRepetitionInstructionReader(){return new n.RepetitionInstructionReader}static createRepetitionCalculator(){return new s.RepetitionCalculator}}},7677:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ArticulationReader=void 0;const s=i(908),r=n(i(2043)),o=i(1357),a=i(5922),l=i(3748),h=i(8640),u=i(1662);e.ArticulationReader=class{constructor(t){this.rules=t}getAccEnumFromString(t){switch(t){case"sharp":return h.AccidentalEnum.SHARP;case"flat":return h.AccidentalEnum.FLAT;case"natural":return h.AccidentalEnum.NATURAL;case"double-sharp":case"sharp-sharp":return h.AccidentalEnum.DOUBLESHARP;case"double-flat":case"flat-flat":return h.AccidentalEnum.DOUBLEFLAT;case"triple-sharp":return h.AccidentalEnum.TRIPLESHARP;case"triple-flat":return h.AccidentalEnum.TRIPLEFLAT;case"quarter-sharp":return h.AccidentalEnum.QUARTERTONESHARP;case"quarter-flat":return h.AccidentalEnum.QUARTERTONEFLAT;case"three-quarters-sharp":return h.AccidentalEnum.THREEQUARTERSSHARP;case"three-quarters-flat":return h.AccidentalEnum.THREEQUARTERSFLAT;case"slash-quarter-sharp":return h.AccidentalEnum.SLASHQUARTERSHARP;case"slash-sharp":return h.AccidentalEnum.SLASHSHARP;case"double-slash-flat":return h.AccidentalEnum.DOUBLESLASHFLAT;case"sori":return h.AccidentalEnum.SORI;case"koron":return h.AccidentalEnum.KORON;default:return h.AccidentalEnum.NONE}}addArticulationExpression(t,e){var i,n;if(void 0!==t&&t.elements().length>0){const o=t.elements();for(let t=0,a=o.length;t0&&e.Articulations[0].articulationEnum!==s.ArticulationEnum.staccato&&e.Articulations.splice(0,0,c),"strongaccent"===h){const t=null===(n=null==a?void 0:a.attribute("type"))||void 0===n?void 0:n.value;"up"===t?c.articulationEnum=s.ArticulationEnum.marcatoup:"down"===t&&(c.articulationEnum=s.ArticulationEnum.marcatodown)}if("detachedlegato"===h){const t=new u.Articulation(s.ArticulationEnum.staccato,r),i=new u.Articulation(s.ArticulationEnum.tenuto,r);e.Articulations.push(t,i)}if(!e.hasArticulation(c))switch(e.Articulations.push(c),c.articulationEnum){case s.ArticulationEnum.staccato:case s.ArticulationEnum.staccatissimo:e.DurationModifier=c;break;case s.ArticulationEnum.accent:case s.ArticulationEnum.strongaccent:e.VolumeModifier=c}}}catch(t){const e="Invalid note articulation.";return void r.default.debug("addArticulationExpression",e,t)}}}}addFermata(t,e){var i;let n=s.ArticulationEnum.fermata;t.attributes().length>0&&t.attribute("type")&&"inverted"===t.attribute("type").value&&(n=s.ArticulationEnum.invertedfermata);let r=l.PlacementEnum.Above;"below"===(null===(i=t.attribute("placement"))||void 0===i?void 0:i.value)&&(r=l.PlacementEnum.Below),e.Articulations.push(new u.Articulation(n,r))}addTechnicalArticulations(t,e,i){var n,r;const a={bend:s.ArticulationEnum.bend,"down-bow":s.ArticulationEnum.downbow,"open-string":s.ArticulationEnum.naturalharmonic,"snap-pizzicato":s.ArticulationEnum.snappizzicato,stopped:s.ArticulationEnum.lefthandpizzicato,"up-bow":s.ArticulationEnum.upbow};for(const i in a){if(!a.hasOwnProperty(i))continue;const s=a[i],o=t.element(i);if(o){let t;"above"===(null===(n=o.attribute("placement"))||void 0===n?void 0:n.value)&&(t=l.PlacementEnum.Above),"below"===(null===(r=o.attribute("placement"))||void 0===r?void 0:r.value)&&(t=l.PlacementEnum.Below);const i=new u.Articulation(s,t);e.hasArticulation(i)||e.Articulations.push(i)}}const h=t.element("fingering");if(h){const t=this.createTechnicalInstruction(h,i);t.type=o.TechnicalInstructionType.Fingering,i.Fingering=t,e.TechnicalInstructions.push(t)}const c=t.element("string");if(c){const t=this.createTechnicalInstruction(c,i);t.type=o.TechnicalInstructionType.String,i.StringInstruction=t,e.TechnicalInstructions.push(t)}}createTechnicalInstruction(t,e){const i=new o.TechnicalInstruction;i.sourceNote=e,i.value=t.value;const n=t.attribute("placement");return this.rules.FingeringPositionFromXML&&(i.placement=this.getPlacement(n)),i}getPlacement(t,e=l.PlacementEnum.NotYetDefined){if(e!==l.PlacementEnum.NotYetDefined)return e;if(!t)return l.PlacementEnum.NotYetDefined;switch(t.value){case"above":return l.PlacementEnum.Above;case"below":return l.PlacementEnum.Below;case"left":return l.PlacementEnum.Left;case"right":return l.PlacementEnum.Right;default:return l.PlacementEnum.NotYetDefined}}addOrnament(t,e){if(t){let i;const n={"delayed-inverted-turn":a.OrnamentEnum.DelayedInvertedTurn,"delayed-turn":a.OrnamentEnum.DelayedTurn,"inverted-mordent":a.OrnamentEnum.InvertedMordent,"inverted-turn":a.OrnamentEnum.InvertedTurn,mordent:a.OrnamentEnum.Mordent,"trill-mark":a.OrnamentEnum.Trill,turn:a.OrnamentEnum.Turn};for(const e in n){if(!n.hasOwnProperty(e))continue;const s=t.element(e);if(s){i=new a.OrnamentContainer(n[e]);const t=s.attribute("placement");t&&"below"===t.value&&(i.placement=l.PlacementEnum.Below)}}if(i){const n=t.elements("accidental-mark");if(n){let t=l.PlacementEnum.Below,e=h.AccidentalEnum.NONE;const s=n;for(let n=0,r=s.length;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DynamicsCalculator=void 0;const n=i(5517),s=i(2343);class r{static fillDynamicsList(t,e,i){for(let s=0;s=0&&i[e].push(new n.DynamicsContainer(o.InstantaneousDynamic,e))}if(void 0!==o.StartingContinuousDynamic){i[s].push(new n.DynamicsContainer(o.StartingContinuousDynamic,o.StaffNumber));const e=this.getOtherStaffIndexIfLinkedStavesAreDetected(t,s,o.StartingContinuousDynamic.Placement);e>=0&&i[e].push(new n.DynamicsContainer(o.StartingContinuousDynamic,e))}}}}static getOtherStaffIndexIfLinkedStavesAreDetected(t,e,i){const n=t.getStaffFromIndex(e),r=n.ParentInstrument.Staves.indexOf(n),o=n.ParentInstrument.Staves.length;return o>1&&0===r&&i===s.PlacementEnum.Below?e+1:o>1&&1===r&&i===s.PlacementEnum.Above?e-1:-1}static fillDynamicExpressions(t){const e=t.DynListStaves,i=t.getCompleteNumberOfStaves(),o=t.TimestampSortedDynamicExpressionsList;for(let t=0;t0?n.RealValue>0?(h=s.Fraction.multiply(s.Fraction.minus(n,r),h),this.directionTimestamp=s.Fraction.plus(h,n)):this.directionTimestamp=s.Fraction.createFromFraction(h):this.offsetDivisions<0&&(n.RealValue>0?(h=s.Fraction.multiply(s.Fraction.minus(n,r),h),this.directionTimestamp=s.Fraction.minus(n,h)):this.directionTimestamp=s.Fraction.createFromFraction(h));const u=t.attribute("placement");if(u)try{const t=u.value;"below"===t?this.placement=f.PlacementEnum.Below:"above"===t&&(this.placement=f.PlacementEnum.Above)}catch(t){const e=g.ITextTranslation.translateText("ReaderErrorMessages/ExpressionPlacementError","Invalid expression placement -> set to default.");b.default.debug("ExpressionReader.readExpressionParameters",e,t),this.musicSheet.SheetErrors.pushMeasureError(e),this.placement=f.PlacementEnum.Below}if(this.placement===f.PlacementEnum.NotYetDefined)try{const e=t.element("direction-type");if(e){const t=e.element("dynamics");if(t){const e=t.attribute("default-y");e&&this.readExpressionPlacement(e,"read dynamics y pos")}const i=e.element("wedge");if(i){const t=i.attribute("default-y");t&&this.readExpressionPlacement(t,"read wedge y pos")}const n=e.element("words");if(n){const t=n.attribute("default-y");t&&this.readExpressionPlacement(t,"read words y pos")}const s=e.element("rehearsal");if(s){const t=s.attribute("default-y");t&&this.readExpressionPlacement(t,"read rehearsal pos")}}}catch(t){const e=g.ITextTranslation.translateText("ReaderErrorMessages/ExpressionPlacementError","Invalid expression placement -> set to default.");b.default.debug("ExpressionReader.readExpressionParameters",e,t),this.musicSheet.SheetErrors.pushMeasureError(e),this.placement=f.PlacementEnum.Below}this.placement===f.PlacementEnum.NotYetDefined&&(e.Staves.length>1?this.placement=f.PlacementEnum.Below:e.HasLyrics?this.placement=f.PlacementEnum.Above:this.placement=f.PlacementEnum.Below)}read(t,e,i,n=void 0,r=0,o){let a=!1,l=!1;const h=t.element("sound");if(h){const t=h.attribute("tempo"),i=h.attribute("dynamics");if(t){const i=t.value.match(/^(\d+)(\.\d+)?$/);(null==i?void 0:i.length)>0?this.soundTempo=Math.round(Number.parseFloat(t.value)):(b.default.info("invalid xml tempo: "+t.value),this.soundTempo=100),e.TempoInBPM=this.soundTempo,0===this.musicSheet.DefaultStartTempoInBpm&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),this.musicSheet.HasBPMInfo=!0,a=!0}if(i){const t=i.value.match(/\d+/);this.soundDynamic=void 0!==t?parseInt(t[0],10):100,l=!0}}const u=t.element("direction-type");if(!u)return;let d=u.element("metronome");if(d){e.metronomeNoteIndex=r;const t=d.element("beat-unit"),n=void 0!==d.element("beat-unit-dot"),a=d.element("per-minute");if(void 0!==t&&a){d.hasAttributes&&void 0!==d.attribute("default-x")&&(this.directionTimestamp=s.Fraction.createFromFraction(i));const r=parseFloat(a.value);!o&&this.createNewTempoExpressionIfNeeded(e);const l=new c.InstantaneousTempoExpression(void 0,this.placement,this.staffNumber,r,this.currentMultiTempoExpression,!0);l.parentMeasure=e,this.soundTempo=r,e.TempoInBPM=this.soundTempo*(n?1.5:1),0===this.musicSheet.DefaultStartTempoInBpm&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),1===e.MeasureNumberXML&&0===this.musicSheet.SourceMeasures.length&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),this.musicSheet.HasBPMInfo=!0,l.dotted=n,l.beatUnit=t.value,this.currentMultiTempoExpression.addExpression(l,""),this.currentMultiTempoExpression.CombinedExpressionsText="test"}}else if(d=u.element("dynamics"),d){const n=void 0!==t.element("notations");this.interpretInstantaneousDynamics(d,e,i,n)}else if(d=u.element("words"),d){const t=u.elements("words");let n="";for(const e of t)n+=e.value;if(d.value=n,a||(0,S.isSpeedKeyword)(d.value)||(0,S.isSpeedHiddenKeyword)(d.value)){this.createNewTempoExpressionIfNeeded(e),this.currentMultiTempoExpression.CombinedExpressionsText=d.value,((0,S.isSpeedKeyword)(d.value)||(0,S.isSpeedHiddenKeyword)(d.value))&&(d.value=void 0);const t=new c.InstantaneousTempoExpression(d.value,this.placement,this.staffNumber,this.soundTempo,this.currentMultiTempoExpression);this.currentMultiTempoExpression.addExpression(t,"")}else l||this.interpretWords(d,e,i)}else d=u.element("wedge"),d?this.interpretWedge(d,e,n,e.MeasureNumber):(d=u.element("rehearsal"),d&&this.interpretRehearsalMark(d,e,i,e.MeasureNumber))}closeOpenExpressions(t,e){for(const i of this.openContinuousDynamicExpressions)this.createNewMultiExpressionIfNeeded(t,i.NumberXml,e),this.closeOpenContinuousDynamic(i,t,e);this.openContinuousTempoExpression&&this.closeOpenContinuousTempo(s.Fraction.plus(t.AbsoluteTimestamp,e))}addOctaveShift(t,e,i){var n;let s=1;const r=t.element("staff");if(r)try{s=parseInt(r.value,10)}catch(t){const e=g.ITextTranslation.translateText("ReaderErrorMessages/OctaveShiftStaffError","Invalid octave shift staff number -> set to default");this.musicSheet.SheetErrors.pushMeasureError(e),s=1,b.default.debug("ExpressionReader.addOctaveShift",e,t)}const o=t.element("direction-type");if(o){const r=o.element("octave-shift"),a=this.readPlacement(t);if(void 0!==r&&r.hasAttributes)try{const t=this.readNumber(r);if(r.attribute("size")){const o=parseInt(r.attribute("size").value,10);let l=0;8===o?l=1:15===o&&(l=2);let u=null===(n=r.attribute("type"))||void 0===n?void 0:n.value;if(u||(a===f.PlacementEnum.Above?u="down":a===f.PlacementEnum.Below&&(u="up")),"up"===u||"down"===u){const i=new h.OctaveShift(u,l);i.StaffNumber=s,this.getMultiExpression=this.createNewMultiExpressionIfNeeded(e,t),this.getMultiExpression.OctaveShiftStart=i,i.ParentStartMultiExpression=this.getMultiExpression,this.openOctaveShift=i}else"stop"===u?this.openOctaveShift&&(this.getMultiExpression=this.createNewMultiExpressionIfNeeded(e,this.openOctaveShift.numberXml,i),this.getMultiExpression.OctaveShiftEnd=this.openOctaveShift,this.openOctaveShift.ParentEndMultiExpression=this.getMultiExpression,this.openOctaveShift=void 0):u||b.default.debug("octave-shift missing type in xml")}}catch(t){const e=g.ITextTranslation.translateText("ReaderErrorMessages/OctaveShiftError","Error while reading octave shift.");this.musicSheet.SheetErrors.pushMeasureError(e),b.default.debug("ExpressionReader.addOctaveShift",e,t)}}}addPedalMarking(t,e,i){var n,s,r,o;const a=t.element("direction-type");if(a){const t=a.element("pedal");if(void 0!==t&&t.hasAttributes){let i=!1,a=!1;try{switch("yes"===(null===(n=t.attribute("line"))||void 0===n?void 0:n.value)?a=!0:"no"===(null===(s=t.attribute("line"))||void 0===s?void 0:s.value)&&(a=!1,i=!0),"yes"===(null===(r=t.attribute("sign"))||void 0===r?void 0:r.value)?i=!0:"no"===(null===(o=t.attribute("sign"))||void 0===o?void 0:o.value)&&(i=!1,a=!0),t.attribute("type").value){case"start":this.openPedal&&this.openPedal.IsLine&&this.endOpenPedal(e),this.createNewMultiExpressionIfNeeded(e,-1),this.openPedal=new _.Pedal(a,i),this.getMultiExpression.PedalStart=this.openPedal,this.openPedal.ParentStartMultiExpression=this.getMultiExpression;break;case"stop":this.openPedal&&this.endOpenPedal(e);break;case"change":this.openPedal&&this.openPedal.IsLine&&(this.openPedal.ChangeEnd=!0,this.createNewMultiExpressionIfNeeded(e,-1),this.getMultiExpression.PedalEnd=this.openPedal,this.openPedal.ParentEndMultiExpression=this.getMultiExpression,this.createNewMultiExpressionIfNeeded(e,-1),this.openPedal=new _.Pedal(a,i),this.openPedal.ChangeBegin=!0,this.getMultiExpression.PedalStart=this.openPedal,this.openPedal.ParentStartMultiExpression=this.getMultiExpression)}}catch(t){const e=g.ITextTranslation.translateText("ReaderErrorMessages/PedalError","Error while reading pedal.");this.musicSheet.SheetErrors.pushMeasureError(e),b.default.debug("ExpressionReader.addPedalMarking",e,t)}}}}endOpenPedal(t){this.createNewMultiExpressionIfNeeded(t,-1),this.getMultiExpression.PedalEnd=this.openPedal,this.openPedal.ParentEndMultiExpression=this.getMultiExpression,this.openPedal=void 0}addWavyLine(t,e,i,n){if(t&&t.hasAttributes)try{switch(t.attribute("type").value){case"start":this.createNewMultiExpressionIfNeeded(e,-1),this.openWavyLine=new x.WavyLine(this.placement),this.getMultiExpression.WavyLineStart=this.openWavyLine,this.openWavyLine.ParentStartMultiExpression=this.getMultiExpression;break;case"stop":this.openWavyLine&&(this.createNewMultiExpressionIfNeeded(e,-1,i),this.getMultiExpression.WavyLineEnd=this.openWavyLine,this.openWavyLine.ParentEndMultiExpression=this.getMultiExpression,this.openWavyLine=void 0)}}catch(t){const e=g.ITextTranslation.translateText("ReaderErrorMessages/WavyLineError","Error while reading wavy-line.");this.musicSheet.SheetErrors.pushMeasureError(e),b.default.debug("ExpressionReader.addWavyLine",e,t)}}initialize(){this.placement=f.PlacementEnum.NotYetDefined,this.soundTempo=0,this.soundDynamic=0,this.offsetDivisions=0}readPlacement(t){var e;const i=null===(e=t.attribute("placement"))||void 0===e?void 0:e.value;return"above"===i?f.PlacementEnum.Above:"below"===i?f.PlacementEnum.Below:f.PlacementEnum.NotYetDefined}readExpressionPlacement(t,e){try{const e=parseInt(t.value,10);e<0?this.placement=f.PlacementEnum.Below:e>0&&(this.placement=f.PlacementEnum.Above)}catch(t){b.default.debug("ExpressionReader.readExpressionParameters",e,t)}}interpretInstantaneousDynamics(t,e,i,n){if(t.hasElements){t.hasAttributes&&t.attribute("default-x")&&(this.directionTimestamp=s.Fraction.createFromFraction(i));const r=this.readNumber(t);let o=t.elements()[0].name;if("other-dynamics"===o&&(o=t.elements()[0].value),o){n?this.createNewMultiExpressionIfNeeded(e,r,s.Fraction.createFromFraction(i)):this.createNewMultiExpressionIfNeeded(e,r);const t=new l.InstantaneousDynamicExpression(o,this.soundDynamic,this.placement,this.staffNumber,e);t.InMeasureTimestamp=i.clone(),this.getMultiExpression.addExpression(t,""),this.initialize(),this.activeInstantaneousDynamic?this.activeInstantaneousDynamic.DynEnum=t.DynEnum:this.activeInstantaneousDynamic=new l.InstantaneousDynamicExpression(o,0,f.PlacementEnum.NotYetDefined,1,e)}}}interpretWords(t,e,i){const n=t.value;let r;const o=t.attribute("font-style");if(o&&"italic"===o.value&&(r=y.FontStyles.Italic),n.length>0){if(t.hasAttributes&&t.attribute("default-x")&&(this.directionTimestamp=s.Fraction.createFromFraction(i)),this.checkIfWordsNodeIsRepetitionInstruction(n))return;this.fillMultiOrTempoExpression(n,e,i,r),this.initialize()}}readNumber(t){var e;let i=1;const n=null===(e=t.attribute("number"))||void 0===e?void 0:e.value;return n&&(i=Number.parseInt(n,10)),i}interpretWedge(t,e,i,n){var r,o;void 0!==t&&t.hasAttributes&&t.attribute("default-x")&&(this.directionTimestamp=s.Fraction.createFromFraction(i));const a=this.readNumber(t);"stop"===(null===(o=null===(r=t.attribute("type"))||void 0===r?void 0:r.value)||void 0===o?void 0:o.toLowerCase())?this.createNewMultiExpressionIfNeeded(e,a,i):this.createNewMultiExpressionIfNeeded(e,a),this.addWedge(t,e,i),this.initialize()}interpretRehearsalMark(t,e,i,n){e.rehearsalExpression=new v.RehearsalExpression(t.value,this.placement)}createNewMultiExpressionIfNeeded(t,e,i=void 0){i||(i=this.directionTimestamp);let n=this.getMultiExpression;return(!n||n&&(n.SourceMeasureParent!==t||n.numberXml!==e||n.SourceMeasureParent===t&&n.Timestamp!==i))&&(this.getMultiExpression=n=new u.MultiExpression(t,s.Fraction.createFromFraction(i)),t.StaffLinkedExpressions[this.globalStaffIndex].push(n)),n}createNewTempoExpressionIfNeeded(t){this.currentMultiTempoExpression&&this.currentMultiTempoExpression.SourceMeasureParent===t&&this.currentMultiTempoExpression.Timestamp===this.directionTimestamp||(this.currentMultiTempoExpression=new r.MultiTempoExpression(t,s.Fraction.createFromFraction(this.directionTimestamp)),t.TempoExpressions.push(this.currentMultiTempoExpression))}addWedge(t,e,i){if(void 0!==t&&t.hasAttributes){const n=this.readNumber(t),s=t.attribute("type").value.toLowerCase();try{if("crescendo"===s||"diminuendo"===s){const t=new o.ContinuousDynamicExpression(o.ContDynamicEnum[s],this.placement,this.staffNumber,e,this.activeInstantaneousDynamic,n);this.openContinuousDynamicExpressions.push(t);let i=this.getMultiExpression;i||(i=this.createNewMultiExpressionIfNeeded(e,n)),i.StartingContinuousDynamic=t,t.StartMultiExpression=i,void 0!==this.activeInstantaneousDynamic&&this.activeInstantaneousDynamic.StaffNumber===t.StaffNumber&&(this.activeInstantaneousDynamic=void 0)}else if("stop"===s)for(const t of this.openContinuousDynamicExpressions)t.NumberXml===n&&t.NumberXml===n&&this.closeOpenContinuousDynamic(t,e,i)}catch(t){const e="ReaderErrorMessages/WedgeError, Error while reading Crescendo / Diminuendo.";this.musicSheet.SheetErrors.pushMeasureError(e),b.default.debug("ExpressionReader.addWedge",e,t)}}}fillMultiOrTempoExpression(t,e,i,n){if(!t)return;const s=t.trim();this.createExpressionFromString("",s,e,i,t,n)}createExpressionFromString(t,e,i,n,s,r){if(c.InstantaneousTempoExpression.isInputStringInstantaneousTempo(e)||a.ContinuousTempoExpression.isInputStringContinuousTempo(e)){if(i.TempoExpressions.length>0)for(let t=0,n=i.TempoExpressions.length;t0)for(let t=0,n=i.TempoExpressions.length;t0&&!this.hasDigit(e)&&this.globalStaffIndex>0){if(n.EntriesList[0].label.indexOf(e)>=0)return!1;break}}let h=m.TextAlignmentEnum.CenterBottom;this.musicSheet.Rules.CompactMode&&(h=m.TextAlignmentEnum.LeftBottom);const u=new p.UnknownExpression(e,this.placement,h,this.staffNumber);return u.fontStyle=r,l.addExpression(u,t),!1}closeOpenContinuousDynamic(t,e,i){if(!t)return;const n=t.NumberXml;t.EndMultiExpression=this.createNewMultiExpressionIfNeeded(e,n,i),t.StartMultiExpression.EndingContinuousDynamic=t,this.openContinuousDynamicExpressions=this.openContinuousDynamicExpressions.filter((e=>e!==t))}closeOpenContinuousTempo(t){this.openContinuousTempoExpression.AbsoluteEndTimestamp=t,this.openContinuousTempoExpression=void 0}checkIfWordsNodeIsRepetitionInstruction(t){return"coda"===(t=t.trim().toLowerCase())||"tocoda"===t||"to coda"===t||"fine"===t||"d.c."===t||"dacapo"===t||"da capo"===t||"d.s."===t||"dalsegno"===t||"dal segno"===t||"d.c. al fine"===t||"d.s. al fine"===t||"d.c. al coda"===t||"d.s. al coda"===t}hasDigit(t){return/\d/.test(t)}}},2535:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LyricsReader=void 0;const n=i(2672),s=i(7274),r=i(6331);e.LyricsReader=class{constructor(t){this.openLyricWords={},this.musicSheet=t}addLyricEntry(t,e){var i,o;if(t){const a=t;for(let t=0,l=a.length;t0)for(let t=s;t1&&(d=parseInt(t[1],10))}catch(t){const e=r.ITextTranslation.translateText("ReaderErrorMessages/LyricVerseNumberError","Invalid lyric verse number");this.musicSheet.SheetErrors.pushMeasureError(e);continue}}if("single"===t||"end"===t){if(this.openLyricWords[d]){this.currentLyricWord=this.openLyricWords[d];const t=this.currentLyricWord.Syllables.length;c=new s.LyricsEntry(h,d,this.currentLyricWord,e,t),this.currentLyricWord.Syllables.push(c),delete this.openLyricWords[d],this.currentLyricWord=void 0}else c=new s.LyricsEntry(h,d,void 0,e);c.extend=void 0!==l.element("extend")}else if("begin"===t)this.openLyricWords[d]&&(delete this.openLyricWords[d],this.currentLyricWord=void 0),this.currentLyricWord=new n.LyricWord,this.openLyricWords[d]=this.currentLyricWord,c=new s.LyricsEntry(h,d,this.currentLyricWord,e,0),this.currentLyricWord.Syllables.push(c);else if("middle"===t)if(this.openLyricWords[d]){this.currentLyricWord=this.openLyricWords[d];const t=this.currentLyricWord.Syllables.length;c=new s.LyricsEntry(h,d,this.currentLyricWord,e,t),this.currentLyricWord.Syllables.push(c)}else c=new s.LyricsEntry(h,d,void 0,e);c&&(e.LyricsEntries[d]||(e.LyricsEntries.setValue(d,c),(null===(o=null===(i=e.ParentSourceStaffEntry)||void 0===i?void 0:i.VerticalContainerParent)||void 0===o?void 0:o.ParentMeasure)&&(e.ParentSourceStaffEntry.VerticalContainerParent.ParentMeasure.hasLyrics=!0)),e.ParentVoice.Parent.LyricVersesNumbers[d]||e.ParentVoice.Parent.LyricVersesNumbers.push(d))}}}catch(t){const e=r.ITextTranslation.translateText("ReaderErrorMessages/LyricError","Error while reading lyric entry.");this.musicSheet.SheetErrors.pushMeasureError(e);continue}}e.ParentVoice.Parent.LyricVersesNumbers=e.ParentVoice.Parent.LyricVersesNumbers.filter(((t,e,i)=>i.indexOf(t)===e))}}}},6789:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.RepetitionBuildingContainer=e.RepetitionCalculator=void 0;const s=i(6189),r=i(6189),o=i(1703),a=i(4990),l=n(i(2043));e.RepetitionCalculator=class{constructor(){this.repetitionInstructions=[],this.openRepetitions=[],this.lastRepetitionCommonPartStartIndex=0}calculateRepetitions(t,e){this.musicSheet=t,this.repetitionInstructions=e,this.openRepetitions.length=0,this.lastRepetitionCommonPartStartIndex=0;const i=this.musicSheet.SourceMeasures;for(const t of this.repetitionInstructions){this.currentMeasureIndex=t.measureIndex;try{this.currentMeasure=i[this.currentMeasureIndex],this.handleRepetitionInstructions(t)}catch(t){l.default.error("RepetitionCalculator: calculateRepetitions",t)}}for(;this.openRepetitions.length>0;)try{const t=this.openRepetitions.last();if(t.RepetitonUnderConstruction.FromWords){if(t.WaitingForCoda){let e=t.RepetitonUnderConstruction.BackwardJumpInstructions.last().measureIndex+1;e>=this.musicSheet.SourceMeasures.length&&(e=-1),t.RepetitonUnderConstruction.setEndingStartIndex(2,e)}else if(0===t.RepetitonUnderConstruction.BackwardJumpInstructions.length){this.openRepetitions.splice(this.openRepetitions.length-1,1);continue}}else if(0===t.RepetitonUnderConstruction.BackwardJumpInstructions.length){const e=i.length-1,n=new s.RepetitionInstruction(e,s.RepetitionInstructionEnum.BackJumpLine,s.AlignmentType.End,t.RepetitonUnderConstruction);t.RepetitonUnderConstruction.BackwardJumpInstructions.push(n),i[e].LastRepetitionInstructions.push(n)}this.finalizeRepetition(this.openRepetitions.last())}catch(t){try{const t=this.openRepetitions.last().RepetitonUnderConstruction;for(const e of this.repetitionInstructions)e.parentRepetition===t&&(e.parentRepetition=void 0);this.openRepetitions.splice(this.openRepetitions.length-1,1)}catch(t){l.default.error("RepetitionCalculator: calculateRepetitions2",t)}}let n=!1;const o=this.musicSheet.SourceMeasures.length-1;for(const t of this.musicSheet.Repetitions)if(0===t.StartIndex&&t.EndIndex===o){n=!0;break}if(!n){const t=new a.Repetition(this.musicSheet,!0);t.FromWords=!0,t.startMarker=new s.RepetitionInstruction(0,s.RepetitionInstructionEnum.StartLine),t.startMarker.parentRepetition=t,this.musicSheet.SourceMeasures[0].FirstRepetitionInstructions.push(t.startMarker),t.endMarker=new s.RepetitionInstruction(o,s.RepetitionInstructionEnum.BackJumpLine),t.endMarker.parentRepetition=t,t.BackwardJumpInstructions.push(t.endMarker),t.UserNumberOfRepetitions=t.DefaultNumberOfRepetitions,this.musicSheet.Repetitions.push(t)}for(let t=0,e=this.musicSheet.SourceMeasures.length;t1&&e.FirstRepetitionInstructions.sort(r.RepetitionInstructionComparer.Compare),e.LastRepetitionInstructions.length>1&&e.LastRepetitionInstructions.sort(r.RepetitionInstructionComparer.Compare)}}handleRepetitionInstructions(t){let e;switch(t.type){case s.RepetitionInstructionEnum.StartLine:e=this.createNewRepetition(this.currentMeasureIndex),t.parentRepetition=e.RepetitonUnderConstruction,e.RepetitonUnderConstruction.FromWords=!1,e.RepetitonUnderConstruction.startMarker=t,this.currentMeasure.FirstRepetitionInstructions.push(t);break;case s.RepetitionInstructionEnum.BackJumpLine:e=this.getOrCreateCurrentRepetition2(!1),t.parentRepetition=e.RepetitonUnderConstruction,e.RepetitonUnderConstruction.BackwardJumpInstructions.push(t),this.currentMeasure.LastRepetitionInstructions.push(t),0===e.RepetitonUnderConstruction.EndingParts.length&&this.finalizeRepetition(e);break;case s.RepetitionInstructionEnum.Ending:if(e=this.getOrCreateCurrentRepetition(),t.parentRepetition=e.RepetitonUnderConstruction,t.endingIndices.contains(1)&&t.alignment===s.AlignmentType.Begin){if(e.RepetitonUnderConstruction.BackwardJumpInstructions.length>0||e.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)){e=void 0;for(let t=this.openRepetitions.length-1;t>=0;t--){const i=this.openRepetitions[t];if(0===i.RepetitonUnderConstruction.BackwardJumpInstructions.length)for(e=i;this.openRepetitions.length-1>t;){const t=this.openRepetitions.last();this.finalizeRepetition(t)}}void 0===e&&(e=this.createNewRepetition(0),e.RepetitonUnderConstruction.startMarker=new s.RepetitionInstruction(0,s.RepetitionInstructionEnum.None))}void 0===e.RepetitonUnderConstruction.forwardJumpInstruction&&(e.RepetitonUnderConstruction.forwardJumpInstruction=new s.RepetitionInstruction(this.currentMeasureIndex-1,s.RepetitionInstructionEnum.ForwardJump,s.AlignmentType.End,e.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[this.currentMeasureIndex-1].LastRepetitionInstructions.push(e.RepetitonUnderConstruction.forwardJumpInstruction))}if(t.alignment===s.AlignmentType.Begin)e.RepetitonUnderConstruction.setEndingsStartIndex(t.endingIndices,this.currentMeasureIndex),this.currentMeasure.FirstRepetitionInstructions.push(t);else for(let i=0,n=t.endingIndices.length;i0&&Math.abs(e.RepetitonUnderConstruction.BackwardJumpInstructions.last().measureIndex-this.currentMeasureIndex)<=1)break;if(this.openRepetitions.length&&this.openRepetitions.find((t=>t.RepetitonUnderConstruction.startMarker.type===s.RepetitionInstructionEnum.StartLine)).RepetitonUnderConstruction.StartIndex===this.currentMeasureIndex)break;e=this.createNewRepetition(this.currentMeasureIndex),t.parentRepetition=e.RepetitonUnderConstruction,e.RepetitonUnderConstruction.FromWords=!0,e.SegnoFound=!0,e.RepetitonUnderConstruction.startMarker=t,this.currentMeasure.FirstRepetitionInstructions.push(t);break;case s.RepetitionInstructionEnum.Fine:if(0===this.openRepetitions.length)break;if(e=this.getCurrentRepetition(!0),void 0===e)break;t.parentRepetition=e.RepetitonUnderConstruction,e.RepetitonUnderConstruction.FromWords=!0,void 0===e.RepetitonUnderConstruction.forwardJumpInstruction?(e.FineFound=!0,e.RepetitonUnderConstruction.forwardJumpInstruction=t,e.RepetitonUnderConstruction.setEndingStartIndex(2,-2),this.currentMeasure.LastRepetitionInstructions.push(t)):this.currentMeasure.LastRepetitionInstructions.push(new s.RepetitionInstruction(this.currentMeasureIndex,s.RepetitionInstructionEnum.Fine,s.AlignmentType.End,void 0));break;case s.RepetitionInstructionEnum.ToCoda:if(0===this.openRepetitions.length)break;if(e=this.getCurrentRepetition(!0),void 0===e)break;void 0===e.RepetitonUnderConstruction.forwardJumpInstruction&&(t.parentRepetition=e.RepetitonUnderConstruction,e.RepetitonUnderConstruction.FromWords=!0,e.ToCodaFound=!0,e.RepetitonUnderConstruction.forwardJumpInstruction=t,this.currentMeasure.LastRepetitionInstructions.push(t));break;case s.RepetitionInstructionEnum.Coda:if(0===this.openRepetitions.length)break;e=this.getOrCreateCurrentRepetition2(!0),t.parentRepetition=e.RepetitonUnderConstruction,e.WaitingForCoda?(e.CodaFound=!0,e.RepetitonUnderConstruction.setEndingStartIndex(2,this.currentMeasureIndex),this.currentMeasure.LastRepetitionInstructions.push(t),this.finalizeRepetition(e),this.currentMeasureIndex>0&&(this.musicSheet.SourceMeasures[this.currentMeasureIndex-1].printNewSystemXml=!0)):e.ToCodaFound||(0===e.RepetitonUnderConstruction.BackwardJumpInstructions.length?(e.ToCodaFound=!0,e.RepetitonUnderConstruction.forwardJumpInstruction=new s.RepetitionInstruction(this.currentMeasureIndex,s.RepetitionInstructionEnum.ToCoda,s.AlignmentType.End,e.RepetitonUnderConstruction),this.currentMeasure.LastRepetitionInstructions.push(e.RepetitonUnderConstruction.forwardJumpInstruction)):this.currentMeasure.LastRepetitionInstructions.push(new s.RepetitionInstruction(this.currentMeasureIndex,s.RepetitionInstructionEnum.Coda,s.AlignmentType.Begin,void 0)));break;case s.RepetitionInstructionEnum.DaCapo:e=this.getOrCreateCurrentRepetition(),e.RepetitonUnderConstruction.BackwardJumpInstructions.length>0&&this.finalizeRepetition(e),0!==e.RepetitonUnderConstruction.StartIndex&&(e=this.createNewRepetition(0)),t.parentRepetition=e.RepetitonUnderConstruction,e.RepetitonUnderConstruction.FromWords=!0,e.RepetitonUnderConstruction.startMarker=new s.RepetitionInstruction(0,s.RepetitionInstructionEnum.None,s.AlignmentType.Begin,e.RepetitonUnderConstruction),e.RepetitonUnderConstruction.BackwardJumpInstructions.push(t),this.currentMeasure.LastRepetitionInstructions.push(t),0===e.RepetitonUnderConstruction.EndingParts.length&&this.finalizeRepetition(e);break;case s.RepetitionInstructionEnum.DalSegno:if(e=this.getOrCreateCurrentRepetition2(!0),e.RepetitonUnderConstruction.BackwardJumpInstructions.length>0&&(this.finalizeRepetition(e),e=this.createNewRepetition(0),e.RepetitonUnderConstruction.FromWords=!0,e.RepetitonUnderConstruction.startMarker=new s.RepetitionInstruction(0,s.RepetitionInstructionEnum.None,s.AlignmentType.Begin,e.RepetitonUnderConstruction)),t.parentRepetition=e.RepetitonUnderConstruction,!e.SegnoFound){const i=this.findInstructionInMainListBackwards(s.RepetitionInstructionEnum.Segno,t.measureIndex);i>=0&&(e.SegnoFound=!0,e.RepetitonUnderConstruction.startMarker=new s.RepetitionInstruction(i,s.RepetitionInstructionEnum.Segno,s.AlignmentType.Begin,e.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[i].FirstRepetitionInstructions.splice(0,0,e.RepetitonUnderConstruction.startMarker))}e.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)&&e.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),e.RepetitonUnderConstruction.BackwardJumpInstructions.push(t),this.currentMeasure.LastRepetitionInstructions.push(t);break;case s.RepetitionInstructionEnum.DalSegnoAlFine:if(0===this.openRepetitions.length)break;if(e=this.getOrCreateCurrentRepetition2(!0),t.parentRepetition=e.RepetitonUnderConstruction,!e.SegnoFound){const i=this.findInstructionInMainListBackwards(s.RepetitionInstructionEnum.Segno,t.measureIndex);i>=0&&(e.SegnoFound=!0,e.RepetitonUnderConstruction.startMarker=new s.RepetitionInstruction(i,s.RepetitionInstructionEnum.Segno,s.AlignmentType.Begin,e.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[i].FirstRepetitionInstructions.splice(0,0,e.RepetitonUnderConstruction.startMarker))}if(!e.FineFound){const i=this.findInstructionInMainListBackwards(s.RepetitionInstructionEnum.Fine,t.measureIndex);i>=0&&(e.FineFound=!0,e.RepetitonUnderConstruction.forwardJumpInstruction=new s.RepetitionInstruction(i,s.RepetitionInstructionEnum.Fine,s.AlignmentType.Begin,e.RepetitonUnderConstruction),e.RepetitonUnderConstruction.setEndingStartIndex(2,-2),this.musicSheet.SourceMeasures[i].LastRepetitionInstructions.splice(0,0,e.RepetitonUnderConstruction.forwardJumpInstruction))}e.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)||e.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),e.RepetitonUnderConstruction.BackwardJumpInstructions.push(t),this.currentMeasure.LastRepetitionInstructions.push(t);break;case s.RepetitionInstructionEnum.DaCapoAlFine:if(e=this.getOrCreateCurrentRepetition(),e.RepetitonUnderConstruction.BackwardJumpInstructions.length>0&&(this.finalizeRepetition(e),e=this.createNewRepetition(0)),void 0!==e.RepetitonUnderConstruction.startMarker&&0!==e.RepetitonUnderConstruction.StartIndex&&(e=this.createNewRepetition(0)),e.RepetitonUnderConstruction.startMarker=new s.RepetitionInstruction(0,s.RepetitionInstructionEnum.None,s.AlignmentType.Begin,e.RepetitonUnderConstruction),e.RepetitonUnderConstruction.FromWords=!0,t.parentRepetition=e.RepetitonUnderConstruction,!e.FineFound){const i=this.findInstructionInMainListBackwards(s.RepetitionInstructionEnum.Fine,t.measureIndex);i>=0&&(e.FineFound=!0,e.RepetitonUnderConstruction.forwardJumpInstruction=new s.RepetitionInstruction(i,s.RepetitionInstructionEnum.Fine,s.AlignmentType.Begin,e.RepetitonUnderConstruction),e.RepetitonUnderConstruction.setEndingStartIndex(2,-2),this.musicSheet.SourceMeasures[i].LastRepetitionInstructions.splice(0,0,e.RepetitonUnderConstruction.forwardJumpInstruction))}e.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)||e.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),e.RepetitonUnderConstruction.BackwardJumpInstructions.push(t),this.currentMeasure.LastRepetitionInstructions.push(t);break;case s.RepetitionInstructionEnum.DalSegnoAlCoda:if(0===this.openRepetitions.length)break;if(e=this.getOrCreateCurrentRepetition2(!0),t.parentRepetition=e.RepetitonUnderConstruction,!e.SegnoFound){const i=this.findInstructionInMainListBackwards(s.RepetitionInstructionEnum.Segno,t.measureIndex);i>=0&&(e.SegnoFound=!0,e.RepetitonUnderConstruction.startMarker=new s.RepetitionInstruction(i,s.RepetitionInstructionEnum.Segno,s.AlignmentType.Begin,e.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[i].FirstRepetitionInstructions.splice(0,0,e.RepetitonUnderConstruction.startMarker))}if(!e.ToCodaFound){const i=this.findInstructionInMainListBackwards(s.RepetitionInstructionEnum.ToCoda,t.measureIndex);if(i>=0)e.RepetitonUnderConstruction.forwardJumpInstruction=new s.RepetitionInstruction(i,s.RepetitionInstructionEnum.ToCoda,s.AlignmentType.Begin,e.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[i].LastRepetitionInstructions.splice(0,0,e.RepetitonUnderConstruction.forwardJumpInstruction),e.ToCodaFound=!0;else{const i=this.findInstructionInMainListBackwards(s.RepetitionInstructionEnum.Coda,t.measureIndex);i>=0&&(e.RepetitonUnderConstruction.forwardJumpInstruction=new s.RepetitionInstruction(i,s.RepetitionInstructionEnum.ToCoda,s.AlignmentType.Begin,e.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[i].LastRepetitionInstructions.splice(0,0,e.RepetitonUnderConstruction.forwardJumpInstruction),e.ToCodaFound=!0)}}e.ToCodaFound&&(e.WaitingForCoda=!0),e.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)||e.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),e.RepetitonUnderConstruction.BackwardJumpInstructions.push(t),this.currentMeasure.LastRepetitionInstructions.push(t);break;case s.RepetitionInstructionEnum.DaCapoAlCoda:if(e=this.getOrCreateCurrentRepetition(),(e.RepetitonUnderConstruction.BackwardJumpInstructions.length>0||0===e.RepetitonUnderConstruction.EndingParts.length)&&(this.finalizeRepetition(e),e=this.createNewRepetition(0)),void 0!==e.RepetitonUnderConstruction.startMarker&&0!==e.RepetitonUnderConstruction.StartIndex&&(e=this.createNewRepetition(0)),e.RepetitonUnderConstruction.startMarker=new s.RepetitionInstruction(0,s.RepetitionInstructionEnum.None,s.AlignmentType.Begin,e.RepetitonUnderConstruction),e.RepetitonUnderConstruction.FromWords=!0,t.parentRepetition=e.RepetitonUnderConstruction,!e.ToCodaFound){const i=this.findInstructionInMainListBackwards(s.RepetitionInstructionEnum.ToCoda,t.measureIndex);if(i>=0)e.RepetitonUnderConstruction.forwardJumpInstruction=new s.RepetitionInstruction(i,s.RepetitionInstructionEnum.ToCoda,s.AlignmentType.Begin,e.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[i].LastRepetitionInstructions.splice(0,0,e.RepetitonUnderConstruction.forwardJumpInstruction),e.ToCodaFound=!0;else{const i=this.findInstructionInMainListBackwards(s.RepetitionInstructionEnum.Coda,t.measureIndex);i>=0&&(e.RepetitonUnderConstruction.forwardJumpInstruction=new s.RepetitionInstruction(i,s.RepetitionInstructionEnum.ToCoda,s.AlignmentType.Begin,e.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[i].LastRepetitionInstructions.splice(0,0,e.RepetitonUnderConstruction.forwardJumpInstruction),e.ToCodaFound=!0)}}e.ToCodaFound&&(e.WaitingForCoda=!0),e.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)||e.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),e.RepetitonUnderConstruction.BackwardJumpInstructions.push(t),this.currentMeasure.LastRepetitionInstructions.push(t);break;case s.RepetitionInstructionEnum.None:break;default:throw new o.ArgumentOutOfRangeException("currentRepetitionInstruction")}return!0}findInstructionInMainListBackwards(t,e){for(let i=this.repetitionInstructions.length-1;i>=0;i--){const n=this.repetitionInstructions[i];if(n.measureIndex<=e&&n.type===t)return n.measureIndex}return-1}finalizeRepetition(t){const e=t.RepetitonUnderConstruction;if(e.BackwardJumpInstructions.length>0){let t=!0;const i=this.getLastFinalizedRepetition();if(void 0!==i&&e.coversIdenticalMeasures(i)){if(e.NumberOfEndings>i.NumberOfEndings){const t=this.musicSheet.Repetitions.indexOf(i,0);t>-1&&this.musicSheet.Repetitions.splice(t,1),i.removeFromRepetitionInstructions(),this.musicSheet.Repetitions.push(e)}t=!1,e.removeFromRepetitionInstructions()}else this.musicSheet.Repetitions.push(e);t&&(e.startMarker.type===s.RepetitionInstructionEnum.None&&this.musicSheet.SourceMeasures[e.StartIndex].FirstRepetitionInstructions.push(e.startMarker),e.UserNumberOfRepetitions=e.DefaultNumberOfRepetitions)}this.openRepetitions.splice(this.openRepetitions.length-1,1)}getCurrentRepetition(t){let e;for(let i=this.openRepetitions.length-1;i>=0;i--)if(this.openRepetitions[i].RepetitonUnderConstruction.FromWords===t){for(e=this.openRepetitions[i];i0)return this.openRepetitions.last();const t=this.createNewRepetition(0);return t.RepetitonUnderConstruction.startMarker=new s.RepetitionInstruction(0,s.RepetitionInstructionEnum.None,s.AlignmentType.Begin,t.RepetitonUnderConstruction),t}getOrCreateCurrentRepetition2(t){let e;if(this.openRepetitions.length&&this.openRepetitions.last().RepetitonUnderConstruction.EndingParts.length<2)for(let i=this.openRepetitions.length-1;i>=0;i--)if(e=this.openRepetitions[i],e.RepetitonUnderConstruction.FromWords===t){for(;i0){const t=this.openRepetitions.last(),e=t.RepetitonUnderConstruction;if(e.BackwardJumpInstructions.length>0){const i=Object.keys(e.EndingIndexDict);(0===i.length||e.EndingIndexDict[i[i.length-1]].part.EndIndex>=0)&&this.finalizeRepetition(t)}}const e=new h(this.musicSheet);return this.lastRepetitionCommonPartStartIndex=t,this.openRepetitions.push(e),e}getLastFinalizedRepetition(){if(this.musicSheet.Repetitions.length>0)return this.musicSheet.Repetitions.last()}};class h{constructor(t){this.RepetitonUnderConstruction=new a.Repetition(t)}}e.RepetitionBuildingContainer=h},9934:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RepetitionInstructionReader=void 0;const n=i(6189),s=i(6189),r=i(1211);e.RepetitionInstructionReader=class{set MusicSheet(t){this.musicSheet=t,this.xmlMeasureList=new Array(this.musicSheet.Instruments.length),this.repetitionInstructions=[]}prepareReadingMeasure(t,e){this.currentMeasureIndex=e}handleLineRepetitionInstructions(t){let e=!1;if(t.elements().length>0){let i="",s=!1,r="",o="",a="";const l=[],h=t.element("bar-style");h&&(a=h.value),i=t.attributes().length>0&&t.attribute("location")?t.attribute("location").value:"right";const u=t.elements();for(let t=0,e=u.length;t0)if("left"===i){if("start"===o){const t=new n.RepetitionInstruction(this.currentMeasureIndex,n.RepetitionInstructionEnum.Ending,n.AlignmentType.Begin,void 0,l);this.addInstruction(this.repetitionInstructions,t)}if("forward"===r){const t=new n.RepetitionInstruction(this.currentMeasureIndex,n.RepetitionInstructionEnum.StartLine);this.addInstruction(this.repetitionInstructions,t)}}else{if("stop"===o){const t=new n.RepetitionInstruction(this.currentMeasureIndex,n.RepetitionInstructionEnum.Ending,n.AlignmentType.End,void 0,l);this.addInstruction(this.repetitionInstructions,t)}if("backward"===r){const t=new n.RepetitionInstruction(this.currentMeasureIndex,n.RepetitionInstructionEnum.BackJumpLine);this.addInstruction(this.repetitionInstructions,t)}}}return e}handleRepetitionInstructionsFromWordsOrSymbols(t,e){const i=t.element("words"),s=this.currentMeasureIndex;if(i){const t="d\\s?\\.s\\.",e=i.value.trim().toLowerCase();if(r.StringUtil.StringContainsSeparatedWord(e,t+" al fine",!0)){const t=new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.DalSegnoAlFine);return this.addInstruction(this.repetitionInstructions,t),!0}if(r.StringUtil.StringContainsSeparatedWord(e,t+" al coda",!0)){const t=new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.DalSegnoAlCoda);return this.addInstruction(this.repetitionInstructions,t),!0}const o="d\\.\\s?c\\.";if(r.StringUtil.StringContainsSeparatedWord(e,o+" al fine",!0)){const t=new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.DaCapoAlFine);return this.addInstruction(this.repetitionInstructions,t),!0}if(r.StringUtil.StringContainsSeparatedWord(e,o+" al coda",!0)){const t=new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.DaCapoAlCoda);return this.addInstruction(this.repetitionInstructions,t),!0}if(r.StringUtil.StringContainsSeparatedWord(e,o)||r.StringUtil.StringContainsSeparatedWord(e,"da\\s?capo",!0)){const t=new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.DaCapo);return this.addInstruction(this.repetitionInstructions,t),!0}if(r.StringUtil.StringContainsSeparatedWord(e,t,!0)||r.StringUtil.StringContainsSeparatedWord(e,"dal\\s?segno",!0)){let t;return t=r.StringUtil.StringContainsSeparatedWord(e,"al\\s?coda",!0)?new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.DalSegnoAlCoda):new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.DalSegno),this.addInstruction(this.repetitionInstructions,t),!0}if(r.StringUtil.StringContainsSeparatedWord(e,"to\\s?coda",!0)||r.StringUtil.StringContainsSeparatedWord(e,"a (la )?coda",!0)){const t=new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.ToCoda);return this.addInstruction(this.repetitionInstructions,t),!0}if(r.StringUtil.StringContainsSeparatedWord(e,"fine",!0)){const t=new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.Fine);return this.addInstruction(this.repetitionInstructions,t),!0}if(r.StringUtil.StringContainsSeparatedWord(e,"coda",!0)){const t=new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.Coda);return this.addInstruction(this.repetitionInstructions,t),!0}if(r.StringUtil.StringContainsSeparatedWord(e,"segno",!0)){const t=new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.Segno);return this.addInstruction(this.repetitionInstructions,t),!0}}else{if(t.element("segno")){const t=new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.Segno);return this.addInstruction(this.repetitionInstructions,t),!0}if(t.element("coda")){const t=new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.Coda);return this.addInstruction(this.repetitionInstructions,t),!0}}return!1}removeRedundantInstructions(){let t=0,e=0,i=0,r=0;for(let s=0;s0&&this.findInstructionInPreviousMeasure(s,o.measureIndex,n.RepetitionInstructionEnum.ToCoda)&&(o.type=n.RepetitionInstructionEnum.None),0===e&&0===i&&(o.type=n.RepetitionInstructionEnum.ToCoda,o.alignment=n.AlignmentType.End,o.measureIndex--);break;case n.RepetitionInstructionEnum.Segno:if(t-r>0){let t=!1;for(let s=0,r=this.repetitionInstructions.length;s0?n.RepetitionInstructionEnum.DalSegnoAlCoda:n.RepetitionInstructionEnum.DalSegno,o.type=n.RepetitionInstructionEnum.None,t=!0;break;case n.RepetitionInstructionEnum.DalSegno:case n.RepetitionInstructionEnum.DalSegnoAlFine:case n.RepetitionInstructionEnum.DalSegnoAlCoda:o.type=n.RepetitionInstructionEnum.None,t=!0}if(t)break}if(t)break;o.type=i-e>0?n.RepetitionInstructionEnum.DalSegnoAlCoda:n.RepetitionInstructionEnum.DalSegno,o.alignment=n.AlignmentType.End,o.measureIndex--}}if(this.backwardSearchForPreviousIdenticalInstruction(s,o)||o.type===n.RepetitionInstructionEnum.None)this.repetitionInstructions.splice(s,1),s--;else switch(o.type){case n.RepetitionInstructionEnum.Fine:break;case n.RepetitionInstructionEnum.ToCoda:i++;break;case n.RepetitionInstructionEnum.Coda:e++;break;case n.RepetitionInstructionEnum.Segno:t++;break;case n.RepetitionInstructionEnum.DalSegnoAlFine:case n.RepetitionInstructionEnum.DalSegnoAlCoda:r++}}this.repetitionInstructions.sort(s.RepetitionInstructionComparer.Compare)}findInstructionInPreviousMeasure(t,e,i){for(let n=t-1;n>=0;n--){const t=this.repetitionInstructions[n];if(e-t.measureIndex==1&&t.type===i)return!0}return!1}backwardSearchForPreviousIdenticalInstruction(t,e){for(let i=t-1;i>=0;i--)if(this.repetitionInstructions[i].equals(e))return!0;return!1}addInstruction(t,e){let i=!0;for(let n=0,s=t.length;n0){const t=i.attribute("type").value;let n=1;try{i.attribute("number")&&(n=parseInt(i.attribute("number").value,10))}catch(t){r.default.debug("VoiceGenerator.addSlur number: ",t)}let o=a.PlacementEnum.NotYetDefined;const l=i.attribute("placement");l&&l.value&&("above"===l.value?o=a.PlacementEnum.Above:"below"===l.value&&(o=a.PlacementEnum.Below));const h=i.attribute("orientation");if(h&&h.value&&("over"===h.value?o=a.PlacementEnum.Above:"under"===h.value&&(o=a.PlacementEnum.Below)),"start"===t){let t=this.openSlurDict[n];t||(t=new s.Slur,this.openSlurDict[n]=t),t.StartNote=e,t.PlacementXml=o}else if("stop"===t){const t=this.openSlurDict[n];t&&(t.EndNote=e,e.checkForDoubleSlur(t)||(e.NoteSlurs.push(t),t.StartNote.NoteSlurs.push(t)),delete this.openSlurDict[n])}}}catch(t){const e=o.ITextTranslation.translateText("ReaderErrorMessages/SlurError","Error while reading slur.");this.musicSheet.SheetErrors.pushMeasureError(e)}}}},1651:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(7677),e),s(i(2905),e),s(i(8198),e),s(i(4671),e),s(i(2535),e),s(i(6789),e),s(i(9934),e),s(i(3755),e)},2458:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ReaderPluginManager=void 0;const s=n(i(2043));e.ReaderPluginManager=class{constructor(){this.voiceMeasureReadPlugins=[]}addVoiceMeasureReadPlugin(t){this.voiceMeasureReadPlugins.push(t)}processVoiceMeasureReadPlugins(t,e,i){for(const n of this.voiceMeasureReadPlugins)try{n.measureReadCalculations(t,e,i)}catch(t){s.default.info("VoiceGenerator.addSingleNote: ",t)}}}},8109:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VoiceGenerator=void 0;const s=i(2947),r=i(3884),o=i(908),a=i(5253),l=i(9050),h=i(9224),u=i(4555),c=i(5544),d=i(8069),p=i(1797),f=i(6331),m=i(2535),g=i(1703),b=i(8640),y=i(8640),S=i(4447),v=n(i(2043)),_=i(8640),x=i(2337),E=i(7677),M=i(766),w=i(3029),P=i(2478),T=i(2953),C=i(3748);e.VoiceGenerator=class{constructor(t,e,i,n,o=void 0){this.openBeams=[],this.beamNumberOffset=0,this.currentOctaveShift=0,this.tupletDict={},this.openTupletNumber=0,this.currMeasureVoiceEntries=[],this.graceVoiceEntriesTempList=[],this.staff=e,this.instrument=e.ParentInstrument,this.musicSheet=this.instrument.GetMusicSheet,this.slurReader=n,this.pluginManager=t,this.voice=o?new s.LinkedVoice(this.instrument,i,o):new r.Voice(this.instrument,i),this.instrument.Voices.push(this.voice),this.staff.Voices.push(this.voice),this.lyricsReader=new m.LyricsReader(this.musicSheet),this.articulationReader=new E.ArticulationReader(this.musicSheet.Rules)}get openTieDict(){return this.staff.openTieDict}get GetVoice(){return this.voice}get OctaveShift(){return this.currentOctaveShift}set OctaveShift(t){this.currentOctaveShift=t}createVoiceEntry(t,e,i,n,s=!1,r=!1,a=!1){this.activeKey=i,this.activeRhythm=n,this.currentVoiceEntry=new o.VoiceEntry(p.Fraction.createFromFraction(t),this.voice,e,!0,s,r,a),s?this.graceVoiceEntriesTempList.push(this.currentVoiceEntry):(this.currentNormalVoiceEntry=this.currentVoiceEntry,this.currMeasureVoiceEntries.push(this.currentNormalVoiceEntry),this.graceVoiceEntriesTempList.length>0&&(this.currentVoiceEntry.GraceVoiceEntriesBefore=this.graceVoiceEntriesTempList,this.graceVoiceEntriesTempList=[]))}finalizeReadingMeasure(){this.graceVoiceEntriesTempList.length>0&&void 0!==this.currentNormalVoiceEntry&&this.currentNormalVoiceEntry.GraceVoiceEntriesAfter.concat(this.graceVoiceEntriesTempList),this.graceVoiceEntriesTempList=[],this.pluginManager.processVoiceMeasureReadPlugins(this.currMeasureVoiceEntries,this.activeKey,this.activeRhythm),this.currMeasureVoiceEntries.length=0,this.openBeams.length>1&&this.handleOpenBeam()}read(t,e,i,n,s,r,o,a,l,h,u,d,p,m,g,b,y,S,_,x,E,M,P){this.currentStaffEntry=o,this.currentMeasure=a;try{this.currentNote=r?this.addRestNote(t.element("rest"),e,n,s,p,m,_):this.addSingleNote(t,e,n,i,s,u,d,p,m,g,b,y,S,_,E,M,P),this.currentNote.DotsXml=x;const o=t.elements("lyric");void 0!==this.lyricsReader&&o&&(this.lyricsReader.addLyricEntry(o,this.currentVoiceEntry),this.voice.Parent.HasLyrics=!0);let a=!1;const f=t.element("notations");if(f){this.articulationReader&&this.readArticulations(f,this.currentVoiceEntry,this.currentNote);const e=f.elements("slur");void 0!==this.slurReader&&e.length>0&&!this.currentNote.ParentVoiceEntry.IsGrace&&this.slurReader.addSlur(e,this.currentNote);const i=f.elements("tuplet");i.length>0&&(this.openTupletNumber=this.addTuplet(t,i),a=!0);const n=f.element("arpeggiate");if(void 0!==n){let t;if(this.currentVoiceEntry.Arpeggio)t=this.currentVoiceEntry.Arpeggio;else{let e=!1;for(const i of this.currentStaffEntry.VoiceEntries)if(i.Arpeggio){e=!0,t=i.Arpeggio;break}if(!e){let e=w.ArpeggioType.ARPEGGIO_DIRECTIONLESS;const i=n.attribute("direction");if(i)switch(i.value){case"up":e=w.ArpeggioType.ROLL_UP;break;case"down":e=w.ArpeggioType.ROLL_DOWN;break;default:e=w.ArpeggioType.ARPEGGIO_DIRECTIONLESS}t=new w.Arpeggio(this.currentVoiceEntry,e),this.currentVoiceEntry.Arpeggio=t}}t.addNote(this.currentNote)}const s=f.elements("tied");s.length>0&&this.addTie(s,l,h,c.TieTypes.SIMPLE);const r=f.elements("slide");r.length>0&&this.addTie(r,l,h,c.TieTypes.SLIDE);const o=f.element("technical");if(o){const t=o.elements("hammer-on");t.length>0&&this.addTie(t,l,h,c.TieTypes.HAMMERON);const e=o.elements("pull-off");e.length>0&&this.addTie(e,l,h,c.TieTypes.PULLOFF)}}void 0===t.element("time-modification")||a||this.handleTimeModificationNode(t)}catch(t){v.default.warn(t);const e=f.ITextTranslation.translateText("ReaderErrorMessages/NoteError","Ignored erroneous Note.");this.musicSheet.SheetErrors.pushMeasureError(e),this.musicSheet.SheetErrors.pushMeasureError(t)}return this.currentNote}checkForStaffEntryLink(t,e,i,n){const s=new S.StaffEntryLink(this.currentVoiceEntry);s.LinkStaffEntries.push(i),i.Link=s;const r=this.currentVoiceEntry.Timestamp.clone(),o=n.getVerticalContainerByTimestamp(r);return(i=o.StaffEntries[t])||(i=new l.SourceStaffEntry(o,e),o.StaffEntries[t]=i),i.VoiceEntries.push(this.currentVoiceEntry),s.LinkStaffEntries.push(i),i.Link=s,i}checkForOpenBeam(){this.openBeams.length>0&&this.currentNote&&this.handleOpenBeam()}checkOpenTies(){const t=this.openTieDict;for(const e in t)if(t.hasOwnProperty(e)){const i=t[e];p.Fraction.plus(i.StartNote.ParentStaffEntry.Timestamp,i.Duration).lt(i.StartNote.SourceMeasure.Duration)&&delete t[e]}}hasVoiceEntry(){return void 0!==this.currentVoiceEntry}readArticulations(t,e,i){const n=t.element("articulations");n&&this.articulationReader.addArticulationExpression(n,e);const s=t.element("fermata");s&&this.articulationReader.addFermata(s,e);const r=t.element("technical");r&&this.articulationReader.addTechnicalArticulations(r,e,i);const o=t.element("ornaments");o&&this.articulationReader.addOrnament(o,e)}addSingleNote(t,e,i,n,s,r,l,h,u,c,d,m,S,x,E,w,P){let C,A,I,L,R=0,N=b.AccidentalEnum.NONE,k=y.NoteEnum.C,O=y.NoteEnum.C,D=0,B=0;const F=t.elements();for(let t=0,e=F.length;t0&&this.openBeams.last().ExtendedNoteList.push(m),m}addNoteInfo(t,e,i,n,s,r,o,a,l,h){t.NoteTypeXml=e,t.PrintObject=i,t.IsCueNote=n,t.NormalNotes=s,t.displayStepUnpitched=r,t.displayOctaveUnpitched=o,t.NoteheadColorXml=a,t.NoteheadColor=a,h&&(t.isDotNote=h)}createBeam(t,e){var i;try{const n=t.element("beam");let s;if(void 0!==n&&n.hasAttributes&&(s=n.attribute("number")),s){let n=parseInt(s.value,10);const r=t.elements("beam"),o=r[0].value;r&&("begin"===o?(n===(null===(i=this.openBeams.last())||void 0===i?void 0:i.BeamNumber)?(this.beamNumberOffset++,n+=this.beamNumberOffset):this.openBeams.last()&&this.handleOpenBeam(),this.openBeams.push(new h.Beam(n,this.beamNumberOffset))):n+=this.beamNumberOffset);let a=!1;if(!(n>0&&n<=this.openBeams.length&&this.openBeams[n-1]))return void v.default.debug("[OSMD] invalid beamnumber");for(let t=0,e=this.openBeams[n-1].Notes.length;t1){let n=t.element("time-modification");n&&(n=n.element("actual-notes"));const s=e;for(let e=0,r=s.length;e1&&this.openTupletNumber--),this.tupletDict[e]=o;const l=[];l.push(this.currentNote),o.Notes.push(l),o.Fractions.push(this.getTupletNoteDurationFromType(t)),this.currentNote.NoteTuplet=o,this.openTupletNumber=e}else if("stop"===s.value){let e=1;r.attribute("number")&&(e=parseInt(r.attribute("number").value,10));const i=this.tupletDict[e];if(i){const n=r.attribute("placement");n&&("below"===n.value?i.tupletLabelNumberPlacement=C.PlacementEnum.Below:i.tupletLabelNumberPlacement=C.PlacementEnum.Above,i.PlacementFromXml=!0);const s=[];if(s.push(this.currentNote),i.Notes.push(s),!i.PlacementFromXml){let t=!1;for(const e of i.Notes){for(const n of e)if(!n.isRest()){n.StemDirectionXml===o.StemDirectionType.Down?i.tupletLabelNumberPlacement=C.PlacementEnum.Below:i.tupletLabelNumberPlacement=C.PlacementEnum.Above,t=!0;break}if(t)break}}i.Fractions.push(this.getTupletNoteDurationFromType(t)),this.currentNote.NoteTuplet=i,delete this.tupletDict[e],0===Object.keys(this.tupletDict).length?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--}}}}}else if(e[0]){const n=e[0];if(n.hasAttributes){const e=n.attribute("type").value;let s=1;n.attribute("number")&&(s=parseInt(n.attribute("number").value,10));const r=isNaN(s),a=n.attribute("bracket");if(a&&"yes"===a.value&&(i=!0),"start"===e){let e=0,o=t.element("time-modification");if(o&&(o=o.element("actual-notes")),o&&(e=parseInt(o.value,10),isNaN(e))){const t=f.ITextTranslation.translateText("ReaderErrorMessages/TupletNoteDurationError","Invalid tuplet note duration.");throw this.musicSheet.SheetErrors.pushMeasureError(t),new g.MusicSheetReadingException(t)}r&&(this.openTupletNumber++,s=this.openTupletNumber);let a=this.tupletDict[s];a||(a=this.tupletDict[s]=new d.Tuplet(e,i),a.tupletLabelNumberPlacement=C.PlacementEnum.Above);const l=n.attribute("placement");l&&("below"===l.value?a.tupletLabelNumberPlacement=C.PlacementEnum.Below:a.tupletLabelNumberPlacement=C.PlacementEnum.Above,a.PlacementFromXml=!0);const h=[];h.push(this.currentNote),a.Notes.push(h),a.Fractions.push(this.getTupletNoteDurationFromType(t)),this.currentNote.NoteTuplet=a,this.openTupletNumber=s}else if("stop"===e){r&&(s=this.openTupletNumber);const e=this.tupletDict[this.openTupletNumber];if(e){const i=n.attribute("placement");i&&("below"===i.value?e.tupletLabelNumberPlacement=C.PlacementEnum.Below:e.tupletLabelNumberPlacement=C.PlacementEnum.Above,e.PlacementFromXml=!0);const r=[];if(r.push(this.currentNote),e.Notes.push(r),!e.PlacementFromXml){let t=!1;for(const i of e.Notes){for(const n of i)if(!n.isRest()){n.StemDirectionXml===o.StemDirectionType.Down?e.tupletLabelNumberPlacement=C.PlacementEnum.Below:e.tupletLabelNumberPlacement=C.PlacementEnum.Above,t=!0;break}if(t)break}}e.Fractions.push(this.getTupletNoteDurationFromType(t)),this.currentNote.NoteTuplet=e,0===Object.keys(this.tupletDict).length?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--,delete this.tupletDict[s]}}}}return this.openTupletNumber}handleTimeModificationNode(t){if(this.tupletDict[this.openTupletNumber])try{const e=this.tupletDict[this.openTupletNumber],i=x.CollectionUtil.last(e.Notes);let n;i[0].ParentVoiceEntry.Timestamp.Equals(this.currentVoiceEntry.Timestamp)?n=i:(n=[],e.Notes.push(n),e.Fractions.push(this.getTupletNoteDurationFromType(t))),n.push(this.currentNote),this.currentNote.NoteTuplet=e}catch(t){const e=f.ITextTranslation.translateText("ReaderErrorMessages/TupletNumberError","Invalid tuplet number.");throw this.musicSheet.SheetErrors.pushMeasureError(e),t}else if(this.currentVoiceEntry.Notes.length>0){const t=this.currentVoiceEntry.Notes[0];if(t.NoteTuplet){const e=t.NoteTuplet;x.CollectionUtil.last(e.Notes).push(this.currentNote),this.currentNote.NoteTuplet=e}}}addTie(t,e,i,n){if(t)if(1===t.length){const e=t[0];if(void 0!==e&&e.attributes()){const t=this.getTieDirection(e),i=e.attribute("type").value;try{if("start"===i){const e=this.findCurrentNoteInTieDict(this.currentNote);e<0&&delete this.openTieDict[e];const i=this.getNextAvailableNumberForTie(),s=new u.Tie(this.currentNote,n);this.openTieDict[i]=s,s.TieNumber=i,s.TieDirection=t}else if("stop"===i){const t=this.findCurrentNoteInTieDict(this.currentNote),e=this.openTieDict[t];e&&(e.AddNote(this.currentNote),delete this.openTieDict[t])}}catch(t){const e=f.ITextTranslation.translateText("ReaderErrorMessages/TieError","Error while reading tie.");this.musicSheet.SheetErrors.pushMeasureError(e)}}}else if(2===t.length){const e=this.findCurrentNoteInTieDict(this.currentNote);if(e>=0){const i=this.openTieDict[e];i.AddNote(this.currentNote);for(const e of t)if("start"===e.attribute("type").value){const t=this.getTieDirection(e);i.NoteIndexToTieDirection[i.Notes.length-1]=t}}}}getTieDirection(t){let e=C.PlacementEnum.NotYetDefined;const i=t.attribute("placement");i&&("above"===i.value?e=C.PlacementEnum.Above:"below"===i.value&&(e=C.PlacementEnum.Below));const n=t.attribute("orientation");return n&&("over"===n.value?e=C.PlacementEnum.Above:"under"===n.value&&(e=C.PlacementEnum.Below)),e}getNextAvailableNumberForTie(){const t=Object.keys(this.openTieDict);if(0===t.length)return 1;t.sort(((t,e)=>+t-+e));for(let e=0;e{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.ArpeggioType=e.Arpeggio=void 0,e.Arpeggio=class{constructor(t,e=i.ARPEGGIO_DIRECTIONLESS){this.parentVoiceEntry=t,this.type=e,this.notes=[]}addNote(t){this.notes.push(t),t.Arpeggio=this}},function(t){t[t.BRUSH_DOWN=1]="BRUSH_DOWN",t[t.BRUSH_UP=2]="BRUSH_UP",t[t.ROLL_DOWN=3]="ROLL_DOWN",t[t.ROLL_UP=4]="ROLL_UP",t[t.RASQUEDO_DOWN=5]="RASQUEDO_DOWN",t[t.RASQUEDO_UP=6]="RASQUEDO_UP",t[t.ARPEGGIO_DIRECTIONLESS=7]="ARPEGGIO_DIRECTIONLESS"}(i=e.ArpeggioType||(e.ArpeggioType={}))},1662:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Articulation=void 0,e.Articulation=class{constructor(t,e){this.articulationEnum=t,this.placement=e}Equals(t){return t.articulationEnum===this.articulationEnum&&t.placement===this.placement}}},9224:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.BeamEnum=e.Beam=void 0,e.Beam=class{constructor(t=1,e=0){this.notes=[],this.extendedNoteList=[],this.BeamNumberOffsetToXML=0,this.BeamNumber=t,this.BeamNumberOffsetToXML=e}get Notes(){return this.notes}set Notes(t){this.notes=t}get ExtendedNoteList(){return this.extendedNoteList}set ExtendedNoteList(t){this.extendedNoteList=t}addNoteToBeam(t){t&&(t.NoteBeam=this,this.notes.push(t),this.extendedNoteList.push(t))}},(i=e.BeamEnum||(e.BeamEnum={}))[i.BeamNone=-1]="BeamNone",i[i.BeamBegin=0]="BeamBegin",i[i.BeamContinue=1]="BeamContinue",i[i.BeamEnd=2]="BeamEnd",i[i.BeamForward=3]="BeamForward",i[i.BeamBackward=4]="BeamBackward"},4123:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChordSymbolEnum=e.ChordDegreeText=e.CustomChord=e.Degree=e.ChordSymbolContainer=void 0;const n=i(8640),s=i(4040),r=i(8640);e.ChordSymbolContainer=class{constructor(t,e,i,n,s){this.rootPitch=t,this.chordKind=e,this.bassPitch=i,this.degrees=n,this.rules=s}get RootPitch(){return this.rootPitch}get ChordKind(){return this.chordKind}get BassPitch(){return this.bassPitch}get ChordDegrees(){return this.degrees}static calculateChordText(t,e,i){let o=t.RootPitch;if(s.MusicSheetCalculator.transposeCalculator&&(o=s.MusicSheetCalculator.transposeCalculator.transposePitch(t.RootPitch,i,e)),t.ChordKind===l.none)return t.getTextFromChordKindEnum(t.ChordKind);let h=n.Pitch.getNoteEnumString(o.FundamentalNote);o.Accidental!==r.AccidentalEnum.NONE&&(h+=this.getTextForAccidental(o.Accidental));const u={adds:[],alts:[],subs:[]};for(const e of t.ChordDegrees)if(e){let t="";switch(e.alteration!==r.AccidentalEnum.NONE&&(t+=this.getTextForAccidental(e.alteration)),t+=e.value,e.text){case a.add:u.adds.push(t);break;case a.alter:u.alts.push(t);break;case a.subtract:u.subs.push(t)}}let c=t.getTextFromChordKindEnum(t.ChordKind);const d=["adds","alts","subs"],p=t.rules.CustomChords;for(const e of p){if(e.chordKind!==t.chordKind)continue;let i=!0;for(const t of d){for(const n of e.degrees[t]||[])if(u[t].indexOf(n)<0){i=!1;break}if(!i)break}if(i){for(const t of d)for(const i of e.degrees[t]||[])u[t].splice(u[t].indexOf(i),1);c=e.alternateName}}if(h+=c,u.adds.length>0&&(h+="("+u.adds.join(",")+")"),u.alts.length>0&&(h+="(alt "+u.alts.join(",")+")"),u.subs.length>0&&(h+="(omit "+u.subs.join(",")+")"),t.BassPitch){let r=t.BassPitch;s.MusicSheetCalculator.transposeCalculator&&(r=s.MusicSheetCalculator.transposeCalculator.transposePitch(t.BassPitch,i,e)),h+="/",h+=n.Pitch.getNoteEnumString(r.FundamentalNote),h+=this.getTextForAccidental(r.Accidental)}return h}static getTextForAccidental(t){let e="";switch(t){case r.AccidentalEnum.DOUBLEFLAT:e+="bb";break;case r.AccidentalEnum.FLAT:e+="b";break;case r.AccidentalEnum.SHARP:e+="#";break;case r.AccidentalEnum.DOUBLESHARP:e+="x"}return e}getTextFromChordKindEnum(t){var e;return null!==(e=this.rules.ChordSymbolLabelTexts.getValue(t))&&void 0!==e?e:""}},e.Degree=class{constructor(t,e,i){this.value=t,this.alteration=e,this.text=i}};class o{constructor(t,e,i){this.alternateName=t,this.chordKind=e,this.degrees=i}static createCustomChord(t,e,i){return new o(t,e,i)}static renameCustomChord(t,e,i){for(const n of i)n.alternateName===t&&(n.alternateName=e)}}var a,l;e.CustomChord=o,function(t){t[t.add=0]="add",t[t.alter=1]="alter",t[t.subtract=2]="subtract"}(a=e.ChordDegreeText||(e.ChordDegreeText={})),function(t){t[t.major=0]="major",t[t.minor=1]="minor",t[t.augmented=2]="augmented",t[t.diminished=3]="diminished",t[t.dominant=4]="dominant",t[t.majorseventh=5]="majorseventh",t[t.minorseventh=6]="minorseventh",t[t.diminishedseventh=7]="diminishedseventh",t[t.augmentedseventh=8]="augmentedseventh",t[t.halfdiminished=9]="halfdiminished",t[t.majorminor=10]="majorminor",t[t.majorsixth=11]="majorsixth",t[t.minorsixth=12]="minorsixth",t[t.dominantninth=13]="dominantninth",t[t.majorninth=14]="majorninth",t[t.minorninth=15]="minorninth",t[t.dominant11th=16]="dominant11th",t[t.major11th=17]="major11th",t[t.minor11th=18]="minor11th",t[t.dominant13th=19]="dominant13th",t[t.major13th=20]="major13th",t[t.minor13th=21]="minor13th",t[t.suspendedsecond=22]="suspendedsecond",t[t.suspendedfourth=23]="suspendedfourth",t[t.Neapolitan=24]="Neapolitan",t[t.Italian=25]="Italian",t[t.French=26]="French",t[t.German=27]="German",t[t.pedal=28]="pedal",t[t.power=29]="power",t[t.Tristan=30]="Tristan",t[t.none=31]="none"}(l=e.ChordSymbolEnum||(e.ChordSymbolEnum={}))},3748:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.PlacementEnum=e.AbstractExpression=void 0,e.AbstractExpression=class{constructor(t){this.placement=t}static isStringInStringList(t,e){for(let i=0,n=t.length;i{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractTempoExpression=void 0;const n=i(3748);class s extends n.AbstractExpression{constructor(t,e,i,n){super(e),this.label=t,this.staffNumber=i,this.parentMultiTempoExpression=n}get Label(){return this.label}set Label(t){this.label=t}get Placement(){return this.placement}set Placement(t){this.placement=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get ParentMultiTempoExpression(){return this.parentMultiTempoExpression}static isStringInStringList(t,e){for(const i of t)if(s.stringContainsSeparatedWord(e.toLowerCase().trim(),i.toLowerCase().trim()))return!0;return!1}static stringContainsSeparatedWord(t,e){return t===e||-1!==t.indexOf(" "+e)||-1!==t.indexOf(e+" ")}}e.AbstractTempoExpression=s},7839:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContDynamicEnum=e.ContinuousDynamicExpression=void 0;const n=i(3748),s=i(1797);class r extends n.AbstractExpression{constructor(t,e,i,n,s,r,o=""){super(e),super.parentMeasure=n,this.NumberXml=r,this.dynamicType=t,this.label=o,this.staffNumber=i,this.activeInstantaneousDynamic=s,this.startVolume=1,this.endVolume=1,this.setStartAndEndVolume(),""!==o&&this.setType()}setStartAndEndVolume(){this.activeInstantaneousDynamic&&(this.dynamicType===o.crescendo&&(this.startVolume=this.activeInstantaneousDynamic.Volume,this.endVolume=1.2*this.activeInstantaneousDynamic.Volume),this.dynamicType===o.diminuendo&&(this.startVolume=this.activeInstantaneousDynamic.Volume,this.endVolume=.8*this.activeInstantaneousDynamic.Volume))}get DynamicType(){return this.dynamicType}set DynamicType(t){this.dynamicType=t}get StartMultiExpression(){return this.startMultiExpression}set StartMultiExpression(t){this.startMultiExpression=t}get EndMultiExpression(){return this.endMultiExpression}set EndMultiExpression(t){this.endMultiExpression=t}get Placement(){return this.placement}set Placement(t){this.placement=t}get StartVolume(){return this.startVolume}set StartVolume(t){this.startVolume=t}get EndVolume(){return this.endVolume}set EndVolume(t){this.endVolume=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get Label(){return this.label}set Label(t){this.label=t,this.setType()}static isInputStringContinuousDynamic(t){return!!t&&(r.isStringInStringList(r.listContinuousDynamicIncreasing,t)||r.isStringInStringList(r.listContinuousDynamicDecreasing,t))}getInterpolatedDynamic(t){const e=this.StartMultiExpression.AbsoluteTimestamp;let i;if(i=this.EndMultiExpression?this.EndMultiExpression.AbsoluteTimestamp:s.Fraction.plus(this.startMultiExpression.SourceMeasureParent.AbsoluteTimestamp,this.startMultiExpression.SourceMeasureParent.Duration),t.lt(e))return-1;if(i.lt(t))return-2;const n=s.Fraction.minus(t,e).RealValue/s.Fraction.minus(i,e).RealValue;return Math.max(0,Math.min(99.9,this.startVolume+(this.endVolume-this.startVolume)*n))}isWedge(){return!this.label}setType(){r.isStringInStringList(r.listContinuousDynamicIncreasing,this.label)?this.dynamicType=o.crescendo:r.isStringInStringList(r.listContinuousDynamicDecreasing,this.label)&&(this.dynamicType=o.diminuendo)}}var o;e.ContinuousDynamicExpression=r,r.listContinuousDynamicIncreasing=["crescendo","cresc","cresc.","cres."],r.listContinuousDynamicDecreasing=["decrescendo","decresc","decr.","diminuendo","dim.","dim"],function(t){t[t.crescendo=0]="crescendo",t[t.diminuendo=1]="diminuendo"}(o=e.ContDynamicEnum||(e.ContDynamicEnum={}))},280:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContinuousTempoType=e.ContinuousTempoExpression=void 0;const n=i(1797),s=i(9775);class r extends s.AbstractTempoExpression{constructor(t,e,i,n){super(t,e,i,n),this.setTempoType()}static isInputStringContinuousTempo(t){return!!t&&(r.isStringInStringList(r.listContinuousTempoFaster,t)||r.isStringInStringList(r.listContinuousTempoSlower,t))}static isIncreasingTempo(t){return t<=o.piuMosso}static isDecreasingTempo(t){return t>=o.allargando&&t<=o.ritenuto}get TempoType(){return this.tempoType}set TempoType(t){this.tempoType=t}get StartTempo(){return this.startTempo}set StartTempo(t){this.startTempo=t}get EndTempo(){return this.endTempo}set EndTempo(t){this.endTempo=t}get AbsoluteEndTimestamp(){return this.absoluteEndTimestamp}set AbsoluteEndTimestamp(t){this.absoluteEndTimestamp=t}get AbsoluteTimestamp(){return this.ParentMultiTempoExpression.AbsoluteTimestamp}getAbsoluteFloatTimestamp(){return this.ParentMultiTempoExpression.AbsoluteTimestamp.RealValue}getInterpolatedTempo(t){const e=n.Fraction.plus(this.parentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.parentMultiTempoExpression.Timestamp);if(t.lt(e))return-1;if(this.absoluteEndTimestamp.lt(t))return-2;const i=n.Fraction.minus(t,e).RealValue/n.Fraction.minus(this.absoluteEndTimestamp,e).RealValue;return Math.max(0,Math.min(250,this.startTempo+(this.endTempo-this.startTempo)*i))}setTempoType(){r.isStringInStringList(r.listContinuousTempoFaster,this.label)?this.tempoType=o.accelerando:r.isStringInStringList(r.listContinuousTempoSlower,this.label)&&(this.tempoType=o.ritardando)}}var o;e.ContinuousTempoExpression=r,r.listContinuousTempoFaster=["accelerando","piu mosso","poco piu","stretto"],r.listContinuousTempoSlower=["poco meno","meno mosso","piu lento","rallentando","ritardando","ritenuto","ritard.","ritard","riten.","riten"],function(t){t[t.accelerando=0]="accelerando",t[t.stretto=1]="stretto",t[t.stringendo=2]="stringendo",t[t.mosso=3]="mosso",t[t.piuMosso=4]="piuMosso",t[t.allargando=5]="allargando",t[t.calando=6]="calando",t[t.menoMosso=7]="menoMosso",t[t.rallentando=8]="rallentando",t[t.ritardando=9]="ritardando",t[t.ritard=10]="ritard",t[t.rit=11]="rit",t[t.ritenuto=12]="ritenuto",t[t.rubato=13]="rubato",t[t.precipitando=14]="precipitando"}(o=e.ContinuousTempoType||(e.ContinuousTempoType={}))},5853:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OctaveEnum=e.OctaveShift=void 0;const n=i(8640);var s;e.OctaveShift=class{constructor(t,e){this.numberXml=1,this.setOctaveShiftValue(t,e)}get Type(){return this.octaveValue}set Type(t){this.octaveValue=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get ParentStartMultiExpression(){return this.startMultiExpression}set ParentStartMultiExpression(t){this.startMultiExpression=t}get ParentEndMultiExpression(){return this.endMultiExpression}set ParentEndMultiExpression(t){this.endMultiExpression=t}setOctaveShiftValue(t,e){this.octaveValue=1===e&&"down"===t?s.VA8:1===e&&"up"===t?s.VB8:2===e&&"down"===t?s.MA15:2===e&&"up"===t?s.MB15:s.NONE}static getPitchFromOctaveShift(t,e){if(!t)return;let i=t.Octave;switch(e){case s.VA8:i-=1;break;case s.VB8:i+=1;break;case s.MA15:i-=2;break;case s.MB15:i+=2;break;case s.NONE:default:i+=0}return new n.Pitch(t.FundamentalNote,i,t.Accidental)}},function(t){t[t.VA8=0]="VA8",t[t.VB8=1]="VB8",t[t.MA15=2]="MA15",t[t.MB15=3]="MB15",t[t.NONE=4]="NONE"}(s=e.OctaveEnum||(e.OctaveEnum={}))},308:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Pedal=void 0,e.Pedal=class{constructor(t=!1,e=!0){this.ChangeEnd=!1,this.ChangeBegin=!1,this.line=t,this.sign=e}get IsLine(){return this.line}get IsSign(){return this.sign}}},1928:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Slur=void 0;const n=i(1797);e.Slur=class{constructor(){}get StartNote(){return this.startNote}set StartNote(t){this.startNote=t}get EndNote(){return this.endNote}set EndNote(t){this.endNote=t}startNoteHasMoreStartingSlurs(){if(!this.startNote)return!1;for(let t=0,e=this.startNote.NoteSlurs.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WavyLine=void 0;const n=i(3748);class s extends n.AbstractExpression{constructor(t){super(t)}}e.WavyLine=s},8084:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(7839),e),s(i(280),e),s(i(5853),e),s(i(1928),e)},4802:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.DynamicExpressionSymbolEnum=void 0,(i=e.DynamicExpressionSymbolEnum||(e.DynamicExpressionSymbolEnum={}))[i.p=0]="p",i[i.f=1]="f",i[i.s=2]="s",i[i.z=3]="z",i[i.m=4]="m",i[i.r=5]="r"},9793:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.DynamicEnum=e.InstantaneousDynamicExpression=void 0;const s=i(3748),r=i(4802),o=i(1703),a=n(i(2043)),l=i(1649);class h extends s.AbstractExpression{constructor(t,e,i,n,s){super(i),super.parentMeasure=s,this.dynamicEnum=u[t.toLowerCase()],this.soundDynamic=e,this.staffNumber=n}static staticConstructor(){h.dynamicToRelativeVolumeDict.setValue(u.ffffff,1),h.dynamicToRelativeVolumeDict.setValue(u.fffff,126/127),h.dynamicToRelativeVolumeDict.setValue(u.ffff,125/127),h.dynamicToRelativeVolumeDict.setValue(u.fff,124/127),h.dynamicToRelativeVolumeDict.setValue(u.ff,122/127),h.dynamicToRelativeVolumeDict.setValue(u.f,108/127),h.dynamicToRelativeVolumeDict.setValue(u.mf,76/127),h.dynamicToRelativeVolumeDict.setValue(u.sf,.5),h.dynamicToRelativeVolumeDict.setValue(u.sfp,.5),h.dynamicToRelativeVolumeDict.setValue(u.sfpp,.5),h.dynamicToRelativeVolumeDict.setValue(u.fp,.5),h.dynamicToRelativeVolumeDict.setValue(u.rf,.5),h.dynamicToRelativeVolumeDict.setValue(u.rfz,.5),h.dynamicToRelativeVolumeDict.setValue(u.sfz,.5),h.dynamicToRelativeVolumeDict.setValue(u.sffz,.5),h.dynamicToRelativeVolumeDict.setValue(u.fz,.5),h.dynamicToRelativeVolumeDict.setValue(u.mp,60/127),h.dynamicToRelativeVolumeDict.setValue(u.p,28/127),h.dynamicToRelativeVolumeDict.setValue(u.pp,12/127),h.dynamicToRelativeVolumeDict.setValue(u.ppp,10/127),h.dynamicToRelativeVolumeDict.setValue(u.pppp,7/127),h.dynamicToRelativeVolumeDict.setValue(u.ppppp,5/127),h.dynamicToRelativeVolumeDict.setValue(u.pppppp,4/127)}get ParentMultiExpression(){return this.multiExpression}set ParentMultiExpression(t){this.multiExpression=t}get DynEnum(){return this.dynamicEnum}set DynEnum(t){this.dynamicEnum=t}get SoundDynamic(){return this.soundDynamic}set SoundDynamic(t){this.soundDynamic=t}get Placement(){return this.placement}set Placement(t){this.placement=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get Length(){return Math.abs(this.length)<1e-4&&(this.length=this.calculateLength()),this.length}get MidiVolume(){return 127*this.Volume}get Volume(){return h.dynamicToRelativeVolumeDict.getValue(this.dynamicEnum)}static isInputStringInstantaneousDynamic(t){return!!t&&h.isStringInStringList(h.listInstantaneousDynamics,t)}getDynamicExpressionSymbol(t){switch(t){case"p":return r.DynamicExpressionSymbolEnum.p;case"f":return r.DynamicExpressionSymbolEnum.f;case"s":return r.DynamicExpressionSymbolEnum.s;case"z":return r.DynamicExpressionSymbolEnum.z;case"m":return r.DynamicExpressionSymbolEnum.m;case"r":return r.DynamicExpressionSymbolEnum.r;default:throw new o.InvalidEnumArgumentException("unknown DynamicExpressionSymbolEnum: "+t)}}calculateLength(){return a.default.debug("[Andrea] instantaneousDynamicExpression: not implemented: calculateLength!"),0}}var u;e.InstantaneousDynamicExpression=h,h.dynamicToRelativeVolumeDict=new l.Dictionary,h.listInstantaneousDynamics=["pppppp","ppppp","pppp","ppp","pp","p","ffffff","fffff","ffff","fff","ff","f","mf","mp","sf","sff","sp","spp","fp","rf","rfz","sfz","sffz","fz"],function(t){t[t.pppppp=0]="pppppp",t[t.ppppp=1]="ppppp",t[t.pppp=2]="pppp",t[t.ppp=3]="ppp",t[t.pp=4]="pp",t[t.p=5]="p",t[t.mp=6]="mp",t[t.mf=7]="mf",t[t.f=8]="f",t[t.ff=9]="ff",t[t.fff=10]="fff",t[t.ffff=11]="ffff",t[t.fffff=12]="fffff",t[t.ffffff=13]="ffffff",t[t.sf=14]="sf",t[t.sff=15]="sff",t[t.sfp=16]="sfp",t[t.sfpp=17]="sfpp",t[t.fp=18]="fp",t[t.rf=19]="rf",t[t.rfz=20]="rfz",t[t.sfz=21]="sfz",t[t.sffz=22]="sffz",t[t.fz=23]="fz",t[t.other=24]="other"}(u=e.DynamicEnum||(e.DynamicEnum={})),h.staticConstructor()},9667:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TempoEnum=e.InstantaneousTempoExpression=void 0;const n=i(9775),s=i(1703),r=i(1797);class o extends n.AbstractTempoExpression{constructor(t,e,i,n,s,r=!1){super(t,e,i,s),this.setTempoAndTempoType(n)}static getDefaultValueForTempoType(t){switch(t){case a.larghissimo:return 20;case a.grave:return 30;case a.lento:return 48;case a.largo:return 52;case a.larghetto:return 63;case a.adagio:return 70;case a.adagietto:return 75;case a.andanteModerato:return 88;case a.andante:return 92;case a.andantino:return 96;case a.moderato:return 106;case a.allegretto:return 112;case a.allegroModerato:return 118;case a.allegro:return 130;case a.vivace:return 140;case a.vivacissimo:return 155;case a.allegrissimo:return 170;case a.presto:return 184;case a.prestissimo:return 200;default:throw new s.ArgumentOutOfRangeException("tempoEnum")}}static isInputStringInstantaneousTempo(t){return!!t&&(o.isStringInStringList(o.listInstantaneousTempoLarghissimo,t)||o.isStringInStringList(o.listInstantaneousTempoGrave,t)||o.isStringInStringList(o.listInstantaneousTempoLento,t)||o.isStringInStringList(o.listInstantaneousTempoLargo,t)||o.isStringInStringList(o.listInstantaneousTempoLarghetto,t)||o.isStringInStringList(o.listInstantaneousTempoAdagio,t)||o.isStringInStringList(o.listInstantaneousTempoAdagietto,t)||o.isStringInStringList(o.listInstantaneousTempoAndanteModerato,t)||o.isStringInStringList(o.listInstantaneousTempoAndante,t)||o.isStringInStringList(o.listInstantaneousTempoAndantino,t)||o.isStringInStringList(o.listInstantaneousTempoModerato,t)||o.isStringInStringList(o.listInstantaneousTempoAllegretto,t)||o.isStringInStringList(o.listInstantaneousTempoAllegroModerato,t)||o.isStringInStringList(o.listInstantaneousTempoAllegro,t)||o.isStringInStringList(o.listInstantaneousTempoVivace,t)||o.isStringInStringList(o.listInstantaneousTempoVivacissimo,t)||o.isStringInStringList(o.listInstantaneousTempoAllegrissimo,t)||o.isStringInStringList(o.listInstantaneousTempoPresto,t)||o.isStringInStringList(o.listInstantaneousTempoPrestissimo,t)||o.isStringInStringList(o.listInstantaneousTempoChangesGeneral,t))}get Label(){return this.label}set Label(t){this.label=t}get Placement(){return this.placement}set Placement(t){this.placement=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get Enum(){return this.tempoEnum}get TempoInBpm(){return this.tempoInBpm}set TempoInBpm(t){this.tempoInBpm=t}get ParentMultiTempoExpression(){return this.parentMultiTempoExpression}getAbsoluteTimestamp(){return r.Fraction.plus(this.ParentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.ParentMultiTempoExpression.Timestamp)}getAbsoluteFloatTimestamp(){return r.Fraction.plus(this.ParentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.ParentMultiTempoExpression.Timestamp).RealValue}setTempoAndTempoType(t){return this.label?o.isStringInStringList(o.listInstantaneousTempoLarghissimo,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.larghissimo)),this.tempoInBpm=t,void(this.tempoEnum=a.larghissimo)):o.isStringInStringList(o.listInstantaneousTempoGrave,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.grave)),this.tempoInBpm=t,void(this.tempoEnum=a.grave)):o.isStringInStringList(o.listInstantaneousTempoLento,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.lento)),this.tempoInBpm=t,void(this.tempoEnum=a.lento)):o.isStringInStringList(o.listInstantaneousTempoLargo,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.largo)),this.tempoInBpm=t,void(this.tempoEnum=a.largo)):o.isStringInStringList(o.listInstantaneousTempoLarghetto,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.larghetto)),this.tempoInBpm=t,void(this.tempoEnum=a.larghetto)):o.isStringInStringList(o.listInstantaneousTempoAdagio,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.adagio)),this.tempoInBpm=t,void(this.tempoEnum=a.adagio)):o.isStringInStringList(o.listInstantaneousTempoAdagietto,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.adagietto)),this.tempoInBpm=t,void(this.tempoEnum=a.adagietto)):o.isStringInStringList(o.listInstantaneousTempoAndanteModerato,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.andanteModerato)),this.tempoInBpm=t,void(this.tempoEnum=a.andanteModerato)):o.isStringInStringList(o.listInstantaneousTempoAndante,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.andante)),this.tempoInBpm=t,void(this.tempoEnum=a.andante)):o.isStringInStringList(o.listInstantaneousTempoAndantino,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.andantino)),this.tempoInBpm=t,void(this.tempoEnum=a.andantino)):o.isStringInStringList(o.listInstantaneousTempoModerato,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.moderato)),this.tempoInBpm=t,void(this.tempoEnum=a.moderato)):o.isStringInStringList(o.listInstantaneousTempoAllegretto,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.allegretto)),this.tempoInBpm=t,void(this.tempoEnum=a.allegretto)):o.isStringInStringList(o.listInstantaneousTempoAllegroModerato,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.allegroModerato)),this.tempoInBpm=t,void(this.tempoEnum=a.allegroModerato)):o.isStringInStringList(o.listInstantaneousTempoAllegro,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.allegro)),this.tempoInBpm=t,void(this.tempoEnum=a.allegro)):o.isStringInStringList(o.listInstantaneousTempoVivace,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.vivace)),this.tempoInBpm=t,void(this.tempoEnum=a.vivace)):o.isStringInStringList(o.listInstantaneousTempoVivacissimo,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.vivacissimo)),this.tempoInBpm=t,void(this.tempoEnum=a.vivacissimo)):o.isStringInStringList(o.listInstantaneousTempoAllegrissimo,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.allegrissimo)),this.tempoInBpm=t,void(this.tempoEnum=a.allegrissimo)):o.isStringInStringList(o.listInstantaneousTempoPresto,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.presto)),this.tempoInBpm=t,void(this.tempoEnum=a.presto)):o.isStringInStringList(o.listInstantaneousTempoPrestissimo,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.prestissimo)),this.tempoInBpm=t,void(this.tempoEnum=a.prestissimo)):o.isStringInStringList(o.listInstantaneousTempoAddons,this.label)?(this.tempoInBpm=0,void(this.tempoEnum=a.addon)):o.isStringInStringList(o.listInstantaneousTempoChangesGeneral,this.label)?(this.tempoInBpm=0,void(this.tempoEnum=a.changes)):void 0:(this.tempoInBpm=t,void(this.tempoEnum=a.metronomeMark))}}var a;e.InstantaneousTempoExpression=o,o.listInstantaneousTempoLarghissimo=["Larghissimo","Sehr breit","very, very slow"],o.listInstantaneousTempoGrave=["Grave","Schwer","slow and solemn"],o.listInstantaneousTempoLento=["Lento","Lent","Langsam","slowly"],o.listInstantaneousTempoLargo=["Largo","Breit","broadly"],o.listInstantaneousTempoLarghetto=["Larghetto","Etwas breit","rather broadly"],o.listInstantaneousTempoAdagio=["Adagio","Langsam","Ruhig","slow and stately"],o.listInstantaneousTempoAdagietto=["Adagietto","Ziemlich ruhig","Ziemlich langsam","rather slow"],o.listInstantaneousTempoAndanteModerato=["Andante moderato"],o.listInstantaneousTempoAndante=["Andante","Gehend","Schreitend","at a walking pace"],o.listInstantaneousTempoAndantino=["Andantino"],o.listInstantaneousTempoModerato=["Moderato","Mäßig","Mod�r�","moderately"],o.listInstantaneousTempoAllegretto=["Allegretto","fast"],o.listInstantaneousTempoAllegroModerato=["Allegro moderato"],o.listInstantaneousTempoAllegro=["Allegro","Rapide","Vite","Rasch","Schnell","Fr�hlich"],o.listInstantaneousTempoVivace=["Vivace","Lebhaft","Lebendig","lively and fast"],o.listInstantaneousTempoVivacissimo=["Vivacissimo","Sehr lebhaft","Sehr lebendig"],o.listInstantaneousTempoAllegrissimo=["Allegrissimo","very fast"],o.listInstantaneousTempoPresto=["Presto","Sehr schnell","Geschwind"],o.listInstantaneousTempoPrestissimo=["Prestissimo","äußerst schnell"],o.listInstantaneousTempoChangesGeneral=["tempo primo","a tempo","tempo i","rubato","doppio movimento"],o.listInstantaneousTempoAddons=["assai","amoroso","cantabile","con brio","con dolore","con espressione","con fuoco","con moto","con spirito","spiritoso","espressivo","giocoso","giusto","grazioso","lesto","lugubre","maestoso","ma non troppo","marcato","molto","morendo","mosso","non tanto","piu","un poco","poco","quasi","risoluto","scherzando","sostenuto","teneramente","tempo giusto","tranquillo","sehr","lieblich","liebevoll","mit Leidenschaft","mit Liebe","amourös","gesanglich","mit Schwung","mit Feuer","mit Schmerz","mit Ausdruck","mit Bewegung","geistvoll","ausdrucksvoll","freudig","verspielt","angemessen","graziös","mit Grazie","flink","behände","traurig","klagend","majestätisch","aber nicht zu sehr","markant","gemäßigt","viel","sehr","ersterbend","bewegt","nicht zu sehr","mehr","ein wenig","gleichsam","entschlossen","zupackend","heiter","nachdrücklich","getragen","gewichtig","zart","zärtlich","im angemessenen Zeitmaß","ruhig","ein wenig","alla marcia","ad libitum","alla breve"],function(t){t[t.none=0]="none",t[t.larghissimo=1]="larghissimo",t[t.grave=2]="grave",t[t.lento=3]="lento",t[t.largo=4]="largo",t[t.larghetto=5]="larghetto",t[t.adagio=6]="adagio",t[t.adagietto=7]="adagietto",t[t.andanteModerato=8]="andanteModerato",t[t.andante=9]="andante",t[t.andantino=10]="andantino",t[t.moderato=11]="moderato",t[t.allegretto=12]="allegretto",t[t.allegroModerato=13]="allegroModerato",t[t.allegro=14]="allegro",t[t.vivace=15]="vivace",t[t.vivacissimo=16]="vivacissimo",t[t.allegrissimo=17]="allegrissimo",t[t.presto=18]="presto",t[t.prestissimo=19]="prestissimo",t[t.lastRealTempo=20]="lastRealTempo",t[t.addon=21]="addon",t[t.changes=22]="changes",t[t.metronomeMark=23]="metronomeMark"}(a=e.TempoEnum||(e.TempoEnum={}))},7527:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MoodEnum=e.MoodExpression=void 0;const n=i(3748);class s extends n.AbstractExpression{constructor(t,e,i){super(e),this.label=t,this.staffNumber=i,this.setMoodType()}static isInputStringMood(t){return!!t&&(s.isStringInStringList(s.listMoodAffettuoso,t)||s.isStringInStringList(s.listMoodAgitato,t)||s.isStringInStringList(s.listMoodAnimato,t)||s.isStringInStringList(s.listMoodAppassionato,t)||s.isStringInStringList(s.listMoodBrillante,t)||s.isStringInStringList(s.listMoodCantabile,t)||s.isStringInStringList(s.listMoodDolce,t)||s.isStringInStringList(s.listMoodEnergico,t)||s.isStringInStringList(s.listMoodEroico,t)||s.isStringInStringList(s.listMoodEspressivo,t)||s.isStringInStringList(s.listMoodFurioso,t)||s.isStringInStringList(s.listMoodGiocoso,t)||s.isStringInStringList(s.listMoodGioioso,t)||s.isStringInStringList(s.listMoodGrandioso,t)||s.isStringInStringList(s.listMoodGrazioso,t)||s.isStringInStringList(s.listMoodLacrimoso,t)||s.isStringInStringList(s.listMoodLeggiero,t)||s.isStringInStringList(s.listMoodMaestoso,t)||s.isStringInStringList(s.listMoodMalinconico,t)||s.isStringInStringList(s.listMoodMarcato,t)||s.isStringInStringList(s.listMoodMarziale,t)||s.isStringInStringList(s.listMoodMesto,t)||s.isStringInStringList(s.listMoodMorendo,t)||s.isStringInStringList(s.listMoodNobilmente,t)||s.isStringInStringList(s.listMoodPatetico,t)||s.isStringInStringList(s.listMoodPesante,t)||s.isStringInStringList(s.listMoodSaltando,t)||s.isStringInStringList(s.listMoodSautille,t)||s.isStringInStringList(s.listMoodScherzando,t)||s.isStringInStringList(s.listMoodSostenuto,t)||s.isStringInStringList(s.listMoodSpiccato,t)||s.isStringInStringList(s.listMoodTenerezza,t)||s.isStringInStringList(s.listMoodTranquillamente,t)||s.isStringInStringList(s.listMoodTrionfante,t))}get Label(){return this.label}set Label(t){this.label=t}get Mood(){return this.moodType}set Mood(t){this.moodType=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get Placement(){return this.placement}set Placement(t){this.placement=t}setMoodType(){s.isStringInStringList(s.listMoodAffettuoso,this.label)?this.moodType=r.Affettuoso:s.isStringInStringList(s.listMoodAgitato,this.label)?this.moodType=r.Agitato:s.isStringInStringList(s.listMoodAnimato,this.label)?this.moodType=r.Animato:s.isStringInStringList(s.listMoodAppassionato,this.label)?this.moodType=r.Appassionato:s.isStringInStringList(s.listMoodBrillante,this.label)?this.moodType=r.Brillante:s.isStringInStringList(s.listMoodCantabile,this.label)?this.moodType=r.Cantabile:s.isStringInStringList(s.listMoodDolce,this.label)?this.moodType=r.Dolce:s.isStringInStringList(s.listMoodEnergico,this.label)?this.moodType=r.Energico:s.isStringInStringList(s.listMoodEroico,this.label)?this.moodType=r.Eroico:s.isStringInStringList(s.listMoodEspressivo,this.label)?this.moodType=r.Espressivo:s.isStringInStringList(s.listMoodFurioso,this.label)?this.moodType=r.Furioso:s.isStringInStringList(s.listMoodGiocoso,this.label)?this.moodType=r.Giocoso:s.isStringInStringList(s.listMoodGioioso,this.label)?this.moodType=r.Gioioso:s.isStringInStringList(s.listMoodGrandioso,this.label)?this.moodType=r.Grandioso:s.isStringInStringList(s.listMoodGrazioso,this.label)?this.moodType=r.Grazioso:s.isStringInStringList(s.listMoodLacrimoso,this.label)?this.moodType=r.Lacrimoso:s.isStringInStringList(s.listMoodLeggiero,this.label)?this.moodType=r.Leggiero:s.isStringInStringList(s.listMoodMaestoso,this.label)?this.moodType=r.Maestoso:s.isStringInStringList(s.listMoodMalinconico,this.label)?this.moodType=r.Malinconico:s.isStringInStringList(s.listMoodMarcato,this.label)?this.moodType=r.Marcato:s.isStringInStringList(s.listMoodMarziale,this.label)?this.moodType=r.Marziale:s.isStringInStringList(s.listMoodMesto,this.label)?this.moodType=r.Mesto:s.isStringInStringList(s.listMoodMorendo,this.label)?this.moodType=r.Morendo:s.isStringInStringList(s.listMoodNobilmente,this.label)?this.moodType=r.Nobilmente:s.isStringInStringList(s.listMoodPatetico,this.label)?this.moodType=r.Patetico:s.isStringInStringList(s.listMoodPesante,this.label)?this.moodType=r.Pesante:s.isStringInStringList(s.listMoodSaltando,this.label)?this.moodType=r.Saltando:s.isStringInStringList(s.listMoodSautille,this.label)?this.moodType=r.Sautille:s.isStringInStringList(s.listMoodScherzando,this.label)?this.moodType=r.Scherzando:s.isStringInStringList(s.listMoodSostenuto,this.label)?this.moodType=r.Sostenuto:s.isStringInStringList(s.listMoodSpiccato,this.label)?this.moodType=r.Spiccato:s.isStringInStringList(s.listMoodTenerezza,this.label)?this.moodType=r.Tenerezza:s.isStringInStringList(s.listMoodTranquillamente,this.label)?this.moodType=r.Tranquillamente:s.isStringInStringList(s.listMoodTrionfante,this.label)&&(this.moodType=r.Trionfante)}}var r;e.MoodExpression=s,s.listMoodAffettuoso=["affettuoso"],s.listMoodAgitato=["agitato"],s.listMoodAppassionato=["appassionato"],s.listMoodAnimato=["animato","lively"],s.listMoodBrillante=["brillante"],s.listMoodCantabile=["cantabile"],s.listMoodDolce=["dolce"],s.listMoodEnergico=["energico"],s.listMoodEroico=["eroico"],s.listMoodEspressivo=["espressivo"],s.listMoodFurioso=["furioso"],s.listMoodGiocoso=["giocoso"],s.listMoodGioioso=["gioioso"],s.listMoodLacrimoso=["lacrimoso"],s.listMoodGrandioso=["grandioso"],s.listMoodGrazioso=["grazioso"],s.listMoodLeggiero=["leggiero"],s.listMoodMaestoso=["maestoso"],s.listMoodMalinconico=["malinconico"],s.listMoodMarcato=["marcato"],s.listMoodMarziale=["marziale"],s.listMoodMesto=["mesto"],s.listMoodMorendo=["morendo"],s.listMoodNobilmente=["nobilmente"],s.listMoodPatetico=["patetico"],s.listMoodPesante=["pesante"],s.listMoodSautille=["sautille"],s.listMoodSaltando=["saltando"],s.listMoodScherzando=["scherzando"],s.listMoodSostenuto=["sostenuto"],s.listMoodSpiccato=["spiccato"],s.listMoodTenerezza=["tenerezza"],s.listMoodTranquillamente=["tranquillamente"],s.listMoodTrionfante=["trionfante"],function(t){t[t.Affettuoso=0]="Affettuoso",t[t.Agitato=1]="Agitato",t[t.Appassionato=2]="Appassionato",t[t.Animato=3]="Animato",t[t.Brillante=4]="Brillante",t[t.Cantabile=5]="Cantabile",t[t.Dolce=6]="Dolce",t[t.Energico=7]="Energico",t[t.Eroico=8]="Eroico",t[t.Espressivo=9]="Espressivo",t[t.Furioso=10]="Furioso",t[t.Giocoso=11]="Giocoso",t[t.Gioioso=12]="Gioioso",t[t.Lacrimoso=13]="Lacrimoso",t[t.Grandioso=14]="Grandioso",t[t.Grazioso=15]="Grazioso",t[t.Leggiero=16]="Leggiero",t[t.Maestoso=17]="Maestoso",t[t.Malinconico=18]="Malinconico",t[t.Marcato=19]="Marcato",t[t.Marziale=20]="Marziale",t[t.Mesto=21]="Mesto",t[t.Morendo=22]="Morendo",t[t.Nobilmente=23]="Nobilmente",t[t.Patetico=24]="Patetico",t[t.Pesante=25]="Pesante",t[t.Sautille=26]="Sautille",t[t.Saltando=27]="Saltando",t[t.Scherzando=28]="Scherzando",t[t.Sostenuto=29]="Sostenuto",t[t.Spiccato=30]="Spiccato",t[t.Tenerezza=31]="Tenerezza",t[t.Tranquillamente=32]="Tranquillamente",t[t.Trionfante=33]="Trionfante",t[t.Vivace=34]="Vivace"}(r=e.MoodEnum||(e.MoodEnum={}))},6943:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MultiExpressionEntry=e.MultiExpression=void 0;const n=i(1797),s=i(9793),r=i(7839),o=i(7527),a=i(1614),l=i(3748),h=i(2562);e.MultiExpression=class{constructor(t,e){this.unknownList=[],this.moodList=[],this.expressions=[],this.sourceMeasure=t,this.timestamp=e}get SourceMeasureParent(){return this.sourceMeasure}set SourceMeasureParent(t){this.sourceMeasure=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get Timestamp(){return this.timestamp}set Timestamp(t){this.timestamp=t}get AbsoluteTimestamp(){return n.Fraction.plus(this.timestamp,this.sourceMeasure.AbsoluteTimestamp)}get InstantaneousDynamic(){return this.instantaneousDynamic}set InstantaneousDynamic(t){this.instantaneousDynamic=t}get EndingContinuousDynamic(){return this.endingContinuousDynamic}set EndingContinuousDynamic(t){this.endingContinuousDynamic=t}get StartingContinuousDynamic(){return this.startingContinuousDynamic}set StartingContinuousDynamic(t){this.startingContinuousDynamic=t}get MoodList(){return this.moodList}get UnknownList(){return this.unknownList}get EntriesList(){return this.expressions}get OctaveShiftStart(){return this.octaveShiftStart}set OctaveShiftStart(t){this.octaveShiftStart=t}get OctaveShiftEnd(){return this.octaveShiftEnd}set OctaveShiftEnd(t){this.octaveShiftEnd=t}get CombinedExpressionsText(){return this.combinedExpressionsText}set CombinedExpressionsText(t){this.combinedExpressionsText=t}getPlacementOfFirstEntry(){let t=l.PlacementEnum.Above;return this.expressions.length>0&&(this.expressions[0].expression instanceof s.InstantaneousDynamicExpression||this.expressions[0].expression instanceof r.ContinuousDynamicExpression||this.expressions[0].expression instanceof o.MoodExpression||this.expressions[0].expression instanceof a.UnknownExpression)&&(t=this.expressions[0].expression.Placement),t}getFontstyleOfFirstEntry(){var t;let e=h.FontStyles.Regular;return this.expressions.length>0&&(this.expressions[0].expression instanceof r.ContinuousDynamicExpression||this.expressions[0].expression instanceof o.MoodExpression?e=h.FontStyles.Italic:this.expressions[0].expression instanceof a.UnknownExpression&&(e=null!==(t=this.expressions[0].expression.fontStyle)&&void 0!==t?t:h.FontStyles.Regular)),e}addExpression(t,e){t instanceof s.InstantaneousDynamicExpression?(this.instantaneousDynamic&&this.removeExpressionFromEntryList(this.InstantaneousDynamic),this.instantaneousDynamic=t,this.instantaneousDynamic.ParentMultiExpression=this):t instanceof r.ContinuousDynamicExpression?this.startingContinuousDynamic=t:t instanceof o.MoodExpression?this.moodList.push(t):t instanceof a.UnknownExpression&&this.unknownList.push(t),this.addExpressionToEntryList(t,e)}CompareTo(t){return this.Timestamp.RealValue>t.Timestamp.RealValue?1:this.Timestamp.RealValue{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TempoExpressionEntry=e.MultiTempoExpression=void 0;const n=i(1797),s=i(9667),r=i(3748),o=i(2562),a=i(280);e.MultiTempoExpression=class{constructor(t,e){this.expressions=[],this.sourceMeasure=t,this.timestamp=e}get Timestamp(){return this.timestamp}get AbsoluteTimestamp(){return n.Fraction.plus(this.sourceMeasure.AbsoluteTimestamp,this.timestamp)}get SourceMeasureParent(){return this.sourceMeasure}set SourceMeasureParent(t){this.sourceMeasure=t}get InstantaneousTempo(){return this.instantaneousTempo}get ContinuousTempo(){return this.continuousTempo}get EntriesList(){return this.expressions}get CombinedExpressionsText(){return this.combinedExpressionsText}set CombinedExpressionsText(t){this.combinedExpressionsText=t}getPlacementOfFirstEntry(){let t=r.PlacementEnum.Above;return this.expressions.length>0&&(this.expressions[0].Expression instanceof s.InstantaneousTempoExpression||this.expressions[0].Expression instanceof a.ContinuousTempoExpression)&&(t=this.expressions[0].Expression.Placement),t}getFontstyleOfFirstEntry(){let t=o.FontStyles.Regular;return this.expressions[0].Expression instanceof s.InstantaneousTempoExpression?t=o.FontStyles.Bold:this.expressions[0].Expression instanceof a.ContinuousTempoExpression&&(t=o.FontStyles.Italic),t}addExpression(t,e){if(this.checkIfAlreadyExists(t))return;t instanceof s.InstantaneousTempoExpression?this.instantaneousTempo=t:t instanceof a.ContinuousTempoExpression&&(this.continuousTempo=t);const i=new l;i.prefix=e,i.Expression=t,i.label=t.Label,this.expressions.push(i)}CompareTo(t){return this.Timestamp.RealValue>t.Timestamp.RealValue?1:this.Timestamp.RealValue{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RehearsalExpression=void 0;const n=i(3748);class s extends n.AbstractExpression{constructor(t,e){super(e),this.label=t}}e.RehearsalExpression=s},1614:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UnknownExpression=void 0;const n=i(3748),s=i(1274);class r extends n.AbstractExpression{constructor(t,e,i,n){super(e),this.label=t,this.staffNumber=n,void 0===i&&(i=s.TextAlignmentEnum.LeftBottom),this.textAlignment=i}get Label(){return this.label}get Placement(){return this.placement}set Placement(t){this.placement=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get TextAlignment(){return this.textAlignment}}e.UnknownExpression=r},2343:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(3748),e),s(i(9775),e),s(i(4802),e),s(i(9793),e),s(i(9667),e),s(i(7527),e),s(i(6943),e),s(i(6124),e),s(i(7513),e),s(i(1614),e)},5356:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DynamicsContainer=void 0;const n=i(7839),s=i(9793);e.DynamicsContainer=class{constructor(t,e){t instanceof n.ContinuousDynamicExpression?this.continuousDynamicExpression=t:t instanceof s.InstantaneousDynamicExpression&&(this.instantaneousDynamicExpression=t),this.staffNumber=e}static Compare(t,e){return t.parMultiExpression().AbsoluteTimestamp.CompareTo(e.parMultiExpression().AbsoluteTimestamp)}parMultiExpression(){return this.continuousDynamicExpression?this.continuousDynamicExpression.StartMultiExpression:this.instantaneousDynamicExpression?this.instantaneousDynamicExpression.ParentMultiExpression:void 0}}},5517:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(5356),e)},1877:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractNotationInstruction=void 0,e.AbstractNotationInstruction=class{constructor(t){this.printObject=!0,this.parent=t}get Parent(){return this.parent}set Parent(t){this.parent=t}get PrintObject(){return this.printObject}set PrintObject(t){this.printObject=t}}},289:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MidiInstrument=e.ClefEnum=e.ClefInstruction=void 0;const n=i(8640),s=i(1877),r=i(8640),o=i(8640),a=i(1703);class l extends s.AbstractNotationInstruction{constructor(t=h.G,e=0,i=2){super(void 0),this.clefType=h.G,this.line=2,this.octaveOffset=0,this.line=i,this.clefType=t,this.octaveOffset=e,this.calcParameters()}static getDefaultClefFromMidiInstrument(t){switch(t){case u.Acoustic_Grand_Piano:case u.Electric_Bass_finger:case u.Electric_Bass_pick:case u.Fretless_Bass:case u.Slap_Bass_1:case u.Slap_Bass_2:case u.Synth_Bass_1:case u.Synth_Bass_2:case u.Contrabass:return new l(h.F,0,4);default:return new l(h.G,0,2)}}static getAllPossibleClefs(){const t=[];for(let e=0;e<=2;e++){const i=new l(h.G,e,2);t.push(i)}for(let e=-2;e<=0;e++){const i=new l(h.F,e,4);t.push(i)}return t}static isSupportedClef(t){switch(t){case h.G:case h.F:case h.C:case h.percussion:case h.TAB:return!0;default:return!1}}get ClefType(){return this.clefType}set ClefType(t){this.clefType=t}get Line(){return this.line}set Line(t){this.line=t}get OctaveOffset(){return this.octaveOffset}set OctaveOffset(t){this.octaveOffset=t}get ClefPitch(){return this.clefPitch}set ClefPitch(t){this.clefPitch=t}get ReferenceCyPosition(){return this.referenceCyPosition}set ReferenceCyPosition(t){this.referenceCyPosition=t}Equals(t){return this===t||!(!this||!t)&&this.clefPitch===t.clefPitch&&this.Line===t.Line}NotEqual(t){return!this.Equals(t)}ToString(){return"ClefType: "+this.clefType}calcParameters(){switch(this.clefType){case h.G:this.clefPitch=new n.Pitch(r.NoteEnum.G,1+this.octaveOffset,o.AccidentalEnum.NONE),this.referenceCyPosition=5-this.line+2;break;case h.F:this.clefPitch=new n.Pitch(r.NoteEnum.F,0+this.octaveOffset,o.AccidentalEnum.NONE),this.referenceCyPosition=5-this.line+1.5;break;case h.C:this.clefPitch=new n.Pitch(r.NoteEnum.C,1+this.octaveOffset,o.AccidentalEnum.NONE),this.referenceCyPosition=5-this.line;break;case h.percussion:this.clefPitch=new n.Pitch(r.NoteEnum.C,2,o.AccidentalEnum.NONE),this.referenceCyPosition=2;break;case h.TAB:this.clefPitch=new n.Pitch(r.NoteEnum.G,0,o.AccidentalEnum.NONE),this.referenceCyPosition=0;break;default:throw new a.ArgumentOutOfRangeException("clefType")}}}var h,u;e.ClefInstruction=l,function(t){t[t.G=0]="G",t[t.F=1]="F",t[t.C=2]="C",t[t.percussion=3]="percussion",t[t.TAB=4]="TAB"}(h=e.ClefEnum||(e.ClefEnum={})),function(t){t[t.None=-1]="None",t[t.Acoustic_Grand_Piano=0]="Acoustic_Grand_Piano",t[t.Bright_Acoustic_Piano=1]="Bright_Acoustic_Piano",t[t.Electric_Grand_Piano=2]="Electric_Grand_Piano",t[t.Honky_tonk_Piano=3]="Honky_tonk_Piano",t[t.Electric_Piano_1=4]="Electric_Piano_1",t[t.Electric_Piano_2=5]="Electric_Piano_2",t[t.Harpsichord=6]="Harpsichord",t[t.Clavinet=7]="Clavinet",t[t.Celesta=8]="Celesta",t[t.Glockenspiel=9]="Glockenspiel",t[t.Music_Box=10]="Music_Box",t[t.Vibraphone=11]="Vibraphone",t[t.Marimba=12]="Marimba",t[t.Xylophone=13]="Xylophone",t[t.Tubular_Bells=14]="Tubular_Bells",t[t.Dulcimer=15]="Dulcimer",t[t.Drawbar_Organ=16]="Drawbar_Organ",t[t.Percussive_Organ=17]="Percussive_Organ",t[t.Rock_Organ=18]="Rock_Organ",t[t.Church_Organ=19]="Church_Organ",t[t.Reed_Organ=20]="Reed_Organ",t[t.Accordion=21]="Accordion",t[t.Harmonica=22]="Harmonica",t[t.Tango_Accordion=23]="Tango_Accordion",t[t.Acoustic_Guitar_nylon=24]="Acoustic_Guitar_nylon",t[t.Acoustic_Guitar_steel=25]="Acoustic_Guitar_steel",t[t.Electric_Guitar_jazz=26]="Electric_Guitar_jazz",t[t.Electric_Guitar_clean=27]="Electric_Guitar_clean",t[t.Electric_Guitar_muted=28]="Electric_Guitar_muted",t[t.Overdriven_Guitar=29]="Overdriven_Guitar",t[t.Distortion_Guitar=30]="Distortion_Guitar",t[t.Guitar_harmonics=31]="Guitar_harmonics",t[t.Acoustic_Bass=32]="Acoustic_Bass",t[t.Electric_Bass_finger=33]="Electric_Bass_finger",t[t.Electric_Bass_pick=34]="Electric_Bass_pick",t[t.Fretless_Bass=35]="Fretless_Bass",t[t.Slap_Bass_1=36]="Slap_Bass_1",t[t.Slap_Bass_2=37]="Slap_Bass_2",t[t.Synth_Bass_1=38]="Synth_Bass_1",t[t.Synth_Bass_2=39]="Synth_Bass_2",t[t.Violin=40]="Violin",t[t.Viola=41]="Viola",t[t.Cello=42]="Cello",t[t.Contrabass=43]="Contrabass",t[t.Tremolo_Strings=44]="Tremolo_Strings",t[t.Pizzicato_Strings=45]="Pizzicato_Strings",t[t.Orchestral_Harp=46]="Orchestral_Harp",t[t.Timpani=47]="Timpani",t[t.String_Ensemble_1=48]="String_Ensemble_1",t[t.String_Ensemble_2=49]="String_Ensemble_2",t[t.Synth_Strings_1=50]="Synth_Strings_1",t[t.Synth_Strings_2=51]="Synth_Strings_2",t[t.Choir_Aahs=52]="Choir_Aahs",t[t.Voice_Oohs=53]="Voice_Oohs",t[t.Synth_Voice=54]="Synth_Voice",t[t.Orchestra_Hit=55]="Orchestra_Hit",t[t.Trumpet=56]="Trumpet",t[t.Trombone=57]="Trombone",t[t.Tuba=58]="Tuba",t[t.Muted_Trumpet=59]="Muted_Trumpet",t[t.French_Horn=60]="French_Horn",t[t.Brass_Section=61]="Brass_Section",t[t.Synth_Brass_1=62]="Synth_Brass_1",t[t.Synth_Brass_2=63]="Synth_Brass_2",t[t.Soprano_Sax=64]="Soprano_Sax",t[t.Alto_Sax=65]="Alto_Sax",t[t.Tenor_Sax=66]="Tenor_Sax",t[t.Baritone_Sax=67]="Baritone_Sax",t[t.Oboe=68]="Oboe",t[t.English_Horn=69]="English_Horn",t[t.Bassoon=70]="Bassoon",t[t.Clarinet=71]="Clarinet",t[t.Piccolo=72]="Piccolo",t[t.Flute=73]="Flute",t[t.Recorder=74]="Recorder",t[t.Pan_Flute=75]="Pan_Flute",t[t.Blown_Bottle=76]="Blown_Bottle",t[t.Shakuhachi=77]="Shakuhachi",t[t.Whistle=78]="Whistle",t[t.Ocarina=79]="Ocarina",t[t.Lead_1_square=80]="Lead_1_square",t[t.Lead_2_sawtooth=81]="Lead_2_sawtooth",t[t.Lead_3_calliope=82]="Lead_3_calliope",t[t.Lead_4_chiff=83]="Lead_4_chiff",t[t.Lead_5_charang=84]="Lead_5_charang",t[t.Lead_6_voice=85]="Lead_6_voice",t[t.Lead_7_fifths=86]="Lead_7_fifths",t[t.Lead_8_bass_lead=87]="Lead_8_bass_lead",t[t.Pad_1_new_age=88]="Pad_1_new_age",t[t.Pad_2_warm=89]="Pad_2_warm",t[t.Pad_3_polysynth=90]="Pad_3_polysynth",t[t.Pad_4_choir=91]="Pad_4_choir",t[t.Pad_5_bowed=92]="Pad_5_bowed",t[t.Pad_6_metallic=93]="Pad_6_metallic",t[t.Pad_7_halo=94]="Pad_7_halo",t[t.Pad_8_sweep=95]="Pad_8_sweep",t[t.FX_1_rain=96]="FX_1_rain",t[t.FX_2_soundtrack=97]="FX_2_soundtrack",t[t.FX_3_crystal=98]="FX_3_crystal",t[t.FX_4_atmosphere=99]="FX_4_atmosphere",t[t.FX_5_brightness=100]="FX_5_brightness",t[t.FX_6_goblins=101]="FX_6_goblins",t[t.FX_7_echoes=102]="FX_7_echoes",t[t.FX_8_scifi=103]="FX_8_scifi",t[t.Sitar=104]="Sitar",t[t.Banjo=105]="Banjo",t[t.Shamisen=106]="Shamisen",t[t.Koto=107]="Koto",t[t.Kalimba=108]="Kalimba",t[t.Bag_pipe=109]="Bag_pipe",t[t.Fiddle=110]="Fiddle",t[t.Shanai=111]="Shanai",t[t.Tinkle_Bell=112]="Tinkle_Bell",t[t.Agogo=113]="Agogo",t[t.Steel_Drums=114]="Steel_Drums",t[t.Woodblock=115]="Woodblock",t[t.Taiko_Drum=116]="Taiko_Drum",t[t.Melodic_Tom=117]="Melodic_Tom",t[t.Synth_Drum=118]="Synth_Drum",t[t.Reverse_Cymbal=119]="Reverse_Cymbal",t[t.Guitar_Fret_Noise=120]="Guitar_Fret_Noise",t[t.Breath_Noise=121]="Breath_Noise",t[t.Seashore=122]="Seashore",t[t.Bird_Tweet=123]="Bird_Tweet",t[t.Telephone_Ring=124]="Telephone_Ring",t[t.Helicopter=125]="Helicopter",t[t.Applause=126]="Applause",t[t.Gunshot=127]="Gunshot",t[t.euphonium=128]="euphonium",t[t.AltoClarinetInEb=200]="AltoClarinetInEb",t[t.TrumpetInBb=201]="TrumpetInBb",t[t.BaritoneSaxophone=202]="BaritoneSaxophone",t[t.TenorSaxophone=203]="TenorSaxophone",t[t.ClarinetInEb=204]="ClarinetInEb",t[t.Euphonium=205]="Euphonium",t[t.Alto_Clarinet=206]="Alto_Clarinet",t[t.Bass_Clarinet=207]="Bass_Clarinet",t[t.Bass_Trombone=208]="Bass_Trombone",t[t.clarinet_in_bb=209]="clarinet_in_bb",t[t.clarinet_in_eb=210]="clarinet_in_eb",t[t.Percussion=135]="Percussion"}(u=e.MidiInstrument||(e.MidiInstrument={}))},5198:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KeyEnum=e.NoteEnumToHalfToneLink=e.KeyInstruction=void 0;const n=i(1877),s=i(8640),r=i(8640);class o extends n.AbstractNotationInstruction{constructor(t=void 0,e=0,i=a.major){super(t),this.isTransposedBy=0,this.Key=e,this.keyTypeOriginal=e,this.mode=i,this.alteratedNotes=this.calcAlteratedNotes()}static copy(t){const e=new o(t.parent,t.Key,t.Mode);return e.keyTypeOriginal=t.keyTypeOriginal,e}static getAllPossibleMajorKeyInstructions(){const t=[];for(let e=-7;e<7;e++){const i=new o(void 0,e,a.major);t.push(i)}return t}get Key(){return this.keyType}set Key(t){this.keyType=t,this.alteratedNotes=this.calcAlteratedNotes()}get Mode(){return this.mode}set Mode(t){this.mode=t}get AlteratedNotes(){return this.alteratedNotes}calcAlteratedNotes(){const t=[];if(this.keyType>0)for(let e=0;e=0}getAlterationForPitch(t){return this.keyType>0&&this.alteratedNotes.indexOf(t.FundamentalNote)<=this.keyType?r.AccidentalEnum.SHARP:this.keyType<0&&this.alteratedNotes.indexOf(t.FundamentalNote)<=Math.abs(this.keyType)?r.AccidentalEnum.FLAT:r.AccidentalEnum.NONE}ToString(){return"Key: "+this.keyType+this.mode}OperatorEquals(t){const e=this;return e===t||!(!e||!t)&&e.Key===t.Key&&e.Mode===t.Mode}OperatorNotEqual(t){return!this.OperatorEquals(t)}}var a;e.KeyInstruction=o,o.sharpPositionList=[s.NoteEnum.F,s.NoteEnum.C,s.NoteEnum.G,s.NoteEnum.D,s.NoteEnum.A,s.NoteEnum.E,s.NoteEnum.B],o.flatPositionList=[s.NoteEnum.B,s.NoteEnum.E,s.NoteEnum.A,s.NoteEnum.D,s.NoteEnum.G,s.NoteEnum.C,s.NoteEnum.F],e.NoteEnumToHalfToneLink=class{constructor(t,e){this.note=t,this.halfTone=e}},function(t){t[t.major=0]="major",t[t.minor=1]="minor",t[t.none=2]="none",t[t.dorian=3]="dorian",t[t.phrygian=4]="phrygian",t[t.lydian=5]="lydian",t[t.mixolydian=6]="mixolydian",t[t.aeolian=7]="aeolian",t[t.ionian=8]="ionian",t[t.locrian=9]="locrian"}(a=e.KeyEnum||(e.KeyEnum={}))},6189:(t,e)=>{"use strict";var i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.AlignmentType=e.RepetitionInstructionEnum=e.RepetitionInstruction=e.RepetitionInstructionComparer=void 0,e.RepetitionInstructionComparer=class{static Compare(t,e){if(void 0!==t.parentRepetition&&e.parentRepetition){if(t.alignment===n.End&&e.alignment===n.End){if(t.parentRepetition.StartIndexe.parentRepetition.StartIndex)return-1}if(t.alignment===n.Begin&&e.alignment===n.Begin){if(t.parentRepetition.EndIndexe.parentRepetition.EndIndex)return-1}}return 0}},e.RepetitionInstruction=class{constructor(t,e,i=n.End,s=void 0,r=void 0){this.endingIndices=void 0,this.measureIndex=t,r&&(this.endingIndices=r.slice()),this.type=e,this.alignment=i,this.parentRepetition=s}CompareTo(t){const e=t;if(this.measureIndex>e.measureIndex)return 1;if(this.measureIndex{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RhythmSymbolEnum=e.RhythmInstruction=void 0;const n=i(1877);class s extends n.AbstractNotationInstruction{constructor(t,e){super(void 0),this.rhythm=t,this.numerator=t.Numerator,this.denominator=t.Denominator,this.symbolEnum=e}get Rhythm(){return this.rhythm}set Rhythm(t){this.rhythm=t}get SymbolEnum(){return this.symbolEnum}set SymbolEnum(t){this.symbolEnum=t}clone(){return new s(this.rhythm.clone(),this.symbolEnum)}OperatorEquals(t){const e=this;return e===t||!(!e||!t)&&e.numerator===t.numerator&&e.denominator===t.denominator}OperatorNotEqual(t){return!(this===t)}ToString(){return"Rhythm: "+this.rhythm.toString()}}var r;e.RhythmInstruction=s,(r=e.RhythmSymbolEnum||(e.RhythmSymbolEnum={}))[r.NONE=0]="NONE",r[r.COMMON=1]="COMMON",r[r.CUT=2]="CUT"},1357:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.TechnicalInstruction=e.TechnicalInstructionType=void 0,(i=e.TechnicalInstructionType||(e.TechnicalInstructionType={}))[i.Fingering=0]="Fingering",i[i.String=1]="String",e.TechnicalInstruction=class{}},6065:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(1877),e),s(i(289),e),s(i(5198),e),s(i(6189),e),s(i(3331),e),s(i(1357),e)},2947:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedVoice=void 0;const n=i(3884);class s extends n.Voice{constructor(t,e,i){super(t,e),this.master=i}get Master(){return this.master}}e.LinkedVoice=s},7274:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LyricsEntry=void 0,e.LyricsEntry=class{constructor(t,e,i,n,s=-1){this.text=t,this.word=i,this.parent=n,this.verseNumber=e,s>=0&&(this.syllableIndex=s)}get Text(){return this.text}set Text(t){this.text=t}get Word(){return this.word}get Parent(){return this.parent}set Parent(t){this.parent=t}get VerseNumber(){return this.verseNumber}get SyllableIndex(){return this.syllableIndex}}},2672:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LyricWord=void 0,e.LyricWord=class{constructor(){this.syllables=[]}get Syllables(){return this.syllables}containsVoiceEntry(t){for(let e=0,i=this.Syllables.length;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Appearance=e.Note=void 0;const n=i(1797);var s;e.Note=class{constructor(t,e,i,n,s,r){this.slurs=[],this.playbackInstrumentId=void 0,this.notehead=void 0,this.printObject=!0,this.voiceEntry=t,this.parentStaffEntry=e,this.length=i,this.pitch=n,this.sourceMeasure=s,this.isRestFlag=null!=r&&r,this.noteTremoloType="",this.glissandoType="",this.slideType="",this.halfTone=n?n.getHalfTone():0}get NoteAsString(){return this.pitch.toString()}get TremoloType(){return this.noteTremoloType}set TremoloType(t){this.noteTremoloType=t}get ParentVoiceEntry(){return this.voiceEntry}set ParentVoiceEntry(t){this.voiceEntry=t}get ParentStaffEntry(){return this.parentStaffEntry}get ParentStaff(){return this.parentStaffEntry.ParentStaff}get Length(){return this.length}set PlaybackNote(t){this.playbackNote=t}get PlaybackNote(){return this.playbackNote}set Length(t){this.length=t}get SourceMeasure(){return this.sourceMeasure}get TypeLength(){return this.typeLength}set TypeLength(t){this.typeLength=t}get NoteTypeXml(){return this.noteTypeXml}set NoteTypeXml(t){this.noteTypeXml=t}get NormalNotes(){return this.normalNotes}set NormalNotes(t){this.normalNotes=t}get Pitch(){return this.pitch}get NoteBeam(){return this.beam}set NoteBeam(t){this.beam=t}set Notehead(t){this.notehead=t}get Notehead(){return this.notehead}get NoteTuplet(){return this.tuplet}set NoteTuplet(t){this.tuplet=t}get NoteTie(){return this.tie}set NoteTie(t){this.tie=t}get NoteSlurs(){return this.slurs}set NoteSlurs(t){this.slurs=t}get PlaybackInstrumentId(){return this.playbackInstrumentId}set PlaybackInstrumentId(t){this.playbackInstrumentId=t}get PrintObject(){return this.printObject}set PrintObject(t){this.printObject=t}get Arpeggio(){return this.arpeggio}set Arpeggio(t){this.arpeggio=t}get IsCueNote(){return this.isCueNote}set IsCueNote(t){this.isCueNote=t}get StemDirectionXml(){return this.stemDirectionXml}set StemDirectionXml(t){this.stemDirectionXml=t}get TremoloStrokes(){return this.tremoloStrokes}set TremoloStrokes(t){this.tremoloStrokes=t}get StemColorXml(){return this.stemColorXml}set StemColorXml(t){this.stemColorXml=t}get NoteheadColorXml(){return this.noteheadColorXml}set NoteheadColorXml(t){this.noteheadColorXml=t}get NoteheadColor(){return this.noteheadColor}set NoteheadColor(t){this.noteheadColor=t}get NoteheadColorCurrentlyRendered(){return this.noteheadColorCurrentlyRendered}set NoteheadColorCurrentlyRendered(t){this.noteheadColorCurrentlyRendered=t}isRest(){return this.isRestFlag}isWholeRest(){return this.isRest()&&this.Length.RealValue===this.sourceMeasure.ActiveTimeSignature.RealValue}ToString(){return this.pitch?this.Pitch.ToString()+", length: "+this.length.toString():"rest note, length: "+this.length.toString()}getAbsoluteTimestamp(){return n.Fraction.plus(this.voiceEntry.Timestamp,this.sourceMeasure.AbsoluteTimestamp)}checkForDoubleSlur(t){for(let e=0,i=this.slurs.length;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NoteTypeHandler=e.NoteType=void 0;const n=i(1797),s=i(6331),r=i(1703);var o;!function(t){t[t.UNDEFINED=0]="UNDEFINED",t[t._1024th=1]="_1024th",t[t._512th=2]="_512th",t[t._256th=3]="_256th",t[t._128th=4]="_128th",t[t._64th=5]="_64th",t[t._32nd=6]="_32nd",t[t._16th=7]="_16th",t[t.EIGTH=8]="EIGTH",t[t.QUARTER=9]="QUARTER",t[t.HALF=10]="HALF",t[t.WHOLE=11]="WHOLE",t[t.BREVE=12]="BREVE",t[t.LONG=13]="LONG",t[t.MAXIMA=14]="MAXIMA"}(o=e.NoteType||(e.NoteType={}));class a{static NoteTypeToString(t){return this.NoteTypeXmlValues[t]}static StringToNoteType(t){const e=this.NoteTypeXmlValues.indexOf(t);return-1!==e?e:o.UNDEFINED}static getNoteDurationFromType(t){switch(t){case"1024th":return new n.Fraction(1,1024);case"512th":return new n.Fraction(1,512);case"256th":return new n.Fraction(1,256);case"128th":return new n.Fraction(1,128);case"64th":return new n.Fraction(1,64);case"32th":case"32nd":return new n.Fraction(1,32);case"16th":return new n.Fraction(1,16);case"eighth":return new n.Fraction(1,8);case"quarter":return new n.Fraction(1,4);case"half":return new n.Fraction(1,2);case"whole":return new n.Fraction(1,1);case"breve":return new n.Fraction(2,1);case"long":return new n.Fraction(4,1);case"maxima":return new n.Fraction(8,1);default:{const t=s.ITextTranslation.translateText("ReaderErrorMessages/NoteDurationError","Invalid note duration.");throw new r.MusicSheetReadingException(t)}}}}e.NoteTypeHandler=a,a.NoteTypeXmlValues=["","1024th","512th","256th","128th","64th","32nd","16th","eigth","quarter","half","whole","breve","long","maxima"]},766:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.NoteHeadShape=e.Notehead=void 0;const s=n(i(2043));class r{constructor(t,e,i=void 0){this.sourceNote=t,this.setShapeFromXml(e,i)}setShapeFromXml(t,e=void 0){this.shape=r.ShapeTypeXmlToShape(t);let i=e;void 0===i&&(this.sourceNote?i=this.sourceNote.Length.Denominator>2:(s.default.warn("notehead: sourceNote and filledXmlAttribute undefined."),i=!0)),this.filled=i}get SourceNote(){return this.sourceNote}get Shape(){return this.shape}get Filled(){return this.filled}static ShapeTypeXmlToShape(t){switch(t.toLowerCase()){case"normal":return o.NORMAL;case"x":return o.X;case"slash":return o.SLASH;case"diamond":return o.DIAMOND;case"square":case"la":return o.SQUARE;case"do":case"triangle":return o.TRIANGLE;case"rectangle":return o.RECTANGLE;case"circle-x":return o.CIRCLEX;default:return s.default.info("unsupported/unhandled xml notehead '"+t+"'. Using normal notehead."),o.NORMAL}}}var o;e.Notehead=r,function(t){t[t.CIRCLEX=0]="CIRCLEX",t[t.DIAMOND=1]="DIAMOND",t[t.NORMAL=2]="NORMAL",t[t.RECTANGLE=3]="RECTANGLE",t[t.SLASH=4]="SLASH",t[t.SQUARE=5]="SQUARE",t[t.TRIANGLE=6]="TRIANGLE",t[t.X=7]="X"}(o=e.NoteHeadShape||(e.NoteHeadShape={}))},5922:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OrnamentEnum=e.OrnamentContainer=void 0;const n=i(8640),s=i(3748);var r;e.OrnamentContainer=class{constructor(t){this.placement=s.PlacementEnum.Above,this.accidentalAbove=n.AccidentalEnum.NONE,this.accidentalBelow=n.AccidentalEnum.NONE,this.ornament=t}get GetOrnament(){return this.ornament}get AccidentalAbove(){return this.accidentalAbove}set AccidentalAbove(t){this.accidentalAbove=t}get AccidentalBelow(){return this.accidentalBelow}set AccidentalBelow(t){this.accidentalBelow=t}},(r=e.OrnamentEnum||(e.OrnamentEnum={}))[r.Trill=0]="Trill",r[r.Turn=1]="Turn",r[r.InvertedTurn=2]="InvertedTurn",r[r.DelayedTurn=3]="DelayedTurn",r[r.DelayedInvertedTurn=4]="DelayedInvertedTurn",r[r.Mordent=5]="Mordent",r[r.InvertedMordent=6]="InvertedMordent"},5942:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SourceMeasure=void 0;const n=i(1797),s=i(141),r=i(9050),o=i(6189),a=i(908),l=i(289),h=i(5198),u=i(6894);let c=null;e.SourceMeasure=class{constructor(t,e){this.printNewSystemXml=!1,this.printNewPageXml=!1,this.IsSystemStartMeasure=!1,this.hasLyrics=!1,this.hasMoodExpressions=!1,this.allRests=!1,this.isReducedToMultiRest=!1,this.multipleRestMeasureNumber=0,this.staffLinkedExpressions=[],this.tempoExpressions=[],this.verticalSourceStaffEntryContainers=[],this.graphicalMeasureErrors=[],this.firstRepetitionInstructions=[],this.lastRepetitionInstructions=[],this.metronomeNoteIndex=0,this.completeNumberOfStaves=t,this.implicitMeasure=!1,this.hasEndLine=!1,this.endingBarStyleXml="",this.endingBarStyleEnum=u.SystemLinesEnum.SingleThin,this.firstInstructionsStaffEntries=new Array(t),this.lastInstructionsStaffEntries=new Array(t),this.rules=e,this.TempoInBPM=0;for(let e=0;e1)return t[this.measureListIndex-1]}get Rules(){return this.rules}get VerticalMeasureList(){return this.verticalMeasureList}set VerticalMeasureList(t){this.verticalMeasureList=t}get TempoInBPM(){return this.tempoInBPM}set TempoInBPM(t){this.tempoInBPM=t}findOrCreateStaffEntry(t,e,i){let n,o;for(const e of this.verticalSourceStaffEntryContainers)if(e.Timestamp.Equals(t)){o=e;break}if(o)return o.StaffEntries[e]?n=o.StaffEntries[e]:(n=new r.SourceStaffEntry(o,i),o.StaffEntries[e]=n),{createdNewContainer:!1,staffEntry:n};const a=this.verticalSourceStaffEntryContainers[this.verticalSourceStaffEntryContainers.length-1];if(0===this.verticalSourceStaffEntryContainers.length||a.Timestamp.lt(t)){const o=new s.VerticalSourceStaffEntryContainer(this,t.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.push(o),n=new r.SourceStaffEntry(o,i),o.StaffEntries[e]=n}else for(let o=this.verticalSourceStaffEntryContainers.length-1;o>=0;o--){if(this.verticalSourceStaffEntryContainers[o].Timestamp.lt(t)){const a=new s.VerticalSourceStaffEntryContainer(this,t.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.splice(o+1,0,a),n=new r.SourceStaffEntry(a,i),a.StaffEntries[e]=n;break}if(0===o){const a=new s.VerticalSourceStaffEntryContainer(this,t.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.splice(o,0,a),n=new r.SourceStaffEntry(a,i),a.StaffEntries[e]=n;break}}return{createdNewContainer:!0,staffEntry:n}}findOrCreateVoiceEntry(t,e){let i,n=!1;for(const n of t.VoiceEntries)if(n.ParentVoice===e){i=n;break}return i||(i=new a.VoiceEntry(t.Timestamp,e,t),n=!0),{createdVoiceEntry:n,voiceEntry:i}}getPreviousSourceStaffEntryFromIndex(t,e){for(let i=e-1;i>=0;i--)if(this.verticalSourceStaffEntryContainers[i][t])return this.verticalSourceStaffEntryContainers[i][t]}getVerticalContainerIndexByTimestamp(t){for(let e=0,i=this.VerticalSourceStaffEntryContainers.length;e=0;e--){const t=this.verticalSourceStaffEntryContainers[e][r+s];if(void 0!==t&&t.hasTie()&&i.lt(n.Fraction.plus(t.Timestamp,t.calculateMaxNoteLength()))){i=n.Fraction.plus(t.Timestamp,t.calculateMaxNoteLength());break}}}s.push(i)}for(let t=0,e=s.length;t0)return!0}return!1}beginsWithLineRepetition(){for(let t=0,e=this.FirstRepetitionInstructions.length;t=0&&(e=this.verticalSourceStaffEntryContainers[i].StaffEntries[t],!e);i--);return e}canBeReducedToMultiRest(){var t,e,i,n,s,r;let o=!0,a=!1;for(const t of this.verticalSourceStaffEntryContainers)if(t)for(const e of t.StaffEntries)if(e&&e.ParentStaff.ParentInstrument.Visible){if(e.ChordContainers.length>0)return!1;if(e.ParentStaff.hasLyrics&&(a=!0),this.firstRepetitionInstructions.length>0||this.lastRepetitionInstructions.length>0)return!1;for(const t of e.VoiceEntries){for(const e of t.Notes)if(!e.isRest()){o=!1;break}if(!o)break}}if(!o||a||this.hasMoodExpressions||this.tempoExpressions.length>0)return!1;for(const t of this.staffLinkedExpressions)if(t.length>0)return!1;for(const t of this.lastInstructionsStaffEntries)for(let e=0,i=null==t?void 0:t.Instructions.length;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SourceStaffEntry=void 0;const n=i(1797),s=i(289),r=i(5198),o=i(3331);e.SourceStaffEntry=class{constructor(t,e){this.voiceEntries=[],this.instructions=[],this.chordSymbolContainers=[],this.verticalContainerParent=t,this.parentStaff=e}get ParentStaff(){return this.parentStaff}get VerticalContainerParent(){return this.verticalContainerParent}get Timestamp(){if(this.VerticalContainerParent)return this.VerticalContainerParent.Timestamp}get AbsoluteTimestamp(){if(this.VerticalContainerParent)return n.Fraction.plus(this.VerticalContainerParent.ParentMeasure.AbsoluteTimestamp,this.VerticalContainerParent.Timestamp)}get VoiceEntries(){return this.voiceEntries}set VoiceEntries(t){this.voiceEntries=t}get Link(){return this.staffEntryLink}set Link(t){this.staffEntryLink=t}get Instructions(){return this.instructions}set Instructions(t){this.instructions=t}get ChordContainers(){return this.chordSymbolContainers}set ChordContainers(t){this.chordSymbolContainers=t}removeAllInstructionsOfTypeClefInstruction(){let t=0,e=0;for(;t0)return!0;return!1}hasTie(){for(let t=0,e=this.VoiceEntries.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Staff=void 0,e.Staff=class{constructor(t,e){this.isTab=!1,this.voices=[],this.volume=1,this.stafflineCount=5,this.hasLyrics=!1,this.openTieDict={},this.parentInstrument=t,this.id=e,this.audible=!0,this.following=!0}get ParentInstrument(){return this.parentInstrument}set ParentInstrument(t){this.parentInstrument=t}get Voices(){return this.voices}get Solo(){return this.solo}set Solo(t){this.solo=t}get Id(){return this.id}get Volume(){return this.volume}set Volume(t){this.volume=t}get StafflineCount(){return this.stafflineCount}set StafflineCount(t){this.stafflineCount=t}toString(){return"Staff "+this.idInMusicSheet.toString()}}},4447:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StaffEntryLink=void 0,e.StaffEntryLink=class{constructor(t){this.linkStaffEntries=[],this.voiceEntry=t}get GetVoiceEntry(){return this.voiceEntry}get LinkStaffEntries(){return this.linkStaffEntries}set LinkStaffEntries(t){this.linkStaffEntries=t}}},2953:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TabNote=void 0;const n=i(5253);class s extends n.Note{constructor(t,e,i,n,s,r,o,a){super(t,e,i,n,s),this.stringNumberTab=r,this.fretNumber=o,this.bendArray=a}get StringNumberTab(){return this.stringNumberTab}get FretNumber(){return this.fretNumber}get BendArray(){return this.bendArray}}e.TabNote=s},4555:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Tie=void 0;const s=i(1797),r=i(3748),o=n(i(2043));e.Tie=class{constructor(t,e){this.notes=[],this.TieNumber=1,this.TieDirection=r.PlacementEnum.NotYetDefined,this.NoteIndexToTieDirection={},this.AddNote(t),this.type=e}getTieDirection(t){if(!t)return this.TieDirection;for(let e=0;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Tuplet=void 0,e.Tuplet=class{constructor(t,e=!1){this.PlacementFromXml=!1,this.notes=[],this.fractions=[],this.tupletLabelNumber=t,this.bracket=e}get TupletLabelNumber(){return this.tupletLabelNumber}set TupletLabelNumber(t){this.tupletLabelNumber=t}get Notes(){return this.notes}set Notes(t){this.notes=t}get Fractions(){return this.fractions}set Fractions(t){this.fractions=t}get Bracket(){return this.bracket}set Bracket(t){this.bracket=t}getNoteIndex(t){for(let e=this.notes.length-1;e>=0;e--)for(let i=0;i{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VerticalSourceStaffEntryContainer=void 0;const n=i(1797);e.VerticalSourceStaffEntryContainer=class{constructor(t,e,i){this.staffEntries=[],this.comments=[],this.timestamp=e,this.staffEntries=new Array(i),this.parentMeasure=t}$get$(t){return this.staffEntries[t]}$set$(t,e){this.staffEntries[t]=e}get Timestamp(){return this.timestamp}set Timestamp(t){this.timestamp=t}get StaffEntries(){return this.staffEntries}set StaffEntries(t){this.staffEntries=t}get Comments(){return this.comments}set Comments(t){this.comments=t}get ParentMeasure(){return this.parentMeasure}set ParentMeasure(t){this.parentMeasure=t}getAbsoluteTimestamp(){return n.Fraction.plus(this.timestamp,this.parentMeasure.AbsoluteTimestamp)}}},3884:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Voice=void 0,e.Voice=class{constructor(t,e){this.voiceEntries=[],this.volume=1,this.parent=t,this.visible=!0,this.audible=!0,this.following=!0,this.voiceId=e,this.uniqueVoiceId="I:"+this.parent.Id+" V: "+this.voiceId}get VoiceEntries(){return this.voiceEntries}get Parent(){return this.parent}get Visible(){return this.visible}set Visible(t){this.visible=t}get Audible(){return this.audible}set Audible(t){this.audible=t}get Following(){return this.following}set Following(t){this.following=t}get Solo(){return this.solo}set Solo(t){this.solo=t}get VoiceId(){return this.voiceId}get Volume(){return this.volume}set Volume(t){this.volume=t}toString(){return this.uniqueVoiceId}}},908:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StemDirectionType=e.ArticulationEnum=e.VoiceEntry=void 0;const n=i(1649),s=i(4170),r=i(6591);var o,a;e.VoiceEntry=class{constructor(t,e,i,r=!0,o=!1,l=!1,h=!1){if(this.notes=[],this.graceVoiceEntriesBefore=[],this.graceVoiceEntriesAfter=[],this.articulations=[],this.playbackEntries=[],this.technicalInstructions=[],this.lyricsEntries=new n.Dictionary,this.wantedStemDirection=a.Undefined,this.stemDirectionXml=a.Undefined,this.stemDirection=a.Undefined,this.timestamp=t,this.parentVoice=e,this.parentSourceStaffEntry=i,this.isGrace=o,this.graceAfterMainNote=!1,this.graceNoteSlash=l,this.graceSlur=h,o||e.VoiceEntries.push(this),r&&void 0!==i){const t=i.VoiceEntries;-1===t.indexOf(this)&&t.push(this)}this.mainPlaybackEntry=new s.PlaybackEntry(this),this.PlaybackEntries.push(this.mainPlaybackEntry)}get ParentSourceStaffEntry(){return this.parentSourceStaffEntry}get ParentVoice(){return this.parentVoice}get Timestamp(){return this.timestamp}set Timestamp(t){this.timestamp=t}get Notes(){return this.notes}addNote(t){this.notes.push(t),t.isRest()||void 0!==t.NoteTie&&t.NoteTie.StartNote!==t||this.MainPlaybackEntry.Notes.push(new r.PlaybackNote(this.MainPlaybackEntry,t))}get GraceVoiceEntriesBefore(){return this.graceVoiceEntriesBefore}set GraceVoiceEntriesBefore(t){this.graceVoiceEntriesBefore=t;for(const t of this.graceVoiceEntriesBefore)t.parentSourceStaffEntry=this.ParentSourceStaffEntry}get GraceVoiceEntriesAfter(){return this.graceVoiceEntriesAfter}set GraceVoiceEntriesAfter(t){this.graceVoiceEntriesAfter=t;for(const t of this.graceVoiceEntriesAfter)t.parentSourceStaffEntry=this.ParentSourceStaffEntry}get IsGrace(){return this.isGrace}set IsGrace(t){this.isGrace=t}get GraceAfterMainNote(){return this.graceAfterMainNote}set GraceAfterMainNote(t){this.graceAfterMainNote=t}get GraceNoteSlash(){return this.graceNoteSlash}set GraceNoteSlash(t){this.graceNoteSlash=t}get GraceSlur(){return this.graceSlur}set GraceSlur(t){this.graceSlur=t}get Articulations(){return this.articulations}get PlaybackEntries(){return this.playbackEntries}get Fermata(){return this.fermata}get MainPlaybackEntry(){return this.mainPlaybackEntry}set MainPlaybackEntry(t){this.mainPlaybackEntry=t}removeMainPlaybackEntry(){void 0!==this.mainPlaybackEntry&&this.removePlaybackEntry(this.mainPlaybackEntry)}removePlaybackEntry(t){this.mainPlaybackEntry===t&&(this.mainPlaybackEntry=void 0);const e=this.playbackEntries.indexOf(t);e>-1&&this.playbackEntries.splice(e,1)}get TechnicalInstructions(){return this.technicalInstructions}get LyricsEntries(){return this.lyricsEntries}get Arpeggio(){return this.arpeggio}set Arpeggio(t){this.arpeggio=t}get OrnamentContainer(){return this.ornamentContainer}set OrnamentContainer(t){this.ornamentContainer=t}set WantedStemDirection(t){this.wantedStemDirection=t}get WantedStemDirection(){return this.wantedStemDirection}set StemDirectionXml(t){this.stemDirectionXml=t}get StemDirectionXml(){return this.stemDirectionXml}set StemDirection(t){this.stemDirection=t}get StemDirection(){return this.stemDirection}get StemColorXml(){return this.stemColorXml}set StemColorXml(t){this.stemColorXml=t}get StemColor(){return this.stemColor}set StemColor(t){this.stemColor=t}get VolumeModifier(){return this.volumeModifier}set VolumeModifier(t){this.volumeModifier=t}get DurationModifier(){return this.durationModifier}set DurationModifier(t){this.durationModifier=t}hasArticulation(t){for(const e of this.articulations)if(e.Equals(t))return!0;return!1}static isSupportedArticulation(t){switch(t){case o.accent:case o.strongaccent:case o.invertedstrongaccent:case o.staccato:case o.staccatissimo:case o.spiccato:case o.tenuto:case o.fermata:case o.invertedfermata:case o.breathmark:case o.caesura:case o.lefthandpizzicato:case o.naturalharmonic:case o.snappizzicato:case o.upbow:case o.downbow:case o.bend:case o.detachedlegato:return!0;default:return!1}}hasTie(){for(let t=0,e=this.Notes.length;t0)return!0;return!1}isStaccato(){for(const t of this.Articulations)if(t.articulationEnum===o.staccato)return!0;return!1}isAccent(){for(const t of this.Articulations)if(t.articulationEnum===o.accent||t.articulationEnum===o.strongaccent)return!0;return!1}getVerseNumberForLyricEntry(t){let e=1;return this.lyricsEntries.forEach(((i,n)=>{t===n&&(e=i)})),e}},function(t){t[t.accent=0]="accent",t[t.strongaccent=1]="strongaccent",t[t.marcatoup=2]="marcatoup",t[t.marcatodown=3]="marcatodown",t[t.invertedstrongaccent=4]="invertedstrongaccent",t[t.staccato=5]="staccato",t[t.staccatissimo=6]="staccatissimo",t[t.spiccato=7]="spiccato",t[t.tenuto=8]="tenuto",t[t.fermata=9]="fermata",t[t.invertedfermata=10]="invertedfermata",t[t.breathmark=11]="breathmark",t[t.caesura=12]="caesura",t[t.lefthandpizzicato=13]="lefthandpizzicato",t[t.naturalharmonic=14]="naturalharmonic",t[t.snappizzicato=15]="snappizzicato",t[t.upbow=16]="upbow",t[t.downbow=17]="downbow",t[t.scoop=18]="scoop",t[t.plop=19]="plop",t[t.doit=20]="doit",t[t.falloff=21]="falloff",t[t.stress=22]="stress",t[t.unstress=23]="unstress",t[t.detachedlegato=24]="detachedlegato",t[t.otherarticulation=25]="otherarticulation",t[t.bend=26]="bend"}(o=e.ArticulationEnum||(e.ArticulationEnum={})),function(t){t[t.Undefined=-1]="Undefined",t[t.Up=0]="Up",t[t.Down=1]="Down",t[t.None=2]="None",t[t.Double=3]="Double"}(a=e.StemDirectionType||(e.StemDirectionType={}))},6550:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(3029),e),s(i(9224),e),s(i(4123),e),s(i(2947),e),s(i(5253),e),s(i(766),e),s(i(2478),e),s(i(5922),e),s(i(5942),e),s(i(9050),e),s(i(0),e),s(i(4447),e),s(i(4555),e),s(i(8069),e),s(i(141),e),s(i(3884),e),s(i(908),e),s(i(6065),e),s(i(5253),e),s(i(2478),e),s(i(5942),e),s(i(9050),e),s(i(141),e),s(i(4555),e)},4761:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(1703),e),s(i(6842),e),s(i(884),e),s(i(2255),e),s(i(7514),e),s(i(5142),e),s(i(6550),e),s(i(4990),e),s(i(4257),e),s(i(9714),e),s(i(4759),e),s(i(4143),e),s(i(1295),e)},3495:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AJAX=void 0,e.AJAX=class{static ajax(t,e=9e3){let i;const n=t.indexOf(".mxl")>-1?"text/plain; charset=x-user-defined":"application/xml";if(XMLHttpRequest)i=new XMLHttpRequest;else{if(!ActiveXObject)return Promise.reject(new Error("XMLHttp not supported."));i=new ActiveXObject("Microsoft.XMLHTTP")}return i.timeout=e,new Promise(((e,s)=>{i.onreadystatechange=()=>{i.readyState===XMLHttpRequest.DONE&&(200===i.status||0===i.status&&i.responseText?e(i.responseText):s(new Error("Could not retrieve requested URL "+i.status)))},i.ontimeout=t=>{s(new Error("Server request Timeout"))},i.overrideMimeType(n),i.open("GET",t,!0),i.send()}))}}},530:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Cursor=void 0;const n=i(301),s=i(1797);e.Cursor=class{constructor(t,e,i){this.hidden=!1,this.currentPageNumber=1,this.container=t,this.openSheetMusicDisplay=e,this.rules=this.openSheetMusicDisplay.EngravingRules,this.cursorOptions=i;let n=0;for(this.cursorElementId="cursorImg-0";document.getElementById(this.cursorElementId);)n++,this.cursorElementId=`cursorImg-${n}`;const s=document.createElement("img");s.id=this.cursorElementId,s.style.position="absolute",!0===this.cursorOptions.follow?(this.wantedZIndex="-1",s.style.zIndex=this.wantedZIndex):(this.wantedZIndex="-2",s.style.zIndex=this.wantedZIndex),this.cursorElement=s,this.container.appendChild(s)}cursorPositionChanged(t,e){for(;this.iterator.CurrentEnrolledTimestamp.lt(t);)this.iterator.moveToNext();this.iterator.CurrentEnrolledTimestamp.gt(t)&&(this.iterator=new n.MusicPartManagerIterator(this.manager.MusicSheet,t)),this.updateWithTimestamp(e.PredictedPosition)}pauseOccurred(t){}setSound(){}selectionEndReached(t){}resetOccurred(t){this.reset()}notesPlaybackEventOccurred(t){}adjustToBackgroundColor(){let t;t=this.rules.PageBackgroundColor?"1":this.wantedZIndex,this.cursorElement.style.zIndex=t}init(t,e){this.manager=t,this.graphic=e,this.reset(),this.hidden=!1}show(){this.hidden=!1,this.update(),this.adjustToBackgroundColor()}resetIterator(){if(!this.openSheetMusicDisplay.Sheet||!this.openSheetMusicDisplay.Sheet.SourceMeasures)return void console.log("OSMD.Cursor.resetIterator(): sheet or measures were null/undefined.");const t=this.openSheetMusicDisplay.Sheet.SourceMeasures.length-1;let e=this.rules.MinMeasureToDrawIndex;e=Math.min(e,t);let i=this.rules.MaxMeasureToDrawIndex;if(i=Math.min(i,t),this.openSheetMusicDisplay.Sheet&&(!this.openSheetMusicDisplay.Sheet.SelectionStart||this.openSheetMusicDisplay.Sheet.SelectionStart.WholeValuee&&(this.openSheetMusicDisplay.Sheet.SelectionStart=this.openSheetMusicDisplay.Sheet.SourceMeasures[e].AbsoluteTimestamp),this.openSheetMusicDisplay.Sheet&&this.openSheetMusicDisplay.Sheet.SourceMeasures.length>i){const t=this.openSheetMusicDisplay.Sheet.SourceMeasures[i];this.openSheetMusicDisplay.Sheet.SelectionEnd=s.Fraction.plus(t.AbsoluteTimestamp,t.Duration)}this.iterator=this.manager.getIterator()}getStaffEntryFromVoiceEntry(t){const e=t.ParentSourceStaffEntry.VerticalContainerParent.ParentMeasure.measureListIndex,i=t.ParentSourceStaffEntry.ParentStaff.idInMusicSheet;return this.graphic.findGraphicalStaffEntryFromMeasureList(i,e,t.ParentSourceStaffEntry)}updateWithTimestamp(t){const e=this.manager.absoluteEnrolledToSheetTimestamp(t),i=this.graphic.calculateXPositionFromTimestamp(e),n=i[0],s=i[1];this.updateCurrentPageFromSystem(s);const r=i[2];if(!r)return;const o=Math.max(r.parentMeasure.MeasureNumber,1);let a;for(const t of this.graphic.MeasureList[o-1])if(t){a=t;break}const l=this.graphic.calculateCursorPoints(n,s),h=l[0].y,u=l[1].y-h;if(a){if(this.updateWidthAndStyle(a.PositionAndShape,n,h,u),this.openSheetMusicDisplay.FollowCursor){const t=this.cursorElement.getBoundingClientRect().top;this.cursorElement.scrollIntoView({behavior:t<1e3?"smooth":"auto",block:"center"})}this.cursorElement.style.display=""}}update(){var t;if(this.hidden||void 0===this.hidden||null===this.hidden)return;this.updateCurrentPage();const e=this.Iterator,i=e.CurrentVisibleVoiceEntries();if(e.EndReached||!e.CurrentVoiceEntries||0===i.length)return;let n,s=0,r=0,o=0;if(e.CurrentMeasure.isReducedToMultiRest){const t=this.graphic.findGraphicalMeasure(e.CurrentMeasureIndex,0),i=t.parentSourceMeasure.multipleRestMeasures,r=e.CurrentMeasure.multipleRestMeasureNumber/(i+1),o=t.PositionAndShape.Size.width-t.beginInstructionsWidth;s=t.PositionAndShape.AbsolutePosition.x+t.beginInstructionsWidth+r*o,n=t.ParentMusicSystem}else{const t=i.map((t=>this.getStaffEntryFromVoiceEntry(t))).sort(((t,e)=>{var i,n,s,r;return(null===(n=null===(i=null==t?void 0:t.PositionAndShape)||void 0===i?void 0:i.AbsolutePosition)||void 0===n?void 0:n.x)<=(null===(r=null===(s=null==e?void 0:e.PositionAndShape)||void 0===s?void 0:s.AbsolutePosition)||void 0===r?void 0:r.x)?-1:1}))[0];t&&(s=t.PositionAndShape.AbsolutePosition.x,n=t.parentMeasure.ParentMusicSystem)}if(!n)return;r=null!==(t=n.PositionAndShape.AbsolutePosition.y+n.StaffLines[0].PositionAndShape.RelativePosition.y)&&void 0!==t?t:0;const a=n.StaffLines[n.StaffLines.length-1];o=n.PositionAndShape.AbsolutePosition.y+a.PositionAndShape.RelativePosition.y+a.StaffHeight-r;const l=this.graphic.findGraphicalMeasure(e.CurrentMeasureIndex,0).PositionAndShape;if(this.updateWidthAndStyle(l,s,r,o),this.openSheetMusicDisplay.FollowCursor&&this.cursorOptions.follow)if(this.openSheetMusicDisplay.EngravingRules.RenderSingleHorizontalStaffline)this.cursorElement.scrollIntoView({behavior:"smooth",inline:"center"});else{const t=this.cursorElement.getBoundingClientRect().top;this.cursorElement.scrollIntoView({behavior:t<1e3?"smooth":"auto",block:"center"})}this.cursorElement.style.display=""}updateWidthAndStyle(t,e,i,n){var s;const r=this.cursorElement;let o=0,a=n;switch(this.cursorOptions.type){case 1:r.style.top=10*i*this.openSheetMusicDisplay.zoom+"px",r.style.left=10*(e-1.5)*this.openSheetMusicDisplay.zoom+"px",a=10*n*this.openSheetMusicDisplay.zoom,r.height=a,r.style.height=a+"px",o=5*this.openSheetMusicDisplay.zoom;break;case 2:r.style.top=10*(i-2.5)*this.openSheetMusicDisplay.zoom+"px",r.style.left=10*e*this.openSheetMusicDisplay.zoom+"px",a=15*this.openSheetMusicDisplay.zoom,r.height=a,r.style.height=a+"px",o=5*this.openSheetMusicDisplay.zoom;break;case 3:r.style.top=10*t.AbsolutePosition.y*this.openSheetMusicDisplay.zoom+"px",r.style.left=10*t.AbsolutePosition.x*this.openSheetMusicDisplay.zoom+"px",a=10*n*this.openSheetMusicDisplay.zoom,r.height=a,r.style.height=a+"px",o=10*t.Size.width*this.openSheetMusicDisplay.zoom;break;case 4:r.style.top=10*t.AbsolutePosition.y*this.openSheetMusicDisplay.zoom+"px",r.style.left=10*t.AbsolutePosition.x*this.openSheetMusicDisplay.zoom+"px",a=10*n*this.openSheetMusicDisplay.zoom,r.height=a,r.style.height=a+"px",o=10*(e-t.AbsolutePosition.x)*this.openSheetMusicDisplay.zoom;break;default:r.style.top=10*i*this.openSheetMusicDisplay.zoom+"px",r.style.left=10*(e-1.5)*this.openSheetMusicDisplay.zoom+"px",a=10*n*this.openSheetMusicDisplay.zoom,r.height=a,r.style.height=a+"px",o=30*this.openSheetMusicDisplay.zoom}(null===(s=window.GYM)||void 0===s?void 0:s.multitrack)&&(r.height=a+24,r.style.height=a+24+"px"),o!==r.width&&(r.width=o,this.updateStyle(o,this.cursorOptions))}hide(){this.cursorElement.style.display="none",this.hidden=!0}next(){this.Iterator.moveToNextVisibleVoiceEntry(!1),this.update()}reset(){this.resetIterator();const t=this.manager.getIterator(this.graphic.ParentMusicSheet.SelectionStart);this.updateWithTimestamp(t.CurrentEnrolledTimestamp)}updateStyle(t,e=void 0){void 0!==e&&(this.cursorOptions=e);const i=document.createElement("canvas");i.width=this.cursorElement.width,i.height=1;const n=i.getContext("2d");n.globalAlpha=this.cursorOptions.alpha;const s=n.createLinearGradient(0,0,this.cursorElement.width,0);switch(this.cursorOptions.type){case 1:case 2:case 3:case 4:s.addColorStop(1,this.cursorOptions.color);break;default:s.addColorStop(0,"white"),s.addColorStop(.2,this.cursorOptions.color),s.addColorStop(.8,this.cursorOptions.color),s.addColorStop(1,"white")}n.fillStyle=s,n.fillRect(0,0,t,1),this.cursorElement.src=i.toDataURL("image/png")}get Iterator(){return this.iterator}get Hidden(){return this.hidden}VoicesUnderCursor(t){return this.Iterator.CurrentVisibleVoiceEntries(t)}NotesUnderCursor(t){const e=this.VoicesUnderCursor(t),i=[];return e.forEach((t=>{i.push.apply(i,t.Notes)})),i}GNotesUnderCursor(t){const e=this.VoicesUnderCursor(t),i=[];return e.forEach((t=>{i.push(...t.Notes.map((t=>this.rules.GNote(t))))})),i}updateCurrentPage(){const t=this.Iterator.currentTimeStamp;for(const e of this.graphic.MusicPages)if(e.MusicSystems.last().GetSystemsLastTimeStamp().gt(t)){const t=e.PageNumber;return t!==this.currentPageNumber&&(this.container.removeChild(this.cursorElement),this.container=document.getElementById(this.rules.DYContainerId+t),this.container.appendChild(this.cursorElement)),this.currentPageNumber=t}return 1}updateCurrentPageFromSystem(t){if(null==t?void 0:t.Parent){const e=t.Parent.PageNumber;return e!==this.currentPageNumber&&(this.container.removeChild(this.cursorElement),this.container=document.getElementById(this.rules.DYContainerId+e),this.container.appendChild(this.cursorElement)),this.currentPageNumber=e}return 1}}},41:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OSMDOptions=e.BackendType=e.FillEmptyMeasuresWithWholeRests=e.AlignRestOption=e.CursorType=void 0;const n=i(7459);var s,r,o,a;(a=e.CursorType||(e.CursorType={}))[a.Standard=0]="Standard",a[a.ThinLeft=1]="ThinLeft",a[a.ShortThinTopLeft=2]="ShortThinTopLeft",a[a.CurrentArea=3]="CurrentArea",a[a.CurrentAreaLeft=4]="CurrentAreaLeft",(o=e.AlignRestOption||(e.AlignRestOption={}))[o.Never=0]="Never",o[o.Always=1]="Always",o[o.Auto=2]="Auto",(r=e.FillEmptyMeasuresWithWholeRests||(e.FillEmptyMeasuresWithWholeRests={}))[r.No=0]="No",r[r.YesVisible=1]="YesVisible",r[r.YesInvisible=2]="YesInvisible",function(t){t[t.SVG=0]="SVG",t[t.Canvas=1]="Canvas"}(s=e.BackendType||(e.BackendType={})),e.OSMDOptions=class{static OSMDOptionsStandard(){return{autoResize:!0,backend:"svg",drawingParameters:n.DrawingParametersEnum.default}}static BackendTypeFromString(t){return t&&"canvas"===t.toLowerCase()?s.Canvas:s.SVG}}},9629:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.OpenSheetMusicDisplay=void 0;const s=i(9228),r=i(8738),o=i(1372),a=i(4324),l=i(4040),h=i(5820),u=i(9505),c=i(4028),d=i(530),p=i(7056),f=i(3495),m=n(i(2043)),g=i(7459),b=i(41),y=i(1405),S=i(3748),v=i(1649),_=i(8155),x=i(8640),E=i(1596),M=i(2660),w=i(4821),P=i(8198);class T{constructor(t,e=b.OSMDOptions.OSMDOptionsStandard(),i=new y.EngravingRules){if(this.version="1.4.5-audio-extended",this.cursorsOptions=[],this.cursors=[],this.zoom=1,this.zoomUpdated=!1,this.loadUrlTimeout=5e3,this.rules=i,"string"==typeof t?this.container=document.getElementById(t):t&&"appendChild"in t&&(this.container=t),!this.container)throw new Error("Please pass a valid div container to OpenSheetMusicDisplay");void 0===e.autoResize&&(e.autoResize=!0),this.backendType=b.BackendType.SVG,this.setOptions(e),this.interactionManager=new w.WebDisplayInteractionManager(this.container),this.renderingManager=new M.WebSheetRenderingManager(this.interactionManager,this.rules)}get cursor(){return this.cursors[0]}get RenderingManager(){return this.renderingManager}set PlaybackManager(t){this.renderingManager&&(this.renderingManager.PlaybackManager=t)}get PlaybackManager(){var t;return null===(t=this.renderingManager)||void 0===t?void 0:t.PlaybackManager}isUrl(t){return t.length<2083}isMxl(t){return"PK"===t.substr(0,4)}processMxl(t,e,i){p.MXLHelper.MXLtoXMLstring(t).then((t=>{e(this.processStringXml(t))}),(t=>{m.default.error(new Error("[OSMD] Invalid MXL file: "+t)),i(new Error("[OSMD] Invalid MXL file: "+t))}))}processStringXml(t){const e=new DOMParser;if(""===t.substr(0,3))return m.default.debug("[OSMD] UTF with BOM detected, truncate first three bytes and pass along: "+t),e.parseFromString(t.substr(3),"application/xml");if(t.substr(0,6).includes("{i.isMxl(t)?i.processMxl(t,e,n):e(i.processStringXml(t))}),(t=>{throw n(t),t}));else{const t=new Error("[OSMD] osmd.load(string): Could not process string. Did not find {t.init(this.sheet.MusicPartManager,this.graphic)})),this.renderingManager.setMusicSheet(this.graphic),this.interactionManager.Initialize()}render(){var t;if(!this.graphic)throw new Error("OpenSheetMusicDisplay: Before rendering a music sheet, please load a MusicXML file");null===(t=this.drawer)||void 0===t||t.clear();let e=this.container.offsetWidth;this.rules.RenderSingleHorizontalStaffline&&(e=this.rules.SheetMaximumWidth),this.sheet.pageWidth=e/this.zoom/10,this.renderingManager.MainViewingRegion.WidthInUnits=this.sheet.pageWidth,this.rules.PageFormat&&!this.rules.PageFormat.IsUndefined?(this.rules.PageHeight=this.sheet.pageWidth/this.rules.PageFormat.aspectRatio,m.default.debug("[OSMD] PageHeight: "+this.rules.PageHeight)):(m.default.debug("[OSMD] endless/undefined pageformat, id: "+this.rules.PageFormat.idString),this.rules.PageHeight=100001),this.graphic.reCalculate(),this.drawingParameters.drawCursors&&(this.graphic.Cursors.length=0),this.createOrRefreshRenderBackend(),this.needBackendUpdate=!1,this.drawer.setZoom(this.zoom),this.drawer.drawSheet(this.graphic),this.enableOrDisableCursors(this.drawingParameters.drawCursors),this.drawingParameters.drawCursors&&this.cursors.forEach((t=>{t.update()})),this.zoomUpdated=!1,this.interactionManager.displaySizeChanged(this.container.clientWidth,this.container.clientHeight)}createOrRefreshRenderBackend(){this.drawer&&this.drawer.Backends&&(this.drawer.Backends[0]&&this.drawer.Backends[0].removeAllChildrenFromContainer(this.container),this.drawer.Backends.clear()),this.drawingParameters.Rules=this.rules,this.drawer=new h.VexFlowMusicSheetDrawer(this.drawingParameters),this.drawer.drawableBoundingBoxElement=this.DrawBoundingBox,this.drawer.bottomLineVisible=this.drawBottomLine,this.drawer.skyLineVisible=this.drawSkyLine;let t,e=this.container.offsetWidth;this.rules.RenderSingleHorizontalStaffline&&(e=10*this.graphic.MusicPages[0].PositionAndShape.Size.width*this.zoom);const i=32767;for(const n of this.graphic.MusicPages){if(n.PageNumber>this.rules.MaxPageToDrawNumber)break;const s=this.createBackend(this.backendType,n),r=" exceeds CanvasBackend limit of 32767. Cutting off score.";s.getOSMDBackendType()===b.BackendType.Canvas&&e>i&&(m.default.warn("[OSMD] Warning: width of "+e+r),e=i),this.rules.PageFormat&&!this.rules.PageFormat.IsUndefined?t=e/this.rules.PageFormat.aspectRatio:(t=n.PositionAndShape.Size.height,t+=this.rules.PageBottomMargin,t+=this.rules.CompactMode?this.rules.PageTopMarginNarrow:this.rules.PageTopMargin,this.rules.RenderTitle&&(t+=this.rules.TitleTopDistance),t*=10*this.zoom),s.getOSMDBackendType()===b.BackendType.Canvas&&t>i&&(m.default.warn("[OSMD] Warning: height of "+t+r),t=Math.min(t,i)),s.resize(e,t),s.clear(),this.drawer.Backends.push(s),this.graphic.drawer=this.drawer}}exportSVG(){var t;for(const e of null===(t=this.drawer)||void 0===t?void 0:t.Backends)e instanceof u.SvgVexFlowBackend&&e.export()}IsReadyToRender(){return void 0!==this.graphic}clear(){var t;null===(t=this.drawer)||void 0===t||t.clear(),this.reset()}dispose(){this.disposeResizeListener&&this.disposeResizeListener(),this.InteractionManager&&this.InteractionManager.Dispose()}setOptions(t){if(this.rules||(this.rules=new y.EngravingRules),this.drawingParameters||(this.drawingParameters=new g.DrawingParameters,this.drawingParameters.Rules=this.rules),null==t)return void m.default.warn("warning: osmd.setOptions() called without an options parameter, has no effect.\nexample usage: osmd.setOptions({drawCredits: false, drawPartNames: false})");this.OnXMLRead=function(t){return t},t.onXMLRead&&(this.OnXMLRead=t.onXMLRead),t.drawingParameters&&(this.drawingParameters.DrawingParametersEnum=g.DrawingParametersEnum[t.drawingParameters.toLowerCase()]);let e=!this.drawer||!this.drawer.Backends||this.drawer.Backends.length<1;if(void 0!==t.backend){const i=b.OSMDOptions.BackendTypeFromString(t.backend);e=e||this.backendType!==i,this.backendType=i}this.needBackendUpdate=e,void 0!==t.autoBeam&&(this.rules.AutoBeamNotes=t.autoBeam);const i=t.autoBeamOptions;if(i&&(void 0===i.maintain_stem_directions&&(i.maintain_stem_directions=!1),this.rules.AutoBeamOptions=i,i.groups&&i.groups.length))for(const t of i.groups)if(2!==t.length)throw new Error("Each fraction in autoBeamOptions.groups must be of length 2, e.g. [3,4] for beaming three fourths");void 0!==t.percussionOneLineCutoff&&(this.rules.PercussionOneLineCutoff=t.percussionOneLineCutoff),0!==this.rules.PercussionOneLineCutoff&&void 0!==t.percussionForceVoicesOneLineCutoff&&(this.rules.PercussionForceVoicesOneLineCutoff=t.percussionForceVoicesOneLineCutoff),void 0!==t.alignRests&&(this.rules.AlignRests=t.alignRests),void 0!==t.coloringMode&&this.setColoringMode(t),void 0!==t.coloringEnabled&&(this.rules.ColoringEnabled=t.coloringEnabled),void 0!==t.colorStemsLikeNoteheads&&(this.rules.ColorStemsLikeNoteheads=t.colorStemsLikeNoteheads),t.disableCursor&&(this.drawingParameters.drawCursors=!1),t.drawHiddenNotes&&(this.drawingParameters.drawHiddenNotes=!0),void 0!==t.drawCredits&&(this.drawingParameters.DrawCredits=t.drawCredits),void 0!==t.drawComposer&&(this.drawingParameters.DrawComposer=t.drawComposer),void 0!==t.drawTitle&&(this.drawingParameters.DrawTitle=t.drawTitle),void 0!==t.drawSubtitle&&(this.drawingParameters.DrawSubtitle=t.drawSubtitle),void 0!==t.drawLyricist&&(this.drawingParameters.DrawLyricist=t.drawLyricist),void 0!==t.drawMetronomeMarks&&(this.rules.MetronomeMarksDrawn=t.drawMetronomeMarks),void 0!==t.drawPartNames&&(this.drawingParameters.DrawPartNames=t.drawPartNames,t.drawPartAbbreviations||(this.rules.RenderPartAbbreviations=t.drawPartNames)),void 0!==t.drawPartAbbreviations&&(this.rules.RenderPartAbbreviations=t.drawPartAbbreviations),!1===t.drawFingerings&&(this.rules.RenderFingerings=!1),void 0!==t.drawMeasureNumbers&&(this.rules.RenderMeasureNumbers=t.drawMeasureNumbers),t.drawMeasureNumbersOnlyAtSystemStart&&(this.rules.RenderMeasureNumbersOnlyAtSystemStart=t.drawMeasureNumbersOnlyAtSystemStart),void 0!==t.drawLyrics&&(this.rules.RenderLyrics=t.drawLyrics),void 0!==t.drawTimeSignatures&&(this.rules.RenderTimeSignatures=t.drawTimeSignatures),void 0!==t.drawSlurs&&(this.rules.RenderSlurs=t.drawSlurs),void 0!==t.measureNumberInterval&&(this.rules.MeasureNumberLabelOffset=t.measureNumberInterval),void 0!==t.useXMLMeasureNumbers&&(this.rules.UseXMLMeasureNumbers=t.useXMLMeasureNumbers),void 0!==t.fingeringPosition&&(this.rules.FingeringPosition=S.AbstractExpression.PlacementEnumFromString(t.fingeringPosition)),void 0!==t.fingeringInsideStafflines&&(this.rules.FingeringInsideStafflines=t.fingeringInsideStafflines),void 0!==t.newSystemFromXML&&(this.rules.NewSystemAtXMLNewSystemAttribute=t.newSystemFromXML),void 0!==t.newPageFromXML&&(this.rules.NewPageAtXMLNewPageAttribute=t.newPageFromXML),void 0!==t.fillEmptyMeasuresWithWholeRest&&(this.rules.FillEmptyMeasuresWithWholeRest=t.fillEmptyMeasuresWithWholeRest),void 0!==t.followCursor&&(this.FollowCursor=t.followCursor),void 0!==t.setWantedStemDirectionByXml&&(this.rules.SetWantedStemDirectionByXml=t.setWantedStemDirectionByXml),t.darkMode?(this.rules.applyDefaultColorMusic("#FFFFFF"),this.rules.PageBackgroundColor="#000000"):!1===t.darkMode&&(this.rules.applyDefaultColorMusic("#000000"),this.rules.PageBackgroundColor=void 0),t.defaultColorMusic&&this.rules.applyDefaultColorMusic(t.defaultColorMusic),t.defaultColorNotehead&&(this.rules.DefaultColorNotehead=t.defaultColorNotehead),t.defaultColorRest&&(this.rules.DefaultColorRest=t.defaultColorRest),t.defaultColorStem&&(this.rules.DefaultColorStem=t.defaultColorStem),t.defaultColorLabel&&(this.rules.DefaultColorLabel=t.defaultColorLabel),t.defaultColorTitle&&(this.rules.DefaultColorTitle=t.defaultColorTitle),t.defaultFontFamily&&(this.rules.DefaultFontFamily=t.defaultFontFamily),t.defaultFontStyle&&(this.rules.DefaultFontStyle=t.defaultFontStyle),t.drawUpToMeasureNumber&&(this.rules.MaxMeasureToDrawIndex=t.drawUpToMeasureNumber-1),t.drawFromMeasureNumber&&(this.rules.MinMeasureToDrawIndex=t.drawFromMeasureNumber-1),t.drawUpToPageNumber&&(this.rules.MaxPageToDrawNumber=t.drawUpToPageNumber),t.drawUpToSystemNumber&&(this.rules.MaxSystemToDrawNumber=t.drawUpToSystemNumber),t.tupletsRatioed&&(this.rules.TupletsRatioed=!0),t.tupletsBracketed&&(this.rules.TupletsBracketed=!0),t.tripletsBracketed&&(this.rules.TripletsBracketed=!0),t.autoResize?(this.resizeHandlerAttached||this.autoResize(),this.autoResizeEnabled=!0):!1===t.autoResize&&(this.autoResizeEnabled=!1),void 0!==t.pageFormat&&this.setPageFormat(t.pageFormat),void 0!==t.pageBackgroundColor&&(this.rules.PageBackgroundColor=t.pageBackgroundColor),void 0!==t.performanceMode&&(this.rules.PerformanceMode=t.performanceMode),void 0!==t.renderSingleHorizontalStaffline&&(this.rules.RenderSingleHorizontalStaffline=t.renderSingleHorizontalStaffline),void 0!==t.spacingFactorSoftmax&&(this.rules.SoftmaxFactorVexFlow=t.spacingFactorSoftmax),void 0!==t.spacingBetweenTextLines&&(this.rules.SpacingBetweenTextLines=t.spacingBetweenTextLines),void 0!==t.stretchLastSystemLine&&(this.rules.StretchLastSystemLine=t.stretchLastSystemLine),void 0!==t.autoGenerateMutipleRestMeasuresFromRestMeasures&&(this.rules.AutoGenerateMutipleRestMeasuresFromRestMeasures=t.autoGenerateMutipleRestMeasuresFromRestMeasures),void 0!==t.cursorsOptions?this.cursorsOptions=t.cursorsOptions:this.cursorsOptions=[{type:0,color:this.EngravingRules.DefaultColorCursor,alpha:.5,follow:!0}]}setColoringMode(t){if(t.coloringMode===g.ColoringModes.XML)return void(this.rules.ColoringMode=g.ColoringModes.XML);const e=[x.NoteEnum.C,x.NoteEnum.D,x.NoteEnum.E,x.NoteEnum.F,x.NoteEnum.G,x.NoteEnum.A,x.NoteEnum.B,-1];let i;if(t.coloringMode===g.ColoringModes.CustomColorSet){if(!t.coloringSetCustom||8!==t.coloringSetCustom.length)throw new Error("Invalid amount of colors: With coloringModes.customColorSet, you have to provide a coloringSetCustom parameter with 8 strings (C to B, rest note).");for(const e of t.coloringSetCustom)if(!/^\#[0-9a-fA-F]{6}$/.test(e))throw new Error("One of the color strings in options.coloringSetCustom was not a valid HTML Hex color:\n"+e);i=t.coloringSetCustom}else if(t.coloringMode===g.ColoringModes.AutoColoring){i=[];const t=Object.keys(_.AutoColorSet);for(let e=0;e{t.hide()})),this.sheet=void 0,this.graphic=void 0,this.zoom=1}autoResize(){const t=this;this.handleResize((()=>{}),(()=>{var e;(null===(e=this.graphic)||void 0===e?void 0:e.GetCalculator)instanceof r.VexFlowMusicSheetCalculator&&(this.graphic.GetCalculator.beamsNeedUpdate=!0),t.IsReadyToRender()&&t.render()}))}handleResize(t,e){let i,n;const s=this;function r(){s.AutoResizeEnabled&&(i=(new Date).getTime(),n||(t(),i=(new Date).getTime(),n=window.setTimeout(o,200)))}function o(){n=void 0,window.clearTimeout(n),(new Date).getTime()-i<200?n=window.setTimeout(o,200):e()}window.attachEvent?window.attachEvent("onresize",r):window.addEventListener("resize",r),this.disposeResizeListener=()=>{window.detachEvent?window.detachEvent("onresize",r):window.removeEventListener("resize",r),this.resizeHandlerAttached=!1},this.resizeHandlerAttached=!0,window.setTimeout(t,0),window.setTimeout(e,1)}enableOrDisableCursors(t){var e,i,n,s,r,o;if(this.drawingParameters.drawCursors=t,t){for(let t=0;t{t.hide()}))}createBackend(t,e){let i;return i=void 0===t||t===b.BackendType.SVG?new u.SvgVexFlowBackend(this.rules):new c.CanvasVexFlowBackend(this.rules),i.graphicalMusicPage=e,i.initialize(this.container,this.zoom),i.getContext().setFillStyle(this.rules.DefaultColorMusic),i.getContext().setStrokeStyle(this.rules.DefaultColorMusic),i}static StringToPageFormat(t){let e=y.PageFormat.UndefinedPageFormat;if(t.match("^[0-9]+x[0-9]+$")){const i=t.split("x"),n=Number.parseInt(i[0],10),s=Number.parseInt(i[1],10);n>0&&n<32768&&s>0&&s<32768&&(e=new y.PageFormat(n,s,`customPageFormat${t}`))}return t=(t=(t=t.replace(" ","_")).replace("Landscape","L")).replace("Portrait","P"),T.PageFormatStandards.hasOwnProperty(t)?(e=T.PageFormatStandards[t],e):e}setPageFormat(t){const e=T.StringToPageFormat(t);this.needBackendUpdate=!e.Equals(this.rules.PageFormat),this.rules.PageFormat=e}setCustomPageFormat(t,e){if(t>0&&e>0){const i=new y.PageFormat(t,e);this.rules.PageFormat=i}}set DrawSkyLine(t){this.drawSkyLine=t,this.drawer&&(this.drawer.skyLineVisible=t)}get DrawSkyLine(){return this.drawer.skyLineVisible}set DrawBottomLine(t){this.drawBottomLine=t,this.drawer&&(this.drawer.bottomLineVisible=t)}get DrawBottomLine(){return this.drawer.bottomLineVisible}set DrawBoundingBox(t){this.setDrawBoundingBox(t,!0)}get DrawBoundingBox(){return this.drawBoundingBox}setDrawBoundingBox(t,e=!1){this.drawBoundingBox=t,this.drawer&&(this.drawer.drawableBoundingBoxElement=t),e&&this.render()}get AutoResizeEnabled(){return this.autoResizeEnabled}set AutoResizeEnabled(t){this.autoResizeEnabled=t}get Zoom(){return this.zoom}set Zoom(t){var e;this.zoom=t,this.zoomUpdated=!0,(null===(e=this.graphic)||void 0===e?void 0:e.GetCalculator)instanceof r.VexFlowMusicSheetCalculator&&(this.graphic.GetCalculator.beamsNeedUpdate=this.zoomUpdated)}set FollowCursor(t){this.followCursor=t}get FollowCursor(){return this.followCursor}set TransposeCalculator(t){l.MusicSheetCalculator.transposeCalculator=t}get TransposeCalculator(){return l.MusicSheetCalculator.transposeCalculator}get Sheet(){return this.sheet}get Drawer(){return this.drawer}get GraphicSheet(){return this.graphic}get DrawingParameters(){return this.drawingParameters}get EngravingRules(){return this.rules}get InteractionManager(){return this.interactionManager}get Version(){return this.version}}e.OpenSheetMusicDisplay=T,T.PageFormatStandards={A3_L:new y.PageFormat(420,297,"A3_L"),A3_P:new y.PageFormat(297,420,"A3_P"),A4_L:new y.PageFormat(297,210,"A4_L"),A4_P:new y.PageFormat(210,297,"A4_P"),A5_L:new y.PageFormat(210,148,"A5_L"),A5_P:new y.PageFormat(148,210,"A5_P"),A6_L:new y.PageFormat(148,105,"A6_L"),A6_P:new y.PageFormat(105,148,"A6_P"),Endless:y.PageFormat.UndefinedPageFormat,Letter_L:new y.PageFormat(279.4,215.9,"Letter_L"),Letter_P:new y.PageFormat(215.9,279.4,"Letter_P")}},2861:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(3495),e),s(i(530),e),s(i(41),e),s(i(9629),e)},419:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&n(e,t,i);return s(e,t),e},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.BasicAudioPlayer=void 0;const a=i(3607),l=i(807),h=r(i(8346)),u=o(i(722)),c=o(i(1991));function d(t,e,i){return"https://ks3-cn-beijing.ksyuncs.com/daya/sound_source_1/"+t+"-"+(i="ogg"===i?i:"mp3")+".js"}e.BasicAudioPlayer=class{constructor(t){this.ac=new l.AudioContext,this.channelVolumes=[],this.memoryLoadedSoundFonts=new Map,this.channelToSoundFont=new Map,this.SoundfontInstrumentOptions={only:[],nameToUrl:d},this.instruments=t.sheet.instruments}async open(t,e=16){void 0===this.piano&&(this.piano=await h.instrument(this.ac,u.default[a.MidiInstrument.Acoustic_Grand_Piano].toLowerCase(),Object.assign(Object.assign({},this.SoundfontInstrumentOptions),{only:void 0})));for(let t=0;t=128)return;const s=Math.min(1,this.channelVolumes[t]*i);this.memoryLoadedSoundFonts.get(this.channelToSoundFont.get(t)).schedule(0,[{note:e,duration:n/1e3,gain:s}])}stopSound(t,e){}getUsedSoundFonts(t,e){const i=new Set;for(const e of t.voices)for(const t of e.voiceEntries)for(const e of t.notes)e.halfTone>0&&i.add(c.default[e.halfTone+12]);return Array.from(i)}async setSound(t,e){return console.log(this.getUsedSoundFonts(this.instruments[t],t)),this.SoundfontInstrumentOptions.only=this.getUsedSoundFonts(this.instruments[t],t),void 0===this.memoryLoadedSoundFonts.get(e)&&await this.loadSoundFont(e),this.channelToSoundFont.set(t,e),Promise.resolve()}async loadSoundFont(t){if(void 0!==this.memoryLoadedSoundFonts.get(t))return this.memoryLoadedSoundFonts.get(t);const e=await h.instrument(this.ac,u.default[t].toLowerCase(),this.SoundfontInstrumentOptions);return this.memoryLoadedSoundFonts.set(t,Object.assign({},e)),e}setVolume(t,e){this.channelVolumes[t]=e}setSoundFontFilePath(t,e){}playbackHasStopped(){}getMemoryLoadedSoundFonts(){return[...this.memoryLoadedSoundFonts.values()]}}},3575:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MetronomeInstrument=void 0,e.MetronomeInstrument=class{constructor(t,e,i,n,s,r){this.id=t,this.name=e,this.visible=i,this.audible=n,this.Volume=s,this.MidiInstrumentId=r}get PreCountVolume(){return this.preCountVolume>=0?this.preCountVolume:this.Volume}set PreCountVolume(t){this.preCountVolume=t}get Audible(){return this.audible}set Audible(t){this.audible=t}get Visible(){return this.visible}set Visible(t){this.visible=t}get Mute(){return!this.Audible}set Mute(t){this.Audible=!t}get Name(){return this.name}setVoiceAudible(t,e){throw new Error("Method not implemented.")}setStaffAudible(t,e){throw new Error("Method not implemented.")}setVoiceFollowing(t,e){throw new Error("Method not implemented.")}setStaffFollow(t,e){throw new Error("Method not implemented.")}setVoicePitchMonitor(t,e){throw new Error("Method not implemented.")}setStaffPitchMonitor(t,e){throw new Error("Method not implemented.")}setInstrumentParameter(t,e){throw new Error("Method not implemented.")}get Id(){return this.id}}},936:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.PlaybackManager=e.ChannelNote=void 0;const s=i(9822),r=i(1649),o=i(6550),a=i(8918),l=i(3575),h=i(8151),u=i(9986),c=i(4761),d=i(8084),p=n(i(2043)),f=i(2406),m=[];class g{constructor(t,e,i=void 0){this.note=i,this.key=t,this.channel=e}}e.ChannelNote=g,e.PlaybackManager=class{constructor(t,e,i,n){this.listeners=[],this.percussionChannel=9,this.instrumentToStaffToMidiChannelDict=new r.Dictionary,this.instrumentIdMapping=new r.Dictionary,this.freeMidiChannels=[],this.notesToStop=new r.Dictionary,this.metronomeNote=new g(88,this.percussionChannel),this.metronomeNoteFirstBeat=new g(64,this.percussionChannel),this.currentMeasure=void 0,this.currentTimestamp=void 0,this.closestNextTimestamp=void 0,this.currentMetronomeBaseTimestamp=void 0,this.currentBeatDuration=void 0,this.currentIteratorSourceTimeStamp=void 0,this.beatCounter=0,this.runningState=f.PlaybackState.Stopped,this.isRunning=!1,this.isInitialized=!1,this.isPlaying=!1,this.metronomeSoundPlayed=!1,this.tempoImpactFactor=1,this.defaultVolume=.8,this.currentVolume=this.defaultVolume,this.dynamicImpactFactor=.6,this.scorePositionChangedData=new h.CursorPosChangedData,this.tooManyInstruments=!1,this.metronomeOnlyBPM=100,this.highlightPlayedNotes=!1,this.MoveCursorDuringPrecount=!0,this.doPreCount=!0,this.SoloAttenuationValue=0;const s=u.TextTranslation.translateText("Playback/LabelMetronome","Metronome");this.metronome=new l.MetronomeInstrument(-1,s,!1,!0,0,o.MidiInstrument.Percussion),this.timingSource=t,this.audioMetronomePlayer=e,this.audioPlayer=i,this.messageViewer=n}addListener(t){this.listeners.push(t)}get CursorIterator(){return this.cursorIterator}get InstrumentIdMapping(){return this.instrumentIdMapping}get RunningState(){return this.runningState}set RunningState(t){this.runningState=t}get DoPreCount(){return this.doPreCount}set DoPreCount(t){this.doPreCount!==t&&(this.doPreCount=t)}get Metronome(){return this.metronome}get MetronomeOnlyBPM(){return this.metronomeOnlyBPM}set MetronomeOnlyBPM(t){this.metronomeOnlyBPM=t}get OriginalBpm(){return this.currentReferenceBPM}playVoiceEntry(t){const e=t;if(void 0!==e){if(this.stopAllCurrentlyPlayingNotes(),this.highlightPlayedNotes){const t=[];for(const i of e.Notes)i.state=c.NoteState.Selected,t.push(i)}const t=this.instrumentToStaffToMidiChannelDict.getValue(e.Notes[0].ParentStaff),i=e.ParentVoice.Parent,n=i.MidiInstrumentId===o.MidiInstrument.Percussion,s=.8,r=[],a=this.musicPartManager.MusicSheet.Transpose,l=e.ParentVoice.Parent.PlaybackTranspose;for(const o of e.MainPlaybackEntry.Notes.filter((t=>0!==t.MidiKey))){let e=o.MidiKey;if(n||(e+=l+a),void 0!==o.ParentNote.PlaybackInstrumentId){const t=i.getSubInstrument(o.ParentNote.PlaybackInstrumentId);void 0!==t&&t.fixedKey>=0&&(e=t.fixedKey)}try{void 0!==this.audioPlayer&&this.audioPlayer.playSound(t,e,s,500)}catch(t){p.default.info("PlaybackManager.playVoiceEntry: ",t)}r.push(new g(e,t,o))}}}initialize(t){if(this.isInitialized&&(this.stopAllCurrentlyPlayingNotes(),void 0!==this.audioPlayer&&this.audioPlayer.close(),this.cursorIterator=void 0,this.playbackIterator=void 0),this.isInitialized=!1,this.musicPartManager=t,void 0!==this.musicPartManager){const t=this.musicPartManager.MusicSheet;if(this.cursorIterator=this.musicPartManager.getIterator(),this.playbackIterator=new s.PlaybackIterator(t),void 0!==this.audioPlayer){const e=Array.from(new Set(t.Instruments.map((t=>t.MidiInstrumentId))));this.audioPlayer.open(e,16),this.audioPlayer.setSound(this.percussionChannel,115)}this.currentReferenceBPM=this.sheetStartBPM=t.getExpressionsStartTempoInBPM(),this.tempoUserFactor=t.userStartTempoInBPM/this.sheetStartBPM;let e=0;this.tooManyInstruments=!1,this.instrumentToStaffToMidiChannelDict.clear(),this.instrumentIdMapping.clear();for(let t=0;to.MidiInstrument.Percussion)return!1;try{const n=e===o.MidiInstrument.Percussion;if(-1===t)void 0===this.audioPlayer||n||this.audioPlayer.setSound(0,e);else{let s=!1;const r=this.musicPartManager.MusicSheet;let o;o=-2===t?r.Instruments.find((e=>e.Id===t)):r.Instruments[t],this.instrumentIdMapping.setValue(o.Id,o);for(const t of o.Staves){let r=this.instrumentToStaffToMidiChannelDict.getValue(t);const o=r===this.percussionChannel;if(n){const t=r;r=this.percussionChannel,t>0&&!o&&(this.freeMidiChannels.push(t),this.freeMidiChannels.sort(((t,e)=>t-e)))}else(r<0||o)&&(this.freeMidiChannels.length>0?(r=this.freeMidiChannels[0],this.freeMidiChannels.shift()):(this.tooManyInstruments=!0,r=15,this.instrumentToStaffToMidiChannelDict.setValue(t,r),s=!0));if(!(this.instrumentToStaffToMidiChannelDict.setValue(t,r),void 0===this.audioPlayer||n||[].includes(e)||m.includes(e))){m.push(e),await this.audioPlayer.setSound(r,e);for(const t of this.listeners)null===(i=t.setSound)||void 0===i||i.call(t,r,e)}}if(s)return!1}return!0}catch(t){return p.default.info("PlaybackManager.setSound: ",t),!1}}setBpm(t){this.tempoUserFactor=t/this.sheetStartBPM,this.setTempo()}handlePlaybackEvent(){var t,e;const i=this.resetRequested;this.resetRequested=!1;let n=i,s=!1;if(i){const t=this.DoPreCount;this.doReset(t)}if(void 0!==this.musicPartManager){if(this.currentTimestamp=this.timingSource.getCurrentTimestamp(),s=this.cursorIterator.EndReached,this.stopFinishedNotes(),this.processTempoInstructions(),this.RunningState===f.PlaybackState.Running){const i=this.currentTimestamp.gte(this.cursorIterator.CurrentEnrolledTimestamp)&&!s;if(i){if(this.isPreCounting=!1,this.currentMeasure!==this.cursorIterator.CurrentMeasure&&void 0!==this.cursorIterator.CurrentMeasure){this.currentMeasure=this.cursorIterator.CurrentMeasure,this.startRhythmBeats=this.cursorIterator.currentPlaybackSettings().Rhythm.Numerator,this.startRhythmDenominator=this.cursorIterator.currentPlaybackSettings().Rhythm.Denominator;const t=this.cursorIterator.CurrentRelativeInMeasureTimestamp;this.currentMetronomeBaseTimestamp=a.Fraction.minus(this.cursorIterator.CurrentEnrolledTimestamp,t),this.currentBeatDuration=new a.Fraction(1,this.currentMeasure.Duration.Denominator);const e=this.currentMeasure.TempoInBPM;e!==this.currentBPM&&this.bpmChanged(e);const i=new a.Fraction;for(this.beatCounter=0;i.lt(t);)i.Add(this.currentBeatDuration),this.beatCounter++;this.playNextMetronomeAt=a.Fraction.plus(this.currentMetronomeBaseTimestamp,new a.Fraction(this.beatCounter,this.currentMeasure.Duration.Denominator))}const t=this.cursorIterator.getCurrentDynamicChangingExpressions();for(const e of t){const t=this.musicPartManager.MusicSheet.getStaffFromIndex(e.staffNumber),i=this.instrumentToStaffToMidiChannelDict.getValue(t);let n=this.currentVolume;if(void 0!==e.parMultiExpression().StartingContinuousDynamic){const t=e.parMultiExpression().StartingContinuousDynamic.getInterpolatedDynamic(this.cursorIterator.CurrentSourceTimestamp);t>=0&&(n=this.calculateFinalVolume(t))}else n=this.calculateFinalVolume(e.parMultiExpression().InstantaneousDynamic.Volume);try{void 0!==this.audioPlayer&&this.audioPlayer.setVolume(i,n)}catch(t){p.default.info("PlaybackManager.handlePlaybackEvent: ",t)}}t.clear()}const r=this.playbackIterator.Update(this.currentTimestamp);if(r.length>0&&this.DoPlayback){const i=[];for(const n of r){const s=n.playbackEntry,r=s.ParentVoiceEntry;if(0===s.Notes.length)continue;const l=r.ParentVoice.Parent,h=r.Notes[0].ParentStaff,u=c.MusicSheet.getIndexFromStaff(h);let f=this.instrumentToStaffToMidiChannelDict.getValue(h);const m=l.MidiInstrumentId===o.MidiInstrument.Percussion;m&&(f=this.percussionChannel);const b=this.cursorIterator.ActiveDynamicExpressions[u];if(b instanceof d.ContinuousDynamicExpression){const t=b.getInterpolatedDynamic(this.cursorIterator.CurrentSourceTimestamp);if(t>=0){const e=this.calculateFinalVolume(t);try{void 0!==this.audioPlayer&&this.audioPlayer.setVolume(f,e)}catch(t){p.default.info("PlaybackManager.handlePlaybackEvent: ",t)}}}let y=l.Volume*h.Volume*r.ParentVoice.Volume;const S=this.SoloActive&&!(l.Solo||r.ParentVoice.Solo||h.Solo);S&&(y*=this.SoloAttenuationValue);const v=void 0!==r.VolumeModifier;v&&(y*=1.3,y=Math.min(1,y));const _=this.musicPartManager.MusicSheet.Transpose,x=null!==(t=l.PlaybackTranspose)&&void 0!==t?t:0;for(const t of s.Notes.filter((t=>0!==t.MidiKey))){let s=t.MidiKey;if(m||(s+=x+_),void 0!==t.ParentNote.PlaybackInstrumentId){const i=l.getSubInstrument(t.ParentNote.PlaybackInstrumentId);void 0!==i&&i.fixedKey>=0&&(s=i.fixedKey),y=(null!==(e=null==i?void 0:i.volume)&&void 0!==e?e:1)*h.Volume*r.ParentVoice.Volume,S&&(y*=this.SoloAttenuationValue),v&&(y*=1.3,y=Math.min(1,y))}let o,u=a.Fraction.createFromFraction(t.Length);void 0!==r.DurationModifier?(u=new a.Fraction(2*u.Numerator,3*u.Denominator),o=a.Fraction.plus(n.enrolledTimestamp,u)):o=a.Fraction.plus(n.enrolledTimestamp,u);try{void 0!==this.audioPlayer&&this.audioPlayer.playSound(f,s,y,this.timingSource.getDurationInMs(u))}catch(t){p.default.info("PlaybackManager.handlePlaybackEvent. Failed playing sound: ",t)}this.notesToStop.containsKey(o)||this.notesToStop.setValue(o,[]),this.notesToStop.getValue(o).push(new g(s,f,t)),this.highlightPlayedNotes&&(t.ParentNote.state=c.NoteState.Selected),i.push(t)}}this.NotesPlaybackEventOccurred(i)}if(i&&(this.currentIteratorSourceTimeStamp=this.cursorIterator.CurrentSourceTimestamp,this.currentMeasureIndex=this.cursorIterator.CurrentMeasureIndex,this.cursorIterator.moveToNext(),this.nextIteratorTimestamp=this.cursorIterator.CurrentEnrolledTimestamp,n=!0),this.stopMetronomeSound(),s&&this.currentTimestamp.gte(this.cursorIterator.CurrentEnrolledTimestamp)){for(const t of this.listeners)null==t||t.selectionEndReached(void 0);this.handleEndReached()}else{if(this.currentTimestamp.gte(this.playNextMetronomeAt)){n=!0;const t=this.beatCounter%this.startRhythmBeats==0;this.playMetronomeSound(t),this.beatCounter++}void 0!==this.currentMetronomeBaseTimestamp&&(this.playNextMetronomeAt=a.Fraction.plus(this.currentMetronomeBaseTimestamp,new a.Fraction(this.beatCounter,this.startRhythmDenominator))),this.calculateClosestNextTimestamp()}}else this.isPlaying=!1;(n||s&&!this.loopTriggeredReset)&&this.updateScoreCursorPosition(i)}}NotesPlaybackEventOccurred(t){for(const e of this.listeners)null==e||e.notesPlaybackEventOccurred(t)}calculateFinalVolume(t){return(t-this.defaultVolume)*this.dynamicImpactFactor+this.defaultVolume}loop(){try{if(this.isRunning=!0,this.isPlaying)try{if(this.isRunning&&this.isInitialized&&(this.handlePlaybackEvent(),void 0!==this.closestNextTimestamp)){const t=this.timingSource.getWaitingTimeForTimestampInMs(this.closestNextTimestamp);window.setTimeout((()=>{this.loop()}),Math.max(0,t))}}catch(t){this.pause(),this.reset();const e=u.TextTranslation.translateText("MidiPlaybackError","An error occurred at the Midi Playback.");p.default.info("PlaybackManager.loop: "+e+" ",t),void 0!==this.messageViewer&&void 0!==this.messageViewer.MessageOccurred&&this.messageViewer.MessageOccurred(f.MessageBoxType.Error,e)}}catch(t){const e=u.TextTranslation.translateText("MidiPlaybackLoopError","An error occurred at the Midi Playback. Please restart the program in order for the Playback to be availiable again.");p.default.info("PlaybackManager.loop: "+e+" ",t),void 0!==this.messageViewer&&void 0!==this.messageViewer.MessageOccurred&&this.messageViewer.MessageOccurred(f.MessageBoxType.Error,e)}this.isRunning=!1}stopAllCurrentlyPlayingNotes(){try{if(void 0!==this.audioPlayer){this.audioPlayer.stopSound(this.metronomeNoteFirstBeat.channel,this.metronomeNoteFirstBeat.key),this.audioPlayer.stopSound(this.metronomeNote.channel,this.metronomeNote.key);for(const t of this.notesToStop.values())for(const e of t)this.audioPlayer.stopSound(e.channel,e.key)}const t=[];for(const e of this.notesToStop.values())for(const i of e)i.note.ParentNote.state=c.NoteState.Normal,t.push(i.note.ParentNote);this.highlightPlayedNotes,this.notesToStop.clear()}catch(t){p.default.info("PlaybackManager.stoppAllCurrentlyPlayingNotes: ",t)}}doReset(t,e=1){if(this.nextIteratorTimestamp=void 0,this.playNextMetronomeAt=void 0,this.closestNextTimestamp=void 0,this.currentMeasure=void 0,this.beatCounter=0,this.fermataActive=!1,this.stopAllCurrentlyPlayingNotes(),void 0!==this.musicPartManager&&(this.cursorIterator=this.musicPartManager.getIterator()),void 0===this.cursorIterator)return;this.playbackIterator.Reset(),this.currentIteratorSourceTimeStamp=this.cursorIterator.CurrentSourceTimestamp,this.nextIteratorTimestamp=this.cursorIterator.CurrentEnrolledTimestamp,this.currentMeasure=this.cursorIterator.CurrentMeasure,this.currentMeasureIndex=this.cursorIterator.CurrentMeasureIndex,this.startRhythmBeats=this.cursorIterator.currentPlaybackSettings().Rhythm.Numerator,this.startRhythmDenominator=this.cursorIterator.currentPlaybackSettings().Rhythm.Denominator;let i=new a.Fraction;if(t){this.isPreCounting=!0;const t=new a.Fraction(this.startRhythmBeats*e,this.startRhythmDenominator),n=this.musicPartManager.MusicSheet.SourceMeasures[this.currentMeasureIndex].Duration,s=new a.Fraction(n.Numerator*e,n.Denominator),r=a.Fraction.plus(this.musicPartManager.MusicSheet.SourceMeasures[this.currentMeasureIndex].AbsoluteTimestamp,s).Sub(this.currentIteratorSourceTimeStamp);if(i=t,t.gte(r)){const e=a.Fraction.minus(t,r);e.RealValue/t.RealValue<.5?i.Add(e):i=e}}this.currentMetronomeBaseTimestamp=this.playNextMetronomeAt=a.Fraction.minus(this.cursorIterator.CurrentEnrolledTimestamp,i),this.timingSource.setTimeAndBpm(this.currentMetronomeBaseTimestamp,this.cursorIterator.currentPlaybackSettings().BeatsPerMinute),this.calculateClosestNextTimestamp()}calculateClosestNextTimestamp(){const t=[];this.notesToStop.size()>0&&t.push(this.notesToStop.keys().reduce(((t,e)=>t.lt(e)?t:e))),void 0!==this.playbackIterator.NextEntryTimestamp&&t.push(this.playbackIterator.NextEntryTimestamp),void 0!==this.nextIteratorTimestamp&&t.push(this.nextIteratorTimestamp),void 0!==this.playNextMetronomeAt&&t.push(this.playNextMetronomeAt),t.length>0?this.closestNextTimestamp=t.reduce(((t,e)=>t.lt(e)?t:e)):this.closestNextTimestamp=void 0}handleEndReached(){this.pause()}updateScoreCursorPosition(t){if(!this.isPreCounting||this.MoveCursorDuringPrecount){this.scorePositionChangedData.CurrentMeasureIndex=this.currentMeasureIndex,this.scorePositionChangedData.CurrentRepetition=this.currentRepetition,this.scorePositionChangedData.PredictedPosition=this.currentTimestamp,this.scorePositionChangedData.CurrentBpm=this.musicPartManager.MusicSheet.SheetPlaybackSetting.BeatsPerMinute,this.scorePositionChangedData.ResetOccurred=t;for(const t of this.listeners)null==t||t.cursorPositionChanged(this.currentIteratorSourceTimeStamp,this.scorePositionChangedData)}}stopMetronomeSound(){this.metronomeSoundPlayed&&(void 0!==this.audioPlayer&&(this.audioPlayer.stopSound(this.metronomeNoteFirstBeat.channel,this.metronomeNoteFirstBeat.key),this.audioPlayer.stopSound(this.metronomeNote.channel,this.metronomeNote.key)),this.metronomeSoundPlayed=!1)}playMetronomeSound(t){if(this.metronome.Audible||this.metronome.Solo||this.isPreCounting){let e=this.isPreCounting?this.metronome.PreCountVolume:this.metronome.Volume;if(this.isPreCounting||!this.SoloActive||this.metronome.Solo||(e*=this.SoloAttenuationValue),e>0){if(t)try{void 0!==this.audioPlayer&&this.audioPlayer.playSound(this.metronomeNoteFirstBeat.channel,this.metronomeNoteFirstBeat.key,e,1e3),void 0!==this.audioMetronomePlayer&&this.audioMetronomePlayer.playFirstBeatSample(e)}catch(t){p.default.info("PlaybackManager.playMetronomeSound: ",t)}else try{void 0!==this.audioPlayer&&this.audioPlayer.playSound(this.metronomeNote.channel,this.metronomeNote.key,e,1e3),void 0!==this.audioMetronomePlayer&&this.audioMetronomePlayer.playBeatSample(e)}catch(t){p.default.info("PlaybackManager.playMetronomeSound: ",t)}this.metronomeSoundPlayed=!0}}}stopFinishedNotes(){let t;t=void 0!==this.currentTimestamp?this.notesToStop.keys().filter((t=>t.lte(this.currentTimestamp))):this.notesToStop.keys();for(const e of t){const t=this.notesToStop.getValue(e);if(void 0!==this.audioPlayer)for(const e of t)this.audioPlayer.stopSound(e.channel,e.key);const i=[];for(const e of t)e.note.ParentNote.state=c.NoteState.Normal,i.push(e.note.ParentNote);this.highlightPlayedNotes,this.notesToStop.remove(e)}}processTempoInstructions(){Math.abs(this.currentReferenceBPM-this.cursorIterator.CurrentBpm)>.001&&this.changeTempo(this.cursorIterator.CurrentBpm),this.handleFermata()}handleFermata(){let t=!1;if(!this.cursorIterator.EndReached&&this.currentTimestamp.gte(this.cursorIterator.CurrentEnrolledTimestamp))for(const e of this.cursorIterator.CurrentVoiceEntries)t=void 0!==e.Fermata;t?this.fermataActive||(this.fermataActive=!0,this.changeTempo(this.cursorIterator.CurrentBpm/3)):this.fermataActive&&(this.fermataActive=!1,this.changeTempo(this.cursorIterator.CurrentBpm))}bpmChanged(t){this.currentBPM=t,this.timingSource.setBpm(t)}volumeChanged(t,e){this.currentVolume=e/100,-1===t?this.metronome.Volume=this.currentVolume:this.instrumentIdMapping.getValue(t).Volume=this.currentVolume}volumeMute(t){-1===t?this.metronome.Mute=!0:this.instrumentIdMapping.getValue(t).Audible=!1}volumeUnmute(t){-1===t?this.metronome.Mute=!1:this.instrumentIdMapping.getValue(t).Audible=!0}changeTempo(t){p.default.debug("PlaybackManager.changeTempo",`current tempo in BPM: ${t}`),t>0&&(this.currentReferenceBPM=t,this.setTempo())}setTempo(){this.currentBPM=this.tempoUserFactor*this.getCurrentReferenceBPM(),this.timingSource.setBpm(this.currentBPM)}getCurrentReferenceBPM(){return(this.currentReferenceBPM-this.sheetStartBPM)*this.tempoImpactFactor+this.sheetStartBPM}checkForSoloDeactivated(){if(void 0===this.musicPartManager.MusicSheet)return void(this.SoloActive=!1);let t=!1;for(const e of this.musicPartManager.MusicSheet.Instruments){for(const i of e.Staves)t=t||i.Solo;for(const i of e.Voices)t=t||i.Solo}t=t||this.Metronome.Solo,t||(this.SoloActive=!1)}getSheetDurationInMs(){return this.timingSource.getDurationInMs(this.musicPartManager.MusicSheet.SheetEndTimestamp)}}},2011:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractTimingSource=void 0;const n=i(8918);e.AbstractTimingSource=class{constructor(){this.anchorTimestamp=new n.Fraction}setBpm(t){this.anchorTimestamp=n.Fraction.createFromFraction(this.getCurrentTimestamp()),void 0!==this.Settings&&(this.Settings.BeatsPerMinute=t),this.reset()}setTimeAndBpm(t,e){this.anchorTimestamp=n.Fraction.createFromFraction(t),void 0!==this.Settings&&e&&(this.Settings.BeatsPerMinute=e),this.reset()}getCurrentTimestamp(){const t=this.getCurrentTimeInMs(),e=this.getDuration(t);return n.Fraction.plus(e,this.anchorTimestamp)}getWaitingTimeForTimestampInMs(t){const e=this.getCurrentTimestamp(),i=n.Fraction.minus(t,e);return this.getDurationInMs(i)}getDurationInMs(t){return Math.round(this.Settings.getDurationInMilliseconds(t))}getDuration(t){return void 0===this.Settings?new n.Fraction:this.Settings.getDurationAsNoteDuration(t)}getCurrentTimeInMs(){throw new Error("not implemented")}getTimestampForTimeInMs(t){throw new Error("not implemented")}start(){throw new Error("not implemented")}pause(){throw new Error("not implemented")}reset(){throw new Error("not implemented")}getCurrentAudioDelayRevisedTimestamp(){throw new Error("not implemented")}}},5141:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LinearTimingSource=void 0;const n=i(2011),s=i(807),r=i(8918);class o extends n.AbstractTimingSource{constructor(){super(),this.audioContext=new s.AudioContext,this.audioInputDelay=320,this.lastResetTime=0,this.audioContext.suspend(),this.lastResetTime=this.audioContext.currentTime}getCurrentTimeInMs(){return 1e3*(this.audioContext.currentTime-this.lastResetTime)}getCurrentAudioDelayRevisedTimestamp(){return r.Fraction.plus(this.getDuration(this.getCurrentTimeInMs()-this.audioInputDelay),this.anchorTimestamp)}getTimestampForTimeInMs(t){const e=this.getCurrentTimeInMs()-t,i=this.getCurrentTimestamp(),n=this.Settings.getDurationAsNoteDuration(e);return r.Fraction.minus(i,n)}start(){return console.log("Start linear timing source"),this.audioContext.resume()}pause(){return console.log("Pause linear timing source"),this.audioContext.suspend()}reset(){console.log("Reset linear timing source"),this.lastResetTime=this.audioContext.currentTime,this.audioContext.close()}}e.LinearTimingSource=o},8731:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ControlPanel=void 0;const n=i(7181),s=i(5088),r=i(7474),o=i(1649);class a extends n.AUIController{constructor(){super(...arguments),this.bpmValue=80,this.volumeSliders=new o.Dictionary,this.volumeSliderElements=new o.Dictionary}volumeMute(t){throw new Error("Method not implemented.")}volumeUnmute(t){throw new Error("Method not implemented.")}bpmChanged(t){this.bpmValue=t,this.bpmSlider&&(this.bpmSlider.value=this.bpmValue)}volumeChanged(t,e){throw new Error("Method not implemented.")}play(){throw new Error("Method not implemented.")}pause(){throw new Error("Method not implemented.")}reset(){throw new Error("Method not implemented.")}get IsClosed(){return this.controlPanelElement.classList.contains("hide")}clearVolumeTracks(){for(const t of this.volumeSliders.values())t.destroy();this.volumeSliders.clear();for(const t of this.volumeSliderElements.values())t.parentElement.remove();this.volumeSliderElements.clear()}addVolumeTrack(t,e,i=80){const n=this.generateHtmlTemplate("",{name:t,id:e.toString()});this.volumeToolbarElement.insertAdjacentHTML("beforeend",n);const o=this.volumeToolbarElement.lastChild,a=o.getElementsByClassName("volume-slider")[0],l=o.getElementsByClassName("mute-button")[0],h=new r.MDCIconButtonToggle(l);h.initialize(),this.volumeSliderElements.setValue(e,a);const u=new s.MDCSlider(a);u.value=i,u.initialize();const c=this;h.listen("MDCIconButtonToggle:change",(function(t){t.preventDefault();for(const i of c.eventListeners)t.detail.isOn?i.volumeMute(e):(i.volumeUnmute(e),l.classList.remove("mdc-ripple-upgraded--background-focused"))})),h.on=!1,u.listen("MDCSlider:input",(()=>{for(const t of c.eventListeners)t.volumeChanged(e,u.value)})),this.volumeSliders.setValue(e,u)}initialize(){}hideAndClear(){this.controlPanelElement.classList.add("hide")}show(){var t;this.controlPanelElement.classList.remove("hide");const e=this;if(this.metronomeToolbarElement.classList.contains("hide"))for(const t of e.volumeSliders.keys()){let i=e.volumeSliders.getValue(t);i.destroy(),i=new s.MDCSlider(e.volumeSliderElements.getValue(t)),i.initialize(),i.listen("MDCSlider:input",(()=>{for(const n of e.eventListeners)n.volumeChanged(t,i.value)}))}else null===(t=this.bpmSlider)||void 0===t||t.destroy(),this.bpmSlider=new s.MDCSlider(this.controlPanelElement.getElementsByClassName("metronome-slider")[0]),this.bpmSlider.initialize(),this.bpmSlider.value=this.bpmValue,this.bpmSlider.listen("MDCSlider:input",(()=>{this.bpmValue=e.bpmSlider.value;for(const t of e.eventListeners)t.bpmChanged(e.bpmSlider.value)}))}}e.ControlPanel=a},293:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(936),e),s(i(419),e),s(i(5141),e),s(i(8731),e)},722:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=["Acoustic_Grand_Piano","Bright_Acoustic_Piano","Electric_Grand_Piano","Honky_tonk_Piano","Electric_Piano_1","Electric_Piano_2","Harpsichord","Clavinet","Celesta","Glockenspiel","Music_Box","Vibraphone","Marimba","Xylophone","Tubular_Bells","Dulcimer","Drawbar_Organ","Percussive_Organ","Rock_Organ","Church_Organ","Reed_Organ","Accordion","Harmonica","Tango_Accordion","Acoustic_Guitar_nylon","Acoustic_Guitar_steel","Electric_Guitar_jazz","Electric_Guitar_clean","Electric_Guitar_muted","Overdriven_Guitar","Distortion_Guitar","Guitar_harmonics","Acoustic_Bass","Electric_Bass_finger","Electric_Bass_pick","Fretless_Bass","Slap_Bass_1","Slap_Bass_2","Synth_Bass_1","Synth_Bass_2","Violin","Viola","Cello","Contrabass","Tremolo_Strings","Pizzicato_Strings","Orchestral_Harp","Timpani","String_Ensemble_1","String_Ensemble_2","Synth_Strings_1","Synth_Strings_2","Choir_Aahs","Voice_Oohs","Synth_Voice","Orchestra_Hit","Trumpet","Trombone","Tuba","Muted_Trumpet","French_Horn","Brass_Section","Synth_Brass_1","Synth_Brass_2","Soprano_Sax","Alto_Sax","Tenor_Sax","Baritone_Sax","Oboe","English_Horn","Bassoon","Clarinet","Piccolo","Flute","Recorder","Pan_Flute","Blown_Bottle","Shakuhachi","Whistle","Ocarina","Lead_1_square","Lead_2_sawtooth","Lead_3_calliope","Lead_4_chiff","Lead_5_charang","Lead_6_voice","Lead_7_fifths","Lead_8_bass_lead","Pad_1_new_age","Pad_2_warm","Pad_3_polysynth","Pad_4_choir","Pad_5_bowed","Pad_6_metallic","Pad_7_halo","Pad_8_sweep","FX_1_rain","FX_2_soundtrack","FX_3_crystal","FX_4_atmosphere","FX_5_brightness","FX_6_goblins","FX_7_echoes","FX_8_scifi","Sitar","Banjo","Shamisen","Koto","Kalimba","Bagpipe","Fiddle","Shanai","Tinkle_Bell","Agogo","Steel_Drums","Woodblock","Taiko_Drum","Melodic_Tom","Synth_Drum","Reverse_Cymbal","Guitar_Fret_Noise","Breath_Noise","Seashore","Bird_Tweet","Telephone_Ring","Helicopter","Applause","Gunshot","Euphonium","Alto_Clarinet","Bass_Clarinet","Bass_Trombone","clarinet_in_bb","clarinet_in_eb","Percussion"]},1991:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={21:"A0",22:"Bb0",23:"B0",24:"C1",25:"Db1",26:"D1",27:"Eb1",28:"E1",29:"F1",30:"Gb1",31:"G1",32:"Ab1",33:"A1",34:"Bb1",35:"B1",36:"C2",37:"Db2",38:"D2",39:"Eb2",40:"E2",41:"F2",42:"Gb2",43:"G2",44:"Ab2",45:"A2",46:"Bb2",47:"B2",48:"C3",49:"Db3",50:"D3",51:"Eb3",52:"E3",53:"F3",54:"Gb3",55:"G3",56:"Ab3",57:"A3",58:"Bb3",59:"B3",60:"C4",61:"Db4",62:"D4",63:"Eb4",64:"E4",65:"F4",66:"Gb4",67:"G4",68:"Ab4",69:"A4",70:"Bb4",71:"B4",72:"C5",73:"Db5",74:"D5",75:"Eb5",76:"E5",77:"F5",78:"Gb5",79:"G5",80:"Ab5",81:"A5",82:"Bb5",83:"B5",84:"C6",85:"Db6",86:"D6",87:"Eb6",88:"E6",89:"F6",90:"Gb6",91:"G6",92:"Ab6",93:"A6",94:"Bb6",95:"B6",96:"C7",97:"Db7",98:"D7",99:"Eb7",100:"E7",101:"F7",102:"Gb7",103:"G7",104:"Ab7",105:"A7",106:"Bb7",107:"B7",108:"C8"}},8265:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TransposeCalculator=void 0;const n=i(8918);class s{transposePitch(t,e,i){let r=n.NoteEnum.C,o=0,a=n.AccidentalEnum.NONE;const l=n.Pitch.CalculateTransposedHalfTone(t,i);let h=l.halftone,u=l.overflow;for(let e=0;eh)break}for(let i=0;ih){let l=i;const c=n.Pitch.HalfTonesFromAccidental(t.Accidental);for((c>0||0===c&&e.Key>=0)&&l--;l<0;)l+=7,h+=12,u--;for(;l>=7;)l-=7,h-=12,u++;r=s.noteEnums[l],a=n.Pitch.AccidentalFromHalfTones(h-r),o=t.Octave+u;break}return new n.Pitch(r,o,a)}transposeKey(t,e){let i=0,n=0;for(;i=12;)r-=12;for(;r<0;)r+=12;t.Key=s.keyMapping[r],t.isTransposedBy=e}}e.TransposeCalculator=s,s.keyMapping=[0,-5,2,-3,4,-1,6,1,-4,3,-2,5],s.noteEnums=[n.NoteEnum.C,n.NoteEnum.D,n.NoteEnum.E,n.NoteEnum.F,n.NoteEnum.G,n.NoteEnum.A,n.NoteEnum.B]},5742:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(8265),e)},8447:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(5742),e)},2337:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CollectionUtil=void 0,Array.prototype.last||Object.defineProperty(Array.prototype,"last",{enumerable:!1,value:function(){return this[this.length-1]}}),Array.prototype.clear||Object.defineProperty(Array.prototype,"clear",{enumerable:!1,value:function(){this.length=0}}),Array.prototype.contains||Object.defineProperty(Array.prototype,"contains",{enumerable:!1,value:function(t){return-1!==this.indexOf(t)}}),e.CollectionUtil=class{static contains2(t,e){for(let i=0;i{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PSMath=void 0;class i{static log(t,e){return Math.log(e)/Math.log(t)}static log10(t){return i.log(10,t)}static meanSimple(t){let e=0;for(let i=0;i{"use strict";i.d(e,{ZT:()=>s,fl:()=>a,pi:()=>r});var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},n(t,e)};function s(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var r=function(){return r=Object.assign||function(t){for(var e,i=1,n=arguments.length;i0)&&!(n=r.next()).done;)o.push(n.value)}catch(t){s={error:t}}finally{try{n&&!n.done&&(i=r.return)&&i.call(r)}finally{if(s)throw s.error}}return o}function a(){for(var t=[],e=0;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(9205),s=i(278),r=function(){function t(t){this.root=null,this.compare=t||n.defaultCompare,this.nElements=0}return t.prototype.add=function(t){return!n.isUndefined(t)&&null!==this.insertNode(this.createNode(t))&&(this.nElements++,!0)},t.prototype.clear=function(){this.root=null,this.nElements=0},t.prototype.isEmpty=function(){return 0===this.nElements},t.prototype.size=function(){return this.nElements},t.prototype.contains=function(t){return!n.isUndefined(t)&&null!==this.searchNode(this.root,t)},t.prototype.search=function(t){var e=this.searchNode(this.root,t);if(null!==e)return e.element},t.prototype.remove=function(t){var e=this.searchNode(this.root,t);return null!==e&&(this.removeNode(e),this.nElements--,!0)},t.prototype.inorderTraversal=function(t){this.inorderTraversalAux(this.root,t,{stop:!1})},t.prototype.preorderTraversal=function(t){this.preorderTraversalAux(this.root,t,{stop:!1})},t.prototype.postorderTraversal=function(t){this.postorderTraversalAux(this.root,t,{stop:!1})},t.prototype.levelTraversal=function(t){this.levelTraversalAux(this.root,t)},t.prototype.minimum=function(){if(!this.isEmpty()&&null!==this.root)return this.minimumAux(this.root).element},t.prototype.maximum=function(){if(!this.isEmpty()&&null!==this.root)return this.maximumAux(this.root).element},t.prototype.forEach=function(t){this.inorderTraversal(t)},t.prototype.toArray=function(){var t=[];return this.inorderTraversal((function(e){return t.push(e),!0})),t},t.prototype.height=function(){return this.heightAux(this.root)},t.prototype.searchNode=function(t,e){for(var i=1;null!==t&&0!==i;)(i=this.compare(e,t.element))<0?t=t.leftCh:i>0&&(t=t.rightCh);return t},t.prototype.transplant=function(t,e){null===t.parent?this.root=e:t===t.parent.leftCh?t.parent.leftCh=e:t.parent.rightCh=e,null!==e&&(e.parent=t.parent)},t.prototype.removeNode=function(t){if(null===t.leftCh)this.transplant(t,t.rightCh);else if(null===t.rightCh)this.transplant(t,t.leftCh);else{var e=this.minimumAux(t.rightCh);e.parent!==t&&(this.transplant(e,e.rightCh),e.rightCh=t.rightCh,e.rightCh.parent=e),this.transplant(t,e),e.leftCh=t.leftCh,e.leftCh.parent=e}},t.prototype.inorderTraversalAux=function(t,e,i){null===t||i.stop||(this.inorderTraversalAux(t.leftCh,e,i),i.stop||(i.stop=!1===e(t.element),i.stop||this.inorderTraversalAux(t.rightCh,e,i)))},t.prototype.levelTraversalAux=function(t,e){var i=new s.default;for(null!==t&&i.enqueue(t),t=i.dequeue()||null;null!=t;){if(!1===e(t.element))return;null!==t.leftCh&&i.enqueue(t.leftCh),null!==t.rightCh&&i.enqueue(t.rightCh),t=i.dequeue()||null}},t.prototype.preorderTraversalAux=function(t,e,i){null===t||i.stop||(i.stop=!1===e(t.element),i.stop||(this.preorderTraversalAux(t.leftCh,e,i),i.stop||this.preorderTraversalAux(t.rightCh,e,i)))},t.prototype.postorderTraversalAux=function(t,e,i){null===t||i.stop||(this.postorderTraversalAux(t.leftCh,e,i),i.stop||(this.postorderTraversalAux(t.rightCh,e,i),i.stop||(i.stop=!1===e(t.element))))},t.prototype.minimumAux=function(t){for(;null!=t&&null!==t.leftCh;)t=t.leftCh;return t},t.prototype.maximumAux=function(t){for(;null!=t&&null!==t.rightCh;)t=t.rightCh;return t},t.prototype.heightAux=function(t){return null===t?-1:Math.max(this.heightAux(t.leftCh),this.heightAux(t.rightCh))+1},t.prototype.insertNode=function(t){for(var e=null,i=this.root;null!==i;){var n=this.compare(t.element,i.element);if(0===n)return null;n<0?(e=i,i=i.leftCh):(e=i,i=i.rightCh)}return t.parent=e,null===e?this.root=t:this.compare(t.element,e.element)<0?e.leftCh=t:e.rightCh=t,t},t.prototype.createNode=function(t){return{element:t,leftCh:null,rightCh:null,parent:null}},t}();e.default=r},2070:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(9205),s=i(8805),r=i(7818),o=function(){function t(t){this.toStrF=t||n.defaultToString,this.dictionary=new s.default(this.toStrF),this.nElements=0}return t.prototype.add=function(t,e){if(void 0===e&&(e=1),n.isUndefined(t)||e<=0)return!1;if(this.contains(t))this.dictionary.getValue(t).copies+=e;else{var i={value:t,copies:e};this.dictionary.setValue(t,i)}return this.nElements+=e,!0},t.prototype.count=function(t){return this.contains(t)?this.dictionary.getValue(t).copies:0},t.prototype.contains=function(t){return this.dictionary.containsKey(t)},t.prototype.remove=function(t,e){if(void 0===e&&(e=1),n.isUndefined(t)||e<=0)return!1;if(this.contains(t)){var i=this.dictionary.getValue(t);return e>i.copies?this.nElements-=i.copies:this.nElements-=e,i.copies-=e,i.copies<=0&&this.dictionary.remove(t),!0}return!1},t.prototype.toArray=function(){for(var t=[],e=0,i=this.dictionary.values();e{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(9205),s=function(){function t(t){this.table={},this.nElements=0,this.toStr=t||n.defaultToString}return t.prototype.getValue=function(t){var e=this.table["$"+this.toStr(t)];if(!n.isUndefined(e))return e.value},t.prototype.setValue=function(t,e){if(!n.isUndefined(t)&&!n.isUndefined(e)){var i,s="$"+this.toStr(t),r=this.table[s];return n.isUndefined(r)?(this.nElements++,i=void 0):i=r.value,this.table[s]={key:t,value:e},i}},t.prototype.remove=function(t){var e="$"+this.toStr(t),i=this.table[e];if(!n.isUndefined(i))return delete this.table[e],this.nElements--,i.value},t.prototype.keys=function(){var t=[];for(var e in this.table)if(n.has(this.table,e)){var i=this.table[e];t.push(i.key)}return t},t.prototype.values=function(){var t=[];for(var e in this.table)if(n.has(this.table,e)){var i=this.table[e];t.push(i.value)}return t},t.prototype.forEach=function(t){for(var e in this.table)if(n.has(this.table,e)){var i=this.table[e];if(!1===t(i.key,i.value))return}},t.prototype.containsKey=function(t){return!n.isUndefined(this.getValue(t))},t.prototype.clear=function(){this.table={},this.nElements=0},t.prototype.size=function(){return this.nElements},t.prototype.isEmpty=function(){return this.nElements<=0},t.prototype.toString=function(){var t="{";return this.forEach((function(e,i){t+="\n\t"+e+" : "+i})),t+"\n}"},t}();e.default=s},2734:function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(8805),o=i(9205),a=function(t){function e(e,i){var n=t.call(this,i)||this;return n.defaultFactoryFunction=e,n}return s(e,t),e.prototype.setDefault=function(e,i){var n=t.prototype.getValue.call(this,e);return o.isUndefined(n)?(this.setValue(e,i),i):n},e.prototype.getValue=function(t){return this.setDefault(t,this.defaultFactoryFunction())},e}(r.default);e.default=a},2422:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(9205),s=i(1229),r=function(){function t(t){this.data=[],this.compare=t||n.defaultCompare}return t.prototype.leftChildIndex=function(t){return 2*t+1},t.prototype.rightChildIndex=function(t){return 2*t+2},t.prototype.parentIndex=function(t){return Math.floor((t-1)/2)},t.prototype.minIndex=function(t,e){return e>=this.data.length?t>=this.data.length?-1:t:this.compare(this.data[t],this.data[e])<=0?t:e},t.prototype.siftUp=function(t){for(var e=this.parentIndex(t);t>0&&this.compare(this.data[e],this.data[t])>0;)s.swap(this.data,e,t),t=e,e=this.parentIndex(t)},t.prototype.siftDown=function(t){for(var e=this.minIndex(this.leftChildIndex(t),this.rightChildIndex(t));e>=0&&this.compare(this.data[t],this.data[e])>0;)s.swap(this.data,e,t),t=e,e=this.minIndex(this.leftChildIndex(t),this.rightChildIndex(t))},t.prototype.peek=function(){return this.data.length>0?this.data[0]:void 0},t.prototype.add=function(t){return!n.isUndefined(t)&&(this.data.push(t),this.siftUp(this.data.length-1),!0)},t.prototype.removeRoot=function(){if(this.data.length>0){var t=this.data[0];return this.data[0]=this.data[this.data.length-1],this.data.splice(this.data.length-1,1),this.data.length>0&&this.siftDown(0),t}},t.prototype.contains=function(t){var e=n.compareToEquals(this.compare);return s.contains(this.data,t,e)},t.prototype.size=function(){return this.data.length},t.prototype.isEmpty=function(){return this.data.length<=0},t.prototype.clear=function(){this.data.length=0},t.prototype.forEach=function(t){s.forEach(this.data,t)},t}();e.default=r},3272:function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(8805),o=i(9205),a=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.unlink=function(){this.prev.next=this.next,this.next.prev=this.prev},t}(),l=function(){function t(){this.key=null,this.value=null}return t.prototype.unlink=function(){this.prev.next=this.next,this.next.prev=this.prev},t}(),h=function(t){function e(e){var i=t.call(this,e)||this;return i.head=new l,i.tail=new l,i.head.next=i.tail,i.tail.prev=i.head,i}return s(e,t),e.prototype.appendToTail=function(t){var e=this.tail.prev;e.next=t,t.prev=e,t.next=this.tail,this.tail.prev=t},e.prototype.getLinkedDictionaryPair=function(t){if(!o.isUndefined(t)){var e="$"+this.toStr(t);return this.table[e]}},e.prototype.getValue=function(t){var e=this.getLinkedDictionaryPair(t);if(!o.isUndefined(e))return e.value},e.prototype.remove=function(e){var i=this.getLinkedDictionaryPair(e);if(!o.isUndefined(i))return t.prototype.remove.call(this,e),i.unlink(),i.value},e.prototype.clear=function(){t.prototype.clear.call(this),this.head.next=this.tail,this.tail.prev=this.head},e.prototype.replace=function(t,e){var i="$"+this.toStr(e.key);e.next=t.next,e.prev=t.prev,this.remove(t.key),e.prev.next=e,e.next.prev=e,this.table[i]=e,++this.nElements},e.prototype.setValue=function(t,e){if(!o.isUndefined(t)&&!o.isUndefined(e)){var i=this.getLinkedDictionaryPair(t),n=new a(t,e),s="$"+this.toStr(t);return o.isUndefined(i)?(this.appendToTail(n),this.table[s]=n,void++this.nElements):(this.replace(i,n),i.value)}},e.prototype.keys=function(){var t=[];return this.forEach((function(e,i){t.push(e)})),t},e.prototype.values=function(){var t=[];return this.forEach((function(e,i){t.push(i)})),t},e.prototype.forEach=function(t){for(var e=this.head.next;e.next;){if(!1===t(e.key,e.value))return;e=e.next}},e}(r.default);e.default=h},5456:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(9205),s=i(1229),r=function(){function t(){this.firstNode=null,this.lastNode=null,this.nElements=0}return t.prototype.add=function(t,e){if(n.isUndefined(e)&&(e=this.nElements),e<0||e>this.nElements||n.isUndefined(t))return!1;var i=this.createNode(t);if(0===this.nElements||null===this.lastNode)this.firstNode=i,this.lastNode=i;else if(e===this.nElements)this.lastNode.next=i,this.lastNode=i;else if(0===e)i.next=this.firstNode,this.firstNode=i;else{var s=this.nodeAtIndex(e-1);if(null===s)return!1;i.next=s.next,s.next=i}return this.nElements++,!0},t.prototype.first=function(){if(null!==this.firstNode)return this.firstNode.element},t.prototype.last=function(){if(null!==this.lastNode)return this.lastNode.element},t.prototype.elementAtIndex=function(t){var e=this.nodeAtIndex(t);if(null!==e)return e.element},t.prototype.indexOf=function(t,e){var i=e||n.defaultEquals;if(n.isUndefined(t))return-1;for(var s=this.firstNode,r=0;null!==s;){if(i(s.element,t))return r;r++,s=s.next}return-1},t.prototype.contains=function(t,e){return this.indexOf(t,e)>=0},t.prototype.remove=function(t,e){var i=e||n.defaultEquals;if(this.nElements<1||n.isUndefined(t))return!1;for(var s=null,r=this.firstNode;null!==r;){if(i(r.element,t))return null===s?(this.firstNode=r.next,r===this.lastNode&&(this.lastNode=null)):r===this.lastNode?(this.lastNode=s,s.next=r.next,r.next=null):(s.next=r.next,r.next=null),this.nElements--,!0;s=r,r=r.next}return!1},t.prototype.clear=function(){this.firstNode=null,this.lastNode=null,this.nElements=0},t.prototype.equals=function(e,i){var s=i||n.defaultEquals;return e instanceof t&&this.size()===e.size()&&this.equalsAux(this.firstNode,e.firstNode,s)},t.prototype.equalsAux=function(t,e,i){for(;null!==t&&null!==e;){if(!i(t.element,e.element))return!1;t=t.next,e=e.next}return!0},t.prototype.removeElementAtIndex=function(t){if(!(t<0||t>=this.nElements||null===this.firstNode||null===this.lastNode)){var e;if(1===this.nElements)e=this.firstNode.element,this.firstNode=null,this.lastNode=null;else{var i=this.nodeAtIndex(t-1);null===i?(e=this.firstNode.element,this.firstNode=this.firstNode.next):i.next===this.lastNode&&(e=this.lastNode.element,this.lastNode=i),null!==i&&null!==i.next&&(e=i.next.element,i.next=i.next.next)}return this.nElements--,e}},t.prototype.forEach=function(t){for(var e=this.firstNode;null!==e&&!1!==t(e.element);)e=e.next},t.prototype.reverse=function(){for(var t=null,e=this.firstNode,i=null;null!==e;)i=e.next,e.next=t,t=e,e=i;i=this.firstNode,this.firstNode=this.lastNode,this.lastNode=i},t.prototype.toArray=function(){for(var t=[],e=this.firstNode;null!==e;)t.push(e.element),e=e.next;return t},t.prototype.size=function(){return this.nElements},t.prototype.isEmpty=function(){return this.nElements<=0},t.prototype.toString=function(){return s.toString(this.toArray())},t.prototype.nodeAtIndex=function(t){if(t<0||t>=this.nElements)return null;if(t===this.nElements-1)return this.lastNode;for(var e=this.firstNode,i=0;i{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(9205),s=i(8805),r=i(1229),o=function(){function t(t,e,i){void 0===i&&(i=!1),this.dict=new s.default(t),this.equalsF=e||n.defaultEquals,this.allowDuplicate=i}return t.prototype.getValue=function(t){var e=this.dict.getValue(t);return n.isUndefined(e)?[]:r.copy(e)},t.prototype.setValue=function(t,e){if(n.isUndefined(t)||n.isUndefined(e))return!1;var i=this.dict.getValue(t);return n.isUndefined(i)?(this.dict.setValue(t,[e]),!0):!(!this.allowDuplicate&&r.contains(i,e,this.equalsF)||(i.push(e),0))},t.prototype.remove=function(t,e){if(n.isUndefined(e)){var i=this.dict.remove(t);return!n.isUndefined(i)}var s=this.dict.getValue(t);return!(n.isUndefined(s)||!r.remove(s,e,this.equalsF)||(0===s.length&&this.dict.remove(t),0))},t.prototype.keys=function(){return this.dict.keys()},t.prototype.values=function(){for(var t=[],e=0,i=this.dict.values();e{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.BEFORE=0]="BEFORE",t[t.AFTER=1]="AFTER",t[t.INSIDE_AT_END=2]="INSIDE_AT_END",t[t.INSIDE_AT_START=3]="INSIDE_AT_START"}(i||(i={}));var n=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.rootIds=t,this.nodes=e,this.initRootIds(),this.initNodes()}return t.prototype.initRootIds=function(){for(var t=0,e=this.rootIds;t-1&&this.insertIdIntoRoot(e,i),this.nodes)if(this.nodes.hasOwnProperty(n)){var s=this.findNodeId(n,t);s>-1&&this.insertIdIntoNode(n,e,s)}},t.prototype.insertIdAfterId=function(t,e){var i=this.findRootId(t);for(var n in i>-1&&this.insertIdIntoRoot(e,i+1),this.nodes)if(this.nodes.hasOwnProperty(n)){var s=this.findNodeId(n,t);s>-1&&this.insertIdIntoNode(n,e,s+1)}},t.prototype.insertIdIntoId=function(t,e){this.nodeInsertAtEnd(t,e),this.nodes[e]=[]},t.prototype.insertIdIntoRoot=function(t,e){if(void 0===e)this.rootInsertAtEnd(t);else if(e<0){var i=this.rootIds.length;this.rootIds.splice(e+i+1,0,t)}else this.rootIds.splice(e,0,t);this.nodes[t]=this.nodes[t]||[]},t.prototype.insertIdIntoNode=function(t,e,i){if(this.nodes[t]=this.nodes[t]||[],this.nodes[e]=this.nodes[e]||[],void 0===i)this.nodeInsertAtEnd(t,e);else if(i<0){var n=this.nodes[t].length;this.nodes[t].splice(i+n+1,0,e)}else this.nodes[t].splice(i,0,e)},t.prototype.moveId=function(t,e,n){var s=t,r=this.findRootId(s);for(var o in this.nodes[e],this.nodes)if(this.nodes.hasOwnProperty(o)){this.findNodeId(o,e);break}var a=e,l=this.findRootId(a);for(var o in this.nodes[e],this.nodes)if(this.nodes.hasOwnProperty(o)){this.findNodeId(o,e);break}if(r>-1){if(l>-1)switch(this.rootDelete(r),l>r&&l--,n){case i.BEFORE:this.insertIdIntoRoot(s,l);break;case i.AFTER:this.insertIdIntoRoot(s,l+1);break;case i.INSIDE_AT_START:this.nodeInsertAtStart(a,s);break;case i.INSIDE_AT_END:this.nodeInsertAtEnd(a,s)}else for(var o in this.rootDelete(r),this.nodes)if(this.nodes.hasOwnProperty(o)&&(h=this.findNodeId(o,a))>-1){switch(n){case i.BEFORE:this.insertIdIntoNode(o,s,h);break;case i.AFTER:this.insertIdIntoNode(o,s,h+1);break;case i.INSIDE_AT_START:this.nodeInsertAtStart(a,s);break;case i.INSIDE_AT_END:this.nodeInsertAtEnd(a,s)}break}}else if(l>-1){for(var o in this.nodes)if(this.nodes.hasOwnProperty(o)&&(h=this.findNodeId(o,s))>-1){this.nodeDeleteAtIndex(o,h);break}switch(n){case i.BEFORE:this.insertIdIntoRoot(s,l);break;case i.AFTER:this.insertIdIntoRoot(s,l+1);break;case i.INSIDE_AT_START:this.nodeInsertAtStart(a,s);break;case i.INSIDE_AT_END:this.nodeInsertAtEnd(a,s)}}else{for(var o in this.nodes)if(this.nodes.hasOwnProperty(o)&&(h=this.findNodeId(o,s))>-1){this.nodeDeleteAtIndex(o,h);break}for(var o in this.nodes){var h;if(this.nodes.hasOwnProperty(o)&&(h=this.findNodeId(o,a))>-1){switch(n){case i.BEFORE:this.insertIdIntoNode(o,s,h);break;case i.AFTER:this.insertIdIntoNode(o,s,h+1);break;case i.INSIDE_AT_START:this.nodeInsertAtStart(a,s);break;case i.INSIDE_AT_END:this.nodeInsertAtEnd(a,s)}break}}}},t.prototype.swapArrayElements=function(t,e,i){var n=t[e];return t[e]=t[i],t[i]=n,t},t.prototype.rootDeleteId=function(t){var e=this.findRootId(t);e>-1&&this.rootDelete(e)},t.prototype.nodeAndSubNodesDelete=function(t){for(var e=[],i=0;i{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(9205),s=i(2422),r=function(){function t(t){this.heap=new s.default(n.reverseCompareFunction(t))}return t.prototype.enqueue=function(t){return this.heap.add(t)},t.prototype.add=function(t){return this.heap.add(t)},t.prototype.dequeue=function(){if(0!==this.heap.size()){var t=this.heap.peek();return this.heap.removeRoot(),t}},t.prototype.peek=function(){return this.heap.peek()},t.prototype.contains=function(t){return this.heap.contains(t)},t.prototype.isEmpty=function(){return this.heap.isEmpty()},t.prototype.size=function(){return this.heap.size()},t.prototype.clear=function(){this.heap.clear()},t.prototype.forEach=function(t){this.heap.forEach(t)},t}();e.default=r},278:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(5456),s=function(){function t(){this.list=new n.default}return t.prototype.enqueue=function(t){return this.list.add(t)},t.prototype.add=function(t){return this.list.add(t)},t.prototype.dequeue=function(){if(0!==this.list.size()){var t=this.list.first();return this.list.removeElementAtIndex(0),t}},t.prototype.peek=function(){if(0!==this.list.size())return this.list.first()},t.prototype.size=function(){return this.list.size()},t.prototype.contains=function(t,e){return this.list.contains(t,e)},t.prototype.isEmpty=function(){return this.list.size()<=0},t.prototype.clear=function(){this.list.clear()},t.prototype.forEach=function(t){this.list.forEach(t)},t}();e.default=s},7818:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(9205),s=i(1229),r=i(8805),o=function(){function t(t){this.dictionary=new r.default(t)}return t.prototype.contains=function(t){return this.dictionary.containsKey(t)},t.prototype.add=function(t){return!this.contains(t)&&!n.isUndefined(t)&&(this.dictionary.setValue(t,t),!0)},t.prototype.intersection=function(t){var e=this;this.forEach((function(i){return t.contains(i)||e.remove(i),!0}))},t.prototype.union=function(t){var e=this;t.forEach((function(t){return e.add(t),!0}))},t.prototype.difference=function(t){var e=this;t.forEach((function(t){return e.remove(t),!0}))},t.prototype.isSubsetOf=function(t){if(this.size()>t.size())return!1;var e=!0;return this.forEach((function(i){return!!t.contains(i)||(e=!1,!1)})),e},t.prototype.remove=function(t){return!!this.contains(t)&&(this.dictionary.remove(t),!0)},t.prototype.forEach=function(t){this.dictionary.forEach((function(e,i){return t(i)}))},t.prototype.toArray=function(){return this.dictionary.values()},t.prototype.isEmpty=function(){return this.dictionary.isEmpty()},t.prototype.size=function(){return this.dictionary.size()},t.prototype.clear=function(){this.dictionary.clear()},t.prototype.toString=function(){return s.toString(this.toArray())},t}();e.default=o},5669:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(5456),s=function(){function t(){this.list=new n.default}return t.prototype.push=function(t){return this.list.add(t,0)},t.prototype.add=function(t){return this.list.add(t,0)},t.prototype.pop=function(){return this.list.removeElementAtIndex(0)},t.prototype.peek=function(){return this.list.first()},t.prototype.size=function(){return this.list.size()},t.prototype.contains=function(t,e){return this.list.contains(t,e)},t.prototype.isEmpty=function(){return this.list.isEmpty()},t.prototype.clear=function(){this.list.clear()},t.prototype.forEach=function(t){this.list.forEach(t)},t}();e.default=s},1229:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(9205);function s(t,e,i){for(var s=i||n.defaultEquals,r=t.length,o=0;o=0;r--)if(s(t[r],e))return r;return-1},e.contains=function(t,e,i){return s(t,e,i)>=0},e.remove=function(t,e,i){var n=s(t,e,i);return!(n<0||(t.splice(n,1),0))},e.frequency=function(t,e,i){for(var s=i||n.defaultEquals,r=t.length,o=0,a=0;a=t.length||i<0||i>=t.length)return!1;var n=t[e];return t[e]=t[i],t[i]=n,!0},e.toString=function(t){return"["+t.toString()+"]"},e.forEach=function(t,e){for(var i=0,n=t;i{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(1229);e.arrays=n;var s=i(2070);e.Bag=s.default;var r=i(8071);e.BSTree=r.default;var o=i(3176);e.BSTreeKV=o.default;var a=i(8805);e.Dictionary=a.default;var l=i(2422);e.Heap=l.default;var h=i(3272);e.LinkedDictionary=h.default;var u=i(5456);e.LinkedList=u.default;var c=i(6072);e.MultiDictionary=c.default;var d=i(2734);e.FactoryDictionary=d.default;var p=i(2734);e.DefaultDictionary=p.default;var f=i(278);e.Queue=f.default;var m=i(5994);e.PriorityQueue=m.default;var g=i(7818);e.Set=g.default;var b=i(5669);e.Stack=b.default;var y=i(1489);e.MultiRootTree=y.default;var S=i(9205);e.util=S},9205:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.prototype.hasOwnProperty;function n(t){return"function"==typeof t}function s(t){return void 0===t}function r(t){return"[object String]"===Object.prototype.toString.call(t)}e.has=function(t,e){return i.call(t,e)},e.defaultCompare=function(t,e){return t{"use strict";i.d(e,{k:()=>n});class n{static copy(t){return new n(t.x,t.y,t.w,t.h)}constructor(t,e,i,n){this.x=t,this.y=e,this.w=i,this.h=n}getX(){return this.x}getY(){return this.y}getW(){return this.w}getH(){return this.h}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setW(t){return this.w=t,this}setH(t){return this.h=t,this}move(t,e){this.x+=t,this.y+=e}clone(){return n.copy(this)}mergeWith(t,e){const i=t,n=this.x{"use strict";i.d(e,{o:()=>r});var n=i(4552),s=i(3493);class r extends s.Modifier{static get CATEGORY(){return"dots"}static format(t,e){const i=e.right_shift;if(!t||0===t.length)return!1;const n=[],s={};for(let e=0;ee.line-t.line));let r=i,o=0,a=null,l=null,h=null,u=0;for(let t=0;to?r:o,a=d,l=i}return e.right_shift+=o,!0}constructor(){super(),this.setAttribute("type","Dot"),this.note=null,this.index=null,this.position=s.Modifier.Position.RIGHT,this.radius=2,this.setWidth(5),this.dot_shiftY=0}getCategory(){return r.CATEGORY}setNote(t){this.note=t,"gracenotes"===this.note.getCategory()&&(this.radius*=.5,this.setWidth(3))}setDotShiftY(t){return this.dot_shiftY=t,this}draw(){if(this.checkContext(),this.setRendered(),!this.note||null===this.index)throw new n.s.RERR("NoAttachedNote","Can't draw dot without a note and index.");const t=this.note.stave.options.spacing_between_lines_px,e=this.note.getModifierStartXY(this.position,this.index,{forceFlagRight:!0});"tabnotes"===this.note.getCategory()&&(e.y=this.note.getStemExtents().baseY+1);const i=e.x+this.x_shift+this.width-this.radius;let s=this.dot_shiftY*t;this.note&&"jianpu"==this.note.DYMusicScoreType&&(s=-5);const r=e.y+this.y_shift+s,o=this.context;o.beginPath(),o.arc(i,r,this.radius,0,2*Math.PI,!1),o.fill()}}},2088:(t,e,i)=>{"use strict";i.d(e,{W:()=>r});var n=i(4552),s=i(8194);class r{static newID(){return"auto"+r.ID++}constructor({type:t}={}){this.attrs={id:r.newID(),el:null,type:t||"Base",classes:{}},this.boundingBox=null,this.context=null,this.rendered=!1,s.B.getDefaultRegistry()&&s.B.getDefaultRegistry().register(this)}setStyle(t){return this.style=t,this}getStyle(){return this.style}applyStyle(t=this.context,e=this.getStyle()){return e?(t.save(),e.shadowColor&&t.setShadowColor(e.shadowColor),e.shadowBlur&&t.setShadowBlur(e.shadowBlur),e.fillStyle&&t.setFillStyle(e.fillStyle),e.strokeStyle&&t.setStrokeStyle(e.strokeStyle),e.lineWidth&&t.setLineWidth(e.lineWidth),this):this}restoreStyle(t=this.context,e=this.getStyle()){return e?(t.restore(),this):this}drawWithStyle(){this.checkContext(),this.applyStyle(),this.draw(),this.restoreStyle()}hasClass(t){return!0===this.attrs.classes[t]}addClass(t){return this.attrs.classes[t]=!0,this.registry&&this.registry.onUpdate({id:this.getAttribute("id"),name:"class",value:t,oldValue:null}),this}removeClass(t){return delete this.attrs.classes[t],this.registry&&this.registry.onUpdate({id:this.getAttribute("id"),name:"class",value:null,oldValue:t}),this}onRegister(t){return this.registry=t,this}isRendered(){return this.rendered}setRendered(t=!0){return this.rendered=t,this}getAttributes(){return this.attrs}getAttribute(t){return this.attrs[t]}setAttribute(t,e){const i=this.attrs.id,n=this.attrs[t];return this.attrs[t]=e,this.registry&&this.registry.onUpdate({id:i,name:t,value:e,oldValue:n}),this}getContext(){return this.context}setContext(t){return this.context=t,this}getBoundingBox(){return this.boundingBox}checkContext(){if(!this.context)throw new n.s.RERR("NoContext","No rendering context attached to instance");return this.context}}r.ID=1e3},3042:(t,e,i)=>{"use strict";i.d(e,{Z:()=>n});const n={glyphs:{v0:{x_min:0,x_max:514.5,ha:525,o:"m 236 648 b 246 648 238 648 242 648 b 288 646 261 648 283 648 b 472 513 364 634 428 587 b 514 347 502 464 514 413 b 462 163 514 272 499 217 b 257 44 409 83 333 44 b 50 163 181 44 103 83 b 0 347 14 217 0 272 b 40 513 0 413 12 464 b 236 648 87 591 155 638 m 277 614 b 253 616 273 616 261 616 b 242 616 247 616 243 616 b 170 499 193 609 181 589 b 159 348 163 446 159 398 b 166 222 159 308 161 266 b 201 91 174 138 183 106 b 257 76 215 81 235 76 b 311 91 277 76 299 81 b 347 222 330 106 338 138 b 353 348 352 266 353 308 b 344 499 353 398 351 446 b 277 614 333 587 322 606 m 257 -1 l 258 -1 l 255 -1 l 257 -1 m 257 673 l 258 673 l 255 673 l 257 673 "},v1:{x_min:-1.359375,x_max:344.359375,ha:351,o:"m 126 637 l 129 638 l 198 638 l 266 638 l 269 635 b 274 631 272 634 273 632 l 277 627 l 277 395 b 279 156 277 230 277 161 b 329 88 281 123 295 106 b 344 69 341 81 344 79 b 337 55 344 62 343 59 l 333 54 l 197 54 l 61 54 l 58 55 b 50 69 53 59 50 62 b 65 88 50 79 53 81 b 80 97 72 91 74 93 b 117 156 103 113 112 129 b 117 345 117 161 117 222 l 117 528 l 100 503 l 38 406 b 14 383 24 384 23 383 b -1 398 5 383 -1 390 b 4 415 -1 403 1 409 b 16 437 5 416 10 426 l 72 539 l 100 596 b 121 632 119 631 119 631 b 126 637 122 634 125 635 m 171 -1 l 172 -1 l 170 -1 l 171 -1 m 171 673 l 172 673 l 170 673 l 171 673 "},v2:{x_min:-1.359375,x_max:458.6875,ha:468,o:"m 197 648 b 216 648 201 648 208 648 b 258 646 232 648 253 648 b 419 546 333 637 393 599 b 432 489 428 528 432 509 b 356 342 432 440 405 384 b 235 278 322 313 288 295 b 69 170 166 256 107 217 b 69 169 69 170 69 169 b 69 169 69 169 69 169 b 74 173 69 169 72 170 b 209 222 112 204 163 222 b 310 195 247 222 274 215 b 371 179 332 184 352 179 b 396 181 379 179 387 179 b 428 202 409 184 423 194 b 442 212 431 209 436 212 b 458 197 450 212 458 206 b 441 148 458 190 449 165 b 299 44 409 84 353 44 b 288 45 295 44 292 44 b 250 61 274 45 268 49 b 122 99 212 86 164 99 b 73 91 104 99 88 97 b 28 63 53 84 34 72 b 14 54 25 56 20 54 b 1 62 9 54 4 56 l -1 65 l -1 79 b 0 99 -1 91 0 95 b 2 113 1 102 2 108 b 164 309 20 197 81 272 b 285 470 232 341 277 398 b 287 487 287 476 287 481 b 171 595 287 551 239 595 b 155 595 166 595 160 595 b 142 592 145 594 142 594 b 145 589 142 592 142 591 b 179 527 168 576 179 551 b 132 455 179 496 163 467 b 104 451 122 452 112 451 b 27 530 62 451 27 487 b 29 555 27 538 27 546 b 197 648 44 601 115 639 m 228 -1 l 230 -1 l 227 -1 l 228 -1 m 228 673 l 230 673 l 227 673 l 228 673 "},v3:{x_min:-1.359375,x_max:409.6875,ha:418,o:"m 174 648 b 191 648 176 648 183 648 b 225 648 204 648 220 648 b 402 523 317 638 389 588 b 404 503 404 517 404 510 b 402 484 404 495 404 488 b 264 373 389 437 334 394 b 257 370 259 371 257 371 b 257 370 257 370 257 370 b 264 369 258 370 261 369 b 409 202 359 334 409 267 b 318 72 409 152 381 104 b 200 43 281 52 240 43 b 23 113 134 43 69 68 b 0 169 6 129 0 149 b 77 249 0 210 29 249 l 77 249 b 152 174 125 249 152 212 b 103 102 152 145 137 116 b 103 102 103 102 103 102 b 147 94 103 101 132 95 b 153 94 149 94 151 94 b 265 206 219 94 265 141 b 264 226 265 213 265 219 b 147 355 253 299 204 353 b 126 371 133 356 126 362 b 147 388 126 383 132 388 b 254 474 196 391 238 424 b 259 502 258 484 259 494 b 182 592 259 544 228 582 b 156 595 175 595 166 595 b 115 592 142 595 129 594 l 111 591 l 115 588 b 152 524 141 574 152 549 b 92 449 152 491 130 458 b 76 448 87 448 81 448 b -1 530 32 448 -1 488 b 20 581 -1 548 5 566 b 174 648 55 619 108 641 m 204 -1 l 205 -1 l 202 -1 l 204 -1 m 204 673 l 205 673 l 202 673 l 204 673 "},v4:{x_min:0,x_max:468.21875,ha:478,o:"m 174 637 b 232 638 175 638 189 638 b 277 638 245 638 259 638 l 378 638 l 381 635 b 389 623 386 632 389 627 b 382 609 389 617 386 613 b 366 589 381 606 372 598 l 313 528 l 245 451 l 209 410 l 155 348 l 84 267 b 59 240 72 252 59 240 b 59 240 59 240 59 240 b 151 238 59 238 68 238 l 242 238 l 242 303 b 243 371 242 369 242 370 b 289 426 245 374 254 385 l 303 441 l 317 456 l 338 483 l 360 506 l 371 520 b 386 527 375 526 381 527 b 400 519 392 527 397 524 b 401 440 401 516 401 514 b 401 377 401 423 401 402 l 401 238 l 426 238 b 453 237 449 238 450 238 b 465 217 461 234 465 226 b 460 202 465 212 464 206 b 426 197 454 197 453 197 l 401 197 l 401 180 b 451 88 402 129 412 109 b 468 69 465 81 468 79 b 461 55 468 62 466 59 l 458 54 l 321 54 l 185 54 l 182 55 b 175 69 176 59 175 62 b 191 88 175 79 176 81 b 240 180 230 109 240 129 l 240 197 l 125 197 b 73 195 104 195 87 195 b 8 197 10 195 9 197 b 0 212 2 199 0 205 b 0 212 0 212 0 212 b 20 242 0 219 0 219 b 163 610 104 344 163 492 b 174 637 163 628 166 634 m 234 -1 l 235 -1 l 232 -1 l 234 -1 m 234 673 l 235 673 l 232 673 l 234 673 "},v5:{x_min:0,x_max:409.6875,ha:418,o:"m 47 637 b 53 638 49 638 50 638 b 69 634 55 638 61 637 b 210 610 114 619 161 610 b 363 634 259 610 311 619 b 382 638 372 637 378 638 b 392 634 386 638 389 637 b 397 623 396 630 397 627 b 393 610 397 620 396 616 b 298 505 368 552 338 520 b 212 494 277 498 246 494 b 65 517 163 494 106 502 b 61 517 62 517 61 517 b 61 517 61 517 61 517 b 51 408 61 517 51 412 b 51 408 51 408 51 408 b 51 408 51 408 51 408 b 61 412 53 408 55 409 b 125 434 80 421 103 430 b 185 441 145 440 166 441 b 409 244 310 441 409 353 b 401 191 409 227 406 209 b 197 43 375 105 287 43 b 159 47 183 43 171 44 b 23 123 112 56 61 86 b 0 180 6 140 0 159 b 76 260 0 220 31 260 b 92 259 81 260 87 259 b 152 183 132 251 152 216 b 100 112 152 152 134 122 b 95 111 98 112 95 111 b 95 111 95 111 95 111 b 129 98 95 109 119 101 b 148 97 136 97 141 97 b 264 235 206 97 261 158 b 265 248 265 240 265 244 b 210 398 265 312 243 373 b 179 408 201 406 194 408 b 174 408 178 408 176 408 b 53 369 130 408 88 394 b 34 359 39 359 38 359 b 17 374 24 359 17 365 b 39 628 17 384 38 625 b 47 637 40 631 43 635 m 204 -1 l 205 -1 l 202 -1 l 204 -1 m 204 673 l 205 673 l 202 673 l 204 673 "},v6:{x_min:0,x_max:475.03125,ha:485,o:"m 255 648 b 274 648 259 648 266 648 b 314 646 288 648 307 648 b 450 555 374 637 438 594 b 454 530 453 546 454 538 b 375 451 454 485 416 451 b 328 467 359 451 343 455 b 300 526 310 483 300 503 b 352 598 300 557 319 589 b 356 599 355 598 356 599 b 352 602 356 599 355 601 b 288 616 330 612 308 616 b 210 584 257 616 230 605 b 164 433 189 559 174 508 b 160 374 163 415 160 381 b 160 374 160 374 160 374 b 160 374 160 374 160 374 b 168 377 160 374 164 376 b 258 395 200 390 228 395 b 366 367 294 395 328 387 b 475 223 436 333 475 283 b 472 197 475 215 473 206 b 349 65 462 141 419 95 b 259 43 317 51 288 43 b 167 69 230 43 200 52 b 4 290 80 113 20 195 b 0 349 1 309 0 328 b 20 467 0 391 6 433 b 255 648 58 563 155 637 m 269 363 b 257 363 265 363 261 363 b 210 345 236 363 220 356 b 186 226 196 324 186 272 b 187 198 186 216 186 206 b 213 95 191 151 202 112 b 257 76 221 83 238 76 b 270 77 261 76 266 76 b 321 156 299 81 310 99 b 329 229 326 183 329 206 b 321 301 329 252 326 274 b 269 363 311 342 298 359 m 236 -1 l 238 -1 l 235 -1 l 236 -1 m 236 673 l 238 673 l 235 673 l 236 673 "},v7:{x_min:0,x_max:442.359375,ha:451,o:"m 147 648 b 166 649 153 649 160 649 b 313 598 217 649 273 630 b 340 587 323 588 328 587 l 341 587 b 412 628 367 587 390 601 b 427 638 416 635 421 638 b 439 632 431 638 435 637 b 442 623 441 630 442 628 b 430 569 442 616 439 603 b 352 369 408 492 377 410 b 300 259 325 324 313 298 b 273 84 283 205 273 140 b 265 55 273 65 272 59 l 261 54 l 181 54 l 99 54 l 96 55 b 91 61 95 56 92 59 l 89 63 l 89 77 b 147 263 89 133 111 202 b 261 401 176 313 212 355 b 378 541 315 449 349 489 l 382 548 l 375 544 b 240 495 333 512 285 495 b 129 535 198 495 160 509 b 84 560 108 552 95 560 b 76 559 81 560 78 560 b 31 487 59 555 43 530 b 14 470 27 473 24 470 b 1 477 8 470 4 471 l 0 480 l 0 553 l 0 627 l 1 630 b 16 638 4 635 9 638 b 23 635 17 638 20 637 b 49 626 36 626 39 626 b 96 638 59 626 80 630 b 104 639 99 638 102 639 b 117 644 107 641 112 642 b 147 648 125 645 137 648 m 220 -1 l 221 -1 l 219 -1 l 220 -1 m 220 673 l 221 673 l 219 673 l 220 673 "},v8:{x_min:0,x_max:488.640625,ha:499,o:"m 217 648 b 245 649 225 648 235 649 b 453 516 343 649 430 595 b 458 478 455 503 458 491 b 412 370 458 440 441 398 b 411 369 412 369 411 369 b 415 365 411 367 412 367 b 488 231 462 331 488 281 b 472 165 488 208 483 186 b 243 43 434 86 338 43 b 63 104 178 43 112 62 b 0 233 20 140 0 186 b 73 365 0 283 24 331 l 77 369 l 72 374 b 29 476 42 406 29 441 b 217 648 29 557 103 635 m 258 605 b 242 606 253 605 247 606 b 157 552 198 606 157 580 b 160 541 157 548 159 544 b 319 413 176 503 242 452 l 337 403 l 338 406 b 359 476 352 428 359 452 b 258 605 359 537 318 595 m 138 326 b 130 330 134 328 130 330 b 130 330 130 330 130 330 b 107 305 127 330 112 313 b 84 231 91 281 84 256 b 243 86 84 156 151 86 b 249 87 245 86 246 87 b 347 156 303 88 347 120 b 344 172 347 162 345 167 b 156 319 325 227 257 281 b 138 326 151 322 144 324 m 243 -1 l 245 -1 l 242 -1 l 243 -1 m 243 673 l 245 673 l 242 673 l 243 673 "},v9:{x_min:0,x_max:475.03125,ha:485,o:"m 191 646 b 212 649 198 648 205 649 b 255 644 227 649 243 646 b 458 448 348 616 428 539 b 475 342 469 415 475 378 b 460 244 475 308 469 274 b 193 44 421 124 303 44 b 91 69 157 44 122 51 b 19 161 43 97 19 126 b 21 181 19 167 20 174 b 98 241 32 220 65 241 b 170 186 129 241 160 223 b 172 166 171 179 172 173 b 121 94 172 134 152 102 b 117 93 118 94 117 93 b 121 90 117 93 118 91 b 185 76 142 80 164 76 b 270 119 220 76 251 91 b 308 259 287 145 300 194 b 313 317 310 277 313 310 b 313 317 313 317 313 317 b 313 317 313 317 313 317 b 304 315 313 317 308 316 b 216 295 273 302 245 295 b 145 308 193 295 170 299 b 19 398 88 327 42 360 b 0 469 5 420 0 444 b 24 551 0 496 8 526 b 191 646 54 596 125 637 m 227 614 b 215 616 224 616 220 616 b 202 614 210 616 206 616 b 152 535 174 610 163 592 b 144 463 147 509 144 485 b 152 391 144 440 147 417 b 216 328 163 344 179 328 b 280 391 253 328 269 344 b 288 463 285 417 288 440 b 280 535 288 485 285 509 b 227 614 269 594 258 610 m 236 -1 l 238 -1 l 235 -1 l 236 -1 m 236 673 l 238 673 l 235 673 l 236 673 "},va:{x_min:-149.71875,x_max:148.359375,ha:151,o:"m -8 -1 b -1 0 -5 -1 -4 0 b 16 -11 5 0 13 -4 b 83 -186 17 -12 47 -90 l 148 -358 l 148 -363 b 127 -385 148 -376 138 -385 b 112 -378 122 -385 118 -383 b 54 -226 110 -374 114 -385 b 0 -81 24 -147 0 -81 b -55 -226 -1 -81 -25 -147 b -114 -378 -115 -385 -111 -374 b -129 -385 -119 -383 -123 -385 b -149 -363 -140 -385 -149 -376 l -149 -358 l -84 -186 b -19 -11 -49 -90 -19 -12 b -8 -1 -17 -8 -12 -4 "},vb:{x_min:0,x_max:428.75,ha:438,o:"m 262 186 b 273 186 266 186 272 186 b 274 186 273 186 274 186 b 285 186 274 186 280 186 b 428 48 375 181 428 122 b 386 -68 428 12 416 -29 b 155 -187 329 -145 236 -187 b 12 -111 92 -187 38 -162 b 0 -51 4 -91 0 -72 b 262 186 0 58 122 179 "},vc:{x_min:0,x_max:447.8125,ha:457,o:"m 0 86 l 0 173 l 223 173 l 447 173 l 447 86 l 447 0 l 223 0 l 0 0 l 0 86 "},vf:{x_min:0,x_max:370.21875,ha:378,o:"m 0 0 l 0 277 l 61 277 l 122 277 l 122 0 l 122 -278 l 61 -278 l 0 -278 l 0 0 m 246 -1 l 246 277 l 308 277 l 370 277 l 370 -1 l 370 -278 l 308 -278 l 246 -278 l 246 -1 "},v10:{x_min:0,x_max:559.421875,ha:571,o:"m 5 127 b 14 127 6 127 9 127 b 51 126 25 127 43 127 b 175 98 93 122 138 112 l 186 94 b 279 51 210 86 255 65 b 285 47 280 51 283 48 b 319 27 291 44 311 31 l 326 22 b 359 0 332 19 352 4 l 367 -6 b 371 -9 368 -6 370 -8 l 379 -15 b 387 -22 383 -18 386 -20 l 398 -30 l 411 -40 l 417 -47 l 427 -55 l 434 -61 b 441 -66 436 -62 439 -65 l 446 -72 l 453 -77 l 462 -87 b 558 -188 490 -113 549 -176 b 559 -195 559 -191 559 -194 b 548 -205 559 -201 555 -205 b 541 -204 547 -205 544 -205 b 534 -198 539 -201 536 -199 l 525 -191 b 481 -162 518 -187 490 -167 b 472 -155 477 -159 472 -156 b 468 -152 470 -155 469 -154 b 461 -149 466 -152 464 -151 b 428 -130 454 -145 441 -137 b 371 -99 413 -122 372 -99 b 363 -95 371 -99 367 -98 b 353 -91 357 -94 353 -91 b 348 -90 353 -91 352 -91 b 332 -81 343 -87 341 -86 b 27 -12 230 -37 127 -13 b 0 -5 4 -11 2 -11 b 0 58 0 -2 0 27 b 0 122 0 88 0 120 b 5 127 1 124 4 126 "},v11:{x_min:-155.171875,x_max:153.8125,ha:157,o:"m -137 353 b -130 353 -136 353 -133 353 b -112 349 -125 353 -119 352 b -100 342 -110 347 -104 344 b 0 317 -69 326 -35 317 b 111 349 38 317 76 328 b 129 353 117 352 123 353 b 153 327 142 353 153 344 b 144 302 153 320 153 317 b 27 6 93 226 50 113 b 21 -13 24 -11 24 -11 b 0 -26 17 -22 8 -26 b -24 -12 -9 -26 -19 -22 b -28 5 -24 -9 -27 -2 b -145 302 -53 117 -95 224 b -155 327 -155 317 -155 320 b -137 353 -155 340 -148 349 "},v18:{x_min:0,x_max:323.9375,ha:331,o:"m 217 535 b 225 537 220 537 221 537 b 245 524 235 537 242 533 l 246 521 l 247 390 l 247 258 l 273 265 b 306 270 288 269 299 270 b 322 259 315 270 319 267 b 323 208 323 256 323 233 b 322 158 323 184 323 159 b 288 140 318 148 315 147 b 247 130 254 131 247 130 b 247 65 247 130 247 104 b 247 20 247 51 247 36 l 247 -88 l 273 -81 b 306 -76 289 -77 299 -76 b 318 -81 311 -76 315 -77 b 323 -123 323 -87 323 -86 l 323 -138 l 323 -154 b 318 -195 323 -191 323 -190 b 269 -210 314 -199 315 -199 b 249 -216 259 -213 250 -216 l 247 -216 l 247 -349 l 246 -483 l 245 -487 b 225 -499 242 -495 234 -499 b 206 -487 219 -499 210 -495 l 205 -483 l 205 -355 l 205 -227 l 204 -227 l 181 -233 l 138 -244 b 117 -249 127 -247 117 -249 b 115 -385 115 -249 115 -256 l 115 -523 l 114 -526 b 95 -538 110 -534 102 -538 b 74 -526 87 -538 78 -534 l 73 -523 l 73 -391 b 72 -260 73 -269 73 -260 b 72 -260 72 -260 72 -260 b 19 -273 61 -263 23 -273 b 0 -260 10 -273 4 -267 b 0 -209 0 -256 0 -256 l 0 -162 l 1 -158 b 61 -134 5 -148 5 -148 l 73 -131 l 73 -22 b 72 86 73 79 73 86 b 72 86 72 86 72 86 b 19 74 61 83 23 74 b 0 86 10 74 4 79 b 0 137 0 90 0 90 l 0 184 l 1 188 b 61 212 5 198 5 198 l 73 215 l 73 348 l 73 481 l 74 485 b 95 498 78 492 87 498 b 103 495 98 498 100 496 b 114 485 107 494 111 489 l 115 481 l 115 353 l 115 226 l 121 226 b 159 235 123 227 141 231 l 198 247 l 205 248 l 205 384 l 205 521 l 206 524 b 217 535 209 528 212 533 m 205 9 b 205 119 205 70 205 119 l 205 119 b 182 113 204 119 194 116 l 138 102 b 117 97 127 99 117 97 b 115 -12 115 97 115 91 l 115 -122 l 121 -120 b 159 -111 123 -119 141 -115 l 198 -101 l 205 -98 l 205 9 "},v1b:{x_min:0,x_max:559.421875,ha:571,o:"m 544 204 b 548 204 545 204 547 204 b 559 194 555 204 559 199 b 559 190 559 192 559 191 b 530 156 559 188 556 184 b 462 86 510 134 481 104 b 453 76 458 81 454 77 l 446 70 l 441 65 b 434 59 439 63 436 61 l 427 54 b 409 37 426 51 416 44 b 392 23 398 29 394 26 b 387 19 389 22 387 20 b 379 13 386 19 383 16 l 371 8 l 367 5 l 359 -1 l 337 -16 b 285 -48 319 -29 298 -41 l 279 -52 b 186 -95 255 -66 210 -87 l 175 -99 b 23 -129 127 -117 68 -129 b 17 -129 20 -129 19 -129 b 1 -123 2 -129 2 -129 b 0 -49 0 -122 0 -83 b 0 4 0 -22 0 1 b 27 11 2 9 4 9 b 185 31 78 12 145 20 b 198 34 186 31 193 33 b 314 73 234 44 277 58 b 349 88 328 79 340 84 b 353 90 352 90 353 90 b 363 94 353 90 357 93 b 371 98 367 97 371 98 b 428 129 372 98 413 120 b 461 148 441 136 454 144 b 468 151 464 149 466 151 b 472 154 469 152 470 154 b 481 161 473 155 477 158 b 525 190 490 166 518 186 l 534 197 b 540 201 536 198 539 199 b 544 204 541 202 544 204 "},v1d:{x_min:0,x_max:619.3125,ha:632,o:"m 274 184 b 307 186 285 186 296 186 b 616 22 465 186 597 116 b 619 -1 617 13 619 5 b 308 -187 619 -104 483 -187 b 0 -1 133 -187 0 -102 b 5 36 0 11 1 23 b 274 184 29 115 141 176 m 289 161 b 272 162 284 162 277 162 b 171 41 209 162 171 108 b 205 -73 171 5 182 -34 b 345 -163 243 -133 298 -163 b 436 -98 385 -163 420 -142 b 446 -43 443 -80 446 -62 b 289 161 446 47 377 147 "},v1e:{x_min:-402.890625,x_max:401.53125,ha:410,o:"m -219 173 b -213 174 -217 174 -215 174 b -202 173 -209 174 -205 173 b -114 86 -200 172 -179 151 b -28 0 -66 37 -28 0 b 40 84 -28 0 2 37 b 117 174 111 173 110 172 b 122 174 118 174 119 174 b 132 173 125 174 129 173 b 295 11 134 172 171 134 l 307 -1 l 336 34 b 374 76 366 72 368 74 b 381 77 375 77 378 77 b 401 56 392 77 401 68 b 400 48 401 54 401 51 b 223 -172 397 41 230 -166 b 210 -176 220 -174 215 -176 b 201 -174 206 -176 204 -176 b 112 -87 198 -173 178 -152 b 27 0 65 -38 27 0 b -42 -86 27 0 -4 -38 b -118 -174 -112 -174 -111 -173 b -123 -176 -119 -176 -121 -176 b -133 -174 -126 -176 -130 -174 b -296 -12 -136 -173 -172 -137 l -308 0 l -337 -34 b -375 -77 -367 -73 -370 -76 b -382 -79 -377 -79 -379 -79 b -402 -58 -393 -79 -402 -69 b -401 -49 -402 -55 -402 -52 b -224 172 -398 -43 -228 167 b -219 173 -223 172 -220 173 "},v1f:{x_min:-340.28125,x_max:338.921875,ha:346,o:"m -32 520 b -29 521 -31 520 -31 521 b -23 519 -27 521 -24 520 b -20 513 -21 517 -20 516 b -21 506 -20 512 -20 509 b -31 474 -23 502 -27 488 l -53 402 l -66 352 l -68 349 l -57 349 b -32 351 -51 349 -40 351 b 123 370 19 352 74 359 b 137 371 127 370 133 371 b 170 356 152 371 164 366 b 171 355 170 355 170 355 b 216 366 174 355 183 358 b 280 378 268 377 266 377 b 287 378 283 378 284 378 b 332 349 307 378 322 369 b 338 319 336 341 338 330 b 332 301 338 310 336 302 b 242 280 329 299 246 280 b 242 280 242 280 242 280 b 235 288 236 280 235 283 b 235 292 235 290 235 291 b 236 302 236 297 236 299 b 220 337 236 316 230 330 l 216 340 l 210 335 b 159 276 189 322 172 301 b 118 149 152 265 156 274 b 81 34 84 36 85 36 b -8 13 78 33 -4 13 b -8 13 -8 13 -8 13 b -14 20 -12 15 -14 15 b -8 44 -14 24 -12 31 b -2 66 -5 55 -2 65 b -2 66 -2 66 -2 66 l -2 66 b -43 41 -2 66 -21 55 b -114 4 -98 8 -98 8 b -144 0 -123 0 -134 0 b -242 99 -197 0 -242 43 b -242 109 -242 102 -242 105 b -212 219 -240 122 -242 116 b -185 312 -197 270 -185 312 l -185 312 b -189 312 -185 312 -186 312 b -259 312 -200 312 -227 312 b -321 310 -291 312 -310 310 b -334 312 -330 310 -334 312 b -340 319 -338 313 -340 316 b -336 326 -340 322 -338 324 b -291 337 -334 326 -314 331 l -247 347 l -210 348 b -172 348 -190 348 -172 348 b -168 363 -172 348 -171 355 b -145 442 -151 424 -145 441 b -133 452 -144 444 -140 446 l -77 489 b -32 520 -53 506 -32 520 m 57 334 b 53 335 55 335 54 335 b 44 334 50 335 49 335 b -70 316 8 326 -28 320 b -78 309 -78 316 -78 316 b -108 202 -80 305 -88 274 b -141 81 -136 112 -141 93 b -140 74 -141 79 -141 77 b -117 49 -137 59 -127 49 b -107 52 -114 49 -110 51 b 16 127 -106 54 14 126 b 42 217 16 127 42 215 b 49 241 42 222 44 229 b 73 320 53 251 73 317 b 57 334 73 327 65 333 "},v20:{x_min:-571.671875,x_max:570.3125,ha:582,o:"m -559 351 b -551 352 -556 352 -553 352 b -530 338 -543 352 -533 348 b -529 169 -530 337 -529 291 l -529 1 l -507 27 l -441 112 b -382 174 -394 169 -390 174 b -378 174 -381 174 -379 174 b -281 86 -370 174 -375 179 b -196 0 -234 37 -196 0 b -126 84 -196 0 -164 37 b -50 174 -55 173 -57 172 b -44 174 -49 174 -47 174 b -35 173 -42 174 -38 173 b 53 86 -32 172 -12 151 b 138 0 100 37 138 0 b 208 84 140 0 170 37 b 284 174 279 173 279 172 b 289 174 285 174 288 174 b 300 173 294 174 298 173 b 462 11 303 172 340 134 l 475 -1 l 503 34 b 541 76 534 72 536 74 b 548 77 544 77 545 77 b 570 56 560 77 570 68 b 567 48 570 54 568 51 b 392 -172 564 41 397 -166 b 378 -176 387 -174 382 -176 b 368 -174 375 -176 371 -176 b 280 -87 367 -173 347 -152 b 194 0 234 -38 194 0 b 126 -86 194 0 163 -38 b 49 -174 54 -174 55 -173 b 44 -176 47 -176 46 -176 b 34 -174 40 -176 36 -174 b -54 -87 31 -173 10 -152 b -140 0 -102 -38 -140 0 b -209 -86 -140 0 -171 -38 b -285 -174 -280 -174 -279 -173 b -291 -176 -287 -176 -288 -176 b -300 -174 -294 -176 -298 -174 b -464 -11 -303 -173 -374 -102 l -476 0 l -506 -37 b -539 -76 -528 -65 -537 -74 b -551 -80 -543 -79 -547 -80 b -570 -68 -558 -80 -566 -76 l -571 -65 l -571 136 b -570 340 -571 331 -571 337 b -559 351 -568 344 -564 348 "},v22:{x_min:0,x_max:432.828125,ha:442,o:"m 209 186 b 213 187 210 187 212 187 b 216 187 215 187 216 187 b 224 174 216 186 220 180 b 420 -1 269 105 338 43 b 432 -12 431 -8 432 -9 b 421 -23 432 -15 432 -16 b 228 -180 345 -70 264 -137 b 219 -188 221 -188 221 -188 l 219 -188 b 208 -177 215 -188 215 -188 b 10 1 163 -106 93 -44 b 0 11 0 6 0 8 b 10 22 0 13 0 15 b 202 179 87 69 167 136 b 209 186 206 183 209 186 "},v23:{x_min:0,x_max:133.390625,ha:136,o:"m 54 66 b 65 68 58 68 61 68 b 122 37 88 68 110 56 b 133 -1 130 26 133 12 b 104 -58 133 -23 123 -44 b 66 -69 92 -65 78 -69 b 10 -38 44 -69 23 -58 b 0 -1 2 -27 0 -13 b 54 66 0 30 20 61 "},v25:{x_min:0,x_max:318.5,ha:325,o:"m 20 376 b 167 377 23 377 96 377 b 296 376 231 377 294 377 b 318 347 311 371 318 359 b 296 316 318 333 311 320 b 159 315 294 315 227 315 b 21 316 91 315 24 315 b 0 345 6 320 0 333 b 20 376 0 359 6 371 "},v26:{x_min:-21.78125,x_max:483.1875,ha:493,o:"m -8 631 b -1 632 -6 632 -4 632 b 19 620 8 632 16 628 b 20 383 20 616 20 616 l 20 148 l 21 151 b 140 199 59 183 102 199 b 206 179 164 199 187 192 l 210 176 l 210 396 l 210 617 l 212 621 b 231 632 216 628 223 632 b 250 620 239 632 247 628 b 251 383 251 616 251 616 l 251 148 l 254 151 b 370 199 291 183 332 199 b 415 191 385 199 400 197 b 483 84 458 176 483 134 b 461 0 483 58 476 29 b 332 -142 439 -40 411 -72 l 255 -215 b 231 -229 240 -229 239 -229 b 216 -223 224 -229 220 -227 b 210 -158 210 -217 210 -223 b 210 -120 210 -148 210 -136 l 210 -29 l 205 -34 b 100 -142 182 -65 159 -88 l 23 -215 b -1 -229 9 -229 6 -229 b -20 -216 -9 -229 -17 -224 l -21 -212 l -21 201 l -21 616 l -20 620 b -8 631 -17 624 -13 630 m 110 131 b 96 133 106 133 100 133 b 89 133 93 133 91 133 b 24 87 63 129 40 113 l 20 80 l 20 -37 l 20 -156 l 23 -152 b 144 81 96 -72 144 20 l 144 83 b 110 131 144 113 134 126 m 341 131 b 328 133 337 133 332 133 b 322 133 326 133 323 133 b 257 87 296 129 273 113 l 251 80 l 251 -37 l 251 -156 l 255 -152 b 375 81 328 -72 375 20 l 375 83 b 341 131 375 113 367 126 "},v27:{x_min:0,x_max:432.828125,ha:442,o:"m 208 184 b 213 187 209 186 212 187 b 224 176 217 187 221 183 b 245 147 225 172 235 159 b 419 -1 288 90 347 38 b 431 -8 424 -4 431 -8 b 432 -12 432 -9 432 -11 b 430 -18 432 -13 432 -16 b 364 -61 424 -20 383 -47 b 225 -183 307 -102 250 -152 b 223 -187 224 -184 223 -187 b 220 -188 221 -188 220 -188 b 208 -176 216 -188 210 -184 b 187 -148 205 -173 197 -159 b 12 0 144 -90 84 -38 b 0 11 4 5 0 8 b 16 24 0 13 4 18 b 183 158 83 69 141 115 b 208 184 194 169 198 173 m 183 105 b 176 113 181 109 176 113 b 172 109 176 113 175 112 b 92 45 149 90 117 62 l 88 41 l 102 31 b 247 -105 160 -6 210 -55 l 254 -115 l 257 -112 l 269 -102 b 340 -45 287 -87 319 -61 l 344 -43 l 330 -33 b 183 105 272 6 221 54 "},v28:{x_min:-73.5,x_max:72.140625,ha:74,o:"m -72 252 l -73 254 l 0 254 l 72 254 l 70 252 b 0 -1 70 248 0 -1 b -72 252 -1 -1 -72 248 "},v29:{x_min:-590.71875,x_max:589.359375,ha:601,o:"m 175 273 b 182 274 178 273 181 274 b 202 262 190 274 198 269 b 204 158 204 259 204 259 l 204 56 l 250 112 b 303 174 296 172 298 172 b 308 174 304 174 307 174 b 318 173 313 174 317 173 b 481 11 322 172 357 134 l 494 -1 l 522 34 b 560 76 553 72 555 74 b 567 77 563 77 564 77 b 589 56 579 77 589 68 b 586 48 589 54 588 51 b 411 -172 583 41 416 -166 b 397 -176 406 -174 401 -176 b 387 -174 393 -176 390 -176 b 299 -87 386 -173 366 -152 b 213 0 253 -38 213 0 b 208 -6 213 0 210 -2 l 204 -12 l 204 -147 b 204 -210 204 -173 204 -194 b 198 -292 204 -297 204 -287 b 183 -299 194 -297 189 -299 b 164 -287 175 -299 167 -295 b 163 -174 163 -284 163 -284 l 161 -63 l 119 -117 b 65 -176 76 -170 73 -176 b 61 -176 63 -176 62 -176 b -35 -87 51 -174 57 -180 b -121 0 -83 -38 -121 0 b -190 -86 -122 0 -152 -38 b -266 -174 -261 -174 -259 -173 b -272 -176 -268 -176 -270 -176 b -281 -174 -276 -176 -280 -174 b -371 -86 -284 -173 -304 -152 b -457 0 -417 -38 -457 0 l -457 0 b -477 -26 -457 0 -470 -16 b -548 -227 -524 -88 -548 -161 b -536 -303 -548 -254 -544 -280 b -533 -317 -534 -309 -533 -313 b -553 -338 -533 -330 -541 -338 b -577 -315 -566 -338 -571 -333 b -590 -227 -586 -287 -590 -258 b -518 -9 -590 -154 -564 -77 b -465 56 -509 2 -504 8 l -402 134 b -363 174 -374 170 -371 174 b -359 174 -362 174 -360 174 b -262 86 -351 174 -356 179 b -176 0 -216 37 -176 0 b -107 84 -176 0 -145 37 b -31 174 -36 173 -38 172 b -25 174 -29 174 -28 174 b -16 173 -23 174 -19 173 b 147 11 -13 172 35 123 l 157 -1 l 160 1 l 163 4 l 163 130 b 164 260 163 256 163 258 b 175 273 166 266 170 270 "},v2a:{x_min:-21.78125,x_max:366.140625,ha:374,o:"m 276 1378 b 284 1379 279 1379 281 1379 b 306 1360 292 1379 298 1374 b 352 1247 326 1326 343 1286 b 366 1139 362 1213 366 1175 b 347 1009 366 1093 359 1049 l 344 1002 l 347 992 b 352 971 348 986 351 977 b 366 863 362 936 366 899 b 347 732 366 818 359 773 l 344 725 l 347 716 b 352 695 348 710 351 700 b 366 588 362 659 366 623 b 223 262 366 464 314 345 b 189 233 212 252 212 252 b 35 76 126 183 73 129 b -1 16 20 56 2 27 b -19 4 -4 9 -12 4 l -21 4 l -21 137 l -21 270 l -17 270 b 186 344 59 281 134 308 b 319 606 270 399 319 499 b 317 650 319 620 319 635 l 315 659 l 314 655 b 223 537 288 607 258 570 b 189 509 212 528 212 528 b 35 352 126 459 73 405 b -1 292 20 333 2 303 b -19 280 -4 285 -12 280 l -21 280 l -21 413 l -21 546 l -17 546 b 186 620 59 557 134 584 b 319 882 270 675 319 775 b 317 925 319 896 319 911 l 315 935 l 314 931 b 223 813 288 884 258 846 b 189 785 212 805 212 805 b 35 628 126 735 73 681 b -1 569 20 609 2 580 b -19 556 -4 562 -12 556 l -21 556 l -21 689 l -21 823 l -17 823 b 202 907 68 835 152 867 b 319 1157 280 968 319 1061 b 270 1338 319 1218 303 1281 b 262 1358 264 1349 262 1353 b 262 1364 262 1360 262 1363 b 276 1378 265 1371 269 1376 "},v2c:{x_min:-597.53125,x_max:596.171875,ha:608,o:"m -413 173 b -408 174 -412 174 -409 174 b -397 173 -404 174 -400 173 b -308 86 -394 172 -374 151 b -223 0 -261 37 -223 0 b -153 84 -223 0 -191 37 b -77 174 -83 173 -84 172 b -72 174 -76 174 -74 174 b -62 173 -68 174 -63 173 b 25 86 -59 172 -39 151 b 112 0 73 37 111 0 b 181 84 112 0 144 37 b 257 174 251 173 251 172 b 262 174 258 174 261 174 b 273 173 266 174 270 173 b 436 9 276 172 347 101 l 447 -1 l 477 36 b 522 79 511 79 513 79 l 522 79 b 552 51 533 79 539 73 b 596 -112 582 6 596 -51 b 567 -262 596 -161 586 -213 b 539 -322 558 -287 544 -316 b 524 -327 534 -326 529 -327 b 504 -315 515 -327 507 -323 b 503 -308 503 -312 503 -309 b 511 -285 503 -302 504 -297 b 555 -113 540 -227 555 -169 b 544 -34 555 -86 551 -59 b 522 19 540 -16 530 8 l 521 22 l 481 -26 l 405 -122 b 353 -176 366 -172 362 -176 b 349 -176 352 -176 351 -176 b 253 -87 341 -176 347 -180 b 167 0 206 -38 167 0 b 99 -86 167 0 136 -38 b 21 -174 27 -174 28 -173 b 17 -176 20 -176 19 -176 b 6 -174 13 -176 9 -174 b -81 -87 4 -173 -14 -152 b -167 0 -129 -38 -167 0 b -236 -86 -167 0 -198 -38 b -313 -174 -307 -174 -306 -173 b -318 -176 -314 -176 -315 -176 b -328 -174 -321 -176 -325 -174 b -491 -12 -330 -173 -367 -137 l -503 0 l -530 -34 b -570 -77 -562 -73 -564 -76 b -577 -79 -571 -79 -574 -79 b -597 -58 -588 -79 -597 -69 b -596 -49 -597 -55 -597 -52 b -417 172 -593 -43 -423 167 b -413 173 -417 172 -415 173 "},v2d:{x_min:0,x_max:438.28125,ha:447,o:"m 212 190 b 219 191 213 191 216 191 b 236 176 225 191 228 190 b 419 18 277 105 341 49 b 436 5 431 13 434 11 b 438 -1 438 4 438 1 b 424 -16 438 -8 432 -13 b 356 -49 409 -20 379 -36 b 234 -180 306 -83 258 -133 b 219 -192 230 -188 224 -192 b 200 -176 213 -192 206 -187 b 9 -15 157 -102 89 -45 b 0 0 2 -12 0 -6 b 16 18 0 9 2 12 b 200 176 93 48 159 104 b 212 190 205 186 208 188 m 239 113 b 236 117 238 116 238 117 b 230 108 235 117 234 115 b 92 -15 196 58 140 8 b 88 -18 91 -16 88 -18 b 92 -20 88 -18 91 -19 b 198 -116 130 -43 166 -74 b 200 -117 200 -117 200 -117 b 201 -117 200 -117 201 -117 b 264 -43 212 -98 242 -62 b 345 15 288 -19 321 4 b 348 18 347 16 348 16 b 344 20 348 18 347 19 b 239 113 307 41 266 79 "},v2f:{x_min:-1.359375,x_max:680.5625,ha:694,o:"m 597 1042 b 604 1042 600 1042 602 1042 b 642 1002 627 1042 642 1022 b 619 966 642 988 635 974 b 439 927 574 942 503 927 l 426 927 l 426 921 b 430 838 428 893 430 866 b 345 480 430 696 398 560 b 179 391 307 423 249 391 b 156 392 171 391 164 392 b 138 394 149 394 142 394 b 103 434 115 396 103 416 b 129 471 103 451 111 466 b 141 474 133 473 137 474 b 172 459 153 474 164 469 b 181 455 175 456 176 455 b 187 456 182 455 185 455 b 253 520 212 460 234 483 b 315 836 294 605 315 714 b 311 928 315 867 314 898 b 302 945 310 943 311 942 b 245 953 283 950 262 953 b 130 891 193 953 149 931 b 84 860 119 870 102 860 b 36 905 61 860 39 877 b 36 910 36 907 36 909 b 80 970 36 931 50 949 b 249 1017 125 1000 187 1017 b 322 1009 273 1017 299 1014 l 341 1003 b 436 991 372 995 406 991 b 577 1031 495 991 545 1004 b 597 1042 583 1038 590 1041 m 416 360 b 424 360 419 360 421 360 b 481 309 454 360 479 338 b 503 145 484 280 495 199 b 585 -185 525 16 555 -106 b 630 -245 596 -213 613 -237 l 634 -247 l 638 -245 b 647 -244 641 -245 645 -244 b 680 -278 666 -244 680 -262 b 664 -308 680 -290 675 -301 b 638 -312 658 -310 650 -312 b 613 -309 631 -312 623 -310 b 477 -201 555 -303 502 -260 b 417 -2 460 -159 434 -72 b 416 5 417 1 416 5 b 416 5 416 5 416 5 b 411 -5 415 5 413 0 b 359 -97 397 -33 377 -70 b 353 -106 355 -102 353 -105 b 359 -112 353 -108 355 -109 b 409 -130 375 -123 390 -129 b 426 -134 420 -130 421 -131 b 431 -147 428 -137 431 -141 b 420 -162 431 -152 427 -159 b 382 -169 409 -166 396 -169 b 323 -155 363 -169 341 -165 l 317 -152 l 314 -155 b 62 -303 240 -240 148 -295 b 36 -305 55 -305 44 -305 b 23 -303 29 -305 24 -305 b -1 -273 6 -299 -1 -287 b 31 -240 -1 -256 10 -240 b 36 -240 32 -240 34 -240 b 42 -241 38 -241 39 -241 b 134 -204 63 -241 99 -226 b 367 288 265 -115 357 81 b 375 330 368 313 370 320 b 416 360 383 347 400 358 m 360 -359 b 379 -359 363 -359 371 -359 b 424 -360 396 -359 416 -359 b 646 -502 536 -373 624 -430 b 649 -527 649 -510 649 -519 b 530 -673 649 -578 604 -635 l 521 -677 l 529 -681 b 653 -811 592 -714 637 -762 b 660 -853 658 -827 660 -839 b 645 -911 660 -873 656 -892 b 426 -1021 608 -981 519 -1021 b 283 -989 377 -1021 328 -1011 b 235 -949 249 -972 239 -964 b 234 -936 234 -946 234 -941 b 234 -928 234 -934 234 -931 l 235 -925 l 234 -927 l 225 -934 b 87 -982 186 -966 138 -982 b 80 -982 85 -982 83 -982 b 55 -981 70 -981 58 -981 b 17 -943 32 -981 17 -964 b 54 -904 17 -921 35 -904 b 78 -914 62 -904 72 -909 l 83 -918 l 88 -918 b 190 -831 122 -918 166 -881 b 269 -506 242 -727 269 -612 b 268 -462 269 -492 269 -477 b 266 -449 266 -458 266 -452 b 265 -444 266 -445 266 -444 b 257 -446 264 -444 261 -445 b 132 -545 196 -470 152 -505 b 88 -573 122 -563 104 -573 b 39 -523 63 -573 39 -553 b 63 -476 39 -505 44 -494 b 360 -359 136 -408 235 -369 m 419 -424 b 393 -423 411 -423 406 -423 l 375 -423 l 377 -426 b 379 -439 377 -427 378 -434 b 383 -510 382 -463 383 -487 b 314 -811 383 -609 360 -710 b 266 -893 296 -850 285 -870 b 264 -898 265 -896 264 -898 l 264 -898 b 264 -898 264 -898 264 -898 b 268 -898 264 -898 266 -898 b 273 -898 270 -898 272 -898 b 300 -909 283 -898 291 -900 b 426 -957 340 -941 385 -957 b 476 -949 443 -957 460 -954 b 547 -853 522 -931 547 -893 b 485 -745 547 -816 526 -775 b 397 -707 460 -727 432 -714 b 366 -675 375 -703 366 -692 b 396 -642 366 -657 377 -645 b 530 -557 455 -637 511 -601 b 536 -527 534 -548 536 -537 b 419 -424 536 -480 490 -437 "},v30:{x_min:-21.78125,x_max:367.5,ha:375,o:"m 276 1900 b 284 1901 279 1900 281 1901 b 306 1883 291 1901 298 1896 b 367 1686 347 1825 367 1757 b 343 1558 367 1643 359 1600 l 338 1549 l 343 1537 b 367 1411 359 1497 367 1454 b 343 1282 367 1367 359 1324 l 338 1272 l 343 1261 b 367 1135 359 1221 367 1178 b 343 1007 367 1090 359 1047 l 338 996 l 343 985 b 367 859 359 945 367 902 b 343 731 367 814 359 771 l 338 720 l 343 709 b 367 582 359 667 367 626 b 289 362 367 503 340 426 b 239 312 276 345 259 330 b 29 77 152 237 76 152 b -1 18 14 54 2 30 b -19 4 -4 11 -12 4 l -21 4 l -21 133 l -20 260 l -13 262 b 98 299 17 269 62 284 b 111 305 103 302 110 305 b 167 334 123 310 156 327 b 319 595 264 391 319 491 b 313 659 319 616 318 638 b 310 667 311 664 311 667 b 307 663 310 667 308 666 b 240 588 289 637 269 614 b 16 331 141 505 62 413 b -1 294 8 316 1 302 b -19 280 -4 287 -12 280 l -21 280 l -21 408 l -20 537 l -13 538 b 98 576 17 545 62 560 b 111 581 103 578 110 581 b 167 610 123 587 156 603 b 319 871 264 667 319 767 b 313 935 319 892 318 913 b 310 942 311 941 311 942 b 307 939 310 942 308 941 b 240 864 289 913 269 889 b 16 607 141 781 62 689 b -1 570 8 592 1 578 b -19 556 -4 563 -12 556 l -21 556 l -21 684 l -20 813 l -13 814 b 98 852 17 821 62 836 b 111 857 103 855 110 857 b 167 886 123 863 156 880 b 319 1147 264 943 319 1043 b 313 1211 319 1168 318 1189 b 310 1218 311 1217 311 1218 b 307 1215 310 1218 308 1217 b 240 1140 289 1188 269 1165 b 16 884 141 1057 62 966 b -1 846 8 868 1 855 b -19 832 -4 839 -12 832 l -21 832 l -21 960 l -20 1089 l -13 1090 b 98 1128 17 1097 62 1111 b 111 1134 103 1131 110 1134 b 167 1163 123 1139 156 1156 b 319 1424 264 1220 319 1320 b 313 1486 319 1444 318 1465 b 310 1494 311 1493 311 1494 b 307 1492 310 1494 308 1493 b 240 1417 289 1464 269 1442 b 16 1160 141 1333 62 1242 b -1 1121 8 1145 1 1131 b -19 1109 -4 1115 -12 1109 l -21 1109 l -21 1236 l -20 1365 l -13 1367 b 98 1404 17 1374 62 1388 b 111 1410 103 1407 110 1410 b 250 1508 172 1437 215 1467 b 319 1701 296 1564 319 1633 b 270 1859 319 1757 303 1814 b 262 1882 265 1868 262 1875 b 276 1900 262 1890 266 1896 "},v31:{x_min:0,x_max:386.5625,ha:394,o:"m 0 173 l 0 347 l 193 347 l 386 347 l 386 173 l 386 0 l 193 0 l 0 0 l 0 173 "},v33:{x_min:-423.3125,x_max:421.9375,ha:431,o:"m -10 276 b -2 277 -8 277 -5 277 b 17 265 5 277 13 273 b 19 163 19 260 19 260 l 19 68 l 39 45 b 277 -95 122 -34 200 -81 b 289 -97 281 -97 285 -97 b 378 0 332 -97 371 -54 b 378 11 378 4 378 6 b 302 83 378 55 345 83 b 242 66 283 83 262 77 b 208 56 231 59 219 56 b 148 120 175 56 148 81 b 200 186 148 151 164 172 b 261 198 220 194 240 198 b 420 45 341 198 411 137 b 421 22 421 37 421 29 b 257 -198 421 -86 347 -188 b 242 -198 251 -198 247 -198 b 20 -105 181 -198 95 -163 l 19 -104 l 19 -183 b 19 -216 19 -195 19 -206 b 12 -273 19 -272 17 -267 b -2 -278 8 -277 2 -278 b -21 -266 -10 -278 -19 -274 b -23 -165 -23 -263 -23 -262 l -23 -69 l -44 -47 b -250 86 -117 23 -183 66 b -295 94 -270 93 -284 94 b -315 91 -302 94 -308 94 b -381 5 -356 81 -381 43 b -355 -56 -381 -16 -372 -40 b -299 -81 -338 -73 -319 -81 b -246 -68 -283 -81 -265 -77 b -212 -58 -234 -61 -223 -58 b -168 -77 -196 -58 -179 -65 b -151 -122 -156 -90 -151 -105 b -179 -174 -151 -141 -160 -162 b -239 -195 -194 -184 -217 -192 b -257 -197 -245 -195 -250 -197 b -423 -5 -349 -197 -423 -113 b -423 0 -423 -4 -423 -1 b -277 194 -420 97 -362 173 b -247 197 -268 197 -258 197 b -24 104 -185 197 -100 162 l -23 102 l -23 181 b -21 265 -23 260 -23 260 b -10 276 -20 269 -14 274 "},v34:{x_min:0,x_max:622.03125,ha:635,o:"m 398 417 b 406 419 401 419 404 419 b 427 398 417 419 427 409 b 427 391 427 395 427 392 b 34 -274 424 385 38 -272 b 20 -280 29 -278 25 -280 b 0 -259 9 -280 0 -270 b 0 -252 0 -256 0 -254 b 393 413 2 -247 389 410 b 398 417 394 415 397 416 m 592 417 b 600 419 594 419 597 419 b 622 398 611 419 622 409 b 620 391 622 395 620 392 b 227 -274 617 385 231 -272 b 213 -280 223 -278 219 -280 b 193 -259 202 -280 193 -270 b 194 -252 193 -256 193 -254 b 586 413 196 -247 582 410 b 592 417 588 415 590 416 "},v36:{x_min:-1.359375,x_max:1064.390625,ha:1086,o:"m 296 692 b 314 694 302 694 307 694 b 386 685 337 694 366 689 b 548 498 480 660 548 580 b 548 481 548 492 548 487 b 455 395 541 426 499 395 b 370 462 420 395 383 417 b 362 496 364 477 362 488 b 377 514 362 509 367 514 b 393 501 386 514 390 510 b 432 474 397 484 413 474 b 470 487 445 474 458 478 b 491 530 484 496 491 510 b 490 544 491 534 491 539 b 333 660 479 606 411 657 l 323 662 l 315 646 b 269 524 285 591 269 556 b 321 431 269 492 287 466 b 349 395 338 413 343 408 b 363 342 359 378 363 362 b 359 312 363 333 362 322 b 285 158 348 266 318 206 b 281 152 283 155 281 152 b 281 152 281 152 281 152 b 287 154 283 152 284 152 b 318 155 298 154 308 155 b 461 98 371 155 419 136 l 464 97 l 483 112 b 503 129 494 120 503 127 b 504 130 503 129 504 129 b 503 138 504 131 503 134 b 500 180 500 152 500 166 b 553 326 500 238 518 288 b 604 366 560 331 592 358 b 649 381 617 376 632 381 b 696 362 665 381 681 374 b 724 302 714 347 724 324 b 695 238 724 278 714 255 b 660 210 691 234 662 212 b 579 148 658 209 582 151 b 579 148 579 148 579 148 b 596 106 579 144 589 119 b 622 77 604 88 609 83 b 657 69 632 72 645 69 b 748 112 688 69 721 84 b 755 123 754 117 755 120 b 755 127 755 124 755 126 b 751 165 752 137 751 151 b 758 219 751 183 754 202 b 894 387 774 290 820 347 b 896 390 896 388 896 388 b 891 398 896 391 895 392 b 622 560 827 477 730 535 b 600 580 605 564 600 569 b 617 596 600 591 607 596 b 628 595 622 596 624 596 b 1057 248 846 552 1020 412 b 1064 191 1061 229 1064 209 b 922 0 1064 94 1005 9 b 902 -1 916 -1 909 -1 b 774 76 847 -1 800 26 b 769 83 770 81 770 83 b 769 81 769 83 769 83 b 627 -1 733 29 677 -1 b 548 27 597 -1 570 8 b 515 88 537 37 525 61 l 513 95 l 510 93 l 453 45 b 390 0 396 0 396 0 b 390 0 390 0 390 0 b 374 15 381 0 377 4 b 268 105 359 69 314 105 b 250 104 262 105 257 105 l 243 102 l 234 90 b 155 1 201 49 159 2 b 147 -1 152 0 149 -1 b 130 15 138 -1 130 6 b 132 20 130 18 132 19 b 136 31 133 22 134 27 b 220 131 149 74 178 109 b 231 137 225 134 230 136 b 302 278 280 202 302 244 b 265 335 302 299 295 309 b 209 442 234 363 213 402 b 209 455 209 446 209 451 b 279 648 209 502 232 564 l 285 659 l 283 659 b 176 627 238 653 210 645 b 57 477 111 594 66 538 b 55 459 55 471 55 464 b 72 409 55 437 61 415 b 93 403 78 405 87 403 b 152 467 123 403 151 431 b 168 488 153 483 157 488 b 185 462 181 488 185 483 l 185 460 b 137 344 183 409 168 369 b 78 322 119 328 98 322 b 13 360 50 322 25 335 b -1 426 4 380 -1 402 b 89 610 -1 488 32 559 b 296 692 147 659 210 685 m 926 348 b 921 353 924 351 922 353 b 914 348 920 353 918 351 b 823 167 857 306 823 237 b 828 124 823 154 826 138 b 890 31 837 79 862 40 b 896 31 892 31 894 31 b 956 104 916 31 940 59 b 970 191 965 129 970 159 b 966 241 970 208 969 224 b 926 348 959 277 945 313 m 627 326 b 619 326 624 326 622 326 b 598 316 611 326 604 323 b 568 215 579 288 568 255 b 568 208 568 213 568 210 b 571 183 570 195 570 184 l 571 183 b 594 201 571 183 582 191 l 634 231 b 660 259 653 247 656 248 b 664 278 662 266 664 272 b 627 326 664 299 649 320 "},v38:{x_min:-1.359375,x_max:651.96875,ha:665,o:"m 389 644 b 405 645 394 645 400 645 b 504 566 450 645 492 613 b 507 541 506 557 507 549 b 480 471 507 514 498 489 l 477 467 l 483 470 b 609 591 539 485 586 531 b 613 601 611 595 613 599 b 631 609 619 607 624 609 b 651 588 641 609 651 602 b 200 -946 651 584 204 -941 b 182 -957 197 -953 190 -957 b 163 -945 174 -957 166 -953 b 161 -939 161 -942 161 -942 b 217 -743 161 -931 170 -904 b 272 -555 247 -639 272 -555 b 272 -555 272 -555 272 -555 b 264 -560 272 -555 268 -557 b 140 -603 227 -589 182 -603 b 36 -567 102 -603 65 -592 b -1 -487 12 -548 -1 -517 b 17 -427 -1 -466 5 -445 b 103 -380 38 -395 70 -380 b 191 -433 137 -380 172 -398 b 205 -484 201 -448 205 -466 b 178 -553 205 -509 196 -535 l 175 -557 l 182 -555 b 307 -435 236 -539 284 -494 b 372 -213 308 -430 372 -215 b 372 -213 372 -213 372 -213 b 364 -219 372 -213 368 -216 b 240 -262 328 -247 283 -262 b 137 -226 202 -262 166 -249 b 99 -145 112 -206 99 -176 b 118 -84 99 -124 106 -104 b 204 -38 138 -54 171 -38 b 292 -91 238 -38 273 -56 b 306 -141 302 -106 306 -124 b 279 -212 306 -167 296 -194 l 276 -215 l 281 -213 b 408 -93 336 -198 385 -151 b 473 129 409 -88 473 127 b 473 129 473 129 473 129 b 465 122 473 129 469 126 b 341 80 428 94 383 80 b 236 115 303 80 266 91 b 200 195 213 136 200 165 b 217 256 200 217 206 238 b 304 303 239 287 272 303 b 393 249 338 303 374 285 b 406 199 402 234 406 217 b 379 129 406 173 397 148 l 377 126 l 382 127 b 509 248 436 142 485 190 b 574 470 510 254 574 469 b 574 470 574 470 574 470 b 566 464 574 470 570 467 b 442 421 529 435 484 421 b 337 458 404 421 367 433 b 300 537 313 478 300 508 b 389 644 300 585 334 635 "},v39:{x_min:-171.5,x_max:251.8125,ha:257,o:"m -8 631 b -1 632 -6 632 -4 632 b 19 620 8 632 16 628 b 20 553 20 616 20 614 b 20 491 20 503 20 491 l 20 491 b 153 535 47 501 149 535 b 174 514 167 535 174 524 b 164 496 174 508 171 501 b 92 470 164 495 132 484 l 20 445 l 20 390 b 20 363 20 378 20 370 b 20 333 20 340 20 333 l 20 333 b 153 377 47 344 149 377 b 174 356 167 377 174 367 b 164 338 174 349 171 342 b 92 312 164 338 132 326 l 20 288 l 20 219 l 20 148 l 21 151 b 137 199 59 183 99 199 b 182 191 152 199 167 197 b 251 84 227 176 251 134 b 228 0 251 58 243 29 b 100 -142 206 -40 178 -72 l 23 -215 b -1 -229 9 -229 6 -229 b -20 -216 -9 -229 -17 -224 b -21 30 -21 -212 -21 -212 b -21 273 -21 163 -21 273 b -84 252 -21 273 -50 263 b -152 230 -133 234 -145 230 b -157 231 -155 230 -156 231 b -171 252 -166 234 -171 244 b -160 270 -171 259 -167 266 b -27 316 -159 270 -93 294 l -21 319 l -21 374 b -21 431 -21 406 -21 431 b -84 409 -21 431 -50 421 b -152 388 -133 392 -145 388 b -157 390 -155 388 -156 388 b -171 409 -166 392 -171 401 b -160 428 -171 417 -167 424 b -27 474 -159 428 -93 451 l -21 476 l -21 546 b -20 620 -21 614 -21 616 b -8 631 -17 624 -13 630 m 110 131 b 96 133 106 133 100 133 b 89 133 93 133 91 133 b 24 87 63 129 40 113 l 20 80 l 20 -37 l 20 -156 l 23 -152 b 144 81 96 -72 144 20 l 144 83 b 110 131 144 113 134 126 "},v3b:{x_min:0,x_max:484.5625,ha:494,o:"m 228 245 b 239 247 234 247 239 247 b 243 247 240 247 242 247 b 303 238 257 247 287 242 b 484 -2 417 208 484 104 b 412 -177 484 -65 461 -127 b 243 -248 363 -226 303 -248 b 6 -63 138 -248 36 -180 b 0 -1 1 -41 0 -20 b 228 245 0 127 98 240 m 255 181 b 240 183 247 183 245 183 b 232 181 238 183 235 183 b 142 152 200 180 168 170 l 138 149 l 190 97 l 242 44 l 294 97 l 345 149 l 340 152 b 255 181 315 169 284 180 m 147 -54 l 197 -1 l 147 51 l 95 104 l 91 99 b 62 -1 72 70 62 34 b 66 -43 62 -15 63 -29 b 91 -101 72 -63 80 -84 l 95 -106 l 147 -54 m 393 99 b 389 104 390 102 389 104 b 337 51 389 104 366 80 l 285 -1 l 337 -54 l 389 -106 l 393 -101 b 421 -1 412 -72 421 -36 b 393 99 421 34 412 69 m 294 -98 b 242 -45 265 -69 242 -45 b 190 -98 242 -45 219 -69 l 138 -151 l 142 -154 b 242 -184 172 -174 206 -184 b 340 -154 276 -184 311 -174 l 345 -151 l 294 -98 "},v3c:{x_min:0,x_max:450.53125,ha:460,o:"m 189 302 b 204 303 193 302 198 303 b 303 224 250 303 292 270 b 306 199 304 216 306 208 b 279 129 306 173 296 147 l 276 126 l 281 127 b 408 249 337 142 385 190 b 412 259 409 254 412 258 b 430 267 417 265 423 267 b 450 247 441 267 450 259 b 200 -605 450 242 204 -599 b 182 -616 197 -612 190 -616 b 163 -602 174 -616 166 -610 b 161 -598 161 -601 161 -601 b 217 -402 161 -589 170 -562 b 272 -213 247 -298 272 -213 b 272 -213 272 -213 272 -213 b 264 -219 272 -213 268 -216 b 140 -262 227 -247 182 -262 b 36 -226 102 -262 65 -249 b 0 -145 12 -206 0 -176 b 17 -84 0 -124 5 -104 b 103 -38 38 -54 70 -38 b 191 -91 137 -38 172 -56 b 205 -141 201 -106 205 -124 b 178 -212 205 -167 196 -194 l 175 -215 l 182 -213 b 307 -93 236 -198 284 -151 b 372 129 308 -88 372 127 b 372 129 372 129 372 129 b 364 122 372 129 368 126 b 240 80 328 94 283 80 b 137 115 202 80 166 91 b 99 194 111 136 99 165 b 189 302 99 244 133 292 "},v3e:{x_min:0,x_max:406.96875,ha:415,o:"m 21 183 b 28 183 24 183 25 183 b 42 181 34 183 39 183 b 127 108 47 179 47 179 b 202 41 168 72 202 41 b 279 108 204 41 238 72 b 357 177 321 145 356 176 b 375 183 363 181 370 183 b 406 151 392 183 406 169 b 404 137 406 147 405 141 b 322 62 401 131 398 129 b 251 0 284 27 251 0 b 322 -63 251 -1 284 -29 b 404 -138 398 -130 401 -133 b 406 -152 405 -142 406 -148 b 375 -184 406 -170 392 -184 b 357 -179 370 -184 363 -183 b 279 -109 356 -177 321 -147 b 202 -43 238 -73 204 -43 b 127 -109 202 -43 168 -73 b 49 -179 85 -147 50 -177 b 31 -184 43 -183 36 -184 b 0 -152 13 -184 0 -170 b 2 -138 0 -148 0 -142 b 83 -63 5 -133 8 -130 b 155 0 122 -29 155 -1 b 83 62 155 0 122 27 b 8 129 43 97 10 127 b 0 151 2 136 0 144 b 21 183 0 165 8 177 "},v3f:{x_min:-24.5,x_max:317.140625,ha:324,o:"m -24 -147 l -24 -5 l -20 -5 b -1 -19 -12 -5 -4 -11 b 58 -123 6 -43 31 -86 b 196 -278 93 -173 134 -219 b 317 -570 274 -356 317 -460 b 294 -713 317 -617 308 -666 l 289 -724 l 294 -735 b 317 -873 308 -780 317 -827 b 235 -1132 317 -963 288 -1054 b 209 -1165 228 -1140 224 -1146 b 189 -1177 204 -1172 196 -1177 b 171 -1164 182 -1177 175 -1172 b 168 -1154 170 -1161 168 -1159 b 181 -1132 168 -1149 172 -1142 b 269 -891 238 -1064 269 -975 b 269 -881 269 -886 269 -884 b 262 -814 269 -857 265 -827 b 258 -800 261 -811 259 -806 b 142 -628 240 -731 198 -667 b -8 -589 112 -606 47 -589 b -20 -589 -13 -589 -19 -589 l -24 -589 l -24 -449 l -24 -308 l -20 -308 b -1 -322 -12 -308 -4 -313 b 58 -424 6 -345 31 -388 b 194 -580 93 -476 136 -523 b 259 -660 221 -606 245 -635 b 261 -663 259 -662 261 -663 b 264 -656 262 -663 262 -660 b 269 -587 268 -632 269 -610 b 264 -521 269 -566 268 -544 b 262 -512 264 -517 262 -513 b 258 -498 261 -509 259 -503 b 142 -326 240 -428 198 -365 b -8 -287 112 -303 47 -288 b -20 -287 -13 -287 -19 -287 l -24 -287 l -24 -147 "},v40:{x_min:-1.359375,x_max:436.921875,ha:446,o:"m 213 205 b 217 205 215 205 216 205 b 234 194 224 205 234 199 b 236 187 234 194 235 190 l 245 167 l 261 129 l 270 106 b 355 -61 294 54 329 -13 b 420 -163 381 -105 402 -138 b 436 -188 435 -184 436 -184 b 436 -191 436 -190 436 -190 b 421 -206 436 -201 431 -206 l 421 -206 l 416 -206 l 405 -201 b 217 -158 347 -172 283 -158 b 31 -201 153 -158 88 -172 l 20 -206 l 14 -206 l 14 -206 b 0 -191 5 -206 0 -201 b -1 -188 0 -190 -1 -190 b 14 -163 -1 -186 0 -184 b 95 -34 36 -136 72 -77 b 166 106 119 8 148 68 l 175 129 l 183 148 l 200 188 b 213 205 205 199 208 202 "},v41:{x_min:-1.359375,x_max:556.6875,ha:568,o:"m 294 322 b 318 323 299 322 308 323 b 360 320 334 323 352 322 b 526 217 430 310 490 273 b 543 166 537 202 543 184 b 447 70 543 117 503 70 b 445 70 447 70 446 70 b 359 159 394 72 359 113 b 368 201 359 173 362 187 b 442 245 382 229 412 245 b 455 244 446 245 451 245 b 460 244 458 244 460 244 b 460 244 460 244 460 244 b 454 248 460 244 458 245 b 325 291 417 276 372 291 b 285 287 313 291 299 290 b 144 -2 183 269 144 190 b 281 -290 144 -208 179 -280 b 304 -291 289 -291 298 -291 b 524 -105 412 -291 506 -212 b 541 -84 526 -88 530 -84 b 556 -101 551 -84 556 -90 b 549 -138 556 -111 553 -122 b 334 -322 521 -237 435 -310 b 302 -324 323 -323 313 -324 b 13 -101 172 -324 54 -234 b -1 -1 4 -68 -1 -34 b 294 322 -1 161 121 303 "},v42:{x_min:-348.4375,x_max:24.5,ha:25,o:"m -330 155 b -322 156 -329 156 -326 156 b -315 156 -319 156 -317 156 b -298 147 -311 155 -308 154 b -19 30 -224 98 -122 55 l 2 26 b 24 -1 17 22 24 13 b 2 -27 24 -15 17 -23 l -19 -31 b -298 -148 -122 -56 -224 -99 b -322 -158 -313 -158 -315 -158 b -348 -131 -338 -158 -348 -145 b -344 -117 -348 -127 -347 -122 b -328 -104 -341 -112 -338 -111 b -127 -8 -269 -65 -202 -33 b -106 0 -115 -4 -106 -1 b -127 6 -106 0 -115 2 b -328 102 -202 31 -269 63 b -344 116 -338 109 -341 111 b -348 130 -347 120 -348 124 b -330 155 -348 141 -341 152 "},v43:{x_min:-442.359375,x_max:441,ha:450,o:"m -31 487 b -1 488 -21 488 -10 488 b 434 104 216 488 397 330 b 441 27 438 79 441 47 b 439 12 441 20 439 15 b 419 0 435 4 427 0 b 404 5 413 0 408 1 b 398 30 400 11 398 13 b 0 351 390 213 213 351 b -59 348 -20 351 -39 349 b -400 30 -251 324 -393 191 b -405 5 -400 13 -401 11 b -420 0 -409 1 -415 0 b -441 12 -428 0 -436 4 b -442 27 -441 15 -442 20 b -435 104 -442 47 -439 79 b -31 487 -401 316 -235 474 m -13 131 b -1 133 -9 133 -5 133 b 51 105 19 133 39 123 b 61 70 58 95 61 83 b 51 34 61 58 58 45 b -1 6 39 16 19 6 b -46 27 -17 6 -34 13 b -62 69 -57 38 -62 54 b -13 131 -62 98 -44 124 "},v44:{x_min:-21.78125,x_max:251.8125,ha:257,o:"m -8 631 b -1 632 -6 632 -4 632 b 19 620 8 632 16 628 b 20 383 20 616 20 616 l 20 148 l 21 151 b 137 199 59 183 99 199 b 182 191 152 199 167 197 b 251 84 227 176 251 134 b 228 0 251 58 243 29 b 100 -142 206 -40 178 -72 l 23 -215 b 0 -229 9 -229 6 -229 b -20 -216 -9 -229 -17 -224 l -21 -212 l -21 201 l -21 616 l -20 620 b -8 631 -17 624 -13 630 m 110 131 b 96 133 106 133 100 133 b 89 133 93 133 91 133 b 24 87 63 129 40 113 l 20 80 l 20 -37 l 20 -156 l 23 -152 b 144 81 96 -72 144 20 l 144 83 b 110 131 144 113 134 126 "},v45:{x_min:-402.890625,x_max:401.53125,ha:410,o:"m -10 273 b -4 274 -9 273 -6 274 b 16 262 4 274 12 269 b 17 158 17 259 17 259 l 17 56 l 62 112 b 117 174 110 172 110 172 b 122 174 118 174 119 174 b 132 173 125 174 129 173 b 295 11 134 172 171 134 l 307 -1 l 336 34 b 374 76 366 72 368 74 b 381 77 375 77 378 77 b 401 56 392 77 401 68 b 400 48 401 54 401 51 b 223 -172 397 41 230 -166 b 210 -176 220 -174 215 -176 b 201 -174 206 -176 204 -176 b 112 -87 198 -173 178 -152 b 27 0 65 -38 27 0 b 21 -6 27 0 24 -2 l 17 -12 l 17 -147 b 17 -210 17 -173 17 -194 b 10 -292 17 -297 16 -287 b -2 -299 6 -297 2 -299 b -21 -287 -10 -299 -19 -295 b -24 -174 -23 -284 -23 -284 l -24 -63 l -66 -117 b -121 -176 -110 -170 -114 -176 b -125 -176 -122 -176 -123 -176 b -296 -12 -134 -174 -125 -184 l -308 0 l -337 -34 b -375 -77 -367 -73 -370 -76 b -382 -79 -377 -79 -379 -79 b -402 -58 -393 -79 -402 -69 b -401 -49 -402 -55 -402 -52 b -224 170 -398 -43 -231 165 b -212 174 -221 173 -216 174 b -202 173 -208 174 -205 174 b -39 11 -200 172 -151 122 l -28 -1 l -25 1 l -24 4 l -24 130 b -23 260 -24 256 -24 258 b -10 273 -20 266 -16 270 "},v46:{x_min:0,x_max:627.46875,ha:640,o:"m 306 190 b 314 191 308 191 311 191 b 326 184 318 191 322 190 l 336 173 b 510 52 377 127 442 80 b 515 49 513 51 515 49 b 611 16 537 40 579 24 b 627 0 624 13 627 9 b 607 -18 627 -11 624 -13 b 330 -181 490 -49 389 -109 b 314 -192 323 -190 319 -192 b 306 -191 311 -192 308 -192 b 294 -177 302 -188 302 -188 b 257 -140 287 -170 265 -148 b 19 -18 193 -84 114 -44 b 0 0 2 -13 0 -11 b 16 16 0 9 2 13 b 110 49 47 24 89 40 b 117 52 111 49 114 51 b 145 65 126 56 130 58 b 281 163 200 93 245 124 b 300 186 288 170 291 174 b 306 190 300 187 303 188 m 317 137 b 313 142 315 141 314 142 b 308 137 313 142 311 141 b 161 4 276 84 220 33 b 155 0 159 1 155 0 b 163 -4 155 0 159 -2 b 308 -138 220 -34 276 -84 b 313 -142 311 -141 313 -142 b 317 -138 314 -142 315 -141 b 464 -4 351 -84 406 -34 b 470 0 468 -2 470 0 b 464 4 470 0 468 1 b 317 137 406 33 351 84 "},v47:{x_min:-24.5,x_max:315.78125,ha:322,o:"m -24 -145 l -24 -5 l -20 -5 b 1 -26 -10 -5 -6 -9 b 175 -241 31 -86 96 -166 b 314 -548 259 -323 304 -420 b 315 -589 315 -555 315 -571 b 314 -630 315 -606 315 -623 b 298 -730 311 -664 306 -699 l 295 -742 l 296 -748 b 314 -850 304 -778 311 -813 b 315 -892 315 -857 315 -874 b 314 -932 315 -909 315 -925 b 298 -1032 311 -967 306 -1002 l 295 -1045 l 296 -1050 b 314 -1153 304 -1081 311 -1115 b 315 -1193 315 -1160 315 -1177 b 314 -1235 315 -1211 315 -1228 b 217 -1526 306 -1338 270 -1444 b 201 -1533 213 -1532 208 -1533 b 182 -1522 193 -1533 185 -1529 b 179 -1514 181 -1518 179 -1517 b 189 -1489 179 -1508 182 -1501 b 266 -1217 240 -1403 266 -1308 b 262 -1156 266 -1196 265 -1177 b 110 -907 247 -1043 190 -950 b 0 -889 87 -895 50 -889 l -1 -889 l -24 -889 l -24 -749 l -24 -610 l -20 -610 b 1 -631 -10 -610 -6 -614 b 175 -846 31 -691 96 -771 b 259 -956 213 -884 236 -914 b 265 -966 262 -961 264 -966 b 265 -966 265 -966 265 -966 b 265 -953 265 -964 265 -959 b 266 -920 266 -943 266 -932 b 262 -853 266 -898 265 -873 b 110 -605 247 -741 190 -648 b 0 -587 87 -592 50 -587 l -1 -587 l -24 -587 l -24 -448 l -24 -308 l -20 -308 b 1 -328 -10 -308 -6 -312 b 175 -544 31 -388 96 -469 b 259 -655 213 -581 236 -612 b 265 -663 262 -659 264 -663 b 265 -663 265 -663 265 -663 b 265 -650 265 -663 265 -657 b 266 -617 266 -641 266 -630 b 262 -551 266 -595 265 -570 b 110 -303 247 -438 190 -345 b 0 -284 87 -290 50 -284 l -1 -284 l -24 -284 l -24 -145 "},v49:{x_min:0,x_max:630.203125,ha:643,o:"m 308 204 b 314 205 310 205 313 205 b 326 201 319 205 323 204 b 355 154 328 199 338 180 b 401 83 362 142 392 95 l 409 72 b 431 41 412 66 424 49 b 619 -174 498 -51 570 -134 b 630 -192 626 -180 630 -186 b 626 -202 630 -195 628 -199 b 616 -206 623 -205 620 -206 b 552 -188 608 -206 592 -202 b 310 -155 488 -169 392 -155 b 268 -156 295 -155 281 -155 b 77 -188 197 -161 126 -173 b 13 -206 35 -202 20 -206 b 9 -206 12 -206 10 -206 b 0 -191 2 -202 0 -197 b 8 -176 0 -186 2 -180 b 204 49 58 -136 138 -43 l 220 72 l 227 83 b 295 188 245 108 281 166 b 308 204 299 197 304 202 m 315 147 b 314 147 315 147 314 147 b 314 147 314 147 314 147 b 306 129 314 145 310 138 l 296 105 b 281 72 292 97 284 77 l 274 56 b 181 -123 247 -4 212 -72 l 174 -134 l 176 -133 b 314 -123 215 -127 272 -123 b 451 -133 356 -123 413 -127 l 454 -134 l 449 -123 b 353 56 417 -72 381 -4 l 347 72 b 332 105 344 77 336 97 l 322 129 b 315 147 318 138 315 145 "},v4a:{x_min:70.78125,x_max:378.390625,ha:315,o:"m 246 373 b 254 373 249 373 251 373 b 372 324 303 373 360 351 b 378 302 377 317 378 309 b 338 251 378 278 362 255 b 328 249 334 249 332 249 b 283 294 303 249 283 270 b 288 315 283 301 284 308 b 289 319 289 317 289 319 b 289 319 289 319 289 319 b 283 320 289 320 287 320 b 270 322 279 322 274 322 b 206 288 242 322 215 308 b 206 283 206 287 206 285 b 257 223 206 267 230 238 b 284 206 272 213 277 210 b 351 90 328 173 351 130 b 340 47 351 74 348 59 b 205 -30 314 -2 264 -30 b 182 -29 198 -30 190 -30 b 84 15 147 -24 103 -5 b 70 48 74 24 70 36 b 108 99 70 70 85 94 b 121 102 112 101 117 102 b 167 56 147 102 167 80 b 159 31 167 48 164 40 l 156 26 l 157 26 b 190 20 167 22 178 20 b 220 26 201 20 212 22 b 258 65 243 34 258 51 b 257 70 258 66 258 69 b 204 126 249 94 234 109 b 114 258 148 158 114 209 b 125 302 114 273 118 288 b 246 373 147 342 193 370 "},v4b:{x_min:0,x_max:503.609375,ha:514,o:"m 274 430 b 277 430 276 430 277 430 b 310 394 296 430 310 415 b 308 383 310 391 308 387 b 306 367 307 381 307 374 b 236 120 298 305 272 210 b 40 -273 189 -5 125 -134 b 20 -287 35 -283 27 -287 b 5 -281 14 -287 9 -285 b 0 -267 1 -277 0 -273 b 9 -242 0 -262 2 -255 b 246 395 137 -12 232 242 b 274 430 249 416 257 427 m 468 430 b 472 430 469 430 470 430 b 503 394 490 430 503 415 b 502 383 503 391 503 387 b 499 367 502 381 500 374 b 431 120 491 305 465 210 b 234 -273 382 -5 318 -134 b 213 -287 228 -283 220 -287 b 198 -281 208 -287 202 -285 b 193 -267 194 -277 193 -273 b 202 -242 193 -262 196 -255 b 439 395 330 -12 426 242 b 468 430 442 416 451 427 "},v4d:{x_min:-311.6875,x_max:310.328125,ha:317,o:"m -9 388 b -2 390 -8 390 -5 390 b 5 388 1 390 4 390 b 19 378 10 387 16 383 b 23 333 23 371 23 371 b 24 298 23 299 24 298 b 81 276 34 298 65 285 b 213 91 145 240 190 177 b 224 24 217 76 224 36 b 257 24 224 24 235 24 b 299 19 292 24 292 24 b 310 -1 306 15 310 6 b 299 -23 310 -11 306 -19 b 257 -27 292 -27 292 -27 b 224 -29 235 -27 224 -29 b 213 -95 224 -40 217 -80 b 81 -280 190 -181 145 -244 b 24 -301 65 -290 34 -301 b 23 -335 24 -301 23 -303 l 23 -340 b 17 -381 23 -374 23 -374 b -1 -391 13 -388 5 -391 b -21 -381 -9 -391 -17 -388 b -27 -340 -27 -374 -27 -374 l -27 -335 b -28 -301 -27 -303 -27 -301 b -85 -280 -38 -301 -69 -290 b -217 -95 -149 -244 -194 -181 b -228 -29 -221 -80 -228 -40 b -259 -27 -228 -29 -238 -27 b -300 -23 -294 -27 -294 -27 b -311 -2 -307 -19 -311 -11 b -294 23 -311 8 -304 19 b -259 24 -291 23 -284 24 b -228 24 -239 24 -228 24 b -217 91 -228 36 -221 76 b -85 276 -194 177 -149 240 b -28 298 -69 285 -38 298 b -27 333 -27 298 -27 299 b -27 371 -27 362 -27 369 b -9 388 -24 378 -17 385 m -27 136 b -28 247 -27 197 -28 247 b -61 216 -31 247 -53 226 b -123 33 -95 172 -121 98 l -125 24 l -76 24 l -27 24 l -27 136 m 29 242 b 24 247 27 245 24 247 b 23 136 24 247 23 197 l 23 24 l 72 24 l 121 24 l 119 33 b 29 242 115 116 77 206 m -27 -140 l -27 -27 l -76 -27 l -125 -27 l -123 -36 b -61 -220 -121 -102 -95 -176 b -28 -251 -53 -230 -31 -251 b -27 -140 -28 -251 -27 -201 m 119 -36 l 121 -27 l 72 -27 l 23 -27 l 23 -140 b 24 -251 23 -201 24 -251 b 57 -220 27 -251 49 -230 b 119 -36 91 -176 117 -102 "},v4e:{x_min:0,x_max:239.5625,ha:244,o:"m 10 460 b 20 462 13 462 14 462 b 39 449 28 462 35 458 l 40 446 l 40 326 b 40 205 40 259 40 205 b 127 227 40 205 80 215 b 220 249 196 244 213 249 b 227 247 224 249 225 248 b 238 237 231 245 235 241 l 239 233 l 239 -106 l 239 -448 l 238 -451 b 219 -463 234 -459 225 -463 b 198 -451 210 -463 202 -459 l 197 -448 l 197 -324 b 197 -201 197 -248 197 -201 b 110 -223 196 -201 157 -210 b 17 -245 42 -240 24 -245 b 10 -242 13 -245 13 -244 b 0 -233 6 -241 2 -237 l 0 -230 l 0 108 l 0 446 l 0 449 b 10 460 2 453 6 458 m 197 22 b 197 70 197 41 197 58 b 196 116 197 113 197 116 l 196 116 b 118 97 196 116 160 106 l 40 77 l 40 -18 b 40 -112 40 -69 40 -112 l 119 -93 l 197 -73 l 197 22 "},v51:{x_min:-1.359375,x_max:455.96875,ha:465,o:"m 352 541 b 357 542 353 542 355 542 b 377 530 364 542 372 537 l 378 526 l 378 394 l 379 262 l 404 266 b 436 270 420 269 430 270 b 450 265 443 270 446 269 b 455 220 455 259 455 260 l 455 208 l 455 161 l 454 156 b 411 140 449 147 447 147 b 378 133 393 137 379 134 b 378 68 378 133 378 106 b 378 22 378 54 378 38 l 379 -87 l 404 -83 b 436 -79 420 -80 430 -79 b 450 -84 443 -79 446 -80 b 455 -129 455 -90 455 -88 l 455 -141 l 455 -188 l 454 -192 b 413 -209 449 -202 447 -202 b 382 -215 398 -212 383 -215 l 378 -215 l 378 -345 l 378 -380 b 375 -485 378 -484 378 -480 b 357 -494 371 -491 364 -494 b 340 -485 351 -494 344 -491 b 336 -383 337 -480 336 -484 l 336 -349 l 336 -223 l 334 -223 b 291 -231 334 -223 314 -227 l 247 -240 l 247 -371 l 246 -503 l 245 -506 b 225 -519 242 -514 234 -519 b 206 -506 219 -519 210 -514 l 205 -503 l 205 -376 l 205 -248 l 160 -256 l 115 -265 l 115 -396 l 115 -527 l 114 -531 b 95 -544 110 -539 102 -544 b 76 -531 87 -544 78 -539 l 73 -527 l 73 -399 b 73 -273 73 -330 73 -273 b 49 -277 73 -273 61 -274 b 17 -281 32 -280 24 -281 b 4 -276 10 -281 8 -280 b -1 -234 0 -269 -1 -272 b 0 -219 -1 -229 0 -224 l 0 -170 l 1 -167 b 10 -158 2 -163 6 -159 b 49 -149 13 -156 16 -155 l 73 -145 l 73 -34 b 73 76 73 26 73 76 b 49 72 73 76 61 74 b 17 68 32 69 24 68 b 4 73 10 68 8 69 b -1 115 0 80 -1 77 b 0 130 -1 120 0 124 l 0 179 l 1 181 b 10 191 2 186 6 190 b 49 199 13 192 16 194 l 73 204 l 73 338 b 73 374 73 352 73 365 b 77 483 73 484 73 477 b 95 492 81 489 88 492 b 111 483 100 492 107 489 b 115 378 115 477 115 483 l 115 342 b 117 212 115 223 115 212 b 204 229 117 212 200 227 l 205 229 l 205 365 l 205 502 l 206 505 b 225 517 210 513 219 517 b 245 505 234 517 242 513 l 246 502 l 247 369 l 247 237 l 249 237 b 336 254 253 238 336 254 b 337 390 336 254 337 302 l 337 526 l 338 530 b 352 541 341 535 347 539 m 336 15 b 336 126 336 102 336 126 l 336 126 b 291 117 336 126 315 122 l 247 109 l 247 -1 l 247 -112 l 249 -112 b 336 -95 253 -111 336 -95 b 336 15 336 -95 336 -56 m 205 -120 b 205 -55 205 -120 205 -93 b 205 -9 205 -41 205 -24 l 205 101 l 160 93 l 115 84 l 115 -26 b 115 -83 115 -49 115 -69 b 117 -137 115 -133 115 -137 b 205 -120 118 -137 204 -120 "},v52:{x_min:-10.890625,x_max:298.078125,ha:294,o:"m 138 473 b 142 474 140 473 141 474 b 164 459 148 474 153 470 b 191 402 183 442 191 423 b 181 353 191 388 187 371 b 178 349 179 352 178 349 b 179 348 178 348 179 348 b 185 349 181 348 182 348 b 255 376 210 355 234 363 b 272 381 264 381 266 381 b 298 355 287 381 298 370 b 288 330 298 348 298 345 b 171 34 238 254 194 141 b 166 13 168 16 168 16 b 144 1 161 5 152 1 b 121 15 134 1 125 5 b 115 33 119 18 117 24 b 0 330 91 145 49 252 b -10 355 -9 345 -10 348 b 13 381 -10 371 0 381 b 31 376 19 381 25 380 b 132 345 61 358 103 345 l 136 345 l 137 355 b 145 378 138 359 142 370 b 152 415 149 394 152 405 b 137 452 152 427 148 438 b 133 464 134 458 133 460 b 138 473 133 467 134 470 "},v53:{x_min:0,x_max:902.421875,ha:921,o:"m 17 240 b 24 241 19 241 21 241 b 32 240 28 241 31 241 b 46 229 38 238 43 234 b 50 88 50 223 50 237 b 50 -1 50 63 50 34 b 50 -90 50 -36 50 -65 b 46 -231 50 -238 50 -224 b 25 -242 42 -238 34 -242 b 0 -224 14 -242 4 -235 b 0 2 0 -222 0 -108 b 0 223 0 112 0 220 b 17 240 2 230 9 237 m 110 240 b 118 241 111 241 114 241 b 126 240 121 241 123 241 b 142 223 133 237 140 230 b 144 123 144 220 144 205 b 144 29 144 45 144 29 b 144 29 144 29 144 29 b 393 183 166 106 264 167 b 450 186 412 184 431 186 b 756 29 600 186 732 120 b 756 29 756 29 756 29 b 758 123 758 29 758 45 b 760 227 758 226 758 223 b 784 241 766 237 774 241 b 804 229 792 241 800 237 b 809 88 808 223 809 237 l 809 -1 l 809 -90 b 804 -231 809 -238 808 -224 b 784 -242 800 -238 792 -242 b 762 -231 775 -242 766 -238 b 758 -124 756 -224 758 -231 b 756 -30 758 -47 758 -30 b 756 -30 756 -30 756 -30 b 509 -184 736 -108 637 -169 b 450 -187 488 -187 469 -187 b 144 -30 300 -187 168 -122 b 144 -30 144 -30 144 -30 b 144 -124 144 -30 144 -47 b 140 -231 144 -231 144 -224 b 118 -242 134 -238 126 -242 b 92 -224 107 -242 96 -235 b 92 2 92 -222 92 -108 b 92 223 92 112 92 220 b 110 240 95 230 102 237 m 432 161 b 413 162 426 162 420 162 b 313 41 351 162 313 109 b 347 -73 313 5 323 -34 b 487 -163 385 -133 439 -163 b 578 -97 526 -163 562 -142 b 588 -43 585 -80 588 -62 b 432 161 588 47 518 147 m 868 240 b 876 241 869 241 872 241 b 884 240 879 241 882 241 b 898 229 890 238 894 234 b 902 88 902 223 902 237 l 902 -1 l 902 -90 b 898 -231 902 -238 902 -224 b 876 -242 892 -238 884 -242 b 852 -224 865 -242 854 -235 b 850 2 850 -222 850 -108 b 852 223 850 112 850 220 b 868 240 853 230 860 237 "},v54:{x_min:-24.5,x_max:317.140625,ha:324,o:"m -24 -161 l -24 -5 l -20 -5 b 0 -24 -9 -5 -2 -12 b 171 -315 21 -124 84 -233 b 317 -660 268 -406 317 -531 b 187 -1014 317 -782 274 -909 b 161 -1034 172 -1034 171 -1034 b 141 -1013 149 -1034 141 -1025 b 152 -991 141 -1004 142 -1002 b 266 -682 228 -899 266 -788 b 174 -430 266 -588 236 -498 b -23 -317 136 -388 66 -348 b -24 -161 -23 -316 -24 -285 "},v55:{x_min:0,x_max:551.25,ha:563,o:"m 289 644 b 304 645 294 645 299 645 b 404 566 349 645 392 613 b 406 541 405 557 406 549 b 379 471 406 514 397 489 l 377 467 l 382 470 b 509 591 438 485 485 531 b 513 601 510 595 513 599 b 530 609 518 607 524 609 b 551 588 540 609 551 602 b 200 -605 551 584 204 -599 b 182 -616 197 -612 190 -616 b 163 -602 174 -616 166 -610 b 161 -598 161 -601 161 -601 b 217 -402 161 -589 170 -562 b 272 -213 247 -298 272 -213 b 272 -213 272 -213 272 -213 b 264 -219 272 -213 268 -216 b 140 -262 227 -247 182 -262 b 36 -226 102 -262 65 -249 b 0 -145 12 -206 0 -176 b 17 -84 0 -124 5 -104 b 103 -38 38 -54 70 -38 b 191 -91 137 -38 172 -56 b 205 -141 201 -106 205 -124 b 178 -212 205 -167 196 -194 l 175 -215 l 182 -213 b 307 -93 236 -198 284 -151 b 372 129 308 -88 372 127 b 372 129 372 129 372 129 b 364 122 372 129 368 126 b 240 80 328 94 283 80 b 137 115 202 80 166 91 b 99 195 112 136 99 165 b 118 256 99 217 106 238 b 204 303 138 287 171 303 b 292 249 238 303 273 285 b 306 199 302 234 306 217 b 279 129 306 173 296 148 l 276 126 l 281 127 b 408 248 336 142 385 190 b 473 470 409 254 473 469 b 473 470 473 470 473 470 b 465 464 473 470 469 467 b 341 421 428 435 383 421 b 236 458 303 421 266 433 b 200 537 212 478 200 508 b 289 644 200 585 234 635 "},v58:{x_min:-21.78125,x_max:367.5,ha:375,o:"m 259 1553 b 265 1553 261 1553 264 1553 b 288 1540 272 1553 277 1550 b 367 1351 340 1493 367 1424 b 336 1221 367 1308 357 1263 l 332 1211 l 333 1208 b 367 1077 356 1170 367 1124 b 336 945 367 1032 357 986 l 332 935 l 333 932 b 367 800 356 893 367 848 b 336 669 367 756 357 710 l 332 659 l 333 656 b 367 523 356 617 367 571 b 345 412 367 485 360 446 b 231 273 322 356 284 310 b -1 19 121 195 27 93 b -17 4 -4 11 -10 5 l -21 4 l -21 134 l -21 265 l -17 265 b 133 291 20 265 96 278 b 318 537 245 328 318 433 b 307 603 318 559 315 582 b 303 614 304 612 304 614 b 298 609 302 614 300 613 b 231 549 281 589 258 567 b -1 295 121 471 27 369 b -17 280 -4 287 -10 281 l -21 280 l -21 410 l -21 541 l -17 541 b 133 567 20 541 96 555 b 318 813 245 605 318 709 b 307 880 318 835 315 859 b 303 891 304 888 304 891 b 298 885 302 891 300 888 b 231 825 281 866 258 843 b -1 571 121 748 27 645 b -17 556 -4 563 -10 557 l -21 556 l -21 687 l -21 817 l -17 817 b 133 843 20 817 96 830 b 318 1089 245 881 318 985 b 307 1156 318 1111 315 1134 b 303 1167 304 1164 304 1167 b 298 1161 302 1167 300 1164 b 231 1102 281 1140 258 1120 b -1 848 121 1024 27 921 b -17 832 -4 839 -10 834 l -21 832 l -21 963 l -21 1093 l -17 1093 b 114 1113 12 1093 78 1103 b 313 1314 215 1142 289 1218 b 318 1364 317 1331 318 1347 b 255 1511 318 1422 295 1478 b 243 1532 247 1519 243 1525 b 259 1553 243 1540 250 1550 "},v59:{x_min:0,x_max:464.140625,ha:474,o:"m 0 0 l 0 347 l 76 347 l 153 347 l 153 0 l 153 -348 l 76 -348 l 0 -348 l 0 0 m 308 -1 l 308 347 l 386 347 l 464 347 l 464 -1 l 464 -348 l 386 -348 l 308 -348 l 308 -1 "},v5a:{x_min:-171.5,x_max:170.140625,ha:174,o:"m -6 566 b 0 567 -5 567 -2 567 b 14 556 6 567 12 563 b 92 285 14 555 50 433 b 170 13 166 33 170 19 b 168 13 170 13 170 13 b 161 1 168 8 167 4 l 159 0 l 122 0 l 84 0 l 81 1 b 21 195 76 5 78 -5 b -32 381 -8 297 -32 381 b -87 197 -32 381 -57 298 b -141 8 -115 94 -140 9 b -155 0 -142 2 -149 0 b -171 15 -163 0 -171 5 b -14 556 -171 18 -24 528 b -6 566 -14 560 -10 564 "},v5b:{x_min:-441,x_max:439.640625,ha:449,o:"m -428 -2 b -421 0 -427 -1 -424 0 b -406 -6 -416 0 -409 -2 b -400 -31 -401 -12 -400 -15 b -1 -352 -392 -215 -215 -352 b 58 -349 19 -352 38 -351 b 398 -31 250 -326 392 -192 b 404 -6 398 -15 400 -12 b 419 -1 408 -2 413 -1 b 439 -13 427 -1 435 -5 b 439 -29 439 -16 439 -22 b 434 -105 439 -48 438 -80 b 0 -489 397 -333 213 -489 b -68 -484 -23 -489 -44 -488 b -441 -36 -280 -452 -436 -263 b -441 -30 -441 -34 -441 -31 b -428 -2 -441 -11 -439 -5 m -13 -9 b -1 -8 -9 -8 -5 -8 b 50 -36 19 -8 39 -19 b 61 -72 57 -47 61 -59 b 50 -106 61 -84 57 -97 b -1 -134 39 -124 19 -134 b -46 -115 -17 -134 -34 -129 b -62 -72 -57 -102 -62 -87 b -13 -9 -62 -44 -44 -16 "},v5c:{x_min:0,x_max:447.8125,ha:457,o:"m 0 -87 l 0 0 l 223 0 l 447 0 l 447 -87 l 447 -174 l 223 -174 l 0 -174 l 0 -87 "},v5d:{x_min:-1.359375,x_max:592.078125,ha:604,o:"m 280 692 b 295 694 283 692 289 694 b 310 692 300 694 307 692 b 357 630 340 684 357 657 b 336 580 357 612 351 594 b 311 538 321 566 311 549 b 352 492 311 512 330 492 b 366 495 357 492 362 492 b 397 553 390 503 397 517 b 415 603 397 576 402 591 b 460 623 427 617 443 623 b 509 599 479 623 498 614 b 522 559 518 587 522 573 b 494 506 522 538 513 519 b 451 495 481 498 473 496 b 415 488 432 495 426 494 b 394 449 404 483 394 464 b 394 448 394 448 394 448 l 394 440 l 397 433 b 428 409 404 420 413 413 b 438 408 431 408 435 408 b 479 431 450 408 462 415 b 528 455 495 448 510 455 b 548 452 534 455 541 453 b 592 391 577 442 592 416 b 549 331 592 365 577 340 b 528 327 541 328 534 327 b 479 351 510 327 495 335 b 438 374 464 367 450 374 b 417 369 431 374 424 373 b 394 333 402 360 394 348 b 400 312 394 326 396 319 b 451 287 408 294 420 288 b 513 258 484 285 499 278 b 522 223 519 247 522 234 b 461 159 522 190 496 159 b 449 161 457 159 453 159 b 397 229 416 167 397 191 b 366 288 397 265 390 278 b 352 290 362 290 357 290 b 315 262 336 290 321 280 b 311 245 313 256 311 251 b 334 204 311 233 318 220 b 355 170 348 190 351 184 b 357 152 356 166 357 159 b 355 136 357 147 356 140 b 295 88 345 104 321 88 b 232 152 264 88 232 112 b 255 204 232 174 238 186 b 279 244 273 222 279 231 l 279 245 b 238 290 279 270 259 290 b 224 288 234 290 228 290 b 193 229 200 278 193 265 b 141 161 193 191 174 167 b 129 159 137 159 133 159 b 68 223 93 159 68 190 b 77 258 68 234 70 247 b 138 287 91 278 106 285 b 185 302 166 287 175 291 b 196 333 193 312 196 323 b 174 369 196 347 187 360 b 152 374 166 373 159 374 b 111 351 140 374 126 367 b 62 327 95 335 80 327 b 51 328 58 327 54 327 b -1 391 16 334 -1 363 b 53 455 -1 420 17 449 b 62 455 57 455 59 455 b 111 431 80 455 95 448 b 152 408 127 415 140 408 b 161 409 155 408 159 408 b 193 433 176 413 186 420 l 196 440 l 196 448 b 196 451 196 449 196 449 b 190 471 196 459 194 463 b 137 495 182 489 167 495 l 134 495 l 134 495 b 68 560 95 495 68 521 b 129 623 68 596 95 623 b 144 621 134 623 138 623 b 193 553 175 614 193 589 b 224 495 193 517 200 503 b 238 492 228 492 234 492 b 279 538 259 492 279 512 b 254 580 279 549 269 566 b 232 630 239 594 232 612 b 280 692 232 657 250 684 m 307 456 b 295 458 303 458 299 458 b 230 391 258 458 230 426 b 236 360 230 381 231 371 b 295 324 249 337 272 324 b 353 360 318 324 341 337 b 360 391 357 370 360 381 b 307 456 360 421 340 451 "},v60:{x_min:-590.71875,x_max:589.359375,ha:601,o:"m -367 173 b -362 174 -366 174 -364 174 b -351 173 -357 174 -353 173 b -262 86 -348 172 -328 151 b -176 0 -216 37 -176 0 b -107 84 -176 0 -145 37 b -31 174 -36 173 -38 172 b -25 174 -29 174 -28 174 b -16 173 -23 174 -19 173 b 72 86 -13 172 6 151 b 157 0 119 37 157 0 b 227 84 159 0 189 37 b 303 174 298 173 296 172 b 308 174 304 174 307 174 b 318 173 313 174 317 173 b 481 11 322 172 357 134 l 494 -1 l 522 34 b 560 76 553 72 555 74 b 567 77 563 77 564 77 b 589 56 579 77 589 68 b 586 48 589 54 588 51 b 411 -172 583 41 416 -166 b 397 -176 406 -174 401 -176 b 387 -174 393 -176 390 -176 b 299 -87 386 -173 366 -152 b 213 0 253 -38 213 0 b 144 -86 213 0 182 -38 b 68 -174 73 -174 74 -173 b 62 -176 66 -176 65 -176 b 53 -174 59 -176 55 -174 b -35 -87 50 -173 29 -152 b -121 0 -83 -38 -121 0 b -190 -86 -122 0 -152 -38 b -266 -174 -261 -174 -259 -173 b -272 -176 -268 -176 -270 -176 b -281 -174 -276 -176 -280 -174 b -371 -86 -284 -173 -304 -152 b -457 0 -417 -38 -457 0 l -457 0 b -477 -26 -457 0 -470 -16 b -548 -227 -524 -88 -548 -161 b -536 -303 -548 -254 -544 -280 b -533 -317 -534 -309 -533 -313 b -553 -338 -533 -330 -541 -338 b -577 -315 -566 -338 -571 -333 b -590 -227 -586 -287 -590 -258 b -518 -9 -590 -154 -564 -77 b -465 56 -509 2 -504 8 l -402 134 b -367 173 -375 169 -372 172 "},v62:{x_min:46.28125,x_max:669.671875,ha:563,o:"m 183 376 b 189 376 185 376 187 376 b 212 374 197 376 208 376 b 265 337 234 369 253 355 b 274 317 268 331 273 320 b 274 316 274 317 274 316 b 280 323 276 316 276 319 b 311 358 288 337 299 348 b 319 366 315 360 318 365 b 356 376 326 373 340 376 b 382 371 364 376 374 374 b 428 337 400 366 417 352 b 436 317 431 331 436 320 b 438 316 436 317 436 316 b 442 323 438 316 439 319 b 475 358 451 337 462 348 b 483 366 477 360 481 365 b 518 376 488 373 503 376 b 544 373 528 376 536 376 b 604 285 579 360 604 326 b 597 249 604 273 601 258 b 543 63 596 247 544 70 b 541 54 543 61 541 55 b 540 44 540 51 540 47 b 552 23 540 33 545 23 b 552 23 552 23 552 23 b 647 126 586 29 627 72 b 658 138 651 136 653 138 b 660 138 660 138 660 138 b 669 129 666 137 669 136 b 654 88 669 122 665 109 b 562 -12 631 43 602 9 l 549 -19 b 521 -27 540 -24 530 -27 b 447 30 490 -27 458 -4 b 443 58 445 38 443 48 b 450 93 443 72 446 84 b 504 278 453 97 504 272 b 507 288 506 283 506 287 b 509 298 507 292 509 295 b 491 326 509 310 502 320 b 487 327 490 327 488 327 b 479 324 484 327 483 326 b 441 270 462 316 443 288 b 435 249 441 265 436 254 b 398 127 434 248 419 195 b 362 4 379 61 362 5 b 328 -1 359 -1 362 -1 b 314 -1 323 -1 319 -1 b 302 -1 310 -1 306 -1 b 266 4 266 -1 269 -1 b 265 6 265 5 265 5 b 303 144 265 13 272 34 b 343 278 325 216 343 276 b 344 288 343 281 344 285 b 345 298 345 291 345 295 b 330 326 345 310 340 320 b 323 327 328 327 325 327 b 317 324 322 327 321 326 b 279 270 300 316 281 288 b 273 249 279 265 274 254 b 236 127 272 248 255 195 b 200 4 216 61 200 5 b 164 -1 197 -1 198 -1 b 151 -1 161 -1 156 -1 b 140 -1 147 -1 142 -1 b 103 4 104 -1 106 -1 b 103 6 103 5 103 5 b 141 144 103 13 108 34 b 181 278 161 216 179 276 b 182 288 181 281 181 285 b 183 298 182 291 183 295 b 168 324 183 310 178 320 b 160 327 166 326 163 327 b 141 320 156 327 151 324 b 69 230 112 305 85 272 b 57 215 65 217 62 215 b 55 215 57 215 55 215 b 46 224 49 215 46 217 b 59 260 46 231 50 242 b 151 363 81 306 112 341 b 161 369 155 365 160 367 b 183 376 166 371 174 374 "},v68:{x_min:-597.53125,x_max:596.171875,ha:608,o:"m -533 324 b -525 327 -530 326 -528 327 b -504 305 -514 327 -504 317 b -504 305 -504 305 -504 305 b -513 284 -504 299 -504 299 b -556 112 -541 226 -556 167 b -545 33 -556 84 -552 58 b -524 -20 -541 15 -532 -9 l -522 -23 l -491 15 l -413 111 b -355 174 -367 169 -363 174 b -351 174 -353 174 -352 174 b -254 86 -343 174 -348 179 b -168 -1 -208 37 -168 -1 b -100 84 -168 -1 -137 37 b -23 173 -28 173 -29 172 b -19 174 -21 174 -20 174 b -8 173 -14 174 -10 173 b 155 11 -5 172 43 123 l 166 -1 l 168 1 l 170 4 l 170 130 b 171 260 170 256 170 258 b 191 274 175 269 183 274 b 205 267 196 274 201 272 b 212 158 212 262 210 273 l 212 56 l 257 112 b 311 173 304 172 304 172 b 317 174 313 174 314 174 b 326 173 319 174 323 173 b 490 11 329 172 366 134 l 502 -1 l 530 34 b 568 76 560 72 563 74 b 575 77 570 77 573 77 b 596 56 586 77 596 68 b 594 48 596 54 596 51 b 417 -172 592 41 424 -166 b 405 -176 415 -174 409 -176 b 396 -174 401 -176 398 -176 b 307 -87 393 -173 372 -152 b 221 -1 259 -38 221 -1 b 216 -6 221 -1 219 -2 l 212 -12 l 212 -147 b 212 -210 212 -173 212 -194 b 205 -292 212 -297 210 -287 b 191 -299 201 -297 196 -299 b 172 -287 183 -299 175 -295 b 170 -174 171 -284 171 -284 l 170 -63 l 127 -117 b 73 -176 84 -170 80 -176 b 68 -176 72 -176 70 -176 b -27 -87 59 -174 65 -180 b -114 0 -74 -38 -112 0 b -182 -86 -114 0 -145 -38 b -258 -174 -253 -174 -253 -173 b -264 -176 -259 -176 -262 -176 b -274 -174 -268 -176 -272 -174 b -438 -11 -277 -173 -348 -102 l -449 0 l -479 -37 b -524 -80 -513 -80 -514 -80 l -524 -80 b -553 -52 -534 -80 -540 -74 b -597 109 -583 -8 -597 48 b -560 280 -597 165 -585 224 b -533 324 -548 310 -540 322 "},v6c:{x_min:-1.359375,x_max:193.28125,ha:197,o:"m 78 233 b 87 233 81 233 84 233 b 187 140 132 233 174 195 b 193 102 190 127 193 115 b 43 -113 193 22 136 -62 b 27 -119 36 -116 31 -119 b 19 -108 21 -119 19 -115 b 29 -97 19 -102 20 -101 b 102 13 73 -72 102 -27 b 92 51 102 26 98 40 l 91 54 l 84 54 b 8 104 53 54 21 74 b -1 142 1 116 -1 130 b 78 233 -1 187 31 227 "},v6d:{x_min:-590.71875,x_max:589.359375,ha:601,o:"m 544 335 b 553 337 548 337 551 337 b 575 313 563 337 570 330 b 589 226 583 285 589 256 b 517 8 589 152 563 76 b 464 -58 507 -4 503 -9 l 401 -136 b 362 -176 372 -172 370 -176 b 357 -176 360 -176 359 -176 b 261 -87 349 -174 355 -180 b 175 0 215 -38 175 0 b 106 -86 175 0 144 -38 b 29 -174 35 -174 36 -173 b 24 -176 28 -176 27 -176 b 14 -174 21 -176 17 -174 b -73 -87 12 -173 -8 -152 b -159 0 -121 -38 -159 0 b -228 -86 -160 0 -190 -38 b -304 -174 -299 -174 -298 -173 b -310 -176 -306 -176 -308 -176 b -319 -174 -314 -176 -318 -174 b -483 -12 -323 -173 -359 -137 l -495 0 l -524 -34 b -562 -77 -553 -73 -556 -76 b -568 -79 -564 -79 -566 -79 b -590 -58 -581 -79 -590 -69 b -588 -49 -590 -55 -589 -52 b -412 170 -585 -43 -417 165 b -398 174 -408 173 -402 174 b -389 173 -394 174 -392 174 b -300 86 -387 172 -366 151 b -215 -1 -254 37 -215 -1 b -145 84 -215 -1 -183 37 b -69 173 -74 173 -76 172 b -63 174 -68 174 -66 174 b -54 173 -61 174 -57 173 b 34 86 -51 172 -31 151 b 119 -1 81 37 119 -1 b 189 84 121 -1 151 37 b 265 173 259 173 258 172 b 270 174 266 174 269 174 b 280 173 274 174 279 173 b 370 84 283 172 303 151 b 455 -1 416 37 455 -1 l 455 -1 b 476 24 455 -1 469 15 b 547 226 522 87 547 159 b 534 302 547 252 543 278 b 532 317 533 308 532 313 b 544 335 532 326 536 333 "},v6f:{x_min:-80.3125,x_max:78.9375,ha:81,o:"m 63 191 b 69 192 65 192 66 192 b 77 188 72 192 76 191 b 78 183 78 187 78 186 b 74 158 78 179 77 172 l 66 115 b 9 -161 49 30 10 -158 b -10 -187 6 -172 -1 -181 b -34 -194 -17 -191 -25 -194 b -80 -147 -58 -194 -80 -174 b -80 -141 -80 -144 -80 -142 b 9 70 -80 -134 -73 -117 l 49 163 b 63 191 59 188 61 190 "},v70:{x_min:0,x_max:436.921875,ha:446,o:"m 213 190 b 217 191 215 191 216 191 b 231 184 223 191 228 188 b 249 154 240 167 246 159 b 419 18 292 91 348 45 b 436 -1 435 11 436 8 b 424 -16 436 -9 434 -13 b 308 -87 394 -26 340 -59 b 231 -186 276 -117 257 -142 b 219 -192 228 -191 225 -192 b 198 -174 209 -192 208 -191 b 47 -33 161 -113 110 -63 b 10 -16 34 -26 17 -19 b 0 -1 2 -13 0 -9 b 17 18 0 8 1 11 b 198 173 95 48 156 101 b 213 190 206 187 208 188 "},v72:{x_min:-423.3125,x_max:421.9375,ha:431,o:"m -262 197 b -247 197 -257 197 -253 197 b -118 162 -210 197 -163 184 b 40 45 -61 134 -13 98 b 277 -95 119 -33 200 -81 b 289 -97 281 -97 285 -97 b 378 0 332 -97 371 -55 b 378 11 378 4 378 6 b 302 83 378 55 345 83 b 242 66 283 83 262 77 b 208 56 231 59 219 56 b 148 120 175 56 148 81 b 201 186 148 151 164 172 b 261 198 220 194 240 198 b 420 45 341 198 411 136 b 421 22 421 37 421 29 b 245 -199 421 -93 338 -199 b 238 -198 243 -199 240 -199 b -44 -47 148 -194 50 -141 b -250 86 -114 22 -183 66 b -295 94 -270 91 -283 94 b -315 91 -302 94 -307 94 b -381 4 -356 81 -381 43 b -355 -56 -381 -18 -372 -40 b -298 -81 -338 -73 -319 -81 b -246 -68 -283 -81 -265 -77 b -212 -58 -234 -61 -223 -58 b -178 -69 -200 -58 -189 -62 b -151 -122 -160 -81 -151 -101 b -171 -167 -151 -138 -157 -155 b -239 -195 -185 -181 -213 -192 b -257 -197 -245 -197 -250 -197 b -423 -5 -352 -197 -423 -109 b -412 65 -423 16 -419 40 b -262 197 -389 137 -329 188 "},v74:{x_min:-206.890625,x_max:428.75,ha:438,o:"m 389 -351 b 394 -351 390 -351 393 -351 b 428 -385 413 -351 428 -367 b 428 -394 428 -388 428 -391 b 394 -428 426 -406 421 -410 l 332 -473 l 269 -516 l 205 -560 l 141 -603 l 77 -648 l 13 -692 l -50 -737 l -114 -780 l -145 -802 b -171 -813 -157 -810 -163 -813 b -175 -813 -172 -813 -174 -813 b -206 -777 -194 -811 -206 -795 b -202 -760 -206 -771 -205 -766 b -87 -675 -197 -752 -206 -757 l -34 -639 l 83 -557 l 145 -514 l 209 -470 l 272 -427 b 389 -351 375 -356 381 -352 "},v75:{x_min:-149.71875,x_max:148.359375,ha:151,o:"m -137 381 b -130 383 -134 383 -133 383 b -111 371 -122 383 -114 378 b -55 224 -110 370 -85 305 b 0 80 -25 145 -1 80 b 54 224 0 80 24 145 b 112 377 114 384 110 373 b 127 384 118 381 122 384 b 148 362 138 384 148 374 l 148 356 l 83 183 b 16 9 47 88 17 11 b -1 0 12 2 5 0 b -14 5 -5 0 -10 1 b -84 183 -19 9 -13 -6 l -149 356 l -149 362 b -137 381 -149 371 -145 378 "},v78:{x_min:0,x_max:193.28125,ha:197,o:"m 85 514 b 95 517 88 517 89 517 b 114 505 103 517 110 513 l 115 502 l 115 376 b 115 249 115 306 115 249 b 141 258 117 249 127 252 l 167 266 l 172 266 b 190 254 181 265 187 262 l 193 251 l 193 202 l 193 188 b 187 147 193 149 191 152 b 147 130 183 142 182 141 l 115 119 l 115 9 b 115 -99 115 -51 115 -99 b 141 -91 115 -99 127 -95 b 171 -81 166 -81 167 -81 l 171 -81 b 191 -94 181 -81 189 -87 b 193 -142 191 -97 193 -120 b 191 -195 193 -167 191 -194 b 125 -227 187 -205 187 -204 l 115 -230 l 115 -366 l 115 -503 l 114 -506 b 95 -519 110 -514 102 -519 b 74 -506 87 -519 78 -514 l 73 -503 l 73 -374 b 73 -245 73 -260 73 -245 b 73 -245 73 -245 73 -245 b 55 -252 72 -245 63 -249 l 32 -260 b 19 -263 27 -262 23 -263 b 4 -256 13 -263 8 -260 b 0 -215 0 -251 0 -254 b 0 -199 0 -210 0 -206 l 0 -152 l 1 -149 b 8 -140 2 -145 5 -141 b 42 -127 9 -140 24 -133 l 73 -116 l 73 -5 b 73 23 73 4 73 15 b 73 105 73 70 73 105 b 49 97 73 105 61 101 b 17 88 32 91 23 88 b 4 95 10 88 8 91 b 0 137 0 101 0 98 b 0 151 0 141 0 145 l 0 199 l 1 202 b 43 224 5 212 5 212 l 73 234 l 73 367 l 73 502 l 74 505 b 85 514 77 509 81 513 "},v79:{x_min:-1.359375,x_max:899.703125,ha:918,o:"m 307 349 b 332 351 315 351 323 351 b 443 340 367 351 408 347 b 741 47 607 306 720 195 b 744 0 743 31 744 16 b 660 -303 744 -90 713 -206 b 28 -755 534 -531 304 -695 b 14 -756 23 -755 19 -756 b -1 -741 4 -756 -1 -750 b 21 -720 -1 -731 1 -728 b 567 -56 337 -601 548 -344 b 568 -11 568 -41 568 -24 b 442 285 568 129 525 233 b 325 319 406 308 367 319 b 93 177 232 319 137 266 b 84 154 91 170 84 155 b 84 154 84 154 84 154 b 88 156 84 154 85 155 b 159 177 110 170 134 177 b 257 134 194 177 231 162 b 294 41 281 108 294 73 b 171 -97 294 -24 246 -90 b 156 -98 166 -97 161 -98 b 6 74 73 -98 6 -22 b 6 80 6 76 6 79 b 307 349 10 223 141 340 m 839 215 b 845 216 841 216 842 216 b 862 213 852 216 860 215 b 899 163 887 206 899 184 b 872 117 899 145 890 127 b 847 111 865 112 856 111 b 808 130 833 111 818 117 b 796 162 800 140 796 151 b 839 215 796 187 812 212 m 839 -112 b 845 -112 841 -112 842 -112 b 862 -115 852 -112 860 -113 b 899 -165 887 -122 899 -144 b 872 -210 899 -183 890 -201 b 847 -217 865 -215 856 -217 b 808 -198 833 -217 818 -210 b 796 -165 800 -188 796 -177 b 839 -112 796 -140 812 -116 "},v7a:{x_min:-1.359375,x_max:386.5625,ha:394,o:"m 249 535 b 257 537 251 537 253 537 b 276 524 266 537 273 533 l 277 521 l 279 419 l 279 316 l 304 323 b 337 328 319 326 330 328 b 353 316 347 328 349 324 b 355 266 355 315 355 290 b 353 215 355 241 355 217 b 319 198 349 206 347 205 b 279 187 284 190 279 188 b 279 156 279 187 279 174 b 279 136 279 151 279 144 l 279 84 l 289 87 l 330 98 b 367 105 352 102 362 105 b 378 101 372 105 375 104 b 386 61 385 95 386 94 b 386 40 386 55 386 48 l 386 -5 l 385 -8 b 374 -19 383 -12 378 -18 b 291 -40 372 -19 347 -26 b 279 -43 284 -41 279 -43 b 279 -83 279 -43 279 -59 b 279 -95 279 -87 279 -91 l 279 -145 l 304 -140 b 337 -133 321 -136 330 -133 b 349 -140 343 -133 347 -136 b 355 -181 355 -145 355 -142 l 355 -197 l 355 -210 b 349 -252 355 -249 355 -247 b 300 -269 345 -258 347 -258 b 280 -274 291 -272 281 -273 l 279 -274 l 277 -378 l 277 -483 l 276 -487 b 257 -499 273 -495 265 -499 b 238 -487 249 -499 242 -495 l 236 -483 l 236 -384 l 236 -285 l 235 -285 l 212 -291 l 170 -301 b 148 -308 159 -305 148 -306 b 147 -415 147 -308 147 -313 l 147 -523 l 145 -526 b 126 -538 141 -534 133 -538 b 106 -526 118 -538 110 -534 l 104 -523 l 104 -420 b 103 -317 104 -326 104 -317 b 103 -317 103 -317 103 -317 b 50 -330 92 -322 54 -330 b 31 -317 42 -330 35 -326 b 29 -267 29 -315 29 -315 l 29 -219 l 32 -216 b 92 -192 36 -206 36 -206 l 104 -190 l 104 -138 b 103 -87 104 -91 104 -87 b 103 -87 103 -87 103 -87 b 88 -91 103 -87 96 -88 l 49 -101 b 17 -106 32 -105 23 -106 b 6 -102 13 -106 10 -105 b -1 -62 0 -97 -1 -95 b 0 -41 -1 -56 0 -49 l 0 4 l 1 6 b 10 16 2 11 6 15 b 91 37 12 18 38 24 l 104 41 l 104 93 b 103 144 104 140 104 144 b 103 144 103 144 103 144 b 50 131 92 141 54 131 b 31 144 42 131 35 137 b 29 195 29 147 29 148 l 29 242 l 32 245 b 92 269 36 255 36 255 l 104 273 l 104 377 l 104 481 l 106 485 b 126 498 110 492 118 498 b 134 495 129 498 132 496 b 145 485 138 494 142 489 l 147 481 l 147 383 l 147 283 l 152 284 b 190 294 155 285 171 290 l 230 303 l 236 305 l 236 413 l 236 521 l 238 524 b 249 535 240 528 243 533 m 236 126 b 235 177 236 154 236 177 l 235 177 b 213 172 235 177 225 174 l 170 161 b 147 155 157 158 147 155 b 147 124 147 155 147 142 b 147 102 147 117 147 111 l 147 52 l 153 54 l 228 72 l 236 74 l 236 126 m 236 -105 b 235 -54 236 -65 236 -54 l 235 -54 b 231 -55 235 -54 234 -54 b 172 -69 227 -55 204 -62 l 149 -76 l 147 -76 l 147 -127 l 147 -179 l 152 -177 b 190 -167 155 -177 171 -173 l 230 -158 l 236 -156 l 236 -105 "},v7c:{x_min:0,x_max:300.8125,ha:307,o:"m 49 505 b 53 506 50 505 51 506 b 70 496 58 506 62 503 b 81 485 73 492 78 488 l 96 473 l 111 459 l 122 449 l 134 438 l 182 396 l 255 330 b 292 291 292 298 292 298 l 292 290 l 292 284 l 283 270 b 209 36 234 197 209 113 b 288 -170 209 -44 235 -119 b 299 -184 295 -179 299 -181 b 300 -191 300 -187 300 -188 b 285 -206 300 -199 294 -206 b 280 -206 283 -206 281 -206 b 247 -201 270 -202 259 -201 b 176 -222 223 -201 197 -208 b 114 -340 136 -249 114 -292 b 172 -471 114 -384 134 -433 b 185 -492 182 -481 185 -487 b 181 -502 185 -496 183 -499 b 171 -508 176 -505 174 -508 b 152 -498 166 -508 160 -503 b 0 -284 65 -428 12 -352 b 0 -260 0 -278 0 -270 b 1 -238 0 -252 0 -242 b 148 -140 16 -177 73 -140 b 209 -148 167 -140 189 -142 b 215 -149 212 -148 215 -149 b 215 -149 215 -149 215 -149 l 215 -149 b 201 -136 215 -148 209 -142 l 157 -97 l 96 -41 b 17 34 21 24 17 29 b 17 37 17 36 17 36 b 17 38 17 37 17 38 b 25 56 17 44 17 44 b 110 298 81 131 110 219 b 46 474 110 367 88 431 b 38 491 40 480 38 487 b 49 505 38 498 42 502 "},v7d:{x_min:-1.359375,x_max:436.921875,ha:446,o:"m 213 205 b 217 205 215 205 216 205 b 234 194 224 205 234 199 b 236 187 234 194 235 190 l 245 167 l 261 129 l 270 106 b 355 -61 294 54 329 -13 b 420 -163 381 -105 402 -138 b 436 -188 435 -184 436 -184 b 436 -191 436 -190 436 -190 b 421 -206 436 -201 431 -206 l 421 -206 l 416 -206 l 405 -201 b 217 -158 347 -172 283 -158 b 31 -201 153 -158 88 -172 l 20 -206 l 14 -206 l 14 -206 b 0 -191 5 -206 0 -201 b -1 -188 0 -190 -1 -190 b 14 -163 -1 -186 0 -184 b 95 -34 36 -136 72 -77 b 166 106 119 8 148 68 l 175 129 l 183 148 l 200 188 b 213 205 205 199 208 202 "},v7f:{x_min:0,x_max:367.5,ha:375,o:"m 0 124 l 0 187 l 61 187 l 122 187 l 122 138 l 122 91 l 153 61 l 183 30 l 213 61 l 243 91 l 243 138 l 243 187 l 306 187 l 367 187 l 367 124 l 367 61 l 321 61 l 274 61 l 243 30 l 213 0 l 243 -31 l 274 -62 l 321 -62 l 367 -62 l 367 -124 l 367 -188 l 306 -188 l 243 -188 l 243 -140 l 243 -93 l 213 -62 l 183 -31 l 153 -62 l 122 -93 l 122 -140 l 122 -188 l 61 -188 l 0 -188 l 0 -124 l 0 -62 l 46 -62 l 92 -62 l 123 -31 l 153 0 l 123 30 l 92 61 l 46 61 l 0 61 l 0 124 "},v80:{x_min:29.9375,x_max:420.578125,ha:371,o:"m 115 345 b 221 347 117 345 166 347 b 411 345 306 347 409 345 b 420 330 416 342 420 335 b 415 319 420 326 419 321 b 178 118 397 303 179 118 b 178 117 178 118 178 117 b 181 117 178 117 178 117 b 189 117 182 117 185 117 b 193 117 190 117 191 117 b 247 98 215 117 232 111 b 296 75 266 83 280 76 b 302 75 299 75 300 75 b 322 91 311 75 315 79 b 322 91 322 91 322 91 b 322 91 322 91 322 91 b 319 91 322 91 321 91 b 313 90 318 90 315 90 b 283 107 300 90 288 97 b 277 126 279 114 277 121 b 319 167 277 149 295 167 b 319 167 319 167 319 167 b 362 118 347 167 362 147 b 355 82 362 108 359 96 b 311 33 349 65 340 55 b 224 1 284 12 253 1 b 194 5 213 1 204 2 b 168 18 183 8 178 11 b 110 36 151 30 130 36 b 57 15 88 36 68 29 b 47 11 54 12 51 11 b 31 20 40 11 34 13 b 29 26 31 22 29 25 b 68 66 29 36 39 45 b 285 250 73 71 281 248 b 285 250 285 250 285 250 b 231 252 285 252 261 252 b 137 250 190 252 141 250 b 93 227 122 248 110 241 b 78 220 88 222 83 220 b 66 227 74 220 70 222 b 63 234 65 229 63 231 b 85 291 63 241 69 252 b 115 345 108 342 108 344 "},v81:{x_min:0,x_max:428.75,ha:438,o:"m 262 186 b 273 186 266 186 272 186 b 274 186 273 186 274 186 b 285 186 274 186 280 186 b 428 48 375 181 428 122 b 386 -68 428 12 416 -29 b 155 -187 329 -145 236 -187 b 12 -111 92 -187 38 -162 b 0 -51 4 -91 0 -72 b 262 186 0 58 122 179 m 366 131 b 352 134 362 133 357 134 b 219 81 321 134 269 115 b 47 -111 126 23 50 -62 b 47 -112 47 -111 47 -112 b 77 -136 47 -129 58 -136 b 264 -45 118 -136 194 -101 b 382 109 336 12 382 76 b 366 131 382 120 377 129 "},v83:{x_min:-1.359375,x_max:847.96875,ha:865,o:"m 488 1499 b 495 1500 490 1500 492 1500 b 541 1465 507 1500 521 1490 b 679 1078 622 1372 679 1210 b 677 1050 679 1068 677 1060 b 477 642 668 893 604 764 l 443 609 l 431 596 l 431 592 l 438 562 l 449 508 l 460 458 b 481 355 475 390 481 355 b 481 355 481 355 481 355 b 490 356 481 355 485 355 b 528 358 495 356 511 358 b 558 356 540 358 552 356 b 839 95 699 338 808 237 b 847 22 845 72 847 47 b 631 -303 847 -113 766 -242 b 620 -309 623 -308 620 -309 l 620 -310 b 631 -359 620 -310 626 -333 l 646 -435 l 660 -496 b 672 -588 668 -535 672 -563 b 664 -653 672 -610 669 -630 b 383 -875 630 -792 509 -875 b 201 -810 321 -875 257 -855 b 129 -680 151 -768 129 -730 b 274 -530 129 -592 200 -530 b 351 -553 300 -530 326 -538 b 412 -669 393 -582 412 -626 b 287 -805 412 -735 366 -800 l 279 -805 l 285 -809 b 383 -830 318 -823 351 -830 b 586 -718 464 -830 540 -789 b 626 -584 612 -678 626 -631 b 619 -528 626 -566 623 -548 b 612 -495 619 -526 616 -510 b 577 -324 590 -387 577 -324 b 577 -324 577 -324 577 -324 b 568 -326 575 -324 571 -324 b 528 -334 558 -328 537 -333 b 465 -338 506 -337 485 -338 b 24 -11 269 -338 87 -206 b -1 145 8 41 -1 93 b 96 442 -1 249 32 351 b 322 714 166 541 236 626 l 352 745 l 345 782 l 332 843 l 315 921 b 303 984 310 950 304 978 b 295 1082 298 1017 295 1049 b 413 1426 295 1208 336 1329 b 488 1499 436 1456 477 1496 m 549 1301 b 541 1301 547 1301 544 1301 b 411 1207 500 1301 447 1263 b 355 1004 374 1152 355 1079 b 359 942 355 984 356 963 b 371 881 362 927 363 917 l 385 818 b 392 782 389 799 392 784 l 392 782 b 434 828 393 782 424 816 b 607 1165 534 941 594 1060 b 608 1193 608 1175 608 1183 b 597 1270 608 1224 604 1254 b 549 1301 589 1286 571 1299 m 398 528 b 393 555 396 542 393 553 b 392 555 393 555 393 555 b 317 470 390 555 347 505 b 190 298 266 408 212 334 b 127 70 148 227 127 148 b 155 -77 127 19 137 -30 b 468 -303 209 -216 333 -303 b 519 -299 484 -303 502 -302 b 568 -284 541 -295 568 -287 l 568 -284 b 563 -263 568 -284 566 -274 l 534 -120 l 511 -13 l 496 61 l 480 133 b 469 187 472 176 469 187 b 468 188 469 187 469 188 b 416 162 462 188 430 172 b 337 13 364 126 337 69 b 413 -124 337 -40 363 -93 b 428 -144 424 -131 428 -137 b 428 -149 428 -145 428 -148 b 409 -166 426 -161 419 -166 b 394 -162 405 -166 400 -165 b 240 77 302 -122 240 -27 l 240 77 b 430 342 240 197 315 301 l 436 344 l 426 394 l 398 528 m 548 194 b 526 195 540 195 532 195 b 519 195 524 195 521 195 l 514 195 l 518 177 l 539 79 l 552 15 l 566 -48 l 594 -187 l 605 -240 b 612 -266 609 -254 611 -266 b 612 -266 612 -266 612 -266 b 641 -248 613 -266 630 -256 b 744 -98 692 -212 730 -156 b 751 -40 749 -79 751 -59 b 548 194 751 76 665 181 "},v84:{x_min:25.859375,x_max:164.6875,ha:168,o:"m 34 369 b 40 370 35 370 38 370 b 59 353 49 370 50 367 b 164 40 122 254 155 158 b 164 0 164 33 164 16 b 164 -40 164 -16 164 -34 b 59 -353 155 -158 122 -254 b 40 -371 53 -366 47 -371 b 34 -370 38 -371 36 -370 b 25 -358 28 -367 25 -363 b 31 -337 25 -352 27 -347 b 92 0 72 -234 92 -117 b 31 335 92 116 72 233 b 25 356 27 345 25 352 b 34 369 25 363 28 366 "},v86:{x_min:-571.671875,x_max:570.3125,ha:582,o:"m -386 173 b -381 174 -385 174 -383 174 b -370 173 -377 174 -372 173 b -281 86 -367 172 -347 151 b -196 0 -235 37 -196 0 b -126 84 -196 0 -164 37 b -50 174 -55 173 -57 172 b -44 174 -49 174 -47 174 b -35 173 -42 174 -38 173 b 53 86 -32 172 -12 151 b 138 0 100 37 138 0 b 208 84 140 0 170 37 b 284 174 279 173 277 172 b 289 174 285 174 288 174 b 299 173 294 174 298 173 b 462 11 303 172 338 134 l 475 -1 l 503 34 b 541 76 534 72 536 74 b 548 77 544 77 545 77 b 570 56 560 77 570 68 b 567 48 570 54 568 51 b 392 -172 564 41 397 -166 b 378 -176 387 -174 382 -176 b 368 -174 374 -176 371 -176 b 280 -87 367 -173 345 -152 b 194 0 234 -38 194 0 b 125 -86 194 0 163 -38 b 49 -174 54 -174 55 -173 b 43 -176 47 -176 46 -176 b 34 -174 40 -176 36 -174 b -54 -87 31 -173 10 -152 b -140 0 -102 -38 -140 0 b -209 -86 -141 0 -171 -38 b -285 -174 -280 -174 -279 -173 b -291 -176 -287 -176 -289 -176 b -300 -174 -295 -176 -299 -174 b -464 -12 -304 -173 -340 -137 l -476 0 l -504 -34 b -543 -77 -534 -73 -537 -76 b -549 -79 -545 -79 -547 -79 b -571 -58 -562 -79 -571 -69 b -568 -49 -571 -55 -570 -52 b -392 172 -566 -43 -396 167 b -386 173 -390 172 -387 173 "},v8a:{x_min:-170.140625,x_max:168.78125,ha:172,o:"m -160 567 b -122 567 -159 567 -149 567 l -87 567 l -84 566 b -74 553 -78 563 -77 560 b -20 366 -73 551 -49 466 b 31 186 8 267 31 186 b 85 371 31 186 55 269 b 140 559 114 473 138 557 b 153 567 141 564 148 567 b 168 559 159 567 166 564 b 168 555 168 557 168 557 b 92 281 168 548 159 513 b 14 13 50 134 14 13 b 0 0 14 6 6 0 b -17 15 -8 0 -17 8 b -93 283 -17 15 -51 136 b -170 552 -166 533 -170 548 b -170 553 -170 552 -170 552 b -160 567 -170 560 -167 564 "},v8b:{x_min:0,x_max:319.859375,ha:326,o:"m 149 508 b 159 509 152 509 155 509 b 186 494 170 509 181 503 b 190 440 190 487 190 488 l 190 430 l 190 377 l 242 377 l 251 377 b 303 373 298 377 296 377 b 319 345 314 367 319 356 b 304 319 319 335 314 324 b 250 315 296 315 299 315 l 242 315 l 190 315 l 190 262 l 190 252 b 186 198 190 204 190 205 b 159 183 179 188 170 183 b 132 198 148 183 138 188 b 127 252 127 205 127 204 l 127 262 l 127 315 l 76 315 l 68 315 b 14 319 20 315 21 315 b 0 347 4 324 0 335 b 14 373 0 356 4 367 b 68 377 21 377 20 377 l 76 377 l 127 377 l 127 430 l 127 440 b 132 494 127 488 127 487 b 149 508 136 501 142 505 "},v8c:{x_min:-330.75,x_max:329.390625,ha:336,o:"m -133 483 b -117 484 -127 484 -122 484 b 31 373 -51 484 9 440 b 35 348 34 365 35 356 b -25 285 35 313 10 285 b -87 331 -55 285 -76 302 b -167 402 -100 376 -133 402 b -191 398 -175 402 -183 401 b -227 341 -215 388 -227 369 b -225 320 -227 334 -227 327 b -13 74 -209 230 -125 133 b 6 65 -4 70 5 66 l 9 63 l 10 65 b 117 231 12 68 40 112 l 189 341 l 242 424 b 268 460 262 456 264 458 b 283 464 273 463 277 464 b 308 438 296 464 308 453 l 308 437 b 287 396 308 430 308 428 l 95 98 l 59 43 l 58 41 l 65 37 b 253 -156 151 -8 217 -77 b 281 -285 272 -199 281 -244 b 148 -481 281 -381 231 -463 b 115 -485 137 -484 126 -485 b -32 -376 51 -485 -9 -442 b -36 -349 -35 -366 -36 -358 b 25 -287 -36 -315 -12 -287 b 85 -333 54 -287 74 -302 b 166 -403 99 -377 133 -403 b 190 -399 174 -403 182 -402 b 225 -342 215 -390 225 -370 b 224 -322 225 -335 225 -328 b 12 -76 208 -231 125 -134 b -8 -66 2 -72 -6 -68 l -10 -65 l -12 -66 b -118 -231 -13 -68 -42 -113 l -190 -342 l -243 -426 b -269 -462 -264 -458 -265 -458 b -284 -466 -274 -464 -279 -466 b -310 -440 -298 -466 -310 -455 l -310 -438 b -288 -398 -310 -430 -308 -430 l -96 -99 l -59 -44 l -59 -43 l -66 -38 b -281 284 -198 33 -281 158 l -281 284 b -133 483 -281 392 -220 474 m 254 177 b 266 179 258 177 262 179 b 319 149 287 179 307 167 b 329 115 326 140 329 127 b 319 79 329 102 326 90 b 268 51 307 61 287 51 b 221 72 250 51 234 58 b 205 115 210 84 205 99 b 254 177 205 142 223 170 m -281 -54 b -269 -52 -277 -52 -273 -52 b -223 -73 -253 -52 -235 -59 b -206 -116 -212 -84 -206 -101 b -216 -151 -206 -129 -209 -141 b -269 -179 -228 -170 -249 -179 b -314 -159 -285 -179 -302 -173 b -330 -116 -325 -147 -330 -131 b -281 -54 -330 -88 -313 -61 "},v8d:{x_min:-1.359375,x_max:255.890625,ha:261,o:"m 118 514 b 127 517 121 517 122 517 b 147 505 136 517 142 513 l 148 502 l 148 403 b 148 306 148 351 148 306 b 174 315 149 306 160 310 l 200 324 l 205 323 b 223 312 213 323 220 319 l 225 308 l 225 260 b 225 245 225 255 225 249 b 220 204 225 208 224 209 b 179 188 216 199 215 199 l 148 177 l 148 124 l 148 70 l 189 84 b 236 98 219 94 230 98 b 247 94 240 98 243 97 b 255 52 254 88 255 87 b 255 33 255 47 255 40 l 254 -12 l 253 -15 b 249 -22 253 -18 250 -20 l 245 -24 l 196 -41 l 148 -58 l 148 -108 b 148 -158 148 -136 148 -158 b 174 -148 148 -158 160 -154 b 204 -140 198 -140 200 -140 l 204 -140 b 224 -152 213 -140 221 -145 b 225 -201 224 -155 225 -177 b 224 -254 225 -226 224 -251 b 157 -284 220 -262 220 -262 l 148 -288 l 148 -395 l 148 -503 l 147 -506 b 127 -519 142 -514 134 -519 b 107 -506 119 -519 111 -514 l 106 -503 l 106 -403 b 106 -303 106 -316 106 -303 b 104 -303 104 -303 104 -303 b 88 -310 104 -303 96 -306 l 63 -319 b 51 -322 59 -320 55 -322 b 36 -315 46 -322 40 -319 b 31 -273 32 -309 31 -312 b 31 -258 31 -269 31 -263 l 31 -210 l 34 -206 b 40 -198 35 -204 38 -199 b 74 -186 42 -197 57 -191 l 106 -173 l 106 -123 b 106 -97 106 -112 106 -104 b 106 -72 106 -76 106 -72 b 104 -72 106 -72 106 -72 b 20 -99 89 -79 23 -99 b 0 -84 10 -99 2 -93 b -1 -37 0 -81 -1 -59 b 0 11 -1 -15 0 9 b 58 40 4 22 2 22 l 106 56 l 106 109 b 106 123 106 115 106 119 b 106 162 106 147 106 162 b 81 155 106 162 93 159 b 50 147 65 149 55 147 b 36 152 43 147 40 148 b 31 194 32 158 31 156 b 31 209 31 198 31 204 l 31 256 l 34 260 b 76 281 38 269 38 269 l 106 292 l 106 396 l 106 502 l 107 505 b 118 514 110 509 114 513 "},v8f:{x_min:-21.78125,x_max:362.0625,ha:369,o:"m 302 1031 b 308 1032 304 1032 307 1032 b 330 1016 318 1032 325 1027 b 362 867 351 970 362 920 b 340 738 362 824 353 780 l 336 727 l 340 717 b 362 591 355 677 362 634 b 257 323 362 496 325 401 b 204 272 243 306 227 290 b 20 56 129 206 66 133 b -1 18 12 44 0 22 b -19 4 -4 9 -12 4 l -21 4 l -21 140 l -21 276 l -12 277 b 167 333 61 288 127 309 b 319 598 262 388 319 491 b 311 664 319 620 317 642 l 310 673 l 304 664 b 204 548 279 620 250 587 b 20 333 129 483 66 409 b -1 292 12 320 0 298 b -19 280 -4 285 -12 280 l -21 280 l -21 416 l -21 552 l -12 553 b 167 609 61 564 127 585 b 319 874 264 666 319 770 b 294 992 319 914 311 954 b 288 1011 288 1004 288 1007 b 302 1031 288 1021 294 1028 "},v90:{x_min:-171.5,x_max:483.1875,ha:493,o:"m -8 631 b -1 632 -6 632 -4 632 b 19 620 8 632 16 628 b 20 495 20 616 20 616 b 20 373 20 427 20 373 b 115 410 20 373 63 390 l 210 448 l 210 531 b 212 620 210 614 210 616 b 231 632 215 628 223 632 b 246 627 236 632 242 631 b 251 541 251 620 251 628 l 251 463 l 315 489 b 387 514 368 509 381 514 b 393 513 390 514 392 514 b 406 494 402 510 406 502 b 397 476 406 487 404 480 b 323 446 396 474 363 462 l 251 417 l 251 283 l 251 148 l 254 151 b 370 199 291 183 332 199 b 415 191 385 199 400 197 b 483 84 458 176 483 134 b 461 0 483 58 476 29 b 332 -142 439 -40 411 -72 l 255 -215 b 231 -229 240 -229 239 -229 b 216 -223 224 -229 220 -227 b 210 -158 210 -217 210 -223 b 210 -120 210 -148 210 -136 l 210 -29 l 205 -34 b 100 -142 182 -65 159 -88 l 23 -215 b -1 -229 9 -229 6 -229 b -19 -217 -9 -229 -16 -224 l -20 -215 l -21 48 l -21 310 l -83 287 b -152 262 -133 266 -145 262 b -157 263 -153 262 -155 262 b -171 283 -166 266 -171 274 b -161 301 -171 290 -167 297 b -91 328 -160 302 -129 315 l -21 356 l -21 487 l -20 617 l -19 621 b -8 631 -17 626 -12 630 m 210 288 b 210 401 210 351 210 401 b 114 365 209 401 167 384 l 20 327 l 20 238 l 20 148 l 21 151 b 140 199 59 183 102 199 b 206 180 164 199 187 192 l 209 177 b 209 177 209 177 209 177 b 210 288 210 177 210 199 m 110 131 b 96 133 106 133 100 133 b 89 133 93 133 91 133 b 24 87 63 129 40 113 l 20 80 l 20 -37 l 20 -156 l 23 -152 b 144 81 96 -72 144 20 l 144 83 b 110 131 144 113 134 126 m 341 131 b 328 133 337 133 332 133 b 322 133 326 133 323 133 b 257 87 296 129 273 113 l 251 80 l 251 -37 l 251 -156 l 255 -152 b 375 81 328 -72 375 20 l 375 83 b 341 131 375 113 367 126 "},v92:{x_min:0,x_max:598.890625,ha:611,o:"m 62 181 b 77 183 66 183 72 183 b 91 181 83 183 88 183 b 202 131 100 180 106 177 l 299 87 l 394 131 b 517 183 499 181 502 183 b 519 183 517 183 518 183 b 598 104 567 183 598 144 b 577 49 598 84 592 65 b 518 15 567 38 563 37 b 484 0 499 6 484 0 b 518 -16 484 -1 499 -8 b 577 -51 563 -38 567 -40 b 598 -105 592 -66 598 -86 b 519 -184 598 -145 567 -184 b 517 -184 518 -184 517 -184 b 394 -133 502 -184 499 -183 l 299 -88 l 202 -133 b 81 -184 99 -183 95 -184 b 77 -184 80 -184 78 -184 b 0 -105 29 -184 0 -145 b 20 -51 0 -86 5 -66 b 80 -16 29 -40 34 -38 b 114 -1 98 -8 114 -1 b 80 15 114 0 98 6 b 20 49 34 37 29 38 b 0 104 6 65 0 84 b 62 181 0 140 23 174 m 88 134 b 74 136 85 134 80 136 b 68 134 72 136 69 136 b 46 104 54 130 46 117 b 55 81 46 95 49 88 b 149 34 59 76 53 80 b 224 -1 190 15 224 0 b 144 -38 224 -1 187 -18 b 54 -84 59 -79 58 -79 b 46 -105 49 -90 46 -98 b 76 -137 46 -122 58 -137 b 78 -137 77 -137 77 -137 b 194 -86 87 -137 76 -141 b 298 -36 250 -58 298 -36 b 298 -36 298 -36 298 -36 b 402 -84 299 -36 345 -58 b 518 -137 522 -141 510 -137 b 521 -137 519 -137 519 -137 b 551 -105 539 -137 551 -122 b 541 -83 551 -98 548 -90 b 447 -36 537 -77 544 -81 b 374 -1 406 -16 374 -1 b 447 34 374 0 406 15 b 541 81 544 80 537 76 b 551 104 548 88 551 97 b 521 136 551 120 539 136 b 518 136 519 136 519 136 b 517 136 518 136 517 136 l 517 136 b 402 83 511 136 511 136 b 298 34 345 56 299 34 b 298 34 298 34 298 34 b 194 84 298 34 250 56 b 88 134 137 111 89 133 "},v93:{x_min:0,x_max:438.28125,ha:447,o:"m 212 205 b 219 205 213 205 216 205 b 239 183 228 205 231 204 b 421 -163 298 40 363 -83 b 438 -191 434 -180 438 -186 b 436 -197 438 -192 438 -195 b 424 -206 434 -204 431 -206 b 406 -201 420 -206 415 -205 b 216 -156 347 -172 281 -156 b 23 -205 148 -156 80 -173 b 14 -206 20 -206 17 -206 b 0 -191 6 -206 0 -201 b 6 -176 0 -187 1 -183 b 202 192 63 -104 142 45 b 212 205 205 199 208 202 m 264 48 l 249 81 l 243 94 l 242 91 b 89 -126 208 36 137 -66 b 81 -138 85 -133 81 -138 b 81 -138 81 -138 81 -138 b 81 -138 81 -138 81 -138 b 95 -133 81 -138 87 -136 b 280 -94 156 -108 221 -94 b 334 -98 299 -94 317 -95 b 343 -99 338 -99 343 -99 b 343 -99 343 -99 343 -99 b 338 -94 343 -99 341 -97 b 264 48 318 -58 287 1 "},v94:{x_min:-149.71875,x_max:148.359375,ha:151,o:"m -9 215 b 0 217 -6 217 -4 217 b 19 205 8 217 14 213 b 20 142 20 202 20 201 l 20 84 l 23 84 b 144 -27 81 74 129 30 b 148 -66 147 -40 148 -54 b 36 -213 148 -134 103 -197 b 0 -219 24 -217 12 -219 b -145 -104 -68 -219 -129 -173 b -149 -68 -148 -91 -149 -79 b -24 84 -149 6 -98 74 l -21 84 l -21 142 b -19 205 -20 201 -20 202 b -9 215 -17 209 -13 213 m -21 -15 b -23 41 -21 37 -21 41 b -23 41 -23 41 -23 41 b -76 11 -35 40 -62 26 b -108 -65 -98 -11 -108 -38 b -1 -176 -108 -122 -65 -176 b 107 -65 63 -176 107 -122 b 74 11 107 -38 96 -11 b 20 41 61 26 32 41 b 20 -15 20 41 20 15 b 19 -74 20 -72 20 -72 b 0 -87 14 -83 6 -87 b -19 -74 -8 -87 -16 -83 b -21 -15 -20 -72 -20 -72 "},v95:{x_min:0,x_max:406.96875,ha:415,o:"m 55 181 b 70 183 61 183 66 183 b 111 170 85 183 99 179 b 160 130 115 167 137 149 l 202 95 l 245 130 b 319 181 299 176 302 179 b 334 183 325 183 330 183 b 406 109 375 183 406 148 b 401 81 406 99 405 91 b 348 24 394 65 390 59 b 318 -1 332 11 318 0 b 348 -26 318 -1 332 -12 b 401 -83 390 -61 394 -66 b 406 -111 405 -93 406 -101 b 334 -184 406 -149 375 -184 b 319 -183 330 -184 325 -184 b 245 -131 302 -180 299 -177 l 202 -97 l 160 -131 b 85 -183 107 -177 103 -180 b 70 -184 80 -184 76 -184 b 0 -111 31 -184 0 -149 b 4 -83 0 -101 1 -93 b 58 -26 10 -66 16 -61 b 88 -1 74 -12 88 -1 b 58 24 88 0 74 11 b 10 69 23 54 17 59 b 0 109 2 81 0 95 b 55 181 0 142 21 173 m 83 133 b 72 136 78 136 76 136 b 57 131 66 136 61 134 b 46 109 49 126 46 117 b 50 93 46 104 47 98 b 107 45 51 91 77 70 b 160 0 137 20 160 0 b 107 -47 160 -1 137 -22 b 50 -94 77 -72 51 -93 b 46 -111 47 -99 46 -105 b 59 -134 46 -120 50 -130 b 72 -137 62 -136 68 -137 b 83 -136 76 -137 80 -136 b 144 -84 84 -134 107 -116 b 202 -36 176 -58 202 -36 b 261 -84 202 -36 230 -58 b 323 -136 299 -116 321 -134 b 334 -137 326 -136 330 -137 b 345 -134 338 -137 343 -136 b 360 -111 355 -130 360 -120 b 355 -94 360 -105 359 -99 b 299 -47 353 -93 329 -72 b 245 0 269 -22 245 -1 b 299 45 245 0 269 20 b 355 93 329 70 353 91 b 360 109 359 98 360 104 b 345 133 360 119 355 129 b 334 136 343 134 338 136 b 323 134 330 136 326 134 b 261 83 321 133 299 115 b 202 34 230 56 202 34 b 144 83 202 34 176 56 b 83 133 106 115 84 133 "},v97:{x_min:-228.671875,x_max:227.3125,ha:232,o:"m -217 487 l -213 488 l 0 488 l 212 488 l 216 487 b 225 476 220 484 224 480 l 227 473 l 227 244 l 227 15 l 225 12 b 206 0 223 4 215 0 b 197 1 204 0 200 0 b 187 12 193 4 189 6 l 186 15 l 186 138 l 186 262 l -1 262 l -187 262 l -187 138 l -187 15 l -189 12 b -208 0 -193 4 -200 0 b -227 12 -216 0 -223 4 l -228 15 l -228 244 l -228 473 l -227 476 b -217 487 -225 480 -221 484 "},v9a:{x_min:-21.78125,x_max:367.5,ha:375,o:"m 230 1031 b 238 1032 232 1032 235 1032 b 259 1014 245 1032 251 1027 b 367 662 330 906 367 782 b 364 602 367 641 367 621 b 232 317 352 488 304 384 b 57 120 155 245 103 187 b -1 18 31 84 6 40 b -19 4 -4 11 -12 4 l -21 4 l -21 159 l -21 315 l -16 315 b 96 335 10 315 62 324 b 315 695 227 380 315 527 b 313 738 315 709 314 724 b 224 991 304 825 273 916 b 216 1013 219 999 216 1007 b 230 1031 216 1021 220 1028 "},v9b:{x_min:-24.5,x_max:313.0625,ha:319,o:"m -24 -133 l -24 -5 l -20 -5 b -1 -19 -12 -5 -4 -11 b 142 -213 13 -61 74 -144 b 258 -376 196 -269 230 -315 b 313 -605 295 -449 313 -528 b 292 -742 313 -652 306 -699 b 288 -752 289 -748 288 -752 b 288 -752 288 -752 288 -752 b 292 -764 289 -753 291 -757 b 313 -907 306 -811 313 -860 b 292 -1045 313 -954 306 -1002 b 288 -1054 289 -1050 288 -1054 b 288 -1054 288 -1054 288 -1054 b 292 -1067 289 -1054 291 -1060 b 313 -1210 306 -1113 313 -1161 b 292 -1346 313 -1257 306 -1304 b 288 -1357 289 -1353 288 -1357 b 288 -1357 288 -1357 288 -1357 b 292 -1368 289 -1357 291 -1363 b 313 -1512 306 -1415 313 -1464 b 292 -1648 313 -1560 306 -1605 b 288 -1660 289 -1654 288 -1660 b 288 -1660 288 -1660 288 -1660 b 292 -1671 289 -1660 291 -1665 b 313 -1814 306 -1719 313 -1766 b 250 -2040 313 -1897 291 -1977 b 232 -2062 238 -2057 236 -2059 b 221 -2065 230 -2063 225 -2065 b 200 -2045 210 -2065 201 -2057 b 200 -2043 200 -2044 200 -2044 b 208 -2026 200 -2037 202 -2034 b 269 -1826 249 -1966 269 -1897 b 153 -1544 269 -1726 230 -1625 b -9 -1472 115 -1506 58 -1481 b -21 -1471 -14 -1471 -19 -1471 l -24 -1471 l -24 -1343 l -24 -1215 l -20 -1215 b -1 -1229 -12 -1215 -4 -1221 b 142 -1424 13 -1270 74 -1353 b 257 -1582 196 -1478 228 -1524 b 264 -1594 261 -1589 264 -1594 l 264 -1594 b 265 -1582 264 -1594 264 -1589 b 270 -1525 268 -1562 270 -1544 b 153 -1243 270 -1424 228 -1321 b -9 -1170 115 -1203 58 -1178 b -21 -1168 -14 -1170 -19 -1168 l -24 -1168 l -24 -1041 l -24 -913 l -20 -913 b -1 -927 -12 -913 -4 -918 b 142 -1121 13 -967 74 -1050 b 257 -1281 196 -1175 228 -1221 b 264 -1292 261 -1286 264 -1292 l 264 -1292 b 265 -1279 264 -1292 264 -1286 b 270 -1222 268 -1261 270 -1242 b 153 -941 270 -1121 228 -1018 b -9 -867 115 -900 58 -875 b -21 -866 -14 -867 -19 -866 l -24 -866 l -24 -738 l -24 -610 l -20 -610 b -1 -624 -12 -610 -4 -616 b 142 -818 13 -664 74 -749 b 257 -978 196 -873 228 -918 b 264 -989 261 -984 264 -989 l 264 -989 b 265 -977 264 -989 264 -984 b 270 -920 268 -959 270 -939 b 153 -638 270 -818 228 -716 b -9 -564 115 -598 58 -573 b -21 -563 -14 -564 -19 -563 l -24 -563 l -24 -435 l -24 -308 l -20 -308 b -1 -322 -12 -308 -4 -313 b 142 -516 13 -363 74 -446 b 257 -675 196 -571 228 -616 b 264 -687 261 -681 264 -687 l 264 -687 b 265 -674 264 -687 264 -681 b 270 -617 268 -656 270 -637 b 153 -335 270 -516 228 -413 b -9 -262 115 -295 58 -270 b -21 -260 -14 -262 -19 -260 l -24 -260 l -24 -133 "},v9c:{x_min:-166.0625,x_max:-25.859375,ha:0,o:"m -49 369 b -42 370 -46 369 -44 370 b -27 360 -36 370 -29 366 b -25 355 -27 359 -25 358 b -32 335 -25 351 -28 347 b -92 52 -66 248 -87 159 b -93 -1 -93 43 -93 20 b -92 -54 -93 -23 -93 -45 b -32 -337 -85 -162 -66 -251 b -25 -355 -27 -349 -25 -352 b -42 -371 -25 -365 -32 -371 b -61 -353 -50 -371 -51 -369 b -163 -63 -119 -262 -153 -165 b -166 -1 -166 -37 -166 -31 b -163 62 -166 30 -166 36 b -61 352 -153 163 -119 260 b -49 369 -54 365 -51 366 "},v9e:{x_min:0,x_max:607.0625,ha:619,o:"m 243 631 b 250 632 246 632 249 632 b 270 620 259 632 268 628 l 272 616 l 272 201 l 272 -212 l 270 -216 b 251 -229 268 -224 259 -229 b 227 -215 243 -229 240 -229 l 151 -142 b 32 -16 81 -80 53 -49 b 0 84 9 18 0 52 b 111 199 0 149 42 199 b 137 197 119 199 127 198 b 228 151 168 191 197 177 l 231 148 l 231 383 b 232 620 231 616 231 616 b 243 631 234 624 238 630 m 168 131 b 152 133 163 133 157 133 b 107 102 130 133 111 120 b 106 86 107 97 106 91 b 111 41 106 73 108 56 b 227 -152 125 -13 171 -90 l 231 -156 l 231 -37 l 231 80 l 225 87 b 168 131 210 111 190 126 m 347 631 b 353 632 348 632 351 632 b 374 620 363 632 371 628 b 375 383 375 616 375 616 l 375 148 l 377 151 b 492 199 415 183 454 199 b 537 191 507 199 522 197 b 607 84 582 176 607 134 b 583 0 607 58 598 29 b 455 -142 562 -40 533 -72 l 378 -215 b 355 -229 364 -229 362 -229 b 334 -216 345 -229 337 -224 l 333 -212 l 333 201 l 333 616 l 334 620 b 347 631 337 624 341 630 m 465 131 b 451 133 461 133 455 133 b 445 133 449 133 446 133 b 379 87 419 129 396 113 l 375 80 l 375 -37 l 375 -156 l 378 -152 b 499 81 451 -72 499 20 l 499 83 b 465 131 499 113 490 126 "},va3:{x_min:58.53125,x_max:228.671875,ha:294,o:"m 138 371 b 142 373 140 371 141 373 b 178 342 149 373 156 366 b 228 251 217 297 228 278 b 228 244 228 248 228 247 b 176 147 227 212 212 184 b 123 73 152 122 132 93 b 121 62 122 70 121 66 b 145 13 121 48 129 31 b 153 -2 151 6 153 1 b 149 -9 153 -5 152 -6 b 144 -11 148 -11 145 -11 b 129 -1 140 -11 136 -8 b 61 87 89 37 68 68 b 58 113 59 95 58 105 b 110 215 58 144 74 177 b 163 287 134 240 155 269 b 166 299 166 291 166 295 b 141 348 166 313 157 330 b 133 360 134 356 133 358 b 133 363 133 362 133 362 b 138 371 133 367 136 370 "},va5:{x_min:0,x_max:349.8125,ha:357,o:"m 88 302 b 103 303 93 302 98 303 b 202 224 149 303 191 270 b 205 199 204 216 205 208 b 178 129 205 173 196 147 l 175 126 l 182 127 b 307 249 236 142 284 190 b 313 259 308 254 311 258 b 329 267 317 265 323 267 b 349 247 340 267 349 259 b 201 -263 349 242 204 -258 b 182 -273 197 -270 190 -273 b 163 -260 174 -273 166 -269 b 161 -256 161 -259 161 -258 b 217 -59 161 -248 170 -220 b 272 129 247 43 272 127 b 272 129 272 129 272 129 b 264 122 272 129 268 126 b 140 80 227 94 183 80 b 36 115 102 80 65 91 b 0 194 10 136 0 165 b 88 302 0 244 32 292 "},va9:{x_min:-24.5,x_max:314.421875,ha:321,o:"m -24 -145 l -24 -5 l -20 -5 b 0 -23 -9 -5 -2 -12 b 27 -87 4 -38 14 -66 b 138 -220 53 -136 88 -177 b 235 -328 179 -255 208 -288 b 314 -592 287 -409 314 -501 b 292 -732 314 -639 307 -687 l 289 -742 l 294 -756 b 314 -896 307 -802 314 -849 b 292 -1035 314 -943 307 -991 l 289 -1045 l 294 -1057 b 314 -1197 307 -1104 314 -1152 b 292 -1338 314 -1246 307 -1292 l 289 -1347 l 294 -1360 b 314 -1500 307 -1407 314 -1454 b 273 -1689 314 -1565 300 -1628 b 250 -1712 265 -1710 261 -1712 b 228 -1691 236 -1712 228 -1704 l 228 -1685 l 234 -1675 b 270 -1507 258 -1621 270 -1564 b 98 -1193 270 -1381 209 -1261 b 40 -1174 76 -1179 58 -1174 b -10 -1189 24 -1174 8 -1178 b -20 -1192 -14 -1192 -16 -1192 l -24 -1192 l -24 -1052 l -24 -913 l -20 -913 b 0 -931 -9 -913 -2 -920 b 27 -995 4 -946 14 -974 b 138 -1128 53 -1043 88 -1085 b 257 -1275 190 -1172 228 -1220 b 262 -1283 259 -1279 262 -1283 l 262 -1283 b 269 -1249 264 -1282 268 -1260 b 270 -1206 270 -1233 270 -1220 b 98 -891 270 -1075 206 -957 b 40 -871 76 -877 58 -871 b -10 -886 24 -871 8 -875 b -20 -889 -14 -889 -16 -889 l -24 -889 l -24 -749 l -24 -610 l -20 -610 b 0 -628 -9 -610 -2 -617 b 27 -692 4 -644 14 -671 b 138 -825 53 -741 88 -782 b 257 -973 190 -870 228 -917 b 262 -981 259 -977 262 -981 l 262 -981 b 269 -946 264 -979 268 -957 b 270 -903 270 -931 270 -917 b 98 -588 270 -774 206 -655 b 40 -569 76 -574 58 -569 b -10 -584 24 -569 8 -574 b -20 -587 -14 -587 -16 -587 l -24 -587 l -24 -448 l -24 -308 l -20 -308 b 0 -326 -9 -308 -2 -315 b 27 -390 4 -341 14 -369 b 138 -523 53 -438 88 -480 b 257 -670 190 -567 228 -614 b 262 -678 259 -674 262 -678 b 262 -678 262 -678 262 -678 b 269 -644 264 -677 268 -656 b 270 -601 270 -628 270 -614 b 98 -285 270 -471 206 -352 b 40 -266 76 -273 58 -266 b -10 -281 24 -266 8 -272 b -20 -284 -14 -284 -16 -284 l -24 -284 l -24 -145 "},vaa:{x_min:-1.359375,x_max:752.703125,ha:768,o:"m 490 985 b 504 986 495 986 500 986 b 604 907 551 986 593 954 b 607 884 607 900 607 892 b 581 813 607 857 597 831 l 578 810 l 583 811 b 710 932 638 827 687 873 b 714 943 711 936 713 942 b 730 952 720 949 725 952 b 752 931 741 952 752 943 b 200 -946 752 927 204 -941 b 182 -957 197 -953 190 -957 b 163 -945 174 -957 166 -953 b 161 -939 161 -942 161 -942 b 217 -743 161 -931 170 -904 b 272 -555 247 -639 272 -555 b 272 -555 272 -555 272 -555 b 264 -560 272 -555 268 -557 b 140 -603 227 -589 182 -603 b 36 -567 102 -603 65 -592 b -1 -487 12 -548 -1 -517 b 17 -427 -1 -466 5 -445 b 103 -380 38 -395 70 -380 b 191 -433 137 -380 172 -398 b 205 -484 201 -448 205 -466 b 178 -553 205 -509 196 -535 l 175 -557 l 182 -555 b 307 -435 236 -539 284 -494 b 372 -213 308 -430 372 -215 b 372 -213 372 -213 372 -213 b 364 -219 372 -213 368 -216 b 240 -262 328 -247 283 -262 b 137 -226 202 -262 166 -249 b 99 -145 112 -206 99 -176 b 118 -84 99 -124 106 -104 b 204 -38 138 -54 171 -38 b 292 -91 238 -38 273 -56 b 306 -141 302 -106 306 -124 b 279 -212 306 -167 296 -194 l 276 -215 l 281 -213 b 408 -93 336 -198 385 -151 b 473 129 409 -88 473 127 b 473 129 473 129 473 129 b 465 122 473 129 469 126 b 341 80 428 94 383 80 b 236 115 303 80 266 91 b 200 195 213 136 200 165 b 217 256 200 217 206 238 b 304 303 239 287 272 303 b 393 249 338 303 374 285 b 406 199 402 234 406 217 b 379 129 406 173 397 148 l 377 126 l 382 127 b 509 248 436 142 485 190 b 574 470 510 254 574 469 b 574 470 574 470 574 470 b 566 464 574 470 570 467 b 442 421 529 435 484 421 b 337 458 404 421 367 433 b 300 538 314 477 300 508 b 318 598 300 559 306 580 b 404 645 340 630 372 645 b 494 592 439 645 475 627 b 507 541 502 577 507 559 b 480 471 507 516 498 489 l 477 467 l 483 470 b 608 589 537 485 586 531 b 675 811 611 595 675 810 b 675 811 675 811 675 811 b 666 806 675 811 671 809 b 543 763 628 777 585 763 b 438 799 504 763 468 775 b 401 878 412 820 401 849 b 490 985 401 928 434 977 "},vab:{x_min:0,x_max:272.21875,ha:278,o:"m 243 631 b 250 632 246 632 249 632 b 270 620 259 632 268 628 l 272 616 l 272 201 l 272 -212 l 270 -216 b 251 -229 268 -224 259 -229 b 227 -215 243 -229 240 -229 l 151 -142 b 32 -16 81 -80 53 -49 b 0 84 9 18 0 52 b 111 199 0 149 42 199 b 137 197 119 199 127 198 b 228 151 168 191 197 177 l 231 148 l 231 383 b 232 620 231 616 231 616 b 243 631 234 624 238 630 m 168 131 b 152 133 163 133 157 133 b 107 102 130 133 111 120 b 106 86 107 97 106 91 b 111 41 106 73 108 56 b 227 -152 125 -13 171 -90 l 231 -156 l 231 -37 l 231 80 l 225 87 b 168 131 210 111 190 126 "},vad:{x_min:0,x_max:873.828125,ha:892,o:"m 0 0 l 0 703 l 81 703 l 164 703 l 164 0 l 164 -705 l 81 -705 l 0 -705 l 0 0 m 225 0 l 225 703 l 246 703 l 268 703 l 268 366 l 268 30 l 274 36 b 314 79 284 44 302 63 b 413 302 357 137 392 213 b 432 327 419 324 421 327 b 449 306 443 327 447 322 b 611 115 457 195 529 115 b 651 122 624 115 638 117 b 728 316 705 140 724 188 b 729 388 728 342 729 366 b 671 635 729 533 711 602 b 581 662 649 652 616 662 b 477 637 545 662 510 653 l 475 635 l 477 634 b 503 627 488 632 495 631 b 545 556 532 612 545 584 b 491 480 545 524 526 491 b 465 474 481 476 473 474 b 379 563 417 474 379 516 b 389 602 379 576 382 588 b 541 691 409 641 479 681 b 582 694 555 692 568 694 b 865 462 714 694 834 598 b 873 392 871 440 873 416 b 865 317 873 367 871 341 b 639 84 839 194 748 101 b 612 83 630 83 620 83 b 511 116 577 83 543 94 b 504 120 509 119 506 120 b 504 120 504 120 504 120 b 469 59 504 120 488 93 l 432 -1 l 469 -61 b 504 -122 488 -94 504 -122 b 504 -122 504 -122 504 -122 b 511 -117 506 -122 509 -120 b 612 -84 543 -95 577 -84 b 665 -91 630 -84 647 -87 b 869 -338 771 -122 850 -216 b 873 -392 872 -356 873 -374 b 798 -595 873 -469 847 -539 b 581 -695 741 -662 660 -695 b 406 -626 517 -695 454 -671 b 381 -563 389 -607 381 -585 b 465 -477 381 -519 413 -477 b 545 -559 514 -477 545 -519 b 503 -628 545 -587 532 -613 b 477 -635 495 -632 488 -634 l 475 -637 l 477 -638 b 581 -663 510 -655 545 -663 b 671 -637 616 -663 649 -653 b 729 -391 711 -603 729 -534 b 728 -317 729 -367 728 -344 b 623 -117 722 -173 698 -124 b 611 -116 619 -116 615 -116 b 449 -308 528 -116 457 -198 b 432 -328 447 -323 443 -328 b 413 -303 421 -328 419 -326 b 314 -80 392 -215 357 -138 b 274 -37 302 -65 284 -45 l 268 -31 l 268 -367 l 268 -705 l 246 -705 l 225 -705 l 225 0 "},vb1:{x_min:78.9375,x_max:485.921875,ha:417,o:"m 362 378 b 378 380 367 380 372 380 b 472 348 415 380 453 367 b 485 315 481 338 485 327 b 462 273 485 298 477 281 b 439 267 454 269 446 267 b 398 290 424 267 409 274 b 344 319 385 309 364 319 b 281 269 315 319 289 301 b 279 262 280 266 279 262 b 276 256 279 260 277 258 b 274 249 276 254 274 251 b 238 127 273 248 257 192 b 201 4 217 61 201 5 b 166 -1 198 -1 200 -1 b 153 -1 163 -1 157 -1 b 141 -1 148 -1 144 -1 b 104 4 106 -1 107 -1 b 104 6 104 5 104 5 b 142 144 104 13 110 34 b 182 278 164 219 181 276 b 183 288 182 281 182 285 b 185 302 185 292 185 298 b 164 330 185 317 176 328 b 159 330 163 330 161 330 b 102 302 140 330 119 320 b 91 294 95 295 93 294 b 88 294 91 294 89 294 b 78 303 83 294 78 298 b 81 312 78 306 78 309 b 200 373 106 347 160 373 b 215 371 205 373 209 371 b 266 335 235 367 254 353 b 269 331 268 333 269 331 b 269 331 269 331 269 331 b 273 335 269 331 270 334 b 362 378 298 359 330 376 "},vb3:{x_min:0,x_max:227.3125,ha:232,o:"m 91 213 b 100 215 93 215 96 215 b 227 58 167 215 224 144 b 227 52 227 56 227 54 b 61 -201 227 -43 164 -138 b 29 -216 44 -212 36 -216 b 23 -210 27 -216 24 -213 b 21 -205 21 -208 21 -206 b 34 -192 21 -201 25 -197 b 122 -55 89 -161 122 -106 b 104 6 122 -33 117 -12 l 103 9 l 96 9 b 4 79 57 9 17 38 b 0 112 1 90 0 101 b 91 213 0 163 36 209 "},vb4:{x_min:-597.53125,x_max:596.171875,ha:608,o:"m -533 324 b -525 327 -530 326 -528 327 b -504 305 -514 327 -504 317 b -504 305 -504 305 -504 305 b -513 284 -504 299 -504 299 b -556 112 -541 226 -556 167 b -545 33 -556 84 -552 58 b -524 -20 -541 15 -532 -9 l -522 -23 l -491 15 l -413 111 b -355 174 -367 169 -363 174 b -351 174 -353 174 -352 174 b -254 86 -343 174 -348 179 b -168 -1 -208 37 -168 -1 b -100 84 -168 -1 -137 37 b -23 173 -28 173 -29 172 b -19 174 -21 174 -20 174 b -8 173 -14 174 -10 173 b 80 86 -5 172 13 151 b 166 -1 127 37 166 -1 b 235 84 166 -1 197 37 b 311 173 306 173 304 172 b 317 174 313 174 314 174 b 326 173 319 174 323 173 b 490 11 329 172 366 134 l 502 -1 l 530 34 b 568 76 560 72 563 74 b 575 77 570 77 573 77 b 596 56 586 77 596 68 b 594 48 596 54 596 51 b 417 -172 592 41 424 -166 b 405 -176 415 -174 409 -176 b 396 -174 401 -176 398 -176 b 307 -87 393 -173 372 -152 b 221 -1 259 -38 221 -1 b 152 -86 221 -1 190 -38 b 76 -176 81 -174 83 -173 b 70 -176 74 -176 73 -176 b 61 -174 66 -176 62 -174 b -27 -87 58 -173 38 -152 b -114 -1 -74 -38 -112 -1 b -182 -86 -114 -1 -145 -38 b -258 -176 -253 -174 -253 -173 b -264 -176 -259 -176 -262 -176 b -274 -174 -268 -176 -272 -174 b -438 -11 -277 -173 -348 -102 l -449 0 l -479 -37 b -524 -80 -513 -80 -514 -80 l -524 -80 b -553 -52 -534 -80 -540 -74 b -597 109 -583 -8 -597 48 b -560 280 -597 165 -585 224 b -533 324 -548 310 -540 322 "},vb6:{x_min:0,x_max:556.6875,ha:568,o:"m 289 545 b 298 546 292 545 295 546 b 318 533 306 546 315 541 b 319 428 319 530 319 528 l 319 327 l 334 327 b 526 223 412 326 485 285 b 543 172 537 206 543 190 b 447 76 543 122 503 76 b 445 76 446 76 446 76 b 359 165 394 77 359 119 b 368 205 359 179 362 192 b 441 251 382 233 412 251 b 455 249 446 251 451 251 b 460 248 458 249 460 248 b 460 248 460 248 460 248 b 454 254 460 249 458 251 b 334 295 419 280 378 294 l 319 295 l 319 4 l 319 -287 l 321 -285 b 328 -285 322 -285 325 -285 b 524 -99 424 -277 507 -198 b 541 -79 526 -84 530 -79 b 556 -97 551 -79 556 -84 b 548 -133 556 -105 553 -117 b 334 -317 521 -233 434 -306 b 322 -319 329 -317 323 -317 l 319 -319 l 319 -424 b 319 -471 319 -444 319 -459 b 313 -541 319 -544 318 -535 b 298 -548 308 -545 303 -548 b 279 -534 289 -548 281 -542 b 277 -424 277 -531 277 -530 l 277 -317 l 273 -317 b 13 -95 153 -305 51 -217 b 0 2 4 -62 0 -29 b 182 295 0 126 66 238 b 274 324 210 309 249 320 l 277 324 l 277 427 b 279 533 277 528 277 530 b 289 545 281 538 285 542 m 277 2 b 277 291 277 161 277 291 b 268 288 277 291 273 290 b 144 1 179 265 144 184 b 276 -284 144 -199 175 -267 l 277 -285 l 277 2 "},vb7:{x_min:-176.9375,x_max:251.8125,ha:257,o:"m -8 631 b -1 632 -6 632 -4 632 b 19 620 8 632 16 628 b 20 503 20 616 20 614 b 20 391 20 442 20 391 b 84 424 20 391 49 406 l 147 456 l 152 456 b 153 456 153 456 153 456 b 175 435 166 456 175 446 b 172 427 175 433 174 430 b 92 380 170 420 172 421 l 20 342 l 20 245 l 20 148 l 21 151 b 137 199 59 183 99 199 b 182 191 152 199 167 197 b 251 84 227 176 251 134 b 228 0 251 58 243 29 b 100 -142 206 -40 178 -72 l 23 -215 b 0 -229 9 -229 6 -229 b -20 -216 -9 -229 -17 -224 b -21 54 -21 -212 -21 -212 b -21 322 -21 201 -21 322 b -85 290 -21 322 -50 308 l -148 256 l -153 256 b -155 256 -155 256 -155 256 b -176 277 -167 256 -176 266 b -174 285 -176 280 -175 283 b -93 333 -171 294 -174 292 l -21 370 l -21 494 b -20 620 -21 616 -21 616 b -8 631 -17 624 -13 630 m 110 131 b 96 133 106 133 100 133 b 89 133 93 133 91 133 b 24 87 63 129 40 113 l 20 80 l 20 -37 l 20 -156 l 23 -152 b 144 81 96 -72 144 20 l 144 83 b 110 131 144 113 134 126 "},vb9:{x_min:-122.5,x_max:121.140625,ha:124,o:"m -16 145 b 0 147 -10 147 -5 147 b 121 -1 66 147 121 77 b 114 -49 121 -16 118 -33 b -1 -148 95 -112 47 -148 b -85 -106 -31 -148 -61 -134 b -122 -1 -110 -76 -122 -38 b -16 145 -122 68 -81 134 m 12 111 b 0 113 8 113 4 113 b -68 22 -29 113 -61 73 b -70 0 -69 15 -70 6 b -13 -113 -70 -49 -47 -98 b -1 -115 -9 -115 -5 -115 b 63 -40 24 -115 53 -83 b 68 -1 66 -27 68 -15 b 12 111 68 48 46 97 "},vba:{x_min:-118.421875,x_max:597.53125,ha:381,o:"m 460 574 b 464 574 461 574 462 574 b 488 574 470 574 481 574 b 500 573 491 574 498 574 b 594 503 543 570 588 538 b 597 488 596 498 597 494 b 528 417 597 449 564 417 b 502 423 519 417 510 419 b 465 481 477 434 465 458 b 488 528 465 499 472 516 b 490 530 490 530 490 530 b 490 530 490 530 490 530 b 468 517 488 530 475 523 b 349 340 419 485 377 420 b 347 330 348 334 347 330 b 383 328 347 328 363 328 b 428 326 423 328 424 328 b 442 302 438 320 442 312 b 430 281 442 294 438 285 b 385 276 424 277 426 276 l 377 276 l 332 276 l 330 269 b 178 -117 303 126 250 -9 b 1 -249 129 -194 69 -237 b -20 -251 -6 -251 -13 -251 b -114 -187 -65 -251 -100 -227 b -118 -156 -117 -177 -118 -166 b -51 -84 -118 -116 -91 -84 b -31 -87 -46 -84 -39 -86 b 16 -152 0 -95 16 -124 b -12 -205 16 -173 8 -194 b -16 -208 -14 -206 -16 -208 b -14 -208 -16 -208 -14 -208 b -9 -206 -14 -208 -12 -208 b 74 -124 23 -197 54 -166 b 172 224 98 -79 125 22 b 185 276 178 252 183 274 b 185 276 185 276 185 276 b 141 276 185 276 181 276 b 91 280 96 276 96 276 b 77 302 83 285 77 294 b 91 326 77 312 83 320 b 148 328 95 328 96 328 l 198 330 l 202 341 b 460 574 249 473 351 566 "},vbf:{x_min:-53.078125,x_max:513.140625,ha:485,o:"m 185 383 b 196 384 187 383 191 384 b 277 334 230 384 259 365 b 288 301 281 324 288 306 b 288 297 288 298 288 297 b 294 302 289 297 291 299 b 394 370 323 338 367 367 b 404 371 398 370 401 371 b 510 272 453 371 498 328 b 513 237 513 262 513 251 b 507 172 513 217 511 192 b 326 -34 487 59 412 -26 b 314 -36 322 -36 318 -36 b 274 -24 298 -36 283 -31 l 265 -16 b 224 44 246 -1 232 20 b 223 49 224 47 223 49 b 223 49 223 49 223 49 b 149 -197 221 48 149 -194 b 149 -198 149 -197 149 -198 b 170 -210 149 -202 155 -205 b 187 -215 174 -210 175 -212 b 204 -231 201 -219 204 -222 b 197 -245 204 -240 202 -242 l 194 -248 l 76 -248 l -42 -248 l -46 -245 b -53 -231 -51 -242 -53 -240 b -35 -215 -53 -222 -49 -217 b -13 -210 -21 -212 -20 -212 b -6 -208 -10 -209 -8 -208 b 0 -206 -6 -208 -2 -206 b 25 -188 13 -201 21 -195 b 163 280 28 -183 163 276 b 166 291 163 283 164 287 b 167 302 167 295 167 299 b 155 324 167 315 161 324 b 155 324 155 324 155 324 b 65 230 125 322 85 280 b 53 215 61 217 58 215 b 51 215 53 215 51 215 b 42 224 46 215 42 217 b 57 263 42 231 47 244 b 140 360 77 305 104 337 b 152 370 144 365 149 369 b 185 383 157 376 172 381 m 374 306 b 366 308 371 308 368 308 b 300 273 348 308 321 294 b 284 254 288 262 287 259 b 280 242 283 249 281 245 b 257 169 279 240 270 213 l 236 98 l 236 93 b 251 48 238 77 243 61 b 279 27 258 37 272 27 b 281 27 279 27 280 27 b 291 31 281 27 287 30 b 396 170 334 52 378 109 b 406 247 402 197 406 224 b 401 277 406 259 405 270 b 374 306 397 290 383 303 "},vc3:{x_min:-10.890625,x_max:299.4375,ha:294,o:"m 136 460 b 142 462 137 462 140 462 b 166 449 152 462 161 456 b 171 428 168 446 168 445 b 288 131 194 322 238 209 b 298 115 295 120 296 117 b 299 106 298 112 299 109 b 273 81 299 91 287 81 b 255 86 268 81 261 83 b 155 116 225 104 183 116 l 152 116 l 149 108 b 141 83 148 102 144 91 b 134 48 137 69 134 58 b 149 9 134 34 140 24 b 153 -1 152 5 153 1 b 149 -9 153 -5 152 -6 b 144 -11 148 -11 147 -11 b 122 2 138 -11 133 -6 b 95 61 104 20 95 38 b 107 108 95 74 99 90 b 108 113 107 111 108 112 b 107 113 108 113 108 113 b 102 113 106 113 104 113 b 31 86 76 108 53 98 b 14 80 24 81 20 80 b -10 106 0 80 -10 91 b 0 131 -10 115 -9 116 b 115 430 49 209 91 317 b 136 460 119 451 123 456 "},vd0:{x_min:-10.890625,x_max:299.4375,ha:294,o:"m 44 174 b 51 174 47 174 49 174 b 68 173 55 174 61 174 l 287 112 l 551 40 b 615 20 617 22 609 23 b 626 0 622 16 626 8 b 615 -22 626 -9 622 -18 b 613 -23 613 -23 613 -23 b 613 -23 613 -23 613 -23 b 287 -113 613 -24 597 -29 l 68 -174 b 53 -176 61 -176 57 -176 b 39 -172 47 -176 43 -174 b 27 -151 31 -167 27 -159 b 39 -129 27 -141 31 -133 b 230 -74 43 -124 20 -131 l 370 -36 l 468 -9 b 498 0 484 -4 498 -1 b 468 8 498 0 484 2 l 370 34 l 230 73 b 40 126 28 129 43 124 b 27 149 31 131 27 140 b 44 174 27 161 34 170 m 205 110 l 205 300 b 205 330 245 330 245 300 l 245 300 l 245 -300 b 245 -330 205 -330 205 -300 l 205 -300 l 205 110 l 345 90 m 345 90 l 345 330 b 345 360 385 360 385 330 l 385 330 l 385 -270 b 385 -300 345 -300 345 -270 l 345 -270 l 345 90 "},vd1:{x_min:-20,x_max:320,ha:257,o:"m -8 200 b -8 210 8 200 16 200 l 20 148 -199 l 23 -615 b 0 -629 9 -629 6 -629 l -21 -612 l -21 -201 l -21 216 l -20 200 m 16 200 l 310 0 l 240 0 l 16 140 l 16 -120 l 240 0 l 310 0 l 16 -200 "},vd2:{x_min:0,x_max:430.75,ha:386,o:"m 0 200 l 0 -200 l 430 -200 l 430 200 l 0 200 "},vd3:{x_min:0,x_max:430.75,ha:386,o:"m 0 200 l 0 -200 l 430 -200 l 430 200 l 0 200 l 50 150 l 380 150 l 380 -150 l 50 -150 l 50 150 "},vd4:{x_min:0,x_max:430.75,ha:360,o:"m 0 150 l 0 -150 l 430 -150 l 430 150 l 0 150 "},vd5:{x_min:0,x_max:430.75,ha:360,o:"m 0 150 l 0 -150 l 430 -150 l 430 150 l 0 150 l 50 100 l 380 100 l 380 -100 l 50 -100 l 50 100"},vd6:{x_min:0,x_max:430.75,ha:360,o:"m -146 537 b -138 538 -143 538 -141 538 b -118 525 -129 538 -121 533 b -117 390 -117 522 -117 521 b -115 259 -117 268 -117 259 b -115 259 -115 259 -115 259 b -59 272 -104 263 -62 272 b -39 259 -50 272 -42 267 b -37 209 -38 257 -37 233 b -39 159 -37 185 -38 162 b -85 138 -43 149 -44 149 l -117 131 l -117 21 b -115 -88 -117 -80 -117 -88 b -115 -88 -115 -88 -115 -88 b -59 -75 -104 -84 -62 -75 b -44 -81 -52 -75 -48 -77 b -38 -124 -38 -87 -38 -85 b -38 -138 -38 -124 -38 -138 b -38 -152 -38 -138 -38 -152 b -44 -195 -38 -191 -38 -190 b -85 -209 -48 -200 -48 -200 l -117 -217 l -117 -349 b -118 -486 -117 -481 -117 -482 b -138 -499 -121 -494 -129 -499 b -153 -493 -143 -499 -149 -497 b -159 -415 -158 -487 -159 -496 b -159 -355 -159 -398 -159 -379 b -159 -227 -159 -284 -159 -227 b -205 -238 -159 -227 -180 -232 b -250 -249 -230 -244 -250 -249 b -251 -386 -251 -249 -251 -311 b -252 -525 -251 -521 -251 -522 b -272 -538 -255 -534 -264 -538 b -287 -532 -277 -538 -283 -536 b -293 -452 -292 -527 -293 -536 b -293 -391 -293 -436 -293 -415 b -294 -260 -293 -269 -293 -260 b -294 -260 -294 -260 -294 -260 b -348 -272 -306 -264 -345 -272 b -368 -259 -357 -272 -365 -267 b -369 -209 -369 -257 -369 -233 b -368 -159 -369 -185 -369 -162 b -323 -139 -364 -149 -362 -148 l -293 -131 l -293 -22 b -294 87 -293 80 -293 87 b -294 87 -294 87 -294 87 b -348 75 -306 84 -345 75 b -368 88 -357 75 -365 80 b -369 138 -369 91 -369 114 b -368 188 -369 162 -369 186 b -323 209 -364 198 -362 199 l -293 216 l -293 349 b -292 486 -293 481 -293 482 b -272 499 -288 494 -280 499 b -257 493 -266 499 -261 497 b -251 414 -251 487 -251 496 b -251 354 -251 398 -251 378 b -251 226 -251 284 -251 226 b -205 238 -250 226 -230 231 b -159 249 -180 244 -159 249 b -159 385 -159 249 -159 310 b -157 525 -159 521 -159 522 b -146 537 -156 530 -151 535 z m -159 11 b -159 120 -159 98 -159 120 l -159 120 b -175 116 -160 120 -167 119 b -221 105 -184 114 -204 109 l -251 98 l -251 -12 b -251 -121 -251 -72 -251 -121 b -205 -110 -250 -121 -230 -116 b -159 -99 -180 -104 -159 -99 b -159 11 -159 -99 -159 -49 z m 89 517 b 97 519 92 518 94 519 b 117 505 106 519 114 513 b 119 376 119 502 119 501 l 119 249 l 145 258 b 176 267 169 266 172 267 b 177 267 176 267 177 267 b 196 255 186 267 192 263 l 197 252 l 197 205 b 197 181 197 195 197 187 b 193 149 197 153 197 153 b 152 131 190 144 187 143 l 119 120 l 119 10 b 119 -100 119 -62 119 -100 b 145 -91 120 -100 131 -96 b 173 -82 159 -86 171 -82 b 176 -81 174 -81 175 -81 b 196 -94 185 -81 193 -87 b 198 -151 197 -97 198 -125 b 197 -194 198 -172 197 -192 b 153 -218 193 -203 192 -204 l 119 -230 l 119 -367 l 118 -504 l 117 -507 b 97 -519 113 -514 105 -519 b 82 -512 92 -519 87 -517 b 76 -434 77 -507 76 -516 b 76 -374 76 -418 76 -398 b 76 -245 76 -303 76 -245 b 52 -254 76 -245 65 -249 b 19 -263 34 -260 25 -263 b 6 -257 13 -263 10 -261 b 0 -214 0 -251 0 -253 b 0 -200 0 -210 0 -205 b 0 -188 0 -196 0 -192 b 6 -143 0 -147 0 -149 b 46 -126 10 -139 10 -139 l 76 -115 l 76 -5 b 76 106 76 56 76 106 b 51 98 76 106 64 102 b 18 89 34 92 25 89 b 6 95 13 89 10 91 b 0 139 0 101 0 99 b 0 153 0 143 0 148 b 0 179 0 163 0 172 b 44 225 0 215 3 211 l 76 236 l 76 369 b 78 505 76 501 76 502 b 89 517 80 510 85 515 z "},vd7:{x_min:0,x_max:430.75,ha:360,o:"m 283 633 b 291 634 286 634 289 634 b 311 621 300 634 308 629 b 313 505 313 618 313 617 b 313 393 313 443 313 393 b 378 425 313 393 343 407 l 443 458 l 448 458 b 449 458 449 458 449 458 b 471 437 462 458 471 448 b 469 429 471 434 470 432 b 387 382 466 421 469 423 l 313 344 l 313 247 l 313 150 l 315 152 b 433 201 353 184 394 201 b 479 193 448 201 464 198 b 549 86 524 177 549 135 b 526 1 549 59 541 29 b 395 -143 504 -39 475 -71 b 316 -214 351 -182 341 -191 b 292 -229 302 -228 300 -229 b 272 -216 283 -229 275 -224 b 271 55 271 -212 271 -212 b 270 323 271 203 270 323 b 205 291 270 323 241 308 l 140 258 l 135 258 b 134 258 135 258 134 258 b 112 279 121 258 112 267 b 114 287 112 281 113 284 b 196 334 117 295 114 293 l 271 371 l 271 495 b 272 621 271 617 271 618 b 283 633 274 626 279 631 z m 404 133 b 391 134 400 134 395 134 b 384 134 388 134 386 134 b 318 88 358 130 335 114 l 313 81 l 313 -37 l 313 -156 l 316 -152 b 439 83 391 -71 439 22 l 439 84 b 404 133 439 115 430 128 z m -8 633 l -8 633 b 0 634 -6 634 -3 634 b 20 621 8 634 17 629 b 21 384 21 618 21 617 l 21 150 l 24 152 b 141 201 62 184 102 201 b 187 193 157 201 172 198 b 257 86 232 177 257 135 b 234 1 257 59 250 29 b 103 -143 212 -39 183 -71 b 24 -214 60 -182 49 -191 b 0 -229 10 -228 8 -229 b -20 -216 -9 -229 -17 -224 l -21 -212 l -21 203 l -21 618 l -20 621 b -8 633 -18 626 -13 631 z m 113 133 l 113 133 b 99 134 109 134 103 134 b 93 134 97 134 94 134 b 26 88 66 130 43 114 l 21 81 l 21 -37 l 21 -156 l 25 -152 b 148 83 99 -71 148 22 l 148 84 b 113 133 148 115 138 128 z "}},cssFontWeight:"normal",ascender:1903,underlinePosition:-125,cssFontStyle:"normal",boundingBox:{yMin:-2065.375,xMin:-695.53125,yMax:1901.578125,xMax:1159.671875},resolution:1e3,descender:-2066,familyName:"VexFlow-18",lineHeight:4093,underlineThickness:50}},9515:(t,e,i)=>{"use strict";i.d(e,{i:()=>s});var n=i(4552);class s{static GCD(t,e){if("number"!=typeof t||"number"!=typeof e)throw new n.s.RERR("BadArgument",`Invalid numbers: ${t}, ${e}`);let i;for(;0!==e;)i=e,e=t%e,t=i;return t}static LCM(t,e){return t*e/s.GCD(t,e)}static LCMM(t){if(0===t.length)return 0;if(1===t.length)return t[0];if(2===t.length)return s.LCM(t[0],t[1]);{const e=t[0];return t.shift(),s.LCM(e,s.LCMM(t))}}constructor(t,e){this.set(t,e)}set(t,e){return this.numerator=void 0===t?1:t,this.denominator=void 0===e?1:e,this}value(){return this.numerator/this.denominator}simplify(){let t=this.numerator,e=this.denominator;const i=s.GCD(t,e);return t/=i,e/=i,e<0&&(e=-e,t=-t),this.set(t,e)}add(t,e){let i,n;t instanceof s?(i=t.numerator,n=t.denominator):(i=void 0!==t?t:0,n=void 0!==e?e:1);const r=s.LCM(this.denominator,n),o=r/this.denominator,a=r/n,l=this.numerator*o+i*a;return this.set(l,r)}subtract(t,e){let i,n;t instanceof s?(i=t.numerator,n=t.denominator):(i=void 0!==t?t:0,n=void 0!==e?e:1);const r=s.LCM(this.denominator,n),o=r/this.denominator,a=r/n,l=this.numerator*o-i*a;return this.set(l,r)}multiply(t,e){let i,n;return t instanceof s?(i=t.numerator,n=t.denominator):(i=void 0!==t?t:1,n=void 0!==e?e:1),this.set(this.numerator*i,this.denominator*n)}divide(t,e){let i,n;return t instanceof s?(i=t.numerator,n=t.denominator):(i=void 0!==t?t:1,n=void 0!==e?e:1),this.set(this.numerator*n,this.denominator*i)}equals(t){const e=s.__compareA.copy(t).simplify(),i=s.__compareB.copy(this).simplify();return e.numerator===i.numerator&&e.denominator===i.denominator}greaterThan(t){const e=s.__compareB.copy(this);return e.subtract(t),e.numerator>0}greaterThanEquals(t){const e=s.__compareB.copy(this);return e.subtract(t),e.numerator>=0}lessThan(t){return!this.greaterThanEquals(t)}lessThanEquals(t){return!this.greaterThan(t)}clone(){return new s(this.numerator,this.denominator)}copy(t){return"number"==typeof t?this.set(t||0,1):this.set(t.numerator,t.denominator)}quotient(){return Math.floor(this.numerator/this.denominator)}fraction(){return this.numerator%this.denominator}abs(){return this.denominator=Math.abs(this.denominator),this.numerator=Math.abs(this.numerator),this}toString(){return this.numerator+"/"+this.denominator}toSimplifiedString(){return s.__tmp.copy(this).simplify().toString()}toMixedString(){let t="";const e=this.quotient(),i=s.__tmp.copy(this);return e<0?i.abs().fraction():i.fraction(),0!==e?(t+=e,0!==i.numerator&&(t+=" "+i.toSimplifiedString())):t=0===i.numerator?"0":i.toSimplifiedString(),t}parse(t){const e=t.split("/"),i=parseInt(e[0],10),n=e[1]?parseInt(e[1],10):1;return this.set(i,n)}}s.__compareA=new s,s.__compareB=new s,s.__tmp=new s},2306:(t,e,i)=>{"use strict";i.d(e,{r:()=>h});var n=i(4552),s=i(2088);class r{constructor(t,e,i,n){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN,this.addPoint(t,e),this.addPoint(i,n)}width(){return this.x2-this.x1}height(){return this.y2-this.y1}addPoint(t,e){null!=t&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=t,this.x2=t),tthis.x2&&(this.x2=t)),null!=e&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),ethis.y2&&(this.y2=e))}addX(t){this.addPoint(t,null)}addY(t){this.addPoint(null,t)}addQuadraticCurve(t,e,i,n,s,r){const o=t+2/3*(i-t),a=e+2/3*(n-e),l=o+1/3*(s-t),h=a+1/3*(r-e);this.addBezierCurve(t,e,o,a,l,h,s,r)}addBezierCurve(t,e,i,n,s,r,o,a){const l=[t,e],h=[i,n],u=[s,r],c=[o,a];let d;this.addPoint(l[0],l[1]),this.addPoint(c[0],c[1]);const p=(t,e)=>Math.pow(1-t,3)*l[e]+3*Math.pow(1-t,2)*t*h[e]+3*(1-t)*Math.pow(t,2)*u[e]+Math.pow(t,3)*c[e];for(d=0;d<=1;d++){const t=6*l[d]-12*h[d]+6*u[d],e=-3*l[d]+9*h[d]-9*u[d]+3*c[d],i=3*h[d]-3*l[d];if(0===e){if(0===t)continue;const e=-i/t;0{"use strict";i.r(e),i.d(e,{default:()=>ce});var n=i(4552),s=i(8179),r=i(2088),o=i(9515);class a{static get WIDTH(){return 600}static get HEIGHT(){return 400}static get CANVAS_BROWSER_SIZE_LIMIT(){return 32767}static SanitizeCanvasDims(t,e){return Math.max(t,e)>this.CANVAS_BROWSER_SIZE_LIMIT&&(n.s.W("Canvas dimensions exceed browser limit. Cropping to "+this.CANVAS_BROWSER_SIZE_LIMIT),t>this.CANVAS_BROWSER_SIZE_LIMIT&&(t=this.CANVAS_BROWSER_SIZE_LIMIT),e>this.CANVAS_BROWSER_SIZE_LIMIT&&(e=this.CANVAS_BROWSER_SIZE_LIMIT)),[t,e]}constructor(t){this.vexFlowCanvasContext=t,t.canvas?this.canvas=t.canvas:this.canvas={width:a.WIDTH,height:a.HEIGHT}}clear(){this.vexFlowCanvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}openGroup(){}closeGroup(){}add(){}setFont(t,e,i){return this.vexFlowCanvasContext.font=(i||"")+" "+e+"pt "+t,this}setRawFont(t){return this.vexFlowCanvasContext.font=t,this}setFillStyle(t){return this.vexFlowCanvasContext.fillStyle=t,this}setBackgroundFillStyle(t){return this.background_fillStyle=t,this}setStrokeStyle(t){return this.vexFlowCanvasContext.strokeStyle=t,this}setShadowColor(t){return this.vexFlowCanvasContext.shadowColor=t,this}setShadowBlur(t){return this.vexFlowCanvasContext.shadowBlur=t,this}setLineWidth(t){return this.vexFlowCanvasContext.lineWidth=t,this}setLineCap(t){return this.vexFlowCanvasContext.lineCap=t,this}setLineDash(t){return this.vexFlowCanvasContext.lineDash=t,this}scale(t,e){return this.vexFlowCanvasContext.scale(parseFloat(t),parseFloat(e))}resize(t,e){return[t,e]=this.SanitizeCanvasDims(parseInt(t,10),parseInt(e,10)),this.vexFlowCanvasContext.resize(t,e)}rect(t,e,i,n){return this.vexFlowCanvasContext.rect(t,e,i,n)}fillRect(t,e,i,n){return this.vexFlowCanvasContext.fillRect(t,e,i,n)}clearRect(t,e,i,n){return this.vexFlowCanvasContext.clearRect(t,e,i,n)}beginPath(){return this.vexFlowCanvasContext.beginPath()}moveTo(t,e){return this.vexFlowCanvasContext.moveTo(t,e)}lineTo(t,e){return this.vexFlowCanvasContext.lineTo(t,e)}bezierCurveTo(t,e,i,n,s,r){return this.vexFlowCanvasContext.bezierCurveTo(t,e,i,n,s,r)}quadraticCurveTo(t,e,i,n){return this.vexFlowCanvasContext.quadraticCurveTo(t,e,i,n)}arc(t,e,i,n,s,r){return this.vexFlowCanvasContext.arc(t,e,i,n,s,r)}glow(){return this.vexFlowCanvasContext.glow()}fill(){return this.vexFlowCanvasContext.fill()}stroke(){return this.vexFlowCanvasContext.stroke()}closePath(){return this.vexFlowCanvasContext.closePath()}measureText(t){return this.vexFlowCanvasContext.measureText(t)}fillText(t,e,i){return this.vexFlowCanvasContext.fillText(t,e,i)}save(){return this.vexFlowCanvasContext.save()}restore(){return this.vexFlowCanvasContext.restore()}}class l{constructor(t){this.element=t,this.paper=Raphael(t),this.path="",this.pen={x:0,y:0},this.lineWidth=1,this.state={scale:{x:1,y:1},font_family:"Arial",font_size:8,font_weight:800},this.attributes={"stroke-width":.3,fill:"black",stroke:"black",font:"10pt Arial"},this.background_attributes={"stroke-width":0,fill:"white",stroke:"white",font:"10pt Arial"},this.shadow_attributes={width:0,color:"black"},this.state_stack=[]}openGroup(){}closeGroup(){}add(){}setFont(t,e,i){return this.state.font_family=t,this.state.font_size=e,this.state.font_weight=i,this.attributes.font=(this.state.font_weight||"")+" "+this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this}setRawFont(t){return this.attributes.font=t,this}setFillStyle(t){return this.attributes.fill=t,this}setBackgroundFillStyle(t){return this.background_attributes.fill=t,this.background_attributes.stroke=t,this}setStrokeStyle(t){return this.attributes.stroke=t,this}setShadowColor(t){return this.shadow_attributes.color=t,this}setShadowBlur(t){return this.shadow_attributes.width=t,this}setLineWidth(t){this.attributes["stroke-width"]=t,this.lineWidth=t}setLineDash(){return this}setLineCap(){return this}scale(t,e){return this.state.scale={x:t,y:e},this.attributes.transform="S"+t+","+e+",0,0",this.attributes.scale=t+","+e+",0,0",this.attributes.font=this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this.background_attributes.transform="S"+t+","+e+",0,0",this.background_attributes.font=this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this}clear(){this.paper.clear()}resize(t,e){return this.element.style.width=t,this.paper.setSize(t,e),this}setViewBox(t){this.paper.canvas.setAttribute("viewBox",t)}rect(t,e,i,n){return n<0&&(e+=n,n=-n),this.paper.rect(t,e,i-.5,n-.5).attr(this.attributes).attr("fill","none").attr("stroke-width",this.lineWidth),this}fillRect(t,e,i,n){return n<0&&(e+=n,n=-n),this.paper.rect(t,e,i-.5,n-.5).attr(this.attributes),this}clearRect(t,e,i,n){return n<0&&(e+=n,n=-n),this.paper.rect(t,e,i-.5,n-.5).attr(this.background_attributes),this}beginPath(){return this.path="",this.pen.x=0,this.pen.y=0,this}moveTo(t,e){return this.path+="M"+t+","+e,this.pen.x=t,this.pen.y=e,this}lineTo(t,e){return this.path+="L"+t+","+e,this.pen.x=t,this.pen.y=e,this}bezierCurveTo(t,e,i,n,s,r){return this.path+="C"+t+","+e+","+i+","+n+","+s+","+r,this.pen.x=s,this.pen.y=r,this}quadraticCurveTo(t,e,i,n){return this.path+="Q"+t+","+e+","+i+","+n,this.pen.x=i,this.pen.y=n,this}arc(t,e,i,n,s,r){function o(t){for(;t<0;)t+=2*Math.PI;for(;t>2*Math.PI;)t-=2*Math.PI;return t}if((n=o(n))>(s=o(s))){const t=n;n=s,s=t,r=!r}const a=s-n;return a>Math.PI?(this.arcHelper(t,e,i,n,n+a/2,r),this.arcHelper(t,e,i,n+a/2,s,r)):this.arcHelper(t,e,i,n,s,r),this}arcHelper(t,e,i,n,s,r){const o=t+i*Math.cos(n),a=e+i*Math.sin(n),l=t+i*Math.cos(s),h=e+i*Math.sin(s);let u=0,c=0;r?(c=1,s-nMath.PI&&(u=1),this.path+="M"+o+","+a+",A"+i+","+i+",0,"+u+","+c+","+l+","+h+"M"+this.pen.x+","+this.pen.y}glow(){const t=this.paper.set();if(this.shadow_attributes.width>0){const e=this.shadow_attributes,i=e.width/2;for(let n=1;n<=i;n++)t.push(this.paper.path(this.path).attr({stroke:e.color,"stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(e.width/i*n).toFixed(3),opacity:+((e.opacity||.3)/i).toFixed(3),transform:this.attributes.transform,scale:this.attributes.scale}))}return t}fill(){const t=this.paper.path(this.path).attr(this.attributes).attr("stroke-width",0);return this.glow(t),this}stroke(){const t=this.lineWidth*(this.state.scale.x+this.state.scale.y)/2,e=this.paper.path(this.path).attr(this.attributes).attr("fill","none").attr("stroke-width",t);return this.glow(e),this}closePath(){return this.path+="Z",this}measureText(t){const e=this.paper.text(0,0,t).attr(this.attributes).attr("fill","none").attr("stroke","none"),i=e.getBBox();return e.remove(),{width:i.width,height:i.height}}fillText(t,e,i){return this.paper.text(e+this.measureText(t).width/2,i-this.state.font_size/(2.25*this.state.scale.y),t).attr(this.attributes),this}save(){return this.state_stack.push({state:{font_family:this.state.font_family},attributes:{font:this.attributes.font,fill:this.attributes.fill,stroke:this.attributes.stroke,"stroke-width":this.attributes["stroke-width"]},shadow_attributes:{width:this.shadow_attributes.width,color:this.shadow_attributes.color}}),this}restore(){const t=this.state_stack.pop();return this.state.font_family=t.state.font_family,this.attributes.font=t.attributes.font,this.attributes.fill=t.attributes.fill,this.attributes.stroke=t.attributes.stroke,this.attributes["stroke-width"]=t.attributes["stroke-width"],this.shadow_attributes.width=t.shadow_attributes.width,this.shadow_attributes.color=t.shadow_attributes.color,this}}const h={path:{x:!0,y:!0,width:!0,height:!0},rect:{},text:{width:!0,height:!0}};{const t={"font-family":!0,"font-weight":!0,"font-style":!0,"font-size":!0};n.s.Merge(h.rect,t),n.s.Merge(h.path,t)}class u{constructor(t){this.element=t,this.svgNS="http://www.w3.org/2000/svg";const e=this.create("svg");this.element.appendChild(e),this.svg=e,this.groups=[this.svg],this.parent=this.svg,this.path="",this.pen={x:NaN,y:NaN},this.lineWidth=1,this.state={scale:{x:1,y:1},"font-family":"Arial","font-size":"8pt","font-weight":"normal"},this.attributes={"stroke-width":.3,fill:"black",stroke:"black","stroke-dasharray":"none","font-family":"Arial","font-size":"10pt","font-weight":"normal","font-style":"normal"},this.background_attributes={"stroke-width":0,fill:"white",stroke:"white","stroke-dasharray":"none","font-family":"Arial","font-size":"10pt","font-weight":"normal","font-style":"normal"},this.shadow_attributes={width:0,color:"black"},this.state_stack=[],this.iePolyfill()}create(t){return document.createElementNS(this.svgNS,t)}openGroup(t,e,i){const s=this.create("g");return this.groups.push(s),this.parent.appendChild(s),this.parent=s,t&&s.setAttribute("class",n.s.Prefix(t)),e&&s.setAttribute("id",n.s.Prefix(e)),i&&i.pointerBBox&&s.setAttribute("pointer-events","bounding-box"),s}closeGroup(){this.groups.pop(),this.parent=this.groups[this.groups.length-1]}add(t){this.parent.appendChild(t)}iePolyfill(){"undefined"!=typeof navigator&&(this.ie=/MSIE 9/i.test(navigator.userAgent)||/MSIE 10/i.test(navigator.userAgent)||/rv:11\.0/i.test(navigator.userAgent)||/Trident/i.test(navigator.userAgent))}setFont(t,e,i){let s=!1,r=!1,o="normal";"string"==typeof i&&(-1!==i.indexOf("italic")&&(i=i.replace(/italic/g,""),r=!0),-1!==i.indexOf("bold")&&(i=i.replace(/bold/g,""),s=!0),i=i.replace(/ /g,"")),o=r?"italic":o;const a={"font-family":t,"font-size":e+"pt","font-weight":i=void 0===(i=s?"bold":i)||""===i?"normal":i,"font-style":o};return this.fontSize=Number(e),n.s.Merge(this.attributes,a),n.s.Merge(this.state,a),this}setRawFont(t){const e=(t=t.trim()).split(" ");return this.attributes["font-family"]=e[1],this.state["font-family"]=e[1],this.attributes["font-size"]=e[0],this.state["font-size"]=e[0],this.fontSize=Number(e[0].match(/\d+/)),this}setFillStyle(t){return this.attributes.fill=t,this}setBackgroundFillStyle(t){return this.background_attributes.fill=t,this.background_attributes.stroke=t,this}setStrokeStyle(t){return this.attributes.stroke=t,this}setShadowColor(t){return this.shadow_attributes.color=t,this}setShadowBlur(t){return this.shadow_attributes.width=t,this}setLineWidth(t){this.attributes["stroke-width"]=t,this.lineWidth=t}setLineDash(t){if("[object Array]"===Object.prototype.toString.call(t))return t=t.join(", "),this.attributes["stroke-dasharray"]=t,this;throw new n.s.RERR("ArgumentError","lineDash must be an array of integers.")}setLineCap(t){return this.attributes["stroke-linecap"]=t,this}resize(t,e){this.width=t,this.height=e,this.element.style.width=t;const i={width:t,height:e};return this.applyAttributes(this.svg,i),this.scale(this.state.scale.x,this.state.scale.y),this}scale(t,e){this.state.scale={x:t,y:e};const i=this.width/t,n=this.height/e;return this.setViewBox(0,0,i,n),this}setViewBox(...t){if(1===t.length){const[e]=t;this.svg.setAttribute("viewBox",e)}else{const[e,i,n,s]=t,r=e+" "+i+" "+n+" "+s;this.svg.setAttribute("viewBox",r)}}applyAttributes(t,e){const i=h[t.nodeName];return Object.keys(e).forEach((n=>{i&&i[n]||!n||!e[n]||"d"===n&&e[n]?.indexOf("NaN")>-1||t.setAttributeNS(null,n,e[n])})),t}clear(){for(;this.svg.lastChild;)this.svg.removeChild(this.svg.lastChild);this.scale(this.state.scale.x,this.state.scale.y)}rect(t,e,i,s,r){s<0&&(e+=s,s*=-1);const o=this.create("rect");return void 0===r&&(r={fill:"none","stroke-width":this.lineWidth,stroke:"black"}),n.s.Merge(r,{x:t,y:e,width:i,height:s}),this.applyAttributes(o,r),this.add(o),this}fillRect(t,e,i,n){return n<0&&(e+=n,n*=-1),this.rect(t,e,i,n,this.attributes),this}clearRect(t,e,i,n){return this.rect(t,e,i,n,this.background_attributes),this}beginPath(){return this.path="",this.pen.x=NaN,this.pen.y=NaN,this}moveTo(t,e){return this.path+="M"+t+" "+e,this.pen.x=t,this.pen.y=e,this}lineTo(t,e){return this.path+="L"+t+" "+e,this.pen.x=t,this.pen.y=e,this}bezierCurveTo(t,e,i,n,s,r){return this.path+="C"+t+" "+e+","+i+" "+n+","+s+" "+r,this.pen.x=s,this.pen.y=r,this}quadraticCurveTo(t,e,i,n){return this.path+="Q"+t+" "+e+","+i+" "+n,this.pen.x=i,this.pen.y=n,this}arc(t,e,i,n,s,r){function o(t){for(;t<0;)t+=2*Math.PI;for(;t>2*Math.PI;)t-=2*Math.PI;return t}if((n=o(n))>(s=o(s))){const t=n;n=s,s=t,r=!r}const a=s-n;return a>Math.PI?(this.arcHelper(t,e,i,n,n+a/2,r),this.arcHelper(t,e,i,n+a/2,s,r)):this.arcHelper(t,e,i,n,s,r),this}arcHelper(t,e,i,n,s,r){const o=t+i*Math.cos(n),a=e+i*Math.sin(n),l=t+i*Math.cos(s),h=e+i*Math.sin(s);let u=0,c=0;r?(c=1,s-nMath.PI&&(u=1),this.path+="M"+o+" "+a+" A"+i+" "+i+" 0 "+u+" "+c+" "+l+" "+h,isNaN(this.pen.x)||isNaN(this.pen.y)||(this.peth+="M"+this.pen.x+" "+this.pen.y)}closePath(){return this.path+="Z",this}glow(){if(this.shadow_attributes.width>0){const t=this.shadow_attributes,e=t.width/2;for(let i=1;i<=e;i++){const n={stroke:t.color,"stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(.4*t.width/e*i).toFixed(3),opacity:+((t.opacity||.3)/e).toFixed(3)},s=this.create("path");n.d=this.path,this.applyAttributes(s,n),this.add(s)}}return this}fill(t){this.glow();const e=this.create("path");let i=t;return void 0===t?(t={},n.s.Merge(t,this.attributes),t.stroke="none",i=t):(i=t,n.s.Merge(i,this.attributes),t.class&&(i.class=t.class),t.id&&(i.id=t.id)),t.d=this.path,this.applyAttributes(e,t),this.add(e),this}stroke(t=void 0){this.glow();const e=this.create("path"),i={};return n.s.Merge(i,this.attributes),t&&n.s.Merge(i,t),i.fill="none",i["stroke-width"]=this.lineWidth,i.d=this.path,this.applyAttributes(e,i),this.add(e),this}measureText(t){const e=this.create("text");if("function"!=typeof e.getBBox)return{x:0,y:0,width:0,height:0};e.textContent=t,this.applyAttributes(e,this.attributes),this.svg.appendChild(e);let i=e.getBBox();return this.ie&&""!==t&&"italic"===this.attributes["font-style"]&&(i=this.ieMeasureTextFix(i,t)),this.svg.removeChild(e),i}ieMeasureTextFix(t){const e=1.196*Number(this.fontSize)+1.9598,i=t.width-e,n=t.height-1.5;return{x:t.x,y:t.y,width:i,height:n}}fillText(t,e,i){if(!t||t.length<=0)return;const s={};n.s.Merge(s,this.attributes),s.stroke="none",s.x=e,s.y=i;const r=this.create("text");r.textContent=t,this.applyAttributes(r,s),this.add(r)}save(){return this.state_stack.push({state:{"font-family":this.state["font-family"],"font-weight":this.state["font-weight"],"font-style":this.state["font-style"],"font-size":this.state["font-size"],scale:this.state.scale},attributes:{"font-family":this.attributes["font-family"],"font-weight":this.attributes["font-weight"],"font-style":this.attributes["font-style"],"font-size":this.attributes["font-size"],fill:this.attributes.fill,stroke:this.attributes.stroke,"stroke-width":this.attributes["stroke-width"],"stroke-dasharray":this.attributes["stroke-dasharray"]},shadow_attributes:{width:this.shadow_attributes.width,color:this.shadow_attributes.color},lineWidth:this.lineWidth}),this}restore(){const t=this.state_stack.pop();return this.state["font-family"]=t.state["font-family"],this.state["font-weight"]=t.state["font-weight"],this.state["font-style"]=t.state["font-style"],this.state["font-size"]=t.state["font-size"],this.state.scale=t.state.scale,this.attributes["font-family"]=t.attributes["font-family"],this.attributes["font-weight"]=t.attributes["font-weight"],this.attributes["font-style"]=t.attributes["font-style"],this.attributes["font-size"]=t.attributes["font-size"],this.attributes.fill=t.attributes.fill,this.attributes.stroke=t.attributes.stroke,this.attributes["stroke-width"]=t.attributes["stroke-width"],this.attributes["stroke-dasharray"]=t.attributes["stroke-dasharray"],this.shadow_attributes.width=t.shadow_attributes.width,this.shadow_attributes.color=t.shadow_attributes.color,this.lineWidth=t.lineWidth,this}}let c=null;class d{static get Backends(){return{CANVAS:1,RAPHAEL:2,SVG:3,VML:4}}static get LineEndType(){return{NONE:1,UP:2,DOWN:3}}static get USE_CANVAS_PROXY(){return!1}static get lastContext(){return c}static set lastContext(t){c=t}static buildContext(t,e,i,n,s){const r=new d(t,e);i&&n&&r.resize(i,n),s||(s="#FFF");const o=r.getContext();return o.setBackgroundFillStyle(s),d.lastContext=o,o}static getCanvasContext(t,e,i,n){return d.buildContext(t,d.Backends.CANVAS,e,i,n)}static getRaphaelContext(t,e,i,n){return d.buildContext(t,d.Backends.RAPHAEL,e,i,n)}static getSVGContext(t,e,i,n){return d.buildContext(t,d.Backends.SVG,e,i,n)}static bolsterCanvasContext(t){return d.USE_CANVAS_PROXY?new a(t):(t.vexFlowCanvasContext=t,["clear","setFont","setRawFont","setFillStyle","setBackgroundFillStyle","setStrokeStyle","setShadowColor","setShadowBlur","setLineWidth","setLineCap","setLineDash","openGroup","closeGroup","getGroup"].forEach((e=>{t[e]=t[e]||a.prototype[e]})),t)}static drawDashedLine(t,e,i,n,s,r){t.beginPath();const o=n-e,a=s-i,l=Math.atan2(a,o);let h=e,u=i;t.moveTo(e,i);let c=0,d=!0;for(;!(o<0?h<=n:h>=n)||!(a<0?u<=s:u>=s);){const e=r[c++%r.length],i=h+Math.cos(l)*e;h=o<0?Math.max(n,i):Math.min(n,i);const p=u+Math.sin(l)*e;u=a<0?Math.max(s,p):Math.min(s,p),d?t.lineTo(h,u):t.moveTo(h,u),d=!d}t.closePath(),t.stroke()}constructor(t,e){if(this.elementId=t,!this.elementId)throw new n.s.RERR("BadArgument","Invalid id for renderer.");if(this.element=document.getElementById(t),this.element||(this.element=t),this.ctx=null,this.paper=null,this.backend=e,this.backend===d.Backends.CANVAS){if(!this.element.getContext)throw new n.s.RERR("BadElement",`Can't get canvas context from element: ${t}`);this.ctx=d.bolsterCanvasContext(this.element.getContext("2d"))}else if(this.backend===d.Backends.RAPHAEL)this.ctx=new l(this.element);else{if(this.backend!==d.Backends.SVG)throw new n.s.RERR("InvalidBackend",`No support for backend: ${this.backend}`);this.ctx=new u(this.element)}}resize(t,e){if(this.backend===d.Backends.CANVAS){if(!this.element.getContext)throw new n.s.RERR("BadElement",`Can't get canvas context from element: ${this.elementId}`);[t,e]=a.SanitizeCanvasDims(t,e);const i=window.devicePixelRatio||1;this.element.width=t*i,this.element.height=e*i,this.element.style.width=t+"px",this.element.style.height=e+"px",this.ctx=d.bolsterCanvasContext(this.element.getContext("2d")),this.ctx.scale(i,i)}else this.ctx.resize(t,e);return this}getContext(){return this.ctx}}var p=i(2306),f=i(1140);class m extends r.W{static get LOCATION_TOP(){return 1}static get LOCATION_BOTTOM(){return-1}static get NESTING_OFFSET(){return 15}constructor(t,e){if(super(),this.setAttribute("type","Tuplet"),!t||!t.length)throw new n.s.RuntimeError("BadArguments","No notes provided for tuplet.");this.options=n.s.Merge({},e),this.notes=t,this.num_notes="num_notes"in this.options?this.options.num_notes:t.length,this.options.beats_occupied&&this.beatsOccupiedDeprecationWarning(),this.notes_occupied=this.options.notes_occupied||this.options.beats_occupied||2,"bracketed"in this.options?this.bracketed=this.options.bracketed:this.bracketed=t.some((t=>null===t.beam)),this.ratioed="ratioed"in this.options?this.options.ratioed:Math.abs(this.notes_occupied-this.num_notes)>1,this.point=28,this.y_pos=16,this.x_pos=100,this.width=200,this.location=this.options.location||m.LOCATION_TOP,it.AlignRestsToNotes(t,!0,!0),this.resolveGlyphs(),this.attach()}attach(){for(let t=0;t=1;)this.numerator_glyphs.unshift(new p.r("v"+t%10,this.point)),t=parseInt(t/10,10);for(this.denom_glyphs=[],t=this.notes_occupied;t>=1;)this.denom_glyphs.unshift(new p.r("v"+t%10,this.point)),t=parseInt(t/10,10)}getNestedTupletCount(){const t=this.location,e=this.notes[0];let i=s(e,t),n=s(e,t);function s(t,e){return t.tupletStack.filter((t=>t.location===e)).length}return this.notes.forEach((e=>{const r=s(e,t);i=r>i?r:i,n=rn&&(n=e)}}return n+t+e}draw(){this.checkContext(),this.setRendered();const t=this.notes[0],e=this.notes[this.notes.length-1];this.bracketed?(this.x_pos=t.getTieLeftX()-5,this.width=e.getTieRightX()-this.x_pos+5):(this.x_pos=t.getStemX(),this.width=e.getStemX()-this.x_pos),this.y_pos=this.getYPosition();const i=(t,e)=>t+e.getMetrics().width;let n=this.numerator_glyphs.reduce(i,0);this.ratioed&&(n=this.denom_glyphs.reduce(i,n),n+=.32*this.point);const s=this.x_pos+this.width/2-n/2;if(this.bracketed){const t=this.width/2-n/2-5;t>0&&(this.context.fillRect(this.x_pos,this.y_pos,t,1),this.context.fillRect(this.x_pos+this.width/2+n/2+5,this.y_pos,t,1),this.context.fillRect(this.x_pos,this.y_pos+(this.location===m.LOCATION_BOTTOM),1,10*this.location),this.context.fillRect(this.x_pos+this.width,this.y_pos+(this.location===m.LOCATION_BOTTOM),1,10*this.location))}let r=0;if(this.numerator_glyphs.forEach((t=>{t.render(this.context,s+r,this.y_pos+this.point/3-2),r+=t.getMetrics().width})),this.ratioed){const t=s+r+.16*this.point,e=.06*this.point;this.context.beginPath(),this.context.arc(t,this.y_pos-.08*this.point,e,0,2*Math.PI,!0),this.context.closePath(),this.context.fill(),this.context.beginPath(),this.context.arc(t,this.y_pos+.12*this.point,e,0,2*Math.PI,!0),this.context.closePath(),this.context.fill(),r+=.32*this.point,this.denom_glyphs.forEach((t=>{t.render(this.context,s+r,this.y_pos+this.point/3-2),r+=t.getMetrics().width}))}}}function g(t){let e=0;return t.forEach((t=>{t.keyProps&&t.keyProps.forEach((t=>{e+=t.line-3}))})),e>=0?f.r.DOWN:f.r.UP}const b="L",y="B";class S extends r.W{static getDefaultBeamGroups(t){t&&"c"!==t||(t="4/4");const e={"1/2":["1/2"],"2/2":["1/2"],"3/2":["1/2"],"4/2":["1/2"],"1/4":["1/4"],"2/4":["1/4"],"3/4":["1/4"],"4/4":["1/4"],"1/8":["1/8"],"2/8":["2/8"],"3/8":["3/8"],"4/8":["2/8"],"1/16":["1/16"],"2/16":["2/16"],"3/16":["3/16"],"4/16":["2/16"]}[t];if(void 0!==e)return e.map((t=>(new o.i).parse(t)));{const e=parseInt(t.split("/")[0],10),i=parseInt(t.split("/")[1],10);if(e%3==0)return[new o.i(3,i)];if(i>4)return[new o.i(2,i)];if(i<=4)return[new o.i(1,i)]}return[new o.i(1,4)]}static applyAndGetBeams(t,e,i){return S.generateBeams(t.getTickables(),{groups:i,stem_direction:e})}static generateBeams(t,e){e||(e={}),e.groups&&e.groups.length||(e.groups=[new o.i(2,8)]);const i=e.groups.map((t=>{if(!t.multiply)throw new n.s.RuntimeError("InvalidBeamGroups","The beam groups must be an array of Vex.Flow.Fractions");return t.clone().multiply(s.Z.RESOLUTION,1)})),r=t;let a=0,l=[],h=[];function u(){i.length-1>a?a+=1:a=0}!function(){let t=[];r.forEach((e=>{if(t=[],e.shouldIgnoreTicks())return l.push(h),void(h=t);h.push(e);const n=i[a].clone(),r=h.reduce(((t,e)=>e.getTicks().clone().add(t)),new o.i(0,1)),c=s.Z.durationToNumber(e.duration)<8;c&&e.tuplet&&(n.numerator*=2),r.greaterThan(n)?(c||t.push(h.pop()),l.push(h),h=t,u()):r.equals(n)&&(l.push(h),h=t,u())})),h.length>0&&l.push(h)}(),function(){const t=[];l.forEach((i=>{let n=[];i.forEach(((i,s,r)=>{const o=0===s||s===r.length-1,a=r[s-1],l=!e.beam_rests&&i.isRest(),h=e.beam_rests&&e.beam_middle_only&&i.isRest()&&o;let u=!1;if(e.maintain_stem_directions&&a&&!i.isRest()&&!a.isRest()){const t=a.getStemDirection();u=i.getStemDirection()!==t}const c=parseInt(i.duration,10)<8;l||h||u||c?(n.length>0&&t.push(n),n=u?[i]:[]):n.push(i)})),n.length>0&&t.push(n)})),l=t}(),l.forEach((t=>{let i;if(e.maintain_stem_directions){const e=function(t){for(let e=0;e{t.setStemDirection(e)}))}(t,i)}));const c=l.filter((t=>{if(t.length>1){let e=!0;return t.forEach((t=>{t.getIntrinsicTicks()>=s.Z.durationToTicks("4")&&(e=!1)})),e}return!1})),d=function(){const t=[];return l.forEach((e=>{let i=null;e.forEach((e=>{e.tuplet&&i!==e.tuplet&&(i=e.tuplet,t.push(i))}))})),t}(),p=[];return c.forEach((t=>{const i=new S(t);e.show_stemlets&&(i.render_options.show_stemlets=!0),e.secondary_breaks&&(i.render_options.secondary_break_ticks=s.Z.durationToTicks(e.secondary_breaks)),!0===e.flat_beams&&(i.render_options.flat_beams=!0,i.render_options.flat_beam_offset=e.flat_beam_offset),p.push(i)})),d.forEach((t=>{const e=t.notes[0].stem_direction===f.r.DOWN?m.LOCATION_BOTTOM:m.LOCATION_TOP;t.setTupletLocation(e);let i=!1;for(let e=0;e=s.Z.durationToTicks("4"))throw new n.s.RuntimeError("BadArguments","Beams can only be applied to notes shorter than a quarter note.");let i,r;for(this.stem_direction=f.r.UP,i=0;it+e.stem_direction),0);o=e>-1?f.r.UP:f.r.DOWN}for(i=0;it.getGlyph().beam_count)).reduce(((t,e)=>e>t?e:t))}breakSecondaryAt(t){return this.break_on_indices=t,this}getSlopeY(t,e,i,n){return i+(t-e)*n}calculateSlope(){const{notes:t,stem_direction:e,render_options:{max_slope:i,min_slope:n,slope_iterations:s,slope_cost:r}}=this,o=t[0],a=((t,e)=>{const i=t.getStemExtents().topY,n=t.getStemX();return(e.getStemExtents().topY-i)/(e.getStemX()-n)})(o,t[t.length-1]),l=(i-n)/s;let h=Number.MAX_VALUE,u=0,c=0;for(let s=n;s<=i;s+=l){let i=0,n=0;for(let r=1;rs)&&(l=s,o=Math.min(...n.getYs()),a=n.getBeamCount())}let h=r/t.length;const u=n+a*(1.5*i),c=o+u*-e;e===f.r.DOWN&&hc&&(h=o-u),s+this.render_options.flat_beam_offset_per_beam>0?(e===f.r.DOWN&&h>s&&!this.render_options.flat_beams||e===f.r.UP&&h0){let e=this.render_options.flat_beam_offset;this.render_options.flat_beam_offset_per_beam&&(e+=this.render_options.flat_beam_offset_per_beam*this.getBeamCount());let i=this.notes[0].note_heads[0].y;const n=this.stem_direction>0?Math.min:Math.max;for(const t of this.notes)for(const e of t.note_heads)i=n(i,e.y);t=i+e*-this.stem_direction}return t}applyStemExtensions(){const{notes:t,slope:e,y_shift:i,stem_direction:n,beam_count:s,render_options:{show_stemlets:r,stemlet_extension:o,beam_width:a}}=this,l=t[0],h=this.getBeamYToDraw(),u=l.getStemX();for(let l=0;l=8&&(u=-1!==this.break_on_indices.indexOf(s),this.render_options.secondary_break_ticks&&l>=this.render_options.secondary_break_ticks&&(l=0,u=!0));const c=h.getIntrinsicTicks(){t.getStem()&&(this.context.openGroup("stem",t.getAttribute("id")+"-stem"),t.getStem().setContext(this.context).draw(),this.context.closeGroup())}),this)}drawBeamLines(){this.checkContext();const t=["4","8","16","32","64"],e=this.notes[0];let i=this.getBeamYToDraw();const n=e.getStemX(),s=this.render_options.beam_width*this.stem_direction,r={};for(const t of this.notes)r[t.getAttribute("id")]=0;for(let e=0;e{t.getStave()||t.setStave(this.stave)})),this.preFormatted=!0),this}draw(t=this.context,e=this.stave){this.setRendered();let i=null;for(let s=0;s0&&i){const t=r.getBoundingBox();t&&i.mergeWith(t)}r.setContext(t),r.drawWithStyle()}this.boundingBox=i}}function _(t,e,i,s,r){if(e!==x.type.BOLD_DOUBLE_LEFT&&e!==x.type.BOLD_DOUBLE_RIGHT)throw new n.s.RERR("InvalidConnector","A REPEAT_BEGIN or REPEAT_END type must be provided.");let o=3,a=3.5;e===x.type.BOLD_DOUBLE_RIGHT&&(o=-5,a=3),t.fillRect(i+o,s,1,r-s),t.fillRect(i-2,s,a,r-s)}class x extends r.W{static get type(){return{SINGLE_RIGHT:0,SINGLE_LEFT:1,SINGLE:1,DOUBLE:2,BRACE:3,BRACKET:4,BOLD_DOUBLE_LEFT:5,BOLD_DOUBLE_RIGHT:6,THIN_DOUBLE:7,NONE:8}}static get typeString(){return{singleRight:x.type.SINGLE_RIGHT,singleLeft:x.type.SINGLE_LEFT,single:x.type.SINGLE,double:x.type.DOUBLE,brace:x.type.BRACE,bracket:x.type.BRACKET,boldDoubleLeft:x.type.BOLD_DOUBLE_LEFT,boldDoubleRight:x.type.BOLD_DOUBLE_RIGHT,thinDouble:x.type.THIN_DOUBLE,none:x.type.NONE}}constructor(t,e){super(),this.setAttribute("type","StaveConnector"),this.thickness=s.Z.STAVE_LINE_THICKNESS,this.width=3,this.top_stave=t,this.bottom_stave=e,this.type=x.type.DOUBLE,this.font={family:"times",size:16,weight:"normal"},this.x_shift=0,this.texts=[]}setType(t){return(t="string"==typeof t?x.typeString[t]:t)>=x.type.SINGLE_RIGHT&&t<=x.type.NONE&&(this.type=t),this}setText(t,e){return this.texts.push({content:t,options:n.s.Merge({shift_x:0,shift_y:0},e)}),this}setFont(t){n.s.Merge(this.font,t)}setXShift(t){if("number"!=typeof t)throw n.s.RERR("InvalidType","x_shift must be a Number");return this.x_shift=t,this}draw(){const t=this.checkContext();this.setRendered();let e=this.top_stave.getYForLine(0),i=this.bottom_stave.getYForLine(this.bottom_stave.getNumLines()-1)+this.thickness,s=this.width,r=this.top_stave.getX();(this.type===x.type.SINGLE_RIGHT||this.type===x.type.BOLD_DOUBLE_RIGHT||this.type===x.type.THIN_DOUBLE)&&(r=this.top_stave.getX()+this.top_stave.width);let o=i-e;switch(this.type){case x.type.SINGLE:case x.type.SINGLE_LEFT:case x.type.SINGLE_RIGHT:s=1;break;case x.type.DOUBLE:r-=this.width+2;break;case x.type.BRACE:{s=12;const n=this.top_stave.getX()-2+this.x_shift,r=e,a=n,l=i,h=n-s,u=r+o/2,c=h-.9*s,d=r+.2*o,p=n+1.1*s,f=u-.135*o,m=p,g=u+.135*o,b=c,y=l-.2*o,S=h-s,v=y,_=n+.4*s,x=u+.135*o,E=_,M=u-.135*o,w=S,P=d;t.beginPath(),t.moveTo(n,r),t.bezierCurveTo(c,d,p,f,h,u),t.bezierCurveTo(m,g,b,y,a,l),t.bezierCurveTo(S,v,_,x,h,u),t.bezierCurveTo(E,M,w,P,n,r),t.fill(),t.stroke();break}case x.type.BRACKET:e-=4,i+=4,o=i-e,p.r.renderGlyph(t,r-5,e-3,40,"v1b",!0),p.r.renderGlyph(t,r-5,i+3,40,"v10",!0),r-=this.width+2;break;case x.type.BOLD_DOUBLE_LEFT:_(t,this.type,r+this.x_shift,e,i);break;case x.type.BOLD_DOUBLE_RIGHT:_(t,this.type,r,e,i);break;case x.type.THIN_DOUBLE:s=1;break;case x.type.NONE:break;default:throw new n.s.RERR("InvalidType",`The provided StaveConnector.type (${this.type}) is invalid`)}this.type!==x.type.BRACE&&this.type!==x.type.BOLD_DOUBLE_LEFT&&this.type!==x.type.BOLD_DOUBLE_RIGHT&&this.type!==x.type.NONE&&t.fillRect(r,e,s,o),this.type===x.type.THIN_DOUBLE&&t.fillRect(r-3,e,s,o),t.save(),t.lineWidth=2,t.setFont(this.font.family,this.font.size,this.font.weight);for(let e=0;ee.line-t.line));let l=0,h=0,u=0,c=0,d=null,p=null;for(let t=0;tu?e:u):o===P.Modifier.Position.RIGHT&&(f.setXShift(h),e=a+y,c=e>c?e:c),d=m,p=r}return e.left_shift+=u,e.right_shift+=c,!0}constructor(t){super(),this.setAttribute("type","FretHandFinger"),this.note=null,this.index=null,this.finger=t,this.width=7,this.position=P.Modifier.Position.LEFT,this.x_shift=0,this.y_shift=0,this.x_offset=0,this.y_offset=0,this.font={family:"sans-serif",size:9,weight:"bold"}}getCategory(){return T.CATEGORY}setFretHandFinger(t){return this.finger=t,this}setOffsetX(t){return this.x_offset=t,this}setOffsetY(t){return this.y_offset=t,this}draw(){if(this.checkContext(),!this.note||null==this.index)throw new n.s.RERR("NoAttachedNote","Can't draw string number without a note and index.");this.setRendered();const t=this.context,e=this.note.getModifierStartXY(this.position,this.index);let i=e.x+this.x_shift+this.x_offset,s=e.y+this.y_shift+this.y_offset+5;switch(this.position){case P.Modifier.Position.ABOVE:i-=4,s-=12;break;case P.Modifier.Position.BELOW:i-=2,s+=10;break;case P.Modifier.Position.LEFT:i-=this.width;break;case P.Modifier.Position.RIGHT:i+=1;break;default:throw new n.s.RERR("InvalidPostion",`The position ${this.position} does not exist`)}t.save(),t.setFont(this.font.family,this.font.size,this.font.weight),t.fillText(""+this.finger,i,s),t.restore()}}class C{static get NUM_TONES(){return 12}static get roots(){return["c","d","e","f","g","a","b"]}static get root_values(){return[0,2,4,5,7,9,11]}static get root_indices(){return{c:0,d:1,e:2,f:3,g:4,a:5,b:6}}static get canonical_notes(){return["c","c#","d","d#","e","f","f#","g","g#","a","a#","b"]}static get diatonic_intervals(){return["unison","m2","M2","m3","M3","p4","dim5","p5","m6","M6","b7","M7","octave"]}static get diatonic_accidentals(){return{unison:{note:0,accidental:0},m2:{note:1,accidental:-1},M2:{note:1,accidental:0},m3:{note:2,accidental:-1},M3:{note:2,accidental:0},p4:{note:3,accidental:0},dim5:{note:4,accidental:-1},p5:{note:4,accidental:0},m6:{note:5,accidental:-1},M6:{note:5,accidental:0},b7:{note:6,accidental:-1},M7:{note:6,accidental:0},octave:{note:7,accidental:0}}}static get intervals(){return{u:0,unison:0,m2:1,b2:1,min2:1,S:1,H:1,2:2,M2:2,maj2:2,T:2,W:2,m3:3,b3:3,min3:3,M3:4,3:4,maj3:4,4:5,p4:5,"#4":6,b5:6,aug4:6,dim5:6,5:7,p5:7,"#5":8,b6:8,aug5:8,6:9,M6:9,maj6:9,b7:10,m7:10,min7:10,dom7:10,M7:11,maj7:11,8:12,octave:12}}static get scales(){return{major:[2,2,1,2,2,2,1],dorian:[2,1,2,2,2,1,2],mixolydian:[2,2,1,2,2,1,2],minor:[2,1,2,2,1,2,2]}}static get scaleTypes(){return{M:C.scales.major,m:C.scales.minor}}static get accidentals(){return["bb","b","n","#","##"]}static get noteValues(){return{c:{root_index:0,int_val:0},cn:{root_index:0,int_val:0},"c#":{root_index:0,int_val:1},"c##":{root_index:0,int_val:2},cb:{root_index:0,int_val:11},cbb:{root_index:0,int_val:10},d:{root_index:1,int_val:2},dn:{root_index:1,int_val:2},"d#":{root_index:1,int_val:3},"d##":{root_index:1,int_val:4},db:{root_index:1,int_val:1},dbb:{root_index:1,int_val:0},e:{root_index:2,int_val:4},en:{root_index:2,int_val:4},"e#":{root_index:2,int_val:5},"e##":{root_index:2,int_val:6},eb:{root_index:2,int_val:3},ebb:{root_index:2,int_val:2},f:{root_index:3,int_val:5},fn:{root_index:3,int_val:5},"f#":{root_index:3,int_val:6},"f##":{root_index:3,int_val:7},fb:{root_index:3,int_val:4},fbb:{root_index:3,int_val:3},g:{root_index:4,int_val:7},gn:{root_index:4,int_val:7},"g#":{root_index:4,int_val:8},"g##":{root_index:4,int_val:9},gb:{root_index:4,int_val:6},gbb:{root_index:4,int_val:5},a:{root_index:5,int_val:9},an:{root_index:5,int_val:9},"a#":{root_index:5,int_val:10},"a##":{root_index:5,int_val:11},ab:{root_index:5,int_val:8},abb:{root_index:5,int_val:7},b:{root_index:6,int_val:11},bn:{root_index:6,int_val:11},"b#":{root_index:6,int_val:0},"b##":{root_index:6,int_val:1},bb:{root_index:6,int_val:10},bbb:{root_index:6,int_val:9}}}isValidNoteValue(t){return!(null==t||t<0||t>=C.NUM_TONES)}isValidIntervalValue(t){return this.isValidNoteValue(t)}getNoteParts(t){if(!t||t.length<1)throw new n.s.RERR("BadArguments","Invalid note name: "+t);if(t.length>3)throw new n.s.RERR("BadArguments","Invalid note name: "+t);const e=t.toLowerCase(),i=/^([cdefgab])(b|bb|n|#|##)?$/.exec(e);if(null!=i)return{root:i[1],accidental:i[2]};throw new n.s.RERR("BadArguments","Invalid note name: "+t)}getKeyParts(t){if(!t||t.length<1)throw new n.s.RERR("BadArguments","Invalid key: "+t);const e=t.toLowerCase(),i=/^([cdefgab])(b|#)?(mel|harm|m|M)?$/.exec(e);if(null!=i){const t=i[1],e=i[2];let n=i[3];return n||(n="M"),{root:t,accidental:e,type:n}}throw new n.s.RERR("BadArguments",`Invalid key: ${t}`)}getNoteValue(t){const e=C.noteValues[t];if(null==e)throw new n.s.RERR("BadArguments",`Invalid note name: ${t}`);return e.int_val}getIntervalValue(t){const e=C.intervals[t];if(null==e)throw new n.s.RERR("BadArguments",`Invalid interval name: ${t}`);return e}getCanonicalNoteName(t){if(!this.isValidNoteValue(t))throw new n.s.RERR("BadArguments",`Invalid note value: ${t}`);return C.canonical_notes[t]}getCanonicalIntervalName(t){if(!this.isValidIntervalValue(t))throw new n.s.RERR("BadArguments",`Invalid interval value: ${t}`);return C.diatonic_intervals[t]}getRelativeNoteValue(t,e,i){if(null==i&&(i=1),1!==i&&-1!==i)throw new n.s.RERR("BadArguments",`Invalid direction: ${i}`);let s=(t+i*e)%C.NUM_TONES;return s<0&&(s+=C.NUM_TONES),s}getRelativeNoteName(t,e){const i=this.getNoteParts(t),s=this.getNoteValue(i.root);let r=e-s;if(Math.abs(r)>C.NUM_TONES-3){let i=1;r>0&&(i=-1);const o=(e+1+(s+1))%C.NUM_TONES*i;if(Math.abs(o)>2)throw new n.s.RERR("BadArguments",`Notes not related: ${t}, ${e})`);r=o}if(Math.abs(r)>2)throw new n.s.RERR("BadArguments",`Notes not related: ${t}, ${e})`);let o=i.root;if(r>0)for(let t=1;t<=r;++t)o+="#";else if(r<0)for(let t=-1;t>=r;--t)o+="b";return o}getScaleTones(t,e){const i=[t];let n=t;for(let s=0;st.getMetrics().width;class L extends P.Modifier{static get CATEGORY(){return"accidentals"}static format(t,e){const i=e.left_shift+1;if(!t||0===t.length)return;const n=[];let r,o=null,a=0;for(let e=0;ee.line-t.line));const l=[];let h=0,u=null;for(let t=0;th?e.shift:h,u=e.line}let c=0;for(let t=0;tl[i+t],o=t=>t.map(r),a=(t,e)=>{const[i,n]=o([t,e]).map((t=>t.line));return i-n},h=(...t)=>t.map(o).every((t=>!this.checkCollision(...t))),u=n-i+1;let d,p,f=this.checkCollision(l[i],l[n])?"a":"b";switch(u){case 3:"a"===f&&.5===a(1,2)&&.5!==a(0,1)&&(f="second_on_bottom");break;case 4:h([0,2],[1,3])&&(f="spaced_out_tetrachord");break;case 5:"b"===f&&h([1,3])&&(f="spaced_out_pentachord",h([0,2],[2,4])&&(f="very_spaced_out_pentachord"));break;case 6:h([0,3],[1,4],[2,5])&&(f="spaced_out_hexachord"),h([0,2],[2,4],[1,3],[3,5])&&(f="very_spaced_out_hexachord")}if(u>=7){let e=2,i=!0;for(;!0===i;){i=!1;for(let t=0;t+ep?c:p}else for(d=t;d<=n;d++)p=s.Z.accidentalColumnsTable[u][f][d-t],l[d].column=p,c=c>p?c:p;t=n}const d=[],p=[];for(let t=0;t<=c;t++)d[t]=0,p[t]=0;d[0]=h+i,p[0]=h+i,l.forEach((t=>{t.width>d[t.column]&&(d[t.column]=t.width)}));for(let t=1;t{let e=0;const i=m+t.numAcc;for(;m0?(n=e.flatLine||e.dblSharpLine?2.5:3,t.dblSharpLine&&(i-=.5)):(n=t.flatLine||t.dblSharpLine?2.5:3,e.dblSharpLine&&(i-=.5));const s=Math.abs(i){const e=new o.i(0,1);t.getTickables().forEach((t=>{if(t.shouldIgnoreTicks())return;const s=n[e.value()];s?s.push(t):(i.push(e.value()),n[e.value()]=[t]),e.add(t.getTicks())}))}));const s=new C;e||(e="C");const r=s.createScaleMap(e);i.forEach((t=>{const e=n[t],i=[],o=t=>{t.isRest()||t.shouldIgnoreTicks()||(t.keys.forEach(((e,n)=>{const o=s.getNoteParts(e.split("/")[0]),a=o.accidental||"n",l=o.root+a,h=r[o.root]===l,u=i.indexOf(l)>-1;if(!h||h&&u){r[o.root]=l;const e=new L(a);t.addAccidental(n,e),i.push(l)}})),t.getModifiers().forEach((t=>{"gracenotegroups"===t.getCategory()&&t.getGraceNotes().forEach(o)})))};e.forEach(o)}))}constructor(t=null){if(super(),this.setAttribute("type","Accidental"),A("New accidental: ",t),this.note=null,this.index=null,this.type=t,this.position=P.Modifier.Position.LEFT,this.render_options={font_scale:38,stroke_px:3,parenLeftPadding:2,parenRightPadding:2},this.accidental=s.Z.accidentalCodes(this.type),!this.accidental)throw new n.s.RERR("ArgumentError",`Unknown accidental type: ${t}`);this.cautionary=!1,this.parenLeft=null,this.parenRight=null,this.reset()}reset(){const t=this.render_options.font_scale;this.glyph=new p.r(this.accidental.code,t),this.glyph.setOriginX(1),this.cautionary&&(this.parenLeft=new p.r(s.Z.accidentalCodes("{").code,t),this.parenRight=new p.r(s.Z.accidentalCodes("}").code,t),this.parenLeft.setOriginX(1),this.parenRight.setOriginX(1))}getCategory(){return L.CATEGORY}getWidth(){const t=this.cautionary?I(this.parenLeft)+I(this.parenRight)+this.render_options.parenLeftPadding+this.render_options.parenRightPadding:0;return I(this.glyph)+t}setNote(t){if(!t)throw new n.s.RERR("ArgumentError",`Bad note value: ${t}`);this.note=t,"gracenotes"===this.note.getCategory()&&(this.render_options.font_scale=25,this.reset())}setAsCautionary(){return this.cautionary=!0,this.render_options.font_scale=28,this.reset(),this}draw(){const{context:t,type:e,position:i,note:s,index:r,cautionary:o,x_shift:a,y_shift:l,glyph:h,parenLeft:u,parenRight:c,render_options:{parenLeftPadding:d,parenRightPadding:p}}=this;if(this.checkContext(),!s||null==r)throw new n.s.RERR("NoAttachedNote","Can't draw accidental without a note and index.");const f=s.getModifierStartXY(i,r);let m=f.x+a;const g=f.y+l;A("Rendering: ",e,m,g),o?(c.render(t,m,g),m-=I(c),m-=p,m-=this.accidental.parenRightPaddingAdjustment,h.render(t,m,g),m-=I(h),m-=d,u.render(t,m,g)):h.render(t,m,g),this.setRendered()}}class R extends P.Modifier{static get CATEGORY(){return"notesubgroup"}static format(t,e){if(!t||0===t.length)return!1;let i=0;for(let e=0;e{t.ignore_ticks=!1})),this.width=0,this.preFormatted=!1,this.formatter=new it,this.voice=new v({num_beats:4,beat_value:4,resolution:s.Z.RESOLUTION}).setStrict(!1),this.voice.addTickables(this.subNotes),this}getCategory(){return R.CATEGORY}preFormat(){this.preFormatted||(this.formatter.joinVoices([this.voice]).format([this.voice],0),this.setWidth(this.formatter.getMinTotalWidth()),this.preFormatted=!0)}setNote(t){this.note=t}setWidth(t){this.width=t}getWidth(){return this.width}draw(){this.checkContext();const t=this.getNote();if(!t||null===this.index)throw new n.s.RuntimeError("NoAttachedNote","Can't draw notes without a parent note and parent note index.");this.setRendered(),this.alignSubNotesWithNote(this.subNotes,t),this.subNotes.forEach((t=>t.setContext(this.context).drawWithStyle()))}}class N extends r.W{constructor(t,e){super(),this.setAttribute("type","StaveTie"),this.notes=t,this.context=null,this.text=e,this.direction=null,this.render_options={cp1:8,cp2:12,text_shift_x:0,first_x_shift:0,last_x_shift:0,y_shift:7,tie_spacing:0,font:{family:"Arial",size:15,style:""}},this.font=this.render_options.font,this.setNotes(t)}setFont(t){return this.font=t,this}setDirection(t){return this.direction=t,this}setNotes(t){if(!t.first_note&&!t.last_note)throw new n.s.RuntimeError("BadArguments","Tie needs to have either first_note or last_note set.");if(t.first_indices||(t.first_indices=[0]),t.last_indices||(t.last_indices=[0]),t.first_indices.length!==t.last_indices.length)throw new n.s.RuntimeError("BadArguments","Tied notes must have similar index sizes");return this.first_note=t.first_note,this.first_indices=t.first_indices,this.last_note=t.last_note,this.last_indices=t.last_indices,this}isPartial(){return!this.first_note||!this.last_note}renderTie(t){if(0===t.first_ys.length||0===t.last_ys.length)throw new n.s.RERR("BadArguments","No Y-values to render");const e=this.context;let i=this.render_options.cp1,s=this.render_options.cp2;Math.abs(t.last_x_px-t.first_x_px)<10&&(i=2,s=8);const r=this.render_options.first_x_shift,o=this.render_options.last_x_shift,a=this.render_options.y_shift*t.direction;for(let l=0;ld&&Math.abs(u-d)<10?-6:0;if(this.first_note&&"jianpu"===this.first_note.DYMusicScoreType){if("TabTie"===this.getAttribute("type"))continue;u1){const e=new S(t);e.render_options.beam_width=3,e.render_options.partial_beam_length=4,this.beams.push(e)}return this}setNote(t){this.note=t}setWidth(t){this.width=t}getWidth(){return this.width}getGraceNotes(){return this.grace_notes}draw(){this.checkContext();const t=this.getNote();if(function(...t){O.DEBUG&&n.s.L("Vex.Flow.GraceNoteGroup",t)}("Drawing grace note group for:",t),!t||null===this.index)throw new n.s.RuntimeError("NoAttachedNote","Can't draw grace note without a parent note and parent note index.");if(this.setRendered(),this.alignSubNotesWithNote(this.getGraceNotes(),t),this.grace_notes.forEach((t=>{t.setContext(this.context).draw()})),this.beams.forEach((t=>{t.setContext(this.context).draw()})),this.show_slur){const e=this.getNote().getCategory()===E.$.CATEGORY,i=e?N:k;this.slur=new i({last_note:this.grace_notes[0],first_note:t,first_indices:[0],last_indices:[0]}),this.slur.render_options.cp2=12,this.slur.render_options.y_shift=(e?7:5)+this.render_options.slur_y_shift,this.slur.setContext(this.context).draw()}}}class D extends P.Modifier{static get CATEGORY(){return"strokes"}static get Type(){return{BRUSH_DOWN:1,BRUSH_UP:2,ROLL_DOWN:3,ROLL_UP:4,RASQUEDO_DOWN:5,RASQUEDO_UP:6,ARPEGGIO_DIRECTIONLESS:7}}static format(t,e){const i=e.left_shift;if(!t||0===t.length)return this;const n=t.map((t=>{const e=t.getNote();if(e instanceof E.$){const{line:i,displaced:n}=e.getKeyProps()[t.getIndex()];return{line:i,shift:n?e.getExtraLeftPx():0,stroke:t}}{const{str:i}=e.getPositions()[t.getIndex()];return{line:i,shift:0,stroke:t}}})),s=i,r=n.reduce(((t,{stroke:e,shift:i})=>(e.setXShift(s+i),Math.max(e.getWidth()+0,t))),0);return e.left_shift+=r,!0}constructor(t,e){super(),this.setAttribute("type","Stroke"),this.note=null,this.options=n.s.Merge({},e),this.all_voices=!("all_voices"in this.options)||this.options.all_voices,this.note_end=null,this.index=null,this.type=t,this.position=P.Modifier.Position.LEFT,this.render_options={font_scale:38,stroke_px:3,stroke_spacing:10},this.font={family:"serif",size:10,weight:"bold italic"},this.setXShift(0),this.setWidth(10)}getCategory(){return D.CATEGORY}getPosition(){return this.position}addEndNote(t){return this.note_end=t,this}draw(){if(this.checkContext(),this.setRendered(),!this.note||null==this.index)throw new n.s.RERR("NoAttachedNote","Can't draw stroke without a note and index.");const t=this.note.getModifierStartXY(this.position,this.index);let e=this.note.getYs(),i=t.y,s=t.y;const r=t.x-5,o=this.note.stave.options.spacing_between_lines_px,a=this.getModifierContext().getModifiers(this.note.getCategory());for(let t=0;te.line-t.line));let p=0,f=0,m=0,g=0,b=null,y=null;for(r=0;rm?t:m):l===P.Modifier.Position.RIGHT&&(o.setXShift(f),t+=d,g=t>g?t:g),b=e,y=a}return e.left_shift+=m,e.right_shift+=g,!0}constructor(t){super(),this.setAttribute("type","StringNumber"),this.note=null,this.last_note=null,this.index=null,this.string_number=t,this.setWidth(20),this.position=P.Modifier.Position.ABOVE,this.x_shift=0,this.y_shift=0,this.x_offset=0,this.y_offset=0,this.dashed=!0,this.leg=d.LineEndType.NONE,this.radius=8,this.font={family:"sans-serif",size:10,weight:"bold"}}getCategory(){return B.CATEGORY}getNote(){return this.note}setNote(t){return this.note=t,this}getIndex(){return this.index}setIndex(t){return this.index=t,this}setLineEndType(t){return t>=d.LineEndType.NONE&&t<=d.LineEndType.DOWN&&(this.leg=t),this}setStringNumber(t){return this.string_number=t,this}setOffsetX(t){return this.x_offset=t,this}setOffsetY(t){return this.y_offset=t,this}setLastNote(t){return this.last_note=t,this}setDashed(t){return this.dashed=t,this}draw(){const t=this.checkContext();if(!this.note||null==this.index)throw new n.s.RERR("NoAttachedNote","Can't draw string number without a note and index.");this.setRendered();const e=this.note.stave.options.spacing_between_lines_px,i=this.note.getModifierStartXY(this.position,this.index);let s=i.x+this.x_shift+this.x_offset,r=i.y+this.y_shift+this.y_offset;switch(this.position){case P.Modifier.Position.ABOVE:case P.Modifier.Position.BELOW:{const t=this.note.getStemExtents();let n=t.topY,s=t.baseY+2;this.note.stem_direction===E.$.STEM_DOWN&&(n=t.baseY,s=t.topY-2),r=this.position===P.Modifier.Position.ABOVE?this.note.hasStem()?n-1.75*e:i.y-1.75*e:this.note.hasStem()?s+1.5*e:i.y+1.75*e,r+=this.y_shift+this.y_offset;break}case P.Modifier.Position.LEFT:s-=this.radius/2+5;break;case P.Modifier.Position.RIGHT:s+=this.radius/2+6;break;default:throw new n.s.RERR("InvalidPosition",`The position ${this.position} is invalid`)}t.save(),t.beginPath(),t.arc(s,r,this.radius,0,2*Math.PI,!1),t.lineWidth=1.5,t.stroke(),t.setFont(this.font.family,this.font.size,this.font.weight);const o=s-t.measureText(this.string_number).width/2;if(t.fillText(""+this.string_number,o,r+4.5),null!=this.last_note){const e=this.last_note.getStemX()-this.note.getX()+5;let i,n;switch(t.strokeStyle="#000000",t.lineCap="round",t.lineWidth=.6,this.dashed?d.drawDashedLine(t,s+10,r,s+e,r,[3,3]):d.drawDashedLine(t,s+10,r,s+e,r,[3,0]),this.leg){case d.LineEndType.UP:i=-10,n=this.dashed?[3,3]:[3,0],d.drawDashedLine(t,s+e,r,s+e,r+i,n);break;case d.LineEndType.DOWN:i=10,n=this.dashed?[3,3]:[3,0],d.drawDashedLine(t,s+e,r,s+e,r+i,n)}}t.restore()}}const{ABOVE:F,BELOW:V}=P.Modifier.Position,G=(t,e)=>.5*t(e/.5),W=(t,e)=>e===F?t<=5:t>=1,U=(t,e)=>W(t,e)?e===F?Math.ceil:Math.floor:Math.round,H=t=>{const e=t.getCategory();return"stavenotes"===e||"gracenotes"===e},z=t=>{const e=t.getCategory();return"tabnotes"===e||"numberednotes"===e};class j extends P.Modifier{static get CATEGORY(){return"articulations"}static get INITIAL_OFFSET(){return-.5}static format(t,e){if(!t||0===t.length)return!1;const i=(t,e,i)=>G(U(e,i),t.glyph.getMetrics().height/10+.5);t.filter((t=>t.getPosition()===F)).forEach((t=>{t.setTextLine(e.top_text_line),e.top_text_line+=i(t,e.top_text_line,F)})),t.filter((t=>t.getPosition()===V)).forEach((t=>{t.setTextLine(e.text_line),e.text_line+=i(t,e.text_line,V)}));const n=t.map((t=>t.getWidth())).reduce(((t,e)=>Math.max(e,t)));return e.left_shift+=n/2,e.right_shift+=n/2,!0}static easyScoreHook({articulations:t},e,i){if(!t)return;const n={staccato:"a.",tenuto:"a-"};t.split(",").map((t=>t.trim().split("."))).map((([t,e])=>{const s={type:n[t]};return e&&(s.position=P.Modifier.PositionString[e]),i.getFactory().Articulation(s)})).map((t=>e.addModifier(0,t)))}constructor(t){if(super(),this.setAttribute("type","Articulation"),this.note=null,this.index=null,this.type=t,this.position=V,this.render_options={font_scale:38},this.articulation=s.Z.articulationCodes(this.type),!this.articulation)throw new n.s.RERR("ArgumentError",`Articulation not found: ${this.type}`);this.glyph=new p.r(this.articulation.code,this.render_options.font_scale),this.setWidth(this.glyph.getMetrics().width)}getCategory(){return j.CATEGORY}draw(){const{note:t,index:e,position:i,glyph:s,articulation:{between_lines:r},text_line:o,context:a}=this;if(this.checkContext(),!t||null==e)throw new n.s.RERR("NoAttachedNote","Can't draw Articulation without a note and index.");this.setRendered();const l=t.getStave(),h=l.getSpacingBetweenLines(),u="tabnotes"===t.getCategory(),{x:c}=t.getModifierStartXY(i,e),d=!r||u,p=((t,e)=>{const i=e===F&&t.getStemDirection()===f.r.UP||e===V&&t.getStemDirection()===f.r.DOWN;return H(t)?t.hasStem()&&i?.5:1:t.hasStem()&&i?1:0})(t,i);let m={[F]:()=>{s.setOrigin(.5,1);const e=((t,e)=>{const i=t.getStave(),s=t.getStemDirection(),{topY:r,baseY:o}=t.getStemExtents();if(H(t))return t.hasStem()?s===f.r.UP?r:o:Math.min(...t.getYs());if(z(t))return t.hasStem()&&s===f.r.UP?r:i.getYForTopText(e);throw new n.s.RERR("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")})(t,o)-(o+p)*h+(this.y_shift||0);return d?Math.min(l.getYForTopText(j.INITIAL_OFFSET),e):e},[V]:()=>{s.setOrigin(.5,0);const e=((t,e)=>{const i=t.getStave(),s=t.getStemDirection(),{topY:r,baseY:o}=t.getStemExtents();if(H(t))return t.hasStem()?s===f.r.UP?o:r:Math.max(...t.getYs());if(z(t))return t.hasStem()?s===f.r.UP?i.getYForBottomText(e):r:i.getYForBottomText(e);throw new n.s.RERR("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")})(t,o)+(o+p)*h;return d?Math.max(l.getYForBottomText(j.INITIAL_OFFSET),e):e}}[i]();if(!u){const n=i===F?-1:1,o=u?t.positions[e].str:t.getKeyProps()[e].line,a=(t.getYs()[e]-m)/h+o,l=((t,e,i,n)=>{const s=G(U(e,i),e);return t&&W(s,i)&&s%1==0?s+.5*-n:s})(r,a,i,n);W(l,i)&&s.setOrigin(.5,.5),m+=Math.abs(l-a)*h*n}!function(...t){j.DEBUG&&n.s.L("Vex.Flow.Articulation",t)}(`Rendering articulation at (x: ${c}, y: ${m})`),s.render(a,c,m)}}var X=i(6619);class Y extends X.W{static getNextContext(t){const e=t.tContexts,i=e.indexOf(t);return e[i+1]}constructor(){super(),this.setAttribute("type","TickContext"),this.currentTick=new o.i(0,1),this.maxTicks=new o.i(0,1),this.minTicks=null,this.padding=3,this.x=0,this.xBase=0,this.xOffset=0,this.tickables=[],this.notePx=0,this.extraLeftPx=0,this.extraRightPx=0,this.tContexts=[]}getX(){return this.x}setX(t){return this.x=t,this.xBase=t,this.xOffset=0,this}getXBase(){return this.xBase}setXBase(t){this.xBase=t,this.x=t+this.xOffset}getXOffset(){return this.xOffset}setXOffset(t){this.xOffset=t,this.x=this.xBase+t}getWidth(){return this.width+2*this.padding}setPadding(t){return this.padding=t,this}getMaxTicks(){return this.maxTicks}getMinTicks(){return this.minTicks}getTickables(){return this.tickables}getCenterAlignedTickables(){return this.tickables.filter((t=>t.isCenterAligned()))}getMetrics(){const{width:t,notePx:e,extraLeftPx:i,extraRightPx:n}=this;return{width:t,notePx:e,extraLeftPx:i,extraRightPx:n}}getCurrentTick(){return this.currentTick}setCurrentTick(t){this.currentTick=t,this.preFormatted=!1}getExtraPx(){let t=0,e=0,i=0,n=0;for(let s=0;s0&&n--;for(let e=0;e{J("Preformatting ModifierContext: ",t.CATEGORY),t.format(this.getModifiers(t.CATEGORY),this.state,this)})),this.width=this.state.left_shift+this.state.right_shift,this.preFormatted=!0)}postFormat(){this.postFormatted||this.POSTFORMAT.forEach((t=>{J("Postformatting ModifierContext: ",t.CATEGORY),t.postFormat(this.getModifiers(t.CATEGORY),this)}))}}function tt(t,e){const i=t[e+1];return i&&i?.keys?.includes("b/4")||i?.keys?.includes("r/4")?tt(t,e+1):i}function et(t,e,i){if(!t||!t.length)throw new n.s.RERR("BadArgument","No voices to format");const s=t[0].getTotalTicks(),r=t.reduce(((t,e)=>{if(!e.getTotalTicks().equals(s))throw new n.s.RERR("TickMismatch","Voices should have same total note duration in ticks.");if(e.getMode()===v.Mode.STRICT&&!e.isComplete())throw new n.s.RERR("IncompleteVoice","Voice does not have enough notes.");return Math.max(t,o.i.LCM(t,e.getResolutionMultiplier()))}),1),a={},l=[],h=[];return t.forEach((t=>{const n=new o.i(0,r);t.getTickables().forEach((t=>{const s=n.numerator;if(!a[s]){const t=new e;h.push(t),a[s]=t}i(t,a[s]),l.push(s),n.add(t.getTicks())}))})),{map:a,array:h,list:n.s.SortAndUnique(l,((t,e)=>t-e),((t,e)=>t===e)),resolutionMultiplier:r}}class it{static SimpleFormat(t,e=0,{paddingBetween:i=10}={}){t.reduce(((t,e)=>{e.addToModifierContext(new Q);const n=(new Y).addTickable(e).preFormat(),s=n.getExtraPx();return n.setX(t+s.left),t+n.getWidth()+s.right+i}),e)}static plotDebugging(t,e,i,n,s){const r=i+M.j.STAVEPADDING,o=e.contextGaps;t.save(),t.setFont("Arial",8,""),o.gaps.forEach((e=>{var i,o,a;i=r+e.x1,o=r+e.x2,a="#aaa",t.beginPath(),t.setStrokeStyle(a),t.setFillStyle(a),t.setLineWidth(1),t.fillRect(i,n,o-i,s-n),t.fillText(Math.round(e.x2-e.x1),r+e.x1,s+12)})),t.fillText(Math.round(o.total)+"px",r-20,s+12),t.setFillStyle("red"),t.fillText("Loss: "+e.lossHistory.map((t=>Math.round(t))),r-20,s+22),t.restore()}static FormatAndDraw(t,e,i,r){const o={auto_beam:!1,align_rests:!1};"object"==typeof r?n.s.Merge(o,r):"boolean"==typeof r&&(o.auto_beam=r);const a=new v(s.Z.TIME4_4).setMode(v.Mode.SOFT).addTickables(i),l=o.auto_beam?S.applyAndGetBeams(a):[];return(new it).joinVoices([a],{align_rests:o.align_rests}).formatToStave([a],e,{align_rests:o.align_rests,stave:e}),a.setStave(e).draw(t,e),l.forEach((e=>e.setContext(t).draw())),a.getBoundingBox()}static FormatAndDrawTab(t,e,i,r,o,a,l){const h={auto_beam:a,align_rests:!1};"object"==typeof l?n.s.Merge(h,l):"boolean"==typeof l&&(h.auto_beam=l);const u=new v(s.Z.TIME4_4).setMode(v.Mode.SOFT).addTickables(o),c=new v(s.Z.TIME4_4).setMode(v.Mode.SOFT).addTickables(r),d=h.auto_beam?S.applyAndGetBeams(u):[];(new it).joinVoices([u],{align_rests:h.align_rests}).joinVoices([c]).formatToStave([u,c],i,{align_rests:h.align_rests}),u.draw(t,i),c.draw(t,e),d.forEach((e=>e.setContext(t).draw())),new x(i,e).setContext(t).draw()}static AlignRestsToNotes(t,e,i){return t.forEach(((e,n)=>{if(e instanceof E.$&&e.isRest()){if(e.tuplet&&!i)return;if(["va5","v3c"].includes(e.glyph.code_head)){const i="va5"===e.glyph.code_head?10:14,s=t[n-1],r=tt(t,n);let o=!1;if(s&&r&&s.beam&&r.beam&&(o=s.beam.notes.includes(r)),o){e.setKeyLine(0,3);let t=[...s.beam.notes,...r.beam.notes];e.beam&&e.beam.notes&&t.push(...e.beam.notes),t=Array.from(new Set(t));for(let e=0;e0){const t=n<1.5?Math.abs(n-1.5)*i:0;s.setResetHeight(t)}else{const t=n>4.5?Math.abs(n-4.5)*i:0;s.setResetHeight(t)}}}}}})),this}constructor(){this.minTotalWidth=0,this.hasMinTotalWidth=!1,this.totalTicks=new o.i(0,1),this.tickContexts=null,this.modiferContexts=null,this.contextGaps={total:0,gaps:[]},this.voices=[]}alignRests(t,e){if(!t||!t.length)throw new n.s.RERR("BadArgument","No voices to format rests");t.forEach((t=>it.AlignRestsToNotes(t.getTickables(),e)))}preCalculateMinTotalWidth(t){if(this.hasMinTotalWidth)return this.minTotalWidth;if(!this.tickContexts){if(!t)throw new n.s.RERR("BadArgument","'voices' required to run preCalculateMinTotalWidth");this.createTickContexts(t)}const{list:e,map:i}=this.tickContexts;return this.minTotalWidth=e.map((t=>{const e=i[t];return e.preFormat(),e.getWidth()})).reduce(((t,e)=>t+e),0),this.hasMinTotalWidth=!0,this.minTotalWidth}getMinTotalWidth(){if(!this.hasMinTotalWidth)throw new n.s.RERR("NoMinTotalWidth","Call 'preCalculateMinTotalWidth' or 'preFormat' before calling 'getMinTotalWidth'");return this.minTotalWidth}createModifierContexts(t){const e=et(t,Q,((t,e)=>t.addToModifierContext(e)));return this.modiferContexts=e,e}createTickContexts(t){const e=et(t,Y,((t,e)=>e.addTickable(t)));return e.array.forEach((t=>{t.tContexts=e.array})),this.totalTicks=t[0].getTicksUsed().clone(),this.tickContexts=e,e}preFormat(t=0,e,i,n){const s=this.tickContexts,{list:r,map:o,resolutionMultiplier:a}=s;i&&n&&i.forEach((t=>t.setStave(n).preFormat()));let l=0,h=0;const u=t/2;if(this.minTotalWidth=0,r.forEach((t=>{const i=o[t];e&&i.setContext(e),i.preFormat();const n=i.getWidth();this.minTotalWidth+=n;const s=i.getMetrics();l=l+h+s.extraLeftPx,i.setX(l),h=n-s.extraLeftPx})),this.minTotalWidth=l+h,this.hasMinTotalWidth=!0,t<=0)return;const c=(t-this.minTotalWidth)/(this.totalTicks.value()*a);let d=0;r.forEach(((t,e)=>{const i=r[e-1]||0,n=o[t];d+=(t-i)*c,n.setX(n.getX()+d),n.getCenterAlignedTickables().forEach((t=>{t.center_x_shift=u-n.getX()}))})),1!==r.length&&(this.justifyWidth=t,this.lossHistory=[],this.evaluate())}evaluate(){const t=this.justifyWidth;this.contextGaps={total:0,gaps:[]},this.tickContexts.list.forEach(((t,e)=>{if(0===e)return;const i=this.tickContexts.list[e-1],n=this.tickContexts.map[i],s=this.tickContexts.map[t],r=n.getMetrics(),o=n.getX()+r.width,a=s.getX(),l=a-o;this.contextGaps.total+=l,this.contextGaps.gaps.push({x1:o,x2:a}),s.getFormatterMetrics().freedom.left=l,n.getFormatterMetrics().freedom.right=l}));const e=this.durationStats={};this.voices.forEach((i=>{i.getTickables().forEach(((i,n,s)=>{const r=i.getTicks().clone().simplify().toString(),o=i.getMetrics(),a=i.getFormatterMetrics(),l=i.getX()+o.noteWidth+o.modRightPx+o.extraRightPx;let h=0;if(n{t.getTickables().forEach((t=>{const n=t.getTicks().clone().simplify().toString(),s=t.getFormatterMetrics();s.iterations+=1,s.space.deviation=s.space.used-e[n].mean,s.duration=n,s.space.mean=e[n].mean,i+=Math.pow(e[n].mean,2)}))})),this.totalCost=Math.sqrt(i),this.lossHistory.push(this.totalCost),this}tune(){let t=0;return this.tickContexts.list.forEach(((e,i,n)=>{const s=this.tickContexts.map[e],r=i>0?this.tickContexts.map[n[i-1]]:null,o=it.getFormatterMetrics().space.deviation)).reduce(((t,e)=>t+e));a>0?t=-Math.min(s.getFormatterMetrics().freedom.right,Math.abs(a)):a<0&&(t=o?Math.min(o.getFormatterMetrics().freedom.right,Math.abs(a)):0);const l=Math.min(5,Math.abs(t));t=t>0?l:-l})),this.evaluate()}postFormat(){const t=t=>t.list.forEach((e=>t.map[e].postFormat()));return t(this.modiferContexts),t(this.tickContexts),this}joinVoices(t){return this.createModifierContexts(t),this.hasMinTotalWidth=!1,this}format(t,e,i){const s={align_rests:!1,context:null,stave:null};return n.s.Merge(s,i),this.voices=t,this.alignRests(t,s.align_rests),this.createTickContexts(t),this.preFormat(e,s.context,t,s.stave),s.stave&&this.postFormat(),this}formatToStave(t,e,i){const s=e.getNoteEndX()-e.getNoteStartX()-10;!function(...t){it.DEBUG&&n.s.L("Vex.Flow.Formatter",t)}("Formatting voices to width: ",s);const r={context:e.getContext()};return n.s.Merge(r,i),this.format(t,s,r)}}class nt extends r.W{static get Position(){return{LEFT:1,RIGHT:2,ABOVE:3,BELOW:4,BEGIN:5,END:6}}constructor(){super(),this.setAttribute("type","StaveModifier"),this.padding=10,this.position=nt.Position.ABOVE,this.layoutMetrics=null}getPosition(){return this.position}setPosition(t){return this.position=t,this}getStave(){return this.stave}setStave(t){return this.stave=t,this}getWidth(){return this.width}setWidth(t){return this.width=t,this}getX(){return this.x}setX(t){return this.x=t,this}getCategory(){return""}makeSpacer(t){return{getContext:()=>!0,setStave(){},renderToStave(){},getMetrics:()=>({width:t})}}placeGlyphOnLine(t,e,i){t.setYShift(e.getYForLine(i)-e.getYForGlyphs())}getPadding(t){return void 0!==t&&t<2?0:this.padding}setPadding(t){return this.padding=t,this}setLayoutMetrics(t){return this.layoutMetrics=t,this}getLayoutMetrics(){return this.layoutMetrics}}class st extends nt{static get CATEGORY(){return"barlines"}static get type(){return{SINGLE:1,DOUBLE:2,END:3,REPEAT_BEGIN:4,REPEAT_END:5,REPEAT_BOTH:6,NONE:7}}static get typeString(){return{single:st.type.SINGLE,double:st.type.DOUBLE,end:st.type.END,repeatBegin:st.type.REPEAT_BEGIN,repeatEnd:st.type.REPEAT_END,repeatBoth:st.type.REPEAT_BOTH,none:st.type.NONE}}constructor(t){super(),this.setAttribute("type","Barline"),this.thickness=s.Z.STAVE_LINE_THICKNESS;const e=st.type;this.widths={},this.widths[e.SINGLE]=5,this.widths[e.DOUBLE]=5,this.widths[e.END]=5,this.widths[e.REPEAT_BEGIN]=5,this.widths[e.REPEAT_END]=5,this.widths[e.REPEAT_BOTH]=5,this.widths[e.NONE]=5,this.paddings={},this.paddings[e.SINGLE]=0,this.paddings[e.DOUBLE]=0,this.paddings[e.END]=0,this.paddings[e.REPEAT_BEGIN]=15,this.paddings[e.REPEAT_END]=15,this.paddings[e.REPEAT_BOTH]=15,this.paddings[e.NONE]=0,this.layoutMetricsMap={},this.layoutMetricsMap[e.SINGLE]={xMin:0,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.DOUBLE]={xMin:-3,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.END]={xMin:-5,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.REPEAT_END]={xMin:-10,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.REPEAT_BEGIN]={xMin:-2,xMax:10,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.REPEAT_BOTH]={xMin:-10,xMax:10,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.NONE]={xMin:0,xMax:0,paddingLeft:5,paddingRight:5},this.setPosition(nt.Position.BEGIN),this.setType(t)}getCategory(){return st.CATEGORY}getType(){return this.type}setType(t){return this.type="string"==typeof t?st.typeString[t]:t,this.setWidth(this.widths[this.type]),this.setPadding(this.paddings[this.type]),this.setLayoutMetrics(this.layoutMetricsMap[this.type]),this}draw(t){switch(t.checkContext(),this.setRendered(),this.type){case st.type.SINGLE:this.drawVerticalBar(t,this.x,!1);break;case st.type.DOUBLE:this.drawVerticalBar(t,this.x,!0);break;case st.type.END:this.drawVerticalEndBar(t,this.x);break;case st.type.REPEAT_BEGIN:this.drawRepeatBar(t,this.x,!0),t.getX()!==this.x&&this.drawVerticalBar(t,t.getX());break;case st.type.REPEAT_END:this.drawRepeatBar(t,this.x,!1);break;case st.type.REPEAT_BOTH:this.drawRepeatBar(t,this.x,!1),this.drawRepeatBar(t,this.x,!0)}}drawVerticalBar(t,e,i){t.checkContext();const n=t.getTopLineTopY(),s=t.getBottomLineBottomY();i&&t.context.fillRect(e-3,n,1,s-n),t.context.fillRect(e,n,1,s-n)}drawVerticalEndBar(t,e){t.checkContext();const i=t.getTopLineTopY(),n=t.getBottomLineBottomY();t.context.fillRect(e-5,i,1,n-i),t.context.fillRect(e-2,i,3,n-i)}drawRepeatBar(t,e,i){t.checkContext();const n=t.getTopLineTopY(),s=t.getBottomLineBottomY();let r=3;i||(r=-5),t.context.fillRect(e+r,n,1,s-n),t.context.fillRect(e-2,n,3,s-n),i?r+=4:r-=4;const o=e+r+1;let a=(t.getNumLines()-1)*t.getSpacingBetweenLines();a=a/2-t.getSpacingBetweenLines()/2;let l=n+a+1;t.context.beginPath(),t.context.arc(o,l,2,0,2*Math.PI,!1),t.context.fill(),l+=t.getSpacingBetweenLines(),t.context.beginPath(),t.context.arc(o,l,2,0,2*Math.PI,!1),t.context.fill()}}class rt extends nt{static get CATEGORY(){return"repetitions"}static get type(){return{NONE:1,CODA_LEFT:2,CODA_RIGHT:3,SEGNO_LEFT:4,SEGNO_RIGHT:5,DC:6,DC_AL_CODA:7,DC_AL_FINE:8,DS:9,DS_AL_CODA:10,DS_AL_FINE:11,FINE:12,TO_CODA:13}}constructor(t,e,i){super(),this.setAttribute("type","Repetition"),this.symbol_type=t,this.x=e,this.x_shift=0,this.y_shift=i,this.font={family:"times",size:12,weight:"bold italic"}}getCategory(){return rt.CATEGORY}setShiftX(t){return this.x_shift=t,this}setShiftY(t){return this.y_shift=t,this}setX(t){return this.x=t,this}draw(t,e){switch(this.setRendered(),this.symbol_type){case rt.type.CODA_RIGHT:this.drawCodaFixed(t,e+t.width);break;case rt.type.CODA_LEFT:this.drawSymbolText(t,e,"Coda",!1);break;case rt.type.SEGNO_LEFT:this.drawSignoFixed(t,e);break;case rt.type.SEGNO_RIGHT:this.drawSignoFixed(t,e+t.width);break;case rt.type.DC:this.drawSymbolText(t,e,"D.C.",!1);break;case rt.type.DC_AL_CODA:this.drawSymbolText(t,e,"D.C. al Coda",!0);break;case rt.type.DC_AL_FINE:this.drawSymbolText(t,e,"D.C. al Fine",!1);break;case rt.type.DS:this.drawSymbolText(t,e,"D.S.",!1);break;case rt.type.DS_AL_CODA:this.drawSymbolText(t,e,"D.S. al Coda",!0);break;case rt.type.DS_AL_FINE:this.drawSymbolText(t,e,"D.S. al Fine",!1);break;case rt.type.FINE:this.drawSymbolText(t,e,"Fine",!1);break;case rt.type.TO_CODA:this.drawSymbolText(t,e,"To Coda",!0)}return this}drawCodaFixed(t,e){const i=t.getYForTopText(t.options.num_lines)+this.y_shift;return p.r.renderGlyph(t.context,this.x+e+this.x_shift,i+25,40,"v4d",!0),this}drawSignoFixed(t,e){const i=t.getYForTopText(t.options.num_lines)+this.y_shift;return p.r.renderGlyph(t.context,this.x+e+this.x_shift,i+25,30,"v8c",!0),this}drawSymbolText(t,e,i,n){const s=t.checkContext();s.save(),s.setFont(this.font.family,this.font.size,this.font.weight);let r=0+this.x_shift,o=e+this.x_shift;this.symbol_type===rt.type.CODA_LEFT?(r=this.x+t.options.vertical_bar_width,o=r+s.measureText(i).width+12):(this.x_shift=-(r+s.measureText(i).width+12+t.options.vertical_bar_width+12),r=this.x+this.x_shift+t.options.vertical_bar_width,o=r+s.measureText(i).width+12);const a=t.getYForTopText(t.options.num_lines)+this.y_shift+25;return n&&p.r.renderGlyph(s,o,a,40,"v4d",!0),s.fillText(i,r,a+5),s.restore(),this}}class ot extends nt{static get CATEGORY(){return"stavesection"}constructor(t,e,i){super(),this.setAttribute("type","StaveSection"),this.setWidth(16),this.section=t,this.x=e,this.shift_x=0,this.shift_y=i,this.font={family:"sans-serif",size:12,weight:"bold"}}getCategory(){return ot.CATEGORY}setStaveSection(t){return this.section=t,this}setShiftX(t){return this.shift_x=t,this}setShiftY(t){return this.shift_y=t,this}draw(t,e){const i=t.checkContext();this.setRendered(),i.save(),i.lineWidth=2,i.setFont(this.font.family,this.font.size,this.font.weight);const n=i.measureText(""+this.section),s=n.width,r=n.height;let o=s+6;o<18&&(o=18);const a=r,l=t.getYForTopText(3)+this.shift_y;let h=this.x+e;return i.beginPath(),i.lineWidth=2,i.rect(h,l+r/4,o,a),i.stroke(),h+=(o-s)/2,i.fillText(""+this.section,h,l+16),i.restore(),this}}class at extends nt{static get CATEGORY(){return"stavetempo"}constructor(t,e,i){super(),this.setAttribute("type","StaveTempo"),this.tempo=t,this.position=P.Modifier.Position.ABOVE,this.x=e,this.shift_x=10,this.shift_y=i,this.font={family:"times",size:14,weight:"bold"},this.render_options={glyph_font_scale:30}}getCategory(){return at.CATEGORY}setTempo(t){return this.tempo=t,this}setShiftX(t){return this.shift_x=t,this}setShiftY(t){return this.shift_y=t,this}draw(t,e){const i=t.checkContext();this.setRendered();const n=this.render_options,r=n.glyph_font_scale/38,o=this.tempo.name,a=this.tempo.duration,l=this.tempo.dots,h=this.tempo.bpm,u=this.font;let c=this.x+this.shift_x+e;const d=t.getYForTopText(1)+this.shift_y;if(i.save(),i.openGroup("stavetempo",null,{}),o&&(i.setFont(u.family,u.size,u.weight),i.fillText(o,c,d),c+=i.measureText(o).width),a&&h){i.setFont(u.family,u.size,"normal"),o&&(c+=i.measureText(" ").width,i.fillText("(",c,d),c+=i.measureText("(").width);const t=s.Z.getGlyphProps(a);if(c+=3*r,p.r.renderGlyph(i,c,d,n.glyph_font_scale,t.code_head),c+=t.getWidth()*r,t.stem){let e=30;t.beam_count&&(e+=3*(t.beam_count-1)),e*=r;const s=d-e;i.fillRect(c-r,s,r,e),t.flag&&(p.r.renderGlyph(i,c,s,n.glyph_font_scale,t.code_flag_upstem),l||(c+=6*r))}for(let t=0;t=t.line?i.above:i.below)}this.placeGlyphOnLine(n,this.stave,t.line),this.glyphs.push(n);const o=this.xPositions[this.xPositions.length-1],a=n.getMetrics().width+r;this.xPositions.push(o+a),this.width+=a}cancelKey(t){return this.formatted=!1,this.cancelKeySpec=t,this}convertToCancelAccList(t){const e=s.Z.keySignature(t),i=this.accList.length>0&&e.length>0&&e[0].type!==this.accList[0].type,n=i?e.length:e.length-this.accList.length;if(n<1)return;const r=[];for(let t=0;t0?t[0].type:null;let i;if(this.cancelKeySpec&&(i=this.convertToCancelAccList(this.cancelKeySpec)),this.alterKeySpec&&this.convertToAlterAccList(this.alterKeySpec),this.accList.length>0){const n=(this.position===nt.Position.END?this.stave.endClef:this.stave.clef)||this.stave.clef;i&&this.convertAccLines(n,i.type,i.accList),this.convertAccLines(n,e,t);for(let t=0;t0){this.stave.context.openGroup("keysignature");for(let t=0;t{const e=t.split("/").filter((t=>""!==t));if(2!==e.length)throw new n.s.RERR("BadTimeSignature",`Invalid time spec: ${t}. Must be in the form "/"`);e.forEach((e=>{if(isNaN(Number(e)))throw new n.s.RERR("BadTimeSignature",`Invalid time spec: ${t}. Must contain two valid numbers.`)}))})(t);const[e,i]=t.split("/").map((t=>t.split("")));return{num:!0,glyph:this.makeTimeSignatureGlyph(e,i)}}makeTimeSignatureGlyph(t,e){const i=new p.r("v0",this.point);i.topGlyphs=[],i.botGlyphs=[];let n=0;for(let e=0;es?n:s,o=i.getMetrics().x_min;i.getMetrics=()=>({x_min:o,x_max:o+r,width:r});const a=(r-n)/2,l=(r-s)/2,h=this;return i.renderToStave=function(t){let e=t+a;for(let t=0;tt.visible)).filter(Boolean).length}getOptions(){return this.options}setNoteStartX(t){this.formatted||this.format(),this.setStartX(t);const e=this.modifiers[0];return e.setX(this.start_x-e.getWidth()),this}setStartX(t){this.start_x=t}getNoteStartX(){return this.formatted||this.format(),this.start_x}getNoteEndX(){return this.formatted||this.format(),this.end_x}getTieStartX(){return this.start_x}getTieEndX(){return this.x+this.width}getX(){return this.x}getNumLines(){return this.options.num_lines}setNumLines(t){return this.options.num_lines=parseInt(t,10),this.resetLines(),this}setY(t){return this.y=t,this}getTopLineTopY(){return this.getYForLine(0)-s.Z.STAVE_LINE_THICKNESS/2}getBottomLineBottomY(){return 2===this.getLines()?this.getYForLine(6)+s.Z.STAVE_LINE_THICKNESS/2:this.getYForLine(this.getNumLines()-1)+s.Z.STAVE_LINE_THICKNESS/2}setX(t){const e=t-this.x;this.formatted=!1,this.x=t,this.start_x+=e,this.end_x+=e;for(let t=0;ti.getWidth()&&(e-=i.getWidth()),e}setRepetitionTypeLeft(t,e){return this.modifiers.push(new rt(t,this.x,e)),this}setRepetitionTypeRight(t,e){return this.modifiers.push(new rt(t,this.x,e)),this}setVoltaType(t,e,i){if(2===t)2===gt.type&>.stave.modifiers.push(new ft(gt.type,gt.number_t,gt.x,gt.y)),gt={stave:this,type:t,number_t:e,MeasureNumber:this.MeasureNumber,y:i,x:this.x};else if(4===t){let t=this.MeasureNumber-gt.MeasureNumber,n=Math.max(gt.y,i);for(let i=0;i<=t;i++)bt[gt.MeasureNumber+i]={type:0===i?2:i===t?4:0,number_t:e,y:n};gt={}}else this.modifiers.push(new ft(t,e,this.x,i));return this}drawVolta(){let t=bt[this.MeasureNumber];t&&(this.modifiers.push(new ft(t.type,t.number_t,this.x,t.y)),delete bt[this.MeasureNumber]),gt.type&>.MeasureNumber==this.MeasureNumber&&(this.modifiers.push(new ft(gt.type,gt.number_t,this.x,gt.y)),gt={})}setSection(t,e,i=0,n=12){const s=new ot(t,this.x+i,e);return s.font.size=n,this.modifiers.push(s),this}setTempo(t,e){return this.modifiers.push(new at(t,this.x,e)),this}setText(t,e,i){let n=new ht(t,e,i);return n.setFont({family:"Arial",size:14,weight:"normal"}),this.modifiers.push(n),this}getHeight(){return this.height}getSpacingBetweenLines(){return this.options.spacing_between_lines_px}getBoundingBox(){return new ut.k(this.x,this.y,this.width,this.getBottomY()-this.y)}getBottomY(){const t=this.options,e=t.spacing_between_lines_px;return this.getYForLine(t.num_lines)+t.space_below_staff_ln*e}getBottomLineY(){return this.getYForLine(this.options.num_lines)}getYForLine(t){const e=this.options,i=e.spacing_between_lines_px,n=e.space_above_staff_ln;return this.y+t*i+n*i}getLineForY(t){const e=this.options,i=e.spacing_between_lines_px,n=e.space_above_staff_ln;return(t-this.y)/i-n}getYForTopText(t){const e=t||0;return this.getYForLine(-e-this.options.top_text_position)}getYForBottomText(t){const e=t||0;return this.getYForLine(this.options.bottom_text_position+e)}getYForNote(t){const e=this.options,i=e.spacing_between_lines_px,n=e.space_above_staff_ln;return this.y+n*i+5*i-t*i}getYForGlyphs(){return this.getYForLine(3)}addModifier(t,e,i){return void 0!==e&&t.setPosition(e),i&&(this.timeSignature.numerator=i.numerator,this.timeSignature.denominator=i.denominator),t.setStave(this),this.formatted=!1,this.modifiers.push(t),this}addEndModifier(t){return this.addModifier(t,nt.Position.END),this}setBegBarType(t){const{SINGLE:e,REPEAT_BEGIN:i,NONE:n}=st.type;return t!==e&&t!==i&&t!==n||(this.modifiers[0].setType(t),this.formatted=!1),this}setEndBarType(t){return t!==st.type.REPEAT_BEGIN&&(this.modifiers[1].setType(t),this.formatted=!1),this}setClef(t,e,i,n){void 0===n&&(n=nt.Position.BEGIN),n===nt.Position.END?this.endClef=t:this.clef=t;const s=this.getModifiers(n,ct.CATEGORY);return 0===s.length?this.addClef(t,e,i,n):s[0].setType(t,e,i),this}setEndClef(t,e,i){return this.setClef(t,e,i,nt.Position.END),this}setKeySignature(t,e,i){this.options.keySignature=t,void 0===i&&(i=nt.Position.BEGIN);const n=this.getModifiers(i,dt.CATEGORY);return 0===n.length?"jianpu"!==this.options.DYMusicScoreType&&this.addKeySignature(t,e,i):n[0].setKeySig(t,e),this}setEndKeySignature(t,e){return this.setKeySignature(t,e,nt.Position.END),this}setTimeSignature(t,e,i){void 0===i&&(i=nt.Position.BEGIN);const n=this.getModifiers(i,pt.CATEGORY);return 0===n.length?this.addTimeSignature(t,e,i):n[0].setTimeSig(t),this}setEndTimeSignature(t,e){return this.setTimeSignature(t,e,nt.Position.END),this}addKeySignature(t,e,i){return void 0===i&&(i=nt.Position.BEGIN),this.addModifier(new dt(t,e).setPosition(i),i),this}addClef(t,e,i,n){return void 0===n||n===nt.Position.BEGIN?this.clef=t:n===nt.Position.END&&(this.endClef=t),this.addModifier(new ct(t,e,i),n),this}addEndClef(t,e,i){return this.addClef(t,e,i,nt.Position.END),this}addTimeSignature(t,e,i){return this.addModifier(new pt(t,e),i),this}addEndTimeSignature(t,e){return this.addTimeSignature(t,e,nt.Position.END),this}addTrebleGlyph(){return this.addClef("treble"),this}getModifiers(t,e){return void 0===t&&void 0===e?this.modifiers:this.modifiers.filter((i=>!(void 0!==t&&t!==i.getPosition()||void 0!==e&&e!==i.getCategory())))}sortByCategory(t,e){for(let i=t.length-1;i>=0;i--)for(let n=0;ne[t[n+1].getCategory()]){const e=t[n];t[n]=t[n+1],t[n+1]=e}}format(){const t=this.modifiers[0],e=this.modifiers[1],i=this.getModifiers(nt.Position.BEGIN),n=this.getModifiers(nt.Position.END);let s,r,o;this.sortByCategory(i,{barlines:0,clefs:1,keysignatures:2,timesignatures:3}),this.sortByCategory(n,{timesignatures:0,keysignatures:1,barlines:2,clefs:3}),i.length>1&&t.getType()===st.type.REPEAT_BEGIN&&(i.push(i.splice(0,1)[0]),i.splice(0,0,new st(st.type.SINGLE))),n.indexOf(e)>0&&n.splice(0,0,new st(st.type.NONE));let a=0,l=this.x;for(let t=0;t{t.includes(i)?e.visible=!0:e.visible=!1}))}for(let s=0;sthis.drawStaveTempo())),this.measure>0){this.context.save(),this.context.setFont(this.font.family,this.font.size,this.font.weight);const t=this.context.measureText(""+this.measure).width;n=this.getYForTopText(0)+3,this.context.fillText(""+this.measure,this.x-t/2,n),this.context.restore()}return this}drawStaveTempo(){if(!this.staveTempos.length)return;const t=document.querySelector(`#${this.attrs.id}`);if(!t)return;const e=t.parentElement.getBBox(),i=this.getYForLine(0),n=t.parentElement.parentElement.querySelectorAll(".vf-curve");if(n.length){const t=this.x+this.staveTempos[0].shift_x+this.getModifierXShift(0),s=this.getYForTopText(1)+e.y-i+5;n.forEach((i=>{const n=i.getBBox();n.x-10t&&n.y-10s&&(e.y=n.y+5)}))}for(let t=0;t=0&&this.timeSignature.numerator){let t=40,e=0;this.MeasureNumber<2&&(t=70,e=-72),this.setText(`${this.timeSignature.numerator}`,1,{justification:1,shift_x:t,shift_y:e-13}),this.setText("ᅳ",1,{justification:1,shift_x:t+3,shift_y:e-2}),this.setText(`${this.timeSignature.denominator}`,1,{justification:1,shift_x:t,shift_y:e+8})}}drawVertical(t,e){this.drawVerticalFixed(this.x+t,e)}drawVerticalFixed(t,e){this.checkContext();const i=this.getYForLine(0),n=this.getYForLine(this.options.num_lines-1);e&&this.context.fillRect(t-3,i,1,n-i+1),this.context.fillRect(t,i,1,n-i+1)}drawVerticalBar(t){this.drawVerticalBarFixed(this.x+t,!1)}drawVerticalBarFixed(t){this.checkContext();const e=this.getYForLine(0),i=this.getYForLine(this.options.num_lines-1);this.context.fillRect(t,e,1,i-e+1)}getConfigForLines(){return this.options.line_config}setConfigForLine(t,e){if(t>=this.options.num_lines||t<0)throw new n.s.RERR("StaveConfigError","The line number must be within the range of the number of lines in the Stave.");if(void 0===e.visible)throw new n.s.RERR("StaveConfigError","The line configuration object is missing the 'visible' property.");if("boolean"!=typeof e.visible)throw new n.s.RERR("StaveConfigError","The line configuration objects 'visible' property must be true or false.");return this.options.line_config[t]=e,this}setConfigForLines(t){if(t.length!==this.options.num_lines)throw new n.s.RERR("StaveConfigError","The length of the lines configuration array must match the number of lines in the Stave");for(const e in t)t[e]||(t[e]=this.options.line_config[e]),n.s.Merge(this.options.line_config[e],t[e]);return this.options.line_config=t,this}}class St extends yt{constructor(t,e,i,s){const r={spacing_between_lines_px:13,num_lines:6,top_text_position:1};n.s.Merge(r,s),super(t,e,i,r),this.setAttribute("type","TabStave")}getYForGlyphs(){return this.getYForLine(2.5)}addTabGlyph(){return this.addClef("tab"),this}}var vt=i(2945);class _t extends vt.Y{static get CATEGORY(){return"tabnotes"}constructor(t,e){if(super(t),this.setAttribute("type","TabNote"),this.ghost=!1,this.positions=t.positions,n.s.Merge(this.render_options,{glyph_font_scale:s.Z.DEFAULT_TABLATURE_FONT_SCALE,draw_stem:e,draw_dots:e,draw_stem_through_stave:!1,y_shift:0,scale:1,font:"10pt Arial"}),this.glyph=s.Z.getGlyphProps(this.duration,this.noteType),!this.glyph)throw new n.s.RuntimeError("BadArguments",`Invalid note initialization data (No glyph found): ${JSON.stringify(t)}`);this.buildStem(),t.stem_direction?this.setStemDirection(t.stem_direction):this.setStemDirection(f.r.UP),this.ghost=!1,this.updateWidth()}reset(){this.stave&&this.setStave(this.stave)}getCategory(){return _t.CATEGORY}setGhost(t){return this.ghost=t,this.updateWidth(),this}hasStem(){return this.render_options.draw_stem}getStemExtension(){const t=this.getGlyph();return null!=this.stem_extension_override?this.stem_extension_override:t?1===this.getStemDirection()?t.tabnote_stem_up_extension:t.tabnote_stem_down_extension:0}addDot(){const t=new w.o;return this.dots+=1,this.addModifier(t,0)}updateWidth(){this.glyphs=[],this.width=0;for(let t=0;tthis.width}setStave(t){let e;if(super.setStave(t),this.context=t.context,this.context){const t=this.context;for(this.width=0,e=0;ei.width),this.width=Math.max(i.getWidth(),this.width)}this.glyph.getWidth=()=>this.width}const i=this.positions.map((({str:e})=>t.getYForLine(e-1)));return this.setYs(i),this.stem&&this.stem.setYBounds(this.getStemY(),this.getStemY()),this}getPositions(){return this.positions}addToModifierContext(t){this.setModifierContext(t);for(let t=0;t{("dots"!==t.getCategory()||this.render_options.draw_dots)&&(t.setContext(this.context),t.drawWithStyle())}))}drawStemThrough(){const t=this.getStemX(),e=this.getStemY(),i=this.context,n=this.render_options.draw_stem_through_stave;if(this.render_options.draw_stem&&n){const n=function(t,e){const i=[];let n=[];for(let s=1;s<=t;s++)e.indexOf(s)>-1?(i.push(n),n=[]):n.push(s);return n.length>0&&i.push(n),i}(this.stave.getNumLines(),this.positions.map((t=>t.str))),s=function(t,e,i,n){const s=1!==n,r=-1!==n,o=i.getSpacingBetweenLines(),a=i.getNumLines(),l=[];return e.forEach((e=>{const h=e.indexOf(a)>-1,u=e.indexOf(1)>-1;if(s&&u||r&&h)return;1===e.length&&e.push(e[0]);const c=[];e.forEach(((e,s,r)=>{const l=1===e,h=e===a;let u=i.getYForLine(e-1);0!==s||l?s!==r.length-1||h||(u+=o/2-1):u-=o/2-1,c.push(u),1===n&&l?c.push(t-2):-1===n&&h&&c.push(t+2)})),l.push(c.sort(((t,e)=>t-e)))})),l}(e,n,this.getStave(),this.getStemDirection());i.save(),i.setLineWidth(f.r.WIDTH),s.forEach((e=>{0!==e.length&&(i.beginPath(),i.moveTo(t,e[0]),i.lineTo(t,e[e.length-1]),i.stroke(),i.closePath())})),i.restore()}}drawPositions(){const t=this.context,e=this.getAbsoluteX(),i=this.ys;for(let n=0;nparseInt(n,10)?It.SLIDE_DOWN:It.SLIDE_UP}this.slide_direction=e,this.render_options.cp1=11,this.render_options.cp2=14,this.render_options.y_shift=.5,this.setFont({font:"Times",size:10,style:"bold italic"}),this.setNotes(t)}renderTie(t){if(0===t.first_ys.length||0===t.last_ys.length)throw new n.s.RERR("BadArguments","No Y-values to render");const e=this.context,i=t.first_x_px,s=t.first_ys,r=t.last_x_px,o=this.slide_direction;if(o!==It.SLIDE_UP&&o!==It.SLIDE_DOWN)throw new n.s.RERR("BadSlide","Invalid slide direction");for(let t=0;tthis.numStrings)throw new n.s.RERR("BadArguments",`String number must be between 1 and ${this.numStrings}:${t}`);return this.tuningValues[e-1]}getValueForFret(t,e){const i=this.getValueForString(e),s=parseInt(t,10);if(s<0)throw new n.s.RERR("BadArguments","Fret number must be 0 or higher: "+t);return i+s}getNoteForFret(t,e){const i=this.getValueForFret(t,e),n=Math.floor(i/12),r=i%12;return s.Z.integerToNote(r)+"/"+n}}class kt extends r.W{static get type(){return{CRESC:1,DECRESC:2}}static FormatByTicksAndDraw(t,e,i,s,r,o){const a=e.pixelsPerTick;if(null==a)throw new n.s.RuntimeError("BadArguments","A valid Formatter must be provide to draw offsets by ticks.");const l=a*o.left_shift_ticks,h=a*o.right_shift_ticks,u={height:o.height,y_shift:o.y_shift,left_shift_px:l,right_shift_px:h};new kt({first_note:i.first_note,last_note:i.last_note},s).setContext(t).setRenderOptions(u).setPosition(r).draw()}constructor(t,e){super(),this.setAttribute("type","StaveHairpin"),this.notes=t,this.hairpin=e,this.position=P.Modifier.Position.BELOW,this.render_options={height:10,y_shift:0,left_shift_px:0,right_shift_px:0},this.setNotes(t)}setPosition(t){return t!==P.Modifier.Position.ABOVE&&t!==P.Modifier.Position.BELOW||(this.position=t),this}setRenderOptions(t){return null!=t.height&&null!=t.y_shift&&null!=t.left_shift_px&&null!=t.right_shift_px&&(this.render_options=t),this}setNotes(t){if(!t.first_note&&!t.last_note)throw new n.s.RuntimeError("BadArguments","Hairpin needs to have either first_note or last_note set.");return this.first_note=t.first_note,this.last_note=t.last_note,this}renderHairpin(t){const e=this.checkContext();let i=this.render_options.y_shift+20,n=t.first_y;this.position===P.Modifier.Position.ABOVE&&(i=30-i,n=t.first_y-t.staff_height);const s=this.render_options.left_shift_px,r=this.render_options.right_shift_px;switch(e.beginPath(),this.hairpin){case kt.type.CRESC:e.moveTo(t.last_x+r,n+i),e.lineTo(t.first_x+s,n+this.render_options.height/2+i),e.lineTo(t.last_x+r,n+this.render_options.height+i);break;case kt.type.DECRESC:e.moveTo(t.first_x+s,n+i),e.lineTo(t.last_x+r,n+this.render_options.height/2+i),e.lineTo(t.first_x+s,n+this.render_options.height+i)}e.stroke(),e.closePath()}draw(){this.checkContext(),this.setRendered();const t=this.first_note,e=this.last_note,i=t.getModifierStartXY(this.position,0),n=e.getModifierStartXY(this.position,0);return this.renderHairpin({first_x:i.x,last_x:n.x,first_y:t.getStave().y+t.getStave().height,last_y:e.getStave().y+e.getStave().height,staff_height:t.getStave().height}),!0}}class Ot extends r.W{static get Position(){return{NEAR_HEAD:1,NEAR_TOP:2}}static get PositionString(){return{nearHead:Ot.Position.NEAR_HEAD,nearTop:Ot.Position.NEAR_TOP}}constructor(t,e,i){super(),this.setAttribute("type","Curve"),this.render_options={spacing:2,thickness:2,x_shift:0,y_shift:10,position:Ot.Position.NEAR_HEAD,position_end:Ot.Position.NEAR_HEAD,invert:!1,cps:[{x:0,y:10},{x:0,y:10}]},n.s.Merge(this.render_options,i),this.setNotes(t,e)}setNotes(t,e){if(!t&&!e)throw new n.s.RuntimeError("BadArguments","Curve needs to have either first_note or last_note set.");return this.from=t,this.to=e,this}isPartial(){return!this.from||!this.to}renderCurve(t){const e=this.context,i=this.render_options.cps,n=this.render_options.x_shift,s=this.render_options.y_shift*t.direction,r=t.first_x+n,o=t.first_y+s,a=t.last_x-n,l=t.last_y+s,h=this.render_options.thickness,u=(a-r)/(i.length+2);e.beginPath(),e.moveTo(r,o),e.bezierCurveTo(r+u+i[0].x,o+i[0].y*t.direction,a-u+i[1].x,l+i[1].y*t.direction,a,l),e.bezierCurveTo(a-u+i[1].x,l+(i[1].y+h)*t.direction,r+u+i[0].x,o+(i[0].y+h)*t.direction,r,o),e.stroke(),e.closePath(),e.fill()}draw(){this.checkContext(),this.setRendered();const t=this.from,e=this.to;let i,n,s,r,o,a="baseY",l="baseY";function h(t){return"string"==typeof t?Ot.PositionString[t]:t}const u=h(this.render_options.position),c=h(this.render_options.position_end);return u===Ot.Position.NEAR_TOP&&(a="topY",l="topY"),c===Ot.Position.NEAR_HEAD?l="baseY":c===Ot.Position.NEAR_TOP&&(l="topY"),t?(i=t.getTieRightX(),o=t.getStemDirection(),s=t.getStemExtents()[a]):(i=e.getStave().getTieStartX(),s=e.getStemExtents()[a]),e?(n=e.getTieLeftX(),o=e.getStemDirection(),r=e.getStemExtents()[l]):(n=t.getStave().getTieEndX(),r=t.getStemExtents()[l]),this.renderCurve({first_x:i,last_x:n,first_y:s,last_y:r,direction:o*(!0===this.render_options.invert?-1:1)}),!0}}function Dt(...t){Bt.DEBUG&&n.s.L("Vex.Flow.TextDynamics",t)}class Bt extends M.j{static get GLYPHS(){return{f:{code:"vba",width:12},p:{code:"vbf",width:14},m:{code:"v62",width:17},s:{code:"v4a",width:10},z:{code:"v80",width:12},r:{code:"vb1",width:12}}}constructor(t){super(t),this.setAttribute("type","TextDynamics"),this.sequence=t.text.toLowerCase(),this.line=t.line||0,this.glyphs=[],n.s.Merge(this.render_options,{glyph_font_size:40}),Dt("New Dynamics Text: ",this.sequence)}setLine(t){return this.line=t,this}preFormat(){let t=0;return this.sequence.split("").forEach((e=>{const i=Bt.GLYPHS[e];if(!i)throw new n.s.RERR("Invalid dynamics character: "+e);const s=this.render_options.glyph_font_size,r=new p.r(i.code,s);this.glyphs.push(r),t+=i.width})),this.setWidth(t),this.preFormatted=!0,this}draw(){this.setRendered();const t=this.getAbsoluteX(),e=this.stave.getYForLine(this.line+-3);Dt("Rendering Dynamics: ",this.sequence);let i=t;this.glyphs.forEach(((t,n)=>{const s=this.sequence[n];t.render(this.context,i,e),i+=Bt.GLYPHS[s].width}))}}function Ft(t,e,i,n,s,r,o){t.beginPath(),t.moveTo(e,i),t.lineTo(n,s),t.lineTo(r,o),t.lineTo(e,i),t.closePath(),t.fill()}class Vt extends r.W{static get TextVerticalPosition(){return{TOP:1,BOTTOM:2}}static get TextJustification(){return{LEFT:1,CENTER:2,RIGHT:3}}constructor(t){super(),this.setAttribute("type","StaveLine"),this.notes=t,this.text="",this.font={family:"Arial",size:10,weight:""},this.render_options={padding_left:4,padding_right:3,line_width:1,line_dash:null,rounded_end:!0,color:null,draw_start_arrow:!1,draw_end_arrow:!1,arrowhead_length:10,arrowhead_angle:Math.PI/8,text_position_vertical:Vt.TextVerticalPosition.TOP,text_justification:Vt.TextJustification.CENTER},this.setNotes(t)}setFont(t){return this.font=t,this}setText(t){return this.text=t,this}setNotes(t){if(!t.first_note&&!t.last_note)throw new n.s.RuntimeError("BadArguments","Notes needs to have either first_note or last_note set.");if(t.first_indices||(t.first_indices=[0]),t.last_indices||(t.last_indices=[0]),t.first_indices.length!==t.last_indices.length)throw new n.s.RuntimeError("BadArguments","Connected notes must have similar index sizes");return this.first_note=t.first_note,this.first_indices=t.first_indices,this.last_note=t.last_note,this.last_indices=t.last_indices,this}applyLineStyle(){const t=this.checkContext(),e=this.render_options;e.line_dash&&t.setLineDash(e.line_dash),e.line_width&&t.setLineWidth(e.line_width),e.rounded_end?t.setLineCap("round"):t.setLineCap("square")}applyFontStyle(){const t=this.checkContext();this.font&&t.setFont(this.font.family,this.font.size,this.font.weight),this.render_options.color&&(t.setStrokeStyle(this.render_options.color),t.setFillStyle(this.render_options.color))}draw(){const t=this.checkContext();this.setRendered();const e=this.first_note,i=this.last_note,n=this.render_options;let r,o;t.save(),this.applyLineStyle(),this.first_indices.forEach(((s,a)=>{const l=this.last_indices[a];r=e.getModifierStartXY(2,s),o=i.getModifierStartXY(1,l);const h=r.y>o.y;r.x+=e.getMetrics().modRightPx+n.padding_left,o.x-=i.getMetrics().modLeftPx+n.padding_right;const u=e.getGlyph().getWidth();e.getKeyProps()[s].displaced&&1===e.getStemDirection()&&(r.x+=u+n.padding_left),i.getKeyProps()[l].displaced&&-1===i.getStemDirection()&&(o.x-=u+n.padding_right),r.y+=h?-3:1,o.y+=h?2:0,function(t,e,i,n){const s=n.draw_start_arrow&&n.draw_end_arrow,r=e.x,o=e.y,a=i.x,l=i.y,h=Math.sqrt((a-r)*(a-r)+(l-o)*(l-o)),u=(h-n.arrowhead_length/3)/h;let c,d,p,f;n.draw_end_arrow||s?(c=Math.round(r+(a-r)*u),d=Math.round(o+(l-o)*u)):(c=a,d=l),n.draw_start_arrow||s?(p=r+(a-r)*(1-u),f=o+(l-o)*(1-u)):(p=r,f=o),n.color&&(t.setStrokeStyle(n.color),t.setFillStyle(n.color)),t.beginPath(),t.moveTo(p,f),t.lineTo(c,d),t.stroke(),t.closePath();const m=Math.atan2(l-o,a-r),g=Math.abs(n.arrowhead_length/Math.cos(n.arrowhead_angle));let b,y,S,v,_,x;(n.draw_end_arrow||s)&&(b=m+Math.PI+n.arrowhead_angle,S=a+Math.cos(b)*g,v=l+Math.sin(b)*g,y=m+Math.PI-n.arrowhead_angle,_=a+Math.cos(y)*g,x=l+Math.sin(y)*g,Ft(t,S,v,a,l,_,x)),(n.draw_start_arrow||s)&&(b=m+n.arrowhead_angle,S=r+Math.cos(b)*g,v=o+Math.sin(b)*g,y=m-n.arrowhead_angle,_=r+Math.cos(y)*g,x=o+Math.sin(y)*g,Ft(t,S,v,r,o,_,x))}(t,r,o,this.render_options)})),t.restore();const a=t.measureText(this.text).width,l=n.text_justification;let h,u=0;l===Vt.TextJustification.LEFT?u=r.x:l===Vt.TextJustification.CENTER?u=(o.x-r.x)/2+r.x-a/2:l===Vt.TextJustification.RIGHT&&(u=o.x-a);const c=n.text_position_vertical;return c===Vt.TextVerticalPosition.TOP?h=e.getStave().getYForTopText():c===Vt.TextVerticalPosition.BOTTOM&&(h=e.getStave().getYForBottomText(s.Z.TEXT_HEIGHT_OFFSET_HACK)),t.save(),this.applyFontStyle(),t.fillText(this.text,u,h),t.restore(),this}}function Gt(t,e,i,n,s){const r=Wt.GLYPHS[t];new p.r(r.code,s).render(e,i+r.x_shift,n+r.y_shift)}class Wt extends r.W{static get GLYPHS(){return{pedal_depress:{code:"v36",x_shift:-10,y_shift:0},pedal_release:{code:"v5d",x_shift:-2,y_shift:3}}}static get Styles(){return{TEXT:1,BRACKET:2,MIXED:3,MIXED_OPEN_END:4,BRACKET_OPEN_BEGIN:5,BRACKET_OPEN_END:6,BRACKET_OPEN_BOTH:7}}static get StylesString(){return{text:Wt.Styles.TEXT,bracket:Wt.Styles.BRACKET,mixed:Wt.Styles.MIXED,mixed_open_end:Wt.Styles.MIXED_OPEN_END,bracket_open_begin:Wt.Styles.BRACKET_OPEN_BEGIN,bracket_open_end:Wt.Styles.BRACKET_OPEN_END,bracket_open_both:Wt.Styles.BRACKET_OPEN_BOTH}}static createSustain(t){return new Wt(t)}static createSostenuto(t){const e=new Wt(t);return e.setStyle(Wt.Styles.MIXED),e.setCustomText("Sost. Ped."),e}static createUnaCorda(t){const e=new Wt(t);return e.setStyle(Wt.Styles.TEXT),e.setCustomText("una corda","tre corda"),e}constructor(t){super(),this.setAttribute("type","PedalMarking"),this.EndsStave=!1,this.ChangeBegin=!1,this.ChangeEnd=!1,this.notes=t,this.style=Wt.TEXT,this.line=0,this.custom_depress_text="",this.custom_release_text="",this.font={family:"Times New Roman",size:12,weight:"italic bold"},this.render_options={bracket_height:10,text_margin_right:6,bracket_line_width:1,glyph_point_size:40,color:"black"}}setEndStave(t){if(this.endStave=t,this.endStaveAddedWidth=0,this.startMargin=0,this.endMargin=0,Array.isArray(this.endStave.modifiers))for(let t=0;t3)throw new n.s.RERR("InvalidParameter","The style must be one found in PedalMarking.Styles");return this.style=t,this}setLine(t){return this.line=t,this}drawBracketed(){const t=this.context;let e,i,n=!1;const s=this;this.notes.forEach(((r,o,a)=>{n=!n;let l=0;if(l=r?r.getNoteHeadBeginX():this.endStave.end_x+this.endStaveAddedWidth,this.EndsStave)n?this.ChangeBegin&&(l=r.getAbsoluteX()):(l=r?this.ChangeEnd?r.getAbsoluteX():r.getStave().end_x+this.endStaveAddedWidth-s.render_options.text_margin_right:this.endStave.end_x+this.endStaveAddedWidth-s.render_options.text_margin_right,this.endMargin=-s.render_options.text_margin_right);else if(r)if(n)this.ChangeBegin&&(l=r.getAbsoluteX());else switch(s.style){case Wt.Styles.BRACKET_OPEN_END:case Wt.Styles.BRACKET_OPEN_BOTH:case Wt.Styles.MIXED_OPEN_END:l=r.getNoteHeadEndX();break;default:this.ChangeEnd?l=r.getAbsoluteX():(l=r.getNoteHeadBeginX()-s.render_options.text_margin_right,this.startMargin=-s.render_options.text_margin_right)}let h=this.endStave;r&&(h=r.getStave());let u=h.getYForBottomText(s.line+3);i&&i>u&&(u=i);const c=a[o+1]===r,d=a[o-1]===r;let p=0;if(n)if(p=d?5:0,s.style!==Wt.Styles.MIXED&&s.style!==Wt.Styles.MIXED_OPEN_END||d)t.beginPath(),s.style===Wt.Styles.BRACKET_OPEN_BEGIN||s.style===Wt.Styles.BRACKET_OPEN_BOTH?t.moveTo(l+p,u):(this.ChangeBegin&&(l+=5),t.moveTo(l,u-s.render_options.bracket_height),this.ChangeBegin&&(l+=5),t.lineTo(l+p,u)),t.stroke(),t.closePath();else if(s.custom_depress_text){const e=t.measureText(s.custom_depress_text).width;t.fillText(s.custom_depress_text,l-e/2,u),p=e/2+s.render_options.text_margin_right}else Gt("pedal_depress",t,l,u,s.render_options.glyph_point_size),p=20+s.render_options.text_margin_right;else p=c&&!this.EndsStave?-5:0,t.beginPath(),t.moveTo(e,i),t.lineTo(l+p,u),s.style!==Wt.Styles.BRACKET_OPEN_END&&s.style!==Wt.Styles.MIXED_OPEN_END&&s.style!==Wt.Styles.BRACKET_OPEN_BOTH&&(this.ChangeEnd&&(l+=5),t.lineTo(l,u-s.render_options.bracket_height)),t.stroke(),t.closePath();e=l+p,i=u}))}drawText(){const t=this.context;let e=!1;const i=this,n=i.render_options.glyph_point_size;this.notes.forEach((s=>{e=!e;const r=s.getStave(),o=s.getAbsoluteX(),a=r.getYForBottomText(i.line+3);let l=0;e?i.custom_depress_text?(l=t.measureText(i.custom_depress_text).width,t.fillText(i.custom_depress_text,o-l/2,a)):Gt("pedal_depress",t,o,a,n):i.custom_release_text?(l=t.measureText(i.custom_release_text).width,t.fillText(i.custom_release_text,o-l/2,a)):Gt("pedal_release",t,o,a,n)}))}draw(){const t=this.checkContext();this.setRendered(),t.save(),t.setStrokeStyle(this.render_options.color),t.setFillStyle(this.render_options.color),t.setFont(this.font.family,this.font.size,this.font.weight),function(...t){Wt.DEBUG&&n.s.L("Vex.Flow.PedalMarking",t)}("Rendering Pedal Marking"),this.style===Wt.Styles.BRACKET||this.style===Wt.Styles.MIXED||this.style===Wt.Styles.MIXED_OPEN_END||this.style===Wt.Styles.BRACKET_OPEN_BEGIN||this.style===Wt.Styles.BRACKET_OPEN_END||this.style===Wt.Styles.BRACKET_OPEN_BOTH?(t.setLineWidth(this.render_options.bracket_line_width),this.drawBracketed()):this.style===Wt.Styles.TEXT&&this.drawText(),t.restore()}}class Ut extends r.W{static get Positions(){return{TOP:1,BOTTOM:-1}}static get PositionString(){return{top:Ut.Positions.TOP,bottom:Ut.Positions.BOTTOM}}constructor({start:t,stop:e,text:i="",superscript:n="",position:s=Ut.Positions.TOP}){super(),this.setAttribute("type","TextBracket"),this.start=t,this.stop=e,this.text=i,this.superscript=n,this.position="string"==typeof s?Ut.PositionString[s]:s,this.line=1,this.font={family:"Serif",size:15,weight:"italic"},this.render_options={dashed:!0,dash:[5],color:"black",line_width:1,show_bracket:!0,bracket_height:8,underline_superscript:!0}}applyStyle(t){return t.setFont(this.font.family,this.font.size,this.font.weight),t.setStrokeStyle(this.render_options.color),t.setFillStyle(this.render_options.color),t.setLineWidth(this.render_options.line_width),this}setDashed(t,e){return this.render_options.dashed=t,e&&(this.render_options.dash=e),this}setFont(t){return this.font={...this.font,...t},this}setLine(t){return this.line=t,this}draw(){const t=this.context;this.setRendered();let e=0;switch(this.position){case Ut.Positions.TOP:e=this.start.getStave().getYForTopText(this.line);break;case Ut.Positions.BOTTOM:e=this.start.getStave().getYForBottomText(this.line+s.Z.TEXT_HEIGHT_OFFSET_HACK);break;default:throw new n.s.RERR("InvalidPosition",`The position ${this.position} is invalid`)}const i={x:this.start.getAbsoluteX(),y:e},r={x:this.stop.getAbsoluteX(),y:e};!function(...t){Ut.DEBUG&&n.s.L("Vex.Flow.TextBracket",t)}("Rendering TextBracket: start:",i,"stop:",r,"y:",e);const o=this.render_options.bracket_height*this.position;t.save(),this.applyStyle(t),t.fillText(this.text,i.x,i.y);const a=t.measureText(this.text).width,l=t.measureText("M").width,h=i.y-l/2.5;t.setFont(this.font.family,this.font.size/1.4,this.font.weight),t.fillText(this.superscript,i.x+a+1,h);const u=t.measureText(this.superscript).width,c=t.measureText("M").width;let p=i.x,f=h;const m=r.x+this.stop.getGlyph().getWidth();this.position===Ut.Positions.TOP?(p+=a+u+5,f-=c/2.7):this.position===Ut.Positions.BOTTOM&&(f+=c/2.7,p+=a+2,this.render_options.underline_superscript||(p+=u)),this.render_options.dashed?(d.drawDashedLine(t,p,f,m,f,this.render_options.dash),this.render_options.show_bracket&&d.drawDashedLine(t,m,f+1*this.position,m,f+o,this.render_options.dash)):(t.beginPath(),t.moveTo(p,f),t.lineTo(m,f),this.render_options.show_bracket&&t.lineTo(m,f+o),t.stroke(),t.closePath()),t.restore()}}class Ht extends M.j{constructor(t=st.type.SINGLE){super({duration:"b"}),this.setAttribute("type","BarNote"),this.metrics={widths:{}};const e=st.type;this.metrics.widths={[e.SINGLE]:8,[e.DOUBLE]:12,[e.END]:15,[e.REPEAT_BEGIN]:14,[e.REPEAT_END]:14,[e.REPEAT_BOTH]:18,[e.NONE]:0},this.ignore_ticks=!0,this.setType(t)}getType(){return this.type}setType(t){return this.type="string"==typeof t?st.typeString[t]:t,this.setWidth(this.metrics.widths[this.type]),this}getBoundingBox(){return super.getBoundingBox()}addToModifierContext(){return this}preFormat(){return this.setPreFormatted(!0),this}draw(){if(this.checkContext(),!this.stave)throw new n.s.RERR("NoStave","Can't draw without a stave.");!function(...t){Ht.DEBUG&&n.s.L("Vex.Flow.BarNote",t)}("Rendering bar line at: ",this.getAbsoluteX());const t=new st(this.type);t.setX(this.getAbsoluteX()),t.draw(this.stave),this.setRendered()}}class zt extends vt.Y{constructor(t){if(!t)throw new n.s.RuntimeError("BadArguments","Ghost note must have valid initialization data to identify duration.");let e;if("string"==typeof t)e={duration:t};else{if("object"!=typeof t)throw new n.s.RuntimeError("BadArguments","Ghost note must have valid initialization data to identify duration.");e=t}super(e),this.setAttribute("type","GhostNote"),this.setWidth(0)}isRest(){return!0}setStave(t){super.setStave(t)}addToModifierContext(){return this}preFormat(){return this.setPreFormatted(!0),this}draw(){if(!this.stave)throw new n.s.RERR("NoStave","Can't draw without a stave.");this.setRendered();for(let t=0;t0||!0===e;return!e||s>0||(this.pos=n),o?this.matchSuccess():this.matchFail(n),{success:o,results:i,numMatches:s}}expectZeroOrMore(t){return this.expectOneOrMore(t,!0)}expect(t){let e;if(function(...t){Zt.DEBUG&&n.s.L("Vex.Flow.Parser",t)}("Evaluating rules:",t),!t)throw new Kt("Invalid Rule: "+t,t);const i=t.bind(this.grammar)();if(i.token)e=this.matchToken(i.token,!0===i.noSpace),e.success&&(this.pos+=e.incrementPos);else{if(!i.expect)throw new Kt("Bad grammar! No `token` or `expect` property",i);e=i.oneOrMore?this.expectOneOrMore(i):i.zeroOrMore?this.expectZeroOrMore(i):this.expectOne(i)}return e.matches=[],e.results&&e.results.forEach((t=>e.matches.push(qt(t)))),i.run&&e.success&&i.run(e),e}}function $t(...t){ne.DEBUG&&n.s.L("Vex.Flow.EasyScore",t)}const Jt=n.s.MakeException("EasyScoreError");class Qt{constructor(t){this.builder=t}begin(){return this.LINE}LINE(){return{expect:[this.PIECE,this.PIECES,this.EOL]}}PIECE(){return{expect:[this.CHORDORNOTE,this.PARAMS],run:()=>this.builder.commitPiece()}}PIECES(){return{expect:[this.COMMA,this.PIECE],zeroOrMore:!0}}PARAMS(){return{expect:[this.DURATION,this.TYPE,this.DOTS,this.OPTS]}}CHORDORNOTE(){return{expect:[this.CHORD,this.SINGLENOTE],or:!0}}CHORD(){return{expect:[this.LPAREN,this.NOTES,this.RPAREN],run:t=>this.builder.addChord(t.matches[1])}}NOTES(){return{expect:[this.NOTE],oneOrMore:!0}}NOTE(){return{expect:[this.NOTENAME,this.ACCIDENTAL,this.OCTAVE]}}SINGLENOTE(){return{expect:[this.NOTENAME,this.ACCIDENTAL,this.OCTAVE],run:t=>this.builder.addSingleNote(t.matches[0],t.matches[1],t.matches[2])}}ACCIDENTAL(){return{expect:[this.ACCIDENTALS],maybe:!0}}DOTS(){return{expect:[this.DOT],zeroOrMore:!0,run:t=>this.builder.setNoteDots(t.matches[0])}}TYPE(){return{expect:[this.SLASH,this.MAYBESLASH,this.TYPES],maybe:!0,run:t=>this.builder.setNoteType(t.matches[2])}}DURATION(){return{expect:[this.SLASH,this.DURATIONS],maybe:!0,run:t=>this.builder.setNoteDuration(t.matches[1])}}OPTS(){return{expect:[this.LBRACKET,this.KEYVAL,this.KEYVALS,this.RBRACKET],maybe:!0}}KEYVALS(){return{expect:[this.COMMA,this.KEYVAL],zeroOrMore:!0}}KEYVAL(){return{expect:[this.KEY,this.EQUALS,this.VAL],run:t=>this.builder.addNoteOption(t.matches[0],t.matches[2].slice(1,-1))}}VAL(){return{expect:[this.SVAL,this.DVAL],or:!0}}KEY(){return{token:"[a-zA-Z][a-zA-Z0-9]*"}}DVAL(){return{token:'["][^"]*["]'}}SVAL(){return{token:"['][^']*[']"}}NOTENAME(){return{token:"[a-gA-G]"}}OCTAVE(){return{token:"[0-9]+"}}ACCIDENTALS(){return{token:"bbs|bb|bss|bs|b|db|d|##|#|n|\\+\\+-|\\+-|\\+\\+|\\+|k|o"}}DURATIONS(){return{token:"[0-9whq]+"}}TYPES(){return{token:"[rRsSxX]"}}LPAREN(){return{token:"[(]"}}RPAREN(){return{token:"[)]"}}COMMA(){return{token:"[,]"}}DOT(){return{token:"[.]"}}SLASH(){return{token:"[/]"}}MAYBESLASH(){return{token:"[/]?"}}EQUALS(){return{token:"[=]"}}LBRACKET(){return{token:"\\["}}RBRACKET(){return{token:"\\]"}}EOL(){return{token:"$"}}}class te{constructor(t){this.factory=t,this.commitHooks=[],this.reset()}reset(t={}){this.options={stem:"auto",clef:"treble"},this.elements={notes:[],accidentals:[]},this.rollingDuration="8",this.resetPiece(),Object.assign(this.options,t)}getFactory(){return this.factory}getElements(){return this.elements}addCommitHook(t){this.commitHooks.push(t)}resetPiece(){$t("resetPiece"),this.piece={chord:[],duration:this.rollingDuration,dots:0,type:void 0,options:{}}}setNoteDots(t){$t("setNoteDots:",t),t&&(this.piece.dots=t.length)}setNoteDuration(t){$t("setNoteDuration:",t),this.rollingDuration=this.piece.duration=t||this.rollingDuration}setNoteType(t){$t("setNoteType:",t),t&&(this.piece.type=t)}addNoteOption(t,e){$t("addNoteOption: key:",t,"value:",e),this.piece.options[t]=e}addNote(t,e,i){$t("addNote:",t,e,i),this.piece.chord.push({key:t,accid:e,octave:i})}addSingleNote(t,e,i){$t("addSingleNote:",t,e,i),this.addNote(t,e,i)}addChord(t){$t("startChord"),"object"!=typeof t[0]?this.addSingleNote(t[0]):t.forEach((t=>{t&&this.addNote(...t)})),$t("endChord")}commitPiece(){$t("commitPiece");const{factory:t}=this;if(!t)return;const e={...this.options,...this.piece.options},{stem:i,clef:n}=e,s="auto"===i.toLowerCase(),r=s||"up"!==i.toLowerCase()?E.$.STEM_DOWN:E.$.STEM_UP,{chord:o,duration:a,dots:l,type:h}=this.piece,u=o.map((t=>t.key+"/"+t.octave)),c=t.StaveNote({keys:u,duration:a,dots:l,type:h,clef:n,auto_stem:s});s||c.setStemDirection(r);const d=o.map((t=>t.accid||null));d.forEach(((e,i)=>{e&&c.addAccidental(i,t.Accidental({type:e}))}));for(let t=0;tt(e,c,this))),this.elements.notes.push(c),this.elements.accidentals.concat(d),this.resetPiece()}}function ee({id:t},e){void 0!==t&&e.setAttribute("id",t)}function ie(t,e){t.class&&t.class.split(/\s*,\s*/).forEach((t=>e.addClass(t)))}class ne{constructor(t={}){this.setOptions(t),this.defaults={clef:"treble",time:"4/4",stem:"auto"}}set(t){return Object.assign(this.defaults,t),this}setOptions(t){return this.options={factory:null,builder:null,commitHooks:[ee,ie,j.easyScoreHook],throwOnError:!1,...t},this.factory=this.options.factory,this.builder=this.options.builder||new te(this.factory),this.grammar=new Qt(this.builder),this.parser=new Zt(this.grammar),this.options.commitHooks.forEach((t=>this.addCommitHook(t))),this}setContext(t){return this.factory&&this.factory.setContext(t),this}parse(t,e={}){this.builder.reset(e);const i=this.parser.parse(t);if(!i.success&&this.options.throwOnError)throw new Jt("Error parsing line: "+t,i);return i}beam(t,e={}){return this.factory.Beam({notes:t,options:e}),t}tuplet(t,e={}){return this.factory.Tuplet({notes:t,options:e}),t}notes(t,e={}){return e={clef:this.defaults.clef,stem:this.defaults.stem,...e},this.parse(t,e),this.builder.getElements().notes}voice(t,e){return e={time:this.defaults.time,...e},this.factory.Voice(e).addTickables(t)}addCommitHook(t){return this.builder.addCommitHook(t)}}var se=i(3544);const re=n.s.MakeException("FactoryError");function oe(t={},e){const i=e.options;return(t=Object.assign(e,t)).options=Object.assign(i,t.options),t}class ae{constructor(t){!function(...t){ae.DEBUG&&n.s.L("Vex.Flow.Factory",t)}("New factory: ",t);const e={stave:{space:10},renderer:{context:null,elementId:"",backend:d.Backends.SVG,width:500,height:200,background:"#FFF"},font:{face:"Arial",point:10,style:""}};this.options=e,this.setOptions(t)}static newFromElementId(t,e=500,i=200){return new ae({renderer:{elementId:t,width:e,height:i}})}reset(){this.renderQ=[],this.systems=[],this.staves=[],this.voices=[],this.stave=null}getOptions(){return this.options}setOptions(t){for(const e of["stave","renderer","font"])Object.assign(this.options[e],t[e]);(null!==this.options.renderer.elementId||this.options.renderer.context)&&this.initRenderer(),this.reset()}initRenderer(){const{elementId:t,backend:e,width:i,height:n,background:s}=this.options.renderer;if(""===t)throw new re("HTML DOM element not set in Factory");this.context=d.buildContext(t,e,i,n,s)}getContext(){return this.context}setContext(t){return this.context=t,this}getStave(){return this.stave}getVoices(){return this.voices}space(t){return this.options.stave.space*t}Stave(t){t=oe(t,{x:0,y:0,width:this.options.renderer.width-this.space(1),options:{spacing_between_lines_px:this.options.stave.space}});const e=new yt(t.x,t.y,t.width,t.options);return this.staves.push(e),e.setContext(this.context),this.stave=e,e}TabStave(t){t=oe(t,{x:0,y:0,width:this.options.renderer.width-this.space(1),options:{spacing_between_lines_px:1.3*this.options.stave.space}});const e=new St(t.x,t.y,t.width,t.options);return this.staves.push(e),e.setContext(this.context),this.stave=e,e}StaveNote(t){const e=new E.$(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}GhostNote(t){const e=new zt(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}TextNote(t){const e=new lt(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}NumberedNote(t){const e=new se.NumberedNote(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}BarNote(t){t=oe(t,{type:"single",options:{}});const e=new Ht(t.type);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}ClefNote(t){t=oe(t,{type:"treble",options:{size:"default"}});const e=new Tt(t.type,t.options.size,t.options.annotation);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}TimeSigNote(t){t=oe(t,{time:"4/4",options:{}});const e=new At(t.time);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}KeySigNote(t){const e=new Ct(t.key,t.cancelKey,t.alterKey);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}TabNote(t){const e=new _t(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}GraceNote(t){const e=new Lt(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),e}GraceNoteGroup(t){const e=new O(t.notes,t.slur);return e.setContext(this.context),e}Accidental(t){t=oe(t,{type:null,options:{}});const e=new L(t.type);return e.setContext(this.context),e}Annotation(t){t=oe(t,{text:"p",vJustify:"below",hJustify:"center",fontFamily:"Times",fontSize:14,fontWeight:"bold italic",options:{}});const e=new q(t.text);return e.setJustification(t.hJustify),e.setVerticalJustification(t.vJustify),e.setFont(t.fontFamily,t.fontSize,t.fontWeight),e.setContext(this.context),e}Articulation(t){t=oe(t,{type:"a.",position:"above",options:{}});const e=new j(t.type);return e.setPosition(t.position),e.setContext(this.context),e}TextDynamics(t){t=oe(t,{text:"p",duration:"q",dots:0,line:0,options:{}});const e=new Bt({text:t.text,line:t.line,duration:t.duration,dots:t.dots});return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}Fingering(t){t=oe(t,{number:"0",position:"left",options:{}});const e=new T(t.number);return e.setPosition(t.position),e.setContext(this.context),e}StringNumber(t){t=oe(t,{number:"0",position:"left",options:{}});const e=new B(t.number);return e.setPosition(t.position),e.setContext(this.context),e}TickContext(){return(new Y).setContext(this.context)}ModifierContext(){return new Q}MultiMeasureRest(t){const e=new Pt(t.number_of_measures,t);return e.setContext(this.context),this.renderQ.push(e),e}Voice(t){t=oe(t,{time:"4/4",options:{}});const e=new v(t.time);return this.voices.push(e),e}StaveConnector(t){t=oe(t,{top_stave:null,bottom_stave:null,type:"double",options:{}});const e=new x(t.top_stave,t.bottom_stave);return e.setType(t.type).setContext(this.context),this.renderQ.push(e),e}Formatter(){return new it}Tuplet(t){t=oe(t,{notes:[],options:{}});const e=new m(t.notes,t.options).setContext(this.context);return this.renderQ.push(e),e}Beam(t){t=oe(t,{notes:[],options:{autoStem:!1,secondaryBeamBreaks:[]}});const e=new S(t.notes,t.options.autoStem).setContext(this.context);return e.breakSecondaryAt(t.options.secondaryBeamBreaks),this.renderQ.push(e),e}Curve(t){t=oe(t,{from:null,to:null,options:{}});const e=new Ot(t.from,t.to,t.options).setContext(this.context);return this.renderQ.push(e),e}StaveTie(t){t=oe(t,{from:null,to:null,first_indices:[0],last_indices:[0],text:null,options:{direction:void 0}});const e=new N({first_note:t.from,last_note:t.to,first_indices:t.first_indices,last_indices:t.last_indices},t.text);return t.options.direction&&e.setDirection(t.options.direction),e.setContext(this.context),this.renderQ.push(e),e}StaveLine(t){t=oe(t,{from:null,to:null,first_indices:[0],last_indices:[0],options:{}});const e=new Vt({first_note:t.from,last_note:t.to,first_indices:t.first_indices,last_indices:t.last_indices});return t.options.text&&e.setText(t.options.text),t.options.font&&e.setFont(t.options.font),e.setContext(this.context),this.renderQ.push(e),e}VibratoBracket(t){t=oe(t,{from:null,to:null,options:{harsh:!1}});const e=new xt({start:t.from,stop:t.to});return t.options.line&&e.setLine(t.options.line),t.options.harsh&&e.setHarsh(t.options.harsh),e.setContext(this.context),this.renderQ.push(e),e}TextBracket(t){t=oe(t,{from:null,to:null,text:"",options:{superscript:"",position:1}});const e=new Ut({start:t.from,stop:t.to,text:t.text,superscript:t.options.superscript,position:t.options.position});return t.options.line&&e.setLine(t.options.line),t.options.font&&e.setFont(t.options.font),e.setContext(this.context),this.renderQ.push(e),e}System(t={}){t.factory=this;const e=new he(t).setContext(this.context);return this.systems.push(e),e}EasyScore(t={}){return t.factory=this,new ne(t)}PedalMarking(t={}){t=oe(t,{notes:[],options:{style:"mixed"}});const e=new Wt(t.notes);return e.setStyle(Wt.StylesString[t.options.style]),e.setContext(this.context),this.renderQ.push(e),e}NoteSubGroup(t={}){t=oe(t,{notes:[],options:{}});const e=new R(t.notes);return e.setContext(this.context),e}draw(){this.systems.forEach((t=>t.setContext(this.context).format())),this.staves.forEach((t=>t.setContext(this.context).draw())),this.voices.forEach((t=>t.setContext(this.context).draw())),this.renderQ.forEach((t=>{t.isRendered()||t.setContext(this.context).draw()})),this.systems.forEach((t=>t.setContext(this.context).draw())),this.reset()}}function le(t,e){const i=e.options;return(t=Object.assign(e,t)).options=Object.assign(i,t.options),t}class he extends r.W{constructor(t={}){super(),this.setAttribute("type","System"),this.setOptions(t),this.parts=[]}setOptions(t={}){this.options=le(t,{x:10,y:10,width:500,connector:null,spaceBetweenStaves:12,factory:null,debugFormatter:!1,formatIterations:0,options:{}}),this.factory=this.options.factory||new ae({renderer:{el:null}})}setContext(t){return super.setContext(t),this.factory.setContext(t),this}addConnector(t="double"){return this.connector=this.factory.StaveConnector({top_stave:this.parts[0].stave,bottom_stave:this.parts[this.parts.length-1].stave,type:t}),this.connector}addStave(t){return(t=le(t,{stave:null,voices:[],spaceAbove:0,spaceBelow:0,debugNoteMetrics:!1,options:{left_bar:!1}})).stave||(t.stave=this.factory.Stave({x:this.options.x,y:this.options.y,width:this.options.width,options:t.options})),t.voices.forEach((e=>e.setContext(this.context).setStave(t.stave).getTickables().forEach((e=>e.setStave(t.stave))))),this.parts.push(t),t.stave}format(){const t=new it;this.formatter=t;let e=this.options.y,i=0,n=[];const s=[];this.parts.forEach((r=>{e+=r.stave.space(r.spaceAbove),r.stave.setY(e),t.joinVoices(r.voices),e+=r.stave.space(r.spaceBelow),e+=r.stave.space(this.options.spaceBetweenStaves),r.debugNoteMetrics&&(s.push({y:e,voice:r.voices[0]}),e+=15),n=n.concat(r.voices),i=Math.max(i,r.stave.getNoteStartX())})),this.parts.forEach((t=>t.stave.setNoteStartX(i)));const r=this.options.width-(i-this.options.x)-M.j.STAVEPADDING;t.format(n,r);for(let e=0;e{e.voice.getTickables().forEach((i=>M.j.plotMetrics(t,i,e.y)))}))}}var ue=i(8194);n.s.Flow=s.Z,n.s.Flow.Element=r.W,n.s.Flow.Fraction=o.i,n.s.Flow.Renderer=d,n.s.Flow.Formatter=it,n.s.Flow.Music=C,n.s.Flow.Glyph=p.r,n.s.Flow.Stave=yt,n.s.Flow.StaveNote=E.$,n.s.Flow.StaveModifier=nt,n.s.Flow.StaveTempo=at,n.s.Flow.Voice=v,n.s.Flow.Accidental=L,n.s.Flow.Beam=S,n.s.Flow.StaveTie=N,n.s.Flow.TabStave=St,n.s.Flow.TabNote=_t,n.s.Flow.Bend=Z,n.s.Flow.Vibrato=$,n.s.Flow.VibratoBracket=xt,n.s.Flow.Note=M.j,n.s.Flow.ModifierContext=Q,n.s.Flow.MultiMeasureRest=Pt,n.s.Flow.TickContext=Y,n.s.Flow.Articulation=j,n.s.Flow.Annotation=q,n.s.Flow.Barline=st,n.s.Flow.NoteHead=Et.i,n.s.Flow.StaveConnector=x,n.s.Flow.ClefNote=Tt,n.s.Flow.KeySignature=dt,n.s.Flow.KeySigNote=Ct,n.s.Flow.TimeSignature=pt,n.s.Flow.TimeSigNote=At,n.s.Flow.Stem=f.r,n.s.Flow.TabTie=k,n.s.Flow.Clef=ct,n.s.Flow.Dot=w.o,n.s.Flow.Modifier=P.Modifier,n.s.Flow.TabSlide=It,n.s.Flow.Tuplet=m,n.s.Flow.GraceNote=Lt,n.s.Flow.GraceTabNote=Rt,n.s.Flow.Tuning=Nt,n.s.Flow.KeyManager=class{constructor(t){this.music=new C,this.setKey(t)}setKey(t){return this.key=t,this.reset(),this}getKey(){return this.key}reset(){if(this.keyParts=this.music.getKeyParts(this.key),this.keyString=this.keyParts.root,this.keyParts.accidental&&(this.keyString+=this.keyParts.accidental),!C.scaleTypes[this.keyParts.type])throw new n.s.RERR("BadArguments",`Unsupported key type: ${this.key}`);this.scale=this.music.getScaleTones(this.music.getNoteValue(this.keyString),C.scaleTypes[this.keyParts.type]),this.scaleMap={},this.scaleMapByValue={},this.originalScaleMapByValue={};const t=C.root_indices[this.keyParts.root];for(let e=0;e{"use strict";i.d(e,{Modifier:()=>r});var n=i(4552),s=i(2088);class r extends s.W{static get CATEGORY(){return"none"}static get Position(){return{LEFT:1,RIGHT:2,ABOVE:3,BELOW:4}}static get PositionString(){return{above:r.Position.ABOVE,below:r.Position.BELOW,left:r.Position.LEFT,right:r.Position.RIGHT}}constructor(){super(),this.setAttribute("type","Modifier"),this.width=0,this.note=null,this.index=null,this.text_line=0,this.position=r.Position.LEFT,this.modifier_context=null,this.x_shift=0,this.y_shift=0,this.spacingFromNextModifier=0}getCategory(){return r.CATEGORY}getWidth(){return this.width}setWidth(t){return this.width=t,this}getNote(){return this.note}setNote(t){return this.note=t,this}getIndex(){return this.index}setIndex(t){return this.index=t,this}getModifierContext(){return this.modifier_context}setModifierContext(t){return this.modifier_context=t,this}getPosition(){return this.position}setPosition(t){return this.position="string"==typeof t?r.PositionString[t]:t,this}setTextLine(t){return this.text_line=t,this}setYShift(t){return this.y_shift=t,this}setSpacingFromNextModifier(t){this.spacingFromNextModifier=t}getSpacingFromNextModifier(){return this.spacingFromNextModifier}setXShift(t){this.x_shift=0,this.position===r.Position.LEFT?this.x_shift-=t:this.x_shift+=t}getXShift(){return this.x_shift}draw(){throw this.checkContext(),new n.s.RERR("MethodNotImplemented","draw() not implemented for this modifier.")}alignSubNotesWithNote(t,e){const i=e.getTickContext(),n=i.getExtraPx(),s=i.getX()-n.left-n.extraLeft+this.getSpacingFromNextModifier();t.forEach((t=>{const i=t.getTickContext();t.setStave(e.stave),i.setXOffset(s)}))}}},4699:(t,e,i)=>{"use strict";i.d(e,{j:()=>o});var n=i(4552),s=i(8179),r=i(6619);class o extends r.W{static get CATEGORY(){return"note"}static get STAVEPADDING(){return 12}static plotMetrics(t,e,i){const s=e.getMetrics(),r=e.getAbsoluteX()-s.modLeftPx-s.extraLeftPx,o=e.getAbsoluteX()-s.extraLeftPx,a=e.getAbsoluteX(),l=e.getAbsoluteX()+s.noteWidth,h=e.getAbsoluteX()+s.noteWidth+s.extraRightPx,u=e.getAbsoluteX()+s.noteWidth+s.extraRightPx+s.modRightPx,c=u+e.getFormatterMetrics().freedom.right,d=u-r;t.save(),t.setFont("Arial",8,""),t.fillText(Math.round(d)+"px",r+e.getXShift(),i);const p=i+7;function f(i,n,s,r=p){t.beginPath(),t.setStrokeStyle(s),t.setFillStyle(s),t.setLineWidth(3),t.moveTo(i+e.getXShift(),r),t.lineTo(n+e.getXShift(),r),t.stroke()}f(r,o,"red"),f(o,a,"#999"),f(a,l,"green"),f(l,h,"#999"),f(h,u,"red"),f(u,c,"#DD0"),f(r-e.getXShift(),r,"#BBB"),n.s.drawDot(t,a+e.getXShift(),p,"blue");const m=e.getFormatterMetrics();if(m.iterations>0){const n=m.space.deviation,s=n>=0?"+":"";t.setFillStyle("red"),t.fillText(s+Math.round(n),a+e.getXShift(),i-10)}t.restore()}constructor(t){if(super(),this.setAttribute("type","Note"),!t)throw new n.s.RuntimeError("BadArguments","Note must have valid initialization data to identify duration and type.");const e=s.Z.parseNoteStruct(t);if(!e)throw new n.s.RuntimeError("BadArguments",`Invalid note initialization object: ${JSON.stringify(t)}`);if(this.duration=e.duration,this.dots=e.dots,this.noteType=e.type,this.customTypes=e.customTypes,this.DYMusicScoreType=t.DYMusicScoreType,t.duration_override?this.setDuration(t.duration_override):this.setIntrinsicTicks(e.ticks),this.modifiers=[],this.glyph=s.Z.getGlyphProps(this.duration,this.noteType),this.customGlyphs=this.customTypes.map((t=>s.Z.getGlyphProps(this.duration,t))),this.positions&&("object"!=typeof this.positions||!this.positions.length))throw new n.s.RuntimeError("BadArguments","Note keys must be array type.");this.playNote=null,this.tickContext=null,this.modifierContext=null,this.ignore_ticks=!1,this.width=0,this.extraLeftPx=0,this.extraRightPx=0,this.x_shift=0,this.left_modPx=0,this.right_modPx=0,this.voice=null,this.preFormatted=!1,this.ys=[],t.align_center&&this.setCenterAlignment(t.align_center),this.stave=null,this.render_options={annotation_spacing:5,stave_padding:o.STAVEPADDING}}getPlayNote(){return this.playNote}setPlayNote(t){return this.playNote=t,this}isRest(){return!1}addStroke(t,e){return e.setNote(this),e.setIndex(t),this.modifiers.push(e),this.setPreFormatted(!1),this}getStave(){return this.stave}setStave(t){return this.stave=t,this.setYs([t.getYForLine(0)]),this.context=this.stave.context,this}getCategory(){return o.CATEGORY}setContext(t){return this.context=t,this}getExtraLeftPx(){return this.extraLeftPx}getExtraRightPx(){return this.extraRightPx}setExtraLeftPx(t){return this.extraLeftPx=t,this}setExtraRightPx(t){return this.extraRightPx=t,this}shouldIgnoreTicks(){return this.ignore_ticks}getLineNumber(){return 0}getLineForRest(){return 0}getGlyph(){return this.glyph}getGlyphWidth(){return this.glyph.getWidth?this.glyph.getWidth(this.render_options.glyph_font_scale):15}setYs(t){return this.ys=t,this}getYs(){if(0===this.ys.length)throw new n.s.RERR("NoYValues","No Y-values calculated for this note.");return this.ys}getYForTopText(t){if(!this.stave)throw new n.s.RERR("NoStave","No stave attached to this note.");return this.stave.getYForTopText(t)}getBoundingBox(){return null}getVoice(){if(!this.voice)throw new n.s.RERR("NoVoice","Note has no voice.");return this.voice}setVoice(t){return this.voice=t,this.preFormatted=!1,this}getTickContext(){return this.tickContext}setTickContext(t){return this.tickContext=t,this.preFormatted=!1,this}getDuration(){return this.duration}isDotted(){return this.dots>0}hasStem(){return!1}getDots(){return this.dots}getNoteType(){return this.noteType}setBeam(){return this}setModifierContext(t){return this.modifierContext=t,this}addModifier(t,e=0){return t.setNote(this),t.setIndex(e),this.modifiers.push(t),this.setPreFormatted(!1),this}getModifierStartXY(){if(!this.preFormatted)throw new n.s.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");return{x:this.getAbsoluteX(),y:this.ys[0]}}getMetrics(){if(!this.preFormatted)throw new n.s.RERR("UnformattedNote","Can't call getMetrics on an unformatted note.");let t=0,e=0;null!=this.modifierContext&&(t=this.modifierContext.state.left_shift,e=this.modifierContext.state.right_shift);const i=this.getWidth();return{width:i,noteWidth:i-t-e-this.extraLeftPx-this.extraRightPx,left_shift:this.x_shift,modLeftPx:t,modRightPx:e,extraLeftPx:this.extraLeftPx,extraRightPx:this.extraRightPx}}setWidth(t){this.width=t}getWidth(){if(!this.preFormatted)throw new n.s.RERR("UnformattedNote","Can't call GetWidth on an unformatted note.");return this.width+(this.modifierContext?this.modifierContext.getWidth():0)}setXShift(t){return this.x_shift=t,this}getXShift(){return this.x_shift}getX(){if(!this.tickContext)throw new n.s.RERR("NoTickContext","Note needs a TickContext assigned for an X-Value");return this.tickContext.getX()+this.x_shift}getAbsoluteX(){if(!this.tickContext)throw new n.s.RERR("NoTickContext","Note needs a TickContext assigned for an X-Value");let t=this.tickContext.getX();return this.stave&&(t+=this.stave.getNoteStartX()+this.render_options.stave_padding),this.isCenterAligned()&&("jianpu"===this.DYMusicScoreType||(t+=this.getCenterXShift())),t}setPreFormatted(t){if(this.preFormatted=t,this.preFormatted){const t=this.tickContext.getExtraPx();this.left_modPx=Math.max(this.left_modPx,t.left),this.right_modPx=Math.max(this.right_modPx,t.right)}}}},9723:(t,e,i)=>{"use strict";i.d(e,{i:()=>h});var n=i(4552),s=i(8179),r=i(4699),o=i(1140),a=i(8391),l=i(2306);class h extends r.j{static get CATEGORY(){return"notehead"}constructor(t){if(super(t),this.setAttribute("type","NoteHead"),this.index=t.index,this.x=t.x||0,this.y=t.y||0,this.note_type=t.note_type,this.duration=t.duration,this.displaced=t.displaced||!1,this.stem_direction=t.stem_direction||a.$.STEM_UP,this.line=t.line,this._line=t._line,this.glyph=s.Z.getGlyphProps(this.duration,this.note_type),!this.glyph)throw new n.s.RuntimeError("BadArguments",`No glyph found for duration '${this.duration}' and type '${this.note_type}'`);this.glyph_code=this.glyph.code_head,this.x_shift=t.x_shift||0,t.custom_glyph_code&&(this.custom_glyph=!0,this.glyph_code=t.custom_glyph_code,this.stem_up_x_offset=t.stem_up_x_offset||0,this.stem_down_x_offset=t.stem_down_x_offset||0),this.style=t.style,this.slashed=t.slashed,n.s.Merge(this.render_options,{glyph_font_scale:t.glyph_font_scale||s.Z.DEFAULT_NOTATION_FONT_SCALE,stroke_px:3}),this.setWidth(this.glyph.getWidth(this.render_options.glyph_font_scale))}getCategory(){return h.CATEGORY}getWidth(){return this.width}isDisplaced(){return!0===this.displaced}getGlyph(){return this.glyph}setX(t){return this.x=t,this}getY(){return this.y}setY(t){return this.y=t,this}getLine(){return this.line}setLine(t){return this.line=t,this}getAbsoluteX(){const t=this.preFormatted?super.getAbsoluteX():this.x,e=o.r.WIDTH/2;return t+(this.displaced?(this.width-e)*this.stem_direction:0)}getBoundingBox(){if(!this.preFormatted)throw new n.s.RERR("UnformattedNote","Can't call getBoundingBox on an unformatted note.");const t=this.stave.getSpacingBetweenLines(),e=t/2,i=this.y-e;return new s.Z.BoundingBox(this.getAbsoluteX(),i,this.width,t)}setStave(t){const e=this.getLine();return this.stave=t,this.setY(t.getYForNote(e)),this.context=this.stave.context,this}preFormat(){if(this.preFormatted)return this;const t=this.getWidth()+this.extraLeftPx+this.extraRightPx;return this.setWidth(t),this.setPreFormatted(!0),this}draw(){this.checkContext(),this.setRendered();const t=this.context;let e=this.getAbsoluteX();this.custom_glyph&&(e+=this.stem_direction===o.r.UP?this.stem_up_x_offset:this.stem_down_x_offset);const i=this.y;!function(...t){h.DEBUG&&n.s.L("Vex.Flow.NoteHead",t)}("Drawing note head '",this.note_type,this.duration,"' at",e,i);const r=this.stem_direction,a=this.render_options.glyph_font_scale;if(this.style&&this.applyStyle(t),"s"===this.note_type){const n=this.stave.getSpacingBetweenLines();!function(t,e,i,n,r,o){const a=s.Z.SLASH_NOTEHEAD_WIDTH;t.save(),t.setLineWidth(s.Z.STEM_WIDTH);let l=!1;if(s.Z.durationToNumber(e)>2&&(l=!0),l||(i-=s.Z.STEM_WIDTH/2*r),t.beginPath(),t.moveTo(i,n+o),t.lineTo(i,n+1),t.lineTo(i+a,n-o),t.lineTo(i+a,n),t.lineTo(i,n+o),t.closePath(),l?t.fill():t.stroke(),s.Z.durationToFraction(e).equals(.5)){const e=[-3,-1,a+1,a+3];for(let s=0;s{"use strict";i.r(e),i.d(e,{NumberedNote:()=>f});var n=i(4552),s=i(8391),r=i(8179),o=i(4184),a=i(2306);let l=null,h="C",u={notes:[],finish:!1,total:0,staveId:""},c="",d="",p="";class f extends s.${static get CATEGORY(){return"numberednotes"}static accidentalAndKey(t){switch(t){case"G":return{4:"#"};case"D":return{1:"#",4:"#"};case"A":return{1:"#",4:"#",5:"#"};case"E":return{1:"#",2:"#",4:"#",5:"#"};case"B":return{1:"#",2:"#",4:"#",5:"#",6:"#"};case"F#":return{1:"#",2:"#",3:"#",4:"#",5:"#",6:"#"};case"C#":return{1:"#",2:"#",3:"#",4:"#",5:"#",6:"#",7:"#"};case"F":return{7:"b"};case"Bb":return{7:"b",3:"b"};case"Eb":return{7:"b",3:"b",6:"b"};case"Ab":return{7:"b",2:"b",3:"b",6:"b"};case"Db":return{7:"b",2:"b",3:"b",5:"b",6:"b"};case"Gb":return{7:"b",1:"b",2:"b",3:"b",5:"b",6:"b"};case"Cb":return{7:"b",1:"b",2:"b",3:"b",4:"b",5:"b",6:"b"};default:return{}}}static accidentalMap(t){switch(t){case"C":return"";case"F":case"Bb":case"Eb":case"Ab":case"Db":case"Gb":case"Cb":return{bb:"b",b:"",n:"#","#":"##"};default:return{b:"bb",n:"b","#":"","##":"#"}}}static get noteLift(){switch(h){case"G":return["7"];case"D":return["7","3"];case"A":return["7","3","6"];case"E":return["2","6","3","7"];case"B":return["5","2","6","3","7"];case"F#":return["1","5","2","6","3","7"];case"C#":return["4","1","5","2","6","3","7"];case"F":return["4"];case"Bb":return["1","4"];case"Eb":return["5","1","4"];case"Ab":return["2","5","1","4"];case"Db":return["6","2","5","1","4"];case"Gb":return["3","6","2","5","1","4"];case"Cb":return["7","3","6","2","5","1","4"]}}static get longDurationLine(){return{1:3,2:1,6:2}}static get numberedDurationLine(){return{8:1,16:2,32:3,64:4,128:5}}static get durationTime(){return{8:6144,4:4096}}constructor(t){super(t),this.setAttribute("type","NumberedNote"),h=t.keyString,this.ornament=!!t.ornament,this.line=0,this.keys=t.keys||[],this.fontSize=20,this.offset_x=0,this.offset_y=0,this.note_tones=[],this.duration_lines=0,this.long_duration_lines=0,this.note_size=t.note_size||16;const e=r.Z.sanitizeDuration(this.duration);var i=f.numberedDurationLine[e.toString()];if(i&&(this.duration_lines=i),(i=f.longDurationLine[e.toString()])&&(this.long_duration_lines=i),!l){var n="__$text_wraper$$__";let t=document.createElement("canvas");t.id=n,document.body.append(t);const e=document.getElementById(n),i=e.getContext("2d");i.font="Arial 22px";var s=i.measureText("5");l=s.width+2,document.body.removeChild(e)}}getCategory(){return f.CATEGORY}setKeySignature(t){this.keySignature=t}preFormat(){this.preFormatted||(this.modifierContext&&this.modifierContext.preFormat(),this.setWidth(this.full_width),this.setPreFormatted(!0))}filterNote(){if(window&&window.sett&&window.sett.keySignature)return;if(!this.keys||!this.keys.length)return;const t=f.accidentalMap(h);if(!t)return;const e=f.noteLift;if(!e)return;var i=this.keys[0].split("/")[0];"b"===i&&(i="R"),(i=(i=i.replace(new RegExp("#","g"),"")).replace(new RegExp("n","g"),"")).length>1&&(i=i.replace(new RegExp("b","g"),""));const n=m.numberedNotationMapping[i.toUpperCase()];if(e.includes(n))for(let e=0;e{let s=!1;switch(i.getAttribute("type")){case"Accidental":i.render_options.font_scale=1.4*this.note_width,i.x_shift=2,i.y_shift=this.unit_height/2,s=!0,this.ornament&&(i.render_options.font_scale=this.note_width,i.x_shift=14,i.y_shift=-10);break;case"Stroke":i.x_shift=-1*t,i.y_shift=1*this.unit_height,s=!0;break;case"Dot":i.x_shift=e*this.duration_dot_width+7,i.y_shift=1*this.unit_height,e++;break;case"Ornament":i.y_shift=-3;break;default:i.y_shift=1*this.unit_height}i.reset&&i.reset(),t+=i.getWidth()/2}))}handleDeleteDot(){for(let t=0;tt)),i=e.length?e[0]/e[1]:0;if(this.ornament)return;if(0===i)return this.long_duration_lines=this.intrinsicTicks/t-1,this.long_duration_lines>=d&&(this.long_duration_lines=d-1),8==c&&(this.long_duration_lines=0,3==d&&this.draw_dot(this.context,this.bottom_x+25,this.bottom_y-30,this.dot_width),6==d)&&(this.draw_dot(this.context,this.bottom_x+25,this.bottom_y-30,this.dot_width),new a.r("v0",40).render(this.context,this.bottom_x+40,this.top_y),this.draw_dot(this.context,this.bottom_x+65,this.bottom_y-30,this.dot_width)),u={notes:[],finish:!1,total:0,staveId:""};let n={lines:this.duration_lines,duration:i,id:this.attrs.id,x:this.x-this.duration_line_space/2-this.left_width,y:this.y,width:this.full_width};i>2*t&&(this.long_duration_lines=parseInt(i/t)-1,this.handleDeleteDot()),p&&(n.x+=this.note_width),u.notes.push(n);let s=u.notes.reduce(((t,e)=>t+e.duration),0);if(s=parseInt(s),s>t&&(s-=t),s>t-10&&s0===t.lines));t.length&&(this.drawDurationLoneLine(),u={notes:[],finish:!1,total:0,staveId:""})}}draw(){if(this.checkContext(),!this.stave)throw new n.s.RERR("NoStave","Can't draw without a stave.");let t=this.context;t.save(),t.setFont("Arial",this.note_height,"normal"),this.setAttribute("el",t.openGroup("stavenote",this.getAttribute("id"))),t.openGroup("note",null,{pointerBBox:!0});let e=this.getAbsoluteX()+2.5;this.x=e;let i=this.stave.getYForLine(2)+this.note_height/2;this.y=i,this.buildToneHeads(),this.preFormatModifier(),this.applyStyle(),this.note_tones.forEach((e=>{e.draw(t)})),t.openGroup("modifier",null,{pointerBBox:!0}),this.drawModifiers(),t.closeGroup(),t.closeGroup(),t.closeGroup(),this.calcGroup(),u.staveId=this.stave.attrs.id,this.drawDurationLine(t,{}),this.drawLongDurationLines(t),this.restoreStyle(),this.setRendered(),p=this.ornament?p?Object.assign(p,{lines:this.duration_lines,id:this.attrs.id,x:this.x-this.duration_line_space/2-this.left_width,width:this.full_width}):{lines:this.duration_lines,id:this.attrs.id,x:this.x-this.duration_line_space/2-this.left_width,width:this.full_width}:""}drawDurationLoneLine(t,e){t=t||this.context;let i=e||this.y+this.duration_line_space;for(let e=0;e<5;e++){let n=[],s=0;for(let r=0;re)n.push(o),s++;else{if(n.length>1){let s=n.length-1;i=n[0].y+this.duration_line_space,t.rect(n[0].x,i+3*e,n[s].x-n[0].x+n[s].width,.5)}n=[],s=r+1}}if(n.length>1){let s=n.length-1;i=n[0].y+this.duration_line_space,t.rect(n[0].x,i+3*e,n[s].x-n[0].x+n[s].width,.5)}}}draw_dot(t,e,i,n){t.openGroup("numbered-note-dot"),t.beginPath(),t.arc(e,i,n,0,2*Math.PI),t.closePath(),t.fill(),t.closeGroup()}drawDurationLine(t,e){var i,n,s=this.attrs.id+"-lines";if(t.openGroup("numbered_note_lines",s),this.duration_lines>0){const s=this.duration_line_space;var r=this.full_width;if(e&&e.width&&(r=e.width),r<0&&(r=this.note_width),i=e&&void 0!==e.startX?e.startX:this.x-s/2-this.left_width,n=e&&void 0!==e.startY?e.startY:this.y+this.duration_line_space,u.finish&&(this.drawDurationLoneLine(t,n),u={notes:[],finish:!1,total:0,staveId:""}),this.ornament?(i+=12,n-=22,r=15,p&&(i-=10,r+=10)):p&&(i+=this.note_width,r-=this.note_width),r>0){for(var o=0;o"Accidental"===t.getAttribute("type"))),this.modifiers.findIndex((t=>"Accidental"===t.getAttribute("type"))));t&&e>-1?this.modifiers[e].accidental.code="#"===t?"v18":"v44":this.modifiers.splice(e,1)}}catch(t){console.log("🚀 ~ error",t)}}this.setYs(t)}getFullWidth(){return this.full_width}getFullHeight(){return this.full_height}getLine(){return this.keyProps[0].line}get full_width(){return this.note_width+this.left_width+this.right_width+this.long_duration_line_width}get long_duration_line_width(){return(this.long_duration_width+this.long_duration_space)*this.long_duration_lines}get full_height(){return this.bottom_y-this.top_y}get note_width(){return this.note_size||0}get note_dot_width(){return 6}get note_height(){return this.unit_height}get unit_height(){return this.note_size||0}get note_x(){return this.x||0}get top_x(){return this.x||0}get top_y(){var t=this;return(this.y||0)-(t.note_tones.map((e=>(e.td+e.bd)*(t.dot_space+t.dot_width))).reduce(((t,e)=>t+e),0)+this.note_height*this.note_tones.length-this.unit_height-this.note_tones[0].bd*(t.dot_space+t.dot_width)+(this.note_tones.length-1)*this.head_space)}get bottom_x(){return this.x||0}get bottom_y(){return(this.y||0)+this.unit_height+this.duration_lines*(this.duration_line_height+this.duration_line_space)+this.note_tones[0].meta.bd*(this.dot_width+this.dot_space)}get left_width(){return this.modifiers_width}get right_width(){return this.full_duration_dot_width}get duration_dot_width(){return 6}get full_duration_dot_width(){return this.duration_dot_width*this.getModifiersByCategory(o.o.CATEGORY).length}getModifiersByCategory(t){var e=[];return this.modifiers.forEach((i=>{i.getCategory()===t&&e.push(i)})),e}get head_space(){return 6}get duration_line_height(){return 2}get duration_line_space(){return 4}get dot_width(){return 2}get dot_space(){return 2}get long_duration_space(){return 10}get long_duration_width(){return 20}getWidth(){return this.full_width}get modifiers_width(){let t=0;return this.modifiers.forEach((e=>{t+=e.getWidth()})),t}}class m{static get numberedNotationMapping(){let t=h;switch(window&&window.sett&&window.sett.keySignature&&(t="C"),t){case"A":return{C:"3",D:"4",E:"5",F:"6",G:"7",A:"1",B:"2",R:"0",min:2.5,max:5.5};case"B":case"Bb":case"A#":return{C:"2",D:"3",E:"4",F:"5",G:"6",A:"7",B:"1",R:"0",min:-.5,max:2.5};case"D":case"D#":case"Db":return{C:"7",D:"1",E:"2",F:"3",G:"4",A:"5",B:"6",R:"0",min:.5,max:3.5};case"E":case"Eb":return{C:"6",D:"7",E:"1",F:"2",G:"3",A:"4",B:"5",R:"0",min:1,max:4};case"F":case"F#":return{C:"5",D:"6",E:"7",F:"1",G:"2",A:"3",B:"4",R:"0",min:1.5,max:4.5};case"G":case"Gb":return{C:"4",D:"5",E:"6",F:"7",G:"1",A:"2",B:"3",R:"0",min:2,max:5};case"Ab":case"G#":return{C:"3",D:"4",E:"5",F:"6",G:"7",A:"1",B:"2",R:"0",min:-1,max:2};default:return{C:"1",D:"2",E:"3",F:"4",G:"5",A:"6",B:"7",R:"0",min:0,max:3}}}tone_to_numbered_key(){var t=this.key.split("/")[0];"b"===t&&(t="R"),(t=(t=t.replace(new RegExp("#","g"),"")).replace(new RegExp("n","g"),"")).length>1&&(t=t.replace(new RegExp("b","g"),""));let e=0,i=0;this.note.stave&&this.note.stave.options&&this.note.stave.options.keySignature&&(h=this.note.stave.options.keySignature);const n=this.note.getLine();return nm.numberedNotationMapping.max&&(i=Math.ceil((n-m.numberedNotationMapping.max)/3.5)),"R"===t.toUpperCase()&&(e=0,i=0),{key:m.numberedNotationMapping[t.toUpperCase()],td:i,bd:e}}constructor(t){this.key=t.key,this.x=t.x||0,this.y=t.y||0,this.idx=t.idx||0,this.note=t.note||0,this.meta=this.tone_to_numbered_key(),this.noteSize=t.noteSize||16,this.td=this.meta.td,this.bd=this.meta.bd}draw(t){let e=this.y;t.openGroup("numbered-note-head");var i=this.x+(this.note.ornament?-2:0);let n=e-this.note.unit_height-this.note.dot_space-(this.note.ornament?-4:2);for(let e=0;e1&&(t-=this.note.duration_line_space),e+=t}this.draw_dot(t,i+l,e,this.note.dot_width),e+=this.note.dot_width+this.note.dot_space}t.closeGroup()}get height(){return this.note.note_height+(this.meta.bd+this.meta.td)*(this.note.dot_width+this.note.dot_space)}draw_dot(t,e,i,n){t.openGroup("numbered-note-dot"),t.beginPath(),t.arc(e,i,n,0,2*Math.PI),t.closePath(),t.fill(),t.closeGroup()}}},8194:(t,e,i)=>{"use strict";i.d(e,{B:()=>r});const n=i(4552).s.MakeException("RegistryError");function s(t,e,i,n,s){t[e][i]||(t[e][i]={}),t[e][i][n]=s}class r{static get INDEXES(){return["type"]}constructor(){this.clear()}static enableDefaultRegistry(t){r.defaultRegistry=t}static getDefaultRegistry(){return r.defaultRegistry}static disableDefaultRegistry(){r.defaultRegistry=null}clear(){return this.index={id:{},type:{},class:{}},this}updateIndex({id:t,name:e,value:i,oldValue:n}){const r=this.getElementById(t);null!==n&&this.index[e][n]&&delete this.index[e][n][t],null!==i&&s(this.index,e,i,r.getAttribute("id"),r)}register(t,e){if(!(e=e||t.getAttribute("id")))throw new n("Can't add element without `id` attribute to registry",t);return t.setAttribute("id",e),s(this.index,"id",e,e,t),r.INDEXES.forEach((i=>{this.updateIndex({id:e,name:i,value:t.getAttribute(i),oldValue:null})})),t.onRegister(this),this}getElementById(t){return this.index.id[t]?this.index.id[t][t]:null}getElementsByAttribute(t,e){const i=this.index[t];return i&&i[e]?Object.keys(i[e]).map((t=>i[e][t])):[]}getElementsByType(t){return this.getElementsByAttribute("type",t)}getElementsByClass(t){return this.getElementsByAttribute("class",t)}onUpdate({id:t,name:e,value:i,oldValue:n}){return function(t,e){return t.filter((t=>t===e)).length>0}(r.INDEXES.concat(["id","class"]),e)?(this.updateIndex({id:t,name:e,value:i,oldValue:n}),this):this}}r.defaultRegistry=null},8391:(t,e,i)=>{"use strict";i.d(e,{$:()=>d});var n=i(4552),s=i(8179),r=i(4658),o=i(1140),a=i(9723),l=i(2945),h=i(3493),u=i(4184);function c(t,e,i){const n=(e.isrest?0:1)*i;t.line+=n,t.maxLine+=n,t.minLine+=n,t.note.setKeyLine(0,t.note.getKeyLine(0)+n)}class d extends l.Y{static get CATEGORY(){return"stavenotes"}static get STEM_UP(){return o.r.UP}static get STEM_DOWN(){return o.r.DOWN}static get DEFAULT_LEDGER_LINE_OFFSET(){return 3}static renderVibrato(t,e,i,n){let{width:s,height:r,wave_width:o,wave_girth:a,wave_height:l,stem_direction:h}=n;const u=Math.floor(s/o);let c=r/(u/2)*h;0==c&&(h=1,c=.3),t.beginPath(),t.moveTo(e,i+a);for(let n=0;n2?i[1]:null;let l=r>2?i[2]:i[1];2===r&&-1===o.stemDirection&&1===l.stemDirection&&(o=i[1],l=i[0]);const h=Math.max(o.voice_shift,l.voice_shift);let d,p=0;if(2===r){const t=o.stemDirection===l.stemDirection?0:.5;if(o.stemDirection===l.stemDirection&&o.minLine<=l.maxLine&&(o.isrest||(d=Math.abs(o.line-(l.maxLine+.5)),d=Math.max(d,o.stemMin),o.minLine=o.line-d,o.note.setStemLength(10*d))),o.minLine<=l.maxLine+t)if(o.isrest)c(o,l,1);else if(l.isrest)c(l,o,-1);else{p=h;const t=Math.abs(o.line-l.line);let e=0,i=0;"h"===o.note.duration?e++:"w"===o.note.duration&&i++,"h"===l.note.duration?e++:"w"===l.note.duration&&i++;let n=1===e||1===i||o.note.dots!==l.note.dots;if(s&&(n=n||2===i),0===t&&n){if(l.note.setXShift(p),o.note.dots>0){let t=0;for(const e of o.note.modifiers)if(e instanceof u.o&&(t++,e.setYShift(-10*(l.maxLine-o.line+1)),t===o.note.dots))break}}else t<1&&t>0?l.note.setXShift(p):o.note.voice!==l.note.voice&&o.stemDirection===l.stemDirection&&(o.line>l.line?1===o.stemDirection?l.note.renderFlag=!1:o.note.renderFlag=!1:l.line>o.line?1===l.stemDirection?o.note.renderFlag=!1:l.note.renderFlag=!1:1===l.stemDirection&&(l.stemDirection=-1,l.note.setStemDirection(-1)))}return!0}return null!==a&&a.minLinet.postFormat())),!0)}constructor(t){if(super(t),this.setAttribute("type","StaveNote"),this.keys=t.keys,this.clef=t.clef,this.octave_shift=t.octave_shift,this.beam=null,this.vibrato=null,this.slideNote=null,this.glyph=s.Z.getGlyphProps(this.duration,this.noteType),!this.glyph)throw new n.s.RuntimeError("BadArguments",`Invalid note initialization data (No glyph found): ${JSON.stringify(t)}`);if(this.displaced=!1,this.dot_shiftY=0,this.addDotsCount=0,this.keyProps=[],this.use_default_head_x=!1,this.note_heads=[],this.modifiers=[],n.s.Merge(this.render_options,{glyph_font_scale:t.glyph_font_scale||s.Z.DEFAULT_NOTATION_FONT_SCALE,stroke_px:t.stroke_px||d.DEFAULT_LEDGER_LINE_OFFSET}),this.calculateKeyProps(),this.buildStem(),t.auto_stem)this.autoStem();else{const e=window.DYMusicalOrientation,i=void 0!==e?e:t.stem_direction;this.setStemDirection(i)}this.reset(),this.buildFlag()}reset(){super.reset();const t=this.note_heads.map((t=>t.getStyle()));this.buildNoteHeads(),this.note_heads.forEach(((e,i)=>e.setStyle(t[i]))),this.stave&&this.note_heads.forEach((t=>t.setStave(this.stave))),this.calcExtraPx()}setBeam(t){return this.beam=t,this.calcExtraPx(),this}setVibrato(t){this.vibrato=t}setSlideNote(t){this.slideNote=t}getCategory(){return d.CATEGORY}buildStem(){this.setStem(new o.r({hide:!!this.isRest()})),this.stem.id=n.s.Prefix(`${this.getAttribute("id")}-stem`)}buildNoteHeads(){this.note_heads=[];const t=this.getStemDirection(),e=this.getKeys();let i,n,s,r=null,l=null,h=!1;t===o.r.UP?(i=0,n=e.length,s=1):t===o.r.DOWN&&(i=e.length-1,n=-1,s=-1);for(let e=i;e!==n;e+=s){const i=this.keyProps[e],n=i.line;null===r?r=n:(l=Math.abs(r-n),0===l||.5===l?h=!h:(h=!1,this.use_default_head_x=!0)),r=n;const s=new a.i({duration:this.duration,note_type:this.noteType,displaced:h,stem_direction:t,custom_glyph_code:i.code,glyph_font_scale:this.render_options.glyph_font_scale,x_shift:i.shift_right,stem_up_x_offset:i.stem_up_x_offset,stem_down_x_offset:i.stem_down_x_offset,line:i.line});this.note_heads[e]=s}}autoStem(){this.minLine=this.keyProps[0].line,this.maxLine=this.keyProps[this.keyProps.length-1].line;const t=(this.minLine+this.maxLine)/2<3?o.r.UP:o.r.DOWN;this.setStemDirection(t)}calculateKeyProps(){let t=null;for(let e=0;e0&&(this.keyProps[e-1].displaced=!0)),t=a,this.keyProps.push(o)}t=-1/0,this.keyProps.forEach((e=>{e.linet.line-e.line))}getBoundingBox(){if(!this.preFormatted)throw new n.s.RERR("UnformattedNote","Can't call getBoundingBox on an unformatted note.");const{width:t,modLeftPx:e,extraLeftPx:i}=this.getMetrics(),o=this.getAbsoluteX()-e-i;let a=0,l=0;const h=this.getStave().getSpacingBetweenLines()/2,u=2*h;if(this.isRest()){const t=this.ys[0],e=s.Z.durationToFraction(this.duration);e.equals(1)||e.equals(2)?(a=t-h,l=t+h):(a=t-this.glyph.line_above*u,l=t+this.glyph.line_below*u)}else if(this.glyph.stem){const t=this.getStemExtents();t.baseY+=h*this.stem_direction,a=Math.min(t.topY,t.baseY),l=Math.max(t.topY,t.baseY)}else{a=null,l=null;for(let t=0;te&&(e=n):n1}hasStem(){return this.glyph.stem}hasFlag(){return super.hasFlag()&&!this.isRest()&&this.renderFlag}getStemX(){return"r"===this.noteType?this.getCenterGlyphX():super.getStemX()+(this,o.r.WIDTH/(2*-this.getStemDirection()))}getYForTopText(t){const e=this.getStemExtents();return Math.min(this.stave.getYForTopText(t),e.topY-this.render_options.annotation_spacing*(t+1))}getYForBottomText(t){const e=this.getStemExtents();return Math.max(this.stave.getYForTopText(t),e.baseY+this.render_options.annotation_spacing*t)}setStave(t){super.setStave(t);const e=this.note_heads.map((e=>(e.setStave(t),e.getY())));if(this.setYs(e),this.stem){const{y_top:t,y_bottom:e}=this.getNoteHeadBounds();this.stem.setYBounds(t,e)}return this}getKeys(){return this.keys}getKeyProps(){return this.keyProps}isDisplaced(){return this.displaced}setNoteDisplaced(t){return this.displaced=t,this}getTieRightX(){let t=this.getAbsoluteX();return t+=this.getGlyphWidth()+this.x_shift+this.extraRightPx,this.modifierContext&&(t+=this.modifierContext.getExtraRightPx()),t}getTieLeftX(){let t=this.getAbsoluteX();return t+=this.x_shift-this.extraLeftPx,t}getLineForRest(){let t=this.keyProps[0].line;if(this.keyProps.length>1){const e=this.keyProps[this.keyProps.length-1].line,i=Math.max(t,e),s=Math.min(t,e);t=n.s.MidLine(i,s)}return t}getModifierStartXY(t,e,i){if(i=i||{},!this.preFormatted)throw new n.s.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");if(0===this.ys.length)throw new n.s.RERR("NoYValues","No Y-Values calculated for this note.");const{ABOVE:s,BELOW:r,LEFT:a,RIGHT:l}=h.Modifier.Position;let u=0;return t===a?u=-2:t===l?(u=this.getGlyphWidth()+this.x_shift+2,this.stem_direction===o.r.UP&&this.hasFlag()&&(i.forceFlagRight||((t,e)=>e===(t.getStemDirection()===o.r.UP?t.keyProps.length-1:0))(this,e))&&(u+=this.flag.getMetrics().width)):t!==r&&t!==s||(u=this.getGlyphWidth()/2),{x:this.getAbsoluteX()+u,y:this.ys[e]}}setStyle(t){super.setStyle(t),this.note_heads.forEach((e=>e.setStyle(t))),this.stem&&this.stem.setStyle(t)}setStemStyle(t){this.stem&&this.getStem().setStyle(t)}getStemStyle(){return this.stem.getStyle()}setLedgerLineStyle(t){this.ledgerLineStyle=t}getLedgerLineStyle(){return this.ledgerLineStyle}setFlagStyle(t){this.flagStyle=t}getFlagStyle(){return this.flagStyle}setKeyStyle(t,e){return this.note_heads[t].setStyle(e),this}setKeyLine(t,e){return this.keyProps[t].line=e,this.reset(),this}getKeyLine(t){return this.keyProps[t].line}addToModifierContext(t){this.setModifierContext(t);for(let t=0;t{const c=u.getLine(),d=u.getY();(null===t||de)&&(e=d),null===n&&u.isDisplaced()&&(n=u.getAbsoluteX()),null!==i||u.isDisplaced()||(i=u.getAbsoluteX()),s=c>s?c:s,r=c{let o;o=n&&e?g-i:e?m-i:f-i;const l=e&&n?a:r;s.beginPath(),s.moveTo(o,t),s.lineTo(o+l,t),s.stroke()},y={...t.getStyle()||{},...this.getLedgerLineStyle()||{}};this.applyStyle(s,y);for(let e=6;e<=l;++e){const i=null!==m&&e<=c,n=null!==f&&e<=u;b(t.getYForNote(e),i,n)}for(let e=0;e>=h;--e){const i=null!==m&&e>=p,n=null!==f&&e>=d;b(t.getYForNote(e),i,n)}this.restoreStyle(s,y)}drawVibrato(){if(this.vibrato){const t=this.context,e=this.vibrato.getNoteHeadEndX()+2;let{y_bottom:i}=this.vibrato.getNoteHeadBounds(),{y_top:n}=this.getNoteHeadBounds();const s=i6.5||t<-.5)&&(l+=t>6.5?10*(t-6.5):10*(t+.5))}i.openGroup("flag",null,{pointerBBox:!0}),this.applyStyle(i,this.getFlagStyle()||!1),this.flag.render(i,a,l),this.restoreStyle(i,this.getFlagStyle()||!1),i.closeGroup()}}drawNoteHeads(){this.note_heads.forEach((t=>{this.context.openGroup("notehead",null,{pointerBBox:!0});try{if(this.isRest()&&"w"===this.duration){const e=this.stave.options.line_config.filter((t=>t.visible)).length;4===this.keyProps[0].line&&e<5&&t.setY(t.getY()+10),1===e&&t.setLine(3)}}catch(t){}t.setContext(this.context).draw(),this.context.closeGroup()}))}drawStem(t){if(!this.context)throw new n.s.RERR("NoCanvasContext","Can't draw without a canvas context.");t&&this.setStem(new o.r(t)),this.stem.id=n.s.Prefix(`${this.getAttribute("id")}-stem`),this.stem&&(this.context.openGroup("stem",null,{pointerBBox:!0}),this.stem.setContext(this.context).draw(),this.context.closeGroup())}draw(){if(!this.context)throw new n.s.RERR("NoCanvasContext","Can't draw without a canvas context.");if(!this.stave)throw new n.s.RERR("NoStave","Can't draw without a stave.");if(0===this.ys.length)throw new n.s.RERR("NoYValues","Can't draw note without Y values.");const t=this.stave.getLines();if(2===t||3===t||4===t)for(let e=0;et.setX(e))),this.stem){let t=this.getStemX();const e=this.keyProps[0].line;(e>6.5||e<-.5)&&(this.beam||(this.stem.renderHeightAdjustment=e>6.5?10*(e-6.5):10*Math.abs(e+.5))),this.stem.setNoteHeadXBounds(t,t)}!function(...t){d.DEBUG&&n.s.L("Vex.Flow.StaveNote",t)}("Rendering ",this.isChord()?"chord :":"note :",this.keys),this.drawLedgerLines(),this.applyStyle(),this.setAttribute("el",this.context.openGroup("stavenote",this.getAttribute("id"))),this.context.openGroup("note",null,{pointerBBox:!0}),i&&this.drawStem(),this.drawNoteHeads(),this.drawFlag(),this.context.closeGroup(),this.drawModifiers(),this.context.closeGroup(),this.restoreStyle(),this.setRendered()}}},1140:(t,e,i)=>{"use strict";i.d(e,{r:()=>o});var n=i(4552),s=i(2088),r=i(8179);class o extends s.W{static get CATEGORY(){return"stem"}static get UP(){return 1}static get DOWN(){return-1}static get WIDTH(){return r.Z.STEM_WIDTH}static get HEIGHT(){return r.Z.STEM_HEIGHT}constructor(t={}){super(),this.setAttribute("type","Stem"),this.x_begin=t.x_begin||0,this.x_end=t.x_end||0,this.y_top=t.y_top||0,this.y_bottom=t.y_bottom||0,this.stem_extension=t.stem_extension||0,this.stem_direction=t.stem_direction||0,this.hide=t.hide||!1,this.isStemlet=t.isStemlet||!1,this.stemletHeight=t.stemletHeight||0,this.resetHeight=0,this.renderHeightAdjustment=0,this.setOptions(t)}setResetHeight(t){this.resetHeight=t}setOptions(t){this.stem_up_y_offset=t.stem_up_y_offset||0,this.stem_down_y_offset=t.stem_down_y_offset||0}setNoteHeadXBounds(t,e){return this.x_begin=t,this.x_end=e,this}setDirection(t){this.stem_direction=t}setExtension(t){this.stem_extension=t}getExtension(){return this.stem_extension}setYBounds(t,e){this.y_top=t,this.y_bottom=e}getCategory(){return o.CATEGORY}getHeight(){const t=this.stem_direction===o.UP?this.stem_up_y_offset:this.stem_down_y_offset;return(this.y_bottom-this.y_top)*this.stem_direction+(o.HEIGHT-t+this.stem_extension)*this.stem_direction}getBoundingBox(){throw new n.s.RERR("NotImplemented","getBoundingBox() not implemented.")}getExtents(){const t=this.stem_direction===o.UP,e=[this.y_top,this.y_bottom],i=o.HEIGHT+this.stem_extension,n=(t?Math.min:Math.max)(...e),s=(t?Math.max:Math.min)(...e);return{topY:n+i*-this.stem_direction+this.resetHeight*-this.stem_direction,baseY:s}}setVisibility(t){return this.hide=!t,this}setStemlet(t,e){return this.isStemlet=t,this.stemletHeight=e,this}draw(){if(this.setRendered(),this.hide)return;const t=this.checkContext();let e,i;const s=this.stem_direction;s===o.DOWN?(e=this.x_begin,i=this.y_top+this.stem_down_y_offset):(e=this.x_end,i=this.y_bottom-this.stem_up_y_offset);const r=this.getHeight();!function(...t){o.DEBUG&&n.s.L("Vex.Flow.Stem",t)}("Rendering stem - ","Top Y: ",this.y_top,"Bottom Y: ",this.y_bottom);const a=this.isStemlet?r-this.stemletHeight*this.stem_direction:0;if(t.save(),this.applyStyle(t),t.beginPath(),t.setLineWidth(o.WIDTH),t.moveTo(e,i-a),t.lineTo(e,i-r-this.renderHeightAdjustment*s-this.resetHeight*s),t.svg){const e={class:n.s.Prefix("stem")};this.id&&(e.id=this.id),t.stroke(e)}else t.stroke();this.restoreStyle(t),t.restore()}}},2945:(t,e,i)=>{"use strict";i.d(e,{Y:()=>l});var n=i(4552),s=i(8179),r=i(1140),o=i(2306),a=i(4699);class l extends a.j{constructor(t){super(t),this.setAttribute("type","StemmableNote"),this.stem=null,this.stemExtensionOverride=null,this.beam=null,this.renderFlag=!0}getStem(){return this.stem}setStem(t){return this.stem=t,this}buildStem(){const t=new r.r;return this.setStem(t),this}buildFlag(){const{glyph:t,beam:e}=this,i=null===e&&this.renderFlag;if(t&&t.flag&&i){const e=this.getStemDirection()===r.r.DOWN?t.code_flag_downstem:t.code_flag_upstem;this.flag=new o.r(e,this.render_options.glyph_font_scale)}}getTopGlyph(){return this.getStemDirection()===r.r.DOWN?this.customGlyphs[this.customGlyphs.length-1]:this.customGlyphs[0]}getStemLength(){return r.r.HEIGHT+this.getStemExtension()}getBeamCount(){const t=this.getGlyph();return t?t.beam_count:0}getStemMinumumLength(){let t=s.Z.durationToFraction(this.duration).value()<=1?0:20;switch(this.duration){case"8":null==this.beam&&(t=35);break;case"16":t=null==this.beam?35:25;break;case"32":t=null==this.beam?45:35;break;case"64":t=null==this.beam?50:40;break;case"128":t=null==this.beam?55:45}return t}getStemDirection(){return this.stem_direction}setStemDirection(t){if(t||(t=r.r.UP),t!==r.r.UP&&t!==r.r.DOWN)throw new n.s.RERR("BadArgument",`Invalid stem direction: ${t}`);if(this.stem_direction=t,this.stem){this.stem.setDirection(t),this.stem.setExtension(this.getStemExtension());const e=this.getTopGlyph()||this.getGlyph();this.stem.setOptions({stem_up_y_offset:e.stem_up_y_offset,stem_down_y_offset:e.stem_down_y_offset})}return this.reset(),this.flag&&this.renderFlag&&this.buildFlag(),this.beam=null,this.preFormatted&&this.preFormat(),this}getStemX(){const t=this.getAbsoluteX()+this.x_shift,e=this.getAbsoluteX()+this.x_shift+this.getGlyphWidth();return this.stem_direction===r.r.DOWN?t:e}getCenterGlyphX(){return this.getAbsoluteX()+this.x_shift+this.getGlyphWidth()/2}getStemExtension(){const t=this.getGlyph();return null!=this.stemExtensionOverride?this.stemExtensionOverride:t?1===this.getStemDirection()?t.stem_up_extension:t.stem_down_extension:0}setStemLength(t){return this.stemExtensionOverride=t-r.r.HEIGHT,this}getStemExtents(){return this.stem.getExtents()}setBeam(t){return this.beam=t,this}getYForTopText(t){const e=this.getStemExtents();return this.hasStem()?Math.min(this.stave.getYForTopText(t),e.topY-this.render_options.annotation_spacing*(t+1)):this.stave.getYForTopText(t)}getYForBottomText(t){const e=this.getStemExtents();return this.hasStem()?Math.max(this.stave.getYForTopText(t),e.baseY+this.render_options.annotation_spacing*t):this.stave.getYForBottomText(t)}hasFlag(){return this.renderFlag&&s.Z.getGlyphProps(this.duration).flag&&!this.beam}postFormat(){return this.beam&&this.beam.postFormat(),this.postFormatted=!0,this}drawStem(t){this.checkContext(),this.setRendered(),this.setStem(new r.r(t)),this.stem.setContext(this.context).draw()}}},8179:(t,e,i)=>{"use strict";i.d(e,{Z:()=>o});var n=i(4552),s=i(9515),r=i(2306);const o={STEM_WIDTH:1.5,STEM_HEIGHT:35,STAVE_LINE_THICKNESS:1,RESOLUTION:16384,DEFAULT_NOTATION_FONT_SCALE:39,DEFAULT_TABLATURE_FONT_SCALE:39,SLASH_NOTEHEAD_WIDTH:15,TEXT_HEIGHT_OFFSET_HACK:1,IsKerned:!0,clefProperties:t=>{if(!t)throw new n.s.RERR("BadArgument","Invalid clef: "+t);const e=o.clefProperties.values[t];if(!e)throw new n.s.RERR("BadArgument","Invalid clef: "+t);return e}};o.clefProperties.values={treble:{line_shift:0},bass:{line_shift:6},tenor:{line_shift:4},alto:{line_shift:3},soprano:{line_shift:1},percussion:{line_shift:0},"mezzo-soprano":{line_shift:2},"baritone-c":{line_shift:5},"baritone-f":{line_shift:5},subbass:{line_shift:7},french:{line_shift:-1}},o.keyProperties=(t,e,i)=>{void 0===e&&(e="treble");const s={octave_shift:0};"object"==typeof i&&n.s.Merge(s,i);const r=t.split("/");if(r.length<2)throw new n.s.RERR("BadArguments",`Key must have note + octave and an optional glyph: ${t}`);const a=r[0].toUpperCase(),l=o.keyProperties.note_values[a];if(!l)throw new n.s.RERR("BadArguments","Invalid key name: "+a);l.octave&&(r[1]=l.octave);let h=parseInt(r[1],10);h+=-1*s.octave_shift;let u=(7*h-28+l.index)/2;u+=o.clefProperties(e).line_shift;let c=0;u<=0&&2*u%2==0&&(c=1),u>=6&&2*u%2==0&&(c=-1);const d=void 0!==l.int_val?12*h+l.int_val:null,p=l.code,f=l.shift_right;let m={};if(r.length>2&&r[2]){const t=r[2].toUpperCase();m=o.keyProperties.customNoteHeads[t]||{}}return{key:a,octave:h,line:u,int_value:d,accidental:l.accidental,code:p,stroke:c,shift_right:f,displaced:!1,...m}},o.keyProperties.note_values={C:{index:0,int_val:0,accidental:null},CN:{index:0,int_val:0,accidental:"n"},"C#":{index:0,int_val:1,accidental:"#"},"C##":{index:0,int_val:2,accidental:"##"},CB:{index:0,int_val:-1,accidental:"b"},CBB:{index:0,int_val:-2,accidental:"bb"},D:{index:1,int_val:2,accidental:null},DN:{index:1,int_val:2,accidental:"n"},"D#":{index:1,int_val:3,accidental:"#"},"D##":{index:1,int_val:4,accidental:"##"},DB:{index:1,int_val:1,accidental:"b"},DBB:{index:1,int_val:0,accidental:"bb"},E:{index:2,int_val:4,accidental:null},EN:{index:2,int_val:4,accidental:"n"},"E#":{index:2,int_val:5,accidental:"#"},"E##":{index:2,int_val:6,accidental:"##"},EB:{index:2,int_val:3,accidental:"b"},EBB:{index:2,int_val:2,accidental:"bb"},F:{index:3,int_val:5,accidental:null},FN:{index:3,int_val:5,accidental:"n"},"F#":{index:3,int_val:6,accidental:"#"},"F##":{index:3,int_val:7,accidental:"##"},FB:{index:3,int_val:4,accidental:"b"},FBB:{index:3,int_val:3,accidental:"bb"},G:{index:4,int_val:7,accidental:null},GN:{index:4,int_val:7,accidental:"n"},"G#":{index:4,int_val:8,accidental:"#"},"G##":{index:4,int_val:9,accidental:"##"},GB:{index:4,int_val:6,accidental:"b"},GBB:{index:4,int_val:5,accidental:"bb"},A:{index:5,int_val:9,accidental:null},AN:{index:5,int_val:9,accidental:"n"},"A#":{index:5,int_val:10,accidental:"#"},"A##":{index:5,int_val:11,accidental:"##"},AB:{index:5,int_val:8,accidental:"b"},ABB:{index:5,int_val:7,accidental:"bb"},B:{index:6,int_val:11,accidental:null},BN:{index:6,int_val:11,accidental:"n"},"B#":{index:6,int_val:12,accidental:"#"},"B##":{index:6,int_val:13,accidental:"##"},BB:{index:6,int_val:10,accidental:"b"},BBB:{index:6,int_val:9,accidental:"bb"},R:{index:6,int_val:9,rest:!0},X:{index:6,accidental:"",octave:4,code:"v3e",shift_right:5.5}},o.keyProperties.customNoteHeads={D0:{code:"v27",shift_right:0,stem_up_x_offset:0,stem_down_x_offset:0,stem_up_y_offset:-1,stem_down_y_offset:0},D1:{code:"v2d",shift_right:-.5},D2:{code:"v22",shift_right:-.5},D3:{code:"v70",shift_right:-.5},T0:{code:"v49",shift_right:-2,stem_up_y_offset:-4,stem_down_y_offset:4},T1:{code:"v93",shift_right:.5,stem_up_y_offset:-4,stem_down_y_offset:4},T2:{code:"v40",shift_right:.5,stem_up_y_offset:-4,stem_down_y_offset:4},T3:{code:"v7d",shift_right:.5,stem_up_y_offset:-4,stem_down_y_offset:4},X0:{code:"v92",stem_up_x_offset:-2,stem_down_x_offset:0,stem_up_y_offset:4,stem_down_y_offset:4},X1:{code:"v95",shift_right:-.5,stem_up_y_offset:4,stem_down_y_offset:4},X2:{code:"v3e",shift_right:.5,stem_up_y_offset:4,stem_down_y_offset:4},X3:{code:"v3b",shift_right:0,stem_up_x_offset:-1.2,stem_down_x_offset:0,stem_up_y_offset:-1,stem_down_y_offset:2},S1:{code:"vd3",shift_right:0},S2:{code:"vd2",shift_right:0},R1:{code:"vd5",shift_right:0},R2:{code:"vd4",shift_right:0}},o.integerToNote=t=>{if(void 0===t)throw new n.s.RERR("BadArguments","Undefined integer for integerToNote");if(t<-2)throw new n.s.RERR("BadArguments",`integerToNote requires integer > -2: ${t}`);const e=o.integerToNote.table[t];if(!e)throw new n.s.RERR("BadArguments",`Unknown note value for integer: ${t}`);return e},o.integerToNote.table={0:"C",1:"C#",2:"D",3:"D#",4:"E",5:"F",6:"F#",7:"G",8:"G#",9:"A",10:"A#",11:"B"},o.tabToGlyph=(t,e=1)=>{let i=null,n=0,s=0;if("X"===t.toString().toUpperCase()){const t=new r.r("v7f",o.DEFAULT_TABLATURE_FONT_SCALE).getMetrics();i="v7f",n=t.width,s=-t.height/2}else n=o.textWidth(t.toString());return{text:t,code:i,getWidth:()=>n*e,shift_y:s}},o.textWidth=t=>7*t.toString().length,o.articulationCodes=t=>o.articulationCodes.articulations[t],o.articulationCodes.articulations={"a.":{code:"v23",between_lines:!0},av:{code:"v28",between_lines:!0},"a>":{code:"v42",between_lines:!0},"a-":{code:"v25",between_lines:!0},"a^":{code:"va",between_lines:!1},"a+":{code:"v8b",between_lines:!1},ao:{code:"v94",between_lines:!1},ah:{code:"vb9",between_lines:!1},"a@a":{code:"v43",between_lines:!1},"a@u":{code:"v5b",between_lines:!1},"a|":{code:"v75",between_lines:!1},am:{code:"v97",between_lines:!1},"a,":{code:"vb3",between_lines:!1}},o.accidentalCodes=t=>o.accidentalCodes.accidentals[t],o.accidentalCodes.accidentals={"#":{code:"v18",parenRightPaddingAdjustment:-1},"##":{code:"v7f",parenRightPaddingAdjustment:-1},b:{code:"v44",parenRightPaddingAdjustment:-2},bb:{code:"v26",parenRightPaddingAdjustment:-2},n:{code:"v4e",parenRightPaddingAdjustment:-1},"{":{code:"v9c",parenRightPaddingAdjustment:-1},"}":{code:"v84",parenRightPaddingAdjustment:-1},db:{code:"v9e",parenRightPaddingAdjustment:-1},d:{code:"vab",parenRightPaddingAdjustment:0},bbs:{code:"v90",parenRightPaddingAdjustment:-1},"++":{code:"v51",parenRightPaddingAdjustment:-1},"+":{code:"v78",parenRightPaddingAdjustment:-1},"+-":{code:"v8d",parenRightPaddingAdjustment:-1},"++-":{code:"v7a",parenRightPaddingAdjustment:-1},bs:{code:"vb7",parenRightPaddingAdjustment:-1},bss:{code:"v39",parenRightPaddingAdjustment:-1},o:{code:"vd0",parenRightPaddingAdjustment:-1},k:{code:"vd1",parenRightPaddingAdjustment:-1},ashs:{code:"vd6",parenRightPaddingAdjustment:-1},afhf:{code:"vd7",parenRightPaddingAdjustment:-1}},o.accidentalColumnsTable={1:{a:[1],b:[1]},2:{a:[1,2]},3:{a:[1,3,2],b:[1,2,1],second_on_bottom:[1,2,3]},4:{a:[1,3,4,2],b:[1,2,3,1],spaced_out_tetrachord:[1,2,1,2]},5:{a:[1,3,5,4,2],b:[1,2,4,3,1],spaced_out_pentachord:[1,2,3,2,1],very_spaced_out_pentachord:[1,2,1,2,1]},6:{a:[1,3,5,6,4,2],b:[1,2,4,5,3,1],spaced_out_hexachord:[1,3,2,1,3,2],very_spaced_out_hexachord:[1,2,1,2,1,2]}},o.ornamentCodes=t=>o.ornamentCodes.ornaments[t],o.ornamentCodes.ornaments={mordent:{code:"v1e"},mordent_inverted:{code:"v45"},turn:{code:"v72"},turn_inverted:{code:"v33"},tr:{code:"v1f"},upprall:{code:"v60"},downprall:{code:"vb4"},prallup:{code:"v6d"},pralldown:{code:"v2c"},upmordent:{code:"v29"},downmordent:{code:"v68"},lineprall:{code:"v20"},prallprall:{code:"v86"}},o.keySignature=t=>{const e=o.keySignature.keySpecs[t];if(!e)throw new n.s.RERR("BadKeySignature",`Bad key signature spec: '${t}'`);if(!e.acc)return[];const i=o.keySignature.accidentalList(e.acc),s=[];for(let t=0;t({b:[2,.5,2.5,1,3,1.5,3.5],"#":[0,1.5,-.5,1,2.5,.5,2]}[t]),o.parseNoteDurationString=t=>{if("string"!=typeof t)return null;const e=/(\d*\/?\d+|[a-z])(d*)([nrhms]|$)/.exec(t);if(!e)return null;const i=e[1],n=e[2].length;let s=e[3];return 0===s.length&&(s="n"),{duration:i,dots:n,type:s}},o.parseNoteStruct=t=>{const e=t.duration,i=o.parseNoteDurationString(e);if(!i)return null;let n=o.durationToTicks(i.duration);if(null==n)return null;let s=t.type;const r=[];if(s){if(!o.getGlyphProps.validTypes[s])return null}else s=i.type||"n",void 0!==t.keys&&t.keys.forEach(((t,e)=>{const i=t.split("/");i&&3===i.length&&(r[e]=i[2])}));const a=t.dots?t.dots:i.dots;if("number"!=typeof a)return null;let l=n;for(let t=0;t{const e=o.durationAliases[t];if(void 0!==e&&(t=e),void 0===o.durationToTicks.durations[t])throw new n.s.RERR("BadArguments",`The provided duration is not valid: ${t}`);return t},o.durationToFraction=t=>(new s.i).parse(o.sanitizeDuration(t)),o.durationToNumber=t=>o.durationToFraction(t).value(),o.durationToTicks=t=>{t=o.sanitizeDuration(t);const e=o.durationToTicks.durations[t];return void 0===e?null:e},o.durationToTicks.durations={"1/2":2*o.RESOLUTION,1:o.RESOLUTION/1,2:o.RESOLUTION/2,4:o.RESOLUTION/4,8:o.RESOLUTION/8,16:o.RESOLUTION/16,32:o.RESOLUTION/32,64:o.RESOLUTION/64,128:o.RESOLUTION/128,256:o.RESOLUTION/256},o.durationAliases={w:"1",h:"2",q:"4",b:"256"},o.getGlyphProps=(t,e)=>{t=o.sanitizeDuration(t);const i=o.getGlyphProps.duration_codes[t];if(void 0===i)return null;e||(e="n");let n=i.type[e];if(void 0===n){const t=o.keyProperties.customNoteHeads[e.toUpperCase()];if(void 0===t)return null;n={code_head:t.code,...t}}return{...i.common,...n}},o.getGlyphProps.validTypes={n:{name:"note"},r:{name:"rest"},h:{name:"harmonic"},m:{name:"muted"},s:{name:"slash"}},o.getGlyphProps.duration_codes={"1/2":{common:{getWidth(t=o.DEFAULT_NOTATION_FONT_SCALE){return new r.r(this.code_head||"v53",t).getMetrics().width},stem:!1,stem_offset:0,flag:!1,stem_up_extension:-o.STEM_HEIGHT,stem_down_extension:-o.STEM_HEIGHT,tabnote_stem_up_extension:-o.STEM_HEIGHT,tabnote_stem_down_extension:-o.STEM_HEIGHT,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"v53"},h:{code_head:"v59"},m:{code_head:"vf",stem_offset:0},r:{code_head:"v31",rest:!0,position:"B/5",dot_shiftY:.5},s:{getWidth:()=>o.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},1:{common:{getWidth(t=o.DEFAULT_NOTATION_FONT_SCALE){return new r.r(this.code_head||"v1d",t).getMetrics().width},stem:!1,stem_offset:0,flag:!1,stem_up_extension:-o.STEM_HEIGHT,stem_down_extension:-o.STEM_HEIGHT,tabnote_stem_up_extension:-o.STEM_HEIGHT,tabnote_stem_down_extension:-o.STEM_HEIGHT,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"v1d"},h:{code_head:"v46"},m:{code_head:"v92",stem_offset:-3},r:{code_head:"v5c",rest:!0,position:"D/5",dot_shiftY:.5},s:{getWidth:()=>o.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},2:{common:{getWidth(t=o.DEFAULT_NOTATION_FONT_SCALE){return new r.r(this.code_head||"v81",t).getMetrics().width},stem:!0,stem_offset:0,flag:!1,stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"v81"},h:{code_head:"v2d"},m:{code_head:"v95",stem_offset:-3},r:{code_head:"vc",stem:!1,rest:!0,position:"B/4",dot_shiftY:-.5},s:{getWidth:()=>o.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},4:{common:{getWidth(t=o.DEFAULT_NOTATION_FONT_SCALE){return new r.r(this.code_head||"vb",t).getMetrics().width},stem:!0,stem_offset:0,flag:!1,stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e",stem_offset:-3},r:{code_head:"v7c",stem:!1,rest:!0,position:"B/4",dot_shiftY:-.5,line_above:1.5,line_below:1.5},s:{getWidth:()=>o.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},8:{common:{getWidth(t=o.DEFAULT_NOTATION_FONT_SCALE){return new r.r(this.code_head||"vb",t).getMetrics().width},stem:!0,stem_offset:0,flag:!0,beam_count:1,code_flag_upstem:"v54",code_flag_downstem:"v9a",stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"va5",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-.5,line_above:1,line_below:1},s:{getWidth:()=>o.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},16:{common:{beam_count:2,getWidth(t=o.DEFAULT_NOTATION_FONT_SCALE){return new r.r(this.code_head||"vb",t).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"v3f",code_flag_downstem:"v8f",stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"v3c",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-.5,line_above:1,line_below:2},s:{getWidth:()=>o.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},32:{common:{beam_count:3,getWidth(t=o.DEFAULT_NOTATION_FONT_SCALE){return new r.r(this.code_head||"vb",t).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"v47",code_flag_downstem:"v2a",stem_up_extension:9,stem_down_extension:9,tabnote_stem_up_extension:8,tabnote_stem_down_extension:5,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"v55",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-1.5,line_above:2,line_below:2},s:{getWidth:()=>o.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},64:{common:{beam_count:4,getWidth(t=o.DEFAULT_NOTATION_FONT_SCALE){return new r.r(this.code_head||"vb",t).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"va9",code_flag_downstem:"v58",stem_up_extension:13,stem_down_extension:13,tabnote_stem_up_extension:12,tabnote_stem_down_extension:9,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"v38",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-1.5,line_above:2,line_below:3},s:{getWidth:()=>o.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},128:{common:{beam_count:5,getWidth(t=o.DEFAULT_NOTATION_FONT_SCALE){return new r.r(this.code_head||"vb",t).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"v9b",code_flag_downstem:"v30",stem_up_extension:22,stem_down_extension:22,tabnote_stem_up_extension:21,tabnote_stem_down_extension:18,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"vaa",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:1.5,line_above:3,line_below:3},s:{getWidth:()=>o.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}}},o.smufl={},o.smufl.to_code_points={bracketTop:"v1b",bracketBottom:"v10",barlineTick:"v6f",segno:"v8c",coda:"v4d",gClef:"v83",cClef:"vad",fClef:"v79",unpitchedPercussionClef1:"v59","6stringTabClef":"v2f",timeSig0:"v0",timeSig1:"v1",timeSig2:"v2",timeSig3:"v3",timeSig4:"v4",timeSig5:"v5",timeSig6:"v6",timeSig7:"v7",timeSig8:"v8",timeSig9:"v9",timeSigCommon:"v41",timeSigCutCommon:"vb6",noteheadDoubleWhole:"v53",noteheadWhole:"v1d",noteheadHalf:"v81",noteheadBlack:"vb",noteheadXWhole:"v92",noteheadXHalf:"v95",noteheadXBlack:"v3e",noteheadCircleX:"v3b",noteheadTriangleUpWhole:"v49",noteheadTriangleUpHalf:"v93",noteheadTriangleUpBlack:"v40",noteheadDiamondWhole:"v46",noteheadDiamondHalf:"v2d",noteheadDiamondBlack:"v22",augmentationDot:"v23",tremolo1:"v74",flag8thUp:"v54",flag8thDown:"v9a",flag16thUp:"v3f",flag16thDown:"v8f",flag32ndUp:"v47",flag32ndDown:"v2a",flag64thUp:"va9",flag64thDown:"v58",flag128thUp:"v9b",flag128thDown:"v30",accidentalFlat:"v44",accidentalNatural:"v4e",accidentalSharp:"v18",accidentalDoubleSharp:"v7f",accidentalDoubleFlat:"v26",accidentalParensLeft:"v9c",accidentalParensRight:"v84",accidentalQuarterToneFlatStein:"vab",accidentalThreeQuarterTonesFlatZimmermann:"v9e",accidentalQuarterToneSharpStein:"v78",accidentalThreeQuarterTonesSharpStein:"v51",accidentalBuyukMucennebFlat:"v39",accidentalBakiyeFlat:"vb7",accidentalKomaSharp:"v51",accidentalKucukMucennebSharp:"v8d",accidentalKoron:"vd1",accidentalSori:"vd0",articAccentAbove:"v42",articAccentBelow:"v42",articTenutoAbove:"v25",articTenutoBelow:"v25",articStaccatoAbove:"v23",articStaccatoBelow:"v23",articStaccatissimoAbove:"v28",articMarcatoAbove:"va",fermataAbove:"v43",fermataBelow:"v5b",breathMarkComma:"v6c",breathMarkUpbow:"v8a",caesura:"v34",caesuraCurved:"v4b",restMaxima:"v59",restDoubleWhole:"v31",restWhole:"v5c",restHalf:"vc",restQuarter:"v7c",rest8th:"va5",rest16th:"v3c",rest32nd:"v55",rest64th:"v38",rest128th:"vaa",dynamicPiano:"vbf",dynamicMezzo:"v62",dynamicForte:"vba",dynamicRinforzando:"vba",dynamicSforzando:"v4a",dynamicZ:"v80",ornamentTrill:"v1f",ornamentTurn:"v72",ornamentTurnSlash:"v33",ornamentMordent:"v45",ornamentMordentInverted:"v1e",ornamentTremblement:"v86",ornamentPrecompAppoggTrill:"v20",ornamentPrecompSlideTrillDAnglebert:"v60",ornamentPrecompSlideTrillBach:"v29",ornamentPrecompTrillSuffixDandrieu:"v6d",ornamentPrecompDoubleCadenceUpperPrefix:"vb4",ornamentPrecompDoubleCadenceUpperPrefixTurn:"v68",ornamentPrecompTrillLowerSuffix:"v2c",stringsDownBow:"v94",stringsUpBow:"v75",stringsHarmonic:"vb9",pluckedSnapPizzicatoAbove:"v94",pluckedLeftHandPizzicato:"v8b",keyboardPedalPed:"v36",keyboardPedalUp:"v5d",pictChokeCymbal:"vb3",wiggleArpeggiatoUp:"va3",arrowheadBlackUp:"vc3",arrowheadBlackDown:"v52"},o.TIME4_4={num_beats:4,beat_value:4,resolution:o.RESOLUTION}},6619:(t,e,i)=>{"use strict";i.d(e,{W:()=>a});var n=i(4552),s=i(2088),r=i(8179),o=i(9515);class a extends s.W{constructor(){super(),this.setAttribute("type","Tickable"),this.ticks=new o.i(0,1),this.intrinsicTicks=0,this.tickMultiplier=new o.i(1,1),this.width=0,this.x_shift=0,this.voice=null,this.tickContext=null,this.modifierContext=null,this.modifiers=[],this.preFormatted=!1,this.postFormatted=!1,this.tuplet=null,this.tupletStack=[],this.align_center=!1,this.center_x_shift=0,this.ignore_ticks=!1,this.formatterMetrics={freedom:{left:0,right:0},duration:"",iterations:0,space:{used:0,mean:0,deviation:0}}}reset(){return this}getTicks(){return this.ticks}shouldIgnoreTicks(){return this.ignore_ticks}getWidth(){return this.width}getFormatterMetrics(){return this.formatterMetrics}setXShift(t){this.x_shift=t}getCenterXShift(){return this.isCenterAligned()?this.center_x_shift:0}isCenterAligned(){return this.align_center}setCenterAlignment(t){return this.align_center=t,this}getVoice(){if(!this.voice)throw new n.s.RERR("NoVoice","Tickable has no voice.");return this.voice}setVoice(t){this.voice=t}getTuplet(){return this.tuplet}resetTuplet(t){let e,i;if(t){const n=this.tupletStack.indexOf(t);return-1!==n&&(this.tupletStack.splice(n,1),e=t.getNoteCount(),i=t.getNotesOccupied(),this.applyTickMultiplier(e,i)),this}for(;this.tupletStack.length;)e=(t=this.tupletStack.pop()).getNoteCount(),i=t.getNotesOccupied(),this.applyTickMultiplier(e,i);return this}setTuplet(t){if(t){this.tupletStack.push(t);const e=t.getNoteCount(),i=t.getNotesOccupied();this.applyTickMultiplier(i,e)}return this.tuplet=t,this}addToModifierContext(t){this.modifierContext=t,this.preFormatted=!1}addModifier(t){return this.modifiers.push(t),this.preFormatted=!1,this}getModifiers(){return this.modifiers}setTickContext(t){this.tickContext=t,this.preFormatted=!1}preFormat(){this.preFormatted||(this.width=0,this.modifierContext&&(this.modifierContext.preFormat(),this.width+=this.modifierContext.getWidth()))}postFormat(){return this.postFormatted||(this.postFormatted=!0),this}getIntrinsicTicks(){return this.intrinsicTicks}setIntrinsicTicks(t){this.intrinsicTicks=t,this.ticks=this.tickMultiplier.clone().multiply(this.intrinsicTicks)}getTickMultiplier(){return this.tickMultiplier}applyTickMultiplier(t,e){this.tickMultiplier.multiply(t,e),this.ticks=this.tickMultiplier.clone().multiply(this.intrinsicTicks)}setDuration(t){const e=t.numerator*(r.Z.RESOLUTION/t.denominator);this.ticks=this.tickMultiplier.clone().multiply(e),this.intrinsicTicks=this.ticks.value()}}},4552:(t,e,i)=>{"use strict";i.d(e,{s:()=>n});const n=()=>{};n.L=(t,e)=>{if(!e)return;const i=Array.prototype.slice.call(e).join(" ");window.console.log(t+": "+i)},n.MakeException=t=>class extends Error{constructor(e,i){super(e),this.name=t,this.message=e,this.data=i}},n.RuntimeError=class{constructor(t,e){this.code=t,this.message=e}toString(){return"[RuntimeError] "+this.code+":"+this.message}},n.RERR=n.RuntimeError,n.Merge=(t,e)=>{for(const i in e)t[i]=e[i];return t},n.Min=Math.min,n.Max=Math.max,n.forEach=(t,e)=>{for(let i=0;it%e>=e/2?parseInt(t/e,10)*e+e:parseInt(t/e,10)*e,n.MidLine=(t,e)=>{let i=e+(t-e)/2;return i%2>0&&(i=n.RoundN(10*i,5)/10),i},n.SortAndUnique=(t,e,i)=>{if(t.length>1){const n=[];let s;t.sort(e);for(let e=0;e{let i=t.length;for(;i--;)if(t[i]===e)return!0;return!1},n.getCanvasContext=t=>{if(!t)throw new n.RERR("BadArgument","Invalid canvas selector: "+t);const e=document.getElementById(t);if(!e||!e.getContext)throw new n.RERR("UnsupportedBrowserError","This browser does not support HTML5 Canvas");return e.getContext("2d")},n.drawDot=(t,e,i,n="#55")=>{t.save(),t.setFillStyle(n),t.beginPath(),t.arc(e,i,3,0,2*Math.PI,!0),t.closePath(),t.fill(),t.restore()},n.BM=(t,e)=>{const i=(new Date).getTime();e();const s=(new Date).getTime()-i;n.L(t+s+"ms")},n.StackTrace=()=>(new Error).stack,n.W=(...t)=>{const e=t.join(" ");window.console.log("Warning: ",e,n.StackTrace())},n.Prefix=t=>n.Prefix.prefix+t,n.Prefix.prefix="vf-"},3897:t=>{t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i{t.exports=function(t){if(Array.isArray(t))return t},t.exports.__esModule=!0,t.exports.default=t.exports},6690:t=>{t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},9728:(t,e,i)=>{var n=i(4062);function s(t,e){for(var i=0;i{t.exports=function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,s,r,o,a=[],l=!0,h=!1;try{if(r=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=r.call(i)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){h=!0,s=t}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw s}}return a}},t.exports.__esModule=!0,t.exports.default=t.exports},2218:t=>{t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},7424:(t,e,i)=>{var n=i(5372),s=i(8872),r=i(6116),o=i(2218);t.exports=function(t,e){return n(t)||s(t,e)||r(t,e)||o()},t.exports.__esModule=!0,t.exports.default=t.exports},5036:(t,e,i)=>{var n=i(8698).default;t.exports=function(t,e){if("object"!==n(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var s=i.call(t,e||"default");if("object"!==n(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},4062:(t,e,i)=>{var n=i(8698).default,s=i(5036);t.exports=function(t){var e=s(t,"string");return"symbol"===n(e)?e:String(e)},t.exports.__esModule=!0,t.exports.default=t.exports},8698:t=>{function e(i){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(i)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},6116:(t,e,i)=>{var n=i(3897);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(t,e):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports}},e={};function i(n){var s=e[n];if(void 0!==s)return s.exports;var r=e[n]={exports:{}};return t[n].call(r.exports,r,r.exports,i),r.exports}return i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i(3607)})()));