(function(){function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=_superPropBase(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},_get.apply(this,arguments)}function _wrapNativeSuper2(e){var t="function"==typeof Map?new Map:void 0;return _wrapNativeSuper2=function(e){if(null===e||!_isNativeFunction2(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return _construct2(e,arguments,_getPrototypeOf2(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf2(n,e)},_wrapNativeSuper2(e)}function _construct2(e,t,n){return _construct2=_isNativeReflectConstruct()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&_setPrototypeOf2(r,n.prototype),r},_construct2.apply(null,arguments)}function _isNativeFunction2(e){return-1!==Function.toString.call(e).indexOf("[native code]")}function _createForOfIteratorHelper(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function _inherits2(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf2(e,t)}function _setPrototypeOf2(e,t){return _setPrototypeOf2=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_setPrototypeOf2(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var n,i=_getPrototypeOf2(e);if(t){var r=_getPrototypeOf2(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return _possibleConstructorReturn2(this,n)}}function _possibleConstructorReturn2(e,t){if(t&&("object"===_typeof3(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized2(e)}function _assertThisInitialized2(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function set(e,t,n,i){return set="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(e,t,n,i){var r,a=_superPropBase(e,t);if(a){if((r=Object.getOwnPropertyDescriptor(a,t)).set)return r.set.call(i,n),!0;if(!r.writable)return!1}if(r=Object.getOwnPropertyDescriptor(i,t)){if(!r.writable)return!1;r.value=n,Object.defineProperty(i,t,r)}else _defineProperty2(i,t,n);return!0},set(e,t,n,i)}function _set(e,t,n,i,r){if(!set(e,t,n,i||e)&&r)throw new Error("failed to set property");return n}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf2(e)););return e}function _getPrototypeOf2(e){return _getPrototypeOf2=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf2(e)}function _classCallCheck2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);nimg{width:100%;height:100%;display:block}._flickerAnimate_11jg0_124{animation:_flicker_11jg0_124 1s cubic-bezier(.075,.82,.165,1) infinite}@keyframes _flicker_11jg0_124{0%{opacity:0}50%{opacity:1}to{opacity:0}}._box_a7vlt_1{position:relative;height:100vh;display:flex;align-items:center;justify-content:center;box-sizing:border-box}._bg_a7vlt_9{position:absolute;width:100%;height:100%;z-index:0;display:block}._button_a7vlt_16{position:absolute;top:.24rem;left:.45333rem;width:.61333rem;height:.61333rem;padding:0;border:none;background-color:transparent;font-size:0}._button_a7vlt_16 img{width:.61333rem;height:.61333rem;display:block;margin:auto}._iconSound_a7vlt_33{position:absolute;left:1.28rem;top:1.28rem;width:7.25333rem}._skepBtn_a7vlt_39{width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;margin-bottom:.42667rem;color:#fff}._skepBtn_a7vlt_39>img{display:block;width:100%;margin-bottom:4Px}._wrap_a7vlt_53{position:relative;width:4.90667rem;box-sizing:border-box;z-index:1}._wrapContainer_a7vlt_59{display:flex;flex-direction:column;align-items:center;padding-top:1.6rem}._top_a7vlt_65{position:relative;display:flex;align-items:center;width:100%;height:0}._top_a7vlt_65 ._title_a7vlt_72{position:absolute;left:50%;top:-.93333rem;font-size:.18667rem;color:#fff;font-weight:700;z-index:1;transform:translate(-60%)}._top_a7vlt_65 ._num_a7vlt_82{font-size:.48rem;color:#fff79e}._top_a7vlt_65 ._txt_a7vlt_86{font-size:.24rem}._top_a7vlt_65 ._iconLeft_a7vlt_89{width:.96rem;height:1.06667rem}._top_a7vlt_65 ._iconTop_a7vlt_93{position:absolute;top:-1.46667rem;width:100%}._evaluatWrap_a7vlt_98{position:relative;width:4.37333rem;height:.93333rem;box-sizing:border-box;z-index:1;box-shadow:0 .02667rem .05333rem rgba(255,207,147,.28)}._evaluatWrap_a7vlt_98 .van-grid{align-items:center;width:100%;border-radius:.16rem;overflow:hidden;background-color:#fff}._evaluatWrap_a7vlt_98 .van-grid-item{flex:1;padding:0}._evaluatWrap_a7vlt_98 .van-grid-item__content{padding:0;height:.93333rem}._evaluatWrap_a7vlt_98 .van-grid:after,._evaluatWrap_a7vlt_98 .van-grid-item__content:after{display:none}._evaluatWrap_a7vlt_98 .van-badge__wrapper>div{display:flex;align-items:center}._evaluatWrap_a7vlt_98 ._evaluatTitle_a7vlt_129{font-size:.16rem;color:#1a1a1a;font-weight:500}._evaluatWrap_a7vlt_98 ._evaluatIcon_a7vlt_134{width:.26667rem;height:.26667rem;margin-right:.05333rem;vertical-align:text-bottom}._evaluatWrap_a7vlt_98 ._fraction_a7vlt_140{color:#ff6729;font-size:.21333rem}._evaluatWrap_a7vlt_98 ._fraction_a7vlt_140>span{font-size:.16rem}._evaluatWrap_a7vlt_98 ._line_a7vlt_147{width:.01333rem;height:.64rem;background-color:#f2f2f2}._tips_a7vlt_152{position:relative;padding:.16rem .32rem .10667rem;width:100%;font-size:.16rem;color:#333;line-height:.24rem;height:.8rem;box-sizing:border-box;z-index:1;background:#fef7e4;border-radius:.32rem}._btns_a7vlt_165{display:flex;justify-content:space-evenly;padding:.26667rem 0}._btns_a7vlt_165 .van-button{width:1.28rem;height:.45333rem;padding:0;margin:0;border:none;background:none}._btns_a7vlt_165 ._btnIcon_a7vlt_178{width:1.28rem;height:.45333rem;display:block}._rigthBtns_a7vlt_183{position:absolute;right:-.85333rem;top:0;width:.42667rem;height:100%;display:flex;flex-direction:column;justify-content:center}._confirm_a7vlt_193{width:3.25333rem;height:1.97333rem;border-radius:.24rem;background-color:#fff}._confirm_a7vlt_193 ._iconTitle_a7vlt_199{width:1.22667rem;height:.4rem;margin-top:-.05333rem}._confirm_a7vlt_193 ._footer_a7vlt_204{display:flex;align-items:center;justify-content:space-evenly}._confirm_a7vlt_193 ._footer_a7vlt_204 img{width:1.44rem;height:.45333rem;display:block}._confirm_a7vlt_193 .van-dialog{overflow:auto}._confirm_a7vlt_193 .van-dialog__header{padding:0;line-height:0}._confirm_a7vlt_193 .van-hairline--top:after{display:none}._confirm_a7vlt_193 .van-dialog__message{padding:0;height:1.01333rem;color:gray;font-size:.16rem;display:flex;align-items:center;justify-content:center}._sbtn_a7vlt_233{width:.53333rem;height:.26667rem;font-size:.16rem;padding:0;margin-right:.05333rem}._speed-change_15rit_1{padding:calc(.26667rem * var(--screen)) calc(.4rem * var(--screen))}._speed-change_15rit_1 ._title_15rit_4{color:#999;text-align:center;font-size:calc(.26667rem * var(--screen));font-weight:700}._speed-change_15rit_1 ._title_15rit_4 ._strong_15rit_10{color:#454545}._speed-change_15rit_1 .van-popup__close-icon{font-size:calc(.21333rem * var(--screen))!important}._speed-change_15rit_1 .van-button{height:calc(.53333rem * var(--screen));line-height:calc(.53333rem * var(--screen))}._speed_15rit_1,._background_15rit_21{color:#454545;font-size:calc(10 * var(--screen));display:flex;align-items:center;justify-content:space-between;height:calc(90% - 1.73333rem);max-height:300PX}._speed_15rit_1>span,._background_15rit_21>span{margin-right:calc(.26667rem * var(--screen))}._speed_15rit_1>div,._background_15rit_21>div{flex:1;display:flex;align-items:center;flex-direction:column;justify-content:space-between}._speed_15rit_1>div .van-button,._background_15rit_21>div .van-button{min-width:calc(.32rem * var(--screen))!important;width:calc(.26667rem * var(--screen))!important;height:calc(.26667rem * var(--screen))}._speed_15rit_1>div .van-button img,._background_15rit_21>div .van-button img{width:calc(.32rem * var(--screen));height:calc(.32rem * var(--screen));margin-top:calc(.05333rem * var(--screen))}._speed_15rit_1>div ._slider_15rit_54,._background_15rit_21>div ._slider_15rit_54{height:calc(100vh - 1.06667rem - 1.73333rem - .53333rem - .53333rem);max-height:240PX;margin:calc(.26667rem * var(--screen)) 0;background-color:#01c1b5}._speed-button_15rit_61{width:calc(4.26667rem * var(--screen));margin:auto;font-size:calc(.21333rem * var(--screen))}._custom-button_15rit_66{width:calc(.66667rem * var(--screen));color:#000;font-weight:700;font-size:calc(.21333rem * var(--screen));height:calc(.42667rem * var(--screen));line-height:calc(.42667rem * var(--screen));text-align:center;background-color:#fff;border-radius:calc(2.66667rem * var(--screen));box-shadow:0 calc(.02667rem * var(--screen)) calc(.13333rem * var(--screen)) rgba(0,0,0,.1);position:relative}._custom-button_15rit_66 ._title_15rit_4{font-size:calc(.21333rem * var(--screen));width:calc(.8rem * var(--screen));position:absolute;top:calc(-1.06667rem * var(--screen));left:calc(-.26667rem * var(--screen));box-shadow:0 calc(.02667rem * var(--screen)) calc(.26667rem * var(--screen)) rgba(0,0,0,.1);height:calc(.8rem * var(--screen));line-height:calc(.8rem * var(--screen));border-radius:calc(.4rem * var(--screen));visibility:hidden;opacity:0;transition:all .2s}._custom-button_15rit_66 ._title_15rit_4:after{content:"";position:absolute;width:0;height:0;border-radius:calc(2.66667rem * var(--screen));border:calc(2.66667rem * var(--screen)) solid #fff;border-color:#fff transparent transparent transparent;bottom:calc(-.4rem * var(--screen));left:calc(.53333rem * var(--screen))}._custom-button_15rit_66 ._title_15rit_4._show_15rit_104{visibility:visible;opacity:1}._close_1xean_1{position:absolute;right:-.18667rem;top:-.18667rem;width:.37333rem;height:.37333rem}._close_1xean_1 .van-icon__image{width:100%;height:100%}._bg_1xean_12{background-position:left 102%;background-size:100% .48rem;background-repeat:no-repeat}._title_184ej_1{margin:.21333rem 0;text-align:center;font-size:.18667rem;font-weight:500;color:#1a1a1a}._wrap_184ej_8{padding:.05333rem .32rem}._wrap_184ej_8 .van-divider{margin:.13333rem 0}._item_184ej_14{display:flex;align-items:center}._label_184ej_18{width:.85333rem;font-size:.16rem;font-weight:400;color:#666;line-height:.24rem}._container_la5im_1{height:auto!important;padding-bottom:.21333rem}._title_la5im_5{margin:.21333rem 0;text-align:center;font-size:.18667rem;font-weight:500;color:#1a1a1a}._practiseBtn_la5im_12{width:2.10667rem;height:.48rem;margin-top:.18667rem;background-image:url(/orchestra-music-score/assets/practise.dcd2b4c4.png);background-size:100% 100%;background-repeat:no-repeat;border:none}._wrap_la5im_21{height:1.86667rem;overflow-y:auto}._wrap_la5im_21 .van-radio-group{display:flex;flex-direction:column;justify-content:center;align-items:center}._wrap_la5im_21 .van-radio__icon{display:none}._wrap_la5im_21 .van-radio{width:2.85333rem;height:.53333rem;line-height:.53333rem;background:#f8f8f8;border-radius:.08rem;border:.01333rem solid #f8f8f8;margin-bottom:.16rem;justify-content:center}._wrap_la5im_21 .van-radio__label{margin:0;font-size:.16rem;color:#999}._wrap_la5im_21 .van-radio[aria-checked=true]{border-color:var(--primary-color);background:#e2fff9}._wrap_la5im_21 .van-radio[aria-checked=true] .van-checkbox__label{color:var(--primary-color)}.eyeProtection ._container_yu37e_1:before{background:var(--eye-background-color)}._container_yu37e_1{display:flex;position:fixed;z-index:9;top:0;right:0;left:0;padding:0;align-items:center;justify-content:center;height:calc(.90667rem + var(--header-padding-top));box-sizing:border-box;overflow:hidden;background-color:#fff}._container_yu37e_1:before{position:absolute;top:0;left:0;height:100vh;width:100vw;z-index:-1}._container_yu37e_1>div{flex:1 1 33.33%}._moreButton_yu37e_30{display:flex;justify-content:flex-end}._centerButton_yu37e_34{display:flex;align-items:center;justify-content:center}._leftButton_yu37e_39{display:flex;align-items:center;flex:1;padding-left:.42667rem}._leftButton_yu37e_39>div>div{max-width:20vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._leftButton_yu37e_39 ._title_yu37e_51{font-size:.26667rem;color:#333}._leftButton_yu37e_39 ._album_yu37e_55{font-size:.16rem;color:#999}._button_yu37e_59{height:.61333rem;padding:0;margin:0;border:none;background:none;font-size:0}._button_yu37e_59._hasText_yu37e_67{height:.72rem;border:none;font-size:12Px;margin:0 5Px}._button_yu37e_59._hasText_yu37e_67 img{width:.4rem;height:.37333rem;display:block;margin:auto;margin-bottom:.02667rem}._button_yu37e_59._hasText_yu37e_67 .van-button__text{display:flex;font-size:.13333rem;color:#828282;flex-direction:column}._button_yu37e_59._hasText_yu37e_67 .van-button__text>span{display:block;white-space:nowrap}._button_yu37e_59._bigIcon_yu37e_90 img{width:.66667rem;height:.37333rem;display:block;margin:auto;margin-bottom:.02667rem}._evaluatBtn_yu37e_97{width:1.44rem}._start_yu37e_100{width:2rem;height:2rem;background-color:transparent;background-size:100%;background-position:center;color:#fff;border-radius:100%;position:fixed;top:50%;left:50%;margin-top:10vh;transform:translate(-50%,-50%);font-size:.32rem}._icon_yu37e_115{width:100%}._onShow_yu37e_118{transform:translateY(0)}._popover_yu37e_121 .van-popover__content{border-radius:.08rem!important}._popover_yu37e_121 .van-popover__arrow{bottom:.08rem;border-width:.10667rem!important}._backbtn_yu37e_128{display:inline-block;padding:0;width:32Px;height:32Px}._titleWrap_yu37e_134{margin-left:15Px}._speed_yu37e_137{display:block}._speed_yu37e_137>div{padding:.05333rem}._speed_yu37e_137 .van-slider__button-wrapper{background:#FFE8B1;border-radius:20Px;border:.02667rem solid #ffffff;padding:2Px 4Px}._speed_yu37e_137 .van-slider__button-wrapper>div{background-color:transparent!important}._speed_yu37e_137 .van-slider__button-wrapper span{color:#f67146!important}._speed_yu37e_137 .van-slider{background-color:#ffd571!important;margin-top:.05333rem!important;margin-bottom:.05333rem!important;min-height:35vh}._speed_yu37e_137 .van-button{width:.26667rem!important;height:.26667rem!important;background-color:transparent!important;border:none!important;margin-left:0!important}._speed_yu37e_137 .van-button:last-child{margin-top:.10667rem}._speed_yu37e_137 .van-button__icon,._speed_yu37e_137 img{width:.26667rem!important;height:.26667rem!important}._schedule_yu37e_176{position:relative}._schedule_yu37e_176 circle{display:block}._schedule_yu37e_176 ._ring_yu37e_182{position:absolute;left:0;top:0;transform-origin:center;transform:rotate(-90deg);display:flex;width:100%;height:100%}._speedButton_yu37e_192{position:relative}._speedButton_yu37e_192 ._label_yu37e_195{position:absolute;font-size:.10667rem;color:var(--primary-color);line-height:.18667rem;background:#FFE8B1;border-radius:.13333rem;border:.02667rem solid #ffffff;right:-.10667rem;top:-.02667rem}._player_yu37e_206{position:fixed;z-index:8;bottom:.26667rem;right:.42667rem;display:inline-block;z-index:9}._fullbtn_yu37e_214 .van-button__text{width:.53333rem;height:.53333rem}._fullbtn_yu37e_214 .van-button__text>div,._fullbtn_yu37e_214 .van-button__text img{width:.53333rem;height:.53333rem}._finish_yu37e_223{background-color:transparent;background-size:100%;background-position:center;width:1.78667rem;height:.61333rem;border-radius:.32rem;border:none;color:#6f4900;font-size:.24rem}.start-enter-active,.start-leave-active{transition:all .5s ease-out}.start-enter-from{opacity:0}.start-enter-to,.start-leave-from{opacity:1}.start-leave-to{margin-top:-2.66667rem;margin-left:-.8rem;opacity:0;transform:scale(.1);border-radius:0}.finish-enter-active,.finish-leave-active{transition:all .5s ease-out}.finish-enter-from{transform:scale(.1);opacity:0}.finish-enter-to{opacity:1;transform:scale(1)}.finish-leave-from{opacity:1}.finish-leave-to{opacity:0;transform:scale(.1)}._dialogueBox_yu37e_273{position:fixed;bottom:0;right:0;z-index:9;display:flex;flex-direction:column;align-items:flex-end}._dialogueBox_yu37e_273 ._dialogue_yu37e_273{position:fixed;bottom:1.49333rem}._dialogueBox_yu37e_273 ._dialogue_yu37e_273>div{width:2.56rem;height:.85333rem;background:url(/orchestra-music-score/assets/task-bg.859300d7.svg) no-repeat center;background-size:cover;margin-right:.26667rem;color:#6f4900;font-size:.16rem;line-height:.21333rem;padding:.16rem .10667rem .10667rem;box-sizing:border-box}._inRadio_yu37e_299{width:.85333rem;height:.37333rem;font-size:.16rem;background:#ffe1b8;border-radius:.18667rem;border:.02667rem solid #ffffff;color:#6f4900;line-height:.32rem;box-sizing:border-box;text-align:center;position:fixed;bottom:.12rem;right:1.2rem;z-index:9}._animation_yu37e_315{width:2.13333rem;height:1.78667rem;margin-right:0}._btnMusicList_yu37e_320{position:fixed;right:0;top:50%;transform:translateY(-50%);z-index:10;margin:0;width:40Px}._btnMusicList_yu37e_320 img{width:100%}._toggleMusicType_yu37e_332 .van-popover__content{padding:4Px 0;border-radius:8Px}._toggleMusicType_yu37e_332 .van-popover__action{width:130Px;height:40Px;padding:0 14Px}._toggleMusicType_yu37e_332 .van-popover__action>img{width:38Px;margin-right:16Px}._toggleMusicType_yu37e_332 .action-text{flex:1;font-size:14Px;text-align:justify;text-align-last:justify;text-justify:distribute-all-lines}._toggleMusicType_yu37e_332 .action-text:before,._toggleMusicType_yu37e_332 .action-text:after{display:inline-block;content:"";width:100%;height:0;visibility:hidden}._toggleMusicType_yu37e_332 .action-active{color:var(--primary-color)}._slider_yu37e_365{width:.74667rem;color:#fff;font-size:.21333rem;line-height:.42667rem;text-align:center;background-color:var(--van-primary-color);border-radius:.53333rem}.van-popup.van-popover.cameraPopover{width:8rem}.van-popup.van-popover.cameraPopover .van-popover__arrow{right:.16rem;border-width:.10667rem}.van-popup.van-popover.cameraPopover .van-cell{padding:.26667rem .42667rem;line-height:.64rem}.van-popup.van-popover.cameraPopover .van-switch{font-size:.42667rem!important}.van-popup.van-popover.cameraPopover .cameraOpacity .van-cell__value{flex:2;overflow:visible}._followEndBtn_yu37e_392{background-color:transparent;background-size:100%;background-position:center;color:#fff}._setting_18qx2_1{width:3.94667rem;height:3.86667rem;max-height:70vh;overflow:hidden;border-radius:.21333rem;--van-switch-background-color: #fff;--van-switch-on-background-color: linear-gradient(180deg, #39f3d0 0%, #2dc7aa 100%);--van-switch-border: .00267rem solid #2dc7aa}._setting_18qx2_1 .van-tabs{display:flex;flex-direction:column;height:100%}._setting_18qx2_1 .van-tabs__content{height:3.33333rem}._setting_18qx2_1 .van-tab__pane{height:100%}._setting_18qx2_1 .van-tab__pane>div{height:100%}._setting_18qx2_1 .van-switch{background:url(/orchestra-music-score/assets/off.a9b6351b.svg) no-repeat center;background-size:cover;border-radius:0;background-color:transparent!important;border:none!important;width:.64rem;height:.32rem}._setting_18qx2_1 .van-switch .van-switch__node{display:none}._setting_18qx2_1 .van-switch--on{background-image:url(/orchestra-music-score/assets/on.7f9bf846.svg);background-size:cover}._setting_18qx2_1 .van-tabs__content>.van-tab__pane>div{overflow:hidden;box-sizing:border-box}._sliderWrap_18qx2_45{height:.8rem;display:flex;align-items:center}._sliderWrap_18qx2_45 .cell__title{font-size:.16rem;color:#666;font-weight:400;width:30%}._sliderWrap_18qx2_45 .van-slider{flex:1}._slider_18qx2_45{width:.74667rem;color:#fff;font-size:.21333rem;line-height:.32rem;text-align:center;background-color:var(--van-primary-color);border-radius:.53333rem}._noticebar_18qx2_68{margin:.08rem .18667rem 0;height:.45333rem;border-radius:.13333rem}._groupBox_18qx2_74{padding:.10667rem .32rem;overflow:hidden;overflow-y:auto;height:100%;box-sizing:border-box}._groupBox_18qx2_74 .van-cell{padding:0;line-height:.29333rem}._groupBox_18qx2_74 .van-cell__title{font-size:.16rem;color:#666;font-weight:400}._groupBox_18qx2_74 .van-divider{margin:.08rem 0}._btnsbar_18qx2_93{padding:0 .18667rem;margin:.10667rem auto .08rem;box-sizing:border-box;position:absolute;bottom:0;display:flex;width:100%;justify-content:center}._btnsbar_18qx2_93 ._btn_18qx2_93{height:.4rem;border-radius:.08rem;display:flex;align-items:center;justify-content:center;font-size:.13333rem;background:#fff6e8;color:#6c442d;border:none;margin:0 5Px}._btnsbar_18qx2_93 ._btn_18qx2_93 .van-button__text{margin:0}._btnsbar_18qx2_93 ._btn_18qx2_93 img{width:.26667rem;height:.26667rem;margin-right:0}._radioGroup_18qx2_124{display:flex;align-items:center;padding:4Px;border-radius:.10667rem;background:linear-gradient(180deg,var(--primary-color) 0%,var(--primary-color) 100%);margin-left:auto}._radioGroup_18qx2_124 .van-radio__icon{display:none}._radioGroup_18qx2_124 .van-radio__label{margin:0;font-size:12Px;color:#fff;line-height:normal;white-space:nowrap;padding:2Px 4Px}._radioGroup_18qx2_124 .van-radio{display:flex;align-items:center;justify-content:center;border-radius:.08rem;margin:0 .02667rem}._radioGroup_18qx2_124 .van-radio[aria-checked=true]{background:#fff}._radioGroup_18qx2_124 .van-radio[aria-checked=true] .van-radio__label{color:var(--primary-color)}.van-switch{border-color:#ccc}.van-switch.van-switch--on{border-color:#2dc7aa}.van-switch--on{background-color:#2dc7aa}._tabs_e40bs_1{height:100%;display:flex;flex-direction:column}._tabs_e40bs_1 .van-tabs__content{flex:1}._tabs_e40bs_1 .van-tab__pane,._tabs_e40bs_1 iframe{width:100%;height:100%;border:none;margin:0}._feedback_1x8ma_1{width:4.8rem;height:3.86667rem;overflow:hidden;border-radius:.13333rem}._title_1x8ma_7{margin:.21333rem 0;text-align:center;font-size:.18667rem;font-weight:500;color:#1a1a1a}._wrap_1x8ma_14{padding:.13333rem .21333rem 0}._sub_1x8ma_17{font-size:.16rem;font-weight:400;color:#666;margin-bottom:.16rem}._group_1x8ma_23{display:flex;flex-wrap:wrap}._group_1x8ma_23 .van-radio__icon{display:none}._group_1x8ma_23 .van-radio__label{margin:0;color:#999;line-height:inherit}._group_1x8ma_23 .van-radio{height:.32rem;justify-content:center;border-radius:.08rem;background:#f8f8f8;font-size:.16rem;margin-bottom:.10667rem;border:.01333rem solid #f8f8f8}._group_1x8ma_23 .van-radio[aria-checked=true]{border-color:var(--primary-color);background:#e2fff9}._group_1x8ma_23 .van-radio[aria-checked=true] .van-radio__label{color:var(--primary-color)}._text_1x8ma_51{background:#f8f8f8;font-size:.16rem;padding:.10667rem;border-radius:.08rem;line-height:1.2;height:.88rem;overflow-y:auto}._text_1x8ma_51 textarea::-webkit-input-placeholder{color:#999}._text_1x8ma_51:after{display:none}._text_1x8ma_51 .van-field__word-limit{font-size:.16rem;line-height:.21333rem;color:#ccc;margin-top:0}._submit_1x8ma_72{width:2.10667rem;height:.48rem;margin-top:.18667rem;background-size:100% 100%;background-repeat:no-repeat;border:none}._header_1l0s0_1{display:flex;justify-content:space-between;position:fixed;left:.4rem;right:.4rem;top:.21333rem;z-index:2}._header_1l0s0_1 ._left_1l0s0_10{display:flex}._header_1l0s0_1 ._left_1l0s0_10>button,._header_1l0s0_1>button{width:.66667rem;height:.66667rem;padding:0;height:auto;display:flex;align-items:center;border:none;background-color:transparent;font-size:0}._header_1l0s0_1 ._left_1l0s0_10>button img,._header_1l0s0_1>button img{width:.66667rem;height:.66667rem;display:block;margin:auto}._modelWraper_iddf4_1{position:fixed;left:0;right:0;bottom:0;z-index:100}._modelWraper_iddf4_1 ._wrap_iddf4_8{padding:.42667rem 0;display:flex;justify-content:center;background:rgba(255,255,255,.7)}._modelWraper_iddf4_1 ._wrap_iddf4_8 img{width:1.70667rem;height:.64rem;margin:0 .37333rem}.green .vf-notehead>path{fill:green}._follow_1izp1_4{position:fixed;left:0;right:0;bottom:0;top:0;z-index:1000}._title_1izp1_12{margin-top:1.06667rem;font-size:.32rem}._endBtns_1izp1_16{position:fixed;top:1.06667rem;right:.26667rem}._button_1izp1_21{height:.61333rem;padding:0;margin:0;border:none;background:none;font-size:0}._button_1izp1_21._hasText_1izp1_29{height:.72rem;border-radius:.10667rem;font-size:.13333rem;margin-right:.26667rem}._button_1izp1_21._hasText_1izp1_29 img{width:.4rem;height:.37333rem;display:block;margin:auto;margin-bottom:.02667rem}._button_1izp1_21._hasText_1izp1_29 .van-button__text{display:flex;font-size:.13333rem;color:#828282;flex-direction:column}._button_1izp1_21._hasText_1izp1_29 .van-button__text>span{display:block;margin-top:.05333rem}._button_1izp1_21._bigIcon_1izp1_52 img{width:.66667rem;height:.37333rem;display:block;margin:auto;margin-bottom:.02667rem}._start_1izp1_59{width:2rem;height:2rem;background-repeat:no-repeat;background-position:center;background-size:100%;border-radius:100%;position:fixed;top:50%;left:50%;margin-top:10vh;transform:translate(-50%,-50%);font-size:.32rem;color:#fff}._container_ajal8_1 img{width:100%;margin:auto;display:block}._changeIndex_ajal8_6{font-size:.16rem;position:absolute;left:.64rem;bottom:.53333rem;z-index:10;width:.4rem;height:.4rem;border-radius:100%;background-color:#01c1b5;line-height:.4rem;text-align:center;color:#fff;box-shadow:0 0 .26667rem rgba(0,0,0,.05)}.transverse ._changeIndex_ajal8_6{bottom:.26667rem;left:.02667rem}.flute ._changeIndex_ajal8_6{left:.32rem!important}.piccolo ._changeIndex_ajal8_6{left:1.5vw;bottom:.53333rem}.clarinet ._changeIndex_ajal8_6{left:0!important}.horn ._changeIndex_ajal8_6{left:1vw;top:1vh}.up-bass-horn ._changeIndex_ajal8_6{left:1vw}.tuba ._changeIndex_ajal8_6{right:inherit;left:1vw;bottom:.53333rem}.saxophone ._changeIndex_ajal8_6{left:1vw}.trombone ._changeIndex_ajal8_6{left:.32rem!important}@keyframes _activeopacity_ajal8_1{0%{transforopacitym:0}to{opacity:1}}@keyframes _leftrotates_ajal8_1{0%{transform:rotate(0)}50%{transform:rotate(-10deg)}to{transform:rotate(-10deg)}}@keyframes _rightrotates_ajal8_1{0%{transform:rotate(0)}50%{transform:rotate(5deg)}to{transform:rotate(5deg)}}.small-drum img[data-index=active]{animation:_activeopacity_ajal8_1 .2s;animation-delay:.3s;transform-origin:0 0}.small-drum img[data-index=left]{animation:_leftrotates_ajal8_1 .5s;transform-origin:0 0}.small-drum img[data-index=right]{animation:_rightrotates_ajal8_1 .5s;transform-origin:0 0}.piccolo{margin-top:0}._section_fxysl_1 ._measure_fxysl_1{transition:.5s all;position:relative}._section_fxysl_1 ._measure_fxysl_1._dontTransition_fxysl_5 ._after_fxysl_5{display:none}._section_fxysl_1 ._measure_fxysl_1 ._after_fxysl_5{transform:translateY(-.8rem) scale(.75);top:0;opacity:0;transition:.5s all;content:"";position:absolute;display:flex;align-items:center;width:160PX;height:100%;left:0;margin-left:-32PX}._section_fxysl_1 ._measure_fxysl_1 ._after_fxysl_5 ._img_fxysl_22{display:block;background-repeat:no-repeat;background-position:right;background-size:cover;height:100%;width:130PX}._section_fxysl_1 ._measure_fxysl_1 ._after_fxysl_5 ._font_fxysl_30{font-size:.48rem;font-family:Roboto,sans-serif;font-weight:700}._section_fxysl_1 ._bad_fxysl_35{background-color:rgba(255,142,142,.32);color:#ee4c6a}._section_fxysl_1 ._bad_fxysl_35 ._after_fxysl_5 ._img_fxysl_22{background-image:url(/orchestra-music-score/assets/bad.d9395829.png?inline);background-position:20PX}._section_fxysl_1 ._good_fxysl_43{background-color:rgba(1,193,181,.2);color:#ff958b}._section_fxysl_1 ._good_fxysl_43 ._after_fxysl_5 ._img_fxysl_22{background-image:url(/orchestra-music-score/assets/good.79181f8b.png?inline);background-position:5PX}._section_fxysl_1 ._great_fxysl_51{background-color:rgba(255,178,82,.37);color:#ff8e5a}._section_fxysl_1 ._great_fxysl_51 ._after_fxysl_5 ._img_fxysl_22{background-image:url(/orchestra-music-score/assets/great.39cb6b25.png?inline)}._section_fxysl_1 ._perfect_fxysl_58{background-color:rgba(255,220,64,.4);color:#516aff}._section_fxysl_1 ._perfect_fxysl_58 ._after_fxysl_5 ._img_fxysl_22{background-image:url(/orchestra-music-score/assets/perfect.ab44b0e5.png?inline)}._section_fxysl_1 .list-enter-active,._section_fxysl_1 .list-enter-active ._after_fxysl_5{opacity:1}._section_fxysl_1 .list-enter-from{opacity:0}._section_fxysl_1 .list-enter-from ._after_fxysl_5{left:50%;opacity:1;transform:translateY(0) scale(1);margin-left:-65PX}._noteWrap_fxysl_80{display:flex;flex-direction:column;justify-content:center;align-items:center}._noteBase_fxysl_86{display:none}.follow-success>._noteRight_fxysl_89{display:block}.follow-error>._noteError_fxysl_92{display:block}.dotWrap{position:absolute;display:flex;justify-content:flex-end;transform:translateY(-10%)}.dotWrap .dot{display:flex;justify-content:center;align-items:center;width:20PX;height:20PX;border-radius:50%;background-color:#ff9100;color:#fff;font-weight:700;font-size:14Px}@keyframes _flash_fxysl_124{0%{opacity:0}50%{opacity:1}to{opacity:0}}._flash_fxysl_124{animation:_flash_fxysl_124 1.2s infinite ease-in-out}._restFlag_fxysl_127{position:absolute;left:.53333rem;top:.53333rem;display:flex;align-items:center}._restFlag_fxysl_127 div{width:10PX;height:10PX;border-radius:50%;background-color:#ff9100;margin:0 1PX}._restFlagActive_fxysl_141{animation:_flicker_fxysl_1 1s ease infinite}._restFlagActive_fxysl_141 div{background-color:#2dc7aa}@keyframes _flicker_fxysl_1{0%{opacity:1}50%{opacity:.2}to{opacity:1}}\n',document.head.appendChild(__vite_style__),System.register(["./native-message-legacy.9bc4e0cc.js","./index-legacy.dc18ac28.js"],(function(exports,module){"use strict";var unref,ref,inject,onUnmounted,computed,reactive,onMounted,nextTick,onActivated,onDeactivated,isRef,watch,getCurrentInstance,provide,isVNode,defineComponent,createVNode,onBeforeUnmount,Transition,withDirectives,vShow,Teleport,Fragment,mergeProps,createTextVNode,createApp,onBeforeUpdate,commonjsGlobal$1,getRequestHostname,browser,postMessage,commonjsRequire$1,getAugmentedNamespace,watchEffect,formatZoom,state$3,__vitePreload,open$1,close$1,createRouter,createWebHashHistory,queryString,listenerMessage,removeListenerMessage,state$4,toRefs,resolveComponent,promisefiyPostMessage,resolveDirective,getPlatform,store_legacy,formatTime,TransitionGroup,isIOS$1,truthProp,createNamespace,withInstall,extend$2,routeProps,useRoute,Button,unknownProp,getZIndexStyle,isDef$1,noop$2,Icon,isObject$1,isPromise,isFunction$1,addUnit,Loading,inBrowser$1,pick,BORDER_LEFT,BORDER_TOP,unitToPx,Badge,BORDER_TOP_BOTTOM,route,BORDER,BORDER_BOTTOM,getSizeStyle;return{setters:[function(e){unref=e.l,ref=e.i,inject=e.m,onUnmounted=e.n,computed=e.q,reactive=e.v,onMounted=e.o,nextTick=e.x,onActivated=e.y,onDeactivated=e.z,isRef=e.A,watch=e.w,getCurrentInstance=e.B,provide=e.C,isVNode=e.D,defineComponent=e.d,createVNode=e.c,onBeforeUnmount=e.E,Transition=e.T,withDirectives=e.G,vShow=e.H,Teleport=e.I,Fragment=e.F,mergeProps=e.J,createTextVNode=e.j,createApp=e.g,onBeforeUpdate=e.K,commonjsGlobal$1=e.L,getRequestHostname=e.M,browser=e.h,postMessage=e.N,commonjsRequire$1=e.O,getAugmentedNamespace=e.P,watchEffect=e.Q,formatZoom=e.f,state$3=e.s,__vitePreload=e._,open$1=e.R,close$1=e.e,createRouter=e.a,createWebHashHistory=e.S,queryString=e.U,listenerMessage=e.V,removeListenerMessage=e.W,state$4=e.k,toRefs=e.t,resolveComponent=e.r,promisefiyPostMessage=e.p,resolveDirective=e.X,getPlatform=e.Y,store_legacy=e.Z,formatTime=e.$,TransitionGroup=e.a0},function(e){isIOS$1=e.i,truthProp=e.t,createNamespace=e.c,withInstall=e.w,extend$2=e.e,routeProps=e.r,useRoute=e.u,Button=e.B,unknownProp=e.a,getZIndexStyle=e.g,isDef$1=e.b,noop$2=e.n,Icon=e.I,isObject$1=e.d,isPromise=e.f,isFunction$1=e.h,addUnit=e.j,Loading=e.L,inBrowser$1=e.k,pick=e.p,BORDER_LEFT=e.l,BORDER_TOP=e.m,unitToPx=e.o,Badge=e.q,BORDER_TOP_BOTTOM=e.s,route=e.v,BORDER=e.x,BORDER_BOTTOM=e.y,getSizeStyle=e.z}],execute:function execute(){exports({D:Dialog,T:Toast,a$:useClickAway,aZ:useParent,a_:useChildren,aj:useScrollParent,ak:useEventListener,al:useTabStatus,an:isHidden,ao:useExpose,ap:cancelRaf,aq:raf$2,ar:useTouch,at:preventDefault,au:clamp,av:useWindowSize,ax:callInterceptor,ay:mountComponent,az:usePopupState,q:startRun,v:svgtopng});var replace=String.prototype.replace,percentTwenties=/%20/g,Format={RFC1738:"RFC1738",RFC3986:"RFC3986"},formats$3={default:Format.RFC3986,formatters:{RFC1738:function(e){return replace.call(e,percentTwenties,"+")},RFC3986:function(e){return String(e)}},RFC1738:Format.RFC1738,RFC3986:Format.RFC3986},formats$2=formats$3,has$2=Object.prototype.hasOwnProperty,isArray$4=Array.isArray,hexTable=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),compactQueue=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(isArray$4(n)){for(var i=[],r=0;r=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||r===formats$2.RFC1738&&(40===l||41===l)?s+=a.charAt(o):l<128?s+=hexTable[l]:l<2048?s+=hexTable[192|l>>6]+hexTable[128|63&l]:l<55296||l>=57344?s+=hexTable[224|l>>12]+hexTable[128|l>>6&63]+hexTable[128|63&l]:(o+=1,l=65536+((1023&l)<<10|1023&a.charCodeAt(o)),s+=hexTable[240|l>>18]+hexTable[128|l>>12&63]+hexTable[128|l>>6&63]+hexTable[128|63&l])}return s},compact=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],i=0;i0?m.join(",")||null:void 0}];else if(isArray$3(o))v=o;else{var y=Object.keys(m);v=l?y.sort(l):y}for(var b=0;b0?h+c:""},utils$1=utils$3,has=Object.prototype.hasOwnProperty,isArray$2=Array.isArray,defaults={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:utils$1.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},interpretNumericEntities=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},parseArrayValue=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},isoSentinel="utf8=%26%2310003%3B",charsetSentinel="utf8=%E2%9C%93",parseValues=function(e,t){var n,i={},r=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=t.parameterLimit===1/0?void 0:t.parameterLimit,s=r.split(t.delimiter,a),o=-1,l=t.charset;if(t.charsetSentinel)for(n=0;n-1&&(c=isArray$2(c)?[c]:c),has.call(i,u)?i[u]=utils$1.combine(i[u],c):i[u]=c}return i},parseObject=function(e,t,n,i){for(var r=i?t:parseArrayValue(t,n),a=e.length-1;a>=0;--a){var s,o=e[a];if("[]"===o&&n.parseArrays)s=[].concat(r);else{s=n.plainObjects?Object.create(null):{};var l="["===o.charAt(0)&&"]"===o.charAt(o.length-1)?o.slice(1,-1):o,u=parseInt(l,10);n.parseArrays||""!==l?!isNaN(u)&&o!==l&&String(u)===l&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(s=[])[u]=r:s[l]=r:s={0:r}}r=s}return r},parseKeys=function(e,t,n,i){if(e){var r=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,s=n.depth>0&&/(\[[^[\]]*])/.exec(r),o=s?r.slice(0,s.index):r,l=[];if(o){if(!n.plainObjects&&has.call(Object.prototype,o)&&!n.allowPrototypes)return;l.push(o)}for(var u=0;n.depth>0&&null!==(s=a.exec(r))&&u-1};function normalizeName(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function normalizeValue(e){return"string"!=typeof e&&(e=String(e)),e}function iteratorFor(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return support.iterable&&(t[Symbol.iterator]=function(){return t}),t}function Headers(e){this.map={},e instanceof Headers?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function consumed(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function fileReaderReady(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function readBlobAsArrayBuffer(e){var t=new FileReader,n=fileReaderReady(t);return t.readAsArrayBuffer(e),n}function readBlobAsText(e){var t=new FileReader,n=fileReaderReady(t);return t.readAsText(e),n}function readArrayBufferAsText(e){for(var t=new Uint8Array(e),n=new Array(t.length),i=0;i=0&&"string"!=typeof this._bodyInit&&(this._bodyInit=this._bodyText):"string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):support.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8")},support.blob&&(this.blob=function(){var e=consumed(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=consumed(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}return this.blob().then(readBlobAsArrayBuffer)}),this.text=function(){var e=consumed(this);if(e)return e;if(this._bodyBlob)return readBlobAsText(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},support.formData&&(this.formData=function(){return this.text().then(decode$1)}),this.json=function(){return this.text().then(JSON.parse)},this}Headers.prototype.append=function(e,t){e=normalizeName(e),t=normalizeValue(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},Headers.prototype.delete=function(e){delete this.map[normalizeName(e)]},Headers.prototype.get=function(e){return e=normalizeName(e),this.has(e)?this.map[e]:null},Headers.prototype.has=function(e){return this.map.hasOwnProperty(normalizeName(e))},Headers.prototype.set=function(e,t){this.map[normalizeName(e)]=normalizeValue(t)},Headers.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},Headers.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),iteratorFor(e)},Headers.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),iteratorFor(e)},Headers.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),iteratorFor(e)},support.iterable&&(Headers.prototype[Symbol.iterator]=Headers.prototype.entries);var methods=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function normalizeMethod(e){var t=e.toUpperCase();return methods.indexOf(t)>-1?t:e}function Request(e,t){if(!(this instanceof Request))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n=(t=t||{}).body;if(e instanceof Request){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Headers(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new Headers(t.headers)),this.method=normalizeMethod(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var i=/([?&])_=[^&]*/;if(i.test(this.url))this.url=this.url.replace(i,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function decode$1(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),i=n.shift().replace(/\+/g," "),r=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(r))}})),t}function parseHeaders(e){var t=new Headers;return e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),i=n.shift().trim();if(i){var r=n.join(":").trim();t.append(i,r)}})),t}function Response(e,t){if(!(this instanceof Response))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new Headers(t.headers),this.url=t.url||"",this._initBody(e)}Request.prototype.clone=function(){return new Request(this,{body:this._bodyInit})},Body.call(Request.prototype),Body.call(Response.prototype),Response.prototype.clone=function(){return new Response(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Headers(this.headers),url:this.url})},Response.error=function(){var e=new Response(null,{status:0,statusText:""});return e.type="error",e};var redirectStatuses=[301,302,303,307,308];Response.redirect=function(e,t){if(-1===redirectStatuses.indexOf(t))throw new RangeError("Invalid status code");return new Response(null,{status:t,headers:{location:e}})};var DOMException=global$1.DOMException;try{new DOMException}catch(err){DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},DOMException.prototype=Object.create(Error.prototype),DOMException.prototype.constructor=DOMException}function fetch$2(t,n){return new Promise((function(i,r){var a=new Request(t,n);if(a.signal&&a.signal.aborted)return r(new DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function o(){s.abort()}s.onload=function(){var e={status:s.status,statusText:s.statusText,headers:parseHeaders(s.getAllResponseHeaders()||"")};e.url="responseURL"in s?s.responseURL:e.headers.get("X-Request-URL");var t="response"in s?s.response:s.responseText;setTimeout((function(){i(new Response(t,e))}),0)},s.onerror=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},s.ontimeout=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},s.onabort=function(){setTimeout((function(){r(new DOMException("Aborted","AbortError"))}),0)},s.open(a.method,function(t){try{return""===t&&global$1.location.href?global$1.location.href:t}catch(e){return t}}(a.url),!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&(support.blob?s.responseType="blob":support.arrayBuffer&&a.headers.get("Content-Type")&&-1!==a.headers.get("Content-Type").indexOf("application/octet-stream")&&(s.responseType="arraybuffer")),!n||"object"!==_typeof3(n.headers)||n.headers instanceof Headers?a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})):Object.getOwnPropertyNames(n.headers).forEach((function(e){s.setRequestHeader(e,normalizeValue(n.headers[e]))})),a.signal&&(a.signal.addEventListener("abort",o),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",o)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}fetch$2.polyfill=!0,global$1.fetch||(global$1.fetch=fetch$2,global$1.Headers=Headers,global$1.Request=Request,global$1.Response=Response),self.fetch.bind(self);var defineProperty=_defineProperty;function _objectSpread(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{global:!1,core:!1,defaultInstance:!1},i=!1,r=!1,a=!1;"number"==typeof n?(process&&process.env,i=!0,r=!1):"object"===_typeof_1(n)&&n&&(r=n.global||!1,i=n.core||!1,a=n.defaultInstance||!1),r?e.globalMiddlewares.splice(e.globalMiddlewares.length-e.defaultGlobalMiddlewaresLength,0,t):i?e.coreMiddlewares.splice(e.coreMiddlewares.length-e.defaultCoreMiddlewaresLength,0,t):a?this.defaultMiddlewares.push(t):this.middlewares.push(t)}},{key:"execute",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=compose([].concat(toConsumableArray(this.middlewares),toConsumableArray(this.defaultMiddlewares),toConsumableArray(e.globalMiddlewares),toConsumableArray(e.coreMiddlewares)));return n(t)}}]),e}();function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}Onion.globalMiddlewares=[],Onion.defaultGlobalMiddlewaresLength=0,Onion.coreMiddlewares=[],Onion.defaultCoreMiddlewaresLength=0;var assertThisInitialized=_assertThisInitialized;function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof_1(t)&&"function"!=typeof t?assertThisInitialized(e):t}var possibleConstructorReturn=_possibleConstructorReturn,getPrototypeOf=createCommonjsModule$1((function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(n)}e.exports=t})),setPrototypeOf=createCommonjsModule$1((function(e){function t(n,i){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(n,i)}e.exports=t}));function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&setPrototypeOf(e,t)}var inherits=_inherits;function _isNativeFunction(e){return-1!==Function.toString.call(e).indexOf("[native code]")}var isNativeFunction=_isNativeFunction,construct=createCommonjsModule$1((function(t){function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function i(e,r,a){return n()?t.exports=i=Reflect.construct:t.exports=i=function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&setPrototypeOf(r,n.prototype),r},i.apply(null,arguments)}t.exports=i})),wrapNativeSuper=createCommonjsModule$1((function(e){function t(n){var i="function"==typeof Map?new Map:void 0;return e.exports=t=function(e){if(null===e||!isNativeFunction(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(e))return i.get(e);i.set(e,t)}function t(){return construct(e,arguments,getPrototypeOf(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),setPrototypeOf(t,e)},t(n)}e.exports=t})),MapCache=function(){function e(t){classCallCheck(this,e),this.cache=new Map,this.timer={},this.extendOptions(t)}return createClass(e,[{key:"extendOptions",value:function(e){this.maxCache=e.maxCache||0}},{key:"get",value:function(e){return this.cache.get(JSON.stringify(e))}},{key:"set",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:6e4;if(this.maxCache>0&&this.cache.size>=this.maxCache){var r=toConsumableArray(this.cache.keys())[0];this.cache.delete(r),this.timer[r]&&clearTimeout(this.timer[r])}var a=JSON.stringify(e);this.cache.set(a,t),i>0&&(this.timer[a]=setTimeout((function(){n.cache.delete(a),delete n.timer[a]}),i))}},{key:"delete",value:function(e){var t=JSON.stringify(e);return delete this.timer[t],this.cache.delete(t)}},{key:"clear",value:function(){return this.timer={},this.cache.clear()}}]),e}(),RequestError=function(e){function t(e,n){var i,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"RequestError";return classCallCheck(this,t),(i=possibleConstructorReturn(this,getPrototypeOf(t).call(this,e))).name="RequestError",i.request=n,i.type=r,i}return inherits(t,e),t}(wrapNativeSuper(Error)),ResponseError=function(e){function t(e,n,i,r){var a,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"ResponseError";return classCallCheck(this,t),(a=possibleConstructorReturn(this,getPrototypeOf(t).call(this,n||e.statusText))).name="ResponseError",a.data=i,a.response=e,a.request=r,a.type=s,a}return inherits(t,e),t}(wrapNativeSuper(Error));function readerGBK(e){return new Promise((function(t,n){var i=new FileReader;i.onload=function(){t(i.result)},i.onerror=n,i.readAsText(e,"GBK")}))}function safeJsonParse(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;try{return JSON.parse(t)}catch(e){if(n)throw new ResponseError(i,"JSON.parse fail",t,r,"ParseError")}return t}function timeout2Throw(e,t){return new Promise((function(n,i){setTimeout((function(){i(new RequestError("timeout of ".concat(e,"ms exceeded"),t,"Timeout"))}),e)}))}function cancel2Throw(e){return new Promise((function(t,n){e.cancelToken&&e.cancelToken.promise.then((function(e){n(e)}))}))}var toString$2=Object.prototype.toString;function getEnv(){var e;return"undefined"!=typeof process&&"[object process]"===toString$2.call(process)&&(e="NODE"),"undefined"!=typeof XMLHttpRequest&&(e="BROWSER"),e}function isArray$1(e){return"object"===_typeof_1(e)&&"[object Array]"===Object.prototype.toString.call(e)}function isURLSearchParams(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams}function isDate(e){return"object"===_typeof_1(e)&&"[object Date]"===Object.prototype.toString.call(e)}function isObject(e){return null!==e&&"object"===_typeof_1(e)}function forEach2ObjArr(e,t){if(e)if("object"!==_typeof_1(e)&&(e=[e]),isArray$1(e))for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=t.prefix,i=t.suffix;return n&&(e="".concat(n).concat(e)),i&&(e="".concat(e).concat(i)),{url:e,options:t}},warnedCoreType=!1;function __defaultValidateCache(e,t){var n=t.method;return"get"===(void 0===n?"get":n).toLowerCase()}function fetchMiddleware(e,t){if(!e)return t();var n=e.req,i=(n=void 0===n?{}:n).options,r=void 0===i?{}:i,a=n.url,s=void 0===a?"":a,o=e.cache,l=e.responseInterceptors,u=r.timeout,c=void 0===u?0:u,h=r.__umiRequestCoreType__,f=void 0===h?"normal":h,d=r.useCache,p=void 0!==d&&d,m=r.method,v=void 0===m?"get":m,g=r.params,y=r.ttl,b=r.validateCache,_=void 0===b?__defaultValidateCache:b;if("normal"!==f)return process&&process.env,t();var S=fetch;if(!S)throw new Error("Global fetch not exist!");var x,w="BROWSER"===getEnv(),k=_(s,r)&&p&&w;if(k){var E=o.get({url:s,params:g,method:v});if(E)return(E=E.clone()).useCache=!0,e.res=E,t()}return x=c>0?Promise.race([cancel2Throw(r),S(s,r),timeout2Throw(c,e.req)]):Promise.race([cancel2Throw(r),S(s,r)]),l.forEach((function(e){x=x.then((function(t){var n="function"==typeof t.clone?t.clone():t;return e(n,r)}))})),x.then((function(n){if(k&&200===n.status){var i=n.clone();i.useCache=!0,o.set({url:s,params:g,method:v},i,y)}return e.res=n,t()}))}function parseResponseMiddleware(t,n){var i;return n().then((function(){if(t){var n=t.res,r=void 0===n?{}:n,a=t.req,s=void 0===a?{}:a,o=(s||{}).options,l=(o=void 0===o?{}:o).responseType,u=void 0===l?"json":l,c=o.charset,h=void 0===c?"utf8":c;o.getResponse;var f=o.throwErrIfParseFail,d=void 0!==f&&f,p=o.parseResponse;if((void 0===p||p)&&r&&r.clone){if((i="BROWSER"===getEnv()?r.clone():r).useCache=r.useCache||!1,"gbk"===h)try{return r.blob().then(readerGBK).then((function(e){return safeJsonParse(e,!1,i,s)}))}catch(e){throw new ResponseError(i,e.message,null,s,"ParseError")}else if("json"===u)return r.text().then((function(e){return safeJsonParse(e,d,i,s)}));try{return r[u]()}catch(e){throw new ResponseError(i,"responseType not support",null,s,"ParseError")}}}})).then((function(e){if(t){t.res;var n=t.req,r=void 0===n?{}:n,a=(r||{}).options,s=(a=void 0===a?{}:a).getResponse,o=void 0!==s&&s;if(i){if(i.status>=200&&i.status<300)return o?void(t.res={data:e,response:i}):void(t.res=e);throw new ResponseError(i,"http error",e,r,"HttpError")}}})).catch((function(e){if(e instanceof RequestError||e instanceof ResponseError)throw e;var n=t.req,i=t.res;throw e.request=e.request||n,e.response=e.response||i,e.type=e.type||e.name,e.data=e.data||void 0,e}))}function simplePostMiddleware(e,t){if(!e)return t();var n=e.req,i=(n=void 0===n?{}:n).options,r=void 0===i?{}:i,a=r.method;if(-1===["post","put","patch","delete"].indexOf((void 0===a?"get":a).toLowerCase()))return t();var s=r.requestType,o=void 0===s?"json":s,l=r.data;if(l){var u=Object.prototype.toString.call(l);"[object Object]"===u||"[object Array]"===u?"json"===o?(r.headers=objectSpread({Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},r.headers),r.body=JSON.stringify(l)):"form"===o&&(r.headers=objectSpread({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},r.headers),r.body=reqStringify(l)):(r.headers=objectSpread({Accept:"application/json"},r.headers),r.body=l)}return e.req.options=r,t()}function paramsSerialize(e,t){var n,i;if(e)if(t)n=t(e);else if(isURLSearchParams(e))n=e.toString();else{if(isArray$1(e))i=[],forEach2ObjArr(e,(function(e){null==e?i.push(e):i.push(isObject(e)?JSON.stringify(e):e)})),n=reqStringify(i);else i={},forEach2ObjArr(e,(function(e,t){var n=e;null==e?i[t]=e:isDate(e)?n=e.toISOString():isArray$1(e)?n=e:isObject(e)&&(n=JSON.stringify(e)),i[t]=n})),n=reqStringify(i)}return n}function simpleGetMiddleware(e,t){if(!e)return t();var n=e.req,i=(n=void 0===n?{}:n).options,r=void 0===i?{}:i,a=r.paramsSerializer,s=r.params,o=e.req,l=(o=void 0===o?{}:o).url,u=void 0===l?"":l;r.method=r.method?r.method.toUpperCase():"GET",r.credentials=r.credentials||"same-origin";var c=paramsSerialize(s,a);if(e.req.originUrl=u,c){var h=-1!==u.indexOf("?")?"&":"?";e.req.url="".concat(u).concat(h).concat(c)}return e.req.options=r,t()}var globalMiddlewares=[simplePostMiddleware,simpleGetMiddleware,parseResponseMiddleware],coreMiddlewares=[fetchMiddleware];Onion.globalMiddlewares=globalMiddlewares,Onion.defaultGlobalMiddlewaresLength=globalMiddlewares.length,Onion.coreMiddlewares=coreMiddlewares,Onion.defaultCoreMiddlewaresLength=coreMiddlewares.length;var Core=function(){function t(e){classCallCheck(this,t),this.onion=new Onion([]),this.fetchIndex=0,this.mapCache=new MapCache(e),this.initOptions=e,this.instanceRequestInterceptors=[],this.instanceResponseInterceptors=[]}return createClass(t,[{key:"use",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{global:!1,core:!1};return this.onion.use(e,t),this}},{key:"extendOptions",value:function(e){this.initOptions=mergeRequestOptions(this.initOptions,e),this.mapCache.extendOptions(e)}},{key:"dealRequestInterceptors",value:function(e){return[].concat(toConsumableArray(t.requestInterceptors),toConsumableArray(this.instanceRequestInterceptors)).reduce((function(t,n){return t.then((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.req.url=t.url||e.req.url,e.req.options=t.options||e.req.options,n(e.req.url,e.req.options)}))}),Promise.resolve()).then((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.req.url=t.url||e.req.url,e.req.options=t.options||e.req.options,Promise.resolve()}))}},{key:"request",value:function(n,i){var r=this,a=this.onion,s={req:{url:n,options:i},res:null,cache:this.mapCache,responseInterceptors:[].concat(toConsumableArray(t.responseInterceptors),toConsumableArray(this.instanceResponseInterceptors))};if("string"!=typeof n)throw new Error("url MUST be a string");return new Promise((function(t,n){r.dealRequestInterceptors(s).then((function(){return a.execute(s)})).then((function(){t(s.res)})).catch((function(i){var r=s.req.options.errorHandler;if(r)try{var a=r(i);t(a)}catch(e){n(e)}else n(i)}))}))}}],[{key:"requestUse",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{global:!0};if("function"!=typeof e)throw new TypeError("Interceptor must be function!");n.global?t.requestInterceptors.push(e):this.instanceRequestInterceptors.push(e)}},{key:"responseUse",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{global:!0};if("function"!=typeof e)throw new TypeError("Interceptor must be function!");n.global?t.responseInterceptors.push(e):this.instanceResponseInterceptors.push(e)}}]),t}();function Cancel(e){this.message=e}function CancelToken(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new Cancel(e),t(n.reason))}))}function isCancel(e){return!(!e||!e.__CANCEL__)}Core.requestInterceptors=[addfix],Core.responseInterceptors=[],Cancel.prototype.toString=function(){return this.message?"Cancel: ".concat(this.message):"Cancel"},Cancel.prototype.__CANCEL__=!0,CancelToken.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},CancelToken.source=function(){var e,t=new CancelToken((function(t){e=t}));return{token:t,cancel:e}};var request$1=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new Core(e),n=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=mergeRequestOptions(t.initOptions,n);return t.request(e,i)};n.use=t.use.bind(t),n.fetchIndex=t.fetchIndex,n.interceptors={request:{use:Core.requestUse.bind(t)},response:{use:Core.responseUse.bind(t)}};var i=["get","post","delete","put","patch","head","options","rpc"];return i.forEach((function(e){n[e]=function(t,i){return n(t,objectSpread({},i,{method:e}))}})),n.Cancel=Cancel,n.CancelToken=CancelToken,n.isCancel=isCancel,n.extendOptions=t.extendOptions.bind(t),n.middlewares={instance:t.onion.middlewares,defaultInstance:t.onion.defaultMiddlewares,global:Onion.globalMiddlewares,core:Onion.coreMiddlewares},n},extend$1=function(e){return request$1(e)};request$1({parseResponse:!1});var request$1$1=exports("e",request$1({}));function clamp(e,t,n){return Math.min(Math.max(e,t),n)}function trimExtraChar(e,t,n){var i=e.indexOf(t);return-1===i?e:"-"===t&&0!==i?e.slice(0,i):e.slice(0,i+1)+e.slice(i).replace(n,"")}function formatNumber(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];e=t?trimExtraChar(e,".",/\./g):e.split(".")[0];var i=t?/[^-0-9.]/g:/[^-0-9]/g;return(e=n?trimExtraChar(e,"-",/-/g):e.replace(/-/,"")).replace(i,"")}function addNumber(e,t){var n=Math.pow(10,10);return Math.round((e+t)*n)/n}function isHidden(e){var t=unref(e);if(!t)return!1;var n=window.getComputedStyle(t),i="none"===n.display,r=null===t.offsetParent&&"fixed"!==n.position;return i||r}function stopPropagation(e){e.stopPropagation()}function preventDefault(e,t){("boolean"!=typeof e.cancelable||e.cancelable)&&e.preventDefault(),t&&stopPropagation(e)}function trigger(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function isWindow$1(e){return e===window}function getScrollTop(e){var t="scrollTop"in e?e.scrollTop:e.pageYOffset;return Math.max(t,0)}function setScrollTop(e,t){"scrollTop"in e?e.scrollTop=t:e.scrollTo(e.scrollX,t)}function getRootScrollTop(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0}function setRootScrollTop(e){setScrollTop(window,e),setScrollTop(document.body,e)}function getElementTop(e,t){if(isWindow$1(e))return 0;var n=t?getScrollTop(t):getRootScrollTop();return e.getBoundingClientRect().top+n}function getVisibleHeight(e){return isWindow$1(e)?e.innerHeight:e.getBoundingClientRect().height}function getVisibleTop(e){return isWindow$1(e)?0:e.getBoundingClientRect().top}var isIOS=isIOS$1();function resetScroll(){isIOS&&setRootScrollTop(getRootScrollTop())}var inBrowser="undefined"!=typeof window;function raf$2(e){return inBrowser?requestAnimationFrame(e):-1}function cancelRaf(e){inBrowser&&cancelAnimationFrame(e)}function doubleRaf(e){raf$2((function(){return raf$2(e)}))}var isWindow=function(e){return e===window},makeDOMRect=function(e,t){return{top:0,left:0,right:e,bottom:t,width:e,height:t}},useRect=exports("am",(function(e){var t=unref(e);if(isWindow(t)){var n=t.innerWidth,i=t.innerHeight;return makeDOMRect(n,i)}return(null==t?void 0:t.getBoundingClientRect)?t.getBoundingClientRect():makeDOMRect(0,0)})),width,height;function useToggle(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=ref(e),n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:!t.value;t.value=e};return[t,n]}function useParent(e){var t=inject(e,null);if(t){var n=getCurrentInstance(),i=t.link,r=t.unlink,a=t.internalChildren;return i(n),onUnmounted((function(){return r(n)})),{parent:t,index:computed((function(){return a.indexOf(n)}))}}return{parent:null,index:ref(-1)}}function flattenVNodes(e){var t=[];return function e(n){Array.isArray(n)&&n.forEach((function(n){var i;isVNode(n)&&(t.push(n),(null==(i=n.component)?void 0:i.subTree)&&e(n.component.subTree.children),n.children&&e(n.children))}))}(e),t}function sortChildren(e,t,n){var i=flattenVNodes(e.subTree.children);n.sort((function(e,t){return i.indexOf(e.vnode)-i.indexOf(t.vnode)}));var r=n.map((function(e){return e.proxy}));t.sort((function(e,t){return r.indexOf(e)-r.indexOf(t)}))}function useChildren(e){var t=reactive([]),n=reactive([]),i=getCurrentInstance();return{children:t,linkChildren:function(r){provide(e,Object.assign({link:function(e){e.proxy&&(n.push(e),t.push(e.proxy),sortChildren(i,t,n))},unlink:function(e){var i=n.indexOf(e);t.splice(i,1),n.splice(i,1)},children:t,internalChildren:n},r))}}}function onMountedOrActivated(e){var t;onMounted((function(){e(),nextTick((function(){t=!0}))})),onActivated((function(){t&&e()}))}function useEventListener(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(inBrowser){var i,r=n.target,a=void 0===r?window:r,s=n.passive,o=void 0!==s&&s,l=n.capture,u=void 0!==l&&l,c=function(n){var r=unref(n);r&&!i&&(r.addEventListener(e,t,{capture:u,passive:o}),i=!0)},h=function(n){var r=unref(n);r&&i&&(r.removeEventListener(e,t,u),i=!1)};onUnmounted((function(){return h(a)})),onDeactivated((function(){return h(a)})),onMountedOrActivated((function(){return c(a)})),isRef(a)&&watch(a,(function(e,t){h(t),c(e)}))}}function useClickAway(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(inBrowser){var i=n.eventName,r=void 0===i?"click":i,a=function(n){var i=unref(e);i&&!i.contains(n.target)&&t(n)};useEventListener(r,a,{target:document})}}function useWindowSize(){if(!width&&(width=ref(0),height=ref(0),inBrowser)){var e=function(){width.value=window.innerWidth,height.value=window.innerHeight};e(),window.addEventListener("resize",e,{passive:!0}),window.addEventListener("orientationchange",e,{passive:!0})}return{width:width,height:height}}var overflowScrollReg=/scroll|auto/i,defaultRoot=inBrowser?window:void 0,visibility;function isElement$1(e){return"HTML"!==e.tagName&&"BODY"!==e.tagName&&1===e.nodeType}function getScrollParent$1(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:defaultRoot,n=e;n&&n!==t&&isElement$1(n);){var i=window.getComputedStyle(n),r=i.overflowY;if(overflowScrollReg.test(r))return n;n=n.parentNode}return t}function useScrollParent(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:defaultRoot,n=ref();return onMounted((function(){e.value&&(n.value=getScrollParent$1(e.value,t))})),n}function usePageVisibility(){if(!visibility&&(visibility=ref("visible"),inBrowser)){var e=function(){visibility.value=document.hidden?"hidden":"visible"};e(),window.addEventListener("visibilitychange",e)}return visibility}var _createNamespace=createNamespace("action-bar"),_createNamespace2=_slicedToArray(_createNamespace,2),name$q=_createNamespace2[0],bem$q=_createNamespace2[1],ACTION_BAR_KEY=Symbol(name$q),_ActionBar=defineComponent({name:name$q,props:{safeAreaInsetBottom:truthProp},setup:function(e,t){var n=t.slots;return(0,useChildren(ACTION_BAR_KEY).linkChildren)(),function(){return createVNode("div",{class:bem$q({unfit:!e.safeAreaInsetBottom})},[null==n.default?void 0:n.default()])}}}),ActionBar=withInstall(_ActionBar);function useExpose(e){var t=getCurrentInstance();t&&extend$2(t.proxy,e)}var _createNamespace3=createNamespace("action-bar-button"),_createNamespace4=_slicedToArray(_createNamespace3,2),name$p=_createNamespace4[0],bem$p=_createNamespace4[1],_ActionBarButton=defineComponent({name:name$p,props:extend$2({},routeProps,{type:String,text:String,icon:String,color:String,loading:Boolean,disabled:Boolean}),setup:function(e,t){var n=t.slots,i=useRoute(),r=useParent(ACTION_BAR_KEY),a=r.parent,s=r.index,o=computed((function(){if(a){var e=a.children[s.value-1];return!(e&&"isButton"in e)}})),l=computed((function(){if(a){var e=a.children[s.value+1];return!(e&&"isButton"in e)}}));return useExpose({isButton:!0}),function(){var t=e.type,r=e.icon,a=e.text,s=e.color,u=e.loading,c=e.disabled;return createVNode(Button,{class:bem$p([t,{last:l.value,first:o.value}]),size:"large",type:t,icon:r,color:s,loading:u,disabled:c,onClick:i},{default:function(){return[n.default?n.default():a]}})}}}),ActionBarButton=withInstall(_ActionBarButton),popupSharedProps={show:Boolean,zIndex:[Number,String],overlay:truthProp,duration:[Number,String],teleport:[String,Object],lockScroll:truthProp,lazyRender:truthProp,overlayStyle:Object,overlayClass:unknownProp,transitionAppear:Boolean,closeOnClickOverlay:truthProp},popupSharedPropKeys=Object.keys(popupSharedProps),MIN_DISTANCE=10;function getDirection(e,t){return e>t&&e>MIN_DISTANCE?"horizontal":t>e&&t>MIN_DISTANCE?"vertical":""}function useTouch(){var e=ref(0),t=ref(0),n=ref(0),i=ref(0),r=ref(0),a=ref(0),s=ref(""),o=function(){n.value=0,i.value=0,r.value=0,a.value=0,s.value=""};return{move:function(o){var l=o.touches[0];n.value=l.clientX<0?0:l.clientX-e.value,i.value=l.clientY-t.value,r.value=Math.abs(n.value),a.value=Math.abs(i.value),s.value||(s.value=getDirection(r.value,a.value))},start:function(n){o(),e.value=n.touches[0].clientX,t.value=n.touches[0].clientY},reset:o,startX:e,startY:t,deltaX:n,deltaY:i,offsetX:r,offsetY:a,direction:s,isVertical:function(){return"vertical"===s.value},isHorizontal:function(){return"horizontal"===s.value}}}var totalLockCount=0,BODY_LOCK_CLASS="van-overflow-hidden";function useLockScroll(e,t){var n=useTouch(),i=function(t){n.move(t);var i=n.deltaY.value>0?"10":"01",r=getScrollParent$1(t.target,e.value),a=r.scrollHeight,s=r.offsetHeight,o=r.scrollTop,l="11";0===o?l=s>=a?"00":"01":o+s>=a&&(l="10"),"11"===l||!n.isVertical()||parseInt(l,2)&parseInt(i,2)||preventDefault(t,!0)},r=function(){document.addEventListener("touchstart",n.start),document.addEventListener("touchmove",i,{passive:!1}),totalLockCount||document.body.classList.add(BODY_LOCK_CLASS),totalLockCount++},a=function(){totalLockCount&&(document.removeEventListener("touchstart",n.start),document.removeEventListener("touchmove",i),--totalLockCount||document.body.classList.remove(BODY_LOCK_CLASS))},s=function(){t()&&a()};onMountedOrActivated((function(){t()&&r()})),onDeactivated(s),onBeforeUnmount(s),watch(t,(function(e){e?r():a()}))}function useLazyRender(e){var t=ref(!1);return watch(e,(function(e){e&&(t.value=e)}),{immediate:!0}),function(e){return function(){return t.value?e():null}}}var POPUP_TOGGLE_KEY=Symbol();function onPopupReopen(e){var t=inject(POPUP_TOGGLE_KEY,null);t&&watch(t,(function(t){t&&e()}))}var _createNamespace5=createNamespace("overlay"),_createNamespace6=_slicedToArray(_createNamespace5,2),name$o=_createNamespace6[0],bem$o=_createNamespace6[1],_Overlay=defineComponent({name:name$o,props:{show:Boolean,zIndex:[Number,String],duration:[Number,String],className:unknownProp,lockScroll:truthProp,customStyle:Object},setup:function(e,t){var n=t.slots,i=useLazyRender((function(){return e.show})),r=function(e){preventDefault(e,!0)},a=i((function(){var t=extend$2(getZIndexStyle(e.zIndex),e.customStyle);return isDef$1(e.duration)&&(t.animationDuration=e.duration+"s"),withDirectives(createVNode("div",{style:t,class:[bem$o(),e.className],onTouchmove:e.lockScroll?r:noop$2},[null==n.default?void 0:n.default()]),[[vShow,e.show]])}));return function(){return createVNode(Transition,{name:"van-fade"},{default:function(){return[a()]}})}}}),Overlay=withInstall(_Overlay),_createNamespace7=createNamespace("popup"),_createNamespace8=_slicedToArray(_createNamespace7,2),name$n=_createNamespace8[0],bem$n=_createNamespace8[1],globalZIndex=2e3,_Popup=defineComponent({name:name$n,inheritAttrs:!1,props:extend$2({},popupSharedProps,{round:Boolean,closeable:Boolean,transition:String,iconPrefix:String,closeOnPopstate:Boolean,safeAreaInsetBottom:Boolean,position:{type:String,default:"center"},closeIcon:{type:String,default:"cross"},closeIconPosition:{type:String,default:"top-right"}}),emits:["open","close","click","opened","closed","update:show","click-overlay","click-close-icon"],setup:function(e,t){var n,i,r=t.emit,a=t.attrs,s=t.slots,o=ref(),l=ref(),u=useLazyRender((function(){return e.show||!e.lazyRender})),c=computed((function(){var t={zIndex:o.value};isDef$1(e.duration)&&(t["center"===e.position?"animationDuration":"transitionDuration"]=e.duration+"s");return t})),h=function(){n||(void 0!==e.zIndex&&(globalZIndex=+e.zIndex),n=!0,o.value=++globalZIndex)},f=function(){n&&(n=!1,r("update:show",!1))},d=function(t){r("click-overlay",t),e.closeOnClickOverlay&&f()},p=function(){if(e.overlay)return createVNode(Overlay,{show:e.show,class:e.overlayClass,zIndex:o.value,duration:e.duration,customStyle:e.overlayStyle,onClick:d},{default:s["overlay-content"]})},m=function(e){r("click-close-icon",e),f()},v=function(){if(e.closeable)return createVNode(Icon,{role:"button",tabindex:0,name:e.closeIcon,class:bem$n("close-icon",e.closeIconPosition),classPrefix:e.iconPrefix,onClick:m},null)},g=function(e){return r("click",e)},y=function(){return r("opened")},b=function(){return r("closed")},_=u((function(){var t,n=e.round,i=e.position,r=e.safeAreaInsetBottom;return withDirectives(createVNode("div",mergeProps({ref:l,style:c.value,class:bem$n((t={round:n},_defineProperty2(t,i,i),_defineProperty2(t,"safe-area-inset-bottom",r),t)),onClick:g},a),[null==s.default?void 0:s.default(),v()]),[[vShow,e.show]])})),S=function(){var t=e.position,n=e.transition,i=e.transitionAppear;return createVNode(Transition,{name:n||("center"===t?"van-fade":"van-popup-slide-"+t),appear:i,onAfterEnter:y,onAfterLeave:b},{default:function(){return[_()]}})};return watch((function(){return e.show}),(function(e){e?(h(),r("open")):(f(),r("close"))})),useExpose({popupRef:l}),useLockScroll(l,(function(){return e.show&&e.lockScroll})),useEventListener("popstate",(function(){e.closeOnPopstate&&(f(),i=!1)})),onMounted((function(){e.show&&h()})),onActivated((function(){i&&(r("update:show",!0),i=!1)})),onDeactivated((function(){e.show&&(f(),i=!0)})),provide(POPUP_TOGGLE_KEY,(function(){return e.show})),function(){return e.teleport?createVNode(Teleport,{to:e.teleport},{default:function(){return[p(),S()]}}):createVNode(Fragment,null,[p(),S()])}}}),Popup=exports("P",withInstall(_Popup)),_createNamespace9=createNamespace("cell"),_createNamespace10=_slicedToArray(_createNamespace9,2),name$m=_createNamespace10[0],bem$m=_createNamespace10[1],cellProps={icon:String,size:String,title:[Number,String],value:[Number,String],label:[Number,String],center:Boolean,isLink:Boolean,border:truthProp,required:Boolean,iconPrefix:String,valueClass:unknownProp,labelClass:unknownProp,titleClass:unknownProp,titleStyle:null,arrowDirection:String,clickable:{type:Boolean,default:null}},_Cell=defineComponent({name:name$m,props:extend$2({},cellProps,routeProps),setup:function(e,t){var n=t.slots,i=useRoute(),r=function(){if(n.label||isDef$1(e.label))return createVNode("div",{class:[bem$m("label"),e.labelClass]},[n.label?n.label():e.label])},a=function(){if(n.title||isDef$1(e.title))return createVNode("div",{class:[bem$m("title"),e.titleClass],style:e.titleStyle},[n.title?n.title():createVNode("span",null,[e.title]),r()])},s=function(){if(n.default||isDef$1(e.value)){var t=n.title||isDef$1(e.title);return createVNode("div",{class:[bem$m("value",{alone:!t}),e.valueClass]},[n.default?n.default():createVNode("span",null,[e.value])])}},o=function(){if(n["right-icon"])return n["right-icon"]();if(e.isLink){var t=e.arrowDirection?"arrow-"+e.arrowDirection:"arrow";return createVNode(Icon,{name:t,class:bem$m("right-icon")},null)}};return function(){var t,r=e.size,l=e.center,u=e.border,c=e.isLink,h=e.required,f=null!=(t=e.clickable)?t:c,d={center:l,required:h,clickable:f,borderless:!u};return r&&(d[r]=!!r),createVNode("div",{class:bem$m(d),role:f?"button":void 0,tabindex:f?0:void 0,onClick:i},[n.icon?n.icon():e.icon?createVNode(Icon,{name:e.icon,class:bem$m("left-icon"),classPrefix:e.iconPrefix},null):void 0,a(),s(),o(),null==n.extra?void 0:n.extra()])}}}),Cell=exports("a4",withInstall(_Cell));function isEmptyValue(e){return Array.isArray(e)?!e.length:0!==e&&!e}function runSyncRule(e,t){return(!t.required||!isEmptyValue(e))&&!(t.pattern&&!t.pattern.test(String(e)))}function runRuleValidator(e,t){return new Promise((function(n){var i=t.validator(e,t);if(isPromise(i))return i.then(n);n(i)}))}function getRuleMessage(e,t){var n=t.message;return isFunction$1(n)?n(e,t):n||""}function startComposing(e){e.target.composing=!0}function endComposing(e){var t=e.target;t.composing&&(t.composing=!1,trigger(t,"input"))}function resizeTextarea(e,t){e.style.height="auto";var n=e.scrollHeight;if(isObject$1(t)){var i=t.maxHeight,r=t.minHeight;void 0!==i&&(n=Math.min(n,i)),void 0!==r&&(n=Math.max(n,r))}n&&(e.style.height=n+"px")}function mapInputType(e){return"number"===e?{type:"text",inputmode:"decimal"}:"digit"===e?{type:"tel",inputmode:"numeric"}:{type:e}}var FORM_KEY=Symbol("van-form"),FIELD_KEY=Symbol("van-field");function useLinkField(e){var t=inject(FIELD_KEY,null);t&&!t.childFieldValue.value&&(t.childFieldValue.value=e,watch(e,(function(){t.resetValidation(),t.validateWithTrigger("onChange")})))}var _createNamespace11=createNamespace("field"),_createNamespace12=_slicedToArray(_createNamespace11,2),name$l=_createNamespace12[0],bem$l=_createNamespace12[1],fieldProps=exports("b0",{formatter:Function,leftIcon:String,rightIcon:String,autofocus:Boolean,clearable:Boolean,maxlength:[Number,String],inputAlign:String,placeholder:String,errorMessage:String,error:{type:Boolean,default:null},disabled:{type:Boolean,default:null},readonly:{type:Boolean,default:null},clearIcon:{type:String,default:"clear"},modelValue:{type:[Number,String],default:""},clearTrigger:{type:String,default:"focus"},formatTrigger:{type:String,default:"onChange"}}),_Field=defineComponent({name:name$l,props:extend$2({},cellProps,fieldProps,{rows:[Number,String],name:String,rules:Array,autosize:[Boolean,Object],labelWidth:[Number,String],labelClass:unknownProp,labelAlign:String,autocomplete:String,showWordLimit:Boolean,errorMessageAlign:String,type:{type:String,default:"text"},colon:{type:Boolean,default:null}}),emits:["blur","focus","clear","keypress","click-input","click-left-icon","click-right-icon","update:modelValue"],setup:function(e,t){var n=t.emit,i=t.slots,r=reactive({focused:!1,validateFailed:!1,validateMessage:""}),a=ref(),s=ref(),o=useParent(FORM_KEY).parent,l=function(){var t;return String(null!=(t=e.modelValue)?t:"")},u=function(t){return isDef$1(e[t])?e[t]:o&&isDef$1(o.props[t])?o.props[t]:void 0},c=computed((function(){var t=u("readonly");if(e.clearable&&!t){var n=""!==l(),i="always"===e.clearTrigger||"focus"===e.clearTrigger&&r.focused;return n&&i}return!1})),h=computed((function(){return s.value&&i.input?s.value():e.modelValue})),f=function(e){return e.reduce((function(e,t){return e.then((function(){if(!r.validateFailed){var e=h.value;return t.formatter&&(e=t.formatter(e,t)),runSyncRule(e,t)?t.validator?runRuleValidator(e,t).then((function(n){n&&"string"==typeof n?(r.validateFailed=!0,r.validateMessage=n):!1===n&&(r.validateFailed=!0,r.validateMessage=getRuleMessage(e,t))})):void 0:(r.validateFailed=!0,void(r.validateMessage=getRuleMessage(e,t)))}}))}),Promise.resolve())},d=function(){r.validateFailed&&(r.validateFailed=!1,r.validateMessage="")},p=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.rules;return new Promise((function(n){d(),t?f(t).then((function(){r.validateFailed?n({name:e.name,message:r.validateMessage}):n()})):n()}))},m=function(t){if(o&&e.rules){var n=o.props.validateTrigger===t,i=e.rules.filter((function(e){return e.trigger?e.trigger===t:n}));i.length&&p(i)}},v=function(t){var n=e.maxlength;if(isDef$1(n)&&t.length>n){var i=l();return i&&i.length===+n?i:t.slice(0,+n)}return t},g=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"onChange";if(t=v(t),"number"===e.type||"digit"===e.type){var r="number"===e.type;t=formatNumber(t,r,r)}e.formatter&&i===e.formatTrigger&&(t=e.formatter(t)),a.value&&a.value.value!==t&&(a.value.value=t),t!==e.modelValue&&n("update:modelValue",t)},y=function(e){e.target.composing||g(e.target.value)},b=function(){var e;return null==(e=a.value)?void 0:e.blur()},_=function(e){r.focused=!0,n("focus",e),u("readonly")&&b()},S=function(e){r.focused=!1,g(l(),"onBlur"),n("blur",e),m("onBlur"),resetScroll()},x=function(e){return n("click-input",e)},w=function(e){return n("click-left-icon",e)},k=function(e){return n("click-right-icon",e)},E=function(e){preventDefault(e),n("update:modelValue",""),n("clear",e)},T=computed((function(){return"boolean"==typeof e.error?e.error:!!(o&&o.props.showError&&r.validateFailed)||void 0})),P=computed((function(){var e=u("labelWidth");if(e)return{width:addUnit(e)}})),A=function(t){13===t.keyCode&&(o&&o.props.submitOnEnter||"textarea"===e.type||preventDefault(t),"search"===e.type&&b());n("keypress",t)},C=function(){var t=a.value;"textarea"===e.type&&e.autosize&&t&&resizeTextarea(t,e.autosize)},M=function(){var t=u("inputAlign");if(i.input)return createVNode("div",{class:bem$l("control",[t,"custom"]),onClick:x},[i.input()]);var n={ref:a,name:e.name,rows:void 0!==e.rows?+e.rows:void 0,class:bem$l("control",t),value:e.modelValue,disabled:u("disabled"),readonly:u("readonly"),autofocus:e.autofocus,placeholder:e.placeholder,autocomplete:e.autocomplete,onBlur:S,onFocus:_,onInput:y,onClick:x,onChange:endComposing,onKeypress:A,onCompositionend:endComposing,onCompositionstart:startComposing};return"textarea"===e.type?createVNode("textarea",n,null):createVNode("input",mergeProps(mapInputType(e.type),n),null)},I=function(){var t=i["right-icon"];if(e.rightIcon||t)return createVNode("div",{class:bem$l("right-icon"),onClick:k},[t?t():createVNode(Icon,{name:e.rightIcon,classPrefix:e.iconPrefix},null)])},N=function(){if(e.showWordLimit&&e.maxlength){var t=l().length;return createVNode("div",{class:bem$l("word-limit")},[createVNode("span",{class:bem$l("word-num")},[t]),createTextVNode("/"),e.maxlength])}},L=function(){if(!o||!1!==o.props.showErrorMessage){var t=e.errorMessage||r.validateMessage;if(t){var n=u("errorMessageAlign");return createVNode("div",{class:bem$l("error-message",n)},[t])}}};return useExpose({blur:b,focus:function(){var e;return null==(e=a.value)?void 0:e.focus()},validate:p,formValue:h,resetValidation:d}),provide(FIELD_KEY,{childFieldValue:s,resetValidation:d,validateWithTrigger:m}),watch((function(){return e.modelValue}),(function(){g(l()),d(),m("onChange"),nextTick(C)})),onMounted((function(){g(l(),e.formatTrigger),nextTick(C)})),function(){var t,n,r=u("disabled"),a=u("labelAlign"),s=(n=u("colon")?":":"",i.label?[i.label(),n]:e.label?createVNode("span",null,[e.label+n]):void 0),o=function(){var t=i["left-icon"];if(e.leftIcon||t)return createVNode("div",{class:bem$l("left-icon"),onClick:w},[t?t():createVNode(Icon,{name:e.leftIcon,classPrefix:e.iconPrefix},null)])}();return createVNode(Cell,{size:e.size,icon:e.leftIcon,class:bem$l((t={error:T.value,disabled:r},_defineProperty2(t,"label-"+a,a),_defineProperty2(t,"min-height","textarea"===e.type&&!e.autosize),t)),center:e.center,border:e.border,isLink:e.isLink,required:e.required,clickable:e.clickable,titleStyle:P.value,valueClass:bem$l("value"),titleClass:[bem$l("label",a),e.labelClass],arrowDirection:e.arrowDirection},{default:function(){return[createVNode("div",{class:bem$l("body")},[M(),c.value&&createVNode(Icon,{name:e.clearIcon,class:bem$l("clear"),onTouchstart:E},null),I(),i.button&&createVNode("div",{class:bem$l("button")},[i.button()])]),N(),L()]},icon:o?function(){return o}:null,title:s?function(){return s}:null,extra:i.extra})}}}),Field=exports("aA",withInstall(_Field));function usePopupState(){var e=reactive({show:!1}),t=function(t){e.show=t},n=function(n){extend$2(e,n),nextTick((function(){return t(!0)}))},i=function(){return t(!1)};return useExpose({open:n,close:i,toggle:t}),{open:n,close:i,state:e,toggle:t}}function mountComponent(e){var t=createApp(e),n=document.createElement("div");return document.body.appendChild(n),{instance:t.mount(n),unmount:function(){t.unmount(),document.body.removeChild(n)}}}var lockCount=0;function lockClick(e){e?(lockCount||document.body.classList.add("van-toast--unclickable"),lockCount++):lockCount&&(--lockCount||document.body.classList.remove("van-toast--unclickable"))}var _createNamespace13=createNamespace("toast"),_createNamespace14=_slicedToArray(_createNamespace13,2),name$k=_createNamespace14[0],bem$k=_createNamespace14[1],VanToast=defineComponent({name:name$k,props:{icon:String,show:Boolean,overlay:Boolean,message:[Number,String],iconSize:[Number,String],className:unknownProp,iconPrefix:String,loadingType:String,forbidClick:Boolean,overlayClass:unknownProp,overlayStyle:Object,closeOnClick:Boolean,closeOnClickOverlay:Boolean,type:{type:String,default:"text"},duration:{type:Number,default:2e3},position:{type:String,default:"middle"},transition:{type:String,default:"van-fade"}},emits:["update:show"],setup:function(e,t){var n,i=t.emit,r=!1,a=function(){var t=e.show&&e.forbidClick;r!==t&&lockClick(r=t)},s=function(e){return i("update:show",e)},o=function(){e.closeOnClick&&s(!1)},l=function(){clearTimeout(n)},u=function(){var t=e.icon,n=e.type,i=e.iconSize,r=e.iconPrefix,a=e.loadingType;return t||"success"===n||"fail"===n?createVNode(Icon,{name:t||n,size:i,class:bem$k("icon"),classPrefix:r},null):"loading"===n?createVNode(Loading,{class:bem$k("loading"),size:i,type:a},null):void 0},c=function(){var t=e.type,n=e.message;if(isDef$1(n)&&""!==n)return"html"===t?createVNode("div",{class:bem$k("text"),innerHTML:String(n)},null):createVNode("div",{class:bem$k("text")},[n])};return watch((function(){return[e.show,e.forbidClick]}),a),watch((function(){return[e.show,e.type,e.message,e.duration]}),(function(){l(),e.show&&e.duration>0&&(n=setTimeout((function(){s(!1)}),e.duration))})),onMounted(a),onUnmounted(a),function(){return createVNode(Popup,mergeProps({show:e.show,class:[bem$k([e.position,_defineProperty2({},e.type,!e.icon)]),e.className],overlay:e.overlay,lockScroll:!1,transition:e.transition,overlayClass:e.overlayClass,overlayStyle:e.overlayStyle,closeOnClickOverlay:e.closeOnClickOverlay,onClick:o,onClosed:l},{"onUpdate:show":s}),{default:function(){return[u(),c()]}})}}}),defaultOptions={icon:"",type:"text",message:"",className:"",overlay:!1,onClose:void 0,onOpened:void 0,duration:2e3,teleport:"body",iconSize:void 0,iconPrefix:void 0,position:"middle",transition:"van-fade",forbidClick:!1,loadingType:void 0,overlayClass:"",overlayStyle:void 0,closeOnClick:!1,closeOnClickOverlay:!1},queue$1=[],allowMultiple=!1,currentOptions=extend$2({},defaultOptions),defaultOptionsMap={};function parseOptions(e){return isObject$1(e)?e:{message:e}}function createInstance(){var e=mountComponent({setup:function(){var e=ref(""),i=usePopupState(),r=i.open,a=i.state,s=i.close,o=i.toggle,l=function(){allowMultiple&&(queue$1=queue$1.filter((function(e){return e!==t})),n())};return getCurrentInstance().render=function(){var t={onClosed:l,"onUpdate:show":o};return e.value&&(t.message=e.value),createVNode(VanToast,mergeProps(a,t),null)},{open:r,clear:s,message:e}}}),t=e.instance,n=e.unmount;return t}function getInstance(){if(!queue$1.length||allowMultiple){var e=createInstance();queue$1.push(e)}return queue$1[queue$1.length-1]}function Toast(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!inBrowser$1)return{};var t=getInstance(),n=parseOptions(e);return t.open(extend$2({},currentOptions,defaultOptionsMap[n.type||currentOptions.type],n)),t}var createMethod=function(e){return function(t){return Toast(extend$2({type:e},parseOptions(t)))}};function setDefaultOptions(e,t){"string"==typeof e?defaultOptionsMap[e]=t:extend$2(currentOptions,e)}function callInterceptor(e){var t=e.interceptor,n=e.args,i=e.done,r=e.canceled;if(t){var a=t.apply(null,n||[]);isPromise(a)?a.then((function(e){e?i():r&&r()})).catch(noop$2):a?i():r&&r()}else i()}Toast.loading=createMethod("loading"),Toast.success=createMethod("success"),Toast.fail=createMethod("fail"),Toast.clear=function(e){queue$1.length&&(e?(queue$1.forEach((function(e){e.clear()})),queue$1=[]):allowMultiple?queue$1.shift().clear():queue$1[0].clear())},Toast.setDefaultOptions=setDefaultOptions,Toast.resetDefaultOptions=function(e){"string"==typeof e?defaultOptionsMap[e]=null:(currentOptions=extend$2({},defaultOptions),defaultOptionsMap={})},Toast.allowMultiple=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];allowMultiple=e},Toast.install=function(e){e.use(withInstall(VanToast)),e.config.globalProperties.$toast=Toast};var _createNamespace15=createNamespace("dialog"),_createNamespace16=_slicedToArray(_createNamespace15,3),name$j=_createNamespace16[0],bem$j=_createNamespace16[1],t$1=_createNamespace16[2],popupKeys=[].concat(_toConsumableArray2(popupSharedPropKeys),["transition","closeOnPopstate"]),VanDialog=defineComponent({name:name$j,props:extend$2({},popupSharedProps,{title:String,theme:String,width:[Number,String],message:[String,Function],callback:Function,allowHtml:Boolean,className:unknownProp,beforeClose:Function,messageAlign:String,closeOnPopstate:truthProp,showCancelButton:Boolean,cancelButtonText:String,cancelButtonColor:String,confirmButtonText:String,confirmButtonColor:String,showConfirmButton:truthProp,closeOnClickOverlay:Boolean,transition:{type:String,default:"van-dialog-bounce"}}),emits:["confirm","cancel","update:show"],setup:function(e,t){var n=t.emit,i=t.slots,r=reactive({confirm:!1,cancel:!1}),a=function(e){return n("update:show",e)},s=function(t){a(!1),e.callback&&e.callback(t)},o=function(t){return function(){e.show&&(n(t),e.beforeClose?(r[t]=!0,callInterceptor({interceptor:e.beforeClose,args:[t],done:function(){s(t),r[t]=!1},canceled:function(){r[t]=!1}})):s(t))}},l=o("cancel"),u=o("confirm"),c=function(){var t=i.title?i.title():e.title;if(t)return createVNode("div",{class:bem$j("header",{isolated:!e.message&&!i.default})},[t])},h=function(t){var n=e.message,i=e.allowHtml,r=e.messageAlign,a=bem$j("message",_defineProperty2({"has-title":t},r,r)),s=isFunction$1(n)?n():n;return i&&"string"==typeof s?createVNode("div",{class:a,innerHTML:s},null):createVNode("div",{class:a},[s])},f=function(){if(i.default)return createVNode("div",{class:bem$j("content")},[i.default()]);var t=e.title,n=e.message,r=e.allowHtml;if(n){var a=!(!t&&!i.title);return createVNode("div",{key:r?1:0,class:bem$j("content",{isolated:!a})},[h(a)])}},d=function(){return i.footer?i.footer():"round-button"===e.theme?createVNode(ActionBar,{class:bem$j("footer")},{default:function(){return[e.showCancelButton&&createVNode(ActionBarButton,{type:"warning",text:e.cancelButtonText||t$1("cancel"),class:bem$j("cancel"),color:e.cancelButtonColor,loading:r.cancel,onClick:l},null),e.showConfirmButton&&createVNode(ActionBarButton,{type:"danger",text:e.confirmButtonText||t$1("confirm"),class:bem$j("confirm"),color:e.confirmButtonColor,loading:r.confirm,onClick:u},null)]}}):createVNode("div",{class:[BORDER_TOP,bem$j("footer")]},[e.showCancelButton&&createVNode(Button,{size:"large",text:e.cancelButtonText||t$1("cancel"),class:bem$j("cancel"),style:{color:e.cancelButtonColor},loading:r.cancel,onClick:l},null),e.showConfirmButton&&createVNode(Button,{size:"large",text:e.confirmButtonText||t$1("confirm"),class:[bem$j("confirm"),_defineProperty2({},BORDER_LEFT,e.showCancelButton)],style:{color:e.confirmButtonColor},loading:r.confirm,onClick:u},null)])};return function(){var t=e.width,n=e.title,i=e.theme,r=e.message,s=e.className;return createVNode(Popup,mergeProps({role:"dialog",class:[bem$j([i]),s],style:{width:addUnit(t)},"aria-labelledby":n||r},pick(e,popupKeys),{"onUpdate:show":a}),{default:function(){return[c(),f(),d()]}})}}}),instance;function initInstance(){var e={setup:function(){var e=usePopupState(),t=e.state,n=e.toggle;return function(){return createVNode(VanDialog,mergeProps(t,{"onUpdate:show":n}),null)}}},t=mountComponent(e);instance=t.instance}function Dialog(e){return inBrowser$1?new Promise((function(t,n){instance||initInstance(),instance.open(extend$2({},Dialog.currentOptions,e,{callback:function(e){("confirm"===e?t:n)(e)}}))})):Promise.resolve()}Dialog.defaultOptions={title:"",width:"",theme:null,message:"",overlay:!0,callback:null,teleport:"body",className:"",allowHtml:!1,lockScroll:!0,transition:"van-dialog-bounce",beforeClose:null,overlayClass:"",overlayStyle:void 0,messageAlign:"",cancelButtonText:"",cancelButtonColor:null,confirmButtonText:"",confirmButtonColor:null,showConfirmButton:!0,showCancelButton:!1,closeOnPopstate:!0,closeOnClickOverlay:!1},Dialog.currentOptions=extend$2({},Dialog.defaultOptions),Dialog.alert=Dialog,Dialog.confirm=function(e){return Dialog(extend$2({showCancelButton:!0},e))},Dialog.close=function(){instance&&instance.toggle(!1)},Dialog.setDefaultOptions=function(e){extend$2(Dialog.currentOptions,e)},Dialog.resetDefaultOptions=function(){Dialog.currentOptions=extend$2({},Dialog.defaultOptions)},Dialog.install=function(e){e.use(withInstall(VanDialog)),e.config.globalProperties.$dialog=Dialog},Dialog.Component=withInstall(VanDialog);var _createNamespace17=createNamespace("switch"),_createNamespace18=_slicedToArray(_createNamespace17,2),name$i=_createNamespace18[0],bem$i=_createNamespace18[1],_Switch=defineComponent({name:name$i,props:{size:[Number,String],loading:Boolean,disabled:Boolean,modelValue:unknownProp,activeColor:String,inactiveColor:String,activeValue:{type:unknownProp,default:!0},inactiveValue:{type:unknownProp,default:!1}},emits:["change","update:modelValue"],setup:function(e,t){var n=t.emit,i=function(){return e.modelValue===e.activeValue},r=function(){if(!e.disabled&&!e.loading){var t=i()?e.inactiveValue:e.activeValue;n("update:modelValue",t),n("change",t)}},a=function(){if(e.loading){var t=i()?e.activeColor:e.inactiveColor;return createVNode(Loading,{class:bem$i("loading"),color:t},null)}};return useLinkField((function(){return e.modelValue})),function(){var t=e.size,n=e.loading,s=e.disabled,o=e.activeColor,l=e.inactiveColor,u=i(),c={fontSize:addUnit(t),backgroundColor:u?o:l};return createVNode("div",{role:"switch",class:bem$i({on:u,loading:n,disabled:s}),style:c,"aria-checked":u,onClick:r},[createVNode("div",{class:bem$i("node")},[a()])])}}}),Switch=exports("aN",withInstall(_Switch)),_createNamespace19=createNamespace("radio-group"),_createNamespace20=_slicedToArray(_createNamespace19,2),name$h=_createNamespace20[0],bem$h=_createNamespace20[1],RADIO_KEY=Symbol(name$h),props$4={disabled:Boolean,iconSize:[Number,String],direction:String,modelValue:unknownProp,checkedColor:String},_RadioGroup=defineComponent({name:name$h,props:props$4,emits:["change","update:modelValue"],setup:function(e,t){var n=t.emit,i=t.slots,r=useChildren(RADIO_KEY).linkChildren;return watch((function(){return e.modelValue}),(function(e){return n("change",e)})),r({props:e,updateValue:function(e){return n("update:modelValue",e)}}),useLinkField((function(){return e.modelValue})),function(){return createVNode("div",{class:bem$h([e.direction]),role:"radiogroup"},[null==i.default?void 0:i.default()])}}}),RadioGroup=withInstall(_RadioGroup),checkerProps={name:unknownProp,disabled:Boolean,iconSize:[Number,String],modelValue:unknownProp,checkedColor:String,labelPosition:String,labelDisabled:Boolean,shape:{type:String,default:"round"}},Checker=defineComponent({props:extend$2({},checkerProps,{role:String,parent:Object,checked:Boolean,bindGroup:truthProp,bem:{type:Function,required:!0}}),emits:["click","toggle"],setup:function(e,t){var n=t.emit,i=t.slots,r=ref(),a=function(t){if(e.parent&&e.bindGroup)return e.parent.props[t]},s=computed((function(){return a("disabled")||e.disabled})),o=computed((function(){return a("direction")})),l=computed((function(){var t=e.checkedColor||a("checkedColor");if(t&&e.checked&&!s.value)return{borderColor:t,backgroundColor:t}})),u=function(t){var i=t.target,a=r.value,o=a===i||a.contains(i);s.value||!o&&e.labelDisabled||n("toggle"),n("click",t)},c=function(){var t=e.bem,n=e.shape,o=e.checked,u=e.iconSize||a("iconSize");return createVNode("div",{ref:r,class:t("icon",[n,{disabled:s.value,checked:o}]),style:{fontSize:addUnit(u)}},[i.icon?i.icon({checked:o,disabled:s.value}):createVNode(Icon,{name:"success",style:l.value},null)])},h=function(){if(i.default)return createVNode("span",{class:e.bem("label",[e.labelPosition,{disabled:s.value}])},[i.default()])};return function(){var t=[c()];return"left"===e.labelPosition?t.unshift(h()):t.push(h()),createVNode("div",{role:e.role,class:e.bem([{disabled:s.value,"label-disabled":e.labelDisabled},o.value]),tabindex:s.value?-1:0,"aria-checked":e.checked,onClick:u},[t])}}}),_createNamespace21=createNamespace("radio"),_createNamespace22=_slicedToArray(_createNamespace21,2),name$g=_createNamespace22[0],bem$g=_createNamespace22[1],_Radio=defineComponent({name:name$g,props:checkerProps,emits:["update:modelValue"],setup:function(e,t){var n=t.emit,i=t.slots,r=useParent(RADIO_KEY).parent,a=function(){r?r.updateValue(e.name):n("update:modelValue",e.name)};return function(){return createVNode(Checker,mergeProps({bem:bem$g,role:"radio",parent:r,checked:(r?r.props.modelValue:e.modelValue)===e.name,onToggle:a},e),pick(i,["default","icon"]))}}}),Radio=withInstall(_Radio),rafId;function useRefs(){var e=ref([]);onBeforeUpdate((function(){e.value=[]}));return[e,function(t){return function(n){e.value[t]=n}}]}function scrollLeftTo(e,t,n){cancelRaf(rafId);var i=0,r=e.scrollLeft,a=0===n?1:Math.round(1e3*n/16);!function n(){e.scrollLeft+=(t-r)/a,++it||!a&&rt?raf$2(n):i&&raf$2(i)}()}function useVisibilityChange(e,t){if(inBrowser$1&&window.IntersectionObserver){var n=new IntersectionObserver((function(e){t(e[0].intersectionRatio>0)}),{root:document.body}),i=function(){e.value&&n.unobserve(e.value)};onDeactivated(i),onBeforeUnmount(i),onMountedOrActivated((function(){e.value&&n.observe(e.value)}))}}var _createNamespace23=createNamespace("sticky"),_createNamespace24=_slicedToArray(_createNamespace23,2),name$f=_createNamespace24[0],bem$f=_createNamespace24[1],_Sticky=defineComponent({name:name$f,props:{zIndex:[Number,String],container:Object,offsetTop:{type:[Number,String],default:0},offsetBottom:{type:[Number,String],default:0},position:{type:String,default:"top"}},emits:["scroll","change"],setup:function(e,t){var n=t.emit,i=t.slots,r=ref(),a=useScrollParent(r),s=reactive({fixed:!1,width:0,height:0,transform:0}),o=computed((function(){return unitToPx("top"===e.position?e.offsetTop:e.offsetBottom)})),l=computed((function(){var e=s.fixed,t=s.height,n=s.width;if(e)return{width:n+"px",height:t+"px"}})),u=computed((function(){if(s.fixed){var t=extend$2(getZIndexStyle(e.zIndex),_defineProperty2({width:s.width+"px",height:s.height+"px"},e.position,o.value+"px"));return s.transform&&(t.transform="translate3d(0, "+s.transform+"px, 0)"),t}})),c=function(){if(r.value&&!isHidden(r)){var t=e.container,i=e.position,a=useRect(r),l=getScrollTop(window);if(s.width=a.width,s.height=a.height,"top"===i)if(t){var u=useRect(t),c=u.bottom-o.value-s.height;s.fixed=o.value>a.top&&u.bottom>0,s.transform=c<0?c:0}else s.fixed=o.value>a.top;else{var h=document.documentElement.clientHeight;if(t){var f=useRect(t),d=h-f.top-o.value-s.height;s.fixed=h-o.valuef.top,s.transform=d<0?-d:0}else s.fixed=h-o.value1&&void 0!==arguments[1]?arguments[1]:0,i=t*p.value;e.loop||(i=Math.min(i,-v.value));var r=n-i;return e.loop||(r=clamp(r,v.value,0)),r},w=function(t){var n=t.pace,i=void 0===n?0:n,a=t.offset,s=void 0===a?0:a,l=t.emitChange;if(!(d.value<=1)){var u=o.active,c=function(t){var n=o.active;return t?e.loop?clamp(n+t,-1,d.value):clamp(n+t,0,g.value):n}(i),f=x(c,s);if(e.loop){if(h[0]&&f!==v.value){var p=f0;h[d.value-1].setOffset(m?-y.value:0)}}o.active=c,o.offset=f,l&&c!==u&&r("change",b.value)}},k=function(){o.swiping=!0,o.active<=-1?w({pace:d.value}):o.active>=d.value&&w({pace:-d.value})},E=function(){k(),l.reset(),doubleRaf((function(){o.swiping=!1,w({pace:1,emitChange:!0})}))},T=function(){return clearTimeout(n)},P=function t(){T(),e.autoplay>0&&d.value>1&&(n=setTimeout((function(){E(),t()}),+e.autoplay))},A=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:+e.initialSwipe;if(s.value){if(!isHidden(s)){var n,i,r={width:s.value.offsetWidth,height:s.value.offsetHeight};o.rect=r,o.width=+(null!=(n=e.width)?n:r.width),o.height=+(null!=(i=e.height)?i:r.height)}d.value&&(t=Math.min(d.value-1,t)),o.active=t,o.swiping=!0,o.offset=x(t),h.forEach((function(e){e.setOffset(0)}))}},C=function(){return A(o.active)},M=function(t){e.touchable&&(l.start(t),i=Date.now(),T(),k())},I=function(t){e.touchable&&o.swiping&&(l.move(t),_.value&&(preventDefault(t,e.stopPropagation),w({offset:m.value})))},N=function(){if(e.touchable&&o.swiping){var t=Date.now()-i,n=m.value/t;if((Math.abs(n)>.25||Math.abs(m.value)>p.value/2)&&_.value){var r=e.vertical?l.offsetY.value:l.offsetX.value,a=0;a=e.loop?r>0?m.value>0?-1:1:0:-Math[m.value>0?"ceil":"floor"](m.value/p.value),w({pace:a,emitChange:!0})}else m.value&&w({pace:0});o.swiping=!1,P()}},L=function(t,n){var i=n===b.value,r=i?{backgroundColor:e.indicatorColor}:void 0;return createVNode("i",{style:r,class:bem$d("indicator",{active:i})},null)};return useExpose({prev:function(){k(),l.reset(),doubleRaf((function(){o.swiping=!1,w({pace:-1,emitChange:!0})}))},next:E,state:o,resize:C,swipeTo:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k(),l.reset(),doubleRaf((function(){var i;i=e.loop&&t===d.value?0===o.active?0:t:t%d.value,n.immediate?doubleRaf((function(){o.swiping=!1})):o.swiping=!1,w({pace:i-o.active,emitChange:!0})}))}}),f({size:p,props:e,count:d,activeIndicator:b}),watch((function(){return e.initialSwipe}),(function(e){return A(+e)})),watch(d,(function(){return A(o.active)})),watch([d,function(){return e.autoplay}],P),watch([u.width,u.height],C),watch(usePageVisibility(),(function(e){"visible"===e?P():T()})),onMounted(A),onActivated((function(){return A(o.active)})),onPopupReopen((function(){return A(o.active)})),onDeactivated(T),onBeforeUnmount(T),function(){return createVNode("div",{ref:s,class:bem$d()},[createVNode("div",{style:S.value,class:bem$d("track",{vertical:e.vertical}),onTouchstart:M,onTouchmove:I,onTouchend:N,onTouchcancel:N},[null==a.default?void 0:a.default()]),a.indicator?a.indicator({active:b.value}):e.showIndicators&&d.value>1?createVNode("div",{class:bem$d("indicators",{vertical:e.vertical})},[Array(d.value).fill("").map(L)]):void 0])}}}),Swipe=exports("aw",withInstall(_Swipe)),_createNamespace29=createNamespace("tabs"),_createNamespace30=_slicedToArray(_createNamespace29,2),name$c=_createNamespace30[0],bem$c=_createNamespace30[1],TabsContent=defineComponent({name:name$c,props:{inited:Boolean,animated:Boolean,swipeable:Boolean,lazyRender:Boolean,count:{type:Number,required:!0},duration:{type:[Number,String],required:!0},currentIndex:{type:Number,required:!0}},emits:["change"],setup:function(e,t){var n=t.emit,i=t.slots,r=ref(),a=function(e){return n("change",e)},s=function(){var t=null==i.default?void 0:i.default();return e.animated||e.swipeable?createVNode(Swipe,{ref:r,loop:!1,class:bem$c("track"),duration:1e3*+e.duration,touchable:e.swipeable,lazyRender:e.lazyRender,showIndicators:!1,onChange:a},{default:function(){return[t]}}):t},o=function(t){var n=r.value;n&&n.state.active!==t&&n.swipeTo(t,{immediate:!e.inited})};return watch((function(){return e.currentIndex}),o),onMounted((function(){o(e.currentIndex)})),function(){return createVNode("div",{class:bem$c("content",{animated:e.animated||e.swipeable})},[s()])}}}),_createNamespace31=createNamespace("tabs"),_createNamespace32=_slicedToArray(_createNamespace31,2),name$b=_createNamespace32[0],bem$b=_createNamespace32[1],TABS_KEY=Symbol(name$b),props$2={color:String,border:Boolean,sticky:Boolean,animated:Boolean,ellipsis:truthProp,swipeable:Boolean,scrollspy:Boolean,background:String,lazyRender:truthProp,lineWidth:[Number,String],lineHeight:[Number,String],beforeChange:Function,titleActiveColor:String,titleInactiveColor:String,type:{type:String,default:"line"},active:{type:[Number,String],default:0},duration:{type:[Number,String],default:.3},offsetTop:{type:[Number,String],default:0},swipeThreshold:{type:[Number,String],default:5}},_Tabs=defineComponent({name:name$b,props:props$2,emits:["click","change","scroll","disabled","rendered","update:active"],setup:function(e,t){var n,i,r,a=t.emit,s=t.slots,o=ref(),l=ref(),u=ref(),c=useWindowSize(),h=useScrollParent(o),f=_slicedToArray(useRefs(),2),d=f[0],p=f[1],m=useChildren(TABS_KEY),v=m.children,g=m.linkChildren,y=reactive({inited:!1,position:"",lineStyle:{},currentIndex:-1}),b=computed((function(){return v.length>e.swipeThreshold||!e.ellipsis})),_=computed((function(){return{borderColor:e.color,background:e.background}})),S=function(e,t){var n;return null!=(n=e.name)?n:t},x=computed((function(){var e=v[y.currentIndex];if(e)return S(e,y.currentIndex)})),w=computed((function(){return unitToPx(e.offsetTop)})),k=computed((function(){return e.sticky?w.value+n:0})),E=function(t){var n=l.value,i=d.value;if(b.value&&n&&i&&i[y.currentIndex]){var r=i[y.currentIndex].$el;scrollLeftTo(n,r.offsetLeft-(n.offsetWidth-r.offsetWidth)/2,t?0:+e.duration)}},T=function(){var t=y.inited;nextTick((function(){var n=d.value;if(n&&n[y.currentIndex]&&"line"===e.type&&!isHidden(o.value)){var i=n[y.currentIndex].$el,r=e.lineWidth,a=e.lineHeight,s=i.offsetLeft+i.offsetWidth/2,l={width:addUnit(r),backgroundColor:e.color,transform:"translateX("+s+"px) translateX(-50%)"};if(t&&(l.transitionDuration=e.duration+"s"),isDef$1(a)){var u=addUnit(a);l.height=u,l.borderRadius=u}y.lineStyle=l}}))},P=function(t){var n=function(e){for(var t=e=0&&e0&&void 0!==arguments[0]&&arguments[0];if(e.scrollspy){var n=v[y.currentIndex].$el;if(n&&h.value){var r=getElementTop(n,h.value)-k.value;i=!0,scrollTopTo(h.value,r,t?0:+e.duration,(function(){i=!1}))}}},M=function(e){r=e.isFixed,a("scroll",e)},I=function(){return v.map((function(t,n){return createVNode(TabsTitle,{ref:p(n),dot:t.dot,type:e.type,badge:t.badge,title:t.title,color:e.color,style:t.titleStyle,class:t.titleClass,isActive:n===y.currentIndex,disabled:t.disabled,scrollable:b.value,renderTitle:t.$slots.title,activeColor:e.titleActiveColor,inactiveColor:e.titleInactiveColor,onClick:function(){!function(t,n){var i=v[n],r=i.title,s=i.disabled,o=S(v[n],n);s?a("disabled",o,r):(callInterceptor({interceptor:e.beforeChange,args:[o],done:function(){P(n),C()}}),a("click",o,r),route(t))}(t,n)}},null)}))},N=function(){var t,n,i=e.type,r=e.border;return createVNode("div",{ref:u,class:[bem$b("wrap",{scrollable:b.value}),_defineProperty2({},BORDER_TOP_BOTTOM,"line"===i&&r)]},[createVNode("div",{ref:l,role:"tablist",class:bem$b("nav",[i,{complete:b.value}]),style:_.value},[null==(t=s["nav-left"])?void 0:t.call(s),I(),"line"===i&&createVNode("div",{class:bem$b("line"),style:y.lineStyle},null),null==(n=s["nav-right"])?void 0:n.call(s)])])};watch([function(){return e.color},c.width],T),watch((function(){return e.active}),(function(e){e!==x.value&&A(e)})),watch((function(){return v.length}),(function(){y.inited&&(A(e.active),T(),nextTick((function(){E(!0)})))})),watch((function(){return y.currentIndex}),(function(){E(),T(),r&&!e.scrollspy&&setRootScrollTop(Math.ceil(getElementTop(o.value)-w.value))}));return useExpose({resize:T,scrollTo:function(e){nextTick((function(){A(e),C(!0)}))}}),onActivated(T),onPopupReopen(T),onMountedOrActivated((function(){A(e.active),nextTick((function(){y.inited=!0,n=getVisibleHeight(u.value),E(!0)}))})),useEventListener("scroll",(function(){if(e.scrollspy&&!i){var t=function(){for(var e=0;ek.value)return 0===e?0:e-1;return v.length-1}();P(t)}}),{target:h}),g({props:e,setLine:T,onRendered:function(e,t){return a("rendered",e,t)},currentName:x,scrollIntoView:E}),function(){return createVNode("div",{ref:o,class:bem$b([e.type])},[e.sticky?createVNode(Sticky,{container:o.value,offsetTop:w.value,onScroll:M},{default:function(){return[N()]}}):N(),createVNode(TabsContent,{count:v.length,inited:y.inited,animated:e.animated,duration:e.duration,swipeable:e.swipeable,lazyRender:e.lazyRender,currentIndex:y.currentIndex,onChange:P},{default:function(){return[null==s.default?void 0:s.default()]}})])}}}),TAB_STATUS_KEY=Symbol();function useTabStatus(){return inject(TAB_STATUS_KEY,null)}var _createNamespace33=createNamespace("swipe-item"),_createNamespace34=_slicedToArray(_createNamespace33,2),name$a=_createNamespace34[0],bem$a=_createNamespace34[1],_SwipeItem=defineComponent({name:name$a,setup:function(e,t){var n,i=t.slots,r=reactive({offset:0,inited:!1,mounted:!1}),a=useParent(SWIPE_KEY),s=a.parent,o=a.index;if(s){var l=computed((function(){var e={},t=s.props.vertical;return s.size.value&&(e[t?"height":"width"]=s.size.value+"px"),r.offset&&(e.transform="translate"+(t?"Y":"X")+"("+r.offset+"px)"),e})),u=computed((function(){var e=s.props,t=e.loop;if(!e.lazyRender||n)return!0;if(!r.mounted)return!1;var i=s.activeIndicator.value,a=s.count.value-1,l=0===i&&t?a:i-1,u=i===a&&t?0:i+1;return n=o.value===i||o.value===l||o.value===u}));return onMounted((function(){nextTick((function(){r.mounted=!0}))})),useExpose({setOffset:function(e){r.offset=e}}),function(){return createVNode("div",{class:bem$a(),style:l.value},[u.value?null==i.default?void 0:i.default():null])}}}}),SwipeItem=exports("as",withInstall(_SwipeItem)),_createNamespace35=createNamespace("tab"),_createNamespace36=_slicedToArray(_createNamespace35,2),name$9=_createNamespace36[0],bem$9=_createNamespace36[1],_Tab=defineComponent({name:name$9,props:extend$2({},routeProps,{dot:Boolean,name:[Number,String],badge:[Number,String],title:String,disabled:Boolean,titleClass:unknownProp,titleStyle:[String,Object]}),setup:function(e,t){var n=t.slots,i=ref(!1),r=useParent(TABS_KEY),a=r.parent,s=r.index;if(a){var o=function(){var t;return null!=(t=e.name)?t:s.value},l=computed((function(){var t=o()===a.currentName.value;return t&&!i.value&&(i.value=!0,a.props.lazyRender&&nextTick((function(){a.onRendered(o(),e.title)}))),t}));return watch((function(){return e.title}),(function(){a.setLine(),a.scrollIntoView()})),provide(TAB_STATUS_KEY,l),function(){var e=a.props,t=e.animated,r=e.swipeable,s=e.scrollspy,o=e.lazyRender;if(n.default||t){var u=s||l.value;if(t||r)return createVNode(SwipeItem,{role:"tabpanel","aria-hidden":!l.value,class:bem$9("pane-wrapper",{inactive:!l.value})},{default:function(){return[createVNode("div",{class:bem$9("pane")},[null==n.default?void 0:n.default()])]}});var c=i.value||s||!o?null==n.default?void 0:n.default():null;return withDirectives(createVNode("div",{role:"tabpanel",class:bem$9("pane")},[c]),[[vShow,u]])}}}}}),Tab=exports("X",withInstall(_Tab)),Tabs=exports("W",withInstall(_Tabs)),_createNamespace37=createNamespace("cell-group"),_createNamespace38=_slicedToArray(_createNamespace37,2),name$8=_createNamespace38[0],bem$8=_createNamespace38[1],_CellGroup=defineComponent({name:name$8,inheritAttrs:!1,props:{title:String,inset:Boolean,border:truthProp},setup:function(e,t){var n=t.slots,i=t.attrs,r=function(){return createVNode("div",mergeProps({class:[bem$8({inset:e.inset}),_defineProperty2({},BORDER_TOP_BOTTOM,e.border&&!e.inset)]},i),[null==n.default?void 0:n.default()])};return function(){return e.title||n.title?createVNode(Fragment,null,[createVNode("div",{class:bem$8("title",{inset:e.inset})},[n.title?n.title():e.title]),r()]):r()}}}),CellGroup=exports("a3",withInstall(_CellGroup)),_createNamespace39=createNamespace("row"),_createNamespace40=_slicedToArray(_createNamespace39,2),name$7=_createNamespace40[0],bem$7=_createNamespace40[1],ROW_KEY=Symbol(name$7),_Row=defineComponent({name:name$7,props:{wrap:truthProp,align:String,justify:String,tag:{type:String,default:"div"},gutter:{type:[Number,String],default:0}},setup:function(e,t){var n=t.slots,i=useChildren(ROW_KEY),r=i.children,a=i.linkChildren,s=computed((function(){var e=[[]],t=0;return r.forEach((function(n,i){(t+=Number(n.span))>24?(e.push([i]),t-=24):e[e.length-1].push(i)})),e})),o=computed((function(){var t=Number(e.gutter),n=[];return t?(s.value.forEach((function(e){var i=t*(e.length-1)/e.length;e.forEach((function(e,r){if(0===r)n.push({right:i});else{var a=t-n[e-1].right,s=i-a;n.push({left:a,right:s})}}))})),n):n}));return a({spaces:o}),function(){var t,i=e.tag,r=e.wrap,a=e.align,s=e.justify;return createVNode(i,{class:bem$7((t={},_defineProperty2(t,"align-"+a,a),_defineProperty2(t,"justify-"+s,s),_defineProperty2(t,"nowrap",!r),t))},{default:function(){return[null==n.default?void 0:n.default()]}})}}}),_createNamespace41=createNamespace("col"),_createNamespace42=_slicedToArray(_createNamespace41,2),name$6=_createNamespace42[0],bem$6=_createNamespace42[1],_Col=defineComponent({name:name$6,props:{offset:[Number,String],tag:{type:String,default:"div"},span:{type:[Number,String],default:0}},setup:function(e,t){var n=t.slots,i=useParent(ROW_KEY),r=i.parent,a=i.index,s=computed((function(){if(r){var e=r.spaces;if(e&&e.value&&e.value[a.value]){var t=e.value[a.value],n=t.left,i=t.right;return{paddingLeft:n?n+"px":null,paddingRight:i?i+"px":null}}}}));return function(){var t,i=e.tag,r=e.span,a=e.offset;return createVNode(i,{style:s.value,class:bem$6((t={},_defineProperty2(t,r,r),_defineProperty2(t,"offset-"+a,a),t))},{default:function(){return[null==n.default?void 0:n.default()]}})}}}),Col=withInstall(_Col),_createNamespace43=createNamespace("divider"),_createNamespace44=_slicedToArray(_createNamespace43,2),name$5=_createNamespace44[0],bem$5=_createNamespace44[1],_Divider=defineComponent({name:name$5,props:{dashed:Boolean,hairline:truthProp,contentPosition:{type:String,default:"center"}},setup:function(e,t){var n=t.slots;return function(){return createVNode("div",{role:"separator",class:bem$5(_defineProperty2({dashed:e.dashed,hairline:e.hairline},"content-"+e.contentPosition,!!n.default))},[null==n.default?void 0:n.default()])}}}),Divider=withInstall(_Divider),_createNamespace45=createNamespace("grid"),_createNamespace46=_slicedToArray(_createNamespace45,2),name$4=_createNamespace46[0],bem$4=_createNamespace46[1],GRID_KEY=Symbol(name$4),props$1={square:Boolean,center:truthProp,border:truthProp,gutter:[Number,String],reverse:Boolean,iconSize:[Number,String],direction:String,clickable:Boolean,columnNum:{type:[Number,String],default:4}},_Grid=defineComponent({name:name$4,props:props$1,setup:function(e,t){var n=t.slots;return(0,useChildren(GRID_KEY).linkChildren)({props:e}),function(){return createVNode("div",{style:{paddingLeft:addUnit(e.gutter)},class:[bem$4(),_defineProperty2({},BORDER_TOP,e.border&&!e.gutter)]},[null==n.default?void 0:n.default()])}}}),Grid=exports("G",withInstall(_Grid)),_createNamespace47=createNamespace("grid-item"),_createNamespace48=_slicedToArray(_createNamespace47,2),name$3=_createNamespace48[0],bem$3=_createNamespace48[1],_GridItem=defineComponent({name:name$3,props:extend$2({},routeProps,{dot:Boolean,text:String,icon:String,badge:[Number,String],iconPrefix:String,iconColor:String}),setup:function(e,t){var n=t.slots,i=useParent(GRID_KEY),r=i.parent,a=i.index,s=useRoute();if(r){var o=computed((function(){var e=r.props,t=e.square,n=e.gutter,i=e.columnNum,s=100/+i+"%",o={flexBasis:s};if(t)o.paddingTop=s;else if(n){var l=addUnit(n);o.paddingRight=l,a.value>=i&&(o.marginTop=l)}return o})),l=computed((function(){var e=r.props,t=e.square,n=e.gutter;if(t&&n){var i=addUnit(n);return{right:i,bottom:i,height:"auto"}}}));return function(){var t=r.props,i=t.center,a=t.border,u=t.square,c=t.gutter,h=t.reverse,f=t.direction,d=t.clickable,p=[bem$3("content",[f,{center:i,square:u,reverse:h,clickable:d,surround:a&&c}]),_defineProperty2({},BORDER,a)];return createVNode("div",{class:[bem$3({square:u})],style:o.value},[createVNode("div",{role:d?"button":void 0,class:p,style:l.value,tabindex:d?0:void 0,onClick:s},[n.default?n.default():[n.icon?createVNode(Badge,{dot:e.dot,content:e.badge},{default:function(){return[n.icon()]}}):e.icon?createVNode(Icon,{dot:e.dot,name:e.icon,size:r.props.iconSize,badge:e.badge,class:bem$3("icon"),classPrefix:e.iconPrefix,color:e.iconColor},null):void 0,n.text?n.text():e.text?createVNode("span",{class:bem$3("text")},[e.text]):void 0]])])}}}}),GridItem=exports("a",withInstall(_GridItem)),_createNamespace49=createNamespace("notice-bar"),_createNamespace50=_slicedToArray(_createNamespace49,2),name$2=_createNamespace50[0],bem$2=_createNamespace50[1],_NoticeBar=defineComponent({name:name$2,props:{text:String,mode:String,color:String,leftIcon:String,wrapable:Boolean,background:String,scrollable:{type:Boolean,default:null},delay:{type:[Number,String],default:1},speed:{type:[Number,String],default:60}},emits:["close","replay"],setup:function(e,t){var n,i=t.emit,r=t.slots,a=0,s=0,o=ref(),l=ref(),u=reactive({show:!0,offset:0,duration:0}),c=function(t){"closeable"===e.mode&&(u.show=!1,i("close",t))},h=function(){if(r["right-icon"])return r["right-icon"]();var t="closeable"===e.mode?"cross":"link"===e.mode?"arrow":void 0;return t?createVNode(Icon,{name:t,class:bem$2("right-icon"),onClick:c},null):void 0},f=function(){u.offset=a,u.duration=0,raf$2((function(){doubleRaf((function(){u.offset=-s,u.duration=(s+a)/+e.speed,i("replay")}))}))},d=function(){var t=e.delay,i=e.speed,r=e.scrollable,c=isDef$1(t)?1e3*+t:0;a=0,s=0,u.offset=0,u.duration=0,clearTimeout(n),n=setTimeout((function(){if(o.value&&l.value&&!1!==r){var e=useRect(o).width,t=useRect(l).width;(r||t>e)&&doubleRaf((function(){a=e,s=t,u.offset=-s,u.duration=s/+i}))}}),c)};return onPopupReopen(d),onMountedOrActivated(d),useEventListener("pageshow",d),watch((function(){return[e.text,e.scrollable]}),d),function(){var t,n,i=e.color,a=e.wrapable,s=e.background;return withDirectives(createVNode("div",{role:"alert",class:bem$2({wrapable:a}),style:{color:i,background:s}},[r["left-icon"]?r["left-icon"]():e.leftIcon?createVNode(Icon,{class:bem$2("left-icon"),name:e.leftIcon},null):void 0,(t=!1===e.scrollable&&!e.wrapable,n={transform:u.offset?"translateX("+u.offset+"px)":"",transitionDuration:u.duration+"s"},createVNode("div",{ref:o,role:"marquee",class:bem$2("wrap")},[createVNode("div",{ref:l,style:n,class:[bem$2("content"),{"van-ellipsis":t}],onTransitionend:f},[r.default?r.default():e.text])])),h()]),[[vShow,u.show]])}}}),NoticeBar=exports("N",withInstall(_NoticeBar));function getBoundingClientRect(e){var t=e.getBoundingClientRect();return{width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left,x:t.left,y:t.top}}function getWindow(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function getWindowScroll(e){var t=getWindow(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function isElement(e){return e instanceof getWindow(e).Element||e instanceof Element}function isHTMLElement(e){return e instanceof getWindow(e).HTMLElement||e instanceof HTMLElement}function isShadowRoot(e){return"undefined"!=typeof ShadowRoot&&(e instanceof getWindow(e).ShadowRoot||e instanceof ShadowRoot)}function getHTMLElementScroll(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function getNodeScroll(e){return e!==getWindow(e)&&isHTMLElement(e)?getHTMLElementScroll(e):getWindowScroll(e)}function getNodeName(e){return e?(e.nodeName||"").toLowerCase():null}function getDocumentElement(e){return((isElement(e)?e.ownerDocument:e.document)||window.document).documentElement}function getWindowScrollBarX(e){return getBoundingClientRect(getDocumentElement(e)).left+getWindowScroll(e).scrollLeft}function getComputedStyle(e){return getWindow(e).getComputedStyle(e)}function isScrollParent(e){var t=getComputedStyle(e),n=t.overflow,i=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function getCompositeRect(e,t,n){void 0===n&&(n=!1);var i=getDocumentElement(t),r=getBoundingClientRect(e),a=isHTMLElement(t),s={scrollLeft:0,scrollTop:0},o={x:0,y:0};return(a||!a&&!n)&&(("body"!==getNodeName(t)||isScrollParent(i))&&(s=getNodeScroll(t)),isHTMLElement(t)?((o=getBoundingClientRect(t)).x+=t.clientLeft,o.y+=t.clientTop):i&&(o.x=getWindowScrollBarX(i))),{x:r.left+s.scrollLeft-o.x,y:r.top+s.scrollTop-o.y,width:r.width,height:r.height}}function getLayoutRect(e){var t=getBoundingClientRect(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function getParentNode(e){return"html"===getNodeName(e)?e:e.assignedSlot||e.parentNode||(isShadowRoot(e)?e.host:null)||getDocumentElement(e)}function getScrollParent(e){return["html","body","#document"].indexOf(getNodeName(e))>=0?e.ownerDocument.body:isHTMLElement(e)&&isScrollParent(e)?e:getScrollParent(getParentNode(e))}function listScrollParents(e,t){var n;void 0===t&&(t=[]);var i=getScrollParent(e),r=i===(null==(n=e.ownerDocument)?void 0:n.body),a=getWindow(i),s=r?[a].concat(a.visualViewport||[],isScrollParent(i)?i:[]):i,o=t.concat(s);return r?o:o.concat(listScrollParents(getParentNode(s)))}function isTableElement(e){return["table","td","th"].indexOf(getNodeName(e))>=0}function getTrueOffsetParent(e){return isHTMLElement(e)&&"fixed"!==getComputedStyle(e).position?e.offsetParent:null}function getContainingBlock(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&isHTMLElement(e)&&"fixed"===getComputedStyle(e).position)return null;for(var n=getParentNode(e);isHTMLElement(n)&&["html","body"].indexOf(getNodeName(n))<0;){var i=getComputedStyle(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}function getOffsetParent(e){for(var t=getWindow(e),n=getTrueOffsetParent(e);n&&isTableElement(n)&&"static"===getComputedStyle(n).position;)n=getTrueOffsetParent(n);return n&&("html"===getNodeName(n)||"body"===getNodeName(n)&&"static"===getComputedStyle(n).position)?t:n||getContainingBlock(e)||t}var top$1="top",bottom$1="bottom",right="right",left$1="left",auto="auto",basePlacements=[top$1,bottom$1,right,left$1],start$4="start",end="end",placements=[].concat(basePlacements,[auto]).reduce((function(e,t){return e.concat([t,t+"-"+start$4,t+"-"+end])}),[]),beforeRead="beforeRead",read="read",afterRead="afterRead",beforeMain="beforeMain",main="main",afterMain="afterMain",beforeWrite="beforeWrite",write="write",afterWrite="afterWrite",modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];function order(e){var t=new Map,n=new Set,i=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var i=t.get(e);i&&r(i)}})),i.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||r(e)})),i}function orderModifiers(e){var t=order(e);return modifierPhases.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}function debounce(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}function getBasePlacement(e){return e.split("-")[0]}function mergeByName(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}var round=Math.round;function getVariation(e){return e.split("-")[1]}function getMainAxisFromPlacement(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function computeOffsets(e){var t,n=e.reference,i=e.element,r=e.placement,a=r?getBasePlacement(r):null,s=r?getVariation(r):null,o=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2;switch(a){case top$1:t={x:o,y:n.y-i.height};break;case bottom$1:t={x:o,y:n.y+n.height};break;case right:t={x:n.x+n.width,y:l};break;case left$1:t={x:n.x-i.width,y:l};break;default:t={x:n.x,y:n.y}}var u=a?getMainAxisFromPlacement(a):null;if(null!=u){var c="y"===u?"height":"width";switch(s){case start$4:t[u]=t[u]-(n[c]/2-i[c]/2);break;case end:t[u]=t[u]+(n[c]/2-i[c]/2)}}return t}var DEFAULT_OPTIONS={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var e=arguments.length,t=new Array(e),n=0;n=0?-1:1,a="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=a[0],o=a[1];return s=s||0,o=(o||0)*r,[left$1,right].indexOf(i)>=0?{x:o,y:s}:{x:s,y:o}}function offset(e){var t=e.state,n=e.options,i=e.name,r=n.offset,a=void 0===r?[0,0]:r,s=placements.reduce((function(e,n){return e[n]=distanceAndSkiddingToXY(n,t.rects,a),e}),{}),o=s[t.placement],l=o.x,u=o.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[i]=s}var offset$1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:offset},_createNamespace51=createNamespace("popover"),_createNamespace52=_slicedToArray(_createNamespace51,2),name$1=_createNamespace52[0],bem$1=_createNamespace52[1],popupProps=["show","overlay","duration","teleport","overlayStyle","overlayClass","closeOnClickOverlay"],_Popover=defineComponent({name:name$1,props:{show:Boolean,overlay:Boolean,duration:[Number,String],iconPrefix:String,overlayClass:unknownProp,overlayStyle:Object,closeOnClickAction:truthProp,closeOnClickOverlay:truthProp,closeOnClickOutside:truthProp,offset:{type:Array,default:function(){return[0,8]}},theme:{type:String,default:"light"},trigger:{type:String,default:"click"},actions:{type:Array,default:function(){return[]}},placement:{type:String,default:"bottom"},teleport:{type:[String,Object],default:"body"}},emits:["select","touchstart","update:show"],setup:function(e,t){var n,i=t.emit,r=t.slots,a=t.attrs,s=ref(),o=ref(),l=function(){nextTick((function(){e.show&&(n?n.setOptions({placement:e.placement}):n=createPopper(s.value,o.value.popupRef.value,{placement:e.placement,modifiers:[{name:"computeStyles",options:{adaptive:!1,gpuAcceleration:!1}},extend$2({},offset$1,{options:{offset:e.offset}})]}))}))},u=function(e){return i("update:show",e)},c=function(){"click"===e.trigger&&u(!e.show)},h=function(e){e.stopPropagation(),i("touchstart",e)},f=function(t,n){var r=t.icon,a=t.text,s=t.color,o=t.disabled,l=t.className;return createVNode("div",{role:"menuitem",class:[bem$1("action",{disabled:o,"with-icon":r}),l],style:{color:s},onClick:function(){return function(t,n){t.disabled||(i("select",t,n),e.closeOnClickAction&&u(!1))}(t,n)}},[r&&createVNode(Icon,{name:r,classPrefix:e.iconPrefix,class:bem$1("action-icon")},null),createVNode("div",{class:[bem$1("action-text"),BORDER_BOTTOM]},[a])])};return onMounted(l),onBeforeUnmount((function(){n&&(n.destroy(),n=null)})),watch((function(){return[e.show,e.placement]}),l),useClickAway(s,(function(){!e.closeOnClickOutside||e.overlay&&!e.closeOnClickOverlay||u(!1)}),{eventName:"touchstart"}),function(){return createVNode(Fragment,null,[createVNode("span",{ref:s,class:bem$1("wrapper"),onClick:c},[null==r.reference?void 0:r.reference()]),createVNode(Popup,mergeProps({ref:o,class:bem$1([e.theme]),position:"",transition:"van-popover-zoom",lockScroll:!1,onTouchstart:h},a,pick(e,popupProps),{"onUpdate:show":u}),{default:function(){return[createVNode("div",{class:bem$1("arrow")},null),createVNode("div",{role:"menu",class:bem$1("content")},[r.default?r.default():e.actions.map(f)])]}})])}}}),Popover=exports("aE",withInstall(_Popover)),Row=withInstall(_Row),_createNamespace53=createNamespace("slider"),_createNamespace54=_slicedToArray(_createNamespace53,2),name=_createNamespace54[0],bem=_createNamespace54[1],_Slider=defineComponent({name:name,props:{range:Boolean,disabled:Boolean,readonly:Boolean,vertical:Boolean,barHeight:[Number,String],buttonSize:[Number,String],activeColor:String,inactiveColor:String,min:{type:[Number,String],default:0},max:{type:[Number,String],default:100},step:{type:[Number,String],default:1},modelValue:{type:[Number,Array],default:0}},emits:["change","drag-end","drag-start","update:modelValue"],setup:function(e,t){var n,i,r,a=t.emit,s=t.slots,o=ref(),l=ref(),u=useTouch(),c=computed((function(){return Number(e.max)-Number(e.min)})),h=computed((function(){var t=e.vertical?"width":"height";return _defineProperty2({background:e.inactiveColor},t,addUnit(e.barHeight))})),f=function(t){return!!e.range&&Array.isArray(t)},d=function(){var t=e.modelValue,n=e.min;return f(t)?100*(t[0]-Number(n))/c.value+"%":"0%"},p=computed((function(){var t,n,i;return _defineProperty2(t={},e.vertical?"height":"width",(n=e.modelValue,i=e.min,f(n)?100*(n[1]-n[0])/c.value+"%":100*(n-Number(i))/c.value+"%")),_defineProperty2(t,"left",e.vertical?void 0:d()),_defineProperty2(t,"top",e.vertical?d():void 0),_defineProperty2(t,"background",e.activeColor),_defineProperty2(t,"transition",l.value?"none":void 0),t})),m=function(t){var n=+e.min,i=+e.max,r=+e.step;return t=clamp(t,n,i),addNumber(n,Math.round((t-n)/r)*r)},v=function(e,t){return JSON.stringify(e)===JSON.stringify(t)},g=function(t,n){t=f(t)?function(e){return e[0]>e[1]?e.slice(0).reverse():e}(t).map(m):m(t),v(t,e.modelValue)||a("update:modelValue",t),n&&!v(t,i)&&a("change",t)},y=function(t){if(t.stopPropagation(),!e.disabled&&!e.readonly){var n=e.min,i=e.vertical,r=e.modelValue,a=useRect(o),s=i?t.clientY-a.top:t.clientX-a.left,l=i?a.height:a.width,u=Number(n)+s/l*c.value;if(f(r)){var h=_slicedToArray(r,2),d=h[0],p=h[1];g(u<=(d+p)/2?[u,p]:[d,u],!0)}else g(u,!0)}},b=function(t){e.disabled||e.readonly||(u.start(t),r=e.modelValue,i=f(r)?r.map(m):m(r),l.value="start")},_=function(t){if(!e.disabled&&!e.readonly){"start"===l.value&&a("drag-start"),preventDefault(t,!0),u.move(t),l.value="draging";var s=useRect(o),h=(e.vertical?u.deltaY.value:u.deltaX.value)/(e.vertical?s.height:s.width)*c.value;f(i)?r[n]=i[n]+h:r=i+h,g(r)}},S=function(){e.disabled||e.readonly||("draging"===l.value&&(g(r,!0),a("drag-end")),l.value="")},x=function(t){var i="number"==typeof t?e.modelValue[t]:e.modelValue;return createVNode("div",{role:"slider",class:bem(function(){if("number"==typeof t){return"button-wrapper-"+["left","right"][t]}return"button-wrapper"}()),tabindex:e.disabled||e.readonly?-1:0,"aria-valuemin":+e.min,"aria-valuenow":i,"aria-valuemax":+e.max,"aria-orientation":e.vertical?"vertical":"horizontal",onTouchstart:function(e){"number"==typeof t&&(n=t),b(e)},onTouchmove:_,onTouchend:S,onTouchcancel:S,onClick:stopPropagation},[s.button?s.button():createVNode("div",{class:bem("button"),style:getSizeStyle(e.buttonSize)},null)])};return g(e.modelValue),useLinkField((function(){return e.modelValue})),function(){return createVNode("div",{ref:o,style:h.value,class:bem({vertical:e.vertical,disabled:e.disabled}),onClick:y},[createVNode("div",{class:bem("bar"),style:p.value},[e.range?[x(0),x(1)]:x()])])}}}),Slider=withInstall(_Slider),lodash_isempty={exports:{}};!function(t,n){var i=9007199254740991,r="[object Map]",a="[object Promise]",s="[object Set]",o="[object WeakMap]",l="[object DataView]",u=/^\[object .+?Constructor\]$/,c="object"==_typeof3(commonjsGlobal$1)&&commonjsGlobal$1&&commonjsGlobal$1.Object===Object&&commonjsGlobal$1,h="object"==("undefined"==typeof self?"undefined":_typeof3(self))&&self&&self.Object===Object&&self,f=c||h||Function("return this")(),d=n&&!n.nodeType&&n,p=d&&t&&!t.nodeType&&t,m=p&&p.exports===d;var v,g=Function.prototype,y=Object.prototype,b=f["__core-js_shared__"],_=(v=/[^.]+$/.exec(b&&b.keys&&b.keys.IE_PROTO||""))?"Symbol(src)_1."+v:"",S=g.toString,x=y.hasOwnProperty,w=y.toString,k=RegExp("^"+S.call(x).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),E=m?f.Buffer:void 0,T=y.propertyIsEnumerable,P=E?E.isBuffer:void 0,A=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),C=G(f,"DataView"),M=G(f,"Map"),I=G(f,"Promise"),N=G(f,"Set"),L=G(f,"WeakMap"),R=!T.call({valueOf:1},"valueOf"),F=H(C),O=H(M),B=H(I),D=H(N),V=H(L);function $(t){if(!X(t)||(n=t,_&&_ in n))return!1;var n,i=Y(t)||function(t){var n=!1;if(null!=t&&"function"!=typeof t.toString)try{n=!!(t+"")}catch(e){}return n}(t)?k:u;return i.test(H(t))}function G(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return $(n)?n:void 0}var z=function(e){return w.call(e)};function H(t){if(null!=t){try{return S.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function U(e){return function(e){return function(e){return!!e&&"object"==_typeof3(e)}(e)&&W(e)}(e)&&x.call(e,"callee")&&(!T.call(e,"callee")||"[object Arguments]"==w.call(e))}(C&&z(new C(new ArrayBuffer(1)))!=l||M&&z(new M)!=r||I&&z(I.resolve())!=a||N&&z(new N)!=s||L&&z(new L)!=o)&&(z=function(e){var t=w.call(e),n="[object Object]"==t?e.constructor:void 0,i=n?H(n):void 0;if(i)switch(i){case F:return l;case O:return r;case B:return a;case D:return s;case V:return o}return t});var j=Array.isArray;function W(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}(e.length)&&!Y(e)}var q=P||function(){return!1};function Y(e){var t=X(e)?w.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}function X(e){var t=_typeof3(e);return!!e&&("object"==t||"function"==t)}t.exports=function(e){if(W(e)&&(j(e)||"string"==typeof e||"function"==typeof e.splice||q(e)||U(e)))return!e.length;var t=z(e);if(t==r||t==s)return!e.size;if(R||function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||y)}(e))return!A(e).length;for(var n in e)if(x.call(e,n))return!1;return!0}}(lodash_isempty,lodash_isempty.exports);var objectTag="[object Object]";function isHostObject(t){var n=!1;if(null!=t&&"function"!=typeof t.toString)try{n=!!(t+"")}catch(e){}return n}function overArg(e,t){return function(n){return e(t(n))}}var funcProto=Function.prototype,objectProto=Object.prototype,funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectCtorString=funcToString.call(Object),objectToString=objectProto.toString,getPrototype=overArg(Object.getPrototypeOf,Object);function isObjectLike(e){return!!e&&"object"==_typeof3(e)}function isPlainObject$1(e){if(!isObjectLike(e)||objectToString.call(e)!=objectTag||isHostObject(e))return!1;var t=getPrototype(e);if(null===t)return!0;var n=hasOwnProperty.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&funcToString.call(n)==objectCtorString}var lodash_isplainobject=isPlainObject$1,lodash_transform={exports:{}};!function(t,n){var i="__lodash_hash_undefined__",r=9007199254740991,a="[object Arguments]",s="[object Array]",o="[object Boolean]",l="[object Date]",u="[object Error]",c="[object Function]",h="[object Map]",f="[object Number]",d="[object Object]",p="[object Promise]",m="[object RegExp]",v="[object Set]",g="[object String]",y="[object Symbol]",b="[object WeakMap]",_="[object ArrayBuffer]",S="[object DataView]",x=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,w=/^\w*$/,k=/^\./,E=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,T=/\\(\\)?/g,P=/^\[object .+?Constructor\]$/,A=/^(?:0|[1-9]\d*)$/,C={};C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C[a]=C[s]=C[_]=C[o]=C[S]=C[l]=C[u]=C[c]=C[h]=C[f]=C[d]=C[m]=C[v]=C[g]=C[b]=!1;var M="object"==_typeof3(commonjsGlobal$1)&&commonjsGlobal$1&&commonjsGlobal$1.Object===Object&&commonjsGlobal$1,I="object"==("undefined"==typeof self?"undefined":_typeof3(self))&&self&&self.Object===Object&&self,N=M||I||Function("return this")(),L=n&&!n.nodeType&&n,R=L&&t&&!t.nodeType&&t,F=R&&R.exports===L&&M.process,O=function(){try{return F&&F.binding("util")}catch(e){}}(),B=O&&O.isTypedArray;function D(e,t){for(var n=-1,i=e?e.length:0;++n-1},xe.prototype.set=function(e,t){var n=this.__data__,i=Pe(n,e);return i<0?n.push([e,t]):n[i][1]=t,this},we.prototype.clear=function(){this.__data__={hash:new Se,map:new(le||xe),string:new Se}},we.prototype.delete=function(e){return Ve(this,e).delete(e)},we.prototype.get=function(e){return Ve(this,e).get(e)},we.prototype.has=function(e){return Ve(this,e).has(e)},we.prototype.set=function(e,t){return Ve(this,e).set(e,t),this},ke.prototype.add=ke.prototype.push=function(e){return this.__data__.set(e,i),this},ke.prototype.has=function(e){return this.__data__.has(e)},Ee.prototype.clear=function(){this.__data__=new xe},Ee.prototype.delete=function(e){return this.__data__.delete(e)},Ee.prototype.get=function(e){return this.__data__.get(e)},Ee.prototype.has=function(e){return this.__data__.has(e)},Ee.prototype.set=function(e,t){var n=this.__data__;if(n instanceof xe){var i=n.__data__;if(!le||i.length<199)return i.push([e,t]),this;n=this.__data__=new we(i)}return n.set(e,t),this};var Ae,Ce=function(e,t,n){for(var i=-1,r=Object(e),a=n(e),s=a.length;s--;){var o=a[Ae?s:++i];if(!1===t(r[o],o,r))break}return e};function Me(e,t){return e&&Ce(e,t,ot)}function Ie(e,t){for(var n=0,i=(t=He(t,e)?[t]:Be(t)).length;null!=e&&no))return!1;var u=a.get(e);if(u&&a.get(t))return u==t;var c=-1,h=!0,f=1&r?new ke:void 0;for(a.set(e,t),a.set(t,e);++c-1&&e%1==0&&e-1&&e%1==0&&e<=r}function nt(e){var t=_typeof3(e);return!!e&&("object"==t||"function"==t)}function it(e){return!!e&&"object"==_typeof3(e)}function rt(e){return"symbol"==_typeof3(e)||it(e)&&J.call(e)==y}var at,st=B?(at=B,function(e){return at(e)}):function(e){return it(e)&&tt(e.length)&&!!C[J.call(e)]};function ot(e){return Qe(e)?Te(e):Oe(e)}function lt(e){return e}t.exports=function(e,t,n){var i,r=Je(e)||st(e);if(t=Fe(t),null==n)if(r||nt(e)){var a=e.constructor;n=r?Je(e)?new a:[]:et(a)?nt(i=ne(e))?ie(i):{}:{}}else n={};return(r?D:Me)(e,(function(e,i,r){return t(n,e,i,r)})),n}}(lodash_transform,lodash_transform.exports);var isEmpty$1=lodash_isempty.exports,isPlainObject=lodash_isplainobject,transform=lodash_transform.exports,src=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.cleanKeys,r=void 0===i?[]:i,a=n.cleanValues,s=void 0===a?[]:a,o=n.emptyArrays,l=void 0===o||o,u=n.emptyObjects,c=void 0===u||u,h=n.emptyStrings,f=void 0===h||h,d=n.NaNValues,p=void 0!==d&&d,m=n.nullValues,v=void 0===m||m,g=n.undefinedValues,y=void 0===g||g;return transform(t,(function(t,n,i){if(!r.includes(i)&&((Array.isArray(n)||isPlainObject(n))&&(n=e(n,{NaNValues:p,cleanKeys:r,cleanValues:s,emptyArrays:l,emptyObjects:c,emptyStrings:f,nullValues:v,undefinedValues:y})),!s.includes(n)&&!(c&&isPlainObject(n)&&isEmpty$1(n))&&(!l||!Array.isArray(n)||n.length)&&!(f&&""===n||p&&Number.isNaN(n)||v&&null===n||y&&void 0===n)))return Array.isArray(t)?t.push(n):void(t[i]=n)}))},isOpenLogin=!1,request=exports("r",extend$1({requestType:"json",timeout:1e4,prefix:getRequestHostname()}));request.use(function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.req,e.next=3,n();case 3:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),request.interceptors.request.use((function(e,t){var n=sessionStorage.getItem("Authorization")||"",i={};return n&&!["/api-auth/usernameLogin","/api-auth/smsLogin","/api-auth/code/sendSms"].includes(e)&&(i.Authorization=n),{url:e,options:_objectSpread2(_objectSpread2({},t),{},{params:src(t.params),headers:_objectSpread2(_objectSpread2({},t.headers),i)})}}),{global:!1}),request.interceptors.response.use(function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(t,n){var i,r,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(new URL(t.url),!(t.status>299||t.status<200)){e.next=5;break}throw Toast(i="服务器错误,状态码"+t.status),new Error(i);case 5:return e.next=7,t.clone().json();case 7:if(200===(r=e.sent).code||0===r.errCode){e.next=14;break}throw a=r.msg||"处理失败,请重试",403!==r.code&&401!==r.code&&Toast(a),s=browser(),403===r.code&&s.isApp&&!isOpenLogin&&(s.android?(postMessage({api:"login"}),window.DAYA.postMessage(JSON.stringify({api:"login"}))):s.iPhone&&window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api:"login"}))),new Error(a);case 14:return e.abrupt("return",t);case 15:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),{global:!1});var AJAX=function(){function e(){_classCallCheck2(this,e)}return _createClass2(e,null,[{key:"ajax",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e3,i=e.indexOf(".mxl")>-1?"text/plain; charset=x-user-defined":"application/xml";if(XMLHttpRequest)t=new XMLHttpRequest;else{if(!ActiveXObject)return Promise.reject(new Error("XMLHttp not supported."));t=new ActiveXObject("Microsoft.XMLHTTP")}return t.timeout=n,new Promise((function(n,r){t.onreadystatechange=function(){t.readyState===XMLHttpRequest.DONE&&(200===t.status||0===t.status&&t.responseText?n(t.responseText):r(new Error("Could not retrieve requested URL "+t.status)))},t.ontimeout=function(e){r(new Error("Server request Timeout"))},t.overrideMimeType(i),t.open("GET",e,!0),t.send()}))}}]),e}(),_Fraction=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];_classCallCheck2(this,e),this.numerator=0,this.denominator=1,this.wholeValue=0,this.numerator=t,this.denominator=n,this.wholeValue=i,r&&this.simplify(),this.setRealValue()}return _createClass2(e,[{key:"toString",value:function(){var e=this.numerator+"/"+this.denominator;return 0!==this.wholeValue&&(e=this.wholeValue+" "+e),e}},{key:"clone",value:function(){return new e(this.numerator,this.denominator,this.wholeValue,!1)}},{key:"Numerator",get:function(){return this.numerator},set:function(e){this.numerator!==e&&(this.numerator=e,this.simplify(),this.setRealValue())}},{key:"Denominator",get:function(){return this.denominator},set:function(e){this.denominator!==e&&(this.denominator=e,0!==this.numerator&&this.simplify(),this.setRealValue())}},{key:"WholeValue",get:function(){return this.wholeValue},set:function(e){this.wholeValue!==e&&(this.wholeValue=e,this.setRealValue())}},{key:"GetExpandedNumerator",value:function(){return this.wholeValue*this.denominator+this.numerator}},{key:"calculateNumberOfNeededDots",value:function(){for(var e=1,t=2,n=this.GetExpandedNumerator();tt;)n.Numerator++;if(this.numerator>this.denominator){for(var i=new e(this.numerator-1,this.denominator,this.wholeValue);i.Denominator>t;)i.Numerator--;if(i.Denominatore.maximumAllowedNumber){var i=this.denominator/e.maximumAllowedNumber;this.numerator=Math.round(this.numerator/i),this.denominator=Math.round(this.denominator/i)}if(this.numerator>e.maximumAllowedNumber){var r=this.numerator/e.maximumAllowedNumber;this.numerator=Math.round(this.numerator/r),this.denominator=Math.round(this.denominator/r)}}else this.denominator=1}},{key:"isOnBeat",value:function(t){var n=this.distanceFromBeat(t);return Math.abs(n)t.RealValue?e:t}},{key:"Equal",value:function(e,t){return e.wholeValue===t.wholeValue&&e.Denominator===t.Denominator&&e.Numerator===t.Numerator}},{key:"createFromFraction",value:function(t){return new e(t.numerator,t.denominator,t.wholeValue,!1)}},{key:"plus",value:function(e,t){var n=e.clone();return n.Add(t),n}},{key:"minus",value:function(e,t){var n=e.clone();return n.Sub(t),n}},{key:"multiply",value:function(t,n){return new e((t.wholeValue*t.denominator+t.numerator)*(n.wholeValue*n.denominator+n.numerator),t.denominator*n.denominator)}},{key:"greatestCommonDenominator",value:function(e,t){if(0===e)return t;if(1===t)return 1;for(;Math.abs(t)>1e-8;)e>t?e-=t:t-=e;return Math.round(e)}}]),e}(),Fraction$1=_Fraction;Fraction$1.maximumAllowedNumber=46340,Fraction$1.FloatInaccuracyTolerance=1e-4;var AbstractExpression=function(){function e(t){_classCallCheck2(this,e),this.placement=t}return _createClass2(e,[{key:"Placement",get:function(){return this.placement}}],[{key:"isStringInStringList",value:function(e,t){for(var n=0,i=e.length;n6&&void 0!==arguments[6]?arguments[6]:"";return _classCallCheck2(this,n),_set((l=_assertThisInitialized2(u=t.call(this,i)),_getPrototypeOf2(n.prototype)),"parentMeasure",a,l,!0),u.NumberXml=o,u.dynamicType=e,u.label=c,u.staffNumber=r,u.activeInstantaneousDynamic=s,u.startVolume=1,u.endVolume=1,u.setStartAndEndVolume(),""!==c&&u.setType(),u}return _createClass2(n,[{key:"setStartAndEndVolume",value:function(){this.activeInstantaneousDynamic&&(this.dynamicType===ContDynamicEnum.crescendo&&(this.startVolume=this.activeInstantaneousDynamic.Volume,this.endVolume=1.2*this.activeInstantaneousDynamic.Volume),this.dynamicType===ContDynamicEnum.diminuendo&&(this.startVolume=this.activeInstantaneousDynamic.Volume,this.endVolume=.8*this.activeInstantaneousDynamic.Volume))}},{key:"DynamicType",get:function(){return this.dynamicType},set:function(e){this.dynamicType=e}},{key:"StartMultiExpression",get:function(){return this.startMultiExpression},set:function(e){this.startMultiExpression=e}},{key:"EndMultiExpression",get:function(){return this.endMultiExpression},set:function(e){this.endMultiExpression=e}},{key:"Placement",get:function(){return this.placement},set:function(e){this.placement=e}},{key:"StartVolume",get:function(){return this.startVolume},set:function(e){this.startVolume=e}},{key:"EndVolume",get:function(){return this.endVolume},set:function(e){this.endVolume=e}},{key:"StaffNumber",get:function(){return this.staffNumber},set:function(e){this.staffNumber=e}},{key:"Label",get:function(){return this.label},set:function(e){this.label=e,this.setType()}},{key:"getInterpolatedDynamic",value:function(e){var t,n=this.StartMultiExpression.AbsoluteTimestamp;if(t=this.EndMultiExpression?this.EndMultiExpression.AbsoluteTimestamp:Fraction$1.plus(this.startMultiExpression.SourceMeasureParent.AbsoluteTimestamp,this.startMultiExpression.SourceMeasureParent.Duration),e.lt(n))return-1;if(t.lt(e))return-2;var i=Fraction$1.minus(e,n).RealValue/Fraction$1.minus(t,n).RealValue;return Math.max(0,Math.min(99.9,this.startVolume+(this.endVolume-this.startVolume)*i))}},{key:"isWedge",value:function(){return!this.label}},{key:"setType",value:function(){n.isStringInStringList(n.listContinuousDynamicIncreasing,this.label)?this.dynamicType=ContDynamicEnum.crescendo:n.isStringInStringList(n.listContinuousDynamicDecreasing,this.label)&&(this.dynamicType=ContDynamicEnum.diminuendo)}}],[{key:"isInputStringContinuousDynamic",value:function(e){return!!e&&(n.isStringInStringList(n.listContinuousDynamicIncreasing,e)||n.isStringInStringList(n.listContinuousDynamicDecreasing,e))}}]),n}(AbstractExpression),ContinuousDynamicExpression=_ContinuousDynamicExpression;ContinuousDynamicExpression.listContinuousDynamicIncreasing=["crescendo","cresc","cresc.","cres."],ContinuousDynamicExpression.listContinuousDynamicDecreasing=["decrescendo","decresc","decr.","diminuendo","dim.","dim"];var ContDynamicEnum=function(e){return e[e.crescendo=0]="crescendo",e[e.diminuendo=1]="diminuendo",e}(ContDynamicEnum||{}),DynamicExpressionSymbolEnum=function(e){return e[e.p=0]="p",e[e.f=1]="f",e[e.s=2]="s",e[e.z=3]="z",e[e.m=4]="m",e[e.r=5]="r",e}(DynamicExpressionSymbolEnum||{}),MusicSheetReadingException=_createClass2((function e(t,n){_classCallCheck2(this,e),this.message=t,n&&(this.message+=" "+n.toString())})),ArgumentOutOfRangeException=_createClass2((function e(t){_classCallCheck2(this,e),this.message=t})),InvalidEnumArgumentException=_createClass2((function e(t){_classCallCheck2(this,e),this.message=t})),loglevel={exports:{}};!function(t){!function(e,n){t.exports?t.exports=n():e.log=n()}(commonjsGlobal$1,(function(){var t=function(){},n="undefined",i=("undefined"==typeof window?"undefined":_typeof3(window))!==n&&_typeof3(window.navigator)!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"];function a(t,n){var i=t[n];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 s(){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){return"debug"===e&&(e="log"),("undefined"==typeof console?"undefined":_typeof3(console))!==n&&("trace"===e&&i?s:void 0!==console[e]?a(console,e):void 0!==console.log?a(console,"log"):t)}function l(e,n){for(var i=0;i=0&&t<=s.levels.SILENT))throw"log.setLevel() called with invalid level: "+t;if(a=t,!1!==i&&function(e){var t=(r[e]||"silent").toUpperCase();if(("undefined"==typeof window?"undefined":_typeof3(window))!==n&&o){try{return void(window.localStorage[o]=t)}catch(i){}try{window.document.cookie=encodeURIComponent(o)+"="+t+";"}catch(i){}}}(t),l.call(s,t,e),("undefined"==typeof console?"undefined":_typeof3(console))===n&&t=0;r--)if(i(e[r],t))return r;return-1}function contains(e,t,n){return indexOf$1(e,t,n)>=0}function remove(e,t,n){var i=indexOf$1(e,t,n);return!(i<0)&&(e.splice(i,1),!0)}function frequency(e,t,n){for(var i=n||util$9.defaultEquals,r=e.length,a=0,s=0;s=e.length||n<0||n>=e.length)return!1;var i=e[t];return e[t]=e[n],e[n]=i,!0}function toString$1(e){return"["+e.toString()+"]"}function forEach(e,t){for(var n=0,i=e;ne.size())return!1;var t=!0;return this.forEach((function(n){return!!e.contains(n)||(t=!1,!1)})),t},e.prototype.remove=function(e){return!!this.contains(e)&&(this.dictionary.remove(e),!0)},e.prototype.forEach=function(e){this.dictionary.forEach((function(t,n){return e(n)}))},e.prototype.toArray=function(){return this.dictionary.values()},e.prototype.isEmpty=function(){return this.dictionary.isEmpty()},e.prototype.size=function(){return this.dictionary.size()},e.prototype.clear=function(){this.dictionary.clear()},e.prototype.toString=function(){return arrays$3.toString(this.toArray())},e}();_Set.default=Set$1,Object.defineProperty(Bag$1,"__esModule",{value:!0});var util$6=util$a,Dictionary_1$4=Dictionary$2,Set_1$1=_Set,Bag=function(){function e(e){this.toStrF=e||util$6.defaultToString,this.dictionary=new Dictionary_1$4.default(this.toStrF),this.nElements=0}return e.prototype.add=function(e,t){if(void 0===t&&(t=1),util$6.isUndefined(e)||t<=0)return!1;if(this.contains(e))this.dictionary.getValue(e).copies+=t;else{var n={value:e,copies:t};this.dictionary.setValue(e,n)}return this.nElements+=t,!0},e.prototype.count=function(e){return this.contains(e)?this.dictionary.getValue(e).copies:0},e.prototype.contains=function(e){return this.dictionary.containsKey(e)},e.prototype.remove=function(e,t){if(void 0===t&&(t=1),util$6.isUndefined(e)||t<=0)return!1;if(this.contains(e)){var n=this.dictionary.getValue(e);return t>n.copies?this.nElements-=n.copies:this.nElements-=t,n.copies-=t,n.copies<=0&&this.dictionary.remove(e),!0}return!1},e.prototype.toArray=function(){for(var e=[],t=0,n=this.dictionary.values();tthis.nElements||util$5.isUndefined(e))return!1;var n=this.createNode(e);if(0===this.nElements||null===this.lastNode)this.firstNode=n,this.lastNode=n;else if(t===this.nElements)this.lastNode.next=n,this.lastNode=n;else if(0===t)n.next=this.firstNode,this.firstNode=n;else{var i=this.nodeAtIndex(t-1);if(null===i)return!1;n.next=i.next,i.next=n}return this.nElements++,!0},e.prototype.first=function(){if(null!==this.firstNode)return this.firstNode.element},e.prototype.last=function(){if(null!==this.lastNode)return this.lastNode.element},e.prototype.elementAtIndex=function(e){var t=this.nodeAtIndex(e);if(null!==t)return t.element},e.prototype.indexOf=function(e,t){var n=t||util$5.defaultEquals;if(util$5.isUndefined(e))return-1;for(var i=this.firstNode,r=0;null!==i;){if(n(i.element,e))return r;r++,i=i.next}return-1},e.prototype.contains=function(e,t){return this.indexOf(e,t)>=0},e.prototype.remove=function(e,t){var n=t||util$5.defaultEquals;if(this.nElements<1||util$5.isUndefined(e))return!1;for(var i=null,r=this.firstNode;null!==r;){if(n(r.element,e))return null===i?(this.firstNode=r.next,r===this.lastNode&&(this.lastNode=null)):r===this.lastNode?(this.lastNode=i,i.next=r.next,r.next=null):(i.next=r.next,r.next=null),this.nElements--,!0;i=r,r=r.next}return!1},e.prototype.clear=function(){this.firstNode=null,this.lastNode=null,this.nElements=0},e.prototype.equals=function(t,n){var i=n||util$5.defaultEquals;return t instanceof e&&(this.size()===t.size()&&this.equalsAux(this.firstNode,t.firstNode,i))},e.prototype.equalsAux=function(e,t,n){for(;null!==e&&null!==t;){if(!n(e.element,t.element))return!1;e=e.next,t=t.next}return!0},e.prototype.removeElementAtIndex=function(e){if(!(e<0||e>=this.nElements||null===this.firstNode||null===this.lastNode)){var t;if(1===this.nElements)t=this.firstNode.element,this.firstNode=null,this.lastNode=null;else{var n=this.nodeAtIndex(e-1);null===n?(t=this.firstNode.element,this.firstNode=this.firstNode.next):n.next===this.lastNode&&(t=this.lastNode.element,this.lastNode=n),null!==n&&null!==n.next&&(t=n.next.element,n.next=n.next.next)}return this.nElements--,t}},e.prototype.forEach=function(e){for(var t=this.firstNode;null!==t&&!1!==e(t.element);)t=t.next},e.prototype.reverse=function(){for(var e=null,t=this.firstNode,n=null;null!==t;)n=t.next,t.next=e,e=t,t=n;n=this.firstNode,this.firstNode=this.lastNode,this.lastNode=n},e.prototype.toArray=function(){for(var e=[],t=this.firstNode;null!==t;)e.push(t.element),t=t.next;return e},e.prototype.size=function(){return this.nElements},e.prototype.isEmpty=function(){return this.nElements<=0},e.prototype.toString=function(){return arrays$2.toString(this.toArray())},e.prototype.nodeAtIndex=function(e){if(e<0||e>=this.nElements)return null;if(e===this.nElements-1)return this.lastNode;for(var t=this.firstNode,n=0;n0&&(e=e.rightCh);return e},e.prototype.transplant=function(e,t){null===e.parent?this.root=t:e===e.parent.leftCh?e.parent.leftCh=t:e.parent.rightCh=t,null!==t&&(t.parent=e.parent)},e.prototype.removeNode=function(e){if(null===e.leftCh)this.transplant(e,e.rightCh);else if(null===e.rightCh)this.transplant(e,e.leftCh);else{var t=this.minimumAux(e.rightCh);t.parent!==e&&(this.transplant(t,t.rightCh),t.rightCh=e.rightCh,t.rightCh.parent=t),this.transplant(e,t),t.leftCh=e.leftCh,t.leftCh.parent=t}},e.prototype.inorderTraversalAux=function(e,t,n){null===e||n.stop||(this.inorderTraversalAux(e.leftCh,t,n),n.stop||(n.stop=!1===t(e.element),n.stop||this.inorderTraversalAux(e.rightCh,t,n)))},e.prototype.levelTraversalAux=function(e,t){var n=new Queue_1$1.default;for(null!==e&&n.enqueue(e),e=n.dequeue()||null;null!=e;){if(!1===t(e.element))return;null!==e.leftCh&&n.enqueue(e.leftCh),null!==e.rightCh&&n.enqueue(e.rightCh),e=n.dequeue()||null}},e.prototype.preorderTraversalAux=function(e,t,n){null===e||n.stop||(n.stop=!1===t(e.element),n.stop||(this.preorderTraversalAux(e.leftCh,t,n),n.stop||this.preorderTraversalAux(e.rightCh,t,n)))},e.prototype.postorderTraversalAux=function(e,t,n){null===e||n.stop||(this.postorderTraversalAux(e.leftCh,t,n),n.stop||(this.postorderTraversalAux(e.rightCh,t,n),n.stop||(n.stop=!1===t(e.element))))},e.prototype.minimumAux=function(e){for(;null!=e&&null!==e.leftCh;)e=e.leftCh;return e},e.prototype.maximumAux=function(e){for(;null!=e&&null!==e.rightCh;)e=e.rightCh;return e},e.prototype.heightAux=function(e){return null===e?-1:Math.max(this.heightAux(e.leftCh),this.heightAux(e.rightCh))+1},e.prototype.insertNode=function(e){for(var t=null,n=this.root;null!==n;){var i=this.compare(e.element,n.element);if(0===i)return null;i<0?(t=n,n=n.leftCh):(t=n,n=n.rightCh)}return e.parent=t,null===t?this.root=e:this.compare(e.element,t.element)<0?t.leftCh=e:t.rightCh=e,e},e.prototype.createNode=function(e){return{element:e,leftCh:null,rightCh:null,parent:null}},e}();BSTreeKV$1.default=BSTreeKV;var __extends$2=commonjsGlobal$1&&commonjsGlobal$1.__extends||(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),extendStatics;Object.defineProperty(BSTree$1,"__esModule",{value:!0});var BSTreeKV_1$1=BSTreeKV$1,BSTree=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends$2(t,e),t}(BSTreeKV_1$1.default);BSTree$1.default=BSTree;var Heap$1={};Object.defineProperty(Heap$1,"__esModule",{value:!0});var collections=util$a,arrays$1=arrays$4,Heap=function(){function e(e){this.data=[],this.compare=e||collections.defaultCompare}return e.prototype.leftChildIndex=function(e){return 2*e+1},e.prototype.rightChildIndex=function(e){return 2*e+2},e.prototype.parentIndex=function(e){return Math.floor((e-1)/2)},e.prototype.minIndex=function(e,t){return t>=this.data.length?e>=this.data.length?-1:e:this.compare(this.data[e],this.data[t])<=0?e:t},e.prototype.siftUp=function(e){for(var t=this.parentIndex(e);e>0&&this.compare(this.data[t],this.data[e])>0;)arrays$1.swap(this.data,t,e),e=t,t=this.parentIndex(e)},e.prototype.siftDown=function(e){for(var t=this.minIndex(this.leftChildIndex(e),this.rightChildIndex(e));t>=0&&this.compare(this.data[e],this.data[t])>0;)arrays$1.swap(this.data,t,e),e=t,t=this.minIndex(this.leftChildIndex(e),this.rightChildIndex(e))},e.prototype.peek=function(){return this.data.length>0?this.data[0]:void 0},e.prototype.add=function(e){return!collections.isUndefined(e)&&(this.data.push(e),this.siftUp(this.data.length-1),!0)},e.prototype.removeRoot=function(){if(this.data.length>0){var e=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),e}},e.prototype.contains=function(e){var t=collections.compareToEquals(this.compare);return arrays$1.contains(this.data,e,t)},e.prototype.size=function(){return this.data.length},e.prototype.isEmpty=function(){return this.data.length<=0},e.prototype.clear=function(){this.data.length=0},e.prototype.forEach=function(e){arrays$1.forEach(this.data,e)},e}();Heap$1.default=Heap;var LinkedDictionary$1={},__extends$1=commonjsGlobal$1&&commonjsGlobal$1.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(LinkedDictionary$1,"__esModule",{value:!0});var Dictionary_1$3=Dictionary$2,util$3=util$a,LinkedDictionaryPair=function(){function e(e,t){this.key=e,this.value=t}return e.prototype.unlink=function(){this.prev.next=this.next,this.next.prev=this.prev},e}(),HeadOrTailLinkedDictionaryPair=function(){function e(){this.key=null,this.value=null}return e.prototype.unlink=function(){this.prev.next=this.next,this.next.prev=this.prev},e}();function isHeadOrTailLinkedDictionaryPair(e){return!e.next}var LinkedDictionary=function(e){function t(t){var n=e.call(this,t)||this;return n.head=new HeadOrTailLinkedDictionaryPair,n.tail=new HeadOrTailLinkedDictionaryPair,n.head.next=n.tail,n.tail.prev=n.head,n}return __extends$1(t,e),t.prototype.appendToTail=function(e){var t=this.tail.prev;t.next=e,e.prev=t,e.next=this.tail,this.tail.prev=e},t.prototype.getLinkedDictionaryPair=function(e){if(!util$3.isUndefined(e)){var t="$"+this.toStr(e);return this.table[t]}},t.prototype.getValue=function(e){var t=this.getLinkedDictionaryPair(e);if(!util$3.isUndefined(t))return t.value},t.prototype.remove=function(t){var n=this.getLinkedDictionaryPair(t);if(!util$3.isUndefined(n))return e.prototype.remove.call(this,t),n.unlink(),n.value},t.prototype.clear=function(){e.prototype.clear.call(this),this.head.next=this.tail,this.tail.prev=this.head},t.prototype.replace=function(e,t){var n="$"+this.toStr(t.key);t.next=e.next,t.prev=e.prev,this.remove(e.key),t.prev.next=t,t.next.prev=t,this.table[n]=t,++this.nElements},t.prototype.setValue=function(e,t){if(!util$3.isUndefined(e)&&!util$3.isUndefined(t)){var n=this.getLinkedDictionaryPair(e),i=new LinkedDictionaryPair(e,t),r="$"+this.toStr(e);return util$3.isUndefined(n)?(this.appendToTail(i),this.table[r]=i,void++this.nElements):(this.replace(n,i),n.value)}},t.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(t)})),e},t.prototype.values=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),e},t.prototype.forEach=function(e){for(var t=this.head.next;!isHeadOrTailLinkedDictionaryPair(t);){if(!1===e(t.key,t.value))return;t=t.next}},t}(Dictionary_1$3.default);LinkedDictionary$1.default=LinkedDictionary;var MultiDictionary$1={};Object.defineProperty(MultiDictionary$1,"__esModule",{value:!0});var util$2=util$a,Dictionary_1$2=Dictionary$2,arrays=arrays$4,MultiDictionary=function(){function e(e,t,n){void 0===n&&(n=!1),this.dict=new Dictionary_1$2.default(e),this.equalsF=t||util$2.defaultEquals,this.allowDuplicate=n}return e.prototype.getValue=function(e){var t=this.dict.getValue(e);return util$2.isUndefined(t)?[]:arrays.copy(t)},e.prototype.setValue=function(e,t){if(util$2.isUndefined(e)||util$2.isUndefined(t))return!1;var n=this.dict.getValue(e);return util$2.isUndefined(n)?(this.dict.setValue(e,[t]),!0):!(!this.allowDuplicate&&arrays.contains(n,t,this.equalsF))&&(n.push(t),!0)},e.prototype.remove=function(e,t){if(util$2.isUndefined(t)){var n=this.dict.remove(e);return!util$2.isUndefined(n)}var i=this.dict.getValue(e);return!(util$2.isUndefined(i)||!arrays.remove(i,t,this.equalsF))&&(0===i.length&&this.dict.remove(e),!0)},e.prototype.keys=function(){return this.dict.keys()},e.prototype.values=function(){for(var e=[],t=0,n=this.dict.values();t-1&&this.insertIdIntoRoot(t,n),this.nodes)if(this.nodes.hasOwnProperty(i)){var r=this.findNodeId(i,e);r>-1&&this.insertIdIntoNode(i,t,r)}},e.prototype.insertIdAfterId=function(e,t){var n=this.findRootId(e);for(var i in n>-1&&this.insertIdIntoRoot(t,n+1),this.nodes)if(this.nodes.hasOwnProperty(i)){var r=this.findNodeId(i,e);r>-1&&this.insertIdIntoNode(i,t,r+1)}},e.prototype.insertIdIntoId=function(e,t){this.nodeInsertAtEnd(e,t),this.nodes[t]=[]},e.prototype.insertIdIntoRoot=function(e,t){if(void 0===t)this.rootInsertAtEnd(e);else if(t<0){var n=this.rootIds.length;this.rootIds.splice(t+n+1,0,e)}else this.rootIds.splice(t,0,e);this.nodes[e]=this.nodes[e]||[]},e.prototype.insertIdIntoNode=function(e,t,n){if(this.nodes[e]=this.nodes[e]||[],this.nodes[t]=this.nodes[t]||[],void 0===n)this.nodeInsertAtEnd(e,t);else if(n<0){var i=this.nodes[e].length;this.nodes[e].splice(n+i+1,0,t)}else this.nodes[e].splice(n,0,t)},e.prototype.moveId=function(e,t,n){var i=e,r=this.findRootId(i);for(var a in this.nodes[t],this.nodes)if(this.nodes.hasOwnProperty(a)){this.findNodeId(a,t);break}var s=t,o=this.findRootId(s);for(var a in this.nodes[t],this.nodes)if(this.nodes.hasOwnProperty(a)){this.findNodeId(a,t);break}if(r>-1)if(o>-1)switch(this.rootDelete(r),o>r&&o--,n){case Direction.BEFORE:this.insertIdIntoRoot(i,o);break;case Direction.AFTER:this.insertIdIntoRoot(i,o+1);break;case Direction.INSIDE_AT_START:this.nodeInsertAtStart(s,i);break;case Direction.INSIDE_AT_END:this.nodeInsertAtEnd(s,i)}else for(var a in this.rootDelete(r),this.nodes){if(this.nodes.hasOwnProperty(a))if((l=this.findNodeId(a,s))>-1){switch(n){case Direction.BEFORE:this.insertIdIntoNode(a,i,l);break;case Direction.AFTER:this.insertIdIntoNode(a,i,l+1);break;case Direction.INSIDE_AT_START:this.nodeInsertAtStart(s,i);break;case Direction.INSIDE_AT_END:this.nodeInsertAtEnd(s,i)}break}}else if(o>-1){for(var a in this.nodes){if(this.nodes.hasOwnProperty(a))if((l=this.findNodeId(a,i))>-1){this.nodeDeleteAtIndex(a,l);break}}switch(n){case Direction.BEFORE:this.insertIdIntoRoot(i,o);break;case Direction.AFTER:this.insertIdIntoRoot(i,o+1);break;case Direction.INSIDE_AT_START:this.nodeInsertAtStart(s,i);break;case Direction.INSIDE_AT_END:this.nodeInsertAtEnd(s,i)}}else{for(var a in this.nodes){if(this.nodes.hasOwnProperty(a))if((l=this.findNodeId(a,i))>-1){this.nodeDeleteAtIndex(a,l);break}}for(var a in this.nodes){var l;if(this.nodes.hasOwnProperty(a))if((l=this.findNodeId(a,s))>-1){switch(n){case Direction.BEFORE:this.insertIdIntoNode(a,i,l);break;case Direction.AFTER:this.insertIdIntoNode(a,i,l+1);break;case Direction.INSIDE_AT_START:this.nodeInsertAtStart(s,i);break;case Direction.INSIDE_AT_END:this.nodeInsertAtEnd(s,i)}break}}}},e.prototype.swapArrayElements=function(e,t,n){var i=e[t];return e[t]=e[n],e[n]=i,e},e.prototype.rootDeleteId=function(e){var t=this.findRootId(e);t>-1&&this.rootDelete(t)},e.prototype.nodeAndSubNodesDelete=function(e){for(var t=[],n=0;n0&&void 0!==arguments[0]?arguments[0]:void 0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=new e(this.musicSheet,null!=t?t:this.currentTimeStamp,n);return i.currentVoiceEntryIndex=this.currentVoiceEntryIndex,i.currentMappingPart=this.currentMappingPart,i.currentPartIndex=this.currentPartIndex,i.currentVoiceEntries=this.currentVoiceEntries,i.endReached=this.endReached,i.frontReached=this.frontReached,i}},{key:"CurrentVisibleVoiceEntries",value:function(e){var t=[];if(!this.currentVoiceEntries)return t;if(e){var n,i=_createForOfIteratorHelper(this.currentVoiceEntries);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(r.ParentVoice.Parent.IdString===e.IdString)return this.getVisibleEntries(r,t),t}}catch(err){i.e(err)}finally{i.f()}}else{var a,s=_createForOfIteratorHelper(this.currentVoiceEntries);try{for(s.s();!(a=s.n()).done;){var o=a.value;this.getVisibleEntries(o,t)}}catch(err){s.e(err)}finally{s.f()}}return t}},{key:"CurrentAudibleVoiceEntries",value:function(e){var t=[];if(this.currentVoiceEntries)if(e){var n,i=_createForOfIteratorHelper(this.currentVoiceEntries);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(r.ParentVoice.Parent.IdString===e.IdString)return this.getAudibleEntries(r,t),t}}catch(err){i.e(err)}finally{i.f()}}else{var a,s=_createForOfIteratorHelper(this.currentVoiceEntries);try{for(s.s();!(a=s.n()).done;){var o=a.value;this.getAudibleEntries(o,t)}}catch(err){s.e(err)}finally{s.f()}}return t}},{key:"getCurrentDynamicChangingExpressions",value:function(){return this.currentDynamicChangingExpressions}},{key:"CurrentScoreFollowingVoiceEntries",value:function(e){var t=[];if(!this.currentVoiceEntries)return t;if(e){var n,i=_createForOfIteratorHelper(this.currentVoiceEntries);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(r.ParentVoice.Parent.IdString===e.IdString)return this.getScoreFollowingEntries(r,t),t}}catch(err){i.e(err)}finally{i.f()}}else{var a,s=_createForOfIteratorHelper(this.currentVoiceEntries);try{for(s.s();!(a=s.n()).done;){var o=a.value;this.getScoreFollowingEntries(o,t)}}catch(err){s.e(err)}finally{s.f()}}return t}},{key:"currentPlaybackSettings",value:function(){return this.musicSheet.SheetPlaybackSetting}},{key:"moveToNext",value:function(){this.forwardJumpOccurred=this.backJumpOccurred=!1,this.endReached||(this.currentVoiceEntries&&(this.currentVoiceEntries.length=0),this.recursiveMove(),this.currentMeasure||(this.currentTimeStamp=new Fraction$1(99999,1)),void 0!==this.CurrentTempoChangingExpression&&(void 0!==this.CurrentTempoChangingExpression.ContinuousTempo?this.currentBpm=this.CurrentTempoChangingExpression.ContinuousTempo.getInterpolatedTempo(this.CurrentSourceTimestamp):this.currentBpm=this.CurrentTempoChangingExpression.InstantaneousTempo.TempoInBpm))}},{key:"moveToNextVisibleVoiceEntry",value:function(e){for(;!this.endReached;)if(this.moveToNext(),this.checkEntries(e))return}},{key:"resetRepetitionIterationCount",value:function(e){return 1}},{key:"incrementRepetitionIterationCount",value:function(e){return-1===this.repetitionIterationCountDictKeys.indexOf(e)?this.setRepetitionIterationCount(e,1):this.setRepetitionIterationCount(e,this.getRepetitionIterationCount(e)+1)}},{key:"setRepetitionIterationCount",value:function(e,t){var n=this.repetitionIterationCountDictKeys.indexOf(e);return-1===n?(this.repetitionIterationCountDictKeys.push(e),this.repetitionIterationCountDictValues.push(t)):this.repetitionIterationCountDictValues[n]=t,t}},{key:"getRepetitionIterationCount",value:function(e){var t=this.repetitionIterationCountDictKeys.indexOf(e);if(-1!==t)return this.repetitionIterationCountDictValues[t]}},{key:"handleRepetitionsAtMeasureBegin",value:function(){for(var e=0,t=this.currentMeasure.FirstRepetitionInstructions.length;e=this.JumpResponsibleRepetition.StartIndex&&i.EndIndex<=this.JumpResponsibleRepetition.EndIndex&&this.resetRepetitionIterationCount(i)}}}},{key:"handleRepetitionsAtMeasureEnd",value:function(){for(var e=0,t=this.currentMeasure.LastRepetitionInstructions.length;e-1&&this.getRepetitionIterationCount(i)=this.JumpResponsibleRepetition.StartIndex&&i.EndIndex<=this.JumpResponsibleRepetition.EndIndex&&this.resetRepetitionIterationCount(i),this.repetitionIterationCountDictKeys.contains(i))){var r=i.getForwardJumpTargetForIteration(this.getRepetitionIterationCount(i));if(r>=0)return this.currentMeasureIndex=r,this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex],this.currentVoiceEntryIndex=-1,this.jumpResponsibleRepetition=i,void(this.forwardJumpOccurred=!0);-2===r&&(this.endReached=!0)}}}this.currentMeasureIndex++,void 0!==this.JumpResponsibleRepetition&&this.currentMeasureIndex>this.JumpResponsibleRepetition.EndIndex&&(this.jumpResponsibleRepetition=void 0)}},{key:"doBackJump",value:function(e){this.currentMeasureIndex=e.getBackwardJumpTarget(),this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex],this.currentVoiceEntryIndex=-1,this.incrementRepetitionIterationCount(e),this.jumpResponsibleRepetition=e,this.backJumpOccurred=!0}},{key:"activateCurrentRhythmInstructions",value:function(){if(void 0!==this.currentMeasure&&this.currentMeasure.FirstInstructionsStaffEntries.length>0&&void 0!==this.currentMeasure.FirstInstructionsStaffEntries[0])for(var e=this.currentMeasure.FirstInstructionsStaffEntries[0].Instructions,t=0,n=e.length;t0&&(this.currentDynamicEntryIndex>=e.length||e[this.currentDynamicEntryIndex].parMultiExpression().AbsoluteTimestamp.gte(this.CurrentSourceTimestamp));)this.currentDynamicEntryIndex--;for(;this.currentDynamicEntryIndex0&&(this.currentTempoEntryIndex>=l.length||l[this.currentTempoEntryIndex].AbsoluteTimestamp.gte(this.CurrentSourceTimestamp));)this.currentTempoEntryIndex--;for(;this.currentTempoEntryIndex=0&&this.currentVoiceEntryIndex=0&&this.currentMeasureIndex0){if(!e)return!0;for(var n=0,i=t.length;nt&&(this.openSheetMusicDisplay.Sheet.SelectionStart=this.openSheetMusicDisplay.Sheet.SourceMeasures[t].AbsoluteTimestamp),this.openSheetMusicDisplay.Sheet&&this.openSheetMusicDisplay.Sheet.SourceMeasures.length>n){var i=this.openSheetMusicDisplay.Sheet.SourceMeasures[n];this.openSheetMusicDisplay.Sheet.SelectionEnd=Fraction$1.plus(i.AbsoluteTimestamp,i.Duration)}this.iterator=this.manager.getIterator()}else console.log("OSMD.Cursor.resetIterator(): sheet or measures were null/undefined.")}},{key:"getStaffEntryFromVoiceEntry",value:function(e){var t=e.ParentSourceStaffEntry.VerticalContainerParent.ParentMeasure.measureListIndex,n=e.ParentSourceStaffEntry.ParentStaff.idInMusicSheet;return this.graphic.findGraphicalStaffEntryFromMeasureList(n,t,e.ParentSourceStaffEntry)}},{key:"updateWithTimestamp",value:function(e){var t=this.manager.absoluteEnrolledToSheetTimestamp(e),n=this.graphic.calculateXPositionFromTimestamp(t),i=n[0],r=n[1];this.updateCurrentPageFromSystem(r);var a=n[2];if(a){var s,o,l=Math.max(a.parentMeasure.MeasureNumber,1),u=_createForOfIteratorHelper(this.graphic.MeasureList[l-1]);try{for(u.s();!(o=u.n()).done;){var c=o.value;if(c){s=c;break}}}catch(err){u.e(err)}finally{u.f()}var h=this.graphic.calculateCursorPoints(i,r),f=h[0].y,d=h[1].y-f;if(s){if(this.updateWidthAndStyle(s.PositionAndShape,i,f,d),this.openSheetMusicDisplay.FollowCursor){var p=this.cursorElement.getBoundingClientRect().top;this.cursorElement.scrollIntoView({behavior:p<1e3?"smooth":"auto",block:"center"})}this.cursorElement.style.display=""}}}},{key:"update",value:function(){var e=this;if(!this.hidden&&void 0!==this.hidden&&null!==this.hidden){this.updateCurrentPage();var t=this.Iterator,n=t.CurrentVisibleVoiceEntries();if(!t.EndReached&&t.CurrentVoiceEntries&&0!==n.length){var i,r,a,s=0;if(t.CurrentMeasure.isReducedToMultiRest){var o=this.graphic.findGraphicalMeasure(t.CurrentMeasureIndex,0),l=o.parentSourceMeasure.multipleRestMeasures,u=t.CurrentMeasure.multipleRestMeasureNumber/(l+1),c=o.PositionAndShape.Size.width-o.beginInstructionsWidth;s=o.PositionAndShape.AbsolutePosition.x+o.beginInstructionsWidth+u*c,a=o.ParentMusicSystem}else{var h=n.map((function(t){return e.getStaffEntryFromVoiceEntry(t)})).sort((function(e,t){var n,i,r,a;return(null==e||null===(n=e.PositionAndShape)||void 0===n||null===(i=n.AbsolutePosition)||void 0===i?void 0:i.x)<=(null==t||null===(r=t.PositionAndShape)||void 0===r||null===(a=r.AbsolutePosition)||void 0===a?void 0:a.x)?-1:1}))[0];h&&(s=h.PositionAndShape.AbsolutePosition.x,a=h.parentMeasure.ParentMusicSystem)}if(a){i=a.PositionAndShape.AbsolutePosition.y+a.StaffLines[0].PositionAndShape.RelativePosition.y;var f=a.StaffLines[a.StaffLines.length-1];r=a.PositionAndShape.AbsolutePosition.y+f.PositionAndShape.RelativePosition.y+f.StaffHeight-i;var d=this.graphic.findGraphicalMeasure(t.CurrentMeasureIndex,0).PositionAndShape;if(this.updateWidthAndStyle(d,s,i,r),this.openSheetMusicDisplay.FollowCursor&&this.cursorOptions.follow)if(this.openSheetMusicDisplay.EngravingRules.RenderSingleHorizontalStaffline)this.cursorElement.scrollIntoView({behavior:"smooth",inline:"center"});else{var p=this.cursorElement.getBoundingClientRect().top;this.cursorElement.scrollIntoView({behavior:p<1e3?"smooth":"auto",block:"center"})}this.cursorElement.style.display=""}}}}},{key:"updateWidthAndStyle",value:function(e,t,n,i){var r=this.cursorElement,a=0,s=i;switch(this.cursorOptions.type){case 1:r.style.top=10*n*this.openSheetMusicDisplay.zoom+"px",r.style.left=10*(t-1.5)*this.openSheetMusicDisplay.zoom+"px",s=10*i*this.openSheetMusicDisplay.zoom,r.height=s,r.style.height=s+"px",a=5*this.openSheetMusicDisplay.zoom;break;case 2:r.style.top=10*(n-2.5)*this.openSheetMusicDisplay.zoom+"px",r.style.left=10*t*this.openSheetMusicDisplay.zoom+"px",s=15*this.openSheetMusicDisplay.zoom,r.height=s,r.style.height=s+"px",a=5*this.openSheetMusicDisplay.zoom;break;case 3:r.style.top=10*e.AbsolutePosition.y*this.openSheetMusicDisplay.zoom+"px",r.style.left=10*e.AbsolutePosition.x*this.openSheetMusicDisplay.zoom+"px",s=10*i*this.openSheetMusicDisplay.zoom,r.height=s,r.style.height=s+"px",a=10*e.Size.width*this.openSheetMusicDisplay.zoom;break;case 4:r.style.top=10*e.AbsolutePosition.y*this.openSheetMusicDisplay.zoom+"px",r.style.left=10*e.AbsolutePosition.x*this.openSheetMusicDisplay.zoom+"px",s=10*i*this.openSheetMusicDisplay.zoom,r.height=s,r.style.height=s+"px",a=10*(t-e.AbsolutePosition.x)*this.openSheetMusicDisplay.zoom;break;default:r.style.top=10*n*this.openSheetMusicDisplay.zoom+"px",r.style.left=10*(t-1.5)*this.openSheetMusicDisplay.zoom+"px",s=10*i*this.openSheetMusicDisplay.zoom,r.height=s,r.style.height=s+"px",a=30*this.openSheetMusicDisplay.zoom}a!==r.width&&(r.width=a,this.updateStyle(a,this.cursorOptions))}},{key:"hide",value:function(){this.cursorElement.style.display="none",this.hidden=!0}},{key:"next",value:function(){this.Iterator.moveToNextVisibleVoiceEntry(!1),this.update()}},{key:"reset",value:function(){this.resetIterator();var e=this.manager.getIterator(this.graphic.ParentMusicSheet.SelectionStart);this.updateWithTimestamp(e.CurrentEnrolledTimestamp)}},{key:"updateStyle",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;void 0!==t&&(this.cursorOptions=t);var n=document.createElement("canvas");n.width=this.cursorElement.width,n.height=1;var i=n.getContext("2d");i.globalAlpha=this.cursorOptions.alpha;var r=i.createLinearGradient(0,0,this.cursorElement.width,0);switch(this.cursorOptions.type){case 1:case 2:case 3:case 4:r.addColorStop(1,this.cursorOptions.color);break;default:r.addColorStop(0,"white"),r.addColorStop(.2,this.cursorOptions.color),r.addColorStop(.8,this.cursorOptions.color),r.addColorStop(1,"white")}i.fillStyle=r,i.fillRect(0,0,e,1),this.cursorElement.src=n.toDataURL("image/png")}},{key:"Iterator",get:function(){return this.iterator}},{key:"Hidden",get:function(){return this.hidden}},{key:"VoicesUnderCursor",value:function(e){return this.Iterator.CurrentVisibleVoiceEntries(e)}},{key:"NotesUnderCursor",value:function(e){var t=this.VoicesUnderCursor(e),n=[];return t.forEach((function(e){n.push.apply(n,e.Notes)})),n}},{key:"GNotesUnderCursor",value:function(e){var t=this,n=this.VoicesUnderCursor(e),i=[];return n.forEach((function(e){i.push.apply(i,_toConsumableArray2(e.Notes.map((function(e){return t.rules.GNote(e)}))))})),i}},{key:"updateCurrentPage",value:function(){var e,t=this.Iterator.currentTimeStamp,n=_createForOfIteratorHelper(this.graphic.MusicPages);try{for(n.s();!(e=n.n()).done;){var i=e.value;if(i.MusicSystems.last().GetSystemsLastTimeStamp().gt(t)){var r=i.PageNumber;return r!==this.currentPageNumber&&(this.container.removeChild(this.cursorElement),this.container=document.getElementById(this.rules.DYContainerId+r),this.container.appendChild(this.cursorElement)),this.currentPageNumber=r}}}catch(err){n.e(err)}finally{n.f()}return 1}},{key:"updateCurrentPageFromSystem",value:function(e){if(null!=e&&e.Parent){var t=e.Parent.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}}]),e}(),PointF2D=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;_classCallCheck2(this,e),this.x=0,this.y=0,this.x=t,this.y=n}return _createClass2(e,[{key:"ToString",value:function(){return"["+this.x+", "+this.y+"]"}}],[{key:"Empty",get:function(){return new e}},{key:"pointsAreEqual",value:function(e,t){return e.x===t.x&&e.y===t.y}}]),e}(),SizeF2D=_createClass2((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;_classCallCheck2(this,e),this.width=t,this.height=n})),RectangleF2D=function(){function e(t,n,i,r){_classCallCheck2(this,e),this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=n,this.width=i,this.height=r}return _createClass2(e,[{key:"Location",get:function(){return new PointF2D(this.x,this.y)}},{key:"Size",get:function(){return new SizeF2D(this.width,this.height)}}],[{key:"createFromLocationAndSize",value:function(t,n){return new e(t.x,t.y,n.width,n.height)}}]),e}(),AClassHierarchyTrackable=function(){function e(){_classCallCheck2(this,e)}return _createClass2(e,[{key:"isInstanceOfClass",value:function(e){for(var t=this.constructor.prototype;t;){if(e===t.constructor.name)return!0;t=t.__proto__}return!1}}]),e}(),GraphicalObject=function(e){_inherits2(n,e);var t=_createSuper(n);function n(){return _classCallCheck2(this,n),t.apply(this,arguments)}return _createClass2(n,[{key:"PositionAndShape",get:function(){return this.boundingBox},set:function(e){this.boundingBox=e}}]),n}(AClassHierarchyTrackable),StaffLineActivitySymbol=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e){var i;_classCallCheck2(this,n),(i=t.call(this)).parentStaffLine=e;var r=e.PositionAndShape;return i.boundingBox=new BoundingBox$2(_assertThisInitialized2(i),r),i.boundingBox.BorderRight=6,i.boundingBox.BorderBottom=4.5,i.boundingBox.BorderLeft=-1.5,i.boundingBox.BorderTop=-1.5,i}return _createClass2(n)}(GraphicalObject),Clickable=function(e){_inherits2(n,e);var t=_createSuper(n);function n(){return _classCallCheck2(this,n),t.apply(this,arguments)}return _createClass2(n)}(GraphicalObject),BoundingBox$2=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];_classCallCheck2(this,e),this.isSymbol=!1,this.relativePositionHasBeenSet=!1,this.xBordersHaveBeenSet=!1,this.yBordersHaveBeenSet=!1,this.absolutePosition=new PointF2D,this.relativePosition=new PointF2D,this.size=new SizeF2D,this.marginSize=new SizeF2D,this.upperLeftCorner=new PointF2D,this.upperLeftMarginCorner=new PointF2D,this.borderLeft=0,this.borderRight=0,this.borderTop=0,this.borderBottom=0,this.borderMarginLeft=0,this.borderMarginRight=0,this.borderMarginTop=0,this.borderMarginBottom=0,this.childElements=[],this.parent=n,this.dataObject=t,this.isSymbol=i,this.xBordersHaveBeenSet=!1,this.yBordersHaveBeenSet=!1,n&&(this.Parent=n)}return _createClass2(e,[{key:"RelativePositionHasBeenSet",get:function(){return this.relativePositionHasBeenSet}},{key:"XBordersHaveBeenSet",get:function(){return this.xBordersHaveBeenSet},set:function(e){this.xBordersHaveBeenSet=e}},{key:"YBordersHaveBeenSet",get:function(){return this.yBordersHaveBeenSet},set:function(e){this.yBordersHaveBeenSet=e}},{key:"AbsolutePosition",get:function(){return this.absolutePosition},set:function(e){this.absolutePosition=e}},{key:"RelativePosition",get:function(){return this.relativePosition},set:function(e){this.relativePosition=e,this.relativePositionHasBeenSet=!0}},{key:"Size",get:function(){return this.size},set:function(e){this.size=e}},{key:"MarginSize",get:function(){return this.marginSize}},{key:"UpperLeftCorner",get:function(){return this.upperLeftCorner}},{key:"UpperLeftMarginCorner",get:function(){return this.upperLeftMarginCorner}},{key:"BorderLeft",get:function(){return this.borderLeft},set:function(e){this.borderLeft=e,this.calculateRectangle()}},{key:"BorderRight",get:function(){return this.borderRight},set:function(e){this.borderRight=e,this.calculateRectangle()}},{key:"BorderTop",get:function(){return this.borderTop},set:function(e){this.borderTop=e,this.calculateRectangle()}},{key:"BorderBottom",get:function(){return this.borderBottom},set:function(e){this.borderBottom=e,this.calculateRectangle()}},{key:"BorderMarginLeft",get:function(){return this.borderMarginLeft>this.borderLeft?this.borderLeft:this.borderMarginLeft},set:function(e){this.borderMarginLeft=e,this.calculateMarginRectangle()}},{key:"BorderMarginRight",get:function(){return this.borderMarginRightthis.borderTop?this.borderTop:this.borderMarginTop},set:function(e){this.borderMarginTop=e,this.calculateMarginRectangle()}},{key:"BorderMarginBottom",get:function(){return this.borderMarginBottom-1&&this.parent.ChildElements.splice(a,1)}(this.parent=e,(null===(t=this.parent)||void 0===t||null===(n=t.ChildElements)||void 0===n?void 0:n.indexOf(this))>-1)?log$2.error("BoundingBox of "+this.dataObject.constructor.name+" already in children list of "+this.parent.dataObject.constructor.name+"'s BoundingBox"):null===(i=this.parent)||void 0===i||null===(r=i.ChildElements)||void 0===r||r.push(this)}},{key:"DataObject",get:function(){return this.dataObject}},{key:"Center",get:function(){return new PointF2D(this.RelativePosition.x+(this.BorderMarginRight+this.BorderMarginLeft),this.RelativePosition.y+(this.BorderMarginBottom+this.BorderMarginTop))}},{key:"setAbsolutePositionFromParent",value:function(){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}},{key:"calculateAbsolutePosition",value:function(){this.absolutePosition.x=this.relativePosition.x,this.absolutePosition.y=this.relativePosition.y;for(var e=this.parent;e;)this.absolutePosition.x+=e.relativePosition.x,this.absolutePosition.y+=e.relativePosition.y,e=e.parent}},{key:"calculateAbsolutePositionsRecursiveWithoutTopelement",value:function(){this.absolutePosition.x=0,this.absolutePosition.y=0;for(var e=0,t=this.ChildElements.length;e.001;break;case ColDirEnum.Up:case ColDirEnum.Down:i=this.relativePosition.y,e.calculateMarginPositionAlongDirection(this,t),r=Math.abs(i-this.relativePosition.y)>.001;break;default:throw new ArgumentOutOfRangeException("direction")}}while(r)}},{key:"collisionDetection",value:function(e){var t=Math.min(this.AbsolutePosition.x+this.borderRight,e.absolutePosition.x+e.borderRight)-Math.max(this.AbsolutePosition.x+this.borderLeft,e.absolutePosition.x+e.borderLeft),n=Math.min(this.AbsolutePosition.y+this.borderBottom,e.absolutePosition.y+e.borderBottom)-Math.max(this.AbsolutePosition.y+this.borderTop,e.absolutePosition.y+e.borderTop);return t>0&&n>0}},{key:"liesInsideBorders",value:function(e){var t=this.AbsolutePosition.x+this.borderLeft<=e.absolutePosition.x+e.borderLeft&&e.absolutePosition.x+e.borderLeft<=this.AbsolutePosition.x+this.borderRight,n=this.AbsolutePosition.x+this.borderLeft<=e.absolutePosition.x+e.borderRight&&e.absolutePosition.x+e.borderRight<=this.AbsolutePosition.x+this.borderRight;if(t&&n){var i=this.AbsolutePosition.y+this.borderTop<=e.absolutePosition.y+e.borderTop&&e.absolutePosition.y+e.borderTop<=this.AbsolutePosition.y+this.borderBottom,r=this.AbsolutePosition.y+this.borderTop<=e.absolutePosition.y+e.borderBottom&&e.absolutePosition.y+e.borderBottom<=this.AbsolutePosition.y+this.borderBottom;if(i&&r)return!0}return!1}},{key:"pointLiesInsideBorders",value:function(e){if(this.AbsolutePosition.x+this.borderLeft<=e.x&&e.x<=this.AbsolutePosition.x+this.borderRight&&(this.AbsolutePosition.y+this.borderTop<=e.y&&e.y<=this.AbsolutePosition.y+this.borderBottom))return!0;return!1}},{key:"marginCollisionDetection",value:function(e){var t=Math.min(this.AbsolutePosition.x+this.borderMarginRight,e.absolutePosition.x+e.borderMarginRight)-Math.max(this.AbsolutePosition.x+this.borderMarginLeft,e.absolutePosition.x+e.borderMarginLeft),n=Math.min(this.AbsolutePosition.y+this.borderMarginBottom,e.absolutePosition.y+e.borderMarginBottom)-Math.max(this.AbsolutePosition.y+this.borderMarginTop,e.absolutePosition.y+e.borderMarginTop);return t>0&&n>0}},{key:"liesInsideMargins",value:function(e){var t=this.AbsolutePosition.x+this.borderMarginLeft<=e.absolutePosition.x+e.borderMarginLeft&&e.absolutePosition.x+e.borderMarginLeft<=this.AbsolutePosition.x+this.borderMarginRight,n=this.AbsolutePosition.x+this.borderMarginLeft<=e.absolutePosition.x+e.borderMarginRight&&e.absolutePosition.x+e.borderMarginRight<=this.AbsolutePosition.x+this.borderMarginRight;if(t&&n){var i=this.AbsolutePosition.y+this.borderMarginTop<=e.absolutePosition.y+e.borderMarginTop&&e.absolutePosition.y+e.borderMarginTop<=this.AbsolutePosition.y+this.borderMarginBottom,r=this.AbsolutePosition.y+this.borderMarginTop<=e.absolutePosition.y+e.borderMarginBottom&&e.absolutePosition.y+e.borderMarginBottom<=this.AbsolutePosition.y+this.borderMarginBottom;if(i&&r)return!0}return!1}},{key:"pointLiesInsideMargins",value:function(e){if(this.AbsolutePosition.x+this.borderMarginLeft<=e.x&&e.x<=this.AbsolutePosition.x+this.borderMarginRight&&(this.AbsolutePosition.y+this.borderMarginTop<=e.y&&e.y<=this.AbsolutePosition.y+this.borderMarginBottom))return!0;return!1}},{key:"computeNonOverlappingPosition",value:function(e,t,n){this.RelativePosition=new PointF2D(n.x,n.y),this.setAbsolutePositionFromParent();var i=0,r=!1;do{switch(t){case ColDirEnum.Left:case ColDirEnum.Right:i=this.relativePosition.x,e.calculatePositionAlongDirection(this,t),r=Math.abs(i-this.relativePosition.x)>1e-4;break;case ColDirEnum.Up:case ColDirEnum.Down:i=this.relativePosition.y,e.calculatePositionAlongDirection(this,t),r=Math.abs(i-this.relativePosition.y)>1e-4;break;default:throw new ArgumentOutOfRangeException("direction")}}while(r)}},{key:"getClickedObjectOfType",value:function(e){var t=this.dataObject;if(this.pointLiesInsideBorders(e)&&t)return t;for(var n=0,i=this.childElements.length;n1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:GraphicalObject.name,r=[],a=_createForOfIteratorHelper(this.childElements);try{for(a.s();!(t=a.n()).done;){var s=t.value;r=r.concat(s.getObjectsInRegion(e,n,i))}}catch(err){a.e(err)}finally{a.f()}return this.dataObject&&this.dataObject.isInstanceOfClass(i)&&(n?e.liesInsideBorders(this)&&r.push(this.dataObject):e.collisionDetection(this)&&r.push(this.dataObject)),r}},{key:"calculateRectangle",value:function(){this.upperLeftCorner=new PointF2D(this.BorderLeft,this.BorderTop),this.size=new SizeF2D(this.BorderRight-this.BorderLeft,this.BorderBottom-this.BorderTop),this.boundingRectangle=RectangleF2D.createFromLocationAndSize(this.upperLeftCorner,this.size)}},{key:"calculateMarginRectangle",value:function(){this.upperLeftMarginCorner=new PointF2D(this.BorderMarginLeft,this.BorderMarginTop),this.marginSize=new SizeF2D(this.BorderMarginRight-this.BorderMarginLeft,this.BorderMarginBottom-this.BorderMarginTop),this.boundingMarginRectangle=RectangleF2D.createFromLocationAndSize(this.upperLeftMarginCorner,this.marginSize)}},{key:"calculateMarginPositionAlongDirection",value:function(e,t){if(this!==e){if(this.isSymbol&&this.marginCollisionDetection(e)){var n=0;switch(t){case ColDirEnum.Left:return n=this.absolutePosition.x+this.borderMarginLeft-(e.absolutePosition.x+e.borderMarginRight),e.relativePosition.x+=n,void(e.absolutePosition.x+=n);case ColDirEnum.Right:return n=this.absolutePosition.x+this.borderMarginRight-(e.absolutePosition.x+e.borderMarginLeft),e.relativePosition.x+=n,void(e.absolutePosition.x+=n);case ColDirEnum.Up:return n=this.absolutePosition.y+this.borderMarginTop-(e.absolutePosition.y+e.borderMarginBottom),e.relativePosition.y+=n,void(e.absolutePosition.y+=n);case ColDirEnum.Down:return n=this.absolutePosition.y+this.borderMarginBottom-(e.absolutePosition.y+e.borderMarginTop),e.relativePosition.y+=n,void(e.absolutePosition.y+=n);default:throw new ArgumentOutOfRangeException("direction")}}for(var i=0,r=this.ChildElements.length;i3&&void 0!==arguments[3]?arguments[3]:void 0;_classCallCheck2(this,e),this.accidental=2,this.fundamentalNote=t,this.octave=n,this.accidental=i,this.accidentalXml=r,this.halfTone=t+12*(n+e.octXmlDiff)+e.HalfTonesFromAccidental(i),this.frequency=e.calcFrequency(this),this.nextFrequency=e.calcFrequency(this,"next"),this.prevFrequency=e.calcFrequency(this,"prev")}return _createClass2(e,[{key:"AccidentalHalfTones",get:function(){return e.HalfTonesFromAccidental(this.accidental)}},{key:"Octave",get:function(){return this.octave}},{key:"FundamentalNote",get:function(){return this.fundamentalNote}},{key:"Accidental",get:function(){return this.accidental}},{key:"AccidentalXml",get:function(){return this.accidentalXml}},{key:"Frequency",get:function(){return this.frequency}},{key:"getHalfTone",value:function(){return this.halfTone}},{key:"getTransposedPitch",value:function(e){if(e>12)throw new Error("rewrite this method to handle bigger octave changes or don't use is with bigger octave changes!");return e>0?this.getHigherPitchByTransposeFactor(e):e<0?this.getLowerPitchByTransposeFactor(-e):this}},{key:"DoEnharmonicChange",value:function(){switch(this.accidental){case 1:case 5:this.fundamentalNote=this.getPreviousFundamentalNote(this.fundamentalNote),this.accidental=e.AccidentalFromHalfTones(this.halfTone-(this.fundamentalNote+12*(this.octave+e.octXmlDiff)));break;case 0:case 4:this.fundamentalNote=this.getNextFundamentalNote(this.fundamentalNote),this.accidental=e.AccidentalFromHalfTones(this.halfTone-(this.fundamentalNote+12*(this.octave+e.octXmlDiff)));break;default:return}}},{key:"ToString",value:function(){var t=e.accidentalVexflow(this.accidental);return t||(t=""),"Key: "+e.getNoteEnumString(this.fundamentalNote)+t+", Note: "+this.fundamentalNote+", octave: "+this.octave.toString()}},{key:"OperatorEquals",value:function(e){var t=this;return!(!t||!e)&&(t.FundamentalNote===e.FundamentalNote&&t.Octave===e.Octave&&t.Accidental===e.Accidental)}},{key:"OperatorNotEqual",value:function(e){return!(this===e)}},{key:"OperatorFundamentalGreaterThan",value:function(e){var t=this;return t.Octave===e.Octave?t.FundamentalNote>e.FundamentalNote:t.Octave>e.Octave}},{key:"OperatorFundamentalLessThan",value:function(e){var t=this;return t.Octave===e.Octave?t.FundamentalNotee.pitchEnumValues.length-1?(n=e.pitchEnumValues[i+t-e.pitchEnumValues.length],r++):n=e.pitchEnumValues[i+t],new e(n,r,2)}},{key:"getLowerPitchByTransposeFactor",value:function(t){var n,i=e.pitchEnumValues.indexOf(this.fundamentalNote),r=this.octave;return i-t<0?(n=e.pitchEnumValues[e.pitchEnumValues.length+i-t],r--):n=e.pitchEnumValues[i-t],new e(n,r,2)}},{key:"getNextFundamentalNote",value:function(t){var n=e.pitchEnumValues.indexOf(t);return n=(n+1)%e.pitchEnumValues.length,e.pitchEnumValues[n]}},{key:"getPreviousFundamentalNote",value:function(t){var n=e.pitchEnumValues.indexOf(t);return n>0?e.pitchEnumValues[n-1]:e.pitchEnumValues[e.pitchEnumValues.length-1]}}],[{key:"getNoteEnumString",value:function(e){switch(e){case 0:return"C";case 2:return"D";case 4:return"E";case 5:return"F";case 7:return"G";case 9:return"A";case 11:return"B";default:return""}}},{key:"lineShiftFromNoteEnum",value:function(t,n){if(0===n)return[t,0];var i=e.pitchEnumValues,r=i.indexOf(t),a=0,s=(r+n)%i.length;return r+n>i.length-1&&(a=1),s<0&&(s=i.length+s,a=-1),[i[s],a]}},{key:"CalculateTransposedHalfTone",value:function(t,n){var i=t.fundamentalNote+t.AccidentalHalfTones+n;return e.WrapAroundCheck(i,12)}},{key:"WrapAroundCheck",value:function(e,t){for(var n=0;e<0;)e+=t,n--;for(;e>=t;)e-=t,n++;return{overflow:n,halftone:e}}},{key:"calcFrequency",value:function(t,n){var i,r=0;if(t instanceof e){var a=t;r=a.octave-1,i=a.fundamentalNote-9+a.AccidentalHalfTones}else if("number"==typeof t){i=t-57}var s=window.DYSubjectId,o=0;for(var l in"COLEXIU"===window.DYEnvironment&&(Additional[12]=[120]),Additional){if(Object.prototype.hasOwnProperty.call(Additional,l))if(Additional[l].includes(s)){o=parseFloat(l);break}}var u=i+o;return"next"===n&&u++,"prev"===n&&u--,442*Math.pow(2,r)*Math.pow(2,u/12)}},{key:"calcFractionalKey",value:function(t){return Math.log(t/440)/Math.LN10*e.halftoneFactor+57}},{key:"fromFrequency",value:function(t){var n=e.calcFractionalKey(t)+.5,i=Math.floor(n/12)-e.octXmlDiff,r=Math.floor(n)%12,a=r,s=2;return-1===this.pitchEnumValues.indexOf(a)&&(a=r-1,s=0),new e(a,i,s)}},{key:"fromHalftone",value:function(t){var n=Math.floor(t/12)-e.octXmlDiff,i=t%12,r=i,a=2;return-1===this.pitchEnumValues.indexOf(r)&&(r=i-1,a=0),new e(r,n,a)}},{key:"ceiling",value:function(e){var t=e%=12;return-1===this.pitchEnumValues.indexOf(t)&&(t=e+1),t}},{key:"floor",value:function(e){var t=e%=12;return-1===this.pitchEnumValues.indexOf(t)&&(t=e-1),t}},{key:"HalfTonesFromAccidental",value:function(e){switch(e){case 2:case 3:return 0;case 0:return 1;case 1:return-1;case 4:return 2;case 5:return-2;case 6:return 3;case 7:return-3;case 8:return.5;case 9:return-.5;case 10:return-.51;case 11:return 1.5;case 12:return-1.5;case 13:return.0013;case 14:return.0014;case 15:return-.0015;case 16:return.0016;case 17:return.0017;default:throw new Error("Unhandled AccidentalEnum value")}}},{key:"AccidentalFromHalfTones",value:function(e){switch(e){case 0:return 2;case 1:return 0;case-1:return 1;case 2:return 4;case-2:return 5;case 3:return 6;case-3:return 7;case.5:return 8;case-.5:return 9;case 1.5:return 11;case-1.5:return 12;default:return e>0&&e<1?8:e<0&&e>-1?9:8}}},{key:"accidentalVexflow",value:function(e){var t;switch(e){case 3:t="n";break;case 1:t="b";break;case 0:t="#";break;case 4:t="##";break;case 6:t="###";break;case 5:t="bb";break;case 7:t="bbs";break;case 8:t="+";break;case 9:t="d";break;case 10:t="bs";break;case 11:t="++";break;case 12:t="db";break;case 13:t="+-";break;case 14:t="++-";break;case 15:t="bss";break;case 16:t="o";break;case 17:t="k"}return t}},{key:"OctaveXmlDifference",get:function(){return e.octXmlDiff}}]),e}(),Pitch=_Pitch;Pitch.pitchEnumValues=[0,2,4,5,7,9,11],Pitch.halftoneFactor=12/(Math.LN2/Math.LN10),Pitch.octXmlDiff=3;var VerticalGraphicalStaffEntryContainer=function(){function e(t,n){_classCallCheck2(this,e),this.staffEntries=[],this.absoluteTimestamp=n,this.staffEntries=new Array(t)}return _createClass2(e,[{key:"Index",get:function(){return this.index},set:function(e){this.index=e}},{key:"AbsoluteTimestamp",get:function(){return this.absoluteTimestamp}},{key:"StaffEntries",get:function(){return this.staffEntries},set:function(e){this.staffEntries=e}},{key:"getFirstNonNullStaffEntry",value:function(){for(var e=0,t=this.staffEntries.length;ei?1:0}}]),e}(),OutlineAndFillStyleEnum=function(e){return e[e.BaseWritingColor=0]="BaseWritingColor",e[e.FollowingCursor=1]="FollowingCursor",e[e.AlternativeFollowingCursor=2]="AlternativeFollowingCursor",e[e.PlaybackCursor=3]="PlaybackCursor",e[e.Highlighted=4]="Highlighted",e[e.ErrorUnderlay=5]="ErrorUnderlay",e[e.Selected=6]="Selected",e[e.SelectionSymbol=7]="SelectionSymbol",e[e.DebugColor1=8]="DebugColor1",e[e.DebugColor2=9]="DebugColor2",e[e.DebugColor3=10]="DebugColor3",e[e.SplitScreenDivision=11]="SplitScreenDivision",e[e.GreyTransparentOverlay=12]="GreyTransparentOverlay",e[e.MarkedArea1=13]="MarkedArea1",e[e.MarkedArea2=14]="MarkedArea2",e[e.MarkedArea3=15]="MarkedArea3",e[e.MarkedArea4=16]="MarkedArea4",e[e.MarkedArea5=17]="MarkedArea5",e[e.MarkedArea6=18]="MarkedArea6",e[e.MarkedArea7=19]="MarkedArea7",e[e.MarkedArea8=20]="MarkedArea8",e[e.MarkedArea9=21]="MarkedArea9",e[e.MarkedArea10=22]="MarkedArea10",e[e.Comment1=23]="Comment1",e[e.Comment2=24]="Comment2",e[e.Comment3=25]="Comment3",e[e.Comment4=26]="Comment4",e[e.Comment5=27]="Comment5",e[e.Comment6=28]="Comment6",e[e.Comment7=29]="Comment7",e[e.Comment8=30]="Comment8",e[e.Comment9=31]="Comment9",e[e.Comment10=32]="Comment10",e}(OutlineAndFillStyleEnum||{}),OUTLINE_AND_FILL_STYLE_DICT=new Dictionary;OUTLINE_AND_FILL_STYLE_DICT.setValue(0,"Thistle"),OUTLINE_AND_FILL_STYLE_DICT.setValue(1,"Aqua"),OUTLINE_AND_FILL_STYLE_DICT.setValue(2,"Azure"),OUTLINE_AND_FILL_STYLE_DICT.setValue(3,"Bisque"),OUTLINE_AND_FILL_STYLE_DICT.setValue(4,"CadetBlue"),OUTLINE_AND_FILL_STYLE_DICT.setValue(5,"DarkBlue"),OUTLINE_AND_FILL_STYLE_DICT.setValue(6,"DarkGoldenRod"),OUTLINE_AND_FILL_STYLE_DICT.setValue(7,"BlanchedAlmond"),OUTLINE_AND_FILL_STYLE_DICT.setValue(8,"Chartreuse"),OUTLINE_AND_FILL_STYLE_DICT.setValue(9,"DarkGreen"),OUTLINE_AND_FILL_STYLE_DICT.setValue(10,"DarkOrange"),OUTLINE_AND_FILL_STYLE_DICT.setValue(11,"FireBrick"),OUTLINE_AND_FILL_STYLE_DICT.setValue(12,"DarkSalmon"),OUTLINE_AND_FILL_STYLE_DICT.setValue(13,"DarkSeaGreen"),OUTLINE_AND_FILL_STYLE_DICT.setValue(14,"DarkOrchid"),OUTLINE_AND_FILL_STYLE_DICT.setValue(15,"Aquamarine"),OUTLINE_AND_FILL_STYLE_DICT.setValue(16,"DarkKhaki"),OUTLINE_AND_FILL_STYLE_DICT.setValue(17,"ForestGreen"),OUTLINE_AND_FILL_STYLE_DICT.setValue(18,"AliceBlue"),OUTLINE_AND_FILL_STYLE_DICT.setValue(19,"DeepPink"),OUTLINE_AND_FILL_STYLE_DICT.setValue(20,"Coral"),OUTLINE_AND_FILL_STYLE_DICT.setValue(21,"DarkOliveGreen"),OUTLINE_AND_FILL_STYLE_DICT.setValue(22,"Chocolate"),OUTLINE_AND_FILL_STYLE_DICT.setValue(23,"DodgerBlue"),OUTLINE_AND_FILL_STYLE_DICT.setValue(24,"Blue"),OUTLINE_AND_FILL_STYLE_DICT.setValue(25,"Beige"),OUTLINE_AND_FILL_STYLE_DICT.setValue(26,"Crimson"),OUTLINE_AND_FILL_STYLE_DICT.setValue(27,"Fuchsia"),OUTLINE_AND_FILL_STYLE_DICT.setValue(28,"Brown"),OUTLINE_AND_FILL_STYLE_DICT.setValue(29,"BlanchedAlmond"),OUTLINE_AND_FILL_STYLE_DICT.setValue(30,"CornflowerBlue"),OUTLINE_AND_FILL_STYLE_DICT.setValue(31,"Cornsilk"),OUTLINE_AND_FILL_STYLE_DICT.setValue(32,"DarkGrey");var GraphicalLayers=function(e){return e[e.Background=0]="Background",e[e.Highlight=1]="Highlight",e[e.MeasureError=2]="MeasureError",e[e.SelectionSymbol=3]="SelectionSymbol",e[e.Cursor=4]="Cursor",e[e.PSI_Debug=5]="PSI_Debug",e[e.Notes=6]="Notes",e[e.Comment=7]="Comment",e[e.Debug_above=8]="Debug_above",e}(GraphicalLayers||{}),NoteState=function(e){return e[e.Normal=0]="Normal",e[e.Selected=1]="Selected",e[e.Follow_Confirmed=2]="Follow_Confirmed",e[e.QFeedback_NotFound=3]="QFeedback_NotFound",e[e.QFeedback_OK=4]="QFeedback_OK",e[e.QFeedback_Perfect=5]="QFeedback_Perfect",e[e.Debug1=6]="Debug1",e[e.Debug2=7]="Debug2",e[e.Debug3=8]="Debug3",e}(NoteState||{}),AutoColorSet=function(e){return e.C="#d82c6b",e.D="#F89D15",e.E="#FFE21A",e.F="#4dbd5c",e.G="#009D96",e.A="#43469d",e.B="#76429c",e.Rest="#000000",e}(AutoColorSet||{}),GraphicalLine=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:OutlineAndFillStyleEnum.BaseWritingColor,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;_classCallCheck2(this,e),this.start=t,this.end=n,this.width=i,this.styleId=r,this.colorHex=a}return _createClass2(e,[{key:"Start",get:function(){return this.start},set:function(e){this.start=e}},{key:"End",get:function(){return this.end},set:function(e){this.end=e}},{key:"Width",get:function(){return this.width},set:function(e){this.width=e}}]),e}(),ClefInstruction=function(e){_inherits2(n,e);var t=_createSuper(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ClefEnum.G,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;return _classCallCheck2(this,n),(e=t.call(this,void 0)).clefType=ClefEnum.G,e.line=2,e.octaveOffset=0,e.line=a,e.clefType=i,e.octaveOffset=r,e.calcParameters(),e}return _createClass2(n,[{key:"ClefType",get:function(){return this.clefType},set:function(e){this.clefType=e}},{key:"Line",get:function(){return this.line},set:function(e){this.line=e}},{key:"OctaveOffset",get:function(){return this.octaveOffset},set:function(e){this.octaveOffset=e}},{key:"ClefPitch",get:function(){return this.clefPitch},set:function(e){this.clefPitch=e}},{key:"ReferenceCyPosition",get:function(){return this.referenceCyPosition},set:function(e){this.referenceCyPosition=e}},{key:"Equals",value:function(e){return this===e||!(!this||!e)&&(this.clefPitch===e.clefPitch&&this.Line===e.Line)}},{key:"NotEqual",value:function(e){return!this.Equals(e)}},{key:"ToString",value:function(){return"ClefType: "+this.clefType}},{key:"calcParameters",value:function(){switch(this.clefType){case ClefEnum.G:this.clefPitch=new Pitch(NoteEnum.G,1+this.octaveOffset,AccidentalEnum.NONE),this.referenceCyPosition=5-this.line+2;break;case ClefEnum.F:this.clefPitch=new Pitch(NoteEnum.F,0+this.octaveOffset,AccidentalEnum.NONE),this.referenceCyPosition=5-this.line+1.5;break;case ClefEnum.C:this.clefPitch=new Pitch(NoteEnum.C,1+this.octaveOffset,AccidentalEnum.NONE),this.referenceCyPosition=5-this.line;break;case ClefEnum.percussion:this.clefPitch=new Pitch(NoteEnum.C,2,AccidentalEnum.NONE),this.referenceCyPosition=2;break;case ClefEnum.TAB:this.clefPitch=new Pitch(NoteEnum.G,0,AccidentalEnum.NONE),this.referenceCyPosition=0;break;default:throw new ArgumentOutOfRangeException("clefType")}}}],[{key:"getDefaultClefFromMidiInstrument",value:function(e){switch(e){case MidiInstrument.Acoustic_Grand_Piano:case MidiInstrument.Electric_Bass_finger:case MidiInstrument.Electric_Bass_pick:case MidiInstrument.Fretless_Bass:case MidiInstrument.Slap_Bass_1:case MidiInstrument.Slap_Bass_2:case MidiInstrument.Synth_Bass_1:case MidiInstrument.Synth_Bass_2:case MidiInstrument.Contrabass:return new n(ClefEnum.F,0,4);default:return new n(ClefEnum.G,0,2)}}},{key:"getAllPossibleClefs",value:function(){for(var e=[],t=0;t<=2;t++){var i=new n(ClefEnum.G,t,2);e.push(i)}for(var r=-2;r<=0;r++){var a=new n(ClefEnum.F,r,4);e.push(a)}return e}},{key:"isSupportedClef",value:function(e){switch(e){case ClefEnum.G:case ClefEnum.F:case ClefEnum.C:case ClefEnum.percussion:case ClefEnum.TAB:return!0;default:return!1}}}]),n}(AbstractNotationInstruction),ClefEnum=function(e){return e[e.G=0]="G",e[e.F=1]="F",e[e.C=2]="C",e[e.percussion=3]="percussion",e[e.TAB=4]="TAB",e}(ClefEnum||{}),MidiInstrument=function(e){return e[e.None=-1]="None",e[e.Acoustic_Grand_Piano=0]="Acoustic_Grand_Piano",e[e.Bright_Acoustic_Piano=1]="Bright_Acoustic_Piano",e[e.Electric_Grand_Piano=2]="Electric_Grand_Piano",e[e.Honky_tonk_Piano=3]="Honky_tonk_Piano",e[e.Electric_Piano_1=4]="Electric_Piano_1",e[e.Electric_Piano_2=5]="Electric_Piano_2",e[e.Harpsichord=6]="Harpsichord",e[e.Clavinet=7]="Clavinet",e[e.Celesta=8]="Celesta",e[e.Glockenspiel=9]="Glockenspiel",e[e.Music_Box=10]="Music_Box",e[e.Vibraphone=11]="Vibraphone",e[e.Marimba=12]="Marimba",e[e.Xylophone=13]="Xylophone",e[e.Tubular_Bells=14]="Tubular_Bells",e[e.Dulcimer=15]="Dulcimer",e[e.Drawbar_Organ=16]="Drawbar_Organ",e[e.Percussive_Organ=17]="Percussive_Organ",e[e.Rock_Organ=18]="Rock_Organ",e[e.Church_Organ=19]="Church_Organ",e[e.Reed_Organ=20]="Reed_Organ",e[e.Accordion=21]="Accordion",e[e.Harmonica=22]="Harmonica",e[e.Tango_Accordion=23]="Tango_Accordion",e[e.Acoustic_Guitar_nylon=24]="Acoustic_Guitar_nylon",e[e.Acoustic_Guitar_steel=25]="Acoustic_Guitar_steel",e[e.Electric_Guitar_jazz=26]="Electric_Guitar_jazz",e[e.Electric_Guitar_clean=27]="Electric_Guitar_clean",e[e.Electric_Guitar_muted=28]="Electric_Guitar_muted",e[e.Overdriven_Guitar=29]="Overdriven_Guitar",e[e.Distortion_Guitar=30]="Distortion_Guitar",e[e.Guitar_harmonics=31]="Guitar_harmonics",e[e.Acoustic_Bass=32]="Acoustic_Bass",e[e.Electric_Bass_finger=33]="Electric_Bass_finger",e[e.Electric_Bass_pick=34]="Electric_Bass_pick",e[e.Fretless_Bass=35]="Fretless_Bass",e[e.Slap_Bass_1=36]="Slap_Bass_1",e[e.Slap_Bass_2=37]="Slap_Bass_2",e[e.Synth_Bass_1=38]="Synth_Bass_1",e[e.Synth_Bass_2=39]="Synth_Bass_2",e[e.Violin=40]="Violin",e[e.Viola=41]="Viola",e[e.Cello=42]="Cello",e[e.Contrabass=43]="Contrabass",e[e.Tremolo_Strings=44]="Tremolo_Strings",e[e.Pizzicato_Strings=45]="Pizzicato_Strings",e[e.Orchestral_Harp=46]="Orchestral_Harp",e[e.Timpani=47]="Timpani",e[e.String_Ensemble_1=48]="String_Ensemble_1",e[e.String_Ensemble_2=49]="String_Ensemble_2",e[e.Synth_Strings_1=50]="Synth_Strings_1",e[e.Synth_Strings_2=51]="Synth_Strings_2",e[e.Choir_Aahs=52]="Choir_Aahs",e[e.Voice_Oohs=53]="Voice_Oohs",e[e.Synth_Voice=54]="Synth_Voice",e[e.Orchestra_Hit=55]="Orchestra_Hit",e[e.Trumpet=56]="Trumpet",e[e.Trombone=57]="Trombone",e[e.Tuba=58]="Tuba",e[e.Muted_Trumpet=59]="Muted_Trumpet",e[e.French_Horn=60]="French_Horn",e[e.Brass_Section=61]="Brass_Section",e[e.Synth_Brass_1=62]="Synth_Brass_1",e[e.Synth_Brass_2=63]="Synth_Brass_2",e[e.Soprano_Sax=64]="Soprano_Sax",e[e.Alto_Sax=65]="Alto_Sax",e[e.Tenor_Sax=66]="Tenor_Sax",e[e.Baritone_Sax=67]="Baritone_Sax",e[e.Oboe=68]="Oboe",e[e.English_Horn=69]="English_Horn",e[e.Bassoon=70]="Bassoon",e[e.Clarinet=71]="Clarinet",e[e.Piccolo=72]="Piccolo",e[e.Flute=73]="Flute",e[e.Recorder=74]="Recorder",e[e.Pan_Flute=75]="Pan_Flute",e[e.Blown_Bottle=76]="Blown_Bottle",e[e.Shakuhachi=77]="Shakuhachi",e[e.Whistle=78]="Whistle",e[e.Ocarina=79]="Ocarina",e[e.Lead_1_square=80]="Lead_1_square",e[e.Lead_2_sawtooth=81]="Lead_2_sawtooth",e[e.Lead_3_calliope=82]="Lead_3_calliope",e[e.Lead_4_chiff=83]="Lead_4_chiff",e[e.Lead_5_charang=84]="Lead_5_charang",e[e.Lead_6_voice=85]="Lead_6_voice",e[e.Lead_7_fifths=86]="Lead_7_fifths",e[e.Lead_8_bass_lead=87]="Lead_8_bass_lead",e[e.Pad_1_new_age=88]="Pad_1_new_age",e[e.Pad_2_warm=89]="Pad_2_warm",e[e.Pad_3_polysynth=90]="Pad_3_polysynth",e[e.Pad_4_choir=91]="Pad_4_choir",e[e.Pad_5_bowed=92]="Pad_5_bowed",e[e.Pad_6_metallic=93]="Pad_6_metallic",e[e.Pad_7_halo=94]="Pad_7_halo",e[e.Pad_8_sweep=95]="Pad_8_sweep",e[e.FX_1_rain=96]="FX_1_rain",e[e.FX_2_soundtrack=97]="FX_2_soundtrack",e[e.FX_3_crystal=98]="FX_3_crystal",e[e.FX_4_atmosphere=99]="FX_4_atmosphere",e[e.FX_5_brightness=100]="FX_5_brightness",e[e.FX_6_goblins=101]="FX_6_goblins",e[e.FX_7_echoes=102]="FX_7_echoes",e[e.FX_8_scifi=103]="FX_8_scifi",e[e.Sitar=104]="Sitar",e[e.Banjo=105]="Banjo",e[e.Shamisen=106]="Shamisen",e[e.Koto=107]="Koto",e[e.Kalimba=108]="Kalimba",e[e.Bag_pipe=109]="Bag_pipe",e[e.Fiddle=110]="Fiddle",e[e.Shanai=111]="Shanai",e[e.Tinkle_Bell=112]="Tinkle_Bell",e[e.Agogo=113]="Agogo",e[e.Steel_Drums=114]="Steel_Drums",e[e.Woodblock=115]="Woodblock",e[e.Taiko_Drum=116]="Taiko_Drum",e[e.Melodic_Tom=117]="Melodic_Tom",e[e.Synth_Drum=118]="Synth_Drum",e[e.Reverse_Cymbal=119]="Reverse_Cymbal",e[e.Guitar_Fret_Noise=120]="Guitar_Fret_Noise",e[e.Breath_Noise=121]="Breath_Noise",e[e.Seashore=122]="Seashore",e[e.Bird_Tweet=123]="Bird_Tweet",e[e.Telephone_Ring=124]="Telephone_Ring",e[e.Helicopter=125]="Helicopter",e[e.Applause=126]="Applause",e[e.Gunshot=127]="Gunshot",e[e.euphonium=128]="euphonium",e[e.AltoClarinetInEb=200]="AltoClarinetInEb",e[e.TrumpetInBb=201]="TrumpetInBb",e[e.BaritoneSaxophone=202]="BaritoneSaxophone",e[e.TenorSaxophone=203]="TenorSaxophone",e[e.ClarinetInEb=204]="ClarinetInEb",e[e.Euphonium=205]="Euphonium",e[e.Alto_Clarinet=206]="Alto_Clarinet",e[e.Bass_Clarinet=207]="Bass_Clarinet",e[e.Bass_Trombone=208]="Bass_Trombone",e[e.clarinet_in_bb=209]="clarinet_in_bb",e[e.clarinet_in_eb=210]="clarinet_in_eb",e[e.Percussion=135]="Percussion",e}(MidiInstrument||{}),_KeyInstruction=function(e){_inherits2(n,e);var t=_createSuper(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:KeyEnum.major;return _classCallCheck2(this,n),(e=t.call(this,i)).isTransposedBy=0,e.Key=r,e.keyTypeOriginal=r,e.mode=a,e.alteratedNotes=e.calcAlteratedNotes(),e}return _createClass2(n,[{key:"Key",get:function(){return this.keyType},set:function(e){this.keyType=e,this.alteratedNotes=this.calcAlteratedNotes()}},{key:"Mode",get:function(){return this.mode},set:function(e){this.mode=e}},{key:"AlteratedNotes",get:function(){return this.alteratedNotes}},{key:"calcAlteratedNotes",value:function(){var e=[];if(this.keyType>0)for(var t=0;t=0}},{key:"getAlterationForPitch",value:function(e){return this.keyType>0&&this.alteratedNotes.indexOf(e.FundamentalNote)<=this.keyType?AccidentalEnum.SHARP:this.keyType<0&&this.alteratedNotes.indexOf(e.FundamentalNote)<=Math.abs(this.keyType)?AccidentalEnum.FLAT:AccidentalEnum.NONE}},{key:"ToString",value:function(){return"Key: "+this.keyType+this.mode}},{key:"OperatorEquals",value:function(e){var t=this;return t===e||!(!t||!e)&&(t.Key===e.Key&&t.Mode===e.Mode)}},{key:"OperatorNotEqual",value:function(e){return!this.OperatorEquals(e)}}],[{key:"copy",value:function(e){var t=new n(e.parent,e.Key,e.Mode);return t.keyTypeOriginal=e.keyTypeOriginal,t}},{key:"getAllPossibleMajorKeyInstructions",value:function(){for(var e=[],t=-7;t<7;t++){var i=new n(void 0,t,KeyEnum.major);e.push(i)}return e}}]),n}(AbstractNotationInstruction),KeyInstruction=_KeyInstruction;KeyInstruction.sharpPositionList=[NoteEnum.F,NoteEnum.C,NoteEnum.G,NoteEnum.D,NoteEnum.A,NoteEnum.E,NoteEnum.B],KeyInstruction.flatPositionList=[NoteEnum.B,NoteEnum.E,NoteEnum.A,NoteEnum.D,NoteEnum.G,NoteEnum.C,NoteEnum.F];var KeyEnum=function(e){return e[e.major=0]="major",e[e.minor=1]="minor",e[e.none=2]="none",e[e.dorian=3]="dorian",e[e.phrygian=4]="phrygian",e[e.lydian=5]="lydian",e[e.mixolydian=6]="mixolydian",e[e.aeolian=7]="aeolian",e[e.ionian=8]="ionian",e[e.locrian=9]="locrian",e}(KeyEnum||{});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(e){return-1!==this.indexOf(e)}});var CollectionUtil=function(){function e(){_classCallCheck2(this,e)}return _createClass2(e,null,[{key:"contains2",value:function(e,t){for(var n=0;n3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:e.length-1,a=1;i<=r;){var s=n(e[a=Math.floor((i+r)/2)],t);if(0===s)return a;s<0&&(i=a+1),0=0;n--){var i=this.measureList[n][t];if(i)return i}}},{key:"findGraphicalStaffEntryFromMeasureList",value:function(e,t,n){for(var i=t;i0)return a.staffEntries[0]}}},{key:"getFirstVisibleMeasuresListFromIndices",value:function(e,t){for(var n=[],i=this.measureList[0].length,r=e;r<=t;r++)for(var a=0;a=0;n--){if(this.verticalGraphicalStaffEntryContainers[n].AbsoluteTimestamp.lt(e)){var i=new VerticalGraphicalStaffEntryContainer(this.numberOfStaves,e);return this.verticalGraphicalStaffEntryContainers.splice(n+1,0,i),i}if(this.verticalGraphicalStaffEntryContainers[n].AbsoluteTimestamp.Equals(e))return this.verticalGraphicalStaffEntryContainers[n]}}},{key:"GetVerticalContainerFromTimestamp",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=CollectionUtil.binarySearch(this.verticalGraphicalStaffEntryContainers,new VerticalGraphicalStaffEntryContainer(0,e),VerticalGraphicalStaffEntryContainer.compareByTimestamp,t);if(n>=0)return this.verticalGraphicalStaffEntryContainers[n]}},{key:"GetInterpolatedIndexInVerticalContainers",value:function(e){var t=this.verticalGraphicalStaffEntryContainers,n=0,i=t.length-1,r=void 0,a=void 0;if(e.lte(t[t.length-1].AbsoluteTimestamp)){for(;i-n>1;){var s=Math.floor((i+n)/2);if(t[n].AbsoluteTimestamp.Equals(e)){i=n;break}if(t[i].AbsoluteTimestamp.Equals(e)){n=i;break}if(t[s].AbsoluteTimestamp.Equals(e))return this.verticalGraphicalStaffEntryContainers.indexOf(t[s]);e.lt(t[s].AbsoluteTimestamp)?i=s:n=s}if(n===i)return this.verticalGraphicalStaffEntryContainers.indexOf(t[n]);r=t[n].AbsoluteTimestamp,a=t[i].AbsoluteTimestamp}else r=t[t.length-1].AbsoluteTimestamp,a=Fraction$1.plus(this.getLongestStaffEntryDuration(t.length-1),r),i=t.length;var o=a.RealValue-r.RealValue,l=i-(a.RealValue-e.RealValue)/o;return Math.min(l,this.verticalGraphicalStaffEntryContainers.length)}},{key:"getVisibleStavesIndicesFromSourceMeasure",value:function(e){for(var t=[],n=[],i=0,r=e.length;i1&&void 0!==arguments[1])||arguments[1],n=this.measureList.length-1;return t&&(n=Math.min(n,this.musicSheet.Rules.MaxMeasureToDrawIndex)),this.measureList[n][e]}},{key:"getMeasureIndex",value:function(e,t,n){for(t=0;t1&&void 0!==arguments[1]?arguments[1]:GraphicalObject.name,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:20,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:5,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:void 0,s=[];0===s.length&&n<=i;){var o=new BoundingBox$2(void 0);o.BorderLeft=e.x-n,o.BorderTop=e.y-n,o.BorderRight=e.x+n,o.BorderBottom=e.y+n,o.AbsolutePosition=new PointF2D(e.x,e.y),o.calculateAbsolutePosition();for(var l=0,u=this.MusicPages.length;la.PositionAndShape.RelativePosition.x&&(n=a):n=a)}}catch(s){log$2.info("GraphicalMusicSheet.getStaffEntry",s)}return n}},{key:"GetPreviousVisibleContainerIndex",value:function(e){for(var t=e-1;t>=0;t--)for(var n=this.verticalGraphicalStaffEntryContainers[t].StaffEntries,i=0,r=n.length;i=0;r--)if(n=this.getStaffEntry(r)){if(!t)return n;if(n.sourceStaffEntry.ParentStaff.ParentInstrument.Visible)return n}}},{key:"findClosestRightStaffEntry",value:function(e,t){for(var n=void 0,i=Math.max(0,Math.ceil(e));i=t/2?parseInt(e/t,10)*t+t:parseInt(e/t,10)*t},Vex.MidLine=function(e,t){var n=t+(e-t)/2;return n%2>0&&(n=Vex.RoundN(10*n,5)/10),n},Vex.SortAndUnique=function(e,t,n){if(e.length>1){var i,r=[];e.sort(t);for(var a=0;a3&&void 0!==arguments[3]?arguments[3]:"#55";e.save(),e.setFillStyle(i),e.beginPath(),e.arc(t,n,3,0,2*Math.PI,!0),e.closePath(),e.fill(),e.restore()},Vex.BM=function(e,t){var n=(new Date).getTime();t();var i=(new Date).getTime()-n;Vex.L(e+i+"ms")},Vex.StackTrace=function(){return(new Error).stack},Vex.W=function(){for(var e=arguments.length,t=new Array(e),n=0;n0}},{key:"greaterThanEquals",value:function(t){var n=e.__compareB.copy(this);return n.subtract(t),n.numerator>=0}},{key:"lessThan",value:function(e){return!this.greaterThanEquals(e)}},{key:"lessThanEquals",value:function(e){return!this.greaterThan(e)}},{key:"clone",value:function(){return new e(this.numerator,this.denominator)}},{key:"copy",value:function(e){return"number"==typeof e?this.set(e||0,1):this.set(e.numerator,e.denominator)}},{key:"quotient",value:function(){return Math.floor(this.numerator/this.denominator)}},{key:"fraction",value:function(){return this.numerator%this.denominator}},{key:"abs",value:function(){return this.denominator=Math.abs(this.denominator),this.numerator=Math.abs(this.numerator),this}},{key:"toString",value:function(){return this.numerator+"/"+this.denominator}},{key:"toSimplifiedString",value:function(){return e.__tmp.copy(this).simplify().toString()}},{key:"toMixedString",value:function(){var t="",n=this.quotient(),i=e.__tmp.copy(this);return n<0?i.abs().fraction():i.fraction(),0!==n?(t+=n,0!==i.numerator&&(t+=" "+i.toSimplifiedString())):t=0===i.numerator?"0":i.toSimplifiedString(),t}},{key:"parse",value:function(e){var t=e.split("/"),n=parseInt(t[0],10),i=t[1]?parseInt(t[1],10):1;return this.set(n,i)}}],[{key:"GCD",value:function(e,t){if("number"!=typeof e||"number"!=typeof t)throw new Vex.RERR("BadArgument","Invalid numbers: ".concat(e,", ").concat(t));for(var n;0!==t;)n=t,t=e%t,e=n;return e}},{key:"LCM",value:function(t,n){return t*n/e.GCD(t,n)}},{key:"LCMM",value:function(t){if(0===t.length)return 0;if(1===t.length)return t[0];if(2===t.length)return e.LCM(t[0],t[1]);var n=t[0];return t.shift(),e.LCM(n,e.LCMM(t))}}]),e}();Fraction.__compareA=new Fraction,Fraction.__compareB=new Fraction,Fraction.__tmp=new Fraction;var X$3=Vex.MakeException("RegistryError");function setIndexValue(e,t,n,i,r){e[t][n]||(e[t][n]={}),e[t][n][i]=r}var Registry=function(){function e(){_classCallCheck2(this,e),this.clear()}return _createClass2(e,[{key:"clear",value:function(){return this.index={id:{},type:{},class:{}},this}},{key:"updateIndex",value:function(e){var t=e.id,n=e.name,i=e.value,r=e.oldValue,a=this.getElementById(t);null!==r&&this.index[n][r]&&delete this.index[n][r][t],null!==i&&setIndexValue(this.index,n,i,a.getAttribute("id"),a)}},{key:"register",value:function(t,n){var i=this;if(!(n=n||t.getAttribute("id")))throw new X$3("Can't add element without `id` attribute to registry",t);return t.setAttribute("id",n),setIndexValue(this.index,"id",n,n,t),e.INDEXES.forEach((function(e){i.updateIndex({id:n,name:e,value:t.getAttribute(e),oldValue:null})})),t.onRegister(this),this}},{key:"getElementById",value:function(e){return this.index.id[e]?this.index.id[e][e]:null}},{key:"getElementsByAttribute",value:function(e,t){var n=this.index[e];return n&&n[t]?Object.keys(n[t]).map((function(e){return n[t][e]})):[]}},{key:"getElementsByType",value:function(e){return this.getElementsByAttribute("type",e)}},{key:"getElementsByClass",value:function(e){return this.getElementsByAttribute("class",e)}},{key:"onUpdate",value:function(t){var n=t.id,i=t.name,r=t.value,a=t.oldValue;return function(e,t){return e.filter((function(e){return e===t})).length>0}(e.INDEXES.concat(["id","class"]),i)?(this.updateIndex({id:n,name:i,value:r,oldValue:a}),this):this}}],[{key:"INDEXES",get:function(){return["type"]}},{key:"enableDefaultRegistry",value:function(t){e.defaultRegistry=t}},{key:"getDefaultRegistry",value:function(){return e.defaultRegistry}},{key:"disableDefaultRegistry",value:function(){e.defaultRegistry=null}}]),e}();Registry.defaultRegistry=null;var Element$2=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.type;_classCallCheck2(this,e),this.attrs={id:e.newID(),el:null,type:n||"Base",classes:{}},this.boundingBox=null,this.context=null,this.rendered=!1,Registry.getDefaultRegistry()&&Registry.getDefaultRegistry().register(this)}return _createClass2(e,[{key:"setStyle",value:function(e){return this.style=e,this}},{key:"getStyle",value:function(){return this.style}},{key:"applyStyle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.context,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getStyle();return t?(e.save(),t.shadowColor&&e.setShadowColor(t.shadowColor),t.shadowBlur&&e.setShadowBlur(t.shadowBlur),t.fillStyle&&e.setFillStyle(t.fillStyle),t.strokeStyle&&e.setStrokeStyle(t.strokeStyle),t.lineWidth&&e.setLineWidth(t.lineWidth),this):this}},{key:"restoreStyle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.context,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getStyle();return t?(e.restore(),this):this}},{key:"drawWithStyle",value:function(){this.checkContext(),this.applyStyle(),this.draw(),this.restoreStyle()}},{key:"hasClass",value:function(e){return!0===this.attrs.classes[e]}},{key:"addClass",value:function(e){return this.attrs.classes[e]=!0,this.registry&&this.registry.onUpdate({id:this.getAttribute("id"),name:"class",value:e,oldValue:null}),this}},{key:"removeClass",value:function(e){return delete this.attrs.classes[e],this.registry&&this.registry.onUpdate({id:this.getAttribute("id"),name:"class",value:null,oldValue:e}),this}},{key:"onRegister",value:function(e){return this.registry=e,this}},{key:"isRendered",value:function(){return this.rendered}},{key:"setRendered",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.rendered=e,this}},{key:"getAttributes",value:function(){return this.attrs}},{key:"getAttribute",value:function(e){return this.attrs[e]}},{key:"setAttribute",value:function(e,t){var n=this.attrs.id,i=this.attrs[e];return this.attrs[e]=t,this.registry&&this.registry.onUpdate({id:n,name:e,value:t,oldValue:i}),this}},{key:"getContext",value:function(){return this.context}},{key:"setContext",value:function(e){return this.context=e,this}},{key:"getBoundingBox",value:function(){return this.boundingBox}},{key:"checkContext",value:function(){if(!this.context)throw new Vex.RERR("NoContext","No rendering context attached to instance");return this.context}}],[{key:"newID",value:function(){return"auto"+e.ID++}}]),e}();Element$2.ID=1e3;var BoundingBoxComputation=function(){function e(t,n,i,r){_classCallCheck2(this,e),this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN,this.addPoint(t,n),this.addPoint(i,r)}return _createClass2(e,[{key:"width",value:function(){return this.x2-this.x1}},{key:"height",value:function(){return this.y2-this.y1}},{key:"addPoint",value:function(e,t){null!=e&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),ethis.x2&&(this.x2=e)),null!=t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))}},{key:"addX",value:function(e){this.addPoint(e,null)}},{key:"addY",value:function(e){this.addPoint(null,e)}},{key:"addQuadraticCurve",value:function(e,t,n,i,r,a){var s=e+2/3*(n-e),o=t+2/3*(i-t),l=s+1/3*(r-e),u=o+1/3*(a-t);this.addBezierCurve(e,t,s,o,l,u,r,a)}},{key:"addBezierCurve",value:function(e,t,n,i,r,a,s,o){var l,u=[e,t],c=[n,i],h=[r,a],f=[s,o];this.addPoint(u[0],u[1]),this.addPoint(f[0],f[1]);var d=function(e,t){return Math.pow(1-e,3)*u[t]+3*Math.pow(1-e,2)*e*c[t]+3*(1-e)*Math.pow(e,2)*h[t]+Math.pow(e,3)*f[t]};for(l=0;l<=1;l++){var p=6*u[l]-12*c[l]+6*h[l],m=-3*u[l]+9*c[l]-9*h[l]+3*f[l],v=3*c[l]-3*u[l];if(0!==m){var g=Math.pow(p,2)-4*v*m;if(!(g<0)){var y=(-p+Math.sqrt(g))/(2*m);0=6&&2*l%2==0&&(u=-1);var c=void 0!==s.int_val?12*o+s.int_val:null,h=s.code,f=s.shift_right,d={};if(r.length>2&&r[2]){var p=r[2].toUpperCase();d=Flow.keyProperties.customNoteHeads[p]||{}}return _objectSpread2({key:a,octave:o,line:l,int_value:c,accidental:s.accidental,code:h,stroke:u,shift_right:f,displaced:!1},d)},Flow.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}},Flow.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}},Flow.integerToNote=function(e){if(void 0===e)throw new Vex.RERR("BadArguments","Undefined integer for integerToNote");if(e<-2)throw new Vex.RERR("BadArguments","integerToNote requires integer > -2: ".concat(e));var t=Flow.integerToNote.table[e];if(!t)throw new Vex.RERR("BadArguments","Unknown note value for integer: ".concat(e));return t},Flow.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"},Flow.tabToGlyph=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=null,i=0,r=0;if("X"===e.toString().toUpperCase()){var a=new Glyph("v7f",Flow.DEFAULT_TABLATURE_FONT_SCALE).getMetrics();n="v7f",i=a.width,r=-a.height/2}else i=Flow.textWidth(e.toString());return{text:e,code:n,getWidth:function(){return i*t},shift_y:r}},Flow.textWidth=function(e){return 7*e.toString().length},Flow.articulationCodes=function(e){return Flow.articulationCodes.articulations[e]},Flow.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}},Flow.accidentalCodes=function(e){return Flow.accidentalCodes.accidentals[e]},Flow.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}},Flow.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]}},Flow.ornamentCodes=function(e){return Flow.ornamentCodes.ornaments[e]},Flow.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"}},Flow.keySignature=function(e){var t=Flow.keySignature.keySpecs[e];if(!t)throw new Vex.RERR("BadKeySignature","Bad key signature spec: '".concat(e,"'"));if(!t.acc)return[];for(var n=Flow.keySignature.accidentalList(t.acc),i=[],r=0;r0&&void 0!==arguments[0]?arguments[0]:Flow.DEFAULT_NOTATION_FONT_SCALE;return new Glyph(this.code_head||"v53",e).getMetrics().width},stem:!1,stem_offset:0,flag:!1,stem_up_extension:-Flow.STEM_HEIGHT,stem_down_extension:-Flow.STEM_HEIGHT,tabnote_stem_up_extension:-Flow.STEM_HEIGHT,tabnote_stem_down_extension:-Flow.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:function(){return Flow.SLASH_NOTEHEAD_WIDTH},position:"B/4"}}},1:{common:{getWidth:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Flow.DEFAULT_NOTATION_FONT_SCALE;return new Glyph(this.code_head||"v1d",e).getMetrics().width},stem:!1,stem_offset:0,flag:!1,stem_up_extension:-Flow.STEM_HEIGHT,stem_down_extension:-Flow.STEM_HEIGHT,tabnote_stem_up_extension:-Flow.STEM_HEIGHT,tabnote_stem_down_extension:-Flow.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:function(){return Flow.SLASH_NOTEHEAD_WIDTH},position:"B/4"}}},2:{common:{getWidth:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Flow.DEFAULT_NOTATION_FONT_SCALE;return new Glyph(this.code_head||"v81",e).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:function(){return Flow.SLASH_NOTEHEAD_WIDTH},position:"B/4"}}},4:{common:{getWidth:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Flow.DEFAULT_NOTATION_FONT_SCALE;return new Glyph(this.code_head||"vb",e).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:function(){return Flow.SLASH_NOTEHEAD_WIDTH},position:"B/4"}}},8:{common:{getWidth:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Flow.DEFAULT_NOTATION_FONT_SCALE;return new Glyph(this.code_head||"vb",e).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:function(){return Flow.SLASH_NOTEHEAD_WIDTH},position:"B/4"}}},16:{common:{beam_count:2,getWidth:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Flow.DEFAULT_NOTATION_FONT_SCALE;return new Glyph(this.code_head||"vb",e).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:function(){return Flow.SLASH_NOTEHEAD_WIDTH},position:"B/4"}}},32:{common:{beam_count:3,getWidth:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Flow.DEFAULT_NOTATION_FONT_SCALE;return new Glyph(this.code_head||"vb",e).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:function(){return Flow.SLASH_NOTEHEAD_WIDTH},position:"B/4"}}},64:{common:{beam_count:4,getWidth:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Flow.DEFAULT_NOTATION_FONT_SCALE;return new Glyph(this.code_head||"vb",e).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:function(){return Flow.SLASH_NOTEHEAD_WIDTH},position:"B/4"}}},128:{common:{beam_count:5,getWidth:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Flow.DEFAULT_NOTATION_FONT_SCALE;return new Glyph(this.code_head||"vb",e).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:function(){return Flow.SLASH_NOTEHEAD_WIDTH},position:"B/4"}}}},Flow.smufl={},Flow.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"},Flow.TIME4_4={num_beats:4,beat_value:4,resolution:Flow.RESOLUTION};var CanvasContext=function(){function e(t){_classCallCheck2(this,e),this.vexFlowCanvasContext=t,t.canvas?this.canvas=t.canvas:this.canvas={width:e.WIDTH,height:e.HEIGHT}}return _createClass2(e,[{key:"clear",value:function(){this.vexFlowCanvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}},{key:"openGroup",value:function(){}},{key:"closeGroup",value:function(){}},{key:"add",value:function(){}},{key:"setFont",value:function(e,t,n){return this.vexFlowCanvasContext.font=(n||"")+" "+t+"pt "+e,this}},{key:"setRawFont",value:function(e){return this.vexFlowCanvasContext.font=e,this}},{key:"setFillStyle",value:function(e){return this.vexFlowCanvasContext.fillStyle=e,this}},{key:"setBackgroundFillStyle",value:function(e){return this.background_fillStyle=e,this}},{key:"setStrokeStyle",value:function(e){return this.vexFlowCanvasContext.strokeStyle=e,this}},{key:"setShadowColor",value:function(e){return this.vexFlowCanvasContext.shadowColor=e,this}},{key:"setShadowBlur",value:function(e){return this.vexFlowCanvasContext.shadowBlur=e,this}},{key:"setLineWidth",value:function(e){return this.vexFlowCanvasContext.lineWidth=e,this}},{key:"setLineCap",value:function(e){return this.vexFlowCanvasContext.lineCap=e,this}},{key:"setLineDash",value:function(e){return this.vexFlowCanvasContext.lineDash=e,this}},{key:"scale",value:function(e,t){return this.vexFlowCanvasContext.scale(parseFloat(e),parseFloat(t))}},{key:"resize",value:function(e,t){var n=_slicedToArray(this.SanitizeCanvasDims(parseInt(e,10),parseInt(t,10)),2);return e=n[0],t=n[1],this.vexFlowCanvasContext.resize(e,t)}},{key:"rect",value:function(e,t,n,i){return this.vexFlowCanvasContext.rect(e,t,n,i)}},{key:"fillRect",value:function(e,t,n,i){return this.vexFlowCanvasContext.fillRect(e,t,n,i)}},{key:"clearRect",value:function(e,t,n,i){return this.vexFlowCanvasContext.clearRect(e,t,n,i)}},{key:"beginPath",value:function(){return this.vexFlowCanvasContext.beginPath()}},{key:"moveTo",value:function(e,t){return this.vexFlowCanvasContext.moveTo(e,t)}},{key:"lineTo",value:function(e,t){return this.vexFlowCanvasContext.lineTo(e,t)}},{key:"bezierCurveTo",value:function(e,t,n,i,r,a){return this.vexFlowCanvasContext.bezierCurveTo(e,t,n,i,r,a)}},{key:"quadraticCurveTo",value:function(e,t,n,i){return this.vexFlowCanvasContext.quadraticCurveTo(e,t,n,i)}},{key:"arc",value:function(e,t,n,i,r,a){return this.vexFlowCanvasContext.arc(e,t,n,i,r,a)}},{key:"glow",value:function(){return this.vexFlowCanvasContext.glow()}},{key:"fill",value:function(){return this.vexFlowCanvasContext.fill()}},{key:"stroke",value:function(){return this.vexFlowCanvasContext.stroke()}},{key:"closePath",value:function(){return this.vexFlowCanvasContext.closePath()}},{key:"measureText",value:function(e){return this.vexFlowCanvasContext.measureText(e)}},{key:"fillText",value:function(e,t,n){return this.vexFlowCanvasContext.fillText(e,t,n)}},{key:"save",value:function(){return this.vexFlowCanvasContext.save()}},{key:"restore",value:function(){return this.vexFlowCanvasContext.restore()}}],[{key:"WIDTH",get:function(){return 600}},{key:"HEIGHT",get:function(){return 400}},{key:"CANVAS_BROWSER_SIZE_LIMIT",get:function(){return 32767}},{key:"SanitizeCanvasDims",value:function(e,t){return Math.max(e,t)>this.CANVAS_BROWSER_SIZE_LIMIT&&(Vex.W("Canvas dimensions exceed browser limit. Cropping to "+this.CANVAS_BROWSER_SIZE_LIMIT),e>this.CANVAS_BROWSER_SIZE_LIMIT&&(e=this.CANVAS_BROWSER_SIZE_LIMIT),t>this.CANVAS_BROWSER_SIZE_LIMIT&&(t=this.CANVAS_BROWSER_SIZE_LIMIT)),[e,t]}}]),e}(),RaphaelContext=function(){function e(t){_classCallCheck2(this,e),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=[]}return _createClass2(e,[{key:"openGroup",value:function(){}},{key:"closeGroup",value:function(){}},{key:"add",value:function(){}},{key:"setFont",value:function(e,t,n){return this.state.font_family=e,this.state.font_size=t,this.state.font_weight=n,this.attributes.font=(this.state.font_weight||"")+" "+this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this}},{key:"setRawFont",value:function(e){return this.attributes.font=e,this}},{key:"setFillStyle",value:function(e){return this.attributes.fill=e,this}},{key:"setBackgroundFillStyle",value:function(e){return this.background_attributes.fill=e,this.background_attributes.stroke=e,this}},{key:"setStrokeStyle",value:function(e){return this.attributes.stroke=e,this}},{key:"setShadowColor",value:function(e){return this.shadow_attributes.color=e,this}},{key:"setShadowBlur",value:function(e){return this.shadow_attributes.width=e,this}},{key:"setLineWidth",value:function(e){this.attributes["stroke-width"]=e,this.lineWidth=e}},{key:"setLineDash",value:function(){return this}},{key:"setLineCap",value:function(){return this}},{key:"scale",value:function(e,t){return this.state.scale={x:e,y:t},this.attributes.transform="S"+e+","+t+",0,0",this.attributes.scale=e+","+t+",0,0",this.attributes.font=this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this.background_attributes.transform="S"+e+","+t+",0,0",this.background_attributes.font=this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this}},{key:"clear",value:function(){this.paper.clear()}},{key:"resize",value:function(e,t){return this.element.style.width=e,this.paper.setSize(e,t),this}},{key:"setViewBox",value:function(e){this.paper.canvas.setAttribute("viewBox",e)}},{key:"rect",value:function(e,t,n,i){return i<0&&(t+=i,i=-i),this.paper.rect(e,t,n-.5,i-.5).attr(this.attributes).attr("fill","none").attr("stroke-width",this.lineWidth),this}},{key:"fillRect",value:function(e,t,n,i){return i<0&&(t+=i,i=-i),this.paper.rect(e,t,n-.5,i-.5).attr(this.attributes),this}},{key:"clearRect",value:function(e,t,n,i){return i<0&&(t+=i,i=-i),this.paper.rect(e,t,n-.5,i-.5).attr(this.background_attributes),this}},{key:"beginPath",value:function(){return this.path="",this.pen.x=0,this.pen.y=0,this}},{key:"moveTo",value:function(e,t){return this.path+="M"+e+","+t,this.pen.x=e,this.pen.y=t,this}},{key:"lineTo",value:function(e,t){return this.path+="L"+e+","+t,this.pen.x=e,this.pen.y=t,this}},{key:"bezierCurveTo",value:function(e,t,n,i,r,a){return this.path+="C"+e+","+t+","+n+","+i+","+r+","+a,this.pen.x=r,this.pen.y=a,this}},{key:"quadraticCurveTo",value:function(e,t,n,i){return this.path+="Q"+e+","+t+","+n+","+i,this.pen.x=n,this.pen.y=i,this}},{key:"arc",value:function(e,t,n,i,r,a){function s(e){for(;e<0;)e+=2*Math.PI;for(;e>2*Math.PI;)e-=2*Math.PI;return e}if((i=s(i))>(r=s(r))){var o=i;i=r,r=o,a=!a}var l=r-i;return l>Math.PI?(this.arcHelper(e,t,n,i,i+l/2,a),this.arcHelper(e,t,n,i+l/2,r,a)):this.arcHelper(e,t,n,i,r,a),this}},{key:"arcHelper",value:function(e,t,n,i,r,a){var s=e+n*Math.cos(i),o=t+n*Math.sin(i),l=e+n*Math.cos(r),u=t+n*Math.sin(r),c=0,h=0;a?(h=1,r-iMath.PI&&(c=1),this.path+="M"+s+","+o+",A"+n+","+n+",0,"+c+","+h+","+l+","+u+"M"+this.pen.x+","+this.pen.y}},{key:"glow",value:function(){var e=this.paper.set();if(this.shadow_attributes.width>0)for(var t=this.shadow_attributes,n=t.width/2,i=1;i<=n;i++)e.push(this.paper.path(this.path).attr({stroke:t.color,"stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(t.width/n*i).toFixed(3),opacity:+((t.opacity||.3)/n).toFixed(3),transform:this.attributes.transform,scale:this.attributes.scale}));return e}},{key:"fill",value:function(){var e=this.paper.path(this.path).attr(this.attributes).attr("stroke-width",0);return this.glow(e),this}},{key:"stroke",value:function(){var e=this.lineWidth*(this.state.scale.x+this.state.scale.y)/2,t=this.paper.path(this.path).attr(this.attributes).attr("fill","none").attr("stroke-width",e);return this.glow(t),this}},{key:"closePath",value:function(){return this.path+="Z",this}},{key:"measureText",value:function(e){var t=this.paper.text(0,0,e).attr(this.attributes).attr("fill","none").attr("stroke","none"),n=t.getBBox();return t.remove(),{width:n.width,height:n.height}}},{key:"fillText",value:function(e,t,n){return this.paper.text(t+this.measureText(e).width/2,n-this.state.font_size/(2.25*this.state.scale.y),e).attr(this.attributes),this}},{key:"save",value:function(){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}},{key:"restore",value:function(){var e=this.state_stack.pop();return this.state.font_family=e.state.font_family,this.attributes.font=e.attributes.font,this.attributes.fill=e.attributes.fill,this.attributes.stroke=e.attributes.stroke,this.attributes["stroke-width"]=e.attributes["stroke-width"],this.shadow_attributes.width=e.shadow_attributes.width,this.shadow_attributes.color=e.shadow_attributes.color,this}}]),e}(),attrNamesToIgnoreMap={path:{x:!0,y:!0,width:!0,height:!0},rect:{},text:{width:!0,height:!0}},fontAttrNamesToIgnore={"font-family":!0,"font-weight":!0,"font-style":!0,"font-size":!0};Vex.Merge(attrNamesToIgnoreMap.rect,fontAttrNamesToIgnore),Vex.Merge(attrNamesToIgnoreMap.path,fontAttrNamesToIgnore);var SVGContext=function(){function e(t){_classCallCheck2(this,e),this.element=t,this.svgNS="http://www.w3.org/2000/svg";var n=this.create("svg");this.element.appendChild(n),this.svg=n,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()}return _createClass2(e,[{key:"create",value:function(e){return document.createElementNS(this.svgNS,e)}},{key:"openGroup",value:function(e,t,n){var i=this.create("g");return this.groups.push(i),this.parent.appendChild(i),this.parent=i,e&&i.setAttribute("class",Vex.Prefix(e)),t&&i.setAttribute("id",Vex.Prefix(t)),n&&n.pointerBBox&&i.setAttribute("pointer-events","bounding-box"),i}},{key:"closeGroup",value:function(){this.groups.pop(),this.parent=this.groups[this.groups.length-1]}},{key:"add",value:function(e){this.parent.appendChild(e)}},{key:"iePolyfill",value:function(){"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))}},{key:"setFont",value:function(e,t,n){var i=!1,r=!1,a="normal";"string"==typeof n&&(-1!==n.indexOf("italic")&&(n=n.replace(/italic/g,""),r=!0),-1!==n.indexOf("bold")&&(n=n.replace(/bold/g,""),i=!0),n=n.replace(/ /g,""));var s={"font-family":e,"font-size":t+"pt","font-weight":n=void 0===(n=i?"bold":n)||""===n?"normal":n,"font-style":a=r?"italic":a};return this.fontSize=Number(t),Vex.Merge(this.attributes,s),Vex.Merge(this.state,s),this}},{key:"setRawFont",value:function(e){var t=(e=e.trim()).split(" ");return this.attributes["font-family"]=t[1],this.state["font-family"]=t[1],this.attributes["font-size"]=t[0],this.state["font-size"]=t[0],this.fontSize=Number(t[0].match(/\d+/)),this}},{key:"setFillStyle",value:function(e){return this.attributes.fill=e,this}},{key:"setBackgroundFillStyle",value:function(e){return this.background_attributes.fill=e,this.background_attributes.stroke=e,this}},{key:"setStrokeStyle",value:function(e){return this.attributes.stroke=e,this}},{key:"setShadowColor",value:function(e){return this.shadow_attributes.color=e,this}},{key:"setShadowBlur",value:function(e){return this.shadow_attributes.width=e,this}},{key:"setLineWidth",value:function(e){this.attributes["stroke-width"]=e,this.lineWidth=e}},{key:"setLineDash",value:function(e){if("[object Array]"===Object.prototype.toString.call(e))return e=e.join(", "),this.attributes["stroke-dasharray"]=e,this;throw new Vex.RERR("ArgumentError","lineDash must be an array of integers.")}},{key:"setLineCap",value:function(e){return this.attributes["stroke-linecap"]=e,this}},{key:"resize",value:function(e,t){this.width=e,this.height=t,this.element.style.width=e;var n={width:e,height:t};return this.applyAttributes(this.svg,n),this.scale(this.state.scale.x,this.state.scale.y),this}},{key:"scale",value:function(e,t){this.state.scale={x:e,y:t};var n=this.width/e,i=this.height/t;return this.setViewBox(0,0,n,i),this}},{key:"setViewBox",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n-1||e.setAttributeNS(null,i,t[i])})),e}},{key:"clear",value:function(){for(;this.svg.lastChild;)this.svg.removeChild(this.svg.lastChild);this.scale(this.state.scale.x,this.state.scale.y)}},{key:"rect",value:function(e,t,n,i,r){i<0&&(t+=i,i*=-1);var a=this.create("rect");return void 0===r&&(r={fill:"none","stroke-width":this.lineWidth,stroke:"black"}),Vex.Merge(r,{x:e,y:t,width:n,height:i}),this.applyAttributes(a,r),this.add(a),this}},{key:"fillRect",value:function(e,t,n,i){return i<0&&(t+=i,i*=-1),this.rect(e,t,n,i,this.attributes),this}},{key:"clearRect",value:function(e,t,n,i){return this.rect(e,t,n,i,this.background_attributes),this}},{key:"beginPath",value:function(){return this.path="",this.pen.x=NaN,this.pen.y=NaN,this}},{key:"moveTo",value:function(e,t){return this.path+="M"+e+" "+t,this.pen.x=e,this.pen.y=t,this}},{key:"lineTo",value:function(e,t){return this.path+="L"+e+" "+t,this.pen.x=e,this.pen.y=t,this}},{key:"bezierCurveTo",value:function(e,t,n,i,r,a){return this.path+="C"+e+" "+t+","+n+" "+i+","+r+" "+a,this.pen.x=r,this.pen.y=a,this}},{key:"quadraticCurveTo",value:function(e,t,n,i){return this.path+="Q"+e+" "+t+","+n+" "+i,this.pen.x=n,this.pen.y=i,this}},{key:"arc",value:function(e,t,n,i,r,a){function s(e){for(;e<0;)e+=2*Math.PI;for(;e>2*Math.PI;)e-=2*Math.PI;return e}if((i=s(i))>(r=s(r))){var o=i;i=r,r=o,a=!a}var l=r-i;return l>Math.PI?(this.arcHelper(e,t,n,i,i+l/2,a),this.arcHelper(e,t,n,i+l/2,r,a)):this.arcHelper(e,t,n,i,r,a),this}},{key:"arcHelper",value:function(e,t,n,i,r,a){var s=e+n*Math.cos(i),o=t+n*Math.sin(i),l=e+n*Math.cos(r),u=t+n*Math.sin(r),c=0,h=0;a?(h=1,r-iMath.PI&&(c=1),this.path+="M"+s+" "+o+" A"+n+" "+n+" 0 "+c+" "+h+" "+l+" "+u,isNaN(this.pen.x)||isNaN(this.pen.y)||(this.peth+="M"+this.pen.x+" "+this.pen.y)}},{key:"closePath",value:function(){return this.path+="Z",this}},{key:"glow",value:function(){if(this.shadow_attributes.width>0)for(var e=this.shadow_attributes,t=e.width/2,n=1;n<=t;n++){var i={stroke:e.color,"stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(.4*e.width/t*n).toFixed(3),opacity:+((e.opacity||.3)/t).toFixed(3)},r=this.create("path");i.d=this.path,this.applyAttributes(r,i),this.add(r)}return this}},{key:"fill",value:function(e){this.glow();var t=this.create("path"),n=e;return void 0===e?(e={},Vex.Merge(e,this.attributes),e.stroke="none",n=e):(n=e,Vex.Merge(n,this.attributes),e.class&&(n.class=e.class),e.id&&(n.id=e.id)),e.d=this.path,this.applyAttributes(t,e),this.add(t),this}},{key:"stroke",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;this.glow();var t=this.create("path"),n={};return Vex.Merge(n,this.attributes),e&&Vex.Merge(n,e),n.fill="none",n["stroke-width"]=this.lineWidth,n.d=this.path,this.applyAttributes(t,n),this.add(t),this}},{key:"measureText",value:function(e){var t=this.create("text");if("function"!=typeof t.getBBox)return{x:0,y:0,width:0,height:0};t.textContent=e,this.applyAttributes(t,this.attributes),this.svg.appendChild(t);var n=t.getBBox();return this.ie&&""!==e&&"italic"===this.attributes["font-style"]&&(n=this.ieMeasureTextFix(n,e)),this.svg.removeChild(t),n}},{key:"ieMeasureTextFix",value:function(e){var t=1.196*Number(this.fontSize)+1.9598,n=e.width-t,i=e.height-1.5;return{x:e.x,y:e.y,width:n,height:i}}},{key:"fillText",value:function(e,t,n){if(e&&!(e.length<=0)){var i={};Vex.Merge(i,this.attributes),i.stroke="none",i.x=t,i.y=n;var r=this.create("text");r.textContent=e,this.applyAttributes(r,i),this.add(r)}}},{key:"save",value:function(){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}},{key:"restore",value:function(){var e=this.state_stack.pop();return this.state["font-family"]=e.state["font-family"],this.state["font-weight"]=e.state["font-weight"],this.state["font-style"]=e.state["font-style"],this.state["font-size"]=e.state["font-size"],this.state.scale=e.state.scale,this.attributes["font-family"]=e.attributes["font-family"],this.attributes["font-weight"]=e.attributes["font-weight"],this.attributes["font-style"]=e.attributes["font-style"],this.attributes["font-size"]=e.attributes["font-size"],this.attributes.fill=e.attributes.fill,this.attributes.stroke=e.attributes.stroke,this.attributes["stroke-width"]=e.attributes["stroke-width"],this.attributes["stroke-dasharray"]=e.attributes["stroke-dasharray"],this.shadow_attributes.width=e.shadow_attributes.width,this.shadow_attributes.color=e.shadow_attributes.color,this.lineWidth=e.lineWidth,this}}]),e}(),lastContext=null,Renderer=function(){function e(t,n){if(_classCallCheck2(this,e),this.elementId=t,!this.elementId)throw new Vex.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=n,this.backend===e.Backends.CANVAS){if(!this.element.getContext)throw new Vex.RERR("BadElement","Can't get canvas context from element: ".concat(t));this.ctx=e.bolsterCanvasContext(this.element.getContext("2d"))}else if(this.backend===e.Backends.RAPHAEL)this.ctx=new RaphaelContext(this.element);else{if(this.backend!==e.Backends.SVG)throw new Vex.RERR("InvalidBackend","No support for backend: ".concat(this.backend));this.ctx=new SVGContext(this.element)}}return _createClass2(e,[{key:"resize",value:function(t,n){if(this.backend===e.Backends.CANVAS){if(!this.element.getContext)throw new Vex.RERR("BadElement","Can't get canvas context from element: ".concat(this.elementId));var i=_slicedToArray(CanvasContext.SanitizeCanvasDims(t,n),2);t=i[0],n=i[1];var r=window.devicePixelRatio||1;this.element.width=t*r,this.element.height=n*r,this.element.style.width=t+"px",this.element.style.height=n+"px",this.ctx=e.bolsterCanvasContext(this.element.getContext("2d")),this.ctx.scale(r,r)}else this.ctx.resize(t,n);return this}},{key:"getContext",value:function(){return this.ctx}}],[{key:"Backends",get:function(){return{CANVAS:1,RAPHAEL:2,SVG:3,VML:4}}},{key:"LineEndType",get:function(){return{NONE:1,UP:2,DOWN:3}}},{key:"USE_CANVAS_PROXY",get:function(){return!1}},{key:"lastContext",get:function(){return lastContext},set:function(e){lastContext=e}},{key:"buildContext",value:function(t,n,i,r,a){var s=new e(t,n);i&&r&&s.resize(i,r),a||(a="#FFF");var o=s.getContext();return o.setBackgroundFillStyle(a),e.lastContext=o,o}},{key:"getCanvasContext",value:function(t,n,i,r){return e.buildContext(t,e.Backends.CANVAS,n,i,r)}},{key:"getRaphaelContext",value:function(t,n,i,r){return e.buildContext(t,e.Backends.RAPHAEL,n,i,r)}},{key:"getSVGContext",value:function(t,n,i,r){return e.buildContext(t,e.Backends.SVG,n,i,r)}},{key:"bolsterCanvasContext",value:function(t){if(e.USE_CANVAS_PROXY)return new CanvasContext(t);return t.vexFlowCanvasContext=t,["clear","setFont","setRawFont","setFillStyle","setBackgroundFillStyle","setStrokeStyle","setShadowColor","setShadowBlur","setLineWidth","setLineCap","setLineDash","openGroup","closeGroup","getGroup"].forEach((function(e){t[e]=t[e]||CanvasContext.prototype[e]})),t}},{key:"drawDashedLine",value:function(e,t,n,i,r,a){e.beginPath();var s=i-t,o=r-n,l=Math.atan2(o,s),u=t,c=n;e.moveTo(t,n);for(var h=0,f=!0;!(s<0?u<=i:u>=i)||!(o<0?c<=r:c>=r);){var d=a[h++%a.length],p=u+Math.cos(l)*d;u=s<0?Math.max(i,p):Math.min(i,p);var m=c+Math.sin(l)*d;c=o<0?Math.max(r,m):Math.min(r,m),f?e.lineTo(u,c):e.moveTo(u,c),f=!f}e.closePath(),e.stroke()}}]),e}();function L$k(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck2(this,n),(e=t.call(this)).setAttribute("type","Stem"),e.x_begin=i.x_begin||0,e.x_end=i.x_end||0,e.y_top=i.y_top||0,e.y_bottom=i.y_bottom||0,e.stem_extension=i.stem_extension||0,e.stem_direction=i.stem_direction||0,e.hide=i.hide||!1,e.isStemlet=i.isStemlet||!1,e.stemletHeight=i.stemletHeight||0,e.resetHeight=0,e.renderHeightAdjustment=0,e.setOptions(i),e}return _createClass2(n,[{key:"setResetHeight",value:function(e){this.resetHeight=e}},{key:"setOptions",value:function(e){this.stem_up_y_offset=e.stem_up_y_offset||0,this.stem_down_y_offset=e.stem_down_y_offset||0}},{key:"setNoteHeadXBounds",value:function(e,t){return this.x_begin=e,this.x_end=t,this}},{key:"setDirection",value:function(e){this.stem_direction=e}},{key:"setExtension",value:function(e){this.stem_extension=e}},{key:"getExtension",value:function(){return this.stem_extension}},{key:"setYBounds",value:function(e,t){this.y_top=e,this.y_bottom=t}},{key:"getCategory",value:function(){return n.CATEGORY}},{key:"getHeight",value:function(){var e=this.stem_direction===n.UP?this.stem_up_y_offset:this.stem_down_y_offset;return(this.y_bottom-this.y_top)*this.stem_direction+(n.HEIGHT-e+this.stem_extension)*this.stem_direction}},{key:"getBoundingBox",value:function(){throw new Vex.RERR("NotImplemented","getBoundingBox() not implemented.")}},{key:"getExtents",value:function(){var e=this.stem_direction===n.UP,t=[this.y_top,this.y_bottom],i=n.HEIGHT+this.stem_extension,r=(e?Math.min:Math.max).apply(void 0,t),a=(e?Math.max:Math.min).apply(void 0,t);return{topY:r+i*-this.stem_direction+this.resetHeight*-this.stem_direction,baseY:a}}},{key:"setVisibility",value:function(e){return this.hide=!e,this}},{key:"setStemlet",value:function(e,t){return this.isStemlet=e,this.stemletHeight=t,this}},{key:"draw",value:function(){if(this.setRendered(),!this.hide){var e,t,i=this.checkContext(),r=this.stem_direction;r===n.DOWN?(e=this.x_begin,t=this.y_top+this.stem_down_y_offset):(e=this.x_end,t=this.y_bottom-this.stem_up_y_offset);var a=this.getHeight();L$k("Rendering stem - ","Top Y: ",this.y_top,"Bottom Y: ",this.y_bottom);var s=this.isStemlet?a-this.stemletHeight*this.stem_direction:0;if(i.save(),this.applyStyle(i),i.beginPath(),i.setLineWidth(n.WIDTH),i.moveTo(e,t-s),i.lineTo(e,t-a-this.renderHeightAdjustment*r-this.resetHeight*r),i.svg){var o={class:Vex.Prefix("stem")};this.id&&(o.id=this.id),i.stroke(o)}else i.stroke();this.restoreStyle(i),i.restore()}}}],[{key:"CATEGORY",get:function(){return"stem"}},{key:"UP",get:function(){return 1}},{key:"DOWN",get:function(){return-1}},{key:"WIDTH",get:function(){return Flow.STEM_WIDTH}},{key:"HEIGHT",get:function(){return Flow.STEM_HEIGHT}}]),n}(Element$2),Tuplet$1=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i){var r;if(_classCallCheck2(this,n),(r=t.call(this)).setAttribute("type","Tuplet"),!e||!e.length)throw new Vex.RuntimeError("BadArguments","No notes provided for tuplet.");return r.options=Vex.Merge({},i),r.notes=e,r.num_notes="num_notes"in r.options?r.options.num_notes:e.length,r.options.beats_occupied&&r.beatsOccupiedDeprecationWarning(),r.notes_occupied=r.options.notes_occupied||r.options.beats_occupied||2,"bracketed"in r.options?r.bracketed=r.options.bracketed:r.bracketed=e.some((function(e){return null===e.beam})),r.ratioed="ratioed"in r.options?r.options.ratioed:Math.abs(r.notes_occupied-r.num_notes)>1,r.point=28,r.y_pos=16,r.x_pos=100,r.width=200,r.location=r.options.location||n.LOCATION_TOP,_Formatter.AlignRestsToNotes(e,!0,!0),r.resolveGlyphs(),r.attach(),r}return _createClass2(n,[{key:"attach",value:function(){for(var e=0;e=1;)this.numerator_glyphs.unshift(new Glyph("v"+e%10,this.point)),e=parseInt(e/10,10);for(this.denom_glyphs=[],e=this.notes_occupied;e>=1;)this.denom_glyphs.unshift(new Glyph("v"+e%10,this.point)),e=parseInt(e/10,10)}},{key:"getNestedTupletCount",value:function(){var e=this.location,t=this.notes[0],n=r(t,e),i=r(t,e);function r(e,t){return e.tupletStack.filter((function(e){return e.location===t})).length}return this.notes.forEach((function(t){var a=r(t,e);n=a>n?a:n,i=ae&&(e=l)}}return e+t+i}},{key:"draw",value:function(){var e=this;this.checkContext(),this.setRendered();var t=this.notes[0],i=this.notes[this.notes.length-1];this.bracketed?(this.x_pos=t.getTieLeftX()-5,this.width=i.getTieRightX()-this.x_pos+5):(this.x_pos=t.getStemX(),this.width=i.getStemX()-this.x_pos),this.y_pos=this.getYPosition();var r=function(e,t){return e+t.getMetrics().width},a=this.numerator_glyphs.reduce(r,0);this.ratioed&&(a=this.denom_glyphs.reduce(r,a),a+=.32*this.point);var s=this.x_pos+this.width/2-a/2;if(this.bracketed){var o=this.width/2-a/2-5;o>0&&(this.context.fillRect(this.x_pos,this.y_pos,o,1),this.context.fillRect(this.x_pos+this.width/2+a/2+5,this.y_pos,o,1),this.context.fillRect(this.x_pos,this.y_pos+(this.location===n.LOCATION_BOTTOM),1,10*this.location),this.context.fillRect(this.x_pos+this.width,this.y_pos+(this.location===n.LOCATION_BOTTOM),1,10*this.location))}var l=0;if(this.numerator_glyphs.forEach((function(t){t.render(e.context,s+l,e.y_pos+e.point/3-2),l+=t.getMetrics().width})),this.ratioed){var u=s+l+.16*this.point,c=.06*this.point;this.context.beginPath(),this.context.arc(u,this.y_pos-.08*this.point,c,0,2*Math.PI,!0),this.context.closePath(),this.context.fill(),this.context.beginPath(),this.context.arc(u,this.y_pos+.12*this.point,c,0,2*Math.PI,!0),this.context.closePath(),this.context.fill(),l+=.32*this.point,this.denom_glyphs.forEach((function(t){t.render(e.context,s+l,e.y_pos+e.point/3-2),l+=t.getMetrics().width}))}}}],[{key:"LOCATION_TOP",get:function(){return 1}},{key:"LOCATION_BOTTOM",get:function(){return-1}},{key:"NESTING_OFFSET",get:function(){return 15}}]),n}(Element$2);function calculateStemDirection(e){var t=0;return e.forEach((function(e){e.keyProps&&e.keyProps.forEach((function(e){t+=e.line-3}))})),t>=0?Stem.DOWN:Stem.UP}var getStemSlope=function(e,t){var n=e.getStemExtents().topY,i=e.getStemX();return(t.getStemExtents().topY-n)/(t.getStemX()-i)},BEAM_LEFT="L",BEAM_RIGHT="R",BEAM_BOTH="B",Beam$1=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i){var r,a,s;if(_classCallCheck2(this,n),(r=t.call(this)).setAttribute("type","Beam"),!e||e===[])throw new Vex.RuntimeError("BadArguments","No notes provided for beam.");if(1===e.length)throw new Vex.RuntimeError("BadArguments","Too few notes for beam.");if(r.ticks=e[0].getIntrinsicTicks(),r.ticks>=Flow.durationToTicks("4"))throw new Vex.RuntimeError("BadArguments","Beams can only be applied to notes shorter than a quarter note.");for(r.stem_direction=Stem.UP,a=0;a-1?Stem.UP:Stem.DOWN}for(a=0;ae?t:e}))}},{key:"breakSecondaryAt",value:function(e){return this.break_on_indices=e,this}},{key:"getSlopeY",value:function(e,t,n,i){return n+(e-t)*i}},{key:"calculateSlope",value:function(){for(var e=this.notes,t=this.stem_direction,n=this.render_options,i=n.max_slope,r=n.min_slope,a=n.slope_iterations,s=n.slope_cost,o=e[0],l=getStemSlope(o,e[e.length-1]),u=(i-r)/a,c=Number.MAX_VALUE,h=0,f=0,d=r;d<=i;d+=u){for(var p=0,m=0,v=1;vf)&&(u=f,o=Math.min.apply(Math,_toConsumableArray2(h.getYs())),l=h.getBeamCount())}var d=s/e.length,p=r+l*(1.5*i),m=o+p*-t;t===Stem.DOWN&&dm&&(d=o-p),a+this.render_options.flat_beam_offset_per_beam>0?(t===Stem.DOWN&&d>a&&!this.render_options.flat_beams||t===Stem.UP&&d0){var t=this.render_options.flat_beam_offset;this.render_options.flat_beam_offset_per_beam&&(t+=this.render_options.flat_beam_offset_per_beam*this.getBeamCount());var n,i=this.notes[0].note_heads[0].y,r=this.stem_direction>0?Math.min:Math.max,a=_createForOfIteratorHelper(this.notes);try{for(a.s();!(n=a.n()).done;){var s,o=_createForOfIteratorHelper(n.value.note_heads);try{for(o.s();!(s=o.n()).done;){i=r(i,s.value.y)}}catch(err){o.e(err)}finally{o.f()}}}catch(err){a.e(err)}finally{a.f()}e=i+t*-this.stem_direction}return e}},{key:"applyStemExtensions",value:function(){for(var e=this.notes,t=this.slope,n=this.y_shift,i=this.stem_direction,r=this.beam_count,a=this.render_options,s=a.show_stemlets,o=a.stemlet_extension,l=a.beam_width,u=e[0],c=this.getBeamYToDraw(),h=u.getStemX(),f=0;f=8&&(c=-1!==this.break_on_indices.indexOf(l),this.render_options.secondary_break_ticks&&o>=this.render_options.secondary_break_ticks&&(o=0,c=!0));var h=u.getIntrinsicTicks()4?[new Fraction(2,i)]:i<=4?[new Fraction(1,i)]:[new Fraction(1,4)]}},{key:"applyAndGetBeams",value:function(e,t,i){return n.generateBeams(e.getTickables(),{groups:i,stem_direction:t})}},{key:"generateBeams",value:function(e,t){t||(t={}),t.groups&&t.groups.length||(t.groups=[new Fraction(2,8)]);var i,r,a=t.groups.map((function(e){if(!e.multiply)throw new Vex.RuntimeError("InvalidBeamGroups","The beam groups must be an array of Vex.Flow.Fractions");return e.clone().multiply(Flow.RESOLUTION,1)})),s=0,o=[],l=[];function u(){a.length-1>s?s+=1:s=0}i=[],e.forEach((function(e){if(i=[],e.shouldIgnoreTicks())return o.push(l),void(l=i);l.push(e);var t=a[s].clone(),n=l.reduce((function(e,t){return t.getTicks().clone().add(e)}),new Fraction(0,1)),r=Flow.durationToNumber(e.duration)<8;r&&e.tuplet&&(t.numerator*=2),n.greaterThan(t)?(r||i.push(l.pop()),o.push(l),l=i,u()):n.equals(t)&&(o.push(l),l=i,u())})),l.length>0&&o.push(l),r=[],o.forEach((function(e){var n=[];e.forEach((function(e,i,a){var s=0===i||i===a.length-1,o=a[i-1],l=!t.beam_rests&&e.isRest(),u=t.beam_rests&&t.beam_middle_only&&e.isRest()&&s,c=!1;if(t.maintain_stem_directions&&o&&!e.isRest()&&!o.isRest()){var h=o.getStemDirection();c=e.getStemDirection()!==h}var f=parseInt(e.duration,10)<8;l||u||c||f?(n.length>0&&r.push(n),n=c?[e]:[]):n.push(e)})),n.length>0&&r.push(n)})),(o=r).forEach((function(e){var n;if(t.maintain_stem_directions){var i=function(e){for(var t=0;t1){var t=!0;return e.forEach((function(e){e.getIntrinsicTicks()>=Flow.durationToTicks("4")&&(t=!1)})),t}return!1})),f=(c=[],o.forEach((function(e){var t=null;e.forEach((function(e){e.tuplet&&t!==e.tuplet&&(t=e.tuplet,c.push(t))}))})),c),d=[];return h.forEach((function(e){var i=new n(e);t.show_stemlets&&(i.render_options.show_stemlets=!0),t.secondary_breaks&&(i.render_options.secondary_break_ticks=Flow.durationToTicks(t.secondary_breaks)),!0===t.flat_beams&&(i.render_options.flat_beams=!0,i.render_options.flat_beam_offset=t.flat_beam_offset),d.push(i)})),f.forEach((function(e){var t=e.notes[0].stem_direction===Stem.DOWN?Tuplet$1.LOCATION_BOTTOM:Tuplet$1.LOCATION_TOP;e.setTupletLocation(t);for(var n=!1,i=0;i0&&void 0!==arguments[0]?arguments[0]:this.context,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.stave;this.setRendered();for(var n=null,i=0;i0&&n){var a=r.getBoundingBox();a&&n.mergeWith(a)}r.setContext(e),r.drawWithStyle()}this.boundingBox=n}}],[{key:"Mode",get:function(){return{STRICT:1,SOFT:2,FULL:3}}}]),n}(Element$2);function drawBoldDoubleLine(e,t,n,i,r){if(t!==_StaveConnector.type.BOLD_DOUBLE_LEFT&&t!==_StaveConnector.type.BOLD_DOUBLE_RIGHT)throw new Vex.RERR("InvalidConnector","A REPEAT_BEGIN or REPEAT_END type must be provided.");var a=3,s=3.5;t===_StaveConnector.type.BOLD_DOUBLE_RIGHT&&(a=-5,s=3),e.fillRect(n+a,i,1,r-i),e.fillRect(n-2,i,s,r-i)}var _StaveConnector=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i){var r;return _classCallCheck2(this,n),(r=t.call(this)).setAttribute("type","StaveConnector"),r.thickness=Flow.STAVE_LINE_THICKNESS,r.width=3,r.top_stave=e,r.bottom_stave=i,r.type=n.type.DOUBLE,r.font={family:"times",size:16,weight:"normal"},r.x_shift=0,r.texts=[],r}return _createClass2(n,[{key:"setType",value:function(e){return(e="string"==typeof e?n.typeString[e]:e)>=n.type.SINGLE_RIGHT&&e<=n.type.NONE&&(this.type=e),this}},{key:"setText",value:function(e,t){return this.texts.push({content:e,options:Vex.Merge({shift_x:0,shift_y:0},t)}),this}},{key:"setFont",value:function(e){Vex.Merge(this.font,e)}},{key:"setXShift",value:function(e){if("number"!=typeof e)throw Vex.RERR("InvalidType","x_shift must be a Number");return this.x_shift=e,this}},{key:"draw",value:function(){var e=this.checkContext();this.setRendered();var t=this.top_stave.getYForLine(0),i=this.bottom_stave.getYForLine(this.bottom_stave.getNumLines()-1)+this.thickness,r=this.width,a=this.top_stave.getX();(this.type===n.type.SINGLE_RIGHT||this.type===n.type.BOLD_DOUBLE_RIGHT||this.type===n.type.THIN_DOUBLE)&&(a=this.top_stave.getX()+this.top_stave.width);var s=i-t;switch(this.type){case n.type.SINGLE:case n.type.SINGLE_LEFT:case n.type.SINGLE_RIGHT:r=1;break;case n.type.DOUBLE:a-=this.width+2;break;case n.type.BRACE:r=12;var o=this.top_stave.getX()-2+this.x_shift,l=t,u=o,c=i,h=o-r,f=l+s/2,d=h-.9*r,p=l+.2*s,m=o+1.1*r,v=f-.135*s,g=m,y=f+.135*s,b=d,_=c-.2*s,S=h-r,x=_,w=o+.4*r,k=f+.135*s,E=w,T=f-.135*s,P=S,A=p;e.beginPath(),e.moveTo(o,l),e.bezierCurveTo(d,p,m,v,h,f),e.bezierCurveTo(g,y,b,_,u,c),e.bezierCurveTo(S,x,w,k,h,f),e.bezierCurveTo(E,T,P,A,o,l),e.fill(),e.stroke();break;case n.type.BRACKET:s=(i+=4)-(t-=4),Glyph.renderGlyph(e,a-5,t-3,40,"v1b",!0),Glyph.renderGlyph(e,a-5,i+3,40,"v10",!0),a-=this.width+2;break;case n.type.BOLD_DOUBLE_LEFT:drawBoldDoubleLine(e,this.type,a+this.x_shift,t,i);break;case n.type.BOLD_DOUBLE_RIGHT:drawBoldDoubleLine(e,this.type,a,t,i);break;case n.type.THIN_DOUBLE:r=1;break;case n.type.NONE:break;default:throw new Vex.RERR("InvalidType","The provided StaveConnector.type (".concat(this.type,") is invalid"))}this.type!==n.type.BRACE&&this.type!==n.type.BOLD_DOUBLE_LEFT&&this.type!==n.type.BOLD_DOUBLE_RIGHT&&this.type!==n.type.NONE&&e.fillRect(a,t,r,s),this.type===n.type.THIN_DOUBLE&&e.fillRect(a-3,t,r,s),e.save(),e.lineWidth=2,e.setFont(this.font.family,this.font.size,this.font.weight);for(var C=0;C0}},{key:"hasStem",value:function(){return!1}},{key:"getDots",value:function(){return this.dots}},{key:"getNoteType",value:function(){return this.noteType}},{key:"setBeam",value:function(){return this}},{key:"setModifierContext",value:function(e){return this.modifierContext=e,this}},{key:"addModifier",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.setNote(this),e.setIndex(t),this.modifiers.push(e),this.setPreFormatted(!1),this}},{key:"getModifierStartXY",value:function(){if(!this.preFormatted)throw new Vex.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");return{x:this.getAbsoluteX(),y:this.ys[0]}}},{key:"getMetrics",value:function(){if(!this.preFormatted)throw new Vex.RERR("UnformattedNote","Can't call getMetrics on an unformatted note.");var e=0,t=0;null!=this.modifierContext&&(e=this.modifierContext.state.left_shift,t=this.modifierContext.state.right_shift);var n=this.getWidth();return{width:n,noteWidth:n-e-t-this.extraLeftPx-this.extraRightPx,left_shift:this.x_shift,modLeftPx:e,modRightPx:t,extraLeftPx:this.extraLeftPx,extraRightPx:this.extraRightPx}}},{key:"setWidth",value:function(e){this.width=e}},{key:"getWidth",value:function(){if(!this.preFormatted)throw new Vex.RERR("UnformattedNote","Can't call GetWidth on an unformatted note.");return this.width+(this.modifierContext?this.modifierContext.getWidth():0)}},{key:"setXShift",value:function(e){return this.x_shift=e,this}},{key:"getXShift",value:function(){return this.x_shift}},{key:"getX",value:function(){if(!this.tickContext)throw new Vex.RERR("NoTickContext","Note needs a TickContext assigned for an X-Value");return this.tickContext.getX()+this.x_shift}},{key:"getAbsoluteX",value:function(){if(!this.tickContext)throw new Vex.RERR("NoTickContext","Note needs a TickContext assigned for an X-Value");var e=this.tickContext.getX();return this.stave&&(e+=this.stave.getNoteStartX()+this.render_options.stave_padding),this.isCenterAligned()&&("jianpu"===this.DYMusicScoreType||(e+=this.getCenterXShift())),e}},{key:"setPreFormatted",value:function(e){if(this.preFormatted=e,this.preFormatted){var t=this.tickContext.getExtraPx();this.left_modPx=Math.max(this.left_modPx,t.left),this.right_modPx=Math.max(this.right_modPx,t.right)}}}],[{key:"CATEGORY",get:function(){return"note"}},{key:"STAVEPADDING",get:function(){return 12}},{key:"plotMetrics",value:function(e,t,n){var i=t.getMetrics(),r=t.getAbsoluteX()-i.modLeftPx-i.extraLeftPx,a=t.getAbsoluteX()-i.extraLeftPx,s=t.getAbsoluteX(),o=t.getAbsoluteX()+i.noteWidth,l=t.getAbsoluteX()+i.noteWidth+i.extraRightPx,u=t.getAbsoluteX()+i.noteWidth+i.extraRightPx+i.modRightPx,c=u+t.getFormatterMetrics().freedom.right,h=u-r;e.save(),e.setFont("Arial",8,""),e.fillText(Math.round(h)+"px",r+t.getXShift(),n);var f=n+7;function d(n,i,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:f;e.beginPath(),e.setStrokeStyle(r),e.setFillStyle(r),e.setLineWidth(3),e.moveTo(n+t.getXShift(),a),e.lineTo(i+t.getXShift(),a),e.stroke()}d(r,a,"red"),d(a,s,"#999"),d(s,o,"green"),d(o,l,"#999"),d(l,u,"red"),d(u,c,"#DD0"),d(r-t.getXShift(),r,"#BBB"),Vex.drawDot(e,s+t.getXShift(),f,"blue");var p=t.getFormatterMetrics();if(p.iterations>0){var m=p.space.deviation,v=m>=0?"+":"";e.setFillStyle("red"),e.fillText(v+Math.round(m),s+t.getXShift(),n-10)}e.restore()}}]),n}(Tickable);function L$j(){for(var e=arguments.length,t=new Array(e),n=0;n2&&(o=!0),o||(n-=Flow.STEM_WIDTH/2*r),e.beginPath(),e.moveTo(n,i+a),e.lineTo(n,i+1),e.lineTo(n+s,i-a),e.lineTo(n+s,i),e.lineTo(n,i+a),e.closePath(),o?e.fill():e.stroke(),Flow.durationToFraction(t).equals(.5))for(var l=[-3,-1,s+1,s+3],u=0;uf?h:f,d=x,p=_}return t.right_shift+=f,!0}}]),n}(Modifier);function L$i(){for(var e=arguments.length,t=new Array(e),n=0;n0&&(this.keyProps[t-1].displaced=!0)),e=a,this.keyProps.push(r)}e=-1/0,this.keyProps.forEach((function(t){t.linet&&(t=i):i1}},{key:"hasStem",value:function(){return this.glyph.stem}},{key:"hasFlag",value:function(){return _get(_getPrototypeOf2(n.prototype),"hasFlag",this).call(this)&&!this.isRest()&&this.renderFlag}},{key:"getStemX",value:function(){return"r"===this.noteType?this.getCenterGlyphX():_get(_getPrototypeOf2(n.prototype),"getStemX",this).call(this)+getStemAdjustment(this)}},{key:"getYForTopText",value:function(e){var t=this.getStemExtents();return Math.min(this.stave.getYForTopText(e),t.topY-this.render_options.annotation_spacing*(e+1))}},{key:"getYForBottomText",value:function(e){var t=this.getStemExtents();return Math.max(this.stave.getYForTopText(e),t.baseY+this.render_options.annotation_spacing*e)}},{key:"setStave",value:function(e){_get(_getPrototypeOf2(n.prototype),"setStave",this).call(this,e);var t=this.note_heads.map((function(t){return t.setStave(e),t.getY()}));if(this.setYs(t),this.stem){var i=this.getNoteHeadBounds(),r=i.y_top,a=i.y_bottom;this.stem.setYBounds(r,a)}return this}},{key:"getKeys",value:function(){return this.keys}},{key:"getKeyProps",value:function(){return this.keyProps}},{key:"isDisplaced",value:function(){return this.displaced}},{key:"setNoteDisplaced",value:function(e){return this.displaced=e,this}},{key:"getTieRightX",value:function(){var e=this.getAbsoluteX();return e+=this.getGlyphWidth()+this.x_shift+this.extraRightPx,this.modifierContext&&(e+=this.modifierContext.getExtraRightPx()),e}},{key:"getTieLeftX",value:function(){var e=this.getAbsoluteX();return e+=this.x_shift-this.extraLeftPx}},{key:"getLineForRest",value:function(){var e=this.keyProps[0].line;if(this.keyProps.length>1){var t=this.keyProps[this.keyProps.length-1].line,n=Math.max(e,t),i=Math.min(e,t);e=Vex.MidLine(n,i)}return e}},{key:"getModifierStartXY",value:function(e,t,n){if(n=n||{},!this.preFormatted)throw new Vex.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");if(0===this.ys.length)throw new Vex.RERR("NoYValues","No Y-Values calculated for this note.");var i=Modifier.Position,r=i.ABOVE,a=i.BELOW,s=i.LEFT,o=i.RIGHT,l=0;return e===s?l=-2:e===o?(l=this.getGlyphWidth()+this.x_shift+2,this.stem_direction===Stem.UP&&this.hasFlag()&&(n.forceFlagRight||isInnerNoteIndex(this,t))&&(l+=this.flag.getMetrics().width)):e!==a&&e!==r||(l=this.getGlyphWidth()/2),{x:this.getAbsoluteX()+l,y:this.ys[t]}}},{key:"setStyle",value:function(e){_get(_getPrototypeOf2(n.prototype),"setStyle",this).call(this,e),this.note_heads.forEach((function(t){return t.setStyle(e)})),this.stem&&this.stem.setStyle(e)}},{key:"setStemStyle",value:function(e){this.stem&&this.getStem().setStyle(e)}},{key:"getStemStyle",value:function(){return this.stem.getStyle()}},{key:"setLedgerLineStyle",value:function(e){this.ledgerLineStyle=e}},{key:"getLedgerLineStyle",value:function(){return this.ledgerLineStyle}},{key:"setFlagStyle",value:function(e){this.flagStyle=e}},{key:"getFlagStyle",value:function(){return this.flagStyle}},{key:"setKeyStyle",value:function(e,t){return this.note_heads[e].setStyle(t),this}},{key:"setKeyLine",value:function(e,t){return"va5"!=this.glyph.code_head&&"v3c"!=this.glyph.code_head||(t=3),this.keyProps[e].line=t,this.reset(),this}},{key:"getKeyLine",value:function(e){return this.keyProps[e].line}},{key:"addToModifierContext",value:function(e){this.setModifierContext(e);for(var t=0;tt)&&(t=f),null===i&&c.isDisplaced()&&(i=c.getAbsoluteX()),null!==n||c.isDisplaced()||(n=c.getAbsoluteX()),r=h>r?h:r,a=h=l;--S){var x=null!==p&&S>=f,w=null!==d&&S>=h;v(e.getYForNote(S),x,w)}this.restoreStyle(i,g)}}},{key:"drawVibrato",value:function(){if(this.vibrato){var e=this.context;e.openGroup("vibrato");var t=this.vibrato.getNoteHeadEndX()+2,i=this.vibrato.getNoteHeadBounds().y_top,r=this.getNoteHeadBounds().y_bottom,a=Math.abs(this.getNoteHeadBeginX()-t)-10;this.vibrato.stave.y!==this.stave.y&&(a=30,r=i+10),n.renderVibrato(this.context,t,i,{harsh:!0,vibrato_width:a,wave_height:6,wave_width:4,wave_girth:2},r),e.closeGroup()}}},{key:"drawModifiers",value:function(){if(!this.context)throw new Vex.RERR("NoCanvasContext","Can't draw without a canvas context.");var e=this.context;e.openGroup("modifiers");for(var t=0;t6.5||c<-.5)&&(u+=c>6.5?10*(c-6.5):10*(c+.5))}n.openGroup("flag",null,{pointerBBox:!0}),this.applyStyle(n,this.getFlagStyle()||!1),this.flag.render(n,l,u),this.restoreStyle(n,this.getFlagStyle()||!1),n.closeGroup()}}},{key:"drawNoteHeads",value:function(){var e=this;this.note_heads.forEach((function(t){e.context.openGroup("notehead",null,{pointerBBox:!0});try{if(e.isRest()&&"w"===e.duration){var n=e.stave.options.line_config.filter((function(e){return e.visible})).length;4===e.keyProps[0].line&&n<5&&t.setY(t.getY()+10),1===n&&t.setLine(3)}}catch(i){}t.setContext(e.context).draw(),e.context.closeGroup()}))}},{key:"drawStem",value:function(e){if(!this.context)throw new Vex.RERR("NoCanvasContext","Can't draw without a canvas context.");e&&this.setStem(new Stem(e)),this.stem.id=Vex.Prefix("".concat(this.getAttribute("id"),"-stem")),this.stem&&(this.context.openGroup("stem",null,{pointerBBox:!0}),this.stem.setContext(this.context).draw(),this.context.closeGroup())}},{key:"draw",value:function(){if(!this.context)throw new Vex.RERR("NoCanvasContext","Can't draw without a canvas context.");if(!this.stave)throw new Vex.RERR("NoStave","Can't draw without a stave.");if(0===this.ys.length)throw new Vex.RERR("NoYValues","Can't draw note without Y values.");var e=this.stave.getLines();if(2===e||3===e||4===e)for(var t=0;t6.5||o<-.5)&&(this.beam||(this.stem.renderHeightAdjustment=o>6.5?10*(o-6.5):10*Math.abs(o+.5))),this.stem.setNoteHeadXBounds(s,s)}L$i("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}),a&&this.drawStem(),this.drawNoteHeads(),this.drawFlag(),this.context.closeGroup(),this.drawModifiers(),this.context.closeGroup(),this.restoreStyle(),this.setRendered()}}],[{key:"CATEGORY",get:function(){return"stavenotes"}},{key:"STEM_UP",get:function(){return Stem.UP}},{key:"STEM_DOWN",get:function(){return Stem.DOWN}},{key:"DEFAULT_LEDGER_LINE_OFFSET",get:function(){return 3}},{key:"renderVibrato",value:function(e,t,n,i,r){var a,s=i.vibrato_width,o=i.wave_width,l=i.wave_girth,u=i.wave_height,c=s/o,h=Math.abs(r-n)/c+2;for(e.beginPath(),e.moveTo(t,n+l),a=0;a2?n[1]:null,m=f>2?n[2]:n[1];2===f&&-1===d.stemDirection&&1===m.stemDirection&&(d=n[1],m=n[0]);var v,g=Math.max(d.voice_shift,m.voice_shift),y=0;if(2===f){var b=d.stemDirection===m.stemDirection?0:.5;if(d.stemDirection===m.stemDirection&&d.minLine<=m.maxLine&&(d.isrest||(v=Math.abs(d.line-(m.maxLine+.5)),v=Math.max(v,d.stemMin),d.minLine=d.line-v,d.note.setStemLength(10*v))),d.minLine<=m.maxLine+b)if(d.isrest)shiftRestVertical(d,m,1);else if(m.isrest)shiftRestVertical(m,d,-1);else{y=g;var _=Math.abs(d.line-m.line),S=0,x=0;"h"===d.note.duration?S++:"w"===d.note.duration&&x++,"h"===m.note.duration?S++:"w"===m.note.duration&&x++;var w=1===S||1===x||d.note.dots!==m.note.dots;if(i&&(w=w||2===x),0===_&&w){if(m.note.setXShift(y),d.note.dots>0){var k,E=0,T=_createForOfIteratorHelper(d.note.modifiers);try{for(T.s();!(k=T.n()).done;){var P=k.value;if(P instanceof Dot&&(E++,P.setYShift(-10*(m.maxLine-d.line+1)),E===d.note.dots))break}}catch(err){T.e(err)}finally{T.f()}}}else _<1&&_>0?m.note.setXShift(y):d.note.voice!==m.note.voice&&d.stemDirection===m.stemDirection&&(d.line>m.line?1===d.stemDirection?m.note.renderFlag=!1:d.note.renderFlag=!1:m.line>d.line?1===m.stemDirection?d.note.renderFlag=!1:m.note.renderFlag=!1:1===m.stemDirection&&(m.stemDirection=-1,m.note.setStemDirection(-1)))}return!0}if((null!==p&&p.minLineg?x:g):E===Modifier.Position.RIGHT&&(T.setXShift(v),y=(x=o+M)>y?x:y),b=P,_=k}return t.left_shift+=g,t.right_shift+=y,!0}}]),n}(Modifier),Music=function(){function e(){_classCallCheck2(this,e)}return _createClass2(e,[{key:"isValidNoteValue",value:function(t){return!(null==t||t<0||t>=e.NUM_TONES)}},{key:"isValidIntervalValue",value:function(e){return this.isValidNoteValue(e)}},{key:"getNoteParts",value:function(e){if(!e||e.length<1)throw new Vex.RERR("BadArguments","Invalid note name: "+e);if(e.length>3)throw new Vex.RERR("BadArguments","Invalid note name: "+e);var t=e.toLowerCase(),n=/^([cdefgab])(b|bb|n|#|##)?$/.exec(t);if(null!=n)return{root:n[1],accidental:n[2]};throw new Vex.RERR("BadArguments","Invalid note name: "+e)}},{key:"getKeyParts",value:function(e){if(!e||e.length<1)throw new Vex.RERR("BadArguments","Invalid key: "+e);var t=e.toLowerCase(),n=/^([cdefgab])(b|#)?(mel|harm|m|M)?$/.exec(t);if(null!=n){var i=n[1],r=n[2],a=n[3];return a||(a="M"),{root:i,accidental:r,type:a}}throw new Vex.RERR("BadArguments","Invalid key: ".concat(e))}},{key:"getNoteValue",value:function(t){var n=e.noteValues[t];if(null==n)throw new Vex.RERR("BadArguments","Invalid note name: ".concat(t));return n.int_val}},{key:"getIntervalValue",value:function(t){var n=e.intervals[t];if(null==n)throw new Vex.RERR("BadArguments","Invalid interval name: ".concat(t));return n}},{key:"getCanonicalNoteName",value:function(t){if(!this.isValidNoteValue(t))throw new Vex.RERR("BadArguments","Invalid note value: ".concat(t));return e.canonical_notes[t]}},{key:"getCanonicalIntervalName",value:function(t){if(!this.isValidIntervalValue(t))throw new Vex.RERR("BadArguments","Invalid interval value: ".concat(t));return e.diatonic_intervals[t]}},{key:"getRelativeNoteValue",value:function(t,n,i){if(null==i&&(i=1),1!==i&&-1!==i)throw new Vex.RERR("BadArguments","Invalid direction: ".concat(i));var r=(t+i*n)%e.NUM_TONES;return r<0&&(r+=e.NUM_TONES),r}},{key:"getRelativeNoteName",value:function(t,n){var i=this.getNoteParts(t),r=this.getNoteValue(i.root),a=n-r;if(Math.abs(a)>e.NUM_TONES-3){var s=1;a>0&&(s=-1);var o=(n+1+(r+1))%e.NUM_TONES*s;if(Math.abs(o)>2)throw new Vex.RERR("BadArguments","Notes not related: ".concat(t,", ").concat(n,")"));a=o}if(Math.abs(a)>2)throw new Vex.RERR("BadArguments","Notes not related: ".concat(t,", ").concat(n,")"));var l=i.root;if(a>0)for(var u=1;u<=a;++u)l+="#";else if(a<0)for(var c=-1;c>=a;--c)l+="b";return l}},{key:"getScaleTones",value:function(e,t){for(var n=[e],i=e,r=0;r0&&void 0!==arguments[0]?arguments[0]:null;if(_classCallCheck2(this,n),(e=t.call(this)).setAttribute("type","Accidental"),L$h("New accidental: ",i),e.note=null,e.index=null,e.type=i,e.position=Modifier.Position.LEFT,e.render_options={font_scale:38,stroke_px:3,parenLeftPadding:2,parenRightPadding:2},e.accidental=Flow.accidentalCodes(e.type),!e.accidental)throw new Vex.RERR("ArgumentError","Unknown accidental type: ".concat(i));return e.cautionary=!1,e.parenLeft=null,e.parenRight=null,e.reset(),e}return _createClass2(n,[{key:"reset",value:function(){var e=this.render_options.font_scale;this.glyph=new Glyph(this.accidental.code,e),this.glyph.setOriginX(1),this.cautionary&&(this.parenLeft=new Glyph(Flow.accidentalCodes("{").code,e),this.parenRight=new Glyph(Flow.accidentalCodes("}").code,e),this.parenLeft.setOriginX(1),this.parenRight.setOriginX(1))}},{key:"getCategory",value:function(){return n.CATEGORY}},{key:"getWidth",value:function(){var e=this.cautionary?getGlyphWidth(this.parenLeft)+getGlyphWidth(this.parenRight)+this.render_options.parenLeftPadding+this.render_options.parenRightPadding:0;return getGlyphWidth(this.glyph)+e}},{key:"setNote",value:function(e){if(!e)throw new Vex.RERR("ArgumentError","Bad note value: ".concat(e));this.note=e,"gracenotes"===this.note.getCategory()&&(this.render_options.font_scale=25,this.reset())}},{key:"setAsCautionary",value:function(){return this.cautionary=!0,this.render_options.font_scale=28,this.reset(),this}},{key:"draw",value:function(){var e=this.context,t=this.type,n=this.position,i=this.note,r=this.index,a=this.cautionary,s=this.x_shift,o=this.y_shift,l=this.glyph,u=this.parenLeft,c=this.parenRight,h=this.render_options,f=h.parenLeftPadding,d=h.parenRightPadding;if(this.checkContext(),!i||null==r)throw new Vex.RERR("NoAttachedNote","Can't draw accidental without a note and index.");var p=i.getModifierStartXY(n,r),m=p.x+s,v=p.y+o;L$h("Rendering: ",t,m,v),a?(c.render(e,m,v),m-=getGlyphWidth(c),m-=d,m-=this.accidental.parenRightPaddingAdjustment,l.render(e,m,v),m-=getGlyphWidth(l),m-=f,u.render(e,m,v)):l.render(e,m,v),this.setRendered()}}],[{key:"CATEGORY",get:function(){return"accidentals"}},{key:"format",value:function(e,t){var n=this,i=t.left_shift+1;if(e&&0!==e.length){for(var r=[],a=null,s=0,o=0;og?_.shift:g,y=_.line}for(var S=0,x=function(e){for(var t=!1,i=e,r=e;r+1=7){for(var d=2,p=!0;!0===p;){p=!1;for(var m=0;m+df?S:f}else for(h=e;h<=r;h++)f=Flow.accidentalColumnsTable[u][c][h-e],v[h].column=f,S=S>f?S:f;w=e=r},w=0;wk[e.column]&&(k[e.column]=e.width)}));for(var P=1;P0?(i=t.flatLine||t.dblSharpLine?2.5:3,e.dblSharpLine&&(n-=.5)):(i=e.flatLine||e.dblSharpLine?2.5:3,t.dblSharpLine&&(n-=.5));var r=Math.abs(n)-1;if(!c||c&&h){s[o.root]=u;var f=new n(l);t.addAccidental(r,f),i.push(u)}})),t.getModifiers().forEach((function(t){"gracenotegroups"===t.getCategory()&&t.getGraceNotes().forEach(e)})))}))}))}}]),n}(Modifier),NoteSubGroup$1=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e){var i;return _classCallCheck2(this,n),(i=t.call(this)).setAttribute("type","NoteSubGroup"),i.note=null,i.index=null,i.position=Modifier.Position.LEFT,i.subNotes=e,i.subNotes.forEach((function(e){e.ignore_ticks=!1})),i.width=0,i.preFormatted=!1,i.formatter=new _Formatter,i.voice=new Voice$1({num_beats:4,beat_value:4,resolution:Flow.RESOLUTION}).setStrict(!1),i.voice.addTickables(i.subNotes),_possibleConstructorReturn2(i,_assertThisInitialized2(i))}return _createClass2(n,[{key:"getCategory",value:function(){return n.CATEGORY}},{key:"preFormat",value:function(){this.preFormatted||(this.formatter.joinVoices([this.voice]).format([this.voice],0),this.setWidth(this.formatter.getMinTotalWidth()),this.preFormatted=!0)}},{key:"setNote",value:function(e){this.note=e}},{key:"setWidth",value:function(e){this.width=e}},{key:"getWidth",value:function(){return this.width}},{key:"draw",value:function(){var e=this;this.checkContext();var t=this.getNote();if(!t||null===this.index)throw new Vex.RuntimeError("NoAttachedNote","Can't draw notes without a parent note and parent note index.");this.setRendered(),this.alignSubNotesWithNote(this.subNotes,t),this.subNotes.forEach((function(t){return t.setContext(e.context).drawWithStyle()}))}}],[{key:"CATEGORY",get:function(){return"notesubgroup"}},{key:"format",value:function(e,t){if(!e||0===e.length)return!1;for(var n=0,i=0;ih&&Math.abs(u-h)<10?-6:0;if(this.first_note&&"jianpu"===this.first_note.DYMusicScoreType){if("TabTie"===this.getAttribute("type"))continue;u1){var t=new Beam$1(e);t.render_options.beam_width=3,t.render_options.partial_beam_length=4,this.beams.push(t)}return this}},{key:"setNote",value:function(e){this.note=e}},{key:"setWidth",value:function(e){this.width=e}},{key:"getWidth",value:function(){return this.width}},{key:"getGraceNotes",value:function(){return this.grace_notes}},{key:"draw",value:function(){var e=this;this.checkContext();var t=this.getNote();if(L$g("Drawing grace note group for:",t),!t||null===this.index)throw new Vex.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((function(t){t.setContext(e.context).draw()})),this.beams.forEach((function(t){t.setContext(e.context).draw()})),this.show_slur){var n=this.getNote().getCategory()===_StaveNote3.CATEGORY,i=n?_StaveTie2:TabTie;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=(n?7:5)+this.render_options.slur_y_shift,this.slur.setContext(this.context).draw()}}}],[{key:"CATEGORY",get:function(){return"gracenotegroups"}},{key:"format",value:function(e,t){if(!e||0===e.length)return!1;for(var n=[],i=null,r=0,a=0;a=Renderer.LineEndType.NONE&&e<=Renderer.LineEndType.DOWN&&(this.leg=e),this}},{key:"setStringNumber",value:function(e){return this.string_number=e,this}},{key:"setOffsetX",value:function(e){return this.x_offset=e,this}},{key:"setOffsetY",value:function(e){return this.y_offset=e,this}},{key:"setLastNote",value:function(e){return this.last_note=e,this}},{key:"setDashed",value:function(e){return this.dashed=e,this}},{key:"draw",value:function(){var e=this.checkContext();if(!this.note||null==this.index)throw new Vex.RERR("NoAttachedNote","Can't draw string number without a note and index.");this.setRendered();var t=this.note.stave.options.spacing_between_lines_px,n=this.note.getModifierStartXY(this.position,this.index),i=n.x+this.x_shift+this.x_offset,r=n.y+this.y_shift+this.y_offset;switch(this.position){case Modifier.Position.ABOVE:case Modifier.Position.BELOW:var a=this.note.getStemExtents(),s=a.topY,o=a.baseY+2;this.note.stem_direction===_StaveNote3.STEM_DOWN&&(s=a.baseY,o=a.topY-2),r=this.position===Modifier.Position.ABOVE?this.note.hasStem()?s-1.75*t:n.y-1.75*t:this.note.hasStem()?o+1.5*t:n.y+1.75*t,r+=this.y_shift+this.y_offset;break;case Modifier.Position.LEFT:i-=this.radius/2+5;break;case Modifier.Position.RIGHT:i+=this.radius/2+6;break;default:throw new Vex.RERR("InvalidPosition","The position ".concat(this.position," is invalid"))}e.save(),e.beginPath(),e.arc(i,r,this.radius,0,2*Math.PI,!1),e.lineWidth=1.5,e.stroke(),e.setFont(this.font.family,this.font.size,this.font.weight);var l=i-e.measureText(this.string_number).width/2;if(e.fillText(""+this.string_number,l,r+4.5),null!=this.last_note){var u,c,h=this.last_note.getStemX()-this.note.getX()+5;switch(e.strokeStyle="#000000",e.lineCap="round",e.lineWidth=.6,this.dashed?Renderer.drawDashedLine(e,i+10,r,i+h,r,[3,3]):Renderer.drawDashedLine(e,i+10,r,i+h,r,[3,0]),this.leg){case Renderer.LineEndType.UP:u=-10,c=this.dashed?[3,3]:[3,0],Renderer.drawDashedLine(e,i+h,r,i+h,r+u,c);break;case Renderer.LineEndType.DOWN:u=10,c=this.dashed?[3,3]:[3,0],Renderer.drawDashedLine(e,i+h,r,i+h,r+u,c)}}e.restore()}}],[{key:"CATEGORY",get:function(){return"stringnumber"}},{key:"format",value:function(e,t){var n=t.left_shift,i=t.right_shift;if(!e||0===e.length)return this;var r,a,s,o,l,u=[],c=null,h=0,f=0;for(r=0;rv?_:v):o===Modifier.Position.RIGHT&&(a.setXShift(m),g=(_+=w)>g?_:g),y=S,b=s}return t.left_shift+=v,t.right_shift+=g,!0}}]),n}(Modifier);function L$f(){for(var e=arguments.length,t=new Array(e),n=0;n=1},getRoundingFunction=function(e,t){return isWithinLines(e,t)?t===ABOVE?Math.ceil:Math.floor:Math.round},snapLineToStaff=function(e,t,n,i){var r=roundToNearestHalf(getRoundingFunction(t,n),t);if(e&&isWithinLines(r,n)&&r%1==0){return r+.5*-i}return r},isStaveNote=function(e){var t=e.getCategory();return"stavenotes"===t||"gracenotes"===t},isTabNote=function(e){var t=e.getCategory();return"tabnotes"===t||"numberednotes"===t},getTopY=function(e,t){var n=e.getStave(),i=e.getStemDirection(),r=e.getStemExtents(),a=r.topY,s=r.baseY;if(isStaveNote(e))return e.hasStem()?i===Stem.UP?a:s:Math.min.apply(Math,_toConsumableArray2(e.getYs()));if(isTabNote(e))return e.hasStem()&&i===Stem.UP?a:n.getYForTopText(t);throw new Vex.RERR("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")},getBottomY=function(e,t){var n=e.getStave(),i=e.getStemDirection(),r=e.getStemExtents(),a=r.topY,s=r.baseY;if(isStaveNote(e))return e.hasStem()?i===Stem.UP?s:a:Math.max.apply(Math,_toConsumableArray2(e.getYs()));if(isTabNote(e))return e.hasStem()?i===Stem.UP?n.getYForBottomText(t):a:n.getYForBottomText(t);throw new Vex.RERR("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")},getInitialOffset=function(e,t){var n=t===ABOVE&&e.getStemDirection()===Stem.UP||t===BELOW&&e.getStemDirection()===Stem.DOWN;return isStaveNote(e)?e.hasStem()&&n?.5:1:e.hasStem()&&n?1:0},Articulation$1=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e){var i;if(_classCallCheck2(this,n),(i=t.call(this)).setAttribute("type","Articulation"),i.note=null,i.index=null,i.type=e,i.position=BELOW,i.render_options={font_scale:38},i.articulation=Flow.articulationCodes(i.type),!i.articulation)throw new Vex.RERR("ArgumentError","Articulation not found: ".concat(i.type));return i.glyph=new Glyph(i.articulation.code,i.render_options.font_scale),i.setWidth(i.glyph.getMetrics().width),i}return _createClass2(n,[{key:"getCategory",value:function(){return n.CATEGORY}},{key:"draw",value:function(){var e,t=this,i=this.note,r=this.index,a=this.position,s=this.glyph,o=this.articulation.between_lines,l=this.text_line,u=this.context;if(this.checkContext(),!i||null==r)throw new Vex.RERR("NoAttachedNote","Can't draw Articulation without a note and index.");this.setRendered();var c=i.getStave(),h=c.getSpacingBetweenLines(),f="tabnotes"===i.getCategory(),d=i.getModifierStartXY(a,r).x,p=!o||f,m=getInitialOffset(i,a),v=(e={},_defineProperty2(e,ABOVE,(function(){s.setOrigin(.5,1);var e=getTopY(i,l)-(l+m)*h+(t.y_shift||0);return p?Math.min(c.getYForTopText(n.INITIAL_OFFSET),e):e})),_defineProperty2(e,BELOW,(function(){s.setOrigin(.5,0);var e=getBottomY(i,l)+(l+m)*h;return p?Math.max(c.getYForBottomText(n.INITIAL_OFFSET),e):e})),e)[a]();if(!f){var g=a===ABOVE?-1:1,y=f?i.positions[r].str:i.getKeyProps()[r].line,b=(i.getYs()[r]-v)/h+y,_=snapLineToStaff(o,b,a,g);isWithinLines(_,a)&&s.setOrigin(.5,.5),v+=Math.abs(_-b)*h*g}L$f("Rendering articulation at (x: ".concat(d,", y: ").concat(v,")")),s.render(u,d,v)}}],[{key:"CATEGORY",get:function(){return"articulations"}},{key:"INITIAL_OFFSET",get:function(){return-.5}},{key:"format",value:function(e,t){if(!e||0===e.length)return!1;var n=function(e,t,n){return roundToNearestHalf(getRoundingFunction(t,n),e.glyph.getMetrics().height/10+.5)};e.filter((function(e){return e.getPosition()===ABOVE})).forEach((function(e){e.setTextLine(t.top_text_line),t.top_text_line+=n(e,t.top_text_line,ABOVE)})),e.filter((function(e){return e.getPosition()===BELOW})).forEach((function(e){e.setTextLine(t.text_line),t.text_line+=n(e,t.text_line,BELOW)}));var i=e.map((function(e){return e.getWidth()})).reduce((function(e,t){return Math.max(t,e)}));return t.left_shift+=i/2,t.right_shift+=i/2,!0}},{key:"easyScoreHook",value:function(e,t,n){var i=e.articulations;if(i){var r={staccato:"a.",tenuto:"a-"};i.split(",").map((function(e){return e.trim().split(".")})).map((function(e){var t=_slicedToArray(e,2),i=t[0],a=t[1],s={type:r[i]};return a&&(s.position=Modifier.PositionString[a]),n.getFactory().Articulation(s)})).map((function(e){return t.addModifier(0,e)}))}}}]),n}(Modifier),_TickContext=function(e){_inherits2(n,e);var t=_createSuper(n);function n(){var e;return _classCallCheck2(this,n),(e=t.call(this)).setAttribute("type","TickContext"),e.currentTick=new Fraction(0,1),e.maxTicks=new Fraction(0,1),e.minTicks=null,e.padding=3,e.x=0,e.xBase=0,e.xOffset=0,e.tickables=[],e.notePx=0,e.extraLeftPx=0,e.extraRightPx=0,e.tContexts=[],e}return _createClass2(n,[{key:"getX",value:function(){return this.x}},{key:"setX",value:function(e){return this.x=e,this.xBase=e,this.xOffset=0,this}},{key:"getXBase",value:function(){return this.xBase}},{key:"setXBase",value:function(e){this.xBase=e,this.x=e+this.xOffset}},{key:"getXOffset",value:function(){return this.xOffset}},{key:"setXOffset",value:function(e){this.xOffset=e,this.x=this.xBase+e}},{key:"getWidth",value:function(){return this.width+2*this.padding}},{key:"setPadding",value:function(e){return this.padding=e,this}},{key:"getMaxTicks",value:function(){return this.maxTicks}},{key:"getMinTicks",value:function(){return this.minTicks}},{key:"getTickables",value:function(){return this.tickables}},{key:"getCenterAlignedTickables",value:function(){return this.tickables.filter((function(e){return e.isCenterAligned()}))}},{key:"getMetrics",value:function(){return{width:this.width,notePx:this.notePx,extraLeftPx:this.extraLeftPx,extraRightPx:this.extraRightPx}}},{key:"getCurrentTick",value:function(){return this.currentTick}},{key:"setCurrentTick",value:function(e){this.currentTick=e,this.preFormatted=!1}},{key:"getExtraPx",value:function(){for(var e=0,t=0,n=0,i=0,r=0;r0&&i--;for(var o=0;o4&&void 0!==arguments[4]?arguments[4]:0,a=t;for(n+=1;n4.5||a<1.5)){var c=e[n].stem;if(c)if(c.stem_direction>0){var h=a<1.5?Math.abs(a-1.5)*r:0;c.setResetHeight(h)}else{var f=a>4.5?Math.abs(a-4.5)*r:0;c.setResetHeight(f)}}}return a}function createContexts(e,t,n){if(!e||!e.length)throw new Vex.RERR("BadArgument","No voices to format");var i=e[0].getTotalTicks(),r=e.reduce((function(e,t){if(!t.getTotalTicks().equals(i))throw new Vex.RERR("TickMismatch","Voices should have same total note duration in ticks.");if(t.getMode()===Voice$1.Mode.STRICT&&!t.isComplete())throw new Vex.RERR("IncompleteVoice","Voice does not have enough notes.");return Math.max(e,Fraction.LCM(e,t.getResolutionMultiplier()))}),1),a={},s=[],o=[];return e.forEach((function(e){var i=new Fraction(0,r);e.getTickables().forEach((function(e){var r=i.numerator;if(!a[r]){var l=new t;o.push(l),a[r]=l}n(e,a[r]),s.push(r),i.add(e.getTicks())}))})),{map:a,array:o,list:Vex.SortAndUnique(s,(function(e,t){return e-t}),(function(e,t){return e===t})),resolutionMultiplier:r}}var _Formatter=function(){function e(){_classCallCheck2(this,e),this.minTotalWidth=0,this.hasMinTotalWidth=!1,this.totalTicks=new Fraction(0,1),this.tickContexts=null,this.modiferContexts=null,this.contextGaps={total:0,gaps:[]},this.voices=[]}return _createClass2(e,[{key:"alignRests",value:function(t,n){if(!t||!t.length)throw new Vex.RERR("BadArgument","No voices to format rests");t.forEach((function(t){return e.AlignRestsToNotes(t.getTickables(),n)}))}},{key:"preCalculateMinTotalWidth",value:function(e){if(this.hasMinTotalWidth)return this.minTotalWidth;if(!this.tickContexts){if(!e)throw new Vex.RERR("BadArgument","'voices' required to run preCalculateMinTotalWidth");this.createTickContexts(e)}var t=this.tickContexts,n=t.list,i=t.map;return this.minTotalWidth=n.map((function(e){var t=i[e];return t.preFormat(),t.getWidth()})).reduce((function(e,t){return e+t}),0),this.hasMinTotalWidth=!0,this.minTotalWidth}},{key:"getMinTotalWidth",value:function(){if(!this.hasMinTotalWidth)throw new Vex.RERR("NoMinTotalWidth","Call 'preCalculateMinTotalWidth' or 'preFormat' before calling 'getMinTotalWidth'");return this.minTotalWidth}},{key:"createModifierContexts",value:function(e){var t=createContexts(e,_ModifierContext,(function(e,t){return e.addToModifierContext(t)}));return this.modiferContexts=t,t}},{key:"createTickContexts",value:function(e){var t=createContexts(e,_TickContext,(function(e,t){return t.addTickable(e)}));return t.array.forEach((function(e){e.tContexts=t.array})),this.totalTicks=e[0].getTicksUsed().clone(),this.tickContexts=t,t}},{key:"preFormat",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,a=this.tickContexts,s=a.list,o=a.map,l=a.resolutionMultiplier;i&&r&&i.forEach((function(e){return e.setStave(r).preFormat()}));var u=0,c=0,h=t/2;if(this.minTotalWidth=0,s.forEach((function(t){var i=o[t];n&&i.setContext(n),i.preFormat();var r=i.getWidth();e.minTotalWidth+=r;var a=i.getMetrics();u=u+c+a.extraLeftPx,i.setX(u),c=r-a.extraLeftPx})),this.minTotalWidth=u+c,this.hasMinTotalWidth=!0,!(t<=0)){var f=t-this.minTotalWidth,d=f/(this.totalTicks.value()*l),p=0;s.forEach((function(e,t){var n=s[t-1]||0,i=o[e];p+=(e-n)*d,i.setX(i.getX()+p),i.getCenterAlignedTickables().forEach((function(e){e.center_x_shift=h-i.getX()}))})),1!==s.length&&(this.justifyWidth=t,this.lossHistory=[],this.evaluate())}}},{key:"evaluate",value:function(){var e=this,t=this.justifyWidth;this.contextGaps={total:0,gaps:[]},this.tickContexts.list.forEach((function(t,n){if(0!==n){var i=e.tickContexts.list[n-1],r=e.tickContexts.map[i],a=e.tickContexts.map[t],s=r.getMetrics(),o=r.getX()+s.width,l=a.getX(),u=l-o;e.contextGaps.total+=u,e.contextGaps.gaps.push({x1:o,x2:l}),a.getFormatterMetrics().freedom.left=u,r.getFormatterMetrics().freedom.right=u}}));var n=this.durationStats={};this.voices.forEach((function(e){e.getTickables().forEach((function(e,i,r){var a=e.getTicks().clone().simplify().toString(),s=e.getMetrics(),o=e.getFormatterMetrics(),l=e.getX()+s.noteWidth+s.modRightPx+s.extraRightPx,u=0;if(i0?e.tickContexts.map[r[i-1]]:null,o=i0?t=-Math.min(a.getFormatterMetrics().freedom.right,Math.abs(l)):l<0&&(t=o?Math.min(o.getFormatterMetrics().freedom.right,Math.abs(l)):0);var u=Math.min(5,Math.abs(t));t=t>0?u:-u})),this.evaluate()}},{key:"postFormat",value:function(){var e=function(e){return e.list.forEach((function(t){return e.map[t].postFormat()}))};return e(this.modiferContexts),e(this.tickContexts),this}},{key:"joinVoices",value:function(e){return this.createModifierContexts(e),this.hasMinTotalWidth=!1,this}},{key:"format",value:function(e,t,n){var i={align_rests:!1,context:null,stave:null};return Vex.Merge(i,n),this.voices=e,this.alignRests(e,i.align_rests),this.createTickContexts(e),this.preFormat(t,i.context,e,i.stave),i.stave&&this.postFormat(),this}},{key:"formatToStave",value:function(e,t,n){var i=t.getNoteEndX()-t.getNoteStartX()-10;L$b("Formatting voices to width: ",i);var r={context:t.getContext()};return Vex.Merge(r,n),this.format(e,i,r)}}],[{key:"SimpleFormat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.paddingBetween,r=void 0===i?10:i;e.reduce((function(e,t){t.addToModifierContext(new _ModifierContext);var n=(new _TickContext).addTickable(t).preFormat(),i=n.getExtraPx();return n.setX(e+i.left),e+n.getWidth()+i.right+r}),t)}},{key:"plotDebugging",value:function(e,t,n,i,r){var a=n+Note.STAVEPADDING,s=t.contextGaps;e.save(),e.setFont("Arial",8,""),s.gaps.forEach((function(t){var n,s,o;n=a+t.x1,s=a+t.x2,o="#aaa",e.beginPath(),e.setStrokeStyle(o),e.setFillStyle(o),e.setLineWidth(1),e.fillRect(n,i,s-n,r-i),e.fillText(Math.round(t.x2-t.x1),a+t.x1,r+12)})),e.fillText(Math.round(s.total)+"px",a-20,r+12),e.setFillStyle("red"),e.fillText("Loss: "+t.lossHistory.map((function(e){return Math.round(e)})),a-20,r+22),e.restore()}},{key:"FormatAndDraw",value:function(t,n,i,r){var a={auto_beam:!1,align_rests:!1};"object"===_typeof3(r)?Vex.Merge(a,r):"boolean"==typeof r&&(a.auto_beam=r);var s=new Voice$1(Flow.TIME4_4).setMode(Voice$1.Mode.SOFT).addTickables(i),o=a.auto_beam?Beam$1.applyAndGetBeams(s):[];return(new e).joinVoices([s],{align_rests:a.align_rests}).formatToStave([s],n,{align_rests:a.align_rests,stave:n}),s.setStave(n).draw(t,n),o.forEach((function(e){return e.setContext(t).draw()})),s.getBoundingBox()}},{key:"FormatAndDrawTab",value:function(t,n,i,r,a,s,o){var l={auto_beam:s,align_rests:!1};"object"===_typeof3(o)?Vex.Merge(l,o):"boolean"==typeof o&&(l.auto_beam=o);var u=new Voice$1(Flow.TIME4_4).setMode(Voice$1.Mode.SOFT).addTickables(a),c=new Voice$1(Flow.TIME4_4).setMode(Voice$1.Mode.SOFT).addTickables(r),h=l.auto_beam?Beam$1.applyAndGetBeams(u):[];(new e).joinVoices([u],{align_rests:l.align_rests}).joinVoices([c]).formatToStave([u,c],i,{align_rests:l.align_rests}),u.draw(t,i),c.draw(t,n),h.forEach((function(e){return e.setContext(t).draw()})),new _StaveConnector(i,n).setContext(t).draw()}},{key:"AlignRestsToNotes",value:function(e,t,n){return e.forEach((function(i,r){if(i instanceof _StaveNote3&&i.isRest()){if(i.tuplet&&!n)return;if(i.getGlyph().position.toUpperCase(),"va5"===i.glyph.code_head||"v3c"===i.glyph.code_head){var a="va5"===i.glyph.code_head?10:20,s=e[r-1],o=getNext(e,r),l=!1;if(s&&o&&s.beam&&o.beam&&(l=s.beam.notes.includes(o)),t||null!=i.beam||l){var u=i.getKeyProps()[0];if(0===r)u.line=lookAhead(e,u.line,r,!1,a),i.setKeyLine(0,u.line);else if(r>0&&r=e.line?s.above:s.below}this.placeGlyphOnLine(r,this.stave,e.line),this.glyphs.push(r);var o=this.xPositions[this.xPositions.length-1],l=r.getMetrics().width+a;this.xPositions.push(o+l),this.width+=l}},{key:"cancelKey",value:function(e){return this.formatted=!1,this.cancelKeySpec=e,this}},{key:"convertToCancelAccList",value:function(e){var t=Flow.keySignature(e),n=this.accList.length>0&&t.length>0&&t[0].type!==this.accList[0].type,i=n?t.length:t.length-this.accList.length;if(!(i<1)){for(var r=[],a=0;a2&&void 0!==arguments[2]?arguments[2]:this.accList,a=0;switch(e){case"soprano":"#"===t?n=[2.5,.5,2,0,1.5,-.5,1]:a=-1;break;case"mezzo-soprano":"b"===t?n=[0,2,.5,2.5,1,3,1.5]:a=1.5;break;case"alto":a=.5;break;case"tenor":"#"===t?n=[3,1,2.5,.5,2,0,1.5]:a=-.5;break;case"baritone-f":case"baritone-c":"b"===t?n=[.5,2.5,1,3,1.5,3.5,2]:a=2;break;case"bass":case"french":a=1}if(void 0!==n)for(i=0;i0?t[0].type:null;if(this.cancelKeySpec&&(e=this.convertToCancelAccList(this.cancelKeySpec)),this.alterKeySpec&&this.convertToAlterAccList(this.alterKeySpec),this.accList.length>0){var i=(this.position===StaveModifier.Position.END?this.stave.endClef:this.stave.clef)||this.stave.clef;e&&this.convertAccLines(i,e.type,e.accList),this.convertAccLines(i,n,t);for(var r=0;r0){this.stave.context.openGroup("keysignature");for(var e=0;e/"'));t.forEach((function(t){if(isNaN(Number(t)))throw new Vex.RERR("BadTimeSignature","Invalid time spec: ".concat(e,". Must contain two valid numbers."))}))},TimeSignature=function(e){_inherits2(n,e);var t=_createSuper(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(_classCallCheck2(this,n),(e=t.call(this)).setAttribute("type","TimeSignature"),e.validate_args=a,null===i)return _possibleConstructorReturn2(e);var s=r;return e.point=40,e.topLine=2,e.bottomLine=4,e.setPosition(StaveModifier.Position.BEGIN),e.setTimeSig(i),e.setWidth(e.timeSig.glyph.getMetrics().width),e.setPadding(s),e}return _createClass2(n,[{key:"getCategory",value:function(){return n.CATEGORY}},{key:"parseTimeSpec",value:function(e){if("C"===e||"C|"===e){var t=n.glyphs[e],i=t.line,r=t.code,a=t.point;return{line:i,num:!1,glyph:new Glyph(r,a)}}this.validate_args&&assertIsValidFraction(e);var s=_slicedToArray(e.split("/").map((function(e){return e.split("")})),2),o=s[0],l=s[1];return{num:!0,glyph:this.makeTimeSignatureGlyph(o,l)}}},{key:"makeTimeSignatureGlyph",value:function(e,t){var n=new Glyph("v0",this.point);n.topGlyphs=[],n.botGlyphs=[];for(var i=0,r=0;ro?i:o,f=n.getMetrics().x_min;n.getMetrics=function(){return{x_min:f,x_max:f+h,width:h}};var d=(h-i)/2,p=(h-o)/2,m=this;return n.renderToStave=function(e){for(var t=e+d,n=0;n0&&void 0!==arguments[0]?arguments[0]:0;if("number"!=typeof e)throw new Vex.RERR("InvalidIndex","Must be of number type");if(this.formatted||this.format(),1===this.getModifiers(StaveModifier.Position.BEGIN).length)return 0;var t=this.start_x-this.x,n=this.modifiers[0];return n.getType()===Barline.type.REPEAT_BEGIN&&t>n.getWidth()&&(t-=n.getWidth()),t}},{key:"setRepetitionTypeLeft",value:function(e,t){return this.modifiers.push(new Repetition$1(e,this.x,t)),this}},{key:"setRepetitionTypeRight",value:function(e,t){return this.modifiers.push(new Repetition$1(e,this.x,t)),this}},{key:"setVoltaType",value:function(e,t,n){if(2===e)2===volta.type&&volta.stave.modifiers.push(new Volta(volta.type,volta.number_t,volta.x,volta.y)),volta={stave:this,type:e,number_t:t,MeasureNumber:this.MeasureNumber,y:n,x:this.x};else if(4===e){for(var i=this.MeasureNumber-volta.MeasureNumber,r=Math.max(volta.y,n),a=0;a<=i;a++)voltaMeasureNumber[volta.MeasureNumber+a]={type:0===a?2:a===i?4:0,number_t:t,y:r};volta={}}else this.modifiers.push(new Volta(e,t,this.x,n));return this}},{key:"drawVolta",value:function(){var e=voltaMeasureNumber[this.MeasureNumber];e&&(this.modifiers.push(new Volta(e.type,e.number_t,this.x,e.y)),delete voltaMeasureNumber[this.MeasureNumber]),volta.type&&volta.MeasureNumber==this.MeasureNumber&&(this.modifiers.push(new Volta(volta.type,volta.number_t,this.x,volta.y)),volta={})}},{key:"setSection",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:12,r=new StaveSection(e,this.x+n,t);return r.font.size=i,this.modifiers.push(r),this}},{key:"setTempo",value:function(e,t){return this.modifiers.push(new StaveTempo(e,this.x,t)),this}},{key:"setText",value:function(e,t,n){var i=new StaveText(e,t,n);return i.setFont({family:"Arial",size:14,weight:"normal"}),this.modifiers.push(i),this}},{key:"getHeight",value:function(){return this.height}},{key:"getSpacingBetweenLines",value:function(){return this.options.spacing_between_lines_px}},{key:"getBoundingBox",value:function(){return new BoundingBox$1(this.x,this.y,this.width,this.getBottomY()-this.y)}},{key:"getBottomY",value:function(){var e=this.options,t=e.spacing_between_lines_px;return this.getYForLine(e.num_lines)+e.space_below_staff_ln*t}},{key:"getBottomLineY",value:function(){return this.getYForLine(this.options.num_lines)}},{key:"getYForLine",value:function(e){var t=this.options,n=t.spacing_between_lines_px,i=t.space_above_staff_ln;return this.y+e*n+i*n}},{key:"getLineForY",value:function(e){var t=this.options,n=t.spacing_between_lines_px,i=t.space_above_staff_ln;return(e-this.y)/n-i}},{key:"getYForTopText",value:function(e){var t=e||0;return this.getYForLine(-t-this.options.top_text_position)}},{key:"getYForBottomText",value:function(e){var t=e||0;return this.getYForLine(this.options.bottom_text_position+t)}},{key:"getYForNote",value:function(e){var t=this.options,n=t.spacing_between_lines_px,i=t.space_above_staff_ln;return this.y+i*n+5*n-e*n}},{key:"getYForGlyphs",value:function(){return this.getYForLine(3)}},{key:"addModifier",value:function(e,t,n){return void 0!==t&&e.setPosition(t),n&&(this.timeSignature.numerator=n.numerator,this.timeSignature.denominator=n.denominator),e.setStave(this),this.formatted=!1,this.modifiers.push(e),this}},{key:"addEndModifier",value:function(e){return this.addModifier(e,StaveModifier.Position.END),this}},{key:"setBegBarType",value:function(e){var t=Barline.type,n=t.SINGLE,i=t.REPEAT_BEGIN,r=t.NONE;return e!==n&&e!==i&&e!==r||(this.modifiers[0].setType(e),this.formatted=!1),this}},{key:"setEndBarType",value:function(e){return e!==Barline.type.REPEAT_BEGIN&&(this.modifiers[1].setType(e),this.formatted=!1),this}},{key:"setClef",value:function(e,t,n,i){void 0===i&&(i=StaveModifier.Position.BEGIN),i===StaveModifier.Position.END?this.endClef=e:this.clef=e;var r=this.getModifiers(i,Clef.CATEGORY);return 0===r.length?this.addClef(e,t,n,i):r[0].setType(e,t,n),this}},{key:"setEndClef",value:function(e,t,n){return this.setClef(e,t,n,StaveModifier.Position.END),this}},{key:"setKeySignature",value:function(e,t,n){this.options.keySignature=e,void 0===n&&(n=StaveModifier.Position.BEGIN);var i=this.getModifiers(n,KeySignature.CATEGORY);return 0===i.length?"jianpu"!==this.options.DYMusicScoreType&&this.addKeySignature(e,t,n):i[0].setKeySig(e,t),this}},{key:"setEndKeySignature",value:function(e,t){return this.setKeySignature(e,t,StaveModifier.Position.END),this}},{key:"setTimeSignature",value:function(e,t,n){void 0===n&&(n=StaveModifier.Position.BEGIN);var i=this.getModifiers(n,TimeSignature.CATEGORY);return 0===i.length?this.addTimeSignature(e,t,n):i[0].setTimeSig(e),this}},{key:"setEndTimeSignature",value:function(e,t){return this.setTimeSignature(e,t,StaveModifier.Position.END),this}},{key:"addKeySignature",value:function(e,t,n){return void 0===n&&(n=StaveModifier.Position.BEGIN),this.addModifier(new KeySignature(e,t).setPosition(n),n),this}},{key:"addClef",value:function(e,t,n,i){return void 0===i||i===StaveModifier.Position.BEGIN?this.clef=e:i===StaveModifier.Position.END&&(this.endClef=e),this.addModifier(new Clef(e,t,n),i),this}},{key:"addEndClef",value:function(e,t,n){return this.addClef(e,t,n,StaveModifier.Position.END),this}},{key:"addTimeSignature",value:function(e,t,n){return this.addModifier(new TimeSignature(e,t),n),this}},{key:"addEndTimeSignature",value:function(e,t){return this.addTimeSignature(e,t,StaveModifier.Position.END),this}},{key:"addTrebleGlyph",value:function(){return this.addClef("treble"),this}},{key:"getModifiers",value:function(e,t){return void 0===e&&void 0===t?this.modifiers:this.modifiers.filter((function(n){return!(void 0!==e&&e!==n.getPosition()||void 0!==t&&t!==n.getCategory())}))}},{key:"sortByCategory",value:function(e,t){for(var n=e.length-1;n>=0;n--)for(var i=0;it[e[i+1].getCategory()]){var r=e[i];e[i]=e[i+1],e[i+1]=r}}},{key:"format",value:function(){var e,t,n,i=this.modifiers[0],r=this.modifiers[1],a=this.getModifiers(StaveModifier.Position.BEGIN),s=this.getModifiers(StaveModifier.Position.END);this.sortByCategory(a,{barlines:0,clefs:1,keysignatures:2,timesignatures:3}),this.sortByCategory(s,{timesignatures:0,keysignatures:1,barlines:2,clefs:3}),a.length>1&&i.getType()===Barline.type.REPEAT_BEGIN&&(a.push(a.splice(0,1)[0]),a.splice(0,0,new Barline(Barline.type.SINGLE))),s.indexOf(r)>0&&s.splice(0,0,new Barline(Barline.type.NONE));for(var o=0,l=this.x,u=0;u0){this.context.save(),this.context.setFont(this.font.family,this.font.size,this.font.weight);var h=this.context.measureText(""+this.measure).width;t=this.getYForTopText(0)+3,this.context.fillText(""+this.measure,this.x-h/2,t),this.context.restore()}return this}},{key:"drawStaveTempo",value:function(){if(this.staveTempos.length){var e=document.querySelector("#".concat(this.attrs.id));if(e){var t=e.parentElement.getBBox(),n=this.getYForLine(0),i=e.parentElement.parentElement.querySelectorAll(".vf-curve");if(i.length){var r=this.x+this.staveTempos[0].shift_x+this.getModifierXShift(0),a=this.getYForTopText(1)+t.y-n+5;i.forEach((function(e){var n=e.getBBox();n.x-10r&&n.y-10a&&(t.y=n.y+5)}))}for(var s=0;s=0&&this.timeSignature.numerator){var t=40,i=0;this.MeasureNumber<2&&(t=70,i=-72),this.setText("".concat(this.timeSignature.numerator),1,{justification:1,shift_x:t,shift_y:i-13}),this.setText("ᅳ",1,{justification:1,shift_x:t+3,shift_y:i-2}),this.setText("".concat(this.timeSignature.denominator),1,{justification:1,shift_x:t,shift_y:i+8})}}},{key:"drawVertical",value:function(e,t){this.drawVerticalFixed(this.x+e,t)}},{key:"drawVerticalFixed",value:function(e,t){this.checkContext();var n=this.getYForLine(0),i=this.getYForLine(this.options.num_lines-1);t&&this.context.fillRect(e-3,n,1,i-n+1),this.context.fillRect(e,n,1,i-n+1)}},{key:"drawVerticalBar",value:function(e){this.drawVerticalBarFixed(this.x+e,!1)}},{key:"drawVerticalBarFixed",value:function(e){this.checkContext();var t=this.getYForLine(0),n=this.getYForLine(this.options.num_lines-1);this.context.fillRect(e,t,1,n-t+1)}},{key:"getConfigForLines",value:function(){return this.options.line_config}},{key:"setConfigForLine",value:function(e,t){if(e>=this.options.num_lines||e<0)throw new Vex.RERR("StaveConfigError","The line number must be within the range of the number of lines in the Stave.");if(void 0===t.visible)throw new Vex.RERR("StaveConfigError","The line configuration object is missing the 'visible' property.");if("boolean"!=typeof t.visible)throw new Vex.RERR("StaveConfigError","The line configuration objects 'visible' property must be true or false.");return this.options.line_config[e]=t,this}},{key:"setConfigForLines",value:function(e){if(e.length!==this.options.num_lines)throw new Vex.RERR("StaveConfigError","The length of the lines configuration array must match the number of lines in the Stave");for(var t in e)e[t]||(e[t]=this.options.line_config[t]),Vex.Merge(this.options.line_config[t],e[t]);return this.options.line_config=e,this}}],[{key:"saxophoneMap",value:function(e){var t={C:"bE","#C":"E","C#":"E",Db:"E",D:"F",Eb:"bG",E:"G",F:"bA","#F":"A","F#":"A",Gb:"A",G:"bB",Ab:"B",A:"C",Bb:"bD",B:"D"};return t[e]?t[e]:e}}]),n}(Element$2),_TabStave=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i,r,a){var s;_classCallCheck2(this,n);var o={spacing_between_lines_px:13,num_lines:6,top_text_position:1};return Vex.Merge(o,a),(s=t.call(this,e,i,r,o)).setAttribute("type","TabStave"),s}return _createClass2(n,[{key:"getYForGlyphs",value:function(){return this.getYForLine(2.5)}},{key:"addTabGlyph",value:function(){return this.addClef("tab"),this}}]),n}(_Stave2);function getUnusedStringGroups(e,t){for(var n=[],i=[],r=1;r<=e;r++){t.indexOf(r)>-1?(n.push(i),i=[]):i.push(r)}return i.length>0&&n.push(i),n}function getPartialStemLines(e,t,n,i){var r=1!==i,a=-1!==i,s=n.getSpacingBetweenLines(),o=n.getNumLines(),l=[];return t.forEach((function(t){var u=t.indexOf(o)>-1,c=t.indexOf(1)>-1;if(!(r&&c||a&&u)){1===t.length&&t.push(t[0]);var h=[];t.forEach((function(t,r,a){var l=1===t,u=t===o,c=n.getYForLine(t-1);0!==r||l?r!==a.length-1||u||(c+=s/2-1):c-=s/2-1,h.push(c),1===i&&l?h.push(e-2):-1===i&&u&&h.push(e+2)})),l.push(h.sort((function(e,t){return e-t})))}})),l}var TabNote$1=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i){var r;if(_classCallCheck2(this,n),(r=t.call(this,e)).setAttribute("type","TabNote"),r.ghost=!1,r.positions=e.positions,Vex.Merge(r.render_options,{glyph_font_scale:Flow.DEFAULT_TABLATURE_FONT_SCALE,draw_stem:i,draw_dots:i,draw_stem_through_stave:!1,y_shift:0,scale:1,font:"10pt Arial"}),r.glyph=Flow.getGlyphProps(r.duration,r.noteType),!r.glyph)throw new Vex.RuntimeError("BadArguments","Invalid note initialization data (No glyph found): ".concat(JSON.stringify(e)));return r.buildStem(),e.stem_direction?r.setStemDirection(e.stem_direction):r.setStemDirection(Stem.UP),r.ghost=!1,r.updateWidth(),r}return _createClass2(n,[{key:"reset",value:function(){this.stave&&this.setStave(this.stave)}},{key:"getCategory",value:function(){return n.CATEGORY}},{key:"setGhost",value:function(e){return this.ghost=e,this.updateWidth(),this}},{key:"hasStem",value:function(){return this.render_options.draw_stem}},{key:"getStemExtension",value:function(){var e=this.getGlyph();return null!=this.stem_extension_override?this.stem_extension_override:e?1===this.getStemDirection()?e.tabnote_stem_up_extension:e.tabnote_stem_down_extension:0}},{key:"addDot",value:function(){var e=new Dot;return this.dots+=1,this.addModifier(e,0)}},{key:"updateWidth",value:function(){var e=this;this.glyphs=[],this.width=0;for(var t=0;tparseInt(s,10)?n.SLIDE_DOWN:n.SLIDE_UP}return r.slide_direction=i,r.render_options.cp1=11,r.render_options.cp2=14,r.render_options.y_shift=.5,r.setFont({font:"Times",size:10,style:"bold italic"}),r.setNotes(e),r}return _createClass2(n,[{key:"renderTie",value:function(e){if(0===e.first_ys.length||0===e.last_ys.length)throw new Vex.RERR("BadArguments","No Y-values to render");var t=this.context,i=e.first_x_px,r=e.first_ys,a=e.last_x_px,s=this.slide_direction;if(s!==n.SLIDE_UP&&s!==n.SLIDE_DOWN)throw new Vex.RERR("BadSlide","Invalid slide direction");for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:"E/5,B/4,G/4,D/4,A/3,E/3,B/2,E/2";_classCallCheck2(this,e),this.setTuning(t)}return _createClass2(e,[{key:"noteToInteger",value:function(e){return Flow.keyProperties(e).int_value}},{key:"setTuning",value:function(t){e.names[t]&&(t=e.names[t]),this.tuningString=t,this.tuningValues=[],this.numStrings=0;var n=t.split(/\s*,\s*/);if(0===n.length)throw new Vex.RERR("BadArguments","Invalid tuning string: "+t);this.numStrings=n.length;for(var i=0;ithis.numStrings)throw new Vex.RERR("BadArguments","String number must be between 1 and ".concat(this.numStrings,":").concat(e));return this.tuningValues[t-1]}},{key:"getValueForFret",value:function(e,t){var n=this.getValueForString(t),i=parseInt(e,10);if(i<0)throw new Vex.RERR("BadArguments","Fret number must be 0 or higher: "+e);return n+i}},{key:"getNoteForFret",value:function(e,t){var n=this.getValueForFret(e,t),i=Math.floor(n/12),r=n%12;return Flow.integerToNote(r)+"/"+i}}],[{key:"names",get:function(){return{standard:"E/5,B/4,G/4,D/4,A/3,E/3",dagdad:"D/5,A/4,G/4,D/4,A/3,D/3",dropd:"E/5,B/4,G/4,D/4,A/3,D/3",eb:"Eb/5,Bb/4,Gb/4,Db/4,Ab/3,Db/3",standardBanjo:"D/5,B/4,G/4,D/4,G/5"}}}]),e}(),KeyManager=function(){function e(t){_classCallCheck2(this,e),this.music=new Music,this.setKey(t)}return _createClass2(e,[{key:"setKey",value:function(e){return this.key=e,this.reset(),this}},{key:"getKey",value:function(){return this.key}},{key:"reset",value:function(){if(this.keyParts=this.music.getKeyParts(this.key),this.keyString=this.keyParts.root,this.keyParts.accidental&&(this.keyString+=this.keyParts.accidental),!Music.scaleTypes[this.keyParts.type])throw new Vex.RERR("BadArguments","Unsupported key type: ".concat(this.key));this.scale=this.music.getScaleTones(this.music.getNoteValue(this.keyString),Music.scaleTypes[this.keyParts.type]),this.scaleMap={},this.scaleMapByValue={},this.originalScaleMapByValue={};for(var e=Music.root_indices[this.keyParts.root],t=0;tr.y;i.x+=a.getMetrics().modRightPx+o.padding_left,r.x-=s.getMetrics().modLeftPx+o.padding_right;var h=a.getGlyph().getWidth();a.getKeyProps()[n].displaced&&1===a.getStemDirection()&&(i.x+=h+o.padding_left),s.getKeyProps()[u].displaced&&-1===s.getStemDirection()&&(r.x-=h+o.padding_right),i.y+=c?-3:1,r.y+=c?2:0,drawArrowLine(t,i,r,e.render_options)})),t.restore();var l,u=t.measureText(this.text).width,c=o.text_justification,h=0;if(c===n.TextJustification.LEFT)h=i.x;else if(c===n.TextJustification.CENTER){h=(r.x-i.x)/2+i.x-u/2}else c===n.TextJustification.RIGHT&&(h=r.x-u);var f=o.text_position_vertical;return f===n.TextVerticalPosition.TOP?l=a.getStave().getYForTopText():f===n.TextVerticalPosition.BOTTOM&&(l=a.getStave().getYForBottomText(Flow.TEXT_HEIGHT_OFFSET_HACK)),t.save(),this.applyFontStyle(),t.fillText(this.text,h,l),t.restore(),this}}],[{key:"TextVerticalPosition",get:function(){return{TOP:1,BOTTOM:2}}},{key:"TextJustification",get:function(){return{LEFT:1,CENTER:2,RIGHT:3}}}]),n}(Element$2);function L$7(){for(var e=arguments.length,t=new Array(e),n=0;n3)throw new Vex.RERR("InvalidParameter","The style must be one found in PedalMarking.Styles");return this.style=e,this}},{key:"setLine",value:function(e){return this.line=e,this}},{key:"drawBracketed",value:function(){var e,t,i=this,r=this.context,a=!1,s=this;this.notes.forEach((function(o,l,u){a=!a;var c=0;if(c=o?o.getNoteHeadBeginX():i.endStave.end_x+i.endStaveAddedWidth,i.EndsStave)a?i.ChangeBegin&&(c=o.getAbsoluteX()):(c=o?i.ChangeEnd?o.getAbsoluteX():o.getStave().end_x+i.endStaveAddedWidth-s.render_options.text_margin_right:i.endStave.end_x+i.endStaveAddedWidth-s.render_options.text_margin_right,i.endMargin=-s.render_options.text_margin_right);else if(o)if(a)i.ChangeBegin&&(c=o.getAbsoluteX());else switch(s.style){case n.Styles.BRACKET_OPEN_END:case n.Styles.BRACKET_OPEN_BOTH:case n.Styles.MIXED_OPEN_END:c=o.getNoteHeadEndX();break;default:i.ChangeEnd?c=o.getAbsoluteX():(c=o.getNoteHeadBeginX()-s.render_options.text_margin_right,i.startMargin=-s.render_options.text_margin_right)}var h=i.endStave;o&&(h=o.getStave());var f=h.getYForBottomText(s.line+3);t&&t>f&&(f=t);var d=u[l+1]===o,p=u[l-1]===o,m=0;if(a)if(m=p?5:0,s.style!==n.Styles.MIXED&&s.style!==n.Styles.MIXED_OPEN_END||p)r.beginPath(),s.style===n.Styles.BRACKET_OPEN_BEGIN||s.style===n.Styles.BRACKET_OPEN_BOTH?r.moveTo(c+m,f):(i.ChangeBegin&&(c+=5),r.moveTo(c,f-s.render_options.bracket_height),i.ChangeBegin&&(c+=5),r.lineTo(c+m,f)),r.stroke(),r.closePath();else if(s.custom_depress_text){var v=r.measureText(s.custom_depress_text).width;r.fillText(s.custom_depress_text,c-v/2,f),m=v/2+s.render_options.text_margin_right}else drawPedalGlyph("pedal_depress",r,c,f,s.render_options.glyph_point_size),m=20+s.render_options.text_margin_right;else m=d&&!i.EndsStave?-5:0,r.beginPath(),r.moveTo(e,t),r.lineTo(c+m,f),s.style!==n.Styles.BRACKET_OPEN_END&&s.style!==n.Styles.MIXED_OPEN_END&&s.style!==n.Styles.BRACKET_OPEN_BOTH&&(i.ChangeEnd&&(c+=5),r.lineTo(c,f-s.render_options.bracket_height)),r.stroke(),r.closePath();e=c+m,t=f}))}},{key:"drawText",value:function(){var e=this.context,t=!1,n=this,i=n.render_options.glyph_point_size;this.notes.forEach((function(r){t=!t;var a=r.getStave(),s=r.getAbsoluteX(),o=a.getYForBottomText(n.line+3),l=0;t?n.custom_depress_text?(l=e.measureText(n.custom_depress_text).width,e.fillText(n.custom_depress_text,s-l/2,o)):drawPedalGlyph("pedal_depress",e,s,o,i):n.custom_release_text?(l=e.measureText(n.custom_release_text).width,e.fillText(n.custom_release_text,s-l/2,o)):drawPedalGlyph("pedal_release",e,s,o,i)}))}},{key:"draw",value:function(){var e=this.checkContext();this.setRendered(),e.save(),e.setStrokeStyle(this.render_options.color),e.setFillStyle(this.render_options.color),e.setFont(this.font.family,this.font.size,this.font.weight),L$7("Rendering Pedal Marking"),this.style===n.Styles.BRACKET||this.style===n.Styles.MIXED||this.style===n.Styles.MIXED_OPEN_END||this.style===n.Styles.BRACKET_OPEN_BEGIN||this.style===n.Styles.BRACKET_OPEN_END||this.style===n.Styles.BRACKET_OPEN_BOTH?(e.setLineWidth(this.render_options.bracket_line_width),this.drawBracketed()):this.style===n.Styles.TEXT&&this.drawText(),e.restore()}}],[{key:"GLYPHS",get:function(){return{pedal_depress:{code:"v36",x_shift:-10,y_shift:0},pedal_release:{code:"v5d",x_shift:-2,y_shift:3}}}},{key:"Styles",get:function(){return{TEXT:1,BRACKET:2,MIXED:3,MIXED_OPEN_END:4,BRACKET_OPEN_BEGIN:5,BRACKET_OPEN_END:6,BRACKET_OPEN_BOTH:7}}},{key:"StylesString",get:function(){return{text:n.Styles.TEXT,bracket:n.Styles.BRACKET,mixed:n.Styles.MIXED,mixed_open_end:n.Styles.MIXED_OPEN_END,bracket_open_begin:n.Styles.BRACKET_OPEN_BEGIN,bracket_open_end:n.Styles.BRACKET_OPEN_END,bracket_open_both:n.Styles.BRACKET_OPEN_BOTH}}},{key:"createSustain",value:function(e){return new n(e)}},{key:"createSostenuto",value:function(e){var t=new n(e);return t.setStyle(n.Styles.MIXED),t.setCustomText("Sost. Ped."),t}},{key:"createUnaCorda",value:function(e){var t=new n(e);return t.setStyle(n.Styles.TEXT),t.setCustomText("una corda","tre corda"),t}}]),n}(Element$2);function L$6(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:Barline.type.SINGLE;_classCallCheck2(this,n),(i=t.call(this,{duration:"b"})).setAttribute("type","BarNote"),i.metrics={widths:{}};var a=Barline.type;return i.metrics.widths=(_defineProperty2(e={},a.SINGLE,8),_defineProperty2(e,a.DOUBLE,12),_defineProperty2(e,a.END,15),_defineProperty2(e,a.REPEAT_BEGIN,14),_defineProperty2(e,a.REPEAT_END,14),_defineProperty2(e,a.REPEAT_BOTH,18),_defineProperty2(e,a.NONE,0),e),i.ignore_ticks=!0,i.setType(r),i}return _createClass2(n,[{key:"getType",value:function(){return this.type}},{key:"setType",value:function(e){return this.type="string"==typeof e?Barline.typeString[e]:e,this.setWidth(this.metrics.widths[this.type]),this}},{key:"getBoundingBox",value:function(){return _get(_getPrototypeOf2(n.prototype),"getBoundingBox",this).call(this)}},{key:"addToModifierContext",value:function(){return this}},{key:"preFormat",value:function(){return this.setPreFormatted(!0),this}},{key:"draw",value:function(){if(this.checkContext(),!this.stave)throw new Vex.RERR("NoStave","Can't draw without a stave.");L$5("Rendering bar line at: ",this.getAbsoluteX());var e=new Barline(this.type);e.setX(this.getAbsoluteX()),e.draw(this.stave),this.setRendered()}}]),n}(Note),_GhostNote=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e){var i,r;if(_classCallCheck2(this,n),!e)throw new Vex.RuntimeError("BadArguments","Ghost note must have valid initialization data to identify duration.");if("string"==typeof e)r={duration:e};else{if("object"!==_typeof3(e))throw new Vex.RuntimeError("BadArguments","Ghost note must have valid initialization data to identify duration.");r=e}return(i=t.call(this,r)).setAttribute("type","GhostNote"),i.setWidth(0),i}return _createClass2(n,[{key:"isRest",value:function(){return!0}},{key:"setStave",value:function(e){_get(_getPrototypeOf2(n.prototype),"setStave",this).call(this,e)}},{key:"addToModifierContext",value:function(){return this}},{key:"preFormat",value:function(){return this.setPreFormatted(!0),this}},{key:"draw",value:function(){if(!this.stave)throw new Vex.RERR("NoStave","Can't draw without a stave.");this.setRendered();for(var e=0;e1&&void 0!==arguments[1]&&arguments[1],n=t?new RegExp("^(("+e+"))"):new RegExp("^(("+e+")\\s*)"),i=this.line.slice(this.pos),r=i.match(n);return null!==r?{success:!0,matchedString:r[2],incrementPos:r[1].length,pos:this.pos}:{success:!1,pos:this.pos}}},{key:"expectOne",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[],i=this.pos,r=!0,a=!1;t=!0===t||!0===e.maybe;for(var s=0;s1&&void 0!==arguments[1]&&arguments[1],n=[],i=this.pos,r=0,a=!0;do{var s=this.expectOne(e);s.success?(r++,n.push(s.results)):a=!1}while(a);var o=r>0||!0===t;return!t||r>0||(this.pos=i),o?this.matchSuccess():this.matchFail(i),{success:o,results:n,numMatches:r}}},{key:"expectZeroOrMore",value:function(e){return this.expectOneOrMore(e,!0)}},{key:"expect",value:function(e){var t;if(L$3("Evaluating rules:",e),!e)throw new X$2("Invalid Rule: "+e,e);var n=e.bind(this.grammar)();if(n.token)(t=this.matchToken(n.token,!0===n.noSpace)).success&&(this.pos+=t.incrementPos);else{if(!n.expect)throw new X$2("Bad grammar! No `token` or `expect` property",n);t=n.oneOrMore?this.expectOneOrMore(n):n.zeroOrMore?this.expectZeroOrMore(n):this.expectOne(n)}return t.matches=[],t.results&&t.results.forEach((function(e){return t.matches.push(flattenMatches(e))})),n.run&&t.success&&n.run(t),t}}]),e}();function L$2(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.options={stem:"auto",clef:"treble"},this.elements={notes:[],accidentals:[]},this.rollingDuration="8",this.resetPiece(),Object.assign(this.options,e)}},{key:"getFactory",value:function(){return this.factory}},{key:"getElements",value:function(){return this.elements}},{key:"addCommitHook",value:function(e){this.commitHooks.push(e)}},{key:"resetPiece",value:function(){L$2("resetPiece"),this.piece={chord:[],duration:this.rollingDuration,dots:0,type:void 0,options:{}}}},{key:"setNoteDots",value:function(e){L$2("setNoteDots:",e),e&&(this.piece.dots=e.length)}},{key:"setNoteDuration",value:function(e){L$2("setNoteDuration:",e),this.rollingDuration=this.piece.duration=e||this.rollingDuration}},{key:"setNoteType",value:function(e){L$2("setNoteType:",e),e&&(this.piece.type=e)}},{key:"addNoteOption",value:function(e,t){L$2("addNoteOption: key:",e,"value:",t),this.piece.options[e]=t}},{key:"addNote",value:function(e,t,n){L$2("addNote:",e,t,n),this.piece.chord.push({key:e,accid:t,octave:n})}},{key:"addSingleNote",value:function(e,t,n){L$2("addSingleNote:",e,t,n),this.addNote(e,t,n)}},{key:"addChord",value:function(e){var t=this;L$2("startChord"),"object"!==_typeof3(e[0])?this.addSingleNote(e[0]):e.forEach((function(e){e&&t.addNote.apply(t,_toConsumableArray2(e))})),L$2("endChord")}},{key:"commitPiece",value:function(){var e=this;L$2("commitPiece");var t=this.factory;if(t){var n=_objectSpread2(_objectSpread2({},this.options),this.piece.options),i=n.stem,r=n.clef,a="auto"===i.toLowerCase(),s=a||"up"!==i.toLowerCase()?_StaveNote3.STEM_DOWN:_StaveNote3.STEM_UP,o=this.piece,l=o.chord,u=o.duration,c=o.dots,h=o.type,f=l.map((function(e){return e.key+"/"+e.octave})),d=t.StaveNote({keys:f,duration:u,dots:c,type:h,clef:r,auto_stem:a});a||d.setStemDirection(s);var p=l.map((function(e){return e.accid||null}));p.forEach((function(e,n){e&&d.addAccidental(n,t.Accidental({type:e}))}));for(var m=0;m0&&void 0!==arguments[0]?arguments[0]:{};_classCallCheck2(this,e),this.setOptions(t),this.defaults={clef:"treble",time:"4/4",stem:"auto"}}return _createClass2(e,[{key:"set",value:function(e){return Object.assign(this.defaults,e),this}},{key:"setOptions",value:function(e){var t=this;return this.options=_objectSpread2({factory:null,builder:null,commitHooks:[setId,setClass,Articulation$1.easyScoreHook],throwOnError:!1},e),this.factory=this.options.factory,this.builder=this.options.builder||new Builder(this.factory),this.grammar=new Grammar(this.builder),this.parser=new Parser$1(this.grammar),this.options.commitHooks.forEach((function(e){return t.addCommitHook(e)})),this}},{key:"setContext",value:function(e){return this.factory&&this.factory.setContext(e),this}},{key:"parse",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.builder.reset(t);var n=this.parser.parse(e);if(!n.success&&this.options.throwOnError)throw new X$1("Error parsing line: "+e,n);return n}},{key:"beam",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.factory.Beam({notes:e,options:t}),e}},{key:"tuplet",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.factory.Tuplet({notes:e,options:t}),e}},{key:"notes",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t=_objectSpread2({clef:this.defaults.clef,stem:this.defaults.stem},t),this.parse(e,t),this.builder.getElements().notes}},{key:"voice",value:function(e,t){return t=_objectSpread2({time:this.defaults.time},t),this.factory.Voice(t).addTickables(e)}},{key:"addCommitHook",value:function(e){return this.builder.addCommitHook(e)}}]),e}();function initGroup(){return{notes:[],finish:!1,total:0,staveId:""}}var _text_width=null,tone="C",group$1=initGroup(),_denominator="",_numerator="",ornamentGroup="",_NumberedNote=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e){var i;_classCallCheck2(this,n),(i=t.call(this,e)).setAttribute("type","NumberedNote"),tone=e.keyString,i.ornament=!!e.ornament,i.line=0,i.keys=e.keys||[],i.fontSize=20,i.offset_x=0,i.offset_y=0,i.note_tones=[],i.duration_lines=0,i.long_duration_lines=0,i.note_size=e.note_size||16;var r=Flow.sanitizeDuration(i.duration),a=n.numberedDurationLine[r.toString()];if(a&&(i.duration_lines=a),(a=n.longDurationLine[r.toString()])&&(i.long_duration_lines=a),!_text_width){var s="__$text_wraper$$__",o=document.createElement("canvas");o.id=s,document.body.append(o);var l=document.getElementById(s),u=l.getContext("2d");u.font="Arial 22px";var c=u.measureText("5");_text_width=c.width+2,document.body.removeChild(l)}return i}return _createClass2(n,[{key:"getCategory",value:function(){return n.CATEGORY}},{key:"setKeySignature",value:function(e){this.keySignature=e}},{key:"preFormat",value:function(){this.preFormatted||(this.modifierContext&&this.modifierContext.preFormat(),this.setWidth(this.full_width),this.setPreFormatted(!0))}},{key:"filterNote",value:function(){if(!(window&&window.sett&&window.sett.keySignature)&&this.keys&&this.keys.length){var e=n.accidentalMap(tone);if(e){var t=n.noteLift;if(t){var i=this.keys[0].split("/")[0];"b"===i&&(i="R"),(i=(i=i.replaceAll("#","")).replaceAll("n","")).length>1&&(i=i.replaceAll("b",""));var r=NumberedNoteHead.numberedNotationMapping[i.toUpperCase()];if(t.includes(r))for(var a=0;a=_numerator&&(this.long_duration_lines=_numerator-1),8==_denominator)if(this.long_duration_lines=0,3==_numerator&&this.draw_dot(this.context,this.bottom_x+25,this.bottom_y-30,this.dot_width),6==_numerator)this.draw_dot(this.context,this.bottom_x+25,this.bottom_y-30,this.dot_width),new Glyph("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);return group$1=initGroup()}var r={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*e&&(this.long_duration_lines=parseInt(i/e)-1,this.handleDeleteDot()),ornamentGroup&&(r.x+=this.note_width),group$1.notes.push(r);var a=group$1.notes.reduce((function(e,t){return e+t.duration}),0);if((a=parseInt(a))>e&&(a-=e),a>e-10&&ai)r.push(o),a++;else{if(r.length>1){var l=r.length-1;n=r[0].y+this.duration_line_space,e.rect(r[0].x,n+3*i,r[l].x-r[0].x+r[l].width,.5)}r=[],a=s+1}}if(r.length>1){var u=r.length-1;n=r[0].y+this.duration_line_space,e.rect(r[0].x,n+3*i,r[u].x-r[0].x+r[u].width,.5)}}}},{key:"draw_dot",value:function(e,t,n,i){e.openGroup("numbered-note-dot"),e.beginPath(),e.arc(t,n,i,0,2*Math.PI),e.closePath(),e.fill(),e.closeGroup()}},{key:"drawDurationLine",value:function(e,t){var n,i,r=this.attrs.id+"-lines";if(e.openGroup("numbered_note_lines",r),this.duration_lines>0){var a=this.duration_line_space,s=this.full_width;if(t&&t.width&&(s=t.width),s<0&&(s=this.note_width),n=t&&void 0!==t.startX?t.startX:this.x-a/2-this.left_width,i=t&&void 0!==t.startY?t.startY:this.y+this.duration_line_space,group$1.finish&&(this.drawDurationLoneLine(e,i),group$1=initGroup()),this.ornament?(n+=12,i-=22,s=15,ornamentGroup&&(n-=10,s+=10)):ornamentGroup&&(n+=this.note_width,s-=this.note_width),s>0){for(var o=0;o-1?this.modifiers[a].accidental.code="#"===r?"v18":"v44":this.modifiers.splice(a,1)}}catch(s){console.log("🚀 ~ error",s)}}this.setYs(e)}},{key:"getFullWidth",value:function(){return this.full_width}},{key:"getFullHeight",value:function(){return this.full_height}},{key:"getLine",value:function(){return this.keyProps[0].line}},{key:"full_width",get:function(){return this.note_width+this.left_width+this.right_width+this.long_duration_line_width}},{key:"long_duration_line_width",get:function(){return(this.long_duration_width+this.long_duration_space)*this.long_duration_lines}},{key:"full_height",get:function(){return this.bottom_y-this.top_y}},{key:"note_width",get:function(){return this.note_size||0}},{key:"note_dot_width",get:function(){return 6}},{key:"note_height",get:function(){return this.unit_height}},{key:"unit_height",get:function(){return this.note_size||0}},{key:"note_x",get:function(){return this.x||0}},{key:"top_x",get:function(){return this.x||0}},{key:"top_y",get:function(){var e=this;return(this.y||0)-(e.note_tones.map((function(t){return(t.td+t.bd)*(e.dot_space+e.dot_width)})).reduce((function(e,t){return e+t}),0)+this.note_height*this.note_tones.length-this.unit_height-this.note_tones[0].bd*(e.dot_space+e.dot_width)+(this.note_tones.length-1)*this.head_space)}},{key:"bottom_x",get:function(){return this.x||0}},{key:"bottom_y",get:function(){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)}},{key:"left_width",get:function(){return this.modifiers_width}},{key:"right_width",get:function(){return this.full_duration_dot_width}},{key:"duration_dot_width",get:function(){return 6}},{key:"full_duration_dot_width",get:function(){return this.duration_dot_width*this.getModifiersByCategory(Dot.CATEGORY).length}},{key:"getModifiersByCategory",value:function(e){var t=[];return this.modifiers.forEach((function(n){n.getCategory()===e&&t.push(n)})),t}},{key:"head_space",get:function(){return 6}},{key:"duration_line_height",get:function(){return 2}},{key:"duration_line_space",get:function(){return 4}},{key:"dot_width",get:function(){return 2}},{key:"dot_space",get:function(){return 2}},{key:"long_duration_space",get:function(){return 10}},{key:"long_duration_width",get:function(){return 20}},{key:"getWidth",value:function(){return this.full_width}},{key:"modifiers_width",get:function(){var e=0;return this.modifiers.forEach((function(t){e+=t.getWidth()})),e}}],[{key:"CATEGORY",get:function(){return"numberednotes"}},{key:"accidentalAndKey",value:function(e){switch(e){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{}}}},{key:"accidentalMap",value:function(e){switch(e){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","#":"","##":"#"}}}},{key:"noteLift",get:function(){switch(tone){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"]}}},{key:"longDurationLine",get:function(){return{1:3,2:1,6:2}}},{key:"numberedDurationLine",get:function(){return{8:1,16:2,32:3,64:4,128:5}}},{key:"durationTime",get:function(){return{8:6144,4:4096}}}]),n}(_StaveNote3),NumberedNoteHead=function(){function e(t){_classCallCheck2(this,e),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}return _createClass2(e,[{key:"tone_to_numbered_key",value:function(){var t=this.key.split("/")[0];"b"===t&&(t="R"),(t=(t=t.replaceAll("#","")).replaceAll("n","")).length>1&&(t=t.replaceAll("b",""));var n=0,i=0;this.note.stave&&this.note.stave.options&&this.note.stave.options.keySignature&&(tone=this.note.stave.options.keySignature);var r=this.note.getLine();return re.numberedNotationMapping.max&&(i=Math.ceil((r-e.numberedNotationMapping.max)/3.5)),"R"===t.toUpperCase()&&(n=0,i=0),{key:e.numberedNotationMapping[t.toUpperCase()],td:i,bd:n}}},{key:"draw",value:function(e){var t=this.y;e.openGroup("numbered-note-head");for(var n=this.x+(this.note.ornament?-2:0),i=t-this.note.unit_height-this.note.dot_space-(this.note.ornament?-4:2),r=0;r1&&(s-=this.note.duration_line_space),t+=s}this.draw_dot(e,n+_text_width,t,this.note.dot_width),t+=this.note.dot_width+this.note.dot_space}e.closeGroup()}},{key:"height",get:function(){return this.note.note_height+(this.meta.bd+this.meta.td)*(this.note.dot_width+this.note.dot_space)}},{key:"draw_dot",value:function(e,t,n,i){e.openGroup("numbered-note-dot"),e.beginPath(),e.arc(t,n,i,0,2*Math.PI),e.closePath(),e.fill(),e.closeGroup()}}],[{key:"numberedNotationMapping",get:function(){var e=tone;switch(window&&window.sett&&window.sett.keySignature&&(e="C"),e){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}}}}]),e}();function L$1(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=t.options;return(e=Object.assign(t,e)).options=Object.assign(n,e.options),e}var Factory=function(){function e(t){_classCallCheck2(this,e),L$1("New factory: ",t);var n={stave:{space:10},renderer:{context:null,elementId:"",backend:Renderer.Backends.SVG,width:500,height:200,background:"#FFF"},font:{face:"Arial",point:10,style:""}};this.options=n,this.setOptions(t)}return _createClass2(e,[{key:"reset",value:function(){this.renderQ=[],this.systems=[],this.staves=[],this.voices=[],this.stave=null}},{key:"getOptions",value:function(){return this.options}},{key:"setOptions",value:function(e){for(var t=0,n=["stave","renderer","font"];t0&&void 0!==arguments[0]?arguments[0]:{};e.factory=this;var t=new System(e).setContext(this.context);return this.systems.push(t),t}))},{key:"EasyScore",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.factory=this,new _EasyScore(e)}},{key:"PedalMarking",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=setDefaults$1(e,{notes:[],options:{style:"mixed"}});var t=new _PedalMarking(e.notes);return t.setStyle(_PedalMarking.StylesString[e.options.style]),t.setContext(this.context),this.renderQ.push(t),t}},{key:"NoteSubGroup",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=setDefaults$1(e,{notes:[],options:{}});var t=new NoteSubGroup$1(e.notes);return t.setContext(this.context),t}},{key:"draw",value:function(){var e=this;this.systems.forEach((function(t){return t.setContext(e.context).format()})),this.staves.forEach((function(t){return t.setContext(e.context).draw()})),this.voices.forEach((function(t){return t.setContext(e.context).draw()})),this.renderQ.forEach((function(t){t.isRendered()||t.setContext(e.context).draw()})),this.systems.forEach((function(t){return t.setContext(e.context).draw()})),this.reset()}}],[{key:"newFromElementId",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200;return new e({renderer:{elementId:t,width:n,height:i}})}}]),e}();function setDefaults(e,t){var n=t.options;return(e=Object.assign(t,e)).options=Object.assign(n,e.options),e}var System=function(e){_inherits2(n,e);var t=_createSuper(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck2(this,n),(e=t.call(this)).setAttribute("type","System"),e.setOptions(i),e.parts=[],e}return _createClass2(n,[{key:"setOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=setDefaults(e,{x:10,y:10,width:500,connector:null,spaceBetweenStaves:12,factory:null,debugFormatter:!1,formatIterations:0,options:{}}),this.factory=this.options.factory||new Factory({renderer:{el:null}})}},{key:"setContext",value:function(e){return _get(_getPrototypeOf2(n.prototype),"setContext",this).call(this,e),this.factory.setContext(e),this}},{key:"addConnector",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"double";return this.connector=this.factory.StaveConnector({top_stave:this.parts[0].stave,bottom_stave:this.parts[this.parts.length-1].stave,type:e}),this.connector}},{key:"addStave",value:function(e){var t=this;return(e=setDefaults(e,{stave:null,voices:[],spaceAbove:0,spaceBelow:0,debugNoteMetrics:!1,options:{left_bar:!1}})).stave||(e.stave=this.factory.Stave({x:this.options.x,y:this.options.y,width:this.options.width,options:e.options})),e.voices.forEach((function(n){return n.setContext(t.context).setStave(e.stave).getTickables().forEach((function(t){return t.setStave(e.stave)}))})),this.parts.push(e),e.stave}},{key:"format",value:function(){var e=this,t=new _Formatter;this.formatter=t;var n=this.options.y,i=0,r=[],a=[];this.parts.forEach((function(s){n+=s.stave.space(s.spaceAbove),s.stave.setY(n),t.joinVoices(s.voices),n+=s.stave.space(s.spaceBelow),n+=s.stave.space(e.options.spaceBetweenStaves),s.debugNoteMetrics&&(a.push({y:n,voice:s.voices[0]}),n+=15),r=r.concat(s.voices),i=Math.max(i,s.stave.getNoteStartX())})),this.parts.forEach((function(e){return e.stave.setNoteStartX(i)}));var s=this.options.width-(i-this.options.x)-Note.STAVEPADDING;t.format(r,s);for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:ArpeggioType.ARPEGGIO_DIRECTIONLESS;_classCallCheck2(this,e),this.parentVoiceEntry=t,this.type=n,this.notes=[]}return _createClass2(e,[{key:"addNote",value:function(e){this.notes.push(e),e.Arpeggio=this}}]),e}(),ArpeggioType=function(e){return e[e.BRUSH_DOWN=1]="BRUSH_DOWN",e[e.BRUSH_UP=2]="BRUSH_UP",e[e.ROLL_DOWN=3]="ROLL_DOWN",e[e.ROLL_UP=4]="ROLL_UP",e[e.RASQUEDO_DOWN=5]="RASQUEDO_DOWN",e[e.RASQUEDO_UP=6]="RASQUEDO_UP",e[e.ARPEGGIO_DIRECTIONLESS=7]="ARPEGGIO_DIRECTIONLESS",e}(ArpeggioType||{}),Beam=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;_classCallCheck2(this,e),this.notes=[],this.extendedNoteList=[],this.BeamNumberOffsetToXML=0,this.BeamNumber=t,this.BeamNumberOffsetToXML=n}return _createClass2(e,[{key:"Notes",get:function(){return this.notes},set:function(e){this.notes=e}},{key:"ExtendedNoteList",get:function(){return this.extendedNoteList},set:function(e){this.extendedNoteList=e}},{key:"addNoteToBeam",value:function(e){e&&(e.NoteBeam=this,this.notes.push(e),this.extendedNoteList.push(e))}}]),e}(),Voice=function(){function e(t,n){_classCallCheck2(this,e),this.voiceEntries=[],this.volume=1,this.parent=t,this.visible=!0,this.audible=!0,this.following=!0,this.voiceId=n,this.uniqueVoiceId="I:"+this.parent.Id+" V: "+this.voiceId}return _createClass2(e,[{key:"VoiceEntries",get:function(){return this.voiceEntries}},{key:"Parent",get:function(){return this.parent}},{key:"Visible",get:function(){return this.visible},set:function(e){this.visible=e}},{key:"Audible",get:function(){return this.audible},set:function(e){this.audible=e}},{key:"Following",get:function(){return this.following},set:function(e){this.following=e}},{key:"Solo",get:function(){return this.solo},set:function(e){this.solo=e}},{key:"VoiceId",get:function(){return this.voiceId}},{key:"Volume",get:function(){return this.volume},set:function(e){this.volume=e}},{key:"toString",value:function(){return this.uniqueVoiceId}}]),e}(),LinkedVoice=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i,r){var a;return _classCallCheck2(this,n),(a=t.call(this,e,i)).master=r,a}return _createClass2(n,[{key:"Master",get:function(){return this.master}}]),n}(Voice),Notehead=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;_classCallCheck2(this,e),this.sourceNote=t,this.setShapeFromXml(n,i)}return _createClass2(e,[{key:"setShapeFromXml",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;this.shape=e.ShapeTypeXmlToShape(t);var i=n;void 0===i&&(this.sourceNote?i=this.sourceNote.Length.Denominator>2:(log$2.warn("notehead: sourceNote and filledXmlAttribute undefined."),i=!0)),this.filled=i}},{key:"SourceNote",get:function(){return this.sourceNote}},{key:"Shape",get:function(){return this.shape}},{key:"Filled",get:function(){return this.filled}}],[{key:"ShapeTypeXmlToShape",value:function(e){switch(e.toLowerCase()){case"normal":return NoteHeadShape.NORMAL;case"x":return NoteHeadShape.X;case"slash":return NoteHeadShape.SLASH;case"diamond":return NoteHeadShape.DIAMOND;case"square":case"la":return NoteHeadShape.SQUARE;case"do":case"triangle":return NoteHeadShape.TRIANGLE;case"rectangle":return NoteHeadShape.RECTANGLE;case"circle-x":return NoteHeadShape.CIRCLEX;default:return log$2.info("unsupported/unhandled xml notehead '"+e+"'. Using normal notehead."),NoteHeadShape.NORMAL}}}]),e}(),NoteHeadShape=function(e){return e[e.CIRCLEX=0]="CIRCLEX",e[e.DIAMOND=1]="DIAMOND",e[e.NORMAL=2]="NORMAL",e[e.RECTANGLE=3]="RECTANGLE",e[e.SLASH=4]="SLASH",e[e.SQUARE=5]="SQUARE",e[e.TRIANGLE=6]="TRIANGLE",e[e.X=7]="X",e}(NoteHeadShape||{}),ITextTranslation=function(){function e(){_classCallCheck2(this,e)}return _createClass2(e,null,[{key:"translateText",value:function(e,t){if(!this.defaultTextTranslation)return t}}]),e}(),NoteType=function(e){return e[e.UNDEFINED=0]="UNDEFINED",e[e._1024th=1]="_1024th",e[e._512th=2]="_512th",e[e._256th=3]="_256th",e[e._128th=4]="_128th",e[e._64th=5]="_64th",e[e._32nd=6]="_32nd",e[e._16th=7]="_16th",e[e.EIGTH=8]="EIGTH",e[e.QUARTER=9]="QUARTER",e[e.HALF=10]="HALF",e[e.WHOLE=11]="WHOLE",e[e.BREVE=12]="BREVE",e[e.LONG=13]="LONG",e[e.MAXIMA=14]="MAXIMA",e}(NoteType||{}),NoteTypeHandler=function(){function e(){_classCallCheck2(this,e)}return _createClass2(e,null,[{key:"NoteTypeToString",value:function(e){return this.NoteTypeXmlValues[e]}},{key:"StringToNoteType",value:function(e){var t=this.NoteTypeXmlValues.indexOf(e);return-1!==t?t:0}},{key:"getNoteDurationFromType",value:function(e){switch(e){case"1024th":return new Fraction$1(1,1024);case"512th":return new Fraction$1(1,512);case"256th":return new Fraction$1(1,256);case"128th":return new Fraction$1(1,128);case"64th":return new Fraction$1(1,64);case"32th":case"32nd":return new Fraction$1(1,32);case"16th":return new Fraction$1(1,16);case"eighth":return new Fraction$1(1,8);case"quarter":return new Fraction$1(1,4);case"half":return new Fraction$1(1,2);case"whole":return new Fraction$1(1,1);case"breve":return new Fraction$1(2,1);case"long":return new Fraction$1(4,1);case"maxima":return new Fraction$1(8,1);default:var t=ITextTranslation.translateText("ReaderErrorMessages/NoteDurationError","Invalid note duration.");throw new MusicSheetReadingException(t)}}}]),e}();NoteTypeHandler.NoteTypeXmlValues=["","1024th","512th","256th","128th","64th","32nd","16th","eigth","quarter","half","whole","breve","long","maxima"];var OrnamentContainer=function(){function e(t){_classCallCheck2(this,e),this.placement=PlacementEnum.Above,this.accidentalAbove=AccidentalEnum.NONE,this.accidentalBelow=AccidentalEnum.NONE,this.ornament=t}return _createClass2(e,[{key:"GetOrnament",get:function(){return this.ornament}},{key:"AccidentalAbove",get:function(){return this.accidentalAbove},set:function(e){this.accidentalAbove=e}},{key:"AccidentalBelow",get:function(){return this.accidentalBelow},set:function(e){this.accidentalBelow=e}}]),e}(),OrnamentEnum=function(e){return e[e.Trill=0]="Trill",e[e.Turn=1]="Turn",e[e.InvertedTurn=2]="InvertedTurn",e[e.DelayedTurn=3]="DelayedTurn",e[e.DelayedInvertedTurn=4]="DelayedInvertedTurn",e[e.Mordent=5]="Mordent",e[e.InvertedMordent=6]="InvertedMordent",e}(OrnamentEnum||{}),VerticalSourceStaffEntryContainer=function(){function e(t,n,i){_classCallCheck2(this,e),this.staffEntries=[],this.comments=[],this.timestamp=n,this.staffEntries=new Array(i),this.parentMeasure=t}return _createClass2(e,[{key:"$get$",value:function(e){return this.staffEntries[e]}},{key:"$set$",value:function(e,t){this.staffEntries[e]=t}},{key:"Timestamp",get:function(){return this.timestamp},set:function(e){this.timestamp=e}},{key:"StaffEntries",get:function(){return this.staffEntries},set:function(e){this.staffEntries=e}},{key:"Comments",get:function(){return this.comments},set:function(e){this.comments=e}},{key:"ParentMeasure",get:function(){return this.parentMeasure},set:function(e){this.parentMeasure=e}},{key:"getAbsoluteTimestamp",value:function(){return Fraction$1.plus(this.timestamp,this.parentMeasure.AbsoluteTimestamp)}}]),e}(),SourceStaffEntry=function(){function e(t,n){_classCallCheck2(this,e),this.voiceEntries=[],this.instructions=[],this.chordSymbolContainers=[],this.verticalContainerParent=t,this.parentStaff=n}return _createClass2(e,[{key:"ParentStaff",get:function(){return this.parentStaff}},{key:"VerticalContainerParent",get:function(){return this.verticalContainerParent}},{key:"Timestamp",get:function(){if(this.VerticalContainerParent)return this.VerticalContainerParent.Timestamp}},{key:"AbsoluteTimestamp",get:function(){if(this.VerticalContainerParent)return Fraction$1.plus(this.VerticalContainerParent.ParentMeasure.AbsoluteTimestamp,this.VerticalContainerParent.Timestamp)}},{key:"VoiceEntries",get:function(){return this.voiceEntries},set:function(e){this.voiceEntries=e}},{key:"Link",get:function(){return this.staffEntryLink},set:function(e){this.staffEntryLink=e}},{key:"Instructions",get:function(){return this.instructions},set:function(e){this.instructions=e}},{key:"ChordContainers",get:function(){return this.chordSymbolContainers},set:function(e){this.chordSymbolContainers=e}},{key:"removeAllInstructionsOfTypeClefInstruction",value:function(){for(var e=0,t=0;e0)return!0}return!1}},{key:"hasTie",value:function(){for(var e=0,t=this.VoiceEntries.length;et.parentRepetition.StartIndex)return-1}if(e.alignment===AlignmentType.Begin&&t.alignment===AlignmentType.Begin){if(e.parentRepetition.EndIndext.parentRepetition.EndIndex)return-1}}return 0}}]),e}(),RepetitionInstruction=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:AlignmentType.End,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;_classCallCheck2(this,e),this.endingIndices=void 0,this.measureIndex=t,a&&(this.endingIndices=a.slice()),this.type=n,this.alignment=i,this.parentRepetition=r}return _createClass2(e,[{key:"CompareTo",value:function(e){var t=e;if(this.measureIndex>t.measureIndex)return 1;if(this.measureIndex1)return e[this.measureListIndex-1]}},{key:"Rules",get:function(){return this.rules}},{key:"VerticalMeasureList",get:function(){return this.verticalMeasureList},set:function(e){this.verticalMeasureList=e}},{key:"TempoInBPM",get:function(){return this.tempoInBPM},set:function(e){this.tempoInBPM=e}},{key:"findOrCreateStaffEntry",value:function(e,t,n){var i,r,a=void 0,s=_createForOfIteratorHelper(this.verticalSourceStaffEntryContainers);try{for(s.s();!(r=s.n()).done;){var o=r.value;if(o.Timestamp.Equals(e)){i=o;break}}}catch(err){s.e(err)}finally{s.f()}if(i)return i.StaffEntries[t]?a=i.StaffEntries[t]:(a=new SourceStaffEntry(i,n),i.StaffEntries[t]=a),{createdNewContainer:!1,staffEntry:a};var l=this.verticalSourceStaffEntryContainers[this.verticalSourceStaffEntryContainers.length-1];if(0===this.verticalSourceStaffEntryContainers.length||l.Timestamp.lt(e)){var u=new VerticalSourceStaffEntryContainer(this,e.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.push(u),a=new SourceStaffEntry(u,n),u.StaffEntries[t]=a}else for(var c=this.verticalSourceStaffEntryContainers.length-1;c>=0;c--){if(this.verticalSourceStaffEntryContainers[c].Timestamp.lt(e)){var h=new VerticalSourceStaffEntryContainer(this,e.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.splice(c+1,0,h),a=new SourceStaffEntry(h,n),h.StaffEntries[t]=a;break}if(0===c){var f=new VerticalSourceStaffEntryContainer(this,e.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.splice(c,0,f),a=new SourceStaffEntry(f,n),f.StaffEntries[t]=a;break}}return{createdNewContainer:!0,staffEntry:a}}},{key:"findOrCreateVoiceEntry",value:function(e,t){var n,i=void 0,r=!1,a=_createForOfIteratorHelper(e.VoiceEntries);try{for(a.s();!(n=a.n()).done;){var s=n.value;if(s.ParentVoice===t){i=s;break}}}catch(err){a.e(err)}finally{a.f()}return i||(i=new VoiceEntry(e.Timestamp,t,e),r=!0),{createdVoiceEntry:r,voiceEntry:i}}},{key:"getPreviousSourceStaffEntryFromIndex",value:function(e,t){for(var n=t-1;n>=0;n--)if(this.verticalSourceStaffEntryContainers[n][e])return this.verticalSourceStaffEntryContainers[n][e]}},{key:"getVerticalContainerIndexByTimestamp",value:function(e){for(var t=0,n=this.VerticalSourceStaffEntryContainers.length;t=0;u--){var c=this.verticalSourceStaffEntryContainers[u][s+o];if(void 0!==c&&c.hasTie()&&a.lt(Fraction$1.plus(c.Timestamp,c.calculateMaxNoteLength()))){a=Fraction$1.plus(c.Timestamp,c.calculateMaxNoteLength());break}}}i.push(a)}for(var h=0,f=i.length;h0)return!0}return!1}},{key:"beginsWithLineRepetition",value:function(){for(var e=0,t=this.FirstRepetitionInstructions.length;e=0&&!(t=this.verticalSourceStaffEntryContainers[n].StaffEntries[e]);n--);return t}},{key:"canBeReducedToMultiRest",value:function(){var e,t,n,i,r,a,s,o,l,u=!0,c=!1,h=_createForOfIteratorHelper(this.verticalSourceStaffEntryContainers);try{for(h.s();!(l=h.n()).done;){var f=l.value;if(f){var d,p=_createForOfIteratorHelper(f.StaffEntries);try{for(p.s();!(d=p.n()).done;){var m=d.value;if(m&&m.ParentStaff.ParentInstrument.Visible){if(m.ChordContainers.length>0)return!1;if(m.ParentStaff.hasLyrics&&(c=!0),this.firstRepetitionInstructions.length>0||this.lastRepetitionInstructions.length>0)return!1;var v,g=_createForOfIteratorHelper(m.VoiceEntries);try{for(g.s();!(v=g.n()).done;){var y,b=_createForOfIteratorHelper(v.value.Notes);try{for(b.s();!(y=b.n()).done;){if(!y.value.isRest()){u=!1;break}}}catch(err){b.e(err)}finally{b.f()}if(!u)break}}catch(err){g.e(err)}finally{g.f()}}}}catch(err){p.e(err)}finally{p.f()}}}}catch(err){h.e(err)}finally{h.f()}if(!u||c||this.hasMoodExpressions||this.tempoExpressions.length>0)return!1;var _,S=_createForOfIteratorHelper(this.staffLinkedExpressions);try{for(S.s();!(_=S.n()).done;){if(_.value.length>0)return!1}}catch(err){S.e(err)}finally{S.f()}var x,w=_createForOfIteratorHelper(this.lastInstructionsStaffEntries);try{for(w.s();!(x=w.n()).done;)for(var k=x.value,E=0,T=null==k?void 0:k.Instructions.length;E1&&void 0!==arguments[1]&&arguments[1];_classCallCheck2(this,e),this.PlacementFromXml=!1,this.notes=[],this.fractions=[],this.tupletLabelNumber=t,this.bracket=n}return _createClass2(e,[{key:"TupletLabelNumber",get:function(){return this.tupletLabelNumber},set:function(e){this.tupletLabelNumber=e}},{key:"Notes",get:function(){return this.notes},set:function(e){this.notes=e}},{key:"Fractions",get:function(){return this.fractions},set:function(e){this.fractions=e}},{key:"Bracket",get:function(){return this.bracket},set:function(e){this.bracket=e}},{key:"getNoteIndex",value:function(e){for(var t=this.notes.length-1;t>=0;t--)for(var n=0;n0)return this.Notes[0].Length},set:function(e){var t,n=_createForOfIteratorHelper(this.Notes);try{for(n.s();!(t=n.n()).done;){t.value.Length=e}}catch(err){n.e(err)}finally{n.f()}}},{key:"HasNotes",get:function(){return this.Notes.length>0}}]),e}(),VoiceEntry=function(){function e(t,n,i){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(_classCallCheck2(this,e),this.notes=[],this.graceVoiceEntriesBefore=[],this.graceVoiceEntriesAfter=[],this.articulations=[],this.playbackEntries=[],this.technicalInstructions=[],this.lyricsEntries=new Dictionary,this.wantedStemDirection=StemDirectionType.Undefined,this.stemDirectionXml=StemDirectionType.Undefined,this.stemDirection=StemDirectionType.Undefined,this.timestamp=t,this.parentVoice=n,this.parentSourceStaffEntry=i,this.isGrace=a,this.graceAfterMainNote=!1,this.graceNoteSlash=s,this.graceSlur=o,a||n.VoiceEntries.push(this),r&&void 0!==i){var l=i.VoiceEntries;-1===l.indexOf(this)&&l.push(this)}this.mainPlaybackEntry=new PlaybackEntry(this),this.PlaybackEntries.push(this.mainPlaybackEntry)}return _createClass2(e,[{key:"ParentSourceStaffEntry",get:function(){return this.parentSourceStaffEntry}},{key:"ParentVoice",get:function(){return this.parentVoice}},{key:"Timestamp",get:function(){return this.timestamp},set:function(e){this.timestamp=e}},{key:"Notes",get:function(){return this.notes}},{key:"addNote",value:function(e){this.notes.push(e),e.isRest()||void 0!==e.NoteTie&&e.NoteTie.StartNote!==e||this.MainPlaybackEntry.Notes.push(new PlaybackNote(this.MainPlaybackEntry,e))}},{key:"GraceVoiceEntriesBefore",get:function(){return this.graceVoiceEntriesBefore},set:function(e){this.graceVoiceEntriesBefore=e;var t,n=_createForOfIteratorHelper(this.graceVoiceEntriesBefore);try{for(n.s();!(t=n.n()).done;){t.value.parentSourceStaffEntry=this.ParentSourceStaffEntry}}catch(err){n.e(err)}finally{n.f()}}},{key:"GraceVoiceEntriesAfter",get:function(){return this.graceVoiceEntriesAfter},set:function(e){this.graceVoiceEntriesAfter=e;var t,n=_createForOfIteratorHelper(this.graceVoiceEntriesAfter);try{for(n.s();!(t=n.n()).done;){t.value.parentSourceStaffEntry=this.ParentSourceStaffEntry}}catch(err){n.e(err)}finally{n.f()}}},{key:"IsGrace",get:function(){return this.isGrace},set:function(e){this.isGrace=e}},{key:"GraceAfterMainNote",get:function(){return this.graceAfterMainNote},set:function(e){this.graceAfterMainNote=e}},{key:"GraceNoteSlash",get:function(){return this.graceNoteSlash},set:function(e){this.graceNoteSlash=e}},{key:"GraceSlur",get:function(){return this.graceSlur},set:function(e){this.graceSlur=e}},{key:"Articulations",get:function(){return this.articulations}},{key:"PlaybackEntries",get:function(){return this.playbackEntries}},{key:"Fermata",get:function(){return this.fermata}},{key:"MainPlaybackEntry",get:function(){return this.mainPlaybackEntry},set:function(e){this.mainPlaybackEntry=e}},{key:"removeMainPlaybackEntry",value:function(){void 0!==this.mainPlaybackEntry&&this.removePlaybackEntry(this.mainPlaybackEntry)}},{key:"removePlaybackEntry",value:function(e){this.mainPlaybackEntry===e&&(this.mainPlaybackEntry=void 0);var t=this.playbackEntries.indexOf(e);t>-1&&this.playbackEntries.splice(t,1)}},{key:"TechnicalInstructions",get:function(){return this.technicalInstructions}},{key:"LyricsEntries",get:function(){return this.lyricsEntries}},{key:"Arpeggio",get:function(){return this.arpeggio},set:function(e){this.arpeggio=e}},{key:"OrnamentContainer",get:function(){return this.ornamentContainer},set:function(e){this.ornamentContainer=e}},{key:"WantedStemDirection",get:function(){return this.wantedStemDirection},set:function(e){this.wantedStemDirection=e}},{key:"StemDirectionXml",get:function(){return this.stemDirectionXml},set:function(e){this.stemDirectionXml=e}},{key:"StemDirection",get:function(){return this.stemDirection},set:function(e){this.stemDirection=e}},{key:"StemColorXml",get:function(){return this.stemColorXml},set:function(e){this.stemColorXml=e}},{key:"StemColor",get:function(){return this.stemColor},set:function(e){this.stemColor=e}},{key:"VolumeModifier",get:function(){return this.volumeModifier},set:function(e){this.volumeModifier=e}},{key:"DurationModifier",get:function(){return this.durationModifier},set:function(e){this.durationModifier=e}},{key:"hasArticulation",value:function(e){var t,n=_createForOfIteratorHelper(this.articulations);try{for(n.s();!(t=n.n()).done;){if(t.value.Equals(e))return!0}}catch(err){n.e(err)}finally{n.f()}return!1}},{key:"hasTie",value:function(){for(var e=0,t=this.Notes.length;e0)return!0}return!1}},{key:"isStaccato",value:function(){var e,t=_createForOfIteratorHelper(this.Articulations);try{for(t.s();!(e=t.n()).done;){if(e.value.articulationEnum===ArticulationEnum.staccato)return!0}}catch(err){t.e(err)}finally{t.f()}return!1}},{key:"isAccent",value:function(){var e,t=_createForOfIteratorHelper(this.Articulations);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(n.articulationEnum===ArticulationEnum.accent||n.articulationEnum===ArticulationEnum.strongaccent)return!0}}catch(err){t.e(err)}finally{t.f()}return!1}},{key:"getVerseNumberForLyricEntry",value:function(e){var t=1;return this.lyricsEntries.forEach((function(n,i){e===i&&(t=n)})),t}}],[{key:"isSupportedArticulation",value:function(e){switch(e){case ArticulationEnum.accent:case ArticulationEnum.strongaccent:case ArticulationEnum.invertedstrongaccent:case ArticulationEnum.staccato:case ArticulationEnum.staccatissimo:case ArticulationEnum.spiccato:case ArticulationEnum.tenuto:case ArticulationEnum.fermata:case ArticulationEnum.invertedfermata:case ArticulationEnum.breathmark:case ArticulationEnum.caesura:case ArticulationEnum.lefthandpizzicato:case ArticulationEnum.naturalharmonic:case ArticulationEnum.snappizzicato:case ArticulationEnum.upbow:case ArticulationEnum.downbow:case ArticulationEnum.bend:case ArticulationEnum.detachedlegato:return!0;default:return!1}}}]),e}(),ArticulationEnum=function(e){return e[e.accent=0]="accent",e[e.strongaccent=1]="strongaccent",e[e.marcatoup=2]="marcatoup",e[e.marcatodown=3]="marcatodown",e[e.invertedstrongaccent=4]="invertedstrongaccent",e[e.staccato=5]="staccato",e[e.staccatissimo=6]="staccatissimo",e[e.spiccato=7]="spiccato",e[e.tenuto=8]="tenuto",e[e.fermata=9]="fermata",e[e.invertedfermata=10]="invertedfermata",e[e.breathmark=11]="breathmark",e[e.caesura=12]="caesura",e[e.lefthandpizzicato=13]="lefthandpizzicato",e[e.naturalharmonic=14]="naturalharmonic",e[e.snappizzicato=15]="snappizzicato",e[e.upbow=16]="upbow",e[e.downbow=17]="downbow",e[e.scoop=18]="scoop",e[e.plop=19]="plop",e[e.doit=20]="doit",e[e.falloff=21]="falloff",e[e.stress=22]="stress",e[e.unstress=23]="unstress",e[e.detachedlegato=24]="detachedlegato",e[e.otherarticulation=25]="otherarticulation",e[e.bend=26]="bend",e}(ArticulationEnum||{}),StemDirectionType=function(e){return e[e.Undefined=-1]="Undefined",e[e.Up=0]="Up",e[e.Down=1]="Down",e[e.None=2]="None",e[e.Double=3]="Double",e}(StemDirectionType||{}),SystemLinePosition=function(e){return e[e.MeasureBegin=0]="MeasureBegin",e[e.MeasureEnd=1]="MeasureEnd",e}(SystemLinePosition||{}),GraphicalLabel=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i,r,a){var s,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;return _classCallCheck2(this,n),(s=t.call(this)).label=e,s.boundingBox=new BoundingBox$2(_assertThisInitialized2(s),o),s.label.fontHeight=i,s.label.textAlignment=r,s.rules=a,s.rules.MpatMode&&"TRIO"===s.label.text&&(s.label.fontFamily="Arial"),s}return _createClass2(n,[{key:"Label",get:function(){return this.label}},{key:"toString",value:function(){return"".concat(this.label.text," (").concat(this.boundingBox.RelativePosition.x,",").concat(this.boundingBox.RelativePosition.y,")")}},{key:"setLabelPositionAndShapeBorders",value:function(){var e,t;if(""!==this.Label.text.trim()){this.TextLines=[];for(var n=null!==(e=null===(t=this.rules)||void 0===t?void 0:t.LabelMarginBorderFactor)&&void 0!==e?e:.1,i=this.Label.text.split(/[\n\r]+/g),r=i.length,a=0,s=0;s0&&this.TextLines.length>1&&(p+=this.rules.SpacingBetweenTextLines*r/10);var m=this.PositionAndShape;switch(this.Label.textAlignment){case TextAlignmentEnum.CenterBottom:m.BorderTop=-p,m.BorderLeft=-a/2,m.BorderBottom=0,m.BorderRight=a/2;break;case TextAlignmentEnum.CenterCenter:m.BorderTop=-p/2,m.BorderLeft=-a/2,m.BorderBottom=p/2,m.BorderRight=a/2;break;case TextAlignmentEnum.CenterTop:m.BorderTop=0,m.BorderLeft=-a/2,m.BorderBottom=p,m.BorderRight=a/2;break;case TextAlignmentEnum.LeftBottom:m.BorderTop=-p,m.BorderLeft=0,m.BorderBottom=0,m.BorderRight=a;break;case TextAlignmentEnum.LeftCenter:m.BorderTop=-p/2,m.BorderLeft=0,m.BorderBottom=p/2,m.BorderRight=a;break;case TextAlignmentEnum.LeftTop:m.BorderTop=0,m.BorderLeft=0,m.BorderBottom=p,m.BorderRight=a;break;case TextAlignmentEnum.RightBottom:m.BorderTop=-p,m.BorderLeft=-a,m.BorderBottom=0,m.BorderRight=0;break;case TextAlignmentEnum.RightCenter:m.BorderTop=-p/2,m.BorderLeft=-a,m.BorderBottom=p/2,m.BorderRight=0;break;case TextAlignmentEnum.RightTop:m.BorderTop=0,m.BorderLeft=-a,m.BorderBottom=p,m.BorderRight=0}m.BorderMarginTop=m.BorderTop-p*n,m.BorderMarginLeft=m.BorderLeft-p*n,m.BorderMarginBottom=m.BorderBottom+p*n,m.BorderMarginRight=m.BorderRight+p*n}}}]),n}(Clickable),Label=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:TextAlignmentEnum.CenterBottom,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];_classCallCheck2(this,e),this.IsCreditLabel=!1,this.text=t,this.print=r,this.textAlignment=n,this.font=i,this.fontFamily=void 0}return _createClass2(e,[{key:"font",get:function(){return this.fontEnumValue},set:function(e){this.fontEnumValue=e,this.fontFamily=FontStringNames[e]}},{key:"ToString",value:function(){return this.text}}]),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},SpecialMarks=["纯律","纯律结束"],HideWords=["跳过下一个","b","#","§","º","X"],GradientWords=["poco rit.","rall.","rit.","accel.","molto rit.","molto rall","lentando","poco accel.","calando"],GRADIENT_SPEED_CLOSE_TAG="结束范围速度",GRADIENT_SPEED_RESET_TAG="a tempo",SpecialWords=[GRADIENT_SPEED_CLOSE_TAG],SpeedKeyword="速度 ",SpeedHiddenKeyword="仅文本速度 ";function isSpeedKeyword(e){return 0===e.indexOf(SpeedKeyword)}function isSpeedHiddenKeyword(e){return 0===e.indexOf(SpeedHiddenKeyword)}function formatSpeedKeyword(e){return e.replace(SpeedHiddenKeyword,"").replace(SpeedKeyword,"")}function isGradientWords(e){return GradientWords.includes(e)}function isSpecialMark(e){return[].concat(_toConsumableArray2(Object.keys(SpeedTag)),SpecialMarks,SpecialWords,HideWords).map((function(e){return e.trim().toLocaleUpperCase()})).includes(e.toLocaleUpperCase().trim())}function isTopFont(e){return[TextAlignmentEnum.CenterTop,TextAlignmentEnum.RightTop].includes(e)}var MusicSymbol=function(e){return e[e.Unused_first_Symbol=0]="Unused_first_Symbol",e[e.BLACK_HEAD=1]="BLACK_HEAD",e[e.UPWARDS_TAIL=2]="UPWARDS_TAIL",e[e.DOWNWARDS_TAIL=3]="DOWNWARDS_TAIL",e[e.UPWARDS_DOUBLE_TAIL=4]="UPWARDS_DOUBLE_TAIL",e[e.DOWNWARDS_DOUBLE_TAIL=5]="DOWNWARDS_DOUBLE_TAIL",e[e.UPWARDS_TRIPLE_TAIL=6]="UPWARDS_TRIPLE_TAIL",e[e.DOWNWARDS_TRIPLE_TAIL=7]="DOWNWARDS_TRIPLE_TAIL",e[e.UPWARDS_QUAD_TAIL=8]="UPWARDS_QUAD_TAIL",e[e.DOWNWARDS_QUAD_TAIL=9]="DOWNWARDS_QUAD_TAIL",e[e.ROUND_HEAD=10]="ROUND_HEAD",e[e.WHITE_HEAD=11]="WHITE_HEAD",e[e.G_CLEF=12]="G_CLEF",e[e.F_CLEF=13]="F_CLEF",e[e.C_CLEF=14]="C_CLEF",e[e.BREVE=15]="BREVE",e[e.BREVE_REST=16]="BREVE_REST",e[e.COMMON_TIME=17]="COMMON_TIME",e[e.CUT_TIME=18]="CUT_TIME",e[e.WHOLE_REST=19]="WHOLE_REST",e[e.HALF_REST=20]="HALF_REST",e[e.QUARTER_REST=21]="QUARTER_REST",e[e.EIGHTH_REST=22]="EIGHTH_REST",e[e.SIXTEENTH_REST=23]="SIXTEENTH_REST",e[e.THIRTYSECOND_REST=24]="THIRTYSECOND_REST",e[e.SIXTYFOURTH_REST=25]="SIXTYFOURTH_REST",e[e.FLAT=26]="FLAT",e[e.SHARP=27]="SHARP",e[e.NATURAL=28]="NATURAL",e[e.DOUBLE_FLAT=29]="DOUBLE_FLAT",e[e.DOUBLE_SHARP=30]="DOUBLE_SHARP",e[e.ZERO=31]="ZERO",e[e.ONE=32]="ONE",e[e.TWO=33]="TWO",e[e.THREE=34]="THREE",e[e.FOUR=35]="FOUR",e[e.FIVE=36]="FIVE",e[e.SIX=37]="SIX",e[e.SEVEN=38]="SEVEN",e[e.EIGHT=39]="EIGHT",e[e.NINE=40]="NINE",e[e.DOT=41]="DOT",e[e.FERMATA=42]="FERMATA",e[e.INVERTED_FERMATA=43]="INVERTED_FERMATA",e[e.SPICCATO=44]="SPICCATO",e[e.TENUTO=45]="TENUTO",e[e.MARCATO=46]="MARCATO",e[e.MARCATISSIMO=47]="MARCATISSIMO",e[e.INVERTED_MARCATISSIMO=48]="INVERTED_MARCATISSIMO",e[e.P=49]="P",e[e.F=50]="F",e[e.S=51]="S",e[e.Z=52]="Z",e[e.M=53]="M",e[e.R=54]="R",e[e.SEGNO=55]="SEGNO",e[e.CODA=56]="CODA",e[e.DRUM_CLEF=57]="DRUM_CLEF",e[e.G_CLEF_SUB8=58]="G_CLEF_SUB8",e[e.G_CLEF_SUPER8=59]="G_CLEF_SUPER8",e[e.G_CLEF_SUB15=60]="G_CLEF_SUB15",e[e.G_CLEF_SUPER15=61]="G_CLEF_SUPER15",e[e.F_CLEF_SUB8=62]="F_CLEF_SUB8",e[e.F_CLEF_SUPER8=63]="F_CLEF_SUPER8",e[e.F_CLEF_SUB15=64]="F_CLEF_SUB15",e[e.F_CLEF_SUPER15=65]="F_CLEF_SUPER15",e[e.DOWN_BOW=66]="DOWN_BOW",e[e.MORDENT=67]="MORDENT",e[e.INVERTED_MORDENT=68]="INVERTED_MORDENT",e[e.TURN=69]="TURN",e[e.INVERTED_TURN=70]="INVERTED_TURN",e[e.LEFTHAND_PIZZICATO=71]="LEFTHAND_PIZZICATO",e[e.RELEASE_PED=72]="RELEASE_PED",e[e.ENGAGE_PED=73]="ENGAGE_PED",e[e.VA8=74]="VA8",e[e.VB8=75]="VB8",e[e.TRILL=76]="TRILL",e[e.MA15=77]="MA15",e[e.MB15=78]="MB15",e[e.HIGH=79]="HIGH",e[e.PLAY=80]="PLAY",e[e.MIC=81]="MIC",e[e.SNAP_PIZZICATO=82]="SNAP_PIZZICATO",e[e.NATURAL_HARMONIC=83]="NATURAL_HARMONIC",e[e.EditPen=84]="EditPen",e[e.PEDAL_BRACKET=85]="PEDAL_BRACKET",e[e.PEDAL_MIXED=86]="PEDAL_MIXED",e[e.PEDAL_SYMBOL=87]="PEDAL_SYMBOL",e}(MusicSymbol||{}),MusicSymbolDrawingStyle=function(e){return e[e.Normal=0]="Normal",e[e.Disabled=1]="Disabled",e[e.Selected=2]="Selected",e[e.Clickable=3]="Clickable",e[e.PlaybackSymbols=4]="PlaybackSymbols",e[e.FollowSymbols=5]="FollowSymbols",e[e.QFeedbackNotFound=6]="QFeedbackNotFound",e[e.QFeedbackOk=7]="QFeedbackOk",e[e.QFeedbackPerfect=8]="QFeedbackPerfect",e[e.Debug1=9]="Debug1",e[e.Debug2=10]="Debug2",e[e.Debug3=11]="Debug3",e}(MusicSymbolDrawingStyle||{}),PhonicScoreModes=function(e){return e[e.Following=0]="Following",e[e.Midi=1]="Midi",e[e.Manual=2]="Manual",e}(PhonicScoreModes||{}),LabelRenderSpecs=_createClass2((function e(){_classCallCheck2(this,e)})),MusicSheetDrawer=function(){function e(t,n){_classCallCheck2(this,e),this.drawableBoundingBoxElement="None",this.skyLineVisible=!1,this.bottomLineVisible=!1,this.phonicScoreMode=PhonicScoreModes.Manual,this.textMeasurer=t,this.splitScreenLineColor=-1,this.drawingParameters=n,this.rules=n.Rules}return _createClass2(e,[{key:"Mode",set:function(e){this.phonicScoreMode=e}},{key:"drawSheet",value:function(e){if(this.graphicalMusicSheet=e,this.rules=e.ParentMusicSheet.Rules,this.drawSplitScreenLine(),this.drawingParameters.drawCursors){var t,n=_createForOfIteratorHelper(e.Cursors);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i){var r=new BoundingBox$2(i);r.AbsolutePosition=i.Start,r.BorderBottom=i.End.y-i.Start.y,r.BorderRight=i.Width/2,r.BorderLeft=-i.Width/2,this.isVisible(r)&&this.drawLineAsVerticalRectangle(i,GraphicalLayers.Cursor)}}}catch(err){n.e(err)}finally{n.f()}}this.drawingParameters.drawScrollIndicator&&this.drawScrollIndicator();for(var a=Math.min(this.graphicalMusicSheet.MusicPages.length,this.rules.MaxPageToDrawNumber),s=0;s0&&(isTopFont(e.Label.textAlignment)||[TextAlignmentEnum.CenterBottom].includes(e.Label.textAlignment))){var d,p=-1,m=!1,v=_createForOfIteratorHelper((null==u?void 0:u.AbstractExpressions)||[]);try{for(v.s();!(d=v.n()).done;){var g,y,b=d.value;if(b.Label===e)p=null==b||null===(y=b.parentMeasure)||void 0===y?void 0:y.measureListIndex;else null!==(g=b.expression)&&void 0!==g&&g.TempoInBpm&&(m=b.expression.TempoInBpm>0);if(m&&p>-1){o.ScreenPosition.y-=40;break}}}catch(err){v.e(err)}finally{v.f()}}"jianpu"===this.rules.DYMusicScoreType?isNaN(parseInt(e.Label.text,10))&&this.renderLabel(e,t,o):this.renderLabel(e,t,o)}}}},{key:"calculateLabel",value:function(e){var t=new LabelRenderSpecs,n=e.Label,i=new BoundingBox$2(this);i.AbsolutePosition.x=e.PositionAndShape.AbsolutePosition.x,i.AbsolutePosition.y=e.PositionAndShape.AbsolutePosition.y||e.PositionAndShape.Parent.AbsolutePosition.y,t.ScreenPosition=this.applyScreenTransformation(i.AbsolutePosition),t.FontHeightInPixel=this.calculatePixelDistance(n.fontHeight);var r=this.calculatePixelDistance(e.PositionAndShape.Size.width);switch(t.BitmapWidth=Math.ceil(r),t.BitmapHeight=e.TextLines?Math.ceil(t.FontHeightInPixel*(.2+e.TextLines.length)):10,n.textAlignment){case TextAlignmentEnum.LeftTop:t.ScreenPosition.x-=t.BitmapWidth/2,t.ScreenPosition.y+=1.5*t.BitmapHeight;break;case TextAlignmentEnum.LeftCenter:t.ScreenPosition.y-=t.BitmapHeight/2;break;case TextAlignmentEnum.LeftBottom:t.ScreenPosition.y-=t.BitmapHeight;break;case TextAlignmentEnum.CenterTop:t.ScreenPosition.x-=t.BitmapWidth/2;break;case TextAlignmentEnum.CenterCenter:t.ScreenPosition.x-=t.BitmapWidth/2,t.ScreenPosition.y-=t.BitmapHeight/2;break;case TextAlignmentEnum.CenterBottom:t.ScreenPosition.x-=t.BitmapWidth/2,t.ScreenPosition.y-=t.BitmapHeight;break;case TextAlignmentEnum.RightTop:t.ScreenPosition.x-=t.BitmapWidth;break;case TextAlignmentEnum.RightCenter:t.ScreenPosition.x-=t.BitmapWidth,t.ScreenPosition.y-=t.BitmapHeight/2;break;case TextAlignmentEnum.RightBottom:t.ScreenPosition.x-=t.BitmapWidth,t.ScreenPosition.y-=t.BitmapHeight;break;default:throw new ArgumentOutOfRangeException("")}return t}},{key:"applyScreenTransformations",value:function(e){var t,n=[],i=_createForOfIteratorHelper(e);try{for(i.s();!(t=i.n()).done;){var r=t.value;n.push(this.applyScreenTransformation(r))}}catch(err){i.e(err)}finally{i.f()}return n}},{key:"drawSplitScreenLine",value:function(){}},{key:"renderRectangle",value:function(e,t,n){throw new Error("not implemented")}},{key:"drawScrollIndicator",value:function(){}},{key:"drawSelectionStartSymbol",value:function(e){}},{key:"drawSelectionEndSymbol",value:function(e){}},{key:"renderLabel",value:function(e,t,n){throw new Error("not implemented")}},{key:"renderSystemToScreen",value:function(e,t,n){}},{key:"drawSkyLine",value:function(e){}},{key:"drawBottomLine",value:function(e){}},{key:"drawInstrumentBrace",value:function(e,t){}},{key:"drawGroupBracket",value:function(e,t){}},{key:"isVisible",value:function(e){return!0}},{key:"drawMusicSystem",value:function(e){var t=this.getSystemAbsBoundingRect(e),n=this.getSytemBoundingBoxInPixels(t);this.drawMusicSystemComponents(e,n,t)}},{key:"getSytemBoundingBoxInPixels",value:function(e){var t=this.applyScreenTransformationForRect(e);return t.x=Math.round(t.x),t.y=Math.round(t.y),t}},{key:"getSystemAbsBoundingRect",value:function(e){var t=e.PositionAndShape.BoundingRectangle;return new RectangleF2D(e.PositionAndShape.AbsolutePosition.x+e.PositionAndShape.BorderLeft-1,e.PositionAndShape.AbsolutePosition.y+e.PositionAndShape.BorderTop-1,t.width+6,t.height+2)}},{key:"drawMusicSystemComponents",value:function(e,t,n){var i=this.graphicalMusicSheet.SelectionStartSymbol,r=this.graphicalMusicSheet.SelectionEndSymbol;this.drawingParameters.drawSelectionStartSymbol&&void 0!==i&&this.isVisible(i.PositionAndShape)&&this.drawSelectionStartSymbol(i),this.drawingParameters.drawSelectionEndSymbol&&void 0!==r&&this.isVisible(r.PositionAndShape)&&this.drawSelectionEndSymbol(r);var a,s=_createForOfIteratorHelper(e.StaffLines);try{for(s.s();!(a=s.n()).done;){var o=a.value;this.drawStaffLine(o),this.rules.RenderLyrics&&(o.LyricsDashes.length>0&&this.drawDashes(o.LyricsDashes),o.LyricLines.length>0&&this.drawLyricLines(o.LyricLines,o))}}catch(err){s.e(err)}finally{s.f()}var l,u=_createForOfIteratorHelper(e.SystemLines);try{for(u.s();!(l=u.n()).done;){var c=l.value;this.drawSystemLineObject(c)}}catch(err){u.e(err)}finally{u.f()}if(e.Parent===e.Parent.Parent.MusicPages[0]){var h,f=_createForOfIteratorHelper(e.Labels);try{for(f.s();!(h=f.n()).done;){var d=h.value;d.SVGNode=this.drawLabel(d,GraphicalLayers.Notes)}}catch(err){f.e(err)}finally{f.f()}}var p,m=this.graphicalMusicSheet.ParentMusicSheet.Instruments,v=m.filter((function(e){return e.Visible})).length,g=_createForOfIteratorHelper(e.InstrumentBrackets);try{for(g.s();!(p=g.n()).done;){var y=p.value;this.drawInstrumentBrace(y,e)}}catch(err){g.e(err)}finally{g.f()}if(m.length>0)if(v>1){var b,_=_createForOfIteratorHelper(e.GroupBrackets);try{for(_.s();!(b=_.n()).done;){var S=b.value;this.drawGroupBracket(S,e)}}catch(err){_.e(err)}finally{_.f()}}else{var x,w=_createForOfIteratorHelper(e.GroupBrackets);try{for(w.s();!(x=w.n()).done;){x.value.Visible=!1}}catch(err){w.e(err)}finally{w.f()}}if(!this.leadSheet){var k,E=_createForOfIteratorHelper(e.MeasureNumberLabels);try{for(E.s();!(k=E.n()).done;){var T=k.value;T.SVGNode=this.drawLabel(T,GraphicalLayers.Notes)}}catch(err){E.e(err)}finally{E.f()}}var P,A=_createForOfIteratorHelper(e.StaffLines);try{for(A.s();!(P=A.n()).done;){var C=P.value;this.drawStaffLineSymbols(C)}}catch(err){A.e(err)}finally{A.f()}this.drawingParameters.drawMarkedAreas&&this.drawMarkedAreas(e)}},{key:"activateSystemRendering",value:function(e,t,n,i){return!0}},{key:"drawSystemLineObject",value:function(e){}},{key:"drawStaffLine",value:function(e){var t,n=_createForOfIteratorHelper(e.Measures);try{for(n.s();!(t=n.n()).done;){var i=t.value;this.drawMeasure(i)}}catch(err){n.e(err)}finally{n.f()}this.rules.RenderLyrics&&e.LyricsDashes.length>0&&this.drawDashes(e.LyricsDashes),this.drawOctaveShifts(e),this.drawPedals(e),this.drawWavyLines(e),this.drawExpressions(e),this.skyLineVisible&&this.drawSkyLine(e),this.bottomLineVisible&&this.drawBottomLine(e)}},{key:"drawLyricLines",value:function(e,t){var n=this;t.LyricLines.forEach((function(e){e.Start.y+=t.PositionAndShape.AbsolutePosition.y,e.End.y+=t.PositionAndShape.AbsolutePosition.y,e.Start.x+=t.PositionAndShape.AbsolutePosition.x,e.End.x+=t.PositionAndShape.AbsolutePosition.x,n.drawGraphicalLine(e,n.rules.LyricUnderscoreLineWidth)}))}},{key:"drawExpressions",value:function(e){}},{key:"drawGraphicalLine",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"black";return this.drawLine(e.Start,e.End,n,t)}},{key:"drawLine",value:function(e,t){}},{key:"drawDashes",value:function(e){var t=this;e.forEach((function(e){return e.SVGNode=t.drawLabel(e,GraphicalLayers.Notes)}))}},{key:"drawOctaveShifts",value:function(e){}},{key:"drawStaffLines",value:function(e){if(e.StaffLines)for(var t=e.PositionAndShape.AbsolutePosition,n=0;n<5;n++)this.drawLineAsHorizontalRectangleWithOffset(e.StaffLines[n],t,GraphicalLayers.Notes)}},{key:"drawSymbol",value:function(e,t,n){arguments.length>4&&void 0!==arguments[4]||GraphicalLayers.Notes}},{key:"leadSheet",get:function(){return this.graphicalMusicSheet.LeadSheet},set:function(e){this.graphicalMusicSheet.LeadSheet=e}},{key:"drawPage",value:function(e){if(this.isVisible(e.PositionAndShape)){var t,n=_createForOfIteratorHelper(e.MusicSystems);try{for(n.s();!(t=n.n()).done;){var i=t.value;this.isVisible(i.PositionAndShape)&&this.drawMusicSystem(i)}}catch(err){n.e(err)}finally{n.f()}if(e===e.Parent.MusicPages[0]){var r,a=_createForOfIteratorHelper(e.Labels);try{for(a.s();!(r=a.n()).done;){var s=r.value;s.SVGNode=this.drawLabel(s,GraphicalLayers.Notes)}}catch(err){a.e(err)}finally{a.f()}}this.drawableBoundingBoxElement&&this.drawBoundingBoxes(e.PositionAndShape,0,this.drawableBoundingBoxElement)}}},{key:"drawBoundingBoxes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all",r=e.DataObject.constructor.name,a=!1;"all"===i&&(a=!0),(a||r===i)&&this.drawBoundingBox(e,void 0,!0,r,n),n++,e.ChildElements.forEach((function(e){return t.drawBoundingBoxes(e,n,i)}))}},{key:"drawBoundingBox",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=new RectangleF2D(e.AbsolutePosition.x+e.BorderMarginLeft,e.AbsolutePosition.y+e.BorderMarginTop,e.BorderMarginRight-e.BorderMarginLeft,e.BorderMarginBottom-e.BorderMarginTop);n&&(this.drawLineAsHorizontalRectangle(new GraphicalLine(new PointF2D(e.AbsolutePosition.x-1,e.AbsolutePosition.y),new PointF2D(e.AbsolutePosition.x+1,e.AbsolutePosition.y),.1,OutlineAndFillStyleEnum.BaseWritingColor,t),r-1),this.drawLineAsVerticalRectangle(new GraphicalLine(new PointF2D(e.AbsolutePosition.x,e.AbsolutePosition.y-1),new PointF2D(e.AbsolutePosition.x,e.AbsolutePosition.y+1),.1,OutlineAndFillStyleEnum.BaseWritingColor,t),r-1)),a=this.applyScreenTransformationForRect(a);var s=this.renderRectangle(a,GraphicalLayers.Background,r,t,.5);if(i){var o=new Label(i),l=new LabelRenderSpecs;l.BitmapWidth=a.width,l.BitmapHeight=a.height,l.FontHeightInPixel=a.height,l.ScreenPosition=new PointF2D(a.x,a.y+12),this.renderLabel(new GraphicalLabel(o,.8,TextAlignmentEnum.CenterCenter,this.rules),r,l)}return s}},{key:"drawMarkedAreas",value:function(e){var t,n=_createForOfIteratorHelper(e.GraphicalMarkedAreas);try{for(n.s();!(t=n.n()).done;){var i=t.value;i&&(i.systemRectangle&&this.drawRectangle(i.systemRectangle,GraphicalLayers.Background),i.settings&&(i.settings.SVGNode=this.drawLabel(i.settings,GraphicalLayers.Comment)),i.labelRectangle&&this.drawRectangle(i.labelRectangle,GraphicalLayers.Background),i.label&&(i.label.SVGNode=this.drawLabel(i.label,GraphicalLayers.Comment)))}}catch(err){n.e(err)}finally{n.f()}}},{key:"drawStaffLineSymbols",value:function(e){var t=e.ParentStaff.ParentInstrument,n=e.PositionAndShape.AbsolutePosition.x,i=e.PositionAndShape.AbsolutePosition.y+2,r=e.PositionAndShape.BorderRight;t.highlight&&this.drawingParameters.drawHighlights&&this.drawLineAsHorizontalRectangle(new GraphicalLine(new PointF2D(n,i),new PointF2D(n+r,i),4,OutlineAndFillStyleEnum.Highlighted),GraphicalLayers.Highlight);var a=MusicSymbolDrawingStyle.Disabled,s=MusicSymbol.PLAY,o=this.drawingParameters.drawActivitySymbols;switch(this.phonicScoreMode){case PhonicScoreModes.Midi:s=MusicSymbol.PLAY,this.midiPlaybackAvailable&&e.ParentStaff.audible&&(a=MusicSymbolDrawingStyle.PlaybackSymbols);break;case PhonicScoreModes.Following:s=MusicSymbol.MIC,e.ParentStaff.following&&(a=MusicSymbolDrawingStyle.FollowSymbols);break;default:o=!1}if(o){var l=new PointF2D(n+r+2,i);this.drawSymbol(s,a,l)}if(this.drawingParameters.drawErrors){var u,c=_createForOfIteratorHelper(e.Measures);try{for(c.s();!(u=c.n()).done;){var h=u.value,f=h.PositionAndShape,d=f.AbsolutePosition.x,p=f.AbsolutePosition.y+2;h.hasError&&this.graphicalMusicSheet.ParentMusicSheet.DrawErroneousMeasures&&this.drawLineAsHorizontalRectangle(new GraphicalLine(new PointF2D(d,p),new PointF2D(d+f.BorderRight,p),4,OutlineAndFillStyleEnum.ErrorUnderlay),GraphicalLayers.MeasureError)}}catch(err){c.e(err)}finally{c.f()}}}}]),e}(),VexFlowTextMeasurer=function(){function e(t){_classCallCheck2(this,e),this.fontSize=20,this.fontSizeStandard=this.fontSize;var n=document.createElement("canvas");this.context=n.getContext("2d"),this.rules=t}return _createClass2(e,[{key:"computeTextWidthToHeightRatio",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.fontSize;return this.context.font=VexFlowConverter.font(r,n,t,this.rules,i),this.context.measureText(e).width/r}},{key:"setFontSize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.fontSizeStandard;return this.fontSize=e,e}}]),e}(),AbstractGraphicalExpression=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i,r){var a;return _classCallCheck2(this,n),(a=t.call(this)).expression=i,a.parentMeasure=r,a.boundingBox=new BoundingBox$2(_assertThisInitialized2(a),e.PositionAndShape),a.parentStaffLine=e,a.parentStaffLine.AbstractExpressions.push(_assertThisInitialized2(a)),a.rules=e.ParentMusicSystem.rules,a}return _createClass2(n,[{key:"Label",get:function(){return this.label}},{key:"ParentStaffLine",get:function(){return this.parentStaffLine}},{key:"SourceExpression",get:function(){return this.expression}},{key:"Placement",get:function(){return this.expression.Placement}}]),n}(GraphicalObject),GraphicalInstantaneousTempoExpression=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i){var r;return _classCallCheck2(this,n),(r=t.call(this,i.PositionAndShape.Parent.DataObject,e,e.parentMeasure)).label=i,r}return _createClass2(n,[{key:"GraphicalLabel",get:function(){return this.label}},{key:"updateSkyBottomLine",value:function(){}}]),n}(AbstractGraphicalExpression),GraphicalInstantaneousDynamicExpression=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i,r){var a;return _classCallCheck2(this,n),(a=t.call(this,i,e,r.parentSourceMeasure)).mInstantaneousDynamicExpression=e,a.mMeasure=r,a}return _createClass2(n,[{key:"updateSkyBottomLine",value:function(){var e=this.parentStaffLine.SkyBottomLineCalculator,t=this.PositionAndShape.RelativePosition.x+this.PositionAndShape.BorderMarginLeft,n=this.PositionAndShape.RelativePosition.x+this.PositionAndShape.BorderMarginRight,i=0;switch(this.Placement){case PlacementEnum.Above:i=this.PositionAndShape.RelativePosition.y+this.PositionAndShape.BorderMarginTop,e.updateSkyLineInRange(t,n,i);break;case PlacementEnum.Below:i=this.PositionAndShape.RelativePosition.y+this.PositionAndShape.BorderMarginBottom,e.updateBottomLineInRange(t,n,i);break;default:log$2.error("Placement for GraphicalInstantaneousDynamicExpression is unknown")}}}]),n}(AbstractGraphicalExpression),GraphicalContinuousDynamicExpression=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i,r){var a;return _classCallCheck2(this,n),(a=t.call(this,i,e,r)).lines=[],a.isSplittedPart=!1,a.notToBeRemoved=!1,a}return _createClass2(n,[{key:"StartMeasure",get:function(){return this.startMeasure},set:function(e){this.startMeasure=e}},{key:"EndMeasure",get:function(){return this.endMeasure},set:function(e){this.endMeasure=e}},{key:"EndStaffLine",get:function(){return this.endMeasure?this.endMeasure.ParentStaffLine:void 0}},{key:"IsSplittedPart",get:function(){return this.isSplittedPart},set:function(e){this.isSplittedPart=e}},{key:"IsVerbal",get:function(){return this.ContinuousDynamic.Label&&this.ContinuousDynamic.Label.length>0}},{key:"NotToBeRemoved",get:function(){return this.notToBeRemoved},set:function(e){this.notToBeRemoved=e}},{key:"Lines",get:function(){return this.lines}},{key:"ContinuousDynamic",get:function(){return this.SourceExpression}},{key:"updateSkyBottomLine",value:function(){var e,t=this.parentStaffLine.SkyBottomLineCalculator,n=this.IsVerbal?this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginLeft:0,i=this.IsVerbal?this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginRight:0;(!this.IsVerbal&&this.lines.length<2&&log$2.warn("Not enough lines for SkyBottomLine calculation"),this.IsVerbal)||this.ContinuousDynamic.DynamicType!==ContDynamicEnum.crescendo&&this.ContinuousDynamic.DynamicType!==ContDynamicEnum.diminuendo&&log$2.warn("GraphicalContinuousDynamicExpression.updateSkyBottomLine(): unhandled continuous dynamic type. start measure: "+(null===(e=this.startMeasure)||void 0===e?void 0:e.MeasureNumber));switch(this.Placement){case PlacementEnum.Above:if(this.IsVerbal){var r=this.label.PositionAndShape.BorderMarginTop+this.label.PositionAndShape.RelativePosition.y;t.updateSkyLineInRange(n,i,r)}else this.ContinuousDynamic.DynamicType===ContDynamicEnum.crescendo?t.updateSkyLineWithWedge(this.lines[0].Start,this.lines[0].End):this.ContinuousDynamic.DynamicType===ContDynamicEnum.diminuendo&&t.updateSkyLineWithWedge(this.lines[0].End,this.lines[0].Start);break;case PlacementEnum.Below:if(this.IsVerbal){var a=this.label.PositionAndShape.BorderMarginBottom+this.label.PositionAndShape.RelativePosition.y;t.updateBottomLineInRange(n,i,a)}else this.ContinuousDynamic.DynamicType===ContDynamicEnum.crescendo?t.updateBottomLineWithWedge(this.lines[1].Start,this.lines[1].End):this.ContinuousDynamic.DynamicType===ContDynamicEnum.diminuendo&&t.updateBottomLineWithWedge(this.lines[1].End,this.lines[1].Start);break;default:log$2.error("Placement for GraphicalContinuousDynamicExpression is unknown")}}},{key:"createCrescendoLines",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.rules.WedgeOpeningLength,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.rules.WedgeLineWidth,a=new PointF2D(e,n),s=new PointF2D(t,n-i/2),o=new PointF2D(t,n+i/2);this.addWedgeLines(a,s,o,r)}},{key:"createFirstHalfCrescendoLines",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.rules.WedgeMeasureEndOpeningLength,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.rules.WedgeLineWidth,a=new PointF2D(e,n),s=new PointF2D(t,n-i/2),o=new PointF2D(t,n+i/2);this.addWedgeLines(a,s,o,r)}},{key:"createSecondHalfCrescendoLines",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.rules.WedgeMeasureBeginOpeningLength,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.rules.WedgeOpeningLength,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:this.rules.WedgeLineWidth,s=new PointF2D(e,n-i/2),o=new PointF2D(e,n+i/2),l=new PointF2D(t,n-r/2),u=new PointF2D(t,n+r/2);this.addDoubleLines(s,l,o,u,a)}},{key:"recalculateCrescendoLines",value:function(e,t,n){var i=Math.abs(this.lines[0].Start.y-this.lines[1].Start.y)>1e-4;this.lines.clear(),i?this.createSecondHalfCrescendoLines(e,t,n):this.isSplittedPart?this.createFirstHalfCrescendoLines(e,t,n):this.createCrescendoLines(e,t,n)}},{key:"createDiminuendoLines",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.rules.WedgeOpeningLength,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.rules.WedgeLineWidth,a=new PointF2D(e,n-i/2),s=new PointF2D(e,n+i/2),o=new PointF2D(t,n);this.addWedgeLines(o,a,s,r)}},{key:"createFirstHalfDiminuendoLines",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.rules.WedgeOpeningLength,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.rules.WedgeMeasureEndOpeningLength,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:this.rules.WedgeLineWidth,s=new PointF2D(e,n-i/2),o=new PointF2D(e,n+i/2),l=new PointF2D(t,n-r/2),u=new PointF2D(t,n+r/2);this.addDoubleLines(s,l,o,u,a)}},{key:"createSecondHalfDiminuendoLines",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.rules.WedgeMeasureBeginOpeningLength,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.rules.WedgeLineWidth,a=new PointF2D(e,n-i/2),s=new PointF2D(e,n+i/2),o=new PointF2D(t,n);this.addWedgeLines(o,a,s,r)}},{key:"recalculateDiminuendoLines",value:function(e,t,n){var i=Math.abs(this.lines[0].End.y-this.lines[1].End.y)>1e-4;this.lines.clear(),i?this.createFirstHalfDiminuendoLines(e,t,n):this.isSplittedPart?this.createSecondHalfDiminuendoLines(e,t,n):this.createDiminuendoLines(e,t,n)}},{key:"calcPsi",value:function(){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===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))}},{key:"cleanUp",value:function(){this.lines.clear()}},{key:"shiftYPosition",value:function(e){this.IsVerbal?(this.PositionAndShape.RelativePosition.y+=e,this.PositionAndShape.calculateBoundingBox()):(this.lines[0].Start.y+=e,this.lines[0].End.y+=e,this.lines[1].End.y+=e)}},{key:"squeeze",value:function(e){this.IsVerbal||(Math.abs(this.lines[0].End.x-this.lines[0].Start.x)0?this.lines[0].Start.x+=e:(this.lines[0].End.x+=e,this.lines[1].End.x+=e):e<0?this.lines[0].Start.x+=e:(this.lines[0].End.x+=e,this.lines[1].End.x+=e),this.calcPsi()))}},{key:"addWedgeLines",value:function(e,t,n,i){var r=new GraphicalLine(e,t,i),a=new GraphicalLine(e,n,i);this.lines.push(r),this.lines.push(a)}},{key:"addDoubleLines",value:function(e,t,n,i,r){var a=new GraphicalLine(e,t,r),s=new GraphicalLine(n,i,r);this.lines.push(a),this.lines.push(s)}}]),n}(AbstractGraphicalExpression),GraphicalUnknownExpression=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i,r,a){var s,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;return _classCallCheck2(this,n),(s=t.call(this,e,new AbstractExpression(r),a)).label=i,s.sourceMultiExpression=o,s}return _createClass2(n,[{key:"updateSkyBottomLine",value:function(){var e=this.parentStaffLine.SkyBottomLineCalculator,t=this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginLeft,n=this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginRight;switch(this.Placement){case PlacementEnum.Above:var i=this.label.PositionAndShape.BorderMarginTop+this.label.PositionAndShape.RelativePosition.y;e.updateSkyLineInRange(t,n,i);break;case PlacementEnum.Below:var r=this.label.PositionAndShape.BorderMarginBottom+this.label.PositionAndShape.RelativePosition.y;e.updateBottomLineInRange(t,n,r);break;default:log$2.error("Placement for GraphicalUnknownExpression is unknown")}}}]),n}(AbstractGraphicalExpression);Vex.Flow;var unitInPixels=10,VexFlowMusicSheetDrawer=function(e){_inherits2(n,e);var t=_createSuper(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new DrawingParameters;return _classCallCheck2(this,n),(e=t.call(this,new VexFlowTextMeasurer(i.Rules),i)).backends=[],e.zoom=1,e.pageIdx=0,e.getDotId=function(e,t){return t?String(e.Label.PositionAndShape.RelativePosition[t]):String(e.Label.PositionAndShape.RelativePosition.x)+String(e.Label.PositionAndShape.RelativePosition.y)},e.hasDot=function(e,t,n,i){var r,a=_createForOfIteratorHelper(t||Object.values(i));try{for(a.s();!(r=a.n()).done;){var s=r.value;if(n)return e.x===s.x&&e.y===s.y;if(e.x===s.x)return!0}}catch(err){a.e(err)}finally{a.f()}return!1},e}return _createClass2(n,[{key:"Zoom",get:function(){return this.zoom}},{key:"Backends",get:function(){return this.backends}},{key:"initializeBackendForPage",value:function(e){this.backend=this.backends[e.PageNumber-1]}},{key:"drawSheet",value:function(e){var t,i,r;"gonville"===this.rules.DefaultVexFlowNoteFont&&(Vex.Flow.DEFAULT_FONT_STACK=[null===(t=Vex.Flow.Fonts)||void 0===t?void 0:t.Gonville,null===(i=Vex.Flow.Fonts)||void 0===i?void 0:i.Bravura,null===(r=Vex.Flow.Fonts)||void 0===r?void 0:r.Custom]);Vex.Flow.STAVE_LINE_THICKNESS=this.rules.StaffLineWidth*unitInPixels,Vex.Flow.STEM_WIDTH=this.rules.StemWidth*unitInPixels,Vex.Flow.DEFAULT_NOTATION_FONT_SCALE=this.rules.VexFlowDefaultNotationFontScale,Vex.Flow.DEFAULT_TAB_FONT_SCALE=this.rules.VexFlowDefaultTabFontScale,this.pageIdx=0;var a,s=_createForOfIteratorHelper(e.MusicPages);try{for(s.s();!(a=s.n()).done;){var o=a.value;if(o.PageNumber>this.rules.MaxPageToDrawNumber)break;var l=this.backends[this.pageIdx];l.graphicalMusicPage=o,l.scale(this.zoom),this.pageIdx+=1}}catch(err){s.e(err)}finally{s.f()}this.pageIdx=0,this.backend=this.backends[0],_get(_getPrototypeOf2(n.prototype),"drawSheet",this).call(this,e)}},{key:"drawPage",value:function(e){e&&(this.backend=this.backends[e.PageNumber-1],_get(_getPrototypeOf2(n.prototype),"drawPage",this).call(this,e),this.pageIdx+=1)}},{key:"clear",value:function(){var e,t=_createForOfIteratorHelper(this.backends);try{for(t.s();!(e=t.n()).done;){e.value.clear()}}catch(err){t.e(err)}finally{t.f()}}},{key:"setZoom",value:function(e){this.zoom=e}},{key:"calculatePixelDistance",value:function(e){return e*unitInPixels}},{key:"drawStaffLine",value:function(e){var t=this.backend.getContext().openGroup();t&&t.classList.add("staffline"),_get(_getPrototypeOf2(n.prototype),"drawStaffLine",this).call(this,e);var i=e.PositionAndShape.AbsolutePosition;this.rules.RenderSlurs&&this.drawSlurs(e,i),this.backend.getContext().closeGroup()}},{key:"drawSlurs",value:function(e,t){var n,i=_createForOfIteratorHelper(e.GraphicalSlurs);try{for(i.s();!(n=i.n()).done;){var r=n.value;r.slur.isCrossed()||this.drawSlur(r,t)}}catch(err){i.e(err)}finally{i.f()}}},{key:"drawSlur",value:function(e,t){var n,i,r,a,s=[];"jianpu"===this.rules.DYMusicScoreType?((e.placement>0||e.bezierStartPt.y>0)&&(e.bezierStartPt.y=-.8,e.bezierStartControlPt.y=-2.5),n=new PointF2D(e.bezierStartPt.x+t.x,e.bezierStartPt.y+t.y),i=new PointF2D(e.bezierStartControlPt.x+t.x,e.bezierStartControlPt.y+t.y),r=new PointF2D(e.bezierEndControlPt.x+t.x,e.bezierStartControlPt.y+t.y),a=new PointF2D(e.bezierEndPt.x+t.x,e.bezierStartPt.y+t.y)):(n=new PointF2D(e.bezierStartPt.x+t.x,e.bezierStartPt.y+t.y),i=new PointF2D(e.bezierStartControlPt.x+t.x,e.bezierStartControlPt.y+t.y),r=new PointF2D(e.bezierEndControlPt.x+t.x,e.bezierEndControlPt.y+t.y),a=new PointF2D(e.bezierEndPt.x+t.x,e.bezierEndPt.y+t.y)),s.push(this.applyScreenTransformation(n)),s.push(this.applyScreenTransformation(i)),s.push(this.applyScreenTransformation(r)),s.push(this.applyScreenTransformation(a)),e.placement===PlacementEnum.Above?(n.y-=.05,i.y-=.3,r.y-=.3,a.y-=.05):(n.y+=.05,i.y+=.3,r.y+=.3,a.y+=.05),s.push(this.applyScreenTransformation(n)),s.push(this.applyScreenTransformation(i)),s.push(this.applyScreenTransformation(r)),s.push(this.applyScreenTransformation(a)),e.SVGElement=this.backend.renderCurve(s)}},{key:"drawMeasure",value:function(e){e.setAbsoluteCoordinates(e.PositionAndShape.AbsolutePosition.x*unitInPixels,e.PositionAndShape.AbsolutePosition.y*unitInPixels);var t=this.backend.getContext();try{e.draw(t)}catch(a){log$2.warn("VexFlowMusicSheetDrawer.drawMeasure",a)}var n,i=_createForOfIteratorHelper(e.staffEntries);try{for(i.s();!(n=i.n()).done;){var r=n.value;this.drawStaffEntry(r)}}catch(err){i.e(err)}finally{i.f()}}},{key:"drawLine",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#FF0000FF",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.2;return e=this.applyScreenTransformation(e),t=this.applyScreenTransformation(t),this.backend.renderLine(e,t,n,i*unitInPixels)}},{key:"DrawOverlayLine",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#FF0000FF",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.2;if(!(!n.PageNumber||n.PageNumber>this.backends.length||n.PageNumber<1)){var a=n.PageNumber-1,s=this.backends[a];return e=this.applyScreenTransformation(e),t=this.applyScreenTransformation(t),s.renderLine(e,t,i,r*unitInPixels)}console.log("VexFlowMusicSheetDrawer.drawOverlayLine: invalid page number / music page number doesn't correspond to an existing backend.")}},{key:"drawSkyLine",value:function(e){var t=e.PositionAndShape.AbsolutePosition,n=e.PositionAndShape.Size.width;this.drawSampledLine(e.SkyLine,t,n)}},{key:"drawBottomLine",value:function(e){var t=new PointF2D(e.PositionAndShape.AbsolutePosition.x,e.PositionAndShape.AbsolutePosition.y),n=e.PositionAndShape.Size.width;this.drawSampledLine(e.BottomLine,t,n,"#0000FFFF")}},{key:"drawSampledLine",value:function(e,t,n){for(var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#FF0000FF",r=[],a=0,s=0;s0){var l,u,c=this.rules.SamplingUnit,h=new PointF2D(o.x,o.y),f=new PointF2D(r[0]/c+o.x,o.y);this.drawLine(h,f,i),e[0]>=0&&(l=new PointF2D(r[0]/c+o.x,o.y),u=new PointF2D(r[0]/c+o.x,o.y+e[r[0]]),this.drawLine(l,u,i));for(var d=1;d0){var t,n=_createForOfIteratorHelper(e.FingeringEntries);try{for(n.s();!(t=n.n()).done;){var i=t.value;i.SVGNode=this.drawLabel(i,GraphicalLayers.Notes)}}catch(err){n.e(err)}finally{n.f()}}if(void 0!==e.graphicalChordContainers&&e.graphicalChordContainers.length>0){var r,a=_createForOfIteratorHelper(e.graphicalChordContainers);try{for(a.s();!(r=a.n()).done;){var s=r.value.GraphicalLabel;s.SVGNode=this.drawLabel(s,GraphicalLayers.Notes)}}catch(err){a.e(err)}finally{a.f()}}this.rules.RenderLyrics&&e.LyricsEntries.length>0&&this.drawLyrics(e.LyricsEntries,GraphicalLayers.Notes)}},{key:"drawLyrics",value:function(e,t){var n=this;e.forEach((function(e){var i=e.GraphicalLabel;i.SVGNode=n.drawLabel(i,t)}))}},{key:"drawInstrumentBrace",value:function(e,t){e.draw(this.backend.getContext())}},{key:"drawGroupBracket",value:function(e,t){e.draw(this.backend.getContext())}},{key:"drawOctaveShifts",value:function(e){var t,n=_createForOfIteratorHelper(e.OctaveShifts);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i){var r=i,a=this.backend.getContext(),s=r.getTextBracket();s.setContext(a);try{s.draw()}catch(o){log$2.warn(o)}}}}catch(err){n.e(err)}finally{n.f()}}},{key:"drawPedals",value:function(e){var t,n=_createForOfIteratorHelper(e.Pedals);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i){var r=i,a=this.backend.getContext(),s=r.getPedalMarking();s.setContext(a),s.draw()}}}catch(err){n.e(err)}finally{n.f()}}},{key:"drawWavyLines",value:function(e){var t,n=_createForOfIteratorHelper(e.WavyLines);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i){var r=i,a=this.backend.getContext(),s=r.getVibratoBracket();s.setContext(a),s.draw()}}}catch(err){n.e(err)}finally{n.f()}}},{key:"getMaxExpressionsYAndDots",value:function(e){var t,n=[],i=0,r=_createForOfIteratorHelper(e.measures);try{for(r.s();!(t=r.n()).done;){var a=t.value;n.push(a.measureNumber)}}catch(err){r.e(err)}finally{r.f()}var s,o={},l={},u={},c=_createForOfIteratorHelper(e.AbstractExpressions);try{for(c.s();!(s=c.n()).done;){var h=s.value;if(h instanceof GraphicalUnknownExpression&&n.includes(h.parentMeasure.MeasureNumber)){var f=this.getDotId(h),d=this.getDotId(h,"x");l[f]||(l[f]=[]),u[d]||(u[d]=[]),this.hasDot(h.Label.PositionAndShape.RelativePosition,l[f],!0)||(l[f].push(h.Label.PositionAndShape.RelativePosition),u[d].push(h.Label.PositionAndShape.RelativePosition)),o[f]=h.Label.PositionAndShape.RelativePosition}}}catch(err){c.e(err)}finally{c.f()}var p,m=0,v=_createForOfIteratorHelper(e.AbstractExpressions);try{for(v.s();!(p=v.n()).done;){var g,y=p.value,b=null===(g=y.parentMeasure)||void 0===g?void 0:g.MeasureNumber;if(y instanceof GraphicalUnknownExpression&&n.includes(b)){var _,S=null===(_=y.parentMeasure.verticalMeasureList[0])||void 0===_?void 0:_.stave,x=(null==S?void 0:S.end_x)-(null==S?void 0:S.x),w=this.getDotId(y,"x");if(1===(u[w]||[]).length&&m!==b){var k=y.Label.PositionAndShape.AbsolutePosition.y;i=0===i?k:Math.min(i,k)}1!==(u[w]||[]).length&&x/101){var n=Math.min.apply(Math,_toConsumableArray2(e.Lines.map((function(e){return e.Start.x}))));e.Lines[0].Start.x=n,e.Lines[1].Start.x=n;var i=[e.Lines[1].Start.y,e.Lines[0].Start.y];e.Lines[0].Start.y=i[0],e.Lines[1].Start.y=i[1],e.Lines[0].End.y+=this.rules.WedgeOpeningLength/2,e.Lines[1].End.y+=this.rules.WedgeOpeningLength}}catch(c){}var r=this.backend.getContext();r.openGroup("lineGroup");var a,s=_createForOfIteratorHelper(e.Lines);try{for(s.s();!(a=s.n()).done;){var o=a.value,l=new PointF2D(e.ParentStaffLine.PositionAndShape.AbsolutePosition.x+o.Start.x,e.ParentStaffLine.PositionAndShape.AbsolutePosition.y+o.Start.y),u=new PointF2D(e.ParentStaffLine.PositionAndShape.AbsolutePosition.x+o.End.x,e.ParentStaffLine.PositionAndShape.AbsolutePosition.y+o.End.y);this.drawLine(l,u,"black",o.Width)}}catch(err){s.e(err)}finally{s.f()}r.closeGroup()}}},{key:"renderLabel",value:function(e,t,n){return this._renderLabel(e,n)}},{key:"_renderLabel",value:function(e,t){if(e.Label.print){var n,i=e.Label.fontHeight*unitInPixels,r=e.Label.font;this.rules.ColoringEnabled&&(n=e.Label.colorDefault,e.Label.color&&(n=e.Label.color.toString()),n||(n=this.rules.DefaultColorLabel));var a,s=e.Label,o=s.fontStyle,l=s.fontFamily;o||(o=this.rules.DefaultFontStyle),l||(l=this.rules.DefaultFontFamily);for(var u=0;u<(null===(c=e.TextLines)||void 0===c?void 0:c.length);u++){var c,h=e.TextLines[u],f=this.calculatePixelDistance(h.xOffset),d=new PointF2D(t.ScreenPosition.x+f,t.ScreenPosition.y),p=this.backend.renderText(i,o,r,h.text,t.FontHeightInPixel,d,n,e.Label.fontFamily);a?a.appendChild(p):a=p,t.ScreenPosition.y=t.ScreenPosition.y+t.FontHeightInPixel,e.TextLines.length>1&&(t.ScreenPosition.y+=this.rules.SpacingBetweenTextLines)}return a}}},{key:"renderRectangle",value:function(e,t,n,i,r){return this.backend.renderRectangle(e,n,i,r)}},{key:"applyScreenTransformation",value:function(e){return new PointF2D(e.x*unitInPixels,e.y*unitInPixels)}},{key:"applyScreenTransformationForRect",value:function(e){return new RectangleF2D(e.x*unitInPixels,e.y*unitInPixels,e.width*unitInPixels,e.height*unitInPixels)}}]),n}(MusicSheetDrawer),VF$c=Vex.Flow,_VexFlowConverter=function(){function e(){_classCallCheck2(this,e)}return _createClass2(e,null,[{key:"durations",value:function(e,t){for(var n=[],i=e.clone();i.RealValue>0;){var r=i.RealValue;if(r>=2)n.push("1/2"),i.Sub(new Fraction$1(2,1));else if(r>=1)n.push("w"),i.Sub(new Fraction$1(1,1));else if(r<1&&r>=.5){if(t&&r>.5)return["w"];n.push("h"),i.Sub(new Fraction$1(1,2))}else if(r<.5&&r>=.25){if(t&&r>.25)return["h"];n.push("q"),i.Sub(new Fraction$1(1,4))}else if(r<.25&&r>=.125){if(t&&r>.125)return["q"];n.push("8"),i.Sub(new Fraction$1(1,8))}else if(r<.125&&r>=.0625){if(t&&r>.0625)return["8"];n.push("16"),i.Sub(new Fraction$1(1,16))}else if(r<.0625&&r>=.03125){if(t&&r>.03125)return["16"];n.push("32"),i.Sub(new Fraction$1(1,32))}else if(r<.03125&&r>=.015625){if(t&&r>.015625)return["32"];n.push("64"),i.Sub(new Fraction$1(1,64))}else{if(t)return["64"];n.push("128"),i.Sub(new Fraction$1(1,128))}}return n}},{key:"pitch",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0,a=r;void 0===r&&(a=3),t&&void 0===r&&(a=0,n.ClefType===ClefEnum.F&&(a=2),n.ClefType===ClefEnum.C&&(a=2));var s=NoteEnum[e.FundamentalNote].toLowerCase(),o=Pitch.accidentalVexflow(e.Accidental),l=e.Octave-n.OctaveOffset+a,u="";return i&&(u=this.NoteHeadCode(i)),[s+"n/"+l+u,o,n]}},{key:"restToNotePitch",value:function(e,t){var n=e.Octave;switch(t){case ClefEnum.C:case ClefEnum.F:n+=2;case ClefEnum.G:}return new Pitch(e.FundamentalNote,n,AccidentalEnum.NONE)}},{key:"NoteHeadCode",value:function(e){var t=e.Filled?"2":"1";switch(e.Shape){case NoteHeadShape.NORMAL:return"";case NoteHeadShape.DIAMOND:return"/D"+t;case NoteHeadShape.TRIANGLE:return"/T"+t;case NoteHeadShape.X:return"/X"+t;case NoteHeadShape.CIRCLEX:return"/X3";case NoteHeadShape.RECTANGLE:return"/R"+t;case NoteHeadShape.SQUARE:return"/S"+t;case NoteHeadShape.SLASH:default:return""}}},{key:"GhostNotes",value:function(t){var n,i=[],r=_createForOfIteratorHelper(e.durations(t,!1));try{for(r.s();!(n=r.n()).done;){var a=n.value;i.push(new VF$c.GhostNote({duration:a}))}}catch(err){r.e(err)}finally{r.f()}return i}},{key:"StaveNote",value:function(t){t.sortForVexflow();var n,i=t.notes,r=t.parentStaffEntry.parentMeasure.parentSourceMeasure.Rules,a=i[0],s=[],o=[],l=a.graphicalNoteLength,u=void 0!==a.sourceNote.NoteTuplet,c=e.durations(l,u)[0];void 0!==a.sourceNote.TypeLength&&a.sourceNote.TypeLength!==l&&0!==a.sourceNote.TypeLength.RealValue&&(c=e.durations(a.sourceNote.TypeLength,u)[0],a.numberOfDots=a.sourceNote.DotsXml);var h,f,d,p=void 0,m=a.numberOfDots,v=!1,g=0,y=!1,b=!1,_=_createForOfIteratorHelper(i);try{for(_.s();!(f=_.n()).done;){var S,x,w=f.value;if(m=1&&I.length-1>=R+1)if(N=null===(P=I[R-1])||void 0===P||null===(A=P.graphicalVoiceEntries[0])||void 0===A?void 0:A.parentVoiceEntry,L=null===(C=I[R+1])||void 0===C||null===(M=C.graphicalVoiceEntries[0])||void 0===M?void 0:M.parentVoiceEntry,N&&L){var B,D=N.Notes[0],V=L.Notes[0];if(null!==(B=D.NoteBeam)&&void 0!==B&&B.Notes.includes(V)&&1!==V.ParentStaffEntry.ParentStaff.StafflineCount){var $=N.Notes.last().Pitch,G=w.Clef(),z=e.pitch(e.restToNotePitch($.getTransposedPitch(-2),G.ClefType),!1,G);4===$.FundamentalNote&&(s=[z[0]])}}}l.RealValue===w.sourceNote.SourceMeasure.ActiveTimeSignature.RealValue&&(s="staff"===r.DYMusicScoreType?["d/5"]:["R/5"],c="w",m=0,v=!0,g=r.WholeRestXShiftVexflow*unitInPixels);var H=_toConsumableArray2(w.sourceNote.ParentStaff.Voices).filter((function(e){return 1!=(null==e?void 0:e.VoiceId)}));if(H.length){var U,j=w.parentVoiceEntry.parentStaffEntry.graphicalVoiceEntries,W=w.parentVoiceEntry.parentVoiceEntry.ParentVoice.VoiceId,q=void 0,Y=void 0,X=_createForOfIteratorHelper(j);try{for(X.s();!(U=X.n()).done;){var K,Z=_createForOfIteratorHelper(U.value.notes);try{for(Z.s();!(K=Z.n()).done;){var J=K.value;if(J!==w&&!J.sourceNote.isRest()&&J.sourceNote.PrintObject){var Q=J.parentVoiceEntry.parentVoiceEntry.WantedStemDirection,ee=1===W||5===W,te=ee?1:-1,ne=J.sourceNote.Pitch.getHalfTone();(!q||1===te&&ne>q||-1===te&&ne0){var ie=3,re=w.Clef();switch(re.ClefType){case ClefEnum.F:ie=5;break;case ClefEnum.C:ie=4}h=Pitch.fromHalftone(q),s=[e.pitch(h,!0,re,void 0,ie)[0]]}}break}w.sourceNote.Notehead&&w.sourceNote.Notehead.Shape===NoteHeadShape.SLASH&&(y=!0);var ae=w.vfpitch;if(null!==(S=ae[2])&&void 0!==S&&null!==(x=S.Parent)&&void 0!==x&&x.Instructions)for(var se=0,oe=ae[2].Parent.Instructions.length;se0&&"single"===Pe){var Ae=new VF$c.Tremolo(Te);Ae.extra_stroke_scale=r.TremoloStrokeScale,Ae.y_spacing_scale=r.TremoloYSpacingScale,d&&"w"===d.duration&&d.stem.setExtension(-9),d.addModifier(ye,Ae)}if(Te>0&&"start"===Pe&&this.noteTremoloList.push(d),Te>0&&"stop"===Pe){this.noteTremoloList.push(d);var Ce=new VF$c.Tremolo(Te,_toConsumableArray2(this.noteTremoloList));Ce.extra_stroke_scale=1.2,Ce.y_spacing_scale=1.2,Ce.x_shift=-30,d.addModifier(ye,Ce),this.noteTremoloList=[]}if(this.glissandoList.length)d.setVibrato(this.glissandoList[0].vfnote[0]),null===(_e=this.glissandoList[0])||void 0===_e||null===(Se=_e.sourceNote)||void 0===Se||null===(xe=Se.SourceMeasure)||void 0===xe||xe.MeasureNumberXML,null===(we=i[ye])||void 0===we||null===(ke=we.sourceNote)||void 0===ke||null===(Ee=ke.SourceMeasure)||void 0===Ee||Ee.MeasureNumberXML,this.glissandoList=[];"start"===i[ye].sourceNote.glissandoType&&this.glissandoList.push(i[ye])}if(.25===de.Length.RealValue&&de.Notehead&&!1===de.Notehead.Filled)for(var Me=d.getKeyProps(),Ie=0;Ie1){var Re=d.getKeyProps().filter((function(e){return!e.code&&e.line>3}));Re.length===s.length&&d.setStemDirection(-1)}"jianpu"===r.DYMusicScoreType&&window&&window.sett&&window.sett.keySignature&&d.addAccidental(0,new VF$c.Accidental("#"));try{!function(){var e,t=["b","#","§","º","X"],n={b:"b","#":"#","§":"n","º":"bb",X:"##"},r=_createForOfIteratorHelper(i);try{for(r.s();!(e=r.n()).done;){var a,s=e.value,o=s.sourceNote.voiceEntry.Timestamp,l=_createForOfIteratorHelper(s.sourceNote.SourceMeasure.StaffLinkedExpressions);try{for(l.s();!(a=l.n()).done;){var u,c=_createForOfIteratorHelper(a.value);try{for(c.s();!(u=c.n()).done;){var h=u.value,f=Fraction$1.Equal(o,h.Timestamp),p=h.EntriesList.map((function(e){return e.label})).filter((function(e){return t.includes(e)})),m=p.map((function(e){return n[e]}));if(f){var v,g=_createForOfIteratorHelper(m);try{for(g.s();!(v=g.n()).done;){var y=v.value;y&&d.addAnnotation(0,new VF$c.Annotation(y))}}catch(err){g.e(err)}finally{g.f()}break}}}catch(err){c.e(err)}finally{c.f()}}}catch(err){l.e(err)}finally{l.f()}}}catch(err){r.e(err)}finally{r.f()}}()}catch(Fe){}return d}},{key:"generateArticulations",value:function(e,t,n){if(e&&"GhostNote"!==e.getAttribute("type")){var i,r=_createForOfIteratorHelper(t);try{for(r.s();!(i=r.n()).done;){var a=i.value,s=VF$c.Modifier.Position.ABOVE;e.getStemDirection()===VF$c.Stem.UP&&(s=VF$c.Modifier.Position.BELOW);var o=void 0,l=a.articulationEnum;switch(n.ArticulationPlacementFromXML&&(a.placement===PlacementEnum.Above?s=VF$c.Modifier.Position.ABOVE:a.placement===PlacementEnum.Below&&(s=VF$c.Modifier.Position.BELOW)),l){case ArticulationEnum.accent:o=new VF$c.Articulation("a>");break;case ArticulationEnum.downbow:o=new VF$c.Articulation("am"),void 0===a.placement&&(s=VF$c.Modifier.Position.ABOVE);break;case ArticulationEnum.fermata:o=new VF$c.Articulation("a@a"),s=VF$c.Modifier.Position.ABOVE;break;case ArticulationEnum.marcatodown:o=new VF$c.Articulation("a|");break;case ArticulationEnum.marcatoup:o=new VF$c.Articulation("a^");break;case ArticulationEnum.invertedfermata:o=new VF$c.Articulation("a@u"),s=VF$c.Modifier.Position.BELOW;break;case ArticulationEnum.lefthandpizzicato:o=new VF$c.Articulation("a+");break;case ArticulationEnum.naturalharmonic:o=new VF$c.Articulation("ah");break;case ArticulationEnum.snappizzicato:o=new VF$c.Articulation("ao");break;case ArticulationEnum.staccatissimo:o=new VF$c.Articulation("av");break;case ArticulationEnum.staccato:o=new VF$c.Articulation("a.");break;case ArticulationEnum.tenuto:o=new VF$c.Articulation("a-");break;case ArticulationEnum.upbow:o=new VF$c.Articulation("a|"),void 0===a.placement&&(s=VF$c.Modifier.Position.ABOVE);break;case ArticulationEnum.strongaccent:o=new VF$c.Articulation("a^")}if(o){var u,c;if(!e.hasStem()&&!e.isRest()&&l==ArticulationEnum.accent&&e.getLineNumber()>=3)s=VF$c.Modifier.Position.ABOVE,null!=e&&null!==(u=e.modifiers)&&void 0!==u&&null!==(c=u.filter((function(e){return["TREMOLO"].includes(e.getCategory().toLocaleUpperCase())})))&&void 0!==c&&c.length&&o.setYShift(-16);l===ArticulationEnum.strongaccent&&(s=VF$c.Modifier.Position.ABOVE),o.setPosition(s),e.addModifier(0,o)}}}catch(err){r.e(err)}finally{r.f()}}}},{key:"generateOrnaments",value:function(e,t){var n=VF$c.Modifier.Position.ABOVE;t.placement===PlacementEnum.Below&&(n=VF$c.Modifier.Position.BELOW);var i=void 0;switch(t.GetOrnament){case OrnamentEnum.DelayedInvertedTurn:(i=new VF$c.Ornament("turn_inverted")).setDelayed(!0);break;case OrnamentEnum.DelayedTurn:(i=new VF$c.Ornament("turn")).setDelayed(!0);break;case OrnamentEnum.InvertedMordent:(i=new VF$c.Ornament("mordent")).setDelayed(!1);break;case OrnamentEnum.InvertedTurn:(i=new VF$c.Ornament("turn_inverted")).setDelayed(!1);break;case OrnamentEnum.Mordent:(i=new VF$c.Ornament("mordent_inverted")).setDelayed(!1);break;case OrnamentEnum.Trill:(i=new VF$c.Ornament("tr")).setDelayed(!1);break;case OrnamentEnum.Turn:(i=new VF$c.Ornament("turn")).setDelayed(!1);break;default:return void log$2.warn("unhandled OrnamentEnum type: "+t.GetOrnament)}i&&(t.AccidentalBelow!==AccidentalEnum.NONE&&i.setLowerAccidental(Pitch.accidentalVexflow(t.AccidentalBelow)),t.AccidentalAbove!==AccidentalEnum.NONE&&i.setUpperAccidental(Pitch.accidentalVexflow(t.AccidentalAbove)),i.setPosition(n),e.addModifier(0,i))}},{key:"StrokeTypeFromArpeggioType",value:function(e){switch(e){case ArpeggioType.ARPEGGIO_DIRECTIONLESS:return VF$c.Stroke.Type.ARPEGGIO_DIRECTIONLESS;case ArpeggioType.BRUSH_DOWN:return VF$c.Stroke.Type.BRUSH_UP;case ArpeggioType.BRUSH_UP:return VF$c.Stroke.Type.BRUSH_DOWN;case ArpeggioType.RASQUEDO_DOWN:return VF$c.Stroke.Type.RASQUEDO_UP;case ArpeggioType.RASQUEDO_UP:return VF$c.Stroke.Type.RASQUEDO_DOWN;case ArpeggioType.ROLL_DOWN:return VF$c.Stroke.Type.ROLL_UP;case ArpeggioType.ROLL_UP:return VF$c.Stroke.Type.ROLL_DOWN;default:return VF$c.Stroke.Type.ARPEGGIO_DIRECTIONLESS}}},{key:"CreateTabNote",value:function(t){var n,i=[],r=t.notes.reverse(),a=[],s=t.notes[0].graphicalNoteLength,o=void 0!==t.notes[0].sourceNote.NoteTuplet,l=e.durations(s,o)[0],u=0,c=_createForOfIteratorHelper(t.notes);try{var h=function(){var e=n.value,t=e.sourceNote,r={str:t.StringNumberTab,fret:t.FretNumber};i.push(r),t.BendArray&&t.BendArray.forEach((function(e){var t,n=e.bendalter-r.fret;t=n>1?"Full":1===n?"1/2":"1/4","up"===e.direction?a.push({type:VF$c.Bend.UP,text:t,width:10}):a.push({type:VF$c.Bend.DOWN,text:t,width:10})})),u1&&void 0!==arguments[1]?arguments[1]:"default";switch("default"!==i&&"small"!==i&&(log$2.warn('Invalid VexFlow clef size "'.concat(i,'" specified. Using "default".')),i="default"),e.ClefType){case ClefEnum.G:switch(e.Line){case 1:t="french";break;case 2:t="treble";break;default:t="treble",log$2.error("Clef ".concat(ClefEnum[e.ClefType]," on line ").concat(e.Line,' not supported by VexFlow. Using default value "').concat(t,'".'))}break;case ClefEnum.F:switch(e.Line){case 4:t="bass";break;case 3:t="baritone-f";break;case 5:t="subbass";break;default:t="bass",log$2.error("Clef ".concat(ClefEnum[e.ClefType]," on line ").concat(e.Line,' not supported by VexFlow. Using default value "').concat(t,'".'))}break;case ClefEnum.C:switch(e.Line){case 3:t="alto";break;case 4:t="tenor";break;case 1:t="soprano";break;case 2:t="mezzo-soprano";break;default:t="alto",log$2.error("Clef ".concat(ClefEnum[e.ClefType]," on line ").concat(e.Line,' not supported by VexFlow. Using default value "').concat(t,'".'))}break;case ClefEnum.percussion:t="percussion";break;case ClefEnum.TAB:t="treble";break;default:log$2.info("bad clef type: "+e.ClefType),t="treble"}return 1===e.OctaveOffset&&"bass"!==t?n="8va":-1===e.OctaveOffset&&(n="8vb"),{type:t,size:i,annotation:n}}},{key:"TimeSignature",value:function(e){var t;switch(e.SymbolEnum){case RhythmSymbolEnum.NONE:t=e.Rhythm.Numerator+"/"+e.Rhythm.Denominator;break;case RhythmSymbolEnum.COMMON:t="C";break;case RhythmSymbolEnum.CUT:t="C|"}return new VF$c.TimeSignature(t)}},{key:"keySignature",value:function(t){if(t){var n;switch(t.Mode){case KeyEnum.minor:n=e.minorMap[t.Key]+"m";break;case KeyEnum.major:case KeyEnum.none:n=e.majorMap[t.Key];break;default:n="C"}return n}}},{key:"line",value:function(e,t){switch(e){case SystemLinesEnum.SingleThin:return t===SystemLinePosition.MeasureBegin?VF$c.StaveConnector.type.SINGLE:VF$c.StaveConnector.type.SINGLE_RIGHT;case SystemLinesEnum.DoubleThin:return VF$c.StaveConnector.type.THIN_DOUBLE;case SystemLinesEnum.ThinBold:return VF$c.StaveConnector.type.BOLD_DOUBLE_RIGHT;case SystemLinesEnum.BoldThinDots:return VF$c.StaveConnector.type.BOLD_DOUBLE_LEFT;case SystemLinesEnum.DotsThinBold:case SystemLinesEnum.DotsBoldBoldDots:return VF$c.StaveConnector.type.BOLD_DOUBLE_RIGHT;case SystemLinesEnum.None:return VF$c.StaveConnector.type.NONE}}},{key:"font",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:FontStyles.Regular,n=(arguments.length>2&&void 0!==arguments[2]||Fonts.TimesNewRoman,arguments.length>3?arguments[3]:void 0),i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0,r="normal",a="normal",s="'".concat(n.DefaultFontFamily,"'");switch(t){case FontStyles.Bold:a="bold";break;case FontStyles.Italic:r="italic";break;case FontStyles.BoldItalic:r="italic",a="bold";case FontStyles.Underlined:}return Fonts.Kokila,i&&"default"!==i&&(s="'".concat(i,"'")),r+" "+a+" "+Math.floor(e)+"px "+s}},{key:"fontStyle",value:function(e){switch(e){case FontStyles.Bold:return"bold";case FontStyles.Italic:return"italic";case FontStyles.BoldItalic:return"italic bold";default:return"normal"}}},{key:"style",value:function(e){return OUTLINE_AND_FILL_STYLE_DICT.getValue(e)}}]),e}(),VexFlowConverter=_VexFlowConverter;VexFlowConverter.majorMap={"-1":"F","-2":"Bb","-3":"Eb","-4":"Ab","-5":"Db","-6":"Gb","-7":"Cb","-8":"Fb",0:"C",1:"G",2:"D",3:"A",4:"E",5:"B",6:"F#",7:"C#",8:"G#"},VexFlowConverter.minorMap={"-1":"D","-2":"G","-3":"C","-4":"F","-5":"Bb","-6":"Eb","-7":"Ab","-8":"Db",0:"A",1:"E",2:"B",3:"F#",4:"C#",5:"G#",6:"D#",7:"A#",8:"E#"},VexFlowConverter.noteTremoloList=[],VexFlowConverter.glissandoList=[];var OctaveShift=function(){function e(t,n){_classCallCheck2(this,e),this.numberXml=1,this.setOctaveShiftValue(t,n)}return _createClass2(e,[{key:"Type",get:function(){return this.octaveValue},set:function(e){this.octaveValue=e}},{key:"StaffNumber",get:function(){return this.staffNumber},set:function(e){this.staffNumber=e}},{key:"ParentStartMultiExpression",get:function(){return this.startMultiExpression},set:function(e){this.startMultiExpression=e}},{key:"ParentEndMultiExpression",get:function(){return this.endMultiExpression},set:function(e){this.endMultiExpression=e}},{key:"setOctaveShiftValue",value:function(e,t){this.octaveValue=1===t&&"down"===e?OctaveEnum.VA8:1===t&&"up"===e?OctaveEnum.VB8:2===t&&"down"===e?OctaveEnum.MA15:2===t&&"up"===e?OctaveEnum.MB15:OctaveEnum.NONE}}],[{key:"getPitchFromOctaveShift",value:function(e,t){if(e){var n=e.Octave;switch(t){case OctaveEnum.VA8:n-=1;break;case OctaveEnum.VB8:n+=1;break;case OctaveEnum.MA15:n-=2;break;case OctaveEnum.MB15:n+=2;break;case OctaveEnum.NONE:default:n+=0}return new Pitch(e.FundamentalNote,n,e.Accidental)}}}]),e}(),OctaveEnum=function(e){return e[e.VA8=0]="VA8",e[e.VB8=1]="VB8",e[e.MA15=2]="MA15",e[e.MB15=3]="MB15",e[e.NONE=4]="NONE",e}(OctaveEnum||{}),AbstractTempoExpression=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i,r,a){var s;return _classCallCheck2(this,n),(s=t.call(this,i)).label=e,s.staffNumber=r,s.parentMultiTempoExpression=a,s}return _createClass2(n,[{key:"Label",get:function(){return this.label},set:function(e){this.label=e}},{key:"Placement",get:function(){return this.placement},set:function(e){this.placement=e}},{key:"StaffNumber",get:function(){return this.staffNumber},set:function(e){this.staffNumber=e}},{key:"ParentMultiTempoExpression",get:function(){return this.parentMultiTempoExpression}}],[{key:"isStringInStringList",value:function(e,t){var i,r=_createForOfIteratorHelper(e);try{for(r.s();!(i=r.n()).done;){var a=i.value;if(n.stringContainsSeparatedWord(t.toLowerCase().trim(),a.toLowerCase().trim()))return!0}}catch(err){r.e(err)}finally{r.f()}return!1}},{key:"stringContainsSeparatedWord",value:function(e,t){return e===t||-1!==e.indexOf(" "+t)||-1!==e.indexOf(t+" ")}}]),n}(AbstractExpression),_InstantaneousTempoExpression=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i,r,a,s){var o;return _classCallCheck2(this,n),(o=t.call(this,e,i,r,s)).setTempoAndTempoType(a),o}return _createClass2(n,[{key:"Label",get:function(){return this.label},set:function(e){this.label=e}},{key:"Placement",get:function(){return this.placement},set:function(e){this.placement=e}},{key:"StaffNumber",get:function(){return this.staffNumber},set:function(e){this.staffNumber=e}},{key:"Enum",get:function(){return this.tempoEnum}},{key:"TempoInBpm",get:function(){return this.tempoInBpm},set:function(e){this.tempoInBpm=e}},{key:"ParentMultiTempoExpression",get:function(){return this.parentMultiTempoExpression}},{key:"getAbsoluteTimestamp",value:function(){return Fraction$1.plus(this.ParentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.ParentMultiTempoExpression.Timestamp)}},{key:"getAbsoluteFloatTimestamp",value:function(){return Fraction$1.plus(this.ParentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.ParentMultiTempoExpression.Timestamp).RealValue}},{key:"setTempoAndTempoType",value:function(e){return this.label?n.isStringInStringList(n.listInstantaneousTempoLarghissimo,this.label)?(0===e&&(e=n.getDefaultValueForTempoType(TempoEnum.larghissimo)),this.tempoInBpm=e,void(this.tempoEnum=TempoEnum.larghissimo)):n.isStringInStringList(n.listInstantaneousTempoGrave,this.label)?(0===e&&(e=n.getDefaultValueForTempoType(TempoEnum.grave)),this.tempoInBpm=e,void(this.tempoEnum=TempoEnum.grave)):n.isStringInStringList(n.listInstantaneousTempoLento,this.label)?(0===e&&(e=n.getDefaultValueForTempoType(TempoEnum.lento)),this.tempoInBpm=e,void(this.tempoEnum=TempoEnum.lento)):n.isStringInStringList(n.listInstantaneousTempoLargo,this.label)?(0===e&&(e=n.getDefaultValueForTempoType(TempoEnum.largo)),this.tempoInBpm=e,void(this.tempoEnum=TempoEnum.largo)):n.isStringInStringList(n.listInstantaneousTempoLarghetto,this.label)?(0===e&&(e=n.getDefaultValueForTempoType(TempoEnum.larghetto)),this.tempoInBpm=e,void(this.tempoEnum=TempoEnum.larghetto)):n.isStringInStringList(n.listInstantaneousTempoAdagio,this.label)?(0===e&&(e=n.getDefaultValueForTempoType(TempoEnum.adagio)),this.tempoInBpm=e,void(this.tempoEnum=TempoEnum.adagio)):n.isStringInStringList(n.listInstantaneousTempoAdagietto,this.label)?(0===e&&(e=n.getDefaultValueForTempoType(TempoEnum.adagietto)),this.tempoInBpm=e,void(this.tempoEnum=TempoEnum.adagietto)):n.isStringInStringList(n.listInstantaneousTempoAndanteModerato,this.label)?(0===e&&(e=n.getDefaultValueForTempoType(TempoEnum.andanteModerato)),this.tempoInBpm=e,void(this.tempoEnum=TempoEnum.andanteModerato)):n.isStringInStringList(n.listInstantaneousTempoAndante,this.label)?(0===e&&(e=n.getDefaultValueForTempoType(TempoEnum.andante)),this.tempoInBpm=e,void(this.tempoEnum=TempoEnum.andante)):n.isStringInStringList(n.listInstantaneousTempoAndantino,this.label)?(0===e&&(e=n.getDefaultValueForTempoType(TempoEnum.andantino)),this.tempoInBpm=e,void(this.tempoEnum=TempoEnum.andantino)):n.isStringInStringList(n.listInstantaneousTempoModerato,this.label)?(0===e&&(e=n.getDefaultValueForTempoType(TempoEnum.moderato)),this.tempoInBpm=e,void(this.tempoEnum=TempoEnum.moderato)):n.isStringInStringList(n.listInstantaneousTempoAllegretto,this.label)?(0===e&&(e=n.getDefaultValueForTempoType(TempoEnum.allegretto)),this.tempoInBpm=e,void(this.tempoEnum=TempoEnum.allegretto)):n.isStringInStringList(n.listInstantaneousTempoAllegroModerato,this.label)?(0===e&&(e=n.getDefaultValueForTempoType(TempoEnum.allegroModerato)),this.tempoInBpm=e,void(this.tempoEnum=TempoEnum.allegroModerato)):n.isStringInStringList(n.listInstantaneousTempoAllegro,this.label)?(0===e&&(e=n.getDefaultValueForTempoType(TempoEnum.allegro)),this.tempoInBpm=e,void(this.tempoEnum=TempoEnum.allegro)):n.isStringInStringList(n.listInstantaneousTempoVivace,this.label)?(0===e&&(e=n.getDefaultValueForTempoType(TempoEnum.vivace)),this.tempoInBpm=e,void(this.tempoEnum=TempoEnum.vivace)):n.isStringInStringList(n.listInstantaneousTempoVivacissimo,this.label)?(0===e&&(e=n.getDefaultValueForTempoType(TempoEnum.vivacissimo)),this.tempoInBpm=e,void(this.tempoEnum=TempoEnum.vivacissimo)):n.isStringInStringList(n.listInstantaneousTempoAllegrissimo,this.label)?(0===e&&(e=n.getDefaultValueForTempoType(TempoEnum.allegrissimo)),this.tempoInBpm=e,void(this.tempoEnum=TempoEnum.allegrissimo)):n.isStringInStringList(n.listInstantaneousTempoPresto,this.label)?(0===e&&(e=n.getDefaultValueForTempoType(TempoEnum.presto)),this.tempoInBpm=e,void(this.tempoEnum=TempoEnum.presto)):n.isStringInStringList(n.listInstantaneousTempoPrestissimo,this.label)?(0===e&&(e=n.getDefaultValueForTempoType(TempoEnum.prestissimo)),this.tempoInBpm=e,void(this.tempoEnum=TempoEnum.prestissimo)):n.isStringInStringList(n.listInstantaneousTempoAddons,this.label)?(this.tempoInBpm=0,void(this.tempoEnum=TempoEnum.addon)):n.isStringInStringList(n.listInstantaneousTempoChangesGeneral,this.label)?(this.tempoInBpm=0,void(this.tempoEnum=TempoEnum.changes)):void 0:(this.tempoInBpm=e,void(this.tempoEnum=TempoEnum.metronomeMark))}}],[{key:"getDefaultValueForTempoType",value:function(e){switch(e){case TempoEnum.larghissimo:return 20;case TempoEnum.grave:return 30;case TempoEnum.lento:return 48;case TempoEnum.largo:return 52;case TempoEnum.larghetto:return 63;case TempoEnum.adagio:return 70;case TempoEnum.adagietto:return 75;case TempoEnum.andanteModerato:return 88;case TempoEnum.andante:return 92;case TempoEnum.andantino:return 96;case TempoEnum.moderato:return 106;case TempoEnum.allegretto:return 112;case TempoEnum.allegroModerato:return 118;case TempoEnum.allegro:return 130;case TempoEnum.vivace:return 140;case TempoEnum.vivacissimo:return 155;case TempoEnum.allegrissimo:return 170;case TempoEnum.presto:return 184;case TempoEnum.prestissimo:return 200;default:throw new ArgumentOutOfRangeException("tempoEnum")}}},{key:"isInputStringInstantaneousTempo",value:function(e){return!!e&&(n.isStringInStringList(n.listInstantaneousTempoLarghissimo,e)||n.isStringInStringList(n.listInstantaneousTempoGrave,e)||n.isStringInStringList(n.listInstantaneousTempoLento,e)||n.isStringInStringList(n.listInstantaneousTempoLargo,e)||n.isStringInStringList(n.listInstantaneousTempoLarghetto,e)||n.isStringInStringList(n.listInstantaneousTempoAdagio,e)||n.isStringInStringList(n.listInstantaneousTempoAdagietto,e)||n.isStringInStringList(n.listInstantaneousTempoAndanteModerato,e)||n.isStringInStringList(n.listInstantaneousTempoAndante,e)||n.isStringInStringList(n.listInstantaneousTempoAndantino,e)||n.isStringInStringList(n.listInstantaneousTempoModerato,e)||n.isStringInStringList(n.listInstantaneousTempoAllegretto,e)||n.isStringInStringList(n.listInstantaneousTempoAllegroModerato,e)||n.isStringInStringList(n.listInstantaneousTempoAllegro,e)||n.isStringInStringList(n.listInstantaneousTempoVivace,e)||n.isStringInStringList(n.listInstantaneousTempoVivacissimo,e)||n.isStringInStringList(n.listInstantaneousTempoAllegrissimo,e)||n.isStringInStringList(n.listInstantaneousTempoPresto,e)||n.isStringInStringList(n.listInstantaneousTempoPrestissimo,e)||n.isStringInStringList(n.listInstantaneousTempoChangesGeneral,e))}}]),n}(AbstractTempoExpression),InstantaneousTempoExpression=_InstantaneousTempoExpression;InstantaneousTempoExpression.listInstantaneousTempoLarghissimo=["Larghissimo","Sehr breit","very, very slow"],InstantaneousTempoExpression.listInstantaneousTempoGrave=["Grave","Schwer","slow and solemn"],InstantaneousTempoExpression.listInstantaneousTempoLento=["Lento","Lent","Langsam","slowly"],InstantaneousTempoExpression.listInstantaneousTempoLargo=["Largo","Breit","broadly"],InstantaneousTempoExpression.listInstantaneousTempoLarghetto=["Larghetto","Etwas breit","rather broadly"],InstantaneousTempoExpression.listInstantaneousTempoAdagio=["Adagio","Langsam","Ruhig","slow and stately"],InstantaneousTempoExpression.listInstantaneousTempoAdagietto=["Adagietto","Ziemlich ruhig","Ziemlich langsam","rather slow"],InstantaneousTempoExpression.listInstantaneousTempoAndanteModerato=["Andante moderato"],InstantaneousTempoExpression.listInstantaneousTempoAndante=["Andante","Gehend","Schreitend","at a walking pace"],InstantaneousTempoExpression.listInstantaneousTempoAndantino=["Andantino"],InstantaneousTempoExpression.listInstantaneousTempoModerato=["Moderato","Mäßig","Mod�r�","moderately"],InstantaneousTempoExpression.listInstantaneousTempoAllegretto=["Allegretto","fast"],InstantaneousTempoExpression.listInstantaneousTempoAllegroModerato=["Allegro moderato"],InstantaneousTempoExpression.listInstantaneousTempoAllegro=["Allegro","Rapide","Vite","Rasch","Schnell","Fr�hlich"],InstantaneousTempoExpression.listInstantaneousTempoVivace=["Vivace","Lebhaft","Lebendig","lively and fast"],InstantaneousTempoExpression.listInstantaneousTempoVivacissimo=["Vivacissimo","Sehr lebhaft","Sehr lebendig"],InstantaneousTempoExpression.listInstantaneousTempoAllegrissimo=["Allegrissimo","very fast"],InstantaneousTempoExpression.listInstantaneousTempoPresto=["Presto","Sehr schnell","Geschwind"],InstantaneousTempoExpression.listInstantaneousTempoPrestissimo=["Prestissimo","äußerst schnell"],InstantaneousTempoExpression.listInstantaneousTempoChangesGeneral=["tempo primo","a tempo","tempo i","rubato","doppio movimento"],InstantaneousTempoExpression.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"];var TempoEnum=function(e){return e[e.none=0]="none",e[e.larghissimo=1]="larghissimo",e[e.grave=2]="grave",e[e.lento=3]="lento",e[e.largo=4]="largo",e[e.larghetto=5]="larghetto",e[e.adagio=6]="adagio",e[e.adagietto=7]="adagietto",e[e.andanteModerato=8]="andanteModerato",e[e.andante=9]="andante",e[e.andantino=10]="andantino",e[e.moderato=11]="moderato",e[e.allegretto=12]="allegretto",e[e.allegroModerato=13]="allegroModerato",e[e.allegro=14]="allegro",e[e.vivace=15]="vivace",e[e.vivacissimo=16]="vivacissimo",e[e.allegrissimo=17]="allegrissimo",e[e.presto=18]="presto",e[e.prestissimo=19]="prestissimo",e[e.lastRealTempo=20]="lastRealTempo",e[e.addon=21]="addon",e[e.changes=22]="changes",e[e.metronomeMark=23]="metronomeMark",e}(TempoEnum||{}),_MoodExpression=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i,r){var a;return _classCallCheck2(this,n),(a=t.call(this,i)).label=e,a.staffNumber=r,a.setMoodType(),a}return _createClass2(n,[{key:"Label",get:function(){return this.label},set:function(e){this.label=e}},{key:"Mood",get:function(){return this.moodType},set:function(e){this.moodType=e}},{key:"StaffNumber",get:function(){return this.staffNumber},set:function(e){this.staffNumber=e}},{key:"Placement",get:function(){return this.placement},set:function(e){this.placement=e}},{key:"setMoodType",value:function(){n.isStringInStringList(n.listMoodAffettuoso,this.label)?this.moodType=MoodEnum.Affettuoso:n.isStringInStringList(n.listMoodAgitato,this.label)?this.moodType=MoodEnum.Agitato:n.isStringInStringList(n.listMoodAnimato,this.label)?this.moodType=MoodEnum.Animato:n.isStringInStringList(n.listMoodAppassionato,this.label)?this.moodType=MoodEnum.Appassionato:n.isStringInStringList(n.listMoodBrillante,this.label)?this.moodType=MoodEnum.Brillante:n.isStringInStringList(n.listMoodCantabile,this.label)?this.moodType=MoodEnum.Cantabile:n.isStringInStringList(n.listMoodDolce,this.label)?this.moodType=MoodEnum.Dolce:n.isStringInStringList(n.listMoodEnergico,this.label)?this.moodType=MoodEnum.Energico:n.isStringInStringList(n.listMoodEroico,this.label)?this.moodType=MoodEnum.Eroico:n.isStringInStringList(n.listMoodEspressivo,this.label)?this.moodType=MoodEnum.Espressivo:n.isStringInStringList(n.listMoodFurioso,this.label)?this.moodType=MoodEnum.Furioso:n.isStringInStringList(n.listMoodGiocoso,this.label)?this.moodType=MoodEnum.Giocoso:n.isStringInStringList(n.listMoodGioioso,this.label)?this.moodType=MoodEnum.Gioioso:n.isStringInStringList(n.listMoodGrandioso,this.label)?this.moodType=MoodEnum.Grandioso:n.isStringInStringList(n.listMoodGrazioso,this.label)?this.moodType=MoodEnum.Grazioso:n.isStringInStringList(n.listMoodLacrimoso,this.label)?this.moodType=MoodEnum.Lacrimoso:n.isStringInStringList(n.listMoodLeggiero,this.label)?this.moodType=MoodEnum.Leggiero:n.isStringInStringList(n.listMoodMaestoso,this.label)?this.moodType=MoodEnum.Maestoso:n.isStringInStringList(n.listMoodMalinconico,this.label)?this.moodType=MoodEnum.Malinconico:n.isStringInStringList(n.listMoodMarcato,this.label)?this.moodType=MoodEnum.Marcato:n.isStringInStringList(n.listMoodMarziale,this.label)?this.moodType=MoodEnum.Marziale:n.isStringInStringList(n.listMoodMesto,this.label)?this.moodType=MoodEnum.Mesto:n.isStringInStringList(n.listMoodMorendo,this.label)?this.moodType=MoodEnum.Morendo:n.isStringInStringList(n.listMoodNobilmente,this.label)?this.moodType=MoodEnum.Nobilmente:n.isStringInStringList(n.listMoodPatetico,this.label)?this.moodType=MoodEnum.Patetico:n.isStringInStringList(n.listMoodPesante,this.label)?this.moodType=MoodEnum.Pesante:n.isStringInStringList(n.listMoodSaltando,this.label)?this.moodType=MoodEnum.Saltando:n.isStringInStringList(n.listMoodSautille,this.label)?this.moodType=MoodEnum.Sautille:n.isStringInStringList(n.listMoodScherzando,this.label)?this.moodType=MoodEnum.Scherzando:n.isStringInStringList(n.listMoodSostenuto,this.label)?this.moodType=MoodEnum.Sostenuto:n.isStringInStringList(n.listMoodSpiccato,this.label)?this.moodType=MoodEnum.Spiccato:n.isStringInStringList(n.listMoodTenerezza,this.label)?this.moodType=MoodEnum.Tenerezza:n.isStringInStringList(n.listMoodTranquillamente,this.label)?this.moodType=MoodEnum.Tranquillamente:n.isStringInStringList(n.listMoodTrionfante,this.label)&&(this.moodType=MoodEnum.Trionfante)}}],[{key:"isInputStringMood",value:function(e){return!!e&&(n.isStringInStringList(n.listMoodAffettuoso,e)||n.isStringInStringList(n.listMoodAgitato,e)||n.isStringInStringList(n.listMoodAnimato,e)||n.isStringInStringList(n.listMoodAppassionato,e)||n.isStringInStringList(n.listMoodBrillante,e)||n.isStringInStringList(n.listMoodCantabile,e)||n.isStringInStringList(n.listMoodDolce,e)||n.isStringInStringList(n.listMoodEnergico,e)||n.isStringInStringList(n.listMoodEroico,e)||n.isStringInStringList(n.listMoodEspressivo,e)||n.isStringInStringList(n.listMoodFurioso,e)||n.isStringInStringList(n.listMoodGiocoso,e)||n.isStringInStringList(n.listMoodGioioso,e)||n.isStringInStringList(n.listMoodGrandioso,e)||n.isStringInStringList(n.listMoodGrazioso,e)||n.isStringInStringList(n.listMoodLacrimoso,e)||n.isStringInStringList(n.listMoodLeggiero,e)||n.isStringInStringList(n.listMoodMaestoso,e)||n.isStringInStringList(n.listMoodMalinconico,e)||n.isStringInStringList(n.listMoodMarcato,e)||n.isStringInStringList(n.listMoodMarziale,e)||n.isStringInStringList(n.listMoodMesto,e)||n.isStringInStringList(n.listMoodMorendo,e)||n.isStringInStringList(n.listMoodNobilmente,e)||n.isStringInStringList(n.listMoodPatetico,e)||n.isStringInStringList(n.listMoodPesante,e)||n.isStringInStringList(n.listMoodSaltando,e)||n.isStringInStringList(n.listMoodSautille,e)||n.isStringInStringList(n.listMoodScherzando,e)||n.isStringInStringList(n.listMoodSostenuto,e)||n.isStringInStringList(n.listMoodSpiccato,e)||n.isStringInStringList(n.listMoodTenerezza,e)||n.isStringInStringList(n.listMoodTranquillamente,e)||n.isStringInStringList(n.listMoodTrionfante,e))}}]),n}(AbstractExpression),MoodExpression=_MoodExpression;MoodExpression.listMoodAffettuoso=["affettuoso"],MoodExpression.listMoodAgitato=["agitato"],MoodExpression.listMoodAppassionato=["appassionato"],MoodExpression.listMoodAnimato=["animato","lively"],MoodExpression.listMoodBrillante=["brillante"],MoodExpression.listMoodCantabile=["cantabile"],MoodExpression.listMoodDolce=["dolce"],MoodExpression.listMoodEnergico=["energico"],MoodExpression.listMoodEroico=["eroico"],MoodExpression.listMoodEspressivo=["espressivo"],MoodExpression.listMoodFurioso=["furioso"],MoodExpression.listMoodGiocoso=["giocoso"],MoodExpression.listMoodGioioso=["gioioso"],MoodExpression.listMoodLacrimoso=["lacrimoso"],MoodExpression.listMoodGrandioso=["grandioso"],MoodExpression.listMoodGrazioso=["grazioso"],MoodExpression.listMoodLeggiero=["leggiero"],MoodExpression.listMoodMaestoso=["maestoso"],MoodExpression.listMoodMalinconico=["malinconico"],MoodExpression.listMoodMarcato=["marcato"],MoodExpression.listMoodMarziale=["marziale"],MoodExpression.listMoodMesto=["mesto"],MoodExpression.listMoodMorendo=["morendo"],MoodExpression.listMoodNobilmente=["nobilmente"],MoodExpression.listMoodPatetico=["patetico"],MoodExpression.listMoodPesante=["pesante"],MoodExpression.listMoodSautille=["sautille"],MoodExpression.listMoodSaltando=["saltando"],MoodExpression.listMoodScherzando=["scherzando"],MoodExpression.listMoodSostenuto=["sostenuto"],MoodExpression.listMoodSpiccato=["spiccato"],MoodExpression.listMoodTenerezza=["tenerezza"],MoodExpression.listMoodTranquillamente=["tranquillamente"],MoodExpression.listMoodTrionfante=["trionfante"];var MoodEnum=function(e){return e[e.Affettuoso=0]="Affettuoso",e[e.Agitato=1]="Agitato",e[e.Appassionato=2]="Appassionato",e[e.Animato=3]="Animato",e[e.Brillante=4]="Brillante",e[e.Cantabile=5]="Cantabile",e[e.Dolce=6]="Dolce",e[e.Energico=7]="Energico",e[e.Eroico=8]="Eroico",e[e.Espressivo=9]="Espressivo",e[e.Furioso=10]="Furioso",e[e.Giocoso=11]="Giocoso",e[e.Gioioso=12]="Gioioso",e[e.Lacrimoso=13]="Lacrimoso",e[e.Grandioso=14]="Grandioso",e[e.Grazioso=15]="Grazioso",e[e.Leggiero=16]="Leggiero",e[e.Maestoso=17]="Maestoso",e[e.Malinconico=18]="Malinconico",e[e.Marcato=19]="Marcato",e[e.Marziale=20]="Marziale",e[e.Mesto=21]="Mesto",e[e.Morendo=22]="Morendo",e[e.Nobilmente=23]="Nobilmente",e[e.Patetico=24]="Patetico",e[e.Pesante=25]="Pesante",e[e.Sautille=26]="Sautille",e[e.Saltando=27]="Saltando",e[e.Scherzando=28]="Scherzando",e[e.Sostenuto=29]="Sostenuto",e[e.Spiccato=30]="Spiccato",e[e.Tenerezza=31]="Tenerezza",e[e.Tranquillamente=32]="Tranquillamente",e[e.Trionfante=33]="Trionfante",e[e.Vivace=34]="Vivace",e}(MoodEnum||{}),UnknownExpression=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i,r,a){var s;return _classCallCheck2(this,n),(s=t.call(this,i)).label=e,s.staffNumber=a,void 0===r&&(r=TextAlignmentEnum.LeftBottom),s.textAlignment=r,s}return _createClass2(n,[{key:"Label",get:function(){return this.label}},{key:"Placement",get:function(){return this.placement},set:function(e){this.placement=e}},{key:"StaffNumber",get:function(){return this.staffNumber},set:function(e){this.staffNumber=e}},{key:"TextAlignment",get:function(){return this.textAlignment}}]),n}(AbstractExpression),MultiExpression=function(){function e(t,n){_classCallCheck2(this,e),this.unknownList=[],this.moodList=[],this.expressions=[],this.sourceMeasure=t,this.timestamp=n}return _createClass2(e,[{key:"SourceMeasureParent",get:function(){return this.sourceMeasure},set:function(e){this.sourceMeasure=e}},{key:"StaffNumber",get:function(){return this.staffNumber},set:function(e){this.staffNumber=e}},{key:"Timestamp",get:function(){return this.timestamp},set:function(e){this.timestamp=e}},{key:"AbsoluteTimestamp",get:function(){return Fraction$1.plus(this.timestamp,this.sourceMeasure.AbsoluteTimestamp)}},{key:"InstantaneousDynamic",get:function(){return this.instantaneousDynamic},set:function(e){this.instantaneousDynamic=e}},{key:"EndingContinuousDynamic",get:function(){return this.endingContinuousDynamic},set:function(e){this.endingContinuousDynamic=e}},{key:"StartingContinuousDynamic",get:function(){return this.startingContinuousDynamic},set:function(e){this.startingContinuousDynamic=e}},{key:"MoodList",get:function(){return this.moodList}},{key:"UnknownList",get:function(){return this.unknownList}},{key:"EntriesList",get:function(){return this.expressions}},{key:"OctaveShiftStart",get:function(){return this.octaveShiftStart},set:function(e){this.octaveShiftStart=e}},{key:"OctaveShiftEnd",get:function(){return this.octaveShiftEnd},set:function(e){this.octaveShiftEnd=e}},{key:"CombinedExpressionsText",get:function(){return this.combinedExpressionsText},set:function(e){this.combinedExpressionsText=e}},{key:"getPlacementOfFirstEntry",value:function(){var e=PlacementEnum.Above;return this.expressions.length>0&&(this.expressions[0].expression instanceof InstantaneousDynamicExpression||this.expressions[0].expression instanceof ContinuousDynamicExpression||this.expressions[0].expression instanceof MoodExpression||this.expressions[0].expression instanceof UnknownExpression)&&(e=this.expressions[0].expression.Placement),e}},{key:"getFontstyleOfFirstEntry",value:function(){var e=FontStyles.Regular;if(this.expressions.length>0)if(this.expressions[0].expression instanceof ContinuousDynamicExpression)e=FontStyles.Italic;else if(this.expressions[0].expression instanceof MoodExpression)e=FontStyles.Italic;else if(this.expressions[0].expression instanceof UnknownExpression){var t;e=null!==(t=this.expressions[0].expression.fontStyle)&&void 0!==t?t:FontStyles.Regular}return e}},{key:"addExpression",value:function(e,t){e instanceof InstantaneousDynamicExpression?(this.instantaneousDynamic&&this.removeExpressionFromEntryList(this.InstantaneousDynamic),this.instantaneousDynamic=e,this.instantaneousDynamic.ParentMultiExpression=this):e instanceof ContinuousDynamicExpression?this.startingContinuousDynamic=e:e instanceof MoodExpression?this.moodList.push(e):e instanceof UnknownExpression&&this.unknownList.push(e),this.addExpressionToEntryList(e,t)}},{key:"CompareTo",value:function(e){return this.Timestamp.RealValue>e.Timestamp.RealValue?1:this.Timestamp.RealValue=ContinuousTempoType.allargando&&e<=ContinuousTempoType.ritenuto}}]),n}(AbstractTempoExpression),ContinuousTempoExpression=_ContinuousTempoExpression;ContinuousTempoExpression.listContinuousTempoFaster=["accelerando","piu mosso","poco piu","stretto"],ContinuousTempoExpression.listContinuousTempoSlower=["poco meno","meno mosso","piu lento","rallentando","ritardando","ritenuto","ritard.","ritard","riten.","riten"];var ContinuousTempoType=function(e){return e[e.accelerando=0]="accelerando",e[e.stretto=1]="stretto",e[e.stringendo=2]="stringendo",e[e.mosso=3]="mosso",e[e.piuMosso=4]="piuMosso",e[e.allargando=5]="allargando",e[e.calando=6]="calando",e[e.menoMosso=7]="menoMosso",e[e.rallentando=8]="rallentando",e[e.ritardando=9]="ritardando",e[e.ritard=10]="ritard",e[e.rit=11]="rit",e[e.ritenuto=12]="ritenuto",e[e.rubato=13]="rubato",e[e.precipitando=14]="precipitando",e}(ContinuousTempoType||{}),MultiTempoExpression=function(){function e(t,n){_classCallCheck2(this,e),this.expressions=[],this.sourceMeasure=t,this.timestamp=n}return _createClass2(e,[{key:"Timestamp",get:function(){return this.timestamp}},{key:"AbsoluteTimestamp",get:function(){return Fraction$1.plus(this.sourceMeasure.AbsoluteTimestamp,this.timestamp)}},{key:"SourceMeasureParent",get:function(){return this.sourceMeasure},set:function(e){this.sourceMeasure=e}},{key:"InstantaneousTempo",get:function(){return this.instantaneousTempo}},{key:"ContinuousTempo",get:function(){return this.continuousTempo}},{key:"EntriesList",get:function(){return this.expressions}},{key:"CombinedExpressionsText",get:function(){return this.combinedExpressionsText},set:function(e){this.combinedExpressionsText=e}},{key:"getPlacementOfFirstEntry",value:function(){var e=PlacementEnum.Above;return this.expressions.length>0&&(this.expressions[0].Expression instanceof InstantaneousTempoExpression||this.expressions[0].Expression instanceof ContinuousTempoExpression)&&(e=this.expressions[0].Expression.Placement),e}},{key:"getFontstyleOfFirstEntry",value:function(){var e=FontStyles.Regular;return this.expressions[0].Expression instanceof InstantaneousTempoExpression?e=FontStyles.Bold:this.expressions[0].Expression instanceof ContinuousTempoExpression&&(e=FontStyles.Italic),e}},{key:"addExpression",value:function(e,t){if(!this.checkIfAlreadyExists(e)){e instanceof InstantaneousTempoExpression?this.instantaneousTempo=e:e instanceof ContinuousTempoExpression&&(this.continuousTempo=e);var n=new TempoExpressionEntry;n.prefix=t,n.Expression=e,n.label=e.Label,this.expressions.push(n)}}},{key:"CompareTo",value:function(e){return this.Timestamp.RealValue>e.Timestamp.RealValue?1:this.Timestamp.RealValue0){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}},{key:"calculateSystemYLayout",value:function(){var e,t=_createForOfIteratorHelper(this.musicSystems);try{for(t.s();!(e=t.n()).done;){var n=e.value;this.optimizeDistanceBetweenStaffLines(n)}}catch(err){t.e(err)}finally{t.f()}this.calculateMusicSystemsRelativePositions()}},{key:"setMeasureWidth",value:function(e,t,n,i){for(var r=0,a=e.length;r0&&(s.beginInstructionsWidth=n),i>0&&(s.endInstructionsWidth=i)}}},{key:"finalizeCurrentAndCreateNewSystem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.finalizeCurrentSystem(e,t,n,i),this.currentSystemParams=new SystemBuildParameters,void 0!==e&&this.measureListIndex1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.currentSystemParams.currentSystem.breaksPage=i,this.adaptRepetitionLineWithIfNeeded(),void 0!==e&&n&&this.checkAndCreateExtraInstructionMeasure(e),this.stretchMusicSystem(t)}},{key:"adaptRepetitionLineWithIfNeeded",value:function(){var e=this.currentSystemParams.systemMeasures;if(e.length>=1){var t=this.currentSystemParams.currentSystem.GraphicalMeasures[this.currentSystemParams.currentSystem.GraphicalMeasures.length-1],n=0,i=e[e.length-1];i.endLine===SystemLinesEnum.DotsBoldBoldDots&&(i.endLine=SystemLinesEnum.DotsThinBold,n=t[0].getLineWidth(SystemLinesEnum.DotsBoldBoldDots)/2-t[0].getLineWidth(SystemLinesEnum.DotsThinBold)),this.currentSystemParams.currentSystemFixWidth-=n;for(var r=0,a=t.length;r1){h=!0;break}}for(var p=0,m=0;m=0&&this.measureList[g]){var y,b=null===(y=this.measureList[g][0])||void 0===y?void 0:y.parentSourceMeasure;null!=b&&b.ImplicitMeasure&&null!=b&&b.RhythmPrinted&&(v=!1)}v&&(t.addRhythmAtBegin(l),t.parentSourceMeasure.RhythmPrinted=l,p=!0)}return(f||d||p)&&(a+=t.beginInstructionsWidth,p&&(a+=this.rules.RhythmRightMargin)),a}},{key:"addInstructionsAtMeasureEnd",value:function(e,t,n){if(!e||!e.Instructions||0===e.Instructions.length)return 0;for(var i=0,r=e.Instructions.length;i0&&(this.currentSystemParams.systemMeasures.push({beginLine:SystemLinesEnum.None,endLine:SystemLinesEnum.None}),this.currentSystemParams.currentWidth+=s,this.currentSystemParams.currentSystemFixWidth+=s)}},{key:"addExtraInstructionMeasure",value:function(e,t,n){var i=this.currentSystemParams.currentSystem,r=MusicSheetCalculator.symbolFactory.createExtraGraphicalMeasure(i.StaffLines[e]);t&&r.addKeyAtBegin(t,this.activeKeys[e],this.activeClefs[e]),void 0!==n&&n.PrintObject&&r.addRhythmAtBegin(n),r.PositionAndShape.BorderLeft=0,r.PositionAndShape.BorderTop=0,r.PositionAndShape.BorderBottom=this.rules.StaffHeight;var a=this.rules.MeasureLeftMargin+r.beginInstructionsWidth+this.rules.MeasureRightMargin;return r.PositionAndShape.BorderRight=a,i.StaffLines[e].Measures.push(r),a}},{key:"addStaveMeasuresToSystem",value:function(e){if(e[0]){for(var t=[],n=0;n1){var t=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,e.measureListIndex+e.multipleRestMeasures-1);e=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[t]}}finally{}var n,i,r=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures,a=r[this.measureListIndex],s=!1;a.allRests&&(s=null===(n=r[this.measureListIndex+a.multipleRestMeasures-1])||void 0===n||null===(i=n.endsWithLineRepetition)||void 0===i?void 0:i.call(n));return this.nextMeasureBeginsLineRepetition()&&this.thisMeasureEndsLineRepetition()?SystemLinesEnum.DotsBoldBoldDots:this.thisMeasureEndsLineRepetition()||s?SystemLinesEnum.DotsThinBold:this.nextMeasureHasKeyInstructionChange()||this.thisMeasureEndsWordRepetition()||this.nextMeasureBeginsWordRepetition()?SystemLinesEnum.DoubleThin:e&&void 0!==e.endingBarStyleEnum?e.endingBarStyleEnum:SystemLinesEnum.SingleThin}},{key:"getLineWidth",value:function(e,t,n){var i=e.getLineWidth(t);return t===SystemLinesEnum.DotsBoldBoldDots&&(i/=2),n&&t===SystemLinesEnum.BoldThinDots&&(i+=this.rules.DistanceBetweenLastInstructionAndRepetitionBarline),i}},{key:"previousMeasureEndsLineRepetition",value:function(){if(0===this.measureListIndex)return!1;for(var e=0,t=this.measureList[this.measureListIndex-1].length;e=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length||!this.measureList[e])return!1;for(var t=0,n=this.measureList[e].length;t=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length||e>this.measureList.length-1)return!1;for(var t=0,n=this.measureList[e].length;t1)for(var a=1;ar&&(r=l)}for(var u=0;uthis.rules.PageHeight-this.rules.PageBottomMargin&&++i<=4&&console.log("warning: could not fit a single system on page ".concat(e.PageNumber," and measure number ").concat(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{var h,f,d=this.musicSystems[u-1],p=d.StaffLines[d.StaffLines.length-1],m=p.PositionAndShape,v=this.findRequiredDistanceWithSkyBottomLine(d,n);v=Math.max(r,v),v+=this.rules.MinSkyBottomDistBetweenSystems,"GYM"===(null===(h=window)||void 0===h||null===(f=h.appName)||void 0===f?void 0:f.toLocaleUpperCase())&&(v=v<16?16:v);var g=this.hasExpressionCounts(n);g.TempoCount>0&&this.rules.MetronomeMarksDrawn&&(v+=2),g.OtherCount>0&&this.rules.MetronomeMarksDrawn&&(v+=2),v=Math.max(v,this.rules.MinimumDistanceBetweenSystems+p.StaffHeight);var y=t+m.RelativePosition.y+v,b=y+n.PositionAndShape.BorderMarginBottom;if(this.rules.NewPageAtXMLNewPageAttribute&&d.breaksPage||!(b0&&console.log("total amount of pages that couldn't fit a single music system: ".concat(i," of ").concat(e.PageNumber))}},{key:"findRequiredDistanceWithSkyBottomLine",value:function(e,t){for(var n=e.StaffLines[e.StaffLines.length-1],i=t.StaffLines[0],r=n.BottomLine,a=i.SkyLine,s=n.PositionAndShape,o=i.PositionAndShape,l=1/this.rules.SamplingUnit,u=0,c=0;c=a.length)break;for(var d=Math.max(0,f-6),p=Math.min(a.length-1,f+6),m=0,v=d;v<=p;v++)m=Math.min(m,a[v]);var g=h-m;u=Math.max(g,u)}}return 0===u&&(u=s.BorderBottom-o.BorderTop),u}}]),e}(),SystemBuildParameters=function(){function e(){_classCallCheck2(this,e),this.systemMeasures=[],this.systemMeasureIndex=0,this.currentWidth=0,this.currentSystemFixWidth=0,this.currentSystemVarWidth=0,this.maxLabelLength=0}return _createClass2(e,[{key:"IsSystemStartMeasure",value:function(){return 0===this.systemMeasureIndex}}]),e}(),OctaveShiftParams=_createClass2((function e(t,n,i){_classCallCheck2(this,e),this.getOpenOctaveShift=t,this.getAbsoluteStartTimestamp=n,this.getAbsoluteEndTimestamp=i})),AccidentalCalculator=function(){function e(){_classCallCheck2(this,e),this.keySignatureNoteAlterationsDict=new Dictionary,this.currentAlterationsComparedToKeyInstructionList=[],this.currentInMeasureNoteAlterationsDict=new Dictionary}return _createClass2(e,[{key:"ActiveKeyInstruction",get:function(){return this.activeKeyInstruction},set:function(e){this.activeKeyInstruction=e,this.reactOnKeyInstructionChange()}},{key:"doCalculationsAtEndOfMeasure",value:function(){this.currentInMeasureNoteAlterationsDict.clear(),this.currentAlterationsComparedToKeyInstructionList.clear();var e,t=_createForOfIteratorHelper(this.keySignatureNoteAlterationsDict.keys());try{for(t.s();!(e=t.n()).done;){var n=e.value;this.currentInMeasureNoteAlterationsDict.setValue(n,this.keySignatureNoteAlterationsDict.getValue(n))}}catch(err){t.e(err)}finally{t.f()}}},{key:"checkAccidental",value:function(e,t){if(t){var n=t.FundamentalNote+12*t.Octave,i=this.currentAlterationsComparedToKeyInstructionList.indexOf(n)>=0;if(this.currentInMeasureNoteAlterationsDict.containsKey(n)){if(i&&this.currentAlterationsComparedToKeyInstructionList.splice(this.currentAlterationsComparedToKeyInstructionList.indexOf(n),1),this.currentInMeasureNoteAlterationsDict.getValue(n)!==t.AccidentalHalfTones){this.keySignatureNoteAlterationsDict.containsKey(n)&&this.keySignatureNoteAlterationsDict.getValue(n)!==t.AccidentalHalfTones?(this.currentAlterationsComparedToKeyInstructionList.push(n),this.currentInMeasureNoteAlterationsDict.setValue(n,t.AccidentalHalfTones)):t.Accidental!==AccidentalEnum.NONE&&this.currentInMeasureNoteAlterationsDict.remove(n);var r=this.currentInMeasureNoteAlterationsDict.getValue(n);if(t.Accidental===AccidentalEnum.NONE&&(t=.5===Math.abs(r)?new Pitch(t.FundamentalNote,t.Octave,AccidentalEnum.NONE):new Pitch(t.FundamentalNote,t.Octave,AccidentalEnum.NATURAL)),this.isAlterAmbiguousAccidental(t.Accidental)&&!t.AccidentalXml)return;MusicSheetCalculator.symbolFactory.addGraphicalAccidental(e,t)}}else if(t.Accidental!==AccidentalEnum.NONE){if(i||this.currentAlterationsComparedToKeyInstructionList.push(n),this.currentInMeasureNoteAlterationsDict.setValue(n,t.AccidentalHalfTones),this.isAlterAmbiguousAccidental(t.Accidental)&&!t.AccidentalXml)return;MusicSheetCalculator.symbolFactory.addGraphicalAccidental(e,t)}else i&&(t=new Pitch(t.FundamentalNote,t.Octave,AccidentalEnum.NATURAL),this.currentAlterationsComparedToKeyInstructionList.splice(this.currentAlterationsComparedToKeyInstructionList.indexOf(n),1),MusicSheetCalculator.symbolFactory.addGraphicalAccidental(e,t))}}},{key:"isAlterAmbiguousAccidental",value:function(e){return e===AccidentalEnum.SLASHFLAT||e===AccidentalEnum.QUARTERTONEFLAT}},{key:"reactOnKeyInstructionChange",value:function(){var e,t=this.activeKeyInstruction.AlteratedNotes;e=this.activeKeyInstruction.Key>0?AccidentalEnum.SHARP:AccidentalEnum.FLAT,this.keySignatureNoteAlterationsDict.clear(),this.currentAlterationsComparedToKeyInstructionList.length=0;for(var n=-9;n<9;n++)for(var i=0;i0)n=i-1,e.push({startIndex:t,endIndex:n}),t=i;else l.HasEndLine&&this.rules.NewPartAndSystemAfterFinalBarline&&(n=i,e.push({startIndex:t,endIndex:n}),t=i+1)}}tL&&D%2==0?(h.push(D),B=z,D=1):D++:B>L?(h.push(D),B=z,D=1):D++,F===(U=z>L?V+1:Math.ceil(U))?O+=1:(c.push(O),F=U,O=1)}}c.push(O),h.push(D),h=h.filter(Boolean),console.log(h,c)}return this.buildPreparedMusicSystems(h)}},{key:"buildPreparedMusicSystems",value:function(e){var t=!1;this.currentSystemParams=new SystemBuildParameters,this.currentSystemParams.currentSystem=this.initMusicSystem();for(var n=0,i=this.measureList.length;n0&&this.rules.RenderMultipleRestMeasures){c.isReducedToMultiRest=!0,c.multipleRestMeasureNumber=1;var f=c.multipleRestMeasures-1;l+=f;for(var d=1;d<=f;d++){var p=e.SourceMeasures[c.MeasureNumber-1+d];p.multipleRestMeasureNumber=d+1,p.isReducedToMultiRest=!0,t.push([void 0])}}}if(this.rules.AutoGenerateMutipleRestMeasuresFromRestMeasures&&this.rules.RenderMultipleRestMeasures){for(var m=void 0,v=0,g=0,y=e.SourceMeasures.length;g0){m.isReducedToMultiRest=!0,m.multipleRestMeasureNumber=1,v++,b.multipleRestMeasureNumber=v,b.isReducedToMultiRest=!0;for(var _=0;_1){m.multipleRestMeasures=v;var S=this.createGraphicalMeasuresForSourceMeasure(m,n,r,s,i);t[m.measureListIndex]=S,v=0,m=void 0}else v=0,m=void 0}if(v>1){m.multipleRestMeasures=v,m.isReducedToMultiRest=!0;var x=this.createGraphicalMeasuresForSourceMeasure(m,n,r,s,i);t[m.measureListIndex]=x,v=0,m=void 0}}var w=i.map((function(e){return e.ClefType===ClefEnum.percussion}));this.handleStaffEntries(w),this.calculateVerticalContainersList(),this.setIndicesToVerticalGraphicalContainers()}},{key:"calculate",value:function(){this.musicSystems=[],this.clearSystemsAndMeasures(),this.clearRecreatedObjects(),this.createGraphicalTies(),this.calculateSheetLabelBoundingBoxes(),this.calculateXLayout(this.graphicalMusicSheet,this.maxInstrNameLabelLength()),this.graphicalMusicSheet.MusicPages.length=0,this.calculateMusicSystems(),GraphicalMusicSheet.transformRelativeToAbsolutePosition(this.graphicalMusicSheet)}},{key:"calculateXLayout",value:function(t,n){var i=0,r=this.rules.MaxInstructionsConstValue;if(this.graphicalMusicSheet.MeasureList.length>0){var a=this.graphicalMusicSheet.MeasureList[0],s=this.calculateMeasureXLayout(a);s=this.calculateMeasureWidthFromStaffEntries(a,s),e.setMeasuresMinStaffEntriesWidth(a,s),i=1.2*s+n+r;for(var o=1;o0)return;var a=t.Measures[r];0!==a.MeasureNumber&&1!==a.MeasureNumber||(n=a.MeasureNumber),i=a!==t.Measures[0]&&this.rules.MeasureNumberLabelXOffset?this.rules.MeasureNumberLabelXOffset:0;var s=this.rules.UseXMLMeasureNumbers&&1===a.MeasureNumber&&1!==a.parentSourceMeasure.getPrintedMeasureNumber();((a.MeasureNumber===n||a.MeasureNumber>=n+this.rules.MeasureNumberLabelOffset)&&!a.parentSourceMeasure.ImplicitMeasure||s)&&((1!==a.MeasureNumber||1===a.MeasureNumber&&a!==t.Measures[0]||s)&&this.calculateSingleMeasureNumberPlacement(a,t,e,i),n=a.MeasureNumber)}else log$2.warn("calculateMeasureNumberPlacement: measure undefined for system.Id "+e.Id)}},{key:"calculateSingleMeasureNumberPlacement",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=e.parentSourceMeasure.getPrintedMeasureNumber().toString(),a=new Label(r),s=new GraphicalLabel(a,this.rules.MeasureNumberLabelHeight,TextAlignmentEnum.LeftBottom,this.rules),o=t.SkyBottomLineCalculator;s.setLabelPositionAndShapeBorders(),s.PositionAndShape.Parent=n.PositionAndShape;var l,u=t.PositionAndShape.RelativePosition.x+e.PositionAndShape.RelativePosition.x-s.PositionAndShape.BorderMarginLeft+i,c=u,h=u-s.PositionAndShape.BorderLeft+s.PositionAndShape.BorderRight,f=(c-=t.PositionAndShape.RelativePosition.x)+.5,d=(h-=t.PositionAndShape.RelativePosition.x)-.5,p=o.getSkyLineMinInRange(f,d);if(e===t.Measures[0]){var m=0;if(n.GroupBrackets.length>0){var v,g=_createForOfIteratorHelper(n.GroupBrackets);try{for(g.s();!(v=g.n()).done;){var y=v.value;m=Math.min(m,y.PositionAndShape.BorderTop)}}catch(err){g.e(err)}finally{g.f()}}l=Math.min(p,m)}else l=p;l=Math.min(0,l),s.PositionAndShape.RelativePosition=new PointF2D(u,l),n.MeasureNumberLabels.push(s)}},{key:"calculateMeasureNumberSkyline",value:function(e){var t,n=e.StaffLines[0],i=_createForOfIteratorHelper(e.MeasureNumberLabels);try{for(i.s();!(t=i.n()).done;){var r=t.value,a=r.PositionAndShape.RelativePosition.x,s=a-r.PositionAndShape.BorderLeft+r.PositionAndShape.BorderRight;a-=n.PositionAndShape.RelativePosition.x,s-=n.PositionAndShape.RelativePosition.x,n.SkyBottomLineCalculator.updateSkyLineInRange(a,s,r.PositionAndShape.RelativePosition.y+r.PositionAndShape.BorderMarginTop)}}catch(err){i.e(err)}finally{i.f()}}},{key:"layoutGraphicalTie",value:function(e,t,n){throw new Error(this.abstractNotImplementedErrorMessage)}},{key:"calculateSingleStaffLineLyricsPosition",value:function(e,t){for(var n=0,i=this.rules.StaffHeight,r=[],a=e.SkyBottomLineCalculator,s=e.Measures.length,o=0;o0){r.push(f),n=Math.max(n,f.LyricsEntries.length);for(var d=f.PositionAndShape.RelativePosition.x+u.x,p=Number.MAX_VALUE,m=Number.MIN_VALUE,v=0;v0){var M=e.PositionAndShape.Size.width,I=r[0].PositionAndShape.RelativePosition.x+r[0].PositionAndShape.BorderMarginLeft+r[0].parentMeasure.PositionAndShape.RelativePosition.x;I=I>M?M:I,a.updateBottomLineInRange(I,M,b)}return r}},{key:"calculateLyricsExtendsAndDashes",value:function(e){for(var t=0,n=e.length;t0||e.UnknownList.length>0){for(var s,o="",l=0,u=e.EntriesList.length;le.length-1&&(log$2.debug("minimum measure to draw index out of range. resetting min measure index to limit."),this.rules.MinMeasureToDrawIndex=e.length-1);for(var t=[],n=this.rules.MinMeasureToDrawIndex,i=e.length;n0)&&(s=a.getSkyLineMinInRange(S,x));var w=0;0===g?(w+=this.rules.ChordSymbolYOffset,w+=.1):w+=this.rules.ChordSymbolYPadding,w*=-1;var k=y.GraphicalLabel;k.PositionAndShape.RelativePosition.y=s+w,k.setLabelPositionAndShapeBorders(),k.PositionAndShape.calculateBoundingBox(),a.updateSkyLineInRange(S,x,s+k.PositionAndShape.BorderMarginTop)}}}catch(err){m.e(err)}finally{m.f()}}}catch(err){f.e(err)}finally{f.f()}}}catch(err){i.e(err)}finally{i.f()}}}catch(err){t.e(err)}finally{t.f()}}},{key:"calculateAlignedChordSymbolsOffset",value:function(e,t){var n,i=Number.MAX_SAFE_INTEGER,r=_createForOfIteratorHelper(e);try{for(r.s();!(n=r.n()).done;){var a,s=n.value,o=_createForOfIteratorHelper(s.graphicalChordContainers);try{for(o.s();!(a=o.n()).done;){var l=a.value,u=s.PositionAndShape,c=l.PositionAndShape,h=c.BorderMarginLeft+u.AbsolutePosition.x,f=c.BorderMarginRight+u.AbsolutePosition.x;i=Math.min(i,t.getSkyLineMinInRange(h,f))}}catch(err){o.e(err)}finally{o.f()}}}catch(err){r.e(err)}finally{r.f()}return i}},{key:"layoutMeasureWithWholeRest",value:function(e,t,n){}},{key:"layoutBeams",value:function(e){}},{key:"layoutArticulationMarks",value:function(e,t,n){}},{key:"layoutOrnament",value:function(e,t,n){}},{key:"calculateRestNotePlacementWithinGraphicalBeam",value:function(e,t,n,i,r){}},{key:"calculateTupletNumbers",value:function(){}},{key:"calculateSlurs",value:function(){}},{key:"calculateDynamicExpressionsForMultiExpression",value:function(e,t,n){}},{key:"calculateGraphicalVerbalContinuousDynamic",value:function(e,t){var n,i=e.Label,r=t.x+i.PositionAndShape.BorderMarginLeft,a=t.x+i.PositionAndShape.BorderMarginRight,s=e.ContinuousDynamic.Placement,o=e.ParentStaffLine.SkyBottomLineCalculator;s===PlacementEnum.Below?(n=o.getBottomLineMaxInRange(r,a),i.PositionAndShape.RelativePosition=new PointF2D(t.x,n-i.PositionAndShape.BorderMarginTop)):(n=o.getSkyLineMinInRange(r,a),i.PositionAndShape.RelativePosition=new PointF2D(t.x,n-i.PositionAndShape.BorderMarginBottom))}},{key:"calculateGraphicalContinuousDynamic",value:function(e,t){var n,i,r=e.ParentStaffLine.ParentStaff.idInMusicSheet,a=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(e.ContinuousDynamic.EndMultiExpression.SourceMeasureParent,r);if(a){e.EndMeasure=a;var s=e.ParentStaffLine,o=a.ParentStaffLine,l=o&&s===o,u=!1;o?u=null==o?void 0:o.isPartOfMultiStaffInstrument():s&&(u=null==s?void 0:s.isPartOfMultiStaffInstrument());var c,h=Fraction$1.createFromFraction(e.ContinuousDynamic.EndMultiExpression.AbsoluteTimestamp),f=this.graphicalMusicSheet.GetVerticalContainerFromTimestamp(h),d=f.getFirstNonNullStaffEntry().parentMeasure,p=d.PositionAndShape.AbsolutePosition.x+d.PositionAndShape.BorderRight,m=new Fraction$1(0,0,0),v=_createForOfIteratorHelper(f.StaffEntries);try{for(v.s();!(c=v.n()).done;){var g,y=c.value,b=null==y||null===(g=y.sourceStaffEntry)||void 0===g?void 0:g.calculateMaxNoteLength();null!=b&&b.gt(m)&&(m=b)}}catch(err){v.e(err)}finally{v.f()}var _=this.getRelativePositionInStaffLineFromTimestamp(h,r,o,u,0),S=Fraction$1.plus(h,m),x=this.getRelativePositionInStaffLineFromTimestamp(S,r,o,u,0);x.x>_.x&&x.xE){var B=k.StaffLines[O].PositionAndShape.RelativePosition.y-s.PositionAndShape.RelativePosition.y-this.rules.StaffHeight;R=this.rules.StaffHeight+B/2}else R=this.rules.WedgePlacementBelowY;R-=this.rules.WedgeOpeningLength/2,l||(F=R);var D=T.getBottomLineMaxInRange(M,N);if(D>R&&(R=D),EF&&(F=D),F+=this.rules.WedgeOpeningLength/2,F+=this.rules.WedgeVerticalMargin),R+=this.rules.WedgeOpeningLength/2,R+=this.rules.WedgeVerticalMargin}else if(P===PlacementEnum.Above){if(1===s.ParentStaff.ParentInstrument.Staves.length)R=this.rules.WedgePlacementAboveY;else{var G=0;E>0&&(G=E-1);var z=k.StaffLines[G];R=-(s.PositionAndShape.RelativePosition.y-z.PositionAndShape.RelativePosition.y-this.rules.StaffHeight)/2}R+=this.rules.WedgeOpeningLength/2,l||(F=R);var H=T.getSkyLineMinInRange(M,N);if(H1&&E>0){var U=s.findClosestStaffEntry(M),j=s.findClosestStaffEntry(N);U&&j&&U.parentVerticalContainer}l||((H=o.SkyBottomLineCalculator.getSkyLineMinInRange(I,L))-c/2?-c/2:l-e.PositionAndShape.BorderMarginBottom}else o=l-e.PositionAndShape.BorderMarginBottom;e.PositionAndShape.RelativePosition=new PointF2D(t.x,o)}else if(e.Placement===PlacementEnum.Below){var h=s.getBottomLineMaxInRange(r,a),f=i.ParentStaff.ParentInstrument.Staves[i.ParentStaff.ParentInstrument.Staves.length-1];if(i.isPartOfMultiStaffInstrument()&&i.ParentStaff!==f){var d=i.ParentMusicSystem.StaffLines[i.ParentMusicSystem.StaffLines.indexOf(i)+1].PositionAndShape.RelativePosition.y-i.PositionAndShape.RelativePosition.y-this.rules.StaffHeight;o=h+e.PositionAndShape.BorderMarginBottom6&&void 0!==arguments[6]?arguments[6]:TextAlignmentEnum.CenterBottom,o=new Label(n,s);o.fontStyle=i,o.fontHeight=a;var l=new GraphicalLabel(o,a,o.textAlignment,this.rules,e.PositionAndShape),u=1.1;r===PlacementEnum.Below&&(l.Label.textAlignment=TextAlignmentEnum.LeftTop),l.setLabelPositionAndShapeBorders(),l.PositionAndShape.BorderMarginBottom*=u,l.PositionAndShape.BorderMarginTop*=u,l.PositionAndShape.BorderMarginLeft*=u,l.PositionAndShape.BorderMarginRight*=u;var c,h=t.x+l.PositionAndShape.BorderMarginLeft,f=t.x+l.PositionAndShape.BorderMarginRight;f>e.PositionAndShape.Size.width&&(h=(f=e.PositionAndShape.Size.width-this.rules.MeasureRightMargin)-l.PositionAndShape.MarginSize.width,t.x=h-l.PositionAndShape.BorderMarginLeft);var d=e.SkyBottomLineCalculator;return c=r===PlacementEnum.Below?d.getBottomLineMaxInRange(h,f):d.getSkyLineMinInRange(h,f),l.PositionAndShape.RelativePosition=new PointF2D(t.x,c),r===PlacementEnum.Below?d.updateBottomLineInRange(h,f,l.PositionAndShape.BorderMarginBottom+c):d.updateSkyLineInRange(h,f,l.PositionAndShape.BorderMarginTop+c),l}},{key:"calculateTempoExpressionsForMultiTempoExpression",value:function(e,t,n,i){metronomeMarks={};var r=Fraction$1.plus(e.AbsoluteTimestamp,t.Timestamp),a=this.graphicalMusicSheet.MeasureList[n],s=new PointF2D;if(t.ContinuousTempo||t.InstantaneousTempo){if(this.rules.MinMeasureToDrawIndex>0)return;if(!a[0])return;for(var o=a[0].ParentStaffLine,l=a[0].PositionAndShape.RelativePosition.x,u=0,c=0;c0){o=a[c].ParentStaffLine,l=a[c].PositionAndShape.RelativePosition.x,u=c;break}if(s=this.getRelativePositionInStaffLineFromTimestamp(r,u,o,o.isPartOfMultiStaffInstrument(),l),t.EntriesList.length>0&&t.EntriesList[0].Expression instanceof InstantaneousTempoExpression)if(t.EntriesList[0].Expression.Placement=PlacementEnum.Above,o.Measures[0].staffEntries.length>0&&0===Math.abs(s.x-o.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x)&&o.ParentMusicSystem===this.musicSystems[0]){var h=o.Measures[0].FirstInstructionStaffEntry;if(h){var f=h.GraphicalInstructions.last();s.x=f.PositionAndShape.RelativePosition.x}this.rules.CompactMode&&(s.x=o.PositionAndShape.RelativePosition.x+o.Measures[0].PositionAndShape.RelativePosition.x)}var d,p=_createForOfIteratorHelper(t.EntriesList);try{for(p.s();!(d=p.n()).done;){var m=d.value,v=TextAlignmentEnum.CenterBottom;this.rules.CompactMode&&(v=TextAlignmentEnum.LeftBottom);var g=this.calculateLabel(o,s,m.label,t.getFontstyleOfFirstEntry(),m.Expression.Placement,this.rules.UnknownTextHeight,v);if(m.Expression instanceof InstantaneousTempoExpression){var y,b=_createForOfIteratorHelper(o.AbstractExpressions);try{for(b.s();!(y=b.n()).done;){var _=y.value;_ instanceof GraphicalInstantaneousTempoExpression&&(_.SourceExpression.Label,m.Expression.Label)}}catch(err){b.e(err)}finally{b.f()}new GraphicalInstantaneousTempoExpression(m.Expression,g).ParentStaffLine||log$2.warn("Adding staffline didn't work"),m.Expression.Enum===TempoEnum.metronomeMark&&(metronomeMarks[n]=m.Expression)}else m.Expression;if(i===e.TempoExpressions.length-1)for(var S=0,x=Object.values(metronomeMarks);S-1&&h.PositionAndShape.ChildElements.splice(f,1),h.FirstInstructionStaffEntry=void 0,h.beginInstructionsWidth=0}if(h.LastInstructionStaffEntry){var d=h.PositionAndShape.ChildElements.indexOf(h.LastInstructionStaffEntry.PositionAndShape);d>-1&&h.PositionAndShape.ChildElements.splice(d,1),h.LastInstructionStaffEntry=void 0,h.endInstructionsWidth=0}}l.Measures=[],l.PositionAndShape.ChildElements=[]}a.StaffLines.length=0,a.PositionAndShape.ChildElements=[]}n.MusicSystems=[],n.PositionAndShape.ChildElements=[]}this.graphicalMusicSheet.MusicPages=[]}},{key:"handleVoiceEntry",value:function(t,n,i,r,a,s,o,l,u){var c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:void 0,h=arguments.length>10&&void 0!==arguments[10]?arguments[10]:void 0;t.StemDirectionXml!==StemDirectionType.Undefined&&this.rules.SetWantedStemDirectionByXml&&void 0!==t.StemDirectionXml?t.WantedStemDirection=t.StemDirectionXml:this.calculateStemDirectionFromVoices(t);var f=n.findOrCreateGraphicalVoiceEntry(t);f.octaveShiftValue=l;var d,p=n.tabStaffEntry;p&&(d=p.findOrCreateGraphicalVoiceEntry(t));for(var m=0,v=t.Notes.length;m-1)){var y=void 0;if(t.IsGrace?y=e.symbolFactory.createGraceNote(g,f,a,this.rules,l):(y=e.symbolFactory.createNote(g,f,a,l,this.rules,void 0),e.stafflineNoteCalculator.trackNote(y)),g.Pitch&&this.checkNoteForAccidental(y,i,a,l),this.resetYPositionForLeadSheet(y.PositionAndShape),n.addGraphicalNoteToListAtCorrectYPosition(f,y),y.PositionAndShape.calculateBoundingBox(),this.leadSheet||(void 0!==g.NoteBeam&&g.PrintObject&&this.handleBeam(y,g.NoteBeam,o),void 0!==g.NoteTuplet&&g.PrintObject&&this.handleTuplet(y,g.NoteTuplet,s)),d){var b=e.symbolFactory.createNote(g,d,a,l,this.rules,void 0);p.addGraphicalNoteToListAtCorrectYPosition(d,b),b.PositionAndShape.calculateBoundingBox(),this.leadSheet||g.NoteTuplet&&this.handleTuplet(b,g.NoteTuplet,s)}}}return t.Articulations.length>0&&this.handleVoiceEntryArticulations(t.Articulations,t,n),t.TechnicalInstructions.length>0&&this.handleVoiceEntryTechnicalInstructions(t.TechnicalInstructions,t,n),t.LyricsEntries.size()>0&&this.handleVoiceEntryLyrics(t,n,r),t.OrnamentContainer&&this.handleVoiceEntryOrnaments(t.OrnamentContainer,t,n),l}},{key:"resetYPositionForLeadSheet",value:function(e){this.leadSheet&&(e.RelativePosition=new PointF2D(e.RelativePosition.x,0))}},{key:"layoutVoiceEntries",value:function(e,t){if(e.PositionAndShape.RelativePosition=new PointF2D(0,0),!this.leadSheet){var n,i=_createForOfIteratorHelper(e.graphicalVoiceEntries);try{for(i.s();!(n=i.n()).done;){var r=n.value.notes;if(0!==r.length){var a=r[0].sourceNote.ParentVoiceEntry,s=void 0!==r[0].sourceNote.Pitch;this.layoutVoiceEntry(a,r,e,s)}}}catch(err){i.e(err)}finally{i.f()}}}},{key:"maxInstrNameLabelLength",value:function(){var e,t=0,n=_createForOfIteratorHelper(this.graphicalMusicSheet.ParentMusicSheet.Instruments);try{for(n.s();!(e=n.n()).done;){var i,r=e.value;if(null!==(i=r.NameLabel)&&void 0!==i&&i.print&&r.Voices.length>0&&r.Voices[0].Visible){var a=r.NameLabel;this.rules.RenderPartNames||(a=new Label("",a.textAlignment,a.font));var s=new GraphicalLabel(a,this.rules.InstrumentLabelTextHeight,TextAlignmentEnum.LeftCenter,this.rules);s.setLabelPositionAndShapeBorders(),t=Math.max(t,s.PositionAndShape.MarginSize.width)}}}catch(err){n.e(err)}finally{n.f()}return this.rules.RenderPartNames?t:0}},{key:"calculateSheetLabelBoundingBoxes",value:function(){var e,t=this.graphicalMusicSheet.ParentMusicSheet,n=this.rules.DefaultColorTitle;if(void 0!==t.Title&&this.rules.RenderTitle){var i=new GraphicalLabel(t.Title,this.rules.SheetTitleHeight,TextAlignmentEnum.CenterBottom,this.rules);i.Label.IsCreditLabel=!0,i.Label.colorDefault=n,this.graphicalMusicSheet.Title=i,i.setLabelPositionAndShapeBorders()}else this.rules.RenderTitle||(this.graphicalMusicSheet.Title=void 0);if(void 0!==t.Subtitle&&this.rules.RenderSubtitle){var r=new GraphicalLabel(t.Subtitle,this.rules.SheetSubtitleHeight,TextAlignmentEnum.CenterCenter,this.rules);r.Label.IsCreditLabel=!0,r.Label.colorDefault=n,this.graphicalMusicSheet.Subtitle=r,r.setLabelPositionAndShapeBorders()}else this.rules.RenderSubtitle||(this.graphicalMusicSheet.Subtitle=void 0);if(void 0!==t.Composer&&this.rules.RenderComposer){var a=new GraphicalLabel(t.Composer,this.rules.SheetComposerHeight,TextAlignmentEnum.RightCenter,this.rules);a.Label.IsCreditLabel=!0,a.Label.colorDefault=n,this.graphicalMusicSheet.Composer=a,a.setLabelPositionAndShapeBorders()}else this.rules.RenderComposer||(this.graphicalMusicSheet.Composer=void 0);if(void 0!==t.Lyricist&&this.rules.RenderLyricist){var s=new GraphicalLabel(t.Lyricist,this.rules.SheetAuthorHeight,TextAlignmentEnum.LeftCenter,this.rules);s.Label.IsCreditLabel=!0,s.Label.colorDefault=n,this.graphicalMusicSheet.Lyricist=s,s.setLabelPositionAndShapeBorders()}else this.rules.RenderLyricist||(this.graphicalMusicSheet.Lyricist=void 0);var o=null===(e=this.graphicalMusicSheet.musicSheet.sourceMeasures)||void 0===e?void 0:e[0];if(o&&o.FirstInstructionsStaffEntries.length>0){for(var l,u,c=o.FirstInstructionsStaffEntries[0],h=0,f=c.Instructions.length;h0&&1===u.graphicalVoiceEntries[0].notes.length){var c=u.graphicalVoiceEntries[0].notes[0];!c.sourceNote.Pitch&&new Fraction$1(1,2).lt(c.sourceNote.Length)&&this.layoutMeasureWithWholeRest(c,u,l)}}}}},{key:"optimizeRestNotePlacement",value:function(e,t){if(0!==e.graphicalVoiceEntries.length){var n=e.graphicalVoiceEntries[0].notes;if(0!==n.length){var i=n[0],r=i.sourceNote.isRest();if(2===e.graphicalVoiceEntries.length){var a=!1,s=e.graphicalVoiceEntries[1].notes;if(s.length>0)a=s[0].sourceNote.isRest();r&&a?this.calculateTwoRestNotesPlacementWithCollisionDetection(e):(r||a)&&this.calculateRestNotePlacementWithCollisionDetectionFromGraphicalNote(e)}else if(r&&e!==t.staffEntries[0]&&e!==t.staffEntries[t.staffEntries.length-1]){var o=t.staffEntries.indexOf(e),l=t.staffEntries[o-1],u=t.staffEntries[o+1];if(1===l.graphicalVoiceEntries.length){var c=l.graphicalVoiceEntries[0].notes[0];if(void 0!==c.sourceNote.NoteBeam&&1===u.graphicalVoiceEntries.length){var h=u.graphicalVoiceEntries[0].notes[0];void 0!==h.sourceNote.NoteBeam&&c.sourceNote.NoteBeam===h.sourceNote.NoteBeam&&(this.calculateRestNotePlacementWithinGraphicalBeam(e,i,c,u,h),e.PositionAndShape.calculateBoundingBox())}}}}}}},{key:"getRelativePositionInStaffLineFromTimestamp",value:function(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=new PointF2D,s=void 0,o=void 0,l=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length,u=this.graphicalMusicSheet.GetInterpolatedIndexInVerticalContainers(e),c=Math.min(Math.floor(u),l-1),h=Math.min(Math.ceil(u),l-1);if(c<0||t<0)return a;if(s=this.getFirstLeftNotNullStaffEntryFromContainer(c,t,i),o=this.getFirstRightNotNullStaffEntryFromContainer(h,t,i),s&&o){var f=s.parentMeasure.PositionAndShape.RelativePosition.x;r>0&&(f=r);var d=s.PositionAndShape.RelativePosition.x+f,p=o.PositionAndShape.RelativePosition.x+o.parentMeasure.PositionAndShape.RelativePosition.x;r>0&&(p=o.PositionAndShape.RelativePosition.x+f);var m=0;if(s!==o){var v=s.getAbsoluteTimestamp(),g=o.getAbsoluteTimestamp(),y=Fraction$1.minus(e,v);m=y.RealValue/Fraction$1.minus(g,v).RealValue}s.parentMeasure.ParentStaffLine!==o.parentMeasure.ParentStaffLine&&(s.parentMeasure.ParentStaffLine===n?p=n.PositionAndShape.Size.width:d=n.PositionAndShape.RelativePosition.x),a=new PointF2D(d+(p-d)*m,0)}return a}},{key:"getRelativeXPositionFromTimestamp",value:function(e){var t=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length,n=this.graphicalMusicSheet.GetInterpolatedIndexInVerticalContainers(e),i=Math.max(0,Math.min(Math.round(n),t-1)),r=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[i].getFirstNonNullStaffEntry();return r.PositionAndShape.RelativePosition.x+r.parentMeasure.PositionAndShape.RelativePosition.x}},{key:"calculatePageLabels",value:function(e){this.rules.RenderSingleHorizontalStaffline&&(e.PositionAndShape.BorderRight=e.PositionAndShape.Size.width,e.PositionAndShape.calculateBoundingBox(),this.graphicalMusicSheet.ParentMusicSheet.pageWidth=e.PositionAndShape.Size.width);var t=10;if(e.MusicSystems.length>0){var n=e.MusicSystems[0];t=n.PositionAndShape.RelativePosition.y+n.PositionAndShape.BorderTop}if(this.graphicalMusicSheet.Title){var i=this.graphicalMusicSheet.Title;i.PositionAndShape.Parent=e.PositionAndShape;var r=new PointF2D;r.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth/2,r.y=this.rules.TitleTopDistance+this.rules.SheetTitleHeight,i.PositionAndShape.RelativePosition=r,e.Labels.push(i)}if(this.graphicalMusicSheet.Subtitle){var a=this.graphicalMusicSheet.Subtitle;a.PositionAndShape.Parent=e.PositionAndShape;var s=new PointF2D;s.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth/2,s.y=this.rules.TitleTopDistance+this.rules.SheetTitleHeight+this.rules.SheetMinimumDistanceBetweenTitleAndSubtitle,a.PositionAndShape.RelativePosition=s,e.Labels.push(a)}var o,l=this.graphicalMusicSheet.Composer;if(l){var u;l.PositionAndShape.Parent=e.PositionAndShape,l.setLabelPositionAndShapeBorders();var c=new PointF2D;c.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth-this.rules.PageRightMargin,c.y=t,c.y-=this.rules.SystemComposerDistance;var h=null===(u=l.TextLines)||void 0===u?void 0:u.length;h>1&&(c.y-=l.PositionAndShape.BorderBottom*(h-1)/h),o=c.y,l.PositionAndShape.RelativePosition=c,e.Labels.push(l)}var f=this.graphicalMusicSheet.Lyricist;if(f){var d;f.PositionAndShape.Parent=e.PositionAndShape,f.setLabelPositionAndShapeBorders();var p=new PointF2D;p.x=this.rules.PageLeftMargin,p.y=t,p.y+=f.PositionAndShape.BorderBottom,p.y=Math.min(p.y,null!==(d=o)&&void 0!==d?d:Number.MAX_SAFE_INTEGER),f.PositionAndShape.RelativePosition=p,e.Labels.push(f)}}},{key:"createGraphicalTies",value:function(){for(var e=0;e=0&&this.staffEntriesWithGraphicalTies.push(r)}r=s}}}},{key:"setTieDirections",value:function(e){if(e){var t=e.ties;if(t.length>1){var n,i=void 0,r=_createForOfIteratorHelper(t);try{for(r.s();!(n=r.n()).done;){var a=n.value.Notes[0];(!i||a.Pitch.getHalfTone()>i.Pitch.getHalfTone())&&(i=a)}}catch(err){r.e(err)}finally{r.f()}var s,o=_createForOfIteratorHelper(t);try{for(o.s();!(s=o.n()).done;){var l=s.value;l.TieDirection===PlacementEnum.NotYetDefined&&(l.Notes[0]===i?l.TieDirection=PlacementEnum.Above:l.TieDirection=PlacementEnum.Below)}}catch(err){o.e(err)}finally{o.f()}}}}},{key:"createAccidentalCalculators",value:function(){var e=[],t=this.graphicalMusicSheet.ParentMusicSheet.getFirstSourceMeasure();if(t)for(var n=0;n1)return;h=e.symbolFactory.createGraphicalMeasure(t,c)}if(h.hasError=t.getErrorInMeasure(l),t.FirstInstructionsStaffEntries[l])for(var f=0,d=t.FirstInstructionsStaffEntries[l].Instructions.length;f0){var H=E.Instructions[0];e.symbolFactory.createInStaffClef(M,H)}this.rules.RenderChordSymbols&&(null===(T=E.ChordContainers)||void 0===T?void 0:T.length)>0&&(E.ParentStaff.ParentInstrument.HasChordSymbols=!0,e.symbolFactory.createChordSymbols(E,M,r.ActiveKeyInstruction,this.graphicalMusicSheet.ParentMusicSheet.Transpose))}}if(r.doCalculationsAtEndOfMeasure(),t.LastInstructionsStaffEntries[l])for(var U=t.LastInstructionsStaffEntries[l],j=0,W=U.Instructions.length;j=1&&0===h.staffEntries.length){var ne=new SourceStaffEntry(new VerticalSourceStaffEntryContainer(h.parentSourceMeasure,h.parentSourceMeasure.AbsoluteTimestamp,h.parentSourceMeasure.CompleteNumberOfStaves),c),ie=new VoiceEntry(new Fraction$1(0,1),c.Voices[0],ne),re=new Note$1(ie,ne,Fraction$1.createFromFraction(t.Duration),void 0,t);re.PrintObject=this.rules.FillEmptyMeasuresWithWholeRest===FillEmptyMeasuresWithWholeRests.YesVisible,ie.addNote(re);var ae=e.symbolFactory.createStaffEntry(ne,h);h.addGraphicalStaffEntry(ae),ae.relInMeasureTimestamp=ie.Timestamp;var se=e.symbolFactory.createVoiceEntry(ie,ae);ae.graphicalVoiceEntries.push(se);var oe=e.symbolFactory.createNote(re,se,new ClefInstruction,OctaveEnum.NONE,void 0);e.stafflineNoteCalculator.trackNote(oe),se.notes.push(oe)}h.hasOnlyRests=!0;var le,ue=_createForOfIteratorHelper(h.staffEntries);try{for(ue.s();!(le=ue.n()).done;){var ce=le.value;if(h.hasOnlyRests=ce.hasOnlyRests(),!h.hasOnlyRests)break}}catch(err){ue.e(err)}finally{ue.f()}return h}},{key:"checkNoteForAccidental",value:function(e,t,n,i){var r=e.sourceNote.Pitch,a=e.parentVoiceEntry.parentStaffEntry.parentMeasure.getTransposedHalftones();0!==a&&e.sourceNote.ParentStaffEntry.ParentStaff.ParentInstrument.MidiInstrumentId!==MidiInstrument.Percussion&&(r=e.Transpose(t.ActiveKeyInstruction,n,a,i),e.sourceNote.TransposedPitch=r),e.sourceNote.halfTone=r.getHalfTone(),t.checkAccidental(e,r)}},{key:"handleStaffEntries",value:function(t){for(var n=0,i=this.graphicalMusicSheet.MeasureList.length;n0&&c.graphicalVoiceEntries[0].notes.length>0&&(this.layoutVoiceEntries(c,a),this.layoutStaffEntry(c))}}catch(err){u.e(err)}finally{u.f()}this.graphicalMeasureCreatedCalculations(o)}}}},{key:"calculateSkyBottomLines",value:function(){var e,t=_createForOfIteratorHelper(this.musicSystems);try{for(t.s();!(e=t.n()).done;){var n,i=_createForOfIteratorHelper(e.value.StaffLines);try{for(i.s();!(n=i.n()).done;){n.value.SkyBottomLineCalculator.calculateLines()}}catch(err){i.e(err)}finally{i.f()}}}catch(err){t.e(err)}finally{t.f()}}},{key:"calculateExpressionAlignements",value:function(){}},{key:"calculateStaffEntryArticulationMarks",value:function(){for(var e=0,t=this.musicSystems.length;e0&&this.layoutArticulationMarks(p.Articulations,p,h)}}},{key:"calculateOrnaments",value:function(){for(var e=0,t=this.musicSystems.length;e0&&i.LyricVersesNumbers.sort()}for(var r=0,a=this.musicSystems.length;r=0&&(i=t.GraphicalLyricsEntries[n+1]),i){var r=e.StaffEntryParent.parentMeasure.ParentStaffLine,a=i.StaffEntryParent.parentMeasure.ParentStaffLine,s=e.StaffEntryParent,o=i.StaffEntryParent;if(e.StaffEntryParent.parentMeasure.ParentStaffLine===i.StaffEntryParent.parentMeasure.ParentStaffLine){var l=s.parentMeasure.PositionAndShape.RelativePosition.x+s.PositionAndShape.RelativePosition.x+e.GraphicalLabel.PositionAndShape.RelativePosition.x+e.GraphicalLabel.PositionAndShape.BorderMarginRight,u=o.parentMeasure.PositionAndShape.RelativePosition.x+o.PositionAndShape.RelativePosition.x+e.GraphicalLabel.PositionAndShape.RelativePosition.x+i.GraphicalLabel.PositionAndShape.BorderMarginLeft,c=e.GraphicalLabel.PositionAndShape.RelativePosition.y,h=1;u-l>3*this.rules.MinimumDistanceBetweenDashes&&(h=Math.floor((u-l)/this.rules.MinimumDistanceBetweenDashes)-1),1===h?this.calculateSingleDashForLyricWord(r,l,u,c):this.calculateDashes(r,l,u,c)}else{var f=s.parentMeasure.PositionAndShape.RelativePosition.x+s.PositionAndShape.RelativePosition.x+e.GraphicalLabel.PositionAndShape.BorderMarginRight,d=r.Measures[r.Measures.length-1],p=d.PositionAndShape.RelativePosition.x+d.PositionAndShape.Size.width,m=e.GraphicalLabel.PositionAndShape.RelativePosition.y;if(this.calculateDashes(r,f,p,m),a&&a.Measures[0]&&o.parentMeasure.ParentStaffLine&&(o!==o.parentMeasure.staffEntries[0]||o.parentMeasure!==o.parentMeasure.ParentStaffLine.Measures[0])){var v=a.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x,g=o.parentMeasure.PositionAndShape.RelativePosition.x+o.PositionAndShape.RelativePosition.x+i.GraphicalLabel.PositionAndShape.BorderMarginLeft;m=i.GraphicalLabel.PositionAndShape.RelativePosition.y,this.calculateDashes(a,v,g,m)}}}}},{key:"calculateDashes",value:function(e,t,n,i){var r=n-t;if(r<3*this.rules.MinimumDistanceBetweenDashes)this.calculateSingleDashForLyricWord(e,t,n,i);else{var a=Math.floor(r/this.rules.MinimumDistanceBetweenDashes)-1,s=r/(a+1),o=0;for(t+=s,n-=s;o<=Math.floor(a/2)&&n>t;)r=this.calculateRightAndLeftDashesForLyricWord(e,t,n,i),t+=s,n-=s,o++;r>2*s&&this.calculateSingleDashForLyricWord(e,t,n,i)}}},{key:"calculateSingleDashForLyricWord",value:function(e,t,n,i){var r=new Label("-"),a=new GraphicalLabel(r,this.rules.LyricsHeight,TextAlignmentEnum.CenterBottom,this.rules);a.setLabelPositionAndShapeBorders(),e.LyricsDashes.push(a),-1===this.staffLinesWithLyricWords.indexOf(e)&&this.staffLinesWithLyricWords.push(e),a.PositionAndShape.Parent=e.PositionAndShape;var s=new PointF2D(t+(n-t)/2,i);a.PositionAndShape.RelativePosition=s}},{key:"calculateLyricExtend",value:function(e){for(var t=e.GraphicalLabel.PositionAndShape.RelativePosition.y,n=e.StaffEntryParent,i=n.parentMeasure.ParentStaffLine,r=void 0,a=void 0,s=n.parentMeasure.ParentStaff.idInMusicSheet,o=n.parentVerticalContainer.Index+1;o0)break;(a=(r=l).parentMeasure.ParentStaffLine)||(a=n.parentMeasure.ParentStaffLine)}}if(r&&a)if(i===a&&r.parentMeasure.ParentStaffLine){var u=n.parentMeasure.PositionAndShape.RelativePosition.x+n.PositionAndShape.RelativePosition.x+e.GraphicalLabel.PositionAndShape.BorderMarginRight,c=r.parentMeasure.PositionAndShape.RelativePosition.x+r.PositionAndShape.RelativePosition.x+r.PositionAndShape.BorderMarginRight;t-=e.GraphicalLabel.PositionAndShape.Size.height/4,this.calculateSingleLyricWordWithUnderscore(i,u,c,t)}else{var h=i.Measures[i.Measures.length-1].PositionAndShape,f=n.parentMeasure.PositionAndShape.RelativePosition.x+n.PositionAndShape.RelativePosition.x+e.GraphicalLabel.PositionAndShape.BorderMarginRight,d=h.RelativePosition.x+h.Size.width;if(t-=e.GraphicalLabel.PositionAndShape.Size.height/4,this.calculateSingleLyricWordWithUnderscore(i,f,d,t),!r)return;if(r.parentMeasure.ParentStaffLine&&r.parentMeasure.staffEntries&&(r!==r.parentMeasure.staffEntries[0]||r.parentMeasure!==r.parentMeasure.ParentStaffLine.Measures[0])){var p=a.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x,m=r.parentMeasure.PositionAndShape.RelativePosition.x+r.PositionAndShape.RelativePosition.x+r.PositionAndShape.BorderMarginRight;this.calculateSingleLyricWordWithUnderscore(a,p,m,t)}}}},{key:"calculateSingleLyricWordWithUnderscore",value:function(e,t,n,i){var r=new PointF2D(t,i),a=new PointF2D(n,i),s=new GraphicalLine(r,a,this.rules.LyricUnderscoreLineWidth);e.LyricLines.push(s),-1===this.staffLinesWithLyricWords.indexOf(e)&&this.staffLinesWithLyricWords.push(e)}},{key:"calculateRightAndLeftDashesForLyricWord",value:function(e,t,n,i){var r=new Label("-"),a=new GraphicalLabel(r,this.rules.LyricsHeight,TextAlignmentEnum.CenterBottom,this.rules);a.setLabelPositionAndShapeBorders(),e.LyricsDashes.push(a),-1===this.staffLinesWithLyricWords.indexOf(e)&&this.staffLinesWithLyricWords.push(e),a.PositionAndShape.Parent=e.PositionAndShape;var s=new PointF2D(t,i);a.PositionAndShape.RelativePosition=s;var o=new Label("-"),l=new GraphicalLabel(o,this.rules.LyricsHeight,TextAlignmentEnum.CenterBottom,this.rules);l.setLabelPositionAndShapeBorders(),e.LyricsDashes.push(l),l.PositionAndShape.Parent=e.PositionAndShape;var u=new PointF2D(n,i);return l.PositionAndShape.RelativePosition=u,l.PositionAndShape.RelativePosition.x-a.PositionAndShape.RelativePosition.x}},{key:"calculateDynamicExpressions",value:function(){for(var e=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,this.rules.MaxMeasureToDrawIndex),t=Math.min(this.rules.MinMeasureToDrawIndex,this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length);t<=e;t++){var n=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[t];this.dynamicExpressionMap.clear();for(var i=0;i=0;r--){var a;if(null!==(a=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[r])&&void 0!==a&&a.StaffEntries[t])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[r].StaffEntries[t]}}},{key:"getFirstRightNotNullStaffEntryFromContainer",value:function(e,t,n){var i;if(null!==(i=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[e])&&void 0!==i&&i.StaffEntries[t])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[e].StaffEntries[t];for(var r=e+1;r0||t.StaffLinkedExpressions[n][i].UnknownList.length>0)&&this.calculateMoodAndUnknownExpression(t.StaffLinkedExpressions[n][i],e,n)}},{key:"calculateStemDirectionFromVoices",value:function(e){if(void 0!==e.ParentSourceStaffEntry.Link)return e===e.ParentSourceStaffEntry.VoiceEntries[0]?void(e.WantedStemDirection=StemDirectionType.Up):void(e.WantedStemDirection=StemDirectionType.Down);e.ParentVoice instanceof LinkedVoice?e.WantedStemDirection=StemDirectionType.Down:e.ParentSourceStaffEntry.VoiceEntries.length>1&&(e.WantedStemDirection=StemDirectionType.Up)}},{key:"setBeamNotesWantedStemDirections",value:function(e){if(e.Notes.length>0){var t=e.Notes[0].NoteBeam;if(t){var n,i=_createForOfIteratorHelper(t.Notes);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(r.ParentVoiceEntry.WantedStemDirection!==StemDirectionType.Undefined&&r.ParentVoiceEntry.ParentSourceStaffEntry.ParentStaff.Id===e.ParentSourceStaffEntry.ParentStaff.Id){e.WantedStemDirection=r.ParentVoiceEntry.WantedStemDirection;break}}}catch(err){i.e(err)}finally{i.f()}}}}}],[{key:"TextMeasurer",get:function(){return e.textMeasurer},set:function(t){e.textMeasurer=t}},{key:"setMeasuresMinStaffEntriesWidth",value:function(e,t){for(var n=0,i=e.length;n0&&(r+="("+s.adds.join(",")+")"),s.alts.length>0&&(r+="(alt "+s.alts.join(",")+")"),s.subs.length>0&&(r+="(omit "+s.subs.join(",")+")"),e.BassPitch){var A=e.BassPitch;MusicSheetCalculator.transposeCalculator&&(A=MusicSheetCalculator.transposeCalculator.transposePitch(e.BassPitch,n,t)),r+="/",r+=Pitch.getNoteEnumString(A.FundamentalNote),r+=this.getTextForAccidental(A.Accidental)}return r}},{key:"getTextForAccidental",value:function(e){var t="";switch(e){case AccidentalEnum.DOUBLEFLAT:t+="bb";break;case AccidentalEnum.FLAT:t+="b";break;case AccidentalEnum.SHARP:t+="#";break;case AccidentalEnum.DOUBLESHARP:t+="x"}return t}}]),e}(),Degree=_createClass2((function e(t,n,i){_classCallCheck2(this,e),this.value=t,this.alteration=n,this.text=i})),CustomChord=function(){function e(t,n,i){_classCallCheck2(this,e),this.alternateName=t,this.chordKind=n,this.degrees=i}return _createClass2(e,null,[{key:"createCustomChord",value:function(t,n,i){return new e(t,n,i)}},{key:"renameCustomChord",value:function(e,t,n){var i,r=_createForOfIteratorHelper(n);try{for(r.s();!(i=r.n()).done;){var a=i.value;a.alternateName===e&&(a.alternateName=t)}}catch(err){r.e(err)}finally{r.f()}}}]),e}(),ChordDegreeText=function(e){return e[e.add=0]="add",e[e.alter=1]="alter",e[e.subtract=2]="subtract",e}(ChordDegreeText||{}),ChordSymbolEnum=function(e){return e[e.major=0]="major",e[e.minor=1]="minor",e[e.augmented=2]="augmented",e[e.diminished=3]="diminished",e[e.dominant=4]="dominant",e[e.majorseventh=5]="majorseventh",e[e.minorseventh=6]="minorseventh",e[e.diminishedseventh=7]="diminishedseventh",e[e.augmentedseventh=8]="augmentedseventh",e[e.halfdiminished=9]="halfdiminished",e[e.majorminor=10]="majorminor",e[e.majorsixth=11]="majorsixth",e[e.minorsixth=12]="minorsixth",e[e.dominantninth=13]="dominantninth",e[e.majorninth=14]="majorninth",e[e.minorninth=15]="minorninth",e[e.dominant11th=16]="dominant11th",e[e.major11th=17]="major11th",e[e.minor11th=18]="minor11th",e[e.dominant13th=19]="dominant13th",e[e.major13th=20]="major13th",e[e.minor13th=21]="minor13th",e[e.suspendedsecond=22]="suspendedsecond",e[e.suspendedfourth=23]="suspendedfourth",e[e.Neapolitan=24]="Neapolitan",e[e.Italian=25]="Italian",e[e.French=26]="French",e[e.German=27]="German",e[e.pedal=28]="pedal",e[e.power=29]="power",e[e.Tristan=30]="Tristan",e[e.none=31]="none",e}(ChordSymbolEnum||{}),GraphicalNote=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i,r){var a,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;return _classCallCheck2(this,n),(a=t.call(this)).DrawnAccidental=AccidentalEnum.NONE,a.lineShift=0,a.sourceNote=e,a.parentVoiceEntry=i,a.PositionAndShape=new BoundingBox$2(_assertThisInitialized2(a),i.PositionAndShape),a.graphicalNoteLength=s||e.Length,a.numberOfDots=a.calculateNumberOfNeededDots(a.graphicalNoteLength),a.rules=r,a.rules.addGraphicalNoteToNoteMap(e,_assertThisInitialized2(a)),a}return _createClass2(n,[{key:"Transpose",value:function(e,t,n,i){var r=this.sourceNote.Pitch;return MusicSheetCalculator.transposeCalculator&&(r=MusicSheetCalculator.transposeCalculator.transposePitch(this.sourceNote.Pitch,e,n)),r}},{key:"calculateNumberOfNeededDots",value:function(e){return this.sourceNote&&this.sourceNote.NoteTuplet?0:e.calculateNumberOfNeededDots()}},{key:"ParentMusicPage",get:function(){return this.parentVoiceEntry.parentStaffEntry.parentMeasure.ParentMusicSystem.Parent}}],[{key:"FromNote",value:function(e,t){return t.NoteToGraphicalNoteMap.getValue(e.NoteToGraphicalNoteObjectId)}}]),n}(GraphicalObject),_EngravingRules=function(){function e(){_classCallCheck2(this,e),this.DYSlursStartingAtSameStaffEntryYOffset=0,this.DYMinNoteWidth=0,this.DYWorkId=0,this.DYWorkSpecial=!1,this.DYContainerId="osmdCanvasPage",this.DYSVGContainerId="osmdSvgPage",this.DYMusicScoreType="staff",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()}return _createClass2(e,[{key:"loadDefaultValues",value:function(){this.SamplingUnit=3*e.unit,this.MpatMode=!0,this.SheetTitleHeight=4,this.SheetSubtitleHeight=2,this.SheetMinimumDistanceBetweenTitleAndSubtitle=1,this.SheetComposerHeight=2,this.SheetAuthorHeight=2,this.CompactMode=!1,this.PagePlacementEnum=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=e.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=e.unit/2,this.BeamSpaceWidth=e.unit/3,this.BeamForwardLength=1.25*e.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=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 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*e.unit,this.MeasureNumberLabelOffset=2,this.MeasureNumberLabelXOffset=-.5,this.TupletsRatioed=!1,this.TupletsBracketed=!1,this.TripletsBracketed=!1,this.TupletNumberLabelHeight=1.5*e.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=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=e.unit/2,this.SystemRepetitionEndingLineWidth=.12,this.SystemDotWidth=e.unit/2,this.DistanceBetweenVerticalSystemLines=.35,this.DistanceBetweenDotAndLine=.7,this.RepeatEndStartPadding=2,this.OctaveShiftLineWidth=.12,this.OctaveShiftVerticalLineLength=e.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=AlignRestOption.Never,this.RestCollisionYPadding=0,this.FillEmptyMeasuresWithWholeRest=FillEmptyMeasuresWithWholeRests.No,this.ArpeggiosGoAcrossVoices=!1,this.RenderArpeggios=!0,this.RenderSlurs=!0,this.ColoringMode=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=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=PlacementEnum.AboveOrBelow,this.FingeringPositionFromXML=!0,this.FingeringPositionGrace=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,e.FixStafflineBoundingBox=!1,this.PageFormat=PageFormat.UndefinedPageFormat,this.PageBackgroundColor=void 0,this.PerformanceMode=!1,this.RenderSingleHorizontalStaffline=!1,this.SpacingBetweenTextLines=0,this.NoteToGraphicalNoteMap=new Dictionary,this.NoteToGraphicalNoteMapObjectCount=0;try{this.MaxInstructionsConstValue=this.ClefLeftMargin+this.ClefRightMargin+this.KeyRightMargin+this.RhythmRightMargin+11}catch(t){log$2.info("EngravingRules()",t)}this.MpatMode&&(this.NewPartAndSystemAfterFinalBarline=!0)}},{key:"applyDefaultColorMusic",value:function(e){this.DefaultColorMusic=e,this.DefaultColorNotehead=this.DefaultColorMusic,this.DefaultColorRest=this.DefaultColorNotehead,this.DefaultColorStem=this.DefaultColorNotehead,this.DefaultColorLabel=this.DefaultColorNotehead,this.DefaultColorTitle=this.DefaultColorNotehead,this.LedgerLineColorDefault=this.DefaultColorNotehead}},{key:"addGraphicalNoteToNoteMap",value:function(e,t){e.NoteToGraphicalNoteObjectId=this.NoteToGraphicalNoteMapObjectCount,this.NoteToGraphicalNoteMap.setValue(e.NoteToGraphicalNoteObjectId,t),this.NoteToGraphicalNoteMapObjectCount++}},{key:"GNote",value:function(e){return GraphicalNote.FromNote(e,this)}},{key:"clearMusicSheetObjects",value:function(){this.NoteToGraphicalNoteMap=new Dictionary,this.NoteToGraphicalNoteMapObjectCount=0}},{key:"setChordSymbolLabelText",value:function(e,t){this.ChordSymbolLabelTexts.setValue(e,t)}},{key:"resetChordSymbolLabelTexts",value:function(e){return e.setValue(ChordSymbolEnum.minor,"m"),e.setValue(ChordSymbolEnum.augmented,"aug"),e.setValue(ChordSymbolEnum.diminished,"dim"),e.setValue(ChordSymbolEnum.dominant,"7"),e.setValue(ChordSymbolEnum.majorseventh,"maj7"),e.setValue(ChordSymbolEnum.minorseventh,"m7"),e.setValue(ChordSymbolEnum.diminishedseventh,"dim7"),e.setValue(ChordSymbolEnum.augmentedseventh,"aug7"),e.setValue(ChordSymbolEnum.halfdiminished,"m7b5"),e.setValue(ChordSymbolEnum.majorminor,"m(maj7)"),e.setValue(ChordSymbolEnum.majorsixth,"maj6"),e.setValue(ChordSymbolEnum.minorsixth,"m6"),e.setValue(ChordSymbolEnum.dominantninth,"9"),e.setValue(ChordSymbolEnum.majorninth,"maj9"),e.setValue(ChordSymbolEnum.minorninth,"m9"),e.setValue(ChordSymbolEnum.dominant11th,"11"),e.setValue(ChordSymbolEnum.major11th,"maj11"),e.setValue(ChordSymbolEnum.minor11th,"m11"),e.setValue(ChordSymbolEnum.dominant13th,"13"),e.setValue(ChordSymbolEnum.major13th,"maj13"),e.setValue(ChordSymbolEnum.minor13th,"m13"),e.setValue(ChordSymbolEnum.suspendedsecond,"sus2"),e.setValue(ChordSymbolEnum.suspendedfourth,"sus4"),e.setValue(ChordSymbolEnum.power,"5"),e.setValue(ChordSymbolEnum.none,"N.C."),e}},{key:"addChordName",value:function(e,t,n,i,r){if(void 0!==ChordSymbolEnum[t]){var a={adds:n,alts:i,subs:r};this.CustomChords.push(CustomChord.createCustomChord(e,ChordSymbolEnum[t],a))}}},{key:"renameChord",value:function(e,t){CustomChord.renameCustomChord(e,t,this.CustomChords)}},{key:"resetChordNames",value:function(){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"],[],[])}},{key:"calculateCurveParametersArrays",value:function(){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(var e=0;e2&&void 0!==arguments[2]?arguments[2]:"noIdStringGiven";_classCallCheck2(this,e),this.width=t,this.height=n,this.idString=i}return _createClass2(e,[{key:"aspectRatio",get:function(){return this.IsUndefined?0:this.width/this.height}},{key:"IsUndefined",get:function(){return void 0===this.width||void 0===this.height||0===this.height||0===this.width}},{key:"Equals",value:function(e){return!!e&&(e.width===this.width&&e.height===this.height)}}],[{key:"UndefinedPageFormat",get:function(){return new e(0,0)}}]),e}();exports("p",PageFormat);var ColoringModes=function(e){return e[e.XML=0]="XML",e[e.AutoColoring=1]="AutoColoring",e[e.CustomColorSet=2]="CustomColorSet",e}(ColoringModes||{}),DrawingParametersEnum=function(e){return e.allon="allon",e.compact="compact",e.compacttight="compacttight",e.default="default",e.leadsheet="leadsheet",e.preview="preview",e.thumbnail="thumbnail",e}(DrawingParametersEnum||{}),DrawingParameters=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";_classCallCheck2(this,e),this.rules=new EngravingRules,this.drawCursors=!0,this.drawTitle=!0,this.drawSubtitle=!0,this.drawLyricist=!0,this.drawComposer=!0,this.drawCredits=!0,this.drawPartNames=!0,this.fingeringPosition=PlacementEnum.Left,this.drawHiddenNotes=!1,this.DrawingParametersEnum=t}return _createClass2(e,[{key:"DrawingParametersEnum",get:function(){return this.drawingParametersEnum},set:function(e){switch(this.drawingParametersEnum=e,e){case"allon":this.setForAllOn();break;case"thumbnail":this.setForThumbnail();break;case"leadsheet":this.setForLeadsheet();break;case"compact":this.setForCompactMode();break;case"compacttight":this.setForCompactTightMode();break;default:this.setForDefault()}}},{key:"setForAllOn",value:function(){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}},{key:"setForDefault",value:function(){this.rules.loadDefaultValues(),this.setForAllOn(),this.drawHiddenNotes=!1}},{key:"setForThumbnail",value:function(){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}},{key:"setForCompactMode",value:function(){this.rules.CompactMode=!0,this.DrawCredits=!1,this.drawHiddenNotes=!1}},{key:"setForCompactTightMode",value:function(){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}},{key:"setForLeadsheet",value:function(){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}},{key:"DrawCredits",get:function(){return this.drawCredits},set:function(e){this.drawCredits=e,this.DrawComposer=e,this.DrawTitle=e,this.DrawSubtitle=e,this.DrawLyricist=e}},{key:"DrawTitle",get:function(){return this.drawTitle},set:function(e){this.drawTitle=e,this.rules.RenderTitle=e,e||(this.DrawSubtitle=!1)}},{key:"DrawSubtitle",get:function(){return this.drawSubtitle},set:function(e){this.drawSubtitle=e,this.rules.RenderSubtitle=e,e&&(this.DrawTitle=!0)}},{key:"DrawComposer",get:function(){return this.drawComposer},set:function(e){this.drawComposer=e,this.rules.RenderComposer=e}},{key:"DrawLyricist",get:function(){return this.drawLyricist},set:function(e){this.drawLyricist=e,this.rules.RenderLyricist=e}},{key:"DrawPartNames",get:function(){return this.drawPartNames},set:function(e){this.drawPartNames=e,this.rules.RenderPartNames=e,this.rules.RenderPartNames||(this.rules.RenderPartAbbreviations=!1)}},{key:"FingeringPosition",get:function(){return this.fingeringPosition},set:function(e){this.fingeringPosition=e,this.rules.FingeringPosition=e}},{key:"Rules",get:function(){return this.rules},set:function(e){this.rules=e}}]),e}(),AlignRestOption=function(e){return e[e.Never=0]="Never",e[e.Always=1]="Always",e[e.Auto=2]="Auto",e}(AlignRestOption||{}),FillEmptyMeasuresWithWholeRests=function(e){return e[e.No=0]="No",e[e.YesVisible=1]="YesVisible",e[e.YesInvisible=2]="YesInvisible",e}(FillEmptyMeasuresWithWholeRests||{}),BackendType=function(e){return e[e.SVG=0]="SVG",e[e.Canvas=1]="Canvas",e}(BackendType||{}),OSMDOptions=function(){function e(){_classCallCheck2(this,e)}return _createClass2(e,null,[{key:"OSMDOptionsStandard",value:function(){return{autoResize:!0,backend:"svg",drawingParameters:DrawingParametersEnum.default}}},{key:"BackendTypeFromString",value:function(e){return e&&"canvas"===e.toLowerCase()?1:0}}]),e}(),IXmlElement=function(){function e(t){if(_classCallCheck2(this,e),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=""}return _createClass2(e,[{key:"attribute",value:function(e){return this.elem.attributes.getNamedItem(e)}},{key:"attributes",value:function(){if(!this.attrs){for(var e=this.elem.attributes,t=[],n=0;n0&&this.Voices[0].Visible},set:function(e){for(var t=0,n=this.Voices.length;t-1&&this.parent.MusicSystems.splice(t,1)}this.parent=e,this.boundingBox.Parent=e.PositionAndShape}},{key:"NextSystem",get:function(){var e=this.Parent.MusicSystems.indexOf(this);return e!==this.Parent.MusicSystems.length?this.Parent.MusicSystems[e+1]:void 0}},{key:"StaffLines",get:function(){return this.staffLines}},{key:"GraphicalMeasures",get:function(){return this.graphicalMeasures}},{key:"MeasureNumberLabels",get:function(){return this.measureNumberLabels}},{key:"Labels",get:function(){return this.labels.values()}},{key:"ObjectsToRedraw",get:function(){return this.objectsToRedraw}},{key:"InstrumentBrackets",get:function(){return this.instrumentBrackets}},{key:"GroupBrackets",get:function(){return this.groupBrackets}},{key:"GraphicalMarkedAreas",get:function(){return this.graphicalMarkedAreas}},{key:"SystemLines",get:function(){return this.systemLines}},{key:"Id",get:function(){return this.id}},{key:"createSystemLeftLine",value:function(e,t,n){var i=-e/2;n&&(i=this.maxLabelLength+t-e/2);var r=this.staffLines[0].Measures[0],a=void 0;this.staffLines.length>1&&(a=this.staffLines[this.staffLines.length-1].Measures[0]);var s=this.createSystemLine(i,e,SystemLinesEnum.SingleThin,SystemLinePosition.MeasureBegin,this,r,a);this.SystemLines.push(s),s.PositionAndShape.RelativePosition=new PointF2D(i,0),s.PositionAndShape.BorderLeft=0,s.PositionAndShape.BorderRight=e,s.PositionAndShape.BorderTop=0,s.PositionAndShape.BorderBottom=this.boundingBox.Size.height,this.createLinesForSystemLine(s)}},{key:"createVerticalLineForMeasure",value:function(e,t,n,i,r,a){var s=a.ParentStaffLine,o=new PointF2D(s.PositionAndShape.RelativePosition.x,s.PositionAndShape.RelativePosition.y),l=s.ParentStaff.ParentInstrument.Staves;if(s.ParentStaff===l[0]){var u=void 0;l.length>1&&(u=this.getBottomStaffLine(s).Measures[r]);var c=this.createSystemLine(e,t,n,i,this,a,u),h=o.x+e;c.PositionAndShape.RelativePosition=new PointF2D(h,0),c.PositionAndShape.BorderLeft=0,c.PositionAndShape.BorderRight=t,this.SystemLines.push(c)}}},{key:"setYPositionsToVerticalLineObjectsAndCreateLines",value:function(e){}},{key:"calculateBorders",value:function(e){}},{key:"alignBeginInstructions",value:function(){}},{key:"GetLeftBorderAbsoluteXPosition",value:function(){return this.StaffLines[0].PositionAndShape.AbsolutePosition.x+this.StaffLines[0].Measures[0].beginInstructionsWidth}},{key:"GetRightBorderAbsoluteXPosition",value:function(){return this.StaffLines[0].PositionAndShape.AbsolutePosition.x+this.StaffLines[0].StaffLines[0].End.x}},{key:"AddGraphicalMeasures",value:function(e){for(var t=0,n=e.length;t1){for(var a=void 0,s=void 0,o=0,l=this.staffLines.length;o3&&void 0!==arguments[3]&&arguments[3],r=t,a=0,s=this.staffLines.length;athis.maxLabelLength&&(this.maxLabelLength=v.PositionAndShape.Size.width,t=r))}this.updateMusicSystemStaffLineXPosition(t)}},{key:"setMusicSystemLabelsYPosition",value:function(){var e=this;this.labels.forEach((function(t,n){for(var i=0,r=0,a=0;a0&&(n.PositionAndShape.RelativePosition=new PointF2D(0,i/r+2))}))}},{key:"checkStaffEntriesForStaffEntryLink",value:function(){for(var e=!1,t=!1,n=0;n=0;n--){if(!((t=e.InstrumentalGroups[n])instanceof Instrument))return this.findLastVisibleInstrumentInInstrumentalGroup(t);if(!0===t.Visible)return t}}},{key:"updateMusicSystemStaffLineXPosition",value:function(e){for(var t=0,n=this.StaffLines.length;t4&&void 0!==arguments[4]?arguments[4]:void 0;return _classCallCheck2(this,n),(s=t.call(this)).lineType=e,s.linePosition=i,s.parentMusicSystem=r,s.topMeasure=a,s.bottomMeasure=o,s.parentTopStaffLine=null==a?void 0:a.ParentStaffLine,s.boundingBox=new BoundingBox$2(_assertThisInitialized2(s),r.PositionAndShape),s}return _createClass2(n,null,[{key:"getObjectWidthForLineType",value:function(e,t){switch(t){case SystemLinesEnum.SingleThin:return e.SystemThinLineWidth;case SystemLinesEnum.DoubleThin:return 2*e.SystemThinLineWidth+e.DistanceBetweenVerticalSystemLines;case SystemLinesEnum.ThinBold:return e.SystemThinLineWidth+e.SystemBoldLineWidth+e.DistanceBetweenVerticalSystemLines;case SystemLinesEnum.BoldThinDots:case SystemLinesEnum.DotsThinBold:return e.SystemThinLineWidth+e.SystemBoldLineWidth+e.DistanceBetweenVerticalSystemLines+e.SystemDotWidth+e.DistanceBetweenDotAndLine;case SystemLinesEnum.DotsBoldBoldDots:return 2*e.SystemBoldLineWidth+2*e.SystemDotWidth+2*e.DistanceBetweenDotAndLine+e.DistanceBetweenVerticalSystemLines;default:return 0}}}]),n}(GraphicalObject),VF$b=Vex.Flow,VexFlowInstrumentBracket=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i){var r,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;_classCallCheck2(this,n),(r=t.call(this)).Visible=!0,r.PositionAndShape=new BoundingBox$2(_assertThisInitialized2(r),e.ParentMusicSystem.PositionAndShape);var s=e.Measures[0],o=i.Measures[0];return r.addConnector(s.getVFStave(),o.getVFStave(),VF$b.StaveConnector.type.BRACKET,a),r}return _createClass2(n,[{key:"draw",value:function(e){this.Visible&&this.vexflowConnector.setContext(e).draw();var t=this.vexflowConnector,n=t.top_stave.getYForLine(0),i=t.bottom_stave.getYForLine(t.bottom_stave.getNumLines()-1)+t.thickness;this.PositionAndShape.AbsolutePosition.x=(t.top_stave.getX()-2+t.x_shift)/unitInPixels,this.PositionAndShape.AbsolutePosition.y=n/unitInPixels,this.PositionAndShape.Size.height=(i-n)/unitInPixels,this.PositionAndShape.Size.width=12/unitInPixels}},{key:"addConnector",value:function(e,t,n,i){this.vexflowConnector=new VF$b.StaveConnector(e,t).setType(n).setXShift(-5*i)}}]),n}(GraphicalObject),VF$a=Vex.Flow,VexFlowInstrumentBrace=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i){var r,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return _classCallCheck2(this,n),(r=t.call(this,e,i,a)).vexflowConnector.setType(VF$a.StaveConnector.type.BRACE),r}return _createClass2(n)}(VexFlowInstrumentBracket),VexFlowMusicSystem=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i){var r;return _classCallCheck2(this,n),(r=t.call(this,e)).rules=i,r}return _createClass2(n,[{key:"calculateBorders",value:function(e){if(0!==this.staffLines.length){var t=this.calcBracketsWidth();this.boundingBox.BorderLeft=-t,this.boundingBox.BorderMarginLeft=-t,this.boundingBox.XBordersHaveBeenSet=!0;var n=this.staffLines[0].SkyBottomLineCalculator.getSkyLineMin();this.boundingBox.BorderTop=n,this.boundingBox.BorderMarginTop=n;var i=this.staffLines[this.staffLines.length-1],r=i.SkyBottomLineCalculator.getBottomLineMax()+i.PositionAndShape.RelativePosition.y;this.boundingBox.BorderBottom=r,this.boundingBox.BorderMarginBottom=r,this.boundingBox.XBordersHaveBeenSet=!0,this.boundingBox.YBordersHaveBeenSet=!0}}},{key:"createSystemLine",value:function(e,t,n,i,r,a){var s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:void 0,o=a,l=!1;if(s&&(l=!0,s.lineTo(a,VexFlowConverter.line(n,i)),s.addMeasureLine(n,i),n===SystemLinesEnum.DotsBoldBoldDots)){var u=s.ParentStaffLine.Measures.indexOf(s)+1,c=s.ParentStaffLine.Measures[u],h=a.ParentStaffLine.Measures[u];c&&h&&(c.lineTo(h,VexFlowConverter.line(SystemLinesEnum.BoldThinDots,i)),c.addMeasureLine(SystemLinesEnum.BoldThinDots,i))}return o&&o.addMeasureLine(n,i,l),new SystemLine(n,i,this,a,s)}},{key:"createInstrumentBracket",value:function(e,t){var n=new VexFlowInstrumentBrace(e,t);this.InstrumentBrackets.push(n)}},{key:"createGroupBracket",value:function(e,t,n){var i=e,r=t;if(0===n){var a=new VexFlowInstrumentBracket(i,r,n);this.GroupBrackets.push(a)}else{var s=new VexFlowInstrumentBrace(i,r,n);this.GroupBrackets.push(s)}}}]),n}(MusicSystem),GraphicalMeasure=function(e){_inherits2(n,e);var t=_createSuper(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return _classCallCheck2(this,n),(e=t.call(this)).hasOnlyRests=!1,e.measureNumber=-1,e.ShowTimeSignature=!0,e.parentStaff=i,e.parentSourceMeasure=r,e.parentStaffLine=a,a?(e.parentStaff=a.ParentStaff,e.PositionAndShape=new BoundingBox$2(_assertThisInitialized2(e),a.PositionAndShape)):e.PositionAndShape=new BoundingBox$2(_assertThisInitialized2(e)),e.PositionAndShape.BorderBottom=4,e.parentSourceMeasure&&(e.measureNumber=e.parentSourceMeasure.MeasureNumber),e.staffEntries=[],e}return _createClass2(n,[{key:"ParentStaff",get:function(){return this.parentStaff}},{key:"ParentMusicSystem",get:function(){return this.parentMusicSystem},set:function(e){this.parentMusicSystem=e}},{key:"MeasureNumber",get:function(){return this.measureNumber}},{key:"FirstInstructionStaffEntry",get:function(){return this.firstInstructionStaffEntry},set:function(e){this.firstInstructionStaffEntry=e}},{key:"LastInstructionStaffEntry",get:function(){return this.lastInstructionStaffEntry},set:function(e){this.lastInstructionStaffEntry=e}},{key:"ParentStaffLine",get:function(){return this.parentStaffLine},set:function(e){this.parentStaffLine=e,this.parentStaffLine&&(this.PositionAndShape.Parent=this.parentStaffLine.PositionAndShape)}},{key:"resetLayout",value:function(){throw new Error("not implemented")}},{key:"getLineWidth",value:function(e){throw new Error("not implemented")}},{key:"addClefAtBegin",value:function(e){throw new Error("not implemented")}},{key:"addKeyAtBegin",value:function(e,t,n){throw new Error("not implemented")}},{key:"addRhythmAtBegin",value:function(e){throw new Error("not implemented")}},{key:"addClefAtEnd",value:function(e){throw new Error("not implemented")}},{key:"setPositionInStaffline",value:function(e){this.PositionAndShape.RelativePosition=new PointF2D(e,0)}},{key:"setWidth",value:function(e){this.PositionAndShape.BorderRight=e}},{key:"layoutSymbols",value:function(){throw new Error("not implemented")}},{key:"findGraphicalStaffEntryFromTimestamp",value:function(e){for(var t=0,n=this.staffEntries.length;t1}},{key:"isVisible",value:function(){return this.ParentStaff.ParentInstrument.Visible}},{key:"getGraphicalMeasureDurationFromStaffEntries",value:function(){for(var e=new Fraction$1(0,1),t=[],n=0,i=this.staffEntries.length;n0&&f.Add(v.notes[0].graphicalNoteLength)}}catch(err){m.e(err)}finally{m.f()}}}catch(err){d.e(err)}finally{d.f()}e.lt(f)&&(e=Fraction$1.createFromFraction(f))}return e}},{key:"addGraphicalStaffEntry",value:function(e){this.staffEntries.push(e)}},{key:"addGraphicalStaffEntryAtTimestamp",value:function(e){if(e)if(0===this.staffEntries.length||this.staffEntries[this.staffEntries.length-1].relInMeasureTimestamp.lt(e.relInMeasureTimestamp))this.staffEntries.push(e);else for(var t=this.staffEntries.length-1;t>=0;t--){if(this.staffEntries[t].relInMeasureTimestamp.lt(e.relInMeasureTimestamp)){this.staffEntries.splice(t+1,0,e);break}0===t&&this.staffEntries.splice(t,0,e)}}},{key:"isPianoRightHand",value:function(){return this.isUpperStaffOfInstrument()}},{key:"isPianoLeftHand",value:function(){return this.isLowerStaffOfInstrument()}},{key:"isUpperStaffOfInstrument",value:function(){return 1===this.parentStaff.ParentInstrument.Staves.length||this.ParentStaff===this.parentStaff.ParentInstrument.Staves[0]}},{key:"isLowerStaffOfInstrument",value:function(){return 1!==this.parentStaff.ParentInstrument.Staves.length&&this.ParentStaff===this.ParentStaff.ParentInstrument.Staves.last()}},{key:"beginsWithLineRepetition",value:function(){var e=this.parentSourceMeasure;return!!e&&e.beginsWithLineRepetition()}},{key:"endsWithLineRepetition",value:function(){var e=this.parentSourceMeasure;return!!e&&e.endsWithLineRepetition()}},{key:"beginsWithWordRepetition",value:function(){var e=this.parentSourceMeasure;return!!e&&e.beginsWithWordRepetition()}},{key:"endsWithWordRepetition",value:function(){var e=this.parentSourceMeasure;return!!e&&e.endsWithWordRepetition()}},{key:"getTransposedHalftones",value:function(){return this.parentStaff.ParentInstrument.GetMusicSheet.Transpose+this.parentStaff.ParentInstrument.Transpose}}]),n}(GraphicalObject);Vex.Flow;var VexFlowVoiceEntry=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i){return _classCallCheck2(this,n),t.call(this,e,i)}return _createClass2(n,[{key:"applyBordersFromVexflow",value:function(){var e=this.vfStaveNote;if(e.getNoteHeadBeginX){var t=e.getBoundingBox(),n=e.getNoteHeadBeginX()-t.x;this.PositionAndShape.RelativePosition.y=t.y/unitInPixels,this.PositionAndShape.BorderTop=0,this.PositionAndShape.BorderBottom=t.h/unitInPixels,this.PositionAndShape.BorderLeft=-(n+e.width/2)/unitInPixels,this.PositionAndShape.BorderRight=(t.w-n)/unitInPixels}}},{key:"vfStaveNote",get:function(){return this.mVexFlowStaveNote},set:function(e){this.mVexFlowStaveNote=e}},{key:"color",value:function(){for(var e,t,n=this.rules.DefaultColorNotehead,i=this.rules.DefaultColorRest,r=this.rules.DefaultColorStem,a="#00000000",s=this.vfStaveNote,o=0;o1&&void 0!==arguments[1]?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return _classCallCheck2(this,n),(i=t.call(this,e,r,a)).isTabMeasure=!1,i.octaveOffset=3,i.vfVoices={},i.vfTies=[],i.vfRepetitionWords=[],i.connectors=[],i.beams={},i.tuplets={},i.vftuplets={},i.minimumStaffEntriesWidth=-1,a?i.rules=a.ParentMusicSystem.rules:r&&(i.rules=r.Rules),i.resetLayout(),i}return _createClass2(n,[{key:"setAbsoluteCoordinates",value:function(e,t){this.stave.setX(e).setY(t)}},{key:"resetLayout",value:function(){this.stave=new VF$9.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(VF$9.Barline.type.NONE),this.parentSourceMeasure&&this.parentSourceMeasure.endingBarStyleEnum===SystemLinesEnum.None&&this.stave.setEndBarType(VF$9.Barline.type.NONE),this.updateInstructionWidth()}},{key:"clean",value:function(){this.vfTies.length=0,this.connectors=[],this.resetLayout()}},{key:"getLineWidth",value:function(e){switch(e){case SystemLinesEnum.SingleThin:case SystemLinesEnum.DoubleThin:case SystemLinesEnum.ThinBold:return 5/unitInPixels;case SystemLinesEnum.BoldThinDots:case SystemLinesEnum.DotsThinBold:return 10/unitInPixels;case SystemLinesEnum.DotsBoldBoldDots:return 10/unitInPixels+this.rules.RepeatEndStartPadding;default:return 0}}},{key:"addClefAtBegin",value:function(e){if(this.rules.RenderClefsAtBeginningOfStaffline){if(this.octaveOffset=e.OctaveOffset,"jianpu"!==this.rules.DYMusicScoreType)if(e.ClefType===ClefEnum.TAB)this.stave.addClef("tab",void 0,void 0,void 0);else{var t=VexFlowConverter.Clef(e,"default");this.stave.addClef(t.type,t.size,t.annotation,VF$9.StaveModifier.Position.BEGIN)}this.updateInstructionWidth()}}},{key:"setLineNumber",value:function(e){5!==e&&(0===e?(this.stave.setNumLines(0),this.stave.getBottomLineY=function(){return this.getYForLine(this.options.num_lines)}):1===e?(this.stave.options.line_config=[{visible:!1},{visible:!1},{visible:!0},{visible:!1},{visible:!1}],this.stave.getBottomLineY=function(){return this.getYForLine(2)}):2===e?(this.stave.options.line_config=[{visible:!1},{visible:!1},{visible:!0},{visible:!0},{visible:!1}],this.stave.getBottomLineY=function(){return this.getYForLine(3)}):3===e?(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(e),this.stave.getBottomLineY=function(){return this.getYForLine(this.options.num_lines)}))}},{key:"addKeyAtBegin",value:function(e,t,n){this.rules.RenderKeySignatures&&(this.stave.setKeySignature(VexFlowConverter.keySignature(e),VexFlowConverter.keySignature(t),void 0),this.updateInstructionWidth())}},{key:"addRhythmAtBegin",value:function(e){var t=VexFlowConverter.TimeSignature(e);this.stave.addModifier(t,VF$9.StaveModifier.Position.BEGIN,{numerator:e.Rhythm.Numerator,denominator:e.Rhythm.Denominator}),this.ShowTimeSignature||t.setStyle({fillStyle:"#00000000"}),this.updateInstructionWidth()}},{key:"addClefAtEnd",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=VexFlowConverter.Clef(e,"small");if(t||!this.stave.endClef){this.stave.setEndClef(n.type,n.size,n.annotation);var i,r=_createForOfIteratorHelper(this.stave.getModifiers());try{for(r.s();!(i=r.n()).done;){var a=i.value;if(t){var s=a.originalStrokeStyle,o=a.originalFillStyle;a.getStyle()&&(s&&o?(a.getStyle().strokeStyle=s,a.getStyle().fillStyle=o):(a.getStyle().strokeStyle=null,a.getStyle().fillStyle=null))}else if("clefs"===a.getCategory()&&a.getPosition()===VF$9.StaveModifier.Position.END&&a.type===n.type){var l="#12345600",u=a.getStyle();u&&(a.originalStrokeStyle=u.strokeStyle,a.originalFillStyle=u.fillStyle),a.setStyle({strokeStyle:l,fillStyle:l})}}}catch(err){r.e(err)}finally{r.f()}return this.parentSourceMeasure.hasEndClef=!0,this.updateInstructionWidth()}}},{key:"addMeasureLine",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];switch(t){case SystemLinePosition.MeasureBegin:if(e===SystemLinesEnum.BoldThinDots)n||(this.stave.modifiers[0].draw=function(e){switch(e.checkContext(),this.setRendered(),this.type){case VF$9.Barline.type.SINGLE:this.drawVerticalBar(e,this.x,!1);break;case VF$9.Barline.type.DOUBLE:this.drawVerticalBar(e,this.x,!0);break;case VF$9.Barline.type.END:this.drawVerticalEndBar(e,this.x);break;case VF$9.Barline.type.REPEAT_BEGIN:this.drawRepeatBar(e,this.x,!0);break;case VF$9.Barline.type.REPEAT_END:this.drawRepeatBar(e,this.x,!1);break;case VF$9.Barline.type.REPEAT_BOTH:this.drawRepeatBar(e,this.x,!1),this.drawRepeatBar(e,this.x,!0)}}),this.stave.setBegBarType(VF$9.Barline.type.REPEAT_BEGIN);break;case SystemLinePosition.MeasureEnd:switch(e){case SystemLinesEnum.DotsBoldBoldDots:this.stave.setEndBarType(VF$9.Barline.type.REPEAT_BOTH);break;case SystemLinesEnum.DotsThinBold:this.stave.setEndBarType(VF$9.Barline.type.REPEAT_END);break;case SystemLinesEnum.DoubleThin:this.stave.setEndBarType(VF$9.Barline.type.DOUBLE);break;case SystemLinesEnum.ThinBold:this.stave.setEndBarType(VF$9.Barline.type.END);break;case SystemLinesEnum.None:this.stave.setEndBarType(VF$9.Barline.type.NONE)}}}},{key:"addMeasureNumber",value:function(){var e=this.MeasureNumber.toString(),t=StavePositionEnum.ABOVE;this.stave.setText(e,t,{justification:1,shift_x:0,shift_y:0})}},{key:"addWordRepetition",value:function(e){var t=void 0,n=VF$9.StaveModifier.Position.END,i=this.beginInstructionsWidth;switch(e.type){case RepetitionInstructionEnum.Segno:t=VF$9.Repetition.type.SEGNO_LEFT,n=VF$9.StaveModifier.Position.LEFT;break;case RepetitionInstructionEnum.Coda:t=VF$9.Repetition.type.CODA_LEFT,n=VF$9.StaveModifier.Position.LEFT;break;case RepetitionInstructionEnum.DaCapo:t=VF$9.Repetition.type.DC;break;case RepetitionInstructionEnum.DalSegno:t=VF$9.Repetition.type.DS;break;case RepetitionInstructionEnum.Fine:t=VF$9.Repetition.type.FINE;break;case RepetitionInstructionEnum.ToCoda:t=VF$9.Repetition.type.TO_CODA;break;case RepetitionInstructionEnum.DaCapoAlFine:t=VF$9.Repetition.type.DC_AL_FINE;break;case RepetitionInstructionEnum.DaCapoAlCoda:t=VF$9.Repetition.type.DC_AL_CODA;break;case RepetitionInstructionEnum.DalSegnoAlFine:t=VF$9.Repetition.type.DS_AL_FINE;break;case RepetitionInstructionEnum.DalSegnoAlCoda:t=VF$9.Repetition.type.DS_AL_CODA}if(t){if(this.stave.getModifiers().find((function(e){return e.symbol_type===t})))return;var r=new VF$9.Repetition(t,i,-this.rules.RepetitionSymbolsYOffset);this.stave.addModifier(r,n)}else this.addVolta(e)}},{key:"addVolta",value:function(e){var t=VF$9.Volta.type.BEGIN;if(e.type===RepetitionInstructionEnum.Ending){switch(e.alignment){case AlignmentType.Begin:t=this.parentSourceMeasure.endsRepetitionEnding()?VF$9.Volta.type.BEGIN_END:VF$9.Volta.type.BEGIN;break;case AlignmentType.End:if(this.parentSourceMeasure.beginsRepetitionEnding())return;t=VF$9.Volta.type.END}var i=this.ParentStaffLine.SkyBottomLineCalculator,r=this.PositionAndShape.AbsolutePosition.x+this.PositionAndShape.BorderMarginLeft+.4,a=Math.max(this.PositionAndShape.AbsolutePosition.x+this.PositionAndShape.BorderMarginRight,r+.4),s=i.getSkyLineMinInRange(r,a)-2,o=-6.1+this.rules.VoltaOffset,l=this.rules.VoltaOffset;if(s0){var f;log$2.trace("Ghost Found in between (measure ".concat(this.MeasureNumber,")"));var d=this.createGhostGves(h);(f=n).splice.apply(f,[i,0].concat(_toConsumableArray2(d))),i+=d.length}}else{var p=Fraction$1.minus(s,this.parentSourceMeasure.AbsoluteTimestamp);if(p.RealValue>0){var m;log$2.trace("Ghost Found at start (measure ".concat(this.MeasureNumber,")"));var v=this.createGhostGves(p);(m=n).splice.apply(m,[0,0].concat(_toConsumableArray2(v))),i+=v.length}}t=o}var g=Fraction$1.plus(this.parentSourceMeasure.AbsoluteTimestamp,this.parentSourceMeasure.Duration),y=Fraction$1.minus(g,t);if(y.RealValue>0){log$2.trace("Ghost Found at end (measure ".concat(this.MeasureNumber,")"));var b=this.createGhostGves(y);n=n.concat(b)}return n}},{key:"createGhostGves",value:function(e){var t,n=[],i=_createForOfIteratorHelper(VexFlowConverter.GhostNotes(e));try{for(i.s();!(t=i.n()).done;){var r=t.value,a=new VexFlowVoiceEntry(void 0,void 0);a.vfStaveNote=r,n.push(a)}}catch(err){i.e(err)}finally{i.f()}return n}},{key:"handleBeam",value:function(e,t){var n,i=e.sourceNote.ParentVoiceEntry.ParentVoice.VoiceId,r=this.beams[i];r||(r=this.beams[i]=[]);var a,s=_createForOfIteratorHelper(r);try{for(s.s();!(a=s.n()).done;){var o=a.value;o[0]===t&&(n=o)}}catch(err){s.e(err)}finally{s.f()}n||(n=[t,[]],r.push(n));var l=e.parentVoiceEntry;n[1].indexOf(l)<0&&n[1].push(l)}},{key:"handleTuplet",value:function(e,t){var n=e.sourceNote.ParentVoiceEntry.ParentVoice.VoiceId;t=e.sourceNote.NoteTuplet;var i,r=this.tuplets[n];r||(r=this.tuplets[n]=[]);var a,s=_createForOfIteratorHelper(r);try{for(s.s();!(a=s.n()).done;){var o=a.value;o[0]===t&&(i=o)}}catch(err){s.e(err)}finally{s.f()}i||(i=[t,[]],r.push(i));var l=e.parentVoiceEntry;i[1].indexOf(l)<0&&i[1].push(l)}},{key:"finalizeBeams",value:function(){this.vfbeams={};var e=[];for(var t in this.beams)if(this.beams.hasOwnProperty(t)){var n=this.vfbeams[t];n||(n=this.vfbeams[t]=[]);var i,r=_createForOfIteratorHelper(this.beams[t]);try{for(r.s();!(i=r.n()).done;){var a,s=i.value,o=!1,l=_createForOfIteratorHelper(s[0].Notes);try{for(l.s();!(a=l.n()).done;){var u=a.value;if(u.Length.RealValue>=new Fraction$1(1,4).RealValue&&(!u.TypeLength||u.TypeLength.RealValue>.125)){o=!0;break}}}catch(err){l.e(err)}finally{l.f()}if(o)log$2.debug("Beam between note >= quarter, likely tremolo, currently unsupported. continuing.");else{var c,h=[],f=s[0],d=s[1],p=!0,m=_createForOfIteratorHelper(d);try{for(m.s();!(c=m.n()).done;){var v=c.value;v.parentVoiceEntry.ParentVoice===f.Notes[0].ParentVoiceEntry.ParentVoice&&(p=v.parentVoiceEntry.WantedStemDirection===StemDirectionType.Undefined)}}catch(err){m.e(err)}finally{m.f()}var g,y=!1,b=void 0,_=[],S=_createForOfIteratorHelper(d);try{for(S.s();!(g=S.n()).done;){var x=g.value,w=x.vfStaveNote;w&&(h.push(w),e.push(w)),x.parentVoiceEntry.IsGrace&&(y=!0),x.parentVoiceEntry.StemColor&&this.rules.ColoringEnabled&&_.push(x.parentVoiceEntry.StemColor)}}catch(err){S.e(err)}finally{S.f()}if(h.length>1){var k=new VF$9.Beam(h,p);if(y&&(k.render_options.beam_width=3,k.render_options.partial_beam_length=4),_.length>=2&&this.rules.ColorBeams){b=_[0];var E,T=_createForOfIteratorHelper(_);try{for(T.s();!(E=T.n()).done;){if(E.value!==b){b=void 0;break}}}catch(err){T.e(err)}finally{T.f()}k.setStyle({fillStyle:b,strokeStyle:b})}this.rules.FlatBeams&&(k.render_options.flat_beams=!0,k.render_options.flat_beam_offset=this.rules.FlatBeamOffset,k.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),n.push(k)}else log$2.debug("Warning! Beam with no notes!")}}}catch(err){r.e(err)}finally{r.f()}}this.rules.AutoBeamNotes&&this.autoBeamNotes(e)}},{key:"autoBeamNotes",value:function(e){if(this.rules.AutoBeamTabs||!this.isTabMeasure){var t,n=[],i=[],r=[];this.autoTupletVfBeams=[];var a=[];this.autoVfBeams=[];var s=this.parentSourceMeasure.ActiveTimeSignature;s||(s=this.parentSourceMeasure.Duration);var o,l=_createForOfIteratorHelper(this.staffEntries);try{for(l.s();!(o=l.n()).done;){var u,c=o.value,h=_createForOfIteratorHelper(c.graphicalVoiceEntries);try{for(h.s();!(u=h.n()).done;){var f=u.value,d=f.vfStaveNote,p=f.notes[0],m=c.relInMeasureTimestamp.isOnBeat(s),v=i.length>=2,g=p.sourceNote.Length.RealValue-new Fraction$1(1,4).RealValue>-Fraction$1.FloatInaccuracyTolerance,y=f.parentVoiceEntry.IsGrace||g||e.contains(d);if(y||m){if(v){var b,_=_createForOfIteratorHelper(i);try{for(_.s();!(b=_.n()).done;){var S=b.value;n.push(S)}}catch(err){_.e(err)}finally{_.f()}a.push(n.slice()),n=[]}if(i=[],y)continue}var x=f.notes[0].sourceNote.NoteTuplet;if(x){var w,k=!1,E=_createForOfIteratorHelper(x.Notes);try{for(E.s();!(w=E.n()).done;){var T,P=_createForOfIteratorHelper(w.value);try{for(P.s();!(T=P.n()).done;){var A=T.value;if(A.NoteTypeXml>=NoteType.QUARTER||A.ParentVoiceEntry.IsGrace||A.isRest()&&!this.rules.AutoBeamOptions.beam_rests){k=!0;break}}}catch(err){P.e(err)}finally{P.f()}if(k)break}}catch(err){E.e(err)}finally{E.f()}if(t){if(t!==x){if(r.length>1){var C=new VF$9.Beam(r,!0);this.rules.FlatBeams&&(C.render_options.flat_beams=!0,C.render_options.flat_beam_offset=this.rules.FlatBeamOffset,C.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoTupletVfBeams.push(C)}r=[],t=x}}else t=x;k||r.push(d)}else t=void 0,i.push(d)}}catch(err){h.e(err)}finally{h.f()}}}catch(err){l.e(err)}finally{l.f()}if(r.length>=2){var M=new VF$9.Beam(r,!0);this.rules.FlatBeams&&(M.render_options.flat_beams=!0,M.render_options.flat_beam_offset=this.rules.FlatBeamOffset,M.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoTupletVfBeams.push(M)}if(i.length>=2){var I,N=_createForOfIteratorHelper(i);try{for(N.s();!(I=N.n()).done;){var L=I.value;n.push(L)}}catch(err){N.e(err)}finally{N.f()}a.push(n)}var R=this.rules.AutoBeamOptions,F={beam_middle_only:R.beam_middle_rests_only,beam_rests:R.beam_rests,maintain_stem_directions:R.maintain_stem_directions};if(R.groups&&R.groups.length){var O,B=[],D=_createForOfIteratorHelper(R.groups);try{for(D.s();!(O=D.n()).done;){var V=O.value;B.push(new VF$9.Fraction(V[0],V[1]))}}catch(err){D.e(err)}finally{D.f()}F.groups=B}for(var $=0,G=a;$1){var u=a[0],c=u.Notes[0][0].NormalNotes,h=u.Bracket||3===u.TupletLabelNumber&&this.rules.TripletsBracketed||3!==u.TupletLabelNumber&&this.rules.TupletsBracketed,f=VF$9.Tuplet.LOCATION_TOP;u.tupletLabelNumberPlacement===PlacementEnum.Below&&(f=VF$9.Tuplet.LOCATION_BOTTOM),t.push(new VF$9.Tuplet(s,{bracketed:h,location:f,notes_occupied:c,num_notes:u.TupletLabelNumber,ratioed:this.rules.TupletsRatioed}))}else log$2.debug("Warning! Tuplet with no notes! Trying to ignore, but this is a serious problem.")}}catch(err){i.e(err)}finally{i.f()}}}},{key:"layoutStaffEntry",value:function(e){}},{key:"graphicalMeasureCreatedCalculations",value:function(){var e,t,n=[],i=[],r=_createForOfIteratorHelper(this.staffEntries);try{for(r.s();!(t=r.n()).done;){var a=t.value;e=!1,n=[];var s,o=_createForOfIteratorHelper(a.graphicalVoiceEntries);try{for(o.s();!(s=o.n()).done;){var l=s.value;if(l.parentVoiceEntry.IsGrace)n.push(l),i.push(l),e||(e=l.parentVoiceEntry.GraceSlur);else if(l.vfStaveNote=VexFlowConverter.StaveNote(l),n.length>0){for(var u=[],c=0;c0&&(h.GraceSlash=!1);var f=VexFlowConverter.StaveNote(h);h.vfStaveNote=f,u.push(f)}var d=new VF$9.GraceNoteGroup(u,e);l.vfStaveNote.addModifier(0,d),n=[]}}}catch(err){o.e(err)}finally{o.f()}}}catch(err){r.e(err)}finally{r.f()}if(n.length>0){var p,m=_createForOfIteratorHelper(n);try{for(m.s();!(p=m.n()).done;){var v=p.value;v.vfStaveNote=VexFlowConverter.StaveNote(v),v.parentVoiceEntry.GraceAfterMainNote=!0}}catch(err){m.e(err)}finally{m.f()}}this.finalizeBeams(),this.finalizeTuplets();var g=this.getVoicesWithinMeasure();if(this.rules.RenderFingerings){var y,b=_createForOfIteratorHelper(this.staffEntries);try{for(b.s();!(y=b.n()).done;){y.value.setModifierXOffsets()}}catch(err){b.e(err)}finally{b.f()}}var _,S=_createForOfIteratorHelper(g);try{for(S.s();!(_=S.n()).done;){var x=_.value;if(x){this.vfVoices[x.VoiceId]=new VF$9.Voice({beat_value:this.parentSourceMeasure.Duration.Denominator,num_beats:this.parentSourceMeasure.Duration.Numerator,resolution:VF$9.RESOLUTION}).setMode(VF$9.Voice.Mode.SOFT);var w,k=_createForOfIteratorHelper(this.getRestFilledVexFlowStaveNotesPerVoice(x));try{for(k.s();!(w=k.n()).done;){var E=w.value;if(!E.parentVoiceEntry||!E.parentVoiceEntry.IsGrace||E.parentVoiceEntry.GraceAfterMainNote){var T=E;if(0!==T.vfStaveNote.ticks.denominator)if(0!==E.notes.length&&E.notes[0]&&E.notes[0].sourceNote.PrintObject){var P=T.parentStaffEntry;if(P&&P.vfClefBefore){var A=new NoteSubGroup([P.vfClefBefore]);T.vfStaveNote.getCategory&&"stavenotes"===T.vfStaveNote.getCategory()&&T.vfStaveNote.addModifier(0,A)}E.parentVoiceEntry&&this.rules.RenderFingerings&&(this.rules.FingeringPosition!==PlacementEnum.Left&&this.rules.FingeringPosition!==PlacementEnum.Right||this.createFingerings(E),this.createStringNumber(E)),this.createArpeggio(E),this.vfVoices[x.VoiceId].addTickable(T.vfStaveNote)}else this.vfVoices[x.VoiceId].addTickable(T.vfStaveNote)}}}catch(err){k.e(err)}finally{k.f()}}}}catch(err){S.e(err)}finally{S.f()}this.setStemDirectionFromVexFlow();for(var C=0,M=i;C1){var n=VexFlowConverter.StrokeTypeFromArpeggioType(t.type),i=new VF$9.Stroke(n,{all_voices:this.rules.ArpeggiosGoAcrossVoices});this.rules.RenderArpeggios&&e.vfStaveNote.addStroke(0,i)}else log$2.debug("[OSMD] arpeggio in measure ".concat(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."))}}},{key:"setStemDirectionFromVexFlow",value:function(){var e,t=_createForOfIteratorHelper(this.staffEntries);try{for(t.s();!(e=t.n()).done;){var n,i=_createForOfIteratorHelper(e.value.graphicalVoiceEntries);try{for(i.s();!(n=i.n()).done;){var r,a=n.value,s=_createForOfIteratorHelper(a.notes);try{for(s.s();!(r=s.n()).done;){var o=r.value.vfnote;if(o&&o[0])switch(o[0].getStemDirection()){case VF$9.Stem.UP:a.parentVoiceEntry.StemDirection=StemDirectionType.Up;break;case VF$9.Stem.DOWN:a.parentVoiceEntry.StemDirection=StemDirectionType.Down}}}catch(err){s.e(err)}finally{s.f()}}}catch(err){i.e(err)}finally{i.f()}}}catch(err){t.e(err)}finally{t.f()}}},{key:"createArticulations",value:function(){for(var e=0,t=this.staffEntries.length;e1||e.parentStaffEntry.graphicalVoiceEntries.length>1?f=VF$9.StaveModifier.Position.LEFT:0===d.idInMusicSheet?(f=VF$9.StaveModifier.Position.ABOVE,c=PlacementEnum.Above):(f=VF$9.StaveModifier.Position.BELOW,c=PlacementEnum.Below)}var p=new VF$9.FretHandFinger(u.value);if(p.setPosition(f),p.setOffsetX(h),c===PlacementEnum.Above||c===PlacementEnum.Below){var m=c===PlacementEnum.Above?-1:1,v=c===PlacementEnum.Above?s:i-1-s;if(this.rules.FingeringInsideStafflines&&i>1){var g=p.getWidth()/2,y=2.5*i;p.setOffsetY(m*(v+y)*g)}else if(!this.rules.FingeringInsideStafflines){var b=new VF$9.StringNumber(u.value);b.radius=0,b.setPosition(f),b.setOffsetY(m*v*b.getWidth()*2/3),n.vfStaveNote.addModifier(s,b);continue}}n.vfStaveNote.addModifier(s,p)}else s++}}catch(err){o.e(err)}finally{o.f()}}},{key:"createStringNumber",value:function(e){var t=this;if(this.rules.RenderStringNumbersClassical){var n=e;e.notes.forEach((function(i,r){var a=i.sourceNote.StringInstruction;if(a){var s=a.value;switch(s){case"1":s="I";break;case"2":s="II";break;case"3":s="III";break;case"4":s="IV";break;case"5":s="V";break;case"6":s="VI"}var o=new VF$9.StringNumber(s);o.radius=0;var l=-t.rules.StringNumberOffsetY;e.notes.length>1||e.parentStaffEntry.graphicalVoiceEntries.length>1?(o.setOffsetX(13*i.baseStringNumberXOffset),o.setPosition(VF$9.Modifier.Position.RIGHT)):o.setPosition(VF$9.Modifier.Position.ABOVE),o.setOffsetY(l),n.vfStaveNote.addModifier(r,o)}}))}}},{key:"lineTo",value:function(e,t){var n=new VF$9.StaveConnector(e.getVFStave(),this.stave);n.setType(t),this.connectors.push(n)}},{key:"getVFStave",value:function(){return this.stave}},{key:"updateInstructionWidth",value:function(){var e,t,n,i=0,r=0,a=_createForOfIteratorHelper(this.stave.getModifiers());try{for(a.s();!(n=a.n()).done;){var s=n.value;s.getPosition()===StavePositionEnum.BEGIN?i+=s.getWidth()+s.getPadding(void 0):s.getPosition()===StavePositionEnum.END&&(r+=s.getWidth()+s.getPadding(void 0))}}catch(err){a.e(err)}finally{a.f()}this.beginInstructionsWidth=(null!==(e=i)&&void 0!==e?e:0)/unitInPixels,this.endInstructionsWidth=(null!==(t=r)&&void 0!==t?t:0)/unitInPixels}},{key:"addStaveTie",value:function(e,t){this.vfTies.push(e),t.vfTie=e}}]),n}(GraphicalMeasure),StavePositionEnum=function(e){return e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.ABOVE=3]="ABOVE",e[e.BELOW=4]="BELOW",e[e.BEGIN=5]="BEGIN",e[e.END=6]="END",e}(StavePositionEnum||{}),GraphicalStaffEntry=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return _classCallCheck2(this,n),(i=t.call(this)).graphicalChordContainers=[],i.tabStaffEntry=void 0,i.MaxAccidentals=0,i.graphicalInstructions=[],i.ties=[],i.graphicalTies=[],i.lyricsEntries=[],i.parentMeasure=e,i.graphicalVoiceEntries=[],i.sourceStaffEntry=r,a?(i.staffEntryParent=a,i.parentVerticalContainer=a.parentVerticalContainer,i.PositionAndShape=new BoundingBox$2(_assertThisInitialized2(i),a.PositionAndShape)):i.PositionAndShape=new BoundingBox$2(_assertThisInitialized2(i),e.PositionAndShape),r&&(i.relInMeasureTimestamp=r.Timestamp),i.FingeringEntries=[],i}return _createClass2(n,[{key:"GraphicalInstructions",get:function(){return this.graphicalInstructions}},{key:"GraphicalTies",get:function(){return this.graphicalTies}},{key:"LyricsEntries",get:function(){return this.lyricsEntries},set:function(e){this.lyricsEntries=e}},{key:"getAbsoluteTimestamp",value:function(){var e=this.parentMeasure.parentSourceMeasure.AbsoluteTimestamp.clone();return this.relInMeasureTimestamp&&e.Add(this.relInMeasureTimestamp),e}},{key:"findTieGraphicalNoteFromNote",value:function(e){var t,n=_createForOfIteratorHelper(this.graphicalVoiceEntries);try{for(n.s();!(t=n.n()).done;){var i,r=_createForOfIteratorHelper(t.value.notes);try{for(r.s();!(i=r.n()).done;){var a=i.value,s=a.sourceNote;if(!s.isRest()&&s.Pitch.FundamentalNote===e.Pitch.FundamentalNote&&s.Pitch.Octave===e.Pitch.Octave&&s.getAbsoluteTimestamp().Equals(e.getAbsoluteTimestamp()))return a}}catch(err){r.e(err)}finally{r.f()}}}catch(err){n.e(err)}finally{n.f()}}},{key:"findEndTieGraphicalNoteFromNoteWithStartingSlur",value:function(e,t){if(e){var n,i=_createForOfIteratorHelper(this.graphicalVoiceEntries);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(r.parentVoiceEntry===e.ParentVoiceEntry){var a,s=_createForOfIteratorHelper(r.notes);try{for(s.s();!(a=s.n()).done;){var o=a.value,l=o.sourceNote;if(l.NoteTie&&-1!==l.NoteSlurs.indexOf(t))return o}}catch(err){s.e(err)}finally{s.f()}}}}catch(err){i.e(err)}finally{i.f()}}}},{key:"findGraphicalNoteFromGraceNote",value:function(e){if(e){var t,n=_createForOfIteratorHelper(this.graphicalVoiceEntries);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i.parentVoiceEntry===e.ParentVoiceEntry){var r,a=_createForOfIteratorHelper(i.notes);try{for(a.s();!(r=a.n()).done;){var s=r.value;if(s.sourceNote===e)return s}}catch(err){a.e(err)}finally{a.f()}}}}catch(err){n.e(err)}finally{n.f()}}}},{key:"findGraphicalNoteFromNote",value:function(e){if(e){var t,n=_createForOfIteratorHelper(this.graphicalVoiceEntries);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i.parentVoiceEntry===e.ParentVoiceEntry){var r,a=_createForOfIteratorHelper(i.notes);try{for(a.s();!(r=a.n()).done;){var s=r.value;if(s.sourceNote===e&&this.getAbsoluteTimestamp().Equals(e.getAbsoluteTimestamp()))return s}}catch(err){a.e(err)}finally{a.f()}}}}catch(err){n.e(err)}finally{n.f()}}}},{key:"getGraphicalNoteDurationFromVoice",value:function(e){var t,n=_createForOfIteratorHelper(this.graphicalVoiceEntries);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i.parentVoiceEntry.ParentVoice===e)return i.notes[0].graphicalNoteLength}}catch(err){n.e(err)}finally{n.f()}return new Fraction$1(0,1)}},{key:"findVoiceEntryGraphicalNotes",value:function(e){var t,n=_createForOfIteratorHelper(this.graphicalVoiceEntries);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i.parentVoiceEntry===e)return i.notes}}catch(err){n.e(err)}finally{n.f()}}},{key:"isVoiceEntryPartOfLinkedVoiceEntry",value:function(e){if(this.sourceStaffEntry.Link)for(var t=0,n=this.sourceStaffEntry.Link.LinkStaffEntries.length;t0&&(t=a)}}catch(err){r.e(err)}finally{r.f()}}}catch(err){n.e(err)}finally{n.f()}return t}},{key:"findStaffEntryMaxNoteLength",value:function(){var e,t=new Fraction$1(0,1),n=_createForOfIteratorHelper(this.graphicalVoiceEntries);try{for(n.s();!(e=n.n()).done;){var i,r=_createForOfIteratorHelper(e.value.notes);try{for(r.s();!(i=r.n()).done;){var a=i.value.graphicalNoteLength;t.lt(a)&&a.GetExpandedNumerator()>0&&(t=a)}}catch(err){r.e(err)}finally{r.f()}}}catch(err){n.e(err)}finally{n.f()}return t}},{key:"findOrCreateGraphicalVoiceEntry",value:function(e){var t,n=_createForOfIteratorHelper(this.graphicalVoiceEntries);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i.parentVoiceEntry===e)return i}}catch(err){n.e(err)}finally{n.f()}var r=MusicSheetCalculator.symbolFactory.createVoiceEntry(e,this);return this.graphicalVoiceEntries.push(r),r}},{key:"findOrCreateGraphicalVoiceEntryFromGraphicalNote",value:function(e){var t,n=_createForOfIteratorHelper(this.graphicalVoiceEntries);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i===e.parentVoiceEntry)return i}}catch(err){n.e(err)}finally{n.f()}var r=MusicSheetCalculator.symbolFactory.createVoiceEntry(e.sourceNote.ParentVoiceEntry,this);return this.graphicalVoiceEntries.push(r),r}},{key:"addGraphicalNoteToListAtCorrectYPosition",value:function(e,t){var n=e.notes;if(0===n.length||t.PositionAndShape.RelativePosition.y=0;i--){if(n[i].PositionAndShape.RelativePosition.y>t.PositionAndShape.RelativePosition.y){n.splice(i+1,0,t);break}if(0===i){n.splice(0,0,t);break}}}},{key:"hasOnlyRests",value:function(){var e,t=_createForOfIteratorHelper(this.graphicalVoiceEntries);try{for(t.s();!(e=t.n()).done;){var n,i=_createForOfIteratorHelper(e.value.notes);try{for(i.s();!(n=i.n()).done;){if(!n.value.sourceNote.isRest())return!1}}catch(err){i.e(err)}finally{i.f()}}}catch(err){t.e(err)}finally{t.f()}return!0}},{key:"getSkylineMin",value:function(){var e,t=null===(e=this.parentMeasure)||void 0===e?void 0:e.ParentStaffLine.SkyBottomLineCalculator;if(t){var n=_slicedToArray(this.getAbsoluteStartAndEnd(),2),i=n[0],r=n[1];return t.getSkyLineMinInRange(i,r)}}},{key:"getHighestYAtEntry",value:function(){return this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.y+this.getSkylineMin()}},{key:"getLowestYAtEntry",value:function(){return this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.y+this.getBottomlineMax()}},{key:"getBottomlineMax",value:function(){var e,t=null===(e=this.parentMeasure)||void 0===e?void 0:e.ParentStaffLine.SkyBottomLineCalculator;if(t){var n=_slicedToArray(this.getAbsoluteStartAndEnd(),2),i=n[0],r=n[1];return t.getBottomLineMaxInRange(i,r)}}},{key:"getAbsoluteStartAndEnd",value:function(){var e=this.PositionAndShape.AbsolutePosition.x;return[e-=this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.x,e+this.PositionAndShape.Size.width]}}]),n}(GraphicalObject),VF$8=Vex.Flow,VexFlowStaffEntry=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i,r){return _classCallCheck2(this,n),t.call(this,e,i,r)}return _createClass2(n,[{key:"calculateXPosition",value:function(){var e,t=this.parentMeasure.getVFStave(),n=0,i=_createForOfIteratorHelper(this.graphicalVoiceEntries);try{for(i.s();!(e=i.n()).done;){var r=e.value;if(r.vfStaveNote){if(r.vfStaveNote.setStave(t),t&&t.getLines&&1===t.getLines()&&r.vfStaveNote.getStemDirection()<0&&(r.vfStaveNote.setStemDirection(VF$8.Stem.UP),r.parentVoiceEntry.StemDirection=StemDirectionType.Up),!r.vfStaveNote.preFormatted)continue;r.applyBordersFromVexflow(),this.parentMeasure.ParentStaff.isTab?this.PositionAndShape.RelativePosition.x=(r.vfStaveNote.getAbsoluteX()+r.vfStaveNote.glyph.getWidth())/unitInPixels:this.PositionAndShape.RelativePosition.x=r.vfStaveNote.getBoundingBox().getX()/unitInPixels;var a=r.notes[0].sourceNote;a.isRest()&&a.Length.RealValue===this.parentMeasure.parentSourceMeasure.ActiveTimeSignature.RealValue&&(this.PositionAndShape.RelativePosition.x+=this.parentMeasure.parentSourceMeasure.Rules.WholeRestXShiftVexflow-.1,r.PositionAndShape.BorderLeft=-.7,r.PositionAndShape.BorderRight=.7),r.PositionAndShape.BorderLeft=0;s--){if(Math.abs(e[i]-e[s])<=t&&r===n[s]){r++,a=!0;break}a=!1}n.push(r)}return n}}]),n}(GraphicalStaffEntry);Vex.Flow;var VexFlowGraphicalNote=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i,r){var a,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:OctaveEnum.NONE,o=arguments.length>4?arguments[4]:void 0,l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:void 0;if(_classCallCheck2(this,n),(a=t.call(this,e,i,o,l)).clef=r,a.octaveShift=s,e.Pitch){var u=e.isRest()?e.Pitch:OctaveShift.getPitchFromOctaveShift(e.Pitch,s);a.vfpitch=VexFlowConverter.pitch(u,e.isRest(),a.clef,a.sourceNote.Notehead),a.vfpitch[1]=void 0}return a}return _createClass2(n,[{key:"setAccidental",value:function(e){var t=this.drawPitch(e);this.vfpitch=VexFlowConverter.pitch(t,this.sourceNote.isRest(),this.clef,this.sourceNote.Notehead),this.DrawnAccidental=t.Accidental}},{key:"drawPitch",value:function(e){return OctaveShift.getPitchFromOctaveShift(e,this.octaveShift)}},{key:"Transpose",value:function(e,t,i,r){var a=_get(_getPrototypeOf2(n.prototype),"Transpose",this).call(this,e,t,i,r),s=OctaveShift.getPitchFromOctaveShift(a,this.octaveShift);return this.vfpitch=VexFlowConverter.pitch(s,this.sourceNote.isRest(),this.clef,this.sourceNote.Notehead),this.vfpitch[1]=void 0,s}},{key:"setIndex",value:function(e,t){this.vfnote=[e,t],this.vfnoteIndex=t}},{key:"notehead",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=e;t||(t=this.vfnote[0]);var n=t.note_heads;return n&&n.length>this.vfnoteIndex&&n[this.vfnoteIndex]?t.note_heads[this.vfnoteIndex]:{line:0}}},{key:"Clef",value:function(){return this.clef}},{key:"getSVGId",value:function(){if(this.vfnote)return this.vfnote[0].getAttribute("id")}},{key:"getSVGGElement",value:function(){if(this.vfnote)return this.vfnote[0].getAttribute("el")}},{key:"getStemSVG",value:function(){return document.getElementById("vf-"+this.getSVGId()+"-stem")}},{key:"getBeamSVGs",value:function(){for(var e=[],t=0;;t++){var n=document.getElementById("vf-".concat(this.getSVGId(),"-beam").concat(t));if(!n)break;e.push(n)}return e}}]),n}(GraphicalNote),GraphicalChordSymbolContainer=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i,r,a,s,o){var l;return _classCallCheck2(this,n),(l=t.call(this)).chordSymbolContainer=e,l.boundingBox=new BoundingBox$2(_assertThisInitialized2(l),i),l.rules=o,l.calculateLabel(r,s,a),l}return _createClass2(n,[{key:"GetChordSymbolContainer",get:function(){return this.chordSymbolContainer}},{key:"GraphicalLabel",get:function(){return this.graphicalLabel}},{key:"calculateLabel",value:function(e,t,n){var i=ChordSymbolContainer.calculateChordText(this.chordSymbolContainer,t,n);this.graphicalLabel=new GraphicalLabel(new Label(i),e,this.rules.ChordSymbolTextAlignment,this.rules,this.boundingBox),this.graphicalLabel.PositionAndShape.RelativePosition=new PointF2D(this.rules.ChordSymbolRelativeXOffset,0),this.graphicalLabel.Label.colorDefault=this.rules.DefaultColorChordSymbol}}]),n}(GraphicalObject),VF$7=Vex.Flow,VexFlowTabMeasure=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return _classCallCheck2(this,n),(i=t.call(this,e,r,a)).isTabMeasure=!0,i}return _createClass2(n,[{key:"resetLayout",value:function(){var e,t=null!==(e=this.ParentStaff.StafflineCount)&&void 0!==e?e:6;this.stave=new VF$7.TabStave(0,0,0,{space_above_staff_ln:0,space_below_staff_ln:0,num_lines:t}),this.updateInstructionWidth()}},{key:"graphicalMeasureCreatedCalculations",value:function(){for(var e=0,t=this.staffEntries.length;e1){var d=VexFlowConverter.StrokeTypeFromArpeggioType(f.type),p=new VF$7.Stroke(d,{all_voices:this.rules.ArpeggiosGoAcrossVoices});this.rules.RenderArpeggios&&h.vfStaveNote.addStroke(0,p)}else log$2.debug("[OSMD] arpeggio in measure ".concat(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[o.VoiceId].addTickable(h.vfStaveNote)}else this.vfVoices[o.VoiceId].addTickable(h.vfStaveNote)}}}catch(err){u.e(err)}finally{u.f()}}}}catch(err){s.e(err)}finally{s.f()}}}]),n}(VexFlowMeasure),StaffLine=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i){var r;return _classCallCheck2(this,n),(r=t.call(this)).measures=[],r.staffLines=new Array(5),r.octaveShifts=[],r.lyricLines=[],r.lyricsDashes=[],r.abstractExpressions=[],r.graphicalSlurs=[],r.Pedals=[],r.WavyLines=[],r.parentMusicSystem=e,r.parentStaff=i,r.boundingBox=new BoundingBox$2(_assertThisInitialized2(r),e.PositionAndShape),r.skyBottomLine=MusicSheetCalculator.symbolFactory.createSkyBottomLineCalculator(_assertThisInitialized2(r)),r.staffHeight=r.parentMusicSystem.rules.StaffHeight,r.topLineOffset=0,r.bottomLineOffset=4,r.calculateStaffLineOffsets(),r}return _createClass2(n,[{key:"calculateStaffLineOffsets",value:function(){if(this.ParentStaff.isTab)if(5===this.ParentStaff.StafflineCount)this.staffHeight=this.bottomLineOffset=6*this.ParentStaff.ParentInstrument.GetMusicSheet.Rules.TabStaffInterlineHeight;else 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}}},{key:"Measures",get:function(){return this.measures},set:function(e){this.measures=e}},{key:"StaffLines",get:function(){return this.staffLines},set:function(e){this.staffLines=e}},{key:"Index",get:function(){return this.parentMusicSystem.StaffLines.indexOf(this)}},{key:"NextStaffLine",get:function(){var e=this.Index;return e!==this.parentMusicSystem.StaffLines.length?this.parentMusicSystem.StaffLines[e+1]:void 0}},{key:"LyricLines",get:function(){return this.lyricLines},set:function(e){this.lyricLines=e}},{key:"AbstractExpressions",get:function(){return this.abstractExpressions},set:function(e){this.abstractExpressions=e}},{key:"LyricsDashes",get:function(){return this.lyricsDashes},set:function(e){this.lyricsDashes=e}},{key:"ParentMusicSystem",get:function(){return this.parentMusicSystem},set:function(e){this.parentMusicSystem=e}},{key:"ParentStaff",get:function(){return this.parentStaff},set:function(e){this.parentStaff=e}},{key:"SkyBottomLineCalculator",get:function(){return this.skyBottomLine}},{key:"SkyLine",get:function(){return this.skyBottomLine.SkyLine}},{key:"BottomLine",get:function(){return this.skyBottomLine.BottomLine}},{key:"OctaveShifts",get:function(){return this.octaveShifts},set:function(e){this.octaveShifts=e}},{key:"StaffHeight",get:function(){return this.staffHeight}},{key:"TopLineOffset",get:function(){return this.topLineOffset}},{key:"BottomLineOffset",get:function(){return this.bottomLineOffset}},{key:"GraphicalSlurs",get:function(){return this.graphicalSlurs}},{key:"addSlurToStaffline",value:function(e){this.graphicalSlurs.push(e)}},{key:"addActivitySymbolClickArea",value:function(){var e=new StaffLineActivitySymbol(this),t=this.PositionAndShape;e.PositionAndShape.RelativePosition=new PointF2D(t.RelativePosition.x+t.BorderRight+.5,t.RelativePosition.y+.5),e.PositionAndShape.Parent=this.parentMusicSystem.PositionAndShape}},{key:"isPartOfMultiStaffInstrument",value:function(){return this.parentStaff.ParentInstrument.Staves.length>1}},{key:"findClosestStaffEntry",value:function(e){for(var t=void 0,n=0,i=this.Measures.length;n0)for(var h=c.map((function(e){return e.PositionAndShape.Center.y})),f=Math.max.apply(Math,_toConsumableArray2(h)),d=0;d0?c[d-1]:void 0;if(v){var y=this.getOverlap(p.PositionAndShape,v.PositionAndShape);p.squeeze(-(y.x+this.rules.DynamicExpressionSpacer))}if(g){var b=this.getOverlap(g.PositionAndShape,p.PositionAndShape);p.squeeze(b.x+this.rules.DynamicExpressionSpacer)}}}}}},{key:"getDistance",value:function(e,t){var n=e.RelativePosition.x+e.BorderMarginRight,i=t.RelativePosition.x+t.BorderMarginLeft,r=e.RelativePosition.y+e.BorderMarginBottom,a=t.RelativePosition.y+t.BorderMarginTop;return new PointF2D(i-n,a-r)}},{key:"getOverlap",value:function(e,t){return new PointF2D(e.RelativePosition.x+e.BorderMarginRight-(t.RelativePosition.x+t.BorderMarginLeft),e.RelativePosition.y+e.BorderMarginBottom-(t.RelativePosition.y+t.BorderMarginTop))}}]),e}(),VexFlowStaffLine=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i){var r;return _classCallCheck2(this,n),(r=t.call(this,e,i)).slursInVFStaffLine=[],r.alignmentManager=new AlignmentManager(_assertThisInitialized2(r)),r}return _createClass2(n,[{key:"SlursInVFStaffLine",get:function(){return this.slursInVFStaffLine}},{key:"addVFSlurToVFStaffline",value:function(e){this.slursInVFStaffLine.push(e)}},{key:"AlignmentManager",get:function(){return this.alignmentManager}}]),n}(StaffLine),VF$6=Vex.Flow,VexFlowMultiRestMeasure=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return _classCallCheck2(this,n),(i=t.call(this,e,r,a)).minimumStaffEntriesWidth=-1,a?i.rules=a.ParentMusicSystem.rules:r&&(i.rules=r.Rules),i.resetLayout(),i.multiRestElement=new VF$6.MultiMeasureRest(r.multipleRestMeasures,{}),i}return _createClass2(n,[{key:"draw",value:function(e){var t,n,i,r,a,s=e.openGroup();null==s||null===(t=s.classList)||void 0===t||t.add("vf-measure");var o=e.openGroup();null==o||null===(n=o.classList)||void 0===n||n.add("vf-stave"),null==o||o.setAttribute("id",null===(i=this.stave)||void 0===i||null===(r=i.attrs)||void 0===r?void 0:r.id),this.stave.setContext(e).draw(),e.closeGroup();var l=e.openGroup();null==l||null===(a=l.classList)||void 0===a||a.add("vf-voices"),this.multiRestElement.setStave(this.stave),this.multiRestElement.setContext(e),this.multiRestElement.draw(),e.closeGroup();var u,c=_createForOfIteratorHelper(this.connectors);try{for(c.s();!(u=c.n()).done;){u.value.setContext(e).draw()}}catch(err){c.e(err)}finally{c.f()}return e.closeGroup(),s}},{key:"format",value:function(){}},{key:"getVoicesWithinMeasure",value:function(){return[]}},{key:"getGraphicalVoiceEntriesPerVoice",value:function(e){return[]}},{key:"getRestFilledVexFlowStaveNotesPerVoice",value:function(e){return[]}},{key:"handleBeam",value:function(e,t){}},{key:"handleTuplet",value:function(e,t){}},{key:"finalizeBeams",value:function(){}},{key:"finalizeTuplets",value:function(){}},{key:"layoutStaffEntry",value:function(e){}},{key:"graphicalMeasureCreatedCalculations",value:function(){}},{key:"createArticulations",value:function(){}},{key:"createOrnaments",value:function(){}},{key:"createFingerings",value:function(e){}},{key:"getVFStave",value:function(){return this.stave}}]),n}(VexFlowMeasure),VF$5=Vex.Flow,VexFlowBackend=function(){function e(){_classCallCheck2(this,e)}return _createClass2(e,[{key:"getInnerElement",value:function(){return this.inner}},{key:"getCanvas",value:function(){return this.canvas}},{key:"getRenderElement",value:function(){var e=this.canvas;return this.getVexflowBackendType()===VF$5.Renderer.Backends.CANVAS&&(e=this.inner),e}},{key:"getRenderer",value:function(){return this.renderer}},{key:"removeAllChildrenFromContainer",value:function(e){for(;0!==e.children.length;)e.removeChild(e.children.item(0))}},{key:"removeFromContainer",value:function(e){for(var t=this.getRenderElement(),n=0;n0&&void 0!==arguments[0]?arguments[0]:300,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;this.graphicalMusicPage||(this.graphicalMusicPage=new GraphicalMusicPage(void 0),this.graphicalMusicPage.PageNumber=1),this.canvas=document.createElement("canvas"),this.canvas.width=e,this.canvas.height=t,this.renderer=new VF$4.Renderer(this.canvas,this.getVexflowBackendType()),this.ctx=this.renderer.getContext()}},{key:"getContext",value:function(){return this.ctx}},{key:"clear",value:function(){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())}},{key:"scale",value:function(e){this.ctx.scale(e,e)}},{key:"translate",value:function(e,t){this.CanvasRenderingCtx.translate(e,t)}},{key:"renderText",value:function(e,t,n,i,r,a){var s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:void 0,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:void 0,l=this.CanvasRenderingCtx.font;this.CanvasRenderingCtx.save(),this.CanvasRenderingCtx.font=VexFlowConverter.font(e,t,n,this.rules,o),this.CanvasRenderingCtx.fillStyle=s,this.CanvasRenderingCtx.strokeStyle=s,this.CanvasRenderingCtx.fillText(i,a.x,a.y+r),this.CanvasRenderingCtx.restore(),this.CanvasRenderingCtx.font=l}},{key:"renderRectangle",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=this.CanvasRenderingCtx.fillStyle;this.CanvasRenderingCtx.fillStyle=n||VexFlowConverter.style(t),this.CanvasRenderingCtx.globalAlpha=i,this.ctx.fillRect(e.x,e.y,e.width,e.height),this.CanvasRenderingCtx.fillStyle=r,this.CanvasRenderingCtx.globalAlpha=1}},{key:"renderLine",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#FF0000FF",i=this.CanvasRenderingCtx.strokeStyle;this.CanvasRenderingCtx.strokeStyle=n,this.CanvasRenderingCtx.beginPath(),this.CanvasRenderingCtx.moveTo(e.x,e.y),this.CanvasRenderingCtx.lineTo(t.x,t.y),this.CanvasRenderingCtx.stroke(),this.CanvasRenderingCtx.strokeStyle=i}},{key:"renderCurve",value:function(e){this.ctx.beginPath(),this.ctx.moveTo(e[0].x,e[0].y),this.ctx.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y),this.ctx.lineTo(e[7].x,e[7].y),this.ctx.bezierCurveTo(e[6].x,e[6].y,e[5].x,e[5].y,e[4].x,e[4].y),this.ctx.lineTo(e[0].x,e[0].y),this.ctx.closePath(),this.ctx.fill()}},{key:"CanvasRenderingCtx",get:function(){return this.ctx.vexFlowCanvasContext}}]),n}(VexFlowBackend),VF$3=Vex.Flow,SvgVexFlowBackend=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e){var i;return _classCallCheck2(this,n),(i=t.call(this)).rules=e,i}return _createClass2(n,[{key:"getVexflowBackendType",value:function(){return VF$3.Renderer.Backends.SVG}},{key:"getOSMDBackendType",value:function(){return BackendType.SVG}},{key:"getCanvasSize",value:function(){var e;return null===(e=document.getElementById(this.rules.DYContainerId+this.graphicalMusicPage.PageNumber))||void 0===e?void 0:e.offsetHeight}},{key:"initialize",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;this.zoom=t,this.canvas=document.createElement("div"),n||(n=this.graphicalMusicPage?this.graphicalMusicPage.PageNumber.toString():"1"),this.canvas.id=this.rules.DYContainerId+n,this.inner=this.canvas,this.inner.style.position="relative",this.canvas.style.zIndex="0",e.appendChild(this.inner),this.renderer=new Vex.Flow.Renderer(this.canvas,this.getVexflowBackendType()),this.ctx=this.renderer.getContext(),this.ctx.svg.id=this.rules.DYSVGContainerId+n}},{key:"getContext",value:function(){return this.ctx}},{key:"getSvgElement",value:function(){return this.ctx.svg}},{key:"removeNode",value:function(e){var t,n=null===(t=this.ctx)||void 0===t?void 0:t.svg;if(!n)return!1;try{n.removeChild(e)}catch(i){return log$2.error(i),!1}return!0}},{key:"clear",value:function(){if(this.ctx){for(var e=this.ctx.svg;e.lastChild;)e.removeChild(e.lastChild);this.rules.PageBackgroundColor&&(this.ctx.svg.style["background-color"]=this.rules.PageBackgroundColor)}}},{key:"scale",value:function(e){this.ctx.scale(e,e)}},{key:"translate",value:function(e,t){}},{key:"renderText",value:function(e,t,n,i,r,a){var s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:void 0,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:void 0;this.ctx.save();var l=this.ctx.openGroup("text");s&&(this.ctx.attributes.fill=s,this.ctx.attributes.stroke=s);var u=o;o&&"default"!==o||(u=this.rules.DefaultFontFamily),this.ctx.setFont(u,e,VexFlowConverter.fontStyle(t)),this.ctx.attributes["font-size"]="".concat(e,"px"),this.ctx.state["font-size"]="".concat(e,"px");var c="normal",h="normal";switch(t){case FontStyles.Bold:c="bold";break;case FontStyles.Italic:h="italic";break;case FontStyles.BoldItalic:c="bold",h="italic";break;default:c="normal"}return this.ctx.attributes["font-weight"]=c,this.ctx.state["font-weight"]=c,this.ctx.attributes["font-style"]=h,this.ctx.state["font-style"]=h,this.ctx.fillText(i,a.x,a.y+r),this.ctx.closeGroup(),this.ctx.restore(),l}},{key:"renderRectangle",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.ctx.save();var r=this.ctx.openGroup("rect");return this.ctx.attributes.fill=n||VexFlowConverter.style(t),this.ctx.attributes["fill-opacity"]=i,this.ctx.fillRect(e.x,e.y,e.width,e.height),this.ctx.restore(),this.ctx.attributes["fill-opacity"]=1,this.ctx.closeGroup(),r}},{key:"renderLine",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#FF0000FF",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;this.ctx.save();var r=this.ctx.openGroup("line");return this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(t.x,t.y),this.ctx.attributes.stroke=n,this.ctx.lineWidth=i,this.ctx.stroke(),this.ctx.closeGroup(),this.ctx.restore(),r}},{key:"renderCurve",value:function(e){var t=this.ctx.openGroup("curve");return this.ctx.beginPath(),this.ctx.moveTo(e[0].x,e[0].y),this.ctx.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y),this.ctx.lineTo(e[7].x,e[7].y),this.ctx.bezierCurveTo(e[6].x,e[6].y,e[5].x,e[5].y,e[4].x,e[4].y),this.ctx.lineTo(e[0].x,e[0].y),this.ctx.closePath(),this.ctx.fill(),this.ctx.closeGroup(),t}},{key:"export",value:function(){var e=this.ctx.svg.cloneNode(!0),t=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),n=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",t);n.replaceChild(e,n.documentElement);var i=(new XMLSerializer).serializeToString(n),r=document.createElement("a");r.href="data:image/svg+xml; charset=utf8, "+encodeURIComponent(i.replace(/>\n\r<")),r.download="opensheetmusicdisplay_download.svg",r.innerHTML=window.location.href+"/download",document.body.appendChild(r)}}]),n}(VexFlowBackend),VexFlowInstantaneousDynamicExpression=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i,r){var a;_classCallCheck2(this,n),a=t.call(this,e,i,r);var s=new Label(a.Expression);return a.label=new GraphicalLabel(s,a.rules.ContinuousDynamicTextHeight,TextAlignmentEnum.CenterCenter,a.rules,a.PositionAndShape),a.label.Label.fontStyle=FontStyles.BoldItalic,a.label.setLabelPositionAndShapeBorders(),a.PositionAndShape.calculateBoundingBox(),a}return _createClass2(n,[{key:"InstantaneousDynamic",get:function(){return this.mInstantaneousDynamicExpression}},{key:"Expression",get:function(){return DynamicEnum[this.mInstantaneousDynamicExpression.DynEnum]}}]),n}(GraphicalInstantaneousDynamicExpression),GraphicalOctaveShift=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i){var r;return _classCallCheck2(this,n),(r=t.call(this)).getOctaveShift=e,r.setSymbol(),r.PositionAndShape=new BoundingBox$2(_assertThisInitialized2(r),i),r}return _createClass2(n,[{key:"setSymbol",value:function(){switch(this.getOctaveShift.Type){case OctaveEnum.VA8:this.octaveSymbol=MusicSymbol.VA8;break;case OctaveEnum.VB8:this.octaveSymbol=MusicSymbol.VB8;break;case OctaveEnum.MA15:this.octaveSymbol=MusicSymbol.MA15;break;case OctaveEnum.MB15:this.octaveSymbol=MusicSymbol.MB15;break;default:throw new ArgumentOutOfRangeException("")}}}]),n}(GraphicalObject),VF$2=Vex.Flow,VexFlowOctaveShift=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i){var r;switch(_classCallCheck2(this,n),r=t.call(this,e,i),e.Type){case OctaveEnum.VA8:r.position=VF$2.TextBracket.Positions.TOP,r.supscript="va",r.text="8";break;case OctaveEnum.MA15:r.position=VF$2.TextBracket.Positions.TOP,r.supscript="ma",r.text="15";break;case OctaveEnum.VB8:r.position=VF$2.TextBracket.Positions.BOTTOM,r.supscript="vb",r.text="8";break;case OctaveEnum.MB15:r.position=VF$2.TextBracket.Positions.BOTTOM,r.supscript="mb",r.text="15";break;default:log$2.error("Unknown or NONE octaveshift. This should not be called!")}return r}return _createClass2(n,[{key:"setStartNote",value:function(e){var t,n=_createForOfIteratorHelper(e.graphicalVoiceEntries);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(null!=i&&i.vfStaveNote)return this.startNote=i.vfStaveNote,!0}}catch(err){n.e(err)}finally{n.f()}return!1}},{key:"setEndNote",value:function(e){var t,n=_createForOfIteratorHelper(e.graphicalVoiceEntries);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(null!=i&&i.vfStaveNote)return this.endNote=i.vfStaveNote,!0}}catch(err){n.e(err)}finally{n.f()}return!1}},{key:"getTextBracket",value:function(){return new VF$2.TextBracket({position:this.position,start:this.startNote,stop:this.endNote,superscript:this.supscript,text:this.text})}}]),n}(GraphicalOctaveShift);Vex.Flow;var VexflowStafflineNoteCalculator=function(){function e(t){_classCallCheck2(this,e),this.staffPitchListMapping=new Dictionary,this.baseLineNote=NoteEnum.B,this.baseLineOctave=1,this.rules=t}return _createClass2(e,[{key:"trackNote",value:function(t){if(t instanceof VexFlowGraphicalNote&&t.Clef().ClefType===ClefEnum.percussion&&!t.sourceNote.isRest()&&0!==this.rules.PercussionOneLineCutoff&&-1!==this.rules.PercussionForceVoicesOneLineCutoff){var n,i=t.parentVoiceEntry.parentStaffEntry.sourceStaffEntry.ParentStaff.idInMusicSheet;this.staffPitchListMapping.containsKey(i)||this.staffPitchListMapping.setValue(i,new Array),n=this.staffPitchListMapping.getValue(i);var r=t.sourceNote.Pitch;e.findOrInsert(n,r)}}},{key:"positionNote",value:function(t){var n=t.parentVoiceEntry.parentStaffEntry.sourceStaffEntry.ParentStaff.idInMusicSheet;if(!(t instanceof VexFlowGraphicalNote)||t.sourceNote.isRest()||!this.staffPitchListMapping.containsKey(n))return t;var i=this.staffPitchListMapping.getValue(n),r=this.rules.PercussionUseXMLDisplayStep&&void 0!==t.sourceNote.displayStepUnpitched;if(i.length>this.rules.PercussionOneLineCutoff&&!r)return t;var a=t,s=t.sourceNote.Pitch,o=this.baseLineNote,l=this.baseLineOctave;if(this.rules.PercussionUseXMLDisplayStep&&void 0!==t.sourceNote.displayStepUnpitched&&(o=t.sourceNote.displayStepUnpitched,l=t.sourceNote.displayOctaveUnpitched+this.rules.PercussionOneLineXMLDisplayStepOctaveOffset),i.length<=this.rules.PercussionForceVoicesOneLineCutoff)a.setAccidental(new Pitch(o,l,s.Accidental));else{var u=e.PitchIndexOf(i,s);if(u>-1){var c=Math.ceil(i.length/2);if(!this.rules.PercussionUseXMLDisplayStep)if(u>=c)switch(l=2,(u-c)%5){case 1:o=NoteEnum.E;break;case 2:o=NoteEnum.G;break;case 3:o=NoteEnum.B;break;case 4:o=NoteEnum.D,l=3;break;default:o=NoteEnum.C}else switch(u%5){case 1:o=NoteEnum.F;break;case 2:o=NoteEnum.D;break;case 3:o=NoteEnum.B,l=0;break;case 4:o=NoteEnum.G,l=0;break;default:o=NoteEnum.A}var h=new Pitch(o,l,s.Accidental);a.setAccidental(h);var f=a.parentVoiceEntry.parentVoiceEntry;!this.rules.SetWantedStemDirectionByXml&&f.Notes.length<2&&(h.Octave>this.baseLineOctave||h.FundamentalNote===this.baseLineNote&&h.Octave===this.baseLineOctave?a.parentVoiceEntry.parentVoiceEntry.WantedStemDirection=StemDirectionType.Up:a.parentVoiceEntry.parentVoiceEntry.WantedStemDirection=StemDirectionType.Down)}}return a}},{key:"getStafflineUniquePositionCount",value:function(e){return this.staffPitchListMapping.containsKey(e)?this.staffPitchListMapping.getValue(e).length:0}}],[{key:"PitchIndexOf",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(n>e.length-1)return-1;for(var i=n;i0||o.IsExtraGraphicalMeasure||(log$2.warn("SkyBottomLineCalculator: width not > 0 in measure "+o.MeasureNumber),u=50),u>=50||!o.IsExtraGraphicalMeasure){i.initializeHeadless(u);var c=i.getContext(),h=i.getCanvas();u=h.width;var f=h.height;"jianpu"===this.mRules.DYMusicScoreType?l.setY(l.y-50):l.setY(l.y+100);var d=l.getWidth();l.setWidth(u),o.format(),l.setWidth(d);try{o.draw(c)}catch(I){log$2.warn("SkyBottomLineCalculator.calculateLines.draw",I)}for(var p=c.getImageData(0,0,u,f),m=Math.max(Math.ceil(o.PositionAndShape.Size.width*this.mRules.SamplingUnit),1),v=new Array(m),g=new Array(m),y=0;y0){v[y]=b;break}}for(var S=f;S>0;S--){var x=S*u*4+4*y;if(p.data[x+3]>0){g[y]=S;break}}}for(var w=0;w=0;n--)if(!isNaN(t[n]))return t[n];return 0}},{key:"findNextValidNumber",value:function(e,t){if(e>=t.length)return t[e-1];for(var n=e;n2&&void 0!==arguments[2]?arguments[2]:"#FF0000FF",i=t.getContext(),r=i.fillStyle;i.fillStyle=n,i.fillRect(e.x,e.y,2,2),i.fillStyle=r}},{key:"updateSkyLineWithWedge",value:function(e,t){var n=Math.floor(e.x*this.SamplingUnit),i=Math.ceil(t.x*this.SamplingUnit),r=(t.y-e.y)/(t.x-e.x);i-n<=1&&(i++,r=0),n<0&&(n=0),n>=this.BottomLine.length&&(n=this.BottomLine.length-1),i<0&&(i=0),i>=this.BottomLine.length&&(i=this.BottomLine.length),this.SkyLine[n]=e.y;for(var a=n+1;a=this.BottomLine.length&&(n=this.BottomLine.length-1),i<0&&(i=0),i>=this.BottomLine.length&&(i=this.BottomLine.length),this.BottomLine[n]=e.y;for(var a=n+1;a=t?t-1:n}},{key:"getRightIndexForPointX",value:function(e,t){var n=Math.ceil(e*this.SamplingUnit);return n<0?0:n>=t?t-1:n}},{key:"updateStaffLineBorders",value:function(){this.mStaffLineParent.PositionAndShape.BorderTop=this.getSkyLineMin(),this.mStaffLineParent.PositionAndShape.BorderMarginTop=this.getSkyLineMin(),this.mStaffLineParent.PositionAndShape.BorderBottom=this.getBottomLineMax(),this.mStaffLineParent.PositionAndShape.BorderMarginBottom=this.getBottomLineMax()}},{key:"getSkyLineMin",value:function(){return Math.min.apply(Math,_toConsumableArray2(this.SkyLine.filter((function(e){return!isNaN(e)}))))}},{key:"getSkyLineMinAtPoint",value:function(e){var t=Math.round(e*this.SamplingUnit);return this.mSkyLine[t]}},{key:"getSkyLineMinInRange",value:function(e,t){return this.getMinInRange(this.SkyLine,e,t)}},{key:"getBottomLineMax",value:function(){return Math.max.apply(Math,_toConsumableArray2(this.BottomLine.filter((function(e){return!isNaN(e)}))))}},{key:"getBottomLineMaxAtPoint",value:function(e){var t=Math.round(e*this.SamplingUnit);return this.mBottomLine[t]}},{key:"getBottomLineMaxInRange",value:function(e,t){return this.getMaxInRange(this.BottomLine,e,t)}},{key:"getBottomLineMaxInBoundingBox",value:function(e){var t=Math.floor(e.AbsolutePosition.x+e.BorderLeft),n=Math.ceil(e.AbsolutePosition.x+e.BorderRight);return this.getMaxInRange(this.mBottomLine,t,n)}},{key:"updateWithBoundingBoxRecursively",value:function(e){if(e.ChildElements&&e.ChildElements.length>0){var t,n=_createForOfIteratorHelper(e.ChildElements);try{for(n.s();!(t=n.n()).done;){var i=t.value;this.updateWithBoundingBoxRecursively(i)}}catch(err){n.e(err)}finally{n.f()}}else{var r=e.BorderTop+e.AbsolutePosition.y,a=e.BorderBottom+e.AbsolutePosition.y;if(r<0){var s=Math.floor(e.AbsolutePosition.x+e.BorderLeft),o=Math.ceil(e.AbsolutePosition.x+e.BorderRight);this.updateInRange(this.mSkyLine,s,o,r)}else if(a>this.StaffLineParent.StaffHeight){var l=Math.floor(e.AbsolutePosition.x+e.BorderLeft),u=Math.ceil(e.AbsolutePosition.x+e.BorderRight);this.updateInRange(this.mBottomLine,l,u,a)}}}},{key:"updateInRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(t=Math.floor(t*this.SamplingUnit),(n=Math.ceil(n*this.SamplingUnit))e.length&&(n=e.length);for(var r=t;rMath.abs(e[r])?i:e[r]}},{key:"setInRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(t=Math.floor(t*this.SamplingUnit),(n=Math.ceil(n*this.SamplingUnit))e.length&&(n=e.length);for(var r=t;r=e.length&&(t=e.length-1),n<0&&(n=0),n>=e.length&&(n=e.length),t>=0&&n<=e.length?Math.min.apply(Math,_toConsumableArray2(e.slice(t,n+1))):void 0):Number.MAX_VALUE}},{key:"getMaxInRange",value:function(e,t,n){return t=Math.floor(t*this.SamplingUnit),n=Math.ceil(n*this.SamplingUnit),e?(t<0&&(t=0),t>=e.length&&(t=e.length-1),n<0&&(n=0),n>=e.length&&(n=e.length),t>=0&&n<=e.length?Math.max.apply(Math,_toConsumableArray2(e.slice(t,n+1))):void 0):Number.MIN_VALUE}},{key:"SamplingUnit",get:function(){return this.mRules.SamplingUnit}},{key:"StaffLineParent",get:function(){return this.mStaffLineParent}},{key:"SkyLine",get:function(){return this.mSkyLine}},{key:"BottomLine",get:function(){return this.mBottomLine}}]),e}(),parser$3={exports:{}}; /*! * d-path-parser - v1.0.0 * by Massimo Artizzu (MaxArt2501) * * https://github.com/MaxArt2501/d-path-parser * * Licensed under the MIT License * See LICENSE for details */ !function(e,t){e.exports=function(e){for(var t={command:/\s*([achlmqstvz])/gi,number:/\s*([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/gi,comma:/\s*(?:(,)|\s)/g,flag:/\s*([01])/g},n={number:function(e){return+c("number",e)},"coordinate pair":function(e){var t=c("number",e);return null!==t||e?(c("comma"),{x:+t,y:+c("number",!0)}):null},"arc definition":function(e){var t=n["coordinate pair"](e);if(!t&&!e)return null;c("comma");var i=+c("number",!0);c("comma",!0);var r=!!+c("flag",!0);c("comma");var a=!!+c("flag",!0);return c("comma"),{radii:t,rotation:i,large:r,clockwise:a,end:n["coordinate pair"](!0)}}},i=0,r=[];it.bottom)switch(e.tagName.toLowerCase()){case"g":var c,h=_createForOfIteratorHelper(e.children);try{for(h.s();!(c=h.n()).done;){var f=c.value;this.recursiveUpdate(f,t,n,i)}}catch(err){h.e(err)}finally{h.f()}break;case"circle":case"rect":case"line":case"path":var d=Math.floor((r.x-n.x)/unitInPixels*this.mRules.SamplingUnit),p=d+Math.ceil(r.width/unitInPixels*this.mRules.SamplingUnit);if(e.parentElement.classList.contains("vf-beams")&&e.hasAttribute("d")){var m=parse$3(e.getAttribute("d"));if(5===m.length)for(var v=m[0],g=m[3],y=(g.end.y-v.end.y)/(g.end.x-v.end.x),b=v.end.y/unitInPixels;d<=p;d++)bu[d]&&(u[d]=b),b+=y/this.mRules.SamplingUnit}else for(;d<=p;d++)au[d]&&(u[d]=s)}}},{key:"calculateLinesForMeasure",value:function(e,t){var n,i,r,a,s=t.getBBox(),o=Math.max(Math.round(e.PositionAndShape.Size.width*this.mRules.SamplingUnit),1),l=s.height/unitInPixels,u=t.getElementsByClassName("vf-stave")[0].getBBox(),c=(null==u?void 0:u.height)/unitInPixels,h=(null==u?void 0:u.y)/unitInPixels,f=e.getVFStave(),d=(null!==(n=f.options)&&void 0!==n&&n.num_lines?f.options.num_lines:5)-1,p=-1,m=0,v=[d],g=_createForOfIteratorHelper(null===(r=f.options)||void 0===r?void 0:r.line_config);try{for(g.s();!(a=g.n()).done;){a.value.visible?(-1===p&&(p=m),v.push(m)):d--,m++}}catch(err){g.e(err)}finally{g.f()}-1===p&&(p=0),d=v.pop()-p;var y=null===(i=f.options)||void 0===i?void 0:i.spacing_between_lines_px,b=d*y/unitInPixels;c-b>.2&&(c=b,h=p*y/unitInPixels);var _=h+c,S=new Array(o).fill(h),x=new Array(o).fill(_),w=[S,x];if(l>c){var k,E=_createForOfIteratorHelper(t.children);try{for(E.s();!(k=E.n()).done;){var T=k.value;this.recursiveUpdate(T,{top:h,bottom:_},s,[S,x])}}catch(err){E.e(err)}finally{E.f()}}return w}},{key:"calculateLines",value:function(){this.mSkyLine=[],this.mBottomLine=[];var e=document.createElement("div");document.body.append(e);var t=new SvgVexFlowBackend(this.mRules);t.initialize(e,1,"0");var n=t.getContext(),i=n.openGroup();i.classList.add("staffline");var r,a=_createForOfIteratorHelper(this.StaffLineParent.Measures);try{for(a.s();!(r=a.n()).done;){var s,o,l=r.value;l.PositionAndShape.calculateAbsolutePositionsRecursive(0,0),l.setAbsoluteCoordinates(l.PositionAndShape.AbsolutePosition.x*unitInPixels,l.PositionAndShape.AbsolutePosition.y*unitInPixels);var u=l.draw(n),c=_slicedToArray(this.calculateLinesForMeasure(l,u),2),h=c[0],f=c[1];(s=this.mSkyLine).push.apply(s,_toConsumableArray2(h)),(o=this.mBottomLine).push.apply(o,_toConsumableArray2(f))}}catch(err){a.e(err)}finally{a.f()}n.closeGroup();var d,p=_createForOfIteratorHelper(i.getElementsByClassName("vf-ties"));try{for(p.s();!(d=p.n()).done;){var m,v=_createForOfIteratorHelper(d.value.childNodes);try{for(v.s();!(m=v.n()).done;){var g=m.value;if("path"===g.nodeName.toLowerCase())for(var y=g.getBBox(),b=Math.floor(y.x/unitInPixels*this.mRules.SamplingUnit),_=b+Math.ceil(y.width/unitInPixels*this.mRules.SamplingUnit),S=y.y/unitInPixels,x=y.height/unitInPixels+S;b<=_;b++)Sthis.mBottomLine[b]&&(this.mBottomLine[b]=x)}}catch(err){v.e(err)}finally{v.f()}}}catch(err){p.e(err)}finally{p.f()}t.clear(),e.remove()}}]),n}(SkyBottomLineCalculator),VF$1=Vex.Flow,VexFlowGraphicalSymbolFactory=function(){function e(){_classCallCheck2(this,e),this.hasBBox=!1,void 0!==document.createElementNS("http://www.w3.org/2000/svg","g").getBBox&&(this.hasBBox=!0)}return _createClass2(e,[{key:"createMusicSystem",value:function(e,t){return new VexFlowMusicSystem(e,t)}},{key:"createStaffLine",value:function(e,t){return new VexFlowStaffLine(e,t)}},{key:"createSkyBottomLineCalculator",value:function(e){return e.ParentMusicSystem.rules.PerformanceMode&&this.hasBBox?new SkyBottomLineCalculatorSVG(e):new SkyBottomLineCalculator(e)}},{key:"createGraphicalMeasure",value:function(e,t){return new VexFlowMeasure(t,e,void 0)}},{key:"createMultiRestMeasure",value:function(e,t,n){return new VexFlowMultiRestMeasure(t,e,n)}},{key:"createTabStaffMeasure",value:function(e,t){return new VexFlowTabMeasure(t,e)}},{key:"createExtraGraphicalMeasure",value:function(e){var t=new VexFlowMeasure(e.ParentStaff,void 0,e);return t.IsExtraGraphicalMeasure=!0,t.ExtraGraphicalMeasurePreviousMeasure=e.Measures.last(),t}},{key:"createStaffEntry",value:function(e,t){return new VexFlowStaffEntry(t,e,void 0)}},{key:"createVoiceEntry",value:function(e,t){return new VexFlowVoiceEntry(e,t)}},{key:"createNote",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:OctaveEnum.NONE,r=arguments.length>4?arguments[4]:void 0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:void 0;return new VexFlowGraphicalNote(e,t,n,i,r,a)}},{key:"createGraceNote",value:function(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:OctaveEnum.NONE;return new VexFlowGraphicalNote(e,t,n,r,i)}},{key:"addGraphicalAccidental",value:function(e,t){e.setAccidental(t)}},{key:"addFermataAtTiedEndNote",value:function(e,t){}},{key:"createInStaffClef",value:function(e,t){var n=e,i=VexFlowConverter.Clef(t,"small");n.vfClefBefore=new VF$1.ClefNote(i.type,i.size,i.annotation)}},{key:"createChordSymbols",value:function(e,t,n,i){var r,a=t.parentMeasure.parentSourceMeasure.Rules,s=0,o=a.ChordSymbolXSpacing,l=_createForOfIteratorHelper(e.ChordContainers);try{for(l.s();!(r=l.n()).done;){var u=r.value,c=new GraphicalChordSymbolContainer(u,t.PositionAndShape,a.ChordSymbolTextHeight,n,i,t.parentMeasure.parentSourceMeasure.Rules),h=c.GraphicalLabel;h.PositionAndShape.RelativePosition.y-=a.ChordSymbolYOffset,h.PositionAndShape.RelativePosition.x+=s,h.setLabelPositionAndShapeBorders(),c.PositionAndShape.calculateBoundingBox(),t.graphicalChordContainers.push(c),s+=h.PositionAndShape.Size.width+o}}catch(err){l.e(err)}finally{l.f()}}},{key:"createGraphicalTechnicalInstruction",value:function(e,t){}}]),e}();Vex.Flow;var GraphicalTie=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;_classCallCheck2(this,e),this.tie=t,this.startNote=n,this.endNote=i}return _createClass2(e,[{key:"SVGElement",get:function(){return this.vfTie.getAttribute("el")}},{key:"GetTie",get:function(){return this.tie}},{key:"StartNote",get:function(){return this.startNote},set:function(e){this.startNote=e}},{key:"Tie",get:function(){return this.tie}},{key:"EndNote",get:function(){return this.endNote},set:function(e){this.endNote=e}}]),e}(),GraphicalLyricEntry=function(){function e(t,n,i,r){_classCallCheck2(this,e),this.lyricsEntry=t,this.graphicalStaffEntry=n;var a=n.parentMeasure.parentSourceMeasure.Rules.LyricsAlignmentStandard;t.Text.length>=4&&t.Parent.Notes[0].Length.Denominator>4&&TextAlignmentEnum.LeftBottom;var s=new Label(t.Text);this.graphicalLabel=new GraphicalLabel(s,i,a,this.graphicalStaffEntry.parentMeasure.parentSourceMeasure.Rules,n.PositionAndShape),this.graphicalLabel.PositionAndShape.RelativePosition=new PointF2D(0,r),a===TextAlignmentEnum.LeftBottom&&(this.graphicalLabel.PositionAndShape.RelativePosition.x-=1)}return _createClass2(e,[{key:"LyricsEntry",get:function(){return this.lyricsEntry}},{key:"ParentLyricWord",get:function(){return this.graphicalLyricWord},set:function(e){this.graphicalLyricWord=e}},{key:"GraphicalLabel",get:function(){return this.graphicalLabel},set:function(e){this.graphicalLabel=e}},{key:"StaffEntryParent",get:function(){return this.graphicalStaffEntry},set:function(e){this.graphicalStaffEntry=e}}]),e}(),GraphicalLyricWord=function(){function e(t){_classCallCheck2(this,e),this.graphicalLyricsEntries=[],this.lyricWord=t,this.initialize()}return _createClass2(e,[{key:"GetLyricWord",get:function(){return this.lyricWord}},{key:"GraphicalLyricsEntries",get:function(){return this.graphicalLyricsEntries},set:function(e){this.graphicalLyricsEntries=e}},{key:"isFilled",value:function(){for(var e=0;e=e.bezierCurveStepSize?new PointF2D:new PointF2D(e.oneMinusTPow3[n]*this.bezierStartPt.x+e.bezierFactorOne[n]*this.bezierStartControlPt.x+e.bezierFactorTwo[n]*this.bezierEndControlPt.x+e.tPow3[n]*this.bezierEndPt.x,e.oneMinusTPow3[n]*this.bezierStartPt.y+e.bezierFactorOne[n]*this.bezierStartControlPt.y+e.bezierFactorTwo[n]*this.bezierEndControlPt.y+e.tPow3[n]*this.bezierEndPt.y)}}]),e}(),GraphicalCurve=_GraphicalCurve;GraphicalCurve.bezierCurveStepSize=1e3;var _GraphicalSlur=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i){var r;return _classCallCheck2(this,n),(r=t.call(this)).staffEntries=[],r.slur=e,r.rules=i,r}return _createClass2(n,[{key:"calculateCurve",value:function(e){var t=this.staffEntries[0],n=this.staffEntries[this.staffEntries.length-1],i=t.findGraphicalNoteFromNote(this.slur.StartNote);!i&&this.graceStart&&(i=t.findGraphicalNoteFromGraceNote(this.slur.StartNote)),i||(i=t.findEndTieGraphicalNoteFromNoteWithStartingSlur(this.slur.StartNote,this.slur));var r=n.findGraphicalNoteFromNote(this.slur.EndNote);!r&&this.graceEnd&&(r=n.findGraphicalNoteFromGraceNote(this.slur.EndNote));var a=t.parentMeasure.ParentStaffLine,s=a.SkyBottomLineCalculator;this.calculatePlacement(s,a);var o,l=this.calculateStartAndEnd(i,r,a,e,s),u=l.startX,c=l.endX,h=l.startY,f=l.endY,d=e.SlurTangentMinAngle,p=e.SlurTangentMaxAngle;if(this.placement===PlacementEnum.Above){h-=e.SlurNoteHeadYOffset,f-=e.SlurNoteHeadYOffset;var m=new PointF2D(this.staffEntries[0].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[0].PositionAndShape.RelativePosition.x,h);i?m.x+=this.staffEntries[0].PositionAndShape.BorderRight:m.x=this.staffEntries[0].parentMeasure.beginInstructionsWidth,this.graceStart&&(m.x+=n.PositionAndShape.RelativePosition.x);var v=new PointF2D(this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].PositionAndShape.RelativePosition.x,f);if(r?v.x+=this.staffEntries[this.staffEntries.length-1].PositionAndShape.BorderLeft:v.x=this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.Size.width,this.graceEnd&&(v.x+=n.staffEntryParent.PositionAndShape.RelativePosition.x),0===(o=this.calculateTopPoints(m,v,a,s)).length){var g=new PointF2D((v.x-m.x)/2+m.x,(v.y-m.y)/2+m.y);o.push(g)}var y=Math.atan((f-h)/(c-u)),b=new PointF2D(0,0),_=new PointF2D(c-u,-(f-h)),S=Matrix2D.getRotationMatrix(y),x=S.getTransposeMatrix();_=S.vectorMultiplication(_);var w=this.calculateTranslatedAndRotatedPointListAbove(o,u,h,S),k=this.calculateMaxLeftSlope(w,b,_),E=this.calculateMaxRightSlope(w,b,_),T=b.y-b.x*k,P=_.y-_.x*E,A=new PointF2D,C=!1;Math.abs(Math.abs(k)-Math.abs(E))<1e-4?(A.x=_.x/2,A.y=0,C=!0):(A.x=(P-T)/(k-E),A.y=k*A.x+T);var M=this.calculateHeightWidthRatio(_.x,w),I=0,N=0;if(Math.abs(M)>.001){var L=Math.abs(k/(2*M)),R=Math.abs(k);k-=I=Math.max(0,R*(Math.min(10,L-1)/10));var F=Math.abs(E/(2*M)),O=Math.abs(E);E+=N=Math.max(0,O*(Math.min(10,F-1)/10))}var B=d,D=-d;if(!C){var V=this.calculateAngles(d,k,E,p);B=V.startAngle,D=V.endAngle}var $=this.calculateControlPoints(_.x,B,D,w,M,h,f),G=$.startControlPoint,z=$.endControlPoint;(G=x.vectorMultiplication(G)).x+=u,G.y=-G.y+h,(z=x.vectorMultiplication(z)).x+=u,z.y=-z.y+h,this.bezierStartPt=new PointF2D(u,h-I),this.bezierStartControlPt=new PointF2D(G.x,G.y-I),this.bezierEndControlPt=new PointF2D(z.x,z.y-N),this.bezierEndPt=new PointF2D(c,f-N);for(var H=a.SkyLine.length,U=s.getLeftIndexForPointX(this.bezierStartPt.x,H),j=s.getLeftIndexForPointX(this.bezierEndPt.x,H),W=this.bezierEndPt.x-this.bezierStartPt.x,q=s.SamplingUnit,Y=U;Y=U&&(a.SkyLine[Z]=Math.min(a.SkyLine[Z],K.y)),++Z.001){var ve=Math.abs(oe/(2*de)),ge=Math.abs(oe);oe-=pe=Math.max(0,ge*(Math.min(10,ve-1)/10));var ye=Math.abs(le/(2*de)),be=Math.abs(le);le+=me=Math.max(0,be*(Math.min(10,ye-1)/10))}var _e=d,Se=-d;if(!fe){var xe=this.calculateAngles(d,oe,le,p);_e=xe.startAngle,Se=xe.endAngle}var we=this.calculateControlPoints(ie.x,_e,Se,se,de,h,f),ke=we.startControlPoint,Ee=we.endControlPoint;(ke=ae.vectorMultiplication(ke)).x+=u,ke.y+=h,(Ee=ae.vectorMultiplication(Ee)).x+=u,Ee.y+=h,this.bezierStartPt=new PointF2D(u,h+pe),this.bezierStartControlPt=new PointF2D(ke.x,ke.y+pe),this.bezierEndControlPt=new PointF2D(Ee.x,Ee.y+me),this.bezierEndPt=new PointF2D(c,f+me);for(var Te=a.BottomLine.length,Pe=s.getLeftIndexForPointX(this.bezierStartPt.x,Te),Ae=s.getLeftIndexForPointX(this.bezierEndPt.x,Te),Ce=this.bezierEndPt.x-this.bezierStartPt.x,Me=s.SamplingUnit,Ie=Pe;Ie=Pe&&(a.BottomLine[Re]=Math.max(a.BottomLine[Re],Le.y)),++Re0)return void(this.placement=PlacementEnum.Above)}var s=this.staffEntries[0],o=this.staffEntries[this.staffEntries.length-1],l=s.graphicalVoiceEntries[0].parentVoiceEntry.StemDirection;if(l===o.graphicalVoiceEntries[0].parentVoiceEntry.StemDirection)this.placement=l===StemDirectionType.Up?PlacementEnum.Below:PlacementEnum.Above;else{var u=s.PositionAndShape.BorderLeft+s.PositionAndShape.RelativePosition.x+s.parentMeasure.PositionAndShape.RelativePosition.x,c=o.PositionAndShape.BorderRight+o.PositionAndShape.RelativePosition.x+o.parentMeasure.PositionAndShape.RelativePosition.x;this.graceStart&&(u+=o.PositionAndShape.RelativePosition.x),this.graceEnd&&(c+=o.staffEntryParent.PositionAndShape.RelativePosition.x);var h=-1*e.getSkyLineMinInRange(u,c),f=e.getBottomLineMaxInRange(u,c)-t.StaffHeight;this.placement=f>h?PlacementEnum.Above:PlacementEnum.Below}}}},{key:"calculateTopPoints",value:function(e,t,n,i){var r=[],a=i.getRightIndexForPointX(e.x,n.SkyLine.length),s=i.getLeftIndexForPointX(t.x,n.SkyLine.length);a<0&&(a=0),s>=n.SkyLine.length&&(s=n.SkyLine.length-1);for(var o=a;o=n.BottomLine.length&&(s=n.BottomLine.length-1);for(var o=a;oc&&e>h&&(u+=e/70*this.rules.SlurHeightFlattenLongSlursFactorByWidth,l/=u*=1+t/30*this.rules.SlurHeightFlattenLongSlursFactorByAngle);var f=Math.min(.5,Math.max(.1,1.7*t/80*l*Math.pow(Math.max(a,.05),.4))),d=Math.min(.5,Math.max(.1,1.7*-i/80*l*Math.pow(Math.max(a,.05),.4))),p=new PointF2D;p.x=e*f*Math.cos(t*n.degreesToRadiansFactor),p.y=e*f*Math.sin(t*n.degreesToRadiansFactor);var m=new PointF2D;m.x=e-e*d*Math.cos(i*n.degreesToRadiansFactor),m.y=-e*d*Math.sin(i*n.degreesToRadiansFactor);for(var v=p.y-m.y;this.rules.SlurMaximumYControlPointDistance&&Math.abs(v)>this.rules.SlurMaximumYControlPointDistance;)v<0?(p.y+=1,m.y-=1):(p.y-=1,m.y+=1),v=p.y-m.y;return{startControlPoint:p,endControlPoint:m}}},{key:"calculateAngles",value:function(e,t,i,r){var a=Math.atan(t)/n.degreesToRadiansFactor;t>0?a+=20:a-=20;var s=Math.atan(i)/n.degreesToRadiansFactor;return i<0?s-=20:s+=20,{startAngle:Math.min(Math.max(e,a),r),endAngle:Math.max(Math.min(-e,s),-r)}}}],[{key:"Compare",value:function(e,t){if(e.staffEntries.length<1)return-1;if(t.staffEntries.length<1)return 1;var n=Fraction$1.minus(e.staffEntries[e.staffEntries.length-1].getAbsoluteTimestamp(),e.staffEntries[0].getAbsoluteTimestamp()),i=Fraction$1.minus(t.staffEntries[t.staffEntries.length-1].getAbsoluteTimestamp(),t.staffEntries[0].getAbsoluteTimestamp());return n.RealValue>i.RealValue?1:i.RealValue>n.RealValue?-1:0}}]),n}(GraphicalCurve),GraphicalSlur=_GraphicalSlur;GraphicalSlur.degreesToRadiansFactor=Math.PI/180;var GraphicalPedal=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i){var r;return _classCallCheck2(this,n),(r=t.call(this)).getPedal=e,r.setSymbol(),r.PositionAndShape=new BoundingBox$2(_assertThisInitialized2(r),i),r}return _createClass2(n,[{key:"setSymbol",value:function(){!this.getPedal.IsLine&&this.getPedal.IsSign?this.pedalSymbol=MusicSymbol.PEDAL_SYMBOL:this.getPedal.IsLine&&this.getPedal.IsSign?this.pedalSymbol=MusicSymbol.PEDAL_MIXED:this.pedalSymbol=MusicSymbol.PEDAL_BRACKET}}]),n}(GraphicalObject),VexFlowPedal=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i){var r,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];switch(_classCallCheck2(this,n),(r=t.call(this,e,i)).vfStyle=Vex.Flow.PedalMarking.Styles.BRACKET,r.ChangeBegin=!1,r.ChangeEnd=!1,r.line=-3,r.EndSymbolPositionAndShape=void 0,r.ChangeBegin=e.ChangeBegin,r.ChangeEnd=e.ChangeEnd,r.pedalSymbol){case MusicSymbol.PEDAL_SYMBOL:r.vfStyle=Vex.Flow.PedalMarking.Styles.TEXT,r.EndSymbolPositionAndShape=new BoundingBox$2(_assertThisInitialized2(r),i);break;case MusicSymbol.PEDAL_MIXED:r.vfStyle=a&&s?Vex.Flow.PedalMarking.Styles.BRACKET_OPEN_BOTH:a?Vex.Flow.PedalMarking.Styles.BRACKET_OPEN_BEGIN:s?Vex.Flow.PedalMarking.Styles.MIXED_OPEN_END:Vex.Flow.PedalMarking.Styles.MIXED;break;case MusicSymbol.PEDAL_BRACKET:default:r.vfStyle=a&&s?Vex.Flow.PedalMarking.Styles.BRACKET_OPEN_BOTH:a?Vex.Flow.PedalMarking.Styles.BRACKET_OPEN_BEGIN:s?Vex.Flow.PedalMarking.Styles.BRACKET_OPEN_END:Vex.Flow.PedalMarking.Styles.BRACKET}return r}return _createClass2(n,[{key:"setStartNote",value:function(e){if(!e)return!1;var t,n=_createForOfIteratorHelper(e.graphicalVoiceEntries);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(null!=i&&i.vfStaveNote)return this.startNote=i.vfStaveNote,this.startVfVoiceEntry=i,!0}}catch(err){n.e(err)}finally{n.f()}return!1}},{key:"setEndNote",value:function(e){if(!e)return!1;var t,n=_createForOfIteratorHelper(e.graphicalVoiceEntries);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(null!=i&&i.vfStaveNote)return this.endNote=i.vfStaveNote,this.endVfVoiceEntry=i,!0}}catch(err){n.e(err)}finally{n.f()}return!1}},{key:"setEndMeasure",value:function(e){this.endMeasure=e}},{key:"CalculateBoundingBox",value:function(){}},{key:"setLine",value:function(e){this.line=e}},{key:"getPedalMarking",value:function(){var e,t,n,i,r=new Vex.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===(e=this.endVfVoiceEntry)||void 0===e?void 0:e.parentStaffEntry)!==(null===(t=this.endVfVoiceEntry)||void 0===t||null===(n=t.parentStaffEntry)||void 0===n||null===(i=n.parentMeasure)||void 0===i?void 0:i.staffEntries.last())&&this.endVfVoiceEntry||(r.EndsStave=!0),r.ChangeBegin=this.ChangeBegin,r.ChangeEnd=this.ChangeEnd,r}}]),n}(GraphicalPedal),GraphicalWavyLine=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i){var r;return _classCallCheck2(this,n),(r=t.call(this)).getWavyLine=e,r.PositionAndShape=new BoundingBox$2(_assertThisInitialized2(r),i),r}return _createClass2(n)}(GraphicalObject),VexflowVibratoBracket=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i){var r,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return _classCallCheck2(this,n),(r=t.call(this,e,i)).line=1,r.isVibrato=!1,r.toEndOfStopStave=!1,r.isVibrato=a,r}return _createClass2(n,[{key:"ToEndOfStopStave",get:function(){return this.toEndOfStopStave}},{key:"setStartNote",value:function(e){var t,n=_createForOfIteratorHelper(e.graphicalVoiceEntries);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(null!=i&&i.vfStaveNote)return this.startNote=i.vfStaveNote,this.startVfVoiceEntry=i,!0}}catch(err){n.e(err)}finally{n.f()}return!1}},{key:"setEndNote",value:function(e){var t,n=_createForOfIteratorHelper(e.graphicalVoiceEntries);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(null!=i&&i.vfStaveNote){this.endNote=i.vfStaveNote,this.endVfVoiceEntry=i;var r=this.endVfVoiceEntry.parentStaffEntry.parentMeasure.staffEntries,a=r[r.length-1];return this.toEndOfStopStave=a===this.endVfVoiceEntry.parentStaffEntry,!0}}}catch(err){n.e(err)}finally{n.f()}return!1}},{key:"CalculateBoundingBox",value:function(){var e=this.getVibratoBracket();this.boundingBox.Size.height=.2*e.render_options.wave_height}},{key:"getVibratoBracket",value:function(){var e=new Vex.Flow.VibratoBracket({start:this.startNote,stop:this.endNote,toEndOfStopStave:this.toEndOfStopStave});return e.setLine(this.line),this.isVibrato?e.render_options.vibrato_width=20:e.render_options.wave_girth=4,e}}]),n}(GraphicalWavyLine),VF=Vex.Flow,VexFlowMusicSheetCalculator=function(t){_inherits2(i,t);var n=_createSuper(i);function i(e){var t,r,a,s,o,l;if(_classCallCheck2(this,i),(a=n.call(this)).beamsNeedUpdate=!1,a.rules=e,MusicSheetCalculator.symbolFactory=new VexFlowGraphicalSymbolFactory,MusicSheetCalculator.TextMeasurer=new VexFlowTextMeasurer(a.rules),MusicSheetCalculator.stafflineNoteCalculator=new VexflowStafflineNoteCalculator(a.rules),"gonville"===(null===(t=a.rules.DefaultVexFlowNoteFont)||void 0===t?void 0:t.toLowerCase()))Vex.Flow.DEFAULT_FONT_STACK=[null===(s=Vex.Flow.Fonts)||void 0===s?void 0:s.Gonville,null===(o=Vex.Flow.Fonts)||void 0===o?void 0:o.Bravura,null===(l=Vex.Flow.Fonts)||void 0===l?void 0:l.Custom];else if("petaluma"===(null===(r=a.rules.DefaultVexFlowNoteFont)||void 0===r?void 0:r.toLowerCase())){var u,c,h;Vex.Flow.DEFAULT_FONT_STACK=[null===(u=Vex.Flow.Fonts)||void 0===u?void 0:u.Petaluma,null===(c=Vex.Flow.Fonts)||void 0===c?void 0:c.Gonville,null===(h=Vex.Flow.Fonts)||void 0===h?void 0:h.Bravura]}return a}return _createClass2(i,[{key:"clearRecreatedObjects",value:function(){_get(_getPrototypeOf2(i.prototype),"clearRecreatedObjects",this).call(this),MusicSheetCalculator.stafflineNoteCalculator=new VexflowStafflineNoteCalculator(this.rules);var e,t=_createForOfIteratorHelper(this.graphicalMusicSheet.MeasureList);try{for(t.s();!(e=t.n()).done;){var n,r=_createForOfIteratorHelper(e.value);try{for(r.s();!(n=r.n()).done;){var a=n.value;null==a||a.clean()}}catch(err){r.e(err)}finally{r.f()}}}catch(err){t.e(err)}finally{t.f()}}},{key:"formatMeasures",value:function(){var e,t=_createForOfIteratorHelper(this.graphicalMusicSheet.MeasureList);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(n&&n[0]){n[0].format();var i,r=_createForOfIteratorHelper(n);try{for(r.s();!(i=r.n()).done;){var a,s=i.value,o=_createForOfIteratorHelper(s.staffEntries);try{for(o.s();!(a=o.n()).done;){a.value.calculateXPosition()}}catch(err){o.e(err)}finally{o.f()}s.finalizeBeams()}}catch(err){r.e(err)}finally{r.f()}}}}catch(err){t.e(err)}finally{t.f()}this.beamsNeedUpdate=!1}},{key:"calculateMeasureXLayout",value:function(e){var t,n=[],i=_createForOfIteratorHelper(e);try{for(i.s();!(t=i.n()).done;){var r=t.value;r&&n.push(r)}}catch(err){i.e(err)}finally{i.f()}if(0===n.length)return 0;e=n;var a,s=[],o=new VF.Formatter({softmaxFactor:this.rules.SoftmaxFactorVexFlow}),l=e[0].staffEntries.length,u=1,c=_createForOfIteratorHelper(e);try{for(c.s();!(a=c.n()).done;){var h=a.value;if(h){var f,d=0,p=_createForOfIteratorHelper(h.staffEntries);try{for(p.s();!(f=p.n()).done;){d+=f.value.setMaxAccidentals()}}catch(err){p.e(err)}finally{p.f()}h.parentSourceMeasure.ImplicitMeasure&&(l=Math.max(h.staffEntries.length,l),u=Math.max(h.staffEntries.length+d,u));var m=h.vfVoices,v=[];for(var g in m)m.hasOwnProperty(g)&&(v.push(m[g]),s.push(m[g]));0!==v.length?o.joinVoices(v):log$2.debug("Found a measure with no voices. Continuing anyway.",m)}}}catch(err){c.e(err)}finally{c.f()}var y=12,b=e[0].parentSourceMeasure;if(s.length>0){y=o.preCalculateMinTotalWidth(s)/unitInPixels*this.rules.VoiceSpacingMultiplierVexflow+this.rules.VoiceSpacingAddendVexflow+.3*l,null!=b&&b.ImplicitMeasure&&(y=b.Duration.RealValue/b.ActiveTimeSignature.RealValue*y,l>1&&(y+=.3*u*1.5),y*=this.rules.PickupMeasureWidthMultiplier),MusicSheetCalculator.setMeasuresMinStaffEntriesWidth(e,y);var _,S=function(e,t){o.formatToStave(s,t.getVFStave())},x=function(e,t){o.formatToStave(s,t.getVFStave(),{align_rests:!0,context:void 0})},w=_createForOfIteratorHelper(e);try{for(w.s();!(_=w.n()).done;){var k=_.value;if(this.rules.AlignRests===AlignRestOption.Never)k.formatVoices=S;else if(this.rules.AlignRests===AlignRestOption.Always)k.formatVoices=x;else if(this.rules.AlignRests===AlignRestOption.Auto){var E,T=!1,P=_createForOfIteratorHelper(k.staffEntries);try{for(P.s();!(E=P.n()).done;){var A,C=E.value,M=0,I=0,N=_createForOfIteratorHelper(C.graphicalVoiceEntries);try{for(N.s();!(A=N.n()).done;){var L=A.value;if(L.parentVoiceEntry.IsGrace||L&&L.notes&&L.notes[0]&&L.notes[0].sourceNote&&L.notes[0].sourceNote.PrintObject&&M++,L&&L.notes&&L.notes[0]&&L.notes[0].sourceNote&&L.notes[0].sourceNote.isRest()&&L.notes[0].sourceNote.PrintObject&&I++,M>1&&I>=1){T=!0;break}}}catch(err){N.e(err)}finally{N.f()}if(T)break}}catch(err){P.e(err)}finally{P.f()}k.formatVoices=T?x:S}if(k===e[0]){var R=k;R.formatVoices(y*unitInPixels,R)}}}catch(err){w.e(err)}finally{w.f()}}var F,O=_createForOfIteratorHelper(e);try{for(O.s();!(F=O.n()).done;){var B=F.value;if(B){var D,V=_createForOfIteratorHelper(B.staffEntries);try{for(V.s();!(D=V.n()).done;){D.value.calculateXPosition()}}catch(err){V.e(err)}finally{V.f()}}}}catch(err){O.e(err)}finally{O.f()}var $,G=_createForOfIteratorHelper(e);try{for(G.s();!($=G.n()).done;){var z=$.value;if(z){var H=z.vfVoices,U=[];for(var j in H)H.hasOwnProperty(j)&&U.push(H[j]);0!==U.length?o.joinVoices(U):log$2.debug("Found a measure with no voices. Continuing anyway.",H)}}}catch(err){G.e(err)}finally{G.f()}return y}},{key:"calculateElongationFactor",value:function(e,t,n,i,r,a,s,o){var l,u=r,c=0,h=_createForOfIteratorHelper(e);try{for(h.s();!(l=h.n()).done;){var f=l.value,d=f.GraphicalLabel.Label.textAlignment,p=s,m=o;if(f instanceof GraphicalLyricEntry&&f.ParentLyricWord){f.LyricsEntry.SyllableIndex>0&&(p=this.rules.BetweenSyllableMinimumDistance,TextAlignment.IsCenterAligned(d)&&(p+=1));var v=f.ParentLyricWord.GetLyricWord.Syllables;v.length>1&&f.LyricsEntry.SyllableIndex4&&(P*=1.1)}}else n[c]&&(P=_/S);E=Math.max(T,P),u=Math.max(u,E);var C=Math.max(_-S||0,0);n[c]&&(C+=n[c].cumulativeOverlap),n[c]={cumulativeOverlap:C,extend:f instanceof GraphicalLyricEntry&&f.LyricsEntry.extend,labelWidth:y,measureNumber:a,sourceNoteDuration:f instanceof GraphicalLyricEntry&&(f.LyricsEntry&&f.LyricsEntry.Parent.Notes[0].Length),text:f instanceof GraphicalLyricEntry?f.LyricsEntry.Text:f.GraphicalLabel.Label.text,xPosition:b},c++}}catch(err){h.e(err)}finally{h.f()}return u}},{key:"calculateElongationFactorFromStaffEntries",value:function(e,t,n,i){var r,a=n,s={},o={},l=_createForOfIteratorHelper(e);try{for(l.s();!(r=l.n()).done;){var u=r.value;u.LyricsEntries.length>0&&(a=this.calculateElongationFactor(u.LyricsEntries,u,s,t,a,i,this.rules.HorizontalBetweenLyricsDistance,this.rules.LyricOverlapAllowedIntoNextMeasure)),u.graphicalChordContainers.length>0&&(a=this.calculateElongationFactor(u.graphicalChordContainers,u,o,t,a,i,this.rules.ChordSymbolXSpacing,this.rules.ChordOverlapAllowedIntoNextMeasure))}}catch(err){l.e(err)}finally{l.f()}return a}},{key:"calculateMeasureWidthFromStaffEntries",value:function(e,t){var n,i=1,r=_createForOfIteratorHelper(e);try{for(r.s();!(n=r.n()).done;){var a=n.value;a&&0!==a.staffEntries.length&&(i=this.calculateElongationFactorFromStaffEntries(a.staffEntries,t,i,a.MeasureNumber))}}catch(err){r.e(err)}finally{r.f()}return t*(i=Math.min(i,this.rules.MaximumLyricsElongationFactor))}},{key:"createGraphicalTie",value:function(e,t,n,i,r){return new GraphicalTie(e,i,r)}},{key:"updateStaffLineBorders",value:function(e){e.SkyBottomLineCalculator.updateStaffLineBorders()}},{key:"graphicalMeasureCreatedCalculations",value:function(e){e.rules=this.rules,e.graphicalMeasureCreatedCalculations()}},{key:"layoutVoiceEntry",value:function(e,t,n,i){for(var r=0;r=2&&(a=i.vfnote[0],s=i.vfnote[1]);var o=void 0,l=0;if(r&&r.vfnote&&r.vfnote.length>=2&&(o=r.vfnote[0],l=r.vfnote[1]),t){if(a){var u=new VF.StaveTie({first_indices:[s],first_note:a});i.parentVoiceEntry.parentStaffEntry.parentMeasure.addStaveTie(u,e)}if(o){var c=new VF.StaveTie({last_indices:[l],last_note:o});r.parentVoiceEntry.parentStaffEntry.parentMeasure.addStaveTie(c,e)}}else if(a||o){var h;if(n)if("S"===e.Tie.Type){var f=e.StartNote.sourceNote,d=e.EndNote.sourceNote,p=1;f.FretNumber>d.FretNumber&&(p=-1),h=new VF.TabSlide({first_indices:[s],first_note:a,last_indices:[l],last_note:o},p)}else h=new VF.TabTie({first_indices:[s],first_note:a,last_indices:[l],last_note:o},e.Tie.Type);else{h=new VF.StaveTie({first_indices:[s],first_note:a,last_indices:[l],last_note:o});var m=e.Tie.getTieDirection(i.sourceNote);m===PlacementEnum.Below?h.setDirection(1):m===PlacementEnum.Above&&h.setDirection(-1);try{var v,g;Math.abs((null===(v=a)||void 0===v?void 0:v.getTieRightX())-(null===(g=o)||void 0===g?void 0:g.getTieLeftX()))<10&&(h.render_options.first_x_shift=-3,h.render_options.last_x_shift=3)}catch(y){console.log(y)}}r.parentVoiceEntry.parentStaffEntry.parentMeasure.addStaveTie(h,e)}}},{key:"calculateDynamicExpressionsForMultiExpression",value:function(t,n,i){if(!(nthis.rules.MaxMeasureToDrawIndex)){var r=t.AbsoluteTimestamp,a=this.graphicalMusicSheet.MeasureList[n],s=a[i].ParentStaffLine,o=a[i];if(s){var l=this.getRelativePositionInStaffLineFromTimestamp(r,i,s,null==s?void 0:s.isPartOfMultiStaffInstrument());if(l.x<=0&&(l.x=o.beginInstructionsWidth+this.rules.RhythmRightMargin),t.InstantaneousDynamic){var u=new VexFlowInstantaneousDynamicExpression(t.InstantaneousDynamic,s,o);this.calculateGraphicalInstantaneousDynamicExpression(u,l,r),this.dynamicExpressionMap.set(r.RealValue,u.PositionAndShape)}if(t.StartingContinuousDynamic){var c=t.StartingContinuousDynamic,h=new VexFlowContinuousDynamicExpression(t.StartingContinuousDynamic,s,o.parentSourceMeasure);if(h.StartMeasure=o,!h.IsVerbal&&c.EndMultiExpression)try{this.calculateGraphicalContinuousDynamic(h,l),h.updateSkyBottomLine()}catch(e){}else h.IsVerbal?this.calculateGraphicalVerbalContinuousDynamic(h,l):log$2.warn("This continuous dynamic is not covered. measure"+t.SourceMeasureParent.MeasureNumber)}}}}},{key:"createMetronomeMark",value:function(e,t){var n,i,r,a=Math.max(e.ParentMultiTempoExpression.SourceMeasureParent.MeasureNumber-1,0),s=t||a,o=Math.max(e.StaffNumber-1,0),l=this.graphicalMusicSheet.MeasureList[s][o].getVFStave(),u="q";if(e.beatUnit){var c=NoteTypeHandler.getNoteDurationFromType(e.beatUnit);u=VexFlowConverter.durations(c,!1)[0]}var h=this.rules.MetronomeMarkYShift,f=!1,d=[];if(e.parentMeasure){var p,m=_createForOfIteratorHelper(e.parentMeasure.StaffLinkedExpressions);try{for(m.s();!(p=m.n()).done;){var v,g=_createForOfIteratorHelper(p.value);try{for(g.s();!(v=g.n()).done;){var y=v.value;y&&y instanceof UnknownExpression&&d.push(y)}}catch(err){g.e(err)}finally{g.f()}}}catch(err){m.e(err)}finally{m.f()}var b,_=_createForOfIteratorHelper(e.parentMeasure.TempoExpressions);try{for(_.s();!(b=_.n()).done;){var S,x=b.value,w=(null===(S=x.InstantaneousTempo)||void 0===S?void 0:S.Enum)===TempoEnum.metronomeMark;if(!e.beatUnit&&x.InstantaneousTempo.beatUnit){var k=NoteTypeHandler.getNoteDurationFromType(e.beatUnit);u=VexFlowConverter.durations(k,!1)[0]}if(x.getPlacementOfFirstEntry()===PlacementEnum.Above&&!w){f=!0;break}}}catch(err){_.e(err)}finally{_.f()}}f&&(h-=1.4);var E,T=null===(n=this.graphicalMusicSheet.MeasureList[0][0].ParentStaffLine)||void 0===n?void 0:n.SkyLine,P=e.TempoInBpm,A="",C="",M="",I=_createForOfIteratorHelper(this.graphicalMusicSheet.MeasureList[s][o].parentSourceMeasure.TempoExpressions);try{for(I.s();!(E=I.n()).done;){var N=E.value;if(C=N.CombinedExpressionsText,isSpecialMark(N.CombinedExpressionsText)){A=N.CombinedExpressionsText;break}if(isSpeedKeyword(N.CombinedExpressionsText)||isSpeedHiddenKeyword(N.CombinedExpressionsText)){A=formatSpeedKeyword(N.CombinedExpressionsText),P=N.sourceMeasure.TempoInBPM,isSpeedKeyword(N.CombinedExpressionsText)&&(M=u);break}}}catch(err){I.e(err)}finally{I.f()}var L={bpm:e.TempoInBpm,dots:e.dotted,duration:u,name:A};A&&(L.bpm=P/(L.dots?1.5:1),isSpeedKeyword(C)?L.duration=M:P!==SpeedTag[A]&&SpeedTag[A]||(L.duration=""));var R=(null===(i=this.graphicalMusicSheet.MeasureList[s][o].vfVoices)||void 0===i||null===(r=i[1])||void 0===r?void 0:r.boundingBox.y)||0;if(this.rules.MetronomeMarksDrawn){if(T){var F,O,B=(null===(F=this.graphicalMusicSheet.MeasureList[0])||void 0===F||null===(O=F[o])||void 0===O?void 0:O.ParentStaffLine).Measures.map((function(e){return e.MeasureNumber-1}));if(R&&B.includes(s)&&(isSpeedKeyword(C)||isSpeedHiddenKeyword(C))){var D=T.slice(0,9),V=Math.min.apply(Math,_toConsumableArray2(D));h+=V=V<0?V-1:V}B.includes(s)&&d.length?T[0]=Math.min(T[0],-4.5+h-4):T[0]=Math.min(T[0],-4.5+h)}l.options.line_config.reduce((function(e,t){return t.visible&&e++,e}),0)<5&&(h-=2),l.setTempo(L,h*unitInPixels);var $=0;try{var G,z,H;$+=(null===(G=this.graphicalMusicSheet.MeasureList[s][o])||void 0===G||null===(z=G.vfVoices)||void 0===z||null===(H=z[1])||void 0===H?void 0:H.getTickables())[e.parentMeasure.metronomeNoteIndex].getBoundingBox().getX()-l.getNoteStartX()}catch(U){}l.getModifiers()[l.getModifiers().length-1].setShiftX($)}}},{key:"calculateRehearsalMark",value:function(e){var t,n,i=e.rehearsalExpression;if(i){var r=this.graphicalMusicSheet.MeasureList[0][0].MeasureNumber,a=Math.max(e.measureListIndex+1-r,0),s=null===(t=this.graphicalMusicSheet.MeasureList[a][0])||void 0===t?void 0:t.getVFStave();if(s){var o=-this.rules.RehearsalMarkYOffsetDefault-this.rules.RehearsalMarkYOffset,l=this.rules.RehearsalMarkXOffsetDefault+this.rules.RehearsalMarkXOffset;e.IsSystemStartMeasure&&(l+=this.rules.RehearsalMarkXOffsetSystemStartMeasure);var u=this.rules.RehearsalMarkFontSize,c=s.getModifiers(),h=c.find((function(e){return"repetitions"===e.getCategory().toLocaleLowerCase()}));if(h&&h.setShiftY(h.y_shift-10),s.setSection(i.label,o,l,u),null!==(n=this.graphicalMusicSheet.MeasureList[a][0])&&void 0!==n&&n.ParentStaffLine.AbstractExpressions){var f,d,p,m,v=c.find((function(e){return"stavesection"===e.getCategory().toLocaleLowerCase()})),g=_createForOfIteratorHelper((null==e||null===(f=e.VerticalMeasureList)||void 0===f||null===(d=f[0])||void 0===d||null===(p=d.ParentStaffLine)||void 0===p?void 0:p.AbstractExpressions)||[]);try{for(g.s();!(m=g.n()).done;){var y=m.value;y instanceof GraphicalUnknownExpression&&(v&&(y.Label.PositionAndShape.RelativePosition.y-=.5),h&&(y.Label.PositionAndShape.RelativePosition.y-=1.7))}}catch(err){g.e(err)}finally{g.f()}}}}}},{key:"calculateSingleOctaveShift",value:function(e,t,n,i){var r,a=t.OctaveShiftStart,s=a.ParentStartMultiExpression.Timestamp,o=null===(r=a.ParentEndMultiExpression)||void 0===r?void 0:r.Timestamp,l=this.rules.MinMeasureToDrawIndex,u=this.rules.MaxMeasureToDrawIndex,c=this.graphicalMusicSheet.MeasureList[n][i].ParentStaffLine;c||(c=this.graphicalMusicSheet.MeasureList[l][i].ParentStaffLine);var h=void 0;(h=a.ParentEndMultiExpression?this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(a.ParentEndMultiExpression.SourceMeasureParent,i):this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(i,!0)).MeasureNumber>u+1&&(h=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(i,!0));var f=void 0;if((f=a.ParentEndMultiExpression?this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(a.ParentStartMultiExpression.SourceMeasureParent,i):this.graphicalMusicSheet.MeasureList[l][i]).MeasureNumberu||h.parentSourceMeasure.measureListIndexu)){var d=h.ParentStaffLine;if(d||(d=c),h&&c&&d){var p=new VexFlowOctaveShift(a,c.PositionAndShape);if(!p.startNote){var m,v,g=_createForOfIteratorHelper(f.staffEntries);try{for(g.s();!(v=g.n()).done;){var y=v.value;if(y){m=y;break}}}catch(err){g.e(err)}finally{g.f()}if(!m)return;if(p.setStartNote(m),!p.startNote)return}if(!p.endNote){for(var b,_=h.staffEntries.length-1;_>=0;_++)if(h.staffEntries[_]){b=h.staffEntries[_];break}if(p.setEndNote(b),!p.endNote)return}var S=f.findGraphicalStaffEntryFromTimestamp(s);S||(S=f.staffEntries[0]);var x=h.findGraphicalStaffEntryFromTimestamp(o);if(x||(x=h.staffEntries[h.staffEntries.length-1]),p.setStartNote(S),d!==c){p.endsOnDifferentStaffLine=!0;var w=c.Measures[c.Measures.length-1];void 0===w&&(w=h);var k=w.staffEntries[w.staffEntries.length-1];p.setEndNote(k);var E=d.ParentMusicSystem.Id-c.ParentMusicSystem.Id;if(E>0)for(var T=c.ParentMusicSystem.Id;Tu+1&&(h=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(i,!0));var f=void 0;if(a.ParentEndMultiExpression?f=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(a.ParentStartMultiExpression.SourceMeasureParent,i):(f=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(a.ParentStartMultiExpression.SourceMeasureParent,i))||(f=this.graphicalMusicSheet.MeasureList[l][i]),f.MeasureNumberu||h.parentSourceMeasure.measureListIndexu)){var d=h.ParentStaffLine;if(d||(d=c),h&&c&&d){var p=!1;c!==d&&(p=!0);var m=new VexFlowPedal(a,c.PositionAndShape,!1,p),v=f.findGraphicalStaffEntryFromTimestamp(s);v||(v=f.staffEntries[0]);var g=h.findGraphicalStaffEntryFromTimestamp(o);if(g||(g=h.staffEntries[h.staffEntries.length-1]),!m.setStartNote(v))return;if(d!==c)if(m.pedalSymbol===MusicSymbol.PEDAL_SYMBOL){m.setEndNote(g),m.setEndMeasure(h),m.ReleaseText=" ",m.CalculateBoundingBox(),this.calculatePedalSkyBottomLine(m.startVfVoiceEntry,m.endVfVoiceEntry,m,c);var y=d.Measures[0],b=new VexFlowPedal(a,y.PositionAndShape),_=y.staffEntries[0];if(!b.setStartNote(_))return;b.setEndNote(g),m.setEndMeasure(h),d.Pedals.push(b),b.CalculateBoundingBox(),b.DepressText=" ",this.calculatePedalSkyBottomLine(b.startVfVoiceEntry,b.endVfVoiceEntry,b,d)}else{var S=c.Measures[c.Measures.length-1];void 0===S&&(S=h);var x=S.staffEntries[S.staffEntries.length-1];m.setEndNote(x),m.setEndMeasure(h),m.ChangeEnd=!1;var w=d.ParentMusicSystem.Id-c.ParentMusicSystem.Id;if(w>0)for(var k=1,E=c.ParentMusicSystem.Id;Eu+1&&(h=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(i,!0));var f=void 0;if((f=a.ParentEndMultiExpression?this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(a.ParentStartMultiExpression.SourceMeasureParent,i):this.graphicalMusicSheet.MeasureList[l][i]).MeasureNumberu||h.parentSourceMeasure.measureListIndexu)){var d=h.ParentStaffLine;if(d||(d=c),h&&c&&d){var p=new VexflowVibratoBracket(a,c.PositionAndShape,f.ParentStaff.isTab),m=f.findGraphicalStaffEntryFromTimestamp(s);m||(m=f.staffEntries[0]);var v=h.findGraphicalStaffEntryFromTimestamp(o);if(v||(v=h.staffEntries[h.staffEntries.length-1]),p.setStartNote(m),d!==c){var g=c.Measures[c.Measures.length-1];void 0===g&&(g=h);var y=g.staffEntries[g.staffEntries.length-1];if(p.setEndNote(y),d.ParentMusicSystem.Id-c.ParentMusicSystem.Id>0)for(var b=c.ParentMusicSystem.Id;bh){var x=h;h=u,u=x}i.SkyBottomLineCalculator.updateBottomLineInRange(u,h,f+_)}var w,k=_createForOfIteratorHelper(i.Pedals);try{for(k.s();!(w=k.n()).done;){var E=w.value,T=E.getPedalMarking();if(f>T.line+3+(i.StaffLines.length-1)){var P,A=T.render_options.text_margin_right/10,C=E.startVfVoiceEntry.PositionAndShape.AbsolutePosition.x-A,M=void 0;E.setLine(f-3-(i.StaffLines.length-1));var I=null===(P=E.endVfVoiceEntry)||void 0===P?void 0:P.PositionAndShape;if(I||(I=E.endMeasure.PositionAndShape),E.EndSymbolPositionAndShape){var N=s.render_options.glyph_point_size/20;M=C+3.4;var L=I.AbsolutePosition.x-A,R=L+1.5;i.SkyBottomLineCalculator.updateBottomLineInRange(C,M,f+N),i.SkyBottomLineCalculator.updateBottomLineInRange(L,R,f+N)}else{var F,O,B=T.render_options.bracket_height/10;if(T.EndsStave)M=I.AbsolutePosition.x+I.Size.width-A;else switch(s.style){case a.BRACKET_OPEN_END:case a.BRACKET_OPEN_BOTH:case a.MIXED_OPEN_END:M=I.AbsolutePosition.x+I.BorderRight-A;break;default:M=I.AbsolutePosition.x+I.BorderLeft-A}var D=null===(F=E.endVfVoiceEntry)||void 0===F||null===(O=F.parentStaffEntry)||void 0===O?void 0:O.vfClefBefore;if(D)M+=D.getWidth()/10;if(C>M){var V=C;C=M,M=V}i.SkyBottomLineCalculator.updateBottomLineInRange(C,M,f+B)}}}}catch(err){k.e(err)}finally{k.f()}}},{key:"calculateOctaveShiftSkyBottomLine",value:function(e,t,n,i){if(t){var r=e.PositionAndShape.Size.width,a=t.PositionAndShape.Size.width;e.hasOnlyRests()?r=-r:r/=2,t.hasOnlyRests()?a*=2:a/=2,e===t&&(a*=2);var s=e.PositionAndShape.AbsolutePosition.x-r,o=t.PositionAndShape.AbsolutePosition.x+a;n.PositionAndShape.Size.width=s-o;var l=n.getTextBracket(),u=l.font.size/10;if(l.position===VF.TextBracket.Positions.TOP){var c=Math.ceil(i.SkyBottomLineCalculator.getSkyLineMinInRange(s,o));if(c===1/0)return;l.start.getStave().options.top_text_position=Math.abs(c),i.SkyBottomLineCalculator.updateSkyLineInRange(s,o,c-2*u)}else{var h=i.SkyBottomLineCalculator.getBottomLineMaxInRange(s,o);if(h===1/0)return;l.start.getStave().options.bottom_text_position=h,e.parentMeasure!==t.parentMeasure&&(l.stop.getStave().options.bottom_text_position=h),i.SkyBottomLineCalculator.updateBottomLineInRange(s,o,h+1.5*u)}}else log$2.warn("octaveshift: no endStaffEntry")}},{key:"calculateWordRepetitionInstruction",value:function(e,t){for(var n=void 0,i=this.graphicalMusicSheet.MeasureList[t],r=0,a=i.length;ri.graphicalLyricWords.length-1){var l=new GraphicalLyricWord(r.Word);a.ParentLyricWord=l,l.GraphicalLyricsEntries[s]=a,i.graphicalLyricWords.push(l)}else{var u=i.graphicalLyricWords[o];a.ParentLyricWord=u,u.GraphicalLyricsEntries[s]=a,u.isFilled()&&(n.splice(o,1),i.graphicalLyricWords.splice(i.graphicalLyricWords.indexOf(u),1))}}}))}},{key:"handleVoiceEntryOrnaments",value:function(e,t,n){}},{key:"handleVoiceEntryArticulations",value:function(e,t,n){}},{key:"handleVoiceEntryTechnicalInstructions",value:function(e,t,n){}},{key:"handleTuplet",value:function(e,t,n){e.parentVoiceEntry.parentStaffEntry.parentMeasure.handleTuplet(e,t)}},{key:"findIndexGraphicalSlurFromSlur",value:function(e,t){for(var n=0;n=0){var P=l[T];-1===P.staffEntries.indexOf(g)&&P.staffEntries.push(g),l.splice(T,1)}}}}}catch(err){w.e(err)}finally{w.f()}}}catch(err){_.e(err)}finally{_.f()}}}catch(err){y.e(err)}finally{y.f()}var A,C=_createForOfIteratorHelper(l);try{for(C.s();!(A=C.n()).done;){var M=A.value;-1===M.staffEntries.indexOf(g)&&M.staffEntries.push(g)}}catch(err){C.e(err)}finally{C.f()}}}catch(err){m.e(err)}finally{m.f()}}}catch(err){d.e(err)}finally{d.f()}}}catch(err){s.e(err)}finally{s.f()}}}catch(err){r.e(err)}finally{r.f()}var I,N=_createForOfIteratorHelper(this.musicSystems);try{for(N.s();!(I=N.n()).done;){var L,R=_createForOfIteratorHelper(I.value.StaffLines);try{for(R.s();!(L=R.n()).done;){var F,O=_createForOfIteratorHelper(L.value.GraphicalSlurs.sort(GraphicalSlur.Compare));try{for(O.s();!(F=O.n()).done;){var B=F.value;B.slur.isCrossed()||B.calculateCurve(this.rules)}}catch(err){O.e(err)}finally{O.f()}}}catch(err){R.e(err)}finally{R.f()}}}catch(err){N.e(err)}finally{N.f()}}}]),i}(MusicSheetCalculator),MusicPartManager=function(){function e(t){_classCallCheck2(this,e),this.musicSheet=t}return _createClass2(e,[{key:"reInit",value:function(){this.init()}},{key:"init",value:function(){this.parts=this.musicSheet.Repetitions.slice(),this.sheetStart=this.musicSheet.SelectionStart=new Fraction$1(0,1),this.sheetEnd=this.musicSheet.SelectionEnd=this.musicSheet.SheetEndTimestamp,this.calcMapping()}},{key:"getCurrentRepetitionTimestampTransform",value:function(e){for(var t=void 0,n=this.timestamps.length-1;n>=0;n--)if(t=this.timestamps[n],e.gte(t.from))return t;return this.timestamps[0]}},{key:"absoluteEnrolledToSheetTimestamp",value:function(e){if(0===this.timestamps.length)return e;var t=this.getCurrentRepetitionTimestampTransform(e);return Fraction$1.plus(e,Fraction$1.minus(t.to,t.from))}},{key:"Parts",get:function(){return this.parts}},{key:"MusicSheet",get:function(){return this.musicSheet}},{key:"getIterator",value:function(e){return e?new MusicPartManagerIterator(this.musicSheet,e,void 0):new MusicPartManagerIterator(this.musicSheet,this.musicSheet.SelectionStart,this.musicSheet.SelectionEnd)}},{key:"setSelectionStart",value:function(e){this.musicSheet.SelectionStart=e,this.musicSheet.SelectionEnd=void 0}},{key:"setSelectionRange",value:function(e,t){this.musicSheet.SelectionStart=null!=e?e:this.sheetStart,this.musicSheet.SelectionEnd=null!=t?t:this.sheetEnd}},{key:"calcMapping",value:function(){this.timestamps=[];var e=this.getIterator(),t=e.CurrentRepetition,n=new TimestampTransform(e.CurrentEnrolledTimestamp.clone(),e.CurrentSourceTimestamp.clone(),void 0,0);for(this.timestamps.push(n);!e.EndReached;){if(e.JumpOccurred||t!==e.CurrentRepetition){if(t=e.CurrentRepetition,e.backJumpOccurred){var i=e.JumpResponsibleRepetition;n.nextBackJump=e.CurrentEnrolledTimestamp,n.curRepetition=i,n.curRepetitionIteration=e.CurrentJumpResponsibleRepetitionIterationBeforeJump;for(var r=this.timestamps.length-2;r>=0&&(!i.AbsoluteTimestamp.gt(this.timestamps[r].to)&&!this.timestamps[r].curRepetition);r--)this.timestamps[r].nextBackJump=n.nextBackJump,this.timestamps[r].curRepetition=i,this.timestamps[r].curRepetitionIteration=n.curRepetitionIteration}n=new TimestampTransform(e.CurrentEnrolledTimestamp.clone(),e.CurrentSourceTimestamp.clone(),void 0,0),this.timestamps.push(n)}e.moveToNext()}}}]),e}(),TimestampTransform=_createClass2((function e(t,n,i,r){_classCallCheck2(this,e),this.from=t,this.to=n,this.curRepetition=i,this.curRepetitionIteration=r,this.nextBackJump=void 0,this.nextForwardJump=void 0})),PartListEntry=function(){function e(t){_classCallCheck2(this,e),this.enrolledTimestamps=[],this.visible=!0,this.musicSheet=t}return _createClass2(e,[{key:"Visible",get:function(){return this.visible},set:function(e){this.visible=e}},{key:"getFirstSourceMeasure",value:function(){return this.musicSheet.SourceMeasures[this.startIndex]}},{key:"getLastSourceMeasure",value:function(){return this.musicSheet.SourceMeasures[this.endIndex]}}]),e}(),SourceMusicPart=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i,r){var a;return _classCallCheck2(this,n),(a=t.call(this,e)).musicSheet=e,a.startIndex=i,a.endIndex=r,a}return _createClass2(n,[{key:"MeasuresCount",get:function(){return this.endIndex-this.startIndex+1}},{key:"StartIndex",get:function(){return this.startIndex}},{key:"EndIndex",get:function(){return this.endIndex}},{key:"ParentRepetition",get:function(){return this.parentRepetition},set:function(e){this.parentRepetition=e}},{key:"AbsoluteTimestamp",get:function(){return Fraction$1.createFromFraction(this.musicSheet.SourceMeasures[this.startIndex].AbsoluteTimestamp)}},{key:"setStartIndex",value:function(e){this.startIndex=e}},{key:"setEndIndex",value:function(e){this.endIndex=e}}]),n}(PartListEntry),Repetition=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return _classCallCheck2(this,n),(i=t.call(this,e)).backwardJumpInstructions=[],i.endingParts=[],i.endingIndexDict={},i.userNumberOfRepetitions=0,i.visibles=[],i.fromWords=!1,i.repetitonIterationOrder=[],i.numberOfEndings=1,i.musicSheet2=e,i.virtualOverallRepetition=r,i}return _createClass2(n,[{key:"BackwardJumpInstructions",get:function(){return this.backwardJumpInstructions}},{key:"EndingIndexDict",get:function(){return this.endingIndexDict}},{key:"EndingParts",get:function(){return this.endingParts}},{key:"Visibles",get:function(){return this.visibles},set:function(e){this.visibles=e}},{key:"DefaultNumberOfRepetitions",get:function(){var e=2;return this.virtualOverallRepetition&&(e=1),Math.max(e,Object.keys(this.endingIndexDict).length,this.checkRepetitionForMultipleLyricVerses())}},{key:"UserNumberOfRepetitions",get:function(){return this.userNumberOfRepetitions},set:function(e){this.userNumberOfRepetitions=e,this.repetitonIterationOrder=[];for(var t=this.userNumberOfRepetitions-this.NumberOfEndings,n=1;n<=this.userNumberOfRepetitions;n++)n<=t?this.repetitonIterationOrder.push(1):this.repetitonIterationOrder.push(n-t)}},{key:"getForwardJumpTargetForIteration",value:function(e){var t=this.repetitonIterationOrder[e-1];return this.endingIndexDict[t]?this.endingIndexDict[t].part.StartIndex:-1}},{key:"getBackwardJumpTarget",value:function(){return this.startMarker.measureIndex}},{key:"setEndingsStartIndex",value:function(e,t){var n=new RepetitionEndingPart(new SourceMusicPart(this.musicSheet2,t,t));this.endingParts.push(n);var i,r=_createForOfIteratorHelper(e);try{for(r.s();!(i=r.n()).done;){var a=i.value;try{this.endingIndexDict[a]=n,n.endingIndices.push(a),this.numberOfEndings0&&void 0!==arguments[0]?arguments[0]:new Fraction$1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;_classCallCheck2(this,e),this.rhythm=t,this.beatsPerMinute=n,this.beatLengthInMilliseconds=6e4/n,this.beatRealValue=1/4}return _createClass2(e,[{key:"BeatsPerMinute",get:function(){return this.beatsPerMinute},set:function(e){this.beatsPerMinute=e,this.beatLengthInMilliseconds=6e4/this.beatsPerMinute}},{key:"Rhythm",get:function(){return this.rhythm},set:function(e){this.rhythm=e}},{key:"BeatRealValue",get:function(){return this.beatRealValue}},{key:"BeatLengthInMilliseconds",get:function(){return this.beatLengthInMilliseconds}},{key:"getDurationInMilliseconds",value:function(e){return("number"==typeof e?e:e.RealValue)*this.BeatLengthInMilliseconds/this.beatRealValue}},{key:"getDurationAsNoteDuration",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1024,n=e/this.BeatLengthInMilliseconds,i=Math.floor(n),r=new Fraction$1(i,4),a=n-i;return 0===(i=Math.round(a/(1/t)/4))&&e>0&&(i=1),r.Add(new Fraction$1(i,t)),r}}],[{key:"createFrom",value:function(t){return new e(t.Rhythm,t.BeatsPerMinute)}}]),e}(),MusicSheet$1=function(){function e(){_classCallCheck2(this,e),this.idString="random idString, not initialized",this.sourceMeasures=[],this.repetitions=[],this.dynListStaves=[],this.timestampSortedDynamicExpressionsList=[],this.timestampSortedTempoExpressionsList=[],this.instrumentalGroups=[],this.instruments=[],this.musicPartManager=void 0,this.musicSheetErrors=new MusicSheetErrors,this.staves=[],this.playbackDataDict=new Dictionary,this.transpose=0,this.defaultStartTempoInBpm=0,this.drawErroneousMeasures=!1,this.hasBeenOpenedForTheFirstTime=!1,this.currentEnrolledPosition=new Fraction$1(0,1),this.soundTempos=new Map,this.playbackSettings=new PlaybackSettings,this.playbackSettings.rhythm=new Fraction$1(4,4,0,!1),this.userStartTempoInBPM=100,this.pageWidth=120,this.MusicPartManager=new MusicPartManager(this),this.hasBPMInfo=!1}return _createClass2(e,[{key:"SoundTempos",get:function(){return this.soundTempos},set:function(e){this.soundTempos=e}},{key:"CurrentKeyInstruction",get:function(){return this.currentKeyInstruction},set:function(e){this.currentKeyInstruction=e}},{key:"SourceMeasures",get:function(){return this.sourceMeasures},set:function(e){this.sourceMeasures=e}},{key:"Repetitions",get:function(){return this.repetitions},set:function(e){this.repetitions=e}},{key:"DynListStaves",get:function(){return this.dynListStaves}},{key:"TimestampSortedTempoExpressionsList",get:function(){return this.timestampSortedTempoExpressionsList}},{key:"TimestampSortedDynamicExpressionsList",get:function(){return this.timestampSortedDynamicExpressionsList}},{key:"InstrumentalGroups",get:function(){return this.instrumentalGroups}},{key:"Parts",get:function(){return this.instruments}},{key:"Instruments",get:function(){return this.instruments}},{key:"SheetPlaybackSetting",get:function(){return this.playbackSettings},set:function(e){this.playbackSettings=e}},{key:"DrawErroneousMeasures",get:function(){return this.drawErroneousMeasures},set:function(e){this.drawErroneousMeasures=e}},{key:"HasBeenOpenedForTheFirstTime",get:function(){return this.hasBeenOpenedForTheFirstTime},set:function(e){this.hasBeenOpenedForTheFirstTime=e}},{key:"InitializeStartTempoInBPM",value:function(e){this.playbackSettings.BeatsPerMinute=e,this.userStartTempoInBPM=e}},{key:"DefaultStartTempoInBpm",get:function(){return this.defaultStartTempoInBpm},set:function(e){this.defaultStartTempoInBpm=e,this.InitializeStartTempoInBPM(e)}},{key:"Path",get:function(){return this.path},set:function(e){this.path=e}},{key:"Staves",get:function(){return this.staves}},{key:"TitleString",get:function(){return this.title?this.title.text:""},set:function(e){this.Title=new Label(e)}},{key:"SubtitleString",get:function(){return this.subtitle?this.subtitle.text:""},set:function(e){this.Subtitle=new Label(e)}},{key:"ComposerString",get:function(){return this.composer?this.composer.text:""},set:function(e){this.Composer=new Label(e)}},{key:"LyricistString",get:function(){return this.lyricist?this.lyricist.text:""},set:function(e){this.Lyricist=new Label(e)}},{key:"Title",get:function(){return this.title},set:function(e){this.title=e}},{key:"Subtitle",get:function(){return this.subtitle},set:function(e){this.subtitle=e}},{key:"Composer",get:function(){return this.composer},set:function(e){this.composer=e}},{key:"Lyricist",get:function(){return this.lyricist},set:function(e){this.lyricist=e}},{key:"Rules",get:function(){return this.rules||(log$2.debug("warning: sheet.Rules was undefined. Creating new EngravingRules."),this.rules=new EngravingRules),this.rules},set:function(e){this.rules=e}},{key:"SheetErrors",get:function(){return this.musicSheetErrors}},{key:"PlaybackDataDict",get:function(){return this.playbackDataDict}},{key:"SelectionStart",get:function(){return this.selectionStart},set:function(e){this.selectionStart=e.clone(),this.currentEnrolledPosition=e.clone()}},{key:"SelectionEnd",get:function(){return this.selectionEnd},set:function(e){this.selectionEnd=e}},{key:"HasBPMInfo",get:function(){return this.hasBPMInfo},set:function(e){this.hasBPMInfo=e}},{key:"addMeasure",value:function(e){this.sourceMeasures.push(e),e.measureListIndex=this.sourceMeasures.length-1}},{key:"checkForInstrumentWithNoVoice",value:function(){for(var e=0,t=this.instruments.length;e0){var e=this.TimestampSortedTempoExpressionsList[0];if(e.InstantaneousTempo)return e.InstantaneousTempo.TempoInBpm;if(e.ContinuousTempo)return e.ContinuousTempo.StartTempo}return this.userStartTempoInBPM}},{key:"Errors",get:function(){return this.musicSheetErrors.measureErrors}},{key:"FirstMeasureNumber",get:function(){try{return this.getFirstSourceMeasure().MeasureNumber}catch(e){return log$2.info("MusicSheet.FirstMeasureNumber: ",e),0}}},{key:"LastMeasureNumber",get:function(){try{return this.getLastSourceMeasure().MeasureNumber}catch(e){return log$2.info("MusicSheet.LastMeasureNumber: ",e),0}}},{key:"CurrentEnrolledPosition",get:function(){return this.currentEnrolledPosition.clone()},set:function(e){this.currentEnrolledPosition=e.clone()}},{key:"Transpose",get:function(){return this.transpose},set:function(e){this.transpose=e}},{key:"FullNameString",get:function(){return this.ComposerString+" "+this.TitleString}},{key:"IdString",get:function(){return this.idString},set:function(e){this.idString=e}},{key:"getEnrolledSelectionStartTimeStampWorkaround",value:function(){var e=this.MusicPartManager.getIterator(this.SelectionStart);return Fraction$1.createFromFraction(e.CurrentEnrolledTimestamp)}},{key:"SheetEndTimestamp",get:function(){var e=this.getLastSourceMeasure();return Fraction$1.plus(e.AbsoluteTimestamp,e.Duration)}},{key:"getSourceMeasureFromTimeStamp",value:function(e){for(var t=0,n=this.sourceMeasures.length;t0&&i.Voices[0].Visible&&e.push(i)}return e}}],[{key:"getIndexFromStaff",value:function(e){return e.idInMusicSheet}}]),e}();MusicSheet$1.defaultTitle="[no title given]";var LyricWord=function(){function e(){_classCallCheck2(this,e),this.syllables=[]}return _createClass2(e,[{key:"Syllables",get:function(){return this.syllables}},{key:"containsVoiceEntry",value:function(e){for(var t=0,n=this.Syllables.length;t4&&void 0!==arguments[4]?arguments[4]:-1;_classCallCheck2(this,e),this.text=t,this.word=i,this.parent=r,this.verseNumber=n,a>=0&&(this.syllableIndex=a)}return _createClass2(e,[{key:"Text",get:function(){return this.text},set:function(e){this.text=e}},{key:"Word",get:function(){return this.word}},{key:"Parent",get:function(){return this.parent},set:function(e){this.parent=e}},{key:"VerseNumber",get:function(){return this.verseNumber}},{key:"SyllableIndex",get:function(){return this.syllableIndex}}]),e}(),LyricsReader=function(){function e(t){_classCallCheck2(this,e),this.openLyricWords={},this.musicSheet=t}return _createClass2(e,[{key:"addLyricEntry",value:function(e,t){if(e){for(var n=e,i=0,r=n.length;i0)for(var g=d;g1&&(b=parseInt(S[1],10))}catch(err){var x=ITextTranslation.translateText("ReaderErrorMessages/LyricVerseNumberError","Invalid lyric verse number");this.musicSheet.SheetErrors.pushMeasureError(x);continue}}var w=void 0;if("single"===s||"end"===s){if(this.openLyricWords[b]){this.currentLyricWord=this.openLyricWords[b];var k=this.currentLyricWord.Syllables.length;w=new LyricsEntry(u,b,this.currentLyricWord,t,k),this.currentLyricWord.Syllables.push(w),delete this.openLyricWords[b],this.currentLyricWord=void 0}else w=new LyricsEntry(u,b,void 0,t);w.extend=void 0!==a.element("extend")}else if("begin"===s)this.openLyricWords[b]&&(delete this.openLyricWords[b],this.currentLyricWord=void 0),this.currentLyricWord=new LyricWord,this.openLyricWords[b]=this.currentLyricWord,w=new LyricsEntry(u,b,this.currentLyricWord,t,0),this.currentLyricWord.Syllables.push(w);else if("middle"===s)if(this.openLyricWords[b]){this.currentLyricWord=this.openLyricWords[b];var E=this.currentLyricWord.Syllables.length;w=new LyricsEntry(u,b,this.currentLyricWord,t,E),this.currentLyricWord.Syllables.push(w)}else w=new LyricsEntry(u,b,void 0,t);if(w){var T,P;if(!t.LyricsEntries[b])t.LyricsEntries.setValue(b,w),null!==(T=t.ParentSourceStaffEntry)&&void 0!==T&&null!==(P=T.VerticalContainerParent)&&void 0!==P&&P.ParentMeasure&&(t.ParentSourceStaffEntry.VerticalContainerParent.ParentMeasure.hasLyrics=!0);t.ParentVoice.Parent.LyricVersesNumbers[b]||t.ParentVoice.Parent.LyricVersesNumbers.push(b)}}}}catch(err){var A=ITextTranslation.translateText("ReaderErrorMessages/LyricError","Error while reading lyric entry.");this.musicSheet.SheetErrors.pushMeasureError(A);continue}}t.ParentVoice.Parent.LyricVersesNumbers=t.ParentVoice.Parent.LyricVersesNumbers.filter((function(e,t,n){return n.indexOf(e)===t}))}}}]),e}(),Articulation=function(){function e(t,n){_classCallCheck2(this,e),this.articulationEnum=t,this.placement=n}return _createClass2(e,[{key:"Equals",value:function(e){return e.articulationEnum===this.articulationEnum&&e.placement===this.placement}}]),e}(),ArticulationReader=function(){function e(t){_classCallCheck2(this,e),this.rules=t}return _createClass2(e,[{key:"getAccEnumFromString",value:function(e){switch(e){case"sharp":return AccidentalEnum.SHARP;case"flat":return AccidentalEnum.FLAT;case"natural":return AccidentalEnum.NATURAL;case"double-sharp":case"sharp-sharp":return AccidentalEnum.DOUBLESHARP;case"double-flat":case"flat-flat":return AccidentalEnum.DOUBLEFLAT;case"triple-sharp":return AccidentalEnum.TRIPLESHARP;case"triple-flat":return AccidentalEnum.TRIPLEFLAT;case"quarter-sharp":return AccidentalEnum.QUARTERTONESHARP;case"quarter-flat":return AccidentalEnum.QUARTERTONEFLAT;case"three-quarters-sharp":return AccidentalEnum.THREEQUARTERSSHARP;case"three-quarters-flat":return AccidentalEnum.THREEQUARTERSFLAT;case"slash-quarter-sharp":return AccidentalEnum.SLASHQUARTERSHARP;case"slash-sharp":return AccidentalEnum.SLASHSHARP;case"double-slash-flat":return AccidentalEnum.DOUBLESLASHFLAT;case"sori":return AccidentalEnum.SORI;case"koron":return AccidentalEnum.KORON;default:return AccidentalEnum.NONE}}},{key:"addArticulationExpression",value:function(e,t){if(void 0!==e&&e.elements().length>0)for(var n=e.elements(),i=0,r=n.length;i0&&t.Articulations[0].articulationEnum!==ArticulationEnum.staccato&&t.Articulations.splice(0,0,h),"strongaccent"===s){var f,d=null==a||null===(f=a.attribute("type"))||void 0===f?void 0:f.value;"up"===d?h.articulationEnum=ArticulationEnum.marcatoup:"down"===d&&(h.articulationEnum=ArticulationEnum.marcatodown)}if("detachedlegato"===s){var p,m=new Articulation(ArticulationEnum.staccato,u),v=new Articulation(ArticulationEnum.tenuto,u);(p=t.Articulations).push.apply(p,[m,v])}if(!t.hasArticulation(h))switch(t.Articulations.push(h),h.articulationEnum){case ArticulationEnum.staccato:case ArticulationEnum.staccatissimo:t.DurationModifier=h;break;case ArticulationEnum.accent:case ArticulationEnum.strongaccent:t.VolumeModifier=h}}}catch(g){return void log$2.debug("addArticulationExpression","Invalid note articulation.",g)}}}},{key:"addFermata",value:function(e,t){var n,i=ArticulationEnum.fermata;e.attributes().length>0&&e.attribute("type")&&"inverted"===e.attribute("type").value&&(i=ArticulationEnum.invertedfermata);var r=PlacementEnum.Above;"below"===(null===(n=e.attribute("placement"))||void 0===n?void 0:n.value)&&(r=PlacementEnum.Below),t.Articulations.push(new Articulation(i,r))}},{key:"addTechnicalArticulations",value:function(e,t,n){var i={bend:ArticulationEnum.bend,"down-bow":ArticulationEnum.downbow,"open-string":ArticulationEnum.naturalharmonic,"snap-pizzicato":ArticulationEnum.snappizzicato,stopped:ArticulationEnum.lefthandpizzicato,"up-bow":ArticulationEnum.upbow};for(var r in i)if(i.hasOwnProperty(r)){var a=i[r],s=e.element(r);if(s){var o,l,u=void 0;"above"===(null===(o=s.attribute("placement"))||void 0===o?void 0:o.value)&&(u=PlacementEnum.Above),"below"===(null===(l=s.attribute("placement"))||void 0===l?void 0:l.value)&&(u=PlacementEnum.Below);var c=new Articulation(a,u);t.hasArticulation(c)||t.Articulations.push(c)}}var h=e.element("fingering");if(h){var f=this.createTechnicalInstruction(h,n);f.type=TechnicalInstructionType.Fingering,n.Fingering=f,t.TechnicalInstructions.push(f)}var d=e.element("string");if(d){var p=this.createTechnicalInstruction(d,n);p.type=TechnicalInstructionType.String,n.StringInstruction=p,t.TechnicalInstructions.push(p)}}},{key:"createTechnicalInstruction",value:function(e,t){var n=new TechnicalInstruction;n.sourceNote=t,n.value=e.value;var i=e.attribute("placement");return this.rules.FingeringPositionFromXML&&(n.placement=this.getPlacement(i)),n}},{key:"getPlacement",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:PlacementEnum.NotYetDefined;if(t!==PlacementEnum.NotYetDefined)return t;if(!e)return PlacementEnum.NotYetDefined;switch(e.value){case"above":return PlacementEnum.Above;case"below":return PlacementEnum.Below;case"left":return PlacementEnum.Left;case"right":return PlacementEnum.Right;default:return PlacementEnum.NotYetDefined}}},{key:"addOrnament",value:function(e,t){if(e){var n=void 0,i={"delayed-inverted-turn":OrnamentEnum.DelayedInvertedTurn,"delayed-turn":OrnamentEnum.DelayedTurn,"inverted-mordent":OrnamentEnum.InvertedMordent,"inverted-turn":OrnamentEnum.InvertedTurn,mordent:OrnamentEnum.Mordent,"trill-mark":OrnamentEnum.Trill,turn:OrnamentEnum.Turn};for(var r in i)if(i.hasOwnProperty(r)){var a=e.element(r);if(a){n=new OrnamentContainer(i[r]);var s=a.attribute("placement");if(s)"below"===s.value&&(n.placement=PlacementEnum.Below)}}if(n){var o=e.elements("accidental-mark");if(o)for(var l=PlacementEnum.Below,u=AccidentalEnum.NONE,c=o,h=0,f=c.length;h4&&void 0!==arguments[4]?arguments[4]:void 0;_classCallCheck2(this,t),this.openBeams=[],this.beamNumberOffset=0,this.currentOctaveShift=0,this.tupletDict={},this.openTupletNumber=0,this.currMeasureVoiceEntries=[],this.graceVoiceEntriesTempList=[],this.staff=n,this.instrument=n.ParentInstrument,this.musicSheet=this.instrument.GetMusicSheet,this.slurReader=r,this.pluginManager=e,this.voice=a?new LinkedVoice(this.instrument,i,a):new Voice(this.instrument,i),this.instrument.Voices.push(this.voice),this.staff.Voices.push(this.voice),this.lyricsReader=new LyricsReader(this.musicSheet),this.articulationReader=new ArticulationReader(this.musicSheet.Rules)}return _createClass2(t,[{key:"openTieDict",get:function(){return this.staff.openTieDict}},{key:"GetVoice",get:function(){return this.voice}},{key:"OctaveShift",get:function(){return this.currentOctaveShift},set:function(e){this.currentOctaveShift=e}},{key:"createVoiceEntry",value:function(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];this.activeKey=n,this.activeRhythm=i,this.currentVoiceEntry=new VoiceEntry(Fraction$1.createFromFraction(e),this.voice,t,!0,r,a,s),r?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=[]))}},{key:"finalizeReadingMeasure",value:function(){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()}},{key:"read",value:function(e,t,n,i,r,a,s,o,l,u,c,h,f,d,p,m,v,g,y,b,_,S){this.currentStaffEntry=s,this.currentMeasure=o;try{this.currentNote=a?this.addRestNote(e.element("rest"),t,i,r,f,d,y):this.addSingleNote(e,t,i,n,r,c,h,f,d,p,m,v,g,y,_,S),this.currentNote.DotsXml=b;var x=e.elements("lyric");void 0!==this.lyricsReader&&x&&(this.lyricsReader.addLyricEntry(x,this.currentVoiceEntry),this.voice.Parent.HasLyrics=!0);var w=!1,k=e.element("notations");if(k){this.articulationReader&&this.readArticulations(k,this.currentVoiceEntry,this.currentNote);var E=k.elements("slur");void 0!==this.slurReader&&E.length>0&&!this.currentNote.ParentVoiceEntry.IsGrace&&this.slurReader.addSlur(E,this.currentNote);var T=k.elements("tuplet");T.length>0&&(this.openTupletNumber=this.addTuplet(e,T),w=!0);var P=k.element("arpeggiate");if(void 0!==P){var A;if(this.currentVoiceEntry.Arpeggio)A=this.currentVoiceEntry.Arpeggio;else{var C,M=!1,I=_createForOfIteratorHelper(this.currentStaffEntry.VoiceEntries);try{for(I.s();!(C=I.n()).done;){var N=C.value;if(N.Arpeggio){M=!0,A=N.Arpeggio;break}}}catch(err){I.e(err)}finally{I.f()}if(!M){var L=ArpeggioType.ARPEGGIO_DIRECTIONLESS,R=P.attribute("direction");if(R)switch(R.value){case"up":L=ArpeggioType.ROLL_UP;break;case"down":L=ArpeggioType.ROLL_DOWN;break;default:L=ArpeggioType.ARPEGGIO_DIRECTIONLESS}A=new Arpeggio(this.currentVoiceEntry,L),this.currentVoiceEntry.Arpeggio=A}}A.addNote(this.currentNote)}var F=k.elements("tied");F.length>0&&this.addTie(F,l,u,TieTypes.SIMPLE);var O=k.elements("slide");O.length>0&&this.addTie(O,l,u,TieTypes.SLIDE);var B=k.element("technical");if(B){var D=B.elements("hammer-on");D.length>0&&this.addTie(D,l,u,TieTypes.HAMMERON);var V=B.elements("pull-off");V.length>0&&this.addTie(V,l,u,TieTypes.PULLOFF)}}void 0===e.element("time-modification")||w||this.handleTimeModificationNode(e)}catch(err){log$2.warn(err);var $=ITextTranslation.translateText("ReaderErrorMessages/NoteError","Ignored erroneous Note.");this.musicSheet.SheetErrors.pushMeasureError($),this.musicSheet.SheetErrors.pushMeasureError(err)}return this.currentNote}},{key:"checkForStaffEntryLink",value:function(e,t,n,i){var r=new StaffEntryLink(this.currentVoiceEntry);r.LinkStaffEntries.push(n),n.Link=r;var a=this.currentVoiceEntry.Timestamp.clone(),s=i.getVerticalContainerByTimestamp(a);return(n=s.StaffEntries[e])||(n=new SourceStaffEntry(s,t),s.StaffEntries[e]=n),n.VoiceEntries.push(this.currentVoiceEntry),r.LinkStaffEntries.push(n),n.Link=r,n}},{key:"checkForOpenBeam",value:function(){this.openBeams.length>0&&this.currentNote&&this.handleOpenBeam()}},{key:"checkOpenTies",value:function(){var e=this.openTieDict;for(var t in e)if(e.hasOwnProperty(t)){var n=e[t];Fraction$1.plus(n.StartNote.ParentStaffEntry.Timestamp,n.Duration).lt(n.StartNote.SourceMeasure.Duration)&&delete e[t]}}},{key:"hasVoiceEntry",value:function(){return void 0!==this.currentVoiceEntry}},{key:"readArticulations",value:function(e,t,n){var i=e.element("articulations");i&&this.articulationReader.addArticulationExpression(i,t);var r=e.element("fermata");r&&this.articulationReader.addFermata(r,t);var a=e.element("technical");a&&this.articulationReader.addTechnicalArticulations(a,t,n);var s=e.element("ornaments");s&&this.articulationReader.addOrnament(s,t)}},{key:"addSingleNote",value:function(e,t,n,i,r,a,s,o,l,u,c,h,f,d,p,m){for(var v,g=0,y=AccidentalEnum.NONE,b=NoteEnum.C,_=NoteEnum.C,S=0,x=0,w=void 0,k=void 0,E=void 0,T=e.elements(),P=0,A=T.length;P0&&this.openBeams.last().ExtendedNoteList.push(d),d}},{key:"addNoteInfo",value:function(e,t,n,i,r,a,s,o,l){e.NoteTypeXml=t,e.PrintObject=n,e.IsCueNote=i,e.NormalNotes=r,e.displayStepUnpitched=a,e.displayOctaveUnpitched=s,e.NoteheadColorXml=o,e.NoteheadColor=o}},{key:"createBeam",value:function(t,n){try{var i=t.element("beam"),r=void 0;if(void 0!==i&&i.hasAttributes&&(r=i.attribute("number")),r){var a,s=parseInt(r.value,10),o=t.elements("beam"),l=o[0].value;if(o)if("begin"===l)s===(null===(a=this.openBeams.last())||void 0===a?void 0:a.BeamNumber)?(this.beamNumberOffset++,s+=this.beamNumberOffset):this.openBeams.last()&&this.handleOpenBeam(),this.openBeams.push(new Beam(s,this.beamNumberOffset));else s+=this.beamNumberOffset;var u=!1;if(!(s>0&&s<=this.openBeams.length&&this.openBeams[s-1]))return void log$2.debug("[OSMD] invalid beamnumber");for(var c=0,h=this.openBeams[s-1].Notes.length;c1){var i=e.element("time-modification");i&&(i=i.element("actual-notes"));for(var r=t,a=0,s=r.length;a1&&this.openTupletNumber--),this.tupletDict[c]=d;var m=[];m.push(this.currentNote),d.Notes.push(m),d.Fractions.push(this.getTupletNoteDurationFromType(e)),this.currentNote.NoteTuplet=d,this.openTupletNumber=c}else if("stop"===u.value){var v=1;o.attribute("number")&&(v=parseInt(o.attribute("number").value,10));var g=this.tupletDict[v];if(g){var y=o.attribute("placement");y&&("below"===y.value?g.tupletLabelNumberPlacement=PlacementEnum.Below:g.tupletLabelNumberPlacement=PlacementEnum.Above,g.PlacementFromXml=!0);var b=[];if(b.push(this.currentNote),g.Notes.push(b),!g.PlacementFromXml){var _,S=!1,x=_createForOfIteratorHelper(g.Notes);try{for(x.s();!(_=x.n()).done;){var w,k=_createForOfIteratorHelper(_.value);try{for(k.s();!(w=k.n()).done;){var E=w.value;if(!E.isRest()){E.StemDirectionXml===StemDirectionType.Down?g.tupletLabelNumberPlacement=PlacementEnum.Below:g.tupletLabelNumberPlacement=PlacementEnum.Above,S=!0;break}}}catch(err){k.e(err)}finally{k.f()}if(S)break}}catch(err){x.e(err)}finally{x.f()}}g.Fractions.push(this.getTupletNoteDurationFromType(e)),this.currentNote.NoteTuplet=g,delete this.tupletDict[v],0===Object.keys(this.tupletDict).length?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--}}}}}else if(t[0]){var T=t[0];if(T.hasAttributes){var P=T.attribute("type").value,A=1;T.attribute("number")&&(A=parseInt(T.attribute("number").value,10));var C=isNaN(A),M=T.attribute("bracket");if(M&&"yes"===M.value&&(n=!0),"start"===P){var I=0,N=e.element("time-modification");if(N&&(N=N.element("actual-notes")),N&&(I=parseInt(N.value,10),isNaN(I))){var L=ITextTranslation.translateText("ReaderErrorMessages/TupletNoteDurationError","Invalid tuplet note duration.");throw this.musicSheet.SheetErrors.pushMeasureError(L),new MusicSheetReadingException(L)}C&&(this.openTupletNumber++,A=this.openTupletNumber);var R=this.tupletDict[A];R||((R=this.tupletDict[A]=new Tuplet(I,n)).tupletLabelNumberPlacement=PlacementEnum.Above);var F=T.attribute("placement");F&&("below"===F.value?R.tupletLabelNumberPlacement=PlacementEnum.Below:R.tupletLabelNumberPlacement=PlacementEnum.Above,R.PlacementFromXml=!0);var O=[];O.push(this.currentNote),R.Notes.push(O),R.Fractions.push(this.getTupletNoteDurationFromType(e)),this.currentNote.NoteTuplet=R,this.openTupletNumber=A}else if("stop"===P){C&&(A=this.openTupletNumber);var B=this.tupletDict[this.openTupletNumber];if(B){var D=T.attribute("placement");D&&("below"===D.value?B.tupletLabelNumberPlacement=PlacementEnum.Below:B.tupletLabelNumberPlacement=PlacementEnum.Above,B.PlacementFromXml=!0);var V=[];if(V.push(this.currentNote),B.Notes.push(V),!B.PlacementFromXml){var $,G=!1,z=_createForOfIteratorHelper(B.Notes);try{for(z.s();!($=z.n()).done;){var H,U=_createForOfIteratorHelper($.value);try{for(U.s();!(H=U.n()).done;){var j=H.value;if(!j.isRest()){j.StemDirectionXml===StemDirectionType.Down?B.tupletLabelNumberPlacement=PlacementEnum.Below:B.tupletLabelNumberPlacement=PlacementEnum.Above,G=!0;break}}}catch(err){U.e(err)}finally{U.f()}if(G)break}}catch(err){z.e(err)}finally{z.f()}}B.Fractions.push(this.getTupletNoteDurationFromType(e)),this.currentNote.NoteTuplet=B,0===Object.keys(this.tupletDict).length?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--,delete this.tupletDict[A]}}}}return this.openTupletNumber}},{key:"handleTimeModificationNode",value:function(e){if(this.tupletDict[this.openTupletNumber])try{var t,n=this.tupletDict[this.openTupletNumber],i=CollectionUtil.last(n.Notes);i[0].ParentVoiceEntry.Timestamp.Equals(this.currentVoiceEntry.Timestamp)?t=i:(t=[],n.Notes.push(t),n.Fractions.push(this.getTupletNoteDurationFromType(e))),t.push(this.currentNote),this.currentNote.NoteTuplet=n}catch(o){var r=ITextTranslation.translateText("ReaderErrorMessages/TupletNumberError","Invalid tuplet number.");throw this.musicSheet.SheetErrors.pushMeasureError(r),o}else if(this.currentVoiceEntry.Notes.length>0){var a=this.currentVoiceEntry.Notes[0];if(a.NoteTuplet){var s=a.NoteTuplet;CollectionUtil.last(s.Notes).push(this.currentNote),this.currentNote.NoteTuplet=s}}}},{key:"addTie",value:function(e,t,n,i){if(e)if(1===e.length){var r=e[0];if(void 0!==r&&r.attributes()){var a=this.getTieDirection(r),s=r.attribute("type").value;try{if("start"===s){var o=this.findCurrentNoteInTieDict(this.currentNote);o<0&&delete this.openTieDict[o];var l=this.getNextAvailableNumberForTie(),u=new Tie(this.currentNote,i);this.openTieDict[l]=u,u.TieNumber=l,u.TieDirection=a}else if("stop"===s){var c=this.findCurrentNoteInTieDict(this.currentNote),h=this.openTieDict[c];h&&(h.AddNote(this.currentNote),delete this.openTieDict[c])}}catch(err){var f=ITextTranslation.translateText("ReaderErrorMessages/TieError","Error while reading tie.");this.musicSheet.SheetErrors.pushMeasureError(f)}}}else if(2===e.length){var d=this.findCurrentNoteInTieDict(this.currentNote);if(d>=0){var p=this.openTieDict[d];p.AddNote(this.currentNote);var m,v=_createForOfIteratorHelper(e);try{for(v.s();!(m=v.n()).done;){var g=m.value;if("start"===g.attribute("type").value){var y=this.getTieDirection(g);p.NoteIndexToTieDirection[p.Notes.length-1]=y}}}catch(err){v.e(err)}finally{v.f()}}}}},{key:"getTieDirection",value:function(e){var t=PlacementEnum.NotYetDefined,n=e.attribute("placement");n&&("above"===n.value?t=PlacementEnum.Above:"below"===n.value&&(t=PlacementEnum.Below));var i=e.attribute("orientation");return i&&("over"===i.value?t=PlacementEnum.Above:"under"===i.value&&(t=PlacementEnum.Below)),t}},{key:"getNextAvailableNumberForTie",value:function(){var e=Object.keys(this.openTieDict);if(0===e.length)return 1;e.sort((function(e,t){return+e-+t}));for(var t=0;t0&&void 0!==arguments[0]&&arguments[0],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];_classCallCheck2(this,e),this.ChangeEnd=!1,this.ChangeBegin=!1,this.line=t,this.sign=n}return _createClass2(e,[{key:"IsLine",get:function(){return this.line}},{key:"IsSign",get:function(){return this.sign}}]),e}(),WavyLine=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e){return _classCallCheck2(this,n),t.call(this,e)}return _createClass2(n)}(AbstractExpression),ExpressionReader=function(){function e(t,n,i){_classCallCheck2(this,e),this.openContinuousDynamicExpressions=[],this.musicSheet=t,this.staffNumber=i,this.globalStaffIndex=t.getGlobalStaffIndexOfFirstStaff(n)+(i-1),this.initialize()}return _createClass2(e,[{key:"readExpressionParameters",value:function(e,t,n,i,r,a,s){this.initialize();var o=e.element("offset");if(void 0!==o&&!s)try{this.offsetDivisions=parseInt(o.value,10)}catch(w){var l="ReaderErrorMessages/ExpressionOffsetError, Invalid expression offset -> set to default.";log$2.debug("ExpressionReader.readExpressionParameters",l,w),this.musicSheet.SheetErrors.pushMeasureError(l),this.offsetDivisions=0}this.directionTimestamp=Fraction$1.createFromFraction(i);var u=new Fraction$1(Math.abs(this.offsetDivisions),4*n);this.offsetDivisions>0?i.RealValue>0?(u=Fraction$1.multiply(Fraction$1.minus(i,r),u),this.directionTimestamp=Fraction$1.plus(u,i)):this.directionTimestamp=Fraction$1.createFromFraction(u):this.offsetDivisions<0&&(i.RealValue>0?(u=Fraction$1.multiply(Fraction$1.minus(i,r),u),this.directionTimestamp=Fraction$1.minus(i,u)):this.directionTimestamp=Fraction$1.createFromFraction(u));var c=e.attribute("placement");if(c)try{var h=c.value;"below"===h?this.placement=PlacementEnum.Below:"above"===h&&(this.placement=PlacementEnum.Above)}catch(w){var f=ITextTranslation.translateText("ReaderErrorMessages/ExpressionPlacementError","Invalid expression placement -> set to default.");log$2.debug("ExpressionReader.readExpressionParameters",f,w),this.musicSheet.SheetErrors.pushMeasureError(f),this.placement=PlacementEnum.Below}if(this.placement===PlacementEnum.NotYetDefined)try{var d=e.element("direction-type");if(d){var p=d.element("dynamics");if(p){var m=p.attribute("default-y");m&&this.readExpressionPlacement(m,"read dynamics y pos")}var v=d.element("wedge");if(v){var g=v.attribute("default-y");g&&this.readExpressionPlacement(g,"read wedge y pos")}var y=d.element("words");if(y){var b=y.attribute("default-y");b&&this.readExpressionPlacement(b,"read words y pos")}var _=d.element("rehearsal");if(_){var S=_.attribute("default-y");S&&this.readExpressionPlacement(S,"read rehearsal pos")}}}catch(w){var x=ITextTranslation.translateText("ReaderErrorMessages/ExpressionPlacementError","Invalid expression placement -> set to default.");log$2.debug("ExpressionReader.readExpressionParameters",x,w),this.musicSheet.SheetErrors.pushMeasureError(x),this.placement=PlacementEnum.Below}this.placement===PlacementEnum.NotYetDefined&&(t.Staves.length>1?this.placement=PlacementEnum.Below:t.HasLyrics?this.placement=PlacementEnum.Above:this.placement=PlacementEnum.Below)}},{key:"read",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=!1,s=!1,o=e.element("sound");if(o){var l=o.attribute("tempo"),u=o.attribute("dynamics");if(l){var c=l.value.match(/^(\d+)(\.\d+)?$/);(null==c?void 0:c.length)>0?this.soundTempo=Math.round(Number.parseFloat(l.value)):(log$2.info("invalid xml tempo: "+l.value),this.soundTempo=100),t.TempoInBPM=this.soundTempo,0===this.musicSheet.DefaultStartTempoInBpm&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),this.musicSheet.HasBPMInfo=!0,a=!0}if(u){var h=u.value.match(/\d+/);this.soundDynamic=void 0!==h?parseInt(h[0],10):100,s=!0}}var f=e.element("direction-type");if(f){var d=f.element("metronome");if(d){t.metronomeNoteIndex=r;var p=d.element("beat-unit"),m=void 0!==d.element("beat-unit-dot"),v=d.element("per-minute");if(void 0!==p&&v){var g=d.hasAttributes&&void 0!==d.attribute("default-x");g&&(this.directionTimestamp=Fraction$1.createFromFraction(n));var y=parseFloat(v.value);this.createNewTempoExpressionIfNeeded(t);var b=new InstantaneousTempoExpression(void 0,this.placement,this.staffNumber,y,this.currentMultiTempoExpression,!0);b.parentMeasure=t,this.soundTempo=y,t.TempoInBPM=this.soundTempo*(m?1.5:1),0===this.musicSheet.DefaultStartTempoInBpm&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),1===t.MeasureNumberXML&&0===this.musicSheet.SourceMeasures.length&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),this.musicSheet.HasBPMInfo=!0,b.dotted=m,b.beatUnit=p.value,this.currentMultiTempoExpression.addExpression(b,""),this.currentMultiTempoExpression.CombinedExpressionsText="test"}}else if(d=f.element("dynamics")){var _=void 0!==e.element("notations");this.interpretInstantaneousDynamics(d,t,n,_)}else if(d=f.element("words")){var S,x=f.elements("words"),w="",k=_createForOfIteratorHelper(x);try{for(k.s();!(S=k.n()).done;){var E=S.value;w+=E.value}}catch(err){k.e(err)}finally{k.f()}if(d.value=w,a||isSpeedKeyword(d.value)||isSpeedHiddenKeyword(d.value)){this.createNewTempoExpressionIfNeeded(t),this.currentMultiTempoExpression.CombinedExpressionsText=d.value,(isSpeedKeyword(d.value)||isSpeedHiddenKeyword(d.value))&&(d.value=void 0);var T=new InstantaneousTempoExpression(d.value,this.placement,this.staffNumber,this.soundTempo,this.currentMultiTempoExpression);this.currentMultiTempoExpression.addExpression(T,"")}else s||this.interpretWords(d,t,n)}else(d=f.element("wedge"))?this.interpretWedge(d,t,i,t.MeasureNumber):(d=f.element("rehearsal"))&&this.interpretRehearsalMark(d,t,n,t.MeasureNumber)}}},{key:"closeOpenExpressions",value:function(e,t){var n,i=_createForOfIteratorHelper(this.openContinuousDynamicExpressions);try{for(i.s();!(n=i.n()).done;){var r=n.value;this.createNewMultiExpressionIfNeeded(e,r.NumberXml,t),this.closeOpenContinuousDynamic(r,e,t)}}catch(err){i.e(err)}finally{i.f()}this.openContinuousTempoExpression&&this.closeOpenContinuousTempo(Fraction$1.plus(e.AbsoluteTimestamp,t))}},{key:"addOctaveShift",value:function(e,t,n){var i=1,r=e.element("staff");if(r)try{i=parseInt(r.value,10)}catch(v){var a=ITextTranslation.translateText("ReaderErrorMessages/OctaveShiftStaffError","Invalid octave shift staff number -> set to default");this.musicSheet.SheetErrors.pushMeasureError(a),i=1,log$2.debug("ExpressionReader.addOctaveShift",a,v)}var s=e.element("direction-type");if(s){var o=s.element("octave-shift"),l=this.readPlacement(e);if(void 0!==o&&o.hasAttributes)try{var u=this.readNumber(o);if(o.attribute("size")){var c,h=parseInt(o.attribute("size").value,10),f=0;8===h?f=1:15===h&&(f=2);var d=null===(c=o.attribute("type"))||void 0===c?void 0:c.value;if(d||(l===PlacementEnum.Above?d="down":l===PlacementEnum.Below&&(d="up")),"up"===d||"down"===d){var p=new OctaveShift(d,f);p.StaffNumber=i,this.getMultiExpression=this.createNewMultiExpressionIfNeeded(t,u),this.getMultiExpression.OctaveShiftStart=p,p.ParentStartMultiExpression=this.getMultiExpression,this.openOctaveShift=p}else if("stop"===d){if(this.openOctaveShift)this.getMultiExpression=this.createNewMultiExpressionIfNeeded(t,this.openOctaveShift.numberXml,n),this.getMultiExpression.OctaveShiftEnd=this.openOctaveShift,this.openOctaveShift.ParentEndMultiExpression=this.getMultiExpression,this.openOctaveShift=void 0}else d||log$2.debug("octave-shift missing type in xml")}}catch(v){var m=ITextTranslation.translateText("ReaderErrorMessages/OctaveShiftError","Error while reading octave shift.");this.musicSheet.SheetErrors.pushMeasureError(m),log$2.debug("ExpressionReader.addOctaveShift",m,v)}}}},{key:"addPedalMarking",value:function(e,t,n){var i=e.element("direction-type");if(i){var r=i.element("pedal");if(void 0!==r&&r.hasAttributes){var a=!1,s=!1;try{var o,l,u,c;switch("yes"===(null===(o=r.attribute("line"))||void 0===o?void 0:o.value)?s=!0:"no"===(null===(l=r.attribute("line"))||void 0===l?void 0:l.value)&&(s=!1,a=!0),"yes"===(null===(u=r.attribute("sign"))||void 0===u?void 0:u.value)?a=!0:"no"===(null===(c=r.attribute("sign"))||void 0===c?void 0:c.value)&&(a=!1,s=!0),r.attribute("type").value){case"start":this.openPedal&&this.openPedal.IsLine&&this.endOpenPedal(t),this.createNewMultiExpressionIfNeeded(t,-1),this.openPedal=new Pedal(s,a),this.getMultiExpression.PedalStart=this.openPedal,this.openPedal.ParentStartMultiExpression=this.getMultiExpression;break;case"stop":this.openPedal&&this.endOpenPedal(t);break;case"change":this.openPedal&&this.openPedal.IsLine&&(this.openPedal.ChangeEnd=!0,this.createNewMultiExpressionIfNeeded(t,-1),this.getMultiExpression.PedalEnd=this.openPedal,this.openPedal.ParentEndMultiExpression=this.getMultiExpression,this.createNewMultiExpressionIfNeeded(t,-1),this.openPedal=new Pedal(s,a),this.openPedal.ChangeBegin=!0,this.getMultiExpression.PedalStart=this.openPedal,this.openPedal.ParentStartMultiExpression=this.getMultiExpression)}}catch(f){var h=ITextTranslation.translateText("ReaderErrorMessages/PedalError","Error while reading pedal.");this.musicSheet.SheetErrors.pushMeasureError(h),log$2.debug("ExpressionReader.addPedalMarking",h,f)}}}}},{key:"endOpenPedal",value:function(e){this.createNewMultiExpressionIfNeeded(e,-1),this.getMultiExpression.PedalEnd=this.openPedal,this.openPedal.ParentEndMultiExpression=this.getMultiExpression,this.openPedal=void 0}},{key:"addWavyLine",value:function(e,t,n,i){if(e&&e.hasAttributes)try{switch(e.attribute("type").value){case"start":this.createNewMultiExpressionIfNeeded(t,-1),this.openWavyLine=new WavyLine(this.placement),this.getMultiExpression.WavyLineStart=this.openWavyLine,this.openWavyLine.ParentStartMultiExpression=this.getMultiExpression;break;case"stop":this.openWavyLine&&(this.createNewMultiExpressionIfNeeded(t,-1,n),this.getMultiExpression.WavyLineEnd=this.openWavyLine,this.openWavyLine.ParentEndMultiExpression=this.getMultiExpression,this.openWavyLine=void 0)}}catch(a){var r=ITextTranslation.translateText("ReaderErrorMessages/WavyLineError","Error while reading wavy-line.");this.musicSheet.SheetErrors.pushMeasureError(r),log$2.debug("ExpressionReader.addWavyLine",r,a)}}},{key:"initialize",value:function(){this.placement=PlacementEnum.NotYetDefined,this.soundTempo=0,this.soundDynamic=0,this.offsetDivisions=0}},{key:"readPlacement",value:function(e){var t,n=null===(t=e.attribute("placement"))||void 0===t?void 0:t.value;return"above"===n?PlacementEnum.Above:"below"===n?PlacementEnum.Below:PlacementEnum.NotYetDefined}},{key:"readExpressionPlacement",value:function(e,t){try{var n=parseInt(e.value,10);n<0?this.placement=PlacementEnum.Below:n>0&&(this.placement=PlacementEnum.Above)}catch(i){log$2.debug("ExpressionReader.readExpressionParameters",t,i)}}},{key:"interpretInstantaneousDynamics",value:function(e,t,n,i){if(e.hasElements){e.hasAttributes&&e.attribute("default-x")&&(this.directionTimestamp=Fraction$1.createFromFraction(n));var r=this.readNumber(e),a=e.elements()[0].name;if("other-dynamics"===a&&(a=e.elements()[0].value),a){i?this.createNewMultiExpressionIfNeeded(t,r,Fraction$1.createFromFraction(n)):this.createNewMultiExpressionIfNeeded(t,r);var s=new InstantaneousDynamicExpression(a,this.soundDynamic,this.placement,this.staffNumber,t);s.InMeasureTimestamp=n.clone(),this.getMultiExpression.addExpression(s,""),this.initialize(),this.activeInstantaneousDynamic?this.activeInstantaneousDynamic.DynEnum=s.DynEnum:this.activeInstantaneousDynamic=new InstantaneousDynamicExpression(a,0,PlacementEnum.NotYetDefined,1,t)}}}},{key:"interpretWords",value:function(e,t,n){var i,r=e.value,a=e.attribute("font-style");a&&("italic"===a.value&&(i=FontStyles.Italic));if(r.length>0){if(e.hasAttributes&&e.attribute("default-x")&&(this.directionTimestamp=Fraction$1.createFromFraction(n)),this.checkIfWordsNodeIsRepetitionInstruction(r))return;this.fillMultiOrTempoExpression(r,t,n,i),this.initialize()}}},{key:"readNumber",value:function(e){var t,n=1,i=null===(t=e.attribute("number"))||void 0===t?void 0:t.value;return i&&(n=Number.parseInt(i,10)),n}},{key:"interpretWedge",value:function(e,t,n,i){var r,a;void 0!==e&&e.hasAttributes&&e.attribute("default-x")&&(this.directionTimestamp=Fraction$1.createFromFraction(n));var s=this.readNumber(e);"stop"===(null===(r=e.attribute("type"))||void 0===r||null===(a=r.value)||void 0===a?void 0:a.toLowerCase())?this.createNewMultiExpressionIfNeeded(t,s,n):this.createNewMultiExpressionIfNeeded(t,s),this.addWedge(e,t,n),this.initialize()}},{key:"interpretRehearsalMark",value:function(e,t,n,i){t.rehearsalExpression=new RehearsalExpression(e.value,this.placement)}},{key:"createNewMultiExpressionIfNeeded",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;n||(n=this.directionTimestamp);var i=this.getMultiExpression;return(!i||i&&(i.SourceMeasureParent!==e||i.numberXml!==t||i.SourceMeasureParent===e&&i.Timestamp!==n))&&(this.getMultiExpression=i=new MultiExpression(e,Fraction$1.createFromFraction(n)),e.StaffLinkedExpressions[this.globalStaffIndex].push(i)),i}},{key:"createNewTempoExpressionIfNeeded",value:function(e){this.currentMultiTempoExpression&&this.currentMultiTempoExpression.SourceMeasureParent===e&&this.currentMultiTempoExpression.Timestamp===this.directionTimestamp||(this.currentMultiTempoExpression=new MultiTempoExpression(e,Fraction$1.createFromFraction(this.directionTimestamp)),e.TempoExpressions.push(this.currentMultiTempoExpression))}},{key:"addWedge",value:function(e,t,n){if(void 0!==e&&e.hasAttributes){var i=this.readNumber(e),r=e.attribute("type").value.toLowerCase();try{if("crescendo"===r||"diminuendo"===r){var a=new ContinuousDynamicExpression(ContDynamicEnum[r],this.placement,this.staffNumber,t,this.activeInstantaneousDynamic,i);this.openContinuousDynamicExpressions.push(a);var s=this.getMultiExpression;s||(s=this.createNewMultiExpressionIfNeeded(t,i)),s.StartingContinuousDynamic=a,a.StartMultiExpression=s,void 0!==this.activeInstantaneousDynamic&&this.activeInstantaneousDynamic.StaffNumber===a.StaffNumber&&(this.activeInstantaneousDynamic=void 0)}else if("stop"===r){var o,l=_createForOfIteratorHelper(this.openContinuousDynamicExpressions);try{for(l.s();!(o=l.n()).done;){var u=o.value;u.NumberXml===i&&u.NumberXml===i&&this.closeOpenContinuousDynamic(u,t,n)}}catch(err){l.e(err)}finally{l.f()}}}catch(h){var c="ReaderErrorMessages/WedgeError, Error while reading Crescendo / Diminuendo.";this.musicSheet.SheetErrors.pushMeasureError(c),log$2.debug("ExpressionReader.addWedge",c,h)}}}},{key:"fillMultiOrTempoExpression",value:function(e,t,n,i){if(e){var r=e.trim();this.createExpressionFromString("",r,t,n,e,i)}}},{key:"createExpressionFromString",value:function(e,t,n,i,r,a){if(InstantaneousTempoExpression.isInputStringInstantaneousTempo(t)||ContinuousTempoExpression.isInputStringContinuousTempo(t)){if(n.TempoExpressions.length>0)for(var s=0,o=n.TempoExpressions.length;s0)for(var v=0,g=n.TempoExpressions.length;v0&&!this.hasDigit(t)&&this.globalStaffIndex>0){if(y.EntriesList[0].label.indexOf(t)>=0)return!1;break}}var b=TextAlignmentEnum.CenterBottom;this.musicSheet.Rules.CompactMode&&(b=TextAlignmentEnum.LeftBottom);var _=new UnknownExpression(t,this.placement,b,this.staffNumber);return _.fontStyle=a,m.addExpression(_,e),!1}},{key:"closeOpenContinuousDynamic",value:function(e,t,n){if(e){var i=e.NumberXml;e.EndMultiExpression=this.createNewMultiExpressionIfNeeded(t,i,n),e.StartMultiExpression.EndingContinuousDynamic=e,this.openContinuousDynamicExpressions=this.openContinuousDynamicExpressions.filter((function(t){return t!==e}))}}},{key:"closeOpenContinuousTempo",value:function(e){this.openContinuousTempoExpression.AbsoluteEndTimestamp=e,this.openContinuousTempoExpression=void 0}},{key:"checkIfWordsNodeIsRepetitionInstruction",value:function(e){return"coda"===(e=e.trim().toLowerCase())||"tocoda"===e||"to coda"===e||"fine"===e||"d.c."===e||"dacapo"===e||"da capo"===e||"d.s."===e||"dalsegno"===e||"dal segno"===e||"d.c. al fine"===e||"d.s. al fine"===e||"d.c. al coda"===e||"d.s. al coda"===e}},{key:"hasDigit",value:function(e){return/\d/.test(e)}}]),e}(),Slur=function(){function e(){_classCallCheck2(this,e)}return _createClass2(e,[{key:"StartNote",get:function(){return this.startNote},set:function(e){this.startNote=e}},{key:"EndNote",get:function(){return this.endNote},set:function(e){this.endNote=e}},{key:"startNoteHasMoreStartingSlurs",value:function(){if(!this.startNote)return!1;for(var e=0,t=this.startNote.NoteSlurs.length;e0){var a=r.attribute("type").value,s=1;try{r.attribute("number")&&(s=parseInt(r.attribute("number").value,10))}catch(d){log$2.debug("VoiceGenerator.addSlur number: ",d)}var o=PlacementEnum.NotYetDefined,l=r.attribute("placement");l&&l.value&&("above"===l.value?o=PlacementEnum.Above:"below"===l.value&&(o=PlacementEnum.Below));var u=r.attribute("orientation");if(u&&u.value&&("over"===u.value?o=PlacementEnum.Above:"under"===u.value&&(o=PlacementEnum.Below)),"start"===a){var c=this.openSlurDict[s];c||(c=new Slur,this.openSlurDict[s]=c),c.StartNote=t,c.PlacementXml=o}else if("stop"===a){var h=this.openSlurDict[s];if(h){if(h.EndNote=t,!t.checkForDoubleSlur(h))t.NoteSlurs.push(h),h.StartNote.NoteSlurs.push(h);delete this.openSlurDict[s]}}}}}catch(err){i.e(err)}finally{i.f()}}}catch(err){var f=ITextTranslation.translateText("ReaderErrorMessages/SlurError","Error while reading slur.");this.musicSheet.SheetErrors.pushMeasureError(f)}}}]),e}(),InstrumentReader=function(){function t(e,n,i,r){_classCallCheck2(this,t),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=n,this.xmlMeasureList=i,this.musicSheet=r.GetMusicSheet,this.instrument=r,this.activeClefs=new Array(r.Staves.length),this.activeClefsHaveBeenInitialized=new Array(r.Staves.length);for(var a=0;a=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);var a=new Fraction$1(0,1),s=new Fraction$1(0,1),o=!1;this.maxTieNoteFraction=new Fraction$1(0,1);var l=!1,u=[];try{var c,h=this.xmlMeasureList[this.currentXmlMeasureIndex],f=h.elements();if(t.Rules.UseXMLMeasureNumbers&&!Number.isInteger(t.MeasureNumberXML)){var d,p=parseInt(null===(d=h.attribute("number"))||void 0===d?void 0:d.value,10);Number.isInteger(p)&&(t.MeasureNumberXML=p)}for(var m=0;m0&&(c=f[m-1]),"print"===v.name){var g=v.attribute("new-system");"yes"===(null==g?void 0:g.value)&&(t.printNewSystemXml=!0);var y=v.attribute("new-page");"yes"===(null==y?void 0:y.value)&&(t.printNewPageXml=!0)}else if("note"===v.name){var b;v.element("grace")||(this.xmlNotes.push(v),u.push(v));var _=!0;"no"===(null===(b=v.attribute("print-object"))||void 0===b?void 0:b.value)&&(_=!1);var S=1;this.instrument.Staves.length>1&&v.element("staff")&&(S=parseInt(v.element("staff").value,10),isNaN(S)&&(log$2.debug("InstrumentReader.readNextXmlMeasure.get staff number"),S=1)),this.currentStaff=this.instrument.Staves[S-1];var x=void 0!==v.element("chord");if(v.element("voice")){var w=parseInt(v.element("voice").value,10);this.currentVoiceGenerator=this.getOrCreateVoiceGenerator(w,S-1)}else x&&this.currentVoiceGenerator||(this.currentVoiceGenerator=this.getOrCreateVoiceGenerator(1,S-1));var k=0,E=new Fraction$1(0,1),T=2,P=void 0,A=!1;if(v.element("duration")){if(k=parseInt(v.element("duration").value,10),isNaN(k)){var C=ITextTranslation.translateText("ReaderErrorMessages/NoteDurationError","Invalid Note Duration.");this.musicSheet.SheetErrors.pushMeasureError(C),log$2.debug("InstrumentReader.readNextXmlMeasure",C);continue}if(E=new Fraction$1(k,4*this.divisions),0===k?E=this.getNoteDurationFromTypeNode(v):P=this.getNoteDurationFromTypeNode(v),v.element("time-modification")){E=this.getNoteDurationForTuplet(v);var M=v.element("time-modification");null!=M&&M.element("normal-notes")&&(T=parseInt(M.element("normal-notes").value,10)),A=!0}}var I=void 0!==v.element("rest"),N=v.element("notations"),L=void 0!==v.element("grace")||0===k||x&&l,R=!1,F=!1;if(L){var O=v.element("duration"),B=v.element("grace");if(B&&B.attributes())if(B.attribute("slash"))"yes"===B.attribute("slash").value&&(R=!0);O||(E=this.getNoteDurationFromTypeNode(v));var D=v.element("notations");D&&D.element("slur")&&(F=!0)}var V=!1;v.element("cue")&&(V=!0);var $=v.element("type"),G=NoteType.UNDEFINED;if($){var z=$.attribute("size");"cue"===(null==z?void 0:z.value)&&(V=!0),G=NoteTypeHandler.StringToNoteType($.value)}var H=StemDirectionType.Undefined,U=void 0,j=v.element("stem");if(j){switch(j.value){case"down":H=StemDirectionType.Down;break;case"up":H=StemDirectionType.Up;break;case"double":H=StemDirectionType.Double;break;case"none":H=StemDirectionType.None;break;default:H=StemDirectionType.Undefined}var W=j.attribute("color");W&&(U=this.parseXmlColor(W.value))}var q=0,Y="",X="";if(N){var K=N.element("ornaments");if(K){var Z=K.element("tremolo");if(Z){var J=Z.attribute("type");if(Y=J.value,J){var Q=parseInt(Z.value,10);Q>0&&(q=Q),"start"!==J.value&&"stop"!==J.value||(E=new Fraction$1(parseInt(v.element("duration").value,10),4*this.divisions))}}var ee=K.elements("wavy-line");if(void 0!==ee){var te,ne=_createForOfIteratorHelper(ee);try{for(ne.s();!(te=ne.n()).done;){var ie=te.value,re=this.expressionReaders[this.readExpressionStaffNumber(v)-1];re&&(re.readExpressionParameters(ie,this.instrument,this.divisions,a,s,this.currentMeasure.MeasureNumber,!1),re.addWavyLine(ie,this.currentMeasure,a,s))}}catch(err){ne.e(err)}finally{ne.f()}}}var ae=N.element("glissando");if(ae)"start"===ae.attribute("type").value&&(X="start")}var se=void 0,oe=v.element("notehead");if(oe){var le=oe.attribute("color");le&&(se=this.parseXmlColor(le.value))}var ue=void 0,ce=v.attribute("color");ce&&(ue=this.parseXmlColor(ce.value),se||(se=ue),U||(U=ue));var he=a.clone();x&&(he=s.clone()),this.currentStaffEntry=this.currentMeasure.findOrCreateStaffEntry(he,this.inSourceMeasureInstrumentIndex+S-1,this.currentStaff).staffEntry,(!this.currentVoiceGenerator.hasVoiceEntry()||!x&&!L&&!l||L&&!l||L&&!x||!L&&l)&&this.currentVoiceGenerator.createVoiceEntry(he,this.currentStaffEntry,this.activeKey,this.ActiveRhythm,L,R,F),L||x||(s=a.clone(),a.Add(E)),x&&void 0!==this.currentStaffEntry&&this.currentStaffEntry.ParentStaff!==this.currentStaff&&(this.currentStaffEntry=this.currentVoiceGenerator.checkForStaffEntryLink(this.inSourceMeasureInstrumentIndex+S-1,this.currentStaff,this.currentStaffEntry,this.currentMeasure));var fe=void 0!==this.currentStaffEntry&&void 0!==this.currentStaffEntry.Timestamp&&this.currentStaffEntry.Timestamp.Equals(new Fraction$1(0,1))&&!this.currentStaffEntry.hasNotes();this.saveAbstractInstructionList(this.instrument.Staves.length,fe),0!==this.openChordSymbolContainers.length&&(this.currentStaffEntry.ChordContainers=this.openChordSymbolContainers,this.openChordSymbolContainers=[]),this.activeRhythm,A||L||(E=new Fraction$1(k,4*this.divisions));var de=v.elements("dot").length;if(this.currentVoiceGenerator.read(v,E,P,G,T,I,this.currentStaffEntry,this.currentMeasure,n,this.maxTieNoteFraction,x,i,_,V,L,H,q,U,se,de,Y,X),void 0!==N&&N.element("dynamics")){var pe=this.expressionReaders[this.readExpressionStaffNumber(v)-1];pe&&(pe.readExpressionParameters(v,this.instrument,this.divisions,a,s,this.currentMeasure.MeasureNumber,!1),pe.read(v,this.currentMeasure,s,void 0,u.length))}l=L}else if("attributes"===v.name){var me=v.element("divisions");if(me&&(this.divisions=parseInt(me.value,10),isNaN(this.divisions))){var ve=ITextTranslation.translateText("ReaderErrorMessages/DivisionError","Invalid divisions value at Instrument: ");if(log$2.debug("InstrumentReader.readNextXmlMeasure",ve),this.divisions=this.readDivisionsFromNotes(),!(this.divisions>0))throw o=!0,new MusicSheetReadingException(ve+this.instrument.Name);this.musicSheet.SheetErrors.push(ve+this.instrument.Name)}if(!v.element("divisions")&&0===this.divisions&&0===this.currentXmlMeasureIndex){var ge=ITextTranslation.translateText("ReaderErrorMessages/DivisionError","Invalid divisions value at Instrument: ");if(this.divisions=this.readDivisionsFromNotes(),!(this.divisions>0))throw o=!0,new MusicSheetReadingException(ge+this.instrument.Name);this.musicSheet.SheetErrors.push(ge+this.instrument.Name)}this.addAbstractInstruction(v,i,c,a.clone()),a.Equals(new Fraction$1(0,1))&&this.isAttributesNodeAtBeginOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex],v)&&this.saveAbstractInstructionList(this.instrument.Staves.length,!0),this.isAttributesNodeAtEndOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex],v)&&this.saveClefInstructionAtEndOfMeasure();var ye,be=_createForOfIteratorHelper(v.elements("staff-details"));try{for(be.s();!(ye=be.n()).done;){var _e=ye.value,Se=_e.element("staff-lines");if(Se){var xe=1,we=_e.attribute("number");we&&(xe=parseInt(we.value,10)),this.instrument.Staves[xe-1].StafflineCount=parseInt(Se.value,10)}}}catch(err){be.e(err)}finally{be.f()}var ke=v.element("measure-style");if(ke){var Ee=ke.element("multiple-rest");if(Ee){var Te=Ee.value,Pe=0;try{Pe=Number.parseInt(Te,10),void 0!==t.multipleRestMeasures&&Pe!==t.multipleRestMeasures?t.multipleRestMeasures=0:(t.multipleRestMeasures=Pe,this.currentMultirestStartMeasure=t,this.followingMultirestMeasures=Pe+1)}catch(e){console.log("multirest parse error: "+e)}}}}else if("forward"===v.name){var Ae=parseInt(v.element("duration").value,10);a.Add(new Fraction$1(Ae,4*this.divisions))}else if("backup"===v.name){var Ce=parseInt(v.element("duration").value,10);a.Sub(new Fraction$1(Ce,4*this.divisions)),a.IsNegative()&&(a=new Fraction$1(0,1)),s.Sub(new Fraction$1(Ce,4*this.divisions)),s.IsNegative()&&(s=new Fraction$1(0,1))}else if("direction"===v.name){var Me=v.elements("direction-type"),Ie=v.element("direction-type"),Ne=Math.min(1,a.RealValue);void 0!==this.activeRhythm&&this.activeRhythm.Rhythm&&(Ne/=this.activeRhythm.Rhythm.RealValue);var Le=!1;if(this.repetitionInstructionReader&&(Le=this.repetitionInstructionReader.handleRepetitionInstructionsFromWordsOrSymbols(Ie,Ne)),!Le){var Re=this.expressionReaders[0],Fe=this.readExpressionStaffNumber(v)-1;if(Fe0?this.musicSheet.SourceMeasures[0]:this.currentMeasure;var n,i=new ClefInstruction(ClefEnum.G,0,2);t.FirstInstructionsStaffEntries[e]?(n=t.FirstInstructionsStaffEntries[e]).removeFirstInstructionOfTypeClefInstruction():(n=new SourceStaffEntry(void 0,void 0),t.FirstInstructionsStaffEntries[e]=n),i.Parent=n,n.Instructions.splice(0,0,i)}},{key:"createDefaultKeyInstruction",value:function(){var e;e=this.musicSheet.SourceMeasures.length>0?this.musicSheet.SourceMeasures[0]:this.currentMeasure;for(var t=new KeyInstruction(void 0,0,KeyEnum.major),n=this.inSourceMeasureInstrumentIndex;n0&&"backup"===n[i-1].name)return!0;for(var r=-1,a=0;a0||r<0}},{key:"isAttributesNodeAtEndOfMeasure",value:function(e,t){for(var n=e.elements().slice(),i=0,r=0;ra}},{key:"getNoteDurationFromTypeNode",value:function(e){var t=e.element("type");if(t){var n=t.value;return NoteTypeHandler.getNoteDurationFromType(n)}return new Fraction$1(0,4*this.divisions)}},{key:"addAbstractInstruction",value:function(t,n,i,r){if(!t.element("divisions")||1!==t.elements().length){var a=t.element("transpose");if(a){var s=a.element("chromatic");s&&(this.instrument.PlaybackTranspose=parseInt(s.value,10))}var o,l=t.elements("clef");if(l.length>0)for(var u=0,c=l.length;u using default clef line."),this.musicSheet.SheetErrors.pushMeasureError(o),d=2,log$2.debug("InstrumentReader.addAbstractInstruction",o,Z)}var g=h.element("sign");if(g)try{f=ClefEnum[g.value],ClefInstruction.isSupportedClef(f)||(o=ITextTranslation.translateText("ReaderErrorMessages/ClefError","Unsupported clef found -> using default clef."),this.musicSheet.SheetErrors.pushMeasureError(o),f=ClefEnum.G,d=2),f===ClefEnum.TAB&&(m=-1)}catch(e){o=ITextTranslation.translateText("ReaderErrorMessages/ClefError","Invalid clef found -> using default clef."),this.musicSheet.SheetErrors.pushMeasureError(o),f=ClefEnum.G,d=2,log$2.debug("InstrumentReader.addAbstractInstruction",o,e)}var y=h.element("clef-octave-change");if(y)try{m=parseInt(y.value,10)}catch(e){o=ITextTranslation.translateText("ReaderErrorMessages/ClefOctaveError","Invalid clef octave found -> using default clef octave."),this.musicSheet.SheetErrors.pushMeasureError(o),m=0}if(h.hasAttributes&&h.attribute("number"))try{(p=parseInt(h.attribute("number").value,10))>this.currentClefNumber&&(p=this.currentClefNumber),this.currentClefNumber=p+1}catch(err){o=ITextTranslation.translateText("ReaderErrorMessages/ClefError","Invalid clef found -> using default clef."),this.musicSheet.SheetErrors.pushMeasureError(o),p=1,this.currentClefNumber=p+1}var b=new ClefInstruction(f,m,d);this.abstractInstructions.push([p,b,r])}if(void 0!==t.element("key")&&this.instrument.MidiInstrumentId!==MidiInstrument.Percussion){var _=0,S=t.element("key").element("fifths");if(S)try{_=parseInt(S.value,10)}catch(Z){o=ITextTranslation.translateText("ReaderErrorMessages/KeyError","Invalid key found -> set to default."),this.musicSheet.SheetErrors.pushMeasureError(o),_=0,log$2.debug("InstrumentReader.addAbstractInstruction",o,Z)}var x=KeyEnum.none,w=t.element("key");if(w&&(w=w.element("mode")),w)try{x=KeyEnum[w.value]}catch(Z){o=ITextTranslation.translateText("ReaderErrorMessages/KeyError","Invalid key found -> set to default."),this.musicSheet.SheetErrors.pushMeasureError(o),x=KeyEnum.major,log$2.debug("InstrumentReader.addAbstractInstruction",o,Z)}var k=new KeyInstruction(void 0,_,x);this.abstractInstructions.push([1,k,r])}if(t.element("time")){var E=t.element("time"),T=RhythmSymbolEnum.NONE,P=!0;if(void 0!==E&&E.hasAttributes){var A=E.attribute("symbol");A&&("common"===A.value?T=RhythmSymbolEnum.COMMON:"cut"===A.value&&(T=RhythmSymbolEnum.CUT));var C=E.attribute("print-object");C&&"no"===C.value&&(P=!1)}for(var M=0,I=0,N=E&&void 0!==E.element("senza-misura"),L=t.elements("time"),R=[],F=[],O=0,B=L.length;O0&&void 0!==F&&R.length===F.length){for(var V=R.length,$=new Array(V),G=0,z=0;z set to default."),this.musicSheet.SheetErrors.pushMeasureError(o),M=4,I=4,log$2.debug("InstrumentReader.addAbstractInstruction",o,Z)}var K=new RhythmInstruction(new Fraction$1(M,I,0,!1),T);K.PrintObject=P,this.abstractInstructions.push([1,K,r])}}}}},{key:"saveAbstractInstructionList",value:function(e,t){for(var n=this.abstractInstructions.length-1;n>=0;n--){var i=this.abstractInstructions[n],r=i[0],a=i[1],s=i[2];if(a instanceof ClefInstruction){var o=a;if(0===this.currentXmlMeasureIndex||r<=this.activeClefs.length&&o!==this.activeClefs[r-1])if(t||void 0===this.currentStaffEntry||this.currentStaffEntry.hasNotes()||r-1!==this.instrument.Staves.indexOf(this.currentStaffEntry.ParentStaff))if(t){if(0!==s.RealValue)continue;var l=void 0;if(this.currentMeasure){var u=o,c=this.inSourceMeasureInstrumentIndex+r-1,h=this.currentMeasure.FirstInstructionsStaffEntries[c];if(0===this.currentXmlMeasureIndex)if(h)if(void 0===this.currentMeasure.FirstInstructionsStaffEntries[c]||h.Instructions[0]instanceof ClefInstruction){var f=new SourceStaffEntry(void 0,void 0);this.currentMeasure.LastInstructionsStaffEntries[c]=f,u.Parent=f,f.Instructions.push(u)}else l=h,u.Parent=l,l.removeFirstInstructionOfTypeClefInstruction(),l.Instructions.splice(0,0,u),this.activeClefsHaveBeenInitialized[r-1]=!0;else l=new SourceStaffEntry(void 0,void 0),this.currentMeasure.FirstInstructionsStaffEntries[c]=l,u.Parent=l,l.Instructions.push(u),this.activeClefsHaveBeenInitialized[r-1]=!0;else if(this.activeClefsHaveBeenInitialized[r-1]){var d=this.previousMeasure;this.followingMultirestMeasures>0&&this.currentMeasure.Rules.RenderMultipleRestMeasures&&(d=this.currentMultirestStartMeasure);var p=new SourceStaffEntry(void 0,void 0);d.LastInstructionsStaffEntries[c]=p,u.Parent=p,p.Instructions.push(u)}else{var m=this.musicSheet.SourceMeasures[0];m.FirstInstructionsStaffEntries[c]?(l=m.FirstInstructionsStaffEntries[c]).removeFirstInstructionOfTypeClefInstruction():l=new SourceStaffEntry(void 0,void 0),u.Parent=l,l.Instructions.splice(0,0,u),this.activeClefsHaveBeenInitialized[r-1]=!0}this.activeClefs[r-1]=o,this.abstractInstructions.splice(n,1)}}else{var v=void 0,g=this.activeRhythm.Rhythm;g.RealValue>0&&s.RealValue/g.RealValue>.9&&(this.currentMeasure.LastInstructionsStaffEntries[r-1]||(this.currentMeasure.LastInstructionsStaffEntries[r-1]=new SourceStaffEntry(void 0,this.instrument.Staves[r-1])),v=this.currentMeasure.LastInstructionsStaffEntries[r-1]),v&&(o.Parent=v,v.Instructions.push(o),this.activeClefs[r-1]=o,this.abstractInstructions.splice(n,1))}else{var y=o,b=this.currentStaffEntry;if(s&&Math.abs(s.RealValue-b.Timestamp.RealValue)>.01)continue;y.Parent=b,b.removeFirstInstructionOfTypeClefInstruction(),b.Instructions.push(y),this.activeClefs[r-1]=o,this.abstractInstructions.splice(n,1)}else r<=this.activeClefs.length&&o===this.activeClefs[r-1]&&this.abstractInstructions.splice(n,1)}if(a instanceof KeyInstruction){var _=a;if(this.activeKey&&this.activeKey.Key===_.Key)this.abstractInstructions.splice(n,1);else{this.activeKey=_,this.abstractInstructions.splice(n,1);var S=void 0;if(this.activeKeyHasBeenInitialized?S=this.currentMeasure:(this.activeKeyHasBeenInitialized=!0,S=this.currentXmlMeasureIndex>0?this.musicSheet.SourceMeasures[0]:this.currentMeasure),S)for(var x=this.inSourceMeasureInstrumentIndex;x=0;e--){var t=this.abstractInstructions[e][0],n=this.abstractInstructions[e][1];if(n instanceof ClefInstruction){var i=n;if(!this.activeClefs[t-1]||i.ClefType!==this.activeClefs[t-1].ClefType||i.ClefType===this.activeClefs[t-1].ClefType&&i.Line!==this.activeClefs[t-1].Line){var r=new SourceStaffEntry(void 0,void 0);this.currentMeasure.LastInstructionsStaffEntries[this.inSourceMeasureInstrumentIndex+t-1]=r;var a=i;a.Parent=r,r.Instructions.push(a),this.activeClefs[t-1]=i,this.abstractInstructions.splice(e,1)}}}}},{key:"getNoteDurationForTuplet",value:function(e){var t=new Fraction$1(0,1),n=this.getNoteDurationFromTypeNode(e);if(e.element("time-modification")){var i=e.element("time-modification");if(i&&void 0!==i.element("actual-notes")&&i.element("normal-notes")){var r=i.element("actual-notes"),a=i.element("normal-notes");if(void 0!==r&&a){var s=parseInt(r.value,10),o=parseInt(a.value,10);t=new Fraction$1(o*n.Numerator,s*n.Denominator)}}}return t}},{key:"readExpressionStaffNumber",value:function(e){var t=1;if(e.element("staff")){var n=e.element("staff");if(n)try{t=parseInt(n.value,10)}catch(r){var i=ITextTranslation.translateText("ReaderErrorMessages/ExpressionStaffError","Invalid Expression staff number -> set to default.");this.musicSheet.SheetErrors.pushMeasureError(i),t=1,log$2.debug("InstrumentReader.readExpressionStaffNumber",i,r)}}return t}},{key:"readDivisionsFromNotes",value:function(){for(var e=0,t=this.currentXmlMeasureIndex,n=!1;!n;){for(var i=this.xmlMeasureList[t].elements(),r=0,a=i.length;r0){n=!0;break}}if(0===e&&++t===this.xmlMeasureList.length){var h=ITextTranslation.translateText("ReaderErrorMEssages/DivisionsError","Invalid divisions value at Instrument: ");throw new MusicSheetReadingException(h+this.instrument.Name)}}return e}}]),t}(),_SubInstrument=function(){function t(e){_classCallCheck2(this,t),this.parentInstrument=e,this.fixedKey=-1,this.name=this.parseMidiInstrument(this.parentInstrument.Name),this.midiInstrumentID=t.midiInstrument[this.name],this.volume=1}return _createClass2(t,[{key:"ParentInstrument",get:function(){return this.parentInstrument}},{key:"setMidiInstrument",value:function(e){this.midiInstrumentID=t.midiInstrument[this.parseMidiInstrument(e)]}},{key:"parseMidiInstrument",value:function(n){try{if(n){var i=n.toLowerCase().trim();for(var r in i=i.replace(/\s+/g,"_"),t.midiInstrument)if(-1!==i.indexOf(r))return r}if(this.parentInstrument.Name){var a=this.parentInstrument.Name.toLowerCase().trim();for(var s in a=a.replace(/\s+/g,"_"),t.midiInstrument)if(-1!==a.indexOf(s))return s}}catch(e){log$2.error("Error parsing MIDI Instrument. Default to Grand Piano.")}return"unnamed"}}],[{key:"isPianoInstrument",value:function(e){return e===MidiInstrument.Acoustic_Grand_Piano||e===MidiInstrument.Bright_Acoustic_Piano||e===MidiInstrument.Electric_Grand_Piano||e===MidiInstrument.Electric_Piano_1||e===MidiInstrument.Electric_Piano_2}}]),t}(),SubInstrument=_SubInstrument;SubInstrument.midiInstrument={alto_saxophone:MidiInstrument.Alto_Sax,baritone_saxophone:MidiInstrument.Baritone_Sax,horn_in_f:MidiInstrument.French_Horn,english_horn:MidiInstrument.English_Horn,euphonium:MidiInstrument.Euphonium,clarinet_in_bb:MidiInstrument.clarinet_in_bb,clarinet_in_eb:MidiInstrument.clarinet_in_eb,clarinet:MidiInstrument.Clarinet,alto_clarinet:MidiInstrument.Alto_Clarinet,bass_clarinet:MidiInstrument.Bass_Clarinet,bassoon:MidiInstrument.Bassoon,bass_trombone:MidiInstrument.Bass_Trombone,alt:MidiInstrument.Synth_Voice,alto:MidiInstrument.Synth_Voice,banjo:MidiInstrument.Banjo,bariton:MidiInstrument.Synth_Voice,baritone:MidiInstrument.Synth_Voice,bass:MidiInstrument.Synth_Voice,"blockflöte":MidiInstrument.Recorder,brass:MidiInstrument.Trombone,bratsche:MidiInstrument.Viola,cello:MidiInstrument.Cello,contrabass:MidiInstrument.Contrabass,drums:MidiInstrument.Percussion,flute:MidiInstrument.Flute,"flöte":MidiInstrument.Flute,frenchhorn:MidiInstrument.French_Horn,gitarre:MidiInstrument.Acoustic_Guitar_nylon,guitar:MidiInstrument.Acoustic_Guitar_nylon,harfe:MidiInstrument.Orchestral_Harp,harp:MidiInstrument.Orchestral_Harp,klarinette:MidiInstrument.Clarinet,klavier:MidiInstrument.Acoustic_Grand_Piano,kontrabass:MidiInstrument.Contrabass,oboe:MidiInstrument.Oboe,organ:MidiInstrument.Church_Organ,orgel:MidiInstrument.Church_Organ,orgue:MidiInstrument.Church_Organ,percussion:MidiInstrument.Synth_Drum,"小军鼓":MidiInstrument.Synth_Drum,snare_drum:MidiInstrument.Synth_Drum,bass_drum:MidiInstrument.Synth_Drum,side_drum:MidiInstrument.Synth_Drum,piano:MidiInstrument.Acoustic_Grand_Piano,piccolo:MidiInstrument.Piccolo,posaune:MidiInstrument.Trombone,recorder:MidiInstrument.Recorder,sax:MidiInstrument.Tenor_Sax,schlagwerk:MidiInstrument.Percussion,schlagzeug:MidiInstrument.Percussion,sopran:MidiInstrument.Synth_Voice,steeldrum:MidiInstrument.Steel_Drums,streicher:MidiInstrument.String_Ensemble_1,strings:MidiInstrument.String_Ensemble_1,tenor:MidiInstrument.Synth_Voice,tpt:MidiInstrument.Trumpet,trombone:MidiInstrument.Trombone,trompete:MidiInstrument.Trumpet,trumpet:MidiInstrument.Trumpet,tuba:MidiInstrument.Tuba,unnamed:MidiInstrument.Acoustic_Grand_Piano,viola:MidiInstrument.Viola,violin:MidiInstrument.Violin,"violon-c":MidiInstrument.Cello,"violon.":MidiInstrument.Violin,voice:MidiInstrument.Synth_Voice,woodblock:MidiInstrument.Woodblock,alto_clarinet_in_eb:MidiInstrument.AltoClarinetInEb,trumpet_in_bb:MidiInstrument.TrumpetInBb,tenor_saxophone:MidiInstrument.TenorSaxophone};var StringUtil=function(){function e(){_classCallCheck2(this,e)}return _createClass2(e,null,[{key:"StringContainsSeparatedWord",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=new RegExp("( |^)"+t+"([ .]|$)",n?"i":void 0);return i.test(e)}}]),e}(),RepetitionInstructionReader=function(){function e(){_classCallCheck2(this,e)}return _createClass2(e,[{key:"MusicSheet",set:function(e){this.musicSheet=e,this.xmlMeasureList=new Array(this.musicSheet.Instruments.length),this.repetitionInstructions=[]}},{key:"prepareReadingMeasure",value:function(e,t){this.currentMeasureIndex=t}},{key:"handleLineRepetitionInstructions",value:function(e){var t=!1;if(e.elements().length>0){var n="",i=!1,r="",a="",s="",o=[],l=e.element("bar-style");l&&(s=l.value),n=e.attributes().length>0&&e.attribute("location")?e.attribute("location").value:"right";for(var u=e.elements(),c=0,h=u.length;c0)if("left"===n){if("start"===a){var k=new RepetitionInstruction(this.currentMeasureIndex,RepetitionInstructionEnum.Ending,AlignmentType.Begin,void 0,o);this.addInstruction(this.repetitionInstructions,k)}if("forward"===r){var E=new RepetitionInstruction(this.currentMeasureIndex,RepetitionInstructionEnum.StartLine);this.addInstruction(this.repetitionInstructions,E)}}else{if("stop"===a){var T=new RepetitionInstruction(this.currentMeasureIndex,RepetitionInstructionEnum.Ending,AlignmentType.End,void 0,o);this.addInstruction(this.repetitionInstructions,T)}if("backward"===r){var P=new RepetitionInstruction(this.currentMeasureIndex,RepetitionInstructionEnum.BackJumpLine);this.addInstruction(this.repetitionInstructions,P)}}}return t}},{key:"handleRepetitionInstructionsFromWordsOrSymbols",value:function(e,t){var n=e.element("words"),i=this.currentMeasureIndex;if(n){var r="d\\s?\\.s\\.",a=n.value.trim().toLowerCase();if(StringUtil.StringContainsSeparatedWord(a,r+" al fine",!0)){var s=new RepetitionInstruction(i,RepetitionInstructionEnum.DalSegnoAlFine);return this.addInstruction(this.repetitionInstructions,s),!0}if(StringUtil.StringContainsSeparatedWord(a,r+" al coda",!0)){var o=new RepetitionInstruction(i,RepetitionInstructionEnum.DalSegnoAlCoda);return this.addInstruction(this.repetitionInstructions,o),!0}var l,u="d\\.\\s?c\\.";if(StringUtil.StringContainsSeparatedWord(a,u+" al fine",!0)){var c=new RepetitionInstruction(i,RepetitionInstructionEnum.DaCapoAlFine);return this.addInstruction(this.repetitionInstructions,c),!0}if(StringUtil.StringContainsSeparatedWord(a,u+" al coda",!0)){var h=new RepetitionInstruction(i,RepetitionInstructionEnum.DaCapoAlCoda);return this.addInstruction(this.repetitionInstructions,h),!0}if(StringUtil.StringContainsSeparatedWord(a,u)||StringUtil.StringContainsSeparatedWord(a,"da\\s?capo",!0)){var f=new RepetitionInstruction(i,RepetitionInstructionEnum.DaCapo);return this.addInstruction(this.repetitionInstructions,f),!0}if(StringUtil.StringContainsSeparatedWord(a,r,!0)||StringUtil.StringContainsSeparatedWord(a,"dal\\s?segno",!0))return l=StringUtil.StringContainsSeparatedWord(a,"al\\s?coda",!0)?new RepetitionInstruction(i,RepetitionInstructionEnum.DalSegnoAlCoda):new RepetitionInstruction(i,RepetitionInstructionEnum.DalSegno),this.addInstruction(this.repetitionInstructions,l),!0;if(StringUtil.StringContainsSeparatedWord(a,"to\\s?coda",!0)||StringUtil.StringContainsSeparatedWord(a,"a (la )?coda",!0)){var d=new RepetitionInstruction(i,RepetitionInstructionEnum.ToCoda);return this.addInstruction(this.repetitionInstructions,d),!0}if(StringUtil.StringContainsSeparatedWord(a,"fine",!0)){var p=new RepetitionInstruction(i,RepetitionInstructionEnum.Fine);return this.addInstruction(this.repetitionInstructions,p),!0}if(StringUtil.StringContainsSeparatedWord(a,"coda",!0)){var m=new RepetitionInstruction(i,RepetitionInstructionEnum.Coda);return this.addInstruction(this.repetitionInstructions,m),!0}if(StringUtil.StringContainsSeparatedWord(a,"segno",!0)){var v=new RepetitionInstruction(i,RepetitionInstructionEnum.Segno);return this.addInstruction(this.repetitionInstructions,v),!0}}else{if(e.element("segno")){var g=new RepetitionInstruction(i,RepetitionInstructionEnum.Segno);return this.addInstruction(this.repetitionInstructions,g),!0}if(e.element("coda")){var y=new RepetitionInstruction(i,RepetitionInstructionEnum.Coda);return this.addInstruction(this.repetitionInstructions,y),!0}}return!1}},{key:"removeRedundantInstructions",value:function(){for(var e=0,t=0,n=0,i=0,r=0;r0&&this.findInstructionInPreviousMeasure(r,a.measureIndex,RepetitionInstructionEnum.ToCoda)&&(a.type=RepetitionInstructionEnum.None),0===t&&0===n&&(a.type=RepetitionInstructionEnum.ToCoda,a.alignment=AlignmentType.End,a.measureIndex--);break;case RepetitionInstructionEnum.Segno:if(e-i>0){for(var s=!1,o=0,l=this.repetitionInstructions.length;o0?RepetitionInstructionEnum.DalSegnoAlCoda:RepetitionInstructionEnum.DalSegno,a.type=RepetitionInstructionEnum.None,s=!0;break;case RepetitionInstructionEnum.DalSegno:case RepetitionInstructionEnum.DalSegnoAlFine:case RepetitionInstructionEnum.DalSegnoAlCoda:a.type=RepetitionInstructionEnum.None,s=!0}if(s)break}if(s)break;a.type=n-t>0?RepetitionInstructionEnum.DalSegnoAlCoda:RepetitionInstructionEnum.DalSegno,a.alignment=AlignmentType.End,a.measureIndex--}}if(this.backwardSearchForPreviousIdenticalInstruction(r,a)||a.type===RepetitionInstructionEnum.None)this.repetitionInstructions.splice(r,1),r--;else switch(a.type){case RepetitionInstructionEnum.Fine:break;case RepetitionInstructionEnum.ToCoda:n++;break;case RepetitionInstructionEnum.Coda:t++;break;case RepetitionInstructionEnum.Segno:e++;break;case RepetitionInstructionEnum.DalSegnoAlFine:case RepetitionInstructionEnum.DalSegnoAlCoda:i++}}this.repetitionInstructions.sort(RepetitionInstructionComparer.Compare)}},{key:"findInstructionInPreviousMeasure",value:function(e,t,n){for(var i=e-1;i>=0;i--){var r=this.repetitionInstructions[i];if(t-r.measureIndex==1&&r.type===n)return!0}return!1}},{key:"backwardSearchForPreviousIdenticalInstruction",value:function(e,t){for(var n=e-1;n>=0;n--){if(this.repetitionInstructions[n].equals(t))return!0}return!1}},{key:"addInstruction",value:function(e,t){for(var n=!0,i=0,r=e.length;i0;)try{var s=this.openRepetitions.last();if(s.RepetitonUnderConstruction.FromWords){if(s.WaitingForCoda){var o=s.RepetitonUnderConstruction.BackwardJumpInstructions.last().measureIndex+1;o>=this.musicSheet.SourceMeasures.length&&(o=-1),s.RepetitonUnderConstruction.setEndingStartIndex(2,o)}else if(0===s.RepetitonUnderConstruction.BackwardJumpInstructions.length){this.openRepetitions.splice(this.openRepetitions.length-1,1);continue}}else if(0===s.RepetitonUnderConstruction.BackwardJumpInstructions.length){var l=i.length-1,u=new RepetitionInstruction(l,RepetitionInstructionEnum.BackJumpLine,AlignmentType.End,s.RepetitonUnderConstruction);s.RepetitonUnderConstruction.BackwardJumpInstructions.push(u),i[l].LastRepetitionInstructions.push(u)}this.finalizeRepetition(this.openRepetitions.last())}catch(err){try{var c,h=this.openRepetitions.last().RepetitonUnderConstruction,f=_createForOfIteratorHelper(this.repetitionInstructions);try{for(f.s();!(c=f.n()).done;){var d=c.value;d.parentRepetition===h&&(d.parentRepetition=void 0)}}catch(err){f.e(err)}finally{f.f()}this.openRepetitions.splice(this.openRepetitions.length-1,1)}catch(w){log$2.error("RepetitionCalculator: calculateRepetitions2",w)}}var p,m=!1,v=this.musicSheet.SourceMeasures.length-1,g=_createForOfIteratorHelper(this.musicSheet.Repetitions);try{for(g.s();!(p=g.n()).done;){var y=p.value;if(0===y.StartIndex&&y.EndIndex===v){m=!0;break}}}catch(err){g.e(err)}finally{g.f()}if(!m){var b=new Repetition(this.musicSheet,!0);b.FromWords=!0,b.startMarker=new RepetitionInstruction(0,RepetitionInstructionEnum.StartLine),b.startMarker.parentRepetition=b,this.musicSheet.SourceMeasures[0].FirstRepetitionInstructions.push(b.startMarker),b.endMarker=new RepetitionInstruction(v,RepetitionInstructionEnum.BackJumpLine),b.endMarker.parentRepetition=b,b.BackwardJumpInstructions.push(b.endMarker),b.UserNumberOfRepetitions=b.DefaultNumberOfRepetitions,this.musicSheet.Repetitions.push(b)}for(var _=0,S=this.musicSheet.SourceMeasures.length;_1&&x.FirstRepetitionInstructions.sort(RepetitionInstructionComparer.Compare),x.LastRepetitionInstructions.length>1&&x.LastRepetitionInstructions.sort(RepetitionInstructionComparer.Compare)}}},{key:"handleRepetitionInstructions",value:function(e){var t;switch(e.type){case RepetitionInstructionEnum.StartLine:t=this.createNewRepetition(this.currentMeasureIndex),e.parentRepetition=t.RepetitonUnderConstruction,t.RepetitonUnderConstruction.FromWords=!1,t.RepetitonUnderConstruction.startMarker=e,this.currentMeasure.FirstRepetitionInstructions.push(e);break;case RepetitionInstructionEnum.BackJumpLine:t=this.getOrCreateCurrentRepetition2(!1),e.parentRepetition=t.RepetitonUnderConstruction,t.RepetitonUnderConstruction.BackwardJumpInstructions.push(e),this.currentMeasure.LastRepetitionInstructions.push(e),0===t.RepetitonUnderConstruction.EndingParts.length&&this.finalizeRepetition(t);break;case RepetitionInstructionEnum.Ending:if(t=this.getOrCreateCurrentRepetition(),e.parentRepetition=t.RepetitonUnderConstruction,e.endingIndices.contains(1)&&e.alignment===AlignmentType.Begin){if(t.RepetitonUnderConstruction.BackwardJumpInstructions.length>0||t.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)){t=void 0;for(var n=this.openRepetitions.length-1;n>=0;n--){var i=this.openRepetitions[n];if(0===i.RepetitonUnderConstruction.BackwardJumpInstructions.length)for(t=i;this.openRepetitions.length-1>n;){var r=this.openRepetitions.last();this.finalizeRepetition(r)}}void 0===t&&((t=this.createNewRepetition(0)).RepetitonUnderConstruction.startMarker=new RepetitionInstruction(0,RepetitionInstructionEnum.None))}void 0===t.RepetitonUnderConstruction.forwardJumpInstruction&&(t.RepetitonUnderConstruction.forwardJumpInstruction=new RepetitionInstruction(this.currentMeasureIndex-1,RepetitionInstructionEnum.ForwardJump,AlignmentType.End,t.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[this.currentMeasureIndex-1].LastRepetitionInstructions.push(t.RepetitonUnderConstruction.forwardJumpInstruction))}if(e.alignment===AlignmentType.Begin)t.RepetitonUnderConstruction.setEndingsStartIndex(e.endingIndices,this.currentMeasureIndex),this.currentMeasure.FirstRepetitionInstructions.push(e);else for(var a=0,s=e.endingIndices.length;a0&&Math.abs(t.RepetitonUnderConstruction.BackwardJumpInstructions.last().measureIndex-this.currentMeasureIndex)<=1)break;if(this.openRepetitions.length&&this.openRepetitions.find((function(e){return e.RepetitonUnderConstruction.startMarker.type===RepetitionInstructionEnum.StartLine})).RepetitonUnderConstruction.StartIndex===this.currentMeasureIndex)break;t=this.createNewRepetition(this.currentMeasureIndex),e.parentRepetition=t.RepetitonUnderConstruction,t.RepetitonUnderConstruction.FromWords=!0,t.SegnoFound=!0,t.RepetitonUnderConstruction.startMarker=e,this.currentMeasure.FirstRepetitionInstructions.push(e);break;case RepetitionInstructionEnum.Fine:if(0===this.openRepetitions.length)break;if(void 0===(t=this.getCurrentRepetition(!0)))break;e.parentRepetition=t.RepetitonUnderConstruction,t.RepetitonUnderConstruction.FromWords=!0,void 0===t.RepetitonUnderConstruction.forwardJumpInstruction?(t.FineFound=!0,t.RepetitonUnderConstruction.forwardJumpInstruction=e,t.RepetitonUnderConstruction.setEndingStartIndex(2,-2),this.currentMeasure.LastRepetitionInstructions.push(e)):this.currentMeasure.LastRepetitionInstructions.push(new RepetitionInstruction(this.currentMeasureIndex,RepetitionInstructionEnum.Fine,AlignmentType.End,void 0));break;case RepetitionInstructionEnum.ToCoda:if(0===this.openRepetitions.length)break;if(void 0===(t=this.getCurrentRepetition(!0)))break;void 0===t.RepetitonUnderConstruction.forwardJumpInstruction&&(e.parentRepetition=t.RepetitonUnderConstruction,t.RepetitonUnderConstruction.FromWords=!0,t.ToCodaFound=!0,t.RepetitonUnderConstruction.forwardJumpInstruction=e,this.currentMeasure.LastRepetitionInstructions.push(e));break;case RepetitionInstructionEnum.Coda:if(0===this.openRepetitions.length)break;t=this.getOrCreateCurrentRepetition2(!0),e.parentRepetition=t.RepetitonUnderConstruction,t.WaitingForCoda?(t.CodaFound=!0,t.RepetitonUnderConstruction.setEndingStartIndex(2,this.currentMeasureIndex),this.currentMeasure.LastRepetitionInstructions.push(e),this.finalizeRepetition(t),this.currentMeasureIndex>0&&(this.musicSheet.SourceMeasures[this.currentMeasureIndex-1].printNewSystemXml=!0)):t.ToCodaFound||(0===t.RepetitonUnderConstruction.BackwardJumpInstructions.length?(t.ToCodaFound=!0,t.RepetitonUnderConstruction.forwardJumpInstruction=new RepetitionInstruction(this.currentMeasureIndex,RepetitionInstructionEnum.ToCoda,AlignmentType.End,t.RepetitonUnderConstruction),this.currentMeasure.LastRepetitionInstructions.push(t.RepetitonUnderConstruction.forwardJumpInstruction)):this.currentMeasure.LastRepetitionInstructions.push(new RepetitionInstruction(this.currentMeasureIndex,RepetitionInstructionEnum.Coda,AlignmentType.Begin,void 0)));break;case RepetitionInstructionEnum.DaCapo:(t=this.getOrCreateCurrentRepetition()).RepetitonUnderConstruction.BackwardJumpInstructions.length>0&&this.finalizeRepetition(t),0!==t.RepetitonUnderConstruction.StartIndex&&(t=this.createNewRepetition(0)),e.parentRepetition=t.RepetitonUnderConstruction,t.RepetitonUnderConstruction.FromWords=!0,t.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(0,RepetitionInstructionEnum.None,AlignmentType.Begin,t.RepetitonUnderConstruction),t.RepetitonUnderConstruction.BackwardJumpInstructions.push(e),this.currentMeasure.LastRepetitionInstructions.push(e),0===t.RepetitonUnderConstruction.EndingParts.length&&this.finalizeRepetition(t);break;case RepetitionInstructionEnum.DalSegno:if((t=this.getOrCreateCurrentRepetition2(!0)).RepetitonUnderConstruction.BackwardJumpInstructions.length>0&&(this.finalizeRepetition(t),(t=this.createNewRepetition(0)).RepetitonUnderConstruction.FromWords=!0,t.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(0,RepetitionInstructionEnum.None,AlignmentType.Begin,t.RepetitonUnderConstruction)),e.parentRepetition=t.RepetitonUnderConstruction,!t.SegnoFound){var l=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.Segno,e.measureIndex);l>=0&&(t.SegnoFound=!0,t.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(l,RepetitionInstructionEnum.Segno,AlignmentType.Begin,t.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[l].FirstRepetitionInstructions.splice(0,0,t.RepetitonUnderConstruction.startMarker))}t.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)&&t.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),t.RepetitonUnderConstruction.BackwardJumpInstructions.push(e),this.currentMeasure.LastRepetitionInstructions.push(e);break;case RepetitionInstructionEnum.DalSegnoAlFine:if(0===this.openRepetitions.length)break;if(t=this.getOrCreateCurrentRepetition2(!0),e.parentRepetition=t.RepetitonUnderConstruction,!t.SegnoFound){var u=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.Segno,e.measureIndex);u>=0&&(t.SegnoFound=!0,t.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(u,RepetitionInstructionEnum.Segno,AlignmentType.Begin,t.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[u].FirstRepetitionInstructions.splice(0,0,t.RepetitonUnderConstruction.startMarker))}if(!t.FineFound){var c=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.Fine,e.measureIndex);c>=0&&(t.FineFound=!0,t.RepetitonUnderConstruction.forwardJumpInstruction=new RepetitionInstruction(c,RepetitionInstructionEnum.Fine,AlignmentType.Begin,t.RepetitonUnderConstruction),t.RepetitonUnderConstruction.setEndingStartIndex(2,-2),this.musicSheet.SourceMeasures[c].LastRepetitionInstructions.splice(0,0,t.RepetitonUnderConstruction.forwardJumpInstruction))}t.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)||t.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),t.RepetitonUnderConstruction.BackwardJumpInstructions.push(e),this.currentMeasure.LastRepetitionInstructions.push(e);break;case RepetitionInstructionEnum.DaCapoAlFine:if((t=this.getOrCreateCurrentRepetition()).RepetitonUnderConstruction.BackwardJumpInstructions.length>0&&(this.finalizeRepetition(t),t=this.createNewRepetition(0)),void 0!==t.RepetitonUnderConstruction.startMarker&&0!==t.RepetitonUnderConstruction.StartIndex&&(t=this.createNewRepetition(0)),t.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(0,RepetitionInstructionEnum.None,AlignmentType.Begin,t.RepetitonUnderConstruction),t.RepetitonUnderConstruction.FromWords=!0,e.parentRepetition=t.RepetitonUnderConstruction,!t.FineFound){var h=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.Fine,e.measureIndex);h>=0&&(t.FineFound=!0,t.RepetitonUnderConstruction.forwardJumpInstruction=new RepetitionInstruction(h,RepetitionInstructionEnum.Fine,AlignmentType.Begin,t.RepetitonUnderConstruction),t.RepetitonUnderConstruction.setEndingStartIndex(2,-2),this.musicSheet.SourceMeasures[h].LastRepetitionInstructions.splice(0,0,t.RepetitonUnderConstruction.forwardJumpInstruction))}t.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)||t.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),t.RepetitonUnderConstruction.BackwardJumpInstructions.push(e),this.currentMeasure.LastRepetitionInstructions.push(e);break;case RepetitionInstructionEnum.DalSegnoAlCoda:if(0===this.openRepetitions.length)break;if(t=this.getOrCreateCurrentRepetition2(!0),e.parentRepetition=t.RepetitonUnderConstruction,!t.SegnoFound){var f=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.Segno,e.measureIndex);f>=0&&(t.SegnoFound=!0,t.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(f,RepetitionInstructionEnum.Segno,AlignmentType.Begin,t.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[f].FirstRepetitionInstructions.splice(0,0,t.RepetitonUnderConstruction.startMarker))}if(!t.ToCodaFound){var d=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.ToCoda,e.measureIndex);if(d>=0)t.RepetitonUnderConstruction.forwardJumpInstruction=new RepetitionInstruction(d,RepetitionInstructionEnum.ToCoda,AlignmentType.Begin,t.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[d].LastRepetitionInstructions.splice(0,0,t.RepetitonUnderConstruction.forwardJumpInstruction),t.ToCodaFound=!0;else{var p=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.Coda,e.measureIndex);p>=0&&(t.RepetitonUnderConstruction.forwardJumpInstruction=new RepetitionInstruction(p,RepetitionInstructionEnum.ToCoda,AlignmentType.Begin,t.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[p].LastRepetitionInstructions.splice(0,0,t.RepetitonUnderConstruction.forwardJumpInstruction),t.ToCodaFound=!0)}}t.ToCodaFound&&(t.WaitingForCoda=!0),t.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)||t.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),t.RepetitonUnderConstruction.BackwardJumpInstructions.push(e),this.currentMeasure.LastRepetitionInstructions.push(e);break;case RepetitionInstructionEnum.DaCapoAlCoda:if(((t=this.getOrCreateCurrentRepetition()).RepetitonUnderConstruction.BackwardJumpInstructions.length>0||0===t.RepetitonUnderConstruction.EndingParts.length)&&(this.finalizeRepetition(t),t=this.createNewRepetition(0)),void 0!==t.RepetitonUnderConstruction.startMarker&&0!==t.RepetitonUnderConstruction.StartIndex&&(t=this.createNewRepetition(0)),t.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(0,RepetitionInstructionEnum.None,AlignmentType.Begin,t.RepetitonUnderConstruction),t.RepetitonUnderConstruction.FromWords=!0,e.parentRepetition=t.RepetitonUnderConstruction,!t.ToCodaFound){var m=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.ToCoda,e.measureIndex);if(m>=0)t.RepetitonUnderConstruction.forwardJumpInstruction=new RepetitionInstruction(m,RepetitionInstructionEnum.ToCoda,AlignmentType.Begin,t.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[m].LastRepetitionInstructions.splice(0,0,t.RepetitonUnderConstruction.forwardJumpInstruction),t.ToCodaFound=!0;else{var v=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.Coda,e.measureIndex);v>=0&&(t.RepetitonUnderConstruction.forwardJumpInstruction=new RepetitionInstruction(v,RepetitionInstructionEnum.ToCoda,AlignmentType.Begin,t.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[v].LastRepetitionInstructions.splice(0,0,t.RepetitonUnderConstruction.forwardJumpInstruction),t.ToCodaFound=!0)}}t.ToCodaFound&&(t.WaitingForCoda=!0),t.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)||t.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),t.RepetitonUnderConstruction.BackwardJumpInstructions.push(e),this.currentMeasure.LastRepetitionInstructions.push(e);break;case RepetitionInstructionEnum.None:break;default:throw new ArgumentOutOfRangeException("currentRepetitionInstruction")}return!0}},{key:"findInstructionInMainListBackwards",value:function(e,t){for(var n=this.repetitionInstructions.length-1;n>=0;n--){var i=this.repetitionInstructions[n];if(i.measureIndex<=t&&i.type===e)return i.measureIndex}return-1}},{key:"finalizeRepetition",value:function(e){var t=e.RepetitonUnderConstruction;if(t.BackwardJumpInstructions.length>0){var n=!0,i=this.getLastFinalizedRepetition();if(void 0!==i&&t.coversIdenticalMeasures(i)){if(t.NumberOfEndings>i.NumberOfEndings){var r=this.musicSheet.Repetitions.indexOf(i,0);r>-1&&this.musicSheet.Repetitions.splice(r,1),i.removeFromRepetitionInstructions(),this.musicSheet.Repetitions.push(t)}n=!1,t.removeFromRepetitionInstructions()}else this.musicSheet.Repetitions.push(t);n&&(t.startMarker.type===RepetitionInstructionEnum.None&&this.musicSheet.SourceMeasures[t.StartIndex].FirstRepetitionInstructions.push(t.startMarker),t.UserNumberOfRepetitions=t.DefaultNumberOfRepetitions)}this.openRepetitions.splice(this.openRepetitions.length-1,1)}},{key:"getCurrentRepetition",value:function(e){for(var t=void 0,n=this.openRepetitions.length-1;n>=0;n--)if(this.openRepetitions[n].RepetitonUnderConstruction.FromWords===e){for(t=this.openRepetitions[n];n0)return this.openRepetitions.last();var e=this.createNewRepetition(0);return e.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(0,RepetitionInstructionEnum.None,AlignmentType.Begin,e.RepetitonUnderConstruction),e}},{key:"getOrCreateCurrentRepetition2",value:function(e){var t=void 0;if(this.openRepetitions.length&&this.openRepetitions.last().RepetitonUnderConstruction.EndingParts.length<2)for(var n=this.openRepetitions.length-1;n>=0;n--)if((t=this.openRepetitions[n]).RepetitonUnderConstruction.FromWords===e){for(;n0){var t=this.openRepetitions.last(),n=t.RepetitonUnderConstruction;if(n.BackwardJumpInstructions.length>0){var i=Object.keys(n.EndingIndexDict);(0===i.length||n.EndingIndexDict[i[i.length-1]].part.EndIndex>=0)&&this.finalizeRepetition(t)}}var r=new RepetitionBuildingContainer(this.musicSheet);return this.lastRepetitionCommonPartStartIndex=e,this.openRepetitions.push(r),r}},{key:"getLastFinalizedRepetition",value:function(){if(this.musicSheet.Repetitions.length>0)return this.musicSheet.Repetitions.last()}}]),e}(),RepetitionBuildingContainer=_createClass2((function e(t){_classCallCheck2(this,e),this.RepetitonUnderConstruction=new Repetition(t)})),MusicSymbolModuleFactory=function(){function e(){_classCallCheck2(this,e)}return _createClass2(e,null,[{key:"createRepetitionInstructionReader",value:function(){return new RepetitionInstructionReader}},{key:"createRepetitionCalculator",value:function(){return new RepetitionCalculator}}]),e}(),ReaderPluginManager=function(){function e(){_classCallCheck2(this,e),this.voiceMeasureReadPlugins=[]}return _createClass2(e,[{key:"addVoiceMeasureReadPlugin",value:function(e){this.voiceMeasureReadPlugins.push(e)}},{key:"processVoiceMeasureReadPlugins",value:function(e,t,n){var i,r=_createForOfIteratorHelper(this.voiceMeasureReadPlugins);try{for(r.s();!(i=r.n()).done;){var a=i.value;try{a.measureReadCalculations(e,t,n)}catch(s){log$2.info("VoiceGenerator.addSingleNote: ",s)}}}catch(err){r.e(err)}finally{r.f()}}}]),e}(),MusicSheetReader=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new EngravingRules;_classCallCheck2(this,t),this.completeNumberOfStaves=0,this.pluginManager=new ReaderPluginManager,this.afterSheetReadingModules=e||[],this.repetitionInstructionReader=MusicSymbolModuleFactory.createRepetitionInstructionReader(),this.repetitionCalculator=MusicSymbolModuleFactory.createRepetitionCalculator(),this.rules=n}return _createClass2(t,[{key:"PluginManager",get:function(){return this.pluginManager}},{key:"CompleteNumberOfStaves",get:function(){return this.completeNumberOfStaves}},{key:"createMusicSheet",value:function(t,n){try{return this._createMusicSheet(t,n)}catch(e){return void log$2.error("MusicSheetReader.CreateMusicSheet",e)}}},{key:"_removeFromArray",value:function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},{key:"trimString",value:function(e){return e.replace(/^\s+|\s+$/g,"")}},{key:"_lastElement",value:function(e){return e[e.length-1]}},{key:"_createMusicSheet",value:function(n,i){var r=[],a=0;if(this.musicSheet=new MusicSheet$1,this.musicSheet.Path=i,this.musicSheet.Rules=this.rules,!n)throw new MusicSheetReadingException("Undefined root element");this.pushSheetLabels(n,i);var s=n.element("part-list");if(!s)throw new MusicSheetReadingException("Undefined partListNode");var o=n.elements("part"),l=s.elements();this.initializeReading(l,o,r);var u=!0;this.currentFraction=new Fraction$1(0,1);var c=!1,h=n.element("identification");for(h&&(h=h.element("encoding")),h&&(h=h.element("software")),void 0!==h&&"Guitar Pro 5"===h.value&&(c=!0);u;){void 0!==this.currentMeasure&&this.currentMeasure.HasEndLine&&this.rules.NewPartAndSystemAfterFinalBarline&&(a=0),this.currentMeasure=new SourceMeasure(this.completeNumberOfStaves,this.musicSheet.Rules);var f,d,p=_createForOfIteratorHelper(r);try{for(p.s();!(f=p.n()).done;){var m=f.value;try{u=u&&m.readNextXmlMeasure(this.currentMeasure,this.currentFraction,c)}catch(e){var v=ITextTranslation.translateText("ReaderErrorMessages/InstrumentError","Error while reading instruments.");throw new MusicSheetReadingException(v,e)}}}catch(err){p.e(err)}finally{p.f()}if(u)this.musicSheet.addMeasure(this.currentMeasure),this.checkIfRhythmInstructionsAreSetAndEqual(r),this.checkSourceMeasureForNullEntries(),a=this.setSourceMeasureDuration(r,a),t.doCalculationsAfterDurationHasBeenSet(r),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===(d=r[0])||void 0===d?void 0:d.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(var g=0,y=this.afterSheetReadingModules.length;gr){if(this.areRhythmInstructionsMixed(t)&&l.SymbolEnum!==RhythmSymbolEnum.NONE)continue;r=l.Rhythm.RealValue,a=t.indexOf(l)}}if(t.length>0&&t.lengthe.Denominator){var n=t.Denominator/e.Denominator;e.expand(n)}}},{key:"checkIfMeasureIsImplicit",value:function(e,t){return!(this.previousMeasure||!e.lt(t))||!!this.previousMeasure&&Fraction$1.plus(this.previousMeasure.Duration,e).Equals(t)}},{key:"allInstrumentsHaveSameDuration",value:function(e,t){for(var n=0,i=0,r=e.length;i=0;e--)for(var t=this.currentMeasure.VerticalSourceStaffEntryContainers[e].StaffEntries.length-1;t>=0;t--){var n=this.currentMeasure.VerticalSourceStaffEntryContainers[e].StaffEntries[t];if(n)for(var i=n.VoiceEntries.length-1;i>=0;i--){var r=n.VoiceEntries[i];0===r.Notes.length&&(this._removeFromArray(r.ParentVoice.VoiceEntries,r),this._removeFromArray(n.VoiceEntries,r))}void 0!==n&&0===n.VoiceEntries.length&&(this.currentMeasure.VerticalSourceStaffEntryContainers[e].StaffEntries[t]=void 0)}for(var a=this.currentMeasure.VerticalSourceStaffEntryContainers.length-1;a>=0;a--){for(var s=0,o=0,l=this.currentMeasure.VerticalSourceStaffEntryContainers[a].StaffEntries.length;ot){if(!this.musicSheet.Title){var y=h.attribute("font-size").value,b=parseFloat(y);n0&&c.MidiInstrumentId!==MidiInstrument.Percussion&&(g.midiInstrumentID=Math.max(0,parseInt(k.value,10)-1));else if("midi-unpitched"===k.name)g.fixedKey=Math.max(0,parseInt(k.value,10));else if("volume"===k.name)try{var E=parseFloat(k.value);g.volume=E/127}catch(R){log$2.debug("ExpressionReader.readExpressionParameters","read volume",R)}else if("pan"===k.name)try{var T=parseFloat(k.value);g.pan=T/64}catch(R){log$2.debug("ExpressionReader.readExpressionParameters","read pan",R)}}catch(R){log$2.info("MusicSheetReader.createInstrumentGroups midi settings: ",R)}}}}catch(R){log$2.info("MusicSheetReader.createInstrumentGroups: ",R)}}if(0===c.SubInstruments.length){var P=new SubInstrument(c);c.SubInstruments.push(P)}r[u]=c,n?(n.InstrumentalGroups.push(c),this.musicSheet.Instruments.push(c)):(this.musicSheet.InstrumentalGroups.push(c),this.musicSheet.Instruments.push(c))}else if("part-group"===l.name&&"start"===l.attribute("type").value){var A=new InstrumentalGroup("group",this.musicSheet,n);n?n.InstrumentalGroups.push(A):this.musicSheet.InstrumentalGroups.push(A),n=A}else if("part-group"===l.name&&"stop"===l.attribute("type").value&&n){if(1===n.InstrumentalGroups.length){var C=n.InstrumentalGroups[0];n.Parent?(n.Parent.InstrumentalGroups.push(C),this._removeFromArray(n.Parent.InstrumentalGroups,n)):(this.musicSheet.InstrumentalGroups.push(C),this._removeFromArray(this.musicSheet.InstrumentalGroups,n))}n=n.Parent}}}catch(e){var M=ITextTranslation.translateText("ReaderErrorMessages/InstrumentError","Error while reading Instruments");throw new MusicSheetReadingException(M,e)}for(var I=0,N=this.musicSheet.Instruments.length;I0){var a=r[0];if(a){var s=a.element("attributes");s&&(s=s.element("staves")),s?n+=parseInt(s.value,10):n++}}}}catch(err){i.e(err)}finally{i.f()}if(isNaN(n)||n<=0){var o=ITextTranslation.translateText("ReaderErrorMessages/StaffError","Invalid number of staves.");throw new MusicSheetReadingException(o)}return n}},{key:"getInstrumentNumberOfStavesFromXml",value:function(e){var t=0,n=e.element("measure");if(n){var i=n.element("attributes"),r=void 0;i&&(r=i.element("staves")),t=i&&r?parseInt(r.value,10):1}if(isNaN(t)||t<=0){var a=ITextTranslation.translateText("ReaderErrorMessages/StaffError","Invalid number of Staves.");throw new MusicSheetReadingException(a)}return t}}],[{key:"doCalculationsAfterDurationHasBeenSet",value:function(e){var t,n=_createForOfIteratorHelper(e);try{for(n.s();!(t=n.n()).done;){t.value.doCalculationsAfterDurationHasBeenSet()}}catch(err){n.e(err)}finally{n.f()}}}]),t}(),jszip_min={exports:{}}; /*! JSZip v3.7.1 - A JavaScript class for generating and reading zip files (c) 2009-2016 Stuart Knightley Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown. JSZip uses the library pako released under the MIT license : https://github.com/nodeca/pako/blob/master/LICENSE */ !function(e,t){e.exports=function e(t,n,i){function r(s,o){if(!n[s]){if(!t[s]){var l="function"==typeof commonjsRequire$1&&commonjsRequire$1;if(!o&&l)return l(s,!0);if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[s]={exports:{}};t[s][0].call(c.exports,(function(e){return r(t[s][1][e]||e)}),c,c.exports,e,t,n,i)}return n[s].exports}for(var a="function"==typeof commonjsRequire$1&&commonjsRequire$1,s=0;s>2,o=(3&t)<<4|n>>4,l=1>6:64,u=2>4,n=(15&s)<<4|(o=a.indexOf(e.charAt(u++)))>>2,i=(3&o)<<6|(l=a.indexOf(e.charAt(u++))),f[c++]=t,64!==o&&(f[c++]=n),64!==l&&(f[c++]=i);return f}},{"./support":30,"./utils":32}],2:[function(e,t,n){var i=e("./external"),r=e("./stream/DataWorker"),a=e("./stream/Crc32Probe"),s=e("./stream/DataLengthProbe");function o(e,t,n,i,r){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=i,this.compressedContent=r}o.prototype={getContentWorker:function(){var e=new r(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new s("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new r(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(e,t,n){return e.pipe(new a).pipe(new s("uncompressedSize")).pipe(t.compressWorker(n)).pipe(new s("compressedSize")).withStreamInfo("compression",t)},t.exports=o},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){var i=e("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(e){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},n.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){var i=e("./utils"),r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==i.getTypeOf(e)?function(e,t,n,i){var a=r,s=i+n;e^=-1;for(var o=i;o>>8^a[255&(e^t[o])];return-1^e}(0|t,e,e.length,0):function(e,t,n,i){var a=r,s=i+n;e^=-1;for(var o=i;o>>8^a[255&(e^t.charCodeAt(o))];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){var i=null;i="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:i}},{lie:37}],7:[function(e,t,n){var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,r=e("pako"),a=e("./utils"),s=e("./stream/GenericWorker"),o=i?"uint8array":"array";function l(e,t){s.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic="\b\0",a.inherits(l,s),l.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(a.transformTo(o,e.data),!1)},l.prototype.flush=function(){s.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new r[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new l("Deflate",e)},n.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){function i(e,t){var n,i="";for(n=0;n>>=8;return i}function r(e,t,n,r,s,c){var h,f,d=e.file,p=e.compression,m=c!==o.utf8encode,v=a.transformTo("string",c(d.name)),g=a.transformTo("string",o.utf8encode(d.name)),y=d.comment,b=a.transformTo("string",c(y)),_=a.transformTo("string",o.utf8encode(y)),S=g.length!==d.name.length,x=_.length!==y.length,w="",k="",E="",T=d.dir,P=d.date,A={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(A.crc32=e.crc32,A.compressedSize=e.compressedSize,A.uncompressedSize=e.uncompressedSize);var C=0;t&&(C|=8),m||!S&&!x||(C|=2048);var M=0,I=0;T&&(M|=16),"UNIX"===s?(I=798,M|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(d.unixPermissions,T)):(I=20,M|=function(e){return 63&(e||0)}(d.dosPermissions)),h=P.getUTCHours(),h<<=6,h|=P.getUTCMinutes(),h<<=5,h|=P.getUTCSeconds()/2,f=P.getUTCFullYear()-1980,f<<=4,f|=P.getUTCMonth()+1,f<<=5,f|=P.getUTCDate(),S&&(k=i(1,1)+i(l(v),4)+g,w+="up"+i(k.length,2)+k),x&&(E=i(1,1)+i(l(b),4)+_,w+="uc"+i(E.length,2)+E);var N="";return N+="\n\0",N+=i(C,2),N+=p.magic,N+=i(h,2),N+=i(f,2),N+=i(A.crc32,4),N+=i(A.compressedSize,4),N+=i(A.uncompressedSize,4),N+=i(v.length,2),N+=i(w.length,2),{fileRecord:u.LOCAL_FILE_HEADER+N+v+w,dirRecord:u.CENTRAL_FILE_HEADER+i(I,2)+N+i(b.length,2)+"\0\0\0\0"+i(M,4)+i(r,4)+v+w+b}}var a=e("../utils"),s=e("../stream/GenericWorker"),o=e("../utf8"),l=e("../crc32"),u=e("../signature");function c(e,t,n,i){s.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=i,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(c,s),c.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,s.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-i-1))/n:100}}))},c.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=r(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},c.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=r(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:function(e){return u.DATA_DESCRIPTOR+i(e.crc32,4)+i(e.compressedSize,4)+i(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},c.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return i.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=r},{"../utils":32}],19:[function(e,t,n){var i=e("./Uint8ArrayReader");function r(e){i.call(this,e)}e("../utils").inherits(r,i),r.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=r},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){var i=e("./DataReader");function r(e){i.call(this,e)}e("../utils").inherits(r,i),r.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},r.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},r.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},r.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=r},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){var i=e("./ArrayReader");function r(e){i.call(this,e)}e("../utils").inherits(r,i),r.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=r},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){var i=e("../utils"),r=e("../support"),a=e("./ArrayReader"),s=e("./StringReader"),o=e("./NodeBufferReader"),l=e("./Uint8ArrayReader");t.exports=function(e){var t=i.getTypeOf(e);return i.checkSupport(t),"string"!==t||r.uint8array?"nodebuffer"===t?new o(e):r.uint8array?new l(i.transformTo("uint8array",e)):new a(i.transformTo("array",e)):new s(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t,n){var i=e("./GenericWorker"),r=e("../utils");function a(e){i.call(this,"ConvertWorker to "+e),this.destType=e}r.inherits(a,i),a.prototype.processChunk=function(e){this.push({data:r.transformTo(this.destType,e.data),meta:e.meta})},t.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){var i=e("./GenericWorker"),r=e("../crc32");function a(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(a,i),a.prototype.processChunk=function(e){this.streamInfo.crc32=r(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){var i=e("../utils"),r=e("./GenericWorker");function a(e){r.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}i.inherits(a,r),a.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}r.prototype.processChunk.call(this,e)},t.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){var i=e("../utils"),r=e("./GenericWorker");function a(e){r.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=i.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}i.inherits(a,r),a.prototype.cleanUp=function(){r.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){function i(e){this.name=e||"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}i.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n "+e:e}},t.exports=i},{}],29:[function(e,t,n){var i=e("../utils"),r=e("./ConvertWorker"),a=e("./GenericWorker"),s=e("../base64"),o=e("../support"),l=e("../external"),u=null;if(o.nodestream)try{u=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function c(e,t){return new l.Promise((function(n,r){var a=[],o=e._internalType,l=e._outputType,u=e._mimeType;e.on("data",(function(e,n){a.push(e),t&&t(n)})).on("error",(function(e){a=[],r(e)})).on("end",(function(){try{var e=function(e,t,n){switch(e){case"blob":return i.newBlob(i.transformTo("arraybuffer",t),n);case"base64":return s.encode(t);default:return i.transformTo(e,t)}}(l,function(e,t){var n,i=0,r=null,a=0;for(n=0;n>>6:(n<65536?t[s++]=224|n>>>12:(t[s++]=240|n>>>18,t[s++]=128|n>>>12&63),t[s++]=128|n>>>6&63),t[s++]=128|63&n);return t}(e)},n.utf8decode=function(e){return r.nodebuffer?i.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,n,r,a,s=e.length,l=new Array(2*s);for(t=n=0;t>10&1023,l[n++]=56320|1023&r)}return l.length!==n&&(l.subarray?l=l.subarray(0,n):l.length=n),i.applyFromCharCode(l)}(e=i.transformTo(r.uint8array?"uint8array":"array",e))},i.inherits(u,s),u.prototype.processChunk=function(e){var t=i.transformTo(r.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(r.uint8array){var a=t;(t=new Uint8Array(a.length+this.leftOver.length)).set(this.leftOver,0),t.set(a,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var s=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0||0===n?t:n+o[e[n]]>t?n:t}(t),l=t;s!==t.length&&(r.uint8array?(l=t.subarray(0,s),this.leftOver=t.subarray(s,t.length)):(l=t.slice(0,s),this.leftOver=t.slice(s,t.length))),this.push({data:n.utf8decode(l),meta:e.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=u,i.inherits(c,s),c.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=c},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){var i=e("./support"),r=e("./base64"),a=e("./nodejsUtils"),s=e("set-immediate-shim"),o=e("./external");function l(e){return e}function u(e,t){for(var n=0;n>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=i(this.extraFields[1].value);this.uncompressedSize===r.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===r.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===r.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===r.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,n,i,r=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4>>6:(n<65536?t[s++]=224|n>>>12:(t[s++]=240|n>>>18,t[s++]=128|n>>>12&63),t[s++]=128|n>>>6&63),t[s++]=128|63&n);return t},n.buf2binstring=function(e){return l(e,e.length)},n.binstring2buf=function(e){for(var t=new i.Buf8(e.length),n=0,r=t.length;n>10&1023,u[i++]=56320|1023&r)}return l(u,i)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0||0===n?t:n+s[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){t.exports=function(e,t,n,i){for(var r=65535&e|0,a=e>>>16&65535|0,s=0;0!==n;){for(n-=s=2e3>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,r){var a=i,s=r+n;e^=-1;for(var o=r;o>>8^a[255&(e^t[o])];return-1^e}},{}],46:[function(e,t,n){var i,r=e("../utils/common"),a=e("./trees"),s=e("./adler32"),o=e("./crc32"),l=e("./messages"),u=0,c=4,h=0,f=-2,d=-1,p=4,m=2,v=8,g=9,y=286,b=30,_=19,S=2*y+1,x=15,w=3,k=258,E=k+w+1,T=42,P=113,A=1,C=2,M=3,I=4;function N(e,t){return e.msg=l[t],t}function L(e){return(e<<1)-(4e.avail_out&&(n=e.avail_out),0!==n&&(r.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function O(e,t){a._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,F(e.strm)}function B(e,t){e.pending_buf[e.pending++]=t}function D(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function V(e,t){var n,i,r=e.max_chain_length,a=e.strstart,s=e.prev_length,o=e.nice_match,l=e.strstart>e.w_size-E?e.strstart-(e.w_size-E):0,u=e.window,c=e.w_mask,h=e.prev,f=e.strstart+k,d=u[a+s-1],p=u[a+s];e.prev_length>=e.good_match&&(r>>=2),o>e.lookahead&&(o=e.lookahead);do{if(u[(n=t)+s]===p&&u[n+s-1]===d&&u[n]===u[a]&&u[++n]===u[a+1]){a+=2,n++;do{}while(u[++a]===u[++n]&&u[++a]===u[++n]&&u[++a]===u[++n]&&u[++a]===u[++n]&&u[++a]===u[++n]&&u[++a]===u[++n]&&u[++a]===u[++n]&&u[++a]===u[++n]&&al&&0!=--r);return s<=e.lookahead?s:e.lookahead}function $(e){var t,n,i,a,l,u,c,h,f,d,p=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-E)){for(r.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=n=e.hash_size;i=e.head[--t],e.head[t]=p<=i?i-p:0,--n;);for(t=n=p;i=e.prev[--t],e.prev[t]=p<=i?i-p:0,--n;);a+=p}if(0===e.strm.avail_in)break;if(u=e.strm,c=e.window,h=e.strstart+e.lookahead,d=void 0,(f=a)<(d=u.avail_in)&&(d=f),n=0===d?0:(u.avail_in-=d,r.arraySet(c,u.input,u.next_in,d,h),1===u.state.wrap?u.adler=s(u.adler,c,d,h):2===u.state.wrap&&(u.adler=o(u.adler,c,d,h)),u.next_in+=d,u.total_in+=d,d),e.lookahead+=n,e.lookahead+e.insert>=w)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<=w&&(e.ins_h=(e.ins_h<=w)if(i=a._tr_tally(e,e.strstart-e.match_start,e.match_length-w),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=w){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=w&&(e.ins_h=(e.ins_h<=w&&e.match_length<=e.prev_length){for(r=e.strstart+e.lookahead-w,i=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-w),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=r&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if($(e),0===e.lookahead&&t===u)return A;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+n;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,O(e,!1),0===e.strm.avail_out))return A;if(e.strstart-e.block_start>=e.w_size-E&&(O(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===c?(O(e,!0),0===e.strm.avail_out?M:I):(e.strstart>e.block_start&&(O(e,!1),e.strm.avail_out),A)})),new H(4,4,8,4,G),new H(4,5,16,8,G),new H(4,6,32,32,G),new H(4,4,16,16,z),new H(8,16,32,32,z),new H(8,16,128,128,z),new H(8,32,128,256,z),new H(32,128,258,1024,z),new H(32,258,258,4096,z)],n.deflateInit=function(e,t){return q(e,t,v,15,8,0)},n.deflateInit2=q,n.deflateReset=W,n.deflateResetKeep=j,n.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?f:(e.state.gzhead=t,h):f},n.deflate=function(e,t){var n,r,s,l;if(!e||!e.state||5>8&255),B(r,r.gzhead.time>>16&255),B(r,r.gzhead.time>>24&255),B(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),B(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(B(r,255&r.gzhead.extra.length),B(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=o(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(B(r,0),B(r,0),B(r,0),B(r,0),B(r,0),B(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),B(r,3),r.status=P);else{var d=v+(r.w_bits-8<<4)<<8;d|=(2<=r.strategy||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(d|=32),d+=31-d%31,r.status=P,D(r,d),0!==r.strstart&&(D(r,e.adler>>>16),D(r,65535&e.adler)),e.adler=1}if(69===r.status)if(r.gzhead.extra){for(s=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>s&&(e.adler=o(e.adler,r.pending_buf,r.pending-s,s)),F(e),s=r.pending,r.pending!==r.pending_buf_size));)B(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>s&&(e.adler=o(e.adler,r.pending_buf,r.pending-s,s)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(e.adler=o(e.adler,r.pending_buf,r.pending-s,s)),F(e),s=r.pending,r.pending===r.pending_buf_size)){l=1;break}l=r.gzindexs&&(e.adler=o(e.adler,r.pending_buf,r.pending-s,s)),0===l&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(e.adler=o(e.adler,r.pending_buf,r.pending-s,s)),F(e),s=r.pending,r.pending===r.pending_buf_size)){l=1;break}l=r.gzindexs&&(e.adler=o(e.adler,r.pending_buf,r.pending-s,s)),0===l&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&F(e),r.pending+2<=r.pending_buf_size&&(B(r,255&e.adler),B(r,e.adler>>8&255),e.adler=0,r.status=P)):r.status=P),0!==r.pending){if(F(e),0===e.avail_out)return r.last_flush=-1,h}else if(0===e.avail_in&&L(t)<=L(n)&&t!==c)return N(e,-5);if(666===r.status&&0!==e.avail_in)return N(e,-5);if(0!==e.avail_in||0!==r.lookahead||t!==u&&666!==r.status){var p=2===r.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&($(e),0===e.lookahead)){if(t===u)return A;break}if(e.match_length=0,n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(O(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===c?(O(e,!0),0===e.strm.avail_out?M:I):e.last_lit&&(O(e,!1),0===e.strm.avail_out)?A:C}(r,t):3===r.strategy?function(e,t){for(var n,i,r,s,o=e.window;;){if(e.lookahead<=k){if($(e),e.lookahead<=k&&t===u)return A;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=w&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=w?(n=a._tr_tally(e,1,e.match_length-w),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(O(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===c?(O(e,!0),0===e.strm.avail_out?M:I):e.last_lit&&(O(e,!1),0===e.strm.avail_out)?A:C}(r,t):i[r.level].func(r,t);if(p!==M&&p!==I||(r.status=666),p===A||p===M)return 0===e.avail_out&&(r.last_flush=-1),h;if(p===C&&(1===t?a._tr_align(r):5!==t&&(a._tr_stored_block(r,0,0,!1),3===t&&(R(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),F(e),0===e.avail_out))return r.last_flush=-1,h}return t!==c?h:r.wrap<=0?1:(2===r.wrap?(B(r,255&e.adler),B(r,e.adler>>8&255),B(r,e.adler>>16&255),B(r,e.adler>>24&255),B(r,255&e.total_in),B(r,e.total_in>>8&255),B(r,e.total_in>>16&255),B(r,e.total_in>>24&255)):(D(r,e.adler>>>16),D(r,65535&e.adler)),F(e),0=n.w_size&&(0===o&&(R(n.head),n.strstart=0,n.block_start=0,n.insert=0),d=new r.Buf8(n.w_size),r.arraySet(d,t,p-n.w_size,n.w_size,0),t=d,p=n.w_size),l=e.avail_in,u=e.next_in,c=e.input,e.avail_in=p,e.next_in=0,e.input=t,$(n);n.lookahead>=w;){for(i=n.strstart,a=n.lookahead-(w-1);n.ins_h=(n.ins_h<>>=_=b>>>24,p-=_,0==(_=b>>>16&255))T[a++]=65535&b;else{if(!(16&_)){if(0==(64&_)){b=m[(65535&b)+(d&(1<<_)-1)];continue t}if(32&_){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}S=65535&b,(_&=15)&&(p<_&&(d+=E[i++]<>>=_,p-=_),p<15&&(d+=E[i++]<>>=_=b>>>24,p-=_,!(16&(_=b>>>16&255))){if(0==(64&_)){b=v[(65535&b)+(d&(1<<_)-1)];continue n}e.msg="invalid distance code",n.mode=30;break e}if(x=65535&b,p<(_&=15)&&(d+=E[i++]<>>=_,p-=_,(_=a-s)>3,d&=(1<<(p-=S<<3))-1,e.next_in=i,e.next_out=a,e.avail_in=i>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function v(){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 i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function g(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=f,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new i.Buf32(d),t.distcode=t.distdyn=new i.Buf32(p),t.sane=1,t.back=-1,c):h}function y(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,g(e)):h}function b(e,t){var n,i;return e&&e.state?(i=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=s.wsize?(i.arraySet(s.window,t,n-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(r<(a=s.wsize-s.wnext)&&(a=r),i.arraySet(s.window,t,n-r,a,s.wnext),(r-=a)?(i.arraySet(s.window,t,n-r,r,0),s.wnext=r,s.whave=s.wsize):(s.wnext+=a,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,n.check=a(n.check,$,2,0),S=_=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&_)<<8)+(_>>8))%31){e.msg="incorrect header check",n.mode=30;break}if(8!=(15&_)){e.msg="unknown compression method",n.mode=30;break}if(S-=4,F=8+(15&(_>>>=4)),0===n.wbits)n.wbits=F;else if(F>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<>8&1),512&n.flags&&($[0]=255&_,$[1]=_>>>8&255,n.check=a(n.check,$,2,0)),S=_=0,n.mode=3;case 3:for(;S<32;){if(0===y)break e;y--,_+=d[v++]<>>8&255,$[2]=_>>>16&255,$[3]=_>>>24&255,n.check=a(n.check,$,4,0)),S=_=0,n.mode=4;case 4:for(;S<16;){if(0===y)break e;y--,_+=d[v++]<>8),512&n.flags&&($[0]=255&_,$[1]=_>>>8&255,n.check=a(n.check,$,2,0)),S=_=0,n.mode=5;case 5:if(1024&n.flags){for(;S<16;){if(0===y)break e;y--,_+=d[v++]<>>8&255,n.check=a(n.check,$,2,0)),S=_=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(y<(T=n.length)&&(T=y),T&&(n.head&&(F=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),i.arraySet(n.head.extra,d,v,T,F)),512&n.flags&&(n.check=a(n.check,d,T,v)),y-=T,v+=T,n.length-=T),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===y)break e;for(T=0;F=d[v+T++],n.head&&F&&n.length<65536&&(n.head.name+=String.fromCharCode(F)),F&&T>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;S<32;){if(0===y)break e;y--,_+=d[v++]<>>=7&S,S-=7&S,n.mode=27;break}for(;S<3;){if(0===y)break e;y--,_+=d[v++]<>>=1)){case 0:n.mode=14;break;case 1:if(k(n),n.mode=20,6!==t)break;_>>>=2,S-=2;break e;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}_>>>=2,S-=2;break;case 14:for(_>>>=7&S,S-=7&S;S<32;){if(0===y)break e;y--,_+=d[v++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&_,S=_=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(T=n.length){if(y>>=5,S-=5,n.ndist=1+(31&_),_>>>=5,S-=5,n.ncode=4+(15&_),_>>>=4,S-=4,286>>=3,S-=3}for(;n.have<19;)n.lens[G[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,B={bits:n.lenbits},O=o(0,n.lens,0,19,n.lencode,0,n.work,B),n.lenbits=B.bits,O){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,I=65535&V,!((C=V>>>24)<=S);){if(0===y)break e;y--,_+=d[v++]<>>=C,S-=C,n.lens[n.have++]=I;else{if(16===I){for(D=C+2;S>>=C,S-=C,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}F=n.lens[n.have-1],T=3+(3&_),_>>>=2,S-=2}else if(17===I){for(D=C+3;S>>=C)),_>>>=3,S-=3}else{for(D=C+7;S>>=C)),_>>>=7,S-=7}if(n.have+T>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;T--;)n.lens[n.have++]=F}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,B={bits:n.lenbits},O=o(l,n.lens,0,n.nlen,n.lencode,0,n.work,B),n.lenbits=B.bits,O){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,B={bits:n.distbits},O=o(u,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,B),n.distbits=B.bits,O){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(6<=y&&258<=b){e.next_out=g,e.avail_out=b,e.next_in=v,e.avail_in=y,n.hold=_,n.bits=S,s(e,w),g=e.next_out,p=e.output,b=e.avail_out,v=e.next_in,d=e.input,y=e.avail_in,_=n.hold,S=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;M=(V=n.lencode[_&(1<>>16&255,I=65535&V,!((C=V>>>24)<=S);){if(0===y)break e;y--,_+=d[v++]<>N)])>>>16&255,I=65535&V,!(N+(C=V>>>24)<=S);){if(0===y)break e;y--,_+=d[v++]<>>=N,S-=N,n.back+=N}if(_>>>=C,S-=C,n.back+=C,n.length=I,0===M){n.mode=26;break}if(32&M){n.back=-1,n.mode=12;break}if(64&M){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&M,n.mode=22;case 22:if(n.extra){for(D=n.extra;S>>=n.extra,S-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;M=(V=n.distcode[_&(1<>>16&255,I=65535&V,!((C=V>>>24)<=S);){if(0===y)break e;y--,_+=d[v++]<>N)])>>>16&255,I=65535&V,!(N+(C=V>>>24)<=S);){if(0===y)break e;y--,_+=d[v++]<>>=N,S-=N,n.back+=N}if(_>>>=C,S-=C,n.back+=C,64&M){e.msg="invalid distance code",n.mode=30;break}n.offset=I,n.extra=15&M,n.mode=24;case 24:if(n.extra){for(D=n.extra;S>>=n.extra,S-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===b)break e;if(T=w-b,n.offset>T){if((T=n.offset-T)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}P=T>n.wnext?(T-=n.wnext,n.wsize-T):n.wnext-T,T>n.length&&(T=n.length),A=n.window}else A=p,P=g-n.offset,T=n.length;for(by?(_=B[D+h[k]],L[R+h[k]]):(_=96,0),d=1<>C)+(p-=d)]=b<<24|_<<16|S|0,0!==p;);for(d=1<>=1;if(0!==d?(N&=d-1,N+=d):N=0,k++,0==--F[w]){if(w===T)break;w=t[n+h[k]]}if(P>>7)]}function B(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function D(e,t,n){e.bi_valid>m-n?(e.bi_buf|=t<>m-e.bi_valid,e.bi_valid+=n-m):(e.bi_buf|=t<>>=1,n<<=1,0<--t;);return n>>>1}function G(e,t,n){var i,r,a=new Array(p+1),s=0;for(i=1;i<=p;i++)a[i]=s=s+n[i-1]<<1;for(r=0;r<=t;r++){var o=e[2*r+1];0!==o&&(e[2*r]=$(a[o]++,o))}}function z(e){var t;for(t=0;t>1;1<=n;n--)j(e,a,n);for(r=l;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],j(e,a,1),i=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=i,a[2*r]=a[2*n]+a[2*i],e.depth[r]=(e.depth[n]>=e.depth[i]?e.depth[n]:e.depth[i])+1,a[2*n+1]=a[2*i+1]=r,e.heap[1]=r++,j(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,i,r,a,s,o,l=t.dyn_tree,u=t.max_code,c=t.stat_desc.static_tree,h=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,m=t.stat_desc.extra_base,v=t.stat_desc.max_length,g=0;for(a=0;a<=p;a++)e.bl_count[a]=0;for(l[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n>=7;i>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return r;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return a;for(t=32;t>>3,(o=e.static_len+3+7>>>3)<=s&&(s=o)):s=o=n+5,n+4<=s&&-1!==t?Z(e,t,n,i):4===e.strategy||o===s?(D(e,2+(i?1:0),3),W(e,E,T)):(D(e,4+(i?1:0),3),function(e,t,n,i){var r;for(D(e,t-257,5),D(e,n-1,5),D(e,i-4,4),r=0;r>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(A[n]+u+1)]++,e.dyn_dtree[2*O(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){D(e,2,3),V(e,g,E),function(e){16===e.bi_valid?(B(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,n){t.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(e,t,n){t.exports="function"==typeof setImmediate?setImmediate:function(){var e=[].slice.apply(arguments);e.splice(1,0,0),setTimeout.apply(null,e)}},{}]},{},[10])(10)}(jszip_min);var JSZip=jszip_min.exports,MXLHelper=function(){function e(){_classCallCheck2(this,e)}return _createClass2(e,null,[{key:"MXLtoIXmlElement",value:function(e){var t=new JSZip;return t.loadAsync(e).then((function(e){return t.file("META-INF/container.xml").async("text")}),(function(e){throw e})).then((function(e){var n=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("rootfile")[0].getAttribute("full-path");return t.file(n).async("text")}),(function(e){throw e})).then((function(e){var t=(new DOMParser).parseFromString(e,"text/xml"),n=new IXmlElement(t.documentElement);return Promise.resolve(n)}),(function(e){throw e})).then((function(e){return e}),(function(e){throw new Error("extractSheetFromMxl: "+e.message)}))}},{key:"MXLtoXMLstring",value:function(e){var t=new JSZip;return t.loadAsync(e).then((function(e){return t.file("META-INF/container.xml").async("text")}),(function(e){throw log$2.error(e),e})).then((function(e){var n=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("rootfile")[0].getAttribute("full-path");return t.file(n).async("text")}),(function(e){throw e}))}}]),e}(),PlaybackNoteGenerator=function(){function e(){_classCallCheck2(this,e)}return _createClass2(e,[{key:"calculate",value:function(e){for(var t=new MusicPartManagerIterator(e);!t.EndReached;){var n,i=t.CurrentEnrolledTimestamp,r=_createForOfIteratorHelper(t.CurrentAudibleVoiceEntries());try{for(r.s();!(n=r.n()).done;){var a=n.value;this.handleVoiceEntry(e,a,i)}}catch(err){r.e(err)}finally{r.f()}t.moveToNext()}}},{key:"handleVoiceEntry",value:function(t,n,i){if(!n.IsGrace){var r,a=n.ParentVoice;t.PlaybackDataDict.containsKey(a)?r=t.PlaybackDataDict.getValue(a):(r=[],t.PlaybackDataDict.setValue(a,r));var s,o=_createForOfIteratorHelper(n.PlaybackEntries);try{for(o.s();!(s=o.n()).done;){var l=s.value;if(l.HasNotes){var u,c=_createForOfIteratorHelper(l.Notes);try{for(c.s();!(u=c.n()).done;){u.value.setLength()}}catch(err){c.e(err)}finally{c.f()}var h=Fraction$1.plus(i,l.TimestampShift);e.addEntrySorted(r,l,h)}}}catch(err){o.e(err)}finally{o.f()}}}}],[{key:"addEntrySorted",value:function(e,t,n){if(0===e.length)e.push({enrolledTimestamp:n,playbackEntry:t});else for(var i=e.length-1;i>=0;i--){var r=e[i];if(n.RealValue>r.enrolledTimestamp.RealValue){if(i===e.length-1){e.push({enrolledTimestamp:n,playbackEntry:t});break}e.splice(i+1,0,{enrolledTimestamp:n,playbackEntry:t});break}}}}]),e}(),ScreenViewingRegion=function(){function e(t,n,i,r){_classCallCheck2(this,e),this.psi=new BoundingBox$2(void 0),this.displaySizeInPixel=t,this.RelativeDisplaySize=n,this.RelativeDisplayPosition=i,this.WidthInUnits=r}return _createClass2(e,[{key:"UpperLeftPositionInUnits",get:function(){return this.psi.AbsolutePosition},set:function(e){this.psi.AbsolutePosition=e}},{key:"DisplaySizeInPixel",get:function(){return this.displaySizeInPixel},set:function(e){this.displaySizeInPixel=e,this.regionSizeInPixel=new SizeF2D(this.displaySizeInPixel.width*this.relativeRegionSize.width,this.displaySizeInPixel.height*this.relativeRegionSize.height),this.recalculateDependentVariables()}},{key:"RelativeDisplaySize",get:function(){return this.relativeRegionSize},set:function(e){this.relativeRegionSize=e,this.regionSizeInPixel=new SizeF2D(this.displaySizeInPixel.width*this.relativeRegionSize.width,this.displaySizeInPixel.height*this.relativeRegionSize.height),this.recalculateDependentVariables()}},{key:"RegionSizeInPixel",get:function(){return this.regionSizeInPixel}},{key:"WidthInUnits",get:function(){return this.psi.BorderRight},set:function(e){this.psi.BorderRight=e,this.recalculateDependentVariables()}},{key:"ViewRegionInUnits",get:function(){return new SizeF2D(this.psi.BorderRight,this.psi.BorderBottom)}},{key:"isVisible",value:function(e,t){var n=this.psi.collisionDetection(e);return this.psi.liesInsideBorders(e),n}},{key:"isInsideDisplayArea",value:function(e,t){return this.RelativeDisplayPosition.x<=e&&e<=this.RelativeDisplayPosition.x+this.RelativeDisplaySize.width&&this.RelativeDisplayPosition.y<=t&&t<=this.RelativeDisplayPosition.y+this.RelativeDisplaySize.height}},{key:"transformToUnitCoordinates",value:function(e){return new PointF2D(this.UpperLeftPositionInUnits.x+this.ViewRegionInUnits.width*((e.x-this.RelativeDisplayPosition.x)/this.RelativeDisplaySize.width),this.UpperLeftPositionInUnits.y+this.ViewRegionInUnits.height*((e.y-this.RelativeDisplayPosition.y)/this.RelativeDisplaySize.height))}},{key:"transformLengthXToUnitCoordinates",value:function(e){return e/this.horizontalUnitToPixelRatio}},{key:"transformLengthYToUnitCoordinates",value:function(e){return e/this.verticalUnitToPixelRatio}},{key:"recalculateDependentVariables",value:function(){var e=this.regionSizeInPixel.width/this.regionSizeInPixel.height;this.psi.BorderBottom=this.psi.BorderRight/e,this.horizontalUnitToPixelRatio=this.regionSizeInPixel.width/this.ViewRegionInUnits.width,this.verticalUnitToPixelRatio=this.regionSizeInPixel.height/this.ViewRegionInUnits.height}}],[{key:"createWithRelativeDefaults",value:function(t,n){return new e(t,new SizeF2D(1,1),new PointF2D(0,0),n)}},{key:"createWithDefaults",value:function(){return new e(new SizeF2D(1,1),new SizeF2D(1,1),new PointF2D(0,0),1)}}]),e}(),AbstractZoomView=function(){function e(t){_classCallCheck2(this,e),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}return _createClass2(e,[{key:"positionTouched",value:function(e,t){if(this.convertToUnitsReady()){var n=this.getPositionInUnits(e,t);this.unitPosTouched(n,e,t)}}},{key:"TouchActive",get:function(){return this.displayInteractionManager.TouchActive}},{key:"TouchMoving",get:function(){return this.displayInteractionManager.TouchMoving}},{key:"positionDoubleTouched",value:function(e,t){if(this.convertToUnitsReady()){var n=this.getPositionInUnits(e,t);this.unitPosDoubleTouched(n,e,t)}}},{key:"UsesManuallyControlledZoomMode",get:function(){return this.usesManuallyControlledZoomMode},set:function(e){this.usesManuallyControlledZoomMode=e}},{key:"mouseDown",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.convertToUnitsReady()){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;var i=this.getPositionInUnits(e,t);this.unitPosTouchDown(i,e,t),this.usesManuallyControlledZoomMode||(this.mouseZoomMode=!!n)}}},{key:"mouseUp",value:function(e,t){var n=this.getPositionInUnits(e,t);this.unitPosTouchUp(n,e,t)}},{key:"mouseMove",value:function(e,t,n,i){this.mouseZoomMode?(Math.abs(n-0)>1e-8&&(this.RangeX=Math.abs(this.lastRangeX/(1+n))),!this.lockRanges&&Math.abs(i-0)>1e-8&&(this.RangeY=Math.abs(this.lastRangeY/(1-i)))):(Math.abs(n-0)>1e-8&&(this.OffsetX=this.lastOffsetX-n*this.RangeX),Math.abs(i-0)>1e-8&&(this.OffsetY=this.lastOffsetY-i*this.RangeY));var r=this.getPositionInUnits(e,t);this.unitPosMove(r,e,t)}},{key:"zoom",value:function(e){this.RangeX=Math.abs(this.lastRangeX/e)}},{key:"addZoomView",value:function(e){this.zoomViews.push(e)}},{key:"OffsetX",get:function(){return this.offsetX},set:function(e){this.offsetX=Math.min(this.offsetXMax,Math.max(this.offsetXMin,e));var t,n=_createForOfIteratorHelper(this.zoomViews);try{for(n.s();!(t=n.n()).done;){t.value.viewportXChanged(this.offsetX,this.RangeX)}}catch(err){n.e(err)}finally{n.f()}}},{key:"OffsetY",get:function(){return this.offsetY},set:function(e){this.offsetY=e,this.offsetY>this.offsetYMax?this.offsetY=this.offsetYMax:this.offsetYthis.offsetYMax&&this.setYOffset(this.offsetYMax,!0)}}},{key:"horizontalViewportChanged",value:function(e,t){this.mainViewingRegion.WidthInUnits!==t&&(this.mainViewingRegion.WidthInUnits=t)}},{key:"verticalViewportChanged",value:function(e,t){this.mainViewingRegion.UpperLeftPositionInUnits=new PointF2D(this.mainViewingRegion.UpperLeftPositionInUnits.x,e)}},{key:"unlockFromCursorIfNecessary",value:function(e){!1===this.LockDisplayToCursor||this.ZoomActive||(this.displayInteractionManager.ZoomGestureActive||this.displayInteractionManager.WasZoomGestureActive||Math.abs((e.y-this.yOffsetMouseDown)*this.mainViewingRegion.RegionSizeInPixel.height/this.mainViewingRegion.ViewRegionInUnits.height)>this.unlockCursorDistancePixel&&(this.LockDisplayToCursor=!1))}},{key:"getPositionInUnits",value:function(e,t){return this.mainViewingRegion.transformToUnitCoordinates(new PointF2D(e,t))}},{key:"handleUserDisplayInteraction",value:function(e,t,n){var i=this;switch(n){case InteractionType.TouchDown:case InteractionType.SingleTouch:case InteractionType.DoubleTouch:var r=this.graphicalMusicSheet.GetNearestVoiceEntry(t);if(r){var a=new CustomEvent("note-click",{detail:_objectSpread2(_objectSpread2({},r),{},{setAvtivePlay:function(){if(void 0!==r.parentStaffEntry.parentVerticalContainer){var e,t,n=r.parentStaffEntry.parentVerticalContainer.AbsoluteTimestamp;if(i.setStartPosition(n),void 0!==(null===(e=r.notes[0])||void 0===e?void 0:e.sourceNote.Pitch))console.log("playback clicked note",r.parentVoiceEntry),null===(t=i.PlaybackManager)||void 0===t||t.playVoiceEntry(r.parentVoiceEntry)}}})});window.dispatchEvent(a)}case InteractionType.TouchUp:case InteractionType.TouchDown:case InteractionType.Move:var s,o=_createForOfIteratorHelper(this.listeners);try{for(o.s();!(s=o.n()).done;){s.value.userDisplayInteraction(e,t,n)}}catch(err){o.e(err)}finally{o.f()}break;default:throw new Error("type")}}},{key:"setStartPosition",value:function(e){var t;void 0!==this.graphicalMusicSheet&&(this.graphicalMusicSheet.ParentMusicSheet.SelectionStart=e,null===(t=this.PlaybackManager)||void 0===t||t.reset())}},{key:"GraphicalMusicSheet",get:function(){return this.graphicalMusicSheet}}]),n}(AbstractZoomView),WebSheetRenderingManager=function(e){_inherits2(n,e);var t=_createSuper(n);function n(){return _classCallCheck2(this,n),t.apply(this,arguments)}return _createClass2(n,[{key:"mouseMove",value:function(e,t,n,i){var r=this.getPositionInUnits(e,t);this.unitPosMove(r,e,t)}}]),n}(SheetRenderingManager),AbstractDisplayInteractionManager=function(){function e(){_classCallCheck2(this,e),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}return _createClass2(e,[{key:"addListener",value:function(e){this.listeners.push(e)}},{key:"ZoomGestureActive",get:function(){return this.zoomGestureActive}},{key:"WasZoomGestureActive",get:function(){return this.interactionWasZoomGesture}},{key:"displaySizeChanged",value:function(e,t){this.displayWidth=e,this.displayHeight=t;var n,i=_createForOfIteratorHelper(this.listeners);try{for(i.s();!(n=i.n()).done;){n.value.displaySizeChanged(this.displayWidth,this.displayHeight)}}catch(err){i.e(err)}finally{i.f()}}},{key:"Dispose",value:function(){this.dispose()}},{key:"Initialize",value:function(){this.initialize()}},{key:"DisplayDpi",get:function(){return this.displayDpi}},{key:"TouchActive",get:function(){return this.touchActive}},{key:"TouchMoving",get:function(){return this.touchMoving}},{key:"touchDown",value:function(e,t,n){this.interactionWasZoomGesture=!1;var i=e/this.displayWidth,r=t/this.displayHeight;this.lastRelPosX=i,this.lastRelPosY=r,this.lastPixelX=e,this.lastPixelY=t,this.touchActive=!0,this.touchMoving=!1,this.touchCount=Math.min(this.touchCount+1,this.maxNumerOfFingers);var a,s=_createForOfIteratorHelper(this.listeners);try{for(s.s();!(a=s.n()).done;){a.value.mouseDown(i,r,!n)}}catch(err){s.e(err)}finally{s.f()}}},{key:"move",value:function(e,t){if(this.touchActive&&!this.zoomGestureActive){var n=e/this.displayWidth,i=t/this.displayHeight,r=n-this.lastRelPosX,a=i-this.lastRelPosY;this.touchMoving=!0;var s,o=_createForOfIteratorHelper(this.listeners);try{for(o.s();!(s=o.n()).done;){s.value.mouseMove(n,i,r,a)}}catch(err){o.e(err)}finally{o.f()}}}},{key:"zoomGestureStarted",value:function(){this.zoomGestureActive=!0}},{key:"zoomGestureCompleted",value:function(){this.zoomGestureActive=!1,this.interactionWasZoomGesture=!0}},{key:"zoomGestureMove",value:function(e){this.zoomGestureActive&&this.listeners.forEach((function(t){t.zoom(e)}))}},{key:"touchUp",value:function(e,t){this.touchActive=!1,this.touchMoving=!1,this.touchCount=Math.max(0,this.touchCount-1);var n,i=e/this.displayWidth,r=t/this.displayHeight,a=_createForOfIteratorHelper(this.listeners);try{for(a.s();!(n=a.n()).done;){n.value.mouseUp(i,r)}}catch(err){a.e(err)}finally{a.f()}}},{key:"click",value:function(e,t){if(!this.mouseDidMove(this.lastPixelX,e,this.lastPixelY,t)&&!this.ZoomGestureActive){var n,i=e/this.displayWidth,r=t/this.displayHeight,a=_createForOfIteratorHelper(this.listeners);try{for(a.s();!(n=a.n()).done;){n.value.positionTouched(i,r)}}catch(err){a.e(err)}finally{a.f()}}}},{key:"doubleClick",value:function(e,t){if(!this.mouseDidMove(this.lastPixelX,e,this.lastPixelY,t)&&!this.ZoomGestureActive){var n,i=e/this.displayWidth,r=t/this.displayHeight,a=_createForOfIteratorHelper(this.listeners);try{for(a.s();!(n=a.n()).done;){n.value.positionDoubleTouched(i,r)}}catch(err){a.e(err)}finally{a.f()}}}},{key:"mouseDidMove",value:function(e,t,n,i){var r=Math.abs(e-t)/this.displayDpi,a=Math.abs(n-i)/this.displayDpi;return r>this.movementThreshInch||a>this.movementThreshInch}}]),e}(),WebDisplayInteractionManager=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e){var i;return _classCallCheck2(this,n),(i=t.call(this)).fullOffsetLeft=0,i.fullOffsetTop=0,i.fullScrollTop=0,i.fullScrollLeft=0,i.parentScrollMap=new Map,i.scrollCallbackMap=new Map,i.timeout=void 0,i.resizeObserver=void 0,i.EventCallbackMap=new Dictionary,i.DOUBLE_CLICK_WINDOW=200,i.lastClick=0,i.osmdSheetMusicContainer=e,i.listenForInteractions(),i}return _createClass2(n,[{key:"FullOffsetTop",get:function(){return this.fullOffsetTop}},{key:"FullScrollTop",get:function(){return this.fullScrollTop}},{key:"FullOffsetLeft",get:function(){return this.fullOffsetLeft}},{key:"FullScrollLeft",get:function(){return this.fullScrollLeft}},{key:"registerScrollOffsets",value:function(){var e=this.osmdSheetMusicContainer;this.fullScrollTop=0,this.fullScrollLeft=0;for(var t=this;e&&e!==document.documentElement;){if(this.parentScrollMap.set(e,[e.scrollTop,e.scrollLeft]),this.fullScrollLeft+=e.scrollLeft,this.fullScrollTop+=e.scrollTop,e.scrollHeight>e.clientHeight){var n=function(e){var n=t.parentScrollMap.get(this),i=n[0],r=n[1];t.fullScrollTop=t.fullScrollTop-i+this.scrollTop,t.fullScrollLeft=t.fullScrollLeft-r+this.scrollLeft,t.parentScrollMap.set(this,[this.scrollTop,this.scrollLeft])};this.scrollCallbackMap.set(e,n),e.addEventListener("scroll",n)}e=e.parentElement}}},{key:"deregisterScrollOffsets",value:function(){var e,t=_createForOfIteratorHelper(this.scrollCallbackMap.keys());try{for(t.s();!(e=t.n()).done;){var n=e.value;n.removeEventListener("scroll",this.scrollCallbackMap.get(n))}}catch(err){t.e(err)}finally{t.f()}this.scrollCallbackMap.clear()}},{key:"initialize",value:function(){this.fullOffsetLeft=0,this.fullOffsetTop=0;var e=this.osmdSheetMusicContainer,t=[],i=this;for(window.ResizeObserver&&(this.resizeObserver=new ResizeObserver((function(e){n.resizeCallback(e,i)})));e;)this.fullOffsetLeft+=e.offsetLeft,this.fullOffsetTop+=e.offsetTop,this.resizeObserver?this.resizeObserver.observe(e):t.push(e),e=e.offsetParent;if(this.resizeObserver)this.disposeResizeListener=function(){i.resizeObserver.disconnect(),i.resizeObserver=void 0};else{var r=function(){n.resizeCallback(t,i)};window.addEventListener("resize",r),this.disposeResizeListener=function(){window.removeEventListener("resize",r),r=void 0}}i.registerScrollOffsets()}},{key:"dispose",value:function(){this.disposeResizeListener();var e,t=_createForOfIteratorHelper(this.EventCallbackMap.keys());try{for(t.s();!(e=t.n()).done;){var n=e.value,i=this.EventCallbackMap.getValue(n);i[0].removeEventListener(n,i[1])}}catch(err){t.e(err)}finally{t.f()}this.EventCallbackMap.clear(),this.deregisterScrollOffsets(),this.scrollCallbackMap.clear(),this.parentScrollMap.clear()}},{key:"isTouch",value:function(){if("ontouchstart"in window||window.DocumentTouch)return!0;if(!window.matchMedia)return!1;var e=["(",["-webkit-","-moz-","-o-","-ms-"].join("touch-enabled),("),"heartz",")"].join("");return window.matchMedia(e).matches}},{key:"downEventName",get:function(){return this.isTouch()?"touchstart":"mousedown"}},{key:"moveEventName",get:function(){return this.isTouch()?"touchmove":"mousemove"}},{key:"listenForInteractions",value:function(){var e=this.downEventListener.bind(this),t=this.touchEndEventListener.bind(this),n=this.moveEventListener.bind(this);this.osmdSheetMusicContainer.addEventListener("mousedown",e),this.osmdSheetMusicContainer.addEventListener("touchend",t),document.addEventListener(this.moveEventName,n),this.EventCallbackMap.setValue("mousedown",[this.osmdSheetMusicContainer,e]),this.EventCallbackMap.setValue("touchend",[this.osmdSheetMusicContainer,t]),this.EventCallbackMap.setValue(this.moveEventName,[document,n])}},{key:"downEventListener",value:function(e){var t=(new Date).getTime(),n=t-this.lastClick;clearTimeout(this.clickTimeout);var i=0,r=0;this.isTouch()&&e instanceof TouchEvent?(i=e.touches[0].pageX,r=e.touches[0].pageY):e instanceof MouseEvent&&(i=e.pageX,r=e.pageY);var a=this.getOffsetCoordinates(i,r);if(n0)this.doubleClick(a.x,a.y);else{var s=this;this.clickTimeout=setTimeout((function(){clearTimeout(this.clickTimeout),s.isTouch()?s.touchDown(a.x,a.y,void 0):s.click(a.x,a.y)}),this.DOUBLE_CLICK_WINDOW)}this.lastClick=t}},{key:"moveEventListener",value:function(e){var t=0,n=0;if(this.isTouch()&&e instanceof TouchEvent){var i,r,a=void 0;e.touches&&e.touches.length>0?a=e.touches[0]:e.changedTouches&&e.changedTouches.length>0&&(a=e.changedTouches[0]),t=null===(i=a)||void 0===i?void 0:i.clientX,n=null===(r=a)||void 0===r?void 0:r.clientY}else e instanceof MouseEvent&&(t=e.clientX,n=e.clientY);var s=this.getOffsetCoordinates(t,n);this.move(s.x,s.y)}},{key:"touchEndEventListener",value:function(e){var t,n,i=void 0;e.touches&&e.touches.length>0?i=e.touches[0]:e.changedTouches&&e.changedTouches.length>0&&(i=e.changedTouches[0]);var r=this.getOffsetCoordinates(null===(t=i)||void 0===t?void 0:t.pageX,null===(n=i)||void 0===n?void 0:n.pageY);this.touchUp(r.x,r.y)}},{key:"resizeEventListener",value:function(){this.displaySizeChanged(this.osmdSheetMusicContainer.clientWidth,this.osmdSheetMusicContainer.clientHeight)}},{key:"getOffsetCoordinates",value:function(e,t){var n=e-this.fullOffsetLeft+this.fullScrollLeft,i=t-this.fullOffsetTop+this.fullScrollTop;return new PointF2D(n,i)}}],[{key:"resizeCallback",value:function(e,t){clearTimeout(t.timeout),t.timeout=setTimeout((function(){t.fullOffsetLeft=0,t.fullOffsetTop=0;for(var e=t.osmdSheetMusicContainer;e;)t.fullOffsetLeft+=e.offsetLeft,t.fullOffsetTop+=e.offsetTop,e=e.offsetParent;t.resizeEventListener(),t.deregisterScrollOffsets(),t.registerScrollOffsets()}),500)}}]),n}(AbstractDisplayInteractionManager),DynamicsCalculator=function(){function e(){_classCallCheck2(this,e)}return _createClass2(e,[{key:"calculate",value:function(t){e.fillDynamicExpressions(t)}}],[{key:"fillDynamicsList",value:function(e,t,n){for(var i=0;i=0&&n[u].push(new DynamicsContainer(s.InstantaneousDynamic,u))}if(void 0!==s.StartingContinuousDynamic){n[i].push(new DynamicsContainer(s.StartingContinuousDynamic,s.StaffNumber));var c=this.getOtherStaffIndexIfLinkedStavesAreDetected(e,i,s.StartingContinuousDynamic.Placement);c>=0&&n[c].push(new DynamicsContainer(s.StartingContinuousDynamic,c))}}}}},{key:"getOtherStaffIndexIfLinkedStavesAreDetected",value:function(e,t,n){var i=e.getStaffFromIndex(t),r=i.ParentInstrument.Staves.indexOf(i),a=i.ParentInstrument.Staves.length;return a>1&&0===r&&n===PlacementEnum.Below?t+1:a>1&&1===r&&n===PlacementEnum.Above?t-1:-1}},{key:"fillDynamicExpressions",value:function(t){for(var n=t.DynListStaves,i=t.getCompleteNumberOfStaves(),r=t.TimestampSortedDynamicExpressionsList,a=0;a1&&void 0!==arguments[1]?arguments[1]:OSMDOptions.OSMDOptionsStandard(),i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new EngravingRules;if(_classCallCheck2(this,e),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===n.autoResize&&(n.autoResize=!0),this.backendType=BackendType.SVG,this.setOptions(n),this.interactionManager=new WebDisplayInteractionManager(this.container),this.renderingManager=new WebSheetRenderingManager(this.interactionManager,this.rules)}return _createClass2(e,[{key:"cursor",get:function(){return this.cursors[0]}},{key:"RenderingManager",get:function(){return this.renderingManager}},{key:"PlaybackManager",get:function(){var e;return null===(e=this.renderingManager)||void 0===e?void 0:e.PlaybackManager},set:function(e){this.renderingManager&&(this.renderingManager.PlaybackManager=e)}},{key:"isUrl",value:function(e){return e.length<2083}},{key:"isMxl",value:function(e){return"PK"===e.substr(0,4)}},{key:"processMxl",value:function(e,t,n){var i=this;MXLHelper.MXLtoXMLstring(e).then((function(e){t(i.processStringXml(e))}),(function(e){log$2.error(new Error("[OSMD] Invalid MXL file: "+e)),n(new Error("[OSMD] Invalid MXL file: "+e))}))}},{key:"processStringXml",value:function(e){var t=new DOMParser;if(""===e.substr(0,3))return log$2.debug("[OSMD] UTF with BOM detected, truncate first three bytes and pass along: "+e),t.parseFromString(e.substr(3),"application/xml");if(e.substr(0,6).includes("this.rules.MaxPageToDrawNumber)break;var s=this.createBackend(this.backendType,a),o=" exceeds CanvasBackend limit of 32767. Cutting off score.";s.getOSMDBackendType()===BackendType.Canvas&&t>i&&(log$2.warn("[OSMD] Warning: width of "+t+o),t=i),this.rules.PageFormat&&!this.rules.PageFormat.IsUndefined?e=t/this.rules.PageFormat.aspectRatio:(e=a.PositionAndShape.Size.height,e+=this.rules.PageBottomMargin,e+=this.rules.CompactMode?this.rules.PageTopMarginNarrow:this.rules.PageTopMargin,this.rules.RenderTitle&&(e+=this.rules.TitleTopDistance),e*=10*this.zoom),s.getOSMDBackendType()===BackendType.Canvas&&e>i&&(log$2.warn("[OSMD] Warning: height of "+e+o),e=Math.min(e,i)),s.resize(t,e),s.clear(),this.drawer.Backends.push(s),this.graphic.drawer=this.drawer}}catch(err){r.e(err)}finally{r.f()}}},{key:"exportSVG",value:function(){var e,t,n=_createForOfIteratorHelper(null===(e=this.drawer)||void 0===e?void 0:e.Backends);try{for(n.s();!(t=n.n()).done;){var i=t.value;i instanceof SvgVexFlowBackend&&i.export()}}catch(err){n.e(err)}finally{n.f()}}},{key:"IsReadyToRender",value:function(){return void 0!==this.graphic}},{key:"clear",value:function(){var e;null===(e=this.drawer)||void 0===e||e.clear(),this.reset()}},{key:"dispose",value:function(){this.disposeResizeListener&&this.disposeResizeListener(),this.InteractionManager&&this.InteractionManager.Dispose()}},{key:"setOptions",value:function(e){if(this.rules||(this.rules=new EngravingRules),this.drawingParameters||(this.drawingParameters=new DrawingParameters,this.drawingParameters.Rules=this.rules),null!=e){this.OnXMLRead=function(e){return e},e.onXMLRead&&(this.OnXMLRead=e.onXMLRead),e.drawingParameters&&(this.drawingParameters.DrawingParametersEnum=DrawingParametersEnum[e.drawingParameters.toLowerCase()]);var t=!this.drawer||!this.drawer.Backends||this.drawer.Backends.length<1;if(void 0!==e.backend){var n=OSMDOptions.BackendTypeFromString(e.backend);t=t||this.backendType!==n,this.backendType=n}this.needBackendUpdate=t,void 0!==e.autoBeam&&(this.rules.AutoBeamNotes=e.autoBeam);var i=e.autoBeamOptions;if(i&&(void 0===i.maintain_stem_directions&&(i.maintain_stem_directions=!1),this.rules.AutoBeamOptions=i,i.groups&&i.groups.length)){var r,a=_createForOfIteratorHelper(i.groups);try{for(a.s();!(r=a.n()).done;){if(2!==r.value.length)throw new Error("Each fraction in autoBeamOptions.groups must be of length 2, e.g. [3,4] for beaming three fourths")}}catch(err){a.e(err)}finally{a.f()}}void 0!==e.percussionOneLineCutoff&&(this.rules.PercussionOneLineCutoff=e.percussionOneLineCutoff),0!==this.rules.PercussionOneLineCutoff&&void 0!==e.percussionForceVoicesOneLineCutoff&&(this.rules.PercussionForceVoicesOneLineCutoff=e.percussionForceVoicesOneLineCutoff),void 0!==e.alignRests&&(this.rules.AlignRests=e.alignRests),void 0!==e.coloringMode&&this.setColoringMode(e),void 0!==e.coloringEnabled&&(this.rules.ColoringEnabled=e.coloringEnabled),void 0!==e.colorStemsLikeNoteheads&&(this.rules.ColorStemsLikeNoteheads=e.colorStemsLikeNoteheads),e.disableCursor&&(this.drawingParameters.drawCursors=!1),e.drawHiddenNotes&&(this.drawingParameters.drawHiddenNotes=!0),void 0!==e.drawCredits&&(this.drawingParameters.DrawCredits=e.drawCredits),void 0!==e.drawComposer&&(this.drawingParameters.DrawComposer=e.drawComposer),void 0!==e.drawTitle&&(this.drawingParameters.DrawTitle=e.drawTitle),void 0!==e.drawSubtitle&&(this.drawingParameters.DrawSubtitle=e.drawSubtitle),void 0!==e.drawLyricist&&(this.drawingParameters.DrawLyricist=e.drawLyricist),void 0!==e.drawMetronomeMarks&&(this.rules.MetronomeMarksDrawn=e.drawMetronomeMarks),void 0!==e.drawPartNames&&(this.drawingParameters.DrawPartNames=e.drawPartNames,e.drawPartAbbreviations||(this.rules.RenderPartAbbreviations=e.drawPartNames)),void 0!==e.drawPartAbbreviations&&(this.rules.RenderPartAbbreviations=e.drawPartAbbreviations),!1===e.drawFingerings&&(this.rules.RenderFingerings=!1),void 0!==e.drawMeasureNumbers&&(this.rules.RenderMeasureNumbers=e.drawMeasureNumbers),e.drawMeasureNumbersOnlyAtSystemStart&&(this.rules.RenderMeasureNumbersOnlyAtSystemStart=e.drawMeasureNumbersOnlyAtSystemStart),void 0!==e.drawLyrics&&(this.rules.RenderLyrics=e.drawLyrics),void 0!==e.drawTimeSignatures&&(this.rules.RenderTimeSignatures=e.drawTimeSignatures),void 0!==e.drawSlurs&&(this.rules.RenderSlurs=e.drawSlurs),void 0!==e.measureNumberInterval&&(this.rules.MeasureNumberLabelOffset=e.measureNumberInterval),void 0!==e.useXMLMeasureNumbers&&(this.rules.UseXMLMeasureNumbers=e.useXMLMeasureNumbers),void 0!==e.fingeringPosition&&(this.rules.FingeringPosition=AbstractExpression.PlacementEnumFromString(e.fingeringPosition)),void 0!==e.fingeringInsideStafflines&&(this.rules.FingeringInsideStafflines=e.fingeringInsideStafflines),void 0!==e.newSystemFromXML&&(this.rules.NewSystemAtXMLNewSystemAttribute=e.newSystemFromXML),void 0!==e.newPageFromXML&&(this.rules.NewPageAtXMLNewPageAttribute=e.newPageFromXML),void 0!==e.fillEmptyMeasuresWithWholeRest&&(this.rules.FillEmptyMeasuresWithWholeRest=e.fillEmptyMeasuresWithWholeRest),void 0!==e.followCursor&&(this.FollowCursor=e.followCursor),void 0!==e.setWantedStemDirectionByXml&&(this.rules.SetWantedStemDirectionByXml=e.setWantedStemDirectionByXml),e.darkMode?(this.rules.applyDefaultColorMusic("#FFFFFF"),this.rules.PageBackgroundColor="#000000"):!1===e.darkMode&&(this.rules.applyDefaultColorMusic("#000000"),this.rules.PageBackgroundColor=void 0),e.defaultColorMusic&&this.rules.applyDefaultColorMusic(e.defaultColorMusic),e.defaultColorNotehead&&(this.rules.DefaultColorNotehead=e.defaultColorNotehead),e.defaultColorRest&&(this.rules.DefaultColorRest=e.defaultColorRest),e.defaultColorStem&&(this.rules.DefaultColorStem=e.defaultColorStem),e.defaultColorLabel&&(this.rules.DefaultColorLabel=e.defaultColorLabel),e.defaultColorTitle&&(this.rules.DefaultColorTitle=e.defaultColorTitle),e.defaultFontFamily&&(this.rules.DefaultFontFamily=e.defaultFontFamily),e.defaultFontStyle&&(this.rules.DefaultFontStyle=e.defaultFontStyle),e.drawUpToMeasureNumber&&(this.rules.MaxMeasureToDrawIndex=e.drawUpToMeasureNumber-1),e.drawFromMeasureNumber&&(this.rules.MinMeasureToDrawIndex=e.drawFromMeasureNumber-1),e.drawUpToPageNumber&&(this.rules.MaxPageToDrawNumber=e.drawUpToPageNumber),e.drawUpToSystemNumber&&(this.rules.MaxSystemToDrawNumber=e.drawUpToSystemNumber),e.tupletsRatioed&&(this.rules.TupletsRatioed=!0),e.tupletsBracketed&&(this.rules.TupletsBracketed=!0),e.tripletsBracketed&&(this.rules.TripletsBracketed=!0),e.autoResize?(this.resizeHandlerAttached||this.autoResize(),this.autoResizeEnabled=!0):!1===e.autoResize&&(this.autoResizeEnabled=!1),void 0!==e.pageFormat&&this.setPageFormat(e.pageFormat),void 0!==e.pageBackgroundColor&&(this.rules.PageBackgroundColor=e.pageBackgroundColor),void 0!==e.performanceMode&&(this.rules.PerformanceMode=e.performanceMode),void 0!==e.renderSingleHorizontalStaffline&&(this.rules.RenderSingleHorizontalStaffline=e.renderSingleHorizontalStaffline),void 0!==e.spacingFactorSoftmax&&(this.rules.SoftmaxFactorVexFlow=e.spacingFactorSoftmax),void 0!==e.spacingBetweenTextLines&&(this.rules.SpacingBetweenTextLines=e.spacingBetweenTextLines),void 0!==e.stretchLastSystemLine&&(this.rules.StretchLastSystemLine=e.stretchLastSystemLine),void 0!==e.autoGenerateMutipleRestMeasuresFromRestMeasures&&(this.rules.AutoGenerateMutipleRestMeasuresFromRestMeasures=e.autoGenerateMutipleRestMeasuresFromRestMeasures),void 0!==e.cursorsOptions?this.cursorsOptions=e.cursorsOptions:this.cursorsOptions=[{type:0,color:this.EngravingRules.DefaultColorCursor,alpha:.5,follow:!0}]}else log$2.warn("warning: osmd.setOptions() called without an options parameter, has no effect.\nexample usage: osmd.setOptions({drawCredits: false, drawPartNames: false})")}},{key:"setColoringMode",value:function(e){if(e.coloringMode!==ColoringModes.XML){var t,n=[NoteEnum.C,NoteEnum.D,NoteEnum.E,NoteEnum.F,NoteEnum.G,NoteEnum.A,NoteEnum.B,-1];if(e.coloringMode===ColoringModes.CustomColorSet){if(!e.coloringSetCustom||8!==e.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).");var i,r=_createForOfIteratorHelper(e.coloringSetCustom);try{for(r.s();!(i=r.n()).done;){var a=i.value;if(!/^\#[0-9a-fA-F]{6}$/.test(a))throw new Error("One of the color strings in options.coloringSetCustom was not a valid HTML Hex color:\n"+a)}}catch(err){r.e(err)}finally{r.f()}t=e.coloringSetCustom}else if(e.coloringMode===ColoringModes.AutoColoring){t=[];for(var s=Object.keys(AutoColorSet),o=0;o0&&t>0){var n=new PageFormat(e,t);this.rules.PageFormat=n}}},{key:"DrawSkyLine",get:function(){return this.drawer.skyLineVisible},set:function(e){this.drawSkyLine=e,this.drawer&&(this.drawer.skyLineVisible=e)}},{key:"DrawBottomLine",get:function(){return this.drawer.bottomLineVisible},set:function(e){this.drawBottomLine=e,this.drawer&&(this.drawer.bottomLineVisible=e)}},{key:"DrawBoundingBox",get:function(){return this.drawBoundingBox},set:function(e){this.setDrawBoundingBox(e,!0)}},{key:"setDrawBoundingBox",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.drawBoundingBox=e,this.drawer&&(this.drawer.drawableBoundingBoxElement=e),t&&this.render()}},{key:"AutoResizeEnabled",get:function(){return this.autoResizeEnabled},set:function(e){this.autoResizeEnabled=e}},{key:"Zoom",get:function(){return this.zoom},set:function(e){var t;this.zoom=e,this.zoomUpdated=!0,(null===(t=this.graphic)||void 0===t?void 0:t.GetCalculator)instanceof VexFlowMusicSheetCalculator&&(this.graphic.GetCalculator.beamsNeedUpdate=this.zoomUpdated)}},{key:"FollowCursor",get:function(){return this.followCursor},set:function(e){this.followCursor=e}},{key:"TransposeCalculator",get:function(){return MusicSheetCalculator.transposeCalculator},set:function(e){MusicSheetCalculator.transposeCalculator=e}},{key:"Sheet",get:function(){return this.sheet}},{key:"Drawer",get:function(){return this.drawer}},{key:"GraphicSheet",get:function(){return this.graphic}},{key:"DrawingParameters",get:function(){return this.drawingParameters}},{key:"EngravingRules",get:function(){return this.rules}},{key:"InteractionManager",get:function(){return this.interactionManager}},{key:"Version",get:function(){return this.version}}],[{key:"StringToPageFormat",value:function(t){var n=PageFormat.UndefinedPageFormat;if(t.match("^[0-9]+x[0-9]+$")){var i=t.split("x"),r=Number.parseInt(i[0],10),a=Number.parseInt(i[1],10);r>0&&r<32768&&a>0&&a<32768&&(n=new PageFormat(r,a,"customPageFormat".concat(t)))}return t=(t=(t=t.replace(" ","_")).replace("Landscape","L")).replace("Portrait","P"),e.PageFormatStandards.hasOwnProperty(t)?n=e.PageFormatStandards[t]:n}}]),e}(),OpenSheetMusicDisplay=exports("O",_OpenSheetMusicDisplay);OpenSheetMusicDisplay.PageFormatStandards={A3_L:new PageFormat(420,297,"A3_L"),A3_P:new PageFormat(297,420,"A3_P"),A4_L:new PageFormat(297,210,"A4_L"),A4_P:new PageFormat(210,297,"A4_P"),A5_L:new PageFormat(210,148,"A5_L"),A5_P:new PageFormat(148,210,"A5_P"),A6_L:new PageFormat(148,105,"A6_L"),A6_P:new PageFormat(105,148,"A6_P"),Endless:PageFormat.UndefinedPageFormat,Letter_L:new PageFormat(279.4,215.9,"Letter_L"),Letter_P:new PageFormat(215.9,279.4,"Letter_P")};var handlebars={exports:{}},handlebars_runtime={exports:{}},base$1={},utils={__esModule:!0};utils.extend=extend,utils.indexOf=indexOf,utils.escapeExpression=escapeExpression,utils.isEmpty=isEmpty,utils.createFrame=createFrame,utils.blockParams=blockParams,utils.appendContextPath=appendContextPath;var escape$1={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},badChars=/[&<>"'`=]/g,possible=/[&<>"'`=]/;function escapeChar(e){return escape$1[e]}function extend(e){for(var t=1;t0?(i.ids&&(i.ids=[i.name]),e.helpers.each(t,i)):r(this);if(i.data&&i.ids){var s=n.createFrame(i.data);s.contextPath=n.appendContextPath(i.data.contextPath,i.name),i={data:s}}return a(t,i)}))},e.exports=t.default}(blockHelperMissing,blockHelperMissing.exports);var each={exports:{}};!function(e,t){t.__esModule=!0;var n,i=utils,r=exception.exports,a=(n=r)&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("each",(function(e,t){if(!t)throw new a.default("Must pass iterator to #each");var n,r=t.fn,s=t.inverse,o=0,l="",u=void 0,c=void 0;function h(t,n,a){u&&(u.key=t,u.index=n,u.first=0===n,u.last=!!a,c&&(u.contextPath=c+t)),l+=r(e[t],{data:u,blockParams:i.blockParams([e[t],t],[c+t,null])})}if(t.data&&t.ids&&(c=i.appendContextPath(t.data.contextPath,t.ids[0])+"."),i.isFunction(e)&&(e=e.call(this)),t.data&&(u=i.createFrame(t.data)),e&&"object"===_typeof3(e))if(i.isArray(e))for(var f=e.length;o=0?t:parseInt(e,10)}return e},log:function(e){if(e=i.lookupLevel(e),"undefined"!=typeof console&&i.lookupLevel(i.level)<=e){var t=i.methodMap[e];console[t]||(t="log");for(var n=arguments.length,r=Array(n>1?n-1:0),a=1;a= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};base$1.REVISION_CHANGES=REVISION_CHANGES;var objectType="[object Object]";function HandlebarsEnvironment(e,t,n){this.helpers=e||{},this.partials=t||{},this.decorators=n||{},_helpers$2.registerDefaultHelpers(this),_decorators.registerDefaultDecorators(this)}HandlebarsEnvironment.prototype={constructor:HandlebarsEnvironment,logger:_logger2.default,log:_logger2.default.log,registerHelper:function(e,t){if(_utils$3.toString.call(e)===objectType){if(t)throw new _exception2$3.default("Arg not supported with multiple helpers");_utils$3.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if(_utils$3.toString.call(e)===objectType)_utils$3.extend(this.partials,e);else{if(void 0===t)throw new _exception2$3.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=t}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,t){if(_utils$3.toString.call(e)===objectType){if(t)throw new _exception2$3.default("Arg not supported with multiple decorators");_utils$3.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function(){_internalProtoAccess$1.resetLoggedProperties()}};var log=_logger2.default.log;base$1.log=log,base$1.createFrame=_utils$3.createFrame,base$1.logger=_logger2.default;var safeString={exports:{}};!function(e,t){function n(e){this.string=e}t.__esModule=!0,n.prototype.toString=n.prototype.toHTML=function(){return""+this.string},t.default=n,e.exports=t.default}(safeString,safeString.exports);var runtime={},wrapHelper$1={};function wrapHelper(e,t){if("function"!=typeof e)return e;return function(){var n=arguments[arguments.length-1];return arguments[arguments.length-1]=t(n),e.apply(this,arguments)}}function _interopRequireDefault$3(e){return e&&e.__esModule?e:{default:e}}function _interopRequireWildcard$1(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}wrapHelper$1.__esModule=!0,wrapHelper$1.wrapHelper=wrapHelper,runtime.__esModule=!0,runtime.checkRevision=checkRevision,runtime.template=template,runtime.wrapProgram=wrapProgram,runtime.resolvePartial=resolvePartial,runtime.invokePartial=invokePartial,runtime.noop=noop$1;var _utils$2=utils,Utils=_interopRequireWildcard$1(_utils$2),_exception$2=exception.exports,_exception2$2=_interopRequireDefault$3(_exception$2),_base=base$1,_helpers$1=helpers$1,_internalWrapHelper=wrapHelper$1,_internalProtoAccess=protoAccess;function checkRevision(e){var t=e&&e[0]||1,n=_base.COMPILER_REVISION;if(!(t>=_base.LAST_COMPATIBLE_COMPILER_REVISION&&t<=_base.COMPILER_REVISION)){if(t<_base.LAST_COMPATIBLE_COMPILER_REVISION){var i=_base.REVISION_CHANGES[n],r=_base.REVISION_CHANGES[t];throw new _exception2$2.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+i+") or downgrade your runtime to an older version ("+r+").")}throw new _exception2$2.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+e[1]+").")}}function template(e,t){if(!t)throw new _exception2$2.default("No environment passed to template");if(!e||!e.main)throw new _exception2$2.default("Unknown template object: "+_typeof3(e));e.main.decorator=e.main_d,t.VM.checkRevision(e.compiler);var n=e.compiler&&7===e.compiler[0];var i={strict:function(e,t,n){if(!e||!(t in e))throw new _exception2$2.default('"'+t+'" not defined in '+e,{loc:n});return i.lookupProperty(e,t)},lookupProperty:function(e,t){var n=e[t];return null==n||Object.prototype.hasOwnProperty.call(e,t)||_internalProtoAccess.resultIsAllowed(n,i.protoAccessControl,t)?n:void 0},lookup:function(e,t){for(var n=e.length,r=0;r2&&y.push("'"+this.terminals_[m]+"'");S=this.lexer.showPosition?"Parse error on line "+(o+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+y.join(", ")+", got '"+(this.terminals_[h]||h)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==h?"end of input":"'"+(this.terminals_[h]||h)+"'"),this.parseError(S,{text:this.lexer.match,token:this.terminals_[h]||h,line:this.lexer.yylineno,loc:u,expected:y})}if(d[0]instanceof Array&&d.length>1)throw new Error("Parse Error: multiple actions possible at state: "+f+", token: "+h);switch(d[0]){case 1:n.push(h),i.push(this.lexer.yytext),r.push(this.lexer.yylloc),n.push(d[1]),h=null,l=this.lexer.yyleng,s=this.lexer.yytext,o=this.lexer.yylineno,u=this.lexer.yylloc;break;case 2:if(v=this.productions_[d[1]][1],_.$=i[i.length-v],_._$={first_line:r[r.length-(v||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(v||1)].first_column,last_column:r[r.length-1].last_column},c&&(_._$.range=[r[r.length-(v||1)].range[0],r[r.length-1].range[1]]),void 0!==(p=this.performAction.call(_,s,l,o,this.yy,d[1],i,r)))return p;v&&(n=n.slice(0,-1*v*2),i=i.slice(0,-1*v),r=r.slice(0,-1*v)),n.push(this.productions_[d[1]][0]),i.push(_.$),r.push(_._$),g=a[n[n.length-2]][n[n.length-1]],n.push(g);break;case 3:return!0}}return!0}},t=function(){var e={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e){return this._input=e,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 e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.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),e},unput:function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t-1),this.offset-=t;var i=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),n.length-1&&(this.yylineno-=n.length-1);var r=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:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-t]),this},more:function(){return this._more=!0,this},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;var e,t,n,i,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var a=this._currentRules(),s=0;st[0].length)||(t=n,i=s,this.options.flex));s++);return t?((r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,a[i],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e||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 e=this.next();return void 0!==e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},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(e){this.begin(e)},options:{},performAction:function(e,t,n,i){function r(e,n){return t.yytext=t.yytext.substring(e,t.yyleng-n+e)}switch(n){case 0:if("\\\\"===t.yytext.slice(-2)?(r(0,1),this.begin("mu")):"\\"===t.yytext.slice(-1)?(r(0,1),this.begin("emu")):this.begin("mu"),t.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:(r(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(t.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 t.yytext=r(1,2).replace(/\\"/g,'"'),80;case 32:return t.yytext=r(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 t.yytext=t.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 e}();function n(){this.yy={}}return e.lexer=t,n.prototype=e,e.Parser=n,new n}();t.default=n,e.exports=t.default}(parser$2,parser$2.exports);var whitespaceControl={exports:{}},visitor={exports:{}};!function(e,t){t.__esModule=!0;var n,i=exception.exports,r=(n=i)&&n.__esModule?n:{default:n};function a(){this.parents=[]}function s(e){this.acceptRequired(e,"path"),this.acceptArray(e.params),this.acceptKey(e,"hash")}function o(e){s.call(this,e),this.acceptKey(e,"program"),this.acceptKey(e,"inverse")}function l(e){this.acceptRequired(e,"name"),this.acceptArray(e.params),this.acceptKey(e,"hash")}a.prototype={constructor:a,mutating:!1,acceptKey:function(e,t){var n=this.accept(e[t]);if(this.mutating){if(n&&!a.prototype[n.type])throw new r.default('Unexpected node type "'+n.type+'" found when accepting '+t+" on "+e.type);e[t]=n}},acceptRequired:function(e,t){if(this.acceptKey(e,t),!e[t])throw new r.default(e.type+" requires "+t)},acceptArray:function(e){for(var t=0,n=e.length;t0)throw new _exception2$1.default("Invalid path: "+i,{loc:n});".."===l&&a++}}return{type:"PathExpression",data:e,depth:a,parts:r,original:i,loc:n}}function prepareMustache(e,t,n,i,r,a){var s=i.charAt(3)||i.charAt(2),o="{"!==s&&"&"!==s;return{type:/\*/.test(i)?"Decorator":"MustacheStatement",path:e,params:t,hash:n,escaped:o,strip:r,loc:this.locInfo(a)}}function prepareRawBlock(e,t,n,i){validateClose(e,n);var r={type:"Program",body:t,strip:{},loc:i=this.locInfo(i)};return{type:"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:r,openStrip:{},inverseStrip:{},closeStrip:{},loc:i}}function prepareBlock(e,t,n,i,r,a){i&&i.path&&validateClose(e,i);var s=/\*/.test(e.open);t.blockParams=e.blockParams;var o=void 0,l=void 0;if(n){if(s)throw new _exception2$1.default("Unexpected inverse block on decorator",n);n.chain&&(n.program.body[0].closeStrip=i.strip),l=n.strip,o=n.program}return r&&(r=o,o=t,t=r),{type:s?"DecoratorBlock":"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:t,inverse:o,openStrip:e.strip,inverseStrip:l,closeStrip:i&&i.strip,loc:this.locInfo(a)}}function prepareProgram(e,t){if(!t&&e.length){var n=e[0].loc,i=e[e.length-1].loc;n&&i&&(t={source:n.source,start:{line:n.start.line,column:n.start.column},end:{line:i.end.line,column:i.end.column}})}return{type:"Program",body:e,strip:{},loc:t}}function preparePartialBlock(e,t,n,i){return validateClose(e,n),{type:"PartialBlockStatement",name:e.path,params:e.params,hash:e.hash,program:t,openStrip:e.strip,closeStrip:n&&n.strip,loc:this.locInfo(i)}}function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function _interopRequireDefault$1(e){return e&&e.__esModule?e:{default:e}}base.__esModule=!0,base.parseWithoutProcessing=parseWithoutProcessing,base.parse=parse$2;var _parser=parser$2.exports,_parser2=_interopRequireDefault$1(_parser),_whitespaceControl=whitespaceControl.exports,_whitespaceControl2=_interopRequireDefault$1(_whitespaceControl),_helpers=helpers,Helpers=_interopRequireWildcard(_helpers),_utils$1=utils;base.parser=_parser2.default;var yy={};function parseWithoutProcessing(e,t){return"Program"===e.type?e:(_parser2.default.yy=yy,yy.locInfo=function(e){return new yy.SourceLocation(t&&t.srcName,e)},_parser2.default.parse(e))}function parse$2(e,t){var n=parseWithoutProcessing(e,t);return new _whitespaceControl2.default(t).accept(n)}_utils$1.extend(yy,Helpers);var compiler={};function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}compiler.__esModule=!0,compiler.Compiler=Compiler,compiler.precompile=precompile,compiler.compile=compile;var _exception=exception.exports,_exception2=_interopRequireDefault(_exception),_utils=utils,_ast=ast.exports,_ast2=_interopRequireDefault(_ast),slice=[].slice;function Compiler(){}function precompile(e,t,n){if(null==e||"string"!=typeof e&&"Program"!==e.type)throw new _exception2.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+e);"data"in(t=t||{})||(t.data=!0),t.compat&&(t.useDepths=!0);var i=n.parse(e,t),r=(new n.Compiler).compile(i,t);return(new n.JavaScriptCompiler).compile(r,t)}function compile(e,t,n){if(void 0===t&&(t={}),null==e||"string"!=typeof e&&"Program"!==e.type)throw new _exception2.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+e);"data"in(t=_utils.extend({},t))||(t.data=!0),t.compat&&(t.useDepths=!0);var i=void 0;function r(){var i=n.parse(e,t),r=(new n.Compiler).compile(i,t),a=(new n.JavaScriptCompiler).compile(r,t,void 0,!0);return n.template(a)}function a(e,t){return i||(i=r()),i.call(this,e,t)}return a._setup=function(e){return i||(i=r()),i._setup(e)},a._child=function(e,t,n,a){return i||(i=r()),i._child(e,t,n,a)},a}function argEquals(e,t){if(e===t)return!0;if(_utils.isArray(e)&&_utils.isArray(t)&&e.length===t.length){for(var n=0;n1)throw new _exception2.default("Unsupported number of partial arguments: "+n.length,e);n.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):n.push({type:"PathExpression",parts:[],depth:0}));var i=e.name.original,r="SubExpression"===e.name.type;r&&this.accept(e.name),this.setupFullMustacheParams(e,t,void 0,!0);var a=e.indent||"";this.options.preventIndent&&a&&(this.opcode("appendContent",a),a=""),this.opcode("invokePartial",r,i,a),this.opcode("append")},PartialBlockStatement:function(e){this.PartialStatement(e)},MustacheStatement:function(e){this.SubExpression(e),e.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(e){this.DecoratorBlock(e)},ContentStatement:function(e){e.value&&this.opcode("appendContent",e.value)},CommentStatement:function(){},SubExpression:function(e){transformLiteralToPath(e);var t=this.classifySexpr(e);"simple"===t?this.simpleSexpr(e):"helper"===t?this.helperSexpr(e):this.ambiguousSexpr(e)},ambiguousSexpr:function(e,t,n){var i=e.path,r=i.parts[0],a=null!=t||null!=n;this.opcode("getContext",i.depth),this.opcode("pushProgram",t),this.opcode("pushProgram",n),i.strict=!0,this.accept(i),this.opcode("invokeAmbiguous",r,a)},simpleSexpr:function(e){var t=e.path;t.strict=!0,this.accept(t),this.opcode("resolvePossibleLambda")},helperSexpr:function(e,t,n){var i=this.setupFullMustacheParams(e,t,n),r=e.path,a=r.parts[0];if(this.options.knownHelpers[a])this.opcode("invokeKnownHelper",i.length,a);else{if(this.options.knownHelpersOnly)throw new _exception2.default("You specified knownHelpersOnly, but used the unknown helper "+a,e);r.strict=!0,r.falsy=!0,this.accept(r),this.opcode("invokeHelper",i.length,r.original,_ast2.default.helpers.simpleId(r))}},PathExpression:function(e){this.addDepth(e.depth),this.opcode("getContext",e.depth);var t=e.parts[0],n=_ast2.default.helpers.scopedId(e),i=!e.depth&&!n&&this.blockParamIndex(t);i?this.opcode("lookupBlockParam",i,e.parts):t?e.data?(this.options.data=!0,this.opcode("lookupData",e.depth,e.parts,e.strict)):this.opcode("lookupOnContext",e.parts,e.falsy,e.strict,n):this.opcode("pushContext")},StringLiteral:function(e){this.opcode("pushString",e.value)},NumberLiteral:function(e){this.opcode("pushLiteral",e.value)},BooleanLiteral:function(e){this.opcode("pushLiteral",e.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(e){var t=e.pairs,n=0,i=t.length;for(this.opcode("pushHash");n=0)return[t,r]}}};var javascriptCompiler={exports:{}},codeGen={exports:{}};!function(e,t){t.__esModule=!0;var n=utils,i=void 0;try{var r=require("source-map");i=r.SourceNode}catch(err){}function a(e,t,i){if(n.isArray(e)){for(var r=[],a=0,s=e.length;a0&&(n+=", "+i.join(", "));var r=0;Object.keys(this.aliases).forEach((function(e){var i=t.aliases[e];i.children&&i.referenceCount>1&&(n+=", alias"+ ++r+"="+e,i.children[0]="alias"+r)})),this.lookupPropertyFunctionIsUsed&&(n+=", "+this.lookupPropertyFunctionVarDeclaration());var a=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&a.push("blockParams"),this.useDepths&&a.push("depths");var s=this.mergeSource(n);return e?(a.push(s),Function.apply(this,a)):this.source.wrap(["function(",a.join(","),") {\n ",s,"}"])},mergeSource:function(e){var t=this.environment.isSimple,n=!this.forceBuffer,i=void 0,r=void 0,a=void 0,s=void 0;return this.source.each((function(e){e.appendToBuffer?(a?e.prepend(" + "):a=e,s=e):(a&&(r?a.prepend("buffer += "):i=!0,s.add(";"),a=s=void 0),r=!0,t||(n=!1))})),n?a?(a.prepend("return "),s.add(";")):r||this.source.push('return "";'):(e+=", buffer = "+(i?"":this.initializeBuffer()),a?(a.prepend("return buffer + "),s.add(";")):this.source.push("return buffer;")),e&&this.source.prepend("var "+e.substring(2)+(i?"":";\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(e){var t=this.aliasable("container.hooks.blockHelperMissing"),n=[this.contextName(0)];this.setupHelperArgs(e,0,n);var i=this.popStack();n.splice(1,0,i),this.push(this.source.functionCall(t,"call",n))},ambiguousBlockValue:function(){var e=this.aliasable("container.hooks.blockHelperMissing"),t=[this.contextName(0)];this.setupHelperArgs("",0,t,!0),this.flushInline();var n=this.topStack();t.splice(1,0,n),this.pushSource(["if (!",this.lastHelper,") { ",n," = ",this.source.functionCall(e,"call",t),"}"])},appendContent:function(e){this.pendingContent?e=this.pendingContent+e:this.pendingLocation=this.source.currentLocation,this.pendingContent=e},append:function(){if(this.isInline())this.replaceStack((function(e){return[" != null ? ",e,' : ""']})),this.pushSource(this.appendToBuffer(this.popStack()));else{var e=this.popStack();this.pushSource(["if (",e," != null) { ",this.appendToBuffer(e,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(e){this.lastContext=e},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(e,t,n,i){var r=0;i||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(e[r++])),this.resolvePath("context",e,r,t,n)},lookupBlockParam:function(e,t){this.useBlockParams=!0,this.push(["blockParams[",e[0],"][",e[1],"]"]),this.resolvePath("context",t,1)},lookupData:function(e,t,n){e?this.pushStackLiteral("container.data(data, "+e+")"):this.pushStackLiteral("data"),this.resolvePath("data",t,0,!0,n)},resolvePath:function(e,t,n,i,r){var a=this;if(this.options.strict||this.options.assumeObjects)this.push(function(e,t,n,i){var r=t.popStack(),a=0,s=n.length;e&&s--;for(;athis.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var e=this.inlineStack;this.inlineStack=[];for(var t=0,n=e.length;t64&&e<91?e-65:e>96&&e<123?e-71:e>47&&e<58?e+4:43===e?62:47===e?63:0}function decode(e,t){for(var n,i,r=e.replace(/[^A-Za-z0-9\+\/]/g,""),a=r.length,s=t?Math.ceil((3*a+1>>2)/t)*t:3*a+1>>2,o=new Uint8Array(s),l=0,u=0,c=0;c>>(16>>>n&24)&255;l=0}return o}var base64={decode:decode},fetch$1=function(e,t){return new Promise((function(n,i){var r=new XMLHttpRequest;t&&(r.responseType=t),r.open("GET",e),r.onload=function(){200===r.status?n(r.response):i(Error(r.statusText))},r.onerror=function(){i(Error("Network Error"))},r.send()}))};!function(e){var t=base64,n=fetch$1;function i(e){return function(t){return"string"==typeof t&&e.test(t)}}function r(e,t){return"string"==typeof e?e+t:"function"==typeof e?e(t):t}function a(e,t,n,i){var r=function(e){return e instanceof ArrayBuffer}(t)?s:o(t)?l:function(e){return e&&"function"==typeof e.then}(t)?u:c(t)?h:function(e){return e&&"object"===_typeof3(e)}(t)?f:d(t)?p:m(t)?v:g(t)?y:null;return r?r(e,t,n||{}):i?Promise.resolve(i):Promise.reject("Source not valid ("+t+")")}function s(e,t,n){return new Promise((function(n,i){e.decodeAudioData(t,(function(e){n(e)}),(function(){i("Can't decode audio data ("+t.slice(0,30)+"...)")}))}))}a.fetch=n;var o=i(/\.(mp3|wav|ogg)(\?.*)?$/i);function l(e,t,n){var i=r(n.from,t);return a(e,a.fetch(i,"arraybuffer"),n)}function u(e,t,n){return t.then((function(t){return a(e,t,n)}))}var c=Array.isArray;function h(e,t,n){return Promise.all(t.map((function(t){return a(e,t,n,t)})))}function f(e,t,n){var i={},r=Object.keys(t).map((function(r){if(n.only&&-1===n.only.indexOf(r))return null;var s=t[r];return a(e,s,n,s).then((function(e){i[r]=e}))}));return Promise.all(r).then((function(){return i}))}var d=i(/\.json(\?.*)?$/i);function p(e,t,n){var i=r(n.from,t);return a(e,a.fetch(i,"text").then(JSON.parse),n)}var m=i(/^data:audio/);function v(e,n,i){var r=n.indexOf(",");return a(e,t.decode(n.slice(r+1)).buffer,i)}var g=i(/\.js(\?.*)?$/i);function y(e,t,n){var i=r(n.from,t);return a(e,a.fetch(i,"text").then(b),n)}function b(e){var t=e.indexOf("MIDI.Soundfont.");if(t<0)throw Error("Invalid MIDI.js Soundfont format");t=e.indexOf("=",t)+2;var n=e.lastIndexOf(",");return JSON.parse(e.slice(t,n)+"}")}e.exports&&(e.exports=a),"undefined"!=typeof window&&(window.loadAudio=a)}(lib$1);var lib={exports:{}},adsr=ADSR$1;function ADSR$1(e){var t=e.createGain(),n=t._voltage=getVoltage(e),i=scale(n),r=scale(n),a=scale(n);return t._startAmount=scale(r),t._endAmount=scale(a),t._multiplier=scale(i),t._multiplier.connect(t),t._startAmount.connect(t),t._endAmount.connect(t),t.value=i.gain,t.startValue=r.gain,t.endValue=a.gain,t.startValue.value=0,t.endValue.value=0,Object.defineProperties(t,props),t}var props={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(e){var t=this._multiplier.gain,n=this._startAmount.gain,i=this._endAmount.gain;this._voltage.start(e),this._decayFrom=this._decayFrom=e+this.attack,this._startedAt=e;var r=this.sustain;t.cancelScheduledValues(e),n.cancelScheduledValues(e),i.cancelScheduledValues(e),i.setValueAtTime(0,e),this.attack?(t.setValueAtTime(0,e),t.linearRampToValueAtTime(1,e+this.attack),n.setValueAtTime(1,e),n.linearRampToValueAtTime(0,e+this.attack)):(t.setValueAtTime(1,e),n.setValueAtTime(0,e)),this.decay&&t.setTargetAtTime(r,this._decayFrom,getTimeConstant(this.decay))}},stop:{value:function(e,t){t&&(e-=this.release);var n=e+this.release;if(this.release){var i=this._multiplier.gain,r=this._startAmount.gain,a=this._endAmount.gain;i.cancelScheduledValues(e),r.cancelScheduledValues(e),a.cancelScheduledValues(e);var s=getTimeConstant(this.release);if(this.attack&&e=t&&(a=t),a}var ADSR=adsr,EMPTY={},DEFAULTS={gain:1,attack:.01,decay:.1,sustain:.9,release:.3,loop:!1,cents:0,loopStart:0,loopEnd:0};function SamplePlayer(e,t,n){var i=!1,r=0,a={},s=e.createGain();s.gain.value=1;var o=Object.assign({},DEFAULTS,n),l={context:e,out:s,opts:o};return t instanceof AudioBuffer?l.buffer=t:l.buffers=t,l.start=function(t,n,s){if(l.buffer&&null!==t)return l.start(null,t,n);var o=t?l.buffers[t]:l.buffer;if(o){if(i){var c=s||EMPTY;n=Math.max(e.currentTime,n||0),l.emit("start",n,t,c);var h=u(t,o,c);return h.id=function(t,n){return n.id=r++,a[n.id]=n,n.source.onended=function(){var t=e.currentTime;n.source.disconnect(),n.env.disconnect(),n.disconnect(),l.emit("ended",t,n.id,n)},n.id}(0,h),h.env.start(n),h.source.start(n),l.emit("started",n,h.id,h),c.duration&&h.stop(n+c.duration),h}console.warn("SamplePlayer not connected to any node.")}else console.warn("Buffer "+t+" not found.")},l.play=function(e,t,n){return l.start(e,t,n)},l.stop=function(e,t){var n;return(t=t||Object.keys(a)).map((function(t){return(n=a[t])?(n.stop(e),n.id):null}))},l.connect=function(e){return i=!0,s.connect(e),l},l.emit=function(e,t,n,i){l.onevent&&l.onevent(e,t,n,i);var r=l["on"+e];r&&r(t,n,i)},l;function u(t,n,i){var r=e.createGain();return r.gain.value=0,r.connect(s),r.env=envelope(e,i,o),r.env.connect(r.gain),r.source=e.createBufferSource(),r.source.buffer=n,r.source.connect(r),r.source.loop=i.loop||o.loop,r.source.playbackRate.value=centsToRate(i.cents||o.cents),r.source.loopStart=i.loopStart||o.loopStart,r.source.loopEnd=i.loopEnd||o.loopEnd,r.stop=function(n){var i=n||e.currentTime;l.emit("stop",i,t);var a=r.env.stop(i);r.source.stop(a)},r}}function isNum$1(e){return"number"==typeof e}var PARAMS=["attack","decay","sustain","release"];function envelope(e,t,n){var i=ADSR(e),r=t.adsr||n.adsr;return PARAMS.forEach((function(e,a){i[e]=r?r[a]:t[e]||n[e]})),i.value.value=isNum$1(t.gain)?t.gain:isNum$1(n.gain)?n.gain:1,i}function centsToRate(e){return e?Math.pow(2,e/1200):1}var player$1=SamplePlayer,events=function(e){return e.on=function(t,n){if(1===arguments.length&&"function"==typeof t)return e.on("event",t);var i="on"+t,r=e[i];return e[i]=r?chain(r,n):n,e},e};function chain(e,t){return function(n,i,r,a){e(n,i,r,a),t(n,i,r,a)}}var REGEX$1=/^([a-gA-G])(#{1,}|b{1,}|x{1,}|)(-?\d*)\s*(.*)\s*$/;function regex$1(){return REGEX$1}var SEMITONES$1=[0,2,4,5,7,9,11];function parse$1(e,t,n){if("string"!=typeof e)return null;var i=REGEX$1.exec(e);if(!i||!t&&i[4])return null;var r={letter:i[1].toUpperCase(),acc:i[2].replace(/x/g,"##")};return r.pc=r.letter+r.acc,r.step=(r.letter.charCodeAt(0)+3)%7,r.alt="b"===r.acc[0]?-r.acc.length:r.acc.length,r.chroma=SEMITONES$1[r.step]+r.alt,i[3]&&(r.oct=+i[3],r.midi=r.chroma+12*(r.oct+1),r.freq=midiToFreq$1(r.midi,n)),t&&(r.tonicOf=i[4]),r}function midiToFreq$1(e,t){return Math.pow(2,(e-69)/12)*(t||440)}var parser$1={parse:parse$1,regex:regex$1,midiToFreq:midiToFreq$1},FNS=["letter","acc","pc","step","alt","chroma","oct","midi","freq"];FNS.forEach((function(e){parser$1[e]=function(t){var n=parse$1(t);return n&&void 0!==n[e]?n[e]:null}}));var noteParser$1=parser$1,note=noteParser$1,isMidi=function(e){return null!==e&&e!==[]&&e>=0&&e<129},toMidi=function(e){return isMidi(e)?+e:note.midi(e)},notes=function(e){if(e.buffers){var t=e.opts.map,n="function"==typeof t?t:toMidi,i=function(e){return e?n(e)||e:null};e.buffers=mapBuffers(e.buffers,i);var r=e.start;e.start=function(e,t,n){var a=i(e),s=a%1;return s&&(a=Math.floor(a),n=Object.assign(n||{},{cents:Math.floor(100*s)})),r(a,t,n)}}return e};function mapBuffers(e,t){return Object.keys(e).reduce((function(n,i){return n[t(i)]=e[i],n}),{})}var isArr=Array.isArray,isObj=function(e){return e&&"object"===_typeof3(e)},OPTS={},scheduler=function(e){return e.schedule=function(t,n){var i,r,a,s,o=e.context.currentTime,l=t6?null:LETTERS.charAt(e)+accStr(t)+octStr(n)}function midi(e){if((isNum(e)||isStr(e))&&e>=0&&e<128)return+e;var t=parse(e);return t&&isDef(t.midi)?t.midi:null}function freq(e,t){var n=midi(e);return null===n?null:midiToFreq(n,t)}function letter(e){return(parse(e)||{}).letter}function acc(e){return(parse(e)||{}).acc}function pc(e){return(parse(e)||{}).pc}function step(e){return(parse(e)||{}).step}function alt(e){return(parse(e)||{}).alt}function chroma(e){return(parse(e)||{}).chroma}function oct(e){return(parse(e)||{}).oct}var noteParser=Object.freeze(Object.defineProperty({__proto__:null,regex:regex,parse:parse,build:build,midi:midi,freq:freq,letter:letter,acc:acc,pc:pc,step:step,alt:alt,chroma:chroma,oct:oct},Symbol.toStringTag,{value:"Module"})),require$$0=getAugmentedNamespace(noteParser),parser=require$$0;function Soundfont(e,t){if(console.warn("new Soundfont() is deprected"),console.log("Please use Soundfont.instrument() instead of new Soundfont().instrument()"),!(this instanceof Soundfont))return new Soundfont(e);this.nameToUrl=t||Soundfont.nameToUrl,this.ctx=e,this.instruments={},this.promises=[]}function loadBuffers(e,t,n){return console.warn("Soundfont.loadBuffers is deprecate."),console.log("Use Soundfont.instrument(..) and get buffers properties from the result."),Soundfont.instrument(e,t,n).then((function(e){return e.buffers}))}function oscillatorPlayer(e,t){return t=t||{},function(n,i,r,a){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 s=n>0&&n<129?+n:parser.midi(n),o=s?parser.midiToFreq(s,440):null;if(o){r=r||.2;var l=(a=a||{}).destination||t.destination||e.destination,u=a.vcoType||t.vcoType||"sine",c=a.gain||t.gain||.4,h=e.createOscillator();h.type=u,h.frequency.value=o;var f=e.createGain();return f.gain.value=c,h.connect(f),f.connect(l),h.start(i),r>0&&h.stop(i+r),h}}}Soundfont.prototype.onready=function(e){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(e)},Soundfont.prototype.instrument=function(e,t){console.warn("new Soundfont().instrument() is deprecated."),console.log("Please use Soundfont.instrument() instead.");var n=this.ctx;if((e=e||"default")in this.instruments)return this.instruments[e];var i={name:e,play:oscillatorPlayer(n,t)};if(this.instruments[e]=i,"default"!==e){var r=Soundfont.instrument(n,e,t).then((function(e){return i.play=e.play,i}));this.promises.push(r),i.onready=function(e){console.warn("onready is deprecated. Use Soundfont.instrument().then()"),r.then(e)}}else i.onready=function(e){console.warn("onready is deprecated. Use Soundfont.instrument().then()"),e()};return i},Soundfont.loadBuffers=loadBuffers,Soundfont.noteToMidi=parser.midi;var legacy=Soundfont;!function(e){var t=lib$1.exports,n=lib.exports;function i(e){return/\.js(\?.*)?$/i.test(e)}function r(e,t,n){return"https://gleitz.github.io/midi-js-soundfonts/"+(t="FluidR3_GM"===t?t:"MusyngKite")+"/"+e+"-"+(n="ogg"===n?n:"mp3")+".js"}var a=legacy;a.instrument=function e(a,s,o){if(1===arguments.length)return function(t,n){return e(a,t,n)};var l=o||{},u=l.isSoundfontURL||i,c=l.nameToUrl||r,h=u(s)?s:c(s,l.soundfont,l.format);return t(a,h,{only:l.only||l.notes}).then((function(e){var t=n(a,e,l).connect(l.destination?l.destination:a.destination);return t.url=h,t.name=s,t}))},a.nameToUrl=r,e.exports&&(e.exports=a),"undefined"!=typeof window&&(window.Soundfont=a)}(lib$2),NoteEnum.C,NoteEnum.D,NoteEnum.E,NoteEnum.F,NoteEnum.G,NoteEnum.A,NoteEnum.B;var state$2=exports("s",reactive({sectionStatus:!1,maskStatus:!1,section:[],times:[],timesById:{},sectionBoundingBoxs:[],activeTick:-1,activeTickRepeat:1,showTick:!1,isSpecialShapedScreen:!1,notchHeight:0,fixedKey:0,renderLoading:!1,evaluatings:{},isPauseRecording:!1,feeShow:!1,vipShow:!1,mode:"contact",subjectId:0,activeSpeed:90,baseSpeed:90,activeDetail:null,needTick:!1,skipTick:!1,repeatedBeats:!0,sectionFlash:!1,befireSection:null,isPercussion:!1,enableEvaluation:!0,isAppPlay:!1,partListNames:[],partIndex:0,midiPlayIniting:!1,isSpecialBookCategory:!1,code:"",frozenMode:!1,initRendered:!1,setting:null,activeNote:"",freeRate:.1,zoom:1,renderType:"native"})),toastItem=null;watchEffect((function(){var e,t={},n=_createForOfIteratorHelper(state$2.times);try{for(n.s();!(e=n.n()).done;){var i=e.value;i.id&&(t[i.id]=i)}}catch(err){n.e(err)}finally{n.f()}state$2.timesById=t,state$2.subjectId>0&&(state$2.isPercussion=23==state$2.subjectId||113==state$2.subjectId),state$2.renderLoading?toastItem=Toast({duration:0,message:"加载中..."}):toastItem&&(toastItem.close(),toastItem=null)}));var eventemitter3={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function i(){}function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(e,t,i,a,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new r(i,a||e,s),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function o(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),o.prototype.eventNames=function(){var e,i,r=[];if(0===this._eventsCount)return r;for(i in e=this._events)t.call(e,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},o.prototype.listeners=function(e){var t=n?n+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,a=i.length,s=new Array(a);r2&&void 0!==arguments[2]?arguments[2]:{},i=ref();if(e.value){for(var r=new EngravingRules,a=0,s=Object.entries(n);a * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ !function(t,n){(function(){var i,r="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",o=16,l=32,u=64,c=128,h=256,f=1/0,d=9007199254740991,p=NaN,m=4294967295,v=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",o],["flip",512],["partial",l],["partialRight",u],["rearg",h]],g="[object Arguments]",y="[object Array]",b="[object Boolean]",_="[object Date]",S="[object Error]",x="[object Function]",w="[object GeneratorFunction]",k="[object Map]",E="[object Number]",T="[object Object]",P="[object Promise]",A="[object RegExp]",C="[object Set]",M="[object String]",I="[object Symbol]",N="[object WeakMap]",L="[object ArrayBuffer]",R="[object DataView]",F="[object Float32Array]",O="[object Float64Array]",B="[object Int8Array]",D="[object Int16Array]",V="[object Int32Array]",$="[object Uint8Array]",G="[object Uint8ClampedArray]",z="[object Uint16Array]",H="[object Uint32Array]",U=/\b__p \+= '';/g,j=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,X=RegExp(q.source),K=RegExp(Y.source),Z=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,ee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,ne=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ie=/[\\^$.*+?()[\]{}|]/g,re=RegExp(ie.source),ae=/^\s+/,se=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,le=/\{\n\/\* \[wrapped with (.+)\] \*/,ue=/,? & /,ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,he=/[()=,{}\[\]\/\s]/,fe=/\\(\\)?/g,de=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,me=/^[-+]0x[0-9a-f]+$/i,ve=/^0b[01]+$/i,ge=/^\[object .+?Constructor\]$/,ye=/^0o[0-7]+$/i,be=/^(?:0|[1-9]\d*)$/,_e=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Se=/($^)/,xe=/['\n\r\u2028\u2029\\]/g,we="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ke="\\u2700-\\u27bf",Ee="a-z\\xdf-\\xf6\\xf8-\\xff",Te="A-Z\\xc0-\\xd6\\xd8-\\xde",Pe="\\ufe0e\\ufe0f",Ae="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ce="['’]",Me="[\\ud800-\\udfff]",Ie="["+Ae+"]",Ne="["+we+"]",Le="\\d+",Re="[\\u2700-\\u27bf]",Fe="["+Ee+"]",Oe="[^\\ud800-\\udfff"+Ae+Le+ke+Ee+Te+"]",Be="\\ud83c[\\udffb-\\udfff]",De="[^\\ud800-\\udfff]",Ve="(?:\\ud83c[\\udde6-\\uddff]){2}",$e="[\\ud800-\\udbff][\\udc00-\\udfff]",Ge="["+Te+"]",ze="(?:"+Fe+"|"+Oe+")",He="(?:"+Ge+"|"+Oe+")",Ue="(?:['’](?:d|ll|m|re|s|t|ve))?",je="(?:['’](?:D|LL|M|RE|S|T|VE))?",We="(?:"+Ne+"|"+Be+")"+"?",qe="[\\ufe0e\\ufe0f]?",Ye=qe+We+("(?:\\u200d(?:"+[De,Ve,$e].join("|")+")"+qe+We+")*"),Xe="(?:"+[Re,Ve,$e].join("|")+")"+Ye,Ke="(?:"+[De+Ne+"?",Ne,Ve,$e,Me].join("|")+")",Ze=RegExp(Ce,"g"),Je=RegExp(Ne,"g"),Qe=RegExp(Be+"(?="+Be+")|"+Ke+Ye,"g"),et=RegExp([Ge+"?"+Fe+"+"+Ue+"(?="+[Ie,Ge,"$"].join("|")+")",He+"+"+je+"(?="+[Ie,Ge+ze,"$"].join("|")+")",Ge+"?"+ze+"+"+Ue,Ge+"+"+je,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Le,Xe].join("|"),"g"),tt=RegExp("[\\u200d\\ud800-\\udfff"+we+Pe+"]"),nt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,it=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rt=-1,at={};at[F]=at[O]=at[B]=at[D]=at[V]=at[$]=at[G]=at[z]=at[H]=!0,at[g]=at[y]=at[L]=at[b]=at[R]=at[_]=at[S]=at[x]=at[k]=at[E]=at[T]=at[A]=at[C]=at[M]=at[N]=!1;var st={};st[g]=st[y]=st[L]=st[R]=st[b]=st[_]=st[F]=st[O]=st[B]=st[D]=st[V]=st[k]=st[E]=st[T]=st[A]=st[C]=st[M]=st[I]=st[$]=st[G]=st[z]=st[H]=!0,st[S]=st[x]=st[N]=!1;var ot={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},lt=parseFloat,ut=parseInt,ct="object"==_typeof3(commonjsGlobal$1)&&commonjsGlobal$1&&commonjsGlobal$1.Object===Object&&commonjsGlobal$1,ht="object"==("undefined"==typeof self?"undefined":_typeof3(self))&&self&&self.Object===Object&&self,ft=ct||ht||Function("return this")(),dt=n&&!n.nodeType&&n,pt=dt&&t&&!t.nodeType&&t,mt=pt&&pt.exports===dt,vt=mt&&ct.process,gt=function(){try{var t=pt&&pt.require&&pt.require("util").types;return t||vt&&vt.binding&&vt.binding("util")}catch(e){}}(),yt=gt&>.isArrayBuffer,bt=gt&>.isDate,_t=gt&>.isMap,St=gt&>.isRegExp,xt=gt&>.isSet,wt=gt&>.isTypedArray;function kt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Et(e,t,n,i){for(var r=-1,a=null==e?0:e.length;++r-1}function It(e,t,n){for(var i=-1,r=null==e?0:e.length;++i-1;);return n}function en(e,t){for(var n=e.length;n--&&$t(t,e[n],0)>-1;);return n}function tn(e,t){for(var n=e.length,i=0;n--;)e[n]===t&&++i;return i}var nn=jt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),rn=jt({"&":"&","<":"<",">":">",'"':""","'":"'"});function an(e){return"\\"+ot[e]}function sn(e){return tt.test(e)}function on(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n}function ln(e,t){return function(n){return e(t(n))}}function un(e,t){for(var n=-1,i=e.length,r=0,a=[];++n",""":'"',"'":"'"});var vn=function t(n){var se,we=(n=null==n?ft:vn.defaults(ft.Object(),n,vn.pick(ft,it))).Array,ke=n.Date,Ee=n.Error,Te=n.Function,Pe=n.Math,Ae=n.Object,Ce=n.RegExp,Me=n.String,Ie=n.TypeError,Ne=we.prototype,Le=Te.prototype,Re=Ae.prototype,Fe=n["__core-js_shared__"],Oe=Le.toString,Be=Re.hasOwnProperty,De=0,Ve=(se=/[^.]+$/.exec(Fe&&Fe.keys&&Fe.keys.IE_PROTO||""))?"Symbol(src)_1."+se:"",$e=Re.toString,Ge=Oe.call(Ae),ze=ft._,He=Ce("^"+Oe.call(Be).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ue=mt?n.Buffer:i,je=n.Symbol,We=n.Uint8Array,qe=Ue?Ue.allocUnsafe:i,Ye=ln(Ae.getPrototypeOf,Ae),Xe=Ae.create,Ke=Re.propertyIsEnumerable,Qe=Ne.splice,tt=je?je.isConcatSpreadable:i,ot=je?je.iterator:i,ct=je?je.toStringTag:i,ht=function(){try{var t=pa(Ae,"defineProperty");return t({},"",{}),t}catch(e){}}(),dt=n.clearTimeout!==ft.clearTimeout&&n.clearTimeout,pt=ke&&ke.now!==ft.Date.now&&ke.now,vt=n.setTimeout!==ft.setTimeout&&n.setTimeout,gt=Pe.ceil,Bt=Pe.floor,jt=Ae.getOwnPropertySymbols,gn=Ue?Ue.isBuffer:i,yn=n.isFinite,bn=Ne.join,_n=ln(Ae.keys,Ae),Sn=Pe.max,xn=Pe.min,wn=ke.now,kn=n.parseInt,En=Pe.random,Tn=Ne.reverse,Pn=pa(n,"DataView"),An=pa(n,"Map"),Cn=pa(n,"Promise"),Mn=pa(n,"Set"),In=pa(n,"WeakMap"),Nn=pa(Ae,"create"),Ln=In&&new In,Rn={},Fn=Ga(Pn),On=Ga(An),Bn=Ga(Cn),Dn=Ga(Mn),Vn=Ga(In),$n=je?je.prototype:i,Gn=$n?$n.valueOf:i,zn=$n?$n.toString:i;function Hn(e){if(ro(e)&&!qs(e)&&!(e instanceof qn)){if(e instanceof Wn)return e;if(Be.call(e,"__wrapped__"))return za(e)}return new Wn(e)}var Un=function(){function e(){}return function(t){if(!io(t))return{};if(Xe)return Xe(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function jn(){}function Wn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function qn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m,this.__views__=[]}function Yn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function hi(e,t,n,r,a,s){var o,l=1&t,u=2&t,c=4&t;if(n&&(o=a?n(e,r,a,s):n(e)),o!==i)return o;if(!io(e))return e;var h=qs(e);if(h){if(o=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Be.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return Nr(e,o)}else{var f=ga(e),d=f==x||f==w;if(Zs(e))return Tr(e,l);if(f==T||f==g||d&&!a){if(o=u||d?{}:ba(e),!l)return u?function(e,t){return Lr(e,va(e),t)}(e,function(e,t){return e&&Lr(t,Oo(t),e)}(o,e)):function(e,t){return Lr(e,ma(e),t)}(e,oi(o,e))}else{if(!st[f])return a?e:{};o=function(e,t,n){var i=e.constructor;switch(t){case L:return Pr(e);case b:case _:return new i(+e);case R:return function(e,t){var n=t?Pr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case F:case O:case B:case D:case V:case $:case G:case z:case H:return Ar(e,n);case k:return new i;case E:case M:return new i(e);case A:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case C:return new i;case I:return r=e,Gn?Ae(Gn.call(r)):{}}var r}(e,f,l)}}s||(s=new Jn);var p=s.get(e);if(p)return p;s.set(e,o),uo(e)?e.forEach((function(i){o.add(hi(i,t,n,i,e,s))})):ao(e)&&e.forEach((function(i,r){o.set(r,hi(i,t,n,r,e,s))}));var m=h?i:(c?u?oa:sa:u?Oo:Fo)(e);return Tt(m||e,(function(i,r){m&&(i=e[r=i]),ri(o,r,hi(i,t,n,r,e,s))})),o}function fi(e,t,n){var r=n.length;if(null==e)return!r;for(e=Ae(e);r--;){var a=n[r],s=t[a],o=e[a];if(o===i&&!(a in e)||!s(o))return!1}return!0}function di(e,t,n){if("function"!=typeof e)throw new Ie(r);return Ra((function(){e.apply(i,n)}),t)}function pi(e,t,n,i){var r=-1,a=Mt,s=!0,o=e.length,l=[],u=t.length;if(!o)return l;n&&(t=Nt(t,Kt(n))),i?(a=It,s=!1):t.length>=200&&(a=Jt,s=!1,t=new Zn(t));e:for(;++r-1},Xn.prototype.set=function(e,t){var n=this.__data__,i=ai(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this},Kn.prototype.clear=function(){this.size=0,this.__data__={hash:new Yn,map:new(An||Xn),string:new Yn}},Kn.prototype.delete=function(e){var t=fa(this,e).delete(e);return this.size-=t?1:0,t},Kn.prototype.get=function(e){return fa(this,e).get(e)},Kn.prototype.has=function(e){return fa(this,e).has(e)},Kn.prototype.set=function(e,t){var n=fa(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this},Zn.prototype.add=Zn.prototype.push=function(e){return this.__data__.set(e,a),this},Zn.prototype.has=function(e){return this.__data__.has(e)},Jn.prototype.clear=function(){this.__data__=new Xn,this.size=0},Jn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Jn.prototype.get=function(e){return this.__data__.get(e)},Jn.prototype.has=function(e){return this.__data__.has(e)},Jn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Xn){var i=n.__data__;if(!An||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new Kn(i)}return n.set(e,t),this.size=n.size,this};var mi=Or(wi),vi=Or(ki,!0);function gi(e,t){var n=!0;return mi(e,(function(e,i,r){return n=!!t(e,i,r)})),n}function yi(e,t,n){for(var r=-1,a=e.length;++r0&&n(o)?t>1?_i(o,t-1,n,i,r):Lt(r,o):i||(r[r.length]=o)}return r}var Si=Br(),xi=Br(!0);function wi(e,t){return e&&Si(e,t,Fo)}function ki(e,t){return e&&xi(e,t,Fo)}function Ei(e,t){return Ct(t,(function(t){return eo(e[t])}))}function Ti(e,t){for(var n=0,r=(t=xr(t,e)).length;null!=e&&nt}function Mi(e,t){return null!=e&&Be.call(e,t)}function Ii(e,t){return null!=e&&t in Ae(e)}function Ni(e,t,n){for(var r=n?It:Mt,a=e[0].length,s=e.length,o=s,l=we(s),u=1/0,c=[];o--;){var h=e[o];o&&t&&(h=Nt(h,Kt(t))),u=xn(h.length,u),l[o]=!n&&(t||a>=120&&h.length>=120)?new Zn(o&&h):i}h=e[0];var f=-1,d=l[0];e:for(;++f=o?l:l*("desc"==n[i]?-1:1)}return e.index-t.index}(e,t,n)}))}function Yi(e,t,n){for(var i=-1,r=t.length,a={};++i-1;)o!==e&&Qe.call(o,l,1),Qe.call(e,l,1);return e}function Ki(e,t){for(var n=e?t.length:0,i=n-1;n--;){var r=t[n];if(n==i||r!==a){var a=r;Sa(r)?Qe.call(e,r,1):pr(e,r)}}return e}function Zi(e,t){return e+Bt(En()*(t-e+1))}function Ji(e,t){var n="";if(!e||t<1||t>d)return n;do{t%2&&(n+=e),(t=Bt(t/2))&&(e+=e)}while(t);return n}function Qi(e,t){return Fa(Ca(e,t,ol),e+"")}function er(e){return ei(Uo(e))}function tr(e,t){var n=Uo(e);return Da(n,ci(t,0,n.length))}function nr(e,t,n,r){if(!io(e))return e;for(var a=-1,s=(t=xr(t,e)).length,o=s-1,l=e;null!=l&&++ar?0:r+t),(n=n>r?r:n)<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var a=we(r);++i>>1,s=e[a];null!==s&&!ho(s)&&(n?s<=t:s=200){var u=t?null:Jr(e);if(u)return cn(u);s=!1,r=Jt,l=new Zn}else l=t?[]:o;e:for(;++i=r?e:sr(e,t,n)}var Er=dt||function(e){return ft.clearTimeout(e)};function Tr(e,t){if(t)return e.slice();var n=e.length,i=qe?qe(n):new e.constructor(n);return e.copy(i),i}function Pr(e){var t=new e.constructor(e.byteLength);return new We(t).set(new We(e)),t}function Ar(e,t){var n=t?Pr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Cr(e,t){if(e!==t){var n=e!==i,r=null===e,a=e==e,s=ho(e),o=t!==i,l=null===t,u=t==t,c=ho(t);if(!l&&!c&&!s&&e>t||s&&o&&u&&!l&&!c||r&&o&&u||!n&&u||!a)return 1;if(!r&&!s&&!c&&e1?n[a-1]:i,o=a>2?n[2]:i;for(s=e.length>3&&"function"==typeof s?(a--,s):i,o&&xa(n[0],n[1],o)&&(s=a<3?i:s,a=1),t=Ae(t);++r-1?a[s?t[o]:o]:i}}function zr(e){return aa((function(t){var n=t.length,a=n,s=Wn.prototype.thru;for(e&&t.reverse();a--;){var o=t[a];if("function"!=typeof o)throw new Ie(r);if(s&&!l&&"wrapper"==ua(o))var l=new Wn([],!0)}for(a=l?a:n;++a1&&y.reverse(),f&&ul))return!1;var c=s.get(e),h=s.get(t);if(c&&h)return c==t&&h==e;var f=-1,d=!0,p=2&n?new Zn:i;for(s.set(e,t),s.set(t,e);++f-1&&e%1==0&&e1?"& ":"")+t[i],t=t.join(n>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(i,function(e,t){return Tt(v,(function(n){var i="_."+n[0];t&n[1]&&!Mt(e,i)&&e.push(i)})),e.sort()}(function(e){var t=e.match(le);return t?t[1].split(ue):[]}(i),n)))}function Ba(e){var t=0,n=0;return function(){var r=wn(),a=16-(r-n);if(n=r,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Da(e,t){var n=-1,r=e.length,a=r-1;for(t=t===i?r:t;++n1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,ls(e,n)}));function ms(e){var t=Hn(e);return t.__chain__=!0,t}function vs(e,t){return t(e)}var gs=aa((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,a=function(t){return ui(t,e)};return!(t>1||this.__actions__.length)&&r instanceof qn&&Sa(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:vs,args:[a],thisArg:i}),new Wn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(a)}));var ys=Rr((function(e,t,n){Be.call(e,n)?++e[n]:li(e,n,1)}));var bs=Gr(Wa),_s=Gr(qa);function Ss(e,t){return(qs(e)?Tt:mi)(e,ha(t,3))}function xs(e,t){return(qs(e)?Pt:vi)(e,ha(t,3))}var ws=Rr((function(e,t,n){Be.call(e,n)?e[n].push(t):li(e,n,[t])}));var ks=Qi((function(e,t,n){var i=-1,r="function"==typeof t,a=Xs(e)?we(e.length):[];return mi(e,(function(e){a[++i]=r?kt(t,e,n):Li(e,t,n)})),a})),Es=Rr((function(e,t,n){li(e,n,t)}));function Ts(e,t){return(qs(e)?Nt:zi)(e,ha(t,3))}var Ps=Rr((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var As=Qi((function(e,t){if(null==e)return[];var n=t.length;return n>1&&xa(e,t[0],t[1])?t=[]:n>2&&xa(t[0],t[1],t[2])&&(t=[t[0]]),qi(e,_i(t,1),[])})),Cs=pt||function(){return ft.Date.now()};function Ms(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,ea(e,c,i,i,i,i,t)}function Is(e,t){var n;if("function"!=typeof t)throw new Ie(r);return e=yo(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var Ns=Qi((function(e,t,n){var i=1;if(n.length){var r=un(n,ca(Ns));i|=l}return ea(e,i,t,n,r)})),Ls=Qi((function(e,t,n){var i=3;if(n.length){var r=un(n,ca(Ls));i|=l}return ea(t,i,e,n,r)}));function Rs(e,t,n){var a,s,o,l,u,c,h=0,f=!1,d=!1,p=!0;if("function"!=typeof e)throw new Ie(r);function m(t){var n=a,r=s;return a=s=i,h=t,l=e.apply(r,n)}function v(e){return h=e,u=Ra(y,t),f?m(e):l}function g(e){var n=e-c;return c===i||n>=t||n<0||d&&e-h>=o}function y(){var e=Cs();if(g(e))return b(e);u=Ra(y,function(e){var n=t-(e-c);return d?xn(n,o-(e-h)):n}(e))}function b(e){return u=i,p&&a?m(e):(a=s=i,l)}function _(){var e=Cs(),n=g(e);if(a=arguments,s=this,c=e,n){if(u===i)return v(c);if(d)return Er(u),u=Ra(y,t),m(c)}return u===i&&(u=Ra(y,t)),l}return t=_o(t)||0,io(n)&&(f=!!n.leading,o=(d="maxWait"in n)?Sn(_o(n.maxWait)||0,t):o,p="trailing"in n?!!n.trailing:p),_.cancel=function(){u!==i&&Er(u),h=0,a=c=s=u=i},_.flush=function(){return u===i?l:b(Cs())},_}var Fs=Qi((function(e,t){return di(e,1,t)})),Os=Qi((function(e,t,n){return di(e,_o(t)||0,n)}));function Bs(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ie(r);var n=function n(){var i=arguments,r=t?t.apply(this,i):i[0],a=n.cache;if(a.has(r))return a.get(r);var s=e.apply(this,i);return n.cache=a.set(r,s)||a,s};return n.cache=new(Bs.Cache||Kn),n}function Ds(e){if("function"!=typeof e)throw new Ie(r);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Bs.Cache=Kn;var Vs=wr((function(e,t){var n=(t=1==t.length&&qs(t[0])?Nt(t[0],Kt(ha())):Nt(_i(t,1),Kt(ha()))).length;return Qi((function(i){for(var r=-1,a=xn(i.length,n);++r=t})),Ws=Ri(function(){return arguments}())?Ri:function(e){return ro(e)&&Be.call(e,"callee")&&!Ke.call(e,"callee")},qs=we.isArray,Ys=yt?Kt(yt):function(e){return ro(e)&&Ai(e)==L};function Xs(e){return null!=e&&no(e.length)&&!eo(e)}function Ks(e){return ro(e)&&Xs(e)}var Zs=gn||_l,Js=bt?Kt(bt):function(e){return ro(e)&&Ai(e)==_};function Qs(e){if(!ro(e))return!1;var t=Ai(e);return t==S||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!oo(e)}function eo(e){if(!io(e))return!1;var t=Ai(e);return t==x||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function to(e){return"number"==typeof e&&e==yo(e)}function no(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function io(e){var t=_typeof3(e);return null!=e&&("object"==t||"function"==t)}function ro(e){return null!=e&&"object"==_typeof3(e)}var ao=_t?Kt(_t):function(e){return ro(e)&&ga(e)==k};function so(e){return"number"==typeof e||ro(e)&&Ai(e)==E}function oo(e){if(!ro(e)||Ai(e)!=T)return!1;var t=Ye(e);if(null===t)return!0;var n=Be.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Oe.call(n)==Ge}var lo=St?Kt(St):function(e){return ro(e)&&Ai(e)==A};var uo=xt?Kt(xt):function(e){return ro(e)&&ga(e)==C};function co(e){return"string"==typeof e||!qs(e)&&ro(e)&&Ai(e)==M}function ho(e){return"symbol"==_typeof3(e)||ro(e)&&Ai(e)==I}var fo=wt?Kt(wt):function(e){return ro(e)&&no(e.length)&&!!at[Ai(e)]};var po=Xr(Gi),mo=Xr((function(e,t){return e<=t}));function vo(e){if(!e)return[];if(Xs(e))return co(e)?dn(e):Nr(e);if(ot&&e[ot])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[ot]());var t=ga(e);return(t==k?on:t==C?cn:Uo)(e)}function go(e){return e?(e=_o(e))===f||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function yo(e){var t=go(e),n=t%1;return t==t?n?t-n:t:0}function bo(e){return e?ci(yo(e),0,m):0}function _o(e){if("number"==typeof e)return e;if(ho(e))return p;if(io(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=io(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Xt(e);var n=ve.test(e);return n||ye.test(e)?ut(e.slice(2),n?2:8):me.test(e)?p:+e}function So(e){return Lr(e,Oo(e))}function xo(e){return null==e?"":fr(e)}var wo=Fr((function(e,t){if(Ta(t)||Xs(t))Lr(t,Fo(t),e);else for(var n in t)Be.call(t,n)&&ri(e,n,t[n])})),ko=Fr((function(e,t){Lr(t,Oo(t),e)})),Eo=Fr((function(e,t,n,i){Lr(t,Oo(t),e,i)})),To=Fr((function(e,t,n,i){Lr(t,Fo(t),e,i)})),Po=aa(ui);var Ao=Qi((function(e,t){e=Ae(e);var n=-1,r=t.length,a=r>2?t[2]:i;for(a&&xa(t[0],t[1],a)&&(r=1);++n1),t})),Lr(e,oa(e),n),i&&(n=hi(n,7,ia));for(var r=t.length;r--;)pr(n,t[r]);return n}));var $o=aa((function(e,t){return null==e?{}:function(e,t){return Yi(e,t,(function(t,n){return Io(e,n)}))}(e,t)}));function Go(e,t){if(null==e)return{};var n=Nt(oa(e),(function(e){return[e]}));return t=ha(t),Yi(e,n,(function(e,n){return t(e,n[0])}))}var zo=Qr(Fo),Ho=Qr(Oo);function Uo(e){return null==e?[]:Zt(e,Fo(e))}var jo=Vr((function(e,t,n){return t=t.toLowerCase(),e+(n?Wo(t):t)}));function Wo(e){return el(xo(e).toLowerCase())}function qo(e){return(e=xo(e))&&e.replace(_e,nn).replace(Je,"")}var Yo=Vr((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Xo=Vr((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ko=Dr("toLowerCase");var Zo=Vr((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Jo=Vr((function(e,t,n){return e+(n?" ":"")+el(t)}));var Qo=Vr((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),el=Dr("toUpperCase");function tl(e,t,n){return e=xo(e),(t=n?i:t)===i?function(e){return nt.test(e)}(e)?function(e){return e.match(et)||[]}(e):function(e){return e.match(ce)||[]}(e):e.match(t)||[]}var nl=Qi((function(t,n){try{return kt(t,i,n)}catch(e){return Qs(e)?e:new Ee(e)}})),il=aa((function(e,t){return Tt(t,(function(t){t=$a(t),li(e,t,Ns(e[t],e))})),e}));function rl(e){return function(){return e}}var al=zr(),sl=zr(!0);function ol(e){return e}function ll(e){return Di("function"==typeof e?e:hi(e,1))}var ul=Qi((function(e,t){return function(n){return Li(n,e,t)}})),cl=Qi((function(e,t){return function(n){return Li(e,n,t)}}));function hl(e,t,n){var i=Fo(t),r=Ei(t,i);null!=n||io(t)&&(r.length||!i.length)||(n=t,t=e,e=this,r=Ei(t,Fo(t)));var a=!(io(n)&&"chain"in n&&!n.chain),s=eo(e);return Tt(r,(function(n){var i=t[n];e[n]=i,s&&(e.prototype[n]=function(){var t=this.__chain__;if(a||t){var n=e(this.__wrapped__),r=n.__actions__=Nr(this.__actions__);return r.push({func:i,args:arguments,thisArg:e}),n.__chain__=t,n}return i.apply(e,Lt([this.value()],arguments))})})),e}function fl(){}var dl=Wr(Nt),pl=Wr(At),ml=Wr(Ot);function vl(e){return wa(e)?Ut($a(e)):function(e){return function(t){return Ti(t,e)}}(e)}var gl=Yr(),yl=Yr(!0);function bl(){return[]}function _l(){return!1}var Sl=jr((function(e,t){return e+t}),0),xl=Zr("ceil"),wl=jr((function(e,t){return e/t}),1),kl=Zr("floor");var El,Tl=jr((function(e,t){return e*t}),1),Pl=Zr("round"),Al=jr((function(e,t){return e-t}),0);return Hn.after=function(e,t){if("function"!=typeof t)throw new Ie(r);return e=yo(e),function(){if(--e<1)return t.apply(this,arguments)}},Hn.ary=Ms,Hn.assign=wo,Hn.assignIn=ko,Hn.assignInWith=Eo,Hn.assignWith=To,Hn.at=Po,Hn.before=Is,Hn.bind=Ns,Hn.bindAll=il,Hn.bindKey=Ls,Hn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return qs(e)?e:[e]},Hn.chain=ms,Hn.chunk=function(e,t,n){t=(n?xa(e,t,n):t===i)?1:Sn(yo(t),0);var r=null==e?0:e.length;if(!r||t<1)return[];for(var a=0,s=0,o=we(gt(r/t));aa?0:a+n),(r=r===i||r>a?a:yo(r))<0&&(r+=a),r=n>r?0:bo(r);n>>0)?(e=xo(e))&&("string"==typeof t||null!=t&&!lo(t))&&!(t=fr(t))&&sn(e)?kr(dn(e),0,n):e.split(t,n):[]},Hn.spread=function(e,t){if("function"!=typeof e)throw new Ie(r);return t=null==t?0:Sn(yo(t),0),Qi((function(n){var i=n[t],r=kr(n,0,t);return i&&Lt(r,i),kt(e,this,r)}))},Hn.tail=function(e){var t=null==e?0:e.length;return t?sr(e,1,t):[]},Hn.take=function(e,t,n){return e&&e.length?sr(e,0,(t=n||t===i?1:yo(t))<0?0:t):[]},Hn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?sr(e,(t=r-(t=n||t===i?1:yo(t)))<0?0:t,r):[]},Hn.takeRightWhile=function(e,t){return e&&e.length?vr(e,ha(t,3),!1,!0):[]},Hn.takeWhile=function(e,t){return e&&e.length?vr(e,ha(t,3)):[]},Hn.tap=function(e,t){return t(e),e},Hn.throttle=function(e,t,n){var i=!0,a=!0;if("function"!=typeof e)throw new Ie(r);return io(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),Rs(e,t,{leading:i,maxWait:t,trailing:a})},Hn.thru=vs,Hn.toArray=vo,Hn.toPairs=zo,Hn.toPairsIn=Ho,Hn.toPath=function(e){return qs(e)?Nt(e,$a):ho(e)?[e]:Nr(Va(xo(e)))},Hn.toPlainObject=So,Hn.transform=function(e,t,n){var i=qs(e),r=i||Zs(e)||fo(e);if(t=ha(t,4),null==n){var a=e&&e.constructor;n=r?i?new a:[]:io(e)&&eo(a)?Un(Ye(e)):{}}return(r?Tt:wi)(e,(function(e,i,r){return t(n,e,i,r)})),n},Hn.unary=function(e){return Ms(e,1)},Hn.union=rs,Hn.unionBy=as,Hn.unionWith=ss,Hn.uniq=function(e){return e&&e.length?dr(e):[]},Hn.uniqBy=function(e,t){return e&&e.length?dr(e,ha(t,2)):[]},Hn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?dr(e,i,t):[]},Hn.unset=function(e,t){return null==e||pr(e,t)},Hn.unzip=os,Hn.unzipWith=ls,Hn.update=function(e,t,n){return null==e?e:mr(e,t,Sr(n))},Hn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:mr(e,t,Sr(n),r)},Hn.values=Uo,Hn.valuesIn=function(e){return null==e?[]:Zt(e,Oo(e))},Hn.without=us,Hn.words=tl,Hn.wrap=function(e,t){return $s(Sr(t),e)},Hn.xor=cs,Hn.xorBy=hs,Hn.xorWith=fs,Hn.zip=ds,Hn.zipObject=function(e,t){return br(e||[],t||[],ri)},Hn.zipObjectDeep=function(e,t){return br(e||[],t||[],nr)},Hn.zipWith=ps,Hn.entries=zo,Hn.entriesIn=Ho,Hn.extend=ko,Hn.extendWith=Eo,hl(Hn,Hn),Hn.add=Sl,Hn.attempt=nl,Hn.camelCase=jo,Hn.capitalize=Wo,Hn.ceil=xl,Hn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=_o(n))==n?n:0),t!==i&&(t=(t=_o(t))==t?t:0),ci(_o(e),t,n)},Hn.clone=function(e){return hi(e,4)},Hn.cloneDeep=function(e){return hi(e,5)},Hn.cloneDeepWith=function(e,t){return hi(e,5,t="function"==typeof t?t:i)},Hn.cloneWith=function(e,t){return hi(e,4,t="function"==typeof t?t:i)},Hn.conformsTo=function(e,t){return null==t||fi(e,t,Fo(t))},Hn.deburr=qo,Hn.defaultTo=function(e,t){return null==e||e!=e?t:e},Hn.divide=wl,Hn.endsWith=function(e,t,n){e=xo(e),t=fr(t);var r=e.length,a=n=n===i?r:ci(yo(n),0,r);return(n-=t.length)>=0&&e.slice(n,a)==t},Hn.eq=Hs,Hn.escape=function(e){return(e=xo(e))&&K.test(e)?e.replace(Y,rn):e},Hn.escapeRegExp=function(e){return(e=xo(e))&&re.test(e)?e.replace(ie,"\\$&"):e},Hn.every=function(e,t,n){var r=qs(e)?At:gi;return n&&xa(e,t,n)&&(t=i),r(e,ha(t,3))},Hn.find=bs,Hn.findIndex=Wa,Hn.findKey=function(e,t){return Dt(e,ha(t,3),wi)},Hn.findLast=_s,Hn.findLastIndex=qa,Hn.findLastKey=function(e,t){return Dt(e,ha(t,3),ki)},Hn.floor=kl,Hn.forEach=Ss,Hn.forEachRight=xs,Hn.forIn=function(e,t){return null==e?e:Si(e,ha(t,3),Oo)},Hn.forInRight=function(e,t){return null==e?e:xi(e,ha(t,3),Oo)},Hn.forOwn=function(e,t){return e&&wi(e,ha(t,3))},Hn.forOwnRight=function(e,t){return e&&ki(e,ha(t,3))},Hn.get=Mo,Hn.gt=Us,Hn.gte=js,Hn.has=function(e,t){return null!=e&&ya(e,t,Mi)},Hn.hasIn=Io,Hn.head=Xa,Hn.identity=ol,Hn.includes=function(e,t,n,i){e=Xs(e)?e:Uo(e),n=n&&!i?yo(n):0;var r=e.length;return n<0&&(n=Sn(r+n,0)),co(e)?n<=r&&e.indexOf(t,n)>-1:!!r&&$t(e,t,n)>-1},Hn.indexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var r=null==n?0:yo(n);return r<0&&(r=Sn(i+r,0)),$t(e,t,r)},Hn.inRange=function(e,t,n){return t=go(t),n===i?(n=t,t=0):n=go(n),function(e,t,n){return e>=xn(t,n)&&e=-9007199254740991&&e<=d},Hn.isSet=uo,Hn.isString=co,Hn.isSymbol=ho,Hn.isTypedArray=fo,Hn.isUndefined=function(e){return e===i},Hn.isWeakMap=function(e){return ro(e)&&ga(e)==N},Hn.isWeakSet=function(e){return ro(e)&&"[object WeakSet]"==Ai(e)},Hn.join=function(e,t){return null==e?"":bn.call(e,t)},Hn.kebabCase=Yo,Hn.last=Qa,Hn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var a=r;return n!==i&&(a=(a=yo(n))<0?Sn(r+a,0):xn(a,r-1)),t==t?function(e,t,n){for(var i=n+1;i--;)if(e[i]===t)return i;return i}(e,t,a):Vt(e,zt,a,!0)},Hn.lowerCase=Xo,Hn.lowerFirst=Ko,Hn.lt=po,Hn.lte=mo,Hn.max=function(e){return e&&e.length?yi(e,ol,Ci):i},Hn.maxBy=function(e,t){return e&&e.length?yi(e,ha(t,2),Ci):i},Hn.mean=function(e){return Ht(e,ol)},Hn.meanBy=function(e,t){return Ht(e,ha(t,2))},Hn.min=function(e){return e&&e.length?yi(e,ol,Gi):i},Hn.minBy=function(e,t){return e&&e.length?yi(e,ha(t,2),Gi):i},Hn.stubArray=bl,Hn.stubFalse=_l,Hn.stubObject=function(){return{}},Hn.stubString=function(){return""},Hn.stubTrue=function(){return!0},Hn.multiply=Tl,Hn.nth=function(e,t){return e&&e.length?Wi(e,yo(t)):i},Hn.noConflict=function(){return ft._===this&&(ft._=ze),this},Hn.noop=fl,Hn.now=Cs,Hn.pad=function(e,t,n){e=xo(e);var i=(t=yo(t))?fn(e):0;if(!t||i>=t)return e;var r=(t-i)/2;return qr(Bt(r),n)+e+qr(gt(r),n)},Hn.padEnd=function(e,t,n){e=xo(e);var i=(t=yo(t))?fn(e):0;return t&&it){var r=e;e=t,t=r}if(n||e%1||t%1){var a=En();return xn(e+a*(t-e+lt("1e-"+((a+"").length-1))),t)}return Zi(e,t)},Hn.reduce=function(e,t,n){var i=qs(e)?Rt:Wt,r=arguments.length<3;return i(e,ha(t,4),n,r,mi)},Hn.reduceRight=function(e,t,n){var i=qs(e)?Ft:Wt,r=arguments.length<3;return i(e,ha(t,4),n,r,vi)},Hn.repeat=function(e,t,n){return t=(n?xa(e,t,n):t===i)?1:yo(t),Ji(xo(e),t)},Hn.replace=function(){var e=arguments,t=xo(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Hn.result=function(e,t,n){var r=-1,a=(t=xr(t,e)).length;for(a||(a=1,e=i);++rd)return[];var n=m,i=xn(e,m);t=ha(t),e-=m;for(var r=Yt(i,t);++n=s)return e;var l=n-fn(r);if(l<1)return r;var u=o?kr(o,0,l).join(""):e.slice(0,l);if(a===i)return u+r;if(o&&(l+=u.length-l),lo(a)){if(e.slice(l).search(a)){var c,h=u;for(a.global||(a=Ce(a.source,xo(pe.exec(a))+"g")),a.lastIndex=0;c=a.exec(h);)var f=c.index;u=u.slice(0,f===i?l:f)}}else if(e.indexOf(fr(a),l)!=l){var d=u.lastIndexOf(a);d>-1&&(u=u.slice(0,d))}return u+r},Hn.unescape=function(e){return(e=xo(e))&&X.test(e)?e.replace(q,mn):e},Hn.uniqueId=function(e){var t=++De;return xo(e)+t},Hn.upperCase=Qo,Hn.upperFirst=el,Hn.each=Ss,Hn.eachRight=xs,Hn.first=Xa,hl(Hn,(El={},wi(Hn,(function(e,t){Be.call(Hn.prototype,t)||(El[t]=e)})),El),{chain:!1}),Hn.VERSION="4.17.21",Tt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Hn[e].placeholder=Hn})),Tt(["drop","take"],(function(e,t){qn.prototype[e]=function(n){n=n===i?1:Sn(yo(n),0);var r=this.__filtered__&&!t?new qn(this):this.clone();return r.__filtered__?r.__takeCount__=xn(n,r.__takeCount__):r.__views__.push({size:xn(n,m),type:e+(r.__dir__<0?"Right":"")}),r},qn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Tt(["filter","map","takeWhile"],(function(e,t){var n=t+1,i=1==n||3==n;qn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:ha(e,3),type:n}),t.__filtered__=t.__filtered__||i,t}})),Tt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");qn.prototype[e]=function(){return this[n](1).value()[0]}})),Tt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");qn.prototype[e]=function(){return this.__filtered__?new qn(this):this[n](1)}})),qn.prototype.compact=function(){return this.filter(ol)},qn.prototype.find=function(e){return this.filter(e).head()},qn.prototype.findLast=function(e){return this.reverse().find(e)},qn.prototype.invokeMap=Qi((function(e,t){return"function"==typeof e?new qn(this):this.map((function(n){return Li(n,e,t)}))})),qn.prototype.reject=function(e){return this.filter(Ds(ha(e)))},qn.prototype.slice=function(e,t){e=yo(e);var n=this;return n.__filtered__&&(e>0||t<0)?new qn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=yo(t))<0?n.dropRight(-t):n.take(t-e)),n)},qn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},qn.prototype.toArray=function(){return this.take(m)},wi(qn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),a=Hn[r?"take"+("last"==t?"Right":""):t],s=r||/^find/.test(t);a&&(Hn.prototype[t]=function(){var t=this.__wrapped__,o=r?[1]:arguments,l=t instanceof qn,u=o[0],c=l||qs(t),h=function(e){var t=a.apply(Hn,Lt([e],o));return r&&f?t[0]:t};c&&n&&"function"==typeof u&&1!=u.length&&(l=c=!1);var f=this.__chain__,d=!!this.__actions__.length,p=s&&!f,m=l&&!d;if(!s&&c){t=m?t:new qn(this);var v=e.apply(t,o);return v.__actions__.push({func:vs,args:[h],thisArg:i}),new Wn(v,f)}return p&&m?e.apply(this,o):(v=this.thru(h),p?r?v.value()[0]:v.value():v)})})),Tt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ne[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",i=/^(?:pop|shift)$/.test(e);Hn.prototype[e]=function(){var e=arguments;if(i&&!this.__chain__){var r=this.value();return t.apply(qs(r)?r:[],e)}return this[n]((function(n){return t.apply(qs(n)?n:[],e)}))}})),wi(qn.prototype,(function(e,t){var n=Hn[t];if(n){var i=n.name+"";Be.call(Rn,i)||(Rn[i]=[]),Rn[i].push({name:t,func:n})}})),Rn[Hr(i,2).name]=[{name:"wrapper",func:i}],qn.prototype.clone=function(){var e=new qn(this.__wrapped__);return e.__actions__=Nr(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Nr(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Nr(this.__views__),e},qn.prototype.reverse=function(){if(this.__filtered__){var e=new qn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},qn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=qs(e),i=t<0,r=n?e.length:0,a=function(e,t,n){var i=-1,r=n.length;for(;++i=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Hn.prototype.plant=function(e){for(var t,n=this;n instanceof jn;){var r=za(n);r.__index__=0,r.__values__=i,t?a.__wrapped__=r:t=r;var a=r;n=n.__wrapped__}return a.__wrapped__=e,t},Hn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof qn){var t=e;return this.__actions__.length&&(t=new qn(this)),(t=t.reverse()).__actions__.push({func:vs,args:[is],thisArg:i}),new Wn(t,this.__chain__)}return this.thru(is)},Hn.prototype.toJSON=Hn.prototype.valueOf=Hn.prototype.value=function(){return gr(this.__wrapped__,this.__actions__)},Hn.prototype.first=Hn.prototype.head,ot&&(Hn.prototype[ot]=function(){return this}),Hn}();pt?((pt.exports=vn)._=vn,dt._=vn):ft._=vn}).call(commonjsGlobal$1)}(lodash,lodash.exports);var browserInfo$5=browser(),getLinkId$1=function(){return location.hash.split("?")[0].split("/").pop()||""},retain=function(e){return Math.ceil(1e6*e)/1e6},formatLyricsEntries=function(e){var t,n,i=[],r=_createForOfIteratorHelper((null===(t=e.parentStaffEntry)||void 0===t?void 0:t.voiceEntries)||[]);try{for(r.s();!(n=r.n()).done;){var a,s=n.value;if(null!==(a=s.lyricsEntries)&&void 0!==a&&a.table)for(var o=Object.values(s.lyricsEntries.table),l=0,u=o;lh)Pe=(null===(Te=i[i.length-1])||void 0===Te?void 0:Te.speed)||100;var Ce=[null===(G=O.sourceMeasure.verticalMeasureList)||void 0===G?void 0:G[0]],Me=u.currentTimeStamp.realValue,Ie=formatDuration(u.currentMeasure.activeTimeSignature,u.currentMeasure.duration),Ne=Ie.RealValue,Le=Ie.Denominator,Re=O.length,Fe=Re.wholeValue,Oe=Re.numerator,Be=Re.denominator,De=(Re.realValue,p),Ve=(state$2.isSpecialBookCategory?getTimeByBeatUnit(g,Pe,u.currentMeasure.activeTimeSignature.Denominator):o)||1,$e=(state$2.isSpecialBookCategory?Pe:o)||1;0===c&&(n+=getFixTime(Ve));var Ge,ze,He=(0===Oe&&O.isRestFlag?Ne:(Fe+Oe)/Be)*Le*(60/Ve),Ue=Ne*Le*(60/Ve);if(["Piano"].includes(null===(z=state$2.activeDetail)||void 0===z?void 0:z.code))He=(u.currentTimeStamp.realValue-S||(0===Oe?Ne:(Fe+Oe)/Be))*Le*(60/Ve);if(O.isRestFlag&&null!==(H=O)&&void 0!==H&&null!==(U=H.sourceMeasure)&&void 0!==U&&U.allRests)w=null===(Ge=O)||void 0===Ge||null===(ze=Ge.sourceMeasure)||void 0===ze?void 0:ze.multipleRestMeasures;w>0&&(w-=1,He=Ue),O.isRestFlag&&He>Ue&&(He=Ue),O.DotsXml&&O.tuplet&&(He*=1.5),x&&(He=1e-7,x=!1,I=!0);var je,We=_createForOfIteratorHelper((null===(j=O.sourceMeasure.staffLinkedExpressions)||void 0===j?void 0:j[0])||[]);try{for(We.s();!(je=We.n()).done;){var qe=je.value;if(qe){var Ye,Xe,Ke=null===(Ye=qe.expressions)||void 0===Ye?void 0:Ye.find((function(e){return"跳过下一个"===e.label}));if(Ke&&Fraction$1.Equal(null===(Xe=O.voiceEntry)||void 0===Xe?void 0:Xe.Timestamp,qe.Timestamp)){x=!0;break}}}}catch(err){We.e(err)}finally{We.f()}S=u.currentTimeStamp.realValue,p+=He,m+=He;var Ze=He+De,Je=O.ParentVoiceEntry.ParentVoice.Parent.SubInstruments[0].fixedKey||0,Qe=null===(W=Ce[0])||void 0===W||null===(q=W.vfVoices[1])||void 0===q?void 0:q.tickables[_];if(i.length&&i[i.length-1].relativeTime===De)continue;if(0===c){var et,tt=getMeasureDurationDiff(u.currentMeasure);if(console.log("diff",tt),tt>0)v=tt*Le*(60/Ve),"MIDI"===(null===(et=state$2.activeDetail)||void 0===et?void 0:et.audioType)&&(v=0),n+=v}var nt={skipMode:I,NoteToGraphicalNoteObjectId:O.NoteToGraphicalNoteObjectId,cursorBox:A,skipNextNote:x,measureNumberPrinted:y,difftime:v,octaveOffset:null===(Y=Ce[0])||void 0===Y?void 0:Y.octaveOffset,frequency:null===(X=O.pitch)||void 0===X?void 0:X.frequency,speed:$e,beatSpeed:Ve,i:c,si:h,stepSpeeds:d,indexOfMeasures:0,measureOpenIndex:a.length-1,measures:f,tempoInBPM:O.sourceMeasure.tempoInBPM,measureLength:Ue,relaMeasureLength:m,id:null==Qe?void 0:Qe.attrs.id,note:O.halfTone+12,relativeTime:retain(De),time:retain(De+n),endtime:retain(Ze+n),relaEndtime:retain(Ze),realValue:Me,halfTone:O.halfTone,voiceEntry:{isStaccato:O.voiceEntry.isStaccato(),Timestamp:_objectSpread2({},O.voiceEntry.Timestamp),ornamentContainer:O.voiceEntry.ornamentContainer?_objectSpread2({},O.voiceEntry.ornamentContainer):""},noteElement:{NoteToGraphicalNoteObjectId:O.NoteToGraphicalNoteObjectId,notehead:O.notehead?{filled:O.notehead.filled,shape:O.notehead.shape,sourceNote:null===(K=O.notehead.sourceNote)||void 0===K?void 0:K.NoteToGraphicalNoteObjectId}:"",noteheadColor:O.noteheadColor,isRestFlag:O.isRestFlag,sourceMeasure:{measureListIndex:null===(Z=O)||void 0===Z||null===(J=Z.SourceMeasure)||void 0===J?void 0:J.measureListIndex,MeasureNumberXML:null===(Q=O)||void 0===Q||null===(ee=Q.SourceMeasure)||void 0===ee?void 0:ee.MeasureNumberXML,allRests:null===(te=O)||void 0===te||null===(ne=te.SourceMeasure)||void 0===ne?void 0:ne.allRests,isRestFlag:null===(ie=O)||void 0===ie||null===(re=ie.SourceMeasure)||void 0===re?void 0:re.isRestFlag,multipleRestMeasures:null===(ae=O)||void 0===ae||null===(se=ae.SourceMeasure)||void 0===se?void 0:se.multipleRestMeasures,verticalMeasureList:Array.isArray(null===(oe=O)||void 0===oe||null===(le=oe.SourceMeasure)||void 0===le?void 0:le.verticalMeasureList)?O.SourceMeasure.verticalMeasureList.map((function(e){var t=(null==e?void 0:e.stave)||{},n=t.x,i=t.y,r=t.width,a=t.height,s=t.start_x,o=t.end_x;return e?{stave:{x:n,y:i,width:r,height:a,start_x:s,end_x:o},boundingBox:e&&e.boundingBox?{absolutePosition:_objectSpread2({},e.boundingBox.absolutePosition),size:_objectSpread2({},e.boundingBox.size)}:""}:void 0})):[],activeTimeSignature:_objectSpread2({},O.activeTimeSignature)},tie:O.tie?{StartNote:{NoteToGraphicalNoteObjectId:O.tie.StartNote.NoteToGraphicalNoteObjectId},notes:Array.isArray(O.tie.notes)&&(null===(ue=O.tie.notes)||void 0===ue?void 0:ue.map((function(e){return{NoteToGraphicalNoteObjectId:e.NoteToGraphicalNoteObjectId}})))||[]}:"",slurs:Array.isArray(O.slurs)?O.slurs.map((function(e){return{startNote:{NoteToGraphicalNoteObjectId:e.startNote.NoteToGraphicalNoteObjectId},endNote:{NoteToGraphicalNoteObjectId:e.endNote.NoteToGraphicalNoteObjectId}}})):[],pitch:{prevFrequency:null===(ce=O.pitch)||void 0===ce?void 0:ce.prevFrequency,nextFrequency:null===(he=O.pitch)||void 0===he?void 0:he.nextFrequency,frequency:null===(fe=O.pitch)||void 0===fe?void 0:fe.frequency},Length:_objectSpread2({},O.Length)},svgElelent:Qe?{bbox:(null===(de=Qe.getBoundingBox)||void 0===de?void 0:de.call(Qe))||"",top_y:Qe.top_y,note_height:Qe.note_height}:"",fixedKey:Je,realKey:0,duration:0,formatLyricsEntries:formatLyricsEntries(O),stave:Ce[0]&&Ce[0].stave?{attrs:Ce[0].stave?_objectSpread2({},Ce[0].stave.attrs):{}}:"",firstVerticalMeasure:{measureNumber:null==Ce||null===(pe=Ce[0])||void 0===pe?void 0:pe.measureNumber},noteLength:1,halfTone1:Array.isArray(F.notes)?F.notes.map((function(e){return e.halfTone+12})).filter(Boolean):[],halfTone2:M&&Array.isArray(M.notes)?M.notes.map((function(e){return e.halfTone+12})).filter(Boolean):[]};nt.realKey=l(O.halfTone-12*Je,nt),nt.duration=nt.endtime-nt.time;var it=(null===(me=Ce[0])||void 0===me||null===(ve=me.vfVoices[1])||void 0===ve?void 0:ve.tickables)||[],rt=(null===(ge=O.sourceMeasure.verticalMeasureList)||void 0===ge||null===(ye=ge[0])||void 0===ye||null===(be=ye.staffEntries)||void 0===be?void 0:be.length)||it.length;nt.noteLength=rt||1,i.push(nt),r.push(nt.id),f.push({realKey:nt.realKey,NoteToGraphicalNoteObjectId:O.NoteToGraphicalNoteObjectId}),h0)for(;t-n>0;)t-++n>0&&e.cursor.setPosition(_objectSpread2({},state$2.times[n].cursorBox));else e.cursor.setPosition(_objectSpread2({},state$2.times[t].cursorBox))}else if(t||0===t)if(n&&t-n==1)e.cursor.next();else if(n&&t-n>0)for(;t-n>0;)n++,e.cursor.next();else{var i=0;for(e.cursor.reset();istate$2.times[state$2.times.length-1].endtime)return-1;for(var n=0,i=e.filter((function(t,n){var i=e[n-1];return!1===(null==i?void 0:i.skipNextNote)})),r=0;r=a.time))break;s&&a.time==s.time||(n=a.i)}if(state$2.sectionStatus&&2===state$2.section.length){var o=state$2.befireSection||state$2.section[0];n=Math.min(Math.max(n,o.i),state$2.section[1].i),console.log("endIndex",n)}return n},getSlursNote=function(e,t){var n,i,r="end"===t?null===(n=e.noteElement.slurs[0])||void 0===n?void 0:n.endNote:null===(i=e.noteElement.slurs[0])||void 0===i?void 0:i.startNote;if(r)return state$2.times.find((function(e){return e.NoteToGraphicalNoteObjectId==r.NoteToGraphicalNoteObjectId}))},getNoteBySlursStart=function(e,t,n){var i=e,r=getSlursNote(i,n);if(!r&&t){var a,s=_createForOfIteratorHelper(i.measures);try{var o=function(){var e=a.value,t=state$2.times.find((function(t){return t.NoteToGraphicalNoteObjectId==e.NoteToGraphicalNoteObjectId}));console.log("🚀 ~ item",t),t.noteElement.slurs.length&&(r=getSlursNote(t,n),i=t)};for(s.s();!(a=s.n()).done;)o()}catch(err){s.e(err)}finally{s.f()}}if(i&&r!==i.noteElement){var l,u=_createForOfIteratorHelper(state$2.times);try{for(u.s();!(l=u.n()).done;){var c=l.value;if(r===c.noteElement)return c}}catch(err){u.e(err)}finally{u.f()}}return i},getParentNote=exports("d",(function(e){if(e){var t,n=_createForOfIteratorHelper(state$2.times);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(e.NoteToGraphicalNoteObjectId===i.noteElement.NoteToGraphicalNoteObjectId)return i}}catch(err){n.e(err)}finally{n.f()}}})),getNoteByMeasuresSlursStart=exports("aL",(function(e){var t,n=e;if(e.noteElement.tie&&e.noteElement.tie.StartNote&&(t=e.noteElement.tie.StartNote),n&&t&&t!==n.noteElement){var i,r=_createForOfIteratorHelper(state$2.times);try{for(r.s();!(i=r.n()).done;){var a=i.value;if(t.NoteToGraphicalNoteObjectId===a.noteElement.NoteToGraphicalNoteObjectId)return a}}catch(err){r.e(err)}finally{r.f()}}return n})),getActtiveNoteByTimes=function(e){var t,n,i=null===(t=e.target)||void 0===t?void 0:t.dataset,r={},a=_createForOfIteratorHelper(state$2.times);try{for(a.s();!(n=a.n()).done;){var s=n.value;s.id&&(r[s.id]=s)}}catch(err){a.e(err)}finally{a.f()}return r[i.id||""]},getPrevHasSourceNote=function(e){for(var t=Math.max(state$2.times.indexOf(e)-1,0);t>=0;t--){var n=state$2.times[t];if(null!=n&&n.stave)return n}},getBoundingBoxByverticalNote=exports("i",(function(e){var t,n,i,r,a,s,o=null==e||null===(t=e.noteElement)||void 0===t||null===(n=t.sourceMeasure)||void 0===n?void 0:n.verticalMeasureList,l=0;if(o=o&&o[0]?o:(null==e||null===(i=e.noteElement)||void 0===i?void 0:i.isRestFlag)&&(null===(r=getPrevHasSourceNote(e))||void 0===r||null===(a=r.noteElement)||void 0===a||null===(s=a.sourceMeasure)||void 0===s?void 0:s.verticalMeasureList))for(var u=o[state.partIndex],c=0;c0)l+=null===(p=o[c-1])||void 0===p?void 0:p.stave.height;l+=m;var v=null==u?void 0:u.stave,g=v.x,y=v.y,b=v.width,_=v.context,S=v.start_x,x=v.end_x;return{measureIndex:(null==e||null===(f=e.noteElement)||void 0===f?void 0:f.sourceMeasure.measureListIndex)||0,MeasureNumberXML:(null==e||null===(d=e.noteElement)||void 0===d?void 0:d.sourceMeasure.MeasureNumberXML)||1,start_x:S,end_x:x,height:l,x:g,y:y,width:b,context:_}}}return{measureIndex:0,height:l,start_x:0,end_x:0,x:0,y:0,width:0,context:{element:null}}})),getDuration=exports("x",(function(e){if(e){var t,n=null==e||null===(t=e.graphic)||void 0===t?void 0:t.measureList[0][0];if(n){var i=null==n?void 0:n.parentSourceMeasure,r=i.duration,a=i.tempoInBPM,s=i.activeTimeSignature;if(r)return _objectSpread2(_objectSpread2({},formatDuration(s)),{},{tempoInBPM:a})}}return{}})),formatDuration=function(e,t){return e},getTimeByBeatUnit=function(e,t,n){var i=4;switch(e){case"1024th":i=1024;break;case"512th":i=512;break;case"256th":i=256;break;case"128th":i=128;break;case"64th":i=64;break;case"32nd":i=32;break;case"16th":i=16;break;case"eighth":i=8;break;case"quarter":i=4;break;case"half":i=2;break;case"whole":i=1;break;case"breve":i=.5;break;case"long":i=.25;break;case"maxima":i=.125}return n/i*t},getEnvHostname=exports("aC",(function(){return location.origin.indexOf("online")>-1?"https://mstuonline.dayaedu.com":location.origin.indexOf("dev")>-1?"http://mstudev.dayaedu.com":"https://mstutest.dayaedu.com"})),getTvIconUrl=exports("aB",(function(){return location.origin.indexOf("online")>-1?"https://mteaonline.dayaedu.com/#/guide":location.origin.indexOf("dev")>-1?"http://mteadev.dayaedu.com/#/guide":"https://mteatest.dayaedu.com/#/guide"})),setPrefix=exports("aS",(function(e){return e?"?"+e:""})),formatXML=exports("h",(function(e,t){if(!e)return"";var n,i=(new DOMParser).parseFromString(e,"text/xml"),r=i.getElementsByTagName("measure"),a=-1,s=-1,o=document.createElement("direction");(o.innerHTML='\n \n quarter\n 100\n \n \n 1\n 1',0===i.getElementsByTagName("per-minute").length)&&(null===(n=r[0])||void 0===n||n.insertAdjacentElement("afterbegin",o));var l,u=_createForOfIteratorHelper(r);try{for(u.s();!(l=u.n()).done;){var c,h=l.value;-1===a&&h.getElementsByTagName("beats").length&&(a=parseInt(h.getElementsByTagName("beats")[0].textContent||"4")),-1===s&&h.getElementsByTagName("beat-type").length&&(s=parseInt(h.getElementsByTagName("beat-type")[0].textContent||"4"));var f=parseInt((null===(c=h.getElementsByTagName("divisions")[0])||void 0===c?void 0:c.textContent)||"256");if(0===h.getElementsByTagName("note").length){var d,p=null===(d=h.getElementsByTagName("forward")[0])||void 0===d?void 0:d.getElementsByTagName("duration")[0];p&&(p.textContent="0"),h.innerHTML=h.innerHTML+'\n \n \n '.concat(f*a,"\n 1\n whole\n ")}}}catch(err){u.e(err)}finally{u.f()}if(t){var m=i.querySelector("work-title");m&&t.title&&(m.textContent=t.title)}return(new XMLSerializer).serializeToString(i)})),getCustomInfo=exports("f",(function(e){var t,n,i={showSpeed:!0,parsedXML:e,code:""},r=(new DOMParser).parseFromString(e,"text/xml"),a=_createForOfIteratorHelper(r.getElementsByTagName("words"));try{for(a.s();!(n=a.n()).done;){var s,o,l=n.value;l&&"隐藏速度"===(null===(s=l.textContent)||void 0===s?void 0:s.trim())&&(i.showSpeed=!1,l.textContent=""),l&&"@"===(null===(o=l.textContent)||void 0===o?void 0:o.trim())&&(l.textContent="segno")}}catch(err){a.e(err)}finally{a.f()}return i.parsedXML=(new XMLSerializer).serializeToString(r),i.code=(null===(t=r.querySelector("part-name"))||void 0===t?void 0:t.innerHTML)||"",i})),setElementNoteBefore=function(e,t,n){var i=0;if(t){for(var r=0;r0)for(var s=0,o=0;o-1){var o=f.indexOf(r),l=e.getElementsByTagName("measure")[o];setElementNoteBefore(i,r,l)}})),p.forEach((function(t){var n=t.textContent||"";if((isSpecialMark(n)||isSpeedKeyword(n)||isGradientWords(n)||isRepeatWord(n)||GRADIENT_SPEED_RESET_TAG)&&n){var i,r=null===(i=t.parentElement)||void 0===i?void 0:i.parentElement,a=null==r?void 0:r.parentElement,s=_toConsumableArray2((null==a?void 0:a.childNodes)||[]),o=r?s.indexOf(r):-1;if(r&&a&&o>-1){var l=f.indexOf(a),u=e.getElementsByTagName("measure")[l];setElementNoteBefore(r,a,u)}}})),m.forEach((function(t){var n,i=null===(n=t.parentElement)||void 0===n?void 0:n.parentElement,r=null==i?void 0:i.parentElement;if(r){var a,s=f.indexOf(r);null===(a=e.getElementsByTagName("measure")[s])||void 0===a||a.appendChild(i.cloneNode(!0))}}))}if(e&&e.getAttribute("id")===g){var l,u,c=e.getElementsByTagName("barline"),h=null===(l=c[c.length-1])||void 0===l?void 0:l.parentElement;if("barline"!==(null==h||null===(u=h.lastElementChild)||void 0===u?void 0:u.tagName)){var v,y=_createForOfIteratorHelper((null==h?void 0:h.children)||[]);try{for(y.s();!(v=y.n()).done;){var b=v.value;if("barline"===b.tagName){null==h||h.appendChild(b);break}}}catch(err){y.e(err)}finally{y.f()}}}})),Array.from(u).forEach((function(e){var t;e&&e.getAttribute("id")!==g&&(null===(t=e.parentNode)||void 0===t||t.removeChild(e))}));var y=l.getElementsByTagName("note");Array.from(y).forEach((function(e,t){var n,i=e.getElementsByTagName("grace");i&&i.length&&e.appendChild(null===(n=function(e){for(var t,n=y[e+1],i=e;i1){var u,c=r(null===(u=o.parentElement)||void 0===u?void 0:u.nextElementSibling);if(c&&c.querySelectorAll("slur").length>0){var h,f,d=Array.from((null===(h=c.querySelector("notations"))||void 0===h?void 0:h.children)||[]).map((function(e){return e.getAttribute("number")})),p=_createForOfIteratorHelper(l.querySelectorAll("slur"));try{for(p.s();!(f=p.n()).done;){var m,v=f.value;if(!d.includes(v.getAttribute("number")))null===(m=c.querySelector("notations"))||void 0===m||m.appendChild(v)}}catch(err){p.e(err)}finally{p.f()}}}}}catch(err){a.e(err)}finally{a.f()}return(new XMLSerializer).serializeToString(t)})),getVoicePartInfo=exports("aV",(function(){var e=state$3,t=e.MusicalInstrumentClassification,n=e.chinesePartName,i=-1,r=state$2.partListNames,a=state$2.partIndex,s=r.filter((function(e){return""!==(e||"").trim()}));if(s.length)for(var o=function(){var e=_slicedToArray(u[l],2),t=e[0],s=e[1],o=r[a],c=s.filter((function(e){return e&&o.indexOf(e||"")>-1}));if(o&&(c.length||s.includes(o)))return isNaN(+t)||(i=+t),{v:{realPartListNames:r,subjectId:i,partListNames:s,partName:o,chinesePartName:n[o]||o}}},l=0,u=Object.entries(t);l2&&void 0!==arguments[2]&&arguments[2];if(!e)return!1;var i,r=!1,a=_createForOfIteratorHelper(e);try{for(a.s();!(i=a.n()).done;){var s=i.value;if(s.id===t&&(n||classids.includes(s.id))){r=!0;break}if(s.sysMusicScoreCategoriesList&&(r=idIsInClassIds(s.sysMusicScoreCategoriesList,t,n||classids.includes(s.id))))break}}catch(err){a.e(err)}finally{a.f()}return r})),SectionHint=function(){function e(){_classCallCheck2(this,e),this.currentNote=null,this.el=document.createElement("div"),this.span=document.createElement("span"),this.init()}return _createClass2(e,[{key:"init",value:function(){this.el.id="section-hint"+Math.floor(1e5*Math.random()),this.hide()}},{key:"showForElement",value:function(e){if(this.currentNote!==e){this.el||(this.el=document.createElement("div"),this.init(),this.show()),this.currentNote=e;var t=getBoundingBoxByverticalNote(e),n=document.querySelector("#osmdSvgPage1");if(t){var i,r=t.x,a=t.y,s=t.width,o=t.height;this.el.id="custom-cursor-bg-hint",this.el.style.position="absolute",this.el.style.top=formatZoom(a)+"px",this.el.style.left=formatZoom(r)+"px",this.el.style.width=formatZoom(s)+"px",this.el.style.height=formatZoom(o)+"px",this.el.style.zIndex="-1",null==n||null===(i=n.parentNode)||void 0===i||i.appendChild(this.el)}}}},{key:"hide",value:function(){this.el.style.display="none"}},{key:"show",value:function(){this.el.style.display=""}},{key:"destroy",value:function(){this.currentNote=null,this.hide()}}]),e}();function __variableDynamicImportRuntime0__(e){switch(e){case"../src/pages/baseClass/index.tsx":return __vitePreload((function(){return module.import("./index-legacy.18a4b420.js")}),void 0);case"../src/pages/classify/index.tsx":return __vitePreload((function(){return module.import("./index-legacy.8c1e495e.js")}),void 0);case"../src/pages/detail/index.tsx":return __vitePreload((function(){return module.import("./index-legacy.18414953.js")}),void 0);case"../src/pages/list/index.tsx":return __vitePreload((function(){return module.import("./index-legacy.64b30a0b.js")}),void 0);case"../src/pages/notfund/index.tsx":return __vitePreload((function(){return module.import("./index-legacy.d714544e.js")}),void 0);case"../src/pages/render-test/index.tsx":return __vitePreload((function(){return module.import("./index-legacy.7dae5def.js")}),void 0);case"../src/pages/report/index.tsx":return __vitePreload((function(){return module.import("./index-legacy.addfb13f.js").then((function(e){return e.i}))}),void 0);default:return new Promise((function(t,n){("function"==typeof queueMicrotask?queueMicrotask:setTimeout)(n.bind(null,new Error("Unknown variable dynamic import: "+e)))}))}}var getRouterComponent=function(e){return _asyncToGenerator(regeneratorRuntime.mark((function t(){var n,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=setTimeout((function(){open$1()}),300),i=Promise.resolve(null),t.prev=2,t.next=5,__variableDynamicImportRuntime0__("../src/pages/".concat(e,"/index.tsx"));case 5:i=t.sent,t.next=11;break;case 8:t.prev=8,t.t0=t.catch(2),i=Promise.reject();case 11:return clearTimeout(n),close$1(),t.abrupt("return",i);case 14:case"end":return t.stop()}}),t,null,[[2,8]])})))},routes=[{path:"/",component:getRouterComponent("baseClass")},{path:"/classify",component:getRouterComponent("classify")},{path:"/list/:id",component:getRouterComponent("list"),meta:{keepAlive:!0}},{path:"/detail/:id",component:getRouterComponent("detail")},{path:"/evaluating/:id",component:getRouterComponent("detail")},{path:"/report",component:getRouterComponent("report")},{path:"/report/:id",component:getRouterComponent("report")},{path:"/render-test",component:getRouterComponent("render-test")},{path:"/vexflow-test",component:__vitePreload((function(){return module.import("./index-legacy.66e311d4.js")}),void 0)},{path:"/:pathMatch(.*)*",component:getRouterComponent("notfund"),meta:{title:"404 Not Fund"}}];createRouter({history:createWebHashHistory(),routes:routes});var tock="SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjI5LjEwMAAAAAAAAAAAAAAA//tQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAAGAAAKmwA6Ojo6Ojo6Ojo6Ojo6Ojo6YmJiYmJiYmJiYmJiYmJiYmKJiYmJiYmJiYmJiYmJiYmJsbGxsbGxsbGxsbGxsbGxsbHY2NjY2NjY2NjY2NjY2NjY2P////////////////////8AAAAATGF2YzU4LjU0AAAAAAAAAAAAAAAAJAQUAAAAAAAACpv9GcQ9AAAAAAAAAAAAAAAAAAAAAP/7kGQAAALJHFAdPeAAMs13wKAUABOVWUYZ2gAA1UIigwBQAAAAUlDQQxklOcnZOydj1iYIxFj1oWbgRwYhdwAgBMLA1q+Ech0QS2HREhx5GBklTjJq98QImWB5q9/SmXkQa8gJAxrBDlDn/l/D5d9cH9pd/D/Ln+H+XP8P////////////kIQhCf6EIz////5z8hCf//////85CEqc5zkqcPh8Ph8DgAAAABwOBwUIYigkYzAOBgVYUoT0xxC8ypKoLAmYGA34OAo4Ukoel04PoEw+AY5KXwIIcD4SwNeeCwQnPAyAEDKEQAQwphNGfC10AQCF6hESOSROeGNRFBPYnkVxbUW+KTH8ZQZcmyCUWWj/HPJ8iBBy2SxPrRrRr/lYqlcnidNieLpsuvXr/5eMTIvHThkdMDIz///8wUmYIJoIHzRj6ALf/8Ahz/////////////09fPP/f++v91/qp///0FCCor/MeqOQV9OtjKwvETiP///4gLFJ///+PYKZAAAJSMgAAwRYCBMBIAIRYAFgJiRgCoBwYDiBGGAvgP/7kmQPjfQJHkZXfqAANq14YOAUAE0JqxIN/oiIvTZhgACj2SxgDYAkYBOAeGAtgzRh5IwEZAKX5HH4nhRqcw/qYc4EGmBlAeBgu4K8BuRvgZYEQGQRwBjkZDiS0cxRbUuZOZHpixkiipJJ1OpaqzJIe4kJfb////////6heitNxprnDpIJ//////////+/r+tfuy37W7+d1rTu37oi36V//p/RGntSvLdowxnDgeONKh1jhpihwTMDCAwcPO8CRICfmLS0OAAxDCIU1kuNRoDAEATswDwKMME9IWzYyOJsxDwZfMBUCPDAYwSEwHACiA8jwD2hwLkAGpwxG//9///t/q//////7+////+r/////99mu7qqdT6Dp6KtS3WmpaJso5oG//zU/y9j4VkE5l+sBkvmkX+v///acWnV2trA0mrZlJKphkD4zD4UYeaLigSkDKVVAAAABoOjRLAYlW2pbW0TjAQPMMiYxoNTLhlNAqA29QTCARHAylZ+yMpzCeDB0ANUwLUBKIgHkGugOHwNbgAFkXS1+v/V/p/6/9f+3/7/+5JkJojzkmvFa5+akiqtWGAAJfZPNa0MDn6KSMy2IUAAm6HV66am7/9qv9JO3S/1f/7dPr7V1/1/QrqtqWt9StPTTTSQrNUm/8ud1+NUvMOdbX4+j4aaz6f//rVfa9U1dtasIILnUYQ4o4wTDo87xIDzyBiBbaW9wIQKKCAVG5gEUGSwkaiBx005mGcAmRt6ItsZhME5GFGgZpglAD8YFGA6gce2BpnwGLRgAECDP//6////////11dkWu1S67La+tnr2t1UPo9f1vt//71alvXrqRmSlo60EkkVLTdzxdQLhmeLyRqo+ZmhaOQf9f/FXojkaky22YJvJz9bAcF9zk0p8v/+X752Zmbu+7Tqr5l8j+aexVdmLCHIEz0WejhSGgDmLY5Yp0A4ATFgDgwCcAEMAVATgCBZmAuAwRgoIoKaUNEAmBeh/5rCvGZViZSMxjwUGPQOGEgiDcJ////3/////+/9P0k8taNNRqKfI7qhlYqGY7/ZPyVb9v+vfVDEkVkKZHrOwgVhUUQa6iRRrChlDwrFFDwkOFwoTKKEfr/5//uSZECP8/BswoP8KyAurYhgACb2TnWxCg38qoi3NiGAAJvZyyeZe+GTlsyDkIzns5w///+v+3z/7fmPsPpsRc5J09lTsJmEllkDIC0CMKkQLax/q7iyphogZAOmcI5pr0cF/mCYhxRiJDJgY4CESGCQAW5gMoCIYAgAAg0AAMAMABzABwAAtiH///////////911rt5im0a6NR1t6satH2VVWyp1///+nofRUZHQimYpSmHWZw8cYoTYCDxgmIi6CqIv/TvkZdRYEQDg7m7Uuyzf0qz//////63ds8PL1uNTm7nWYRtHt0hJrgT3SKaqWg5c/2AGAUAwBgATARAbMDQCwwIASzEfGVMWUpU75zHTcSLAMIYFQweADDBFAnA4/AWYG2ABAMv//////////9er32U7V2vruldDdWvVZaqkEXe9f7W/+/f60ek6DpqVRQSRSpsiipA4UCfNjExMjxoXlLSNCZMhf//////////9P/17cln97tv9GIhOVro9PTf//9U19ao0qO5FTUGEDmO4CcoYUgyiwoZVQEcAAABCv/7kmRYgAPBbEKFemACNK14YKAIAB2aEQc56gAB1UIgwwLQAAgAAAABq3tm9gKW2Bgcic+KisAoBQwGBTT7kslMXcNU7Q9oDDGDANzjkkwCwpVFWbApcBEnr8DMCgNMCE59VTQbwB2hOINj//cBpGKiDY+IJl7q/XKgLABYguYC9hbW6aCaDKrUggkLIHoiIpcLljtEEzdNEwm6RspVN3OJUxcZeMBMCJCCAcYbjMGiZcVUZou6LGa1F51prqLxBSDh9yqKXGTYzGwRJSqjk1L54rn0Cbm2szRPolE4R5Ml0dBDyDi4BPh8cDonxH5OiAZLmQ5pOE2RcZwfJc////LY1Y2////xzRDBpCyP1/////////79v9F0GWupdNNadM2SZSe7TWdQOJUETFkEzdRmgYWTc6by8q9lsaGi2UZLWihMzVdaJ916OiZFBiSYpmJwiDHFxdJB0zp4vmRgiS8fmR0UWXJpqRROx6l00HsO4Lr///+PY6MUMf///5ONCIOekEgAFo2Hw+Gw1EYYCAHPFMMT2N4KpAjHDGwyfhUkKHP/+5JkEAAEs0PYbkMkhDDs+DDAHAAAAAGkHAAAIAAANIOAAARJeX/IDTYPBUSlUNQD/+eBQG8NtczGGFOFF6L//zBYBCY0cDrhKStLnRiNT///LXqrpGMbRVUuksRopVlS////p8LMTDUAXkvl1pqtnzWVX////5dRRunlFeU005/7///9f/////3reGruVrlsHP/iUgZCDTTzlv//////zf/+qt//+x1HNHnGv//6OOqz0Op////ORzh4qUHiTiMM/////kABRAf/+qpMQU1FMy4xMDCqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",tick="SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjI5LjEwMAAAAAAAAAAAAAAA//tQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAAGAAAKmwA6Ojo6Ojo6Ojo6Ojo6Ojo6YmJiYmJiYmJiYmJiYmJiYmKJiYmJiYmJiYmJiYmJiYmJsbGxsbGxsbGxsbGxsbGxsbHY2NjY2NjY2NjY2NjY2NjY2P////////////////////8AAAAATGF2YzU4LjU0AAAAAAAAAAAAAAAAJAQUAAAAAAAACpsJoXZ7AAAAAAAAAAAAAAAAAAAAAP/7kGQAAALmINEVPeAAOA1nwKAUAFJpV1I5moAAxMIiwwAgAAAJdWKyJljOc0zrZ9UpVjOc0ydibhICwL5OzLXhuEsSYKQMBGN7PInFA1lsOiJDj4ePJU4yavfFKXVjzWb+msvIg0/EgY4If/D/E58P7S7+H+X8H+X8H+XeUDH+U///////////////+d/oQjZCEIQjZCEJ85zv/////8hCEI1CEIQhCHExc7oIBwOAGAYBgGAYfD48ACQIWDrWCzEHeEXm6Qvl/frHQSfa7Wyi4qArEA3m2QMdkQDHnDAyqJQROEFN0BhgEgYaCoAIEAWABAi+FrGF/QbVDIQppKJLOeHoisC1jGjOWr/HLJUgBAzMnK2Wv+Rc3KhPny0V1rrXX/KxqfLxqbF4xS169f/LxiZF46cMjpgcT///8wUmggmgg6DHwRPf/6AW//////////////317pa6/09U///7//ndTuIUN/ldtifykKtKygv///41n////DBRxSpwEjjYIBpwgmIASlzATXqOy+0WbkkUn6YKEJjwqmVBma4nxv/7kmQRhvRLLEe/cuAALs14cOAIAE0lqRIPgFVIsjYhgACb2aAtG1x8BggIP4Bg7YQ+BrcLKgBiv4oEBiIYYEBg5oIEBgPYAWBgNQDaBgKACSBgFIBMBgD4AQKTGRrZ1mKB9jFB0mUkkl3S2LyToGyXq6q0FqelU9VR9SYlO/6vXV//2//yvh3ubf/////////////5P/N+V6fauunX+v31//67c+Z2P6ldBAIyshGO5jAhgqiAhHFyGBSAA6Iz801nLGtGX9dpgKAoCADZgD4EgYICFfmCmAjZgcYHAYLCDOGGCDeZ0W0QOY54C9mDtgUxgbgCqYDuASAIB9DAC8VAA0QmU03un0/Ru30/////t6//r/a3UYivlU12BHnIolcGP+p/9YNArFgyKNS7cofI88/////P28923u73DxbZ0lFImJUdrVhd6t8DsRiWCALVe0ttc7rdNLoy5S5QaABGALAKJgJgRkYIKBSGBVASpgcwJ+YOSK7G9ZqIBiYoLgYJQBKmBBgJBgIQBCYA6ABIwqdLCu9Z//bb/v6/pe1q/Zv/+5JkKY/zZWrEA+AVQjHNqFAARvYN8bEOD4C1CL22YUAAm9j/t//+n/tNRX0Y6tRxaOo9DBJFa7WHABUQuuuiX+37brMiv9QRXvqfsaTl7d/X///8/2t147te2ihqbNj6UUiJ7XI3TrhLAVDlhRuiQCzA1nL/3ljS00Ou8iqYAeARGADA1JgYACmYDuAtGBGgcxgeQgqaxkVzmF+Am5gVYDsYCIAbmANgCxgAgACzp/WvQ7l/9Pv/XtW+tNUZ3qzdtG27////678qXQx9dEsIB8p0I4mUcqIZFIIioYcsXg/7rKY4sEx/yskQCv1sODfXqX/fk3bfrN/u97+wUUxZrxqMvrRBxjrHQcDMzkIqHgIZ7H//96ysz0VacYAgApgZiYGEKA4YJgGJgmBPmDGXUfuKWRjeh4GCkCuYDIEhgAAFoCnpk8Cz3P/t7y3vfL1yEvXoldaK/0/N//9fru/QrGFio7EGIRmKzDzlY7g4kHR4sOHD3D5Rhx39lwVz0WozDO36Ye8RGSizLItOzh/+P/1V78uv/F++XnVXODau4y+V//uSZEmP81dsQwPALUIyzZhQACn2C6GzDA8AVQC4NiGAAKPZWbabe2ImyAcS6WJ42uf//+/7eo4SmsYFgWIYEaYEYBhgMgqAAb05CgQTDCCXMBMC4GAGohM9gCckV7v/b3VS6sk6I3Kpcy/k3pXei/p//3//u+y5lkXUOimYQIMHiqoKdzmIEFiVCDf/znuaM4Q1fF52ict/xk/y/////8172vq6sNjqCmui3ZhonD5BHUYMDLiEaeitExf/ZM0JMTADBeIIFgxgDAlAwBA5AwEFKA9IoNAwph4AcCEGoBA8otA5ZPlo+3///////v+pwNTH8GyDFIyKIfORswWXNnSIIDnbM9++/zvHfPFvmHrVupOT56+1XG6XRMNOjlFhkVyQIyMMvy6nrD2uJnhq6JZSI2Nll5SuVhL/v/WH7z3n+eof23Ocu7SuuSyl/Ol3zNs9SB1pxgZNUBASDtc/99+vSbzvsojBvbkVpvmgYKAnAQGOBtCPoBgXBKBgoBUGkiCAYDHwK3Efm6kGTL5fNGWm6jBAzHMJxk01FwuMgg30C//7kmR0BfNla8ICwV3yMw2oUAAp9hRBsQkVmwAIvLYhwoBQAOnQZaaai+n6aboVvUhWaGFNakEGZkLu1SZ+gqmkp3SdGnSUzr2agpV1MhQQUmrst9Vb3W77prrWtearQRubpqRTdZupM0MEDdFZsznETcrEWLRfNDI6mWjYl////////////76/ttT9NE9F+7f27/0///r0rpQt2ucqMVqq6WEkFkERykEwkPItGggAAASKvjNixlEu4N8A55LwruB3AB+uOSUMLDgDjBsI/l05xH44xcgy5ZMWfxySBEsO0idEySX8cwoEecIsTqlOjV+T5XJwmyiUjVaPZX8qlsnDAzMC8XTdVSvX/z5oXzpxE1PmiBmv1alf/mBkYnz5obnTizU2NEDPr/1f//QSm//9YAEAAACRVvkHHeYo4YgA30vCu4GXAAaAuOSUMLDgDgwbCP5dOcQDHGLkGXLJiz+OSQIlh2kTomSS/jmFAjzhFidUp0avyfK5OE2USkarR7K/lUtk4YGZwvF03VUr1/8+XC+dOImp80QM1+rUr/8wMkT/+5JEeoAEI2hHLk5gAIZNCOXJUAAAAAGkHAAAIAAANIOAAAT580L504iamxogn1/Vq//+cSLqf/9aTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",b64toBlob=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:512,i=atob(e),r=[],a=0;a=0&&e<=1){if(t._volume=e,t._muted)return t;t.usingWebAudio&&t.masterGain.gain.setValueAtTime(e,i.ctx.currentTime);for(var n=0;n=0;t--)e._howls[t].unload();return e.usingWebAudio&&e.ctx&&void 0!==e.ctx.close&&(e.ctx.close(),e.ctx=null,h()),e},codecs:function(e){return(this||i)._codecs[e.replace(/^x-/,"")]},_setup:function(){var t=this||i;if(t.state=t.ctx&&t.ctx.state||"suspended",t._autoSuspend(),!t.usingWebAudio)if("undefined"!=typeof Audio)try{void 0===(new Audio).oncanplaythrough&&(t._canPlayEvent="canplay")}catch(e){t.noAudio=!0}else t.noAudio=!0;try{(new Audio).muted&&(t.noAudio=!0)}catch(e){}return t.noAudio||t._setupCodecs(),t},_setupCodecs:function(){var e=this||i,t=null;try{t="undefined"!=typeof Audio?new Audio:null}catch(err){return e}if(!t||"function"!=typeof t.canPlayType)return e;var n=t.canPlayType("audio/mpeg;").replace(/^no$/,""),r=e._navigator?e._navigator.userAgent:"",a=r.match(/OPR\/([0-6].)/g),s=a&&parseInt(a[0].split("/")[1],10)<33,o=-1!==r.indexOf("Safari")&&-1===r.indexOf("Chrome"),l=r.match(/Version\/(.*?) /),u=o&&l&&parseInt(l[1],10)<15;return e._codecs={mp3:!(s||!n&&!t.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!n,opus:!!t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(t.canPlayType('audio/wav; codecs="1"')||t.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!t.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!t.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/m4a;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(t.canPlayType("audio/x-m4b;")||t.canPlayType("audio/m4b;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(t.canPlayType("audio/x-mp4;")||t.canPlayType("audio/mp4;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(u||!t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(u||!t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!t.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(t.canPlayType("audio/x-flac;")||t.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||i;if(!e._audioUnlocked&&e.ctx){e._audioUnlocked=!1,e.autoUnlock=!1,e._mobileUnloaded||44100===e.ctx.sampleRate||(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var t=function t(n){for(;e._html5AudioPool.length0?o._seek:n._sprite[e][0]/1e3),c=Math.max(0,(n._sprite[e][0]+n._sprite[e][1])/1e3-u),h=1e3*c/Math.abs(o._rate),f=n._sprite[e][0]/1e3,d=(n._sprite[e][0]+n._sprite[e][1])/1e3;o._sprite=e,o._ended=!1;var p=function(){o._paused=!1,o._seek=u,o._start=f,o._stop=d,o._loop=!(!o._loop&&!n._sprite[e][2])};if(!(u>=d)){var m=o._node;if(n._webAudio){var v=function(){n._playLock=!1,p(),n._refreshBuffer(o);var e=o._muted||n._muted?0:o._volume;m.gain.setValueAtTime(e,i.ctx.currentTime),o._playStart=i.ctx.currentTime,void 0===m.bufferSource.start?o._loop?m.bufferSource.noteGrainOn(0,u,86400):m.bufferSource.noteGrainOn(0,u,c):o._loop?m.bufferSource.start(0,u,86400):m.bufferSource.start(0,u,c),h!==1/0&&(n._endTimers[o._id]=setTimeout(n._ended.bind(n,o),h)),t||setTimeout((function(){n._emit("play",o._id),n._loadQueue()}),0)};"running"===i.state&&"interrupted"!==i.ctx.state?v():(n._playLock=!0,n.once("resume",v),n._clearTimer(o._id))}else{var g=function(){m.currentTime=u,m.muted=o._muted||n._muted||i._muted||m.muted,m.volume=o._volume*i.volume(),m.playbackRate=o._rate;try{var r=m.play();if(r&&"undefined"!=typeof Promise&&(r instanceof Promise||"function"==typeof r.then)?(n._playLock=!0,p(),r.then((function(){n._playLock=!1,m._unlocked=!0,t?n._loadQueue():n._emit("play",o._id)})).catch((function(){n._playLock=!1,n._emit("playerror",o._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),o._ended=!0,o._paused=!0}))):t||(n._playLock=!1,p(),n._emit("play",o._id)),m.playbackRate=o._rate,m.paused)return void n._emit("playerror",o._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==e||o._loop?n._endTimers[o._id]=setTimeout(n._ended.bind(n,o),h):(n._endTimers[o._id]=function(){n._ended(o),m.removeEventListener("ended",n._endTimers[o._id],!1)},m.addEventListener("ended",n._endTimers[o._id],!1))}catch(err){n._emit("playerror",o._id,err)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===m.src&&(m.src=n._src,m.load());var y=window&&window.ejecta||!m.readyState&&i._navigator.isCocoonJS;if(m.readyState>=3||y)g();else{n._playLock=!0,n._state="loading";m.addEventListener(i._canPlayEvent,(function e(){n._state="loaded",g(),m.removeEventListener(i._canPlayEvent,e,!1)}),!1),n._clearTimer(o._id)}}return o._id}n._ended(o)},pause:function(e){var t=this;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"pause",action:function(){t.pause(e)}}),t;for(var n=t._getSoundIds(e),i=0;i=0?t=parseInt(a[0],10):e=parseFloat(a[0])}else a.length>=2&&(e=parseFloat(a[0]),t=parseInt(a[1],10));if(!(void 0!==e&&e>=0&&e<=1))return(n=t?r._soundById(t):r._sounds[0])?n._volume:0;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"volume",action:function(){r.volume.apply(r,a)}}),r;void 0===t&&(r._volume=e),t=r._getSoundIds(t);for(var l=0;l0?i/u:i),h=Date.now();e._fadeTo=n,e._interval=setInterval((function(){var r=(Date.now()-h)/i;h=Date.now(),o+=l*r,o=Math.round(100*o)/100,o=l<0?Math.max(n,o):Math.min(n,o),s._webAudio?e._volume=o:s.volume(o,e._id,!0),a&&(s._volume=o),(nt&&o>=n)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,s.volume(n,e._id),s._emit("fade",e._id))}),c)},_stopFade:function(e){var t=this,n=t._soundById(e);return n&&n._interval&&(t._webAudio&&n._node.gain.cancelScheduledValues(i.ctx.currentTime),clearInterval(n._interval),n._interval=null,t.volume(n._fadeTo,e),n._fadeTo=null,t._emit("fade",e)),t},loop:function(){var e,t,n,i=this,r=arguments;if(0===r.length)return i._loop;if(1===r.length){if("boolean"!=typeof r[0])return!!(n=i._soundById(parseInt(r[0],10)))&&n._loop;e=r[0],i._loop=e}else 2===r.length&&(e=r[0],t=parseInt(r[1],10));for(var a=i._getSoundIds(t),s=0;s=0?t=parseInt(a[0],10):e=parseFloat(a[0])}else 2===a.length&&(e=parseFloat(a[0]),t=parseInt(a[1],10));if("number"!=typeof e)return(n=r._soundById(t))?n._rate:r._rate;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"rate",action:function(){r.rate.apply(r,a)}}),r;void 0===t&&(r._rate=e),t=r._getSoundIds(t);for(var l=0;l=0?t=parseInt(r[0],10):n._sounds.length&&(t=n._sounds[0]._id,e=parseFloat(r[0]))}else 2===r.length&&(e=parseFloat(r[0]),t=parseInt(r[1],10));if(void 0===t)return 0;if("number"==typeof e&&("loaded"!==n._state||n._playLock))return n._queue.push({event:"seek",action:function(){n.seek.apply(n,r)}}),n;var o=n._soundById(t);if(o){if(!("number"==typeof e&&e>=0)){if(n._webAudio){var l=n.playing(t)?i.ctx.currentTime-o._playStart:0,u=o._rateSeek?o._rateSeek-o._seek:0;return o._seek+(u+l*Math.abs(o._rate))}return o._node.currentTime}var c=n.playing(t);c&&n.pause(t,!0),o._seek=e,o._ended=!1,n._clearTimer(t),n._webAudio||!o._node||isNaN(o._node.duration)||(o._node.currentTime=e);var h=function(){c&&n.play(t,!0),n._emit("seek",t)};if(c&&!n._webAudio){var f=function e(){n._playLock?setTimeout(e,0):h()};setTimeout(f,0)}else h()}return n},playing:function(e){var t=this;if("number"==typeof e){var n=t._soundById(e);return!!n&&!n._paused}for(var i=0;i=0&&i._howls.splice(r,1);var a=!0;for(n=0;n=0){a=!1;break}return s&&a&&delete s[e._src],i.noAudio=!1,e._state="unloaded",e._sounds=[],e=null,null},on:function(e,t,n,i){var r=this["_on"+e];return"function"==typeof t&&r.push(i?{id:n,fn:t,once:i}:{id:n,fn:t}),this},off:function(e,t,n){var i=this,r=i["_on"+e],a=0;if("number"==typeof t&&(n=t,t=null),t||n)for(a=0;a=0;a--)r[a].id&&r[a].id!==t&&"load"!==e||(setTimeout(function(e){e.call(this,t,n)}.bind(i,r[a].fn),0),r[a].once&&i.off(e,r[a].fn,r[a].id));return i._loadQueue(e),i},_loadQueue:function(e){var t=this;if(t._queue.length>0){var n=t._queue[0];n.event===e&&(t._queue.shift(),t._loadQueue()),e||n.action()}return t},_ended:function(e){var t=this,n=e._sprite;if(!t._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime=0;i--){if(n<=t)return;e._sounds[i]._ended&&(e._webAudio&&e._sounds[i]._node&&e._sounds[i]._node.disconnect(0),e._sounds.splice(i,1),n--)}}},_getSoundIds:function(e){if(void 0===e){for(var t=[],n=0;n=0;if(i._scratchBuffer&&t.bufferSource&&(t.bufferSource.onended=null,t.bufferSource.disconnect(0),n))try{t.bufferSource.buffer=i._scratchBuffer}catch(e){}return t.bufferSource=null,this},_clearSound:function(e){/MSIE |Trident\//.test(i._navigator&&i._navigator.userAgent)||(e.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var a=function(e){this._parent=e,this.init()};a.prototype={init:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++i._counter,t._sounds.push(e),e.create(),e},create:function(){var e=this,t=e._parent,n=i._muted||e._muted||e._parent._muted?0:e._volume;return t._webAudio?(e._node=void 0===i.ctx.createGain?i.ctx.createGainNode():i.ctx.createGain(),e._node.gain.setValueAtTime(n,i.ctx.currentTime),e._node.paused=!0,e._node.connect(i.masterGain)):i.noAudio||(e._node=i._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener("error",e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(i._canPlayEvent,e._loadFn,!1),e._endFn=e._endListener.bind(e),e._node.addEventListener("ended",e._endFn,!1),e._node.src=t._src,e._node.preload=!0===t._preload?"auto":t._preload,e._node.volume=n*i.volume(),e._node.load()),e},reset:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._rateSeek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++i._counter,e},_errorListener:function(){var e=this;e._parent._emit("loaderror",e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener("error",e._errorFn,!1)},_loadListener:function(){var e=this,t=e._parent;t._duration=Math.ceil(10*e._node.duration)/10,0===Object.keys(t._sprite).length&&(t._sprite={__default:[0,1e3*t._duration]}),"loaded"!==t._state&&(t._state="loaded",t._emit("load"),t._loadQueue()),e._node.removeEventListener(i._canPlayEvent,e._loadFn,!1)},_endListener:function(){var e=this,t=e._parent;t._duration===1/0&&(t._duration=Math.ceil(10*e._node.duration)/10,t._sprite.__default[1]===1/0&&(t._sprite.__default[1]=1e3*t._duration),t._ended(e)),e._node.removeEventListener("ended",e._endFn,!1)}};var s={},o=function(e){var t=e._src;if(s[t])return e._duration=s[t].duration,void c(e);if(/^data:[^;]+;base64,/.test(t)){for(var n=atob(t.split(",")[1]),i=new Uint8Array(n.length),r=0;r0?(s[t._src]=e,c(t,e)):n()};"undefined"!=typeof Promise&&1===i.ctx.decodeAudioData.length?i.ctx.decodeAudioData(e).then(r).catch(n):i.ctx.decodeAudioData(e,r,n)},c=function(e,t){t&&!e._duration&&(e._duration=t.duration),0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue())},h=function(){if(i.usingWebAudio){try{"undefined"!=typeof AudioContext?i.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?i.ctx=new webkitAudioContext:i.usingWebAudio=!1}catch(e){i.usingWebAudio=!1}i.ctx||(i.usingWebAudio=!1);var t=/iP(hone|od|ad)/.test(i._navigator&&i._navigator.platform),n=i._navigator&&i._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),r=n?parseInt(n[1],10):null;if(t&&r&&r<9){var a=/safari/.test(i._navigator&&i._navigator.userAgent.toLowerCase());i._navigator&&!a&&(i.usingWebAudio=!1)}i.usingWebAudio&&(i.masterGain=void 0===i.ctx.createGain?i.ctx.createGainNode():i.ctx.createGain(),i.masterGain.gain.setValueAtTime(i._muted?0:i._volume,i.ctx.currentTime),i.masterGain.connect(i.ctx.destination)),i._setup()}};t.Howler=i,t.Howl=r,void 0!==commonjsGlobal$1?(commonjsGlobal$1.HowlerGlobal=n,commonjsGlobal$1.Howler=i,commonjsGlobal$1.Howl=r,commonjsGlobal$1.Sound=a):"undefined"!=typeof window&&(window.HowlerGlobal=n,window.Howler=i,window.Howl=r,window.Sound=a)}(), /*! * Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported. * * howler.js v2.2.3 * howlerjs.com * * (c) 2013-2020, James Simpson of GoldFire Studios * goldfirestudios.com * * MIT License */ function(){var e;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){var t=this;if(!t.ctx||!t.ctx.listener)return t;for(var n=t._howls.length-1;n>=0;n--)t._howls[n].stereo(e);return t},HowlerGlobal.prototype.pos=function(e,t,n){var i=this;return i.ctx&&i.ctx.listener?(t="number"!=typeof t?i._pos[1]:t,n="number"!=typeof n?i._pos[2]:n,"number"!=typeof e?i._pos:(i._pos=[e,t,n],void 0!==i.ctx.listener.positionX?(i.ctx.listener.positionX.setTargetAtTime(i._pos[0],Howler.ctx.currentTime,.1),i.ctx.listener.positionY.setTargetAtTime(i._pos[1],Howler.ctx.currentTime,.1),i.ctx.listener.positionZ.setTargetAtTime(i._pos[2],Howler.ctx.currentTime,.1)):i.ctx.listener.setPosition(i._pos[0],i._pos[1],i._pos[2]),i)):i},HowlerGlobal.prototype.orientation=function(e,t,n,i,r,a){var s=this;if(!s.ctx||!s.ctx.listener)return s;var o=s._orientation;return t="number"!=typeof t?o[1]:t,n="number"!=typeof n?o[2]:n,i="number"!=typeof i?o[3]:i,r="number"!=typeof r?o[4]:r,a="number"!=typeof a?o[5]:a,"number"!=typeof e?o:(s._orientation=[e,t,n,i,r,a],void 0!==s.ctx.listener.forwardX?(s.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),s.ctx.listener.forwardY.setTargetAtTime(t,Howler.ctx.currentTime,.1),s.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),s.ctx.listener.upX.setTargetAtTime(i,Howler.ctx.currentTime,.1),s.ctx.listener.upY.setTargetAtTime(r,Howler.ctx.currentTime,.1),s.ctx.listener.upZ.setTargetAtTime(a,Howler.ctx.currentTime,.1)):s.ctx.listener.setOrientation(e,t,n,i,r,a),s)},Howl.prototype.init=(e=Howl.prototype.init,function(t){var n=this;return n._orientation=t.orientation||[1,0,0],n._stereo=t.stereo||null,n._pos=t.pos||null,n._pannerAttr={coneInnerAngle:void 0!==t.coneInnerAngle?t.coneInnerAngle:360,coneOuterAngle:void 0!==t.coneOuterAngle?t.coneOuterAngle:360,coneOuterGain:void 0!==t.coneOuterGain?t.coneOuterGain:0,distanceModel:void 0!==t.distanceModel?t.distanceModel:"inverse",maxDistance:void 0!==t.maxDistance?t.maxDistance:1e4,panningModel:void 0!==t.panningModel?t.panningModel:"HRTF",refDistance:void 0!==t.refDistance?t.refDistance:1,rolloffFactor:void 0!==t.rolloffFactor?t.rolloffFactor:1},n._onstereo=t.onstereo?[{fn:t.onstereo}]:[],n._onpos=t.onpos?[{fn:t.onpos}]:[],n._onorientation=t.onorientation?[{fn:t.onorientation}]:[],e.call(this,t)}),Howl.prototype.stereo=function(e,n){var i=this;if(!i._webAudio)return i;if("loaded"!==i._state)return i._queue.push({event:"stereo",action:function(){i.stereo(e,n)}}),i;var r=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===n){if("number"!=typeof e)return i._stereo;i._stereo=e,i._pos=[e,0,0]}for(var a=i._getSoundIds(n),s=0;s2&&void 0!==a[2]?a[2]:1,e.next=3,nextTick();case 3:if(!this.isRuning){e.next=5;break}return e.abrupt("return");case 5:this.isRuning=!0,r=this.formatTick(t,i),this.startTick(r,n,t,i);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"start",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(t,n){var i,r=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=r.length>2&&void 0!==r[2]?r[2]:1,this.isNeedStop=!1,this.setAudioMode(t,n,i);case 3:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"destroy",value:function(){this.ticks=[],this.event.emit("destroy"),console.log("destroy"),state$2.activeTick=-1,state$2.activeTickRepeat=1,this.event.removeAllListeners(),this.isRuning=!1,this.isNeedStop=!0,this.part&&(this.part.clear(),this.part=null)}}]),e}();exports("aF",Player);var useOriginSearch=exports("u",(function(){var e=location.search||location.hash.replaceAll("#/",""),t=queryString.parse(e);if(t.Authorization&&sessionStorage.setItem("Authorization",t.Authorization||""),t.setting)try{t.setting=JSON.parse(decodeURIComponent(t.setting))}catch(n){}return t})),useReload=exports("aT",(function(){var e=useOriginSearch(),t=queryString.stringify(_objectSpread2(_objectSpread2({},e),{},{_t:Date.now()}),{});location.search="?"+t})),useMenu=function(){var e=ref(!0);return useEventListener("click",(function(t){var n=t.path||t.composedPath(),i=n[0];if(i){var r=i.dataset.id&&i.dataset.id.indexOf("auto")>-1,a=n.find((function(e){var t;return"BUTTON"===e.tagName||"button"===(null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"role"))}));if(r||a)return}e.value=!e.value}),{target:document.body.querySelector("#app")}),watch((function(){return state.playState}),(function(t,n){console.log("newRuntime",n);var i=n;"suspend"===i&&(i="pause"),e.value="pause"!==i})),[e]},dayjs_min={exports:{}};!function(e,t){e.exports=function(){var e=1e3,t=6e4,n=36e5,i="millisecond",r="second",a="minute",s="hour",o="day",l="week",u="month",c="quarter",h="year",f="date",d="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},g=function(e,t,n){var i=String(e);return!i||i.length>=t?e:""+Array(t+1-i.length).join(n)+e},y={s:g,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),i=Math.floor(n/60),r=n%60;return(t<=0?"+":"-")+g(i,2,"0")+":"+g(r,2,"0")},m:function e(t,n){if(t.date()1)return e(s[0])}else{var o=t.name;_[o]=t,r=o}return!i&&r&&(b=r),r||!i&&b},w=function(e,t){if(S(e))return e.clone();var n="object"==_typeof3(t)?t:{};return n.date=e,n.args=arguments,new E(n)},k=y;k.l=x,k.i=S,k.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function v(e){this.$L=x(e.locale,null,!0),this.parse(e)}var g=v.prototype;return g.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(k.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var i=t.match(p);if(i){var r=i[2]-1||0,a=(i[7]||"0").substring(0,3);return n?new Date(Date.UTC(i[1],r,i[3]||1,i[4]||0,i[5]||0,i[6]||0,a)):new Date(i[1],r,i[3]||1,i[4]||0,i[5]||0,i[6]||0,a)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},g.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},g.$utils=function(){return k},g.isValid=function(){return!(this.$d.toString()===d)},g.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},g.isAfter=function(e,t){return w(e)\n \n \n Click to add Title\n \n Click to add Composer\n Click to add Copyright\n \n 2021-08-27\n SmartMusic\n \n \n \n \n \n \n \n \n \n 6.5000\n 40\n \n \n 1827.3\n 1292\n \n 61.2\n 61.5\n 379.6\n 61.3\n \n \n \n 1.0000\n 1.0000\n 5.0000\n 1.0000\n 1.0000\n 3.4199\n 1.0000\n 60\n 50\n \n \n \n \n \n \n \n Music\n \n Music\n wind.flutes.flute\n \n Finale Default Bank\n \n \n \n \n \n \n \n \n \n \n 60\n 0\n \n 40\n \n system\n \n \n 3840\n \n 0\n major\n \n \n \n G\n 2\n \n \n \n \n \n C\n 5\n \n 15360\n 1\n whole\n \n \n \n \n ',text:""}:5==e||6==e?{xml:'\n \n \n Click to add Title\n \n Click to add Composer\n Click to add Copyright\n \n 2021-08-27\n SmartMusic\n \n \n \n \n \n \n \n \n \n 6.5000\n 40\n \n \n 1827.4\n 1292.1\n \n 61.3\n 61.5\n 355.6\n 61.4\n \n \n \n 1.0000\n 1.0000\n 5.0000\n 1.0000\n 1.0000\n 3.4199\n 1.0000\n 60\n 50\n \n \n \n \n \n \n \n Music\n \n Music\n wind.flutes.flute\n \n Finale Default Bank\n \n \n \n \n \n \n \n \n \n \n 60\n 0\n \n 40\n \n system\n \n \n 3840\n \n 1\n major\n \n \n \n G\n 2\n \n \n \n \n \n C\n 5\n \n 15360\n 1\n whole\n \n \n \n \n ',text:"C"}:13==e?{xml:'\n \n \n Click to add Title\n \n Click to add Composer\n Click to add Copyright\n \n 2021-08-27\n SmartMusic\n \n \n \n \n \n \n \n \n \n 6.5000\n 40\n \n \n 1827.4\n 1292.1\n \n 61.3\n 61.5\n 355.6\n 61.4\n \n \n \n 1.0000\n 1.0000\n 5.0000\n 1.0000\n 1.0000\n 3.4199\n 1.0000\n 60\n 50\n \n \n \n \n \n \n \n Music\n \n Music\n wind.flutes.flute\n \n Finale Default Bank\n \n \n \n \n \n \n \n \n \n \n 60\n 0\n \n 40\n \n system\n \n \n 3840\n \n -1\n major\n \n \n \n G\n 2\n \n \n \n \n \n F\n 4\n \n 15360\n 1\n whole\n \n \n \n \n ',text:"F"}:14==e||15==e?{xml:'\n \n \n Click to add Title\n \n Click to add Composer\n Click to add Copyright\n \n 2021-08-27\n SmartMusic\n \n \n \n \n \n \n \n \n \n 6.5000\n 40\n \n \n 1827.4\n 1292.1\n \n 61.3\n 61.5\n 355.6\n 61.4\n \n \n \n 1.0000\n 1.0000\n 5.0000\n 1.0000\n 1.0000\n 3.4199\n 1.0000\n 60\n 50\n \n \n \n \n \n \n \n Music\n \n Music\n wind.flutes.flute\n \n Finale Default Bank\n \n \n \n \n \n \n \n \n \n \n 60\n 0\n \n 40\n \n system\n \n \n 3840\n \n -2\n major\n \n \n \n F\n 4\n \n \n \n \n \n B\n -1\n 2\n \n 15360\n 1\n whole\n \n \n \n \n ',text:"S"}:120==e?{xml:'\n \n \n Click to add Title\n \n Click to add Composer\n Click to add Copyright\n \n 2021-08-27\n SmartMusic\n \n \n \n \n \n \n \n \n \n 6.5000\n 40\n \n \n 1827.3\n 1292\n \n 61.2\n 61.5\n 379.6\n 61.3\n \n \n \n 1.0000\n 1.0000\n 5.0000\n 1.0000\n 1.0000\n 3.4199\n 1.0000\n 60\n 50\n \n \n \n \n \n \n \n Music\n \n Music\n wind.flutes.flute\n \n Finale Default Bank\n \n \n \n \n \n \n \n \n \n \n 60\n 0\n \n 40\n \n system\n \n \n 3840\n \n 0\n major\n \n \n \n G\n 2\n \n \n \n \n \n A\n 5\n \n 15360\n 1\n whole\n \n \n \n \n ',text:"A"}:{xml:'\n \n \n Click to add Title\n \n Click to add Composer\n Click to add Copyright\n \n 2021-08-27\n SmartMusic\n \n \n \n \n \n \n \n \n \n 6.5000\n 40\n \n \n 1827.4\n 1292.1\n \n 61.3\n 61.5\n 355.6\n 61.4\n \n \n \n 1.0000\n 1.0000\n 5.0000\n 1.0000\n 1.0000\n 3.4199\n 1.0000\n 60\n 50\n \n \n \n \n \n \n \n Music\n \n Music\n wind.flutes.flute\n \n Finale Default Bank\n \n \n \n \n \n \n \n \n \n \n 60\n 0\n \n 40\n \n system\n \n \n 3840\n \n -2\n major\n \n \n \n G\n 2\n \n \n \n \n \n B\n -1\n 4\n \n 15360\n 1\n whole\n \n \n \n \n ',text:"Bb"}})),checkStatus=ref("checking"),checkFrequency=ref(0),dotIcons=ref([iconWhite,iconWhite,iconWhite]),trend=ref(-1),time=ref(0),useStart=function(t){var n=getAllNodes(t);checkFrequency.value=n[0].frequency,postMessage({api:"proxyServiceMessage",content:{header:{status:200,commond:"xmlInfo",type:"SOUND_CHECK"},body:{frequency:checkFrequency.value}}}),postMessage({api:"startSoundCheck"},(function(){checkStatus.value="checking";try{localStorage.setItem(storeKeys.lastCheckTime,""+(new Date).valueOf())}catch(e){}}))},useEnd=function(){postMessage({api:"endSoundCheck"})},useLister=function(){var e=function(e){var t,n=null==e||null===(t=e.content)||void 0===t?void 0:t.body.frequency;console.log("frequency",n,checkFrequency.value),trend.value=Math.abs(n-checkFrequency.value)<=5?0:n-checkFrequency.value>0?1:-1,dotIcons.value=[iconWhite,iconWhite,iconWhite],dotIcons.value[trend.value+1]=0===trend.value?iconGreen:iconRed,0!==trend.value&&(time.value=(new Date).getTime()),(new Date).getTime()-time.value>3e3&&(useEnd(),checkStatus.value="success",dotIcons.value=[iconGreen,iconGreen,iconGreen],setTimeout((function(){soundEffectShow.value=!1}),1e3))};onMounted((function(){listenerMessage("sendResult",e)})),onBeforeUnmount((function(){removeListenerMessage("sendResult",e)}))},soundEffectShow=ref(!1),SoundEffect=exports("ab",defineComponent({name:"ColexiuSoundEffect",emits:["success","close","pass","fail"],setup:function(e,t){var n=t.emit,i=ref(!1),r=ref(!1);return useLister(),watch([soundEffectShow,checkStatus],(function(){"success"===checkStatus.value&&n("success"),"fail"===checkStatus.value&&n("fail"),!1===soundEffectShow.value&&(i.value=!1,n("close"),useEnd())})),function(){var e=score(2),t=(null==e?void 0:e.xml)||"";return createVNode(Popup,{position:"bottom",show:soundEffectShow.value,"onUpdate:show":function(e){return soundEffectShow.value=e},onOpen:function(){return i.value=!0},onClosed:function(){return i.value=!1},teleport:"body"},{default:function(){return[createVNode("div",{class:styles$f.box},[createVNode("img",{class:styles$f.iconSound,src:iconSound$1},null),createVNode("div",{class:styles$f.wrap},[createVNode("div",{class:styles$f.staff},[i.value&&createVNode(MusicSheet,{isSoundEffect:!0,opotions:{stretchLastSystemLine:!0,drawMetronomeMarks:!1,drawPartAbbreviations:!1,drawPartNames:!1,drawSlurs:!1,drawTimeSignatures:!1,followCursor:!1},score:t,showSection:!1,onRerender:useStart},null)]),createVNode("div",{class:styles$f.des},[createTextVNode("请演奏 "),createVNode("span",{style:{color:"var(--primary-color)"}},[e.text]),createTextVNode("直到绿灯全部亮起")]),createVNode("div",{class:styles$f.lampWrap},[dotIcons.value.map((function(e,t){return createVNode("div",{class:styles$f.lamp,key:t},[createVNode("img",{class:["checking"===checkStatus.value&&styles$f.flickerAnimate],src:e},null)])}))])]),createVNode("img",{class:styles$f.bottom,src:iconBottom},null),createVNode(Button,{class:styles$f.button,icon:backIcon,onClick:function(){return soundEffectShow.value=!1}},null),createVNode(Popover,{class:styles$f.skepItems,show:r.value,"onUpdate:show":function(e){return r.value=e},actions:[{text:"跳过本次"},{text:"关闭校音"}],onSelect:function(e){return function(e){"关闭校音"===e.text&&(state$4.sett.tuning=!1),n("pass"),soundEffectShow.value=!1}(e)},showArrow:!1},{reference:function(){return createVNode(Button,{class:styles$f.skepBtn,icon:iconArrow,iconPosition:"right"},{default:function(){return[createTextVNode("跳过本次")]}})}})])]}})}}})),box="_box_a7vlt_1",bg$2="_bg_a7vlt_9",button$2="_button_a7vlt_16",iconSound="_iconSound_a7vlt_33",skepBtn="_skepBtn_a7vlt_39",wrap$4="_wrap_a7vlt_53",wrapContainer="_wrapContainer_a7vlt_59",top="_top_a7vlt_65",title$6="_title_a7vlt_72",num="_num_a7vlt_82",txt="_txt_a7vlt_86",iconLeft="_iconLeft_a7vlt_89",iconTop="_iconTop_a7vlt_93",evaluatWrap="_evaluatWrap_a7vlt_98",evaluatTitle="_evaluatTitle_a7vlt_129",evaluatIcon="_evaluatIcon_a7vlt_134",fraction="_fraction_a7vlt_140",line="_line_a7vlt_147",tips="_tips_a7vlt_152",btns="_btns_a7vlt_165",btnIcon="_btnIcon_a7vlt_178",rigthBtns="_rigthBtns_a7vlt_183",confirm="_confirm_a7vlt_193",iconTitle$1="_iconTitle_a7vlt_199",footer="_footer_a7vlt_204",sbtn="_sbtn_a7vlt_233",styles$e={box:box,bg:bg$2,button:button$2,iconSound:iconSound,skepBtn:skepBtn,wrap:wrap$4,wrapContainer:wrapContainer,top:top,title:title$6,num:num,txt:txt,iconLeft:iconLeft,iconTop:iconTop,evaluatWrap:evaluatWrap,evaluatTitle:evaluatTitle,evaluatIcon:evaluatIcon,fraction:fraction,line:line,tips:tips,btns:btns,btnIcon:btnIcon,rigthBtns:rigthBtns,confirm:confirm,iconTitle:iconTitle$1,footer:footer,sbtn:sbtn},iconTitle="/orchestra-music-score/assets/title.26d31e69.svg",iconCancel="/orchestra-music-score/assets/cancel.79fe3f5e.svg",iconConfirm="/orchestra-music-score/assets/confirm.8050789e.svg",iconLianxi="/orchestra-music-score/assets/icon-lianxi.104eeb83.svg",iconReport="/orchestra-music-score/assets/icon-report.7c7e9fcf.svg",TryIcon="/orchestra-music-score/assets/try.8a1d0eec.svg",IntegrityIcon="/orchestra-music-score/assets/integrity.f311836f.svg",IntonationIcon="/orchestra-music-score/assets/intonation.64e00f66.svg",CadenceIcon="/orchestra-music-score/assets/cadence.18a7a60b.svg",Image1$1="/orchestra-music-score/assets/5.d8bfbf51.png",Image2$1="/orchestra-music-score/assets/4.cfa387c7.png",Image3$1="/orchestra-music-score/assets/3.d02c685a.png",Image4$1="/orchestra-music-score/assets/2.5c4c2ef5.png",Image5$1="/orchestra-music-score/assets/1.a0d5037d.png",IconBad="/orchestra-music-score/assets/bad.d9395829.png",IconGood="/orchestra-music-score/assets/good.b0fbfb32.png",IconGreat="/orchestra-music-score/assets/great.55272f0a.png",IconPerfect="/orchestra-music-score/assets/perfect.ab44b0e5.png",icons={1:{icon:IconBad,text:"bad"},2:{icon:IconGood,text:"good"},3:{icon:IconGreat,text:"great"},4:{icon:IconPerfect,text:"perfect"}},constant={1:{img:Image1$1,tips:"你的演奏不太好,再练一练吧~",mome:"敢于尝试"},2:{img:Image2$1,tips:"你的演奏还不熟练,加紧训练才能有好成绩哦~",mome:"还要加油哦~"},3:{img:Image3$1,tips:"你的演奏还不流畅,科学的练习才能更完美哦~",mome:"突破自我"},4:{img:Image4$1,tips:"你的演奏还不错,继续加油吧,离完美就差一步啦~",mome:"崭露头角"},5:{img:Image5$1,tips:"你的演奏完美无缺,继续努力吧~",mome:"你很棒"}},getLeveByScoreId=function(e){if(!e&&"number"!=typeof e)return{};var t=1;return e>20&&e<=40?t=2:e>40&&e<=60?t=3:e>60&&e<=80?t=4:e>80&&(t=5),t},getLeveByScore=exports("aM",(function(e){if(!e&&"number"!=typeof e)return{};var t=getLeveByScoreId(e);return constant[t]})),getLeveByScoreMeasure=exports("j",(function(e){if(!e&&"number"!=typeof e)return{};var t=1;return e>=40&&e<70?t=2:e>=70&&e<90?t=3:e>=90&&(t=4),icons[t]})),Image1="/orchestra-music-score/assets/5.a95933dd.svg",Image2="/orchestra-music-score/assets/4.49f14e1f.svg",Image3="/orchestra-music-score/assets/3.240ee5fd.svg",Image4="/orchestra-music-score/assets/2.ce512136.svg",Image5="/orchestra-music-score/assets/1.aad3802e.svg",iconShare="/orchestra-music-score/assets/icon-share.9f124616.svg",iconUpload="/orchestra-music-score/assets/icon-upload.53f774c1.svg",accompaniment="/orchestra-music-score/assets/accompaniment.b83f0e6e.svg",__glob_2_0=Object.freeze(Object.defineProperty({__proto__:null,default:accompaniment},Symbol.toStringTag,{value:"Module"})),back$1="/orchestra-music-score/assets/back.0e8784e6.svg",__glob_2_1=Object.freeze(Object.defineProperty({__proto__:null,default:back$1},Symbol.toStringTag,{value:"Module"})),backgroundClose="/orchestra-music-score/assets/background-close.292949ba.svg",__glob_2_2=Object.freeze(Object.defineProperty({__proto__:null,default:backgroundClose},Symbol.toStringTag,{value:"Module"})),background$1="/orchestra-music-score/assets/background.66e3a94f.svg",__glob_2_3=Object.freeze(Object.defineProperty({__proto__:null,default:background$1},Symbol.toStringTag,{value:"Module"})),camera="/orchestra-music-score/assets/camera.6735691d.svg",__glob_2_4=Object.freeze(Object.defineProperty({__proto__:null,default:camera},Symbol.toStringTag,{value:"Module"})),equilibrium="/orchestra-music-score/assets/equilibrium.f9043cf5.svg",__glob_2_5=Object.freeze(Object.defineProperty({__proto__:null,default:equilibrium},Symbol.toStringTag,{value:"Module"})),evaluating$1="/orchestra-music-score/assets/evaluating.9eb5cfac.svg",__glob_2_6=Object.freeze(Object.defineProperty({__proto__:null,default:evaluating$1},Symbol.toStringTag,{value:"Module"})),fingeringOff="/orchestra-music-score/assets/fingeringOff.b63542d4.svg",__glob_2_7=Object.freeze(Object.defineProperty({__proto__:null,default:fingeringOff},Symbol.toStringTag,{value:"Module"})),fingeringOn="/orchestra-music-score/assets/fingeringOn.32644085.svg",__glob_2_8=Object.freeze(Object.defineProperty({__proto__:null,default:fingeringOn},Symbol.toStringTag,{value:"Module"})),gudingActive="/orchestra-music-score/assets/guding-active.ffb42216.svg",__glob_2_9=Object.freeze(Object.defineProperty({__proto__:null,default:gudingActive},Symbol.toStringTag,{value:"Module"})),guding="/orchestra-music-score/assets/guding.a3ea7233.svg",__glob_2_10=Object.freeze(Object.defineProperty({__proto__:null,default:guding},Symbol.toStringTag,{value:"Module"})),iconBack="/orchestra-music-score/assets/icon-back.f7c9eb40.svg",__glob_2_11=Object.freeze(Object.defineProperty({__proto__:null,default:iconBack},Symbol.toStringTag,{value:"Module"})),iconEvaluatingEnd="/orchestra-music-score/assets/icon-evaluatingEnd.438e3cc0.svg",__glob_2_12=Object.freeze(Object.defineProperty({__proto__:null,default:iconEvaluatingEnd},Symbol.toStringTag,{value:"Module"})),iconEvaluatingStart=exports("H","/orchestra-music-score/assets/icon-evaluatingStart.ef7aea8e.svg"),__glob_2_13=Object.freeze(Object.defineProperty({__proto__:null,default:iconEvaluatingStart},Symbol.toStringTag,{value:"Module"})),iconStaffActive="/orchestra-music-score/assets/icon-staff-active.c1d6b682.svg",__glob_2_14=Object.freeze(Object.defineProperty({__proto__:null,default:iconStaffActive},Symbol.toStringTag,{value:"Module"})),iconStaff="/orchestra-music-score/assets/icon-staff.5a2b7c94.svg",__glob_2_15=Object.freeze(Object.defineProperty({__proto__:null,default:iconStaff},Symbol.toStringTag,{value:"Module"})),iconZhuanpu="/orchestra-music-score/assets/icon-zhuanpu.1a6e0bcb.svg",__glob_2_16=Object.freeze(Object.defineProperty({__proto__:null,default:iconZhuanpu},Symbol.toStringTag,{value:"Module"})),jia="/orchestra-music-score/assets/jia.362e133d.svg",__glob_2_17=Object.freeze(Object.defineProperty({__proto__:null,default:jia},Symbol.toStringTag,{value:"Module"})),jian="/orchestra-music-score/assets/jian.ce0820a8.svg",__glob_2_18=Object.freeze(Object.defineProperty({__proto__:null,default:jian},Symbol.toStringTag,{value:"Module"})),jianpu="/orchestra-music-score/assets/jianpu.70310e35.svg",__glob_2_19=Object.freeze(Object.defineProperty({__proto__:null,default:jianpu},Symbol.toStringTag,{value:"Module"})),model1="/orchestra-music-score/assets/model-1.5cdc3b59.svg",__glob_2_20=Object.freeze(Object.defineProperty({__proto__:null,default:model1},Symbol.toStringTag,{value:"Module"})),model2="/orchestra-music-score/assets/model-2.aedda1e7.svg",__glob_2_21=Object.freeze(Object.defineProperty({__proto__:null,default:model2},Symbol.toStringTag,{value:"Module"})),model3="/orchestra-music-score/assets/model-3.f6cc2e96.svg",__glob_2_22=Object.freeze(Object.defineProperty({__proto__:null,default:model3},Symbol.toStringTag,{value:"Module"})),modelType$1="/orchestra-music-score/assets/modelType.7dff5016.svg",__glob_2_23=Object.freeze(Object.defineProperty({__proto__:null,default:modelType$1},Symbol.toStringTag,{value:"Module"})),musicList="/orchestra-music-score/assets/music-list.8ad9f128.svg",__glob_2_24=Object.freeze(Object.defineProperty({__proto__:null,default:musicList},Symbol.toStringTag,{value:"Module"})),musicList1="/orchestra-music-score/assets/music-list1.16180b5c.svg",__glob_2_25=Object.freeze(Object.defineProperty({__proto__:null,default:musicList1},Symbol.toStringTag,{value:"Module"})),music="/orchestra-music-score/assets/music.855d26de.svg",__glob_2_26=Object.freeze(Object.defineProperty({__proto__:null,default:music},Symbol.toStringTag,{value:"Module"})),part="/orchestra-music-score/assets/part.7184ecd4.svg",__glob_2_27=Object.freeze(Object.defineProperty({__proto__:null,default:part},Symbol.toStringTag,{value:"Module"})),pause$1="/orchestra-music-score/assets/pause.1f3a158e.svg",__glob_2_28=Object.freeze(Object.defineProperty({__proto__:null,default:pause$1},Symbol.toStringTag,{value:"Module"})),play$1="/orchestra-music-score/assets/play.4cb46bbb.svg",__glob_2_29=Object.freeze(Object.defineProperty({__proto__:null,default:play$1},Symbol.toStringTag,{value:"Module"})),practice="/orchestra-music-score/assets/practice.a1fec217.svg",__glob_2_30=Object.freeze(Object.defineProperty({__proto__:null,default:practice},Symbol.toStringTag,{value:"Module"})),practise="/orchestra-music-score/assets/practise.cdd135b3.svg",__glob_2_31=Object.freeze(Object.defineProperty({__proto__:null,default:practise},Symbol.toStringTag,{value:"Module"})),record="/orchestra-music-score/assets/record.214e6a6d.svg",__glob_2_32=Object.freeze(Object.defineProperty({__proto__:null,default:record},Symbol.toStringTag,{value:"Module"})),resetShengyin="/orchestra-music-score/assets/reset-shengyin.af688c9a.svg",__glob_2_33=Object.freeze(Object.defineProperty({__proto__:null,default:resetShengyin},Symbol.toStringTag,{value:"Module"})),reset="/orchestra-music-score/assets/reset.8f0314cd.svg",__glob_2_34=Object.freeze(Object.defineProperty({__proto__:null,default:reset},Symbol.toStringTag,{value:"Module"})),restore="/orchestra-music-score/assets/restore.3a4a6db3.svg",__glob_2_35=Object.freeze(Object.defineProperty({__proto__:null,default:restore},Symbol.toStringTag,{value:"Module"})),section$1="/orchestra-music-score/assets/section.f9765b45.svg",__glob_2_36=Object.freeze(Object.defineProperty({__proto__:null,default:section$1},Symbol.toStringTag,{value:"Module"})),section1="/orchestra-music-score/assets/section1.8f6086dd.svg",__glob_2_37=Object.freeze(Object.defineProperty({__proto__:null,default:section1},Symbol.toStringTag,{value:"Module"})),section2="/orchestra-music-score/assets/section2.7715197f.svg",__glob_2_38=Object.freeze(Object.defineProperty({__proto__:null,default:section2},Symbol.toStringTag,{value:"Module"})),setting$1="/orchestra-music-score/assets/setting.d2c48eac.svg",__glob_2_39=Object.freeze(Object.defineProperty({__proto__:null,default:setting$1},Symbol.toStringTag,{value:"Module"})),shuodiaoActive="/orchestra-music-score/assets/shuodiao-active.6b157b93.svg",__glob_2_40=Object.freeze(Object.defineProperty({__proto__:null,default:shuodiaoActive},Symbol.toStringTag,{value:"Module"})),shuodiao="/orchestra-music-score/assets/shuodiao.da855d30.svg",__glob_2_41=Object.freeze(Object.defineProperty({__proto__:null,default:shuodiao},Symbol.toStringTag,{value:"Module"})),speed$2="/orchestra-music-score/assets/speed.256b84ef.svg",__glob_2_42=Object.freeze(Object.defineProperty({__proto__:null,default:speed$2},Symbol.toStringTag,{value:"Module"})),staff="/orchestra-music-score/assets/staff.f226ff22.svg",__glob_2_43=Object.freeze(Object.defineProperty({__proto__:null,default:staff},Symbol.toStringTag,{value:"Module"})),start$3="/orchestra-music-score/assets/start.7b27072b.svg",__glob_2_44=Object.freeze(Object.defineProperty({__proto__:null,default:start$3},Symbol.toStringTag,{value:"Module"})),stop="/orchestra-music-score/assets/stop.e36ceb44.svg",__glob_2_45=Object.freeze(Object.defineProperty({__proto__:null,default:stop},Symbol.toStringTag,{value:"Module"})),taskBg="/orchestra-music-score/assets/task-bg.859300d7.svg",__glob_2_46=Object.freeze(Object.defineProperty({__proto__:null,default:taskBg},Symbol.toStringTag,{value:"Module"})),tuning="/orchestra-music-score/assets/tuning.4b86afaf.svg",__glob_2_47=Object.freeze(Object.defineProperty({__proto__:null,default:tuning},Symbol.toStringTag,{value:"Module"})),volPlus="/orchestra-music-score/assets/vol-plus.8301fc70.svg",__glob_2_48=Object.freeze(Object.defineProperty({__proto__:null,default:volPlus},Symbol.toStringTag,{value:"Module"})),vol="/orchestra-music-score/assets/vol.4b3b0407.svg",__glob_2_49=Object.freeze(Object.defineProperty({__proto__:null,default:vol},Symbol.toStringTag,{value:"Module"})),____="/orchestra-music-score/assets/评测记录.5949e468.svg",__glob_2_50=Object.freeze(Object.defineProperty({__proto__:null,default:____},Symbol.toStringTag,{value:"Module"})),getAssetsHomeFile=function(e){var t,n="./icons/".concat(e,".svg");return null===(t={"./icons/accompaniment.svg":__glob_2_0,"./icons/back.svg":__glob_2_1,"./icons/background-close.svg":__glob_2_2,"./icons/background.svg":__glob_2_3,"./icons/camera.svg":__glob_2_4,"./icons/equilibrium.svg":__glob_2_5,"./icons/evaluating.svg":__glob_2_6,"./icons/fingeringOff.svg":__glob_2_7,"./icons/fingeringOn.svg":__glob_2_8,"./icons/guding-active.svg":__glob_2_9,"./icons/guding.svg":__glob_2_10,"./icons/icon-back.svg":__glob_2_11,"./icons/icon-evaluatingEnd.svg":__glob_2_12,"./icons/icon-evaluatingStart.svg":__glob_2_13,"./icons/icon-staff-active.svg":__glob_2_14,"./icons/icon-staff.svg":__glob_2_15,"./icons/icon-zhuanpu.svg":__glob_2_16,"./icons/jia.svg":__glob_2_17,"./icons/jian.svg":__glob_2_18,"./icons/jianpu.svg":__glob_2_19,"./icons/model-1.svg":__glob_2_20,"./icons/model-2.svg":__glob_2_21,"./icons/model-3.svg":__glob_2_22,"./icons/modelType.svg":__glob_2_23,"./icons/music-list.svg":__glob_2_24,"./icons/music-list1.svg":__glob_2_25,"./icons/music.svg":__glob_2_26,"./icons/part.svg":__glob_2_27,"./icons/pause.svg":__glob_2_28,"./icons/play.svg":__glob_2_29,"./icons/practice.svg":__glob_2_30,"./icons/practise.svg":__glob_2_31,"./icons/record.svg":__glob_2_32,"./icons/reset-shengyin.svg":__glob_2_33,"./icons/reset.svg":__glob_2_34,"./icons/restore.svg":__glob_2_35,"./icons/section.svg":__glob_2_36,"./icons/section1.svg":__glob_2_37,"./icons/section2.svg":__glob_2_38,"./icons/setting.svg":__glob_2_39,"./icons/shuodiao-active.svg":__glob_2_40,"./icons/shuodiao.svg":__glob_2_41,"./icons/speed.svg":__glob_2_42,"./icons/staff.svg":__glob_2_43,"./icons/start.svg":__glob_2_44,"./icons/stop.svg":__glob_2_45,"./icons/task-bg.svg":__glob_2_46,"./icons/tuning.svg":__glob_2_47,"./icons/vol-plus.svg":__glob_2_48,"./icons/vol.svg":__glob_2_49,"./icons/评测记录.svg":__glob_2_50}[n])||void 0===t?void 0:t.default},ButtonIcon=exports("I",defineComponent({name:"ButtonIcon",props:{name:{type:String}},setup:function(e){return function(){return e.name?createVNode("img",{src:getAssetsHomeFile(e.name)},null):null}}})),classnames$1={exports:{}}; /*! Copyright (c) 2017 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ !function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e=[],i=0;i=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,n,s):r(t,n))||s);return a>3&&s&&Object.defineProperty(t,n,s),s /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */}var t$3=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,e$8=Symbol(),n$5=new Map,s$3=function(){function e(t,n){if(_classCallCheck2(this,e),this._$cssResult$=!0,n!==e$8)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}return _createClass2(e,[{key:"styleSheet",get:function(){var e=n$5.get(this.cssText);return t$3&&void 0===e&&(n$5.set(this.cssText,e=new CSSStyleSheet),e.replaceSync(this.cssText)),e}},{key:"toString",value:function(){return this.cssText}}]),e}(),o$5=function(e){return new s$3("string"==typeof e?e:e+"",e$8)},r$3=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i>>0,1)}},{key:"_$Em",value:function(){var e=this;this.constructor.elementProperties.forEach((function(t,n){e.hasOwnProperty(n)&&(e._$Et.set(n,e[n]),delete e[n])}))}},{key:"createRenderRoot",value:function(){var e,t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return i$3(t,this.constructor.elementStyles),t}},{key:"connectedCallback",value:function(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$Eg)||void 0===e||e.forEach((function(e){var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}},{key:"enableUpdating",value:function(e){}},{key:"disconnectedCallback",value:function(){var e;null===(e=this._$Eg)||void 0===e||e.forEach((function(e){var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}},{key:"attributeChangedCallback",value:function(e,t,n){this._$AK(e,n)}},{key:"_$ES",value:function(e,t){var n,i,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l$3,a=this.constructor._$Eh(e,r);if(void 0!==a&&!0===r.reflect){var s=(null!==(i=null===(n=r.converter)||void 0===n?void 0:n.toAttribute)&&void 0!==i?i:o$4.toAttribute)(t,r.type);this._$Ei=e,null==s?this.removeAttribute(a):this.setAttribute(a,s),this._$Ei=null}}},{key:"_$AK",value:function(e,t){var n,i,r,a=this.constructor,s=a._$Eu.get(e);if(void 0!==s&&this._$Ei!==s){var o=a.getPropertyOptions(s),l=o.converter,u=null!==(r=null!==(i=null===(n=l)||void 0===n?void 0:n.fromAttribute)&&void 0!==i?i:"function"==typeof l?l:null)&&void 0!==r?r:o$4.fromAttribute;this._$Ei=s,this[s]=u(t,o.type),this._$Ei=null}}},{key:"requestUpdate",value:function(e,t,n){var i=!0;void 0!==e&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||n$4)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===n.reflect&&this._$Ei!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,n))):i=!1),!this.isUpdatePending&&i&&(this._$Ep=this._$E_())}},{key:"_$E_",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.isUpdatePending=!0,e.prev=1,e.next=4,this._$Ep;case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),Promise.reject(e.t0);case 9:if(t=this.scheduleUpdate(),e.t1=null!=t,!e.t1){e.next=14;break}return e.next=14,t;case 14:return e.abrupt("return",!this.isUpdatePending);case 15:case"end":return e.stop()}}),e,this,[[1,6]])}))),function(){return t.apply(this,arguments)})},{key:"scheduleUpdate",value:function(){return this.performUpdate()}},{key:"performUpdate",value:function(){var e,t=this;if(this.isUpdatePending){this.hasUpdated,this._$Et&&(this._$Et.forEach((function(e,n){return t[n]=e})),this._$Et=void 0);var n=!1,i=this._$AL;try{(n=this.shouldUpdate(i))?(this.willUpdate(i),null===(e=this._$Eg)||void 0===e||e.forEach((function(e){var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)})),this.update(i)):this._$EU()}catch(e){throw n=!1,this._$EU(),e}n&&this._$AE(i)}}},{key:"willUpdate",value:function(e){}},{key:"_$AE",value:function(e){var t;null===(t=this._$Eg)||void 0===t||t.forEach((function(e){var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}},{key:"_$EU",value:function(){this._$AL=new Map,this.isUpdatePending=!1}},{key:"updateComplete",get:function(){return this.getUpdateComplete()}},{key:"getUpdateComplete",value:function(){return this._$Ep}},{key:"shouldUpdate",value:function(e){return!0}},{key:"update",value:function(e){var t=this;void 0!==this._$EC&&(this._$EC.forEach((function(e,n){return t._$ES(n,t[n],e)})),this._$EC=void 0),this._$EU()}},{key:"updated",value:function(e){}},{key:"firstUpdated",value:function(e){}}],[{key:"addInitializer",value:function(e){var t;null!==(t=this.l)&&void 0!==t||(this.l=[]),this.l.push(e)}},{key:"observedAttributes",get:function(){var e=this;this.finalize();var t=[];return this.elementProperties.forEach((function(n,i){var r=e._$Eh(i,n);void 0!==r&&(e._$Eu.set(r,i),t.push(r))})),t}},{key:"createProperty",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l$3;if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){var n="symbol"==_typeof3(e)?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,t);void 0!==i&&Object.defineProperty(this.prototype,e,i)}}},{key:"getPropertyDescriptor",value:function(e,t,n){return{get:function(){return this[t]},set:function(i){var r=this[e];this[t]=i,this.requestUpdate(e,r,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function(e){return this.elementProperties.get(e)||l$3}},{key:"finalize",value:function(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;var e=Object.getPrototypeOf(this);if(e.finalize(),this.elementProperties=new Map(e.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){var t,n=this.properties,i=_createForOfIteratorHelper([].concat(_toConsumableArray2(Object.getOwnPropertyNames(n)),_toConsumableArray2(Object.getOwnPropertySymbols(n))));try{for(i.s();!(t=i.n()).done;){var r=t.value;this.createProperty(r,n[r])}}catch(err){i.e(err)}finally{i.f()}}return this.elementStyles=this.finalizeStyles(this.styles),!0}},{key:"finalizeStyles",value:function(e){var t=[];if(Array.isArray(e)){var n,i=_createForOfIteratorHelper(new Set(e.flat(1/0).reverse()));try{for(i.s();!(n=i.n()).done;){var r=n.value;t.unshift(S$1(r))}}catch(err){i.e(err)}finally{i.f()}}else void 0!==e&&t.push(S$1(e));return t}},{key:"_$Eh",value:function(e,t){var n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}}]),i}(_wrapNativeSuper2(HTMLElement)),t$2;a$1.finalized=!0,a$1.elementProperties=new Map,a$1.elementStyles=[],a$1.shadowRootOptions={mode:"open"},null==h$2||h$2({ReactiveElement:a$1}),(null!==(s$2=globalThis.reactiveElementVersions)&&void 0!==s$2?s$2:globalThis.reactiveElementVersions=[]).push("1.3.1");var i$2=globalThis.trustedTypes,s$1=i$2?i$2.createPolicy("lit-html",{createHTML:function(e){return e}}):void 0,e$6="lit$".concat((Math.random()+"").slice(9),"$"),o$3="?"+e$6,n$3="<".concat(o$3,">"),l$2=document,h$1=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return l$2.createComment(e)},r$1=function(e){return null===e||"object"!=_typeof3(e)&&"function"!=typeof e},d=Array.isArray,u$1=function(e){var t;return d(e)||"function"==typeof(null===(t=e)||void 0===t?void 0:t[Symbol.iterator])},c$2=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v$1=/-->/g,a$2=/>/g,f$1=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,_$1=/'/g,m$2=/"/g,g=/^(?:script|style|textarea|title)$/i,p$1=function(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r":"",s=c$2,o=0;o"===c[0]?(s=null!=n?n:c$2,h=-1):void 0===c[1]?h=-2:(h=s.lastIndex-c[2].length,u=c[1],s=void 0===c[3]?f$1:'"'===c[3]?m$2:_$1):s===m$2||s===_$1?s=f$1:s===v$1||s===a$2?s=c$2:(s=f$1,n=void 0);var d=s===f$1&&e[o+1].startsWith("/>")?" ":"";a+=s===c$2?l+n$3:h>=0?(r.push(u),l.slice(0,h)+"$lit$"+l.slice(h)+e$6+d):l+e$6+(-2===h?(r.push(void 0),o):d)}var p=a+(e[i]||"")+(2===t?"":"");if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==s$1?s$1.createHTML(p):p,r]},E=function(){function e(t,n){var i,r=t.strings,a=t._$litType$;_classCallCheck2(this,e),this.parts=[];var s=0,o=0,l=r.length-1,u=this.parts,c=_slicedToArray(C(r,a),2),h=c[0],f=c[1];if(this.el=e.createElement(h,n),A.currentNode=this.el.content,2===a){var d=this.el.content,p=d.firstChild;p.remove(),d.append.apply(d,_toConsumableArray2(p.childNodes))}for(;null!==(i=A.nextNode())&&u.length0){i.textContent=i$2?i$2.emptyScript:"";for(var L=0;L2&&void 0!==arguments[2]?arguments[2]:e,o=arguments.length>3?arguments[3]:void 0;if(t===b)return t;var l=void 0!==o?null===(n=s._$Cl)||void 0===n?void 0:n[o]:s._$Cu,u=r$1(t)?void 0:t._$litDirective$;return(null==l?void 0:l.constructor)!==u&&(null===(i=null==l?void 0:l._$AO)||void 0===i||i.call(l,!1),void 0===u?l=void 0:(l=new u(e))._$AT(e,s,o),void 0!==o?(null!==(r=(a=s)._$Cl)&&void 0!==r?r:a._$Cl=[])[o]=l:s._$Cu=l),void 0!==l&&(t=P(e,l._$AS(e,t.values),l,o)),t}var V=function(){function e(t,n){_classCallCheck2(this,e),this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=n}return _createClass2(e,[{key:"parentNode",get:function(){return this._$AM.parentNode}},{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"p",value:function(e){var t,n=this._$AD,i=n.el.content,r=n.parts,a=(null!==(t=null==e?void 0:e.creationScope)&&void 0!==t?t:l$2).importNode(i,!0);A.currentNode=a;for(var s=A.nextNode(),o=0,l=0,u=r[0];void 0!==u;){if(o===u.index){var c=void 0;2===u.type?c=new N$1(s,s.nextSibling,this,e):1===u.type?c=new u.ctor(s,u.name,u.strings,this,e):6===u.type&&(c=new L(s,this,e)),this.v.push(c),u=r[++l]}o!==(null==u?void 0:u.index)&&(s=A.nextNode(),o++)}return a}},{key:"m",value:function(e){var t,n=0,i=_createForOfIteratorHelper(this.v);try{for(i.s();!(t=i.n()).done;){var r=t.value;void 0!==r&&(void 0!==r.strings?(r._$AI(e,r,n),n+=r.strings.length-2):r._$AI(e[n])),n++}}catch(err){i.e(err)}finally{i.f()}}}]),e}(),N$1=function(){function e(t,n,i,r){var a;_classCallCheck2(this,e),this.type=2,this._$AH=w,this._$AN=void 0,this._$AA=t,this._$AB=n,this._$AM=i,this.options=r,this._$Cg=null===(a=null==r?void 0:r.isConnected)||void 0===a||a}return _createClass2(e,[{key:"_$AU",get:function(){var e,t;return null!==(t=null===(e=this._$AM)||void 0===e?void 0:e._$AU)&&void 0!==t?t:this._$Cg}},{key:"parentNode",get:function(){var e=this._$AA.parentNode,t=this._$AM;return void 0!==t&&11===e.nodeType&&(e=t.parentNode),e}},{key:"startNode",get:function(){return this._$AA}},{key:"endNode",get:function(){return this._$AB}},{key:"_$AI",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this;e=P(this,e,t),r$1(e)?e===w||null==e||""===e?(this._$AH!==w&&this._$AR(),this._$AH=w):e!==this._$AH&&e!==b&&this.$(e):void 0!==e._$litType$?this.T(e):void 0!==e.nodeType?this.k(e):u$1(e)?this.S(e):this.$(e)}},{key:"A",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._$AB;return this._$AA.parentNode.insertBefore(e,t)}},{key:"k",value:function(e){this._$AH!==e&&(this._$AR(),this._$AH=this.A(e))}},{key:"$",value:function(e){this._$AH!==w&&r$1(this._$AH)?this._$AA.nextSibling.data=e:this.k(l$2.createTextNode(e)),this._$AH=e}},{key:"T",value:function(e){var t,n=e.values,i=e._$litType$,r="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=E.createElement(i.h,this.options)),i);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===r)this._$AH.m(n);else{var a=new V(r,this),s=a.p(this.options);a.m(n),this.k(s),this._$AH=a}}},{key:"_$AC",value:function(e){var t=T$1.get(e.strings);return void 0===t&&T$1.set(e.strings,t=new E(e)),t}},{key:"S",value:function(t){d(this._$AH)||(this._$AH=[],this._$AR());var n,i,r=this._$AH,a=0,s=_createForOfIteratorHelper(t);try{for(s.s();!(i=s.n()).done;){var o=i.value;a===r.length?r.push(n=new e(this.A(h$1()),this.A(h$1()),this,this.options)):n=r[a],n._$AI(o),a++}}catch(err){s.e(err)}finally{s.f()}a0&&void 0!==arguments[0]?arguments[0]:this._$AA.nextSibling,n=arguments.length>1?arguments[1]:void 0;for(null===(e=this._$AP)||void 0===e||e.call(this,!1,!0,n);t&&t!==this._$AB;){var i=t.nextSibling;t.remove(),t=i}}},{key:"setConnected",value:function(e){var t;void 0===this._$AM&&(this._$Cg=e,null===(t=this._$AP)||void 0===t||t.call(this,e))}}]),e}(),S=function(){function e(t,n,i,r,a){_classCallCheck2(this,e),this.type=1,this._$AH=w,this._$AN=void 0,this.element=t,this.name=n,this._$AM=r,this.options=a,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=w}return _createClass2(e,[{key:"tagName",get:function(){return this.element.tagName}},{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=this.strings,a=!1;if(void 0===r)e=P(this,e,t,0),(a=!r$1(e)||e!==this._$AH&&e!==b)&&(this._$AH=e);else{var s,o,l=e;for(e=r[0],s=0;s1&&void 0!==arguments[1]?arguments[1]:this;if((e=null!==(t=P(this,e,n,0))&&void 0!==t?t:w)!==b){var i=this._$AH,r=e===w&&i!==w||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,a=e!==w&&(i===w||r);r&&this.element.removeEventListener(this.name,this,i),a&&this.element.addEventListener(this.name,this,e),this._$AH=e}}},{key:"handleEvent",value:function(e){var t,n;"function"==typeof this._$AH?this._$AH.call(null!==(n=null===(t=this.options)||void 0===t?void 0:t.host)&&void 0!==n?n:this.element,e):this._$AH.handleEvent(e)}}]),n}(S),L=function(){function e(t,n,i){_classCallCheck2(this,e),this.element=t,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i}return _createClass2(e,[{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(e){P(this,e)}}]),e}(),z=window.litHtmlPolyfillSupport,l$1,o$2;null==z||z(E,N$1),(null!==(t$2=globalThis.litHtmlVersions)&&void 0!==t$2?t$2:globalThis.litHtmlVersions=[]).push("2.2.1");var s$4=function(e){_inherits2(n,e);var t=_createSuper(n);function n(){var e;return _classCallCheck2(this,n),(e=t.apply(this,arguments)).renderOptions={host:_assertThisInitialized2(e)},e._$Dt=void 0,e}return _createClass2(n,[{key:"createRenderRoot",value:function(){var e,t,i=_get(_getPrototypeOf2(n.prototype),"createRenderRoot",this).call(this);return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=i.firstChild),i}},{key:"update",value:function(e){var t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),_get(_getPrototypeOf2(n.prototype),"update",this).call(this,e),this._$Dt=x(t,this.renderRoot,this.renderOptions)}},{key:"connectedCallback",value:function(){var e;_get(_getPrototypeOf2(n.prototype),"connectedCallback",this).call(this),null===(e=this._$Dt)||void 0===e||e.setConnected(!0)}},{key:"disconnectedCallback",value:function(){var e;_get(_getPrototypeOf2(n.prototype),"disconnectedCallback",this).call(this),null===(e=this._$Dt)||void 0===e||e.setConnected(!1)}},{key:"render",value:function(){return b}}]),n}(a$1);s$4.finalized=!0,s$4._$litElement$=!0,null===(l$1=globalThis.litElementHydrateSupport)||void 0===l$1||l$1.call(globalThis,{LitElement:s$4});var n$2=globalThis.litElementPolyfillSupport;null==n$2||n$2({LitElement:s$4}),(null!==(o$2=globalThis.litElementVersions)&&void 0!==o$2?o$2:globalThis.litElementVersions=[]).push("3.2.0"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ var n$1=function(e){return function(t){return"function"==typeof t?function(e,t){return window.customElements.define(e,t),t}(e,t):function(e,t){return{kind:t.kind,elements:t.elements,finisher:function(t){window.customElements.define(e,t)}}}(e,t)}} /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */,i$1$1=function(e,t){return"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?_objectSpread2(_objectSpread2({},t),{},{finisher:function(n){n.createProperty(t.key,e)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer:function(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher:function(n){n.createProperty(t.key,e)}}};function e$5(e){return function(t,n){return void 0!==n?function(e,t,n){t.constructor.createProperty(n,e)}(e,t,n):i$1$1(e,t)}; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */} /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */var o$1=function(e){var t=e.finisher,n=e.descriptor;return function(e,i){var r;if(void 0===i){var a=null!==(r=e.originalKey)&&void 0!==r?r:e.key,s=null!=n?{kind:"method",placement:"prototype",key:a,descriptor:n(e.key)}:_objectSpread2(_objectSpread2({},e),{},{key:a});return null!=t&&(s.finisher=function(e){t(e,a)}),s}var o=e.constructor;void 0!==n&&Object.defineProperty(e,i,n(i)),null==t||t(o,i)}} /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */,n$6; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */function i$4(e,t){return o$1({descriptor:function(n){var i={get:function(){var t,n;return null!==(n=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(e))&&void 0!==n?n:null},enumerable:!0,configurable:!0};if(t){var r="symbol"==_typeof3(n)?Symbol():"__"+n;i.get=function(){var t,n;return void 0===this[r]&&(this[r]=null!==(n=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(e))&&void 0!==n?n:null),this[r]}}return i}})} /** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */null===(n$6=window.HTMLSlotElement)||void 0===n$6||n$6.prototype.assignedElements;var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return commonjsRequire(e,null==t?n.path:t)}},n.exports),n.exports}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var lottie_svg=createCommonjsModule((function(module,exports){"undefined"!=typeof navigator&&function(e,t){module.exports=t()}(0,(function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(e){_useWebWorker=!!e},getWebWorker=function(){return _useWebWorker},setLocationHref=function(e){locationHref=e},getLocationHref=function(){return locationHref};function createTag(e){return document.createElement(e)}function extendPrototype(e,t){var n,i,r=e.length;for(n=0;n1?n[1]=1:n[1]<=0&&(n[1]=0),HSVtoRGB(n[0],n[1],n[2])}function addBrightnessToRGB(e,t){var n=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return n[2]+=t,n[2]>1?n[2]=1:n[2]<0&&(n[2]=0),HSVtoRGB(n[0],n[1],n[2])}function addHueToRGB(e,t){var n=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return n[0]+=t/360,n[0]>1?n[0]-=1:n[0]<0&&(n[0]+=1),HSVtoRGB(n[0],n[1],n[2])}var rgbToHex=function(){var e,t,n=[];for(e=0;e<256;e+=1)t=e.toString(16),n[e]=1===t.length?"0"+t:t;return function(e,t,i){return e<0&&(e=0),t<0&&(t=0),i<0&&(i=0),"#"+n[e]+n[t]+n[i]}}(),setSubframeEnabled=function(e){subframeEnabled=!!e},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(e){expressionsPlugin=e},getExpressionsPlugin=function(){return expressionsPlugin},setDefaultCurveSegments=function(e){defaultCurveSegments=e},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(e){idPrefix=e};function createNS(e){return document.createElementNS(svgNS,e)}function _typeof$5(e){return(_typeof$5="function"==typeof Symbol&&"symbol"==_typeof3(Symbol.iterator)?function(e){return _typeof3(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof3(e)})(e)}var dataManager=function(){var e,t,n=1,i=[],r={onmessage:function(){},postMessage:function(t){e({data:t})}},a={postMessage:function(e){r.onmessage({data:e})}};function s(){t||((t=function(t){if(window.Worker&&window.Blob&&getWebWorker()){var n=new Blob(["var _workerSelf = self; self.onmessage = ",t.toString()],{type:"text/javascript"}),i=URL.createObjectURL(n);return new Worker(i)}return e=t,r}((function(e){if(a.dataManager||(a.dataManager=function(){function e(r,a){var s,o,l,u,c,f,d=r.length;for(o=0;o=0;t-=1)if("sh"===e[t].ty)if(e[t].ks.k.i)i(e[t].ks.k);else for(a=e[t].ks.k.length,r=0;rn[0]||!(n[0]>e[0])&&(e[1]>n[1]||!(n[1]>e[1])&&(e[2]>n[2]||!(n[2]>e[2])&&null))}var a,s=function(){var e=[4,4,14];function t(e){var t,n,i,r=e.length;for(t=0;t=0;n-=1)if("sh"===e[n].ty)if(e[n].ks.k.i)e[n].ks.k.c=e[n].closed;else for(r=e[n].ks.k.length,i=0;i500)&&(this._imageLoaded(),clearInterval(n)),t+=1}.bind(this),50)}function a(e){var t={assetData:e},n=i(e,this.assetsPath,this.path);return dataManager.loadData(n,function(e){t.img=e,this._footageLoaded()}.bind(this),function(){t.img={},this._footageLoaded()}.bind(this)),t}function s(){this._imageLoaded=t.bind(this),this._footageLoaded=n.bind(this),this.testImageLoaded=r.bind(this),this.createFootageData=a.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return s.prototype={loadAssets:function(e,t){var n;this.imagesLoadedCb=t;var i=e.length;for(n=0;nthis.animationData.op&&(this.animationData.op=e.op,this.totalFrames=Math.floor(e.op-this.animationData.ip));var t,n,i=this.animationData.layers,r=i.length,a=e.layers,s=a.length;for(n=0;nthis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded&&this.renderer)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},AnimationItem.prototype.play=function(e){e&&this.name!==e||!0===this.isPaused&&(this.isPaused=!1,this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(e){e&&this.name!==e||!1===this.isPaused&&(this.isPaused=!0,this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(e){e&&this.name!==e||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(e){e&&this.name!==e||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(e){for(var t,n=0;n=this.totalFrames-1&&this.frameModifier>0?this.loop&&this.playCount!==this.loop?t>=this.totalFrames?(this.playCount+=1,this.checkSegments(t%this.totalFrames)||(this.setCurrentRawFrameValue(t%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(t):this.checkSegments(t>this.totalFrames?t%this.totalFrames:0)||(n=!0,t=this.totalFrames-1):t<0?this.checkSegments(t%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(n=!0,t=0):(this.setCurrentRawFrameValue(this.totalFrames+t%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(t),n&&(this.setCurrentRawFrameValue(t),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(e,t){this.playCount=0,e[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=e[0]-e[1],this.timeCompleted=this.totalFrames,this.firstFrame=e[1],this.setCurrentRawFrameValue(this.totalFrames-.001-t)):e[1]>e[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=e[1]-e[0],this.timeCompleted=this.totalFrames,this.firstFrame=e[0],this.setCurrentRawFrameValue(.001+t)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(e,t){var n=-1;this.isPaused&&(this.currentRawFrame+this.firstFramet&&(n=t-e)),this.firstFrame=e,this.totalFrames=t-e,this.timeCompleted=this.totalFrames,-1!==n&&this.goToAndStop(n,!0)},AnimationItem.prototype.playSegments=function(e,t){if(t&&(this.segments.length=0),"object"===_typeof$4(e[0])){var n,i=e.length;for(n=0;n=0;n-=1)t[n].animation.destroy(e)},e.freeze=function(){s=!0},e.unfreeze=function(){s=!1,p()},e.setVolume=function(e,n){var r;for(r=0;r=.001?function(e,t,n,i){for(var r=0;r<4;++r){var a=o(t,n,i);if(0===a)return t;t-=(s(t,n,i)-e)/a}return t}(e,l,t,n):0===u?l:function(e,t,n,i,r){var a,o,l=0;do{(a=s(o=t+(n-t)/2,i,r)-e)>0?n=o:t=o}while(Math.abs(a)>1e-7&&++l<10);return o}(e,r,r+.1,t,n)}},e}(),pooling={double:function(e){return e.concat(createSizedArray(e.length))}},poolFactory=function(e,t,n){var i=0,r=e,a=createSizedArray(r);return{newElement:function(){return i?a[i-=1]:t()},release:function(e){i===r&&(a=pooling.double(a),r*=2),n&&n(e),a[i]=e,i+=1}}},bezierLengthPool=poolFactory(8,(function(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}})),segmentsLengthPool=poolFactory(8,(function(){return{lengths:[],totalLength:0}}),(function(e){var t,n=e.lengths.length;for(t=0;t-.001&&s<.001}var n=function(e,t,n,i){var r,a,s,o,l,u,c=getDefaultCurveSegments(),h=0,f=[],d=[],p=bezierLengthPool.newElement();for(s=n.length,r=0;rs?-1:1,u=!0;u;)if(i[a]<=s&&i[a+1]>s?(o=(s-i[a])/(i[a+1]-i[a]),u=!1):a+=l,a<0||a>=r-1){if(a===r-1)return n[a];u=!1}return n[a]+(n[a+1]-n[a])*o}var l=createTypedArray("float32",8);return{getSegmentsLength:function(e){var t,i=segmentsLengthPool.newElement(),r=e.c,a=e.v,s=e.o,o=e.i,l=e._length,u=i.lengths,c=0;for(t=0;t1&&(a=1);var c,h=o(a,u),f=o(s=s>1?1:s,u),d=t.length,p=1-h,m=1-f,v=p*p*p,g=h*p*p*3,y=h*h*p*3,b=h*h*h,_=p*p*m,S=h*p*m+p*h*m+p*p*f,x=h*h*m+p*h*f+h*p*f,w=h*h*f,k=p*m*m,E=h*m*m+p*f*m+p*m*f,T=h*f*m+p*f*f+h*m*f,P=h*f*f,A=m*m*m,C=f*m*m+m*f*m+m*m*f,M=f*f*m+m*f*f+f*m*f,I=f*f*f;for(c=0;cd?f>p?f-d-p:p-d-f:p>d?p-d-f:d-f-p)>-1e-4&&h<1e-4}}}var bez=bezFunction(),PropertyFactory=function(){var e=initialDefaultFrame,t=Math.abs;function n(e,t){var n,r=this.offsetTime;"multidimensional"===this.propType&&(n=createTypedArray("float32",this.pv.length));for(var a,s,o,l,u,c,h,f,d,p=t.lastIndex,m=p,v=this.keyframes.length-1,g=!0;g;){if(a=this.keyframes[m],s=this.keyframes[m+1],m===v-1&&e>=s.t-r){a.h&&(a=s),p=0;break}if(s.t-r>e){p=m;break}m=b||e<_){var x=e>=b?S.points.length-1:0;for(u=S.points[x].point.length,l=0;l=E&&k=b?(n[0]=y[0],n[1]=y[1],n[2]=y[2]):e<=_?(n[0]=a.s[0],n[1]=a.s[1],n[2]=a.s[2]):function(e,t){var n=t[0],i=t[1],r=t[2],a=t[3],s=Math.atan2(2*i*a-2*n*r,1-2*i*i-2*r*r),o=Math.asin(2*n*i+2*r*a),l=Math.atan2(2*n*a-2*i*r,1-2*n*n-2*r*r);e[0]=s/degToRads,e[1]=o/degToRads,e[2]=l/degToRads}(n,function(e,t,n){var i,r,a,s,o,l=[],u=e[0],c=e[1],h=e[2],f=e[3],d=t[0],p=t[1],m=t[2],v=t[3];return(r=u*d+c*p+h*m+f*v)<0&&(r=-r,d=-d,p=-p,m=-m,v=-v),1-r>1e-6?(i=Math.acos(r),a=Math.sin(i),s=Math.sin((1-n)*i)/a,o=Math.sin(n*i)/a):(s=1-n,o=n),l[0]=s*u+o*d,l[1]=s*c+o*p,l[2]=s*h+o*m,l[3]=s*f+o*v,l}(i(a.s),i(y),(e-_)/(b-_)));else for(m=0;m=b?c=1:e<_?c=0:(a.o.x.constructor===Array?(o.__fnct||(o.__fnct=[]),o.__fnct[m]?d=o.__fnct[m]:(T=void 0===a.o.x[m]?a.o.x[0]:a.o.x[m],P=void 0===a.o.y[m]?a.o.y[0]:a.o.y[m],A=void 0===a.i.x[m]?a.i.x[0]:a.i.x[m],C=void 0===a.i.y[m]?a.i.y[0]:a.i.y[m],d=BezierFactory.getBezierEasing(T,P,A,C).get,o.__fnct[m]=d)):o.__fnct?d=o.__fnct:(T=a.o.x,P=a.o.y,A=a.i.x,C=a.i.y,d=BezierFactory.getBezierEasing(T,P,A,C).get,a.keyframeMetadata=d),c=d((e-_)/(b-_)))),y=s.s||a.e,M=1===a.h?a.s[m]:a.s[m]+(y[m]-a.s[m])*c,"multidimensional"===this.propType?n[m]=M:n=M}return t.lastIndex=p,n}function i(e){var t=e[0]*degToRads,n=e[1]*degToRads,i=e[2]*degToRads,r=Math.cos(t/2),a=Math.cos(n/2),s=Math.cos(i/2),o=Math.sin(t/2),l=Math.sin(n/2),u=Math.sin(i/2);return[o*l*s+r*a*u,o*a*s+r*l*u,r*l*s-o*a*u,r*a*s-o*l*u]}function r(){var t=this.comp.renderedFrame-this.offsetTime,n=this.keyframes[0].t-this.offsetTime,i=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==e&&(this._caching.lastFrame>=i&&t>=i||this._caching.lastFrame=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var r=this.interpolateValue(t,this._caching);this.pv=r}return this._caching.lastFrame=t,this.pv}function a(e){var n;if("unidimensional"===this.propType)n=e*this.mult,t(this.v-n)>1e-5&&(this.v=n,this._mdf=!0);else for(var i=0,r=this.v.length;i1e-5&&(this.v[i]=n,this._mdf=!0),i+=1}function s(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var e;this.lock=!0,this._mdf=this._isFirstFrame;var t=this.effectsSequence.length,n=this.kf?this.pv:this.data.k;for(e=0;e=this._maxLength&&this.doubleArrayLength(),n){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[]}(!a[i]||a[i]&&!r)&&(a[i]=pointPool.newElement()),a[i][0]=e,a[i][1]=t},ShapePath.prototype.setTripleAt=function(e,t,n,i,r,a,s,o){this.setXYAt(e,t,"v",s,o),this.setXYAt(n,i,"o",s,o),this.setXYAt(r,a,"i",s,o)},ShapePath.prototype.reverse=function(){var e=new ShapePath;e.setPathData(this.c,this._length);var t=this.v,n=this.o,i=this.i,r=0;this.c&&(e.setTripleAt(t[0][0],t[0][1],i[0][0],i[0][1],n[0][0],n[0][1],0,!1),r=1);var a,s=this._length-1,o=this._length;for(a=r;a=d[d.length-1].t-this.offsetTime)i=d[d.length-1].s?d[d.length-1].s[0]:d[d.length-2].e[0],a=!0;else{for(var p,m,v,g=f,y=d.length-1,b=!0;b&&(p=d[g],!((m=d[g+1]).t-this.offsetTime>e));)g=m.t-this.offsetTime)c=1;else if(en&&e>n)||(this._caching.lastIndex=i0||e>-1e-6&&e<0?i(1e4*e)/1e4:e}function N(){var e=this.props;return"matrix("+I(e[0])+","+I(e[1])+","+I(e[4])+","+I(e[5])+","+I(e[12])+","+I(e[13])+")"}return function(){this.reset=r,this.rotate=a,this.rotateX=s,this.rotateY=o,this.rotateZ=l,this.skew=c,this.skewFromAxis=h,this.shear=u,this.scale=f,this.setTransform=d,this.translate=p,this.transform=m,this.applyToPoint=_,this.applyToX=S,this.applyToY=x,this.applyToZ=w,this.applyToPointArray=A,this.applyToTriplePoints=P,this.applyToPointStringified=C,this.toCSS=M,this.to2dCSS=N,this.clone=y,this.cloneFromProps=b,this.equals=g,this.inversePoints=T,this.inversePoint=E,this.getInverseMatrix=k,this._t=this.transform,this.isIdentity=v,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();function _typeof$3(e){return(_typeof$3="function"==typeof Symbol&&"symbol"==_typeof3(Symbol.iterator)?function(e){return _typeof3(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof3(e)})(e)}var lottie={},standalone="__[STANDALONE]__",queryString;function setLocation(e){setLocationHref(e)}function searchAnimations(){animationManager.searchAnimations()}function setSubframeRendering(e){setSubframeEnabled(e)}function setPrefix(e){setIdPrefix(e)}function loadAnimation(e){return animationManager.loadAnimation(e)}function setQuality(e){if("string"==typeof e)switch(e){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10)}else!isNaN(e)&&e>1&&setDefaultCurveSegments(e)}function inBrowser(){return"undefined"!=typeof navigator}function installPlugin(e,t){"expressions"===e&&setExpressionsPlugin(t)}function getFactory(e){switch(e){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(e){for(var t=queryString.split("&"),n=0;n=1?a.push({s:e-1,e:t-1}):(a.push({s:e,e:1}),a.push({s:0,e:t-1}));var s,o,l=[],u=a.length;for(s=0;si+n||(c=o.s*r<=i?0:(o.s*r-i)/n,h=o.e*r>=i+n?1:(o.e*r-i)/n,l.push([c,h]))}return l.length||l.push([0,0]),l},TrimModifier.prototype.releasePathsData=function(e){var t,n=e.length;for(t=0;t1?1+a:this.s.v<0?0+a:this.s.v+a)>(n=this.e.v>1?1+a:this.e.v<0?0+a:this.e.v+a)){var s=t;t=n,n=s}t=1e-4*Math.round(1e4*t),n=1e-4*Math.round(1e4*n),this.sValue=t,this.eValue=n}else t=this.sValue,n=this.eValue;var o,l,u,c,h,f=this.shapes.length,d=0;if(n===t)for(r=0;r=0;r-=1)if((p=this.shapes[r]).shape._mdf){for((m=p.localShapeCollection).releaseShapes(),2===this.m&&f>1?(g=this.calculateShapeEdges(t,n,p.totalShapeLength,_,d),_+=p.totalShapeLength):g=[[y,b]],l=g.length,o=0;o=1?v.push({s:p.totalShapeLength*(y-1),e:p.totalShapeLength*(b-1)}):(v.push({s:p.totalShapeLength*y,e:p.totalShapeLength}),v.push({s:0,e:p.totalShapeLength*(b-1)}));var S=this.addShapes(p,v[0]);if(v[0].s!==v[0].e){if(v.length>1)if(p.shape.paths.shapes[p.shape.paths._length-1].c){var x=S.pop();this.addPaths(S,m),S=this.addShapes(p,v[1],x)}else this.addPaths(S,m),S=this.addShapes(p,v[1]);this.addPaths(S,m)}}p.shape.paths=m}}},TrimModifier.prototype.addPaths=function(e,t){var n,i=e.length;for(n=0;nt.e){n.c=!1;break}t.s<=p&&t.e>=p+s.addedLength?(this.addSegment(f[i].v[r-1],f[i].o[r-1],f[i].i[r],f[i].v[r],n,o,v),v=!1):(u=bez.getNewSegment(f[i].v[r-1],f[i].v[r],f[i].o[r-1],f[i].i[r],(t.s-p)/s.addedLength,(t.e-p)/s.addedLength,l[r-1]),this.addSegmentFromArray(u,n,o,v),v=!1,n.c=!1),p+=s.addedLength,o+=1}if(f[i].c&&l.length){if(s=l[r-1],p<=t.e){var g=l[r-1].addedLength;t.s<=p&&t.e>=p+g?(this.addSegment(f[i].v[r-1],f[i].o[r-1],f[i].i[0],f[i].v[0],n,o,v),v=!1):(u=bez.getNewSegment(f[i].v[r-1],f[i].v[0],f[i].o[r-1],f[i].i[0],(t.s-p)/g,(t.e-p)/g,l[r-1]),this.addSegmentFromArray(u,n,o,v),v=!1,n.c=!1)}else n.c=!1;p+=s.addedLength,o+=1}if(n._length&&(n.setXYAt(n.v[c][0],n.v[c][1],"i",c),n.setXYAt(n.v[n._length-1][0],n.v[n._length-1][1],"o",n._length-1)),p>t.e)break;i=this.p.keyframes[this.p.keyframes.length-1].t?(i=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/n,0),r=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/n,0)):(i=this.p.pv,r=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/n,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){i=[],r=[];var a=this.px,s=this.py;a._caching.lastFrame+a.offsetTime<=a.keyframes[0].t?(i[0]=a.getValueAtTime((a.keyframes[0].t+.01)/n,0),i[1]=s.getValueAtTime((s.keyframes[0].t+.01)/n,0),r[0]=a.getValueAtTime(a.keyframes[0].t/n,0),r[1]=s.getValueAtTime(s.keyframes[0].t/n,0)):a._caching.lastFrame+a.offsetTime>=a.keyframes[a.keyframes.length-1].t?(i[0]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/n,0),i[1]=s.getValueAtTime(s.keyframes[s.keyframes.length-1].t/n,0),r[0]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/n,0),r[1]=s.getValueAtTime((s.keyframes[s.keyframes.length-1].t-.01)/n,0)):(i=[a.pv,s.pv],r[0]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/n,a.offsetTime),r[1]=s.getValueAtTime((s._caching.lastFrame+s.offsetTime-.01)/n,s.offsetTime))}else i=r=e;this.v.rotate(-Math.atan2(i[1]-r[1],i[0]-r[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],t),t.prototype.addDynamicProperty=function(e){this._addDynamicProperty(e),this.elem.addDynamicProperty(e),this._isDirty=!0},t.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(e,n,i){return new t(e,n,i)}}}();function RepeaterModifier(){}function RoundCornersModifier(){}function getFontProperties(e){for(var t=e.fStyle?e.fStyle.split(" "):[],n="normal",i="normal",r=t.length,a=0;a0;)n-=1,this._elements.unshift(t[n]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(e){var t,n=e.length;for(t=0;t0?Math.floor(f):Math.ceil(f),m=this.pMatrix.props,v=this.rMatrix.props,g=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var y,b,_=0;if(f>0){for(;_p;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),_-=1;d&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-d,!0),_-=d)}for(i=1===this.data.m?0:this._currentCopies-1,r=1===this.data.m?1:-1,a=this._currentCopies;a;){if(b=(n=(t=this.elemsData[i].it)[t.length-1].transform.mProps.v.props).length,t[t.length-1].transform.mProps._mdf=!0,t[t.length-1].transform.op._mdf=!0,t[t.length-1].transform.op.v=1===this._currentCopies?this.so.v:this.so.v+(this.eo.v-this.so.v)*(i/(this._currentCopies-1)),0!==_){for((0!==i&&1===r||i!==this._currentCopies-1&&-1===r)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],v[9],v[10],v[11],v[12],v[13],v[14],v[15]),this.matrix.transform(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]),this.matrix.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),y=0;y0&&(c=!1),c){var h=createTag("style");h.setAttribute("f-forigin",i[n].fOrigin),h.setAttribute("f-origin",i[n].origin),h.setAttribute("f-family",i[n].fFamily),h.type="text/css",h.innerText="@font-face {font-family: "+i[n].fFamily+"; font-style: normal; src: url('"+i[n].fPath+"');}",t.appendChild(h)}}else if("g"===i[n].fOrigin||1===i[n].origin){for(l=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),u=0;ue?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var e,t=this.renderableComponents.length;for(e=0;e0&&(this.maskElement.setAttribute("id",v),this.element.maskedElement.setAttribute(y,"url("+getLocationHref()+"#"+v+")"),a.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}FootageElement.prototype.prepareFrame=function(){},extendPrototype([RenderableElement,BaseElement,FrameElement],FootageElement),FootageElement.prototype.getBaseElement=function(){return null},FootageElement.prototype.renderFrame=function(){},FootageElement.prototype.destroy=function(){},FootageElement.prototype.initExpressions=function(){this.layerInterface=FootageInterface(this)},FootageElement.prototype.getFootageData=function(){return this.footageData},AudioElement.prototype.prepareFrame=function(e){if(this.prepareRenderableFrame(e,!0),this.prepareProperties(e,!0),this.tm._placeholder)this._currentTime=e/this.data.sr;else{var t=this.tm.v;this._currentTime=t}},extendPrototype([RenderableElement,BaseElement,FrameElement],AudioElement),AudioElement.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek())>.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(e){this.audio.rate(e)},AudioElement.prototype.volume=function(e){this.audio.volume(e)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},BaseRenderer.prototype.checkLayers=function(e){var t,n,i=this.layers.length;for(this.completeLayers=!0,t=i-1;t>=0;t-=1)this.elements[t]||(n=this.layers[t]).ip-n.st<=e-this.layers[t].st&&n.op-n.st>e-this.layers[t].st&&this.buildItem(t),this.completeLayers=!!this.elements[t]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(e){switch(e.ty){case 2:return this.createImage(e);case 0:return this.createComp(e);case 1:return this.createSolid(e);case 3:default:return this.createNull(e);case 4:return this.createShape(e);case 5:return this.createText(e);case 6:return this.createAudio(e);case 13:return this.createCamera(e);case 15:return this.createFootage(e)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(e){return new AudioElement(e,this.globalData,this)},BaseRenderer.prototype.createFootage=function(e){return new FootageElement(e,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var e,t=this.layers.length;for(e=0;e1&&(a+=" C"+t.o[i-1][0]+","+t.o[i-1][1]+" "+t.i[0][0]+","+t.i[0][1]+" "+t.v[0][0]+","+t.v[0][1]),n.lastPath!==a){var s="";n.elem&&(t.c&&(s=e.inv?this.solidPath+a:a),n.elem.setAttribute("d",s)),n.lastPath=a}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var filtersFactory=(t={createFilter:function(e,t){var n=createNS("filter");return n.setAttribute("id",e),!0!==t&&(n.setAttribute("filterUnits","objectBoundingBox"),n.setAttribute("x","0%"),n.setAttribute("y","0%"),n.setAttribute("width","100%"),n.setAttribute("height","100%")),n},createAlphaToLuminanceFilter:function(){var e=createNS("feColorMatrix");return e.setAttribute("type","matrix"),e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),e}},t),featureSupport=function(){var e={maskType:!0};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(e.maskType=!1),e}(),t;function SVGTintFilter(e,t){this.filterManager=t;var n=createNS("feColorMatrix");if(n.setAttribute("type","matrix"),n.setAttribute("color-interpolation-filters","linearRGB"),n.setAttribute("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"),n.setAttribute("result","f1"),e.appendChild(n),(n=createNS("feColorMatrix")).setAttribute("type","matrix"),n.setAttribute("color-interpolation-filters","sRGB"),n.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),n.setAttribute("result","f2"),e.appendChild(n),this.matrixFilter=n,100!==t.effectElements[2].p.v||t.effectElements[2].p.k){var i,r=createNS("feMerge");e.appendChild(r),(i=createNS("feMergeNode")).setAttribute("in","SourceGraphic"),r.appendChild(i),(i=createNS("feMergeNode")).setAttribute("in","f2"),r.appendChild(i)}}function SVGFillFilter(e,t){this.filterManager=t;var n=createNS("feColorMatrix");n.setAttribute("type","matrix"),n.setAttribute("color-interpolation-filters","sRGB"),n.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),e.appendChild(n),this.matrixFilter=n}function SVGStrokeEffect(e,t){this.initialized=!1,this.filterManager=t,this.elem=e,this.paths=[]}function SVGTritoneFilter(e,t){this.filterManager=t;var n=createNS("feColorMatrix");n.setAttribute("type","matrix"),n.setAttribute("color-interpolation-filters","linearRGB"),n.setAttribute("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"),n.setAttribute("result","f1"),e.appendChild(n);var i=createNS("feComponentTransfer");i.setAttribute("color-interpolation-filters","sRGB"),e.appendChild(i),this.matrixFilter=i;var r=createNS("feFuncR");r.setAttribute("type","table"),i.appendChild(r),this.feFuncR=r;var a=createNS("feFuncG");a.setAttribute("type","table"),i.appendChild(a),this.feFuncG=a;var s=createNS("feFuncB");s.setAttribute("type","table"),i.appendChild(s),this.feFuncB=s}function SVGProLevelsFilter(e,t){this.filterManager=t;var n=this.filterManager.effectElements,i=createNS("feComponentTransfer");(n[10].p.k||0!==n[10].p.v||n[11].p.k||1!==n[11].p.v||n[12].p.k||1!==n[12].p.v||n[13].p.k||0!==n[13].p.v||n[14].p.k||1!==n[14].p.v)&&(this.feFuncR=this.createFeFunc("feFuncR",i)),(n[17].p.k||0!==n[17].p.v||n[18].p.k||1!==n[18].p.v||n[19].p.k||1!==n[19].p.v||n[20].p.k||0!==n[20].p.v||n[21].p.k||1!==n[21].p.v)&&(this.feFuncG=this.createFeFunc("feFuncG",i)),(n[24].p.k||0!==n[24].p.v||n[25].p.k||1!==n[25].p.v||n[26].p.k||1!==n[26].p.v||n[27].p.k||0!==n[27].p.v||n[28].p.k||1!==n[28].p.v)&&(this.feFuncB=this.createFeFunc("feFuncB",i)),(n[31].p.k||0!==n[31].p.v||n[32].p.k||1!==n[32].p.v||n[33].p.k||1!==n[33].p.v||n[34].p.k||0!==n[34].p.v||n[35].p.k||1!==n[35].p.v)&&(this.feFuncA=this.createFeFunc("feFuncA",i)),(this.feFuncR||this.feFuncG||this.feFuncB||this.feFuncA)&&(i.setAttribute("color-interpolation-filters","sRGB"),e.appendChild(i),i=createNS("feComponentTransfer")),(n[3].p.k||0!==n[3].p.v||n[4].p.k||1!==n[4].p.v||n[5].p.k||1!==n[5].p.v||n[6].p.k||0!==n[6].p.v||n[7].p.k||1!==n[7].p.v)&&(i.setAttribute("color-interpolation-filters","sRGB"),e.appendChild(i),this.feFuncRComposed=this.createFeFunc("feFuncR",i),this.feFuncGComposed=this.createFeFunc("feFuncG",i),this.feFuncBComposed=this.createFeFunc("feFuncB",i))}function SVGDropShadowEffect(e,t){var n=t.container.globalData.renderConfig.filterSize;e.setAttribute("x",n.x),e.setAttribute("y",n.y),e.setAttribute("width",n.width),e.setAttribute("height",n.height),this.filterManager=t;var i=createNS("feGaussianBlur");i.setAttribute("in","SourceAlpha"),i.setAttribute("result","drop_shadow_1"),i.setAttribute("stdDeviation","0"),this.feGaussianBlur=i,e.appendChild(i);var r=createNS("feOffset");r.setAttribute("dx","25"),r.setAttribute("dy","0"),r.setAttribute("in","drop_shadow_1"),r.setAttribute("result","drop_shadow_2"),this.feOffset=r,e.appendChild(r);var a=createNS("feFlood");a.setAttribute("flood-color","#00ff00"),a.setAttribute("flood-opacity","1"),a.setAttribute("result","drop_shadow_3"),this.feFlood=a,e.appendChild(a);var s=createNS("feComposite");s.setAttribute("in","drop_shadow_3"),s.setAttribute("in2","drop_shadow_2"),s.setAttribute("operator","in"),s.setAttribute("result","drop_shadow_4"),e.appendChild(s);var o,l=createNS("feMerge");e.appendChild(l),o=createNS("feMergeNode"),l.appendChild(o),(o=createNS("feMergeNode")).setAttribute("in","SourceGraphic"),this.feMergeNode=o,this.feMerge=l,this.originalNodeAdded=!1,l.appendChild(o)}SVGTintFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=this.filterManager.effectElements[0].p.v,n=this.filterManager.effectElements[1].p.v,i=this.filterManager.effectElements[2].p.v/100;this.matrixFilter.setAttribute("values",n[0]-t[0]+" 0 0 0 "+t[0]+" "+(n[1]-t[1])+" 0 0 0 "+t[1]+" "+(n[2]-t[2])+" 0 0 0 "+t[2]+" 0 0 0 "+i+" 0")}},SVGFillFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=this.filterManager.effectElements[2].p.v,n=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+t[0]+" 0 0 0 0 "+t[1]+" 0 0 0 0 "+t[2]+" 0 0 0 "+n+" 0")}},SVGStrokeEffect.prototype.initialize=function(){var e,t,n,i,r=this.elem.layerElement.children||this.elem.layerElement.childNodes;for(1===this.filterManager.effectElements[1].p.v?(i=this.elem.maskManager.masksProperties.length,n=0):i=1+(n=this.filterManager.effectElements[0].p.v-1),(t=createNS("g")).setAttribute("fill","none"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-dashoffset",1);n=u?d<0?i:r:i+f*Math.pow((a-e)/d,1/n),c[h]=s,h+=1,o+=256/255;return c.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t,n=this.filterManager.effectElements;this.feFuncRComposed&&(e||n[3].p._mdf||n[4].p._mdf||n[5].p._mdf||n[6].p._mdf||n[7].p._mdf)&&(t=this.getTableValue(n[3].p.v,n[4].p.v,n[5].p.v,n[6].p.v,n[7].p.v),this.feFuncRComposed.setAttribute("tableValues",t),this.feFuncGComposed.setAttribute("tableValues",t),this.feFuncBComposed.setAttribute("tableValues",t)),this.feFuncR&&(e||n[10].p._mdf||n[11].p._mdf||n[12].p._mdf||n[13].p._mdf||n[14].p._mdf)&&(t=this.getTableValue(n[10].p.v,n[11].p.v,n[12].p.v,n[13].p.v,n[14].p.v),this.feFuncR.setAttribute("tableValues",t)),this.feFuncG&&(e||n[17].p._mdf||n[18].p._mdf||n[19].p._mdf||n[20].p._mdf||n[21].p._mdf)&&(t=this.getTableValue(n[17].p.v,n[18].p.v,n[19].p.v,n[20].p.v,n[21].p.v),this.feFuncG.setAttribute("tableValues",t)),this.feFuncB&&(e||n[24].p._mdf||n[25].p._mdf||n[26].p._mdf||n[27].p._mdf||n[28].p._mdf)&&(t=this.getTableValue(n[24].p.v,n[25].p.v,n[26].p.v,n[27].p.v,n[28].p.v),this.feFuncB.setAttribute("tableValues",t)),this.feFuncA&&(e||n[31].p._mdf||n[32].p._mdf||n[33].p._mdf||n[34].p._mdf||n[35].p._mdf)&&(t=this.getTableValue(n[31].p.v,n[32].p.v,n[33].p.v,n[34].p.v,n[35].p.v),this.feFuncA.setAttribute("tableValues",t))}},SVGDropShadowEffect.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){if((e||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),e||this.filterManager.effectElements[0].p._mdf){var t=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(255*t[0]),Math.round(255*t[1]),Math.round(255*t[2])))}if((e||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),e||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var n=this.filterManager.effectElements[3].p.v,i=(this.filterManager.effectElements[2].p.v-90)*degToRads,r=n*Math.cos(i),a=n*Math.sin(i);this.feOffset.setAttribute("dx",r),this.feOffset.setAttribute("dy",a)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(e,t,n){this.initialized=!1,this.filterManager=t,this.filterElem=e,this.elem=n,n.matteElement=createNS("g"),n.matteElement.appendChild(n.layerElement),n.matteElement.appendChild(n.transformedElement),n.baseElement=n.matteElement}function SVGGaussianBlurEffect(e,t){e.setAttribute("x","-100%"),e.setAttribute("y","-100%"),e.setAttribute("width","300%"),e.setAttribute("height","300%"),this.filterManager=t;var n=createNS("feGaussianBlur");e.appendChild(n),this.feGaussianBlur=n}SVGMatte3Effect.prototype.findSymbol=function(e){for(var t=0,n=_svgMatteSymbols.length;t=0&&!this.shapeModifiers[e].processShapes(this._isFirstFrame);e-=1);}},searchProcessedElement:function(e){for(var t=this.processedElements,n=0,i=t.length;n.01)return!1;n+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var e=0,t=this.data.k.k.length;e0;)l=i.transformers[m].mProps._mdf||l,p-=1,m-=1;if(l)for(p=g-i.styles[c].lvl,m=i.transformers.length-1;p>0;)d=i.transformers[m].mProps.v.props,f.transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15]),p-=1,m-=1}else f=e;if(s=(h=i.sh.paths)._length,l){for(o="",a=0;a=1?y=.99:y<=-1&&(y=-.99);var b=o*y,_=Math.cos(g+t.a.v)*b+c[0],S=Math.sin(g+t.a.v)*b+c[1];l.setAttribute("fx",_),l.setAttribute("fy",S),u&&!t.g._collapsable&&(t.of.setAttribute("fx",_),t.of.setAttribute("fy",S))}}function l(e,t,n){var i=t.style,r=t.d;r&&(r._mdf||n)&&r.dashStr&&(i.pElem.setAttribute("stroke-dasharray",r.dashStr),i.pElem.setAttribute("stroke-dashoffset",r.dashoffset[0])),t.c&&(t.c._mdf||n)&&i.pElem.setAttribute("stroke","rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||n)&&i.pElem.setAttribute("stroke-opacity",t.o.v),(t.w._mdf||n)&&(i.pElem.setAttribute("stroke-width",t.w.v),i.msElem&&i.msElem.setAttribute("stroke-width",t.w.v))}return{createRenderFunction:function(e){switch(e.ty){case"fl":return a;case"gf":return o;case"gs":return s;case"st":return l;case"sh":case"el":case"rc":case"sr":return r;case"tr":return n;case"no":return i;default:return null}}}}();function SVGShapeElement(e,t,n){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(e,t,n),this.prevViewData=[]}function LetterProps(e,t,n,i,r,a){this.o=e,this.sw=t,this.sc=n,this.fc=i,this.m=r,this.p=a,this._mdf={o:!0,sw:!!t,sc:!!n,fc:!!i,m:!0,p:!0}}function TextProperty(e,t){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=t,this.elem=e,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var e,t,n,i,r=this.shapes.length,a=this.stylesList.length,s=[],o=!1;for(n=0;n1&&o&&this.setShapesAsAnimated(s)}},SVGShapeElement.prototype.setShapesAsAnimated=function(e){var t,n=e.length;for(t=0;t=0;o-=1){if((f=this.searchProcessedElement(e[o]))?t[o]=n[f-1]:e[o]._render=s,"fl"===e[o].ty||"st"===e[o].ty||"gf"===e[o].ty||"gs"===e[o].ty||"no"===e[o].ty)f?t[o].style.closed=!1:t[o]=this.createStyleElement(e[o],r),e[o]._render&&t[o].style.pElem.parentNode!==i&&i.appendChild(t[o].style.pElem),m.push(t[o].style);else if("gr"===e[o].ty){if(f)for(u=t[o].it.length,l=0;l1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(e){this.effectsSequence.push(e),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(e){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||e){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var t=this.currentData,n=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{var i;this.lock=!0,this._mdf=!1;var r=this.effectsSequence.length,a=e||this.data.d.k[this.keysIndex].s;for(i=0;it);)n+=1;return this.keysIndex!==n&&(this.keysIndex=n),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(e){for(var t,n,i=[],r=0,a=e.length,s=!1;r=55296&&t<=56319?(n=e.charCodeAt(r+1))>=56320&&n<=57343?(s||FontManager.isModifier(t,n)?(i[i.length-1]+=e.substr(r,2),s=!1):i.push(e.substr(r,2)),r+=1):i.push(e.charAt(r)):t>56319?(n=e.charCodeAt(r+1),FontManager.isZeroWidthJoiner(t,n)?(s=!0,i[i.length-1]+=e.substr(r,2),r+=1):i.push(e.charAt(r))):FontManager.isZeroWidthJoiner(t)?(i[i.length-1]+=e.charAt(r),s=!0):i.push(e.charAt(r)),r+=1;return i},TextProperty.prototype.completeTextData=function(e){e.__complete=!0;var t,n,i,r,a,s,o,l=this.elem.globalData.fontManager,u=this.data,c=[],h=0,f=u.m.g,d=0,p=0,m=0,v=[],g=0,y=0,b=l.getFontByName(e.f),_=0,S=getFontProperties(b);e.fWeight=S.weight,e.fStyle=S.style,e.finalSize=e.s,e.finalText=this.buildFinalText(e.t),n=e.finalText.length,e.finalLineHeight=e.lh;var x,w=e.tr/1e3*e.finalSize;if(e.sz)for(var k,E,T=!0,P=e.sz[0],A=e.sz[1];T;){k=0,g=0,n=(E=this.buildFinalText(e.t)).length,w=e.tr/1e3*e.finalSize;var C=-1;for(t=0;tP&&" "!==E[t]?(-1===C?n+=1:t=C,k+=e.finalLineHeight||1.2*e.finalSize,E.splice(t,C===t?1:0,"\r"),C=-1,g=0):(g+=_,g+=w);k+=b.ascent*e.finalSize/100,this.canResize&&e.finalSize>this.minimumFontSize&&Ay?g:y,g=-2*w,r="",i=!0,m+=1):r=M,l.chars?(o=l.getCharData(M,b.fStyle,l.getFontByName(e.f).fFamily),_=i?0:o.w*e.finalSize/100):_=l.measureText(r,e.f,e.finalSize)," "===M?I+=_+w:(g+=_+w+I,I=0),c.push({l:_,an:_,add:d,n:i,anIndexes:[],val:r,line:m,animatorJustifyOffset:0}),2==f){if(d+=_,""===r||" "===r||t===n-1){for(""!==r&&" "!==r||(d-=_);p<=t;)c[p].an=d,c[p].ind=h,c[p].extra=_,p+=1;h+=1,d=0}}else if(3==f){if(d+=_,""===r||t===n-1){for(""===r&&(d-=_);p<=t;)c[p].an=d,c[p].ind=h,c[p].extra=_,p+=1;d=0,h+=1}}else c[h].ind=h,c[h].extra=0,h+=1;if(e.l=c,y=g>y?g:y,v.push(g),e.sz)e.boxWidth=e.sz[0],e.justifyOffset=0;else switch(e.boxWidth=y,e.j){case 1:e.justifyOffset=-e.boxWidth;break;case 2:e.justifyOffset=-e.boxWidth/2;break;default:e.justifyOffset=0}e.lineWidths=v;var N,L,R,F,O=u.a;s=O.length;var B=[];for(a=0;a0?r=this.ne.v/100:a=-this.ne.v/100,this.xe.v>0?s=1-this.xe.v/100:o=1+this.xe.v/100;var l=BezierFactory.getBezierEasing(r,a,s,o).get,u=0,c=this.finalS,h=this.finalE,f=this.data.sh;if(2===f)u=l(u=h===c?i>=h?1:0:e(0,t(.5/(h-c)+(i-c)/(h-c),1)));else if(3===f)u=l(u=h===c?i>=h?0:1:1-e(0,t(.5/(h-c)+(i-c)/(h-c),1)));else if(4===f)h===c?u=0:(u=e(0,t(.5/(h-c)+(i-c)/(h-c),1)))<.5?u*=2:u=1-2*(u-.5),u=l(u);else if(5===f){if(h===c)u=0;else{var d=h-c,p=-d/2+(i=t(e(0,i+.5-c),h-c)),m=d/2;u=Math.sqrt(1-p*p/(m*m))}u=l(u)}else 6===f?(h===c?u=0:(i=t(e(0,i+.5-c),h-c),u=(1+Math.cos(Math.PI+2*Math.PI*i/(h-c)))/2),u=l(u)):(i>=n(c)&&(u=e(0,t(i-c<0?t(h,1)-(c-i):h-i,1))),u=l(u));if(100!==this.sm.v){var v=.01*this.sm.v;0===v&&(v=1e-8);var g=.5-.5*v;u1&&(u=1)}return u*this.a.v},getValue:function(e){this.iterateDynamicProperties(),this._mdf=e||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,e&&2===this.data.r&&(this.e.v=this._currentTextLength);var t=2===this.data.r?1:100/this.data.totalChars,n=this.o.v/t,i=this.s.v/t+n,r=this.e.v/t+n;if(i>r){var a=i;i=r,r=a}this.finalS=i,this.finalE=r}},extendPrototype([DynamicPropertyContainer],i),{getTextSelectorProp:function(e,t,n){return new i(e,t)}}}();function TextAnimatorDataProperty(e,t,n){var i={propType:!1},r=PropertyFactory.getProp,a=t.a;this.a={r:a.r?r(e,a.r,0,degToRads,n):i,rx:a.rx?r(e,a.rx,0,degToRads,n):i,ry:a.ry?r(e,a.ry,0,degToRads,n):i,sk:a.sk?r(e,a.sk,0,degToRads,n):i,sa:a.sa?r(e,a.sa,0,degToRads,n):i,s:a.s?r(e,a.s,1,.01,n):i,a:a.a?r(e,a.a,1,0,n):i,o:a.o?r(e,a.o,0,.01,n):i,p:a.p?r(e,a.p,1,0,n):i,sw:a.sw?r(e,a.sw,0,0,n):i,sc:a.sc?r(e,a.sc,1,0,n):i,fc:a.fc?r(e,a.fc,1,0,n):i,fh:a.fh?r(e,a.fh,0,0,n):i,fs:a.fs?r(e,a.fs,0,.01,n):i,fb:a.fb?r(e,a.fb,0,.01,n):i,t:a.t?r(e,a.t,0,0,n):i},this.s=TextSelectorProp.getTextSelectorProp(e,t.s,n),this.s.t=t.s.t}function TextAnimatorProperty(e,t,n){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=e,this._renderType=t,this._elem=n,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(n)}function ITextElement(){}TextAnimatorProperty.prototype.searchProperties=function(){var e,t,n=this._textData.a.length,i=PropertyFactory.getProp;for(e=0;e=o+oe||!p?(y=(o+oe-u)/l.partialLength,D=d.point[0]+(l.point[0]-d.point[0])*y,V=d.point[1]+(l.point[1]-d.point[1])*y,k.translate(-S[0]*P[r].an*.005,-S[1]*F*.01),c=!1):p&&(u+=l.partialLength,(h+=1)>=p.length&&(h=0,m[f+=1]?p=m[f].points:_.v.c?(h=0,p=m[f=0].points):(u-=l.partialLength,p=null)),p&&(d=l,v=(l=p[h]).partialLength));B=P[r].an/2-P[r].add,k.translate(-B,0,0)}else B=P[r].an/2-P[r].add,k.translate(-B,0,0),k.translate(-S[0]*P[r].an*.005,-S[1]*F*.01,0);for(I=0;Ie?this.textSpans[e].span:createNS(l?"g":"text"),v<=e){if(s.setAttribute("stroke-linecap","butt"),s.setAttribute("stroke-linejoin","round"),s.setAttribute("stroke-miterlimit","4"),this.textSpans[e].span=s,l){var g=createNS("g");s.appendChild(g),this.textSpans[e].childSpan=g}this.textSpans[e].span=s,this.layerElement.appendChild(s)}s.style.display="inherit"}if(u.reset(),u.scale(n.finalSize/100,n.finalSize/100),c&&(o[e].n&&(h=-p,f+=n.yOffset,f+=d?1:0,d=!1),this.applyTextPropertiesToMatrix(n,u,o[e].line,h,f),h+=o[e].l||0,h+=p),l){var y;if(1===(m=this.globalData.fontManager.getCharData(n.finalText[e],i.fStyle,this.globalData.fontManager.getFontByName(n.f).fFamily)).t)y=new SVGCompElement(m.data,this.globalData,this);else{var b=emptyShapeData;m.data&&m.data.shapes&&(b=m.data),y=new SVGShapeElement(b,this.globalData,this)}this.textSpans[e].glyph=y,y._debug=!0,y.prepareFrame(0),y.renderFrame(),this.textSpans[e].childSpan.appendChild(y.layerElement),this.textSpans[e].childSpan.setAttribute("transform","scale("+n.finalSize/100+","+n.finalSize/100+")")}else c&&s.setAttribute("transform","translate("+u.props[12]+","+u.props[13]+")"),s.textContent=o[e].val,s.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}c&&s&&s.setAttribute("d","")}else{var _=this.textContainer,S="start";switch(n.j){case 1:S="end";break;case 2:S="middle";break;default:S="start"}_.setAttribute("text-anchor",S),_.setAttribute("letter-spacing",p);var x=this.buildTextContents(n.finalText);for(t=x.length,f=n.ps?n.ps[1]+n.ascent:0,e=0;e=0;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].prepareFrame(e-this.layers[t].st);if(this.globalData._mdf)for(t=0;t=0;n-=1)(this.completeLayers||this.elements[n])&&(this.elements[n].prepareFrame(this.renderedFrame-this.layers[n].st),this.elements[n]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var e,t=this.layers.length;for(e=0;e=a;)e/=2,t/=2,n>>>=1;return(e+n)/t};return v.int32=function(){return 0|m.g(4)},v.quick=function(){return m.g(4)/4294967296},v.double=v,l(u(m.S),e),(h.pass||f||function(e,n,i,r){return r&&(r.S&&o(r,m),e.state=function(){return o(m,{})}),i?(t.random=e,n):e})(v,p,"global"in h?h.global:this==t,h.state)},l(t.random(),e)}function initialize$2(e){seedRandom([],e)}var propTypes={SHAPE:"shape"};function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==_typeof3(Symbol.iterator)?function(e){return _typeof3(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof3(e)})(e)}var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null,XMLHttpRequest=null,fetch=null,frames=null;function $bm_isInstanceOfArray(e){return e.constructor===Array||e.constructor===Float32Array}function isNumerable(e,t){return"number"===e||"boolean"===e||"string"===e||t instanceof Number}function $bm_neg(e){var t=_typeof(e);if("number"===t||"boolean"===t||e instanceof Number)return-e;if($bm_isInstanceOfArray(e)){var n,i=e.length,r=[];for(n=0;nn){var i=n;n=t,t=i}return Math.min(Math.max(e,t),n)}function radiansToDegrees(e){return e/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(e){return e*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(e,t){if("number"==typeof e||e instanceof Number)return t=t||0,Math.abs(e-t);var n;t||(t=helperLengthArray);var i=Math.min(e.length,t.length),r=0;for(n=0;n.5?u/(2-s-o):u/(s+o),s){case i:t=(r-a)/u+(r1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function hslToRgb(e){var t,n,i,r=e[0],a=e[1],s=e[2];if(0===a)t=s,i=s,n=s;else{var o=s<.5?s*(1+a):s+a-s*a,l=2*s-o;t=hue2rgb(l,o,r+1/3),n=hue2rgb(l,o,r),i=hue2rgb(l,o,r-1/3)}return[t,n,i,e[3]]}function linear(e,t,n,i,r){if(void 0!==i&&void 0!==r||(i=t,r=n,t=0,n=1),n=n)return r;var s,o=n===t?0:(e-t)/(n-t);if(!i.length)return i+(r-i)*o;var l=i.length,u=createTypedArray("float32",l);for(s=0;s1){for(i=0;i1?t=1:t<0&&(t=0);var s=e(t);if($bm_isInstanceOfArray(r)){var o,l=r.length,u=createTypedArray("float32",l);for(o=0;odata.k[t].t&&edata.k[t+1].t-e?(n=t+2,i=data.k[t+1].t):(n=t+1,i=data.k[t].t);break}}-1===n&&(n=t+1,i=data.k[t].t)}else n=0,i=0;var a={};return a.index=n,a.time=i/elem.comp.globalData.frameRate,a}function key(e){var t,n,i;if(!data.k.length||"number"==typeof data.k[0])throw new Error("The property has no keyframe at index "+e);e-=1,t={time:data.k[e].t/elem.comp.globalData.frameRate,value:[]};var r=Object.prototype.hasOwnProperty.call(data.k[e],"s")?data.k[e].s:data.k[e-1].e;for(i=r.length,n=0;nu.length-1)&&(t=u.length-1),i=c-(r=u[u.length-1-t].t)),"pingpong"===e){if(Math.floor((l-r)/i)%2!=0)return this.getValueAtTime((i-(l-r)%i+r)/this.comp.globalData.frameRate,0)}else{if("offset"===e){var h=this.getValueAtTime(r/this.comp.globalData.frameRate,0),f=this.getValueAtTime(c/this.comp.globalData.frameRate,0),d=this.getValueAtTime(((l-r)%i+r)/this.comp.globalData.frameRate,0),p=Math.floor((l-r)/i);if(this.pv.length){for(s=(o=new Array(h.length)).length,a=0;a=c)return this.pv;if(n?r=c+(i=t?Math.abs(this.elem.comp.globalData.frameRate*t):Math.max(0,this.elem.data.op-c)):((!t||t>u.length-1)&&(t=u.length-1),i=(r=u[t].t)-c),"pingpong"===e){if(Math.floor((c-l)/i)%2==0)return this.getValueAtTime(((c-l)%i+c)/this.comp.globalData.frameRate,0)}else{if("offset"===e){var h=this.getValueAtTime(c/this.comp.globalData.frameRate,0),f=this.getValueAtTime(r/this.comp.globalData.frameRate,0),d=this.getValueAtTime((i-(c-l)%i+c)/this.comp.globalData.frameRate,0),p=Math.floor((c-l)/i)+1;if(this.pv.length){for(s=(o=new Array(h.length)).length,a=0;a1?(r+e-a)/(t-1):1,o=0,l=0;for(n=this.pv.length?createTypedArray("float32",this.pv.length):0;os){var c=o,h=n.c&&o===l-1?0:o+1,f=(s-u)/a[o].addedLength;i=bez.getPointInSegment(n.v[c],n.v[h],n.o[c],n.i[h],f,a[o]);break}u+=a[o].addedLength,o+=1}return i||(i=n.c?[n.v[0][0],n.v[0][1]]:[n.v[n._length-1][0],n.v[n._length-1][1]]),i},vectorOnPath:function(e,t,n){1==e?e=this.v.c:0==e&&(e=.999);var i=this.pointOnPath(e,t),r=this.pointOnPath(e+.001,t),a=r[0]-i[0],s=r[1]-i[1],o=Math.sqrt(Math.pow(a,2)+Math.pow(s,2));return 0===o?[0,0]:"tangent"===n?[a/o,s/o]:[-s/o,a/o]},tangentOnPath:function(e,t){return this.vectorOnPath(e,t,"tangent")},normalOnPath:function(e,t){return this.vectorOnPath(e,t,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([u],o),extendPrototype([u],l),l.prototype.getValueAtTime=function(e){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shapePool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),e*=this.elem.globalData.frameRate,(e-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime (c) 2009-2016 Stuart Knightley Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. JSZip uses the library pako released under the MIT license : https://github.com/nodeca/pako/blob/main/LICENSE */ e.exports=function e(t,n,i){function r(s,o){if(!n[s]){if(!t[s]){var l="function"==typeof commonjsRequire&&commonjsRequire;if(!o&&l)return l(s,!0);if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[s]={exports:{}};t[s][0].call(c.exports,(function(e){return r(t[s][1][e]||e)}),c,c.exports,e,t,n,i)}return n[s].exports}for(var a="function"==typeof commonjsRequire&&commonjsRequire,s=0;s>2,o=(3&t)<<4|n>>4,l=d>1?(15&n)<<2|r>>6:64,u=d>2?63&r:64,c.push(a.charAt(s)+a.charAt(o)+a.charAt(l)+a.charAt(u));return c.join("")},n.decode=function(e){var t,n,i,s,o,l,u=0,c=0;if("data:"===e.substr(0,"data:".length))throw new Error("Invalid base64 input, it looks like a data url.");var h,f=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(e.charAt(e.length-1)===a.charAt(64)&&f--,e.charAt(e.length-2)===a.charAt(64)&&f--,f%1!=0)throw new Error("Invalid base64 input, bad content length.");for(h=r.uint8array?new Uint8Array(0|f):new Array(0|f);u>4,n=(15&s)<<4|(o=a.indexOf(e.charAt(u++)))>>2,i=(3&o)<<6|(l=a.indexOf(e.charAt(u++))),h[c++]=t,64!==o&&(h[c++]=n),64!==l&&(h[c++]=i);return h}},{"./support":30,"./utils":32}],2:[function(e,t,n){var i=e("./external"),r=e("./stream/DataWorker"),a=e("./stream/Crc32Probe"),s=e("./stream/DataLengthProbe");function o(e,t,n,i,r){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=i,this.compressedContent=r}o.prototype={getContentWorker:function(){var e=new r(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new s("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new r(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(e,t,n){return e.pipe(new a).pipe(new s("uncompressedSize")).pipe(t.compressWorker(n)).pipe(new s("compressedSize")).withStreamInfo("compression",t)},t.exports=o},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){var i=e("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(e){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},n.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){var i=e("./utils"),r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==i.getTypeOf(e)?function(e,t,n,i){var a=r,s=i+n;e^=-1;for(var o=i;o>>8^a[255&(e^t[o])];return-1^e}(0|t,e,e.length,0):function(e,t,n,i){var a=r,s=i+n;e^=-1;for(var o=i;o>>8^a[255&(e^t.charCodeAt(o))];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){var i=null;i="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:i}},{lie:37}],7:[function(e,t,n){var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,r=e("pako"),a=e("./utils"),s=e("./stream/GenericWorker"),o=i?"uint8array":"array";function l(e,t){s.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic="\b\0",a.inherits(l,s),l.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(a.transformTo(o,e.data),!1)},l.prototype.flush=function(){s.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new r[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new l("Deflate",e)},n.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){var i=e("../utils"),r=e("../stream/GenericWorker"),a=e("../utf8"),s=e("../crc32"),o=e("../signature"),l=function(e,t){var n,i="";for(n=0;n>>=8;return i},u=function(e,t,n,r,u,c){var h,f,d=e.file,p=e.compression,m=c!==a.utf8encode,v=i.transformTo("string",c(d.name)),g=i.transformTo("string",a.utf8encode(d.name)),y=d.comment,b=i.transformTo("string",c(y)),_=i.transformTo("string",a.utf8encode(y)),S=g.length!==d.name.length,x=_.length!==y.length,w="",k="",E="",T=d.dir,P=d.date,A={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(A.crc32=e.crc32,A.compressedSize=e.compressedSize,A.uncompressedSize=e.uncompressedSize);var C=0;t&&(C|=8),m||!S&&!x||(C|=2048);var M,I,N=0,L=0;T&&(N|=16),"UNIX"===u?(L=798,N|=(I=M=d.unixPermissions,M||(I=T?16893:33204),(65535&I)<<16)):(L=20,N|=63&(d.dosPermissions||0)),h=P.getUTCHours(),h<<=6,h|=P.getUTCMinutes(),h<<=5,h|=P.getUTCSeconds()/2,f=P.getUTCFullYear()-1980,f<<=4,f|=P.getUTCMonth()+1,f<<=5,f|=P.getUTCDate(),S&&(k=l(1,1)+l(s(v),4)+g,w+="up"+l(k.length,2)+k),x&&(E=l(1,1)+l(s(b),4)+_,w+="uc"+l(E.length,2)+E);var R="";return R+="\n\0",R+=l(C,2),R+=p.magic,R+=l(h,2),R+=l(f,2),R+=l(A.crc32,4),R+=l(A.compressedSize,4),R+=l(A.uncompressedSize,4),R+=l(v.length,2),R+=l(w.length,2),{fileRecord:o.LOCAL_FILE_HEADER+R+v+w,dirRecord:o.CENTRAL_FILE_HEADER+l(L,2)+R+l(b.length,2)+"\0\0\0\0"+l(N,4)+l(r,4)+v+w+b}},c=function(e){return o.DATA_DESCRIPTOR+l(e.crc32,4)+l(e.compressedSize,4)+l(e.uncompressedSize,4)};function h(e,t,n,i){r.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=i,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}i.inherits(h,r),h.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,r.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-i-1))/n:100}}))},h.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=u(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=u(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:c(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t0?e.substring(0,t):""},m=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},v=function(e,t){return t=void 0!==t?t:o.createFolders,e=m(e),this.files[e]||d.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function g(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var y={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,n,i;for(t in this.files)i=this.files[t],(n=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(n,i)},filter:function(e){var t=[];return this.forEach((function(n,i){e(n,i)&&t.push(i)})),t},file:function(e,t,n){if(1===arguments.length){if(g(e)){var i=e;return this.filter((function(e,t){return!t.dir&&i.test(e)}))}var r=this.files[this.root+e];return r&&!r.dir?r:null}return e=this.root+e,d.call(this,e,t,n),this},folder:function(e){if(!e)return this;if(g(e))return this.filter((function(t,n){return n.dir&&e.test(t)}));var t=this.root+e,n=v.call(this,t),i=this.clone();return i.root=n.name,i},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var n=this.filter((function(t,n){return n.name.slice(0,e.length)===e})),i=0;i=0;--a)if(this.data[a]===t&&this.data[a+1]===n&&this.data[a+2]===i&&this.data[a+3]===r)return a-this.zero;return-1},r.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),i=e.charCodeAt(2),r=e.charCodeAt(3),a=this.readData(4);return t===a[0]&&n===a[1]&&i===a[2]&&r===a[3]},r.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=r},{"../utils":32,"./DataReader":18}],18:[function(e,t,n){var i=e("../utils");function r(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}r.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return i.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=r},{"../utils":32}],19:[function(e,t,n){var i=e("./Uint8ArrayReader");function r(e){i.call(this,e)}e("../utils").inherits(r,i),r.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=r},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){var i=e("./DataReader");function r(e){i.call(this,e)}e("../utils").inherits(r,i),r.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},r.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},r.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},r.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=r},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){var i=e("./ArrayReader");function r(e){i.call(this,e)}e("../utils").inherits(r,i),r.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=r},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){var i=e("../utils"),r=e("../support"),a=e("./ArrayReader"),s=e("./StringReader"),o=e("./NodeBufferReader"),l=e("./Uint8ArrayReader");t.exports=function(e){var t=i.getTypeOf(e);return i.checkSupport(t),"string"!==t||r.uint8array?"nodebuffer"===t?new o(e):r.uint8array?new l(i.transformTo("uint8array",e)):new a(i.transformTo("array",e)):new s(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t,n){var i=e("./GenericWorker"),r=e("../utils");function a(e){i.call(this,"ConvertWorker to "+e),this.destType=e}r.inherits(a,i),a.prototype.processChunk=function(e){this.push({data:r.transformTo(this.destType,e.data),meta:e.meta})},t.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){var i=e("./GenericWorker"),r=e("../crc32");function a(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(a,i),a.prototype.processChunk=function(e){this.streamInfo.crc32=r(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){var i=e("../utils"),r=e("./GenericWorker");function a(e){r.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}i.inherits(a,r),a.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}r.prototype.processChunk.call(this,e)},t.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){var i=e("../utils"),r=e("./GenericWorker");function a(e){r.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=i.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}i.inherits(a,r),a.prototype.cleanUp=function(){r.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){function i(e){this.name=e||"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}i.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n "+e:e}},t.exports=i},{}],29:[function(e,t,n){var i=e("../utils"),r=e("./ConvertWorker"),a=e("./GenericWorker"),s=e("../base64"),o=e("../support"),l=e("../external"),u=null;if(o.nodestream)try{u=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function c(e,t){return new l.Promise((function(n,r){var a=[],o=e._internalType,l=e._outputType,u=e._mimeType;e.on("data",(function(e,n){a.push(e),t&&t(n)})).on("error",(function(e){a=[],r(e)})).on("end",(function(){try{var e=function(e,t,n){switch(e){case"blob":return i.newBlob(i.transformTo("arraybuffer",t),n);case"base64":return s.encode(t);default:return i.transformTo(e,t)}}(l,function(e,t){var n,i=0,r=null,a=0;for(n=0;n=252?6:l>=248?5:l>=240?4:l>=224?3:l>=192?2:1;function u(){s.call(this,"utf-8 decode"),this.leftOver=null}function c(){s.call(this,"utf-8 encode")}o[254]=o[254]=1,n.utf8encode=function(e){return r.nodebuffer?a.newBufferFrom(e,"utf-8"):function(e){var t,n,i,a,s,o=e.length,l=0;for(a=0;a>>6,t[s++]=128|63&n):n<65536?(t[s++]=224|n>>>12,t[s++]=128|n>>>6&63,t[s++]=128|63&n):(t[s++]=240|n>>>18,t[s++]=128|n>>>12&63,t[s++]=128|n>>>6&63,t[s++]=128|63&n);return t}(e)},n.utf8decode=function(e){return r.nodebuffer?i.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,n,r,a,s=e.length,l=new Array(2*s);for(n=0,t=0;t4)l[n++]=65533,t+=a-1;else{for(r&=2===a?31:3===a?15:7;a>1&&t1?l[n++]=65533:r<65536?l[n++]=r:(r-=65536,l[n++]=55296|r>>10&1023,l[n++]=56320|1023&r)}return l.length!==n&&(l.subarray?l=l.subarray(0,n):l.length=n),i.applyFromCharCode(l)}(e=i.transformTo(r.uint8array?"uint8array":"array",e))},i.inherits(u,s),u.prototype.processChunk=function(e){var t=i.transformTo(r.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(r.uint8array){var a=t;(t=new Uint8Array(a.length+this.leftOver.length)).set(this.leftOver,0),t.set(a,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var s=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+o[e[n]]>t?n:t}(t),l=t;s!==t.length&&(r.uint8array?(l=t.subarray(0,s),this.leftOver=t.subarray(s,t.length)):(l=t.slice(0,s),this.leftOver=t.slice(s,t.length))),this.push({data:n.utf8decode(l),meta:e.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=u,i.inherits(c,s),c.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=c},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){var i=e("./support"),r=e("./base64"),a=e("./nodejsUtils"),s=e("./external");function o(e){return e}function l(e,t){for(var n=0;n1;)try{return u.stringifyByChunk(e,i,t)}catch(e){t=Math.floor(t/2)}return u.stringifyByChar(e)}function h(e,t){for(var n=0;n1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e0)this.isSignature(t,a.CENTRAL_FILE_HEADER)||(this.reader.zero=i);else if(i<0)throw new Error("Corrupted zip: missing "+Math.abs(i)+" bytes.")},prepareReader:function(e){this.reader=i(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=l},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(e,t,n){var i=e("./reader/readerFor"),r=e("./utils"),a=e("./compressedObject"),s=e("./crc32"),o=e("./utf8"),l=e("./compressions"),u=e("./support");function c(e,t){this.options=e,this.loadOptions=t}c.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,n;if(e.skip(22),this.fileNameLength=e.readInt(2),n=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(n),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in l)if(l.hasOwnProperty(t)&&l[t].magic===e)return l[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+r.pretty(this.compressionMethod)+" unknown (inner file : "+r.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===e&&(this.dosPermissions=63&this.externalFileAttributes),3===e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=i(this.extraFields[1].value);this.uncompressedSize===r.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===r.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===r.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===r.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,n,i,r=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+40?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var n=i.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw new Error(s[n]);if(t.header&&i.deflateSetHeader(this.strm,t.header),t.dictionary){var c;if(c="string"==typeof t.dictionary?a.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=i.deflateSetDictionary(this.strm,c)))throw new Error(s[n]);this._dict_set=!0}}function c(e,t){var n=new u(t);if(n.push(e,!0),n.err)throw n.msg||s[n.err];return n.result}u.prototype.push=function(e,t){var n,s,o=this.strm,u=this.options.chunkSize;if(this.ended)return!1;s=t===~~t?t:!0===t?4:0,"string"==typeof e?o.input=a.string2buf(e):"[object ArrayBuffer]"===l.call(e)?o.input=new Uint8Array(e):o.input=e,o.next_in=0,o.avail_in=o.input.length;do{if(0===o.avail_out&&(o.output=new r.Buf8(u),o.next_out=0,o.avail_out=u),1!==(n=i.deflate(o,s))&&0!==n)return this.onEnd(n),this.ended=!0,!1;0!==o.avail_out&&(0!==o.avail_in||4!==s&&2!==s)||("string"===this.options.to?this.onData(a.buf2binstring(r.shrinkBuf(o.output,o.next_out))):this.onData(r.shrinkBuf(o.output,o.next_out)))}while((o.avail_in>0||0===o.avail_out)&&1!==n);return 4===s?(n=i.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,0===n):2!==s||(this.onEnd(0),o.avail_out=0,!0)},u.prototype.onData=function(e){this.chunks.push(e)},u.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Deflate=u,n.deflate=c,n.deflateRaw=function(e,t){return(t=t||{}).raw=!0,c(e,t)},n.gzip=function(e,t){return(t=t||{}).gzip=!0,c(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,n){var i=e("./zlib/inflate"),r=e("./utils/common"),a=e("./utils/strings"),s=e("./zlib/constants"),o=e("./zlib/messages"),l=e("./zlib/zstream"),u=e("./zlib/gzheader"),c=Object.prototype.toString;function h(e){if(!(this instanceof h))return new h(e);this.options=r.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var n=i.inflateInit2(this.strm,t.windowBits);if(n!==s.Z_OK)throw new Error(o[n]);this.header=new u,i.inflateGetHeader(this.strm,this.header)}function f(e,t){var n=new h(t);if(n.push(e,!0),n.err)throw n.msg||o[n.err];return n.result}h.prototype.push=function(e,t){var n,o,l,u,h,f,d=this.strm,p=this.options.chunkSize,m=this.options.dictionary,v=!1;if(this.ended)return!1;o=t===~~t?t:!0===t?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof e?d.input=a.binstring2buf(e):"[object ArrayBuffer]"===c.call(e)?d.input=new Uint8Array(e):d.input=e,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new r.Buf8(p),d.next_out=0,d.avail_out=p),(n=i.inflate(d,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&m&&(f="string"==typeof m?a.string2buf(m):"[object ArrayBuffer]"===c.call(m)?new Uint8Array(m):m,n=i.inflateSetDictionary(this.strm,f)),n===s.Z_BUF_ERROR&&!0===v&&(n=s.Z_OK,v=!1),n!==s.Z_STREAM_END&&n!==s.Z_OK)return this.onEnd(n),this.ended=!0,!1;d.next_out&&(0!==d.avail_out&&n!==s.Z_STREAM_END&&(0!==d.avail_in||o!==s.Z_FINISH&&o!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(l=a.utf8border(d.output,d.next_out),u=d.next_out-l,h=a.buf2string(d.output,l),d.next_out=u,d.avail_out=p-u,u&&r.arraySet(d.output,d.output,l,u,0),this.onData(h)):this.onData(r.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(v=!0)}while((d.avail_in>0||0===d.avail_out)&&n!==s.Z_STREAM_END);return n===s.Z_STREAM_END&&(o=s.Z_FINISH),o===s.Z_FINISH?(n=i.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===s.Z_OK):o!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),d.avail_out=0,!0)},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){e===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Inflate=h,n.inflate=f,n.inflateRaw=function(e,t){return(t=t||{}).raw=!0,f(e,t)},n.ungzip=f},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,n){var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=_typeof3(n))throw new TypeError(n+"must be non-object");for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])}}return e},n.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var r={arraySet:function(e,t,n,i,r){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+i),r);else for(var a=0;a=252?6:o>=248?5:o>=240?4:o>=224?3:o>=192?2:1;function l(e,t){if(t<65537&&(e.subarray&&a||!e.subarray&&r))return String.fromCharCode.apply(null,i.shrinkBuf(e,t));for(var n="",s=0;s>>6,t[s++]=128|63&n):n<65536?(t[s++]=224|n>>>12,t[s++]=128|n>>>6&63,t[s++]=128|63&n):(t[s++]=240|n>>>18,t[s++]=128|n>>>12&63,t[s++]=128|n>>>6&63,t[s++]=128|63&n);return t},n.buf2binstring=function(e){return l(e,e.length)},n.binstring2buf=function(e){for(var t=new i.Buf8(e.length),n=0,r=t.length;n4)u[i++]=65533,n+=a-1;else{for(r&=2===a?31:3===a?15:7;a>1&&n1?u[i++]=65533:r<65536?u[i++]=r:(r-=65536,u[i++]=55296|r>>10&1023,u[i++]=56320|1023&r)}return l(u,i)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+s[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){t.exports=function(e,t,n,i){for(var r=65535&e|0,a=e>>>16&65535|0,s=0;0!==n;){n-=s=n>2e3?2e3:n;do{a=a+(r=r+t[i++]|0)|0}while(--s);r%=65521,a%=65521}return r|a<<16|0}},{}],44:[function(e,t,n){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t,n){var i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,r){var a=i,s=r+n;e^=-1;for(var o=r;o>>8^a[255&(e^t[o])];return-1^e}},{}],46:[function(e,t,n){var i,r=e("../utils/common"),a=e("./trees"),s=e("./adler32"),o=e("./crc32"),l=e("./messages");function u(e,t){return e.msg=l[t],t}function c(e){return(e<<1)-(e>4?9:0)}function h(e){for(var t=e.length;--t>=0;)e[t]=0}function f(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(r.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function d(e,t){a._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,f(e.strm)}function p(e,t){e.pending_buf[e.pending++]=t}function m(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function v(e,t){var n,i,r=e.max_chain_length,a=e.strstart,s=e.prev_length,o=e.nice_match,l=e.strstart>e.w_size-262?e.strstart-(e.w_size-262):0,u=e.window,c=e.w_mask,h=e.prev,f=e.strstart+258,d=u[a+s-1],p=u[a+s];e.prev_length>=e.good_match&&(r>>=2),o>e.lookahead&&(o=e.lookahead);do{if(u[(n=t)+s]===p&&u[n+s-1]===d&&u[n]===u[a]&&u[++n]===u[a+1]){a+=2,n++;do{}while(u[++a]===u[++n]&&u[++a]===u[++n]&&u[++a]===u[++n]&&u[++a]===u[++n]&&u[++a]===u[++n]&&u[++a]===u[++n]&&u[++a]===u[++n]&&u[++a]===u[++n]&&as){if(e.match_start=t,s=i,i>=o)break;d=u[a+s-1],p=u[a+s]}}}while((t=h[t&c])>l&&0!=--r);return s<=e.lookahead?s:e.lookahead}function g(e){var t,n,i,a,l,u,c,h,f,d,p=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-262)){r.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=n=e.hash_size;do{i=e.head[--t],e.head[t]=i>=p?i-p:0}while(--n);t=n=p;do{i=e.prev[--t],e.prev[t]=i>=p?i-p:0}while(--n);a+=p}if(0===e.strm.avail_in)break;if(u=e.strm,c=e.window,h=e.strstart+e.lookahead,f=a,d=void 0,(d=u.avail_in)>f&&(d=f),n=0===d?0:(u.avail_in-=d,r.arraySet(c,u.input,u.next_in,d,h),1===u.state.wrap?u.adler=s(u.adler,c,d,h):2===u.state.wrap&&(u.adler=o(u.adler,c,d,h)),u.next_in+=d,u.total_in+=d,d),e.lookahead+=n,e.lookahead+e.insert>=3)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<=3)if(i=a._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-3,i=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=r&&(e.ins_h=(e.ins_h<15&&(o=2,i-=16),a<1||a>9||8!==n||i<8||i>15||t<0||t>9||s<0||s>4)return u(e,-2);8===i&&(i=9);var l=new S;return e.state=l,l.strm=e,l.wrap=o,l.gzhead=null,l.w_bits=i,l.w_size=1<e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(g(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+n;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,d(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-262&&(d(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(d(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(d(e,!1),e.strm.avail_out),1)})),new _(4,4,8,4,y),new _(4,5,16,8,y),new _(4,6,32,32,y),new _(4,4,16,16,b),new _(8,16,32,32,b),new _(8,16,128,128,b),new _(8,32,128,256,b),new _(32,128,258,1024,b),new _(32,258,258,4096,b)],n.deflateInit=function(e,t){return k(e,t,8,15,8,0)},n.deflateInit2=k,n.deflateReset=w,n.deflateResetKeep=x,n.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?-2:(e.state.gzhead=t,0):-2},n.deflate=function(e,t){var n,r,s,l;if(!e||!e.state||t>5||t<0)return e?u(e,-2):-2;if(r=e.state,!e.output||!e.input&&0!==e.avail_in||666===r.status&&4!==t)return u(e,0===e.avail_out?-5:-2);if(r.strm=e,n=r.last_flush,r.last_flush=t,42===r.status)if(2===r.wrap)e.adler=0,p(r,31),p(r,139),p(r,8),r.gzhead?(p(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),p(r,255&r.gzhead.time),p(r,r.gzhead.time>>8&255),p(r,r.gzhead.time>>16&255),p(r,r.gzhead.time>>24&255),p(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),p(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(p(r,255&r.gzhead.extra.length),p(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=o(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(p(r,0),p(r,0),p(r,0),p(r,0),p(r,0),p(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),p(r,3),r.status=113);else{var v=8+(r.w_bits-8<<4)<<8;v|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(v|=32),v+=31-v%31,r.status=113,m(r,v),0!==r.strstart&&(m(r,e.adler>>>16),m(r,65535&e.adler)),e.adler=1}if(69===r.status)if(r.gzhead.extra){for(s=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>s&&(e.adler=o(e.adler,r.pending_buf,r.pending-s,s)),f(e),s=r.pending,r.pending!==r.pending_buf_size));)p(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>s&&(e.adler=o(e.adler,r.pending_buf,r.pending-s,s)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(e.adler=o(e.adler,r.pending_buf,r.pending-s,s)),f(e),s=r.pending,r.pending===r.pending_buf_size)){l=1;break}l=r.gzindexs&&(e.adler=o(e.adler,r.pending_buf,r.pending-s,s)),0===l&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(e.adler=o(e.adler,r.pending_buf,r.pending-s,s)),f(e),s=r.pending,r.pending===r.pending_buf_size)){l=1;break}l=r.gzindexs&&(e.adler=o(e.adler,r.pending_buf,r.pending-s,s)),0===l&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&f(e),r.pending+2<=r.pending_buf_size&&(p(r,255&e.adler),p(r,e.adler>>8&255),e.adler=0,r.status=113)):r.status=113),0!==r.pending){if(f(e),0===e.avail_out)return r.last_flush=-1,0}else if(0===e.avail_in&&c(t)<=c(n)&&4!==t)return u(e,-5);if(666===r.status&&0!==e.avail_in)return u(e,-5);if(0!==e.avail_in||0!==r.lookahead||0!==t&&666!==r.status){var y=2===r.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(g(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(d(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(d(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(d(e,!1),0===e.strm.avail_out)?1:2}(r,t):3===r.strategy?function(e,t){for(var n,i,r,s,o=e.window;;){if(e.lookahead<=258){if(g(e),e.lookahead<=258&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=o[r=e.strstart-1])===o[++r]&&i===o[++r]&&i===o[++r]){s=e.strstart+258;do{}while(i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&re.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=a._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(d(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(d(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(d(e,!1),0===e.strm.avail_out)?1:2}(r,t):i[r.level].func(r,t);if(3!==y&&4!==y||(r.status=666),1===y||3===y)return 0===e.avail_out&&(r.last_flush=-1),0;if(2===y&&(1===t?a._tr_align(r):5!==t&&(a._tr_stored_block(r,0,0,!1),3===t&&(h(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),f(e),0===e.avail_out))return r.last_flush=-1,0}return 4!==t?0:r.wrap<=0?1:(2===r.wrap?(p(r,255&e.adler),p(r,e.adler>>8&255),p(r,e.adler>>16&255),p(r,e.adler>>24&255),p(r,255&e.total_in),p(r,e.total_in>>8&255),p(r,e.total_in>>16&255),p(r,e.total_in>>24&255)):(m(r,e.adler>>>16),m(r,65535&e.adler)),f(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},n.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&103!==t&&113!==t&&666!==t?u(e,-2):(e.state=null,113===t?u(e,-3):0):-2},n.deflateSetDictionary=function(e,t){var n,i,a,o,l,u,c,f,d=t.length;if(!e||!e.state)return-2;if(2===(o=(n=e.state).wrap)||1===o&&42!==n.status||n.lookahead)return-2;for(1===o&&(e.adler=s(e.adler,t,d,0)),n.wrap=0,d>=n.w_size&&(0===o&&(h(n.head),n.strstart=0,n.block_start=0,n.insert=0),f=new r.Buf8(n.w_size),r.arraySet(f,t,d-n.w_size,n.w_size,0),t=f,d=n.w_size),l=e.avail_in,u=e.next_in,c=e.input,e.avail_in=d,e.next_in=0,e.input=t,g(n);n.lookahead>=3;){i=n.strstart,a=n.lookahead-2;do{n.ins_h=(n.ins_h<>>=_=b>>>24,p-=_,0==(_=b>>>16&255))T[a++]=65535&b;else{if(!(16&_)){if(0==(64&_)){b=m[(65535&b)+(d&(1<<_)-1)];continue t}if(32&_){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}S=65535&b,(_&=15)&&(p<_&&(d+=E[i++]<>>=_,p-=_),p<15&&(d+=E[i++]<>>=_=b>>>24,p-=_,!(16&(_=b>>>16&255))){if(0==(64&_)){b=v[(65535&b)+(d&(1<<_)-1)];continue n}e.msg="invalid distance code",n.mode=30;break e}if(x=65535&b,p<(_&=15)&&(d+=E[i++]<l){e.msg="invalid distance too far back",n.mode=30;break e}if(d>>>=_,p-=_,x>(_=a-s)){if((_=x-_)>c&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(w=0,k=f,0===h){if(w+=u-_,_2;)T[a++]=k[w++],T[a++]=k[w++],T[a++]=k[w++],S-=3;S&&(T[a++]=k[w++],S>1&&(T[a++]=k[w++]))}else{w=a-x;do{T[a++]=T[w++],T[a++]=T[w++],T[a++]=T[w++],S-=3}while(S>2);S&&(T[a++]=T[w++],S>1&&(T[a++]=T[w++]))}break}}break}}while(i>3,d&=(1<<(p-=S<<3))-1,e.next_in=i,e.next_out=a,e.avail_in=i>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function u(){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 i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function c(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new i.Buf32(852),t.distcode=t.distdyn=new i.Buf32(592),t.sane=1,t.back=-1,0):-2}function h(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,c(e)):-2}function f(e,t){var n,i;return e&&e.state?(i=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?-2:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,h(e))):-2}function d(e,t){var n,i;return e?(i=new u,e.state=i,i.window=null,0!==(n=f(e,t))&&(e.state=null),n):-2}var p,m,v=!0;function g(e){if(v){var t;for(p=new i.Buf32(512),m=new i.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(o(1,e.lens,0,288,p,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;o(2,e.lens,0,32,m,0,e.work,{bits:5}),v=!1}e.lencode=p,e.lenbits=9,e.distcode=m,e.distbits=5}function y(e,t,n,r){var a,s=e.state;return null===s.window&&(s.wsize=1<=s.wsize?(i.arraySet(s.window,t,n-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((a=s.wsize-s.wnext)>r&&(a=r),i.arraySet(s.window,t,n-r,a,s.wnext),(r-=a)?(i.arraySet(s.window,t,n-r,r,0),s.wnext=r,s.whave=s.wsize):(s.wnext+=a,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,n.check=a(n.check,F,2,0),m=0,v=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&m)<<8)+(m>>8))%31){e.msg="incorrect header check",n.mode=30;break}if(8!=(15&m)){e.msg="unknown compression method",n.mode=30;break}if(v-=4,M=8+(15&(m>>>=4)),0===n.wbits)n.wbits=M;else if(M>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<>8&1),512&n.flags&&(F[0]=255&m,F[1]=m>>>8&255,n.check=a(n.check,F,2,0)),m=0,v=0,n.mode=3;case 3:for(;v<32;){if(0===d)break e;d--,m+=u[h++]<>>8&255,F[2]=m>>>16&255,F[3]=m>>>24&255,n.check=a(n.check,F,4,0)),m=0,v=0,n.mode=4;case 4:for(;v<16;){if(0===d)break e;d--,m+=u[h++]<>8),512&n.flags&&(F[0]=255&m,F[1]=m>>>8&255,n.check=a(n.check,F,2,0)),m=0,v=0,n.mode=5;case 5:if(1024&n.flags){for(;v<16;){if(0===d)break e;d--,m+=u[h++]<>>8&255,n.check=a(n.check,F,2,0)),m=0,v=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((S=n.length)>d&&(S=d),S&&(n.head&&(M=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),i.arraySet(n.head.extra,u,h,S,M)),512&n.flags&&(n.check=a(n.check,u,S,h)),d-=S,h+=S,n.length-=S),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===d)break e;S=0;do{M=u[h+S++],n.head&&M&&n.length<65536&&(n.head.name+=String.fromCharCode(M))}while(M&&S>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;v<32;){if(0===d)break e;d--,m+=u[h++]<>>=7&v,v-=7&v,n.mode=27;break}for(;v<3;){if(0===d)break e;d--,m+=u[h++]<>>=1)){case 0:n.mode=14;break;case 1:if(g(n),n.mode=20,6===t){m>>>=2,v-=2;break e}break;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}m>>>=2,v-=2;break;case 14:for(m>>>=7&v,v-=7&v;v<32;){if(0===d)break e;d--,m+=u[h++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&m,m=0,v=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(S=n.length){if(S>d&&(S=d),S>p&&(S=p),0===S)break e;i.arraySet(c,u,h,S,f),d-=S,h+=S,p-=S,f+=S,n.length-=S;break}n.mode=12;break;case 17:for(;v<14;){if(0===d)break e;d--,m+=u[h++]<>>=5,v-=5,n.ndist=1+(31&m),m>>>=5,v-=5,n.ncode=4+(15&m),m>>>=4,v-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have>>=3,v-=3}for(;n.have<19;)n.lens[O[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,N={bits:n.lenbits},I=o(0,n.lens,0,19,n.lencode,0,n.work,N),n.lenbits=N.bits,I){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,T=65535&R,!((k=R>>>24)<=v);){if(0===d)break e;d--,m+=u[h++]<>>=k,v-=k,n.lens[n.have++]=T;else{if(16===T){for(L=k+2;v>>=k,v-=k,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}M=n.lens[n.have-1],S=3+(3&m),m>>>=2,v-=2}else if(17===T){for(L=k+3;v>>=k)),m>>>=3,v-=3}else{for(L=k+7;v>>=k)),m>>>=7,v-=7}if(n.have+S>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;S--;)n.lens[n.have++]=M}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,N={bits:n.lenbits},I=o(1,n.lens,0,n.nlen,n.lencode,0,n.work,N),n.lenbits=N.bits,I){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,N={bits:n.distbits},I=o(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,N),n.distbits=N.bits,I){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(d>=6&&p>=258){e.next_out=f,e.avail_out=p,e.next_in=h,e.avail_in=d,n.hold=m,n.bits=v,s(e,_),f=e.next_out,c=e.output,p=e.avail_out,h=e.next_in,u=e.input,d=e.avail_in,m=n.hold,v=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;E=(R=n.lencode[m&(1<>>16&255,T=65535&R,!((k=R>>>24)<=v);){if(0===d)break e;d--,m+=u[h++]<>P)])>>>16&255,T=65535&R,!(P+(k=R>>>24)<=v);){if(0===d)break e;d--,m+=u[h++]<>>=P,v-=P,n.back+=P}if(m>>>=k,v-=k,n.back+=k,n.length=T,0===E){n.mode=26;break}if(32&E){n.back=-1,n.mode=12;break}if(64&E){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&E,n.mode=22;case 22:if(n.extra){for(L=n.extra;v>>=n.extra,v-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;E=(R=n.distcode[m&(1<>>16&255,T=65535&R,!((k=R>>>24)<=v);){if(0===d)break e;d--,m+=u[h++]<>P)])>>>16&255,T=65535&R,!(P+(k=R>>>24)<=v);){if(0===d)break e;d--,m+=u[h++]<>>=P,v-=P,n.back+=P}if(m>>>=k,v-=k,n.back+=k,64&E){e.msg="invalid distance code",n.mode=30;break}n.offset=T,n.extra=15&E,n.mode=24;case 24:if(n.extra){for(L=n.extra;v>>=n.extra,v-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===p)break e;if(S=_-p,n.offset>S){if((S=n.offset-S)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}S>n.wnext?(S-=n.wnext,x=n.wsize-S):x=n.wnext-S,S>n.length&&(S=n.length),w=n.window}else w=c,x=f-n.offset,S=n.length;S>p&&(S=p),p-=S,n.length-=S;do{c[f++]=w[x++]}while(--S);0===n.length&&(n.mode=21);break;case 26:if(0===p)break e;c[f++]=n.length,p--,n.mode=21;break;case 27:if(n.wrap){for(;v<32;){if(0===d)break e;d--,m|=u[h++]<=1&&0===F[T];T--);if(P>T&&(P=T),0===T)return u[c++]=20971520,u[c++]=20971520,f.bits=1,0;for(E=1;E0&&(0===e||1!==T))return-1;for(O[1]=0,w=1;w<15;w++)O[w+1]=O[w]+F[w];for(k=0;k852||2===e&&I>592)return 1;for(;;){b=w-C,h[k]y?(_=B[D+h[k]],S=L[R+h[k]]):(_=96,S=0),d=1<>C)+(p-=d)]=b<<24|_<<16|S|0}while(0!==p);for(d=1<>=1;if(0!==d?(N&=d-1,N+=d):N=0,k++,0==--F[w]){if(w===T)break;w=t[n+h[k]]}if(w>P&&(N&v)!==m){for(0===C&&(C=P),g+=E,M=1<<(A=w-C);A+C852||2===e&&I>592)return 1;u[m=N&v]=P<<24|A<<16|g-c|0}}return 0!==N&&(u[g+N]=w-C<<24|64<<16|0),f.bits=P,0}},{"../utils/common":41}],51:[function(e,t,n){t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,t,n){var i=e("../utils/common");function r(e){for(var t=e.length;--t>=0;)e[t]=0}var a=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],s=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],l=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],u=new Array(576);r(u);var c=new Array(60);r(c);var h=new Array(512);r(h);var f=new Array(256);r(f);var d=new Array(29);r(d);var p,m,v,g=new Array(30);function y(e,t,n,i,r){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=e&&e.length}function b(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function _(e){return e<256?h[e]:h[256+(e>>>7)]}function S(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function x(e,t,n){e.bi_valid>16-n?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<>>=1,n<<=1}while(--t>0);return n>>>1}function E(e,t,n){var i,r,a=new Array(16),s=0;for(i=1;i<=15;i++)a[i]=s=s+n[i-1]<<1;for(r=0;r<=t;r++){var o=e[2*r+1];0!==o&&(e[2*r]=k(a[o]++,o))}}function T(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function P(e){e.bi_valid>8?S(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function A(e,t,n,i){var r=2*t,a=2*n;return e[r]>1;n>=1;n--)C(e,a,n);r=l;do{n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],C(e,a,1),i=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=i,a[2*r]=a[2*n]+a[2*i],e.depth[r]=(e.depth[n]>=e.depth[i]?e.depth[n]:e.depth[i])+1,a[2*n+1]=a[2*i+1]=r,e.heap[1]=r++,C(e,a,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,i,r,a,s,o,l=t.dyn_tree,u=t.max_code,c=t.stat_desc.static_tree,h=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(a=0;a<=15;a++)e.bl_count[a]=0;for(l[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<573;n++)(a=l[2*l[2*(i=e.heap[n])+1]+1]+1)>p&&(a=p,m++),l[2*i+1]=a,i>u||(e.bl_count[a]++,s=0,i>=d&&(s=f[i-d]),o=l[2*i],e.opt_len+=o*(a+s),h&&(e.static_len+=o*(c[2*i+1]+s)));if(0!==m){do{for(a=p-1;0===e.bl_count[a];)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[p]--,m-=2}while(m>0);for(a=p;0!==a;a--)for(i=e.bl_count[a];0!==i;)(r=e.heap[--n])>u||(l[2*r+1]!==a&&(e.opt_len+=(a-l[2*r+1])*l[2*r],l[2*r+1]=a),i--)}}(e,t),E(a,u,e.bl_count)}function N(e,t,n){var i,r,a=-1,s=t[1],o=0,l=7,u=4;for(0===s&&(l=138,u=3),t[2*(n+1)+1]=65535,i=0;i<=n;i++)r=s,s=t[2*(i+1)+1],++o>=7;i<30;i++)for(g[i]=r<<7,e=0;e<1<0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),I(e,e.l_desc),I(e,e.d_desc),s=function(e){var t;for(N(e,e.dyn_ltree,e.l_desc.max_code),N(e,e.dyn_dtree,e.d_desc.max_code),I(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*l[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),r=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=r&&(r=a)):r=a=n+5,n+4<=r&&-1!==t?F(e,t,n,i):4===e.strategy||a===r?(x(e,2+(i?1:0),3),M(e,u,c)):(x(e,4+(i?1:0),3),function(e,t,n,i){var r;for(x(e,t-257,5),x(e,n-1,5),x(e,i-4,4),r=0;r>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(f[n]+256+1)]++,e.dyn_dtree[2*_(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){x(e,2,3),w(e,256,u),function(e){16===e.bi_valid?(S(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,n){t.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(e,t,n){(function(e){!function(e,t){if(!e.setImmediate){var n,i,r,a,s,o=1,l={},u=!1,c=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?n=function(e){process.nextTick((function(){d(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&d(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),n=function(t){e.postMessage(a+t,"*")}):e.MessageChannel?((r=new MessageChannel).port1.onmessage=function(e){d(e.data)},n=function(e){r.port2.postMessage(e)}):c&&"onreadystatechange"in c.createElement("script")?(i=c.documentElement,n=function(e){var t=c.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):n=function(e){setTimeout(d,0,e)},h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),i=0;i=r.count?r.dispatchEvent(new CustomEvent(PlayerEvents.Complete)):r.mode===PlayMode.Bounce?(r.count&&(r._counter+=.5),setTimeout((function(){r.dispatchEvent(new CustomEvent(PlayerEvents.Loop)),r.currentState===PlayerState.Playing&&(r._lottie.setDirection(-1*r._lottie.playDirection),r._lottie.play())}),r.intermission)):(r.count&&(r._counter+=1),window.setTimeout((function(){r.dispatchEvent(new CustomEvent(PlayerEvents.Loop)),r.currentState===PlayerState.Playing&&(r._lottie.stop(),r._lottie.play())}),r.intermission)):r.dispatchEvent(new CustomEvent(PlayerEvents.Complete))})),this._lottie.addEventListener("DOMLoaded",(function(){r.dispatchEvent(new CustomEvent(PlayerEvents.Ready))})),this._lottie.addEventListener("data_ready",(function(){r.dispatchEvent(new CustomEvent(PlayerEvents.Load))})),this._lottie.addEventListener("data_failed",(function(){r.currentState=PlayerState.Error,r.dispatchEvent(new CustomEvent(PlayerEvents.Error))})),this.container.addEventListener("mouseenter",(function(){r.hover&&r.currentState!==PlayerState.Playing&&r.play()})),this.container.addEventListener("mouseleave",(function(){r.hover&&r.currentState===PlayerState.Playing&&r.stop()})),this.setSpeed(this.speed),this.setDirection(this.direction),this.autoplay&&this.play());case 14:case"end":return e.stop()}}),e,this,[[3,10]])}))),function(e){return n.apply(this,arguments)})},{key:"getLottie",value:function(){return this._lottie}},{key:"play",value:function(){this._lottie&&(this._lottie.play(),this.currentState=PlayerState.Playing,this.dispatchEvent(new CustomEvent(PlayerEvents.Play)))}},{key:"pause",value:function(){this._lottie&&(this._lottie.pause(),this.currentState=PlayerState.Paused,this.dispatchEvent(new CustomEvent(PlayerEvents.Pause)))}},{key:"stop",value:function(){this._lottie&&(this._counter=0,this._lottie.stop(),this.currentState=PlayerState.Stopped,this.dispatchEvent(new CustomEvent(PlayerEvents.Stop)))}},{key:"seek",value:function(e){if(this._lottie){var t=e.toString().match(/^([0-9]+)(%?)$/);if(t){var n="%"===t[2]?this._lottie.totalFrames*Number(t[1])/100:t[1];this.seeker=n,this.currentState===PlayerState.Playing?this._lottie.goToAndPlay(n,!0):(this._lottie.goToAndStop(n,!0),this._lottie.pause())}}}},{key:"snapshot",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shadowRoot){var t=this.shadowRoot.querySelector(".animation svg"),n=(new XMLSerializer).serializeToString(t);if(e){var i=document.createElement("a");i.href="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(n),i.download="download_"+this.seeker+".svg",document.body.appendChild(i),i.click(),document.body.removeChild(i)}return n}}},{key:"freeze",value:function(){this._lottie&&(this._lottie.pause(),this.currentState=PlayerState.Frozen,this.dispatchEvent(new CustomEvent(PlayerEvents.Freeze)))}},{key:"setSpeed",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this._lottie&&this._lottie.setSpeed(e)}},{key:"setDirection",value:function(e){this._lottie&&this._lottie.setDirection(e)}},{key:"setLooping",value:function(e){this._lottie&&(this.loop=e,this._lottie.loop=e)}},{key:"togglePlay",value:function(){return this.currentState===PlayerState.Playing?this.pause():this.play()}},{key:"toggleLooping",value:function(){this.setLooping(!this.loop)}},{key:"firstUpdated",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("IntersectionObserver"in window&&(this._io=new IntersectionObserver((function(e){e[0].isIntersecting?t.currentState===PlayerState.Frozen&&t.play():t.currentState===PlayerState.Playing&&t.freeze()})),this._io.observe(this.container)),void 0!==document.hidden&&document.addEventListener("visibilitychange",(function(){return t._onVisibilityChange()})),e.t0=this.src,!e.t0){e.next=6;break}return e.next=6,this.load(this.src);case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"disconnectedCallback",value:function(){var e=this;this._io&&(this._io.disconnect(),this._io=void 0),document.removeEventListener("visibilitychange",(function(){return e._onVisibilityChange()}))}},{key:"renderControls",value:function(){var e=this,t=this.currentState===PlayerState.Playing,n=this.currentState===PlayerState.Paused,i=this.currentState===PlayerState.Stopped;return $(_templateObject||(_templateObject=_taggedTemplateLiteral(['\n
\n \n ','\n \n \n \n \n \n \n \n \n
\n '])),this.togglePlay,t||n?"active":"",$(t?_templateObject2||(_templateObject2=_taggedTemplateLiteral(['\n \n '])):_templateObject3||(_templateObject3=_taggedTemplateLiteral(['\n \n ']))),this.stop,i?"active":"",this.seeker,this._handleSeekChange,(function(){e._prevState=e.currentState,e.freeze()}),(function(){e._prevState===PlayerState.Playing&&e.play()}),this.seeker,this.toggleLooping,this.loop?"active":"")}},{key:"render",value:function(){var e=this.controls?"main controls":"main",t=this.controls?"animation controls":"animation";return $(_templateObject4||(_templateObject4=_taggedTemplateLiteral(['\n \n "])),e,t,this.background,this.currentState===PlayerState.Error?$(_templateObject5||(_templateObject5=_taggedTemplateLiteral(['\n
⚠️
\n ']))):void 0,this.controls?this.renderControls():void 0)}}],[{key:"styles",get:function(){return styles$9}}]),r}(s$4);__decorate([i$4(".animation")],DotLottiePlayer.prototype,"container",void 0),__decorate([e$5()],DotLottiePlayer.prototype,"mode",void 0),__decorate([e$5({type:Boolean})],DotLottiePlayer.prototype,"autoplay",void 0),__decorate([e$5({type:String,reflect:!0})],DotLottiePlayer.prototype,"background",void 0),__decorate([e$5({type:Boolean})],DotLottiePlayer.prototype,"controls",void 0),__decorate([e$5({type:Number})],DotLottiePlayer.prototype,"count",void 0),__decorate([e$5({type:Number})],DotLottiePlayer.prototype,"direction",void 0),__decorate([e$5({type:Boolean})],DotLottiePlayer.prototype,"hover",void 0),__decorate([e$5({type:Boolean,reflect:!0})],DotLottiePlayer.prototype,"loop",void 0),__decorate([e$5({type:String})],DotLottiePlayer.prototype,"renderer",void 0),__decorate([e$5({type:Number})],DotLottiePlayer.prototype,"speed",void 0),__decorate([e$5({type:String})],DotLottiePlayer.prototype,"src",void 0),__decorate([e$5({type:String})],DotLottiePlayer.prototype,"currentState",void 0),__decorate([e$5()],DotLottiePlayer.prototype,"seeker",void 0),__decorate([e$5()],DotLottiePlayer.prototype,"intermission",void 0),DotLottiePlayer=__decorate([n$1("dotlottie-player")],DotLottiePlayer);var StartEvaluating="/orchestra-music-score/assets/start-evaluating.7994767f.lottie",Recording="/orchestra-music-score/assets/recording2.feb0931b.lottie",container$1="_container_yu37e_1",moreButton="_moreButton_yu37e_30",centerButton="_centerButton_yu37e_34",leftButton="_leftButton_yu37e_39",title$2="_title_yu37e_51",album="_album_yu37e_55",button$1="_button_yu37e_59",hasText$1="_hasText_yu37e_67",bigIcon$1="_bigIcon_yu37e_90",evaluatBtn="_evaluatBtn_yu37e_97",start$2="_start_yu37e_100",icon="_icon_yu37e_115",onShow="_onShow_yu37e_118",popover="_popover_yu37e_121",backbtn="_backbtn_yu37e_128",titleWrap="_titleWrap_yu37e_134",speed="_speed_yu37e_137",schedule="_schedule_yu37e_176",ring="_ring_yu37e_182",speedButton="_speedButton_yu37e_192",label="_label_yu37e_195",player="_player_yu37e_206",fullbtn="_fullbtn_yu37e_214",finish="_finish_yu37e_223",dialogueBox="_dialogueBox_yu37e_273",dialogue="_dialogue_yu37e_273",inRadio="_inRadio_yu37e_299",animation="_animation_yu37e_315",btnMusicList="_btnMusicList_yu37e_320",toggleMusicType="_toggleMusicType_yu37e_332",slider$1="_slider_yu37e_365",followEndBtn="_followEndBtn_yu37e_392",styles$8=exports("A",{container:container$1,moreButton:moreButton,centerButton:centerButton,leftButton:leftButton,title:title$2,album:album,button:button$1,hasText:hasText$1,bigIcon:bigIcon$1,evaluatBtn:evaluatBtn,start:start$2,icon:icon,onShow:onShow,popover:popover,backbtn:backbtn,titleWrap:titleWrap,speed:speed,schedule:schedule,ring:ring,speedButton:speedButton,label:label,player:player,fullbtn:fullbtn,finish:finish,dialogueBox:dialogueBox,dialogue:dialogue,inRadio:inRadio,animation:animation,btnMusicList:btnMusicList,toggleMusicType:toggleMusicType,slider:slider$1,followEndBtn:followEndBtn}),backtime=0,search$4=useOriginSearch(),initBehaviorId$2=""+(new Date).valueOf(),evaluating=ref(!1),playStatus=ref("stop"),endloading=ref(!1),connentLoading=ref(!1),playUrl=ref(""),endResult=ref(null),animate$1={mounted:function(e){e.addEventListener("click",(function(e){var t;(t=e.target.classList).add.apply(t,["animate__animated","animate__tada"])})),e.addEventListener("animationend",(function(e){var t;(t=e.target.classList).remove.apply(t,["animate__animated","animate__tada"])}))}},browserInfo$3=browser(),formatPitch=function(e){return e?state$4.sett.hertz&&442!==state$4.sett.hertz?e/442*state$4.sett.hertz:e:-1},formatTimes=function(){for(var e,t,n=(null===(e=state$2.times)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.difftime)||0,i=!1,r=!1,a=!1,s=[],o=0;o=0;){var t=state$2.times[e];if(t.stave)return t;e--}},r=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=getBoundingBoxByverticalNote(e);console.log(state$2.evaluatings,i),state$2.evaluatings=_objectSpread2(_objectSpread2({},state$2.evaluatings),{},_defineProperty2({},i.measureIndex,_objectSpread2(_objectSpread2(_objectSpread2({},i),getLeveByScoreMeasure(t.score)),{},{score:t.score,dontTransition:n})))},a=0;a=(null===(e=state$2.times[state$2.times.length-1])||void 0===e?void 0:e.time)-2&&(canSubmit.value=!0)},cloudMetronome=function(e){startButtonShow.value=!0},Evaluating$1=defineComponent({name:"ColexiuEvaluating",directives:{animate:animate$1},setup:function(e,t){var n=t.expose;return onMounted(_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,n,i,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return state.evaluatingTips=!0,state$2.section=[],state$2.sectionStatus=!1,changeAllMode(),playUrl.value=state.songs.background||state.songs.music,null===(t=state.audiosInstance)||void 0===t||null===(n=t.audios[playUrl.value])||void 0===n||n.addEventListener("play",timeupdate),null===(i=state.audiosInstance)||void 0===i||null===(r=i.audios[playUrl.value])||void 0===r||r.addEventListener("timeupdate",onProgress),event.on("next-click",playerStop),event.on("ended",endevent),listenerMessage("sendResult",sendResult),listenerMessage("cancelEvaluating",cancelEvaluating),listenerMessage("cloudTimeUpdae",onProgress),event.on("tickDestroy",cloudMetronome),event.on("tickEnd",start$1),e.next=16,pause();case 16:setCurrentTime(0);case 17:case"end":return e.stop()}}),e)})))),onBeforeUnmount((function(){var e,t,n,i;null===(e=state.audiosInstance)||void 0===e||null===(t=e.audios[playUrl.value])||void 0===t||t.removeEventListener("play",timeupdate),null===(n=state.audiosInstance)||void 0===n||null===(i=n.audios[playUrl.value])||void 0===i||i.removeEventListener("timeupdate",onProgress),event.off("next-click",playerStop),event.off("ended",endevent),event.off("tickDestroy",cloudMetronome),removeListenerMessage("sendResult",sendResult),removeListenerMessage("cancelEvaluating",cancelEvaluating),removeListenerMessage("cloudTimeUpdae",onProgress),event.off("tickEnd",start$1)})),n({setPlayer:setPlayer,startPlay:startPlay,stopPlay:stopPlay,togglePlay:togglePlay,playerStop:playerStop,evaluating:evaluating,connentLoading:connentLoading,playStatus:playStatus,cancelTheEvaluation:cancelTheEvaluation}),function(){return createVNode(Fragment,null,[withDirectives(createVNode(Button,{class:[styles$8.button,styles$8.hasText],style:{display:state$2.frozenMode?"none":""},onClick:function(){state.evaluatingStatus=!1,"play"!==playStatus.value&&"connecting"!==playStatus.value||cancelTheEvaluation()}},{default:function(){return[createVNode(ButtonIcon,{name:"practise"},null),createVNode("span",null,[createTextVNode("练习")])]}}),[[resolveDirective("animate")]]),createVNode(Evaluating,{data:endResult.value},null),evaluating.value?createVNode(Teleport,{to:"body",key:"Recording"},{default:function(){return[createVNode("div",{class:styles$8.dialogueBox},[createVNode("div",{class:styles$8.inRadio},[createTextVNode("收音中...")]),createVNode(resolveComponent("dotlottie-player"),{src:Recording,autoplay:!0,loop:!0,class:styles$8.animation},null)])]}}):createVNode(Teleport,{to:"body",key:"StartEvaluating"},{default:function(){return[createVNode("div",{class:styles$8.dialogueBox},[createVNode("div",{class:styles$8.dialogue},[createVNode("div",null,[createTextVNode("演奏前请调整好乐器,保证最佳演奏状态。"),createVNode("span",{class:styles$8.triangle},null)])]),createVNode(resolveComponent("dotlottie-player"),{src:StartEvaluating,autoplay:!0,loop:!0,class:styles$8.animation},null)])]}})])}}}),InfoIcon="/orchestra-music-score/assets/info.df4a2cca.svg",iconTv="/orchestra-music-score/assets/tv.e0e4a552.svg",iconYijian="/orchestra-music-score/assets/yijian.93a8e5bd.svg",setting="_setting_18qx2_1",sliderWrap="_sliderWrap_18qx2_45",slider="_slider_18qx2_45",noticebar="_noticebar_18qx2_68",groupBox="_groupBox_18qx2_74",btnsbar="_btnsbar_18qx2_93",btn="_btn_18qx2_93",radioGroup="_radioGroup_18qx2_124",styles$7={setting:setting,sliderWrap:sliderWrap,slider:slider,noticebar:noticebar,groupBox:groupBox,btnsbar:btnsbar,btn:btn,radioGroup:radioGroup},tabs="_tabs_e40bs_1",styles$6={tabs:tabs},show=ref(!1),HelperPopup=exports("ac",defineComponent({name:"HelperPopup",setup:function(){return function(){return createVNode(Popup,{show:show.value,position:"right",round:!0,teleport:"body",onClickOverlay:function(){return show.value=!1},style:{height:"100vh",width:"40vw",overflow:"hidden"}},{default:function(){return[createVNode(Tabs,{class:styles$6.tabs},{default:function(){return[createVNode(Tab,{title:"投屏"},{default:function(){return[createVNode("iframe",{src:location.origin+"/student/#/guide"},null)]}}),createVNode(Tab,{title:"帮助"},{default:function(){return[createVNode("iframe",{src:location.origin+"/student/#/helpCenter?platformType=ANALYSIS"},null)]}})]}})]}})}}})),raf$1={exports:{}},performanceNow={exports:{}};(function(){var e,t,n,i,r,a;"undefined"!=typeof performance&&null!==performance&&performance.now?performanceNow.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(performanceNow.exports=function(){return(e()-r)/1e6},t=process.hrtime,i=(e=function(){var e;return 1e9*(e=t())[0]+e[1]})(),a=1e9*process.uptime(),r=i-a):Date.now?(performanceNow.exports=function(){return Date.now()-n},n=Date.now()):(performanceNow.exports=function(){return(new Date).getTime()-n},n=(new Date).getTime())}).call(commonjsGlobal$1);for(var now=performanceNow.exports,root="undefined"==typeof window?commonjsGlobal$1:window,vendors=["moz","webkit"],suffix="AnimationFrame",raf=root["request"+suffix],caf=root["cancel"+suffix]||root["cancelRequest"+suffix],i$1=0;!raf&&i$13&&(this.alpha=l[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var e=this.r.toString(16),t=this.g.toString(16),n=this.b.toString(16);return 1==e.length&&(e="0"+e),1==t.length&&(t="0"+t),1==n.length&&(n="0"+n),"#"+e+t+n},this.getHelpXML=function(){for(var t=new Array,r=0;r "+c.toRGB()+" -> "+c.toHex());u.appendChild(h),u.appendChild(f),l.appendChild(u)}catch(e){}return l}},_t20=function(e,t){return(_t20=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}_t20(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function e(e){var t="";Array.isArray(e)||(e=[e]);for(var n=0;ne.phi1&&(e.phi2-=2*n),1===e.sweepFlag&&e.phi2i)return[];if(0===i)return[[e*n/(e*e+t*t),t*n/(e*e+t*t)]];var r=Math.sqrt(i);return[[(e*n+t*r)/(e*e+t*t),(t*n-e*r)/(e*e+t*t)],[(e*n-t*r)/(e*e+t*t),(t*n+e*r)/(e*e+t*t)]]}var u,h=Math.PI/180;function c$1(e,t,n){return(1-n)*e+n*t}function y(e,t,i,r){return e+Math.cos(r/180*n)*t+Math.sin(r/180*n)*i}function p(e,t,n,i){var r=1e-6,a=t-e,s=n-t,o=3*a+3*(i-n)-6*s,l=6*(s-a),u=3*a;return Math.abs(o)v&&(a.sweepFlag=+!a.sweepFlag),a}))}e.ROUND=function(e){function t(t){return Math.round(t*e)/e}return void 0===e&&(e=1e13),a(e),function(e){return void 0!==e.x1&&(e.x1=t(e.x1)),void 0!==e.y1&&(e.y1=t(e.y1)),void 0!==e.x2&&(e.x2=t(e.x2)),void 0!==e.y2&&(e.y2=t(e.y2)),void 0!==e.x&&(e.x=t(e.x)),void 0!==e.y&&(e.y=t(e.y)),void 0!==e.rX&&(e.rX=t(e.rX)),void 0!==e.rY&&(e.rY=t(e.rY)),e}},e.TO_ABS=t,e.TO_REL=function(){return l((function(e,t,n){return e.relative||(void 0!==e.x1&&(e.x1-=t),void 0!==e.y1&&(e.y1-=n),void 0!==e.x2&&(e.x2-=t),void 0!==e.y2&&(e.y2-=n),void 0!==e.x&&(e.x-=t),void 0!==e.y&&(e.y-=n),e.relative=!0),e}))},e.NORMALIZE_HVZ=function(e,t,n){return void 0===e&&(e=!0),void 0===t&&(t=!0),void 0===n&&(n=!0),l((function(i,r,a,s,o){if(isNaN(s)&&!(i.type&_.MOVE_TO))throw new Error("path must start with moveto");return t&&i.type&_.HORIZ_LINE_TO&&(i.type=_.LINE_TO,i.y=i.relative?0:a),n&&i.type&_.VERT_LINE_TO&&(i.type=_.LINE_TO,i.x=i.relative?0:r),e&&i.type&_.CLOSE_PATH&&(i.type=_.LINE_TO,i.x=i.relative?s-r:s,i.y=i.relative?o-a:o),i.type&_.ARC&&(0===i.rX||0===i.rY)&&(i.type=_.LINE_TO,delete i.rX,delete i.rY,delete i.xRot,delete i.lArcFlag,delete i.sweepFlag),i}))},e.NORMALIZE_ST=n,e.QT_TO_C=r,e.INFO=l,e.SANITIZE=function(e){void 0===e&&(e=0),a(e);var t=NaN,n=NaN,i=NaN,r=NaN;return l((function(a,s,o,l,u){var c=Math.abs,h=!1,f=0,d=0;if(a.type&_.SMOOTH_CURVE_TO&&(f=isNaN(t)?0:s-t,d=isNaN(n)?0:o-n),a.type&(_.CURVE_TO|_.SMOOTH_CURVE_TO)?(t=a.relative?s+a.x2:a.x2,n=a.relative?o+a.y2:a.y2):(t=NaN,n=NaN),a.type&_.SMOOTH_QUAD_TO?(i=isNaN(i)?s:2*s-i,r=isNaN(r)?o:2*o-r):a.type&_.QUAD_TO?(i=a.relative?s+a.x1:a.x1,r=a.relative?o+a.y1:a.y2):(i=NaN,r=NaN),a.type&_.LINE_COMMANDS||a.type&_.ARC&&(0===a.rX||0===a.rY||!a.lArcFlag)||a.type&_.CURVE_TO||a.type&_.SMOOTH_CURVE_TO||a.type&_.QUAD_TO||a.type&_.SMOOTH_QUAD_TO){var p=void 0===a.x?0:a.relative?a.x:a.x-s,m=void 0===a.y?0:a.relative?a.y:a.y-o;f=isNaN(i)?void 0===a.x1?f:a.relative?a.x:a.x1-s:i-s,d=isNaN(r)?void 0===a.y1?d:a.relative?a.y:a.y1-o:r-o;var v=void 0===a.x2?0:a.relative?a.x:a.x2-s,g=void 0===a.y2?0:a.relative?a.y:a.y2-o;c(p)<=e&&c(m)<=e&&c(f)<=e&&c(d)<=e&&c(v)<=e&&c(g)<=e&&(h=!0)}return a.type&_.CLOSE_PATH&&c(s-l)<=e&&c(o-u)<=e&&(h=!0),h?[]:a}))},e.MATRIX=u,e.ROTATE=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=0),a(e,t,n);var i=Math.sin(e),r=Math.cos(e);return u(r,i,-i,r,t-t*r+n*i,n-t*i-n*r)},e.TRANSLATE=function(e,t){return void 0===t&&(t=0),a(e,t),u(1,0,0,1,e,t)},e.SCALE=function(e,t){return void 0===t&&(t=e),a(e,t),u(e,0,0,t,0,0)},e.SKEW_X=function(e){return a(e),u(1,0,Math.atan(e),1,0,0)},e.SKEW_Y=function(e){return a(e),u(1,Math.atan(e),0,1,0,0)},e.X_AXIS_SYMMETRY=function(e){return void 0===e&&(e=0),a(e),u(-1,0,0,1,e,0)},e.Y_AXIS_SYMMETRY=function(e){return void 0===e&&(e=0),a(e),u(1,0,0,-1,0,e)},e.A_TO_C=function(){return l((function(e,t,n){return _.ARC===e.type?function(e,t,n){var r,a,s,l;e.cX||o(e,t,n);for(var u=Math.min(e.phi1,e.phi2),c=Math.max(e.phi1,e.phi2)-u,f=Math.ceil(c/90),d=new Array(f),p=t,m=n,v=0;vu.maxX&&(u.maxX=e),eu.maxY&&(u.maxY=e),eN&&c(m$1(n,l.x1,l.x2,l.x,N));for(var m=0,v=p(r,l.y1,l.y2,l.y);mN&&h(m$1(r,l.y1,l.y2,l.y,N))}if(l.type&_.ARC){c(l.x),h(l.y),o(l,n,r);for(var g=l.xRot/180*Math.PI,b=Math.cos(g)*l.rX,S=Math.sin(g)*l.rX,x=-Math.sin(g)*l.rY,w=Math.cos(g)*l.rY,k=l.phi1l.phi2?[l.phi2+360,l.phi1+360]:[l.phi2,l.phi1],E=k[0],T=k[1],P=function(e){var t=e[0],n=e[1],i=180*Math.atan2(n,t)/Math.PI;return iE&&NE&&Nl)throw new SyntaxError('Expected positive number, got "'+l+'" at index "'+r+'"')}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+r+'"');this.curArgs.push(l),this.curArgs.length===N[this.curCommandType]&&(_.HORIZ_LINE_TO===this.curCommandType?i({type:_.HORIZ_LINE_TO,relative:this.curCommandRelative,x:l}):_.VERT_LINE_TO===this.curCommandType?i({type:_.VERT_LINE_TO,relative:this.curCommandRelative,y:l}):this.curCommandType===_.MOVE_TO||this.curCommandType===_.LINE_TO||this.curCommandType===_.SMOOTH_QUAD_TO?(i({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),_.MOVE_TO===this.curCommandType&&(this.curCommandType=_.LINE_TO)):this.curCommandType===_.CURVE_TO?i({type:_.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===_.SMOOTH_CURVE_TO?i({type:_.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===_.QUAD_TO?i({type:_.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===_.ARC&&i({type:_.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!T(a))if(","===a&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==a&&"-"!==a&&"."!==a)if(o)this.curNumber=a,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError("Unterminated command at index "+r+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+a+'" at index '+r+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,"z"!==a&&"Z"!==a)if("h"===a||"H"===a)this.curCommandType=_.HORIZ_LINE_TO,this.curCommandRelative="h"===a;else if("v"===a||"V"===a)this.curCommandType=_.VERT_LINE_TO,this.curCommandRelative="v"===a;else if("m"===a||"M"===a)this.curCommandType=_.MOVE_TO,this.curCommandRelative="m"===a;else if("l"===a||"L"===a)this.curCommandType=_.LINE_TO,this.curCommandRelative="l"===a;else if("c"===a||"C"===a)this.curCommandType=_.CURVE_TO,this.curCommandRelative="c"===a;else if("s"===a||"S"===a)this.curCommandType=_.SMOOTH_CURVE_TO,this.curCommandRelative="s"===a;else if("q"===a||"Q"===a)this.curCommandType=_.QUAD_TO,this.curCommandRelative="q"===a;else if("t"===a||"T"===a)this.curCommandType=_.SMOOTH_QUAD_TO,this.curCommandRelative="t"===a;else{if("a"!==a&&"A"!==a)throw new SyntaxError('Unexpected character "'+a+'" at index '+r+".");this.curCommandType=_.ARC,this.curCommandRelative="a"===a}else t.push({type:_.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=a,this.curNumberHasDecimal="."===a}else this.curNumber+=a,this.curNumberHasDecimal=!0;else this.curNumber+=a;else this.curNumber+=a,this.curNumberHasExp=!0;else this.curNumber+=a,this.curNumberHasExpDigits=this.curNumberHasExp}return t},t.prototype.transform=function(e){return Object.create(this,{parse:{value:function(t,n){void 0===n&&(n=[]);for(var i=0,r=Object.getPrototypeOf(this).parse.call(this,t);i>S;if(o[b+3]=Y,0!==Y){var X=255/Y;o[b]=(O*_>>S)*X,o[b+1]=(B*_>>S)*X,o[b+2]=(D*_>>S)*X}else o[b]=o[b+1]=o[b+2]=0;O-=N,B-=L,D-=R,V-=F,N-=v.r,L-=v.g,R-=v.b,F-=v.a;var K=q+a+1;K=y+(K>S,se>0?(se=255/se,o[ke]=(he*_>>S)*se,o[ke+1]=(fe*_>>S)*se,o[ke+2]=(de*_>>S)*se):o[ke]=o[ke+1]=o[ke+2]=0,he-=oe,fe-=le,de-=ue,pe-=ce,oe-=v.r,le-=v.g,ue-=v.b,ce-=v.a,ke=ne+((ke=we+h)0&&void 0!==arguments[0]?arguments[0]:{},t=e.DOMParser,n={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:t,createCanvas:function(e,t){return new OffscreenCanvas(e,t)},createImage:function(e){return _asyncToGenerator(regeneratorRuntime.mark((function t(){var n,i,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch(e);case 2:return n=t.sent,t.next=5,n.blob();case 5:return i=t.sent,t.next=8,createImageBitmap(i);case 8:return r=t.sent,t.abrupt("return",r);case 10:case"end":return t.stop()}}),t)})))()}};return void 0===globalThis.DOMParser&&void 0!==t||Reflect.deleteProperty(n,"DOMParser"),n}function node(e){var t=e.DOMParser,n=e.canvas;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:t,fetch:e.fetch,createCanvas:n.createCanvas,createImage:n.loadImage}}var index=exports("n",Object.freeze({__proto__:null,offscreen:offscreen,node:node}));function compressSpaces(e){return e.replace(/(?!\u3000)\s+/gm," ")}function trimLeft(e){return e.replace(/^[\n \t]+/,"")}function trimRight(e){return e.replace(/[\n \t]+$/,"")}function toNumbers(e){var t=e.match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm);return t?t.map(parseFloat):[]}function toMatrixValue(e){var t=toNumbers(e);return[t[0]||0,t[1]||0,t[2]||0,t[3]||0,t[4]||0,t[5]||0]}var allUppercase=/^[A-Z-]+$/;function normalizeAttributeName(e){return allUppercase.test(e)?e.toLowerCase():e}function parseExternalUrl(e){var t=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(e);return t&&(t[2]||t[3]||t[4])||""}function normalizeColor(e){if(!e.startsWith("rgb"))return e;var t=3,n=e.replace(/\d+(\.\d+)?/g,(function(e,n){return t--&&n?String(Math.round(parseFloat(e))):e}));return n}var attributeRegex=/(\[[^\]]+\])/g,idRegex=/(#[^\s+>~.[:]+)/g,classRegex=/(\.[^\s+>~.[:]+)/g,pseudoElementRegex=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,pseudoClassWithBracketsRegex=/(:[\w-]+\([^)]*\))/gi,pseudoClassRegex=/(:[^\s+>~.[:]+)/g,elementRegex=/([^\s+>~.[:]+)/g;function findSelectorMatch(e,t){var n=t.exec(e);return n?[e.replace(t," "),n.length]:[e,0]}function getSelectorSpecificity(e){var t=[0,0,0],n=e.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),i=0,r=_slicedToArray(findSelectorMatch(n,attributeRegex),2);n=r[0],i=r[1],t[1]+=i;var a=_slicedToArray(findSelectorMatch(n,idRegex),2);n=a[0],i=a[1],t[0]+=i;var s=_slicedToArray(findSelectorMatch(n,classRegex),2);n=s[0],i=s[1],t[1]+=i;var o=_slicedToArray(findSelectorMatch(n,pseudoElementRegex),2);n=o[0],i=o[1],t[2]+=i;var l=_slicedToArray(findSelectorMatch(n,pseudoClassWithBracketsRegex),2);n=l[0],i=l[1],t[1]+=i;var u=_slicedToArray(findSelectorMatch(n,pseudoClassRegex),2);n=u[0],i=u[1],t[1]+=i;var c=_slicedToArray(findSelectorMatch(n=n.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),elementRegex),2);return n=c[0],i=c[1],t[2]+=i,t.join("")}var PSEUDO_ZERO=1e-8;function vectorMagnitude(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2))}function vectorsRatio(e,t){return(e[0]*t[0]+e[1]*t[1])/(vectorMagnitude(e)*vectorMagnitude(t))}function vectorsAngle(e,t){return(e[0]*t[1]0&&void 0!==arguments[0]?arguments[0]:" ",n=this.document,i=this.name;return compressSpaces(this.getString()).trim().split(t).map((function(t){return new e(n,i,t)}))}},{key:"hasValue",value:function(e){var t=this.value;return null!==t&&""!==t&&(e||0!==t)&&void 0!==t}},{key:"isString",value:function(e){var t=this.value,n="string"==typeof t;return n&&e?e.test(t):n}},{key:"isUrlDefinition",value:function(){return this.isString(/^url\(/)}},{key:"isPixels",value:function(){if(!this.hasValue())return!1;var e=this.getString();switch(!0){case e.endsWith("px"):case/^[0-9]+$/.test(e):return!0;default:return!1}}},{key:"setValue",value:function(e){return this.value=e,this}},{key:"getValue",value:function(e){return void 0===e||this.hasValue()?this.value:e}},{key:"getNumber",value:function(e){if(!this.hasValue())return void 0===e?0:parseFloat(e);var t=this.value,n=parseFloat(t);return this.isString(/%$/)&&(n/=100),n}},{key:"getString",value:function(e){return void 0===e||this.hasValue()?void 0===this.value?"":String(this.value):String(e)}},{key:"getColor",value:function(e){var t=this.getString(e);return this.isNormalizedColor||(this.isNormalizedColor=!0,t=normalizeColor(t),this.value=t),t}},{key:"getDpi",value:function(){return 96}},{key:"getRem",value:function(){return this.document.rootEmSize}},{key:"getEm",value:function(){return this.document.emSize}},{key:"getUnits",value:function(){return this.getString().replace(/[0-9.-]/g,"")}},{key:"getPixels",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.hasValue())return 0;var n="boolean"==typeof e?[void 0,e]:[e],i=_slicedToArray(n,2),r=i[0],a=i[1],s=this.document.screen.viewPort;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(s.computeSize("x"),s.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(s.computeSize("x"),s.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*s.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*s.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return 15*this.getNumber();case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case this.isString(/%$/)&&a:return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*s.computeSize(r);default:var o=this.getNumber();return t&&o<1?o*s.computeSize(r):o}}},{key:"getMilliseconds",value:function(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():1e3*this.getNumber():0}},{key:"getRadians",value:function(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}},{key:"getDefinition",value:function(){var e=this.getString(),t=/#([^)'"]+)/.exec(e),n=(null==t?void 0:t[1])||e;return this.document.definitions[n]}},{key:"getFillStyleDefinition",value:function(e,t){var n=this.getDefinition();if(!n)return null;if("function"==typeof n.createGradient&&"getBoundingBox"in e)return n.createGradient(this.document.ctx,e,t);if("function"==typeof n.createPattern){if(n.getHrefAttribute().hasValue()){var i=n.getAttribute("patternTransform");(n=n.getHrefAttribute().getDefinition())&&i.hasValue()&&n.getAttribute("patternTransform",!0).setValue(i.value)}if(n)return n.createPattern(this.document.ctx,e,t)}return null}},{key:"getTextBaseline",value:function(){if(!this.hasValue())return null;var t=this.getString();return e.textBaselineMapping[t]||null}},{key:"addOpacity",value:function(t){for(var n=this.getColor(),i=n.length,r=0,a=0;a1&&void 0!==arguments[1]?arguments[1]:0,i=toNumbers(t),r=_slicedToArray(i,2),a=r[0],s=void 0===a?n:a,o=r[1],l=void 0===o?n:o;return new e(s,l)}},{key:"parseScale",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=toNumbers(t),r=_slicedToArray(i,2),a=r[0],s=void 0===a?n:a,o=r[1],l=void 0===o?s:o;return new e(s,l)}},{key:"parsePath",value:function(t){for(var n=toNumbers(t),i=n.length,r=[],a=0;a0}},{key:"runEvents",value:function(){if(this.working){var e,t=this.screen,n=this.events,i=this.eventElements,r=t.ctx.canvas.style;r&&(r.cursor=""),n.forEach((function(t,n){var r=t.run;for(e=i[n];e;)r(e),e=e.parent})),this.events=[],this.eventElements=[]}}},{key:"checkPath",value:function(e,t){if(this.working&&t){var n=this.events,i=this.eventElements;n.forEach((function(n,r){var a=n.x,s=n.y;!i[r]&&t.isPointInPath&&t.isPointInPath(a,s)&&(i[r]=e)}))}}},{key:"checkBoundingBox",value:function(e,t){if(this.working&&t){var n=this.events,i=this.eventElements;n.forEach((function(n,r){var a=n.x,s=n.y;!i[r]&&t.isPointInBox(a,s)&&(i[r]=e)}))}}},{key:"mapXY",value:function(e,t){for(var n=this.screen,i=n.window,r=n.ctx,a=new Point(e,t),s=r.canvas;s;)a.x-=s.offsetLeft,a.y-=s.offsetTop,s=s.offsetParent;return(null==i?void 0:i.scrollX)&&(a.x+=i.scrollX),(null==i?void 0:i.scrollY)&&(a.y+=i.scrollY),a}},{key:"onClick",value:function(e){var t=this.mapXY(e.clientX,e.clientY),n=t.x,i=t.y;this.events.push({type:"onclick",x:n,y:i,run:function(e){e.onClick&&e.onClick()}})}},{key:"onMouseMove",value:function(e){var t=this.mapXY(e.clientX,e.clientY),n=t.x,i=t.y;this.events.push({type:"onmousemove",x:n,y:i,run:function(e){e.onMouseMove&&e.onMouseMove()}})}}]),e}(),defaultWindow="undefined"!=typeof window?window:null,defaultFetch$1="undefined"!=typeof fetch?fetch.bind(void 0):void 0,Screen=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.fetch,r=void 0===i?defaultFetch$1:i,a=n.window,s=void 0===a?defaultWindow:a;if(_classCallCheck2(this,e),this.ctx=t,this.viewPort=new ViewPort,this.mouse=new Mouse(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=s,!r)throw new Error("Can't find 'fetch' in 'globalThis', please provide it via options");this.fetch=r}return _createClass2(e,[{key:"wait",value:function(e){this.waits.push(e)}},{key:"ready",value:function(){return this.readyPromise?this.readyPromise:Promise.resolve()}},{key:"isReady",value:function(){if(this.isReadyLock)return!0;var e=this.waits.every((function(e){return e()}));return e&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=e,e}},{key:"setDefaults",value:function(e){e.strokeStyle="rgba(0,0,0,0)",e.lineCap="butt",e.lineJoin="miter",e.miterLimit=4}},{key:"setViewBox",value:function(e){var t=e.document,n=e.ctx,i=e.aspectRatio,r=e.width,a=e.desiredWidth,s=e.height,o=e.desiredHeight,l=e.minX,u=void 0===l?0:l,c=e.minY,h=void 0===c?0:c,f=e.refX,d=e.refY,p=e.clip,m=void 0!==p&&p,v=e.clipX,g=void 0===v?0:v,y=e.clipY,b=void 0===y?0:y,_=_slicedToArray(compressSpaces(i).replace(/^defer\s/,"").split(" "),2),S=_[0]||"xMidYMid",x=_[1]||"meet",w=r/a,k=s/o,E=Math.min(w,k),T=Math.max(w,k),P=a,A=o;"meet"===x&&(P*=E,A*=E),"slice"===x&&(P*=T,A*=T);var C=new Property(t,"refX",f),M=new Property(t,"refY",d),I=C.hasValue()&&M.hasValue();if(I&&n.translate(-E*C.getPixels("x"),-E*M.getPixels("y")),m){var N=E*g,L=E*b;n.beginPath(),n.moveTo(N,L),n.lineTo(r,L),n.lineTo(r,s),n.lineTo(N,s),n.closePath(),n.clip()}if(!I){var R="meet"===x&&E===k,F="slice"===x&&T===k,O="meet"===x&&E===w,B="slice"===x&&T===w;S.startsWith("xMid")&&(R||F)&&n.translate(r/2-P/2,0),S.endsWith("YMid")&&(O||B)&&n.translate(0,s/2-A/2),S.startsWith("xMax")&&(R||F)&&n.translate(r-P,0),S.endsWith("YMax")&&(O||B)&&n.translate(0,s-A)}switch(!0){case"none"===S:n.scale(w,k);break;case"meet"===x:n.scale(E,E);break;case"slice"===x:n.scale(T,T)}n.translate(-u,-h)}},{key:"start",value:function(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=i.enableRedraw,a=void 0!==r&&r,s=i.ignoreMouse,o=void 0!==s&&s,l=i.ignoreAnimation,u=void 0!==l&&l,c=i.ignoreDimensions,h=void 0!==c&&c,f=i.ignoreClear,d=void 0!==f&&f,p=i.forceRedraw,m=i.scaleWidth,v=i.scaleHeight,g=i.offsetX,y=i.offsetY,b=this.mouse,_=1e3/e.FRAMERATE;if(this.frameDuration=_,this.readyPromise=new Promise((function(e){n.resolveReady=e})),this.isReady()&&this.render(t,h,d,m,v,g,y),a){var S=Date.now(),x=S,w=0,k=function e(){S=Date.now(),(w=S-x)>=_&&(x=S-w%_,n.shouldUpdate(u,p)&&(n.render(t,h,d,m,v,g,y),b.runEvents())),n.intervalId=requestAnimationFrame$1(e)};o||b.start(),this.intervalId=requestAnimationFrame$1(k)}}},{key:"stop",value:function(){this.intervalId&&(requestAnimationFrame$1.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}},{key:"shouldUpdate",value:function(e,t){if(!e){var n=this.frameDuration,i=this.animations.reduce((function(e,t){return t.update(n)||e}),!1);if(i)return!0}return!("function"!=typeof t||!t())||(!(this.isReadyLock||!this.isReady())||!!this.mouse.hasEvents())}},{key:"render",value:function(e,t,n,i,r,a,s){var o=this.viewPort,l=this.ctx,u=this.isFirstRender,c=l.canvas;o.clear(),c.width&&c.height&&o.setCurrent(c.width,c.height);var h=e.getStyle("width"),f=e.getStyle("height");!t&&(u||"number"!=typeof i&&"number"!=typeof r)&&(h.hasValue()&&(c.width=h.getPixels("x"),c.style&&(c.style.width="".concat(c.width,"px"))),f.hasValue()&&(c.height=f.getPixels("y"),c.style&&(c.style.height="".concat(c.height,"px"))));var d=c.clientWidth||c.width,p=c.clientHeight||c.height;if(t&&h.hasValue()&&f.hasValue()&&(d=h.getPixels("x"),p=f.getPixels("y")),o.setCurrent(d,p),"number"==typeof a&&e.getAttribute("x",!0).setValue(a),"number"==typeof s&&e.getAttribute("y",!0).setValue(s),"number"==typeof i||"number"==typeof r){var m=toNumbers(e.getAttribute("viewBox").getString()),v=0,g=0;if("number"==typeof i){var y=e.getStyle("width");y.hasValue()?v=y.getPixels("x")/i:m[2]&&!isNaN(m[2])&&(v=m[2]/i)}if("number"==typeof r){var b=e.getStyle("height");b.hasValue()?g=b.getPixels("y")/r:m[3]&&!isNaN(m[3])&&(g=m[3]/r)}v||(v=g),g||(g=v),e.getAttribute("width",!0).setValue(i),e.getAttribute("height",!0).setValue(r);var _=e.getStyle("transform",!0,!0);_.setValue("".concat(_.getString()," scale(").concat(1/v,", ").concat(1/g,")"))}n||l.clearRect(0,0,d,p),e.render(l),u&&(this.isFirstRender=!1)}}]),e}();Screen.defaultWindow=defaultWindow,Screen.defaultFetch=defaultFetch$1,Screen.FRAMERATE=30,Screen.MAX_VIRTUAL_PIXELS=3e4;var defaultFetch=Screen.defaultFetch,DefaultDOMParser="undefined"!=typeof DOMParser?DOMParser:void 0,Parser=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.fetch,i=void 0===n?defaultFetch:n,r=t.DOMParser,a=void 0===r?DefaultDOMParser:r;if(_classCallCheck2(this,e),!i)throw new Error("Can't find 'fetch' in 'globalThis', please provide it via options");if(!a)throw new Error("Can't find 'DOMParser' in 'globalThis', please provide it via options");this.fetch=i,this.DOMParser=a}var t,n;return _createClass2(e,[{key:"parse",value:(n=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.startsWith("<")){e.next=2;break}return e.abrupt("return",this.parseFromString(t));case 2:return e.abrupt("return",this.load(t));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"parseFromString",value:function(e){var t=new this.DOMParser;try{return this.checkDocument(t.parseFromString(e,"image/svg+xml"))}catch(err){return this.checkDocument(t.parseFromString(e,"text/xml"))}}},{key:"checkDocument",value:function(e){var t=e.getElementsByTagName("parsererror")[0];if(t)throw new Error(t.textContent||"Unknown parse error");return e}},{key:"load",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.fetch(t);case 2:return n=e.sent,e.next=5,n.text();case 5:return i=e.sent,e.abrupt("return",this.parseFromString(i));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}(),Translate=function(){function e(t,n){_classCallCheck2(this,e),this.type="translate",this.point=Point.parse(n)}return _createClass2(e,[{key:"apply",value:function(e){var t=this.point,n=t.x,i=t.y;e.translate(n||0,i||0)}},{key:"unapply",value:function(e){var t=this.point,n=t.x,i=t.y;e.translate(-1*n||0,-1*i||0)}},{key:"applyToPoint",value:function(e){var t=this.point,n=t.x,i=t.y;e.applyTransform([1,0,0,1,n||0,i||0])}}]),e}(),Rotate=function(){function e(t,n,i){_classCallCheck2(this,e),this.type="rotate";var r=toNumbers(n);this.angle=new Property(t,"angle",r[0]),this.originX=i[0],this.originY=i[1],this.cx=r[1]||0,this.cy=r[2]||0}return _createClass2(e,[{key:"apply",value:function(e){var t=this.cx,n=this.cy,i=this.originX,r=this.originY,a=this.angle,s=t+i.getPixels("x"),o=n+r.getPixels("y");e.translate(s,o),e.rotate(a.getRadians()),e.translate(-s,-o)}},{key:"unapply",value:function(e){var t=this.cx,n=this.cy,i=this.originX,r=this.originY,a=this.angle,s=t+i.getPixels("x"),o=n+r.getPixels("y");e.translate(s,o),e.rotate(-1*a.getRadians()),e.translate(-s,-o)}},{key:"applyToPoint",value:function(e){var t=this.cx,n=this.cy,i=this.angle.getRadians();e.applyTransform([1,0,0,1,t||0,n||0]),e.applyTransform([Math.cos(i),Math.sin(i),-Math.sin(i),Math.cos(i),0,0]),e.applyTransform([1,0,0,1,-t||0,-n||0])}}]),e}(),Scale=function(){function e(t,n,i){_classCallCheck2(this,e),this.type="scale";var r=Point.parseScale(n);0!==r.x&&0!==r.y||(r.x=PSEUDO_ZERO,r.y=PSEUDO_ZERO),this.scale=r,this.originX=i[0],this.originY=i[1]}return _createClass2(e,[{key:"apply",value:function(e){var t=this.scale,n=t.x,i=t.y,r=this.originX,a=this.originY,s=r.getPixels("x"),o=a.getPixels("y");e.translate(s,o),e.scale(n,i||n),e.translate(-s,-o)}},{key:"unapply",value:function(e){var t=this.scale,n=t.x,i=t.y,r=this.originX,a=this.originY,s=r.getPixels("x"),o=a.getPixels("y");e.translate(s,o),e.scale(1/n,1/i||n),e.translate(-s,-o)}},{key:"applyToPoint",value:function(e){var t=this.scale,n=t.x,i=t.y;e.applyTransform([n||0,0,0,i||0,0,0])}}]),e}(),Matrix=function(){function e(t,n,i){_classCallCheck2(this,e),this.type="matrix",this.matrix=toMatrixValue(n),this.originX=i[0],this.originY=i[1]}return _createClass2(e,[{key:"apply",value:function(e){var t=this.originX,n=this.originY,i=this.matrix,r=t.getPixels("x"),a=n.getPixels("y");e.translate(r,a),e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),e.translate(-r,-a)}},{key:"unapply",value:function(e){var t=this.originX,n=this.originY,i=this.matrix,r=i[0],a=i[2],s=i[4],o=i[1],l=i[3],u=i[5],c=1/(r*(1*l-0*u)-a*(1*o-0*u)+s*(0*o-0*l)),h=t.getPixels("x"),f=n.getPixels("y");e.translate(h,f),e.transform(c*(1*l-0*u),c*(0*u-1*o),c*(0*s-1*a),c*(1*r-0*s),c*(a*u-s*l),c*(s*o-r*u)),e.translate(-h,-f)}},{key:"applyToPoint",value:function(e){e.applyTransform(this.matrix)}}]),e}(),Skew=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i,r){var a;return _classCallCheck2(this,n),(a=t.call(this,e,i,r)).type="skew",a.angle=new Property(e,"angle",i),a}return _createClass2(n)}(Matrix),SkewX=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i,r){var a;return _classCallCheck2(this,n),(a=t.call(this,e,i,r)).type="skewX",a.matrix=[1,0,Math.tan(a.angle.getRadians()),1,0,0],a}return _createClass2(n)}(Skew),SkewY=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i,r){var a;return _classCallCheck2(this,n),(a=t.call(this,e,i,r)).type="skewY",a.matrix=[1,Math.tan(a.angle.getRadians()),0,1,0,0],a}return _createClass2(n)}(Skew);function parseTransforms(e){return compressSpaces(e).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function parseTransform(e){var t=_slicedToArray(e.split("("),2),n=t[0],i=void 0===n?"":n,r=t[1],a=void 0===r?"":r;return[i.trim(),a.trim().replace(")","")]}var Transform=function(){function e(t,n,i){var r=this;_classCallCheck2(this,e),this.document=t,this.transforms=[],parseTransforms(n).forEach((function(t){if("none"!==t){var n=_slicedToArray(parseTransform(t),2),a=n[0],s=n[1],o=e.transformTypes[a];o&&r.transforms.push(new o(r.document,s,i))}}))}return _createClass2(e,[{key:"apply",value:function(e){this.transforms.forEach((function(t){return t.apply(e)}))}},{key:"unapply",value:function(e){this.transforms.forEach((function(t){return t.unapply(e)}))}},{key:"applyToPoint",value:function(e){this.transforms.forEach((function(t){return t.applyToPoint(e)}))}}],[{key:"fromElement",value:function(t,n){var i=n.getStyle("transform",!1,!0);if(i.hasValue()){var r=_slicedToArray(n.getStyle("transform-origin",!1,!0).split(),2),a=r[0],s=r[1],o=void 0===s?a:s;if(a&&o){var l=[a,o];return new e(t,i.getString(),l)}}return null}}]),e}();Transform.transformTypes={translate:Translate,rotate:Rotate,scale:Scale,matrix:Matrix,skewX:SkewX,skewY:SkewY};var Element$1=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(_classCallCheck2(this,e),this.document=t,this.node=n,this.captureTextNodes=r,this.type="",this.attributes={},this.styles={},this.stylesSpecificity={},this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],n&&1===n.nodeType){if(Array.from(n.attributes).forEach((function(e){var n=normalizeAttributeName(e.nodeName);i.attributes[n]=new Property(t,n,e.value)})),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()){var a=this.getAttribute("style").getString().split(";").map((function(e){return e.trim()}));a.forEach((function(e){if(e){var n=e.split(":").map((function(e){return e.trim()})),r=_slicedToArray(n,2),a=r[0],s=r[1];a&&(i.styles[a]=new Property(t,a,s))}}))}var s=t.definitions,o=this.getAttribute("id");o.hasValue()&&(s[o.getString()]||(s[o.getString()]=this)),Array.from(n.childNodes).forEach((function(e){if(1===e.nodeType)i.addChild(e);else if(r&&(3===e.nodeType||4===e.nodeType)){var n=t.createTextNode(e);n.getText().length>0&&i.addChild(n)}}))}}return _createClass2(e,[{key:"getAttribute",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.attributes[e];if(!n&&t){var i=new Property(this.document,e,"");return this.attributes[e]=i,i}return n||Property.empty(this.document)}},{key:"getHrefAttribute",value:function(){var e;for(var t in this.attributes)if("href"===t||t.endsWith(":href")){e=this.attributes[t];break}return e||Property.empty(this.document)}},{key:"getStyle",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.styles[e];if(i)return i;var r=this.getAttribute(e);if(r.hasValue())return this.styles[e]=r,r;if(!n){var a=this.parent;if(a){var s=a.getStyle(e);if(s.hasValue())return s}}if(t){var o=new Property(this.document,e,"");return this.styles[e]=o,o}return Property.empty(this.document)}},{key:"render",value:function(e){if("none"!==this.getStyle("display").getString()&&"hidden"!==this.getStyle("visibility").getString()){if(e.save(),this.getStyle("mask").hasValue()){var t=this.getStyle("mask").getDefinition();t&&(this.applyEffects(e),t.apply(e,this))}else if("none"!==this.getStyle("filter").getValue("none")){var n=this.getStyle("filter").getDefinition();n&&(this.applyEffects(e),n.apply(e,this))}else this.setContext(e),this.renderChildren(e),this.clearContext(e);e.restore()}}},{key:"setContext",value:function(e){}},{key:"applyEffects",value:function(e){var t=Transform.fromElement(this.document,this);t&&t.apply(e);var n=this.getStyle("clip-path",!1,!0);if(n.hasValue()){var i=n.getDefinition();i&&i.apply(e)}}},{key:"clearContext",value:function(e){}},{key:"renderChildren",value:function(e){this.children.forEach((function(t){t.render(e)}))}},{key:"addChild",value:function(t){var n=t instanceof e?t:this.document.createElement(t);n.parent=this,e.ignoreChildTypes.includes(n.type)||this.children.push(n)}},{key:"matchesSelector",value:function(e){var t,n=this.node;if("function"==typeof n.matches)return n.matches(e);var i=null===(t=n.getAttribute)||void 0===t?void 0:t.call(n,"class");return!(!i||""===i)&&i.split(" ").some((function(t){return".".concat(t)===e}))}},{key:"addStylesFromStyleDefinition",value:function(){var e,t=this.document,n=t.styles,i=t.stylesSpecificity;for(var r in n)if(!r.startsWith("@")&&this.matchesSelector(r)){var a=n[r],s=i[r];if(a)for(var o in a){var l=this.stylesSpecificity[o];void 0===l&&(l="000"),s&&s>=l&&((e=a[o])&&(this.styles[o]=e),this.stylesSpecificity[o]=s)}}}},{key:"removeStyles",value:function(e,t){var n=t.reduce((function(t,n){var i=e.getStyle(n);if(!i.hasValue())return t;var r=i.getString();return i.setValue(""),[].concat(_toConsumableArray2(t),[[n,r]])}),[]);return n}},{key:"restoreStyles",value:function(e,t){t.forEach((function(t){var n=_slicedToArray(t,2),i=n[0],r=n[1];e.getStyle(i,!0).setValue(r)}))}},{key:"isFirstChild",value:function(){var e;return 0===(null===(e=this.parent)||void 0===e?void 0:e.children.indexOf(this))}}]),e}();Element$1.ignoreChildTypes=["title"];var UnknownElement=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i,r){return _classCallCheck2(this,n),t.call(this,e,i,r)}return _createClass2(n)}(Element$1);function wrapFontFamily(e){var t=e.trim();return/^('|")/.test(t)?t:'"'.concat(t,'"')}function prepareFontFamily(e){return"undefined"==typeof process?e:e.trim().split(",").map(wrapFontFamily).join(",")}function prepareFontStyle(e){if(!e)return"";var t=e.trim().toLowerCase();switch(t){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return t;default:return/^oblique\s+(-|)\d+deg$/.test(t)?t:""}}function prepareFontWeight(e){if(!e)return"";var t=e.trim().toLowerCase();switch(t){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return t;default:return/^[\d.]+$/.test(t)?t:""}}var Font=function(){function e(t,n,i,r,a,s){_classCallCheck2(this,e);var o=s?"string"==typeof s?e.parse(s):s:{};this.fontFamily=a||o.fontFamily,this.fontSize=r||o.fontSize,this.fontStyle=t||o.fontStyle,this.fontWeight=i||o.fontWeight,this.fontVariant=n||o.fontVariant}return _createClass2(e,[{key:"toString",value:function(){return[prepareFontStyle(this.fontStyle),this.fontVariant,prepareFontWeight(this.fontWeight),this.fontSize,prepareFontFamily(this.fontFamily)].join(" ").trim()}}],[{key:"parse",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,i="",r="",a="",s="",o="",l=compressSpaces(t).trim().split(" "),u={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return l.forEach((function(t){switch(!0){case!u.fontStyle&&e.styles.includes(t):"inherit"!==t&&(i=t),u.fontStyle=!0;break;case!u.fontVariant&&e.variants.includes(t):"inherit"!==t&&(r=t),u.fontStyle=!0,u.fontVariant=!0;break;case!u.fontWeight&&e.weights.includes(t):"inherit"!==t&&(a=t),u.fontStyle=!0,u.fontVariant=!0,u.fontWeight=!0;break;case!u.fontSize:"inherit"!==t&&(s=t.split("/")[0]||""),u.fontStyle=!0,u.fontVariant=!0,u.fontWeight=!0,u.fontSize=!0;break;default:"inherit"!==t&&(o+=t)}})),new e(i,r,a,s,o,n)}}]),e}();Font.styles="normal|italic|oblique|inherit",Font.variants="normal|small-caps|inherit",Font.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";var BoundingBox=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.NaN,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.NaN,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.NaN,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Number.NaN;_classCallCheck2(this,e),this.x1=t,this.y1=n,this.x2=i,this.y2=r,this.addPoint(t,n),this.addPoint(i,r)}return _createClass2(e,[{key:"x",get:function(){return this.x1}},{key:"y",get:function(){return this.y1}},{key:"width",get:function(){return this.x2-this.x1}},{key:"height",get:function(){return this.y2-this.y1}},{key:"addPoint",value:function(e,t){void 0!==e&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),ethis.x2&&(this.x2=e)),void 0!==t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))}},{key:"addX",value:function(e){this.addPoint(e,0)}},{key:"addY",value:function(e){this.addPoint(0,e)}},{key:"addBoundingBox",value:function(e){if(e){var t=e.x1,n=e.y1,i=e.x2,r=e.y2;this.addPoint(t,n),this.addPoint(i,r)}}},{key:"sumCubic",value:function(e,t,n,i,r){return Math.pow(1-e,3)*t+3*Math.pow(1-e,2)*e*n+3*(1-e)*Math.pow(e,2)*i+Math.pow(e,3)*r}},{key:"bezierCurveAdd",value:function(e,t,n,i,r){var a=6*t-12*n+6*i,s=-3*t+9*n-9*i+3*r,o=3*n-3*t;if(0!==s){var l=Math.pow(a,2)-4*o*s;if(!(l<0)){var u=(-a+Math.sqrt(l))/(2*s);01&&void 0!==arguments[1]&&arguments[1];if(!t){var n=this.getStyle("fill"),i=this.getStyle("fill-opacity"),r=this.getStyle("stroke"),a=this.getStyle("stroke-opacity");if(n.isUrlDefinition()){var s=n.getFillStyleDefinition(this,i);s&&(e.fillStyle=s)}else if(n.hasValue()){"currentColor"===n.getString()&&n.setValue(this.getStyle("color").getColor());var o=n.getColor();"inherit"!==o&&(e.fillStyle="none"===o?"rgba(0,0,0,0)":o)}if(i.hasValue()){var l=new Property(this.document,"fill",e.fillStyle).addOpacity(i).getColor();e.fillStyle=l}if(r.isUrlDefinition()){var u=r.getFillStyleDefinition(this,a);u&&(e.strokeStyle=u)}else if(r.hasValue()){"currentColor"===r.getString()&&r.setValue(this.getStyle("color").getColor());var c=r.getString();"inherit"!==c&&(e.strokeStyle="none"===c?"rgba(0,0,0,0)":c)}if(a.hasValue()){var h=new Property(this.document,"stroke",e.strokeStyle).addOpacity(a).getString();e.strokeStyle=h}var f=this.getStyle("stroke-width");if(f.hasValue()){var d=f.getPixels();e.lineWidth=d||PSEUDO_ZERO}var p=this.getStyle("stroke-linecap"),m=this.getStyle("stroke-linejoin"),v=this.getStyle("stroke-miterlimit"),g=this.getStyle("stroke-dasharray"),y=this.getStyle("stroke-dashoffset");if(p.hasValue()&&(e.lineCap=p.getString()),m.hasValue()&&(e.lineJoin=m.getString()),v.hasValue()&&(e.miterLimit=v.getNumber()),g.hasValue()&&"none"!==g.getString()){var b=toNumbers(g.getString());void 0!==e.setLineDash?e.setLineDash(b):void 0!==e.webkitLineDash?e.webkitLineDash=b:void 0===e.mozDash||1===b.length&&0===b[0]||(e.mozDash=b);var _=y.getPixels();void 0!==e.lineDashOffset?e.lineDashOffset=_:void 0!==e.webkitLineDashOffset?e.webkitLineDashOffset=_:void 0!==e.mozDashOffset&&(e.mozDashOffset=_)}}if(this.modifiedEmSizeStack=!1,void 0!==e.font){var S=this.getStyle("font"),x=this.getStyle("font-style"),w=this.getStyle("font-variant"),k=this.getStyle("font-weight"),E=this.getStyle("font-size"),T=this.getStyle("font-family"),P=new Font(x.getString(),w.getString(),k.getString(),E.hasValue()?"".concat(E.getPixels(!0),"px"):"",T.getString(),Font.parse(S.getString(),e.font));x.setValue(P.fontStyle),w.setValue(P.fontVariant),k.setValue(P.fontWeight),E.setValue(P.fontSize),T.setValue(P.fontFamily),e.font=P.toString(),E.isPixels()&&(this.document.emSize=E.getPixels(),this.modifiedEmSizeStack=!0)}t||(this.applyEffects(e),e.globalAlpha=this.calculateOpacity())}},{key:"clearContext",value:function(e){_get(_getPrototypeOf2(n.prototype),"clearContext",this).call(this,e),this.modifiedEmSizeStack&&this.document.popEmSize()}}]),n}(Element$1),TextElement=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i,r){var a;return _classCallCheck2(this,n),(a=t.call(this,e,i,(this instanceof n?this.constructor:void 0)===n||r)).type="text",a.x=0,a.y=0,a.leafTexts=[],a.textChunkStart=0,a.minX=Number.POSITIVE_INFINITY,a.maxX=Number.NEGATIVE_INFINITY,a.measureCache=-1,a}return _createClass2(n,[{key:"setContext",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];_get(_getPrototypeOf2(n.prototype),"setContext",this).call(this,e,t);var i=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();i&&(e.textBaseline=i)}},{key:"initializeCoordinates",value:function(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}},{key:"getBoundingBox",value:function(e){var t=this;if("text"!==this.type)return this.getTElementBoundingBox(e);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e);var n=null;return this.children.forEach((function(i,r){var a=t.getChildBoundingBox(e,t,t,r);n?n.addBoundingBox(a):n=a})),n}},{key:"getFontSize",value:function(){var e=this.document,t=this.parent,n=Font.parse(e.ctx.font).fontSize;return t.getStyle("font-size").getNumber(n)}},{key:"getTElementBoundingBox",value:function(e){var t=this.getFontSize();return new BoundingBox(this.x,this.y-t,this.x+this.measureText(e),this.y)}},{key:"getGlyph",value:function(e,t,n){var i,r=t[n];if(e.isArabic){var a,s=t.length,o=t[n-1],l=t[n+1],u="isolated";(0===n||" "===o)&&n0&&" "!==o&&n0&&" "!==o&&(n===s-1||" "===l)&&(u="initial"),i=(null===(a=e.arabicGlyphs[r])||void 0===a?void 0:a[u])||e.glyphs[r]}else i=e.glyphs[r];return i||(i=e.missingGlyph),i}},{key:"getText",value:function(){return""}},{key:"getTextFromNode",value:function(e){var t=e||this.node,n=Array.from(t.parentNode.childNodes),i=n.indexOf(t),r=n.length-1,a=compressSpaces(t.textContent||"");return 0===i&&(a=trimLeft(a)),i===r&&(a=trimRight(a)),a}},{key:"renderChildren",value:function(e){var t=this;if("text"===this.type){this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e),this.children.forEach((function(n,i){t.renderChild(e,t,t,i)}));var n=this.document.screen.mouse;n.isWorking()&&n.checkBoundingBox(this,this.getBoundingBox(e))}else this.renderTElementChildren(e)}},{key:"renderTElementChildren",value:function(e){var t=this.document,n=this.parent,i=this.getText(),r=n.getStyle("font-family").getDefinition();if(r)for(var a=r.fontFace.unitsPerEm,s=Font.parse(t.ctx.font),o=n.getStyle("font-size").getNumber(s.fontSize),l=n.getStyle("font-style").getString(s.fontStyle),u=o/a,c=r.isRTL?i.split("").reverse().join(""):i,h=toNumbers(n.getAttribute("dx").getString()),f=c.length,d=0;d=this.leafTexts.length)){var e=this.leafTexts[this.textChunkStart],t=e.getStyle("text-anchor").getString("start"),n=0;n="start"===t?e.x-this.minX:"end"===t?e.x-this.maxX:e.x-(this.minX+this.maxX)/2;for(var i=this.textChunkStart;i0?r.children.forEach((function(n,i){t.adjustChildCoordinatesRecursiveCore(e,t,r,i)})):this.adjustChildCoordinates(e,t,n,i)}},{key:"adjustChildCoordinates",value:function(e,t,n,i){var r=n.children[i];if("function"!=typeof r.measureText)return r;e.save(),r.setContext(e,!0);var a=r.getAttribute("x"),s=r.getAttribute("y"),o=r.getAttribute("dx"),l=r.getAttribute("dy"),u=r.getStyle("font-family").getDefinition(),c=Boolean(null==u?void 0:u.isRTL);0===i&&(a.hasValue()||a.setValue(r.getInheritedAttribute("x")),s.hasValue()||s.setValue(r.getInheritedAttribute("y")),o.hasValue()||o.setValue(r.getInheritedAttribute("dx")),l.hasValue()||l.setValue(r.getInheritedAttribute("dy")));var h=r.measureText(e);return c&&(t.x-=h),a.hasValue()?(t.applyAnchoring(),r.x=a.getPixels("x"),o.hasValue()&&(r.x+=o.getPixels("x"))):(o.hasValue()&&(t.x+=o.getPixels("x")),r.x=t.x),t.x=r.x,c||(t.x+=h),s.hasValue()?(r.y=s.getPixels("y"),l.hasValue()&&(r.y+=l.getPixels("y"))):(l.hasValue()&&(t.y+=l.getPixels("y")),r.y=t.y),t.y=r.y,t.leafTexts.push(r),t.minX=Math.min(t.minX,r.x,r.x+h),t.maxX=Math.max(t.maxX,r.x,r.x+h),r.clearContext(e),e.restore(),r}},{key:"getChildBoundingBox",value:function(e,t,n,i){var r=n.children[i];if("function"!=typeof r.getBoundingBox)return null;var a=r.getBoundingBox(e);return a&&r.children.forEach((function(n,i){var s=t.getChildBoundingBox(e,t,r,i);a.addBoundingBox(s)})),a}},{key:"renderChild",value:function(e,t,n,i){var r=n.children[i];r.render(e),r.children.forEach((function(n,i){t.renderChild(e,t,r,i)}))}},{key:"measureText",value:function(e){var t=this.measureCache;if(~t)return t;var n=this.getText(),i=this.measureTargetText(e,n);return this.measureCache=i,i}},{key:"measureTargetText",value:function(e,t){if(!t.length)return 0;var n=this.parent,i=n.getStyle("font-family").getDefinition();if(i){for(var r=this.getFontSize(),a=i.isRTL?t.split("").reverse().join(""):t,s=toNumbers(n.getAttribute("dx").getString()),o=a.length,l=0,u=0;u0?"":a.getTextFromNode(),a}return _createClass2(n,[{key:"getText",value:function(){return this.text}}]),n}(TextElement),TextNode=function(e){_inherits2(n,e);var t=_createSuper(n);function n(){var e;_classCallCheck2(this,n);for(var i=arguments.length,r=new Array(i),a=0;a=this.commands.length-1}},{key:"next",value:function(){var e=this.commands[++this.i];return this.previousCommand=this.command,this.command=e,e}},{key:"getPoint",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"x",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"y",n=new Point(this.command[e],this.command[t]);return this.makeAbsolute(n)}},{key:"getAsControlPoint",value:function(e,t){var n=this.getPoint(e,t);return this.control=n,n}},{key:"getAsCurrentPoint",value:function(e,t){var n=this.getPoint(e,t);return this.current=n,n}},{key:"getReflectedControlPoint",value:function(){var e=this.previousCommand.type;if(e!==_.CURVE_TO&&e!==_.SMOOTH_CURVE_TO&&e!==_.QUAD_TO&&e!==_.SMOOTH_QUAD_TO)return this.current;var t=this.current,n=t.x,i=t.y,r=this.control,a=r.x,s=r.y;return new Point(2*n-a,2*i-s)}},{key:"makeAbsolute",value:function(e){if(this.command.relative){var t=this.current,n=t.x,i=t.y;e.x+=n,e.y+=i}return e}},{key:"addMarker",value:function(e,t,n){var i=this.points,r=this.angles;n&&r.length>0&&!r[r.length-1]&&(r[r.length-1]=i[i.length-1].angleTo(n)),this.addMarkerAngle(e,t?t.angleTo(e):null)}},{key:"addMarkerAngle",value:function(e,t){this.points.push(e),this.angles.push(t)}},{key:"getMarkerPoints",value:function(){return this.points}},{key:"getMarkerAngles",value:function(){for(var e=this.angles,t=e.length,n=0;no?s:o,g=s>o?1:s/o,y=s>o?o/s:1;e.translate(c.x,c.y),e.rotate(u),e.scale(g,y),e.arc(0,0,v,h,h+f,Boolean(1-l)),e.scale(1/g,1/y),e.rotate(-u),e.translate(-c.x,-c.y)}}},{key:"pathZ",value:function(e,t){n.pathZ(this.pathParser),e&&t.x1!==t.x2&&t.y1!==t.y2&&e.closePath()}}],[{key:"pathM",value:function(e){var t=e.getAsCurrentPoint();return e.start=e.current,{point:t}}},{key:"pathL",value:function(e){return{current:e.current,point:e.getAsCurrentPoint()}}},{key:"pathH",value:function(e){var t=e.current,n=e.command,i=new Point((n.relative?t.x:0)+n.x,t.y);return e.current=i,{current:t,point:i}}},{key:"pathV",value:function(e){var t=e.current,n=e.command,i=new Point(t.x,(n.relative?t.y:0)+n.y);return e.current=i,{current:t,point:i}}},{key:"pathC",value:function(e){return{current:e.current,point:e.getPoint("x1","y1"),controlPoint:e.getAsControlPoint("x2","y2"),currentPoint:e.getAsCurrentPoint()}}},{key:"pathS",value:function(e){return{current:e.current,point:e.getReflectedControlPoint(),controlPoint:e.getAsControlPoint("x2","y2"),currentPoint:e.getAsCurrentPoint()}}},{key:"pathQ",value:function(e){return{current:e.current,controlPoint:e.getAsControlPoint("x1","y1"),currentPoint:e.getAsCurrentPoint()}}},{key:"pathT",value:function(e){var t=e.current,n=e.getReflectedControlPoint();return e.control=n,{current:t,controlPoint:n,currentPoint:e.getAsCurrentPoint()}}},{key:"pathA",value:function(e){var t=e.current,n=e.command,i=n.rX,r=n.rY,a=n.xRot,s=n.lArcFlag,o=n.sweepFlag,l=a*(Math.PI/180),u=e.getAsCurrentPoint(),c=new Point(Math.cos(l)*(t.x-u.x)/2+Math.sin(l)*(t.y-u.y)/2,-Math.sin(l)*(t.x-u.x)/2+Math.cos(l)*(t.y-u.y)/2),h=Math.pow(c.x,2)/Math.pow(i,2)+Math.pow(c.y,2)/Math.pow(r,2);h>1&&(i*=Math.sqrt(h),r*=Math.sqrt(h));var f=(s===o?-1:1)*Math.sqrt((Math.pow(i,2)*Math.pow(r,2)-Math.pow(i,2)*Math.pow(c.y,2)-Math.pow(r,2)*Math.pow(c.x,2))/(Math.pow(i,2)*Math.pow(c.y,2)+Math.pow(r,2)*Math.pow(c.x,2)));isNaN(f)&&(f=0);var d=new Point(f*i*c.y/r,f*-r*c.x/i),p=new Point((t.x+u.x)/2+Math.cos(l)*d.x-Math.sin(l)*d.y,(t.y+u.y)/2+Math.sin(l)*d.x+Math.cos(l)*d.y),m=vectorsAngle([1,0],[(c.x-d.x)/i,(c.y-d.y)/r]),v=[(c.x-d.x)/i,(c.y-d.y)/r],g=[(-c.x-d.x)/i,(-c.y-d.y)/r],y=vectorsAngle(v,g);return vectorsRatio(v,g)<=-1&&(y=Math.PI),vectorsRatio(v,g)>=1&&(y=0),{currentPoint:u,rX:i,rY:r,sweepFlag:o,xAxisRotation:l,centp:p,a1:m,ad:y}}},{key:"pathZ",value:function(e){e.current=e.start}}]),n}(RenderedElement),SVGElement=function(e){_inherits2(n,e);var t=_createSuper(n);function n(){var e;_classCallCheck2(this,n);for(var i=arguments.length,r=new Array(i),a=0;a1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.getAttribute("width",!0),r=this.getAttribute("height",!0),a=this.getAttribute("viewBox"),s=this.getAttribute("style"),o=i.getNumber(0),l=r.getNumber(0);if(n)if("string"==typeof n)this.getAttribute("preserveAspectRatio",!0).setValue(n);else{var u=this.getAttribute("preserveAspectRatio");u.hasValue()&&u.setValue(u.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(i.setValue(e),r.setValue(t),a.hasValue()||a.setValue("0 0 ".concat(o||e," ").concat(l||t)),s.hasValue()){var c=this.getStyle("width"),h=this.getStyle("height");c.hasValue()&&c.setValue("".concat(e,"px")),h.hasValue()&&h.setValue("".concat(t,"px"))}}}]),n}(RenderedElement),RectElement=function(e){_inherits2(n,e);var t=_createSuper(n);function n(){var e;_classCallCheck2(this,n);for(var i=arguments.length,r=new Array(i),a=0;a0&&i>0&&(e.moveTo(t+o,n),e.lineTo(t+i-o,n),e.bezierCurveTo(t+i-o+u*o,n,t+i,n+l-u*l,t+i,n+l),e.lineTo(t+i,n+r-l),e.bezierCurveTo(t+i,n+r-l+u*l,t+i-o+u*o,n+r,t+i-o,n+r),e.lineTo(t+o,n+r),e.bezierCurveTo(t+o-u*o,n+r,t,n+r-l+u*l,t,n+r-l),e.lineTo(t,n+l),e.bezierCurveTo(t,n+l-u*l,t+o-u*o,n,t+o,n),e.closePath())}return new BoundingBox(t,n,t+i,n+r)}},{key:"getMarkers",value:function(){return null}}]),n}(PathElement),CircleElement=function(e){_inherits2(n,e);var t=_createSuper(n);function n(){var e;_classCallCheck2(this,n);for(var i=arguments.length,r=new Array(i),a=0;a0&&(e.beginPath(),e.arc(t,n,i,0,2*Math.PI,!1),e.closePath()),new BoundingBox(t-i,n-i,t+i,n+i)}},{key:"getMarkers",value:function(){return null}}]),n}(PathElement),EllipseElement=function(e){_inherits2(n,e);var t=_createSuper(n);function n(){var e;_classCallCheck2(this,n);for(var i=arguments.length,r=new Array(i),a=0;a0&&i>0&&(e.beginPath(),e.moveTo(r+n,a),e.bezierCurveTo(r+n,a+t*i,r+t*n,a+i,r,a+i),e.bezierCurveTo(r-t*n,a+i,r-n,a+t*i,r-n,a),e.bezierCurveTo(r-n,a-t*i,r-t*n,a-i,r,a-i),e.bezierCurveTo(r+t*n,a-i,r+n,a-t*i,r+n,a),e.closePath()),new BoundingBox(r-n,a-i,r+n,a+i)}},{key:"getMarkers",value:function(){return null}}]),n}(PathElement),LineElement=function(e){_inherits2(n,e);var t=_createSuper(n);function n(){var e;_classCallCheck2(this,n);for(var i=arguments.length,r=new Array(i),a=0;a0&&n.push([e[e.length-1],n[n.length-1][1]]),n}}]),n}(PathElement),PolygonElement=function(e){_inherits2(n,e);var t=_createSuper(n);function n(){var e;_classCallCheck2(this,n);for(var i=arguments.length,r=new Array(i),a=0;athis.maxDuration){var i=this.getAttribute("fill").getString("remove");if("indefinite"===this.getAttribute("repeatCount").getString()||"indefinite"===this.getAttribute("repeatDur").getString())this.duration=0;else if("freeze"!==i||this.frozen){if("remove"===i&&!this.removed)return this.removed=!0,t&&n&&n.setValue(t.animationFrozen?t.animationFrozenValue:this.initialValue),!0}else this.frozen=!0,t&&n&&(t.animationFrozen=!0,t.animationFrozenValue=n.getString());return!1}this.duration+=e;var r=!1;if(this.begin0&&Array.from(s).every((function(e){return 3===e.nodeType}));return a.hasText=l,a.text=l?a.getTextFromNode(o):"",a}return _createClass2(n,[{key:"getText",value:function(){return this.text}},{key:"renderChildren",value:function(e){if(this.hasText){_get(_getPrototypeOf2(n.prototype),"renderChildren",this).call(this,e);var t=this.document,i=this.x,r=this.y,a=t.screen.mouse,s=new Property(t,"fontSize",Font.parse(t.ctx.font).fontSize);a.isWorking()&&a.checkBoundingBox(this,new BoundingBox(i,r-s.getPixels("y"),i+this.measureText(e),r))}else if(this.children.length>0){var o=new GElement(this.document);o.children=this.children,o.parent=this,o.render(e)}}},{key:"onClick",value:function(){var e=this.document.window;e&&e.open(this.getHrefAttribute().getString())}},{key:"onMouseMove",value:function(){this.document.ctx.canvas.style.cursor="pointer"}}]),n}(TextElement),TextPathElement=function(e){_inherits2(n,e);var t=_createSuper(n);function n(e,i,r){var a;_classCallCheck2(this,n),(a=t.call(this,e,i,r)).type="textPath",a.textWidth=0,a.textHeight=0,a.pathLength=-1,a.glyphInfo=null,a.letterSpacingCache=[],a.measuresCache=new Map([["",0]]);var s=a.getHrefAttribute().getDefinition();return a.text=a.getTextFromNode(),a.dataArray=a.parsePathData(s),a}return _createClass2(n,[{key:"getText",value:function(){return this.text}},{key:"path",value:function(e){var t=this.dataArray;e&&e.beginPath(),t.forEach((function(t){var n=t.type,i=t.points;switch(n){case PathParser.LINE_TO:e&&e.lineTo(i[0],i[1]);break;case PathParser.MOVE_TO:e&&e.moveTo(i[0],i[1]);break;case PathParser.CURVE_TO:e&&e.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5]);break;case PathParser.QUAD_TO:e&&e.quadraticCurveTo(i[0],i[1],i[2],i[3]);break;case PathParser.ARC:var r=_slicedToArray(i,8),a=r[0],s=r[1],o=r[2],l=r[3],u=r[4],c=r[5],h=r[6],f=r[7],d=o>l?o:l,p=o>l?1:o/l,m=o>l?l/o:1;e&&(e.translate(a,s),e.rotate(h),e.scale(p,m),e.arc(0,0,d,u,u+c,Boolean(1-f)),e.scale(1/p,1/m),e.rotate(-h),e.translate(-a,-s));break;case PathParser.CLOSE_PATH:e&&e.closePath()}}))}},{key:"renderChildren",value:function(e){this.setTextData(e),e.save();var t=this.parent.getStyle("text-decoration").getString(),n=this.getFontSize(),i=this.glyphInfo,r=e.fillStyle;"underline"===t&&e.beginPath(),i.forEach((function(i,r){var a=i.p0,s=i.p1,o=i.rotation,l=i.text;e.save(),e.translate(a.x,a.y),e.rotate(o),e.fillStyle&&e.fillText(l,0,0),e.strokeStyle&&e.strokeText(l,0,0),e.restore(),"underline"===t&&(0===r&&e.moveTo(a.x,a.y+n/8),e.lineTo(s.x,s.y+n/5))})),"underline"===t&&(e.lineWidth=n/20,e.strokeStyle=r,e.stroke(),e.closePath()),e.restore()}},{key:"getLetterSpacingAt",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.letterSpacingCache[e]||0}},{key:"findSegmentToFitChar",value:function(e,t,n,i,r,a,s,o,l){var u=a,c=this.measureText(e,o);" "===o&&"justify"===t&&n-1&&(u+=this.getLetterSpacingAt(l));var h=this.textHeight/20,f=this.getEquidistantPointOnPath(u,h,0),d=this.getEquidistantPointOnPath(u+c,h,0),p={p0:f,p1:d},m=f&&d?Math.atan2(d.y-f.y,d.x-f.x):0;if(s){var v=Math.cos(Math.PI/2+m)*s,g=Math.cos(-m)*s;p.p0=_objectSpread2(_objectSpread2({},f),{},{x:f.x+v,y:f.y+g}),p.p1=_objectSpread2(_objectSpread2({},d),{},{x:d.x+v,y:d.y+g})}return{offset:u+=c,segment:p,rotation:m}}},{key:"measureText",value:function(e,t){var n=this.measuresCache,i=t||this.getText();if(n.has(i))return n.get(i);var r=this.measureTargetText(e,i);return n.set(i,r),r}},{key:"setTextData",value:function(e){var t=this;if(!this.glyphInfo){var n=this.getText(),i=n.split(""),r=n.split(" ").length-1,a=this.parent.getAttribute("dx").split().map((function(e){return e.getPixels("x")})),s=this.parent.getAttribute("dy").getPixels("y"),o=this.parent.getStyle("text-anchor").getString("start"),l=this.getStyle("letter-spacing"),u=this.parent.getStyle("letter-spacing"),c=0;l.hasValue()&&"inherit"!==l.getValue()?l.hasValue()&&"initial"!==l.getValue()&&"unset"!==l.getValue()&&(c=l.getPixels()):c=u.getPixels();var h=[],f=n.length;this.letterSpacingCache=h;for(var d=0;d0&&(l-=2*Math.PI),1===r&&l<0&&(l+=2*Math.PI),[s.x,s.y,n,i,o,l,a,r]}},{key:"calcLength",value:function(e,t,n,i){var r=0,a=null,s=null,o=0;switch(n){case PathParser.LINE_TO:return this.getLineLength(e,t,i[0],i[1]);case PathParser.CURVE_TO:for(r=0,a=this.getPointOnCubicBezier(0,e,t,i[0],i[1],i[2],i[3],i[4],i[5]),o=.01;o<=1;o+=.01)s=this.getPointOnCubicBezier(o,e,t,i[0],i[1],i[2],i[3],i[4],i[5]),r+=this.getLineLength(a.x,a.y,s.x,s.y),a=s;return r;case PathParser.QUAD_TO:for(r=0,a=this.getPointOnQuadraticBezier(0,e,t,i[0],i[1],i[2],i[3]),o=.01;o<=1;o+=.01)s=this.getPointOnQuadraticBezier(o,e,t,i[0],i[1],i[2],i[3]),r+=this.getLineLength(a.x,a.y,s.x,s.y),a=s;return r;case PathParser.ARC:r=0;var l=i[4],u=i[5],c=i[4]+u,h=Math.PI/180;if(Math.abs(l-c)c;o-=h)s=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],o,0),r+=this.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(o=l+h;o5&&void 0!==arguments[5]?arguments[5]:t,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:n,o=(r-n)/(i-t+PSEUDO_ZERO),l=Math.sqrt(e*e/(1+o*o));it)return null;var r,a=_createForOfIteratorHelper(this.dataArray);try{for(a.s();!(r=a.n()).done;){var s=r.value;if(!s||!(s.pathLength<5e-5||n+s.pathLength+5e-5=0&&l>h)break;i=this.getPointOnEllipticalArc(s.points[0],s.points[1],s.points[2],s.points[3],l,s.points[6]);break;case PathParser.CURVE_TO:(l=o/s.pathLength)>1&&(l=1),i=this.getPointOnCubicBezier(l,s.start.x,s.start.y,s.points[0],s.points[1],s.points[2],s.points[3],s.points[4],s.points[5]);break;case PathParser.QUAD_TO:(l=o/s.pathLength)>1&&(l=1),i=this.getPointOnQuadraticBezier(l,s.start.x,s.start.y,s.points[0],s.points[1],s.points[2],s.points[3])}if(i)return i;break}n+=s.pathLength}}catch(err){a.e(err)}finally{a.f()}return null}},{key:"getLineLength",value:function(e,t,n,i){return Math.sqrt((n-e)*(n-e)+(i-t)*(i-t))}},{key:"getPathLength",value:function(){return-1===this.pathLength&&(this.pathLength=this.dataArray.reduce((function(e,t){return t.pathLength>0?e+t.pathLength:e}),0)),this.pathLength}},{key:"getPointOnCubicBezier",value:function(e,t,n,i,r,a,s,o,l){return{x:o*CB1(e)+a*CB2(e)+i*CB3(e)+t*CB4(e),y:l*CB1(e)+s*CB2(e)+r*CB3(e)+n*CB4(e)}}},{key:"getPointOnQuadraticBezier",value:function(e,t,n,i,r,a,s){return{x:a*QB1(e)+i*QB2(e)+t*QB3(e),y:s*QB1(e)+r*QB2(e)+n*QB3(e)}}},{key:"getPointOnEllipticalArc",value:function(e,t,n,i,r,a){var s=Math.cos(a),o=Math.sin(a),l=n*Math.cos(r),u=i*Math.sin(r);return{x:e+(l*s-u*o),y:t+(l*o+u*s)}}},{key:"buildEquidistantCache",value:function(e,t){var n=this.getPathLength(),i=t||.25,r=e||n/100;if(!this.equidistantCache||this.equidistantCache.step!==r||this.equidistantCache.precision!==i){this.equidistantCache={step:r,precision:i,points:[]};for(var a=0,s=0;s<=n;s+=i){var o=this.getPointOnPath(s),l=this.getPointOnPath(s+i);o&&l&&((a+=this.getLineLength(o.x,o.y,l.x,l.y))>=r&&(this.equidistantCache.points.push({x:o.x,y:o.y,distance:s}),a-=r))}}}},{key:"getEquidistantPointOnPath",value:function(e,t,n){if(this.buildEquidistantCache(t,n),e<0||e-this.getPathLength()>5e-5)return null;var i=Math.round(e/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[i]||null}}]),n}(TextElement),dataUriRegex=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i,ImageElement=function(e){_inherits2(r,e);var t,n,i=_createSuper(r);function r(e,t,n){var a;_classCallCheck2(this,r),(a=i.call(this,e,t,n)).type="image",a.loaded=!1;var s=a.getHrefAttribute().getString();if(!s)return _possibleConstructorReturn2(a);var o=s.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(s);return e.images.push(_assertThisInitialized2(a)),o?a.loadSvg(s):a.loadImage(s),a}return _createClass2(r,[{key:"loadImage",value:(n=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.document.createImage(t);case 3:n=e.sent,this.image=n,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.error('Error while loading image "'.concat(t,'":'),e.t0);case 10:this.loaded=!0;case 11:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e){return n.apply(this,arguments)})},{key:"loadSvg",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var n,i,r,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=dataUriRegex.exec(t))){e.next=6;break}(i=n[5])&&("base64"===n[4]?this.image=atob(i):this.image=decodeURIComponent(i)),e.next=19;break;case 6:return e.prev=6,e.next=9,this.document.fetch(t);case 9:return r=e.sent,e.next=12,r.text();case 12:a=e.sent,this.image=a,e.next=19;break;case 16:e.prev=16,e.t0=e.catch(6),console.error('Error while loading image "'.concat(t,'":'),e.t0);case 19:this.loaded=!0;case 20:case"end":return e.stop()}}),e,this,[[6,16]])}))),function(e){return t.apply(this,arguments)})},{key:"renderChildren",value:function(e){var t=this.document,n=this.image,i=this.loaded,r=this.getAttribute("x").getPixels("x"),a=this.getAttribute("y").getPixels("y"),s=this.getStyle("width").getPixels("x"),o=this.getStyle("height").getPixels("y");if(i&&n&&s&&o){if(e.save(),e.translate(r,a),"string"==typeof n){var l=t.canvg.forkString(e,n,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:s,scaleHeight:o}),u=l.document.documentElement;u&&(u.parent=this),l.render()}else t.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:s,desiredWidth:n.width,height:o,desiredHeight:n.height}),this.loaded&&("complete"in n&&!n.complete||e.drawImage(n,0,0));e.restore()}}},{key:"getBoundingBox",value:function(){var e=this.getAttribute("x").getPixels("x"),t=this.getAttribute("y").getPixels("y"),n=this.getStyle("width").getPixels("x"),i=this.getStyle("height").getPixels("y");return new BoundingBox(e,t,e+n,t+i)}}]),r}(RenderedElement),SymbolElement=function(e){_inherits2(n,e);var t=_createSuper(n);function n(){var e;_classCallCheck2(this,n);for(var i=arguments.length,r=new Array(i),a=0;a0){var n=parseExternalUrl(t);n&&new SVGFontLoader(e).load(r,n)}}))}}}))}})),a}return _createClass2(n)}(Element$1);StyleElement.parseExternalUrl=parseExternalUrl;var UseElement=function(e){_inherits2(n,e);var t=_createSuper(n);function n(){var e;_classCallCheck2(this,n);for(var i=arguments.length,r=new Array(i),a=0;a1&&void 0!==r[1]&&r[1],i=document.createElement("img"),n&&(i.crossOrigin="Anonymous"),e.abrupt("return",new Promise((function(e,n){i.onload=function(){e(i)},i.onerror=function(e,t,i,r,a){n(a)},i.src=t})));case 4:case"end":return e.stop()}}),e)}))),_createImage.apply(this,arguments)}var DEFAULT_EM_SIZE=12,Document$1=function(){function e(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=i.rootEmSize,a=void 0===r?DEFAULT_EM_SIZE:r,s=i.emSize,o=void 0===s?DEFAULT_EM_SIZE:s,l=i.createCanvas,u=void 0===l?e.createCanvas:l,c=i.createImage,h=void 0===c?e.createImage:c,f=i.anonymousCrossOrigin;_classCallCheck2(this,e),this.canvg=t,this.definitions={},this.styles={},this.stylesSpecificity={},this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=t.screen,this.rootEmSize=a,this.emSize=o,this.createCanvas=u,this.createImage=this.bindCreateImage(h,f),this.screen.wait((function(){return n.isImagesLoaded()})),this.screen.wait((function(){return n.isFontsLoaded()}))}return _createClass2(e,[{key:"bindCreateImage",value:function(e,t){return"boolean"==typeof t?function(n,i){return e(n,"boolean"==typeof i?i:t)}:e}},{key:"window",get:function(){return this.screen.window}},{key:"fetch",get:function(){return this.screen.fetch}},{key:"ctx",get:function(){return this.screen.ctx}},{key:"emSize",get:function(){var e=this.emSizeStack;return e[e.length-1]||DEFAULT_EM_SIZE},set:function(e){this.emSizeStack.push(e)}},{key:"popEmSize",value:function(){this.emSizeStack.pop()}},{key:"getUniqueId",value:function(){return"canvg".concat(++this.uniqueId)}},{key:"isImagesLoaded",value:function(){return this.images.every((function(e){return e.loaded}))}},{key:"isFontsLoaded",value:function(){return this.fonts.every((function(e){return e.loaded}))}},{key:"createDocumentElement",value:function(e){var t=this.createElement(e.documentElement);return t.root=!0,t.addStylesFromStyleDefinition(),this.documentElement=t,t}},{key:"createElement",value:function(t){var n=t.nodeName.replace(/^[^:]+:/,""),i=e.elementTypes[n];return i?new i(this,t):new UnknownElement(this,t)}},{key:"createTextNode",value:function(e){return new TextNode(this,e)}},{key:"setViewBox",value:function(e){this.screen.setViewBox(_objectSpread2({document:this},e))}}]),e}();Document$1.createCanvas=createCanvas,Document$1.createImage=createImage,Document$1.elementTypes=elements;var Canvg=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};_classCallCheck2(this,e),this.parser=new Parser(i),this.screen=new Screen(t,i),this.options=i;var r=new Document$1(this,i),a=r.createDocumentElement(n);this.document=r,this.documentElement=a}var t,n;return _createClass2(e,[{key:"fork",value:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.from(t,n,_objectSpread2(_objectSpread2({},this.options),i))}},{key:"forkString",value:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.fromString(t,n,_objectSpread2(_objectSpread2({},this.options),i))}},{key:"ready",value:function(){return this.screen.ready()}},{key:"isReady",value:function(){return this.screen.isReady()}},{key:"render",value:(n=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},this.start(_objectSpread2({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},t)),e.next=4,this.ready();case 4:this.stop();case 5:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"start",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.documentElement,n=this.screen,i=this.options;n.start(t,_objectSpread2(_objectSpread2({enableRedraw:!0},i),e))}},{key:"stop",value:function(){this.screen.stop()}},{key:"resize",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.documentElement.resize(e,t,n)}}],[{key:"from",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function t(n,i){var r,a,s,o=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o.length>2&&void 0!==o[2]?o[2]:{},a=new Parser(r),t.next=4,a.parse(i);case 4:return s=t.sent,t.abrupt("return",new e(n,s,r));case 6:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})},{key:"fromString",value:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=new Parser(i),a=r.parseFromString(n);return new e(t,a,i)}}]),e}();exports("C",Canvg),globalThis&&globalThis.__awaiter,globalThis&&globalThis.__awaiter,globalThis&&globalThis.__awaiter,globalThis&&globalThis.__awaiter,globalThis&&globalThis.__awaiter,globalThis&&globalThis.__awaiter;var bg="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbwAAACNCAYAAADM4c9jAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABvKADAAQAAAABAAAAjQAAAADzprXxAABAAElEQVR4Ae2dd3Ndx3n/0UkUkiCIRoINJEWKtOXEtib515q0iTNOMsnIM7El9yLbif/IG7D1BpIZZyzZcpMcSeNYk+IUj1McyxlPEmtk/2JLIsUOkAAJgOgEQHT8Pt/l3aNT7z3nFtQ9M/eec7Y8++yzu0/bcqqr8lxra2vVo6OjLTU1Na08N6+srDTwXEeW6jzZdkrUWm1t7dLq6upSdXX1TFtb2yQVn+V5bacQwNXTUcBRwFFgK1EgVnBJ0E1PT++/d+9eD0y9YStVaCNxRSFY4Bo8duzYxEbi4cp2FHAUcBRwFIhSICLwXn311XoY9gmStviTY7nM1tXVLcDUlxCIO96KgR7VKAP1y8vLuyFHk59WvE+/8cYb1x955JFlf7h7dhRwFHAUcBTYOAoEBN7Nmzcbm5ubT8l1KZRw14lhDxE+/vDDDy9tHJqbu2QEXP2dO3cOgGW35KCwlbXX1dV1mfeFzY29w85RwFHAUWBnUMATeLLsTpw48aAVdvX19eP79u27AcNe2RmkKL2WCL66qampY0tLS62ClhN6FxwNS6etg+Ao4CjgKFAqBYzAg1FrccppgBk3Jgx6qL29fbBU4Dsxv2g5Pj5+GOu4U/VvaGiYQnG4shNp4ersKOAo4CiwmShQI2S0QIWbEXay7JywK76JUBbWWLE5gOCbEpTFxcV9CMB9xUN0OR0FHAUcBRwFykGBGlkkWo0pYJqzkxuzHIB3MgwJvY6Ojj5ouyo6sHLz8E6mh6u7o4CjgKPAZqBAjfbZ+bYeDLn5pvI0C3Rc5jckaKxujazkLE8pDoqjgKOAo4CjQFoKsI+8xiywUAatxkyb0aUrTIHJyUmPnigWHp0L53QpHAUcBRwFHAXKTYEa3G12ocqs23pQXvI+8MADC+zTm89BDexrLG9JDpqjgKOAo4CjQCEK1GjztBLBmN1+sULUKiIe+hq6YkkbOhcBwmVxFHAUcBRwFCgDBeTS1NmYVazOdBvLy0DQMAhLV/bkOYEXJo57dxRwFHAUWEcKaFuC3Yu3448LqwTdWalp6ept8q9EOQ6mo4CjgKOAo0B+Cph9ePmTuFhHAUcBRwFHAUeBrU8B487c7NX47ne/28jVxvL+FjZy7wLfWlyx1cw7VuMy1LL/NVyG2vO2gkGl8z8XCGN74b17HPM19/73v39xs9fR4eco4CjgKOAoUFkKbFqB96Mf/agV4dbNr0mCjZ8W1hhqSMjpx0HXVQg0hVUj4HRocy3vOvhaefYrja5//Md/nOeaRGhOvO9975szge5vU1Pgi1/8Yg0n1tR3d3evPfroo/rmoHUNb2q8HXJbgwIo0bUowu6c4K3RXGXDsppT/t8taNokvdFHimGdVf/nf/7nUbZKtPGLuFubmpqMoPPXPifwvKBC71iC85wocxsmOrEeTJRjxY5SZgd1W+3s7Px/HqIVfhAtn3322X3c132xDCtTV48ePToV93kkCbJf+7Vfq//d3/1dCTFzEk2YFE899dR+ziA9Du6mD2DNL+/Zs+cqDGomnNa9Owrko4D627lz53ZxfGIjCnAjTp8m+mcjeerpV7c//vGP38qX38VtLwpsGgvvhz/8Yc8///M/d8maC5NYgk4/e4WFmg1Pc0fY7SZd79/8zd90Pf/884OPPfbYdJp8Wy3NM888c4QB3bEReCPgq65evbqAwHrDr1R861vf2k37nh4cHKz/+te/XsVvgbaceOKJJ27508GQDlthJ/xpszo27uv4u4sbUZ+tVCZ0q37hhRf24NHQ+bh7oN0i+0GvxSkfaeulKYXZ2VlNJWyqi35Wox9XLfWs2b17dw31rkWw1dGvGgiXt6eeL5gYvPEWVdG3vDrQ53QYhBN4HkW2/8OGC7z//u//bhwbGzuNBhbBRS5JzvYMtEJY2ClNOCyQwffiT8dgaKLDP/Cd73znLs99222ej7rt8VV93R9hvLteeuklWZfe/CnMqYt3z+JUGlzR3ViiY4TbDfrC1UujF12ki/SP+zE7+1+uORh5MwKpGWbe/LWvfa2Ftve4Os+7Ll26dAgq3SiGUhKgKE9nGSMRRbQYeOXOA14GpO4SaLpL4bLh+cojXSNTJ3WlKAP54Lu4zUeBDWUiP/jBD9qGh4d748hihV0hgeYXYmE44bg4WHT6PaQ7++1vf/vKhz70odkwDPdePAWGhoYCTBJa741jRMzFBlybMG747Fogb/FYZM/51a9+tZ4+sRc8PMGRHUp5cyDvq2XF6Ec/ruO+C1o2YL0Yy0t0hWaamogruB3BOFSMUvfkk09W9/T0xAKNK2irhV24cEGK4cRWw9vhWxwFNkzg/cd//EcX/nTzlYY41OXClMDST4LKXnFCy8aF72nTwizEQM7gCrr+wQ9+cFt0fhikVq6GSbKu71pwYguE4Yo5y8UUvpbCjBi8q+MEYzhjJd5xc+/FLXaS8iNzyJUoLwtMoaSfFWy6p7nIUw3t9X3GgTTpd1IaFATNlWyLMb+T2q3Yum6YwPuN3/iNETrbsBD/3//9372ao0G4eRN11u9uKybXZloBpjx+ISmhqcvezQt/fnhiCsSfwCU08MlPftLgZdNtxTvMcBK8NTm/IRflz2t1pS0c5SbJxXrXptkMd1yDx+gLm07YlUobFKD7S5xLBbQN8sN3VvnNoeTOHjhw4M42qJKrQkoKbKpVmt/73ve66ISJ346LE3oSYhJcrDA1P6XxL3CxdFA6CVEEq/ndvn07IgCtQGSF6JVPf/rT92e6LYAi7xu1SlPo4qZtxloy5jECx7ilRB/7TJI9CKb2cNVYWDLGAgAJTC0yiVjh5NG856jyYQ0F3F2spqxCaKzSHtNYbp6JiSLRS/I25fFfwJmhjHt4Dw0c3Xk/4E+jZ8pcgWmP0UZeeTaPwoCzun///nHKLHolZ84KfShc9lZ+V1vxG6c/m/bKWhfyVrO46F1Z822G9PT9ZfrIIv1jYdeuXfPUZZ73uY985CMLCLx05vFmqIjDoWwU2FQCT7VipeaJubk5s4dOAshvqSleDNteEmwsf686ePCgDUp9F+wbN25Uvfnmm0YQKqPCdDEwVrq6ui68973vLflA7Y0UeKYyef6ee+65A0z0Hw8nQbAMfvSjHx1iLqsJQXI2HI9ScgcGmnoRhJjmN7/5zXeQr6IeBeCvsZ3hPLj7F8CE0U98//KXv9xC/jOJCbZGxBJ0mGXcTNOfJ2knz8ouFn36wT76gVY3V+RCCEkx06rSwIVQmiI8cV5dSg7XCvlXSSeFaBVlaeXIkSMrr7zyyhJbEgJzwwHg7mVHUqCiDCgrRWGMNQg84/qywkcw9CzBZ4WdniXo9Cv2EoyTJ0+an6y9n/70p57gY6DVDgwMnELjf9NvpRRb1k7Px766ZgRJxfsaDLCaPqT+U5TAwwpoIP+WaS6Y/SJ9VVs77rW2ts7Qp2fD86HlqEzO21EWj0ccPgjUdtouIvAIm/rEJz7hXI5xRHNhRVGg4kwoLVayAjgR5e24EwM4+YWdhJR+Dz30UKzbMm1Z4XSyEP/wD/+w6rXXXjM/lQkj2Y0LVKbjQDi9e89GAYTdun38lv7juTyzYckxPbW1DVgIkWzgP0Rf2NC5RlayrtH3V3E1y2pZcafPRJrJBTgKFKRAQLgUTF3BBGxROA2zems5pq8sWXZW2L3rXe+KuDl9SUt6lCCV1fhv//ZvVbhVteG580tf+tKdz3/+8yW7NktCbItnho770dbXpRYoTkW78HDvarNyBE8E4V36wLY8oCBSWRfgKLCNKbApBB6bP7s54iz2i+BW2KkNJJAk+Cp5qTxZexJ6uDqrOX9Tm3avV7LM7Qz7G9/4hk77iNuOUPZqa87nM5/5zORnP/vZomDLwotzaWLxe5vniwK8BTNpPlMu3nVCvTmB7o2aP1wPHFjwtIg7+N56lOXK2DgKbLjA00kHCLueOBJIuNkVl5pvs89xacsZpnJ/7/d+r+pf/uVfJPTaGHTDzGO4Q6eLIDLCLrIKVGAQTqNY0UNxIHHbnSU+sOkbOIswpYtx6RV2/vz5VRYpLDPnk5SkYDjuzAaEXiQdq/oWWQgTCd+uAdCxTot34oTQetYZa1tH463L8XgTExNUd+3/6Hduoct6NvI6l7XhAg+mdyKpznaRigRdMSsxBVdbEfyCM6msuPDf/u3frvqHf/iHKo4906Drj0uzmcMYwDWsjuzGVbwHGkR8dWwpqItz4cH4O9lGsF/54+rHarj9xDeH4ySUtJ3hwx/+8JjipMxwrFWsO5NFdYmuYqzCNWCFwVdVYkGGvxBoEbFoCFveaUyQsVb0PKifnlvpmXaufvnll9Xfox1vK1XE4ZqXArEMLW+OMka+8cYbDezZMqsyw2D9QqoYYac5OAkrznOsevHFF421Fi6j0Ltw4Jw9zeWJ+W85JoBlehLcD1IPuYu1qT/wi2PwOZrIb6yzRmOXogNTilIAlt6Bp086Hc/tudOWjzYxkhxM74awu7fZLGZW5NaGrUohTF13nDvTayj34CiwzSiwoRZef3//kSR6WvelhE4xAu8nP/mJ2WBu4dutB7/+679ug1LdZWV2dHTUPsundsigzdhb4vr+97+/i68S7N0gZOUGHkfYRaxA4YPyUNQm6ArXJWLdqbxyCzztfUTg72Ne0GyWh0ajfKJmQ1eAVpiuDryjwKahwIYKPE78SJyQ9rszi6GWBFz4igvzp1G8fnKD2p+2KOQu7RPaMgKPesQycFuZSt9h5FqsohNZAqeryD3IcU7G5VlpHLLAZw4ndoUmMLwOkAVeXFo+j2QsYMVBF5ME9/F+VgK/sZlWAp8+fXrtypUrcVXY1mGsJdg6mzC3dUtUrnKZBd6rr77a9PDDD5e8gENwLl68aNxdsuL8l//dCj5/fJpnWYgSWv7LWo3+MD3z7baqn//852Yrgj/OJ+z0tfVYa8Wf3j2/RQHoVceKyVEsPTF3rXQ1jczzwGbczE+fa8DyeqsCuSfqUTaXJnWP9CHCqpkTlXt402x90edyaLcrokmEIKEAcK9Gce2iHnnTovyskXYIhSeiQEB3udwDilGumHEWEcUeFUceLYYS3QpelDuGV8Gc2OLfp8nexir7TpqFzdgvC1bOJchEgUwC75/+6Z+a6Nxnf/azny3RgWTtTL373e++K609U6kkRqM2q/ck3KxgsYLOL5hsWFb4cl1qa4H/0h6+8CVBp+PFCl3Ud5fmebbDoLDtBdOQWy0yxybmBKPR1xZi40WrQjAsPZmrG4V2Yzptpbe3d6kcx7VZ2OW8a0sC9Y2AZGl+2QQe85sRWqvAYpW6CLJlDMidrpIXoixW+IE+NFxI2C2yveda0ue3EK5rwIgIPHkIOMg91v1Nnxql/HYUkh76YnRprQ9z0hzgJ8VrECUsInB9Sd3jNqdAJoEHLdpzwqmeTmaWDP/iF79YxVqbJk7m1BTWX6oORQc0J/n7hZ3/uVS6awO59tPJetP14IMPRhiLPUszbVm4PIRzrMaZFsYmSDfM0v0B4ZF0liZL0m99lLM0dfg0GvCDYZxpuzEYR5/Cc18xf1s4jf+dviJX0aammzad+3G2z9S/bALPwtzqdxS/Rs6IPUw/iP2+Yah+42wnuVFuRTHXp+6wEngChfUwFlrkwHE/HopHSLY+/fTTt5544ok7ufz+JO55B1Agk8BDIDVr9aNfI0UrrqHz6OioVgms//mf/5nDKjPWXz7XJ2kDZVthV06a2y8oJMHUUWL2SlO+rDzSb2rGbevj7tkoICsFiyKSiQVLTuDlqIIlVo8lfIipgnbuEVr5AxgrK9D0BsrVuD+83M9yvwKzj43yo+B0lF/iJ7HgU7UIviPUo530Nz73uc+5sVzuBtnk8AJCpxCu7NuSZZc3GfFNaH7yrR/6r//6ryU6/SRuj6nf/M3fDLg+YS6ptkRIwFbiElz/HJ/ftary0gjASuC1HWHC/Kr15ey0dZMrtVA/SwsrbTr6bOyiFf83/dLC2m7ptJ8Sb0gXY6KTtiw4bmm7KcZ3P8IulbenHPSS8AK3C1/5ylc6JJTBIVEiSyjyO4N3YgzLfhD37brhWY66OhjFUyCTwFMnyieAwkKD9PV0wg42I3cg/FZ/+MMfTiMAp/hm2tTQ0JA0s1g3kr86+crzp8v67Bd2yusXcAzWNXAH9eDgpn6pmXZWfDYiPYM9tv2pd3Qyq0gE2UR+6Jlnnunu6ekpiXaywNjf9+40aAh/NPnBj33sY3dSptc33yJ9kX6grxHs2JV7EnTXrl3rxGXYBT0LCjraaJl0A/bggTS0L2eaXFuNYMFNMFZ7UGLyujkVT55WXPe3Hn/8cefmLGdjbFJYsQwvCVc6SDVWnve5nnA6v9AIx1nXJ8yolZNLtOghkan64Ugw6V3CtJyXvwwLF5xWCe/n00CTX/jCF9bYtN5M+UeIN6vBqEMizhbGFrvHEhU6lE3jpb21gq8kYZeVpuBfS1PpSxepBB7tHEsHmPe6uDMZVzVaEJW1nmnSY6Hq696ZhDa4NDBf3cX8dzvtVwMdChaFxTSCFXhbx7sVTFzhBDmLrY96jM7MzBylL+R1czJP69ycFW6TzQK+cE+OwVRfDS9mM7gFJWHDIEoc4LLq/POEpZZny/XfwwJU7zAeb86BgavkcpO8+eyzz8qd08OcoFna7IezlZ/FCGBUkSpA/7IxLTHMSAHrEJCx3Ih1JxSx8FrSWpWlVAlL+zi/UkAk5sW6XsPKHmJz+63ERL6IF154YT8rqHtZuCQXhy8m/pE0d/kW300WpZRy8HLSvEVSeDwyoVBwMm5OrPdOxvYheE5iX8y5OU8A4pchMO51G1EgsQPE1VGuPoWH3YFxafOFWWFj7+G0Enh+C0yrKct9hctW3a5fvz4RLkfasVYsEn6NAVQZrhQudB3eZVFQt8ixbqID2n1JjGYd0C9rEXgcYgVeWQvZIGCyrmnTg2xu14KrghfWjs5XLWiRA3MRAXL1U5/61KUShV0VFtkc8PolPLnP6o7A7VN4QYQLJND4ZWvDMHV6naSFFtAUii9Qmove7BTIZOEhJFbQRGskkCT0/FZYlopaYRa3OdzCEXytstSl9NpeoC8mlOvy7/UTTAbZIlZddJlerkA+ORMRhuXCZSPgoMXrUOcIYxOzyUeHrLhSxjJMLFM/y1pGXHoYXeqN3NQ51qUZB3erhmHBqI4FadLS0jI+OTmZb2+b3N3DnORzp5z9BOGm/Xaxe+7KQfOcm/M61u4ono2j9I/AObES4AjvWwjHchTnYGxSCmRiRDAvdXbDHHQEV1jgyWqywixNfZU+KY8EnoSS4nWpPD1rf105LsHWT8JbFx2+sP+mHAVvAhiy7qDvoThUYP7B42niEmUIw5XUB3PpAm4mb0KGIiJJYe7LWAjRs+UiKe8HgJ8OUkiI3R7BLBRLVUGstRXcuBI8Xf6aSyAw/obwtoyVU9D5y1iPZ51bSlufl5uTdj9k+yX95SbviQrveuDmyqg8BTIJPDr8XVAyCzgkKDS3Zq2wLKhKcFnBKKEj4RZ3hefu5NpUvnJZehLYVuDFlb9dw8bGxrpxR93XJHyV1IAfHh4uq1sHzdocSOArZtM9wgQnWNnXrXmcTYdcGRCCqa+wUno+LSjGxQhj0gg8FJYFxuhtTkkZp3+kEpppy9modLl6DKP4TTAWDiHMV7Dstsw5uRtFt+1QbiaBhytAh/56mp+18iTAdFkhZl7y/PnTKa/f0vJnUzoJQ78lKaGnsLhjwvx50zxLWKsOumB2mWiRBv5mTMPg3oWlHntot9oX7b1sC1Y2Y/3jcBID5HoTrV+nBzXR7yKu3rh8WcMopwlFIzKXRnvMMHdWtpWxfrxk7XLSyR1Zbv7wfM+aq2aP2lX2z1brC/KiD1sNAlnkJWDu8zB0S3WeZSDzOr/kvDdy5dzOuTYNBqonD33mxf3tCApkYvJ0kHscR7WqeTxRRwLJzq1ZoWep5hdqNizurnTKq19cnrDAEwyFlePyW6cw+zoGL2N7e2ixSfSBuepUnMglpgBj1OKcghfnSzbh9jqshNAtuswzAYLoy6rBRtxHZV8kAmNfYs/YvWLdbbS73FnDCaiXJZiP8R6BXp1hYLTJMHPEm8rCYKGWwQe8wuiad+aAe8D7/iR7bIrNEwieQkYHd7fSP87vRKVu87TGxmKSSeAJVZjiJG4v76BXuQRldYXdjEkCLFxdmy6fa9MKPSsQlaccl99yFDyYsehREU27HPhWEgaWx1BO4y1YDExbrj/j/kOIFUyvBPo+H1bDSZhPI26yVHmyJBLMw4cPL2B5XJViliWvS5udAvSXRpSk7Bk3Nkf9iRMnxLtGNhYNV/pGUSDzQgIE22BY4Egg2UOa01QknL9QHmvR2Xz2XihfoXgJWXsJJsI8swJg82/lO9bNAqeSpLLuiq0nruPjOUFZLIiC+RC+u1hheKJgQpdgx1IAN21gdeaOJcQOrXhmBv+2t71t8e/+7u/uMtkb2MNlhZ5WURYSSNZSC9Pcb+UJhnV3Kp3/OZyvlHdbTg5+avdcKWVuprxy5e3du/dqzqUXQA3moM+2BMKKecmtCm0pJm/WPNRjt/acVeKDqhw43II7V8dRLXHwwthGfeqIpfUae4ekQCDkx1lOrxWG6UztrARNSI91tyX3pGKZlt+9kEAjF7z5KFAUN9NS8zihJvemLL1yrHy0QlF3/6/cJPRbeXfv3q3IYoVy41xmeP1JLkCssnkYaurFDnnwWldFAqFU9vL0GSSY5Wno0Q6zPzg4OPh2Frkcy1PnikQh7LSq8DS/FoRcLQpJx7OcBFSRwvIARRm6BQ6z/NbCv6Rs4XTlfk8q1x8O3yrPAgA/UPe8ZSiQ2cJTzTTXw8dgOf95qDtcUwknzelpfky/OMEYzmPf86WVENUiEysIbZ5y3VU2wm9dteRy4Z4FDkx7GoVF82/13IdYhZe4DUELQJ5//vlrnEfYu1NWsSbRkoVaWqQRUIgk/KDPxGOPPabvQVb80mHOV65c0RmhgQvcDjFHOrGeFmfOgo58ORlrvoEFLW8P00rC7fTp07/Mfc4ngH85XthW0oTF+0C+fkrfH0z6CG05cHAwNj8FirLwVK33ve99g2xmjT25QUJJe+gk+HQPC6l8gi0NycLw0uRJSmNh6c7B2Nte4MEcF/hsy+soI68h7AaT6GLDxcxZyv1LvnbwOgzjjZjfVZt2u95h4i0w8NjVrWwnWLc+w5FvWkYcWSki4cKB5+tubca1N8KuOyzslA6BN14pYYfSsRf4Z/IJO+JusPK0ovPUcfRwYZuLAkVZeLYKfDbkPFrb22dnZxOXTWpuTz+5DvUrVthJIPmFk56LhWXxD9+xIHeEfz/HNFPPweTmh2KVG4RBtV1UFKZnoXcYo+idekN0GB59YHc+JhdOX8w7Vlw17syjCXnnWOwzw8b1hOjyBuNZWcGSGYJukVNyaKM9+oL9Rn2aRzXNWXexWxWam5tTfbkiK8VwK7fBf46jiAWsbwtHliW7YK7ZbRY23N13JgVKEnhyedHJ38DSezvzX3lhySVp5/YkqPzCyj5bIWYFW7hJlM7GCVZ4W0E4fZp3C09pX3nllR25JSENnSqRBmY0zQkX14uF/fTTTx8nb95vnhUL2+bTEVQ8my0YNszesZbXfbEIC1SG2APZhoCLrDbUZ25we05VypKy9U6669SSBMEzVwlXInTQkXWHUQBiUSJuhZXXV1AUZmITuMAdR4G8QioNNaR10rFef/HFFx9CCEUWC1gh5oelML+g8cclPfuFndLIqihV4PnxwP+/LAGeVL4L33kU0EIV+oXOW4yr/Li+sh0XUckwWdusFu3HajkTLoe4Wub4jhBetBIRhpn2HVq1Miccq3yA13BaOGnS0R7VTz311GHSRjbx2/yUuYrw7eMw7CWt2u3u7jaNiMvV3PFMrb3nPe/RtwLdmLdE2wH3kgWeaESnWUGzfJ2Va2dZveWdopFVqOWjtwSeX+hpbrDUg6StxalyYSBFu9by4b3Z4mACjdKMy4UX7V2WPlQufMoFR0yVgwiOYz1EzAcxSbZyFJz/LBcuYTgStLg274CajkILX23MaY2t10IaFQ4u9Vjrx8KI5N7ndFYp88YJ0dmDZXUzXhOFnSDSfjUI4JPwpKrGxkbvdCbbnCgGVfqJjsxR38iOhcuxFSkQGczFVkJuFAbZa21tbaMSTP4rreAL5/PD8As7hcvC8wssf9q0z/78MLFt9XHXJBrAmLQfTtpxWX649SIrdZPK3krhz7LUH+ao46giF1Zf6lNpIpnLFICrTgI31gXPnNYxMfwyFZUXjBQDhM9x+lWs4oOwGWRsGasqL6AMkZS1P0PyvEmlNGj1a95ELnLbUKDsg+KP//iP+zs7O7UKMPPxToUEXpjqWgVayiUr0V47ReDZ+rp7MgW0wRzroCchxZzm0RLi1i1YUwlY67EDACbegBUUWdhSCeRwLXZBq71xsFF0K7Jlg7EamTqJKz9tGKtfy84H05bt0q0vBSrS0NoPxIA8j9/8AoJvJmydZa2i8tufP6++dJDWevTns89W4AkGe83WfT7G4uHuxVGAT94UlzFPLmn7WCwn4pJgWazRn/V9v7JaLHFlpQnTykNwSjp0ugt33Vtn56UBmDENh2F3QKskxWDp7NmzsQI5YzEuuaNA2ShQEYFnsWOv3hyC7yJLpX8Oo7jB4JhFcCWe3JEkvMhrQQbuSs/WiEBY2hfltZ8GgnHe9X82JC0Ml257UUDuuYsXL/ZSq6BPPldNLKdB+nNmz0WFqXQDvGPHFPgeU50qUb6EHa7dpO0a2nfXX6nVoliU2s7iLkeBzBRYF991TiPWPhxvLw6a9G5cCbvw8dcjfBiXa41sbeiSIJI157/s8V+KC18SWhKIWRew+N2hDM7E00bC5bn37UsBju06yr6+WPccfXiKxRcjbKPYVASQoobwGUwQPk25bRVlXSWZQtjdAq+KHeHFftkbrLbsYNxmUthRAPbI3bupGtAhs64UWBeBF1cjtD+tivRWRn7nO995uxVoVujpLmEWFoBheLLyJBT937cLpwm/W8sQRrb0J3/yJ+Mf+MAHwkm25XvOBfbW5GWJtQTeLuaStBR+3S8U/bJZL7kzKmM3TVPHRZaxbxpXZpjQuDZHEUJt4Bk5oJv+fYhl+ZPlOkwbN2l7gnA1aDFmJ/iG3v2vKocRLdN7zsrO7C6FRifA3Qm8MrXDVgSzYQLPT6x///d/39fX1xf4ErQVemmF2M9//vOqhx56qIpT7P2gY59l3dnTQThO7DZMYcfsxUHDXcBKKZv2Xel5otgGLHMgG9g7ERaxHYfwNbwQ1yrlnitHVei/a+yD60cBOEf7BpQAPCc1TCXI9Xi5lLLYo1qDF6UHgZG4HQBazY6MjPSVUo7L6yhQSQpkcglUChEGieZNIpeEXSHrzp9JQu+1117Lu5BFglTpdOG+WpB27IfhnncWBV544YX9BSzUG5U4JaTcVKYfz1OP2NWjctPi2vQ+2py1bH28l7NUz+QTdsCcY6vEZXd4Q1bquvTrSYENF3h8deFo3AktcmUmLVbJRyBZbz/5yU+8BSnhtD/96U89gcim6QFpx+E07j09BbAqNqwPYb0EJ3tzaMN4U7WpviunL0Ek1RYBMshcVNkUIpStgPWVVG6x4Tdv3hyCJt40gR8O7aRjxzJ7dCQob926dQ5YiSs+ZdkxVi/haoxdPOPHwz07CmwkBTIPgHIi+4Mf/KCNQRo5LULzcVqEImusmEsbymXFyTrkC+3GzSmYsv7sykxcPyNoxUlLuospdkvkgSHu46SVWEFRTAVQGJqBGcmKsCi4ko422ItL9MFI5hQBlFvLL3ZfQkdHR6qOw6b5Y+AZK4SwitQ/Yi2mOPSgQQ3CoYN8sXNECIUafrEbpumvBWkVV2Y4TNZV0rFj4FXHvLUOG+gL50t6p58cpl55T+WhDWcQdjqvsmLCDhx06s0BXLPaHxnbXkl18IfDT5rB1x9knu1xY5EIF7DtKLBhAu9f//Vfm7HGItq1FXbloLQEn4ScfhJ+etfFoJllocoAv3IUs6Vg5IRErKAopiJxwk5wECQF9zUiAOpgQGXtgzD2e2nn28Axyv3uE2EcYTfAlxBSkwSGrEOMtVQ/MQ+0j8RBgzUEdNm2OuQ7doz6HmCub0juzwgioQAUESlFeYUd9RmFRje4RzWeELxSXiXsoO0xxm0pYKrihB1hy8xpp1KQSircZd4UFEga8BVF7u///u9bEXYRzV4uTFlkWebtLKKFrEEbTwdfYuBfq/QgtXjtxDtCcL6/v39dPooapi/tPBgOS3qnDwyE4+gb05z7WMyKzESXX7gM/zsCb7zc1lG+Y8dQ+lIpGMAAtdV8gmwAOvWvxziSZeenWTmfqWNqK76c5TpYG0OBdRd4fE6omxNOToarq9WVEnbFXmEhaQWchad3NMQl9vppriH1t+Bs/q12p67JpkaFK8NG/j7/4oXz588vF2CeZcGIOo9l2f8Fw9b+S0/o0Udm+G7beipDSyhgqQV0WiJJgCK4b4TTI5ym2DKQ6sxYwWBMeftmLSxgLOAKvohVVNa9fRZ+3J12jZrGcQkzhkH7GfrASMZsLvkWpsC6CTwYYA3C7gzbAXrC9LLzbGEhFU6X7z2cNywAybvY2tp6MY07J185WyWOucp5hMy6CnYsuxUY4vXwqkYJP1yNY5WkHVbA0PDwcITJFypTjBvPwmvQ6gJfgC9l4UVWt9gcQumSNo4XwrGYePq5jh27RXtwW12EPn0w9yu857PaAkXhhbmtvDaQvKN8JeLCen8Wib5Tmi/TVsB3p6/e5Tuemejhy+4etygFqjnt5N3Cnc48xDaAsmubli5aIQYTPsVJ7s0STn6BpGctUpFL0y+4/M+Ck+89HOdPz7zKLAP32kZYduPj40cpv4MBtsqh2v/P0mM97tojR7v28ivbnF0c3hJ0tOEkmr9WNcYycCk8R44c6QaXVtJpfqikCya4JkbIR0/n0NRHKPf+BG1JUIvPLFqDxykg5K0b1soCgu6OLAtokVr4FI9ZaTlRUmunp6f30YfnN4rG+p4dc/sP0M8Ce3Wz1gweAIi1eeg+wgHgY1uB/lnr6NLnp8C6CTyLhjaZDwwM9LIloNYv9BQvt6Z/o3lYiBXzTie/9Ud/9EdDG9W5N1LgWZprAQKCoSLWPJv9V/iQpiy7Tc+8LT0qdYeZVr/00kv1Q0NDERccB6mLPityFVaq/O0MNx9t09Rb9H/00UeXXD9NQ63tm2bdBZ4l5fe+972uycnJQ1h8hhFL+EmgaZWmBF/Y2lO+LAIPTfoeJ2T0/87v/E6qOQuLV7nvm0HglbtODp6jgKOAo8BWpECqFVuVqNgf/MEfaNJ7+G//9m8PsnKsk8UkBhcJNW0el+CT0NMvzeUThnJtDQF/0mlzaSjn0jgKOAo4CuwMCmyYwLPk5YOxOmj2NhbfHqy9Hs62bOJXrT1zOu9Slp+EngSgfnEX1pzcRNO7du0a+63f+q2ynRMZV5YLcxRwFHAUcBTYmhSQwNPcAsZQzK7YdawTFtldintTRT7//PN7cUe2M8+nBS61HP9Ug/Az8yItLS2rCLYlhN88wvAecdO///u/P7NZrTkfXXf8HNc6didXlKOAo4CjQIQCdSzqWGZ1WT0r3vKuLovkrGDAY489pk3LG7JxudzVQmDXS5eAvrGrF8tdnoPnKOAo4CjgKBBPgRoYsdlng1uwpCW/8eBdKMu5DV1RLJzAc93BUcBRwFFgAylQg/VhVjGy7Lf51Vdf3TRW3gbSpGxFX758WR9HtXvgCp4tWbaCHSBHAUcBRwFHgQgFdIK798UANgYX/c2sCGQXUMXJLh492V/o0dmRxlHAUcBRwFFg/SlQAyOewe1mjw/qxtKrXX80tl+J0LGOX7dqhrtYpzts6Ekg24/CrkaOAo4CjgLZKCCX5horIgeVjcUrdayGPJoNhEsdpgCCThv6j0Nbs6meVaUD4TTu3VHAUcBRwFFgfSlgGDIHwk5QrJljYlVhG18z6FlfNLZPaRJ2nK5yGGFndsxzaO9UW1ub2xu4fZrY1cRRwFFgi1LACDxZeXy/7JpdsSlXHMd+9XJ37s0MDQu9ZCGfYF60U9lwFS+gTFzPAMIldRRwFHAUcBSoEAUCh9zevHmzke+BnYJRN6g87dHjNkT4+MMPP+yW1Sc0AoKuHhfmAaL1NQCjJEjYdXV1XeZ9ISGbC3YUcBRwFHAUWEcKBASeytXWhGPHjp3gMfCVYRj3LIsvFjjdZAkGv+NPDYEe1dqsD012Q47AmWe8T7/xxhvXH3nkkbJ/x2sd+4YrylHAUcBRYFtRICLwVDsYdjXfwNrP0V49MHVj7W2rWleoMrLquAZRGDQn6i5HAUcBRwFHgU1EgViBZ/GT4GMBSwurN1t5bparUys5ic+bz+bf5nd9gHRJJ6hg7M2wMEX77GZ53vHW7zZvd1c9RwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBR4H7FCj5u3Zf/epX65ubmxsFbnZ29t6nP/3ppc1O3Oeff37v0tJSDXjOf/SjH53fTPh+97vfrT1//vzaF7/4xdWNxku4DA0N1X3+859fWE9cvvGNb+zh+4ttKpNvDg4XaqNvfetbu/lWY5fS8z3C8Y9//ON39eyujafAl7/85Za6urpV+MLcemOjfrG4uLif6y5jam6jxxTjqWFiYuKA6NDQ0DAR7tff/va3m/no9l7Ff+pTnxqmL1eUB/jLO3369J1HHnlkWWXb60tf+tIuLjMO4/C16bLc9Y3VLN8MRb407d69u/HDH/7wWL5yvv/97+/i2637oN9EPhmkj7mWdLVwzc3NnRAQHq9x21Rf+6aTSRgvvv/9718RjrpmZmZ6YaSMw7pBXodM4Ab9SagwKPVx3T3z8/N7pqammru6uoSTcKv4pfJRVOq5Grg30Ll2oQw0gk8juDTQ4ddI8zr0W6w4MrkCoEcjbdOuVz6wO84tr1JCmnoGkkkP7vdIn0ngaRCqrFKuLIO4lHK2Ut6nnnpqP+Osl49GV3/ta18b/8QnPtG3XnRSvx4bGztFP9pFP646derUZWg3vZH0u3PnDnKj4VAOB/XTQL9eWFjQx7ZN/Msvv3yH+IoKPH95fX194tsBgcdHrXchQAw+3IVrAF/eM11qk2eeeeYB+sLEJz/5yeFCmb/5zW92wIeOwg+qyDsHDxLNYq/BwUHh2cZYPohi81qSclOywIstvcRADRQ66rFiwbS2tr5mBdz4+PhpCTdgXvvsZz+77sJYzJRGrkPLrKPh6vntol67Gfi7l5eXJVTqbT3p7OYR4dNJA99JK2SkyQomg6majllN/mo6Sg0duho6VlNOHbBr9aNc8yNebV9P+bUqlDRVKl+dS5fFhXs1aXoIum4ituEfFuWv0k73iV9k/dBEL5TLitFAR3AfKRKVkrI1NjYOfOhDHxopCQiZYWqyuA9bOPTN6fUSdhpztMcJCTuVj0J057HHHqu4sJPn6O7du8YisvX23xmXdeBmgmjfzqeffrrVHw+eu+24u3LlyhHi7yf2J8o9P/HEE/3rRc+Y4osKmpycPEn9msncTB9vwMIdyFeHGzdujB06dKiTNLunp6fFg67EFSz+B/8ydIfXDyUJO+XdlAJPjJuOYRhxXAULheG+MBo7QkMCxdSRgZyoHRSCFxfPgO4Fx3oG1TKdtxpCV9Nha+yduBre677+9a9L2FSBRxwYf9gSeWeAN4PQmnn00UdTu4YlRCnjpISWLiu0gGXe7V0vGnD60YlMnP8PfDXAlohbIM89WUuiG1ZfSZqdvww9QzsxQk/Qh+N5lwA3F4L5IOmN9WbDwnfS1Nv6gPcB0mtQJV1LaJcDSZHFhlNuLQMt83j6whe+sALuEcZGe0YbqFjkMuSTkpQheSSpxhyMTcJ6j42kX45Rn0W5qm1Y3H3Pnj0LaZW8uPw2DOX2MDzEuAah7Sr94y4CcJ+NL3RHOZ2xCnOhtP54CSz1P3+Y/1njzl7gtYe09jXu3pYv/sknn7xBprcAxkHYZGHUXwLuFGjV0yadGAINjJnr/GItWYXTn/rhnWfIu0/9J266gjhjhUL/xdu3b8syTrwCFCdjzV/91V/lY0QRQEheMX0Trmf5fSOJ8gQ89NBDK2HfMYx/jkEy4M+mCquTUKlJBs8MBNtLur2ETREXdmEZAspFKBikXYbJlZVp58qv426sIXAwQgT8DNrgpfknfxUkaORWXQL/BZ7niTf3uIGOtRDIm+8Ff/80nUGwJGTXgGsGgp7BY5XyVhFeq3omTsqEGfzgPk3Zo9wXEbKLwFkmTcUHkcqnHE+o5asb6fIySeUljR9EEy/6xV6iOxGBvgVtBunD1dCpFpodVEbupp+FgSSlIX1vT09PprEj2C+99NJr3O6b1bnCmBqYYZAHcMxF5b2JptTPKAc8j+bqmjdPOJJ6hMdSOEns+49+9KM6FM2D4C2NPJAG2h4AbqIgsIlzdS7o6rLp4+4ItnbaqNPGQYMaLCsz5WLDUtzPkyazgox1N0fZmo5IusQrDR0YhxMoF4G5ccKaoZ3t78PwwMBYJK6JNEaQJxWwmcPlAUGAvYlC9AB1kTXbevDgQRkO13jntlaNgeC1nepCn9D4Fm/TVMsRlNkxfx3pVzXwr/0KI808Y7CDNF4SpmRm8FjM2oD7kir3hsTdg0Z/ykZmvdOYR/TLku/SpUuSyNJWvAtTV0wpIKAw7wFdJ4F3F8KN0LHlgtpLn5n53Oc+FztIsHSsljfjAS/DgwY3LgdDO3CaRrCqoxvBQoeUUFklfJUGWGFeTGbXUiWFiToLZbyepmo5898IPPCb++AHP+i5ebMI2TRlJaWh3LvQKzDY/Wlp410aEArjeRZ63jdd/Yl8z3R4WdHGqlOnLwA7IFwE5jOf+Yxx4TEYGxhgVuCZfuYrxjwmpfnKV75yADwzC7wwfL1jXYjZZma4smKouxF40GSS9izoVogrP20YtK7GNdVCG7UzjvfLM5M2b1w6zRfHhacN0wIZ0h5Nmz4pHQpHrMWRlN6Gw4fEZxJ5TQ4/I/Do3+P0u0mbV3cYdRc3I/CYcxwKGwLwQAmDLSvwVEdZ8BJ6KAen6Deas2xFyB2nL/URrf4j70/gIs68M760HiMQT34vLfGiTYA+yAcpjvECz8u5DR40GGFCxm0gQvD8K7ZavBthBVM4SLg6WeBCWE0ywd4fCPS9oMlqvsyE0GhDdNyCWvF6CRMfmpv2EVoEFJwwohrYtIFRnLgPxrkx/Hnk6qAdTiuMNr2DclHyHJQffppnFMXhnIJl5hLA51ZYQ7dwSNsEnkYr7ejoKIq5WljrfYdZ1bLSUIxqD3RvZZwZj45lPNxnqPeQ3IKFcNNiKWj2AHkapMXjOg9o74Xy++MR9k3gojkiK3QHaINxf5q4Z/CsxjN1lLxGCVS7vfe9701UxuJg+MPAQ0pPrOKjBWF2ugEe1CCc/Xn9+a5du9ZIvDxC3kV+0ct7L/Qg+LTFWxIhlEE40A9NKPcmBLLhizYZtPC8MKTdnRPYNjpwl4LPuJ4LBCa8yF1MP7rC+oozwJUQa3vhhRfGMCJmuru7YxU94O+ijWTNGQPCgs7ll2K8SHyAXkrDWAsoy4EK0vj3RkZG+iywNPcmLpAwZiiFj7BiM1WlLey9e/cGLDkbXuqdwaiFL6axRShwizR8UjiDJuiLDCEDXK8jnDhxIraBbBbK0KIVo9WRb6EQ87b5Ct1lZaJV55urigXBgKmnfiYO3HYxKMxAj02cECgXas6qTEix84K1bJpBvICFaBctTKHxx44FNHmrpS6Ftfgw5exy63B43Dtt20ibmij6eyvLzlNNL2jOuBCz0hJ2tOWj1K/J1388NOAB07gOh9L2b+Zn6mBuJ8CzAWa1Bu+5KkboAczwYBf5AMsIO+D1U5/RQiA0NlF4jzEuzRhAOIyhvN4ulC9fPLRR29o+EEjqF1bQ8oilYyBR7oU6nA7H+/PH5QmHkf8Uinms8FVa2szLAi16rRJvA8HRPmra5lA43ou8/6A1B78MhSW+qq3hPZfhI5qf8y8qOq9Mahs/j4GHnuZdHshRxtqgBQyMd4Gb2v0GC3k8j4bGTZziEhB4MjfJGNCyKNhwRwqL1USRzKvIOCPw5C/92Mc+NmGR8d9xpbXSIZf8/lR/fPhZDJ2lsnJRmIvGNkKGQdUoWHRO84683a13m449gXdFTPDtAHc16j3KDdSJuEOqF/e4+b8qfMV5hbBPUyvIsJijoT1qjgk/6iA8ClqDti757izDFeM5lS9NoThoKSvDWBqF0vrjqdP/8f7WaPFHluH52LFjU7S9WbRz9uzZvAqFipPSceHChWt6Pn78uCdkGAz1ML7Ui3+Uv8TLU7/pc+qfHi5+uPS9Jvqecdf6w+Oeh4eHG+nrR+Li8oVRRrufYeVLC3wxkFhcbb7HH398DkGtMWODzNiiD02SfxJmM0eZ1Tdv3qxJWoRgM+asxFP0X2n3VYynfsZswXa2+e1dYxh32DHGeBuwRE/NX/fR5gUtO+H67LPPSthZF+OUVj4i8Cz4ou7ANW0LnbRYJmBdgKOIZwSQ4pTGXwjvZgW1wqiL15f8abbTs8YmfeGC+LWtF2tA9sLDDyLg1B9u2PAsd2A23Lp16xz9dR46XvHzgIDA8wOl09YwodgF0+ikEaUteVLVny7Ns2BR8DEGRh1IzLGA5EKhfDm34UmbTh1aF7i0A8fMU+idZ3VY02n1znWeCmuy0whLyr1NRw4IYbS6bgaGrL4Z5guH72dL/8+cnVk+TAfNyyTSQ9yZKSWQaJ/9MJmAC1KaGW24hqvpIHuXPP97EpXk/qEtjHvolVdeuav+1tvbe5B2Uv+9TYcvSWtPKjccrpW1DNQ1MTaUJsPMw2n0Tr9rpN56zNR/qKMm7z3mIAD+SwyTeGPVFUoLDtq6koijH66egbeGS6sfpbab+k0xzzWVU5CNNk6Sdrwq3SwjX4T+V/gFmLmFp7bxLU8XXGnsAYXUps1311w0vOQk+Y3iCz3XsECuMZ4D82JxMKCRFkccJ85YYtBCm8Cvq45x6dOGAVcC2OADzNtMiwz582Ic7Ld7llHUr4SVf+rTRXpj/bMR/EIh698PO98z7TxNu0VWLxK+D5wNLwXfG9Q/oByioDfS1ocEG9oOQePIWESp6iBvYN4sHy7hOL+wUxywKMbM7bUwdkcZu5nGiGCwz/qw2oIxuMpWtECd8gm8VZb37kWDqwOBLhhQ6n1hKtR/HT169ADENWVBuGl/XKFnygb3tXmZ07kBusRdmlM9xNEqSaMZ8uwNXhhlZw7uEsx0kkoXKiZrvGGuENSUnTVzOdJfwd/NxtDXC8FCg22CdpoUVgeYQEEYxS3wgPJB2zto17N07ON6h4YjdJaA8FF4+GIgxzKzcLp87/SnRuaCToFfAwO9GYu13zJJ4mrB4xQ4N9KWbX/xF3/x5p//+Z8n0po66TSPbpV37ty5OwieFRhPgwQPQYdgjmswtADzyYeb4oB3hAFnmI8/LYrUWyaOP4JnMUzmHxcpd5c8EaFo80rdtDDGjrtMgxn4/dA+0UMAvlq0ckoFMS5uwiw8F08YF9LKtf2OcHi+99yijCvhNKo38DSHpsVGu/wr7/xp5YlBCTmsNArnPjUwMHDTnybNM23bRv2Okf++Fnw/k1Z2t9CXPK9QEixwbaSvGyYNDPXlJWD2kDc2C+NEC5gSaWkzwS811swr8CPtRN29PnHkyJG3/IUWQIXu1HGB/h9RBKivaQcVS5q7pAl4tthXuIq722DFfOscfDQCA1oWLeziqqs+xhgaY/wdACeNv0tx6ZLCZCHSN4zXqr29PWIh2oEXmx/G2A8zPCfGwSDtIdH12IR5AhkE8pN3UQHjcgBmRNPIk12+Y20pkNVWCw6/SqfWIpGR5557rgcG3on1dl75abx3WzhoHavqeOQdhWglaW0Wpr3nVmiaXi1hYcPX+54TDnkHjTRKOqwRdtBiRvOzuAsboKFBl4G8Iu2aORBNBh/l14nmWSMmZIVPXL04aiwuOGvYCn3DWittMIAGaHv1xz/+8aosANrNMAfS3Mkn7OIKVZtz9WFtUe0aub97qOMK7vasfS9RuMWVqzA06TnoKEZiNP1wOhiHUZZy4ZkEXhjWZnpnXvcmLsIaaH1ANNfcGPj1CUcpN9qbR5xZRCYlljSDCO9hxWe56JfyFh2kjY2wA84M79zub2hOAwth5CWjn6jvWwXZC/c/MM7FQwoKPLb4NFk3MuPuBMLAD0aWsMdvmX8/GxMvl6bJExcfAMaL6g5vzMyTw3Aq+U4dm1D+YtcaiP/QB8bD5VOvQWjVCi32oETsR9AGPHTh9PadPDrR54jeaeORODe5X0Oy+by7JD5I2U7ZJuS9yJQPDIJ9CDujSVCRCesGSZm9qGRoCTf37dt3kQGWicGlKcy/UARf86ZkWNoLicZ6Su4TDWjacJZ5rqtJQiwnCAZUf9K3Hz58+BxtbSby09CkmDTqB1ioF8HNaI3cWy5fvnxG1oE6umDSb8YYEAVd6aTzBBNWo1FwgLHGJtTr1Mdo2ihHR3C5Gbgp8R1n0NwI/ygrLz4wPLM6kXLNqrJwWdTTjqElrIaAuyWcdiu9i94f+chH+m17QqcD9KGj9MNjKKrnbJsyJqWkvQmjtnwlUzXVh+mfsjKXUMYH6buXgG3oSNlr/BaTfgi2+5oemfWclM6GZ0KMxLS9x9jhdfIwBH70CY/fhuP0Tj08SRwXHw4DTw9eVlzXMf0+aC1lOvIDB+MuDeOicUH6W9BDW7xiFcdwHr2j4OokG1mpS7jcb8Wl8TSOuEiFHThwYAjtrEONwS+ziUmjdAkOd/nYb+u5mIvl27IypdWkcqfBUA3jKaasAnk8hrUewrsALoFouctwBXbB3LVgxwgB6K5l+jdpOyMIAhl8L2JACIQ58mrlnE5uOQWzmmIQD+VcWb7U5XmEfrLyrrEC8BDMqxsczZFrgs7zlBhoIbyVVgKP/HoMXGKOMF3NzZylPnLhiSFFXE2BTLkXGPMsNIkoTDmXpLwdsRdleP3ur//6r2WlBrwA1Nf0H3DKrCyRpxV3j2AmXX7msI+0RtFMSOwx14T4zMFqK+hzi3EqOoveZuGYBQRNx+AnN9XuNqyYu+Z4advX1b70zSr6qQGDJTGPADyfBJO+0E7cMcXDUK8W6tfAfSftlVqoMNYGWG0aUYhwZdbz02Zr0XyJPWiXEdoRGhDeDoyDwo/7BWB5Alph9iJdL/EtjNPYeJtuK9/x3N1hcdxYlr6SUyCl2NcxdiP0FT0KCjwVSEfRyd2H+O3ReXFpz6XLLWU2PnU6452wjzhLg7D6ywxemFteN55gYtZ20VETLRTizGCn07ejFcT6oHFjDIYnlXP4GoalzsaAiF1+7K8Xrg3P+qBcWV4F8/jzQ/Oljxc4/V/7Y1AmOmA0BjaMRpbaCvcbdIJxfn6Qic8qh7Y+D12OU7+9oiFw90HPOfAYZguJFirEdqREoAUigKv5Hx2pJo3b9EfK11c3zOkLBbKbaISdR2Mm+wOCXYOAfniV9qwGd08YpYFbTBqUi3so2tTHywAAHhpJREFUDpp41pyp+qAn8BSGq8+49ah3ZoEHXbQ/MRVaEjbqB5W4qEc1zKhehyFzbm09StZu+otOCWmmD4YRXKIPjdG2YzAhM0eEUNQc7THgzOMGHC6mT0nYZa0bOEiRM9nS8JGs8NXXwnk0NilLB2gbnsOUTh90iJ2PZpx5Y4t+vBi3aEW0h4cYXkh/iGp5YQQ2+B2hPYLXRYsevYu+orYP8Gf1Cfblvd0mgieYR8aLuZPeuHsZU52ESXExF3Q1Y5++10u4N/ZtPiVimqEf2WM8SeHOeR9K6F9Io1WIAd7hZI67CLxQivhXNDpj3ZFvpbe393Z8qnShMDXTyDqGq1AOytVp+4nuK4hjQICXmWSPg2c7aEycEXh0NmnavTHxgSC/5YHQb6HMgpPqfgDgKiZ90R+mZ61SYwDrdHD9DG0UTtialAsOXr0NU8isAeYG7WUpNjClw3RO1VMLEnrlLqQjThE2Eed7V/lZLhajNDJneBha7wVvLyt1FnPwOq8iECKx7g/FkddraxbzdEvgKNxeDBJtNRGMvfQfudVjGY5NX8od3NdgSLIitQJOCojnWqH8Vvql4biyILOWI0UAWiW2KbC1iMtYgLTRPcpITAtugLp/Ok0WPGThoiS+nbzVCLIqbbvlWQqW+VlY0EH9ZBQrfUo0seHKD2M7letXWk2tvnvdxlfyDuPbBX3MGEExWaavV6w4Kfsou1rR2moLoZ/eSmss2Dy6M9a7pdQBS18b0Kb/eoVD/wndN/OVU2Y8QS5cmU/Xlo0I2vSJgvJI/ZZ0EU1OPIMrAlMBlOWl9wrA/dEJo4x1l7BSTvmknel0hT0MaL2bi0l4CQ373EGcsZhgMFr2bFbLELl09erVHn+++7nv/5Nuls4X0AL88XomzS4qtAoBC2o1dAgJiftIhQGlfKczRbQ1mL3cNPeXYaWEU6lk0ENWrKfpqBzoMwHPu4U2YzTpuLL7+/uXmc+7qTgGUaKVoYEJ/AsMXK2I6+KnJcqiqQaw7pHJZsJSXblN84eA12Ez0IdWcZ+OQvdO0ThneXsLBWAWB23aAvcuv/AMp6UvizYVE3gqD/fVBLxVAm+XNHzrOqN9DuRkkI6am87KcBmfN/NZ+/RPb5Um428Q+B79wnRQXybsHeHwQu8af1giYrTGmwCttUPYHDZOfef1o69oVaMZP/RFDyTCrgVhdxI6GL5DXx2T2xqLx0tTyQfwMooh5S+CsyeEy1Em9dY5xC200R5+++nLnjUJ/CVZdsUIO+HGOG1mTBjByV3ufp2NO2gt5nLgv9EwWFm9ypjvrwQeLIjzlEtP4NFIxoWVtUCI72XhWR/utAsO/OE61NY/v+DF6QEmJyB5BR5pWuhEAeuODlwtUzinRXgwc8IzLzwvcYYHmNQKjXIhQxbtE6wB9zPKA32mwNnT+NPA4TDUqCpExpMnTw5evHixlQEA2OpRFuloVVJBZSBn9Y2kKRu4Ygpj+lm3KQxuP4P3dpr8cWkk7FicIgvBU8dgfNN4EG7oQ7MwU1nAsqIlzD2GTf+JpYPKAE8PFs+gaL76oKjIRVkB6y+SIBdAm9XFHYSOG6+euKRsJryzs3NS1rDaBsF3gMAZWTZYM0YZpE+M5WibF07WSPoWRd5XZllQVVaG7scFy+UWdJykH9xDYC0Uqou8ETDtHuqvwycMKNrzLu2kFcItKNF+8IFn5uRmCsEPZMjzQplGOafcguMkD5jYKOpwAnoYNx3lmDTgvYBgGmHeMtVcFHiN0zcMc37Pe97j9Xf6m+YFx6ChTqRZRDiI5qn6sRChrRpl0BikfH+UJ2vRhPDcRpqARwBjxvtcEeVpTthYlj4QBjZ5/UFFPefauOw8O4yMJ/BomGUqn6UjyNoRdzEDW4DtsxqDwRcgXrhg/zuNnDetrEqS7KXh/YxahwRXw1jO4a/1Oocfbrmfc50s0SqKK08CmYFuokRjtlRkyh8HU2Hy7wP7kr/zY0FL6z6WlCdLOFsTfuGfJ8lZKWLcN8IKRha4whs8J2AK7fzmUbQGP+rbI0QfukO7HuPXKiFhhTjKxv8llYMS8jbaxihUMNTIht+kfPnCweMgDCytVRkAJfrI9UtgK3D2Q8ebMA9jESkh/aAiAxshVwNTNLgwVkrnQgZS9E+KCaFG+aTtoglyIVIYaN+DjF1tVQiko710/qnnig5E+l5o21/yGvG2+JJ4j5Sj7+BFmLISQI9a4o20RQAsJ6XzgGV8YMM9ywxu6ustsnanVWd4oL5Q0o5V2+6fU0oCLUFpFQLwq7J5/Ho+/E7C7moSjLhw6Kx5RCmSiZf6O2kS44mT4qZf4CJf4H2zv3g1hBH3pUVWGhuNeZafLJhbdKaeXN7bIhwNskYjXcoNjLRgE9NRRg8EX9a8lE2E22iazqF5Ag0a78OKNn6r3TUArRsoLe4w1oBrDuai1YpBzpIWmC8dA2+F77Stwah9ofcfSxF2FhjCdLC3t1ef7RhXX7Hhubtn1TG4NcC8Ng+lM6+5fZGe94C+sp+Iobi06xnGmBgDF+0lqn3ggQf2IfC0kVbzXHeLHReqGxawmUOOqwvj0VsWjyWqtN57OD0CSEdahINLfs9Zc/ulsAAsEde0BYUXIeXLB321yjfWTQvtvKzQSfipn+S9JIDSXrnTgX5hxwfCqg3eFDtFlBZmXDrqUfL4joO72cJQdH6VdnrLfZgRQdpXUwYRxcATeGnh0Ql0GPJxANYghG6z32FBE9e6eJ5nocNtOt0htOMTMMyL/EodVbIk62loncTh9dqccLhi8WZwv9s+6y7LCiZzwh+W5hmBsQDsG2nS5mhxBvy0+XU4q8BSGbJixsbGDvHYxkKRK8X6+QULms+Bh9wf3gWO3sn8xEk5SRzF1F3zapp7naQNE9N5wIt8yLXjGJveAxByc3snbSACvCDD0L5IcLZZdG+SZVGsUPEBGsYdGVkUgDtPnyI65UsX+4irbwqmJ21/F3l6oOcuJcQKi2x1iAUQE0i53pxnTLTmub1g2jniwvIieSiHsJOShmLbSDvJ9SVhI0+M5wZTeZQzS7xcuHe7uroK9ilO3DFjQXnJMxq3UlFxm/Gyws6PG0LvHmNw0h9WzDMwAovTssAQHVEyb4bz6NtxhB1WOO10gX2rgbl/9sTusX0dGNeBEakH2yuOgFtgLUG4nGLeKa+WsVNMVpOHsRBgChZQZogIO608kua4hH996MUXXzR+awsQ19MQwqcNhJsgmIiZSnjY/DF3fQlcbqoxBEpMdHyQvnpOg5o5k/gU8aHULbXLEVerNEXRopnGkWDPND8nDFAS5JbV4bfVKA7qPOehXUHGoLzhK2fxBaw+5kiOKB0dehH6JVpLMC8dRm0sdVYyjodhV/pdp5uzsOkBcDCCQeXh+ss/WUYathu0WDee6kj+BgS/rIthwSj2gnEvsijAm+y2cKSgWBe1DYu7qw2h/TADT5+eMXXiefkDH/jAJCud47LEhjG3uUodA4woNiGBKkf9CDqYhSRJ6cLh9F1PkQzHxb1jxbXSNsfFlKB1JAk4LOOBGWfv7GiuT0bSxAUAt5tw4/qF/gvsxbrJuI9LGggDj2GEakQ5sYnE/NQOepcA4qdPOQnxrlzYCGGJ4566BMaU8qS9KPce/SiRL2jcab8dUxNL+cY9ylMzOHpjI235SgcO8tZEDA/4tAcGBWk1nAYFfA1lzaSBXrEwwF9TWh6cCjwM0z9TTwGAp4yxRM9GJoHHAO6AeNLAxIy0mXmV46sCdVSjsbKvD0LJ8ulAKCyzsiyxwQOZE14QrHf4JcQWDgYPTXwv5UtJfWQpFGSwFgbMpZq6GVrwvKL9RDYuy12uEODoYFa5gndzMo0GYdlccjAOzSto6bhWriZedCrNN8lFrRVgi3ELNv7sz/5MgzIycBKBpoxAiLTgrj7JgDb9EXrepRxpl3nbgwGqOSszrwDuxpIQYyOvNjyPcC9KcUiJdsFk1Gmsu7v7kK0X98yLVbBUpynoDRUmr0WcFaE49UcY2K/wqHmqKRTPiDtH6cpxyXpF8Z2HvoaxqP+L/rxrP6W+mJJ5oQm4d9H3jMIFrDUsYR0YkKqv5Vu5qvpqwQZ4marTt0fAb0zbbuBRRuAh0GbSHl9VDvpZGLKQ6eNnpUBBzzuEl2ocWNDb5k67LTNPnErhU6WhY94+k1rg5YTdUQGlQ97K10G0YZsz0K7TmCdIe5DOXIOWM6C8WS86fS0dw5SbNa9NDx7DEC1ijtt43RkU0gwik7L+NP5ntFEtujAaF/eiNs9aeAzAIRpKE/v6IONBGNs4jG3Rxhd714CCfnYxR16BR7n7SatVVzoP8W1xmjs4yoXszbEVi5fNl7OWtHpP8x1i2ivsy7sGA9KcrOZm67mDVrzgYh5wPwLPLFKQ2wwBM4FXQd8Z26X2Ib+YSMUv4ciS9IY4Nyq4yHoy44x6JFoRhZCUVYW1d4z7nF3R6s/D+GwBvlmUwZi7648r97PaAzz6aKe91G8G4XrP30Yofw3g00Xb7Dlz5sylQm7JHG+RN0i8xXz1IOHQh8xVkeJG3zKKKbAXcdutu/ciCWnGnLdKkv5btBWZBN+FRymQSuBJ+6JxTIeEGab6SKIEIkLkJgxULjV9pqWGgVHwiKswijATxlT+uYtwnkq/y7KQYFI5YmjaElBKmTALfZliAFjm7EsEgDTd66XAVF4GUTd4GjCUkcgEYV67aVdv4UdSubRlXu0pKV84XJYKTLsLV67c42ZiWswI184VucBy2rfJphM9eIgV/swf6TgyzfWs4hoep11WYJ6T1Hm/2oe+I4uqLDiH66B3GGkrSkArFnozglr0lULgXXLpU75HV/A5DI7T/CQEU1/qb7SPFlnoyyV7Kesc9RxAifMOR1c8tDQwsVwS2zp1oQUS5rRuo3mHpxoQhK3Qv1NKDHOsp8D/Er9IO6he7JFSH/VWw9KO13H55lVOC6DmRQs+itsJAowiwP1GHB5ehjwPUmq4yuoxYHx6rjfgp7Zi8qC5ZaPEg+jbbVjrAW8g/bpRB0inrRg8SocvJCbPK/ByiwiOkVtzItL+p/Gpp/5Ior5qgLCUW6qLwdgBc2iC2V3LYr2IYfEr6C6EWN6gEa6VvJib0IIAY1lQr5KsO4unFAToY1x5hLXhFh4pRcuFCe8R0xF86DeaY1C2uMAdTVw9JMCsbQLo6n16h7rmdQvbPIXuMORu4ErYmaTCj9V4g9YSIM7rsTDPWIGnLRgwCSNMYBzag2jy4LIaAq4GSD30lMvqdiF88sVrDOh7e+CkFYdNnCtrPvCpPOBtltWDh54DYBjA+kqDWWRCnDlqjAT1zCsf4Z5Jmckx6evUeQo85O2opW2PolC2MffZx3sVS+LNwgHiZ7N+XUL5y3nRb0cQyDrVRIcINPN5sOPQSC5KT2CIPsQfBl/jJRGNEE59CLvEubgsOFKejuAS77IrRXXE3lQWGP60OgSf/tSDEJ/Q9IXtb/40WZ9FG+pvFDbaLzJfnBXeVk2PTGhk64a+aC6lKCDweG9jfHtbegrVkT6VN0miwBPD5JgmnQFnGLsaGt99n7/T5oWci5Qrk87N2F/uUQPDMM7x3gcDTqXF0XH1CYkwESJFI1jXReCpcbBMjIsE4i6D2wh1ieBTTADnEt7EujunvDB6WXmXioEDjrXgKBetsUA5WWUwHxwYgQRZLDNgw7m3KoF5lbIIPBjbEPXTQp1lVkLeCAt2+oi3GALh6DFJWwfq10AazdVpQn5Z8GwcdZmD0Y3SbyQA5B6+C3PK685V3pxyp9NkDCj6ewdeiS7GgBQ271KZ/ot09xCyM1ibXn/O4XfcpmXRyVWUinZwlSBuQ2PVNxozM3b62jg4acP2ccrVtypb9GVnxtYC7wYx2qjgWPHjX6lnxsQAAkJfC5Bg20+byEoXL9gNrfSpIG9BGW01jzJ9FWFXFitHbYnAPUl5Zu+Z2gj3981S6ko9dJajrJCDQ0NDY8DKz1kLFEYfaWGs271x+mhxxAIuAGJbROsINsbyA7SRscLVdlbxVQXVN6D9QtrK0kZSIhLlWiRCBV6/fv0gndRYByoIALcQXLeLXThC5x9ShwemmLA2gJ4UUzrJaSH+yqWt1Ealg/g1CNYT1MEwFwapWbhTLnxgzPdgaJPAN9+CktKBiZ/JPSVmy0A6CQzDqKF1STTGfSZ3pxEs5dBqRSvBAc+LSSvToKt1QSl5QMjSBtUws146tknD6rJbYbzoZ7fos23AqdFRVpR1gTSxblENOITvAwi2Wmim8swl5sbPvpo7cJcJWyCdcUUhrG/KmvEnkhttdHS0F2Fk8CPtbW01YVzNUYYYXD35joLTbBJOfnjh55xychkadFBH82VneIVRSqDNCm0vaxI037KmwjDW413lc8kqPUN5srI0rbELwb8PfD3Ckm4UQV62cUQZTaz21dSAsRyh0eypU6eulMpngGMUf9GOPhXokwoLX9QxoqjZNLR9LUfcHbfvpDWrEKFVG/154fHHH9dh7YH89GXRU270QLiFsRXv0LROY4+6SpnQp4Cuh9uJcTQm+ZG2fihZshSN5yUujzfCNVA1V6djn6ywExIQ+iqDrCS3kAqWdsoczSUazWhG3NtVllZQ8ewNgDgkN0sYAugINDFuNBqnLAcox9TNozWCpicmPjFIc1/MjZ0lgXHjgOso86bSRou+6AtGC4VJF73gIq5wMXvwix28hHvMBfwD810w+oMMFIMT/UZfaTbMwl+GhAJ431AY7VQnBUD925/GPmvJP+X5BaxxMRGvL2iLdgNYmZcp85csk/8Fffiazcs+T/to7uBTw6rMk7K8FCD8UBJNe2ogy2WncA109queEuPTezEX43IOYRrQfFUPGOYZmP47tAhLcx+llFEMXjaPxrQ+jwQNtcrUXOBrjsLTC/hPQ4cL8IV+8C7ZupGiTr2PUsZZyjbCTvSnvS6Hmeh9bN76Zw7+rZfkJzPupfSkscYwEH7J72f8rvtBii7su9X2I4MjcXP04UmNXcJ6sX4fhA//Cv1cH5Bt52fGAnS6IniMB7Ni1w9zqz3TJ4yhpf6qH/hrvF4UHSpdF1OwiI2kNfuFQMCUSceZ4dcPEmVxMwgoTE5HU53HhJW7Z48qS8c/QgN3aCtD2LWlPGIOxPfqudgLYu4DfsA1FYYFUzMdOhxu38U86JBmnoSwJVwkhqHa+Dz3TEwt55KboiwdBNxMh99HWKy70ZYJTWXVdVIHs8xa4dBVR3YNMVBsssx3ytZXEszApB2C3D0ztPQZqLfR0MRc6COeUMQd1s1gMa5r8Flk3u+aP95fwp/+6Z+O0W9k+Ygm2hN6mvpIeQto5/TJFdINU+YqzOYeQinV+ZD+svQswQKT0lcAjLAjaAnaBeatZOmRZoR6dfJrRDnRgo7LaRioyiBdDed06pNNB8DV49KUadyq0EL7X3k12zsOkOUAru016HaX8T2F63UqbiWpYJd6qf6UpfneZuqm8zGbqb8OpwiA5n0ahWC4lAMW/ABFE+YID6A8a8rEjDX6hvrMbYTDUFL/gIarjBcDiv2vstgTXcwqg35nXLCUcT+TH4kUz9CiWvOA9MFD0MCzyJnG6FN2cNZ5w1K+5FnQHK13Ggx78O5Bs0kUrLFi2o/ykk7d8RRL+sZJxkFA8aB/epu/oVcP8d3hqkKPBnAPBye+i6dQP78FpsMyroTHZSKAEiNMb8RE1ykdhrFRAdp2eRBtIqI5l1iWyS7Nnoa9jPbXQYfTp2F0soeW48f6xBVPxtSTlnE4Ul47DCIuygujHO857oFO02HDaaD+sNaoDv3yyy/X/vjHP/Y2cBJWg5vCcw0DI2CtWHjhO53rtmVo4KX5wliBB5NpZBBotaPZuC444LYGw9Mcaarl1xrM586dq8a9KCZhhMuTTz5ZjRuohfbxLEz6RNm1L9GMyxNowl9uXMKl7Upoe2UyUHQmo2hh6sjtargNFOe/EPaDwBMjMcoDtHkQmpmVoP509PUB/zu0878WfJZ1gbvyARIay5q7+cgni0cCwlWAgD0A45ObWJ9EakEQ94JfRHATZr45hwtwN22sTceamzBbD0QbXWprfsOcTnKbdlS/G+DkC+2nbLdMReNHZUFL/Y5Aj2WY2xLPmmKQm3cJK3cR+Ape1DytlABTgO9Prl/6pLauiBnX6U455i4Bi8JFUTXCSRayrFsvN2EqZxRrS4co67nki3ZsgCG3g7P2BgsPAxMctBewHzrPw0TzlePhAX6dMHPtiYswCWDpuD4pD0Y4UFYqxY/+Wg8ttdhJbd2C0NoHLH3axuAEvgt4Ta5DDyNAc67xEW2jYKWq+oa+FK5tH9JgBAcW3XgQxXsGuKM8T8a1U1yFySs+H9Q8QgnBJ6Lwg6+Xiva0FqkXpgdgB96zvJB3EqVESmEiEGjXIyUhLVxg3e8ICRlMjbS5FS1wDC2w6sEHHxwoxEgSYKUOBieNhhHKnKYzHWfADamDxgEQMWj4obg4fxgdI5EoEFaM4a0R6M+Ye1bH0i8mygSxOOAKK+wOAacmzuKSkIB5vYM02gBs3GL4kwMwqUsqt6AsXQSlVuTp5IxhMb8czTz0xIBgMg8qgDQmHDpNk24QRp+qHGUSgwROL+UZGPqjDlVW+9U7eExS59QwlSfN9Zd/+Ze7odU56rcC3mpnnRLijTLezT46ub2po2lfpWPAX8VCKIiPaIYQuCahQn650/QtttOU95rgpMExTZrr168fJZ11I+uovcsIuwjzFCzhBLO+Bh5nxMiEF+NAngNTV30jkPrpa/OeR4I0RoCQVyB0LRE2Cq3usBLaE6oSesRJ0RmXQEAR0sKWvRJ45LXWT50EFDTwFugwBgXTXPSFqueee26IY98GbZjutIWEoD5J5fU3y7wV5r/AjSKXZyhb/VFu59ix7c+T5RnaHKNu2rcqYWCyUs4CKMqjkWpzvwQv49MecCDCtkHPCBp+2iiSLx9EFEnqr+MWT4CPrB31XwnPav8YssKD+EWex7T3FpwjBeYsOPWFO7RnzbFjx/ZK4AKvVeVDU50s1IKgX2VcTOBm7wdOsAGU0HepTOhUlGXqAxP7CM3Vj7y+GpvIFyg+gtKloxhnEXaDhXBXVtHSB6KkR4+5sAKzIOFKKikmc24gvBkT5QXRmVYg0m0vIOEBxpko8LCYrlGWZy3EgdCcB4SVJhd75ZjJQGwkgYoHB3Uqw/jAG3BvWY10DB1mqnm/JBCBcBb09L2HT4SoQ8TlkVBE8zELXCjrLgPglv3uWgBQgZeBgYFpCbi4i7INA6Vj3gT3uCQlhWn5PMxLgkHaI2PyPvPKAdXZpEaoQccJBkgX+NQy2K9Aj4KrLi1iahfocw2hcpg26ESrVj+PMBqbvpg7GvkAgkIf99WJIzo03RNCcfCkmcvSlMIiZoSF5s2ziia0q/IHmIgYBIxS82GaFyx4kokYOmnlpdGKVc2nNSGEmugn+jhyoxiV6El85FJZ4UCN1ZyCqhNwllVX/WgzfWUF429hgeX684y1+aTFSGGYxb7TB+QWNdMLwpW6DCP4zfmvWfop+F/np9W+ZnolCR/K0GC+x10LpCKCg/z66K9oIqUqAIYwKQpz9LtZrLIpaKMTadZYjBZIF/eS4zniW5OyGLmrzu2U0QBcbjWrghWXNxQ2xZi5EQoryyt4HQWQ5/1KA5RV48Y7g2elYHL60xDjJLW3EWXxOO1kpxUi8D2Bl5JwEQB0PHVyY4HpOZKgyAD2ui2iIWn5eirmZHFA8zNuQ077X2WAjqh4iBCrbftRA/dpOhBjx7h5/FGpnzUgYCrGP28z0cnFGOZp3LtoYza44D2NlY2L6CZunZGsKzn9hTOo9KmUK9Rb7hZZT7KGV1hpuMpKsgUNujiB64dRyvPevXv7aLPd0N9ocfRDuQPv+ecqYGJL7De7xF6lWoR6QcsujE+ub99EyGQ62zEMR++c0bqKVWwGIH3OMD8JFyyzy+985zuX0rSb4CgP+Fymny9Rv0Afp10HoIn2Uc63t7fPU6ZpB+XTlYZZ3k95/z9XfwmxgCDLMVEx0nq8LHUIkjr6bx2LOO7689tnlOIrxfIJC6Mcd23pAPd+cJ23Sh5hmUGrX5HpqjIyRqvlpYkDoi+HFKo3nwcaon/qlBid57oEbou4ohf9/TgOdtqwHK63wVOnMsnluR9rM2CFh2GR5g7tWsM90O7hdKW8U1/DN9PyaZWVZoxAbzPG4EmZvi6C0SHFZ57V5RHFpJR6uryOAo4CjgKOAo4CjgKOAo4CjgKOAo4CjgKbjQL/H0U4I+33KKiUAAAAAElFTkSuQmCC",bgImg=new Image;function imgToCanvas(e){return _imgToCanvas.apply(this,arguments)}function _imgToCanvas(){return _imgToCanvas=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(n=document.createElement("img")).src=t,n.setAttribute("crossOrigin","anonymous"),e.next=5,new Promise((function(e){return n.onload=e}));case 5:return(i=document.createElement("canvas")).width=n.width,i.height=n.height,i.getContext("2d").drawImage(n,0,0),e.abrupt("return",i);case 10:case"end":return e.stop()}}),e)}))),_imgToCanvas.apply(this,arguments)}function addWatermark(e,t){var n=Math.max(e.width,e.height),i=5*Math.floor(n/600),r=5*Math.floor(n/500),a=e.getContext("2d");a.rotate(-30*Math.PI/180),console.log(a);for(var s=0;s0&&void 0!==arguments[0]&&arguments[0],t=document.querySelector("#globalPlayer");t&&(t.style.display=e?"":"none")},data=reactive({list:[],index:0,start:!1});useToggle(!0);var noteFrequency=ref(0),audioFrequency=ref(0),followTime=ref(0),openToggleRecord=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(postMessage({api:"cloudToggleFollow",content:{state:e?"start":"end"}}),e)followTime.value=Date.now();else{var t=Date.now()-followTime.value;0!==followTime.value&&t>0&&(followTime.value=0,updatePlayTime$1(t/1e3))}},initBehaviorId$1=""+(new Date).valueOf();function updatePlayTime$1(e){return _updatePlayTime$.apply(this,arguments)}function _updatePlayTime$(){return _updatePlayTime$=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var n,i,r,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=useOriginSearch(),i=sessionStorage.getItem("behaviorId")||n.behaviorId||initBehaviorId$1,r=getRequestHostname(),a=useOriginSearch().id,s=location.hash.split("?")[0].split("/").pop()||a||"",e.prev=5,e.next=8,request.post("/musicPracticeRecord/save",{prefix:r,data:{musicSheetId:s,sysMusicScoreId:s,feature:"CLOUD_STUDY_TRAIN",playTime:t,deviceType:getPlatform(),behaviorId:i}});case 8:e.sent,e.next=13;break;case 11:e.prev=11,e.t0=e.catch(5);case 13:case"end":return e.stop()}}),e,null,[[5,11]])}))),_updatePlayTime$.apply(this,arguments)}var onClear=function(){state$2.times.forEach((function(e){var t=document.querySelector("div[data-vf=vf".concat(e.id,"]"));t&&(t.classList.remove("follow-error"),t.classList.remove("follow-success"))}))},handleStart=function(){onClear(),data.start=!0,openToggleRecord(!0),data.index=0,data.list=[],state.osmd.cursor.reset(),getNoteIndex(),refreshView()},handleEnd=function(){data.start=!1,openToggleRecord(!1),data.index=0,state.osmd.cursor.reset(),getNoteIndex()},next=function(){state.osmd.product?state.osmd.cursor.setPosition(state$2.times[data.index].cursorBox):state.osmd.cursor.next(),refreshView()},getNoteIndex=function e(){var t=state$2.times[data.index];return t.frequency?(noteFrequency.value=t.frequency,state$2.fixedKey=t.realKey,{id:t.id,min:t.frequency-.1*(t.frequency-t.noteElement.pitch.prevFrequency),max:t.frequency+.1*(t.noteElement.pitch.nextFrequency-t.frequency)}):(data.index=data.index+1,next(),e())},checking=!1,onFollowTime=function(e){var t,n=null==e||null===(t=e.content)||void 0===t?void 0:t.frequency;audioFrequency.value=n,data.list.push(n),checked()},checked=function(){if(!checking){checking=!0;for(var e=getNoteIndex(),t=0;te.min&&n1&&void 0!==arguments[1]&&arguments[1],n=document.querySelector("div[data-vf=vf".concat(e.id,"]"));n&&(t?(n.classList.remove("follow-error"),n.classList.add("follow-success")):(n.classList.remove("follow-success"),n.classList.add("follow-error")))},Follow=defineComponent({name:"follow",setup:function(e,t){var n=t.expose;return onMounted((function(){togglePlayer(),console.log("开始监听"),listenerMessage("cloudFollowTime",onFollowTime)})),onUnmounted((function(){removeListenerMessage("cloudFollowTime",onFollowTime),togglePlayer(!0),onClear()})),n({data:data,handleEnd:handleEnd}),function(){return createVNode(Teleport,{to:"#colexiu-detail-music-sheet"},{default:function(){return[createVNode("div",{class:styles$2.follow},[createVNode(Transition,{name:"start",duration:300},{default:function(){return[!data.start&&createVNode(Button,{style:{backgroundImage:"url(".concat(iconFollwBtn,")")},class:[styles$2.button,styles$2.start,styles$2.followBtn],onClick:function(){return handleStart()}},{default:function(){return[createTextVNode("开始")]}})]}}),createVNode("div",{class:styles$2.title},[createVNode("span",null,[createTextVNode("音符频率: "),noteFrequency.value.toFixed(2)]),createVNode("span",{style:{color:"red",marginLeft:"10px"}},[createTextVNode("拾音频率: "),audioFrequency.value.toFixed(2)]),createVNode("span",{style:{marginLeft:"10px"}},[createTextVNode("拾音长度: "),data.list.length])])])]}})}}}),iconFollowEndBtn="/orchestra-music-score/assets/icon-followEndBtn.7fe21406.svg",confirmShow=ref(!1),search$3=useOriginSearch(),startButtonShow=exports("F",ref(!0)),evaluatingRef=exports("E",ref({})),settingPopup=ref(null);ref(null);var followRef=ref(null),animate={mounted:function(e){e.addEventListener("click",(function(e){var t;(t=e.target.classList).add.apply(t,["animate__animated","animate__tada"])})),e.addEventListener("animationend",(function(e){var t;(t=e.target.classList).remove.apply(t,["animate__animated","animate__tada"])}))}},beforeCheck=function(e){var t,n,i,r,a=search$3.setting||{},s=null===(t=state$2.activeDetail)||void 0===t?void 0:t.paymentType,o=null===(n=state$2.activeDetail)||void 0===n?void 0:n.orderStatus,l=null===(i=state$2.activeDetail)||void 0===i?void 0:i.play,u=(null===(r=state$3.user)||void 0===r?void 0:r.membershipDays)||0;return"web"===useClientType()||l||"FREE"===a.feeType?e(!0):null==s||!s.includes("VIP")||null==s||!s.includes("CHARGE")||u>0||"PAID"===o?"VIP"!==s||u>0?"CHARGE"===s&&"PAID"!==o?(permissionPopup.active="demand",permissionPopup.show=!0,e(!1)):void e(!0):(permissionPopup.active="member",permissionPopup.show=!0,e(!1)):(permissionPopup.active="memberAndDemand",permissionPopup.show=!0,e(!1))},back=function(){postMessage({api:"back"})},startEvaluat=function(){console.log("开始评测"),beforeCheck((function(e){e&&(setCurrentTime(0),state.evaluatingStatus=!0)}))},modelType=exports("aa",ref("init")),modelWraperShow=ref(!0),onChangeModelType=function(e){if(modelWraperShow.value=!1,e!==modelType.value){if("evaluation"===e){var t;changeSpeed(null===(t=state$2.activeDetail)||void 0===t?void 0:t.originalSpeed,!1),startEvaluat()}else{var n=store_legacy.get("speeds")||{},i=useOriginSearch();n[i.id]&&changeSpeed(n[i.id])}nextTick((function(){modelType.value=e}))}},Buttons=exports("a9",defineComponent({name:"Colexiu-Buttons",directives:{animate:animate},props:{onSetMusicScoreType:{type:Function,default:function(e){}}},emits:["setMusicScoreType"],setup:function(e,t){t.emit;var n=useOriginSearch(),i={query:n},r=_slicedToArray(useWiredHeadsetCheck(),1)[0],a=ref(),s=_slicedToArray(useMenu(),1)[0],o=ref(!1);onMounted((function(){i.query.modelType&&onChangeModelType(i.query.modelType)}));var l=ref(!1),u=ref(""),c=function(e){u.value=e.text,confirmShow.value=!0},h=function(e){return"staff"===e?state$4.sett.type===e:"shoudiao"===e?"jianpu"===state$4.sett.type&&!state$4.sett.keySignature:"guding"===e?"jianpu"===state$4.sett.type&&state$4.sett.keySignature:void 0};return function(){var e,t,f,d,p,m,v,g,y,b=(null!==(e=state$2.activeDetail)&&void 0!==e&&e.isAppPlay?""===(null===(t=state$2.activeDetail)||void 0===t?void 0:t.midiUrl):state.isFirstPlay||1==(null===(f=state.audiosInstance)||void 0===f?void 0:f.length))||state.evaluatingStatus||(null===(d=state$2.activeDetail)||void 0===d?void 0:d.isAppPlay)&&state$2.midiPlayIniting;return createVNode("div",{class:[styles$8.container,s.value?"animate__animated animate__fadeInDown":"animate__animated animate__fadeOutUp"]},[createVNode("div",{class:styles$8.leftButton},[!(null!==(p=i.query)&&void 0!==p&&p.modelType)&&createVNode(Button,{class:[styles$8.button,styles$8.backbtn],onClick:back},{default:function(){return[createVNode(ButtonIcon,{name:"icon-back"},null)]}}),createVNode("div",{class:styles$8.titleWrap},[createVNode("div",{class:styles$8.title},[null===(m=state$2.activeDetail)||void 0===m?void 0:m.musicSheetName]),n.albumName&&createVNode("div",{class:styles$8.album},[n.albumName])])]),createVNode("div",{class:styles$8.centerButton},[createVNode(Transition,{name:"finish"},{default:function(){var e,t;return[r.value&&!(null!==(e=evaluatingRef.value)&&void 0!==e&&e.connentLoading)&&!startButtonShow.value&&createVNode(Button,{style:{backgroundImage:"url(".concat(iconEvaluatingEnd,")")},class:[styles$8.button,styles$8.finish],onClick:function(){var e,t;null===(e=evaluatingRef.value)||void 0===e||null===(t=e.playerStop)||void 0===t||t.call(e)}},{default:function(){return[createTextVNode("结束评测")]}}),(null==followRef||null===(t=followRef.value)||void 0===t?void 0:t.data.start)&&createVNode(Button,{style:{backgroundImage:"url(".concat(iconFollowEndBtn,")")},class:[styles$8.button,styles$8.finish,styles$8.followEndBtn],onClick:function(){var e,t;null===(e=followRef.value)||void 0===e||null===(t=e.handleEnd)||void 0===t||t.call(e)}},{default:function(){return[createTextVNode("结束演奏")]}})]}})]),createVNode("div",{class:[styles$8.moreButton],style:{opacity:state$2.initRendered?1:0}},[!(null!==(v=i.query)&&void 0!==v&&v.modelType)&&"init"!==modelType.value&&!state$2.frozenMode&&createVNode(Button,{class:[styles$8.button,styles$8.hasText],disabled:state.evaluatingStatus&&!startButtonShow.value||(null===(g=followRef.value)||void 0===g?void 0:g.data.start),onClick:function(){var e,t,n;("practice"===modelType.value&&(resetPlayStatus(),setCurrentTime(0)),"evaluation"===modelType.value)&&(state.evaluatingStatus=!1,("play"===(null===(e=evaluatingRef.value)||void 0===e?void 0:e.playStatus.value)||"connecting"===(null===(t=evaluatingRef.value)||void 0===t?void 0:t.playStatus.value))&&(null===(n=evaluatingRef.value)||void 0===n||n.cancelTheEvaluation()));modelType.value="init",modelWraperShow.value=!0}},{default:function(){return[createVNode(ButtonIcon,{key:"modelType",name:"modelType"},null),createVNode("span",null,[createTextVNode("模式")])]}}),"evaluation"===modelType.value&&createVNode(Fragment,null,[createVNode(Popover,{show:o.value,"onUpdate:show":function(e){return o.value=e},overlay:!1,placement:"bottom-end",class:"cameraPopover","show-arrow":!1},{default:function(){return[createVNode(CellGroup,{border:!1},{default:function(){return[createVNode(Cell,{center:!0,title:"摄像头"},{default:function(){return[createVNode("div",{style:"display:flex;justify-content: flex-end;"},[createVNode(Switch,mergeProps({disabled:!startButtonShow.value,modelValue:state$4.sett.camera,"onUpdate:modelValue":function(e){return state$4.sett.camera=e}},switchProps),{default:function(){return[createTextVNode("off")]}})])]}}),state$4.sett.camera&&createVNode(Cell,{class:"cameraOpacity",center:!0,title:"透明度"},{default:function(){return[createVNode(Slider,{min:0,max:100,modelValue:state$4.sett.opacity,"onUpdate:modelValue":function(e){return state$4.sett.opacity=e}},{button:function(){return createVNode("div",{class:styles$8.slider},[state$4.sett.opacity])}})]}})]}})]},reference:function(){return createVNode("div",null,[createVNode(Button,{class:[styles$8.button,styles$8.hasText]},{default:function(){return[createVNode(ButtonIcon,{key:"camera",name:"camera"},null),createVNode("span",null,[createTextVNode("摄像头")])]}})])}}),createVNode("div",{style:{display:"none"}},[state.evaluatingStatus?createVNode(Evaluating$1,{ref:evaluatingRef,key:"lianxi"},null):createVNode(Button,{class:[styles$8.button,styles$8.hasText],onClick:startEvaluat},{default:function(){return[createVNode(ButtonIcon,{key:"evaluating",name:"evaluating"},null),createVNode("span",null,[createTextVNode("评测")])]}})])]),"practice"===modelType.value&&createVNode(Fragment,null,[createVNode(Button,{class:[styles$8.button,styles$8.hasText],onClick:function(){return changeMode("background"===state.mode?"music":"background")},disabled:b},{default:function(){return[createVNode(ButtonIcon,{key:"music",name:"music"===state.mode?"music":"accompaniment"},null),createVNode("span",null,["background"===state.mode?"伴奏":"原声"])]}}),createVNode(Button,{class:[styles$8.button,styles$8.hasText],onClick:sectionChange,disabled:state.evaluatingStatus},{default:function(){return[createVNode(ButtonIcon,{key:"section",name:"section"+(state$2.section.length&&state$2.section.length<=2?state$2.section.length:"")},null),createVNode("span",null,[createTextVNode("选段")])]}}),createVNode(Button,{class:[styles$8.button,styles$8.hasText],onClick:function(){state$4.sett.fingering=!state$4.sett.fingering,event.emit("settingFingeringChange")}},{default:function(){return[createVNode(ButtonIcon,{key:"music",name:state$4.sett.fingering?"fingeringOn":"fingeringOff"},null),createVNode("span",null,[createTextVNode("指法")])]}})]),["practice","evaluation"].includes(modelType.value)&&createVNode(Popover,{trigger:"manual",overlay:!1,placement:"bottom",class:styles$8.popover,show:s.value&&state.speedShow&&!(state.evaluatingStatus||"play"===state.playState),"onUpdate:show":function(e){return state.speedShow=e}},{default:function(){return[createVNode(Speed,{ref:a,updateSpeed:function(e){return state.speed=e},changed:changeSpeed,mode:state.mode,changeMode:changeMode,lib:{speed:state.speed},class:styles$8.speed},null)]},reference:function(){return createVNode(Button,{class:[styles$8.button,styles$8.hasText,styles$8.speedButton],disabled:state.evaluatingStatus||"play"===state.playState,onClick:function(){var e;null===(e=a.value)||void 0===e||e.refUpdateSpeed(state.speed),state.speedShow=!state.speedShow}},{default:function(){return[createVNode(ButtonIcon,{name:"speed"},null),createVNode("span",null,[createTextVNode("速度")]),createVNode("span",{class:styles$8.label},[state.speed])]}})}}),null!==(y=state$2.activeDetail)&&void 0!==y&&y.notation?createVNode(Popover,{class:styles$8.toggleMusicType,placement:"bottom-end",show:l.value,"onUpdate:show":function(e){var t;"play"===state.playState||state.evaluatingStatus&&!startButtonShow.value||null!==(t=followRef.value)&&void 0!==t&&t.data.start||(l.value=e)}},{reference:function(){var e;return createVNode(Button,{disabled:"play"===state.playState||state.evaluatingStatus&&!startButtonShow.value||(null===(e=followRef.value)||void 0===e?void 0:e.data.start),class:[styles$8.button,styles$8.hasText,styles$8.speedButton]},{default:function(){return[createVNode(ButtonIcon,{name:"icon-zhuanpu"},null),createVNode("span",null,[h("staff")?"转简谱":"转五线谱"])]}})},default:function(){return createVNode(Fragment,null,[createVNode("div",{role:"menuitem",class:"van-popover__action",onClick:function(){return c({text:"五线谱"})}},[createVNode(ButtonIcon,{key:"type",name:h("staff")?"icon-staff-active":"icon-staff"},null),createVNode("div",{class:["action-text",h("staff")&&"action-active"]},[createTextVNode("五线谱")])]),createVNode("div",{role:"menuitem",class:"van-popover__action",onClick:function(){return c({text:"简谱"})}},[createVNode(ButtonIcon,{key:"type",name:h("shoudiao")?"shuodiao-active":"shuodiao"},null),createVNode("div",{class:["action-text",h("shoudiao")&&"action-active"]},[createTextVNode("首调")])]),createVNode("div",{role:"menuitem",class:"van-popover__action",onClick:function(){return c({text:"固定调"})}},[createVNode(ButtonIcon,{key:"type",name:h("guding")?"guding-active":"guding"},null),createVNode("div",{class:["action-text",h("guding")&&"action-active"]},[createTextVNode("固定调")])])])}}):null,state$2.initRendered&&createVNode(Fragment,null,[createVNode(Button,{class:[styles$8.button,styles$8.hasText],onClick:function(){var e;null===(e=settingPopup.value)||void 0===e||e.onShow()},disabled:state.evaluatingStatus&&!startButtonShow.value},{default:function(){return[createVNode(ButtonIcon,{name:"setting"},null),createVNode("span",null,[createTextVNode("设置")])]}}),createVNode(Popups,{ref:settingPopup,style:{borderRadius:"8px"}},{default:function(){return[createVNode(Setting,{active:"practice"==modelType.value?"2":"evaluation"==modelType.value?"3":"1"},null)]}})]),"follow"===modelType.value&&createVNode(Fragment,null,[createVNode(Follow,{ref:followRef},null)])]),state$2.initRendered&&!state$2.frozenMode&&createVNode(ModelWraper,{show:modelWraperShow.value,onChangeModelType:onChangeModelType},null),createVNode(FloatWraper,null,null),createVNode(Dialog.Component,{teleport:"body",class:styles$e.confirm,style:{overflow:"initial"},show:confirmShow.value,"onUpdate:show":function(e){return confirmShow.value=e},message:"设置成功,是否立即重新加载?"},{title:function(){return createVNode("img",{class:styles$e.iconTitle,src:iconTitle},null)},footer:function(){return createVNode("div",{class:styles$e.footer},[createVNode("img",{src:iconCancel,onClick:function(){return confirmShow.value=!1}},null),createVNode("img",{src:iconConfirm,onClick:function(){"五线谱"===u.value?state$4.sett.type="staff":"简谱"===u.value?(state$4.sett.type="jianpu",state$4.sett.keySignature=!1):"固定调"===u.value&&(state$4.sett.type="jianpu",state$4.sett.keySignature=!0),useReload()}},null)])}})])}}})),scoreInfos={1:{img:Image1,tips:"你的演奏不太好,音准和完整性还需加强,再练一练吧~",mome:"敢于尝试"},2:{img:Image2,tips:"你的演奏还不熟练,音准和完整性还需加强,加紧训练才能有好成绩哦~",mome:"还要加油哦"},3:{img:Image3,tips:"你的演奏还不流畅,音准和节奏还需加强,科学的练习才能更完美哦~",mome:"突破自我"},4:{img:Image4,tips:"你的演奏还不错,继续加油吧,加强音准,离完美就差一步啦~",mome:"崭露头角"},5:{img:Image5,tips:"你的演奏非常不错,音准的把握和节奏稍有瑕疵,完整性把握的很好~",mome:"你很棒"}};ref(!1);var search$2=useOriginSearch(),Content=defineComponent({name:"ColexiuEvaluating",props:{data:{type:Object,default:function(){return null}}},emits:["restart","upload"],setup:function(e,t){var n=t.emit,i=ref(!1),r=ref(""),a=toRefs(e).data,s=location.origin.indexOf("localhost")>-1||location.origin.indexOf("192.168")>-1?"":"/orchestra-music-score",o=function(){var e,t,n,i,r,o,l,u,c,h={id:null===(e=a.value)||void 0===e?void 0:e.recordId,musicId:search$2.id,name:(null===(t=state$3.user)||void 0===t?void 0:t.username)||"",subjectName:((null===(n=state$3.user)||void 0===n?void 0:n.subjectName)||"").split(",")[0]||"",avatar:encodeURIComponent((null===(i=state$3.user)||void 0===i?void 0:i.avatar)||""),score:(null===(r=a.value)||void 0===r?void 0:r.score)||0,examSongName:(null===(o=state$2.activeDetail)||void 0===o?void 0:o.examSongName)||""};state$2.isPercussion||(h.intonation=null===(l=a.value)||void 0===l?void 0:l.intonation,h.cadence=null===(u=a.value)||void 0===u?void 0:u.cadence,h.integrity=null===(c=a.value)||void 0===c?void 0:c.integrity);return"".concat(location.origin).concat(s,"/share-colexiu-evaluating/index.html?").concat(queryString.stringify(h))},l=function(e){var t=e.target;t&&(t.contentWindow.setPng=function(e){r.value=e})},u=function(){r.value&&postMessage({api:"shareAchievements",content:{title:"分享我的乐器练习进度,一起见证我的成长!",desc:"晒一下我的评测分数,快来“小酷AI”上和我PK一下吧!",image:r.value,video:"",type:"image",button:["copy"],url:o()}},(function(e){var t,n,r;(null!=e&&null!==(t=e.content)&&void 0!==t&&t.status&&(i.value=!1),null!=e&&null!==(n=e.content)&&void 0!==n&&n.message)&&Toast(null==e||null===(r=e.content)||void 0===r?void 0:r.message)}))},c=function(){var e;postMessage({api:"openWebView",content:{url:location.origin+s+"/colexiu-report.html?source=evaluation&musicId="+search$2.id+"&id="+(null===(e=a.value)||void 0===e?void 0:e.recordId)||"",orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0}})};return function(){var e,t,r=getLeveByScoreId(null===(e=a.value)||void 0===e?void 0:e.score);return createVNode("div",null,[createVNode("div",{class:styles$e.box},[createVNode("div",{class:styles$e.wrap},[createVNode("div",{class:styles$e.wrapContainer},[createVNode("div",{class:styles$e.top},[createVNode("div",{class:styles$e.title},[createVNode("div",{style:{position:"relative",zIndex:1,"white-space":"nowrap"}},[createVNode("span",{class:styles$e.num},[null===(t=a.value)||void 0===t?void 0:t.score]),createVNode("span",{class:styles$e.txt},[createTextVNode("分 "),scoreInfos[r].mome])]),createVNode("div",{class:styles$e.line},null)]),createVNode("img",{class:styles$e.iconTop,src:scoreInfos[r].img},null)]),createVNode("div",{class:styles$e.evaluatWrap},[createVNode(Grid,null,{default:function(){return[createVNode(GridItem,null,{icon:function(){return createVNode("div",null,[createVNode("img",{class:styles$e.evaluatIcon,src:IntonationIcon},null),createVNode("span",{class:styles$e.evaluatTitle},[createTextVNode("音准")])])},text:function(){var e;return createVNode("span",{class:styles$e.fraction},[null===(e=a.value)||void 0===e?void 0:e.intonation,createVNode("span",null,[createTextVNode("分")])])}}),createVNode("div",{class:styles$e.line},null),createVNode(GridItem,null,{icon:function(){return createVNode("div",null,[createVNode("img",{class:styles$e.evaluatIcon,src:CadenceIcon},null),createVNode("span",{class:styles$e.evaluatTitle},[createTextVNode("节奏")])])},text:function(){var e;return createVNode("span",{class:styles$e.fraction},[null===(e=a.value)||void 0===e?void 0:e.cadence,createVNode("span",null,[createTextVNode("分")])])}}),createVNode("div",{class:styles$e.line},null),createVNode(GridItem,null,{icon:function(){return createVNode("div",null,[createVNode("img",{class:styles$e.evaluatIcon,src:IntegrityIcon},null),createVNode("span",{class:styles$e.evaluatTitle},[createTextVNode("完整性")])])},text:function(){var e;return createVNode("span",{class:styles$e.fraction},[null===(e=a.value)||void 0===e?void 0:e.integrity,createVNode("span",null,[createTextVNode("分")])])}})]}})]),createVNode("div",{class:styles$e.tips},[scoreInfos[r].tips])]),createVNode("div",{class:styles$e.btns},[state$2.frozenMode?null:createVNode(Button,{onClick:function(){state.evaluatingStatus=!1,onChangeModelType("practice")}},{default:function(){return[createVNode("img",{class:styles$e.btnIcon,src:iconLianxi},null)]}}),createVNode(Button,{style:{margin:"0 4px"},onClick:function(){return n("restart")}},{default:function(){return[createVNode("img",{class:styles$e.btnIcon,src:TryIcon},null)]}}),createVNode(Button,{onClick:c},{default:function(){return[createVNode("img",{class:styles$e.btnIcon,src:iconReport,alt:"查看报告"},null)]}})]),createVNode("div",{class:styles$e.rigthBtns},[createVNode("div",{class:styles$e.skepBtn,onClick:function(){return n("upload")}},[createVNode("img",{src:iconUpload},null),createTextVNode("上传")]),createVNode("div",{class:styles$e.skepBtn,onClick:function(){return i.value=!0}},[createVNode("img",{src:iconShare},null),createTextVNode("分享")])])]),createVNode(Popup,{teleport:"body",show:i.value,style:{background:"transparent"}},{default:function(){return[createVNode("div",{style:{textAlign:"right"}},[createVNode(Button,{class:styles$e.sbtn,onClick:u,round:!0,type:"primary",color:"#2DC7AA"},{default:function(){return[createTextVNode("分享")]}}),createVNode(Button,{class:styles$e.sbtn,onClick:function(){return i.value=!1},round:!0},{default:function(){return[createTextVNode("关闭")]}})]),createVNode("iframe",{style:{width:"50vw",border:"none",height:"70vh",marginTop:"1vh"},src:o(),onLoad:l},null)]}}),createVNode(Button,{class:styles$e.button,icon:backIcon,onClick:function(){return n("restart")}},null)])])}}}),evaluatingShow=ref(!1),open=ref(!1),Evaluating=defineComponent({name:"ColexiuEvaluating",props:{data:{type:Object,default:function(){return null}}},emits:["restart"],setup:function(e){var t=ref(!1),n=state$4.sett.camera&&state$4.eva.save;console.log(state$4.sett.camera,state$4.eva.save);var i=function(t){var n,i;postMessage({api:"proxyServiceMessage",content:{header:{commond:"videoUpload",status:200,type:"SOUND_COMPARE"},body:{filePath:null==t||null===(n=t.content)||void 0===n?void 0:n.filePath,recordId:null===(i=e.data)||void 0===i?void 0:i.recordId}}})},r=function(){n?postMessage({api:"videoUpdate"},(function(e){if(t.value=!1,null!=e&&e.content){if("error"===e.content.type)return void Toast(e.content.message);i(e)}})):(t.value=!1,i(),Toast.success("上传成功"))};return function(){return createVNode("div",null,[createVNode(Popup,{position:"bottom",show:evaluatingShow.value,"onUpdate:show":function(e){return evaluatingShow.value=e},onOpen:function(){return open.value=!0},onClosed:function(){return open.value=!1},teleport:"body",style:{backgroundColor:"transparent"}},{default:function(){return[open&&createVNode(Content,{data:e.data,onUpload:function(){return t.value=!0},onRestart:function(){return evaluatingShow.value=!1}},null)]}}),createVNode(Dialog.Component,{teleport:"body",class:styles$e.confirm,style:{overflow:"initial"},show:t.value,"onUpdate:show":function(e){return t.value=e},message:"评测".concat(n?"音视频":"音频","是否保存演奏?")},{title:function(){return createVNode("img",{class:styles$e.iconTitle,src:iconTitle},null)},footer:function(){return createVNode("div",{class:styles$e.footer},[createVNode("img",{src:iconCancel,onClick:function(){return t.value=!1}},null),createVNode("img",{src:iconConfirm,onClick:r},null)])}})])}}}),soundNeedShow=function(){if(state.evaluatingStatus&&!permissionPopup.show){var t=-1,n=localStorage.getItem(storeKeys.lastCheckTime);try{var i=dayjs(parseFloat(n||"0"));i.isValid()&&(t=Math.abs(i.diff(dayjs((new Date).valueOf()),"day")))}catch(e){}(state$4.sett.tuning||t>0||!n)&&(soundEffectShow.value=!0)}},setWiredStatus=function(e){state.evaluatingStatus?(permissionPopup.active="earphone",permissionPopup.show=!(null!=e&&e.content.checkIsWired),soundNeedShow()):permissionPopup.show=!1},useWiredHeadsetCheck=exports("y",(function(){var e=ref(!1);return watch((function(){return state.evaluatingStatus}),(function(){postMessage({api:"isWiredHeadsetOn"},setWiredStatus)})),watch((function(){return permissionPopup.show}),(function(){soundNeedShow()})),watch([function(){return state.evaluatingStatus}],(function(){Toast.clear(),state.evaluatingStatus||(state.evaluatingTips=!1,pause(),setCurrentTime(0)),state$4.sett.fingering&&event.emit("settingFingeringChange")})),watch([function(){return state.evaluatingStatus},function(){return permissionPopup.show},function(){return soundEffectShow.value}],(function(t){var n=_slicedToArray(t,3),i=n[0],r=n[1],a=n[2];e.value=i&&!r&&!a,state.evaluatingStatus||(state$2.evaluatings={},evaluatingShow.value=!1)})),onMounted((function(){listenerMessage("listenerWiredStatus",setWiredStatus)})),onBeforeUnmount((function(){removeListenerMessage("listenerWiredStatus",setWiredStatus)})),[e]})),browserInfo$2=browser(),useFee=exports("ad",(function(e,t){var n,i,r;console.log("maxtime",e,t);var a=(null===(n=state$2.activeDetail)||void 0===n?void 0:n.orderStatus)||t,s=useOriginSearch().setting||{};if(!(null!==(i=state$2.activeDetail)&&void 0!==i&&i.play||"FREE"===s.feeType)){var o=useClientType();if((browserInfo$2.isApp||"web"!==o)&&!(null!=e&&e.includes("VIP")&&(null===(r=state$3.user)||void 0===r?void 0:r.membershipDays)>0||null!=e&&e.includes("CHARGE")&&"PAID"===a)){var l=ref(-1),u=state$2.times[state$2.times.length-1];u&&(l.value=Math.max(10,u.time*state$2.freeRate));var c=function(n){var i,r,a=(null===(i=state$2.activeDetail)||void 0===i?void 0:i.orderStatus)||t;if("web"!=o&&(l.value>=0&&state.currentTimeNum>=l.value))if(null!=e&&e.includes("CHARGE")&&e.includes("VIP"))"PAID"===a||(null===(r=state$3.user)||void 0===r?void 0:r.membershipDays)>0||(permissionPopup.active="memberAndDemand",permissionPopup.show=!0,pause());else if("CHARGE"===e)"PAID"!==a&&(permissionPopup.active="demand",permissionPopup.show=!0,pause());else if("VIP"===e){var s;(null===(s=state$3.user)||void 0===s?void 0:s.membershipDays)>0||(permissionPopup.active="member",permissionPopup.show=!0,pause())}};state.audiosInstance.event.on("timeupdate",c),listenerMessage("cloudTimeUpdae",c),onBeforeUnmount((function(){state.audiosInstance.event.off("timeupdate",c),removeListenerMessage("cloudTimeUpdae",c)}))}}})),search$1=useOriginSearch(),browserInfo$1=browser(),useClientType=exports("L",(function(){var e=useOriginSearch();if(e.client)return e.client;var t=0===location.pathname.indexOf("/orchestra-student/")||browserInfo$1.isStudent,n=0===location.pathname.indexOf("/orchestra-teacher/")||browserInfo$1.isTeacher;return t?"student":n?"teacher":"web"})),MemberDefaultData={membershipDays:1},useUpdateMember=function(){var e=getRequestHostname();request.get("/musicSheet/detail/".concat(search$1.id),{prefix:e}).then((function(e){state$2.activeDetail&&(state$2.activeDetail.orderStatus=e.data.orderStatus,state$2.activeDetail.play=e.data.play)}))},useUser=exports("a7",(function(){var e=usePageVisibility(),t=function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,n,i,r,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,"student"!==(t=useClientType())){e.next=8;break}return e.next=5,request.get("/appLoginUser/getUserInfo");case 5:n=e.sent,i=n.data,state$3.user=i;case 8:if("teacher"!==t){e.next=14;break}return e.next=11,request.get("/appLoginUser/getUserInfo",{prefix:"/api-teacher"});case 11:r=e.sent,a=r.data,state$3.user=_objectSpread2(_objectSpread2({},MemberDefaultData),a);case 14:"web"===t&&(state$3.user=_objectSpread2({},MemberDefaultData)),e.next=19;break;case 17:e.prev=17,e.t0=e.catch(0);case 19:case"end":return e.stop()}}),e,null,[[0,17]])})));return function(){return e.apply(this,arguments)}}();t(),watch(e,function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(n){var i,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:permissionPopup.show=!1,"visible"===n&&0===(null===(i=state$3.user)||void 0===i?void 0:i.membershipDays)&&t(),"visible"===n&&"PAID"!==(null===(r=state$2.activeDetail)||void 0===r?void 0:r.orderStatus)&&useUpdateMember();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())})),typeById=exports("Y",{2:{name:"flute",direction:"transverse"},4:{name:"clarinet",direction:"vertical",width:"1rem",paddingLeft:"0rem"},5:{name:"saxophone",direction:"vertical",width:"2rem"},6:{name:"saxophone",direction:"vertical",width:"2rem"},12:{name:"trumpet",direction:"transverse",height:"80px"},13:{name:"horn",direction:"vertical",width:"3.5rem"},14:{name:"trombone",direction:"transverse",height:"80px"},15:{name:"up-bass-horn",direction:"vertical",width:"3rem"},17:{name:"tuba",direction:"vertical",width:"3rem"},120:{name:"piccolo",direction:"vertical",width:"1rem"},136:{name:"hulusi-flute",direction:"vertical",width:"1.2rem"},135:{name:"pan-flute",direction:"vertical",width:"2.5rem"},134:{name:"ocarina",direction:"vertical",width:"2rem"},137:{name:"melodica",direction:"transverse"},130:{name:"ukulele",direction:"vertical",width:"2rem"},140:{name:"mouthorgan",direction:"transverse",height:"80px"},150:{name:"piano",direction:"transverse",height:"80px"}}),relationships=exports("aU",{flute17:{59:[27,26,25,15,24,22,17,20],60:[1,2,3,5,7,9,11,12,13,15],1060:[1,2,3,5,7,9,1011,12,13,15],61:[1,2,3,5,7,9,13,15],1061:[1,2,3,5,7,9,1013,15],62:[1,2,3,5,7,9,15],1062:[1,2,3,5,7,9,1010,15],63:[1,2,3,5,7,9,10,15],1063:[1,2,3,5,7,1009,10,15],64:[1,2,3,5,7,10,15],1064:[1,2,3,5,1007,10,15],65:[1,2,3,5,10,15],1065:[1,2,3,1005,9,10,15],66:[1,2,3,9,10,15],1066:[1,2,3,1009,10,15],67:[1,2,3,10,15],1067:[1,2,3,1004,10,15],68:[1,2,3,4,10,15],1068:[[1,2,1003,4,10,15],[1,2,1003,1004,10,15]],69:[1,2,10,15],1069:[1,1002,10,14],70:[[1,5,10,15],[1,10,14]],1070:[1,1005,10,15],71:[1,10,15],1071:[1,10,1015],72:[1,10],1072:[1001,10],73:[13],1073:[1006,13],74:[2,3,5,7,9,15],1074:[2,3,5,7,9,1013,15],75:[2,3,5,7,9,10,15],1075:[2,3,5,7,9,10,15],76:[1,2,3,5,7,10,15],1076:[1,2,3,5,1007,10,15],77:[1,2,3,5,10,15],1077:[1,2,3,1005,9,10,15],78:[1,2,3,9,10,15],1078:[1,2,3,1009,10,15],79:[1,2,3,10,15],1079:[1,2,3,4,10,15],80:[1,2,3,4,10,15],1080:[1,2,1003,4,10,15],81:[1,2,10,15],1081:[1,1002,10,15],82:[[1,5,10],[1,10,14]],1082:[1,1005,10,15],83:[1,10,15],1083:[1,10,1015],84:[1,10],1084:[1001,10],85:[10],1085:[1006,10],86:[2,3,10,15],1086:[2,3,1008,10,15],87:[1,2,3,4,5,7,8,10,15],1087:[1,2,1003,4,5,7,8,10,15],88:[1,2,5,7,10,15],1088:[1,1002,5,7,10,15],89:[1,3,5,10,15],1089:[1,3,1005,9,10,15],90:[1,3,9,10,15],1090:[1,3,9,10,1015],91:[1,2,3,10],1091:[1,2,3,1006,10],92:[2,3,4,10],1092:[2,3,4,1006,10],93:[2,5,10,15],1093:[1002,5,10,15],94:[5,6,15],1094:[1,3,1005,1006,8,15],95:[1,3,8,15],1095:[1,3,8,10,1015],96:[1,2,3,4,5,11],1096:[1001,2,3,4,5,11]},flute:{59:[27,26,25,15,24,22,17,20],60:[27,26,25,15,24,22,17,20],61:[27,26,25,15,24,22,17,21],62:[27,26,25,15,24,22,17],63:[27,26,25,15,24,22,17,19],64:[27,26,25,15,24,22,19],65:[27,26,25,15,24,19],66:[27,26,25,15,17,19],67:[27,26,25,15,19],68:[27,26,25,15,18,19],69:[27,26,15,19],70:[[27,14,19],[27,24,15,19]],71:[27,15,19],72:[27,19],73:[19],74:[26,25,24,22,17,15],75:[26,25,24,22,17,19,15],76:[27,26,25,15,24,22,19],77:[27,26,25,15,24,19],78:[27,26,25,15,17,19],79:[27,26,25,15,19],80:[27,26,25,15,18,19],81:[27,26,15,19],82:[[27,14,19],[27,24,15,19]],83:[27,15,19],84:[27,19],85:[19],86:[26,25,15,19],87:[27,26,25,15,24,22,17,18,19],88:[27,26,15,24,22,19],89:[27,25,24,15,19],90:[27,25,17,15,19],91:[27,26,25,19],92:[26,25,18,19],93:[26,24,15,19],94:[23,24,15,19],95:[27,25,15,16],96:[27,26,25,18,24,19]},clarinet:{52:[[3,4,6,8,9,11,14,18,20],[3,4,6,8,9,11,14,20]],53:[[3,4,6,8,9,11,12,20],[3,4,6,8,9,11,18,20]],54:[[3,4,6,8,9,11,13,18,20],[3,4,6,8,9,11,13,20],[3,4,6,8,9,11,15]],55:[3,4,6,8,9,11,20],56:[3,4,6,8,9,11,16,20],57:[3,4,6,8,9,20],58:[3,4,6,8,20],59:[[3,4,6,9,20],[3,4,6,8,10,20]],60:[3,4,6,20],61:[3,4,6,7,20],62:[3,4,20],63:[[3,4,20,24],[3,4,5,20],[3,8,20]],64:[3,20],65:[20],66:[[3],[20,23,24]],67:[],68:[2],69:[1],70:[1,19],71:[[3,4,6,8,9,11,14,18,19,20],[3,4,6,8,9,11,14,19,20]],72:[[3,4,6,8,9,11,12,19,20],[3,4,6,8,9,11,18,19,20]],73:[[3,4,6,8,9,11,13,19,20],[3,4,6,8,9,11,13,18,19,20],[3,4,6,8,9,11,15,19,20]],74:[3,4,6,8,9,11,19,20],75:[3,4,6,8,9,11,16,19,20],76:[3,4,6,8,9,19,20],77:[3,4,6,8,19,20],78:[[3,4,6,9,19,20],[3,4,6,8,10,19,20]],79:[3,4,6,19,20],80:[3,4,6,7,19,20],81:[3,4,19,20],82:[[3,4,19,20,24],[3,4,5,19,20],[3,4,8,19,20]],83:[3,19,20],84:[19,20],85:[4,6,8,9,19,20],86:[4,6,8,16,19,20],87:[[4,6,8,10,16,19,20],[4,6,9,16,19,20]],88:[4,6,16,19,20],89:[4,6,7,16,19,20]},trumpet:{0:[1,2,3],54:[4,5,6],55:[4,2,6],56:[1,5,6],57:[4,5,3],58:[4,2,3],59:[1,5,3],60:[1,2,3],61:[4,5,6],62:[4,2,6],63:[1,5,6],64:[4,5,3],65:[4,2,3],66:[1,5,3],67:[1,2,3],68:[1,5,6],69:[4,5,3],70:[4,2,3],71:[1,5,3],72:[1,2,3],73:[4,5,3],74:[4,2,3],75:[1,5,3],76:[1,2,3],77:[4,2,3],78:[1,4,3],79:[1,2,3],80:[1,5,6],81:[4,5,3],82:[4,2,3],83:[1,5,3],84:[1,2,3]},horn:{53:[1],54:[2],55:[],56:[2,3],57:[1,2],58:[1],59:[2],60:[],61:[1,2],62:[1],63:[2],64:[],65:[1],66:[2],67:[],68:[0,2,3],69:[0,1,2],70:[0,1],71:[0,2],72:[0],73:[0,2,3],74:[0,1,2],75:[0,1],76:[0,2],77:[0],78:[0,2],79:[0],80:[0,2,3],81:[0,1,2],82:[0,1],83:[0,2],84:[0]},upBassHorn:{0:[1,2,3],40:[4,5,6],41:[4,2,6],42:[1,5,6],43:[4,5,3],44:[4,2,3],45:[1,5,3],46:[1,2,3],47:[4,5,6],48:[4,2,6],49:[1,5,6],50:[4,5,3],51:[4,2,3],52:[1,5,3],53:[1,2,3],54:[1,5,6],55:[4,5,3],56:[4,2,3],57:[1,5,3],58:[1,2,3],59:[4,5,3],60:[4,2,3],61:[1,5,3],62:[1,2,3],63:[4,2,3],64:[1,5,3],65:[1,2,3],66:[1,5,6],67:[4,5,3],68:[4,2,3],69:[1,5,3],70:[1,2,3]},trombone:{0:[1],40:[22],41:[11],42:[5],43:[4],44:[3],45:[2],46:[1],47:[22],48:[11],49:[5],50:[4],51:[3],52:[2],53:[1],54:[5],55:[4],56:[3],57:[2],58:[1],59:[4],60:[3],61:[2],62:[1],63:[3],64:[2],65:[1],66:[5],67:[4],68:[3],69:[2],70:[1]},saxophone:{58:[2,4,5,13,17,18,19,23],59:[2,4,5,11,17,18,19,23],60:[2,4,5,17,18,19,23],61:[2,4,5,12,17,18,19,23],62:[2,4,5,17,18,19],63:[2,4,5,17,18,19,22],64:[2,4,5,17,18],65:[2,4,5,17],66:[[2,4,5,18],[2,4,5,17,21]],67:[2,4,5],68:[2,4,5,10],69:[2,4],70:[[2,4,16],[2,17],[2,3]],71:[2],72:[[4],[2,15]],73:[],74:[2,4,5,6,17,18,19],75:[2,4,5,6,17,18,19,22],76:[2,4,5,6,17,18],77:[2,4,5,6,17],78:[[2,4,5,6,18],[2,4,5,6,17,21]],79:[2,4,5,6],80:[2,4,5,6,10],81:[2,4,6],82:[[2,4,6,16],[2,6,17],[2,3,6]],83:[2,6],84:[[4,6],[2,6,15]],85:[6],86:[6,9],87:[6,7,8],88:[6,8,9,14],89:[[6,7,8,9,14],[1,4,6]]},tuba:{0:[1,2,3],28:[4,5,6],29:[4,2,6],30:[1,5,6],31:[4,5,3],32:[4,2,3],33:[1,5,3],34:[1,2,3],35:[4,5,6],36:[4,2,6],37:[1,5,6],38:[4,5,3],39:[4,2,3],40:[1,5,3],41:[1,2,3],42:[1,5,6],43:[4,5,3],44:[4,2,3],45:[1,5,3],46:[1,2,3],47:[4,5,3],48:[4,2,3],49:[1,5,3],50:[1,2,3],51:[4,2,3],52:[1,5,3],53:[1,2,3],54:[1,5,6],55:[4,5,3],56:[4,2,3],57:[1,5,3],58:[1,2,3]},piccolo:{72:[11,2,33,4,5,6,7,8],73:[11,2,33,4,5,6,7,88],74:[11,2,33,4,5,6,7],75:[11,2,33,4,5,6,77],76:[11,2,33,4,5,6],77:[11,2,33,4,5,7,8],78:[11,2,33,4,6,7],79:[11,2,33,4],80:[11,2,33,5,6,77],81:[11,2,33],82:[[11,2,4,5],[11,3,4,5]],83:[[11,2],[11,33,4]],84:[11,33],85:[[2,33],[11]],86:[33],87:[33,4,5,6,7],88:[1,2,33,4,5,6],89:[1,2,33,4,5,7],90:[1,2,33,4,6],91:[1,2,33,4],92:[1,2,33,5],93:[1,2,33],94:[1,2,33,5,6,7],95:[1,2,33,5,6],96:[1,2,5,6],97:[1,2,4,5,7,8],98:[1,2,4]},smallDrum:{0:["active","active-left","active-right"],64:["left","right"]},hulusi:{59:[7,6,5,4,3,2,1],60:[7,6,5,4,3,2],61:[7,6,5,4,3],62:[7,6,5,4],63:[7,6,5],64:[7,6],65:[[7,5,4,3,2,1],[7,5,4,3,2],[7,66]],66:[7]},pan:{54:[21],56:[20],58:[19],60:[18],62:[17],64:[16],66:[15],68:[14],70:[13],72:[12],74:[11],76:[10],78:[9],80:[8],82:[7],84:[6],86:[5],88:[4],90:[3],92:[2],94:[1]},ocarina:{57:[1,2,3,4,5,6,7,8,9,10,11,12],58:[1,2,3,4,5,6,8,9,10,11,12],59:[1,2,4,5,6,8,9,10,11,12],60:[1,2,4,5,6,11,12],61:[1,2,4,5,6,7,8,9,11,12],62:[1,2,4,5,6,8,9,11,12],63:[1,2,4,5,6,8,10,11,12],64:[1,2,4,5,6,8,11,12],65:[1,2,4,5,6,11,12],66:[1,2,4,6,9,11,12],67:[1,2,4,6,11,12],68:[1,2,6,9,11,12],69:[1,2,6,11,12],70:[1,2,6,9,11,12],71:[1,6,9,11,12],72:[6,11,12],73:[2,6,12],74:[6,12],75:[2,6],76:[6],77:[]},melodica:{56:[1],57:[2],58:[3],59:[4],60:[5],61:[6],62:[7],63:[8],64:[9],65:[10],66:[11],67:[12],68:[13],69:[14],70:[15],71:[16],72:[17],73:[18],74:[19],75:[20],76:[21],77:[22],78:[23],79:[24],80:[25],81:[26],82:[27],83:[28],84:[29],85:[30],86:[31],87:[32]},ukulele:{60:[3,300],61:[3,301],62:[3,302],63:[3,303],64:[2,200],65:[2,201],66:[2,202],67:[2,203],68:[2,204],69:[1,100],70:[1,101],71:[1,102],72:[1,103],73:[1,104],74:[1,105],75:[1,106],76:[1,107],77:[1,108],78:[1,109],79:[1,110],80:[1,111],81:[1,112],82:[1,113],83:[1,114],84:[1,115],85:[1,116],86:[1,117]},mouthorgan:{53:[101],54:[1],55:[102],56:[2],57:[103],58:[3],59:[104],60:[105],61:[4],62:[106],63:[5],64:[107],65:[108],66:[6],67:[109],68:[7],69:[110],70:[8],71:[111],72:[112],73:[9],74:[113],75:[10],76:[114],77:[115],78:[11],79:[116],80:[12],81:[117],82:[13],83:[118],84:[119],85:[14],86:[120],87:[15],88:[121],89:[122]},piano:{21:[101],22:[1],23:[102],24:[103],25:[2],26:[104],27:[3],28:[105],29:[106],30:[4],31:[107],32:[5],33:[108],34:[6],35:[109],36:[110],37:[7],38:[111],39:[8],40:[112],41:[113],42:[9],43:[114],44:[10],45:[115],46:[11],47:[116],48:[117],49:[12],50:[118],51:[13],52:[119],53:[120],54:[14],55:[121],56:[15],57:[122],58:[16],59:[123],60:[124],61:[17],62:[125],63:[18],64:[126],65:[127],66:[19],67:[128],68:[20],69:[129],70:[21],71:[130],72:[131],73:[22],74:[132],75:[23],76:[133],77:[134],78:[24],79:[135],80:[25],81:[136],82:[26],83:[137],84:[138],85:[27],86:[139],87:[28],88:[140],89:[141],90:[29],91:[142],92:[30],93:[143],94:[31],95:[144],96:[145],97:[32],98:[146],99:[33],100:[147],101:[148],102:[34],103:[149],104:[35],105:[150],106:[36],107:[151],108:[152]}}),getTypes=exports("$",function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var n,i,r,a,s,o,l,u,c,h,f,d,p,m,v,g,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t,e.next="flute"===e.t0?3:"clarinet"===e.t0?7:"trumpet"===e.t0?11:"horn"===e.t0?15:"tuba"===e.t0?19:"piccolo"===e.t0?23:"up-bass-horn"===e.t0?27:"trombone"===e.t0?31:"saxophone"===e.t0?35:"small-drum"===e.t0?39:"hulusi-flute"===e.t0?43:"pan-flute"===e.t0?47:"ocarina"===e.t0?51:"melodica"===e.t0?55:"ukulele"===e.t0?59:"mouthorgan"===e.t0?63:"piano"===e.t0?67:71;break;case 3:return e.next=5,__vitePreload((function(){return module.import("./index-legacy.fa6adf21.js")}),void 0);case 5:return n=e.sent,e.abrupt("return",{json:n.default,relationship:relationships.flute,height:"60px",styles:{}});case 7:return e.next=9,__vitePreload((function(){return module.import("./index-legacy.b76912f0.js")}),void 0);case 9:return i=e.sent,e.abrupt("return",{json:i.default,relationship:relationships.clarinet,styles:{marginLeft:".4rem",marginRight:".7rem"}});case 11:return e.next=13,__vitePreload((function(){return module.import("./index-legacy.fb3b5ff7.js")}),void 0);case 13:return r=e.sent,e.abrupt("return",{json:r.default,relationship:relationships.trumpet});case 15:return e.next=17,__vitePreload((function(){return module.import("./index-legacy.c0359bda.js")}),void 0);case 17:return a=e.sent,e.abrupt("return",{json:a.default,relationship:relationships.horn,height:"212px",width:"252px"});case 19:return e.next=21,__vitePreload((function(){return module.import("./index-legacy.a40d31f0.js")}),void 0);case 21:return s=e.sent,e.abrupt("return",{json:s.default,relationship:relationships.tuba});case 23:return e.next=25,__vitePreload((function(){return module.import("./index-legacy.751aa416.js")}),void 0);case 25:return o=e.sent,e.abrupt("return",{json:o.default,relationship:relationships.piccolo});case 27:return e.next=29,__vitePreload((function(){return module.import("./index-legacy.3387fea3.js")}),void 0);case 29:return l=e.sent,e.abrupt("return",{json:l.default,relationship:relationships.upBassHorn});case 31:return e.next=33,__vitePreload((function(){return module.import("./index-legacy.5b8ff9d7.js")}),void 0);case 33:return u=e.sent,e.abrupt("return",{json:u.default,relationship:relationships.trombone});case 35:return e.next=37,__vitePreload((function(){return module.import("./index-legacy.a4e2912c.js")}),void 0);case 37:return c=e.sent,e.abrupt("return",{json:c.default,relationship:relationships.saxophone,styles:{marginLeft:".2rem",marginRight:".3rem"}});case 39:return e.next=41,__vitePreload((function(){return module.import("./index-legacy.3a52eaf3.js")}),void 0);case 41:return h=e.sent,e.abrupt("return",{json:h.default,relationship:relationships.smallDrum,width:"180px"});case 43:return e.next=45,__vitePreload((function(){return module.import("./index-legacy.c7dff827.js")}),void 0);case 45:return f=e.sent,e.abrupt("return",{json:f.default,relationship:relationships.hulusi,styles:{marginLeft:".6rem",marginRight:".7rem"}});case 47:return e.next=49,__vitePreload((function(){return module.import("./index-legacy.c4408dd6.js")}),void 0);case 49:return d=e.sent,e.abrupt("return",{json:d.default,relationship:relationships.pan,width:"240px",styles:{marginTop:"auto",marginLeft:".6rem",marginRight:".7rem"}});case 51:return e.next=53,__vitePreload((function(){return module.import("./index-legacy.9fdfdeec.js")}),void 0);case 53:return p=e.sent,e.abrupt("return",{json:p.default,relationship:relationships.ocarina,width:"180px",styles:{marginTop:"auto"}});case 55:return e.next=57,__vitePreload((function(){return module.import("./index-legacy.c8105c13.js")}),void 0);case 57:return m=e.sent,e.abrupt("return",{json:m.default,relationship:relationships.melodica,height:"80px",styles:{marginTop:"auto"}});case 59:return e.next=61,__vitePreload((function(){return module.import("./index-legacy.69114e0a.js")}),void 0);case 61:return v=e.sent,e.abrupt("return",{json:v.default,relationship:relationships.ukulele});case 63:return e.next=65,__vitePreload((function(){return module.import("./index-legacy.771b9517.js")}),void 0);case 65:return g=e.sent,e.abrupt("return",{json:g.default,relationship:relationships.mouthorgan});case 67:return e.next=69,__vitePreload((function(){return module.import("./index-legacy.dbcc0444.js")}),void 0);case 69:return y=e.sent,e.abrupt("return",{json:y.default,relationship:relationships.piano});case 71:return e.abrupt("return",null);case 72:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),container="_container_ajal8_1",changeIndex="_changeIndex_ajal8_6",activeopacity="_activeopacity_ajal8_1",leftrotates="_leftrotates_ajal8_1",rightrotates="_rightrotates_ajal8_1",styles$1={container:container,changeIndex:changeIndex,activeopacity:activeopacity,leftrotates:leftrotates,rightrotates:rightrotates},getImageSize=exports("a2",(function(e){return new Promise((function(t,n){var i=new Image;i.src=e,i.onload=function(){t(i)},i.onerror=function(e){return t(i)}}))})),formatFixedKey=exports("a0",(function(e,t){return"piccolo"===e&&state$2.times[0]?ref(t+12*(1-state$2.times[0].octaveOffset)):ref(t)})),formatRelationship=function(e,t){var n=e[t]||e[0]||[];return"number"==typeof n[0]||"string"==typeof n[0]?[n]:"object"===_typeof3(n[0])?n:[[]]},useFingeringSrc=exports("a1",(function(e,t,n){var i=ref("");return e&&"trombone"===t&&!e.relationship[n]?(i.value=e.json.full2,i):(i.value=e.json.full,i)})),FingeringComponent=exports("Z",defineComponent({name:"fingering",props:{type:{type:String,default:""},fixedKey:{type:Number,default:0},fingeringInfo:{type:Object},loaded:{type:Function,default:function(){}},viewInfo:{type:Object}},setup:function(e,t){var n=t.expose,i=toRefs(e),r=ref(null),a=ref(null),s=ref(0),o=ref(0);return n({container:r,containerWidth:s}),function(){var t,n,s,l,u,c,h,f,d,p,m,v,g,y,b;if(null===(t=i.viewInfo.value)||void 0===t||!t.activeType)return null;var _=formatFixedKey(null===(n=e.fingeringInfo)||void 0===n?void 0:n.name,i.fixedKey.value).value,S=formatRelationship(null===(s=i.viewInfo.value)||void 0===s||null===(l=s.activeType)||void 0===l?void 0:l.relationship,_||0),x=S[o.value]||[];return createVNode("div",{ref:r,class:classnames(null===(u=e.fingeringInfo)||void 0===u?void 0:u.name,styles$1.container),style:{width:"vertical"===(null===(c=e.fingeringInfo)||void 0===c?void 0:c.direction)?null===(h=e.fingeringInfo)||void 0===h?void 0:h.width:"",height:"transverse"===(null===(f=e.fingeringInfo)||void 0===f?void 0:f.direction)?(null===(d=e.fingeringInfo)||void 0===d?void 0:d.height)||"":"100%",display:"flex",paddingLeft:"vertical"===(null===(p=e.fingeringInfo)||void 0===p?void 0:p.direction)?null===(m=e.fingeringInfo)||void 0===m?void 0:m.paddingLeft:"",paddingRight:"vertical"===(null===(v=e.fingeringInfo)||void 0===v?void 0:v.direction)?null===(g=e.fingeringInfo)||void 0===g?void 0:g.paddingRight:""}},[x.includes(0)?createVNode("span",{style:{position:"absolute",top:".5vh",right:".5vw",color:"rgb(1, 193, 181)",fontWeight:"bold"}},[createTextVNode("转调")]):null,createVNode("img",{ref:a,src:null===(y=i.viewInfo.value)||void 0===y?void 0:y.fullsrc,style:{width:"auto",maxWidth:"100%",maxHeight:"ukulele"==(null===(b=e.fingeringInfo)||void 0===b?void 0:b.name)?"110%":"100%"}},null),x.map((function(t,n){var r,s,o,l,u,c,h,f,d="string"==typeof t?t.replace("active-",""):String(t);return createVNode("img",{"data-index":d,style:{position:"absolute",top:(null===(r=a.value)||void 0===r?void 0:r.offsetTop)+"px",left:(null===(s=a.value)||void 0===s?void 0:s.offsetLeft)+"px",zIndex:n,height:(null===(o=a.value)||void 0===o?void 0:o.height)+"px",width:(null===(l=a.value)||void 0===l?void 0:l.width)+"px",maxWidth:"100%",maxHeight:"ukulele"==(null===(u=e.fingeringInfo)||void 0===u?void 0:u.name)?"110%":"100%"},src:null===(c=i.viewInfo.value)||void 0===c||null===(h=c.activeType)||void 0===h||null===(f=h.json)||void 0===f?void 0:f[d]},null)})),S.length>1?createVNode("div",{role:"button",onClick:function(){var e=o.value===S.length-1?0:o.value+1;o.value=e},class:["substituteFinger",styles$1.changeIndex]},[createTextVNode("替指")]):null])}}})),formatdata={Flute:2,Clarinet:4,Trombone:14,Tuba:17,Trumpet:12,Horn:13,AltoSaxophone:6,TenorSaxophone:6,Saxophone:6,UpBassHorn:15,Melodica:137,HulusiFlute:136,PanFlute:135,Ocarina:134,Recorder:120,Ukulele:130,Mouthorgan:140,Piano:150},formatId=exports("_",(function(e){return formatdata[e]||-1})),fingeringWidth=ref(0),fingeringStatus=ref("hidden"),fingeringViewInfo=function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var n,i,r,a,s,o,l,u,c,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=t)){e.next=21;break}return e.next=4,getTypes(n.name);case 4:if(!(i=e.sent)){e.next=19;break}return r=formatFixedKey(n.name,state$2.fixedKey),a=useFingeringSrc(i,n.name,r.value),e.next=10,getImageSize(a.value);case 10:return s=e.sent,o=s.width,l=s.height,u=document.getElementById("colexiu-detail-music-sheet").clientHeight||0,c=state.evaluatingStatus?0:o,h=u/l,fingeringWidth.value=u?h*c:c,o&&(fingeringStatus.value="show"),e.abrupt("return",reactive({width:o,height:l,scale:h,usedFixedKey:r.value,fullsrc:a.value,activeType:i,detail:n}));case 19:e.next=22;break;case 21:fingeringStatus.value="hidden";case 22:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),useFingering=exports("ah",_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,n,i,r,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:"",n=ref({}),i=ref({}),e.next=5,fingeringViewInfo(typeById[formatId(t)]);case 5:return r=e.sent,n.value=(null==r?void 0:r.activeType)||{},i.value=(null==r?void 0:r.detail)||{},e.abrupt("return",[fingeringStatus,fingeringWidth,n,i]);case 9:case"end":return e.stop()}}),e)})))),ee=new EventEmitter,playStartTime$1=0,MultipleAudio=function(){function e(t){var n=this;_classCallCheck2(this,e),this.audios={},this.audioList=[],this.length=0,this.status="init",this.speed=90,this.muted=!1,this.audio=null,this.event=ee,this.currentTime=0,this.duration=0,this.timer=null,this.accelerateRefreshPlayer=function(){if(!n.timer){var e=n.currentTime,t=(new Date).getTime();n.timer=setInterval((function(){n.currentTime=((new Date).getTime()-t)/1e3+e,n.event.emit("timeupdate",n)}),10)}},this.clearAccelerateRefreshPlayer=function(){clearInterval(n.timer),n.timer=null},this.setVolume=function(e,t){var i=setInterval((function(){Object.values(n.audios).map((function(n){e?(n.volume-=.01,n.volume<=.01&&(n.volume=0,clearInterval(i),t&&t())):(n.volume+=.01,n.volume>=1&&(n.volume=1,clearInterval(i),t&&t())),console.log(n.volume)}))}),16.7)},this.setSongs(t)}var t,n;return _createClass2(e,[{key:"setSongs",value:(n=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var n,i,r,a,s,o,l=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.audioList=t.filter((function(e){return!!e})).map((function(e){return e})),this.audio=null,this.event.removeAllListeners(),this.audios={},n=t.filter((function(e){return!!e})).map(function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{url:t});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.next=7,Promise.all(n);case 7:i=e.sent,r=_createForOfIteratorHelper(i);try{for(r.s();!(a=r.n()).done;)s=a.value,(o=new Audio(s.url)).load(),this.audios[s.url]=o,this.audio||(this.audio=o)}catch(err){r.e(err)}finally{r.f()}this.length=n.length,this.audio&&(this.audio.addEventListener("loadedmetadata",(function(e){l.setDuration()})),this.audio.addEventListener("timeupdate",(function(e){var t;l.currentTime=(null===(t=l.audio)||void 0===t?void 0:t.currentTime)||0,l.event.emit("timeupdate",e);var n=!1;l.currentTime!==l.duration||n||(n=!0)}))),t.length&&(this.status=this.getStatus()),this.event.on("allWaiting",(function(){l.hasWaitng()&&l.event.emit("waiting")})),this.event.on("allPlaying",(function(){l.hasWaitng()||l.event.emit("playing")})),this.syncEvent();case 16:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"setDuration",value:function(e){var t=Object.values(e||this.audios||{});if(t.length){var n,i=[],r=_createForOfIteratorHelper(t);try{for(r.s();!(n=r.n()).done;){var a=n.value.duration;a>0&&i.push(a)}}catch(err){r.e(err)}finally{r.f()}var s,o=Math.floor(Math.max.apply(Math,i)-Math.min.apply(Math,i));if(o>=1&&console.log("该教程原音与伴奏时长超过"+o+"秒,请修改后使用"),this.duration=Math.min.apply(Math,i),this.duration>0)null===(s=this.event)||void 0===s||s.emit("loadedmetadata",null,this.duration)}}},{key:"destroyed",value:function(){this.pause(),this.event.removeAllListeners(),this.audio=null,this.audios={}}},{key:"hasWaitng",value:function(){for(var e=!1,t=0,n=Object.values(this.audios);t-1&&stopTick(),console.log(state.playState),"play"===state.playState&&(resetPlayStatus(),state.evaluatingStatus&&evaluatStopPlay(!1))}))})),event=exports("a6",new EventEmitter),browserInfo=browser(),initBehaviorId=""+(new Date).valueOf(),getLinkId=function(){var e=useOriginSearch().id;return location.hash.split("?")[0].split("/").pop()||e||""},getFixTime=exports("aI",(function(e){var t=getDuration(state.osmd),n=t.numerator||0,i=t.denominator||4;return state$2.repeatedBeats&&(n=2===n?4:n),state$2.needTick||state$2.skipTick?0:60*i/e/i*n})),prevIndex=0,state=exports("c",reactive({songs:{},playState:"init",sectionHint:new SectionHint,audiosInstance:null,mode:"music",isFirstPlay:!0,metro:null,metroing:!1,duration:"0:00",durationNum:0,currentTime:"0:00",currentTimeNum:0,loading:!1,speed:90,browser:browser(),speedShow:!1,progressShow:!1,touched:!1,osmd:null,tickPlayer:null,evaluatingStatus:!1,evaluatingTips:!1,clickTime:0,evaluatingFixTime:0,cameraStatus:!1,captureStatus:!1,ticking:!1,partIndex:0,activeIndex:0})),syncStepIndex=function(e){var t;!1!==state.osmd.hidden&&state.osmd.cursor.show(),prevIndex=e,setStepIndex(state.osmd,e),refreshIndex(null===(t=state$2.times[e])||void 0===t?void 0:t.time)};watchEffect((function(){state$2.maskStatus="play"===state.playState}));var syncPlayState=function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!state$2.activeDetail.isAppPlay){e.next=8;break}return e.next=3,promisefiyPostMessage({api:"cloudGetMediaStatus"});case 3:t=e.sent,n=null==t?void 0:t.content.status,state.playState=n,e.next=9;break;case 8:state.playState=state.audiosInstance.getStatus();case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),setCurrentTime=exports("J",(function(e){console.log("setCurrentTime",e);var t=e;state$2.fixedKey=0,state.currentTimeNum=t,state.currentTime=formatTime(t),state$2.activeDetail.isAppPlay?promisefiyPostMessage({api:"cloudSetCurrentTime",content:{currentTime:1e3*e,songID:state$2.activeDetail.examSongId}}):state.audiosInstance.setCurrentTime(t),refreshView(),syncPlayState();var n=getIndex(state$2.times,state.currentTimeNum);syncStepIndex(n)})),getActiveMidiId=function(){var e,t,n,i,r,a,s;return null!==(e=null===(t=state.osmd)||void 0===t||null===(n=t.sheet)||void 0===n||null===(i=n.instruments)||void 0===i||null===(r=i[0])||void 0===r||null===(a=r.subInstruments)||void 0===a||null===(s=a[0])||void 0===s?void 0:s.midiInstrumentID)&&void 0!==e?e:0},changeMode=exports("w",function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var n,i,r,a,s,o,l,u,c,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="background"===t?"music":"background",console.log(!state.songs[t],t,r),state$2.activeDetail.isAppPlay){a=new Map,s=_createForOfIteratorHelper(state$2.partListNames);try{for(s.s();!(o=s.n()).done;)l=o.value,a.set(l,60)}catch(err){s.e(err)}finally{s.f()}u=_createForOfIteratorHelper(getVoicePartInfo().partListNames);try{for(u.s();!(c=u.n()).done;)h=c.value,a.set(h,"background"===r?100:0)}catch(err){u.e(err)}finally{u.f()}promisefiyPostMessage({api:"cloudVolume",content:{activeMidiId:getActiveMidiId(),activeMidiVolume:"background"===r?100:0,parts:Array.from(a.keys()).map((function(e){return{name:e,volume:a.get(e)}}))}})}state.mode=t,null===(n=state.audiosInstance)||void 0===n||n.setMute(!0,state.songs[r]),null===(i=state.audiosInstance)||void 0===i||i.setMute(!1,state.songs[t]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),changeAllMode=exports("aG",(function(){var e;if(null!==(e=state$2.activeDetail)&&void 0!==e&&e.isAppPlay){var t,n=new Map,i=_createForOfIteratorHelper(state$2.partListNames);try{for(i.s();!(t=i.n()).done;){var r=t.value;n.set(r,1)}}catch(err){i.e(err)}finally{i.f()}promisefiyPostMessage({api:"cloudVolume",content:{activeMidiId:getActiveMidiId(),activeMidiVolume:100,parts:Array.from(n.keys()).map((function(e){return{name:e,volume:n.get(e)}}))}})}else{var a;state.mode="background",null===(a=state.audiosInstance)||void 0===a||a.setMute(!0)}})),changeSpeed=exports("ae",(function(e){var t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=store_legacy.get("speeds")||{};n&&(i[getLinkId()]=e,store_legacy.set("speeds",i)),state.speed=e,state$2.activeDetail&&(null===(t=state.audiosInstance)||void 0===t||t.setSpeed(e/state$2.baseSpeed),promisefiyPostMessage({api:"cloudChangeSpeed",content:{speed:e,originalSpeed:state$2.activeDetail.originalSpeed,songID:state$2.activeDetail.examSongId}}),"play"===state.playState&&syncStepIndex(getIndex(state$2.times,state.currentTimeNum)))})),resetCursor=function(){state.osmd&&(state.osmd.product?state.osmd.cursor.setPosition(_objectSpread2({},state$2.times[0].cursorBox)):state.osmd.cursor.reset(),state.osmd.cursor.hide(),state$2.fixedKey=0)},refreshIndexBase=function(e){if(!(e<0)){var t=state.osmd;t&&state$2.times[e]&&(state$2.sectionStatus||state.sectionHint.show(),state$2.times[e]&&state$2.times[e].noteElement&&state.sectionHint.showForElement(state$2.times[e]),t.product||!1!==t.cursor.hidden&&(t.cursor.reset(),t.cursor.show(),state$2.fixedKey=0),prevIndex!==e&&(setStepIndex(state.osmd,state$2.times[e].i,prevIndex),prevIndex=e),state$2.fixedKey=state$2.times[e].realKey,state$2.activeNote=state$2.times[e])}},refreshIndex=exports("R",(function(e){if(state.osmd&&(e||state.audiosInstance.audio)){var t=e||state.audiosInstance.audio.currentTime,n=getIndex(state$2.times,t);state.activeIndex=n,removeRepateBackground(n);var i=state$2.times[state$2.times.length-1];t>((null==i?void 0:i.sourceEndTime)||(null==i?void 0:i.endtime))?(state.osmd.cursor.hide(),state.sectionHint.destroy()):state$2.times[n]&&refreshIndexBase(n)}})),removeRepateBackground=function(e){if(state.evaluatingStatus&&e){var t,n,i=state$2.times[e],r=state$2.times[e+1]||i,a=null==r||null===(t=r.noteElement)||void 0===t||null===(n=t.sourceMeasure)||void 0===n?void 0:n.measureListIndex;r&&state$2.evaluatings[a]&&e>0&&(state$2.evaluatings=_objectSpread2(_objectSpread2({},state$2.evaluatings),{},_defineProperty2({},a,void 0)))}},refreshPlayer=function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var n,i,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!state.osmd||!t&&!state.audiosInstance.audio){e.next=39;break}if(i=t||state.audiosInstance.audio.currentTime,0,!(i+1<0)){e.next=7;break}return setCurrentTime(0),e.abrupt("return");case 7:if(!function(){if(state$2.sectionStatus&&2===state$2.section.length){i>=state$2.section[0].time&&(state$2.sectionFlash=!1);var e=state$2.times[state$2.section[1].i+1],t=e?0===e.halfTone?state$2.section[1].endtime:e.time:state.durationNum;return i+(browserInfo.xiaomi?.2:.08)>=t}return!1}()){e.next=23;break}if(state.audiosInstance.setMute(!0),state.osmd.cursor.hide(),null===(r=state$2.activeDetail)||void 0===r||!r.isAppPlay){e.next=16;break}pause(),e.next=18;break;case 16:return e.next=18,state.audiosInstance.pause();case 18:return setSectionModeCurrentTime(),clearAccelerateRefreshPlayer(),setTimeout((function(){return setPlayState()}),1e3),state.loading=!1,e.abrupt("return");case 23:if(!(null!==(n=state$2.activeDetail)&&void 0!==n&&n.isAppPlay&&state.durationNum+30?(setCurrentTime(getFirsrNoteByMeasureListIndex(n-1).time),state$2.sectionFlash=!0):setCurrentTime(0)}},setPlayerView=function(){console.log(state$2.sectionStatus,"detailState.sectionStatus"),console.log(state$2.needTick),state$2.sectionStatus&&(syncStepIndex(getIndex(state$2.times,state.currentTimeNum)),2===state$2.section.length?setSectionModeCurrentTime():(state$2.section=[],state$2.sectionBoundingBoxs=[],state$2.sectionStatus=!1,Toast.clear()))},cloudToggleState=function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,promisefiyPostMessage({api:"cloudGetMediaStatus"});case 2:if(t=e.sent,"init"!==(n=null==t?void 0:t.content.status)){e.next=6;break}return e.abrupt("return");case 6:if("suspend"!==n){e.next=12;break}return e.next=9,promisefiyPostMessage({api:"cloudPlay",content:{songID:state$2.activeDetail.examSongId,startTime:1e3*state.currentTimeNum,originalSpeed:state$2.activeDetail.originalSpeed,speed:state.speed,hertz:440}});case 9:startCapture(),e.next=15;break;case 12:return e.next=14,promisefiyPostMessage({api:"cloudSuspend"});case 14:endCapture();case 15:return e.next=17,promisefiyPostMessage({api:"cloudGetMediaStatus"});case 17:i=e.sent,state.playState=null==i?void 0:i.content.status,console.log(i,"cloudGetMediaStatused");case 20:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),toggleState=function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!state$2.activeDetail.isAppPlay){e.next=5;break}return e.next=3,cloudToggleState();case 3:e.next=13;break;case 5:return console.log(state$2.activeDetail),console.log("delay",t),state.isFirstPlay=!1,setPlayerView(),e.next=11,state.audiosInstance.togglePlay(t);case 11:state.evaluatingStatus||changeMode(state.mode),state.playState=state.audiosInstance.getStatus();case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),setActiveKey=function(e){state$2.activeTick=e},setTickStop=function(){console.log("节拍器结束",(new Date).getTime()-state.clickTime),state$2.activeTick=-1,state$2.activeTickRepeat=1,toggleState(getTickTime(state.speed/state$2.baseSpeed))},timeliner=-1,clearIntervalTimeline=exports("aK",(function(){clearInterval(timeliner)})),onTickDestroy=function(){event.emit("tickDestroy")},setTick=function(e,t){console.log("ticking");var n=function(){e(),event.emit("tickEnd")};if(state$2.needTick){var i=getDuration(state.osmd),r=i.numerator,a=i.denominator;if(state.osmd.numerator&&state.osmd.denominator&&(r=state.osmd.numerator,a=state.osmd.denominator),state$2.activeDetail.isAppPlay)state.ticking=!0,postMessage({api:"cloudMetronome",content:{repeat:2===r?2:1,denominator:a,numerator:r}},(function(e){state.ticking=!1,"finish"===(null==e?void 0:e.content.status)?n():"cancel"===(null==e?void 0:e.content.status)&&event.emit("tickDestroy")}));else{var s,o,l,u,c,h,f,d=2===r?2:1;state$2.activeTickRepeat=d,console.log("ticking"),state.tickPlayer=new Player(r,(t||state.speed)/90),null===(s=state.tickPlayer)||void 0===s||s.start(r,(t||state.speed)/90,d),null===(o=state.tickPlayer)||void 0===o||o.event.off("tick",setActiveKey),null===(l=state.tickPlayer)||void 0===l||l.event.off("stop",n),null===(u=state.tickPlayer)||void 0===u||u.event.off("destroy",onTickDestroy),null===(c=state.tickPlayer)||void 0===c||c.event.on("tick",setActiveKey),null===(h=state.tickPlayer)||void 0===h||h.event.on("stop",n),null===(f=state.tickPlayer)||void 0===f||f.event.on("destroy",onTickDestroy)}}else n()},setPlayState=exports("z",_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(state$2.activeTick>-1||state.ticking)){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,syncPlayState();case 4:if(console.table({playState:state.playState,currentTime:state.currentTimeNum}),"pause"===state.playState||"suspend"===state.playState){e.next=9;break}return e.next=8,toggleState();case 8:return e.abrupt("return");case 9:console.log("设置播放"),setPlayerView(),setTick(setTickStop);case 12:case"end":return e.stop()}}),e)})))),stopTick=exports("ai",(function(){state.tickPlayer&&state.tickPlayer.destroy(),event.emit("stopTick"),state$2.activeTickRepeat=1,state$2.activeTick=-1})),windowResize=function(){var e=getIndex(state$2.times,state.currentTimeNum);setTimeout((function(){var t,n;null===(t=state.sectionHint)||void 0===t||t.showForElement(null===(n=state$2.times[e])||void 0===n?void 0:n.noteElement)}),200)},loadedmetadata=function(){state.duration=formatTime(state.audiosInstance.duration),state.durationNum=state.audiosInstance.duration},prevDiff=0,viewing=!1,refreshView=function(){var e,t=void 0,n=void 0;null!=state&&null!==(e=state.osmd)&&void 0!==e&&e.product&&(t=state.osmd.cursor.img,n=document.querySelector("#colexiu-detail-music-sheet"));var i=Math.max(parseFloat((t||state.osmd.cursor.cursorElement).style.top),0);Math.abs(prevDiff-i)>10&&!viewing&&(viewing=!0,setTimeout((function(){viewing=!1,(n||("colexiu"===state$3.clintNmae?state.osmd.container.parentElement.parentElement:state.osmd.container.parentElement)).scrollTo({top:i,left:0,behavior:"smooth"}),prevDiff=i}),100))},updatePlayTime=function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var n,i,r,a,s,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(state.evaluatingStatus){e.next=28;break}if(n=useOriginSearch(),i=sessionStorage.getItem("behaviorId")||n.behaviorId||initBehaviorId,r=getRequestHostname(),a=useClientType(),console.log("🚀 ~ clientType",a),s=n.feature||"PRACTICE","web"!==a){e.next=9;break}return e.abrupt("return");case 9:return e.prev=9,e.next=12,request.post("/musicPracticeRecord/save",{prefix:r,requestType:"json",data:{musicSheetId:getLinkId(),sysMusicScoreId:getLinkId(),feature:s,playTime:t,deviceType:getPlatform(),behaviorId:i}});case 12:o=e.sent,event.emit("updatePlayTimeSuccess",o.data),e.next=18;break;case 16:e.prev=16,e.t0=e.catch(9);case 18:if(!n.lessonTrainingId){e.next=28;break}return e.prev=19,console.log(r),e.next=23,request.post("/studentLessonTraining/lessonTrainingRecord",{prefix:r,requestType:"json",data:{materialType:"SONG",record:{clientType:null==a?void 0:a.toLocaleUpperCase(),feature:"LESSON_TRAINING",deviceType:browserInfo.android?"ANDROID":browserInfo.isApp?"IOS":"WEB",behaviorId:i,playTime:t,musicSheetId:getLinkId()},courseScheduleId:n.courseScheduleId,lessonTrainingId:n.lessonTrainingId,materialId:n.materialId}});case 23:e.sent,e.next=28;break;case 26:e.prev=26,e.t1=e.catch(19);case 28:case"end":return e.stop()}}),e,null,[[9,16],[19,26]])})));return function(t){return e.apply(this,arguments)}}(),setAudioInit=exports("af",(function(){state.audiosInstance.event.on("loadedmetadata",loadedmetadata),state.audiosInstance.event.on("waiting",waiting),state.audiosInstance.event.on("playing",playing),state.audiosInstance.event.on("play",play,!1),state.audiosInstance.event.on("pause",pause,!1),state.audiosInstance.event.on("ended",ended,!1),state.audiosInstance.event.on("updatePlayTime",updatePlayTime,!1),listenerMessage("cloudplayed",_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,syncPlayState();case 2:state.currentTimeNum=0,state.currentTime="00:00",state.audiosInstance.event.emit("ended",new Event("ended"));case 5:case"end":return e.stop()}}),e)})))),listenerMessage("cloudTimeUpdae",(function(e){var t=(null==e?void 0:e.content.currentTime)/1e3;"play"===state.playState&&(state.currentTimeNum=t,state.currentTime=formatTime(t),refreshPlayer(t),refreshIndex(t)),refreshView()})),state.audiosInstance.event.on("timeupdate",(function(){state.currentTimeNum=state.audiosInstance.currentTime,state.currentTime=formatTime(state.audiosInstance.currentTime),requestAnimationFrame((function(){"play"===state.audiosInstance.getStatus()&&refreshPlayer(),refreshView()}))})),window.addEventListener("resize",windowResize)})),setStepView=function(e,t){prevIndex=Math.max(e.i,0),syncStepIndex(e.i),t&&refreshPlayer(t),refreshView()},noteClick=exports("aO",(function(e){if(state.isFirstPlay)Toast("开始播放后才能调整进度");else{var t=getNoteBySlursStart(getActtiveNoteByTimes(e));if(t){var n=t.sourceStartTime||t.time;setCurrentTime(n),setStepView(t.i,n),state$2.fixedKey=t.realKey,state$2.activeNote=t}}})),playStartTime=0,startCapture=function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null!==(t=state$2.activeDetail)&&void 0!==t&&t.isAppPlay&&(playStartTime=(new Date).getTime(),console.log("startCapture",playStartTime)),state$4.sett.camera&&browserInfo.isApp&&!state.captureStatus&&state.evaluatingStatus&&state$4.eva.save&&(state.captureStatus=!0,postMessage({api:"startCapture"},(function(){postMessage({api:"setCaptureMode",content:{mode:"evaluating"}})})));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),endCapture=function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null!==(t=state$2.activeDetail)&&void 0!==t&&t.isAppPlay&&(n=(new Date).getTime()-playStartTime,0!==playStartTime&&n>0&&(null===(i=state.audiosInstance)||void 0===i||i.event.emit("updatePlayTime",n/1e3),playStartTime=0)),browserInfo.isApp&&state.evaluatingStatus&&state$4.sett.camera&&state.captureStatus&&(postMessage({api:"endCapture"},(function(){state.captureStatus=!1})),evaluatPlayerStop());case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),setCaptureMode=exports("aJ",_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:browserInfo.isApp&&state$4.sett.camera&&postMessage({api:"setCaptureMode",content:{mode:state.evaluatingStatus?"evaluating":"practice"}});case 1:case"end":return e.stop()}}),e)})))),section="_section_fxysl_1",measure="_measure_fxysl_1",dontTransition="_dontTransition_fxysl_5",after="_after_fxysl_5",img="_img_fxysl_22",font="_font_fxysl_30",bad="_bad_fxysl_35",good="_good_fxysl_43",great="_great_fxysl_51",perfect="_perfect_fxysl_58",noteWrap="_noteWrap_fxysl_80",noteBase="_noteBase_fxysl_86",noteRight="_noteRight_fxysl_89",noteError="_noteError_fxysl_92",flash="_flash_fxysl_124",restFlag="_restFlag_fxysl_127",restFlagActive="_restFlagActive_fxysl_141",flicker="_flicker_fxysl_1",styles={section:section,measure:measure,dontTransition:dontTransition,after:after,img:img,font:font,bad:bad,good:good,great:great,perfect:perfect,noteWrap:noteWrap,noteBase:noteBase,noteRight:noteRight,noteError:noteError,flash:flash,restFlag:restFlag,restFlagActive:restFlagActive,flicker:flicker},restPromptData=reactive({list:[]}),restPromptMain=exports("ag",(function(e){calculateMergeRest(e)}));function calculateMergeRest(e){var t,n=[],i=document.querySelector("#osmdSvgPage1"),r=(null===(t=i.getAttribute("viewBox"))||void 0===t?void 0:t.split(" "))||[],a=Number(i.getAttribute("width"))/Number(r[2]);a=isNaN(a)?1:a;for(var s=function(t){var i,r,s,o,l,u,c=e[t],h=(null==c||null===(i=c.noteElement)||void 0===i||null===(r=i.sourceMeasure)||void 0===r?void 0:r.MeasureNumberXML)||-1,f=(null==c||null===(s=c.noteElement)||void 0===s||null===(o=s.sourceMeasure)||void 0===o?void 0:o.multipleRestMeasures)||0,d=(null==c||null===(l=c.noteElement)||void 0===l||null===(u=l.sourceMeasure)||void 0===u?void 0:u.allRests)||!1,p=n.find((function(e){return e.measureNumberXML===h}));if(!p&&d&&f>1){var m,v,g=getStaveBox(null==c||null===(m=c.stave)||void 0===m||null===(v=m.attrs)||void 0===v?void 0:v.id,a);n.push({measureNumberXML:h,allRests:d,multipleRestMeasures:f,staveBox:g})}},o=0;o=0&&t0&&void 0!==a[0]?a[0]:{},i=t.score,r=i||c.value,Toast("加载中,请稍后..."),setTimeout(_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(f&&f.value&&r)){e.next=18;break}return e.next=3,f.value.clear();case 3:return d(),e.prev=4,state$2.section=[],state$2.sectionStatus=!1,e.next=9,useOsmdLoader(f.value,r);case 9:n("rerender",f.value),event$1.emit("loaded"),g(),e.next=18;break;case 14:e.prev=14,e.t0=e.catch(4),console.error(e.t0),n("renderError");case 18:case"end":return e.stop()}}),e,null,[[4,14]])}))),100);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),v=function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===(t=f.value)||void 0===t?void 0:t.render();case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),g=function(){for(var e=Array.from(h.value.querySelectorAll(".staffline")),t=function(t,n){var i=e[n],r=i.getBBox(),a=r.y+r.height/2,s=Array.from(i.querySelectorAll(".vf-measure")),o=Array.from(i.querySelectorAll(".vf-curve")),l=Array.from(i.querySelectorAll(".vf-measure > .vf-voices")),u=Array.from(i.querySelectorAll(".vf-measure > .vf-beams")),c=Array.from(i.querySelectorAll(".vf-ties")),h=Array.from(i.querySelectorAll(".vf-line")),f=Array.from(i.querySelectorAll(".vf-measure > .vf-stave text"));Array.from(i.querySelectorAll(".vf-measure > .vf-stave rect[fill=none]"));var d=Array.from(i.querySelectorAll(".vf-measure .vf-staveSection")),p=["To Coda","D.S. al Coda","Coda"];f.filter((function(e){return p.includes(e.textContent||"")})).forEach((function(e){u.forEach((function(t){var n=b(e,t),i=null==e?void 0:e.previousSibling;if(n.isCollision){var r,a=Number(e.getAttribute("y"))-(n.b1-n.t2)-4+"";e.setAttribute("y",a),i&&"0.3"===i.getAttribute("stroke-width")&&"none"===i.getAttribute("stroke")&&((null===(r=i.getAttribute("d"))||void 0===r?void 0:r.length)||0)>3e3&&(i.style.transform="translateY(".concat(-(n.b1-n.t2+4),"px)"))}})),l.forEach((function(t){var n=b(e,t),i=null==e?void 0:e.previousSibling;if(n.isCollision){var r,a=Number(e.getAttribute("y"))-(n.b1-n.t2)-4+"";e.setAttribute("y",a),i&&"0.3"===i.getAttribute("stroke-width")&&"none"===i.getAttribute("stroke")&&((null===(r=i.getAttribute("d"))||void 0===r?void 0:r.length)||0)>3e3&&(i.style.transform="translateY(".concat(-(n.b1-n.t2+4),"px)"))}}))})),d.forEach((function(e){var t=0;[].concat(_toConsumableArray2(o),_toConsumableArray2(c),_toConsumableArray2(l)).forEach((function(n){var i=b(e,n);i.isCollision&&(t=Math.min(t,i.t2-i.b1-4))})),e.style.transform="translateY(".concat(t,"px)")}));for(var m=Array.from(i.querySelectorAll(".vf-text > text")).filter((function(e){return e.getBBox().y text")).filter((function(e){return e.getBBox().y1&&x.forEach((function(e){e.setAttribute("y",S+"")})),m.forEach((function(e){[].concat(_toConsumableArray2(o),_toConsumableArray2(s),_toConsumableArray2(h)).forEach((function(t){var n=b(e,t);if(n.isCollision&&n.b1 text")).filter((function(e){return e.getBBox().y>a})),k=Array.from(i.querySelectorAll(".vf-line")).filter((function(e){return e.getBBox().y>a})),E=0;Ei.x1+i.w1?Math.abs(i.y2-i.y1)>10&&r.setAttribute("y",i.y1+i.h2/2+""):Math.abs(i.x2-i.x1)10&&r.setAttribute("y",i.y1+i.h2/2+"")):(r.setAttribute("x",i.x1+i.w1+5+""),Math.abs(i.y2-i.y1)>10&&r.setAttribute("y",i.y1+i.h2/2+""))}else if(2===n.length){var a=n[0].result,s=n[0].text,o=n[1].result,l=n[1].text;s.setAttribute("x",a.x1-a.w2-5+""),Math.abs(a.y2-a.y1)>10&&s.setAttribute("y",a.y1+a.h2/2+""),l.setAttribute("x",o.x1+o.w1+5+""),Math.abs(o.y2-o.y1)>10&&l.setAttribute("y",o.y1+o.h2/2+"")}})),w.forEach((function(e){w.forEach((function(t){if(e.parentNode!==t.parentNode&&!["marcato","legato","cresc.","Cantabile"].includes(e.textContent))if(["marcato","legato","cresc.","Cantabile"].includes(t.textContent)){if(b(e,t,30,30).isCollision){var n=e.getBBox();t.setAttribute("x",n.x+n.width+5+""),t.setAttribute("y",n.y+n.height-5+"")}}else{var i=b(e,t);i.isCollision&&t.setAttribute("y",i.y1+i.h1+i.h2+"")}}))}))},n=0,i=e.length;n .vf-measure")),a=Array.from(h.value.querySelectorAll(".staffline > .vf-text")),s=Array.from(h.value.querySelectorAll(".staffline > .vf-curve"));n.forEach((function(t){var o=0;[].concat(_toConsumableArray2(r),_toConsumableArray2(a),_toConsumableArray2(s)).forEach((function(e){var n=b(t,e);n.isCollision&&(n.b1n.l2||n.l10&&([].concat(_toConsumableArray2(i),_toConsumableArray2(n)).forEach((function(e){if(t!=e){var n=b(t,e,Math.abs(u),Math.abs(o));n.isCollision&&(o=n.t2-n.b1)}})),t.style.transform="translate(-".concat(u/.7,"px,").concat(o,"px)"))})),t.y<0&&e.setAttribute("height",Number(e.getAttribute("height"))-t.y+10+"")}}},b=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=e.getBBox(),a=t.getBBox(),s=r.y-i,o=r.x-n,l=r.x+r.width+n,u=r.y+r.height+i,c=a.y,h=a.x,f=a.x+a.width,d=a.y+a.height;return uf||s>d||l