music-detail.a532772d.js 268 KB

12345678910111213141516171819202122
  1. import{d as Oi,bN as vn,c as N,t as ve,a7 as si,U as be,$ as Ns,B as Ps,bl as An,p as Ms,bn as wn,bo as Cn,ap as Bs,aj as Tn,r as xn,a1 as En,b9 as Sn,al as kn,F as Nn,P as ni,a0 as ri,be as ai,n as Pn,g as Mn,e as Bn}from"./ResizeObserver.es.2c4c1d3a.js";import{O as Ji}from"./index.a5ba97dc.js";import{i as it,d as On,e as Fn,f as In}from"./music-img-default.7aa4a8c2.js";/* empty css */import{d as oi}from"./deep-clone.c5af4e6b.js";import{R as Rn,a as li}from"./index.45edc446.js";import{C as Ln}from"./index.fcf6c2e4.js";import{C as ui}from"./index.7b6b16d9.js";import{I as ot}from"./index.3b5da76b.js";import{S as Dn,a as Vn}from"./index.08cff628.js";import{S as Un}from"./index.1fdc5be4.js";import{P as Hn}from"./index.abc7e23d.js";import"./index.4dbec01b.js";import"./index.e423d226.js";import"./Checker.2b527b6f.js";import"./Picker.8bdb2185.js";import"./index.1379e03f.js";import"./use-tab-status.45ce52d0.js";import"./index.d308109f.js";const ci={"Acoustic Grand Piano":"\u5927\u94A2\u7434","Bright Acoustic Piano":"\u660E\u4EAE\u7684\u94A2\u7434","Electric Grand Piano":"\u7535\u94A2\u7434","Rhodes Piano":"\u67D4\u548C\u7684\u7535\u94A2\u7434","Chorused Piano":"\u52A0\u5408\u5531\u6548\u679C\u7684\u7535\u94A2\u7434",Harpsichord:"\u7FBD\u7BA1\u952E\u7434",Clavichord:"\u79D1\u62C9\u7EF4\u79D1\u7279\u7434",Celesta:"\u94A2\u7247\u7434",Glockenspiel:"\u94A2\u7247\u7434","Music box":"\u516B\u97F3\u76D2",Vibraphone:"\u98A4\u97F3\u7434",Marimba:"\u9A6C\u6797\u5DF4",Xylophone:"\u6728\u7434","Tubular Bells":"\u7BA1\u949F",Dulcimer:"\u5927\u626C\u7434","Hammond Organ":"\u51FB\u6746\u98CE\u7434","Percussive Organ":"\u6253\u51FB\u5F0F\u98CE\u7434","Rock Organ":"\u6447\u6EDA\u98CE\u7434","Church Organ":"\u6559\u5802\u98CE\u7434","Reed Organ":"\u7C27\u7BA1\u98CE\u7434",Accordian:"\u624B\u98CE\u7434",Harmonica:"\u53E3\u7434","Tango Accordian":"\u63A2\u6208\u624B\u98CE\u7434","Acoustic Guitar":"\u94A2\u5F26\u5409\u4ED6","Electric Guitar":"\u95F7\u97F3\u7535\u5409\u4ED6","Overdriven Guitar":"\u52A0\u9A71\u52A8\u6548\u679C\u7684\u7535\u5409\u4ED6","Distortion Guitar":"\u52A0\u5931\u771F\u6548\u679C\u7684\u7535\u5409\u4ED6","Guitar Harmonics":"\u5409\u4ED6\u548C\u97F3","Acoustic Bass":"\u5927\u8D1D\u53F8","Electric Bass":"\u7535\u8D1D\u53F8","Fretless Bass":"\u65E0\u54C1\u8D1D\u53F8","Slap Bass":"\u638C\u51FB","Synth Bass":"\u7535\u5B50\u5408\u6210",Violin:"\u5C0F\u63D0\u7434",Viola:"\u4E2D\u63D0\u7434",Cello:"\u5927\u63D0\u7434",Contrabass:"\u4F4E\u97F3\u5927\u63D0\u7434","Tremolo Strings":"\u5F26\u4E50\u7FA4\u98A4\u97F3\u97F3\u8272","Pizzicato Strings":"\u5F26\u4E50\u7FA4\u62E8\u5F26\u97F3\u8272","Orchestral Harp":"\u7AD6\u7434",Timpani:"\u5B9A\u97F3\u9F13","String Ensemble":"\u5F26\u4E50\u5408\u594F\u97F3\u8272","Synth Strings":"\u5408\u6210\u5F26\u4E50\u5408\u594F\u97F3\u8272","Choir Aahs":"\u4EBA\u58F0\u5408\u5531","Voice Oohs":"\u4EBA\u58F0","Synth Voice":"\u5408\u6210\u4EBA\u58F0","Orchestra Hit":"\u7BA1\u5F26\u4E50\u6572\u51FB\u9F50\u594F",Trumpet:"\u5C0F\u53F7",Trombone:"\u957F\u53F7",Tuba:"\u5927\u53F7","Muted Trumpet":"\u52A0\u5F31\u97F3\u5668\u5C0F\u53F7","French Horn":"\u6CD5\u56FD\u53F7","Brass Section":"\u94DC\u7BA1\u7EC4","Synth Brass":"\u5408\u6210\u94DC\u7BA1\u97F3\u8272","Soprano Sax":"\u9AD8\u97F3\u8428\u514B\u65AF\u7BA1","Alto Sax":"\u4E2D\u97F3\u8428\u514B\u65AF\u7BA1","Tenor Sax":"\u6B21\u4E2D\u97F3\u8428\u514B\u65AF\u7BA1","Baritone Sax":"\u4F4E\u97F3\u8428\u514B\u65AF\u7BA1",Oboe:"\u53CC\u7C27\u7BA1","English Horn":"\u82F1\u56FD\u7BA1",Bassoon:"\u5DF4\u677E","Soprano Saxophone":"\u9AD8\u97F3\u8428\u514B\u65AF\u7BA1","Alto Saxophone":"\u4E2D\u97F3\u8428\u514B\u65AF\u7BA1","Tenor Saxophone":"\u6B21\u4E2D\u97F3\u8428\u514B\u65AF\u7BA1","Baritone Saxophone":"\u4F4E\u97F3\u8428\u514B\u65AF\u7BA1",Piccolo:"\u77ED\u7B1B",Flute:"\u957F\u7B1B",Recorder:"\u7AD6\u7B1B","Soprano Recorder":"\u9AD8\u97F3\u7AD6\u7B1B","Pan Flute":"\u6392\u7BAB","Bottle Blow":"\u74F6\u6728\u7BA1",Whistle:"\u53E3\u54E8\u58F0",Ocarina:"\u9676\u7B1B",Lead:"\u5408\u6210\u4E3B\u97F3","Lead lead":"\u5408\u6210\u4E3B\u97F3","Pad age":"\u5408\u6210\u97F3\u8272",Pad:"\u5408\u6210\u97F3\u8272",FX:"\u5408\u6210\u6548\u679C \u79D1\u5E7B",Sitar:"\u897F\u5854\u5C14",Banjo:"\u73ED\u5353\u7434",Shamisen:"\u4E09\u6627\u7EBF",Koto:"\u5341\u4E09\u5F26\u7B5D",Kalimba:"\u5361\u6797\u5DF4",Bagpipe:"\u98CE\u7B1B",Fiddle:"\u6C11\u65CF\u63D0\u7434",Shanai:"\u5C71\u5948","Tinkle Bell":"\u53EE\u5F53\u94C3",Agogos:"\u963F\u6208\u6208\u94C3","Steel Drums":"\u94A2\u9F13","Taiko Drum":"\u592A\u9F13","Melodic Toms":"\u55F5\u55F5\u9F13","Synth Drums":"\u5408\u6210\u9F13","Reverse Cymbals":"\u53CD\u5411\u9572","Agogo Bells":"\u963F\u6208\u6208\u94C3","Taiko Drums":"\u592A\u9F13",Bongos:"\u90A6\u6208\u9F13","Bongo Bell":"\u90A6\u6208\u94C3",Congas:"\u5EB7\u52A0\u9F13",Guiro:"\u522E\u58F6","Guitar Fret Noise":"\u5409\u4ED6\u6362\u628A\u6742\u97F3","Breath Noise":"\u547C\u5438\u58F0",Seashore:"\u6D77\u6D6A\u58F0","Bird Tweet":"\u9E1F\u9E23","Telephone Ring":"\u7535\u8BDD\u94C3",Helicopter:"\u76F4\u5347\u673A",Applause:"\u9F13\u638C\u58F0",Gunshot:"\u67AA\u58F0","Acoustic Bass Drum":"\u5927\u9F13","Bass Drum":"\u5927\u9F13","Side Drum":"\u5C0F\u9F13\u9F13\u8FB9","Acoustic Snare":"\u5C0F\u9F13","Hand Claps":"\u62CD\u624B","Electric Snare":"\u5C0F\u9F13","Low Floor Tom":"\u4F4E\u97F3\u55F5\u9F13","Closed Hi-Hat":"\u95ED\u5408\u8E29\u9572","High Floor Tom":"\u9AD8\u97F3\u843D\u5730\u55F5\u9F13","Pedal Hi-Hat":"\u811A\u8E0F\u8E29\u9572","Low Tom":"\u4F4E\u97F3\u55F5\u9F13","Open Hi-Hat":"\u5F00\u97F3\u8E29\u9572","Low-Mid Tom":"\u4E2D\u4F4E\u97F3\u55F5\u9F13","Hi Mid Tom":"\u9AD8\u97F3\u9F13","Crash Cymbals":"\u5BF9\u9572","High Tom":"\u9AD8\u97F3\u55F5\u9F13","Ride Cymbals":"\u53EE\u53EE\u9572","Chinese Cymbals":"\u4E2D\u56FD\u9572","Ride Bell":"\u5706\u94C3",Tambourine:"\u94C3\u9F13","Splash Cymbal":"\u6E85\u97F3\u9572",Cowbell:"\u725B\u94C3","Crash Cymbal":"\u5F3A\u97F3\u94B9","Vibra-Slap":"\u98A4\u97F3\u5668","Ride Cymbal":"\u6253\u70B9\u94B9","Hi Bongo":"\u9AD8\u97F3\u90A6\u6208\u9F13","Low Bongo":"\u4F4E\u97F3\u90A6\u6208\u9F13","Mute Hi Conga":"\u5F31\u97F3\u9AD8\u97F3\u5EB7\u52A0\u9F13","Open Hi Conga":"\u5F3A\u97F3\u9AD8\u97F3\u5EB7\u52A0\u9F13","Low Conga":"\u4F4E\u97F3\u5EB7\u52A0\u9F13","High Timbale":"\u9AD8\u97F3\u5929\u5DF4\u9F13","Low Timbale":"\u4F4E\u97F3\u5929\u5DF4\u9F13","High Agogo":"\u9AD8\u97F3\u963F\u6208\u6208\u94C3","Low Agogo":"\u4F4E\u97F3\u963F\u6208\u6208\u94C3",Cabasa:"\u5361\u5DF4\u8428",Maracas:"\u6C99\u9524","Short Whistle":"\u77ED\u53E3\u54E8","Long Whistle":"\u957F\u53E3\u54E8","Short Guiro":"\u77ED\u522E\u58F6","Long Guiro":"\u957F\u522E\u58F6",Claves:"\u54CD\u68D2","Hi Wood Block":"\u9AD8\u97F3\u6728\u9C7C","Low Wood Block":"\u4F4E\u97F3\u6728\u9C7C","Mute Triangle":"\u5F31\u97F3\u4E09\u89D2\u94C1","Open Triangle":"\u5F3A\u97F3\u4E09\u89D2\u94C1","Drum Set":"\u67B6\u5B50\u9F13","Hulusi flute":"\u846B\u82A6\u4E1D",Melodica:"\u53E3\u98CE\u7434","Snare Drum":"\u5C0F\u519B\u9F13","Horn in F":"\u5706\u53F7",Triangle:"\u4E09\u89D2\u94C1",Vibrato:"\u98A4\u97F3\u7434","Suspend Cymbals":"\u540A\u9572","Suspended Cymbals":"\u540A\u9572","Tom-Toms":"\u55F5\u55F5\u9F13",Bell:"\u94C3\u94DB",Bells:"\u94C3\u94DB","Alto Clarinet":"\u4E2D\u97F3\u5355\u7C27\u7BA1","Bass Clarinet":"\u4F4E\u97F3\u5355\u7C27\u7BA1",Clarinet:"\u5355\u7C27\u7BA1",Cornet:"\u77ED\u53F7",Euphonium:"\u4E0A\u4F4E\u97F3\u53F7","crash cymbals":"\u5BF9\u9572",Castanets:"\u54CD\u677F",Shaker:"\u6C99\u9524","Mark tree":"\u97F3\u6811",Chimes:"\u7BA1\u949F","Mark Tree":"\u97F3\u6811","Tom-toms":"\u55F5\u55F5\u9F13","Hi-Hat":"\u8E29\u9572","Sleigh Bells":"\u96EA\u6A47\u94C3",Flexatone:"\u5F39\u97F3\u5668","Brake drum":"\u95F8\u9F13",Gong:"\u9523","concert tom":"\u97F3\u4E50\u4F1A\u55F5\u55F5\u9F13","brake drum":"\u8F66\u8F6E\u9F13","finger cymbal":"\u6307\u94B9","ride cymbal":"\u53EE\u53EE\u9572","Concert Toms":"\u97F3\u4E50\u4F1A\u55F5\u55F5\u9F13",Vibraslap:"\u5F39\u97F3\u5668","Wood Blocks":"\u6728\u9C7C","Temple Blocks":"\u6728\u9C7C","Wood Block":"\u6728\u9C7C","Field Drum":"\u519B\u9F13","Quad-Toms":"\u7B52\u9F13",Quads:"\u7B52\u9F13","Drums set":"\u67B6\u5B50\u9F13","High Bongo":"\u90A6\u6208",Timbales:"\u5929\u5DF4\u9F13","rain stick":"\u96E8\u68D2","String Bass":"\u5F26\u4E50\u4F4E\u97F3","Floor Tom":"\u4FA7\u55F5\u9F13","Brake Drum":"\u95F8\u9F13","Tam-tam":"\u5927\u9523",Cymbal:"\u9572",Cymbals:"\u9572"},zn=s=>{const e=s.replace(/ /g," ").toLocaleLowerCase(),t=Object.keys(ci);for(let i=0;i<t.length;i++)if(t[i].replace(/ /g," ").toLocaleLowerCase()===e)return ci[t[i]]||"";for(let i=0;i<t.length;i++){const n=t[i].replace(/ /g," ").toLocaleLowerCase();if(e.includes(n))return ci[t[i]]||""}return""},Qn="_musicDetail_1rgii_1",Wn="_musicContainer_1rgii_14",qn="_musicInfos_1rgii_25",Xn="_musicImg_1rgii_31",Yn="_info_1rgii_43",jn="_names_1rgii_49",Gn="_author_1rgii_62",Kn="_audio_1rgii_67",Jn="_showImgContainer_1rgii_83",Zn="_pdfContainer_1rgii_87",_n="_footers_1rgii_95",$n="_iconGroup_1rgii_106",er="_icon_1rgii_11",tr="_staffChange_1rgii_126";var ne={musicDetail:Qn,musicContainer:Wn,musicInfos:qn,musicImg:Xn,info:Yn,names:jn,author:Gn,audio:Kn,showImgContainer:Jn,pdfContainer:Zn,footers:_n,iconGroup:$n,icon:er,staffChange:tr};function k(s,e,t){return(e=sr(e))in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function ir(s,e){if(typeof s!="object"||s===null)return s;var t=s[Symbol.toPrimitive];if(t!==void 0){var i=t.call(s,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(s)}function sr(s){var e=ir(s,"string");return typeof e=="symbol"?e:String(e)}function nr(s,e){if(!(s instanceof e))throw new TypeError("Cannot call a class as a function")}function Zi(s,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(s,i.key,i)}}function rr(s,e,t){return e&&Zi(s.prototype,e),t&&Zi(s,t),s}function ar(s,e,t){return e in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function _i(s,e){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(s);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(s,n).enumerable})),t.push.apply(t,i)}return t}function $i(s){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_i(Object(t),!0).forEach(function(i){ar(s,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):_i(Object(t)).forEach(function(i){Object.defineProperty(s,i,Object.getOwnPropertyDescriptor(t,i))})}return s}var es={addCSS:!0,thumbWidth:15,watch:!0};function or(s,e){return function(){return Array.from(document.querySelectorAll(e)).includes(this)}.call(s,e)}function lr(s,e){if(s&&e){var t=new Event(e,{bubbles:!0});s.dispatchEvent(t)}}var pt=function(s){return s!=null?s.constructor:null},Fi=function(s,e){return!!(s&&e&&s instanceof e)},Os=function(s){return s==null},Fs=function(s){return pt(s)===Object},ur=function(s){return pt(s)===Number&&!Number.isNaN(s)},Is=function(s){return pt(s)===String},cr=function(s){return pt(s)===Boolean},hr=function(s){return pt(s)===Function},Rs=function(s){return Array.isArray(s)},Ls=function(s){return Fi(s,NodeList)},dr=function(s){return Fi(s,Element)},mr=function(s){return Fi(s,Event)},gr=function(s){return Os(s)||(Is(s)||Rs(s)||Ls(s))&&!s.length||Fs(s)&&!Object.keys(s).length},ae={nullOrUndefined:Os,object:Fs,number:ur,string:Is,boolean:cr,function:hr,array:Rs,nodeList:Ls,element:dr,event:mr,empty:gr};function pr(s){var e="".concat(s).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return e?Math.max(0,(e[1]?e[1].length:0)-(e[2]?+e[2]:0)):0}function fr(s,e){if(1>e){var t=pr(e);return parseFloat(s.toFixed(t))}return Math.round(s/e)*e}var yr=function(){function s(e,t){nr(this,s),ae.element(e)?this.element=e:ae.string(e)&&(this.element=document.querySelector(e)),ae.element(this.element)&&ae.empty(this.element.rangeTouch)&&(this.config=$i({},es,{},t),this.init())}return rr(s,[{key:"init",value:function(){s.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){s.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(e){var t=this,i=e?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach(function(n){t.element[i](n,function(r){return t.set(r)},!1)})}},{key:"get",value:function(e){if(!s.enabled||!ae.event(e))return null;var t,i=e.target,n=e.changedTouches[0],r=parseFloat(i.getAttribute("min"))||0,o=parseFloat(i.getAttribute("max"))||100,a=parseFloat(i.getAttribute("step"))||1,l=i.getBoundingClientRect(),u=100/l.width*(this.config.thumbWidth/2)/100;return 0>(t=100/l.width*(n.clientX-l.left))?t=0:100<t&&(t=100),50>t?t-=(100-2*t)*u:50<t&&(t+=2*(t-50)*u),r+fr(t/100*(o-r),a)}},{key:"set",value:function(e){s.enabled&&ae.event(e)&&!e.target.disabled&&(e.preventDefault(),e.target.value=this.get(e),lr(e.target,e.type==="touchend"?"change":"input"))}}],[{key:"setup",value:function(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},i=null;if(ae.empty(e)||ae.string(e)?i=Array.from(document.querySelectorAll(ae.string(e)?e:'input[type="range"]')):ae.element(e)?i=[e]:ae.nodeList(e)?i=Array.from(e):ae.array(e)&&(i=e.filter(ae.element)),ae.empty(i))return null;var n=$i({},es,{},t);if(ae.string(e)&&n.watch){var r=new MutationObserver(function(o){Array.from(o).forEach(function(a){Array.from(a.addedNodes).forEach(function(l){ae.element(l)&&or(l,e)&&new s(l,n)})})});r.observe(document.body,{childList:!0,subtree:!0})}return i.map(function(o){return new s(o,t)})}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),s}();const ft=s=>s!=null?s.constructor:null,Ne=(s,e)=>Boolean(s&&e&&s instanceof e),Ii=s=>s==null,Ds=s=>ft(s)===Object,br=s=>ft(s)===Number&&!Number.isNaN(s),Vt=s=>ft(s)===String,vr=s=>ft(s)===Boolean,Vs=s=>typeof s=="function",Us=s=>Array.isArray(s),Ar=s=>Ne(s,WeakMap),Hs=s=>Ne(s,NodeList),wr=s=>ft(s)===Text,Cr=s=>Ne(s,Event),Tr=s=>Ne(s,KeyboardEvent),xr=s=>Ne(s,window.TextTrackCue)||Ne(s,window.VTTCue),Er=s=>Ne(s,TextTrack)||!Ii(s)&&Vt(s.kind),Sr=s=>Ne(s,Promise)&&Vs(s.then),kr=s=>s!==null&&typeof s=="object"&&s.nodeType===1&&typeof s.style=="object"&&typeof s.ownerDocument=="object",zs=s=>Ii(s)||(Vt(s)||Us(s)||Hs(s))&&!s.length||Ds(s)&&!Object.keys(s).length,Nr=s=>{if(Ne(s,window.URL))return!0;if(!Vt(s))return!1;let e=s;s.startsWith("http://")&&s.startsWith("https://")||(e=`http://${s}`);try{return!zs(new URL(e).hostname)}catch{return!1}};var g={nullOrUndefined:Ii,object:Ds,number:br,string:Vt,boolean:vr,function:Vs,array:Us,weakMap:Ar,nodeList:Hs,element:kr,textNode:wr,event:Cr,keyboardEvent:Tr,cue:xr,track:Er,promise:Sr,url:Nr,empty:zs};const Ci=(()=>{const s=document.createElement("span"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},t=Object.keys(e).find(i=>s.style[i]!==void 0);return!!g.string(t)&&e[t]})();function Qs(s,e){setTimeout(()=>{try{s.hidden=!0,s.offsetHeight,s.hidden=!1}catch{}},e)}const Pr=Boolean(window.document.documentMode),Mr=/Edge/g.test(navigator.userAgent),Br="WebkitAppearance"in document.documentElement.style&&!/Edge/g.test(navigator.userAgent),Or=/iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1,Fr=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,Ir=/iPad|iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1;var ie={isIE:Pr,isEdge:Mr,isWebKit:Br,isIPhone:Or,isIPadOS:Fr,isIos:Ir};function Rr(s){return JSON.parse(JSON.stringify(s))}function Ws(s,e){return e.split(".").reduce((t,i)=>t&&t[i],s)}function J(s={},...e){if(!e.length)return s;const t=e.shift();return g.object(t)?(Object.keys(t).forEach(i=>{g.object(t[i])?(Object.keys(s).includes(i)||Object.assign(s,{[i]:{}}),J(s[i],t[i])):Object.assign(s,{[i]:t[i]})}),J(s,...e)):s}function qs(s,e){const t=s.length?s:[s];Array.from(t).reverse().forEach((i,n)=>{const r=n>0?e.cloneNode(!0):e,o=i.parentNode,a=i.nextSibling;r.appendChild(i),a?o.insertBefore(r,a):o.appendChild(r)})}function Ti(s,e){g.element(s)&&!g.empty(e)&&Object.entries(e).filter(([,t])=>!g.nullOrUndefined(t)).forEach(([t,i])=>s.setAttribute(t,i))}function B(s,e,t){const i=document.createElement(s);return g.object(e)&&Ti(i,e),g.string(t)&&(i.innerText=t),i}function Lr(s,e){g.element(s)&&g.element(e)&&e.parentNode.insertBefore(s,e.nextSibling)}function ts(s,e,t,i){g.element(e)&&e.appendChild(B(s,t,i))}function Se(s){g.nodeList(s)||g.array(s)?Array.from(s).forEach(Se):g.element(s)&&g.element(s.parentNode)&&s.parentNode.removeChild(s)}function Bt(s){if(!g.element(s))return;let{length:e}=s.childNodes;for(;e>0;)s.removeChild(s.lastChild),e-=1}function Rt(s,e){return g.element(e)&&g.element(e.parentNode)&&g.element(s)?(e.parentNode.replaceChild(s,e),s):null}function Ce(s,e){if(!g.string(s)||g.empty(s))return{};const t={},i=J({},e);return s.split(",").forEach(n=>{const r=n.trim(),o=r.replace(".",""),a=r.replace(/[[\]]/g,"").split("="),[l]=a,u=a.length>1?a[1].replace(/["']/g,""):"";switch(r.charAt(0)){case".":g.string(i.class)?t.class=`${i.class} ${o}`:t.class=o;break;case"#":t.id=r.replace("#","");break;case"[":t[l]=u}}),J(i,t)}function ze(s,e){if(!g.element(s))return;let t=e;g.boolean(t)||(t=!s.hidden),s.hidden=t}function V(s,e,t){if(g.nodeList(s))return Array.from(s).map(i=>V(i,e,t));if(g.element(s)){let i="toggle";return t!==void 0&&(i=t?"add":"remove"),s.classList[i](e),s.classList.contains(e)}return!1}function Lt(s,e){return g.element(s)&&s.classList.contains(e)}function qe(s,e){const{prototype:t}=Element;return(t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||function(){return Array.from(document.querySelectorAll(e)).includes(this)}).call(s,e)}function Dr(s,e){const{prototype:t}=Element;return(t.closest||function(){let i=this;do{if(qe.matches(i,e))return i;i=i.parentElement||i.parentNode}while(i!==null&&i.nodeType===1);return null}).call(s,e)}function ut(s){return this.elements.container.querySelectorAll(s)}function ee(s){return this.elements.container.querySelector(s)}function hi(s=null,e=!1){g.element(s)&&s.focus({preventScroll:!0,focusVisible:e})}const is={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},Z={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(s,e){const t=Z[s]||e!=="html5";return{api:t,ui:t&&Z.rangeInput}},pip:!(ie.isIPhone||!g.function(B("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||B("video").disablePictureInPicture)),airplay:g.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(s){if(g.empty(s))return!1;const[e]=s.split("/");let t=s;if(!this.isHTML5||e!==this.type)return!1;Object.keys(is).includes(t)&&(t+=`; codecs="${is[s]}"`);try{return Boolean(t&&this.media.canPlayType(t).replace(/no/,""))}catch{return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(()=>{const s=document.createElement("input");return s.type="range",s.type==="range"})(),touch:"ontouchstart"in document.documentElement,transitions:Ci!==!1,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},Vr=(()=>{let s=!1;try{const e=Object.defineProperty({},"passive",{get:()=>(s=!0,null)});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return s})();function ct(s,e,t,i=!1,n=!0,r=!1){if(!s||!("addEventListener"in s)||g.empty(e)||!g.function(t))return;const o=e.split(" ");let a=r;Vr&&(a={passive:n,capture:r}),o.forEach(l=>{this&&this.eventListeners&&i&&this.eventListeners.push({element:s,type:l,callback:t,options:a}),s[i?"addEventListener":"removeEventListener"](l,t,a)})}function R(s,e="",t,i=!0,n=!1){ct.call(this,s,e,t,!0,i,n)}function Ut(s,e="",t,i=!0,n=!1){ct.call(this,s,e,t,!1,i,n)}function Ri(s,e="",t,i=!0,n=!1){const r=(...o)=>{Ut(s,e,r,i,n),t.apply(this,o)};ct.call(this,s,e,r,!0,i,n)}function O(s,e="",t=!1,i={}){if(!g.element(s)||g.empty(e))return;const n=new CustomEvent(e,{bubbles:t,detail:{...i,plyr:this}});s.dispatchEvent(n)}function Ur(){this&&this.eventListeners&&(this.eventListeners.forEach(s=>{const{element:e,type:t,callback:i,options:n}=s;e.removeEventListener(t,i,n)}),this.eventListeners=[])}function Hr(){return new Promise(s=>this.ready?setTimeout(s,0):R.call(this,this.elements.container,"ready",s)).then(()=>{})}function Te(s){g.promise(s)&&s.then(null,()=>{})}function xi(s){return g.array(s)?s.filter((e,t)=>s.indexOf(e)===t):s}function Xs(s,e){return g.array(s)&&s.length?s.reduce((t,i)=>Math.abs(i-e)<Math.abs(t-e)?i:t):null}function Ys(s){return!(!window||!window.CSS)&&window.CSS.supports(s)}const ss=[[1,1],[4,3],[3,4],[5,4],[4,5],[3,2],[2,3],[16,10],[10,16],[16,9],[9,16],[21,9],[9,21],[32,9],[9,32]].reduce((s,[e,t])=>({...s,[e/t]:[e,t]}),{});function js(s){return g.array(s)||g.string(s)&&s.includes(":")?(g.array(s)?s:s.split(":")).map(Number).every(g.number):!1}function Dt(s){if(!g.array(s)||!s.every(g.number))return null;const[e,t]=s,i=(r,o)=>o===0?r:i(o,r%o),n=i(e,t);return[e/n,t/n]}function Li(s){const e=i=>js(i)?i.split(":").map(Number):null;let t=e(s);if(t===null&&(t=e(this.config.ratio)),t===null&&!g.empty(this.embed)&&g.array(this.embed.ratio)&&({ratio:t}=this.embed),t===null&&this.isHTML5){const{videoWidth:i,videoHeight:n}=this.media;t=[i,n]}return Dt(t)}function $e(s){if(!this.isVideo)return{};const{wrapper:e}=this.elements,t=Li.call(this,s);if(!g.array(t))return{};const[i,n]=Dt(t),r=100/i*n;if(Ys(`aspect-ratio: ${i}/${n}`)?e.style.aspectRatio=`${i}/${n}`:e.style.paddingBottom=`${r}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const o=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),a=(o-r)/(o/50);this.fullscreen.active?e.style.paddingBottom=null:this.media.style.transform=`translateY(-${a}%)`}else this.isHTML5&&e.classList.add(this.config.classNames.videoFixedRatio);return{padding:r,ratio:t}}function Gs(s,e,t=.05){const i=s/e,n=Xs(Object.keys(ss),i);return Math.abs(n-i)<=t?ss[n]:[s,e]}function zr(){return[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)]}const Ie={getSources(){return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter(s=>{const e=s.getAttribute("type");return!!g.empty(e)||Z.mime.call(this,e)}):[]},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:Ie.getSources.call(this).map(s=>Number(s.getAttribute("size"))).filter(Boolean)},setup(){if(!this.isHTML5)return;const s=this;s.options.speed=s.config.speed.options,g.empty(this.config.ratio)||$e.call(s),Object.defineProperty(s.media,"quality",{get(){const e=Ie.getSources.call(s).find(t=>t.getAttribute("src")===s.source);return e&&Number(e.getAttribute("size"))},set(e){if(s.quality!==e){if(s.config.quality.forced&&g.function(s.config.quality.onChange))s.config.quality.onChange(e);else{const t=Ie.getSources.call(s).find(l=>Number(l.getAttribute("size"))===e);if(!t)return;const{currentTime:i,paused:n,preload:r,readyState:o,playbackRate:a}=s.media;s.media.src=t.getAttribute("src"),(r!=="none"||o)&&(s.once("loadedmetadata",()=>{s.speed=a,s.currentTime=i,n||Te(s.play())}),s.media.load())}O.call(s,s.media,"qualitychange",!1,{quality:e})}}})},cancelRequests(){this.isHTML5&&(Se(Ie.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function Qr(s){return`${s}-${Math.floor(1e4*Math.random())}`}function Ei(s,...e){return g.empty(s)?s:s.toString().replace(/{(\d+)}/g,(t,i)=>e[i].toString())}function Wr(s,e){return s===0||e===0||Number.isNaN(s)||Number.isNaN(e)?0:(s/e*100).toFixed(2)}const lt=(s="",e="",t="")=>s.replace(new RegExp(e.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),t.toString()),Ks=(s="")=>s.toString().replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase());function qr(s=""){let e=s.toString();return e=lt(e,"-"," "),e=lt(e,"_"," "),e=Ks(e),lt(e," ","")}function Xr(s=""){let e=s.toString();return e=qr(e),e.charAt(0).toLowerCase()+e.slice(1)}function Yr(s){const e=document.createDocumentFragment(),t=document.createElement("div");return e.appendChild(t),t.innerHTML=s,e.firstChild.innerText}function jr(s){const e=document.createElement("div");return e.appendChild(s),e.innerHTML}const ns={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},te={get(s="",e={}){if(g.empty(s)||g.empty(e))return"";let t=Ws(e.i18n,s);if(g.empty(t))return Object.keys(ns).includes(s)?ns[s]:"";const i={"{seektime}":e.seekTime,"{title}":e.title};return Object.entries(i).forEach(([n,r])=>{t=lt(t,n,r)}),t}};class ht{constructor(e){k(this,"get",t=>{if(!ht.supported||!this.enabled)return null;const i=window.localStorage.getItem(this.key);if(g.empty(i))return null;const n=JSON.parse(i);return g.string(t)&&t.length?n[t]:n}),k(this,"set",t=>{if(!ht.supported||!this.enabled||!g.object(t))return;let i=this.get();g.empty(i)&&(i={}),J(i,t);try{window.localStorage.setItem(this.key,JSON.stringify(i))}catch{}}),this.enabled=e.config.storage.enabled,this.key=e.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;const e="___test";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch{return!1}}}function yt(s,e="text"){return new Promise((t,i)=>{try{const n=new XMLHttpRequest;if(!("withCredentials"in n))return;n.addEventListener("load",()=>{if(e==="text")try{t(JSON.parse(n.responseText))}catch{t(n.responseText)}else t(n.response)}),n.addEventListener("error",()=>{throw new Error(n.status)}),n.open("GET",s,!0),n.responseType=e,n.send()}catch(n){i(n)}})}function Js(s,e){if(!g.string(s))return;const t="cache",i=g.string(e);let n=!1;const r=()=>document.getElementById(e)!==null,o=(a,l)=>{a.innerHTML=l,i&&r()||document.body.insertAdjacentElement("afterbegin",a)};if(!i||!r()){const a=ht.supported,l=document.createElement("div");if(l.setAttribute("hidden",""),i&&l.setAttribute("id",e),a){const u=window.localStorage.getItem(`${t}-${e}`);if(n=u!==null,n){const c=JSON.parse(u);o(l,c.content)}}yt(s).then(u=>{if(!g.empty(u)){if(a)try{window.localStorage.setItem(`${t}-${e}`,JSON.stringify({content:u}))}catch{}o(l,u)}}).catch(()=>{})}}const Zs=s=>Math.trunc(s/60/60%60,10),Gr=s=>Math.trunc(s/60%60,10),Kr=s=>Math.trunc(s%60,10);function Ht(s=0,e=!1,t=!1){if(!g.number(s))return Ht(void 0,e,t);const i=a=>`0${a}`.slice(-2);let n=Zs(s);const r=Gr(s),o=Kr(s);return n=e||n>0?`${n}:`:"",`${t&&s>0?"-":""}${n}${i(r)}:${i(o)}`}const S={getIconUrl(){const s=new URL(this.config.iconUrl,window.location),e=window.location.host?window.location.host:window.top.location.host,t=s.host!==e||ie.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:t}},findElements(){try{return this.elements.controls=ee.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:ut.call(this,this.config.selectors.buttons.play),pause:ee.call(this,this.config.selectors.buttons.pause),restart:ee.call(this,this.config.selectors.buttons.restart),rewind:ee.call(this,this.config.selectors.buttons.rewind),fastForward:ee.call(this,this.config.selectors.buttons.fastForward),mute:ee.call(this,this.config.selectors.buttons.mute),pip:ee.call(this,this.config.selectors.buttons.pip),airplay:ee.call(this,this.config.selectors.buttons.airplay),settings:ee.call(this,this.config.selectors.buttons.settings),captions:ee.call(this,this.config.selectors.buttons.captions),fullscreen:ee.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=ee.call(this,this.config.selectors.progress),this.elements.inputs={seek:ee.call(this,this.config.selectors.inputs.seek),volume:ee.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:ee.call(this,this.config.selectors.display.buffer),currentTime:ee.call(this,this.config.selectors.display.currentTime),duration:ee.call(this,this.config.selectors.display.duration)},g.element(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`)),!0}catch(s){return this.debug.warn("It looks like there is a problem with your custom controls HTML",s),this.toggleNativeControls(!0),!1}},createIcon(s,e){const t="http://www.w3.org/2000/svg",i=S.getIconUrl.call(this),n=`${i.cors?"":i.url}#${this.config.iconPrefix}`,r=document.createElementNS(t,"svg");Ti(r,J(e,{"aria-hidden":"true",focusable:"false"}));const o=document.createElementNS(t,"use"),a=`${n}-${s}`;return"href"in o&&o.setAttributeNS("http://www.w3.org/1999/xlink","href",a),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a),r.appendChild(o),r},createLabel(s,e={}){const t=te.get(s,this.config);return B("span",{...e,class:[e.class,this.config.classNames.hidden].filter(Boolean).join(" ")},t)},createBadge(s){if(g.empty(s))return null;const e=B("span",{class:this.config.classNames.menu.value});return e.appendChild(B("span",{class:this.config.classNames.menu.badge},s)),e},createButton(s,e){const t=J({},e);let i=Xr(s);const n={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach(o=>{Object.keys(t).includes(o)&&(n[o]=t[o],delete t[o])}),n.element!=="button"||Object.keys(t).includes("type")||(t.type="button"),Object.keys(t).includes("class")?t.class.split(" ").some(o=>o===this.config.classNames.control)||J(t,{class:`${t.class} ${this.config.classNames.control}`}):t.class=this.config.classNames.control,s){case"play":n.toggle=!0,n.label="play",n.labelPressed="pause",n.icon="play",n.iconPressed="pause";break;case"mute":n.toggle=!0,n.label="mute",n.labelPressed="unmute",n.icon="volume",n.iconPressed="muted";break;case"captions":n.toggle=!0,n.label="enableCaptions",n.labelPressed="disableCaptions",n.icon="captions-off",n.iconPressed="captions-on";break;case"fullscreen":n.toggle=!0,n.label="enterFullscreen",n.labelPressed="exitFullscreen",n.icon="enter-fullscreen",n.iconPressed="exit-fullscreen";break;case"play-large":t.class+=` ${this.config.classNames.control}--overlaid`,i="play",n.label="play",n.icon="play";break;default:g.empty(n.label)&&(n.label=i),g.empty(n.icon)&&(n.icon=s)}const r=B(n.element);return n.toggle?(r.appendChild(S.createIcon.call(this,n.iconPressed,{class:"icon--pressed"})),r.appendChild(S.createIcon.call(this,n.icon,{class:"icon--not-pressed"})),r.appendChild(S.createLabel.call(this,n.labelPressed,{class:"label--pressed"})),r.appendChild(S.createLabel.call(this,n.label,{class:"label--not-pressed"}))):(r.appendChild(S.createIcon.call(this,n.icon)),r.appendChild(S.createLabel.call(this,n.label))),J(t,Ce(this.config.selectors.buttons[i],t)),Ti(r,t),i==="play"?(g.array(this.elements.buttons[i])||(this.elements.buttons[i]=[]),this.elements.buttons[i].push(r)):this.elements.buttons[i]=r,r},createRange(s,e){const t=B("input",J(Ce(this.config.selectors.inputs[s]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":te.get(s,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},e));return this.elements.inputs[s]=t,S.updateRangeFill.call(this,t),yr.setup(t),t},createProgress(s,e){const t=B("progress",J(Ce(this.config.selectors.display[s]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},e));if(s!=="volume"){t.appendChild(B("span",null,"0"));const i={played:"played",buffer:"buffered"}[s],n=i?te.get(i,this.config):"";t.innerText=`% ${n.toLowerCase()}`}return this.elements.display[s]=t,t},createTime(s,e){const t=Ce(this.config.selectors.display[s],e),i=B("div",J(t,{class:`${t.class?t.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":te.get(s,this.config),role:"timer"}),"00:00");return this.elements.display[s]=i,i},bindMenuItemShortcuts(s,e){R.call(this,s,"keydown keyup",t=>{if(![" ","ArrowUp","ArrowDown","ArrowRight"].includes(t.key)||(t.preventDefault(),t.stopPropagation(),t.type==="keydown"))return;const i=qe(s,'[role="menuitemradio"]');if(!i&&[" ","ArrowRight"].includes(t.key))S.showMenuPanel.call(this,e,!0);else{let n;t.key!==" "&&(t.key==="ArrowDown"||i&&t.key==="ArrowRight"?(n=s.nextElementSibling,g.element(n)||(n=s.parentNode.firstElementChild)):(n=s.previousElementSibling,g.element(n)||(n=s.parentNode.lastElementChild)),hi.call(this,n,!0))}},!1),R.call(this,s,"keyup",t=>{t.key==="Return"&&S.focusFirstMenuItem.call(this,null,!0)})},createMenuItem({value:s,list:e,type:t,title:i,badge:n=null,checked:r=!1}){const o=Ce(this.config.selectors.inputs[t]),a=B("button",J(o,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${o.class?o.class:""}`.trim(),"aria-checked":r,value:s})),l=B("span");l.innerHTML=i,g.element(n)&&l.appendChild(n),a.appendChild(l),Object.defineProperty(a,"checked",{enumerable:!0,get:()=>a.getAttribute("aria-checked")==="true",set(u){u&&Array.from(a.parentNode.children).filter(c=>qe(c,'[role="menuitemradio"]')).forEach(c=>c.setAttribute("aria-checked","false")),a.setAttribute("aria-checked",u?"true":"false")}}),this.listeners.bind(a,"click keyup",u=>{if(!g.keyboardEvent(u)||u.key===" "){switch(u.preventDefault(),u.stopPropagation(),a.checked=!0,t){case"language":this.currentTrack=Number(s);break;case"quality":this.quality=s;break;case"speed":this.speed=parseFloat(s)}S.showMenuPanel.call(this,"home",g.keyboardEvent(u))}},t,!1),S.bindMenuItemShortcuts.call(this,a,t),e.appendChild(a)},formatTime(s=0,e=!1){return g.number(s)?Ht(s,Zs(this.duration)>0,e):s},updateTimeDisplay(s=null,e=0,t=!1){g.element(s)&&g.number(e)&&(s.innerText=S.formatTime(e,t))},updateVolume(){this.supported.ui&&(g.element(this.elements.inputs.volume)&&S.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),g.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||this.volume===0))},setRange(s,e=0){g.element(s)&&(s.value=e,S.updateRangeFill.call(this,s))},updateProgress(s){if(!this.supported.ui||!g.event(s))return;let e=0;const t=(i,n)=>{const r=g.number(n)?n:0,o=g.element(i)?i:this.elements.display.buffer;if(g.element(o)){o.value=r;const a=o.getElementsByTagName("span")[0];g.element(a)&&(a.childNodes[0].nodeValue=r)}};if(s)switch(s.type){case"timeupdate":case"seeking":case"seeked":e=Wr(this.currentTime,this.duration),s.type==="timeupdate"&&S.setRange.call(this,this.elements.inputs.seek,e);break;case"playing":case"progress":t(this.elements.display.buffer,100*this.buffered)}},updateRangeFill(s){const e=g.event(s)?s.target:s;if(g.element(e)&&e.getAttribute("type")==="range"){if(qe(e,this.config.selectors.inputs.seek)){e.setAttribute("aria-valuenow",this.currentTime);const t=S.formatTime(this.currentTime),i=S.formatTime(this.duration),n=te.get("seekLabel",this.config);e.setAttribute("aria-valuetext",n.replace("{currentTime}",t).replace("{duration}",i))}else if(qe(e,this.config.selectors.inputs.volume)){const t=100*e.value;e.setAttribute("aria-valuenow",t),e.setAttribute("aria-valuetext",`${t.toFixed(1)}%`)}else e.setAttribute("aria-valuenow",e.value);(ie.isWebKit||ie.isIPadOS)&&e.style.setProperty("--value",e.value/e.max*100+"%")}},updateSeekTooltip(s){var e,t;if(!this.config.tooltips.seek||!g.element(this.elements.inputs.seek)||!g.element(this.elements.display.seekTooltip)||this.duration===0)return;const i=this.elements.display.seekTooltip,n=`${this.config.classNames.tooltip}--visible`,r=c=>V(i,n,c);if(this.touch)return void r(!1);let o=0;const a=this.elements.progress.getBoundingClientRect();if(g.event(s))o=100/a.width*(s.pageX-a.left);else{if(!Lt(i,n))return;o=parseFloat(i.style.left,10)}o<0?o=0:o>100&&(o=100);const l=this.duration/100*o;i.innerText=S.formatTime(l);const u=(e=this.config.markers)===null||e===void 0||(t=e.points)===null||t===void 0?void 0:t.find(({time:c})=>c===Math.round(l));u&&i.insertAdjacentHTML("afterbegin",`${u.label}<br>`),i.style.left=`${o}%`,g.event(s)&&["mouseenter","mouseleave"].includes(s.type)&&r(s.type==="mouseenter")},timeUpdate(s){const e=!g.element(this.elements.display.duration)&&this.config.invertTime;S.updateTimeDisplay.call(this,this.elements.display.currentTime,e?this.duration-this.currentTime:this.currentTime,e),s&&s.type==="timeupdate"&&this.media.seeking||S.updateProgress.call(this,s)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32)return ze(this.elements.display.currentTime,!0),void ze(this.elements.progress,!0);g.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const s=g.element(this.elements.display.duration);!s&&this.config.displayDuration&&this.paused&&S.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),s&&S.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&S.setMarkers.call(this),S.updateSeekTooltip.call(this)},toggleMenuButton(s,e){ze(this.elements.settings.buttons[s],!e)},updateSetting(s,e,t){const i=this.elements.settings.panels[s];let n=null,r=e;if(s==="captions")n=this.currentTrack;else{if(n=g.empty(t)?this[s]:t,g.empty(n)&&(n=this.config[s].default),!g.empty(this.options[s])&&!this.options[s].includes(n))return void this.debug.warn(`Unsupported value of '${n}' for ${s}`);if(!this.config[s].options.includes(n))return void this.debug.warn(`Disabled value of '${n}' for ${s}`)}if(g.element(r)||(r=i&&i.querySelector('[role="menu"]')),!g.element(r))return;this.elements.settings.buttons[s].querySelector(`.${this.config.classNames.menu.value}`).innerHTML=S.getLabel.call(this,s,n);const o=r&&r.querySelector(`[value="${n}"]`);g.element(o)&&(o.checked=!0)},getLabel(s,e){switch(s){case"speed":return e===1?te.get("normal",this.config):`${e}&times;`;case"quality":if(g.number(e)){const t=te.get(`qualityLabel.${e}`,this.config);return t.length?t:`${e}p`}return Ks(e);case"captions":return L.getLabel.call(this);default:return null}},setQualityMenu(s){if(!g.element(this.elements.settings.panels.quality))return;const e="quality",t=this.elements.settings.panels.quality.querySelector('[role="menu"]');g.array(s)&&(this.options.quality=xi(s).filter(r=>this.config.quality.options.includes(r)));const i=!g.empty(this.options.quality)&&this.options.quality.length>1;if(S.toggleMenuButton.call(this,e,i),Bt(t),S.checkMenu.call(this),!i)return;const n=r=>{const o=te.get(`qualityBadge.${r}`,this.config);return o.length?S.createBadge.call(this,o):null};this.options.quality.sort((r,o)=>{const a=this.config.quality.options;return a.indexOf(r)>a.indexOf(o)?1:-1}).forEach(r=>{S.createMenuItem.call(this,{value:r,list:t,type:e,title:S.getLabel.call(this,"quality",r),badge:n(r)})}),S.updateSetting.call(this,e,t)},setCaptionsMenu(){if(!g.element(this.elements.settings.panels.captions))return;const s="captions",e=this.elements.settings.panels.captions.querySelector('[role="menu"]'),t=L.getTracks.call(this),i=Boolean(t.length);if(S.toggleMenuButton.call(this,s,i),Bt(e),S.checkMenu.call(this),!i)return;const n=t.map((r,o)=>({value:o,checked:this.captions.toggled&&this.currentTrack===o,title:L.getLabel.call(this,r),badge:r.language&&S.createBadge.call(this,r.language.toUpperCase()),list:e,type:"language"}));n.unshift({value:-1,checked:!this.captions.toggled,title:te.get("disabled",this.config),list:e,type:"language"}),n.forEach(S.createMenuItem.bind(this)),S.updateSetting.call(this,s,e)},setSpeedMenu(){if(!g.element(this.elements.settings.panels.speed))return;const s="speed",e=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter(i=>i>=this.minimumSpeed&&i<=this.maximumSpeed);const t=!g.empty(this.options.speed)&&this.options.speed.length>1;S.toggleMenuButton.call(this,s,t),Bt(e),S.checkMenu.call(this),t&&(this.options.speed.forEach(i=>{S.createMenuItem.call(this,{value:i,list:e,type:s,title:S.getLabel.call(this,"speed",i)})}),S.updateSetting.call(this,s,e))},checkMenu(){const{buttons:s}=this.elements.settings,e=!g.empty(s)&&Object.values(s).some(t=>!t.hidden);ze(this.elements.settings.menu,!e)},focusFirstMenuItem(s,e=!1){if(this.elements.settings.popup.hidden)return;let t=s;g.element(t)||(t=Object.values(this.elements.settings.panels).find(n=>!n.hidden));const i=t.querySelector('[role^="menuitem"]');hi.call(this,i,e)},toggleMenu(s){const{popup:e}=this.elements.settings,t=this.elements.buttons.settings;if(!g.element(e)||!g.element(t))return;const{hidden:i}=e;let n=i;if(g.boolean(s))n=s;else if(g.keyboardEvent(s)&&s.key==="Escape")n=!1;else if(g.event(s)){const r=g.function(s.composedPath)?s.composedPath()[0]:s.target,o=e.contains(r);if(o||!o&&s.target!==t&&n)return}t.setAttribute("aria-expanded",n),ze(e,!n),V(this.elements.container,this.config.classNames.menu.open,n),n&&g.keyboardEvent(s)?S.focusFirstMenuItem.call(this,null,!0):n||i||hi.call(this,t,g.keyboardEvent(s))},getMenuSize(s){const e=s.cloneNode(!0);e.style.position="absolute",e.style.opacity=0,e.removeAttribute("hidden"),s.parentNode.appendChild(e);const t=e.scrollWidth,i=e.scrollHeight;return Se(e),{width:t,height:i}},showMenuPanel(s="",e=!1){const t=this.elements.container.querySelector(`#plyr-settings-${this.id}-${s}`);if(!g.element(t))return;const i=t.parentNode,n=Array.from(i.children).find(r=>!r.hidden);if(Z.transitions&&!Z.reducedMotion){i.style.width=`${n.scrollWidth}px`,i.style.height=`${n.scrollHeight}px`;const r=S.getMenuSize.call(this,t),o=a=>{a.target===i&&["width","height"].includes(a.propertyName)&&(i.style.width="",i.style.height="",Ut.call(this,i,Ci,o))};R.call(this,i,Ci,o),i.style.width=`${r.width}px`,i.style.height=`${r.height}px`}ze(n,!0),ze(t,!1),S.focusFirstMenuItem.call(this,t,e)},setDownloadUrl(){const s=this.elements.buttons.download;g.element(s)&&s.setAttribute("href",this.download)},create(s){const{bindMenuItemShortcuts:e,createButton:t,createProgress:i,createRange:n,createTime:r,setQualityMenu:o,setSpeedMenu:a,showMenuPanel:l}=S;this.elements.controls=null,g.array(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(t.call(this,"play-large"));const u=B("div",Ce(this.config.selectors.controls.wrapper));this.elements.controls=u;const c={class:"plyr__controls__item"};return xi(g.array(this.config.controls)?this.config.controls:[]).forEach(m=>{if(m==="restart"&&u.appendChild(t.call(this,"restart",c)),m==="rewind"&&u.appendChild(t.call(this,"rewind",c)),m==="play"&&u.appendChild(t.call(this,"play",c)),m==="fast-forward"&&u.appendChild(t.call(this,"fast-forward",c)),m==="progress"){const h=B("div",{class:`${c.class} plyr__progress__container`}),d=B("div",Ce(this.config.selectors.progress));if(d.appendChild(n.call(this,"seek",{id:`plyr-seek-${s.id}`})),d.appendChild(i.call(this,"buffer")),this.config.tooltips.seek){const p=B("span",{class:this.config.classNames.tooltip},"00:00");d.appendChild(p),this.elements.display.seekTooltip=p}this.elements.progress=d,h.appendChild(this.elements.progress),u.appendChild(h)}if(m==="current-time"&&u.appendChild(r.call(this,"currentTime",c)),m==="duration"&&u.appendChild(r.call(this,"duration",c)),m==="mute"||m==="volume"){let{volume:h}=this.elements;if(g.element(h)&&u.contains(h)||(h=B("div",J({},c,{class:`${c.class} plyr__volume`.trim()})),this.elements.volume=h,u.appendChild(h)),m==="mute"&&h.appendChild(t.call(this,"mute")),m==="volume"&&!ie.isIos&&!ie.isIPadOS){const d={max:1,step:.05,value:this.config.volume};h.appendChild(n.call(this,"volume",J(d,{id:`plyr-volume-${s.id}`})))}}if(m==="captions"&&u.appendChild(t.call(this,"captions",c)),m==="settings"&&!g.empty(this.config.settings)){const h=B("div",J({},c,{class:`${c.class} plyr__menu`.trim(),hidden:""}));h.appendChild(t.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${s.id}`,"aria-expanded":!1}));const d=B("div",{class:"plyr__menu__container",id:`plyr-settings-${s.id}`,hidden:""}),p=B("div"),f=B("div",{id:`plyr-settings-${s.id}-home`}),y=B("div",{role:"menu"});f.appendChild(y),p.appendChild(f),this.elements.settings.panels.home=f,this.config.settings.forEach(v=>{const A=B("button",J(Ce(this.config.selectors.buttons.settings),{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--forward`,role:"menuitem","aria-haspopup":!0,hidden:""}));e.call(this,A,v),R.call(this,A,"click",()=>{l.call(this,v,!1)});const w=B("span",null,te.get(v,this.config)),b=B("span",{class:this.config.classNames.menu.value});b.innerHTML=s[v],w.appendChild(b),A.appendChild(w),y.appendChild(A);const E=B("div",{id:`plyr-settings-${s.id}-${v}`,hidden:""}),T=B("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});T.appendChild(B("span",{"aria-hidden":!0},te.get(v,this.config))),T.appendChild(B("span",{class:this.config.classNames.hidden},te.get("menuBack",this.config))),R.call(this,E,"keydown",x=>{x.key==="ArrowLeft"&&(x.preventDefault(),x.stopPropagation(),l.call(this,"home",!0))},!1),R.call(this,T,"click",()=>{l.call(this,"home",!1)}),E.appendChild(T),E.appendChild(B("div",{role:"menu"})),p.appendChild(E),this.elements.settings.buttons[v]=A,this.elements.settings.panels[v]=E}),d.appendChild(p),h.appendChild(d),u.appendChild(h),this.elements.settings.popup=d,this.elements.settings.menu=h}if(m==="pip"&&Z.pip&&u.appendChild(t.call(this,"pip",c)),m==="airplay"&&Z.airplay&&u.appendChild(t.call(this,"airplay",c)),m==="download"){const h=J({},c,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(h.download="");const{download:d}=this.config.urls;!g.url(d)&&this.isEmbed&&J(h,{icon:`logo-${this.provider}`,label:this.provider}),u.appendChild(t.call(this,"download",h))}m==="fullscreen"&&u.appendChild(t.call(this,"fullscreen",c))}),this.isHTML5&&o.call(this,Ie.getQualityOptions.call(this)),a.call(this),u},inject(){if(this.config.loadSprite){const n=S.getIconUrl.call(this);n.cors&&Js(n.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());let s=null;this.elements.controls=null;const e={id:this.id,seektime:this.config.seekTime,title:this.config.title};let t=!0;g.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this,e)),this.config.controls||(this.config.controls=[]),g.element(this.config.controls)||g.string(this.config.controls)?s=this.config.controls:(s=S.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:L.getLabel.call(this)}),t=!1);let i;if(t&&g.string(this.config.controls)&&(s=(n=>{let r=n;return Object.entries(e).forEach(([o,a])=>{r=lt(r,`{${o}}`,a)}),r})(s)),g.string(this.config.selectors.controls.container)&&(i=document.querySelector(this.config.selectors.controls.container)),g.element(i)||(i=this.elements.container),i[g.element(s)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",s),g.element(this.elements.controls)||S.findElements.call(this),!g.empty(this.elements.buttons)){const n=r=>{const o=this.config.classNames.controlPressed;r.setAttribute("aria-pressed","false"),Object.defineProperty(r,"pressed",{configurable:!0,enumerable:!0,get:()=>Lt(r,o),set(a=!1){V(r,o,a),r.setAttribute("aria-pressed",a?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach(r=>{g.array(r)||g.nodeList(r)?Array.from(r).filter(Boolean).forEach(n):n(r)})}if(ie.isEdge&&Qs(i),this.config.tooltips.controls){const{classNames:n,selectors:r}=this.config,o=`${r.controls.wrapper} ${r.labels} .${n.hidden}`,a=ut.call(this,o);Array.from(a).forEach(l=>{V(l,this.config.classNames.hidden,!1),V(l,this.config.classNames.tooltip,!0)})}},setMediaMetadata(){try{"mediaSession"in navigator&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:this.config.mediaMetadata.title,artist:this.config.mediaMetadata.artist,album:this.config.mediaMetadata.album,artwork:this.config.mediaMetadata.artwork}))}catch{}},setMarkers(){var s,e;if(!this.duration||this.elements.markers)return;const t=(s=this.config.markers)===null||s===void 0||(e=s.points)===null||e===void 0?void 0:e.filter(({time:l})=>l>0&&l<this.duration);if(t==null||!t.length)return;const i=document.createDocumentFragment(),n=document.createDocumentFragment();let r=null;const o=`${this.config.classNames.tooltip}--visible`,a=l=>V(r,o,l);t.forEach(l=>{const u=B("span",{class:this.config.classNames.marker},""),c=l.time/this.duration*100+"%";r&&(u.addEventListener("mouseenter",()=>{l.label||(r.style.left=c,r.innerHTML=l.label,a(!0))}),u.addEventListener("mouseleave",()=>{a(!1)})),u.addEventListener("click",()=>{this.currentTime=l.time}),u.style.left=c,n.appendChild(u)}),i.appendChild(n),this.config.tooltips.seek||(r=B("span",{class:this.config.classNames.tooltip},""),i.appendChild(r)),this.elements.markers={points:n,tip:r},this.elements.progress.appendChild(i)}};function _s(s,e=!0){let t=s;if(e){const i=document.createElement("a");i.href=t,t=i.href}try{return new URL(t)}catch{return null}}function $s(s){const e=new URLSearchParams;return g.object(s)&&Object.entries(s).forEach(([t,i])=>{e.set(t,i)}),e}const L={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!Z.textTracks)return void(g.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&S.setCaptionsMenu.call(this));if(g.element(this.elements.captions)||(this.elements.captions=B("div",Ce(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),Lr(this.elements.captions,this.elements.wrapper)),ie.isIE&&window.URL){const i=this.media.querySelectorAll("track");Array.from(i).forEach(n=>{const r=n.getAttribute("src"),o=_s(r);o!==null&&o.hostname!==window.location.href.hostname&&["http:","https:"].includes(o.protocol)&&yt(r,"blob").then(a=>{n.setAttribute("src",window.URL.createObjectURL(a))}).catch(()=>{Se(n)})})}const s=xi((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map(i=>i.split("-")[0]));let e=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();e==="auto"&&([e]=s);let t=this.storage.get("captions");if(g.boolean(t)||({active:t}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:t,language:e,languages:s}),this.isHTML5){const i=this.config.captions.update?"addtrack removetrack":"removetrack";R.call(this,this.media.textTracks,i,L.update.bind(this))}setTimeout(L.update.bind(this),0)},update(){const s=L.getTracks.call(this,!0),{active:e,language:t,meta:i,currentTrackNode:n}=this.captions,r=Boolean(s.find(o=>o.language===t));this.isHTML5&&this.isVideo&&s.filter(o=>!i.get(o)).forEach(o=>{this.debug.log("Track added",o),i.set(o,{default:o.mode==="showing"}),o.mode==="showing"&&(o.mode="hidden"),R.call(this,o,"cuechange",()=>L.updateCues.call(this))}),(r&&this.language!==t||!s.includes(n))&&(L.setLanguage.call(this,t),L.toggle.call(this,e&&r)),this.elements&&V(this.elements.container,this.config.classNames.captions.enabled,!g.empty(s)),g.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&S.setCaptionsMenu.call(this)},toggle(s,e=!0){if(!this.supported.ui)return;const{toggled:t}=this.captions,i=this.config.classNames.captions.active,n=g.nullOrUndefined(s)?!t:s;if(n!==t){if(e||(this.captions.active=n,this.storage.set({captions:n})),!this.language&&n&&!e){const r=L.getTracks.call(this),o=L.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=o.language,void L.set.call(this,r.indexOf(o))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=n),V(this.elements.container,i,n),this.captions.toggled=n,S.updateSetting.call(this,"captions"),O.call(this,this.media,n?"captionsenabled":"captionsdisabled")}setTimeout(()=>{n&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")})},set(s,e=!0){const t=L.getTracks.call(this);if(s!==-1)if(g.number(s))if(s in t){if(this.captions.currentTrack!==s){this.captions.currentTrack=s;const i=t[s],{language:n}=i||{};this.captions.currentTrackNode=i,S.updateSetting.call(this,"captions"),e||(this.captions.language=n,this.storage.set({language:n})),this.isVimeo&&this.embed.enableTextTrack(n),O.call(this,this.media,"languagechange")}L.toggle.call(this,!0,e),this.isHTML5&&this.isVideo&&L.updateCues.call(this)}else this.debug.warn("Track not found",s);else this.debug.warn("Invalid caption argument",s);else L.toggle.call(this,!1,e)},setLanguage(s,e=!0){if(!g.string(s))return void this.debug.warn("Invalid language argument",s);const t=s.toLowerCase();this.captions.language=t;const i=L.getTracks.call(this),n=L.findTrack.call(this,[t]);L.set.call(this,i.indexOf(n),e)},getTracks(s=!1){return Array.from((this.media||{}).textTracks||[]).filter(e=>!this.isHTML5||s||this.captions.meta.has(e)).filter(e=>["captions","subtitles"].includes(e.kind))},findTrack(s,e=!1){const t=L.getTracks.call(this),i=o=>Number((this.captions.meta.get(o)||{}).default),n=Array.from(t).sort((o,a)=>i(a)-i(o));let r;return s.every(o=>(r=n.find(a=>a.language===o),!r)),r||(e?n[0]:void 0)},getCurrentTrack(){return L.getTracks.call(this)[this.currentTrack]},getLabel(s){let e=s;return!g.track(e)&&Z.textTracks&&this.captions.toggled&&(e=L.getCurrentTrack.call(this)),g.track(e)?g.empty(e.label)?g.empty(e.language)?te.get("enabled",this.config):s.language.toUpperCase():e.label:te.get("disabled",this.config)},updateCues(s){if(!this.supported.ui)return;if(!g.element(this.elements.captions))return void this.debug.warn("No captions element to render to");if(!g.nullOrUndefined(s)&&!Array.isArray(s))return void this.debug.warn("updateCues: Invalid input",s);let e=s;if(!e){const i=L.getCurrentTrack.call(this);e=Array.from((i||{}).activeCues||[]).map(n=>n.getCueAsHTML()).map(jr)}const t=e.map(i=>i.trim()).join(`
  2. `);if(t!==this.elements.captions.innerHTML){Bt(this.elements.captions);const i=B("span",Ce(this.config.selectors.caption));i.innerHTML=t,this.elements.captions.appendChild(i),O.call(this,this.media,"cuechange")}}},en={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.7.8/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",marker:"plyr__progress__marker",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id",hash:"data-plyr-embed-hash"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1},mediaMetadata:{title:"",artist:"",album:"",artwork:[]},markers:{enabled:!1,points:[]}},di={active:"picture-in-picture",inactive:"inline"},Fe={html5:"html5",youtube:"youtube",vimeo:"vimeo"},mi={audio:"audio",video:"video"};function Jr(s){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(s)?Fe.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(s)?Fe.vimeo:null}const gi=()=>{};class Zr{constructor(e=!1){this.enabled=window.console&&e,this.enabled&&this.log("Debugging enabled")}get log(){return this.enabled?Function.prototype.bind.call(console.log,console):gi}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):gi}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):gi}}class ye{constructor(e){k(this,"onChange",()=>{if(!this.supported)return;const t=this.player.elements.buttons.fullscreen;g.element(t)&&(t.pressed=this.active);const i=this.target===this.player.media?this.target:this.player.elements.container;O.call(this.player,i,this.active?"enterfullscreen":"exitfullscreen",!0)}),k(this,"toggleFallback",(t=!1)=>{var i,n;if(t?this.scrollPosition={x:(i=window.scrollX)!=null?i:0,y:(n=window.scrollY)!=null?n:0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=t?"hidden":"",V(this.target,this.player.config.classNames.fullscreen.fallback,t),ie.isIos){let r=document.head.querySelector('meta[name="viewport"]');const o="viewport-fit=cover";r||(r=document.createElement("meta"),r.setAttribute("name","viewport"));const a=g.string(r.content)&&r.content.includes(o);t?(this.cleanupViewport=!a,a||(r.content+=`,${o}`)):this.cleanupViewport&&(r.content=r.content.split(",").filter(l=>l.trim()!==o).join(","))}this.onChange()}),k(this,"trapFocus",t=>{if(ie.isIos||ie.isIPadOS||!this.active||t.key!=="Tab")return;const i=document.activeElement,n=ut.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[r]=n,o=n[n.length-1];i!==o||t.shiftKey?i===r&&t.shiftKey&&(o.focus(),t.preventDefault()):(r.focus(),t.preventDefault())}),k(this,"update",()=>{if(this.supported){let t;t=this.forceFallback?"Fallback (forced)":ye.nativeSupported?"Native":"Fallback",this.player.debug.log(`${t} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");V(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.supported)}),k(this,"enter",()=>{this.supported&&(ie.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!ye.nativeSupported||this.forceFallback?this.toggleFallback(!0):this.prefix?g.empty(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))}),k(this,"exit",()=>{if(this.supported)if(ie.isIos&&this.player.config.fullscreen.iosNative)this.player.isVimeo?this.player.embed.exitFullscreen():this.target.webkitEnterFullscreen(),Te(this.player.play());else if(!ye.nativeSupported||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!g.empty(this.prefix)){const t=this.prefix==="moz"?"Cancel":"Exit";document[`${this.prefix}${t}${this.property}`]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)}),k(this,"toggle",()=>{this.active?this.exit():this.enter()}),this.player=e,this.prefix=ye.prefix,this.property=ye.property,this.scrollPosition={x:0,y:0},this.forceFallback=e.config.fullscreen.fallback==="force",this.player.elements.fullscreen=e.config.fullscreen.container&&Dr(this.player.elements.container,e.config.fullscreen.container),R.call(this.player,document,this.prefix==="ms"?"MSFullscreenChange":`${this.prefix}fullscreenchange`,()=>{this.onChange()}),R.call(this.player,this.player.elements.container,"dblclick",t=>{g.element(this.player.elements.controls)&&this.player.elements.controls.contains(t.target)||this.player.listeners.proxy(t,this.toggle,"fullscreen")}),R.call(this,this.player.elements.container,"keydown",t=>this.trapFocus(t)),this.update()}static get nativeSupported(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get useNative(){return ye.nativeSupported&&!this.forceFallback}static get prefix(){if(g.function(document.exitFullscreen))return"";let e="";return["webkit","moz","ms"].some(t=>!(!g.function(document[`${t}ExitFullscreen`])&&!g.function(document[`${t}CancelFullScreen`]))&&(e=t,!0)),e}static get property(){return this.prefix==="moz"?"FullScreen":"Fullscreen"}get supported(){return[this.player.config.fullscreen.enabled,this.player.isVideo,ye.nativeSupported||this.player.config.fullscreen.fallback,!this.player.isYouTube||ye.nativeSupported||!ie.isIos||this.player.config.playsinline&&!this.player.config.fullscreen.iosNative].every(Boolean)}get active(){if(!this.supported)return!1;if(!ye.nativeSupported||this.forceFallback)return Lt(this.target,this.player.config.classNames.fullscreen.fallback);const e=this.prefix?this.target.getRootNode()[`${this.prefix}${this.property}Element`]:this.target.getRootNode().fullscreenElement;return e&&e.shadowRoot?e===this.target.getRootNode().host:e===this.target}get target(){var e;return ie.isIos&&this.player.config.fullscreen.iosNative?this.player.media:(e=this.player.elements.fullscreen)!=null?e:this.player.elements.container}}function Ot(s,e=1){return new Promise((t,i)=>{const n=new Image,r=()=>{delete n.onload,delete n.onerror,(n.naturalWidth>=e?t:i)(n)};Object.assign(n,{onload:r,onerror:r,src:s})})}const H={addStyleHook(){V(this.elements.container,this.config.selectors.container.replace(".",""),!0),V(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls(s=!1){s&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build(){if(this.listeners.media(),!this.supported.ui)return this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),void H.toggleNativeControls.call(this,!0);g.element(this.elements.controls)||(S.inject.call(this),this.listeners.controls()),H.toggleNativeControls.call(this),this.isHTML5&&L.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,S.updateVolume.call(this),S.timeUpdate.call(this),S.durationUpdate.call(this),H.checkPlaying.call(this),V(this.elements.container,this.config.classNames.pip.supported,Z.pip&&this.isHTML5&&this.isVideo),V(this.elements.container,this.config.classNames.airplay.supported,Z.airplay&&this.isHTML5),V(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout(()=>{O.call(this,this.media,"ready")},0),H.setTitle.call(this),this.poster&&H.setPoster.call(this,this.poster,!1).catch(()=>{}),this.config.duration&&S.durationUpdate.call(this),this.config.mediaMetadata&&S.setMediaMetadata.call(this)},setTitle(){let s=te.get("play",this.config);if(g.string(this.config.title)&&!g.empty(this.config.title)&&(s+=`, ${this.config.title}`),Array.from(this.elements.buttons.play||[]).forEach(e=>{e.setAttribute("aria-label",s)}),this.isEmbed){const e=ee.call(this,"iframe");if(!g.element(e))return;const t=g.empty(this.config.title)?"video":this.config.title,i=te.get("frameTitle",this.config);e.setAttribute("title",i.replace("{title}",t))}},togglePoster(s){V(this.elements.container,this.config.classNames.posterEnabled,s)},setPoster(s,e=!0){return e&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",s),this.elements.poster.removeAttribute("hidden"),Hr.call(this).then(()=>Ot(s)).catch(t=>{throw s===this.poster&&H.togglePoster.call(this,!1),t}).then(()=>{if(s!==this.poster)throw new Error("setPoster cancelled by later call to setPoster")}).then(()=>(Object.assign(this.elements.poster.style,{backgroundImage:`url('${s}')`,backgroundSize:""}),H.togglePoster.call(this,!0),s)))},checkPlaying(s){V(this.elements.container,this.config.classNames.playing,this.playing),V(this.elements.container,this.config.classNames.paused,this.paused),V(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach(e=>{Object.assign(e,{pressed:this.playing}),e.setAttribute("aria-label",te.get(this.playing?"pause":"play",this.config))}),g.event(s)&&s.type==="timeupdate"||H.toggleControls.call(this)},checkLoading(s){this.loading=["stalled","waiting"].includes(s.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout(()=>{V(this.elements.container,this.config.classNames.loading,this.loading),H.toggleControls.call(this)},this.loading?250:0)},toggleControls(s){const{controls:e}=this.elements;if(e&&this.config.hideControls){const t=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(s||this.loading||this.paused||e.pressed||e.hover||t))}},migrateStyles(){Object.values({...this.media.style}).filter(s=>!g.empty(s)&&g.string(s)&&s.startsWith("--plyr")).forEach(s=>{this.elements.container.style.setProperty(s,this.media.style.getPropertyValue(s)),this.media.style.removeProperty(s)}),g.empty(this.media.style)&&this.media.removeAttribute("style")}};class _r{constructor(e){k(this,"firstTouch",()=>{const{player:t}=this,{elements:i}=t;t.touch=!0,V(i.container,t.config.classNames.isTouch,!0)}),k(this,"global",(t=!0)=>{const{player:i}=this;i.config.keyboard.global&&ct.call(i,window,"keydown keyup",this.handleKey,t,!1),ct.call(i,document.body,"click",this.toggleMenu,t),Ri.call(i,document.body,"touchstart",this.firstTouch)}),k(this,"container",()=>{const{player:t}=this,{config:i,elements:n,timers:r}=t;!i.keyboard.global&&i.keyboard.focused&&R.call(t,n.container,"keydown keyup",this.handleKey,!1),R.call(t,n.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",l=>{const{controls:u}=n;u&&l.type==="enterfullscreen"&&(u.pressed=!1,u.hover=!1);let c=0;["touchstart","touchmove","mousemove"].includes(l.type)&&(H.toggleControls.call(t,!0),c=t.touch?3e3:2e3),clearTimeout(r.controls),r.controls=setTimeout(()=>H.toggleControls.call(t,!1),c)});const o=()=>{if(!t.isVimeo||t.config.vimeo.premium)return;const l=n.wrapper,{active:u}=t.fullscreen,[c,m]=Li.call(t),h=Ys(`aspect-ratio: ${c} / ${m}`);if(!u)return void(h?(l.style.width=null,l.style.height=null):(l.style.maxWidth=null,l.style.margin=null));const[d,p]=zr(),f=d/p>c/m;h?(l.style.width=f?"auto":"100%",l.style.height=f?"100%":"auto"):(l.style.maxWidth=f?p/m*c+"px":null,l.style.margin=f?"0 auto":null)},a=()=>{clearTimeout(r.resized),r.resized=setTimeout(o,50)};R.call(t,n.container,"enterfullscreen exitfullscreen",l=>{const{target:u}=t.fullscreen;u===n.container&&(!t.isEmbed&&g.empty(t.config.ratio)||(o(),(l.type==="enterfullscreen"?R:Ut).call(t,window,"resize",a)))})}),k(this,"media",()=>{const{player:t}=this,{elements:i}=t;if(R.call(t,t.media,"timeupdate seeking seeked",r=>S.timeUpdate.call(t,r)),R.call(t,t.media,"durationchange loadeddata loadedmetadata",r=>S.durationUpdate.call(t,r)),R.call(t,t.media,"ended",()=>{t.isHTML5&&t.isVideo&&t.config.resetOnEnd&&(t.restart(),t.pause())}),R.call(t,t.media,"progress playing seeking seeked",r=>S.updateProgress.call(t,r)),R.call(t,t.media,"volumechange",r=>S.updateVolume.call(t,r)),R.call(t,t.media,"playing play pause ended emptied timeupdate",r=>H.checkPlaying.call(t,r)),R.call(t,t.media,"waiting canplay seeked playing",r=>H.checkLoading.call(t,r)),t.supported.ui&&t.config.clickToPlay&&!t.isAudio){const r=ee.call(t,`.${t.config.classNames.video}`);if(!g.element(r))return;R.call(t,i.container,"click",o=>{([i.container,r].includes(o.target)||r.contains(o.target))&&(t.touch&&t.config.hideControls||(t.ended?(this.proxy(o,t.restart,"restart"),this.proxy(o,()=>{Te(t.play())},"play")):this.proxy(o,()=>{Te(t.togglePlay())},"play")))})}t.supported.ui&&t.config.disableContextMenu&&R.call(t,i.wrapper,"contextmenu",r=>{r.preventDefault()},!1),R.call(t,t.media,"volumechange",()=>{t.storage.set({volume:t.volume,muted:t.muted})}),R.call(t,t.media,"ratechange",()=>{S.updateSetting.call(t,"speed"),t.storage.set({speed:t.speed})}),R.call(t,t.media,"qualitychange",r=>{S.updateSetting.call(t,"quality",null,r.detail.quality)}),R.call(t,t.media,"ready qualitychange",()=>{S.setDownloadUrl.call(t)});const n=t.config.events.concat(["keyup","keydown"]).join(" ");R.call(t,t.media,n,r=>{let{detail:o={}}=r;r.type==="error"&&(o=t.media.error),O.call(t,i.container,r.type,!0,o)})}),k(this,"proxy",(t,i,n)=>{const{player:r}=this,o=r.config.listeners[n];let a=!0;g.function(o)&&(a=o.call(r,t)),a!==!1&&g.function(i)&&i.call(r,t)}),k(this,"bind",(t,i,n,r,o=!0)=>{const{player:a}=this,l=a.config.listeners[r],u=g.function(l);R.call(a,t,i,c=>this.proxy(c,n,r),o&&!u)}),k(this,"controls",()=>{const{player:t}=this,{elements:i}=t,n=ie.isIE?"change":"input";if(i.buttons.play&&Array.from(i.buttons.play).forEach(r=>{this.bind(r,"click",()=>{Te(t.togglePlay())},"play")}),this.bind(i.buttons.restart,"click",t.restart,"restart"),this.bind(i.buttons.rewind,"click",()=>{t.lastSeekTime=Date.now(),t.rewind()},"rewind"),this.bind(i.buttons.fastForward,"click",()=>{t.lastSeekTime=Date.now(),t.forward()},"fastForward"),this.bind(i.buttons.mute,"click",()=>{t.muted=!t.muted},"mute"),this.bind(i.buttons.captions,"click",()=>t.toggleCaptions()),this.bind(i.buttons.download,"click",()=>{O.call(t,t.media,"download")},"download"),this.bind(i.buttons.fullscreen,"click",()=>{t.fullscreen.toggle()},"fullscreen"),this.bind(i.buttons.pip,"click",()=>{t.pip="toggle"},"pip"),this.bind(i.buttons.airplay,"click",t.airplay,"airplay"),this.bind(i.buttons.settings,"click",r=>{r.stopPropagation(),r.preventDefault(),S.toggleMenu.call(t,r)},null,!1),this.bind(i.buttons.settings,"keyup",r=>{[" ","Enter"].includes(r.key)&&(r.key!=="Enter"?(r.preventDefault(),r.stopPropagation(),S.toggleMenu.call(t,r)):S.focusFirstMenuItem.call(t,null,!0))},null,!1),this.bind(i.settings.menu,"keydown",r=>{r.key==="Escape"&&S.toggleMenu.call(t,r)}),this.bind(i.inputs.seek,"mousedown mousemove",r=>{const o=i.progress.getBoundingClientRect(),a=100/o.width*(r.pageX-o.left);r.currentTarget.setAttribute("seek-value",a)}),this.bind(i.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",r=>{const o=r.currentTarget,a="play-on-seeked";if(g.keyboardEvent(r)&&!["ArrowLeft","ArrowRight"].includes(r.key))return;t.lastSeekTime=Date.now();const l=o.hasAttribute(a),u=["mouseup","touchend","keyup"].includes(r.type);l&&u?(o.removeAttribute(a),Te(t.play())):!u&&t.playing&&(o.setAttribute(a,""),t.pause())}),ie.isIos){const r=ut.call(t,'input[type="range"]');Array.from(r).forEach(o=>this.bind(o,n,a=>Qs(a.target)))}this.bind(i.inputs.seek,n,r=>{const o=r.currentTarget;let a=o.getAttribute("seek-value");g.empty(a)&&(a=o.value),o.removeAttribute("seek-value"),t.currentTime=a/o.max*t.duration},"seek"),this.bind(i.progress,"mouseenter mouseleave mousemove",r=>S.updateSeekTooltip.call(t,r)),this.bind(i.progress,"mousemove touchmove",r=>{const{previewThumbnails:o}=t;o&&o.loaded&&o.startMove(r)}),this.bind(i.progress,"mouseleave touchend click",()=>{const{previewThumbnails:r}=t;r&&r.loaded&&r.endMove(!1,!0)}),this.bind(i.progress,"mousedown touchstart",r=>{const{previewThumbnails:o}=t;o&&o.loaded&&o.startScrubbing(r)}),this.bind(i.progress,"mouseup touchend",r=>{const{previewThumbnails:o}=t;o&&o.loaded&&o.endScrubbing(r)}),ie.isWebKit&&Array.from(ut.call(t,'input[type="range"]')).forEach(r=>{this.bind(r,"input",o=>S.updateRangeFill.call(t,o.target))}),t.config.toggleInvert&&!g.element(i.display.duration)&&this.bind(i.display.currentTime,"click",()=>{t.currentTime!==0&&(t.config.invertTime=!t.config.invertTime,S.timeUpdate.call(t))}),this.bind(i.inputs.volume,n,r=>{t.volume=r.target.value},"volume"),this.bind(i.controls,"mouseenter mouseleave",r=>{i.controls.hover=!t.touch&&r.type==="mouseenter"}),i.fullscreen&&Array.from(i.fullscreen.children).filter(r=>!r.contains(i.container)).forEach(r=>{this.bind(r,"mouseenter mouseleave",o=>{i.controls&&(i.controls.hover=!t.touch&&o.type==="mouseenter")})}),this.bind(i.controls,"mousedown mouseup touchstart touchend touchcancel",r=>{i.controls.pressed=["mousedown","touchstart"].includes(r.type)}),this.bind(i.controls,"focusin",()=>{const{config:r,timers:o}=t;V(i.controls,r.classNames.noTransition,!0),H.toggleControls.call(t,!0),setTimeout(()=>{V(i.controls,r.classNames.noTransition,!1)},0);const a=this.touch?3e3:4e3;clearTimeout(o.controls),o.controls=setTimeout(()=>H.toggleControls.call(t,!1),a)}),this.bind(i.inputs.volume,"wheel",r=>{const o=r.webkitDirectionInvertedFromDevice,[a,l]=[r.deltaX,-r.deltaY].map(m=>o?-m:m),u=Math.sign(Math.abs(a)>Math.abs(l)?a:l);t.increaseVolume(u/50);const{volume:c}=t.media;(u===1&&c<1||u===-1&&c>0)&&r.preventDefault()},"volume",!1)}),this.player=e,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.firstTouch=this.firstTouch.bind(this)}handleKey(e){const{player:t}=this,{elements:i}=t,{key:n,type:r,altKey:o,ctrlKey:a,metaKey:l,shiftKey:u}=e,c=r==="keydown",m=c&&n===this.lastKey;if(!(o||a||l||u)&&!!n){if(c){const d=document.activeElement;if(g.element(d)){const{editable:p}=t.config.selectors,{seek:f}=i.inputs;if(d!==f&&qe(d,p)||e.key===" "&&qe(d,'button, [role^="menuitem"]'))return}switch([" ","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","0","1","2","3","4","5","6","7","8","9","c","f","k","l","m"].includes(n)&&(e.preventDefault(),e.stopPropagation()),n){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":m||(h=parseInt(n,10),t.currentTime=t.duration/10*h);break;case" ":case"k":m||Te(t.togglePlay());break;case"ArrowUp":t.increaseVolume(.1);break;case"ArrowDown":t.decreaseVolume(.1);break;case"m":m||(t.muted=!t.muted);break;case"ArrowRight":t.forward();break;case"ArrowLeft":t.rewind();break;case"f":t.fullscreen.toggle();break;case"c":m||t.toggleCaptions();break;case"l":t.loop=!t.loop}n==="Escape"&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=n}else this.lastKey=null;var h}}toggleMenu(e){S.toggleMenu.call(this.player,e)}}function $r(s,e){return s(e={exports:{}},e.exports),e.exports}var ea=$r(function(s,e){s.exports=function(){var t=function(){},i={},n={},r={};function o(h,d){h=h.push?h:[h];var p,f,y,v=[],A=h.length,w=A;for(p=function(b,E){E.length&&v.push(b),--w||d(v)};A--;)f=h[A],(y=n[f])?p(f,y):(r[f]=r[f]||[]).push(p)}function a(h,d){if(h){var p=r[h];if(n[h]=d,p)for(;p.length;)p[0](h,d),p.splice(0,1)}}function l(h,d){h.call&&(h={success:h}),d.length?(h.error||t)(d):(h.success||t)(h)}function u(h,d,p,f){var y,v,A=document,w=p.async,b=(p.numRetries||0)+1,E=p.before||t,T=h.replace(/[\?|#].*$/,""),x=h.replace(/^(css|img)!/,"");f=f||0,/(^css!|\.css$)/.test(T)?((v=A.createElement("link")).rel="stylesheet",v.href=x,(y="hideFocus"in v)&&v.relList&&(y=0,v.rel="preload",v.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(T)?(v=A.createElement("img")).src=x:((v=A.createElement("script")).src=h,v.async=w===void 0||w),v.onload=v.onerror=v.onbeforeload=function(P){var F=P.type[0];if(y)try{v.sheet.cssText.length||(F="e")}catch(z){z.code!=18&&(F="e")}if(F=="e"){if((f+=1)<b)return u(h,d,p,f)}else if(v.rel=="preload"&&v.as=="style")return v.rel="stylesheet";d(h,F,P.defaultPrevented)},E(h,v)!==!1&&A.head.appendChild(v)}function c(h,d,p){var f,y,v=(h=h.push?h:[h]).length,A=v,w=[];for(f=function(b,E,T){if(E=="e"&&w.push(b),E=="b"){if(!T)return;w.push(b)}--v||d(w)},y=0;y<A;y++)u(h[y],f,p)}function m(h,d,p){var f,y;if(d&&d.trim&&(f=d),y=(f?p:d)||{},f){if(f in i)throw"LoadJS";i[f]=!0}function v(A,w){c(h,function(b){l(y,b),A&&l({success:A,error:w},b),a(f,b)},y)}if(y.returnPromise)return new Promise(v);v()}return m.ready=function(h,d){return o(h,function(p){l(d,p)}),m},m.done=function(h){a(h,[])},m.reset=function(){i={},n={},r={}},m.isDefined=function(h){return h in i},m}()});function Di(s){return new Promise((e,t)=>{ea(s,{success:e,error:t})})}function ta(s){return g.empty(s)?null:g.number(Number(s))?s:s.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:s}function ia(s){const e=s.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*&*h=|\/)+([\d,a-f]+)/);return e&&e.length===5?e[4]:null}function st(s){s&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===s&&(this.media.paused=!s,O.call(this,this.media,s?"play":"pause"))}const Si={setup(){const s=this;V(s.elements.wrapper,s.config.classNames.embed,!0),s.options.speed=s.config.speed.options,$e.call(s),g.object(window.Vimeo)?Si.ready.call(s):Di(s.config.urls.vimeo.sdk).then(()=>{Si.ready.call(s)}).catch(e=>{s.debug.warn("Vimeo SDK (player.js) failed to load",e)})},ready(){const s=this,e=s.config.vimeo,{premium:t,referrerPolicy:i,...n}=e;let r=s.media.getAttribute("src"),o="";g.empty(r)?(r=s.media.getAttribute(s.config.attributes.embed.id),o=s.media.getAttribute(s.config.attributes.embed.hash)):o=ia(r);const a=o?{h:o}:{};t&&Object.assign(n,{controls:!1,sidedock:!1});const l=$s({loop:s.config.loop.active,autoplay:s.autoplay,muted:s.muted,gesture:"media",playsinline:s.config.playsinline,...a,...n}),u=ta(r),c=B("iframe"),m=Ei(s.config.urls.vimeo.iframe,u,l);if(c.setAttribute("src",m),c.setAttribute("allowfullscreen",""),c.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),g.empty(i)||c.setAttribute("referrerPolicy",i),t||!e.customControls)c.setAttribute("data-poster",s.poster),s.media=Rt(c,s.media);else{const A=B("div",{class:s.config.classNames.embedContainer,"data-poster":s.poster});A.appendChild(c),s.media=Rt(A,s.media)}e.customControls||yt(Ei(s.config.urls.vimeo.api,m)).then(A=>{!g.empty(A)&&A.thumbnail_url&&H.setPoster.call(s,A.thumbnail_url).catch(()=>{})}),s.embed=new window.Vimeo.Player(c,{autopause:s.config.autopause,muted:s.muted}),s.media.paused=!0,s.media.currentTime=0,s.supported.ui&&s.embed.disableTextTrack(),s.media.play=()=>(st.call(s,!0),s.embed.play()),s.media.pause=()=>(st.call(s,!1),s.embed.pause()),s.media.stop=()=>{s.pause(),s.currentTime=0};let{currentTime:h}=s.media;Object.defineProperty(s.media,"currentTime",{get:()=>h,set(A){const{embed:w,media:b,paused:E,volume:T}=s,x=E&&!w.hasPlayed;b.seeking=!0,O.call(s,b,"seeking"),Promise.resolve(x&&w.setVolume(0)).then(()=>w.setCurrentTime(A)).then(()=>x&&w.pause()).then(()=>x&&w.setVolume(T)).catch(()=>{})}});let d=s.config.speed.selected;Object.defineProperty(s.media,"playbackRate",{get:()=>d,set(A){s.embed.setPlaybackRate(A).then(()=>{d=A,O.call(s,s.media,"ratechange")}).catch(()=>{s.options.speed=[1]})}});let{volume:p}=s.config;Object.defineProperty(s.media,"volume",{get:()=>p,set(A){s.embed.setVolume(A).then(()=>{p=A,O.call(s,s.media,"volumechange")})}});let{muted:f}=s.config;Object.defineProperty(s.media,"muted",{get:()=>f,set(A){const w=!!g.boolean(A)&&A;s.embed.setMuted(!!w||s.config.muted).then(()=>{f=w,O.call(s,s.media,"volumechange")})}});let y,{loop:v}=s.config;Object.defineProperty(s.media,"loop",{get:()=>v,set(A){const w=g.boolean(A)?A:s.config.loop.active;s.embed.setLoop(w).then(()=>{v=w})}}),s.embed.getVideoUrl().then(A=>{y=A,S.setDownloadUrl.call(s)}).catch(A=>{this.debug.warn(A)}),Object.defineProperty(s.media,"currentSrc",{get:()=>y}),Object.defineProperty(s.media,"ended",{get:()=>s.currentTime===s.duration}),Promise.all([s.embed.getVideoWidth(),s.embed.getVideoHeight()]).then(A=>{const[w,b]=A;s.embed.ratio=Gs(w,b),$e.call(this)}),s.embed.setAutopause(s.config.autopause).then(A=>{s.config.autopause=A}),s.embed.getVideoTitle().then(A=>{s.config.title=A,H.setTitle.call(this)}),s.embed.getCurrentTime().then(A=>{h=A,O.call(s,s.media,"timeupdate")}),s.embed.getDuration().then(A=>{s.media.duration=A,O.call(s,s.media,"durationchange")}),s.embed.getTextTracks().then(A=>{s.media.textTracks=A,L.setup.call(s)}),s.embed.on("cuechange",({cues:A=[]})=>{const w=A.map(b=>Yr(b.text));L.updateCues.call(s,w)}),s.embed.on("loaded",()=>{s.embed.getPaused().then(A=>{st.call(s,!A),A||O.call(s,s.media,"playing")}),g.element(s.embed.element)&&s.supported.ui&&s.embed.element.setAttribute("tabindex",-1)}),s.embed.on("bufferstart",()=>{O.call(s,s.media,"waiting")}),s.embed.on("bufferend",()=>{O.call(s,s.media,"playing")}),s.embed.on("play",()=>{st.call(s,!0),O.call(s,s.media,"playing")}),s.embed.on("pause",()=>{st.call(s,!1)}),s.embed.on("timeupdate",A=>{s.media.seeking=!1,h=A.seconds,O.call(s,s.media,"timeupdate")}),s.embed.on("progress",A=>{s.media.buffered=A.percent,O.call(s,s.media,"progress"),parseInt(A.percent,10)===1&&O.call(s,s.media,"canplaythrough"),s.embed.getDuration().then(w=>{w!==s.media.duration&&(s.media.duration=w,O.call(s,s.media,"durationchange"))})}),s.embed.on("seeked",()=>{s.media.seeking=!1,O.call(s,s.media,"seeked")}),s.embed.on("ended",()=>{s.media.paused=!0,O.call(s,s.media,"ended")}),s.embed.on("error",A=>{s.media.error=A,O.call(s,s.media,"error")}),e.customControls&&setTimeout(()=>H.build.call(s),0)}};function sa(s){return g.empty(s)?null:s.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:s}function nt(s){s&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===s&&(this.media.paused=!s,O.call(this,this.media,s?"play":"pause"))}function na(s){return s.noCookie?"https://www.youtube-nocookie.com":window.location.protocol==="http:"?"http://www.youtube.com":void 0}const Ft={setup(){if(V(this.elements.wrapper,this.config.classNames.embed,!0),g.object(window.YT)&&g.function(window.YT.Player))Ft.ready.call(this);else{const s=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{g.function(s)&&s(),Ft.ready.call(this)},Di(this.config.urls.youtube.sdk).catch(e=>{this.debug.warn("YouTube API failed to load",e)})}},getTitle(s){yt(Ei(this.config.urls.youtube.api,s)).then(e=>{if(g.object(e)){const{title:t,height:i,width:n}=e;this.config.title=t,H.setTitle.call(this),this.embed.ratio=Gs(n,i)}$e.call(this)}).catch(()=>{$e.call(this)})},ready(){const s=this,e=s.config.youtube,t=s.media&&s.media.getAttribute("id");if(!g.empty(t)&&t.startsWith("youtube-"))return;let i=s.media.getAttribute("src");g.empty(i)&&(i=s.media.getAttribute(this.config.attributes.embed.id));const n=sa(i),r=B("div",{id:Qr(s.provider),"data-poster":e.customControls?s.poster:void 0});if(s.media=Rt(r,s.media),e.customControls){const o=a=>`https://i.ytimg.com/vi/${n}/${a}default.jpg`;Ot(o("maxres"),121).catch(()=>Ot(o("sd"),121)).catch(()=>Ot(o("hq"))).then(a=>H.setPoster.call(s,a.src)).then(a=>{a.includes("maxres")||(s.elements.poster.style.backgroundSize="cover")}).catch(()=>{})}s.embed=new window.YT.Player(s.media,{videoId:n,host:na(e),playerVars:J({},{autoplay:s.config.autoplay?1:0,hl:s.config.hl,controls:s.supported.ui&&e.customControls?0:1,disablekb:1,playsinline:s.config.playsinline&&!s.config.fullscreen.iosNative?1:0,cc_load_policy:s.captions.active?1:0,cc_lang_pref:s.config.captions.language,widget_referrer:window?window.location.href:null},e),events:{onError(o){if(!s.media.error){const a=o.data,l={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[a]||"An unknown error occurred";s.media.error={code:a,message:l},O.call(s,s.media,"error")}},onPlaybackRateChange(o){const a=o.target;s.media.playbackRate=a.getPlaybackRate(),O.call(s,s.media,"ratechange")},onReady(o){if(g.function(s.media.play))return;const a=o.target;Ft.getTitle.call(s,n),s.media.play=()=>{nt.call(s,!0),a.playVideo()},s.media.pause=()=>{nt.call(s,!1),a.pauseVideo()},s.media.stop=()=>{a.stopVideo()},s.media.duration=a.getDuration(),s.media.paused=!0,s.media.currentTime=0,Object.defineProperty(s.media,"currentTime",{get:()=>Number(a.getCurrentTime()),set(m){s.paused&&!s.embed.hasPlayed&&s.embed.mute(),s.media.seeking=!0,O.call(s,s.media,"seeking"),a.seekTo(m)}}),Object.defineProperty(s.media,"playbackRate",{get:()=>a.getPlaybackRate(),set(m){a.setPlaybackRate(m)}});let{volume:l}=s.config;Object.defineProperty(s.media,"volume",{get:()=>l,set(m){l=m,a.setVolume(100*l),O.call(s,s.media,"volumechange")}});let{muted:u}=s.config;Object.defineProperty(s.media,"muted",{get:()=>u,set(m){const h=g.boolean(m)?m:u;u=h,a[h?"mute":"unMute"](),a.setVolume(100*l),O.call(s,s.media,"volumechange")}}),Object.defineProperty(s.media,"currentSrc",{get:()=>a.getVideoUrl()}),Object.defineProperty(s.media,"ended",{get:()=>s.currentTime===s.duration});const c=a.getAvailablePlaybackRates();s.options.speed=c.filter(m=>s.config.speed.options.includes(m)),s.supported.ui&&e.customControls&&s.media.setAttribute("tabindex",-1),O.call(s,s.media,"timeupdate"),O.call(s,s.media,"durationchange"),clearInterval(s.timers.buffering),s.timers.buffering=setInterval(()=>{s.media.buffered=a.getVideoLoadedFraction(),(s.media.lastBuffered===null||s.media.lastBuffered<s.media.buffered)&&O.call(s,s.media,"progress"),s.media.lastBuffered=s.media.buffered,s.media.buffered===1&&(clearInterval(s.timers.buffering),O.call(s,s.media,"canplaythrough"))},200),e.customControls&&setTimeout(()=>H.build.call(s),50)},onStateChange(o){const a=o.target;switch(clearInterval(s.timers.playing),s.media.seeking&&[1,2].includes(o.data)&&(s.media.seeking=!1,O.call(s,s.media,"seeked")),o.data){case-1:O.call(s,s.media,"timeupdate"),s.media.buffered=a.getVideoLoadedFraction(),O.call(s,s.media,"progress");break;case 0:nt.call(s,!1),s.media.loop?(a.stopVideo(),a.playVideo()):O.call(s,s.media,"ended");break;case 1:e.customControls&&!s.config.autoplay&&s.media.paused&&!s.embed.hasPlayed?s.media.pause():(nt.call(s,!0),O.call(s,s.media,"playing"),s.timers.playing=setInterval(()=>{O.call(s,s.media,"timeupdate")},50),s.media.duration!==a.getDuration()&&(s.media.duration=a.getDuration(),O.call(s,s.media,"durationchange")));break;case 2:s.muted||s.embed.unMute(),nt.call(s,!1);break;case 3:O.call(s,s.media,"waiting")}O.call(s,s.elements.container,"statechange",!1,{code:o.data})}}})}},tn={setup(){this.media?(V(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),V(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&V(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=B("div",{class:this.config.classNames.video}),qs(this.media,this.elements.wrapper),this.elements.poster=B("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?Ie.setup.call(this):this.isYouTube?Ft.setup.call(this):this.isVimeo&&Si.setup.call(this)):this.debug.warn("No media element found!")}};class ra{constructor(e){k(this,"load",()=>{this.enabled&&(g.object(window.google)&&g.object(window.google.ima)?this.ready():Di(this.player.config.urls.googleIMA.sdk).then(()=>{this.ready()}).catch(()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))}))}),k(this,"ready",()=>{var t;this.enabled||((t=this).manager&&t.manager.destroy(),t.elements.displayContainer&&t.elements.displayContainer.destroy(),t.elements.container.remove()),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then(()=>{this.clearSafetyTimer("onAdsManagerLoaded()")}),this.listeners(),this.setupIMA()}),k(this,"setupIMA",()=>{this.elements.container=B("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,t=>this.onAdsManagerLoaded(t),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,t=>this.onAdError(t),!1),this.requestAds()}),k(this,"requestAds",()=>{const{container:t}=this.player.elements;try{const i=new google.ima.AdsRequest;i.adTagUrl=this.tagUrl,i.linearAdSlotWidth=t.offsetWidth,i.linearAdSlotHeight=t.offsetHeight,i.nonLinearAdSlotWidth=t.offsetWidth,i.nonLinearAdSlotHeight=t.offsetHeight,i.forceNonLinearFullSlot=!1,i.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(i)}catch(i){this.onAdError(i)}}),k(this,"pollCountdown",(t=!1)=>{if(!t)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval(()=>{const i=Ht(Math.max(this.manager.getRemainingTime(),0)),n=`${te.get("advertisement",this.player.config)} - ${i}`;this.elements.container.setAttribute("data-badge-text",n)},100)}),k(this,"onAdsManagerLoaded",t=>{if(!this.enabled)return;const i=new google.ima.AdsRenderingSettings;i.restoreCustomPlaybackStateOnAdBreakComplete=!0,i.enablePreloading=!0,this.manager=t.getAdsManager(this.player,i),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,n=>this.onAdError(n)),Object.keys(google.ima.AdEvent.Type).forEach(n=>{this.manager.addEventListener(google.ima.AdEvent.Type[n],r=>this.onAdEvent(r))}),this.trigger("loaded")}),k(this,"addCuePoints",()=>{g.empty(this.cuePoints)||this.cuePoints.forEach(t=>{if(t!==0&&t!==-1&&t<this.player.duration){const i=this.player.elements.progress;if(g.element(i)){const n=100/this.player.duration*t,r=B("span",{class:this.player.config.classNames.cues});r.style.left=`${n.toString()}%`,i.appendChild(r)}}})}),k(this,"onAdEvent",t=>{const{container:i}=this.player.elements,n=t.getAd(),r=t.getAdData();switch((o=>{O.call(this.player,this.player.media,`ads${o.replace(/_/g,"").toLowerCase()}`)})(t.type),t.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),n.isLinear()||(n.width=i.offsetWidth,n.height=i.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:this.manager.setVolume(this.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.player.ended?this.loadAds():this.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.LOG:r.adError&&this.player.debug.warn(`Non-fatal ad error: ${r.adError.getMessage()}`)}}),k(this,"onAdError",t=>{this.cancel(),this.player.debug.warn("Ads error",t)}),k(this,"listeners",()=>{const{container:t}=this.player.elements;let i;this.player.on("canplay",()=>{this.addCuePoints()}),this.player.on("ended",()=>{this.loader.contentComplete()}),this.player.on("timeupdate",()=>{i=this.player.currentTime}),this.player.on("seeked",()=>{const n=this.player.currentTime;g.empty(this.cuePoints)||this.cuePoints.forEach((r,o)=>{i<r&&r<n&&(this.manager.discardAdBreak(),this.cuePoints.splice(o,1))})}),window.addEventListener("resize",()=>{this.manager&&this.manager.resize(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL)})}),k(this,"play",()=>{const{container:t}=this.player.elements;this.managerPromise||this.resumeContent(),this.managerPromise.then(()=>{this.manager.setVolume(this.player.volume),this.elements.displayContainer.initialize();try{this.initialized||(this.manager.init(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL),this.manager.start()),this.initialized=!0}catch(i){this.onAdError(i)}}).catch(()=>{})}),k(this,"resumeContent",()=>{this.elements.container.style.zIndex="",this.playing=!1,Te(this.player.media.play())}),k(this,"pauseContent",()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()}),k(this,"cancel",()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()}),k(this,"loadAds",()=>{this.managerPromise.then(()=>{this.manager&&this.manager.destroy(),this.managerPromise=new Promise(t=>{this.on("loaded",t),this.player.debug.log(this.manager)}),this.initialized=!1,this.requestAds()}).catch(()=>{})}),k(this,"trigger",(t,...i)=>{const n=this.events[t];g.array(n)&&n.forEach(r=>{g.function(r)&&r.apply(this,i)})}),k(this,"on",(t,i)=>(g.array(this.events[t])||(this.events[t]=[]),this.events[t].push(i),this)),k(this,"startSafetyTimer",(t,i)=>{this.player.debug.log(`Safety timer invoked from: ${i}`),this.safetyTimer=setTimeout(()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")},t)}),k(this,"clearSafetyTimer",t=>{g.nullOrUndefined(this.safetyTimer)||(this.player.debug.log(`Safety timer cleared from: ${t}`),clearTimeout(this.safetyTimer),this.safetyTimer=null)}),this.player=e,this.config=e.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise((t,i)=>{this.on("loaded",t),this.on("error",i)}),this.load()}get enabled(){const{config:e}=this;return this.player.isHTML5&&this.player.isVideo&&e.enabled&&(!g.empty(e.publisherId)||g.url(e.tagUrl))}get tagUrl(){const{config:e}=this;return g.url(e.tagUrl)?e.tagUrl:`https://go.aniview.com/api/adserver6/vast/?${$s({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:e.publisherId})}`}}function sn(s=0,e=0,t=255){return Math.min(Math.max(s,e),t)}const aa=s=>{const e=[];return s.split(/\r\n\r\n|\n\n|\r\r/).forEach(t=>{const i={};t.split(/\r\n|\n|\r/).forEach(n=>{if(g.number(i.startTime)){if(!g.empty(n.trim())&&g.empty(i.text)){const r=n.trim().split("#xywh=");[i.text]=r,r[1]&&([i.x,i.y,i.w,i.h]=r[1].split(","))}}else{const r=n.match(/([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/);r&&(i.startTime=60*Number(r[1]||0)*60+60*Number(r[2])+Number(r[3])+Number(`0.${r[4]}`),i.endTime=60*Number(r[6]||0)*60+60*Number(r[7])+Number(r[8])+Number(`0.${r[9]}`))}}),i.text&&e.push(i)}),e},rs=(s,e)=>{const t={};return s>e.width/e.height?(t.width=e.width,t.height=1/s*e.width):(t.height=e.height,t.width=s*e.height),t};class ki{constructor(e){k(this,"load",()=>{this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then(()=>{this.enabled&&(this.render(),this.determineContainerAutoSizing(),this.listeners(),this.loaded=!0)})}),k(this,"getThumbnails",()=>new Promise(t=>{const{src:i}=this.player.config.previewThumbnails;if(g.empty(i))throw new Error("Missing previewThumbnails.src config attribute");const n=()=>{this.thumbnails.sort((r,o)=>r.height-o.height),this.player.debug.log("Preview thumbnails",this.thumbnails),t()};if(g.function(i))i(r=>{this.thumbnails=r,n()});else{const r=(g.string(i)?[i]:i).map(o=>this.getThumbnail(o));Promise.all(r).then(n)}})),k(this,"getThumbnail",t=>new Promise(i=>{yt(t).then(n=>{const r={frames:aa(n),height:null,urlPrefix:""};r.frames[0].text.startsWith("/")||r.frames[0].text.startsWith("http://")||r.frames[0].text.startsWith("https://")||(r.urlPrefix=t.substring(0,t.lastIndexOf("/")+1));const o=new Image;o.onload=()=>{r.height=o.naturalHeight,r.width=o.naturalWidth,this.thumbnails.push(r),i()},o.src=r.urlPrefix+r.frames[0].text})})),k(this,"startMove",t=>{if(this.loaded&&g.event(t)&&["touchmove","mousemove"].includes(t.type)&&this.player.media.duration){if(t.type==="touchmove")this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{var i,n;const r=this.player.elements.progress.getBoundingClientRect(),o=100/r.width*(t.pageX-r.left);this.seekTime=this.player.media.duration*(o/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=t.pageX,this.elements.thumb.time.innerText=Ht(this.seekTime);const a=(i=this.player.config.markers)===null||i===void 0||(n=i.points)===null||n===void 0?void 0:n.find(({time:l})=>l===Math.round(this.seekTime));a&&this.elements.thumb.time.insertAdjacentHTML("afterbegin",`${a.label}<br>`)}this.showImageAtCurrentTime()}}),k(this,"endMove",()=>{this.toggleThumbContainer(!1,!0)}),k(this,"startScrubbing",t=>{(g.nullOrUndefined(t.button)||t.button===!1||t.button===0)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))}),k(this,"endScrubbing",()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):Ri.call(this.player,this.player.media,"timeupdate",()=>{this.mouseDown||this.toggleScrubbingContainer(!1)})}),k(this,"listeners",()=>{this.player.on("play",()=>{this.toggleThumbContainer(!1,!0)}),this.player.on("seeked",()=>{this.toggleThumbContainer(!1)}),this.player.on("timeupdate",()=>{this.lastTime=this.player.media.currentTime})}),k(this,"render",()=>{this.elements.thumb.container=B("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=B("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const t=B("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=B("span",{},"00:00"),t.appendChild(this.elements.thumb.time),this.elements.thumb.imageContainer.appendChild(t),g.element(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=B("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)}),k(this,"destroy",()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()}),k(this,"showImageAtCurrentTime",()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();const t=this.thumbnails[0].frames.findIndex(r=>this.seekTime>=r.startTime&&this.seekTime<=r.endTime),i=t>=0;let n=0;this.mouseDown||this.toggleThumbContainer(i),i&&(this.thumbnails.forEach((r,o)=>{this.loadedImages.includes(r.frames[t].text)&&(n=o)}),t!==this.showingThumb&&(this.showingThumb=t,this.loadImage(n)))}),k(this,"loadImage",(t=0)=>{const i=this.showingThumb,n=this.thumbnails[t],{urlPrefix:r}=n,o=n.frames[i],a=n.frames[i].text,l=r+a;if(this.currentImageElement&&this.currentImageElement.dataset.filename===a)this.showImage(this.currentImageElement,o,t,i,a,!1),this.currentImageElement.dataset.index=i,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);const u=new Image;u.src=l,u.dataset.index=i,u.dataset.filename=a,this.showingThumbFilename=a,this.player.debug.log(`Loading image: ${l}`),u.onload=()=>this.showImage(u,o,t,i,a,!0),this.loadingImage=u,this.removeOldImages(u)}}),k(this,"showImage",(t,i,n,r,o,a=!0)=>{this.player.debug.log(`Showing thumb: ${o}. num: ${r}. qual: ${n}. newimg: ${a}`),this.setImageSizeAndOffset(t,i),a&&(this.currentImageContainer.appendChild(t),this.currentImageElement=t,this.loadedImages.includes(o)||this.loadedImages.push(o)),this.preloadNearby(r,!0).then(this.preloadNearby(r,!1)).then(this.getHigherQuality(n,t,i,o))}),k(this,"removeOldImages",t=>{Array.from(this.currentImageContainer.children).forEach(i=>{if(i.tagName.toLowerCase()!=="img")return;const n=this.usingSprites?500:1e3;if(i.dataset.index!==t.dataset.index&&!i.dataset.deleting){i.dataset.deleting=!0;const{currentImageContainer:r}=this;setTimeout(()=>{r.removeChild(i),this.player.debug.log(`Removing thumb: ${i.dataset.filename}`)},n)}})}),k(this,"preloadNearby",(t,i=!0)=>new Promise(n=>{setTimeout(()=>{const r=this.thumbnails[0].frames[t].text;if(this.showingThumbFilename===r){let o;o=i?this.thumbnails[0].frames.slice(t):this.thumbnails[0].frames.slice(0,t).reverse();let a=!1;o.forEach(l=>{const u=l.text;if(u!==r&&!this.loadedImages.includes(u)){a=!0,this.player.debug.log(`Preloading thumb filename: ${u}`);const{urlPrefix:c}=this.thumbnails[0],m=c+u,h=new Image;h.src=m,h.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${u}`),this.loadedImages.includes(u)||this.loadedImages.push(u),n()}}}),a||n()}},300)})),k(this,"getHigherQuality",(t,i,n,r)=>{if(t<this.thumbnails.length-1){let o=i.naturalHeight;this.usingSprites&&(o=n.h),o<this.thumbContainerHeight&&setTimeout(()=>{this.showingThumbFilename===r&&(this.player.debug.log(`Showing higher quality thumb for: ${r}`),this.loadImage(t+1))},300)}}),k(this,"toggleThumbContainer",(t=!1,i=!1)=>{const n=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(n,t),!t&&i&&(this.showingThumb=null,this.showingThumbFilename=null)}),k(this,"toggleScrubbingContainer",(t=!1)=>{const i=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(i,t),t||(this.showingThumb=null,this.showingThumbFilename=null)}),k(this,"determineContainerAutoSizing",()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)}),k(this,"setThumbContainerSizeAndPos",()=>{const{imageContainer:t}=this.elements.thumb;if(this.sizeSpecifiedInCSS){if(t.clientHeight>20&&t.clientWidth<20){const i=Math.floor(t.clientHeight*this.thumbAspectRatio);t.style.width=`${i}px`}else if(t.clientHeight<20&&t.clientWidth>20){const i=Math.floor(t.clientWidth/this.thumbAspectRatio);t.style.height=`${i}px`}}else{const i=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);t.style.height=`${this.thumbContainerHeight}px`,t.style.width=`${i}px`}this.setThumbContainerPos()}),k(this,"setThumbContainerPos",()=>{const t=this.player.elements.progress.getBoundingClientRect(),i=this.player.elements.container.getBoundingClientRect(),{container:n}=this.elements.thumb,r=i.left-t.left+10,o=i.right-t.left-n.clientWidth-10,a=this.mousePosX-t.left-n.clientWidth/2,l=sn(a,r,o);n.style.left=`${l}px`,n.style.setProperty("--preview-arrow-offset",a-l+"px")}),k(this,"setScrubbingContainerSize",()=>{const{width:t,height:i}=rs(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});this.elements.scrubbing.container.style.width=`${t}px`,this.elements.scrubbing.container.style.height=`${i}px`}),k(this,"setImageSizeAndOffset",(t,i)=>{if(!this.usingSprites)return;const n=this.thumbContainerHeight/i.h;t.style.height=t.naturalHeight*n+"px",t.style.width=t.naturalWidth*n+"px",t.style.left=`-${i.x*n}px`,t.style.top=`-${i.y*n}px`}),this.player=e,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}get enabled(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}get currentImageContainer(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}get usingSprites(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}get thumbAspectRatio(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}get thumbContainerHeight(){if(this.mouseDown){const{height:e}=rs(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});return e}return this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}get currentImageElement(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement}set currentImageElement(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}const Ni={insertElements(s,e){g.string(e)?ts(s,this.media,{src:e}):g.array(e)&&e.forEach(t=>{ts(s,this.media,t)})},change(s){Ws(s,"sources.length")?(Ie.cancelRequests.call(this),this.destroy.call(this,()=>{this.options.quality=[],Se(this.media),this.media=null,g.element(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:e,type:t}=s,[{provider:i=Fe.html5,src:n}]=e,r=i==="html5"?t:"div",o=i==="html5"?{}:{src:n};Object.assign(this,{provider:i,type:t,supported:Z.check(t,i,this.config.playsinline),media:B(r,o)}),this.elements.container.appendChild(this.media),g.boolean(s.autoplay)&&(this.config.autoplay=s.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute("crossorigin",""),this.config.autoplay&&this.media.setAttribute("autoplay",""),g.empty(s.poster)||(this.poster=s.poster),this.config.loop.active&&this.media.setAttribute("loop",""),this.config.muted&&this.media.setAttribute("muted",""),this.config.playsinline&&this.media.setAttribute("playsinline","")),H.addStyleHook.call(this),this.isHTML5&&Ni.insertElements.call(this,"source",e),this.config.title=s.title,tn.setup.call(this),this.isHTML5&&Object.keys(s).includes("tracks")&&Ni.insertElements.call(this,"track",s.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&H.build.call(this),this.isHTML5&&this.media.load(),g.empty(s.previewThumbnails)||(Object.assign(this.config.previewThumbnails,s.previewThumbnails),this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new ki(this))),this.fullscreen.update()},!0)):this.debug.warn("Invalid source format")}};class dt{constructor(e,t){if(k(this,"play",()=>g.function(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then(()=>this.ads.play()).catch(()=>Te(this.media.play())),this.media.play()):null),k(this,"pause",()=>this.playing&&g.function(this.media.pause)?this.media.pause():null),k(this,"togglePlay",a=>(g.boolean(a)?a:!this.playing)?this.play():this.pause()),k(this,"stop",()=>{this.isHTML5?(this.pause(),this.restart()):g.function(this.media.stop)&&this.media.stop()}),k(this,"restart",()=>{this.currentTime=0}),k(this,"rewind",a=>{this.currentTime-=g.number(a)?a:this.config.seekTime}),k(this,"forward",a=>{this.currentTime+=g.number(a)?a:this.config.seekTime}),k(this,"increaseVolume",a=>{const l=this.media.muted?0:this.volume;this.volume=l+(g.number(a)?a:0)}),k(this,"decreaseVolume",a=>{this.increaseVolume(-a)}),k(this,"airplay",()=>{Z.airplay&&this.media.webkitShowPlaybackTargetPicker()}),k(this,"toggleControls",a=>{if(this.supported.ui&&!this.isAudio){const l=Lt(this.elements.container,this.config.classNames.hideControls),u=a===void 0?void 0:!a,c=V(this.elements.container,this.config.classNames.hideControls,u);if(c&&g.array(this.config.controls)&&this.config.controls.includes("settings")&&!g.empty(this.config.settings)&&S.toggleMenu.call(this,!1),c!==l){const m=c?"controlshidden":"controlsshown";O.call(this,this.media,m)}return!c}return!1}),k(this,"on",(a,l)=>{R.call(this,this.elements.container,a,l)}),k(this,"once",(a,l)=>{Ri.call(this,this.elements.container,a,l)}),k(this,"off",(a,l)=>{Ut(this.elements.container,a,l)}),k(this,"destroy",(a,l=!1)=>{if(!this.ready)return;const u=()=>{document.body.style.overflow="",this.embed=null,l?(Object.keys(this.elements).length&&(Se(this.elements.buttons.play),Se(this.elements.captions),Se(this.elements.controls),Se(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),g.function(a)&&a()):(Ur.call(this),Ie.cancelRequests.call(this),Rt(this.elements.original,this.elements.container),O.call(this,this.elements.original,"destroyed",!0),g.function(a)&&a.call(this.elements.original),this.ready=!1,setTimeout(()=>{this.elements=null,this.media=null},200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(H.toggleNativeControls.call(this,!0),u()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),this.embed!==null&&g.function(this.embed.destroy)&&this.embed.destroy(),u()):this.isVimeo&&(this.embed!==null&&this.embed.unload().then(u),setTimeout(u,200))}),k(this,"supports",a=>Z.mime.call(this,a)),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=Z.touch,this.media=e,g.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||g.nodeList(this.media)||g.array(this.media))&&(this.media=this.media[0]),this.config=J({},en,dt.defaults,t||{},(()=>{try{return JSON.parse(this.media.getAttribute("data-plyr-config"))}catch{return{}}})()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new Zr(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",Z),g.nullOrUndefined(this.media)||!g.element(this.media))return void this.debug.error("Setup failed: no suitable element passed");if(this.media.plyr)return void this.debug.warn("Target already setup");if(!this.config.enabled)return void this.debug.error("Setup failed: disabled by config");if(!Z.check().api)return void this.debug.error("Setup failed: no support");const i=this.media.cloneNode(!0);i.autoplay=!1,this.elements.original=i;const n=this.media.tagName.toLowerCase();let r=null,o=null;switch(n){case"div":if(r=this.media.querySelector("iframe"),g.element(r)){if(o=_s(r.getAttribute("src")),this.provider=Jr(o.toString()),this.elements.container=this.media,this.media=r,this.elements.container.className="",o.search.length){const a=["1","true"];a.includes(o.searchParams.get("autoplay"))&&(this.config.autoplay=!0),a.includes(o.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=a.includes(o.searchParams.get("playsinline")),this.config.youtube.hl=o.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(g.empty(this.provider)||!Object.values(Fe).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=mi.video;break;case"video":case"audio":this.type=n,this.provider=Fe.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=Z.check(this.type,this.provider),this.supported.api?(this.eventListeners=[],this.listeners=new _r(this),this.storage=new ht(this),this.media.plyr=this,g.element(this.elements.container)||(this.elements.container=B("div"),qs(this.media,this.elements.container)),H.migrateStyles.call(this),H.addStyleHook.call(this),tn.setup.call(this),this.config.debug&&R.call(this,this.elements.container,this.config.events.join(" "),a=>{this.debug.log(`event: ${a.type}`)}),this.fullscreen=new ye(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&H.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new ra(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",()=>Te(this.play())),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new ki(this))):this.debug.error("Setup failed: no support")}get isHTML5(){return this.provider===Fe.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===Fe.youtube}get isVimeo(){return this.provider===Fe.vimeo}get isVideo(){return this.type===mi.video}get isAudio(){return this.type===mi.audio}get playing(){return Boolean(this.ready&&!this.paused&&!this.ended)}get paused(){return Boolean(this.media.paused)}get stopped(){return Boolean(this.paused&&this.currentTime===0)}get ended(){return Boolean(this.media.ended)}set currentTime(e){if(!this.duration)return;const t=g.number(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log(`Seeking to ${this.currentTime} seconds`)}get currentTime(){return Number(this.media.currentTime)}get buffered(){const{buffered:e}=this.media;return g.number(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}get seeking(){return Boolean(this.media.seeking)}get duration(){const e=parseFloat(this.config.duration),t=(this.media||{}).duration,i=g.number(t)&&t!==1/0?t:0;return e||i}set volume(e){let t=e;g.string(t)&&(t=Number(t)),g.number(t)||(t=this.storage.get("volume")),g.number(t)||({volume:t}=this.config),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!g.empty(e)&&this.muted&&t>0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(e){let t=e;g.boolean(t)||(t=this.storage.get("muted")),g.boolean(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t}get muted(){return Boolean(this.media.muted)}get hasAudio(){return!this.isHTML5||!!this.isAudio||Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)}set speed(e){let t=null;g.number(e)&&(t=e),g.number(t)||(t=this.storage.get("speed")),g.number(t)||(t=this.config.speed.selected);const{minimumSpeed:i,maximumSpeed:n}=this;t=sn(t,i,n),this.config.speed.selected=t,setTimeout(()=>{this.media&&(this.media.playbackRate=t)},0)}get speed(){return Number(this.media.playbackRate)}get minimumSpeed(){return this.isYouTube?Math.min(...this.options.speed):this.isVimeo?.5:.0625}get maximumSpeed(){return this.isYouTube?Math.max(...this.options.speed):this.isVimeo?2:16}set quality(e){const t=this.config.quality,i=this.options.quality;if(!i.length)return;let n=[!g.empty(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(g.number),r=!0;if(!i.includes(n)){const o=Xs(i,n);this.debug.warn(`Unsupported quality option: ${n}, using ${o} instead`),n=o,r=!1}t.selected=n,this.media.quality=n,r&&this.storage.set({quality:n})}get quality(){return this.media.quality}set loop(e){const t=g.boolean(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t}get loop(){return Boolean(this.media.loop)}set source(e){Ni.change.call(this,e)}get source(){return this.media.currentSrc}get download(){const{download:e}=this.config.urls;return g.url(e)?e:this.source}set download(e){g.url(e)&&(this.config.urls.download=e,S.setDownloadUrl.call(this))}set poster(e){this.isVideo?H.setPoster.call(this,e,!1).catch(()=>{}):this.debug.warn("Poster can only be set for video")}get poster(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}get ratio(){if(!this.isVideo)return null;const e=Dt(Li.call(this));return g.array(e)?e.join(":"):e}set ratio(e){this.isVideo?g.string(e)&&js(e)?(this.config.ratio=Dt(e),$e.call(this)):this.debug.error(`Invalid aspect ratio specified (${e})`):this.debug.warn("Aspect ratio can only be set for video")}set autoplay(e){this.config.autoplay=g.boolean(e)?e:this.config.autoplay}get autoplay(){return Boolean(this.config.autoplay)}toggleCaptions(e){L.toggle.call(this,e,!1)}set currentTrack(e){L.set.call(this,e,!1),L.setup.call(this)}get currentTrack(){const{toggled:e,currentTrack:t}=this.captions;return e?t:-1}set language(e){L.setLanguage.call(this,e,!1)}get language(){return(L.getCurrentTrack.call(this)||{}).language}set pip(e){if(!Z.pip)return;const t=g.boolean(e)?e:!this.pip;g.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?di.active:di.inactive),g.function(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}get pip(){return Z.pip?g.empty(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===di.active:null}setPreviewThumbnails(e){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,e),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new ki(this))}static supported(e,t){return Z.check(e,t)}static loadSprite(e,t){return Js(e,t)}static setup(e,t={}){let i=null;return g.string(e)?i=Array.from(document.querySelectorAll(e)):g.nodeList(e)?i=Array.from(e):g.array(e)&&(i=e.filter(g.element)),g.empty(i)?null:i.map(n=>new dt(n,t))}}dt.defaults=Rr(en);const oa="_staffContainer_f8ytm_1",la="_staffTitle_f8ytm_6",ua="_staffImg_f8ytm_13",ca="_name_f8ytm_17",ha="_boxStyle_f8ytm_22",da="_active_f8ytm_29";var he={staffContainer:oa,staffTitle:la,staffImg:ua,name:ca,boxStyle:ha,active:da},pi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAA11JREFUWEfVmU1ME0EUx/9vt0TkO6EkLdg0IKF08aZGr569mKgJB0+e1OAdDp484F0jnDyZGAMHL569mqgn7JYShJAKbUKbAAUsod0nb9NtxvJRKiUd5rTZnXnzm/fmfcws4T8aMxu2bd80DOMOgOsAIgCCANpL4nIAUgASAH44jvPFsqxvROTUOh3VMiCRSPQVCoUxAI+I6EotY5n5N4D3Pp/vTSQSWT3t2FMBxuPxbmZ+CeAxgEunFX5Mvz0A74joRTQazVaTVRXQtu1RAK8B+FVhPp8Pra2taGlpQXNzM5qammAYhtvFcRzs7+8jn89jd3cXOzs7KBQKlSwZ0zTHIpHIx5MgjwVkZt+B5gTsiSpAgLq7u104oqrrc4cyswuZzWZd4Io2faDJ50R0aAXS78gZksnk5VwuNwPgridMNBQIBND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ERDic1GlJ8Zrmv2cbID9fKav7olUg/ka2OibCP4JHesj3WPYtwvhAS4t6FgA0j5kvA8gNCGPTkwDoMEhsUoqTmwf7ieWnQkDHIrdwoVsrODqOSJa8Je0ffBKBWyUmG3mDCLQWlcalVAlSCU4kis8Vr9tyOhvdXGVsr4BcA/l/1XMIyDPzDgEOAXlGIM/uLVeAVhO4Weg86EuoPOf9ibiXZJql1LVst2LcIcAKWhlkHQJsBDMXU58KAWqofAazMN7LOiMNASLpTqvfDlluQcb/wRKtbeb3ow4R5xHwFI04SuEmS98kWSbAQdteBBwC7MXTsjWHAMuQ2avgEGAvnpatOQRYhsxeBYcAe/G0bM0hwDJk9io4BNiLp2VrDgGWIbNXwSHAXjwtW/svbQM/ebg6togAAAAASUVORK5CYII=",va=Oi({name:"staff-change",props:{radio:{type:String,default:"staff"}},emits:["change","close"],setup(s,{emit:e}){const{radio:t}=vn(s),i=n=>{t.value=n,e("change",n),e("close")};return()=>N("div",{class:he.staffContainer},[N("div",{class:he.staffTitle},[ve("\u8F6C\u6362\u66F2\u8C31")]),N(Rn,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{default:()=>[N(Ln,{border:!1},{default:()=>[N(ui,{center:!0,border:!1,class:t.value==="staff"?he.active:"",onClick:()=>i("staff")},{icon:()=>N(ot,{src:t.value==="staff"?ga:ma,class:he.staffImg},null),title:()=>N("span",{class:he.name},[ve("\u4E94\u7EBF\u8C31")]),value:()=>N(li,{name:"staff"},{icon:n=>N(si,{class:he.boxStyle,name:n.checked?fi:pi},null)})}),N(ui,{center:!0,border:!1,class:t.value==="first"?he.active:"",onClick:()=>i("first")},{icon:()=>N(ot,{src:t.value==="first"?ba:ya,class:he.staffImg},null),title:()=>N("span",{class:he.name},[ve("\u7B80\u8C31-\u9996\u8C03")]),value:()=>N(li,{name:"first"},{icon:n=>N(si,{class:he.boxStyle,name:n.checked?fi:pi},null)})}),N(ui,{center:!0,border:!1,class:t.value==="fixed"?he.active:"",onClick:()=>i("fixed")},{icon:()=>N(ot,{src:t.value==="fixed"?fa:pa,class:he.staffImg},null),title:()=>N("span",{class:he.name},[ve("\u7B80\u8C31-\u56FA\u5B9A\u8C03")]),value:()=>N(li,{name:"fixed"},{icon:n=>N(si,{class:he.boxStyle,name:n.checked?fi:pi},null)})})]})]})])}});const Aa="_downloadContainer_ahrb6_1",wa="_musicContainer_ahrb6_4",Ca="_musicImg_ahrb6_15",Ta="_num_ahrb6_18",xa="_page_ahrb6_26",Ea="_downloadBtn_ahrb6_32";var Be={downloadContainer:Aa,musicContainer:wa,musicImg:Ca,num:Ta,page:xa,downloadBtn:Ea};const Sa=async s=>{console.log("imgToCanvas",s);const e=document.createElement("img");e.setAttribute("crossOrigin","anonymous"),s&&typeof s=="string"&&s.includes("data:image")?e.src=s:e.src=s+`?t=${+new Date}`,await new Promise(n=>e.onload=n);const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");return i.fillStyle="rgb(255, 255, 255)",i.fillStyle="#fff",i.fillRect(0,0,e.width,e.height),i.drawImage(e,0,0),t},ka=async(s,e)=>{console.log("addWatermark");try{const t=s.getContext("2d"),i=document.createElement("img");i.setAttribute("crossOrigin","anonymous"),it&&typeof it=="string"&&it.includes("data:image")?i.src=it:i.src=it+`?${new Date().getTime()}`,await new Promise(a=>i.onload=a);const n=document.createElement("canvas");n.width=600,n.height=500;const r=n.getContext("2d");r.clearRect(0,0,n.width,n.height),r.rotate(-30*Math.PI/180),r.drawImage(i,0,300);const o=t.createPattern(n,"repeat");return t.fillStyle=o,t.fillRect(0,0,s.width,s.height),s}catch(t){console.log(t)}},Na=(s,e)=>{s.getContext("2d");const t=document.createElement("canvas");t.width=s.width,t.height=s.height+70;const i=t.getContext("2d");return i.fillStyle="#fff",i.fillRect(0,0,s.width,s.height+90),i.font="40pt Calibri",i.fillStyle="#000",i.textAlign="center",i.drawImage(s,0,70),i.fillText(e.title,s.width/2,120),t},Pa=s=>s.toDataURL("image/png");var Ma=Oi({name:"download",props:{imgList:{type:Array,default:()=>[]},musicSheetName:{type:String,default:""}},setup(s){const e=be(s.imgList),t=be();Ns(()=>s.imgList,l=>{e.value=l,i.value=0,t.value&&t.value.swipeTo(0)});const i=be(0),n=be(!1),r=be(""),o=async()=>{if(!n.value)if(n.value=!0,r.value)a();else{console.log(e.value[i.value],"list.value[acitveIndex.value]");const l=await Sa(e.value[i.value]),u=Na(l,{title:s.musicSheetName,size:12}),c=await ka(u);r.value=Pa(c),console.log(r.value,"image.value"),await a()}},a=async()=>{var u;An({message:"\u56FE\u7247\u751F\u6210\u4E2D...",forbidClick:!0}),setTimeout(()=>{n.value=!1},100);const l=await Ms({api:"savePicture",content:{base64:r.value}});((u=l==null?void 0:l.content)==null?void 0:u.status)==="success"?wn("\u5DF2\u4FDD\u5B58\u5230\u76F8\u518C"):Cn("\u4FDD\u5B58\u5931\u8D25")};return()=>N("div",{class:Be.downloadContainer},[N("div",{class:Be.musicContainer},[N("h2",null,[s.musicSheetName]),N("div",{class:Be.musicImg},[N(Dn,{ref:t,showIndicators:!1,loop:!1,onChange:l=>{i.value=l,r.value=""}},{default:()=>[e.value.length>0&&e.value.map(l=>N(Vn,null,{default:()=>[N(ot,{src:l},null)]}))]})])]),N("div",{class:Be.buttonGroup},[N("div",{class:Be.num},[N("span",{class:Be.page},[i.value+1,ve("/"),e.value.length]),N("span",{class:Be.countPage},[ve("\uFF08\u5171"),e.value.length,ve("\u9875\uFF09")])]),N(Ps,{type:"primary",color:"#FF8057",class:Be.downloadBtn,block:!0,round:!0,onClick:()=>o(),loading:n.value,loadingText:"\u4E0B\u8F7D\u4E2D..."},{default:()=>[ve("\u4E0B\u8F7D\u5F53\u524D\u9875\u9762")]})])])}}),zt={exports:{}},at={exports:{}};(function(){var s,e,t,i,n,r;typeof performance!="undefined"&&performance!==null&&performance.now?at.exports=function(){return performance.now()}:typeof process!="undefined"&&process!==null&&process.hrtime?(at.exports=function(){return(s()-n)/1e6},e=process.hrtime,s=function(){var o;return o=e(),o[0]*1e9+o[1]},i=s(),r=process.uptime()*1e9,n=i-r):Date.now?(at.exports=function(){return Date.now()-t},t=Date.now()):(at.exports=function(){return new Date().getTime()-t},t=new Date().getTime())}).call(Bs);var Ba=at.exports,ke=typeof window=="undefined"?Bs:window,Nt=["moz","webkit"],Ze="AnimationFrame",et=ke["request"+Ze],mt=ke["cancel"+Ze]||ke["cancelRequest"+Ze];for(var rt=0;!et&&rt<Nt.length;rt++)et=ke[Nt[rt]+"Request"+Ze],mt=ke[Nt[rt]+"Cancel"+Ze]||ke[Nt[rt]+"CancelRequest"+Ze];if(!et||!mt){var yi=0,as=0,Qe=[],Oa=1e3/60;et=function(s){if(Qe.length===0){var e=Ba(),t=Math.max(0,Oa-(e-yi));yi=t+e,setTimeout(function(){var i=Qe.slice(0);Qe.length=0;for(var n=0;n<i.length;n++)if(!i[n].cancelled)try{i[n].callback(yi)}catch(r){setTimeout(function(){throw r},0)}},Math.round(t))}return Qe.push({handle:++as,callback:s,cancelled:!1}),as},mt=function(s){for(var e=0;e<Qe.length;e++)Qe[e].handle===s&&(Qe[e].cancelled=!0)}}zt.exports=function(s){return et.call(ke,s)};zt.exports.cancel=function(){mt.apply(ke,arguments)};zt.exports.polyfill=function(s){s||(s=ke),s.requestAnimationFrame=et,s.cancelAnimationFrame=mt};var bi=zt.exports,Pi=function(s){this.ok=!1,this.alpha=1,s.charAt(0)=="#"&&(s=s.substr(1,6)),s=s.replace(/ /g,""),s=s.toLowerCase();var e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};s=e[s]||s;for(var t=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:["rgba(123, 234, 45, 0.8)","rgba(255,234,245,1.0)"],process:function(l){return[parseInt(l[1]),parseInt(l[2]),parseInt(l[3]),parseFloat(l[4])]}},{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(l){return[parseInt(l[1]),parseInt(l[2]),parseInt(l[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(l){return[parseInt(l[1],16),parseInt(l[2],16),parseInt(l[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(l){return[parseInt(l[1]+l[1],16),parseInt(l[2]+l[2],16),parseInt(l[3]+l[3],16)]}}],i=0;i<t.length;i++){var n=t[i].re,r=t[i].process,o=n.exec(s);if(o){var a=r(o);this.r=a[0],this.g=a[1],this.b=a[2],a.length>3&&(this.alpha=a[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 l=this.r.toString(16),u=this.g.toString(16),c=this.b.toString(16);return l.length==1&&(l="0"+l),u.length==1&&(u="0"+u),c.length==1&&(c="0"+c),"#"+l+u+c},this.getHelpXML=function(){for(var l=new Array,u=0;u<t.length;u++)for(var c=t[u].example,m=0;m<c.length;m++)l[l.length]=c[m];for(var h in e)l[l.length]=h;var d=document.createElement("ul");d.setAttribute("id","rgbcolor-examples");for(var u=0;u<l.length;u++)try{var p=document.createElement("li"),f=new RGBColor(l[u]),y=document.createElement("div");y.style.cssText="margin: 3px; border: 1px solid black; background:"+f.toHex()+"; color:"+f.toHex(),y.appendChild(document.createTextNode("test"));var v=document.createTextNode(" "+l[u]+" -> "+f.toRGB()+" -> "+f.toHex());p.appendChild(y),p.appendChild(v),d.appendChild(p)}catch{}return d}};/*! *****************************************************************************
  3. Copyright (c) Microsoft Corporation.
  4. Permission to use, copy, modify, and/or distribute this software for any
  5. purpose with or without fee is hereby granted.
  6. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  7. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  8. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  9. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  10. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  11. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  12. PERFORMANCE OF THIS SOFTWARE.
  13. ***************************************************************************** */var nn=function(s,e){return(nn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])})(s,e)};function rn(s,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=s}nn(s,e),s.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Fa(s){var e="";Array.isArray(s)||(s=[s]);for(var t=0;t<s.length;t++){var i=s[t];if(i.type===C.CLOSE_PATH)e+="z";else if(i.type===C.HORIZ_LINE_TO)e+=(i.relative?"h":"H")+i.x;else if(i.type===C.VERT_LINE_TO)e+=(i.relative?"v":"V")+i.y;else if(i.type===C.MOVE_TO)e+=(i.relative?"m":"M")+i.x+" "+i.y;else if(i.type===C.LINE_TO)e+=(i.relative?"l":"L")+i.x+" "+i.y;else if(i.type===C.CURVE_TO)e+=(i.relative?"c":"C")+i.x1+" "+i.y1+" "+i.x2+" "+i.y2+" "+i.x+" "+i.y;else if(i.type===C.SMOOTH_CURVE_TO)e+=(i.relative?"s":"S")+i.x2+" "+i.y2+" "+i.x+" "+i.y;else if(i.type===C.QUAD_TO)e+=(i.relative?"q":"Q")+i.x1+" "+i.y1+" "+i.x+" "+i.y;else if(i.type===C.SMOOTH_QUAD_TO)e+=(i.relative?"t":"T")+i.x+" "+i.y;else{if(i.type!==C.ARC)throw new Error('Unexpected command type "'+i.type+'" at index '+t+".");e+=(i.relative?"a":"A")+i.rX+" "+i.rY+" "+i.xRot+" "+ +i.lArcFlag+" "+ +i.sweepFlag+" "+i.x+" "+i.y}}return e}function Mi(s,e){var t=s[0],i=s[1];return[t*Math.cos(e)-i*Math.sin(e),t*Math.sin(e)+i*Math.cos(e)]}function fe(){for(var s=[],e=0;e<arguments.length;e++)s[e]=arguments[e];for(var t=0;t<s.length;t++)if(typeof s[t]!="number")throw new Error("assertNumbers arguments["+t+"] is not a number. "+typeof s[t]+" == typeof "+s[t]);return!0}var Oe=Math.PI;function vi(s,e,t){s.lArcFlag=s.lArcFlag===0?0:1,s.sweepFlag=s.sweepFlag===0?0:1;var i=s.rX,n=s.rY,r=s.x,o=s.y;i=Math.abs(s.rX),n=Math.abs(s.rY);var a=Mi([(e-r)/2,(t-o)/2],-s.xRot/180*Oe),l=a[0],u=a[1],c=Math.pow(l,2)/Math.pow(i,2)+Math.pow(u,2)/Math.pow(n,2);1<c&&(i*=Math.sqrt(c),n*=Math.sqrt(c)),s.rX=i,s.rY=n;var m=Math.pow(i,2)*Math.pow(u,2)+Math.pow(n,2)*Math.pow(l,2),h=(s.lArcFlag!==s.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(i,2)*Math.pow(n,2)-m)/m)),d=i*u/n*h,p=-n*l/i*h,f=Mi([d,p],s.xRot/180*Oe);s.cX=f[0]+(e+r)/2,s.cY=f[1]+(t+o)/2,s.phi1=Math.atan2((u-p)/n,(l-d)/i),s.phi2=Math.atan2((-u-p)/n,(-l-d)/i),s.sweepFlag===0&&s.phi2>s.phi1&&(s.phi2-=2*Oe),s.sweepFlag===1&&s.phi2<s.phi1&&(s.phi2+=2*Oe),s.phi1*=180/Oe,s.phi2*=180/Oe}function os(s,e,t){fe(s,e,t);var i=s*s+e*e-t*t;if(0>i)return[];if(i===0)return[[s*t/(s*s+e*e),e*t/(s*s+e*e)]];var n=Math.sqrt(i);return[[(s*t+e*n)/(s*s+e*e),(e*t-s*n)/(s*s+e*e)],[(s*t-e*n)/(s*s+e*e),(e*t+s*n)/(s*s+e*e)]]}var $,xe=Math.PI/180;function ls(s,e,t){return(1-t)*s+t*e}function us(s,e,t,i){return s+Math.cos(i/180*Oe)*e+Math.sin(i/180*Oe)*t}function cs(s,e,t,i){var n=1e-6,r=e-s,o=t-e,a=3*r+3*(i-t)-6*o,l=6*(o-r),u=3*r;return Math.abs(a)<n?[-u/l]:function(c,m,h){h===void 0&&(h=1e-6);var d=c*c/4-m;if(d<-h)return[];if(d<=h)return[-c/2];var p=Math.sqrt(d);return[-c/2-p,-c/2+p]}(l/a,u/a,n)}function hs(s,e,t,i,n){var r=1-n;return s*(r*r*r)+e*(3*r*r*n)+t*(3*r*n*n)+i*(n*n*n)}(function(s){function e(){return n(function(a,l,u){return a.relative&&(a.x1!==void 0&&(a.x1+=l),a.y1!==void 0&&(a.y1+=u),a.x2!==void 0&&(a.x2+=l),a.y2!==void 0&&(a.y2+=u),a.x!==void 0&&(a.x+=l),a.y!==void 0&&(a.y+=u),a.relative=!1),a})}function t(){var a=NaN,l=NaN,u=NaN,c=NaN;return n(function(m,h,d){return m.type&C.SMOOTH_CURVE_TO&&(m.type=C.CURVE_TO,a=isNaN(a)?h:a,l=isNaN(l)?d:l,m.x1=m.relative?h-a:2*h-a,m.y1=m.relative?d-l:2*d-l),m.type&C.CURVE_TO?(a=m.relative?h+m.x2:m.x2,l=m.relative?d+m.y2:m.y2):(a=NaN,l=NaN),m.type&C.SMOOTH_QUAD_TO&&(m.type=C.QUAD_TO,u=isNaN(u)?h:u,c=isNaN(c)?d:c,m.x1=m.relative?h-u:2*h-u,m.y1=m.relative?d-c:2*d-c),m.type&C.QUAD_TO?(u=m.relative?h+m.x1:m.x1,c=m.relative?d+m.y1:m.y1):(u=NaN,c=NaN),m})}function i(){var a=NaN,l=NaN;return n(function(u,c,m){if(u.type&C.SMOOTH_QUAD_TO&&(u.type=C.QUAD_TO,a=isNaN(a)?c:a,l=isNaN(l)?m:l,u.x1=u.relative?c-a:2*c-a,u.y1=u.relative?m-l:2*m-l),u.type&C.QUAD_TO){a=u.relative?c+u.x1:u.x1,l=u.relative?m+u.y1:u.y1;var h=u.x1,d=u.y1;u.type=C.CURVE_TO,u.x1=((u.relative?0:c)+2*h)/3,u.y1=((u.relative?0:m)+2*d)/3,u.x2=(u.x+2*h)/3,u.y2=(u.y+2*d)/3}else a=NaN,l=NaN;return u})}function n(a){var l=0,u=0,c=NaN,m=NaN;return function(h){if(isNaN(c)&&!(h.type&C.MOVE_TO))throw new Error("path must start with moveto");var d=a(h,l,u,c,m);return h.type&C.CLOSE_PATH&&(l=c,u=m),h.x!==void 0&&(l=h.relative?l+h.x:h.x),h.y!==void 0&&(u=h.relative?u+h.y:h.y),h.type&C.MOVE_TO&&(c=l,m=u),d}}function r(a,l,u,c,m,h){return fe(a,l,u,c,m,h),n(function(d,p,f,y){var v=d.x1,A=d.x2,w=d.relative&&!isNaN(y),b=d.x!==void 0?d.x:w?0:p,E=d.y!==void 0?d.y:w?0:f;function T(ge){return ge*ge}d.type&C.HORIZ_LINE_TO&&l!==0&&(d.type=C.LINE_TO,d.y=d.relative?0:f),d.type&C.VERT_LINE_TO&&u!==0&&(d.type=C.LINE_TO,d.x=d.relative?0:p),d.x!==void 0&&(d.x=d.x*a+E*u+(w?0:m)),d.y!==void 0&&(d.y=b*l+d.y*c+(w?0:h)),d.x1!==void 0&&(d.x1=d.x1*a+d.y1*u+(w?0:m)),d.y1!==void 0&&(d.y1=v*l+d.y1*c+(w?0:h)),d.x2!==void 0&&(d.x2=d.x2*a+d.y2*u+(w?0:m)),d.y2!==void 0&&(d.y2=A*l+d.y2*c+(w?0:h));var x=a*c-l*u;if(d.xRot!==void 0&&(a!==1||l!==0||u!==0||c!==1))if(x===0)delete d.rX,delete d.rY,delete d.xRot,delete d.lArcFlag,delete d.sweepFlag,d.type=C.LINE_TO;else{var P=d.xRot*Math.PI/180,F=Math.sin(P),z=Math.cos(P),D=1/T(d.rX),Q=1/T(d.rY),W=T(z)*D+T(F)*Q,j=2*F*z*(D-Q),G=T(F)*D+T(z)*Q,re=W*c*c-j*l*c+G*l*l,se=j*(a*c+l*u)-2*(W*u*c+G*a*l),de=W*u*u-j*a*u+G*a*a,K=(Math.atan2(se,re-de)+Math.PI)%Math.PI/2,X=Math.sin(K),oe=Math.cos(K);d.rX=Math.abs(x)/Math.sqrt(re*T(oe)+se*X*oe+de*T(X)),d.rY=Math.abs(x)/Math.sqrt(re*T(X)-se*X*oe+de*T(oe)),d.xRot=180*K/Math.PI}return d.sweepFlag!==void 0&&0>x&&(d.sweepFlag=+!d.sweepFlag),d})}function o(){return function(a){var l={};for(var u in a)l[u]=a[u];return l}}s.ROUND=function(a){function l(u){return Math.round(u*a)/a}return a===void 0&&(a=1e13),fe(a),function(u){return u.x1!==void 0&&(u.x1=l(u.x1)),u.y1!==void 0&&(u.y1=l(u.y1)),u.x2!==void 0&&(u.x2=l(u.x2)),u.y2!==void 0&&(u.y2=l(u.y2)),u.x!==void 0&&(u.x=l(u.x)),u.y!==void 0&&(u.y=l(u.y)),u.rX!==void 0&&(u.rX=l(u.rX)),u.rY!==void 0&&(u.rY=l(u.rY)),u}},s.TO_ABS=e,s.TO_REL=function(){return n(function(a,l,u){return a.relative||(a.x1!==void 0&&(a.x1-=l),a.y1!==void 0&&(a.y1-=u),a.x2!==void 0&&(a.x2-=l),a.y2!==void 0&&(a.y2-=u),a.x!==void 0&&(a.x-=l),a.y!==void 0&&(a.y-=u),a.relative=!0),a})},s.NORMALIZE_HVZ=function(a,l,u){return a===void 0&&(a=!0),l===void 0&&(l=!0),u===void 0&&(u=!0),n(function(c,m,h,d,p){if(isNaN(d)&&!(c.type&C.MOVE_TO))throw new Error("path must start with moveto");return l&&c.type&C.HORIZ_LINE_TO&&(c.type=C.LINE_TO,c.y=c.relative?0:h),u&&c.type&C.VERT_LINE_TO&&(c.type=C.LINE_TO,c.x=c.relative?0:m),a&&c.type&C.CLOSE_PATH&&(c.type=C.LINE_TO,c.x=c.relative?d-m:d,c.y=c.relative?p-h:p),c.type&C.ARC&&(c.rX===0||c.rY===0)&&(c.type=C.LINE_TO,delete c.rX,delete c.rY,delete c.xRot,delete c.lArcFlag,delete c.sweepFlag),c})},s.NORMALIZE_ST=t,s.QT_TO_C=i,s.INFO=n,s.SANITIZE=function(a){a===void 0&&(a=0),fe(a);var l=NaN,u=NaN,c=NaN,m=NaN;return n(function(h,d,p,f,y){var v=Math.abs,A=!1,w=0,b=0;if(h.type&C.SMOOTH_CURVE_TO&&(w=isNaN(l)?0:d-l,b=isNaN(u)?0:p-u),h.type&(C.CURVE_TO|C.SMOOTH_CURVE_TO)?(l=h.relative?d+h.x2:h.x2,u=h.relative?p+h.y2:h.y2):(l=NaN,u=NaN),h.type&C.SMOOTH_QUAD_TO?(c=isNaN(c)?d:2*d-c,m=isNaN(m)?p:2*p-m):h.type&C.QUAD_TO?(c=h.relative?d+h.x1:h.x1,m=h.relative?p+h.y1:h.y2):(c=NaN,m=NaN),h.type&C.LINE_COMMANDS||h.type&C.ARC&&(h.rX===0||h.rY===0||!h.lArcFlag)||h.type&C.CURVE_TO||h.type&C.SMOOTH_CURVE_TO||h.type&C.QUAD_TO||h.type&C.SMOOTH_QUAD_TO){var E=h.x===void 0?0:h.relative?h.x:h.x-d,T=h.y===void 0?0:h.relative?h.y:h.y-p;w=isNaN(c)?h.x1===void 0?w:h.relative?h.x:h.x1-d:c-d,b=isNaN(m)?h.y1===void 0?b:h.relative?h.y:h.y1-p:m-p;var x=h.x2===void 0?0:h.relative?h.x:h.x2-d,P=h.y2===void 0?0:h.relative?h.y:h.y2-p;v(E)<=a&&v(T)<=a&&v(w)<=a&&v(b)<=a&&v(x)<=a&&v(P)<=a&&(A=!0)}return h.type&C.CLOSE_PATH&&v(d-f)<=a&&v(p-y)<=a&&(A=!0),A?[]:h})},s.MATRIX=r,s.ROTATE=function(a,l,u){l===void 0&&(l=0),u===void 0&&(u=0),fe(a,l,u);var c=Math.sin(a),m=Math.cos(a);return r(m,c,-c,m,l-l*m+u*c,u-l*c-u*m)},s.TRANSLATE=function(a,l){return l===void 0&&(l=0),fe(a,l),r(1,0,0,1,a,l)},s.SCALE=function(a,l){return l===void 0&&(l=a),fe(a,l),r(a,0,0,l,0,0)},s.SKEW_X=function(a){return fe(a),r(1,0,Math.atan(a),1,0,0)},s.SKEW_Y=function(a){return fe(a),r(1,Math.atan(a),0,1,0,0)},s.X_AXIS_SYMMETRY=function(a){return a===void 0&&(a=0),fe(a),r(-1,0,0,1,a,0)},s.Y_AXIS_SYMMETRY=function(a){return a===void 0&&(a=0),fe(a),r(1,0,0,-1,0,a)},s.A_TO_C=function(){return n(function(a,l,u){return C.ARC===a.type?function(c,m,h){var d,p,f,y;c.cX||vi(c,m,h);for(var v=Math.min(c.phi1,c.phi2),A=Math.max(c.phi1,c.phi2)-v,w=Math.ceil(A/90),b=new Array(w),E=m,T=h,x=0;x<w;x++){var P=ls(c.phi1,c.phi2,x/w),F=ls(c.phi1,c.phi2,(x+1)/w),z=F-P,D=4/3*Math.tan(z*xe/4),Q=[Math.cos(P*xe)-D*Math.sin(P*xe),Math.sin(P*xe)+D*Math.cos(P*xe)],W=Q[0],j=Q[1],G=[Math.cos(F*xe),Math.sin(F*xe)],re=G[0],se=G[1],de=[re+D*Math.sin(F*xe),se-D*Math.cos(F*xe)],K=de[0],X=de[1];b[x]={relative:c.relative,type:C.CURVE_TO};var oe=function(ge,we){var Me=Mi([ge*c.rX,we*c.rY],c.xRot),je=Me[0],vt=Me[1];return[c.cX+je,c.cY+vt]};d=oe(W,j),b[x].x1=d[0],b[x].y1=d[1],p=oe(K,X),b[x].x2=p[0],b[x].y2=p[1],f=oe(re,se),b[x].x=f[0],b[x].y=f[1],c.relative&&(b[x].x1-=E,b[x].y1-=T,b[x].x2-=E,b[x].y2-=T,b[x].x-=E,b[x].y-=T),E=(y=[b[x].x,b[x].y])[0],T=y[1]}return b}(a,a.relative?0:l,a.relative?0:u):a})},s.ANNOTATE_ARCS=function(){return n(function(a,l,u){return a.relative&&(l=0,u=0),C.ARC===a.type&&vi(a,l,u),a})},s.CLONE=o,s.CALCULATE_BOUNDS=function(){var a=function(h){var d={};for(var p in h)d[p]=h[p];return d},l=e(),u=i(),c=t(),m=n(function(h,d,p){var f=c(u(l(a(h))));function y(X){X>m.maxX&&(m.maxX=X),X<m.minX&&(m.minX=X)}function v(X){X>m.maxY&&(m.maxY=X),X<m.minY&&(m.minY=X)}if(f.type&C.DRAWING_COMMANDS&&(y(d),v(p)),f.type&C.HORIZ_LINE_TO&&y(f.x),f.type&C.VERT_LINE_TO&&v(f.y),f.type&C.LINE_TO&&(y(f.x),v(f.y)),f.type&C.CURVE_TO){y(f.x),v(f.y);for(var A=0,w=cs(d,f.x1,f.x2,f.x);A<w.length;A++)0<(K=w[A])&&1>K&&y(hs(d,f.x1,f.x2,f.x,K));for(var b=0,E=cs(p,f.y1,f.y2,f.y);b<E.length;b++)0<(K=E[b])&&1>K&&v(hs(p,f.y1,f.y2,f.y,K))}if(f.type&C.ARC){y(f.x),v(f.y),vi(f,d,p);for(var T=f.xRot/180*Math.PI,x=Math.cos(T)*f.rX,P=Math.sin(T)*f.rX,F=-Math.sin(T)*f.rY,z=Math.cos(T)*f.rY,D=f.phi1<f.phi2?[f.phi1,f.phi2]:-180>f.phi2?[f.phi2+360,f.phi1+360]:[f.phi2,f.phi1],Q=D[0],W=D[1],j=function(X){var oe=X[0],ge=X[1],we=180*Math.atan2(ge,oe)/Math.PI;return we<Q?we+360:we},G=0,re=os(F,-x,0).map(j);G<re.length;G++)(K=re[G])>Q&&K<W&&y(us(f.cX,x,F,K));for(var se=0,de=os(z,-P,0).map(j);se<de.length;se++){var K;(K=de[se])>Q&&K<W&&v(us(f.cY,P,z,K))}}return h});return m.minX=1/0,m.maxX=-1/0,m.minY=1/0,m.maxY=-1/0,m}})($||($={}));var pe,an=function(){function s(){}return s.prototype.round=function(e){return this.transform($.ROUND(e))},s.prototype.toAbs=function(){return this.transform($.TO_ABS())},s.prototype.toRel=function(){return this.transform($.TO_REL())},s.prototype.normalizeHVZ=function(e,t,i){return this.transform($.NORMALIZE_HVZ(e,t,i))},s.prototype.normalizeST=function(){return this.transform($.NORMALIZE_ST())},s.prototype.qtToC=function(){return this.transform($.QT_TO_C())},s.prototype.aToC=function(){return this.transform($.A_TO_C())},s.prototype.sanitize=function(e){return this.transform($.SANITIZE(e))},s.prototype.translate=function(e,t){return this.transform($.TRANSLATE(e,t))},s.prototype.scale=function(e,t){return this.transform($.SCALE(e,t))},s.prototype.rotate=function(e,t,i){return this.transform($.ROTATE(e,t,i))},s.prototype.matrix=function(e,t,i,n,r,o){return this.transform($.MATRIX(e,t,i,n,r,o))},s.prototype.skewX=function(e){return this.transform($.SKEW_X(e))},s.prototype.skewY=function(e){return this.transform($.SKEW_Y(e))},s.prototype.xSymmetry=function(e){return this.transform($.X_AXIS_SYMMETRY(e))},s.prototype.ySymmetry=function(e){return this.transform($.Y_AXIS_SYMMETRY(e))},s.prototype.annotateArcs=function(){return this.transform($.ANNOTATE_ARCS())},s}(),Ia=function(s){return s===" "||s===" "||s==="\r"||s===`
  14. `},ds=function(s){return"0".charCodeAt(0)<=s.charCodeAt(0)&&s.charCodeAt(0)<="9".charCodeAt(0)},Ra=function(s){function e(){var t=s.call(this)||this;return t.curNumber="",t.curCommandType=-1,t.curCommandRelative=!1,t.canParseCommandOrComma=!0,t.curNumberHasExp=!1,t.curNumberHasExpDigits=!1,t.curNumberHasDecimal=!1,t.curArgs=[],t}return rn(e,s),e.prototype.finish=function(t){if(t===void 0&&(t=[]),this.parse(" ",t),this.curArgs.length!==0||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t},e.prototype.parse=function(t,i){var n=this;i===void 0&&(i=[]);for(var r=function(m){i.push(m),n.curArgs.length=0,n.canParseCommandOrComma=!0},o=0;o<t.length;o++){var a=t[o],l=!(this.curCommandType!==C.ARC||this.curArgs.length!==3&&this.curArgs.length!==4||this.curNumber.length!==1||this.curNumber!=="0"&&this.curNumber!=="1"),u=ds(a)&&(this.curNumber==="0"&&a==="0"||l);if(!ds(a)||u)if(a!=="e"&&a!=="E")if(a!=="-"&&a!=="+"||!this.curNumberHasExp||this.curNumberHasExpDigits)if(a!=="."||this.curNumberHasExp||this.curNumberHasDecimal||l){if(this.curNumber&&this.curCommandType!==-1){var c=Number(this.curNumber);if(isNaN(c))throw new SyntaxError("Invalid number ending at "+o);if(this.curCommandType===C.ARC){if(this.curArgs.length===0||this.curArgs.length===1){if(0>c)throw new SyntaxError('Expected positive number, got "'+c+'" at index "'+o+'"')}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+o+'"')}this.curArgs.push(c),this.curArgs.length===La[this.curCommandType]&&(C.HORIZ_LINE_TO===this.curCommandType?r({type:C.HORIZ_LINE_TO,relative:this.curCommandRelative,x:c}):C.VERT_LINE_TO===this.curCommandType?r({type:C.VERT_LINE_TO,relative:this.curCommandRelative,y:c}):this.curCommandType===C.MOVE_TO||this.curCommandType===C.LINE_TO||this.curCommandType===C.SMOOTH_QUAD_TO?(r({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),C.MOVE_TO===this.curCommandType&&(this.curCommandType=C.LINE_TO)):this.curCommandType===C.CURVE_TO?r({type:C.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===C.SMOOTH_CURVE_TO?r({type:C.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===C.QUAD_TO?r({type:C.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===C.ARC&&r({type:C.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(!Ia(a))if(a===","&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if(a!=="+"&&a!=="-"&&a!==".")if(u)this.curNumber=a,this.curNumberHasDecimal=!1;else{if(this.curArgs.length!==0)throw new SyntaxError("Unterminated command at index "+o+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+a+'" at index '+o+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,a!=="z"&&a!=="Z")if(a==="h"||a==="H")this.curCommandType=C.HORIZ_LINE_TO,this.curCommandRelative=a==="h";else if(a==="v"||a==="V")this.curCommandType=C.VERT_LINE_TO,this.curCommandRelative=a==="v";else if(a==="m"||a==="M")this.curCommandType=C.MOVE_TO,this.curCommandRelative=a==="m";else if(a==="l"||a==="L")this.curCommandType=C.LINE_TO,this.curCommandRelative=a==="l";else if(a==="c"||a==="C")this.curCommandType=C.CURVE_TO,this.curCommandRelative=a==="c";else if(a==="s"||a==="S")this.curCommandType=C.SMOOTH_CURVE_TO,this.curCommandRelative=a==="s";else if(a==="q"||a==="Q")this.curCommandType=C.QUAD_TO,this.curCommandRelative=a==="q";else if(a==="t"||a==="T")this.curCommandType=C.SMOOTH_QUAD_TO,this.curCommandRelative=a==="t";else{if(a!=="a"&&a!=="A")throw new SyntaxError('Unexpected character "'+a+'" at index '+o+".");this.curCommandType=C.ARC,this.curCommandRelative=a==="a"}else i.push({type:C.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 i},e.prototype.transform=function(t){return Object.create(this,{parse:{value:function(i,n){n===void 0&&(n=[]);for(var r=0,o=Object.getPrototypeOf(this).parse.call(this,i);r<o.length;r++){var a=o[r],l=t(a);Array.isArray(l)?n.push.apply(n,l):n.push(l)}return n}}})},e}(an),C=function(s){function e(t){var i=s.call(this)||this;return i.commands=typeof t=="string"?e.parse(t):t,i}return rn(e,s),e.prototype.encode=function(){return e.encode(this.commands)},e.prototype.getBounds=function(){var t=$.CALCULATE_BOUNDS();return this.transform(t),t},e.prototype.transform=function(t){for(var i=[],n=0,r=this.commands;n<r.length;n++){var o=t(r[n]);Array.isArray(o)?i.push.apply(i,o):i.push(o)}return this.commands=i,this},e.encode=function(t){return Fa(t)},e.parse=function(t){var i=new Ra,n=[];return i.parse(t,n),i.finish(n),n},e.CLOSE_PATH=1,e.MOVE_TO=2,e.HORIZ_LINE_TO=4,e.VERT_LINE_TO=8,e.LINE_TO=16,e.CURVE_TO=32,e.SMOOTH_CURVE_TO=64,e.QUAD_TO=128,e.SMOOTH_QUAD_TO=256,e.ARC=512,e.LINE_COMMANDS=e.LINE_TO|e.HORIZ_LINE_TO|e.VERT_LINE_TO,e.DRAWING_COMMANDS=e.HORIZ_LINE_TO|e.VERT_LINE_TO|e.LINE_TO|e.CURVE_TO|e.SMOOTH_CURVE_TO|e.QUAD_TO|e.SMOOTH_QUAD_TO|e.ARC,e}(an),La=((pe={})[C.MOVE_TO]=2,pe[C.LINE_TO]=2,pe[C.HORIZ_LINE_TO]=1,pe[C.VERT_LINE_TO]=1,pe[C.CLOSE_PATH]=0,pe[C.QUAD_TO]=4,pe[C.SMOOTH_QUAD_TO]=2,pe[C.CURVE_TO]=6,pe[C.SMOOTH_CURVE_TO]=4,pe[C.ARC]=7,pe);function It(s){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?It=function(e){return typeof e}:It=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},It(s)}function Da(s,e){if(!(s instanceof e))throw new TypeError("Cannot call a class as a function")}var Va=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],Ua=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function Ha(s,e,t,i,n){if(typeof s=="string"&&(s=document.getElementById(s)),!s||It(s)!=="object"||!("getContext"in s))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var r=s.getContext("2d");try{return r.getImageData(e,t,i,n)}catch(o){throw new Error("unable to access image data: "+o)}}function za(s,e,t,i,n,r){if(!(isNaN(r)||r<1)){r|=0;var o=Ha(s,e,t,i,n);o=Qa(o,e,t,i,n,r),s.getContext("2d").putImageData(o,e,t)}}function Qa(s,e,t,i,n,r){for(var o=s.data,a=2*r+1,l=i-1,u=n-1,c=r+1,m=c*(c+1)/2,h=new ms,d=h,p,f=1;f<a;f++)d=d.next=new ms,f===c&&(p=d);d.next=h;for(var y=null,v=null,A=0,w=0,b=Va[r],E=Ua[r],T=0;T<n;T++){d=h;for(var x=o[w],P=o[w+1],F=o[w+2],z=o[w+3],D=0;D<c;D++)d.r=x,d.g=P,d.b=F,d.a=z,d=d.next;for(var Q=0,W=0,j=0,G=0,re=c*x,se=c*P,de=c*F,K=c*z,X=m*x,oe=m*P,ge=m*F,we=m*z,Me=1;Me<c;Me++){var je=w+((l<Me?l:Me)<<2),vt=o[je],zi=o[je+1],Qi=o[je+2],Wi=o[je+3],At=c-Me;X+=(d.r=vt)*At,oe+=(d.g=zi)*At,ge+=(d.b=Qi)*At,we+=(d.a=Wi)*At,Q+=vt,W+=zi,j+=Qi,G+=Wi,d=d.next}y=h,v=p;for(var Xt=0;Xt<i;Xt++){var Yt=we*b>>>E;if(o[w+3]=Yt,Yt!==0){var jt=255/Yt;o[w]=(X*b>>>E)*jt,o[w+1]=(oe*b>>>E)*jt,o[w+2]=(ge*b>>>E)*jt}else o[w]=o[w+1]=o[w+2]=0;X-=re,oe-=se,ge-=de,we-=K,re-=y.r,se-=y.g,de-=y.b,K-=y.a;var De=Xt+r+1;De=A+(De<l?De:l)<<2,Q+=y.r=o[De],W+=y.g=o[De+1],j+=y.b=o[De+2],G+=y.a=o[De+3],X+=Q,oe+=W,ge+=j,we+=G,y=y.next;var wt=v,qi=wt.r,Xi=wt.g,Yi=wt.b,ji=wt.a;re+=qi,se+=Xi,de+=Yi,K+=ji,Q-=qi,W-=Xi,j-=Yi,G-=ji,v=v.next,w+=4}A+=i}for(var Ge=0;Ge<i;Ge++){w=Ge<<2;var Ve=o[w],Ue=o[w+1],He=o[w+2],ue=o[w+3],Gt=c*Ve,Kt=c*Ue,Jt=c*He,Zt=c*ue,Ct=m*Ve,Tt=m*Ue,xt=m*He,Et=m*ue;d=h;for(var Gi=0;Gi<c;Gi++)d.r=Ve,d.g=Ue,d.b=He,d.a=ue,d=d.next;for(var Ki=i,_t=0,$t=0,ei=0,ti=0,St=1;St<=r;St++){w=Ki+Ge<<2;var kt=c-St;Ct+=(d.r=Ve=o[w])*kt,Tt+=(d.g=Ue=o[w+1])*kt,xt+=(d.b=He=o[w+2])*kt,Et+=(d.a=ue=o[w+3])*kt,ti+=Ve,_t+=Ue,$t+=He,ei+=ue,d=d.next,St<u&&(Ki+=i)}w=Ge,y=h,v=p;for(var ii=0;ii<n;ii++){var ce=w<<2;o[ce+3]=ue=Et*b>>>E,ue>0?(ue=255/ue,o[ce]=(Ct*b>>>E)*ue,o[ce+1]=(Tt*b>>>E)*ue,o[ce+2]=(xt*b>>>E)*ue):o[ce]=o[ce+1]=o[ce+2]=0,Ct-=Gt,Tt-=Kt,xt-=Jt,Et-=Zt,Gt-=y.r,Kt-=y.g,Jt-=y.b,Zt-=y.a,ce=Ge+((ce=ii+c)<u?ce:u)*i<<2,Ct+=ti+=y.r=o[ce],Tt+=_t+=y.g=o[ce+1],xt+=$t+=y.b=o[ce+2],Et+=ei+=y.a=o[ce+3],y=y.next,Gt+=Ve=v.r,Kt+=Ue=v.g,Jt+=He=v.b,Zt+=ue=v.a,ti-=Ve,_t-=Ue,$t-=He,ei-=ue,v=v.next,w+=i}}return s}var ms=function s(){Da(this,s),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null};function Wa(){let{DOMParser:s}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:s,createCanvas(t,i){return new OffscreenCanvas(t,i)},async createImage(t){const n=await(await fetch(t)).blob();return await createImageBitmap(n)}};return(typeof globalThis.DOMParser!="undefined"||typeof s=="undefined")&&Reflect.deleteProperty(e,"DOMParser"),e}function qa(s){let{DOMParser:e,canvas:t,fetch:i}=s;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:e,fetch:i,createCanvas:t.createCanvas,createImage:t.loadImage}}var Xa=Object.freeze({__proto__:null,offscreen:Wa,node:qa});function tt(s){return s.replace(/(?!\u3000)\s+/gm," ")}function Ya(s){return s.replace(/^[\n \t]+/,"")}function ja(s){return s.replace(/[\n \t]+$/,"")}function me(s){const e=s.match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm);return e?e.map(parseFloat):[]}function Ga(s){const e=me(s);return[e[0]||0,e[1]||0,e[2]||0,e[3]||0,e[4]||0,e[5]||0]}const Ka=/^[A-Z-]+$/;function Ja(s){return Ka.test(s)?s.toLowerCase():s}function on(s){const e=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(s);return e&&(e[2]||e[3]||e[4])||""}function Za(s){if(!s.startsWith("rgb"))return s;let e=3;return s.replace(/\d+(\.\d+)?/g,(i,n)=>e--&&n?String(Math.round(parseFloat(i))):i)}const _a=/(\[[^\]]+\])/g,$a=/(#[^\s+>~.[:]+)/g,eo=/(\.[^\s+>~.[:]+)/g,to=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,io=/(:[\w-]+\([^)]*\))/gi,so=/(:[^\s+>~.[:]+)/g,no=/([^\s+>~.[:]+)/g;function We(s,e){const t=e.exec(s);return t?[s.replace(e," "),t.length]:[s,0]}function ro(s){const e=[0,0,0];let t=s.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),i=0;return[t,i]=We(t,_a),e[1]+=i,[t,i]=We(t,$a),e[0]+=i,[t,i]=We(t,eo),e[1]+=i,[t,i]=We(t,to),e[2]+=i,[t,i]=We(t,io),e[1]+=i,[t,i]=We(t,so),e[1]+=i,t=t.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[t,i]=We(t,no),e[2]+=i,e.join("")}const _e=1e-8;function gs(s){return Math.sqrt(Math.pow(s[0],2)+Math.pow(s[1],2))}function Bi(s,e){return(s[0]*e[0]+s[1]*e[1])/(gs(s)*gs(e))}function ps(s,e){return(s[0]*e[1]<s[1]*e[0]?-1:1)*Math.acos(Bi(s,e))}function fs(s){return s*s*s}function ys(s){return 3*s*s*(1-s)}function bs(s){return 3*s*(1-s)*(1-s)}function vs(s){return(1-s)*(1-s)*(1-s)}function As(s){return s*s}function ws(s){return 2*s*(1-s)}function Cs(s){return(1-s)*(1-s)}class M{static empty(e){return new M(e,"EMPTY","")}split(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:" ";const{document:t,name:i}=this;return tt(this.getString()).trim().split(e).map(n=>new M(t,i,n))}hasValue(e){const t=this.value;return t!==null&&t!==""&&(e||t!==0)&&typeof t!="undefined"}isString(e){const{value:t}=this,i=typeof t=="string";return!i||!e?i:e.test(t)}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;const e=this.getString();switch(!0){case e.endsWith("px"):case/^[0-9]+$/.test(e):return!0;default:return!1}}setValue(e){return this.value=e,this}getValue(e){return typeof e=="undefined"||this.hasValue()?this.value:e}getNumber(e){if(!this.hasValue())return typeof e=="undefined"?0:parseFloat(e);const{value:t}=this;let i=parseFloat(t);return this.isString(/%$/)&&(i/=100),i}getString(e){return typeof e=="undefined"||this.hasValue()?typeof this.value=="undefined"?"":String(this.value):String(e)}getColor(e){let t=this.getString(e);return this.isNormalizedColor||(this.isNormalizedColor=!0,t=Za(t),this.value=t),t}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!this.hasValue())return 0;const[i,n]=typeof e=="boolean"?[void 0,e]:[e],{viewPort:r}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(r.computeSize("x"),r.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(r.computeSize("x"),r.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*r.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*r.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 this.getNumber()*15;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(/%$/)&&n):return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*r.computeSize(i);default:{const o=this.getNumber();return t&&o<1?o*r.computeSize(i):o}}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():this.getNumber()*1e3:0}getRadians(){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)}}getDefinition(){const e=this.getString(),t=/#([^)'"]+)/.exec(e),i=(t==null?void 0:t[1])||e;return this.document.definitions[i]}getFillStyleDefinition(e,t){let i=this.getDefinition();if(!i)return null;if(typeof i.createGradient=="function"&&"getBoundingBox"in e)return i.createGradient(this.document.ctx,e,t);if(typeof i.createPattern=="function"){if(i.getHrefAttribute().hasValue()){const n=i.getAttribute("patternTransform");i=i.getHrefAttribute().getDefinition(),i&&n.hasValue()&&i.getAttribute("patternTransform",!0).setValue(n.value)}if(i)return i.createPattern(this.document.ctx,e,t)}return null}getTextBaseline(){if(!this.hasValue())return null;const e=this.getString();return M.textBaselineMapping[e]||null}addOpacity(e){let t=this.getColor();const i=t.length;let n=0;for(let r=0;r<i&&(t[r]===","&&n++,n!==3);r++);if(e.hasValue()&&this.isString()&&n!==3){const r=new Pi(t);r.ok&&(r.alpha=e.getNumber(),t=r.toRGBA())}return new M(this.document,this.name,t)}constructor(e,t,i){this.document=e,this.name=t,this.value=i,this.isNormalizedColor=!1}}M.textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};class gt{clear(){this.viewPorts=[]}setCurrent(e,t){this.viewPorts.push({width:e,height:t})}removeCurrent(){this.viewPorts.pop()}getRoot(){const[e]=this.viewPorts;return e||Ts()}getCurrent(){const{viewPorts:e}=this,t=e[e.length-1];return t||Ts()}get width(){return this.getCurrent().width}get height(){return this.getCurrent().height}computeSize(e){return typeof e=="number"?e:e==="x"?this.width:e==="y"?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}constructor(){this.viewPorts=[]}}gt.DEFAULT_VIEWPORT_WIDTH=800;gt.DEFAULT_VIEWPORT_HEIGHT=600;function Ts(){return{width:gt.DEFAULT_VIEWPORT_WIDTH,height:gt.DEFAULT_VIEWPORT_HEIGHT}}class Y{static parse(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const[i=t,n=t]=me(e);return new Y(i,n)}static parseScale(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;const[i=t,n=i]=me(e);return new Y(i,n)}static parsePath(e){const t=me(e),i=t.length,n=[];for(let r=0;r<i;r+=2)n.push(new Y(t[r],t[r+1]));return n}angleTo(e){return Math.atan2(e.y-this.y,e.x-this.x)}applyTransform(e){const{x:t,y:i}=this,n=t*e[0]+i*e[2]+e[4],r=t*e[1]+i*e[3]+e[5];this.x=n,this.y=r}constructor(e,t){this.x=e,this.y=t}}class ao{isWorking(){return this.working}start(){if(this.working)return;const{screen:e,onClick:t,onMouseMove:i}=this,n=e.ctx.canvas;n.onclick=t,n.onmousemove=i,this.working=!0}stop(){if(!this.working)return;const e=this.screen.ctx.canvas;this.working=!1,e.onclick=null,e.onmousemove=null}hasEvents(){return this.working&&this.events.length>0}runEvents(){if(!this.working)return;const{screen:e,events:t,eventElements:i}=this,{style:n}=e.ctx.canvas;let r;n&&(n.cursor=""),t.forEach((o,a)=>{let{run:l}=o;for(r=i[a];r;)l(r),r=r.parent}),this.events=[],this.eventElements=[]}checkPath(e,t){if(!this.working||!t)return;const{events:i,eventElements:n}=this;i.forEach((r,o)=>{let{x:a,y:l}=r;!n[o]&&t.isPointInPath&&t.isPointInPath(a,l)&&(n[o]=e)})}checkBoundingBox(e,t){if(!this.working||!t)return;const{events:i,eventElements:n}=this;i.forEach((r,o)=>{let{x:a,y:l}=r;!n[o]&&t.isPointInBox(a,l)&&(n[o]=e)})}mapXY(e,t){const{window:i,ctx:n}=this.screen,r=new Y(e,t);let o=n.canvas;for(;o;)r.x-=o.offsetLeft,r.y-=o.offsetTop,o=o.offsetParent;return i!=null&&i.scrollX&&(r.x+=i.scrollX),i!=null&&i.scrollY&&(r.y+=i.scrollY),r}onClick(e){const{x:t,y:i}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onclick",x:t,y:i,run(n){n.onClick&&n.onClick()}})}onMouseMove(e){const{x:t,y:i}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onmousemove",x:t,y:i,run(n){n.onMouseMove&&n.onMouseMove()}})}constructor(e){this.screen=e,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}}const ln=typeof window!="undefined"?window:null,un=typeof fetch!="undefined"?fetch.bind(void 0):void 0;class Pe{wait(e){this.waits.push(e)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;const e=this.waits.every(t=>t());return e&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=e,e}setDefaults(e){e.strokeStyle="rgba(0,0,0,0)",e.lineCap="butt",e.lineJoin="miter",e.miterLimit=4}setViewBox(e){let{document:t,ctx:i,aspectRatio:n,width:r,desiredWidth:o,height:a,desiredHeight:l,minX:u=0,minY:c=0,refX:m,refY:h,clip:d=!1,clipX:p=0,clipY:f=0}=e;const y=tt(n).replace(/^defer\s/,""),[v,A]=y.split(" "),w=v||"xMidYMid",b=A||"meet",E=r/o,T=a/l,x=Math.min(E,T),P=Math.max(E,T);let F=o,z=l;b==="meet"&&(F*=x,z*=x),b==="slice"&&(F*=P,z*=P);const D=new M(t,"refX",m),Q=new M(t,"refY",h),W=D.hasValue()&&Q.hasValue();if(W&&i.translate(-x*D.getPixels("x"),-x*Q.getPixels("y")),d){const j=x*p,G=x*f;i.beginPath(),i.moveTo(j,G),i.lineTo(r,G),i.lineTo(r,a),i.lineTo(j,a),i.closePath(),i.clip()}if(!W){const j=b==="meet"&&x===T,G=b==="slice"&&P===T,re=b==="meet"&&x===E,se=b==="slice"&&P===E;w.startsWith("xMid")&&(j||G)&&i.translate(r/2-F/2,0),w.endsWith("YMid")&&(re||se)&&i.translate(0,a/2-z/2),w.startsWith("xMax")&&(j||G)&&i.translate(r-F,0),w.endsWith("YMax")&&(re||se)&&i.translate(0,a-z)}switch(!0){case w==="none":i.scale(E,T);break;case b==="meet":i.scale(x,x);break;case b==="slice":i.scale(P,P);break}i.translate(-u,-c)}start(e){let{enableRedraw:t=!1,ignoreMouse:i=!1,ignoreAnimation:n=!1,ignoreDimensions:r=!1,ignoreClear:o=!1,forceRedraw:a,scaleWidth:l,scaleHeight:u,offsetX:c,offsetY:m}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{mouse:h}=this,d=1e3/Pe.FRAMERATE;if(this.isReadyLock=!1,this.frameDuration=d,this.readyPromise=new Promise(A=>{this.resolveReady=A}),this.isReady()&&this.render(e,r,o,l,u,c,m),!t)return;let p=Date.now(),f=p,y=0;const v=()=>{p=Date.now(),y=p-f,y>=d&&(f=p-y%d,this.shouldUpdate(n,a)&&(this.render(e,r,o,l,u,c,m),h.runEvents())),this.intervalId=bi(v)};i||h.start(),this.intervalId=bi(v)}stop(){this.intervalId&&(bi.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(e,t){if(!e){const{frameDuration:i}=this;if(this.animations.reduce((r,o)=>o.update(i)||r,!1))return!0}return!!(typeof t=="function"&&t()||!this.isReadyLock&&this.isReady()||this.mouse.hasEvents())}render(e,t,i,n,r,o,a){const{viewPort:l,ctx:u,isFirstRender:c}=this,m=u.canvas;l.clear(),m.width&&m.height&&l.setCurrent(m.width,m.height);const h=e.getStyle("width"),d=e.getStyle("height");!t&&(c||typeof n!="number"&&typeof r!="number")&&(h.hasValue()&&(m.width=h.getPixels("x"),m.style&&(m.style.width="".concat(m.width,"px"))),d.hasValue()&&(m.height=d.getPixels("y"),m.style&&(m.style.height="".concat(m.height,"px"))));let p=m.clientWidth||m.width,f=m.clientHeight||m.height;if(t&&h.hasValue()&&d.hasValue()&&(p=h.getPixels("x"),f=d.getPixels("y")),l.setCurrent(p,f),typeof o=="number"&&e.getAttribute("x",!0).setValue(o),typeof a=="number"&&e.getAttribute("y",!0).setValue(a),typeof n=="number"||typeof r=="number"){const y=me(e.getAttribute("viewBox").getString());let v=0,A=0;if(typeof n=="number"){const b=e.getStyle("width");b.hasValue()?v=b.getPixels("x")/n:y[2]&&!isNaN(y[2])&&(v=y[2]/n)}if(typeof r=="number"){const b=e.getStyle("height");b.hasValue()?A=b.getPixels("y")/r:y[3]&&!isNaN(y[3])&&(A=y[3]/r)}v||(v=A),A||(A=v),e.getAttribute("width",!0).setValue(n),e.getAttribute("height",!0).setValue(r);const w=e.getStyle("transform",!0,!0);w.setValue("".concat(w.getString()," scale(").concat(1/v,", ").concat(1/A,")"))}i||u.clearRect(0,0,p,f),e.render(u),c&&(this.isFirstRender=!1)}constructor(e,{fetch:t=un,window:i=ln}={}){if(this.ctx=e,this.viewPort=new gt,this.mouse=new ao(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=i,!t)throw new Error("Can't find 'fetch' in 'globalThis', please provide it via options");this.fetch=t}}Pe.defaultWindow=ln;Pe.defaultFetch=un;Pe.FRAMERATE=30;Pe.MAX_VIRTUAL_PIXELS=3e4;const{defaultFetch:oo}=Pe,lo=typeof DOMParser!="undefined"?DOMParser:void 0;class Ai{async parse(e){return e.startsWith("<")?this.parseFromString(e):this.load(e)}parseFromString(e){const t=new this.DOMParser;try{return this.checkDocument(t.parseFromString(e,"image/svg+xml"))}catch{return this.checkDocument(t.parseFromString(e,"text/xml"))}}checkDocument(e){const t=e.getElementsByTagName("parsererror")[0];if(t)throw new Error(t.textContent||"Unknown parse error");return e}async load(e){const i=await(await this.fetch(e)).text();return this.parseFromString(i)}constructor({fetch:e=oo,DOMParser:t=lo}={}){if(!e)throw new Error("Can't find 'fetch' in 'globalThis', please provide it via options");if(!t)throw new Error("Can't find 'DOMParser' in 'globalThis', please provide it via options");this.fetch=e,this.DOMParser=t}}class uo{apply(e){const{x:t,y:i}=this.point;e.translate(t||0,i||0)}unapply(e){const{x:t,y:i}=this.point;e.translate(-1*t||0,-1*i||0)}applyToPoint(e){const{x:t,y:i}=this.point;e.applyTransform([1,0,0,1,t||0,i||0])}constructor(e,t){this.type="translate",this.point=Y.parse(t)}}class co{apply(e){const{cx:t,cy:i,originX:n,originY:r,angle:o}=this,a=t+n.getPixels("x"),l=i+r.getPixels("y");e.translate(a,l),e.rotate(o.getRadians()),e.translate(-a,-l)}unapply(e){const{cx:t,cy:i,originX:n,originY:r,angle:o}=this,a=t+n.getPixels("x"),l=i+r.getPixels("y");e.translate(a,l),e.rotate(-1*o.getRadians()),e.translate(-a,-l)}applyToPoint(e){const{cx:t,cy:i,angle:n}=this,r=n.getRadians();e.applyTransform([1,0,0,1,t||0,i||0]),e.applyTransform([Math.cos(r),Math.sin(r),-Math.sin(r),Math.cos(r),0,0]),e.applyTransform([1,0,0,1,-t||0,-i||0])}constructor(e,t,i){this.type="rotate";const n=me(t);this.angle=new M(e,"angle",n[0]),this.originX=i[0],this.originY=i[1],this.cx=n[1]||0,this.cy=n[2]||0}}class ho{apply(e){const{scale:{x:t,y:i},originX:n,originY:r}=this,o=n.getPixels("x"),a=r.getPixels("y");e.translate(o,a),e.scale(t,i||t),e.translate(-o,-a)}unapply(e){const{scale:{x:t,y:i},originX:n,originY:r}=this,o=n.getPixels("x"),a=r.getPixels("y");e.translate(o,a),e.scale(1/t,1/i||t),e.translate(-o,-a)}applyToPoint(e){const{x:t,y:i}=this.scale;e.applyTransform([t||0,0,0,i||0,0,0])}constructor(e,t,i){this.type="scale";const n=Y.parseScale(t);(n.x===0||n.y===0)&&(n.x=_e,n.y=_e),this.scale=n,this.originX=i[0],this.originY=i[1]}}class cn{apply(e){const{originX:t,originY:i,matrix:n}=this,r=t.getPixels("x"),o=i.getPixels("y");e.translate(r,o),e.transform(n[0],n[1],n[2],n[3],n[4],n[5]),e.translate(-r,-o)}unapply(e){const{originX:t,originY:i,matrix:n}=this,r=n[0],o=n[2],a=n[4],l=n[1],u=n[3],c=n[5],m=0,h=0,d=1,p=1/(r*(u*d-c*h)-o*(l*d-c*m)+a*(l*h-u*m)),f=t.getPixels("x"),y=i.getPixels("y");e.translate(f,y),e.transform(p*(u*d-c*h),p*(c*m-l*d),p*(a*h-o*d),p*(r*d-a*m),p*(o*c-a*u),p*(a*l-r*c)),e.translate(-f,-y)}applyToPoint(e){e.applyTransform(this.matrix)}constructor(e,t,i){this.type="matrix",this.matrix=Ga(t),this.originX=i[0],this.originY=i[1]}}class hn extends cn{constructor(e,t,i){super(e,t,i),this.type="skew",this.angle=new M(e,"angle",t)}}class mo extends hn{constructor(e,t,i){super(e,t,i),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class go extends hn{constructor(e,t,i){super(e,t,i),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}function po(s){return tt(s).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function fo(s){const[e="",t=""]=s.split("(");return[e.trim(),t.trim().replace(")","")]}class Xe{static fromElement(e,t){const i=t.getStyle("transform",!1,!0);if(i.hasValue()){const[n,r=n]=t.getStyle("transform-origin",!1,!0).split();if(n&&r){const o=[n,r];return new Xe(e,i.getString(),o)}}return null}apply(e){this.transforms.forEach(t=>t.apply(e))}unapply(e){this.transforms.forEach(t=>t.unapply(e))}applyToPoint(e){this.transforms.forEach(t=>t.applyToPoint(e))}constructor(e,t,i){this.document=e,this.transforms=[],po(t).forEach(r=>{if(r==="none")return;const[o,a]=fo(r),l=Xe.transformTypes[o];l&&this.transforms.push(new l(this.document,a,i))})}}Xe.transformTypes={translate:uo,rotate:co,scale:ho,matrix:cn,skewX:mo,skewY:go};class q{getAttribute(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this.attributes[e];if(!i&&t){const n=new M(this.document,e,"");return this.attributes[e]=n,n}return i||M.empty(this.document)}getHrefAttribute(){let e;for(const t in this.attributes)if(t==="href"||t.endsWith(":href")){e=this.attributes[t];break}return e||M.empty(this.document)}getStyle(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const n=this.styles[e];if(n)return n;const r=this.getAttribute(e);if(r.hasValue())return this.styles[e]=r,r;if(!i){const{parent:o}=this;if(o){const a=o.getStyle(e);if(a.hasValue())return a}}if(t){const o=new M(this.document,e,"");return this.styles[e]=o,o}return M.empty(this.document)}render(e){if(!(this.getStyle("display").getString()==="none"||this.getStyle("visibility").getString()==="hidden")){if(e.save(),this.getStyle("mask").hasValue()){const t=this.getStyle("mask").getDefinition();t&&(this.applyEffects(e),t.apply(e,this))}else if(this.getStyle("filter").getValue("none")!=="none"){const t=this.getStyle("filter").getDefinition();t&&(this.applyEffects(e),t.apply(e,this))}else this.setContext(e),this.renderChildren(e),this.clearContext(e);e.restore()}}setContext(e){}applyEffects(e){const t=Xe.fromElement(this.document,this);t&&t.apply(e);const i=this.getStyle("clip-path",!1,!0);if(i.hasValue()){const n=i.getDefinition();n&&n.apply(e)}}clearContext(e){}renderChildren(e){this.children.forEach(t=>{t.render(e)})}addChild(e){const t=e instanceof q?e:this.document.createElement(e);t.parent=this,q.ignoreChildTypes.includes(t.type)||this.children.push(t)}matchesSelector(e){var t;const{node:i}=this;if(typeof i.matches=="function")return i.matches(e);const n=(t=i.getAttribute)===null||t===void 0?void 0:t.call(i,"class");return!n||n===""?!1:n.split(" ").some(r=>".".concat(r)===e)}addStylesFromStyleDefinition(){const{styles:e,stylesSpecificity:t}=this.document;let i;for(const n in e)if(!n.startsWith("@")&&this.matchesSelector(n)){const r=e[n],o=t[n];if(r)for(const a in r){let l=this.stylesSpecificity[a];typeof l=="undefined"&&(l="000"),o&&o>=l&&(i=r[a],i&&(this.styles[a]=i),this.stylesSpecificity[a]=o)}}}removeStyles(e,t){return t.reduce((n,r)=>{const o=e.getStyle(r);if(!o.hasValue())return n;const a=o.getString();return o.setValue(""),[...n,[r,a]]},[])}restoreStyles(e,t){t.forEach(i=>{let[n,r]=i;e.getStyle(n,!0).setValue(r)})}isFirstChild(){var e;return((e=this.parent)===null||e===void 0?void 0:e.children.indexOf(this))===0}constructor(e,t,i=!1){if(this.document=e,this.node=t,this.captureTextNodes=i,this.type="",this.attributes={},this.styles={},this.stylesSpecificity={},this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],!t||t.nodeType!==1)return;Array.from(t.attributes).forEach(o=>{const a=Ja(o.nodeName);this.attributes[a]=new M(e,a,o.value)}),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()&&this.getAttribute("style").getString().split(";").map(a=>a.trim()).forEach(a=>{if(!a)return;const[l,u]=a.split(":").map(c=>c.trim());l&&(this.styles[l]=new M(e,l,u))});const{definitions:n}=e,r=this.getAttribute("id");r.hasValue()&&(n[r.getString()]||(n[r.getString()]=this)),Array.from(t.childNodes).forEach(o=>{if(o.nodeType===1)this.addChild(o);else if(i&&(o.nodeType===3||o.nodeType===4)){const a=e.createTextNode(o);a.getText().length>0&&this.addChild(a)}})}}q.ignoreChildTypes=["title"];class yo extends q{constructor(e,t,i){super(e,t,i)}}function bo(s){const e=s.trim();return/^('|")/.test(e)?e:'"'.concat(e,'"')}function vo(s){return typeof process=="undefined"?s:s.trim().split(",").map(bo).join(",")}function Ao(s){if(!s)return"";const e=s.trim().toLowerCase();switch(e){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return e;default:return/^oblique\s+(-|)\d+deg$/.test(e)?e:""}}function wo(s){if(!s)return"";const e=s.trim().toLowerCase();switch(e){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return e;default:return/^[\d.]+$/.test(e)?e:""}}class le{static parse(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,i="",n="",r="",o="",a="";const l=tt(e).trim().split(" "),u={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return l.forEach(c=>{switch(!0){case(!u.fontStyle&&le.styles.includes(c)):c!=="inherit"&&(i=c),u.fontStyle=!0;break;case(!u.fontVariant&&le.variants.includes(c)):c!=="inherit"&&(n=c),u.fontStyle=!0,u.fontVariant=!0;break;case(!u.fontWeight&&le.weights.includes(c)):c!=="inherit"&&(r=c),u.fontStyle=!0,u.fontVariant=!0,u.fontWeight=!0;break;case!u.fontSize:c!=="inherit"&&(o=c.split("/")[0]||""),u.fontStyle=!0,u.fontVariant=!0,u.fontWeight=!0,u.fontSize=!0;break;default:c!=="inherit"&&(a+=c)}}),new le(i,n,r,o,a,t)}toString(){return[Ao(this.fontStyle),this.fontVariant,wo(this.fontWeight),this.fontSize,vo(this.fontFamily)].join(" ").trim()}constructor(e,t,i,n,r,o){const a=o?typeof o=="string"?le.parse(o):o:{};this.fontFamily=r||a.fontFamily,this.fontSize=n||a.fontSize,this.fontStyle=e||a.fontStyle,this.fontWeight=i||a.fontWeight,this.fontVariant=t||a.fontVariant}}le.styles="normal|italic|oblique|inherit";le.variants="normal|small-caps|inherit";le.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";class Ae{get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(e,t){typeof e!="undefined"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),typeof t!="undefined"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))}addX(e){this.addPoint(e,0)}addY(e){this.addPoint(0,e)}addBoundingBox(e){if(!e)return;const{x1:t,y1:i,x2:n,y2:r}=e;this.addPoint(t,i),this.addPoint(n,r)}sumCubic(e,t,i,n,r){return Math.pow(1-e,3)*t+3*Math.pow(1-e,2)*e*i+3*(1-e)*Math.pow(e,2)*n+Math.pow(e,3)*r}bezierCurveAdd(e,t,i,n,r){const o=6*t-12*i+6*n,a=-3*t+9*i-9*n+3*r,l=3*i-3*t;if(a===0){if(o===0)return;const h=-l/o;0<h&&h<1&&(e?this.addX(this.sumCubic(h,t,i,n,r)):this.addY(this.sumCubic(h,t,i,n,r)));return}const u=Math.pow(o,2)-4*l*a;if(u<0)return;const c=(-o+Math.sqrt(u))/(2*a);0<c&&c<1&&(e?this.addX(this.sumCubic(c,t,i,n,r)):this.addY(this.sumCubic(c,t,i,n,r)));const m=(-o-Math.sqrt(u))/(2*a);0<m&&m<1&&(e?this.addX(this.sumCubic(m,t,i,n,r)):this.addY(this.sumCubic(m,t,i,n,r)))}addBezierCurve(e,t,i,n,r,o,a,l){this.addPoint(e,t),this.addPoint(a,l),this.bezierCurveAdd(!0,e,i,r,a),this.bezierCurveAdd(!1,t,n,o,l)}addQuadraticCurve(e,t,i,n,r,o){const a=e+.6666666666666666*(i-e),l=t+2/3*(n-t),u=a+1/3*(r-e),c=l+1/3*(o-t);this.addBezierCurve(e,t,a,u,l,c,r,o)}isPointInBox(e,t){const{x1:i,y1:n,x2:r,y2:o}=this;return i<=e&&e<=r&&n<=t&&t<=o}constructor(e=Number.NaN,t=Number.NaN,i=Number.NaN,n=Number.NaN){this.x1=e,this.y1=t,this.x2=i,this.y2=n,this.addPoint(e,t),this.addPoint(i,n)}}class Ye extends q{calculateOpacity(){let e=1,t=this;for(;t;){const i=t.getStyle("opacity",!1,!0);i.hasValue(!0)&&(e*=i.getNumber()),t=t.parent}return e}setContext(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!t){const i=this.getStyle("fill"),n=this.getStyle("fill-opacity"),r=this.getStyle("stroke"),o=this.getStyle("stroke-opacity");if(i.isUrlDefinition()){const d=i.getFillStyleDefinition(this,n);d&&(e.fillStyle=d)}else if(i.hasValue()){i.getString()==="currentColor"&&i.setValue(this.getStyle("color").getColor());const d=i.getColor();d!=="inherit"&&(e.fillStyle=d==="none"?"rgba(0,0,0,0)":d)}if(n.hasValue()){const d=new M(this.document,"fill",e.fillStyle).addOpacity(n).getColor();e.fillStyle=d}if(r.isUrlDefinition()){const d=r.getFillStyleDefinition(this,o);d&&(e.strokeStyle=d)}else if(r.hasValue()){r.getString()==="currentColor"&&r.setValue(this.getStyle("color").getColor());const d=r.getString();d!=="inherit"&&(e.strokeStyle=d==="none"?"rgba(0,0,0,0)":d)}if(o.hasValue()){const d=new M(this.document,"stroke",e.strokeStyle).addOpacity(o).getString();e.strokeStyle=d}const a=this.getStyle("stroke-width");if(a.hasValue()){const d=a.getPixels();e.lineWidth=d||_e}const l=this.getStyle("stroke-linecap"),u=this.getStyle("stroke-linejoin"),c=this.getStyle("stroke-miterlimit"),m=this.getStyle("stroke-dasharray"),h=this.getStyle("stroke-dashoffset");if(l.hasValue()&&(e.lineCap=l.getString()),u.hasValue()&&(e.lineJoin=u.getString()),c.hasValue()&&(e.miterLimit=c.getNumber()),m.hasValue()&&m.getString()!=="none"){const d=me(m.getString());typeof e.setLineDash!="undefined"?e.setLineDash(d):typeof e.webkitLineDash!="undefined"?e.webkitLineDash=d:typeof e.mozDash!="undefined"&&!(d.length===1&&d[0]===0)&&(e.mozDash=d);const p=h.getPixels();typeof e.lineDashOffset!="undefined"?e.lineDashOffset=p:typeof e.webkitLineDashOffset!="undefined"?e.webkitLineDashOffset=p:typeof e.mozDashOffset!="undefined"&&(e.mozDashOffset=p)}}if(this.modifiedEmSizeStack=!1,typeof e.font!="undefined"){const i=this.getStyle("font"),n=this.getStyle("font-style"),r=this.getStyle("font-variant"),o=this.getStyle("font-weight"),a=this.getStyle("font-size"),l=this.getStyle("font-family"),u=new le(n.getString(),r.getString(),o.getString(),a.hasValue()?"".concat(a.getPixels(!0),"px"):"",l.getString(),le.parse(i.getString(),e.font));n.setValue(u.fontStyle),r.setValue(u.fontVariant),o.setValue(u.fontWeight),a.setValue(u.fontSize),l.setValue(u.fontFamily),e.font=u.toString(),a.isPixels()&&(this.document.emSize=a.getPixels(),this.modifiedEmSizeStack=!0)}t||(this.applyEffects(e),e.globalAlpha=this.calculateOpacity())}clearContext(e){super.clearContext(e),this.modifiedEmSizeStack&&this.document.popEmSize()}constructor(...e){super(...e),this.modifiedEmSizeStack=!1}}class Le extends Ye{setContext(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.setContext(e,t);const i=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();i&&(e.textBaseline=i)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(e){if(this.type!=="text")return this.getTElementBoundingBox(e);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e);let t=null;return this.children.forEach((i,n)=>{const r=this.getChildBoundingBox(e,this,this,n);t?t.addBoundingBox(r):t=r}),t}getFontSize(){const{document:e,parent:t}=this,i=le.parse(e.ctx.font).fontSize;return t.getStyle("font-size").getNumber(i)}getTElementBoundingBox(e){const t=this.getFontSize();return new Ae(this.x,this.y-t,this.x+this.measureText(e),this.y)}getGlyph(e,t,i){const n=t[i];let r;if(e.isArabic){var o;const a=t.length,l=t[i-1],u=t[i+1];let c="isolated";(i===0||l===" ")&&i<a-1&&u!==" "&&(c="terminal"),i>0&&l!==" "&&i<a-1&&u!==" "&&(c="medial"),i>0&&l!==" "&&(i===a-1||u===" ")&&(c="initial"),r=((o=e.arabicGlyphs[n])===null||o===void 0?void 0:o[c])||e.glyphs[n]}else r=e.glyphs[n];return r||(r=e.missingGlyph),r}getText(){return""}getTextFromNode(e){const t=e||this.node,i=Array.from(t.parentNode.childNodes),n=i.indexOf(t),r=i.length-1;let o=tt(t.textContent||"");return n===0&&(o=Ya(o)),n===r&&(o=ja(o)),o}renderChildren(e){if(this.type!=="text"){this.renderTElementChildren(e);return}this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e),this.children.forEach((i,n)=>{this.renderChild(e,this,this,n)});const{mouse:t}=this.document.screen;t.isWorking()&&t.checkBoundingBox(this,this.getBoundingBox(e))}renderTElementChildren(e){const{document:t,parent:i}=this,n=this.getText(),r=i.getStyle("font-family").getDefinition();if(r){const{unitsPerEm:l}=r.fontFace,u=le.parse(t.ctx.font),c=i.getStyle("font-size").getNumber(u.fontSize),m=i.getStyle("font-style").getString(u.fontStyle),h=c/l,d=r.isRTL?n.split("").reverse().join(""):n,p=me(i.getAttribute("dx").getString()),f=d.length;for(let y=0;y<f;y++){const v=this.getGlyph(r,d,y);e.translate(this.x,this.y),e.scale(h,-h);const A=e.lineWidth;e.lineWidth=e.lineWidth*l/c,m==="italic"&&e.transform(1,0,.4,1,0,0),v.render(e),m==="italic"&&e.transform(1,0,-.4,1,0,0),e.lineWidth=A,e.scale(1/h,-1/h),e.translate(-this.x,-this.y),this.x+=c*(v.horizAdvX||r.horizAdvX)/l,typeof p[y]!="undefined"&&!isNaN(p[y])&&(this.x+=p[y])}return}const{x:o,y:a}=this;e.fillStyle&&e.fillText(n,o,a),e.strokeStyle&&e.strokeText(n,o,a)}applyAnchoring(){if(this.textChunkStart>=this.leafTexts.length)return;const e=this.leafTexts[this.textChunkStart],t=e.getStyle("text-anchor").getString("start"),i=!1;let n=0;t==="start"&&!i||t==="end"&&i?n=e.x-this.minX:t==="end"&&!i||t==="start"&&i?n=e.x-this.maxX:n=e.x-(this.minX+this.maxX)/2;for(let r=this.textChunkStart;r<this.leafTexts.length;r++)this.leafTexts[r].x+=n;this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.textChunkStart=this.leafTexts.length}adjustChildCoordinatesRecursive(e){this.children.forEach((t,i)=>{this.adjustChildCoordinatesRecursiveCore(e,this,this,i)}),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(e,t,i,n){const r=i.children[n];r.children.length>0?r.children.forEach((o,a)=>{t.adjustChildCoordinatesRecursiveCore(e,t,r,a)}):this.adjustChildCoordinates(e,t,i,n)}adjustChildCoordinates(e,t,i,n){const r=i.children[n];if(typeof r.measureText!="function")return r;e.save(),r.setContext(e,!0);const o=r.getAttribute("x"),a=r.getAttribute("y"),l=r.getAttribute("dx"),u=r.getAttribute("dy"),c=r.getStyle("font-family").getDefinition(),m=Boolean(c==null?void 0:c.isRTL);n===0&&(o.hasValue()||o.setValue(r.getInheritedAttribute("x")),a.hasValue()||a.setValue(r.getInheritedAttribute("y")),l.hasValue()||l.setValue(r.getInheritedAttribute("dx")),u.hasValue()||u.setValue(r.getInheritedAttribute("dy")));const h=r.measureText(e);return m&&(t.x-=h),o.hasValue()?(t.applyAnchoring(),r.x=o.getPixels("x"),l.hasValue()&&(r.x+=l.getPixels("x"))):(l.hasValue()&&(t.x+=l.getPixels("x")),r.x=t.x),t.x=r.x,m||(t.x+=h),a.hasValue()?(r.y=a.getPixels("y"),u.hasValue()&&(r.y+=u.getPixels("y"))):(u.hasValue()&&(t.y+=u.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}getChildBoundingBox(e,t,i,n){const r=i.children[n];if(typeof r.getBoundingBox!="function")return null;const o=r.getBoundingBox(e);return o&&r.children.forEach((a,l)=>{const u=t.getChildBoundingBox(e,t,r,l);o.addBoundingBox(u)}),o}renderChild(e,t,i,n){const r=i.children[n];r.render(e),r.children.forEach((o,a)=>{t.renderChild(e,t,r,a)})}measureText(e){const{measureCache:t}=this;if(~t)return t;const i=this.getText(),n=this.measureTargetText(e,i);return this.measureCache=n,n}measureTargetText(e,t){if(!t.length)return 0;const{parent:i}=this,n=i.getStyle("font-family").getDefinition();if(n){const o=this.getFontSize(),a=n.isRTL?t.split("").reverse().join(""):t,l=me(i.getAttribute("dx").getString()),u=a.length;let c=0;for(let m=0;m<u;m++)c+=(this.getGlyph(n,a,m).horizAdvX||n.horizAdvX)*o/n.fontFace.unitsPerEm,typeof l[m]!="undefined"&&!isNaN(l[m])&&(c+=l[m]);return c}if(!e.measureText)return t.length*10;e.save(),this.setContext(e,!0);const{width:r}=e.measureText(t);return this.clearContext(e),e.restore(),r}getInheritedAttribute(e){let t=this;for(;t instanceof Le&&t.isFirstChild()&&t.parent;){const i=t.parent.getAttribute(e);if(i.hasValue(!0))return i.getString("0");t=t.parent}return null}constructor(e,t,i){super(e,t,new.target===Le?!0:i),this.type="text",this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.measureCache=-1}}class Qt extends Le{getText(){return this.text}constructor(e,t,i){super(e,t,new.target===Qt?!0:i),this.type="tspan",this.text=this.children.length>0?"":this.getTextFromNode()}}class Co extends Qt{constructor(...e){super(...e),this.type="textNode"}}class I extends C{reset(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new Y(0,0),this.control=new Y(0,0),this.current=new Y(0,0),this.points=[],this.angles=[]}isEnd(){const{i:e,commands:t}=this;return e>=t.length-1}next(){const e=this.commands[++this.i];return this.previousCommand=this.command,this.command=e,e}getPoint(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"x",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"y";const i=new Y(this.command[e],this.command[t]);return this.makeAbsolute(i)}getAsControlPoint(e,t){const i=this.getPoint(e,t);return this.control=i,i}getAsCurrentPoint(e,t){const i=this.getPoint(e,t);return this.current=i,i}getReflectedControlPoint(){const e=this.previousCommand.type;if(e!==C.CURVE_TO&&e!==C.SMOOTH_CURVE_TO&&e!==C.QUAD_TO&&e!==C.SMOOTH_QUAD_TO)return this.current;const{current:{x:t,y:i},control:{x:n,y:r}}=this;return new Y(2*t-n,2*i-r)}makeAbsolute(e){if(this.command.relative){const{x:t,y:i}=this.current;e.x+=t,e.y+=i}return e}addMarker(e,t,i){const{points:n,angles:r}=this;i&&r.length>0&&!r[r.length-1]&&(r[r.length-1]=n[n.length-1].angleTo(i)),this.addMarkerAngle(e,t?t.angleTo(e):null)}addMarkerAngle(e,t){this.points.push(e),this.angles.push(t)}getMarkerPoints(){return this.points}getMarkerAngles(){const{angles:e}=this,t=e.length;for(let i=0;i<t;i++)if(!e[i]){for(let n=i+1;n<t;n++)if(e[n]){e[i]=e[n];break}}return e}constructor(e){super(e.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,"")),this.control=new Y(0,0),this.start=new Y(0,0),this.current=new Y(0,0),this.command=null,this.commands=this.commands,this.i=-1,this.previousCommand=null,this.points=[],this.angles=[]}}class U extends Ye{path(e){const{pathParser:t}=this,i=new Ae;for(t.reset(),e&&e.beginPath();!t.isEnd();)switch(t.next().type){case I.MOVE_TO:this.pathM(e,i);break;case I.LINE_TO:this.pathL(e,i);break;case I.HORIZ_LINE_TO:this.pathH(e,i);break;case I.VERT_LINE_TO:this.pathV(e,i);break;case I.CURVE_TO:this.pathC(e,i);break;case I.SMOOTH_CURVE_TO:this.pathS(e,i);break;case I.QUAD_TO:this.pathQ(e,i);break;case I.SMOOTH_QUAD_TO:this.pathT(e,i);break;case I.ARC:this.pathA(e,i);break;case I.CLOSE_PATH:this.pathZ(e,i);break}return i}getBoundingBox(e){return this.path()}getMarkers(){const{pathParser:e}=this,t=e.getMarkerPoints(),i=e.getMarkerAngles();return t.map((r,o)=>[r,i[o]])}renderChildren(e){this.path(e),this.document.screen.mouse.checkPath(this,e);const t=this.getStyle("fill-rule");e.fillStyle!==""&&(t.getString("inherit")!=="inherit"?e.fill(t.getString()):e.fill()),e.strokeStyle!==""&&(this.getAttribute("vector-effect").getString()==="non-scaling-stroke"?(e.save(),e.setTransform(1,0,0,1,0,0),e.stroke(),e.restore()):e.stroke());const i=this.getMarkers();if(i){const n=i.length-1,r=this.getStyle("marker-start"),o=this.getStyle("marker-mid"),a=this.getStyle("marker-end");if(r.isUrlDefinition()){const l=r.getDefinition(),[u,c]=i[0];l.render(e,u,c)}if(o.isUrlDefinition()){const l=o.getDefinition();for(let u=1;u<n;u++){const[c,m]=i[u];l.render(e,c,m)}}if(a.isUrlDefinition()){const l=a.getDefinition(),[u,c]=i[n];l.render(e,u,c)}}}static pathM(e){const t=e.getAsCurrentPoint();return e.start=e.current,{point:t}}pathM(e,t){const{pathParser:i}=this,{point:n}=U.pathM(i),{x:r,y:o}=n;i.addMarker(n),t.addPoint(r,o),e&&e.moveTo(r,o)}static pathL(e){const{current:t}=e,i=e.getAsCurrentPoint();return{current:t,point:i}}pathL(e,t){const{pathParser:i}=this,{current:n,point:r}=U.pathL(i),{x:o,y:a}=r;i.addMarker(r,n),t.addPoint(o,a),e&&e.lineTo(o,a)}static pathH(e){const{current:t,command:i}=e,n=new Y((i.relative?t.x:0)+i.x,t.y);return e.current=n,{current:t,point:n}}pathH(e,t){const{pathParser:i}=this,{current:n,point:r}=U.pathH(i),{x:o,y:a}=r;i.addMarker(r,n),t.addPoint(o,a),e&&e.lineTo(o,a)}static pathV(e){const{current:t,command:i}=e,n=new Y(t.x,(i.relative?t.y:0)+i.y);return e.current=n,{current:t,point:n}}pathV(e,t){const{pathParser:i}=this,{current:n,point:r}=U.pathV(i),{x:o,y:a}=r;i.addMarker(r,n),t.addPoint(o,a),e&&e.lineTo(o,a)}static pathC(e){const{current:t}=e,i=e.getPoint("x1","y1"),n=e.getAsControlPoint("x2","y2"),r=e.getAsCurrentPoint();return{current:t,point:i,controlPoint:n,currentPoint:r}}pathC(e,t){const{pathParser:i}=this,{current:n,point:r,controlPoint:o,currentPoint:a}=U.pathC(i);i.addMarker(a,o,r),t.addBezierCurve(n.x,n.y,r.x,r.y,o.x,o.y,a.x,a.y),e&&e.bezierCurveTo(r.x,r.y,o.x,o.y,a.x,a.y)}static pathS(e){const{current:t}=e,i=e.getReflectedControlPoint(),n=e.getAsControlPoint("x2","y2"),r=e.getAsCurrentPoint();return{current:t,point:i,controlPoint:n,currentPoint:r}}pathS(e,t){const{pathParser:i}=this,{current:n,point:r,controlPoint:o,currentPoint:a}=U.pathS(i);i.addMarker(a,o,r),t.addBezierCurve(n.x,n.y,r.x,r.y,o.x,o.y,a.x,a.y),e&&e.bezierCurveTo(r.x,r.y,o.x,o.y,a.x,a.y)}static pathQ(e){const{current:t}=e,i=e.getAsControlPoint("x1","y1"),n=e.getAsCurrentPoint();return{current:t,controlPoint:i,currentPoint:n}}pathQ(e,t){const{pathParser:i}=this,{current:n,controlPoint:r,currentPoint:o}=U.pathQ(i);i.addMarker(o,r,r),t.addQuadraticCurve(n.x,n.y,r.x,r.y,o.x,o.y),e&&e.quadraticCurveTo(r.x,r.y,o.x,o.y)}static pathT(e){const{current:t}=e,i=e.getReflectedControlPoint();e.control=i;const n=e.getAsCurrentPoint();return{current:t,controlPoint:i,currentPoint:n}}pathT(e,t){const{pathParser:i}=this,{current:n,controlPoint:r,currentPoint:o}=U.pathT(i);i.addMarker(o,r,r),t.addQuadraticCurve(n.x,n.y,r.x,r.y,o.x,o.y),e&&e.quadraticCurveTo(r.x,r.y,o.x,o.y)}static pathA(e){const{current:t,command:i}=e;let{rX:n,rY:r,xRot:o,lArcFlag:a,sweepFlag:l}=i;const u=o*(Math.PI/180),c=e.getAsCurrentPoint(),m=new Y(Math.cos(u)*(t.x-c.x)/2+Math.sin(u)*(t.y-c.y)/2,-Math.sin(u)*(t.x-c.x)/2+Math.cos(u)*(t.y-c.y)/2),h=Math.pow(m.x,2)/Math.pow(n,2)+Math.pow(m.y,2)/Math.pow(r,2);h>1&&(n*=Math.sqrt(h),r*=Math.sqrt(h));let d=(a===l?-1:1)*Math.sqrt((Math.pow(n,2)*Math.pow(r,2)-Math.pow(n,2)*Math.pow(m.y,2)-Math.pow(r,2)*Math.pow(m.x,2))/(Math.pow(n,2)*Math.pow(m.y,2)+Math.pow(r,2)*Math.pow(m.x,2)));isNaN(d)&&(d=0);const p=new Y(d*n*m.y/r,d*-r*m.x/n),f=new Y((t.x+c.x)/2+Math.cos(u)*p.x-Math.sin(u)*p.y,(t.y+c.y)/2+Math.sin(u)*p.x+Math.cos(u)*p.y),y=ps([1,0],[(m.x-p.x)/n,(m.y-p.y)/r]),v=[(m.x-p.x)/n,(m.y-p.y)/r],A=[(-m.x-p.x)/n,(-m.y-p.y)/r];let w=ps(v,A);return Bi(v,A)<=-1&&(w=Math.PI),Bi(v,A)>=1&&(w=0),{currentPoint:c,rX:n,rY:r,sweepFlag:l,xAxisRotation:u,centp:f,a1:y,ad:w}}pathA(e,t){const{pathParser:i}=this,{currentPoint:n,rX:r,rY:o,sweepFlag:a,xAxisRotation:l,centp:u,a1:c,ad:m}=U.pathA(i),h=1-a?1:-1,d=c+h*(m/2),p=new Y(u.x+r*Math.cos(d),u.y+o*Math.sin(d));if(i.addMarkerAngle(p,d-h*Math.PI/2),i.addMarkerAngle(n,d-h*Math.PI),t.addPoint(n.x,n.y),e&&!isNaN(c)&&!isNaN(m)){const f=r>o?r:o,y=r>o?1:r/o,v=r>o?o/r:1;e.translate(u.x,u.y),e.rotate(l),e.scale(y,v),e.arc(0,0,f,c,c+m,Boolean(1-a)),e.scale(1/y,1/v),e.rotate(-l),e.translate(-u.x,-u.y)}}static pathZ(e){e.current=e.start}pathZ(e,t){U.pathZ(this.pathParser),e&&t.x1!==t.x2&&t.y1!==t.y2&&e.closePath()}constructor(e,t,i){super(e,t,i),this.type="path",this.pathParser=new I(this.getAttribute("d").getString())}}class bt extends Ye{setContext(e){var t;const{document:i}=this,{screen:n,window:r}=i,o=e.canvas;if(n.setDefaults(e),"style"in o&&typeof e.font!="undefined"&&r&&typeof r.getComputedStyle!="undefined"){e.font=r.getComputedStyle(o).getPropertyValue("font");const A=new M(i,"fontSize",le.parse(e.font).fontSize);A.hasValue()&&(i.rootEmSize=A.getPixels("y"),i.emSize=i.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);let{width:a,height:l}=n.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");const u=this.getAttribute("refX"),c=this.getAttribute("refY"),m=this.getAttribute("viewBox"),h=m.hasValue()?me(m.getString()):null,d=!this.root&&this.getStyle("overflow").getValue("hidden")!=="visible";let p=0,f=0,y=0,v=0;h&&(p=h[0],f=h[1]),this.root||(a=this.getStyle("width").getPixels("x"),l=this.getStyle("height").getPixels("y"),this.type==="marker"&&(y=p,v=f,p=0,f=0)),n.viewPort.setCurrent(a,l),this.node&&(!this.parent||((t=this.node.parentNode)===null||t===void 0?void 0:t.nodeName)==="foreignObject")&&this.getStyle("transform",!1,!0).hasValue()&&!this.getStyle("transform-origin",!1,!0).hasValue()&&this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),super.setContext(e),e.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),h&&(a=h[2],l=h[3]),i.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:n.viewPort.width,desiredWidth:a,height:n.viewPort.height,desiredHeight:l,minX:p,minY:f,refX:u.getValue(),refY:c.getValue(),clip:d,clipX:y,clipY:v}),h&&(n.viewPort.removeCurrent(),n.viewPort.setCurrent(a,l))}clearContext(e){super.clearContext(e),this.document.screen.viewPort.removeCurrent()}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const n=this.getAttribute("width",!0),r=this.getAttribute("height",!0),o=this.getAttribute("viewBox"),a=this.getAttribute("style"),l=n.getNumber(0),u=r.getNumber(0);if(i)if(typeof i=="string")this.getAttribute("preserveAspectRatio",!0).setValue(i);else{const c=this.getAttribute("preserveAspectRatio");c.hasValue()&&c.setValue(c.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(n.setValue(e),r.setValue(t),o.hasValue()||o.setValue("0 0 ".concat(l||e," ").concat(u||t)),a.hasValue()){const c=this.getStyle("width"),m=this.getStyle("height");c.hasValue()&&c.setValue("".concat(e,"px")),m.hasValue()&&m.setValue("".concat(t,"px"))}}constructor(...e){super(...e),this.type="svg",this.root=!1}}class dn extends U{path(e){const t=this.getAttribute("x").getPixels("x"),i=this.getAttribute("y").getPixels("y"),n=this.getStyle("width",!1,!0).getPixels("x"),r=this.getStyle("height",!1,!0).getPixels("y"),o=this.getAttribute("rx"),a=this.getAttribute("ry");let l=o.getPixels("x"),u=a.getPixels("y");if(o.hasValue()&&!a.hasValue()&&(u=l),a.hasValue()&&!o.hasValue()&&(l=u),l=Math.min(l,n/2),u=Math.min(u,r/2),e){const c=4*((Math.sqrt(2)-1)/3);e.beginPath(),r>0&&n>0&&(e.moveTo(t+l,i),e.lineTo(t+n-l,i),e.bezierCurveTo(t+n-l+c*l,i,t+n,i+u-c*u,t+n,i+u),e.lineTo(t+n,i+r-u),e.bezierCurveTo(t+n,i+r-u+c*u,t+n-l+c*l,i+r,t+n-l,i+r),e.lineTo(t+l,i+r),e.bezierCurveTo(t+l-c*l,i+r,t,i+r-u+c*u,t,i+r-u),e.lineTo(t,i+u),e.bezierCurveTo(t,i+u-c*u,t+l-c*l,i,t+l,i),e.closePath())}return new Ae(t,i,t+n,i+r)}getMarkers(){return null}constructor(...e){super(...e),this.type="rect"}}class To extends U{path(e){const t=this.getAttribute("cx").getPixels("x"),i=this.getAttribute("cy").getPixels("y"),n=this.getAttribute("r").getPixels();return e&&n>0&&(e.beginPath(),e.arc(t,i,n,0,Math.PI*2,!1),e.closePath()),new Ae(t-n,i-n,t+n,i+n)}getMarkers(){return null}constructor(...e){super(...e),this.type="circle"}}class xo extends U{path(e){const t=4*((Math.sqrt(2)-1)/3),i=this.getAttribute("rx").getPixels("x"),n=this.getAttribute("ry").getPixels("y"),r=this.getAttribute("cx").getPixels("x"),o=this.getAttribute("cy").getPixels("y");return e&&i>0&&n>0&&(e.beginPath(),e.moveTo(r+i,o),e.bezierCurveTo(r+i,o+t*n,r+t*i,o+n,r,o+n),e.bezierCurveTo(r-t*i,o+n,r-i,o+t*n,r-i,o),e.bezierCurveTo(r-i,o-t*n,r-t*i,o-n,r,o-n),e.bezierCurveTo(r+t*i,o-n,r+i,o-t*n,r+i,o),e.closePath()),new Ae(r-i,o-n,r+i,o+n)}getMarkers(){return null}constructor(...e){super(...e),this.type="ellipse"}}class Eo extends U{getPoints(){return[new Y(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new Y(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(e){const[{x:t,y:i},{x:n,y:r}]=this.getPoints();return e&&(e.beginPath(),e.moveTo(t,i),e.lineTo(n,r)),new Ae(t,i,n,r)}getMarkers(){const[e,t]=this.getPoints(),i=e.angleTo(t);return[[e,i],[t,i]]}constructor(...e){super(...e),this.type="line"}}class mn extends U{path(e){const{points:t}=this,[{x:i,y:n}]=t,r=new Ae(i,n);return e&&(e.beginPath(),e.moveTo(i,n)),t.forEach(o=>{let{x:a,y:l}=o;r.addPoint(a,l),e&&e.lineTo(a,l)}),r}getMarkers(){const{points:e}=this,t=e.length-1,i=[];return e.forEach((n,r)=>{r!==t&&i.push([n,n.angleTo(e[r+1])])}),i.length>0&&i.push([e[e.length-1],i[i.length-1][1]]),i}constructor(e,t,i){super(e,t,i),this.type="polyline",this.points=[],this.points=Y.parsePath(this.getAttribute("points").getString())}}class So extends mn{path(e){const t=super.path(e),[{x:i,y:n}]=this.points;return e&&(e.lineTo(i,n),e.closePath()),t}constructor(...e){super(...e),this.type="polygon"}}class ko extends q{createPattern(e,t,i){const n=this.getStyle("width").getPixels("x",!0),r=this.getStyle("height").getPixels("y",!0),o=new bt(this.document,null);o.attributes.viewBox=new M(this.document,"viewBox",this.getAttribute("viewBox").getValue()),o.attributes.width=new M(this.document,"width","".concat(n,"px")),o.attributes.height=new M(this.document,"height","".concat(r,"px")),o.attributes.transform=new M(this.document,"transform",this.getAttribute("patternTransform").getValue()),o.children=this.children;const a=this.document.createCanvas(n,r),l=a.getContext("2d"),u=this.getAttribute("x"),c=this.getAttribute("y");u.hasValue()&&c.hasValue()&&l.translate(u.getPixels("x",!0),c.getPixels("y",!0)),i.hasValue()?this.styles["fill-opacity"]=i:Reflect.deleteProperty(this.styles,"fill-opacity");for(let h=-1;h<=1;h++)for(let d=-1;d<=1;d++)l.save(),o.attributes.x=new M(this.document,"x",h*a.width),o.attributes.y=new M(this.document,"y",d*a.height),o.render(l),l.restore();return e.createPattern(a,"repeat")}constructor(...e){super(...e),this.type="pattern"}}class No extends q{render(e,t,i){if(!t)return;const{x:n,y:r}=t,o=this.getAttribute("orient").getString("auto"),a=this.getAttribute("markerUnits").getString("strokeWidth");e.translate(n,r),o==="auto"&&e.rotate(i),a==="strokeWidth"&&e.scale(e.lineWidth,e.lineWidth),e.save();const l=new bt(this.document);l.type=this.type,l.attributes.viewBox=new M(this.document,"viewBox",this.getAttribute("viewBox").getValue()),l.attributes.refX=new M(this.document,"refX",this.getAttribute("refX").getValue()),l.attributes.refY=new M(this.document,"refY",this.getAttribute("refY").getValue()),l.attributes.width=new M(this.document,"width",this.getAttribute("markerWidth").getValue()),l.attributes.height=new M(this.document,"height",this.getAttribute("markerHeight").getValue()),l.attributes.overflow=new M(this.document,"overflow",this.getAttribute("overflow").getValue()),l.attributes.fill=new M(this.document,"fill",this.getAttribute("fill").getColor("black")),l.attributes.stroke=new M(this.document,"stroke",this.getAttribute("stroke").getValue("none")),l.children=this.children,l.render(e),e.restore(),a==="strokeWidth"&&e.scale(1/e.lineWidth,1/e.lineWidth),o==="auto"&&e.rotate(-i),e.translate(-n,-r)}constructor(...e){super(...e),this.type="marker"}}class Po extends q{render(){}constructor(...e){super(...e),this.type="defs"}}class Vi extends Ye{getBoundingBox(e){const t=new Ae;return this.children.forEach(i=>{t.addBoundingBox(i.getBoundingBox(e))}),t}constructor(...e){super(...e),this.type="g"}}class gn extends q{getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(e,t,i){let n=this;this.getHrefAttribute().hasValue()&&(n=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(n));const{stops:r}=n,o=this.getGradient(e,t);if(!o)return this.addParentOpacity(i,r[r.length-1].color);if(r.forEach(a=>{o.addColorStop(a.offset,this.addParentOpacity(i,a.color))}),this.getAttribute("gradientTransform").hasValue()){const{document:a}=this,{MAX_VIRTUAL_PIXELS:l}=Pe,{viewPort:u}=a.screen,c=u.getRoot(),m=new dn(a);m.attributes.x=new M(a,"x",-l/3),m.attributes.y=new M(a,"y",-l/3),m.attributes.width=new M(a,"width",l),m.attributes.height=new M(a,"height",l);const h=new Vi(a);h.attributes.transform=new M(a,"transform",this.getAttribute("gradientTransform").getValue()),h.children=[m];const d=new bt(a);d.attributes.x=new M(a,"x",0),d.attributes.y=new M(a,"y",0),d.attributes.width=new M(a,"width",c.width),d.attributes.height=new M(a,"height",c.height),d.children=[h];const p=a.createCanvas(c.width,c.height),f=p.getContext("2d");return f.fillStyle=o,d.render(f),f.createPattern(p,"no-repeat")}return o}inheritStopContainer(e){this.attributesToInherit.forEach(t=>{!this.getAttribute(t).hasValue()&&e.getAttribute(t).hasValue()&&this.getAttribute(t,!0).setValue(e.getAttribute(t).getValue())})}addParentOpacity(e,t){return e.hasValue()?new M(this.document,"color",t).addOpacity(e).getColor():t}constructor(e,t,i){super(e,t,i),this.attributesToInherit=["gradientUnits"],this.stops=[];const{stops:n,children:r}=this;r.forEach(o=>{o.type==="stop"&&n.push(o)})}}class Mo extends gn{getGradient(e,t){const i=this.getGradientUnits()==="objectBoundingBox",n=i?t.getBoundingBox(e):null;if(i&&!n)return null;!this.getAttribute("x1").hasValue()&&!this.getAttribute("y1").hasValue()&&!this.getAttribute("x2").hasValue()&&!this.getAttribute("y2").hasValue()&&(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));const r=i?n.x+n.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),o=i?n.y+n.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),a=i?n.x+n.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),l=i?n.y+n.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return r===a&&o===l?null:e.createLinearGradient(r,o,a,l)}constructor(e,t,i){super(e,t,i),this.type="linearGradient",this.attributesToInherit.push("x1","y1","x2","y2")}}class Bo extends gn{getGradient(e,t){const i=this.getGradientUnits()==="objectBoundingBox",n=t.getBoundingBox(e);if(i&&!n)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");const r=i?n.x+n.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),o=i?n.y+n.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y");let a=r,l=o;this.getAttribute("fx").hasValue()&&(a=i?n.x+n.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(l=i?n.y+n.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));const u=i?(n.width+n.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),c=this.getAttribute("fr").getPixels();return e.createRadialGradient(a,l,c,r,o,u)}constructor(e,t,i){super(e,t,i),this.type="radialGradient",this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}}class Oo extends q{constructor(e,t,i){super(e,t,i),this.type="stop";const n=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),r=this.getStyle("stop-opacity");let o=this.getStyle("stop-color",!0);o.getString()===""&&o.setValue("#000"),r.hasValue()&&(o=o.addOpacity(r)),this.offset=n,this.color=o.getColor()}}class Ui extends q{getProperty(){const e=this.getAttribute("attributeType").getString(),t=this.getAttribute("attributeName").getString();return e==="CSS"?this.parent.getStyle(t,!0):this.parent.getAttribute(t,!0)}calcValue(){const{initialUnits:e}=this,{progress:t,from:i,to:n}=this.getProgress();let r=i.getNumber()+(n.getNumber()-i.getNumber())*t;return e==="%"&&(r*=100),"".concat(r).concat(e)}update(e){const{parent:t}=this,i=this.getProperty();if(this.initialValue||(this.initialValue=i.getString(),this.initialUnits=i.getUnits()),this.duration>this.maxDuration){const r=this.getAttribute("fill").getString("remove");if(this.getAttribute("repeatCount").getString()==="indefinite"||this.getAttribute("repeatDur").getString()==="indefinite")this.duration=0;else if(r==="freeze"&&!this.frozen)this.frozen=!0,t&&i&&(t.animationFrozen=!0,t.animationFrozenValue=i.getString());else if(r==="remove"&&!this.removed)return this.removed=!0,t&&i&&i.setValue(t.animationFrozen?t.animationFrozenValue:this.initialValue),!0;return!1}this.duration+=e;let n=!1;if(this.begin<this.duration){let r=this.calcValue();const o=this.getAttribute("type");if(o.hasValue()){const a=o.getString();r="".concat(a,"(").concat(r,")")}i.setValue(r),n=!0}return n}getProgress(){const{document:e,values:t}=this;let i=(this.duration-this.begin)/(this.maxDuration-this.begin),n,r;if(t.hasValue()){const o=i*(t.getValue().length-1),a=Math.floor(o),l=Math.ceil(o);let u;u=t.getValue()[a],n=new M(e,"from",u?parseFloat(u):0),u=t.getValue()[l],r=new M(e,"to",u?parseFloat(u):0),i=(o-a)/(l-a)}else n=this.from,r=this.to;return{progress:i,from:n,to:r}}constructor(e,t,i){super(e,t,i),this.type="animate",this.duration=0,this.initialUnits="",this.removed=!1,this.frozen=!1,e.screen.animations.push(this),this.begin=this.getAttribute("begin").getMilliseconds(),this.maxDuration=this.begin+this.getAttribute("dur").getMilliseconds(),this.from=this.getAttribute("from"),this.to=this.getAttribute("to"),this.values=new M(e,"values",null);const n=this.getAttribute("values");n.hasValue()&&this.values.setValue(n.getString().split(";"))}}class Fo extends Ui{calcValue(){const{progress:e,from:t,to:i}=this.getProgress(),n=new Pi(t.getColor()),r=new Pi(i.getColor());if(n.ok&&r.ok){const o=n.r+(r.r-n.r)*e,a=n.g+(r.g-n.g)*e,l=n.b+(r.b-n.b)*e;return"rgb(".concat(Math.floor(o),", ").concat(Math.floor(a),", ").concat(Math.floor(l),")")}return this.getAttribute("from").getColor()}constructor(...e){super(...e),this.type="animateColor"}}class Io extends Ui{calcValue(){const{progress:e,from:t,to:i}=this.getProgress(),n=me(t.getString()),r=me(i.getString());return n.map((a,l)=>{const u=r[l];return a+(u-a)*e}).join(" ")}constructor(...e){super(...e),this.type="animateTransform"}}class pn extends q{constructor(e,t,i){super(e,t,i),this.type="font-face",this.ascent=this.getAttribute("ascent").getNumber(),this.descent=this.getAttribute("descent").getNumber(),this.unitsPerEm=this.getAttribute("units-per-em").getNumber()}}class Hi extends U{constructor(e,t,i){super(e,t,i),this.type="glyph",this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}}class fn extends Hi{constructor(...e){super(...e),this.type="missing-glyph",this.horizAdvX=0}}class Ro extends q{render(){}constructor(e,t,i){super(e,t,i),this.type="font",this.isArabic=!1,this.glyphs={},this.arabicGlyphs={},this.isRTL=!1,this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();const{definitions:n}=e,{children:r}=this;for(const o of r)if(o instanceof pn){this.fontFace=o;const a=o.getStyle("font-family");a.hasValue()&&(n[a.getString()]=this)}else if(o instanceof fn)this.missingGlyph=o;else if(o instanceof Hi)if(o.arabicForm){this.isRTL=!0,this.isArabic=!0;const a=this.arabicGlyphs[o.unicode];typeof a=="undefined"?this.arabicGlyphs[o.unicode]={[o.arabicForm]:o}:a[o.arabicForm]=o}else this.glyphs[o.unicode]=o}}class Lo extends Le{getText(){const e=this.getHrefAttribute().getDefinition();if(e){const t=e.children[0];if(t)return t.getText()}return""}constructor(...e){super(...e),this.type="tref"}}class Do extends Le{getText(){return this.text}renderChildren(e){if(this.hasText){super.renderChildren(e);const{document:t,x:i,y:n}=this,{mouse:r}=t.screen,o=new M(t,"fontSize",le.parse(t.ctx.font).fontSize);r.isWorking()&&r.checkBoundingBox(this,new Ae(i,n-o.getPixels("y"),i+this.measureText(e),n))}else if(this.children.length>0){const t=new Vi(this.document);t.children=this.children,t.parent=this,t.render(e)}}onClick(){const{window:e}=this.document;e&&e.open(this.getHrefAttribute().getString())}onMouseMove(){const e=this.document.ctx;e.canvas.style.cursor="pointer"}constructor(e,t,i){super(e,t,i),this.type="a";const{childNodes:n}=t,r=n[0],o=n.length>0&&Array.from(n).every(a=>a.nodeType===3);this.hasText=o,this.text=o?this.getTextFromNode(r):""}}class Vo extends Le{getText(){return this.text}path(e){const{dataArray:t}=this;e&&e.beginPath(),t.forEach(i=>{let{type:n,points:r}=i;switch(n){case I.LINE_TO:e&&e.lineTo(r[0],r[1]);break;case I.MOVE_TO:e&&e.moveTo(r[0],r[1]);break;case I.CURVE_TO:e&&e.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]);break;case I.QUAD_TO:e&&e.quadraticCurveTo(r[0],r[1],r[2],r[3]);break;case I.ARC:{const[o,a,l,u,c,m,h,d]=r,p=l>u?l:u,f=l>u?1:l/u,y=l>u?u/l:1;e&&(e.translate(o,a),e.rotate(h),e.scale(f,y),e.arc(0,0,p,c,c+m,Boolean(1-d)),e.scale(1/f,1/y),e.rotate(-h),e.translate(-o,-a));break}case I.CLOSE_PATH:e&&e.closePath();break}})}renderChildren(e){this.setTextData(e),e.save();const t=this.parent.getStyle("text-decoration").getString(),i=this.getFontSize(),{glyphInfo:n}=this,r=e.fillStyle;t==="underline"&&e.beginPath(),n.forEach((o,a)=>{const{p0:l,p1:u,rotation:c,text:m}=o;e.save(),e.translate(l.x,l.y),e.rotate(c),e.fillStyle&&e.fillText(m,0,0),e.strokeStyle&&e.strokeText(m,0,0),e.restore(),t==="underline"&&(a===0&&e.moveTo(l.x,l.y+i/8),e.lineTo(u.x,u.y+i/5))}),t==="underline"&&(e.lineWidth=i/20,e.strokeStyle=r,e.stroke(),e.closePath()),e.restore()}getLetterSpacingAt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.letterSpacingCache[e]||0}findSegmentToFitChar(e,t,i,n,r,o,a,l,u){let c=o,m=this.measureText(e,l);l===" "&&t==="justify"&&i<n&&(m+=(n-i)/r),u>-1&&(c+=this.getLetterSpacingAt(u));const h=this.textHeight/20,d=this.getEquidistantPointOnPath(c,h,0),p=this.getEquidistantPointOnPath(c+m,h,0),f={p0:d,p1:p},y=d&&p?Math.atan2(p.y-d.y,p.x-d.x):0;if(a){const v=Math.cos(Math.PI/2+y)*a,A=Math.cos(-y)*a;f.p0={...d,x:d.x+v,y:d.y+A},f.p1={...p,x:p.x+v,y:p.y+A}}return c+=m,{offset:c,segment:f,rotation:y}}measureText(e,t){const{measuresCache:i}=this,n=t||this.getText();if(i.has(n))return i.get(n);const r=this.measureTargetText(e,n);return i.set(n,r),r}setTextData(e){if(this.glyphInfo)return;const t=this.getText(),i=t.split(""),n=t.split(" ").length-1,r=this.parent.getAttribute("dx").split().map(w=>w.getPixels("x")),o=this.parent.getAttribute("dy").getPixels("y"),a=this.parent.getStyle("text-anchor").getString("start"),l=this.getStyle("letter-spacing"),u=this.parent.getStyle("letter-spacing");let c=0;!l.hasValue()||l.getValue()==="inherit"?c=u.getPixels():l.hasValue()&&l.getValue()!=="initial"&&l.getValue()!=="unset"&&(c=l.getPixels());const m=[],h=t.length;this.letterSpacingCache=m;for(let w=0;w<h;w++)m.push(typeof r[w]!="undefined"?r[w]:c);const d=m.reduce((w,b,E)=>E===0?0:w+b||0,0),p=this.measureText(e),f=Math.max(p+d,0);this.textWidth=p,this.textHeight=this.getFontSize(),this.glyphInfo=[];const y=this.getPathLength(),v=this.getStyle("startOffset").getNumber(0)*y;let A=0;(a==="middle"||a==="center")&&(A=-f/2),(a==="end"||a==="right")&&(A=-f),A+=v,i.forEach((w,b)=>{const{offset:E,segment:T,rotation:x}=this.findSegmentToFitChar(e,a,f,y,n,A,o,w,b);A=E,!(!T.p0||!T.p1)&&this.glyphInfo.push({text:i[b],p0:T.p0,p1:T.p1,rotation:x})})}parsePathData(e){if(this.pathLength=-1,!e)return[];const t=[],{pathParser:i}=e;for(i.reset();!i.isEnd();){const{current:n}=i,r=n?n.x:0,o=n?n.y:0,a=i.next();let l=a.type,u=[];switch(a.type){case I.MOVE_TO:this.pathM(i,u);break;case I.LINE_TO:l=this.pathL(i,u);break;case I.HORIZ_LINE_TO:l=this.pathH(i,u);break;case I.VERT_LINE_TO:l=this.pathV(i,u);break;case I.CURVE_TO:this.pathC(i,u);break;case I.SMOOTH_CURVE_TO:l=this.pathS(i,u);break;case I.QUAD_TO:this.pathQ(i,u);break;case I.SMOOTH_QUAD_TO:l=this.pathT(i,u);break;case I.ARC:u=this.pathA(i);break;case I.CLOSE_PATH:U.pathZ(i);break}a.type!==I.CLOSE_PATH?t.push({type:l,points:u,start:{x:r,y:o},pathLength:this.calcLength(r,o,l,u)}):t.push({type:I.CLOSE_PATH,points:[],pathLength:0})}return t}pathM(e,t){const{x:i,y:n}=U.pathM(e).point;t.push(i,n)}pathL(e,t){const{x:i,y:n}=U.pathL(e).point;return t.push(i,n),I.LINE_TO}pathH(e,t){const{x:i,y:n}=U.pathH(e).point;return t.push(i,n),I.LINE_TO}pathV(e,t){const{x:i,y:n}=U.pathV(e).point;return t.push(i,n),I.LINE_TO}pathC(e,t){const{point:i,controlPoint:n,currentPoint:r}=U.pathC(e);t.push(i.x,i.y,n.x,n.y,r.x,r.y)}pathS(e,t){const{point:i,controlPoint:n,currentPoint:r}=U.pathS(e);return t.push(i.x,i.y,n.x,n.y,r.x,r.y),I.CURVE_TO}pathQ(e,t){const{controlPoint:i,currentPoint:n}=U.pathQ(e);t.push(i.x,i.y,n.x,n.y)}pathT(e,t){const{controlPoint:i,currentPoint:n}=U.pathT(e);return t.push(i.x,i.y,n.x,n.y),I.QUAD_TO}pathA(e){let{rX:t,rY:i,sweepFlag:n,xAxisRotation:r,centp:o,a1:a,ad:l}=U.pathA(e);return n===0&&l>0&&(l-=2*Math.PI),n===1&&l<0&&(l+=2*Math.PI),[o.x,o.y,t,i,a,l,r,n]}calcLength(e,t,i,n){let r=0,o=null,a=null,l=0;switch(i){case I.LINE_TO:return this.getLineLength(e,t,n[0],n[1]);case I.CURVE_TO:for(r=0,o=this.getPointOnCubicBezier(0,e,t,n[0],n[1],n[2],n[3],n[4],n[5]),l=.01;l<=1;l+=.01)a=this.getPointOnCubicBezier(l,e,t,n[0],n[1],n[2],n[3],n[4],n[5]),r+=this.getLineLength(o.x,o.y,a.x,a.y),o=a;return r;case I.QUAD_TO:for(r=0,o=this.getPointOnQuadraticBezier(0,e,t,n[0],n[1],n[2],n[3]),l=.01;l<=1;l+=.01)a=this.getPointOnQuadraticBezier(l,e,t,n[0],n[1],n[2],n[3]),r+=this.getLineLength(o.x,o.y,a.x,a.y),o=a;return r;case I.ARC:{r=0;const u=n[4],c=n[5],m=n[4]+c;let h=Math.PI/180;if(Math.abs(u-m)<h&&(h=Math.abs(u-m)),o=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],u,0),c<0)for(l=u-h;l>m;l-=h)a=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],l,0),r+=this.getLineLength(o.x,o.y,a.x,a.y),o=a;else for(l=u+h;l<m;l+=h)a=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],l,0),r+=this.getLineLength(o.x,o.y,a.x,a.y),o=a;return a=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],m,0),r+=this.getLineLength(o.x,o.y,a.x,a.y),r}}return 0}getPointOnLine(e,t,i,n,r){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:t,a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:i;const l=(r-i)/(n-t+_e);let u=Math.sqrt(e*e/(1+l*l));n<t&&(u*=-1);let c=l*u,m=null;if(n===t)m={x:o,y:a+c};else if((a-i)/(o-t+_e)===l)m={x:o+u,y:a+c};else{let h=0,d=0;const p=this.getLineLength(t,i,n,r);if(p<_e)return null;let f=(o-t)*(n-t)+(a-i)*(r-i);f/=p*p,h=t+f*(n-t),d=i+f*(r-i);const y=this.getLineLength(o,a,h,d),v=Math.sqrt(e*e-y*y);u=Math.sqrt(v*v/(1+l*l)),n<t&&(u*=-1),c=l*u,m={x:h+u,y:d+c}}return m}getPointOnPath(e){const t=this.getPathLength();let i=0,n=null;if(e<-5e-5||e-5e-5>t)return null;const{dataArray:r}=this;for(const o of r){if(o&&(o.pathLength<5e-5||i+o.pathLength+5e-5<e)){i+=o.pathLength;continue}const a=e-i;let l=0;switch(o.type){case I.LINE_TO:n=this.getPointOnLine(a,o.start.x,o.start.y,o.points[0],o.points[1],o.start.x,o.start.y);break;case I.ARC:{const u=o.points[4],c=o.points[5],m=o.points[4]+c;if(l=u+a/o.pathLength*c,c<0&&l<m||c>=0&&l>m)break;n=this.getPointOnEllipticalArc(o.points[0],o.points[1],o.points[2],o.points[3],l,o.points[6]);break}case I.CURVE_TO:l=a/o.pathLength,l>1&&(l=1),n=this.getPointOnCubicBezier(l,o.start.x,o.start.y,o.points[0],o.points[1],o.points[2],o.points[3],o.points[4],o.points[5]);break;case I.QUAD_TO:l=a/o.pathLength,l>1&&(l=1),n=this.getPointOnQuadraticBezier(l,o.start.x,o.start.y,o.points[0],o.points[1],o.points[2],o.points[3]);break}if(n)return n;break}return null}getLineLength(e,t,i,n){return Math.sqrt((i-e)*(i-e)+(n-t)*(n-t))}getPathLength(){return this.pathLength===-1&&(this.pathLength=this.dataArray.reduce((e,t)=>t.pathLength>0?e+t.pathLength:e,0)),this.pathLength}getPointOnCubicBezier(e,t,i,n,r,o,a,l,u){const c=l*fs(e)+o*ys(e)+n*bs(e)+t*vs(e),m=u*fs(e)+a*ys(e)+r*bs(e)+i*vs(e);return{x:c,y:m}}getPointOnQuadraticBezier(e,t,i,n,r,o,a){const l=o*As(e)+n*ws(e)+t*Cs(e),u=a*As(e)+r*ws(e)+i*Cs(e);return{x:l,y:u}}getPointOnEllipticalArc(e,t,i,n,r,o){const a=Math.cos(o),l=Math.sin(o),u={x:i*Math.cos(r),y:n*Math.sin(r)};return{x:e+(u.x*a-u.y*l),y:t+(u.x*l+u.y*a)}}buildEquidistantCache(e,t){const i=this.getPathLength(),n=t||.25,r=e||i/100;if(!this.equidistantCache||this.equidistantCache.step!==r||this.equidistantCache.precision!==n){this.equidistantCache={step:r,precision:n,points:[]};let o=0;for(let a=0;a<=i;a+=n){const l=this.getPointOnPath(a),u=this.getPointOnPath(a+n);!l||!u||(o+=this.getLineLength(l.x,l.y,u.x,u.y),o>=r&&(this.equidistantCache.points.push({x:l.x,y:l.y,distance:a}),o-=r))}}}getEquidistantPointOnPath(e,t,i){if(this.buildEquidistantCache(t,i),e<0||e-this.getPathLength()>5e-5)return null;const n=Math.round(e/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[n]||null}constructor(e,t,i){super(e,t,i),this.type="textPath",this.textWidth=0,this.textHeight=0,this.pathLength=-1,this.glyphInfo=null,this.letterSpacingCache=[],this.measuresCache=new Map([["",0]]);const n=this.getHrefAttribute().getDefinition();this.text=this.getTextFromNode(),this.dataArray=this.parsePathData(n)}}const Uo=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class Ho extends Ye{async loadImage(e){try{const t=await this.document.createImage(e);this.image=t}catch(t){console.error('Error while loading image "'.concat(e,'":'),t)}this.loaded=!0}async loadSvg(e){const t=Uo.exec(e);if(t){const i=t[5];i&&(t[4]==="base64"?this.image=atob(i):this.image=decodeURIComponent(i))}else try{const n=await(await this.document.fetch(e)).text();this.image=n}catch(i){console.error('Error while loading image "'.concat(e,'":'),i)}this.loaded=!0}renderChildren(e){const{document:t,image:i,loaded:n}=this,r=this.getAttribute("x").getPixels("x"),o=this.getAttribute("y").getPixels("y"),a=this.getStyle("width").getPixels("x"),l=this.getStyle("height").getPixels("y");if(!(!n||!i||!a||!l)){if(e.save(),e.translate(r,o),typeof i=="string"){const u=t.canvg.forkString(e,i,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:a,scaleHeight:l}),{documentElement:c}=u.document;c&&(c.parent=this),u.render()}else t.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:a,desiredWidth:i.width,height:l,desiredHeight:i.height}),this.loaded&&(!("complete"in i)||i.complete)&&e.drawImage(i,0,0);e.restore()}}getBoundingBox(){const e=this.getAttribute("x").getPixels("x"),t=this.getAttribute("y").getPixels("y"),i=this.getStyle("width").getPixels("x"),n=this.getStyle("height").getPixels("y");return new Ae(e,t,e+i,t+n)}constructor(e,t,i){super(e,t,i),this.type="image",this.loaded=!1;const n=this.getHrefAttribute().getString();if(!n)return;const r=n.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(n);e.images.push(this),r?this.loadSvg(n):this.loadImage(n)}}class zo extends Ye{render(e){}constructor(...e){super(...e),this.type="symbol"}}class Qo{async load(e,t){try{const{document:i}=this,r=(await i.canvg.parser.load(t)).getElementsByTagName("font");Array.from(r).forEach(o=>{const a=i.createElement(o);i.definitions[e]=a})}catch(i){console.error('Error while loading font "'.concat(t,'":'),i)}this.loaded=!0}constructor(e){this.document=e,this.loaded=!1,e.fonts.push(this)}}class yn extends q{constructor(e,t,i){super(e,t,i),this.type="style",tt(Array.from(t.childNodes).map(o=>o.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")).split("}").forEach(o=>{const a=o.trim();if(!a)return;const l=a.split("{"),u=l[0].split(","),c=l[1].split(";");u.forEach(m=>{const h=m.trim();if(!h)return;const d=e.styles[h]||{};if(c.forEach(p=>{const f=p.indexOf(":"),y=p.substr(0,f).trim(),v=p.substr(f+1,p.length-f).trim();y&&v&&(d[y]=new M(e,y,v))}),e.styles[h]=d,e.stylesSpecificity[h]=ro(h),h==="@font-face"){const p=d["font-family"].getString().replace(/"|'/g,"");d.src.getString().split(",").forEach(y=>{if(y.indexOf('format("svg")')>0){const v=on(y);v&&new Qo(e).load(p,v)}})}})})}}yn.parseExternalUrl=on;class Wo extends Ye{setContext(e){super.setContext(e);const t=this.getAttribute("x"),i=this.getAttribute("y");t.hasValue()&&e.translate(t.getPixels("x"),0),i.hasValue()&&e.translate(0,i.getPixels("y"))}path(e){const{element:t}=this;t&&t.path(e)}renderChildren(e){const{document:t,element:i}=this;if(i){let n=i;if(i.type==="symbol"&&(n=new bt(t),n.attributes.viewBox=new M(t,"viewBox",i.getAttribute("viewBox").getString()),n.attributes.preserveAspectRatio=new M(t,"preserveAspectRatio",i.getAttribute("preserveAspectRatio").getString()),n.attributes.overflow=new M(t,"overflow",i.getAttribute("overflow").getString()),n.children=i.children,i.styles.opacity=new M(t,"opacity",this.calculateOpacity())),n.type==="svg"){const o=this.getStyle("width",!1,!0),a=this.getStyle("height",!1,!0);o.hasValue()&&(n.attributes.width=new M(t,"width",o.getString())),a.hasValue()&&(n.attributes.height=new M(t,"height",a.getString()))}const r=n.parent;n.parent=this,n.render(e),n.parent=r}}getBoundingBox(e){const{element:t}=this;return t?t.getBoundingBox(e):null}elementTransform(){const{document:e,element:t}=this;return t?Xe.fromElement(e,t):null}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}constructor(...e){super(...e),this.type="use"}}function Pt(s,e,t,i,n,r){return s[t*i*4+e*4+r]}function Mt(s,e,t,i,n,r,o){s[t*i*4+e*4+r]=o}function _(s,e,t){return s[e]*t}function Ee(s,e,t,i){return e+Math.cos(s)*t+Math.sin(s)*i}class bn extends q{apply(e,t,i,n,r){const{includeOpacity:o,matrix:a}=this,l=e.getImageData(0,0,n,r);for(let u=0;u<r;u++)for(let c=0;c<n;c++){const m=Pt(l.data,c,u,n,r,0),h=Pt(l.data,c,u,n,r,1),d=Pt(l.data,c,u,n,r,2),p=Pt(l.data,c,u,n,r,3);let f=_(a,0,m)+_(a,1,h)+_(a,2,d)+_(a,3,p)+_(a,4,1),y=_(a,5,m)+_(a,6,h)+_(a,7,d)+_(a,8,p)+_(a,9,1),v=_(a,10,m)+_(a,11,h)+_(a,12,d)+_(a,13,p)+_(a,14,1),A=_(a,15,m)+_(a,16,h)+_(a,17,d)+_(a,18,p)+_(a,19,1);o&&(f=0,y=0,v=0,A*=p/255),Mt(l.data,c,u,n,r,0,f),Mt(l.data,c,u,n,r,1,y),Mt(l.data,c,u,n,r,2,v),Mt(l.data,c,u,n,r,3,A)}e.clearRect(0,0,n,r),e.putImageData(l,0,0)}constructor(e,t,i){super(e,t,i),this.type="feColorMatrix";let n=me(this.getAttribute("values").getString());switch(this.getAttribute("type").getString("matrix")){case"saturate":{const r=n[0];n=[.213+.787*r,.715-.715*r,.072-.072*r,0,0,.213-.213*r,.715+.285*r,.072-.072*r,0,0,.213-.213*r,.715-.715*r,.072+.928*r,0,0,0,0,0,1,0,0,0,0,0,1];break}case"hueRotate":{const r=n[0]*Math.PI/180;n=[Ee(r,.213,.787,-.213),Ee(r,.715,-.715,-.715),Ee(r,.072,-.072,.928),0,0,Ee(r,.213,-.213,.143),Ee(r,.715,.285,.14),Ee(r,.072,-.072,-.283),0,0,Ee(r,.213,-.213,-.787),Ee(r,.715,-.715,.715),Ee(r,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break}case"luminanceToAlpha":n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1];break}this.matrix=n,this.includeOpacity=this.getAttribute("includeOpacity").hasValue()}}class Wt extends q{apply(e,t){const{document:i}=this;let n=this.getAttribute("x").getPixels("x"),r=this.getAttribute("y").getPixels("y"),o=this.getStyle("width").getPixels("x"),a=this.getStyle("height").getPixels("y");if(!o&&!a){const d=new Ae;this.children.forEach(p=>{d.addBoundingBox(p.getBoundingBox(e))}),n=Math.floor(d.x1),r=Math.floor(d.y1),o=Math.floor(d.width),a=Math.floor(d.height)}const l=this.removeStyles(t,Wt.ignoreStyles),u=i.createCanvas(n+o,r+a),c=u.getContext("2d");i.screen.setDefaults(c),this.renderChildren(c),new bn(i,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(c,0,0,n+o,r+a);const m=i.createCanvas(n+o,r+a),h=m.getContext("2d");i.screen.setDefaults(h),t.render(h),h.globalCompositeOperation="destination-in",h.fillStyle=c.createPattern(u,"no-repeat"),h.fillRect(0,0,n+o,r+a),e.fillStyle=h.createPattern(m,"no-repeat"),e.fillRect(0,0,n+o,r+a),this.restoreStyles(t,l)}render(e){}constructor(...e){super(...e),this.type="mask"}}Wt.ignoreStyles=["mask","transform","clip-path"];const xs=()=>{};class qo extends q{apply(e){const{document:t}=this,i=Reflect.getPrototypeOf(e),{beginPath:n,closePath:r}=e;i&&(i.beginPath=xs,i.closePath=xs),Reflect.apply(n,e,[]),this.children.forEach(o=>{if(!("path"in o))return;let a="elementTransform"in o?o.elementTransform():null;a||(a=Xe.fromElement(t,o)),a&&a.apply(e),o.path(e),i&&(i.closePath=r),a&&a.unapply(e)}),Reflect.apply(r,e,[]),e.clip(),i&&(i.beginPath=n,i.closePath=r)}render(e){}constructor(...e){super(...e),this.type="clipPath"}}class qt extends q{apply(e,t){const{document:i,children:n}=this,r="getBoundingBox"in t?t.getBoundingBox(e):null;if(!r)return;let o=0,a=0;n.forEach(v=>{const A=v.extraFilterDistance||0;o=Math.max(o,A),a=Math.max(a,A)});const l=Math.floor(r.width),u=Math.floor(r.height),c=l+2*o,m=u+2*a;if(c<1||m<1)return;const h=Math.floor(r.x),d=Math.floor(r.y),p=this.removeStyles(t,qt.ignoreStyles),f=i.createCanvas(c,m),y=f.getContext("2d");i.screen.setDefaults(y),y.translate(-h+o,-d+a),t.render(y),n.forEach(v=>{typeof v.apply=="function"&&v.apply(y,0,0,c,m)}),e.drawImage(f,0,0,c,m,h-o,d-a,c,m),this.restoreStyles(t,p)}render(e){}constructor(...e){super(...e),this.type="filter"}}qt.ignoreStyles=["filter","transform","clip-path"];class Xo extends q{apply(e,t,i,n,r){}constructor(e,t,i){super(e,t,i),this.type="feDropShadow",this.addStylesFromStyleDefinition()}}class Yo extends q{apply(e,t,i,n,r){}constructor(...e){super(...e),this.type="feMorphology"}}class jo extends q{apply(e,t,i,n,r){}constructor(...e){super(...e),this.type="feComposite"}}class Go extends q{apply(e,t,i,n,r){const{document:o,blurRadius:a}=this,l=o.window?o.window.document.body:null,u=e.canvas;u.id=o.getUniqueId(),l&&(u.style.display="none",l.appendChild(u)),za(u,t,i,n,r,a),l&&l.removeChild(u)}constructor(e,t,i){super(e,t,i),this.type="feGaussianBlur",this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}}class Ko extends q{constructor(...e){super(...e),this.type="title"}}class Jo extends q{constructor(...e){super(...e),this.type="desc"}}const Zo={svg:bt,rect:dn,circle:To,ellipse:xo,line:Eo,polyline:mn,polygon:So,path:U,pattern:ko,marker:No,defs:Po,linearGradient:Mo,radialGradient:Bo,stop:Oo,animate:Ui,animateColor:Fo,animateTransform:Io,font:Ro,"font-face":pn,"missing-glyph":fn,glyph:Hi,text:Le,tspan:Qt,tref:Lo,a:Do,textPath:Vo,image:Ho,g:Vi,symbol:zo,style:yn,use:Wo,mask:Wt,clipPath:qo,filter:qt,feDropShadow:Xo,feMorphology:Yo,feComposite:jo,feColorMatrix:bn,feGaussianBlur:Go,title:Ko,desc:Jo};function _o(s,e){const t=document.createElement("canvas");return t.width=s,t.height=e,t}async function $o(s){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const t=document.createElement("img");return e&&(t.crossOrigin="Anonymous"),new Promise((i,n)=>{t.onload=()=>{i(t)},t.onerror=(r,o,a,l,u)=>{n(u)},t.src=s})}const wi=12;class Re{bindCreateImage(e,t){return typeof t=="boolean"?(i,n)=>e(i,typeof n=="boolean"?n:t):e}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){const{emSizeStack:e}=this;return e[e.length-1]||wi}set emSize(e){const{emSizeStack:t}=this;t.push(e)}popEmSize(){const{emSizeStack:e}=this;e.pop()}getUniqueId(){return"canvg".concat(++this.uniqueId)}isImagesLoaded(){return this.images.every(e=>e.loaded)}isFontsLoaded(){return this.fonts.every(e=>e.loaded)}createDocumentElement(e){const t=this.createElement(e.documentElement);return t.root=!0,t.addStylesFromStyleDefinition(),this.documentElement=t,t}createElement(e){const t=e.nodeName.replace(/^[^:]+:/,""),i=Re.elementTypes[t];return i?new i(this,e):new yo(this,e)}createTextNode(e){return new Co(this,e)}setViewBox(e){this.screen.setViewBox({document:this,...e})}constructor(e,{rootEmSize:t=wi,emSize:i=wi,createCanvas:n=Re.createCanvas,createImage:r=Re.createImage,anonymousCrossOrigin:o}={}){this.canvg=e,this.definitions={},this.styles={},this.stylesSpecificity={},this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=e.screen,this.rootEmSize=t,this.emSize=i,this.createCanvas=n,this.createImage=this.bindCreateImage(r,o),this.screen.wait(()=>this.isImagesLoaded()),this.screen.wait(()=>this.isFontsLoaded())}}Re.createCanvas=_o;Re.createImage=$o;Re.elementTypes=Zo;class Je{static async from(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=await new Ai(i).parse(t);return new Je(e,r,i)}static fromString(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=new Ai(i).parseFromString(t);return new Je(e,r,i)}fork(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Je.from(e,t,{...this.options,...i})}forkString(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Je.fromString(e,t,{...this.options,...i})}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}async render(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.start({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0,...e}),await this.ready(),this.stop()}start(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{documentElement:t,screen:i,options:n}=this;i.start(t,{enableRedraw:!0,...n,...e})}stop(){this.screen.stop()}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.documentElement.resize(e,t,i)}constructor(e,t,i={}){this.parser=new Ai(i),this.screen=new Pe(e,i),this.options=i;const n=new Re(this,i),r=n.createDocumentElement(t);this.document=n,this.documentElement=r}}window.OffscreenCanvas||(window.OffscreenCanvas=class{constructor(e,t){return this.canvas=document.createElement("canvas"),this.canvas.width=e,this.canvas.height=t,this.canvas.convertToBlob=()=>new Promise(i=>{this.canvas.toBlob(i)}),this.canvas}});const el=Xa.offscreen(),tl=s=>new Promise((e,t)=>{const i=new FileReader;i.onloadend=()=>e(i.result),i.readAsDataURL(s)});let Ke=null;const il=async(s,e,t)=>{Ke||(Ke=new OffscreenCanvas(e,t));const i=Ke.getContext("2d");let n=await Je.fromString(i,s,el);n.resize(e*2,t*2,"xMidYMid meet"),await n.start();const r=await Ke.convertToBlob(),o=await tl(r);return i.clearRect(0,0,Ke.width,Ke.height),await n.stop(),n=null,o},Es=s=>{var r,o;if(!s)return"";const e=new DOMParser().parseFromString(s,"text/xml"),t=e.getElementsByTagName("measure");let i=-1,n=-1;for(const a of t){i===-1&&a.getElementsByTagName("beats").length&&(i=parseInt(a.getElementsByTagName("beats")[0].textContent||"4")),n===-1&&a.getElementsByTagName("beat-type").length&&(n=parseInt(a.getElementsByTagName("beat-type")[0].textContent||"4"));const l=parseInt(((r=a.getElementsByTagName("divisions")[0])==null?void 0:r.textContent)||"256");if(a.getElementsByTagName("note").length===0){const u=(o=a.getElementsByTagName("forward")[0])==null?void 0:o.getElementsByTagName("duration")[0];u&&(u.textContent="0"),a.innerHTML=a.innerHTML+`
  15. <note>
  16. <rest measure="yes"/>
  17. <duration>${l*i}</duration>
  18. <voice>1</voice>
  19. <type>whole</type>
  20. </note>`}}return new XMLSerializer().serializeToString(e)},Ss=(s,e)=>{var c,m,h,d;if(!s)return"";const t=new DOMParser().parseFromString(s,"text/xml"),i=((m=(c=t.getElementsByTagName("part-list"))==null?void 0:c[0])==null?void 0:m.getElementsByTagName("score-part"))||[],n=Array.from(i).map(p=>{var f;return((f=p.getElementsByTagName("part-name"))==null?void 0:f[0].textContent)||""}),r=t.getElementsByTagName("part"),o=r[0],a=[...o.getElementsByTagName("measure")],l=[...o.getElementsByTagName("metronome")];[...o.getElementsByTagName("words")],[...o.getElementsByTagName("coda")],[...o.getElementsByTagName("rehearsal")],((d=(h=n[0])==null?void 0:h.toLocaleUpperCase)==null?void 0:d.call(h))==="COMMON"&&(e++,n.shift());const u=i[e];if(u){const p=u.getAttribute("id");Array.from(r).forEach(y=>{var v,A,w,b,E;if(y&&y.getAttribute("id")!==p)(v=y.parentNode)==null||v.removeChild(y);else if(y&&y.getAttribute("id")!=="P1"){const T={};for(let x=0;x<l.length;x++){const P=l[x],F=(w=(A=P.parentElement)==null?void 0:A.parentElement)==null?void 0:w.parentElement;if(F){const z=a.indexOf(F);T[z]=P}}Object.values(T).forEach(x=>{var Q;const P=(Q=x.parentElement)==null?void 0:Q.parentElement,F=P==null?void 0:P.parentElement,z=[...(F==null?void 0:F.childNodes)||[]],D=P?z.indexOf(P):-1;if(F&&D>-1){const W=a.indexOf(F),j=y.getElementsByTagName("measure")[W];nl(P,F,j)}})}if(y&&y.getAttribute("id")===p){const T=y.getElementsByTagName("barline"),x=(b=T[T.length-1])==null?void 0:b.parentElement;if(((E=x==null?void 0:x.lastElementChild)==null?void 0:E.tagName)!=="barline"){const P=(x==null?void 0:x.children)||[];for(const F of P)if(F.tagName==="barline"){x==null||x.appendChild(F);break}}}}),Array.from(i).forEach(y=>{var v;y&&y.getAttribute("id")!==p&&((v=y.parentNode)==null||v.removeChild(y))});const f=t.getElementsByTagName("note");Array.from(f).forEach((y,v)=>{const A=y.getElementsByTagName("grace");A&&A.length})}return new XMLSerializer().serializeToString(sl(t))},sl=s=>{var i,n,r,o;if(!s)return s;const e=s.querySelectorAll("grace");if(!e.length)return s;const t=a=>a.querySelector("grace")?t(a==null?void 0:a.nextElementSibling):a;for(const a of e){const l=(i=a.parentElement)==null?void 0:i.querySelector("notations");if(l&&l.querySelectorAll("slur").length>1){const u=t((n=a.parentElement)==null?void 0:n.nextElementSibling);if(u&&u.querySelectorAll("slur").length>0){const c=Array.from(((r=u.querySelector("notations"))==null?void 0:r.children)||[]).map(h=>h.getAttribute("number")),m=l.querySelectorAll("slur");for(const h of m)c.includes(h.getAttribute("number"))||(o=u.querySelector("notations"))==null||o.appendChild(h)}}}return s},nl=(s,e,t)=>{let i=0;if(!!e){for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(r.nodeName==="note"&&i++,r===s)break}if(i===0&&t){t.insertBefore(s,t.childNodes[0]);return}if(t&&t.childNodes.length>0){let n=0;const r=Array.from(t.childNodes).filter(a=>a.nodeName==="note"),o=r[r.length-1];if(i>=r.length&&o){t.insertBefore(s,t.childNodes[Array.from(t.childNodes).indexOf(o)]);return}for(let a=0;a<r.length;a++){const l=r[a];if(l.nodeName==="note"&&(n=n+1,n===i)){t.insertBefore(s,l);break}}}}},ks=s=>{var n,r;const e={showSpeed:!0,parsedXML:s},t=new DOMParser().parseFromString(s,"text/xml"),i=t.getElementsByTagName("words");for(const o of i)o&&((n=o.textContent)==null?void 0:n.trim())==="\u9690\u85CF\u901F\u5EA6"&&(e.showSpeed=!1,o.textContent=""),o&&((r=o.textContent)==null?void 0:r.trim())==="@"&&(o.textContent="segno");return e.parsedXML=new XMLSerializer().serializeToString(t),e};var El=Oi({name:"music-detail",setup(){const s=Tn(),e=be(),t=be(null),i=be([]),n=xn({details:{},musicPdfUrl:"",status:!1,open:!1,audioReady:!1,iframeSrc:"",isComberRender:!1,musicXml:[],instrumentName:"",iframeRef:null,imgs:[],radio:"staff",partList:[],partNames:[],selectedPartName:"",selectedPartIndex:0,partXmlIndex:0}),r=be(!1),o=be(!1),a=be([]);Ns(()=>n.radio,b=>{var E,T,x;b=="first"?a.value=oi(((E=n.details.musicFirstSvg)==null?void 0:E.split(","))||[]):b=="fixed"?a.value=oi(((T=n.details.musicJianSvg)==null?void 0:T.split(","))||[]):a.value=oi(((x=n.details.musicImg)==null?void 0:x.split(","))||[])});const l=async()=>{const b=document.getElementById("staffIframeRef");if(b&&b.contentWindow.renderXml){const E=await ai.get(n.details.xmlFileUrl,{mode:"cors"}),T=ks(E),x=Es(T.parsedXML);if(n.isComberRender)b.contentWindow.renderXml(x,n.partXmlIndex,n.isComberRender);else{const P=Ss(x,n.partXmlIndex);b.contentWindow.renderXml(P,n.partXmlIndex,n.isComberRender)}}},u=async()=>{const b=document.getElementById("staffIframeRef");if(b&&b.contentWindow.renderXml){r.value=!0;const E=await ai.get(n.details.xmlFileUrl,{mode:"cors"}),T=ks(E),x=Es(T.parsedXML);if(n.isComberRender)b.contentWindow.renderXml(x,n.partXmlIndex,n.isComberRender);else{const P=Ss(x,n.partXmlIndex);b.contentWindow.renderXml(P,0,n.isComberRender)}}},c=(b,E)=>{const T=document.getElementById("staffIframeRef");T&&T.contentWindow.renderXml&&T.contentWindow.resetRenderPage(b,E)},m=async()=>{try{n.musicPdfUrl?(document.querySelector("#staffIframeRef").contentWindow.location.replace(`${location.origin}${location.pathname}pdf/web/viewer.html?file=${encodeURIComponent(n.musicPdfUrl)}&t=${Date.now()}`),n.iframeSrc=`${location.origin}${location.pathname}pdf/web/viewer.html?file=${encodeURIComponent(n.musicPdfUrl)}&t=${Date.now()}`):(document.querySelector("#staffIframeRef").contentWindow.location.replace(`${location.origin}${location.pathname}osmd/index.html`),n.iframeSrc=`${location.origin}${location.pathname}osmd/index.html`)}catch{}},h=async b=>{const E=[];try{const T=await ai.get(b,{mode:"cors"}),x=new DOMParser().parseFromString(T,"text/xml");for(const P of x.getElementsByTagName("part-name"))P.textContent&&E.push(P.textContent)}catch{}return E.filter(T=>T.toLocaleUpperCase()!=="COMMON")||[]},d=(b,E="")=>{var T;if(E=E.toLocaleLowerCase().replace(/ /g,""),!E)return"";for(let x in b){const P=b[x],F=(T=P.track)==null?void 0:T.toLocaleLowerCase().replace(/ /g,"");if(console.log(F),F===E)return P}return""},p=async b=>{var x,P,F,z;if(b.musicSheetType==="SINGLE"){r.value=!1,n.musicPdfUrl=b.musicPdfUrl;return}n.partNames=await h(b.xmlFileUrl);let E=b.background||[];E=E.filter(D=>{var Q,W;return!((W=(Q=D.track)==null?void 0:Q.toLocaleUpperCase())!=null&&W.includes("COMMON"))}),i.value=E.map((D,Q)=>{const W=zn(D.track),j=n.partNames.findIndex(G=>G===D.track);return{text:D.track+(W?`(${W})`:""),instrumentName:W,track:D.track,xmlIndex:j,value:Q}});const T=i.value[n.selectedPartIndex];if(n.selectedPartName=T.instrumentName||T.track,n.partXmlIndex=T.xmlIndex,n.isComberRender)n.musicPdfUrl=b.musicPdfUrl;else{const D=d(((x=n.details)==null?void 0:x.background)||[],(P=i.value[n.selectedPartIndex])==null?void 0:P.track);console.log(D,"item",(F=n.details)==null?void 0:F.background,(z=i.value[n.selectedPartIndex])==null?void 0:z.track),D?n.musicPdfUrl=D.musicPdfUrl:n.musicPdfUrl=""}},f=async()=>{var b;r.value=!0;try{if(!s.query.id)return;const{data:E}=await Pn.get(Mn.platformApi+"/musicSheet/detail/"+s.query.id);n.details=E||{},a.value=((b=n.details.musicImg)==null?void 0:b.split(","))||[],n.isComberRender=E.musicSubject==="1",ri(async()=>{E.audioFileUrl?y():(await p(n.details),m())})}catch(E){console.log(E)}},y=async()=>{const b=["play","progress","captions","current-time","duration"];t.value=new dt(e.value,{controls:b}),t.value.on("ready",()=>{n.audioReady=!0,t.value.muted=!1,ri(async()=>{await p(n.details),m()})})},v=async b=>{let E=`${location.origin}/orchestra-music-score/?id=${b.id}&part-index=${n.selectedPartIndex}`;if(n.details.musicSheetType==="SINGLE"){let T="staff";n.radio==="first"?T="firstTone":n.radio==="fixed"?T="fixedTone":n.radio==="staff"&&(T="staff"),E+="&musicRenderType="+T}console.log("\u{1F680} ~ src:",E),Bn({api:"openAccompanyWebView",content:{url:E,orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0}})},A=()=>{var b;(b=t.value)==null||b.pause(),v(n.details)},w=async b=>{var E;if(((E=b.data)==null?void 0:E.api)==="musicStaffRender"){try{const T=b.data.osmdImg,x=[];for(let P=0;P<T.length;P++){const F=await il(T[P].img,T[P].width,T[P].height);x.push(F)}a.value=x}catch{}r.value=b.data.loading}};return En(async()=>{await f(),window.addEventListener("message",w)}),Sn(()=>{window.removeEventListener("message",w)}),()=>N("div",{class:ne.musicDetail},[N(Ji,{mode:"sticky",position:"top"},{default:()=>[N(kn,{border:!1,background:"transparent"},null)]}),N("div",{class:ne.musicContainer},[N("div",{class:ne.musicInfos},[N("div",{class:ne.musicImg},[N(ot,{src:On},null)]),n.details.id&&!n.musicPdfUrl&&N("div",{class:ne.info},[N("p",{class:ne.names},[n.details.musicSheetName,n.details.musicSheetType==="CONCERT"&&n.selectedPartName?`(${n.selectedPartName})`:""]),N("p",{class:ne.author},[n.details.composer])])]),N("div",{class:[ne.showImgContainer,n.musicPdfUrl&&ne.pdfContainer]},[r.value&&N(Nn,null,[N(Un,{title:!0,row:7},null)]),n.details.id?n.musicPdfUrl?N("iframe",{style:{opacity:r.value?0:1,width:"100%",height:"100%"},id:"staffIframeRef",onLoad:()=>{r.value=!1}},null):N("iframe",{id:"staffIframeRef",style:{opacity:r.value?0:1,width:"100%",height:"100%"},onLoad:()=>{l()}},null):""])]),n.details.id&&N(Ji,{position:"bottom",varName:"--footer-height"},{default:()=>{var b,E,T;return[N("div",{class:ne.bottomStyle,style:{background:"#fff"}},[((b=n.details)==null?void 0:b.audioFileUrl)&&N("div",{class:[ne.audio,ne.collectCell],style:{opacity:n.audioReady?1:0}},[N("audio",{id:"player",controls:!0,ref:e,style:{height:"40px"}},[N("source",{src:(E=n.details)==null?void 0:E.audioFileUrl,type:"audio/mp3"},null)])]),N("div",{class:ne.footers},[N("div",{class:ne.iconGroup},[N("div",{class:ne.icon,onClick:()=>{var x;if(!r.value)if(n.musicPdfUrl){const P=((x=n.details)==null?void 0:x.musicSheetName)+(n.details.musicSheetType==="CONCERT"&&n.selectedPartName?`(${n.selectedPartName})`:"");Ms({api:"downloadFile",content:{downloadUrl:n.musicPdfUrl,fileName:P}})}else o.value=!0}},[N("img",{src:Fn},null),N("span",null,[ve("\u4E0B\u8F7D")])]),((T=n.details)==null?void 0:T.musicSheetType)==="CONCERT"?N("div",{class:ne.icon,onClick:()=>{r.value||(n.open=!0)}},[N("img",{src:In},null),N("span",null,[ve("\u58F0\u8F68")])]):N("div",null,null)]),N(Ps,{round:!0,block:!0,type:"primary",disabled:r.value,color:"#FF8057",onClick:A},{default:()=>[ve("\u5F00\u59CB\u7EC3\u4E60")]})])])]}}),N(ni,{show:n.status,"onUpdate:show":b=>n.status=b,teleport:"body",closeable:!0,style:{width:"80%"},class:ne.staffChange,round:!0},{default:()=>[N(va,{radio:n.radio,onClose:()=>n.status=!1,onChange:b=>{n.radio=b,n.status=!1,b=="first"?(r.value=!0,c("first",n.details.xmlFileUrl)):b=="fixed"?(r.value=!0,c("fixed",n.details.xmlFileUrl)):(r.value=!0,c("staff",n.details.xmlFileUrl))}},null)]}),N(ni,{show:o.value,"onUpdate:show":b=>o.value=b,position:"bottom",round:!0},{default:()=>[o.value&&N(Ma,{imgList:JSON.parse(JSON.stringify(a.value)),musicSheetName:n.details.musicSheetName+(n.details.musicSheetType==="CONCERT"&&n.selectedPartName?`(${n.selectedPartName})`:"")},null)]}),N(ni,{teleport:"body",position:"bottom",round:!0,show:n.open,"onUpdate:show":b=>n.open=b},{default:()=>[N(Hn,{columns:i.value,onConfirm:b=>{n.open=!1,n.selectedPartIndex=b.selectedValues[0],n.selectedPartName=b.selectedOptions[0].instrumentName||b.selectedOptions[0].track,n.partXmlIndex=b.selectedOptions[0].xmlIndex,ri(()=>{const E=d(n.details.background||[],b.selectedOptions[0].track);console.log(E,"nextTick",n.details);let T="";n!=null&&n.isComberRender?n!=null&&n.musicPdfUrl&&(T=n==null?void 0:n.musicPdfUrl):T=E==null?void 0:E.musicPdfUrl,T?(n.musicPdfUrl=T,m()):(n.musicPdfUrl="",r.value=!0,n.iframeSrc.indexOf("pdf/web")!==-1?m():u())})},onCancel:()=>n.open=!1},null)]})])}});export{El as default};