|
|
var at=Object.assign,bR=(Pr,dr,He)=>new Promise((ze,re)=>{var z=M=>{try{K(He.next(M))}catch(se){re(se)}},ae=M=>{try{K(He.throw(M))}catch(se){re(se)}},K=M=>M.done?ze(M.value):Promise.resolve(M.value).then(z,ae);K((He=He.apply(Pr,dr)).next())});(window.webpackJsonp=window.webpackJsonp||[]).push([[285,7,9],{"32qa":function(Pr,dr,He){Pr.exports={flex_box_center:"flex_box_center___25LpO",flex_space_between:"flex_space_between___3RRAb",flex_box_vertical_center:"flex_box_vertical_center___26dC0",flex_box_center_end:"flex_box_center_end___TCbFZ",flex_box_column:"flex_box_column___2Xzqk",Bg:"Bg___aeQYh",main_warp:"main_warp___3n2cI",title_warp:"title_warp___3am7i",row_info:"row_info___BlsCt",evaluate:"evaluate___3JmQM",operate:"operate___11-Al",btn_update:"btn_update___6Mz1g",btn_del:"btn_del___25JOB"}},"7ixt":function(Pr,dr,He){"use strict";He.d(dr,"a",function(){return z});var ze={adjustX:1,adjustY:1},re=[0,0],z={left:{points:["cr","cl"],overflow:ze,offset:[-4,0],targetOffset:re},right:{points:["cl","cr"],overflow:ze,offset:[4,0],targetOffset:re},top:{points:["bc","tc"],overflow:ze,offset:[0,-4],targetOffset:re},bottom:{points:["tc","bc"],overflow:ze,offset:[0,4],targetOffset:re},topLeft:{points:["bl","tl"],overflow:ze,offset:[0,-4],targetOffset:re},leftTop:{points:["tr","tl"],overflow:ze,offset:[-4,0],targetOffset:re},topRight:{points:["br","tr"],overflow:ze,offset:[0,-4],targetOffset:re},rightTop:{points:["tl","tr"],overflow:ze,offset:[4,0],targetOffset:re},bottomRight:{points:["tr","br"],overflow:ze,offset:[0,4],targetOffset:re},rightBottom:{points:["bl","br"],overflow:ze,offset:[4,0],targetOffset:re},bottomLeft:{points:["tl","bl"],overflow:ze,offset:[0,4],targetOffset:re},leftBottom:{points:["br","bl"],overflow:ze,offset:[-4,0],targetOffset:re}},ae=z},"8hTe":function(Pr,dr,He){Pr.exports={button:"button___1wy9m"}},"9Bee":function(Pr,dr,He){"use strict";var ze=He("DYRE"),re=He("zeV3"),z=He("+L6B"),ae=He("2/Rp"),K=He("k1fw"),M=He("9og8"),se=He("tJVT"),q=He("WmNS"),X=He.n(q),V=He("q1tI"),L=He.n(V),H=He("vg9a"),F=He("DlQD"),I=He.n(F),j=He("rUJ1");function P(ge,ie){var ne=ge.match(/^(\s+)(?:```)/);if(ne===null)return ie;var ce=ne[1];return ie.split(`
|
|
|
`).map(function(me){var le=me.match(/^\s+/);if(le===null)return me;var ue=Object(se.a)(le,1),ye=ue[0];return ye.length>=ce.length?me.slice(ce.length):me}).join(`
|
|
|
`)}var w=[],d=["<ul>"],p=new I.a.Renderer,f=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function T(){w.length=0,d=["<ul>"]}var x={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function E(ge,ie,ne,ce){if(ie>=ge.length||ge[ie].level<=ne)return ie;var me=ge[ie];ce.push("<li><a href='#"+me.anchor+"'>"+me.text+"</a>"),ie++;var le=[];return ie=E(ge,ie,me.level,le),le.length>0&&(ce.push("<ul>"),le.forEach(function(ue){ce.push(ue)}),ce.push("</ul>")),ce.push("</li>"),ie=E(ge,ie,ne,ce),ie}function k(){return E(w,0,0,d),d.push("</ul>"),d.join("")}var C={heading:function(ie){var ne=f.exec(ie);if(ne)return{type:"heading",raw:ne[0],depth:ne[1].length,text:ne[2]}},fences:function(ie){var ne=this.rules.block.fences.exec(ie);if(ne){var ce=ne[0],me=P(ce,ne[3]||""),le=ne[2]?ne[2].trim():ne[2];if(["latex","katex","math"].indexOf(le)>=0){var ue=v(),ye=me;me=ue,g[ue]={type:"block",expression:ye}}return{type:"code",raw:ce,lang:le,text:me}}}},b=/(?:\${2})([^\n`]+?)(?:\${2})/gi,m=0,v=function(){return"__special_katext_id_".concat(m++,"__")},g={};function _(){return g}function O(){m=0,g={}}function G(ge){return ge=ge.replace(b,function(ie,ne){var ce=v();return g[ce]={type:"inline",expression:ne},ce}),ge}var Y=p.listitem;p.listitem=function(ge){return Y(G(ge))};var ee=p.paragraph;p.paragraph=function(ge){return ee(G(ge))};var fe=p.tablecell;p.tablecell=function(ge,ie){return fe(G(ge),ie)},p.code=function(ge,ie,ne){var ce=(ie||"").match(/\S*/)[0];return ce?["latex","katex","math"].indexOf(ce)>=0?"<p class='editormd-tex'>".concat(ge,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(ie,'">').concat(ne?ge:Object(j.escape)(ge,!0),`</code></pre>
|
|
|
`):'<pre class="prettyprint linenums"><code>'+(ne?ge:Object(j.escape)(ge,!0))+"</code></pre>"},p.heading=function(ge,ie,ne){var ce=this.options.headerPrefix+ne.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return w.push({anchor:ce,level:ie,text:ge}),"<h"+ie+' id="'+ce+'">'+ge+"</h"+ie+">"},I.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),I.a.use({tokenizer:C,renderer:p});var pe=I.a,xe=He("SJMd"),Ce=He("ulZh"),be=He.n(Ce),Oe=He("m3rI"),We=He("Oy/b"),Me=He("p5ED"),ct=He("ErOA"),Ge=He("STEk");/* **********************************
|
|
|
cropro version 1.2.0
|
|
|
@license SEE LICENSE IN LICENSE
|
|
|
|
|
|
copyright Alan Mendelevich
|
|
|
see README and LICENSE for details
|
|
|
********************************** *//*! *****************************************************************************
|
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
purpose with or without fee is hereby granted.
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
|
***************************************************************************** */var Je=function(ge,ie){return(Je=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ne,ce){ne.__proto__=ce}||function(ne,ce){for(var me in ce)Object.prototype.hasOwnProperty.call(ce,me)&&(ne[me]=ce[me])})(ge,ie)};function Xe(ge,ie){if(typeof ie!="function"&&ie!==null)throw new TypeError("Class extends value "+String(ie)+" is not a constructor or null");function ne(){this.constructor=ge}Je(ge,ie),ge.prototype=ie===null?Object.create(ie):(ne.prototype=ie.prototype,new ne)}function Ye(ge,ie,ne,ce){return new(ne||(ne=Promise))(function(me,le){function ue(Ne){try{we(ce.next(Ne))}catch(Ie){le(Ie)}}function ye(Ne){try{we(ce.throw(Ne))}catch(Ie){le(Ie)}}function we(Ne){var Ie;Ne.done?me(Ne.value):(Ie=Ne.value,Ie instanceof ne?Ie:new ne(function(lt){lt(Ie)})).then(ue,ye)}we((ce=ce.apply(ge,ie||[])).next())})}function ke(ge,ie){var ne,ce,me,le,ue={label:0,sent:function(){if(1&me[0])throw me[1];return me[1]},trys:[],ops:[]};return le={next:ye(0),throw:ye(1),return:ye(2)},typeof Symbol=="function"&&(le[Symbol.iterator]=function(){return this}),le;function ye(we){return function(Ne){return function(Ie){if(ne)throw new TypeError("Generator is already executing.");for(;ue;)try{if(ne=1,ce&&(me=2&Ie[0]?ce.return:Ie[0]?ce.throw||((me=ce.return)&&me.call(ce),0):ce.next)&&!(me=me.call(ce,Ie[1])).done)return me;switch(ce=0,me&&(Ie=[2&Ie[0],me.value]),Ie[0]){case 0:case 1:me=Ie;break;case 4:return ue.label++,{value:Ie[1],done:!1};case 5:ue.label++,ce=Ie[1],Ie=[0];continue;case 7:Ie=ue.ops.pop(),ue.trys.pop();continue;default:if(!(me=ue.trys,(me=me.length>0&&me[me.length-1])||Ie[0]!==6&&Ie[0]!==2)){ue=0;continue}if(Ie[0]===3&&(!me||Ie[1]>me[0]&&Ie[1]<me[3])){ue.label=Ie[1];break}if(Ie[0]===6&&ue.label<me[1]){ue.label=me[1],me=Ie;break}if(me&&ue.label<me[2]){ue.label=me[2],ue.ops.push(Ie);break}me[2]&&ue.ops.pop(),ue.trys.pop();continue}Ie=ie.call(ge,ue)}catch(lt){Ie=[6,lt],ce=0}finally{ne=me=0}if(5&Ie[0])throw Ie[1];return{value:Ie[0]?Ie[1]:void 0,done:!0}}([we,Ne])}}}var Z=function(){function ge(){}return ge.addKey=function(ie){ge.key=ie},Object.defineProperty(ge,"isLicensed",{get:function(){return!!ge.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ge.key)},enumerable:!1,configurable:!0}),ge}(),A=function(){function ge(){}return ge.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ge.setAttributes=function(ie,ne){for(var ce=0,me=ne;ce<me.length;ce++){var le=me[ce],ue=le[0],ye=le[1];ie.setAttribute(ue,ye)}},ge.createRect=function(ie,ne,ce){var me=document.createElementNS("http://www.w3.org/2000/svg","rect");return me.setAttribute("width",ie.toString()),me.setAttribute("height",ne.toString()),ce&&ge.setAttributes(me,ce),me},ge.createLine=function(ie,ne,ce,me,le){var ue=document.createElementNS("http://www.w3.org/2000/svg","line");return ue.setAttribute("x1",ie.toString()),ue.setAttribute("y1",ne.toString()),ue.setAttribute("x2",ce.toString()),ue.setAttribute("y2",me.toString()),le&&ge.setAttributes(ue,le),ue},ge.createPolygon=function(ie,ne){var ce=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ce.setAttribute("points",ie),ne&&ge.setAttributes(ce,ne),ce},ge.createCircle=function(ie,ne){var ce=document.createElementNS("http://www.w3.org/2000/svg","circle");return ce.setAttribute("cx",(ie/2).toString()),ce.setAttribute("cy",(ie/2).toString()),ce.setAttribute("r",ie.toString()),ne&&ge.setAttributes(ce,ne),ce},ge.createEllipse=function(ie,ne,ce){var me=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return me.setAttribute("cx",(ie/2).toString()),me.setAttribute("cy",(ne/2).toString()),me.setAttribute("rx",(ie/2).toString()),me.setAttribute("ry",(ne/2).toString()),ce&&ge.setAttributes(me,ce),me},ge.createGroup=function(ie){var ne=document.createElementNS("http://www.w3.org/2000/svg","g");return ie&&ge.setAttributes(ne,ie),ne},ge.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ge.createMarker=function(ie,ne,ce,me,le,ue,ye){var we=document.createElementNS("http://www.w3.org/2000/svg","marker");return ge.setAttributes(we,[["id",ie],["orient",ne],["markerWidth",ce.toString()],["markerHeight",me.toString()],["refX",le.toString()],["refY",ue.toString()]]),we.appendChild(ye),we},ge.createText=function(ie){var ne=document.createElementNS("http://www.w3.org/2000/svg","text");return ne.setAttribute("x","0"),ne.setAttribute("y","0"),ie&&ge.setAttributes(ne,ie),ne},ge.createTSpan=function(ie,ne){var ce=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ce.textContent=ie,ne&&ge.setAttributes(ce,ne),ce},ge.createImage=function(ie){var ne=document.createElementNS("http://www.w3.org/2000/svg","image");return ie&&ge.setAttributes(ne,ie),ne},ge.createPoint=function(ie,ne){var ce=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ce.x=ie,ce.y=ne,ce},ge.createPath=function(ie,ne){var ce=document.createElementNS("http://www.w3.org/2000/svg","path");return ce.setAttribute("d",ie),ne&&ge.setAttributes(ce,ne),ce},ge.createElement=function(ie,ne){var ce=document.createElementNS("http://www.w3.org/2000/svg",ie);return ne&&ge.setAttributes(ce,ne),ce},ge.getHollowRectanglePath=function(ie,ne,ce,me,le,ue,ye,we){return"M"+ie+","+ne+"V"+(ne+me)+"H"+(ie+ce)+"V"+ne+"H"+le+"V"+ue+"H"+(le+ye)+"V"+(ue+we)+"H"+le+"V"+ne+"Z"},ge}(),R=function(){function ge(ie){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+ie+"_"}return Object.defineProperty(ge.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),ge.prototype.addClass=function(ie){return this.styleSheet===void 0&&this.addStyleSheet(),ie.name=""+this.classNamePrefix+ie.localName,this.classes.push(ie),this.styleSheet.sheet.insertRule("."+ie.name+" {"+ie.style+"}",this.styleSheet.sheet.cssRules.length),ie},ge.prototype.addRule=function(ie){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(ie),this.styleSheet.sheet.insertRule(ie.selector+" {"+ie.style+"}",this.styleSheet.sheet.cssRules.length)},ge.prototype.addStyleSheet=function(){var ie;this.styleSheet=document.createElement("style"),((ie=this.styleSheetRoot)!==null&&ie!==void 0?ie:document.head).appendChild(this.styleSheet),this.addRule(new J("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new J("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`)),this.addRule(new J("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
|
from {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)),this.addClass(new oe("_fade_in",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
|
`)),this.addClass(new oe("_fade_out",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
|
`))},ge.prototype.removeStyleSheet=function(){var ie;this.styleSheet&&(((ie=this.styleSheetRoot)!==null&&ie!==void 0?ie:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ge}(),J=function(ge,ie){this.selector=ge,this.style=ie},oe=function(ge,ie){this.localName=ge,this.style=ie},$=function(){function ge(){this.blocks=[],this.display=""}return ge.prototype.addButtonBlock=function(ie){ie.className=this.blockClassName,ie.buttonClassName=this.buttonClassName,ie.buttonColorsClassName=this.buttonColorsClassName,ie.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(ie)},ge.prototype.addElementBlock=function(ie){ie.className===void 0&&(ie.className=this.blockClassName),this.blocks.push(ie)},ge.prototype.getUI=function(){var ie=document.createElement("div");return ie.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,ie.style.display=this.display,this.blocks.forEach(function(ne){return ie.appendChild(ne.getUI())}),ie},ge}(),Se=function(){function ge(){}return ge.prototype.getUI=function(){var ie=document.createElement("div");if(ie.className=this.className,this.minWidth!==void 0&&(ie.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":ie.style.justifyContent="flex-start";break;case"center":ie.style.justifyContent="center";break;case"end":ie.style.justifyContent="flex-end"}return ie.style.whiteSpace="nowrap",ie},ge}(),je=function(ge){function ie(){var ne=ge!==null&&ge.apply(this,arguments)||this;return ne.buttons=[],ne}return Xe(ie,ge),ie.prototype.addButton=function(ne){ne.className=this.buttonClassName,ne.colorsClassName=this.buttonColorsClassName,ne.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(ne)},ie.prototype.getUI=function(){var ne=ge.prototype.getUI.call(this);return this.buttons.forEach(function(ce){return ne.appendChild(ce.getUI())}),ne},ie}(Se),$e=function(){function ge(ie,ne){this._isActive=!1,this._isHidden=!1,this._icon=ie,this.title=ne,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(ge.prototype,"icon",{get:function(){return this._icon},set:function(ie){this._icon=ie,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"isActive",{get:function(){return this._isActive},set:function(ie){this._isActive=ie,this.adjustClassName()},enumerable:!1,configurable:!0}),ge.prototype.getUI=function(){var ie=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return ie.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},ge.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},ge.prototype.hide=function(){this._isHidden=!0},ge}(),st=function(ge){function ie(){var ne=ge!==null&&ge.apply(this,arguments)||this;return ne.elements=[],ne}return Xe(ie,ge),ie.prototype.addElement=function(ne){this.elements.push(ne)},ie.prototype.getUI=function(){var ne=ge.prototype.getUI.call(this);return this.elements.forEach(function(ce){return ne.appendChild(ce)}),ne},ie}(Se),Ke=function(){function ge(ie,ne){this.horizontal=ie,this.vertical=ne}return Object.defineProperty(ge.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),ge.prototype.getVerticalLength=function(ie){return ie/this.ratio},ge.prototype.getHorizontalLength=function(ie){return ie*this.ratio},ge}(),it=function(){function ge(){}return ge.getIcon=function(ie,ne){if(ie>0&&ne>0){var ce=new Ke(ie,ne),me=ce.ratio>=1?20:ce.getHorizontalLength(20),le=ce.ratio<1?20:ce.getVerticalLength(20),ue=document.createElementNS("http://www.w3.org/2000/svg","svg");ue.setAttribute("xmlns","http://www.w3.org/2000/svg"),ue.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ue);var ye=A.createDefs();ue.appendChild(ye);var we=A.createElement("clipPath",[["id","text-bg-clip"]]);ye.appendChild(we);var Ne=A.createPath(A.getHollowRectanglePath((24-me)/2,(24-le)/2,me,le,(24-me)/2+2,(24-le)/2+2,me-4,le-4));ue.appendChild(Ne);var Ie=A.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ie.appendChild(A.createTSpan(ie+":"+ne)),ue.appendChild(Ie);var lt=Ie.getBBox();A.setAttributes(Ie,[["x",((24-lt.width)/2).toString()],["y",((24-lt.height)/2-lt.y).toString()]]);var Pt=A.createPath(A.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(lt.width))/2,(24-Math.ceil(lt.height))/2,Math.ceil(lt.width),Math.ceil(lt.height)));return we.appendChild(Pt),A.setAttributes(Ne,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ue),ue.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},ge}(),nt=function(ge){function ie(ne,ce,me){var le=ge.call(this,ne,ce)||this;return le.isDropdownOpen=!1,le.onClick=le.dropdownButtonClicked,le.dropdownButtons=me,le}return Xe(ie,ge),ie.prototype.setupDropdown=function(){var ne=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(ce){ce.className=ne.className,ce.colorsClassName=ne.colorsClassName,ne.dropdownBlock.appendChild(ce.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},ie.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},ie.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},ie.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},ie.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},ie.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},ie}($e),bt=function(){function ge(ie,ne){this.GRIP_SIZE=10,this.color=ie,this.fillColor=ne,this.visual=A.createGroup(),this.visual.appendChild(A.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(A.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ge.prototype.ownsTarget=function(ie){return ie===this.visual||ie===this.visual.childNodes[0]||ie===this.visual.childNodes[1]},ge.prototype.setCenter=function(ie,ne){this.visual.childNodes.forEach(function(ce){return A.setAttributes(ce,[["cx",ie.toString()],["cy",ne.toString()]])})},ge}(),_t=function(){function ge(ie,ne,ce,me){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=ie,this.canvasHeight=ne,this.margin=ce,this.container=me,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(ge.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(ie){this._aspectRatio=ie,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(ie){this._isGridVisible=ie,this.gridContainer&&A.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(ie){this._zoomFactor=ie,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),ge.prototype.open=function(){var ie=this;this.cropShadeElement=A.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=A.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var ne=0;ne<this.numberOfGridLines;ne++)this.horizontalGridLines.push(A.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(A.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(ce){return ie.gridContainer.appendChild(ce)}),this.verticalGridLines.forEach(function(ce){return ie.gridContainer.appendChild(ce)}),this.cropRectElement=A.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new bt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new bt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new bt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new bt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},ge.prototype.setCropRectangle=function(ie){this.cropRect=ie;var ne=Object.assign({},this.cropRect);this.zoomFactor!==1&&(ne.width=this.cropRect.width*this.zoomFactor,ne.height=this.cropRect.height*this.zoomFactor,ne.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-ne.width/2,ne.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-ne.height/2),A.setAttributes(this.cropRectElement,[["x",ne.x.toString()],["y",ne.y.toString()],["width",ne.width.toString()],["height",ne.height.toString()]]);var ce=ne.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(le,ue){var ye=ne.y+ce*(ue+1);A.setAttributes(le,[["x1",""+ne.x],["y1",""+ye],["x2",""+(ne.x+ne.width)],["y2",""+ye]])});var me=ne.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(le,ue){var ye=ne.x+me*(ue+1);A.setAttributes(le,[["x1",""+ye],["y1",""+ne.y],["x2",""+ye],["y2",""+(ne.y+ne.height)]])}),A.setAttributes(this.cropShadeElement,[["d",A.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,ne.x,ne.y,ne.width,ne.height)]]),this.topLeftGrip.setCenter(ne.x,ne.y),this.topRightGrip.setCenter(ne.x+ne.width,ne.y),this.bottomLeftGrip.setCenter(ne.x,ne.y+ne.height),this.bottomRightGrip.setCenter(ne.x+ne.width,ne.y+ne.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},ge.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},ge.prototype.clientToLocalCoordinates=function(ie,ne){var ce=this.container.getBoundingClientRect();return{x:ie-ce.left+this.margin,y:ne-ce.top+this.margin}},ge.prototype.onPointerDown=function(ie){this.container.setPointerCapture(ie.pointerId),this.previousPoint=this.clientToLocalCoordinates(ie.clientX,ie.clientY),this.cropRectElement===ie.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(ie.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(ie.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(ie.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(ie.target)&&(this.activeGrip=this.bottomRightGrip)},ge.prototype.onPointerMove=function(ie){if(this.isMoving)this.move(this.clientToLocalCoordinates(ie.clientX,ie.clientY));else if(this.activeGrip){var ne=this.clientToLocalCoordinates(ie.clientX,ie.clientY);this.resize(ne)}ie.preventDefault()},ge.prototype.onPointerUp=function(ie){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(ie.pointerId)},ge.prototype.move=function(ie){var ne=ie.x-this.previousPoint.x,ce=ie.y-this.previousPoint.y;this.zoomFactor!==1&&(ne=-ne/this.zoomFactor,ce=-ce/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+ne),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+ce),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=ie},ge.prototype.resize=function(ie){var ne=Object.assign({},this.cropRect),ce=ie.x-this.previousPoint.x,me=ie.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:ne.x+ce<this.margin&&(ce=this.margin-ne.x),ne.x+=ce,ne.width=this.cropRect.x+this.cropRect.width-ne.x;break;case this.bottomRightGrip:case this.topRightGrip:ne.width+ce>this.canvasWidth*this.zoomFactor&&(ce=this.canvasWidth*this.zoomFactor-ne.width),ne.width+=ce}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(ne.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ce),ne.height=this.aspectRatio.getVerticalLength(ne.width)):(ne.y+=me,ne.height=this.cropRect.y+this.cropRect.height-ne.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?ne.height=this.aspectRatio.getVerticalLength(ne.width):ne.height+=me}ne.width<10&&(ne.x=this.cropRect.x,ne.width=10),ne.height<10&&(ne.y=this.cropRect.y,ne.height=10),this.previousPoint=ie,ne.x>=this.margin&&ne.y>=this.margin&&ne.x-this.margin+ne.width<=this.canvasWidth&&ne.y-this.margin+ne.height<=this.canvasHeight&&(this.cropRect=ne,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},ge.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var ie=this.cropRect.x+this.cropRect.width/2,ne=this.cropRect.y+this.cropRect.height/2,ce=this.aspectRatio.getHorizontalLength(this.cropRect.height),me=this.aspectRatio.getVerticalLength(this.cropRect.width);ce/this.canvasWidth<me/this.canvasHeight?this.cropRect.width=ce:this.cropRect.height=me,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=ie-this.cropRect.width/2,this.cropRect.y=ne-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},ge.prototype.getRescaledRect=function(ie,ne,ce,me,le,ue){var ye=ce/ie,we=me/ne;return{x:(le.x-ue)*ye+ue,y:(le.y-ue)*we+ue,width:le.width*ye,height:le.height*we}},ge.prototype.scaleCanvas=function(ie,ne){var ce=this.getRescaledRect(this.canvasWidth,this.canvasHeight,ie,ne,this.cropRect,this.margin);this.canvasWidth=ie,this.canvasHeight=ne,this.onCropChange&&this.onCropChange(ce),this.setCropRectangle(ce)},ge}(),Lt=function(){function ge(ie){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=ie,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(ge.prototype,"angle",{get:function(){return this._angle},set:function(ie){this._angle=ie,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),ge.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},ge.prototype.onPointerDown=function(ie){this.controlContainer.setPointerCapture(ie.pointerId),this.isDragging=!0,this.previousPoint={x:ie.clientX,y:ie.clientY}},ge.prototype.onPointerMove=function(ie){this.isDragging&&(this.onAngleChange&&this.onAngleChange((ie.clientX-this.previousPoint.x)/5),this.previousPoint.x=ie.clientX)},ge.prototype.onPointerUp=function(ie){this.isDragging&&this.onAngleChange&&this.onAngleChange((ie.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(ie.pointerId)},ge.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var ie=this.angleLabelText.getBBox();A.setAttributes(this.angleLabelElement,[["x",((this.width-ie.width)/2).toString()],["y",(this.height/2).toString()]])}},ge.prototype.positionScaleShape=function(){if(this.scaleShape){var ie=this.scaleShape.transform.baseVal.getItem(0);ie.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(ie,0)}},ge.prototype.getVisual=function(){var ie=document.createElementNS("http://www.w3.org/2000/svg","svg");ie.setAttribute("xmlns","http://www.w3.org/2000/svg"),ie.setAttribute("width",this.width+"px"),ie.setAttribute("height",this.height+"px"),ie.setAttribute("viewBox","0 0 "+this.width+" "+this.height),ie.style.flexShrink="0",document.body.appendChild(ie);for(var ne="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ce=1;ce<=this.width/5+10;ce++){var me=ce%5==0?this.height/3:this.height/6;ne+="h4v"+-me+"h1v"+me}ne+="v1H0Z",this.scaleShape=A.createPath(ne);var le=A.createTransform();this.scaleShape.transform.baseVal.appendItem(le),ie.appendChild(this.scaleShape),this.angleLabelElement=A.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=A.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ue=A.createTSpan("");return ue.innerHTML="°",this.angleLabelElement.appendChild(ue),ie.appendChild(this.angleLabelElement),document.body.removeChild(ie),ie},ge}(),Ot=function(){function ge(){this.naturalSize=!1,this.imageType="image/png"}return ge.prototype.rasterize=function(ie,ne,ce,me,le,ue,ye){var we=this;return new Promise(function(Ne){var Ie=document.createElement("canvas");Ie.width=ie.width.baseVal.value-2*me,Ie.height=ie.height.baseVal.value-2*me;var lt=1,Pt=1;we.naturalSize===!0?(lt=ne.naturalWidth/(ie.width.baseVal.value-2*me)/ue,Pt=ne.naturalHeight/(ie.height.baseVal.value-2*me)/ye,Ie.width=ne.naturalWidth/ue,Ie.height=ne.naturalHeight/ye):we.width!==void 0&&we.height!==void 0&&(lt=we.width/ce.width,Pt=we.height/ce.height,Ie.width*=lt,Ie.height*=Pt);var Zt=Ie.getContext("2d");Zt.translate(Ie.width/2,Ie.height/2),Zt.rotate(le*Math.PI/180),Zt.scale(ue,ye),Zt.translate(-Ie.width/2,-Ie.height/2),Zt.drawImage(ne,0,0,Ie.width,Ie.height);var $t=document.createElement("canvas");$t.width=ce.width*lt,$t.height=ce.height*Pt,$t.getContext("2d").putImageData(Zt.getImageData((ce.x-me)*lt,(ce.y-me)*Pt,ce.width*lt,ce.height*Pt),0,0),Ne($t.toDataURL(we.imageType,we.imageQuality))})},ge}(),xt=function(){function ge(ie){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=ge.instanceCounter++,this.styles=new R(this.instanceNo),this.target=ie,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(ge.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(ie){this._zoomToCropEnabled=ie,ie?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(ie){this._isGridVisible=ie,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"gridLines",{get:function(){return this._gridLines},set:function(ie){this._gridLines=ie,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(ie){this._rotationAngle=ie,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"aspectRatio",{get:function(){var ie;return(ie=this._aspectRatio)!==null&&ie!==void 0?ie:this.aspectRatios[0]},set:function(ie){this._aspectRatio=ie},enumerable:!1,configurable:!0}),ge.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},ge.prototype.show=function(){this.showUI(),this.open()},ge.prototype.close=function(ie){ie===void 0&&(ie=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),ie||this.closeEventListeners.forEach(function(ne){return ne()}),this._isOpen=!1)},ge.prototype.addRenderEventListener=function(ie){this.renderEventListeners.push(ie)},ge.prototype.removeRenderEventListener=function(ie){this.renderEventListeners.indexOf(ie)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(ie),1)},ge.prototype.addCloseEventListener=function(ie){this.closeEventListeners.push(ie)},ge.prototype.removeCloseEventListener=function(ie){this.closeEventListeners.indexOf(ie)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(ie),1)},ge.prototype.setupResizeObserver=function(){var ie=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){ie.resize(ie.target.clientWidth,ie.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},ge.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var ie=1*this.target.clientWidth/this.target.clientHeight,ne=this.contentDiv.clientWidth/ie>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*ie:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ce=ne+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/ie;this.resize(ne,ce)}},ge.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ge.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",A.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},ge.prototype.resize=function(ie,ne){this.imageWidth=Math.round(ie),this.imageHeight=Math.round(ne),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},ge.prototype.setEditingTarget=function(){var ie=document.createElement("canvas");ie.width=this.target.naturalWidth,ie.height=this.target.naturalHeight,ie.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var ne=ie.toDataURL();A.setAttributes(this.editingTarget,[["href",ne]]),this.setEditingTargetSize()},ge.prototype.setTopLeft=function(){var ie=this.target.getBoundingClientRect(),ne=this.editorCanvas.getBoundingClientRect();this.left=ie.left-ne.left-this.CANVAS_MARGIN,this.top=ie.top-ne.top-this.CANVAS_MARGIN},ge.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=A.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=A.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=A.createGroup(),this.editingTargetRotationScaleContainer=A.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var ie=A.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(ie);var ne=A.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(ne),this.editingTargetContainer=A.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},ge.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},ge.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=A.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new _t(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},ge.prototype.zoomToCrop=function(){if(this.cropRect){var ie=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,ne=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=ie+"px "+ne+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-ie+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-ne+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},ge.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},ge.prototype.cropRectChanged=function(ie){this.cropRect=ie,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},ge.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},ge.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},ge.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ge.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var ie=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,ne=this.target.offsetTop>ie+this.CANVAS_MARGIN?this.target.offsetTop-(ie+this.CANVAS_MARGIN):0;this.coverDiv.style.top=ne+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},ge.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},ge.prototype.addTopToolbar=function(){var ie=this;this.topToolbar=new $,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var ne=new je;ne.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(ne);var ce=[];this.aspectRatios.forEach(function(Pt){var Zt=new $e(it.getIcon(Pt.horizontal,Pt.vertical),Pt.horizontal===0&&Pt.vertical===0?"FREE":Pt.horizontal+":"+Pt.vertical);Zt.onClick=function(){return ie.ratioButtonClicked(Pt)},ce.push(Zt)}),this.aspectRatioButton=new nt(it.getIcon(0,0),"Aspect ratio",ce),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,ne.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var me=new $e('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");me.isActive=this.isGridVisible,me.onClick=function(){ie.isGridVisible=!ie.isGridVisible,me.isActive=ie.isGridVisible},ne.addButton(me);var le=new $e('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(le.isActive=this.zoomToCropEnabled,le.onClick=function(){ie.zoomToCropEnabled=!ie.zoomToCropEnabled,le.isActive=ie.zoomToCropEnabled},ne.addButton(le),!Z.isLicensed){var ue=new st;this.topToolbar.addElementBlock(ue);var ye=document.createElement("div");ye.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var we=document.createElement("a");we.style.color="currentColor",we.href="https://markerjs.com/products/cropro",we.target="_blank",we.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',ye.appendChild(we),ue.addElement(ye)}var Ne=new je;Ne.minWidth=3*this.toolbarHeight+"px",Ne.contentAlign="end",this.topToolbar.addButtonBlock(Ne);var Ie=new $e('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");Ie.onClick=this.startRenderAndClose,Ne.addButton(Ie),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ie.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var lt=new $e('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");lt.onClick=this.close,Ne.addButton(lt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(lt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},ge.prototype.addBottomToolbar=function(){var ie=this;this.bottomToolbar=new $,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var ne=new je;ne.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(ne);var ce=new $e('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");ce.onClick=this.rotateLeftButtonClicked,ne.addButton(ce);var me=new $e('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");me.onClick=this.rotateRightButtonClicked,ne.addButton(me);var le=new st;le.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(le),this.straightener=new Lt("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(Ne){ie.rotateBy(Ne),ie.straightener.angle=ie.rotationAngle},le.addElement(this.straightener.getUI());var ue=new je;ue.minWidth=2*this.toolbarHeight+"px",ue.contentAlign="end",this.bottomToolbar.addButtonBlock(ue);var ye=new $e('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");ye.onClick=this.flipHorizontallyButtonClicked,ue.addButton(ye);var we=new $e('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");we.onClick=this.flipVerticallyButtonClicked,ue.addButton(we)},ge.prototype.ratioButtonClicked=function(ie){this.aspectRatio=ie,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},ge.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=it.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},ge.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Ke(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},ge.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ge.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},ge.prototype.restoreState=function(ie){if(ie){var ne=this.cropLayer.getRescaledRect(ie.width,ie.height,this.imageWidth,this.imageHeight,ie.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(ne),this.cropRectChanged(ne),this.flippedHorizontally=ie.flippedHorizontally,this.flippedVertically=ie.flippedVertically,this.applyFlip(),this.rotationAngle=ie.rotationAngle,this.applyRotation()}},ge.prototype.clientToLocalCoordinates=function(ie,ne){var ce=this.cropImage.getBoundingClientRect();return{x:ie-ce.left,y:ne-ce.top}},ge.prototype.onWindowResize=function(){this.positionUI()},ge.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var ie=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=ie+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},ge.prototype.rotateLeftButtonClicked=function(){var ie=this.rotationAngle-90;this.rotationAngle%90!=0&&(ie+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(ie)},ge.prototype.rotateRightButtonClicked=function(){var ie=this.rotationAngle+90;this.rotationAngle%90!=0&&(ie-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(ie)},ge.prototype.rotateTo=function(ie){ie=(ie=ie>180?ie-360:ie)<=-180?ie+360:ie,this.rotationAngle=ie,this.applyRotation()},ge.prototype.rotateBy=function(ie){this.rotateTo((this.rotationAngle+ie)%360)},ge.prototype.applyRotation=function(){var ie=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var ne=this.editingTargetRotationContainer.transform.baseVal.getItem(0);ne.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(ne,0);var ce=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/ce.width,this.imageHeight/ce.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=ie},ge.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},ge.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},ge.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},ge.prototype.startRenderAndClose=function(){return Ye(this,void 0,void 0,function(){var ie,ne;return ke(this,function(ce){switch(ce.label){case 0:return[4,this.render()];case 1:return ie=ce.sent(),ne=this.getState(),this.renderEventListeners.forEach(function(me){return me(ie,ne)}),this.close(!0),[2]}})})},ge.prototype.render=function(){return Ye(this,void 0,void 0,function(){var ie;return ke(this,function(ne){switch(ne.label){case 0:return(ie=new Ot).naturalSize=this.renderAtNaturalSize,ie.imageType=this.renderImageType,ie.imageQuality=this.renderImageQuality,ie.width=this.renderWidth,ie.height=this.renderHeight,this.unzoomFromCrop(),A.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,ie.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return ne.sent(),[4,ie.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,ne.sent()]}})})},ge.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new oe("toolbar",`
|
|
|
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
|
|
|
flex-shrink: 0;
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
justify-content: space-between;
|
|
|
height: `+this.toolbarHeight+`px;
|
|
|
box-sizing: content-box;
|
|
|
overflow: hidden;
|
|
|
line-height: 0px;
|
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new oe("toolbar_colors",`
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new oe("toolbar-block",`
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
box-sizing: content-box;
|
|
|
`));var ie=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new oe("toolbar_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.toolbarHeight-2*ie)+`px;
|
|
|
height: `+(this.toolbarHeight-2*ie)+`px;
|
|
|
padding: `+ie+`px;
|
|
|
cursor: default;
|
|
|
user-select: none;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new oe("toolbar_button_colors",`
|
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
|
fill: currentColor;
|
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new oe("toolbar_active_button",`
|
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
|
fill: currentColor;
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
|
`)),this.styles.addRule(new J("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
|
height: `+this.toolbarHeight/2+`px;
|
|
|
`)),this.styles.addRule(new J("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new oe("toolbar_dropdown",`
|
|
|
position: absolute;
|
|
|
max-width: `+4*this.toolbarHeight+`px;
|
|
|
z-index: 20;
|
|
|
white-space: normal;
|
|
|
box-sizing: content-box;
|
|
|
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
|
|
|
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
|
|
|
line-height: 0px;
|
|
|
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new oe("toolbar_dropdown_colors",`
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new oe("toolbar_straightener_block",`
|
|
|
display: flex;
|
|
|
overflow: hidden;
|
|
|
justify-content: center;
|
|
|
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
|
|
|
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new oe("toolbar_straightener",`
|
|
|
display: flex;
|
|
|
overflow: hidden;
|
|
|
justify-content: center;
|
|
|
height: `+(this.toolbarHeight-2*ie)+`px;
|
|
|
padding: `+ie+`px;
|
|
|
cursor: default;
|
|
|
user-select: none;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new oe("toolbar_straightener_colors",`
|
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
|
fill: currentColor;
|
|
|
`))},ge.instanceCounter=0,ge}(),jt=He("8hTe"),Nt=He.n(jt),mt=/<pre[^>]*>/g;function Ht(ge){var ie=document.createElement("div");return ie.innerHTML=ge,ie.childNodes.length===0?"":ie.childNodes[0].nodeValue}var Vt=dr.a=function(ge){var ie=ge.value,ne=ie===void 0?"":ie,ce=ge.edit,me=ce===void 0?!1:ce,le=ge.className,ue=ge.showTextOnly,ye=ge.showLines,we=ge.replaces,Ne=ge.zoomImg,Ie=ge.hasMask,lt=ge.style,Pt=lt===void 0?{}:lt,Zt=ge.stylesPrev,$t=Zt===void 0?{}:Zt,Kr=String(ne),Jt=Object(V.useRef)(),Yt=Object(V.useRef)(),jn=Object(V.useState)(""),Qr=Object(se.a)(jn,2),Kn=Qr[0],Dn=Qr[1],Br=Object(V.useState)("office"),eo=Object(se.a)(Br,2),qu=eo[0],to=eo[1],$n=function(){var wr=new xt(Yt.current);wr.displayMode="popup",wr.addRenderEventListener(function(){var Ai=Object(M.a)(X.a.mark(function Lr(Fi){var dn;return X.a.wrap(function(ui){for(;;)switch(ui.prev=ui.next){case 0:return Jt.current.style.display="none",ui.next=3,Object(ct.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Fi}});case 3:dn=ui.sent,dn!=null&&dn.id&&we(Yt.current.getAttribute("src").replace(Oe.a.API_SERVER,""),"/api/attachments/".concat(dn==null?void 0:dn.id,"?type=").concat(dn.content_type));case 5:case"end":return ui.stop()}},Lr)}));return function(Lr){return Ai.apply(this,arguments)}}()),wr.show()},ec=function(){var wr=new Ge.a(Yt.current);wr.settings.displayMode="popup",wr.addEventListener("render",function(){var Ai=Object(M.a)(X.a.mark(function Lr(Fi){var dn;return X.a.wrap(function(ui){for(;;)switch(ui.prev=ui.next){case 0:if(Jt.current.style.display="none",!Yt.current){ui.next=6;break}return ui.next=4,Object(ct.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Fi.dataUrl}});case 4:dn=ui.sent,dn!=null&&dn.id&&we(Yt.current.getAttribute("src").replace(Oe.a.API_SERVER,""),"/api/attachments/".concat(dn==null?void 0:dn.id,"?type=").concat(dn.content_type));case 6:case"end":return ui.stop()}},Lr)}));return function(Lr){return Ai.apply(this,arguments)}}()),wr.show(),window.markerArea=wr},Cl=Object(V.useMemo)(function(){Jt.current&&(Jt.current.style.zIndex=-1);try{var li=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,wr=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Ai=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Kr=Kr.replace(li,"("+Oe.a.API_SERVER+"/api/attachments/").replace(wr,'"'+Oe.a.API_SERVER+"/api/attachments/").replace(Ai,'"'+Oe.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
|
`)}catch(Tl){}var Lr=pe(Kr),Fi=_();if(Kr.match(/\[TOC\]/)&&(Lr=Lr.replace("<p>[TOC]</p>",k()),T()),Lr=Lr.replace(/(__special_katext_id_\d+__)/g,function(Tl,ui){var Al=Fi[ui],s1=Al.type,l1=Al.expression;return Object(We.renderToString)(Ht(l1)||"",{displayMode:s1==="block",throwOnError:!1,output:"html"})}),Lr=Lr.replace(/▁/g,"\u2581\u2581\u2581"),O(),ue){var dn=document.createElement("div");return dn.innerHTML=Lr,dn.innerText}return setTimeout(function(){return ri()},500),Lr},[Kr]),Sa=Object(V.useRef)();x.WebkitLineClamp=ye,ye&&(Pt=Object(K.a)(Object(K.a)({},Pt),x));function ro(li){var wr=li.target;if(wr.tagName.toUpperCase()==="IMG"){if(Ne){var Ai=wr.getAttribute("src");Dn(Ai),to("image")}}else if(wr.tagName.toUpperCase()==="A"){var Lr=wr.getAttribute("href");if(Lr.indexOf("office")>-1)li.preventDefault(),Dn(Lr),to("office");else if(Lr.indexOf("application/pdf")>-1)li.preventDefault(),Dn(Lr),to("pdf");else if(Lr.indexOf("text/html")>-1)li.preventDefault(),Dn(Lr),to("html");else if(Lr.startsWith("#")){li.preventDefault();var Fi=document.getElementById(Lr.replace("#",""));Fi&&Fi.scrollIntoView(!0)}}}var ri=function(){var wr,Ai=(wr=Sa.current)===null||wr===void 0?void 0:wr.querySelectorAll("video");Ai==null||Ai.forEach(function(Lr){if(Lr.oncontextmenu=function(){return!1},Lr.src.indexOf(".m3u8")>-1&&!Lr.canPlayType("application/vnd.apple.mpegurl")){if(be.a.isSupported()){var Fi=new be.a;Fi.loadSource(Lr.src),Fi.attachMedia(Lr)}}})};Object(V.useEffect)(function(){if(Sa.current&&Cl&&(Cl.match(mt)&&window.PR.prettyPrint()),Sa.current)return Sa.current.addEventListener("click",ro),function(){Sa.current.removeEventListener("click",ro),O(),T()}},[Cl,Sa.current,ro]);var a1=function(wr){if(!me)return;wr.target.nodeName==="IMG"?(Jt.current.style.zIndex=1,Jt.current.style.display="flex",Jt.current.style.width=wr.target.clientWidth+"px",Jt.current.style.height=wr.target.clientHeight+"px",Jt.current.style.top=wr.target.offsetTop+"px",Jt.current.style.left=wr.target.offsetLeft+"px",Yt.current.src=wr.target.getAttribute("src")):Jt.current.style.display="none"};return L.a.createElement("div",{style:{position:"relative"}},L.a.createElement("div",{ref:Sa,style:Object(K.a)({},Pt),className:"".concat(le||""," markdown-body ").concat(Nt.a.mdBody),onMouseOver:a1,dangerouslySetInnerHTML:{__html:Cl}}),L.a.createElement("div",{ref:Jt,className:Nt.a.button},L.a.createElement(re.a,null,L.a.createElement(ae.a,{onClick:function(){return $n()}},"\u88C1\u526A"),L.a.createElement(ae.a,{onClick:function(){return ec()}},"\u7F16\u8F91"))),L.a.createElement("img",{ref:Yt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),L.a.createElement(Me.a,{close:!0,data:Kn,type:Kn!=null&&Kn.length?qu:"",style:Object(K.a)({},$t),onClose:function(){return Dn("")}}))}},DlQD:function(Pr,dr,He){(function(ze,re){Pr.exports=re()})(this,function(){"use strict";function ze(ne,ce){for(var me=0;me<ce.length;me++){var le=ce[me];le.enumerable=le.enumerable||!1,le.configurable=!0,"value"in le&&(le.writable=!0),Object.defineProperty(ne,le.key,le)}}function re(ne,ce,me){return ce&&ze(ne.prototype,ce),me&&ze(ne,me),ne}function z(ne,ce){if(!ne)return;if(typeof ne=="string")return ae(ne,ce);var me=Object.prototype.toString.call(ne).slice(8,-1);if(me==="Object"&&ne.constructor&&(me=ne.constructor.name),me==="Map"||me==="Set")return Array.from(ne);if(me==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(me))return ae(ne,ce)}function ae(ne,ce){(ce==null||ce>ne.length)&&(ce=ne.length);for(var me=0,le=new Array(ce);me<ce;me++)le[me]=ne[me];return le}function K(ne,ce){var me;if(typeof Symbol=="undefined"||ne[Symbol.iterator]==null){if(Array.isArray(ne)||(me=z(ne))||ce&&ne&&typeof ne.length=="number"){me&&(ne=me);var le=0;return function(){return le>=ne.length?{done:!0}:{done:!1,value:ne[le++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return me=ne[Symbol.iterator](),me.next.bind(me)}function M(ne,ce){return ce={exports:{}},ne(ce,ce.exports),ce.exports}var se=M(function(ne){function ce(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function me(le){ne.exports.defaults=le}ne.exports={defaults:ce(),getDefaults:ce,changeDefaults:me}}),q=se.defaults,X=se.getDefaults,V=se.changeDefaults,L=/[&<>"']/,H=/[&<>"']/g,F=/[<>"']|&(?!#?\w+;)/,I=/[<>"']|&(?!#?\w+;)/g,j={"&":"&","<":"<",">":">",'"':""","'":"'"},P=function(ce){return j[ce]};function w(ne,ce){if(ce){if(L.test(ne))return ne.replace(H,P)}else if(F.test(ne))return ne.replace(I,P);return ne}var d=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function p(ne){return ne.replace(d,function(ce,me){return me=me.toLowerCase(),me==="colon"?":":me.charAt(0)==="#"?me.charAt(1)==="x"?String.fromCharCode(parseInt(me.substring(2),16)):String.fromCharCode(+me.substring(1)):""})}var f=/(^|[^\[])\^/g;function T(ne,ce){ne=ne.source||ne,ce=ce||"";var me={replace:function(ue,ye){return ye=ye.source||ye,ye=ye.replace(f,"$1"),ne=ne.replace(ue,ye),me},getRegex:function(){return new RegExp(ne,ce)}};return me}var x=/[^\w:]/g,E=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function k(ne,ce,me){if(ne){var le;try{le=decodeURIComponent(p(me)).replace(x,"").toLowerCase()}catch(ue){return null}if(le.indexOf("javascript:")===0||le.indexOf("vbscript:")===0||le.indexOf("data:")===0)return null}ce&&!E.test(me)&&(me=g(ce,me));try{me=encodeURI(me).replace(/%25/g,"%")}catch(ue){return null}return me}var C={},b=/^[^:]+:\/*[^/]*$/,m=/^([^:]+:)[\s\S]*$/,v=/^([^:]+:\/*[^/]*)[\s\S]*$/;function g(ne,ce){C[" "+ne]||(b.test(ne)?C[" "+ne]=ne+"/":C[" "+ne]=Y(ne,"/",!0)),ne=C[" "+ne];var me=ne.indexOf(":")===-1;return ce.substring(0,2)==="//"?me?ce:ne.replace(m,"$1")+ce:ce.charAt(0)==="/"?me?ce:ne.replace(v,"$1")+ce:ne+ce}var _={exec:function(){}};function O(ne){for(var ce=1,me,le;ce<arguments.length;ce++){me=arguments[ce];for(le in me)Object.prototype.hasOwnProperty.call(me,le)&&(ne[le]=me[le])}return ne}function G(ne,ce){var me=ne.replace(/\|/g,function(ye,we,Ne){for(var Ie=!1,lt=we;--lt>=0&&Ne[lt]==="\\";)Ie=!Ie;return Ie?"|":" |"}),le=me.split(/ \|/),ue=0;if(le.length>ce)le.splice(ce);else for(;le.length<ce;)le.push("");for(;ue<le.length;ue++)le[ue]=le[ue].trim().replace(/\\\|/g,"|");return le}function Y(ne,ce,me){var le=ne.length;if(le===0)return"";for(var ue=0;ue<le;){var ye=ne.charAt(le-ue-1);if(ye===ce&&!me)ue++;else if(ye!==ce&&me)ue++;else break}return ne.substr(0,le-ue)}function ee(ne,ce){if(ne.indexOf(ce[1])===-1)return-1;for(var me=ne.length,le=0,ue=0;ue<me;ue++)if(ne[ue]==="\\")ue++;else if(ne[ue]===ce[0])le++;else if(ne[ue]===ce[1]&&(le--,le<0))return ue;return-1}function fe(ne){ne&&ne.sanitize&&!ne.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var pe={escape:w,unescape:p,edit:T,cleanUrl:k,resolveUrl:g,noopTest:_,merge:O,splitCells:G,rtrim:Y,findClosingBracket:ee,checkSanitizeDeprecation:fe},xe=se.defaults,Ce=pe.rtrim,be=pe.splitCells,Oe=pe.escape,We=pe.findClosingBracket;function Me(ne,ce,me){var le=ce.href,ue=ce.title?Oe(ce.title):null,ye=ne[1].replace(/\\([\[\]])/g,"$1");return ne[0].charAt(0)!=="!"?{type:"link",raw:me,href:le,title:ue,text:ye}:{type:"image",raw:me,href:le,title:ue,text:Oe(ye)}}function ct(ne,ce){var me=ne.match(/^(\s+)(?:```)/);if(me===null)return ce;var le=me[1];return ce.split(`
|
|
|
`).map(function(ue){var ye=ue.match(/^\s+/);if(ye===null)return ue;var we=ye[0];return we.length>=le.length?ue.slice(le.length):ue}).join(`
|
|
|
`)}var Ge=function(){function ne(me){this.options=me||xe}var ce=ne.prototype;return ce.space=function(le){var ue=this.rules.block.newline.exec(le);if(ue)return ue[0].length>1?{type:"space",raw:ue[0]}:{raw:`
|
|
|
`}},ce.code=function(le,ue){var ye=this.rules.block.code.exec(le);if(ye){var we=ue[ue.length-1];if(we&&we.type==="paragraph")return{raw:ye[0],text:ye[0].trimRight()};var Ne=ye[0].replace(/^ {4}/gm,"");return{type:"code",raw:ye[0],codeBlockStyle:"indented",text:this.options.pedantic?Ne:Ce(Ne,`
|
|
|
`)}}},ce.fences=function(le){var ue=this.rules.block.fences.exec(le);if(ue){var ye=ue[0],we=ct(ye,ue[3]||"");return{type:"code",raw:ye,lang:ue[2]?ue[2].trim():ue[2],text:we}}},ce.heading=function(le){var ue=this.rules.block.heading.exec(le);if(ue)return{type:"heading",raw:ue[0],depth:ue[1].length,text:ue[2]}},ce.nptable=function(le){var ue=this.rules.block.nptable.exec(le);if(ue){var ye={type:"table",header:be(ue[1].replace(/^ *| *\| *$/g,"")),align:ue[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ue[3]?ue[3].replace(/\n$/,"").split(`
|
|
|
`):[],raw:ue[0]};if(ye.header.length===ye.align.length){var we=ye.align.length,Ne;for(Ne=0;Ne<we;Ne++)/^ *-+: *$/.test(ye.align[Ne])?ye.align[Ne]="right":/^ *:-+: *$/.test(ye.align[Ne])?ye.align[Ne]="center":/^ *:-+ *$/.test(ye.align[Ne])?ye.align[Ne]="left":ye.align[Ne]=null;for(we=ye.cells.length,Ne=0;Ne<we;Ne++)ye.cells[Ne]=be(ye.cells[Ne],ye.header.length);return ye}}},ce.hr=function(le){var ue=this.rules.block.hr.exec(le);if(ue)return{type:"hr",raw:ue[0]}},ce.blockquote=function(le){var ue=this.rules.block.blockquote.exec(le);if(ue){var ye=ue[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ue[0],text:ye}}},ce.list=function(le){var ue=this.rules.block.list.exec(le);if(ue){for(var ye=ue[0],we=ue[2],Ne=we.length>1,Ie=we[we.length-1]===")",lt={type:"list",raw:ye,ordered:Ne,start:Ne?+we.slice(0,-1):"",loose:!1,items:[]},Pt=ue[0].match(this.rules.block.item),Zt=!1,$t,Kr,Jt,Yt,jn,Qr,Kn,Dn=Pt.length,Br=0;Br<Dn;Br++)$t=Pt[Br],ye=$t,Kr=$t.length,$t=$t.replace(/^ *([*+-]|\d+[.)]) */,""),~$t.indexOf(`
|
|
|
`)&&(Kr-=$t.length,$t=this.options.pedantic?$t.replace(/^ {1,4}/gm,""):$t.replace(new RegExp("^ {1,"+Kr+"}","gm"),"")),Br!==Dn-1&&(Jt=this.rules.block.bullet.exec(Pt[Br+1])[0],(Ne?Jt.length===1||!Ie&&Jt[Jt.length-1]===")":Jt.length>1||this.options.smartLists&&Jt!==we)&&(Yt=Pt.slice(Br+1).join(`
|
|
|
`),lt.raw=lt.raw.substring(0,lt.raw.length-Yt.length),Br=Dn-1)),jn=Zt||/\n\n(?!\s*$)/.test($t),Br!==Dn-1&&(Zt=$t.charAt($t.length-1)===`
|
|
|
`,jn||(jn=Zt)),jn&&(lt.loose=!0),Qr=/^\[[ xX]\] /.test($t),Kn=void 0,Qr&&(Kn=$t[1]!==" ",$t=$t.replace(/^\[[ xX]\] +/,"")),lt.items.push({type:"list_item",raw:ye,task:Qr,checked:Kn,loose:jn,text:$t});return lt}},ce.html=function(le){var ue=this.rules.block.html.exec(le);if(ue)return{type:this.options.sanitize?"paragraph":"html",raw:ue[0],pre:!this.options.sanitizer&&(ue[1]==="pre"||ue[1]==="script"||ue[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):Oe(ue[0]):ue[0]}},ce.def=function(le){var ue=this.rules.block.def.exec(le);if(ue){ue[3]&&(ue[3]=ue[3].substring(1,ue[3].length-1));var ye=ue[1].toLowerCase().replace(/\s+/g," ");return{tag:ye,raw:ue[0],href:ue[2],title:ue[3]}}},ce.table=function(le){var ue=this.rules.block.table.exec(le);if(ue){var ye={type:"table",header:be(ue[1].replace(/^ *| *\| *$/g,"")),align:ue[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ue[3]?ue[3].replace(/\n$/,"").split(`
|
|
|
`):[]};if(ye.header.length===ye.align.length){ye.raw=ue[0];var we=ye.align.length,Ne;for(Ne=0;Ne<we;Ne++)/^ *-+: *$/.test(ye.align[Ne])?ye.align[Ne]="right":/^ *:-+: *$/.test(ye.align[Ne])?ye.align[Ne]="center":/^ *:-+ *$/.test(ye.align[Ne])?ye.align[Ne]="left":ye.align[Ne]=null;for(we=ye.cells.length,Ne=0;Ne<we;Ne++)ye.cells[Ne]=be(ye.cells[Ne].replace(/^ *\| *| *\| *$/g,""),ye.header.length);return ye}}},ce.lheading=function(le){var ue=this.rules.block.lheading.exec(le);if(ue)return{type:"heading",raw:ue[0],depth:ue[2].charAt(0)==="="?1:2,text:ue[1]}},ce.paragraph=function(le){var ue=this.rules.block.paragraph.exec(le);if(ue)return{type:"paragraph",raw:ue[0],text:ue[1].charAt(ue[1].length-1)===`
|
|
|
`?ue[1].slice(0,-1):ue[1]}},ce.text=function(le,ue){var ye=this.rules.block.text.exec(le);if(ye){var we=ue[ue.length-1];return we&&we.type==="text"?{raw:ye[0],text:ye[0]}:{type:"text",raw:ye[0],text:ye[0]}}},ce.escape=function(le){var ue=this.rules.inline.escape.exec(le);if(ue)return{type:"escape",raw:ue[0],text:Oe(ue[1])}},ce.tag=function(le,ue,ye){var we=this.rules.inline.tag.exec(le);if(we)return!ue&&/^<a /i.test(we[0])?ue=!0:ue&&/^<\/a>/i.test(we[0])&&(ue=!1),!ye&&/^<(pre|code|kbd|script)(\s|>)/i.test(we[0])?ye=!0:ye&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(we[0])&&(ye=!1),{type:this.options.sanitize?"text":"html",raw:we[0],inLink:ue,inRawBlock:ye,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(we[0]):Oe(we[0]):we[0]}},ce.link=function(le){var ue=this.rules.inline.link.exec(le);if(ue){var ye=We(ue[2],"()");if(ye>-1){var we=ue[0].indexOf("!")===0?5:4,Ne=we+ue[1].length+ye;ue[2]=ue[2].substring(0,ye),ue[0]=ue[0].substring(0,Ne).trim(),ue[3]=""}var Ie=ue[2],lt="";if(this.options.pedantic){var Pt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ie);Pt?(Ie=Pt[1],lt=Pt[3]):lt=""}else lt=ue[3]?ue[3].slice(1,-1):"";Ie=Ie.trim().replace(/^<([\s\S]*)>$/,"$1");var Zt=Me(ue,{href:Ie&&Ie.replace(this.rules.inline._escapes,"$1"),title:lt&<.replace(this.rules.inline._escapes,"$1")},ue[0]);return Zt}},ce.reflink=function(le,ue){var ye;if((ye=this.rules.inline.reflink.exec(le))||(ye=this.rules.inline.nolink.exec(le))){var we=(ye[2]||ye[1]).replace(/\s+/g," ");if(we=ue[we.toLowerCase()],!we||!we.href){var Ne=ye[0].charAt(0);return{type:"text",raw:Ne,text:Ne}}var Ie=Me(ye,we,ye[0]);return Ie}},ce.strong=function(le,ue,ye){ye===void 0&&(ye="");var we=this.rules.inline.strong.start.exec(le);if(we&&(!we[1]||we[1]&&(ye===""||this.rules.inline.punctuation.exec(ye)))){ue=ue.slice(-1*le.length);var Ne=we[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ne.lastIndex=0;for(var Ie;(we=Ne.exec(ue))!=null;)if(Ie=this.rules.inline.strong.middle.exec(ue.slice(0,we.index+3)),Ie)return{type:"strong",raw:le.slice(0,Ie[0].length),text:le.slice(2,Ie[0].length-2)}}},ce.em=function(le,ue,ye){ye===void 0&&(ye="");var we=this.rules.inline.em.start.exec(le);if(we&&(!we[1]||we[1]&&(ye===""||this.rules.inline.punctuation.exec(ye)))){ue=ue.slice(-1*le.length);var Ne=we[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ne.lastIndex=0;for(var Ie;(we=Ne.exec(ue))!=null;)if(Ie=this.rules.inline.em.middle.exec(ue.slice(0,we.index+2)),Ie)return{type:"em",raw:le.slice(0,Ie[0].length),text:le.slice(1,Ie[0].length-1)}}},ce.codespan=function(le){var ue=this.rules.inline.code.exec(le);if(ue){var ye=ue[2].replace(/\n/g," "),we=/[^ ]/.test(ye),Ne=ye.startsWith(" ")&&ye.endsWith(" ");return we&&Ne&&(ye=ye.substring(1,ye.length-1)),ye=Oe(ye,!0),{type:"codespan",raw:ue[0],text:ye}}},ce.br=function(le){var ue=this.rules.inline.br.exec(le);if(ue)return{type:"br",raw:ue[0]}},ce.del=function(le){var ue=this.rules.inline.del.exec(le);if(ue)return{type:"del",raw:ue[0],text:ue[1]}},ce.autolink=function(le,ue){var ye=this.rules.inline.autolink.exec(le);if(ye){var we,Ne;return ye[2]==="@"?(we=Oe(this.options.mangle?ue(ye[1]):ye[1]),Ne="mailto:"+we):(we=Oe(ye[1]),Ne=we),{type:"link",raw:ye[0],text:we,href:Ne,tokens:[{type:"text",raw:we,text:we}]}}},ce.url=function(le,ue){var ye;if(ye=this.rules.inline.url.exec(le)){var we,Ne;if(ye[2]==="@")we=Oe(this.options.mangle?ue(ye[0]):ye[0]),Ne="mailto:"+we;else{var Ie;do Ie=ye[0],ye[0]=this.rules.inline._backpedal.exec(ye[0])[0];while(Ie!==ye[0]);we=Oe(ye[0]),ye[1]==="www."?Ne="http://"+we:Ne=we}return{type:"link",raw:ye[0],text:we,href:Ne,tokens:[{type:"text",raw:we,text:we}]}}},ce.inlineText=function(le,ue,ye){var we=this.rules.inline.text.exec(le);if(we){var Ne;return ue?Ne=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(we[0]):Oe(we[0]):we[0]:Ne=Oe(this.options.smartypants?ye(we[0]):we[0]),{type:"text",raw:we[0],text:Ne}}},ne}(),Je=pe.noopTest,Xe=pe.edit,Ye=pe.merge,ke={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Je,table:Je,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ke._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ke._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ke.def=Xe(ke.def).replace("label",ke._label).replace("title",ke._title).getRegex(),ke.bullet=/(?:[*+-]|\d{1,9}[.)])/,ke.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ke.item=Xe(ke.item,"gm").replace(/bull/g,ke.bullet).getRegex(),ke.list=Xe(ke.list).replace(/bull/g,ke.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ke.def.source+")").getRegex(),ke._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ke._comment=/<!--(?!-?>)[\s\S]*?-->/,ke.html=Xe(ke.html,"i").replace("comment",ke._comment).replace("tag",ke._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ke.paragraph=Xe(ke._paragraph).replace("hr",ke.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ke._tag).getRegex(),ke.blockquote=Xe(ke.blockquote).replace("paragraph",ke.paragraph).getRegex(),ke.normal=Ye({},ke),ke.gfm=Ye({},ke.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ke.gfm.nptable=Xe(ke.gfm.nptable).replace("hr",ke.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ke._tag).getRegex(),ke.gfm.table=Xe(ke.gfm.table).replace("hr",ke.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ke._tag).getRegex(),ke.pedantic=Ye({},ke.normal,{html:Xe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ke._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Je,paragraph:Xe(ke.normal._paragraph).replace("hr",ke.hr).replace("heading",` *#{1,6} *[^
|
|
|
]`).replace("lheading",ke.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Z={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Je,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Je,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};Z._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Z.punctuation=Xe(Z.punctuation).replace(/punctuation/g,Z._punctuation).getRegex(),Z._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",Z._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",Z.em.start=Xe(Z.em.start).replace(/punctuation/g,Z._punctuation).getRegex(),Z.em.middle=Xe(Z.em.middle).replace(/punctuation/g,Z._punctuation).replace(/overlapSkip/g,Z._overlapSkip).getRegex(),Z.em.endAst=Xe(Z.em.endAst,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.em.endUnd=Xe(Z.em.endUnd,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.strong.start=Xe(Z.strong.start).replace(/punctuation/g,Z._punctuation).getRegex(),Z.strong.middle=Xe(Z.strong.middle).replace(/punctuation/g,Z._punctuation).replace(/blockSkip/g,Z._blockSkip).getRegex(),Z.strong.endAst=Xe(Z.strong.endAst,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.strong.endUnd=Xe(Z.strong.endUnd,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.blockSkip=Xe(Z._blockSkip,"g").getRegex(),Z.overlapSkip=Xe(Z._overlapSkip,"g").getRegex(),Z._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Z._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Z._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Z.autolink=Xe(Z.autolink).replace("scheme",Z._scheme).replace("email",Z._email).getRegex(),Z._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Z.tag=Xe(Z.tag).replace("comment",ke._comment).replace("attribute",Z._attribute).getRegex(),Z._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Z._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,Z._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Z.link=Xe(Z.link).replace("label",Z._label).replace("href",Z._href).replace("title",Z._title).getRegex(),Z.reflink=Xe(Z.reflink).replace("label",Z._label).getRegex(),Z.reflinkSearch=Xe(Z.reflinkSearch,"g").replace("reflink",Z.reflink).replace("nolink",Z.nolink).getRegex(),Z.normal=Ye({},Z),Z.pedantic=Ye({},Z.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Xe(/^!?\[(label)\]\((.*?)\)/).replace("label",Z._label).getRegex(),reflink:Xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Z._label).getRegex()}),Z.gfm=Ye({},Z.normal,{escape:Xe(Z.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),Z.gfm.url=Xe(Z.gfm.url,"i").replace("email",Z.gfm._extended_email).getRegex(),Z.breaks=Ye({},Z.gfm,{br:Xe(Z.br).replace("{2,}","*").getRegex(),text:Xe(Z.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var A={block:ke,inline:Z},R=se.defaults,J=A.block,oe=A.inline;function $(ne){return ne.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function Se(ne){var ce="",me,le,ue=ne.length;for(me=0;me<ue;me++)le=ne.charCodeAt(me),Math.random()>.5&&(le="x"+le.toString(16)),ce+="&#"+le+";";return ce}var je=function(){function ne(me){this.tokens=[],this.tokens.links=Object.create(null),this.options=me||R,this.options.tokenizer=this.options.tokenizer||new Ge,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var le={block:J.normal,inline:oe.normal};this.options.pedantic?(le.block=J.pedantic,le.inline=oe.pedantic):this.options.gfm&&(le.block=J.gfm,this.options.breaks?le.inline=oe.breaks:le.inline=oe.gfm),this.tokenizer.rules=le}ne.lex=function(le,ue){var ye=new ne(ue);return ye.lex(le)};var ce=ne.prototype;return ce.lex=function(le){return le=le.replace(/\r\n|\r/g,`
|
|
|
`).replace(/\t/g," "),this.blockTokens(le,this.tokens,!0),this.inline(this.tokens),this.tokens},ce.blockTokens=function(le,ue,ye){ue===void 0&&(ue=[]),ye===void 0&&(ye=!0),le=le.replace(/^ +$/gm,"");for(var we,Ne,Ie,lt;le;){if(we=this.tokenizer.space(le)){le=le.substring(we.raw.length),we.type&&ue.push(we);continue}if(we=this.tokenizer.code(le,ue)){le=le.substring(we.raw.length),we.type?ue.push(we):(lt=ue[ue.length-1],lt.raw+=`
|
|
|
`+we.raw,lt.text+=`
|
|
|
`+we.text);continue}if(we=this.tokenizer.fences(le)){le=le.substring(we.raw.length),ue.push(we);continue}if(we=this.tokenizer.heading(le)){le=le.substring(we.raw.length),ue.push(we);continue}if(we=this.tokenizer.nptable(le)){le=le.substring(we.raw.length),ue.push(we);continue}if(we=this.tokenizer.hr(le)){le=le.substring(we.raw.length),ue.push(we);continue}if(we=this.tokenizer.blockquote(le)){le=le.substring(we.raw.length),we.tokens=this.blockTokens(we.text,[],ye),ue.push(we);continue}if(we=this.tokenizer.list(le)){for(le=le.substring(we.raw.length),Ie=we.items.length,Ne=0;Ne<Ie;Ne++)we.items[Ne].tokens=this.blockTokens(we.items[Ne].text,[],!1);ue.push(we);continue}if(we=this.tokenizer.html(le)){le=le.substring(we.raw.length),ue.push(we);continue}if(ye&&(we=this.tokenizer.def(le))){le=le.substring(we.raw.length),this.tokens.links[we.tag]||(this.tokens.links[we.tag]={href:we.href,title:we.title});continue}if(we=this.tokenizer.table(le)){le=le.substring(we.raw.length),ue.push(we);continue}if(we=this.tokenizer.lheading(le)){le=le.substring(we.raw.length),ue.push(we);continue}if(ye&&(we=this.tokenizer.paragraph(le))){le=le.substring(we.raw.length),ue.push(we);continue}if(we=this.tokenizer.text(le,ue)){le=le.substring(we.raw.length),we.type?ue.push(we):(lt=ue[ue.length-1],lt.raw+=`
|
|
|
`+we.raw,lt.text+=`
|
|
|
`+we.text);continue}if(le){var Pt="Infinite loop on byte: "+le.charCodeAt(0);if(this.options.silent){console.error(Pt);break}else throw new Error(Pt)}}return ue},ce.inline=function(le){var ue,ye,we,Ne,Ie,lt,Pt=le.length;for(ue=0;ue<Pt;ue++){lt=le[ue];switch(lt.type){case"paragraph":case"text":case"heading":{lt.tokens=[],this.inlineTokens(lt.text,lt.tokens);break}case"table":{for(lt.tokens={header:[],cells:[]},Ne=lt.header.length,ye=0;ye<Ne;ye++)lt.tokens.header[ye]=[],this.inlineTokens(lt.header[ye],lt.tokens.header[ye]);for(Ne=lt.cells.length,ye=0;ye<Ne;ye++)for(Ie=lt.cells[ye],lt.tokens.cells[ye]=[],we=0;we<Ie.length;we++)lt.tokens.cells[ye][we]=[],this.inlineTokens(Ie[we],lt.tokens.cells[ye][we]);break}case"blockquote":{this.inline(lt.tokens);break}case"list":{for(Ne=lt.items.length,ye=0;ye<Ne;ye++)this.inline(lt.items[ye].tokens);break}}}return le},ce.inlineTokens=function(le,ue,ye,we,Ne){ue===void 0&&(ue=[]),ye===void 0&&(ye=!1),we===void 0&&(we=!1),Ne===void 0&&(Ne="");var Ie,lt=le,Pt;if(this.tokens.links){var Zt=Object.keys(this.tokens.links);if(Zt.length>0)for(;(Pt=this.tokenizer.rules.inline.reflinkSearch.exec(lt))!=null;)Zt.includes(Pt[0].slice(Pt[0].lastIndexOf("[")+1,-1))&&(lt=lt.slice(0,Pt.index)+"["+"a".repeat(Pt[0].length-2)+"]"+lt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Pt=this.tokenizer.rules.inline.blockSkip.exec(lt))!=null;)lt=lt.slice(0,Pt.index)+"["+"a".repeat(Pt[0].length-2)+"]"+lt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;le;){if(Ie=this.tokenizer.escape(le)){le=le.substring(Ie.raw.length),ue.push(Ie);continue}if(Ie=this.tokenizer.tag(le,ye,we)){le=le.substring(Ie.raw.length),ye=Ie.inLink,we=Ie.inRawBlock,ue.push(Ie);continue}if(Ie=this.tokenizer.link(le)){le=le.substring(Ie.raw.length),Ie.type==="link"&&(Ie.tokens=this.inlineTokens(Ie.text,[],!0,we)),ue.push(Ie);continue}if(Ie=this.tokenizer.reflink(le,this.tokens.links)){le=le.substring(Ie.raw.length),Ie.type==="link"&&(Ie.tokens=this.inlineTokens(Ie.text,[],!0,we)),ue.push(Ie);continue}if(Ie=this.tokenizer.strong(le,lt,Ne)){le=le.substring(Ie.raw.length),Ie.tokens=this.inlineTokens(Ie.text,[],ye,we),ue.push(Ie);continue}if(Ie=this.tokenizer.em(le,lt,Ne)){le=le.substring(Ie.raw.length),Ie.tokens=this.inlineTokens(Ie.text,[],ye,we),ue.push(Ie);continue}if(Ie=this.tokenizer.codespan(le)){le=le.substring(Ie.raw.length),ue.push(Ie);continue}if(Ie=this.tokenizer.br(le)){le=le.substring(Ie.raw.length),ue.push(Ie);continue}if(Ie=this.tokenizer.del(le)){le=le.substring(Ie.raw.length),Ie.tokens=this.inlineTokens(Ie.text,[],ye,we),ue.push(Ie);continue}if(Ie=this.tokenizer.autolink(le,Se)){le=le.substring(Ie.raw.length),ue.push(Ie);continue}if(!ye&&(Ie=this.tokenizer.url(le,Se))){le=le.substring(Ie.raw.length),ue.push(Ie);continue}if(Ie=this.tokenizer.inlineText(le,we,$)){le=le.substring(Ie.raw.length),Ne=Ie.raw.slice(-1),ue.push(Ie);continue}if(le){var $t="Infinite loop on byte: "+le.charCodeAt(0);if(this.options.silent){console.error($t);break}else throw new Error($t)}}return ue},re(ne,null,[{key:"rules",get:function(){return{block:J,inline:oe}}}]),ne}(),$e=se.defaults,st=pe.cleanUrl,Ke=pe.escape,it=function(){function ne(me){this.options=me||$e}var ce=ne.prototype;return ce.code=function(le,ue,ye){var we=(ue||"").match(/\S*/)[0];if(this.options.highlight){var Ne=this.options.highlight(le,we);Ne!=null&&Ne!==le&&(ye=!0,le=Ne)}return we?'<pre><code class="'+this.options.langPrefix+Ke(we,!0)+'">'+(ye?le:Ke(le,!0))+`</code></pre>
|
|
|
`:"<pre><code>"+(ye?le:Ke(le,!0))+`</code></pre>
|
|
|
`},ce.blockquote=function(le){return`<blockquote>
|
|
|
`+le+`</blockquote>
|
|
|
`},ce.html=function(le){return le},ce.heading=function(le,ue,ye,we){return this.options.headerIds?"<h"+ue+' id="'+this.options.headerPrefix+we.slug(ye)+'">'+le+"</h"+ue+`>
|
|
|
`:"<h"+ue+">"+le+"</h"+ue+`>
|
|
|
`},ce.hr=function(){return this.options.xhtml?`<hr/>
|
|
|
`:`<hr>
|
|
|
`},ce.list=function(le,ue,ye){var we=ue?"ol":"ul",Ne=ue&&ye!==1?' start="'+ye+'"':"";return"<"+we+Ne+`>
|
|
|
`+le+"</"+we+`>
|
|
|
`},ce.listitem=function(le){return"<li>"+le+`</li>
|
|
|
`},ce.checkbox=function(le){return"<input "+(le?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ce.paragraph=function(le){return"<p>"+le+`</p>
|
|
|
`},ce.table=function(le,ue){return ue&&(ue="<tbody>"+ue+"</tbody>"),`<table>
|
|
|
<thead>
|
|
|
`+le+`</thead>
|
|
|
`+ue+`</table>
|
|
|
`},ce.tablerow=function(le){return`<tr>
|
|
|
`+le+`</tr>
|
|
|
`},ce.tablecell=function(le,ue){var ye=ue.header?"th":"td",we=ue.align?"<"+ye+' align="'+ue.align+'">':"<"+ye+">";return we+le+"</"+ye+`>
|
|
|
`},ce.strong=function(le){return"<strong>"+le+"</strong>"},ce.em=function(le){return"<em>"+le+"</em>"},ce.codespan=function(le){return"<code>"+le+"</code>"},ce.br=function(){return this.options.xhtml?"<br/>":"<br>"},ce.del=function(le){return"<del>"+le+"</del>"},ce.link=function(le,ue,ye){if(le=st(this.options.sanitize,this.options.baseUrl,le),le===null)return ye;var we='<a href="'+Ke(le)+'"';return ue&&(we+=' title="'+ue+'"'),we+=">"+ye+"</a>",we},ce.image=function(le,ue,ye){if(le=st(this.options.sanitize,this.options.baseUrl,le),le===null)return ye;var we='<img src="'+le+'" alt="'+ye+'"';return ue&&(we+=' title="'+ue+'"'),we+=this.options.xhtml?"/>":">",we},ce.text=function(le){return le},ne}(),nt=function(){function ne(){}var ce=ne.prototype;return ce.strong=function(le){return le},ce.em=function(le){return le},ce.codespan=function(le){return le},ce.del=function(le){return le},ce.html=function(le){return le},ce.text=function(le){return le},ce.link=function(le,ue,ye){return""+ye},ce.image=function(le,ue,ye){return""+ye},ce.br=function(){return""},ne}(),bt=function(){function ne(){this.seen={}}var ce=ne.prototype;return ce.slug=function(le){var ue=le.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ue)){var ye=ue;do this.seen[ye]++,ue=ye+"-"+this.seen[ye];while(this.seen.hasOwnProperty(ue))}return this.seen[ue]=0,ue},ne}(),_t=se.defaults,Lt=pe.unescape,Ot=function(){function ne(me){this.options=me||_t,this.options.renderer=this.options.renderer||new it,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new nt,this.slugger=new bt}ne.parse=function(le,ue){var ye=new ne(ue);return ye.parse(le)};var ce=ne.prototype;return ce.parse=function(le,ue){ue===void 0&&(ue=!0);var ye="",we,Ne,Ie,lt,Pt,Zt,$t,Kr,Jt,Yt,jn,Qr,Kn,Dn,Br,eo,qu,to,$n=le.length;for(we=0;we<$n;we++){Yt=le[we];switch(Yt.type){case"space":continue;case"hr":{ye+=this.renderer.hr();continue}case"heading":{ye+=this.renderer.heading(this.parseInline(Yt.tokens),Yt.depth,Lt(this.parseInline(Yt.tokens,this.textRenderer)),this.slugger);continue}case"code":{ye+=this.renderer.code(Yt.text,Yt.lang,Yt.escaped);continue}case"table":{for(Kr="",$t="",lt=Yt.header.length,Ne=0;Ne<lt;Ne++)$t+=this.renderer.tablecell(this.parseInline(Yt.tokens.header[Ne]),{header:!0,align:Yt.align[Ne]});for(Kr+=this.renderer.tablerow($t),Jt="",lt=Yt.cells.length,Ne=0;Ne<lt;Ne++){for(Zt=Yt.tokens.cells[Ne],$t="",Pt=Zt.length,Ie=0;Ie<Pt;Ie++)$t+=this.renderer.tablecell(this.parseInline(Zt[Ie]),{header:!1,align:Yt.align[Ie]});Jt+=this.renderer.tablerow($t)}ye+=this.renderer.table(Kr,Jt);continue}case"blockquote":{Jt=this.parse(Yt.tokens),ye+=this.renderer.blockquote(Jt);continue}case"list":{for(jn=Yt.ordered,Qr=Yt.start,Kn=Yt.loose,lt=Yt.items.length,Jt="",Ne=0;Ne<lt;Ne++)Br=Yt.items[Ne],eo=Br.checked,qu=Br.task,Dn="",Br.task&&(to=this.renderer.checkbox(eo),Kn?Br.tokens.length>0&&Br.tokens[0].type==="text"?(Br.tokens[0].text=to+" "+Br.tokens[0].text,Br.tokens[0].tokens&&Br.tokens[0].tokens.length>0&&Br.tokens[0].tokens[0].type==="text"&&(Br.tokens[0].tokens[0].text=to+" "+Br.tokens[0].tokens[0].text)):Br.tokens.unshift({type:"text",text:to}):Dn+=to),Dn+=this.parse(Br.tokens,Kn),Jt+=this.renderer.listitem(Dn,qu,eo);ye+=this.renderer.list(Jt,jn,Qr);continue}case"html":{ye+=this.renderer.html(Yt.text);continue}case"paragraph":{ye+=this.renderer.paragraph(this.parseInline(Yt.tokens));continue}case"text":{for(Jt=Yt.tokens?this.parseInline(Yt.tokens):Yt.text;we+1<$n&&le[we+1].type==="text";)Yt=le[++we],Jt+=`
|
|
|
`+(Yt.tokens?this.parseInline(Yt.tokens):Yt.text);ye+=ue?this.renderer.paragraph(Jt):Jt;continue}default:{var ec='Token with "'+Yt.type+'" type was not found.';if(this.options.silent){console.error(ec);return}else throw new Error(ec)}}}return ye},ce.parseInline=function(le,ue){ue=ue||this.renderer;var ye="",we,Ne,Ie=le.length;for(we=0;we<Ie;we++){Ne=le[we];switch(Ne.type){case"escape":{ye+=ue.text(Ne.text);break}case"html":{ye+=ue.html(Ne.text);break}case"link":{ye+=ue.link(Ne.href,Ne.title,this.parseInline(Ne.tokens,ue));break}case"image":{ye+=ue.image(Ne.href,Ne.title,Ne.text);break}case"strong":{ye+=ue.strong(this.parseInline(Ne.tokens,ue));break}case"em":{ye+=ue.em(this.parseInline(Ne.tokens,ue));break}case"codespan":{ye+=ue.codespan(Ne.text);break}case"br":{ye+=ue.br();break}case"del":{ye+=ue.del(this.parseInline(Ne.tokens,ue));break}case"text":{ye+=ue.text(Ne.text);break}default:{var lt='Token with "'+Ne.type+'" type was not found.';if(this.options.silent){console.error(lt);return}else throw new Error(lt)}}}return ye},ne}(),xt=pe.merge,jt=pe.checkSanitizeDeprecation,Nt=pe.escape,mt=se.getDefaults,Ht=se.changeDefaults,Vt=se.defaults;function ge(ne,ce,me){if(typeof ne=="undefined"||ne===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ne!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ne)+", string expected");if(typeof ce=="function"&&(me=ce,ce=null),ce=xt({},ge.defaults,ce||{}),jt(ce),me){var le=ce.highlight,ue;try{ue=je.lex(ne,ce)}catch(Ie){return me(Ie)}var ye=function(lt){var Pt;if(!lt)try{Pt=Ot.parse(ue,ce)}catch(Zt){lt=Zt}return ce.highlight=le,lt?me(lt):me(null,Pt)};if(!le||le.length<3)return ye();if(delete ce.highlight,!ue.length)return ye();var we=0;ge.walkTokens(ue,function(Ie){Ie.type==="code"&&(we++,setTimeout(function(){le(Ie.text,Ie.lang,function(lt,Pt){if(lt)return ye(lt);Pt!=null&&Pt!==Ie.text&&(Ie.text=Pt,Ie.escaped=!0),we--,we===0&&ye()})},0))}),we===0&&ye();return}try{var Ne=je.lex(ne,ce);return ce.walkTokens&&ge.walkTokens(Ne,ce.walkTokens),Ot.parse(Ne,ce)}catch(Ie){if(Ie.message+=`
|
|
|
Please report this to https://github.com/markedjs/marked.`,ce.silent)return"<p>An error occurred:</p><pre>"+Nt(Ie.message+"",!0)+"</pre>";throw Ie}}ge.options=ge.setOptions=function(ne){return xt(ge.defaults,ne),Ht(ge.defaults),ge},ge.getDefaults=mt,ge.defaults=Vt,ge.use=function(ne){var ce=xt({},ne);if(ne.renderer&&function(){var le=ge.defaults.renderer||new it,ue=function(Ne){var Ie=le[Ne];le[Ne]=function(){for(var lt=arguments.length,Pt=new Array(lt),Zt=0;Zt<lt;Zt++)Pt[Zt]=arguments[Zt];var $t=ne.renderer[Ne].apply(le,Pt);return $t===!1&&($t=Ie.apply(le,Pt)),$t}};for(var ye in ne.renderer)ue(ye);ce.renderer=le}(),ne.tokenizer&&function(){var le=ge.defaults.tokenizer||new Ge,ue=function(Ne){var Ie=le[Ne];le[Ne]=function(){for(var lt=arguments.length,Pt=new Array(lt),Zt=0;Zt<lt;Zt++)Pt[Zt]=arguments[Zt];var $t=ne.tokenizer[Ne].apply(le,Pt);return $t===!1&&($t=Ie.apply(le,Pt)),$t}};for(var ye in ne.tokenizer)ue(ye);ce.tokenizer=le}(),ne.walkTokens){var me=ge.defaults.walkTokens;ce.walkTokens=function(le){ne.walkTokens(le),me&&me(le)}}ge.setOptions(ce)},ge.walkTokens=function(ne,ce){for(var me=K(ne),le;!(le=me()).done;){var ue=le.value;ce(ue);switch(ue.type){case"table":{for(var ye=K(ue.tokens.header),we;!(we=ye()).done;){var Ne=we.value;ge.walkTokens(Ne,ce)}for(var Ie=K(ue.tokens.cells),lt;!(lt=Ie()).done;)for(var Pt=lt.value,Zt=K(Pt),$t;!($t=Zt()).done;){var Kr=$t.value;ge.walkTokens(Kr,ce)}break}case"list":{ge.walkTokens(ue.items,ce);break}default:ue.tokens&&ge.walkTokens(ue.tokens,ce)}}},ge.Parser=Ot,ge.parser=Ot.parse,ge.Renderer=it,ge.TextRenderer=nt,ge.Lexer=je,ge.lexer=je.lex,ge.Tokenizer=Ge,ge.Slugger=bt,ge.parse=ge;var ie=ge;return ie})},F8Dx:function(Pr,dr,He){"use strict";He.r(dr);var ze=He("cWXX"),re=He("/ezw"),z=He("miYZ"),ae=He("tsqr"),K=He("2qtc"),M=He("kLXV"),se=He("k1fw"),q=He("9og8"),X=He("tJVT"),V=He("WmNS"),L=He.n(V),H=He("q1tI"),F=He.n(H),I=He("ErOA"),j=He("32qa"),P=He.n(j),w=He("9Bee"),d=He("GZTG"),p=He("Ty5D"),f=He("9kvl"),T=He("xKgJ"),x=function(k){var C=k.globalSetting,b=k.dispatch,m=k.user,v=k.virtualSpaces,g=Object(p.i)(),_=g.id,O=Object(H.useState)({}),G=Object(X.a)(O,2),Y=G[0],ee=G[1],fe=Object(H.useState)(!0),pe=Object(X.a)(fe,2),xe=pe[0],Ce=pe[1],be=Object(H.useState)(!1),Oe=Object(X.a)(be,2),We=Oe[0],Me=Oe[1],ct=Y.trial_evaluation,Ge=Y.editor,Je=Y.type_description,Xe=Y.content,Ye=Y.core_title,ke=Y.core_subject_title,Z=Y.title;Object(H.useEffect)(function(){A()},[_]);var A=function(){var oe=Object(q.a)(L.a.mark(function $(){var Se;return L.a.wrap(function($e){for(;;)switch($e.prev=$e.next){case 0:return Ce(!0),$e.next=3,Object(I.a)("/api/material_trials/".concat(_,".json"),{method:"get"});case 3:Se=$e.sent,(Se==null?void 0:Se.status)!==-1&&ee(Object(se.a)({},Se==null?void 0:Se.data)),Ce(!1);case 6:case"end":return $e.stop()}},$)}));return function(){return oe.apply(this,arguments)}}(),R=function(){M.a.confirm({title:"\u63D0\u793A",okText:"\u786E\u5B9A",icon:!1,centered:!0,cancelText:"\u53D6\u6D88",content:"\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664",onOk:function(){var $=Object(q.a)(L.a.mark(function je(){var $e;return L.a.wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:return Ke.next=2,Object(I.a)("/api/material_trials/".concat(_,".json"),{method:"delete"});case 2:$e=Ke.sent,($e==null?void 0:$e.status)!==-1&&(ae.b.success("\u5220\u9664\u6210\u529F"),f.d.push("/trial"));case 4:case"end":return Ke.stop()}},je)}));function Se(){return $.apply(this,arguments)}return Se}()})},J=function(){var oe=Object(q.a)(L.a.mark(function $(Se){var je;return L.a.wrap(function(st){for(;;)switch(st.prev=st.next){case 0:return st.next=2,Object(I.a)("/api/material_trials/".concat(_,".json"),{method:"put",body:Se});case 2:je=st.sent,(je==null?void 0:je.status)!==-1&&(ae.b.success("\u66F4\u65B0\u6210\u529F"),A(),Me(!1));case 4:case"end":return st.stop()}},$)}));return function(Se){return oe.apply(this,arguments)}}();return F.a.createElement("section",null,F.a.createElement("div",{className:"".concat(P.a.Bg),style:{width:"100%",height:168,backgroundImage:"url(".concat(He("FEOs"),")")}},F.a.createElement("div",{className:P.a.list,style:{width:1200,height:"100%",margin:"0 auto",position:"relative",color:"#fff"}},F.a.createElement("div",{style:{position:"absolute",top:"14px"}},F.a.createElement("span",{className:"primary-hover",style:{cursor:"pointer"},onClick:function(){f.d.go(-1)}},F.a.createElement("i",{className:"iconfont icon-fanhui2 font12"}),"\u8FD4\u56DE"))),F.a.createElement("div",{className:P.a.main_warp},F.a.createElement("div",{className:P.a.title_warp},F.a.createElement("div",{style:{fontSize:"18px",fontWeight:"600"}},"\u8BD5\u7528\u53CD\u9988\u8BE6\u60C5"),Object(T.w)()&&F.a.createElement("div",{className:P.a.operate},F.a.createElement("div",{className:P.a.btn_update,onClick:function(){return Me(!0)}},F.a.createElement("span",{className:"icon-bianji_Hover"}),"\u7F16\u8F91"),F.a.createElement("div",{className:P.a.btn_del,onClick:function($){return R()}},F.a.createElement("span",{className:"icon-shanchu13"}),"\u5220\u9664"))),F.a.createElement(re.a,{className:"mt20",loading:xe},F.a.createElement("div",{style:{padding:10}},F.a.createElement("div",{style:{display:"flex"}},F.a.createElement("div",{className:P.a.row_info},F.a.createElement("span",null,"\u8BFE\u7A0B\u540D\u79F0\uFF1A"),F.a.createElement("div",null,Ye)),F.a.createElement("div",{className:P.a.row_info},F.a.createElement("span",null,"\u201C101\u8BA1\u5212\u201D\u6838\u5FC3\u8BFE\u7A0B\uFF1A"),F.a.createElement("div",null,ke))),F.a.createElement("div",{style:{display:"flex"}},F.a.createElement("div",{className:P.a.row_info},F.a.createElement("span",null,"\u6559\u6750\u540D\u79F0\uFF1A"),F.a.createElement("div",null,Z)),F.a.createElement("div",{className:P.a.row_info},F.a.createElement("span",null,"\u4E3B\u7F16\uFF1A"),F.a.createElement("div",null,Ge))),F.a.createElement("div",{className:P.a.row_info},F.a.createElement("span",null,"\u5F00\u8BFE\u73ED\u578B\uFF1A"),F.a.createElement("div",null,Je)),F.a.createElement("div",{className:P.a.evaluate},F.a.createElement(w.a,{value:ct||""})),F.a.createElement("div",{className:P.a.row_info},"\u6559\u6750\u5E94\u7528\u60C5\u51B5\uFF1A"),F.a.createElement(w.a,{value:Xe||"\u6682\u65E0\u5185\u5BB9"}))))),F.a.createElement(d.a,{data:Y,visible:We,title:"\u6559\u6750\u53CD\u9988",onCancel:function(){return Me(!1)},onOk:J}))};dr.default=Object(f.a)(function(E){var k=E.virtualSpaces,C=E.globalSetting,b=E.user;return{globalSetting:C,virtualSpaces:k,user:b}})(x)},FEOs:function(Pr,dr,He){Pr.exports=He.p+"static/jcxq.1dd9b6d4.jpg"},GZTG:function(Pr,dr,He){"use strict";var ze=He("2qtc"),re=He("kLXV"),z=He("OaEy"),ae=He("2fM7"),K=He("5NDa"),M=He("5rEg"),se=He("9og8"),q=He("y8nQ"),X=He("Vl3Y"),V=He("tJVT"),L=He("WmNS"),H=He.n(L),F=He("q1tI"),I=He.n(F),j=He("9kvl"),P=He("o/Ze"),w=He.n(P),d=He("phzI"),p=function(T){var x,E=T.visible,k=T.onOk,C=T.onCancel,b=T.title,m=b===void 0?"":b,v=T.coreCurriculum,g=T.dispatch,_=T.data,O=_===void 0?null:_,G=v.CoreSubjects,Y=X.a.useForm(),ee=Object(V.a)(Y,1),fe=ee[0],pe=Object(F.useState)(!1),xe=Object(V.a)(pe,2),Ce=xe[0],be=xe[1],Oe=Object(F.useState)(""),We=Object(V.a)(Oe,2),Me=We[0],ct=We[1];Object(F.useEffect)(function(){g({type:"coreCurriculum/getCoreSubjects",payload:{page:1,limit:100}}),E&&O!==null&&O!==void 0&&O.id&&(fe.setFieldsValue(O),ct(O==null?void 0:O.title))},[E]);var Ge=function(){fe.submit()},Je=function(){C()},Xe=function(){var Ye=Object(se.a)(H.a.mark(function ke(Z){return H.a.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return be(!0),R.next=3,k(Z);case 3:be(!1);case 4:case"end":return R.stop()}},ke)}));return function(Z){return Ye.apply(this,arguments)}}();return I.a.createElement(re.a,{title:"".concat(O!=null&&O.id?"\u7F16\u8F91":"\u65B0\u5EFA").concat(m),visible:E,onOk:Ge,centered:!0,maskClosable:!1,onCancel:Je,confirmLoading:Ce,width:1e3,afterClose:function(){be(!1),ct(""),fe.resetFields()},okText:"\u786E\u8BA4".concat(O!=null&&O.id?"\u4FEE\u6539":"\u65B0\u589E"),cancelText:"\u53D6\u6D88"},I.a.createElement(X.a,{form:fe,colon:!1,labelCol:{span:4},wrapperCol:{span:19},onFinish:Xe,className:w.a.form},I.a.createElement(X.a.Item,{label:"\u8BD5\u7528\u4EBA",name:"trial_user",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BD5\u7528\u4EBA"},{whitespace:!0,message:"\u8BD5\u7528\u4EBA"},{max:50,message:"\u53EA\u80FD\u8F93\u516550\u4E2A\u5B57\u7B26"}]},I.a.createElement(M.a,{maxLength:50,placeholder:"\u8BF7\u8F93\u5165\u8BD5\u7528\u4EBA"})),I.a.createElement(X.a.Item,{label:"\u8BD5\u7528\u5355\u4F4D",name:"trial_unit",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BD5\u7528\u5355\u4F4D"},{whitespace:!0,message:"\u8BD5\u7528\u5355\u4F4D"},{max:100,message:"\u53EA\u80FD\u8F93\u5165100\u4E2A\u5B57\u7B26"}]},I.a.createElement(M.a,{maxLength:100,placeholder:"\u8BF7\u8F93\u5165\u8BD5\u7528\u5355\u4F4D"})),I.a.createElement(X.a.Item,{label:"\u8BFE\u7A0B\u540D\u79F0",name:"core_title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u540D\u79F0"},{whitespace:!0,message:"\u8BFE\u7A0B\u540D\u79F0"},{max:100,message:"\u53EA\u80FD\u8F93\u5165100\u4E2A\u5B57\u7B26"}]},I.a.createElement(M.a,{maxLength:100,placeholder:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u540D\u79F0"})),I.a.createElement(X.a.Item,{label:"\u201C101\u8BA1\u5212\u201D\u6838\u5FC3\u8BFE\u7A0B",name:"core_subject_id",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BFE\u7A0B"}]},I.a.createElement(ae.a,{placeholder:"\u8BF7\u9009\u62E9",getPopupContainer:function(ke){return ke.parentElement}},G==null||((x=G.list)===null||x===void 0)?void 0:x.map(function(Ye,ke){return I.a.createElement(ae.a.Option,{key:ke,value:Ye==null?void 0:Ye.id},Ye==null?void 0:Ye.name)}))),I.a.createElement(X.a.Item,{label:"\u6559\u6750\u540D\u79F0",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6559\u6750\u540D\u79F0"},{whitespace:!0,message:"\u8BF7\u8F93\u5165\u6559\u6750\u540D\u79F0"},{max:100,message:"\u53EA\u80FD\u8F93\u5165100\u4E2A\u5B57\u7B26"}]},I.a.createElement(M.a,{maxLength:100,value:Me,placeholder:"\u8BF7\u8F93\u5165\u6559\u6750\u540D\u79F0",suffix:I.a.createElement("span",null,Me==null?void 0:Me.length,"/100"),onChange:function(ke){return ct(ke.target.value)}})),I.a.createElement(X.a.Item,{label:"\u4E3B\u7F16",name:"editor",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4E3B\u7F16"},{whitespace:!0,message:"\u8BF7\u8F93\u5165\u4E3B\u7F16"},{max:50,message:"\u53EA\u80FD\u8F93\u516550\u4E2A\u5B57\u7B26"}]},I.a.createElement(M.a,{maxLength:50,placeholder:"\u8BF7\u8F93\u5165\u4E3B\u7F16"})),I.a.createElement(X.a.Item,{label:"\u5F00\u73ED\u7C7B\u578B",name:"type_description",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5F00\u73ED\u7C7B\u578B"},{whitespace:!0,message:"\u5F00\u73ED\u7C7B\u578B"},{max:100,message:"\u53EA\u80FD\u8F93\u5165100\u4E2A\u5B57\u7B26"}]},I.a.createElement(M.a,{maxLength:100,placeholder:"\u8BF7\u8F93\u5165\u5F00\u73ED\u7C7B\u578B"})),I.a.createElement(X.a.Item,{label:"\u8BD5\u7528\u8BC4\u4EF7",name:"trial_evaluation",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BD5\u7528\u8BC4\u4EF7"}]},I.a.createElement(M.a.TextArea,{rows:4,placeholder:"\u8BF7\u8F93\u5165\u8BD5\u7528\u8BC4\u4EF7",maxLength:500})),I.a.createElement(X.a.Item,{name:"content",label:"\u6559\u6750\u5E94\u7528\u60C5\u51B5",rules:[{max:5e3,message:"\u6559\u6750\u5E94\u7528\u60C5\u51B5\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"}]},I.a.createElement(d.a,{defaultvalue:(O==null?void 0:O.content)||"",style:{height:"300px"}}))))};dr.a=Object(j.a)(function(f){var T=f.dispatch,x=f.coreCurriculum;return{dispatch:T,coreCurriculum:x}})(p)},Gytx:function(Pr,dr){Pr.exports=function(ze,re,z,ae){var K=z?z.call(ae,ze,re):void 0;if(K!==void 0)return!!K;if(ze===re)return!0;if(typeof ze!="object"||!ze||typeof re!="object"||!re)return!1;var M=Object.keys(ze),se=Object.keys(re);if(M.length!==se.length)return!1;for(var q=Object.prototype.hasOwnProperty.bind(re),X=0;X<M.length;X++){var V=M[X];if(!q(V))return!1;var L=ze[V],H=re[V];if(K=z?z.call(ae,L,H,V):void 0,K===!1||K===void 0&&L!==H)return!1}return!0}},LdHM:function(Pr,dr,He){"use strict";He.d(dr,"b",function(){return f}),He.d(dr,"a",function(){return x});var ze=He("1OyB"),re=He("vuIU"),z=He("Ji7U"),ae=He("LK+K"),K=He("q1tI"),M=He("rePB"),se=He("Ff2n"),q=He("ODXe"),X=He("4IlW"),V=He("bX4T"),L=He("YrtM"),H=He("TSYQ"),F=He.n(H),I=He("+nKL"),j=He("8OUc"),P=function(be,Oe){var We=be.prefixCls,Me=be.id,ct=be.flattenOptions,Ge=be.childrenAsData,Je=be.values,Xe=be.searchValue,Ye=be.multiple,ke=be.defaultActiveFirstOption,Z=be.height,A=be.itemHeight,R=be.notFoundContent,J=be.open,oe=be.menuItemSelectedIcon,$=be.virtual,Se=be.onSelect,je=be.onToggleOpen,$e=be.onActiveValue,st=be.onScroll,Ke=be.onMouseEnter,it="".concat(We,"-item"),nt=Object(L.a)(function(){return ct},[J,ct],function(ie,ne){return ne[0]&&ie[1]!==ne[1]}),bt=K.useRef(null),_t=function(ne){ne.preventDefault()},Lt=function(ne){bt.current&&bt.current.scrollTo({index:ne})},Ot=function(ne){for(var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,me=nt.length,le=0;le<me;le+=1){var ue=(ne+le*ce+me)%me,ye=nt[ue],we=ye.group,Ne=ye.data;if(!we&&!Ne.disabled)return ue}return-1},xt=K.useState(function(){return Ot(0)}),jt=Object(q.a)(xt,2),Nt=jt[0],mt=jt[1],Ht=function(ne){mt(ne);var ce=nt[ne];if(!ce){$e(null,-1);return}$e(ce.data.value,ne)};K.useEffect(function(){Ht(ke!==!1?Ot(0):-1)},[nt.length,Xe]),K.useEffect(function(){var ie=setTimeout(function(){if(!Ye&&J&&Je.size===1){var ne=Array.from(Je)[0],ce=nt.findIndex(function(me){var le=me.data;return le.value===ne});Ht(ce),Lt(ce)}});return function(){return clearTimeout(ie)}},[J]);var Vt=function(ne){ne!==void 0&&Se(ne,{selected:!Je.has(ne)}),Ye||je(!1)};if(K.useImperativeHandle(Oe,function(){return{onKeyDown:function(ne){var ce=ne.which;switch(ce){case X.a.UP:case X.a.DOWN:{var me=0;if(ce===X.a.UP?me=-1:ce===X.a.DOWN&&(me=1),me!==0){var le=Ot(Nt+me,me);Lt(le),Ht(le)}break}case X.a.ENTER:{var ue=nt[Nt];ue&&!ue.data.disabled?Vt(ue.data.value):Vt(void 0),J&&ne.preventDefault();break}case X.a.ESC:je(!1)}},onKeyUp:function(){},scrollTo:function(ne){Lt(ne)}}}),nt.length===0)return K.createElement("div",{role:"listbox",id:"".concat(Me,"_list"),className:"".concat(it,"-empty"),onMouseDown:_t},R);function ge(ie){var ne=nt[ie];if(!ne)return null;var ce=ne.data||{},me=ce.value,le=ce.label,ue=ce.children,ye=Object(V.a)(ce,!0),we=Ge?ue:le;return ne?K.createElement("div",Object.assign({"aria-label":typeof we=="string"?we:null},ye,{key:ie,role:"option",id:"".concat(Me,"_list_").concat(ie),"aria-selected":Je.has(me)}),me):null}return K.createElement(K.Fragment,null,K.createElement("div",{role:"listbox",id:"".concat(Me,"_list"),style:{height:0,width:0,overflow:"hidden"}},ge(Nt-1),ge(Nt),ge(Nt+1)),K.createElement(I.a,{itemKey:"key",ref:bt,data:nt,height:Z,itemHeight:A,fullHeight:!1,onMouseDown:_t,onScroll:st,virtual:$,onMouseEnter:Ke},function(ie,ne){var ce,me=ie.group,le=ie.groupOption,ue=ie.data,ye=ue.label,we=ue.key;if(me)return K.createElement("div",{className:F()(it,"".concat(it,"-group"))},ye!==void 0?ye:we);var Ne=ue.disabled,Ie=ue.value,lt=ue.title,Pt=ue.children,Zt=ue.style,$t=ue.className,Kr=Object(se.a)(ue,["disabled","value","title","children","style","className"]),Jt=Je.has(Ie),Yt="".concat(it,"-option"),jn=F()(it,Yt,$t,(ce={},Object(M.a)(ce,"".concat(Yt,"-grouped"),le),Object(M.a)(ce,"".concat(Yt,"-active"),Nt===ne&&!Ne),Object(M.a)(ce,"".concat(Yt,"-disabled"),Ne),Object(M.a)(ce,"".concat(Yt,"-selected"),Jt),ce)),Qr=Ge?Pt:ye,Kn=!oe||typeof oe=="function"||Jt;return K.createElement("div",Object.assign({},Kr,{"aria-selected":Jt,className:jn,title:lt,onMouseMove:function(){if(Nt===ne||Ne)return;Ht(ne)},onClick:function(){Ne||Vt(Ie)},style:Zt}),K.createElement("div",{className:"".concat(Yt,"-content")},Qr||Ie),K.isValidElement(oe)||Jt,Kn&&K.createElement(j.a,{className:"".concat(it,"-option-state"),customizeIcon:oe,customizeIconProps:{isSelected:Jt}},Jt?"\u2713":null))}))},w=K.forwardRef(P);w.displayName="OptionList";var d=w,p=function(){return null};p.isSelectOption=!0;var f=p,T=function(){return null};T.isSelectOptGroup=!0;var x=T,E=He("VTBJ"),k=He("Zm9Q");function C(Ce){var be=Ce.key,Oe=Ce.props,We=Oe.children,Me=Oe.value,ct=Object(se.a)(Oe,["children","value"]);return Object(E.a)({key:be,value:Me!==void 0?Me:be,children:We},ct)}function b(Ce){var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(k.a)(Ce).map(function(Oe,We){if(!K.isValidElement(Oe)||!Oe.type)return null;var Me=Oe.type.isSelectOptGroup,ct=Oe.key,Ge=Oe.props,Je=Ge.children,Xe=Object(se.a)(Ge,["children"]);return be||!Me?C(Oe):Object(E.a)(Object(E.a)({key:"__RC_SELECT_GRP__".concat(ct===null?We:ct,"__"),label:ct},Xe),{},{options:b(Je)})}).filter(function(Oe){return Oe})}var m=He("2Qr1"),v=He("qNPg"),g=He("U8pU"),_=He("Kwbf"),O=He("WKfj");function G(Ce){var be=Ce.mode,Oe=Ce.options,We=Ce.children,Me=Ce.backfill,ct=Ce.allowClear,Ge=Ce.placeholder,Je=Ce.getInputElement,Xe=Ce.showSearch,Ye=Ce.onSearch,ke=Ce.defaultOpen,Z=Ce.autoFocus,A=Ce.labelInValue,R=Ce.value,J=Ce.inputValue,oe=Ce.optionLabelProp,$=be==="multiple"||be==="tags",Se=Xe!==void 0?Xe:$||be==="combobox",je=Oe||b(We);if(Object(_.a)(be!=="tags"||je.every(function(it){return!it.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),be==="tags"||be==="combobox"){var $e=je.some(function(it){return it.options?it.options.some(function(nt){return typeof("value"in nt?nt.value:nt.key)=="number"}):typeof("value"in it?it.value:it.key)=="number"});Object(_.a)(!$e,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(_.a)(be!=="combobox"||!oe,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(_.a)(be==="combobox"||!Me,"`backfill` only works with `combobox` mode."),Object(_.a)(be==="combobox"||!Je,"`getInputElement` only work with `combobox` mode."),Object(_.b)(be!=="combobox"||!Je||!ct||!Ge,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ye&&!Se&&be!=="combobox"&&be!=="tags"&&Object(_.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(_.b)(!ke||Z,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),R!=null){var st=Object(O.d)(R);Object(_.a)(!A||st.every(function(it){return Object(g.a)(it)==="object"&&("key"in it||"value"in it)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(_.a)(!$||Array.isArray(R),"`value` should be array when `mode` is `multiple` or `tags`")}if(We){var Ke=null;Object(k.a)(We).some(function(it){if(!K.isValidElement(it)||!it.type)return!1;var nt=it.type;if(nt.isSelectOption)return!1;if(nt.isSelectOptGroup){var bt=Object(k.a)(it.props.children).every(function(_t){return!K.isValidElement(_t)||!it.type||_t.type.isSelectOption?!0:(Ke=_t.type,!1)});return!bt}return Ke=nt,!0}),Ke&&Object(_.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ke.displayName||Ke.name||Ke,"`.")),Object(_.a)(J===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var Y=G,ee=Object(v.a)({prefixCls:"rc-select",components:{optionList:d},convertChildrenToData:b,flattenOptions:m.d,getLabeledValue:m.e,filterOptions:m.b,isValueDisabled:m.g,findValueOption:m.c,warningProps:Y,fillOptionsWithMissingValue:m.a}),fe=function(Ce){Object(z.a)(Oe,Ce);var be=Object(ae.a)(Oe);function Oe(){var We;return Object(ze.a)(this,Oe),We=be.apply(this,arguments),We.selectRef=K.createRef(),We.focus=function(){We.selectRef.current.focus()},We.blur=function(){We.selectRef.current.blur()},We}return Object(re.a)(Oe,[{key:"render",value:function(){return K.createElement(ee,Object.assign({ref:this.selectRef},this.props))}}]),Oe}(K.Component);fe.Option=f,fe.OptGroup=x;var pe=fe,xe=dr.c=pe},OLES:function(Pr,dr,He){"use strict";var ze=He("U8pU"),re=He("VTBJ"),z=He("Ff2n"),ae=He("q1tI"),K=He("uciX"),M=He("7ixt"),se=function(F){var I=F.overlay,j=F.prefixCls,P=F.id,w=F.overlayInnerStyle;return ae.createElement("div",{className:"".concat(j,"-inner"),id:P,role:"tooltip",style:w},typeof I=="function"?I():I)},q=se,X=function(F,I){var j=F.overlayClassName,P=F.trigger,w=P===void 0?["hover"]:P,d=F.mouseEnterDelay,p=d===void 0?0:d,f=F.mouseLeaveDelay,T=f===void 0?.1:f,x=F.overlayStyle,E=F.prefixCls,k=E===void 0?"rc-tooltip":E,C=F.children,b=F.onVisibleChange,m=F.afterVisibleChange,v=F.transitionName,g=F.animation,_=F.placement,O=_===void 0?"right":_,G=F.align,Y=G===void 0?{}:G,ee=F.destroyTooltipOnHide,fe=ee===void 0?!1:ee,pe=F.defaultVisible,xe=F.getTooltipContainer,Ce=F.overlayInnerStyle,be=Object(z.a)(F,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Oe=Object(ae.useRef)(null);Object(ae.useImperativeHandle)(I,function(){return Oe.current});var We=Object(re.a)({},be);"visible"in F&&(We.popupVisible=F.visible);var Me=function(){var Ye=F.arrowContent,ke=Ye===void 0?null:Ye,Z=F.overlay,A=F.id;return[ae.createElement("div",{className:"".concat(k,"-arrow"),key:"arrow"},ke),ae.createElement(q,{key:"content",prefixCls:k,id:A,overlay:Z,overlayInnerStyle:Ce})]},ct=!1,Ge=!1;if(typeof fe=="boolean")ct=fe;else if(fe&&Object(ze.a)(fe)==="object"){var Je=fe.keepParent;ct=Je===!0,Ge=Je===!1}return ae.createElement(K.a,Object.assign({popupClassName:j,prefixCls:k,popup:Me,action:w,builtinPlacements:M.a,popupPlacement:O,ref:Oe,popupAlign:Y,getPopupContainer:xe,onPopupVisibleChange:b,afterPopupVisibleChange:m,popupTransitionName:v,popupAnimation:g,defaultPopupVisible:pe,destroyPopupOnHide:ct,autoDestroy:Ge,mouseLeaveDelay:T,popupStyle:x,mouseEnterDelay:p},We),C)},V=Object(ae.forwardRef)(X),L=dr.a=V},SJMd:function(Pr,dr){/**
|
|
|
* @license
|
|
|
* Copyright (C) 2006 Google Inc.
|
|
|
*
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
* You may obtain a copy of the License at
|
|
|
*
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
*
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
* See the License for the specific language governing permissions and
|
|
|
* limitations under the License.
|
|
|
*/var He,ze,re,z=!1,ae,K;window.PR_SHOULD_USE_CONTINUATION=!0;var M,se;(function(){var q=window,X=["break,continue,do,else,for,if,return,while"],V=[X,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],L=[V,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],H=[L,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],F=[L,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],I=[L,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],j="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",P=[L,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],w="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",d=[X,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],p=[X,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],f=[X,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],T=[H,I,F,P,w,d,p,f],x=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,E="str",k="kwd",C="com",b="typ",m="lit",v="pun",g="pln",_="tag",O="dec",G="src",Y="atn",ee="atv",fe="nocode",pe="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function xe(Se){for(var je=0,$e=!1,st=!1,Ke=0,it=Se.length;Ke<it;++Ke){var nt=Se[Ke];if(nt.ignoreCase)st=!0;else if(/[a-z]/i.test(nt.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){$e=!0,st=!1;break}}var bt={b:8,t:9,n:10,v:11,f:12,r:13};function _t(Nt){var mt=Nt.charCodeAt(0);if(mt!==92)return mt;var Ht=Nt.charAt(1);return mt=bt[Ht],mt||("0"<=Ht&&Ht<="7"?parseInt(Nt.substring(1),8):Ht==="u"||Ht==="x"?parseInt(Nt.substring(2),16):Nt.charCodeAt(1))}function Lt(Nt){if(Nt<32)return(Nt<16?"\\x0":"\\x")+Nt.toString(16);var mt=String.fromCharCode(Nt);return mt==="\\"||mt==="-"||mt==="]"||mt==="^"?"\\"+mt:mt}function Ot(Nt){var mt=Nt.substring(1,Nt.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),Ht=[],Vt=mt[0]==="^",ge=["["];Vt&&ge.push("^");for(var ie=Vt?1:0,ne=mt.length;ie<ne;++ie){var ce=mt[ie];if(/\\[bdsw]/i.test(ce))ge.push(ce);else{var me=_t(ce),le;ie+2<ne&&mt[ie+1]==="-"?(le=_t(mt[ie+2]),ie+=2):le=me,Ht.push([me,le]),le<65||me>122||(le<65||me>90||Ht.push([Math.max(65,me)|32,Math.min(le,90)|32]),le<97||me>122||Ht.push([Math.max(97,me)&~32,Math.min(le,122)&~32]))}}Ht.sort(function(Ne,Ie){return Ne[0]-Ie[0]||Ie[1]-Ne[1]});for(var ue=[],ye=[],ie=0;ie<Ht.length;++ie){var we=Ht[ie];we[0]<=ye[1]+1?ye[1]=Math.max(ye[1],we[1]):ue.push(ye=we)}for(var ie=0;ie<ue.length;++ie){var we=ue[ie];ge.push(Lt(we[0])),we[1]>we[0]&&(we[1]+1>we[0]&&ge.push("-"),ge.push(Lt(we[1])))}return ge.push("]"),ge.join("")}function xt(Nt){for(var mt=Nt.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),Ht=mt.length,Vt=[],ge=0,ie=0;ge<Ht;++ge){var ne=mt[ge];if(ne==="(")++ie;else if(ne.charAt(0)==="\\"){var ce=+ne.substring(1);ce&&(ce<=ie?Vt[ce]=-1:mt[ge]=Lt(ce))}}for(var ge=1;ge<Vt.length;++ge)Vt[ge]===-1&&(Vt[ge]=++je);for(var ge=0,ie=0;ge<Ht;++ge){var ne=mt[ge];if(ne==="(")++ie,Vt[ie]||(mt[ge]="(?:");else if(ne.charAt(0)==="\\"){var ce=+ne.substring(1);ce&&ce<=ie&&(mt[ge]="\\"+Vt[ce])}}for(var ge=0;ge<Ht;++ge)mt[ge]==="^"&&mt[ge+1]!=="^"&&(mt[ge]="");if(Nt.ignoreCase&&$e)for(var ge=0;ge<Ht;++ge){var ne=mt[ge],me=ne.charAt(0);ne.length>=2&&me==="["?mt[ge]=Ot(ne):me!=="\\"&&(mt[ge]=ne.replace(/[a-zA-Z]/g,function(ye){var we=ye.charCodeAt(0);return"["+String.fromCharCode(we&~32,we|32)+"]"}))}return mt.join("")}for(var jt=[],Ke=0,it=Se.length;Ke<it;++Ke){var nt=Se[Ke];if(nt.global||nt.multiline)throw new Error(""+nt);jt.push("(?:"+xt(nt)+")")}return new RegExp(jt.join("|"),st?"gi":"g")}function Ce(Se,je){var $e=/(?:^|\s)nocode(?:\s|$)/,st=[],Ke=0,it=[],nt=0;function bt(_t){var Lt=_t.nodeType;if(Lt==1){if($e.test(_t.className))return;for(var Ot=_t.firstChild;Ot;Ot=Ot.nextSibling)bt(Ot);var xt=_t.nodeName.toLowerCase();(xt==="br"||xt==="li")&&(st[nt]=`
|
|
|
`,it[nt<<1]=Ke++,it[nt++<<1|1]=_t)}else if(Lt==3||Lt==4){var jt=_t.nodeValue;jt.length&&(je?jt=jt.replace(/\r\n?/g,`
|
|
|
`):jt=jt.replace(/[ \t\r\n]+/g," "),st[nt]=jt,it[nt<<1]=Ke,Ke+=jt.length,it[nt++<<1|1]=_t)}}return bt(Se),{sourceCode:st.join("").replace(/\n$/,""),spans:it}}function be(Se,je,$e,st,Ke){if(!$e)return;var it={sourceNode:Se,pre:1,langExtension:null,numberLines:null,sourceCode:$e,spans:null,basePos:je,decorations:null};st(it),Ke.push.apply(Ke,it.decorations)}var Oe=/\S/;function We(Se){for(var je=void 0,$e=Se.firstChild;$e;$e=$e.nextSibling){var st=$e.nodeType;je=st===1?je?Se:$e:st===3&&Oe.test($e.nodeValue)?Se:je}return je===Se?void 0:je}function Me(Se,je){var $e={},st;(function(){for(var nt=Se.concat(je),bt=[],_t={},Lt=0,Ot=nt.length;Lt<Ot;++Lt){var xt=nt[Lt],jt=xt[3];if(jt)for(var Nt=jt.length;--Nt>=0;)$e[jt.charAt(Nt)]=xt;var mt=xt[1],Ht=""+mt;_t.hasOwnProperty(Ht)||(bt.push(mt),_t[Ht]=null)}bt.push(/[\0-\uffff]/),st=xe(bt)})();var Ke=je.length,it=function(nt){for(var bt=nt.sourceCode,_t=nt.basePos,Lt=nt.sourceNode,Ot=[_t,g],xt=0,jt=bt.match(st)||[],Nt={},mt=0,Ht=jt.length;mt<Ht;++mt){var Vt=jt[mt],ge=Nt[Vt],ie=void 0,ne;if(typeof ge=="string")ne=!1;else{var ce=$e[Vt.charAt(0)];if(ce)ie=Vt.match(ce[1]),ge=ce[0];else{for(var me=0;me<Ke;++me)if(ce=je[me],ie=Vt.match(ce[1]),ie){ge=ce[0];break}ie||(ge=g)}ne=ge.length>=5&&ge.substring(0,5)==="lang-",ne&&!(ie&&typeof ie[1]=="string")&&(ne=!1,ge=G),ne||(Nt[Vt]=ge)}var le=xt;if(xt+=Vt.length,!ne)Ot.push(_t+le,ge);else{var ue=ie[1],ye=Vt.indexOf(ue),we=ye+ue.length;ie[2]&&(we=Vt.length-ie[2].length,ye=we-ue.length);var Ne=ge.substring(5);be(Lt,_t+le,Vt.substring(0,ye),it,Ot),be(Lt,_t+le+ye,ue,Z(Ne,ue),Ot),be(Lt,_t+le+we,Vt.substring(we),it,Ot)}}nt.decorations=Ot};return it}function ct(Se){var je=[],$e=[];Se.tripleQuotedStrings?je.push([E,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Se.multiLineStrings?je.push([E,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):je.push([E,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Se.verbatimStrings&&$e.push([E,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var st=Se.hashComments;st&&(Se.cStyleComments?(st>1?je.push([C,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):je.push([C,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),$e.push([E,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):je.push([C,/^#[^\r\n]*/,null,"#"])),Se.cStyleComments&&($e.push([C,/^\/\/[^\r\n]*/,null]),$e.push([C,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ke=Se.regexLiterals;if(Ke){var it=Ke>1?"":`
|
|
|
\r`,nt=it?".":"[\\S\\s]",bt="/(?=[^/*"+it+"])(?:[^/\\x5B\\x5C"+it+"]|\\x5C"+nt+"|\\x5B(?:[^\\x5C\\x5D"+it+"]|\\x5C"+nt+")*(?:\\x5D|$))+/";$e.push(["lang-regex",RegExp("^"+pe+"("+bt+")")])}var _t=Se.types;_t&&$e.push([b,_t]);var Lt=(""+Se.keywords).replace(/^ | $/g,"");Lt.length&&$e.push([k,new RegExp("^(?:"+Lt.replace(/[\s,]+/g,"|")+")\\b"),null]),je.push([g,/^\s+/,null,` \r
|
|
|
\xA0`]);var Ot="^.[^\\s\\w.$@'\"`/\\\\]*";return Se.regexLiterals&&(Ot+="(?!s*/)"),$e.push([m,/^@[a-z_$][a-z_$@0-9]*/i,null],[b,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[g,/^[a-z_$][a-z_$@0-9]*/i,null],[m,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[g,/^\\[\s\S]?/,null],[v,new RegExp(Ot),null]),Me(je,$e)}var Ge=ct({keywords:T,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Je(Se,je,$e){for(var st=/(?:^|\s)nocode(?:\s|$)/,Ke=/\r\n?|\n/,it=Se.ownerDocument,nt=it.createElement("li");Se.firstChild;)nt.appendChild(Se.firstChild);var bt=[nt];function _t(mt){var Ht=mt.nodeType;if(Ht==1&&!st.test(mt.className))if(mt.nodeName==="br")Lt(mt),mt.parentNode&&mt.parentNode.removeChild(mt);else for(var Vt=mt.firstChild;Vt;Vt=Vt.nextSibling)_t(Vt);else if((Ht==3||Ht==4)&&$e){var ge=mt.nodeValue,ie=ge.match(Ke);if(ie){var ne=ge.substring(0,ie.index);mt.nodeValue=ne;var ce=ge.substring(ie.index+ie[0].length);if(ce){var me=mt.parentNode;me.insertBefore(it.createTextNode(ce),mt.nextSibling)}Lt(mt),ne||mt.parentNode.removeChild(mt)}}}function Lt(mt){for(;!mt.nextSibling;)if(mt=mt.parentNode,!mt)return;function Ht(ie,ne){var ce=ne?ie.cloneNode(!1):ie,me=ie.parentNode;if(me){var le=Ht(me,1),ue=ie.nextSibling;le.appendChild(ce);for(var ye=ue;ye;ye=ue)ue=ye.nextSibling,le.appendChild(ye)}return ce}for(var Vt=Ht(mt.nextSibling,0),ge;(ge=Vt.parentNode)&&ge.nodeType===1;)Vt=ge;bt.push(Vt)}for(var Ot=0;Ot<bt.length;++Ot)_t(bt[Ot]);je===(je|0)&&bt[0].setAttribute("value",je);var xt=it.createElement("ol");xt.className="linenums";for(var jt=Math.max(0,je-1|0)||0,Ot=0,Nt=bt.length;Ot<Nt;++Ot)nt=bt[Ot],nt.className="L"+(Ot+jt)%10,nt.firstChild||nt.appendChild(it.createTextNode("\xA0")),xt.appendChild(nt);Se.appendChild(xt)}function Xe(Se){var je=/\bMSIE\s(\d+)/.exec(navigator.userAgent);je=je&&+je[1]<=8;var $e=/\n/g,st=Se.sourceCode,Ke=st.length,it=0,nt=Se.spans,bt=nt.length,_t=0,Lt=Se.decorations,Ot=Lt.length,xt=0;Lt[Ot]=Ke;var jt,Nt;for(Nt=jt=0;Nt<Ot;)Lt[Nt]!==Lt[Nt+2]?(Lt[jt++]=Lt[Nt++],Lt[jt++]=Lt[Nt++]):Nt+=2;for(Ot=jt,Nt=jt=0;Nt<Ot;){for(var mt=Lt[Nt],Ht=Lt[Nt+1],Vt=Nt+2;Vt+2<=Ot&&Lt[Vt+1]===Ht;)Vt+=2;Lt[jt++]=mt,Lt[jt++]=Ht,Nt=Vt}Ot=Lt.length=jt;var ge=Se.sourceNode,ie="";ge&&(ie=ge.style.display,ge.style.display="none");try{for(var ne=null;_t<bt;){var ce=nt[_t],me=nt[_t+2]||Ke,le=Lt[xt+2]||Ke,Vt=Math.min(me,le),ue=nt[_t+1],ye;if(ue.nodeType!==1&&(ye=st.substring(it,Vt))){je&&(ye=ye.replace($e,"\r")),ue.nodeValue=ye;var we=ue.ownerDocument,Ne=we.createElement("span");Ne.className=Lt[xt+1];var Ie=ue.parentNode;Ie.replaceChild(Ne,ue),Ne.appendChild(ue),it<me&&(nt[_t+1]=ue=we.createTextNode(st.substring(Vt,me)),Ie.insertBefore(ue,Ne.nextSibling))}it=Vt,it>=me&&(_t+=2),it>=le&&(xt+=2)}}finally{ge&&(ge.style.display=ie)}}var Ye={};function ke(Se,je){for(var $e=je.length;--$e>=0;){var st=je[$e];Ye.hasOwnProperty(st)?q.console&&console.warn("cannot override language handler %s",st):Ye[st]=Se}}function Z(Se,je){return Se&&Ye.hasOwnProperty(Se)||(Se=/^\s*</.test(je)?"default-markup":"default-code"),Ye[Se]}ke(Ge,["default-code"]),ke(Me([],[[g,/^[^<?]+/],[O,/^<!\w[^>]*(?:>|$)/],[C,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[v,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ke(Me([[g,/^[\s]+/,null,` \r
|
|
|
`],[ee,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[_,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[Y,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[v,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),ke(Me([],[[ee,/^[\s\S]+/]]),["uq.val"]),ke(ct({keywords:H,hashComments:!0,cStyleComments:!0,types:x}),["c","cc","cpp","cxx","cyc","m"]),ke(ct({keywords:"null,true,false"}),["json"]),ke(ct({keywords:I,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:x}),["cs"]),ke(ct({keywords:F,cStyleComments:!0}),["java"]),ke(ct({keywords:f,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ke(ct({keywords:d,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ke(ct({keywords:w,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ke(ct({keywords:p,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ke(ct({keywords:P,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ke(ct({keywords:j,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ke(Me([],[[E,/^[\s\S]+/]]),["regex"]);function A(Se){var je=Se.langExtension;try{var $e=Ce(Se.sourceNode,Se.pre),st=$e.sourceCode;Se.sourceCode=st,Se.spans=$e.spans,Se.basePos=0,Z(je,st)(Se),Xe(Se)}catch(Ke){q.console&&console.log(Ke&&Ke.stack||Ke)}}function R(Se,je,$e){var st=$e||!1,Ke=je||null,it=document.createElement("div");it.innerHTML="<pre>"+Se+"</pre>",it=it.firstChild,st&&Je(it,st,!0);var nt={langExtension:Ke,numberLines:st,sourceNode:it,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return A(nt),it.innerHTML}function J(Se,je){var $e=je||document.body,st=$e.ownerDocument||document;function Ke(ce){return $e.getElementsByTagName(ce)}for(var it=[Ke("pre"),Ke("code"),Ke("xmp")],nt=[],bt=0;bt<it.length;++bt)for(var _t=0,Lt=it[bt].length;_t<Lt;++_t)nt.push(it[bt][_t]);it=null;var Ot=Date;Ot.now||(Ot={now:function(){return+new Date}});var xt=0,jt=/\blang(?:uage)?-([\w.]+)(?!\S)/,Nt=/\bprettyprint\b/,mt=/\bprettyprinted\b/,Ht=/pre|xmp/i,Vt=/^code$/i,ge=/^(?:pre|code|xmp)$/i,ie={};function ne(){for(var ce=q.PR_SHOULD_USE_CONTINUATION?Ot.now()+250:Infinity;xt<nt.length&&Ot.now()<ce;xt++){for(var me=nt[xt],le=ie,ue=me;ue=ue.previousSibling;){var ye=ue.nodeType,we=(ye===7||ye===8)&&ue.nodeValue;if(we?!/^\??prettify\b/.test(we):ye!==3||/\S/.test(ue.nodeValue))break;if(we){le={},we.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Dn,Br,eo){le[Br]=eo});break}}var Ne=me.className;if((le!==ie||Nt.test(Ne))&&!mt.test(Ne)){for(var Ie=!1,lt=me.parentNode;lt;lt=lt.parentNode){var Pt=lt.tagName;if(ge.test(Pt)&<.className&&Nt.test(lt.className)){Ie=!0;break}}if(!Ie){me.className+=" prettyprinted";var Zt=le.lang;if(!Zt){Zt=Ne.match(jt);var $t;!Zt&&($t=We(me))&&Vt.test($t.tagName)&&(Zt=$t.className.match(jt)),Zt&&(Zt=Zt[1])}var Kr;if(Ht.test(me.tagName))Kr=1;else{var Jt=me.currentStyle,Yt=st.defaultView,jn=Jt?Jt.whiteSpace:Yt&&Yt.getComputedStyle?Yt.getComputedStyle(me,null).getPropertyValue("white-space"):0;Kr=jn&&jn.substring(0,3)==="pre"}var Qr=le.linenums;(Qr=Qr==="true"||+Qr)||(Qr=Ne.match(/\blinenums\b(?::(\d+))?/),Qr=Qr?Qr[1]&&Qr[1].length?+Qr[1]:!0:!1),Qr&&Je(me,Qr,Kr);var Kn={langExtension:Zt,sourceNode:me,numberLines:Qr,pre:Kr,sourceCode:null,basePos:null,spans:null,decorations:null};A(Kn)}}}xt<nt.length?q.setTimeout(ne,250):typeof Se=="function"&&Se()}ne()}var oe=q.PR={createSimpleLexer:Me,registerLangHandler:ke,sourceDecorator:ct,PR_ATTRIB_NAME:Y,PR_ATTRIB_VALUE:ee,PR_COMMENT:C,PR_DECLARATION:O,PR_KEYWORD:k,PR_LITERAL:m,PR_NOCODE:fe,PR_PLAIN:g,PR_PUNCTUATION:v,PR_SOURCE:G,PR_STRING:E,PR_TAG:_,PR_TYPE:b,prettyPrintOne:z?q.prettyPrintOne=R:M=R,prettyPrint:se=z?q.prettyPrint=J:se=J},$=q.define;typeof $=="function"&&$.amd&&$("google-code-prettify",[],function(){return oe})})()},STEk:function(Pr,dr,He){"use strict";He.d(dr,"a",function(){return ke});/*! *****************************************************************************
|
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
purpose with or without fee is hereby granted.
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
|
***************************************************************************** */var ze=function(Z,A){return(ze=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,J){R.__proto__=J}||function(R,J){for(var oe in J)Object.prototype.hasOwnProperty.call(J,oe)&&(R[oe]=J[oe])})(Z,A)};function re(Z,A){function R(){this.constructor=Z}ze(Z,A),Z.prototype=A===null?Object.create(A):(R.prototype=A.prototype,new R)}function z(Z,A,R,J){return new(R||(R=Promise))(function(oe,$){function Se(st){try{$e(J.next(st))}catch(Ke){$(Ke)}}function je(st){try{$e(J.throw(st))}catch(Ke){$(Ke)}}function $e(st){var Ke;st.done?oe(st.value):(Ke=st.value,Ke instanceof R?Ke:new R(function(it){it(Ke)})).then(Se,je)}$e((J=J.apply(Z,A||[])).next())})}function ae(Z,A){var R,J,oe,$,Se={label:0,sent:function(){if(1&oe[0])throw oe[1];return oe[1]},trys:[],ops:[]};return $={next:je(0),throw:je(1),return:je(2)},typeof Symbol=="function"&&($[Symbol.iterator]=function(){return this}),$;function je($e){return function(st){return function(Ke){if(R)throw new TypeError("Generator is already executing.");for(;Se;)try{if(R=1,J&&(oe=2&Ke[0]?J.return:Ke[0]?J.throw||((oe=J.return)&&oe.call(J),0):J.next)&&!(oe=oe.call(J,Ke[1])).done)return oe;switch(J=0,oe&&(Ke=[2&Ke[0],oe.value]),Ke[0]){case 0:case 1:oe=Ke;break;case 4:return Se.label++,{value:Ke[1],done:!1};case 5:Se.label++,J=Ke[1],Ke=[0];continue;case 7:Ke=Se.ops.pop(),Se.trys.pop();continue;default:if(!(oe=Se.trys,(oe=oe.length>0&&oe[oe.length-1])||Ke[0]!==6&&Ke[0]!==2)){Se=0;continue}if(Ke[0]===3&&(!oe||Ke[1]>oe[0]&&Ke[1]<oe[3])){Se.label=Ke[1];break}if(Ke[0]===6&&Se.label<oe[1]){Se.label=oe[1],oe=Ke;break}if(oe&&Se.label<oe[2]){Se.label=oe[2],Se.ops.push(Ke);break}oe[2]&&Se.ops.pop(),Se.trys.pop();continue}Ke=A.call(Z,Se)}catch(it){Ke=[6,it],J=0}finally{R=oe=0}if(5&Ke[0])throw Ke[1];return{value:Ke[0]?Ke[1]:void 0,done:!0}}([$e,st])}}}function K(){for(var Z=0,A=0,R=arguments.length;A<R;A++)Z+=arguments[A].length;var J=Array(Z),oe=0;for(A=0;A<R;A++)for(var $=arguments[A],Se=0,je=$.length;Se<je;Se++,oe++)J[oe]=$[Se];return J}var M=function(){function Z(){}return Z.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Z.setAttributes=function(A,R){for(var J=0,oe=R;J<oe.length;J++){var $=oe[J],Se=$[0],je=$[1];A.setAttribute(Se,je)}},Z.createRect=function(A,R,J){var oe=document.createElementNS("http://www.w3.org/2000/svg","rect");return oe.setAttribute("width",A.toString()),oe.setAttribute("height",R.toString()),J&&Z.setAttributes(oe,J),oe},Z.createLine=function(A,R,J,oe,$){var Se=document.createElementNS("http://www.w3.org/2000/svg","line");return Se.setAttribute("x1",A.toString()),Se.setAttribute("y1",R.toString()),Se.setAttribute("x2",J.toString()),Se.setAttribute("y2",oe.toString()),$&&Z.setAttributes(Se,$),Se},Z.createPolygon=function(A,R){var J=document.createElementNS("http://www.w3.org/2000/svg","polygon");return J.setAttribute("points",A),R&&Z.setAttributes(J,R),J},Z.createCircle=function(A,R){var J=document.createElementNS("http://www.w3.org/2000/svg","circle");return J.setAttribute("cx",(A/2).toString()),J.setAttribute("cy",(A/2).toString()),J.setAttribute("r",A.toString()),R&&Z.setAttributes(J,R),J},Z.createEllipse=function(A,R,J){var oe=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return oe.setAttribute("cx",(A/2).toString()),oe.setAttribute("cy",(R/2).toString()),oe.setAttribute("rx",(A/2).toString()),oe.setAttribute("ry",(R/2).toString()),J&&Z.setAttributes(oe,J),oe},Z.createGroup=function(A){var R=document.createElementNS("http://www.w3.org/2000/svg","g");return A&&Z.setAttributes(R,A),R},Z.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Z.createMarker=function(A,R,J,oe,$,Se,je){var $e=document.createElementNS("http://www.w3.org/2000/svg","marker");return Z.setAttributes($e,[["id",A],["orient",R],["markerWidth",J.toString()],["markerHeight",oe.toString()],["refX",$.toString()],["refY",Se.toString()]]),$e.appendChild(je),$e},Z.createText=function(A){var R=document.createElementNS("http://www.w3.org/2000/svg","text");return R.setAttribute("x","0"),R.setAttribute("y","0"),A&&Z.setAttributes(R,A),R},Z.createTSpan=function(A,R){var J=document.createElementNS("http://www.w3.org/2000/svg","tspan");return J.textContent=A,R&&Z.setAttributes(J,R),J},Z.createImage=function(A){var R=document.createElementNS("http://www.w3.org/2000/svg","image");return A&&Z.setAttributes(R,A),R},Z.createPoint=function(A,R){var J=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return J.x=A,J.y=R,J},Z.createPath=function(A,R){var J=document.createElementNS("http://www.w3.org/2000/svg","path");return J.setAttribute("d",A),R&&Z.setAttributes(J,R),J},Z}(),se=function(){function Z(){}return Z.addKey=function(A){Z.key=A},Object.defineProperty(Z,"isLicensed",{get:function(){return!!Z.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Z.key)},enumerable:!1,configurable:!0}),Z}(),q=function(){function Z(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Z.prototype.rasterize=function(A,R,J){var oe=this;return new Promise(function($){var Se=J!==void 0?J:document.createElement("canvas");A===null&&(oe.markersOnly=!0,oe.naturalSize=!1);var je=document.createElementNS("http://www.w3.org/2000/svg","svg");je.setAttribute("xmlns","http://www.w3.org/2000/svg"),je.setAttribute("width",R.width.baseVal.valueAsString),je.setAttribute("height",R.height.baseVal.valueAsString),je.setAttribute("viewBox","0 0 "+R.viewBox.baseVal.width.toString()+" "+R.viewBox.baseVal.height.toString()),je.innerHTML=R.innerHTML,oe.naturalSize===!0?(je.width.baseVal.value=A.naturalWidth,je.height.baseVal.value=A.naturalHeight):oe.width!==void 0&&oe.height!==void 0&&(je.width.baseVal.value=oe.width,je.height.baseVal.value=oe.height),Se.width=je.width.baseVal.value,Se.height=je.height.baseVal.value;var $e=je.outerHTML,st=Se.getContext("2d");oe.markersOnly!==!0&&st.drawImage(A,0,0,Se.width,Se.height);var Ke=window.URL,it=new Image(Se.width,Se.height);it.setAttribute("crossOrigin","anonymous");var nt=new Blob([$e],{type:"image/svg+xml"}),bt=Ke.createObjectURL(nt);it.onload=function(){st.drawImage(it,0,0),Ke.revokeObjectURL(bt);var _t=Se.toDataURL(oe.imageType,oe.imageQuality);$(_t)},it.src=bt})},Z}(),X=function(){},V=function(){function Z(A){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+A+"_"}return Object.defineProperty(Z.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),Z.prototype.addClass=function(A){return this.styleSheet===void 0&&this.addStyleSheet(),A.name=""+this.classNamePrefix+A.localName,this.classes.push(A),this.styleSheet.sheet.insertRule("."+A.name+" {"+A.style+"}",this.styleSheet.sheet.cssRules.length),A},Z.prototype.addRule=function(A){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(A),this.styleSheet.sheet.insertRule(A.selector+" {"+A.style+"}",this.styleSheet.sheet.cssRules.length)},Z.prototype.addStyleSheet=function(){var A;this.styleSheet=document.createElement("style"),((A=this.styleSheetRoot)!==null&&A!==void 0?A:document.head).appendChild(this.styleSheet),this.addRule(new L("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new L("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`)),this.addRule(new L("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
|
from {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)),this.addClass(new H("fade_in",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
|
`)),this.addClass(new H("fade_out",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
|
`))},Z.prototype.removeStyleSheet=function(){var A;this.styleSheet&&(((A=this.styleSheetRoot)!==null&&A!==void 0?A:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Z}(),L=function(Z,A){this.selector=Z,this.style=A},H=function(Z,A){this.localName=Z,this.style=A},F=function(){function Z(A,R,J,oe,$){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=A,this.displayMode=R,this.markerItems=J,this.uiStyleSettings=oe,this.styles=$,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return Z.prototype.show=function(A){var R=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=A,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var J=document.createElement("div");J.className=this.toolbarBlockStyleClass.name,J.style.whiteSpace="nowrap",this.uiContainer.appendChild(J),this.addActionButton(J,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(J,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(J,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(J,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(J,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(J,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(J,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(J,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function($){var Se=document.createElement("div");Se.className=""+R.toolbarButtonStyleClass.name,Se.setAttribute("data-type-name",$.typeName),Se.innerHTML=$.icon,Se.addEventListener("click",function(){R.markerToolbarButtonClicked(Se,$)}),R.buttons.push(Se),R.markerButtons.push(Se)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var oe=document.createElement("div");oe.className=this.toolbarBlockStyleClass.name,oe.style.whiteSpace="nowrap",oe.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(oe),this.addActionButton(oe,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(oe,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},Z.prototype.addButtonClickListener=function(A){this.buttonClickListeners.push(A)},Z.prototype.removeButtonClickListener=function(A){this.buttonClickListeners.indexOf(A)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(A),1)},Z.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Z.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var A=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var R=0;R<this.markerButtons.length;R++)R<A||R===A&&this.markerButtons.length-1===A?this.markerButtonBlock.appendChild(this.markerButtons[R]):(R===A&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[R]))}},Z.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},Z.prototype.resetButtonStyles=function(){var A=this;this.buttons.forEach(function(R){R.className=R.className.replace(A.uiStyleSettings.toolbarButtonStyleColorsClassName?A.uiStyleSettings.toolbarButtonStyleColorsClassName:A.toolbarButtonStyleColorsClass.name,"").trim(),R.className=R.className.replace(A.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?A.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:A.toolbarActiveButtonStyleColorsClass.name,"").trim(),R.className+=" "+(A.uiStyleSettings.toolbarButtonStyleColorsClassName?A.uiStyleSettings.toolbarButtonStyleColorsClassName:A.toolbarButtonStyleColorsClass.name)})},Z.prototype.addActionButton=function(A,R,J){var oe=this,$=document.createElement("div");switch($.className=""+this.toolbarButtonStyleClass.name,$.innerHTML=R,$.setAttribute("data-action",J),$.addEventListener("click",function(){oe.actionToolbarButtonClicked($,J)}),J){case"select":$.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":$.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":$.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":$.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":$.style.fill=this.uiStyleSettings.closeButtonColor}A.appendChild($),this.buttons.push($)},Z.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new H("toolbar",`
|
|
|
width: 100%;
|
|
|
flex-shrink: 0;
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
justify-content: space-between;
|
|
|
height: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
|
box-sizing: content-box;
|
|
|
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
overflow: hidden;
|
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new H("toolbar_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new H("toolbar-block",`
|
|
|
display: inline-block;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new H("toolbar-overflow-block",`
|
|
|
position: absolute;
|
|
|
top: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
|
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
|
|
|
z-index: 10;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new H("toolbar-overflow-block_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`));var A=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new H("toolbar_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*A)+`px;
|
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*A)+`px;
|
|
|
padding: `+A+`px;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new H("toolbar_button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new H("toolbar_active_button",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new L("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`)),this.styles.addRule(new L("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`))},Z.prototype.markerToolbarButtonClicked=function(A,R){this.setActiveButton(A),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(J){return J("marker",R)}),this.markerButtonOverflowBlock.style.display="none"},Z.prototype.actionToolbarButtonClicked=function(A,R){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(J){return J("action",R)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Z.prototype.setActiveButton=function(A){this.resetButtonStyles(),A.className=A.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),A.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Z.prototype.setActiveMarkerButton=function(A){var R=this.markerButtons.find(function(J){return J.getAttribute("data-type-name")===A});R&&this.setActiveButton(R)},Z.prototype.setCurrentMarker=function(A){var R=this;this.currentMarker=A,this.buttons.filter(function(J){return/delete|notes/.test(J.getAttribute("data-action"))}).forEach(function(J){R.currentMarker===void 0?(J.style.fillOpacity="0.4",J.style.pointerEvents="none"):(J.style.fillOpacity="1",J.style.pointerEvents="all")})},Z}(),I=function(){function Z(A,R,J,oe){this.panels=[],this.panelButtons=[],this.markerjsContainer=A,this.displayMode=R,this.uiStyleSettings=J,this.styles=oe,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Z.prototype.addStyles=function(){var A;this.toolboxStyleClass=this.styles.addClass(new H("toolbox",`
|
|
|
width: 100%;
|
|
|
flex-shrink: 0;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
font-family: sans-serif;
|
|
|
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
|
box-sizing: content-box;
|
|
|
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
|
|
|
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
overflow: hidden;
|
|
|
`)),this.toolboxStyleColorsClass=this.styles.addClass(new H("toolbox_colors",`
|
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
|
`));var R=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new H("toolbox-button-row",`
|
|
|
display: flex;
|
|
|
cursor: default;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new H("toolbox-button-row_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new H("toolbox-panel-row",`
|
|
|
display: flex;
|
|
|
`+(this.displayMode==="inline"?"position: absolute;":"")+`
|
|
|
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
|
cursor: default;
|
|
|
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
|
|
|
`+(this.displayMode==="inline"?"width: 100%;":"")+`
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new H("toolbox-panel-row_colors",`
|
|
|
background-color: `+((A=this.uiStyleSettings.toolboxBackgroundColor)!==null&&A!==void 0?A:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new H("toolbox_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*R)+`px;
|
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*R)+`px;
|
|
|
padding: `+R+`px;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new H("toolbox-button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new H("toolbox-active-button_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.styles.addRule(new L("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new L("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`))},Z.prototype.show=function(A){var R;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=A,this.uiContainer.className=this.toolboxStyleClass.name+" "+((R=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&R!==void 0?R:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Z.prototype.setPanelButtons=function(A){var R,J,oe=this;this.panels=A,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((R=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&R!==void 0?R:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((J=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&J!==void 0?J:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function($){var Se;$.uiStyleSettings=oe.uiStyleSettings;var je=document.createElement("div");je.className=oe.toolboxButtonStyleClass.name+" "+((Se=oe.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Se!==void 0?Se:oe.toolboxButtonStyleColorsClass.name),je.innerHTML=$.icon,je.title=$.title,je.addEventListener("click",function(){oe.panelButtonClick($)}),oe.panelButtons.push(je),oe.buttonRow.appendChild(je)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Z.prototype.panelButtonClick=function(A){var R=this,J=-1;if(A!==this.activePanel){J=this.panels.indexOf(A),this.panelRow.innerHTML="";var oe=A.getUi();oe.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(oe),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=A}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){R.displayMode==="inline"?R.panelRow.style.display="none":R.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function($,Se){var je,$e;$.className=R.toolboxButtonStyleClass.name+" "+(Se===J?""+((je=R.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&je!==void 0?je:R.toolboxActiveButtonStyleColorsClass.name):""+(($e=R.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&$e!==void 0?$e:R.toolboxButtonStyleColorsClass.name))})},Z}(),j=function(Z,A){this.title=Z,this.icon=A},P=function(Z){function A(R,J,oe,$){var Se=Z.call(this,R,$||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return Se.colors=[],Se.addTransparent=!1,Se.colorBoxes=[],Se.colors=J,Se.currentColor=oe,Se.setCurrentColor=Se.setCurrentColor.bind(Se),Se.getColorBox=Se.getColorBox.bind(Se),Se}return re(A,Z),A.prototype.getUi=function(){var R=this,J=document.createElement("div");return J.style.overflow="hidden",J.style.whiteSpace="nowrap",this.colors.forEach(function(oe){var $=R.getColorBox(oe);J.appendChild($),R.colorBoxes.push($)}),J},A.prototype.getColorBox=function(R){var J=this,oe=this.uiStyleSettings.toolbarHeight/4,$=this.uiStyleSettings.toolbarHeight-oe,Se=document.createElement("div");Se.style.display="inline-block",Se.style.boxSizing="content-box",Se.style.width=$-2+"px",Se.style.height=$-2+"px",Se.style.padding="1px",Se.style.marginRight="2px",Se.style.marginBottom="2px",Se.style.borderWidth="2px",Se.style.borderStyle="solid",Se.style.borderRadius=($+2)/2+"px",Se.style.borderColor=R===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Se.addEventListener("click",function(){J.setCurrentColor(R,Se)});var je=document.createElement("div");return je.style.display="inline-block",je.style.width=$-2+"px",je.style.height=$-2+"px",je.style.backgroundColor=R,je.style.borderRadius=$/2+"px",R==="transparent"&&(je.style.fill=this.uiStyleSettings.toolboxAccentColor,je.innerHTML=`<svg viewBox="0 0 24 24">
|
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
|
</svg>`),Se.appendChild(je),Se},A.prototype.setCurrentColor=function(R,J){var oe=this;this.currentColor=R,this.colorBoxes.forEach(function($){$.style.borderColor=$===J?oe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(R)},A}(j),w=function(){function Z(A,R,J){this._state="new",this._isSelected=!1,this._container=A,this._overlayContainer=R,this.globalSettings=J,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Z.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Z.prototype.ownsTarget=function(A){return!1},Object.defineProperty(Z.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Z.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Z.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Z.prototype.pointerDown=function(A,R){},Z.prototype.dblClick=function(A,R){},Z.prototype.manipulate=function(A){},Z.prototype.pointerUp=function(A){this.stateChanged()},Z.prototype.dispose=function(){},Z.prototype.addMarkerVisualToContainer=function(A){this.container.childNodes.length>0?this.container.insertBefore(A,this.container.childNodes[0]):this.container.appendChild(A)},Z.prototype.getState=function(){return{typeName:Z.typeName,state:this.state,notes:this.notes}},Z.prototype.restoreState=function(A){this._state=A.state,this.notes=A.notes},Z.prototype.scale=function(A,R){},Z.prototype.colorChanged=function(A){this.onColorChanged&&this.onColorChanged(A),this.stateChanged()},Z.prototype.fillColorChanged=function(A){this.onFillColorChanged&&this.onFillColorChanged(A),this.stateChanged()},Z.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var A=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),A.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(A)&&this.onStateChanged(this)}},Z.typeName="MarkerBase",Z}(),d=function(){function Z(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Z.prototype.findGripByVisual=function(A){return this.topLeft.ownsTarget(A)?this.topLeft:this.topCenter.ownsTarget(A)?this.topCenter:this.topRight.ownsTarget(A)?this.topRight:this.centerLeft.ownsTarget(A)?this.centerLeft:this.centerRight.ownsTarget(A)?this.centerRight:this.bottomLeft.ownsTarget(A)?this.bottomLeft:this.bottomCenter.ownsTarget(A)?this.bottomCenter:this.bottomRight.ownsTarget(A)?this.bottomRight:void 0},Z}(),p=function(){function Z(){this.GRIP_SIZE=10,this.visual=M.createGroup(),this.visual.appendChild(M.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(M.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Z.prototype.ownsTarget=function(A){return A===this.visual||A===this.visual.childNodes[0]||A===this.visual.childNodes[1]},Z}(),f=function(){function Z(){}return Z.toITransformMatrix=function(A){return{a:A.a,b:A.b,c:A.c,d:A.d,e:A.e,f:A.f}},Z.toSVGMatrix=function(A,R){return A.a=R.a,A.b=R.b,A.c=R.c,A.d=R.d,A.e=R.e,A.f=R.f,A},Z}(),T=function(Z){function A(R,J,oe){var $=Z.call(this,R,J,oe)||this;return $.left=0,$.top=0,$.width=0,$.height=0,$.defaultSize={x:50,y:20},$.offsetX=0,$.offsetY=0,$.rotationAngle=0,$.CB_DISTANCE=10,$._suppressMarkerCreateEvent=!1,$.container.transform.baseVal.appendItem(M.createTransform()),$.setupControlBox(),$}return re(A,Z),Object.defineProperty(A.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"visual",{get:function(){return this._visual},set:function(R){this._visual=R;var J=M.createTransform();this._visual.transform.baseVal.appendItem(J)},enumerable:!1,configurable:!0}),A.prototype.ownsTarget=function(R){return!!Z.prototype.ownsTarget.call(this,R)||!!(this.controlGrips.findGripByVisual(R)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(R))},A.prototype.pointerDown=function(R,J){Z.prototype.pointerDown.call(this,R,J),this.state==="new"&&(this.left=R.x,this.top=R.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var oe=this.unrotatePoint(R);if(this.manipulationStartX=oe.x,this.manipulationStartY=oe.y,this.offsetX=oe.x-this.left,this.offsetY=oe.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(J),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(J)){this.activeGrip=this.rotatorGrip;var $=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=$.x-this.width/2,this.top=$.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Se=this.container.transform.baseVal.getItem(0);Se.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Se,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},A.prototype.pointerUp=function(R){var J=this.state;Z.prototype.pointerUp.call(this,R),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(R),this._state="select",J==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},A.prototype.moveVisual=function(R){this.visual.style.transform="translate("+R.x+"px, "+R.y+"px)"},A.prototype.manipulate=function(R){var J=this.unrotatePoint(R);this.state==="creating"?this.resize(R):this.state==="move"?(this.left=this.manipulationStartLeft+(J.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(J.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(J):this.state==="rotate"&&this.rotate(R)},A.prototype.resize=function(R){var J=this.manipulationStartLeft,oe=this.manipulationStartWidth,$=this.manipulationStartTop,Se=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:J=this.manipulationStartLeft+R.x-this.manipulationStartX,oe=this.manipulationStartWidth+this.manipulationStartLeft-J;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:oe=this.manipulationStartWidth+R.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:$=this.manipulationStartTop+R.y-this.manipulationStartY,Se=this.manipulationStartHeight+this.manipulationStartTop-$;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Se=this.manipulationStartHeight+R.y-this.manipulationStartY}oe>=0?(this.left=J,this.width=oe):(this.left=J+oe,this.width=-oe),Se>=0?(this.top=$,this.height=Se):(this.top=$+Se,this.height=-Se),this.setSize()},A.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},A.prototype.rotate=function(R){if(Math.abs(R.x-this.centerX)>.1){var J=Math.sign(R.x-this.centerX);this.rotationAngle=180*Math.atan((R.y-this.centerY)/(R.x-this.centerX))/Math.PI+90*J,this.applyRotation()}},A.prototype.applyRotation=function(){var R=this.container.transform.baseVal.getItem(0);R.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(R,0)},A.prototype.rotatePoint=function(R){if(this.rotationAngle===0)return R;var J=this.container.getCTM(),oe=M.createPoint(R.x,R.y);return{x:(oe=oe.matrixTransform(J)).x,y:oe.y}},A.prototype.unrotatePoint=function(R){if(this.rotationAngle===0)return R;var J=this.container.getCTM();J=J.inverse();var oe=M.createPoint(R.x,R.y);return{x:(oe=oe.matrixTransform(J)).x,y:oe.y}},A.prototype.select=function(){Z.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},A.prototype.deselect=function(){Z.prototype.deselect.call(this),this.controlBox.style.display="none"},A.prototype.setupControlBox=function(){this.controlBox=M.createGroup();var R=M.createTransform();R.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(R),this.container.appendChild(this.controlBox),this.controlRect=M.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=M.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new d,this.addControlGrips(),this.controlBox.style.display="none"},A.prototype.adjustControlBox=function(){var R=this.controlBox.transform.baseVal.getItem(0);R.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(R,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},A.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},A.prototype.createGrip=function(){var R=new p;return R.visual.transform.baseVal.appendItem(M.createTransform()),this.controlBox.appendChild(R.visual),R},A.prototype.positionGrips=function(){var R=this.controlGrips.topLeft.GRIP_SIZE,J=-R/2,oe=J,$=(this.width+this.CB_DISTANCE)/2-R/2,Se=(this.height+this.CB_DISTANCE)/2-R/2,je=this.height+this.CB_DISTANCE-R/2,$e=this.width+this.CB_DISTANCE-R/2;this.positionGrip(this.controlGrips.topLeft.visual,J,oe),this.positionGrip(this.controlGrips.topCenter.visual,$,oe),this.positionGrip(this.controlGrips.topRight.visual,$e,oe),this.positionGrip(this.controlGrips.centerLeft.visual,J,Se),this.positionGrip(this.controlGrips.centerRight.visual,$e,Se),this.positionGrip(this.controlGrips.bottomLeft.visual,J,je),this.positionGrip(this.controlGrips.bottomCenter.visual,$,je),this.positionGrip(this.controlGrips.bottomRight.visual,$e,je),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,$,oe-3*this.CB_DISTANCE)},A.prototype.positionGrip=function(R,J,oe){var $=R.transform.baseVal.getItem(0);$.setTranslate(J,oe),R.transform.baseVal.replaceItem($,0)},A.prototype.hideControlBox=function(){this.controlBox.style.display="none"},A.prototype.showControlBox=function(){this.controlBox.style.display=""},A.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:f.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:f.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Z.prototype.getState.call(this))},A.prototype.restoreState=function(R){Z.prototype.restoreState.call(this,R);var J=R;this.left=J.left,this.top=J.top,this.width=J.width,this.height=J.height,this.rotationAngle=J.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(f.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,J.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(f.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,J.containerTransformMatrix))},A.prototype.scale=function(R,J){Z.prototype.scale.call(this,R,J);var oe=this.rotatePoint({x:this.left,y:this.top}),$=this.unrotatePoint({x:oe.x*R,y:oe.y*J});this.left=$.x,this.top=$.y,this.width=this.width*R,this.height=this.height*J,this.adjustControlBox()},A}(w),x=function(Z){function A(R,J,oe){var $=Z.call(this,R,J,oe)||this;return $.fillColor="transparent",$.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.opacity=1,$.setStrokeColor=$.setStrokeColor.bind($),$.setFillColor=$.setFillColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.createVisual=$.createVisual.bind($),$}return re(A,Z),A.prototype.ownsTarget=function(R){return!(!Z.prototype.ownsTarget.call(this,R)&&R!==this.visual)},A.prototype.createVisual=function(){this.visual=M.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},A.prototype.pointerDown=function(R,J){Z.prototype.pointerDown.call(this,R,J),this.state==="new"&&(this.createVisual(),this.moveVisual(R),this._state="creating")},A.prototype.manipulate=function(R){Z.prototype.manipulate.call(this,R)},A.prototype.resize=function(R){Z.prototype.resize.call(this,R),this.setSize()},A.prototype.setSize=function(){Z.prototype.setSize.call(this),M.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},A.prototype.pointerUp=function(R){Z.prototype.pointerUp.call(this,R),this.setSize()},A.prototype.setStrokeColor=function(R){this.strokeColor=R,this.visual&&M.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(R),this.stateChanged()},A.prototype.setFillColor=function(R){this.fillColor=R,this.visual&&M.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},A.prototype.setStrokeWidth=function(R){this.strokeWidth=R,this.visual&&M.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},A.prototype.setStrokeDasharray=function(R){this.strokeDasharray=R,this.visual&&M.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},A.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Z.prototype.getState.call(this))},A.prototype.restoreState=function(R){var J=R;this.fillColor=J.fillColor,this.strokeColor=J.strokeColor,this.strokeWidth=J.strokeWidth,this.strokeDasharray=J.strokeDasharray,this.opacity=J.opacity,this.createVisual(),Z.prototype.restoreState.call(this,R),this.setSize()},A.prototype.scale=function(R,J){Z.prototype.scale.call(this,R,J),this.setSize()},A.title="Rectangle marker",A}(T),E=function(Z){function A(R,J,oe,$){var Se=Z.call(this,R,$||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Se.widths=[],Se.widthBoxes=[],Se.widths=J,Se.currentWidth=oe,Se.setCurrentWidth=Se.setCurrentWidth.bind(Se),Se}return re(A,Z),A.prototype.getUi=function(){var R=this,J=document.createElement("div");return J.style.display="flex",J.style.overflow="hidden",J.style.flexGrow="2",this.widths.forEach(function(oe){var $=document.createElement("div");$.style.display="flex",$.style.flexGrow="2",$.style.alignItems="center",$.style.justifyContent="space-between",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.borderColor=oe===R.currentWidth?R.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){R.setCurrentWidth(oe,$)}),J.appendChild($);var Se=document.createElement("div");Se.innerText=oe.toString(),Se.style.marginRight="5px",$.appendChild(Se);var je=document.createElement("div");je.style.minHeight="20px",je.style.flexGrow="2",je.style.display="flex",je.style.alignItems="center";var $e=document.createElement("hr");$e.style.minWidth="20px",$e.style.border="0px",$e.style.borderTop=oe+"px solid "+R.uiStyleSettings.toolboxColor,$e.style.flexGrow="2",je.appendChild($e),$.appendChild(je),R.widthBoxes.push($)}),J},A.prototype.setCurrentWidth=function(R,J){var oe=this;this.currentWidth=R,this.widthBoxes.forEach(function($){$.style.borderColor=$===J?oe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},A}(j),k=function(Z){function A(R,J,oe,$){var Se=Z.call(this,R,$||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return Se.styles=[],Se.styleBoxes=[],Se.styles=J,Se.currentStyle=oe,Se.setCurrentStyle=Se.setCurrentStyle.bind(Se),Se}return re(A,Z),A.prototype.getUi=function(){var R=this,J=document.createElement("div");return J.style.display="flex",J.style.overflow="hidden",J.style.flexGrow="2",this.styles.forEach(function(oe){var $=document.createElement("div");$.style.display="flex",$.style.alignItems="center",$.style.justifyContent="space-between",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.overflow="hidden",$.style.maxWidth=100/R.styles.length-5+"%",$.style.borderColor=oe===R.currentStyle?R.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){R.setCurrentStyle(oe,$)}),J.appendChild($);var Se=document.createElement("div");Se.style.minHeight="20px",Se.style.flexGrow="2",Se.style.overflow="hidden";var je=`<svg width="100" height="20">
|
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+R.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(oe!==""?'stroke-dasharray="'+oe+'"':"")+` />
|
|
|
</svg>`;Se.innerHTML=je,$.appendChild(Se),R.styleBoxes.push($)}),J},A.prototype.setCurrentStyle=function(R,J){var oe=this;this.currentStyle=R,this.styleBoxes.forEach(function($){$.style.borderColor=$===J?oe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},A}(j),C=function(Z){function A(R,J,oe){var $=Z.call(this,R,J,oe)||this;return $.strokeColor=oe.defaultColor,$.strokeWidth=oe.defaultStrokeWidth,$.strokeDasharray=oe.defaultStrokeDasharray,$.strokePanel=new P("Line color",oe.defaultColorSet,oe.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.strokeWidthPanel=new E("Line width",oe.defaultStrokeWidths,oe.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new k("Line style",oe.defaultStrokeDasharrays,oe.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$}return re(A,Z),Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var R=Z.prototype.getState.call(this);return R.typeName=A.typeName,R},A.typeName="FrameMarker",A.title="Frame marker",A.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',A}(x),b=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},m=function(Z){function A(R,J,oe){var $=Z.call(this,R,J,oe)||this;return $.x1=0,$.y1=0,$.x2=0,$.y2=0,$.defaultLength=50,$.manipulationStartX=0,$.manipulationStartY=0,$.manipulationStartX1=0,$.manipulationStartY1=0,$.manipulationStartX2=0,$.manipulationStartY2=0,$.setupControlBox(),$}return re(A,Z),A.prototype.ownsTarget=function(R){return!!Z.prototype.ownsTarget.call(this,R)||!(!this.grip1.ownsTarget(R)&&!this.grip2.ownsTarget(R))},A.prototype.pointerDown=function(R,J){Z.prototype.pointerDown.call(this,R,J),this.manipulationStartX=R.x,this.manipulationStartY=R.y,this.state==="new"&&(this.x1=R.x,this.y1=R.y,this.x2=R.x,this.y2=R.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(J)?this.activeGrip=this.grip1:this.grip2.ownsTarget(J)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},A.prototype.pointerUp=function(R){var J=this.state;Z.prototype.pointerUp.call(this,R),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(R),this._state="select",J==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},A.prototype.adjustVisual=function(){},A.prototype.manipulate=function(R){this.state==="creating"?this.resize(R):this.state==="move"?(this.x1=this.manipulationStartX1+R.x-this.manipulationStartX,this.y1=this.manipulationStartY1+R.y-this.manipulationStartY,this.x2=this.manipulationStartX2+R.x-this.manipulationStartX,this.y2=this.manipulationStartY2+R.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(R)},A.prototype.resize=function(R){switch(this.activeGrip){case this.grip1:this.x1=R.x,this.y1=R.y;break;case this.grip2:case void 0:this.x2=R.x,this.y2=R.y}this.adjustVisual(),this.adjustControlBox()},A.prototype.select=function(){Z.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},A.prototype.deselect=function(){Z.prototype.deselect.call(this),this.controlBox.style.display="none"},A.prototype.setupControlBox=function(){this.controlBox=M.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},A.prototype.adjustControlBox=function(){this.positionGrips()},A.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},A.prototype.createGrip=function(){var R=new p;return R.visual.transform.baseVal.appendItem(M.createTransform()),this.controlBox.appendChild(R.visual),R},A.prototype.positionGrips=function(){var R=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-R/2,this.y1-R/2),this.positionGrip(this.grip2.visual,this.x2-R/2,this.y2-R/2)},A.prototype.positionGrip=function(R,J,oe){var $=R.transform.baseVal.getItem(0);$.setTranslate(J,oe),R.transform.baseVal.replaceItem($,0)},A.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Z.prototype.getState.call(this))},A.prototype.restoreState=function(R){Z.prototype.restoreState.call(this,R);var J=R;this.x1=J.x1,this.y1=J.y1,this.x2=J.x2,this.y2=J.y2},A.prototype.scale=function(R,J){Z.prototype.scale.call(this,R,J),this.x1=this.x1*R,this.y1=this.y1*J,this.x2=this.x2*R,this.y2=this.y2*J,this.adjustVisual(),this.adjustControlBox()},A}(w),v=function(Z){function A(R,J,oe){var $=Z.call(this,R,J,oe)||this;return $.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.setStrokeColor=$.setStrokeColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.strokeColor=oe.defaultColor,$.strokeWidth=oe.defaultStrokeWidth,$.strokeDasharray=oe.defaultStrokeDasharray,$.strokePanel=new P("Line color",oe.defaultColorSet,oe.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.strokeWidthPanel=new E("Line width",oe.defaultStrokeWidths,oe.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new k("Line style",oe.defaultStrokeDasharrays,oe.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$}return re(A,Z),A.prototype.ownsTarget=function(R){return!(!Z.prototype.ownsTarget.call(this,R)&&R!==this.visual&&R!==this.selectorLine&&R!==this.visibleLine)},A.prototype.createVisual=function(){this.visual=M.createGroup(),this.selectorLine=M.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=M.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},A.prototype.pointerDown=function(R,J){Z.prototype.pointerDown.call(this,R,J),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},A.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),M.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),M.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),M.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},A.prototype.setStrokeColor=function(R){this.strokeColor=R,this.adjustVisual(),this.colorChanged(R)},A.prototype.setStrokeWidth=function(R){this.strokeWidth=R,this.adjustVisual()},A.prototype.setStrokeDasharray=function(R){this.strokeDasharray=R,this.adjustVisual(),this.stateChanged()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var R=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Z.prototype.getState.call(this));return R.typeName=A.typeName,R},A.prototype.restoreState=function(R){Z.prototype.restoreState.call(this,R);var J=R;this.strokeColor=J.strokeColor,this.strokeWidth=J.strokeWidth,this.strokeDasharray=J.strokeDasharray,this.createVisual(),this.adjustVisual()},A.typeName="LineMarker",A.title="Line marker",A.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',A}(m),g=function(Z){function A(R,J,oe,$){var Se=Z.call(this,R,$||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return Se.fonts=[],Se.fontBoxes=[],Se.fonts=J,Se.currentFont=oe,Se.setCurrentFont=Se.setCurrentFont.bind(Se),Se}return re(A,Z),A.prototype.getUi=function(){var R=this,J=document.createElement("div");return J.style.overflow="hidden",J.style.flexGrow="2",this.fonts.forEach(function(oe){var $=document.createElement("div");$.style.display="inline-block",$.style.alignItems="center",$.style.justifyContent="space-between",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.overflow="hidden",$.style.maxWidth=100/R.fonts.length-5+"%",$.style.borderColor=oe===R.currentFont?R.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){R.setCurrentFont(oe,$)}),J.appendChild($);var Se=document.createElement("div");Se.style.display="flex",Se.style.minHeight="20px",Se.style.flexGrow="2",Se.style.fontFamily=oe,Se.style.overflow="hidden";var je=document.createElement("div");je.style.whiteSpace="nowrap",je.style.overflow="hidden",je.style.textOverflow="ellipsis",je.innerHTML="The quick brown fox jumps over the lazy dog",Se.appendChild(je),$.appendChild(Se),R.fontBoxes.push($)}),J},A.prototype.setCurrentFont=function(R,J){var oe=this;this.currentFont=R,this.fontBoxes.forEach(function($){$.style.borderColor=$===J?oe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},A}(j),_=function(Z){function A(R,J,oe){var $=Z.call(this,R,J,oe)||this;return $.color="transparent",$.padding=5,$.DEFAULT_TEXT="your text here",$.text=$.DEFAULT_TEXT,$.isMoved=!1,$.color=oe.defaultColor,$.fontFamily=oe.defaultFontFamily,$.defaultSize={x:100,y:30},$.setColor=$.setColor.bind($),$.setFont=$.setFont.bind($),$.renderText=$.renderText.bind($),$.sizeText=$.sizeText.bind($),$.textEditDivClicked=$.textEditDivClicked.bind($),$.showTextEditor=$.showTextEditor.bind($),$.setSize=$.setSize.bind($),$.positionTextEditor=$.positionTextEditor.bind($),$.colorPanel=new P("Color",oe.defaultColorSet,oe.defaultColor),$.colorPanel.onColorChanged=$.setColor,$.fontFamilyPanel=new g("Font",oe.defaultFontFamilies,oe.defaultFontFamily),$.fontFamilyPanel.onFontChanged=$.setFont,$}return re(A,Z),A.prototype.ownsTarget=function(R){if(Z.prototype.ownsTarget.call(this,R)||R===this.visual||R===this.textElement||R===this.bgRectangle)return!0;var J=!1;return this.textElement.childNodes.forEach(function(oe){oe===R&&(J=!0)}),J},A.prototype.createVisual=function(){this.visual=M.createGroup(),this.bgRectangle=M.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=M.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(M.createTransform()),this.textElement.transform.baseVal.appendItem(M.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},A.prototype.pointerDown=function(R,J){Z.prototype.pointerDown.call(this,R,J),this.isMoved=!1,this.pointerDownPoint=R,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(R),this._state="creating")},A.prototype.renderText=function(){var R=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(J){R.textElement.appendChild(M.createTSpan(J.trim()===""?" ":J.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},A.prototype.getTextScale=function(){var R=this.textElement.getBBox(),J=1;if(R.width>0&&R.height>0){var oe=(1*this.width-this.width*this.padding*2/100)/R.width,$=(1*this.height-this.height*this.padding*2/100)/R.height;J=Math.min(oe,$)}return J},A.prototype.getTextPosition=function(R){var J=this.textElement.getBBox(),oe=0,$=0;return J.width>0&&J.height>0&&(oe=(this.width-J.width*R)/2,$=this.height/2-J.height*R/2),{x:oe,y:$}},A.prototype.sizeText=function(){var R=this.textElement.getBBox(),J=this.getTextScale(),oe=this.getTextPosition(J);oe.y-=R.y*J,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+oe.x+"px, "+oe.y+"px) scale("+J+", "+J+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(oe.x,oe.y),this.textElement.transform.baseVal.getItem(1).setScale(J,J))},A.prototype.manipulate=function(R){Z.prototype.manipulate.call(this,R),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(R.x-this.pointerDownPoint.x)>5||Math.abs(R.y-this.pointerDownPoint.y)>5)},A.prototype.resize=function(R){Z.prototype.resize.call(this,R),this.isMoved=!0,this.setSize(),this.sizeText()},A.prototype.setSize=function(){Z.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(M.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),M.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},A.prototype.pointerUp=function(R){var J=this.state;J==="creating"&&(this._suppressMarkerCreateEvent=!0),Z.prototype.pointerUp.call(this,R),this.setSize(),(J==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},A.prototype.showTextEditor=function(){var R=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(J){J.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var J=Number.parseFloat(R.textEditor.style.fontSize);R.textEditor.clientWidth>=Number.parseInt(R.textEditor.style.maxWidth)&&J>.9;)J-=.1,R.textEditor.style.fontSize=Math.max(J,.9)+"em"}),this.textEditor.addEventListener("keyup",function(J){J.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(J){if(J.clipboardData){var oe=J.clipboardData.getData("text"),$=window.getSelection();if(!$.rangeCount)return!1;$.deleteFromDocument(),$.getRangeAt(0).insertNode(document.createTextNode(oe)),J.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){R.textEditDivClicked(R.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},A.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var R=this.getTextScale(),J=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),oe=this.textElement.getBBox(),$={x:oe.width*R,y:oe.height*R};J.x-=$.x/2,J.y-=$.y/2,this.textEditor.style.top=J.y+"px",this.textEditor.style.left=J.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-J.x+"px",this.textEditor.style.fontSize=Math.max(16*R,12)+"px",this.textElement.style.display="none"}},A.prototype.textEditDivClicked=function(R){this.text=R.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},A.prototype.select=function(){Z.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},A.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Z.prototype.deselect.call(this)},A.prototype.dblClick=function(R,J){Z.prototype.dblClick.call(this,R,J),this.showTextEditor()},A.prototype.setColor=function(R){this.textElement&&M.setAttributes(this.textElement,[["fill",R]]),this.color=R,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(R)},A.prototype.setFont=function(R){this.textElement&&M.setAttributes(this.textElement,[["font-family",R]]),this.fontFamily=R,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},A.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},A.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var R=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Z.prototype.getState.call(this));return R.typeName=A.typeName,R},A.prototype.restoreState=function(R){var J=R;this.color=J.color,this.fontFamily=J.fontFamily,this.padding=J.padding,this.text=J.text,this.createVisual(),Z.prototype.restoreState.call(this,R),this.setSize()},A.prototype.scale=function(R,J){Z.prototype.scale.call(this,R,J),this.setSize(),this.sizeText(),this.positionTextEditor()},A.typeName="TextMarker",A.title="Text marker",A.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',A}(T),O=function(Z){function A(R,J,oe){var $=Z.call(this,R,J,oe)||this;return $.color="transparent",$.lineWidth=3,$.drawing=!1,$.pixelRatio=1,$.color=oe.defaultColor,$.lineWidth=oe.defaultStrokeWidth,$.pixelRatio=oe.freehandPixelRatio,$.setColor=$.setColor.bind($),$.addCanvas=$.addCanvas.bind($),$.finishCreation=$.finishCreation.bind($),$.setLineWidth=$.setLineWidth.bind($),$.colorPanel=new P("Color",oe.defaultColorSet,oe.defaultColor),$.colorPanel.onColorChanged=$.setColor,$.lineWidthPanel=new E("Line width",oe.defaultStrokeWidths,oe.defaultStrokeWidth),$.lineWidthPanel.onWidthChanged=$.setLineWidth,$}return re(A,Z),A.prototype.ownsTarget=function(R){return!(!Z.prototype.ownsTarget.call(this,R)&&R!==this.visual&&R!==this.drawingImage)},A.prototype.createVisual=function(){this.visual=M.createGroup(),this.drawingImage=M.createImage(),this.visual.appendChild(this.drawingImage);var R=M.createTransform();this.visual.transform.baseVal.appendItem(R),this.addMarkerVisualToContainer(this.visual)},A.prototype.pointerDown=function(R,J){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(R.x,R.y),this.drawing=!0):Z.prototype.pointerDown.call(this,R,J)},A.prototype.manipulate=function(R){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(R.x,R.y),this.canvasContext.stroke()):Z.prototype.manipulate.call(this,R)},A.prototype.resize=function(R){Z.prototype.resize.call(this,R),M.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),M.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},A.prototype.pointerUp=function(R){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Z.prototype.pointerUp.call(this,R)},A.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},A.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Z.prototype.select.call(this)},A.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Z.prototype.deselect.call(this)},A.prototype.finishCreation=function(){for(var R=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),J=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],oe=J[0],$=J[1],Se=J[2],je=J[3],$e=!1,st=0;st<this.canvasElement.height;st++)for(var Ke=0;Ke<this.canvasElement.width;Ke++)R.data[st*this.canvasElement.width*4+4*Ke+3]>0&&($e=!0,st<$&&($=st),Ke<oe&&(oe=Ke),st>je&&(je=st),Ke>Se&&(Se=Ke));if($e){this.left=oe/this.pixelRatio,this.top=$/this.pixelRatio,this.width=(Se-oe)/this.pixelRatio,this.height=(je-$)/this.pixelRatio;var it=document.createElement("canvas");it.width=Se-oe,it.height=je-$,it.getContext("2d").putImageData(this.canvasContext.getImageData(oe,$,Se-oe,je-$),0,0),this.drawingImgUrl=it.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},A.prototype.setDrawingImage=function(){M.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),M.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},A.prototype.setColor=function(R){this.color=R,this.colorChanged(R)},A.prototype.setLineWidth=function(R){this.lineWidth=R},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var R=Object.assign({drawingImgUrl:this.drawingImgUrl},Z.prototype.getState.call(this));return R.typeName=A.typeName,R},A.prototype.restoreState=function(R){this.createVisual(),Z.prototype.restoreState.call(this,R),this.drawingImgUrl=R.drawingImgUrl,this.setDrawingImage()},A.prototype.scale=function(R,J){Z.prototype.scale.call(this,R,J),this.setDrawingImage()},A.typeName="FreehandMarker",A.title="Freehand marker",A.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',A}(T),G=function(Z){function A(R,J,oe){var $=Z.call(this,R,oe||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return $.typeBoxes=[],$.currentType=J,$.setCurrentType=$.setCurrentType.bind($),$}return re(A,Z),A.prototype.getUi=function(){var R=this,J=document.createElement("div");J.style.display="flex",J.style.overflow="hidden",J.style.flexGrow="2";for(var oe=function(je){var $e="both";switch(je){case 0:$e="both";break;case 1:$e="start";break;case 2:$e="end";break;case 3:$e="none"}var st=document.createElement("div");if(st.style.display="flex",st.style.flexGrow="2",st.style.alignItems="center",st.style.justifyContent="space-between",st.style.padding="5px",st.style.borderWidth="2px",st.style.borderStyle="solid",st.style.borderColor=$e===$.currentType?$.uiStyleSettings.toolboxAccentColor:"transparent",st.addEventListener("click",function(){R.setCurrentType($e,st)}),J.appendChild(st),$e==="both"||$e==="start"){var Ke=document.createElement("div");Ke.style.display="flex",Ke.style.alignItems="center",Ke.style.minHeight="20px",Ke.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
|
<polygon points="0,5 10,0 10,10" fill="`+($.uiStyleSettings!==void 0?$.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
|
</svg>`,Ke.style.marginLeft="5px",st.appendChild(Ke)}var it=document.createElement("div");it.style.display="flex",it.style.alignItems="center",it.style.minHeight="20px",it.style.flexGrow="2";var nt=document.createElement("hr");if(nt.style.minWidth="20px",nt.style.border="0px",nt.style.borderTop="3px solid "+($.uiStyleSettings!==void 0?$.uiStyleSettings.toolboxColor:"#eeeeee"),nt.style.flexGrow="2",it.appendChild(nt),st.appendChild(it),$e==="both"||$e==="end"){var bt=document.createElement("div");bt.style.display="flex",bt.style.alignItems="center",bt.style.minHeight="20px",bt.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
|
<polygon points="0,0 10,5 0,10" fill="`+($.uiStyleSettings!==void 0?$.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
|
</svg>`,bt.style.marginRight="5px",st.appendChild(bt)}$.typeBoxes.push(st)},$=this,Se=0;Se<4;Se++)oe(Se);return J},A.prototype.setCurrentType=function(R,J){var oe=this;this.currentType=R,this.typeBoxes.forEach(function($){$.style.borderColor=$===J?oe.uiStyleSettings!==void 0?oe.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},A}(j),Y=function(Z){function A(R,J,oe){var $=Z.call(this,R,J,oe)||this;return $.arrowType="end",$.arrowBaseHeight=10,$.arrowBaseWidth=10,$.getArrowPoints=$.getArrowPoints.bind($),$.setArrowType=$.setArrowType.bind($),$.arrowTypePanel=new G("Arrow type","end"),$.arrowTypePanel.onArrowTypeChanged=$.setArrowType,$}return re(A,Z),A.prototype.ownsTarget=function(R){return!(!Z.prototype.ownsTarget.call(this,R)&&R!==this.arrow1&&R!==this.arrow2)},A.prototype.getArrowPoints=function(R,J){var oe=this.arrowBaseWidth+2*this.strokeWidth,$=this.arrowBaseHeight+2*this.strokeWidth;return R-oe/2+","+(J+$/2)+" "+R+","+(J-$/2)+" "+(R+oe/2)+","+(J+$/2)},A.prototype.createTips=function(){this.arrow1=M.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(M.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=M.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(M.createTransform()),this.visual.appendChild(this.arrow2)},A.prototype.pointerDown=function(R,J){Z.prototype.pointerDown.call(this,R,J),this.state==="creating"&&this.createTips()},A.prototype.adjustVisual=function(){if(Z.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",M.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),M.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var R=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),J=this.arrow1.transform.baseVal.getItem(0);J.setRotate(R,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(J,0);var oe=this.arrow2.transform.baseVal.getItem(0);oe.setRotate(R+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(oe,0)}},A.prototype.setArrowType=function(R){this.arrowType=R,this.adjustVisual(),this.stateChanged()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var R=Object.assign({arrowType:this.arrowType},Z.prototype.getState.call(this));return R.typeName=A.typeName,R},A.prototype.restoreState=function(R){Z.prototype.restoreState.call(this,R);var J=R;this.arrowType=J.arrowType,this.createTips(),this.adjustVisual()},A.typeName="ArrowMarker",A.title="Arrow marker",A.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',A}(v),ee=function(Z){function A(R,J,oe){var $=Z.call(this,R,J,oe)||this;return $.fillColor=oe.defaultFillColor,$.strokeWidth=0,$.fillPanel=new P("Color",oe.defaultColorSet,oe.defaultFillColor),$.fillPanel.onColorChanged=$.setFillColor,$}return re(A,Z),Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var R=Z.prototype.getState.call(this);return R.typeName=A.typeName,R},A.typeName="CoverMarker",A.title="Cover marker",A.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',A}(x),fe=function(Z){function A(R,J,oe,$){var Se=Z.call(this,R,$||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return Se.opacities=[],Se.opacityBoxes=[],Se.opacities=J,Se.currentOpacity=oe,Se.setCurrentOpacity=Se.setCurrentOpacity.bind(Se),Se}return re(A,Z),A.prototype.getUi=function(){var R=this,J=document.createElement("div");return J.style.display="flex",J.style.overflow="hidden",J.style.flexGrow="2",J.style.justifyContent="space-between",this.opacities.forEach(function(oe){var $=document.createElement("div");$.style.display="flex",$.style.alignItems="center",$.style.justifyContent="center",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.borderColor=oe===R.currentOpacity?R.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){R.setCurrentOpacity(oe,$)}),J.appendChild($);var Se=document.createElement("div");Se.innerText=100*oe+"%",$.appendChild(Se),R.opacityBoxes.push($)}),J},A.prototype.setCurrentOpacity=function(R,J){var oe=this;this.currentOpacity=R,this.opacityBoxes.forEach(function($){$.style.borderColor=$===J?oe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},A}(j),pe=function(Z){function A(R,J,oe){var $=Z.call(this,R,J,oe)||this;return $.setOpacity=$.setOpacity.bind($),$.fillColor=oe.defaultHighlightColor,$.strokeWidth=0,$.opacity=oe.defaultHighlightOpacity,$.fillPanel=new P("Color",oe.defaultColorSet,$.fillColor),$.fillPanel.onColorChanged=$.setFillColor,$.opacityPanel=new fe("Opacity",oe.defaultOpacitySteps,$.opacity),$.opacityPanel.onOpacityChanged=$.setOpacity,$}return re(A,Z),A.prototype.setOpacity=function(R){this.opacity=R,this.visual&&M.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var R=Z.prototype.getState.call(this);return R.typeName=A.typeName,R},A.typeName="HighlightMarker",A.title="Highlight marker",A.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',A}(ee),xe='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',Ce=function(Z){function A(R,J,oe){var $=Z.call(this,R,J,oe)||this;return $.bgColor="transparent",$.tipPosition={x:0,y:0},$.tipBase1Position={x:0,y:0},$.tipBase2Position={x:0,y:0},$.tipMoving=!1,$.color=oe.defaultStrokeColor,$.bgColor=oe.defaultFillColor,$.fontFamily=oe.defaultFontFamily,$.defaultSize={x:100,y:30},$.setBgColor=$.setBgColor.bind($),$.getTipPoints=$.getTipPoints.bind($),$.positionTip=$.positionTip.bind($),$.setTipPoints=$.setTipPoints.bind($),$.colorPanel=new P("Text color",oe.defaultColorSet,$.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),$.colorPanel.onColorChanged=$.setColor,$.bgColorPanel=new P("Fill color",oe.defaultColorSet,$.bgColor,xe),$.bgColorPanel.onColorChanged=$.setBgColor,$.fontFamilyPanel=new g("Font",oe.defaultFontFamilies,oe.defaultFontFamily),$.fontFamilyPanel.onFontChanged=$.setFont,$.tipGrip=new p,$.tipGrip.visual.transform.baseVal.appendItem(M.createTransform()),$.controlBox.appendChild($.tipGrip.visual),$}return re(A,Z),A.prototype.ownsTarget=function(R){return Z.prototype.ownsTarget.call(this,R)||this.tipGrip.ownsTarget(R)||this.tip===R},A.prototype.createTip=function(){M.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=M.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},A.prototype.pointerDown=function(R,J){this.state==="new"&&Z.prototype.pointerDown.call(this,R,J),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(J)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Z.prototype.pointerDown.call(this,R,J)},A.prototype.pointerUp=function(R){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Z.prototype.pointerUp.call(this,R);else{var J=this.state==="creating";Z.prototype.pointerUp.call(this,R),this.setTipPoints(J),this.positionTip()}},A.prototype.manipulate=function(R){if(this.tipMoving){var J=this.unrotatePoint(R);this.tipPosition={x:J.x-this.manipulationStartLeft,y:J.y-this.manipulationStartTop},this.positionTip()}else Z.prototype.manipulate.call(this,R)},A.prototype.setBgColor=function(R){this.bgRectangle&&this.tip&&(M.setAttributes(this.bgRectangle,[["fill",R]]),M.setAttributes(this.tip,[["fill",R]])),this.bgColor=R,this.fillColorChanged(R)},A.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},A.prototype.setTipPoints=function(R){R===void 0&&(R=!1);var J=Math.min(this.height/2,15),oe=this.height/5;R&&(this.tipPosition={x:J+oe/2,y:this.height+20});var $=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?$<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(oe=this.width/5,J=Math.min(this.width/2,15),this.tipBase1Position={x:J,y:0},this.tipBase2Position={x:J+oe,y:0}):(this.tipBase1Position={x:0,y:J},this.tipBase2Position={x:0,y:J+oe}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?$<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(oe=this.width/5,J=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-J-oe,y:0},this.tipBase2Position={x:this.width-J,y:0}):(this.tipBase1Position={x:this.width,y:J},this.tipBase2Position={x:this.width,y:J+oe}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?$<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(oe=this.width/5,J=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-J-oe,y:this.height},this.tipBase2Position={x:this.width-J,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-J-oe},this.tipBase2Position={x:this.width,y:this.height-J}):$<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(oe=this.width/5,J=Math.min(this.width/2,15),this.tipBase1Position={x:J,y:this.height},this.tipBase2Position={x:J+oe,y:this.height}):(this.tipBase1Position={x:0,y:this.height-J},this.tipBase2Position={x:0,y:this.height-J-oe})},A.prototype.resize=function(R){Z.prototype.resize.call(this,R),this.positionTip()},A.prototype.positionTip=function(){M.setAttributes(this.tip,[["points",this.getTipPoints()]]);var R=this.tipGrip.visual.transform.baseVal.getItem(0);R.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(R,0)},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),A.prototype.select=function(){this.positionTip(),Z.prototype.select.call(this)},A.prototype.getState=function(){var R=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Z.prototype.getState.call(this));return R.typeName=A.typeName,R},A.prototype.restoreState=function(R){var J=R;this.bgColor=J.bgColor,this.tipPosition=J.tipPosition,Z.prototype.restoreState.call(this,R),this.createTip(),this.setTipPoints()},A.prototype.scale=function(R,J){Z.prototype.scale.call(this,R,J),this.tipPosition={x:this.tipPosition.x*R,y:this.tipPosition.y*J},this.positionTip()},A.typeName="CalloutMarker",A.title="Callout marker",A.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',A}(_),be=function(Z){function A(R,J,oe){var $=Z.call(this,R,J,oe)||this;return $.fillColor="transparent",$.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.opacity=1,$.strokeColor=oe.defaultColor,$.strokeWidth=oe.defaultStrokeWidth,$.strokeDasharray=oe.defaultStrokeDasharray,$.fillColor=oe.defaultFillColor,$.setStrokeColor=$.setStrokeColor.bind($),$.setFillColor=$.setFillColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.setOpacity=$.setOpacity.bind($),$.createVisual=$.createVisual.bind($),$.strokePanel=new P("Line color",K(oe.defaultColorSet,["transparent"]),oe.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.fillPanel=new P("Fill color",K(oe.defaultColorSet,["transparent"]),$.fillColor,xe),$.fillPanel.onColorChanged=$.setFillColor,$.strokeWidthPanel=new E("Line width",oe.defaultStrokeWidths,oe.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new k("Line style",oe.defaultStrokeDasharrays,oe.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$.opacityPanel=new fe("Opacity",oe.defaultOpacitySteps,$.opacity),$.opacityPanel.onOpacityChanged=$.setOpacity,$}return re(A,Z),A.prototype.ownsTarget=function(R){return!(!Z.prototype.ownsTarget.call(this,R)&&R!==this.visual)},A.prototype.createVisual=function(){this.visual=M.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},A.prototype.pointerDown=function(R,J){Z.prototype.pointerDown.call(this,R,J),this.state==="new"&&(this.createVisual(),this.moveVisual(R),this._state="creating")},A.prototype.manipulate=function(R){Z.prototype.manipulate.call(this,R)},A.prototype.resize=function(R){Z.prototype.resize.call(this,R),this.setSize()},A.prototype.setSize=function(){Z.prototype.setSize.call(this),M.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},A.prototype.pointerUp=function(R){Z.prototype.pointerUp.call(this,R),this.setSize()},A.prototype.setStrokeColor=function(R){this.strokeColor=R,this.visual&&M.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(R),this.stateChanged()},A.prototype.setFillColor=function(R){this.fillColor=R,this.visual&&M.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(R),this.stateChanged()},A.prototype.setStrokeWidth=function(R){this.strokeWidth=R,this.visual&&M.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},A.prototype.setStrokeDasharray=function(R){this.strokeDasharray=R,this.visual&&M.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},A.prototype.setOpacity=function(R){this.opacity=R,this.visual&&M.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var R=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Z.prototype.getState.call(this));return R.typeName=A.typeName,R},A.prototype.restoreState=function(R){var J=R;this.fillColor=J.fillColor,this.strokeColor=J.strokeColor,this.strokeWidth=J.strokeWidth,this.strokeDasharray=J.strokeDasharray,this.opacity=J.opacity,this.createVisual(),Z.prototype.restoreState.call(this,R),this.setSize()},A.prototype.scale=function(R,J){Z.prototype.scale.call(this,R,J),this.setSize()},A.typeName="EllipseMarker",A.title="Ellipse marker",A.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',A}(T),Oe=function(Z){function A(R,J,oe){return Z.call(this,R,J,oe)||this}return re(A,Z),Object.defineProperty(A.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),A.prototype.ownsTarget=function(R){return!(!Z.prototype.ownsTarget.call(this,R)&&R!==this.tip1&&R!==this.tip2)},A.prototype.createTips=function(){this.tip1=M.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(M.createTransform()),this.visual.appendChild(this.tip1),this.tip2=M.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(M.createTransform()),this.visual.appendChild(this.tip2)},A.prototype.pointerDown=function(R,J){Z.prototype.pointerDown.call(this,R,J),this.state==="creating"&&this.createTips()},A.prototype.adjustVisual=function(){if(Z.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(M.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),M.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var R=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),J=this.tip1.transform.baseVal.getItem(0);J.setRotate(R,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(J,0);var oe=this.tip2.transform.baseVal.getItem(0);oe.setRotate(R+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(oe,0)}},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var R=Z.prototype.getState.call(this);return R.typeName=A.typeName,R},A.prototype.restoreState=function(R){Z.prototype.restoreState.call(this,R),this.createTips(),this.adjustVisual()},A.typeName="MeasurementMarker",A.title="Measurement marker",A.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',A}(v),We=function(Z){function A(R,J,oe){var $=Z.call(this,R,J,oe)||this;return $.strokePanel.colors=oe.defaultColorSet,$.fillColor="transparent",$}return re(A,Z),Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var R=Z.prototype.getState.call(this);return R.typeName=A.typeName,R},A.typeName="EllipseFrameMarker",A.title="Ellipse frame marker",A.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',A}(be),Me=function(){function Z(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Z.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Z.prototype.addUndoStep=function(A){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(A)||(this.undoStack.push(A),JSON.stringify(this.lastRedoStep)!==JSON.stringify(A)&&this.redoStack.splice(0,this.redoStack.length))},Z.prototype.replaceLastUndoStep=function(A){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=A)},Z.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Z.prototype.undo=function(){if(this.undoStack.length>1){var A=this.undoStack.pop();return A!==void 0&&this.redoStack.push(A),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Z.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Z}(),ct=function(Z){function A(R,J,oe){var $=Z.call(this,R,J,oe)||this;return $.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.curveX=0,$.curveY=0,$.manipulationStartCurveX=0,$.manipulationStartCurveY=0,$.setStrokeColor=$.setStrokeColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.positionGrips=$.positionGrips.bind($),$.addControlGrips=$.addControlGrips.bind($),$.adjustVisual=$.adjustVisual.bind($),$.setupControlBox=$.setupControlBox.bind($),$.resize=$.resize.bind($),$.strokeColor=oe.defaultColor,$.strokeWidth=oe.defaultStrokeWidth,$.strokeDasharray=oe.defaultStrokeDasharray,$.strokePanel=new P("Line color",oe.defaultColorSet,oe.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.strokeWidthPanel=new E("Line width",oe.defaultStrokeWidths,oe.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new k("Line style",oe.defaultStrokeDasharrays,oe.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$}return re(A,Z),A.prototype.ownsTarget=function(R){return!(!Z.prototype.ownsTarget.call(this,R)&&R!==this.visual&&R!==this.selectorCurve&&R!==this.visibleCurve&&!this.curveGrip.ownsTarget(R))},A.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},A.prototype.createVisual=function(){this.visual=M.createGroup(),this.selectorCurve=M.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=M.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},A.prototype.pointerDown=function(R,J){Z.prototype.pointerDown.call(this,R,J),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=R.x,this.curveY=R.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(J)&&(this.activeGrip=this.curveGrip,this._state="resize")},A.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),M.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),M.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),M.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},A.prototype.setupControlBox=function(){Z.prototype.setupControlBox.call(this),this.curveControlLine1=M.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=M.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},A.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Z.prototype.addControlGrips.call(this)},A.prototype.positionGrips=function(){Z.prototype.positionGrips.call(this);var R=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-R/2,this.curveY-R/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},A.prototype.manipulate=function(R){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+R.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+R.y-this.manipulationStartY),Z.prototype.manipulate.call(this,R)},A.prototype.resize=function(R){this.activeGrip===this.curveGrip&&(this.curveX=R.x,this.curveY=R.y),Z.prototype.resize.call(this,R),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},A.prototype.setStrokeColor=function(R){this.strokeColor=R,this.adjustVisual(),this.colorChanged(R)},A.prototype.setStrokeWidth=function(R){this.strokeWidth=R,this.adjustVisual()},A.prototype.setStrokeDasharray=function(R){this.strokeDasharray=R,this.adjustVisual()},A.prototype.scale=function(R,J){this.curveX=this.curveX*R,this.curveY=this.curveY*J,Z.prototype.scale.call(this,R,J)},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var R=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Z.prototype.getState.call(this));return R.typeName=A.typeName,R},A.prototype.restoreState=function(R){Z.prototype.restoreState.call(this,R);var J=R;this.strokeColor=J.strokeColor,this.strokeWidth=J.strokeWidth,this.strokeDasharray=J.strokeDasharray,this.curveX=J.curveX,this.curveY=J.curveY,this.createVisual(),this.adjustVisual()},A.typeName="CurveMarker",A.title="Curve marker",A.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',A}(m),Ge=function(){function Z(A,R){R===void 0&&(R=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=A,this.cancelable=R}return Object.defineProperty(Z.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Z.prototype.preventDefault=function(){this._defaultPrevented=!0},Z}(),Je=function(Z){function A(R,J,oe){var $=Z.call(this,R,!1)||this;return $.dataUrl=J,$.state=oe,$}return re(A,Z),A}(Ge),Xe=function(Z){function A(R,J,oe){oe===void 0&&(oe=!1);var $=Z.call(this,R,oe)||this;return $.marker=J,$}return re(A,Z),A}(Ge),Ye=function(){function Z(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return Z.prototype.addEventListener=function(A,R){this[A].push(R)},Z.prototype.removeEventListener=function(A,R){var J=this[A].indexOf(R);J>-1&&this[A].splice(J,1)},Z}(),ke=function(){function Z(A){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new b,this._isOpen=!1,this.undoRedoManager=new Me,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Ye,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Z.instanceCounter++,this.styles=new V(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=A,this.targetRoot=document.body,this.width=A.clientWidth,this.height=A.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(Z.prototype,"ALL_MARKER_TYPES",{get:function(){return[C,O,Y,_,We,be,pe,Ce,Oe,ee,v,ct]},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[C,O,Y,_,be,pe,Ce]},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"BASIC_MARKER_TYPES",{get:function(){return[C,O,Y,_,pe]},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(A){var R=this;this._availableMarkerTypes.splice(0),A.forEach(function(J){if(typeof J=="string"){var oe=R.ALL_MARKER_TYPES.find(function($){return $.typeName===J});oe!==void 0&&R._availableMarkerTypes.push(oe)}else R._availableMarkerTypes.push(J)})},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(A){this._zoomLevel=A,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Z.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),se.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Z.prototype.show=function(){var A=this;this.styles.styleSheetRoot===void 0&&X.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=X.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(R){return R(new Ge(A))})},Z.prototype.render=function(){return z(this,void 0,void 0,function(){var A;return ae(this,function(R){switch(R.label){case 0:return this.setCurrentMarker(),(A=new q).naturalSize=this.renderAtNaturalSize,A.imageType=this.renderImageType,A.imageQuality=this.renderImageQuality,A.markersOnly=this.renderMarkersOnly,A.width=this.renderWidth,A.height=this.renderHeight,[4,A.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return R.sent(),[4,A.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,R.sent()]}})})},Z.prototype.close=function(A){var R=this;if(A===void 0&&(A=!1),this.isOpen){var J=!1;A||this.eventListeners.beforeclose.forEach(function(oe){var $=new Ge(R,!0);oe($),$.defaultPrevented&&(J=!0)}),J||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(oe){return oe(new Ge(R))}),this.detachEvents(),this._isOpen=!1)}},Z.prototype.addMarkersToToolbar=function(){for(var A,R=[],J=0;J<arguments.length;J++)R[J]=arguments[J];(A=this._availableMarkerTypes).push.apply(A,R)},Z.prototype.addRenderEventListener=function(A){this.addEventListener("render",function(R){A(R.dataUrl,R.state)})},Z.prototype.removeRenderEventListener=function(A){},Z.prototype.addCloseEventListener=function(A){this.addEventListener("close",function(){A()})},Z.prototype.removeCloseEventListener=function(A){},Z.prototype.setupResizeObserver=function(){var A=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){A.resize(A.target.clientWidth,A.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return A.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Z.prototype.onPopupTargetResize=function(){var A=1*this.target.clientWidth/this.target.clientHeight,R=this.editorCanvas.clientWidth/A>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*A:this.editorCanvas.clientWidth,J=R<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/A;this.resize(R,J)},Z.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Z.prototype.resize=function(A,R){this._isResizing=!0;var J=A/this.imageWidth,oe=R/this.imageHeight;this.imageWidth=Math.round(A),this.imageHeight=Math.round(R),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(J,oe),this._isResizing=!1},Z.prototype.scaleMarkers=function(A,R){var J,oe=this;this._currentMarker&&this._currentMarker instanceof _?this._currentMarker.scale(A,R):(J=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function($){$!==oe._currentMarker&&$.scale(A,R)}),J!==void 0&&this.setCurrentMarker(J)},Z.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},Z.prototype.setTopLeft=function(){var A=this.editingTarget.getBoundingClientRect(),R=this.editorCanvas.getBoundingClientRect();this.left=A.left-R.left,this.top=A.top-R.top},Z.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},Z.prototype.addDefs=function(){for(var A,R=[],J=0;J<arguments.length;J++)R[J]=arguments[J];this.defs=M.createDefs(),this.addDefsToImage(),(A=this.defs).append.apply(A,R)},Z.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},Z.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},Z.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},Z.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},Z.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},Z.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},Z.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},Z.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var A=document.createElement("a");A.href="https://markerjs.com/",A.target="_blank",A.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',A.title="Powered by marker.js",A.style.display="grid",A.style.alignItems="center",A.style.justifyItems="center",A.style.padding="3px",A.style.width="20px",A.style.height="20px",this.logoUI.appendChild(A),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Z.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},Z.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},Z.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Z.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var A=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=A+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new F(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new I(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},Z.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Z.prototype.removeMarker=function(A){this.markerImage.removeChild(A.container),this.markers.indexOf(A)>-1&&this.markers.splice(this.markers.indexOf(A),1),A.dispose()},Z.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},Z.prototype.toolbarButtonClicked=function(A,R){if(A==="marker"&&R!==void 0)this.createNewMarker(R);else if(A==="action")switch(R){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},Z.prototype.deleteSelectedMarker=function(){var A=this;if(this._currentMarker!==void 0){var R=!1;if(this.eventListeners.markerbeforedelete.forEach(function(oe){var $=new Xe(A,A._currentMarker,!0);oe($),$.defaultPrevented&&(R=!0)}),!R){var J=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(oe){return oe(new Xe(A,J))})}}},Z.prototype.clear=function(){var A=this,R=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Se){var je=new Xe(A,void 0,!0);Se(je),je.defaultPrevented&&(R=!0)}),!R)){this.setCurrentMarker();for(var J=function(Se){var je=oe.markers[Se];oe.setCurrentMarker(oe.markers[Se]),oe._currentMarker.dispose(),oe.markerImage.removeChild(oe._currentMarker.container),oe.markers.splice(oe.markers.indexOf(oe._currentMarker),1),oe.eventListeners.markerdelete.forEach(function($e){return $e(new Xe(A,je))})},oe=this,$=this.markers.length-1;$>=0;$--)J($);this.addUndoStep()}},Object.defineProperty(Z.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Z.prototype.showNotesEditor=function(){var A;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(A=this._currentMarker.notes)!==null&&A!==void 0?A:"",this.overlayContainer.appendChild(this.notesArea))},Z.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},Z.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Z.prototype.addUndoStep=function(){var A=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var R=this.getState(),J=this.undoRedoManager.getLastUndoStep();if(!J||J.width===R.width&&J.height===R.height){var oe=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(R),oe<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function($){return $(new Ge(A))})}else this.undoRedoManager.replaceLastUndoStep(R),this.eventListeners.statechange.forEach(function($){return $(new Ge(A))})}},Z.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Z.prototype.undoStep=function(){var A=this,R=this.undoRedoManager.undo();R!==void 0&&(this.restoreState(R),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(J){return J(new Ge(A))}))},Z.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Z.prototype.redoStep=function(){var A=this,R=this.undoRedoManager.redo();R!==void 0&&(this.restoreState(R),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(J){return J(new Ge(A))}))},Z.prototype.stepZoom=function(){var A=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=A<this.zoomSteps.length-1?this.zoomSteps[A+1]:this.zoomSteps[0]},Z.prototype.panTo=function(A){this.contentDiv.scrollBy({left:this.prevPanPoint.x-A.x,top:this.prevPanPoint.y-A.y}),this.prevPanPoint=A},Z.prototype.startRenderAndClose=function(){return z(this,void 0,void 0,function(){var A,R,J=this;return ae(this,function(oe){switch(oe.label){case 0:return[4,this.render()];case 1:return A=oe.sent(),R=this.getState(),this.eventListeners.render.forEach(function($){return $(new Je(J,A,R))}),this.close(!0),[2]}})})},Z.prototype.getState=function(A){A===!0&&this.setCurrentMarker();var R={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(J){return R.markers.push(J.getState())}),R},Z.prototype.restoreState=function(A){var R=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);A.markers.forEach(function(J){var oe=R._availableMarkerTypes.find(function(Se){return Se.typeName===J.typeName});if(oe!==void 0){var $=R.addNewMarker(oe);$.restoreState(J),R.markers.push($)}}),A.width&&A.height&&(A.width!==this.imageWidth||A.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/A.width,this.imageHeight/A.height),this.eventListeners.restorestate.forEach(function(J){return J(new Ge(R))})},Z.prototype.addNewMarker=function(A){var R=M.createGroup();return this.markerImage.appendChild(R),new A(R,this.overlayContainer,this.settings)},Z.prototype.createNewMarker=function(A){var R,J=this;(R=typeof A=="string"?this._availableMarkerTypes.find(function(oe){return oe.typeName===A}):A)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(R),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(R.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(oe){return oe(new Xe(J,J._currentMarker))}))},Z.prototype.markerCreated=function(A){var R=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(A),this.setCurrentMarker(A),A instanceof O&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(O):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(J){return J(new Xe(R,R._currentMarker))})},Z.prototype.colorChanged=function(A){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=A,this.settings.defaultStrokeColor=A)},Z.prototype.fillColorChanged=function(A){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=A)},Z.prototype.markerStateChanged=function(A){var R=this;this.eventListeners.markerchange.forEach(function(J){return J(new Xe(R,A))})},Z.prototype.setCurrentMarker=function(A){var R=this;this._currentMarker!==A&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(J){return J(new Xe(R,R._currentMarker))})),this._currentMarker=A,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(J){return J(new Xe(R,R._currentMarker))}))},Z.prototype.onPointerDown=function(A){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||A.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var R=this.markers.find(function(J){return J.ownsTarget(A.target)});R!==void 0?(this.setCurrentMarker(R),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(A.clientX,A.clientY),A.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:A.clientX,y:A.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(A.clientX,A.clientY))},Z.prototype.onDblClick=function(A){if(this._isFocused||this.focus(),this.mode==="select"){var R=this.markers.find(function(J){return J.ownsTarget(A.target)});R!==void 0&&R!==this._currentMarker&&this.setCurrentMarker(R),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(A.clientX,A.clientY),A.target):this.setCurrentMarker()}},Z.prototype.onPointerMove=function(A){this.touchPoints!==1&&A.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||A.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(A.clientX,A.clientY)):this.zoomLevel>1&&this.panTo({x:A.clientX,y:A.clientY}))},Z.prototype.onPointerUp=function(A){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(A.clientX,A.clientY)),this.isDragging=!1,this.addUndoStep()},Z.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Z.prototype.onKeyUp=function(A){this._currentMarker===void 0||this.notesArea!==void 0||A.key!=="Delete"&&A.key!=="Backspace"||this.deleteSelectedMarker()},Z.prototype.clientToLocalCoordinates=function(A,R){var J=this.markerImage.getBoundingClientRect();return{x:(A-J.left)/this.zoomLevel,y:(R-J.top)/this.zoomLevel}},Z.prototype.onWindowResize=function(){this.positionUI()},Z.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var A=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=A+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},Z.prototype.addLicenseKey=function(A){se.addKey(A)},Z.prototype.addEventListener=function(A,R){this.eventListeners.addEventListener(A,R)},Z.prototype.removeEventListener=function(A,R){this.eventListeners.removeEventListener(A,R)},Z.prototype.renderState=function(A){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(A),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Z.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Z.prototype.focus=function(){var A=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(R){return R(new Ge(A))}))},Z.prototype.blur=function(){var A=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(R){return R(new Ge(A))}))},Z.instanceCounter=0,Z}()},Vg4E:function(Pr,dr,He){},Y1PL:function(Pr,dr,He){"use strict";He.r(dr),He.d(dr,"ResizableTextArea",function(){return We});var ze=He("wx14"),re=He("1OyB"),z=He("vuIU"),ae=He("Ji7U"),K=He("LK+K"),M=He("q1tI"),se=He("VTBJ"),q=He("rePB"),X=He("Zm9Q"),V=He("Kwbf"),L=He("c+Xe"),H=He("m+aA"),F=He("bdgK"),I=new Map;function j(Ge){Ge.forEach(function(Je){var Xe,Ye=Je.target;(Xe=I.get(Ye))===null||Xe===void 0||Xe.forEach(function(ke){return ke(Ye)})})}var P=new F.default(j),w=null,d=null;function p(Ge,Je){I.has(Ge)||(I.set(Ge,new Set),P.observe(Ge)),I.get(Ge).add(Je)}function f(Ge,Je){I.has(Ge)&&(I.get(Ge).delete(Je),I.get(Ge).size||(P.unobserve(Ge),I.delete(Ge)))}var T=function(Ge){Object(ae.a)(Xe,Ge);var Je=Object(K.a)(Xe);function Xe(){return Object(re.a)(this,Xe),Je.apply(this,arguments)}return Object(z.a)(Xe,[{key:"render",value:function(){return this.props.children}}]),Xe}(M.Component),x=M.createContext(null);function E(Ge){var Je=Ge.children,Xe=Ge.onBatchResize,Ye=M.useRef(0),ke=M.useRef([]),Z=M.useContext(x),A=M.useCallback(function(R,J,oe){Ye.current+=1;var $=Ye.current;ke.current.push({size:R,element:J,data:oe}),Promise.resolve().then(function(){$===Ye.current&&(Xe==null||Xe(ke.current),ke.current=[])}),Z==null||Z(R,J,oe)},[Xe,Z]);return M.createElement(x.Provider,{value:A},Je)}function k(Ge){var Je=Ge.children,Xe=Ge.disabled,Ye=M.useRef(null),ke=M.useRef(null),Z=M.useContext(x),A=M.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),R=M.isValidElement(Je)&&Object(L.c)(Je),J=R?Je.ref:null,oe=M.useMemo(function(){return Object(L.a)(J,Ye)},[J,Ye]),$=M.useRef(Ge);$.current=Ge;var Se=M.useCallback(function(je){var $e=$.current,st=$e.onResize,Ke=$e.data,it=je.getBoundingClientRect(),nt=it.width,bt=it.height,_t=je.offsetWidth,Lt=je.offsetHeight,Ot=Math.floor(nt),xt=Math.floor(bt);if(A.current.width!==Ot||A.current.height!==xt||A.current.offsetWidth!==_t||A.current.offsetHeight!==Lt){var jt={width:Ot,height:xt,offsetWidth:_t,offsetHeight:Lt};A.current=jt;var Nt=_t===Math.round(nt)?nt:_t,mt=Lt===Math.round(bt)?bt:Lt,Ht=Object(se.a)(Object(se.a)({},jt),{},{offsetWidth:Nt,offsetHeight:mt});Z==null||Z(Ht,je,Ke),st&&Promise.resolve().then(function(){st(Ht,je)})}},[]);return M.useEffect(function(){var je=Object(H.a)(Ye.current)||Object(H.a)(ke.current);return je&&!Xe&&p(je,Se),function(){return f(je,Se)}},[Ye.current,Xe]),M.createElement(T,{ref:ke},R?M.cloneElement(Je,{ref:oe}):Je)}var C="rc-observer-key";function b(Ge){var Je=Ge.children,Xe=Object(X.a)(Je);return Xe.map(function(Ye,ke){var Z=(Ye==null?void 0:Ye.key)||"".concat(C,"-").concat(ke);return M.createElement(k,Object(ze.a)({},Ge,{key:Z}),Ye)})}b.Collection=E;var m=b,v=He("bT9E"),g=He("TSYQ"),_=He.n(g),O=`
|
|
|
min-height:0 !important;
|
|
|
max-height:none !important;
|
|
|
height:0 !important;
|
|
|
visibility:hidden !important;
|
|
|
overflow:hidden !important;
|
|
|
position:absolute !important;
|
|
|
z-index:-1000 !important;
|
|
|
top:0 !important;
|
|
|
right:0 !important
|
|
|
`,G=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],Y={},ee;function fe(Ge){var Je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Xe=Ge.getAttribute("id")||Ge.getAttribute("data-reactid")||Ge.getAttribute("name");if(Je&&Y[Xe])return Y[Xe];var Ye=window.getComputedStyle(Ge),ke=Ye.getPropertyValue("box-sizing")||Ye.getPropertyValue("-moz-box-sizing")||Ye.getPropertyValue("-webkit-box-sizing"),Z=parseFloat(Ye.getPropertyValue("padding-bottom"))+parseFloat(Ye.getPropertyValue("padding-top")),A=parseFloat(Ye.getPropertyValue("border-bottom-width"))+parseFloat(Ye.getPropertyValue("border-top-width")),R=G.map(function(oe){return"".concat(oe,":").concat(Ye.getPropertyValue(oe))}).join(";"),J={sizingStyle:R,paddingSize:Z,borderSize:A,boxSizing:ke};return Je&&Xe&&(Y[Xe]=J),J}function pe(Ge){var Je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Xe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ye=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;ee||(ee=document.createElement("textarea"),ee.setAttribute("tab-index","-1"),ee.setAttribute("aria-hidden","true"),document.body.appendChild(ee)),Ge.getAttribute("wrap")?ee.setAttribute("wrap",Ge.getAttribute("wrap")):ee.removeAttribute("wrap");var ke=fe(Ge,Je),Z=ke.paddingSize,A=ke.borderSize,R=ke.boxSizing,J=ke.sizingStyle;ee.setAttribute("style","".concat(J,";").concat(O)),ee.value=Ge.value||Ge.placeholder||"";var oe=Number.MIN_SAFE_INTEGER,$=Number.MAX_SAFE_INTEGER,Se=ee.scrollHeight,je;if(R==="border-box"?Se+=A:R==="content-box"&&(Se-=Z),Xe!==null||Ye!==null){ee.value=" ";var $e=ee.scrollHeight-Z;Xe!==null&&(oe=$e*Xe,R==="border-box"&&(oe=oe+Z+A),Se=Math.max(oe,Se)),Ye!==null&&($=$e*Ye,R==="border-box"&&($=$+Z+A),je=Se>$?"":"hidden",Se=Math.min($,Se))}return{height:Se,minHeight:oe,maxHeight:$,overflowY:je,resize:"none"}}var xe=He("Gytx"),Ce=He.n(xe),be;(function(Ge){Ge[Ge.NONE=0]="NONE",Ge[Ge.RESIZING=1]="RESIZING",Ge[Ge.RESIZED=2]="RESIZED"})(be||(be={}));var Oe=function(Ge){Object(ae.a)(Xe,Ge);var Je=Object(K.a)(Xe);function Xe(Ye){var ke;return Object(re.a)(this,Xe),ke=Je.call(this,Ye),ke.nextFrameActionId=void 0,ke.resizeFrameId=void 0,ke.textArea=void 0,ke.saveTextArea=function(Z){ke.textArea=Z},ke.handleResize=function(Z){var A=ke.state.resizeStatus,R=ke.props,J=R.autoSize,oe=R.onResize;if(A!==be.NONE)return;typeof oe=="function"&&oe(Z),J&&ke.resizeOnNextFrame()},ke.resizeOnNextFrame=function(){cancelAnimationFrame(ke.nextFrameActionId),ke.nextFrameActionId=requestAnimationFrame(ke.resizeTextarea)},ke.resizeTextarea=function(){var Z=ke.props.autoSize;if(!Z||!ke.textArea)return;var A=Z.minRows,R=Z.maxRows,J=pe(ke.textArea,!1,A,R);ke.setState({textareaStyles:J,resizeStatus:be.RESIZING},function(){cancelAnimationFrame(ke.resizeFrameId),ke.resizeFrameId=requestAnimationFrame(function(){ke.setState({resizeStatus:be.RESIZED},function(){ke.resizeFrameId=requestAnimationFrame(function(){ke.setState({resizeStatus:be.NONE}),ke.fixFirefoxAutoScroll()})})})})},ke.renderTextArea=function(){var Z=ke.props,A=Z.prefixCls,R=A===void 0?"rc-textarea":A,J=Z.autoSize,oe=Z.onResize,$=Z.className,Se=Z.disabled,je=ke.state,$e=je.textareaStyles,st=je.resizeStatus,Ke=Object(v.a)(ke.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),it=_()(R,$,Object(q.a)({},"".concat(R,"-disabled"),Se));"value"in Ke&&(Ke.value=Ke.value||"");var nt=Object(se.a)(Object(se.a)(Object(se.a)({},ke.props.style),$e),st===be.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return M.createElement(m,{onResize:ke.handleResize,disabled:!(J||oe)},M.createElement("textarea",Object(ze.a)({},Ke,{className:it,style:nt,ref:ke.saveTextArea})))},ke.state={textareaStyles:{},resizeStatus:be.NONE},ke}return Object(z.a)(Xe,[{key:"componentDidUpdate",value:function(ke){(ke.value!==this.props.value||!Ce()(ke.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var ke=this.textArea.selectionStart,Z=this.textArea.selectionEnd;this.textArea.setSelectionRange(ke,Z)}}catch(A){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Xe}(M.Component),We=Oe,Me=function(Ge){Object(ae.a)(Xe,Ge);var Je=Object(K.a)(Xe);function Xe(Ye){var ke;Object(re.a)(this,Xe),ke=Je.call(this,Ye),ke.resizableTextArea=void 0,ke.focus=function(){ke.resizableTextArea.textArea.focus()},ke.saveTextArea=function(A){ke.resizableTextArea=A},ke.handleChange=function(A){var R=ke.props.onChange;ke.setValue(A.target.value,function(){ke.resizableTextArea.resizeTextarea()}),R&&R(A)},ke.handleKeyDown=function(A){var R=ke.props,J=R.onPressEnter,oe=R.onKeyDown;A.keyCode===13&&J&&J(A),oe&&oe(A)};var Z=typeof Ye.value=="undefined"||Ye.value===null?Ye.defaultValue:Ye.value;return ke.state={value:Z},ke}return Object(z.a)(Xe,[{key:"setValue",value:function(ke,Z){"value"in this.props||this.setState({value:ke},Z)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return M.createElement(We,Object(ze.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ke){return"value"in ke?{value:ke.value}:null}}]),Xe}(M.Component),ct=dr.default=Me},bT9E:function(Pr,dr,He){"use strict";He.d(dr,"a",function(){return re});var ze=He("VTBJ");function re(z,ae){var K=Object(ze.a)({},z);return Array.isArray(ae)&&ae.forEach(function(M){delete K[M]}),K}},"o/Ze":function(Pr,dr,He){Pr.exports={flex_box_center:"flex_box_center___33Y_2",flex_space_between:"flex_space_between___2l153",flex_box_vertical_center:"flex_box_vertical_center___23Tf8",flex_box_center_end:"flex_box_center_end___3eAIy",flex_box_column:"flex_box_column___2YVAm",form:"form___2JK57",btn:"btn___3UI5y",img:"img___mvEHH"}},p5ED:function(Pr,dr,He){"use strict";var ze=He("+L6B"),re=He("2/Rp"),z=He("5Dmo"),ae=He("3S7+"),K=He("k1fw"),M=He("9og8"),se=He("tJVT"),q=He("WmNS"),X=He.n(q),V=He("q1tI"),L=He.n(V),H=He("vHTk"),F=He.n(H),I=He("yEEn"),j=He("ZW9T"),P=He("1vsH"),w=He("V0Rq"),d=He("m3rI");dr.a=function(p){var f,T,x,E,k,C,b,m=p.editOffice,v=m===void 0?"view":m,g=p.data,_=p.theme,O=p.type,G=p.filename,Y=p.monacoEditor,ee=p.className,fe=p.style,pe=p.close,xe=p.onClose,Ce=p.hasMask,be=p.disabledDownload,Oe=Object(V.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),We=Object(se.a)(Oe,2),Me=We[0],ct=We[1],Ge=Object(V.useState)(""),Je=Object(se.a)(Ge,2),Xe=Je[0],Ye=Je[1],ke=Object(V.useState)(),Z=Object(se.a)(ke,2),A=Z[0],R=Z[1],J=window.ENV==="build"?"/react/build":"",oe=d.a.PROXY_SERVER||location.origin,$,Se=1024*1024,je=10*Se,$e=Object(V.useRef)();(f=g)!==null&&f!==void 0&&f.startsWith("/api")&&O!=="txt"&&(g=(d.a.API_SERVER||location.origin)+g),O==="office"&&($=Object(P.T)(g).filesize,$>je&&(O="other")),G&&Y&&(Y.filename=G),Object(V.useEffect)(function(){var nt,bt,_t=(nt=document.cookie)===null||nt===void 0||((bt=nt.replace(/\s/g,""))===null||bt===void 0)?void 0:bt.split(";");_t==null||_t.map(function(Lt){var Ot=Lt.split("=");Ot[0]==="_educoder_session"&&Ye(Ot[1])})},[]),Object(V.useEffect)(function(){O==="office"&&st()},[O,g]);var st=function(){var nt=Object(M.a)(X.a.mark(function bt(){var _t,Lt,Ot;return X.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:return console.log("data:",g),_t=g,g.startsWith("http")||(_t=location.origin+_t),Lt=new URL(_t).pathname.split("/").pop(),jt.next=6,Object(w.V)({attachment_id:Lt});case 6:Ot=jt.sent,R(Ot);case 8:case"end":return jt.stop()}},bt)}));return function(){return nt.apply(this,arguments)}}(),Ke=function(){if(g.startsWith("http")||g.startsWith("blob:")){it();return}Object(P.z)(G||"educoder",g,G)},it=function(){Object(P.x)(G||"educoder",decodeURIComponent(g))};return L.a.createElement("div",{style:Object(K.a)({},fe||{}),className:"".concat(Ce&&F.a.bgBlack," ").concat(O?F.a.wrp:"hide")},pe&&L.a.createElement("div",{className:F.a.close,ref:$e},!be&&L.a.createElement(ae.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return $e.current}},L.a.createElement("span",{onClick:it},L.a.createElement("i",{className:"icon-quxiaozhiding"}))),L.a.createElement(ae.a,{title:"\u5173\u95ED",getPopupContainer:function(){return $e.current}},L.a.createElement("span",{className:"",onClick:xe},L.a.createElement("i",{className:"icon-guanbi1"})))),L.a.createElement("div",{className:"".concat(F.a[ee]," ").concat(ee," ").concat(F.a.monaco," ").concat(O==="txt"?"show":"hide")},O==="txt"&&L.a.createElement(j.b,Y)),O==="audio"&&L.a.createElement("audio",{src:"".concat(((T=g)===null||T===void 0?void 0:T.indexOf("http://"))>-1||((x=g)===null||x===void 0?void 0:x.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(g),autoPlay:!0}),O==="video"&&L.a.createElement(L.a.Fragment,null,((E=g)===null||E===void 0?void 0:E.indexOf("http"))>-1?L.a.createElement("video",{controls:!0,src:"".concat(g),autoPlay:!0}):L.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(g),autoPlay:!0})),O==="office"&&A&&L.a.createElement("iframe",{src:"".concat(J,"/office.html?key=").concat(A.key,"&url=").concat(oe+A.url,"&callbackUrl=").concat(oe+A.callbackUrl,"&fileType=").concat(A.fileType,"&title=").concat(A.title,"&model=").concat(v,"&officeServer=").concat(d.a.OFFICE_SERVER,"&disabledDownload=").concat(!!be)}),O==="html"&&L.a.createElement("iframe",{src:g+"&disposition=inline"}),O==="pdf"&&L.a.createElement("iframe",{src:"".concat(J,"/js/pdfview/index.html?url=").concat(g,"&disabledDownload=").concat(!!be)}),O==="image"&&L.a.createElement("img",{src:"".concat(((k=g)===null||k===void 0?void 0:k.indexOf("http://"))>-1||((C=g)===null||C===void 0?void 0:C.indexOf("https://"))>-1||(b=g)!==null&&b!==void 0&&b.startsWith("/api")?"":"data:image/png;base64,").concat(g)}),O==="other"&&L.a.createElement("div",null,L.a.createElement(re.a,{type:"primary",size:"large",onClick:Ke},L.a.createElement(I.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),O==="download"&&L.a.createElement(re.a,{type:"primary",size:"large",onClick:Ke},L.a.createElement(I.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},phzI:function(Pr,dr,He){"use strict";var ze=He("k1fw"),re=He("9og8"),z=He("tJVT"),ae=He("WmNS"),K=He.n(ae),M=He("q1tI"),se=He.n(M),q=He("yyNy");/*! *****************************************************************************
|
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
purpose with or without fee is hereby granted.
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
|
***************************************************************************** */var X=function(){return X=Object.assign||function(d){for(var p,f=1,T=arguments.length;f<T;f++)for(var x in p=arguments[f])Object.prototype.hasOwnProperty.call(p,x)&&(d[x]=p[x]);return d},X.apply(this,arguments)};function V(d,p){var f=typeof Symbol=="function"&&d[Symbol.iterator];if(!f)return d;var T,x,E=f.call(d),k=[];try{for(;(p===void 0||p-- >0)&&!(T=E.next()).done;)k.push(T.value)}catch(C){x={error:C}}finally{try{T&&!T.done&&(f=E.return)&&f.call(E)}finally{if(x)throw x.error}}return k}function L(d){var p=d.defaultContent,f=p===void 0?[]:p,T=d.onCreated,x=d.defaultHtml,E=x===void 0?"":x,k=d.value,C=k===void 0?"":k,b=d.onChange,m=d.defaultConfig,v=m===void 0?{}:m,g=d.mode,_=g===void 0?"default":g,O=d.style,G=O===void 0?{}:O,Y=d.className,ee=Object(M.useRef)(null),fe=V(Object(M.useState)(null),2),pe=fe[0],xe=fe[1],Ce=V(Object(M.useState)(""),2),be=Ce[0],Oe=Ce[1],We=function(Ge){T&&T(Ge);var Je=v.onCreated;Je&&Je(Ge)},Me=function(Ge){Oe(Ge.getHtml()),b&&b(Ge);var Je=v.onChange;Je&&Je(Ge)},ct=function(Ge){var Je=v.onDestroyed;xe(null),Je&&Je(Ge)};return Object(M.useEffect)(function(){if(pe!=null&&C!==be)try{pe.setHtml(C)}catch(Ge){console.error(Ge)}},[C]),Object(M.useEffect)(function(){var Ge;if(ee.current!=null&&pe==null&&!((Ge=ee.current)===null||Ge===void 0?void 0:Ge.getAttribute("data-w-e-textarea"))){var Je=Object(q.a)({selector:ee.current,config:X(X({},v),{onCreated:We,onChange:Me,onDestroyed:ct}),content:f,html:E||C,mode:_});xe(Je)}},[pe]),se.a.createElement("div",{style:G,ref:ee,className:Y})}function H(d){var p=d.editor,f=d.defaultConfig,T=f===void 0?{}:f,x=d.mode,E=x===void 0?"default":x,k=d.style,C=k===void 0?{}:k,b=d.className,m=Object(M.useRef)(null);return Object(M.useEffect)(function(){m.current!=null&&p!=null&&q.b({editor:p,selector:m.current,config:T,mode:E})},[p]),se.a.createElement("div",{style:C,ref:m,className:b})}var F=He("ErOA"),I=He("9kvl"),j=He("Vg4E"),P=function(p){var f=p.defaultvalue,T=p.onChange,x=p.style,E=p.user,k=p.placeholder,C=1024*1024*2,b=Object(M.useRef)(null),m=4,v=Object(M.useState)(null),g=Object(z.a)(v,2),_=g[0],O=g[1],G=Object(M.useState)(""),Y=Object(z.a)(G,2),ee=Y[0],fe=Y[1];Object(M.useEffect)(function(){fe(f)},[f]),Object(M.useEffect)(function(){T(ee)},[ee]);var pe={},xe={placeholder:k||"\u8BF7\u8F93\u5165\u5185\u5BB9...",MENU_CONF:{}};return xe.MENU_CONF.uploadImage={customUpload:function(be,Oe){return Object(re.a)(K.a.mark(function We(){var Me,ct;return K.a.wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:return Me=new FormData,Me.append("file",be),Je.next=4,Object(F.a)("/api/attachments.json",{method:"post",body:Me},!0);case 4:ct=Je.sent,Oe(ct==null?void 0:ct.url,"","");case 6:case"end":return Je.stop()}},We)}))()}},xe.MENU_CONF.uploadVideo={customUpload:function(be,Oe){return Object(re.a)(K.a.mark(function We(){var Me,ct,Ge,Je,Xe,Ye,ke,Z,A,R,J,oe,$,Se,je,$e;return K.a.wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:return Me=be.size,ct=Math.ceil(Me/C),Ke.prev=2,Ke.next=5,Object(F.a)("/api/attachments/multipart_upload_start",{method:"POST",body:{fileName:be.name,chunkCount:ct,user_id:E==null||((Ge=E.userInfo)===null||Ge===void 0)?void 0:Ge.user_id}});case 5:if(Xe=Ke.sent,!((Xe==null?void 0:Xe.status)!==0)){Ke.next=8;break}throw new Error;case 8:for(Ye=Xe.upload_id,b.current=new AbortController,ke=[],Z=0,A=function(nt){var bt=nt*C,_t=Math.min(bt+C,Me),Lt=be.slice(bt,_t),Ot=new FormData;Ot.append("chunk",Lt),Ot.append("fileName",be.name),Ot.append("chunkIndex",(nt+1).toString()),Ot.append("uploadId",Ye),ke.push(function(){return Object(F.a)("/api/attachments/multipart_upload",{method:"POST",body:Ot,signal:b.current.signal},!0).then(function(xt){})})},R=0;R<ct;R++)A(R);J=0,oe=m,console.log(ke,"promises");case 17:if(!(J<ke.length)){Ke.next=26;break}if(Se=($=ke.slice(J,J+oe))===null||$===void 0?void 0:$.map(function(it){return it()}),!(Se.length>0)){Ke.next=24;break}return Ke.next=22,Promise.all(Se);case 22:je=Ke.sent,J+=oe;case 24:Ke.next=17;break;case 26:return Ke.next=28,Object(F.a)("/api/attachments/multipart_upload_end",{method:"POST",body:{fileName:be.name,chunkCount:ct,uploadId:Ye,user_id:E==null||((Je=E.userInfo)===null||Je===void 0)?void 0:Je.user_id}});case 28:$e=Ke.sent,Oe($e==null?void 0:$e.object,""),Ke.next=34;break;case 32:Ke.prev=32,Ke.t0=Ke.catch(2);case 34:case"end":return Ke.stop()}},We,null,[[2,32]])}))()}},Object(M.useEffect)(function(){return function(){if(_==null)return;_.destroy(),O(null),T(null)}},[_]),se.a.createElement(se.a.Fragment,null,se.a.createElement("div",{style:{border:"1px solid #ccc",zIndex:100}},se.a.createElement(H,{editor:_,defaultConfig:pe,mode:"default",style:{borderBottom:"1px solid #ccc"}}),se.a.createElement(L,{defaultConfig:xe,value:ee,onCreated:O,onChange:function(be){return fe(be.getHtml())},mode:"default",style:Object(ze.a)({height:"500px",overflowY:"hidden"},x)})))},w=dr.a=Object(I.a)(function(d){var p=d.user;return{user:p}})(P)},rUJ1:function(Pr,dr){const He=/[&<>"']/,ze=/[&<>"']/g,re=/[<>"']|&(?!#?\w+;)/,z=/[<>"']|&(?!#?\w+;)/g,ae={"&":"&","<":"<",">":">",'"':""","'":"'"},K=C=>ae[C];function M(C,b){if(b){if(He.test(C))return C.replace(ze,K)}else if(re.test(C))return C.replace(z,K);return C}const se=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function q(C){return C.replace(se,(b,m)=>(m=m.toLowerCase(),m==="colon"?":":m.charAt(0)==="#"?m.charAt(1)==="x"?String.fromCharCode(parseInt(m.substring(2),16)):String.fromCharCode(+m.substring(1)):""))}const X=/(^|[^\[])\^/g;function V(C,b){C=C.source||C,b=b||"";const m={replace:(v,g)=>(g=g.source||g,g=g.replace(X,"$1"),C=C.replace(v,g),m),getRegex:()=>new RegExp(C,b)};return m}const L=/[^\w:]/g,H=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function F(C,b,m){if(C){let v;try{v=decodeURIComponent(q(m)).replace(L,"").toLowerCase()}catch(g){return null}if(v.indexOf("javascript:")===0||v.indexOf("vbscript:")===0||v.indexOf("data:")===0)return null}b&&!H.test(m)&&(m=d(b,m));try{m=encodeURI(m).replace(/%25/g,"%")}catch(v){return null}return m}const I={},j=/^[^:]+:\/*[^/]*$/,P=/^([^:]+:)[\s\S]*$/,w=/^([^:]+:\/*[^/]*)[\s\S]*$/;function d(C,b){I[" "+C]||(j.test(C)?I[" "+C]=C+"/":I[" "+C]=x(C,"/",!0)),C=I[" "+C];const m=C.indexOf(":")===-1;return b.substring(0,2)==="//"?m?b:C.replace(P,"$1")+b:b.charAt(0)==="/"?m?b:C.replace(w,"$1")+b:C+b}const p={exec:function(){}};function f(C){let b=1,m,v;for(;b<arguments.length;b++){m=arguments[b];for(v in m)Object.prototype.hasOwnProperty.call(m,v)&&(C[v]=m[v])}return C}function T(C,b){const m=C.replace(/\|/g,(_,O,G)=>{let Y=!1,ee=O;for(;--ee>=0&&G[ee]==="\\";)Y=!Y;return Y?"|":" |"}),v=m.split(/ \|/);let g=0;if(v.length>b)v.splice(b);else for(;v.length<b;)v.push("");for(;g<v.length;g++)v[g]=v[g].trim().replace(/\\\|/g,"|");return v}function x(C,b,m){const v=C.length;if(v===0)return"";let g=0;for(;g<v;){const _=C.charAt(v-g-1);if(_===b&&!m)g++;else if(_!==b&&m)g++;else break}return C.substr(0,v-g)}function E(C,b){if(C.indexOf(b[1])===-1)return-1;const m=C.length;let v=0,g=0;for(;g<m;g++)if(C[g]==="\\")g++;else if(C[g]===b[0])v++;else if(C[g]===b[1]&&(v--,v<0))return g;return-1}function k(C){C&&C.sanitize&&!C.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}Pr.exports={escape:M,unescape:q,edit:V,cleanUrl:F,resolveUrl:d,noopTest:p,merge:f,splitCells:T,rtrim:x,findClosingBracket:E,checkSanitizeDeprecation:k}},ulZh:function(Pr,dr,He){typeof window!="undefined"&&function(re,z){Pr.exports=z()}(this,function(){return function(ze){var re={};function z(ae){if(re[ae])return re[ae].exports;var K=re[ae]={i:ae,l:!1,exports:{}};return ze[ae].call(K.exports,K,K.exports,z),K.l=!0,K.exports}return z.m=ze,z.c=re,z.d=function(ae,K,M){z.o(ae,K)||Object.defineProperty(ae,K,{enumerable:!0,get:M})},z.r=function(ae){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(ae,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(ae,"__esModule",{value:!0})},z.t=function(ae,K){if(K&1&&(ae=z(ae)),K&8)return ae;if(K&4&&typeof ae=="object"&&ae&&ae.__esModule)return ae;var M=Object.create(null);if(z.r(M),Object.defineProperty(M,"default",{enumerable:!0,value:ae}),K&2&&typeof ae!="string")for(var se in ae)z.d(M,se,function(q){return ae[q]}.bind(null,se));return M},z.n=function(ae){var K=ae&&ae.__esModule?function(){return ae.default}:function(){return ae};return z.d(K,"a",K),K},z.o=function(ae,K){return Object.prototype.hasOwnProperty.call(ae,K)},z.p="/dist/",z(z.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ze,re,z){"use strict";var ae=Object.prototype.hasOwnProperty,K="~";function M(){}Object.create&&(M.prototype=Object.create(null),new M().__proto__||(K=!1));function se(L,H,F){this.fn=L,this.context=H,this.once=F||!1}function q(L,H,F,I,j){if(typeof F!="function")throw new TypeError("The listener must be a function");var P=new se(F,I||L,j),w=K?K+H:H;return L._events[w]?L._events[w].fn?L._events[w]=[L._events[w],P]:L._events[w].push(P):(L._events[w]=P,L._eventsCount++),L}function X(L,H){--L._eventsCount===0?L._events=new M:delete L._events[H]}function V(){this._events=new M,this._eventsCount=0}V.prototype.eventNames=function(){var H=[],F,I;if(this._eventsCount===0)return H;for(I in F=this._events)ae.call(F,I)&&H.push(K?I.slice(1):I);return Object.getOwnPropertySymbols?H.concat(Object.getOwnPropertySymbols(F)):H},V.prototype.listeners=function(H){var F=K?K+H:H,I=this._events[F];if(!I)return[];if(I.fn)return[I.fn];for(var j=0,P=I.length,w=new Array(P);j<P;j++)w[j]=I[j].fn;return w},V.prototype.listenerCount=function(H){var F=K?K+H:H,I=this._events[F];return I?I.fn?1:I.length:0},V.prototype.emit=function(H,F,I,j,P,w){var d=K?K+H:H;if(!this._events[d])return!1;var p=this._events[d],f=arguments.length,T,x;if(p.fn){p.once&&this.removeListener(H,p.fn,void 0,!0);switch(f){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,F),!0;case 3:return p.fn.call(p.context,F,I),!0;case 4:return p.fn.call(p.context,F,I,j),!0;case 5:return p.fn.call(p.context,F,I,j,P),!0;case 6:return p.fn.call(p.context,F,I,j,P,w),!0}for(x=1,T=new Array(f-1);x<f;x++)T[x-1]=arguments[x];p.fn.apply(p.context,T)}else{var E=p.length,k;for(x=0;x<E;x++){p[x].once&&this.removeListener(H,p[x].fn,void 0,!0);switch(f){case 1:p[x].fn.call(p[x].context);break;case 2:p[x].fn.call(p[x].context,F);break;case 3:p[x].fn.call(p[x].context,F,I);break;case 4:p[x].fn.call(p[x].context,F,I,j);break;default:if(!T)for(k=1,T=new Array(f-1);k<f;k++)T[k-1]=arguments[k];p[x].fn.apply(p[x].context,T)}}}return!0},V.prototype.on=function(H,F,I){return q(this,H,F,I,!1)},V.prototype.once=function(H,F,I){return q(this,H,F,I,!0)},V.prototype.removeListener=function(H,F,I,j){var P=K?K+H:H;if(!this._events[P])return this;if(!F)return X(this,P),this;var w=this._events[P];if(w.fn)w.fn===F&&(!j||w.once)&&(!I||w.context===I)&&X(this,P);else{for(var d=0,p=[],f=w.length;d<f;d++)(w[d].fn!==F||j&&!w[d].once||I&&w[d].context!==I)&&p.push(w[d]);p.length?this._events[P]=p.length===1?p[0]:p:X(this,P)}return this},V.prototype.removeAllListeners=function(H){var F;return H?(F=K?K+H:H,this._events[F]&&X(this,F)):(this._events=new M,this._eventsCount=0),this},V.prototype.off=V.prototype.removeListener,V.prototype.addListener=V.prototype.on,V.prefixed=K,V.EventEmitter=V,ze.exports=V},"./node_modules/url-toolkit/src/url-toolkit.js":function(ze,re,z){(function(ae){var K=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,M=/^([^\/?#]*)([^]*)$/,se=/(?:\/|^)\.(?=\/)/g,q=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,X={buildAbsoluteURL:function(V,L,H){if(H=H||{},V=V.trim(),L=L.trim(),!L){if(!H.alwaysNormalize)return V;var F=X.parseURL(V);if(!F)throw new Error("Error trying to parse base URL.");return F.path=X.normalizePath(F.path),X.buildURLFromParts(F)}var I=X.parseURL(L);if(!I)throw new Error("Error trying to parse relative URL.");if(I.scheme)return H.alwaysNormalize?(I.path=X.normalizePath(I.path),X.buildURLFromParts(I)):L;var j=X.parseURL(V);if(!j)throw new Error("Error trying to parse base URL.");if(!j.netLoc&&j.path&&j.path[0]!=="/"){var P=M.exec(j.path);j.netLoc=P[1],j.path=P[2]}j.netLoc&&!j.path&&(j.path="/");var w={scheme:j.scheme,netLoc:I.netLoc,path:null,params:I.params,query:I.query,fragment:I.fragment};if(!I.netLoc&&(w.netLoc=j.netLoc,I.path[0]!=="/"))if(!I.path)w.path=j.path,I.params||(w.params=j.params,I.query||(w.query=j.query));else{var d=j.path,p=d.substring(0,d.lastIndexOf("/")+1)+I.path;w.path=X.normalizePath(p)}return w.path===null&&(w.path=H.alwaysNormalize?X.normalizePath(I.path):I.path),X.buildURLFromParts(w)},parseURL:function(V){var L=K.exec(V);return L?{scheme:L[1]||"",netLoc:L[2]||"",path:L[3]||"",params:L[4]||"",query:L[5]||"",fragment:L[6]||""}:null},normalizePath:function(V){for(V=V.split("").reverse().join("").replace(se,"");V.length!==(V=V.replace(q,"")).length;);return V.split("").reverse().join("")},buildURLFromParts:function(V){return V.scheme+V.netLoc+V.path+V.params+V.query+V.fragment}};ze.exports=X})(this)},"./node_modules/webworkify-webpack/index.js":function(ze,re,z){function ae(H){var F={};function I(P){if(F[P])return F[P].exports;var w=F[P]={i:P,l:!1,exports:{}};return H[P].call(w.exports,w,w.exports,I),w.l=!0,w.exports}I.m=H,I.c=F,I.i=function(P){return P},I.d=function(P,w,d){I.o(P,w)||Object.defineProperty(P,w,{configurable:!1,enumerable:!0,get:d})},I.r=function(P){Object.defineProperty(P,"__esModule",{value:!0})},I.n=function(P){var w=P&&P.__esModule?function(){return P.default}:function(){return P};return I.d(w,"a",w),w},I.o=function(P,w){return Object.prototype.hasOwnProperty.call(P,w)},I.p="/",I.oe=function(P){throw console.error(P),P};var j=I(I.s=ENTRY_MODULE);return j.default||j}var K="[\\.|\\-|\\+|\\w|/|@]+",M="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+K+").*?\\)";function se(H){return(H+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function q(H){return!isNaN(1*H)}function X(H,F,I){var j={};j[I]=[];var P=F.toString(),w=P.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!w)return j;for(var d=w[1],p=new RegExp("(\\\\n|\\W)"+se(d)+M,"g"),f;f=p.exec(P);){if(f[3]==="dll-reference")continue;j[I].push(f[3])}for(p=new RegExp("\\("+se(d)+'\\("(dll-reference\\s('+K+'))"\\)\\)'+M,"g");f=p.exec(P);)H[f[2]]||(j[I].push(f[1]),H[f[2]]=z(f[1]).m),j[f[2]]=j[f[2]]||[],j[f[2]].push(f[4]);for(var T=Object.keys(j),x=0;x<T.length;x++)for(var E=0;E<j[T[x]].length;E++)q(j[T[x]][E])&&(j[T[x]][E]=1*j[T[x]][E]);return j}function V(H){var F=Object.keys(H);return F.reduce(function(I,j){return I||H[j].length>0},!1)}function L(H,F){for(var I={main:[F]},j={main:[]},P={main:{}};V(I);)for(var w=Object.keys(I),d=0;d<w.length;d++){var p=w[d],f=I[p],T=f.pop();if(P[p]=P[p]||{},P[p][T]||!H[p][T])continue;P[p][T]=!0,j[p]=j[p]||[],j[p].push(T);for(var x=X(H,H[p][T],p),E=Object.keys(x),k=0;k<E.length;k++)I[E[k]]=I[E[k]]||[],I[E[k]]=I[E[k]].concat(x[E[k]])}return j}ze.exports=function(H,F){F=F||{};var I={main:z.m},j=F.all?{main:Object.keys(I.main)}:L(I,H),P="";Object.keys(j).filter(function(T){return T!=="main"}).forEach(function(T){for(var x=0;j[T][x];)x++;j[T].push(x),I[T][x]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",P=P+"var "+T+" = ("+ae.toString().replace("ENTRY_MODULE",JSON.stringify(x))+")({"+j[T].map(function(E){return""+JSON.stringify(E)+": "+I[T][E].toString()}).join(",")+`});
|
|
|
`}),P=P+"new (("+ae.toString().replace("ENTRY_MODULE",JSON.stringify(H))+")({"+j.main.map(function(T){return""+JSON.stringify(T)+": "+I.main[T].toString()}).join(",")+"}))(self);";var w=new window.Blob([P],{type:"text/javascript"});if(F.bare)return w;var d=window.URL||window.webkitURL||window.mozURL||window.msURL,p=d.createObjectURL(w),f=new window.Worker(p);return f.objectURL=p,f}},"./src/config.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"hlsDefaultConfig",function(){return k}),z.d(re,"mergeConfig",function(){return b}),z.d(re,"enableStreamingMode",function(){return m});var ae=z("./src/controller/abr-controller.ts"),K=z("./src/controller/audio-stream-controller.ts"),M=z("./src/controller/audio-track-controller.ts"),se=z("./src/controller/subtitle-stream-controller.ts"),q=z("./src/controller/subtitle-track-controller.ts"),X=z("./src/controller/buffer-controller.ts"),V=z("./src/controller/timeline-controller.ts"),L=z("./src/controller/cap-level-controller.ts"),H=z("./src/controller/fps-controller.ts"),F=z("./src/controller/eme-controller.ts"),I=z("./src/controller/cmcd-controller.ts"),j=z("./src/utils/xhr-loader.ts"),P=z("./src/utils/fetch-loader.ts"),w=z("./src/utils/cues.ts"),d=z("./src/utils/mediakeys-helper.ts"),p=z("./src/utils/logger.ts");function f(){return f=Object.assign||function(v){for(var g=1;g<arguments.length;g++){var _=arguments[g];for(var O in _)Object.prototype.hasOwnProperty.call(_,O)&&(v[O]=_[O])}return v},f.apply(this,arguments)}function T(v,g){var _=Object.keys(v);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(v);g&&(O=O.filter(function(G){return Object.getOwnPropertyDescriptor(v,G).enumerable})),_.push.apply(_,O)}return _}function x(v){for(var g=1;g<arguments.length;g++){var _=arguments[g]!=null?arguments[g]:{};g%2?T(Object(_),!0).forEach(function(O){E(v,O,_[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(_)):T(Object(_)).forEach(function(O){Object.defineProperty(v,O,Object.getOwnPropertyDescriptor(_,O))})}return v}function E(v,g,_){return g in v?Object.defineProperty(v,g,{value:_,enumerable:!0,configurable:!0,writable:!0}):v[g]=_,v}var k=x(x({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:j.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:ae.default,bufferController:X.default,capLevelController:L.default,fpsController:H.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:d.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},C()),{},{subtitleStreamController:se.SubtitleStreamController,subtitleTrackController:q.default,timelineController:V.TimelineController,audioStreamController:K.default,audioTrackController:M.default,emeController:F.default,cmcdController:I.default});function C(){return{cueHandler:w.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function b(v,g){if((g.liveSyncDurationCount||g.liveMaxLatencyDurationCount)&&(g.liveSyncDuration||g.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(g.liveMaxLatencyDurationCount!==void 0&&(g.liveSyncDurationCount===void 0||g.liveMaxLatencyDurationCount<=g.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(g.liveMaxLatencyDuration!==void 0&&(g.liveSyncDuration===void 0||g.liveMaxLatencyDuration<=g.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return f({},v,g)}function m(v){var g=v.loader;if(g!==P.default&&g!==j.default)p.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),v.progressive=!1;else{var _=Object(P.fetchSupported)();_&&(v.loader=P.default,v.progressive=!0,v.enableSoftwareAES=!0,p.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ze,re,z){"use strict";z.r(re);var ae=z("./src/polyfills/number.ts"),K=z("./src/utils/ewma-bandwidth-estimator.ts"),M=z("./src/events.ts"),se=z("./src/utils/buffer-helper.ts"),q=z("./src/errors.ts"),X=z("./src/types/loader.ts"),V=z("./src/utils/logger.ts");function L(I,j){for(var P=0;P<j.length;P++){var w=j[P];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(I,w.key,w)}}function H(I,j,P){return j&&L(I.prototype,j),P&&L(I,P),I}var F=function(){function I(P){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=P;var w=P.config;this.bwEstimator=new K.default(w.abrEwmaSlowVoD,w.abrEwmaFastVoD,w.abrEwmaDefaultEstimate),this.registerListeners()}var j=I.prototype;return j.registerListeners=function(){var w=this.hls;w.on(M.Events.FRAG_LOADING,this.onFragLoading,this),w.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),w.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),w.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.on(M.Events.ERROR,this.onError,this)},j.unregisterListeners=function(){var w=this.hls;w.off(M.Events.FRAG_LOADING,this.onFragLoading,this),w.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),w.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),w.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.off(M.Events.ERROR,this.onError,this)},j.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},j.onFragLoading=function(w,d){var p=d.frag;if(p.type===X.PlaylistLevelType.MAIN&&!this.timer){var f;this.fragCurrent=p,this.partCurrent=(f=d.part)!=null?f:null,this.timer=self.setInterval(this.onCheck,100)}},j.onLevelLoaded=function(w,d){var p=this.hls.config;d.details.live?this.bwEstimator.update(p.abrEwmaSlowLive,p.abrEwmaFastLive):this.bwEstimator.update(p.abrEwmaSlowVoD,p.abrEwmaFastVoD)},j._abandonRulesCheck=function(){var w=this.fragCurrent,d=this.partCurrent,p=this.hls,f=p.autoLevelEnabled,T=p.config,x=p.media;if(!w||!x)return;var E=d?d.stats:w.stats,k=d?d.duration:w.duration;if(E.aborted){V.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!f||x.paused||!x.playbackRate||!x.readyState)return;var C=performance.now()-E.loading.start,b=Math.abs(x.playbackRate);if(C<=500*k/b)return;var m=p.levels,v=p.minAutoLevel,g=m[w.level],_=E.total||Math.max(E.loaded,Math.round(k*g.maxBitrate/8)),O=Math.max(1,E.bwEstimate?E.bwEstimate/8:E.loaded*1e3/C),G=(_-E.loaded)/O,Y=x.currentTime,ee=(se.BufferHelper.bufferInfo(x,Y,T.maxBufferHole).end-Y)/b;if(ee>=2*k/b||G<=ee)return;var fe=Number.POSITIVE_INFINITY,pe;for(pe=w.level-1;pe>v;pe--){var xe=m[pe].maxBitrate;if(fe=k*xe/(8*.8*O),fe<ee)break}if(fe>=G)return;var Ce=this.bwEstimator.getEstimate();V.logger.warn("Fragment "+w.sn+(d?" part "+d.index:"")+" of level "+w.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+pe+`
|
|
|
Current BW estimate: `+(Object(ae.isFiniteNumber)(Ce)?(Ce/1024).toFixed(3):"Unknown")+` Kb/s
|
|
|
Estimated load time for current fragment: `+G.toFixed(3)+` s
|
|
|
Estimated load time for the next fragment: `+fe.toFixed(3)+` s
|
|
|
Time to underbuffer: `+ee.toFixed(3)+" s"),p.nextLoadLevel=pe,this.bwEstimator.sample(C,E.loaded),this.clearTimer(),w.loader&&(this.fragCurrent=this.partCurrent=null,w.loader.abort()),p.trigger(M.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:w,part:d,stats:E})},j.onFragLoaded=function(w,d){var p=d.frag,f=d.part;if(p.type===X.PlaylistLevelType.MAIN&&Object(ae.isFiniteNumber)(p.sn)){var T=f?f.stats:p.stats,x=f?f.duration:p.duration;if(this.clearTimer(),this.lastLoadedFragLevel=p.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var E=this.hls.levels[p.level],k=(E.loaded?E.loaded.bytes:0)+T.loaded,C=(E.loaded?E.loaded.duration:0)+x;E.loaded={bytes:k,duration:C},E.realBitrate=Math.round(8*k/C)}if(p.bitrateTest){var b={stats:T,frag:p,part:f,id:p.type};this.onFragBuffered(M.Events.FRAG_BUFFERED,b),p.bitrateTest=!1}}},j.onFragBuffered=function(w,d){var p=d.frag,f=d.part,T=f?f.stats:p.stats;if(T.aborted)return;if(p.type!==X.PlaylistLevelType.MAIN||p.sn==="initSegment")return;var x=T.parsing.end-T.loading.start;this.bwEstimator.sample(x,T.loaded),T.bwEstimate=this.bwEstimator.getEstimate(),p.bitrateTest?this.bitrateTestDelay=x/1e3:this.bitrateTestDelay=0},j.onError=function(w,d){switch(d.details){case q.ErrorDetails.FRAG_LOAD_ERROR:case q.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},j.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},j.getNextABRAutoLevel=function(){var w=this.fragCurrent,d=this.partCurrent,p=this.hls,f=p.maxAutoLevel,T=p.config,x=p.minAutoLevel,E=p.media,k=d?d.duration:w?w.duration:0,C=E?E.currentTime:0,b=E&&E.playbackRate!==0?Math.abs(E.playbackRate):1,m=this.bwEstimator?this.bwEstimator.getEstimate():T.abrEwmaDefaultEstimate,v=(se.BufferHelper.bufferInfo(E,C,T.maxBufferHole).end-C)/b,g=this.findBestLevel(m,x,f,v,T.abrBandWidthFactor,T.abrBandWidthUpFactor);if(g>=0)return g;V.logger.trace((v?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var _=k?Math.min(k,T.maxStarvationDelay):T.maxStarvationDelay,O=T.abrBandWidthFactor,G=T.abrBandWidthUpFactor;if(!v){var Y=this.bitrateTestDelay;if(Y){var ee=k?Math.min(k,T.maxLoadingDelay):T.maxLoadingDelay;_=ee-Y,V.logger.trace("bitrate test took "+Math.round(1e3*Y)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*_)+" ms"),O=G=1}}return g=this.findBestLevel(m,x,f,v+_,O,G),Math.max(g,0)},j.findBestLevel=function(w,d,p,f,T,x){for(var E,k=this.fragCurrent,C=this.partCurrent,b=this.lastLoadedFragLevel,m=this.hls.levels,v=m[b],g=!!(v!=null&&(E=v.details)!==null&&E!==void 0&&E.live),_=v==null?void 0:v.codecSet,O=C?C.duration:k?k.duration:0,G=p;G>=d;G--){var Y=m[G];if(!Y||_&&Y.codecSet!==_)continue;var ee=Y.details,fe=(C?ee==null?void 0:ee.partTarget:ee==null?void 0:ee.averagetargetduration)||O,pe=void 0;G<=b?pe=T*w:pe=x*w;var xe=m[G].maxBitrate,Ce=xe*fe/pe;if(V.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+G+"/"+Math.round(pe)+"/"+xe+"/"+fe+"/"+f+"/"+Ce),pe>xe&&(!Ce||g&&!this.bitrateTestDelay||Ce<f))return G}return-1},H(I,[{key:"nextAutoLevel",get:function(){var w=this._nextAutoLevel,d=this.bwEstimator;if(w!==-1&&(!d||!d.canEstimate()))return w;var p=this.getNextABRAutoLevel();return w!==-1&&(p=Math.min(w,p)),p},set:function(w){this._nextAutoLevel=w}}]),I}();re.default=F},"./src/controller/audio-stream-controller.ts":function(ze,re,z){"use strict";z.r(re);var ae=z("./src/polyfills/number.ts"),K=z("./src/controller/base-stream-controller.ts"),M=z("./src/events.ts"),se=z("./src/utils/buffer-helper.ts"),q=z("./src/controller/fragment-tracker.ts"),X=z("./src/types/level.ts"),V=z("./src/types/loader.ts"),L=z("./src/loader/fragment.ts"),H=z("./src/demux/chunk-cache.ts"),F=z("./src/demux/transmuxer-interface.ts"),I=z("./src/types/transmuxer.ts"),j=z("./src/controller/fragment-finders.ts"),P=z("./src/utils/discontinuities.ts"),w=z("./src/errors.ts"),d=z("./src/utils/logger.ts");function p(){return p=Object.assign||function(k){for(var C=1;C<arguments.length;C++){var b=arguments[C];for(var m in b)Object.prototype.hasOwnProperty.call(b,m)&&(k[m]=b[m])}return k},p.apply(this,arguments)}function f(k,C){k.prototype=Object.create(C.prototype),k.prototype.constructor=k,T(k,C)}function T(k,C){return T=Object.setPrototypeOf||function(m,v){return m.__proto__=v,m},T(k,C)}var x=100,E=function(k){f(C,k);function C(m,v){var g;return g=k.call(this,m,v,"[audio-stream-controller]")||this,g.videoBuffer=null,g.videoTrackCC=-1,g.waitingVideoCC=-1,g.audioSwitch=!1,g.trackId=-1,g.waitingData=null,g.mainDetails=null,g.bufferFlushed=!1,g._registerListeners(),g}var b=C.prototype;return b.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},b._registerListeners=function(){var v=this.hls;v.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),v.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.on(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),v.on(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),v.on(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),v.on(M.Events.ERROR,this.onError,this),v.on(M.Events.BUFFER_RESET,this.onBufferReset,this),v.on(M.Events.BUFFER_CREATED,this.onBufferCreated,this),v.on(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),v.on(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),v.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b._unregisterListeners=function(){var v=this.hls;v.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),v.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.off(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),v.off(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),v.off(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),v.off(M.Events.ERROR,this.onError,this),v.off(M.Events.BUFFER_RESET,this.onBufferReset,this),v.off(M.Events.BUFFER_CREATED,this.onBufferCreated,this),v.off(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),v.off(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),v.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b.onInitPtsFound=function(v,g){var _=g.frag,O=g.id,G=g.initPTS;if(O==="main"){var Y=_.cc;this.initPTS[_.cc]=G,this.log("InitPTS for cc: "+Y+" found from main: "+G),this.videoTrackCC=Y,this.state===K.State.WAITING_INIT_PTS&&this.tick()}},b.startLoad=function(v){if(!this.levels){this.startPosition=v,this.state=K.State.STOPPED;return}var g=this.lastCurrentTime;this.stopLoad(),this.setInterval(x),this.fragLoadError=0,g>0&&v===-1?(this.log("Override startPosition with lastCurrentTime @"+g.toFixed(3)),this.state=K.State.IDLE):(this.loadedmetadata=!1,this.state=K.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=v,this.tick()},b.doTick=function(){switch(this.state){case K.State.IDLE:this.doTickIdle();break;case K.State.WAITING_TRACK:{var v,g=this.levels,_=this.trackId,O=g==null||((v=g[_])===null||v===void 0)?void 0:v.details;if(O){if(this.waitForCdnTuneIn(O))break;this.state=K.State.WAITING_INIT_PTS}break}case K.State.FRAG_LOADING_WAITING_RETRY:{var G,Y=performance.now(),ee=this.retryDate;(!ee||Y>=ee||(G=this.media)!==null&&G!==void 0&&G.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=K.State.IDLE);break}case K.State.WAITING_INIT_PTS:{var fe=this.waitingData;if(fe){var pe=fe.frag,xe=fe.part,Ce=fe.cache,be=fe.complete;if(this.initPTS[pe.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=K.State.FRAG_LOADING;var Oe=Ce.flush(),We={frag:pe,part:xe,payload:Oe,networkDetails:null};this._handleFragmentLoadProgress(We),be&&k.prototype._handleFragmentLoadComplete.call(this,We)}else if(this.videoTrackCC!==this.waitingVideoCC)d.logger.log("Waiting fragment cc ("+pe.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var Me=this.getLoadPosition(),ct=se.BufferHelper.bufferInfo(this.mediaBuffer,Me,this.config.maxBufferHole),Ge=Object(j.fragmentWithinToleranceTest)(ct.end,this.config.maxFragLookUpTolerance,pe);Ge<0&&(d.logger.log("Waiting fragment cc ("+pe.cc+") @ "+pe.start+" cancelled because another fragment at "+ct.end+" is needed"),this.clearWaitingFragment())}}else this.state=K.State.IDLE}}this.onTickEnd()},b.clearWaitingFragment=function(){var v=this.waitingData;v&&(this.fragmentTracker.removeFragment(v.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=K.State.IDLE)},b.onTickEnd=function(){var v=this.media;if(!v||!v.readyState)return;var g=this.mediaBuffer?this.mediaBuffer:v,_=g.buffered;!this.loadedmetadata&&_.length&&(this.loadedmetadata=!0),this.lastCurrentTime=v.currentTime},b.doTickIdle=function(){var v,g,_=this.hls,O=this.levels,G=this.media,Y=this.trackId,ee=_.config;if(!O||!O[Y])return;if(!G&&(this.startFragRequested||!ee.startFragPrefetch))return;var fe=O[Y],pe=fe.details;if(!pe||pe.live&&this.levelLastLoaded!==Y||this.waitForCdnTuneIn(pe)){this.state=K.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,L.ElementaryStreamTypes.AUDIO,V.PlaylistLevelType.AUDIO));var xe=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,V.PlaylistLevelType.AUDIO);if(xe===null)return;var Ce=xe.len,be=this.getMaxBufferLength(),Oe=this.audioSwitch;if(Ce>=be&&!Oe)return;if(!Oe&&this._streamEnded(xe,pe)){_.trigger(M.Events.BUFFER_EOS,{type:"audio"}),this.state=K.State.ENDED;return}var We=pe.fragments,Me=We[0].start,ct=xe.end;if(Oe){var Ge=this.getLoadPosition();ct=Ge,pe.PTSKnown&&Ge<Me&&((xe.end>Me||xe.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),G.currentTime=Me+.05))}var Je=this.getNextFragment(ct,pe);if(!Je){this.bufferFlushed=!0;return}((v=Je.decryptdata)===null||v===void 0?void 0:v.keyFormat)==="identity"&&!((g=Je.decryptdata)!==null&&g!==void 0&&g.key)?this.loadKey(Je,pe):this.loadFragment(Je,pe,ct)},b.getMaxBufferLength=function(){var v=k.prototype.getMaxBufferLength.call(this),g=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,V.PlaylistLevelType.MAIN);return g===null?v:Math.max(v,g.len)},b.onMediaDetaching=function(){this.videoBuffer=null,k.prototype.onMediaDetaching.call(this)},b.onAudioTracksUpdated=function(v,g){var _=g.audioTracks;this.resetTransmuxer(),this.levels=_.map(function(O){return new X.Level(O)})},b.onAudioTrackSwitching=function(v,g){var _=!!g.url;this.trackId=g.id;var O=this.fragCurrent;O!=null&&O.loader&&O.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),_?this.setInterval(x):this.resetTransmuxer(),_?(this.audioSwitch=!0,this.state=K.State.IDLE):this.state=K.State.STOPPED,this.tick()},b.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},b.onLevelLoaded=function(v,g){this.mainDetails=g.details},b.onAudioTrackLoaded=function(v,g){var _,O=this.levels,G=g.details,Y=g.id;if(!O){this.warn("Audio tracks were reset while loading level "+Y);return}this.log("Track "+Y+" loaded ["+G.startSN+","+G.endSN+"],duration:"+G.totalduration);var ee=O[Y],fe=0;if(G.live||(_=ee.details)!==null&&_!==void 0&&_.live){var pe=this.mainDetails;if(G.fragments[0]||(G.deltaUpdateFailed=!0),G.deltaUpdateFailed||!pe)return;!ee.details&&G.hasProgramDateTime&&pe.hasProgramDateTime?(Object(P.alignMediaPlaylistByPDT)(G,pe),fe=G.fragments[0].start):fe=this.alignPlaylists(G,ee.details)}ee.details=G,this.levelLastLoaded=Y,!this.startFragRequested&&(this.mainDetails||!G.live)&&this.setStartPosition(ee.details,fe),this.state===K.State.WAITING_TRACK&&!this.waitForCdnTuneIn(G)&&(this.state=K.State.IDLE),this.tick()},b._handleFragmentLoadProgress=function(v){var g,_=v.frag,O=v.part,G=v.payload,Y=this.config,ee=this.trackId,fe=this.levels;if(!fe){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+_.sn+" of level "+_.level+" will not be buffered");return}var pe=fe[ee];console.assert(pe,"Audio track is defined on fragment load progress");var xe=pe.details;console.assert(xe,"Audio track details are defined on fragment load progress");var Ce=Y.defaultAudioCodec||pe.audioCodec||"mp4a.40.2",be=this.transmuxer;be||(be=this.transmuxer=new F.default(this.hls,V.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Oe=this.initPTS[_.cc],We=(g=_.initSegment)===null||g===void 0?void 0:g.data;if(Oe!==void 0){var Me=!1,ct=O?O.index:-1,Ge=ct!==-1,Je=new I.ChunkMetadata(_.level,_.sn,_.stats.chunkCount,G.byteLength,ct,Ge);be.push(G,We,Ce,"",_,O,xe.totalduration,Me,Je,Oe)}else{d.logger.log("Unknown video PTS for cc "+_.cc+", waiting for video PTS before demuxing audio frag "+_.sn+" of ["+xe.startSN+" ,"+xe.endSN+"],track "+ee);var Xe=this.waitingData=this.waitingData||{frag:_,part:O,cache:new H.default,complete:!1},Ye=Xe.cache;Ye.push(new Uint8Array(G)),this.waitingVideoCC=this.videoTrackCC,this.state=K.State.WAITING_INIT_PTS}},b._handleFragmentLoadComplete=function(v){if(this.waitingData){this.waitingData.complete=!0;return}k.prototype._handleFragmentLoadComplete.call(this,v)},b.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},b.onBufferCreated=function(v,g){var _=g.tracks.audio;_&&(this.mediaBuffer=_.buffer),g.tracks.video&&(this.videoBuffer=g.tracks.video.buffer)},b.onFragBuffered=function(v,g){var _=g.frag,O=g.part;if(_.type!==V.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(_)){this.warn("Fragment "+_.sn+(O?" p: "+O.index:"")+" of level "+_.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}_.sn!=="initSegment"&&(this.fragPrevious=_,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(_,O)},b.onError=function(v,g){switch(g.details){case w.ErrorDetails.FRAG_LOAD_ERROR:case w.ErrorDetails.FRAG_LOAD_TIMEOUT:case w.ErrorDetails.KEY_LOAD_ERROR:case w.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(V.PlaylistLevelType.AUDIO,g);break;case w.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case w.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==K.State.ERROR&&this.state!==K.State.STOPPED&&(this.state=g.fatal?K.State.ERROR:K.State.IDLE,this.warn(g.details+" while loading frag, switching to "+this.state+" state"));break;case w.ErrorDetails.BUFFER_FULL_ERROR:if(g.parent==="audio"&&(this.state===K.State.PARSING||this.state===K.State.PARSED)){var _=!0,O=this.getFwdBufferInfo(this.mediaBuffer,V.PlaylistLevelType.AUDIO);O&&O.len>.5&&(_=!this.reduceMaxBufferLength(O.len)),_&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,k.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},b.onBufferFlushed=function(v,g){var _=g.type;_===L.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},b._handleTransmuxComplete=function(v){var g,_="audio",O=this.hls,G=v.remuxResult,Y=v.chunkMeta,ee=this.getCurrentContext(Y);if(!ee){this.warn("The loading context changed while buffering fragment "+Y.sn+" of level "+Y.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(Y.level);return}var fe=ee.frag,pe=ee.part,xe=G.audio,Ce=G.text,be=G.id3,Oe=G.initSegment;if(this.fragContextChanged(fe))return;if(this.state=K.State.PARSING,this.audioSwitch&&xe&&this.completeAudioSwitch(),Oe!=null&&Oe.tracks&&(this._bufferInitSegment(Oe.tracks,fe,Y),O.trigger(M.Events.FRAG_PARSING_INIT_SEGMENT,{frag:fe,id:_,tracks:Oe.tracks})),xe){var We=xe.startPTS,Me=xe.endPTS,ct=xe.startDTS,Ge=xe.endDTS;pe&&(pe.elementaryStreams[L.ElementaryStreamTypes.AUDIO]={startPTS:We,endPTS:Me,startDTS:ct,endDTS:Ge}),fe.setElementaryStreamInfo(L.ElementaryStreamTypes.AUDIO,We,Me,ct,Ge),this.bufferFragmentData(xe,fe,pe,Y)}if(be!=null&&(g=be.samples)!==null&&g!==void 0&&g.length){var Je=p({frag:fe,id:_},be);O.trigger(M.Events.FRAG_PARSING_METADATA,Je)}if(Ce){var Xe=p({frag:fe,id:_},Ce);O.trigger(M.Events.FRAG_PARSING_USERDATA,Xe)}},b._bufferInitSegment=function(v,g,_){if(this.state!==K.State.PARSING)return;v.video&&delete v.video;var O=v.audio;if(!O)return;O.levelCodec=O.codec,O.id="audio",this.log("Init audio buffer, container:"+O.container+", codecs[parsed]=["+O.codec+"]"),this.hls.trigger(M.Events.BUFFER_CODECS,v);var G=O.initSegment;if(G!=null&&G.byteLength){var Y={type:"audio",frag:g,part:null,chunkMeta:_,parent:g.type,data:G};this.hls.trigger(M.Events.BUFFER_APPENDING,Y)}this.tick()},b.loadFragment=function(v,g,_){var O=this.fragmentTracker.getState(v);this.fragCurrent=v,(this.audioSwitch||O===q.FragmentState.NOT_LOADED||O===q.FragmentState.PARTIAL)&&(v.sn==="initSegment"?this._loadInitSegment(v):g.live&&!Object(ae.isFiniteNumber)(this.initPTS[v.cc])?(this.log("Waiting for video PTS in continuity counter "+v.cc+" of live stream before loading audio fragment "+v.sn+" of level "+this.trackId),this.state=K.State.WAITING_INIT_PTS):(this.startFragRequested=!0,k.prototype.loadFragment.call(this,v,g,_)))},b.completeAudioSwitch=function(){var v=this.hls,g=this.media,_=this.trackId;g&&(this.log("Switching audio track : flushing all audio"),k.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,v.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:_})},C}(K.default);re.default=E},"./src/controller/audio-track-controller.ts":function(ze,re,z){"use strict";z.r(re);var ae=z("./src/events.ts"),K=z("./src/errors.ts"),M=z("./src/controller/base-playlist-controller.ts"),se=z("./src/types/loader.ts");function q(F,I){for(var j=0;j<I.length;j++){var P=I[j];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(F,P.key,P)}}function X(F,I,j){return I&&q(F.prototype,I),j&&q(F,j),F}function V(F,I){F.prototype=Object.create(I.prototype),F.prototype.constructor=F,L(F,I)}function L(F,I){return L=Object.setPrototypeOf||function(P,w){return P.__proto__=w,P},L(F,I)}var H=function(F){V(I,F);function I(P){var w;return w=F.call(this,P,"[audio-track-controller]")||this,w.tracks=[],w.groupId=null,w.tracksInGroup=[],w.trackId=-1,w.trackName="",w.selectDefaultTrack=!0,w.registerListeners(),w}var j=I.prototype;return j.registerListeners=function(){var w=this.hls;w.on(ae.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.on(ae.Events.MANIFEST_PARSED,this.onManifestParsed,this),w.on(ae.Events.LEVEL_LOADING,this.onLevelLoading,this),w.on(ae.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),w.on(ae.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),w.on(ae.Events.ERROR,this.onError,this)},j.unregisterListeners=function(){var w=this.hls;w.off(ae.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.off(ae.Events.MANIFEST_PARSED,this.onManifestParsed,this),w.off(ae.Events.LEVEL_LOADING,this.onLevelLoading,this),w.off(ae.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),w.off(ae.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),w.off(ae.Events.ERROR,this.onError,this)},j.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,F.prototype.destroy.call(this)},j.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},j.onManifestParsed=function(w,d){this.tracks=d.audioTracks||[]},j.onAudioTrackLoaded=function(w,d){var p=d.id,f=d.details,T=this.tracksInGroup[p];if(!T){this.warn("Invalid audio track id "+p);return}var x=T.details;T.details=d.details,this.log("audioTrack "+p+" loaded ["+f.startSN+"-"+f.endSN+"]"),p===this.trackId&&(this.retryCount=0,this.playlistLoaded(p,d,x))},j.onLevelLoading=function(w,d){this.switchLevel(d.level)},j.onLevelSwitching=function(w,d){this.switchLevel(d.level)},j.switchLevel=function(w){var d=this.hls.levels[w];if(!(d!=null&&d.audioGroupIds))return;var p=d.audioGroupIds[d.urlId];if(this.groupId!==p){this.groupId=p;var f=this.tracks.filter(function(x){return!p||x.groupId===p});this.selectDefaultTrack&&!f.some(function(x){return x.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=f;var T={audioTracks:f};this.log("Updating audio tracks, "+f.length+' track(s) found in "'+p+'" group-id'),this.hls.trigger(ae.Events.AUDIO_TRACKS_UPDATED,T),this.selectInitialTrack()}},j.onError=function(w,d){if(F.prototype.onError.call(this,w,d),d.fatal||!d.context)return;d.context.type===se.PlaylistContextType.AUDIO_TRACK&&d.context.id===this.trackId&&d.context.groupId===this.groupId&&this.retryLoadingOrFail(d)},j.setAudioTrack=function(w){var d=this.tracksInGroup;if(w<0||w>=d.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var p=d[this.trackId];this.log("Now switching to audio-track index "+w);var f=d[w],T=f.id,x=f.groupId,E=x===void 0?"":x,k=f.name,C=f.type,b=f.url;if(this.trackId=w,this.trackName=k,this.selectDefaultTrack=!1,this.hls.trigger(ae.Events.AUDIO_TRACK_SWITCHING,{id:T,groupId:E,name:k,type:C,url:b}),f.details&&!f.details.live)return;var m=this.switchParams(f.url,p==null?void 0:p.details);this.loadPlaylist(m)},j.selectInitialTrack=function(){var w=this.tracksInGroup;console.assert(w.length,"Initial audio track should be selected when tracks are known");var d=this.trackName,p=this.findTrackId(d)||this.findTrackId();p!==-1?this.setAudioTrack(p):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(ae.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},j.findTrackId=function(w){for(var d=this.tracksInGroup,p=0;p<d.length;p++){var f=d[p];if((!this.selectDefaultTrack||f.default)&&(!w||w===f.name))return f.id}return-1},j.loadPlaylist=function(w){var d=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(d)){var p=d.id,f=d.groupId,T=d.url;if(w)try{T=w.addDirectives(T)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("loading audio-track playlist for id: "+p),this.clearTimer(),this.hls.trigger(ae.Events.AUDIO_TRACK_LOADING,{url:T,id:p,groupId:f,deliveryDirectives:w||null})}},X(I,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(w){this.selectDefaultTrack=!1,this.setAudioTrack(w)}}]),I}(M.default);re.default=H},"./src/controller/base-playlist-controller.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return X});var ae=z("./src/polyfills/number.ts"),K=z("./src/types/level.ts"),M=z("./src/controller/level-helper.ts"),se=z("./src/utils/logger.ts"),q=z("./src/errors.ts"),X=function(){function V(H,F){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=se.logger.log.bind(se.logger,F+":"),this.warn=se.logger.warn.bind(se.logger,F+":"),this.hls=H}var L=V.prototype;return L.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},L.onError=function(F,I){I.fatal&&I.type===q.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},L.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},L.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},L.stopLoad=function(){this.canLoad=!1,this.clearTimer()},L.switchParams=function(F,I){var j=I==null?void 0:I.renditionReports;if(j)for(var P=0;P<j.length;P++){var w=j[P],d=""+w.URI;if(d===F.substr(-d.length)){var p=parseInt(w["LAST-MSN"]),f=parseInt(w["LAST-PART"]);if(I&&this.hls.config.lowLatencyMode){var T=Math.min(I.age-I.partTarget,I.targetduration);f!==void 0&&T>I.partTarget&&(f+=1)}if(Object(ae.isFiniteNumber)(p))return new K.HlsUrlParameters(p,Object(ae.isFiniteNumber)(f)?f:void 0,K.HlsSkip.No)}}},L.loadPlaylist=function(F){},L.shouldLoadTrack=function(F){return this.canLoad&&F&&!!F.url&&(!F.details||F.details.live)},L.playlistLoaded=function(F,I,j){var P=this,w=I.details,d=I.stats,p=d.loading.end?Math.max(0,self.performance.now()-d.loading.end):0;if(w.advancedDateTime=Date.now()-p,w.live||j!=null&&j.live){if(w.reloaded(j),j&&this.log("live playlist "+F+" "+(w.advanced?"REFRESHED "+w.lastPartSn+"-"+w.lastPartIndex:"MISSED")),j&&w.fragments.length>0&&Object(M.mergeDetails)(j,w),!this.canLoad||!w.live)return;var f,T=void 0,x=void 0;if(w.canBlockReload&&w.endSN&&w.advanced){var E=this.hls.config.lowLatencyMode,k=w.lastPartSn,C=w.endSN,b=w.lastPartIndex,m=b!==-1,v=k===C,g=E?0:b;m?(T=v?C+1:k,x=v?g:b+1):T=C+1;var _=w.age,O=_+w.ageHeader,G=Math.min(O-w.partTarget,w.targetduration*1.5);if(G>0){if(j&&G>j.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+j.tuneInGoal+" to: "+G+" with playlist age: "+w.age),G=0;else{var Y=Math.floor(G/w.targetduration);if(T+=Y,x!==void 0){var ee=Math.round(G%w.targetduration/w.partTarget);x+=ee}this.log("CDN Tune-in age: "+w.ageHeader+"s last advanced "+_.toFixed(2)+"s goal: "+G+" skip sn "+Y+" to part "+x)}w.tuneInGoal=G}if(f=this.getDeliveryDirectives(w,I.deliveryDirectives,T,x),E||!v){this.loadPlaylist(f);return}}else f=this.getDeliveryDirectives(w,I.deliveryDirectives,T,x);var fe=Object(M.computeReloadInterval)(w,d);T!==void 0&&w.canBlockReload&&(fe-=w.partTarget||1),this.log("reload live playlist "+F+" in "+Math.round(fe)+" ms"),this.timer=self.setTimeout(function(){return P.loadPlaylist(f)},fe)}else this.clearTimer()},L.getDeliveryDirectives=function(F,I,j,P){var w=Object(K.getSkipValue)(F,j);return I!=null&&I.skip&&F.deltaUpdateFailed&&(j=I.msn,P=I.part,w=K.HlsSkip.No),new K.HlsUrlParameters(j,P,w)},L.retryLoadingOrFail=function(F){var I=this,j=this.hls.config,P=this.retryCount<j.levelLoadingMaxRetry;if(P){var w;if(this.retryCount++,F.details.indexOf("LoadTimeOut")>-1&&(w=F.context)!==null&&w!==void 0&&w.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+F.details+'"'),this.loadPlaylist();else{var d=Math.min(Math.pow(2,this.retryCount)*j.levelLoadingRetryDelay,j.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return I.loadPlaylist()},d),this.warn("retry playlist loading #"+this.retryCount+" in "+d+' ms after "'+F.details+'"')}}else this.warn('cannot recover from error "'+F.details+'"'),this.clearTimer(),F.fatal=!0;return P},V}()},"./src/controller/base-stream-controller.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"State",function(){return C}),z.d(re,"default",function(){return b});var ae=z("./src/polyfills/number.ts"),K=z("./src/task-loop.ts"),M=z("./src/controller/fragment-tracker.ts"),se=z("./src/utils/buffer-helper.ts"),q=z("./src/utils/logger.ts"),X=z("./src/events.ts"),V=z("./src/errors.ts"),L=z("./src/types/transmuxer.ts"),H=z("./src/utils/mp4-tools.ts"),F=z("./src/utils/discontinuities.ts"),I=z("./src/controller/fragment-finders.ts"),j=z("./src/controller/level-helper.ts"),P=z("./src/loader/fragment-loader.ts"),w=z("./src/crypt/decrypter.ts"),d=z("./src/utils/time-ranges.ts"),p=z("./src/types/loader.ts");function f(m,v){for(var g=0;g<v.length;g++){var _=v[g];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(m,_.key,_)}}function T(m,v,g){return v&&f(m.prototype,v),g&&f(m,g),m}function x(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m}function E(m,v){m.prototype=Object.create(v.prototype),m.prototype.constructor=m,k(m,v)}function k(m,v){return k=Object.setPrototypeOf||function(_,O){return _.__proto__=O,_},k(m,v)}var C={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},b=function(m){E(v,m);function v(_,O,G){var Y;return Y=m.call(this)||this,Y.hls=void 0,Y.fragPrevious=null,Y.fragCurrent=null,Y.fragmentTracker=void 0,Y.transmuxer=null,Y._state=C.STOPPED,Y.media=void 0,Y.mediaBuffer=void 0,Y.config=void 0,Y.bitrateTest=!1,Y.lastCurrentTime=0,Y.nextLoadPosition=0,Y.startPosition=0,Y.loadedmetadata=!1,Y.fragLoadError=0,Y.retryDate=0,Y.levels=null,Y.fragmentLoader=void 0,Y.levelLastLoaded=null,Y.startFragRequested=!1,Y.decrypter=void 0,Y.initPTS=[],Y.onvseeking=null,Y.onvended=null,Y.logPrefix="",Y.log=void 0,Y.warn=void 0,Y.logPrefix=G,Y.log=q.logger.log.bind(q.logger,G+":"),Y.warn=q.logger.warn.bind(q.logger,G+":"),Y.hls=_,Y.fragmentLoader=new P.default(_.config),Y.fragmentTracker=O,Y.config=_.config,Y.decrypter=new w.default(_,_.config),_.on(X.Events.KEY_LOADED,Y.onKeyLoaded,x(Y)),Y}var g=v.prototype;return g.doTick=function(){this.onTickEnd()},g.onTickEnd=function(){},g.startLoad=function(O){},g.stopLoad=function(){this.fragmentLoader.abort();var O=this.fragCurrent;O&&this.fragmentTracker.removeFragment(O),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=C.STOPPED},g._streamEnded=function(O,G){var Y=this.fragCurrent,ee=this.fragmentTracker;if(!G.live&&Y&&Y.sn===G.endSN&&!O.nextStart){var fe=ee.getState(Y);return fe===M.FragmentState.PARTIAL||fe===M.FragmentState.OK}return!1},g.onMediaAttached=function(O,G){var Y=this.media=this.mediaBuffer=G.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),Y.addEventListener("seeking",this.onvseeking),Y.addEventListener("ended",this.onvended);var ee=this.config;this.levels&&ee.autoStartLoad&&this.state===C.STOPPED&&this.startLoad(ee.startPosition)},g.onMediaDetaching=function(){var O=this.media;O!=null&&O.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),O&&(O.removeEventListener("seeking",this.onvseeking),O.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},g.onMediaSeeking=function(){var O=this.config,G=this.fragCurrent,Y=this.media,ee=this.mediaBuffer,fe=this.state,pe=Y?Y.currentTime:0,xe=se.BufferHelper.bufferInfo(ee||Y,pe,O.maxBufferHole);if(this.log("media seeking to "+(Object(ae.isFiniteNumber)(pe)?pe.toFixed(3):pe)+", state: "+fe),fe===C.ENDED)this.resetLoadingState();else if(G&&!xe.len){var Ce=O.maxFragLookUpTolerance,be=G.start-Ce,Oe=G.start+G.duration+Ce,We=pe>Oe;(pe<be||We)&&(We&&G.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),G.loader.abort()),this.resetLoadingState())}Y&&(this.lastCurrentTime=pe),!this.loadedmetadata&&!xe.len&&(this.nextLoadPosition=this.startPosition=pe),this.tickImmediate()},g.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},g.onKeyLoaded=function(O,G){if(this.state!==C.KEY_LOADING||G.frag!==this.fragCurrent||!this.levels)return;this.state=C.IDLE;var Y=this.levels[G.frag.level].details;Y&&this.loadFragment(G.frag,Y,G.frag.start)},g.onHandlerDestroying=function(){this.stopLoad(),m.prototype.onHandlerDestroying.call(this)},g.onHandlerDestroyed=function(){this.state=C.STOPPED,this.hls.off(X.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,m.prototype.onHandlerDestroyed.call(this)},g.loadKey=function(O,G){this.log("Loading key for "+O.sn+" of ["+G.startSN+"-"+G.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+O.level),this.state=C.KEY_LOADING,this.fragCurrent=O,this.hls.trigger(X.Events.KEY_LOADING,{frag:O})},g.loadFragment=function(O,G,Y){this._loadFragForPlayback(O,G,Y)},g._loadFragForPlayback=function(O,G,Y){var ee=this,fe=function(xe){if(ee.fragContextChanged(O)){ee.warn("Fragment "+O.sn+(xe.part?" p: "+xe.part.index:"")+" of level "+O.level+" was dropped during download."),ee.fragmentTracker.removeFragment(O);return}O.stats.chunkCount++,ee._handleFragmentLoadProgress(xe)};this._doFragLoad(O,G,Y,fe).then(function(pe){if(!pe)return;ee.fragLoadError=0;var xe=ee.state;if(ee.fragContextChanged(O)){(xe===C.FRAG_LOADING||xe===C.BACKTRACKING||!ee.fragCurrent&&xe===C.PARSING)&&(ee.fragmentTracker.removeFragment(O),ee.state=C.IDLE);return}if("payload"in pe&&(ee.log("Loaded fragment "+O.sn+" of level "+O.level),ee.hls.trigger(X.Events.FRAG_LOADED,pe),ee.state===C.BACKTRACKING)){ee.fragmentTracker.backtrack(O,pe),ee.resetFragmentLoading(O);return}ee._handleFragmentLoadComplete(pe)}).catch(function(pe){ee.warn(pe),ee.resetFragmentLoading(O)})},g.flushMainBuffer=function(O,G,Y){if(Y===void 0&&(Y=null),!(O-G))return;var ee={startOffset:O,endOffset:G,type:Y};this.fragLoadError=0,this.hls.trigger(X.Events.BUFFER_FLUSHING,ee)},g._loadInitSegment=function(O){var G=this;this._doFragLoad(O).then(function(Y){if(!Y||G.fragContextChanged(O)||!G.levels)throw new Error("init load aborted");return Y}).then(function(Y){var ee=G.hls,fe=Y.payload,pe=O.decryptdata;if(fe&&fe.byteLength>0&&pe&&pe.key&&pe.iv&&pe.method==="AES-128"){var xe=self.performance.now();return G.decrypter.webCryptoDecrypt(new Uint8Array(fe),pe.key.buffer,pe.iv.buffer).then(function(Ce){var be=self.performance.now();return ee.trigger(X.Events.FRAG_DECRYPTED,{frag:O,payload:Ce,stats:{tstart:xe,tdecrypt:be}}),Y.payload=Ce,Y})}return Y}).then(function(Y){var ee=G.fragCurrent,fe=G.hls,pe=G.levels;if(!pe)throw new Error("init load aborted, missing levels");var xe=pe[O.level].details;console.assert(xe,"Level details are defined when init segment is loaded");var Ce=O.stats;G.state=C.IDLE,G.fragLoadError=0,O.data=new Uint8Array(Y.payload),Ce.parsing.start=Ce.buffering.start=self.performance.now(),Ce.parsing.end=Ce.buffering.end=self.performance.now(),Y.frag===ee&&fe.trigger(X.Events.FRAG_BUFFERED,{stats:Ce,frag:ee,part:null,id:O.type}),G.tick()}).catch(function(Y){G.warn(Y),G.resetFragmentLoading(O)})},g.fragContextChanged=function(O){var G=this.fragCurrent;return!O||!G||O.level!==G.level||O.sn!==G.sn||O.urlId!==G.urlId},g.fragBufferedComplete=function(O,G){var Y=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+O.type+" sn: "+O.sn+(G?" part: "+G.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+O.level+" "+d.default.toString(se.BufferHelper.getBuffered(Y))),this.state=C.IDLE,this.tick()},g._handleFragmentLoadComplete=function(O){var G=this.transmuxer;if(!G)return;var Y=O.frag,ee=O.part,fe=O.partsLoaded,pe=!fe||fe.length===0||fe.some(function(Ce){return!Ce}),xe=new L.ChunkMetadata(Y.level,Y.sn,Y.stats.chunkCount+1,0,ee?ee.index:-1,!pe);G.flush(xe)},g._handleFragmentLoadProgress=function(O){},g._doFragLoad=function(O,G,Y,ee){var fe=this;if(Y===void 0&&(Y=null),!this.levels)throw new Error("frag load aborted, missing levels");if(Y=Math.max(O.start,Y||0),this.config.lowLatencyMode&&G){var pe=G.partList;if(pe&&ee){Y>O.end&&G.fragmentHint&&(O=G.fragmentHint);var xe=this.getNextPart(pe,O,Y);if(xe>-1){var Ce=pe[xe];return this.log("Loading part sn: "+O.sn+" p: "+Ce.index+" cc: "+O.cc+" of playlist ["+G.startSN+"-"+G.endSN+"] parts [0-"+xe+"-"+(pe.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+O.level+", target: "+parseFloat(Y.toFixed(3))),this.nextLoadPosition=Ce.start+Ce.duration,this.state=C.FRAG_LOADING,this.hls.trigger(X.Events.FRAG_LOADING,{frag:O,part:pe[xe],targetBufferTime:Y}),this.doFragPartsLoad(O,pe,xe,ee).catch(function(be){return fe.handleFragLoadError(be)})}else if(!O.url||this.loadedEndOfParts(pe,Y))return Promise.resolve(null)}}return this.log("Loading fragment "+O.sn+" cc: "+O.cc+" "+(G?"of ["+G.startSN+"-"+G.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+O.level+", target: "+parseFloat(Y.toFixed(3))),Object(ae.isFiniteNumber)(O.sn)&&!this.bitrateTest&&(this.nextLoadPosition=O.start+O.duration),this.state=C.FRAG_LOADING,this.hls.trigger(X.Events.FRAG_LOADING,{frag:O,targetBufferTime:Y}),this.fragmentLoader.load(O,ee).catch(function(be){return fe.handleFragLoadError(be)})},g.doFragPartsLoad=function(O,G,Y,ee){var fe=this;return new Promise(function(pe,xe){var Ce=[],be=function Oe(We){var Me=G[We];fe.fragmentLoader.loadPart(O,Me,ee).then(function(ct){Ce[Me.index]=ct;var Ge=ct.part;fe.hls.trigger(X.Events.FRAG_LOADED,ct);var Je=G[We+1];if(Je&&Je.fragment===O)Oe(We+1);else return pe({frag:O,part:Ge,partsLoaded:Ce})}).catch(xe)};be(Y)})},g.handleFragLoadError=function(O){var G=O.data;return G&&G.details===V.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(G.frag,G.part):this.hls.trigger(X.Events.ERROR,G),null},g._handleTransmuxerFlush=function(O){var G=this.getCurrentContext(O);if(!G||this.state!==C.PARSING){this.fragCurrent||(this.state=C.IDLE);return}var Y=G.frag,ee=G.part,fe=G.level,pe=self.performance.now();Y.stats.parsing.end=pe,ee&&(ee.stats.parsing.end=pe),this.updateLevelTiming(Y,ee,fe,O.partial)},g.getCurrentContext=function(O){var G=this.levels,Y=O.level,ee=O.sn,fe=O.part;if(!G||!G[Y])return this.warn("Levels object was unset while buffering fragment "+ee+" of level "+Y+". The current chunk will not be buffered."),null;var pe=G[Y],xe=fe>-1?Object(j.getPartWith)(pe,ee,fe):null,Ce=xe?xe.fragment:Object(j.getFragmentWithSN)(pe,ee,this.fragCurrent);return Ce?{frag:Ce,part:xe,level:pe}:null},g.bufferFragmentData=function(O,G,Y,ee){if(!O||this.state!==C.PARSING)return;var fe=O.data1,pe=O.data2,xe=fe;if(fe&&pe&&(xe=Object(H.appendUint8Array)(fe,pe)),!xe||!xe.length)return;var Ce={type:O.type,frag:G,part:Y,chunkMeta:ee,parent:G.type,data:xe};this.hls.trigger(X.Events.BUFFER_APPENDING,Ce),O.dropped&&O.independent&&!Y&&this.flushBufferGap(G)},g.flushBufferGap=function(O){var G=this.media;if(!G)return;if(!se.BufferHelper.isBuffered(G,G.currentTime)){this.flushMainBuffer(0,O.start);return}var Y=G.currentTime,ee=se.BufferHelper.bufferInfo(G,Y,0),fe=O.duration,pe=Math.min(this.config.maxFragLookUpTolerance*2,fe*.25),xe=Math.max(Math.min(O.start-pe,ee.end-pe),Y+pe);O.start-xe>pe&&this.flushMainBuffer(xe,O.start)},g.getFwdBufferInfo=function(O,G){var Y=this.config,ee=this.getLoadPosition();if(!Object(ae.isFiniteNumber)(ee))return null;var fe=se.BufferHelper.bufferInfo(O,ee,Y.maxBufferHole);if(fe.len===0&&fe.nextStart!==void 0){var pe=this.fragmentTracker.getBufferedFrag(ee,G);if(pe&&fe.nextStart<pe.end)return se.BufferHelper.bufferInfo(O,ee,Math.max(fe.nextStart,Y.maxBufferHole))}return fe},g.getMaxBufferLength=function(O){var G=this.config,Y;return O?Y=Math.max(8*G.maxBufferSize/O,G.maxBufferLength):Y=G.maxBufferLength,Math.min(Y,G.maxMaxBufferLength)},g.reduceMaxBufferLength=function(O){var G=this.config,Y=O||G.maxBufferLength;return G.maxMaxBufferLength>=Y?(G.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+G.maxMaxBufferLength+"s"),!0):!1},g.getNextFragment=function(O,G){var Y,ee,fe=G.fragments,pe=fe.length;if(!pe)return null;var xe=this.config,Ce=fe[0].start,be;if(G.live){var Oe=xe.initialLiveManifestSize;if(pe<Oe)return this.warn("Not enough fragments to start playback (have: "+pe+", need: "+Oe+")"),null;!G.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(be=this.getInitialLiveFragment(G,fe),this.startPosition=be?this.hls.liveSyncPosition||be.start:O)}else O<=Ce&&(be=fe[0]);if(!be){var We=xe.lowLatencyMode?G.partEnd:G.fragmentEnd;be=this.getFragmentAtPosition(O,We,G)}return(Y=be)!==null&&Y!==void 0&&Y.initSegment&&!((ee=be)!==null&&ee!==void 0&&ee.initSegment.data)&&!this.bitrateTest&&(be=be.initSegment),be},g.getNextPart=function(O,G,Y){for(var ee=-1,fe=!1,pe=!0,xe=0,Ce=O.length;xe<Ce;xe++){var be=O[xe];if(pe=pe&&!be.independent,ee>-1&&Y<be.start)break;var Oe=be.loaded;!Oe&&(fe||be.independent||pe)&&be.fragment===G&&(ee=xe),fe=Oe}return ee},g.loadedEndOfParts=function(O,G){var Y=O[O.length-1];return Y&&G>Y.start&&Y.loaded},g.getInitialLiveFragment=function(O,G){var Y=this.fragPrevious,ee=null;if(Y){if(O.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+Y.programDateTime),ee=Object(I.findFragmentByPDT)(G,Y.endProgramDateTime,this.config.maxFragLookUpTolerance)),!ee){var fe=Y.sn+1;if(fe>=O.startSN&&fe<=O.endSN){var pe=G[fe-O.startSN];Y.cc===pe.cc&&(ee=pe,this.log("Live playlist, switching playlist, load frag with next SN: "+ee.sn))}ee||(ee=Object(I.findFragWithCC)(G,Y.cc),ee&&this.log("Live playlist, switching playlist, load frag with same CC: "+ee.sn))}}else{var xe=this.hls.liveSyncPosition;xe!==null&&(ee=this.getFragmentAtPosition(xe,this.bitrateTest?O.fragmentEnd:O.edge,O))}return ee},g.getFragmentAtPosition=function(O,G,Y){var ee=this.config,fe=this.fragPrevious,pe=Y.fragments,xe=Y.endSN,Ce=Y.fragmentHint,be=ee.maxFragLookUpTolerance,Oe=!!(ee.lowLatencyMode&&Y.partList&&Ce);Oe&&Ce&&!this.bitrateTest&&(pe=pe.concat(Ce),xe=Ce.sn);var We;if(O<G){var Me=O>G-be?0:be;We=Object(I.findFragmentByPTS)(fe,pe,O,Me)}else We=pe[pe.length-1];if(We){var ct=We.sn-Y.startSN,Ge=fe&&We.level===fe.level,Je=pe[ct+1],Xe=this.fragmentTracker.getState(We);if(Xe===M.FragmentState.BACKTRACKED){We=null;for(var Ye=ct;pe[Ye]&&this.fragmentTracker.getState(pe[Ye])===M.FragmentState.BACKTRACKED;)fe?We=pe[Ye--]:We=pe[--Ye];We||(We=Je)}else fe&&We.sn===fe.sn&&!Oe&&(Ge&&(We.sn<xe&&this.fragmentTracker.getState(Je)!==M.FragmentState.OK?(this.log("SN "+We.sn+" just loaded, load next one: "+Je.sn),We=Je):We=null))}return We},g.synchronizeToLiveEdge=function(O){var G=this.config,Y=this.media;if(!Y)return;var ee=this.hls.liveSyncPosition,fe=Y.currentTime,pe=O.fragments[0].start,xe=O.edge,Ce=fe>=pe-G.maxFragLookUpTolerance&&fe<=xe;if(ee!==null&&Y.duration>ee&&(fe<ee||!Ce)){var be=G.liveMaxLatencyDuration!==void 0?G.liveMaxLatencyDuration:G.liveMaxLatencyDurationCount*O.targetduration;(!Ce&&Y.readyState<4||fe<xe-be)&&(this.loadedmetadata||(this.nextLoadPosition=ee),Y.readyState&&(this.warn("Playback: "+fe.toFixed(3)+" is located too far from the end of live sliding playlist: "+xe+", reset currentTime to : "+ee.toFixed(3)),Y.currentTime=ee))}},g.alignPlaylists=function(O,G){var Y=this.levels,ee=this.levelLastLoaded,fe=this.fragPrevious,pe=ee!==null?Y[ee]:null,xe=O.fragments.length;if(!xe)return this.warn("No fragments in live playlist"),0;var Ce=O.fragments[0].start,be=!G,Oe=O.alignedSliding&&Object(ae.isFiniteNumber)(Ce);if(be||!Oe&&!Ce){Object(F.alignStream)(fe,pe,O);var We=O.fragments[0].start;return this.log("Live playlist sliding: "+We.toFixed(2)+" start-sn: "+(G?G.startSN:"na")+"->"+O.startSN+" prev-sn: "+(fe?fe.sn:"na")+" fragments: "+xe),We}return Ce},g.waitForCdnTuneIn=function(O){var G=3;return O.live&&O.canBlockReload&&O.tuneInGoal>Math.max(O.partHoldBack,O.partTarget*G)},g.setStartPosition=function(O,G){var Y=this.startPosition;if(Y<G&&(Y=-1),Y===-1||this.lastCurrentTime===-1){var ee=O.startTimeOffset;Object(ae.isFiniteNumber)(ee)?(Y=G+ee,ee<0&&(Y+=O.totalduration),Y=Math.min(Math.max(G,Y),G+O.totalduration),this.log("Start time offset "+ee+" found in playlist, adjust startPosition to "+Y),this.startPosition=Y):O.live?Y=this.hls.liveSyncPosition||G:this.startPosition=Y=0,this.lastCurrentTime=Y}this.nextLoadPosition=Y},g.getLoadPosition=function(){var O=this.media,G=0;return this.loadedmetadata&&O?G=O.currentTime:this.nextLoadPosition&&(G=this.nextLoadPosition),G},g.handleFragLoadAborted=function(O,G){this.transmuxer&&O.sn!=="initSegment"&&O.stats.aborted&&(this.warn("Fragment "+O.sn+(G?" part"+G.index:"")+" of level "+O.level+" was aborted"),this.resetFragmentLoading(O))},g.resetFragmentLoading=function(O){(!this.fragCurrent||!this.fragContextChanged(O))&&(this.state=C.IDLE)},g.onFragmentOrKeyLoadError=function(O,G){if(G.fatal)return;var Y=G.frag;if(!Y||Y.type!==O)return;var ee=this.fragCurrent;console.assert(ee&&Y.sn===ee.sn&&Y.level===ee.level&&Y.urlId===ee.urlId,"Frag load error must match current frag to retry");var fe=this.config;if(this.fragLoadError+1<=fe.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(Y.level))return;var pe=Math.min(Math.pow(2,this.fragLoadError)*fe.fragLoadingRetryDelay,fe.fragLoadingMaxRetryTimeout);this.warn("Fragment "+Y.sn+" of "+O+" "+Y.level+" failed to load, retrying in "+pe+"ms"),this.retryDate=self.performance.now()+pe,this.fragLoadError++,this.state=C.FRAG_LOADING_WAITING_RETRY}else G.levelRetry?(O===p.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=C.IDLE):(q.logger.error(G.details+" reaches max retry, redispatch as fatal ..."),G.fatal=!0,this.hls.stopLoad(),this.state=C.ERROR)},g.afterBufferFlushed=function(O,G,Y){if(!O)return;var ee=se.BufferHelper.getBuffered(O);this.fragmentTracker.detectEvictedFragments(G,ee,Y),this.state===C.ENDED&&this.resetLoadingState()},g.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=C.IDLE},g.resetLiveStartWhenNotLoaded=function(O){if(!this.loadedmetadata){this.startFragRequested=!1;var G=this.levels?this.levels[O].details:null;if(G!=null&&G.live)return this.startPosition=-1,this.setStartPosition(G,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},g.updateLevelTiming=function(O,G,Y,ee){var fe=this,pe=Y.details;console.assert(!!pe,"level.details must be defined");var xe=Object.keys(O.elementaryStreams).reduce(function(Ce,be){var Oe=O.elementaryStreams[be];if(Oe){var We=Oe.endPTS-Oe.startPTS;if(We<=0)return fe.warn("Could not parse fragment "+O.sn+" "+be+" duration reliably ("+We+") resetting transmuxer to fallback to playlist timing"),fe.resetTransmuxer(),Ce||!1;var Me=ee?0:Object(j.updateFragPTSDTS)(pe,O,Oe.startPTS,Oe.endPTS,Oe.startDTS,Oe.endDTS);return fe.hls.trigger(X.Events.LEVEL_PTS_UPDATED,{details:pe,level:Y,drift:Me,type:be,frag:O,start:Oe.startPTS,end:Oe.endPTS}),!0}return Ce},!1);xe?(this.state=C.PARSED,this.hls.trigger(X.Events.FRAG_PARSED,{frag:O,part:G})):this.resetLoadingState()},g.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},T(v,[{key:"state",get:function(){return this._state},set:function(O){var G=this._state;G!==O&&(this._state=O,this.log(G+"->"+O))}}]),v}(K.default)},"./src/controller/buffer-controller.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return I});var ae=z("./src/polyfills/number.ts"),K=z("./src/events.ts"),M=z("./src/utils/logger.ts"),se=z("./src/errors.ts"),q=z("./src/utils/buffer-helper.ts"),X=z("./src/utils/mediasource-helper.ts"),V=z("./src/loader/fragment.ts"),L=z("./src/controller/buffer-operation-queue.ts"),H=Object(X.getMediaSource)(),F=/([ha]vc.)(?:\.[^.,]+)+/,I=function(){function j(w){var d=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var p=d.hls,f=d.media,T=d.mediaSource;M.logger.log("[buffer-controller]: Media source opened"),f&&(d.updateMediaElementDuration(),p.trigger(K.Events.MEDIA_ATTACHED,{media:f})),T&&T.removeEventListener("sourceopen",d._onMediaSourceOpen),d.checkPendingTracks()},this._onMediaSourceClose=function(){M.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){M.logger.log("[buffer-controller]: Media source ended")},this.hls=w,this._initSourceBuffer(),this.registerListeners()}var P=j.prototype;return P.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},P.destroy=function(){this.unregisterListeners(),this.details=null},P.registerListeners=function(){var d=this.hls;d.on(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.on(K.Events.BUFFER_RESET,this.onBufferReset,this),d.on(K.Events.BUFFER_APPENDING,this.onBufferAppending,this),d.on(K.Events.BUFFER_CODECS,this.onBufferCodecs,this),d.on(K.Events.BUFFER_EOS,this.onBufferEos,this),d.on(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),d.on(K.Events.LEVEL_UPDATED,this.onLevelUpdated,this),d.on(K.Events.FRAG_PARSED,this.onFragParsed,this),d.on(K.Events.FRAG_CHANGED,this.onFragChanged,this)},P.unregisterListeners=function(){var d=this.hls;d.off(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.off(K.Events.BUFFER_RESET,this.onBufferReset,this),d.off(K.Events.BUFFER_APPENDING,this.onBufferAppending,this),d.off(K.Events.BUFFER_CODECS,this.onBufferCodecs,this),d.off(K.Events.BUFFER_EOS,this.onBufferEos,this),d.off(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),d.off(K.Events.LEVEL_UPDATED,this.onLevelUpdated,this),d.off(K.Events.FRAG_PARSED,this.onFragParsed,this),d.off(K.Events.FRAG_CHANGED,this.onFragChanged,this)},P._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new L.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},P.onManifestParsed=function(d,p){var f=2;(p.audio&&!p.video||!p.altAudio)&&(f=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=f,this.details=null,M.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},P.onMediaAttaching=function(d,p){var f=this.media=p.media;if(f&&H){var T=this.mediaSource=new H;T.addEventListener("sourceopen",this._onMediaSourceOpen),T.addEventListener("sourceended",this._onMediaSourceEnded),T.addEventListener("sourceclose",this._onMediaSourceClose),f.src=self.URL.createObjectURL(T),this._objectUrl=f.src}},P.onMediaDetaching=function(){var d=this.media,p=this.mediaSource,f=this._objectUrl;if(p){if(M.logger.log("[buffer-controller]: media source detaching"),p.readyState==="open")try{p.endOfStream()}catch(T){M.logger.warn("[buffer-controller]: onMediaDetaching: "+T.message+" while calling endOfStream")}this.onBufferReset(),p.removeEventListener("sourceopen",this._onMediaSourceOpen),p.removeEventListener("sourceended",this._onMediaSourceEnded),p.removeEventListener("sourceclose",this._onMediaSourceClose),d&&(f&&self.URL.revokeObjectURL(f),d.src===f?(d.removeAttribute("src"),d.load()):M.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(K.Events.MEDIA_DETACHED,void 0)},P.onBufferReset=function(){var d=this;this.getSourceBufferTypes().forEach(function(p){var f=d.sourceBuffer[p];try{f&&(d.removeBufferListeners(p),d.mediaSource&&d.mediaSource.removeSourceBuffer(f),d.sourceBuffer[p]=void 0)}catch(T){M.logger.warn("[buffer-controller]: Failed to reset the "+p+" buffer",T)}}),this._initSourceBuffer()},P.onBufferCodecs=function(d,p){var f=this,T=this.getSourceBufferTypes().length;if(Object.keys(p).forEach(function(x){if(T){var E=f.tracks[x];if(E&&typeof E.buffer.changeType=="function"){var k=p[x],C=k.codec,b=k.levelCodec,m=k.container,v=(E.levelCodec||E.codec).replace(F,"$1"),g=(b||C).replace(F,"$1");if(v!==g){var _=m+";codecs="+(b||C);f.appendChangeType(x,_)}}}else f.pendingTracks[x]=p[x]}),T)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},P.appendChangeType=function(d,p){var f=this,T=this.operationQueue,x={execute:function(){var k=f.sourceBuffer[d];k&&(M.logger.log("[buffer-controller]: changing "+d+" sourceBuffer type to "+p),k.changeType(p)),T.shiftAndExecuteNext(d)},onStart:function(){},onComplete:function(){},onError:function(k){M.logger.warn("[buffer-controller]: Failed to change "+d+" SourceBuffer type",k)}};T.append(x,d)},P.onBufferAppending=function(d,p){var f=this,T=this.hls,x=this.operationQueue,E=this.tracks,k=p.data,C=p.type,b=p.frag,m=p.part,v=p.chunkMeta,g=v.buffering[C],_=self.performance.now();g.start=_;var O=b.stats.buffering,G=m?m.stats.buffering:null;O.start===0&&(O.start=_),G&&G.start===0&&(G.start=_);var Y=E.audio,ee=C==="audio"&&v.id===1&&(Y==null?void 0:Y.container)==="audio/mpeg",fe={execute:function(){if(g.executeStart=self.performance.now(),ee){var xe=f.sourceBuffer[C];if(xe){var Ce=b.start-xe.timestampOffset;Math.abs(Ce)>=.1&&(M.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+b.start+" (delta: "+Ce+") sn: "+b.sn+")"),xe.timestampOffset=b.start)}}f.appendExecutor(k,C)},onStart:function(){},onComplete:function(){var xe=self.performance.now();g.executeEnd=g.end=xe,O.first===0&&(O.first=xe),G&&G.first===0&&(G.first=xe);var Ce=f.sourceBuffer,be={};for(var Oe in Ce)be[Oe]=q.BufferHelper.getBuffered(Ce[Oe]);f.appendError=0,f.hls.trigger(K.Events.BUFFER_APPENDED,{type:C,frag:b,part:m,chunkMeta:v,parent:b.type,timeRanges:be})},onError:function(xe){M.logger.error("[buffer-controller]: Error encountered while trying to append to the "+C+" SourceBuffer",xe);var Ce={type:se.ErrorTypes.MEDIA_ERROR,parent:b.type,details:se.ErrorDetails.BUFFER_APPEND_ERROR,err:xe,fatal:!1};xe.code===DOMException.QUOTA_EXCEEDED_ERR?Ce.details=se.ErrorDetails.BUFFER_FULL_ERROR:(f.appendError++,Ce.details=se.ErrorDetails.BUFFER_APPEND_ERROR,f.appendError>T.config.appendErrorMaxRetry&&(M.logger.error("[buffer-controller]: Failed "+T.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),Ce.fatal=!0)),T.trigger(K.Events.ERROR,Ce)}};x.append(fe,C)},P.onBufferFlushing=function(d,p){var f=this,T=this.operationQueue,x=function(k){return{execute:f.removeExecutor.bind(f,k,p.startOffset,p.endOffset),onStart:function(){},onComplete:function(){f.hls.trigger(K.Events.BUFFER_FLUSHED,{type:k})},onError:function(b){M.logger.warn("[buffer-controller]: Failed to remove from "+k+" SourceBuffer",b)}}};p.type?T.append(x(p.type),p.type):this.getSourceBufferTypes().forEach(function(E){T.append(x(E),E)})},P.onFragParsed=function(d,p){var f=this,T=p.frag,x=p.part,E=[],k=x?x.elementaryStreams:T.elementaryStreams;k[V.ElementaryStreamTypes.AUDIOVIDEO]?E.push("audiovideo"):(k[V.ElementaryStreamTypes.AUDIO]&&E.push("audio"),k[V.ElementaryStreamTypes.VIDEO]&&E.push("video"));var C=function(){var m=self.performance.now();T.stats.buffering.end=m,x&&(x.stats.buffering.end=m);var v=x?x.stats:T.stats;f.hls.trigger(K.Events.FRAG_BUFFERED,{frag:T,part:x,stats:v,id:T.type})};E.length===0&&M.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+T.type+" level: "+T.level+" sn: "+T.sn),this.blockBuffers(C,E)},P.onFragChanged=function(d,p){this.flushBackBuffer()},P.onBufferEos=function(d,p){var f=this,T=this.getSourceBufferTypes().reduce(function(x,E){var k=f.sourceBuffer[E];return(!p.type||p.type===E)&&(k&&!k.ended&&(k.ended=!0,M.logger.log("[buffer-controller]: "+E+" sourceBuffer now EOS"))),x&&!!(!k||k.ended)},!0);T&&this.blockBuffers(function(){var x=f.mediaSource;if(!x||x.readyState!=="open")return;x.endOfStream()})},P.onLevelUpdated=function(d,p){var f=p.details;if(!f.fragments.length)return;this.details=f,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},P.flushBackBuffer=function(){var d=this.hls,p=this.details,f=this.media,T=this.sourceBuffer;if(!f||p===null)return;var x=this.getSourceBufferTypes();if(!x.length)return;var E=p.live&&d.config.liveBackBufferLength!==null?d.config.liveBackBufferLength:d.config.backBufferLength;if(!Object(ae.isFiniteNumber)(E)||E<0)return;var k=f.currentTime,C=p.levelTargetDuration,b=Math.max(E,C),m=Math.floor(k/C)*C-b;x.forEach(function(v){var g=T[v];if(g){var _=q.BufferHelper.getBuffered(g);_.length>0&&m>_.start(0)&&(d.trigger(K.Events.BACK_BUFFER_REACHED,{bufferEnd:m}),p.live&&d.trigger(K.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:m}),d.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:m,type:v}))}})},P.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var d=this.details,p=this.hls,f=this.media,T=this.mediaSource,x=d.fragments[0].start+d.totalduration,E=f.duration,k=Object(ae.isFiniteNumber)(T.duration)?T.duration:0;d.live&&p.config.liveDurationInfinity?(M.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),T.duration=Infinity,this.updateSeekableRange(d)):(x>k&&x>E||!Object(ae.isFiniteNumber)(E))&&(M.logger.log("[buffer-controller]: Updating Media Source duration to "+x.toFixed(3)),T.duration=x)},P.updateSeekableRange=function(d){var p=this.mediaSource,f=d.fragments,T=f.length;if(T&&d.live&&p!==null&&p!==void 0&&p.setLiveSeekableRange){var x=Math.max(0,f[0].start),E=Math.max(x,x+d.totalduration);p.setLiveSeekableRange(x,E)}},P.checkPendingTracks=function(){var d=this.bufferCodecEventsExpected,p=this.operationQueue,f=this.pendingTracks,T=Object.keys(f).length;if(T&&!d||T===2){this.createSourceBuffers(f),this.pendingTracks={};var x=this.getSourceBufferTypes();if(x.length===0){this.hls.trigger(K.Events.ERROR,{type:se.ErrorTypes.MEDIA_ERROR,details:se.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}x.forEach(function(E){p.executeNext(E)})}},P.createSourceBuffers=function(d){var p=this.sourceBuffer,f=this.mediaSource;if(!f)throw Error("createSourceBuffers called when mediaSource was null");var T=0;for(var x in d)if(!p[x]){var E=d[x];if(!E)throw Error("source buffer exists for track "+x+", however track does not");var k=E.levelCodec||E.codec,C=E.container+";codecs="+k;M.logger.log("[buffer-controller]: creating sourceBuffer("+C+")");try{var b=p[x]=f.addSourceBuffer(C),m=x;this.addBufferListener(m,"updatestart",this._onSBUpdateStart),this.addBufferListener(m,"updateend",this._onSBUpdateEnd),this.addBufferListener(m,"error",this._onSBUpdateError),this.tracks[x]={buffer:b,codec:k,container:E.container,levelCodec:E.levelCodec,id:E.id},T++}catch(v){M.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+v.message),this.hls.trigger(K.Events.ERROR,{type:se.ErrorTypes.MEDIA_ERROR,details:se.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:v,mimeType:C})}}T&&this.hls.trigger(K.Events.BUFFER_CREATED,{tracks:this.tracks})},P._onSBUpdateStart=function(d){var p=this.operationQueue,f=p.current(d);f.onStart()},P._onSBUpdateEnd=function(d){var p=this.operationQueue,f=p.current(d);f.onComplete(),p.shiftAndExecuteNext(d)},P._onSBUpdateError=function(d,p){M.logger.error("[buffer-controller]: "+d+" SourceBuffer error",p),this.hls.trigger(K.Events.ERROR,{type:se.ErrorTypes.MEDIA_ERROR,details:se.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var f=this.operationQueue.current(d);f&&f.onError(p)},P.removeExecutor=function(d,p,f){var T=this.media,x=this.mediaSource,E=this.operationQueue,k=this.sourceBuffer,C=k[d];if(!T||!x||!C){M.logger.warn("[buffer-controller]: Attempting to remove from the "+d+" SourceBuffer, but it does not exist"),E.shiftAndExecuteNext(d);return}var b=Object(ae.isFiniteNumber)(T.duration)?T.duration:Infinity,m=Object(ae.isFiniteNumber)(x.duration)?x.duration:Infinity,v=Math.max(0,p),g=Math.min(f,b,m);g>v?(M.logger.log("[buffer-controller]: Removing ["+v+","+g+"] from the "+d+" SourceBuffer"),console.assert(!C.updating,d+" sourceBuffer must not be updating"),C.remove(v,g)):E.shiftAndExecuteNext(d)},P.appendExecutor=function(d,p){var f=this.operationQueue,T=this.sourceBuffer,x=T[p];if(!x){M.logger.warn("[buffer-controller]: Attempting to append to the "+p+" SourceBuffer, but it does not exist"),f.shiftAndExecuteNext(p);return}x.ended=!1,console.assert(!x.updating,p+" sourceBuffer must not be updating"),x.appendBuffer(d)},P.blockBuffers=function(d,p){var f=this;if(p===void 0&&(p=this.getSourceBufferTypes()),!p.length){M.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(d);return}var T=this.operationQueue,x=p.map(function(E){return T.appendBlocker(E)});Promise.all(x).then(function(){d(),p.forEach(function(E){var k=f.sourceBuffer[E];(!k||!k.updating)&&T.shiftAndExecuteNext(E)})})},P.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},P.addBufferListener=function(d,p,f){var T=this.sourceBuffer[d];if(!T)return;var x=f.bind(this,d);this.listeners[d].push({event:p,listener:x}),T.addEventListener(p,x)},P.removeBufferListeners=function(d){var p=this.sourceBuffer[d];if(!p)return;this.listeners[d].forEach(function(f){p.removeEventListener(f.event,f.listener)})},j}()},"./src/controller/buffer-operation-queue.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return K});var ae=z("./src/utils/logger.ts"),K=function(){function M(q){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=q}var se=M.prototype;return se.append=function(X,V){var L=this.queues[V];L.push(X),L.length===1&&this.buffers[V]&&this.executeNext(V)},se.insertAbort=function(X,V){var L=this.queues[V];L.unshift(X),this.executeNext(V)},se.appendBlocker=function(X){var V,L=new Promise(function(F){V=F}),H={execute:V,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(H,X),L},se.executeNext=function(X){var V=this.buffers,L=this.queues,H=V[X],F=L[X];if(F.length){var I=F[0];try{I.execute()}catch(j){ae.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),I.onError(j),(!H||!H.updating)&&(F.shift(),this.executeNext(X))}}},se.shiftAndExecuteNext=function(X){this.queues[X].shift(),this.executeNext(X)},se.current=function(X){return this.queues[X][0]},M}()},"./src/controller/cap-level-controller.ts":function(ze,re,z){"use strict";z.r(re);var ae=z("./src/events.ts");function K(q,X){for(var V=0;V<X.length;V++){var L=X[V];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(q,L.key,L)}}function M(q,X,V){return X&&K(q.prototype,X),V&&K(q,V),q}var se=function(){function q(V){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=V,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var X=q.prototype;return X.setStreamController=function(L){this.streamController=L},X.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},X.registerListeners=function(){var L=this.hls;L.on(ae.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),L.on(ae.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),L.on(ae.Events.MANIFEST_PARSED,this.onManifestParsed,this),L.on(ae.Events.BUFFER_CODECS,this.onBufferCodecs,this),L.on(ae.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},X.unregisterListener=function(){var L=this.hls;L.off(ae.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),L.off(ae.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),L.off(ae.Events.MANIFEST_PARSED,this.onManifestParsed,this),L.off(ae.Events.BUFFER_CODECS,this.onBufferCodecs,this),L.off(ae.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},X.onFpsDropLevelCapping=function(L,H){q.isLevelAllowed(H.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(H.droppedLevel)},X.onMediaAttaching=function(L,H){this.media=H.media instanceof HTMLVideoElement?H.media:null},X.onManifestParsed=function(L,H){var F=this.hls;this.restrictedLevels=[],this.firstLevel=H.firstLevel,F.config.capLevelToPlayerSize&&H.video&&this.startCapping()},X.onBufferCodecs=function(L,H){var F=this.hls;F.config.capLevelToPlayerSize&&H.video&&this.startCapping()},X.onMediaDetaching=function(){this.stopCapping()},X.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var L=this.hls.levels;if(L.length){var H=this.hls;H.autoLevelCapping=this.getMaxLevel(L.length-1),H.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=H.autoLevelCapping}}},X.getMaxLevel=function(L){var H=this,F=this.hls.levels;if(!F.length)return-1;var I=F.filter(function(j,P){return q.isLevelAllowed(P,H.restrictedLevels)&&P<=L});return this.clientRect=null,q.getMaxLevelByMediaSize(I,this.mediaWidth,this.mediaHeight)},X.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},X.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},X.getDimensions=function(){if(this.clientRect)return this.clientRect;var L=this.media,H={width:0,height:0};if(L){var F=L.getBoundingClientRect();H.width=F.width,H.height=F.height,!H.width&&!H.height&&(H.width=F.right-F.left||L.width||0,H.height=F.bottom-F.top||L.height||0)}return this.clientRect=H,H},q.isLevelAllowed=function(L,H){return H===void 0&&(H=[]),H.indexOf(L)===-1},q.getMaxLevelByMediaSize=function(L,H,F){if(!L||!L.length)return-1;for(var I=function(p,f){return f?p.width!==f.width||p.height!==f.height:!0},j=L.length-1,P=0;P<L.length;P+=1){var w=L[P];if((w.width>=H||w.height>=F)&&I(w,L[P+1])){j=P;break}}return j},M(q,[{key:"mediaWidth",get:function(){return this.getDimensions().width*q.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*q.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var L=1;try{L=self.devicePixelRatio}catch(H){}return L}}]),q}();re.default=se},"./src/controller/cmcd-controller.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return I});var ae=z("./src/events.ts"),K=z("./src/types/cmcd.ts"),M=z("./src/utils/buffer-helper.ts"),se=z("./src/utils/logger.ts");function q(j,P){for(var w=0;w<P.length;w++){var d=P[w];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(j,d.key,d)}}function X(j,P,w){return P&&q(j.prototype,P),w&&q(j,w),j}function V(j,P){var w=typeof Symbol!="undefined"&&j[Symbol.iterator]||j["@@iterator"];if(w)return(w=w.call(j)).next.bind(w);if(Array.isArray(j)||(w=L(j))||P&&j&&typeof j.length=="number"){w&&(j=w);var d=0;return function(){return d>=j.length?{done:!0}:{done:!1,value:j[d++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L(j,P){if(!j)return;if(typeof j=="string")return H(j,P);var w=Object.prototype.toString.call(j).slice(8,-1);if(w==="Object"&&j.constructor&&(w=j.constructor.name),w==="Map"||w==="Set")return Array.from(j);if(w==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(w))return H(j,P)}function H(j,P){(P==null||P>j.length)&&(P=j.length);for(var w=0,d=new Array(P);w<P;w++)d[w]=j[w];return d}function F(){return F=Object.assign||function(j){for(var P=1;P<arguments.length;P++){var w=arguments[P];for(var d in w)Object.prototype.hasOwnProperty.call(w,d)&&(j[d]=w[d])}return j},F.apply(this,arguments)}var I=function(){function j(w){var d=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){d.initialized&&(d.starved=!0),d.buffering=!0},this.onPlaying=function(){d.initialized||(d.initialized=!0),d.buffering=!1},this.applyPlaylistData=function(T){try{d.apply(T,{ot:K.CMCDObjectType.MANIFEST,su:!d.initialized})}catch(x){se.logger.warn("Could not generate manifest CMCD data.",x)}},this.applyFragmentData=function(T){try{var x=T.frag,E=d.hls.levels[x.level],k=d.getObjectType(x),C={d:x.duration*1e3,ot:k};(k===K.CMCDObjectType.VIDEO||k===K.CMCDObjectType.AUDIO||k==K.CMCDObjectType.MUXED)&&(C.br=E.bitrate/1e3,C.tb=d.getTopBandwidth(k),C.bl=d.getBufferLength(k)),d.apply(T,C)}catch(b){se.logger.warn("Could not generate segment CMCD data.",b)}},this.hls=w;var p=this.config=w.config,f=p.cmcd;f!=null&&(p.pLoader=this.createPlaylistLoader(),p.fLoader=this.createFragmentLoader(),this.sid=f.sessionId||j.uuid(),this.cid=f.contentId,this.useHeaders=f.useHeaders===!0,this.registerListeners())}var P=j.prototype;return P.registerListeners=function(){var d=this.hls;d.on(ae.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.on(ae.Events.MEDIA_DETACHED,this.onMediaDetached,this),d.on(ae.Events.BUFFER_CREATED,this.onBufferCreated,this)},P.unregisterListeners=function(){var d=this.hls;d.off(ae.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.off(ae.Events.MEDIA_DETACHED,this.onMediaDetached,this),d.off(ae.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},P.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},P.onMediaAttached=function(d,p){this.media=p.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},P.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},P.onBufferCreated=function(d,p){var f,T;this.audioBuffer=(f=p.tracks.audio)===null||f===void 0?void 0:f.buffer,this.videoBuffer=(T=p.tracks.video)===null||T===void 0?void 0:T.buffer},P.createData=function(){var d;return{v:K.CMCDVersion,sf:K.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(d=this.media)===null||d===void 0?void 0:d.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},P.apply=function(d,p){p===void 0&&(p={}),F(p,this.createData());var f=p.ot===K.CMCDObjectType.INIT||p.ot===K.CMCDObjectType.VIDEO||p.ot===K.CMCDObjectType.MUXED;if(this.starved&&f&&(p.bs=!0,p.su=!0,this.starved=!1),p.su==null&&(p.su=this.buffering),this.useHeaders){var T=j.toHeaders(p);if(!Object.keys(T).length)return;d.headers||(d.headers={}),F(d.headers,T)}else{var x=j.toQuery(p);if(!x)return;d.url=j.appendQueryToUri(d.url,x)}},P.getObjectType=function(d){var p=d.type;return p==="subtitle"?K.CMCDObjectType.TIMED_TEXT:d.sn==="initSegment"?K.CMCDObjectType.INIT:p==="audio"?K.CMCDObjectType.AUDIO:p==="main"?this.hls.audioTracks.length?K.CMCDObjectType.VIDEO:K.CMCDObjectType.MUXED:void 0},P.getTopBandwidth=function(d){for(var p=0,f=d===K.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,T=V(f),x;!(x=T()).done;){var E=x.value;E.bitrate>p&&(p=E.bitrate)}return p>0?p:NaN},P.getBufferLength=function(d){var p=this.hls.media,f=d===K.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!f||!p)return NaN;var T=M.BufferHelper.bufferInfo(f,p.currentTime,this.config.maxBufferHole);return T.len*1e3},P.createPlaylistLoader=function(){var d=this.config.pLoader,p=this.applyPlaylistData,f=d||this.config.loader;return function(){function T(E){this.loader=void 0,this.loader=new f(E)}var x=T.prototype;return x.destroy=function(){this.loader.destroy()},x.abort=function(){this.loader.abort()},x.load=function(k,C,b){p(k),this.loader.load(k,C,b)},X(T,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),T}()},P.createFragmentLoader=function(){var d=this.config.fLoader,p=this.applyFragmentData,f=d||this.config.loader;return function(){function T(E){this.loader=void 0,this.loader=new f(E)}var x=T.prototype;return x.destroy=function(){this.loader.destroy()},x.abort=function(){this.loader.abort()},x.load=function(k,C,b){p(k),this.loader.load(k,C,b)},X(T,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),T}()},j.uuid=function(){var d=URL.createObjectURL(new Blob),p=d.toString();return URL.revokeObjectURL(d),p.substr(p.lastIndexOf("/")+1)},j.serialize=function(d){for(var p=[],f=function(ee){return!Number.isNaN(ee)&&ee!=null&&ee!==""&&ee!==!1},T=function(ee){return Math.round(ee)},x=function(ee){return T(ee/100)*100},E=function(ee){return encodeURIComponent(ee)},k={br:T,d:T,bl:x,dl:x,mtp:x,nor:E,rtp:x,tb:T},C=Object.keys(d||{}).sort(),b=V(C),m;!(m=b()).done;){var v=m.value,g=d[v];if(!f(g))continue;if(v==="v"&&g===1)continue;if(v=="pr"&&g===1)continue;var _=k[v];_&&(g=_(g));var O=typeof g,G=void 0;v==="ot"||v==="sf"||v==="st"?G=v+"="+g:O==="boolean"?G=v:O==="number"?G=v+"="+g:G=v+"="+JSON.stringify(g),p.push(G)}return p.join(",")},j.toHeaders=function(d){for(var p=Object.keys(d),f={},T=["Object","Request","Session","Status"],x=[{},{},{},{}],E={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},k=0,C=p;k<C.length;k++){var b=C[k],m=E[b]!=null?E[b]:1;x[m][b]=d[b]}for(var v=0;v<x.length;v++){var g=j.serialize(x[v]);g&&(f["CMCD-"+T[v]]=g)}return f},j.toQuery=function(d){return"CMCD="+encodeURIComponent(j.serialize(d))},j.appendQueryToUri=function(d,p){if(!p)return d;var f=d.includes("?")?"&":"?";return""+d+f+p},j}()},"./src/controller/eme-controller.ts":function(ze,re,z){"use strict";z.r(re);var ae=z("./src/events.ts"),K=z("./src/errors.ts"),M=z("./src/utils/logger.ts"),se=z("./src/utils/mediakeys-helper.ts");function q(I,j){for(var P=0;P<j.length;P++){var w=j[P];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(I,w.key,w)}}function X(I,j,P){return j&&q(I.prototype,j),P&&q(I,P),I}var V=3,L=function(j,P,w){var d={audioCapabilities:[],videoCapabilities:[]};return j.forEach(function(p){d.audioCapabilities.push({contentType:'audio/mp4; codecs="'+p+'"',robustness:w.audioRobustness||""})}),P.forEach(function(p){d.videoCapabilities.push({contentType:'video/mp4; codecs="'+p+'"',robustness:w.videoRobustness||""})}),[d]},H=function(j,P,w,d){switch(j){case se.KeySystems.WIDEVINE:return L(P,w,d);default:throw new Error("Unknown key-system: "+j)}},F=function(){function I(P){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=P,this._config=P.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var j=I.prototype;return j.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},j._registerListeners=function(){this.hls.on(ae.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(ae.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(ae.Events.MANIFEST_PARSED,this.onManifestParsed,this)},j._unregisterListeners=function(){this.hls.off(ae.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(ae.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(ae.Events.MANIFEST_PARSED,this.onManifestParsed,this)},j.getLicenseServerUrl=function(w){switch(w){case se.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+w+'"')},j._attemptKeySystemAccess=function(w,d,p){var f=this,T=H(w,d,p,this._drmSystemOptions);M.logger.log("Requesting encrypted media key-system access");var x=this.requestMediaKeySystemAccess(w,T);this.mediaKeysPromise=x.then(function(E){return f._onMediaKeySystemAccessObtained(w,E)}),x.catch(function(E){M.logger.error('Failed to obtain key-system "'+w+'" access:',E)})},j._onMediaKeySystemAccessObtained=function(w,d){var p=this;M.logger.log('Access for key-system "'+w+'" obtained');var f={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:d,mediaKeySystemDomain:w};this._mediaKeysList.push(f);var T=Promise.resolve().then(function(){return d.createMediaKeys()}).then(function(x){return f.mediaKeys=x,M.logger.log('Media-keys created for key-system "'+w+'"'),p._onMediaKeysCreated(),x});return T.catch(function(x){M.logger.error("Failed to create media-keys:",x)}),T},j._onMediaKeysCreated=function(){var w=this;this._mediaKeysList.forEach(function(d){d.mediaKeysSession||(d.mediaKeysSession=d.mediaKeys.createSession(),w._onNewMediaKeySession(d.mediaKeysSession))})},j._onNewMediaKeySession=function(w){var d=this;M.logger.log("New key-system session "+w.sessionId),w.addEventListener("message",function(p){d._onKeySessionMessage(w,p.message)},!1)},j._onKeySessionMessage=function(w,d){M.logger.log("Got EME message event, creating license request"),this._requestLicense(d,function(p){M.logger.log("Received license data (length: "+(p&&p.byteLength)+"), updating key-session"),w.update(p)})},j.onMediaEncrypted=function(w){var d=this;if(M.logger.log('Media is encrypted using "'+w.initDataType+'" init data type'),!this.mediaKeysPromise){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(ae.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var p=function(T){if(!d._media)return;d._attemptSetMediaKeys(T),d._generateRequestWithPreferredKeySession(w.initDataType,w.initData)};this.mediaKeysPromise.then(p).catch(p)},j._attemptSetMediaKeys=function(w){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var d=this._mediaKeysList[0];if(!d||!d.mediaKeys){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(ae.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}M.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(d.mediaKeys),this._hasSetMediaKeys=!0}},j._generateRequestWithPreferredKeySession=function(w,d){var p=this,f=this._mediaKeysList[0];if(!f){M.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(ae.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(f.mediaKeysSessionInitialized){M.logger.warn("Key-Session already initialized but requested again");return}var T=f.mediaKeysSession;if(!T){M.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(ae.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!d){M.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(ae.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}M.logger.log('Generating key-session request for "'+w+'" init data type'),f.mediaKeysSessionInitialized=!0,T.generateRequest(w,d).then(function(){M.logger.debug("Key-session generation succeeded")}).catch(function(x){M.logger.error("Error generating key-session request:",x),p.hls.trigger(ae.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},j._createLicenseXhr=function(w,d,p){var f=new XMLHttpRequest;f.responseType="arraybuffer",f.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,f,w,d,p);var T=this._licenseXhrSetup;if(T)try{T.call(this.hls,f,w),T=void 0}catch(x){M.logger.error(x)}try{f.readyState||f.open("POST",w,!0),T&&T.call(this.hls,f,w)}catch(x){throw new Error("issue setting up KeySystem license XHR "+x)}return f},j._onLicenseRequestReadyStageChange=function(w,d,p,f){switch(w.readyState){case 4:if(w.status===200){this._requestLicenseFailureCount=0,M.logger.log("License request succeeded");var T=w.response,x=this._licenseResponseCallback;if(x)try{T=x.call(this.hls,w,d)}catch(k){M.logger.error(k)}f(T)}else{if(M.logger.error("License Request XHR failed ("+d+"). Status: "+w.status+" ("+w.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>V){this.hls.trigger(ae.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var E=V-this._requestLicenseFailureCount+1;M.logger.warn("Retrying license request, "+E+" attempts left"),this._requestLicense(p,f)}break}},j._generateLicenseRequestChallenge=function(w,d){switch(w.mediaKeySystemDomain){case se.KeySystems.WIDEVINE:return d}throw new Error("unsupported key-system: "+w.mediaKeySystemDomain)},j._requestLicense=function(w,d){M.logger.log("Requesting content license for key-system");var p=this._mediaKeysList[0];if(!p){M.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(ae.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var f=this.getLicenseServerUrl(p.mediaKeySystemDomain),T=this._createLicenseXhr(f,w,d);M.logger.log("Sending license request to URL: "+f);var x=this._generateLicenseRequestChallenge(p,w);T.send(x)}catch(E){M.logger.error("Failure requesting DRM license: "+E),this.hls.trigger(ae.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},j.onMediaAttached=function(w,d){if(!this._emeEnabled)return;var p=d.media;this._media=p,p.addEventListener("encrypted",this._onMediaEncrypted)},j.onMediaDetached=function(){var w=this._media,d=this._mediaKeysList;if(!w)return;w.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(d.map(function(p){if(p.mediaKeysSession)return p.mediaKeysSession.close().catch(function(){})})).then(function(){return w.setMediaKeys(null)}).catch(function(){})},j.onManifestParsed=function(w,d){if(!this._emeEnabled)return;var p=d.levels.map(function(T){return T.audioCodec}).filter(function(T){return!!T}),f=d.levels.map(function(T){return T.videoCodec}).filter(function(T){return!!T});this._attemptKeySystemAccess(se.KeySystems.WIDEVINE,p,f)},X(I,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),I}();re.default=F},"./src/controller/fps-controller.ts":function(ze,re,z){"use strict";z.r(re);var ae=z("./src/events.ts"),K=z("./src/utils/logger.ts"),M=function(){function se(X){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=X,this.registerListeners()}var q=se.prototype;return q.setStreamController=function(V){this.streamController=V},q.registerListeners=function(){this.hls.on(ae.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},q.unregisterListeners=function(){this.hls.off(ae.Events.MEDIA_ATTACHING,this.onMediaAttaching)},q.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},q.onMediaAttaching=function(V,L){var H=this.hls.config;if(H.capLevelOnFPSDrop){var F=L.media instanceof self.HTMLVideoElement?L.media:null;this.media=F,F&&typeof F.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),H.fpsDroppedMonitoringPeriod)}},q.checkFPS=function(V,L,H){var F=performance.now();if(L){if(this.lastTime){var I=F-this.lastTime,j=H-this.lastDroppedFrames,P=L-this.lastDecodedFrames,w=1e3*j/I,d=this.hls;if(d.trigger(ae.Events.FPS_DROP,{currentDropped:j,currentDecoded:P,totalDroppedFrames:H}),w>0&&j>d.config.fpsDroppedMonitoringThreshold*P){var p=d.currentLevel;K.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+p),p>0&&(d.autoLevelCapping===-1||d.autoLevelCapping>=p)&&(p=p-1,d.trigger(ae.Events.FPS_DROP_LEVEL_CAPPING,{level:p,droppedLevel:d.currentLevel}),d.autoLevelCapping=p,this.streamController.nextLevelSwitch())}}this.lastTime=F,this.lastDroppedFrames=H,this.lastDecodedFrames=L}},q.checkFPSInterval=function(){var V=this.media;if(V)if(this.isVideoPlaybackQualityAvailable){var L=V.getVideoPlaybackQuality();this.checkFPS(V,L.totalVideoFrames,L.droppedVideoFrames)}else this.checkFPS(V,V.webkitDecodedFrameCount,V.webkitDroppedFrameCount)},se}();re.default=M},"./src/controller/fragment-finders.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"findFragmentByPDT",function(){return M}),z.d(re,"findFragmentByPTS",function(){return se}),z.d(re,"fragmentWithinToleranceTest",function(){return q}),z.d(re,"pdtWithinToleranceTest",function(){return X}),z.d(re,"findFragWithCC",function(){return V});var ae=z("./src/polyfills/number.ts"),K=z("./src/utils/binary-search.ts");function M(L,H,F){if(H===null||!Array.isArray(L)||!L.length||!Object(ae.isFiniteNumber)(H))return null;var I=L[0].programDateTime;if(H<(I||0))return null;var j=L[L.length-1].endProgramDateTime;if(H>=(j||0))return null;F=F||0;for(var P=0;P<L.length;++P){var w=L[P];if(X(H,F,w))return w}return null}function se(L,H,F,I){F===void 0&&(F=0),I===void 0&&(I=0);var j=null;if(L?j=H[L.sn-H[0].sn+1]||null:F===0&&H[0].start===0&&(j=H[0]),j&&q(F,I,j)===0)return j;var P=K.default.search(H,q.bind(null,F,I));return P||j}function q(L,H,F){L===void 0&&(L=0),H===void 0&&(H=0);var I=Math.min(H,F.duration+(F.deltaPTS?F.deltaPTS:0));return F.start+F.duration-I<=L?1:F.start-I>L&&F.start?-1:0}function X(L,H,F){var I=Math.min(H,F.duration+(F.deltaPTS?F.deltaPTS:0))*1e3,j=F.endProgramDateTime||0;return j-I>L}function V(L,H){return K.default.search(L,function(F){return F.cc<H?1:F.cc>H?-1:0})}},"./src/controller/fragment-tracker.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"FragmentState",function(){return M}),z.d(re,"FragmentTracker",function(){return se});var ae=z("./src/events.ts"),K=z("./src/types/loader.ts"),M;(function(V){V.NOT_LOADED="NOT_LOADED",V.BACKTRACKED="BACKTRACKED",V.APPENDING="APPENDING",V.PARTIAL="PARTIAL",V.OK="OK"})(M||(M={}));var se=function(){function V(H){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=H,this._registerListeners()}var L=V.prototype;return L._registerListeners=function(){var F=this.hls;F.on(ae.Events.BUFFER_APPENDED,this.onBufferAppended,this),F.on(ae.Events.FRAG_BUFFERED,this.onFragBuffered,this),F.on(ae.Events.FRAG_LOADED,this.onFragLoaded,this)},L._unregisterListeners=function(){var F=this.hls;F.off(ae.Events.BUFFER_APPENDED,this.onBufferAppended,this),F.off(ae.Events.FRAG_BUFFERED,this.onFragBuffered,this),F.off(ae.Events.FRAG_LOADED,this.onFragLoaded,this)},L.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},L.getAppendedFrag=function(F,I){if(I===K.PlaylistLevelType.MAIN){var j=this.activeFragment,P=this.activeParts;if(!j)return null;if(P)for(var w=P.length;w--;){var d=P[w],p=d?d.end:j.appendedPTS;if(d.start<=F&&p!==void 0&&F<=p)return w>9&&(this.activeParts=P.slice(w-9)),d}else if(j.start<=F&&j.appendedPTS!==void 0&&F<=j.appendedPTS)return j}return this.getBufferedFrag(F,I)},L.getBufferedFrag=function(F,I){for(var j=this.fragments,P=Object.keys(j),w=P.length;w--;){var d=j[P[w]];if((d==null?void 0:d.body.type)===I&&d.buffered){var p=d.body;if(p.start<=F&&F<=p.end)return p}}return null},L.detectEvictedFragments=function(F,I,j){var P=this;Object.keys(this.fragments).forEach(function(w){var d=P.fragments[w];if(!d)return;if(!d.buffered){d.body.type===j&&P.removeFragment(d.body);return}var p=d.range[F];if(!p)return;p.time.some(function(f){var T=!P.isTimeBuffered(f.startPTS,f.endPTS,I);return T&&P.removeFragment(d.body),T})})},L.detectPartialFragments=function(F){var I=this,j=this.timeRanges,P=F.frag,w=F.part;if(!j||P.sn==="initSegment")return;var d=X(P),p=this.fragments[d];if(!p)return;Object.keys(j).forEach(function(f){var T=P.elementaryStreams[f];if(!T)return;var x=j[f],E=w!==null||T.partial===!0;p.range[f]=I.getBufferedTimes(P,w,E,x)}),p.backtrack=p.loaded=null,Object.keys(p.range).length?p.buffered=!0:this.removeFragment(p.body)},L.fragBuffered=function(F){var I=X(F),j=this.fragments[I];j&&(j.backtrack=j.loaded=null,j.buffered=!0)},L.getBufferedTimes=function(F,I,j,P){for(var w={time:[],partial:j},d=I?I.start:F.start,p=I?I.end:F.end,f=F.minEndPTS||p,T=F.maxStartPTS||d,x=0;x<P.length;x++){var E=P.start(x)-this.bufferPadding,k=P.end(x)+this.bufferPadding;if(T>=E&&f<=k){w.time.push({startPTS:Math.max(d,P.start(x)),endPTS:Math.min(p,P.end(x))});break}else if(d<k&&p>E)w.partial=!0,w.time.push({startPTS:Math.max(d,P.start(x)),endPTS:Math.min(p,P.end(x))});else if(p<=E)break}return w},L.getPartialFragment=function(F){var I=null,j,P,w,d=0,p=this.bufferPadding,f=this.fragments;return Object.keys(f).forEach(function(T){var x=f[T];if(!x)return;q(x)&&(P=x.body.start-p,w=x.body.end+p,F>=P&&F<=w&&(j=Math.min(F-P,w-F),d<=j&&(I=x.body,d=j)))}),I},L.getState=function(F){var I=X(F),j=this.fragments[I];return j?j.buffered?q(j)?M.PARTIAL:M.OK:j.backtrack?M.BACKTRACKED:M.APPENDING:M.NOT_LOADED},L.backtrack=function(F,I){var j=X(F),P=this.fragments[j];if(!P||P.backtrack)return null;var w=P.backtrack=I||P.loaded;return P.loaded=null,w},L.getBacktrackData=function(F){var I=X(F),j=this.fragments[I];if(j){var P,w=j.backtrack;if(w!=null&&(P=w.payload)!==null&&P!==void 0&&P.byteLength)return w;this.removeFragment(F)}return null},L.isTimeBuffered=function(F,I,j){for(var P,w,d=0;d<j.length;d++){if(P=j.start(d)-this.bufferPadding,w=j.end(d)+this.bufferPadding,F>=P&&I<=w)return!0;if(I<=P)return!1}return!1},L.onFragLoaded=function(F,I){var j=I.frag,P=I.part;if(j.sn==="initSegment"||j.bitrateTest||P)return;var w=X(j);this.fragments[w]={body:j,loaded:I,backtrack:null,buffered:!1,range:Object.create(null)}},L.onBufferAppended=function(F,I){var j=this,P=I.frag,w=I.part,d=I.timeRanges;if(P.type===K.PlaylistLevelType.MAIN)if(this.activeFragment=P,w){var p=this.activeParts;p||(this.activeParts=p=[]),p.push(w)}else this.activeParts=null;this.timeRanges=d,Object.keys(d).forEach(function(f){var T=d[f];if(j.detectEvictedFragments(f,T),!w)for(var x=0;x<T.length;x++)P.appendedPTS=Math.max(T.end(x),P.appendedPTS||0)})},L.onFragBuffered=function(F,I){this.detectPartialFragments(I)},L.hasFragment=function(F){var I=X(F);return!!this.fragments[I]},L.removeFragmentsInRange=function(F,I,j){var P=this;Object.keys(this.fragments).forEach(function(w){var d=P.fragments[w];if(!d)return;if(d.buffered){var p=d.body;p.type===j&&p.start<I&&p.end>F&&P.removeFragment(p)}})},L.removeFragment=function(F){var I=X(F);F.stats.loaded=0,F.clearElementaryStreamInfo(),delete this.fragments[I]},L.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},V}();function q(V){var L,H;return V.buffered&&(((L=V.range.video)===null||L===void 0?void 0:L.partial)||((H=V.range.audio)===null||H===void 0?void 0:H.partial))}function X(V){return V.type+"_"+V.level+"_"+V.urlId+"_"+V.sn}},"./src/controller/gap-controller.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"STALL_MINIMUM_DURATION_MS",function(){return q}),z.d(re,"MAX_START_GAP_JUMP",function(){return X}),z.d(re,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return V}),z.d(re,"SKIP_BUFFER_RANGE_START",function(){return L}),z.d(re,"default",function(){return H});var ae=z("./src/utils/buffer-helper.ts"),K=z("./src/errors.ts"),M=z("./src/events.ts"),se=z("./src/utils/logger.ts"),q=250,X=2,V=.1,L=.05,H=function(){function F(j,P,w,d){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=j,this.media=P,this.fragmentTracker=w,this.hls=d}var I=F.prototype;return I.destroy=function(){this.hls=this.fragmentTracker=this.media=null},I.poll=function(P){var w=this.config,d=this.media,p=this.stalled,f=d.currentTime,T=d.seeking,x=this.seeking&&!T,E=!this.seeking&&T;if(this.seeking=T,f!==P){if(this.moved=!0,p!==null){if(this.stallReported){var k=self.performance.now()-p;se.logger.warn("playback not stuck anymore @"+f+", after "+Math.round(k)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((E||x)&&(this.stalled=null),d.paused||d.ended||d.playbackRate===0||!ae.BufferHelper.getBuffered(d).length)return;var C=ae.BufferHelper.bufferInfo(d,f,0),b=C.len>0,m=C.nextStart||0;if(!b&&!m)return;if(T){var v=C.len>X,g=!m||m-f>X&&!this.fragmentTracker.getPartialFragment(f);if(v||g)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var _,O=Math.max(m,C.start||0)-f,G=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,Y=G==null||((_=G.details)===null||_===void 0)?void 0:_.live,ee=Y?G.details.targetduration*2:X;if(O>0&&O<=ee){this._trySkipBufferHole(null);return}}var fe=self.performance.now();if(p===null){this.stalled=fe;return}var pe=fe-p;!T&&pe>=q&&this._reportStall(C.len);var xe=ae.BufferHelper.bufferInfo(d,f,w.maxBufferHole);this._tryFixBufferStall(xe,pe)},I._tryFixBufferStall=function(P,w){var d=this.config,p=this.fragmentTracker,f=this.media,T=f.currentTime,x=p.getPartialFragment(T);if(x){var E=this._trySkipBufferHole(x);if(E)return}P.len>d.maxBufferHole&&w>d.highBufferWatchdogPeriod*1e3&&(se.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},I._reportStall=function(P){var w=this.hls,d=this.media,p=this.stallReported;p||(this.stallReported=!0,se.logger.warn("Playback stalling at @"+d.currentTime+" due to low buffer (buffer="+P+")"),w.trigger(M.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:P}))},I._trySkipBufferHole=function(P){for(var w=this.config,d=this.hls,p=this.media,f=p.currentTime,T=0,x=ae.BufferHelper.getBuffered(p),E=0;E<x.length;E++){var k=x.start(E);if(f+w.maxBufferHole>=T&&f<k){var C=Math.max(k+L,p.currentTime+V);return se.logger.warn("skipping hole, adjusting currentTime from "+f+" to "+C),this.moved=!0,this.stalled=null,p.currentTime=C,P&&d.trigger(M.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+f+" to "+C,frag:P}),C}T=x.end(E)}return 0},I._tryNudgeBuffer=function(){var P=this.config,w=this.hls,d=this.media,p=d.currentTime,f=(this.nudgeRetry||0)+1;if(this.nudgeRetry=f,f<P.nudgeMaxRetry){var T=p+f*P.nudgeOffset;se.logger.warn("Nudging 'currentTime' from "+p+" to "+T),d.currentTime=T,w.trigger(M.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else se.logger.error("Playhead still not moving while enough data buffered @"+p+" after "+P.nudgeMaxRetry+" nudges"),w.trigger(M.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},F}()},"./src/controller/id3-track-controller.ts":function(ze,re,z){"use strict";z.r(re);var ae=z("./src/events.ts"),K=z("./src/utils/texttrack-utils.ts"),M=z("./src/demux/id3.ts"),se=.25,q=function(){function X(L){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=L,this._registerListeners()}var V=X.prototype;return V.destroy=function(){this._unregisterListeners()},V._registerListeners=function(){var H=this.hls;H.on(ae.Events.MEDIA_ATTACHED,this.onMediaAttached,this),H.on(ae.Events.MEDIA_DETACHING,this.onMediaDetaching,this),H.on(ae.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),H.on(ae.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},V._unregisterListeners=function(){var H=this.hls;H.off(ae.Events.MEDIA_ATTACHED,this.onMediaAttached,this),H.off(ae.Events.MEDIA_DETACHING,this.onMediaDetaching,this),H.off(ae.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),H.off(ae.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},V.onMediaAttached=function(H,F){this.media=F.media},V.onMediaDetaching=function(){if(!this.id3Track)return;Object(K.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},V.getID3Track=function(H){if(!this.media)return;for(var F=0;F<H.length;F++){var I=H[F];if(I.kind==="metadata"&&I.label==="id3")return Object(K.sendAddTrackEvent)(I,this.media),I}return this.media.addTextTrack("metadata","id3")},V.onFragParsingMetadata=function(H,F){if(!this.media)return;var I=F.frag,j=F.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var P=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,w=0;w<j.length;w++){var d=M.getID3Frames(j[w].data);if(d){var p=j[w].pts,f=w<j.length-1?j[w+1].pts:I.end,T=f-p;T<=0&&(f=p+se);for(var x=0;x<d.length;x++){var E=d[x];if(!M.isTimeStampFrame(E)){var k=new P(p,f,"");k.value=E,this.id3Track.addCue(k)}}}}},V.onBufferFlushing=function(H,F){var I=F.startOffset,j=F.endOffset,P=F.type;if(!P||P==="audio"){var w=this.id3Track;w&&Object(K.removeCuesInRange)(w,I,j)}},X}();re.default=q},"./src/controller/latency-controller.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return X});var ae=z("./src/errors.ts"),K=z("./src/events.ts"),M=z("./src/utils/logger.ts");function se(V,L){for(var H=0;H<L.length;H++){var F=L[H];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(V,F.key,F)}}function q(V,L,H){return L&&se(V.prototype,L),H&&se(V,H),V}var X=function(){function V(H){var F=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return F.timeupdate()},this.hls=H,this.config=H.config,this.registerListeners()}var L=V.prototype;return L.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},L.registerListeners=function(){this.hls.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(K.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(K.Events.ERROR,this.onError,this)},L.unregisterListeners=function(){this.hls.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(K.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(K.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(K.Events.ERROR,this.onError)},L.onMediaAttached=function(F,I){this.media=I.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},L.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},L.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},L.onLevelUpdated=function(F,I){var j=I.details;this.levelDetails=j,j.advanced&&this.timeupdate(),!j.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},L.onError=function(F,I){if(I.details!==ae.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,M.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},L.timeupdate=function(){var F=this.media,I=this.levelDetails;if(!F||!I)return;this.currentTime=F.currentTime;var j=this.computeLatency();if(j===null)return;this._latency=j;var P=this.config,w=P.lowLatencyMode,d=P.maxLiveSyncPlaybackRate;if(!w||d===1)return;var p=this.targetLatency;if(p===null)return;var f=j-p,T=Math.min(this.maxLatency,p+I.targetduration),x=f<T;if(I.live&&x&&f>.05&&this.forwardBufferLength>1){var E=Math.min(2,Math.max(1,d)),k=Math.round(2/(1+Math.exp(-.75*f-this.edgeStalled))*20)/20;F.playbackRate=Math.min(E,Math.max(1,k))}else F.playbackRate!==1&&F.playbackRate!==0&&(F.playbackRate=1)},L.estimateLiveEdge=function(){var F=this.levelDetails;return F===null?null:F.edge+F.age},L.computeLatency=function(){var F=this.estimateLiveEdge();return F===null?null:F-this.currentTime},q(V,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var F=this.config,I=this.levelDetails;return F.liveMaxLatencyDuration!==void 0?F.liveMaxLatencyDuration:I?F.liveMaxLatencyDurationCount*I.targetduration:0}},{key:"targetLatency",get:function(){var F=this.levelDetails;if(F===null)return null;var I=F.holdBack,j=F.partHoldBack,P=F.targetduration,w=this.config,d=w.liveSyncDuration,p=w.liveSyncDurationCount,f=w.lowLatencyMode,T=this.hls.userConfig,x=f&&j||I;(T.liveSyncDuration||T.liveSyncDurationCount||x===0)&&(x=d!==void 0?d:p*P);var E=P,k=1;return x+Math.min(this.stallCount*k,E)}},{key:"liveSyncPosition",get:function(){var F=this.estimateLiveEdge(),I=this.targetLatency,j=this.levelDetails;if(F===null||I===null||j===null)return null;var P=j.edge,w=F-I-this.edgeStalled,d=P-j.totalduration,p=P-(this.config.lowLatencyMode&&j.partTarget||j.targetduration);return Math.min(Math.max(d,w),p)}},{key:"drift",get:function(){var F=this.levelDetails;return F===null?1:F.drift}},{key:"edgeStalled",get:function(){var F=this.levelDetails;if(F===null)return 0;var I=(this.config.lowLatencyMode&&F.partTarget||F.targetduration)*3;return Math.max(F.age-I,0)}},{key:"forwardBufferLength",get:function(){var F=this.media,I=this.levelDetails;if(!F||!I)return 0;var j=F.buffered.length;return j?F.buffered.end(j-1):I.edge-this.currentTime}}]),V}()},"./src/controller/level-controller.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return w});var ae=z("./src/types/level.ts"),K=z("./src/events.ts"),M=z("./src/errors.ts"),se=z("./src/utils/codecs.ts"),q=z("./src/controller/level-helper.ts"),X=z("./src/controller/base-playlist-controller.ts"),V=z("./src/types/loader.ts");function L(){return L=Object.assign||function(d){for(var p=1;p<arguments.length;p++){var f=arguments[p];for(var T in f)Object.prototype.hasOwnProperty.call(f,T)&&(d[T]=f[T])}return d},L.apply(this,arguments)}function H(d,p){for(var f=0;f<p.length;f++){var T=p[f];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(d,T.key,T)}}function F(d,p,f){return p&&H(d.prototype,p),f&&H(d,f),d}function I(d,p){d.prototype=Object.create(p.prototype),d.prototype.constructor=d,j(d,p)}function j(d,p){return j=Object.setPrototypeOf||function(T,x){return T.__proto__=x,T},j(d,p)}var P=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),w=function(d){I(p,d);function p(T){var x;return x=d.call(this,T,"[level-controller]")||this,x._levels=[],x._firstLevel=-1,x._startLevel=void 0,x.currentLevelIndex=-1,x.manualLevelIndex=-1,x.onParsedComplete=void 0,x._registerListeners(),x}var f=p.prototype;return f._registerListeners=function(){var x=this.hls;x.on(K.Events.MANIFEST_LOADED,this.onManifestLoaded,this),x.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.on(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),x.on(K.Events.FRAG_LOADED,this.onFragLoaded,this),x.on(K.Events.ERROR,this.onError,this)},f._unregisterListeners=function(){var x=this.hls;x.off(K.Events.MANIFEST_LOADED,this.onManifestLoaded,this),x.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.off(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),x.off(K.Events.FRAG_LOADED,this.onFragLoaded,this),x.off(K.Events.ERROR,this.onError,this)},f.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,d.prototype.destroy.call(this)},f.startLoad=function(){var x=this._levels;x.forEach(function(E){E.loadError=0}),d.prototype.startLoad.call(this)},f.onManifestLoaded=function(x,E){var k=[],C=[],b=[],m,v={},g,_=!1,O=!1,G=!1;if(E.levels.forEach(function(pe){var xe=pe.attrs;_=_||!!(pe.width&&pe.height),O=O||!!pe.videoCodec,G=G||!!pe.audioCodec,P&&pe.audioCodec&&pe.audioCodec.indexOf("mp4a.40.34")!==-1&&(pe.audioCodec=void 0);var Ce=pe.bitrate+"-"+pe.attrs.RESOLUTION+"-"+pe.attrs.CODECS;g=v[Ce],g?g.url.push(pe.url):(g=new ae.Level(pe),v[Ce]=g,k.push(g)),xe&&(xe.AUDIO&&Object(q.addGroupId)(g,"audio",xe.AUDIO),xe.SUBTITLES&&Object(q.addGroupId)(g,"text",xe.SUBTITLES))}),(_||O)&&G&&(k=k.filter(function(pe){var xe=pe.videoCodec,Ce=pe.width,be=pe.height;return!!xe||!!(Ce&&be)})),k=k.filter(function(pe){var xe=pe.audioCodec,Ce=pe.videoCodec;return(!xe||Object(se.isCodecSupportedInMp4)(xe,"audio"))&&(!Ce||Object(se.isCodecSupportedInMp4)(Ce,"video"))}),E.audioTracks&&(C=E.audioTracks.filter(function(pe){return!pe.audioCodec||Object(se.isCodecSupportedInMp4)(pe.audioCodec,"audio")}),Object(q.assignTrackIdsByGroup)(C)),E.subtitles&&(b=E.subtitles,Object(q.assignTrackIdsByGroup)(b)),k.length>0){m=k[0].bitrate,k.sort(function(pe,xe){return pe.bitrate-xe.bitrate}),this._levels=k;for(var Y=0;Y<k.length;Y++)if(k[Y].bitrate===m){this._firstLevel=Y,this.log("manifest loaded, "+k.length+" level(s) found, first bitrate: "+m);break}var ee=G&&!O,fe={levels:k,audioTracks:C,subtitleTracks:b,firstLevel:this._firstLevel,stats:E.stats,audio:G,video:O,altAudio:!ee&&C.some(function(pe){return!!pe.url})};this.hls.trigger(K.Events.MANIFEST_PARSED,fe),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(K.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:E.url,reason:"no level with compatible codecs found in manifest"})},f.onError=function(x,E){if(d.prototype.onError.call(this,x,E),E.fatal)return;var k=E.context,C=this._levels[this.currentLevelIndex];if(k&&(k.type===V.PlaylistContextType.AUDIO_TRACK&&C.audioGroupIds&&k.groupId===C.audioGroupIds[C.urlId]||k.type===V.PlaylistContextType.SUBTITLE_TRACK&&C.textGroupIds&&k.groupId===C.textGroupIds[C.urlId])){this.redundantFailover(this.currentLevelIndex);return}var b=!1,m=!0,v;switch(E.details){case M.ErrorDetails.FRAG_LOAD_ERROR:case M.ErrorDetails.FRAG_LOAD_TIMEOUT:case M.ErrorDetails.KEY_LOAD_ERROR:case M.ErrorDetails.KEY_LOAD_TIMEOUT:if(E.frag){var g=this._levels[E.frag.level];g?(g.fragmentError++,g.fragmentError>this.hls.config.fragLoadingMaxRetry&&(v=E.frag.level)):v=E.frag.level}break;case M.ErrorDetails.LEVEL_LOAD_ERROR:case M.ErrorDetails.LEVEL_LOAD_TIMEOUT:k&&(k.deliveryDirectives&&(m=!1),v=k.level),b=!0;break;case M.ErrorDetails.REMUX_ALLOC_ERROR:v=E.level,b=!0;break}v!==void 0&&this.recoverLevel(E,v,b,m)},f.recoverLevel=function(x,E,k,C){var b=x.details,m=this._levels[E];if(m.loadError++,k){var v=this.retryLoadingOrFail(x);if(v)x.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(C){var g=m.url.length;if(g>1&&m.loadError<g)x.levelRetry=!0,this.redundantFailover(E);else if(this.manualLevelIndex===-1){var _=E===0?this._levels.length-1:E-1;this.currentLevelIndex!==_&&this._levels[_].loadError===0&&(this.warn(b+": switch to "+_),x.levelRetry=!0,this.hls.nextAutoLevel=_)}}},f.redundantFailover=function(x){var E=this._levels[x],k=E.url.length;if(k>1){var C=(E.urlId+1)%k;this.warn("Switching to redundant URL-id "+C),this._levels.forEach(function(b){b.urlId=C}),this.level=x}},f.onFragLoaded=function(x,E){var k=E.frag;if(k!==void 0&&k.type===V.PlaylistLevelType.MAIN){var C=this._levels[k.level];C!==void 0&&(C.fragmentError=0,C.loadError=0)}},f.onLevelLoaded=function(x,E){var k,C=E.level,b=E.details,m=this._levels[C];if(!m){var v;this.warn("Invalid level index "+C),(v=E.deliveryDirectives)!==null&&v!==void 0&&v.skip&&(b.deltaUpdateFailed=!0);return}C===this.currentLevelIndex?(m.fragmentError===0&&(m.loadError=0,this.retryCount=0),this.playlistLoaded(C,E,m.details)):(k=E.deliveryDirectives)!==null&&k!==void 0&&k.skip&&(b.deltaUpdateFailed=!0)},f.onAudioTrackSwitched=function(x,E){var k=this.hls.levels[this.currentLevelIndex];if(!k)return;if(k.audioGroupIds){for(var C=-1,b=this.hls.audioTracks[E.id].groupId,m=0;m<k.audioGroupIds.length;m++)if(k.audioGroupIds[m]===b){C=m;break}C!==k.urlId&&(k.urlId=C,this.startLoad())}},f.loadPlaylist=function(x){var E=this.currentLevelIndex,k=this._levels[E];if(this.canLoad&&k&&k.url.length>0){var C=k.urlId,b=k.url[C];if(x)try{b=x.addDirectives(b)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("Attempt loading level index "+E+(x?" at sn "+x.msn+" part "+x.part:"")+" with URL-id "+C+" "+b),this.clearTimer(),this.hls.trigger(K.Events.LEVEL_LOADING,{url:b,level:E,id:C,deliveryDirectives:x||null})}},f.removeLevel=function(x,E){var k=function(m,v){return v!==E},C=this._levels.filter(function(b,m){return m!==x?!0:b.url.length>1&&E!==void 0?(b.url=b.url.filter(k),b.audioGroupIds&&(b.audioGroupIds=b.audioGroupIds.filter(k)),b.textGroupIds&&(b.textGroupIds=b.textGroupIds.filter(k)),b.urlId=0,!0):!1}).map(function(b,m){var v=b.details;return v!=null&&v.fragments&&v.fragments.forEach(function(g){g.level=m}),b});this._levels=C,this.hls.trigger(K.Events.LEVELS_UPDATED,{levels:C})},F(p,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(x){var E,k=this._levels;if(k.length===0)return;if(this.currentLevelIndex===x&&(E=k[x])!==null&&E!==void 0&&E.details)return;if(x<0||x>=k.length){var C=x<0;if(this.hls.trigger(K.Events.ERROR,{type:M.ErrorTypes.OTHER_ERROR,details:M.ErrorDetails.LEVEL_SWITCH_ERROR,level:x,fatal:C,reason:"invalid level idx"}),C)return;x=Math.min(x,k.length-1)}this.clearTimer();var b=this.currentLevelIndex,m=k[b],v=k[x];this.log("switching to level "+x+" from "+b),this.currentLevelIndex=x;var g=L({},v,{level:x,maxBitrate:v.maxBitrate,uri:v.uri,urlId:v.urlId});delete g._urlId,this.hls.trigger(K.Events.LEVEL_SWITCHING,g);var _=v.details;if(!_||_.live){var O=this.switchParams(v.uri,m==null?void 0:m.details);this.loadPlaylist(O)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(x){this.manualLevelIndex=x,this._startLevel===void 0&&(this._startLevel=x),x!==-1&&(this.level=x)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(x){this._firstLevel=x}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var x=this.hls.config.startLevel;return x!==void 0?x:this._firstLevel}else return this._startLevel},set:function(x){this._startLevel=x}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(x){this.level=x,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=x)}}]),p}(X.default)},"./src/controller/level-helper.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"addGroupId",function(){return M}),z.d(re,"assignTrackIdsByGroup",function(){return se}),z.d(re,"updatePTS",function(){return q}),z.d(re,"updateFragPTSDTS",function(){return V}),z.d(re,"mergeDetails",function(){return L}),z.d(re,"mapPartIntersection",function(){return H}),z.d(re,"mapFragmentIntersection",function(){return F}),z.d(re,"adjustSliding",function(){return I}),z.d(re,"addSliding",function(){return j}),z.d(re,"computeReloadInterval",function(){return P}),z.d(re,"getFragmentWithSN",function(){return w}),z.d(re,"getPartWith",function(){return d});var ae=z("./src/polyfills/number.ts"),K=z("./src/utils/logger.ts");function M(p,f,T){switch(f){case"audio":p.audioGroupIds||(p.audioGroupIds=[]),p.audioGroupIds.push(T);break;case"text":p.textGroupIds||(p.textGroupIds=[]),p.textGroupIds.push(T);break}}function se(p){var f={};p.forEach(function(T){var x=T.groupId||"";T.id=f[x]=f[x]||0,f[x]++})}function q(p,f,T){var x=p[f],E=p[T];X(x,E)}function X(p,f){var T=f.startPTS;if(Object(ae.isFiniteNumber)(T)){var x=0,E;f.sn>p.sn?(x=T-p.start,E=p):(x=p.start-T,E=f),E.duration!==x&&(E.duration=x)}else if(f.sn>p.sn){var k=p.cc===f.cc;k&&p.minEndPTS?f.start=p.start+(p.minEndPTS-p.start):f.start=p.start+p.duration}else f.start=Math.max(p.start-f.duration,0)}function V(p,f,T,x,E,k){var C=x-T;C<=0&&(K.logger.warn("Fragment should have a positive duration",f),x=T+f.duration,k=E+f.duration);var b=T,m=x,v=f.startPTS,g=f.endPTS;if(Object(ae.isFiniteNumber)(v)){var _=Math.abs(v-T);Object(ae.isFiniteNumber)(f.deltaPTS)?f.deltaPTS=Math.max(_,f.deltaPTS):f.deltaPTS=_,b=Math.max(T,v),T=Math.min(T,v),E=Math.min(E,f.startDTS),m=Math.min(x,g),x=Math.max(x,g),k=Math.max(k,f.endDTS)}f.duration=x-T;var O=T-f.start;f.appendedPTS=x,f.start=f.startPTS=T,f.maxStartPTS=b,f.startDTS=E,f.endPTS=x,f.minEndPTS=m,f.endDTS=k;var G=f.sn;if(!p||G<p.startSN||G>p.endSN)return 0;var Y,ee=G-p.startSN,fe=p.fragments;for(fe[ee]=f,Y=ee;Y>0;Y--)X(fe[Y],fe[Y-1]);for(Y=ee;Y<fe.length-1;Y++)X(fe[Y],fe[Y+1]);return p.fragmentHint&&X(fe[fe.length-1],p.fragmentHint),p.PTSKnown=p.alignedSliding=!0,O}function L(p,f){for(var T=null,x=p.fragments,E=x.length-1;E>=0;E--){var k=x[E].initSegment;if(k){T=k;break}}p.fragmentHint&&delete p.fragmentHint.endPTS;var C=0,b;if(F(p,f,function(Y,ee){Y.relurl&&(C=Y.cc-ee.cc),Object(ae.isFiniteNumber)(Y.startPTS)&&Object(ae.isFiniteNumber)(Y.endPTS)&&(ee.start=ee.startPTS=Y.startPTS,ee.startDTS=Y.startDTS,ee.appendedPTS=Y.appendedPTS,ee.maxStartPTS=Y.maxStartPTS,ee.endPTS=Y.endPTS,ee.endDTS=Y.endDTS,ee.minEndPTS=Y.minEndPTS,ee.duration=Y.endPTS-Y.startPTS,ee.duration&&(b=ee),f.PTSKnown=f.alignedSliding=!0),ee.elementaryStreams=Y.elementaryStreams,ee.loader=Y.loader,ee.stats=Y.stats,ee.urlId=Y.urlId,Y.initSegment&&(ee.initSegment=Y.initSegment,T=Y.initSegment)}),T){var m=f.fragmentHint?f.fragments.concat(f.fragmentHint):f.fragments;m.forEach(function(Y){var ee;(!Y.initSegment||Y.initSegment.relurl===((ee=T)===null||ee===void 0?void 0:ee.relurl))&&(Y.initSegment=T)})}if(f.skippedSegments&&(f.deltaUpdateFailed=f.fragments.some(function(Y){return!Y}),f.deltaUpdateFailed)){K.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var v=f.skippedSegments;v--;)f.fragments.shift();f.startSN=f.fragments[0].sn,f.startCC=f.fragments[0].cc}var g=f.fragments;if(C){K.logger.warn("discontinuity sliding from playlist, take drift into account");for(var _=0;_<g.length;_++)g[_].cc+=C}f.skippedSegments&&(f.startCC=f.fragments[0].cc),H(p.partList,f.partList,function(Y,ee){ee.elementaryStreams=Y.elementaryStreams,ee.stats=Y.stats}),b?V(f,b,b.startPTS,b.endPTS,b.startDTS,b.endDTS):I(p,f),g.length&&(f.totalduration=f.edge-g[0].start),f.driftStartTime=p.driftStartTime,f.driftStart=p.driftStart;var O=f.advancedDateTime;if(f.advanced&&O){var G=f.edge;f.driftStart||(f.driftStartTime=O,f.driftStart=G),f.driftEndTime=O,f.driftEnd=G}else f.driftEndTime=p.driftEndTime,f.driftEnd=p.driftEnd,f.advancedDateTime=p.advancedDateTime}function H(p,f,T){if(p&&f)for(var x=0,E=0,k=p.length;E<=k;E++){var C=p[E],b=f[E+x];C&&b&&C.index===b.index&&C.fragment.sn===b.fragment.sn?T(C,b):x--}}function F(p,f,T){for(var x=f.skippedSegments,E=Math.max(p.startSN,f.startSN)-f.startSN,k=(p.fragmentHint?1:0)+(x?f.endSN:Math.min(p.endSN,f.endSN))-f.startSN,C=f.startSN-p.startSN,b=f.fragmentHint?f.fragments.concat(f.fragmentHint):f.fragments,m=p.fragmentHint?p.fragments.concat(p.fragmentHint):p.fragments,v=E;v<=k;v++){var g=m[C+v],_=b[v];x&&!_&&v<x&&(_=f.fragments[v]=g),g&&_&&T(g,_)}}function I(p,f){var T=f.startSN+f.skippedSegments-p.startSN,x=p.fragments;if(T<0||T>=x.length)return;j(f,x[T].start)}function j(p,f){if(f){for(var T=p.fragments,x=p.skippedSegments;x<T.length;x++)T[x].start+=f;p.fragmentHint&&(p.fragmentHint.start+=f)}}function P(p,f){var T=1e3*p.levelTargetDuration,x=T/2,E=p.age,k=E>0&&E<T*3,C=f.loading.end-f.loading.start,b,m=p.availabilityDelay;if(p.updated===!1)if(k){var v=333*p.misses;b=Math.max(Math.min(x,C*2),v),p.availabilityDelay=(p.availabilityDelay||0)+b}else b=x;else k?(m=Math.min(m||T/2,E),p.availabilityDelay=m,b=m+T-E):b=T-C;return Math.round(b)}function w(p,f,T){if(!p||!p.details)return null;var x=p.details,E=x.fragments[f-x.startSN];return E||(E=x.fragmentHint,E&&E.sn===f?E:f<x.startSN&&T&&T.sn===f?T:null)}function d(p,f,T){if(!p||!p.details)return null;var x=p.details.partList;if(x)for(var E=x.length;E--;){var k=x[E];if(k.index===T&&k.fragment.sn===f)return k}return null}},"./src/controller/stream-controller.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return x});var ae=z("./src/polyfills/number.ts"),K=z("./src/controller/base-stream-controller.ts"),M=z("./src/is-supported.ts"),se=z("./src/events.ts"),q=z("./src/utils/buffer-helper.ts"),X=z("./src/controller/fragment-tracker.ts"),V=z("./src/types/loader.ts"),L=z("./src/loader/fragment.ts"),H=z("./src/demux/transmuxer-interface.ts"),F=z("./src/types/transmuxer.ts"),I=z("./src/controller/gap-controller.ts"),j=z("./src/errors.ts"),P=z("./src/utils/logger.ts");function w(E,k){for(var C=0;C<k.length;C++){var b=k[C];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(E,b.key,b)}}function d(E,k,C){return k&&w(E.prototype,k),C&&w(E,C),E}function p(E,k){E.prototype=Object.create(k.prototype),E.prototype.constructor=E,f(E,k)}function f(E,k){return f=Object.setPrototypeOf||function(b,m){return b.__proto__=m,b},f(E,k)}var T=100,x=function(E){p(k,E);function k(b,m){var v;return v=E.call(this,b,m,"[stream-controller]")||this,v.audioCodecSwap=!1,v.gapController=null,v.level=-1,v._forceStartLoad=!1,v.altAudio=!1,v.audioOnly=!1,v.fragPlaying=null,v.onvplaying=null,v.onvseeked=null,v.fragLastKbps=0,v.stalled=!1,v.couldBacktrack=!1,v.audioCodecSwitch=!1,v.videoBuffer=null,v._registerListeners(),v}var C=k.prototype;return C._registerListeners=function(){var m=this.hls;m.on(se.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(se.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(se.Events.MANIFEST_LOADING,this.onManifestLoading,this),m.on(se.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.on(se.Events.LEVEL_LOADING,this.onLevelLoading,this),m.on(se.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.on(se.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),m.on(se.Events.ERROR,this.onError,this),m.on(se.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),m.on(se.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.on(se.Events.BUFFER_CREATED,this.onBufferCreated,this),m.on(se.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),m.on(se.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),m.on(se.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C._unregisterListeners=function(){var m=this.hls;m.off(se.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(se.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(se.Events.MANIFEST_LOADING,this.onManifestLoading,this),m.off(se.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.off(se.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.off(se.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),m.off(se.Events.ERROR,this.onError,this),m.off(se.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),m.off(se.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.off(se.Events.BUFFER_CREATED,this.onBufferCreated,this),m.off(se.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),m.off(se.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),m.off(se.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},C.startLoad=function(m){if(this.levels){var v=this.lastCurrentTime,g=this.hls;if(this.stopLoad(),this.setInterval(T),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var _=g.startLevel;_===-1&&(g.config.testBandwidth?(_=0,this.bitrateTest=!0):_=g.nextAutoLevel),this.level=g.nextLoadLevel=_,this.loadedmetadata=!1}v>0&&m===-1&&(this.log("Override startPosition with lastCurrentTime @"+v.toFixed(3)),m=v),this.state=K.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=m,this.tick()}else this._forceStartLoad=!0,this.state=K.State.STOPPED},C.stopLoad=function(){this._forceStartLoad=!1,E.prototype.stopLoad.call(this)},C.doTick=function(){switch(this.state){case K.State.IDLE:this.doTickIdle();break;case K.State.WAITING_LEVEL:{var m,v=this.levels,g=this.level,_=v==null||((m=v[g])===null||m===void 0)?void 0:m.details;if(_&&(!_.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(_))break;this.state=K.State.IDLE;break}break}case K.State.FRAG_LOADING_WAITING_RETRY:{var O,G=self.performance.now(),Y=this.retryDate;(!Y||G>=Y||(O=this.media)!==null&&O!==void 0&&O.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=K.State.IDLE)}break;default:break}this.onTickEnd()},C.onTickEnd=function(){E.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},C.doTickIdle=function(){var m,v,g=this.hls,_=this.levelLastLoaded,O=this.levels,G=this.media,Y=g.config,ee=g.nextLoadLevel;if(_===null||!G&&(this.startFragRequested||!Y.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!O||!O[ee])return;var fe=O[ee];this.level=g.nextLoadLevel=ee;var pe=fe.details;if(!pe||this.state===K.State.WAITING_LEVEL||pe.live&&this.levelLastLoaded!==ee){this.state=K.State.WAITING_LEVEL;return}var xe=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:G,V.PlaylistLevelType.MAIN);if(xe===null)return;var Ce=xe.len,be=this.getMaxBufferLength(fe.maxBitrate);if(Ce>=be)return;if(this._streamEnded(xe,pe)){var Oe={};this.altAudio&&(Oe.type="video"),this.hls.trigger(se.Events.BUFFER_EOS,Oe),this.state=K.State.ENDED;return}var We=xe.end,Me=this.getNextFragment(We,pe);if(this.couldBacktrack&&!this.fragPrevious&&Me&&Me.sn!=="initSegment"){var ct=Me.sn-pe.startSN;ct>1&&(Me=pe.fragments[ct-1],this.fragmentTracker.removeFragment(Me))}if(Me&&this.fragmentTracker.getState(Me)===X.FragmentState.OK&&this.nextLoadPosition>We){var Ge=this.audioOnly&&!this.altAudio?L.ElementaryStreamTypes.AUDIO:L.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(G,Ge,V.PlaylistLevelType.MAIN),Me=this.getNextFragment(this.nextLoadPosition,pe)}if(!Me)return;Me.initSegment&&!Me.initSegment.data&&!this.bitrateTest&&(Me=Me.initSegment),((m=Me.decryptdata)===null||m===void 0?void 0:m.keyFormat)==="identity"&&!((v=Me.decryptdata)!==null&&v!==void 0&&v.key)?this.loadKey(Me,pe):this.loadFragment(Me,pe,We)},C.loadFragment=function(m,v,g){var _,O=this.fragmentTracker.getState(m);if(this.fragCurrent=m,O===X.FragmentState.BACKTRACKED){var G=this.fragmentTracker.getBacktrackData(m);if(G){this._handleFragmentLoadProgress(G),this._handleFragmentLoadComplete(G);return}else O=X.FragmentState.NOT_LOADED}O===X.FragmentState.NOT_LOADED||O===X.FragmentState.PARTIAL?m.sn==="initSegment"?this._loadInitSegment(m):this.bitrateTest?(m.bitrateTest=!0,this.log("Fragment "+m.sn+" of level "+m.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(m)):(this.startFragRequested=!0,E.prototype.loadFragment.call(this,m,v,g)):O===X.FragmentState.APPENDING?this.reduceMaxBufferLength(m.duration)&&this.fragmentTracker.removeFragment(m):((_=this.media)===null||_===void 0?void 0:_.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},C.getAppendedFrag=function(m){var v=this.fragmentTracker.getAppendedFrag(m,V.PlaylistLevelType.MAIN);return v&&"fragment"in v?v.fragment:v},C.getBufferedFrag=function(m){return this.fragmentTracker.getBufferedFrag(m,V.PlaylistLevelType.MAIN)},C.followingBufferedFrag=function(m){return m?this.getBufferedFrag(m.end+.5):null},C.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},C.nextLevelSwitch=function(){var m=this.levels,v=this.media;if(v!=null&&v.readyState){var g,_=this.getAppendedFrag(v.currentTime);if(_&&_.start>1&&this.flushMainBuffer(0,_.start-1),!v.paused&&m){var O=this.hls.nextLoadLevel,G=m[O],Y=this.fragLastKbps;Y&&this.fragCurrent?g=this.fragCurrent.duration*G.maxBitrate/(1e3*Y)+1:g=0}else g=0;var ee=this.getBufferedFrag(v.currentTime+g);if(ee){var fe=this.followingBufferedFrag(ee);if(fe){this.abortCurrentFrag();var pe=fe.maxStartPTS?fe.maxStartPTS:fe.start,xe=fe.duration,Ce=Math.max(ee.end,pe+Math.min(Math.max(xe-this.config.maxFragLookUpTolerance,xe*.5),xe*.75));this.flushMainBuffer(Ce,Number.POSITIVE_INFINITY)}}}},C.abortCurrentFrag=function(){var m=this.fragCurrent;this.fragCurrent=null,m!=null&&m.loader&&m.loader.abort(),this.state===K.State.KEY_LOADING&&(this.state=K.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},C.flushMainBuffer=function(m,v){E.prototype.flushMainBuffer.call(this,m,v,this.altAudio?"video":null)},C.onMediaAttached=function(m,v){E.prototype.onMediaAttached.call(this,m,v);var g=v.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),g.addEventListener("playing",this.onvplaying),g.addEventListener("seeked",this.onvseeked),this.gapController=new I.default(this.config,g,this.fragmentTracker,this.hls)},C.onMediaDetaching=function(){var m=this.media;m&&(m.removeEventListener("playing",this.onvplaying),m.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),E.prototype.onMediaDetaching.call(this)},C.onMediaPlaying=function(){this.tick()},C.onMediaSeeked=function(){var m=this.media,v=m?m.currentTime:null;Object(ae.isFiniteNumber)(v)&&this.log("Media seeked to "+v.toFixed(3)),this.tick()},C.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(se.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},C.onManifestParsed=function(m,v){var g=!1,_=!1,O;v.levels.forEach(function(G){O=G.audioCodec,O&&(O.indexOf("mp4a.40.2")!==-1&&(g=!0),O.indexOf("mp4a.40.5")!==-1&&(_=!0))}),this.audioCodecSwitch=g&&_&&!Object(M.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=v.levels,this.startFragRequested=!1},C.onLevelLoading=function(m,v){var g=this.levels;if(!g||this.state!==K.State.IDLE)return;var _=g[v.level];(!_.details||_.details.live&&this.levelLastLoaded!==v.level||this.waitForCdnTuneIn(_.details))&&(this.state=K.State.WAITING_LEVEL)},C.onLevelLoaded=function(m,v){var g,_=this.levels,O=v.level,G=v.details,Y=G.totalduration;if(!_){this.warn("Levels were reset while loading level "+O);return}this.log("Level "+O+" loaded ["+G.startSN+","+G.endSN+"], cc ["+G.startCC+", "+G.endCC+"] duration:"+Y);var ee=this.fragCurrent;ee&&(this.state===K.State.FRAG_LOADING||this.state===K.State.FRAG_LOADING_WAITING_RETRY)&&(ee.level!==v.level&&ee.loader&&(this.state=K.State.IDLE,ee.loader.abort()));var fe=_[O],pe=0;if(G.live||(g=fe.details)!==null&&g!==void 0&&g.live){if(G.fragments[0]||(G.deltaUpdateFailed=!0),G.deltaUpdateFailed)return;pe=this.alignPlaylists(G,fe.details)}if(fe.details=G,this.levelLastLoaded=O,this.hls.trigger(se.Events.LEVEL_UPDATED,{details:G,level:O}),this.state===K.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(G))return;this.state=K.State.IDLE}this.startFragRequested?G.live&&this.synchronizeToLiveEdge(G):this.setStartPosition(G,pe),this.tick()},C._handleFragmentLoadProgress=function(m){var v,g=m.frag,_=m.part,O=m.payload,G=this.levels;if(!G){this.warn("Levels were reset while fragment load was in progress. Fragment "+g.sn+" of level "+g.level+" will not be buffered");return}var Y=G[g.level],ee=Y.details;if(!ee){this.warn("Dropping fragment "+g.sn+" of level "+g.level+" after level details were reset");return}var fe=Y.videoCodec,pe=ee.PTSKnown||!ee.live,xe=(v=g.initSegment)===null||v===void 0?void 0:v.data,Ce=this._getAudioCodec(Y),be=this.transmuxer=this.transmuxer||new H.default(this.hls,V.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Oe=_?_.index:-1,We=Oe!==-1,Me=new F.ChunkMetadata(g.level,g.sn,g.stats.chunkCount,O.byteLength,Oe,We),ct=this.initPTS[g.cc];be.push(O,xe,Ce,fe,g,_,ee.totalduration,pe,Me,ct)},C.onAudioTrackSwitching=function(m,v){var g=this.altAudio,_=!!v.url,O=v.id;if(!_){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var G=this.fragCurrent;G!=null&&G.loader&&(this.log("Switching to main audio track, cancel main fragment load"),G.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var Y=this.hls;g&&Y.trigger(se.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),Y.trigger(se.Events.AUDIO_TRACK_SWITCHED,{id:O})}},C.onAudioTrackSwitched=function(m,v){var g=v.id,_=!!this.hls.audioTracks[g].url;if(_){var O=this.videoBuffer;O&&this.mediaBuffer!==O&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=O)}this.altAudio=_,this.tick()},C.onBufferCreated=function(m,v){var g=v.tracks,_,O,G=!1;for(var Y in g){var ee=g[Y];if(ee.id==="main"){if(O=Y,_=ee,Y==="video"){var fe=g[Y];fe&&(this.videoBuffer=fe.buffer)}}else G=!0}G&&_?(this.log("Alternate track found, use "+O+".buffered to schedule main fragment loading"),this.mediaBuffer=_.buffer):this.mediaBuffer=this.media},C.onFragBuffered=function(m,v){var g=v.frag,_=v.part;if(g&&g.type!==V.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(g)){this.warn("Fragment "+g.sn+(_?" p: "+_.index:"")+" of level "+g.level+" finished buffering, but was aborted. state: "+this.state),this.state===K.State.PARSED&&(this.state=K.State.IDLE);return}var O=_?_.stats:g.stats;this.fragLastKbps=Math.round(8*O.total/(O.buffering.end-O.loading.first)),g.sn!=="initSegment"&&(this.fragPrevious=g),this.fragBufferedComplete(g,_)},C.onError=function(m,v){switch(v.details){case j.ErrorDetails.FRAG_LOAD_ERROR:case j.ErrorDetails.FRAG_LOAD_TIMEOUT:case j.ErrorDetails.KEY_LOAD_ERROR:case j.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(V.PlaylistLevelType.MAIN,v);break;case j.ErrorDetails.LEVEL_LOAD_ERROR:case j.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==K.State.ERROR&&(v.fatal?(this.warn(""+v.details),this.state=K.State.ERROR):!v.levelRetry&&this.state===K.State.WAITING_LEVEL&&(this.state=K.State.IDLE));break;case j.ErrorDetails.BUFFER_FULL_ERROR:if(v.parent==="main"&&(this.state===K.State.PARSING||this.state===K.State.PARSED)){var g=!0,_=this.getFwdBufferInfo(this.media,V.PlaylistLevelType.MAIN);_&&_.len>.5&&(g=!this.reduceMaxBufferLength(_.len)),g&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},C.checkBuffer=function(){var m=this.media,v=this.gapController;if(!m||!v||!m.readyState)return;var g=q.BufferHelper.getBuffered(m);!this.loadedmetadata&&g.length?(this.loadedmetadata=!0,this.seekToStartPos()):v.poll(this.lastCurrentTime),this.lastCurrentTime=m.currentTime},C.onFragLoadEmergencyAborted=function(){this.state=K.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},C.onBufferFlushed=function(m,v){var g=v.type;if(g!==L.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var _=(g===L.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(_,g,V.PlaylistLevelType.MAIN)}},C.onLevelsUpdated=function(m,v){this.levels=v.levels},C.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},C.seekToStartPos=function(){var m=this.media,v=m.currentTime,g=this.startPosition;if(g>=0&&v<g){if(m.seeking){P.logger.log("could not seek to "+g+", already seeking at "+v);return}var _=q.BufferHelper.getBuffered(m),O=_.length?_.start(0):0,G=O-g;G>0&&(G<this.config.maxBufferHole||G<this.config.maxFragLookUpTolerance)&&(P.logger.log("adjusting start position by "+G+" to match buffer start"),g+=G,this.startPosition=g),this.log("seek to target start position "+g+" from current time "+v),m.currentTime=g}},C._getAudioCodec=function(m){var v=this.config.defaultAudioCodec||m.audioCodec;return this.audioCodecSwap&&v&&(this.log("Swapping audio codec"),v.indexOf("mp4a.40.5")!==-1?v="mp4a.40.2":v="mp4a.40.5"),v},C._loadBitrateTestFrag=function(m){var v=this;this._doFragLoad(m).then(function(g){var _=v.hls;if(!g||_.nextLoadLevel||v.fragContextChanged(m))return;v.fragLoadError=0,v.state=K.State.IDLE,v.startFragRequested=!1,v.bitrateTest=!1;var O=m.stats;O.parsing.start=O.parsing.end=O.buffering.start=O.buffering.end=self.performance.now(),_.trigger(se.Events.FRAG_LOADED,g)})},C._handleTransmuxComplete=function(m){var v,g="main",_=this.hls,O=m.remuxResult,G=m.chunkMeta,Y=this.getCurrentContext(G);if(!Y){this.warn("The loading context changed while buffering fragment "+G.sn+" of level "+G.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(G.level);return}var ee=Y.frag,fe=Y.part,pe=Y.level,xe=O.video,Ce=O.text,be=O.id3,Oe=O.initSegment,We=this.altAudio?void 0:O.audio;if(this.fragContextChanged(ee))return;if(this.state=K.State.PARSING,Oe){Oe.tracks&&(this._bufferInitSegment(pe,Oe.tracks,ee,G),_.trigger(se.Events.FRAG_PARSING_INIT_SEGMENT,{frag:ee,id:g,tracks:Oe.tracks}));var Me=Oe.initPTS,ct=Oe.timescale;Object(ae.isFiniteNumber)(Me)&&(this.initPTS[ee.cc]=Me,_.trigger(se.Events.INIT_PTS_FOUND,{frag:ee,id:g,initPTS:Me,timescale:ct}))}if(xe&&O.independent!==!1){if(pe.details){var Ge=xe.startPTS,Je=xe.endPTS,Xe=xe.startDTS,Ye=xe.endDTS;if(fe)fe.elementaryStreams[xe.type]={startPTS:Ge,endPTS:Je,startDTS:Xe,endDTS:Ye};else if(xe.firstKeyFrame&&xe.independent&&(this.couldBacktrack=!0),xe.dropped&&xe.independent){var ke=this.getLoadPosition()+this.config.maxBufferHole;if(ke<Ge){this.backtrack(ee);return}ee.setElementaryStreamInfo(xe.type,ee.start,Je,ee.start,Ye,!0)}ee.setElementaryStreamInfo(xe.type,Ge,Je,Xe,Ye),this.bufferFragmentData(xe,ee,fe,G)}}else if(O.independent===!1){this.backtrack(ee);return}if(We){var Z=We.startPTS,A=We.endPTS,R=We.startDTS,J=We.endDTS;fe&&(fe.elementaryStreams[L.ElementaryStreamTypes.AUDIO]={startPTS:Z,endPTS:A,startDTS:R,endDTS:J}),ee.setElementaryStreamInfo(L.ElementaryStreamTypes.AUDIO,Z,A,R,J),this.bufferFragmentData(We,ee,fe,G)}if(be!=null&&(v=be.samples)!==null&&v!==void 0&&v.length){var oe={frag:ee,id:g,samples:be.samples};_.trigger(se.Events.FRAG_PARSING_METADATA,oe)}if(Ce){var $={frag:ee,id:g,samples:Ce.samples};_.trigger(se.Events.FRAG_PARSING_USERDATA,$)}},C._bufferInitSegment=function(m,v,g,_){var O=this;if(this.state!==K.State.PARSING)return;this.audioOnly=!!v.audio&&!v.video,this.altAudio&&!this.audioOnly&&delete v.audio;var G=v.audio,Y=v.video,ee=v.audiovideo;if(G){var fe=m.audioCodec,pe=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(fe&&(fe.indexOf("mp4a.40.5")!==-1?fe="mp4a.40.2":fe="mp4a.40.5"),G.metadata.channelCount!==1&&pe.indexOf("firefox")===-1&&(fe="mp4a.40.5")),pe.indexOf("android")!==-1&&G.container!=="audio/mpeg"&&(fe="mp4a.40.2",this.log("Android: force audio codec to "+fe)),m.audioCodec&&m.audioCodec!==fe&&this.log('Swapping manifest audio codec "'+m.audioCodec+'" for "'+fe+'"'),G.levelCodec=fe,G.id="main",this.log("Init audio buffer, container:"+G.container+", codecs[selected/level/parsed]=["+(fe||"")+"/"+(m.audioCodec||"")+"/"+G.codec+"]")}Y&&(Y.levelCodec=m.videoCodec,Y.id="main",this.log("Init video buffer, container:"+Y.container+", codecs[level/parsed]=["+(m.videoCodec||"")+"/"+Y.codec+"]")),ee&&this.log("Init audiovideo buffer, container:"+ee.container+", codecs[level/parsed]=["+(m.attrs.CODECS||"")+"/"+ee.codec+"]"),this.hls.trigger(se.Events.BUFFER_CODECS,v),Object.keys(v).forEach(function(xe){var Ce=v[xe],be=Ce.initSegment;be!=null&&be.byteLength&&O.hls.trigger(se.Events.BUFFER_APPENDING,{type:xe,data:be,frag:g,part:null,chunkMeta:_,parent:g.type})}),this.tick()},C.backtrack=function(m){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(m);var v=this.fragmentTracker.backtrack(m);this.fragPrevious=null,this.nextLoadPosition=m.start,v?this.resetFragmentLoading(m):this.state=K.State.BACKTRACKING},C.checkFragmentChanged=function(){var m=this.media,v=null;if(m&&m.readyState>1&&m.seeking===!1){var g=m.currentTime;if(q.BufferHelper.isBuffered(m,g)?v=this.getAppendedFrag(g):q.BufferHelper.isBuffered(m,g+.1)&&(v=this.getAppendedFrag(g+.1)),v){var _=this.fragPlaying,O=v.level;(!_||v.sn!==_.sn||_.level!==O||v.urlId!==_.urlId)&&(this.hls.trigger(se.Events.FRAG_CHANGED,{frag:v}),(!_||_.level!==O)&&this.hls.trigger(se.Events.LEVEL_SWITCHED,{level:O}),this.fragPlaying=v)}}},d(k,[{key:"nextLevel",get:function(){var m=this.nextBufferedFrag;return m?m.level:-1}},{key:"currentLevel",get:function(){var m=this.media;if(m){var v=this.getAppendedFrag(m.currentTime);if(v)return v.level}return-1}},{key:"nextBufferedFrag",get:function(){var m=this.media;if(m){var v=this.getAppendedFrag(m.currentTime);return this.followingBufferedFrag(v)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),k}(K.default)},"./src/controller/subtitle-stream-controller.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"SubtitleStreamController",function(){return p});var ae=z("./src/events.ts"),K=z("./src/utils/logger.ts"),M=z("./src/utils/buffer-helper.ts"),se=z("./src/controller/fragment-finders.ts"),q=z("./src/utils/discontinuities.ts"),X=z("./src/controller/level-helper.ts"),V=z("./src/controller/fragment-tracker.ts"),L=z("./src/controller/base-stream-controller.ts"),H=z("./src/types/loader.ts"),F=z("./src/types/level.ts");function I(f,T){for(var x=0;x<T.length;x++){var E=T[x];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(f,E.key,E)}}function j(f,T,x){return T&&I(f.prototype,T),x&&I(f,x),f}function P(f,T){f.prototype=Object.create(T.prototype),f.prototype.constructor=f,w(f,T)}function w(f,T){return w=Object.setPrototypeOf||function(E,k){return E.__proto__=k,E},w(f,T)}var d=500,p=function(f){P(T,f);function T(E,k){var C;return C=f.call(this,E,k,"[subtitle-stream-controller]")||this,C.levels=[],C.currentTrackId=-1,C.tracksBuffered=[],C.mainDetails=null,C._registerListeners(),C}var x=T.prototype;return x.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},x._registerListeners=function(){var k=this.hls;k.on(ae.Events.MEDIA_ATTACHED,this.onMediaAttached,this),k.on(ae.Events.MEDIA_DETACHING,this.onMediaDetaching,this),k.on(ae.Events.MANIFEST_LOADING,this.onManifestLoading,this),k.on(ae.Events.LEVEL_LOADED,this.onLevelLoaded,this),k.on(ae.Events.ERROR,this.onError,this),k.on(ae.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),k.on(ae.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),k.on(ae.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),k.on(ae.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),k.on(ae.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},x._unregisterListeners=function(){var k=this.hls;k.off(ae.Events.MEDIA_ATTACHED,this.onMediaAttached,this),k.off(ae.Events.MEDIA_DETACHING,this.onMediaDetaching,this),k.off(ae.Events.MANIFEST_LOADING,this.onManifestLoading,this),k.off(ae.Events.LEVEL_LOADED,this.onLevelLoaded,this),k.off(ae.Events.ERROR,this.onError,this),k.off(ae.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),k.off(ae.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),k.off(ae.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),k.off(ae.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),k.off(ae.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},x.startLoad=function(){this.stopLoad(),this.state=L.State.IDLE,this.setInterval(d),this.tick()},x.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},x.onLevelLoaded=function(k,C){this.mainDetails=C.details},x.onSubtitleFragProcessed=function(k,C){var b=C.frag,m=C.success;if(this.fragPrevious=b,this.state=L.State.IDLE,!m)return;var v=this.tracksBuffered[this.currentTrackId];if(!v)return;for(var g,_=b.start,O=0;O<v.length;O++)if(_>=v[O].start&&_<=v[O].end){g=v[O];break}var G=b.start+b.duration;g?g.end=G:(g={start:_,end:G},v.push(g)),this.fragmentTracker.fragBuffered(b)},x.onBufferFlushing=function(k,C){var b=C.startOffset,m=C.endOffset;if(b===0&&m!==Number.POSITIVE_INFINITY){var v=this.currentTrackId,g=this.levels;if(!g.length||!g[v]||!g[v].details)return;var _=g[v].details,O=_.targetduration,G=m-O;if(G<=0)return;C.endOffsetSubtitles=Math.max(0,G),this.tracksBuffered.forEach(function(Y){for(var ee=0;ee<Y.length;){if(Y[ee].end<=G){Y.shift();continue}else if(Y[ee].start<G)Y[ee].start=G;else break;ee++}}),this.fragmentTracker.removeFragmentsInRange(b,G,H.PlaylistLevelType.SUBTITLE)}},x.onError=function(k,C){var b,m=C.frag;if(!m||m.type!==H.PlaylistLevelType.SUBTITLE)return;(b=this.fragCurrent)!==null&&b!==void 0&&b.loader&&this.fragCurrent.loader.abort(),this.state=L.State.IDLE},x.onSubtitleTracksUpdated=function(k,C){var b=this,m=C.subtitleTracks;this.tracksBuffered=[],this.levels=m.map(function(v){return new F.Level(v)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(v){b.tracksBuffered[v.id]=[]}),this.mediaBuffer=null},x.onSubtitleTrackSwitch=function(k,C){if(this.currentTrackId=C.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var b=this.levels[this.currentTrackId];b!=null&&b.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,b&&this.setInterval(d)},x.onSubtitleTrackLoaded=function(k,C){var b,m=C.details,v=C.id,g=this.currentTrackId,_=this.levels;if(!_.length)return;var O=_[g];if(v>=_.length||v!==g||!O)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,m.live||(b=O.details)!==null&&b!==void 0&&b.live){var G=this.mainDetails;if(m.deltaUpdateFailed||!G)return;var Y=G.fragments[0];if(!O.details)m.hasProgramDateTime&&G.hasProgramDateTime?Object(q.alignMediaPlaylistByPDT)(m,G):Y&&Object(X.addSliding)(m,Y.start);else{var ee=this.alignPlaylists(m,O.details);ee===0&&Y&&Object(X.addSliding)(m,Y.start)}}if(O.details=m,this.levelLastLoaded=v,this.tick(),m.live&&!this.fragCurrent&&this.media&&this.state===L.State.IDLE){var fe=Object(se.findFragmentByPTS)(null,m.fragments,this.media.currentTime,0);fe||(this.warn("Subtitle playlist not aligned with playback"),O.details=void 0)}},x._handleFragmentLoadComplete=function(k){var C=k.frag,b=k.payload,m=C.decryptdata,v=this.hls;if(this.fragContextChanged(C))return;if(b&&b.byteLength>0&&m&&m.key&&m.iv&&m.method==="AES-128"){var g=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(b),m.key.buffer,m.iv.buffer).then(function(_){var O=performance.now();v.trigger(ae.Events.FRAG_DECRYPTED,{frag:C,payload:_,stats:{tstart:g,tdecrypt:O}})})}},x.doTick=function(){if(!this.media){this.state=L.State.IDLE;return}if(this.state===L.State.IDLE){var k,C=this.currentTrackId,b=this.levels;if(!b.length||!b[C]||!b[C].details)return;var m=b[C].details,v=m.targetduration,g=this.config,_=this.media,O=M.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,_.currentTime-v,g.maxBufferHole),G=O.end,Y=O.len,ee=this.getMaxBufferLength()+v;if(Y>ee)return;console.assert(m,"Subtitle track details are defined on idle subtitle stream controller tick");var fe=m.fragments,pe=fe.length,xe=m.edge,Ce,be=this.fragPrevious;if(G<xe){var Oe=g.maxFragLookUpTolerance;be&&m.hasProgramDateTime&&(Ce=Object(se.findFragmentByPDT)(fe,be.endProgramDateTime,Oe)),Ce||(Ce=Object(se.findFragmentByPTS)(be,fe,G,Oe),!Ce&&be&&be.start<fe[0].start&&(Ce=fe[0]))}else Ce=fe[pe-1];(k=Ce)!==null&&k!==void 0&&k.encrypted?(K.logger.log("Loading key for "+Ce.sn),this.state=L.State.KEY_LOADING,this.hls.trigger(ae.Events.KEY_LOADING,{frag:Ce})):Ce&&this.fragmentTracker.getState(Ce)===V.FragmentState.NOT_LOADED&&this.loadFragment(Ce,m,G)}},x.loadFragment=function(k,C,b){this.fragCurrent=k,f.prototype.loadFragment.call(this,k,C,b)},j(T,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),T}(L.default)},"./src/controller/subtitle-track-controller.ts":function(ze,re,z){"use strict";z.r(re);var ae=z("./src/events.ts"),K=z("./src/utils/texttrack-utils.ts"),M=z("./src/controller/base-playlist-controller.ts"),se=z("./src/types/loader.ts");function q(I,j){for(var P=0;P<j.length;P++){var w=j[P];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(I,w.key,w)}}function X(I,j,P){return j&&q(I.prototype,j),P&&q(I,P),I}function V(I,j){I.prototype=Object.create(j.prototype),I.prototype.constructor=I,L(I,j)}function L(I,j){return L=Object.setPrototypeOf||function(w,d){return w.__proto__=d,w},L(I,j)}var H=function(I){V(j,I);function j(w){var d;return d=I.call(this,w,"[subtitle-track-controller]")||this,d.media=null,d.tracks=[],d.groupId=null,d.tracksInGroup=[],d.trackId=-1,d.selectDefaultTrack=!0,d.queuedDefaultTrack=-1,d.trackChangeListener=function(){return d.onTextTracksChanged()},d.asyncPollTrackChange=function(){return d.pollTrackChange(0)},d.useTextTrackPolling=!1,d.subtitlePollingInterval=-1,d.subtitleDisplay=!0,d.registerListeners(),d}var P=j.prototype;return P.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,I.prototype.destroy.call(this)},P.registerListeners=function(){var d=this.hls;d.on(ae.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.on(ae.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on(ae.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on(ae.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.on(ae.Events.LEVEL_LOADING,this.onLevelLoading,this),d.on(ae.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),d.on(ae.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),d.on(ae.Events.ERROR,this.onError,this)},P.unregisterListeners=function(){var d=this.hls;d.off(ae.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.off(ae.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(ae.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(ae.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.off(ae.Events.LEVEL_LOADING,this.onLevelLoading,this),d.off(ae.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),d.off(ae.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),d.off(ae.Events.ERROR,this.onError,this)},P.onMediaAttached=function(d,p){if(this.media=p.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},P.pollTrackChange=function(d){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,d)},P.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var d=F(this.media.textTracks);d.forEach(function(p){Object(K.clearCurrentCues)(p)}),this.subtitleTrack=-1,this.media=null},P.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},P.onManifestParsed=function(d,p){this.tracks=p.subtitleTracks},P.onSubtitleTrackLoaded=function(d,p){var f=p.id,T=p.details,x=this.trackId,E=this.tracksInGroup[x];if(!E){this.warn("Invalid subtitle track id "+f);return}var k=E.details;E.details=p.details,this.log("subtitle track "+f+" loaded ["+T.startSN+"-"+T.endSN+"]"),f===this.trackId&&(this.retryCount=0,this.playlistLoaded(f,p,k))},P.onLevelLoading=function(d,p){this.switchLevel(p.level)},P.onLevelSwitching=function(d,p){this.switchLevel(p.level)},P.switchLevel=function(d){var p=this.hls.levels[d];if(!(p!=null&&p.textGroupIds))return;var f=p.textGroupIds[p.urlId];if(this.groupId!==f){var T=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,x=this.tracks.filter(function(C){return!f||C.groupId===f});this.tracksInGroup=x;var E=this.findTrackId(T==null?void 0:T.name)||this.findTrackId();this.groupId=f;var k={subtitleTracks:x};this.log("Updating subtitle tracks, "+x.length+' track(s) found in "'+f+'" group-id'),this.hls.trigger(ae.Events.SUBTITLE_TRACKS_UPDATED,k),E!==-1&&this.setSubtitleTrack(E,T)}},P.findTrackId=function(d){for(var p=this.tracksInGroup,f=0;f<p.length;f++){var T=p[f];if((!this.selectDefaultTrack||T.default)&&(!d||d===T.name))return T.id}return-1},P.onError=function(d,p){if(I.prototype.onError.call(this,d,p),p.fatal||!p.context)return;p.context.type===se.PlaylistContextType.SUBTITLE_TRACK&&p.context.id===this.trackId&&p.context.groupId===this.groupId&&this.retryLoadingOrFail(p)},P.loadPlaylist=function(d){var p=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(p)){var f=p.id,T=p.groupId,x=p.url;if(d)try{x=d.addDirectives(x)}catch(E){this.warn("Could not construct new URL with HLS Delivery Directives: "+E)}this.log("Loading subtitle playlist for id "+f),this.hls.trigger(ae.Events.SUBTITLE_TRACK_LOADING,{url:x,id:f,groupId:T,deliveryDirectives:d||null})}},P.toggleTrackModes=function(d){var p=this,f=this.media,T=this.subtitleDisplay,x=this.trackId;if(!f)return;var E=F(f.textTracks),k=E.filter(function(m){return m.groupId===p.groupId});if(d===-1)[].slice.call(E).forEach(function(m){m.mode="disabled"});else{var C=k[x];C&&(C.mode="disabled")}var b=k[d];b&&(b.mode=T?"showing":"hidden")},P.setSubtitleTrack=function(d,p){var f,T=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=d;return}if(this.trackId!==d&&this.toggleTrackModes(d),this.trackId===d&&(d===-1||(f=T[d])!==null&&f!==void 0&&f.details)||d<-1||d>=T.length)return;this.clearTimer();var x=T[d];if(this.log("Switching to subtitle track "+d),this.trackId=d,x){var E=x.id,k=x.groupId,C=k===void 0?"":k,b=x.name,m=x.type,v=x.url;this.hls.trigger(ae.Events.SUBTITLE_TRACK_SWITCH,{id:E,groupId:C,name:b,type:m,url:v});var g=this.switchParams(x.url,p==null?void 0:p.details);this.loadPlaylist(g)}else this.hls.trigger(ae.Events.SUBTITLE_TRACK_SWITCH,{id:d})},P.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var d=-1,p=F(this.media.textTracks),f=0;f<p.length;f++)if(p[f].mode==="hidden")d=f;else if(p[f].mode==="showing"){d=f;break}this.subtitleTrack!==d&&(this.subtitleTrack=d)},X(j,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(d){this.selectDefaultTrack=!1;var p=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(d,p)}}]),j}(M.default);function F(I){for(var j=[],P=0;P<I.length;P++){var w=I[P];w.kind==="subtitles"&&w.label&&j.push(I[P])}return j}re.default=H},"./src/controller/timeline-controller.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"TimelineController",function(){return F});var ae=z("./src/polyfills/number.ts"),K=z("./src/events.ts"),M=z("./src/utils/cea-608-parser.ts"),se=z("./src/utils/output-filter.ts"),q=z("./src/utils/webvtt-parser.ts"),X=z("./src/utils/texttrack-utils.ts"),V=z("./src/utils/imsc1-ttml-parser.ts"),L=z("./src/types/loader.ts"),H=z("./src/utils/logger.ts"),F=function(){function w(p){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=P(),this.captionsProperties=void 0,this.hls=p,this.config=p.config,this.Cues=p.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var f=new se.default(this,"textTrack1"),T=new se.default(this,"textTrack2"),x=new se.default(this,"textTrack3"),E=new se.default(this,"textTrack4");this.cea608Parser1=new M.default(1,f,T),this.cea608Parser2=new M.default(3,x,E)}p.on(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),p.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),p.on(K.Events.MANIFEST_LOADED,this.onManifestLoaded,this),p.on(K.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),p.on(K.Events.FRAG_LOADING,this.onFragLoading,this),p.on(K.Events.FRAG_LOADED,this.onFragLoaded,this),p.on(K.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),p.on(K.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),p.on(K.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),p.on(K.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),p.on(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var d=w.prototype;return d.destroy=function(){var f=this.hls;f.off(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),f.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.off(K.Events.MANIFEST_LOADED,this.onManifestLoaded,this),f.off(K.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),f.off(K.Events.FRAG_LOADING,this.onFragLoading,this),f.off(K.Events.FRAG_LOADED,this.onFragLoaded,this),f.off(K.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),f.off(K.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),f.off(K.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.off(K.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),f.off(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},d.addCues=function(f,T,x,E,k){for(var C=!1,b=k.length;b--;){var m=k[b],v=j(m[0],m[1],T,x);if(v>=0&&(m[0]=Math.min(m[0],T),m[1]=Math.max(m[1],x),C=!0,v/(x-T)>.5))return}if(C||k.push([T,x]),this.config.renderTextTracksNatively){var g=this.captionsTracks[f];this.Cues.newCue(g,T,x,E)}else{var _=this.Cues.newCue(null,T,x,E);this.hls.trigger(K.Events.CUES_PARSED,{type:"captions",cues:_,track:f})}},d.onInitPtsFound=function(f,T){var x=this,E=T.frag,k=T.id,C=T.initPTS,b=T.timescale,m=this.unparsedVttFrags;k==="main"&&(this.initPTS[E.cc]=C,this.timescale[E.cc]=b),m.length&&(this.unparsedVttFrags=[],m.forEach(function(v){x.onFragLoaded(K.Events.FRAG_LOADED,v)}))},d.getExistingTrack=function(f){var T=this.media;if(T)for(var x=0;x<T.textTracks.length;x++){var E=T.textTracks[x];if(E[f])return E}return null},d.createCaptionsTrack=function(f){this.config.renderTextTracksNatively?this.createNativeTrack(f):this.createNonNativeTrack(f)},d.createNativeTrack=function(f){if(this.captionsTracks[f])return;var T=this.captionsProperties,x=this.captionsTracks,E=this.media,k=T[f],C=k.label,b=k.languageCode,m=this.getExistingTrack(f);if(m)x[f]=m,Object(X.clearCurrentCues)(x[f]),Object(X.sendAddTrackEvent)(x[f],E);else{var v=this.createTextTrack("captions",C,b);v&&(v[f]=!0,x[f]=v)}},d.createNonNativeTrack=function(f){if(this.nonNativeCaptionsTracks[f])return;var T=this.captionsProperties[f];if(!T)return;var x=T.label,E={_id:f,label:x,kind:"captions",default:T.media?!!T.media.default:!1,closedCaptions:T.media};this.nonNativeCaptionsTracks[f]=E,this.hls.trigger(K.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[E]})},d.createTextTrack=function(f,T,x){var E=this.media;return E?E.addTextTrack(f,T,x):void 0},d.onMediaAttaching=function(f,T){this.media=T.media,this._cleanTracks()},d.onMediaDetaching=function(){var f=this.captionsTracks;Object.keys(f).forEach(function(T){Object(X.clearCurrentCues)(f[T]),delete f[T]}),this.nonNativeCaptionsTracks={}},d.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=P(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},d._cleanTracks=function(){var f=this.media;if(!f)return;var T=f.textTracks;if(T)for(var x=0;x<T.length;x++)Object(X.clearCurrentCues)(T[x])},d.onSubtitleTracksUpdated=function(f,T){var x=this;this.textTracks=[];var E=T.subtitleTracks||[],k=E.some(function(v){return v.textCodec===V.IMSC1_CODEC});if(this.config.enableWebVTT||k&&this.config.enableIMSC1){var C=this.tracks&&E&&this.tracks.length===E.length;if(this.tracks=E||[],this.config.renderTextTracksNatively){var b=this.media?this.media.textTracks:[];this.tracks.forEach(function(v,g){var _;if(g<b.length){for(var O=null,G=0;G<b.length;G++)if(I(b[G],v)){O=b[G];break}O&&(_=O)}_?Object(X.clearCurrentCues)(_):(_=x.createTextTrack("subtitles",v.name,v.lang),_&&(_.mode="disabled")),_&&(_.groupId=v.groupId,x.textTracks.push(_))})}else if(!C&&this.tracks&&this.tracks.length){var m=this.tracks.map(function(v){return{label:v.name,kind:v.type.toLowerCase(),default:v.default,subtitleTrack:v}});this.hls.trigger(K.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:m})}}},d.onManifestLoaded=function(f,T){var x=this;this.config.enableCEA708Captions&&T.captions&&T.captions.forEach(function(E){var k=/(?:CC|SERVICE)([1-4])/.exec(E.instreamId);if(!k)return;var C="textTrack"+k[1],b=x.captionsProperties[C];if(!b)return;b.label=E.name,E.lang&&(b.languageCode=E.lang),b.media=E})},d.onFragLoading=function(f,T){var x=this.cea608Parser1,E=this.cea608Parser2,k=this.lastSn,C=this.lastPartIndex;if(!this.enabled||!(x&&E))return;if(T.frag.type===L.PlaylistLevelType.MAIN){var b,m,v=T.frag.sn,g=(b=T==null||((m=T.part)===null||m===void 0)?void 0:m.index)!=null?b:-1;v===k+1||v===k&&g===C+1||(x.reset(),E.reset()),this.lastSn=v,this.lastPartIndex=g}},d.onFragLoaded=function(f,T){var x=T.frag,E=T.payload,k=this.initPTS,C=this.unparsedVttFrags;if(x.type===L.PlaylistLevelType.SUBTITLE)if(E.byteLength){if(!Object(ae.isFiniteNumber)(k[x.cc])){C.push(T),k.length&&this.hls.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:x,error:new Error("Missing initial subtitle PTS")});return}var b=x.decryptdata;if(b==null||b.key==null||b.method!=="AES-128"){var m=this.tracks[x.level],v=this.vttCCs;v[x.cc]||(v[x.cc]={start:x.start,prevCC:this.prevCC,new:!0},this.prevCC=x.cc),m&&m.textCodec===V.IMSC1_CODEC?this._parseIMSC1(x,E):this._parseVTTs(x,E,v)}}else this.hls.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:x,error:new Error("Empty subtitle payload")})},d._parseIMSC1=function(f,T){var x=this,E=this.hls;Object(V.parseIMSC1)(T,this.initPTS[f.cc],this.timescale[f.cc],function(k){x._appendCues(k,f.level),E.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:f})},function(k){H.logger.log("Failed to parse IMSC1: "+k),E.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:k})})},d._parseVTTs=function(f,T,x){var E=this,k=this.hls;Object(q.parseWebVTT)(T,this.initPTS[f.cc],this.timescale[f.cc],x,f.cc,f.start,function(C){E._appendCues(C,f.level),k.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:f})},function(C){E._fallbackToIMSC1(f,T),H.logger.log("Failed to parse VTT cue: "+C),k.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:C})})},d._fallbackToIMSC1=function(f,T){var x=this,E=this.tracks[f.level];E.textCodec||Object(V.parseIMSC1)(T,this.initPTS[f.cc],this.timescale[f.cc],function(){E.textCodec=V.IMSC1_CODEC,x._parseIMSC1(f,T)},function(){E.textCodec="wvtt"})},d._appendCues=function(f,T){var x=this.hls;if(this.config.renderTextTracksNatively){var E=this.textTracks[T];if(E.mode==="disabled")return;f.forEach(function(b){return Object(X.addCueToTrack)(E,b)})}else{var k=this.tracks[T],C=k.default?"default":"subtitles"+T;x.trigger(K.Events.CUES_PARSED,{type:"subtitles",cues:f,track:C})}},d.onFragDecrypted=function(f,T){var x=T.frag;if(x.type===L.PlaylistLevelType.SUBTITLE){if(!Object(ae.isFiniteNumber)(this.initPTS[x.cc])){this.unparsedVttFrags.push(T);return}this.onFragLoaded(K.Events.FRAG_LOADED,T)}},d.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},d.onFragParsingUserdata=function(f,T){var x=this.cea608Parser1,E=this.cea608Parser2;if(!this.enabled||!(x&&E))return;for(var k=0;k<T.samples.length;k++){var C=T.samples[k].bytes;if(C){var b=this.extractCea608Data(C);x.addData(T.samples[k].pts,b[0]),E.addData(T.samples[k].pts,b[1])}}},d.onBufferFlushing=function(f,T){var x=T.startOffset,E=T.endOffset,k=T.endOffsetSubtitles,C=T.type,b=this.media;if(!b||b.currentTime<E)return;if(!C||C==="video"){var m=this.captionsTracks;Object.keys(m).forEach(function(g){return Object(X.removeCuesInRange)(m[g],x,E)})}if(this.config.renderTextTracksNatively&&(x===0&&k!==void 0)){var v=this.textTracks;Object.keys(v).forEach(function(g){return Object(X.removeCuesInRange)(v[g],x,k)})}},d.extractCea608Data=function(f){for(var T=f[0]&31,x=2,E=[[],[]],k=0;k<T;k++){var C=f[x++],b=127&f[x++],m=127&f[x++],v=(4&C)!==0,g=3&C;if(b===0&&m===0)continue;v&&((g===0||g===1)&&(E[g].push(b),E[g].push(m)))}return E},w}();function I(w,d){return w&&w.label===d.name&&!(w.textTrack1||w.textTrack2)}function j(w,d,p,f){return Math.min(d,f)-Math.max(w,p)}function P(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return ae});var ae=function(){function K(se,q){this.subtle=void 0,this.aesIV=void 0,this.subtle=se,this.aesIV=q}var M=K.prototype;return M.decrypt=function(q,X){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},X,q)},K}()},"./src/crypt/aes-decryptor.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"removePadding",function(){return K}),z.d(re,"default",function(){return M});var ae=z("./src/utils/typed-array.ts");function K(se){var q=se.byteLength,X=q&&new DataView(se.buffer).getUint8(q-1);return X?Object(ae.sliceUint8)(se,0,q-X):se}var M=function(){function se(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var q=se.prototype;return q.uint8ArrayToUint32Array_=function(V){for(var L=new DataView(V),H=new Uint32Array(4),F=0;F<4;F++)H[F]=L.getUint32(F*4);return H},q.initTable=function(){var V=this.sBox,L=this.invSBox,H=this.subMix,F=H[0],I=H[1],j=H[2],P=H[3],w=this.invSubMix,d=w[0],p=w[1],f=w[2],T=w[3],x=new Uint32Array(256),E=0,k=0,C=0;for(C=0;C<256;C++)C<128?x[C]=C<<1:x[C]=C<<1^283;for(C=0;C<256;C++){var b=k^k<<1^k<<2^k<<3^k<<4;b=b>>>8^b&255^99,V[E]=b,L[b]=E;var m=x[E],v=x[m],g=x[v],_=x[b]*257^b*16843008;F[E]=_<<24|_>>>8,I[E]=_<<16|_>>>16,j[E]=_<<8|_>>>24,P[E]=_,_=g*16843009^v*65537^m*257^E*16843008,d[b]=_<<24|_>>>8,p[b]=_<<16|_>>>16,f[b]=_<<8|_>>>24,T[b]=_,E?(E=m^x[x[x[g^m]]],k^=x[x[k]]):E=k=1}},q.expandKey=function(V){for(var L=this.uint8ArrayToUint32Array_(V),H=!0,F=0;F<L.length&&H;)H=L[F]===this.key[F],F++;if(H)return;this.key=L;var I=this.keySize=L.length;if(I!==4&&I!==6&&I!==8)throw new Error("Invalid aes key size="+I);var j=this.ksRows=(I+6+1)*4,P,w,d=this.keySchedule=new Uint32Array(j),p=this.invKeySchedule=new Uint32Array(j),f=this.sBox,T=this.rcon,x=this.invSubMix,E=x[0],k=x[1],C=x[2],b=x[3],m,v;for(P=0;P<j;P++){if(P<I){m=d[P]=L[P];continue}v=m,P%I===0?(v=v<<8|v>>>24,v=f[v>>>24]<<24|f[v>>>16&255]<<16|f[v>>>8&255]<<8|f[v&255],v^=T[P/I|0]<<24):I>6&&P%I===4&&(v=f[v>>>24]<<24|f[v>>>16&255]<<16|f[v>>>8&255]<<8|f[v&255]),d[P]=m=(d[P-I]^v)>>>0}for(w=0;w<j;w++)P=j-w,w&3?v=d[P]:v=d[P-4],w<4||P<=4?p[w]=v:p[w]=E[f[v>>>24]]^k[f[v>>>16&255]]^C[f[v>>>8&255]]^b[f[v&255]],p[w]=p[w]>>>0},q.networkToHostOrderSwap=function(V){return V<<24|(V&65280)<<8|(V&16711680)>>8|V>>>24},q.decrypt=function(V,L,H){for(var F=this.keySize+6,I=this.invKeySchedule,j=this.invSBox,P=this.invSubMix,w=P[0],d=P[1],p=P[2],f=P[3],T=this.uint8ArrayToUint32Array_(H),x=T[0],E=T[1],k=T[2],C=T[3],b=new Int32Array(V),m=new Int32Array(b.length),v,g,_,O,G,Y,ee,fe,pe,xe,Ce,be,Oe,We,Me=this.networkToHostOrderSwap;L<b.length;){for(pe=Me(b[L]),xe=Me(b[L+1]),Ce=Me(b[L+2]),be=Me(b[L+3]),G=pe^I[0],Y=be^I[1],ee=Ce^I[2],fe=xe^I[3],Oe=4,We=1;We<F;We++)v=w[G>>>24]^d[Y>>16&255]^p[ee>>8&255]^f[fe&255]^I[Oe],g=w[Y>>>24]^d[ee>>16&255]^p[fe>>8&255]^f[G&255]^I[Oe+1],_=w[ee>>>24]^d[fe>>16&255]^p[G>>8&255]^f[Y&255]^I[Oe+2],O=w[fe>>>24]^d[G>>16&255]^p[Y>>8&255]^f[ee&255]^I[Oe+3],G=v,Y=g,ee=_,fe=O,Oe=Oe+4;v=j[G>>>24]<<24^j[Y>>16&255]<<16^j[ee>>8&255]<<8^j[fe&255]^I[Oe],g=j[Y>>>24]<<24^j[ee>>16&255]<<16^j[fe>>8&255]<<8^j[G&255]^I[Oe+1],_=j[ee>>>24]<<24^j[fe>>16&255]<<16^j[G>>8&255]<<8^j[Y&255]^I[Oe+2],O=j[fe>>>24]<<24^j[G>>16&255]<<16^j[Y>>8&255]<<8^j[ee&255]^I[Oe+3],m[L]=Me(v^x),m[L+1]=Me(O^E),m[L+2]=Me(_^k),m[L+3]=Me(g^C),x=pe,E=xe,k=Ce,C=be,L=L+4}return m.buffer},se}()},"./src/crypt/decrypter.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return L});var ae=z("./src/crypt/aes-crypto.ts"),K=z("./src/crypt/fast-aes-key.ts"),M=z("./src/crypt/aes-decryptor.ts"),se=z("./src/utils/logger.ts"),q=z("./src/utils/mp4-tools.ts"),X=z("./src/utils/typed-array.ts"),V=16,L=function(){function H(I,j,P){var w=P===void 0?{}:P,d=w.removePKCS7Padding,p=d===void 0?!0:d;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=I,this.config=j,this.removePKCS7Padding=p,p)try{var f=self.crypto;f&&(this.subtle=f.subtle||f.webkitSubtle)}catch(T){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var F=H.prototype;return F.destroy=function(){this.observer=null},F.isSync=function(){return this.config.enableSoftwareAES},F.flush=function(){var j=this.currentResult;if(!j){this.reset();return}var P=new Uint8Array(j);return this.reset(),this.removePKCS7Padding?Object(M.removePadding)(P):P},F.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},F.decrypt=function(j,P,w,d){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(j),P,w);var p=this.flush();p&&d(p.buffer)}else this.webCryptoDecrypt(new Uint8Array(j),P,w).then(d)},F.softwareDecrypt=function(j,P,w){var d=this.currentIV,p=this.currentResult,f=this.remainderData;this.logOnce("JS AES decrypt"),f&&(j=Object(q.appendUint8Array)(f,j),this.remainderData=null);var T=this.getValidChunk(j);if(!T.length)return null;d&&(w=d);var x=this.softwareDecrypter;x||(x=this.softwareDecrypter=new M.default),x.expandKey(P);var E=p;return this.currentResult=x.decrypt(T.buffer,0,w),this.currentIV=Object(X.sliceUint8)(T,-16).buffer,E||null},F.webCryptoDecrypt=function(j,P,w){var d=this,p=this.subtle;return(this.key!==P||!this.fastAesKey)&&(this.key=P,this.fastAesKey=new K.default(p,P)),this.fastAesKey.expandKey().then(function(f){if(!p)return Promise.reject(new Error("web crypto not initialized"));var T=new ae.default(p,w);return T.decrypt(j.buffer,f)}).catch(function(f){return d.onWebCryptoError(f,j,P,w)})},F.onWebCryptoError=function(j,P,w,d){return se.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",j),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(P,w,d)},F.getValidChunk=function(j){var P=j,w=j.length-j.length%V;return w!==j.length&&(P=Object(X.sliceUint8)(j,0,w),this.remainderData=Object(X.sliceUint8)(j,w)),P},F.logOnce=function(j){if(!this.logEnabled)return;se.logger.log("[decrypter.ts]: "+j),this.logEnabled=!1},H}()},"./src/crypt/fast-aes-key.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return ae});var ae=function(){function K(se,q){this.subtle=void 0,this.key=void 0,this.subtle=se,this.key=q}var M=K.prototype;return M.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},K}()},"./src/demux/aacdemuxer.ts":function(ze,re,z){"use strict";z.r(re);var ae=z("./src/demux/base-audio-demuxer.ts"),K=z("./src/demux/adts.ts"),M=z("./src/utils/logger.ts"),se=z("./src/demux/id3.ts");function q(L,H){L.prototype=Object.create(H.prototype),L.prototype.constructor=L,X(L,H)}function X(L,H){return X=Object.setPrototypeOf||function(I,j){return I.__proto__=j,I},X(L,H)}var V=function(L){q(H,L);function H(I,j){var P;return P=L.call(this)||this,P.observer=void 0,P.config=void 0,P.observer=I,P.config=j,P}var F=H.prototype;return F.resetInitSegment=function(j,P,w){L.prototype.resetInitSegment.call(this,j,P,w),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:j,duration:w,inputTimeScale:9e4,dropped:0}},H.probe=function(j){if(!j)return!1;for(var P=se.getID3Data(j,0)||[],w=P.length,d=j.length;w<d;w++)if(K.probe(j,w))return M.logger.log("ADTS sync word found !"),!0;return!1},F.canParse=function(j,P){return K.canParse(j,P)},F.appendFrame=function(j,P,w){K.initTrackConfig(j,this.observer,P,w,j.manifestCodec);var d=K.appendFrame(j,P,w,this.initPTS,this.frameIndex);if(d&&d.missing===0)return d},H}(ae.default);V.minProbeByteLength=9,re.default=V},"./src/demux/adts.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"getAudioConfig",function(){return se}),z.d(re,"isHeaderPattern",function(){return q}),z.d(re,"getHeaderLength",function(){return X}),z.d(re,"getFullFrameLength",function(){return V}),z.d(re,"canGetFrameLength",function(){return L}),z.d(re,"isHeader",function(){return H}),z.d(re,"canParse",function(){return F}),z.d(re,"probe",function(){return I}),z.d(re,"initTrackConfig",function(){return j}),z.d(re,"getFrameDuration",function(){return P}),z.d(re,"parseFrameHeader",function(){return w}),z.d(re,"appendFrame",function(){return d});var ae=z("./src/utils/logger.ts"),K=z("./src/errors.ts"),M=z("./src/events.ts");function se(p,f,T,x){var E,k,C,b,m=navigator.userAgent.toLowerCase(),v=x,g=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];E=((f[T+2]&192)>>>6)+1;var _=(f[T+2]&60)>>>2;if(_>g.length-1){p.trigger(M.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+_});return}return C=(f[T+2]&1)<<2,C|=(f[T+3]&192)>>>6,ae.logger.log("manifest codec:"+x+", ADTS type:"+E+", samplingIndex:"+_),/firefox/i.test(m)?_>=6?(E=5,b=new Array(4),k=_-3):(E=2,b=new Array(2),k=_):m.indexOf("android")!==-1?(E=2,b=new Array(2),k=_):(E=5,b=new Array(4),x&&(x.indexOf("mp4a.40.29")!==-1||x.indexOf("mp4a.40.5")!==-1)||!x&&_>=6?k=_-3:((x&&x.indexOf("mp4a.40.2")!==-1&&(_>=6&&C===1||/vivaldi/i.test(m))||!x&&C===1)&&(E=2,b=new Array(2)),k=_)),b[0]=E<<3,b[0]|=(_&14)>>1,b[1]|=(_&1)<<7,b[1]|=C<<3,E===5&&(b[1]|=(k&14)>>1,b[2]=(k&1)<<7,b[2]|=2<<2,b[3]=0),{config:b,samplerate:g[_],channelCount:C,codec:"mp4a.40."+E,manifestCodec:v}}function q(p,f){return p[f]===255&&(p[f+1]&246)===240}function X(p,f){return p[f+1]&1?7:9}function V(p,f){return(p[f+3]&3)<<11|p[f+4]<<3|(p[f+5]&224)>>>5}function L(p,f){return f+5<p.length}function H(p,f){return f+1<p.length&&q(p,f)}function F(p,f){return L(p,f)&&q(p,f)&&V(p,f)<=p.length-f}function I(p,f){if(H(p,f)){var T=X(p,f);if(f+T>=p.length)return!1;var x=V(p,f);if(x<=T)return!1;var E=f+x;return E===p.length||H(p,E)}return!1}function j(p,f,T,x,E){if(!p.samplerate){var k=se(f,T,x,E);if(!k)return;p.config=k.config,p.samplerate=k.samplerate,p.channelCount=k.channelCount,p.codec=k.codec,p.manifestCodec=k.manifestCodec,ae.logger.log("parsed codec:"+p.codec+", rate:"+k.samplerate+", channels:"+k.channelCount)}}function P(p){return 1024*9e4/p}function w(p,f,T,x,E){var k=X(p,f),C=V(p,f);if(C-=k,C>0){var b=T+x*E;return{headerLength:k,frameLength:C,stamp:b}}}function d(p,f,T,x,E){var k=P(p.samplerate),C=w(f,T,x,E,k);if(C){var b=C.frameLength,m=C.headerLength,v=C.stamp,g=m+b,_=Math.max(0,T+g-f.length),O;_?(O=new Uint8Array(g-m),O.set(f.subarray(T+m,f.length),0)):O=f.subarray(T+m,T+g);var G={unit:O,pts:v};return _||p.samples.push(G),{sample:G,length:g,missing:_}}}},"./src/demux/base-audio-demuxer.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"initPTSFn",function(){return V});var ae=z("./src/polyfills/number.ts"),K=z("./src/demux/id3.ts"),M=z("./src/demux/dummy-demuxed-track.ts"),se=z("./src/utils/mp4-tools.ts"),q=z("./src/utils/typed-array.ts"),X=function(){function L(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var H=L.prototype;return H.resetInitSegment=function(I,j,P){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},H.resetTimeStamp=function(){},H.resetContiguity=function(){},H.canParse=function(I,j){return!1},H.appendFrame=function(I,j,P){},H.demux=function(I,j){this.cachedData&&(I=Object(se.appendUint8Array)(this.cachedData,I),this.cachedData=null);var P=K.getID3Data(I,0),w=P?P.length:0,d,p,f=this._audioTrack,T=this._id3Track,x=P?K.getTimeStamp(P):void 0,E=I.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=V(x,j)),P&&P.length>0&&T.samples.push({pts:this.initPTS,dts:this.initPTS,data:P}),p=this.initPTS;w<E;){if(this.canParse(I,w)){var k=this.appendFrame(f,I,w);k?(this.frameIndex++,p=k.sample.pts,w+=k.length,d=w):w=E}else K.canParse(I,w)?(P=K.getID3Data(I,w),T.samples.push({pts:p,dts:p,data:P}),w+=P.length,d=w):w++;if(w===E&&d!==E){var C=Object(q.sliceUint8)(I,d);this.cachedData?this.cachedData=Object(se.appendUint8Array)(this.cachedData,C):this.cachedData=C}}return{audioTrack:f,avcTrack:Object(M.dummyTrack)(),id3Track:T,textTrack:Object(M.dummyTrack)()}},H.demuxSampleAes=function(I,j,P){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},H.flush=function(I){var j=this.cachedData;return j&&(this.cachedData=null,this.demux(j,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(M.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(M.dummyTrack)()}},H.destroy=function(){},L}(),V=function(H,F){return Object(ae.isFiniteNumber)(H)?H*90:F*9e4};re.default=X},"./src/demux/chunk-cache.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return ae});var ae=function(){function M(){this.chunks=[],this.dataLength=0}var se=M.prototype;return se.push=function(X){this.chunks.push(X),this.dataLength+=X.length},se.flush=function(){var X=this.chunks,V=this.dataLength,L;if(X.length)X.length===1?L=X[0]:L=K(X,V);else return new Uint8Array(0);return this.reset(),L},se.reset=function(){this.chunks.length=0,this.dataLength=0},M}();function K(M,se){for(var q=new Uint8Array(se),X=0,V=0;V<M.length;V++){var L=M[V];q.set(L,X),X+=L.length}return q}},"./src/demux/dummy-demuxed-track.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"dummyTrack",function(){return ae});function ae(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ze,re,z){"use strict";z.r(re);var ae=z("./src/utils/logger.ts"),K=function(){function M(q){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=q,this.bytesAvailable=q.byteLength,this.word=0,this.bitsAvailable=0}var se=M.prototype;return se.loadWord=function(){var X=this.data,V=this.bytesAvailable,L=X.byteLength-V,H=new Uint8Array(4),F=Math.min(4,V);if(F===0)throw new Error("no bytes available");H.set(X.subarray(L,L+F)),this.word=new DataView(H.buffer).getUint32(0),this.bitsAvailable=F*8,this.bytesAvailable-=F},se.skipBits=function(X){var V;this.bitsAvailable>X?(this.word<<=X,this.bitsAvailable-=X):(X-=this.bitsAvailable,V=X>>3,X-=V>>3,this.bytesAvailable-=V,this.loadWord(),this.word<<=X,this.bitsAvailable-=X)},se.readBits=function(X){var V=Math.min(this.bitsAvailable,X),L=this.word>>>32-V;return X>32&&ae.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=V,this.bitsAvailable>0?this.word<<=V:this.bytesAvailable>0&&this.loadWord(),V=X-V,V>0&&this.bitsAvailable?L<<V|this.readBits(V):L},se.skipLZ=function(){var X;for(X=0;X<this.bitsAvailable;++X)if((this.word&2147483648>>>X)!==0)return this.word<<=X,this.bitsAvailable-=X,X;return this.loadWord(),X+this.skipLZ()},se.skipUEG=function(){this.skipBits(1+this.skipLZ())},se.skipEG=function(){this.skipBits(1+this.skipLZ())},se.readUEG=function(){var X=this.skipLZ();return this.readBits(X+1)-1},se.readEG=function(){var X=this.readUEG();return 1&X?1+X>>>1:-1*(X>>>1)},se.readBoolean=function(){return this.readBits(1)===1},se.readUByte=function(){return this.readBits(8)},se.readUShort=function(){return this.readBits(16)},se.readUInt=function(){return this.readBits(32)},se.skipScalingList=function(X){for(var V=8,L=8,H,F=0;F<X;F++)L!==0&&(H=this.readEG(),L=(V+H+256)%256),V=L===0?V:L},se.readSPS=function(){var X=0,V=0,L=0,H=0,F,I,j,P=this.readUByte.bind(this),w=this.readBits.bind(this),d=this.readUEG.bind(this),p=this.readBoolean.bind(this),f=this.skipBits.bind(this),T=this.skipEG.bind(this),x=this.skipUEG.bind(this),E=this.skipScalingList.bind(this);P();var k=P();if(w(5),f(3),P(),x(),k===100||k===110||k===122||k===244||k===44||k===83||k===86||k===118||k===128){var C=d();if(C===3&&f(1),x(),x(),f(1),p())for(I=C!==3?8:12,j=0;j<I;j++)p()&&(j<6?E(16):E(64))}x();var b=d();if(b===0)d();else if(b===1)for(f(1),T(),T(),F=d(),j=0;j<F;j++)T();x(),f(1);var m=d(),v=d(),g=w(1);g===0&&f(1),f(1),p()&&(X=d(),V=d(),L=d(),H=d());var _=[1,1];if(p()&&p()){var O=P();switch(O){case 1:_=[1,1];break;case 2:_=[12,11];break;case 3:_=[10,11];break;case 4:_=[16,11];break;case 5:_=[40,33];break;case 6:_=[24,11];break;case 7:_=[20,11];break;case 8:_=[32,11];break;case 9:_=[80,33];break;case 10:_=[18,11];break;case 11:_=[15,11];break;case 12:_=[64,33];break;case 13:_=[160,99];break;case 14:_=[4,3];break;case 15:_=[3,2];break;case 16:_=[2,1];break;case 255:{_=[P()<<8|P(),P()<<8|P()];break}}}return{width:Math.ceil((m+1)*16-X*2-V*2),height:(2-g)*(v+1)*16-(g?2:4)*(L+H),pixelRatio:_}},se.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},M}();re.default=K},"./src/demux/id3.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"isHeader",function(){return ae}),z.d(re,"isFooter",function(){return K}),z.d(re,"getID3Data",function(){return M}),z.d(re,"canParse",function(){return q}),z.d(re,"getTimeStamp",function(){return X}),z.d(re,"isTimeStampFrame",function(){return V}),z.d(re,"getID3Frames",function(){return H}),z.d(re,"decodeFrame",function(){return F}),z.d(re,"utf8ArrayToStr",function(){return d}),z.d(re,"testables",function(){return p});var ae=function(E,k){return k+10<=E.length&&(E[k]===73&&E[k+1]===68&&E[k+2]===51&&(E[k+3]<255&&E[k+4]<255&&(E[k+6]<128&&E[k+7]<128&&E[k+8]<128&&E[k+9]<128)))},K=function(E,k){return k+10<=E.length&&(E[k]===51&&E[k+1]===68&&E[k+2]===73&&(E[k+3]<255&&E[k+4]<255&&(E[k+6]<128&&E[k+7]<128&&E[k+8]<128&&E[k+9]<128)))},M=function(E,k){for(var C=k,b=0;ae(E,k);){b+=10;var m=se(E,k+6);b+=m,K(E,k+10)&&(b+=10),k+=b}return b>0?E.subarray(C,C+b):void 0},se=function(E,k){var C=0;return C=(E[k]&127)<<21,C|=(E[k+1]&127)<<14,C|=(E[k+2]&127)<<7,C|=E[k+3]&127,C},q=function(E,k){return ae(E,k)&&se(E,k+6)+10<=E.length-k},X=function(E){for(var k=H(E),C=0;C<k.length;C++){var b=k[C];if(V(b))return w(b)}return},V=function(E){return E&&E.key==="PRIV"&&E.info==="com.apple.streaming.transportStreamTimestamp"},L=function(E){var k=String.fromCharCode(E[0],E[1],E[2],E[3]),C=se(E,4),b=10;return{type:k,size:C,data:E.subarray(b,b+C)}},H=function(E){for(var k=0,C=[];ae(E,k);){var b=se(E,k+6);k+=10;for(var m=k+b;k+8<m;){var v=L(E.subarray(k)),g=F(v);g&&C.push(g),k+=v.size+10}K(E,k)&&(k+=10)}return C},F=function(E){return E.type==="PRIV"?I(E):E.type[0]==="W"?P(E):j(E)},I=function(E){if(E.size<2)return;var k=d(E.data,!0),C=new Uint8Array(E.data.subarray(k.length+1));return{key:E.type,info:k,data:C.buffer}},j=function(E){if(E.size<2)return;if(E.type==="TXXX"){var k=1,C=d(E.data.subarray(k),!0);k+=C.length+1;var b=d(E.data.subarray(k));return{key:E.type,info:C,data:b}}var m=d(E.data.subarray(1));return{key:E.type,data:m}},P=function(E){if(E.type==="WXXX"){if(E.size<2)return;var k=1,C=d(E.data.subarray(k),!0);k+=C.length+1;var b=d(E.data.subarray(k));return{key:E.type,info:C,data:b}}var m=d(E.data);return{key:E.type,data:m}},w=function(E){if(E.data.byteLength===8){var k=new Uint8Array(E.data),C=k[3]&1,b=(k[4]<<23)+(k[5]<<15)+(k[6]<<7)+k[7];return b/=45,C&&(b+=4772185884e-2),Math.round(b)}return},d=function(E,k){k===void 0&&(k=!1);var C=T();if(C){var b=C.decode(E);if(k){var m=b.indexOf("\0");return m!==-1?b.substring(0,m):b}return b.replace(/\0/g,"")}for(var v=E.length,g,_,O,G="",Y=0;Y<v;){if(g=E[Y++],g===0&&k)return G;if(g===0||g===3)continue;switch(g>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:G+=String.fromCharCode(g);break;case 12:case 13:_=E[Y++],G+=String.fromCharCode((g&31)<<6|_&63);break;case 14:_=E[Y++],O=E[Y++],G+=String.fromCharCode((g&15)<<12|(_&63)<<6|(O&63)<<0);break;default:}}return G},p={decodeTextFrame:j},f;function T(){return!f&&typeof self.TextDecoder!="undefined"&&(f=new self.TextDecoder("utf-8")),f}},"./src/demux/mp3demuxer.ts":function(ze,re,z){"use strict";z.r(re);var ae=z("./src/demux/base-audio-demuxer.ts"),K=z("./src/demux/id3.ts"),M=z("./src/utils/logger.ts"),se=z("./src/demux/mpegaudio.ts");function q(L,H){L.prototype=Object.create(H.prototype),L.prototype.constructor=L,X(L,H)}function X(L,H){return X=Object.setPrototypeOf||function(I,j){return I.__proto__=j,I},X(L,H)}var V=function(L){q(H,L);function H(){return L.apply(this,arguments)||this}var F=H.prototype;return F.resetInitSegment=function(j,P,w){L.prototype.resetInitSegment.call(this,j,P,w),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:j,duration:w,inputTimeScale:9e4,dropped:0}},H.probe=function(j){if(!j)return!1;for(var P=K.getID3Data(j,0)||[],w=P.length,d=j.length;w<d;w++)if(se.probe(j,w))return M.logger.log("MPEG Audio sync word found !"),!0;return!1},F.canParse=function(j,P){return se.canParse(j,P)},F.appendFrame=function(j,P,w){return this.initPTS===null?void 0:se.appendFrame(j,P,w,this.initPTS,this.frameIndex)},H}(ae.default);V.minProbeByteLength=4,re.default=V},"./src/demux/mp4demuxer.ts":function(ze,re,z){"use strict";z.r(re);var ae=z("./src/utils/mp4-tools.ts"),K=z("./src/demux/dummy-demuxed-track.ts"),M=function(){function se(X,V){this.remainderData=null,this.config=void 0,this.config=V}var q=se.prototype;return q.resetTimeStamp=function(){},q.resetInitSegment=function(){},q.resetContiguity=function(){},se.probe=function(V){return Object(ae.findBox)({data:V,start:0,end:Math.min(V.length,16384)},["moof"]).length>0},q.demux=function(V){var L=V,H=Object(K.dummyTrack)();if(this.config.progressive){this.remainderData&&(L=Object(ae.appendUint8Array)(this.remainderData,V));var F=Object(ae.segmentValidRange)(L);this.remainderData=F.remainder,H.samples=F.valid||new Uint8Array}else H.samples=L;return{audioTrack:Object(K.dummyTrack)(),avcTrack:H,id3Track:Object(K.dummyTrack)(),textTrack:Object(K.dummyTrack)()}},q.flush=function(){var V=Object(K.dummyTrack)();return V.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(K.dummyTrack)(),avcTrack:V,id3Track:Object(K.dummyTrack)(),textTrack:Object(K.dummyTrack)()}},q.demuxSampleAes=function(V,L,H){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},q.destroy=function(){},se}();M.minProbeByteLength=1024,re.default=M},"./src/demux/mpegaudio.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"appendFrame",function(){return X}),z.d(re,"parseHeader",function(){return V}),z.d(re,"isHeaderPattern",function(){return L}),z.d(re,"isHeader",function(){return H}),z.d(re,"canParse",function(){return F}),z.d(re,"probe",function(){return I});var ae=null,K=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],M=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],se=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],q=[0,1,1,4];function X(j,P,w,d,p){if(w+24>P.length)return;var f=V(P,w);if(f&&w+f.frameLength<=P.length){var T=f.samplesPerFrame*9e4/f.sampleRate,x=d+p*T,E={unit:P.subarray(w,w+f.frameLength),pts:x,dts:x};return j.config=[],j.channelCount=f.channelCount,j.samplerate=f.sampleRate,j.samples.push(E),{sample:E,length:f.frameLength,missing:0}}}function V(j,P){var w=j[P+1]>>3&3,d=j[P+1]>>1&3,p=j[P+2]>>4&15,f=j[P+2]>>2&3;if(w!==1&&p!==0&&p!==15&&f!==3){var T=j[P+2]>>1&1,x=j[P+3]>>6,E=w===3?3-d:d===3?3:4,k=K[E*14+p-1]*1e3,C=w===3?0:w===2?1:2,b=M[C*3+f],m=x===3?1:2,v=se[w][d],g=q[d],_=v*8*g,O=Math.floor(v*k/b+T)*g;if(ae===null){var G=navigator.userAgent||"",Y=G.match(/Chrome\/(\d+)/i);ae=Y?parseInt(Y[1]):0}var ee=!!ae&&ae<=87;return ee&&d===2&&k>=224e3&&x===0&&(j[P+3]=j[P+3]|128),{sampleRate:b,channelCount:m,frameLength:O,samplesPerFrame:_}}}function L(j,P){return j[P]===255&&(j[P+1]&224)===224&&(j[P+1]&6)!==0}function H(j,P){return P+1<j.length&&L(j,P)}function F(j,P){var w=4;return L(j,P)&&w<=j.length-P}function I(j,P){if(P+1<j.length&&L(j,P)){var w=4,d=V(j,P),p=w;d!=null&&d.frameLength&&(p=d.frameLength);var f=P+p;return f===j.length||H(j,f)}return!1}},"./src/demux/sample-aes.ts":function(ze,re,z){"use strict";z.r(re);var ae=z("./src/crypt/decrypter.ts"),K=z("./src/demux/tsdemuxer.ts"),M=function(){function se(X,V,L){this.keyData=void 0,this.decrypter=void 0,this.keyData=L,this.decrypter=new ae.default(X,V,{removePKCS7Padding:!1})}var q=se.prototype;return q.decryptBuffer=function(V,L){this.decrypter.decrypt(V,this.keyData.key.buffer,this.keyData.iv.buffer,L)},q.decryptAacSample=function(V,L,H,F){var I=V[L].unit,j=I.subarray(16,I.length-I.length%16),P=j.buffer.slice(j.byteOffset,j.byteOffset+j.length),w=this;this.decryptBuffer(P,function(d){var p=new Uint8Array(d);I.set(p,16),F||w.decryptAacSamples(V,L+1,H)})},q.decryptAacSamples=function(V,L,H){for(;;L++){if(L>=V.length){H();return}if(V[L].unit.length<32)continue;var F=this.decrypter.isSync();if(this.decryptAacSample(V,L,H,F),!F)return}},q.getAvcEncryptedData=function(V){for(var L=Math.floor((V.length-48)/160)*16+16,H=new Int8Array(L),F=0,I=32;I<=V.length-16;I+=160,F+=16)H.set(V.subarray(I,I+16),F);return H},q.getAvcDecryptedUnit=function(V,L){for(var H=new Uint8Array(L),F=0,I=32;I<=V.length-16;I+=160,F+=16)V.set(H.subarray(F,F+16),I);return V},q.decryptAvcSample=function(V,L,H,F,I,j){var P=Object(K.discardEPB)(I.data),w=this.getAvcEncryptedData(P),d=this;this.decryptBuffer(w.buffer,function(p){I.data=d.getAvcDecryptedUnit(P,p),j||d.decryptAvcSamples(V,L,H+1,F)})},q.decryptAvcSamples=function(V,L,H,F){if(V instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;L++,H=0){if(L>=V.length){F();return}for(var I=V[L].units;!(H>=I.length);H++){var j=I[H];if(j.data.length<=48||j.type!==1&&j.type!==5)continue;var P=this.decrypter.isSync();if(this.decryptAvcSample(V,L,H,F,j,P),!P)return}}},se}();re.default=M},"./src/demux/transmuxer-interface.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return I});var ae=z("./node_modules/webworkify-webpack/index.js"),K=z.n(ae),M=z("./src/events.ts"),se=z("./src/demux/transmuxer.ts"),q=z("./src/utils/logger.ts"),X=z("./src/errors.ts"),V=z("./src/utils/mediasource-helper.ts"),L=z("./node_modules/eventemitter3/index.js"),H=z.n(L),F=Object(V.getMediaSource)()||{isTypeSupported:function(){return!1}},I=function(){function j(w,d,p,f){var T=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=w,this.id=d,this.onTransmuxComplete=p,this.onFlush=f;var x=w.config,E=function(v,g){g=g||{},g.frag=T.frag,g.id=T.id,w.trigger(v,g)};this.observer=new L.EventEmitter,this.observer.on(M.Events.FRAG_DECRYPTED,E),this.observer.on(M.Events.ERROR,E);var k={mp4:F.isTypeSupported("video/mp4"),mpeg:F.isTypeSupported("audio/mpeg"),mp3:F.isTypeSupported('audio/mp4; codecs="mp3"')},C=navigator.vendor;if(x.enableWorker&&typeof Worker!="undefined"){q.logger.log("demuxing in webworker");var b;try{b=this.worker=ae("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),b.addEventListener("message",this.onwmsg),b.onerror=function(m){w.trigger(M.Events.ERROR,{type:X.ErrorTypes.OTHER_ERROR,details:X.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(m.message+" ("+m.filename+":"+m.lineno+")")})},b.postMessage({cmd:"init",typeSupported:k,vendor:C,id:d,config:JSON.stringify(x)})}catch(m){q.logger.warn("Error in worker:",m),q.logger.error("Error while initializing DemuxerWorker, fallback to inline"),b&&self.URL.revokeObjectURL(b.objectURL),this.transmuxer=new se.default(this.observer,k,x,C,d),this.worker=null}}else this.transmuxer=new se.default(this.observer,k,x,C,d)}var P=j.prototype;return P.destroy=function(){var d=this.worker;if(d)d.removeEventListener("message",this.onwmsg),d.terminate(),this.worker=null;else{var p=this.transmuxer;p&&(p.destroy(),this.transmuxer=null)}var f=this.observer;f&&f.removeAllListeners(),this.observer=null},P.push=function(d,p,f,T,x,E,k,C,b,m){var v=this;b.transmuxing.start=self.performance.now();var g=this.transmuxer,_=this.worker,O=E?E.start:x.start,G=x.decryptdata,Y=this.frag,ee=!(Y&&x.cc===Y.cc),fe=!(Y&&b.level===Y.level),pe=Y?b.sn-Y.sn:-1,xe=this.part?b.part-this.part.index:1,Ce=!fe&&(pe===1||pe===0&&xe===1),be=self.performance.now();(fe||pe||x.stats.parsing.start===0)&&(x.stats.parsing.start=be),E&&(xe||!Ce)&&(E.stats.parsing.start=be);var Oe=new se.TransmuxState(ee,Ce,C,fe,O);if(!Ce||ee){q.logger.log("[transmuxer-interface, "+x.type+"]: Starting new transmux session for sn: "+b.sn+" p: "+b.part+" level: "+b.level+" id: "+b.id+`
|
|
|
discontinuity: `+ee+`
|
|
|
trackSwitch: `+fe+`
|
|
|
contiguous: `+Ce+`
|
|
|
accurateTimeOffset: `+C+`
|
|
|
timeOffset: `+O);var We=new se.TransmuxConfig(f,T,p,k,m);this.configureTransmuxer(We)}if(this.frag=x,this.part=E,_)_.postMessage({cmd:"demux",data:d,decryptdata:G,chunkMeta:b,state:Oe},d instanceof ArrayBuffer?[d]:[]);else if(g){var Me=g.push(d,G,b,Oe);Object(se.isPromise)(Me)?Me.then(function(ct){v.handleTransmuxComplete(ct)}):this.handleTransmuxComplete(Me)}},P.flush=function(d){var p=this;d.transmuxing.start=self.performance.now();var f=this.transmuxer,T=this.worker;if(T)T.postMessage({cmd:"flush",chunkMeta:d});else if(f){var x=f.flush(d);Object(se.isPromise)(x)?x.then(function(E){p.handleFlushResult(E,d)}):this.handleFlushResult(x,d)}},P.handleFlushResult=function(d,p){var f=this;d.forEach(function(T){f.handleTransmuxComplete(T)}),this.onFlush(p)},P.onWorkerMessage=function(d){var p=d.data,f=this.hls;switch(p.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(p.data);break}case"flush":{this.onFlush(p.data);break}default:{p.data=p.data||{},p.data.frag=this.frag,p.data.id=this.id,f.trigger(p.event,p.data);break}}},P.configureTransmuxer=function(d){var p=this.worker,f=this.transmuxer;p?p.postMessage({cmd:"configure",config:d}):f&&f.configure(d)},P.handleTransmuxComplete=function(d){d.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(d)},j}()},"./src/demux/transmuxer-worker.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return X});var ae=z("./src/demux/transmuxer.ts"),K=z("./src/events.ts"),M=z("./src/utils/logger.ts"),se=z("./node_modules/eventemitter3/index.js"),q=z.n(se);function X(I){var j=new se.EventEmitter,P=function(d,p){I.postMessage({event:d,data:p})};j.on(K.Events.FRAG_DECRYPTED,P),j.on(K.Events.ERROR,P),I.addEventListener("message",function(w){var d=w.data;switch(d.cmd){case"init":{var p=JSON.parse(d.config);I.transmuxer=new ae.default(j,d.typeSupported,p,d.vendor,d.id),Object(M.enableLogs)(p.debug),P("init",null);break}case"configure":{I.transmuxer.configure(d.config);break}case"demux":{var f=I.transmuxer.push(d.data,d.decryptdata,d.chunkMeta,d.state);Object(ae.isPromise)(f)?f.then(function(E){V(I,E)}):V(I,f);break}case"flush":{var T=d.chunkMeta,x=I.transmuxer.flush(T);Object(ae.isPromise)(x)?x.then(function(E){H(I,E,T)}):H(I,x,T);break}default:break}})}function V(I,j){if(F(j.remuxResult))return;var P=[],w=j.remuxResult,d=w.audio,p=w.video;d&&L(P,d),p&&L(P,p),I.postMessage({event:"transmuxComplete",data:j},P)}function L(I,j){j.data1&&I.push(j.data1.buffer),j.data2&&I.push(j.data2.buffer)}function H(I,j,P){j.forEach(function(w){V(I,w)}),I.postMessage({event:"flush",data:P})}function F(I){return!I.audio&&!I.video&&!I.text&&!I.id3&&!I.initSegment}},"./src/demux/transmuxer.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return p}),z.d(re,"isPromise",function(){return x}),z.d(re,"TransmuxConfig",function(){return E}),z.d(re,"TransmuxState",function(){return k});var ae=z("./src/events.ts"),K=z("./src/errors.ts"),M=z("./src/crypt/decrypter.ts"),se=z("./src/demux/aacdemuxer.ts"),q=z("./src/demux/mp4demuxer.ts"),X=z("./src/demux/tsdemuxer.ts"),V=z("./src/demux/mp3demuxer.ts"),L=z("./src/remux/mp4-remuxer.ts"),H=z("./src/remux/passthrough-remuxer.ts"),F=z("./src/demux/chunk-cache.ts"),I=z("./src/utils/mp4-tools.ts"),j=z("./src/utils/logger.ts"),P;try{P=self.performance.now.bind(self.performance)}catch(C){j.logger.debug("Unable to use Performance API on this environment"),P=self.Date.now}var w=[{demux:X.default,remux:L.default},{demux:q.default,remux:H.default},{demux:se.default,remux:L.default},{demux:V.default,remux:L.default}],d=1024;w.forEach(function(C){var b=C.demux;d=Math.max(d,b.minProbeByteLength)});var p=function(){function C(m,v,g,_,O){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new F.default,this.observer=m,this.typeSupported=v,this.config=g,this.vendor=_,this.id=O}var b=C.prototype;return b.configure=function(v){this.transmuxConfig=v,this.decrypter&&this.decrypter.reset()},b.push=function(v,g,_,O){var G=this,Y=_.transmuxing;Y.executeStart=P();var ee=new Uint8Array(v),fe=this.cache,pe=this.config,xe=this.currentTransmuxState,Ce=this.transmuxConfig;O&&(this.currentTransmuxState=O);var be=f(ee,g);if(be&&be.method==="AES-128"){var Oe=this.getDecrypter();if(pe.enableSoftwareAES){var We=Oe.softwareDecrypt(ee,be.key.buffer,be.iv.buffer);if(!We)return Y.executeEnd=P(),T(_);ee=new Uint8Array(We)}else return this.decryptionPromise=Oe.webCryptoDecrypt(ee,be.key.buffer,be.iv.buffer).then(function(je){var $e=G.push(je,null,_);return G.decryptionPromise=null,$e}),this.decryptionPromise}var Me=O||xe,ct=Me.contiguous,Ge=Me.discontinuity,Je=Me.trackSwitch,Xe=Me.accurateTimeOffset,Ye=Me.timeOffset,ke=Ce.audioCodec,Z=Ce.videoCodec,A=Ce.defaultInitPts,R=Ce.duration,J=Ce.initSegmentData;if((Ge||Je)&&this.resetInitSegment(J,ke,Z,R),Ge&&this.resetInitialTimestamp(A),ct||this.resetContiguity(),this.needsProbing(ee,Ge,Je)){if(fe.dataLength){var oe=fe.flush();ee=Object(I.appendUint8Array)(oe,ee)}this.configureTransmuxer(ee,Ce)}var $=this.transmux(ee,be,Ye,Xe,_),Se=this.currentTransmuxState;return Se.contiguous=!0,Se.discontinuity=!1,Se.trackSwitch=!1,Y.executeEnd=P(),$},b.flush=function(v){var g=this,_=v.transmuxing;_.executeStart=P();var O=this.decrypter,G=this.cache,Y=this.currentTransmuxState,ee=this.decryptionPromise;if(ee)return ee.then(function(){return g.flush(v)});var fe=[],pe=Y.timeOffset;if(O){var xe=O.flush();xe&&fe.push(this.push(xe,null,v))}var Ce=G.dataLength;G.reset();var be=this.demuxer,Oe=this.remuxer;if(!be||!Oe)return Ce>=d&&this.observer.emit(ae.Events.ERROR,ae.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),_.executeEnd=P(),[T(v)];var We=be.flush(pe);return x(We)?We.then(function(Me){return g.flushRemux(fe,Me,v),fe}):(this.flushRemux(fe,We,v),fe)},b.flushRemux=function(v,g,_){var O=g.audioTrack,G=g.avcTrack,Y=g.id3Track,ee=g.textTrack,fe=this.currentTransmuxState,pe=fe.accurateTimeOffset,xe=fe.timeOffset;j.logger.log("[transmuxer.ts]: Flushed fragment "+_.sn+(_.part>-1?" p: "+_.part:"")+" of level "+_.level);var Ce=this.remuxer.remux(O,G,Y,ee,xe,pe,!0,this.id);v.push({remuxResult:Ce,chunkMeta:_}),_.transmuxing.executeEnd=P()},b.resetInitialTimestamp=function(v){var g=this.demuxer,_=this.remuxer;if(!g||!_)return;g.resetTimeStamp(v),_.resetTimeStamp(v)},b.resetContiguity=function(){var v=this.demuxer,g=this.remuxer;if(!v||!g)return;v.resetContiguity(),g.resetNextTimestamp()},b.resetInitSegment=function(v,g,_,O){var G=this.demuxer,Y=this.remuxer;if(!G||!Y)return;G.resetInitSegment(g,_,O),Y.resetInitSegment(v,g,_)},b.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},b.transmux=function(v,g,_,O,G){var Y;return g&&g.method==="SAMPLE-AES"?Y=this.transmuxSampleAes(v,g,_,O,G):Y=this.transmuxUnencrypted(v,_,O,G),Y},b.transmuxUnencrypted=function(v,g,_,O){var G=this.demuxer.demux(v,g,!1,!this.config.progressive),Y=G.audioTrack,ee=G.avcTrack,fe=G.id3Track,pe=G.textTrack,xe=this.remuxer.remux(Y,ee,fe,pe,g,_,!1,this.id);return{remuxResult:xe,chunkMeta:O}},b.transmuxSampleAes=function(v,g,_,O,G){var Y=this;return this.demuxer.demuxSampleAes(v,g,_).then(function(ee){var fe=Y.remuxer.remux(ee.audioTrack,ee.avcTrack,ee.id3Track,ee.textTrack,_,O,!1,Y.id);return{remuxResult:fe,chunkMeta:G}})},b.configureTransmuxer=function(v,g){for(var _=this.config,O=this.observer,G=this.typeSupported,Y=this.vendor,ee=g.audioCodec,fe=g.defaultInitPts,pe=g.duration,xe=g.initSegmentData,Ce=g.videoCodec,be,Oe=0,We=w.length;Oe<We;Oe++)if(w[Oe].demux.probe(v)){be=w[Oe];break}be||(j.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),be={demux:q.default,remux:H.default});var Me=this.demuxer,ct=this.remuxer,Ge=be.remux,Je=be.demux;(!ct||!(ct instanceof Ge))&&(this.remuxer=new Ge(O,_,G,Y)),(!Me||!(Me instanceof Je))&&(this.demuxer=new Je(O,_,G),this.probe=Je.probe),this.resetInitSegment(xe,ee,Ce,pe),this.resetInitialTimestamp(fe)},b.needsProbing=function(v,g,_){return!this.demuxer||!this.remuxer||g||_},b.getDecrypter=function(){var v=this.decrypter;return v||(v=this.decrypter=new M.default(this.observer,this.config)),v},C}();function f(C,b){var m=null;return C.byteLength>0&&b!=null&&b.key!=null&&b.iv!==null&&b.method!=null&&(m=b),m}var T=function(b){return{remuxResult:{},chunkMeta:b}};function x(C){return"then"in C&&C.then instanceof Function}var E=function(b,m,v,g,_){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=b,this.videoCodec=m,this.initSegmentData=v,this.duration=g,this.defaultInitPts=_},k=function(b,m,v,g,_){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=b,this.contiguous=m,this.accurateTimeOffset=v,this.trackSwitch=g,this.timeOffset=_}},"./src/demux/tsdemuxer.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"discardEPB",function(){return T});var ae=z("./src/demux/adts.ts"),K=z("./src/demux/mpegaudio.ts"),M=z("./src/demux/exp-golomb.ts"),se=z("./src/demux/id3.ts"),q=z("./src/demux/sample-aes.ts"),X=z("./src/events.ts"),V=z("./src/utils/mp4-tools.ts"),L=z("./src/utils/logger.ts"),H=z("./src/errors.ts"),F={video:1,audio:2,id3:3,text:4},I=function(){function x(k,C,b){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=k,this.config=C,this.typeSupported=b}x.probe=function(C){var b=x.syncOffset(C);return b<0?!1:(b&&L.logger.warn("MPEG2-TS detected but first sync word found @ offset "+b+", junk ahead ?"),!0)},x.syncOffset=function(C){for(var b=Math.min(1e3,C.length-3*188),m=0;m<b;){if(C[m]===71&&C[m+188]===71&&C[m+2*188]===71)return m;m++}return-1},x.createTrack=function(C,b){return{container:C==="video"||C==="audio"?"video/mp2t":void 0,type:C,id:F[C],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:C==="audio"?b:void 0}};var E=x.prototype;return E.resetInitSegment=function(C,b,m){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=x.createTrack("video",m),this._audioTrack=x.createTrack("audio",m),this._id3Track=x.createTrack("id3",m),this._txtTrack=x.createTrack("text",m),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=C,this.videoCodec=b,this._duration=m},E.resetTimeStamp=function(){},E.resetContiguity=function(){var C=this._audioTrack,b=this._avcTrack,m=this._id3Track;C&&(C.pesData=null),b&&(b.pesData=null),m&&(m.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},E.demux=function(C,b,m,v){m===void 0&&(m=!1),v===void 0&&(v=!1),m||(this.sampleAes=null);var g,_=this._avcTrack,O=this._audioTrack,G=this._id3Track,Y=_.pid,ee=_.pesData,fe=O.pid,pe=G.pid,xe=O.pesData,Ce=G.pesData,be=!1,Oe=this.pmtParsed,We=this._pmtId,Me=C.length;if(this.remainderData&&(C=Object(V.appendUint8Array)(this.remainderData,C),Me=C.length,this.remainderData=null),Me<188&&!v)return this.remainderData=C,{audioTrack:O,avcTrack:_,id3Track:G,textTrack:this._txtTrack};var ct=Math.max(0,x.syncOffset(C));Me-=(Me+ct)%188,Me<C.byteLength&&!v&&(this.remainderData=new Uint8Array(C.buffer,Me,C.buffer.byteLength-Me));for(var Ge=ct;Ge<Me;Ge+=188)if(C[Ge]===71){var Je=!!(C[Ge+1]&64),Xe=((C[Ge+1]&31)<<8)+C[Ge+2],Ye=(C[Ge+3]&48)>>4,ke=void 0;if(Ye>1){if(ke=Ge+5+C[Ge+4],ke===Ge+188)continue}else ke=Ge+4;switch(Xe){case Y:Je&&(ee&&(g=d(ee))&&this.parseAVCPES(g,!1),ee={data:[],size:0}),ee&&(ee.data.push(C.subarray(ke,Ge+188)),ee.size+=Ge+188-ke);break;case fe:Je&&(xe&&(g=d(xe))&&(O.isAAC?this.parseAACPES(g):this.parseMPEGPES(g)),xe={data:[],size:0}),xe&&(xe.data.push(C.subarray(ke,Ge+188)),xe.size+=Ge+188-ke);break;case pe:Je&&(Ce&&(g=d(Ce))&&this.parseID3PES(g),Ce={data:[],size:0}),Ce&&(Ce.data.push(C.subarray(ke,Ge+188)),Ce.size+=Ge+188-ke);break;case 0:Je&&(ke+=C[ke]+1),We=this._pmtId=P(C,ke);break;case We:{Je&&(ke+=C[ke]+1);var Z=w(C,ke,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,m);Y=Z.avc,Y>0&&(_.pid=Y),fe=Z.audio,fe>0&&(O.pid=fe,O.isAAC=Z.isAAC),pe=Z.id3,pe>0&&(G.pid=pe),be&&!Oe&&(L.logger.log("reparse from beginning"),be=!1,Ge=ct-188),Oe=this.pmtParsed=!0;break}case 17:case 8191:break;default:be=!0;break}}else this.observer.emit(X.Events.ERROR,X.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});_.pesData=ee,O.pesData=xe,G.pesData=Ce;var A={audioTrack:O,avcTrack:_,id3Track:G,textTrack:this._txtTrack};return v&&this.extractRemainingSamples(A),A},E.flush=function(){var C=this.remainderData;this.remainderData=null;var b;return C?b=this.demux(C,-1,!1,!0):b={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(b),this.sampleAes?this.decrypt(b,this.sampleAes):b},E.extractRemainingSamples=function(C){var b=C.audioTrack,m=C.avcTrack,v=C.id3Track,g=m.pesData,_=b.pesData,O=v.pesData,G;g&&(G=d(g))?(this.parseAVCPES(G,!0),m.pesData=null):m.pesData=g,_&&(G=d(_))?(b.isAAC?this.parseAACPES(G):this.parseMPEGPES(G),b.pesData=null):(_!=null&&_.size&&L.logger.log("last AAC PES packet truncated,might overlap between fragments"),b.pesData=_),O&&(G=d(O))?(this.parseID3PES(G),v.pesData=null):v.pesData=O},E.demuxSampleAes=function(C,b,m){var v=this.demux(C,m,!0,!this.config.progressive),g=this.sampleAes=new q.default(this.observer,this.config,b);return this.decrypt(v,g)},E.decrypt=function(C,b){return new Promise(function(m){var v=C.audioTrack,g=C.avcTrack;v.samples&&v.isAAC?b.decryptAacSamples(v.samples,0,function(){g.samples?b.decryptAvcSamples(g.samples,0,0,function(){m(C)}):m(C)}):g.samples&&b.decryptAvcSamples(g.samples,0,0,function(){m(C)})})},E.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},E.parseAVCPES=function(C,b){var m=this,v=this._avcTrack,g=this.parseAVCNALu(C.data),_=!1,O=this.avcSample,G,Y=!1;C.data=null,O&&g.length&&!v.audFound&&(p(O,v),O=this.avcSample=j(!1,C.pts,C.dts,"")),g.forEach(function(ee){switch(ee.type){case 1:{G=!0,O||(O=m.avcSample=j(!0,C.pts,C.dts,"")),_&&(O.debug+="NDR "),O.frame=!0;var fe=ee.data;if(Y&&fe.length>4){var pe=new M.default(fe).readSliceType();(pe===2||pe===4||pe===7||pe===9)&&(O.key=!0)}break}case 5:G=!0,O||(O=m.avcSample=j(!0,C.pts,C.dts,"")),_&&(O.debug+="IDR "),O.key=!0,O.frame=!0;break;case 6:{G=!0,_&&O&&(O.debug+="SEI ");var xe=new M.default(T(ee.data));xe.readUByte();for(var Ce=0,be=0,Oe=!1,We=0;!Oe&&xe.bytesAvailable>1;){Ce=0;do We=xe.readUByte(),Ce+=We;while(We===255);be=0;do We=xe.readUByte(),be+=We;while(We===255);if(Ce===4&&xe.bytesAvailable!==0){Oe=!0;var Me=xe.readUByte();if(Me===181){var ct=xe.readUShort();if(ct===49){var Ge=xe.readUInt();if(Ge===1195456820){var Je=xe.readUByte();if(Je===3){for(var Xe=xe.readUByte(),Ye=xe.readUByte(),ke=31&Xe,Z=[Xe,Ye],A=0;A<ke;A++)Z.push(xe.readUByte()),Z.push(xe.readUByte()),Z.push(xe.readUByte());f(m._txtTrack.samples,{type:3,pts:C.pts,bytes:Z})}}}}}else if(Ce===5&&xe.bytesAvailable!==0){if(Oe=!0,be>16){for(var R=[],J=0;J<16;J++)R.push(xe.readUByte().toString(16)),(J===3||J===5||J===7||J===9)&&R.push("-");for(var oe=be-16,$=new Uint8Array(oe),Se=0;Se<oe;Se++)$[Se]=xe.readUByte();f(m._txtTrack.samples,{pts:C.pts,payloadType:Ce,uuid:R.join(""),userData:Object(se.utf8ArrayToStr)($),userDataBytes:$})}}else if(be<xe.bytesAvailable)for(var je=0;je<be;je++)xe.readUByte()}break}case 7:if(G=!0,Y=!0,_&&O&&(O.debug+="SPS "),!v.sps){var $e=new M.default(ee.data),st=$e.readSPS();v.width=st.width,v.height=st.height,v.pixelRatio=st.pixelRatio,v.sps=[ee.data],v.duration=m._duration;for(var Ke=ee.data.subarray(1,4),it="avc1.",nt=0;nt<3;nt++){var bt=Ke[nt].toString(16);bt.length<2&&(bt="0"+bt),it+=bt}v.codec=it}break;case 8:G=!0,_&&O&&(O.debug+="PPS "),v.pps||(v.pps=[ee.data]);break;case 9:G=!1,v.audFound=!0,O&&p(O,v),O=m.avcSample=j(!1,C.pts,C.dts,_?"AUD ":"");break;case 12:G=!1;break;default:G=!1,O&&(O.debug+="unknown NAL "+ee.type+" ");break}if(O&&G){var _t=O.units;_t.push(ee)}}),b&&O&&(p(O,v),this.avcSample=null)},E.getLastNalUnit=function(){var C,b=this.avcSample,m;if(!b||b.units.length===0){var v=this._avcTrack.samples;b=v[v.length-1]}if((C=b)!==null&&C!==void 0&&C.units){var g=b.units;m=g[g.length-1]}return m},E.parseAVCNALu=function(C){var b=C.byteLength,m=this._avcTrack,v=m.naluState||0,g=v,_=[],O=0,G,Y,ee,fe=-1,pe=0;for(v===-1&&(fe=0,pe=C[0]&31,v=0,O=1);O<b;){if(G=C[O++],!v){v=G?0:1;continue}if(v===1){v=G?0:2;continue}if(!G)v=3;else if(G===1){if(fe>=0){var xe={data:C.subarray(fe,O-v-1),type:pe};_.push(xe)}else{var Ce=this.getLastNalUnit();if(Ce&&(g&&O<=4-g&&(Ce.state&&(Ce.data=Ce.data.subarray(0,Ce.data.byteLength-g))),Y=O-v-1,Y>0)){var be=new Uint8Array(Ce.data.byteLength+Y);be.set(Ce.data,0),be.set(C.subarray(0,Y),Ce.data.byteLength),Ce.data=be,Ce.state=0}}O<b?(ee=C[O]&31,fe=O,pe=ee,v=0):v=-1}else v=0}if(fe>=0&&v>=0){var Oe={data:C.subarray(fe,b),type:pe,state:v};_.push(Oe)}if(_.length===0){var We=this.getLastNalUnit();if(We){var Me=new Uint8Array(We.data.byteLength+C.byteLength);Me.set(We.data,0),Me.set(C,We.data.byteLength),We.data=Me}}return m.naluState=v,_},E.parseAACPES=function(C){var b=0,m=this._audioTrack,v=this.aacOverFlow,g=C.data;if(v){this.aacOverFlow=null;var _=v.sample.unit.byteLength,O=Math.min(v.missing,_),G=_-O;v.sample.unit.set(g.subarray(0,O),G),m.samples.push(v.sample),b=v.missing}var Y,ee;for(Y=b,ee=g.length;Y<ee-1&&!ae.isHeader(g,Y);Y++);if(Y!==b){var fe,pe;if(Y<ee-1?(fe="AAC PES did not start with ADTS header,offset:"+Y,pe=!1):(fe="no ADTS header found in AAC PES",pe=!0),L.logger.warn("parsing error:"+fe),this.observer.emit(X.Events.ERROR,X.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.FRAG_PARSING_ERROR,fatal:pe,reason:fe}),pe)return}ae.initTrackConfig(m,this.observer,g,Y,this.audioCodec);var xe;if(C.pts!==void 0)xe=C.pts;else if(v){var Ce=ae.getFrameDuration(m.samplerate);xe=v.sample.pts+Ce}else{L.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var be=0;Y<ee;)if(ae.isHeader(g,Y)){if(Y+5<ee){var Oe=ae.appendFrame(m,g,Y,xe,be);if(Oe)if(Oe.missing)this.aacOverFlow=Oe;else{Y+=Oe.length,be++;continue}}break}else Y++},E.parseMPEGPES=function(C){var b=C.data,m=b.length,v=0,g=0,_=C.pts;if(_===void 0){L.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;g<m;)if(K.isHeader(b,g)){var O=K.appendFrame(this._audioTrack,b,g,_,v);if(O)g+=O.length,v++;else break}else g++},E.parseID3PES=function(C){if(C.pts===void 0){L.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(C)},x}();I.minProbeByteLength=188;function j(x,E,k,C){return{key:x,frame:!1,pts:E,dts:k,units:[],debug:C,length:0}}function P(x,E){return(x[E+10]&31)<<8|x[E+11]}function w(x,E,k,C){var b={audio:-1,avc:-1,id3:-1,isAAC:!0},m=(x[E+1]&15)<<8|x[E+2],v=E+3+m-4,g=(x[E+10]&15)<<8|x[E+11];for(E+=12+g;E<v;){var _=(x[E+1]&31)<<8|x[E+2];switch(x[E]){case 207:if(!C){L.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:b.audio===-1&&(b.audio=_);break;case 21:b.id3===-1&&(b.id3=_);break;case 219:if(!C){L.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:b.avc===-1&&(b.avc=_);break;case 3:case 4:k?b.audio===-1&&(b.audio=_,b.isAAC=!1):L.logger.log("MPEG audio found, not supported in this browser");break;case 36:L.logger.warn("Unsupported HEVC stream type found");break;default:break}E+=((x[E+3]&15)<<8|x[E+4])+5}return b}function d(x){var E=0,k,C,b,m,v,g=x.data;if(!x||x.size===0)return null;for(;g[0].length<19&&g.length>1;){var _=new Uint8Array(g[0].length+g[1].length);_.set(g[0]),_.set(g[1],g[0].length),g[0]=_,g.splice(1,1)}k=g[0];var O=(k[0]<<16)+(k[1]<<8)+k[2];if(O===1){if(C=(k[4]<<8)+k[5],C&&C>x.size-6)return null;var G=k[7];G&192&&(m=(k[9]&14)*536870912+(k[10]&255)*4194304+(k[11]&254)*16384+(k[12]&255)*128+(k[13]&254)/2,G&64?(v=(k[14]&14)*536870912+(k[15]&255)*4194304+(k[16]&254)*16384+(k[17]&255)*128+(k[18]&254)/2,m-v>60*9e4&&(L.logger.warn(Math.round((m-v)/9e4)+"s delta between PTS and DTS, align them"),m=v)):v=m),b=k[8];var Y=b+9;if(x.size<=Y)return null;x.size-=Y;for(var ee=new Uint8Array(x.size),fe=0,pe=g.length;fe<pe;fe++){k=g[fe];var xe=k.byteLength;if(Y)if(Y>xe){Y-=xe;continue}else k=k.subarray(Y),xe-=Y,Y=0;ee.set(k,E),E+=xe}return C&&(C-=b+3),{data:ee,pts:m,dts:v,len:C}}return null}function p(x,E){if(x.units.length&&x.frame){if(x.pts===void 0){var k=E.samples,C=k.length;if(C){var b=k[C-1];x.pts=b.pts,x.dts=b.dts}else{E.dropped++;return}}E.samples.push(x)}x.debug.length&&L.logger.log(x.pts+"/"+x.dts+":"+x.debug)}function f(x,E){var k=x.length;if(k>0){if(E.pts>=x[k-1].pts)x.push(E);else for(var C=k-1;C>=0;C--)if(E.pts<x[C].pts){x.splice(C,0,E);break}}else x.push(E)}function T(x){for(var E=x.byteLength,k=[],C=1;C<E-2;)x[C]===0&&x[C+1]===0&&x[C+2]===3?(k.push(C+2),C+=2):C++;if(k.length===0)return x;var b=E-k.length,m=new Uint8Array(b),v=0;for(C=0;C<b;v++,C++)v===k[0]&&(v++,k.shift()),m[C]=x[v];return m}re.default=I},"./src/errors.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"ErrorTypes",function(){return ae}),z.d(re,"ErrorDetails",function(){return K});var ae;(function(M){M.NETWORK_ERROR="networkError",M.MEDIA_ERROR="mediaError",M.KEY_SYSTEM_ERROR="keySystemError",M.MUX_ERROR="muxError",M.OTHER_ERROR="otherError"})(ae||(ae={}));var K;(function(M){M.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",M.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",M.KEY_SYSTEM_NO_SESSION="keySystemNoSession",M.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",M.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",M.MANIFEST_LOAD_ERROR="manifestLoadError",M.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",M.MANIFEST_PARSING_ERROR="manifestParsingError",M.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",M.LEVEL_EMPTY_ERROR="levelEmptyError",M.LEVEL_LOAD_ERROR="levelLoadError",M.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",M.LEVEL_SWITCH_ERROR="levelSwitchError",M.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",M.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",M.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",M.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",M.FRAG_LOAD_ERROR="fragLoadError",M.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",M.FRAG_DECRYPT_ERROR="fragDecryptError",M.FRAG_PARSING_ERROR="fragParsingError",M.REMUX_ALLOC_ERROR="remuxAllocError",M.KEY_LOAD_ERROR="keyLoadError",M.KEY_LOAD_TIMEOUT="keyLoadTimeOut",M.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",M.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",M.BUFFER_APPEND_ERROR="bufferAppendError",M.BUFFER_APPENDING_ERROR="bufferAppendingError",M.BUFFER_STALLED_ERROR="bufferStalledError",M.BUFFER_FULL_ERROR="bufferFullError",M.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",M.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",M.INTERNAL_EXCEPTION="internalException",M.INTERNAL_ABORTED="aborted",M.UNKNOWN="unknown"})(K||(K={}))},"./src/events.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"Events",function(){return ae});var ae;(function(K){K.MEDIA_ATTACHING="hlsMediaAttaching",K.MEDIA_ATTACHED="hlsMediaAttached",K.MEDIA_DETACHING="hlsMediaDetaching",K.MEDIA_DETACHED="hlsMediaDetached",K.BUFFER_RESET="hlsBufferReset",K.BUFFER_CODECS="hlsBufferCodecs",K.BUFFER_CREATED="hlsBufferCreated",K.BUFFER_APPENDING="hlsBufferAppending",K.BUFFER_APPENDED="hlsBufferAppended",K.BUFFER_EOS="hlsBufferEos",K.BUFFER_FLUSHING="hlsBufferFlushing",K.BUFFER_FLUSHED="hlsBufferFlushed",K.MANIFEST_LOADING="hlsManifestLoading",K.MANIFEST_LOADED="hlsManifestLoaded",K.MANIFEST_PARSED="hlsManifestParsed",K.LEVEL_SWITCHING="hlsLevelSwitching",K.LEVEL_SWITCHED="hlsLevelSwitched",K.LEVEL_LOADING="hlsLevelLoading",K.LEVEL_LOADED="hlsLevelLoaded",K.LEVEL_UPDATED="hlsLevelUpdated",K.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",K.LEVELS_UPDATED="hlsLevelsUpdated",K.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",K.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",K.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",K.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",K.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",K.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",K.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",K.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",K.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",K.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",K.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",K.CUES_PARSED="hlsCuesParsed",K.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",K.INIT_PTS_FOUND="hlsInitPtsFound",K.FRAG_LOADING="hlsFragLoading",K.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",K.FRAG_LOADED="hlsFragLoaded",K.FRAG_DECRYPTED="hlsFragDecrypted",K.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",K.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",K.FRAG_PARSING_METADATA="hlsFragParsingMetadata",K.FRAG_PARSED="hlsFragParsed",K.FRAG_BUFFERED="hlsFragBuffered",K.FRAG_CHANGED="hlsFragChanged",K.FPS_DROP="hlsFpsDrop",K.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",K.ERROR="hlsError",K.DESTROYING="hlsDestroying",K.KEY_LOADING="hlsKeyLoading",K.KEY_LOADED="hlsKeyLoaded",K.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",K.BACK_BUFFER_REACHED="hlsBackBufferReached"})(ae||(ae={}))},"./src/hls.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return x});var ae=z("./node_modules/url-toolkit/src/url-toolkit.js"),K=z.n(ae),M=z("./src/loader/playlist-loader.ts"),se=z("./src/loader/key-loader.ts"),q=z("./src/controller/id3-track-controller.ts"),X=z("./src/controller/latency-controller.ts"),V=z("./src/controller/level-controller.ts"),L=z("./src/controller/fragment-tracker.ts"),H=z("./src/controller/stream-controller.ts"),F=z("./src/is-supported.ts"),I=z("./src/utils/logger.ts"),j=z("./src/config.ts"),P=z("./node_modules/eventemitter3/index.js"),w=z.n(P),d=z("./src/events.ts"),p=z("./src/errors.ts");function f(E,k){for(var C=0;C<k.length;C++){var b=k[C];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(E,b.key,b)}}function T(E,k,C){return k&&f(E.prototype,k),C&&f(E,C),E}var x=function(){E.isSupported=function(){return Object(F.isSupported)()};function E(C){C===void 0&&(C={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new P.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var b=this.config=Object(j.mergeConfig)(E.DefaultConfig,C);this.userConfig=C,Object(I.enableLogs)(b.debug),this._autoLevelCapping=-1,b.progressive&&Object(j.enableStreamingMode)(b);var m=b.abrController,v=b.bufferController,g=b.capLevelController,_=b.fpsController,O=this.abrController=new m(this),G=this.bufferController=new v(this),Y=this.capLevelController=new g(this),ee=new _(this),fe=new M.default(this),pe=new se.default(this),xe=new q.default(this),Ce=this.levelController=new V.default(this),be=new L.FragmentTracker(this),Oe=this.streamController=new H.default(this,be);Y.setStreamController(Oe),ee.setStreamController(Oe);var We=[Ce,Oe];this.networkControllers=We;var Me=[fe,pe,O,G,Y,ee,xe,be];this.audioTrackController=this.createController(b.audioTrackController,null,We),this.createController(b.audioStreamController,be,We),this.subtitleTrackController=this.createController(b.subtitleTrackController,null,We),this.createController(b.subtitleStreamController,be,We),this.createController(b.timelineController,null,Me),this.emeController=this.createController(b.emeController,null,Me),this.cmcdController=this.createController(b.cmcdController,null,Me),this.latencyController=this.createController(X.default,null,Me),this.coreComponents=Me}var k=E.prototype;return k.createController=function(b,m,v){if(b){var g=m?new b(this,m):new b(this);return v&&v.push(g),g}return null},k.on=function(b,m,v){v===void 0&&(v=this),this._emitter.on(b,m,v)},k.once=function(b,m,v){v===void 0&&(v=this),this._emitter.once(b,m,v)},k.removeAllListeners=function(b){this._emitter.removeAllListeners(b)},k.off=function(b,m,v,g){v===void 0&&(v=this),this._emitter.off(b,m,v,g)},k.listeners=function(b){return this._emitter.listeners(b)},k.emit=function(b,m,v){return this._emitter.emit(b,m,v)},k.trigger=function(b,m){if(this.config.debug)return this.emit(b,b,m);try{return this.emit(b,b,m)}catch(v){I.logger.error("An internal error happened while handling event "+b+'. Error message: "'+v.message+'". Here is a stacktrace:',v),this.trigger(d.Events.ERROR,{type:p.ErrorTypes.OTHER_ERROR,details:p.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:b,error:v})}return!1},k.listenerCount=function(b){return this._emitter.listenerCount(b)},k.destroy=function(){I.logger.log("destroy"),this.trigger(d.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(b){return b.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(b){return b.destroy()}),this.coreComponents.length=0},k.attachMedia=function(b){I.logger.log("attachMedia"),this._media=b,this.trigger(d.Events.MEDIA_ATTACHING,{media:b})},k.detachMedia=function(){I.logger.log("detachMedia"),this.trigger(d.Events.MEDIA_DETACHING,void 0),this._media=null},k.loadSource=function(b){this.stopLoad();var m=this.media,v=this.url,g=this.url=ae.buildAbsoluteURL(self.location.href,b,{alwaysNormalize:!0});I.logger.log("loadSource:"+g),m&&v&&v!==g&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(m)),this.trigger(d.Events.MANIFEST_LOADING,{url:b})},k.startLoad=function(b){b===void 0&&(b=-1),I.logger.log("startLoad("+b+")"),this.networkControllers.forEach(function(m){m.startLoad(b)})},k.stopLoad=function(){I.logger.log("stopLoad"),this.networkControllers.forEach(function(b){b.stopLoad()})},k.swapAudioCodec=function(){I.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},k.recoverMediaError=function(){I.logger.log("recoverMediaError");var b=this._media;this.detachMedia(),b&&this.attachMedia(b)},k.removeLevel=function(b,m){m===void 0&&(m=0),this.levelController.removeLevel(b,m)},T(E,[{key:"levels",get:function(){var b=this.levelController.levels;return b||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(b){I.logger.log("set currentLevel:"+b),this.loadLevel=b,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(b){I.logger.log("set nextLevel:"+b),this.levelController.manualLevel=b,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(b){I.logger.log("set loadLevel:"+b),this.levelController.manualLevel=b}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(b){this.levelController.nextLoadLevel=b}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(b){I.logger.log("set firstLevel:"+b),this.levelController.firstLevel=b}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(b){I.logger.log("set startLevel:"+b),b!==-1&&(b=Math.max(b,this.minAutoLevel)),this.levelController.startLevel=b}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(b){var m=!!b;m!==this.config.capLevelToPlayerSize&&(m?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=m)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(b){this._autoLevelCapping!==b&&(I.logger.log("set autoLevelCapping:"+b),this._autoLevelCapping=b)}},{key:"bandwidthEstimate",get:function(){var b=this.abrController.bwEstimator;return b?b.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var b=this.levels,m=this.config.minAutoBitrate;if(!b)return 0;for(var v=b.length,g=0;g<v;g++)if(b[g].maxBitrate>m)return g;return 0}},{key:"maxAutoLevel",get:function(){var b=this.levels,m=this.autoLevelCapping,v;return m===-1&&b&&b.length?v=b.length-1:v=m,v}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(b){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,b)}},{key:"audioTracks",get:function(){var b=this.audioTrackController;return b?b.audioTracks:[]}},{key:"audioTrack",get:function(){var b=this.audioTrackController;return b?b.audioTrack:-1},set:function(b){var m=this.audioTrackController;m&&(m.audioTrack=b)}},{key:"subtitleTracks",get:function(){var b=this.subtitleTrackController;return b?b.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var b=this.subtitleTrackController;return b?b.subtitleTrack:-1},set:function(b){var m=this.subtitleTrackController;m&&(m.subtitleTrack=b)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var b=this.subtitleTrackController;return b?b.subtitleDisplay:!1},set:function(b){var m=this.subtitleTrackController;m&&(m.subtitleDisplay=b)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(b){this.config.lowLatencyMode=b}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return d.Events}},{key:"ErrorTypes",get:function(){return p.ErrorTypes}},{key:"ErrorDetails",get:function(){return p.ErrorDetails}},{key:"DefaultConfig",get:function(){return E.defaultConfig?E.defaultConfig:j.hlsDefaultConfig},set:function(b){E.defaultConfig=b}}]),E}();x.defaultConfig=void 0},"./src/is-supported.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"isSupported",function(){return M}),z.d(re,"changeTypeSupported",function(){return se});var ae=z("./src/utils/mediasource-helper.ts");function K(){return self.SourceBuffer||self.WebKitSourceBuffer}function M(){var q=Object(ae.getMediaSource)();if(!q)return!1;var X=K(),V=q&&typeof q.isTypeSupported=="function"&&q.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),L=!X||X.prototype&&typeof X.prototype.appendBuffer=="function"&&typeof X.prototype.remove=="function";return!!V&&!!L}function se(){var q,X=K();return typeof(X==null||((q=X.prototype)===null||q===void 0)?void 0:q.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return I}),z.d(re,"LoadError",function(){return P});var ae=z("./src/polyfills/number.ts"),K=z("./src/errors.ts");function M(w,d){w.prototype=Object.create(d.prototype),w.prototype.constructor=w,L(w,d)}function se(w){var d=typeof Map=="function"?new Map:void 0;return se=function(f){if(f===null||!V(f))return f;if(typeof f!="function")throw new TypeError("Super expression must either be null or a function");if(typeof d!="undefined"){if(d.has(f))return d.get(f);d.set(f,T)}function T(){return q(f,arguments,H(this).constructor)}return T.prototype=Object.create(f.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),L(T,f)},se(w)}function q(w,d,p){return X()?q=Reflect.construct:q=function(T,x,E){var k=[null];k.push.apply(k,x);var C=Function.bind.apply(T,k),b=new C;return E&&L(b,E.prototype),b},q.apply(null,arguments)}function X(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(w){return!1}}function V(w){return Function.toString.call(w).indexOf("[native code]")!==-1}function L(w,d){return L=Object.setPrototypeOf||function(f,T){return f.__proto__=T,f},L(w,d)}function H(w){return H=Object.setPrototypeOf?Object.getPrototypeOf:function(p){return p.__proto__||Object.getPrototypeOf(p)},H(w)}var F=Math.pow(2,17),I=function(){function w(p){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=p}var d=w.prototype;return d.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},d.abort=function(){this.loader&&this.loader.abort()},d.load=function(f,T){var x=this,E=f.url;if(!E)return Promise.reject(new P({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:f,networkDetails:null},"Fragment does not have a "+(E?"part list":"url")));this.abort();var k=this.config,C=k.fLoader,b=k.loader;return new Promise(function(m,v){x.loader&&x.loader.destroy();var g=x.loader=f.loader=C?new C(k):new b(k),_=j(f),O={timeout:k.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:k.fragLoadingMaxRetryTimeout,highWaterMark:F};f.stats=g.stats,g.load(_,O,{onSuccess:function(Y,ee,fe,pe){x.resetLoader(f,g),m({frag:f,part:null,payload:Y.data,networkDetails:pe})},onError:function(Y,ee,fe){x.resetLoader(f,g),v(new P({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:f,response:Y,networkDetails:fe}))},onAbort:function(Y,ee,fe){x.resetLoader(f,g),v(new P({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:f,networkDetails:fe}))},onTimeout:function(Y,ee,fe){x.resetLoader(f,g),v(new P({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:f,networkDetails:fe}))},onProgress:function(Y,ee,fe,pe){T&&T({frag:f,part:null,payload:fe,networkDetails:pe})}})})},d.loadPart=function(f,T,x){var E=this;this.abort();var k=this.config,C=k.fLoader,b=k.loader;return new Promise(function(m,v){E.loader&&E.loader.destroy();var g=E.loader=f.loader=C?new C(k):new b(k),_=j(f,T),O={timeout:k.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:k.fragLoadingMaxRetryTimeout,highWaterMark:F};T.stats=g.stats,g.load(_,O,{onSuccess:function(Y,ee,fe,pe){E.resetLoader(f,g),E.updateStatsFromPart(f,T);var xe={frag:f,part:T,payload:Y.data,networkDetails:pe};x(xe),m(xe)},onError:function(Y,ee,fe){E.resetLoader(f,g),v(new P({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:f,part:T,response:Y,networkDetails:fe}))},onAbort:function(Y,ee,fe){f.stats.aborted=T.stats.aborted,E.resetLoader(f,g),v(new P({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:f,part:T,networkDetails:fe}))},onTimeout:function(Y,ee,fe){E.resetLoader(f,g),v(new P({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:f,part:T,networkDetails:fe}))}})})},d.updateStatsFromPart=function(f,T){var x=f.stats,E=T.stats,k=E.total;if(x.loaded+=E.loaded,k){var C=Math.round(f.duration/T.duration),b=Math.min(Math.round(x.loaded/k),C),m=C-b,v=m*Math.round(x.loaded/b);x.total=x.loaded+v}else x.total=Math.max(x.loaded,x.total);var g=x.loading,_=E.loading;g.start?g.first+=_.first-_.start:(g.start=_.start,g.first=_.first),g.end=_.end},d.resetLoader=function(f,T){f.loader=null,this.loader===T&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),T.destroy()},w}();function j(w,d){d===void 0&&(d=null);var p=d||w,f={frag:w,part:d,responseType:"arraybuffer",url:p.url,headers:{},rangeStart:0,rangeEnd:0},T=p.byteRangeStartOffset,x=p.byteRangeEndOffset;return Object(ae.isFiniteNumber)(T)&&Object(ae.isFiniteNumber)(x)&&(f.rangeStart=T,f.rangeEnd=x),f}var P=function(w){M(d,w);function d(p){for(var f,T=arguments.length,x=new Array(T>1?T-1:0),E=1;E<T;E++)x[E-1]=arguments[E];return f=w.call.apply(w,[this].concat(x))||this,f.data=void 0,f.data=p,f}return d}(se(Error))},"./src/loader/fragment.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"ElementaryStreamTypes",function(){return I}),z.d(re,"BaseSegment",function(){return j}),z.d(re,"Fragment",function(){return P}),z.d(re,"Part",function(){return w});var ae=z("./src/polyfills/number.ts"),K=z("./node_modules/url-toolkit/src/url-toolkit.js"),M=z.n(K),se=z("./src/utils/logger.ts"),q=z("./src/loader/level-key.ts"),X=z("./src/loader/load-stats.ts");function V(d,p){d.prototype=Object.create(p.prototype),d.prototype.constructor=d,L(d,p)}function L(d,p){return L=Object.setPrototypeOf||function(T,x){return T.__proto__=x,T},L(d,p)}function H(d,p){for(var f=0;f<p.length;f++){var T=p[f];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(d,T.key,T)}}function F(d,p,f){return p&&H(d.prototype,p),f&&H(d,f),d}var I;(function(d){d.AUDIO="audio",d.VIDEO="video",d.AUDIOVIDEO="audiovideo"})(I||(I={}));var j=function(){function d(f){var T;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(T={},T[I.AUDIO]=null,T[I.VIDEO]=null,T[I.AUDIOVIDEO]=null,T),this.baseurl=f}var p=d.prototype;return p.setByteRange=function(T,x){var E=T.split("@",2),k=[];E.length===1?k[0]=x?x.byteRangeEndOffset:0:k[0]=parseInt(E[1]),k[1]=parseInt(E[0])+k[0],this._byteRange=k},F(d,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(K.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(T){this._url=T}}]),d}(),P=function(d){V(p,d);function p(T,x){var E;return E=d.call(this,x)||this,E._decryptdata=null,E.rawProgramDateTime=null,E.programDateTime=null,E.tagList=[],E.duration=0,E.sn=0,E.levelkey=void 0,E.type=void 0,E.loader=null,E.level=-1,E.cc=0,E.startPTS=void 0,E.endPTS=void 0,E.appendedPTS=void 0,E.startDTS=void 0,E.endDTS=void 0,E.start=0,E.deltaPTS=void 0,E.maxStartPTS=void 0,E.minEndPTS=void 0,E.stats=new X.LoadStats,E.urlId=0,E.data=void 0,E.bitrateTest=!1,E.title=null,E.initSegment=null,E.type=T,E}var f=p.prototype;return f.createInitializationVector=function(x){for(var E=new Uint8Array(16),k=12;k<16;k++)E[k]=x>>8*(15-k)&255;return E},f.setDecryptDataFromLevelKey=function(x,E){var k=x;return(x==null?void 0:x.method)==="AES-128"&&x.uri&&!x.iv&&(k=q.LevelKey.fromURI(x.uri),k.method=x.method,k.iv=this.createInitializationVector(E),k.keyFormat="identity"),k},f.setElementaryStreamInfo=function(x,E,k,C,b,m){m===void 0&&(m=!1);var v=this.elementaryStreams,g=v[x];if(!g){v[x]={startPTS:E,endPTS:k,startDTS:C,endDTS:b,partial:m};return}g.startPTS=Math.min(g.startPTS,E),g.endPTS=Math.max(g.endPTS,k),g.startDTS=Math.min(g.startDTS,C),g.endDTS=Math.max(g.endDTS,b)},f.clearElementaryStreamInfo=function(){var x=this.elementaryStreams;x[I.AUDIO]=null,x[I.VIDEO]=null,x[I.AUDIOVIDEO]=null},F(p,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var x=this.sn;typeof x!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&se.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),x=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,x)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(ae.isFiniteNumber)(this.programDateTime))return null;var x=Object(ae.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+x*1e3}},{key:"encrypted",get:function(){var x;return!!((x=this.decryptdata)!==null&&x!==void 0&&x.keyFormat&&this.decryptdata.uri)}}]),p}(j),w=function(d){V(p,d);function p(f,T,x,E,k){var C;C=d.call(this,x)||this,C.fragOffset=0,C.duration=0,C.gap=!1,C.independent=!1,C.relurl=void 0,C.fragment=void 0,C.index=void 0,C.stats=new X.LoadStats,C.duration=f.decimalFloatingPoint("DURATION"),C.gap=f.bool("GAP"),C.independent=f.bool("INDEPENDENT"),C.relurl=f.enumeratedString("URI"),C.fragment=T,C.index=E;var b=f.enumeratedString("BYTERANGE");return b&&C.setByteRange(b,k),k&&(C.fragOffset=k.fragOffset+k.duration),C}return F(p,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var T=this.elementaryStreams;return!!(T.audio||T.video||T.audiovideo)}}]),p}(j)},"./src/loader/key-loader.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return se});var ae=z("./src/events.ts"),K=z("./src/errors.ts"),M=z("./src/utils/logger.ts"),se=function(){function q(V){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=V,this._registerListeners()}var X=q.prototype;return X._registerListeners=function(){this.hls.on(ae.Events.KEY_LOADING,this.onKeyLoading,this)},X._unregisterListeners=function(){this.hls.off(ae.Events.KEY_LOADING,this.onKeyLoading)},X.destroy=function(){this._unregisterListeners();for(var L in this.loaders){var H=this.loaders[L];H&&H.destroy()}this.loaders={}},X.onKeyLoading=function(L,H){var F=H.frag,I=F.type,j=this.loaders[I];if(!F.decryptdata){M.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var P=F.decryptdata.uri;if(P!==this.decrypturl||this.decryptkey===null){var w=this.hls.config;if(j&&(M.logger.warn("abort previous key loader for type:"+I),j.abort()),!P){M.logger.warn("key uri is falsy");return}var d=w.loader,p=F.loader=this.loaders[I]=new d(w);this.decrypturl=P,this.decryptkey=null;var f={url:P,frag:F,responseType:"arraybuffer"},T={timeout:w.fragLoadingTimeOut,maxRetry:0,retryDelay:w.fragLoadingRetryDelay,maxRetryDelay:w.fragLoadingMaxRetryTimeout,highWaterMark:0},x={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};p.load(f,T,x)}else this.decryptkey&&(F.decryptdata.key=this.decryptkey,this.hls.trigger(ae.Events.KEY_LOADED,{frag:F}))},X.loadsuccess=function(L,H,F){var I=F.frag;if(!I.decryptdata){M.logger.error("after key load, decryptdata unset");return}this.decryptkey=I.decryptdata.key=new Uint8Array(L.data),I.loader=null,delete this.loaders[I.type],this.hls.trigger(ae.Events.KEY_LOADED,{frag:I})},X.loaderror=function(L,H){var F=H.frag,I=F.loader;I&&I.abort(),delete this.loaders[F.type],this.hls.trigger(ae.Events.ERROR,{type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:F,response:L})},X.loadtimeout=function(L,H){var F=H.frag,I=F.loader;I&&I.abort(),delete this.loaders[F.type],this.hls.trigger(ae.Events.ERROR,{type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:F})},q}()},"./src/loader/level-details.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"LevelDetails",function(){return q});var ae=z("./src/polyfills/number.ts");function K(X,V){for(var L=0;L<V.length;L++){var H=V[L];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(X,H.key,H)}}function M(X,V,L){return V&&K(X.prototype,V),L&&K(X,L),X}var se=10,q=function(){function X(L){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=L}var V=X.prototype;return V.reloaded=function(H){if(!H){this.advanced=!0,this.updated=!0;return}var F=this.lastPartSn-H.lastPartSn,I=this.lastPartIndex-H.lastPartIndex;this.updated=this.endSN!==H.endSN||!!I||!!F,this.advanced=this.endSN>H.endSN||F>0||F===0&&I>0,this.updated||this.advanced?this.misses=Math.floor(H.misses*.6):this.misses=H.misses+1,this.availabilityDelay=H.availabilityDelay},M(X,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(ae.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||se}},{key:"drift",get:function(){var H=this.driftEndTime-this.driftStartTime;if(H>0){var F=this.driftEnd-this.driftStart;return F*1e3/H}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var H;return(H=this.partList)!==null&&H!==void 0&&H.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var H;return(H=this.fragments)!==null&&H!==void 0&&H.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var H;return(H=this.partList)!==null&&H!==void 0&&H.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var H;return(H=this.partList)!==null&&H!==void 0&&H.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),X}()},"./src/loader/level-key.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"LevelKey",function(){return q});var ae=z("./node_modules/url-toolkit/src/url-toolkit.js"),K=z.n(ae);function M(X,V){for(var L=0;L<V.length;L++){var H=V[L];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(X,H.key,H)}}function se(X,V,L){return V&&M(X.prototype,V),L&&M(X,L),X}var q=function(){X.fromURL=function(L,H){return new X(L,H)},X.fromURI=function(L){return new X(L)};function X(V,L){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,L?this._uri=Object(ae.buildAbsoluteURL)(V,L,{alwaysNormalize:!0}):this._uri=V}return se(X,[{key:"uri",get:function(){return this._uri}}]),X}()},"./src/loader/load-stats.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"LoadStats",function(){return ae});var ae=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return p});var ae=z("./src/polyfills/number.ts"),K=z("./node_modules/url-toolkit/src/url-toolkit.js"),M=z.n(K),se=z("./src/loader/fragment.ts"),q=z("./src/loader/level-details.ts"),X=z("./src/loader/level-key.ts"),V=z("./src/utils/attr-list.ts"),L=z("./src/utils/logger.ts"),H=z("./src/utils/codecs.ts"),F=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,I=/#EXT-X-MEDIA:(.*)/g,j=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),P=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),w=/\.(mp4|m4s|m4v|m4a)$/i;function d(k){var C,b;return w.test((C=(b=K.parseURL(k))===null||b===void 0?void 0:b.path)!=null?C:"")}var p=function(){function k(){}return k.findGroup=function(b,m){for(var v=0;v<b.length;v++){var g=b[v];if(g.id===m)return g}},k.convertAVC1ToAVCOTI=function(b){var m=b.split(".");if(m.length>2){var v=m.shift()+".";return v+=parseInt(m.shift()).toString(16),v+=("000"+parseInt(m.shift()).toString(16)).substr(-4),v}return b},k.resolve=function(b,m){return K.buildAbsoluteURL(m,b,{alwaysNormalize:!0})},k.parseMasterPlaylist=function(b,m){var v=[],g={},_=!1;F.lastIndex=0;for(var O;(O=F.exec(b))!=null;)if(O[1]){var G=new V.AttrList(O[1]),Y={attrs:G,bitrate:G.decimalInteger("AVERAGE-BANDWIDTH")||G.decimalInteger("BANDWIDTH"),name:G.NAME,url:k.resolve(O[2],m)},ee=G.decimalResolution("RESOLUTION");ee&&(Y.width=ee.width,Y.height=ee.height),f((G.CODECS||"").split(/[ ,]+/).filter(function(pe){return pe}),Y),Y.videoCodec&&Y.videoCodec.indexOf("avc1")!==-1&&(Y.videoCodec=k.convertAVC1ToAVCOTI(Y.videoCodec)),v.push(Y)}else if(O[3]){var fe=new V.AttrList(O[3]);fe["DATA-ID"]&&(_=!0,g[fe["DATA-ID"]]=fe)}return{levels:v,sessionData:_?g:null}},k.parseMasterPlaylistMedia=function(b,m,v,g){g===void 0&&(g=[]);var _,O=[],G=0;for(I.lastIndex=0;(_=I.exec(b))!==null;){var Y=new V.AttrList(_[1]);if(Y.TYPE===v){var ee={attrs:Y,bitrate:0,id:G++,groupId:Y["GROUP-ID"],instreamId:Y["INSTREAM-ID"],name:Y.NAME||Y.LANGUAGE||"",type:v,default:Y.bool("DEFAULT"),autoselect:Y.bool("AUTOSELECT"),forced:Y.bool("FORCED"),lang:Y.LANGUAGE,url:Y.URI?k.resolve(Y.URI,m):""};if(g.length){var fe=k.findGroup(g,ee.groupId)||g[0];T(ee,fe,"audioCodec"),T(ee,fe,"textCodec")}O.push(ee)}}return O},k.parseLevelPlaylist=function(b,m,v,g,_){var O=new q.LevelDetails(m),G=O.fragments,Y=null,ee=0,fe=0,pe=0,xe=0,Ce=null,be=new se.Fragment(g,m),Oe,We,Me,ct=-1,Ge=!1;for(j.lastIndex=0,O.m3u8=b;(Oe=j.exec(b))!==null;){Ge&&(Ge=!1,be=new se.Fragment(g,m),be.start=pe,be.sn=ee,be.cc=xe,be.level=v,Y&&(be.initSegment=Y,be.rawProgramDateTime=Y.rawProgramDateTime));var Je=Oe[1];if(Je){be.duration=parseFloat(Je);var Xe=(" "+Oe[2]).slice(1);be.title=Xe||null,be.tagList.push(Xe?["INF",Je,Xe]:["INF",Je])}else if(Oe[3])Object(ae.isFiniteNumber)(be.duration)&&(be.start=pe,Me&&(be.levelkey=Me),be.sn=ee,be.level=v,be.cc=xe,be.urlId=_,G.push(be),be.relurl=(" "+Oe[3]).slice(1),E(be,Ce),Ce=be,pe+=be.duration,ee++,fe=0,Ge=!0);else if(Oe[4]){var Ye=(" "+Oe[4]).slice(1);Ce?be.setByteRange(Ye,Ce):be.setByteRange(Ye)}else if(Oe[5])be.rawProgramDateTime=(" "+Oe[5]).slice(1),be.tagList.push(["PROGRAM-DATE-TIME",be.rawProgramDateTime]),ct===-1&&(ct=G.length);else{if(Oe=Oe[0].match(P),!Oe){L.logger.warn("No matches on slow regex match for level playlist!");continue}for(We=1;We<Oe.length&&!(typeof Oe[We]!="undefined");We++);var ke=(" "+Oe[We]).slice(1),Z=(" "+Oe[We+1]).slice(1),A=Oe[We+2]?(" "+Oe[We+2]).slice(1):"";switch(ke){case"PLAYLIST-TYPE":O.type=Z.toUpperCase();break;case"MEDIA-SEQUENCE":ee=O.startSN=parseInt(Z);break;case"SKIP":{var R=new V.AttrList(Z),J=R.decimalInteger("SKIPPED-SEGMENTS");if(Object(ae.isFiniteNumber)(J)){O.skippedSegments=J;for(var oe=J;oe--;)G.unshift(null);ee+=J}var $=R.enumeratedString("RECENTLY-REMOVED-DATERANGES");$&&(O.recentlyRemovedDateranges=$.split(" "));break}case"TARGETDURATION":O.targetduration=parseFloat(Z);break;case"VERSION":O.version=parseInt(Z);break;case"EXTM3U":break;case"ENDLIST":O.live=!1;break;case"#":(Z||A)&&be.tagList.push(A?[Z,A]:[Z]);break;case"DIS":xe++;case"GAP":be.tagList.push([ke]);break;case"BITRATE":be.tagList.push([ke,Z]);break;case"DISCONTINUITY-SEQ":xe=parseInt(Z);break;case"KEY":{var Se,je=new V.AttrList(Z),$e=je.enumeratedString("METHOD"),st=je.URI,Ke=je.hexadecimalInteger("IV"),it=je.enumeratedString("KEYFORMATVERSIONS"),nt=je.enumeratedString("KEYID"),bt=(Se=je.enumeratedString("KEYFORMAT"))!=null?Se:"identity",_t=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(_t.indexOf(bt)>-1){L.logger.warn("Keyformat "+bt+" is not supported from the manifest");continue}else if(bt!=="identity")continue;$e&&(Me=X.LevelKey.fromURL(m,st),st&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf($e)>=0&&(Me.method=$e,Me.keyFormat=bt,nt&&(Me.keyID=nt),it&&(Me.keyFormatVersions=it),Me.iv=Ke));break}case"START":{var Lt=new V.AttrList(Z),Ot=Lt.decimalFloatingPoint("TIME-OFFSET");Object(ae.isFiniteNumber)(Ot)&&(O.startTimeOffset=Ot);break}case"MAP":{var xt=new V.AttrList(Z);be.relurl=xt.URI,xt.BYTERANGE&&be.setByteRange(xt.BYTERANGE),be.level=v,be.sn="initSegment",Me&&(be.levelkey=Me),be.initSegment=null,Y=be,Ge=!0;break}case"SERVER-CONTROL":{var jt=new V.AttrList(Z);O.canBlockReload=jt.bool("CAN-BLOCK-RELOAD"),O.canSkipUntil=jt.optionalFloat("CAN-SKIP-UNTIL",0),O.canSkipDateRanges=O.canSkipUntil>0&&jt.bool("CAN-SKIP-DATERANGES"),O.partHoldBack=jt.optionalFloat("PART-HOLD-BACK",0),O.holdBack=jt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Nt=new V.AttrList(Z);O.partTarget=Nt.decimalFloatingPoint("PART-TARGET");break}case"PART":{var mt=O.partList;mt||(mt=O.partList=[]);var Ht=fe>0?mt[mt.length-1]:void 0,Vt=fe++,ge=new se.Part(new V.AttrList(Z),be,m,Vt,Ht);mt.push(ge),be.duration+=ge.duration;break}case"PRELOAD-HINT":{var ie=new V.AttrList(Z);O.preloadHint=ie;break}case"RENDITION-REPORT":{var ne=new V.AttrList(Z);O.renditionReports=O.renditionReports||[],O.renditionReports.push(ne);break}default:L.logger.warn("line parsed but not handled: "+Oe);break}}}Ce&&!Ce.relurl?(G.pop(),pe-=Ce.duration,O.partList&&(O.fragmentHint=Ce)):O.partList&&(E(be,Ce),be.cc=xe,O.fragmentHint=be);var ce=G.length,me=G[0],le=G[ce-1];if(pe+=O.skippedSegments*O.targetduration,pe>0&&ce&&le){O.averagetargetduration=pe/ce;var ue=le.sn;O.endSN=ue!=="initSegment"?ue:0,me&&(O.startCC=me.cc,me.initSegment||O.fragments.every(function(ye){return ye.relurl&&d(ye.relurl)})&&(L.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),be=new se.Fragment(g,m),be.relurl=le.relurl,be.level=v,be.sn="initSegment",me.initSegment=be,O.needSidxRanges=!0))}else O.endSN=0,O.startCC=0;return O.fragmentHint&&(pe+=O.fragmentHint.duration),O.totalduration=pe,O.endCC=xe,ct>0&&x(G,ct),O},k}();function f(k,C){["video","audio","text"].forEach(function(b){var m=k.filter(function(g){return Object(H.isCodecType)(g,b)});if(m.length){var v=m.filter(function(g){return g.lastIndexOf("avc1",0)===0||g.lastIndexOf("mp4a",0)===0});C[b+"Codec"]=v.length>0?v[0]:m[0],k=k.filter(function(g){return m.indexOf(g)===-1})}}),C.unknownCodecs=k}function T(k,C,b){var m=C[b];m&&(k[b]=m)}function x(k,C){for(var b=k[C],m=C;m--;){var v=k[m];if(!v)return;v.programDateTime=b.programDateTime-v.duration*1e3,b=v}}function E(k,C){k.rawProgramDateTime?k.programDateTime=Date.parse(k.rawProgramDateTime):C!=null&&C.programDateTime&&(k.programDateTime=C.endProgramDateTime),Object(ae.isFiniteNumber)(k.programDateTime)||(k.programDateTime=null,k.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ze,re,z){"use strict";z.r(re);var ae=z("./src/polyfills/number.ts"),K=z("./src/events.ts"),M=z("./src/errors.ts"),se=z("./src/utils/logger.ts"),q=z("./src/utils/mp4-tools.ts"),X=z("./src/loader/m3u8-parser.ts"),V=z("./src/types/loader.ts"),L=z("./src/utils/attr-list.ts");function H(j){var P=j.type;switch(P){case V.PlaylistContextType.AUDIO_TRACK:return V.PlaylistLevelType.AUDIO;case V.PlaylistContextType.SUBTITLE_TRACK:return V.PlaylistLevelType.SUBTITLE;default:return V.PlaylistLevelType.MAIN}}function F(j,P){var w=j.url;return(w===void 0||w.indexOf("data:")===0)&&(w=P.url),w}var I=function(){function j(w){this.hls=void 0,this.loaders=Object.create(null),this.hls=w,this.registerListeners()}var P=j.prototype;return P.registerListeners=function(){var d=this.hls;d.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),d.on(K.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),d.on(K.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},P.unregisterListeners=function(){var d=this.hls;d.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(K.Events.LEVEL_LOADING,this.onLevelLoading,this),d.off(K.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),d.off(K.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},P.createInternalLoader=function(d){var p=this.hls.config,f=p.pLoader,T=p.loader,x=f||T,E=new x(p);return d.loader=E,this.loaders[d.type]=E,E},P.getInternalLoader=function(d){return this.loaders[d.type]},P.resetInternalLoader=function(d){this.loaders[d]&&delete this.loaders[d]},P.destroyInternalLoaders=function(){for(var d in this.loaders){var p=this.loaders[d];p&&p.destroy(),this.resetInternalLoader(d)}},P.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},P.onManifestLoading=function(d,p){var f=p.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:V.PlaylistContextType.MANIFEST,url:f,deliveryDirectives:null})},P.onLevelLoading=function(d,p){var f=p.id,T=p.level,x=p.url,E=p.deliveryDirectives;this.load({id:f,groupId:null,level:T,responseType:"text",type:V.PlaylistContextType.LEVEL,url:x,deliveryDirectives:E})},P.onAudioTrackLoading=function(d,p){var f=p.id,T=p.groupId,x=p.url,E=p.deliveryDirectives;this.load({id:f,groupId:T,level:null,responseType:"text",type:V.PlaylistContextType.AUDIO_TRACK,url:x,deliveryDirectives:E})},P.onSubtitleTrackLoading=function(d,p){var f=p.id,T=p.groupId,x=p.url,E=p.deliveryDirectives;this.load({id:f,groupId:T,level:null,responseType:"text",type:V.PlaylistContextType.SUBTITLE_TRACK,url:x,deliveryDirectives:E})},P.load=function(d){var p,f=this.hls.config,T=this.getInternalLoader(d);if(T){var x=T.context;if(x&&x.url===d.url){se.logger.trace("[playlist-loader]: playlist request ongoing");return}se.logger.log("[playlist-loader]: aborting previous loader for type: "+d.type),T.abort()}var E,k,C,b;switch(d.type){case V.PlaylistContextType.MANIFEST:E=f.manifestLoadingMaxRetry,k=f.manifestLoadingTimeOut,C=f.manifestLoadingRetryDelay,b=f.manifestLoadingMaxRetryTimeout;break;case V.PlaylistContextType.LEVEL:case V.PlaylistContextType.AUDIO_TRACK:case V.PlaylistContextType.SUBTITLE_TRACK:E=0,k=f.levelLoadingTimeOut;break;default:E=f.levelLoadingMaxRetry,k=f.levelLoadingTimeOut,C=f.levelLoadingRetryDelay,b=f.levelLoadingMaxRetryTimeout;break}if(T=this.createInternalLoader(d),(p=d.deliveryDirectives)!==null&&p!==void 0&&p.part){var m;if(d.type===V.PlaylistContextType.LEVEL&&d.level!==null?m=this.hls.levels[d.level].details:d.type===V.PlaylistContextType.AUDIO_TRACK&&d.id!==null?m=this.hls.audioTracks[d.id].details:d.type===V.PlaylistContextType.SUBTITLE_TRACK&&d.id!==null&&(m=this.hls.subtitleTracks[d.id].details),m){var v=m.partTarget,g=m.targetduration;v&&g&&(k=Math.min(Math.max(v*3,g*.8)*1e3,k))}}var _={timeout:k,maxRetry:E,retryDelay:C,maxRetryDelay:b,highWaterMark:0},O={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};T.load(d,_,O)},P.loadsuccess=function(d,p,f,T){if(T===void 0&&(T=null),f.isSidxRequest){this.handleSidxRequest(d,f),this.handlePlaylistLoaded(d,p,f,T);return}this.resetInternalLoader(f.type);var x=d.data;if(x.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(d,f,"no EXTM3U delimiter",T);return}p.parsing.start=performance.now(),x.indexOf("#EXTINF:")>0||x.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(d,p,f,T):this.handleMasterPlaylist(d,p,f,T)},P.loaderror=function(d,p,f){f===void 0&&(f=null),this.handleNetworkError(p,f,!1,d)},P.loadtimeout=function(d,p,f){f===void 0&&(f=null),this.handleNetworkError(p,f,!0)},P.handleMasterPlaylist=function(d,p,f,T){var x=this.hls,E=d.data,k=F(d,f),C=X.default.parseMasterPlaylist(E,k),b=C.levels,m=C.sessionData;if(!b.length){this.handleManifestParsingError(d,f,"no level found in manifest",T);return}var v=b.map(function(ee){return{id:ee.attrs.AUDIO,audioCodec:ee.audioCodec}}),g=b.map(function(ee){return{id:ee.attrs.SUBTITLES,textCodec:ee.textCodec}}),_=X.default.parseMasterPlaylistMedia(E,k,"AUDIO",v),O=X.default.parseMasterPlaylistMedia(E,k,"SUBTITLES",g),G=X.default.parseMasterPlaylistMedia(E,k,"CLOSED-CAPTIONS");if(_.length){var Y=_.some(function(ee){return!ee.url});!Y&&b[0].audioCodec&&!b[0].attrs.AUDIO&&(se.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),_.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new L.AttrList({}),bitrate:0,url:""}))}x.trigger(K.Events.MANIFEST_LOADED,{levels:b,audioTracks:_,subtitles:O,captions:G,url:k,stats:p,networkDetails:T,sessionData:m})},P.handleTrackOrLevelPlaylist=function(d,p,f,T){var x=this.hls,E=f.id,k=f.level,C=f.type,b=F(d,f),m=Object(ae.isFiniteNumber)(E)?E:0,v=Object(ae.isFiniteNumber)(k)?k:m,g=H(f),_=X.default.parseLevelPlaylist(d.data,b,v,g,m);if(!_.fragments.length){x.trigger(K.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:b,reason:"no fragments found in level",level:typeof f.level=="number"?f.level:void 0});return}if(C===V.PlaylistContextType.MANIFEST){var O={attrs:new L.AttrList({}),bitrate:0,details:_,name:"",url:b};x.trigger(K.Events.MANIFEST_LOADED,{levels:[O],audioTracks:[],url:b,stats:p,networkDetails:T,sessionData:null})}if(p.parsing.end=performance.now(),_.needSidxRanges){var G,Y=(G=_.fragments[0].initSegment)===null||G===void 0?void 0:G.url;this.load({url:Y,isSidxRequest:!0,type:C,level:k,levelDetails:_,id:E,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}f.levelDetails=_,this.handlePlaylistLoaded(d,p,f,T)},P.handleSidxRequest=function(d,p){var f=Object(q.parseSegmentIndex)(new Uint8Array(d.data));if(!f)return;var T=f.references,x=p.levelDetails;T.forEach(function(E,k){var C=E.info,b=x.fragments[k];b.byteRange.length===0&&b.setByteRange(String(1+C.end-C.start)+"@"+String(C.start)),b.initSegment&&b.initSegment.setByteRange(String(f.moovEndOffset)+"@0")})},P.handleManifestParsingError=function(d,p,f,T){this.hls.trigger(K.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:p.type===V.PlaylistContextType.MANIFEST,url:d.url,reason:f,response:d,context:p,networkDetails:T})},P.handleNetworkError=function(d,p,f,T){f===void 0&&(f=!1),se.logger.warn("[playlist-loader]: A network "+(f?"timeout":"error")+" occurred while loading "+d.type+" level: "+d.level+" id: "+d.id+' group-id: "'+d.groupId+'"');var x=M.ErrorDetails.UNKNOWN,E=!1,k=this.getInternalLoader(d);switch(d.type){case V.PlaylistContextType.MANIFEST:x=f?M.ErrorDetails.MANIFEST_LOAD_TIMEOUT:M.ErrorDetails.MANIFEST_LOAD_ERROR,E=!0;break;case V.PlaylistContextType.LEVEL:x=f?M.ErrorDetails.LEVEL_LOAD_TIMEOUT:M.ErrorDetails.LEVEL_LOAD_ERROR,E=!1;break;case V.PlaylistContextType.AUDIO_TRACK:x=f?M.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,E=!1;break;case V.PlaylistContextType.SUBTITLE_TRACK:x=f?M.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:M.ErrorDetails.SUBTITLE_LOAD_ERROR,E=!1;break}k&&this.resetInternalLoader(d.type);var C={type:M.ErrorTypes.NETWORK_ERROR,details:x,fatal:E,url:d.url,loader:k,context:d,networkDetails:p};T&&(C.response=T),this.hls.trigger(K.Events.ERROR,C)},P.handlePlaylistLoaded=function(d,p,f,T){var x=f.type,E=f.level,k=f.id,C=f.groupId,b=f.loader,m=f.levelDetails,v=f.deliveryDirectives;if(!(m!=null&&m.targetduration)){this.handleManifestParsingError(d,f,"invalid target duration",T);return}if(!b)return;m.live&&(b.getCacheAge&&(m.ageHeader=b.getCacheAge()||0),(!b.getCacheAge||isNaN(m.ageHeader))&&(m.ageHeader=0));switch(x){case V.PlaylistContextType.MANIFEST:case V.PlaylistContextType.LEVEL:this.hls.trigger(K.Events.LEVEL_LOADED,{details:m,level:E||0,id:k||0,stats:p,networkDetails:T,deliveryDirectives:v});break;case V.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(K.Events.AUDIO_TRACK_LOADED,{details:m,id:k||0,groupId:C||"",stats:p,networkDetails:T,deliveryDirectives:v});break;case V.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(K.Events.SUBTITLE_TRACK_LOADED,{details:m,id:k||0,groupId:C||"",stats:p,networkDetails:T,deliveryDirectives:v});break}},j}();re.default=I},"./src/polyfills/number.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"isFiniteNumber",function(){return ae}),z.d(re,"MAX_SAFE_INTEGER",function(){return K});var ae=Number.isFinite||function(M){return typeof M=="number"&&isFinite(M)},K=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ze,re,z){"use strict";z.r(re);var ae=function(){function K(){}return K.getSilentFrame=function(se,q){switch(se){case"mp4a.40.2":if(q===1)return new Uint8Array([0,200,0,128,35,128]);if(q===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(q===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(q===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(q===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(q===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(q===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(q===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(q===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},K}();re.default=ae},"./src/remux/mp4-generator.ts":function(ze,re,z){"use strict";z.r(re);var ae=Math.pow(2,32)-1,K=function(){function M(){}return M.init=function(){M.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var q;for(q in M.types)M.types.hasOwnProperty(q)&&(M.types[q]=[q.charCodeAt(0),q.charCodeAt(1),q.charCodeAt(2),q.charCodeAt(3)]);var X=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),V=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);M.HDLR_TYPES={video:X,audio:V};var L=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),H=new Uint8Array([0,0,0,0,0,0,0,0]);M.STTS=M.STSC=M.STCO=H,M.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),M.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),M.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),M.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var F=new Uint8Array([105,115,111,109]),I=new Uint8Array([97,118,99,49]),j=new Uint8Array([0,0,0,1]);M.FTYP=M.box(M.types.ftyp,F,j,F,I),M.DINF=M.box(M.types.dinf,M.box(M.types.dref,L))},M.box=function(q){for(var X=8,V=arguments.length,L=new Array(V>1?V-1:0),H=1;H<V;H++)L[H-1]=arguments[H];for(var F=L.length,I=F;F--;)X+=L[F].byteLength;var j=new Uint8Array(X);for(j[0]=X>>24&255,j[1]=X>>16&255,j[2]=X>>8&255,j[3]=X&255,j.set(q,4),F=0,X=8;F<I;F++)j.set(L[F],X),X+=L[F].byteLength;return j},M.hdlr=function(q){return M.box(M.types.hdlr,M.HDLR_TYPES[q])},M.mdat=function(q){return M.box(M.types.mdat,q)},M.mdhd=function(q,X){X*=q;var V=Math.floor(X/(ae+1)),L=Math.floor(X%(ae+1));return M.box(M.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,q>>24&255,q>>16&255,q>>8&255,q&255,V>>24,V>>16&255,V>>8&255,V&255,L>>24,L>>16&255,L>>8&255,L&255,85,196,0,0]))},M.mdia=function(q){return M.box(M.types.mdia,M.mdhd(q.timescale,q.duration),M.hdlr(q.type),M.minf(q))},M.mfhd=function(q){return M.box(M.types.mfhd,new Uint8Array([0,0,0,0,q>>24,q>>16&255,q>>8&255,q&255]))},M.minf=function(q){return q.type==="audio"?M.box(M.types.minf,M.box(M.types.smhd,M.SMHD),M.DINF,M.stbl(q)):M.box(M.types.minf,M.box(M.types.vmhd,M.VMHD),M.DINF,M.stbl(q))},M.moof=function(q,X,V){return M.box(M.types.moof,M.mfhd(q),M.traf(V,X))},M.moov=function(q){for(var X=q.length,V=[];X--;)V[X]=M.trak(q[X]);return M.box.apply(null,[M.types.moov,M.mvhd(q[0].timescale,q[0].duration)].concat(V).concat(M.mvex(q)))},M.mvex=function(q){for(var X=q.length,V=[];X--;)V[X]=M.trex(q[X]);return M.box.apply(null,[M.types.mvex].concat(V))},M.mvhd=function(q,X){X*=q;var V=Math.floor(X/(ae+1)),L=Math.floor(X%(ae+1)),H=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,q>>24&255,q>>16&255,q>>8&255,q&255,V>>24,V>>16&255,V>>8&255,V&255,L>>24,L>>16&255,L>>8&255,L&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return M.box(M.types.mvhd,H)},M.sdtp=function(q){var X=q.samples||[],V=new Uint8Array(4+X.length),L,H;for(L=0;L<X.length;L++)H=X[L].flags,V[L+4]=H.dependsOn<<4|H.isDependedOn<<2|H.hasRedundancy;return M.box(M.types.sdtp,V)},M.stbl=function(q){return M.box(M.types.stbl,M.stsd(q),M.box(M.types.stts,M.STTS),M.box(M.types.stsc,M.STSC),M.box(M.types.stsz,M.STSZ),M.box(M.types.stco,M.STCO))},M.avc1=function(q){var X=[],V=[],L,H,F;for(L=0;L<q.sps.length;L++)H=q.sps[L],F=H.byteLength,X.push(F>>>8&255),X.push(F&255),X=X.concat(Array.prototype.slice.call(H));for(L=0;L<q.pps.length;L++)H=q.pps[L],F=H.byteLength,V.push(F>>>8&255),V.push(F&255),V=V.concat(Array.prototype.slice.call(H));var I=M.box(M.types.avcC,new Uint8Array([1,X[3],X[4],X[5],252|3,224|q.sps.length].concat(X).concat([q.pps.length]).concat(V))),j=q.width,P=q.height,w=q.pixelRatio[0],d=q.pixelRatio[1];return M.box(M.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,j>>8&255,j&255,P>>8&255,P&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),I,M.box(M.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),M.box(M.types.pasp,new Uint8Array([w>>24,w>>16&255,w>>8&255,w&255,d>>24,d>>16&255,d>>8&255,d&255])))},M.esds=function(q){var X=q.config.length;return new Uint8Array([0,0,0,0,3,23+X,0,1,0,4,15+X,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([X]).concat(q.config).concat([6,1,2]))},M.mp4a=function(q){var X=q.samplerate;return M.box(M.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,q.channelCount,0,16,0,0,0,0,X>>8&255,X&255,0,0]),M.box(M.types.esds,M.esds(q)))},M.mp3=function(q){var X=q.samplerate;return M.box(M.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,q.channelCount,0,16,0,0,0,0,X>>8&255,X&255,0,0]))},M.stsd=function(q){return q.type==="audio"?!q.isAAC&&q.codec==="mp3"?M.box(M.types.stsd,M.STSD,M.mp3(q)):M.box(M.types.stsd,M.STSD,M.mp4a(q)):M.box(M.types.stsd,M.STSD,M.avc1(q))},M.tkhd=function(q){var X=q.id,V=q.duration*q.timescale,L=q.width,H=q.height,F=Math.floor(V/(ae+1)),I=Math.floor(V%(ae+1));return M.box(M.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,X>>24&255,X>>16&255,X>>8&255,X&255,0,0,0,0,F>>24,F>>16&255,F>>8&255,F&255,I>>24,I>>16&255,I>>8&255,I&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,L>>8&255,L&255,0,0,H>>8&255,H&255,0,0]))},M.traf=function(q,X){var V=M.sdtp(q),L=q.id,H=Math.floor(X/(ae+1)),F=Math.floor(X%(ae+1));return M.box(M.types.traf,M.box(M.types.tfhd,new Uint8Array([0,0,0,0,L>>24,L>>16&255,L>>8&255,L&255])),M.box(M.types.tfdt,new Uint8Array([1,0,0,0,H>>24,H>>16&255,H>>8&255,H&255,F>>24,F>>16&255,F>>8&255,F&255])),M.trun(q,V.length+16+20+8+16+8+8),V)},M.trak=function(q){return q.duration=q.duration||4294967295,M.box(M.types.trak,M.tkhd(q),M.mdia(q))},M.trex=function(q){var X=q.id;return M.box(M.types.trex,new Uint8Array([0,0,0,0,X>>24,X>>16&255,X>>8&255,X&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},M.trun=function(q,X){var V=q.samples||[],L=V.length,H=12+16*L,F=new Uint8Array(H),I,j,P,w,d,p;for(X+=8+H,F.set([0,0,15,1,L>>>24&255,L>>>16&255,L>>>8&255,L&255,X>>>24&255,X>>>16&255,X>>>8&255,X&255],0),I=0;I<L;I++)j=V[I],P=j.duration,w=j.size,d=j.flags,p=j.cts,F.set([P>>>24&255,P>>>16&255,P>>>8&255,P&255,w>>>24&255,w>>>16&255,w>>>8&255,w&255,d.isLeading<<2|d.dependsOn,d.isDependedOn<<6|d.hasRedundancy<<4|d.paddingValue<<1|d.isNonSync,d.degradPrio&240<<8,d.degradPrio&15,p>>>24&255,p>>>16&255,p>>>8&255,p&255],12+16*I);return M.box(M.types.trun,F)},M.initSegment=function(q){M.types||M.init();var X=M.moov(q),V=new Uint8Array(M.FTYP.byteLength+X.byteLength);return V.set(M.FTYP),V.set(X,M.FTYP.byteLength),V},M}();K.types=void 0,K.HDLR_TYPES=void 0,K.STTS=void 0,K.STSC=void 0,K.STCO=void 0,K.STSZ=void 0,K.VMHD=void 0,K.SMHD=void 0,K.STSD=void 0,K.FTYP=void 0,K.DINF=void 0,re.default=K},"./src/remux/mp4-remuxer.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return p}),z.d(re,"normalizePts",function(){return f});var ae=z("./src/polyfills/number.ts"),K=z("./src/remux/aac-helper.ts"),M=z("./src/remux/mp4-generator.ts"),se=z("./src/events.ts"),q=z("./src/errors.ts"),X=z("./src/utils/logger.ts"),V=z("./src/types/loader.ts"),L=z("./src/utils/timescale-conversion.ts");function H(){return H=Object.assign||function(k){for(var C=1;C<arguments.length;C++){var b=arguments[C];for(var m in b)Object.prototype.hasOwnProperty.call(b,m)&&(k[m]=b[m])}return k},H.apply(this,arguments)}var F=10*1e3,I=1024,j=1152,P=null,w=null,d=!1,p=function(){function k(b,m,v,g){if(g===void 0&&(g=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=b,this.config=m,this.typeSupported=v,this.ISGenerated=!1,P===null){var _=navigator.userAgent||"",O=_.match(/Chrome\/(\d+)/i);P=O?parseInt(O[1]):0}if(w===null){var G=navigator.userAgent.match(/Safari\/(\d+)/i);w=G?parseInt(G[1]):0}d=!!P&&P<75||!!w&&w<600}var C=k.prototype;return C.destroy=function(){},C.resetTimeStamp=function(m){X.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=m},C.resetNextTimestamp=function(){X.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},C.resetInitSegment=function(){X.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},C.getVideoStartPts=function(m){var v=!1,g=m.reduce(function(_,O){var G=O.pts-_;return G<-4294967296?(v=!0,f(_,O.pts)):G>0?_:O.pts},m[0].pts);return v&&X.logger.debug("PTS rollover detected"),g},C.remux=function(m,v,g,_,O,G,Y,ee){var fe,pe,xe,Ce,be,Oe,We=O,Me=O,ct=m.pid>-1,Ge=v.pid>-1,Je=v.samples.length,Xe=m.samples.length>0,Ye=Je>1,ke=(!ct||Xe)&&(!Ge||Ye)||this.ISGenerated||Y;if(ke){this.ISGenerated||(xe=this.generateIS(m,v,O));var Z=this.isVideoContiguous,A=-1;if(Ye&&(A=T(v.samples),!Z&&this.config.forceKeyFrameOnDiscontinuity))if(Oe=!0,A>0){X.logger.warn("[mp4-remuxer]: Dropped "+A+" out of "+Je+" video samples due to a missing keyframe");var R=this.getVideoStartPts(v.samples);v.samples=v.samples.slice(A),v.dropped+=A,Me+=(v.samples[0].pts-R)/(v.timescale||9e4)}else A===-1&&(X.logger.warn("[mp4-remuxer]: No keyframe found out of "+Je+" video samples"),Oe=!1);if(this.ISGenerated){if(Xe&&Ye){var J=this.getVideoStartPts(v.samples),oe=f(m.samples[0].pts,J)-J,$=oe/v.inputTimeScale;We+=Math.max(0,$),Me+=Math.max(0,-$)}if(Xe){if(m.samplerate||(X.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),xe=this.generateIS(m,v,O)),pe=this.remuxAudio(m,We,this.isAudioContiguous,G,Ge||Ye||ee===V.PlaylistLevelType.AUDIO?Me:void 0),Ye){var Se=pe?pe.endPTS-pe.startPTS:0;v.inputTimeScale||(X.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),xe=this.generateIS(m,v,O)),fe=this.remuxVideo(v,Me,Z,Se)}}else Ye&&(fe=this.remuxVideo(v,Me,Z,0));fe&&(fe.firstKeyFrame=A,fe.independent=A!==-1)}}return this.ISGenerated&&(g.samples.length&&(be=this.remuxID3(g,O)),_.samples.length&&(Ce=this.remuxText(_,O))),{audio:pe,video:fe,initSegment:xe,independent:Oe,text:Ce,id3:be}},C.generateIS=function(m,v,g){var _=m.samples,O=v.samples,G=this.typeSupported,Y={},ee=!Object(ae.isFiniteNumber)(this._initPTS),fe="audio/mp4",pe,xe,Ce;if(ee&&(pe=xe=Infinity),m.config&&_.length&&(m.timescale=m.samplerate,m.isAAC||(G.mpeg?(fe="audio/mpeg",m.codec=""):G.mp3&&(m.codec="mp3")),Y.audio={id:"audio",container:fe,codec:m.codec,initSegment:!m.isAAC&&G.mpeg?new Uint8Array(0):M.default.initSegment([m]),metadata:{channelCount:m.channelCount}},ee&&(Ce=m.inputTimeScale,pe=xe=_[0].pts-Math.round(Ce*g))),v.sps&&v.pps&&O.length&&(v.timescale=v.inputTimeScale,Y.video={id:"main",container:"video/mp4",codec:v.codec,initSegment:M.default.initSegment([v]),metadata:{width:v.width,height:v.height}},ee)){Ce=v.inputTimeScale;var be=this.getVideoStartPts(O),Oe=Math.round(Ce*g);xe=Math.min(xe,f(O[0].dts,be)-Oe),pe=Math.min(pe,be-Oe)}if(Object.keys(Y).length)return this.ISGenerated=!0,ee&&(this._initPTS=pe,this._initDTS=xe),{tracks:Y,initPTS:pe,timescale:Ce}},C.remuxVideo=function(m,v,g,_){var O=m.inputTimeScale,G=m.samples,Y=[],ee=G.length,fe=this._initPTS,pe=this.nextAvcDts,xe=8,Ce,be,Oe,We=Number.POSITIVE_INFINITY,Me=Number.NEGATIVE_INFINITY,ct=0,Ge=!1;if(!g||pe===null){var Je=v*O,Xe=G[0].pts-f(G[0].dts,G[0].pts);pe=Je-Xe}for(var Ye=0;Ye<ee;Ye++){var ke=G[Ye];if(ke.pts=f(ke.pts-fe,pe),ke.dts=f(ke.dts-fe,pe),ke.dts>ke.pts){var Z=9e4*.2;ct=Math.max(Math.min(ct,ke.pts-ke.dts),-1*Z)}ke.dts<G[Ye>0?Ye-1:Ye].dts&&(Ge=!0)}Ge&&G.sort(function(Kr,Jt){var Yt=Kr.dts-Jt.dts,jn=Kr.pts-Jt.pts;return Yt||jn}),be=G[0].dts,Oe=G[G.length-1].dts;var A=Math.round((Oe-be)/(ee-1));if(ct<0){if(ct<A*-2){X.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(L.toMsFromMpegTsClock)(-A,!0)+" ms");for(var R=ct,J=0;J<ee;J++)G[J].dts=R=Math.max(R,G[J].pts-A),G[J].pts=Math.max(R,G[J].pts)}else{X.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(L.toMsFromMpegTsClock)(ct,!0)+" ms to overcome this issue");for(var oe=0;oe<ee;oe++)G[oe].dts=G[oe].dts+ct}be=G[0].dts}if(g){var $=be-pe,Se=$>A,je=$<-1;if(Se||je){Se?X.logger.warn("AVC: "+Object(L.toMsFromMpegTsClock)($,!0)+" ms ("+$+"dts) hole between fragments detected, filling it"):X.logger.warn("AVC: "+Object(L.toMsFromMpegTsClock)(-$,!0)+" ms ("+$+"dts) overlapping between fragments detected"),be=pe;var $e=G[0].pts-$;G[0].dts=be,G[0].pts=$e,X.logger.log("Video: First PTS/DTS adjusted: "+Object(L.toMsFromMpegTsClock)($e,!0)+"/"+Object(L.toMsFromMpegTsClock)(be,!0)+", delta: "+Object(L.toMsFromMpegTsClock)($,!0)+" ms")}}d&&(be=Math.max(0,be));for(var st=0,Ke=0,it=0;it<ee;it++){for(var nt=G[it],bt=nt.units,_t=bt.length,Lt=0,Ot=0;Ot<_t;Ot++)Lt+=bt[Ot].data.length;Ke+=Lt,st+=_t,nt.length=Lt,nt.dts=Math.max(nt.dts,be),nt.pts=Math.max(nt.pts,nt.dts,0),We=Math.min(nt.pts,We),Me=Math.max(nt.pts,Me)}Oe=G[ee-1].dts;var xt=Ke+4*st+8,jt;try{jt=new Uint8Array(xt)}catch(Kr){this.observer.emit(se.Events.ERROR,se.Events.ERROR,{type:q.ErrorTypes.MUX_ERROR,details:q.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:xt,reason:"fail allocating video mdat "+xt});return}var Nt=new DataView(jt.buffer);Nt.setUint32(0,xt),jt.set(M.default.types.mdat,4);for(var mt=0;mt<ee;mt++){for(var Ht=G[mt],Vt=Ht.units,ge=0,ie=0,ne=Vt.length;ie<ne;ie++){var ce=Vt[ie],me=ce.data,le=ce.data.byteLength;Nt.setUint32(xe,le),xe+=4,jt.set(me,xe),xe+=le,ge+=4+le}if(mt<ee-1)Ce=G[mt+1].dts-Ht.dts;else{var ue=this.config,ye=Ht.dts-G[mt>0?mt-1:mt].dts;if(ue.stretchShortVideoTrack&&this.nextAudioPts!==null){var we=Math.floor(ue.maxBufferHole*O),Ne=(_?We+_*O:this.nextAudioPts)-Ht.pts;Ne>we?(Ce=Ne-ye,Ce<0&&(Ce=ye),X.logger.log("[mp4-remuxer]: It is approximately "+Ne/90+" ms to the next segment; using duration "+Ce/90+" ms for the last video frame.")):Ce=ye}else Ce=ye}var Ie=Math.round(Ht.pts-Ht.dts);Y.push(new x(Ht.key,Ce,ge,Ie))}if(Y.length&&P&&P<70){var lt=Y[0].flags;lt.dependsOn=2,lt.isNonSync=0}console.assert(Ce!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=pe=Oe+Ce,this.isVideoContiguous=!0;var Pt=M.default.moof(m.sequenceNumber++,be,H({},m,{samples:Y})),Zt="video",$t={data1:Pt,data2:jt,startPTS:We/O,endPTS:(Me+Ce)/O,startDTS:be/O,endDTS:pe/O,type:Zt,hasAudio:!1,hasVideo:!0,nb:Y.length,dropped:m.dropped};return m.samples=[],m.dropped=0,console.assert(jt.length,"MDAT length must not be zero"),$t},C.remuxAudio=function(m,v,g,_,O){var G=m.inputTimeScale,Y=m.samplerate?m.samplerate:G,ee=G/Y,fe=m.isAAC?I:j,pe=fe*ee,xe=this._initPTS,Ce=!m.isAAC&&this.typeSupported.mpeg,be=[],Oe=m.samples,We=Ce?0:8,Me=this.nextAudioPts||-1,ct=v*G;if(this.isAudioContiguous=g=g||Oe.length&&Me>0&&(_&&Math.abs(ct-Me)<9e3||Math.abs(f(Oe[0].pts-xe,ct)-Me)<20*pe),Oe.forEach(function(me){me.pts=f(me.pts-xe,ct)}),!g||Me<0){if(Oe=Oe.filter(function(me){return me.pts>=0}),!Oe.length)return;O===0?Me=0:_?Me=Math.max(0,ct):Me=Oe[0].pts}if(m.isAAC)for(var Ge=O!==void 0,Je=this.config.maxAudioFramesDrift,Xe=0,Ye=Me;Xe<Oe.length;Xe++){var ke=Oe[Xe],Z=ke.pts,A=Z-Ye,R=Math.abs(1e3*A/G);if(A<=-Je*pe&&Ge)Xe===0&&(X.logger.warn("Audio frame @ "+(Z/G).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*A/G)+" ms."),this.nextAudioPts=Me=Ye=Z);else if(A>=Je*pe&&R<F&&Ge){var J=Math.round(A/pe);Ye=Z-J*pe,Ye<0&&(J--,Ye+=pe),Xe===0&&(this.nextAudioPts=Me=Ye),X.logger.warn("[mp4-remuxer]: Injecting "+J+" audio frame @ "+(Ye/G).toFixed(3)+"s due to "+Math.round(1e3*A/G)+" ms gap.");for(var oe=0;oe<J;oe++){var $=Math.max(Ye,0),Se=K.default.getSilentFrame(m.manifestCodec||m.codec,m.channelCount);Se||(X.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Se=ke.unit.subarray()),Oe.splice(Xe,0,{unit:Se,pts:$}),Ye+=pe,Xe++}}ke.pts=Ye,Ye+=pe}for(var je=null,$e=null,st,Ke=0,it=Oe.length;it--;)Ke+=Oe[it].unit.byteLength;for(var nt=0,bt=Oe.length;nt<bt;nt++){var _t=Oe[nt],Lt=_t.unit,Ot=_t.pts;if($e!==null){var xt=be[nt-1];xt.duration=Math.round((Ot-$e)/ee)}else if(g&&m.isAAC&&(Ot=Me),je=Ot,Ke>0){Ke+=We;try{st=new Uint8Array(Ke)}catch(me){this.observer.emit(se.Events.ERROR,se.Events.ERROR,{type:q.ErrorTypes.MUX_ERROR,details:q.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ke,reason:"fail allocating audio mdat "+Ke});return}if(!Ce){var jt=new DataView(st.buffer);jt.setUint32(0,Ke),st.set(M.default.types.mdat,4)}}else return;st.set(Lt,We);var Nt=Lt.byteLength;We+=Nt,be.push(new x(!0,fe,Nt,0)),$e=Ot}var mt=be.length;if(!mt)return;var Ht=be[be.length-1];this.nextAudioPts=Me=$e+ee*Ht.duration;var Vt=Ce?new Uint8Array(0):M.default.moof(m.sequenceNumber++,je/ee,H({},m,{samples:be}));m.samples=[];var ge=je/G,ie=Me/G,ne="audio",ce={data1:Vt,data2:st,startPTS:ge,endPTS:ie,startDTS:ge,endDTS:ie,type:ne,hasAudio:!0,hasVideo:!1,nb:mt};return this.isAudioContiguous=!0,console.assert(st.length,"MDAT length must not be zero"),ce},C.remuxEmptyAudio=function(m,v,g,_){var O=m.inputTimeScale,G=m.samplerate?m.samplerate:O,Y=O/G,ee=this.nextAudioPts,fe=(ee!==null?ee:_.startDTS*O)+this._initDTS,pe=_.endDTS*O+this._initDTS,xe=Y*I,Ce=Math.ceil((pe-fe)/xe),be=K.default.getSilentFrame(m.manifestCodec||m.codec,m.channelCount);if(X.logger.warn("[mp4-remuxer]: remux empty Audio"),!be){X.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Oe=[],We=0;We<Ce;We++){var Me=fe+We*xe;Oe.push({unit:be,pts:Me,dts:Me})}return m.samples=Oe,this.remuxAudio(m,v,g,!1)},C.remuxID3=function(m,v){var g=m.samples.length;if(!g)return;for(var _=m.inputTimeScale,O=this._initPTS,G=this._initDTS,Y=0;Y<g;Y++){var ee=m.samples[Y];ee.pts=f(ee.pts-O,v*_)/_,ee.dts=f(ee.dts-G,v*_)/_}var fe=m.samples;return m.samples=[],{samples:fe}},C.remuxText=function(m,v){var g=m.samples.length;if(!g)return;for(var _=m.inputTimeScale,O=this._initPTS,G=0;G<g;G++){var Y=m.samples[G];Y.pts=f(Y.pts-O,v*_)/_}m.samples.sort(function(fe,pe){return fe.pts-pe.pts});var ee=m.samples;return m.samples=[],{samples:ee}},k}();function f(k,C){var b;if(C===null)return k;for(C<k?b=-8589934592:b=8589934592;Math.abs(k-C)>4294967296;)k+=b;return k}function T(k){for(var C=0;C<k.length;C++)if(k[C].key)return C;return-1}var x=function(C,b,m,v){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=b,this.size=m,this.cts=v,this.flags=new E(C)},E=function(C){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=C?2:1,this.isNonSync=C?0:1}},"./src/remux/passthrough-remuxer.ts":function(ze,re,z){"use strict";z.r(re);var ae=z("./src/polyfills/number.ts"),K=z("./src/utils/mp4-tools.ts"),M=z("./src/loader/fragment.ts"),se=z("./src/utils/logger.ts"),q=function(){function L(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var H=L.prototype;return H.destroy=function(){},H.resetTimeStamp=function(I){this.initPTS=I,this.lastEndDTS=null},H.resetNextTimestamp=function(){this.lastEndDTS=null},H.resetInitSegment=function(I,j,P){this.audioCodec=j,this.videoCodec=P,this.generateInitSegment(I),this.emitInitSegment=!0},H.generateInitSegment=function(I){var j=this.audioCodec,P=this.videoCodec;if(!I||!I.byteLength){this.initTracks=void 0,this.initData=void 0;return}var w=this.initData=Object(K.parseInitSegment)(I);j||(j=V(w.audio,M.ElementaryStreamTypes.AUDIO)),P||(P=V(w.video,M.ElementaryStreamTypes.VIDEO));var d={};w.audio&&w.video?d.audiovideo={container:"video/mp4",codec:j+","+P,initSegment:I,id:"main"}:w.audio?d.audio={container:"audio/mp4",codec:j,initSegment:I,id:"audio"}:w.video?d.video={container:"video/mp4",codec:P,initSegment:I,id:"main"}:se.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=d},H.remux=function(I,j,P,w,d){var p=this.initPTS,f=this.lastEndDTS,T={audio:void 0,video:void 0,text:w,id3:P,initSegment:void 0};Object(ae.isFiniteNumber)(f)||(f=this.lastEndDTS=d||0);var x=j.samples;if(!x||!x.length)return T;var E={initPTS:void 0,timescale:1},k=this.initData;if((!k||!k.length)&&(this.generateInitSegment(x),k=this.initData),!k||!k.length)return se.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),T;this.emitInitSegment&&(E.tracks=this.initTracks,this.emitInitSegment=!1),Object(ae.isFiniteNumber)(p)||(this.initPTS=E.initPTS=p=X(k,x,f));var C=Object(K.getDuration)(x,k),b=f,m=C+b;Object(K.offsetStartDTS)(k,x,p),C>0?this.lastEndDTS=m:(se.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var v=!!k.audio,g=!!k.video,_="";v&&(_+="audio"),g&&(_+="video");var O={data1:x,startPTS:b,startDTS:b,endPTS:m,endDTS:m,type:_,hasAudio:v,hasVideo:g,nb:1,dropped:0};return T.audio=O.type==="audio"?O:void 0,T.video=O.type!=="audio"?O:void 0,T.text=w,T.id3=P,T.initSegment=E,T},L}(),X=function(H,F,I){return Object(K.getStartDTS)(H,F)-I};function V(L,H){var F=L==null?void 0:L.codec;return F&&F.length>4?F:F==="hvc1"?"hvc1.1.c.L120.90":F==="av01"?"av01.0.04M.08":F==="avc1"||H===M.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}re.default=q},"./src/task-loop.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return ae});var ae=function(){function K(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var M=K.prototype;return M.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},M.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},M.onHandlerDestroyed=function(){},M.hasInterval=function(){return!!this._tickInterval},M.hasNextTick=function(){return!!this._tickTimer},M.setInterval=function(q){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,q),!0)},M.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},M.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},M.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},M.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},M.doTick=function(){},K}()},"./src/types/cmcd.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"CMCDVersion",function(){return ae}),z.d(re,"CMCDObjectType",function(){return K}),z.d(re,"CMCDStreamingFormat",function(){return M}),z.d(re,"CMCDStreamType",function(){return se});var ae=1,K;(function(q){q.MANIFEST="m",q.AUDIO="a",q.VIDEO="v",q.MUXED="av",q.INIT="i",q.CAPTION="c",q.TIMED_TEXT="tt",q.KEY="k",q.OTHER="o"})(K||(K={}));var M;(function(q){q.DASH="d",q.HLS="h",q.SMOOTH="s",q.OTHER="o"})(M||(M={}));var se;(function(q){q.VOD="v",q.LIVE="l"})(se||(se={}))},"./src/types/level.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"HlsSkip",function(){return M}),z.d(re,"getSkipValue",function(){return se}),z.d(re,"HlsUrlParameters",function(){return q}),z.d(re,"Level",function(){return X});function ae(V,L){for(var H=0;H<L.length;H++){var F=L[H];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(V,F.key,F)}}function K(V,L,H){return L&&ae(V.prototype,L),H&&ae(V,H),V}var M;(function(V){V.No="",V.Yes="YES",V.v2="v2"})(M||(M={}));function se(V,L){var H=V.canSkipUntil,F=V.canSkipDateRanges,I=V.endSN,j=L!==void 0?L-I:0;return H&&j<H?F?M.v2:M.Yes:M.No}var q=function(){function V(H,F,I){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=H,this.part=F,this.skip=I}var L=V.prototype;return L.addDirectives=function(F){var I=new self.URL(F);return this.msn!==void 0&&I.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&I.searchParams.set("_HLS_part",this.part.toString()),this.skip&&I.searchParams.set("_HLS_skip",this.skip),I.toString()},V}(),X=function(){function V(L){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[L.url],this.attrs=L.attrs,this.bitrate=L.bitrate,L.details&&(this.details=L.details),this.id=L.id||0,this.name=L.name,this.width=L.width||0,this.height=L.height||0,this.audioCodec=L.audioCodec,this.videoCodec=L.videoCodec,this.unknownCodecs=L.unknownCodecs,this.codecSet=[L.videoCodec,L.audioCodec].filter(function(H){return H}).join(",").replace(/\.[^.,]+/g,"")}return K(V,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(H){var F=H%this.url.length;this._urlId!==F&&(this.details=void 0,this._urlId=F)}}]),V}()},"./src/types/loader.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"PlaylistContextType",function(){return ae}),z.d(re,"PlaylistLevelType",function(){return K});var ae;(function(M){M.MANIFEST="manifest",M.LEVEL="level",M.AUDIO_TRACK="audioTrack",M.SUBTITLE_TRACK="subtitleTrack"})(ae||(ae={}));var K;(function(M){M.MAIN="main",M.AUDIO="audio",M.SUBTITLE="subtitle"})(K||(K={}))},"./src/types/transmuxer.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"ChunkMetadata",function(){return ae});var ae=function(se,q,X,V,L,H){V===void 0&&(V=0),L===void 0&&(L=-1),H===void 0&&(H=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=K(),this.buffering={audio:K(),video:K(),audiovideo:K()},this.level=se,this.sn=q,this.id=X,this.size=V,this.part=L,this.partial=H};function K(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"AttrList",function(){return M});var ae=/^(\d+)x(\d+)$/,K=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,M=function(){function se(X){typeof X=="string"&&(X=se.parseAttrList(X));for(var V in X)X.hasOwnProperty(V)&&(this[V]=X[V])}var q=se.prototype;return q.decimalInteger=function(V){var L=parseInt(this[V],10);return L>Number.MAX_SAFE_INTEGER?Infinity:L},q.hexadecimalInteger=function(V){if(this[V]){var L=(this[V]||"0x").slice(2);L=(L.length&1?"0":"")+L;for(var H=new Uint8Array(L.length/2),F=0;F<L.length/2;F++)H[F]=parseInt(L.slice(F*2,F*2+2),16);return H}else return null},q.hexadecimalIntegerAsNumber=function(V){var L=parseInt(this[V],16);return L>Number.MAX_SAFE_INTEGER?Infinity:L},q.decimalFloatingPoint=function(V){return parseFloat(this[V])},q.optionalFloat=function(V,L){var H=this[V];return H?parseFloat(H):L},q.enumeratedString=function(V){return this[V]},q.bool=function(V){return this[V]==="YES"},q.decimalResolution=function(V){var L=ae.exec(this[V]);return L===null?void 0:{width:parseInt(L[1],10),height:parseInt(L[2],10)}},se.parseAttrList=function(V){var L,H={},F='"';for(K.lastIndex=0;(L=K.exec(V))!==null;){var I=L[2];I.indexOf(F)===0&&I.lastIndexOf(F)===I.length-1&&(I=I.slice(1,-1)),H[L[1]]=I}return H},se}()},"./src/utils/binary-search.ts":function(ze,re,z){"use strict";z.r(re);var ae={search:function(M,se){for(var q=0,X=M.length-1,V=null,L=null;q<=X;){V=(q+X)/2|0,L=M[V];var H=se(L);if(H>0)q=V+1;else if(H<0)X=V-1;else return L}return null}};re.default=ae},"./src/utils/buffer-helper.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"BufferHelper",function(){return M});var ae=z("./src/utils/logger.ts"),K={length:0,start:function(){return 0},end:function(){return 0}},M=function(){function se(){}return se.isBuffered=function(X,V){try{if(X){for(var L=se.getBuffered(X),H=0;H<L.length;H++)if(V>=L.start(H)&&V<=L.end(H))return!0}}catch(F){}return!1},se.bufferInfo=function(X,V,L){try{if(X){var H=se.getBuffered(X),F=[],I;for(I=0;I<H.length;I++)F.push({start:H.start(I),end:H.end(I)});return this.bufferedInfo(F,V,L)}}catch(j){}return{len:0,start:V,end:V,nextStart:void 0}},se.bufferedInfo=function(X,V,L){V=Math.max(0,V),X.sort(function(E,k){var C=E.start-k.start;return C||k.end-E.end});var H=[];if(L)for(var F=0;F<X.length;F++){var I=H.length;if(I){var j=H[I-1].end;X[F].start-j<L?X[F].end>j&&(H[I-1].end=X[F].end):H.push(X[F])}else H.push(X[F])}else H=X;for(var P=0,w,d=V,p=V,f=0;f<H.length;f++){var T=H[f].start,x=H[f].end;if(V+L>=T&&V<x)d=T,p=x,P=p-V;else if(V+L<T){w=T;break}}return{len:P,start:d||0,end:p||0,nextStart:w}},se.getBuffered=function(X){try{return X.buffered}catch(V){return ae.logger.log("failed to get media.buffered",V),K}},se}()},"./src/utils/cea-608-parser.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"Row",function(){return p}),z.d(re,"CaptionScreen",function(){return f});var ae=z("./src/utils/logger.ts"),K={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},M=function(m){var v=m;return K.hasOwnProperty(m)&&(v=K[m]),String.fromCharCode(v)},se=15,q=100,X={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},V={17:2,18:4,21:6,22:8,23:10,19:13,20:15},L={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},H={25:2,26:4,29:6,30:8,31:10,27:13,28:15},F=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],I;(function(b){b[b.ERROR=0]="ERROR",b[b.TEXT=1]="TEXT",b[b.WARNING=2]="WARNING",b[b.INFO=2]="INFO",b[b.DEBUG=3]="DEBUG",b[b.DATA=3]="DATA"})(I||(I={}));var j=function(){function b(){this.time=null,this.verboseLevel=I.ERROR}var m=b.prototype;return m.log=function(g,_){this.verboseLevel>=g&&ae.logger.log(this.time+" ["+g+"] "+_)},b}(),P=function(m){for(var v=[],g=0;g<m.length;g++)v.push(m[g].toString(16));return v},w=function(){function b(v,g,_,O,G){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=v||"white",this.underline=g||!1,this.italics=_||!1,this.background=O||"black",this.flash=G||!1}var m=b.prototype;return m.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},m.setStyles=function(g){for(var _=["foreground","underline","italics","background","flash"],O=0;O<_.length;O++){var G=_[O];g.hasOwnProperty(G)&&(this[G]=g[G])}},m.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},m.equals=function(g){return this.foreground===g.foreground&&this.underline===g.underline&&this.italics===g.italics&&this.background===g.background&&this.flash===g.flash},m.copy=function(g){this.foreground=g.foreground,this.underline=g.underline,this.italics=g.italics,this.background=g.background,this.flash=g.flash},m.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},b}(),d=function(){function b(v,g,_,O,G,Y){this.uchar=void 0,this.penState=void 0,this.uchar=v||" ",this.penState=new w(g,_,O,G,Y)}var m=b.prototype;return m.reset=function(){this.uchar=" ",this.penState.reset()},m.setChar=function(g,_){this.uchar=g,this.penState.copy(_)},m.setPenState=function(g){this.penState.copy(g)},m.equals=function(g){return this.uchar===g.uchar&&this.penState.equals(g.penState)},m.copy=function(g){this.uchar=g.uchar,this.penState.copy(g.penState)},m.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},b}(),p=function(){function b(v){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var g=0;g<q;g++)this.chars.push(new d);this.logger=v,this.pos=0,this.currPenState=new w}var m=b.prototype;return m.equals=function(g){for(var _=!0,O=0;O<q;O++)if(!this.chars[O].equals(g.chars[O])){_=!1;break}return _},m.copy=function(g){for(var _=0;_<q;_++)this.chars[_].copy(g.chars[_])},m.isEmpty=function(){for(var g=!0,_=0;_<q;_++)if(!this.chars[_].isEmpty()){g=!1;break}return g},m.setCursor=function(g){this.pos!==g&&(this.pos=g),this.pos<0?(this.logger.log(I.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>q&&(this.logger.log(I.DEBUG,"Too large cursor position "+this.pos),this.pos=q)},m.moveCursor=function(g){var _=this.pos+g;if(g>1)for(var O=this.pos+1;O<_+1;O++)this.chars[O].setPenState(this.currPenState);this.setCursor(_)},m.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},m.insertChar=function(g){g>=144&&this.backSpace();var _=M(g);if(this.pos>=q){this.logger.log(I.ERROR,"Cannot insert "+g.toString(16)+" ("+_+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(_,this.currPenState),this.moveCursor(1)},m.clearFromPos=function(g){var _;for(_=g;_<q;_++)this.chars[_].reset()},m.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},m.clearToEndOfRow=function(){this.clearFromPos(this.pos)},m.getTextString=function(){for(var g=[],_=!0,O=0;O<q;O++){var G=this.chars[O].uchar;G!==" "&&(_=!1),g.push(G)}return _?"":g.join("")},m.setPenStyles=function(g){this.currPenState.setStyles(g);var _=this.chars[this.pos];_.setPenState(this.currPenState)},b}(),f=function(){function b(v){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var g=0;g<se;g++)this.rows.push(new p(v));this.logger=v,this.currRow=se-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var m=b.prototype;return m.reset=function(){for(var g=0;g<se;g++)this.rows[g].clear();this.currRow=se-1},m.equals=function(g){for(var _=!0,O=0;O<se;O++)if(!this.rows[O].equals(g.rows[O])){_=!1;break}return _},m.copy=function(g){for(var _=0;_<se;_++)this.rows[_].copy(g.rows[_])},m.isEmpty=function(){for(var g=!0,_=0;_<se;_++)if(!this.rows[_].isEmpty()){g=!1;break}return g},m.backSpace=function(){var g=this.rows[this.currRow];g.backSpace()},m.clearToEndOfRow=function(){var g=this.rows[this.currRow];g.clearToEndOfRow()},m.insertChar=function(g){var _=this.rows[this.currRow];_.insertChar(g)},m.setPen=function(g){var _=this.rows[this.currRow];_.setPenStyles(g)},m.moveCursor=function(g){var _=this.rows[this.currRow];_.moveCursor(g)},m.setCursor=function(g){this.logger.log(I.INFO,"setCursor: "+g);var _=this.rows[this.currRow];_.setCursor(g)},m.setPAC=function(g){this.logger.log(I.INFO,"pacData = "+JSON.stringify(g));var _=g.row-1;if(this.nrRollUpRows&&_<this.nrRollUpRows-1&&(_=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==_){for(var O=0;O<se;O++)this.rows[O].clear();var G=this.currRow+1-this.nrRollUpRows,Y=this.lastOutputScreen;if(Y){var ee=Y.rows[G].cueStartTime,fe=this.logger.time;if(ee&&fe!==null&&ee<fe)for(var pe=0;pe<this.nrRollUpRows;pe++)this.rows[_-this.nrRollUpRows+pe+1].copy(Y.rows[G+pe])}}this.currRow=_;var xe=this.rows[this.currRow];if(g.indent!==null){var Ce=g.indent,be=Math.max(Ce-1,0);xe.setCursor(g.indent),g.color=xe.chars[be].penState.foreground}var Oe={foreground:g.color,underline:g.underline,italics:g.italics,background:"black",flash:!1};this.setPen(Oe)},m.setBkgData=function(g){this.logger.log(I.INFO,"bkgData = "+JSON.stringify(g)),this.backSpace(),this.setPen(g),this.insertChar(32)},m.setRollUpRows=function(g){this.nrRollUpRows=g},m.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(I.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(I.TEXT,this.getDisplayText());var g=this.currRow+1-this.nrRollUpRows,_=this.rows.splice(g,1)[0];_.clear(),this.rows.splice(this.currRow,0,_),this.logger.log(I.INFO,"Rolling up")},m.getDisplayText=function(g){g=g||!1;for(var _=[],O="",G=-1,Y=0;Y<se;Y++){var ee=this.rows[Y].getTextString();ee&&(G=Y+1,g?_.push("Row "+G+": '"+ee+"'"):_.push(ee.trim()))}return _.length>0&&(g?O="["+_.join(" | ")+"]":O=_.join(`
|
|
|
`)),O},m.getTextAndFormat=function(){return this.rows},b}(),T=function(){function b(v,g,_){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=v,this.outputFilter=g,this.mode=null,this.verbose=0,this.displayedMemory=new f(_),this.nonDisplayedMemory=new f(_),this.lastOutputScreen=new f(_),this.currRollUpRow=this.displayedMemory.rows[se-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=_}var m=b.prototype;return m.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[se-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},m.getHandler=function(){return this.outputFilter},m.setHandler=function(g){this.outputFilter=g},m.setPAC=function(g){this.writeScreen.setPAC(g)},m.setBkgData=function(g){this.writeScreen.setBkgData(g)},m.setMode=function(g){if(g===this.mode)return;this.mode=g,this.logger.log(I.INFO,"MODE="+g),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=g},m.insertChars=function(g){for(var _=0;_<g.length;_++)this.writeScreen.insertChar(g[_]);var O=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(I.INFO,O+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(I.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},m.ccRCL=function(){this.logger.log(I.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},m.ccBS=function(){if(this.logger.log(I.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},m.ccAOF=function(){},m.ccAON=function(){},m.ccDER=function(){this.logger.log(I.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},m.ccRU=function(g){this.logger.log(I.INFO,"RU("+g+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(g)},m.ccFON=function(){this.logger.log(I.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},m.ccRDC=function(){this.logger.log(I.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},m.ccTR=function(){this.logger.log(I.INFO,"TR"),this.setMode("MODE_TEXT")},m.ccRTD=function(){this.logger.log(I.INFO,"RTD"),this.setMode("MODE_TEXT")},m.ccEDM=function(){this.logger.log(I.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},m.ccCR=function(){this.logger.log(I.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},m.ccENM=function(){this.logger.log(I.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},m.ccEOC=function(){if(this.logger.log(I.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var g=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=g,this.writeScreen=this.nonDisplayedMemory,this.logger.log(I.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},m.ccTO=function(g){this.logger.log(I.INFO,"TO("+g+") - Tab Offset"),this.writeScreen.moveCursor(g)},m.ccMIDROW=function(g){var _={flash:!1};if(_.underline=g%2===1,_.italics=g>=46,_.italics)_.foreground="white";else{var O=Math.floor(g/2)-16,G=["white","green","blue","cyan","red","yellow","magenta"];_.foreground=G[O]}this.logger.log(I.INFO,"MIDROW: "+JSON.stringify(_)),this.writeScreen.setPen(_)},m.outputDataUpdate=function(g){g===void 0&&(g=!1);var _=this.logger.time;if(_===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=_:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,_,this.lastOutputScreen),g&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:_),this.lastOutputScreen.copy(this.displayedMemory))},m.cueSplitAtTime=function(g){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,g,this.displayedMemory),this.cueStartTime=g))},b}(),x=function(){function b(v,g,_){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var O=new j;this.channels=[null,new T(v,g,O),new T(v+1,_,O)],this.cmdHistory=C(),this.logger=O}var m=b.prototype;return m.getHandler=function(g){return this.channels[g].getHandler()},m.setHandler=function(g,_){this.channels[g].setHandler(_)},m.addData=function(g,_){var O,G,Y,ee=!1;this.logger.time=g;for(var fe=0;fe<_.length;fe+=2){if(G=_[fe]&127,Y=_[fe+1]&127,G===0&&Y===0)continue;if(this.logger.log(I.DATA,"["+P([_[fe],_[fe+1]])+"] -> ("+P([G,Y])+")"),O=this.parseCmd(G,Y),O||(O=this.parseMidrow(G,Y)),O||(O=this.parsePAC(G,Y)),O||(O=this.parseBackgroundAttributes(G,Y)),!O&&(ee=this.parseChars(G,Y),ee)){var pe=this.currentChannel;if(pe&&pe>0){var xe=this.channels[pe];xe.insertChars(ee)}else this.logger.log(I.WARNING,"No channel found yet. TEXT-MODE?")}!O&&!ee&&this.logger.log(I.WARNING,"Couldn't parse cleaned data "+P([G,Y])+" orig: "+P([_[fe],_[fe+1]]))}},m.parseCmd=function(g,_){var O=this.cmdHistory,G=(g===20||g===28||g===21||g===29)&&_>=32&&_<=47,Y=(g===23||g===31)&&_>=33&&_<=35;if(!(G||Y))return!1;if(k(g,_,O))return E(null,null,O),this.logger.log(I.DEBUG,"Repeated command ("+P([g,_])+") is dropped"),!0;var ee=g===20||g===21||g===23?1:2,fe=this.channels[ee];return g===20||g===21||g===28||g===29?_===32?fe.ccRCL():_===33?fe.ccBS():_===34?fe.ccAOF():_===35?fe.ccAON():_===36?fe.ccDER():_===37?fe.ccRU(2):_===38?fe.ccRU(3):_===39?fe.ccRU(4):_===40?fe.ccFON():_===41?fe.ccRDC():_===42?fe.ccTR():_===43?fe.ccRTD():_===44?fe.ccEDM():_===45?fe.ccCR():_===46?fe.ccENM():_===47&&fe.ccEOC():fe.ccTO(_-32),E(g,_,O),this.currentChannel=ee,!0},m.parseMidrow=function(g,_){var O=0;if((g===17||g===25)&&_>=32&&_<=47){if(g===17?O=1:O=2,O!==this.currentChannel)return this.logger.log(I.ERROR,"Mismatch channel in midrow parsing"),!1;var G=this.channels[O];return G?(G.ccMIDROW(_),this.logger.log(I.DEBUG,"MIDROW ("+P([g,_])+")"),!0):!1}return!1},m.parsePAC=function(g,_){var O,G=this.cmdHistory,Y=(g>=17&&g<=23||g>=25&&g<=31)&&_>=64&&_<=127,ee=(g===16||g===24)&&_>=64&&_<=95;if(!(Y||ee))return!1;if(k(g,_,G))return E(null,null,G),!0;var fe=g<=23?1:2;_>=64&&_<=95?O=fe===1?X[g]:L[g]:O=fe===1?V[g]:H[g];var pe=this.channels[fe];return pe?(pe.setPAC(this.interpretPAC(O,_)),E(g,_,G),this.currentChannel=fe,!0):!1},m.interpretPAC=function(g,_){var O,G={color:null,italics:!1,indent:null,underline:!1,row:g};return _>95?O=_-96:O=_-64,G.underline=(O&1)===1,O<=13?G.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(O/2)]:O<=15?(G.italics=!0,G.color="white"):G.indent=Math.floor((O-16)/2)*4,G},m.parseChars=function(g,_){var O,G=null,Y=null;if(g>=25?(O=2,Y=g-8):(O=1,Y=g),Y>=17&&Y<=19){var ee;Y===17?ee=_+80:Y===18?ee=_+112:ee=_+144,this.logger.log(I.INFO,"Special char '"+M(ee)+"' in channel "+O),G=[ee]}else g>=32&&g<=127&&(G=_===0?[g]:[g,_]);if(G){var fe=P(G);this.logger.log(I.DEBUG,"Char codes = "+fe.join(",")),E(g,_,this.cmdHistory)}return G},m.parseBackgroundAttributes=function(g,_){var O=(g===16||g===24)&&_>=32&&_<=47,G=(g===23||g===31)&&_>=45&&_<=47;if(!(O||G))return!1;var Y,ee={};g===16||g===24?(Y=Math.floor((_-32)/2),ee.background=F[Y],_%2===1&&(ee.background=ee.background+"_semi")):_===45?ee.background="transparent":(ee.foreground="black",_===47&&(ee.underline=!0));var fe=g<=23?1:2,pe=this.channels[fe];return pe.setBkgData(ee),E(g,_,this.cmdHistory),!0},m.reset=function(){for(var g=0;g<Object.keys(this.channels).length;g++){var _=this.channels[g];_&&_.reset()}this.cmdHistory=C()},m.cueSplitAtTime=function(g){for(var _=0;_<this.channels.length;_++){var O=this.channels[_];O&&O.cueSplitAtTime(g)}},b}();function E(b,m,v){v.a=b,v.b=m}function k(b,m,v){return v.a===b&&v.b===m}function C(){return{a:null,b:null}}re.default=x},"./src/utils/codecs.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"isCodecType",function(){return K}),z.d(re,"isCodecSupportedInMp4",function(){return M});var ae={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function K(se,q){var X=ae[q];return!!X&&X[se.slice(0,4)]===!0}function M(se,q){return MediaSource.isTypeSupported((q||"video")+'/mp4;codecs="'+se+'"')}},"./src/utils/cues.ts":function(ze,re,z){"use strict";z.r(re);var ae=z("./src/utils/vttparser.ts"),K=z("./src/utils/webvtt-parser.ts"),M=z("./src/utils/texttrack-utils.ts"),se=/\s/,q={newCue:function(V,L,H,F){for(var I=[],j,P,w,d,p,f=self.VTTCue||self.TextTrackCue,T=0;T<F.rows.length;T++)if(j=F.rows[T],w=!0,d=0,p="",!j.isEmpty()){for(var x=0;x<j.chars.length;x++)se.test(j.chars[x].uchar)&&w?d++:(p+=j.chars[x].uchar,w=!1);j.cueStartTime=L,L===H&&(H+=1e-4),d>=16?d--:d++;var E=Object(ae.fixLineBreaks)(p.trim()),k=Object(K.generateCueId)(L,H,E);(!V||!V.cues||!V.cues.getCueById(k))&&(P=new f(L,H,E),P.id=k,P.line=T+1,P.align="left",P.position=10+Math.min(80,Math.floor(d*8/32)*10),I.push(P))}return V&&I.length&&(I.sort(function(C,b){return C.line==="auto"||b.line==="auto"?0:C.line>8&&b.line>8?b.line-C.line:C.line-b.line}),I.forEach(function(C){return Object(M.addCueToTrack)(V,C)})),I}};re.default=q},"./src/utils/discontinuities.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"findFirstFragWithCC",function(){return se}),z.d(re,"shouldAlignOnDiscontinuities",function(){return q}),z.d(re,"findDiscontinuousReferenceFrag",function(){return X}),z.d(re,"adjustSlidingStart",function(){return L}),z.d(re,"alignStream",function(){return H}),z.d(re,"alignPDT",function(){return I}),z.d(re,"alignFragmentByPDTDelta",function(){return j}),z.d(re,"alignMediaPlaylistByPDT",function(){return P});var ae=z("./src/polyfills/number.ts"),K=z("./src/utils/logger.ts"),M=z("./src/controller/level-helper.ts");function se(w,d){for(var p=null,f=0,T=w.length;f<T;f++){var x=w[f];if(x&&x.cc===d){p=x;break}}return p}function q(w,d,p){return!!(d.details&&(p.endCC>p.startCC||w&&w.cc<p.startCC))}function X(w,d){var p=w.fragments,f=d.fragments;if(!f.length||!p.length){K.logger.log("No fragments to align");return}var T=se(p,f[0].cc);if(!T||T&&!T.startPTS){K.logger.log("No frag in previous level to align on");return}return T}function V(w,d){if(w){var p=w.start+d;w.start=w.startPTS=p,w.endPTS=p+w.duration}}function L(w,d){for(var p=d.fragments,f=0,T=p.length;f<T;f++)V(p[f],w);d.fragmentHint&&V(d.fragmentHint,w),d.alignedSliding=!0}function H(w,d,p){if(!d)return;F(w,p,d),!p.alignedSliding&&d.details&&I(p,d.details),!p.alignedSliding&&d.details&&!p.skippedSegments&&Object(M.adjustSliding)(d.details,p)}function F(w,d,p){if(q(w,p,d)){var f=X(p.details,d);f&&Object(ae.isFiniteNumber)(f.start)&&(K.logger.log("Adjusting PTS using last level due to CC increase within current level "+d.url),L(f.start,d))}}function I(w,d){if(!d.fragments.length||!w.hasProgramDateTime||!d.hasProgramDateTime)return;var p=d.fragments[0].programDateTime,f=w.fragments[0].programDateTime,T=(f-p)/1e3+d.fragments[0].start;T&&Object(ae.isFiniteNumber)(T)&&(K.logger.log("Adjusting PTS using programDateTime delta "+(f-p)+"ms, sliding:"+T.toFixed(3)+" "+w.url+" "),L(T,w))}function j(w,d){var p=w.programDateTime;if(!p)return;var f=(p-d)/1e3;w.start=w.startPTS=f,w.endPTS=f+w.duration}function P(w,d){if(!d.fragments.length||!w.hasProgramDateTime||!d.hasProgramDateTime)return;var p=d.fragments[0].programDateTime,f=d.fragments[0].start,T=p-f*1e3;w.fragments.forEach(function(x){j(x,T)}),w.fragmentHint&&j(w.fragmentHint,T),w.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ze,re,z){"use strict";z.r(re);var ae=z("./src/utils/ewma.ts"),K=function(){function M(q,X,V){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=V,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new ae.default(q),this.fast_=new ae.default(X)}var se=M.prototype;return se.update=function(X,V){var L=this.slow_,H=this.fast_;this.slow_.halfLife!==X&&(this.slow_=new ae.default(X,L.getEstimate(),L.getTotalWeight())),this.fast_.halfLife!==V&&(this.fast_=new ae.default(V,H.getEstimate(),H.getTotalWeight()))},se.sample=function(X,V){X=Math.max(X,this.minDelayMs_);var L=8*V,H=X/1e3,F=L/H;this.fast_.sample(H,F),this.slow_.sample(H,F)},se.canEstimate=function(){var X=this.fast_;return X&&X.getTotalWeight()>=this.minWeight_},se.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},se.destroy=function(){},M}();re.default=K},"./src/utils/ewma.ts":function(ze,re,z){"use strict";z.r(re);var ae=function(){function K(se,q,X){q===void 0&&(q=0),X===void 0&&(X=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=se,this.alpha_=se?Math.exp(Math.log(.5)/se):0,this.estimate_=q,this.totalWeight_=X}var M=K.prototype;return M.sample=function(q,X){var V=Math.pow(this.alpha_,q);this.estimate_=X*(1-V)+V*this.estimate_,this.totalWeight_+=q},M.getTotalWeight=function(){return this.totalWeight_},M.getEstimate=function(){if(this.alpha_){var q=1-Math.pow(this.alpha_,this.totalWeight_);if(q)return this.estimate_/q}return this.estimate_},K}();re.default=ae},"./src/utils/fetch-loader.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"fetchSupported",function(){return j});var ae=z("./src/polyfills/number.ts"),K=z("./src/loader/load-stats.ts"),M=z("./src/demux/chunk-cache.ts");function se(f,T){f.prototype=Object.create(T.prototype),f.prototype.constructor=f,H(f,T)}function q(f){var T=typeof Map=="function"?new Map:void 0;return q=function(E){if(E===null||!L(E))return E;if(typeof E!="function")throw new TypeError("Super expression must either be null or a function");if(typeof T!="undefined"){if(T.has(E))return T.get(E);T.set(E,k)}function k(){return X(E,arguments,F(this).constructor)}return k.prototype=Object.create(E.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),H(k,E)},q(f)}function X(f,T,x){return V()?X=Reflect.construct:X=function(k,C,b){var m=[null];m.push.apply(m,C);var v=Function.bind.apply(k,m),g=new v;return b&&H(g,b.prototype),g},X.apply(null,arguments)}function V(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(f){return!1}}function L(f){return Function.toString.call(f).indexOf("[native code]")!==-1}function H(f,T){return H=Object.setPrototypeOf||function(E,k){return E.__proto__=k,E},H(f,T)}function F(f){return F=Object.setPrototypeOf?Object.getPrototypeOf:function(x){return x.__proto__||Object.getPrototypeOf(x)},F(f)}function I(){return I=Object.assign||function(f){for(var T=1;T<arguments.length;T++){var x=arguments[T];for(var E in x)Object.prototype.hasOwnProperty.call(x,E)&&(f[E]=x[E])}return f},I.apply(this,arguments)}function j(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(f){}return!1}var P=function(){function f(x){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=x.fetchSetup||d,this.controller=new self.AbortController,this.stats=new K.LoadStats}var T=f.prototype;return T.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},T.abortInternal=function(){var E=this.response;(!E||!E.ok)&&(this.stats.aborted=!0,this.controller.abort())},T.abort=function(){var E;this.abortInternal(),(E=this.callbacks)!==null&&E!==void 0&&E.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},T.load=function(E,k,C){var b=this,m=this.stats;if(m.loading.start)throw new Error("Loader can only be used once.");m.loading.start=self.performance.now();var v=w(E,this.controller.signal),g=C.onProgress,_=E.responseType==="arraybuffer",O=_?"byteLength":"length";this.context=E,this.config=k,this.callbacks=C,this.request=this.fetchSetup(E,v),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){b.abortInternal(),C.onTimeout(m,E,b.response)},k.timeout),self.fetch(this.request).then(function(G){if(b.response=b.loader=G,!G.ok){var Y=G.status,ee=G.statusText;throw new p(ee||"fetch, bad network response",Y,G)}return m.loading.first=Math.max(self.performance.now(),m.loading.start),m.total=parseInt(G.headers.get("Content-Length")||"0"),g&&Object(ae.isFiniteNumber)(k.highWaterMark)?b.loadProgressively(G,m,E,k.highWaterMark,g):_?G.arrayBuffer():G.text()}).then(function(G){var Y=b.response;self.clearTimeout(b.requestTimeout),m.loading.end=Math.max(self.performance.now(),m.loading.first),m.loaded=m.total=G[O];var ee={url:Y.url,data:G};g&&!Object(ae.isFiniteNumber)(k.highWaterMark)&&g(m,E,G,Y),C.onSuccess(ee,m,E,Y)}).catch(function(G){if(self.clearTimeout(b.requestTimeout),m.aborted)return;var Y=G.code||0;C.onError({code:Y,text:G.message},E,G.details)})},T.getCacheAge=function(){var E=null;if(this.response){var k=this.response.headers.get("age");E=k?parseFloat(k):null}return E},T.loadProgressively=function(E,k,C,b,m){b===void 0&&(b=0);var v=new M.default,g=E.body.getReader(),_=function O(){return g.read().then(function(G){if(G.done)return v.dataLength&&m(k,C,v.flush(),E),Promise.resolve(new ArrayBuffer(0));var Y=G.value,ee=Y.length;return k.loaded+=ee,ee<b||v.dataLength?(v.push(Y),v.dataLength>=b&&m(k,C,v.flush(),E)):m(k,C,Y,E),O()}).catch(function(){return Promise.reject()})};return _()},f}();function w(f,T){var x={method:"GET",mode:"cors",credentials:"same-origin",signal:T,headers:new self.Headers(I({},f.headers))};return f.rangeEnd&&x.headers.set("Range","bytes="+f.rangeStart+"-"+String(f.rangeEnd-1)),x}function d(f,T){return new self.Request(f.url,T)}var p=function(f){se(T,f);function T(x,E,k){var C;return C=f.call(this,x)||this,C.code=void 0,C.details=void 0,C.code=E,C.details=k,C}return T}(q(Error));re.default=P},"./src/utils/imsc1-ttml-parser.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"IMSC1_CODEC",function(){return L}),z.d(re,"parseIMSC1",function(){return j});var ae=z("./src/utils/mp4-tools.ts"),K=z("./src/utils/vttparser.ts"),M=z("./src/utils/vttcue.ts"),se=z("./src/demux/id3.ts"),q=z("./src/utils/timescale-conversion.ts"),X=z("./src/utils/webvtt-parser.ts");function V(){return V=Object.assign||function(b){for(var m=1;m<arguments.length;m++){var v=arguments[m];for(var g in v)Object.prototype.hasOwnProperty.call(v,g)&&(b[g]=v[g])}return b},V.apply(this,arguments)}var L="stpp.ttml.im1t",H=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,F=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,I={left:"start",center:"center",right:"end",start:"start",end:"end"};function j(b,m,v,g,_){var O=Object(ae.findBox)(new Uint8Array(b),["mdat"]);if(O.length===0){_(new Error("Could not parse IMSC1 mdat"));return}var G=O[0],Y=Object(se.utf8ArrayToStr)(new Uint8Array(b,G.start,G.end-G.start)),ee=Object(q.toTimescaleFromScale)(m,1,v);try{g(P(Y,ee))}catch(fe){_(fe)}}function P(b,m){var v=new DOMParser,g=v.parseFromString(b,"text/xml"),_=g.getElementsByTagName("tt")[0];if(!_)throw new Error("Invalid ttml");var O={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},G=Object.keys(O).reduce(function(xe,Ce){return xe[Ce]=_.getAttribute("ttp:"+Ce)||O[Ce],xe},{}),Y=_.getAttribute("xml:space")!=="preserve",ee=d(w(_,"styling","style")),fe=d(w(_,"layout","region")),pe=w(_,"body","[begin]");return[].map.call(pe,function(xe){var Ce=p(xe,Y);if(!Ce||!xe.hasAttribute("begin"))return null;var be=E(xe.getAttribute("begin"),G),Oe=E(xe.getAttribute("dur"),G),We=E(xe.getAttribute("end"),G);if(be===null)throw x(xe);if(We===null){if(Oe===null)throw x(xe);We=be+Oe}var Me=new M.default(be-m,We-m,Ce);Me.id=Object(X.generateCueId)(Me.startTime,Me.endTime,Me.text);var ct=fe[xe.getAttribute("region")],Ge=ee[xe.getAttribute("style")];Me.position=10,Me.size=80;var Je=f(ct,Ge),Xe=Je.textAlign;if(Xe){var Ye=I[Xe];Ye&&(Me.lineAlign=Ye),Me.align=Xe}return V(Me,Je),Me}).filter(function(xe){return xe!==null})}function w(b,m,v){var g=b.getElementsByTagName(m)[0];return g?[].slice.call(g.querySelectorAll(v)):[]}function d(b){return b.reduce(function(m,v){var g=v.getAttribute("xml:id");return g&&(m[g]=v),m},{})}function p(b,m){return[].slice.call(b.childNodes).reduce(function(v,g,_){var O;return g.nodeName==="br"&&_?v+`
|
|
|
`:(O=g.childNodes)!==null&&O!==void 0&&O.length?p(g,m):m?v+g.textContent.trim().replace(/\s+/g," "):v+g.textContent},"")}function f(b,m){var v="http://www.w3.org/ns/ttml#styling",g=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return g.reduce(function(_,O){var G=T(m,v,O)||T(b,v,O);return G&&(_[O]=G),_},{})}function T(b,m,v){return b.hasAttributeNS(m,v)?b.getAttributeNS(m,v):null}function x(b){return new Error("Could not parse ttml timestamp "+b)}function E(b,m){if(!b)return null;var v=Object(K.parseTimeStamp)(b);return v===null&&(H.test(b)?v=k(b,m):F.test(b)&&(v=C(b,m))),v}function k(b,m){var v=H.exec(b),g=(v[4]|0)+(v[5]|0)/m.subFrameRate;return(v[1]|0)*3600+(v[2]|0)*60+(v[3]|0)+g/m.frameRate}function C(b,m){var v=F.exec(b),g=Number(v[1]),_=v[2];switch(_){case"h":return g*3600;case"m":return g*60;case"ms":return g*1e3;case"f":return g/m.frameRate;case"t":return g/m.tickRate}return g}},"./src/utils/logger.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"enableLogs",function(){return X}),z.d(re,"logger",function(){return V});var ae=function(){},K={trace:ae,debug:ae,log:ae,warn:ae,info:ae,error:ae},M=K;function se(L){var H=self.console[L];return H?H.bind(self.console,"["+L+"] >"):ae}function q(L){for(var H=arguments.length,F=new Array(H>1?H-1:0),I=1;I<H;I++)F[I-1]=arguments[I];F.forEach(function(j){M[j]=L[j]?L[j].bind(L):se(j)})}function X(L){if(self.console&&L===!0||typeof L=="object"){q(L,"debug","log","info","warn","error");try{M.log()}catch(H){M=K}}else M=K}var V=M},"./src/utils/mediakeys-helper.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"KeySystems",function(){return ae}),z.d(re,"requestMediaKeySystemAccess",function(){return K});var ae;(function(M){M.WIDEVINE="com.widevine.alpha",M.PLAYREADY="com.microsoft.playready"})(ae||(ae={}));var K=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"getMediaSource",function(){return ae});function ae(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"bin2str",function(){return q}),z.d(re,"readUint16",function(){return X}),z.d(re,"readUint32",function(){return V}),z.d(re,"writeUint32",function(){return L}),z.d(re,"findBox",function(){return H}),z.d(re,"parseSegmentIndex",function(){return F}),z.d(re,"parseInitSegment",function(){return I}),z.d(re,"getStartDTS",function(){return j}),z.d(re,"getDuration",function(){return P}),z.d(re,"computeRawDurationFromSamples",function(){return w}),z.d(re,"offsetStartDTS",function(){return d}),z.d(re,"segmentValidRange",function(){return p}),z.d(re,"appendUint8Array",function(){return f});var ae=z("./src/utils/typed-array.ts"),K=z("./src/loader/fragment.ts"),M=Math.pow(2,32)-1,se=[].push;function q(T){return String.fromCharCode.apply(null,T)}function X(T,x){"data"in T&&(x+=T.start,T=T.data);var E=T[x]<<8|T[x+1];return E<0?65536+E:E}function V(T,x){"data"in T&&(x+=T.start,T=T.data);var E=T[x]<<24|T[x+1]<<16|T[x+2]<<8|T[x+3];return E<0?4294967296+E:E}function L(T,x,E){"data"in T&&(x+=T.start,T=T.data),T[x]=E>>24,T[x+1]=E>>16&255,T[x+2]=E>>8&255,T[x+3]=E&255}function H(T,x){var E=[];if(!x.length)return E;var k,C,b;"data"in T?(k=T.data,C=T.start,b=T.end):(k=T,C=0,b=k.byteLength);for(var m=C;m<b;){var v=V(k,m),g=q(k.subarray(m+4,m+8)),_=v>1?m+v:b;if(g===x[0])if(x.length===1)E.push({data:k,start:m+8,end:_});else{var O=H({data:k,start:m+8,end:_},x.slice(1));O.length&&se.apply(E,O)}m=_}return E}function F(T){var x=H(T,["moov"]),E=x[0],k=E?E.end:null,C=H(T,["sidx"]);if(!C||!C[0])return null;var b=[],m=C[0],v=m.data[0],g=v===0?8:16,_=V(m,g);g+=4;var O=0,G=0;v===0?g+=8:g+=16,g+=2;var Y=m.end+G,ee=X(m,g);g+=2;for(var fe=0;fe<ee;fe++){var pe=g,xe=V(m,pe);pe+=4;var Ce=xe&2147483647,be=(xe&2147483648)>>>31;if(be===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Oe=V(m,pe);pe+=4,b.push({referenceSize:Ce,subsegmentDuration:Oe,info:{duration:Oe/_,start:Y,end:Y+Ce-1}}),Y+=Ce,pe+=4,g=pe}return{earliestPresentationTime:O,timescale:_,version:v,referencesCount:ee,references:b,moovEndOffset:k}}function I(T){for(var x=[],E=H(T,["moov","trak"]),k=0;k<E.length;k++){var C=E[k],b=H(C,["tkhd"])[0];if(b){var m=b.data[b.start],v=m===0?12:20,g=V(b,v),_=H(C,["mdia","mdhd"])[0];if(_){m=_.data[_.start],v=m===0?12:20;var O=V(_,v),G=H(C,["mdia","hdlr"])[0];if(G){var Y=q(G.data.subarray(G.start+8,G.start+12)),ee={soun:K.ElementaryStreamTypes.AUDIO,vide:K.ElementaryStreamTypes.VIDEO}[Y];if(ee){var fe=H(C,["mdia","minf","stbl","stsd"])[0],pe=void 0;fe&&(pe=q(fe.data.subarray(fe.start+12,fe.start+16))),x[g]={timescale:O,type:ee},x[ee]={timescale:O,id:g,codec:pe}}}}}}var xe=H(T,["moov","mvex","trex"]);return xe.forEach(function(Ce){var be=V(Ce,4),Oe=x[be];Oe&&(Oe.default={duration:V(Ce,12),flags:V(Ce,20)})}),x}function j(T,x){return H(x,["moof","traf"]).reduce(function(E,k){var C=H(k,["tfdt"])[0],b=C.data[C.start],m=H(k,["tfhd"]).reduce(function(v,g){var _=V(g,4),O=T[_];if(O){var G=V(C,4);b===1&&(G*=Math.pow(2,32),G+=V(C,8));var Y=O.timescale||9e4,ee=G/Y;if(isFinite(ee)&&(v===null||ee<v))return ee}return v},null);return m!==null&&isFinite(m)&&(E===null||m<E)?m:E},null)||0}function P(T,x){for(var E=0,k=0,C=0,b=H(T,["moof","traf"]),m=0;m<b.length;m++){var v=b[m],g=H(v,["tfhd"])[0],_=V(g,4),O=x[_];if(!O)continue;var G=O.default,Y=V(g,0)|(G==null?void 0:G.flags),ee=G==null?void 0:G.duration;Y&8&&(Y&2?ee=V(g,12):ee=V(g,8));for(var fe=O.timescale||9e4,pe=H(v,["trun"]),xe=0;xe<pe.length;xe++){if(ee){var Ce=V(pe[xe],4);E=ee*Ce}else E=w(pe[xe]);O.type===K.ElementaryStreamTypes.VIDEO?k+=E/fe:O.type===K.ElementaryStreamTypes.AUDIO&&(C+=E/fe)}}if(k===0&&C===0){var be=F(T);if(be!=null&&be.references)return be.references.reduce(function(Oe,We){return Oe+We.info.duration||0},0)}return k||C}function w(T){var x=V(T,0),E=8;x&1&&(E+=4),x&4&&(E+=4);for(var k=0,C=V(T,4),b=0;b<C;b++){if(x&256){var m=V(T,E);k+=m,E+=4}x&512&&(E+=4),x&1024&&(E+=4),x&2048&&(E+=4)}return k}function d(T,x,E){H(x,["moof","traf"]).forEach(function(k){H(k,["tfhd"]).forEach(function(C){var b=V(C,4),m=T[b];if(!m)return;var v=m.timescale||9e4;H(k,["tfdt"]).forEach(function(g){var _=g.data[g.start],O=V(g,4);if(_===0)L(g,4,O-E*v);else{O*=Math.pow(2,32),O+=V(g,8),O-=E*v,O=Math.max(O,0);var G=Math.floor(O/(M+1)),Y=Math.floor(O%(M+1));L(g,4,G),L(g,8,Y)}})})})}function p(T){var x={valid:null,remainder:null},E=H(T,["moof"]);if(E){if(E.length<2)return x.remainder=T,x}else return x;var k=E[E.length-1];return x.valid=Object(ae.sliceUint8)(T,0,k.start-8),x.remainder=Object(ae.sliceUint8)(T,k.start-8),x}function f(T,x){var E=new Uint8Array(T.length+x.length);return E.set(T),E.set(x,T.length),E}},"./src/utils/output-filter.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return ae});var ae=function(){function K(se,q){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=se,this.trackName=q}var M=K.prototype;return M.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},M.newCue=function(q,X,V){(this.startTime===null||this.startTime>q)&&(this.startTime=q),this.endTime=X,this.screen=V,this.timelineController.createCaptionsTrack(this.trackName)},M.reset=function(){this.cueRanges=[]},K}()},"./src/utils/texttrack-utils.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"sendAddTrackEvent",function(){return K}),z.d(re,"addCueToTrack",function(){return M}),z.d(re,"clearCurrentCues",function(){return se}),z.d(re,"removeCuesInRange",function(){return q}),z.d(re,"getCuesInRange",function(){return V});var ae=z("./src/utils/logger.ts");function K(L,H){var F;try{F=new Event("addtrack")}catch(I){F=document.createEvent("Event"),F.initEvent("addtrack",!1,!1)}F.track=L,H.dispatchEvent(F)}function M(L,H){var F=L.mode;if(F==="disabled"&&(L.mode="hidden"),L.cues&&!L.cues.getCueById(H.id))try{if(L.addCue(H),!L.cues.getCueById(H.id))throw new Error("addCue is failed for: "+H)}catch(j){ae.logger.debug("[texttrack-utils]: "+j);var I=new self.TextTrackCue(H.startTime,H.endTime,H.text);I.id=H.id,L.addCue(I)}F==="disabled"&&(L.mode=F)}function se(L){var H=L.mode;if(H==="disabled"&&(L.mode="hidden"),L.cues)for(var F=L.cues.length;F--;)L.removeCue(L.cues[F]);H==="disabled"&&(L.mode=H)}function q(L,H,F){var I=L.mode;if(I==="disabled"&&(L.mode="hidden"),L.cues&&L.cues.length>0)for(var j=V(L.cues,H,F),P=0;P<j.length;P++)L.removeCue(j[P]);I==="disabled"&&(L.mode=I)}function X(L,H){if(H<L[0].startTime)return 0;var F=L.length-1;if(H>L[F].endTime)return-1;for(var I=0,j=F;I<=j;){var P=Math.floor((j+I)/2);if(H<L[P].startTime)j=P-1;else if(H>L[P].startTime&&I<F)I=P+1;else return P}return L[I].startTime-H<H-L[j].startTime?I:j}function V(L,H,F){var I=[],j=X(L,H);if(j>-1)for(var P=j,w=L.length;P<w;P++){var d=L[P];if(d.startTime>=H&&d.endTime<=F)I.push(d);else if(d.startTime>F)return I}return I}},"./src/utils/time-ranges.ts":function(ze,re,z){"use strict";z.r(re);var ae={toString:function(M){for(var se="",q=M.length,X=0;X<q;X++)se+="["+M.start(X).toFixed(3)+","+M.end(X).toFixed(3)+"]";return se}};re.default=ae},"./src/utils/timescale-conversion.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"toTimescaleFromBase",function(){return K}),z.d(re,"toTimescaleFromScale",function(){return M}),z.d(re,"toMsFromMpegTsClock",function(){return se}),z.d(re,"toMpegTsClockFromTimescale",function(){return q});var ae=9e4;function K(X,V,L,H){L===void 0&&(L=1),H===void 0&&(H=!1);var F=X*V*L;return H?Math.round(F):F}function M(X,V,L,H){return L===void 0&&(L=1),H===void 0&&(H=!1),K(X,V,1/L,H)}function se(X,V){return V===void 0&&(V=!1),K(X,1e3,1/ae,V)}function q(X,V){return V===void 0&&(V=1),K(X,ae,1/V)}},"./src/utils/typed-array.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"sliceUint8",function(){return ae});function ae(K,M,se){return Uint8Array.prototype.slice?K.slice(M,se):new Uint8Array(Array.prototype.slice.call(K,M,se))}},"./src/utils/vttcue.ts":function(ze,re,z){"use strict";z.r(re),re.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var ae=["","lr","rl"],K=["start","middle","end","left","right"];function M(L,H){if(typeof H!="string")return!1;if(!Array.isArray(L))return!1;var F=H.toLowerCase();return~L.indexOf(F)?F:!1}function se(L){return M(ae,L)}function q(L){return M(K,L)}function X(L){for(var H=arguments.length,F=new Array(H>1?H-1:0),I=1;I<H;I++)F[I-1]=arguments[I];for(var j=1;j<arguments.length;j++){var P=arguments[j];for(var w in P)L[w]=P[w]}return L}function V(L,H,F){var I=this,j={enumerable:!0};I.hasBeenReset=!1;var P="",w=!1,d=L,p=H,f=F,T=null,x="",E=!0,k="auto",C="start",b=50,m="middle",v=50,g="middle";Object.defineProperty(I,"id",X({},j,{get:function(){return P},set:function(O){P=""+O}})),Object.defineProperty(I,"pauseOnExit",X({},j,{get:function(){return w},set:function(O){w=!!O}})),Object.defineProperty(I,"startTime",X({},j,{get:function(){return d},set:function(O){if(typeof O!="number")throw new TypeError("Start time must be set to a number.");d=O,this.hasBeenReset=!0}})),Object.defineProperty(I,"endTime",X({},j,{get:function(){return p},set:function(O){if(typeof O!="number")throw new TypeError("End time must be set to a number.");p=O,this.hasBeenReset=!0}})),Object.defineProperty(I,"text",X({},j,{get:function(){return f},set:function(O){f=""+O,this.hasBeenReset=!0}})),Object.defineProperty(I,"region",X({},j,{get:function(){return T},set:function(O){T=O,this.hasBeenReset=!0}})),Object.defineProperty(I,"vertical",X({},j,{get:function(){return x},set:function(O){var G=se(O);if(G===!1)throw new SyntaxError("An invalid or illegal string was specified.");x=G,this.hasBeenReset=!0}})),Object.defineProperty(I,"snapToLines",X({},j,{get:function(){return E},set:function(O){E=!!O,this.hasBeenReset=!0}})),Object.defineProperty(I,"line",X({},j,{get:function(){return k},set:function(O){if(typeof O!="number"&&O!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");k=O,this.hasBeenReset=!0}})),Object.defineProperty(I,"lineAlign",X({},j,{get:function(){return C},set:function(O){var G=q(O);if(!G)throw new SyntaxError("An invalid or illegal string was specified.");C=G,this.hasBeenReset=!0}})),Object.defineProperty(I,"position",X({},j,{get:function(){return b},set:function(O){if(O<0||O>100)throw new Error("Position must be between 0 and 100.");b=O,this.hasBeenReset=!0}})),Object.defineProperty(I,"positionAlign",X({},j,{get:function(){return m},set:function(O){var G=q(O);if(!G)throw new SyntaxError("An invalid or illegal string was specified.");m=G,this.hasBeenReset=!0}})),Object.defineProperty(I,"size",X({},j,{get:function(){return v},set:function(O){if(O<0||O>100)throw new Error("Size must be between 0 and 100.");v=O,this.hasBeenReset=!0}})),Object.defineProperty(I,"align",X({},j,{get:function(){return g},set:function(O){var G=q(O);if(!G)throw new SyntaxError("An invalid or illegal string was specified.");g=G,this.hasBeenReset=!0}})),I.displayState=void 0}return V.prototype.getCueAsHTML=function(){var L=self.WebVTT;return L.convertCueToDOMTree(self,this.text)},V}()},"./src/utils/vttparser.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"parseTimeStamp",function(){return M}),z.d(re,"fixLineBreaks",function(){return H}),z.d(re,"VTTParser",function(){return F});var ae=z("./src/utils/vttcue.ts"),K=function(){function I(){}var j=I.prototype;return j.decode=function(w,d){if(!w)return"";if(typeof w!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(w))},I}();function M(I){function j(w,d,p,f){return(w|0)*3600+(d|0)*60+(p|0)+parseFloat(f||0)}var P=I.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return P?parseFloat(P[2])>59?j(P[2],P[3],0,P[4]):j(P[1],P[2],P[3],P[4]):null}var se=function(){function I(){this.values=Object.create(null)}var j=I.prototype;return j.set=function(w,d){!this.get(w)&&d!==""&&(this.values[w]=d)},j.get=function(w,d,p){return p?this.has(w)?this.values[w]:d[p]:this.has(w)?this.values[w]:d},j.has=function(w){return w in this.values},j.alt=function(w,d,p){for(var f=0;f<p.length;++f)if(d===p[f]){this.set(w,d);break}},j.integer=function(w,d){/^-?\d+$/.test(d)&&this.set(w,parseInt(d,10))},j.percent=function(w,d){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(d)){var p=parseFloat(d);if(p>=0&&p<=100)return this.set(w,p),!0}return!1},I}();function q(I,j,P,w){var d=w?I.split(w):[I];for(var p in d){if(typeof d[p]!="string")continue;var f=d[p].split(P);if(f.length!==2)continue;var T=f[0],x=f[1];j(T,x)}}var X=new ae.default(0,0,""),V=X.align==="middle"?"middle":"center";function L(I,j,P){var w=I;function d(){var T=M(I);if(T===null)throw new Error("Malformed timestamp: "+w);return I=I.replace(/^[^\sa-zA-Z-]+/,""),T}function p(T,x){var E=new se;q(T,function(b,m){var v;switch(b){case"region":for(var g=P.length-1;g>=0;g--)if(P[g].id===m){E.set(b,P[g].region);break}break;case"vertical":E.alt(b,m,["rl","lr"]);break;case"line":v=m.split(","),E.integer(b,v[0]),E.percent(b,v[0])&&E.set("snapToLines",!1),E.alt(b,v[0],["auto"]),v.length===2&&E.alt("lineAlign",v[1],["start",V,"end"]);break;case"position":v=m.split(","),E.percent(b,v[0]),v.length===2&&E.alt("positionAlign",v[1],["start",V,"end","line-left","line-right","auto"]);break;case"size":E.percent(b,m);break;case"align":E.alt(b,m,["start",V,"end","left","right"]);break}},/:/,/\s/),x.region=E.get("region",null),x.vertical=E.get("vertical","");var k=E.get("line","auto");k==="auto"&&X.line===-1&&(k=-1),x.line=k,x.lineAlign=E.get("lineAlign","start"),x.snapToLines=E.get("snapToLines",!0),x.size=E.get("size",100),x.align=E.get("align",V);var C=E.get("position","auto");C==="auto"&&X.position===50&&(C=x.align==="start"||x.align==="left"?0:x.align==="end"||x.align==="right"?100:50),x.position=C}function f(){I=I.replace(/^\s+/,"")}if(f(),j.startTime=d(),f(),I.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+w);I=I.substr(3),f(),j.endTime=d(),f(),p(I,j)}function H(I){return I.replace(/<br(?: \/)?>/gi,`
|
|
|
`)}var F=function(){function I(){this.state="INITIAL",this.buffer="",this.decoder=new K,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var j=I.prototype;return j.parse=function(w){var d=this;w&&(d.buffer+=d.decoder.decode(w,{stream:!0}));function p(){var C=d.buffer,b=0;for(C=H(C);b<C.length&&C[b]!=="\r"&&C[b]!==`
|
|
|
`;)++b;var m=C.substr(0,b);return C[b]==="\r"&&++b,C[b]===`
|
|
|
`&&++b,d.buffer=C.substr(b),m}function f(C){q(C,function(b,m){},/:/)}try{var T="";if(d.state==="INITIAL"){if(!/\r\n|\n/.test(d.buffer))return this;T=p();var x=T.match(/^()?WEBVTT([ \t].*)?$/);if(!x||!x[0])throw new Error("Malformed WebVTT signature.");d.state="HEADER"}for(var E=!1;d.buffer;){if(!/\r\n|\n/.test(d.buffer))return this;E?E=!1:T=p();switch(d.state){case"HEADER":/:/.test(T)?f(T):T||(d.state="ID");continue;case"NOTE":T||(d.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(T)){d.state="NOTE";break}if(!T)continue;if(d.cue=new ae.default(0,0,""),d.state="CUE",T.indexOf("-->")===-1){d.cue.id=T;continue}case"CUE":if(!d.cue){d.state="BADCUE";continue}try{L(T,d.cue,d.regionList)}catch(C){d.cue=null,d.state="BADCUE";continue}d.state="CUETEXT";continue;case"CUETEXT":{var k=T.indexOf("-->")!==-1;if(!T||k&&(E=!0)){d.oncue&&d.cue&&d.oncue(d.cue),d.cue=null,d.state="ID";continue}if(d.cue===null)continue;d.cue.text&&(d.cue.text+=`
|
|
|
`),d.cue.text+=T}continue;case"BADCUE":T||(d.state="ID")}}}catch(C){d.state==="CUETEXT"&&d.cue&&d.oncue&&d.oncue(d.cue),d.cue=null,d.state=d.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},j.flush=function(){var w=this;try{if((w.cue||w.state==="HEADER")&&(w.buffer+=`
|
|
|
|
|
|
`,w.parse()),w.state==="INITIAL"||w.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(d){w.onparsingerror&&w.onparsingerror(d)}return w.onflush&&w.onflush(),this},I}()},"./src/utils/webvtt-parser.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"generateCueId",function(){return F}),z.d(re,"parseWebVTT",function(){return j});var ae=z("./src/polyfills/number.ts"),K=z("./src/utils/vttparser.ts"),M=z("./src/demux/id3.ts"),se=z("./src/utils/timescale-conversion.ts"),q=z("./src/remux/mp4-remuxer.ts"),X=/\r\n|\n\r|\n|\r/g,V=function(w,d,p){return p===void 0&&(p=0),w.substr(p,d.length)===d},L=function(w){var d=parseInt(w.substr(-3)),p=parseInt(w.substr(-6,2)),f=parseInt(w.substr(-9,2)),T=w.length>9?parseInt(w.substr(0,w.indexOf(":"))):0;if(!Object(ae.isFiniteNumber)(d)||!Object(ae.isFiniteNumber)(p)||!Object(ae.isFiniteNumber)(f)||!Object(ae.isFiniteNumber)(T))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+w);return d+=1e3*p,d+=60*1e3*f,d+=60*60*1e3*T,d},H=function(w){for(var d=5381,p=w.length;p;)d=d*33^w.charCodeAt(--p);return(d>>>0).toString()};function F(P,w,d){return H(P.toString())+H(w.toString())+H(d)}var I=function(w,d,p){var f=w[d],T=w[f.prevCC];if(!T||!T.new&&f.new){w.ccOffset=w.presentationOffset=f.start,f.new=!1;return}for(;(x=T)!==null&&x!==void 0&&x.new;){var x;w.ccOffset+=f.start-T.start,f.new=!1,f=T,T=w[f.prevCC]}w.presentationOffset=p};function j(P,w,d,p,f,T,x,E){var k=new K.VTTParser,C=Object(M.utf8ArrayToStr)(new Uint8Array(P)).trim().replace(X,`
|
|
|
`).split(`
|
|
|
`),b=[],m=Object(se.toMpegTsClockFromTimescale)(w,d),v="00:00.000",g=0,_=0,O,G=!0,Y=!1;k.oncue=function(ee){var fe=p[f],pe=p.ccOffset,xe=(g-m)/9e4;if(fe!=null&&fe.new&&(_!==void 0?pe=p.ccOffset=fe.start:I(p,f,xe)),xe&&(pe=xe-p.presentationOffset),Y){var Ce=ee.endTime-ee.startTime,be=Object(q.normalizePts)((ee.startTime+pe-_)*9e4,T*9e4)/9e4;ee.startTime=be,ee.endTime=be+Ce}var Oe=ee.text.trim();ee.text=decodeURIComponent(encodeURIComponent(Oe)),ee.id||(ee.id=F(ee.startTime,ee.endTime,Oe)),ee.endTime>0&&b.push(ee)},k.onparsingerror=function(ee){O=ee},k.onflush=function(){if(O){E(O);return}x(b)},C.forEach(function(ee){if(G)if(V(ee,"X-TIMESTAMP-MAP=")){G=!1,Y=!0,ee.substr(16).split(",").forEach(function(fe){V(fe,"LOCAL:")?v=fe.substr(6):V(fe,"MPEGTS:")&&(g=parseInt(fe.substr(7)))});try{_=L(v)/1e3}catch(fe){Y=!1,O=fe}return}else ee===""&&(G=!1);k.parse(ee+`
|
|
|
`)}),k.flush()}},"./src/utils/xhr-loader.ts":function(ze,re,z){"use strict";z.r(re);var ae=z("./src/utils/logger.ts"),K=z("./src/loader/load-stats.ts"),M=/^age:\s*[\d.]+\s*$/m,se=function(){function q(V){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=V?V.xhrSetup:null,this.stats=new K.LoadStats,this.retryDelay=0}var X=q.prototype;return X.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},X.abortInternal=function(){var L=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),L&&(L.onreadystatechange=null,L.onprogress=null,L.readyState!==4&&(this.stats.aborted=!0,L.abort()))},X.abort=function(){var L;this.abortInternal(),(L=this.callbacks)!==null&&L!==void 0&&L.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},X.load=function(L,H,F){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=L,this.config=H,this.callbacks=F,this.retryDelay=H.retryDelay,this.loadInternal()},X.loadInternal=function(){var L=this.config,H=this.context;if(!L)return;var F=this.loader=new self.XMLHttpRequest,I=this.stats;I.loading.first=0,I.loaded=0;var j=this.xhrSetup;try{if(j)try{j(F,H.url)}catch(d){F.open("GET",H.url,!0),j(F,H.url)}F.readyState||F.open("GET",H.url,!0);var P=this.context.headers;if(P)for(var w in P)F.setRequestHeader(w,P[w])}catch(d){this.callbacks.onError({code:F.status,text:d.message},H,F);return}H.rangeEnd&&F.setRequestHeader("Range","bytes="+H.rangeStart+"-"+(H.rangeEnd-1)),F.onreadystatechange=this.readystatechange.bind(this),F.onprogress=this.loadprogress.bind(this),F.responseType=H.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),L.timeout),F.send()},X.readystatechange=function(){var L=this.context,H=this.loader,F=this.stats;if(!L||!H)return;var I=H.readyState,j=this.config;if(F.aborted)return;if(I>=2)if(self.clearTimeout(this.requestTimeout),F.loading.first===0&&(F.loading.first=Math.max(self.performance.now(),F.loading.start)),I===4){H.onreadystatechange=null,H.onprogress=null;var P=H.status;if(P>=200&&P<300){F.loading.end=Math.max(self.performance.now(),F.loading.first);var w,d;if(L.responseType==="arraybuffer"?(w=H.response,d=w.byteLength):(w=H.responseText,d=w.length),F.loaded=F.total=d,!this.callbacks)return;var p=this.callbacks.onProgress;if(p&&p(F,L,w,H),!this.callbacks)return;var f={url:H.responseURL,data:w};this.callbacks.onSuccess(f,F,L,H)}else F.retry>=j.maxRetry||P>=400&&P<499?(ae.logger.error(P+" while loading "+L.url),this.callbacks.onError({code:P,text:H.statusText},L,H)):(ae.logger.warn(P+" while loading "+L.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,j.maxRetryDelay),F.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),j.timeout)},X.loadtimeout=function(){ae.logger.warn("timeout while loading "+this.context.url);var L=this.callbacks;L&&(this.abortInternal(),L.onTimeout(this.stats,this.context,this.loader))},X.loadprogress=function(L){var H=this.stats;H.loaded=L.loaded,L.lengthComputable&&(H.total=L.total)},X.getCacheAge=function(){var L=null;if(this.loader&&M.test(this.loader.getAllResponseHeaders())){var H=this.loader.getResponseHeader("age");L=H?parseFloat(H):null}return L},q}();re.default=se}}).default})},vHTk:function(Pr,dr,He){Pr.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},yyNy:function(Pr,dr,He){"use strict";(function(ze){He.d(dr,"a",function(){return Nye}),He.d(dr,"b",function(){return jye});var re=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof ze!="undefined"?ze:typeof self!="undefined"?self:{};function z(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ae(e){var t={exports:{}};return e(t,t.exports),t.exports}var K,M,se=function(e){return e&&e.Math==Math&&e},q=se(typeof globalThis=="object"&&globalThis)||se(typeof window=="object"&&window)||se(typeof self=="object"&&self)||se(typeof re=="object"&&re)||function(){return this}()||Function("return this")(),X=Function.prototype,V=X.apply,L=X.bind,H=X.call,F=typeof Reflect=="object"&&Reflect.apply||(L?H.bind(V):function(){return H.apply(V,arguments)}),I=Function.prototype,j=I.bind,P=I.call,w=j&&j.bind(P),d=j?function(e){return e&&w(P,e)}:function(e){return e&&function(){return P.apply(e,arguments)}},p=function(e){return typeof e=="function"},f=function(e){try{return!!e()}catch(t){return!0}},T=!f(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),x=Function.prototype.call,E=x.bind?x.bind(x):function(){return x.apply(x,arguments)},k={}.propertyIsEnumerable,C=Object.getOwnPropertyDescriptor,b=C&&!k.call({1:2},1)?function(e){var t=C(this,e);return!!t&&t.enumerable}:k,m={f:b},v=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},g=d({}.toString),_=d("".slice),O=function(e){return _(g(e),8,-1)},G=q.Object,Y=d("".split),ee=f(function(){return!G("z").propertyIsEnumerable(0)})?function(e){return O(e)=="String"?Y(e,""):G(e)}:G,fe=q.TypeError,pe=function(e){if(e==null)throw fe("Can't call method on "+e);return e},xe=function(e){return ee(pe(e))},Ce=function(e){return typeof e=="object"?e!==null:p(e)},be={},Oe=function(e){return p(e)?e:void 0},We=function(e,t){return arguments.length<2?Oe(be[e])||Oe(q[e]):be[e]&&be[e][t]||q[e]&&q[e][t]},Me=d({}.isPrototypeOf),ct=We("navigator","userAgent")||"",Ge=q.process,Je=q.Deno,Xe=Ge&&Ge.versions||Je&&Je.version,Ye=Xe&&Xe.v8;Ye&&(M=(K=Ye.split("."))[0]>0&&K[0]<4?1:+(K[0]+K[1])),!M&&ct&&(!(K=ct.match(/Edge\/(\d+)/))||K[1]>=74)&&(K=ct.match(/Chrome\/(\d+)/))&&(M=+K[1]);var ke,Z=M,A=!!Object.getOwnPropertySymbols&&!f(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Z&&Z<41}),R=A&&!Symbol.sham&&typeof Symbol.iterator=="symbol",J=q.Object,oe=R?function(e){return typeof e=="symbol"}:function(e){var t=We("Symbol");return p(t)&&Me(t.prototype,J(e))},$=q.String,Se=function(e){try{return $(e)}catch(t){return"Object"}},je=q.TypeError,$e=function(e){if(p(e))return e;throw je(Se(e)+" is not a function")},st=function(e,t){var r=e[t];return r==null?void 0:$e(r)},Ke=q.TypeError,it=Object.defineProperty,nt=q["__core-js_shared__"]||function(e,t){try{it(q,e,{value:t,configurable:!0,writable:!0})}catch(r){q[e]=t}return t}("__core-js_shared__",{}),bt=ae(function(e){(e.exports=function(t,r){return nt[t]||(nt[t]=r!==void 0?r:{})})("versions",[]).push({version:"3.19.3",mode:"pure",copyright:"\xA9 2021 Denis Pushkarev (zloirock.ru)"})}),_t=q.Object,Lt=function(e){return _t(pe(e))},Ot=d({}.hasOwnProperty),xt=Object.hasOwn||function(e,t){return Ot(Lt(e),t)},jt=0,Nt=Math.random(),mt=d(1 .toString),Ht=function(e){return"Symbol("+(e===void 0?"":e)+")_"+mt(++jt+Nt,36)},Vt=bt("wks"),ge=q.Symbol,ie=ge&&ge.for,ne=R?ge:ge&&ge.withoutSetter||Ht,ce=function(e){if(!xt(Vt,e)||!A&&typeof Vt[e]!="string"){var t="Symbol."+e;A&&xt(ge,e)?Vt[e]=ge[e]:Vt[e]=R&&ie?ie(t):ne(t)}return Vt[e]},me=q.TypeError,le=ce("toPrimitive"),ue=function(e,t){if(!Ce(e)||oe(e))return e;var r,n=st(e,le);if(n){if(t===void 0&&(t="default"),r=E(n,e,t),!Ce(r)||oe(r))return r;throw me("Can't convert object to primitive value")}return t===void 0&&(t="number"),function(i,o){var a,s;if(o==="string"&&p(a=i.toString)&&!Ce(s=E(a,i)))return s;if(p(a=i.valueOf)&&!Ce(s=E(a,i)))return s;if(o!=="string"&&p(a=i.toString)&&!Ce(s=E(a,i)))return s;throw Ke("Can't convert object to primitive value")}(e,t)},ye=function(e){var t=ue(e,"string");return oe(t)?t:t+""},we=q.document,Ne=Ce(we)&&Ce(we.createElement),Ie=function(e){return Ne?we.createElement(e):{}},lt=!T&&!f(function(){return Object.defineProperty(Ie("div"),"a",{get:function(){return 7}}).a!=7}),Pt=Object.getOwnPropertyDescriptor,Zt=T?Pt:function(e,t){if(e=xe(e),t=ye(t),lt)try{return Pt(e,t)}catch(r){}if(xt(e,t))return v(!E(m.f,e,t),e[t])},$t={f:Zt},Kr=/#|\.prototype\./,Jt=function(e,t){var r=jn[Yt(e)];return r==Kn||r!=Qr&&(p(t)?f(t):!!t)},Yt=Jt.normalize=function(e){return String(e).replace(Kr,".").toLowerCase()},jn=Jt.data={},Qr=Jt.NATIVE="N",Kn=Jt.POLYFILL="P",Dn=Jt,Br=d(d.bind),eo=function(e,t){return $e(e),t===void 0?e:Br?Br(e,t):function(){return e.apply(t,arguments)}},qu=q.String,to=q.TypeError,$n=function(e){if(Ce(e))return e;throw to(qu(e)+" is not an object")},ec=q.TypeError,Cl=Object.defineProperty,Sa=T?Cl:function(e,t,r){if($n(e),t=ye(t),$n(r),lt)try{return Cl(e,t,r)}catch(n){}if("get"in r||"set"in r)throw ec("Accessors not supported");return"value"in r&&(e[t]=r.value),e},ro={f:Sa},ri=T?function(e,t,r){return ro.f(e,t,v(1,r))}:function(e,t,r){return e[t]=r,e},a1=$t.f,li=function(e){var t=function(r,n,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,n)}return new e(r,n,i)}return F(e,this,arguments)};return t.prototype=e.prototype,t},wr=function(e,t){var r,n,i,o,a,s,l,u,c=e.target,h=e.global,S=e.stat,y=e.proto,W=h?q:S?q[c]:(q[c]||{}).prototype,B=h?be:be[c]||ri(be,c,{})[c],N=B.prototype;for(i in t)r=!Dn(h?i:c+(S?".":"#")+i,e.forced)&&W&&xt(W,i),a=B[i],r&&(s=e.noTargetGet?(u=a1(W,i))&&u.value:W[i]),o=r&&s?s:t[i],r&&typeof a==typeof o||(l=e.bind&&r?eo(o,q):e.wrap&&r?li(o):y&&p(o)?d(o):o,(e.sham||o&&o.sham||a&&a.sham)&&ri(l,"sham",!0),ri(B,i,l),y&&(xt(be,n=c+"Prototype")||ri(be,n,{}),ri(be[n],i,o),e.real&&N&&!N[i]&&ri(N,i,o)))},Ai=bt("keys"),Lr=function(e){return Ai[e]||(Ai[e]=Ht(e))},Fi=!f(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),dn=Lr("IE_PROTO"),Tl=q.Object,ui=Tl.prototype,Al=Fi?Tl.getPrototypeOf:function(e){var t=Lt(e);if(xt(t,dn))return t[dn];var r=t.constructor;return p(r)&&t instanceof r?r.prototype:t instanceof Tl?ui:null},s1=q.String,l1=q.TypeError,Yg=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=d(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(n){}return function(n,i){return $n(n),function(o){if(typeof o=="object"||p(o))return o;throw l1("Can't set "+s1(o)+" as a prototype")}(i),t?e(n,i):n.__proto__=i,n}}():void 0),KH=Math.ceil,$H=Math.floor,u1=function(e){var t=+e;return t!=t||t===0?0:(t>0?$H:KH)(t)},XH=Math.max,YH=Math.min,c1=function(e,t){var r=u1(e);return r<0?XH(r+t,0):YH(r,t)},ZH=Math.min,ih=function(e){return(t=e.length)>0?ZH(u1(t),9007199254740991):0;var t},ER=function(e){return function(t,r,n){var i,o=xe(t),a=ih(o),s=c1(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},JH={includes:ER(!0),indexOf:ER(!1)},oh={},QH=JH.indexOf,xR=d([].push),SR=function(e,t){var r,n=xe(e),i=0,o=[];for(r in n)!xt(oh,r)&&xt(n,r)&&xR(o,r);for(;t.length>i;)xt(n,r=t[i++])&&(~QH(o,r)||xR(o,r));return o},Zg=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],qH=Zg.concat("length","prototype"),ez=Object.getOwnPropertyNames||function(e){return SR(e,qH)},d1={f:ez},Jg={f:Object.getOwnPropertySymbols},tz=d([].concat),rz=We("Reflect","ownKeys")||function(e){var t=d1.f($n(e)),r=Jg.f;return r?tz(t,r(e)):t},h1=Object.keys||function(e){return SR(e,Zg)},nz=T?Object.defineProperties:function(e,t){$n(e);for(var r,n=xe(t),i=h1(t),o=i.length,a=0;o>a;)ro.f(e,r=i[a++],n[r]);return e},iz=We("document","documentElement"),wR=Lr("IE_PROTO"),f1=function(){},CR=function(e){return"<script>"+e+"</script>"},TR=function(e){e.write(CR("")),e.close();var t=e.parentWindow.Object;return e=null,t},Qg=function(){try{ke=new ActiveXObject("htmlfile")}catch(n){}var e,t;Qg=typeof document!="undefined"?document.domain&&ke?TR(ke):((t=Ie("iframe")).style.display="none",iz.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(CR("document.F=Object")),e.close(),e.F):TR(ke);for(var r=Zg.length;r--;)delete Qg.prototype[Zg[r]];return Qg()};oh[wR]=!0;var wa=Object.create||function(e,t){var r;return e!==null?(f1.prototype=$n(e),r=new f1,f1.prototype=null,r[wR]=e):r=Qg(),t===void 0?r:nz(r,t)},p1=function(e,t,r){var n=ye(t);n in e?ro.f(e,n,v(0,r)):e[n]=r},oz=q.Array,az=Math.max,AR=function(e,t,r){for(var n=ih(e),i=c1(t,n),o=c1(r===void 0?n:r,n),a=oz(az(o-i,0)),s=0;i<o;i++,s++)p1(a,s,e[i]);return a.length=s,a},sz=d("".replace),lz=d("".split),uz=d([].join),g1=String(Error("zxcasd").stack),DR=/\n\s*at [^:]*:[^\n]*/,cz=DR.test(g1),dz=/@[^\n]*\n/.test(g1)&&!/zxcasd/.test(g1),hz=function(e,t){if(typeof e!="string")return e;if(cz)for(;t--;)e=sz(e,DR,"");else if(dz)return uz(AR(lz(e,`
|
|
|
`),t),`
|
|
|
`);return e},fz=function(e,t){Ce(t)&&"cause"in t&&ri(e,"cause",t.cause)},Ca={},pz=ce("iterator"),gz=Array.prototype,OR={};OR[ce("toStringTag")]="z";var v1=String(OR)==="[object z]",vz=ce("toStringTag"),mz=q.Object,yz=O(function(){return arguments}())=="Arguments",ah=v1?O:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=function(i,o){try{return i[o]}catch(a){}}(t=mz(e),vz))=="string"?r:yz?O(t):(n=O(t))=="Object"&&p(t.callee)?"Arguments":n},bz=ce("iterator"),_R=function(e){if(e!=null)return st(e,bz)||st(e,"@@iterator")||Ca[ah(e)]},Ez=q.TypeError,RR=function(e,t,r){var n,i;$n(e);try{if(!(n=st(e,"return"))){if(t==="throw")throw r;return r}n=E(n,e)}catch(o){i=!0,n=o}if(t==="throw")throw r;if(i)throw n;return $n(n),r},xz=q.TypeError,qg=function(e,t){this.stopped=e,this.result=t},kR=qg.prototype,Sz=function(e,t,r){var n,i,o,a,s,l,u,c=r&&r.that,h=!(!r||!r.AS_ENTRIES),S=!(!r||!r.IS_ITERATOR),y=!(!r||!r.INTERRUPTED),W=eo(t,c),B=function(U){return n&&RR(n,"normal",U),new qg(!0,U)},N=function(U){return h?($n(U),y?W(U[0],U[1],B):W(U[0],U[1])):y?W(U,B):W(U)};if(S)n=e;else{if(!(i=_R(e)))throw xz(Se(e)+" is not iterable");if(function(U){return U!==void 0&&(Ca.Array===U||gz[pz]===U)}(i)){for(o=0,a=ih(e);a>o;o++)if((s=N(e[o]))&&Me(kR,s))return s;return new qg(!1)}n=function(U,D){var Q=arguments.length<2?_R(U):D;if($e(Q))return $n(E(Q,U));throw Ez(Se(U)+" is not iterable")}(e,i)}for(l=n.next;!(u=E(l,n)).done;){try{s=N(u.value)}catch(U){RR(n,"throw",U)}if(typeof s=="object"&&s&&Me(kR,s))return s}return new qg(!1)},wz=q.String,sh=function(e){if(ah(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return wz(e)},Cz=function(e,t){return e===void 0?arguments.length<2?"":t:sh(e)},Tz=!f(function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",v(1,7)),e.stack!==7)}),Az=ce("toStringTag"),ev=q.Error,Dz=[].push,lh=function(e,t){var r,n=arguments.length>2?arguments[2]:void 0,i=Me(m1,this);Yg?r=Yg(new ev(void 0),i?Al(this):m1):(r=i?this:wa(m1),ri(r,Az,"Error")),ri(r,"message",Cz(t,"")),Tz&&ri(r,"stack",hz(r.stack,1)),fz(r,n);var o=[];return Sz(e,Dz,{that:o}),ri(r,"errors",o),r};Yg?Yg(lh,ev):function(e,t){for(var r=rz(t),n=ro.f,i=$t.f,o=0;o<r.length;o++){var a=r[o];xt(e,a)||n(e,a,i(t,a))}}(lh,ev);var m1=lh.prototype=wa(ev.prototype,{constructor:v(1,lh),message:v(1,""),name:v(1,"AggregateError")});wr({global:!0},{AggregateError:lh});var Oz=d(Function.toString);p(nt.inspectSource)||(nt.inspectSource=function(e){return Oz(e)});var tv,uh,rv,LR=nt.inspectSource,PR=q.WeakMap,_z=p(PR)&&/native code/.test(LR(PR)),y1=q.TypeError,Rz=q.WeakMap;if(_z||nt.state){var Dl=nt.state||(nt.state=new Rz),kz=d(Dl.get),IR=d(Dl.has),Lz=d(Dl.set);tv=function(e,t){if(IR(Dl,e))throw new y1("Object already initialized");return t.facade=e,Lz(Dl,e,t),t},uh=function(e){return kz(Dl,e)||{}},rv=function(e){return IR(Dl,e)}}else{var tc=Lr("state");oh[tc]=!0,tv=function(e,t){if(xt(e,tc))throw new y1("Object already initialized");return t.facade=e,ri(e,tc,t),t},uh=function(e){return xt(e,tc)?e[tc]:{}},rv=function(e){return xt(e,tc)}}var Qa,MR,BR,rc={set:tv,get:uh,has:rv,enforce:function(e){return rv(e)?uh(e):tv(e,{})},getterFor:function(e){return function(t){var r;if(!Ce(t)||(r=uh(t)).type!==e)throw y1("Incompatible receiver, "+e+" required");return r}}},FR=Function.prototype,Pz=T&&Object.getOwnPropertyDescriptor,b1=xt(FR,"name"),Iz={EXISTS:b1,PROPER:b1&&function(){}.name==="something",CONFIGURABLE:b1&&(!T||T&&Pz(FR,"name").configurable)},nc=function(e,t,r,n){n&&n.enumerable?e[t]=r:ri(e,t,r)},E1=ce("iterator"),NR=!1;[].keys&&("next"in(BR=[].keys())?(MR=Al(Al(BR)))!==Object.prototype&&(Qa=MR):NR=!0);var Mz=Qa==null||f(function(){var e={};return Qa[E1].call(e)!==e});Qa=Mz?{}:wa(Qa),p(Qa[E1])||nc(Qa,E1,function(){return this});var jR={IteratorPrototype:Qa,BUGGY_SAFARI_ITERATORS:NR},Bz=v1?{}.toString:function(){return"[object "+ah(this)+"]"},Fz=ro.f,UR=ce("toStringTag"),nv=function(e,t,r,n){if(e){var i=r?e:e.prototype;xt(i,UR)||Fz(i,UR,{configurable:!0,value:t}),n&&!v1&&ri(i,"toString",Bz)}},Nz=jR.IteratorPrototype,jz=function(){return this},Uz=Iz.PROPER,iv=jR.BUGGY_SAFARI_ITERATORS,x1=ce("iterator"),Hz=function(){return this},HR=function(e,t,r,n,i,o,a){!function(U,D,Q,te){var he=D+" Iterator";U.prototype=wa(Nz,{next:v(+!te,Q)}),nv(U,he,!1,!0),Ca[he]=jz}(r,t,n);var s,l,u,c=function(U){if(U===i&&B)return B;if(!iv&&U in y)return y[U];switch(U){case"keys":case"values":case"entries":return function(){return new r(this,U)}}return function(){return new r(this)}},h=t+" Iterator",S=!1,y=e.prototype,W=y[x1]||y["@@iterator"]||i&&y[i],B=!iv&&W||c(i),N=t=="Array"&&y.entries||W;if(N&&(s=Al(N.call(new e)))!==Object.prototype&&s.next&&(nv(s,h,!0,!0),Ca[h]=Hz),Uz&&i=="values"&&W&&W.name!=="values"&&(S=!0,B=function(){return E(W,this)}),i)if(l={values:c("values"),keys:o?B:c("keys"),entries:c("entries")},a)for(u in l)(iv||S||!(u in y))&&nc(y,u,l[u]);else wr({target:t,proto:!0,forced:iv||S},l);return a&&y[x1]!==B&&nc(y,x1,B,{name:i}),Ca[t]=B,l},zz=rc.set,Wz=rc.getterFor("Array Iterator");HR(Array,"Array",function(e,t){zz(this,{type:"Array Iterator",target:xe(e),index:0,kind:t})},function(){var e=Wz(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):r=="keys"?{value:n,done:!1}:r=="values"?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values"),Ca.Arguments=Ca.Array;var Gz=d("".charAt),zR=d("".charCodeAt),Vz=d("".slice),WR=function(e){return function(t,r){var n,i,o=sh(pe(t)),a=u1(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=zR(o,a))<55296||n>56319||a+1===s||(i=zR(o,a+1))<56320||i>57343?e?Gz(o,a):n:e?Vz(o,a,a+2):i-56320+(n-55296<<10)+65536}},Kz={codeAt:WR(!1),charAt:WR(!0)}.charAt,$z=rc.set,Xz=rc.getterFor("String Iterator");HR(String,"String",function(e){$z(this,{type:"String Iterator",string:sh(e),index:0})},function(){var e,t=Xz(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=Kz(r,n),t.index+=e.length,{value:e,done:!1})});var Yz=be.AggregateError,GR=ce("toStringTag");for(var S1 in{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}){var VR=q[S1],w1=VR&&VR.prototype;w1&&ah(w1)!==GR&&ri(w1,GR,S1),Ca[S1]=Ca.Array}var qa,ov,Zz=Yz,av=function(e){return e&&e.Math==Math&&e},nr=av(typeof globalThis=="object"&&globalThis)||av(typeof window=="object"&&window)||av(typeof self=="object"&&self)||av(typeof re=="object"&&re)||function(){return this}()||Function("return this")(),Xn=function(e){try{return!!e()}catch(t){return!0}},$o=!Xn(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),ch=Function.prototype.call,Yn=ch.bind?ch.bind(ch):function(){return ch.apply(ch,arguments)},KR={}.propertyIsEnumerable,$R=Object.getOwnPropertyDescriptor,Jz=$R&&!KR.call({1:2},1)?function(e){var t=$R(this,e);return!!t&&t.enumerable}:KR,Qz={f:Jz},es=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},XR=Function.prototype,C1=XR.bind,T1=XR.call,qz=C1&&C1.bind(T1),Gr=C1?function(e){return e&&qz(T1,e)}:function(e){return e&&function(){return T1.apply(e,arguments)}},eW=Gr({}.toString),tW=Gr("".slice),Ol=function(e){return tW(eW(e),8,-1)},A1=nr.Object,rW=Gr("".split),YR=Xn(function(){return!A1("z").propertyIsEnumerable(0)})?function(e){return Ol(e)=="String"?rW(e,""):A1(e)}:A1,nW=nr.TypeError,sv=function(e){if(e==null)throw nW("Can't call method on "+e);return e},ic=function(e){return YR(sv(e))},On=function(e){return typeof e=="function"},Ao=function(e){return typeof e=="object"?e!==null:On(e)},iW=function(e){return On(e)?e:void 0},dh=function(e,t){return arguments.length<2?iW(nr[e]):nr[e]&&nr[e][t]},lv=Gr({}.isPrototypeOf),D1=dh("navigator","userAgent")||"",ZR=nr.process,JR=nr.Deno,QR=ZR&&ZR.versions||JR&&JR.version,qR=QR&&QR.v8;qR&&(ov=(qa=qR.split("."))[0]>0&&qa[0]<4?1:+(qa[0]+qa[1])),!ov&&D1&&(!(qa=D1.match(/Edge\/(\d+)/))||qa[1]>=74)&&(qa=D1.match(/Chrome\/(\d+)/))&&(ov=+qa[1]);var ek=ov,O1=!!Object.getOwnPropertySymbols&&!Xn(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ek&&ek<41}),_1=O1&&!Symbol.sham&&typeof Symbol.iterator=="symbol",oW=nr.Object,R1=_1?function(e){return typeof e=="symbol"}:function(e){var t=dh("Symbol");return On(t)&&lv(t.prototype,oW(e))},aW=nr.String,k1=function(e){try{return aW(e)}catch(t){return"Object"}},sW=nr.TypeError,L1=function(e){if(On(e))return e;throw sW(k1(e)+" is not a function")},hh=function(e,t){var r=e[t];return r==null?void 0:L1(r)},lW=nr.TypeError,uW=Object.defineProperty,P1=function(e,t){try{uW(nr,e,{value:t,configurable:!0,writable:!0})}catch(r){nr[e]=t}return t},ts=nr["__core-js_shared__"]||P1("__core-js_shared__",{}),I1=ae(function(e){(e.exports=function(t,r){return ts[t]||(ts[t]=r!==void 0?r:{})})("versions",[]).push({version:"3.19.3",mode:"global",copyright:"\xA9 2021 Denis Pushkarev (zloirock.ru)"})}),cW=nr.Object,M1=function(e){return cW(sv(e))},dW=Gr({}.hasOwnProperty),Di=Object.hasOwn||function(e,t){return dW(M1(e),t)},hW=0,fW=Math.random(),pW=Gr(1 .toString),tk=function(e){return"Symbol("+(e===void 0?"":e)+")_"+pW(++hW+fW,36)},fh=I1("wks"),_l=nr.Symbol,rk=_l&&_l.for,gW=_1?_l:_l&&_l.withoutSetter||tk,xi=function(e){if(!Di(fh,e)||!O1&&typeof fh[e]!="string"){var t="Symbol."+e;O1&&Di(_l,e)?fh[e]=_l[e]:fh[e]=_1&&rk?rk(t):gW(t)}return fh[e]},vW=nr.TypeError,mW=xi("toPrimitive"),yW=function(e,t){if(!Ao(e)||R1(e))return e;var r,n=hh(e,mW);if(n){if(t===void 0&&(t="default"),r=Yn(n,e,t),!Ao(r)||R1(r))return r;throw vW("Can't convert object to primitive value")}return t===void 0&&(t="number"),function(i,o){var a,s;if(o==="string"&&On(a=i.toString)&&!Ao(s=Yn(a,i)))return s;if(On(a=i.valueOf)&&!Ao(s=Yn(a,i)))return s;if(o!=="string"&&On(a=i.toString)&&!Ao(s=Yn(a,i)))return s;throw lW("Can't convert object to primitive value")}(e,t)},B1=function(e){var t=yW(e,"string");return R1(t)?t:t+""},F1=nr.document,bW=Ao(F1)&&Ao(F1.createElement),N1=function(e){return bW?F1.createElement(e):{}},nk=!$o&&!Xn(function(){return Object.defineProperty(N1("div"),"a",{get:function(){return 7}}).a!=7}),ik=Object.getOwnPropertyDescriptor,EW=$o?ik:function(e,t){if(e=ic(e),t=B1(t),nk)try{return ik(e,t)}catch(r){}if(Di(e,t))return es(!Yn(Qz.f,e,t),e[t])},j1={f:EW},xW=nr.String,SW=nr.TypeError,Ni=function(e){if(Ao(e))return e;throw SW(xW(e)+" is not an object")},wW=nr.TypeError,ok=Object.defineProperty,CW=$o?ok:function(e,t,r){if(Ni(e),t=B1(t),Ni(r),nk)try{return ok(e,t,r)}catch(n){}if("get"in r||"set"in r)throw wW("Accessors not supported");return"value"in r&&(e[t]=r.value),e},oc={f:CW},Si=$o?function(e,t,r){return oc.f(e,t,es(1,r))}:function(e,t,r){return e[t]=r,e},TW=Gr(Function.toString);On(ts.inspectSource)||(ts.inspectSource=function(e){return TW(e)});var uv,ph,cv,U1=ts.inspectSource,ak=nr.WeakMap,AW=On(ak)&&/native code/.test(U1(ak)),sk=I1("keys"),H1=function(e){return sk[e]||(sk[e]=tk(e))},z1={},W1=nr.TypeError,DW=nr.WeakMap;if(AW||ts.state){var Rl=ts.state||(ts.state=new DW),OW=Gr(Rl.get),lk=Gr(Rl.has),_W=Gr(Rl.set);uv=function(e,t){if(lk(Rl,e))throw new W1("Object already initialized");return t.facade=e,_W(Rl,e,t),t},ph=function(e){return OW(Rl,e)||{}},cv=function(e){return lk(Rl,e)}}else{var ac=H1("state");z1[ac]=!0,uv=function(e,t){if(Di(e,ac))throw new W1("Object already initialized");return t.facade=e,Si(e,ac,t),t},ph=function(e){return Di(e,ac)?e[ac]:{}},cv=function(e){return Di(e,ac)}}var kl={set:uv,get:ph,has:cv,enforce:function(e){return cv(e)?ph(e):uv(e,{})},getterFor:function(e){return function(t){var r;if(!Ao(t)||(r=ph(t)).type!==e)throw W1("Incompatible receiver, "+e+" required");return r}}},uk=Function.prototype,RW=$o&&Object.getOwnPropertyDescriptor,G1=Di(uk,"name"),V1={EXISTS:G1,PROPER:G1&&function(){}.name==="something",CONFIGURABLE:G1&&(!$o||$o&&RW(uk,"name").configurable)},rs=ae(function(e){var t=V1.CONFIGURABLE,r=kl.get,n=kl.enforce,i=String(String).split("String");(e.exports=function(o,a,s,l){var u,c=!!l&&!!l.unsafe,h=!!l&&!!l.enumerable,S=!!l&&!!l.noTargetGet,y=l&&l.name!==void 0?l.name:a;On(s)&&(String(y).slice(0,7)==="Symbol("&&(y="["+String(y).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!Di(s,"name")||t&&s.name!==y)&&Si(s,"name",y),(u=n(s)).source||(u.source=i.join(typeof y=="string"?y:""))),o!==nr?(c?!S&&o[a]&&(h=!0):delete o[a],h?o[a]=s:Si(o,a,s)):h?o[a]=s:P1(a,s)})(Function.prototype,"toString",function(){return On(this)&&r(this).source||U1(this)})}),kW=Math.ceil,LW=Math.floor,K1=function(e){var t=+e;return t!=t||t===0?0:(t>0?LW:kW)(t)},PW=Math.max,IW=Math.min,$1=function(e,t){var r=K1(e);return r<0?PW(r+t,0):IW(r,t)},MW=Math.min,ck=function(e){return e>0?MW(K1(e),9007199254740991):0},dv=function(e){return ck(e.length)},dk=function(e){return function(t,r,n){var i,o=ic(t),a=dv(o),s=$1(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},BW={includes:dk(!0),indexOf:dk(!1)}.indexOf,hk=Gr([].push),fk=function(e,t){var r,n=ic(e),i=0,o=[];for(r in n)!Di(z1,r)&&Di(n,r)&&hk(o,r);for(;t.length>i;)Di(n,r=t[i++])&&(~BW(o,r)||hk(o,r));return o},hv=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],FW=hv.concat("length","prototype"),NW=Object.getOwnPropertyNames||function(e){return fk(e,FW)},jW={f:NW},UW={f:Object.getOwnPropertySymbols},HW=Gr([].concat),zW=dh("Reflect","ownKeys")||function(e){var t=jW.f(Ni(e)),r=UW.f;return r?HW(t,r(e)):t},pk=function(e,t){for(var r=zW(t),n=oc.f,i=j1.f,o=0;o<r.length;o++){var a=r[o];Di(e,a)||n(e,a,i(t,a))}},WW=/#|\.prototype\./,gh=function(e,t){var r=VW[GW(e)];return r==$W||r!=KW&&(On(t)?Xn(t):!!t)},GW=gh.normalize=function(e){return String(e).replace(WW,".").toLowerCase()},VW=gh.data={},KW=gh.NATIVE="N",$W=gh.POLYFILL="P",XW=gh,YW=j1.f,vh=function(e,t){var r,n,i,o,a,s=e.target,l=e.global,u=e.stat;if(r=l?nr:u?nr[s]||P1(s,{}):(nr[s]||{}).prototype)for(n in t){if(o=t[n],i=e.noTargetGet?(a=YW(r,n))&&a.value:r[n],!XW(l?n:s+(u?".":"#")+n,e.forced)&&i!==void 0){if(typeof o==typeof i)continue;pk(o,i)}(e.sham||i&&i.sham)&&Si(o,"sham",!0),rs(r,n,o,e)}},gk={};gk[xi("toStringTag")]="z";var fv,X1=String(gk)==="[object z]",ZW=xi("toStringTag"),JW=nr.Object,QW=Ol(function(){return arguments}())=="Arguments",pv=X1?Ol:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=function(i,o){try{return i[o]}catch(a){}}(t=JW(e),ZW))=="string"?r:QW?Ol(t):(n=Ol(t))=="Object"&&On(t.callee)?"Arguments":n},qW=nr.String,Ll=function(e){if(pv(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return qW(e)},eG=function(){var e=Ni(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},Y1=nr.RegExp,Z1=Xn(function(){var e=Y1("a","y");return e.lastIndex=2,e.exec("abcd")!=null}),tG=Z1||Xn(function(){return!Y1("a","y").sticky}),rG=Z1||Xn(function(){var e=Y1("^r","gy");return e.lastIndex=2,e.exec("str")!=null}),nG={BROKEN_CARET:rG,MISSED_STICKY:tG,UNSUPPORTED_Y:Z1},iG=Object.keys||function(e){return fk(e,hv)},oG=$o?Object.defineProperties:function(e,t){Ni(e);for(var r,n=ic(t),i=iG(t),o=i.length,a=0;o>a;)oc.f(e,r=i[a++],n[r]);return e},aG=dh("document","documentElement"),vk=H1("IE_PROTO"),J1=function(){},mk=function(e){return"<script>"+e+"</script>"},yk=function(e){e.write(mk("")),e.close();var t=e.parentWindow.Object;return e=null,t},gv=function(){try{fv=new ActiveXObject("htmlfile")}catch(n){}var e,t;gv=typeof document!="undefined"?document.domain&&fv?yk(fv):((t=N1("iframe")).style.display="none",aG.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(mk("document.F=Object")),e.close(),e.F):yk(fv);for(var r=hv.length;r--;)delete gv.prototype[hv[r]];return gv()};z1[vk]=!0;var bk,Q1,mh=Object.create||function(e,t){var r;return e!==null?(J1.prototype=Ni(e),r=new J1,J1.prototype=null,r[vk]=e):r=gv(),t===void 0?r:oG(r,t)},sG=nr.RegExp,lG=Xn(function(){var e=sG(".","s");return!(e.dotAll&&e.exec(`
|
|
|
`)&&e.flags==="s")}),uG=nr.RegExp,cG=Xn(function(){var e=uG("(?<a>b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$<a>c")!=="bc"}),dG=kl.get,hG=I1("native-string-replace",String.prototype.replace),vv=RegExp.prototype.exec,q1=vv,fG=Gr("".charAt),pG=Gr("".indexOf),gG=Gr("".replace),eE=Gr("".slice),tE=(Q1=/b*/g,Yn(vv,bk=/a/,"a"),Yn(vv,Q1,"a"),bk.lastIndex!==0||Q1.lastIndex!==0),Ek=nG.BROKEN_CARET,rE=/()??/.exec("")[1]!==void 0;(tE||rE||Ek||lG||cG)&&(q1=function(e){var t,r,n,i,o,a,s,l=this,u=dG(l),c=Ll(e),h=u.raw;if(h)return h.lastIndex=l.lastIndex,t=Yn(q1,h,c),l.lastIndex=h.lastIndex,t;var S=u.groups,y=Ek&&l.sticky,W=Yn(eG,l),B=l.source,N=0,U=c;if(y&&(W=gG(W,"y",""),pG(W,"g")===-1&&(W+="g"),U=eE(c,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&fG(c,l.lastIndex-1)!==`
|
|
|
`)&&(B="(?: "+B+")",U=" "+U,N++),r=new RegExp("^(?:"+B+")",W)),rE&&(r=new RegExp("^"+B+"$(?!\\s)",W)),tE&&(n=l.lastIndex),i=Yn(vv,y?r:l,U),y?i?(i.input=eE(i.input,N),i[0]=eE(i[0],N),i.index=l.lastIndex,l.lastIndex+=i[0].length):l.lastIndex=0:tE&&i&&(l.lastIndex=l.global?i.index+i[0].length:n),rE&&i&&i.length>1&&Yn(hG,i[0],r,function(){for(o=1;o<arguments.length-2;o++)arguments[o]===void 0&&(i[o]=void 0)}),i&&S)for(i.groups=a=mh(null),o=0;o<S.length;o++)a[(s=S[o])[0]]=i[s[1]];return i});var mv=q1;vh({target:"RegExp",proto:!0,forced:/./.exec!==mv},{exec:mv});var vG=xi("species"),nE=RegExp.prototype,mG=Gr("".charAt),xk=Gr("".charCodeAt),yG=Gr("".slice),Sk=function(e){return function(t,r){var n,i,o=Ll(sv(t)),a=K1(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=xk(o,a))<55296||n>56319||a+1===s||(i=xk(o,a+1))<56320||i>57343?e?mG(o,a):n:e?yG(o,a,a+2):i-56320+(n-55296<<10)+65536}},wk={codeAt:Sk(!1),charAt:Sk(!0)},bG=wk.charAt,EG=function(e,t,r){return t+(r?bG(e,t).length:1)},xG=nr.TypeError,Ck=function(e,t){var r=e.exec;if(On(r)){var n=Yn(r,e,t);return n!==null&&Ni(n),n}if(Ol(e)==="RegExp")return Yn(mv,e,t);throw xG("RegExp#exec called on incompatible receiver")};!function(e,t,r,n){var i=xi(e),o=!Xn(function(){var u={};return u[i]=function(){return 7},""[e](u)!=7}),a=o&&!Xn(function(){var u=!1,c=/a/;return e==="split"&&((c={}).constructor={},c.constructor[vG]=function(){return c},c.flags="",c[i]=/./[i]),c.exec=function(){return u=!0,null},c[i](""),!u});if(!o||!a||r){var s=Gr(/./[i]),l=t(i,""[e],function(u,c,h,S,y){var W=Gr(u),B=c.exec;return B===mv||B===nE.exec?o&&!y?{done:!0,value:s(c,h,S)}:{done:!0,value:W(h,c,S)}:{done:!1}});rs(String.prototype,e,l[0]),rs(nE,i,l[1])}n&&Si(nE[i],"sham",!0)}("match",function(e,t,r){return[function(n){var i=sv(this),o=n==null?void 0:hh(n,e);return o?Yn(o,n,i):new RegExp(n)[e](Ll(i))},function(n){var i=Ni(this),o=Ll(n),a=r(t,i,o);if(a.done)return a.value;if(!i.global)return Ck(i,o);var s=i.unicode;i.lastIndex=0;for(var l,u=[],c=0;(l=Ck(i,o))!==null;){var h=Ll(l[0]);u[c]=h,h===""&&(i.lastIndex=EG(o,ck(i.lastIndex),s)),c++}return c===0?null:u}]}),vh({global:!0},{globalThis:nr});var SG=!Xn(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Tk=H1("IE_PROTO"),iE=nr.Object,wG=iE.prototype,yh=SG?iE.getPrototypeOf:function(e){var t=M1(e);if(Di(t,Tk))return t[Tk];var r=t.constructor;return On(r)&&t instanceof r?r.prototype:t instanceof iE?wG:null},CG=nr.String,TG=nr.TypeError,sc=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Gr(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(n){}return function(n,i){return Ni(n),function(o){if(typeof o=="object"||On(o))return o;throw TG("Can't set "+CG(o)+" as a prototype")}(i),t?e(n,i):n.__proto__=i,n}}():void 0),AG=nr.Array,DG=Math.max,OG=Gr("".replace),_G=Gr("".split),RG=Gr([].join),oE=String(Error("zxcasd").stack),Ak=/\n\s*at [^:]*:[^\n]*/,kG=Ak.test(oE),LG=/@[^\n]*\n/.test(oE)&&!/zxcasd/.test(oE),PG=function(e,t){if(typeof e!="string")return e;if(kG)for(;t--;)e=OG(e,Ak,"");else if(LG)return RG(function(r,n,i){for(var o,a,s,l,u=dv(r),c=$1(n,u),h=$1(i===void 0?u:i,u),S=AG(DG(h-c,0)),y=0;c<h;c++,y++)o=S,a=y,s=r[c],l=void 0,(l=B1(a))in o?oc.f(o,l,es(0,s)):o[l]=s;return S.length=y,S}(_G(e,`
|
|
|
`),t),`
|
|
|
`);return e},IG=function(e,t){Ao(t)&&"cause"in t&&Si(e,"cause",t.cause)},Dk=Gr(Gr.bind),Ok=function(e,t){return L1(e),t===void 0?e:Dk?Dk(e,t):function(){return e.apply(t,arguments)}},lc={},MG=xi("iterator"),BG=Array.prototype,FG=xi("iterator"),_k=function(e){if(e!=null)return hh(e,FG)||hh(e,"@@iterator")||lc[pv(e)]},NG=nr.TypeError,Rk=function(e,t,r){var n,i;Ni(e);try{if(!(n=hh(e,"return"))){if(t==="throw")throw r;return r}n=Yn(n,e)}catch(o){i=!0,n=o}if(t==="throw")throw r;if(i)throw n;return Ni(n),r},jG=nr.TypeError,yv=function(e,t){this.stopped=e,this.result=t},kk=yv.prototype,UG=function(e,t,r){var n,i,o,a,s,l,u,c=r&&r.that,h=!(!r||!r.AS_ENTRIES),S=!(!r||!r.IS_ITERATOR),y=!(!r||!r.INTERRUPTED),W=Ok(t,c),B=function(U){return n&&Rk(n,"normal",U),new yv(!0,U)},N=function(U){return h?(Ni(U),y?W(U[0],U[1],B):W(U[0],U[1])):y?W(U,B):W(U)};if(S)n=e;else{if(!(i=_k(e)))throw jG(k1(e)+" is not iterable");if(function(U){return U!==void 0&&(lc.Array===U||BG[MG]===U)}(i)){for(o=0,a=dv(e);a>o;o++)if((s=N(e[o]))&&lv(kk,s))return s;return new yv(!1)}n=function(U,D){var Q=arguments.length<2?_k(U):D;if(L1(Q))return Ni(Yn(Q,U));throw NG(k1(U)+" is not iterable")}(e,i)}for(l=n.next;!(u=Yn(l,n)).done;){try{s=N(u.value)}catch(U){Rk(n,"throw",U)}if(typeof s=="object"&&s&&lv(kk,s))return s}return new yv(!1)},HG=function(e,t){return e===void 0?arguments.length<2?"":t:Ll(e)},zG=!Xn(function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",es(1,7)),e.stack!==7)}),WG=xi("toStringTag"),bv=nr.Error,GG=[].push,bh=function(e,t){var r,n=arguments.length>2?arguments[2]:void 0,i=lv(aE,this);sc?r=sc(new bv(void 0),i?yh(this):aE):(r=i?this:mh(aE),Si(r,WG,"Error")),Si(r,"message",HG(t,"")),zG&&Si(r,"stack",PG(r.stack,1)),IG(r,n);var o=[];return UG(e,GG,{that:o}),Si(r,"errors",o),r};sc?sc(bh,bv):pk(bh,bv);var aE=bh.prototype=mh(bv.prototype,{constructor:es(1,bh),message:es(1,""),name:es(1,"AggregateError")});vh({global:!0},{AggregateError:bh});var sE=xi("unscopables"),lE=Array.prototype;lE[sE]==null&&oc.f(lE,sE,{configurable:!0,value:mh(null)});var Pl,Lk,Pk,uE=function(e){lE[sE][e]=!0},cE=xi("iterator"),Ik=!1;[].keys&&("next"in(Pk=[].keys())?(Lk=yh(yh(Pk)))!==Object.prototype&&(Pl=Lk):Ik=!0);var VG=Pl==null||Xn(function(){var e={};return Pl[cE].call(e)!==e});VG&&(Pl={}),On(Pl[cE])||rs(Pl,cE,function(){return this});var dE={IteratorPrototype:Pl,BUGGY_SAFARI_ITERATORS:Ik},KG=oc.f,Mk=xi("toStringTag"),Bk=function(e,t,r){e&&!Di(e=r?e:e.prototype,Mk)&&KG(e,Mk,{configurable:!0,value:t})},$G=dE.IteratorPrototype,XG=function(){return this},YG=V1.PROPER,ZG=V1.CONFIGURABLE,Fk=dE.IteratorPrototype,Ev=dE.BUGGY_SAFARI_ITERATORS,Eh=xi("iterator"),JG=function(){return this},Nk=function(e,t,r,n,i,o,a){!function(U,D,Q,te){var he=D+" Iterator";U.prototype=mh($G,{next:es(+!te,Q)}),Bk(U,he,!1),lc[he]=XG}(r,t,n);var s,l,u,c=function(U){if(U===i&&B)return B;if(!Ev&&U in y)return y[U];switch(U){case"keys":case"values":case"entries":return function(){return new r(this,U)}}return function(){return new r(this)}},h=t+" Iterator",S=!1,y=e.prototype,W=y[Eh]||y["@@iterator"]||i&&y[i],B=!Ev&&W||c(i),N=t=="Array"&&y.entries||W;if(N&&(s=yh(N.call(new e)))!==Object.prototype&&s.next&&(yh(s)!==Fk&&(sc?sc(s,Fk):On(s[Eh])||rs(s,Eh,JG)),Bk(s,h,!0)),YG&&i=="values"&&W&&W.name!=="values"&&(ZG?Si(y,"name","values"):(S=!0,B=function(){return Yn(W,this)})),i)if(l={values:c("values"),keys:o?B:c("keys"),entries:c("entries")},a)for(u in l)(Ev||S||!(u in y))&&rs(y,u,l[u]);else vh({target:t,proto:!0,forced:Ev||S},l);return y[Eh]!==B&&rs(y,Eh,B,{name:i}),lc[t]=B,l},QG=kl.set,qG=kl.getterFor("Array Iterator"),xh=Nk(Array,"Array",function(e,t){QG(this,{type:"Array Iterator",target:ic(e),index:0,kind:t})},function(){var e=qG(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):r=="keys"?{value:n,done:!1}:r=="values"?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values");lc.Arguments=lc.Array,uE("keys"),uE("values"),uE("entries");var eV=wk.charAt,tV=kl.set,rV=kl.getterFor("String Iterator");Nk(String,"String",function(e){tV(this,{type:"String Iterator",string:Ll(e),index:0})},function(){var e,t=rV(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=eV(r,n),t.index+=e.length,{value:e,done:!1})});var hE,xv={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},fE=N1("span").classList,jk=fE&&fE.constructor&&fE.constructor.prototype,Uk=jk===Object.prototype?void 0:jk,pE=xi("iterator"),Hk=xi("toStringTag"),gE=xh.values,zk=function(e,t){if(e){if(e[pE]!==gE)try{Si(e,pE,gE)}catch(n){e[pE]=gE}if(e[Hk]||Si(e,Hk,t),xv[t]){for(var r in xh)if(e[r]!==xh[r])try{Si(e,r,xh[r])}catch(n){e[r]=xh[r]}}}};for(var vE in xv)zk(nr[vE]&&nr[vE].prototype,vE);(zk(Uk,"DOMTokenList"),typeof ze=="undefined")?("ActiveXObject"in window&&console.error(`\u62B1\u6B49\uFF0CwangEditor V5+ \u7248\u672C\u5F00\u59CB\uFF0C\u4E0D\u5728\u652F\u6301 IE \u6D4F\u89C8\u5668
|
|
|
Sorry, wangEditor V5+ versions do not support IE browser.`),Wk(),Gk()):ze&&((hE=ze.navigator)===null||hE===void 0?void 0:hE.userAgent.match("QQBrowser"))&&(Wk(),Gk());function Wk(){typeof globalThis=="undefined"&&(window.globalThis=window)}function Gk(){Zz===void 0&&(window.AggregateError=function(e,t){var r=new Error(t);return r.errors=e,r})}var Vk,Sv=Array.isArray||function(e){return O(e)=="Array"},Kk=function(){},nV=[],$k=We("Reflect","construct"),mE=/^\s*(?:class|function)\b/,iV=d(mE.exec),oV=!mE.exec(Kk),Sh=function(e){if(!p(e))return!1;try{return $k(Kk,nV,e),!0}catch(t){return!1}},aV=!$k||f(function(){var e;return Sh(Sh.call)||!Sh(Object)||!Sh(function(){e=!0})||e})?function(e){if(!p(e))return!1;switch(ah(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return oV||!!iV(mE,LR(e))}:Sh,sV=ce("species"),Xk=q.Array,Yk=function(e,t){return new(function(r){var n;return Sv(r)&&(n=r.constructor,(aV(n)&&(n===Xk||Sv(n.prototype))||Ce(n)&&(n=n[sV])===null)&&(n=void 0)),n===void 0?Xk:n}(e))(t===0?0:t)},lV=ce("species"),Zk=ce("isConcatSpreadable"),Jk=q.TypeError,uV=Z>=51||!f(function(){var e=[];return e[Zk]=!1,e.concat()[0]!==e}),cV=(Vk="concat",Z>=51||!f(function(){var e=[];return(e.constructor={})[lV]=function(){return{foo:1}},e[Vk](Boolean).foo!==1})),dV=function(e){if(!Ce(e))return!1;var t=e[Zk];return t!==void 0?!!t:Sv(e)};wr({target:"Array",proto:!0,forced:!uV||!cV},{concat:function(e){var t,r,n,i,o,a=Lt(this),s=Yk(a,0),l=0;for(t=-1,n=arguments.length;t<n;t++)if(dV(o=t===-1?a:arguments[t])){if(l+(i=ih(o))>9007199254740991)throw Jk("Maximum allowed index exceeded");for(r=0;r<i;r++,l++)r in o&&p1(s,l,o[r])}else{if(l>=9007199254740991)throw Jk("Maximum allowed index exceeded");p1(s,l++,o)}return s.length=l,s}});var Qk=d1.f,qk=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],eL={f:function(e){return qk&&O(e)=="Window"?function(t){try{return Qk(t)}catch(r){return AR(qk)}}(e):Qk(xe(e))}},hV=d([].slice),yE={f:ce},fV=ro.f,En=function(e){var t=be.Symbol||(be.Symbol={});xt(t,e)||fV(t,e,{value:yE.f(e)})},tL=d([].push),ns=function(e){var t=e==1,r=e==2,n=e==3,i=e==4,o=e==6,a=e==7,s=e==5||o;return function(l,u,c,h){for(var S,y,W=Lt(l),B=ee(W),N=eo(u,c),U=ih(B),D=0,Q=h||Yk,te=t?Q(l,U):r||a?Q(l,0):void 0;U>D;D++)if((s||D in B)&&(y=N(S=B[D],D,W),e))if(t)te[D]=y;else if(y)switch(e){case 3:return!0;case 5:return S;case 6:return D;case 2:tL(te,S)}else switch(e){case 4:return!1;case 7:tL(te,S)}return o?-1:n||i?i:te}},wv={forEach:ns(0),map:ns(1),filter:ns(2),some:ns(3),every:ns(4),find:ns(5),findIndex:ns(6),filterReject:ns(7)}.forEach,Oi=Lr("hidden"),rL=ce("toPrimitive"),pV=rc.set,nL=rc.getterFor("Symbol"),Do=Object.prototype,is=q.Symbol,os=is&&is.prototype,iL=q.TypeError,bE=q.QObject,wh=We("JSON","stringify"),oL=$t.f,as=ro.f,aL=eL.f,gV=m.f,sL=d([].push),Ta=bt("symbols"),Ch=bt("op-symbols"),EE=bt("string-to-symbol-registry"),xE=bt("symbol-to-string-registry"),vV=bt("wks"),SE=!bE||!bE.prototype||!bE.prototype.findChild,wE=T&&f(function(){return wa(as({},"a",{get:function(){return as(this,"a",{value:7}).a}})).a!=7})?function(e,t,r){var n=oL(Do,t);n&&delete Do[t],as(e,t,r),n&&e!==Do&&as(Do,t,n)}:as,CE=function(e,t){var r=Ta[e]=wa(os);return pV(r,{type:"Symbol",tag:e,description:t}),T||(r.description=t),r},Cv=function(e,t,r){e===Do&&Cv(Ch,t,r),$n(e);var n=ye(t);return $n(r),xt(Ta,n)?(r.enumerable?(xt(e,Oi)&&e[Oi][n]&&(e[Oi][n]=!1),r=wa(r,{enumerable:v(0,!1)})):(xt(e,Oi)||as(e,Oi,v(1,{})),e[Oi][n]=!0),wE(e,n,r)):as(e,n,r)},lL=function(e,t){$n(e);var r=xe(t),n=h1(r).concat(TE(r));return wv(n,function(i){T&&!E(uL,r,i)||Cv(e,i,r[i])}),e},uL=function(e){var t=ye(e),r=E(gV,this,t);return!(this===Do&&xt(Ta,t)&&!xt(Ch,t))&&(!(r||!xt(this,t)||!xt(Ta,t)||xt(this,Oi)&&this[Oi][t])||r)},cL=function(e,t){var r=xe(e),n=ye(t);if(r!==Do||!xt(Ta,n)||xt(Ch,n)){var i=oL(r,n);return!i||!xt(Ta,n)||xt(r,Oi)&&r[Oi][n]||(i.enumerable=!0),i}},dL=function(e){var t=aL(xe(e)),r=[];return wv(t,function(n){xt(Ta,n)||xt(oh,n)||sL(r,n)}),r},TE=function(e){var t=e===Do,r=aL(t?Ch:xe(e)),n=[];return wv(r,function(i){!xt(Ta,i)||t&&!xt(Do,i)||sL(n,Ta[i])}),n};if(A||(os=(is=function(){if(Me(os,this))throw iL("Symbol is not a constructor");var e=arguments.length&&arguments[0]!==void 0?sh(arguments[0]):void 0,t=Ht(e),r=function(n){this===Do&&E(r,Ch,n),xt(this,Oi)&&xt(this[Oi],t)&&(this[Oi][t]=!1),wE(this,t,v(1,n))};return T&&SE&&wE(Do,t,{configurable:!0,set:r}),CE(t,e)}).prototype,nc(os,"toString",function(){return nL(this).tag}),nc(is,"withoutSetter",function(e){return CE(Ht(e),e)}),m.f=uL,ro.f=Cv,$t.f=cL,d1.f=eL.f=dL,Jg.f=TE,yE.f=function(e){return CE(ce(e),e)},T&&as(os,"description",{configurable:!0,get:function(){return nL(this).description}})),wr({global:!0,wrap:!0,forced:!A,sham:!A},{Symbol:is}),wv(h1(vV),function(e){En(e)}),wr({target:"Symbol",stat:!0,forced:!A},{for:function(e){var t=sh(e);if(xt(EE,t))return EE[t];var r=is(t);return EE[t]=r,xE[r]=t,r},keyFor:function(e){if(!oe(e))throw iL(e+" is not a symbol");if(xt(xE,e))return xE[e]},useSetter:function(){SE=!0},useSimple:function(){SE=!1}}),wr({target:"Object",stat:!0,forced:!A,sham:!T},{create:function(e,t){return t===void 0?wa(e):lL(wa(e),t)},defineProperty:Cv,defineProperties:lL,getOwnPropertyDescriptor:cL}),wr({target:"Object",stat:!0,forced:!A},{getOwnPropertyNames:dL,getOwnPropertySymbols:TE}),wr({target:"Object",stat:!0,forced:f(function(){Jg.f(1)})},{getOwnPropertySymbols:function(e){return Jg.f(Lt(e))}}),wh){var mV=!A||f(function(){var e=is();return wh([e])!="[null]"||wh({a:e})!="{}"||wh(Object(e))!="{}"});wr({target:"JSON",stat:!0,forced:mV},{stringify:function(e,t,r){var n=hV(arguments),i=t;if((Ce(t)||e!==void 0)&&!oe(e))return Sv(t)||(t=function(o,a){if(p(i)&&(a=E(i,this,o,a)),!oe(a))return a}),n[1]=t,F(wh,null,n)}})}if(!os[rL]){var yV=os.valueOf;nc(os,rL,function(e){return E(yV,this)})}nv(is,"Symbol"),oh[Oi]=!0,En("asyncIterator"),En("hasInstance"),En("isConcatSpreadable"),En("iterator"),En("match"),En("matchAll"),En("replace"),En("search"),En("species"),En("split"),En("toPrimitive"),En("toStringTag"),En("unscopables"),nv(q.JSON,"JSON",!0);var bV=be.Symbol;En("asyncDispose"),En("dispose"),En("matcher"),En("metadata"),En("observable"),En("patternMatch"),En("replaceAll");var Tv=bV,EV=yE.f("iterator"),xV=ae(function(e){function t(r){return typeof Tv=="function"&&typeof EV=="symbol"?(e.exports=t=function(n){return typeof n},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=t=function(n){return n&&typeof Tv=="function"&&n.constructor===Tv&&n!==Tv.prototype?"symbol":typeof n},e.exports.default=e.exports,e.exports.__esModule=!0),t(r)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0}),SV=z(xV),hL=j1.f,wV=Xn(function(){hL(1)});if(vh({target:"Object",stat:!0,forced:!$o||wV,sham:!$o},{getOwnPropertyDescriptor:function(e,t){return hL(ic(e),t)}}),(typeof ze=="undefined"?"undefined":SV(ze))==="object"){var CV=Object.getOwnPropertyDescriptor(ze,"window");ze.window&&!CV.set||(ze.window=ze,ze.requestAnimationFrame=function(){},ze.navigator={userAgent:""},ze.location={hostname:"0.0.0.0",port:0,protocol:"http:"},ze.btoa=function(){},ze.crypto={getRandomValues:function(e){return nodeCrypto.randomFillSync(e)}}),ze.document!=null&&ze.document.getElementsByTagName==null&&(ze.document.getElementsByTagName=function(){return[]})}/*!
|
|
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
|
*
|
|
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
|
* Released under the MIT License.
|
|
|
*/function fL(e){return Object.prototype.toString.call(e)==="[object Object]"}function ci(e){var t,r;return fL(e)!==!1&&((t=e.constructor)===void 0||fL(r=t.prototype)!==!1&&r.hasOwnProperty("isPrototypeOf")!==!1)}function Oo(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map(function(i){return"'"+i+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Il(e){return!!e&&!!e[ji]}function Ml(e){return!!e&&(function(t){if(!t||typeof t!="object")return!1;var r=Object.getPrototypeOf(t);if(r===null)return!0;var n=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return n===Object||typeof n=="function"&&Function.toString.call(n)===RV}(e)||Array.isArray(e)||!!e[wL]||!!e.constructor[wL]||DE(e)||OE(e))}function Th(e,t,r){r===void 0&&(r=!1),uc(e)===0?(r?Object.keys:UE)(e).forEach(function(n){r&&typeof n=="symbol"||t(n,e[n],e)}):e.forEach(function(n,i){return t(i,n,e)})}function uc(e){var t=e[ji];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:DE(e)?2:OE(e)?3:0}function AE(e,t){return uc(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function pL(e,t,r){var n=uc(e);n===2?e.set(t,r):n===3?(e.delete(t),e.add(r)):e[t]=r}function DE(e){return OV&&e instanceof Map}function OE(e){return _V&&e instanceof Set}function Bl(e){return e.o||e.t}function _E(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=kV(e);delete t[ji];for(var r=UE(t),n=0;n<r.length;n++){var i=r[n],o=t[i];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(t[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[i]})}return Object.create(Object.getPrototypeOf(e),t)}function RE(e,t){return t===void 0&&(t=!1),kE(e)||Il(e)||!Ml(e)||(uc(e)>1&&(e.set=e.add=e.clear=e.delete=TV),Object.freeze(e),t&&Th(e,function(r,n){return RE(n,!0)},!0)),e}function TV(){Oo(2)}function kE(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Aa(e){var t=LV[e];return t||Oo(18,e),t}function gL(){return Ah}function LE(e,t){t&&(Aa("Patches"),e.u=[],e.s=[],e.v=t)}function Av(e){PE(e),e.p.forEach(AV),e.p=null}function PE(e){e===Ah&&(Ah=e.l)}function vL(e){return Ah={p:[],l:Ah,h:e,m:!0,_:0}}function AV(e){var t=e[ji];t.i===0||t.i===1?t.j():t.O=!0}function IE(e,t){t._=t.p.length;var r=t.p[0],n=e!==void 0&&e!==r;return t.h.g||Aa("ES5").S(t,e,n),n?(r[ji].P&&(Av(t),Oo(4)),Ml(e)&&(e=Dv(t,e),t.l||Ov(t,e)),t.u&&Aa("Patches").M(r[ji],e,t.u,t.s)):e=Dv(t,r,[]),Av(t),t.u&&t.v(t.u,t.s),e!==SL?e:void 0}function Dv(e,t,r){if(kE(t))return t;var n=t[ji];if(!n)return Th(t,function(o,a){return mL(e,n,t,o,a,r)},!0),t;if(n.A!==e)return t;if(!n.P)return Ov(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=_E(n.k):n.o;Th(n.i===3?new Set(i):i,function(o,a){return mL(e,n,i,o,a,r)}),Ov(e,i,!1),r&&e.u&&Aa("Patches").R(n,r,e.u,e.s)}return n.o}function mL(e,t,r,n,i,o){if(Il(i)){var a=Dv(e,i,o&&t&&t.i!==3&&!AE(t.D,n)?o.concat(n):void 0);if(pL(r,n,a),!Il(a))return;e.m=!1}if(Ml(i)&&!kE(i)){if(!e.h.F&&e._<1)return;Dv(e,i),t&&t.A.l||Ov(e,i)}}function Ov(e,t,r){r===void 0&&(r=!1),e.h.F&&e.m&&RE(t,r)}function ME(e,t){var r=e[ji];return(r?Bl(r):e)[t]}function yL(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function BE(e){e.P||(e.P=!0,e.l&&BE(e.l))}function FE(e){e.o||(e.o=_E(e.t))}function NE(e,t,r){var n=DE(t)?Aa("MapSet").N(t,r):OE(t)?Aa("MapSet").T(t,r):e.g?function(i,o){var a=Array.isArray(i),s={i:a?1:0,A:o?o.A:gL(),P:!1,I:!1,D:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=s,u=_v;a&&(l=[s],u=Rv);var c=Proxy.revocable(l,u),h=c.revoke,S=c.proxy;return s.k=S,s.j=h,S}(t,r):Aa("ES5").J(t,r);return(r?r.A:gL()).p.push(n),n}function DV(e){return Il(e)||Oo(22,e),function t(r){if(!Ml(r))return r;var n,i=r[ji],o=uc(r);if(i){if(!i.P&&(i.i<4||!Aa("ES5").K(i)))return i.t;i.I=!0,n=bL(r,o),i.I=!1}else n=bL(r,o);return Th(n,function(a,s){i&&function(l,u){return uc(l)===2?l.get(u):l[u]}(i.t,a)===s||pL(n,a,t(s))}),o===3?new Set(n):n}(e)}function bL(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return _E(e)}var EL,Ah,jE=typeof Symbol!="undefined"&&typeof Symbol("x")=="symbol",OV=typeof Map!="undefined",_V=typeof Set!="undefined",xL=typeof Proxy!="undefined"&&Proxy.revocable!==void 0&&typeof Reflect!="undefined",SL=jE?Symbol.for("immer-nothing"):((EL={})["immer-nothing"]=!0,EL),wL=jE?Symbol.for("immer-draftable"):"__$immer_draftable",ji=jE?Symbol.for("immer-state"):"__$immer_state",RV=""+Object.prototype.constructor,UE=typeof Reflect!="undefined"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,kV=Object.getOwnPropertyDescriptors||function(e){var t={};return UE(e).forEach(function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)}),t},LV={},_v={get:function(e,t){if(t===ji)return e;var r=Bl(e);if(!AE(r,t))return function(i,o,a){var s,l=yL(o,a);return l?"value"in l?l.value:(s=l.get)===null||s===void 0?void 0:s.call(i.k):void 0}(e,r,t);var n=r[t];return e.I||!Ml(n)?n:n===ME(e.t,t)?(FE(e),e.o[t]=NE(e.A.h,n,e)):n},has:function(e,t){return t in Bl(e)},ownKeys:function(e){return Reflect.ownKeys(Bl(e))},set:function(e,t,r){var n=yL(Bl(e),t);if(n==null?void 0:n.set)return n.set.call(e.k,r),!0;if(!e.P){var i=ME(Bl(e),t),o=i==null?void 0:i[ji];if(o&&o.t===r)return e.o[t]=r,e.D[t]=!1,!0;if(function(a,s){return a===s?a!==0||1/a==1/s:a!=a&&s!=s}(r,i)&&(r!==void 0||AE(e.t,t)))return!0;FE(e),BE(e)}return e.o[t]===r&&typeof r!="number"&&(r!==void 0||t in e.o)||(e.o[t]=r,e.D[t]=!0,!0)},deleteProperty:function(e,t){return ME(e.t,t)!==void 0||t in e.t?(e.D[t]=!1,FE(e),BE(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=Bl(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty:function(){Oo(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Oo(12)}},Rv={};Th(_v,function(e,t){Rv[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Rv.deleteProperty=function(e,t){return _v.deleteProperty.call(this,e[0],t)},Rv.set=function(e,t,r){return _v.set.call(this,e[0],t,r,e[0])};var PV=function(){function e(r){var n=this;this.g=xL,this.F=!0,this.produce=function(i,o,a){if(typeof i=="function"&&typeof o!="function"){var s=o;o=i;var l=n;return function(y){var W=this;y===void 0&&(y=s);for(var B=arguments.length,N=Array(B>1?B-1:0),U=1;U<B;U++)N[U-1]=arguments[U];return l.produce(y,function(D){var Q;return(Q=o).call.apply(Q,[W,D].concat(N))})}}var u;if(typeof o!="function"&&Oo(6),a!==void 0&&typeof a!="function"&&Oo(7),Ml(i)){var c=vL(n),h=NE(n,i,void 0),S=!0;try{u=o(h),S=!1}finally{S?Av(c):PE(c)}return typeof Promise!="undefined"&&u instanceof Promise?u.then(function(y){return LE(c,a),IE(y,c)},function(y){throw Av(c),y}):(LE(c,a),IE(u,c))}if(!i||typeof i!="object")return(u=o(i))===SL?void 0:(u===void 0&&(u=i),n.F&&RE(u,!0),u);Oo(21,i)},this.produceWithPatches=function(i,o){return typeof i=="function"?function(l){for(var u=arguments.length,c=Array(u>1?u-1:0),h=1;h<u;h++)c[h-1]=arguments[h];return n.produceWithPatches(l,function(S){return i.apply(void 0,[S].concat(c))})}:[n.produce(i,o,function(l,u){a=l,s=u}),a,s];var a,s},typeof(r==null?void 0:r.useProxies)=="boolean"&&this.setUseProxies(r.useProxies),typeof(r==null?void 0:r.autoFreeze)=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var t=e.prototype;return t.createDraft=function(r){Ml(r)||Oo(8),Il(r)&&(r=DV(r));var n=vL(this),i=NE(this,r,void 0);return i[ji].C=!0,PE(n),i},t.finishDraft=function(r,n){var i=(r&&r[ji]).A;return LE(i,n),IE(void 0,i)},t.setAutoFreeze=function(r){this.F=r},t.setUseProxies=function(r){r&&!xL&&Oo(20),this.g=r},t.applyPatches=function(r,n){var i;for(i=n.length-1;i>=0;i--){var o=n[i];if(o.path.length===0&&o.op==="replace"){r=o.value;break}}i>-1&&(n=n.slice(i+1));var a=Aa("Patches").$;return Il(r)?a(r,n):this.produce(r,function(s){return a(s,n)})},e}(),Ui=new PV,kv=Ui.produce;Ui.produceWithPatches.bind(Ui),Ui.setAutoFreeze.bind(Ui),Ui.setUseProxies.bind(Ui),Ui.applyPatches.bind(Ui);var CL=Ui.createDraft.bind(Ui),TL=Ui.finishDraft.bind(Ui);function Xo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Lv=new WeakMap,Dh=new WeakMap,AL=new WeakMap,DL=new WeakMap,OL=new WeakMap,_L=new WeakMap;function RL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Pv(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?RL(Object(r),!0).forEach(function(n){Xo(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):RL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var IV=()=>{var e={children:[],operations:[],selection:null,marks:null,isInline:()=>!1,isVoid:()=>!1,onChange:()=>{},apply:t=>{for(var r of de.pathRefs(e))cK.transform(r,t);for(var n of de.pointRefs(e))dK.transform(n,t);for(var i of de.rangeRefs(e))fK.transform(i,t);var o=new Set,a=[],s=S=>{if(S){var y=S.join(",");o.has(y)||(o.add(y),a.push(S))}},l=Lv.get(e)||[],u=MV(t);for(var c of l)s(Ue.transform(c,t));for(var h of u)s(h);Lv.set(e,a),Ve.transform(e,t),e.operations.push(t),de.normalize(e),t.type==="set_selection"&&(e.marks=null),Dh.get(e)||(Dh.set(e,!0),Promise.resolve().then(()=>{Dh.set(e,!1),e.onChange(),e.operations=[]}))},addMark:(t,r)=>{var{selection:n}=e;if(n)if(Qe.isExpanded(n))Ve.setNodes(e,{[t]:r},{match:Rt.isText,split:!0});else{var i=Pv(Pv({},de.marks(e)||{}),{},{[t]:r});e.marks=i,Dh.get(e)||e.onChange()}},deleteBackward:t=>{var{selection:r}=e;r&&Qe.isCollapsed(r)&&Ve.delete(e,{unit:t,reverse:!0})},deleteForward:t=>{var{selection:r}=e;r&&Qe.isCollapsed(r)&&Ve.delete(e,{unit:t})},deleteFragment:t=>{var{selection:r}=e;r&&Qe.isExpanded(r)&&Ve.delete(e,{reverse:t==="backward"})},getFragment:()=>{var{selection:t}=e;return t?St.fragment(e,t):[]},insertBreak:()=>{Ve.splitNodes(e,{always:!0})},insertFragment:t=>{Ve.insertFragment(e,t)},insertNode:t=>{Ve.insertNodes(e,t)},insertText:t=>{var{selection:r,marks:n}=e;if(r){if(n){var i=Pv({text:t},n);Ve.insertNodes(e,i)}else Ve.insertText(e,t);e.marks=null}},normalizeNode:t=>{var[r,n]=t;if(!Rt.isText(r))if(Ut.isElement(r)&&r.children.length===0)Ve.insertNodes(e,{text:""},{at:n.concat(0),voids:!0});else for(var i=!de.isEditor(r)&&Ut.isElement(r)&&(e.isInline(r)||r.children.length===0||Rt.isText(r.children[0])||e.isInline(r.children[0])),o=0,a=0;a<r.children.length;a++,o++){var s=St.get(e,n);if(!Rt.isText(s)){var l=r.children[a],u=s.children[o-1],c=a===r.children.length-1;(Rt.isText(l)||Ut.isElement(l)&&e.isInline(l))!==i?(Ve.removeNodes(e,{at:n.concat(o),voids:!0}),o--):Ut.isElement(l)?e.isInline(l)&&(u!=null&&Rt.isText(u)?c&&(Ve.insertNodes(e,{text:""},{at:n.concat(o+1),voids:!0}),o++):(Ve.insertNodes(e,{text:""},{at:n.concat(o),voids:!0}),o++)):u!=null&&Rt.isText(u)&&(Rt.equals(l,u,{loose:!0})?(Ve.mergeNodes(e,{at:n.concat(o),voids:!0}),o--):u.text===""?(Ve.removeNodes(e,{at:n.concat(o-1),voids:!0}),o--):l.text===""&&(Ve.removeNodes(e,{at:n.concat(o),voids:!0}),o--))}}},removeMark:t=>{var{selection:r}=e;if(r)if(Qe.isExpanded(r))Ve.unsetNodes(e,t,{match:Rt.isText,split:!0});else{var n=Pv({},de.marks(e)||{});delete n[t],e.marks=n,Dh.get(e)||e.onChange()}}};return e},MV=e=>{switch(e.type){case"insert_text":case"remove_text":case"set_node":var{path:t}=e;return Ue.levels(t);case"insert_node":var{node:r,path:n}=e,i=Ue.levels(n),o=Rt.isText(r)?[]:Array.from(St.nodes(r),te=>{var[,he]=te;return n.concat(he)});return[...i,...o];case"merge_node":var{path:a}=e;return[...Ue.ancestors(a),Ue.previous(a)];case"move_node":var{path:s,newPath:l}=e;if(Ue.equals(s,l))return[];var u=[],c=[];for(var h of Ue.ancestors(s)){var S=Ue.transform(h,e);u.push(S)}for(var y of Ue.ancestors(l)){var W=Ue.transform(y,e);c.push(W)}var B=c[c.length-1],N=l[l.length-1],U=B.concat(N);return[...u,...c,U];case"remove_node":var{path:D}=e;return[...Ue.ancestors(D)];case"split_node":var{path:Q}=e;return[...Ue.levels(Q),Ue.next(Q)];default:return[]}};function Da(e,t){if(e==null)return{};var r,n,i=function(a,s){if(a==null)return{};var l,u,c={},h=Object.keys(a);for(u=0;u<h.length;u++)l=h[u],s.indexOf(l)>=0||(c[l]=a[l]);return c}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var ar,HE=function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=!t,n=t?UV(e):e,i=ar.None,o=ar.None,a=0,s=null;for(var l of n){var u=l.codePointAt(0);if(!u)break;var c=QV(l,u);if([i,o]=r?[o,c]:[c,i],cc(i,ar.ZWJ)&&cc(o,ar.ExtPict)&&!rK(r?e.substring(0,a):e.substring(0,e.length-a)))break;if(cc(i,ar.RI)&&cc(o,ar.RI)&&!(s=s!==null?!s:!!r||iK(e.substring(0,e.length-a))))break;if(i!==ar.None&&o!==ar.None&&eK(i,o))break;a+=l.length}return a||1},BV=/\s/,FV=/[\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,NV=/['\u2018\u2019]/,zE=(e,t,r)=>{if(r){var n=e.length-t;return[e.slice(n,e.length),e.slice(0,n)]}return[e.slice(0,t),e.slice(t)]},jV=function e(t,r){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(BV.test(t))return!1;if(NV.test(t)){var i=HE(r,n),[o,a]=zE(r,i,n);if(e(o,a,n))return!0}return!FV.test(t)},UV=function*(e){for(var t=e.length-1,r=0;r<e.length;r++){var n=e.charAt(t-r);if(zV(n.charCodeAt(0))){var i=e.charAt(t-r-1);if(HV(i.charCodeAt(0))){yield i+n,r++;continue}}yield n}},HV=e=>e>=55296&&e<=56319,zV=e=>e>=56320&&e<=57343;!function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"}(ar||(ar={}));var WV=/^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1AC0\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/,GV=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,VV=/^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/,KV=/^[\u1100-\u115F\uA960-\uA97C]$/,$V=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,XV=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,YV=/^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/,ZV=/^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/,JV=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/,QV=(e,t)=>{var r=ar.Any;return e.search(WV)!==-1&&(r|=ar.Extend),t===8205&&(r|=ar.ZWJ),t>=127462&&t<=127487&&(r|=ar.RI),e.search(GV)!==-1&&(r|=ar.Prepend),e.search(VV)!==-1&&(r|=ar.SpacingMark),e.search(KV)!==-1&&(r|=ar.L),e.search($V)!==-1&&(r|=ar.V),e.search(XV)!==-1&&(r|=ar.T),e.search(YV)!==-1&&(r|=ar.LV),e.search(ZV)!==-1&&(r|=ar.LVT),e.search(JV)!==-1&&(r|=ar.ExtPict),r};function cc(e,t){return(e&t)!=0}var qV=[[ar.L,ar.L|ar.V|ar.LV|ar.LVT],[ar.LV|ar.V,ar.V|ar.T],[ar.LVT|ar.T,ar.T],[ar.Any,ar.Extend|ar.ZWJ],[ar.Any,ar.SpacingMark],[ar.Prepend,ar.Any],[ar.ZWJ,ar.ExtPict],[ar.RI,ar.RI]];function eK(e,t){return qV.findIndex(r=>cc(e,r[0])&&cc(t,r[1]))===-1}var tK=/(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1AC0\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/,rK=e=>e.search(tK)!==-1,nK=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,iK=e=>{var t=e.match(nK);return t!==null&&t[0].length/2%2==1},kL=e=>ci(e)&&St.isNodeList(e.children)&&!de.isEditor(e),Ut={isAncestor:e=>ci(e)&&St.isNodeList(e.children),isElement:kL,isElementList:e=>Array.isArray(e)&&e.every(t=>Ut.isElement(t)),isElementProps:e=>e.children!==void 0,isElementType:function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"type";return kL(e)&&e[r]===t},matches(e,t){for(var r in t)if(r!=="children"&&e[r]!==t[r])return!1;return!0}},oK=["text"],aK=["text"];function LL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function dc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?LL(Object(r),!0).forEach(function(n){Xo(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):LL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var PL=new WeakMap,de={above(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{voids:r=!1,mode:n="lowest",at:i=e.selection,match:o}=t;if(i){var a=de.path(e,i),s=n==="lowest";for(var[l,u]of de.levels(e,{at:a,voids:r,match:o,reverse:s}))if(!Rt.isText(l)&&!Ue.equals(a,u))return[l,u]}},addMark(e,t,r){e.addMark(t,r)},after(e,t){var r,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i={anchor:de.point(e,t,{edge:"end"}),focus:de.end(e,[])},{distance:o=1}=n,a=0;for(var s of de.positions(e,dc(dc({},n),{},{at:i}))){if(a>o)break;a!==0&&(r=s),a++}return r},before(e,t){var r,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i={anchor:de.start(e,[]),focus:de.point(e,t,{edge:"start"})},{distance:o=1}=n,a=0;for(var s of de.positions(e,dc(dc({},n),{},{at:i,reverse:!0}))){if(a>o)break;a!==0&&(r=s),a++}return r},deleteBackward(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{unit:r="character"}=t;e.deleteBackward(r)},deleteForward(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{unit:r="character"}=t;e.deleteForward(r)},deleteFragment(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{direction:r="forward"}=t;e.deleteFragment(r)},edges:(e,t)=>[de.start(e,t),de.end(e,t)],end:(e,t)=>de.point(e,t,{edge:"end"}),first(e,t){var r=de.path(e,t,{edge:"start"});return de.node(e,r)},fragment(e,t){var r=de.range(e,t);return St.fragment(e,r)},hasBlocks:(e,t)=>t.children.some(r=>de.isBlock(e,r)),hasInlines:(e,t)=>t.children.some(r=>Rt.isText(r)||de.isInline(e,r)),hasTexts:(e,t)=>t.children.every(r=>Rt.isText(r)),insertBreak(e){e.insertBreak()},insertFragment(e,t){e.insertFragment(t)},insertNode(e,t){e.insertNode(t)},insertText(e,t){e.insertText(t)},isBlock:(e,t)=>Ut.isElement(t)&&!e.isInline(t),isEditor(e){if(!ci(e))return!1;var t=PL.get(e);if(t!==void 0)return t;var r=typeof e.addMark=="function"&&typeof e.apply=="function"&&typeof e.deleteBackward=="function"&&typeof e.deleteForward=="function"&&typeof e.deleteFragment=="function"&&typeof e.insertBreak=="function"&&typeof e.insertFragment=="function"&&typeof e.insertNode=="function"&&typeof e.insertText=="function"&&typeof e.isInline=="function"&&typeof e.isVoid=="function"&&typeof e.normalizeNode=="function"&&typeof e.onChange=="function"&&typeof e.removeMark=="function"&&(e.marks===null||ci(e.marks))&&(e.selection===null||Qe.isRange(e.selection))&&St.isNodeList(e.children)&&ss.isOperationList(e.operations);return PL.set(e,r),r},isEnd(e,t,r){var n=de.end(e,r);return cr.equals(t,n)},isEdge:(e,t,r)=>de.isStart(e,t,r)||de.isEnd(e,t,r),isEmpty(e,t){var{children:r}=t,[n]=r;return r.length===0||r.length===1&&Rt.isText(n)&&n.text===""&&!e.isVoid(t)},isInline:(e,t)=>Ut.isElement(t)&&e.isInline(t),isNormalizing(e){var t=AL.get(e);return t===void 0||t},isStart(e,t,r){if(t.offset!==0)return!1;var n=de.start(e,r);return cr.equals(t,n)},isVoid:(e,t)=>Ut.isElement(t)&&e.isVoid(t),last(e,t){var r=de.path(e,t,{edge:"end"});return de.node(e,r)},leaf(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=de.path(e,t,r);return[St.leaf(e,n),n]},*levels(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{at:r=e.selection,reverse:n=!1,voids:i=!1}=t,{match:o}=t;if(o==null&&(o=()=>!0),r){var a=[],s=de.path(e,r);for(var[l,u]of St.levels(e,s))if(o(l,u)&&(a.push([l,u]),!i&&de.isVoid(e,l)))break;n&&a.reverse(),yield*a}},marks(e){var{marks:t,selection:r}=e;if(!r)return null;if(t)return t;if(Qe.isExpanded(r)){var[n]=de.nodes(e,{match:Rt.isText});if(n){var[i]=n;return Da(i,oK)}return{}}var{anchor:o}=r,{path:a}=o,[s]=de.leaf(e,a);if(o.offset===0){var l=de.previous(e,{at:a,match:Rt.isText}),u=de.above(e,{match:y=>de.isBlock(e,y)});if(l&&u){var[c,h]=l,[,S]=u;Ue.isAncestor(S,h)&&(s=c)}}return Da(s,aK)},next(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:r="lowest",voids:n=!1}=t,{match:i,at:o=e.selection}=t;if(o){var a=de.after(e,o,{voids:n});if(a){var[,s]=de.last(e,[]),l=[a.path,s];if(Ue.isPath(o)&&o.length===0)throw new Error("Cannot get the next node from the root node!");if(i==null)if(Ue.isPath(o)){var[u]=de.parent(e,o);i=h=>u.children.includes(h)}else i=()=>!0;var[c]=de.nodes(e,{at:l,match:i,mode:r,voids:n});return c}}},node(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=de.path(e,t,r);return[St.get(e,n),n]},*nodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{at:r=e.selection,mode:n="all",universal:i=!1,reverse:o=!1,voids:a=!1}=t,{match:s}=t;if(s||(s=()=>!0),r){var l,u;if(sK.isSpan(r))l=r[0],u=r[1];else{var c=de.path(e,r,{edge:"start"}),h=de.path(e,r,{edge:"end"});l=o?h:c,u=o?c:h}var S,y=St.nodes(e,{reverse:o,from:l,to:u,pass:Q=>{var[te]=Q;return!a&&de.isVoid(e,te)}}),W=[];for(var[B,N]of y){var U=S&&Ue.compare(N,S[1])===0;if(n!=="highest"||!U){if(s(B,N))if(n==="lowest"&&U)S=[B,N];else{var D=n==="lowest"?S:[B,N];D&&(i?W.push(D):yield D),S=[B,N]}else if(i&&!U&&Rt.isText(B))return}}n==="lowest"&&S&&(i?W.push(S):yield S),i&&(yield*W)}},normalize(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{force:r=!1}=t,n=o=>Lv.get(o)||[];if(de.isNormalizing(e)){if(r){var i=Array.from(St.nodes(e),o=>{var[,a]=o;return a});Lv.set(e,i)}n(e).length!==0&&de.withoutNormalizing(e,()=>{for(var o of n(e))if(St.has(e,o)){var a=de.node(e,o),[s,l]=a;Ut.isElement(s)&&s.children.length===0&&e.normalizeNode(a)}for(var u=42*n(e).length,c=0;n(e).length!==0;){if(c>u)throw new Error(`
|
|
|
Could not completely normalize the editor after `.concat(u,` iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state.
|
|
|
`));var h=n(e).pop();if(St.has(e,h)){var S=de.node(e,h);e.normalizeNode(S)}c++}})}},parent(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=de.path(e,t,r),i=Ue.parent(n);return de.node(e,i)},path(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{depth:n,edge:i}=r;if(Ue.isPath(t)){if(i==="start"){var[,o]=St.first(e,t);t=o}else if(i==="end"){var[,a]=St.last(e,t);t=a}}return Qe.isRange(t)&&(t=i==="start"?Qe.start(t):i==="end"?Qe.end(t):Ue.common(t.anchor.path,t.focus.path)),cr.isPoint(t)&&(t=t.path),n!=null&&(t=t.slice(0,n)),t},hasPath:(e,t)=>St.has(e,t),pathRef(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:n="forward"}=r,i={current:t,affinity:n,unref(){var{current:o}=i;return de.pathRefs(e).delete(i),i.current=null,o}};return de.pathRefs(e).add(i),i},pathRefs(e){var t=DL.get(e);return t||(t=new Set,DL.set(e,t)),t},point(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{edge:n="start"}=r;if(Ue.isPath(t)){var i;if(n==="end"){var[,o]=St.last(e,t);i=o}else{var[,a]=St.first(e,t);i=a}var s=St.get(e,i);if(!Rt.isText(s))throw new Error("Cannot get the ".concat(n," point in the node at path [").concat(t,"] because it has no ").concat(n," text node."));return{path:i,offset:n==="end"?s.text.length:0}}if(Qe.isRange(t)){var[l,u]=Qe.edges(t);return n==="start"?l:u}return t},pointRef(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:n="forward"}=r,i={current:t,affinity:n,unref(){var{current:o}=i;return de.pointRefs(e).delete(i),i.current=null,o}};return de.pointRefs(e).add(i),i},pointRefs(e){var t=OL.get(e);return t||(t=new Set,OL.set(e,t)),t},*positions(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{at:r=e.selection,unit:n="offset",reverse:i=!1,voids:o=!1}=t;if(r){var a=de.range(e,r),[s,l]=Qe.edges(a),u=i?l:s,c=!1,h="",S=0,y=0,W=0;for(var[B,N]of de.nodes(e,{at:r,reverse:i,voids:o})){if(Ut.isElement(B)){if(!o&&e.isVoid(B)){yield de.start(e,N);continue}if(e.isInline(B))continue;if(de.hasInlines(e,B)){var U=Ue.isAncestor(N,l.path)?l:de.end(e,N),D=Ue.isAncestor(N,s.path)?s:de.start(e,N);h=de.string(e,{anchor:D,focus:U},{voids:o}),c=!0}}if(Rt.isText(B)){var Q=Ue.equals(N,u.path);for(Q?(y=i?u.offset:B.text.length-u.offset,W=u.offset):(y=B.text.length,W=i?y:0),(Q||c||n==="offset")&&(yield{path:N,offset:W},c=!1);;){if(S===0){if(h==="")break;S=te(h,n,i),h=zE(h,S,i)[1]}if(W=i?W-S:W+S,(y-=S)<0){S=-y;break}S=0,yield{path:N,offset:W}}}}}function te(he,Ee,ve){return Ee==="character"?HE(he,ve):Ee==="word"?function(De){for(var Pe=arguments.length>1&&arguments[1]!==void 0&&arguments[1],qe=0,ot=!1;De.length>0;){var et=HE(De,Pe),[gt,dt]=zE(De,et,Pe);if(jV(gt,dt,Pe))ot=!0,qe+=et;else{if(ot)break;qe+=et}De=dt}return qe}(he,ve):Ee==="line"||Ee==="block"?he.length:1}},previous(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:r="lowest",voids:n=!1}=t,{match:i,at:o=e.selection}=t;if(o){var a=de.before(e,o,{voids:n});if(a){var[,s]=de.first(e,[]),l=[a.path,s];if(Ue.isPath(o)&&o.length===0)throw new Error("Cannot get the previous node from the root node!");if(i==null)if(Ue.isPath(o)){var[u]=de.parent(e,o);i=h=>u.children.includes(h)}else i=()=>!0;var[c]=de.nodes(e,{reverse:!0,at:l,match:i,mode:r,voids:n});return c}}},range:(e,t,r)=>Qe.isRange(t)&&!r?t:{anchor:de.start(e,t),focus:de.end(e,r||t)},rangeRef(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:n="forward"}=r,i={current:t,affinity:n,unref(){var{current:o}=i;return de.rangeRefs(e).delete(i),i.current=null,o}};return de.rangeRefs(e).add(i),i},rangeRefs(e){var t=_L.get(e);return t||(t=new Set,_L.set(e,t)),t},removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){AL.set(e,t)},start:(e,t)=>de.point(e,t,{edge:"start"}),string(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:n=!1}=r,i=de.range(e,t),[o,a]=Qe.edges(i),s="";for(var[l,u]of de.nodes(e,{at:i,match:Rt.isText,voids:n})){var c=l.text;Ue.equals(u,a.path)&&(c=c.slice(0,a.offset)),Ue.equals(u,o.path)&&(c=c.slice(o.offset)),s+=c}return s},unhangRange(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:n=!1}=r,[i,o]=Qe.edges(t);if(i.offset!==0||o.offset!==0||Qe.isCollapsed(t))return t;var a=de.above(e,{at:o,match:S=>de.isBlock(e,S)}),s=a?a[1]:[],l={anchor:de.start(e,[]),focus:o},u=!0;for(var[c,h]of de.nodes(e,{at:l,match:Rt.isText,reverse:!0,voids:n}))if(u)u=!1;else if(c.text!==""||Ue.isBefore(h,s)){o={path:h,offset:c.text.length};break}return{anchor:i,focus:o}},void(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return de.above(e,dc(dc({},t),{},{match:r=>de.isVoid(e,r)}))},withoutNormalizing(e,t){var r=de.isNormalizing(e);de.setNormalizing(e,!1);try{t()}finally{de.setNormalizing(e,r)}de.normalize(e)}},Uye={isLocation:e=>Ue.isPath(e)||cr.isPoint(e)||Qe.isRange(e)},sK={isSpan:e=>Array.isArray(e)&&e.length===2&&e.every(Ue.isPath)},lK=["children"],uK=["text"],IL=new WeakMap,St={ancestor(e,t){var r=St.get(e,t);if(Rt.isText(r))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(r));return r},*ancestors(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};for(var n of Ue.ancestors(t,r)){var i=[St.ancestor(e,n),n];yield i}},child(e,t){if(Rt.isText(e))throw new Error("Cannot get the child of a text node: ".concat(JSON.stringify(e)));var r=e.children[t];if(r==null)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(JSON.stringify(e)));return r},*children(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{reverse:n=!1}=r,i=St.ancestor(e,t),{children:o}=i,a=n?o.length-1:0;n?a>=0:a<o.length;){var s=St.child(i,a),l=t.concat(a);yield[s,l],a=n?a-1:a+1}},common(e,t,r){var n=Ue.common(t,r);return[St.get(e,n),n]},descendant(e,t){var r=St.get(e,t);if(de.isEditor(r))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(r));return r},*descendants(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var[r,n]of St.nodes(e,t))n.length!==0&&(yield[r,n])},*elements(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var[r,n]of St.nodes(e,t))Ut.isElement(r)&&(yield[r,n])},extractProps:e=>Ut.isAncestor(e)?Da(e,lK):Da(e,uK),first(e,t){for(var r=t.slice(),n=St.get(e,r);n&&!Rt.isText(n)&&n.children.length!==0;)n=n.children[0],r.push(0);return[n,r]},fragment(e,t){if(Rt.isText(e))throw new Error("Cannot get a fragment starting from a root text node: ".concat(JSON.stringify(e)));var r=kv({children:e.children},n=>{var[i,o]=Qe.edges(t),a=St.nodes(n,{reverse:!0,pass:S=>{var[,y]=S;return!Qe.includes(t,y)}});for(var[,s]of a){if(!Qe.includes(t,s)){var l=St.parent(n,s),u=s[s.length-1];l.children.splice(u,1)}if(Ue.equals(s,o.path)){var c=St.leaf(n,s);c.text=c.text.slice(0,o.offset)}if(Ue.equals(s,i.path)){var h=St.leaf(n,s);h.text=h.text.slice(i.offset)}}de.isEditor(n)&&(n.selection=null)});return r.children},get(e,t){for(var r=e,n=0;n<t.length;n++){var i=t[n];if(Rt.isText(r)||!r.children[i])throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(JSON.stringify(e)));r=r.children[i]}return r},has(e,t){for(var r=e,n=0;n<t.length;n++){var i=t[n];if(Rt.isText(r)||!r.children[i])return!1;r=r.children[i]}return!0},isNode:e=>Rt.isText(e)||Ut.isElement(e)||de.isEditor(e),isNodeList(e){if(!Array.isArray(e))return!1;var t=IL.get(e);if(t!==void 0)return t;var r=e.every(n=>St.isNode(n));return IL.set(e,r),r},last(e,t){for(var r=t.slice(),n=St.get(e,r);n&&!Rt.isText(n)&&n.children.length!==0;){var i=n.children.length-1;n=n.children[i],r.push(i)}return[n,r]},leaf(e,t){var r=St.get(e,t);if(!Rt.isText(r))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(r));return r},*levels(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};for(var n of Ue.levels(t,r)){var i=St.get(e,n);yield[i,n]}},matches:(e,t)=>Ut.isElement(e)&&Ut.isElementProps(t)&&Ut.matches(e,t)||Rt.isText(e)&&Rt.isTextProps(t)&&Rt.matches(e,t),*nodes(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{pass:r,reverse:n=!1}=t,{from:i=[],to:o}=t,a=new Set,s=[],l=e;!o||!(n?Ue.isBefore(s,o):Ue.isAfter(s,o));)if(a.has(l)||(yield[l,s]),a.has(l)||Rt.isText(l)||l.children.length===0||r!=null&&r([l,s])!==!1){if(s.length===0)break;if(!n){var u=Ue.next(s);if(St.has(e,u)){s=u,l=St.get(e,s);continue}}n&&s[s.length-1]!==0?(s=Ue.previous(s),l=St.get(e,s)):(s=Ue.parent(s),l=St.get(e,s),a.add(l))}else{a.add(l);var c=n?l.children.length-1:0;Ue.isAncestor(s,i)&&(c=i[s.length]),s=s.concat(c),l=St.get(e,s)}},parent(e,t){var r=Ue.parent(t),n=St.get(e,r);if(Rt.isText(n))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return n},string:e=>Rt.isText(e)?e.text:e.children.map(St.string).join(""),*texts(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var[r,n]of St.nodes(e,t))Rt.isText(r)&&(yield[r,n])}};function ML(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _n(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ML(Object(r),!0).forEach(function(n){Xo(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ML(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var ss={isNodeOperation:e=>ss.isOperation(e)&&e.type.endsWith("_node"),isOperation(e){if(!ci(e))return!1;switch(e.type){case"insert_node":case"remove_node":return Ue.isPath(e.path)&&St.isNode(e.node);case"insert_text":case"remove_text":return typeof e.offset=="number"&&typeof e.text=="string"&&Ue.isPath(e.path);case"merge_node":return typeof e.position=="number"&&Ue.isPath(e.path)&&ci(e.properties);case"move_node":return Ue.isPath(e.path)&&Ue.isPath(e.newPath);case"set_node":return Ue.isPath(e.path)&&ci(e.properties)&&ci(e.newProperties);case"set_selection":return e.properties===null&&Qe.isRange(e.newProperties)||e.newProperties===null&&Qe.isRange(e.properties)||ci(e.properties)&&ci(e.newProperties);case"split_node":return Ue.isPath(e.path)&&typeof e.position=="number"&&ci(e.properties);default:return!1}},isOperationList:e=>Array.isArray(e)&&e.every(t=>ss.isOperation(t)),isSelectionOperation:e=>ss.isOperation(e)&&e.type.endsWith("_selection"),isTextOperation:e=>ss.isOperation(e)&&e.type.endsWith("_text"),inverse(e){switch(e.type){case"insert_node":return _n(_n({},e),{},{type:"remove_node"});case"insert_text":return _n(_n({},e),{},{type:"remove_text"});case"merge_node":return _n(_n({},e),{},{type:"split_node",path:Ue.previous(e.path)});case"move_node":var{newPath:t,path:r}=e;if(Ue.equals(t,r))return e;if(Ue.isSibling(r,t))return _n(_n({},e),{},{path:t,newPath:r});var n=Ue.transform(r,e),i=Ue.transform(Ue.next(r),e);return _n(_n({},e),{},{path:n,newPath:i});case"remove_node":return _n(_n({},e),{},{type:"insert_node"});case"remove_text":return _n(_n({},e),{},{type:"insert_text"});case"set_node":var{properties:o,newProperties:a}=e;return _n(_n({},e),{},{properties:a,newProperties:o});case"set_selection":var{properties:s,newProperties:l}=e;return _n(_n({},e),{},s==null?{properties:l,newProperties:null}:l==null?{properties:null,newProperties:s}:{properties:l,newProperties:s});case"split_node":return _n(_n({},e),{},{type:"merge_node",path:Ue.next(e.path)})}}},Ue={ancestors(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:r=!1}=t,n=Ue.levels(e,t);return n=r?n.slice(1):n.slice(0,-1)},common(e,t){for(var r=[],n=0;n<e.length&&n<t.length;n++){var i=e[n];if(i!==t[n])break;r.push(i)}return r},compare(e,t){for(var r=Math.min(e.length,t.length),n=0;n<r;n++){if(e[n]<t[n])return-1;if(e[n]>t[n])return 1}return 0},endsAfter(e,t){var r=e.length-1,n=e.slice(0,r),i=t.slice(0,r),o=e[r],a=t[r];return Ue.equals(n,i)&&o>a},endsAt(e,t){var r=e.length,n=e.slice(0,r),i=t.slice(0,r);return Ue.equals(n,i)},endsBefore(e,t){var r=e.length-1,n=e.slice(0,r),i=t.slice(0,r),o=e[r],a=t[r];return Ue.equals(n,i)&&o<a},equals:(e,t)=>e.length===t.length&&e.every((r,n)=>r===t[n]),hasPrevious:e=>e[e.length-1]>0,isAfter:(e,t)=>Ue.compare(e,t)===1,isAncestor:(e,t)=>e.length<t.length&&Ue.compare(e,t)===0,isBefore:(e,t)=>Ue.compare(e,t)===-1,isChild:(e,t)=>e.length===t.length+1&&Ue.compare(e,t)===0,isCommon:(e,t)=>e.length<=t.length&&Ue.compare(e,t)===0,isDescendant:(e,t)=>e.length>t.length&&Ue.compare(e,t)===0,isParent:(e,t)=>e.length+1===t.length&&Ue.compare(e,t)===0,isPath:e=>Array.isArray(e)&&(e.length===0||typeof e[0]=="number"),isSibling(e,t){if(e.length!==t.length)return!1;var r=e.slice(0,-1),n=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&Ue.equals(r,n)},levels(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:r=!1}=t,n=[],i=0;i<=e.length;i++)n.push(e.slice(0,i));return r&&n.reverse(),n},next(e){if(e.length===0)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},parent(e){if(e.length===0)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(e.length===0)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!Ue.isAncestor(t,e)&&!Ue.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return kv(e,n=>{var{affinity:i="forward"}=r;if(e&&(e==null?void 0:e.length)!==0){if(n===null)return null;switch(t.type){case"insert_node":var{path:o}=t;(Ue.equals(o,n)||Ue.endsBefore(o,n)||Ue.isAncestor(o,n))&&(n[o.length-1]+=1);break;case"remove_node":var{path:a}=t;if(Ue.equals(a,n)||Ue.isAncestor(a,n))return null;Ue.endsBefore(a,n)&&(n[a.length-1]-=1);break;case"merge_node":var{path:s,position:l}=t;Ue.equals(s,n)||Ue.endsBefore(s,n)?n[s.length-1]-=1:Ue.isAncestor(s,n)&&(n[s.length-1]-=1,n[s.length]+=l);break;case"split_node":var{path:u,position:c}=t;if(Ue.equals(u,n)){if(i==="forward")n[n.length-1]+=1;else if(i!=="backward")return null}else Ue.endsBefore(u,n)?n[u.length-1]+=1:Ue.isAncestor(u,n)&&e[u.length]>=c&&(n[u.length-1]+=1,n[u.length]-=c);break;case"move_node":var{path:h,newPath:S}=t;if(Ue.equals(h,S))return;if(Ue.isAncestor(h,n)||Ue.equals(h,n)){var y=S.slice();return Ue.endsBefore(h,S)&&h.length<S.length&&(y[h.length-1]-=1),y.concat(n.slice(h.length))}Ue.isSibling(h,S)&&(Ue.isAncestor(S,n)||Ue.equals(S,n))?Ue.endsBefore(h,n)?n[h.length-1]-=1:n[h.length-1]+=1:Ue.endsBefore(S,n)||Ue.equals(S,n)||Ue.isAncestor(S,n)?(Ue.endsBefore(h,n)&&(n[h.length-1]-=1),n[S.length-1]+=1):Ue.endsBefore(h,n)&&(Ue.equals(S,n)&&(n[S.length-1]+=1),n[h.length-1]-=1)}}})}},cK={transform(e,t){var{current:r,affinity:n}=e;if(r!=null){var i=Ue.transform(r,t,{affinity:n});e.current=i,i==null&&e.unref()}}};function BL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function FL(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?BL(Object(r),!0).forEach(function(n){Xo(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):BL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var cr={compare(e,t){var r=Ue.compare(e.path,t.path);return r===0?e.offset<t.offset?-1:e.offset>t.offset?1:0:r},isAfter:(e,t)=>cr.compare(e,t)===1,isBefore:(e,t)=>cr.compare(e,t)===-1,equals:(e,t)=>e.offset===t.offset&&Ue.equals(e.path,t.path),isPoint:e=>ci(e)&&typeof e.offset=="number"&&Ue.isPath(e.path),transform(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return kv(e,n=>{if(n===null)return null;var{affinity:i="forward"}=r,{path:o,offset:a}=n;switch(t.type){case"insert_node":case"move_node":n.path=Ue.transform(o,t,r);break;case"insert_text":Ue.equals(t.path,o)&&t.offset<=a&&(n.offset+=t.text.length);break;case"merge_node":Ue.equals(t.path,o)&&(n.offset+=t.position),n.path=Ue.transform(o,t,r);break;case"remove_text":Ue.equals(t.path,o)&&t.offset<=a&&(n.offset-=Math.min(a-t.offset,t.text.length));break;case"remove_node":if(Ue.equals(t.path,o)||Ue.isAncestor(t.path,o))return null;n.path=Ue.transform(o,t,r);break;case"split_node":if(Ue.equals(t.path,o)){if(t.position===a&&i==null)return null;(t.position<a||t.position===a&&i==="forward")&&(n.offset-=t.position,n.path=Ue.transform(o,t,FL(FL({},r),{},{affinity:"forward"})))}else n.path=Ue.transform(o,t,r)}})}},dK={transform(e,t){var{current:r,affinity:n}=e;if(r!=null){var i=cr.transform(r,t,{affinity:n});e.current=i,i==null&&e.unref()}}},hK=["anchor","focus"];function NL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}var Qe={edges(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:r=!1}=t,{anchor:n,focus:i}=e;return Qe.isBackward(e)===r?[n,i]:[i,n]},end(e){var[,t]=Qe.edges(e);return t},equals:(e,t)=>cr.equals(e.anchor,t.anchor)&&cr.equals(e.focus,t.focus),includes(e,t){if(Qe.isRange(t)){if(Qe.includes(e,t.anchor)||Qe.includes(e,t.focus))return!0;var[r,n]=Qe.edges(e),[i,o]=Qe.edges(t);return cr.isBefore(r,i)&&cr.isAfter(n,o)}var[a,s]=Qe.edges(e),l=!1,u=!1;return cr.isPoint(t)?(l=cr.compare(t,a)>=0,u=cr.compare(t,s)<=0):(l=Ue.compare(t,a.path)>=0,u=Ue.compare(t,s.path)<=0),l&&u},intersection(e,t){var r=Da(e,hK),[n,i]=Qe.edges(e),[o,a]=Qe.edges(t),s=cr.isBefore(n,o)?o:n,l=cr.isBefore(i,a)?i:a;return cr.isBefore(l,s)?null:function(u){for(var c=1;c<arguments.length;c++){var h=arguments[c]!=null?arguments[c]:{};c%2?NL(Object(h),!0).forEach(function(S){Xo(u,S,h[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(h)):NL(Object(h)).forEach(function(S){Object.defineProperty(u,S,Object.getOwnPropertyDescriptor(h,S))})}return u}({anchor:s,focus:l},r)},isBackward(e){var{anchor:t,focus:r}=e;return cr.isAfter(t,r)},isCollapsed(e){var{anchor:t,focus:r}=e;return cr.equals(t,r)},isExpanded:e=>!Qe.isCollapsed(e),isForward:e=>!Qe.isBackward(e),isRange:e=>ci(e)&&cr.isPoint(e.anchor)&&cr.isPoint(e.focus),*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=Qe.edges(e);return t},transform(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return kv(e,n=>{if(n===null)return null;var i,o,{affinity:a="inward"}=r;if(a==="inward"){var s=Qe.isCollapsed(n);Qe.isForward(n)?(i="forward",o=s?i:"backward"):(i="backward",o=s?i:"forward")}else a==="outward"?Qe.isForward(n)?(i="backward",o="forward"):(i="forward",o="backward"):(i=a,o=a);var l=cr.transform(n.anchor,t,{affinity:i}),u=cr.transform(n.focus,t,{affinity:o});if(!l||!u)return null;n.anchor=l,n.focus=u})}},fK={transform(e,t){var{current:r,affinity:n}=e;if(r!=null){var i=Qe.transform(r,t,{affinity:n});e.current=i,i==null&&e.unref()}}},jL=(e,t)=>{for(var r in e){var n=e[r],i=t[r];if(ci(n)&&ci(i)){if(!jL(n,i))return!1}else if(Array.isArray(n)&&Array.isArray(i)){if(n.length!==i.length)return!1;for(var o=0;o<n.length;o++)if(n[o]!==i[o])return!1}else if(n!==i)return!1}for(var a in t)if(e[a]===void 0&&t[a]!==void 0)return!1;return!0},pK=["text"],gK=["anchor","focus"];function UL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Oa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?UL(Object(r),!0).forEach(function(n){Xo(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):UL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Rt={equals(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{loose:n=!1}=r;function i(o){return Da(o,pK)}return jL(n?i(e):e,n?i(t):t)},isText:e=>ci(e)&&typeof e.text=="string",isTextList:e=>Array.isArray(e)&&e.every(t=>Rt.isText(t)),isTextProps:e=>e.text!==void 0,matches(e,t){for(var r in t)if(r!=="text"&&(!e.hasOwnProperty(r)||e[r]!==t[r]))return!1;return!0},decorations(e,t){var r=[Oa({},e)];for(var n of t){var i=Da(n,gK),[o,a]=Qe.edges(n),s=[],l=0;for(var u of r){var{length:c}=u.text,h=l;if(l+=c,o.offset<=h&&a.offset>=l)Object.assign(u,i),s.push(u);else if(o.offset!==a.offset&&(o.offset===l||a.offset===h)||o.offset>l||a.offset<h||a.offset===h&&h!==0)s.push(u);else{var S=u,y=void 0,W=void 0;if(a.offset<l){var B=a.offset-h;W=Oa(Oa({},S),{},{text:S.text.slice(B)}),S=Oa(Oa({},S),{},{text:S.text.slice(0,B)})}if(o.offset>h){var N=o.offset-h;y=Oa(Oa({},S),{},{text:S.text.slice(0,N)}),S=Oa(Oa({},S),{},{text:S.text.slice(N)})}Object.assign(S,i),y&&s.push(y),s.push(S),W&&s.push(W)}}r=s}return r}};function HL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Oh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?HL(Object(r),!0).forEach(function(n){Xo(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var vK={transform(e,t){e.children=CL(e.children);var r=e.selection&&CL(e.selection);try{r=((n,i,o)=>{switch(o.type){case"insert_node":var{path:a,node:s}=o,l=St.parent(n,a),u=a[a.length-1];if(u>l.children.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(a,"] because the destination is past the end of the node."));if(l.children.splice(u,0,s),i)for(var[c,h]of Qe.points(i))i[h]=cr.transform(c,o);break;case"insert_text":var{path:S,offset:y,text:W}=o;if(W.length===0)break;var B=St.leaf(n,S),N=B.text.slice(0,y),U=B.text.slice(y);if(B.text=N+W+U,i)for(var[D,Q]of Qe.points(i))i[Q]=cr.transform(D,o);break;case"merge_node":var{path:te}=o,he=St.get(n,te),Ee=Ue.previous(te),ve=St.get(n,Ee),De=St.parent(n,te),Pe=te[te.length-1];if(Rt.isText(he)&&Rt.isText(ve))ve.text+=he.text;else{if(Rt.isText(he)||Rt.isText(ve))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(te,"] to nodes of different interfaces: ").concat(he," ").concat(ve));ve.children.push(...he.children)}if(De.children.splice(Pe,1),i)for(var[qe,ot]of Qe.points(i))i[ot]=cr.transform(qe,o);break;case"move_node":var{path:et,newPath:gt}=o;if(Ue.isAncestor(et,gt))throw new Error("Cannot move a path [".concat(et,"] to new path [").concat(gt,"] because the destination is inside itself."));var dt=St.get(n,et),ht=St.parent(n,et),pt=et[et.length-1];ht.children.splice(pt,1);var Dt=Ue.transform(et,o),Ft=St.get(n,Ue.parent(Dt)),Bt=Dt[Dt.length-1];if(Ft.children.splice(Bt,0,dt),i)for(var[It,Re]of Qe.points(i))i[Re]=cr.transform(It,o);break;case"remove_node":var{path:Te}=o,Fe=Te[Te.length-1];if(St.parent(n,Te).children.splice(Fe,1),i)for(var[rt,vt]of Qe.points(i)){var ut=cr.transform(rt,o);if(i!=null&&ut!=null)i[vt]=ut;else{var kt=void 0,Xt=void 0;for(var[qt,or]of St.texts(n)){if(Ue.compare(or,Te)!==-1){Xt=[qt,or];break}kt=[qt,or]}var ft=!1;kt&&Xt&&(ft=Ue.equals(Xt[1],Te)?!Ue.hasPrevious(Xt[1]):Ue.common(kt[1],Te).length<Ue.common(Xt[1],Te).length),kt&&!ft?(rt.path=kt[1],rt.offset=kt[0].text.length):Xt?(rt.path=Xt[1],rt.offset=0):i=null}}break;case"remove_text":var{path:br,offset:lr,text:Gt}=o;if(Gt.length===0)break;var ur=St.leaf(n,br),yn=ur.text.slice(0,lr),Ar=ur.text.slice(lr+Gt.length);if(ur.text=yn+Ar,i)for(var[Hr,on]of Qe.points(i))i[on]=cr.transform(Hr,o);break;case"set_node":var{path:vi,properties:Sr,newProperties:Mi}=o;if(vi.length===0)throw new Error("Cannot set properties on the root node!");var zo=St.get(n,vi);for(var ma in Mi){if(ma==="children"||ma==="text")throw new Error('Cannot set the "'.concat(ma,'" property of nodes!'));var qd=Mi[ma];qd==null?delete zo[ma]:zo[ma]=qd}for(var Yu in Sr)Mi.hasOwnProperty(Yu)||delete zo[Yu];break;case"set_selection":var{newProperties:Wo}=o;if(Wo==null)i=Wo;else{if(i==null){if(!Qe.isRange(Wo))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(JSON.stringify(Wo)," when there is no current selection."));i=Oh({},Wo)}for(var ya in Wo){var Ka=Wo[ya];if(Ka==null){if(ya==="anchor"||ya==="focus")throw new Error('Cannot remove the "'.concat(ya,'" selection property'));delete i[ya]}else i[ya]=Ka}}break;case"split_node":var{path:mi,position:yi,properties:bi}=o;if(mi.length===0)throw new Error('Cannot apply a "split_node" operation at path ['.concat(mi,"] because the root node cannot be split."));var Ci,ti=St.get(n,mi),Co=St.parent(n,mi),Vg=mi[mi.length-1];if(Rt.isText(ti)){var bl=ti.text.slice(0,yi),$a=ti.text.slice(yi);ti.text=bl,Ci=Oh(Oh({},bi),{},{text:$a})}else{var eh=ti.children.slice(0,yi),Zu=ti.children.slice(yi);ti.children=eh,Ci=Oh(Oh({},bi),{},{children:Zu})}if(Co.children.splice(Vg+1,0,Ci),i)for(var[th,Go]of Qe.points(i))i[Go]=cr.transform(th,o)}return i})(e,r,t)}finally{e.children=TL(e.children),e.selection=r?Il(r)?TL(r):r:null}}},mK=["text"],yK=["children"];function zL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function WL(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zL(Object(r),!0).forEach(function(n){Xo(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var bK={insertNodes(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};de.withoutNormalizing(e,()=>{var{hanging:n=!1,voids:i=!1,mode:o="lowest"}=r,{at:a,match:s,select:l}=r;if(St.isNode(t)&&(t=[t]),t.length!==0){var[u]=t;if(a||(a=e.selection?e.selection:e.children.length>0?de.end(e,[]):[0],l=!0),l==null&&(l=!1),Qe.isRange(a))if(n||(a=de.unhangRange(e,a)),Qe.isCollapsed(a))a=a.anchor;else{var[,c]=Qe.edges(a),h=de.pointRef(e,c);Ve.delete(e,{at:a}),a=h.unref()}if(cr.isPoint(a)){s==null&&(s=Rt.isText(u)?Ee=>Rt.isText(Ee):e.isInline(u)?Ee=>Rt.isText(Ee)||de.isInline(e,Ee):Ee=>de.isBlock(e,Ee));var[S]=de.nodes(e,{at:a.path,match:s,mode:o,voids:i});if(!S)return;var[,y]=S,W=de.pathRef(e,y),B=de.isEnd(e,a,y);Ve.splitNodes(e,{at:a,match:s,mode:o,voids:i});var N=W.unref();a=B?Ue.next(N):N}var U=Ue.parent(a),D=a[a.length-1];if(i||!de.void(e,{at:U})){for(var Q of t){var te=U.concat(D);D++,e.apply({type:"insert_node",path:te,node:Q}),a=Ue.next(a)}if(a=Ue.previous(a),l){var he=de.end(e,a);he&&Ve.select(e,he)}}}})},liftNodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};de.withoutNormalizing(e,()=>{var{at:r=e.selection,mode:n="lowest",voids:i=!1}=t,{match:o}=t;if(o==null&&(o=Ue.isPath(r)?hc(e,r):Q=>de.isBlock(e,Q)),r){var a=de.nodes(e,{at:r,match:o,mode:n,voids:i}),s=Array.from(a,Q=>{var[,te]=Q;return de.pathRef(e,te)});for(var l of s){var u=l.unref();if(u.length<2)throw new Error("Cannot lift node at a path [".concat(u,"] because it has a depth of less than `2`."));var c=de.node(e,Ue.parent(u)),[h,S]=c,y=u[u.length-1],{length:W}=h.children;if(W===1){var B=Ue.next(S);Ve.moveNodes(e,{at:u,to:B,voids:i}),Ve.removeNodes(e,{at:S,voids:i})}else if(y===0)Ve.moveNodes(e,{at:u,to:S,voids:i});else if(y===W-1){var N=Ue.next(S);Ve.moveNodes(e,{at:u,to:N,voids:i})}else{var U=Ue.next(u),D=Ue.next(S);Ve.splitNodes(e,{at:U,voids:i}),Ve.moveNodes(e,{at:u,to:D,voids:i})}}}})},mergeNodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};de.withoutNormalizing(e,()=>{var{match:r,at:n=e.selection}=t,{hanging:i=!1,voids:o=!1,mode:a="lowest"}=t;if(n){if(r==null)if(Ue.isPath(n)){var[s]=de.parent(e,n);r=Pe=>s.children.includes(Pe)}else r=Pe=>de.isBlock(e,Pe);if(!i&&Qe.isRange(n)&&(n=de.unhangRange(e,n)),Qe.isRange(n))if(Qe.isCollapsed(n))n=n.anchor;else{var[,l]=Qe.edges(n),u=de.pointRef(e,l);Ve.delete(e,{at:n}),n=u.unref(),t.at==null&&Ve.select(e,n)}var[c]=de.nodes(e,{at:n,match:r,voids:o,mode:a}),h=de.previous(e,{at:n,match:r,voids:o,mode:a});if(c&&h){var[S,y]=c,[W,B]=h;if(y.length!==0&&B.length!==0){var N,U,D=Ue.next(B),Q=Ue.common(y,B),te=Ue.isSibling(y,B),he=Array.from(de.levels(e,{at:y}),Pe=>{var[qe]=Pe;return qe}).slice(Q.length).slice(0,-1),Ee=de.above(e,{at:y,mode:"highest",match:Pe=>he.includes(Pe)&&GL(e,Pe)}),ve=Ee&&de.pathRef(e,Ee[1]);if(Rt.isText(S)&&Rt.isText(W)){var De=Da(S,mK);U=W.text.length,N=De}else{if(!Ut.isElement(S)||!Ut.isElement(W))throw new Error("Cannot merge the node at path [".concat(y,"] with the previous sibling because it is not the same kind: ").concat(JSON.stringify(S)," ").concat(JSON.stringify(W)));De=Da(S,yK),U=W.children.length,N=De}te||Ve.moveNodes(e,{at:y,to:D,voids:o}),ve&&Ve.removeNodes(e,{at:ve.current,voids:o}),Ut.isElement(W)&&de.isEmpty(e,W)||Rt.isText(W)&&W.text===""&&B[B.length-1]!==0?Ve.removeNodes(e,{at:B,voids:o}):e.apply({type:"merge_node",path:D,position:U,properties:N}),ve&&ve.unref()}}}})},moveNodes(e,t){de.withoutNormalizing(e,()=>{var{to:r,at:n=e.selection,mode:i="lowest",voids:o=!1}=t,{match:a}=t;if(n){a==null&&(a=Ue.isPath(n)?hc(e,n):y=>de.isBlock(e,y));var s=de.pathRef(e,r),l=de.nodes(e,{at:n,match:a,mode:i,voids:o}),u=Array.from(l,y=>{var[,W]=y;return de.pathRef(e,W)});for(var c of u){var h=c.unref(),S=s.current;h.length!==0&&e.apply({type:"move_node",path:h,newPath:S}),s.current&&Ue.isSibling(S,h)&&Ue.isAfter(S,h)&&(s.current=Ue.next(s.current))}s.unref()}})},removeNodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};de.withoutNormalizing(e,()=>{var{hanging:r=!1,voids:n=!1,mode:i="lowest"}=t,{at:o=e.selection,match:a}=t;if(o){a==null&&(a=Ue.isPath(o)?hc(e,o):S=>de.isBlock(e,S)),!r&&Qe.isRange(o)&&(o=de.unhangRange(e,o));var s=de.nodes(e,{at:o,match:a,mode:i,voids:n}),l=Array.from(s,S=>{var[,y]=S;return de.pathRef(e,y)});for(var u of l){var c=u.unref();if(c){var[h]=de.node(e,c);e.apply({type:"remove_node",path:c,node:h})}}}})},setNodes(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};de.withoutNormalizing(e,()=>{var{match:n,at:i=e.selection}=r,{hanging:o=!1,mode:a="lowest",split:s=!1,voids:l=!1}=r;if(i){if(n==null&&(n=Ue.isPath(i)?hc(e,i):he=>de.isBlock(e,he)),!o&&Qe.isRange(i)&&(i=de.unhangRange(e,i)),s&&Qe.isRange(i)){if(Qe.isCollapsed(i)&&de.leaf(e,i.anchor)[0].text.length>0)return;var u=de.rangeRef(e,i,{affinity:"inward"}),[c,h]=Qe.edges(i),S=a==="lowest"?"lowest":"highest",y=de.isEnd(e,h,h.path);Ve.splitNodes(e,{at:h,match:n,mode:S,voids:l,always:!y});var W=de.isStart(e,c,c.path);Ve.splitNodes(e,{at:c,match:n,mode:S,voids:l,always:!W}),i=u.unref(),r.at==null&&Ve.select(e,i)}for(var[B,N]of de.nodes(e,{at:i,match:n,mode:a,voids:l})){var U={},D={};if(N.length!==0){var Q=!1;for(var te in t)te!=="children"&&te!=="text"&&t[te]!==B[te]&&(Q=!0,B.hasOwnProperty(te)&&(U[te]=B[te]),t[te]!=null&&(D[te]=t[te]));Q&&e.apply({type:"set_node",path:N,properties:U,newProperties:D})}}}})},splitNodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};de.withoutNormalizing(e,()=>{var{mode:r="lowest",voids:n=!1}=t,{match:i,at:o=e.selection,height:a=0,always:s=!1}=t;if(i==null&&(i=dt=>de.isBlock(e,dt)),Qe.isRange(o)&&(o=EK(e,o)),Ue.isPath(o)){var l=o,u=de.point(e,l),[c]=de.parent(e,l);i=dt=>dt===c,a=u.path.length-l.length+1,o=u,s=!0}if(o){var h=de.pointRef(e,o,{affinity:"backward"}),[S]=de.nodes(e,{at:o,match:i,mode:r,voids:n});if(S){var y=de.void(e,{at:o,mode:"highest"});if(!n&&y){var[W,B]=y;if(Ut.isElement(W)&&e.isInline(W)){var N=de.after(e,B);if(!N){var U=Ue.next(B);Ve.insertNodes(e,{text:""},{at:U,voids:n}),N=de.point(e,U)}o=N,s=!0}a=o.path.length-B.length+1,s=!0}var D=de.pointRef(e,o),Q=o.path.length-a,[,te]=S,he=o.path.slice(0,Q),Ee=a===0?o.offset:o.path[Q]+0;for(var[ve,De]of de.levels(e,{at:he,reverse:!0,voids:n})){var Pe=!1;if(De.length<te.length||De.length===0||!n&&de.isVoid(e,ve))break;var qe=h.current,ot=de.isEnd(e,qe,De);if(s||!h||!de.isEdge(e,qe,De)){Pe=!0;var et=St.extractProps(ve);e.apply({type:"split_node",path:De,position:Ee,properties:et})}Ee=De[De.length-1]+(Pe||ot?1:0)}if(t.at==null){var gt=D.current||de.end(e,[]);Ve.select(e,gt)}h.unref(),D.unref()}}})},unsetNodes(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Array.isArray(t)||(t=[t]);var n={};for(var i of t)n[i]=null;Ve.setNodes(e,n,r)},unwrapNodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};de.withoutNormalizing(e,()=>{var{mode:r="lowest",split:n=!1,voids:i=!1}=t,{at:o=e.selection,match:a}=t;if(o){a==null&&(a=Ue.isPath(o)?hc(e,o):S=>de.isBlock(e,S)),Ue.isPath(o)&&(o=de.range(e,o));var s=Qe.isRange(o)?de.rangeRef(e,o):null,l=de.nodes(e,{at:o,match:a,mode:r,voids:i}),u=Array.from(l,S=>{var[,y]=S;return de.pathRef(e,y)}).reverse(),c=function(S){var y=S.unref(),[W]=de.node(e,y),B=de.range(e,y);n&&s&&(B=Qe.intersection(s.current,B)),Ve.liftNodes(e,{at:B,match:N=>Ut.isAncestor(W)&&W.children.includes(N),voids:i})};for(var h of u)c(h);s&&s.unref()}})},wrapNodes(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};de.withoutNormalizing(e,()=>{var{mode:n="lowest",split:i=!1,voids:o=!1}=r,{match:a,at:s=e.selection}=r;if(s){if(a==null&&(a=Ue.isPath(s)?hc(e,s):e.isInline(t)?N=>de.isInline(e,N)||Rt.isText(N):N=>de.isBlock(e,N)),i&&Qe.isRange(s)){var[l,u]=Qe.edges(s),c=de.rangeRef(e,s,{affinity:"inward"});Ve.splitNodes(e,{at:u,match:a,voids:o}),Ve.splitNodes(e,{at:l,match:a,voids:o}),s=c.unref(),r.at==null&&Ve.select(e,s)}var h=Array.from(de.nodes(e,{at:s,match:e.isInline(t)?N=>de.isBlock(e,N):N=>de.isEditor(N),mode:"lowest",voids:o}));for(var[,S]of h){var y=Qe.isRange(s)?Qe.intersection(s,de.range(e,S)):s;if(y){var W=Array.from(de.nodes(e,{at:y,match:a,mode:n,voids:o}));if(W.length>0){var B=function(){var[N]=W,U=W[W.length-1],[,D]=N,[,Q]=U;if(D.length===0&&Q.length===0)return"continue";var te=Ue.equals(D,Q)?Ue.parent(D):Ue.common(D,Q),he=de.range(e,D,Q),Ee=de.node(e,te),[ve]=Ee,De=te.length+1,Pe=Ue.next(Q.slice(0,De)),qe=WL(WL({},t),{},{children:[]});Ve.insertNodes(e,qe,{at:Pe,voids:o}),Ve.moveNodes(e,{at:he,match:ot=>Ut.isAncestor(ve)&&ve.children.includes(ot),to:Pe.concat(0),voids:o})}();if(B==="continue")continue}}}}})}},GL=(e,t)=>{if(Ut.isElement(t)){var r=t;return!!de.isVoid(e,t)||r.children.length===1&&GL(e,r.children[0])}return!de.isEditor(t)},EK=(e,t)=>{if(Qe.isCollapsed(t))return t.anchor;var[,r]=Qe.edges(t),n=de.pointRef(e,r);return Ve.delete(e,{at:t}),n.unref()},hc=(e,t)=>{var[r]=de.node(e,t);return n=>n===r};function VL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function KL(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?VL(Object(r),!0).forEach(function(n){Xo(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):VL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var xK={collapse(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{edge:r="anchor"}=t,{selection:n}=e;if(n){if(r==="anchor")Ve.select(e,n.anchor);else if(r==="focus")Ve.select(e,n.focus);else if(r==="start"){var[i]=Qe.edges(n);Ve.select(e,i)}else if(r==="end"){var[,o]=Qe.edges(n);Ve.select(e,o)}}},deselect(e){var{selection:t}=e;t&&e.apply({type:"set_selection",properties:t,newProperties:null})},move(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:r}=e,{distance:n=1,unit:i="character",reverse:o=!1}=t,{edge:a=null}=t;if(r){a==="start"&&(a=Qe.isBackward(r)?"focus":"anchor"),a==="end"&&(a=Qe.isBackward(r)?"anchor":"focus");var{anchor:s,focus:l}=r,u={distance:n,unit:i},c={};if(a==null||a==="anchor"){var h=o?de.before(e,s,u):de.after(e,s,u);h&&(c.anchor=h)}if(a==null||a==="focus"){var S=o?de.before(e,l,u):de.after(e,l,u);S&&(c.focus=S)}Ve.setSelection(e,c)}},select(e,t){var{selection:r}=e;if(t=de.range(e,t),r)Ve.setSelection(e,t);else{if(!Qe.isRange(t))throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(JSON.stringify(t)));e.apply({type:"set_selection",properties:r,newProperties:t})}},setPoint(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{selection:n}=e,{edge:i="both"}=r;if(n){i==="start"&&(i=Qe.isBackward(n)?"focus":"anchor"),i==="end"&&(i=Qe.isBackward(n)?"anchor":"focus");var{anchor:o,focus:a}=n,s=i==="anchor"?o:a;Ve.setSelection(e,{[i==="anchor"?"anchor":"focus"]:KL(KL({},s),t)})}},setSelection(e,t){var{selection:r}=e,n={},i={};if(r){for(var o in t)(o==="anchor"&&t.anchor!=null&&!cr.equals(t.anchor,r.anchor)||o==="focus"&&t.focus!=null&&!cr.equals(t.focus,r.focus)||o!=="anchor"&&o!=="focus"&&t[o]!==r[o])&&(n[o]=r[o],i[o]=t[o]);Object.keys(n).length>0&&e.apply({type:"set_selection",properties:n,newProperties:i})}}},SK={delete(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};de.withoutNormalizing(e,()=>{var{reverse:r=!1,unit:n="character",distance:i=1,voids:o=!1}=t,{at:a=e.selection,hanging:s=!1}=t;if(a){if(Qe.isRange(a)&&Qe.isCollapsed(a)&&(a=a.anchor),cr.isPoint(a)){var l=de.void(e,{at:a,mode:"highest"});if(!o&&l){var[,u]=l;a=u}else{var c={unit:n,distance:i};a={anchor:a,focus:r?de.before(e,a,c)||de.start(e,[]):de.after(e,a,c)||de.end(e,[])},s=!0}}if(Ue.isPath(a))Ve.removeNodes(e,{at:a,voids:o});else if(!Qe.isCollapsed(a)){if(!s){var[,h]=Qe.edges(a),S=de.end(e,[]);cr.equals(h,S)||(a=de.unhangRange(e,a,{voids:o}))}var[y,W]=Qe.edges(a),B=de.above(e,{match:Xt=>de.isBlock(e,Xt),at:y,voids:o}),N=de.above(e,{match:Xt=>de.isBlock(e,Xt),at:W,voids:o}),U=B&&N&&!Ue.equals(B[1],N[1]),D=Ue.equals(y.path,W.path),Q=o?null:de.void(e,{at:y,mode:"highest"}),te=o?null:de.void(e,{at:W,mode:"highest"});if(Q){var he=de.before(e,y);he&&B&&Ue.isAncestor(B[1],he.path)&&(y=he)}if(te){var Ee=de.after(e,W);Ee&&N&&Ue.isAncestor(N[1],Ee.path)&&(W=Ee)}var ve,De=[];for(var Pe of de.nodes(e,{at:a,voids:o})){var[qe,ot]=Pe;ve&&Ue.compare(ot,ve)===0||(!o&&de.isVoid(e,qe)||!Ue.isCommon(ot,y.path)&&!Ue.isCommon(ot,W.path))&&(De.push(Pe),ve=ot)}var et=Array.from(De,Xt=>{var[,qt]=Xt;return de.pathRef(e,qt)}),gt=de.pointRef(e,y),dt=de.pointRef(e,W);if(!D&&!Q){var ht=gt.current,[pt]=de.leaf(e,ht),{path:Dt}=ht,{offset:Ft}=y,Bt=pt.text.slice(Ft);Bt.length>0&&e.apply({type:"remove_text",path:Dt,offset:Ft,text:Bt})}for(var It of et){var Re=It.unref();Ve.removeNodes(e,{at:Re,voids:o})}if(!te){var Te=dt.current,[Fe]=de.leaf(e,Te),{path:rt}=Te,vt=D?y.offset:0,ut=Fe.text.slice(vt,W.offset);ut.length>0&&e.apply({type:"remove_text",path:rt,offset:vt,text:ut})}!D&&U&&dt.current&>.current&&Ve.mergeNodes(e,{at:dt.current,hanging:!0,voids:o});var kt=r?gt.unref()||dt.unref():dt.unref()||gt.unref();t.at==null&&kt&&Ve.select(e,kt)}}})},insertFragment(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};de.withoutNormalizing(e,()=>{var{hanging:n=!1,voids:i=!1}=r,{at:o=e.selection}=r;if(t.length&&o){if(Qe.isRange(o))if(n||(o=de.unhangRange(e,o)),Qe.isCollapsed(o))o=o.anchor;else{var[,a]=Qe.edges(o);if(!i&&de.void(e,{at:a}))return;var s=de.pointRef(e,a);Ve.delete(e,{at:o}),o=s.unref()}else Ue.isPath(o)&&(o=de.start(e,o));if(i||!de.void(e,{at:o})){var l=de.above(e,{at:o,match:Te=>de.isInline(e,Te),mode:"highest",voids:i});if(l){var[,u]=l;de.isEnd(e,o,u)?o=de.after(e,u):de.isStart(e,o,u)&&(o=de.before(e,u))}var c=de.above(e,{match:Te=>de.isBlock(e,Te),at:o,voids:i}),[,h]=c,S=de.isStart(e,o,h),y=de.isEnd(e,o,h),W=S&&y,B=!S||S&&y,N=!y,[,U]=St.first({children:t},[]),[,D]=St.last({children:t},[]),Q=[],te=Te=>{var[Fe,rt]=Te;return!(rt.length===0)&&(!!W||!(B&&Ue.isAncestor(rt,U)&&Ut.isElement(Fe)&&!e.isVoid(Fe)&&!e.isInline(Fe))&&!(N&&Ue.isAncestor(rt,D)&&Ut.isElement(Fe)&&!e.isVoid(Fe)&&!e.isInline(Fe)))};for(var he of St.nodes({children:t},{pass:te}))te(he)&&Q.push(he);var Ee=[],ve=[],De=[],Pe=!0,qe=!1;for(var[ot]of Q)Ut.isElement(ot)&&!e.isInline(ot)?(Pe=!1,qe=!0,ve.push(ot)):Pe?Ee.push(ot):De.push(ot);var[et]=de.nodes(e,{at:o,match:Te=>Rt.isText(Te)||de.isInline(e,Te),mode:"highest",voids:i}),[,gt]=et,dt=de.isStart(e,o,gt),ht=de.isEnd(e,o,gt),pt=de.pathRef(e,y?Ue.next(h):h),Dt=de.pathRef(e,ht?Ue.next(gt):gt),Ft=de.pathRef(e,h);Ve.splitNodes(e,{at:o,match:Te=>qe?de.isBlock(e,Te):Rt.isText(Te)||de.isInline(e,Te),mode:qe?"lowest":"highest",voids:i});var Bt=de.pathRef(e,!dt||dt&&ht?Ue.next(gt):gt);if(Ve.insertNodes(e,Ee,{at:Bt.current,match:Te=>Rt.isText(Te)||de.isInline(e,Te),mode:"highest",voids:i}),W&&ve.length&&Ve.delete(e,{at:Ft.unref(),voids:i}),Ve.insertNodes(e,ve,{at:pt.current,match:Te=>de.isBlock(e,Te),mode:"lowest",voids:i}),Ve.insertNodes(e,De,{at:Dt.current,match:Te=>Rt.isText(Te)||de.isInline(e,Te),mode:"highest",voids:i}),!r.at){var It;It=De.length>0?Ue.previous(Dt.current):ve.length>0?Ue.previous(pt.current):Ue.previous(Bt.current);var Re=de.end(e,It);Ve.select(e,Re)}Bt.unref(),pt.unref(),Dt.unref()}}})},insertText(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};de.withoutNormalizing(e,()=>{var{voids:n=!1}=r,{at:i=e.selection}=r;if(i){if(Ue.isPath(i)&&(i=de.range(e,i)),Qe.isRange(i))if(Qe.isCollapsed(i))i=i.anchor;else{var o=Qe.end(i);if(!n&&de.void(e,{at:o}))return;var a=de.pointRef(e,o);Ve.delete(e,{at:i,voids:n}),i=a.unref(),Ve.setSelection(e,{anchor:i,focus:i})}if(n||!de.void(e,{at:i})){var{path:s,offset:l}=i;t.length>0&&e.apply({type:"insert_text",path:s,offset:l,text:t})}}})}};function $L(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Iv(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$L(Object(r),!0).forEach(function(n){Xo(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$L(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Ve=Iv(Iv(Iv(Iv({},vK),bK),xK),SK),WE="[object Map]",GE="[object Set]",wK=/^\[object .+?Constructor\]$/,CK=/^(?:0|[1-9]\d*)$/,TK="[\\ud800-\\udfff]",VE="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",KE="\\ud83c[\\udffb-\\udfff]",XL="[^\\ud800-\\udfff]",YL="(?:\\ud83c[\\udde6-\\uddff]){2}",ZL="[\\ud800-\\udbff][\\udc00-\\udfff]",JL="(?:"+VE+"|"+KE+")?",AK="[\\ufe0e\\ufe0f]?"+JL+("(?:\\u200d(?:"+[XL,YL,ZL].join("|")+")[\\ufe0e\\ufe0f]?"+JL+")*"),DK="(?:"+[XL+VE+"?",VE,YL,ZL,TK].join("|")+")",OK=RegExp(KE+"(?="+KE+")|"+DK+AK,"g"),_K=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),RK=typeof re=="object"&&re&&re.Object===Object&&re,kK=typeof self=="object"&&self&&self.Object===Object&&self,Fl=RK||kK||Function("return this")();function LK(e,t){return function(r,n){for(var i=-1,o=r?r.length:0,a=Array(o);++i<o;)a[i]=n(r[i],i,r);return a}(t,function(r){return e[r]})}function PK(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function IK(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}function MK(e){return function(t){return _K.test(t)}(e)?function(t){return t.match(OK)||[]}(e):function(t){return t.split("")}(e)}var QL,qL,BK=Function.prototype,Mv=Object.prototype,$E=Fl["__core-js_shared__"],eP=function(){var e=/[^.]+$/.exec($E&&$E.keys&&$E.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),tP=BK.toString,Bv=Mv.hasOwnProperty,_h=Mv.toString,FK=RegExp("^"+tP.call(Bv).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rP=Fl.Symbol,XE=rP?rP.iterator:void 0,NK=Mv.propertyIsEnumerable,jK=(QL=Object.keys,qL=Object,function(e){return QL(qL(e))}),YE=Rh(Fl,"DataView"),ZE=Rh(Fl,"Map"),JE=Rh(Fl,"Promise"),QE=Rh(Fl,"Set"),qE=Rh(Fl,"WeakMap"),UK=jl(YE),HK=jl(ZE),zK=jl(JE),WK=jl(QE),GK=jl(qE);function VK(e,t){var r=nP(e)||function(a){return function(s){return aP(s)&&ex(s)}(a)&&Bv.call(a,"callee")&&(!NK.call(a,"callee")||_h.call(a)=="[object Arguments]")}(e)?function(a,s){for(var l=-1,u=Array(a);++l<a;)u[l]=s(l);return u}(e.length,String):[],n=r.length,i=!!n;for(var o in e)!t&&!Bv.call(e,o)||i&&(o=="length"||XK(o,n))||r.push(o);return r}function KK(e){if(!oP(e)||function(r){return!!eP&&eP in r}(e))return!1;var t=iP(e)||function(r){var n=!1;if(r!=null&&typeof r.toString!="function")try{n=!!(r+"")}catch(i){}return n}(e)?FK:wK;return t.test(jl(e))}function $K(e){if(r=(t=e)&&t.constructor,n=typeof r=="function"&&r.prototype||Mv,t!==n)return jK(e);var t,r,n,i=[];for(var o in Object(e))Bv.call(e,o)&&o!="constructor"&&i.push(o);return i}function Rh(e,t){var r=function(n,i){return n==null?void 0:n[i]}(e,t);return KK(r)?r:void 0}var Nl=function(e){return _h.call(e)};function XK(e,t){return!!(t=t==null?9007199254740991:t)&&(typeof e=="number"||CK.test(e))&&e>-1&&e%1==0&&e<t}function jl(e){if(e!=null){try{return tP.call(e)}catch(t){}try{return e+""}catch(t){}}return""}(YE&&Nl(new YE(new ArrayBuffer(1)))!="[object DataView]"||ZE&&Nl(new ZE)!=WE||JE&&Nl(JE.resolve())!="[object Promise]"||QE&&Nl(new QE)!=GE||qE&&Nl(new qE)!="[object WeakMap]")&&(Nl=function(e){var t=_h.call(e),r=t=="[object Object]"?e.constructor:void 0,n=r?jl(r):void 0;if(n)switch(n){case UK:return"[object DataView]";case HK:return WE;case zK:return"[object Promise]";case WK:return GE;case GK:return"[object WeakMap]"}return t});var nP=Array.isArray;function ex(e){return e!=null&&function(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=9007199254740991}(e.length)&&!iP(e)}function iP(e){var t=oP(e)?_h.call(e):"";return t=="[object Function]"||t=="[object GeneratorFunction]"}function oP(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function aP(e){return!!e&&typeof e=="object"}function YK(e){return e?LK(e,function(t){return ex(t)?VK(t):$K(t)}(e)):[]}var sP=function(e){if(!e)return[];if(ex(e))return function(r){return typeof r=="string"||!nP(r)&&aP(r)&&_h.call(r)=="[object String]"}(e)?MK(e):function(r,n){var i=-1,o=r.length;for(n||(n=Array(o));++i<o;)n[i]=r[i];return n}(e);if(XE&&e[XE])return function(r){for(var n,i=[];!(n=r.next()).done;)i.push(n.value);return i}(e[XE]());var t=Nl(e);return(t==WE?PK:t==GE?IK:YK)(e)};function lP(e){return e!==null&&typeof e=="object"&&"constructor"in e&&e.constructor===Object}function tx(e,t){e===void 0&&(e={}),t===void 0&&(t={}),Object.keys(t).forEach(function(r){e[r]===void 0?e[r]=t[r]:lP(t[r])&&lP(e[r])&&Object.keys(t[r]).length>0&&tx(e[r],t[r])})}var uP={body:{},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}},createElementNS:function(){return{}},importNode:function(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function kh(){var e=typeof document!="undefined"?document:{};return tx(e,uP),e}var ZK={document:uP,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState:function(){},pushState:function(){},go:function(){},back:function(){}},CustomEvent:function(){return this},addEventListener:function(){},removeEventListener:function(){},getComputedStyle:function(){return{getPropertyValue:function(){return""}}},Image:function(){},Date:function(){},screen:{},setTimeout:function(){},clearTimeout:function(){},matchMedia:function(){return{}},requestAnimationFrame:function(e){return typeof setTimeout=="undefined"?(e(),null):setTimeout(e,0)},cancelAnimationFrame:function(e){typeof setTimeout!="undefined"&&clearTimeout(e)}};function Ul(){var e=typeof window!="undefined"?window:{};return tx(e,ZK),e}function rx(e){return rx=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},rx(e)}function Fv(e,t){return Fv=Object.setPrototypeOf||function(r,n){return r.__proto__=n,r},Fv(e,t)}function JK(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function nx(e,t,r){return nx=JK()?Reflect.construct:function(n,i,o){var a=[null];a.push.apply(a,i);var s=new(Function.bind.apply(n,a));return o&&Fv(s,o.prototype),s},nx.apply(null,arguments)}function ix(e){var t=typeof Map=="function"?new Map:void 0;return ix=function(r){if(r===null||!function(i){return Function.toString.call(i).indexOf("[native code]")!==-1}(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(r))return t.get(r);t.set(r,n)}function n(){return nx(r,arguments,rx(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Fv(n,r)},ix(e)}var ls=function(e){var t,r;function n(i){var o,a,s;return o=e.call.apply(e,[this].concat(i))||this,a=function(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l}(o),s=a.__proto__,Object.defineProperty(a,"__proto__",{get:function(){return s},set:function(l){s.__proto__=l}}),o}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(ix(Array));function Nv(e){e===void 0&&(e=[]);var t=[];return e.forEach(function(r){Array.isArray(r)?t.push.apply(t,Nv(r)):t.push(r)}),t}function cP(e,t){return Array.prototype.filter.call(e,t)}function _e(e,t){var r=Ul(),n=kh(),i=[];if(!t&&e instanceof ls)return e;if(!e)return new ls(i);if(typeof e=="string"){var o=e.trim();if(o.indexOf("<")>=0&&o.indexOf(">")>=0){var a="div";o.indexOf("<li")===0&&(a="ul"),o.indexOf("<tr")===0&&(a="tbody"),o.indexOf("<td")!==0&&o.indexOf("<th")!==0||(a="tr"),o.indexOf("<tbody")===0&&(a="table"),o.indexOf("<option")===0&&(a="select");var s=n.createElement(a);s.innerHTML=o;for(var l=0;l<s.childNodes.length;l+=1)i.push(s.childNodes[l])}else i=function(u,c){if(typeof u!="string")return[u];for(var h=[],S=c.querySelectorAll(u),y=0;y<S.length;y+=1)h.push(S[y]);return h}(e.trim(),t||n)}else if(e.nodeType||e===r||e===n)i.push(e);else if(Array.isArray(e)){if(e instanceof ls)return e;i=e}return new ls(function(u){for(var c=[],h=0;h<u.length;h+=1)c.indexOf(u[h])===-1&&c.push(u[h]);return c}(i))}function fc(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Nv(t.map(function(i){return i.split(" ")}));return this.forEach(function(i){var o;(o=i.classList).add.apply(o,n)}),this}function pc(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Nv(t.map(function(i){return i.split(" ")}));return this.forEach(function(i){var o;(o=i.classList).remove.apply(o,n)}),this}function gc(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Nv(t.map(function(i){return i.split(" ")}));return cP(this,function(i){return n.filter(function(o){return i.classList.contains(o)}).length>0}).length>0}function no(e,t){if(arguments.length===1&&typeof e=="string")return this[0]?this[0].getAttribute(e):void 0;for(var r=0;r<this.length;r+=1)if(arguments.length===2)this[r].setAttribute(e,t);else for(var n in e)this[r][n]=e[n],this[r].setAttribute(n,e[n]);return this}function jv(e){for(var t=0;t<this.length;t+=1)this[t].removeAttribute(e);return this}function vc(){var e=this[0];if(e){var t,r={};if(e.dataset)for(var n in e.dataset)r[n]=e.dataset[n];else for(var i=0;i<e.attributes.length;i+=1){var o=e.attributes[i];o.name.indexOf("data-")>=0&&(r[t=o.name.split("data-")[1],t.toLowerCase().replace(/-(.)/g,function(s,l){return l.toUpperCase()})]=o.value)}for(var a in r)r[a]==="false"?r[a]=!1:r[a]==="true"?r[a]=!0:parseFloat(r[a])===1*r[a]&&(r[a]*=1);return r}}function Yo(e){if(e===void 0){var t=this[0];if(!t)return;if(t.multiple&&t.nodeName.toLowerCase()==="select"){for(var r=[],n=0;n<t.selectedOptions.length;n+=1)r.push(t.selectedOptions[n].value);return r}return t.value}for(var i=0;i<this.length;i+=1){var o=this[i];if(Array.isArray(e)&&o.multiple&&o.nodeName.toLowerCase()==="select")for(var a=0;a<o.options.length;a+=1)o.options[a].selected=e.indexOf(o.options[a].value)>=0;else o.value=e}return this}function Zo(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0],i=t[1],o=t[2],a=t[3];function s(B){var N=B.target;if(N){var U=B.target.dom7EventData||[];if(U.indexOf(B)<0&&U.unshift(B),_e(N).is(i))o.apply(N,U);else for(var D=_e(N).parents(),Q=0;Q<D.length;Q+=1)_e(D[Q]).is(i)&&o.apply(D[Q],U)}}function l(B){var N=B&&B.target&&B.target.dom7EventData||[];N.indexOf(B)<0&&N.unshift(B),o.apply(this,N)}typeof t[1]=="function"&&(n=t[0],o=t[1],a=t[2],i=void 0),a||(a=!1);for(var u,c=n.split(" "),h=0;h<this.length;h+=1){var S=this[h];if(i)for(u=0;u<c.length;u+=1){var y=c[u];S.dom7LiveListeners||(S.dom7LiveListeners={}),S.dom7LiveListeners[y]||(S.dom7LiveListeners[y]=[]),S.dom7LiveListeners[y].push({listener:o,proxyListener:s}),S.addEventListener(y,s,a)}else for(u=0;u<c.length;u+=1){var W=c[u];S.dom7Listeners||(S.dom7Listeners={}),S.dom7Listeners[W]||(S.dom7Listeners[W]=[]),S.dom7Listeners[W].push({listener:o,proxyListener:l}),S.addEventListener(W,l,a)}}return this}function dP(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0],i=t[1],o=t[2],a=t[3];typeof t[1]=="function"&&(n=t[0],o=t[1],a=t[2],i=void 0),a||(a=!1);for(var s=n.split(" "),l=0;l<s.length;l+=1)for(var u=s[l],c=0;c<this.length;c+=1){var h=this[c],S=void 0;if(!i&&h.dom7Listeners?S=h.dom7Listeners[u]:i&&h.dom7LiveListeners&&(S=h.dom7LiveListeners[u]),S&&S.length)for(var y=S.length-1;y>=0;y-=1){var W=S[y];o&&W.listener===o||o&&W.listener&&W.listener.dom7proxy&&W.listener.dom7proxy===o?(h.removeEventListener(u,W.proxyListener,a),S.splice(y,1)):o||(h.removeEventListener(u,W.proxyListener,a),S.splice(y,1))}}return this}function Uv(){var e=Ul();return this[0]===e?e.innerWidth:this.length>0?parseFloat(this.css("width")):null}function Hv(){var e=Ul();return this[0]===e?e.innerHeight:this.length>0?parseFloat(this.css("height")):null}function hP(){if(this.length>0){var e=Ul(),t=kh(),r=this[0],n=r.getBoundingClientRect(),i=t.body,o=r.clientTop||i.clientTop||0,a=r.clientLeft||i.clientLeft||0,s=r===e?e.scrollY:r.scrollTop,l=r===e?e.scrollX:r.scrollLeft;return{top:n.top+s-o,left:n.left+l-a}}return null}function mc(){for(var e=0;e<this.length;e+=1)this[e].style.display="none";return this}function zv(){for(var e=Ul(),t=0;t<this.length;t+=1){var r=this[t];r.style.display==="none"&&(r.style.display=""),e.getComputedStyle(r,null).getPropertyValue("display")==="none"&&(r.style.display="block")}return this}function Wv(e,t){var r,n=Ul();if(arguments.length===1){if(typeof e!="string"){for(r=0;r<this.length;r+=1)for(var i in e)this[r].style[i]=e[i];return this}if(this[0])return n.getComputedStyle(this[0],null).getPropertyValue(e)}if(arguments.length===2&&typeof e=="string"){for(r=0;r<this.length;r+=1)this[r].style[e]=t;return this}return this}function Gv(e){return e?(this.forEach(function(t,r){e.apply(t,[t,r])}),this):this}function fP(e){return _e(cP(this,e))}function us(e){if(e===void 0)return this[0]?this[0].innerHTML:null;for(var t=0;t<this.length;t+=1)this[t].innerHTML=e;return this}function Vv(e){if(e===void 0)return this[0]?this[0].textContent.trim():null;for(var t=0;t<this.length;t+=1)this[t].textContent=e;return this}function pP(e){var t,r,n=Ul(),i=kh(),o=this[0];if(!o||e===void 0)return!1;if(typeof e=="string"){if(o.matches)return o.matches(e);if(o.webkitMatchesSelector)return o.webkitMatchesSelector(e);if(o.msMatchesSelector)return o.msMatchesSelector(e);for(t=_e(e),r=0;r<t.length;r+=1)if(t[r]===o)return!0;return!1}if(e===i)return o===i;if(e===n)return o===n;if(e.nodeType||e instanceof ls){for(t=e.nodeType?[e]:e,r=0;r<t.length;r+=1)if(t[r]===o)return!0;return!1}return!1}function io(){for(var e,t=kh(),r=0;r<arguments.length;r+=1){e=r<0||arguments.length<=r?void 0:arguments[r];for(var n=0;n<this.length;n+=1)if(typeof e=="string"){var i=t.createElement("div");for(i.innerHTML=e;i.firstChild;)this[n].appendChild(i.firstChild)}else if(e instanceof ls)for(var o=0;o<e.length;o+=1)this[n].appendChild(e[o]);else this[n].appendChild(e)}return this}function gP(e){var t,r,n=kh();for(t=0;t<this.length;t+=1)if(typeof e=="string"){var i=n.createElement("div");for(i.innerHTML=e,r=i.childNodes.length-1;r>=0;r-=1)this[t].insertBefore(i.childNodes[r],this[t].childNodes[0])}else if(e instanceof ls)for(r=0;r<e.length;r+=1)this[t].insertBefore(e[r],this[t].childNodes[0]);else this[t].insertBefore(e,this[t].childNodes[0]);return this}function yc(e){for(var t=[],r=0;r<this.length;r+=1)this[r].parentNode!==null&&(e?_e(this[r].parentNode).is(e)&&t.push(this[r].parentNode):t.push(this[r].parentNode));return _e(t)}function Kv(e){for(var t=[],r=0;r<this.length;r+=1)for(var n=this[r].parentNode;n;)e?_e(n).is(e)&&t.push(n):t.push(n),n=n.parentNode;return _e(t)}function bc(e){for(var t=[],r=0;r<this.length;r+=1)for(var n=this[r].querySelectorAll(e),i=0;i<n.length;i+=1)t.push(n[i]);return _e(t)}function Ec(e){for(var t=[],r=0;r<this.length;r+=1)for(var n=this[r].children,i=0;i<n.length;i+=1)e&&!_e(n[i]).is(e)||t.push(n[i]);return _e(t)}function xc(){for(var e=0;e<this.length;e+=1)this[e].parentNode&&this[e].parentNode.removeChild(this[e]);return this}function Sc(){for(var e=0;e<this.length;e+=1){var t=this[e];if(t.nodeType===1){for(var r=0;r<t.childNodes.length;r+=1)t.childNodes[r].parentNode&&t.childNodes[r].parentNode.removeChild(t.childNodes[r]);t.textContent=""}}return this}_e.fn=ls.prototype;var QK="resize scroll".split(" ");function vP(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(r[0]===void 0){for(var i=0;i<this.length;i+=1)QK.indexOf(e)<0&&(e in this[i]?this[i][e]():_e(this[i]).trigger(e));return this}return this.on.apply(this,[e].concat(r))}}var mP=vP("click"),cs=vP("focus"),qK="[object GeneratorFunction]",e$=/^(?:0|[1-9]\d*)$/;function t$(e,t){for(var r=-1,n=e?e.length:0;++r<n&&t(e[r],r,e)!==!1;);return e}var $v=Object.prototype,ox=$v.hasOwnProperty,yP=$v.toString,r$=$v.propertyIsEnumerable,n$=function(e,t){return function(r){return e(t(r))}}(Object.keys,Object);function i$(e,t){var r=xP(e)||function(a){return function(s){return function(l){return!!l&&typeof l=="object"}(s)&&ax(s)}(a)&&ox.call(a,"callee")&&(!r$.call(a,"callee")||yP.call(a)=="[object Arguments]")}(e)?function(a,s){for(var l=-1,u=Array(a);++l<a;)u[l]=s(l);return u}(e.length,String):[],n=r.length,i=!!n;for(var o in e)!t&&!ox.call(e,o)||i&&(o=="length"||l$(o,n))||r.push(o);return r}var bP,EP,o$=(bP=function(e,t){return e&&a$(e,t,u$)},function(e,t){if(e==null)return e;if(!ax(e))return bP(e,t);for(var r=e.length,n=EP?r:-1,i=Object(e);(EP?n--:++n<r)&&t(i[n],n,i)!==!1;);return e}),a$=function(e){return function(t,r,n){for(var i=-1,o=Object(t),a=n(t),s=a.length;s--;){var l=a[e?s:++i];if(r(o[l],l,o)===!1)break}return t}}();function s$(e){if(r=(t=e)&&t.constructor,n=typeof r=="function"&&r.prototype||$v,t!==n)return n$(e);var t,r,n,i=[];for(var o in Object(e))ox.call(e,o)&&o!="constructor"&&i.push(o);return i}function l$(e,t){return!!(t=t==null?9007199254740991:t)&&(typeof e=="number"||e$.test(e))&&e>-1&&e%1==0&&e<t}var xP=Array.isArray;function ax(e){return e!=null&&function(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=9007199254740991}(e.length)&&!function(t){var r=function(n){var i=typeof n;return!!n&&(i=="object"||i=="function")}(t)?yP.call(t):"";return r=="[object Function]"||r==qK}(e)}function u$(e){return ax(e)?i$(e):s$(e)}function c$(e){return e}var sx=function(e,t){return(xP(e)?t$:o$)(e,typeof t=="function"?t:c$)};let SP=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let n=63&r[e];t+=n<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-"}return t};var d$=/^\s+|\s+$/g,h$=/^[-+]0x[0-9a-f]+$/i,f$=/^0b[01]+$/i,p$=/^0o[0-7]+$/i,g$=parseInt,v$=typeof re=="object"&&re&&re.Object===Object&&re,m$=typeof self=="object"&&self&&self.Object===Object&&self,y$=v$||m$||Function("return this")(),b$=Object.prototype.toString,E$=Math.max,x$=Math.min,lx=function(){return y$.Date.now()};function S$(e,t,r){var n,i,o,a,s,l,u=0,c=!1,h=!1,S=!0;if(typeof e!="function")throw new TypeError("Expected a function");function y(Q){var te=n,he=i;return n=i=void 0,u=Q,a=e.apply(he,te)}function W(Q){return u=Q,s=setTimeout(N,t),c?y(Q):a}function B(Q){var te=Q-l;return l===void 0||te>=t||te<0||h&&Q-u>=o}function N(){var Q=lx();if(B(Q))return U(Q);s=setTimeout(N,function(te){var he=t-(te-l);return h?x$(he,o-(te-u)):he}(Q))}function U(Q){return s=void 0,S&&n?y(Q):(n=i=void 0,a)}function D(){var Q=lx(),te=B(Q);if(n=arguments,i=this,l=Q,te){if(s===void 0)return W(l);if(h)return s=setTimeout(N,t),y(l)}return s===void 0&&(s=setTimeout(N,t)),a}return t=wP(t)||0,Xv(r)&&(c=!!r.leading,o=(h="maxWait"in r)?E$(wP(r.maxWait)||0,t):o,S="trailing"in r?!!r.trailing:S),D.cancel=function(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0},D.flush=function(){return s===void 0?a:U(lx())},D}function Xv(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function wP(e){if(typeof e=="number")return e;if(function(n){return typeof n=="symbol"||function(i){return!!i&&typeof i=="object"}(n)&&b$.call(n)=="[object Symbol]"}(e))return NaN;if(Xv(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Xv(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(d$,"");var r=f$.test(e);return r||p$.test(e)?g$(e.slice(2),r?2:8):h$.test(e)?NaN:+e}var Hl=function(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError("Expected a function");return Xv(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),S$(e,t,{leading:n,maxWait:t,trailing:i})};const w$={createElement:function(e,t){return document.createElement(e,t)},createElementNS:function(e,t,r){return document.createElementNS(e,t,r)},createTextNode:function(e){return document.createTextNode(e)},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,r){e.insertBefore(t,r)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){e.appendChild(t)},parentNode:function(e){return e.parentNode},nextSibling:function(e){return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},getTextContent:function(e){return e.textContent},isElement:function(e){return e.nodeType===1},isText:function(e){return e.nodeType===3},isComment:function(e){return e.nodeType===8}};function Lh(e,t,r,n,i){return{sel:e,data:t,children:r,text:n,elm:i,key:t===void 0?void 0:t.key}}const ux=Array.isArray;function Yv(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function cx(e){return e===void 0}function Hi(e){return e!==void 0}const CP=Lh("",{},[],void 0,void 0);function Ph(e,t){var r,n;const i=e.key===t.key,o=((r=e.data)===null||r===void 0?void 0:r.is)===((n=t.data)===null||n===void 0?void 0:n.is);return e.sel===t.sel&&i&&o}function C$(e,t,r){var n;const i={};for(let o=t;o<=r;++o){const a=(n=e[o])===null||n===void 0?void 0:n.key;a!==void 0&&(i[a]=o)}return i}const T$=["create","update","remove","destroy","pre","post"];function A$(e,t){const r={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},n=t!==void 0?t:w$;for(const h of T$)for(const S of e){const y=S[h];y!==void 0&&r[h].push(y)}function i(h){const S=h.id?"#"+h.id:"",y=h.getAttribute("class"),W=y?"."+y.split(" ").join("."):"";return Lh(n.tagName(h).toLowerCase()+S+W,{},[],void 0,h)}function o(h,S){return function(){if(--S==0){const y=n.parentNode(h);n.removeChild(y,h)}}}function a(h,S){var y,W;let B,N=h.data;if(N!==void 0){const Q=(y=N.hook)===null||y===void 0?void 0:y.init;Hi(Q)&&(Q(h),N=h.data)}const U=h.children,D=h.sel;if(D==="!")cx(h.text)&&(h.text=""),h.elm=n.createComment(h.text);else if(D!==void 0){const Q=D.indexOf("#"),te=D.indexOf(".",Q),he=Q>0?Q:D.length,Ee=te>0?te:D.length,ve=Q!==-1||te!==-1?D.slice(0,Math.min(he,Ee)):D,De=h.elm=Hi(N)&&Hi(B=N.ns)?n.createElementNS(B,ve,N):n.createElement(ve,N);for(he<Ee&&De.setAttribute("id",D.slice(he+1,Ee)),te>0&&De.setAttribute("class",D.slice(Ee+1).replace(/\./g," ")),B=0;B<r.create.length;++B)r.create[B](CP,h);if(ux(U))for(B=0;B<U.length;++B){const qe=U[B];qe!=null&&n.appendChild(De,a(qe,S))}else Yv(h.text)&&n.appendChild(De,n.createTextNode(h.text));const Pe=h.data.hook;Hi(Pe)&&((W=Pe.create)===null||W===void 0||W.call(Pe,CP,h),Pe.insert&&S.push(h))}else h.elm=n.createTextNode(h.text);return h.elm}function s(h,S,y,W,B,N){for(;W<=B;++W){const U=y[W];U!=null&&n.insertBefore(h,a(U,N),S)}}function l(h){var S,y;const W=h.data;if(W!==void 0){(y=(S=W==null?void 0:W.hook)===null||S===void 0?void 0:S.destroy)===null||y===void 0||y.call(S,h);for(let B=0;B<r.destroy.length;++B)r.destroy[B](h);if(h.children!==void 0)for(let B=0;B<h.children.length;++B){const N=h.children[B];N!=null&&typeof N!="string"&&l(N)}}}function u(h,S,y,W){for(var B,N;y<=W;++y){let U,D;const Q=S[y];if(Q!=null)if(Hi(Q.sel)){l(Q),U=r.remove.length+1,D=o(Q.elm,U);for(let he=0;he<r.remove.length;++he)r.remove[he](Q,D);const te=(N=(B=Q==null?void 0:Q.data)===null||B===void 0?void 0:B.hook)===null||N===void 0?void 0:N.remove;Hi(te)?te(Q,D):D()}else n.removeChild(h,Q.elm)}}function c(h,S,y){var W,B,N,U,D;const Q=(W=S.data)===null||W===void 0?void 0:W.hook;(B=Q==null?void 0:Q.prepatch)===null||B===void 0||B.call(Q,h,S);const te=S.elm=h.elm,he=h.children,Ee=S.children;if(h!==S){if(S.data!==void 0){for(let ve=0;ve<r.update.length;++ve)r.update[ve](h,S);(U=(N=S.data.hook)===null||N===void 0?void 0:N.update)===null||U===void 0||U.call(N,h,S)}cx(S.text)?Hi(he)&&Hi(Ee)?he!==Ee&&function(ve,De,Pe,qe){let ot,et,gt,dt,ht=0,pt=0,Dt=De.length-1,Ft=De[0],Bt=De[Dt],It=Pe.length-1,Re=Pe[0],Te=Pe[It];for(;ht<=Dt&&pt<=It;)Ft==null?Ft=De[++ht]:Bt==null?Bt=De[--Dt]:Re==null?Re=Pe[++pt]:Te==null?Te=Pe[--It]:Ph(Ft,Re)?(c(Ft,Re,qe),Ft=De[++ht],Re=Pe[++pt]):Ph(Bt,Te)?(c(Bt,Te,qe),Bt=De[--Dt],Te=Pe[--It]):Ph(Ft,Te)?(c(Ft,Te,qe),n.insertBefore(ve,Ft.elm,n.nextSibling(Bt.elm)),Ft=De[++ht],Te=Pe[--It]):Ph(Bt,Re)?(c(Bt,Re,qe),n.insertBefore(ve,Bt.elm,Ft.elm),Bt=De[--Dt],Re=Pe[++pt]):(ot===void 0&&(ot=C$(De,ht,Dt)),et=ot[Re.key],cx(et)?n.insertBefore(ve,a(Re,qe),Ft.elm):(gt=De[et],gt.sel!==Re.sel?n.insertBefore(ve,a(Re,qe),Ft.elm):(c(gt,Re,qe),De[et]=void 0,n.insertBefore(ve,gt.elm,Ft.elm))),Re=Pe[++pt]);(ht<=Dt||pt<=It)&&(ht>Dt?(dt=Pe[It+1]==null?null:Pe[It+1].elm,s(ve,dt,Pe,pt,It,qe)):u(ve,De,ht,Dt))}(te,he,Ee,y):Hi(Ee)?(Hi(h.text)&&n.setTextContent(te,""),s(te,null,Ee,0,Ee.length-1,y)):Hi(he)?u(te,he,0,he.length-1):Hi(h.text)&&n.setTextContent(te,""):h.text!==S.text&&(Hi(he)&&u(te,he,0,he.length-1),n.setTextContent(te,S.text)),(D=Q==null?void 0:Q.postpatch)===null||D===void 0||D.call(Q,h,S)}}return function(h,S){let y,W,B;const N=[];for(y=0;y<r.pre.length;++y)r.pre[y]();for(function(U){return U.sel!==void 0}(h)||(h=i(h)),Ph(h,S)?c(h,S,N):(W=h.elm,B=n.parentNode(W),a(S,N),B!==null&&(n.insertBefore(B,S.elm,n.nextSibling(W)),u(B,[h],0,0))),y=0;y<N.length;++y)N[y].data.hook.insert(N[y]);for(y=0;y<r.post.length;++y)r.post[y]();return S}}function TP(e,t,r){if(e.ns="http://www.w3.org/2000/svg",r!=="foreignObject"&&t!==void 0)for(let n=0;n<t.length;++n){const i=t[n].data;i!==void 0&&TP(i,t[n].children,t[n].sel)}}function wc(e,t,r){let n,i,o,a={};if(r!==void 0?(t!==null&&(a=t),ux(r)?n=r:Yv(r)?i=r.toString():r&&r.sel&&(n=[r])):t!=null&&(ux(t)?n=t:Yv(t)?i=t.toString():t&&t.sel?n=[t]:a=t),n!==void 0)for(o=0;o<n.length;++o)Yv(n[o])&&(n[o]=Lh(void 0,void 0,void 0,n[o],void 0));return e[0]!=="s"||e[1]!=="v"||e[2]!=="g"||e.length!==3&&e[3]!=="."&&e[3]!=="#"||TP(a,n,e),Lh(e,a,n,i,void 0)}function AP(e,t){let r;const n=t.elm;let i=e.data.attrs,o=t.data.attrs;if((i||o)&&i!==o){for(r in i=i||{},o=o||{},o){const a=o[r];i[r]!==a&&(a===!0?n.setAttribute(r,""):a===!1?n.removeAttribute(r):r.charCodeAt(0)!==120?n.setAttribute(r,a):r.charCodeAt(3)===58?n.setAttributeNS("http://www.w3.org/XML/1998/namespace",r,a):r.charCodeAt(5)===58?n.setAttributeNS("http://www.w3.org/1999/xlink",r,a):n.setAttribute(r,a))}for(r in i)r in o||n.removeAttribute(r)}}const D$={create:AP,update:AP};function DP(e,t){let r,n;const i=t.elm;let o=e.data.class,a=t.data.class;if((o||a)&&o!==a){for(n in o=o||{},a=a||{},o)o[n]&&!Object.prototype.hasOwnProperty.call(a,n)&&i.classList.remove(n);for(n in a)r=a[n],r!==o[n]&&i.classList[r?"add":"remove"](n)}}const O$={create:DP,update:DP},OP=/[A-Z]/g;function _P(e,t){const r=t.elm;let n,i=e.data.dataset,o=t.data.dataset;if(!i&&!o)return;if(i===o)return;i=i||{},o=o||{};const a=r.dataset;for(n in i)o[n]||(a?n in a&&delete a[n]:r.removeAttribute("data-"+n.replace(OP,"-$&").toLowerCase()));for(n in o)i[n]!==o[n]&&(a?a[n]=o[n]:r.setAttribute("data-"+n.replace(OP,"-$&").toLowerCase(),o[n]))}const _$={create:_P,update:_P};function RP(e,t,r){if(typeof e=="function")e.call(t,r,t);else if(typeof e=="object")for(let n=0;n<e.length;n++)RP(e[n],t,r)}function R$(e,t){const r=e.type,n=t.data.on;n&&n[r]&&RP(n[r],t,e)}function dx(e,t){const r=e.data.on,n=e.listener,i=e.elm,o=t&&t.data.on,a=t&&t.elm;let s;if(r!==o){if(r&&n)if(o)for(s in r)o[s]||i.removeEventListener(s,n,!1);else for(s in r)i.removeEventListener(s,n,!1);if(o){const l=t.listener=e.listener||function u(c){R$(c,u.vnode)};if(l.vnode=t,r)for(s in o)r[s]||a.addEventListener(s,l,!1);else for(s in o)a.addEventListener(s,l,!1)}}}const k$={create:dx,update:dx,destroy:dx};function kP(e,t){let r,n,i;const o=t.elm;let a=e.data.props,s=t.data.props;if((a||s)&&a!==s)for(r in a=a||{},s=s||{},s)n=s[r],i=a[r],i===n||r==="value"&&o[r]===n||(o[r]=n)}const L$={create:kP,update:kP},LP=typeof window!="undefined"&&window.requestAnimationFrame.bind(window)||setTimeout;let hx=!1;function P$(e,t,r){!function(n){LP(function(){LP(n)})}(function(){e[t]=r})}function PP(e,t){let r,n;const i=t.elm;let o=e.data.style,a=t.data.style;if(!o&&!a)return;if(o===a)return;o=o||{},a=a||{};const s="delayed"in o;for(n in o)a[n]||(n[0]==="-"&&n[1]==="-"?i.style.removeProperty(n):i.style[n]="");for(n in a)if(r=a[n],n==="delayed"&&a.delayed)for(const l in a.delayed)r=a.delayed[l],s&&r===o.delayed[l]||P$(i.style,l,r);else n!=="remove"&&r!==o[n]&&(n[0]==="-"&&n[1]==="-"?i.style.setProperty(n,r):i.style[n]=r)}const I$={pre:function(){hx=!1},create:PP,update:PP,destroy:function(e){let t,r;const n=e.elm,i=e.data.style;if(i&&(t=i.destroy))for(r in t)n.style[r]=t[r]},remove:function(e,t){const r=e.data.style;if(!r||!r.remove)return void t();let n;hx||(e.elm.offsetLeft,hx=!0);const i=e.elm;let o=0;const a=r.remove;let s=0;const l=[];for(n in a)l.push(n),i.style[n]=a[n];const u=getComputedStyle(i)["transition-property"].split(", ");for(;o<u.length;++o)l.indexOf(u[o])!==-1&&s++;i.addEventListener("transitionend",function(c){c.target===i&&--s,s===0&&t()})}};function IP(e,t){for(const r of e)r!=null&&r!==!1&&r!==""&&(Array.isArray(r)?IP(r,t):typeof r=="string"||typeof r=="number"||typeof r=="boolean"?t.push(Lh(void 0,void 0,void 0,String(r),void 0)):t.push(r));return t}function er(e,t,...r){const n=IP(r,[]);return typeof e=="function"?e(t,n):n.length===1&&!n[0].sel&&n[0].text?wc(e,t,n[0].text):wc(e,t,n)}er||(er={});var M$=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,B$=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,MP="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",F$="[\\ud800-\\udfff]",BP="["+MP+"]",Zv="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",FP="\\d+",N$="[\\u2700-\\u27bf]",NP="[a-z\\xdf-\\xf6\\xf8-\\xff]",jP="[^\\ud800-\\udfff"+MP+FP+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",fx="\\ud83c[\\udffb-\\udfff]",UP="[^\\ud800-\\udfff]",px="(?:\\ud83c[\\udde6-\\uddff]){2}",gx="[\\ud800-\\udbff][\\udc00-\\udfff]",Cc="[A-Z\\xc0-\\xd6\\xd8-\\xde]",HP="(?:"+NP+"|"+jP+")",j$="(?:"+Cc+"|"+jP+")",zP="(?:"+Zv+"|"+fx+")?",WP="[\\ufe0e\\ufe0f]?"+zP+("(?:\\u200d(?:"+[UP,px,gx].join("|")+")[\\ufe0e\\ufe0f]?"+zP+")*"),U$="(?:"+[N$,px,gx].join("|")+")"+WP,H$="(?:"+[UP+Zv+"?",Zv,px,gx,F$].join("|")+")",z$=RegExp("['\u2019]","g"),W$=RegExp(Zv,"g"),G$=RegExp(fx+"(?="+fx+")|"+H$+WP,"g"),V$=RegExp([Cc+"?"+NP+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?="+[BP,Cc,"$"].join("|")+")",j$+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?="+[BP,Cc+HP,"$"].join("|")+")",Cc+"?"+HP+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Cc+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",FP,U$].join("|"),"g"),K$=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),$$=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,X$=typeof re=="object"&&re&&re.Object===Object&&re,Y$=typeof self=="object"&&self&&self.Object===Object&&self,Z$=X$||Y$||Function("return this")(),vx,J$=(vx={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"ss"},function(e){return vx==null?void 0:vx[e]});function GP(e){return K$.test(e)}function Q$(e){return GP(e)?function(t){return t.match(G$)||[]}(e):function(t){return t.split("")}(e)}var q$=Object.prototype.toString,VP=Z$.Symbol,KP=VP?VP.prototype:void 0,$P=KP?KP.toString:void 0;function eX(e){if(typeof e=="string")return e;if(function(r){return typeof r=="symbol"||function(n){return!!n&&typeof n=="object"}(r)&&q$.call(r)=="[object Symbol]"}(e))return $P?$P.call(e):"";var t=e+"";return t=="0"&&1/e==-Infinity?"-0":t}function tX(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:function(i,o,a){var s=-1,l=i.length;o<0&&(o=-o>l?0:l+o),(a=a>l?l:a)<0&&(a+=l),l=o>a?0:a-o>>>0,o>>>=0;for(var u=Array(l);++s<l;)u[s]=i[s+o];return u}(e,t,r)}function Jv(e){return e==null?"":eX(e)}for(var XP,rX=(XP=function(e,t,r){return t=t.toLowerCase(),e+(r?nX(Jv(t).toLowerCase()):t)},function(e){return function(t,r,n,i){var o=-1,a=t?t.length:0;for(i&&a&&(n=t[++o]);++o<a;)n=r(n,t[o],o,t);return n}(function(t,r,n){return t=Jv(t),(r=n?void 0:r)===void 0?function(i){return $$.test(i)}(t)?function(i){return i.match(V$)||[]}(t):function(i){return i.match(M$)||[]}(t):t.match(r)||[]}(function(t){return(t=Jv(t))&&t.replace(B$,J$).replace(W$,"")}(e).replace(z$,"")),XP,"")}),YP,nX=(YP="toUpperCase",function(e){var t=GP(e=Jv(e))?Q$(e):void 0,r=t?t[0]:e.charAt(0),n=t?tX(t,1).join(""):e.slice(1);return r[YP]()+n}),iX=rX,oX=typeof window!="undefined"&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),mx={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},ZP={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:oX?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},yx={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},Qv=1;Qv<20;Qv++)yx["f"+Qv]=111+Qv;function JP(e,t,r){t&&!("byKey"in t)&&(r=t,t=null),Array.isArray(e)||(e=[e]);var n=e.map(function(o){return function(a,s){var l=s&&s.byKey,u={},c=(a=a.replace("++","+add")).split("+"),h=c.length;for(var S in mx)u[mx[S]]=!1;var y=!0,W=!1,B=void 0;try{for(var N,U=c[Symbol.iterator]();!(y=(N=U.next()).done);y=!0){var D=N.value,Q=D.endsWith("?")&&D.length>1;Q&&(D=D.slice(0,-1));var te=QP(D),he=mx[te];if(D.length>1&&!he&&!ZP[D]&&!yx[te])throw new TypeError('Unknown modifier: "'+D+'"');h!==1&&he||(l?u.key=te:u.which=aX(D)),he&&(u[he]=!Q||null)}}catch(Ee){W=!0,B=Ee}finally{try{!y&&U.return&&U.return()}finally{if(W)throw B}}return u}(o,t)}),i=function(o){return n.some(function(a){return function(s,l){for(var u in s){var c=s[u],h=void 0;if(c!=null&&((h=u==="key"&&l.key!=null?l.key.toLowerCase():u==="which"?c===91&&l.which===93?91:l.which:l[u])!=null||c!==!1)&&h!==c)return!1}return!0}(a,o)})};return r==null?i:i(r)}function aX(e){return e=QP(e),yx[e]||e.toUpperCase().charCodeAt(0)}function QP(e){return e=e.toLowerCase(),e=ZP[e]||e}var sX=JP,bx=function(e,t){return JP(e,{byKey:!0},t)},lX=/^\s+|\s+$/g,uX=/^[-+]0x[0-9a-f]+$/i,cX=/^0b[01]+$/i,dX=/^0o[0-7]+$/i,hX=parseInt,fX=typeof re=="object"&&re&&re.Object===Object&&re,pX=typeof self=="object"&&self&&self.Object===Object&&self,gX=fX||pX||Function("return this")(),vX=Object.prototype.toString,mX=Math.max,yX=Math.min,Ex=function(){return gX.Date.now()};function xx(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function qP(e){if(typeof e=="number")return e;if(function(n){return typeof n=="symbol"||function(i){return!!i&&typeof i=="object"}(n)&&vX.call(n)=="[object Symbol]"}(e))return NaN;if(xx(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=xx(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(lX,"");var r=cX.test(e);return r||dX.test(e)?hX(e.slice(2),r?2:8):uX.test(e)?NaN:+e}var Tc,eI=function(e,t,r){var n,i,o,a,s,l,u=0,c=!1,h=!1,S=!0;if(typeof e!="function")throw new TypeError("Expected a function");function y(Q){var te=n,he=i;return n=i=void 0,u=Q,a=e.apply(he,te)}function W(Q){return u=Q,s=setTimeout(N,t),c?y(Q):a}function B(Q){var te=Q-l;return l===void 0||te>=t||te<0||h&&Q-u>=o}function N(){var Q=Ex();if(B(Q))return U(Q);s=setTimeout(N,function(te){var he=t-(te-l);return h?yX(he,o-(te-u)):he}(Q))}function U(Q){return s=void 0,S&&n?y(Q):(n=i=void 0,a)}function D(){var Q=Ex(),te=B(Q);if(n=arguments,i=this,l=Q,te){if(s===void 0)return W(l);if(h)return s=setTimeout(N,t),y(l)}return s===void 0&&(s=setTimeout(N,t)),a}return t=qP(t)||0,xx(r)&&(c=!!r.leading,o=(h="maxWait"in r)?mX(qP(r.maxWait)||0,t):o,S="trailing"in r?!!r.trailing:S),D.cancel=function(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0},D.flush=function(){return s===void 0?a:U(Ex())},D},tI=ae(function(e,t){var r="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",o="[object Boolean]",a="[object Date]",s="[object Function]",l="[object GeneratorFunction]",u="[object Map]",c="[object Number]",h="[object Object]",S="[object Promise]",y="[object RegExp]",W="[object Set]",B="[object String]",N="[object Symbol]",U="[object WeakMap]",D="[object ArrayBuffer]",Q="[object DataView]",te="[object Float32Array]",he="[object Float64Array]",Ee="[object Int8Array]",ve="[object Int16Array]",De="[object Int32Array]",Pe="[object Uint8Array]",qe="[object Uint8ClampedArray]",ot="[object Uint16Array]",et="[object Uint32Array]",gt=/\w*$/,dt=/^\[object .+?Constructor\]$/,ht=/^(?:0|[1-9]\d*)$/,pt={};pt[i]=pt["[object Array]"]=pt[D]=pt[Q]=pt[o]=pt[a]=pt[te]=pt[he]=pt[Ee]=pt[ve]=pt[De]=pt[u]=pt[c]=pt[h]=pt[y]=pt[W]=pt[B]=pt[N]=pt[Pe]=pt[qe]=pt[ot]=pt[et]=!0,pt["[object Error]"]=pt[s]=pt[U]=!1;var Dt=typeof re=="object"&&re&&re.Object===Object&&re,Ft=typeof self=="object"&&self&&self.Object===Object&&self,Bt=Dt||Ft||Function("return this")(),It=t&&!t.nodeType&&t,Re=It&&e&&!e.nodeType&&e,Te=Re&&Re.exports===It;function Fe(Le,tt){return Le.set(tt[0],tt[1]),Le}function rt(Le,tt){return Le.add(tt),Le}function vt(Le,tt,Ct,Mt){var xr=-1,tn=Le?Le.length:0;for(Mt&&tn&&(Ct=Le[++xr]);++xr<tn;)Ct=tt(Ct,Le[xr],xr,Le);return Ct}function ut(Le){var tt=!1;if(Le!=null&&typeof Le.toString!="function")try{tt=!!(Le+"")}catch(Ct){}return tt}function kt(Le){var tt=-1,Ct=Array(Le.size);return Le.forEach(function(Mt,xr){Ct[++tt]=[xr,Mt]}),Ct}function Xt(Le,tt){return function(Ct){return Le(tt(Ct))}}function qt(Le){var tt=-1,Ct=Array(Le.size);return Le.forEach(function(Mt){Ct[++tt]=Mt}),Ct}var or=Array.prototype,ft=Function.prototype,br=Object.prototype,lr=Bt["__core-js_shared__"],Gt=function(){var Le=/[^.]+$/.exec(lr&&lr.keys&&lr.keys.IE_PROTO||"");return Le?"Symbol(src)_1."+Le:""}(),ur=ft.toString,yn=br.hasOwnProperty,Ar=br.toString,Hr=RegExp("^"+ur.call(yn).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),on=Te?Bt.Buffer:void 0,vi=Bt.Symbol,Sr=Bt.Uint8Array,Mi=Xt(Object.getPrototypeOf,Object),zo=Object.create,ma=br.propertyIsEnumerable,qd=or.splice,Yu=Object.getOwnPropertySymbols,Wo=on?on.isBuffer:void 0,ya=Xt(Object.keys,Object),Ka=ba(Bt,"DataView"),mi=ba(Bt,"Map"),yi=ba(Bt,"Promise"),bi=ba(Bt,"Set"),Ci=ba(Bt,"WeakMap"),ti=ba(Object,"create"),Co=xa(Ka),Vg=xa(mi),bl=xa(yi),$a=xa(bi),eh=xa(Ci),Zu=vi?vi.prototype:void 0,th=Zu?Zu.valueOf:void 0;function Go(Le){var tt=-1,Ct=Le?Le.length:0;for(this.clear();++tt<Ct;){var Mt=Le[tt];this.set(Mt[0],Mt[1])}}function To(Le){var tt=-1,Ct=Le?Le.length:0;for(this.clear();++tt<Ct;){var Mt=Le[tt];this.set(Mt[0],Mt[1])}}function Xa(Le){var tt=-1,Ct=Le?Le.length:0;for(this.clear();++tt<Ct;){var Mt=Le[tt];this.set(Mt[0],Mt[1])}}function Vo(Le){this.__data__=new To(Le)}function El(Le,tt){var Ct=Be(Le)||function(Wr){return function(_r){return function(Vn){return!!Vn&&typeof Vn=="object"}(_r)&&Ze(_r)}(Wr)&&yn.call(Wr,"callee")&&(!ma.call(Wr,"callee")||Ar.call(Wr)==i)}(Le)?function(Wr,_r){for(var Vn=-1,Ei=Array(Wr);++Vn<Wr;)Ei[Vn]=_r(Vn);return Ei}(Le.length,String):[],Mt=Ct.length,xr=!!Mt;for(var tn in Le)!tt&&!yn.call(Le,tn)||xr&&(tn=="length"||Qb(tn,Mt))||Ct.push(tn);return Ct}function Zb(Le,tt,Ct){var Mt=Le[tt];yn.call(Le,tt)&&qb(Mt,Ct)&&(Ct!==void 0||tt in Le)||(Le[tt]=Ct)}function qi(Le,tt){for(var Ct=Le.length;Ct--;)if(qb(Le[Ct][0],tt))return Ct;return-1}function Kg(Le,tt,Ct,Mt,xr,tn,Wr){var _r;if(Mt&&(_r=tn?Mt(Le,xr,tn,Wr):Mt(Le)),_r!==void 0)return _r;if(!zr(Le))return Le;var Vn=Be(Le);if(Vn){if(_r=function(rr){var Mr=rr.length,An=rr.constructor(Mr);return Mr&&typeof rr[0]=="string"&&yn.call(rr,"index")&&(An.index=rr.index,An.input=rr.input),An}(Le),!tt)return function(rr,Mr){var An=-1,Er=rr.length;for(Mr||(Mr=Array(Er));++An<Er;)Mr[An]=rr[An];return Mr}(Le,_r)}else{var Ei=Ea(Le),Ju=Ei==s||Ei==l;if(Et(Le))return function(rr,Mr){if(Mr)return rr.slice();var An=new rr.constructor(rr.length);return rr.copy(An),An}(Le,tt);if(Ei==h||Ei==i||Ju&&!tn){if(ut(Le))return tn?Le:{};if(_r=function(rr){return typeof rr.constructor!="function"||xl(rr)?{}:(Mr=Mi(rr),zr(Mr)?zo(Mr):{});var Mr}(Ju?{}:Le),!tt)return function(rr,Mr){return Jb(rr,$g(rr),Mr)}(Le,function(rr,Mr){return rr&&Jb(Mr,mr(Mr),rr)}(_r,Le))}else{if(!pt[Ei])return tn?Le:{};_r=function(rr,Mr,An,Er){var Rr=rr.constructor;switch(Mr){case D:return rh(rr);case o:case a:return new Rr(+rr);case Q:return function(kr,bn){var Ti=bn?rh(kr.buffer):kr.buffer;return new kr.constructor(Ti,kr.byteOffset,kr.byteLength)}(rr,Er);case te:case he:case Ee:case ve:case De:case Pe:case qe:case ot:case et:return function(kr,bn){var Ti=bn?rh(kr.buffer):kr.buffer;return new kr.constructor(Ti,kr.byteOffset,kr.length)}(rr,Er);case u:return function(kr,bn,Ti){return vt(bn?Ti(kt(kr),!0):kt(kr),Fe,new kr.constructor)}(rr,Er,An);case c:case B:return new Rr(rr);case y:return function(kr){var bn=new kr.constructor(kr.source,gt.exec(kr));return bn.lastIndex=kr.lastIndex,bn}(rr);case W:return function(kr,bn,Ti){return vt(bn?Ti(qt(kr),!0):qt(kr),rt,new kr.constructor)}(rr,Er,An);case N:return function(kr){return th?Object(th.call(kr)):{}}(rr)}}(Le,Ei,Kg,tt)}}Wr||(Wr=new Vo);var Ja=Wr.get(Le);if(Ja)return Ja;if(Wr.set(Le,_r),!Vn)var Sl=Ct?function(rr){return function(Mr,An,Er){var Rr=An(Mr);return Be(Mr)?Rr:function(kr,bn){for(var Ti=-1,Bi=bn.length,Ko=kr.length;++Ti<Bi;)kr[Ko+Ti]=bn[Ti];return kr}(Rr,Er(Mr))}(rr,mr,$g)}(Le):mr(Le);return function(rr,Mr){for(var An=-1,Er=rr?rr.length:0;++An<Er&&Mr(rr[An],An,rr)!==!1;);}(Sl||Le,function(rr,Mr){Sl&&(rr=Le[Mr=rr]),Zb(_r,Mr,Kg(rr,tt,Ct,Mt,Mr,Le,Wr))}),_r}function Ya(Le){return!(!zr(Le)||function(tt){return!!Gt&&Gt in tt}(Le))&&(Kt(Le)||ut(Le)?Hr:dt).test(xa(Le))}function rh(Le){var tt=new Le.constructor(Le.byteLength);return new Sr(tt).set(new Sr(Le)),tt}function Jb(Le,tt,Ct,Mt){Ct||(Ct={});for(var xr=-1,tn=tt.length;++xr<tn;){var Wr=tt[xr],_r=Mt?Mt(Ct[Wr],Le[Wr],Wr,Ct,Le):void 0;Zb(Ct,Wr,_r===void 0?Le[Wr]:_r)}return Ct}function Za(Le,tt){var Ct,Mt,xr=Le.__data__;return((Mt=typeof(Ct=tt))=="string"||Mt=="number"||Mt=="symbol"||Mt=="boolean"?Ct!=="__proto__":Ct===null)?xr[typeof tt=="string"?"string":"hash"]:xr.map}function ba(Le,tt){var Ct=function(Mt,xr){return Mt==null?void 0:Mt[xr]}(Le,tt);return Ya(Ct)?Ct:void 0}Go.prototype.clear=function(){this.__data__=ti?ti(null):{}},Go.prototype.delete=function(Le){return this.has(Le)&&delete this.__data__[Le]},Go.prototype.get=function(Le){var tt=this.__data__;if(ti){var Ct=tt[Le];return Ct===r?void 0:Ct}return yn.call(tt,Le)?tt[Le]:void 0},Go.prototype.has=function(Le){var tt=this.__data__;return ti?tt[Le]!==void 0:yn.call(tt,Le)},Go.prototype.set=function(Le,tt){return this.__data__[Le]=ti&&tt===void 0?r:tt,this},To.prototype.clear=function(){this.__data__=[]},To.prototype.delete=function(Le){var tt=this.__data__,Ct=qi(tt,Le);return!(Ct<0)&&(Ct==tt.length-1?tt.pop():qd.call(tt,Ct,1),!0)},To.prototype.get=function(Le){var tt=this.__data__,Ct=qi(tt,Le);return Ct<0?void 0:tt[Ct][1]},To.prototype.has=function(Le){return qi(this.__data__,Le)>-1},To.prototype.set=function(Le,tt){var Ct=this.__data__,Mt=qi(Ct,Le);return Mt<0?Ct.push([Le,tt]):Ct[Mt][1]=tt,this},Xa.prototype.clear=function(){this.__data__={hash:new Go,map:new(mi||To),string:new Go}},Xa.prototype.delete=function(Le){return Za(this,Le).delete(Le)},Xa.prototype.get=function(Le){return Za(this,Le).get(Le)},Xa.prototype.has=function(Le){return Za(this,Le).has(Le)},Xa.prototype.set=function(Le,tt){return Za(this,Le).set(Le,tt),this},Vo.prototype.clear=function(){this.__data__=new To},Vo.prototype.delete=function(Le){return this.__data__.delete(Le)},Vo.prototype.get=function(Le){return this.__data__.get(Le)},Vo.prototype.has=function(Le){return this.__data__.has(Le)},Vo.prototype.set=function(Le,tt){var Ct=this.__data__;if(Ct instanceof To){var Mt=Ct.__data__;if(!mi||Mt.length<199)return Mt.push([Le,tt]),this;Ct=this.__data__=new Xa(Mt)}return Ct.set(Le,tt),this};var $g=Yu?Xt(Yu,Object):function(){return[]},Ea=function(Le){return Ar.call(Le)};function Qb(Le,tt){return!!(tt=tt==null?n:tt)&&(typeof Le=="number"||ht.test(Le))&&Le>-1&&Le%1==0&&Le<tt}function xl(Le){var tt=Le&&Le.constructor;return Le===(typeof tt=="function"&&tt.prototype||br)}function xa(Le){if(Le!=null){try{return ur.call(Le)}catch(tt){}try{return Le+""}catch(tt){}}return""}function qb(Le,tt){return Le===tt||Le!=Le&&tt!=tt}(Ka&&Ea(new Ka(new ArrayBuffer(1)))!=Q||mi&&Ea(new mi)!=u||yi&&Ea(yi.resolve())!=S||bi&&Ea(new bi)!=W||Ci&&Ea(new Ci)!=U)&&(Ea=function(Le){var tt=Ar.call(Le),Ct=tt==h?Le.constructor:void 0,Mt=Ct?xa(Ct):void 0;if(Mt)switch(Mt){case Co:return Q;case Vg:return u;case bl:return S;case $a:return W;case eh:return U}return tt});var Be=Array.isArray;function Ze(Le){return Le!=null&&function(tt){return typeof tt=="number"&&tt>-1&&tt%1==0&&tt<=n}(Le.length)&&!Kt(Le)}var Et=Wo||function(){return!1};function Kt(Le){var tt=zr(Le)?Ar.call(Le):"";return tt==s||tt==l}function zr(Le){var tt=typeof Le;return!!Le&&(tt=="object"||tt=="function")}function mr(Le){return Ze(Le)?El(Le):function(tt){if(!xl(tt))return ya(tt);var Ct=[];for(var Mt in Object(tt))yn.call(tt,Mt)&&Mt!="constructor"&&Ct.push(Mt);return Ct}(Le)}e.exports=function(Le){return Kg(Le,!0,!0)}});function rI(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var bX=0;function EX(e){return"__private_"+bX+++"_"+e}function xX(e,t,r){const n=[];return e.forEach(i=>typeof i!="string"?n.push(i):t[Symbol.split](i).forEach((o,a,s)=>{o!==""&&n.push(o),a<s.length-1&&n.push(r)})),n}/**
|
|
|
* Takes a string with placeholder variables like `%{smart_count} file selected`
|
|
|
* and replaces it with values from options `{smart_count: 5}`
|
|
|
*
|
|
|
* @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE
|
|
|
* taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299
|
|
|
*
|
|
|
* @param {string} phrase that needs interpolation, with placeholders
|
|
|
* @param {object} options with values that will be used to replace placeholders
|
|
|
* @returns {any[]} interpolated
|
|
|
*/function nI(e,t){const r=/\$/g;let n=[e];if(t==null)return n;for(const i of Object.keys(t))if(i!=="_"){let o=t[i];typeof o=="string"&&(o=r[Symbol.replace](o,"$$$$")),n=xX(n,new RegExp(`%\\{${i}\\}`,"g"),o)}return n}var iI=(Tc=EX("apply"),class{constructor(e){Object.defineProperty(this,Tc,{value:SX}),this.locale={strings:{},pluralize:t=>t===1?0:1},Array.isArray(e)?e.forEach(rI(this,Tc)[Tc],this):rI(this,Tc)[Tc](e)}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){if(!function(n,i){return Object.prototype.hasOwnProperty.call(n,i)}(this.locale.strings,e))throw new Error(`missing string: ${e}`);const r=this.locale.strings[e];if(typeof r=="object"){if(t&&t.smart_count!==void 0)return nI(r[this.locale.pluralize(t.smart_count)],t);throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}return nI(r,t)}});function SX(e){if(e==null||!e.strings)return;const t=this.locale;this.locale=at(at({},t),{strings:at(at({},t.strings),e.strings)}),this.locale.pluralize=e.pluralize||t.pluralize}var oI=function(){var e={},t=e._fns={};return e.emit=function(r,n,i,o,a,s,l){var u=function(c){for(var h=t[c]?t[c]:[],S=c.indexOf(":"),y=S===-1?[c]:[c.substring(0,S),c.substring(S+1)],W=Object.keys(t),B=0,N=W.length;B<N;B++){var U=W[B];if(U==="*"&&(h=h.concat(t[U])),y.length===2&&y[0]===U){h=h.concat(t[U]);break}}return h}(r);u.length&&function(c,h,S){for(var y=0,W=h.length;y<W&&h[y];y++)h[y].event=c,h[y].apply(h[y],S)}(r,u,[n,i,o,a,s,l])},e.on=function(r,n){t[r]||(t[r]=[]),t[r].push(n)},e.once=function(r,n){this.on(r,function i(){n.apply(this,arguments),e.off(r,i)})},e.off=function(r,n){var i=[];if(r&&n)for(var o=this._fns[r],a=0,s=o?o.length:0;a<s;a++)o[a]!==n&&i.push(o[a]);i.length?this._fns[r]=i:delete this._fns[r]},e},wX={urlAlphabet:"useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"};let{urlAlphabet:CX}=wX,aI=e=>crypto.getRandomValues(new Uint8Array(e)),sI=(e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,i=-~(1.6*n*t/e.length);return()=>{let o="";for(;;){let a=r(i),s=i;for(;s--;)if(o+=e[a[s]&n]||"",o.length===t)return o}}};var TX={nanoid:(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let n=63&r[e];t+=n<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-"}return t},customAlphabet:(e,t)=>sI(e,t,aI),customRandom:sI,urlAlphabet:CX,random:aI},Sx=function(e){if(typeof e!="number"||isNaN(e))throw new TypeError("Expected a number, got "+typeof e);var t=e<0,r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return(t?"-":"")+e+" B";var n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),r.length-1);e=Number(e/Math.pow(1024,n));var i=r[n];return e>=10||e%1==0?(t?"-":"")+e.toFixed(0)+" "+i:(t?"-":"")+e.toFixed(1)+" "+i};function lI(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}lI.prototype.match=function(e){var t,r,n=!0,i=this.parts,o=i.length;if(typeof e=="string"||e instanceof String)if(this.hasWild||this.text==e){for(r=(e||"").split(this.separator),t=0;n&&t<o;t++)i[t]!=="*"&&(n=t<r.length&&i[t]===r[t]);n=n&&r}else n=!1;else if(typeof e.splice=="function")for(n=[],t=e.length;t--;)this.match(e[t])&&(n[n.length]=e[t]);else if(typeof e=="object")for(var a in n={},e)this.match(a)&&(n[a]=e[a]);return n};var AX=/[\/\+\.]/,DX=function(e,t){function r(n){var i=function(o,a,s){var l=new lI(o,s||/[\/\.]/);return a!==void 0?l.match(a):l}(n,e,AX);return i&&i.length>=2}return t?r(t.split(";")[0]):r},OX=0;function _X(e){return"__private_"+OX+++"_"+e}var wx=_X("publish");class uI{constructor(){Object.defineProperty(this,wx,{value:RX}),this.state={},this.callbacks=[]}getState(){return this.state}setState(e){const t=at({},this.state),r=at(at({},this.state),e);this.state=r,function(n,i){if(!Object.prototype.hasOwnProperty.call(n,i))throw new TypeError("attempted to use private field on non-instance");return n}(this,wx)[wx](t,r,e)}subscribe(e){return this.callbacks.push(e),()=>{this.callbacks.splice(this.callbacks.indexOf(e),1)}}}function RX(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.callbacks.forEach(n=>{n(...t)})}uI.VERSION="2.0.3";var cI=function(e){const t=e.lastIndexOf(".");return t===-1||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}},dI={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function hI(e){let t="";return e.replace(/[^A-Z0-9]/gi,r=>(t+=`-${function(n){return n.charCodeAt(0).toString(32)}(r)}`,"/"))+t}var kX=function(e){if(e==null&&(e=typeof navigator!="undefined"?navigator.userAgent:null),!e)return!0;const t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;const r=t[1];let[n,i]=r.split(".");return n=parseInt(n,10),i=parseInt(i,10),n<15||n===15&&i<15063||n>18||n===18&&i>=18218};function Cx(e){return e<10?`0${e}`:e.toString()}var qv=function(){const e=new Date;return`${Cx(e.getHours())}:${Cx(e.getMinutes())}:${Cx(e.getSeconds())}`},fI={justErrorsLogger:{debug:()=>{},warn:()=>{},error:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return console.error(`[Uppy] [${qv()}]`,...t)}},debugLogger:{debug:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return console.debug(`[Uppy] [${qv()}]`,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return console.warn(`[Uppy] [${qv()}]`,...t)},error:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return console.error(`[Uppy] [${qv()}]`,...t)}}},LX={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",backToSearch:"Back to Search",emptyFolderAdded:"No files were added from empty folder",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"}}},pI=TX;let gI,vI;function zt(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var PX=0;function Rn(e){return"__private_"+PX+++"_"+e}const{nanoid:IX}=pI,{justErrorsLogger:MX,debugLogger:BX}=fI;class Jo extends Error{constructor(){super(...arguments),this.isRestriction=!0}}typeof AggregateError=="undefined"&&(globalThis.AggregateError=class extends Error{constructor(e,t){super(t),this.errors=e}});class FX extends AggregateError{constructor(){super(...arguments),this.isRestriction=!0}}var ni=Rn("plugins"),Ih=Rn("storeUnsubscribe"),_a=Rn("emitter"),zl=Rn("preProcessors"),Wl=Rn("uploaders"),Ra=Rn("postProcessors"),Mh=Rn("checkRestrictions"),Tx=Rn("checkMinNumberOfFiles"),Bh=Rn("checkRequiredMetaFieldsOnFile"),Ax=Rn("checkRequiredMetaFields"),Un=Rn("showOrLogErrorAndThrow"),Fh=Rn("assertNewUploadAllowed"),Nh=Rn("checkAndCreateFileStateObject"),jh=Rn("startIfAutoProceed"),Dx=Rn("addListeners"),_o=Rn("updateOnlineStatus"),ka=Rn("createUpload"),Ox=Rn("getUpload"),Gl=Rn("removeUpload"),La=Rn("runUpload");gI=Symbol.for("uppy test: getPlugins"),vI=Symbol.for("uppy test: createUpload");class mI{constructor(e){Object.defineProperty(this,La,{value:ZX}),Object.defineProperty(this,Gl,{value:YX}),Object.defineProperty(this,Ox,{value:XX}),Object.defineProperty(this,ka,{value:$X}),Object.defineProperty(this,Dx,{value:KX}),Object.defineProperty(this,jh,{value:VX}),Object.defineProperty(this,Nh,{value:GX}),Object.defineProperty(this,Fh,{value:WX}),Object.defineProperty(this,Un,{value:zX}),Object.defineProperty(this,Ax,{value:HX}),Object.defineProperty(this,Bh,{value:UX}),Object.defineProperty(this,Tx,{value:jX}),Object.defineProperty(this,Mh,{value:NX}),Object.defineProperty(this,ni,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,Ih,{writable:!0,value:void 0}),Object.defineProperty(this,_a,{writable:!0,value:oI()}),Object.defineProperty(this,zl,{writable:!0,value:new Set}),Object.defineProperty(this,Wl,{writable:!0,value:new Set}),Object.defineProperty(this,Ra,{writable:!0,value:new Set}),Object.defineProperty(this,_o,{writable:!0,value:this.updateOnlineStatus.bind(this)}),this.defaultLocale=LX;const t={id:"uppy",autoProceed:!1,allowMultipleUploads:!0,allowMultipleUploadBatches:!0,debug:!1,restrictions:{maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]},meta:{},onBeforeFileAdded:r=>r,onBeforeUpload:r=>r,store:new uI,logger:MX,infoTimeout:5e3};if(this.opts=at(at(at({},t),e),{restrictions:at(at({},t.restrictions),e&&e.restrictions)}),e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=BX),this.log(`Using Core v${this.constructor.VERSION}`),this.opts.restrictions.allowedFileTypes&&this.opts.restrictions.allowedFileTypes!==null&&!Array.isArray(this.opts.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");this.i18nInit(),this.calculateProgress=Hl(this.calculateProgress.bind(this),500,{leading:!0,trailing:!0}),this.store=this.opts.store,this.setState({plugins:{},files:{},currentUploads:{},allowNewUpload:!0,capabilities:{uploadProgress:kX(),individualCancellation:!0,resumableUploads:!1},totalProgress:0,meta:at({},this.opts.meta),info:[],recoveredState:null}),zt(this,Ih)[Ih]=this.store.subscribe((r,n,i)=>{this.emit("state-update",r,n,i),this.updateAll(n)}),this.opts.debug&&typeof window!="undefined"&&(window[this.opts.id]=this),zt(this,Dx)[Dx]()}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];zt(this,_a)[_a].emit(e,...r)}on(e,t){return zt(this,_a)[_a].on(e,t),this}once(e,t){return zt(this,_a)[_a].once(e,t),this}off(e,t){return zt(this,_a)[_a].off(e,t),this}updateAll(e){this.iteratePlugins(t=>{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}get state(){return this.getState()}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can\u2019t set state for ${e} (the file could have been removed)`);this.setState({files:at(at({},this.getState().files),{[e]:at(at({},this.getState().files[e]),t)})})}i18nInit(){const e=new iI([this.defaultLocale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(e){this.opts=at(at(at({},this.opts),e),{restrictions:at(at({},this.opts.restrictions),e&&e.restrictions)}),e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(t=>{t.setOptions()}),this.setState()}resetProgress(){const e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t=at({},this.getState().files),r={};Object.keys(t).forEach(n=>{const i=at({},t[n]);i.progress=at(at({},i.progress),e),r[n]=i}),this.setState({files:r,totalProgress:0}),this.emit("reset-progress")}addPreProcessor(e){zt(this,zl)[zl].add(e)}removePreProcessor(e){return zt(this,zl)[zl].delete(e)}addPostProcessor(e){zt(this,Ra)[Ra].add(e)}removePostProcessor(e){return zt(this,Ra)[Ra].delete(e)}addUploader(e){zt(this,Wl)[Wl].add(e)}removeUploader(e){return zt(this,Wl)[Wl].delete(e)}setMeta(e){const t=at(at({},this.getState().meta),e),r=at({},this.getState().files);Object.keys(r).forEach(n=>{r[n]=at(at({},r[n]),{meta:at(at({},r[n].meta),e)})}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:r})}setFileMeta(e,t){const r=at({},this.getState().files);if(!r[e])return void this.log("Was trying to set metadata for a file that has been removed: ",e);const n=at(at({},r[e].meta),t);r[e]=at(at({},r[e]),{meta:n}),this.setState({files:r})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:r}=this.getState(),n=Object.values(e),i=n.filter(y=>{let{progress:W}=y;return!W.uploadComplete&&W.uploadStarted}),o=n.filter(y=>!y.progress.uploadStarted),a=n.filter(y=>y.progress.uploadStarted||y.progress.preprocess||y.progress.postprocess),s=n.filter(y=>y.progress.uploadStarted),l=n.filter(y=>y.isPaused),u=n.filter(y=>y.progress.uploadComplete),c=n.filter(y=>y.error),h=i.filter(y=>!y.isPaused),S=n.filter(y=>y.progress.preprocess||y.progress.postprocess);return{newFiles:o,startedFiles:a,uploadStartedFiles:s,pausedFiles:l,completeFiles:u,erroredFiles:c,inProgressFiles:i,inProgressNotPausedFiles:h,processingFiles:S,isUploadStarted:s.length>0,isAllComplete:t===100&&u.length===n.length&&S.length===0,isAllErrored:!!r&&c.length===n.length,isAllPaused:i.length!==0&&l.length===i.length,isUploadInProgress:i.length>0,isSomeGhost:n.some(y=>y.isGhost)}}validateRestrictions(e,t){try{return zt(this,Mh)[Mh](e,t),{result:!0}}catch(r){return{result:!1,reason:r.message}}}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!(!t[e]||t[e].isGhost)}addFile(e){zt(this,Fh)[Fh](e);const{files:t}=this.getState();let r=zt(this,Nh)[Nh](t,e);return t[r.id]&&t[r.id].isGhost&&(r=at(at({},t[r.id]),{data:e.data,isGhost:!1}),this.log(`Replaced the blob in the restored ghost file: ${r.name}, ${r.id}`)),this.setState({files:at(at({},t),{[r.id]:r})}),this.emit("file-added",r),this.emit("files-added",[r]),this.log(`Added file: ${r.name}, ${r.id}, mime type: ${r.type}`),zt(this,jh)[jh](),r.id}addFiles(e){zt(this,Fh)[Fh]();const t=at({},this.getState().files),r=[],n=[];for(let i=0;i<e.length;i++)try{let o=zt(this,Nh)[Nh](t,e[i]);t[o.id]&&t[o.id].isGhost&&(o=at(at({},t[o.id]),{data:e[i].data,isGhost:!1}),this.log(`Replaced blob in a ghost file: ${o.name}, ${o.id}`)),t[o.id]=o,r.push(o)}catch(o){o.isRestriction||n.push(o)}if(this.setState({files:t}),r.forEach(i=>{this.emit("file-added",i)}),this.emit("files-added",r),r.length>5?this.log(`Added batch of ${r.length} files`):Object.keys(r).forEach(i=>{this.log(`Added file: ${r[i].name}
|
|
|
id: ${r[i].id}
|
|
|
type: ${r[i].type}`)}),r.length>0&&zt(this,jh)[jh](),n.length>0){let i=`Multiple errors occurred while adding files:
|
|
|
`;if(n.forEach(o=>{i+=`
|
|
|
* ${o.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:n.length}),details:i},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(n,i);{const o=new Error(i);throw o.errors=n,o}}}removeFiles(e,t){const{files:r,currentUploads:n}=this.getState(),i=at({},r),o=at({},n),a=Object.create(null);function s(c){return a[c]===void 0}e.forEach(c=>{r[c]&&(a[c]=r[c],delete i[c])}),Object.keys(o).forEach(c=>{const h=n[c].fileIDs.filter(s);h.length!==0?o[c]=at(at({},n[c]),{fileIDs:h}):delete o[c]});const l={currentUploads:o,files:i};Object.keys(i).length===0&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),this.calculateTotalProgress();const u=Object.keys(a);u.forEach(c=>{this.emit("file-removed",a[c],t)}),u.length>5?this.log(`Removed ${u.length} files`):this.log(`Removed files: ${u.join(", ")}`)}removeFile(e,t){t===void 0&&(t=null),this.removeFiles([e],t)}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).uploadComplete)return;const t=!(this.getFile(e).isPaused||!1);return this.setFileState(e,{isPaused:t}),this.emit("upload-pause",e,t),t}pauseAll(){const e=at({},this.getState().files);Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{const r=at(at({},e[t]),{isPaused:!0});e[t]=r}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e=at({},this.getState().files);Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{const r=at(at({},e[t]),{isPaused:!1,error:null});e[t]=r}),this.setState({files:e}),this.emit("resume-all")}retryAll(){const e=at({},this.getState().files),t=Object.keys(e).filter(n=>e[n].error);if(t.forEach(n=>{const i=at(at({},e[n]),{isPaused:!1,error:null});e[n]=i}),this.setState({files:e,error:null}),this.emit("retry-all",t),t.length===0)return Promise.resolve({successful:[],failed:[]});const r=zt(this,ka)[ka](t,{forceAllowNewUpload:!0});return zt(this,La)[La](r)}cancelAll(){this.emit("cancel-all");const{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t,"cancel-all"),this.setState({totalProgress:0,error:null,recoveredState:null})}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);const t=zt(this,ka)[ka]([e],{forceAllowNewUpload:!0});return zt(this,La)[La](t)}reset(){this.cancelAll()}logout(){this.iteratePlugins(e=>{e.provider&&e.provider.logout&&e.provider.logout()})}calculateProgress(e,t){if(!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${e.id}`);const r=Number.isFinite(t.bytesTotal)&&t.bytesTotal>0;this.setFileState(e.id,{progress:at(at({},this.getFile(e.id).progress),{bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:r?Math.round(t.bytesUploaded/t.bytesTotal*100):0})}),this.calculateTotalProgress()}calculateTotalProgress(){const e=this.getFiles().filter(s=>s.progress.uploadStarted||s.progress.preprocess||s.progress.postprocess);if(e.length===0)return this.emit("progress",0),void this.setState({totalProgress:0});const t=e.filter(s=>s.progress.bytesTotal!=null),r=e.filter(s=>s.progress.bytesTotal==null);if(t.length===0){const s=100*e.length,l=r.reduce((c,h)=>c+h.progress.percentage,0),u=Math.round(l/s*100);return void this.setState({totalProgress:u})}let n=t.reduce((s,l)=>s+l.progress.bytesTotal,0);const i=n/t.length;n+=i*r.length;let o=0;t.forEach(s=>{o+=s.progress.bytesUploaded}),r.forEach(s=>{o+=i*(s.progress.percentage||0)/100});let a=n===0?0:Math.round(o/n*100);a>100&&(a=100),this.setState({totalProgress:a}),this.emit("progress",a)}updateOnlineStatus(){window.navigator.onLine===void 0||window.navigator.onLine?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e,t){if(typeof e!="function")throw new TypeError(`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`);const r=new e(this,t),n=r.id;if(!n)throw new Error("Your plugin must have an id");if(!r.type)throw new Error("Your plugin must have a type");const i=this.getPlugin(n);if(i){const o=`Already found a plugin named '${i.id}'. Tried to use: '${n}'.
|
|
|
Uppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id.`;throw new Error(o)}return e.VERSION&&this.log(`Using ${n} v${e.VERSION}`),r.type in zt(this,ni)[ni]?zt(this,ni)[ni][r.type].push(r):zt(this,ni)[ni][r.type]=[r],r.install(),this}getPlugin(e){for(const t of Object.values(zt(this,ni)[ni])){const r=t.find(n=>n.id===e);if(r!=null)return r}}[gI](e){return zt(this,ni)[ni][e]}iteratePlugins(e){Object.values(zt(this,ni)[ni]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=zt(this,ni)[ni][e.type],r=t.findIndex(i=>i.id===e.id);r!==-1&&t.splice(r,1);const n={plugins:at(at({},this.getState().plugins),{[e.id]:void 0})};this.setState(n)}close(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.reset(),zt(this,Ih)[Ih](),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window!="undefined"&&window.removeEventListener&&(window.removeEventListener("online",zt(this,_o)[_o]),window.removeEventListener("offline",zt(this,_o)[_o]))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,r){t===void 0&&(t="info"),r===void 0&&(r=3e3);const n=typeof e=="object";this.setState({info:[...this.getState().info,{type:t,message:n?e.message:e,details:n?e.details:null}]}),setTimeout(()=>this.hideInfo(),r),this.emit("info-visible")}log(e,t){const{logger:r}=this.opts;switch(t){case"error":r.error(e);break;case"warning":r.warn(e);break;default:r.debug(e)}}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?zt(this,La)[La](e):(zt(this,Gl)[Gl](e),Promise.reject(new Error("Nonexistent upload")))}[vI](){return zt(this,ka)[ka](...arguments)}addResultData(e,t){if(!zt(this,Ox)[Ox](e))return void this.log(`Not setting result for an upload that has been removed: ${e}`);const{currentUploads:r}=this.getState(),n=at(at({},r[e]),{result:at(at({},r[e].result),t)});this.setState({currentUploads:at(at({},r),{[e]:n})})}upload(){var e;(e=zt(this,ni)[ni].uploader)!=null&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState();const r=this.opts.onBeforeUpload(t);return r===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(r&&typeof r=="object"&&(t=r,this.setState({files:t})),Promise.resolve().then(()=>{zt(this,Tx)[Tx](t),zt(this,Ax)[Ax](t)}).catch(n=>{zt(this,Un)[Un](n)}).then(()=>{const{currentUploads:n}=this.getState(),i=Object.values(n).flatMap(s=>s.fileIDs),o=[];Object.keys(t).forEach(s=>{const l=this.getFile(s);l.progress.uploadStarted||i.indexOf(s)!==-1||o.push(l.id)});const a=zt(this,ka)[ka](o);return zt(this,La)[La](a)}).catch(n=>{zt(this,Un)[Un](n,{showInformer:!1})}))}}function NX(e,t){t===void 0&&(t=this.getFiles());const{maxFileSize:r,minFileSize:n,maxTotalFileSize:i,maxNumberOfFiles:o,allowedFileTypes:a}=this.opts.restrictions;if(o&&t.length+1>o)throw new Jo(`${this.i18n("youCanOnlyUploadX",{smart_count:o})}`);if(a&&!a.some(s=>s.indexOf("/")>-1?!!e.type&&DX(e.type.replace(/;.*?$/,""),s):!(s[0]!=="."||!e.extension)&&e.extension.toLowerCase()===s.substr(1).toLowerCase())){const s=a.join(", ");throw new Jo(this.i18n("youCanOnlyUploadFileTypes",{types:s}))}if(i&&e.size!=null){let s=0;if(s+=e.size,t.forEach(l=>{s+=l.size}),s>i)throw new Jo(this.i18n("exceedsSize",{size:Sx(i),file:e.name}))}if(r&&e.size!=null&&e.size>r)throw new Jo(this.i18n("exceedsSize",{size:Sx(r),file:e.name}));if(n&&e.size!=null&&e.size<n)throw new Jo(this.i18n("inferiorSize",{size:Sx(n)}))}function jX(e){const{minNumberOfFiles:t}=this.opts.restrictions;if(Object.keys(e).length<t)throw new Jo(`${this.i18n("youHaveToAtLeastSelectX",{smart_count:t})}`)}function UX(e){const{requiredMetaFields:t}=this.opts.restrictions,{hasOwnProperty:r}=Object.prototype,n=[],i=[];for(let o=0;o<t.length;o++)if(!r.call(e.meta,t[o])||e.meta[t[o]]===""){const a=new Jo(`${this.i18n("missingRequiredMetaFieldOnFile",{fileName:e.name})}`);n.push(a),i.push(t[o]),zt(this,Un)[Un](a,{file:e,showInformer:!1,throwErr:!1})}return this.setFileState(e.id,{missingRequiredMetaFields:i}),n}function HX(e){const t=Object.keys(e).flatMap(r=>{const n=this.getFile(r);return zt(this,Bh)[Bh](n)});if(t.length)throw new FX(t,`${this.i18n("missingRequiredMetaField")}`)}function zX(e,t){let{showInformer:r=!0,file:n=null,throwErr:i=!0}=t===void 0?{}:t;const o=typeof e=="object"?e.message:e,a=typeof e=="object"&&e.details?e.details:"";let s=o;if(a&&(s+=` ${a}`),e.isRestriction?(this.log(s),this.emit("restriction-failed",n,e)):this.log(s,"error"),r&&this.info({message:o,details:a},"error",this.opts.infoTimeout),i)throw typeof e=="object"?e:new Error(e)}function WX(e){const{allowNewUpload:t}=this.getState();t===!1&&zt(this,Un)[Un](new Jo(this.i18n("noMoreFilesAllowed")),{file:e})}function GX(e,t){const r=function(h){var S;if(h.type)return h.type;const y=h.name?(S=cI(h.name).extension)==null?void 0:S.toLowerCase():null;return y&&y in dI?dI[y]:"application/octet-stream"}(t),n=function(h,S){return S.name?S.name:h.split("/")[0]==="image"?`${h.split("/")[0]}.${h.split("/")[1]}`:"noname"}(r,t),i=cI(n).extension,o=Boolean(t.isRemote),a=function(h){let S="uppy";return typeof h.name=="string"&&(S+=`-${hI(h.name.toLowerCase())}`),h.type!==void 0&&(S+=`-${h.type}`),h.meta&&typeof h.meta.relativePath=="string"&&(S+=`-${hI(h.meta.relativePath.toLowerCase())}`),h.data.size!==void 0&&(S+=`-${h.data.size}`),h.data.lastModified!==void 0&&(S+=`-${h.data.lastModified}`),S}(at(at({},t),{type:r}));if(this.checkIfFileAlreadyExists(a)){const h=new Jo(this.i18n("noDuplicates",{fileName:n}));zt(this,Un)[Un](h,{file:t})}const s=t.meta||{};s.name=n,s.type=r;const l=Number.isFinite(t.data.size)?t.data.size:null;let u={source:t.source||"",id:a,name:n,extension:i||"",meta:at(at({},this.getState().meta),s),type:r,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:l,uploadComplete:!1,uploadStarted:null},size:l,isRemote:o,remote:t.remote||"",preview:t.preview};const c=this.opts.onBeforeFileAdded(u,e);c===!1?zt(this,Un)[Un](new Jo("Cannot add the file because onBeforeFileAdded returned false."),{showInformer:!1,fileDescriptor:t}):typeof c=="object"&&c!==null&&(u=c);try{const h=Object.keys(e).map(S=>e[S]);zt(this,Mh)[Mh](u,h)}catch(h){zt(this,Un)[Un](h,{file:u})}return u}function VX(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(e=>{e.isRestriction||this.log(e.stack||e.message||e)})},4))}function KX(){const e=(t,r,n)=>{let i=t.message||"Unknown error";t.details&&(i+=` ${t.details}`),this.setState({error:i}),r!=null&&r.id in this.getState().files&&this.setFileState(r.id,{error:i,response:n})};this.on("error",e),this.on("upload-error",(t,r,n)=>{if(e(r,t,n),typeof r=="object"&&r.message){const i=new Error(r.message);i.details=r.message,r.details&&(i.details+=` ${r.details}`),i.message=this.i18n("failedToUpload",{file:t.name}),zt(this,Un)[Un](i,{throwErr:!1})}else zt(this,Un)[Un](r,{throwErr:!1})}),this.on("upload",()=>{this.setState({error:null})}),this.on("upload-started",t=>{this.getFile(t.id)?this.setFileState(t.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:t.size}}):this.log(`Not setting progress for a file that has been removed: ${t.id}`)}),this.on("upload-progress",this.calculateProgress),this.on("upload-success",(t,r)=>{if(!this.getFile(t.id))return void this.log(`Not setting progress for a file that has been removed: ${t.id}`);const n=this.getFile(t.id).progress;this.setFileState(t.id,{progress:at(at({},n),{postprocess:zt(this,Ra)[Ra].size>0?{mode:"indeterminate"}:null,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal}),response:r,uploadURL:r.uploadURL,isPaused:!1}),t.size==null&&this.setFileState(t.id,{size:r.bytesUploaded||n.bytesTotal}),this.calculateTotalProgress()}),this.on("preprocess-progress",(t,r)=>{this.getFile(t.id)?this.setFileState(t.id,{progress:at(at({},this.getFile(t.id).progress),{preprocess:r})}):this.log(`Not setting progress for a file that has been removed: ${t.id}`)}),this.on("preprocess-complete",t=>{if(!this.getFile(t.id))return void this.log(`Not setting progress for a file that has been removed: ${t.id}`);const r=at({},this.getState().files);r[t.id]=at(at({},r[t.id]),{progress:at({},r[t.id].progress)}),delete r[t.id].progress.preprocess,this.setState({files:r})}),this.on("postprocess-progress",(t,r)=>{this.getFile(t.id)?this.setFileState(t.id,{progress:at(at({},this.getState().files[t.id].progress),{postprocess:r})}):this.log(`Not setting progress for a file that has been removed: ${t.id}`)}),this.on("postprocess-complete",t=>{if(!this.getFile(t.id))return void this.log(`Not setting progress for a file that has been removed: ${t.id}`);const r=at({},this.getState().files);r[t.id]=at(at({},r[t.id]),{progress:at({},r[t.id].progress)}),delete r[t.id].progress.postprocess,this.setState({files:r})}),this.on("restored",()=>{this.calculateTotalProgress()}),this.on("dashboard:file-edit-complete",t=>{t&&zt(this,Bh)[Bh](t)}),typeof window!="undefined"&&window.addEventListener&&(window.addEventListener("online",zt(this,_o)[_o]),window.addEventListener("offline",zt(this,_o)[_o]),setTimeout(zt(this,_o)[_o],3e3))}function $X(e,t){t===void 0&&(t={});const{forceAllowNewUpload:r=!1}=t,{allowNewUpload:n,currentUploads:i}=this.getState();if(!n&&!r)throw new Error("Cannot create a new upload: already uploading.");const o=IX();return this.emit("upload",{id:o,fileIDs:e}),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:at(at({},i),{[o]:{fileIDs:e,step:0,result:{}}})}),o}function XX(e){const{currentUploads:t}=this.getState();return t[e]}function YX(e){const t=at({},this.getState().currentUploads);delete t[e],this.setState({currentUploads:t})}function ZX(e){return bR(this,null,function*(){let{currentUploads:t}=this.getState(),r=t[e];const n=r.step||0,i=[...zt(this,zl)[zl],...zt(this,Wl)[Wl],...zt(this,Ra)[Ra]];try{for(let a=n;a<i.length&&r;a++){const s=i[a],l=at(at({},r),{step:a});this.setState({currentUploads:at(at({},t),{[e]:l})}),yield s(l.fileIDs,e),t=this.getState().currentUploads,r=t[e]}}catch(a){throw this.emit("error",a),zt(this,Gl)[Gl](e),a}if(r){r.fileIDs.forEach(u=>{const c=this.getFile(u);c&&c.progress.postprocess&&this.emit("postprocess-complete",c)});const a=r.fileIDs.map(u=>this.getFile(u)),s=a.filter(u=>!u.error),l=a.filter(u=>u.error);yield this.addResultData(e,{successful:s,failed:l,uploadID:e}),t=this.getState().currentUploads,r=t[e]}let o;return r&&(o=r.result,this.emit("complete",o),zt(this,Gl)[Gl](e)),o==null&&this.log(`Not setting result for an upload that has been removed: ${e}`),o})}mI.VERSION="2.1.3";var yI=mI,JX=ae(function(e,t){var r,n,i,o,a,s,l,u,c={},h=[],S=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function y(Re,Te){for(var Fe in Te)Re[Fe]=Te[Fe];return Re}function W(Re){var Te=Re.parentNode;Te&&Te.removeChild(Re)}function B(Re,Te,Fe){var rt,vt,ut,kt={};for(ut in Te)ut=="key"?rt=Te[ut]:ut=="ref"?vt=Te[ut]:kt[ut]=Te[ut];if(arguments.length>2&&(kt.children=arguments.length>3?r.call(arguments,2):Fe),typeof Re=="function"&&Re.defaultProps!=null)for(ut in Re.defaultProps)kt[ut]===void 0&&(kt[ut]=Re.defaultProps[ut]);return N(Re,kt,rt,vt,null)}function N(Re,Te,Fe,rt,vt){var ut={type:Re,props:Te,key:Fe,ref:rt,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:vt==null?++i:vt};return vt==null&&n.vnode!=null&&n.vnode(ut),ut}function U(Re){return Re.children}function D(Re,Te){this.props=Re,this.context=Te}function Q(Re,Te){if(Te==null)return Re.__?Q(Re.__,Re.__.__k.indexOf(Re)+1):null;for(var Fe;Te<Re.__k.length;Te++)if((Fe=Re.__k[Te])!=null&&Fe.__e!=null)return Fe.__e;return typeof Re.type=="function"?Q(Re):null}function te(Re){var Te,Fe;if((Re=Re.__)!=null&&Re.__c!=null){for(Re.__e=Re.__c.base=null,Te=0;Te<Re.__k.length;Te++)if((Fe=Re.__k[Te])!=null&&Fe.__e!=null){Re.__e=Re.__c.base=Fe.__e;break}return te(Re)}}function he(Re){(!Re.__d&&(Re.__d=!0)&&a.push(Re)&&!Ee.__r++||l!==n.debounceRendering)&&((l=n.debounceRendering)||s)(Ee)}function Ee(){for(var Re;Ee.__r=a.length;)Re=a.sort(function(Te,Fe){return Te.__v.__b-Fe.__v.__b}),a=[],Re.some(function(Te){var Fe,rt,vt,ut,kt,Xt;Te.__d&&(kt=(ut=(Fe=Te).__v).__e,(Xt=Fe.__P)&&(rt=[],(vt=y({},ut)).__v=ut.__v+1,dt(Xt,ut,vt,Fe.__n,Xt.ownerSVGElement!==void 0,ut.__h!=null?[kt]:null,rt,kt==null?Q(ut):kt,ut.__h),ht(rt,ut),ut.__e!=kt&&te(ut)))})}function ve(Re,Te,Fe,rt,vt,ut,kt,Xt,qt,or){var ft,br,lr,Gt,ur,yn,Ar,Hr=rt&&rt.__k||h,on=Hr.length;for(Fe.__k=[],ft=0;ft<Te.length;ft++)if((Gt=Fe.__k[ft]=(Gt=Te[ft])==null||typeof Gt=="boolean"?null:typeof Gt=="string"||typeof Gt=="number"||typeof Gt=="bigint"?N(null,Gt,null,null,Gt):Array.isArray(Gt)?N(U,{children:Gt},null,null,null):Gt.__b>0?N(Gt.type,Gt.props,Gt.key,null,Gt.__v):Gt)!=null){if(Gt.__=Fe,Gt.__b=Fe.__b+1,(lr=Hr[ft])===null||lr&&Gt.key==lr.key&&Gt.type===lr.type)Hr[ft]=void 0;else for(br=0;br<on;br++){if((lr=Hr[br])&&Gt.key==lr.key&&Gt.type===lr.type){Hr[br]=void 0;break}lr=null}dt(Re,Gt,lr=lr||c,vt,ut,kt,Xt,qt,or),ur=Gt.__e,(br=Gt.ref)&&lr.ref!=br&&(Ar||(Ar=[]),lr.ref&&Ar.push(lr.ref,null,Gt),Ar.push(br,Gt.__c||ur,Gt)),ur!=null?(yn==null&&(yn=ur),typeof Gt.type=="function"&&Gt.__k===lr.__k?Gt.__d=qt=De(Gt,qt,Re):qt=Pe(Re,Gt,lr,Hr,ur,qt),typeof Fe.type=="function"&&(Fe.__d=qt)):qt&&lr.__e==qt&&qt.parentNode!=Re&&(qt=Q(lr))}for(Fe.__e=yn,ft=on;ft--;)Hr[ft]!=null&&(typeof Fe.type=="function"&&Hr[ft].__e!=null&&Hr[ft].__e==Fe.__d&&(Fe.__d=Q(rt,ft+1)),Ft(Hr[ft],Hr[ft]));if(Ar)for(ft=0;ft<Ar.length;ft++)Dt(Ar[ft],Ar[++ft],Ar[++ft])}function De(Re,Te,Fe){for(var rt,vt=Re.__k,ut=0;vt&&ut<vt.length;ut++)(rt=vt[ut])&&(rt.__=Re,Te=typeof rt.type=="function"?De(rt,Te,Fe):Pe(Fe,rt,rt,vt,rt.__e,Te));return Te}function Pe(Re,Te,Fe,rt,vt,ut){var kt,Xt,qt;if(Te.__d!==void 0)kt=Te.__d,Te.__d=void 0;else if(Fe==null||vt!=ut||vt.parentNode==null)e:if(ut==null||ut.parentNode!==Re)Re.appendChild(vt),kt=null;else{for(Xt=ut,qt=0;(Xt=Xt.nextSibling)&&qt<rt.length;qt+=2)if(Xt==vt)break e;Re.insertBefore(vt,ut),kt=ut}return kt!==void 0?kt:vt.nextSibling}function qe(Re,Te,Fe){Te[0]==="-"?Re.setProperty(Te,Fe):Re[Te]=Fe==null?"":typeof Fe!="number"||S.test(Te)?Fe:Fe+"px"}function ot(Re,Te,Fe,rt,vt){var ut;e:if(Te==="style")if(typeof Fe=="string")Re.style.cssText=Fe;else{if(typeof rt=="string"&&(Re.style.cssText=rt=""),rt)for(Te in rt)Fe&&Te in Fe||qe(Re.style,Te,"");if(Fe)for(Te in Fe)rt&&Fe[Te]===rt[Te]||qe(Re.style,Te,Fe[Te])}else if(Te[0]==="o"&&Te[1]==="n")ut=Te!==(Te=Te.replace(/Capture$/,"")),Te=Te.toLowerCase()in Re?Te.toLowerCase().slice(2):Te.slice(2),Re.l||(Re.l={}),Re.l[Te+ut]=Fe,Fe?rt||Re.addEventListener(Te,ut?gt:et,ut):Re.removeEventListener(Te,ut?gt:et,ut);else if(Te!=="dangerouslySetInnerHTML"){if(vt)Te=Te.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if(Te!=="href"&&Te!=="list"&&Te!=="form"&&Te!=="tabIndex"&&Te!=="download"&&Te in Re)try{Re[Te]=Fe==null?"":Fe;break e}catch(kt){}typeof Fe=="function"||(Fe!=null&&(Fe!==!1||Te[0]==="a"&&Te[1]==="r")?Re.setAttribute(Te,Fe):Re.removeAttribute(Te))}}function et(Re){this.l[Re.type+!1](n.event?n.event(Re):Re)}function gt(Re){this.l[Re.type+!0](n.event?n.event(Re):Re)}function dt(Re,Te,Fe,rt,vt,ut,kt,Xt,qt){var or,ft,br,lr,Gt,ur,yn,Ar,Hr,on,vi,Sr=Te.type;if(Te.constructor!==void 0)return null;Fe.__h!=null&&(qt=Fe.__h,Xt=Te.__e=Fe.__e,Te.__h=null,ut=[Xt]),(or=n.__b)&&or(Te);try{e:if(typeof Sr=="function"){if(Ar=Te.props,Hr=(or=Sr.contextType)&&rt[or.__c],on=or?Hr?Hr.props.value:or.__:rt,Fe.__c?yn=(ft=Te.__c=Fe.__c).__=ft.__E:("prototype"in Sr&&Sr.prototype.render?Te.__c=ft=new Sr(Ar,on):(Te.__c=ft=new D(Ar,on),ft.constructor=Sr,ft.render=Bt),Hr&&Hr.sub(ft),ft.props=Ar,ft.state||(ft.state={}),ft.context=on,ft.__n=rt,br=ft.__d=!0,ft.__h=[]),ft.__s==null&&(ft.__s=ft.state),Sr.getDerivedStateFromProps!=null&&(ft.__s==ft.state&&(ft.__s=y({},ft.__s)),y(ft.__s,Sr.getDerivedStateFromProps(Ar,ft.__s))),lr=ft.props,Gt=ft.state,br)Sr.getDerivedStateFromProps==null&&ft.componentWillMount!=null&&ft.componentWillMount(),ft.componentDidMount!=null&&ft.__h.push(ft.componentDidMount);else{if(Sr.getDerivedStateFromProps==null&&Ar!==lr&&ft.componentWillReceiveProps!=null&&ft.componentWillReceiveProps(Ar,on),!ft.__e&&ft.shouldComponentUpdate!=null&&ft.shouldComponentUpdate(Ar,ft.__s,on)===!1||Te.__v===Fe.__v){ft.props=Ar,ft.state=ft.__s,Te.__v!==Fe.__v&&(ft.__d=!1),ft.__v=Te,Te.__e=Fe.__e,Te.__k=Fe.__k,Te.__k.forEach(function(Mi){Mi&&(Mi.__=Te)}),ft.__h.length&&kt.push(ft);break e}ft.componentWillUpdate!=null&&ft.componentWillUpdate(Ar,ft.__s,on),ft.componentDidUpdate!=null&&ft.__h.push(function(){ft.componentDidUpdate(lr,Gt,ur)})}ft.context=on,ft.props=Ar,ft.state=ft.__s,(or=n.__r)&&or(Te),ft.__d=!1,ft.__v=Te,ft.__P=Re,or=ft.render(ft.props,ft.state,ft.context),ft.state=ft.__s,ft.getChildContext!=null&&(rt=y(y({},rt),ft.getChildContext())),br||ft.getSnapshotBeforeUpdate==null||(ur=ft.getSnapshotBeforeUpdate(lr,Gt)),vi=or!=null&&or.type===U&&or.key==null?or.props.children:or,ve(Re,Array.isArray(vi)?vi:[vi],Te,Fe,rt,vt,ut,kt,Xt,qt),ft.base=Te.__e,Te.__h=null,ft.__h.length&&kt.push(ft),yn&&(ft.__E=ft.__=null),ft.__e=!1}else ut==null&&Te.__v===Fe.__v?(Te.__k=Fe.__k,Te.__e=Fe.__e):Te.__e=pt(Fe.__e,Te,Fe,rt,vt,ut,kt,qt);(or=n.diffed)&&or(Te)}catch(Mi){Te.__v=null,(qt||ut!=null)&&(Te.__e=Xt,Te.__h=!!qt,ut[ut.indexOf(Xt)]=null),n.__e(Mi,Te,Fe)}}function ht(Re,Te){n.__c&&n.__c(Te,Re),Re.some(function(Fe){try{Re=Fe.__h,Fe.__h=[],Re.some(function(rt){rt.call(Fe)})}catch(rt){n.__e(rt,Fe.__v)}})}function pt(Re,Te,Fe,rt,vt,ut,kt,Xt){var qt,or,ft,br=Fe.props,lr=Te.props,Gt=Te.type,ur=0;if(Gt==="svg"&&(vt=!0),ut!=null){for(;ur<ut.length;ur++)if((qt=ut[ur])&&"setAttribute"in qt==!!Gt&&(Gt?qt.localName===Gt:qt.nodeType===3)){Re=qt,ut[ur]=null;break}}if(Re==null){if(Gt===null)return document.createTextNode(lr);Re=vt?document.createElementNS("http://www.w3.org/2000/svg",Gt):document.createElement(Gt,lr.is&&lr),ut=null,Xt=!1}if(Gt===null)br===lr||Xt&&Re.data===lr||(Re.data=lr);else{if(ut=ut&&r.call(Re.childNodes),or=(br=Fe.props||c).dangerouslySetInnerHTML,ft=lr.dangerouslySetInnerHTML,!Xt){if(ut!=null)for(br={},ur=0;ur<Re.attributes.length;ur++)br[Re.attributes[ur].name]=Re.attributes[ur].value;(ft||or)&&(ft&&(or&&ft.__html==or.__html||ft.__html===Re.innerHTML)||(Re.innerHTML=ft&&ft.__html||""))}if(function(yn,Ar,Hr,on,vi){var Sr;for(Sr in Hr)Sr==="children"||Sr==="key"||Sr in Ar||ot(yn,Sr,null,Hr[Sr],on);for(Sr in Ar)vi&&typeof Ar[Sr]!="function"||Sr==="children"||Sr==="key"||Sr==="value"||Sr==="checked"||Hr[Sr]===Ar[Sr]||ot(yn,Sr,Ar[Sr],Hr[Sr],on)}(Re,lr,br,vt,Xt),ft)Te.__k=[];else if(ur=Te.props.children,ve(Re,Array.isArray(ur)?ur:[ur],Te,Fe,rt,vt&&Gt!=="foreignObject",ut,kt,ut?ut[0]:Fe.__k&&Q(Fe,0),Xt),ut!=null)for(ur=ut.length;ur--;)ut[ur]!=null&&W(ut[ur]);Xt||("value"in lr&&(ur=lr.value)!==void 0&&(ur!==br.value||ur!==Re.value||Gt==="progress"&&!ur)&&ot(Re,"value",ur,br.value,!1),"checked"in lr&&(ur=lr.checked)!==void 0&&ur!==Re.checked&&ot(Re,"checked",ur,br.checked,!1))}return Re}function Dt(Re,Te,Fe){try{typeof Re=="function"?Re(Te):Re.current=Te}catch(rt){n.__e(rt,Fe)}}function Ft(Re,Te,Fe){var rt,vt;if(n.unmount&&n.unmount(Re),(rt=Re.ref)&&(rt.current&&rt.current!==Re.__e||Dt(rt,null,Te)),(rt=Re.__c)!=null){if(rt.componentWillUnmount)try{rt.componentWillUnmount()}catch(ut){n.__e(ut,Te)}rt.base=rt.__P=null}if(rt=Re.__k)for(vt=0;vt<rt.length;vt++)rt[vt]&&Ft(rt[vt],Te,typeof Re.type!="function");Fe||Re.__e==null||W(Re.__e),Re.__e=Re.__d=void 0}function Bt(Re,Te,Fe){return this.constructor(Re,Fe)}function It(Re,Te,Fe){var rt,vt,ut;n.__&&n.__(Re,Te),vt=(rt=typeof Fe=="function")?null:Fe&&Fe.__k||Te.__k,ut=[],dt(Te,Re=(!rt&&Fe||Te).__k=B(U,null,[Re]),vt||c,c,Te.ownerSVGElement!==void 0,!rt&&Fe?[Fe]:vt?null:Te.firstChild?r.call(Te.childNodes):null,ut,!rt&&Fe?Fe:vt?vt.__e:Te.firstChild,rt),ht(ut,Re)}r=h.slice,n={__e:function(Re,Te){for(var Fe,rt,vt;Te=Te.__;)if((Fe=Te.__c)&&!Fe.__)try{if((rt=Fe.constructor)&&rt.getDerivedStateFromError!=null&&(Fe.setState(rt.getDerivedStateFromError(Re)),vt=Fe.__d),Fe.componentDidCatch!=null&&(Fe.componentDidCatch(Re),vt=Fe.__d),vt)return Fe.__E=Fe}catch(ut){Re=ut}throw Re}},i=0,o=function(Re){return Re!=null&&Re.constructor===void 0},D.prototype.setState=function(Re,Te){var Fe;Fe=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=y({},this.state),typeof Re=="function"&&(Re=Re(y({},Fe),this.props)),Re&&y(Fe,Re),Re!=null&&this.__v&&(Te&&this.__h.push(Te),he(this))},D.prototype.forceUpdate=function(Re){this.__v&&(this.__e=!0,Re&&this.__h.push(Re),he(this))},D.prototype.render=U,a=[],s=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ee.__r=0,u=0,t.Component=D,t.Fragment=U,t.cloneElement=function(Re,Te,Fe){var rt,vt,ut,kt=y({},Re.props);for(ut in Te)ut=="key"?rt=Te[ut]:ut=="ref"?vt=Te[ut]:kt[ut]=Te[ut];return arguments.length>2&&(kt.children=arguments.length>3?r.call(arguments,2):Fe),N(Re.type,kt,rt||Re.key,vt||Re.ref,null)},t.createContext=function(Re,Te){var Fe={__c:Te="__cC"+u++,__:Re,Consumer:function(rt,vt){return rt.children(vt)},Provider:function(rt){var vt,ut;return this.getChildContext||(vt=[],(ut={})[Te]=this,this.getChildContext=function(){return ut},this.shouldComponentUpdate=function(kt){this.props.value!==kt.value&&vt.some(he)},this.sub=function(kt){vt.push(kt);var Xt=kt.componentWillUnmount;kt.componentWillUnmount=function(){vt.splice(vt.indexOf(kt),1),Xt&&Xt.call(kt)}}),rt.children}};return Fe.Provider.__=Fe.Consumer.contextType=Fe},t.createElement=B,t.createRef=function(){return{current:null}},t.h=B,t.hydrate=function Re(Te,Fe){It(Te,Fe,Re)},t.isValidElement=o,t.options=n,t.render=It,t.toChildArray=function Re(Te,Fe){return Fe=Fe||[],Te==null||typeof Te=="boolean"||(Array.isArray(Te)?Te.some(function(rt){Re(rt,Fe)}):Fe.push(Te)),Fe}}),QX=function(e,t){return t===void 0&&(t=document),typeof e=="string"?t.querySelector(e):((r=e)==null?void 0:r.nodeType)===Node.ELEMENT_NODE?e:null;var r},_x=class{constructor(e,t){t===void 0&&(t={}),this.uppy=e,this.opts=t}getPluginState(){const{plugins:e}=this.uppy.getState();return e[this.id]||{}}setPluginState(e){const{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:at(at({},t),{[this.id]:at(at({},t[this.id]),e)})})}setOptions(e){this.opts=at(at({},this.opts),e),this.setPluginState(),this.i18nInit()}i18nInit(){const e=new iI([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState()}addTarget(){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}render(){throw new Error("Extend the render method to add your plugin to a DOM element")}update(){}afterUpdate(){}};function bI(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var qX=0;function eY(e){return"__private_"+qX+++"_"+e}const{render:EI}=JX;var Uh=eY("updateUI");class xI extends _x{constructor(){super(...arguments),Object.defineProperty(this,Uh,{writable:!0,value:void 0})}mount(e,t){const r=t.id,n=QX(e);if(n){this.isTargetDOMEl=!0;const a=document.createDocumentFragment();return bI(this,Uh)[Uh]=function(s){let l=null,u=null;return function(){for(var c=arguments.length,h=new Array(c),S=0;S<c;S++)h[S]=arguments[S];return u=h,l||(l=Promise.resolve().then(()=>(l=null,s(...u)))),l}}(s=>{this.uppy.getPlugin(this.id)&&(EI(this.render(s),a),this.afterUpdate())}),this.uppy.log(`Installing ${r} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(n.innerHTML=""),EI(this.render(this.uppy.getState()),a),this.el=a.firstElementChild,n.appendChild(a),this.onMount(),this.el}let i;if(typeof e=="object"&&e instanceof xI)i=e;else if(typeof e=="function"){const a=e;this.uppy.iteratePlugins(s=>{if(s instanceof a)return i=s,!1})}if(i)return this.uppy.log(`Installing ${r} to ${i.id}`),this.parent=i,this.el=i.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${r}`);let o=`Invalid target option given to ${r}.`;throw o+=typeof e=="function"?" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":"If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(o)}update(e){var t,r;this.el!=null&&((t=(r=bI(this,Uh))[Uh])==null||t.call(r,e))}unmount(){var e;this.isTargetDOMEl&&((e=this.el)==null||e.remove()),this.onUnmount()}onMount(){}onUnmount(){}}var tY=xI;const{debugLogger:rY}=fI;var Hh=yI,nY=yI,iY=tY,oY=_x,aY=rY;Hh.Uppy=nY,Hh.UIPlugin=iY,Hh.BasePlugin=oY,Hh.debugLogger=aY;class sY extends Error{constructor(e,t){t===void 0&&(t=null),super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=t}}var Rx=sY,kx=function(){return fetch(...arguments).catch(e=>{throw e.name==="AbortError"?e:new Rx(e)})};class lY extends Error{constructor(){super("Authorization required"),this.name="AuthError",this.isAuthError=!0}}var em,ds,Qo,hs,SI,uY=lY;function qo(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var cY=0;function Lx(e){return"__private_"+cY+++"_"+e}function Px(e){return bR(this,null,function*(){if(e.status===401)throw new uY;const t=e.json();if(e.status<200||e.status>300){let r=`Failed request with status: ${e.status}. ${e.statusText}`;try{const n=yield t;r=n.message?`${r} message: ${n.message}`:r,r=n.requestId?`${r} request-Id: ${n.requestId}`:r}finally{throw new Error(r)}}return t})}var Ix=(ds=Lx("getPostResponseFunc"),Qo=Lx("getUrl"),hs=Lx("errorHandler"),SI=em=class e{constructor(t,r){Object.defineProperty(this,hs,{value:hY}),Object.defineProperty(this,Qo,{value:dY}),Object.defineProperty(this,ds,{writable:!0,value:n=>i=>n?i:this.onReceiveResponse(i)}),this.uppy=t,this.opts=r,this.onReceiveResponse=this.onReceiveResponse.bind(this),this.allowedHeaders=["accept","content-type","uppy-auth-token"],this.preflightDone=!1}get hostname(){const{companion:t}=this.uppy.getState(),r=this.opts.companionUrl;return(t&&t[r]?t[r]:r).replace(/\/$/,"")}headers(){const t=this.opts.companionHeaders||{};return Promise.resolve(at(at({},e.defaultHeaders),t))}onReceiveResponse(t){const r=this.uppy.getState().companion||{},n=this.opts.companionUrl,{headers:i}=t;return i.has("i-am")&&i.get("i-am")!==r[n]&&this.uppy.setState({companion:at(at({},r),{[n]:i.get("i-am")})}),t}preflight(t){return this.preflightDone?Promise.resolve(this.allowedHeaders.slice()):fetch(qo(this,Qo)[Qo](t),{method:"OPTIONS"}).then(r=>(r.headers.has("access-control-allow-headers")&&(this.allowedHeaders=r.headers.get("access-control-allow-headers").split(",").map(n=>n.trim().toLowerCase())),this.preflightDone=!0,this.allowedHeaders.slice())).catch(r=>(this.uppy.log(`[CompanionClient] unable to make preflight request ${r}`,"warning"),this.preflightDone=!0,this.allowedHeaders.slice()))}preflightAndHeaders(t){return Promise.all([this.preflight(t),this.headers()]).then(r=>{let[n,i]=r;return Object.keys(i).forEach(o=>{n.includes(o.toLowerCase())||(this.uppy.log(`[CompanionClient] excluding disallowed header ${o}`),delete i[o])}),i})}get(t,r){return this.preflightAndHeaders(t).then(n=>kx(qo(this,Qo)[Qo](t),{method:"get",headers:n,credentials:this.opts.companionCookiesRule||"same-origin"})).then(qo(this,ds)[ds](r)).then(Px).catch(qo(this,hs)[hs]("get",t))}post(t,r,n){const i="post";return this.preflightAndHeaders(t).then(o=>kx(qo(this,Qo)[Qo](t),{method:i,headers:o,credentials:this.opts.companionCookiesRule||"same-origin",body:JSON.stringify(r)})).then(qo(this,ds)[ds](n)).then(Px).catch(qo(this,hs)[hs](i,t))}delete(t,r,n){const i="delete";return this.preflightAndHeaders(t).then(o=>kx(`${this.hostname}/${t}`,{method:i,headers:o,credentials:this.opts.companionCookiesRule||"same-origin",body:r?JSON.stringify(r):null})).then(qo(this,ds)[ds](n)).then(Px).catch(qo(this,hs)[hs](i,t))}},em.VERSION="2.0.4",em.defaultHeaders={Accept:"application/json","Content-Type":"application/json","Uppy-Versions":`@uppy/companion-client=${em.VERSION}`},SI);function dY(e){return/^(https?:|)\/\//.test(e)?e:`${this.hostname}/${e}`}function hY(e,t){return r=>{var n;if((n=r)==null||!n.isAuthError){const i=new Error(`Could not ${e} ${qo(this,Qo)[Qo](t)}`);i.cause=r,r=i}return Promise.reject(r)}}var fY={setItem:(e,t)=>new Promise(r=>{localStorage.setItem(e,t),r()}),getItem:e=>Promise.resolve(localStorage.getItem(e)),removeItem:e=>new Promise(t=>{localStorage.removeItem(e),t()})},ea,fs,oo,di,tm;let wI,CI;function kn(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var pY=0;function zh(e){return"__private_"+pY+++"_"+e}var gY=(ea=zh("queued"),fs=zh("emitter"),oo=zh("isOpen"),di=zh("socket"),tm=zh("handleMessage"),wI=Symbol.for("uppy test: getSocket"),CI=Symbol.for("uppy test: getQueued"),class{constructor(e){Object.defineProperty(this,ea,{writable:!0,value:[]}),Object.defineProperty(this,fs,{writable:!0,value:oI()}),Object.defineProperty(this,oo,{writable:!0,value:!1}),Object.defineProperty(this,di,{writable:!0,value:void 0}),Object.defineProperty(this,tm,{writable:!0,value:t=>{try{const r=JSON.parse(t.data);this.emit(r.action,r.payload)}catch(r){console.log(r)}}}),this.opts=e,e&&e.autoOpen===!1||this.open()}get isOpen(){return kn(this,oo)[oo]}[wI](){return kn(this,di)[di]}[CI](){return kn(this,ea)[ea]}open(){kn(this,di)[di]=new WebSocket(this.opts.target),kn(this,di)[di].onopen=()=>{for(kn(this,oo)[oo]=!0;kn(this,ea)[ea].length>0&&kn(this,oo)[oo];){const e=kn(this,ea)[ea].shift();this.send(e.action,e.payload)}},kn(this,di)[di].onclose=()=>{kn(this,oo)[oo]=!1},kn(this,di)[di].onmessage=kn(this,tm)[tm]}close(){var e;(e=kn(this,di)[di])==null||e.close()}send(e,t){kn(this,oo)[oo]?kn(this,di)[di].send(JSON.stringify({action:e,payload:t})):kn(this,ea)[ea].push({action:e,payload:t})}on(e,t){kn(this,fs)[fs].on(e,t)}emit(e,t){kn(this,fs)[fs].emit(e,t)}once(e,t){kn(this,fs)[fs].once(e,t)}}),vY={RequestClient:Ix,Provider:class extends Ix{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||(r=>r.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" "))(this.id),this.pluginId=this.opts.pluginId,this.tokenKey=`companion-${this.pluginId}-auth-token`,this.companionKeysParams=this.opts.companionKeysParams,this.preAuthToken=null}headers(){return Promise.all([super.headers(),this.getAuthToken()]).then(e=>{let[t,r]=e;const n={};return r&&(n["uppy-auth-token"]=r),this.companionKeysParams&&(n["uppy-credentials-params"]=btoa(JSON.stringify({params:this.companionKeysParams}))),at(at({},t),n)})}onReceiveResponse(e){e=super.onReceiveResponse(e);const t=this.uppy.getPlugin(this.pluginId),r=t.getPluginState().authenticated?e.status!==401:e.status<400;return t.setPluginState({authenticated:r}),e}setAuthToken(e){return this.uppy.getPlugin(this.pluginId).storage.setItem(this.tokenKey,e)}getAuthToken(){return this.uppy.getPlugin(this.pluginId).storage.getItem(this.tokenKey)}authUrl(e){return e===void 0&&(e={}),this.preAuthToken&&(e.uppyPreAuthToken=this.preAuthToken),`${this.hostname}/${this.id}/connect?${new URLSearchParams(e)}`}fileUrl(e){return`${this.hostname}/${this.id}/get/${e}`}fetchPreAuthToken(){return this.companionKeysParams?this.post(`${this.id}/preauth/`,{params:this.companionKeysParams}).then(e=>{this.preAuthToken=e.token}).catch(e=>{this.uppy.log(`[CompanionClient] unable to fetch preAuthToken ${e}`,"warning")}):Promise.resolve()}list(e){return this.get(`${this.id}/list/${e||""}`)}logout(){return this.get(`${this.id}/logout`).then(e=>Promise.all([e,this.uppy.getPlugin(this.pluginId).storage.removeItem(this.tokenKey)])).then(e=>{let[t]=e;return t})}static initPlugin(e,t,r){if(e.type="acquirer",e.files=[],r&&(e.opts=at(at({},r),t)),t.serverUrl||t.serverPattern)throw new Error("`serverUrl` and `serverPattern` have been renamed to `companionUrl` and `companionAllowedHosts` respectively in the 0.30.5 release. Please consult the docs (for example, https://uppy.io/docs/instagram/ for the Instagram plugin) and use the updated options.`");if(t.companionAllowedHosts){const n=t.companionAllowedHosts;if(!(typeof n=="string"||Array.isArray(n)||n instanceof RegExp))throw new TypeError(`${e.id}: the option "companionAllowedHosts" must be one of string, Array, RegExp`);e.opts.companionAllowedHosts=n}else/^(?!https?:\/\/).*$/i.test(t.companionUrl)?e.opts.companionAllowedHosts=`https://${t.companionUrl.replace(/^\/\//,"")}`:e.opts.companionAllowedHosts=new URL(t.companionUrl).origin;e.storage=e.opts.storage||fY}},SearchProvider:class extends Ix{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||(r=>r.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" "))(this.id),this.pluginId=this.opts.pluginId}fileUrl(e){return`${this.hostname}/search/${this.id}/get/${e}`}search(e,t){return t=t?`&${t}`:"",this.get(`search/${this.id}/list?q=${encodeURIComponent(e)}${t}`)}},Socket:gY},ps,Ac,mY=Hl(function(e,t,r){const{progress:n,bytesUploaded:i,bytesTotal:o}=t;n&&(e.uppy.log(`Upload progress: ${n}`),e.uppy.emit("upload-progress",r,{uploader:e,bytesUploaded:i,bytesTotal:o}))},300,{leading:!0,trailing:!0});function Wh(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var yY=0;function TI(e){return"__private_"+yY+++"_"+e}var AI=(ps=TI("emitter"),Ac=TI("events"),class{constructor(e){Object.defineProperty(this,ps,{writable:!0,value:void 0}),Object.defineProperty(this,Ac,{writable:!0,value:[]}),Wh(this,ps)[ps]=e}on(e,t){return Wh(this,Ac)[Ac].push([e,t]),Wh(this,ps)[ps].on(e,t)}remove(){for(const[e,t]of Wh(this,Ac)[Ac].splice(0))Wh(this,ps)[ps].off(e,t)}});function ao(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var bY=0;function rm(e){return"__private_"+bY+++"_"+e}var Pa=rm("aliveTimer"),Vl=rm("isDone"),Gh=rm("onTimedOut"),Kl=rm("timeout"),DI=class{constructor(e,t){Object.defineProperty(this,Pa,{writable:!0,value:void 0}),Object.defineProperty(this,Vl,{writable:!0,value:!1}),Object.defineProperty(this,Gh,{writable:!0,value:void 0}),Object.defineProperty(this,Kl,{writable:!0,value:void 0}),ao(this,Kl)[Kl]=e,ao(this,Gh)[Gh]=t}progress(){ao(this,Vl)[Vl]||ao(this,Kl)[Kl]>0&&(clearTimeout(ao(this,Pa)[Pa]),ao(this,Pa)[Pa]=setTimeout(ao(this,Gh)[Gh],ao(this,Kl)[Kl]))}done(){ao(this,Vl)[Vl]||(clearTimeout(ao(this,Pa)[Pa]),ao(this,Pa)[Pa]=null,ao(this,Vl)[Vl]=!0)}};function Ln(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var EY=0;function $l(e){return"__private_"+EY+++"_"+e}function xY(){return new Error("Cancelled")}var zi=$l("activeRequests"),wi=$l("queuedHandlers"),Vh=$l("call"),Kh=$l("queueNext"),Mx=$l("next"),Bx=$l("queue"),Fx=$l("dequeue");function SY(e){Ln(this,zi)[zi]+=1;let t,r=!1;try{t=e()}catch(n){throw Ln(this,zi)[zi]-=1,n}return{abort:()=>{r||(r=!0,Ln(this,zi)[zi]-=1,t(),Ln(this,Kh)[Kh]())},done:()=>{r||(r=!0,Ln(this,zi)[zi]-=1,Ln(this,Kh)[Kh]())}}}function wY(){queueMicrotask(()=>Ln(this,Mx)[Mx]())}function CY(){if(Ln(this,zi)[zi]>=this.limit)return;if(Ln(this,wi)[wi].length===0)return;const e=Ln(this,wi)[wi].shift(),t=Ln(this,Vh)[Vh](e.fn);e.abort=t.abort,e.done=t.done}function TY(e,t){t===void 0&&(t={});const r={fn:e,priority:t.priority||0,abort:()=>{Ln(this,Fx)[Fx](r)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},n=Ln(this,wi)[wi].findIndex(i=>r.priority>i.priority);return n===-1?Ln(this,wi)[wi].push(r):Ln(this,wi)[wi].splice(n,0,r),r}function AY(e){const t=Ln(this,wi)[wi].indexOf(e);t!==-1&&Ln(this,wi)[wi].splice(t,1)}var DY={RateLimitedQueue:class{constructor(e){Object.defineProperty(this,Fx,{value:AY}),Object.defineProperty(this,Bx,{value:TY}),Object.defineProperty(this,Mx,{value:CY}),Object.defineProperty(this,Kh,{value:wY}),Object.defineProperty(this,Vh,{value:SY}),Object.defineProperty(this,zi,{writable:!0,value:0}),Object.defineProperty(this,wi,{writable:!0,value:[]}),this.limit=typeof e!="number"||e===0?1/0:e}run(e,t){return Ln(this,zi)[zi]<this.limit?Ln(this,Vh)[Vh](e):Ln(this,Bx)[Bx](e,t)}wrapPromiseFunction(e,t){var r=this;return function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];let a;const s=new Promise((l,u)=>{a=r.run(()=>{let c,h;try{h=Promise.resolve(e(...i))}catch(S){h=Promise.reject(S)}return h.then(S=>{c?u(c):(a.done(),l(S))},S=>{c?u(c):(a.done(),u(S))}),()=>{c=xY()}},t)});return s.abort=()=>{a.abort()},s}}},internalRateLimitedQueue:Symbol("__queue")},OI,_I,RI=function(e){return!!e&&(e.readyState!==0&&e.readyState!==4||e.status===0)},OY={strings:{timedOut:"Upload stalled for %{seconds} seconds, aborting."}};const{nanoid:_Y}=pI,{Provider:RY,RequestClient:kY,Socket:LY}=vY,{RateLimitedQueue:PY,internalRateLimitedQueue:Nx}=DY;function kI(e,t){let r=t;return r||(r=new Error("Upload error")),typeof r=="string"&&(r=new Error(r)),r instanceof Error||(r=Object.assign(new Error("Upload error"),{data:r})),RI(e)?(r=new Rx(r,e),r):(r.request=e,r)}function LI(e){return e.data.slice(0,e.data.size,e.meta.type)}var IY=(_I=OI=class extends _x{constructor(e,t){super(e,t),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.title="XHRUpload",this.defaultLocale=OY;const r={formData:!0,fieldName:t.bundle?"files[]":"file",method:"post",metaFields:null,responseUrlFieldName:"url",bundle:!1,headers:{},timeout:3e4,limit:5,withCredentials:!1,responseType:"",getResponseData(n){let i={};try{i=JSON.parse(n)}catch(o){e.log(o)}return i},getResponseError(n,i){let o=new Error("Upload error");return RI(i)&&(o=new Rx(o,i)),o},validateStatus:n=>n>=200&&n<300};if(this.opts=at(at({},r),t),this.i18nInit(),this.handleUpload=this.handleUpload.bind(this),Nx in this.opts?this.requests=this.opts[Nx]:this.requests=new PY(this.opts.limit),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");this.uploaderEvents=Object.create(null)}getOptions(e){const t=this.uppy.getState().xhrUpload,{headers:r}=this.opts,n=at(at(at(at({},this.opts),t||{}),e.xhrUpload||{}),{headers:{}});return typeof r=="function"?n.headers=r(e):Object.assign(n.headers,this.opts.headers),t&&Object.assign(n.headers,t.headers),e.xhrUpload&&Object.assign(n.headers,e.xhrUpload.headers),n}addMetadata(e,t,r){(Array.isArray(r.metaFields)?r.metaFields:Object.keys(t)).forEach(n=>{e.append(n,t[n])})}createFormDataUpload(e,t){const r=new FormData;this.addMetadata(r,e.meta,t);const n=LI(e);return e.name?r.append(t.fieldName,n,e.meta.name):r.append(t.fieldName,n),r}createBundledUpload(e,t){const r=new FormData,{meta:n}=this.uppy.getState();return this.addMetadata(r,n,t),e.forEach(i=>{const o=this.getOptions(i),a=LI(i);i.name?r.append(o.fieldName,a,i.name):r.append(o.fieldName,a)}),r}upload(e,t,r){const n=this.getOptions(e);return this.uppy.log(`uploading ${t} of ${r}`),new Promise((i,o)=>{this.uppy.emit("upload-started",e);const a=n.formData?this.createFormDataUpload(e,n):e.data,s=new XMLHttpRequest;this.uploaderEvents[e.id]=new AI(this.uppy);const l=new DI(n.timeout,()=>{s.abort(),c.done();const h=new Error(this.i18n("timedOut",{seconds:Math.ceil(n.timeout/1e3)}));this.uppy.emit("upload-error",e,h),o(h)}),u=_Y();s.upload.addEventListener("loadstart",()=>{this.uppy.log(`[XHRUpload] ${u} started`)}),s.upload.addEventListener("progress",h=>{this.uppy.log(`[XHRUpload] ${u} progress: ${h.loaded} / ${h.total}`),l.progress(),h.lengthComputable&&this.uppy.emit("upload-progress",e,{uploader:this,bytesUploaded:h.loaded,bytesTotal:h.total})}),s.addEventListener("load",h=>{if(this.uppy.log(`[XHRUpload] ${u} finished`),l.done(),c.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),n.validateStatus(h.target.status,s.responseText,s)){const B=n.getResponseData(s.responseText,s),N=B[n.responseUrlFieldName],U={status:h.target.status,body:B,uploadURL:N};return this.uppy.emit("upload-success",e,U),N&&this.uppy.log(`Download ${e.name} from ${N}`),i(e)}const S=n.getResponseData(s.responseText,s),y=kI(s,n.getResponseError(s.responseText,s)),W={status:h.target.status,body:S};return this.uppy.emit("upload-error",e,y,W),o(y)}),s.addEventListener("error",()=>{this.uppy.log(`[XHRUpload] ${u} errored`),l.done(),c.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null);const h=kI(s,n.getResponseError(s.responseText,s));return this.uppy.emit("upload-error",e,h),o(h)}),s.open(n.method.toUpperCase(),n.endpoint,!0),s.withCredentials=n.withCredentials,n.responseType!==""&&(s.responseType=n.responseType);const c=this.requests.run(()=>{this.uppy.emit("upload-started",e);const h=this.getOptions(e);return Object.keys(h.headers).forEach(S=>{s.setRequestHeader(S,h.headers[S])}),s.send(a),()=>{l.done(),s.abort()}});this.onFileRemove(e.id,()=>{c.abort(),o(new Error("File removed"))}),this.onCancelAll(e.id,()=>{c.abort(),o(new Error("Upload cancelled"))})})}uploadRemote(e){const t=this.getOptions(e);return new Promise((r,n)=>{this.uppy.emit("upload-started",e);const i={};(Array.isArray(t.metaFields)?t.metaFields:Object.keys(e.meta)).forEach(o=>{i[o]=e.meta[o]}),new(e.remote.providerOptions.provider?RY:kY)(this.uppy,e.remote.providerOptions).post(e.remote.url,at(at({},e.remote.body),{endpoint:t.endpoint,size:e.data.size,fieldname:t.fieldName,metadata:i,httpMethod:t.method,useFormData:t.formData,headers:t.headers})).then(o=>{const{token:a}=o,s=function(c){const h=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(c)[1];return`${/^http:\/\//i.test(c)?"ws":"wss"}://${h}`}(e.remote.companionUrl),l=new LY({target:`${s}/api/${a}`,autoOpen:!1});this.uploaderEvents[e.id]=new AI(this.uppy),this.onFileRemove(e.id,()=>{l.send("cancel",{}),u.abort(),r(`upload ${e.id} was removed`)}),this.onCancelAll(e.id,()=>{l.send("cancel",{}),u.abort(),r(`upload ${e.id} was canceled`)}),this.onRetry(e.id,()=>{l.send("pause",{}),l.send("resume",{})}),this.onRetryAll(e.id,()=>{l.send("pause",{}),l.send("resume",{})}),l.on("progress",c=>mY(this,c,e)),l.on("success",c=>{const h=t.getResponseData(c.response.responseText,c.response),S=h[t.responseUrlFieldName],y={status:c.response.status,body:h,uploadURL:S};return this.uppy.emit("upload-success",e,y),u.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),r()}),l.on("error",c=>{const h=c.response,S=h?t.getResponseError(h.responseText,h):Object.assign(new Error(c.error.message),{cause:c.error});this.uppy.emit("upload-error",e,S),u.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),n(S)});const u=this.requests.run(()=>(l.open(),e.isPaused&&l.send("pause",{}),()=>l.close()))}).catch(o=>{this.uppy.emit("upload-error",e,o),n(o)})})}uploadBundle(e){return new Promise((t,r)=>{const{endpoint:n}=this.opts,{method:i}=this.opts,o=this.uppy.getState().xhrUpload,a=this.createBundledUpload(e,at(at({},this.opts),o||{})),s=new XMLHttpRequest,l=new DI(this.opts.timeout,()=>{s.abort();const c=new Error(this.i18n("timedOut",{seconds:Math.ceil(this.opts.timeout/1e3)}));u(c),r(c)}),u=c=>{e.forEach(h=>{this.uppy.emit("upload-error",h,c)})};s.upload.addEventListener("loadstart",()=>{this.uppy.log("[XHRUpload] started uploading bundle"),l.progress()}),s.upload.addEventListener("progress",c=>{l.progress(),c.lengthComputable&&e.forEach(h=>{this.uppy.emit("upload-progress",h,{uploader:this,bytesUploaded:c.loaded/c.total*h.size,bytesTotal:h.size})})}),s.addEventListener("load",c=>{if(l.done(),this.opts.validateStatus(c.target.status,s.responseText,s)){const S=this.opts.getResponseData(s.responseText,s),y={status:c.target.status,body:S};return e.forEach(W=>{this.uppy.emit("upload-success",W,y)}),t()}const h=this.opts.getResponseError(s.responseText,s)||new Error("Upload error");return h.request=s,u(h),r(h)}),s.addEventListener("error",()=>{l.done();const c=this.opts.getResponseError(s.responseText,s)||new Error("Upload error");return u(c),r(c)}),this.uppy.on("cancel-all",()=>{l.done(),s.abort()}),s.open(i.toUpperCase(),n,!0),s.withCredentials=this.opts.withCredentials,this.opts.responseType!==""&&(s.responseType=this.opts.responseType),Object.keys(this.opts.headers).forEach(c=>{s.setRequestHeader(c,this.opts.headers[c])}),s.send(a),e.forEach(c=>{this.uppy.emit("upload-started",c)})})}uploadFiles(e){const t=e.map((r,n)=>{const i=parseInt(n,10)+1,o=e.length;return r.error?Promise.reject(new Error(r.error)):r.isRemote?this.uploadRemote(r,i,o):this.upload(r,i,o)});return function(r){const n=[],i=[];function o(s){n.push(s)}function a(s){i.push(s)}return Promise.all(r.map(s=>s.then(o,a))).then(()=>({successful:n,failed:i}))}(t)}onFileRemove(e,t){this.uploaderEvents[e].on("file-removed",r=>{e===r.id&&t(r.id)})}onRetry(e,t){this.uploaderEvents[e].on("upload-retry",r=>{e===r&&t()})}onRetryAll(e,t){this.uploaderEvents[e].on("retry-all",()=>{this.uppy.getFile(e)&&t()})}onCancelAll(e,t){this.uploaderEvents[e].on("cancel-all",()=>{this.uppy.getFile(e)&&t()})}handleUpload(e){if(e.length===0)return this.uppy.log("[XHRUpload] No files to upload!"),Promise.resolve();this.opts.limit!==0||this.opts[Nx]||this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");const t=e.map(r=>this.uppy.getFile(r));if(this.opts.bundle){if(t.some(r=>r.isRemote))throw new Error("Can\u2019t upload remote files when the `bundle: true` option is set");if(typeof this.opts.headers=="function")throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");return this.uploadBundle(t)}return this.uploadFiles(t).then(()=>null)}install(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:at(at({},e),{individualCancellation:!1})})}this.uppy.addUploader(this.handleUpload)}uninstall(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:at(at({},e),{individualCancellation:!0})})}this.uppy.removeUploader(this.handleUpload)}},OI.VERSION="2.0.6",_I),PI=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof ze!="undefined"?ze:typeof self!="undefined"?self:{};function $h(e){var t={exports:{}};return e(t,t.exports),t.exports}var gs,nm,im=function(e){return e&&e.Math==Math&&e},yt=im(typeof globalThis=="object"&&globalThis)||im(typeof window=="object"&&window)||im(typeof self=="object"&&self)||im(typeof PI=="object"&&PI)||function(){return this}()||Function("return this")(),MY=Object.defineProperty,jx=function(e,t){try{MY(yt,e,{value:t,configurable:!0,writable:!0})}catch(r){yt[e]=t}return t},vs=yt["__core-js_shared__"]||jx("__core-js_shared__",{}),Ux=$h(function(e){(e.exports=function(t,r){return vs[t]||(vs[t]=r!==void 0?r:{})})("versions",[]).push({version:"3.19.3",mode:"global",copyright:"\xA9 2021 Denis Pushkarev (zloirock.ru)"})}),II=Function.prototype,Hx=II.bind,zx=II.call,BY=Hx&&Hx.bind(zx),Wt=Hx?function(e){return e&&BY(zx,e)}:function(e){return e&&function(){return zx.apply(e,arguments)}},FY=yt.TypeError,so=function(e){if(e==null)throw FY("Can't call method on "+e);return e},NY=yt.Object,ms=function(e){return NY(so(e))},jY=Wt({}.hasOwnProperty),xn=Object.hasOwn||function(e,t){return jY(ms(e),t)},UY=0,HY=Math.random(),zY=Wt(1 .toString),Wx=function(e){return"Symbol("+(e===void 0?"":e)+")_"+zY(++UY+HY,36)},jr=function(e){return typeof e=="function"},WY=function(e){return jr(e)?e:void 0},Xl=function(e,t){return arguments.length<2?WY(yt[e]):yt[e]&&yt[e][t]},Dc=Xl("navigator","userAgent")||"",MI=yt.process,BI=yt.Deno,FI=MI&&MI.versions||BI&&BI.version,NI=FI&&FI.v8;NI&&(nm=(gs=NI.split("."))[0]>0&&gs[0]<4?1:+(gs[0]+gs[1])),!nm&&Dc&&(!(gs=Dc.match(/Edge\/(\d+)/))||gs[1]>=74)&&(gs=Dc.match(/Chrome\/(\d+)/))&&(nm=+gs[1]);var Xh=nm,Ir=function(e){try{return!!e()}catch(t){return!0}},Gx=!!Object.getOwnPropertySymbols&&!Ir(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Xh&&Xh<41}),Vx=Gx&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Yh=Ux("wks"),Yl=yt.Symbol,jI=Yl&&Yl.for,GY=Vx?Yl:Yl&&Yl.withoutSetter||Wx,an=function(e){if(!xn(Yh,e)||!Gx&&typeof Yh[e]!="string"){var t="Symbol."+e;Gx&&xn(Yl,e)?Yh[e]=Yl[e]:Yh[e]=Vx&&jI?jI(t):GY(t)}return Yh[e]},UI={};UI[an("toStringTag")]="z";var Kx=String(UI)==="[object z]",Zn=!Ir(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Yr=function(e){return typeof e=="object"?e!==null:jr(e)},$x=yt.document,VY=Yr($x)&&Yr($x.createElement),Zh=function(e){return VY?$x.createElement(e):{}},HI=!Zn&&!Ir(function(){return Object.defineProperty(Zh("div"),"a",{get:function(){return 7}}).a!=7}),KY=yt.String,$Y=yt.TypeError,Sn=function(e){if(Yr(e))return e;throw $Y(KY(e)+" is not an object")},Jh=Function.prototype.call,Cr=Jh.bind?Jh.bind(Jh):function(){return Jh.apply(Jh,arguments)},Zl=Wt({}.isPrototypeOf),XY=yt.Object,Xx=Vx?function(e){return typeof e=="symbol"}:function(e){var t=Xl("Symbol");return jr(t)&&Zl(t.prototype,XY(e))},YY=yt.String,om=function(e){try{return YY(e)}catch(t){return"Object"}},ZY=yt.TypeError,ys=function(e){if(jr(e))return e;throw ZY(om(e)+" is not a function")},Jl=function(e,t){var r=e[t];return r==null?void 0:ys(r)},JY=yt.TypeError,QY=yt.TypeError,qY=an("toPrimitive"),Yx=function(e){var t=function(r,n){if(!Yr(r)||Xx(r))return r;var i,o=Jl(r,qY);if(o){if(n===void 0&&(n="default"),i=Cr(o,r,n),!Yr(i)||Xx(i))return i;throw QY("Can't convert object to primitive value")}return n===void 0&&(n="number"),function(a,s){var l,u;if(s==="string"&&jr(l=a.toString)&&!Yr(u=Cr(l,a)))return u;if(jr(l=a.valueOf)&&!Yr(u=Cr(l,a)))return u;if(s!=="string"&&jr(l=a.toString)&&!Yr(u=Cr(l,a)))return u;throw JY("Can't convert object to primitive value")}(r,n)}(e,"string");return Xx(t)?t:t+""},eZ=yt.TypeError,zI=Object.defineProperty,Ro={f:Zn?zI:function(e,t,r){if(Sn(e),t=Yx(t),Sn(r),HI)try{return zI(e,t,r)}catch(n){}if("get"in r||"set"in r)throw eZ("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},am=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},ko=Zn?function(e,t,r){return Ro.f(e,t,am(1,r))}:function(e,t,r){return e[t]=r,e},tZ=Wt(Function.toString);jr(vs.inspectSource)||(vs.inspectSource=function(e){return tZ(e)});var sm,Qh,lm,um=vs.inspectSource,WI=yt.WeakMap,GI=jr(WI)&&/native code/.test(um(WI)),VI=Ux("keys"),Zx=function(e){return VI[e]||(VI[e]=Wx(e))},cm={},Jx=yt.TypeError,rZ=yt.WeakMap;if(GI||vs.state){var Ql=vs.state||(vs.state=new rZ),nZ=Wt(Ql.get),KI=Wt(Ql.has),iZ=Wt(Ql.set);sm=function(e,t){if(KI(Ql,e))throw new Jx("Object already initialized");return t.facade=e,iZ(Ql,e,t),t},Qh=function(e){return nZ(Ql,e)||{}},lm=function(e){return KI(Ql,e)}}else{var Oc=Zx("state");cm[Oc]=!0,sm=function(e,t){if(xn(e,Oc))throw new Jx("Object already initialized");return t.facade=e,ko(e,Oc,t),t},Qh=function(e){return xn(e,Oc)?e[Oc]:{}},lm=function(e){return xn(e,Oc)}}var hi={set:sm,get:Qh,has:lm,enforce:function(e){return lm(e)?Qh(e):sm(e,{})},getterFor:function(e){return function(t){var r;if(!Yr(t)||(r=Qh(t)).type!==e)throw Jx("Incompatible receiver, "+e+" required");return r}}},$I=Function.prototype,oZ=Zn&&Object.getOwnPropertyDescriptor,Qx=xn($I,"name"),_c={EXISTS:Qx,PROPER:Qx&&function(){}.name==="something",CONFIGURABLE:Qx&&(!Zn||Zn&&oZ($I,"name").configurable)},_i=$h(function(e){var t=_c.CONFIGURABLE,r=hi.get,n=hi.enforce,i=String(String).split("String");(e.exports=function(o,a,s,l){var u,c=!!l&&!!l.unsafe,h=!!l&&!!l.enumerable,S=!!l&&!!l.noTargetGet,y=l&&l.name!==void 0?l.name:a;jr(s)&&(String(y).slice(0,7)==="Symbol("&&(y="["+String(y).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!xn(s,"name")||t&&s.name!==y)&&ko(s,"name",y),(u=n(s)).source||(u.source=i.join(typeof y=="string"?y:""))),o!==yt?(c?!S&&o[a]&&(h=!0):delete o[a],h?o[a]=s:ko(o,a,s)):h?o[a]=s:jx(a,s)})(Function.prototype,"toString",function(){return jr(this)&&r(this).source||um(this)})}),aZ=Wt({}.toString),sZ=Wt("".slice),Lo=function(e){return sZ(aZ(e),8,-1)},lZ=an("toStringTag"),uZ=yt.Object,cZ=Lo(function(){return arguments}())=="Arguments",dm=Kx?Lo:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=function(i,o){try{return i[o]}catch(a){}}(t=uZ(e),lZ))=="string"?r:cZ?Lo(t):(n=Lo(t))=="Object"&&jr(t.callee)?"Arguments":n},dZ=Kx?{}.toString:function(){return"[object "+dm(this)+"]"};Kx||_i(Object.prototype,"toString",dZ,{unsafe:!0});var hm={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},qx=Zh("span").classList,XI=qx&&qx.constructor&&qx.constructor.prototype,YI=XI===Object.prototype?void 0:XI,ZI=Wt(Wt.bind),ql=function(e,t){return ys(e),t===void 0?e:ZI?ZI(e,t):function(){return e.apply(t,arguments)}},eS=yt.Object,hZ=Wt("".split),fm=Ir(function(){return!eS("z").propertyIsEnumerable(0)})?function(e){return Lo(e)=="String"?hZ(e,""):eS(e)}:eS,fZ=Math.ceil,pZ=Math.floor,qh=function(e){var t=+e;return t!=t||t===0?0:(t>0?pZ:fZ)(t)},gZ=Math.min,Rc=function(e){return e>0?gZ(qh(e),9007199254740991):0},eu=function(e){return Rc(e.length)},pm=Array.isArray||function(e){return Lo(e)=="Array"},JI=function(){},vZ=[],QI=Xl("Reflect","construct"),tS=/^\s*(?:class|function)\b/,mZ=Wt(tS.exec),yZ=!tS.exec(JI),ef=function(e){if(!jr(e))return!1;try{return QI(JI,vZ,e),!0}catch(t){return!1}},gm=!QI||Ir(function(){var e;return ef(ef.call)||!ef(Object)||!ef(function(){e=!0})||e})?function(e){if(!jr(e))return!1;switch(dm(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return yZ||!!mZ(tS,um(e))}:ef,bZ=an("species"),qI=yt.Array,eM=function(e,t){return new(function(r){var n;return pm(r)&&(n=r.constructor,(gm(n)&&(n===qI||pm(n.prototype))||Yr(n)&&(n=n[bZ])===null)&&(n=void 0)),n===void 0?qI:n}(e))(t===0?0:t)},tM=Wt([].push),bs=function(e){var t=e==1,r=e==2,n=e==3,i=e==4,o=e==6,a=e==7,s=e==5||o;return function(l,u,c,h){for(var S,y,W=ms(l),B=fm(W),N=ql(u,c),U=eu(B),D=0,Q=h||eM,te=t?Q(l,U):r||a?Q(l,0):void 0;U>D;D++)if((s||D in B)&&(y=N(S=B[D],D,W),e))if(t)te[D]=y;else if(y)switch(e){case 3:return!0;case 5:return S;case 6:return D;case 2:tM(te,S)}else switch(e){case 4:return!1;case 7:tM(te,S)}return o?-1:n||i?i:te}},kc={forEach:bs(0),map:bs(1),filter:bs(2),some:bs(3),every:bs(4),find:bs(5),findIndex:bs(6),filterReject:bs(7)},rM=function(e,t){var r=[][e];return!!r&&Ir(function(){r.call(null,t||function(){throw 1},1)})},EZ=kc.forEach,rS=rM("forEach")?[].forEach:function(e){return EZ(this,e,arguments.length>1?arguments[1]:void 0)},nM=function(e){if(e&&e.forEach!==rS)try{ko(e,"forEach",rS)}catch(t){e.forEach=rS}};for(var nS in hm)hm[nS]&&nM(yt[nS]&&yt[nS].prototype);nM(YI);var iM={}.propertyIsEnumerable,oM=Object.getOwnPropertyDescriptor,xZ=oM&&!iM.call({1:2},1)?function(e){var t=oM(this,e);return!!t&&t.enumerable}:iM,aM={f:xZ},Es=function(e){return fm(so(e))},sM=Object.getOwnPropertyDescriptor,tf={f:Zn?sM:function(e,t){if(e=Es(e),t=Yx(t),HI)try{return sM(e,t)}catch(r){}if(xn(e,t))return am(!Cr(aM.f,e,t),e[t])}},SZ=Math.max,wZ=Math.min,Lc=function(e,t){var r=qh(e);return r<0?SZ(r+t,0):wZ(r,t)},lM=function(e){return function(t,r,n){var i,o=Es(t),a=eu(o),s=Lc(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},uM={includes:lM(!0),indexOf:lM(!1)},CZ=uM.indexOf,cM=Wt([].push),dM=function(e,t){var r,n=Es(e),i=0,o=[];for(r in n)!xn(cm,r)&&xn(n,r)&&cM(o,r);for(;t.length>i;)xn(n,r=t[i++])&&(~CZ(o,r)||cM(o,r));return o},vm=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],TZ=vm.concat("length","prototype"),rf={f:Object.getOwnPropertyNames||function(e){return dM(e,TZ)}},hM={f:Object.getOwnPropertySymbols},AZ=Wt([].concat),DZ=Xl("Reflect","ownKeys")||function(e){var t=rf.f(Sn(e)),r=hM.f;return r?AZ(t,r(e)):t},OZ=function(e,t){for(var r=DZ(t),n=Ro.f,i=tf.f,o=0;o<r.length;o++){var a=r[o];xn(e,a)||n(e,a,i(t,a))}},_Z=/#|\.prototype\./,nf=function(e,t){var r=kZ[RZ(e)];return r==PZ||r!=LZ&&(jr(t)?Ir(t):!!t)},RZ=nf.normalize=function(e){return String(e).replace(_Z,".").toLowerCase()},kZ=nf.data={},LZ=nf.NATIVE="N",PZ=nf.POLYFILL="P",of=nf,IZ=tf.f,sn=function(e,t){var r,n,i,o,a,s=e.target,l=e.global,u=e.stat;if(r=l?yt:u?yt[s]||jx(s,{}):(yt[s]||{}).prototype)for(n in t){if(o=t[n],i=e.noTargetGet?(a=IZ(r,n))&&a.value:r[n],!of(l?n:s+(u?".":"#")+n,e.forced)&&i!==void 0){if(typeof o==typeof i)continue;OZ(o,i)}(e.sham||i&&i.sham)&&ko(o,"sham",!0),_i(r,n,o,e)}},Pc=Object.keys||function(e){return dM(e,vm)},MZ=Ir(function(){Pc(1)});/*!
|
|
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
|
*
|
|
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
|
* Released under the MIT License.
|
|
|
*/function fM(e){return Object.prototype.toString.call(e)==="[object Object]"}sn({target:"Object",stat:!0,forced:MZ},{keys:function(e){return Pc(ms(e))}});var BZ={isHistory(e){return fM(t=e)!==!1&&((r=t.constructor)===void 0||fM(n=r.prototype)!==!1&&n.hasOwnProperty("isPrototypeOf")!==!1)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(e.redos.length===0||ss.isOperationList(e.redos[0]))&&(e.undos.length===0||ss.isOperationList(e.undos[0]));var t,r,n}},iS=new WeakMap,oS=new WeakMap,Ic={isHistoryEditor:e=>BZ.isHistory(e.history)&&de.isEditor(e),isMerging:e=>oS.get(e),isSaving:e=>iS.get(e),redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var r=Ic.isMerging(e);oS.set(e,!1),t(),oS.set(e,r)},withoutSaving(e,t){var r=Ic.isSaving(e);iS.set(e,!1),t(),iS.set(e,r)}},FZ=yt.String,$r=function(e){if(dm(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return FZ(e)},aS=function(){var e=Sn(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},NZ=_c.PROPER,sS=RegExp.prototype,pM=sS.toString,jZ=Wt(aS),UZ=Ir(function(){return pM.call({source:"a",flags:"b"})!="/a/b"}),HZ=NZ&&pM.name!="toString";(UZ||HZ)&&_i(RegExp.prototype,"toString",function(){var e=Sn(this),t=$r(e.source),r=e.flags;return"/"+t+"/"+$r(r===void 0&&Zl(sS,e)&&!("flags"in sS)?jZ(e):r)},{unsafe:!0});var mm,zZ=Zn?Object.defineProperties:function(e,t){Sn(e);for(var r,n=Es(t),i=Pc(t),o=i.length,a=0;o>a;)Ro.f(e,r=i[a++],n[r]);return e},lS=Xl("document","documentElement"),gM=Zx("IE_PROTO"),uS=function(){},vM=function(e){return"<script>"+e+"</script>"},mM=function(e){e.write(vM("")),e.close();var t=e.parentWindow.Object;return e=null,t},ym=function(){try{mm=new ActiveXObject("htmlfile")}catch(n){}var e,t;ym=typeof document!="undefined"?document.domain&&mm?mM(mm):((t=Zh("iframe")).style.display="none",lS.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(vM("document.F=Object")),e.close(),e.F):mM(mm);for(var r=vm.length;r--;)delete ym.prototype[vm[r]];return ym()};cm[gM]=!0;var bm=Object.create||function(e,t){var r;return e!==null?(uS.prototype=Sn(e),r=new uS,uS.prototype=null,r[gM]=e):r=ym(),t===void 0?r:zZ(r,t)},cS=an("unscopables"),dS=Array.prototype;dS[cS]==null&&Ro.f(dS,cS,{configurable:!0,value:bm(null)});var af=function(e){dS[cS][e]=!0},WZ=uM.includes;sn({target:"Array",proto:!0},{includes:function(e){return WZ(this,e,arguments.length>1?arguments[1]:void 0)}}),af("includes");var GZ=an("match"),hS=function(e){var t;return Yr(e)&&((t=e[GZ])!==void 0?!!t:Lo(e)=="RegExp")},VZ=yt.TypeError,fS=function(e){if(hS(e))throw VZ("The method doesn't accept regular expressions");return e},KZ=an("match"),pS=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[KZ]=!1,"/./"[e](t)}catch(n){}}return!1},$Z=Wt("".indexOf);sn({target:"String",proto:!0,forced:!pS("includes")},{includes:function(e){return!!~$Z($r(so(this)),$r(fS(e)),arguments.length>1?arguments[1]:void 0)}});var XZ=/"/g,YZ=Wt("".replace);sn({target:"String",proto:!0,forced:Ir(function(){var e="".anchor('"');return e!==e.toLowerCase()||e.split('"').length>3})},{anchor:function(e){return t=e,r=$r(so(this)),n="<a",(n+=' name="'+YZ($r(t),XZ,""")+'"')+">"+r+"</a>";var t,r,n}});var gS=function(e,t,r){var n,i;Sn(e);try{if(!(n=Jl(e,"return"))){if(t==="throw")throw r;return r}n=Cr(n,e)}catch(o){i=!0,n=o}if(t==="throw")throw r;if(i)throw n;return Sn(n),r},ZZ=function(e,t,r,n){try{return n?t(Sn(r)[0],r[1]):t(r)}catch(i){gS(e,"throw",i)}},Mc={},JZ=an("iterator"),QZ=Array.prototype,yM=function(e){return e!==void 0&&(Mc.Array===e||QZ[JZ]===e)},sf=function(e,t,r){var n=Yx(t);n in e?Ro.f(e,n,am(0,r)):e[n]=r},qZ=an("iterator"),vS=function(e){if(e!=null)return Jl(e,qZ)||Jl(e,"@@iterator")||Mc[dm(e)]},eJ=yt.TypeError,bM=function(e,t){var r=arguments.length<2?vS(e):t;if(ys(r))return Sn(Cr(r,e));throw eJ(om(e)+" is not iterable")},EM=yt.Array,xM=an("iterator"),SM=!1;try{var tJ=0,wM={next:function(){return{done:!!tJ++}},return:function(){SM=!0}};wM[xM]=function(){return this},Array.from(wM,function(){throw 2})}catch(e){}var mS=function(e,t){if(!t&&!SM)return!1;var r=!1;try{var n={};n[xM]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(i){}return r},rJ=!mS(function(e){Array.from(e)});sn({target:"Array",stat:!0,forced:rJ},{from:function(e){var t=ms(e),r=gm(this),n=arguments.length,i=n>1?arguments[1]:void 0,o=i!==void 0;o&&(i=ql(i,n>2?arguments[2]:void 0));var a,s,l,u,c,h,S=vS(t),y=0;if(!S||this==EM&&yM(S))for(a=eu(t),s=r?new this(a):EM(a);a>y;y++)h=o?i(t[y],y):t[y],sf(s,y,h);else for(c=(u=bM(t,S)).next,s=r?new this:[];!(l=Cr(c,u)).done;y++)h=o?ZZ(u,i,[l.value,y],!0):l.value,sf(s,y,h);return s.length=y,s}});var tu,CM,TM,nJ=Wt("".charAt),AM=Wt("".charCodeAt),iJ=Wt("".slice),DM=function(e){return function(t,r){var n,i,o=$r(so(t)),a=qh(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=AM(o,a))<55296||n>56319||a+1===s||(i=AM(o,a+1))<56320||i>57343?e?nJ(o,a):n:e?iJ(o,a,a+2):i-56320+(n-55296<<10)+65536}},OM={codeAt:DM(!1),charAt:DM(!0)},oJ=!Ir(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),_M=Zx("IE_PROTO"),yS=yt.Object,aJ=yS.prototype,Em=oJ?yS.getPrototypeOf:function(e){var t=ms(e);if(xn(t,_M))return t[_M];var r=t.constructor;return jr(r)&&t instanceof r?r.prototype:t instanceof yS?aJ:null},bS=an("iterator"),RM=!1;[].keys&&("next"in(TM=[].keys())?(CM=Em(Em(TM)))!==Object.prototype&&(tu=CM):RM=!0);var sJ=tu==null||Ir(function(){var e={};return tu[bS].call(e)!==e});sJ&&(tu={}),jr(tu[bS])||_i(tu,bS,function(){return this});var ES={IteratorPrototype:tu,BUGGY_SAFARI_ITERATORS:RM},lJ=Ro.f,kM=an("toStringTag"),xm=function(e,t,r){e&&!xn(e=r?e:e.prototype,kM)&&lJ(e,kM,{configurable:!0,value:t})},uJ=ES.IteratorPrototype,cJ=function(){return this},dJ=yt.String,hJ=yt.TypeError,Bc=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Wt(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(n){}return function(n,i){return Sn(n),function(o){if(typeof o=="object"||jr(o))return o;throw hJ("Can't set "+dJ(o)+" as a prototype")}(i),t?e(n,i):n.__proto__=i,n}}():void 0),fJ=_c.PROPER,pJ=_c.CONFIGURABLE,LM=ES.IteratorPrototype,Sm=ES.BUGGY_SAFARI_ITERATORS,lf=an("iterator"),gJ=function(){return this},xS=function(e,t,r,n,i,o,a){!function(U,D,Q,te){var he=D+" Iterator";U.prototype=bm(uJ,{next:am(1,Q)}),xm(U,he,!1),Mc[he]=cJ}(r,t,n);var s,l,u,c=function(U){if(U===i&&B)return B;if(!Sm&&U in y)return y[U];switch(U){case"keys":case"values":case"entries":return function(){return new r(this,U)}}return function(){return new r(this)}},h=t+" Iterator",S=!1,y=e.prototype,W=y[lf]||y["@@iterator"]||i&&y[i],B=!Sm&&W||c(i),N=t=="Array"&&y.entries||W;if(N&&(s=Em(N.call(new e)))!==Object.prototype&&s.next&&(Em(s)!==LM&&(Bc?Bc(s,LM):jr(s[lf])||_i(s,lf,gJ)),xm(s,h,!0)),fJ&&i=="values"&&W&&W.name!=="values"&&(pJ?ko(y,"name","values"):(S=!0,B=function(){return Cr(W,this)})),i)if(l={values:c("values"),keys:o?B:c("keys"),entries:c("entries")},a)for(u in l)(Sm||S||!(u in y))&&_i(y,u,l[u]);else sn({target:t,proto:!0,forced:Sm||S},l);return y[lf]!==B&&_i(y,lf,B,{name:i}),Mc[t]=B,l},vJ=OM.charAt,mJ=hi.set,yJ=hi.getterFor("String Iterator");xS(String,"String",function(e){mJ(this,{type:"String Iterator",string:$r(e),index:0})},function(){var e,t=yJ(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=vJ(r,n),t.index+=e.length,{value:e,done:!1})});var SS,bJ=tf.f,PM=Wt("".endsWith),EJ=Wt("".slice),xJ=Math.min,IM=pS("endsWith"),SJ=!(IM||(SS=bJ(String.prototype,"endsWith"),!SS||SS.writable));sn({target:"String",proto:!0,forced:!SJ&&!IM},{endsWith:function(e){var t=$r(so(this));fS(e);var r=arguments.length>1?arguments[1]:void 0,n=t.length,i=r===void 0?n:xJ(Rc(r),n),o=$r(e);return PM?PM(t,o,i):EJ(t,i-o.length,i)===o}});var wJ=Wt([].join),CJ=fm!=Object,TJ=rM("join",",");sn({target:"Array",proto:!0,forced:CJ||!TJ},{join:function(e){return wJ(Es(this),e===void 0?",":e)}});var AJ=an("species"),wm=function(e){return Xh>=51||!Ir(function(){var t=[];return(t.constructor={})[AJ]=function(){return{foo:1}},t[e](Boolean).foo!==1})},DJ=kc.map,OJ=wm("map");sn({target:"Array",proto:!0,forced:!OJ},{map:function(e){return DJ(this,e,arguments.length>1?arguments[1]:void 0)}});var wS=yt.RegExp,CS=Ir(function(){var e=wS("a","y");return e.lastIndex=2,e.exec("abcd")!=null}),_J=CS||Ir(function(){return!wS("a","y").sticky}),Cm={BROKEN_CARET:CS||Ir(function(){var e=wS("^r","gy");return e.lastIndex=2,e.exec("str")!=null}),MISSED_STICKY:_J,UNSUPPORTED_Y:CS},RJ=yt.RegExp,TS=Ir(function(){var e=RJ(".","s");return!(e.dotAll&&e.exec(`
|
|
|
`)&&e.flags==="s")}),kJ=yt.RegExp,AS=Ir(function(){var e=kJ("(?<a>b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$<a>c")!=="bc"}),LJ=hi.get,PJ=Ux("native-string-replace",String.prototype.replace),Tm=RegExp.prototype.exec,DS=Tm,IJ=Wt("".charAt),MJ=Wt("".indexOf),BJ=Wt("".replace),OS=Wt("".slice),_S=function(){var e=/a/,t=/b*/g;return Cr(Tm,e,"a"),Cr(Tm,t,"a"),e.lastIndex!==0||t.lastIndex!==0}(),MM=Cm.BROKEN_CARET,RS=/()??/.exec("")[1]!==void 0;(_S||RS||MM||TS||AS)&&(DS=function(e){var t,r,n,i,o,a,s,l=this,u=LJ(l),c=$r(e),h=u.raw;if(h)return h.lastIndex=l.lastIndex,t=Cr(DS,h,c),l.lastIndex=h.lastIndex,t;var S=u.groups,y=MM&&l.sticky,W=Cr(aS,l),B=l.source,N=0,U=c;if(y&&(W=BJ(W,"y",""),MJ(W,"g")===-1&&(W+="g"),U=OS(c,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&IJ(c,l.lastIndex-1)!==`
|
|
|
`)&&(B="(?: "+B+")",U=" "+U,N++),r=new RegExp("^(?:"+B+")",W)),RS&&(r=new RegExp("^"+B+"$(?!\\s)",W)),_S&&(n=l.lastIndex),i=Cr(Tm,y?r:l,U),y?i?(i.input=OS(i.input,N),i[0]=OS(i[0],N),i.index=l.lastIndex,l.lastIndex+=i[0].length):l.lastIndex=0:_S&&i&&(l.lastIndex=l.global?i.index+i[0].length:n),RS&&i&&i.length>1&&Cr(PJ,i[0],r,function(){for(o=1;o<arguments.length-2;o++)arguments[o]===void 0&&(i[o]=void 0)}),i&&S)for(i.groups=a=bm(null),o=0;o<S.length;o++)a[(s=S[o])[0]]=i[s[1]];return i});var uf=DS;sn({target:"RegExp",proto:!0,forced:/./.exec!==uf},{exec:uf});var kS=Function.prototype,BM=kS.apply,FJ=kS.bind,FM=kS.call,LS=typeof Reflect=="object"&&Reflect.apply||(FJ?FM.bind(BM):function(){return FM.apply(BM,arguments)}),NJ=an("species"),PS=RegExp.prototype,IS=function(e,t,r,n){var i=an(e),o=!Ir(function(){var u={};return u[i]=function(){return 7},""[e](u)!=7}),a=o&&!Ir(function(){var u=!1,c=/a/;return e==="split"&&((c={}).constructor={},c.constructor[NJ]=function(){return c},c.flags="",c[i]=/./[i]),c.exec=function(){return u=!0,null},c[i](""),!u});if(!o||!a||r){var s=Wt(/./[i]),l=t(i,""[e],function(u,c,h,S,y){var W=Wt(u),B=c.exec;return B===uf||B===PS.exec?o&&!y?{done:!0,value:s(c,h,S)}:{done:!0,value:W(h,c,S)}:{done:!1}});_i(String.prototype,e,l[0]),_i(PS,i,l[1])}n&&ko(PS[i],"sham",!0)},jJ=OM.charAt,MS=function(e,t,r){return t+(r?jJ(e,t).length:1)},UJ=Math.floor,BS=Wt("".charAt),HJ=Wt("".replace),FS=Wt("".slice),zJ=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,WJ=/\$([$&'`]|\d{1,2})/g,GJ=function(e,t,r,n,i,o){var a=r+e.length,s=n.length,l=WJ;return i!==void 0&&(i=ms(i),l=zJ),HJ(o,l,function(u,c){var h;switch(BS(c,0)){case"$":return"$";case"&":return e;case"`":return FS(t,0,r);case"'":return FS(t,a);case"<":h=i[FS(c,1,-1)];break;default:var S=+c;if(S===0)return u;if(S>s){var y=UJ(S/10);return y===0?u:y<=s?n[y-1]===void 0?BS(c,1):n[y-1]+BS(c,1):u}h=n[S-1]}return h===void 0?"":h})},VJ=yt.TypeError,cf=function(e,t){var r=e.exec;if(jr(r)){var n=Cr(r,e,t);return n!==null&&Sn(n),n}if(Lo(e)==="RegExp")return Cr(uf,e,t);throw VJ("RegExp#exec called on incompatible receiver")},NS=an("replace"),KJ=Math.max,$J=Math.min,XJ=Wt([].concat),jS=Wt([].push),NM=Wt("".indexOf),jM=Wt("".slice),YJ="a".replace(/./,"$0")==="$0",UM=!!/./[NS]&&/./[NS]("a","$0")==="";IS("replace",function(e,t,r){var n=UM?"$":"$0";return[function(i,o){var a=so(this),s=i==null?void 0:Jl(i,NS);return s?Cr(s,i,a,o):Cr(t,$r(a),i,o)},function(i,o){var a=Sn(this),s=$r(i);if(typeof o=="string"&&NM(o,n)===-1&&NM(o,"$<")===-1){var l=r(t,a,s,o);if(l.done)return l.value}var u=jr(o);u||(o=$r(o));var c=a.global;if(c){var h=a.unicode;a.lastIndex=0}for(var S=[];;){var y=cf(a,s);if(y===null)break;if(jS(S,y),!c)break;$r(y[0])===""&&(a.lastIndex=MS(s,Rc(a.lastIndex),h))}for(var W,B="",N=0,U=0;U<S.length;U++){for(var D=$r((y=S[U])[0]),Q=KJ($J(qh(y.index),s.length),0),te=[],he=1;he<y.length;he++)jS(te,(W=y[he])===void 0?W:String(W));var Ee=y.groups;if(u){var ve=XJ([D],te,Q,s);Ee!==void 0&&jS(ve,Ee);var De=$r(LS(o,void 0,ve))}else De=GJ(D,s,Q,te,Ee,o);Q>=N&&(B+=jM(s,N,Q)+De,N=Q+D.length)}return B+jM(s,N)}]},!!Ir(function(){var e=/./;return e.exec=function(){var t=[];return t.groups={a:"7"},t},"".replace(e,"$<a>")!=="7"})||!YJ||UM);/*! *****************************************************************************
|
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
purpose with or without fee is hereby granted.
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
|
***************************************************************************** */var US=function(e,t){return US=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},US(e,t)};function Fc(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}US(e,t),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var lo=function(){return lo=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},lo.apply(this,arguments)};function uo(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Tr(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function HS(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e}var ZJ=0,HM=function(){this.id=""+ZJ++},JJ=hi.set,QJ=hi.getterFor("Array Iterator"),df=xS(Array,"Array",function(e,t){JJ(this,{type:"Array Iterator",target:Es(e),index:0,kind:t})},function(){var e=QJ(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):r=="keys"?{value:n,done:!1}:r=="values"?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values");Mc.Arguments=Mc.Array,af("keys"),af("values"),af("entries");var Nc=function(e,t,r){for(var n in t)_i(e,n,t[n],r);return e},qJ=yt.Array,eQ=Math.max,zS=function(e,t,r){for(var n=eu(e),i=Lc(t,n),o=Lc(r===void 0?n:r,n),a=qJ(eQ(o-i,0)),s=0;i<o;i++,s++)sf(a,s,e[i]);return a.length=s,a},zM=rf.f,WM=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],tQ={f:function(e){return WM&&Lo(e)=="Window"?function(t){try{return zM(t)}catch(r){return zS(WM)}}(e):zM(Es(e))}},GM=Ir(function(){if(typeof ArrayBuffer=="function"){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}),Am=Object.isExtensible,ru=Ir(function(){Am(1)})||GM?function(e){return!!Yr(e)&&(!GM||Lo(e)!="ArrayBuffer")&&(!Am||Am(e))}:Am,rQ=!Ir(function(){return Object.isExtensible(Object.preventExtensions({}))}),Dm=$h(function(e){var t=Ro.f,r=!1,n=Wx("meta"),i=0,o=function(s){t(s,n,{value:{objectID:"O"+i++,weakData:{}}})},a=e.exports={enable:function(){a.enable=function(){},r=!0;var s=rf.f,l=Wt([].splice),u={};u[n]=1,s(u).length&&(rf.f=function(c){for(var h=s(c),S=0,y=h.length;S<y;S++)if(h[S]===n){l(h,S,1);break}return h},sn({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:tQ.f}))},fastKey:function(s,l){if(!Yr(s))return typeof s=="symbol"?s:(typeof s=="string"?"S":"P")+s;if(!xn(s,n)){if(!ru(s))return"F";if(!l)return"E";o(s)}return s[n].objectID},getWeakData:function(s,l){if(!xn(s,n)){if(!ru(s))return!0;if(!l)return!1;o(s)}return s[n].weakData},onFreeze:function(s){return rQ&&r&&ru(s)&&!xn(s,n)&&o(s),s}};cm[n]=!0}),nQ=yt.TypeError,Om=function(e,t){this.stopped=e,this.result=t},VM=Om.prototype,hf=function(e,t,r){var n,i,o,a,s,l,u,c=r&&r.that,h=!(!r||!r.AS_ENTRIES),S=!(!r||!r.IS_ITERATOR),y=!(!r||!r.INTERRUPTED),W=ql(t,c),B=function(U){return n&&gS(n,"normal",U),new Om(!0,U)},N=function(U){return h?(Sn(U),y?W(U[0],U[1],B):W(U[0],U[1])):y?W(U,B):W(U)};if(S)n=e;else{if(!(i=vS(e)))throw nQ(om(e)+" is not iterable");if(yM(i)){for(o=0,a=eu(e);a>o;o++)if((s=N(e[o]))&&Zl(VM,s))return s;return new Om(!1)}n=bM(e,i)}for(l=n.next;!(u=Cr(l,n)).done;){try{s=N(u.value)}catch(U){gS(n,"throw",U)}if(typeof s=="object"&&s&&Zl(VM,s))return s}return new Om(!1)},iQ=yt.TypeError,_m=function(e,t){if(Zl(t,e))return e;throw iQ("Incorrect invocation")},KM=function(e,t,r){var n,i;return Bc&&jr(n=t.constructor)&&n!==r&&Yr(i=n.prototype)&&i!==r.prototype&&Bc(e,i),e},$M=function(e,t,r){var n=e.indexOf("Map")!==-1,i=e.indexOf("Weak")!==-1,o=n?"set":"add",a=yt[e],s=a&&a.prototype,l=a,u={},c=function(N){var U=Wt(s[N]);_i(s,N,N=="add"?function(D){return U(this,D===0?0:D),this}:N=="delete"?function(D){return!(i&&!Yr(D))&&U(this,D===0?0:D)}:N=="get"?function(D){return i&&!Yr(D)?void 0:U(this,D===0?0:D)}:N=="has"?function(D){return!(i&&!Yr(D))&&U(this,D===0?0:D)}:function(D,Q){return U(this,D===0?0:D,Q),this})};if(of(e,!jr(a)||!(i||s.forEach&&!Ir(function(){new a().entries().next()}))))l=r.getConstructor(t,e,n,o),Dm.enable();else if(of(e,!0)){var h=new l,S=h[o](i?{}:-0,1)!=h,y=Ir(function(){h.has(1)}),W=mS(function(N){new a(N)}),B=!i&&Ir(function(){for(var N=new a,U=5;U--;)N[o](U,U);return!N.has(-0)});W||((l=t(function(N,U){_m(N,s);var D=KM(new a,N,l);return U!=null&&hf(U,D[o],{that:D,AS_ENTRIES:n}),D})).prototype=s,s.constructor=l),(y||B)&&(c("delete"),c("has"),n&&c("get")),(B||S)&&c(o),i&&s.clear&&delete s.clear}return u[e]=l,sn({global:!0,forced:l!=a},u),xm(l,e),i||r.setStrong(l,e,n),l},Rm=Dm.getWeakData,oQ=hi.set,aQ=hi.getterFor,sQ=kc.find,lQ=kc.findIndex,uQ=Wt([].splice),cQ=0,km=function(e){return e.frozen||(e.frozen=new XM)},XM=function(){this.entries=[]},WS=function(e,t){return sQ(e.entries,function(r){return r[0]===t})};XM.prototype={get:function(e){var t=WS(this,e);if(t)return t[1]},has:function(e){return!!WS(this,e)},set:function(e,t){var r=WS(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=lQ(this.entries,function(r){return r[0]===e});return~t&&uQ(this.entries,t,1),!!~t}};var ff,YM={getConstructor:function(e,t,r,n){var i=e(function(l,u){_m(l,o),oQ(l,{type:t,id:cQ++,frozen:void 0}),u!=null&&hf(u,l[n],{that:l,AS_ENTRIES:r})}),o=i.prototype,a=aQ(t),s=function(l,u,c){var h=a(l),S=Rm(Sn(u),!0);return S===!0?km(h).set(u,c):S[h.id]=c,l};return Nc(o,{delete:function(l){var u=a(this);if(!Yr(l))return!1;var c=Rm(l);return c===!0?km(u).delete(l):c&&xn(c,u.id)&&delete c[u.id]},has:function(l){var u=a(this);if(!Yr(l))return!1;var c=Rm(l);return c===!0?km(u).has(l):c&&xn(c,u.id)}}),Nc(o,r?{get:function(l){var u=a(this);if(Yr(l)){var c=Rm(l);return c===!0?km(u).get(l):c?c[u.id]:void 0}},set:function(l,u){return s(this,l,u)}}:{add:function(l){return s(this,l,!0)}}),i}},Lm=hi.enforce,dQ=!yt.ActiveXObject&&"ActiveXObject"in yt,ZM=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},hQ=$M("WeakMap",ZM,YM);if(GI&&dQ){ff=YM.getConstructor(ZM,"WeakMap",!0),Dm.enable();var pf=hQ.prototype,JM=Wt(pf.delete),Pm=Wt(pf.has),QM=Wt(pf.get),qM=Wt(pf.set);Nc(pf,{delete:function(e){if(Yr(e)&&!ru(e)){var t=Lm(this);return t.frozen||(t.frozen=new ff),JM(this,e)||t.frozen.delete(e)}return JM(this,e)},has:function(e){if(Yr(e)&&!ru(e)){var t=Lm(this);return t.frozen||(t.frozen=new ff),Pm(this,e)||t.frozen.has(e)}return Pm(this,e)},get:function(e){if(Yr(e)&&!ru(e)){var t=Lm(this);return t.frozen||(t.frozen=new ff),Pm(this,e)?QM(this,e):t.frozen.get(e)}return QM(this,e)},set:function(e,t){if(Yr(e)&&!ru(e)){var r=Lm(this);r.frozen||(r.frozen=new ff),Pm(this,e)?qM(this,e,t):r.frozen.set(e,t)}else qM(this,e,t);return this}})}var GS=an("iterator"),e4=an("toStringTag"),VS=df.values,t4=function(e,t){if(e){if(e[GS]!==VS)try{ko(e,GS,VS)}catch(n){e[GS]=VS}if(e[e4]||ko(e,e4,t),hm[t]){for(var r in df)if(e[r]!==df[r])try{ko(e,r,df[r])}catch(n){e[r]=df[r]}}}};for(var KS in hm)t4(yt[KS]&&yt[KS].prototype,KS);t4(YI,"DOMTokenList");var $S=new WeakMap,XS=new WeakMap,YS=new WeakMap,Im=new WeakMap,ZS=new WeakMap,Mm=new WeakMap,JS=new WeakMap,QS=new WeakMap,Bm=new WeakMap,r4=new WeakMap,n4=new WeakMap,i4=new WeakMap,o4=new WeakMap,gf=new WeakMap,jc=new WeakMap,qS=new WeakMap,Fm=new WeakMap,ew=new WeakMap,Nm=new WeakMap,jm=new WeakMap,a4=new WeakMap,nu=new WeakMap,tw=new WeakMap,s4=new WeakMap,rw=new WeakMap,fQ=kc.find,l4=!0;"find"in[]&&Array(1).find(function(){l4=!1}),sn({target:"Array",proto:!0,forced:l4},{find:function(e){return fQ(this,e,arguments.length>1?arguments[1]:void 0)}}),af("find"),sn({global:!0},{globalThis:yt});const pQ=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","isindex","keygen","link","menuitem","meta","nextid","param","source","track","wbr"];Wv&&(_e.fn.css=Wv),io&&(_e.fn.append=io),fc&&(_e.fn.addClass=fc),pc&&(_e.fn.removeClass=pc),gc&&(_e.fn.hasClass=gc),Zo&&(_e.fn.on=Zo),cs&&(_e.fn.focus=cs),no&&(_e.fn.attr=no),jv&&(_e.fn.removeAttr=jv),mc&&(_e.fn.hide=mc),zv&&(_e.fn.show=zv),hP&&(_e.fn.offset=hP),Uv&&(_e.fn.width=Uv),Hv&&(_e.fn.height=Hv),yc&&(_e.fn.parent=yc),Kv&&(_e.fn.parents=Kv),pP&&(_e.fn.is=pP),vc&&(_e.fn.dataset=vc),Yo&&(_e.fn.val=Yo),Vv&&(_e.fn.text=Vv),us&&(_e.fn.html=us),Ec&&(_e.fn.children=Ec),xc&&(_e.fn.remove=xc),bc&&(_e.fn.find=bc),Gv&&(_e.fn.each=Gv),Sc&&(_e.fn.empty=Sc);var ta,fi,nw=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||null},Po=function(e){return iu(e)&&e.nodeType===1},iu=function(e){var t=nw(e);return!!t&&e instanceof t.Node},u4=function(e){var t=e&&e.anchorNode&&nw(e.anchorNode);return!!t&&e instanceof t.Selection},c4=function(e){return iu(e)&&e.nodeType===3},iw=function(e){var t,r,n;return(t=window.document.getElementById(e))!==null&&t!==void 0?t:((n=(r=window.document.activeElement)===null||r===void 0?void 0:r.shadowRoot)===null||n===void 0?void 0:n.getElementById(e))||null},d4=function(e,t,r){for(var n,i=e.childNodes,o=i[t],a=t,s=!1,l=!1;(iu(n=o)&&n.nodeType===8||Po(o)&&o.childNodes.length===0||Po(o)&&o.getAttribute("contenteditable")==="false")&&(!s||!l);)a>=i.length?(s=!0,a=t-1,r="backward"):a<0?(l=!0,a=t+1,r="forward"):(o=i[a],t=a,a+=r==="forward"?1:-1);return[o,t]},gQ=function(e,t,r){return Tr(d4(e,t,r),1)[0]},vQ=function e(t){var r,n,i="";if(c4(t)&&t.nodeValue)return t.nodeValue;if(Po(t)){try{for(var o=uo(Array.from(t.childNodes)),a=o.next();!a.done;a=o.next())i+=e(a.value)}catch(l){r={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}var s=getComputedStyle(t).getPropertyValue("display");s!=="block"&&s!=="list"&&s!=="table-row"&&t.tagName!=="BR"||(i+=`
|
|
|
`)}return i};function h4(e,t){if(!(e instanceof HTMLElement&&e.dataset.slateVoid==="true"))for(var r=e.childNodes,n=r.length;n--;){var i=r[n],o=i.nodeType;o==3?t(i,e):o!=1&&o!=9&&o!=11||h4(i,t)}}function f4(e){if(e.length===0)return"";var t=e[0];return t.nodeType!==ta.ELEMENT_NODE?"":t.tagName.toLowerCase()}(fi=ta||(ta={}))[fi.ELEMENT_NODE=1]="ELEMENT_NODE",fi[fi.TEXT_NODE=3]="TEXT_NODE",fi[fi.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",fi[fi.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",fi[fi.COMMENT_NODE=8]="COMMENT_NODE",fi[fi.DOCUMENT_NODE=9]="DOCUMENT_NODE",fi[fi.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",fi[fi.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",globalThis.navigator!==void 0&&globalThis.window!==void 0&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&globalThis.window.MSStream;var ow=typeof navigator!="undefined"&&/Mac OS X/.test(navigator.userAgent),vf=typeof navigator!="undefined"&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);typeof navigator!="undefined"&&/^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent);var mf=typeof navigator!="undefined"&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),mQ=typeof navigator!="undefined"&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),yQ=typeof navigator!="undefined"&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),aw=typeof navigator!="undefined"&&/Chrome/i.test(navigator.userAgent);typeof navigator!="undefined"&&/.*QQBrowser/.test(navigator.userAgent);var yf=!yQ&&!mQ&&typeof globalThis!="undefined"&&globalThis.InputEvent&&typeof globalThis.InputEvent.prototype.getTargetRanges=="function",Ae={getWindow:function(e){var t=a4.get(e);if(!t)throw new Error("Unable to find a host window element for this editor");return t},findKey:function(e,t){var r=jm.get(t);return r||(r=new HM,jm.set(t,r)),r},setNewKey:function(e){var t=new HM;jm.set(e,t)},findPath:function(e,t){for(var r=[],n=t;;){var i=jc.get(n);if(i==null){if(de.isEditor(n))return r;break}var o=gf.get(n);if(o==null)break;r.unshift(o),n=i}throw new Error("Unable to find the path for Slate node: "+JSON.stringify(t))},findDocumentOrShadowRoot:function(e){if(e.isDestroyed)return window.document;var t=Ae.toDOMNode(e,e),r=t.getRootNode();return(r instanceof Document||r instanceof ShadowRoot)&&r.getSelection!=null?r:t.ownerDocument},getParentNode:function(e,t){return jc.get(t)||null},getParentsNodes:function(e,t){for(var r=[],n=t;n!==e&&n!=null;){var i=Ae.getParentNode(e,n);if(i==null)break;r.push(i),n=i}return r},getTopNode:function(e,t){var r=[Ae.findPath(e,t)[0]];return St.get(e,r)},toDOMNode:function(e,t){var r;if(de.isEditor(t))r=qS.get(e);else{var n=Ae.findKey(e,t);r=ew.get(n)}if(!r)throw new Error("Cannot resolve a DOM node from Slate node: "+JSON.stringify(t));return r},hasDOMNode:function(e,t,r){r===void 0&&(r={});var n,i=r.editable,o=i!==void 0&&i,a=Ae.toDOMNode(e,e);try{n=Po(t)?t:t.parentElement}catch(s){if(!s.message.includes('Permission denied to access property "nodeType"'))throw s}return!!n&&n.closest("[data-slate-editor]")===a&&(!o||n.isContentEditable||!!n.getAttribute("data-slate-zero-width"))},toDOMRange:function(e,t){var r=t.anchor,n=t.focus,i=Qe.isBackward(t),o=Ae.toDOMPoint(e,r),a=Qe.isCollapsed(t)?o:Ae.toDOMPoint(e,n),s=Ae.getWindow(e).document.createRange(),l=Tr(i?a:o,2),u=l[0],c=l[1],h=Tr(i?o:a,2),S=h[0],y=h[1],W=!!(Po(u)?u:u.parentElement).getAttribute("data-slate-zero-width"),B=!!(Po(S)?S:S.parentElement).getAttribute("data-slate-zero-width");return s.setStart(u,W?1:c),s.setEnd(S,B?1:y),s},toDOMPoint:function(e,t){var r,n,i,o=Tr(de.node(e,t.path),1)[0],a=Ae.toDOMNode(e,o);de.void(e,{at:t})&&(t={path:t.path,offset:0});var s=Array.from(a.querySelectorAll("[data-slate-string], [data-slate-zero-width]")),l=0;try{for(var u=uo(s),c=u.next();!c.done;c=u.next()){var h=c.value,S=h.childNodes[0];if(S!=null&&S.textContent!=null){var y=S.textContent.length,W=h.getAttribute("data-slate-length"),B=l+(W==null?y:parseInt(W,10));if(t.offset<=B){i=[S,Math.min(y,Math.max(0,t.offset-l))];break}l=B}}}catch(N){r={error:N}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}if(!i)throw new Error("Cannot resolve a DOM point from Slate point: "+JSON.stringify(t));return i},toSlateNode:function(e,t){var r=Po(t)?t:t.parentElement;r&&!r.hasAttribute("data-slate-node")&&(r=r.closest("[data-slate-node]"));var n=r?Fm.get(r):null;if(!n)throw new Error("Cannot resolve a Slate node from DOM node: "+r);return n},findEventRange:function(e,t){"nativeEvent"in t&&(t=t.nativeEvent);var r=t.clientX,n=t.clientY,i=t.target;if(r==null||n==null)throw new Error("Cannot resolve a Slate range from a DOM event: "+t);var o,a=Ae.toSlateNode(e,t.target),s=Ae.findPath(e,a);if(de.isVoid(e,a)){var l=i.getBoundingClientRect(),u=e.isInline(a)?r-l.left<l.left+l.width-r:n-l.top<l.top+l.height-n,c=de.point(e,s,{edge:u?"start":"end"}),h=u?de.before(e,c):de.after(e,c);if(h)return de.range(e,h)}var S=this.getWindow(e).document;if(S.caretRangeFromPoint)o=S.caretRangeFromPoint(r,n);else{var y=S.caretPositionFromPoint(r,n);y&&((o=S.createRange()).setStart(y.offsetNode,y.offset),o.setEnd(y.offsetNode,y.offset))}if(!o)throw new Error("Cannot resolve a Slate range from a DOM event: "+t);return Ae.toSlateRange(e,o,{exactMatch:!1,suppressThrow:!1})},toSlateRange:function(e,t,r){var n,i,o,a,s,l=r.exactMatch,u=r.suppressThrow;if((u4(t)?t.anchorNode:t.startContainer)&&(u4(t)?(n=t.anchorNode,i=t.anchorOffset,o=t.focusNode,a=t.focusOffset,s=aw&&window.document.activeElement&&window.document.activeElement.shadowRoot?t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset:t.isCollapsed):(n=t.startContainer,i=t.startOffset,o=t.endContainer,a=t.endOffset,s=t.collapsed)),n==null||o==null||i==null||a==null)throw new Error("Cannot resolve a Slate range from DOM range: "+t);var c=Ae.toSlatePoint(e,[n,i],{exactMatch:l,suppressThrow:u});if(!c)return null;var h=s?c:Ae.toSlatePoint(e,[o,a],{exactMatch:l,suppressThrow:u});if(!h)return null;var S={anchor:c,focus:h};return Qe.isExpanded(S)&&Qe.isForward(S)&&Po(o)&&de.void(e,{at:S.focus,mode:"highest"})&&(S=de.unhangRange(e,S,{voids:!0})),S},toSlatePoint:function(e,t,r){var n,i=r.exactMatch,o=r.suppressThrow,a=Tr(i?t:function(D){var Q,te=Tr(D,2),he=te[0],Ee=te[1];if(Po(he)&&he.childNodes.length){var ve=Ee===he.childNodes.length,De=ve?Ee-1:Ee;for(he=(Q=Tr(d4(he,De,ve?"backward":"forward"),2))[0],ve=(De=Q[1])<Ee;Po(he)&&he.childNodes.length;){var Pe=ve?he.childNodes.length-1:0;he=gQ(he,Pe,ve?"backward":"forward")}Ee=ve&&he.textContent!=null?he.textContent.length:0}return[he,Ee]}(t),2),s=a[0],l=a[1],u=s.parentNode,c=null,h=0;if(u){var S=u.closest('[data-slate-void="true"]'),y=u.closest("[data-slate-leaf]"),W=null;if(y){c=y.closest('[data-slate-node="text"]');var B=Ae.getWindow(e).document.createRange();B.setStart(c,0),B.setEnd(s,l);var N=B.cloneContents();HS(HS([],Tr(sP(N.querySelectorAll("[data-slate-zero-width]")))),Tr(sP(N.querySelectorAll("[contenteditable=false]")))).forEach(function(D){D.parentNode.removeChild(D)}),h=N.textContent.length,W=c}else S&&((y=S.querySelector("[data-slate-leaf]"))?(c=y.closest('[data-slate-node="text"]'),h=(W=y).textContent.length,W.querySelectorAll("[data-slate-zero-width]").forEach(function(D){h-=D.textContent.length})):h=1);W&&h===W.textContent.length&&(u.hasAttribute("data-slate-zero-width")||vf&&((n=W.textContent)===null||n===void 0?void 0:n.endsWith(`
|
|
|
`)))&&h--}if(!c){if(o)return null;throw new Error("Cannot resolve a Slate point from DOM point: "+t)}var U=Ae.toSlateNode(e,c);return{path:Ae.findPath(e,U),offset:h}},hasRange:function(e,t){var r=t.anchor,n=t.focus;return de.hasPath(e,r.path)&&de.hasPath(e,n.path)},getNodeType:function(e){return Ut.isElement(e)?e.type:""},checkNodeType:function(e,t){return this.getNodeType(e)===t},getNodesStr:function(e){return e.map(function(t){return St.string(t)}).join("")},getSelectedElems:function(e){var t,r,n=[],i=de.nodes(e,{universal:!0});try{for(var o=uo(i),a=o.next();!a.done;a=o.next()){var s=Tr(a.value,1)[0];Ut.isElement(s)&&n.push(s)}}catch(l){t={error:l}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n},getSelectedNodeByType:function(e,t){var r=this,n=Tr(de.nodes(e,{match:function(o){return r.checkNodeType(o,t)},universal:!0}),1),i=n[0];return i==null?null:i[0]},getSelectedTextNode:function(e){var t=Tr(de.nodes(e,{match:function(n){return Rt.isText(n)},universal:!0}),1),r=t[0];return r==null?null:r[0]},isNodeSelected:function(e,t){var r=Tr(de.nodes(e,{match:function(i){return i===t},universal:!0}),1),n=r[0];return n!=null&&Tr(n,1)[0]===t},isSelectionAtLineEnd:function(e,t){var r=e.selection;return!!r&&(de.isEnd(e,r.anchor,t)||de.isEnd(e,r.focus,t))},getTextarea:function(e){var t=$S.get(e);if(t==null)throw new Error("Cannot find textarea instance by editor");return t},getToolbar:function(e){return Im.get(e)||null},getHoverbar:function(e){return Mm.get(e)||null},normalizeContent:function(e){e.children.forEach(function(t,r){e.normalizeNode([t,[r]])})},getLeftLengthOfMaxLength:function(e){var t=e.getConfig(),r=t.maxLength,n=t.onMaxLength;if(typeof r!="number"||r<=0)return 1/0;var i=r-e.getText().replace(/\r|\n|(\r\n)/g,"").length;return i<=0&&n&&n(e),i},cleanExposedTexNodeInSelectionBlock:function(e){var t,r,n,i,o=Ae.getTextarea(e).$textArea,a=o==null?void 0:o[0].childNodes;if(a)try{for(var s=uo(Array.from(a)),l=s.next();!l.done;l=s.next()){var u=l.value;if(u.nodeType!==3)break;u.remove()}}catch(B){t={error:B}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}var c=de.nodes(e,{match:function(B){return!(!Ut.isElement(B)||e.isInline(B))},universal:!0});try{for(var h=uo(c),S=h.next();!S.done;S=h.next()){var y=S.value;if(y!=null){var W=y[0];h4(Ae.toDOMNode(e,W),function(B,N){var U=_e(N);U.attr("data-slate-string")||U.attr("data-slate-zero-width")||U.attr("data-w-e-reserve")||N.removeChild(B)})}}}catch(B){n={error:B}}finally{try{S&&!S.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}},isLastNode:function(e,t){var r=e.children||[];return r[r.length-1]===t},genEmptyParagraph:function(){return{type:"paragraph",children:[{text:""}]}},isSelectedVoidNode:function(e){var t,r,n=de.nodes(e,{match:function(s){return e.isVoid(s)}}),i=0;try{for(var o=uo(n),a=o.next();!a.done;a=o.next())a.value,i++}catch(s){t={error:s}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i>0},isSelectedEmptyParagraph:function(e){var t=e.selection;if(t==null)return!1;if(Qe.isExpanded(t))return!1;var r=Ae.getSelectedNodeByType(e,"paragraph");if(r===null)return!1;var n=r.children;return n.length===1&&(n[0].text===""||void 0)},isEmptyPath:function(e,t){var r=de.node(e,t);if(r==null)return!1;var n=Tr(r,1)[0].children;return n.length===1&&n[0].text===""}},bQ=1,p4={},bf={},EQ=kc.filter,xQ=wm("filter");sn({target:"Array",proto:!0,forced:!xQ},{filter:function(e){return EQ(this,e,arguments.length>1?arguments[1]:void 0)}});var sw=`
|
|
|
\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`,g4=Wt("".replace),Um="["+sw+"]",SQ=RegExp("^"+Um+Um+"*"),wQ=RegExp(Um+Um+"*$"),lw=function(e){return function(t){var r=$r(so(t));return 1&e&&(r=g4(r,SQ,"")),2&e&&(r=g4(r,wQ,"")),r}},CQ={start:lw(1),end:lw(2),trim:lw(3)},TQ=_c.PROPER,AQ=CQ.trim;sn({target:"String",proto:!0,forced:function(e){return Ir(function(){return!!sw[e]()||"\u200B\x85\u180E"[e]()!=="\u200B\x85\u180E"||TQ&&sw[e].name!==e})}("trim")},{trim:function(){return AQ(this)}});var uw=[],v4={};function DQ(e,t,r){var n=r.isInline(e)?"span":"div";return"<"+n+">"+t+"</"+n+">"}var Ef,Uc,m4,cw,Hm=yt.Promise,y4=an("species"),dw=function(e){var t=Xl(e),r=Ro.f;Zn&&t&&!t[y4]&&r(t,y4,{configurable:!0,get:function(){return this}})},OQ=yt.TypeError,_Q=an("species"),b4=function(e,t){var r,n=Sn(e).constructor;return n===void 0||(r=Sn(n)[_Q])==null?t:function(i){if(gm(i))return i;throw OQ(om(i)+" is not a constructor")}(r)},E4=Wt([].slice),x4=/(?:ipad|iphone|ipod).*applewebkit/i.test(Dc),xs=Lo(yt.process)=="process",hw=yt.setImmediate,fw=yt.clearImmediate,RQ=yt.process,pw=yt.Dispatch,kQ=yt.Function,S4=yt.MessageChannel,LQ=yt.String,gw=0,xf={};try{Ef=yt.location}catch(e){}var vw=function(e){if(xn(xf,e)){var t=xf[e];delete xf[e],t()}},mw=function(e){return function(){vw(e)}},w4=function(e){vw(e.data)},C4=function(e){yt.postMessage(LQ(e),Ef.protocol+"//"+Ef.host)};hw&&fw||(hw=function(e){var t=E4(arguments,1);return xf[++gw]=function(){LS(jr(e)?e:kQ(e),void 0,t)},Uc(gw),gw},fw=function(e){delete xf[e]},xs?Uc=function(e){RQ.nextTick(mw(e))}:pw&&pw.now?Uc=function(e){pw.now(mw(e))}:S4&&!x4?(cw=(m4=new S4).port2,m4.port1.onmessage=w4,Uc=ql(cw.postMessage,cw)):yt.addEventListener&&jr(yt.postMessage)&&!yt.importScripts&&Ef&&Ef.protocol!=="file:"&&!Ir(C4)?(Uc=C4,yt.addEventListener("message",w4,!1)):Uc="onreadystatechange"in Zh("script")?function(e){lS.appendChild(Zh("script")).onreadystatechange=function(){lS.removeChild(this),vw(e)}}:function(e){setTimeout(mw(e),0)});var Sf,ou,wf,Hc,yw,bw,Ew,T4,A4={set:hw,clear:fw},PQ=/ipad|iphone|ipod/i.test(Dc)&&yt.Pebble!==void 0,IQ=/web0s(?!.*chrome)/i.test(Dc),MQ=tf.f,xw=A4.set,D4=yt.MutationObserver||yt.WebKitMutationObserver,O4=yt.document,_4=yt.process,zm=yt.Promise,R4=MQ(yt,"queueMicrotask"),k4=R4&&R4.value;k4||(Sf=function(){var e,t;for(xs&&(e=_4.domain)&&e.exit();ou;){t=ou.fn,ou=ou.next;try{t()}catch(r){throw ou?Hc():wf=void 0,r}}wf=void 0,e&&e.enter()},x4||xs||IQ||!D4||!O4?!PQ&&zm&&zm.resolve?((Ew=zm.resolve(void 0)).constructor=zm,T4=ql(Ew.then,Ew),Hc=function(){T4(Sf)}):xs?Hc=function(){_4.nextTick(Sf)}:(xw=ql(xw,yt),Hc=function(){xw(Sf)}):(yw=!0,bw=O4.createTextNode(""),new D4(Sf).observe(bw,{characterData:!0}),Hc=function(){bw.data=yw=!yw}));var Sw,L4,P4,I4,M4=k4||function(e){var t={fn:e,next:void 0};wf&&(wf.next=t),ou||(ou=t,Hc()),wf=t},BQ=function(e){var t,r;this.promise=new e(function(n,i){if(t!==void 0||r!==void 0)throw TypeError("Bad Promise constructor");t=n,r=i}),this.resolve=ys(t),this.reject=ys(r)},ww={f:function(e){return new BQ(e)}},Cw=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},FQ=typeof window=="object",B4=A4.set,NQ=an("species"),ra="Promise",F4=hi.getterFor(ra),jQ=hi.set,UQ=hi.getterFor(ra),au=Hm&&Hm.prototype,na=Hm,Cf=au,N4=yt.TypeError,Tw=yt.document,Aw=yt.process,zc=ww.f,HQ=zc,zQ=!!(Tw&&Tw.createEvent&&yt.dispatchEvent),j4=jr(yt.PromiseRejectionEvent),U4=!1,Tf=of(ra,function(){var e=um(na),t=e!==String(na);if(!t&&Xh===66)return!0;if(Xh>=51&&/native code/.test(e))return!1;var r=new na(function(i){i(1)}),n=function(i){i(function(){},function(){})};return(r.constructor={})[NQ]=n,!(U4=r.then(function(){})instanceof n)||!t&&FQ&&!j4}),WQ=Tf||!mS(function(e){na.all(e).catch(function(){})}),H4=function(e){var t;return!(!Yr(e)||!jr(t=e.then))&&t},Dw=function(e,t){if(!e.notified){e.notified=!0;var r=e.reactions;M4(function(){for(var n=e.value,i=e.state==1,o=0;r.length>o;){var a,s,l,u=r[o++],c=i?u.ok:u.fail,h=u.resolve,S=u.reject,y=u.domain;try{c?(i||(e.rejection===2&&VQ(e),e.rejection=1),c===!0?a=n:(y&&y.enter(),a=c(n),y&&(y.exit(),l=!0)),a===u.promise?S(N4("Promise-chain cycle")):(s=H4(a))?Cr(s,a,h,S):h(a)):S(n)}catch(W){y&&!l&&y.exit(),S(W)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&GQ(e)})}},z4=function(e,t,r){var n,i;zQ?((n=Tw.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),yt.dispatchEvent(n)):n={promise:t,reason:r},!j4&&(i=yt["on"+e])?i(n):e==="unhandledrejection"&&function(o,a){var s=yt.console;s&&s.error&&(arguments.length==1?s.error(o):s.error(o,a))}("Unhandled promise rejection",r)},GQ=function(e){Cr(B4,yt,function(){var t,r=e.facade,n=e.value;if(W4(e)&&(t=Cw(function(){xs?Aw.emit("unhandledRejection",n,r):z4("unhandledrejection",r,n)}),e.rejection=xs||W4(e)?2:1,t.error))throw t.value})},W4=function(e){return e.rejection!==1&&!e.parent},VQ=function(e){Cr(B4,yt,function(){var t=e.facade;xs?Aw.emit("rejectionHandled",t):z4("rejectionhandled",t,e.value)})},Wc=function(e,t,r){return function(n){e(t,n,r)}},Gc=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,Dw(e,!0))},Ow=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw N4("Promise can't be resolved itself");var n=H4(t);n?M4(function(){var i={done:!1};try{Cr(n,t,Wc(Ow,i,e),Wc(Gc,i,e))}catch(o){Gc(i,o,e)}}):(e.value=t,e.state=1,Dw(e,!1))}catch(i){Gc({done:!1},i,e)}}};if(Tf&&(Cf=(na=function(e){_m(this,Cf),ys(e),Cr(Sw,this);var t=F4(this);try{e(Wc(Ow,t),Wc(Gc,t))}catch(r){Gc(t,r)}}).prototype,(Sw=function(e){jQ(this,{type:ra,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Nc(Cf,{then:function(e,t){var r=UQ(this),n=r.reactions,i=zc(b4(this,na));return i.ok=!jr(e)||e,i.fail=jr(t)&&t,i.domain=xs?Aw.domain:void 0,r.parent=!0,n[n.length]=i,r.state!=0&&Dw(r,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),L4=function(){var e=new Sw,t=F4(e);this.promise=e,this.resolve=Wc(Ow,t),this.reject=Wc(Gc,t)},ww.f=zc=function(e){return e===na||e===P4?new L4(e):HQ(e)},jr(Hm)&&au!==Object.prototype)){I4=au.then,U4||(_i(au,"then",function(e,t){var r=this;return new na(function(n,i){Cr(I4,r,n,i)}).then(e,t)},{unsafe:!0}),_i(au,"catch",Cf.catch,{unsafe:!0}));try{delete au.constructor}catch(e){}Bc&&Bc(au,Cf)}sn({global:!0,wrap:!0,forced:Tf},{Promise:na}),xm(na,ra,!1),dw(ra),P4=Xl(ra),sn({target:ra,stat:!0,forced:Tf},{reject:function(e){var t=zc(this);return Cr(t.reject,void 0,e),t.promise}}),sn({target:ra,stat:!0,forced:Tf},{resolve:function(e){return function(t,r){if(Sn(t),Yr(r)&&r.constructor===t)return r;var n=ww.f(t);return(0,n.resolve)(r),n.promise}(this,e)}}),sn({target:ra,stat:!0,forced:WQ},{all:function(e){var t=this,r=zc(t),n=r.resolve,i=r.reject,o=Cw(function(){var a=ys(t.resolve),s=[],l=0,u=1;hf(e,function(c){var h=l++,S=!1;u++,Cr(a,t,c).then(function(y){S||(S=!0,s[h]=y,--u||n(s))},i)}),--u||n(s)});return o.error&&i(o.value),r.promise},race:function(e){var t=this,r=zc(t),n=r.reject,i=Cw(function(){var o=ys(t.resolve);hf(e,function(a){Cr(o,t,a).then(r.resolve,n)})});return i.error&&n(i.value),r.promise}});var Vc=Cm.UNSUPPORTED_Y,KQ=Math.min,G4=[].push,$Q=Wt(/./.exec),Kc=Wt(G4),Af=Wt("".slice);function co(e){Promise.resolve().then(e)}function V4(e,t){return Ut.isElement(e)?function(r,n){var i=r.type,o=i===void 0?"":i,a=r.children,s=a===void 0?[]:a,l=de.isVoid(n,r),u="";l||(u=s.map(function(U){return V4(U,n)}).join(""));var c=function(U){return v4[U]||DQ}(o),h=c(r,u,n),S="";if(S=typeof h=="string"?h:h.html||"",l||uw.forEach(function(U){return S=U(r,S)}),typeof h=="string")return S;var y=h.prefix,W=y===void 0?"":y,B=h.suffix,N=B===void 0?"":B;return W&&(S=W+S),N&&(S+=N),S}(e,t):function(r,n){var i=r.text;if(i==null)throw new Error("Current node is not slate Text "+JSON.stringify(r));var o=i;o=function(l){return l.replace(/ {2}/g," ").replace(/</g,"<").replace(/>/g,">").replace(/®/g,"®").replace(/©/g,"©").replace(/™/g,"™")}(o);var a=Ae.getParentsNodes(n,r).some(function(l){return Ae.getNodeType(l)==="pre"});if(a||(o=o.replace(/\r\n|\r|\n/g,"<br>")),a&&(o=o.replace(/ /g," ")),o===""){var s=Ae.getParentNode(null,r);if(!s||s.children.length!==0)return o;o="<br>"}return uw.forEach(function(l){return o=l(r,o)}),o}(e,t)}function K4(e){return"w-e-element-"+e}IS("split",function(e,t,r){var n;return n="abbc".split(/(b)*/)[1]=="c"||"test".split(/(?:)/,-1).length!=4||"ab".split(/(?:ab)*/).length!=2||".".split(/(.?)(.?)/).length!=4||".".split(/()()/).length>1||"".split(/.?/).length?function(i,o){var a=$r(so(this)),s=o===void 0?4294967295:o>>>0;if(s===0)return[];if(i===void 0)return[a];if(!hS(i))return Cr(t,a,i,s);for(var l,u,c,h=[],S=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(i.sticky?"y":""),y=0,W=new RegExp(i.source,S+"g");(l=Cr(uf,W,a))&&!((u=W.lastIndex)>y&&(Kc(h,Af(a,y,l.index)),l.length>1&&l.index<a.length&&LS(G4,h,zS(l,1)),c=l[0].length,y=u,h.length>=s));)W.lastIndex===l.index&&W.lastIndex++;return y===a.length?!c&&$Q(W,"")||Kc(h,""):Kc(h,Af(a,y)),h.length>s?zS(h,0,s):h}:"0".split(void 0,0).length?function(i,o){return i===void 0&&o===0?[]:Cr(t,this,i,o)}:t,[function(i,o){var a=so(this),s=i==null?void 0:Jl(i,e);return s?Cr(s,i,a,o):Cr(n,$r(a),i,o)},function(i,o){var a=Sn(this),s=$r(i),l=r(n,a,s,o,n!==t);if(l.done)return l.value;var u=b4(a,RegExp),c=a.unicode,h=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(Vc?"g":"y"),S=new u(Vc?"^(?:"+a.source+")":a,h),y=o===void 0?4294967295:o>>>0;if(y===0)return[];if(s.length===0)return cf(S,s)===null?[s]:[];for(var W=0,B=0,N=[];B<s.length;){S.lastIndex=Vc?0:B;var U,D=cf(S,Vc?Af(s,B):s);if(D===null||(U=KQ(Rc(S.lastIndex+(Vc?B:0)),s.length))===W)B=MS(s,B,c);else{if(Kc(N,Af(s,W,B)),N.length===y)return N;for(var Q=1;Q<=D.length-1;Q++)if(Kc(N,D[Q]),N.length===y)return N;B=W=U}}return Kc(N,Af(s,W)),N}]},!!Ir(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return r.length!==2||r[0]!=="a"||r[1]!=="b"}),Vc);var $4=function(e,t){var r=(t.top+t.bottom)/2;return e.top<=r&&e.bottom>=r},X4=function(e,t,r){var n=Ae.toDOMRange(e,t).getBoundingClientRect(),i=Ae.toDOMRange(e,r).getBoundingClientRect();return $4(n,i)&&$4(i,n)},Y4=["span","b","strong","i","em","s","strike","u","font","sub","sup"],Z4=[],_w=[],Wm={},XQ=Ro.f,YQ=rf.f,ZQ=hi.enforce,JQ=an("match"),Ia=yt.RegExp,$c=Ia.prototype,QQ=yt.SyntaxError,qQ=Wt(aS),eq=Wt($c.exec),Gm=Wt("".charAt),J4=Wt("".replace),Q4=Wt("".indexOf),tq=Wt("".slice),rq=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,su=/a/g,Rw=/a/g,nq=new Ia(su)!==su,q4=Cm.MISSED_STICKY,iq=Cm.UNSUPPORTED_Y,oq=Zn&&(!nq||q4||TS||AS||Ir(function(){return Rw[JQ]=!1,Ia(su)!=su||Ia(Rw)==Rw||Ia(su,"i")!="/a/i"}));if(of("RegExp",oq)){for(var Ss=function(e,t){var r,n,i,o,a,s,l=Zl($c,this),u=hS(e),c=t===void 0,h=[],S=e;if(!l&&u&&c&&e.constructor===Ss)return e;if((u||Zl($c,e))&&(e=e.source,c&&(t="flags"in S?S.flags:qQ(S))),e=e===void 0?"":$r(e),t=t===void 0?"":$r(t),S=e,TS&&"dotAll"in su&&(n=!!t&&Q4(t,"s")>-1)&&(t=J4(t,/s/g,"")),r=t,q4&&"sticky"in su&&(i=!!t&&Q4(t,"y")>-1)&&iq&&(t=J4(t,/y/g,"")),AS&&(o=function(y){for(var W,B=y.length,N=0,U="",D=[],Q={},te=!1,he=!1,Ee=0,ve="";N<=B;N++){if((W=Gm(y,N))==="\\")W+=Gm(y,++N);else if(W==="]")te=!1;else if(!te)switch(!0){case W==="[":te=!0;break;case W==="(":eq(rq,tq(y,N+1))&&(N+=2,he=!0),U+=W,Ee++;continue;case(W===">"&&he):if(ve===""||xn(Q,ve))throw new QQ("Invalid capture group name");Q[ve]=!0,D[D.length]=[ve,Ee],he=!1,ve="";continue}he?ve+=W:U+=W}return[U,D]}(e),e=o[0],h=o[1]),a=KM(Ia(e,t),l?this:$c,Ss),(n||i||h.length)&&(s=ZQ(a),n&&(s.dotAll=!0,s.raw=Ss(function(y){for(var W,B=y.length,N=0,U="",D=!1;N<=B;N++)(W=Gm(y,N))!=="\\"?D||W!=="."?(W==="["?D=!0:W==="]"&&(D=!1),U+=W):U+="[\\s\\S]":U+=W+Gm(y,++N);return U}(e),r)),i&&(s.sticky=!0),h.length&&(s.groups=h)),e!==S)try{ko(a,"source",S===""?"(?:)":S)}catch(y){}return a},aq=function(e){e in Ss||XQ(Ss,e,{configurable:!0,get:function(){return Ia[e]},set:function(t){Ia[e]=t}})},e3=YQ(Ia),t3=0;e3.length>t3;)aq(e3[t3++]);$c.constructor=Ss,Ss.prototype=$c,_i(yt,"RegExp",Ss)}dw("RegExp");var sq=new RegExp(String.fromCharCode(160),"g");function r3(e){return e.replace(sq," ")}function n3(e,t){var r=e.length;if(r){var n=e[r-1];if(Rt.isText(n)){var i=Object.keys(n);if(i.length===1&&i[0]==="text")return n.text=n.text+t,!0}}return!1}function lq(e,t,r){return{type:"paragraph",children:[{text:_e(e).text().replace(/\s+/gm," ")}]}}function kw(e,t){var r=function(o,a){var s=[];if(o.attr("data-w-e-is-void")!=null)return s;var l=o[0].childNodes;return l.length===1&&l[0].nodeName==="BR"?(s.push({text:""}),s):(l.forEach(function(u){if(u.nodeType!==ta.ELEMENT_NODE){if(!(u.nodeType!==ta.TEXT_NODE)){var c=u.textContent||"";if(c.trim()===""&&c.indexOf(`
|
|
|
`)>=0)return;c&&(c=r3(c),n3(s,c)||s.push({text:c}))}}else{if(u.nodeName==="BR")return void(n3(s,`
|
|
|
`)||s.push({text:`
|
|
|
`}));var h=Pw(_e(u),a);Array.isArray(h)?h.forEach(function(S){return s.push(S)}):s.push(h)}}),s)}(e,t),n=function(o){for(var a in Wm)if(o[0].matches(a))return Wm[a];return lq}(e),i=n(e[0],r,t);return Array.isArray(i)||(i=[i]),i.forEach(function(o){de.isVoid(t,o)||(r.length===0&&(o.children=[{text:e.text().replace(/\s+/gm," ")}]),_w.forEach(function(a){o=a(e[0],o,t)}))}),i}function Lw(e,t){e.parents("pre").length===0&&(e[0].innerHTML=e[0].innerHTML.replace(/\s+/gm," ").replace(/<br>/g,`
|
|
|
`));var r=e[0].textContent||"";r=function(i){return i.replace(/ /g," ").replace(/</g,"<").replace(/>/g,">").replace(/®/g,"\xAE").replace(/©/g,"\xA9").replace(/™/g,"\u2122").replace(/"/g,'"')}(r);var n={text:r=r3(r)};return _w.forEach(function(i){n=i(e[0],n,t)}),n}function Pw(e,t){Z4.forEach(function(n){var i=n.selector,o=n.preParseHtml;e[0].matches(i)&&(e=_e(o(e[0])))});var r=f4(e);return r==="span"?e.attr("data-w-e-type")?kw(e,t):Lw(e,t):r==="code"?f4(e.parent())==="pre"?kw(e,t):Lw(e,t):Y4.includes(r)?Lw(e,t):kw(e,t)}function i3(e,t,r){var n=_e(r);return!!n.attr(t)||(n.attr(t,"true"),e.on("destroyed",function(){n.removeAttr(t)}),!1)}function o3(e,t){t===void 0&&(t="");var r=[];t===""&&(t="<p><br></p>"),t.indexOf("<")!==0&&(t=t.split(/\n/).map(function(i){return"<p>"+i+"</p>"}).join(""));var n=_e("<div>"+t+"</div>");return Array.from(n.children()).forEach(function(i){var o=Pw(_e(i),e);Array.isArray(o)?o.forEach(function(a){return r.push(a)}):r.push(o)}),r}var uq=Ro.f,a3=Dm.fastKey,s3=hi.set,Iw=hi.getterFor,cq={getConstructor:function(e,t,r,n){var i=e(function(u,c){_m(u,o),s3(u,{type:t,index:bm(null),first:void 0,last:void 0,size:0}),Zn||(u.size=0),c!=null&&hf(c,u[n],{that:u,AS_ENTRIES:r})}),o=i.prototype,a=Iw(t),s=function(u,c,h){var S,y,W=a(u),B=l(u,c);return B?B.value=h:(W.last=B={index:y=a3(c,!0),key:c,value:h,previous:S=W.last,next:void 0,removed:!1},W.first||(W.first=B),S&&(S.next=B),Zn?W.size++:u.size++,y!=="F"&&(W.index[y]=B)),u},l=function(u,c){var h,S=a(u),y=a3(c);if(y!=="F")return S.index[y];for(h=S.first;h;h=h.next)if(h.key==c)return h};return Nc(o,{clear:function(){for(var u=a(this),c=u.index,h=u.first;h;)h.removed=!0,h.previous&&(h.previous=h.previous.next=void 0),delete c[h.index],h=h.next;u.first=u.last=void 0,Zn?u.size=0:this.size=0},delete:function(u){var c=this,h=a(c),S=l(c,u);if(S){var y=S.next,W=S.previous;delete h.index[S.index],S.removed=!0,W&&(W.next=y),y&&(y.previous=W),h.first==S&&(h.first=y),h.last==S&&(h.last=W),Zn?h.size--:c.size--}return!!S},forEach:function(u){for(var c,h=a(this),S=ql(u,arguments.length>1?arguments[1]:void 0);c=c?c.next:h.first;)for(S(c.value,c.key,this);c&&c.removed;)c=c.previous},has:function(u){return!!l(this,u)}}),Nc(o,r?{get:function(u){var c=l(this,u);return c&&c.value},set:function(u,c){return s(this,u===0?0:u,c)}}:{add:function(u){return s(this,u=u===0?0:u,u)}}),Zn&&uq(o,"size",{get:function(){return a(this).size}}),i},setStrong:function(e,t,r){var n=t+" Iterator",i=Iw(t),o=Iw(n);xS(e,t,function(a,s){s3(this,{type:n,target:a,state:i(a),kind:s,last:void 0})},function(){for(var a=o(this),s=a.kind,l=a.last;l&&l.removed;)l=l.previous;return a.target&&(a.last=l=l?l.next:a.state.first)?s=="keys"?{value:l.key,done:!1}:s=="values"?{value:l.value,done:!1}:{value:[l.key,l.value],done:!1}:(a.target=void 0,{value:void 0,done:!0})},r?"entries":"values",!r,!0),dw(t)}};$M("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},cq);var l3=new Set(["doctype","!doctype","meta","script","style","link","frame","iframe","title","svg"]);function u3(e,t){e.isInline(t)?(e.insertNode(t),t.type==="link"&&e.insertFragment([{text:""}])):Ve.insertNodes(e,t,{mode:"highest"})}var dq=function(e){var t=e,r=t.insertText;return t.insertFragment,t.setFragmentData=function(n){var i=t.selection;if(i){var o=Tr(Qe.edges(i),2),a=o[0],s=o[1],l=de.void(t,{at:a.path}),u=de.void(t,{at:s.path});if(!Qe.isCollapsed(i)||l){var c=Ae.toDOMRange(t,i),h=c.cloneContents(),S=h.childNodes[0];if(h.childNodes.forEach(function(he){he.textContent&&he.textContent.trim()!==""&&(S=he)}),u){var y=Tr(u,1)[0],W=c.cloneRange(),B=Ae.toDOMNode(t,y);W.setEndAfter(B),h=W.cloneContents()}if(l&&(S=h.querySelector("[data-slate-spacer]")),Array.from(h.querySelectorAll("[data-slate-zero-width]")).forEach(function(he){var Ee=he.getAttribute("data-slate-zero-width")==="n";he.textContent=Ee?`
|
|
|
`:""}),c4(S)){var N=S.ownerDocument.createElement("span");N.style.whiteSpace="pre",N.appendChild(S),h.appendChild(N),S=N}var U=t.getFragment(),D=JSON.stringify(U),Q=window.btoa(encodeURIComponent(D));S.setAttribute("data-slate-fragment",Q),n.setData("application/x-slate-fragment",Q);var te=h.ownerDocument.createElement("div");return te.appendChild(h),te.setAttribute("hidden","true"),h.ownerDocument.body.appendChild(te),n.setData("text/html",te.innerHTML),n.setData("text/plain",vQ(te)),h.ownerDocument.body.removeChild(te),n}}},t.insertData=function(n){var i,o,a=n.getData("application/x-slate-fragment");if(a){var s=decodeURIComponent(window.atob(a)),l=JSON.parse(s);t.insertFragment(l)}else{var u=n.getData("text/plain"),c=n.getData("text/html");if(c)t.dangerouslyInsertHtml(c);else if(u){var h=u.split(/\r\n|\r|\n/),S=!1;try{for(var y=uo(h),W=y.next();!W.done;W=y.next()){var B=W.value;S&&Ve.splitNodes(t,{always:!0}),r(B),S=!0}}catch(N){i={error:N}}finally{try{W&&!W.done&&(o=y.return)&&o.call(y)}finally{if(i)throw i.error}}}}},t},Df=function(e){return e!=null},hq={object:!0,function:!0,undefined:!0},fq=/^\s*class[\s{/}]/,pq=Function.prototype.toString,c3=function(e){return!!function(t){if(typeof t!="function")return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if(typeof t.length!="number")return!1;if(typeof t.call!="function")return!1;if(typeof t.apply!="function")return!1}catch(r){return!1}return!function(r){if(!function(n){return!!Df(n)&&hasOwnProperty.call(hq,typeof n)}(r))return!1;try{return!!r.constructor&&r.constructor.prototype===r}catch(n){return!1}}(t)}(e)&&!fq.test(pq.call(e))},Mw=function(e){return e!=null},gq=Object.keys,vq=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}()?Object.keys:function(e){return gq(Mw(e)?Object(e):e)},mq=function(e){if(!Mw(e))throw new TypeError("Cannot use null or undefined");return e},yq=Math.max,d3=function(){var e,t=Object.assign;return typeof t=="function"&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}()?Object.assign:function(e,t){var r,n,i,o=yq(arguments.length,2);for(e=Object(mq(e)),i=function(a){try{e[a]=t[a]}catch(s){r||(r=s)}},n=1;n<o;++n)vq(t=arguments[n]).forEach(i);if(r!==void 0)throw r;return e},bq=Array.prototype.forEach,Eq=Object.create,xq=function(e,t){var r;for(r in e)t[r]=e[r]},h3=function(e){var t=Eq(null);return bq.call(arguments,function(r){Mw(r)&&xq(Object(r),t)}),t},Bw="razdwatrzy",Sq=String.prototype.indexOf,Of=typeof Bw.contains=="function"&&Bw.contains("dwa")===!0&&Bw.contains("foo")===!1?String.prototype.contains:function(e){return Sq.call(this,e,arguments[1])>-1},Vm=$h(function(e){var t=e.exports=function(r,n){var i,o,a,s,l;return arguments.length<2||typeof r!="string"?(s=n,n=r,r=null):s=arguments[2],Df(r)?(i=Of.call(r,"c"),o=Of.call(r,"e"),a=Of.call(r,"w")):(i=a=!0,o=!1),l={value:n,configurable:i,enumerable:o,writable:a},s?d3(h3(s),l):l};t.gs=function(r,n,i){var o,a,s,l;return typeof r!="string"?(s=i,i=n,n=r,r=null):s=arguments[3],Df(n)?c3(n)?Df(i)?c3(i)||(s=i,i=void 0):i=void 0:(s=n,n=i=void 0):n=void 0,Df(r)?(o=Of.call(r,"c"),a=Of.call(r,"e")):(o=!0,a=!1),l={get:n,set:i,configurable:o,enumerable:a},s?d3(h3(s),l):l}}),Fw=function(e){if(typeof e!="function")throw new TypeError(e+" is not a function");return e},wq=$h(function(e,t){var r,n,i,o,a,s,l,u=Function.prototype.apply,c=Function.prototype.call,h=Object.create,S=Object.defineProperty,y=Object.defineProperties,W=Object.prototype.hasOwnProperty,B={configurable:!0,enumerable:!1,writable:!0};r=function(N,U){var D;return Fw(U),W.call(this,"__ee__")?D=this.__ee__:(D=B.value=h(null),S(this,"__ee__",B),B.value=null),D[N]?typeof D[N]=="object"?D[N].push(U):D[N]=[D[N],U]:D[N]=U,this},n=function(N,U){var D,Q;return Fw(U),Q=this,r.call(this,N,D=function(){i.call(Q,N,D),u.call(U,this,arguments)}),D.__eeOnceListener__=U,this},i=function(N,U){var D,Q,te,he;if(Fw(U),!W.call(this,"__ee__"))return this;if(!(D=this.__ee__)[N])return this;if(typeof(Q=D[N])=="object")for(he=0;te=Q[he];++he)te!==U&&te.__eeOnceListener__!==U||(Q.length===2?D[N]=Q[he?0:1]:Q.splice(he,1));else Q!==U&&Q.__eeOnceListener__!==U||delete D[N];return this},o=function(N){var U,D,Q,te,he;if(W.call(this,"__ee__")&&(te=this.__ee__[N]))if(typeof te=="object"){for(D=arguments.length,he=new Array(D-1),U=1;U<D;++U)he[U-1]=arguments[U];for(te=te.slice(),U=0;Q=te[U];++U)u.call(Q,this,he)}else switch(arguments.length){case 1:c.call(te,this);break;case 2:c.call(te,this,arguments[1]);break;case 3:c.call(te,this,arguments[1],arguments[2]);break;default:for(D=arguments.length,he=new Array(D-1),U=1;U<D;++U)he[U-1]=arguments[U];u.call(te,this,he)}},a={on:r,once:n,off:i,emit:o},s={on:Vm(r),once:Vm(n),off:Vm(i),emit:Vm(o)},l=y({},s),e.exports=t=function(N){return N==null?h(l):y(Object(N),s)},t.methods=a});function Km(e){var t=s4.get(e);return t==null&&(t=wq(),s4.set(e,t)),t}var $m=new WeakMap;function f3(e,t){var r=$m.get(e);r==null&&(r=new Set,$m.set(e,r)),r.add(t)}function Cq(e){return $m.get(e)||new Set}function Tq(e){$m.set(e,new Set)}function Nw(e){var t=Ae.getTextarea(e).$textAreaContainer,r=t.width(),n=t.height(),i=t.offset();return{top:i.top,left:i.left,width:r,height:n}}function jw(e){var t={top:"0",left:"0"},r=e.selection;if(r==null)return t;var n=Nw(e);if(n==null)return t;var i=n.top,o=n.left,a=n.width,s=n.height,l=Ae.toDOMRange(e,r).getClientRects()[0];if(l==null)return t;l.width;var u=l.height,c={},h=l.top-i,S=l.left-o;if(S>a/2){var y=a-S;c.right=y+5+"px"}else c.left=S+5+"px";if(h>s/2){var W=s-h;c.bottom=W+5+"px"}else{var B=h+u;B<0&&(B=0),c.top=B+5+"px"}return c}function Uw(e,t,r){r===void 0&&(r="modal");var n={top:"0",left:"0"};if(e.selection==null)return n;var i=Ut.isElement(t)&&e.isVoid(t),o=Ut.isElement(t)&&e.isInline(t),a=Nm.get(t);if(a==null)return n;var s=a.getBoundingClientRect(),l=s.top,u=s.left,c=s.height,h=s.width;if(i){var S=function(ve){var De=[];De.push(ve);for(var Pe=0;De.length>0;){var qe=De.pop();if(qe==null)break;if(++Pe>1e4)break;var ot=qe.nodeName;if(qe.nodeType===1){var et=ot.toLowerCase();if(pQ.includes(et)||et==="iframe"||et==="video")return qe;var gt=qe.children||[],dt=gt.length;if(dt)for(var ht=dt-1;ht>=0;ht--)De.push(gt[ht])}}return null}(a);if(S!=null){var y=S.getBoundingClientRect();l=y.top,c=y.height}}var W=Nw(e);if(W==null)return n;var B,N=W.top,U=W.left,D=W.width,Q=W.height,te={},he=l-N,Ee=u-U;if(r==="bar")return te.left=Ee+"px",he>40?te.bottom=Q-he+5+"px":te.top=he+c+5+"px",te;if(r==="modal")return i?o?Ee>(D-h)/2?te.right=D-Ee+5+"px":te.left=Ee+h+5+"px":te.left="20px":te.left=Ee+"px",i?((B=he)<0&&(B=0),te.top=B+"px"):he>(Q-c)/2?te.bottom=Q-he+5+"px":((B=he+c)<0&&(B=0),te.top=B+5+"px"),te;throw new Error("type '"+r+"' is invalid")}function Hw(e,t){co(function(){var r=Nw(e);if(r!=null){var n,i=r.top,o=r.left,a=r.width,s=r.height,l=t.offset(),u=l.top,c=l.left,h=t.width(),S=t.height(),y=u-i,W=c-o,B=t.attr("style");if(B.indexOf("top")>=0&&(n=y+S-s)>0){var N=t.css("top"),U=parseInt(N.toString())-n;U<0&&(U=0),t.css("top",U+"px")}if(B.indexOf("bottom")>=0&&u<0){var D=t.css("bottom"),Q=parseInt(D.toString())-Math.abs(u);t.css("bottom",Q+"px")}if(B.indexOf("left")>=0&&(n=W+h-a)>0){var te=t.css("left"),he=parseInt(te.toString())-n;he<0&&(he=0),t.css("left",he+"px")}if(B.indexOf("right")>=0&&c<0){var Ee=t.css("right"),ve=parseInt(Ee.toString())-Math.abs(c);t.css("right",ve+"px")}}})}var Aq=wm("slice"),Dq=an("species"),zw=yt.Array,Oq=Math.max;sn({target:"Array",proto:!0,forced:!Aq},{slice:function(e,t){var r,n,i,o=Es(this),a=eu(o),s=Lc(e,a),l=Lc(t===void 0?a:t,a);if(pm(o)&&(r=o.constructor,(gm(r)&&(r===zw||pm(r.prototype))||Yr(r)&&(r=r[Dq])===null)&&(r=void 0),r===zw||r===void 0))return E4(o,s,l);for(n=new(r===void 0?zw:r)(Oq(l-s,0)),i=0;s<l;s++,i++)s in o&&sf(n,i,o[s]);return n.length=i,n}});var _q=tf.f,p3=Wt("".startsWith),Rq=Wt("".slice),kq=Math.min,g3=pS("startsWith"),Lq=!g3&&!!function(){var e=_q(String.prototype,"startsWith");return e&&!e.writable}();sn({target:"String",proto:!0,forced:!Lq&&!g3},{startsWith:function(e){var t=$r(so(this));fS(e);var r=Rc(kq(arguments.length>1?arguments[1]:void 0,t.length)),n=$r(e);return p3?p3(t,n,r):Rq(t,r,r+n.length)===n}});var Xc=Object.assign,v3=Object.defineProperty,Pq=Wt([].concat),m3=!Xc||Ir(function(){if(Zn&&Xc({b:1},Xc(v3({},"a",{enumerable:!0,get:function(){v3(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(i){t[i]=i}),Xc({},e)[r]!=7||Pc(Xc({},t)).join("")!=n})?function(e,t){for(var r=ms(e),n=arguments.length,i=1,o=hM.f,a=aM.f;n>i;)for(var s,l=fm(arguments[i++]),u=o?Pq(Pc(l),o(l)):Pc(l),c=u.length,h=0;c>h;)s=u[h++],Zn&&!Cr(a,l,s)||(r[s]=l[s]);return r}:Xc;sn({target:"Object",stat:!0,forced:Object.assign!==m3},{assign:m3});var Iq=["props","attrs","style","dataset","on","hook"];function y3(e){var t=e.data,r=t===void 0?{}:t,n=e.children,i=n===void 0?[]:n;Object.keys(r).forEach(function(o){var a,s,l=r[o];if(o!=="key"){if(!Iq.includes(o)){if(o.startsWith("data-")){var u=o.slice(5);return u=iX(u),function(c,h){c.data==null&&(c.data={});var S=c.data;S.dataset==null&&(S.dataset={}),Object.assign(S.dataset,h)}(e,((a={})[u]=l,a)),void delete r[o]}!function(c,h){c.data==null&&(c.data={});var S=c.data;S.props==null&&(S.props={}),Object.assign(S.props,h)}(e,(s={},s[o]=l,s)),delete r[o]}}else e.key=l}),i.length>0&&i.forEach(function(o){typeof o!="string"&&y3(o)})}var Ww=[],b3={};function Mq(e,t,r){return er(r.isInline(e)?"span":"div",null,t)}function E3(e,t){return t===void 0&&(t=!1),er("span",{"data-slate-string":!0},t?e+`
|
|
|
`:e)}function Gw(e,t){return e===void 0&&(e=0),t===void 0&&(t=!1),er("span",{"data-slate-zero-width":t?"n":"z","data-slate-length":e},"\uFEFF",t?er("br",null):null)}function Vw(e,t,r,n){return gf.set(e,t),jc.set(e,r),Ut.isElement(e)?function(i,o){var a,s=Ae.findKey(o,i),l=o.isInline(i),u=de.isVoid(o,i),c=K4(s.id),h={id:c,key:s.id,"data-slate-node":"element","data-slate-inline":l},S=i.type,y=i.children,W=y===void 0?[]:y,B=function(he){return b3[he]||Mq}(S);a=u?null:W.map(function(he,Ee){return Vw(he,Ee,i,o)});var N=B(i,a,o);if(u){h["data-slate-void"]=!0;var U=l?"span":"div",D=Tr(St.texts(i),1),Q=Tr(D[0],1)[0],te=er(U,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},Vw(Q,0,i,o));N=er(U,{style:{position:"relative"}},N,te),gf.set(Q,0),jc.set(Q,i)}return N.data==null&&(N.data={}),Object.assign(N.data,h),u||l||(N=function(he,Ee){var ve=Ee;return Ww.forEach(function(De){ve=De(he,Ee)}),ve}(i,N)),co(function(){var he=iw(c);he!=null&&(ew.set(s,he),Nm.set(i,he),Fm.set(he,i))}),N}(e,n):function(i,o,a){if(i.text==null)throw new Error("Current node is not slate Text "+JSON.stringify(i));var s=Ae.findKey(a,i),l=a.getConfig().decorate;if(l==null)throw new Error("Can not get config.decorate");var u=Ae.findPath(a,i),c=l([i,u]),h=Rt.decorations(i,c),S=h.map(function(B,N){var U=function(D,Q,te,he,Ee){Q===void 0&&(Q=!1);var ve=D.text,De=Ae.findPath(Ee,te),Pe=Ue.parent(De);if(de.isEditor(he))throw new Error("Text node "+JSON.stringify(te)+" parent is Editor");return Ee.isVoid(he)?Gw(St.string(he).length):ve!==""||he.children[he.children.length-1]!==te||Ee.isInline(he)||de.string(Ee,Pe)!==""?ve===""?Gw():Q&&ve.slice(-1)===`
|
|
|
`?E3(ve,!0):E3(ve):Gw(0,!0)}(B,N===h.length-1,i,o,a);return U=function(D,Q){var te=Q;return Ww.forEach(function(he){te=he(D,te)}),te}(B,U),er("span",{"data-slate-leaf":!0},U)}),y=function(B){return"w-e-text-"+B}(s.id),W=er("span",{"data-slate-node":"text",id:y,key:s.id},S);return co(function(){var B=iw(y);B!=null&&(ew.set(s,B),Nm.set(i,B),Fm.set(B,i))}),W}(e,r,n)}function Bq(e,t){var r,n=e.$scroll,i=function(B){return"w-e-textarea-"+B}(e.id),o=t.getConfig(),a=o.readOnly,s=o.autoFocus,l=function(B,N){return N===void 0&&(N=!1),wc("div#"+B,{props:{contentEditable:!N}})}(i,a),u=t.children||[];l.children=u.map(function(B,N){var U=Vw(B,N,t,t);return y3(U),U});var c=n4.get(e);if(c==null&&(c=!0),c){var h=function(B,N){return _e(`<div
|
|
|
id="`+B+`"
|
|
|
data-slate-editor
|
|
|
data-slate-node="value"
|
|
|
suppressContentEditableWarning
|
|
|
role="textarea"
|
|
|
spellCheck="true"
|
|
|
autoCorrect="true"
|
|
|
autoCapitalize="true"
|
|
|
></div>`)}(i);n.append(h),e.$textArea=h,r=h[0],(y=A$([O$,L$,I$,_$,k$,D$]))(r,l),n4.set(e,!1),i4.set(e,y)}else{var S=o4.get(e),y=i4.get(e);if(S==null||y==null)return;r=S.elm,y(S,l)}if(r!=null||(r=iw(i))!=null){if((c?s:t.isFocused())&&r.focus({preventScroll:!0}),c){var W=nw(r);W&&a4.set(t,W)}qS.set(t,r),Nm.set(t,r),Fm.set(r,t),o4.set(e,l)}}function x3(e){return typeof e=="object"&&e!=null&&e.nodeType===1}function S3(e,t){return(!t||e!=="hidden")&&e!=="visible"&&e!=="clip"}function Kw(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var r=getComputedStyle(e,null);return S3(r.overflowY,t)||S3(r.overflowX,t)||function(n){var i=function(o){if(!o.ownerDocument||!o.ownerDocument.defaultView)return null;try{return o.ownerDocument.defaultView.frameElement}catch(a){return null}}(n);return!!i&&(i.clientHeight<n.scrollHeight||i.clientWidth<n.scrollWidth)}(e)}return!1}function Xm(e,t,r,n,i,o,a,s){return o<e&&a>t||o>e&&a<t?0:o<=e&&s<=r||a>=t&&s>=r?o-e-n:a>t&&s<r||o<e&&s>r?a-t+i:0}function w3(e,t){var r=window,n=t.scrollMode,i=t.block,o=t.inline,a=t.boundary,s=t.skipOverflowHiddenElements,l=typeof a=="function"?a:function(or){return or!==a};if(!x3(e))throw new TypeError("Invalid target");for(var u=document.scrollingElement||document.documentElement,c=[],h=e;x3(h)&&l(h);){if((h=h.parentElement)===u){c.push(h);break}h!=null&&h===document.body&&Kw(h)&&!Kw(document.documentElement)||h!=null&&Kw(h,s)&&c.push(h)}for(var S=r.visualViewport?r.visualViewport.width:innerWidth,y=r.visualViewport?r.visualViewport.height:innerHeight,W=window.scrollX||pageXOffset,B=window.scrollY||pageYOffset,N=e.getBoundingClientRect(),U=N.height,D=N.width,Q=N.top,te=N.right,he=N.bottom,Ee=N.left,ve=i==="start"||i==="nearest"?Q:i==="end"?he:Q+U/2,De=o==="center"?Ee+D/2:o==="end"?te:Ee,Pe=[],qe=0;qe<c.length;qe++){var ot=c[qe],et=ot.getBoundingClientRect(),gt=et.height,dt=et.width,ht=et.top,pt=et.right,Dt=et.bottom,Ft=et.left;if(n==="if-needed"&&Q>=0&&Ee>=0&&he<=y&&te<=S&&Q>=ht&&he<=Dt&&Ee>=Ft&&te<=pt)return Pe;var Bt=getComputedStyle(ot),It=parseInt(Bt.borderLeftWidth,10),Re=parseInt(Bt.borderTopWidth,10),Te=parseInt(Bt.borderRightWidth,10),Fe=parseInt(Bt.borderBottomWidth,10),rt=0,vt=0,ut="offsetWidth"in ot?ot.offsetWidth-ot.clientWidth-It-Te:0,kt="offsetHeight"in ot?ot.offsetHeight-ot.clientHeight-Re-Fe:0;if(u===ot)rt=i==="start"?ve:i==="end"?ve-y:i==="nearest"?Xm(B,B+y,y,Re,Fe,B+ve,B+ve+U,U):ve-y/2,vt=o==="start"?De:o==="center"?De-S/2:o==="end"?De-S:Xm(W,W+S,S,It,Te,W+De,W+De+D,D),rt=Math.max(0,rt+B),vt=Math.max(0,vt+W);else{rt=i==="start"?ve-ht-Re:i==="end"?ve-Dt+Fe+kt:i==="nearest"?Xm(ht,Dt,gt,Re,Fe+kt,ve,ve+U,U):ve-(ht+gt/2)+kt/2,vt=o==="start"?De-Ft-It:o==="center"?De-(Ft+dt/2)+ut/2:o==="end"?De-pt+Te+ut:Xm(Ft,pt,dt,It,Te+ut,De,De+D,D);var Xt=ot.scrollLeft,qt=ot.scrollTop;ve+=qt-(rt=Math.max(0,Math.min(qt+rt,ot.scrollHeight-gt+kt))),De+=Xt-(vt=Math.max(0,Math.min(Xt+vt,ot.scrollWidth-dt+ut)))}Pe.push({el:ot,top:rt,left:vt})}return Pe}function C3(e){return e===Object(e)&&Object.keys(e).length!==0}function ho(e,t){return iu(t)&&Ae.hasDOMNode(e,t,{editable:!0})}function T3(e,t){if(e.getConfig().readOnly)return!1;var r=Yc(e,t)&&Ae.toSlateNode(e,t);return de.isVoid(e,r)}function Yc(e,t){return iu(t)&&Ae.hasDOMNode(e,t)}function A3(e,t,r){r===void 0&&(r=!1);var n=t.selection,i=t.getConfig(),o=Ae.findDocumentOrShadowRoot(t).getSelection();if(o&&(!e.isComposing||r)&&t.isFocused()){var a=o.type!=="None";if(n||a){var s=qS.get(t),l=!1;if(s.contains(o.anchorNode)&&s.contains(o.focusNode)&&(l=!0),a&&l&&n){var u=Ae.toSlateRange(t,o,{exactMatch:!0,suppressThrow:!0});if(u&&Qe.equals(u,n)){var c=!0;if(Qe.isCollapsed(n)){var h=o.anchorNode,S=o.anchorOffset;if(h===s){var y=s.childNodes,W=void 0;(W=y[S])&&W.matches("table")&&(c=!1),(W=y[S-1])&&W.matches("table")&&(c=!1)}}if(c)return}}if(!n||Ae.hasRange(t,n)){e.isUpdatingSelection=!0;var B=n&&Ae.toDOMRange(t,n);if(B){Qe.isBackward(n)?o.setBaseAndExtent(B.endContainer,B.endOffset,B.startContainer,B.startOffset):o.setBaseAndExtent(B.startContainer,B.startOffset,B.endContainer,B.endOffset);var N=B.startContainer.parentElement;if(!N.closest("[data-slate-spacer]")){N.getBoundingClientRect=B.getBoundingClientRect.bind(B);var U=document.body;(function(D,Q){var te=!D.ownerDocument.documentElement.contains(D);if(C3(Q)&&typeof Q.behavior=="function")return Q.behavior(te?[]:w3(D,Q));if(!te){var he=function(Ee){return Ee===!1?{block:"end",inline:"nearest"}:C3(Ee)?Ee:{block:"start",inline:"nearest"}}(Q);(function(Ee,ve){ve===void 0&&(ve="auto");var De="scrollBehavior"in document.body.style;Ee.forEach(function(Pe){var qe=Pe.el,ot=Pe.top,et=Pe.left;qe.scroll&&De?qe.scroll({top:ot,left:et,behavior:ve}):(qe.scrollTop=ot,qe.scrollLeft=et)})})(w3(D,he),he.behavior)}})(N,{scrollMode:"if-needed",boundary:i.scroll?s.parentElement:U,block:"end",behavior:"smooth"}),delete N.getBoundingClientRect}}else o.removeAllRanges();setTimeout(function(){B&&vf&&s.focus(),e.isUpdatingSelection=!1})}else t.selection=Ae.toSlateRange(t,o,{exactMatch:!1,suppressThrow:!1})}}}var $w=new WeakMap,D3=new WeakMap,Fq={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",splitBlock:"shift?+enter",undo:"mod+z",tab:"tab",selectAll:"mod+a"},Nq={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},jq={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},rn=function(e){var t=Fq[e],r=Nq[e],n=jq[e],i=t&&bx(t),o=r&&bx(r),a=n&&bx(n);return function(s){return!(!i||!i(s))||!!(ow&&o&&o(s))||!(ow||!a||!a(s))}},ln={isBold:rn("bold"),isCompose:rn("compose"),isMoveBackward:rn("moveBackward"),isMoveForward:rn("moveForward"),isDeleteBackward:rn("deleteBackward"),isDeleteForward:rn("deleteForward"),isDeleteLineBackward:rn("deleteLineBackward"),isDeleteLineForward:rn("deleteLineForward"),isDeleteWordBackward:rn("deleteWordBackward"),isDeleteWordForward:rn("deleteWordForward"),isExtendBackward:rn("extendBackward"),isExtendForward:rn("extendForward"),isExtendLineBackward:rn("extendLineBackward"),isExtendLineForward:rn("extendLineForward"),isItalic:rn("italic"),isMoveLineBackward:rn("moveLineBackward"),isMoveLineForward:rn("moveLineForward"),isMoveWordBackward:rn("moveWordBackward"),isMoveWordForward:rn("moveWordForward"),isRedo:rn("redo"),isSplitBlock:rn("splitBlock"),isTransposeCharacter:rn("transposeCharacter"),isUndo:rn("undo"),isTab:rn("tab"),isSelectAll:rn("selectAll")};function Pn(e){e.preventDefault()}var Uq={beforeinput:function(e,t,r){var n=e,i=r.getConfig().readOnly;if(yf&&!i&&ho(r,n.target)){var o=r.selection,a=n.inputType,s=n.dataTransfer||n.data||void 0;if(a!=="insertCompositionText"&&a!=="deleteCompositionText"){if(n.preventDefault(),!a.startsWith("delete")||a.startsWith("deleteBy")){var l=Tr(n.getTargetRanges(),1)[0];if(l){var u=Ae.toSlateRange(r,l,{exactMatch:!1,suppressThrow:!1});o&&Qe.equals(o,u)||Ve.select(r,u)}}if(o&&Qe.isExpanded(o)&&a.startsWith("delete")){var c=a.endsWith("Backward")?"backward":"forward";de.deleteFragment(r,{direction:c})}else switch(a){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":de.deleteFragment(r);break;case"deleteContent":case"deleteContentForward":de.deleteForward(r);break;case"deleteContentBackward":de.deleteBackward(r);break;case"deleteEntireSoftLine":de.deleteBackward(r,{unit:"line"}),de.deleteForward(r,{unit:"line"});break;case"deleteHardLineBackward":de.deleteBackward(r,{unit:"block"});break;case"deleteSoftLineBackward":de.deleteBackward(r,{unit:"line"});break;case"deleteHardLineForward":de.deleteForward(r,{unit:"block"});break;case"deleteSoftLineForward":de.deleteForward(r,{unit:"line"});break;case"deleteWordBackward":de.deleteBackward(r,{unit:"word"});break;case"deleteWordForward":de.deleteForward(r,{unit:"word"});break;case"insertLineBreak":case"insertParagraph":de.insertBreak(r);break;case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":if(a==="insertFromPaste"&&!rw.get(r))break;s instanceof DataTransfer?r.insertData(s):typeof s=="string"&&de.insertText(r,s)}}}},blur:function(e,t,r){var n=e,i=t.isUpdatingSelection,o=t.latestElement;if(!r.getConfig().readOnly&&!i&&ho(r,n.target)){var a=Ae.findDocumentOrShadowRoot(r);if(o!==a.activeElement){var s=n.relatedTarget;if(!(s===Ae.toDOMNode(r,r)||Po(s)&&s.hasAttribute("data-slate-spacer"))){if(s!=null&&iu(s)&&Ae.hasDOMNode(r,s)){var l=Ae.toSlateNode(r,s);if(Ut.isElement(l)&&!r.isVoid(l))return}if(mf){var u=a.getSelection();u==null||u.removeAllRanges()}nu.delete(r)}}}},focus:function(e,t,r){var n=Ae.toDOMNode(r,r),i=Ae.findDocumentOrShadowRoot(r);t.latestElement=i.activeElement,vf&&e.target!==n?n.focus():nu.set(r,!0)},click:function(e,t,r){if(!r.getConfig().readOnly&&Yc(r,e.target)&&iu(e.target)){var n=Ae.toSlateNode(r,e.target),i=Ae.findPath(r,n);if(de.hasPath(r,i)&&St.get(r,i)===n){var o=de.start(r,i),a=de.end(r,i),s=de.void(r,{at:o}),l=de.void(r,{at:a});if(s&&l&&Ue.equals(s[1],l[1])){var u=de.range(r,o);Ve.select(r,u)}}}},compositionstart:function(e,t,r){if(ho(r,e.target)){var n=r.selection;if(n&&Qe.isExpanded(n)&&(de.deleteFragment(r),Promise.resolve().then(function(){A3(t,r,!0)})),n&&Qe.isCollapsed(n)){var i=Ae.toDOMRange(r,n).startContainer,o=i.textContent||"";$w.set(r,o),D3.set(r,i)}t.isComposing=!0,function(a,s){var l;s.getConfig().placeholder&&s.isEmpty()&&a.showPlaceholder&&((l=a.$placeholder)===null||l===void 0||l.hide(),a.showPlaceholder=!1)}(t,r)}},compositionend:function(e,t,r){var n=e;if(ho(r,n.target)){t.isComposing=!1;var i=r.selection;if(i!=null){(aw||vf)&&Ae.cleanExposedTexNodeInSelectionBlock(r);for(var o=Qe.isBackward(i)?i.focus:i.anchor,a=Tr(de.node(r,[o.path[0]]),1)[0],s=0;s<o.path.length;s++){var l=Tr(de.node(r,o.path.slice(0,s+1)),1)[0];if(Ut.isElement(l)&&((mf||vf)&&l.type==="link"||l.type==="code")){Ae.setNewKey(a);break}}var u=n.data;if(u){if(r.getConfig().maxLength){var c=Ae.getLeftLengthOfMaxLength(r);c<u.length?(Ae.toDOMRange(r,i).startContainer.textContent=$w.get(r)||"",c>0&&de.insertText(r,u.slice(0,c)),t.changeViewState()):de.insertText(r,u)}else de.insertText(r,u);mf||setTimeout(function(){var h=r.selection;if(h!=null){var S=D3.get(r);S!=null&&Ae.toDOMRange(r,h).startContainer!==S&&(S.textContent=$w.get(r)||"")}})}}}},compositionupdate:function(e,t,r){ho(r,e.target)&&(t.isComposing=!0)},keydown:function(e,t,r){var n=e,i=r.selection;if(!r.getConfig().readOnly&&!t.isComposing&&ho(r,n.target)){if(function(a,s){var l=Im.get(a),u=l&&l.getMenus(),c=Mm.get(a),h=c&&c.getMenus(),S=lo(lo({},u),h);for(var y in S){var W=S[y],B=W.hotkey;if(B&&sX(B,s)&&!W.isDisabled(a)){var N=W.getValue(a);W.exec(a,N)}}}(r,n),ln.isTab(n))return Pn(n),void r.handleTab();if(ln.isRedo(n))return Pn(n),void(typeof r.redo=="function"&&r.redo());if(ln.isUndo(n))return Pn(n),void(typeof r.undo=="function"&&r.undo());if(ln.isMoveLineBackward(n))return Pn(n),void Ve.move(r,{unit:"line",reverse:!0});if(ln.isMoveLineForward(n))return Pn(n),void Ve.move(r,{unit:"line"});if(ln.isExtendLineBackward(n))return Pn(n),void Ve.move(r,{unit:"line",edge:"focus",reverse:!0});if(ln.isExtendLineForward(n))return Pn(n),void Ve.move(r,{unit:"line",edge:"focus"});if(ln.isMoveBackward(n))return Pn(n),void(i&&Qe.isCollapsed(i)?Ve.move(r,{reverse:!0}):Ve.collapse(r,{edge:"start"}));if(ln.isMoveForward(n))return Pn(n),void(i&&Qe.isCollapsed(i)?Ve.move(r):Ve.collapse(r,{edge:"end"}));if(ln.isMoveWordBackward(n))return Pn(n),i&&Qe.isExpanded(i)&&Ve.collapse(r,{edge:"focus"}),void Ve.move(r,{unit:"word",reverse:!0});if(ln.isMoveWordForward(n))return Pn(n),i&&Qe.isExpanded(i)&&Ve.collapse(r,{edge:"focus"}),void Ve.move(r,{unit:"word"});if(ln.isSelectAll(n))return Pn(n),void r.selectAll();if(yf){if((aw||mf)&&i&&(ln.isDeleteBackward(n)||ln.isDeleteForward(n))&&Qe.isCollapsed(i)){var o=St.parent(r,i.anchor.path);if(Ut.isElement(o)&&de.isVoid(r,o)&&de.isInline(r,o))return n.preventDefault(),void Ve.delete(r,{unit:"block"})}}else{if(ln.isBold(n)||ln.isItalic(n)||ln.isTransposeCharacter(n))return void Pn(n);if(ln.isSplitBlock(n))return Pn(n),void de.insertBreak(r);if(ln.isDeleteBackward(n))return Pn(n),void(i&&Qe.isExpanded(i)?de.deleteFragment(r,{direction:"backward"}):de.deleteBackward(r));if(ln.isDeleteForward(n))return Pn(n),void(i&&Qe.isExpanded(i)?de.deleteFragment(r,{direction:"forward"}):de.deleteForward(r));if(ln.isDeleteLineBackward(n))return Pn(n),void(i&&Qe.isExpanded(i)?de.deleteFragment(r,{direction:"backward"}):de.deleteBackward(r,{unit:"line"}));if(ln.isDeleteLineForward(n))return Pn(n),void(i&&Qe.isExpanded(i)?de.deleteFragment(r,{direction:"forward"}):de.deleteForward(r,{unit:"line"}));if(ln.isDeleteWordBackward(n))return Pn(n),void(i&&Qe.isExpanded(i)?de.deleteFragment(r,{direction:"backward"}):de.deleteBackward(r,{unit:"word"}));if(ln.isDeleteWordForward(n))return Pn(n),void(i&&Qe.isExpanded(i)?de.deleteFragment(r,{direction:"forward"}):de.deleteForward(r,{unit:"word"}))}}},keypress:function(e,t,r){if(!yf&&!r.getConfig().readOnly&&ho(r,e.target)){e.preventDefault();var n=e.key;de.insertText(r,n)}},copy:function(e,t,r){var n=e;if(ho(r,n.target)){n.preventDefault();var i=n.clipboardData;i!=null&&r.setFragmentData(i)}},cut:function(e,t,r){var n=e,i=r.selection;if(!r.getConfig().readOnly&&ho(r,n.target)){n.preventDefault();var o=n.clipboardData;if(o!=null&&(r.setFragmentData(o),i))if(Qe.isExpanded(i))de.deleteFragment(r);else{var a=St.parent(r,i.anchor.path);de.isVoid(r,a)&&Ve.delete(r)}}},paste:function(e,t,r){rw.set(r,!0);var n=e;if(!r.getConfig().readOnly&&ho(r,n.target)){var i=r.getConfig().customPaste;if(i&&i(r,n)===!1)return void rw.set(r,!1);if(!yf||function(a){return a.clipboardData&&a.clipboardData.getData("text/plain")!==""&&a.clipboardData.types.length===1}(n)){n.preventDefault();var o=n.clipboardData;o!=null&&r.insertData(o)}}},dragover:function(e,t,r){if(Yc(r,e.target)){var n=Ae.toSlateNode(r,e.target);de.isVoid(r,n)&&e.preventDefault()}},dragstart:function(e,t,r){var n=e;if(Yc(r,n.target)&&!r.getConfig().readOnly){var i=Ae.toSlateNode(r,n.target),o=Ae.findPath(r,i);if(de.isVoid(r,i)||de.void(r,{at:o,voids:!0})){var a=de.range(r,o);Ve.select(r,a)}var s=n.dataTransfer;s!=null&&(t.isDraggingInternally=!0,r.setFragmentData(s))}},dragend:function(e,t,r){var n=e;r.getConfig().readOnly||t.isDraggingInternally&&Yc(r,n.target)&&(t.isDraggingInternally=!1)},drop:function(e,t,r){var n=e,i=n.dataTransfer;if(!r.getConfig().readOnly&&Yc(r,n.target)&&i!=null&&!(yf&&mf&&i.files.length>0)){n.preventDefault();var o=r.selection,a=Ae.findEventRange(r,n);Ve.select(r,a),t.isDraggingInternally&&(o&&Ve.delete(r,{at:o}),t.isDraggingInternally=!1),r.insertData(i),r.isFocused()||r.focus()}}},Hq=1,zq=function(){function e(t){var r=this;this.id=Hq++,this.$textArea=null,this.$progressBar=_e('<div class="w-e-progress-bar"></div>'),this.$maxLengthInfo=_e('<div class="w-e-max-length-info"></div>'),this.isComposing=!1,this.isUpdatingSelection=!1,this.isDraggingInternally=!1,this.latestElement=null,this.showPlaceholder=!1,this.$placeholder=null,this.latestEditorSelection=null,this.onDOMSelectionChange=Hl(function(){var a=r.editorInstance;!function(s,l){var u=s.isComposing,c=s.isUpdatingSelection,h=s.isDraggingInternally;if(!(l.getConfig().readOnly||u||c||h)){var S=Ae.findDocumentOrShadowRoot(l),y=S.activeElement,W=Ae.toDOMNode(l,l),B=S.getSelection();if(y===W?(s.latestElement=y,nu.set(l,!0)):nu.delete(l),!B)return Ve.deselect(l);var N=B.anchorNode,U=B.focusNode,D=ho(l,N)||T3(l,N),Q=ho(l,U)||T3(l,U);if(D&&Q){var te=Ae.toSlateRange(l,B,{exactMatch:!1,suppressThrow:!1});Ve.select(l,te)}else Ve.deselect(l)}}(r,a)},100);var n=_e(t);if(n.length===0)throw new Error("Cannot find textarea DOM by selector '"+t+"'");this.$box=n;var i=_e('<div class="w-e-text-container"></div>');i.append(this.$progressBar),i.append(this.$maxLengthInfo),n.append(i);var o=_e('<div class="w-e-scroll"></div>');i.append(o),this.$scroll=o,this.$textAreaContainer=i,co(function(){var a=r.editorInstance,s=Ae.getWindow(a);s.document.addEventListener("selectionchange",r.onDOMSelectionChange),a.on("destroyed",function(){s.document.removeEventListener("selectionchange",r.onDOMSelectionChange)}),i.on("click",function(){return a.hidePanelOrModal()}),a.on("change",r.changeViewState.bind(r));var l=a.getConfig().onChange;l&&a.on("change",function(){return l(a)}),r.onFocusAndOnBlur(),a.on("change",r.changeMaxLengthInfo.bind(r)),r.bindEvent()})}return Object.defineProperty(e.prototype,"editorInstance",{get:function(){var t=XS.get(this);if(t==null)throw new Error("Can not get editor instance");return t},enumerable:!1,configurable:!0}),e.prototype.bindEvent=function(){var t=this,r=this.$textArea,n=this.$scroll,i=this.editorInstance;r!=null&&(sx(Uq,function(o,a){r.on(a,function(s){o(s,t,i)})}),i.getConfig().scroll&&(n.css("overflow-y","auto"),n.on("scroll",Hl(function(){i.emit("scroll")},100))))},e.prototype.onFocusAndOnBlur=function(){var t=this,r=this.editorInstance,n=r.getConfig(),i=n.onBlur,o=n.onFocus;this.latestEditorSelection=r.selection,r.on("change",function(){t.latestEditorSelection==null&&r.selection!=null?setTimeout(function(){return o&&o(r)}):t.latestEditorSelection!=null&&r.selection==null&&setTimeout(function(){return i&&i(r)}),t.latestEditorSelection=r.selection})},e.prototype.changeMaxLengthInfo=function(){var t=this.editorInstance,r=t.getConfig().maxLength;if(r){var n=r-Ae.getLeftLengthOfMaxLength(t);this.$maxLengthInfo[0].innerHTML=n+"/"+r}},e.prototype.changeProgress=function(t){var r=this.$progressBar;r.css("width",t+"%"),t>=100&&setTimeout(function(){r.hide(),r.css("width","0"),r.show()},1e3)},e.prototype.changeViewState=function(){var t=this,r=this.editorInstance;Bq(this,r),function(n,i){var o,a=i.getConfig().placeholder;if(a){var s=i.isEmpty();if(s&&!n.showPlaceholder&&!n.isComposing){if(n.$placeholder==null){var l=_e('<div class="w-e-text-placeholder">'+a+"</div>");n.$textAreaContainer.append(l),n.$placeholder=l}return n.$placeholder.show(),void(n.showPlaceholder=!0)}!s&&n.showPlaceholder&&((o=n.$placeholder)===null||o===void 0||o.hide(),n.showPlaceholder=!1)}}(this,r),co(function(){A3(t,r)})},e.prototype.destroy=function(){this.$textAreaContainer.remove()},e}();function Xw(e){e.removeAttr("width"),e.removeAttr("height"),e.removeAttr("fill"),e.removeAttr("class"),e.removeAttr("t"),e.removeAttr("p-id");var t=e.children();t.length&&Xw(t)}function Yw(){return _e('<svg viewBox="0 0 1024 1024"><path d="M498.7 655.8l-197.6-268c-8.1-10.9-0.3-26.4 13.3-26.4h395.2c13.6 0 21.4 15.4 13.3 26.4l-197.6 268c-6.6 9-20 9-26.6 0z"></path></svg>')}function O3(){return _e('<div class="w-e-bar-divider"></div>')}function _3(e,t,r,n,i){if(i===void 0&&(i=!1),t){if(n){var o=ow?"cmd":"ctrl";n=n.replace("mod",o)}if(i)n&&(e.attr("data-tooltip",n),e.addClass("w-e-menu-tooltip-v5"),e.addClass("tooltip-right"));else{var a=n?r+`
|
|
|
`+n:r;e.attr("data-tooltip",a),e.addClass("w-e-menu-tooltip-v5")}}}IS("match",function(e,t,r){return[function(n){var i=so(this),o=n==null?void 0:Jl(n,e);return o?Cr(o,n,i):new RegExp(n)[e]($r(i))},function(n){var i=Sn(this),o=$r(n),a=r(t,i,o);if(a.done)return a.value;if(!i.global)return cf(i,o);var s=i.unicode;i.lastIndex=0;for(var l,u=[],c=0;(l=cf(i,o))!==null;){var h=$r(l[0]);u[c]=h,h===""&&(i.lastIndex=MS(o,Rc(i.lastIndex),s)),c++}return c===0?null:u}]});var Zw=function(){function e(t,r,n){var i=this;n===void 0&&(n=!1),this.$elem=_e('<div class="w-e-bar-item"></div>'),this.$button=_e('<button type="button"></button>'),this.disabled=!1,this.menu=r;var o=r.tag,a=r.width;if(o!=="button")throw new Error("Invalid tag '"+o+"', expected 'button'");var s=r.title,l=r.hotkey,u=l===void 0?"":l,c=r.iconSvg,h=c===void 0?"":c,S=this.$button;if(h){var y=_e(h);Xw(y),S.append(y)}else S.text(s);_3(S,h,s,u,n),n&&h&&S.append(_e('<span class="title">'+s+"</span>")),a&&S.css("width",a+"px"),S.attr("data-menu-key",t),this.$elem.append(S),co(function(){return i.init()})}return e.prototype.init=function(){var t=this;this.setActive(),this.setDisabled(),this.$button.on("click",function(r){r.preventDefault(),Gi(t).hidePanelOrModal(),t.disabled||(t.exec(),t.onButtonClick())})},e.prototype.exec=function(){var t=Gi(this),r=this.menu,n=r.getValue(t);r.exec(t,n)},e.prototype.setActive=function(){var t=Gi(this),r=this.$button,n="active";this.menu.isActive(t)?r.addClass(n):r.removeClass(n)},e.prototype.setDisabled=function(){var t=Gi(this),r=this.$button,n=this.menu.isDisabled(t);(t.selection==null||t.isDisabled())&&(n=!0),this.menu.alwaysEnable&&(n=!1);var i="disabled";n?r.addClass(i):r.removeClass(i),this.disabled=n},e.prototype.changeMenuState=function(){this.setActive(),this.setDisabled()},e}(),Wq=function(e){function t(r,n,i){return i===void 0&&(i=!1),e.call(this,r,n,i)||this}return Fc(t,e),t.prototype.onButtonClick=function(){},t}(Zw),Jw=function(){function e(t){this.isShow=!1,this.showTime=0,this.record(t)}return e.prototype.record=function(t){var r=QS.get(t);r==null&&(r=new Set,QS.set(t,r)),r.add(this),Bm.set(this,t)},e.prototype.renderContent=function(t){var r=this.$elem;r.empty(),r.append(t);var n=this.genSelfElem();n&&r.append(n)},e.prototype.appendTo=function(t){var r=this.$elem;t.append(r)},e.prototype.show=function(){if(!this.isShow){this.showTime=Date.now(),this.$elem.show(),this.isShow=!0;var t=Bm.get(this);t&&t.emit("modalOrPanelShow",this)}},e.prototype.hide=function(){if(this.isShow&&!(Date.now()-this.showTime<200)){this.$elem.hide(),this.isShow=!1;var t=Bm.get(this);t&&t.emit("modalOrPanelHide")}},e}(),Gq=function(e){function t(r){var n=e.call(this,r)||this;return n.type="dropPanel",n.$elem=_e('<div class="w-e-drop-panel"></div>'),n}return Fc(t,e),t.prototype.genSelfElem=function(){return null},t}(Jw),Vq=function(e){function t(r,n,i){i===void 0&&(i=!1);var o=e.call(this,r,n,i)||this;if(o.dropPanel=null,o.menu=n,n.showDropPanel){var a=Yw();o.$button.append(a)}return o}return Fc(t,e),t.prototype.onButtonClick=function(){this.menu.showDropPanel&&this.handleDropPanel()},t.prototype.handleDropPanel=function(){var r=this.menu;if(r.getPanelContentElem!=null){var n=Gi(this);if(this.dropPanel==null){var i=new Gq(n),o=r.getPanelContentElem(n);i.renderContent(o),i.appendTo(this.$elem),i.show(),this.dropPanel=i}else{var a=this.dropPanel;a.isShow?a.hide():(o=r.getPanelContentElem(n),a.renderContent(o),a.show())}var s=this.dropPanel;if(s.isShow){var l=this.$elem,u=l.offset().left,c=l.parents(".w-e-bar");u-c.offset().left>=c.width()/2?s.$elem.css({left:"none",right:"0"}):s.$elem.css({left:"0",right:"none"})}}},t}(Zw),Kq=function(e){function t(r,n){n===void 0&&(n=0);var i=e.call(this,r)||this;i.type="modal",i.$elem=_e('<div class="w-e-modal"></div>'),i.width=0,n&&(i.width=n);var o=i.$elem;return o.on("click",function(a){return a.stopPropagation()}),o.on("keyup",function(a){a.code==="Escape"&&(i.hide(),r.restoreSelection())}),i}return Fc(t,e),t.prototype.genSelfElem=function(){var r=this,n=_e('<span class="btn-close"><svg viewBox="0 0 1024 1024"><path d="M1024 896.1024l-128 128L512 640 128 1024 0 896 384 512 0 128 128 0 512 384 896.1024 0l128 128L640 512z"></path></svg></span>'),i=Bm.get(this);return n.on("click",function(){r.hide(),i==null||i.restoreSelection()}),n},t.prototype.setStyle=function(r){var n=this.width,i=this.$elem;i.attr("style",""),n&&i.css("width",n+"px"),i.css(r)},t}(Jw);function Wi(e,t,r){var n=_e('<label class="babel-container"></label>');n.append("<span>"+e+"</span>");var i=_e('<input type="text" id="'+t+'" placeholder="'+(r||"")+'">');return n.append(i),[n[0],i[0]]}function Hye(e,t,r){var n=_e('<label class="babel-container"></label>');n.append("<span>"+e+"</span>");var i=_e('<textarea type="text" id="'+t+'" placeholder="'+(r||"")+'"></textarea>');return n.append(i),[n[0],i[0]]}function Zc(e,t){var r=_e('<div class="button-container"></div>'),n=_e('<button type="button" id="'+e+'">'+t+"</button>");return r.append(n),[r[0],n[0]]}var $q=function(e){function t(r,n,i){i===void 0&&(i=!1);var o=e.call(this,r,n,i)||this;return o.$body=_e("body"),o.modal=null,o.menu=n,o}return Fc(t,e),t.prototype.onButtonClick=function(){this.menu.showModal&&this.handleModal()},t.prototype.getPosition=function(){var r=Gi(this),n=this.menu.getModalPositionNode(r);return Ut.isElement(n)?Uw(r,n,"modal"):jw(r)},t.prototype.handleModal=function(){var r=Gi(this),n=this.menu;if(this.modal==null){var i=new Kq(r,n.modalWidth);this.renderAndShowModal(i,!0),this.modal=i}else(i=this.modal).isShow?i.hide():this.renderAndShowModal(i,!1)},t.prototype.renderAndShowModal=function(r,n){n===void 0&&(n=!1);var i=Gi(this),o=this.menu;if(o.getModalContentElem!=null){var a=Ae.getTextarea(i),s=Ae.getToolbar(i),l=((s==null?void 0:s.getConfig())||{}).modalAppendToBody,u=o.getModalContentElem(i);if(r.renderContent(u),l)r.setStyle({left:"0",right:"0"});else{var c=this.getPosition();r.setStyle(c)}n&&(l?r.appendTo(this.$body):r.appendTo(a.$textAreaContainer)),r.show(),l||Hw(i,r.$elem),setTimeout(function(){i.blur()})}},t}(Zw),Xq=function(e){function t(r,n){var i=e.call(this,r)||this;return i.type="selectList",i.$elem=_e('<div class="w-e-select-list"></div>'),n&&i.$elem.css("width",n+"px"),i.$elem.on("click",function(o){o.stopPropagation()}),i}return Fc(t,e),t.prototype.renderList=function(r){var n=this.$elem;n.empty();var i=_e("<ul></ul>");r.forEach(function(o){var a=o.value,s=o.text,l=o.selected,u=o.styleForRenderMenuList,c=_e('<li data-value="'+a+'"></li>');if(u&&c.css(u),l){var h=_e('<svg viewBox="0 0 1446 1024"><path d="M574.116299 786.736392 1238.811249 48.517862C1272.390222 11.224635 1329.414799 7.827718 1366.75664 41.450462 1403.840015 74.840484 1406.731043 132.084741 1373.10189 169.433699L655.118888 966.834607C653.072421 969.716875 650.835807 972.514337 648.407938 975.210759 615.017957 1012.29409 558.292155 1015.652019 521.195664 982.250188L72.778218 578.493306C35.910826 545.297758 32.859041 488.584019 66.481825 451.242134 99.871807 414.158803 156.597563 410.800834 193.694055 444.202665L574.116299 786.736392Z"></path></svg>');c.append(h),c.addClass("selected")}c.append(_e('<span data-value="'+a+'">'+s+"</span>")),c.attr("title",s),i.append(c)}),n.append(i)},t.prototype.genSelfElem=function(){return null},t}(Jw),Yq=function(){function e(t,r,n){var i=this;n===void 0&&(n=!1),this.$elem=_e('<div class="w-e-bar-item"></div>'),this.$button=_e('<button type="button" class="select-button"></button>'),this.disabled=!1,this.selectList=null;var o=r.tag,a=r.title,s=r.width,l=r.iconSvg,u=l===void 0?"":l,c=r.hotkey,h=c===void 0?"":c;if(o!=="select")throw new Error("Invalid tag '"+o+"', expected 'select'");var S=this.$button;s&&S.css("width",s+"px"),S.attr("data-menu-key",t),_3(S,u,a,h,n),this.$elem.append(S),this.menu=r,co(function(){return i.init()})}return e.prototype.init=function(){var t=this;this.setSelectedValue(),this.$button.on("click",function(r){r.preventDefault(),Gi(t).hidePanelOrModal(),t.trigger()})},e.prototype.trigger=function(){var t=this,r=Gi(this);if(!r.isDisabled()&&!this.disabled){var n=this.menu;if(this.selectList==null){this.selectList=new Xq(r,n.selectPanelWidth);var i=this.selectList,o=n.getOptions(r);i.renderList(o),i.appendTo(this.$elem),i.show(),i.$elem.on("click","li",function(a){var s=a.target;if(s!=null){a.preventDefault();var l=_e(s).attr("data-value");t.onChange(l)}})}else(i=this.selectList).isShow?i.hide():(o=n.getOptions(r),i.renderList(o),i.show())}},e.prototype.onChange=function(t){var r=Gi(this),n=this.menu;n.exec&&n.exec(r,t)},e.prototype.setSelectedValue=function(){var t=Gi(this),r=this.menu,n=r.getValue(t),i=function(s,l){for(var u=s.length,c="",h=0;h<u;h++){var S=s[h];if(S.value===l){c=S.text;break}}return c}(r.getOptions(t),n.toString()),o=this.$button,a=Yw();o.empty(),o.text(i),o.append(a)},e.prototype.setDisabled=function(){var t=Gi(this),r=this.menu.isDisabled(t),n=this.$button;(t.selection==null||t.isDisabled())&&(r=!0);var i="disabled";r?n.addClass(i):n.removeClass(i),this.disabled=r},e.prototype.changeMenuState=function(){this.setSelectedValue(),this.setDisabled()},e}(),R3=function(){function e(t){this.$elem=_e('<div class="w-e-bar-item w-e-bar-item-group"></div>'),this.$container=_e('<div class="w-e-bar-item-menus-container"></div>'),this.$button=_e('<button type="button"></button>');var r=t.key,n=t.iconSvg,i=t.title,o=this.$elem,a=this.$button;if(n){var s=_e(n);Xw(s),a.append(s)}else a.text(i);a.attr("data-menu-key",r);var l=Yw();a.append(l),o.append(a);var u=this.$container;o.append(u);var c=this.createObserver();this.observe(c)}return e.prototype.appendBarItem=function(t){var r=t.$elem;this.$container.append(r)},e.prototype.observe=function(t){var r=this.$container;t.observe(r[0],{childList:!0,subtree:!0,attributes:!0})},e.prototype.createObserver=function(){var t=this,r=this.$container,n=this.$button,i=new MutationObserver(function(){var o=r.find("button"),a=o.length;if(a!==0){var s=0;o.each(function(l){_e(l).hasClass("disabled")&&s++}),i.disconnect(),s===a?n.addClass("disabled"):n.removeClass("disabled"),t.observe(i)}});return i},e}(),k3=new WeakMap;function Gi(e){var t=JS.get(e);if(t==null)throw new Error("Can not get editor instance");return t}function L3(e,t,r){r===void 0&&(r=!1);var n=k3.get(t);if(n)return n;var i=t.tag;if(i==="button"){var o=t.showDropPanel,a=t.showModal;n=o?new Vq(e,t,r):a?new $q(e,t,r):new Wq(e,t,r)}if(i==="select"&&(n=new Yq(e,t,r)),n==null)throw new Error("Invalid tag in menu "+JSON.stringify(t));return k3.set(t,n),n}function Zq(e,t){var r=e.selection;return r!=null&&!Qe.isCollapsed(r)&&!Ae.getSelectedElems(e).some(function(n){if(e.isVoid(n))return!0;var i=n.type;return!!["pre","code","table"].includes(i)||void 0})&&!!Rt.isText(t)}var Jq=function(){function e(){var t=this;this.$elem=_e('<div class="w-e-bar w-e-bar-hidden w-e-hover-bar"></div>'),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null,this.isShow=!1,this.changeHoverbarState=eI(function(){var r=t.isShow,n=t.getSelectedNodeAndMenuKeys()||{},i=n.node,o=i===void 0?null:i,a=n.menuKeys,s=a===void 0?[]:a;o!=null&&t.changeItemsState(),o&&Ut.isElement(o)&&r&&t.isSamePath(o,t.prevSelectedNode)||(t.hideAndClean(),o!=null&&(t.registerItems(s),t.setPosition(o),t.show()),t.prevSelectedNode=o)},200),co(function(){var r=t.getEditorInstance(),n=t.$elem;n.on("mousedown",function(o){return o.preventDefault()},{passive:!1}),Ae.getTextarea(r).$textAreaContainer.append(n),r.on("change",t.changeHoverbarState);var i=t.hideAndClean.bind(t);r.on("scroll",i),r.on("fullScreen",i),r.on("unFullScreen",i)})}return e.prototype.getMenus=function(){return this.menus},e.prototype.hideAndClean=function(){var t=this.$elem;t.removeClass("w-e-bar-show").addClass("w-e-bar-hidden"),this.hoverbarItems=[],t.empty(),this.isShow=!1},e.prototype.checkPositionBottom=function(){var t=this.$elem,r=!1,n=window.innerHeight;n&&n>=360&&n-t[0].getBoundingClientRect().bottom<360&&(r=!0),r?t.addClass("w-e-bar-bottom"):t.removeClass("w-e-bar-bottom")},e.prototype.show=function(){this.$elem.removeClass("w-e-bar-hidden").addClass("w-e-bar-show"),this.isShow=!0,this.checkPositionBottom()},e.prototype.changeItemsState=function(){var t=this;co(function(){t.hoverbarItems.forEach(function(r){r.changeMenuState()})})},e.prototype.registerItems=function(t){var r=this,n=this.$elem;t.forEach(function(i){if(i!=="|")r.registerSingleItem(i);else{var o=O3();n.append(o)}})},e.prototype.registerSingleItem=function(t){var r=this.getEditorInstance(),n=this.menus,i=n[t];if(i==null){var o=bf[t];if(o==null)throw new Error("Not found menu item factory by key '"+t+"'");if(typeof o!="function")throw new Error("Menu item factory (key='"+t+"') is not a function");i=o(),n[t]=i}var a=L3(t,i);this.hoverbarItems.push(a),JS.set(a,r),this.$elem.append(a.$elem)},e.prototype.setPosition=function(t){var r=this.getEditorInstance(),n=this.$elem;if(n.attr("style",""),Ut.isElement(t)){var i=Uw(r,t,"bar");return n.css(i),void Hw(r,n)}if(Rt.isText(t))return i=jw(r),n.css(i),void Hw(r,n);throw new Error("hoverbar.setPosition error, current selected node is not elem nor text")},e.prototype.getSelectedNodeAndMenuKeys=function(){var t=this.getEditorInstance();if(t.selection==null)return null;var r=this.getHoverbarKeysConf(),n=null,i=[],o=function(s){var l=r[s],u=l.match,c=l.menuKeys,h=c===void 0?[]:c,S=u||function(B,N){return Ae.checkNodeType(N,s)},y=Tr(de.nodes(t,{match:function(B){return S(t,B)},universal:!0}),1),W=y[0];if(W!=null)return n=W[0],i=h,"break"};for(var a in r)if(o(a)==="break")break;return n==null||i.length===0?null:{node:n,menuKeys:i}},e.prototype.getEditorInstance=function(){var t=ZS.get(this);if(t==null)throw new Error("Can not get editor instance");return t},e.prototype.getHoverbarKeysConf=function(){var t=this.getEditorInstance().getConfig().hoverbarKeys,r=t===void 0?{}:t,n=r.text;return n&&n.match==null&&(n.match=Zq),r},e.prototype.isSamePath=function(t,r){if(t==null||r==null)return!1;var n=Ae.findPath(null,t),i=Ae.findPath(null,r);return Ue.equals(n,i)},e.prototype.destroy=function(){this.changeHoverbarState.cancel(),this.$elem.remove(),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null},e}();function P3(e,t,r,n){if(gf.set(e,t),jc.set(e,r),Ut.isElement(e)){var i=e.children;if((i===void 0?[]:i).forEach(function(s,l){return P3(s,l,e,n)}),de.isVoid(n,e)){var o=Tr(St.texts(e),1),a=Tr(o[0],1)[0];gf.set(a,0),jc.set(a,e)}}}function Qq(e){var t=e.selector,r=t===void 0?"":t,n=e.config,i=n===void 0?{}:n,o=e.content,a=e.html,s=e.plugins,l=s===void 0?[]:s,u=(U=>{var D=U,{apply:Q}=D;return D.history={undos:[],redos:[]},D.redo=()=>{var{history:te}=D,{redos:he}=te;if(he.length>0){var Ee=he[he.length-1];Ic.withoutSaving(D,()=>{de.withoutNormalizing(D,()=>{for(var ve of Ee)D.apply(ve)})}),te.redos.pop(),te.undos.push(Ee)}},D.undo=()=>{var{history:te}=D,{undos:he}=te;if(he.length>0){var Ee=he[he.length-1];Ic.withoutSaving(D,()=>{de.withoutNormalizing(D,()=>{var ve=Ee.map(ss.inverse).reverse();for(var De of ve)D.apply(De)})}),te.redos.push(Ee),te.undos.pop()}},D.apply=te=>{var{operations:he,history:Ee}=D,{undos:ve}=Ee,De=ve[ve.length-1],Pe=De&&De[De.length-1],qe=((dt,ht)=>!(!ht||dt.type!=="set_selection"||ht.type!=="set_selection"))(te,Pe),ot=Ic.isSaving(D),et=Ic.isMerging(D);if(ot==null&&(ot=((dt,ht)=>dt.type!=="set_selection"||dt.properties!=null&&dt.newProperties!=null)(te)),ot){if(et==null&&(et=De!=null&&(he.length!==0||((dt,ht)=>dt.type==="set_selection"||!(!ht||dt.type!=="insert_text"||ht.type!=="insert_text"||dt.offset!==ht.offset+ht.text.length||!Ue.equals(dt.path,ht.path))||!(!ht||dt.type!=="remove_text"||ht.type!=="remove_text"||dt.offset+dt.text.length!==ht.offset||!Ue.equals(dt.path,ht.path)))(te,Pe)||qe)),De&&et)qe&&De.pop(),De.push(te);else{var gt=[te];ve.push(gt)}for(;ve.length>100;)ve.shift();(dt=>dt.type!=="set_selection")(te)&&(Ee.redos=[])}Q(te)},D})(function(U){var D=U,Q=D.insertText,te=D.insertNode,he=D.insertFragment,Ee=D.dangerouslyInsertHtml;return D.insertText=function(ve){if(D.getConfig().maxLength){var De=Ae.getLeftLengthOfMaxLength(D);De<=0||(De<ve.length?Q(ve.slice(0,De)):Q(ve))}else Q(ve)},D.insertNode=function(ve){if(D.getConfig().maxLength){var De=Ae.getLeftLengthOfMaxLength(D);De<=0||De<St.string(ve).length||te(ve)}else te(ve)},D.insertFragment=function(ve){if(D.getConfig().maxLength)if(ve.length!==1)ve.forEach(function(Pe){D.insertNode(Pe)});else{var De=ve[0];if(Ae.getLeftLengthOfMaxLength(D)<St.string(De).length)return;he(ve)}else he(ve)},D.dangerouslyInsertHtml=function(ve,De){if(ve===void 0&&(ve=""),De===void 0&&(De=!1),ve)if(D.getConfig().maxLength){var Pe=Ae.getLeftLengthOfMaxLength(D);if(!(Pe<=0)){var qe=document.createElement("div");qe.innerHTML=ve;var ot=Array.from(qe.childNodes).reduce(function(et,gt){var dt=gt.nodeType,ht=gt.nodeName;return gt?dt===ta.TEXT_NODE?et+(gt.textContent||""):dt===ta.ELEMENT_NODE?l3.has(ht.toLowerCase())?et:et+(gt.textContent||""):et:et},"");Pe<ot.length||Ee(ve,De)}}else Ee(ve,De)},D}(function(U){var D=U;return D.on=function(Q,te){var he=Km(D);if(he.on(Q,te),Q==="destroyed"&&f3(D,te),Q!=="destroyed"){var Ee=function(){return he.off(Q,te)};he.on("destroyed",Ee),f3(D,Ee)}},D.once=function(Q,te){Km(D).once(Q,te)},D.off=function(Q,te){Km(D).off(Q,te)},D.emit=function(Q){for(var te=[],he=1;he<arguments.length;he++)te[he-1]=arguments[he];var Ee=Km(D);Ee.emit.apply(Ee,HS([Q],Tr(te))),Q==="destroyed"&&(Cq(D).forEach(function(ve){return Ee.off("destroyed",ve)}),Tq(D))},D}(function(U){var D=U;return D.select=function(Q){Ve.select(D,Q)},D.deselect=function(){var Q=D.selection,te=Ae.findDocumentOrShadowRoot(D).getSelection();te&&te.rangeCount>0&&te.removeAllRanges(),Q&&Ve.deselect(U)},D.move=function(Q,te){te===void 0&&(te=!1),Q&&(Q<0||Ve.move(U,{distance:Q,unit:"character",reverse:te}))},D.moveReverse=function(Q){D.move(Q,!0)},D.restoreSelection=function(){var Q=tw.get(D);Q!=null&&(D.focus(),Ve.select(D,Q))},D.getSelectionPosition=function(){return jw(D)},D.getNodePosition=function(Q){return Uw(D,Q)},D.isSelectedAll=function(){var Q=D.selection;if(Q==null)return!1;var te=Tr(Qe.edges(Q),2),he=te[0],Ee=te[1],ve=Tr(de.edges(D,[]),2),De=ve[0],Pe=ve[1];return!(!cr.equals(he,De)||!cr.equals(Ee,Pe))},D.selectAll=function(){var Q=de.start(D,[]),te=de.end(D,[]);Ve.select(D,{anchor:Q,focus:te})},D}(function(U){var D=U,Q=D.onChange,te=D.insertText,he=D.apply,Ee=D.deleteBackward;return D.insertText=function(ve){D.getConfig().readOnly||te(ve)},D.apply=function(ve){var De,Pe,qe,ot,et,gt,dt,ht,pt=[];switch(ve.type){case"insert_text":case"remove_text":case"set_node":try{for(var Dt=uo(de.levels(D,{at:ve.path})),Ft=Dt.next();!Ft.done;Ft=Dt.next()){var Bt=Tr(Ft.value,2),It=Bt[0],Re=Bt[1],Te=Ae.findKey(D,It);pt.push([Re,Te])}}catch(br){De={error:br}}finally{try{Ft&&!Ft.done&&(Pe=Dt.return)&&Pe.call(Dt)}finally{if(De)throw De.error}}break;case"insert_node":case"remove_node":case"merge_node":case"split_node":try{for(var Fe=uo(de.levels(D,{at:Ue.parent(ve.path)})),rt=Fe.next();!rt.done;rt=Fe.next()){var vt=Tr(rt.value,2);It=vt[0],Re=vt[1],Te=Ae.findKey(D,It),pt.push([Re,Te])}}catch(br){qe={error:br}}finally{try{rt&&!rt.done&&(ot=Fe.return)&&ot.call(Fe)}finally{if(qe)throw qe.error}}break;case"move_node":try{for(var ut=uo(de.levels(D,{at:Ue.common(Ue.parent(ve.path),Ue.parent(ve.newPath))})),kt=ut.next();!kt.done;kt=ut.next()){var Xt=Tr(kt.value,2);It=Xt[0],Re=Xt[1],Te=Ae.findKey(D,It),pt.push([Re,Te])}}catch(br){et={error:br}}finally{try{kt&&!kt.done&&(gt=ut.return)&>.call(ut)}finally{if(et)throw et.error}}}he(ve);try{for(var qt=uo(pt),or=qt.next();!or.done;or=qt.next()){var ft=Tr(or.value,2);Re=ft[0],Te=ft[1],It=Tr(de.node(D,Re),1)[0],jm.set(It,Te)}}catch(br){dt={error:br}}finally{try{or&&!or.done&&(ht=qt.return)&&ht.call(qt)}finally{if(dt)throw dt.error}}},D.deleteBackward=function(ve){if(ve!=="line")return Ee(ve);if(U.selection&&Qe.isCollapsed(U.selection)){var De=de.above(U,{match:function(et){return de.isBlock(U,et)},at:U.selection});if(De){var Pe=Tr(De,2)[1],qe=de.range(U,Pe,U.selection.anchor),ot=function(et,gt){var dt=de.range(et,Qe.end(gt)),ht=Array.from(de.positions(et,{at:gt})),pt=0,Dt=ht.length,Ft=Math.floor(Dt/2);if(X4(et,de.range(et,ht[pt]),dt))return de.range(et,ht[pt],dt);if(ht.length<2)return de.range(et,ht[ht.length-1],dt);for(;Ft!==ht.length&&Ft!==pt;)X4(et,de.range(et,ht[Ft]),dt)?Dt=Ft:pt=Ft,Ft=Math.floor((pt+Dt)/2);return de.range(et,ht[Dt],dt)}(D,qe);Qe.isCollapsed(ot)||Ve.delete(U,{at:ot})}}},D.onChange=function(){var ve=D.selection;ve!=null&&tw.set(D,ve),D.emit("change"),Q()},D.handleTab=function(){D.insertText(" ")},D.getHtml=function(){var ve=D.children;return(ve===void 0?[]:ve).map(function(De){return V4(De,D)}).join("")},D.getText=function(){var ve=D.children;return(ve===void 0?[]:ve).map(function(De){return St.string(De)}).join(`
|
|
|
`)},D.getSelectionText=function(){var ve=D.selection;return ve==null?"":de.string(U,ve)},D.getElemsByType=function(ve,De){var Pe,qe;De===void 0&&(De=!1);var ot=[],et=de.nodes(D,{at:[],universal:!0});try{for(var gt=uo(et),dt=gt.next();!dt.done;dt=gt.next()){var ht=Tr(dt.value,1)[0];if(Ut.isElement(ht)&&(De?ht.type.indexOf(ve)>=0:ht.type===ve)){var pt=K4(Ae.findKey(D,ht).id);ot.push(lo(lo({},ht),{id:pt}))}}}catch(Dt){Pe={error:Dt}}finally{try{dt&&!dt.done&&(qe=gt.return)&&qe.call(gt)}finally{if(Pe)throw Pe.error}}return ot},D.getElemsByTypePrefix=function(ve){return D.getElemsByType(ve,!0)},D.isEmpty=function(){var ve=D.children,De=ve===void 0?[]:ve;if(De.length>1)return!1;var Pe=De[0];if(Pe==null)return!0;if(Ut.isElement(Pe)&&Pe.type==="paragraph"){var qe=Pe.children,ot=qe===void 0?[]:qe;if(ot.length>1)return!1;var et=ot[0];if(et==null)return!0;if(Rt.isText(et)&&et.text==="")return!0}return!1},D.clear=function(){Ve.delete(D,{at:{anchor:de.start(D,[]),focus:de.end(D,[])}}),D.children.length===0&&Ve.insertNodes(D,[{type:"paragraph",children:[{text:""}]}])},D.getParentNode=function(ve){return Ae.getParentNode(D,ve)},D.dangerouslyInsertHtml=function(ve,De){if(ve===void 0&&(ve=""),De===void 0&&(De=!1),ve){var Pe=document.createElement("div");Pe.innerHTML=ve;var qe=Array.from(Pe.childNodes);if(qe=qe.filter(function(dt){var ht=dt.nodeType,pt=dt.nodeName;return ht===ta.TEXT_NODE||ht===ta.ELEMENT_NODE&&!l3.has(pt.toLowerCase())}),qe.length!==0){var ot=D.selection;if(ot!=null){var et=null;Ae.isSelectedEmptyParagraph(D)&&!De&&(et=[ot.focus.path[0]]),Pe.setAttribute("hidden","true"),document.body.appendChild(Pe);var gt=0;qe.forEach(function(dt){var ht=dt.nodeType,pt=dt.nodeName,Dt=dt.textContent,Ft=Dt===void 0?"":Dt;if(ht!==ta.TEXT_NODE)if(pt!=="BR"){var Bt=dt,It=!1;if(Y4.includes(pt.toLowerCase()))It=!0;else for(var Re in Wm)if(Bt.matches(Re)){It=!0;break}if(It){var Te=Pw(_e(Bt),D);return Array.isArray(Te)?(Te.forEach(function(rt){return u3(D,rt)}),gt++):(u3(D,Te),gt++),void(Ae.isSelectedVoidNode(D)&&D.move(1))}var Fe=window.getComputedStyle(Bt).display;Ae.isSelectedEmptyParagraph(D)||Fe.indexOf("inline")<0&&D.insertBreak(),D.dangerouslyInsertHtml(Bt.innerHTML,!0)}else D.insertText(`
|
|
|
`);else{if(!Ft||!Ft.trim())return;D.insertNode({text:Ft})}}),gt&&et&&Ae.isEmptyPath(D,et)&&Ve.removeNodes(D,{at:et}),Pe.remove()}}}},D.setHtml=function(ve){ve===void 0&&(ve="");var De=D.isDisabled(),Pe=D.isFocused(),qe=JSON.stringify(D.selection);D.enable(),D.focus(),D.clear();var ot=o3(D,ve);if(Ve.insertFragment(D,ot),Pe||(D.deselect(),D.blur()),De&&(D.deselect(),D.disable()),D.isFocused())try{D.select(JSON.parse(qe))}catch(et){D.select(de.start(D,[]))}},D}(function(U){var D=U;return D.getAllMenuKeys=function(){var Q=[];for(var te in bf)Q.push(te);return Q},D.getConfig=function(){var Q=r4.get(D);if(Q==null)throw new Error("Can not get editor config");return Q},D.getMenuConfig=function(Q){var te=D.getConfig().MENU_CONF;return(te===void 0?{}:te)[Q]||{}},D.alert=function(Q,te){te===void 0&&(te="info");var he=D.getConfig().customAlert;he&&he(Q,te)},D}(function(U){var D=dq(IV());return D.id="wangEditor-"+bQ++,D.isDestroyed=!1,D.isFullScreen=!1,D.focus=function(Q){if(Ae.toDOMNode(D,D).focus({preventScroll:!0}),nu.set(D,!0),Q){var te=de.end(D,[]);Ve.select(D,te)}else{var he=tw.get(D);he?Ve.select(D,he):Ve.select(D,de.start(D,[]))}},D.isFocused=function(){return!!nu.get(D)},D.blur=function(){Ae.toDOMNode(D,D).blur(),Ve.deselect(D),nu.set(D,!1)},D.updateView=function(){Ae.getTextarea(D).changeViewState();var Q=Ae.getToolbar(D);Q&&Q.changeToolbarState();var te=Ae.getHoverbar(D);te&&te.changeHoverbarState()},D.destroy=function(){if(!D.isDestroyed){var Q=Ae.getTextarea(D);Q.destroy(),$S.delete(D),XS.delete(Q);var te=Ae.getToolbar(D);te&&(te.destroy(),Im.delete(D),YS.delete(te));var he=Ae.getHoverbar(D);he&&(he.destroy(),Mm.delete(D),ZS.delete(he)),D.isDestroyed=!0,D.emit("destroyed")}},D.scrollToElem=function(Q){if(!D.getConfig().scroll){var te="\u7F16\u8F91\u5668\u7981\u7528\u4E86 scroll \uFF0C\u7F16\u8F91\u5668\u5185\u5BB9\u65E0\u6CD5\u6EDA\u52A8\uFF0C\u8BF7\u81EA\u884C\u5B9E\u73B0\u8BE5\u529F\u80FD";return te+=`
|
|
|
You has disabled editor scroll, please do this yourself`,void console.warn(te)}var he=_e("#"+Q);if(he.length!==0){var Ee=he[0];if(!Ae.hasDOMNode(D,Ee))return te="Element (found by id is '"+Q+"') is not in editor DOM",te+=`
|
|
|
\u901A\u8FC7 id '`+Q+"' \u627E\u5230\u7684 element \u4E0D\u5728 editor DOM \u4E4B\u5185",void console.error(te,Ee);var ve=Ae.getTextarea(D),De=ve.$textAreaContainer,Pe=ve.$scroll,qe=he.offset().top,ot=De.offset().top;Pe[0].scrollBy({top:qe-ot,behavior:"smooth"})}},D.showProgressBar=function(Q){Q<1||Ae.getTextarea(D).changeProgress(Q)},D.hidePanelOrModal=function(){var Q=QS.get(D);Q!=null&&Q.forEach(function(te){return te.hide()})},D.enable=function(){D.getConfig().readOnly=!1,D.updateView()},D.disable=function(){D.getConfig().readOnly=!0,D.updateView()},D.isDisabled=function(){return D.getConfig().readOnly},D.toDOMNode=function(Q){return Ae.toDOMNode(D,Q)},D.fullScreen=function(){if(!D.isFullScreen){var Q=null,te=Ae.getToolbar(D);te&&(Q=te.$box);var he=Ae.getTextarea(D).$box.parent();if(Q&&Q.parent()[0]!==he[0])throw new Error(`Can not set full screen, cause toolbar DOM parent is not equal to textarea DOM parent
|
|
|
\u4E0D\u80FD\u8BBE\u7F6E\u5168\u5C4F\uFF0C\u56E0\u4E3A toolbar DOM \u7236\u8282\u70B9\u548C textarea DOM \u7236\u8282\u70B9\u4E0D\u4E00\u81F4`);he.addClass("w-e-full-screen-container");var Ee=he.css("z-index");he.attr("data-z-index",Ee.toString()),D.isFullScreen=!0,D.emit("fullScreen")}},D.unFullScreen=function(){if(D.isFullScreen){var Q=Ae.getTextarea(D).$box.parent();setTimeout(function(){Q.removeClass("w-e-full-screen-container"),D.isFullScreen=!1,D.emit("unFullScreen")},200)}},D.getEditableContainer=function(){return Ae.getTextarea(D).$textAreaContainer[0]},D}()))))));if(r&&function(U,D){return i3(U,"data-w-e-textarea",D)}(u,r))throw new Error("Repeated create editor by selector '"+r+"'");var c=function(U){U===void 0&&(U={});var D=tI(p4),Q={},te=U.MENU_CONF,he=te===void 0?{}:te;return sx(D,function(Ee,ve){Q[ve]=lo(lo({},Ee),he[ve]||{})}),delete U.MENU_CONF,lo({scroll:!0,readOnly:!1,autoFocus:!0,decorate:function(){return[]},maxLength:0,MENU_CONF:Q,hoverbarKeys:{},customAlert:function(Ee,ve){window.alert(ve+`:
|
|
|
`+Ee)}},U)}(i);r4.set(u,c);var h=c.hoverbarKeys,S=h===void 0?{}:h;if(l.forEach(function(U){u=U(u)}),a!=null&&(u.children=o3(u,a)),o&&o.length&&(u.children=o),u.children.length===0&&(u.children=[{type:"paragraph",children:[{text:""}]}]),Ae.normalizeContent(u),r){var y=new zq(r);$S.set(u,y),XS.set(y,u),y.changeViewState(),co(function(){var U=y.$scroll;U!=null&&U.height()<300&&console.warn(`\u7F16\u8F91\u533A\u57DF\u9AD8\u5EA6 < 300px \u8FD9\u53EF\u80FD\u4F1A\u5BFC\u81F4 modal hoverbar \u5B9A\u4F4D\u5F02\u5E38
|
|
|
Textarea height < 300px . This may be cause modal and hoverbar position error`,U)});var W=void 0;Object.keys(S).length>0&&(W=new Jq,ZS.set(W,u),Mm.set(u,W)),u.on("change",function(){u.hidePanelOrModal()}),u.on("scroll",function(){u.hidePanelOrModal()})}else u.children.forEach(function(U,D){return P3(U,D,u,u)});var B=c.onCreated,N=c.onDestroyed;return B&&u.on("created",function(){return B(u)}),N&&u.on("destroyed",function(){return N(u)}),co(function(){return u.emit("created")}),u}var qq=wm("splice"),eee=yt.TypeError,tee=Math.max,ree=Math.min;sn({target:"Array",proto:!0,forced:!qq},{splice:function(e,t){var r,n,i,o,a,s,l=ms(this),u=eu(l),c=Lc(e,u),h=arguments.length;if(h===0?r=n=0:h===1?(r=0,n=u-c):(r=h-2,n=ree(tee(qh(t),0),u-c)),u+r-n>9007199254740991)throw eee("Maximum allowed length exceeded");for(i=eM(l,n),o=0;o<n;o++)(a=c+o)in l&&sf(i,o,l[a]);if(i.length=n,r<n){for(o=c;o<u-n;o++)s=o+r,(a=o+n)in l?l[s]=l[a]:delete l[s];for(o=u;o>u-n+r;o--)delete l[o-1]}else if(r>n)for(o=u-n;o>c;o--)s=o+r-1,(a=o+n-1)in l?l[s]=l[a]:delete l[s];for(o=0;o<r;o++)l[o+c]=arguments[o+2];return l.length=u-n+r,i}});var nee=function(){function e(t,r){var n=this;this.$toolbar=_e('<div class="w-e-bar w-e-bar-show w-e-toolbar"></div>'),this.menus={},this.toolbarItems=[],this.config={},this.changeToolbarState=eI(function(){n.toolbarItems.forEach(function(a){a.changeMenuState()})},200),this.config=r;var i=_e(t);if(i.length===0)throw new Error("Cannot find toolbar DOM by selector '"+t+"'");this.$box=i;var o=this.$toolbar;o.on("mousedown",function(a){return a.preventDefault()},{passive:!1}),i.append(o),co(function(){n.registerItems(),n.changeToolbarState(),n.getEditorInstance().on("change",n.changeToolbarState)})}return e.prototype.getMenus=function(){return this.menus},e.prototype.getConfig=function(){return this.config},e.prototype.registerItems=function(){var t=this,r="",n=this.$toolbar,i=this.config,o=i.toolbarKeys,a=o===void 0?[]:o,s=i.insertKeys,l=s===void 0?{index:0,keys:[]}:s,u=i.excludeKeys,c=u===void 0?[]:u,h=tI(a);l.keys.length>0&&(typeof l.keys=="string"&&(l.keys=[l.keys]),l.keys.forEach(function(W,B){h.splice(l.index+B,0,W)}));var S=h.filter(function(W){if(typeof W=="string"){if(c.includes(W))return!1}else if(c.includes(W.key))return!1;return!0}),y=S.length;S.forEach(function(W,B){if(W==="|"){if(B===0)return;if(B+1===y)return;if(r==="|")return;var N=O3();return n.append(N),void(r=W)}if(typeof W=="string")return t.registerSingleItem(W,t),void(r=W);t.registerGroup(W),r="group"})},e.prototype.registerGroup=function(t){var r=this,n=this.$toolbar,i=function(u){return new R3(u)}(t),o=t.menuKeys,a=o===void 0?[]:o,s=this.config.excludeKeys,l=s===void 0?[]:s;a.forEach(function(u){l.includes(u)||r.registerSingleItem(u,i)}),n.append(i.$elem)},e.prototype.registerSingleItem=function(t,r){var n=this.getEditorInstance(),i=r instanceof R3,o=this.menus,a=o[t];if(a==null){var s=bf[t];if(s==null)throw new Error("Not found menu item factory by key '"+t+"'");if(typeof s!="function")throw new Error("Menu item factory (key='"+t+"') is not a function");a=s(),o[t]=a}else console.warn("Duplicated toolbar menu key '"+t+`'
|
|
|
\u91CD\u590D\u6CE8\u518C\u4E86\u83DC\u5355\u680F menu '`+t+"'");var l=L3(t,a,i);this.toolbarItems.push(l),JS.set(l,n),i?r.appendBarItem(l):r.$toolbar.append(l.$elem)},e.prototype.getEditorInstance=function(){var t=YS.get(this);if(t==null)throw new Error("Can not get editor instance");return t},e.prototype.destroy=function(){this.$toolbar.remove(),this.menus={},this.toolbarItems=[]},e}(),iee=_c.EXISTS,oee=Ro.f,I3=Function.prototype,aee=Wt(I3.toString),M3=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,see=Wt(M3.exec);function B3(e){var t=e.server,r=t===void 0?"":t,n=e.fieldName,i=n===void 0?"":n,o=e.maxFileSize,a=o===void 0?10485760:o,s=e.maxNumberOfFiles,l=s===void 0?100:s,u=e.meta,c=u===void 0?{}:u,h=e.metaWithUrl,S=h!==void 0&&h,y=e.headers,W=y===void 0?{}:y,B=e.withCredentials,N=B!==void 0&&B,U=e.timeout,D=U===void 0?1e4:U,Q=e.onBeforeUpload,te=Q===void 0?function(gt){return gt}:Q,he=e.onSuccess,Ee=he===void 0?function(gt,dt){}:he,ve=e.onError,De=ve===void 0?function(gt,dt,ht){console.error(gt.name+" upload error",dt,ht)}:ve,Pe=e.onProgress,qe=Pe===void 0?function(gt){}:Pe;if(!r)throw new Error(`Cannot get upload server address
|
|
|
\u6CA1\u6709\u914D\u7F6E\u4E0A\u4F20\u5730\u5740`);if(!i)throw new Error(`Cannot get fieldName
|
|
|
\u6CA1\u6709\u914D\u7F6E fieldName`);var ot=r;S&&(ot=function(gt,dt){var ht=Tr(gt.split("#"),2),pt=ht[0],Dt=ht[1],Ft=[];sx(dt,function(It,Re){Ft.push(Re+"="+It)});var Bt=Ft.join("&");return pt=pt.indexOf("?")>0?pt+"&"+Bt:pt+"?"+Bt,Dt?pt+"#"+Dt:pt}(ot,c));var et=new Hh({onBeforeUpload:te,restrictions:{maxFileSize:a,maxNumberOfFiles:l},meta:c}).use(IY,{endpoint:ot,headers:W,formData:!0,fieldName:i,bundle:!0,withCredentials:N,timeout:D});return et.on("upload-success",function(gt,dt){var ht=dt.body,pt=ht===void 0?{}:ht;try{Ee(gt,pt)}catch(Dt){console.error("wangEditor upload file - onSuccess error",Dt)}et.removeFile(gt.id)}),et.on("progress",function(gt){gt<1||qe(gt)}),et.on("upload-error",function(gt,dt,ht){try{De(gt,dt,ht)}catch(pt){console.error("wangEditor upload file - onError error",pt)}et.removeFile(gt.id)}),et.on("restriction-failed",function(gt,dt){try{De(gt,dt)}catch(ht){console.error("wangEditor upload file - onError error",ht)}et.removeFile(gt.id)}),et}function ws(e){return ws=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ws(e)}function lee(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function In(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),n.forEach(function(i){lee(e,i,r[i])})}return e}function Ma(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F3(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ba(e,t,r){return t&&F3(e.prototype,t),r&&F3(e,r),e}function lu(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _f(e,t){if(t&&(ws(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lu(e)}function Jc(e){return Jc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Jc(e)}function Qw(e,t){return Qw=Object.setPrototypeOf||function(r,n){return r.__proto__=n,r},Qw(e,t)}function Ym(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Qw(e,t)}Zn&&!iee&&oee(I3,"name",{configurable:!0,get:function(){try{return see(M3,aee(this))[1]}catch(e){return""}}});var uee={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},Fa=new(function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ma(this,e),this.init(t,r)}return Ba(e,[{key:"init",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=t||uee,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(t){this.debug=t}},{key:"log",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"log","",!0)}},{key:"warn",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"warn","",!0)}},{key:"error",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"error","")}},{key:"deprecate",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(t,r,n,i){return i&&!this.debug?null:(typeof t[0]=="string"&&(t[0]="".concat(n).concat(this.prefix," ").concat(t[0])),this.logger[r](t))}},{key:"create",value:function(t){return new e(this.logger,In({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]),e}()),Cs=function(){function e(){Ma(this,e),this.observers={}}return Ba(e,[{key:"on",value:function(t,r){var n=this;return t.split(" ").forEach(function(i){n.observers[i]=n.observers[i]||[],n.observers[i].push(r)}),this}},{key:"off",value:function(t,r){this.observers[t]&&(r?this.observers[t]=this.observers[t].filter(function(n){return n!==r}):delete this.observers[t])}},{key:"emit",value:function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];if(this.observers[t]){var o=[].concat(this.observers[t]);o.forEach(function(s){s.apply(void 0,n)})}if(this.observers["*"]){var a=[].concat(this.observers["*"]);a.forEach(function(s){s.apply(s,[t].concat(n))})}}}]),e}();function Rf(){var e,t,r=new Promise(function(n,i){e=n,t=i});return r.resolve=e,r.reject=t,r}function N3(e){return e==null?"":""+e}function cee(e,t,r){e.forEach(function(n){t[n]&&(r[n]=t[n])})}function qw(e,t,r){function n(s){return s&&s.indexOf("###")>-1?s.replace(/###/g,"."):s}function i(){return!e||typeof e=="string"}for(var o=typeof t!="string"?[].concat(t):t.split(".");o.length>1;){if(i())return{};var a=n(o.shift());!e[a]&&r&&(e[a]=new r),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return i()?{}:{obj:e,k:n(o.shift())}}function j3(e,t,r){var n=qw(e,t,Object);n.obj[n.k]=r}function Zm(e,t){var r=qw(e,t),n=r.obj,i=r.k;if(n)return n[i]}function U3(e,t,r){var n=Zm(e,r);return n!==void 0?n:Zm(t,r)}function H3(e,t,r){for(var n in t)n!=="__proto__"&&n!=="constructor"&&(n in e?typeof e[n]=="string"||e[n]instanceof String||typeof t[n]=="string"||t[n]instanceof String?r&&(e[n]=t[n]):H3(e[n],t[n],r):e[n]=t[n]);return e}function Qc(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var dee={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function hee(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return dee[t]}):e}var Jm=typeof window!="undefined"&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1;function z3(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(e){if(e[t])return e[t];for(var n=t.split(r),i=e,o=0;o<n.length;++o){if(!i)return;if(typeof i[n[o]]=="string"&&o+1<n.length)return;if(i[n[o]]===void 0){for(var a=2,s=n.slice(o,o+a).join(r),l=i[s];l===void 0&&n.length>o+a;)a++,l=i[s=n.slice(o,o+a).join(r)];if(l===void 0)return;if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s];var u=n.slice(o+a).join(r);return u?z3(l,u,r):void 0}i=i[n[o]]}return i}}var fee=function(e){function t(r){var n,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Ma(this,t),n=_f(this,Jc(t).call(this)),Jm&&Cs.call(lu(n)),n.data=r||{},n.options=i,n.options.keySeparator===void 0&&(n.options.keySeparator="."),n.options.ignoreJSONStructure===void 0&&(n.options.ignoreJSONStructure=!0),n}return Ym(t,Cs),Ba(t,[{key:"addNamespaces",value:function(r){this.options.ns.indexOf(r)<0&&this.options.ns.push(r)}},{key:"removeNamespaces",value:function(r){var n=this.options.ns.indexOf(r);n>-1&&this.options.ns.splice(n,1)}},{key:"getResource",value:function(r,n,i){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,s=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure,l=[r,n];i&&typeof i!="string"&&(l=l.concat(i)),i&&typeof i=="string"&&(l=l.concat(a?i.split(a):i)),r.indexOf(".")>-1&&(l=r.split("."));var u=Zm(this.data,l);return u||!s||typeof i!="string"?u:z3(this.data&&this.data[r]&&this.data[r][n],i,a)}},{key:"addResource",value:function(r,n,i,o){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},s=this.options.keySeparator;s===void 0&&(s=".");var l=[r,n];i&&(l=l.concat(s?i.split(s):i)),r.indexOf(".")>-1&&(o=n,n=(l=r.split("."))[1]),this.addNamespaces(n),j3(this.data,l,o),a.silent||this.emit("added",r,n,i,o)}},{key:"addResources",value:function(r,n,i){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var a in i)typeof i[a]!="string"&&Object.prototype.toString.apply(i[a])!=="[object Array]"||this.addResource(r,n,a,i[a],{silent:!0});o.silent||this.emit("added",r,n,i)}},{key:"addResourceBundle",value:function(r,n,i,o,a){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},l=[r,n];r.indexOf(".")>-1&&(o=i,i=n,n=(l=r.split("."))[1]),this.addNamespaces(n);var u=Zm(this.data,l)||{};o?H3(u,i,a):u=In({},u,i),j3(this.data,l,u),s.silent||this.emit("added",r,n,i)}},{key:"removeResourceBundle",value:function(r,n){this.hasResourceBundle(r,n)&&delete this.data[r][n],this.removeNamespaces(n),this.emit("removed",r,n)}},{key:"hasResourceBundle",value:function(r,n){return this.getResource(r,n)!==void 0}},{key:"getResourceBundle",value:function(r,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?In({},{},this.getResource(r,n)):this.getResource(r,n)}},{key:"getDataByLanguage",value:function(r){return this.data[r]}},{key:"toJSON",value:function(){return this.data}}]),t}(),W3={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,r,n,i){var o=this;return e.forEach(function(a){o.processors[a]&&(t=o.processors[a].process(t,r,n,i))}),t}},G3={},V3=function(e){function t(r){var n,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Ma(this,t),n=_f(this,Jc(t).call(this)),Jm&&Cs.call(lu(n)),cee(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,lu(n)),n.options=i,n.options.keySeparator===void 0&&(n.options.keySeparator="."),n.logger=Fa.create("translator"),n}return Ym(t,Cs),Ba(t,[{key:"changeLanguage",value:function(r){r&&(this.language=r)}},{key:"exists",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(r==null)return!1;var i=this.resolve(r,n);return i&&i.res!==void 0}},{key:"extractFromKey",value:function(r,n){var i=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");var o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,a=n.ns||this.options.defaultNS;if(i&&r.indexOf(i)>-1){var s=r.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:r,namespaces:a};var l=r.split(i);(i!==o||i===o&&this.options.ns.indexOf(l[0])>-1)&&(a=l.shift()),r=l.join(o)}return typeof a=="string"&&(a=[a]),{key:r,namespaces:a}}},{key:"translate",value:function(r,n,i){var o=this;if(ws(n)!=="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),r==null)return"";Array.isArray(r)||(r=[String(r)]);var a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,s=this.extractFromKey(r[r.length-1],n),l=s.key,u=s.namespaces,c=u[u.length-1],h=n.lng||this.language,S=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(h&&h.toLowerCase()==="cimode"){if(S){var y=n.nsSeparator||this.options.nsSeparator;return c+y+l}return l}var W=this.resolve(r,n),B=W&&W.res,N=W&&W.usedKey||l,U=W&&W.exactUsedKey||l,D=Object.prototype.toString.apply(B),Q=["[object Number]","[object Function]","[object RegExp]"],te=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,he=!this.i18nFormat||this.i18nFormat.handleAsObject,Ee=typeof B!="string"&&typeof B!="boolean"&&typeof B!="number";if(he&&B&&Ee&&Q.indexOf(D)<0&&(typeof te!="string"||D!=="[object Array]")){if(!n.returnObjects&&!this.options.returnObjects)return this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(N,B,In({},n,{ns:u})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");if(a){var ve=D==="[object Array]",De=ve?[]:{},Pe=ve?U:N;for(var qe in B)if(Object.prototype.hasOwnProperty.call(B,qe)){var ot="".concat(Pe).concat(a).concat(qe);De[qe]=this.translate(ot,In({},n,{joinArrays:!1,ns:u})),De[qe]===ot&&(De[qe]=B[qe])}B=De}}else if(he&&typeof te=="string"&&D==="[object Array]")(B=B.join(te))&&(B=this.extendTranslation(B,r,n,i));else{var et=!1,gt=!1,dt=n.count!==void 0&&typeof n.count!="string",ht=t.hasDefaultValue(n),pt=dt?this.pluralResolver.getSuffix(h,n.count):"",Dt=n["defaultValue".concat(pt)]||n.defaultValue;!this.isValidLookup(B)&&ht&&(et=!0,B=Dt),this.isValidLookup(B)||(gt=!0,B=l);var Ft=n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,Bt=Ft&>?void 0:B,It=ht&&Dt!==B&&this.options.updateMissing;if(gt||et||It){if(this.logger.log(It?"updateKey":"missingKey",h,c,l,It?Dt:B),a){var Re=this.resolve(l,In({},n,{keySeparator:!1}));Re&&Re.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var Te=[],Fe=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Fe&&Fe[0])for(var rt=0;rt<Fe.length;rt++)Te.push(Fe[rt]);else this.options.saveMissingTo==="all"?Te=this.languageUtils.toResolveHierarchy(n.lng||this.language):Te.push(n.lng||this.language);var vt=function(ut,kt,Xt){o.options.missingKeyHandler?o.options.missingKeyHandler(ut,c,kt,It?Xt:Bt,It,n):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(ut,c,kt,It?Xt:Bt,It,n),o.emit("missingKey",ut,c,kt,B)};this.options.saveMissing&&(this.options.saveMissingPlurals&&dt?Te.forEach(function(ut){o.pluralResolver.getSuffixes(ut).forEach(function(kt){vt([ut],l+kt,n["defaultValue".concat(kt)]||Dt)})}):vt(Te,l,Dt))}B=this.extendTranslation(B,r,n,W,i),gt&&B===l&&this.options.appendNamespaceToMissingKey&&(B="".concat(c,":").concat(l)),(gt||et)&&this.options.parseMissingKeyHandler&&(B=this.options.parseMissingKeyHandler(B))}return B}},{key:"extendTranslation",value:function(r,n,i,o,a){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)r=this.i18nFormat.parse(r,i,o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init(In({},i,{interpolation:In({},this.options.interpolation,i.interpolation)}));var l,u=i.interpolation&&i.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;if(u){var c=r.match(this.interpolator.nestingRegexp);l=c&&c.length}var h=i.replace&&typeof i.replace!="string"?i.replace:i;if(this.options.interpolation.defaultVariables&&(h=In({},this.options.interpolation.defaultVariables,h)),r=this.interpolator.interpolate(r,h,i.lng||this.language,i),u){var S=r.match(this.interpolator.nestingRegexp);l<(S&&S.length)&&(i.nest=!1)}i.nest!==!1&&(r=this.interpolator.nest(r,function(){for(var B=arguments.length,N=new Array(B),U=0;U<B;U++)N[U]=arguments[U];return a&&a[0]===N[0]&&!i.context?(s.logger.warn("It seems you are nesting recursively key: ".concat(N[0]," in key: ").concat(n[0])),null):s.translate.apply(s,N.concat([n]))},i)),i.interpolation&&this.interpolator.reset()}var y=i.postProcess||this.options.postProcess,W=typeof y=="string"?[y]:y;return r!=null&&W&&W.length&&i.applyPostProcessor!==!1&&(r=W3.handle(W,r,n,this.options&&this.options.postProcessPassResolved?In({i18nResolved:o},i):i,this)),r}},{key:"resolve",value:function(r){var n,i,o,a,s,l=this,u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return typeof r=="string"&&(r=[r]),r.forEach(function(c){if(!l.isValidLookup(n)){var h=l.extractFromKey(c,u),S=h.key;i=S;var y=h.namespaces;l.options.fallbackNS&&(y=y.concat(l.options.fallbackNS));var W=u.count!==void 0&&typeof u.count!="string",B=u.context!==void 0&&(typeof u.context=="string"||typeof u.context=="number")&&u.context!=="",N=u.lngs?u.lngs:l.languageUtils.toResolveHierarchy(u.lng||l.language,u.fallbackLng);y.forEach(function(U){l.isValidLookup(n)||(s=U,!G3["".concat(N[0],"-").concat(U)]&&l.utils&&l.utils.hasLoadedNamespace&&!l.utils.hasLoadedNamespace(s)&&(G3["".concat(N[0],"-").concat(U)]=!0,l.logger.warn('key "'.concat(i,'" for languages "').concat(N.join(", "),`" won't get resolved as namespace "`).concat(s,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),N.forEach(function(D){if(!l.isValidLookup(n)){a=D;var Q,te,he=S,Ee=[he];for(l.i18nFormat&&l.i18nFormat.addLookupKeys?l.i18nFormat.addLookupKeys(Ee,S,D,U,u):(W&&(Q=l.pluralResolver.getSuffix(D,u.count)),W&&B&&Ee.push(he+Q),B&&Ee.push(he+="".concat(l.options.contextSeparator).concat(u.context)),W&&Ee.push(he+=Q));te=Ee.pop();)l.isValidLookup(n)||(o=te,n=l.getResource(D,U,te,u))}}))})}}),{res:n,usedKey:i,exactUsedKey:o,usedLng:a,usedNS:s}}},{key:"isValidLookup",value:function(r){return!(r===void 0||!this.options.returnNull&&r===null||!this.options.returnEmptyString&&r==="")}},{key:"getResource",value:function(r,n,i){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(r,n,i,o):this.resourceStore.getResource(r,n,i,o)}}],[{key:"hasDefaultValue",value:function(r){var n="defaultValue";for(var i in r)if(Object.prototype.hasOwnProperty.call(r,i)&&n===i.substring(0,n.length)&&r[i]!==void 0)return!0;return!1}}]),t}();function eC(e){return e.charAt(0).toUpperCase()+e.slice(1)}var pee=function(){function e(t){Ma(this,e),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Fa.create("languageUtils")}return Ba(e,[{key:"getScriptPartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return null;var r=t.split("-");return r.length===2?null:(r.pop(),r[r.length-1].toLowerCase()==="x"?null:this.formatLanguageCode(r.join("-")))}},{key:"getLanguagePartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return t;var r=t.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(t){if(typeof t=="string"&&t.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],n=t.split("-");return this.options.lowerCaseLng?n=n.map(function(i){return i.toLowerCase()}):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=eC(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!=="sgn"&&n[2].length===2&&(n[2]=n[2].toUpperCase()),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=eC(n[1].toLowerCase())),r.indexOf(n[2].toLowerCase())>-1&&(n[2]=eC(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isWhitelisted",value:function(t){return this.logger.deprecate("languageUtils.isWhitelisted",`function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it's usage asap.`),this.isSupportedCode(t)}},{key:"isSupportedCode",value:function(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function(t){var r,n=this;return t?(t.forEach(function(i){if(!r){var o=n.formatLanguageCode(i);n.options.supportedLngs&&!n.isSupportedCode(o)||(r=o)}}),!r&&this.options.supportedLngs&&t.forEach(function(i){if(!r){var o=n.getLanguagePartFromCode(i);if(n.isSupportedCode(o))return r=o;r=n.options.supportedLngs.find(function(a){if(a.indexOf(o)===0)return a})}}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r):null}},{key:"getFallbackCodes",value:function(t,r){if(!t)return[];if(typeof t=="function"&&(t=t(r)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!r)return t.default||[];var n=t[r];return n||(n=t[this.getScriptPartFromCode(r)]),n||(n=t[this.formatLanguageCode(r)]),n||(n=t[this.getLanguagePartFromCode(r)]),n||(n=t.default),n||[]}},{key:"toResolveHierarchy",value:function(t,r){var n=this,i=this.getFallbackCodes(r||this.options.fallbackLng||[],t),o=[],a=function(s){s&&(n.isSupportedCode(s)?o.push(s):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(s)))};return typeof t=="string"&&t.indexOf("-")>-1?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(t))):typeof t=="string"&&a(this.formatLanguageCode(t)),i.forEach(function(s){o.indexOf(s)<0&&a(n.formatLanguageCode(s))}),o}}]),e}(),gee=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],vee={1:function(e){return Number(e>1)},2:function(e){return Number(e!=1)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(e==1?0:e>=2&&e<=4?1:2)},7:function(e){return Number(e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(e==1?0:e==2?1:e!=8&&e!=11?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(e==1?0:e==2?1:e<7?2:e<11?3:4)},11:function(e){return Number(e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(e!==0)},14:function(e){return Number(e==1?0:e==2?1:e==3?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:e!==0?1:2)},17:function(e){return Number(e==1||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(e==0?0:e==1?1:2)},19:function(e){return Number(e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(e==1?0:e==0||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3)}};function mee(){var e={};return gee.forEach(function(t){t.lngs.forEach(function(r){e[r]={numbers:t.nr,plurals:vee[t.fc]}})}),e}var yee=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ma(this,e),this.languageUtils=t,this.options=r,this.logger=Fa.create("pluralResolver"),this.rules=mee()}return Ba(e,[{key:"addRule",value:function(t,r){this.rules[t]=r}},{key:"getRule",value:function(t){return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function(t){var r=this.getRule(t);return r&&r.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(t,r){return this.getSuffixes(t).map(function(n){return r+n})}},{key:"getSuffixes",value:function(t){var r=this,n=this.getRule(t);return n?n.numbers.map(function(i){return r.getSuffix(t,i)}):[]}},{key:"getSuffix",value:function(t,r){var n=this,i=this.getRule(t);if(i){var o=i.noAbs?i.plurals(r):i.plurals(Math.abs(r)),a=i.numbers[o];this.options.simplifyPluralSuffix&&i.numbers.length===2&&i.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));var s=function(){return n.options.prepend&&a.toString()?n.options.prepend+a.toString():a.toString()};return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?"_plural_".concat(a.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&i.numbers.length===2&&i.numbers[0]===1?s():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}return this.logger.warn("no plural rule found for: ".concat(t)),""}}]),e}(),bee=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ma(this,e),this.logger=Fa.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(r){return r},this.init(t)}return Ba(e,[{key:"init",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var r=t.interpolation;this.escape=r.escape!==void 0?r.escape:hee,this.escapeValue=r.escapeValue===void 0||r.escapeValue,this.useRawValueToEscape=r.useRawValueToEscape!==void 0&&r.useRawValueToEscape,this.prefix=r.prefix?Qc(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Qc(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?Qc(r.nestingPrefix):r.nestingPrefixEscaped||Qc("$t("),this.nestingSuffix=r.nestingSuffix?Qc(r.nestingSuffix):r.nestingSuffixEscaped||Qc(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0&&r.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(t,r,n,i){var o,a,s,l=this,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(B){return B.replace(/\$/g,"$$$$")}var h=function(B){if(B.indexOf(l.formatSeparator)<0){var N=U3(r,u,B);return l.alwaysFormat?l.format(N,void 0,n,In({},i,r,{interpolationkey:B})):N}var U=B.split(l.formatSeparator),D=U.shift().trim(),Q=U.join(l.formatSeparator).trim();return l.format(U3(r,u,D),Q,n,In({},i,r,{interpolationkey:D}))};this.resetRegExp();var S=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,y=i&&i.interpolation&&i.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables,W=[{regex:this.regexpUnescape,safeValue:function(B){return c(B)}},{regex:this.regexp,safeValue:function(B){return l.escapeValue?c(l.escape(B)):c(B)}}];return W.forEach(function(B){for(s=0;o=B.regex.exec(t);){if((a=h(o[1].trim()))===void 0)if(typeof S=="function"){var N=S(t,o,i);a=typeof N=="string"?N:""}else{if(y){a=o[0];continue}l.logger.warn("missed to pass in variable ".concat(o[1]," for interpolating ").concat(t)),a=""}else typeof a=="string"||l.useRawValueToEscape||(a=N3(a));var U=B.safeValue(a);if(t=t.replace(o[0],U),y?(B.regex.lastIndex+=U.length,B.regex.lastIndex-=o[0].length):B.regex.lastIndex=0,++s>=l.maxReplaces)break}}),t}},{key:"nest",value:function(t,r){var n,i,o=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=In({},a);function l(S,y){var W=this.nestingOptionsSeparator;if(S.indexOf(W)<0)return S;var B=S.split(new RegExp("".concat(W,"[ ]*{"))),N="{".concat(B[1]);S=B[0],N=(N=this.interpolate(N,s)).replace(/'/g,'"');try{s=JSON.parse(N),y&&(s=In({},y,s))}catch(U){return this.logger.warn("failed parsing options string in nesting for key ".concat(S),U),"".concat(S).concat(W).concat(N)}return delete s.defaultValue,S}for(s.applyPostProcessor=!1,delete s.defaultValue;n=this.nestingRegexp.exec(t);){var u=[],c=!1;if(n[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(n[1])){var h=n[1].split(this.formatSeparator).map(function(S){return S.trim()});n[1]=h.shift(),u=h,c=!0}if((i=r(l.call(this,n[1].trim(),s),s))&&n[0]===t&&typeof i!="string")return i;typeof i!="string"&&(i=N3(i)),i||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(t)),i=""),c&&(i=u.reduce(function(S,y){return o.format(S,y,a.lng,In({},a,{interpolationkey:n[1].trim()}))},i.trim())),t=t.replace(n[0],i),this.regexp.lastIndex=0}return t}}]),e}(),Eee=function(e){function t(r,n,i){var o,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return Ma(this,t),o=_f(this,Jc(t).call(this)),Jm&&Cs.call(lu(o)),o.backend=r,o.store=n,o.services=i,o.languageUtils=i.languageUtils,o.options=a,o.logger=Fa.create("backendConnector"),o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(i,a.backend,a),o}return Ym(t,Cs),Ba(t,[{key:"queueLoad",value:function(r,n,i,o){var a=this,s=[],l=[],u=[],c=[];return r.forEach(function(h){var S=!0;n.forEach(function(y){var W="".concat(h,"|").concat(y);!i.reload&&a.store.hasResourceBundle(h,y)?a.state[W]=2:a.state[W]<0||(a.state[W]===1?l.indexOf(W)<0&&l.push(W):(a.state[W]=1,S=!1,l.indexOf(W)<0&&l.push(W),s.indexOf(W)<0&&s.push(W),c.indexOf(y)<0&&c.push(y)))}),S||u.push(h)}),(s.length||l.length)&&this.queue.push({pending:l,loaded:{},errors:[],callback:o}),{toLoad:s,pending:l,toLoadLanguages:u,toLoadNamespaces:c}}},{key:"loaded",value:function(r,n,i){var o=r.split("|"),a=o[0],s=o[1];n&&this.emit("failedLoading",a,s,n),i&&this.store.addResourceBundle(a,s,i),this.state[r]=n?-1:2;var l={};this.queue.forEach(function(u){!function(c,h,S,y){var W=qw(c,h,Object),B=W.obj,N=W.k;B[N]=B[N]||[],B[N].push(S)}(u.loaded,[a],s),function(c,h){for(var S=c.indexOf(h);S!==-1;)c.splice(S,1),S=c.indexOf(h)}(u.pending,r),n&&u.errors.push(n),u.pending.length!==0||u.done||(Object.keys(u.loaded).forEach(function(c){l[c]||(l[c]=[]),u.loaded[c].length&&u.loaded[c].forEach(function(h){l[c].indexOf(h)<0&&l[c].push(h)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(function(u){return!u.done})}},{key:"read",value:function(r,n,i){var o=this,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:350,l=arguments.length>5?arguments[5]:void 0;return r.length?this.backend[i](r,n,function(u,c){u&&c&&a<5?setTimeout(function(){o.read.call(o,r,n,i,a+1,2*s,l)},s):l(u,c)}):l(null,{})}},{key:"prepareLoading",value:function(r,n){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();typeof r=="string"&&(r=this.languageUtils.toResolveHierarchy(r)),typeof n=="string"&&(n=[n]);var s=this.queueLoad(r,n,o,a);if(!s.toLoad.length)return s.pending.length||a(),null;s.toLoad.forEach(function(l){i.loadOne(l)})}},{key:"load",value:function(r,n,i){this.prepareLoading(r,n,{},i)}},{key:"reload",value:function(r,n,i){this.prepareLoading(r,n,{reload:!0},i)}},{key:"loadOne",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",o=r.split("|"),a=o[0],s=o[1];this.read(a,s,"read",void 0,void 0,function(l,u){l&&n.logger.warn("".concat(i,"loading namespace ").concat(s," for language ").concat(a," failed"),l),!l&&u&&n.logger.log("".concat(i,"loaded namespace ").concat(s," for language ").concat(a),u),n.loaded(r,l,u)})}},{key:"saveMissing",value:function(r,n,i,o,a){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)?this.logger.warn('did not save key "'.concat(i,'" as the namespace "').concat(n,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):i!=null&&i!==""&&(this.backend&&this.backend.create&&this.backend.create(r,n,i,o,null,In({},s,{isUpdate:a})),r&&r[0]&&this.store.addResource(r[0],n,i,o))}}]),t}();function xee(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if(ws(e[1])==="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),ws(e[2])==="object"||ws(e[3])==="object"){var r=e[3]||e[2];Object.keys(r).forEach(function(n){t[n]=r[n]})}return t},interpolation:{escapeValue:!0,format:function(e,t,r,n){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function K3(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supportedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Qm(){}var See=function(e){function t(){var r,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(Ma(this,t),r=_f(this,Jc(t).call(this)),Jm&&Cs.call(lu(r)),r.options=K3(n),r.services={},r.logger=Fa,r.modules={external:[]},i&&!r.isInitialized&&!n.isClone){if(!r.options.initImmediate)return r.init(n,i),_f(r,lu(r));setTimeout(function(){r.init(n,i)},0)}return r}return Ym(t,Cs),Ba(t,[{key:"init",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;function o(y){return y?typeof y=="function"?new y:y:null}if(typeof n=="function"&&(i=n,n={}),n.whitelist&&!n.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),n.nonExplicitWhitelist&&!n.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=In({},xee(),this.options,K3(n)),this.format=this.options.interpolation.format,i||(i=Qm),!this.options.isClone){this.modules.logger?Fa.init(o(this.modules.logger),this.options):Fa.init(null,this.options);var a=new pee(this.options);this.store=new fee(this.options.resources,this.options);var s=this.services;s.logger=Fa,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new yee(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),s.interpolator=new bee(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new Eee(o(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",function(y){for(var W=arguments.length,B=new Array(W>1?W-1:0),N=1;N<W;N++)B[N-1]=arguments[N];r.emit.apply(r,[y].concat(B))}),this.modules.languageDetector&&(s.languageDetector=o(this.modules.languageDetector),s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=o(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new V3(this.services,this.options),this.translator.on("*",function(y){for(var W=arguments.length,B=new Array(W>1?W-1:0),N=1;N<W;N++)B[N-1]=arguments[N];r.emit.apply(r,[y].concat(B))}),this.modules.external.forEach(function(y){y.init&&y.init(r)})}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var u=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];u.forEach(function(y){r[y]=function(){var W;return(W=r.store)[y].apply(W,arguments)}});var c=["addResource","addResources","addResourceBundle","removeResourceBundle"];c.forEach(function(y){r[y]=function(){var W;return(W=r.store)[y].apply(W,arguments),r}});var h=Rf(),S=function(){var y=function(W,B){r.isInitialized&&!r.initializedStoreOnce&&r.logger.warn("init: i18next is already initialized. You should call init just once!"),r.isInitialized=!0,r.options.isClone||r.logger.log("initialized",r.options),r.emit("initialized",r.options),h.resolve(B),i(W,B)};if(r.languages&&r.options.compatibilityAPI!=="v1"&&!r.isInitialized)return y(null,r.t.bind(r));r.changeLanguage(r.options.lng,y)};return this.options.resources||!this.options.initImmediate?S():setTimeout(S,0),h}},{key:"loadResources",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Qm,o=i,a=typeof r=="string"?r:this.language;if(typeof r=="function"&&(o=r),!this.options.resources||this.options.partialBundledLanguages){if(a&&a.toLowerCase()==="cimode")return o();var s=[],l=function(c){c&&n.services.languageUtils.toResolveHierarchy(c).forEach(function(h){s.indexOf(h)<0&&s.push(h)})};if(a)l(a);else{var u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.forEach(function(c){return l(c)})}this.options.preload&&this.options.preload.forEach(function(c){return l(c)}),this.services.backendConnector.load(s,this.options.ns,o)}else o(null)}},{key:"reloadResources",value:function(r,n,i){var o=Rf();return r||(r=this.languages),n||(n=this.options.ns),i||(i=Qm),this.services.backendConnector.reload(r,n,function(a){o.resolve(),i(a)}),o}},{key:"use",value:function(r){if(!r)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!r.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return r.type==="backend"&&(this.modules.backend=r),(r.type==="logger"||r.log&&r.warn&&r.error)&&(this.modules.logger=r),r.type==="languageDetector"&&(this.modules.languageDetector=r),r.type==="i18nFormat"&&(this.modules.i18nFormat=r),r.type==="postProcessor"&&W3.addPostProcessor(r),r.type==="3rdParty"&&this.modules.external.push(r),this}},{key:"changeLanguage",value:function(r,n){var i=this;this.isLanguageChangingTo=r;var o=Rf();this.emit("languageChanging",r);var a=function(s){r||s||!i.services.languageDetector||(s=[]);var l=typeof s=="string"?s:i.services.languageUtils.getBestMatchFromCodes(s);l&&(i.language||(i.language=l,i.languages=i.services.languageUtils.toResolveHierarchy(l)),i.translator.language||i.translator.changeLanguage(l),i.services.languageDetector&&i.services.languageDetector.cacheUserLanguage(l)),i.loadResources(l,function(u){!function(c,h){h?(i.language=h,i.languages=i.services.languageUtils.toResolveHierarchy(h),i.translator.changeLanguage(h),i.isLanguageChangingTo=void 0,i.emit("languageChanged",h),i.logger.log("languageChanged",h)):i.isLanguageChangingTo=void 0,o.resolve(function(){return i.t.apply(i,arguments)}),n&&n(c,function(){return i.t.apply(i,arguments)})}(u,l)})};return r||!this.services.languageDetector||this.services.languageDetector.async?!r&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(a):a(r):a(this.services.languageDetector.detect()),o}},{key:"getFixedT",value:function(r,n,i){var o=this,a=function s(l,u){var c;if(ws(u)!=="object"){for(var h=arguments.length,S=new Array(h>2?h-2:0),y=2;y<h;y++)S[y-2]=arguments[y];c=o.options.overloadTranslationOptionHandler([l,u].concat(S))}else c=In({},u);c.lng=c.lng||s.lng,c.lngs=c.lngs||s.lngs,c.ns=c.ns||s.ns;var W=o.options.keySeparator||".",B=i?"".concat(i).concat(W).concat(l):l;return o.t(B,c)};return typeof r=="string"?a.lng=r:a.lngs=r,a.ns=n,a.keyPrefix=i,a}},{key:"t",value:function(){var r;return this.translator&&(r=this.translator).translate.apply(r,arguments)}},{key:"exists",value:function(){var r;return this.translator&&(r=this.translator).exists.apply(r,arguments)}},{key:"setDefaultNamespace",value:function(r){this.options.defaultNS=r}},{key:"hasLoadedNamespace",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var o=this.languages[0],a=!!this.options&&this.options.fallbackLng,s=this.languages[this.languages.length-1];if(o.toLowerCase()==="cimode")return!0;var l=function(c,h){var S=n.services.backendConnector.state["".concat(c,"|").concat(h)];return S===-1||S===2};if(i.precheck){var u=i.precheck(this,l);if(u!==void 0)return u}return!!this.hasResourceBundle(o,r)||!this.services.backendConnector.backend||!(!l(o,r)||a&&!l(s,r))}},{key:"loadNamespaces",value:function(r,n){var i=this,o=Rf();return this.options.ns?(typeof r=="string"&&(r=[r]),r.forEach(function(a){i.options.ns.indexOf(a)<0&&i.options.ns.push(a)}),this.loadResources(function(a){o.resolve(),n&&n(a)}),o):(n&&n(),Promise.resolve())}},{key:"loadLanguages",value:function(r,n){var i=Rf();typeof r=="string"&&(r=[r]);var o=this.options.preload||[],a=r.filter(function(s){return o.indexOf(s)<0});return a.length?(this.options.preload=o.concat(a),this.loadResources(function(s){i.resolve(),n&&n(s)}),i):(n&&n(),Promise.resolve())}},{key:"dir",value:function(r){return r||(r=this.languages&&this.languages.length>0?this.languages[0]:this.language),r?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(r))>=0?"rtl":"ltr":"rtl"}},{key:"createInstance",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new t(r,n)}},{key:"cloneInstance",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Qm,o=In({},this.options,n,{isClone:!0}),a=new t(o),s=["store","services","language"];return s.forEach(function(l){a[l]=r[l]}),a.services=In({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a.translator=new V3(a.services,a.options),a.translator.on("*",function(l){for(var u=arguments.length,c=new Array(u>1?u-1:0),h=1;h<u;h++)c[h-1]=arguments[h];a.emit.apply(a,[l].concat(c))}),a.init(o,i),a.translator.options=a.options,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages}}}]),t}(),qc=new See;function Ri(e,t){qc.addResourceBundle(e,"translation",t,!0,!0)}function zye(e){qc.changeLanguage(e)}function Wye(e){return qc.getResourceBundle(e,"translation")}qc.init({lng:"zh-CN",resources:{}});var wt=qc.t.bind(qc);Ri("en",{editor:{more:"More",justify:"Justify",indent:"Indent",image:"Image",video:"Video"}}),Ri("zh-CN",{editor:{more:"\u66F4\u591A",justify:"\u5BF9\u9F50",indent:"\u7F29\u8FDB",image:"\u56FE\u7247",video:"\u89C6\u9891"}});var wee=X1?{}.toString:function(){return"[object "+pv(this)+"]"};X1||rs(Object.prototype,"toString",wee,{unsafe:!0});var $3=Array.isArray||function(e){return Ol(e)=="Array"},X3=function(){},Cee=[],Y3=dh("Reflect","construct"),tC=/^\s*(?:class|function)\b/,Tee=Gr(tC.exec),Aee=!tC.exec(X3),kf=function(e){if(!On(e))return!1;try{return Y3(X3,Cee,e),!0}catch(t){return!1}},Dee=!Y3||Xn(function(){var e;return kf(kf.call)||!kf(Object)||!kf(function(){e=!0})||e})?function(e){if(!On(e))return!1;switch(pv(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return Aee||!!Tee(tC,U1(e))}:kf,Oee=xi("species"),Z3=nr.Array,_ee=function(e,t){return new(function(r){var n;return $3(r)&&(n=r.constructor,(Dee(n)&&(n===Z3||$3(n.prototype))||Ao(n)&&(n=n[Oee])===null)&&(n=void 0)),n===void 0?Z3:n}(e))(t===0?0:t)},J3=Gr([].push),Ts=function(e){var t=e==1,r=e==2,n=e==3,i=e==4,o=e==6,a=e==7,s=e==5||o;return function(l,u,c,h){for(var S,y,W=M1(l),B=YR(W),N=Ok(u,c),U=dv(B),D=0,Q=h||_ee,te=t?Q(l,U):r||a?Q(l,0):void 0;U>D;D++)if((s||D in B)&&(y=N(S=B[D],D,W),e))if(t)te[D]=y;else if(y)switch(e){case 3:return!0;case 5:return S;case 6:return D;case 2:J3(te,S)}else switch(e){case 4:return!1;case 7:J3(te,S)}return o?-1:n||i?i:te}},Ree={forEach:Ts(0),map:Ts(1),filter:Ts(2),some:Ts(3),every:Ts(4),find:Ts(5),findIndex:Ts(6),filterReject:Ts(7)}.forEach,kee=function(e,t){var r=[][e];return!!r&&Xn(function(){r.call(null,t||function(){throw 1},1)})}("forEach"),rC=kee?[].forEach:function(e){return Ree(this,e,arguments.length>1?arguments[1]:void 0)},Q3=function(e){if(e&&e.forEach!==rC)try{Si(e,"forEach",rC)}catch(t){e.forEach=rC}};for(var nC in xv)xv[nC]&&Q3(nr[nC]&&nr[nC].prototype);Q3(Uk),Ri("en",{common:{ok:"OK",delete:"Delete",enter:"Enter"},blockQuote:{title:"Quote"},codeBlock:{title:"Code block"},color:{color:"Font color",bgColor:"Back color",default:"Default color",clear:"Clear back color"},divider:{title:"Divider"},emotion:{title:"Emotion"},fontSize:{title:"Font size",default:"Default"},fontFamily:{title:"Font family",default:"Default"},fullScreen:{title:"Full screen"},header:{title:"Header",text:"Text"},image:{netImage:"Net image",delete:"Delete image",edit:"Edit image",viewLink:"View link",src:"Image src",desc:"Description",link:"Image link"},indent:{decrease:"Decrease",increase:"Increase"},justify:{left:"Left",right:"Right",center:"Center",justify:"Justify"},lineHeight:{title:"Line height",default:"Default"},link:{insert:"Insert link",text:"Link text",url:"Link source",unLink:"Unlink",edit:"Edit link",view:"View link"},textStyle:{bold:"Bold",clear:"Clear styles",code:"Inline code",italic:"Italic",sub:"Sub",sup:"Sup",through:"Through",underline:"Underline"},undo:{undo:"undo",redo:"Redo"},todo:{todo:"Todo"}}),Ri("zh-CN",{common:{ok:"\u786E\u5B9A",delete:"\u5220\u9664",enter:"\u56DE\u8F66"},blockQuote:{title:"\u5F15\u7528"},codeBlock:{title:"\u4EE3\u7801\u5757"},color:{color:"\u6587\u5B57\u989C\u8272",bgColor:"\u80CC\u666F\u8272",default:"\u9ED8\u8BA4\u989C\u8272",clear:"\u6E05\u9664\u80CC\u666F\u8272"},divider:{title:"\u5206\u5272\u7EBF"},emotion:{title:"\u8868\u60C5"},fontSize:{title:"\u5B57\u53F7",default:"\u9ED8\u8BA4\u5B57\u53F7"},fontFamily:{title:"\u5B57\u4F53",default:"\u9ED8\u8BA4\u5B57\u4F53"},fullScreen:{title:"\u5168\u5C4F"},header:{title:"\u6807\u9898",text:"\u6B63\u6587"},image:{netImage:"\u7F51\u7EDC\u56FE\u7247",delete:"\u5220\u9664\u56FE\u7247",edit:"\u7F16\u8F91\u56FE\u7247",viewLink:"\u67E5\u770B\u94FE\u63A5",src:"\u56FE\u7247\u5730\u5740",desc:"\u56FE\u7247\u63CF\u8FF0",link:"\u56FE\u7247\u94FE\u63A5"},indent:{decrease:"\u51CF\u5C11\u7F29\u8FDB",increase:"\u589E\u52A0\u7F29\u8FDB"},justify:{left:"\u5DE6\u5BF9\u9F50",right:"\u53F3\u5BF9\u9F50",center:"\u5C45\u4E2D\u5BF9\u9F50",justify:"\u4E24\u7AEF\u5BF9\u9F50"},lineHeight:{title:"\u884C\u9AD8",default:"\u9ED8\u8BA4\u884C\u9AD8"},link:{insert:"\u63D2\u5165\u94FE\u63A5",text:"\u94FE\u63A5\u6587\u672C",url:"\u94FE\u63A5\u5730\u5740",unLink:"\u53D6\u6D88\u94FE\u63A5",edit:"\u4FEE\u6539\u94FE\u63A5",view:"\u67E5\u770B\u94FE\u63A5"},textStyle:{bold:"\u7C97\u4F53",clear:"\u6E05\u9664\u683C\u5F0F",code:"\u884C\u5185\u4EE3\u7801",italic:"\u659C\u4F53",sub:"\u4E0B\u6807",sup:"\u4E0A\u6807",through:"\u5220\u9664\u7EBF",underline:"\u4E0B\u5212\u7EBF"},undo:{undo:"\u64A4\u9500",redo:"\u91CD\u505A"},todo:{todo:"\u5F85\u529E"}});var Lee={type:"paragraph",renderElem:function(e,t,r){return er("p",null,t)}},qm=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof ze!="undefined"?ze:typeof self!="undefined"?self:{};function e0(e){var t={exports:{}};return e(t,t.exports),t.exports}var As,t0,r0=function(e){return e&&e.Math==Math&&e},sr=r0(typeof globalThis=="object"&&globalThis)||r0(typeof window=="object"&&window)||r0(typeof self=="object"&&self)||r0(typeof qm=="object"&&qm)||function(){return this}()||Function("return this")(),un=function(e){try{return!!e()}catch(t){return!0}},Io=!un(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Lf=Function.prototype.call,vn=Lf.bind?Lf.bind(Lf):function(){return Lf.apply(Lf,arguments)},q3={}.propertyIsEnumerable,eB=Object.getOwnPropertyDescriptor,Pee=eB&&!q3.call({1:2},1)?function(e){var t=eB(this,e);return!!t&&t.enumerable}:q3,tB={f:Pee},iC=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},rB=Function.prototype,oC=rB.bind,aC=rB.call,Iee=oC&&oC.bind(aC),Qt=oC?function(e){return e&&Iee(aC,e)}:function(e){return e&&function(){return aC.apply(e,arguments)}},Mee=Qt({}.toString),Bee=Qt("".slice),Ds=function(e){return Bee(Mee(e),8,-1)},sC=sr.Object,Fee=Qt("".split),n0=un(function(){return!sC("z").propertyIsEnumerable(0)})?function(e){return Ds(e)=="String"?Fee(e,""):sC(e)}:sC,Nee=sr.TypeError,fo=function(e){if(e==null)throw Nee("Can't call method on "+e);return e},ed=function(e){return n0(fo(e))},ii=function(e){return typeof e=="function"},po=function(e){return typeof e=="object"?e!==null:ii(e)},jee=function(e){return ii(e)?e:void 0},Pf=function(e,t){return arguments.length<2?jee(sr[e]):sr[e]&&sr[e][t]},nB=Qt({}.isPrototypeOf),lC=Pf("navigator","userAgent")||"",iB=sr.process,oB=sr.Deno,aB=iB&&iB.versions||oB&&oB.version,sB=aB&&aB.v8;sB&&(t0=(As=sB.split("."))[0]>0&&As[0]<4?1:+(As[0]+As[1])),!t0&&lC&&(!(As=lC.match(/Edge\/(\d+)/))||As[1]>=74)&&(As=lC.match(/Chrome\/(\d+)/))&&(t0=+As[1]);var uC=t0,cC=!!Object.getOwnPropertySymbols&&!un(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&uC&&uC<41}),dC=cC&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Uee=sr.Object,hC=dC?function(e){return typeof e=="symbol"}:function(e){var t=Pf("Symbol");return ii(t)&&nB(t.prototype,Uee(e))},Hee=sr.String,lB=function(e){try{return Hee(e)}catch(t){return"Object"}},zee=sr.TypeError,uB=function(e){if(ii(e))return e;throw zee(lB(e)+" is not a function")},i0=function(e,t){var r=e[t];return r==null?void 0:uB(r)},Wee=sr.TypeError,Gee=Object.defineProperty,fC=function(e,t){try{Gee(sr,e,{value:t,configurable:!0,writable:!0})}catch(r){sr[e]=t}return t},Os=sr["__core-js_shared__"]||fC("__core-js_shared__",{}),pC=e0(function(e){(e.exports=function(t,r){return Os[t]||(Os[t]=r!==void 0?r:{})})("versions",[]).push({version:"3.19.3",mode:"global",copyright:"\xA9 2021 Denis Pushkarev (zloirock.ru)"})}),Vee=sr.Object,If=function(e){return Vee(fo(e))},Kee=Qt({}.hasOwnProperty),go=Object.hasOwn||function(e,t){return Kee(If(e),t)},$ee=0,Xee=Math.random(),Yee=Qt(1 .toString),cB=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Yee(++$ee+Xee,36)},Mf=pC("wks"),uu=sr.Symbol,dB=uu&&uu.for,Zee=dC?uu:uu&&uu.withoutSetter||cB,Vi=function(e){if(!go(Mf,e)||!cC&&typeof Mf[e]!="string"){var t="Symbol."+e;cC&&go(uu,e)?Mf[e]=uu[e]:Mf[e]=dC&&dB?dB(t):Zee(t)}return Mf[e]},Jee=sr.TypeError,Qee=Vi("toPrimitive"),gC=function(e){var t=function(r,n){if(!po(r)||hC(r))return r;var i,o=i0(r,Qee);if(o){if(n===void 0&&(n="default"),i=vn(o,r,n),!po(i)||hC(i))return i;throw Jee("Can't convert object to primitive value")}return n===void 0&&(n="number"),function(a,s){var l,u;if(s==="string"&&ii(l=a.toString)&&!po(u=vn(l,a)))return u;if(ii(l=a.valueOf)&&!po(u=vn(l,a)))return u;if(s!=="string"&&ii(l=a.toString)&&!po(u=vn(l,a)))return u;throw Wee("Can't convert object to primitive value")}(r,n)}(e,"string");return hC(t)?t:t+""},vC=sr.document,qee=po(vC)&&po(vC.createElement),mC=function(e){return qee?vC.createElement(e):{}},hB=!Io&&!un(function(){return Object.defineProperty(mC("div"),"a",{get:function(){return 7}}).a!=7}),fB=Object.getOwnPropertyDescriptor,yC={f:Io?fB:function(e,t){if(e=ed(e),t=gC(t),hB)try{return fB(e,t)}catch(r){}if(go(e,t))return iC(!vn(tB.f,e,t),e[t])}},ete=sr.String,tte=sr.TypeError,Ki=function(e){if(po(e))return e;throw tte(ete(e)+" is not an object")},rte=sr.TypeError,pB=Object.defineProperty,td={f:Io?pB:function(e,t,r){if(Ki(e),t=gC(t),Ki(r),hB)try{return pB(e,t,r)}catch(n){}if("get"in r||"set"in r)throw rte("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},rd=Io?function(e,t,r){return td.f(e,t,iC(1,r))}:function(e,t,r){return e[t]=r,e},nte=Qt(Function.toString);ii(Os.inspectSource)||(Os.inspectSource=function(e){return nte(e)});var o0,Bf,a0,bC=Os.inspectSource,gB=sr.WeakMap,ite=ii(gB)&&/native code/.test(bC(gB)),vB=pC("keys"),mB=function(e){return vB[e]||(vB[e]=cB(e))},EC={},xC=sr.TypeError,ote=sr.WeakMap;if(ite||Os.state){var cu=Os.state||(Os.state=new ote),ate=Qt(cu.get),yB=Qt(cu.has),ste=Qt(cu.set);o0=function(e,t){if(yB(cu,e))throw new xC("Object already initialized");return t.facade=e,ste(cu,e,t),t},Bf=function(e){return ate(cu,e)||{}},a0=function(e){return yB(cu,e)}}else{var nd=mB("state");EC[nd]=!0,o0=function(e,t){if(go(e,nd))throw new xC("Object already initialized");return t.facade=e,rd(e,nd,t),t},Bf=function(e){return go(e,nd)?e[nd]:{}},a0=function(e){return go(e,nd)}}var SC={set:o0,get:Bf,has:a0,enforce:function(e){return a0(e)?Bf(e):o0(e,{})},getterFor:function(e){return function(t){var r;if(!po(t)||(r=Bf(t)).type!==e)throw xC("Incompatible receiver, "+e+" required");return r}}},bB=Function.prototype,lte=Io&&Object.getOwnPropertyDescriptor,wC=go(bB,"name"),s0={EXISTS:wC,PROPER:wC&&function(){}.name==="something",CONFIGURABLE:wC&&(!Io||Io&<e(bB,"name").configurable)},Ff=e0(function(e){var t=s0.CONFIGURABLE,r=SC.get,n=SC.enforce,i=String(String).split("String");(e.exports=function(o,a,s,l){var u,c=!!l&&!!l.unsafe,h=!!l&&!!l.enumerable,S=!!l&&!!l.noTargetGet,y=l&&l.name!==void 0?l.name:a;ii(s)&&(String(y).slice(0,7)==="Symbol("&&(y="["+String(y).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!go(s,"name")||t&&s.name!==y)&&rd(s,"name",y),(u=n(s)).source||(u.source=i.join(typeof y=="string"?y:""))),o!==sr?(c?!S&&o[a]&&(h=!0):delete o[a],h?o[a]=s:rd(o,a,s)):h?o[a]=s:fC(a,s)})(Function.prototype,"toString",function(){return ii(this)&&r(this).source||bC(this)})}),ute=Math.ceil,cte=Math.floor,id=function(e){var t=+e;return t!=t||t===0?0:(t>0?cte:ute)(t)},dte=Math.max,hte=Math.min,Nf=function(e,t){var r=id(e);return r<0?dte(r+t,0):hte(r,t)},fte=Math.min,jf=function(e){return e>0?fte(id(e),9007199254740991):0},l0=function(e){return jf(e.length)},EB=function(e){return function(t,r,n){var i,o=ed(t),a=l0(o),s=Nf(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},xB={includes:EB(!0),indexOf:EB(!1)},pte=xB.indexOf,SB=Qt([].push),wB=function(e,t){var r,n=ed(e),i=0,o=[];for(r in n)!go(EC,r)&&go(n,r)&&SB(o,r);for(;t.length>i;)go(n,r=t[i++])&&(~pte(o,r)||SB(o,r));return o},u0=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],gte=u0.concat("length","prototype"),vte={f:Object.getOwnPropertyNames||function(e){return wB(e,gte)}},CB={f:Object.getOwnPropertySymbols},mte=Qt([].concat),yte=Pf("Reflect","ownKeys")||function(e){var t=vte.f(Ki(e)),r=CB.f;return r?mte(t,r(e)):t},bte=function(e,t){for(var r=yte(t),n=td.f,i=yC.f,o=0;o<r.length;o++){var a=r[o];go(e,a)||n(e,a,i(t,a))}},Ete=/#|\.prototype\./,Uf=function(e,t){var r=Ste[xte(e)];return r==Cte||r!=wte&&(ii(t)?un(t):!!t)},xte=Uf.normalize=function(e){return String(e).replace(Ete,".").toLowerCase()},Ste=Uf.data={},wte=Uf.NATIVE="N",Cte=Uf.POLYFILL="P",Tte=Uf,Ate=yC.f,Hn=function(e,t){var r,n,i,o,a,s=e.target,l=e.global,u=e.stat;if(r=l?sr:u?sr[s]||fC(s,{}):(sr[s]||{}).prototype)for(n in t){if(o=t[n],i=e.noTargetGet?(a=Ate(r,n))&&a.value:r[n],!Tte(l?n:s+(u?".":"#")+n,e.forced)&&i!==void 0){if(typeof o==typeof i)continue;bte(o,i)}(e.sham||i&&i.sham)&&rd(o,"sham",!0),Ff(r,n,o,e)}},TB=Qt(Qt.bind),c0=Array.isArray||function(e){return Ds(e)=="Array"},AB={};AB[Vi("toStringTag")]="z";var CC=String(AB)==="[object z]",Dte=Vi("toStringTag"),Ote=sr.Object,_te=Ds(function(){return arguments}())=="Arguments",TC=CC?Ds:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=function(i,o){try{return i[o]}catch(a){}}(t=Ote(e),Dte))=="string"?r:_te?Ds(t):(n=Ds(t))=="Object"&&ii(t.callee)?"Arguments":n},DB=function(){},Rte=[],OB=Pf("Reflect","construct"),AC=/^\s*(?:class|function)\b/,kte=Qt(AC.exec),Lte=!AC.exec(DB),Hf=function(e){if(!ii(e))return!1;try{return OB(DB,Rte,e),!0}catch(t){return!1}},DC=!OB||un(function(){var e;return Hf(Hf.call)||!Hf(Object)||!Hf(function(){e=!0})||e})?function(e){if(!ii(e))return!1;switch(TC(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return Lte||!!kte(AC,bC(e))}:Hf,Pte=Vi("species"),_B=sr.Array,Ite=function(e,t){return new(function(r){var n;return c0(r)&&(n=r.constructor,(DC(n)&&(n===_B||c0(n.prototype))||po(n)&&(n=n[Pte])===null)&&(n=void 0)),n===void 0?_B:n}(e))(t===0?0:t)},RB=Qt([].push),_s=function(e){var t=e==1,r=e==2,n=e==3,i=e==4,o=e==6,a=e==7,s=e==5||o;return function(l,u,c,h){for(var S,y,W=If(l),B=n0(W),N=function(he,Ee){return uB(he),Ee===void 0?he:TB?TB(he,Ee):function(){return he.apply(Ee,arguments)}}(u,c),U=l0(B),D=0,Q=h||Ite,te=t?Q(l,U):r||a?Q(l,0):void 0;U>D;D++)if((s||D in B)&&(y=N(S=B[D],D,W),e))if(t)te[D]=y;else if(y)switch(e){case 3:return!0;case 5:return S;case 6:return D;case 2:RB(te,S)}else switch(e){case 4:return!1;case 7:RB(te,S)}return o?-1:n||i?i:te}},d0={forEach:_s(0),map:_s(1),filter:_s(2),some:_s(3),every:_s(4),find:_s(5),findIndex:_s(6),filterReject:_s(7)},Mte=Vi("species"),OC=function(e){return uC>=51||!un(function(){var t=[];return(t.constructor={})[Mte]=function(){return{foo:1}},t[e](Boolean).foo!==1})},Bte=d0.filter;Hn({target:"Array",proto:!0,forced:!OC("filter")},{filter:function(e){return Bte(this,e,arguments.length>1?arguments[1]:void 0)}});var Fte=CC?{}.toString:function(){return"[object "+TC(this)+"]"};CC||Ff(Object.prototype,"toString",Fte,{unsafe:!0});var h0,Nte=sr.String,cn=function(e){if(TC(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return Nte(e)},kB=function(){var e=Ki(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},_C=sr.RegExp,RC=un(function(){var e=_C("a","y");return e.lastIndex=2,e.exec("abcd")!=null}),jte=RC||un(function(){return!_C("a","y").sticky}),LB={BROKEN_CARET:RC||un(function(){var e=_C("^r","gy");return e.lastIndex=2,e.exec("str")!=null}),MISSED_STICKY:jte,UNSUPPORTED_Y:RC},od=Object.keys||function(e){return wB(e,u0)},Ute=Io?Object.defineProperties:function(e,t){Ki(e);for(var r,n=ed(t),i=od(t),o=i.length,a=0;o>a;)td.f(e,r=i[a++],n[r]);return e},Hte=Pf("document","documentElement"),PB=mB("IE_PROTO"),kC=function(){},IB=function(e){return"<script>"+e+"</script>"},MB=function(e){e.write(IB("")),e.close();var t=e.parentWindow.Object;return e=null,t},f0=function(){try{h0=new ActiveXObject("htmlfile")}catch(n){}var e,t;f0=typeof document!="undefined"?document.domain&&h0?MB(h0):((t=mC("iframe")).style.display="none",Hte.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(IB("document.F=Object")),e.close(),e.F):MB(h0);for(var r=u0.length;r--;)delete f0.prototype[u0[r]];return f0()};EC[PB]=!0;var BB,LC,FB=Object.create||function(e,t){var r;return e!==null?(kC.prototype=Ki(e),r=new kC,kC.prototype=null,r[PB]=e):r=f0(),t===void 0?r:Ute(r,t)},zte=sr.RegExp,Wte=un(function(){var e=zte(".","s");return!(e.dotAll&&e.exec(`
|
|
|
`)&&e.flags==="s")}),Gte=sr.RegExp,Vte=un(function(){var e=Gte("(?<a>b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$<a>c")!=="bc"}),Kte=SC.get,$te=pC("native-string-replace",String.prototype.replace),p0=RegExp.prototype.exec,PC=p0,Xte=Qt("".charAt),Yte=Qt("".indexOf),Zte=Qt("".replace),IC=Qt("".slice),MC=(LC=/b*/g,vn(p0,BB=/a/,"a"),vn(p0,LC,"a"),BB.lastIndex!==0||LC.lastIndex!==0),NB=LB.BROKEN_CARET,BC=/()??/.exec("")[1]!==void 0;(MC||BC||NB||Wte||Vte)&&(PC=function(e){var t,r,n,i,o,a,s,l=this,u=Kte(l),c=cn(e),h=u.raw;if(h)return h.lastIndex=l.lastIndex,t=vn(PC,h,c),l.lastIndex=h.lastIndex,t;var S=u.groups,y=NB&&l.sticky,W=vn(kB,l),B=l.source,N=0,U=c;if(y&&(W=Zte(W,"y",""),Yte(W,"g")===-1&&(W+="g"),U=IC(c,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&Xte(c,l.lastIndex-1)!==`
|
|
|
`)&&(B="(?: "+B+")",U=" "+U,N++),r=new RegExp("^(?:"+B+")",W)),BC&&(r=new RegExp("^"+B+"$(?!\\s)",W)),MC&&(n=l.lastIndex),i=vn(p0,y?r:l,U),y?i?(i.input=IC(i.input,N),i[0]=IC(i[0],N),i.index=l.lastIndex,l.lastIndex+=i[0].length):l.lastIndex=0:MC&&i&&(l.lastIndex=l.global?i.index+i[0].length:n),BC&&i&&i.length>1&&vn($te,i[0],r,function(){for(o=1;o<arguments.length-2;o++)arguments[o]===void 0&&(i[o]=void 0)}),i&&S)for(i.groups=a=FB(null),o=0;o<S.length;o++)a[(s=S[o])[0]]=i[s[1]];return i});var zf=PC;Hn({target:"RegExp",proto:!0,forced:/./.exec!==zf},{exec:zf});var FC=Function.prototype,jB=FC.apply,Jte=FC.bind,UB=FC.call,HB=typeof Reflect=="object"&&Reflect.apply||(Jte?UB.bind(jB):function(){return UB.apply(jB,arguments)}),Qte=Vi("species"),NC=RegExp.prototype,jC=function(e,t,r,n){var i=Vi(e),o=!un(function(){var u={};return u[i]=function(){return 7},""[e](u)!=7}),a=o&&!un(function(){var u=!1,c=/a/;return e==="split"&&((c={}).constructor={},c.constructor[Qte]=function(){return c},c.flags="",c[i]=/./[i]),c.exec=function(){return u=!0,null},c[i](""),!u});if(!o||!a||r){var s=Qt(/./[i]),l=t(i,""[e],function(u,c,h,S,y){var W=Qt(u),B=c.exec;return B===zf||B===NC.exec?o&&!y?{done:!0,value:s(c,h,S)}:{done:!0,value:W(h,c,S)}:{done:!1}});Ff(String.prototype,e,l[0]),Ff(NC,i,l[1])}n&&rd(NC[i],"sham",!0)},qte=Qt("".charAt),zB=Qt("".charCodeAt),ere=Qt("".slice),WB=function(e){return function(t,r){var n,i,o=cn(fo(t)),a=id(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=zB(o,a))<55296||n>56319||a+1===s||(i=zB(o,a+1))<56320||i>57343?e?qte(o,a):n:e?ere(o,a,a+2):i-56320+(n-55296<<10)+65536}},tre=(WB(!1),WB(!0)),UC=function(e,t,r){return t+(r?tre(e,t).length:1)},rre=Math.floor,HC=Qt("".charAt),nre=Qt("".replace),zC=Qt("".slice),ire=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,ore=/\$([$&'`]|\d{1,2})/g,are=function(e,t,r,n,i,o){var a=r+e.length,s=n.length,l=ore;return i!==void 0&&(i=If(i),l=ire),nre(o,l,function(u,c){var h;switch(HC(c,0)){case"$":return"$";case"&":return e;case"`":return zC(t,0,r);case"'":return zC(t,a);case"<":h=i[zC(c,1,-1)];break;default:var S=+c;if(S===0)return u;if(S>s){var y=rre(S/10);return y===0?u:y<=s?n[y-1]===void 0?HC(c,1):n[y-1]+HC(c,1):u}h=n[S-1]}return h===void 0?"":h})},sre=sr.TypeError,Wf=function(e,t){var r=e.exec;if(ii(r)){var n=vn(r,e,t);return n!==null&&Ki(n),n}if(Ds(e)==="RegExp")return vn(zf,e,t);throw sre("RegExp#exec called on incompatible receiver")},WC=Vi("replace"),lre=Math.max,ure=Math.min,cre=Qt([].concat),GC=Qt([].push),GB=Qt("".indexOf),VB=Qt("".slice),dre="a".replace(/./,"$0")==="$0",KB=!!/./[WC]&&/./[WC]("a","$0")==="";jC("replace",function(e,t,r){var n=KB?"$":"$0";return[function(i,o){var a=fo(this),s=i==null?void 0:i0(i,WC);return s?vn(s,i,a,o):vn(t,cn(a),i,o)},function(i,o){var a=Ki(this),s=cn(i);if(typeof o=="string"&&GB(o,n)===-1&&GB(o,"$<")===-1){var l=r(t,a,s,o);if(l.done)return l.value}var u=ii(o);u||(o=cn(o));var c=a.global;if(c){var h=a.unicode;a.lastIndex=0}for(var S=[];;){var y=Wf(a,s);if(y===null)break;if(GC(S,y),!c)break;cn(y[0])===""&&(a.lastIndex=UC(s,jf(a.lastIndex),h))}for(var W,B="",N=0,U=0;U<S.length;U++){for(var D=cn((y=S[U])[0]),Q=lre(ure(id(y.index),s.length),0),te=[],he=1;he<y.length;he++)GC(te,(W=y[he])===void 0?W:String(W));var Ee=y.groups;if(u){var ve=cre([D],te,Q,s);Ee!==void 0&&GC(ve,Ee);var De=cn(HB(o,void 0,ve))}else De=are(D,s,Q,te,Ee,o);Q>=N&&(B+=VB(s,N,Q)+De,N=Q+D.length)}return B+VB(s,N)}]},!!un(function(){var e=/./;return e.exec=function(){var t=[];return t.groups={a:"7"},t},"".replace(e,"$<a>")!=="7"})||!dre||KB);var VC=Vi("unscopables"),KC=Array.prototype;KC[VC]==null&&td.f(KC,VC,{configurable:!0,value:FB(null)});var $B=function(e){KC[VC][e]=!0},hre=d0.find,XB=!0;"find"in[]&&Array(1).find(function(){XB=!1}),Hn({target:"Array",proto:!0,forced:XB},{find:function(e){return hre(this,e,arguments.length>1?arguments[1]:void 0)}}),$B("find");var fre=Vi("match"),YB=function(e){var t;return po(e)&&((t=e[fre])!==void 0?!!t:Ds(e)=="RegExp")},pre=sr.TypeError,gre=Vi("species"),ZB=function(e,t,r){var n=gC(t);n in e?td.f(e,n,iC(0,r)):e[n]=r},vre=sr.Array,mre=Math.max,JB=function(e,t,r){for(var n=l0(e),i=Nf(t,n),o=Nf(r===void 0?n:r,n),a=vre(mre(o-i,0)),s=0;i<o;i++,s++)ZB(a,s,e[i]);return a.length=s,a},ad=LB.UNSUPPORTED_Y,yre=Math.min,QB=[].push,bre=Qt(/./.exec),sd=Qt(QB),Gf=Qt("".slice);jC("split",function(e,t,r){var n;return n="abbc".split(/(b)*/)[1]=="c"||"test".split(/(?:)/,-1).length!=4||"ab".split(/(?:ab)*/).length!=2||".".split(/(.?)(.?)/).length!=4||".".split(/()()/).length>1||"".split(/.?/).length?function(i,o){var a=cn(fo(this)),s=o===void 0?4294967295:o>>>0;if(s===0)return[];if(i===void 0)return[a];if(!YB(i))return vn(t,a,i,s);for(var l,u,c,h=[],S=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(i.sticky?"y":""),y=0,W=new RegExp(i.source,S+"g");(l=vn(zf,W,a))&&!((u=W.lastIndex)>y&&(sd(h,Gf(a,y,l.index)),l.length>1&&l.index<a.length&&HB(QB,h,JB(l,1)),c=l[0].length,y=u,h.length>=s));)W.lastIndex===l.index&&W.lastIndex++;return y===a.length?!c&&bre(W,"")||sd(h,""):sd(h,Gf(a,y)),h.length>s?JB(h,0,s):h}:"0".split(void 0,0).length?function(i,o){return i===void 0&&o===0?[]:vn(t,this,i,o)}:t,[function(i,o){var a=fo(this),s=i==null?void 0:i0(i,e);return s?vn(s,i,a,o):vn(n,cn(a),i,o)},function(i,o){var a=Ki(this),s=cn(i),l=r(n,a,s,o,n!==t);if(l.done)return l.value;var u=function(te,he){var Ee,ve=Ki(te).constructor;return ve===void 0||(Ee=Ki(ve)[gre])==null?he:function(De){if(DC(De))return De;throw pre(lB(De)+" is not a constructor")}(Ee)}(a,RegExp),c=a.unicode,h=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(ad?"g":"y"),S=new u(ad?"^(?:"+a.source+")":a,h),y=o===void 0?4294967295:o>>>0;if(y===0)return[];if(s.length===0)return Wf(S,s)===null?[s]:[];for(var W=0,B=0,N=[];B<s.length;){S.lastIndex=ad?0:B;var U,D=Wf(S,ad?Gf(s,B):s);if(D===null||(U=yre(jf(S.lastIndex+(ad?B:0)),s.length))===W)B=UC(s,B,c);else{if(sd(N,Gf(s,W,B)),N.length===y)return N;for(var Q=1;Q<=D.length-1;Q++)if(sd(N,D[Q]),N.length===y)return N;B=W=U}}return sd(N,Gf(s,W)),N}]},!!un(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return r.length!==2||r[0]!=="a"||r[1]!=="b"}),ad);var $C=`
|
|
|
\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`,qB=Qt("".replace),g0="["+$C+"]",Ere=RegExp("^"+g0+g0+"*"),xre=RegExp(g0+g0+"*$"),XC=function(e){return function(t){var r=cn(fo(t));return 1&e&&(r=qB(r,Ere,"")),2&e&&(r=qB(r,xre,"")),r}},Sre={start:XC(1),end:XC(2),trim:XC(3)},wre=s0.PROPER,Cre=Sre.trim;function YC(e){return _e("<div>"+e+"</div>").children().filter(function(t){return t.tagName!=="BR"}).length===0}function ld(e){return e.length===0?"":e[0].outerHTML}function ud(e){return e.length?e[0].tagName.toLowerCase():""}function Mo(e,t){for(var r="",n=(e.attr("style")||"").split(";"),i=n.length,o=0;o<i;o++){var a=n[o];if(a){var s=a.split(":");s[0].trim()===t&&(r=s[1].trim())}}return r}Hn({target:"String",proto:!0,forced:un(function(){return!!$C.trim()||"\u200B\x85\u180E".trim()!=="\u200B\x85\u180E"||wre&&$C.trim.name!=="trim"})},{trim:function(){return Cre(this)}}),Hn({global:!0},{globalThis:sr}),Wv&&(_e.fn.css=Wv),io&&(_e.fn.append=io),gP&&(_e.fn.prepend=gP),fc&&(_e.fn.addClass=fc),pc&&(_e.fn.removeClass=pc),gc&&(_e.fn.hasClass=gc),Zo&&(_e.fn.on=Zo),dP&&(_e.fn.off=dP),cs&&(_e.fn.focus=cs),no&&(_e.fn.attr=no),jv&&(_e.fn.removeAttr=jv),mc&&(_e.fn.hide=mc),zv&&(_e.fn.show=zv),Kv&&(_e.fn.parents=Kv),vc&&(_e.fn.dataset=vc),Yo&&(_e.fn.val=Yo),Vv&&(_e.fn.text=Vv),us&&(_e.fn.html=us),Ec&&(_e.fn.children=Ec),xc&&(_e.fn.remove=xc),bc&&(_e.fn.find=bc),Uv&&(_e.fn.width=Uv),Hv&&(_e.fn.height=Hv),fP&&(_e.fn.filter=fP),Sc&&(_e.fn.empty=Sc);var Tre={selector:"p:not([data-w-e-type])",parseElemHtml:function(e,t,r){var n=_e(e);return(t=t.filter(function(i){return!!Rt.isText(i)||!!r.isInline(i)})).length===0&&(t=[{text:n.text().replace(/\s+/gm," ")}]),{type:"paragraph",children:t}}},ZC=function(e,t){return ZC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},ZC(e,t);/*! *****************************************************************************
|
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
purpose with or without fee is hereby granted.
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
|
***************************************************************************** */};function nn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ZC(e,t),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Rs=function(){return Rs=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Rs.apply(this,arguments)};function ks(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(u){try{l(n.next(u))}catch(c){o(c)}}function s(u){try{l(n.throw(u))}catch(c){o(c)}}function l(u){var c;u.done?i(u.value):(c=u.value,c instanceof r?c:new r(function(h){h(c)})).then(a,s)}l((n=n.apply(e,t||[])).next())})}function Ls(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(u){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||c[0]!==6&&c[0]!==2)){a=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){a.label=c[1];break}if(c[0]===6&&a.label<i[1]){a.label=i[1],i=c;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(c);break}i[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(h){c=[6,h],n=0}finally{r=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([l,u])}}}function e5(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Dr(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function t5(e){var t=Dr(de.nodes(e,{match:function(o){return e.children[0]===o},mode:"highest"}),1)[0];if(t==null)return!1;var r=t[0];if(!Ut.isElement(r))return!1;if(r.type==="paragraph")return!1;if(St.string(r)!=="")return!1;var n=r.children,i=n===void 0?[]:n;return!!Rt.isText(i[0])&&(Ve.setNodes(e,{type:"paragraph"}),!0)}var Are={renderElems:[Lee],elemsToHtml:[{type:"paragraph",elemToHtml:function(e,t){return t===""?"<p><br></p>":"<p>"+t+"</p>"}}],parseElemsHtml:[Tre],editorPlugin:function(e){var t=e.deleteBackward,r=e.deleteForward;e.insertText,e.insertBreak;var n=e;return n.deleteBackward=function(i){t5(n)||t(i)},n.deleteForward=function(i){t5(n)||r(i)},n}},Dre=/"/g,Ore=Qt("".replace),Vf=function(e,t,r,n){var i=cn(fo(e)),o="<"+t;return r!==""&&(o+=" "+r+'="'+Ore(cn(n),Dre,""")+'"'),o+">"+i+"</"+t+">"},Kf=function(e){return un(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3})};function JC(e,t){var r=t,n=e,i=n.bold,o=n.italic,a=n.underline;return i&&(r="<strong>"+r+"</strong>"),n.code&&(r="<code>"+r+"</code>"),o&&(r="<em>"+r+"</em>"),a&&(r="<u>"+r+"</u>"),n.through&&(r="<s>"+r+"</s>"),n.sub&&(r="<sub>"+r+"</sub>"),n.sup&&(r="<sup>"+r+"</sup>"),r}function du(e,t){return e.length!==0&&(!!e[0].matches(t)||e.find(t).length>0)}Hn({target:"String",proto:!0,forced:Kf("bold")},{bold:function(){return Vf(this,"b","","")}}),Hn({target:"String",proto:!0,forced:Kf("italics")},{italics:function(){return Vf(this,"i","","")}}),Hn({target:"String",proto:!0,forced:Kf("sub")},{sub:function(){return Vf(this,"sub","","")}}),Hn({target:"String",proto:!0,forced:Kf("sup")},{sup:function(){return Vf(this,"sup","","")}});var r5={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},QC=mC("span").classList,n5=QC&&QC.constructor&&QC.constructor.prototype,_re=n5===Object.prototype?void 0:n5,i5=function(e,t){var r=[][e];return!!r&&un(function(){r.call(null,t||function(){throw 1},1)})},Rre=d0.forEach,qC=i5("forEach")?[].forEach:function(e){return Rre(this,e,arguments.length>1?arguments[1]:void 0)},o5=function(e){if(e&&e.forEach!==qC)try{rd(e,"forEach",qC)}catch(t){e.forEach=qC}};for(var eT in r5)r5[eT]&&o5(sr[eT]&&sr[eT].prototype);function a5(e,t){return e.selection==null||!!Dr(de.nodes(e,{match:function(r){return Ae.getNodeType(r)==="pre"||!!de.isVoid(e,r)},universal:!0}),1)[0]}function kre(e,t){Object.keys(t).forEach(function(r){r!=="text"&&de.removeMark(e,r)})}o5(_re),Hn({target:"Object",stat:!0,forced:un(function(){od(1)})},{keys:function(e){return od(If(e))}});var hu=function(){function e(){this.marksNeedToRemove=[],this.tag="button"}return e.prototype.getValue=function(t){var r=this.mark,n=de.marks(t);return n?n[r]:!!Dr(de.nodes(t,{match:function(i){return i[r]===!0}}),1)[0]},e.prototype.isActive=function(t){return!!this.getValue(t)},e.prototype.isDisabled=function(t){return a5(t,this.mark)},e.prototype.exec=function(t,r){var n=this.mark,i=this.marksNeedToRemove;r?t.removeMark(n):(t.addMark(n,!0),i&&i.forEach(function(o){return t.removeMark(o)}))},e}(),Lre='<svg viewBox="0 0 1024 1024"><path d="M707.872 484.64A254.88 254.88 0 0 0 768 320c0-141.152-114.848-256-256-256H192v896h384c141.152 0 256-114.848 256-256a256.096 256.096 0 0 0-124.128-219.36zM384 192h101.504c55.968 0 101.504 57.408 101.504 128s-45.536 128-101.504 128H384V192z m159.008 640H384v-256h159.008c58.464 0 106.016 57.408 106.016 128s-47.552 128-106.016 128z"></path></svg>',Pre='<svg viewBox="0 0 1024 1024"><path d="M704 64l128 0 0 416c0 159.072-143.264 288-320 288s-320-128.928-320-288l0-416 128 0 0 416c0 40.16 18.24 78.688 51.36 108.512 36.896 33.216 86.848 51.488 140.64 51.488s103.744-18.304 140.64-51.488c33.12-29.792 51.36-68.352 51.36-108.512l0-416zM192 832l640 0 0 128-640 0z"></path></svg>',Ire='<svg viewBox="0 0 1024 1024"><path d="M896 64v64h-128L448 896h128v64H128v-64h128L576 128h-128V64z"></path></svg>',Mre='<svg viewBox="0 0 1024 1024"><path d="M1024 512v64h-234.496c27.52 38.496 42.496 82.688 42.496 128 0 70.88-36.672 139.04-100.576 186.976C672.064 935.488 594.144 960 512 960s-160.064-24.512-219.424-69.024C228.64 843.04 192 774.88 192 704h128c0 69.376 87.936 128 192 128s192-58.624 192-128-87.936-128-192-128H0v-64h299.52a385.984 385.984 0 0 1-6.944-5.024C228.64 459.04 192 390.88 192 320s36.672-139.04 100.576-186.976C351.936 88.512 429.856 64 512 64s160.064 24.512 219.424 69.024C795.328 180.96 832 249.12 832 320h-128c0-69.376-87.936-128-192-128s-192 58.624-192 128 87.936 128 192 128c78.976 0 154.048 22.688 212.48 64H1024z"></path></svg>',Bre='<svg viewBox="0 0 1024 1024"><path d="M576 736l96 96 320-320L672 192l-96 96 224 224zM448 288l-96-96L32 512l320 320 96-96-224-224z"></path></svg>',s5='<svg viewBox="0 0 1024 1024"><path d="M864 0a160 160 0 0 1 128 256l-64 64-224-224 64-64c26.752-20.096 59.968-32 96-32zM64 736l-64 288 288-64 592-592-224-224L64 736z m651.584-372.416l-448 448-55.168-55.168 448-448 55.168 55.168z"></path></svg>',l5='<svg viewBox="0 0 1024 1024"><path d="M924.402464 1023.068211H0.679665V99.345412h461.861399v98.909208H99.596867v725.896389h725.896389V561.206811h98.909208z" p-id="10909"></path><path d="M930.805104 22.977336l69.965436 69.965436-453.492405 453.492404-69.965435-69.901489z" p-id="10910"></path><path d="M1022.464381 304.030081h-98.917201V99.345412H709.230573V0.428211h313.233808z"></path></svg>',Fre='<svg viewBox="0 0 1024 1024"><path d="M64 864h896v96H64zM360.58 576h302.85l81.53 224h102.16L579.24 64H444.77L176.89 800h102.16l81.53-224zM512 159.96L628.49 480H395.52L512 159.96z"></path></svg>',Nre='<svg viewBox="0 0 1024 1024"><path d="M510.030769 315.076923l84.676923 196.923077h-177.230769l76.8-196.923077h15.753846zM945.230769 157.538462v708.923076c0 43.323077-35.446154 78.769231-78.769231 78.769231H157.538462c-43.323077 0-78.769231-35.446154-78.769231-78.769231V157.538462c0-43.323077 35.446154-78.769231 78.769231-78.769231h708.923076c43.323077 0 78.769231 35.446154 78.769231 78.769231z m-108.307692 643.938461L600.615385 216.615385c-5.907692-11.815385-15.753846-19.692308-29.538462-19.692308h-139.815385c-11.815385 0-23.630769 7.876923-27.56923 19.692308l-216.615385 584.861538c-3.938462 11.815385 3.938462 25.6 17.723077 25.6h80.738462c11.815385 0 23.630769-9.846154 27.56923-21.661538l63.015385-175.261539h263.876923l68.923077 175.261539c3.938462 11.815385 15.753846 21.661538 27.569231 21.661538h80.738461c13.784615 0 23.630769-13.784615 19.692308-25.6z"></path></svg>',jre='<svg viewBox="0 0 1024 1024"><path d="M64 512h384v128h-128V1024h-128V640h-128z m896-256H708.2496v768h-136.4992V256H320V128h640z"></path></svg>',Ure='<svg viewBox="0 0 1024 1024"><path d="M956.788364 152.110545h-24.110546l23.924364 9.029819 0.186182 121.018181h-65.070546l-86.574545-130.048H566.551273v650.14691l130.048 64.977454v65.163636h-390.050909v-65.163636l129.954909-64.977454V152.110545H198.283636L111.429818 282.065455H46.545455V69.259636C46.545455 33.792 82.664727 22.062545 98.955636 22.062545h812.683637c23.738182 0 45.056 15.173818 45.056 41.053091V169.425455v-17.221819z"></path></svg>',Hre='<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m256-512v384l-256-192z"></path></svg>',zre='<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m0-128V320l256 192z"></path></svg>',Wre='<svg viewBox="0 0 1024 1024"><path d="M768 793.6v102.4H51.2v-102.4h716.8z m204.8-230.4v102.4H51.2v-102.4h921.6z m-204.8-230.4v102.4H51.2v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',Gre='<svg viewBox="0 0 1024 1024"><path d="M972.8 793.6v102.4H256v-102.4h716.8z m0-230.4v102.4H51.2v-102.4h921.6z m0-230.4v102.4H256v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',Vre='<svg viewBox="0 0 1024 1024"><path d="M870.4 793.6v102.4H153.6v-102.4h716.8z m102.4-230.4v102.4H51.2v-102.4h921.6z m-102.4-230.4v102.4H153.6v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',Kre='<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z"></path></svg>',$re='<svg viewBox="0 0 1024 1024"><path d="M768 206.016v50.016h128v64h-192V174.016l128-60V64h-128V0h192v146.016zM676 256h-136L352 444 164 256H28l256 256-256 256h136L352 580 540 768h136l-256-256z"></path></svg>',Xre='<svg viewBox="0 0 1024 1024"><path d="M768 910.016v50.016h128v64h-192v-146.016l128-60V768h-128v-64h192v146.016zM676 256h-136L352 444 164 256H28l256 256-256 256h136L352 580 540 768h136l-256-256z"></path></svg>',Yre=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.mark="bold",r.title=wt("textStyle.bold"),r.iconSvg=Lre,r.hotkey="mod+b",r}return nn(t,e),t}(hu),Zre=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.mark="code",r.title=wt("textStyle.code"),r.iconSvg=Bre,r.hotkey="mod+e",r}return nn(t,e),t}(hu),Jre=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.mark="italic",r.title=wt("textStyle.italic"),r.iconSvg=Ire,r.hotkey="mod+i",r}return nn(t,e),t}(hu),Qre=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.mark="through",r.title=wt("textStyle.through"),r.iconSvg=Mre,r.hotkey="mod+shift+x",r}return nn(t,e),t}(hu),qre=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.mark="underline",r.title=wt("textStyle.underline"),r.iconSvg=Pre,r.hotkey="mod+u",r}return nn(t,e),t}(hu),ene=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.mark="sub",r.marksNeedToRemove=["sup"],r.title=wt("textStyle.sub"),r.iconSvg=Xre,r.hotkey="",r}return nn(t,e),t}(hu),tne=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.mark="sup",r.marksNeedToRemove=["sub"],r.title=wt("textStyle.sup"),r.iconSvg=$re,r.hotkey="",r}return nn(t,e),t}(hu),rne=function(){function e(){this.title=wt("textStyle.clear"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M969.382408 288.738615l-319.401123-270.852152a67.074236 67.074236 0 0 0-96.459139 5.74922l-505.931379 574.922021a68.35184 68.35184 0 0 0-17.886463 47.910169 74.101061 74.101061 0 0 0 24.274486 47.910168l156.50655 132.232065h373.060512L975.131628 383.281347a67.074236 67.074236 0 0 0-5.74922-96.459139z m-440.134747 433.746725H264.144729l-90.071117-78.572676c-5.74922-5.74922-12.137243-12.137243-12.137243-17.886463a36.411728 36.411728 0 0 1 5.749221-24.274485l210.804741-240.828447 265.102932 228.691204z m-439.495945 180.781036h843.218964a60.047411 60.047411 0 1 1 0 120.733624H89.751716a60.047411 60.047411 0 1 1 0-120.733624z m0 0"></path></svg>',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return a5(t)},e.prototype.exec=function(t,r){var n,i,o=de.nodes(t,{match:function(l){return Rt.isText(l)},universal:!0});try{for(var a=e5(o),s=a.next();!s.done;s=a.next())kre(t,s.value[0])}catch(l){n={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}},e}(),nne={renderStyle:function(e,t){var r=e,n=r.bold,i=r.italic,o=r.underline,a=r.code,s=r.through,l=r.sub,u=r.sup,c=t;return n&&(c=er("strong",null,c)),a&&(c=er("code",null,c)),i&&(c=er("em",null,c)),o&&(c=er("u",null,c)),s&&(c=er("s",null,c)),l&&(c=er("sub",null,c)),u&&(c=er("sup",null,c)),c},menus:[{key:"bold",factory:function(){return new Yre}},{key:"underline",factory:function(){return new qre}},{key:"italic",factory:function(){return new Jre}},{key:"through",factory:function(){return new Qre}},{key:"code",factory:function(){return new Zre}},{key:"sub",factory:function(){return new ene}},{key:"sup",factory:function(){return new tne}},{key:"clearStyle",factory:function(){return new rne}}],styleToHtml:function(e,t){if(!Rt.isText(e))return t;if(YC(t))return JC(e,t);var r=_e(t);if(ud(r)==="br")return JC(e,"<br>");var n=r.html();return n=JC(e,n),r.html(n),ld(r)},parseStyleHtml:function(e,t,r){var n=_e(e);if(!Rt.isText(t))return t;var i=t;return du(n,"b,strong")&&(i.bold=!0),du(n,"i,em")&&(i.italic=!0),du(n,"u")&&(i.underline=!0),du(n,"s,strike")&&(i.through=!0),du(n,"sub")&&(i.sub=!0),du(n,"sup")&&(i.sup=!0),du(n,"code")&&(i.code=!0),i}};function $f(e){return function(t,r,n){return er("h"+e,null,r)}}var ine={type:"header1",renderElem:$f(1)},one={type:"header2",renderElem:$f(2)},ane={type:"header3",renderElem:$f(3)},sne={type:"header4",renderElem:$f(4)},lne={type:"header5",renderElem:$f(5)},une=s0.PROPER,tT=RegExp.prototype,u5=tT.toString,cne=Qt(kB),dne=un(function(){return u5.call({source:"a",flags:"b"})!="/a/b"}),hne=une&&u5.name!="toString";(dne||hne)&&Ff(RegExp.prototype,"toString",function(){var e=Ki(this),t=cn(e.source),r=e.flags;return"/"+t+"/"+cn(r===void 0&&nB(tT,e)&&!("flags"in tT)?cne(e):r)},{unsafe:!0});var rT,fne=sr.TypeError,c5=function(e){if(YB(e))throw fne("The method doesn't accept regular expressions");return e},pne=Vi("match"),d5=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[pne]=!1,"/./"[e](t)}catch(n){}}return!1},gne=yC.f,h5=Qt("".startsWith),vne=Qt("".slice),mne=Math.min,f5=d5("startsWith");function p5(e){var t=Dr(de.nodes(e,{match:function(i){return Ae.getNodeType(i).startsWith("header")},universal:!0}),1),r=t[0];if(r==null)return"paragraph";var n=Dr(r,1)[0];return Ae.getNodeType(n)}function g5(e){return e.selection==null||!Dr(de.nodes(e,{match:function(t){var r=Ae.getNodeType(t);return r==="paragraph"||!!r.startsWith("header")},universal:!0,mode:"highest"}),1)[0]}function v5(e,t){t&&Ve.setNodes(e,{type:t})}Hn({target:"String",proto:!0,forced:!(!f5&&(rT=gne(String.prototype,"startsWith"),rT&&!rT.writable)||f5)},{startsWith:function(e){var t=cn(fo(this));c5(e);var r=jf(mne(arguments.length>1?arguments[1]:void 0,t.length)),n=cn(e);return h5?h5(t,n,r):vne(t,r,r+n.length)===n}});var yne=function(){function e(){this.title=wt("header.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M960 960c-51.2 0-102.4-3.2-153.6-3.2-51.2 0-99.2 3.2-150.4 3.2-19.2 0-28.8-22.4-28.8-38.4 0-51.2 57.6-28.8 86.4-48 19.2-12.8 19.2-60.8 19.2-80v-224-19.2c-9.6-3.2-19.2-3.2-28.8-3.2H320c-9.6 0-19.2 0-28.8 3.2V780.8c0 22.4 0 80 22.4 92.8 28.8 19.2 96-6.4 96 44.8 0 16-9.6 41.6-28.8 41.6-54.4 0-105.6-3.2-160-3.2-48 0-96 3.2-147.2 3.2-19.2 0-28.8-22.4-28.8-38.4 0-51.2 51.2-28.8 80-48 19.2-12.8 19.2-60.8 19.2-83.2V294.4c0-28.8 3.2-115.2-22.4-131.2-25.6-16-86.4 9.6-86.4-41.6 0-16 6.4-41.6 28.8-41.6 51.2 0 105.6 3.2 156.8 3.2 48 0 96-3.2 144-3.2 19.2 0 28.8 22.4 28.8 41.6 0 48-57.6 25.6-83.2 41.6-19.2 12.8-19.2 73.6-19.2 92.8v201.6c6.4 3.2 16 3.2 22.4 3.2h400c6.4 0 12.8 0 22.4-3.2V256c0-22.4 0-80-19.2-92.8-28.8-16-86.4 6.4-86.4-41.6 0-16 9.6-41.6 28.8-41.6 51.2 0 99.2 3.2 150.4 3.2 48 0 99.2-3.2 147.2-3.2 19.2 0 28.8 22.4 28.8 41.6 0 51.2-57.6 25.6-86.4 41.6-19.2 12.8-19.2 70.4-19.2 92.8v537.6c0 19.2 0 67.2 19.2 80 28.8 19.2 89.6-6.4 89.6 44.8 0 19.2-6.4 41.6-28.8 41.6z"></path></svg>',this.tag="select",this.width=60}return e.prototype.getOptions=function(t){var r=[{value:"header1",text:"H1",styleForRenderMenuList:{"font-size":"32px","font-weight":"bold"}},{value:"header2",text:"H2",styleForRenderMenuList:{"font-size":"24px","font-weight":"bold"}},{value:"header3",text:"H3",styleForRenderMenuList:{"font-size":"18px","font-weight":"bold"}},{value:"header4",text:"H4",styleForRenderMenuList:{"font-size":"16px","font-weight":"bold"}},{value:"header5",text:"H5",styleForRenderMenuList:{"font-size":"13px","font-weight":"bold"}},{value:"paragraph",text:wt("header.text")}],n=this.getValue(t).toString();return r.forEach(function(i){i.value===n?i.selected=!0:delete i.selected}),r},e.prototype.isActive=function(t){return!1},e.prototype.getValue=function(t){return p5(t)},e.prototype.isDisabled=function(t){return g5(t)},e.prototype.exec=function(t,r){v5(t,r.toString())},e}(),Xf=function(){function e(){this.tag="button"}return e.prototype.getValue=function(t){return p5(t)},e.prototype.isActive=function(t){return this.getValue(t)===this.type},e.prototype.isDisabled=function(t){return g5(t)},e.prototype.exec=function(t,r){var n=this.type;v5(t,r===n?"paragraph":n)},e}(),bne=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title="H1",r.type="header1",r}return nn(t,e),t}(Xf),Ene=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title="H2",r.type="header2",r}return nn(t,e),t}(Xf),xne=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title="H3",r.type="header3",r}return nn(t,e),t}(Xf),Sne=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title="H4",r.type="header4",r}return nn(t,e),t}(Xf),wne=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title="H5",r.type="header5",r}return nn(t,e),t}(Xf),Cne={key:"headerSelect",factory:function(){return new yne}},Tne={key:"header1",factory:function(){return new bne}},Ane={key:"header2",factory:function(){return new Ene}},Dne={key:"header3",factory:function(){return new xne}},One={key:"header4",factory:function(){return new Sne}},_ne={key:"header5",factory:function(){return new wne}};function Yf(e){return function(t,r){return"<h"+e+">"+r+"</h"+e+">"}}function Zf(e){return function(t,r,n){var i=_e(t);return(r=r.filter(function(o){return!!Rt.isText(o)||!!n.isInline(o)})).length===0&&(r=[{text:i.text().replace(/\s+/gm," ")}]),{type:"header"+e,children:r}}}var Rne={renderElems:[ine,one,ane,sne,lne],elemsToHtml:[{type:"header1",elemToHtml:Yf(1)},{type:"header2",elemToHtml:Yf(2)},{type:"header3",elemToHtml:Yf(3)},{type:"header4",elemToHtml:Yf(4)},{type:"header5",elemToHtml:Yf(5)}],parseElemsHtml:[{selector:"h1:not([data-w-e-type])",parseElemHtml:Zf(1)},{selector:"h2:not([data-w-e-type])",parseElemHtml:Zf(2)},{selector:"h3:not([data-w-e-type])",parseElemHtml:Zf(3)},{selector:"h4:not([data-w-e-type])",parseElemHtml:Zf(4)},{selector:"h5:not([data-w-e-type])",parseElemHtml:Zf(5)}],menus:[Cne,Tne,Ane,Dne,One,_ne],editorPlugin:function(e){var t=e.insertBreak;e.insertNode;var r=e;return r.insertBreak=function(){var n=Dr(de.nodes(r,{match:function(i){return Ae.getNodeType(i).startsWith("header")},universal:!0}),1)[0];n&&Ae.isSelectionAtLineEnd(e,n[1])?Ve.insertNodes(r,{type:"paragraph",children:[{text:""}]},{mode:"highest"}):t()},r}},cd=Object.assign,m5=Object.defineProperty,kne=Qt([].concat),y5=!cd||un(function(){if(Io&&cd({b:1},cd(m5({},"a",{enumerable:!0,get:function(){m5(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(i){t[i]=i}),cd({},e)[r]!=7||od(cd({},t)).join("")!=n})?function(e,t){for(var r=If(e),n=arguments.length,i=1,o=CB.f,a=tB.f;n>i;)for(var s,l=n0(arguments[i++]),u=o?kne(od(l),o(l)):od(l),c=u.length,h=0;c>h;)s=u[h++],Io&&!vn(a,l,s)||(r[s]=l[s]);return r}:cd;function fu(e,t){e.data==null&&(e.data={});var r=e.data;r.style==null&&(r.style={}),Object.assign(r.style,t)}Hn({target:"Object",stat:!0,forced:Object.assign!==y5},{assign:y5});var Lne={selector:"font",preParseHtml:function(e){var t=_e(e);if(ud(t)!=="font")return e;var r=t.attr("color")||"";return r&&(t.removeAttr("color"),t.css("color",r)),t[0]}},b5=function(){function e(){this.tag="button",this.showDropPanel=!0,this.$content=null}return e.prototype.exec=function(t,r){},e.prototype.getValue=function(t){var r=this.mark,n=de.marks(t);return n&&n[r]?n[r]:""},e.prototype.isActive=function(t){return!!this.getValue(t)},e.prototype.isDisabled=function(t){return t.selection==null||!!Dr(de.nodes(t,{match:function(r){return Ae.getNodeType(r)==="pre"||!!de.isVoid(t,r)},universal:!0}),1)[0]},e.prototype.getPanelContentElem=function(t){var r=this.mark;if(this.$content==null){var n=_e('<ul class="w-e-panel-content-color"></ul>');n.on("click","li",function(u){var c=u.target;if(c!=null&&(u.preventDefault(),t.selection!=null)){var h=_e(c).attr("data-value");h==="0"?de.removeMark(t,r):de.addMark(t,r,h)}}),this.$content=n}var i=this.$content;if(i==null)return document.createElement("ul");i.empty();var o=this.getValue(t),a=t.getMenuConfig(r).colors;(a===void 0?[]:a).forEach(function(u){var c=_e('<div class="color-block" data-value="'+u+'"></div>');c.css("background-color",u);var h=_e('<li data-value="'+u+'"></li>');o===u&&h.addClass("active"),h.append(c),i.append(h)});var s="";r==="color"&&(s=wt("color.default")),r==="bgColor"&&(s=wt("color.clear"));var l=_e(`
|
|
|
<li data-value="0" class="clear">
|
|
|
<svg viewBox="0 0 1024 1024"><path d="M236.8 128L896 787.2V128H236.8z m614.4 704L192 172.8V832h659.2zM192 64h704c38.4 0 64 25.6 64 64v704c0 38.4-25.6 64-64 64H192c-38.4 0-64-25.6-64-64V128c0-38.4 25.6-64 64-64z"></path></svg>
|
|
|
`+s+`
|
|
|
</li>
|
|
|
`);return i.prepend(l),i[0]},e}(),Pne=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("color.color"),r.iconSvg=Fre,r.mark="color",r}return nn(t,e),t}(b5),Ine=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("color.bgColor"),r.iconSvg=Nre,r.mark="bgColor",r}return nn(t,e),t}(b5),E5=["rgb(0, 0, 0)","rgb(38, 38, 38)","rgb(89, 89, 89)","rgb(140, 140, 140)","rgb(191, 191, 191)","rgb(217, 217, 217)","rgb(233, 233, 233)","rgb(245, 245, 245)","rgb(250, 250, 250)","rgb(255, 255, 255)","rgb(225, 60, 57)","rgb(231, 95, 51)","rgb(235, 144, 58)","rgb(245, 219, 77)","rgb(114, 192, 64)","rgb(89, 191, 192)","rgb(66, 144, 247)","rgb(54, 88, 226)","rgb(106, 57, 201)","rgb(216, 68, 147)","rgb(251, 233, 230)","rgb(252, 237, 225)","rgb(252, 239, 212)","rgb(252, 251, 207)","rgb(231, 246, 213)","rgb(218, 244, 240)","rgb(217, 237, 250)","rgb(224, 232, 250)","rgb(237, 225, 248)","rgb(246, 226, 234)","rgb(255, 163, 158)","rgb(255, 187, 150)","rgb(255, 213, 145)","rgb(255, 251, 143)","rgb(183, 235, 143)","rgb(135, 232, 222)","rgb(145, 213, 255)","rgb(173, 198, 255)","rgb(211, 173, 247)","rgb(255, 173, 210)","rgb(255, 77, 79)","rgb(255, 122, 69)","rgb(255, 169, 64)","rgb(255, 236, 61)","rgb(115, 209, 61)","rgb(54, 207, 201)","rgb(64, 169, 255)","rgb(89, 126, 247)","rgb(146, 84, 222)","rgb(247, 89, 171)","rgb(207, 19, 34)","rgb(212, 56, 13)","rgb(212, 107, 8)","rgb(212, 177, 6)","rgb(56, 158, 13)","rgb(8, 151, 156)","rgb(9, 109, 217)","rgb(29, 57, 196)","rgb(83, 29, 171)","rgb(196, 29, 127)","rgb(130, 0, 20)","rgb(135, 20, 0)","rgb(135, 56, 0)","rgb(97, 71, 0)","rgb(19, 82, 0)","rgb(0, 71, 79)","rgb(0, 58, 140)","rgb(6, 17, 120)","rgb(34, 7, 94)","rgb(120, 6, 80)"],Mne={renderStyle:function(e,t){var r=e,n=r.color,i=r.bgColor,o=t;return n&&fu(o,{color:n}),i&&fu(o,{backgroundColor:i}),o},styleToHtml:function(e,t){if(!Rt.isText(e))return t;var r,n=e,i=n.color,o=n.bgColor;return i||o?((YC(t)||ud(r=_e(t))!=="span")&&(r=_e("<span>"+t+"</span>")),i&&r.css("color",i),o&&r.css("background-color",o),ld(r)):t},preParseHtml:[Lne],parseStyleHtml:function(e,t,r){var n=_e(e);if(!Rt.isText(t))return t;var i=t,o=Mo(n,"color");o&&(i.color=o);var a=Mo(n,"background-color");return a||(a=Mo(n,"background")),a&&(i.bgColor=a),i},menus:[{key:"color",factory:function(){return new Pne},config:{colors:E5}},{key:"bgColor",factory:function(){return new Ine},config:{colors:E5}}]},Bne=/^(?:\w+:)?\/\/(\S+)$/,Fne=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,Nne=/^[^\s\.]+\.\S{2,}$/,jne=xB.includes;function v0(e){return e===void 0&&(e="r"),e+"-"+SP()}function nT(e){return e.replace(/</g,"<").replace(/>/g,">")}function x5(e,t,r,n){return ks(this,void 0,void 0,function(){var i,o;return Ls(this,function(a){switch(a.label){case 0:return(i=t.getMenuConfig(e).checkLink)?[4,i(r,n)]:[3,2];case 1:if(typeof(o=a.sent())=="string")return t.alert(o,"error"),[2,!1];if(o==null)return[2,!1];a.label=2;case 2:return[2,!0]}})})}function S5(e,t,r){return ks(this,void 0,void 0,function(){var n;return Ls(this,function(i){switch(i.label){case 0:return(n=t.getMenuConfig(e).parseLinkUrl)?[4,n(r)]:[3,2];case 1:return[2,i.sent()];case 2:return[2,r]}})})}function iT(e){return e.selection==null||!!Ae.getSelectedElems(e).some(function(t){var r=t.type;return!!e.isVoid(t)||!!["pre","code","link"].includes(r)||void 0})}function oT(e,t){return{type:"link",url:nT(e),children:t?[{text:t}]:[]}}function w5(e,t,r){return ks(this,void 0,void 0,function(){var n,i,o;return Ls(this,function(a){switch(a.label){case 0:return r?(t||(t=r),e.restoreSelection(),iT(e)?[2]:[4,x5("insertLink",e,t,r)]):[2];case 1:return a.sent()?[4,S5("insertLink",e,r)]:[2];case 2:return n=a.sent(),(i=e.selection)==null||(Qe.isCollapsed(i)?(e.insertText(" "),o=oT(n,t),Ve.insertNodes(e,o),e.insertFragment([{text:" "}])):de.string(e,i)!==t?(e.deleteFragment(),o=oT(n,t),Ve.insertNodes(e,o)):(o=oT(n),Ve.wrapNodes(e,o,{split:!0}),Ve.collapse(e,{edge:"end"}))),[2]}})})}Hn({target:"Array",proto:!0},{includes:function(e){return jne(this,e,arguments.length>1?arguments[1]:void 0)}}),$B("includes");var Une={type:"link",renderElem:function(e,t,r){var n=e,i=n.url,o=n.target;return er("a",{href:i,target:o===void 0?"_blank":o},t)}},Hne={selector:"a:not([data-w-e-type])",parseElemHtml:function(e,t,r){var n=_e(e);return(t=t.filter(function(i){return!!Rt.isText(i)||!!r.isInline(i)})).length===0&&(t=[{text:n.text().replace(/\s+/gm," ")}]),{type:"link",url:n.attr("href")||"",target:n.attr("target")||"",children:t}}};function aT(){return v0("w-e-insert-link")}var zne=function(){function e(){this.title=wt("link.insert"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M440.224 635.776a51.84 51.84 0 0 1-36.768-15.232c-95.136-95.136-95.136-249.92 0-345.056l192-192C641.536 37.408 702.816 12.032 768 12.032s126.432 25.376 172.544 71.456c95.136 95.136 95.136 249.92 0 345.056l-87.776 87.776a51.968 51.968 0 1 1-73.536-73.536l87.776-87.776a140.16 140.16 0 0 0 0-197.984c-26.432-26.432-61.6-40.992-99.008-40.992s-72.544 14.56-99.008 40.992l-192 192a140.16 140.16 0 0 0 0 197.984 51.968 51.968 0 0 1-36.768 88.768z"></path><path d="M256 1012a242.4 242.4 0 0 1-172.544-71.456c-95.136-95.136-95.136-249.92 0-345.056l87.776-87.776a51.968 51.968 0 1 1 73.536 73.536l-87.776 87.776a140.16 140.16 0 0 0 0 197.984c26.432 26.432 61.6 40.992 99.008 40.992s72.544-14.56 99.008-40.992l192-192a140.16 140.16 0 0 0 0-197.984 51.968 51.968 0 1 1 73.536-73.536c95.136 95.136 95.136 249.92 0 345.056l-192 192A242.4 242.4 0 0 1 256 1012z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.textInputId=aT(),this.urlInputId=aT(),this.buttonId=aT()}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.exec=function(t,r){},e.prototype.isDisabled=function(t){return iT(t)},e.prototype.getModalPositionNode=function(t){return null},e.prototype.getModalContentElem=function(t){var r=t.selection,n=this,i=n.textInputId,o=n.urlInputId,a=n.buttonId,s=Dr(Wi(wt("link.text"),i),2),l=s[0],u=_e(s[1]),c=Dr(Wi(wt("link.url"),o),2),h=c[0],S=_e(c[1]),y=Dr(Zc(a,wt("common.ok")),1)[0];if(this.$content==null){var W=_e("<div></div>");W.on("click","#"+a,function(U){U.preventDefault();var D=W.find("#"+i).val(),Q=W.find("#"+o).val();w5(t,D,Q),t.hidePanelOrModal()}),this.$content=W}var B=this.$content;if(B.empty(),B.append(l),B.append(h),B.append(y),r==null||Qe.isCollapsed(r))u.val("");else{var N=de.string(t,r);u.val(N)}return S.val(""),setTimeout(function(){u.focus()}),B[0]},e}();function C5(){return v0("w-e-update-link")}var Wne=function(){function e(){this.title=wt("link.edit"),this.iconSvg=s5,this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.urlInputId=C5(),this.buttonId=C5()}return e.prototype.getSelectedLinkElem=function(t){var r=Ae.getSelectedNodeByType(t,"link");return r==null?null:r},e.prototype.getValue=function(t){var r=this.getSelectedLinkElem(t);return r&&r.url||""},e.prototype.isActive=function(t){return!1},e.prototype.exec=function(t,r){},e.prototype.isDisabled=function(t){return t.selection==null||this.getSelectedLinkElem(t)==null},e.prototype.getModalPositionNode=function(t){return Ae.getSelectedNodeByType(t,"link")},e.prototype.getModalContentElem=function(t){var r=this.urlInputId,n=this.buttonId,i=Dr(Wi(wt("link.url"),r),2),o=i[0],a=_e(i[1]),s=Dr(Zc(n,wt("common.ok")),1)[0];if(this.$content==null){var l=_e("<div></div>");l.on("click","button",function(h){h.preventDefault(),t.restoreSelection();var S=Ae.getSelectedNodeByType(t,"link"),y=S?St.string(S):"",W=l.find("#"+r).val();!function(B,N,U){ks(this,void 0,void 0,function(){var D,Q;return Ls(this,function(te){switch(te.label){case 0:return U?[4,x5("editLink",B,N,U)]:[2];case 1:return te.sent()?[4,S5("editLink",B,U)]:[2];case 2:return D=te.sent(),Q={url:nT(D)},Ve.setNodes(B,Q,{match:function(he){return Ae.checkNodeType(he,"link")}}),[2]}})})}(t,y,W),t.hidePanelOrModal()}),this.$content=l}var u=this.$content;u.empty(),u.append(o),u.append(s);var c=this.getValue(t);return a.val(c),setTimeout(function(){a.focus()}),u[0]},e}(),Gne=function(){function e(){this.title=wt("link.unLink"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M608.16328 811.815036c9.371954 9.371954 9.371954 24.56788 0 33.941834l-89.347563 89.347564c-118.525421 118.523421-311.38448 118.531421-429.919901 0-118.527421-118.529421-118.527421-311.39048 0-429.917901l89.349564-89.349563c9.371954-9.371954 24.56788-9.371954 33.941834 0l79.195613 79.195613c9.371954 9.371954 9.371954 24.56788 0 33.941834l-89.349563 89.347564c-56.143726 56.145726-56.143726 147.49928 0 203.645005 56.143726 56.143726 147.49928 56.145726 203.647005 0l89.347564-89.347563c9.371954-9.371954 24.56788-9.371954 33.941834 0l79.193613 79.195613z m-113.135447-520.429459c9.371954 9.371954 24.56788 9.371954 33.941834 0l89.347564-89.347564c56.143726-56.149726 147.49928-56.145726 203.647006 0 56.143726 56.145726 56.143726 147.49928 0 203.645006l-89.349564 89.347564c-9.371954 9.371954-9.371954 24.56788 0 33.941834l79.195613 79.195613c9.371954 9.371954 24.56788 9.371954 33.941834 0l89.349564-89.349563c118.529421-118.529421 118.529421-311.38848 0-429.917901-118.531421-118.527421-311.38848-118.527421-429.919901 0l-89.347563 89.347564c-9.371954 9.371954-9.371954 24.56788 0 33.941834l79.193613 79.195613z m469.653707 718.556492l45.253779-45.253779c18.745908-18.745908 18.745908-49.13776 0-67.881669L127.195629 14.062931c-18.745908-18.745908-49.13776-18.745908-67.881669 0L14.058181 59.31871c-18.745908 18.745908-18.745908 49.13776 0 67.881669l882.74169 882.74169c18.745908 18.743908 49.13776 18.743908 67.881669 0z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null||Ae.getSelectedNodeByType(t,"link")==null},e.prototype.exec=function(t,r){this.isDisabled(t)||Ve.unwrapNodes(t,{match:function(n){return Ae.checkNodeType(n,"link")}})},e}(),Vne=function(){function e(){this.title=wt("link.view"),this.iconSvg=l5,this.tag="button"}return e.prototype.getSelectedLinkElem=function(t){var r=Ae.getSelectedNodeByType(t,"link");return r==null?null:r},e.prototype.getValue=function(t){var r=this.getSelectedLinkElem(t);return r&&r.url||""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null||this.getSelectedLinkElem(t)==null},e.prototype.exec=function(t,r){if(!this.isDisabled(t)){if(!r||typeof r!="string")throw new Error("View link failed, link url is '"+r+"'");window.open(r,"_blank")}},e}(),T5={checkLink:function(e,t){return!0},parseLinkUrl:function(e){return e}},Kne={renderElems:[Une],elemsToHtml:[{type:"link",elemToHtml:function(e,t){var r=e,n=r.url,i=r.target;return'<a href="'+n+'" target="'+(i===void 0?"_blank":i)+'">'+t+"</a>"}}],parseElemsHtml:[Hne],menus:[{key:"insertLink",factory:function(){return new zne},config:T5},{key:"editLink",factory:function(){return new Wne},config:T5},{key:"unLink",factory:function(){return new Gne}},{key:"viewLink",factory:function(){return new Vne}}],editorPlugin:function(e){var t=e.isInline,r=e.insertData,n=e.normalizeNode;e.insertNode,e.insertText;var i=e;return i.isInline=function(o){return o.type==="link"||t(o)},i.insertData=function(o){var a=o.getData("text/plain");if(function(u){if(typeof u!="string")return!1;var c=u.match(Bne);if(!c)return!1;var h=c[1];return!(!h||!Fne.test(h)&&!Nne.test(h))}(a)){if(!iT(i)){var s=i.selection;if(s!=null){var l=de.string(i,s);w5(i,l,a)}}}else r(o)},i.normalizeNode=function(o){var a=Dr(o,2),s=a[0],l=a[1];return Ae.getNodeType(s)!=="link"?n([s,l]):St.string(s)===""?Ve.removeNodes(i,{at:l}):n([s,l])},i}},$ne=Qt(1 .valueOf),Xne=sr.RangeError,Yne=sr.RangeError,A5=sr.String,D5=Math.floor,sT=Qt(function(e){var t=cn(fo(this)),r="",n=id(e);if(n<0||n==1/0)throw Xne("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r}),O5=Qt("".slice),Jf=Qt(1 .toFixed),dd=function(e,t,r){return t===0?r:t%2==1?dd(e,t-1,r*e):dd(e*e,t/2,r)},hd=function(e,t,r){for(var n=-1,i=r;++n<6;)i+=t*e[n],e[n]=i%1e7,i=D5(i/1e7)},lT=function(e,t){for(var r=6,n=0;--r>=0;)n+=e[r],e[r]=D5(n/t),n=n%t*1e7},_5=function(e){for(var t=6,r="";--t>=0;)if(r!==""||t===0||e[t]!==0){var n=A5(e[t]);r=r===""?n:r+sT("0",7-n.length)+n}return r};function R5(e,t){return"w-e-image-container-"+Ae.findKey(e,t).id}Hn({target:"Number",proto:!0,forced:un(function(){return Jf(8e-5,3)!=="0.000"||Jf(.9,0)!=="1"||Jf(1.255,2)!=="1.25"||Jf(1000000000000000100,0)!=="1000000000000000128"})||!un(function(){Jf({})})},{toFixed:function(e){var t,r,n,i,o=$ne(this),a=id(e),s=[0,0,0,0,0,0],l="",u="0";if(a<0||a>20)throw Yne("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return A5(o);if(o<0&&(l="-",o=-o),o>1e-21)if(r=(t=function(c){for(var h=0,S=c;S>=4096;)h+=12,S/=4096;for(;S>=2;)h+=1,S/=2;return h}(o*dd(2,69,1))-69)<0?o*dd(2,-t,1):o/dd(2,t,1),r*=4503599627370496,(t=52-t)>0){for(hd(s,0,r),n=a;n>=7;)hd(s,1e7,0),n-=7;for(hd(s,dd(10,n,1),0),n=t-1;n>=23;)lT(s,1<<23),n-=23;lT(s,1<<n),hd(s,1,1),lT(s,2),u=_5(s)}else hd(s,0,r),hd(s,1<<-t,0),u=_5(s)+sT("0",a);return a>0?l+((i=u.length)<=a?"0."+sT("0",a-i)+u:O5(u,0,i-a)+"."+O5(u,i-a)):l+u}});var Zne={type:"image",renderElem:function(e,t,r){var n=e,i=n.src,o=n.alt,a=o===void 0?"":o,s=n.href,l=s===void 0?"":s,u=n.style,c=u===void 0?{}:u,h=c.width,S=h===void 0?"":h,y=c.height,W=y===void 0?"":y,B=Ae.isNodeSelected(r,e),N={};S&&(N.width="100%"),W&&(N.height="100%");var U=er("img",{style:N,src:i,alt:a,"data-href":l}),D=r.isDisabled();return B&&!D?function(Q,te,he,Ee){var ve=_e("body"),De=R5(Q,te),Pe=Ee.width,qe=Ee.height,ot=0,et=0,gt=0,dt=!1,ht=null;function pt(It){ht=function(){var Fe=_e("#"+De);if(Fe.length===0)throw new Error("Cannot find image container elem");return Fe}(),ot=It;var Re=ht.find("img");if(Re.length===0)throw new Error("Cannot find image elem");et=Re.width(),gt=Re.height(),ve.on("mousemove",Dt),ve.on("mouseup",Ft);var Te=Ae.getHoverbar(Q);Te&&Te.hideAndClean()}var Dt=Hl(function(It){It.preventDefault();var Re=It.clientX,Te=et+(dt?ot-Re:Re-ot),Fe=gt*(Te/et);ht!=null&&(Te<=15||Fe<=15||(ht.css("width",Te+"px"),ht.css("height",Fe+"px")))},100);function Ft(It){if(ve.off("mousemove",Dt),ht!=null){var Re=ht.width().toFixed(2),Te=ht.height().toFixed(2),Fe={style:Rs(Rs({},te.style),{width:Re+"px",height:Te+"px"})};Ve.setNodes(Q,Fe,{at:Ae.findPath(Q,te)}),ve.off("mouseup",Ft)}}var Bt={};return Pe&&(Bt.width=Pe),qe&&(Bt.height=qe),er("div",{id:De,style:Bt,className:"w-e-image-container w-e-selected-image-container",on:{mousedown:function(It){var Re=_e(It.target);Re.hasClass("w-e-image-dragger")&&(It.preventDefault(),(Re.hasClass("left-top")||Re.hasClass("left-bottom"))&&(dt=!0),pt(It.clientX))}}},he,er("div",{className:"w-e-image-dragger left-top"}),er("div",{className:"w-e-image-dragger right-top"}),er("div",{className:"w-e-image-dragger left-bottom"}),er("div",{className:"w-e-image-dragger right-bottom"}))}(r,e,U,{width:S,height:W}):function(Q,te,he,Ee){var ve=Ee.width,De=Ee.height,Pe={};return ve&&(Pe.width=ve),De&&(Pe.height=De),er("div",{id:R5(Q,te),style:Pe,className:"w-e-image-container"},he)}(r,e,U,{width:S,height:W})}},Jne={selector:"img:not([data-w-e-type])",parseElemHtml:function(e,t,r){var n=_e(e),i=n.attr("data-href")||"";return i=decodeURIComponent(i),{type:"image",src:n.attr("src")||"",alt:n.attr("alt")||"",href:i,style:{width:Mo(n,"width"),height:Mo(n,"height")},children:[{text:""}]}}};function k5(e,t,r,n,i){return n===void 0&&(n=""),i===void 0&&(i=""),ks(this,void 0,void 0,function(){var o,a;return Ls(this,function(s){switch(s.label){case 0:return(o=t.getMenuConfig(e).checkImage)?[4,o(r,n,i)]:[3,2];case 1:if(typeof(a=s.sent())=="string")return t.alert(a,"error"),[2,!1];if(a==null)return[2,!1];s.label=2;case 2:return[2,!0]}})})}function L5(e,t,r){return ks(this,void 0,void 0,function(){var n;return Ls(this,function(i){switch(i.label){case 0:return(n=t.getMenuConfig(e).parseImageSrc)?[4,n(r)]:[3,2];case 1:return[2,i.sent()];case 2:return[2,r]}})})}function pu(e,t,r,n){return r===void 0&&(r=""),n===void 0&&(n=""),ks(this,void 0,void 0,function(){var i,o,a;return Ls(this,function(s){switch(s.label){case 0:return[4,k5("insertImage",e,t,r,n)];case 1:return s.sent()?[4,L5("insertImage",e,t)]:[2];case 2:return i=s.sent(),o={type:"image",src:nT(i),href:n,alt:r,style:{},children:[{text:""}]},e.selection===null&&e.restoreSelection(),Ae.getSelectedNodeByType(e,"image")&&e.move(1),m0(e)||(Ve.insertNodes(e,o),(a=e.getMenuConfig("insertImage").onInsertedImage)&&a(o)),[2]}})})}function m0(e){var t=e.selection;return t==null||!Qe.isCollapsed(t)||!!Dr(de.nodes(e,{match:function(r){var n=Ae.getNodeType(r);return n==="code"||n==="pre"||n==="link"||n==="list-item"||!!n.startsWith("header")||n==="blockquote"||!!de.isVoid(e,r)},universal:!0}),1)[0]}function y0(){return v0("w-e-insert-image")}var Qne=function(){function e(){this.title=wt("image.netImage"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M959.877 128l0.123 0.123v767.775l-0.123 0.122H64.102l-0.122-0.122V128.123l0.122-0.123h895.775zM960 64H64C28.795 64 0 92.795 0 128v768c0 35.205 28.795 64 64 64h896c35.205 0 64-28.795 64-64V128c0-35.205-28.795-64-64-64zM832 288.01c0 53.023-42.988 96.01-96.01 96.01s-96.01-42.987-96.01-96.01S682.967 192 735.99 192 832 234.988 832 288.01zM896 832H128V704l224.01-384 256 320h64l224.01-192z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.srcInputId=y0(),this.altInputId=y0(),this.hrefInputId=y0(),this.buttonId=y0()}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.exec=function(t,r){},e.prototype.isDisabled=function(t){return m0(t)},e.prototype.getModalPositionNode=function(t){return null},e.prototype.getModalContentElem=function(t){var r=this,n=this,i=n.srcInputId,o=n.altInputId,a=n.hrefInputId,s=n.buttonId,l=Dr(Wi(wt("image.src"),i),2),u=l[0],c=_e(l[1]),h=Dr(Wi(wt("image.desc"),o),2),S=h[0],y=_e(h[1]),W=Dr(Wi(wt("image.link"),a),2),B=W[0],N=_e(W[1]),U=Dr(Zc(s,wt("common.ok")),1)[0];if(this.$content==null){var D=_e("<div></div>");D.on("click","#"+s,function(te){te.preventDefault();var he=D.find("#"+i).val().trim(),Ee=D.find("#"+o).val().trim(),ve=D.find("#"+a).val().trim();r.insertImage(t,he,Ee,ve),t.hidePanelOrModal()}),this.$content=D}var Q=this.$content;return Q.empty(),Q.append(u),Q.append(S),Q.append(B),Q.append(U),c.val(""),y.val(""),N.val(""),setTimeout(function(){c.focus()}),Q[0]},e.prototype.insertImage=function(t,r,n,i){n===void 0&&(n=""),i===void 0&&(i=""),r&&(t.restoreSelection(),this.isDisabled(t)||pu(t,r,n,i))},e}(),qne=function(){function e(){this.title=wt("image.delete"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M826.8032 356.5312c-19.328 0-36.3776 15.6928-36.3776 35.0464v524.2624c0 19.328-16 34.56-35.328 34.56H264.9344c-19.328 0-35.5072-15.3088-35.5072-34.56V390.0416c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.6928-33.5104 35.0464V915.712c0 57.9328 44.6208 108.288 102.528 108.288H755.2c57.9328 0 108.0832-50.4576 108.0832-108.288V391.4752c-0.1024-19.2512-17.1264-34.944-36.48-34.944z" p-id="9577"></path><path d="M437.1712 775.7568V390.6048c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.616-33.5104 35.0464v385.152c0 19.328 14.1568 35.0464 33.5104 35.0464s33.5104-15.7184 33.5104-35.0464zM649.7024 775.7568V390.6048c0-19.328-17.0496-35.0464-36.3776-35.0464s-36.3776 15.616-36.3776 35.0464v385.152c0 19.328 17.0496 35.0464 36.3776 35.0464s36.3776-15.7184 36.3776-35.0464zM965.0432 217.0368h-174.6176V145.5104c0-57.9328-47.2064-101.76-104.6528-101.76h-350.976c-57.8304 0-105.3952 43.8528-105.3952 101.76v71.5264H54.784c-19.4304 0-35.0464 14.1568-35.0464 33.5104 0 19.328 15.616 33.5104 35.0464 33.5104h910.3616c19.328 0 35.0464-14.1568 35.0464-33.5104 0-19.3536-15.6928-33.5104-35.1488-33.5104z m-247.3728 0H297.3952V145.5104c0-19.328 18.2016-34.7648 37.4272-34.7648h350.976c19.1488 0 31.872 15.1296 31.872 34.7648v71.5264z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null||Ae.getSelectedNodeByType(t,"image")==null},e.prototype.exec=function(t,r){this.isDisabled(t)||Ve.removeNodes(t,{match:function(n){return Ae.checkNodeType(n,"image")}})},e}();function b0(){return v0("w-e-edit-image")}var eie=function(){function e(){this.title=wt("image.edit"),this.iconSvg=s5,this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.srcInputId=b0(),this.altInputId=b0(),this.hrefInputId=b0(),this.buttonId=b0()}return e.prototype.getValue=function(t){return""},e.prototype.getImageNode=function(t){return Ae.getSelectedNodeByType(t,"image")},e.prototype.isActive=function(t){return!1},e.prototype.exec=function(t,r){},e.prototype.isDisabled=function(t){var r=t.selection;return r==null||!Qe.isCollapsed(r)||Ae.getSelectedNodeByType(t,"image")==null},e.prototype.getModalPositionNode=function(t){return this.getImageNode(t)},e.prototype.getModalContentElem=function(t){var r=this,n=this,i=n.srcInputId,o=n.altInputId,a=n.hrefInputId,s=n.buttonId,l=this.getImageNode(t);if(l==null)throw new Error("Not found selected image node");var u=Dr(Wi(wt("image.src"),i),2),c=u[0],h=_e(u[1]),S=Dr(Wi(wt("image.desc"),o),2),y=S[0],W=_e(S[1]),B=Dr(Wi(wt("image.link"),a),2),N=B[0],U=_e(B[1]),D=Dr(Zc(s,wt("common.ok")),1)[0];if(this.$content==null){var Q=_e("<div></div>");Q.on("click","#"+s,function(ot){ot.preventDefault();var et=Q.find("#"+i).val(),gt=Q.find("#"+o).val(),dt=Q.find("#"+a).val();r.updateImage(t,et,gt,dt),t.hidePanelOrModal()}),this.$content=Q}var te=this.$content;te.empty(),te.append(c),te.append(y),te.append(N),te.append(D);var he=l,Ee=he.src,ve=he.alt,De=ve===void 0?"":ve,Pe=he.href,qe=Pe===void 0?"":Pe;return h.val(Ee),W.val(De),U.val(qe),setTimeout(function(){h.focus()}),te[0]},e.prototype.updateImage=function(t,r,n,i,o){n===void 0&&(n=""),i===void 0&&(i=""),o===void 0&&(o={}),r&&(t.restoreSelection(),this.isDisabled(t)||function(a,s,l,u,c){l===void 0&&(l=""),u===void 0&&(u=""),c===void 0&&(c={}),ks(this,void 0,void 0,function(){var h,S,y,W,B,N;return Ls(this,function(U){switch(U.label){case 0:return[4,k5("editImage",a,s,l,u)];case 1:return U.sent()?[4,L5("editImage",a,s)]:[2];case 2:return h=U.sent(),(S=Ae.getSelectedNodeByType(a,"image"))==null||(y=S.style,W={src:h,alt:l,href:u,style:Rs(Rs({},y===void 0?{}:y),c)},Ve.setNodes(a,W,{match:function(D){return Ae.checkNodeType(D,"image")}}),B=Ae.getSelectedNodeByType(a,"image"),(N=a.getMenuConfig("editImage").onUpdatedImage)&&N(B)),[2]}})})}(t,r,n,i,o))},e}(),tie=function(){function e(){this.title=wt("image.viewLink"),this.iconSvg=l5,this.tag="button"}return e.prototype.getValue=function(t){var r=Ae.getSelectedNodeByType(t,"image");return r&&r.href||""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null||!this.getValue(t)},e.prototype.exec=function(t,r){if(!this.isDisabled(t)){if(!r||typeof r!="string")throw new Error("View image link failed, image.href is '"+r+"'");window.open(r,"_blank")}},e}(),uT=function(){function e(){this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.getSelectedNode=function(t){return Ae.getSelectedNodeByType(t,"image")},e.prototype.isDisabled=function(t){return t.selection==null||this.getSelectedNode(t)==null},e.prototype.exec=function(t,r){if(!this.isDisabled(t)){var n=this.getSelectedNode(t);if(n!=null){var i=Ae.getHoverbar(t);i&&i.hideAndClean();var o=n.style,a={style:Rs(Rs({},o===void 0?{}:o),{width:this.value,height:""})};Ve.setNodes(t,a,{match:function(s){return Ae.checkNodeType(s,"image")}})}}},e}(),rie=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title="30%",r.value="30%",r}return nn(t,e),t}(uT),nie=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title="50%",r.value="50%",r}return nn(t,e),t}(uT),iie=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title="100%",r.value="100%",r}return nn(t,e),t}(uT),P5={onInsertedImage:function(e){},onUpdatedImage:function(e){},checkImage:function(e,t,r){return!0},parseImageSrc:function(e){return e}},oie={renderElems:[Zne],elemsToHtml:[{type:"image",elemToHtml:function(e,t){var r=e,n=r.src,i=r.alt,o=i===void 0?"":i,a=r.href,s=a===void 0?"":a,l=r.style,u=l===void 0?{}:l,c=u.width,h=c===void 0?"":c,S=u.height,y=S===void 0?"":S,W="";return h&&(W+="width: "+h+";"),y&&(W+="height: "+y+";"),'<img src="'+n+'" alt="'+o+'" data-href="'+s+'" style="'+W+'"/>'}}],parseElemsHtml:[Jne],menus:[{key:"insertImage",factory:function(){return new Qne},config:P5},{key:"deleteImage",factory:function(){return new qne}},{key:"editImage",factory:function(){return new eie},config:P5},{key:"viewImageLink",factory:function(){return new tie}},{key:"imageWidth30",factory:function(){return new rie}},{key:"imageWidth50",factory:function(){return new nie}},{key:"imageWidth100",factory:function(){return new iie}}],editorPlugin:function(e){var t=e.isInline,r=e.isVoid;e.insertNode;var n=e;return n.isInline=function(i){return i.type==="image"||t(i)},n.isVoid=function(i){return i.type==="image"||r(i)},n}},aie={type:"todo",renderElem:function(e,t,r){var n=!1;r.isDisabled()&&(n=!0);var i=er("div",{style:{margin:"5px 0"}},er("span",{contentEditable:!1,style:{marginRight:"0.5em"}},er("input",{type:"checkbox",checked:e.checked,disabled:n,on:{change:function(o){var a=Ae.findPath(r,e),s={checked:o.target.checked};Ve.setNodes(r,s,{at:a})}}})),er("span",null,t));return i}},sie=function(){function e(){this.title=wt("todo.todo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M278.755556 403.911111l-79.644445 79.644445L455.111111 739.555556l568.888889-568.888889-79.644444-79.644445L455.111111 580.266667l-176.355555-176.355556zM910.222222 910.222222H113.777778V113.777778h568.888889V0H113.777778C51.2 0 0 51.2 0 113.777778v796.444444c0 62.577778 51.2 113.777778 113.777778 113.777778h796.444444c62.577778 0 113.777778-51.2 113.777778-113.777778V455.111111h-113.777778v455.111111z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!!Ae.getSelectedNodeByType(t,"todo")},e.prototype.isDisabled=function(t){return t.selection==null||!!Ae.getSelectedElems(t).some(function(r){if(de.isVoid(t,r)&&de.isBlock(t,r))return!0;var n=r.type;return!!["pre","table","list-item"].includes(n)||void 0})},e.prototype.exec=function(t,r){var n=this.isActive(t);Ve.setNodes(t,{type:n?"paragraph":"todo"})},e}(),lie={selector:'div[data-w-e-type="todo"]',parseElemHtml:function(e,t,r){var n=_e(e);(t=t.filter(function(o){return!!Rt.isText(o)||!!r.isInline(o)})).length===0&&(t=[{text:n.text().replace(/\s+/gm," ")}]);var i=!1;return n.find('input[type="checkbox"]').attr("checked")!=null&&(i=!0),{type:"todo",checked:i,children:t}}},uie={renderElems:[aie],elemsToHtml:[{type:"todo",elemToHtml:function(e,t){return'<div data-w-e-type="todo"><input type="checkbox" disabled '+(e.checked?"checked":"")+">"+t+"</div>"}}],preParseHtml:[{selector:"ul.w-e-todo",preParseHtml:function(e){var t=_e(e).find("li"),r=_e('<div data-w-e-type="todo"></div>'),n=t.find("input[type]");return r.append(n),t.children()[0].remove(),r[0].innerHTML=r[0].innerHTML+t[0].innerHTML,r[0]}}],parseElemsHtml:[lie],menus:[{key:"todo",factory:function(){return new sie}}],editorPlugin:function(e){var t=e.deleteBackward,r=e;return r.deleteBackward=function(n){var i=e.selection;if(i&&Qe.isCollapsed(i)){var o=Ae.getSelectedNodeByType(e,"todo");if(o&&St.string(o).length===0)return void Ve.setNodes(e,{type:"paragraph"},{mode:"highest"})}t(n)},r}},cie={type:"blockquote",renderElem:function(e,t,r){return er("blockquote",null,t)}},die={selector:"blockquote:not([data-w-e-type])",parseElemHtml:function(e,t,r){var n=_e(e);return(t=t.filter(function(i){return!!Rt.isText(i)||!!r.isInline(i)})).length===0&&(t=[{text:n.text().replace(/\s+/gm," ")}]),{type:"blockquote",children:t}}},hie=function(){function e(){this.title=wt("blockQuote.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M894.6 907.1H605.4c-32.6 0-59-26.4-59-59V608.2l-4-14.9c0-315.9 125.5-485.1 376.5-507.5v59.8C752.7 180.4 711.3 315.8 711.3 442.4v41.2l31.5 12.3h151.8c32.6 0 59 26.4 59 59v293.2c0 32.5-26.4 59-59 59z m-472 0H133.4c-32.6 0-59-26.4-59-59V608.2l-4-14.9c0-315.9 125.5-485.1 376.5-507.5v59.8C280.7 180.4 239.3 315.8 239.3 442.4v41.2l31.5 12.3h151.8c32.6 0 59 26.4 59 59v293.2c0 32.5-26.4 59-59 59z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!!Ae.getSelectedNodeByType(t,"blockquote")},e.prototype.isDisabled=function(t){return t.selection==null||!Dr(de.nodes(t,{match:function(r){var n=Ae.getNodeType(r);return n==="paragraph"||n==="blockquote"},universal:!0,mode:"highest"}),1)[0]},e.prototype.exec=function(t,r){if(!this.isDisabled(t)){var n=this.isActive(t)?"paragraph":"blockquote";Ve.setNodes(t,{type:n},{mode:"highest"})}},e}(),fie={key:"blockquote",factory:function(){return new hie}},pie=Qt([].slice),gie=OC("slice"),vie=Vi("species"),cT=sr.Array,mie=Math.max;Hn({target:"Array",proto:!0,forced:!gie},{slice:function(e,t){var r,n,i,o=ed(this),a=l0(o),s=Nf(e,a),l=Nf(t===void 0?a:t,a);if(c0(o)&&(r=o.constructor,(DC(r)&&(r===cT||c0(r.prototype))||po(r)&&(r=r[vie])===null)&&(r=void 0),r===cT||r===void 0))return pie(o,s,l);for(n=new(r===void 0?cT:r)(mie(l-s,0)),i=0;s<l;s++,i++)s in o&&ZB(n,i,o[s]);return n.length=i,n}});var yie={renderElems:[cie],elemsToHtml:[{type:"blockquote",elemToHtml:function(e,t){return"<blockquote>"+t+"</blockquote>"}}],parseElemsHtml:[die],menus:[fie],editorPlugin:function(e){var t=e.insertBreak,r=e.insertText,n=e;return n.insertBreak=function(){var i=n.selection;if(i==null)return t();var o=Dr(de.nodes(e,{match:function(c){return Ae.checkNodeType(c,"blockquote")},universal:!0}),1)[0];if(!o)return t();var a=o[0],s=Ae.findPath(e,a),l=de.end(e,s);if(cr.equals(l,i.focus)){var u=St.string(a);if(u&&u.slice(-1)===`
|
|
|
`)return e.deleteBackward("character"),void Ve.insertNodes(n,{type:"paragraph",children:[{text:""}]},{mode:"highest"})}r(`
|
|
|
`)},n}},bie=function(){function e(){this.title=wt("emotion.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M512 1024C230.4 1024 0 793.6 0 512S230.4 0 512 0s512 230.4 512 512-230.4 512-512 512z m0-102.4c226.742857 0 409.6-182.857143 409.6-409.6S738.742857 102.4 512 102.4 102.4 285.257143 102.4 512s182.857143 409.6 409.6 409.6z m-204.8-358.4h409.6c0 113.371429-91.428571 204.8-204.8 204.8s-204.8-91.428571-204.8-204.8z m0-102.4c-43.885714 0-76.8-32.914286-76.8-76.8s32.914286-76.8 76.8-76.8 76.8 32.914286 76.8 76.8-32.914286 76.8-76.8 76.8z m409.6 0c-43.885714 0-76.8-32.914286-76.8-76.8s32.914286-76.8 76.8-76.8c43.885714 0 76.8 32.914286 76.8 76.8s-32.914286 76.8-76.8 76.8z"></path></svg>',this.tag="button",this.showDropPanel=!0,this.$content=null}return e.prototype.exec=function(t,r){},e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null||!!Dr(de.nodes(t,{match:function(r){return Ae.getNodeType(r)==="pre"||!!de.isVoid(t,r)},universal:!0}),1)[0]},e.prototype.getPanelContentElem=function(t){if(this.$content==null){var r=_e('<ul class="w-e-panel-content-emotion"></ul>');r.on("click","li",function(o){var a=o.target;if(a!=null){o.preventDefault();var s=_e(a).text();t.insertText(s)}}),this.$content=r}var n=this.$content;if(n==null)return document.createElement("ul");n.empty();var i=t.getMenuConfig("emotion").emotions;return(i===void 0?[]:i).forEach(function(o){var a=_e("<li>"+o+"</li>");n.append(a)}),n[0]},e}(),Eie={menus:[{key:"emotion",factory:function(){return new bie},config:{emotions:"\u{1F600} \u{1F603} \u{1F604} \u{1F601} \u{1F606} \u{1F605} \u{1F602} \u{1F923} \u{1F60A} \u{1F607} \u{1F642} \u{1F643} \u{1F609} \u{1F60C} \u{1F60D} \u{1F618} \u{1F617} \u{1F619} \u{1F61A} \u{1F60B} \u{1F61B} \u{1F61D} \u{1F61C} \u{1F913} \u{1F60E} \u{1F60F} \u{1F612} \u{1F61E} \u{1F614} \u{1F61F} \u{1F615} \u{1F641} \u{1F623} \u{1F616} \u{1F62B} \u{1F629} \u{1F622} \u{1F62D} \u{1F624} \u{1F620} \u{1F621} \u{1F633} \u{1F631} \u{1F628} \u{1F917} \u{1F914} \u{1F636} \u{1F611} \u{1F62C} \u{1F644} \u{1F62F} \u{1F634} \u{1F637} \u{1F911} \u{1F608} \u{1F921} \u{1F4A9} \u{1F47B} \u{1F480} \u{1F440} \u{1F463} \u{1F450} \u{1F64C} \u{1F44F} \u{1F91D} \u{1F44D} \u{1F44E} \u{1F44A} \u270A \u{1F91B} \u{1F91C} \u{1F91E} \u270C\uFE0F \u{1F918} \u{1F44C} \u{1F448} \u{1F449} \u{1F446} \u{1F447} \u261D\uFE0F \u270B \u{1F91A} \u{1F590} \u{1F596} \u{1F44B} \u{1F919} \u{1F4AA} \u{1F595} \u270D\uFE0F \u{1F64F}".split(" ")}}]},xie={1:"12px",2:"14px",3:"16px",4:"19px",5:"24px",6:"32px",7:"48px"},Sie={selector:"font",preParseHtml:function(e){var t=_e(e);if(ud(t)!=="font")return e;var r=t.attr("size")||"";r&&(t.removeAttr("size"),t.css("font-size",xie[r]));var n=t.attr("face")||"";return n&&(t.removeAttr("face"),t.css("font-family",n)),t[0]}},wie=Qt("".indexOf);Hn({target:"String",proto:!0,forced:!d5("includes")},{includes:function(e){return!!~wie(cn(fo(this)),cn(c5(e)),arguments.length>1?arguments[1]:void 0)}});var Ps,E0,x0=function(e){return e&&e.Math==Math&&e},hr=x0(typeof globalThis=="object"&&globalThis)||x0(typeof window=="object"&&window)||x0(typeof self=="object"&&self)||x0(typeof qm=="object"&&qm)||function(){return this}()||Function("return this")(),dT=Function.prototype,I5=dT.apply,Cie=dT.bind,M5=dT.call,B5=typeof Reflect=="object"&&Reflect.apply||(Cie?M5.bind(I5):function(){return M5.apply(I5,arguments)}),F5=Function.prototype,hT=F5.bind,fT=F5.call,Tie=hT&&hT.bind(fT),mn=hT?function(e){return e&&Tie(fT,e)}:function(e){return e&&function(){return fT.apply(e,arguments)}},oi=function(e){return typeof e=="function"},$i=function(e){try{return!!e()}catch(t){return!0}},ki=!$i(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Qf=Function.prototype.call,Bo=Qf.bind?Qf.bind(Qf):function(){return Qf.apply(Qf,arguments)},N5={}.propertyIsEnumerable,j5=Object.getOwnPropertyDescriptor,Aie=j5&&!N5.call({1:2},1)?function(e){var t=j5(this,e);return!!t&&t.enumerable}:N5,pT={f:Aie},gu=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Die=mn({}.toString),Oie=mn("".slice),vu=function(e){return Oie(Die(e),8,-1)},gT=hr.Object,_ie=mn("".split),U5=$i(function(){return!gT("z").propertyIsEnumerable(0)})?function(e){return vu(e)=="String"?_ie(e,""):gT(e)}:gT,Rie=hr.TypeError,vT=function(e){if(e==null)throw Rie("Can't call method on "+e);return e},ia=function(e){return U5(vT(e))},vo=function(e){return typeof e=="object"?e!==null:oi(e)},mo={},H5=function(e){return oi(e)?e:void 0},qf=function(e,t){return arguments.length<2?H5(mo[e])||H5(hr[e]):mo[e]&&mo[e][t]||hr[e]&&hr[e][t]},z5=mn({}.isPrototypeOf),mT=qf("navigator","userAgent")||"",W5=hr.process,G5=hr.Deno,V5=W5&&W5.versions||G5&&G5.version,K5=V5&&V5.v8;K5&&(E0=(Ps=K5.split("."))[0]>0&&Ps[0]<4?1:+(Ps[0]+Ps[1])),!E0&&mT&&(!(Ps=mT.match(/Edge\/(\d+)/))||Ps[1]>=74)&&(Ps=mT.match(/Chrome\/(\d+)/))&&(E0=+Ps[1]);var S0=E0,oa=!!Object.getOwnPropertySymbols&&!$i(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&S0&&S0<41}),yT=oa&&!Symbol.sham&&typeof Symbol.iterator=="symbol",kie=hr.Object,fd=yT?function(e){return typeof e=="symbol"}:function(e){var t=qf("Symbol");return oi(t)&&z5(t.prototype,kie(e))},Lie=hr.String,Pie=hr.TypeError,$5=function(e){if(oi(e))return e;throw Pie(function(t){try{return Lie(t)}catch(r){return"Object"}}(e)+" is not a function")},Iie=hr.TypeError,Mie=Object.defineProperty,Is=hr["__core-js_shared__"]||function(e,t){try{Mie(hr,e,{value:t,configurable:!0,writable:!0})}catch(r){hr[e]=t}return t}("__core-js_shared__",{}),mu=e0(function(e){(e.exports=function(t,r){return Is[t]||(Is[t]=r!==void 0?r:{})})("versions",[]).push({version:"3.19.3",mode:"pure",copyright:"\xA9 2021 Denis Pushkarev (zloirock.ru)"})}),Bie=hr.Object,ep=function(e){return Bie(vT(e))},Fie=mn({}.hasOwnProperty),Or=Object.hasOwn||function(e,t){return Fie(ep(e),t)},Nie=0,jie=Math.random(),Uie=mn(1 .toString),w0=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Uie(++Nie+jie,36)},tp=mu("wks"),yu=hr.Symbol,X5=yu&&yu.for,Hie=yT?yu:yu&&yu.withoutSetter||w0,Xi=function(e){if(!Or(tp,e)||!oa&&typeof tp[e]!="string"){var t="Symbol."+e;oa&&Or(yu,e)?tp[e]=yu[e]:tp[e]=yT&&X5?X5(t):Hie(t)}return tp[e]},zie=hr.TypeError,Wie=Xi("toPrimitive"),pd=function(e){var t=function(r,n){if(!vo(r)||fd(r))return r;var i,o,a=(i=r[Wie])==null?void 0:$5(i);if(a){if(n===void 0&&(n="default"),o=Bo(a,r,n),!vo(o)||fd(o))return o;throw zie("Can't convert object to primitive value")}return n===void 0&&(n="number"),function(s,l){var u,c;if(l==="string"&&oi(u=s.toString)&&!vo(c=Bo(u,s)))return c;if(oi(u=s.valueOf)&&!vo(c=Bo(u,s)))return c;if(l!=="string"&&oi(u=s.toString)&&!vo(c=Bo(u,s)))return c;throw Iie("Can't convert object to primitive value")}(r,n)}(e,"string");return fd(t)?t:t+""},bT=hr.document,Gie=vo(bT)&&vo(bT.createElement),Y5=function(e){return Gie?bT.createElement(e):{}},Z5=!ki&&!$i(function(){return Object.defineProperty(Y5("div"),"a",{get:function(){return 7}}).a!=7}),J5=Object.getOwnPropertyDescriptor,ET={f:ki?J5:function(e,t){if(e=ia(e),t=pd(t),Z5)try{return J5(e,t)}catch(r){}if(Or(e,t))return gu(!Bo(pT.f,e,t),e[t])}},Vie=/#|\.prototype\./,rp=function(e,t){var r=$ie[Kie(e)];return r==Yie||r!=Xie&&(oi(t)?$i(t):!!t)},Kie=rp.normalize=function(e){return String(e).replace(Vie,".").toLowerCase()},$ie=rp.data={},Xie=rp.NATIVE="N",Yie=rp.POLYFILL="P",Zie=rp,Q5=mn(mn.bind),q5=function(e,t){return $5(e),t===void 0?e:Q5?Q5(e,t):function(){return e.apply(t,arguments)}},Jie=hr.String,Qie=hr.TypeError,bu=function(e){if(vo(e))return e;throw Qie(Jie(e)+" is not an object")},qie=hr.TypeError,eF=Object.defineProperty,Eu={f:ki?eF:function(e,t,r){if(bu(e),t=pd(t),bu(r),Z5)try{return eF(e,t,r)}catch(n){}if("get"in r||"set"in r)throw qie("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},aa=ki?function(e,t,r){return Eu.f(e,t,gu(1,r))}:function(e,t,r){return e[t]=r,e},eoe=ET.f,toe=function(e){var t=function(r,n,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,n)}return new e(r,n,i)}return B5(e,this,arguments)};return t.prototype=e.prototype,t},Ms=function(e,t){var r,n,i,o,a,s,l,u,c=e.target,h=e.global,S=e.stat,y=e.proto,W=h?hr:S?hr[c]:(hr[c]||{}).prototype,B=h?mo:mo[c]||aa(mo,c,{})[c],N=B.prototype;for(i in t)r=!Zie(h?i:c+(S?".":"#")+i,e.forced)&&W&&Or(W,i),a=B[i],r&&(s=e.noTargetGet?(u=eoe(W,i))&&u.value:W[i]),o=r&&s?s:t[i],r&&typeof a==typeof o||(l=e.bind&&r?q5(o,hr):e.wrap&&r?toe(o):y&&oi(o)?mn(o):o,(e.sham||o&&o.sham||a&&a.sham)&&aa(l,"sham",!0),aa(B,i,l),y&&(Or(mo,n=c+"Prototype")||aa(mo,n,{}),aa(mo[n],i,o),e.real&&N&&!N[i]&&aa(N,i,o)))},C0=Array.isArray||function(e){return vu(e)=="Array"},roe=Math.ceil,noe=Math.floor,xT=function(e){var t=+e;return t!=t||t===0?0:(t>0?noe:roe)(t)},ioe=Math.min,T0=function(e){return(t=e.length)>0?ioe(xT(t),9007199254740991):0;var t},ST=function(e,t,r){var n=pd(t);n in e?Eu.f(e,n,gu(0,r)):e[n]=r},tF={};tF[Xi("toStringTag")]="z";var wT=String(tF)==="[object z]",ooe=Xi("toStringTag"),aoe=hr.Object,soe=vu(function(){return arguments}())=="Arguments",A0=wT?vu:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=function(i,o){try{return i[o]}catch(a){}}(t=aoe(e),ooe))=="string"?r:soe?vu(t):(n=vu(t))=="Object"&&oi(t.callee)?"Arguments":n},loe=mn(Function.toString);oi(Is.inspectSource)||(Is.inspectSource=function(e){return loe(e)});var rF=Is.inspectSource,nF=function(){},uoe=[],iF=qf("Reflect","construct"),CT=/^\s*(?:class|function)\b/,coe=mn(CT.exec),doe=!CT.exec(nF),np=function(e){if(!oi(e))return!1;try{return iF(nF,uoe,e),!0}catch(t){return!1}},hoe=!iF||$i(function(){var e;return np(np.call)||!np(Object)||!np(function(){e=!0})||e})?function(e){if(!oi(e))return!1;switch(A0(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return doe||!!coe(CT,rF(e))}:np,foe=Xi("species"),oF=hr.Array,aF=function(e,t){return new(function(r){var n;return C0(r)&&(n=r.constructor,(hoe(n)&&(n===oF||C0(n.prototype))||vo(n)&&(n=n[foe])===null)&&(n=void 0)),n===void 0?oF:n}(e))(t===0?0:t)},poe=Xi("species"),sF=Xi("isConcatSpreadable"),lF=hr.TypeError,goe=S0>=51||!$i(function(){var e=[];return e[sF]=!1,e.concat()[0]!==e}),voe=S0>=51||!$i(function(){var e=[];return(e.constructor={})[poe]=function(){return{foo:1}},e.concat(Boolean).foo!==1}),moe=function(e){if(!vo(e))return!1;var t=e[sF];return t!==void 0?!!t:C0(e)};Ms({target:"Array",proto:!0,forced:!goe||!voe},{concat:function(e){var t,r,n,i,o,a=ep(this),s=aF(a,0),l=0;for(t=-1,n=arguments.length;t<n;t++)if(moe(o=t===-1?a:arguments[t])){if(l+(i=T0(o))>9007199254740991)throw lF("Maximum allowed index exceeded");for(r=0;r<i;r++,l++)r in o&&ST(s,l,o[r])}else{if(l>=9007199254740991)throw lF("Maximum allowed index exceeded");ST(s,l++,o)}return s.length=l,s}});var D0,yoe=hr.String,O0=function(e){if(A0(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return yoe(e)},boe=Math.max,Eoe=Math.min,TT=function(e,t){var r=xT(e);return r<0?boe(r+t,0):Eoe(r,t)},uF=function(e){return function(t,r,n){var i,o=ia(t),a=T0(o),s=TT(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},xoe={includes:uF(!0),indexOf:uF(!1)},ip={},Soe=xoe.indexOf,cF=mn([].push),dF=function(e,t){var r,n=ia(e),i=0,o=[];for(r in n)!Or(ip,r)&&Or(n,r)&&cF(o,r);for(;t.length>i;)Or(n,r=t[i++])&&(~Soe(o,r)||cF(o,r));return o},_0=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],AT=Object.keys||function(e){return dF(e,_0)},woe=ki?Object.defineProperties:function(e,t){bu(e);for(var r,n=ia(t),i=AT(t),o=i.length,a=0;o>a;)Eu.f(e,r=i[a++],n[r]);return e},Coe=qf("document","documentElement"),hF=mu("keys"),R0=function(e){return hF[e]||(hF[e]=w0(e))},fF=R0("IE_PROTO"),DT=function(){},pF=function(e){return"<script>"+e+"</script>"},gF=function(e){e.write(pF("")),e.close();var t=e.parentWindow.Object;return e=null,t},k0=function(){try{D0=new ActiveXObject("htmlfile")}catch(n){}var e,t;k0=typeof document!="undefined"?document.domain&&D0?gF(D0):((t=Y5("iframe")).style.display="none",Coe.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(pF("document.F=Object")),e.close(),e.F):gF(D0);for(var r=_0.length;r--;)delete k0.prototype[_0[r]];return k0()};ip[fF]=!0;var L0,op,P0,xu=Object.create||function(e,t){var r;return e!==null?(DT.prototype=bu(e),r=new DT,DT.prototype=null,r[fF]=e):r=k0(),t===void 0?r:woe(r,t)},Toe=_0.concat("length","prototype"),vF={f:Object.getOwnPropertyNames||function(e){return dF(e,Toe)}},Aoe=hr.Array,Doe=Math.max,mF=vF.f,yF=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],bF={f:function(e){return yF&&vu(e)=="Window"?function(t){try{return mF(t)}catch(r){return function(n,i,o){for(var a=T0(n),s=TT(void 0,a),l=TT(a,a),u=Aoe(Doe(l-s,0)),c=0;s<l;s++,c++)ST(u,c,n[s]);return u.length=c,u}(yF)}}(e):mF(ia(e))}},OT={f:Object.getOwnPropertySymbols},Ooe=mn([].slice),gd=function(e,t,r,n){n&&n.enumerable?e[t]=r:aa(e,t,r)},_T={f:Xi},_oe=Eu.f,wn=function(e){var t=mo.Symbol||(mo.Symbol={});Or(t,e)||_oe(t,e,{value:_T.f(e)})},Roe=wT?{}.toString:function(){return"[object "+A0(this)+"]"},koe=Eu.f,EF=Xi("toStringTag"),I0=function(e,t,r,n){if(e){var i=r?e:e.prototype;Or(i,EF)||koe(i,EF,{configurable:!0,value:t}),n&&!wT&&aa(i,"toString",Roe)}},xF=hr.WeakMap,Loe=oi(xF)&&/native code/.test(rF(xF)),RT=hr.TypeError,Poe=hr.WeakMap;if(Loe||Is.state){var Su=Is.state||(Is.state=new Poe),Ioe=mn(Su.get),SF=mn(Su.has),Moe=mn(Su.set);L0=function(e,t){if(SF(Su,e))throw new RT("Object already initialized");return t.facade=e,Moe(Su,e,t),t},op=function(e){return Ioe(Su,e)||{}},P0=function(e){return SF(Su,e)}}else{var vd=R0("state");ip[vd]=!0,L0=function(e,t){if(Or(e,vd))throw new RT("Object already initialized");return t.facade=e,aa(e,vd,t),t},op=function(e){return Or(e,vd)?e[vd]:{}},P0=function(e){return Or(e,vd)}}var md={set:L0,get:op,has:P0,enforce:function(e){return P0(e)?op(e):L0(e,{})},getterFor:function(e){return function(t){var r;if(!vo(t)||(r=op(t)).type!==e)throw RT("Incompatible receiver, "+e+" required");return r}}},wF=mn([].push),Bs=function(e){var t=e==1,r=e==2,n=e==3,i=e==4,o=e==6,a=e==7,s=e==5||o;return function(l,u,c,h){for(var S,y,W=ep(l),B=U5(W),N=q5(u,c),U=T0(B),D=0,Q=h||aF,te=t?Q(l,U):r||a?Q(l,0):void 0;U>D;D++)if((s||D in B)&&(y=N(S=B[D],D,W),e))if(t)te[D]=y;else if(y)switch(e){case 3:return!0;case 5:return S;case 6:return D;case 2:wF(te,S)}else switch(e){case 4:return!1;case 7:wF(te,S)}return o?-1:n||i?i:te}},M0=[Bs(0),Bs(1),Bs(2),Bs(3),Bs(4),Bs(5),Bs(6),Bs(7)][0],Li=R0("hidden"),CF=Xi("toPrimitive"),Boe=md.set,TF=md.getterFor("Symbol"),Fo=Object.prototype,Fs=hr.Symbol,Ns=Fs&&Fs.prototype,AF=hr.TypeError,kT=hr.QObject,ap=qf("JSON","stringify"),DF=ET.f,js=Eu.f,OF=bF.f,Foe=pT.f,_F=mn([].push),Na=mu("symbols"),sp=mu("op-symbols"),LT=mu("string-to-symbol-registry"),PT=mu("symbol-to-string-registry"),Noe=mu("wks"),IT=!kT||!kT.prototype||!kT.prototype.findChild,MT=ki&&$i(function(){return xu(js({},"a",{get:function(){return js(this,"a",{value:7}).a}})).a!=7})?function(e,t,r){var n=DF(Fo,t);n&&delete Fo[t],js(e,t,r),n&&e!==Fo&&js(Fo,t,n)}:js,BT=function(e,t){var r=Na[e]=xu(Ns);return Boe(r,{type:"Symbol",tag:e,description:t}),ki||(r.description=t),r},B0=function(e,t,r){e===Fo&&B0(sp,t,r),bu(e);var n=pd(t);return bu(r),Or(Na,n)?(r.enumerable?(Or(e,Li)&&e[Li][n]&&(e[Li][n]=!1),r=xu(r,{enumerable:gu(0,!1)})):(Or(e,Li)||js(e,Li,gu(1,{})),e[Li][n]=!0),MT(e,n,r)):js(e,n,r)},RF=function(e,t){bu(e);var r=ia(t),n=AT(r).concat(FT(r));return M0(n,function(i){ki&&!Bo(kF,r,i)||B0(e,i,r[i])}),e},kF=function(e){var t=pd(e),r=Bo(Foe,this,t);return!(this===Fo&&Or(Na,t)&&!Or(sp,t))&&(!(r||!Or(this,t)||!Or(Na,t)||Or(this,Li)&&this[Li][t])||r)},LF=function(e,t){var r=ia(e),n=pd(t);if(r!==Fo||!Or(Na,n)||Or(sp,n)){var i=DF(r,n);return!i||!Or(Na,n)||Or(r,Li)&&r[Li][n]||(i.enumerable=!0),i}},PF=function(e){var t=OF(ia(e)),r=[];return M0(t,function(n){Or(Na,n)||Or(ip,n)||_F(r,n)}),r},FT=function(e){var t=e===Fo,r=OF(t?sp:ia(e)),n=[];return M0(r,function(i){!Or(Na,i)||t&&!Or(Fo,i)||_F(n,Na[i])}),n};if(oa||(Ns=(Fs=function(){if(z5(Ns,this))throw AF("Symbol is not a constructor");var e=arguments.length&&arguments[0]!==void 0?O0(arguments[0]):void 0,t=w0(e),r=function(n){this===Fo&&Bo(r,sp,n),Or(this,Li)&&Or(this[Li],t)&&(this[Li][t]=!1),MT(this,t,gu(1,n))};return ki&&IT&&MT(Fo,t,{configurable:!0,set:r}),BT(t,e)}).prototype,gd(Ns,"toString",function(){return TF(this).tag}),gd(Fs,"withoutSetter",function(e){return BT(w0(e),e)}),pT.f=kF,Eu.f=B0,ET.f=LF,vF.f=bF.f=PF,OT.f=FT,_T.f=function(e){return BT(Xi(e),e)},ki&&js(Ns,"description",{configurable:!0,get:function(){return TF(this).description}})),Ms({global:!0,wrap:!0,forced:!oa,sham:!oa},{Symbol:Fs}),M0(AT(Noe),function(e){wn(e)}),Ms({target:"Symbol",stat:!0,forced:!oa},{for:function(e){var t=O0(e);if(Or(LT,t))return LT[t];var r=Fs(t);return LT[t]=r,PT[r]=t,r},keyFor:function(e){if(!fd(e))throw AF(e+" is not a symbol");if(Or(PT,e))return PT[e]},useSetter:function(){IT=!0},useSimple:function(){IT=!1}}),Ms({target:"Object",stat:!0,forced:!oa,sham:!ki},{create:function(e,t){return t===void 0?xu(e):RF(xu(e),t)},defineProperty:B0,defineProperties:RF,getOwnPropertyDescriptor:LF}),Ms({target:"Object",stat:!0,forced:!oa},{getOwnPropertyNames:PF,getOwnPropertySymbols:FT}),Ms({target:"Object",stat:!0,forced:$i(function(){OT.f(1)})},{getOwnPropertySymbols:function(e){return OT.f(ep(e))}}),ap){var joe=!oa||$i(function(){var e=Fs();return ap([e])!="[null]"||ap({a:e})!="{}"||ap(Object(e))!="{}"});Ms({target:"JSON",stat:!0,forced:joe},{stringify:function(e,t,r){var n=Ooe(arguments),i=t;if((vo(t)||e!==void 0)&&!fd(e))return C0(t)||(t=function(o,a){if(oi(i)&&(a=Bo(i,this,o,a)),!fd(a))return a}),n[1]=t,B5(ap,null,n)}})}if(!Ns[CF]){var Uoe=Ns.valueOf;gd(Ns,CF,function(e){return Bo(Uoe,this)})}I0(Fs,"Symbol"),ip[Li]=!0,wn("asyncIterator"),wn("hasInstance"),wn("isConcatSpreadable"),wn("iterator"),wn("match"),wn("matchAll"),wn("replace"),wn("search"),wn("species"),wn("split"),wn("toPrimitive"),wn("toStringTag"),wn("unscopables"),I0(hr.JSON,"JSON",!0);var Us,IF,MF,Hoe=mo.Symbol,wu={},BF=Function.prototype,zoe=ki&&Object.getOwnPropertyDescriptor,NT=Or(BF,"name"),Woe={EXISTS:NT,PROPER:NT&&function(){}.name==="something",CONFIGURABLE:NT&&(!ki||ki&&zoe(BF,"name").configurable)},Goe=!$i(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),FF=R0("IE_PROTO"),jT=hr.Object,Voe=jT.prototype,UT=Goe?jT.getPrototypeOf:function(e){var t=ep(e);if(Or(t,FF))return t[FF];var r=t.constructor;return oi(r)&&t instanceof r?r.prototype:t instanceof jT?Voe:null},HT=Xi("iterator"),NF=!1;[].keys&&("next"in(MF=[].keys())?(IF=UT(UT(MF)))!==Object.prototype&&(Us=IF):NF=!0);var Koe=Us==null||$i(function(){var e={};return Us[HT].call(e)!==e});Us=Koe?{}:xu(Us),oi(Us[HT])||gd(Us,HT,function(){return this});var jF={IteratorPrototype:Us,BUGGY_SAFARI_ITERATORS:NF},$oe=jF.IteratorPrototype,Xoe=function(){return this};hr.String,hr.TypeError,Object.setPrototypeOf||"__proto__"in{}&&function(){var e={};try{mn(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set)(e,[]),e instanceof Array}catch(t){}}();var Yoe=Woe.PROPER,F0=jF.BUGGY_SAFARI_ITERATORS,zT=Xi("iterator"),Zoe=function(){return this},UF=function(e,t,r,n,i,o,a){!function(U,D,Q,te){var he=D+" Iterator";U.prototype=xu($oe,{next:gu(1,Q)}),I0(U,he,!1,!0),wu[he]=Xoe}(r,t,n);var s,l,u,c=function(U){if(U===i&&B)return B;if(!F0&&U in y)return y[U];switch(U){case"keys":case"values":case"entries":return function(){return new r(this,U)}}return function(){return new r(this)}},h=t+" Iterator",S=!1,y=e.prototype,W=y[zT]||y["@@iterator"]||i&&y[i],B=!F0&&W||c(i),N=t=="Array"&&y.entries||W;if(N&&(s=UT(N.call(new e)))!==Object.prototype&&s.next&&(I0(s,h,!0,!0),wu[h]=Zoe),Yoe&&i=="values"&&W&&W.name!=="values"&&(S=!0,B=function(){return Bo(W,this)}),i)if(l={values:c("values"),keys:o?B:c("keys"),entries:c("entries")},a)for(u in l)(F0||S||!(u in y))&&gd(y,u,l[u]);else Ms({target:t,proto:!0,forced:F0||S},l);return a&&y[zT]!==B&&gd(y,zT,B,{name:i}),wu[t]=B,l},Joe=md.set,Qoe=md.getterFor("Array Iterator");UF(Array,"Array",function(e,t){Joe(this,{type:"Array Iterator",target:ia(e),index:0,kind:t})},function(){var e=Qoe(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):r=="keys"?{value:n,done:!1}:r=="values"?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values"),wu.Arguments=wu.Array;var HF=Xi("toStringTag");for(var WT in{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}){var zF=hr[WT],GT=zF&&zF.prototype;GT&&A0(GT)!==HF&&aa(GT,HF,WT),wu[WT]=wu.Array}var qoe=Hoe;wn("asyncDispose"),wn("dispose"),wn("matcher"),wn("metadata"),wn("observable"),wn("patternMatch"),wn("replaceAll");var N0=qoe,eae=mn("".charAt),WF=mn("".charCodeAt),tae=mn("".slice),GF=function(e){return function(t,r){var n,i,o=O0(vT(t)),a=xT(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=WF(o,a))<55296||n>56319||a+1===s||(i=WF(o,a+1))<56320||i>57343?e?eae(o,a):n:e?tae(o,a,a+2):i-56320+(n-55296<<10)+65536}},rae=(GF(!1),GF(!0)),nae=md.set,iae=md.getterFor("String Iterator");UF(String,"String",function(e){nae(this,{type:"String Iterator",string:O0(e),index:0})},function(){var e,t=iae(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=rae(r,n),t.index+=e.length,{value:e,done:!1})});var oae=_T.f("iterator"),aae=e0(function(e){function t(r){return typeof N0=="function"&&typeof oae=="symbol"?(e.exports=t=function(n){return typeof n},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=t=function(n){return n&&typeof N0=="function"&&n.constructor===N0&&n!==N0.prototype?"symbol":typeof n},e.exports.default=e.exports,e.exports.__esModule=!0),t(r)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0}),VF=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(aae),sae=s0.EXISTS,lae=td.f,KF=Function.prototype,uae=Qt(KF.toString),$F=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,cae=Qt($F.exec);Io&&!sae&&lae(KF,"name",{configurable:!0,get:function(){try{return cae($F,uae(this))[1]}catch(e){return""}}});var XF=function(){function e(){this.tag="select",this.width=80}return e.prototype.isActive=function(t){return!1},e.prototype.getValue=function(t){var r=this.mark,n=de.marks(t);return n&&n[r]?n[r]:""},e.prototype.isDisabled=function(t){return t.selection==null||(this.mark,!!Dr(de.nodes(t,{match:function(r){return Ae.getNodeType(r)==="pre"||!!de.isVoid(t,r)},universal:!0}),1)[0])},e.prototype.exec=function(t,r){var n=this.mark;r?t.addMark(n,r):t.removeMark(n)},e}(),dae=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("fontSize.title"),r.iconSvg=jre,r.mark="fontSize",r}return nn(t,e),t.prototype.getOptions=function(r){var n=[],i=r.getMenuConfig(this.mark).fontSizeList,o=i===void 0?[]:i;n.push({text:wt("fontSize.default"),value:""}),o.forEach(function(s){if(typeof s=="string")n.push({text:s,value:s});else if(VF(s)==="object"){var l=s.name,u=s.value;n.push({text:l,value:u})}});var a=this.getValue(r);return n.forEach(function(s){s.value===a?s.selected=!0:delete s.selected}),n},t}(XF),hae=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("fontFamily.title"),r.iconSvg=Ure,r.mark="fontFamily",r.selectPanelWidth=150,r}return nn(t,e),t.prototype.getOptions=function(r){var n=[],i=r.getMenuConfig(this.mark).fontFamilyList,o=i===void 0?[]:i;n.push({text:wt("fontFamily.default"),value:""}),o.forEach(function(s){if(typeof s=="string")n.push({text:s,value:s,styleForRenderMenuList:{"font-family":s}});else if(VF(s)==="object"){var l=s.name,u=s.value;n.push({text:l,value:u,styleForRenderMenuList:{"font-family":u}})}});var a=this.getValue(r);return n.forEach(function(s){s.value===a?s.selected=!0:delete s.selected}),n},t}(XF),fae={renderStyle:function(e,t){var r=e,n=r.fontSize,i=r.fontFamily,o=t;return n&&fu(o,{fontSize:n}),i&&fu(o,{fontFamily:i}),o},styleToHtml:function(e,t){if(!Rt.isText(e))return t;var r,n=e,i=n.fontSize,o=n.fontFamily;return i||o?((YC(t)||ud(r=_e(t))!=="span")&&(r=_e("<span>"+t+"</span>")),i&&r.css("font-size",i),o&&r.css("font-family",o),ld(r)):t},preParseHtml:[Sie],parseStyleHtml:function(e,t,r){var n=_e(e);if(!Rt.isText(t))return t;var i=t,o=r.getMenuConfig("fontSize").fontSizeList,a=o===void 0?[]:o,s=Mo(n,"font-size"),l=a.find(function(y){return y.value&&y.value===s})||a.includes(s);s&&l&&(i.fontSize=s);var u=r.getMenuConfig("fontFamily").fontFamilyList,c=u===void 0?[]:u,h=Mo(n,"font-family").replace(/"/g,""),S=c.find(function(y){return y.value&&y.value===h})||c.includes(h);return h&&S&&(i.fontFamily=h),i},menus:[{key:"fontSize",factory:function(){return new dae},config:{fontSizeList:["12px",{name:"13px",value:"13px"},"14px","15px","16px","19px",{name:"22px",value:"22px"},"24px","29px","32px","40px","48px"]}},{key:"fontFamily",factory:function(){return new hae},config:{fontFamilyList:["\u9ED1\u4F53",{name:"\u4EFF\u5B8B",value:"\u4EFF\u5B8B"},"\u6977\u4F53","\u6807\u6977\u4F53","\u534E\u6587\u4EFF\u5B8B","\u534E\u6587\u6977\u4F53",{name:"\u5B8B\u4F53",value:"\u5B8B\u4F53"},"\u5FAE\u8F6F\u96C5\u9ED1","Arial","Tahoma","Verdana","Times New Roman","Courier New"]}}]},pae={selector:"p,h1,h2,h3,h4,h5",preParseHtml:function(e){var t=_e(e),r=Mo(t,"padding-left");return/\dem/.test(r)&&t.css("text-indent","2em"),/\dpx/.test(r)&&parseInt(r,10)%32==0&&t.css("text-indent","2em"),t[0]}},YF=function(){function e(){this.tag="button"}return e.prototype.getValue=function(t){var r=Dr(de.nodes(t,{match:function(i){return!!i.indent},universal:!0}),1),n=r[0];return n==null?"":Dr(n,1)[0].indent||""},e.prototype.isActive=function(t){return!1},e.prototype.getMatchNode=function(t){var r=Dr(de.nodes(t,{match:function(n){var i=Ae.getNodeType(n);return i==="paragraph"||!!i.startsWith("header")},universal:!0,mode:"highest"}),1)[0];return r==null?null:r[0]},e}(),gae=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("indent.decrease"),r.iconSvg=Hre,r}return nn(t,e),t.prototype.isDisabled=function(r){var n=this.getMatchNode(r);return n==null||!n.indent},t.prototype.exec=function(r,n){Ve.setNodes(r,{indent:null},{match:function(i){return Ut.isElement(i)}})},t}(YF),vae=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("indent.increase"),r.iconSvg=zre,r}return nn(t,e),t.prototype.isDisabled=function(r){var n=this.getMatchNode(r);return n==null||!!n.indent},t.prototype.exec=function(r,n){Ve.setNodes(r,{indent:"2em"},{match:function(i){return Ut.isElement(i)},mode:"highest"})},t}(YF),mae={renderStyle:function(e,t){if(!Ut.isElement(e))return t;var r=e.indent,n=t;return r&&fu(n,{textIndent:r}),n},styleToHtml:function(e,t){if(!Ut.isElement(e))return t;var r=e.indent;if(!r)return t;var n=_e(t);return n.css("text-indent",r),ld(n)},preParseHtml:[pae],parseStyleHtml:function(e,t,r){var n=_e(e);if(!Ut.isElement(t))return t;var i=t,o=Mo(n,"text-indent"),a=parseInt(o,10);return o&&a>0&&(i.indent=o),i},menus:[{key:"indent",factory:function(){return new vae}},{key:"delIndent",factory:function(){return new gae}}]},j0=function(){function e(){this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.getMatchNode=function(t){var r=Dr(de.nodes(t,{match:function(n){var i=Ae.getNodeType(n);return i==="paragraph"||i==="blockquote"||!!i.startsWith("header")},universal:!0,mode:"highest"}),1)[0];return r==null?null:r[0]},e.prototype.isDisabled=function(t){return t.selection==null||!!Ae.getSelectedElems(t).some(function(r){if(de.isVoid(t,r)&&de.isBlock(t,r))return!0;var n=r.type;return!!["pre","code"].includes(n)||void 0})},e}(),yae=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("justify.left"),r.iconSvg=Wre,r}return nn(t,e),t.prototype.exec=function(r,n){Ve.setNodes(r,{textAlign:"left"},{match:function(i){return Ut.isElement(i)&&!r.isInline(i)}})},t}(j0),bae=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("justify.right"),r.iconSvg=Gre,r}return nn(t,e),t.prototype.exec=function(r,n){Ve.setNodes(r,{textAlign:"right"},{match:function(i){return Ut.isElement(i)&&!r.isInline(i)}})},t}(j0),Eae=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("justify.center"),r.iconSvg=Vre,r}return nn(t,e),t.prototype.exec=function(r,n){Ve.setNodes(r,{textAlign:"center"},{match:function(i){return Ut.isElement(i)&&!r.isInline(i)}})},t}(j0),xae=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("justify.justify"),r.iconSvg=Kre,r}return nn(t,e),t.prototype.exec=function(r,n){Ve.setNodes(r,{textAlign:"justify"},{match:function(i){return Ut.isElement(i)&&!r.isInline(i)}})},t}(j0),Sae={renderStyle:function(e,t){if(!Ut.isElement(e))return t;var r=e.textAlign,n=t;return r&&fu(n,{textAlign:r}),n},styleToHtml:function(e,t){if(!Ut.isElement(e))return t;var r=e.textAlign;if(!r)return t;var n=_e(t);return n.css("text-align",r),ld(n)},parseStyleHtml:function(e,t,r){var n=_e(e);if(!Ut.isElement(t))return t;var i=t,o=Mo(n,"text-align");return o&&(i.textAlign=o),i},menus:[{key:"justifyLeft",factory:function(){return new yae}},{key:"justifyRight",factory:function(){return new bae}},{key:"justifyCenter",factory:function(){return new Eae}},{key:"justifyJustify",factory:function(){return new xae}}]},wae=function(){function e(){this.title=wt("lineHeight.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M964 788a8 8 0 0 1 8 8v98a8 8 0 0 1-8 8H438a8 8 0 0 1-8-8v-98a8 8 0 0 1 8-8h526zM198.93 144.306c6.668-5.798 16.774-5.094 22.573 1.574l122.26 140.582a16 16 0 0 1 3.927 10.5c0 8.836-7.164 16-16 16h-61.8a8 8 0 0 0-8 8v390.077h69.819a16 16 0 0 1 10.502 3.928c6.666 5.8 7.37 15.906 1.57 22.573L221.476 878.123a16 16 0 0 1-1.57 1.57c-6.668 5.8-16.774 5.097-22.574-1.57L75.051 737.538a16 16 0 0 1-3.928-10.5c0-8.837 7.163-16 16-16h69.822V312.96H87.127a16 16 0 0 1-10.502-3.928c-6.666-5.8-7.37-15.906-1.57-22.573l122.303-140.582a16 16 0 0 1 1.572-1.572zM964 465a8 8 0 0 1 8 8v98a8 8 0 0 1-8 8H438a8 8 0 0 1-8-8v-98a8 8 0 0 1 8-8h526z m0-323a8 8 0 0 1 8 8v98a8 8 0 0 1-8 8H438a8 8 0 0 1-8-8v-98a8 8 0 0 1 8-8h526z"></path></svg>',this.tag="select",this.width=80}return e.prototype.getOptions=function(t){var r=[],n=t.getMenuConfig("lineHeight").lineHeightList,i=n===void 0?[]:n;r.push({text:wt("lineHeight.default"),value:""}),i.forEach(function(a){r.push({text:a,value:a})});var o=this.getValue(t);return r.forEach(function(a){a.value===o?a.selected=!0:delete a.selected}),r},e.prototype.getMatchNode=function(t){var r=Dr(de.nodes(t,{match:function(n){var i=Ae.getNodeType(n);return!!i.startsWith("header")||!!["paragraph","blockquote","list-item"].includes(i)},universal:!0,mode:"highest"}),1)[0];return r==null?null:r[0]},e.prototype.isActive=function(t){return!1},e.prototype.getValue=function(t){var r=this.getMatchNode(t);return r==null?"":Ut.isElement(r)&&r.lineHeight||""},e.prototype.isDisabled=function(t){return t.selection==null||this.getMatchNode(t)==null},e.prototype.exec=function(t,r){Ve.setNodes(t,{lineHeight:r.toString()},{mode:"highest"})},e}(),Cae={renderStyle:function(e,t){if(!Ut.isElement(e))return t;var r=e.lineHeight,n=t;return r&&fu(n,{lineHeight:r}),n},styleToHtml:function(e,t){if(!Ut.isElement(e))return t;var r=e.lineHeight;if(!r)return t;var n=_e(t);return n.css("line-height",r),ld(n)},parseStyleHtml:function(e,t,r){var n=_e(e);if(!Ut.isElement(t))return t;var i=t,o=r.getMenuConfig("lineHeight").lineHeightList,a=o===void 0?[]:o,s=Mo(n,"line-height");return s&&a.includes(s)&&(i.lineHeight=s),i},menus:[{key:"lineHeight",factory:function(){return new wae},config:{lineHeightList:["1","1.15","1.5","2","2.5","3"]}}]},Tae=function(){function e(){this.title=wt("undo.redo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0.00032 576a510.72 510.72 0 0 0 173.344 384l84.672-96A383.136 383.136 0 0 1 128.00032 576C128.00032 363.936 299.93632 192 512.00032 192c106.048 0 202.048 42.976 271.52 112.48L640.00032 448h384V64l-149.984 149.984A510.272 510.272 0 0 0 512.00032 64C229.21632 64 0.00032 293.216 0.00032 576z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null},e.prototype.exec=function(t,r){typeof t.redo=="function"&&t.redo()},e}(),Aae=function(){function e(){this.title=wt("undo.undo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M512 64A510.272 510.272 0 0 0 149.984 213.984L0.032 64v384h384L240.512 304.48A382.784 382.784 0 0 1 512.032 192c212.064 0 384 171.936 384 384 0 114.688-50.304 217.632-130.016 288l84.672 96a510.72 510.72 0 0 0 173.344-384c0-282.784-229.216-512-512-512z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null},e.prototype.exec=function(t,r){typeof t.undo=="function"&&t.undo()},e}(),Dae={menus:[{key:"redo",factory:function(){return new Tae}},{key:"undo",factory:function(){return new Aae}}]},Oae={type:"divider",renderElem:function(e,t,r){return wc("div",{props:{contentEditable:!1,className:"w-e-textarea-divider"},dataset:{selected:Ae.isNodeSelected(r,e)?"true":""},style:{},on:{mousedown:function(n){return n.preventDefault()}}},[wc("hr")])}},_ae=function(){function e(){this.title=wt("divider.title"),this.iconSvg='<svg viewBox="0 0 1092 1024"><path d="M0 51.2m51.2 0l989.866667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-989.866667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M0 460.8m51.2 0l170.666667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-170.666667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M819.2 460.8m51.2 0l170.666667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-170.666667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M409.6 460.8m51.2 0l170.666667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-170.666667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M0 870.4m51.2 0l989.866667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-989.866667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null||!!Ae.getSelectedElems(t).some(function(r){if(t.isVoid(r))return!0;var n=Ae.getNodeType(r);return n==="table"||n==="pre"||void 0})},e.prototype.exec=function(t,r){Ve.insertNodes(t,{type:"divider",children:[{text:""}]},{mode:"highest"})},e}(),Rae={renderElems:[Oae],elemsToHtml:[{type:"divider",elemToHtml:function(e,t){return"<hr/>"}}],parseElemsHtml:[{selector:"hr:not([data-w-e-type])",parseElemHtml:function(e,t,r){return{type:"divider",children:[{text:""}]}}}],menus:[{key:"divider",factory:function(){return new _ae}}],editorPlugin:function(e){var t=e.isVoid,r=e.normalizeNode,n=e;return n.isVoid=function(i){return i.type==="divider"||t(i)},n.normalizeNode=function(i){var o=Dr(i,2),a=o[0],s=o[1];if(Ae.getNodeType(a)!=="divider")return r([a,s]);Ae.isLastNode(n,a)&&Ve.insertNodes(n,Ae.genEmptyParagraph(),{at:[s[0]+1]})},n}},kae=d0.map;Hn({target:"Array",proto:!0,forced:!OC("map")},{map:function(e){return kae(this,e,arguments.length>1?arguments[1]:void 0)}});var Lae=Qt([].join),Pae=n0!=Object,Iae=i5("join",",");Hn({target:"Array",proto:!0,forced:Pae||!Iae},{join:function(e){return Lae(ed(this),e===void 0?",":e)}});var Mae=function(){function e(){this.title=wt("codeBlock.title"),this.iconSvg='<svg viewBox="0 0 1280 1024"><path d="M832 736l96 96 320-320L928 192l-96 96 224 224zM448 288l-96-96L32 512l320 320 96-96-224-224zM701.312 150.528l69.472 18.944-192 704.032-69.472-18.944 192-704.032z"></path></svg>',this.tag="button"}return e.prototype.getSelectCodeElem=function(t){var r=Ae.getSelectedNodeByType(t,"code");if(r==null)return null;var n=Ae.getParentNode(t,r);return n==null||Ae.getNodeType(n)!=="pre"?null:r},e.prototype.getValue=function(t){var r=this.getSelectCodeElem(t);return r==null?"":r.language||""},e.prototype.isActive=function(t){return!!this.getSelectCodeElem(t)},e.prototype.isDisabled=function(t){if(t.selection==null)return!0;var r=Ae.getSelectedElems(t);return!!r.some(function(n){return t.isVoid(n)})||!r.some(function(n){var i=Ae.getNodeType(n);if(i==="pre"||i==="paragraph")return!0})},e.prototype.exec=function(t,r){this.isActive(t)?this.changeToPlainText(t):this.changeToCodeBlock(t,r.toString())},e.prototype.changeToPlainText=function(t){var r=this.getSelectCodeElem(t);if(r!=null){var n=St.string(r);Ve.removeNodes(t,{mode:"highest"});var i=n.split(`
|
|
|
`).map(function(o){return{type:"paragraph",children:[{text:o}]}});Ve.insertNodes(t,i,{mode:"highest"})}},e.prototype.changeToCodeBlock=function(t,r){var n,i,o=[],a=de.nodes(t,{match:function(h){return t.children.includes(h)},universal:!0});try{for(var s=e5(a),l=s.next();!l.done;l=s.next()){var u=Dr(l.value,1)[0];u&&o.push(St.string(u))}}catch(h){n={error:h}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}Ve.removeNodes(t,{mode:"highest"});var c={type:"pre",children:[{type:"code",language:r,children:[{text:o.join(`
|
|
|
`)}]}]};Ve.insertNodes(t,c,{mode:"highest"})},e}(),Bae={key:"codeBlock",factory:function(){return new Mae}};Hn({target:"String",proto:!0,forced:Kf("anchor")},{anchor:function(e){return Vf(this,"a","name",e)}}),jC("match",function(e,t,r){return[function(n){var i=fo(this),o=n==null?void 0:i0(n,e);return o?vn(o,n,i):new RegExp(n)[e](cn(i))},function(n){var i=Ki(this),o=cn(n),a=r(t,i,o);if(a.done)return a.value;if(!i.global)return Wf(i,o);var s=i.unicode;i.lastIndex=0;for(var l,u=[],c=0;(l=Wf(i,o))!==null;){var h=cn(l[0]);u[c]=h,h===""&&(i.lastIndex=UC(o,jf(i.lastIndex),s)),c++}return c===0?null:u}]});var Fae={type:"pre",renderElem:function(e,t,r){return er("pre",null,t)}},Nae={type:"code",renderElem:function(e,t,r){return er("code",null,t)}},jae={selector:"pre:not([data-w-e-type])",parseElemHtml:function(e,t,r){var n=_e(e);return(t=t.filter(function(i){return Ae.getNodeType(i)==="code"})).length===0&&(t=[{type:"code",language:"",children:[{text:n[0].textContent||""}]}]),{type:"pre",children:t.filter(function(i){return Ae.getNodeType(i)==="code"})}}},Uae={menus:[Bae],editorPlugin:function(e){var t=e.insertBreak,r=e.normalizeNode,n=e.insertData;e.insertNode;var i=e;return i.insertBreak=function(){var o=Ae.getSelectedNodeByType(i,"code");if(o!=null){var a=function(u,c){var h=c.selection;if(h==null)return"";var S=St.string(u),y=h.anchor.offset,W=S.slice(0,y).split(`
|
|
|
`),B=W.length;return B===0?"":W[B-1]}(o,i);if(a){var s=a.match(/^\s+/);if(s!=null&&s[0]!=null){var l=s[0];return void i.insertText(`
|
|
|
`+l)}}i.insertText(`
|
|
|
`)}else t()},i.normalizeNode=function(o){var a=Dr(o,2),s=a[0],l=a[1],u=Ae.getNodeType(s);return u==="code"&&l.length<=1&&Ve.setNodes(i,{type:"paragraph"},{at:l}),u==="pre"&&(Ae.isLastNode(i,s)&&Ve.insertNodes(i,Ae.genEmptyParagraph(),{at:[l[0]+1]}),Ae.getNodeType(s.children[0])!=="code"&&(Ve.unwrapNodes(i),Ve.setNodes(i,{type:"paragraph"},{mode:"highest"}))),r([s,l])},i.insertData=function(o){if(Ae.getSelectedNodeByType(i,"code")!=null){var a=o.getData("text/plain");de.insertText(i,a)}else n(o)},i},renderElems:[Fae,Nae],elemsToHtml:[{type:"code",elemToHtml:function(e,t){return"<code>"+t+"</code>"}},{type:"pre",elemToHtml:function(e,t){return"<pre>"+t+"</pre>"}}],preParseHtml:[{selector:"pre>code",preParseHtml:function(e){var t=_e(e);if(ud(t)!=="code")return e;var r=t.find("xmp");if(r.length===0)return e;var n=r.text();return r.remove(),t.text(n),t[0]}}],parseElemsHtml:[{selector:"pre:not([data-w-e-type])>code",parseElemHtml:function(e,t,r){return{type:"code",language:"",children:[{text:_e(e)[0].textContent||""}]}}},jae]},Hae=function(){function e(){this.title=wt("fullScreen.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M133.705143 335.433143V133.851429h201.581714a29.622857 29.622857 0 0 0 29.622857-29.549715V68.754286a29.622857 29.622857 0 0 0-29.622857-29.622857H61.732571A22.893714 22.893714 0 0 0 38.765714 62.025143V335.725714c0 16.310857 13.238857 29.622857 29.622857 29.622857h35.547429a29.842286 29.842286 0 0 0 29.696-29.842285zM690.980571 133.851429h201.581715v201.654857c0 16.310857 13.238857 29.549714 29.622857 29.549714h35.547428a29.622857 29.622857 0 0 0 29.549715-29.549714V61.952a22.893714 22.893714 0 0 0-22.820572-22.893714h-273.554285a29.622857 29.622857 0 0 0-29.549715 29.622857v35.547428c0 16.310857 13.238857 29.696 29.622857 29.696zM335.286857 892.781714H133.705143V691.2a29.622857 29.622857 0 0 0-29.622857-29.622857H68.534857a29.622857 29.622857 0 0 0-29.549714 29.622857v273.554286c0 12.653714 10.24 22.893714 22.820571 22.893714h273.554286a29.622857 29.622857 0 0 0 29.696-29.622857v-35.547429a29.769143 29.769143 0 0 0-29.769143-29.696z m557.348572-201.581714v201.581714H690.907429a29.622857 29.622857 0 0 0-29.622858 29.622857v35.547429c0 16.310857 13.238857 29.622857 29.622858 29.622857h273.554285c12.580571 0 22.893714-10.313143 22.893715-22.893714V691.2a29.622857 29.622857 0 0 0-29.622858-29.622857h-35.547428a29.622857 29.622857 0 0 0-29.696 29.622857z"></path></svg>',this.tag="button",this.alwaysEnable=!0}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return t.isFullScreen},e.prototype.isDisabled=function(t){return!1},e.prototype.exec=function(t,r){t.isFullScreen?t.unFullScreen():t.fullScreen()},e}(),zae={menus:[{key:"fullScreen",factory:function(){return new Hae}}]},Wae=function(){function e(){this.title=wt("common.enter"),this.iconSvg='<svg viewBox="0 0 1255 1024"><path d="M1095.111111 731.477333h-625.777778V1024L0 658.318222 469.333333 292.408889v292.636444h625.777778V0h156.444445v731.477333z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){var r=t.selection;return r==null||!!Qe.isExpanded(r)},e.prototype.exec=function(t,r){var n=t.selection;if(n!=null){var i=[n.anchor.path[0]];Ve.insertNodes(t,{type:"paragraph",children:[{text:""}]},{at:i}),t.select(de.start(t,i))}},e}(),Gae=[nne,Mne,fae,mae,Sae,Cae,oie,Rae,Eie,Kne,Uae,yie,Rne,Are,uie,Dae,zae,{menus:[{key:"enter",factory:function(){return new Wae}}]}];Ri("en",{listModule:{unOrderedList:"Unordered list",orderedList:"Ordered list"}}),Ri("zh-CN",{listModule:{unOrderedList:"\u65E0\u5E8F\u5217\u8868",orderedList:"\u6709\u5E8F\u5217\u8868"}});var ZF=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof ze!="undefined"?ze:typeof self!="undefined"?self:{};function VT(e){var t={exports:{}};return e(t,t.exports),t.exports}var Hs,U0,H0=function(e){return e&&e.Math==Math&&e},tr=H0(typeof globalThis=="object"&&globalThis)||H0(typeof window=="object"&&window)||H0(typeof self=="object"&&self)||H0(typeof ZF=="object"&&ZF)||function(){return this}()||Function("return this")(),JF=Function.prototype,KT=JF.bind,$T=JF.call,Vae=KT&&KT.bind($T),gr=KT?function(e){return e&&Vae($T,e)}:function(e){return e&&function(){return $T.apply(e,arguments)}},hn=function(e){try{return!!e()}catch(t){return!0}},Kae=gr({}.toString),$ae=gr("".slice),ja=function(e){return $ae(Kae(e),8,-1)},XT=tr.Object,Xae=gr("".split),QF=hn(function(){return!XT("z").propertyIsEnumerable(0)})?function(e){return ja(e)=="String"?Xae(e,""):XT(e)}:XT,Yae=tr.TypeError,z0=function(e){if(e==null)throw Yae("Can't call method on "+e);return e},yd=function(e){return QF(z0(e))},Zae=Object.defineProperty,YT=function(e,t){try{Zae(tr,e,{value:t,configurable:!0,writable:!0})}catch(r){tr[e]=t}return t},zs=tr["__core-js_shared__"]||YT("__core-js_shared__",{}),ZT=VT(function(e){(e.exports=function(t,r){return zs[t]||(zs[t]=r!==void 0?r:{})})("versions",[]).push({version:"3.19.3",mode:"global",copyright:"\xA9 2021 Denis Pushkarev (zloirock.ru)"})}),Jae=tr.Object,lp=function(e){return Jae(z0(e))},Qae=gr({}.hasOwnProperty),zn=Object.hasOwn||function(e,t){return Qae(lp(e),t)},qae=0,ese=Math.random(),tse=gr(1 .toString),JT=function(e){return"Symbol("+(e===void 0?"":e)+")_"+tse(++qae+ese,36)},fn=function(e){return typeof e=="function"},rse=function(e){return fn(e)?e:void 0},up=function(e,t){return arguments.length<2?rse(tr[e]):tr[e]&&tr[e][t]},QT=up("navigator","userAgent")||"",qF=tr.process,e8=tr.Deno,t8=qF&&qF.versions||e8&&e8.version,r8=t8&&t8.v8;r8&&(U0=(Hs=r8.split("."))[0]>0&&Hs[0]<4?1:+(Hs[0]+Hs[1])),!U0&&QT&&(!(Hs=QT.match(/Edge\/(\d+)/))||Hs[1]>=74)&&(Hs=QT.match(/Chrome\/(\d+)/))&&(U0=+Hs[1]);var W0,qT=U0,eA=!!Object.getOwnPropertySymbols&&!hn(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&qT&&qT<41}),tA=eA&&!Symbol.sham&&typeof Symbol.iterator=="symbol",cp=ZT("wks"),Cu=tr.Symbol,n8=Cu&&Cu.for,nse=tA?Cu:Cu&&Cu.withoutSetter||JT,ai=function(e){if(!zn(cp,e)||!eA&&typeof cp[e]!="string"){var t="Symbol."+e;eA&&zn(Cu,e)?cp[e]=Cu[e]:cp[e]=tA&&n8?n8(t):nse(t)}return cp[e]},pn=function(e){return typeof e=="object"?e!==null:fn(e)},ise=tr.String,ose=tr.TypeError,Pi=function(e){if(pn(e))return e;throw ose(ise(e)+" is not an object")},Ws=!hn(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),rA=tr.document,ase=pn(rA)&&pn(rA.createElement),nA=function(e){return ase?rA.createElement(e):{}},i8=!Ws&&!hn(function(){return Object.defineProperty(nA("div"),"a",{get:function(){return 7}}).a!=7}),dp=Function.prototype.call,Wn=dp.bind?dp.bind(dp):function(){return dp.apply(dp,arguments)},G0=gr({}.isPrototypeOf),sse=tr.Object,iA=tA?function(e){return typeof e=="symbol"}:function(e){var t=up("Symbol");return fn(t)&&G0(t.prototype,sse(e))},lse=tr.String,oA=function(e){try{return lse(e)}catch(t){return"Object"}},use=tr.TypeError,aA=function(e){if(fn(e))return e;throw use(oA(e)+" is not a function")},hp=function(e,t){var r=e[t];return r==null?void 0:aA(r)},cse=tr.TypeError,dse=tr.TypeError,hse=ai("toPrimitive"),sA=function(e){var t=function(r,n){if(!pn(r)||iA(r))return r;var i,o=hp(r,hse);if(o){if(n===void 0&&(n="default"),i=Wn(o,r,n),!pn(i)||iA(i))return i;throw dse("Can't convert object to primitive value")}return n===void 0&&(n="number"),function(a,s){var l,u;if(s==="string"&&fn(l=a.toString)&&!pn(u=Wn(l,a)))return u;if(fn(l=a.valueOf)&&!pn(u=Wn(l,a)))return u;if(s!=="string"&&fn(l=a.toString)&&!pn(u=Wn(l,a)))return u;throw cse("Can't convert object to primitive value")}(r,n)}(e,"string");return iA(t)?t:t+""},fse=tr.TypeError,o8=Object.defineProperty,Tu={f:Ws?o8:function(e,t,r){if(Pi(e),t=sA(t),Pi(r),i8)try{return o8(e,t,r)}catch(n){}if("get"in r||"set"in r)throw fse("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},pse=Math.ceil,gse=Math.floor,fp=function(e){var t=+e;return t!=t||t===0?0:(t>0?gse:pse)(t)},vse=Math.max,mse=Math.min,lA=function(e,t){var r=fp(e);return r<0?vse(r+t,0):mse(r,t)},yse=Math.min,a8=function(e){return e>0?yse(fp(e),9007199254740991):0},bd=function(e){return a8(e.length)},s8=function(e){return function(t,r,n){var i,o=yd(t),a=bd(o),s=lA(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},l8={includes:s8(!0),indexOf:s8(!1)},V0={},bse=l8.indexOf,u8=gr([].push),c8=function(e,t){var r,n=yd(e),i=0,o=[];for(r in n)!zn(V0,r)&&zn(n,r)&&u8(o,r);for(;t.length>i;)zn(n,r=t[i++])&&(~bse(o,r)||u8(o,r));return o},K0=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ese=Object.keys||function(e){return c8(e,K0)},xse=Ws?Object.defineProperties:function(e,t){Pi(e);for(var r,n=yd(t),i=Ese(t),o=i.length,a=0;o>a;)Tu.f(e,r=i[a++],n[r]);return e},Sse=up("document","documentElement"),d8=ZT("keys"),uA=function(e){return d8[e]||(d8[e]=JT(e))},h8=uA("IE_PROTO"),cA=function(){},f8=function(e){return"<script>"+e+"</script>"},p8=function(e){e.write(f8("")),e.close();var t=e.parentWindow.Object;return e=null,t},$0=function(){try{W0=new ActiveXObject("htmlfile")}catch(n){}var e,t;$0=typeof document!="undefined"?document.domain&&W0?p8(W0):((t=nA("iframe")).style.display="none",Sse.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(f8("document.F=Object")),e.close(),e.F):p8(W0);for(var r=K0.length;r--;)delete $0.prototype[K0[r]];return $0()};V0[h8]=!0;var dA=Object.create||function(e,t){var r;return e!==null?(cA.prototype=Pi(e),r=new cA,cA.prototype=null,r[h8]=e):r=$0(),t===void 0?r:xse(r,t)},hA=ai("unscopables"),fA=Array.prototype;fA[hA]==null&&Tu.f(fA,hA,{configurable:!0,value:dA(null)});var pp=function(e){fA[hA][e]=!0},Ed={},wse=gr(Function.toString);fn(zs.inspectSource)||(zs.inspectSource=function(e){return wse(e)});var X0,gp,Y0,pA=zs.inspectSource,g8=tr.WeakMap,v8=fn(g8)&&/native code/.test(pA(g8)),Z0=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Gs=Ws?function(e,t,r){return Tu.f(e,t,Z0(1,r))}:function(e,t,r){return e[t]=r,e},gA=tr.TypeError,Cse=tr.WeakMap;if(v8||zs.state){var Au=zs.state||(zs.state=new Cse),Tse=gr(Au.get),m8=gr(Au.has),Ase=gr(Au.set);X0=function(e,t){if(m8(Au,e))throw new gA("Object already initialized");return t.facade=e,Ase(Au,e,t),t},gp=function(e){return Tse(Au,e)||{}},Y0=function(e){return m8(Au,e)}}else{var xd=uA("state");V0[xd]=!0,X0=function(e,t){if(zn(e,xd))throw new gA("Object already initialized");return t.facade=e,Gs(e,xd,t),t},gp=function(e){return zn(e,xd)?e[xd]:{}},Y0=function(e){return zn(e,xd)}}var Du,y8,b8,sa={set:X0,get:gp,has:Y0,enforce:function(e){return Y0(e)?gp(e):X0(e,{})},getterFor:function(e){return function(t){var r;if(!pn(t)||(r=gp(t)).type!==e)throw gA("Incompatible receiver, "+e+" required");return r}}},E8={}.propertyIsEnumerable,x8=Object.getOwnPropertyDescriptor,Dse={f:x8&&!E8.call({1:2},1)?function(e){var t=x8(this,e);return!!t&&t.enumerable}:E8},S8=Object.getOwnPropertyDescriptor,w8={f:Ws?S8:function(e,t){if(e=yd(e),t=sA(t),i8)try{return S8(e,t)}catch(r){}if(zn(e,t))return Z0(!Wn(Dse.f,e,t),e[t])}},C8=Function.prototype,Ose=Ws&&Object.getOwnPropertyDescriptor,vA=zn(C8,"name"),mA={EXISTS:vA,PROPER:vA&&function(){}.name==="something",CONFIGURABLE:vA&&(!Ws||Ws&&Ose(C8,"name").configurable)},la=VT(function(e){var t=mA.CONFIGURABLE,r=sa.get,n=sa.enforce,i=String(String).split("String");(e.exports=function(o,a,s,l){var u,c=!!l&&!!l.unsafe,h=!!l&&!!l.enumerable,S=!!l&&!!l.noTargetGet,y=l&&l.name!==void 0?l.name:a;fn(s)&&(String(y).slice(0,7)==="Symbol("&&(y="["+String(y).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!zn(s,"name")||t&&s.name!==y)&&Gs(s,"name",y),(u=n(s)).source||(u.source=i.join(typeof y=="string"?y:""))),o!==tr?(c?!S&&o[a]&&(h=!0):delete o[a],h?o[a]=s:Gs(o,a,s)):h?o[a]=s:YT(a,s)})(Function.prototype,"toString",function(){return fn(this)&&r(this).source||pA(this)})}),_se=K0.concat("length","prototype"),J0={f:Object.getOwnPropertyNames||function(e){return c8(e,_se)}},Rse={f:Object.getOwnPropertySymbols},kse=gr([].concat),Lse=up("Reflect","ownKeys")||function(e){var t=J0.f(Pi(e)),r=Rse.f;return r?kse(t,r(e)):t},Pse=function(e,t){for(var r=Lse(t),n=Tu.f,i=w8.f,o=0;o<r.length;o++){var a=r[o];zn(e,a)||n(e,a,i(t,a))}},Ise=/#|\.prototype\./,vp=function(e,t){var r=Bse[Mse(e)];return r==Nse||r!=Fse&&(fn(t)?hn(t):!!t)},Mse=vp.normalize=function(e){return String(e).replace(Ise,".").toLowerCase()},Bse=vp.data={},Fse=vp.NATIVE="N",Nse=vp.POLYFILL="P",yA=vp,jse=w8.f,Vs=function(e,t){var r,n,i,o,a,s=e.target,l=e.global,u=e.stat;if(r=l?tr:u?tr[s]||YT(s,{}):(tr[s]||{}).prototype)for(n in t){if(o=t[n],i=e.noTargetGet?(a=jse(r,n))&&a.value:r[n],!yA(l?n:s+(u?".":"#")+n,e.forced)&&i!==void 0){if(typeof o==typeof i)continue;Pse(o,i)}(e.sham||i&&i.sham)&&Gs(o,"sham",!0),la(r,n,o,e)}},Use=!hn(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),T8=uA("IE_PROTO"),bA=tr.Object,Hse=bA.prototype,Q0=Use?bA.getPrototypeOf:function(e){var t=lp(e);if(zn(t,T8))return t[T8];var r=t.constructor;return fn(r)&&t instanceof r?r.prototype:t instanceof bA?Hse:null},EA=ai("iterator"),A8=!1;[].keys&&("next"in(b8=[].keys())?(y8=Q0(Q0(b8)))!==Object.prototype&&(Du=y8):A8=!0);var zse=Du==null||hn(function(){var e={};return Du[EA].call(e)!==e});zse&&(Du={}),fn(Du[EA])||la(Du,EA,function(){return this});var xA={IteratorPrototype:Du,BUGGY_SAFARI_ITERATORS:A8},Wse=Tu.f,D8=ai("toStringTag"),SA=function(e,t,r){e&&!zn(e=r?e:e.prototype,D8)&&Wse(e,D8,{configurable:!0,value:t})},Gse=xA.IteratorPrototype,Vse=function(){return this},Kse=tr.String,$se=tr.TypeError,q0=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=gr(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(n){}return function(n,i){return Pi(n),function(o){if(typeof o=="object"||fn(o))return o;throw $se("Can't set "+Kse(o)+" as a prototype")}(i),t?e(n,i):n.__proto__=i,n}}():void 0),Xse=mA.PROPER,Yse=mA.CONFIGURABLE,O8=xA.IteratorPrototype,ey=xA.BUGGY_SAFARI_ITERATORS,mp=ai("iterator"),Zse=function(){return this},_8=function(e,t,r,n,i,o,a){!function(U,D,Q,te){var he=D+" Iterator";U.prototype=dA(Gse,{next:Z0(1,Q)}),SA(U,he,!1),Ed[he]=Vse}(r,t,n);var s,l,u,c=function(U){if(U===i&&B)return B;if(!ey&&U in y)return y[U];switch(U){case"keys":case"values":case"entries":return function(){return new r(this,U)}}return function(){return new r(this)}},h=t+" Iterator",S=!1,y=e.prototype,W=y[mp]||y["@@iterator"]||i&&y[i],B=!ey&&W||c(i),N=t=="Array"&&y.entries||W;if(N&&(s=Q0(N.call(new e)))!==Object.prototype&&s.next&&(Q0(s)!==O8&&(q0?q0(s,O8):fn(s[mp])||la(s,mp,Zse)),SA(s,h,!0)),Xse&&i=="values"&&W&&W.name!=="values"&&(Yse?Gs(y,"name","values"):(S=!0,B=function(){return Wn(W,this)})),i)if(l={values:c("values"),keys:o?B:c("keys"),entries:c("entries")},a)for(u in l)(ey||S||!(u in y))&&la(y,u,l[u]);else Vs({target:t,proto:!0,forced:ey||S},l);return y[mp]!==B&&la(y,mp,B,{name:i}),Ed[t]=B,l},Jse=sa.set,Qse=sa.getterFor("Array Iterator"),yp=_8(Array,"Array",function(e,t){Jse(this,{type:"Array Iterator",target:yd(e),index:0,kind:t})},function(){var e=Qse(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):r=="keys"?{value:n,done:!1}:r=="values"?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values");Ed.Arguments=Ed.Array,pp("keys"),pp("values"),pp("entries");var R8={};R8[ai("toStringTag")]="z";var wA=String(R8)==="[object z]",qse=ai("toStringTag"),ele=tr.Object,tle=ja(function(){return arguments}())=="Arguments",ty=wA?ja:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=function(i,o){try{return i[o]}catch(a){}}(t=ele(e),qse))=="string"?r:tle?ja(t):(n=ja(t))=="Object"&&fn(t.callee)?"Arguments":n},rle=wA?{}.toString:function(){return"[object "+ty(this)+"]"};wA||la(Object.prototype,"toString",rle,{unsafe:!0});var nle=tr.String,Ua=function(e){if(ty(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return nle(e)},ile=gr("".charAt),k8=gr("".charCodeAt),ole=gr("".slice),L8=function(e){return function(t,r){var n,i,o=Ua(z0(t)),a=fp(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=k8(o,a))<55296||n>56319||a+1===s||(i=k8(o,a+1))<56320||i>57343?e?ile(o,a):n:e?ole(o,a,a+2):i-56320+(n-55296<<10)+65536}},P8={codeAt:L8(!1),charAt:L8(!0)},ale=P8.charAt,sle=sa.set,lle=sa.getterFor("String Iterator");_8(String,"String",function(e){sle(this,{type:"String Iterator",string:Ua(e),index:0})},function(){var e,t=lle(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=ale(r,n),t.index+=e.length,{value:e,done:!1})});var CA=function(e,t,r){for(var n in t)la(e,n,t[n],r);return e},ule=tr.Array,cle=Math.max,I8=J0.f,M8=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],dle={f:function(e){return M8&&ja(e)=="Window"?function(t){try{return I8(t)}catch(r){return function(n,i,o){for(var a,s,l,u,c=bd(n),h=lA(void 0,c),S=lA(c,c),y=ule(cle(S-h,0)),W=0;h<S;h++,W++)a=y,s=W,l=n[h],(u=sA(s))in a?Tu.f(a,u,Z0(0,l)):a[u]=l;return y.length=W,y}(M8)}}(e):I8(yd(e))}},B8=hn(function(){if(typeof ArrayBuffer=="function"){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}),ry=Object.isExtensible,Ou=hn(function(){ry(1)})||B8?function(e){return!!pn(e)&&(!B8||ja(e)!="ArrayBuffer")&&(!ry||ry(e))}:ry,hle=!hn(function(){return Object.isExtensible(Object.preventExtensions({}))}),TA=VT(function(e){var t=Tu.f,r=!1,n=JT("meta"),i=0,o=function(s){t(s,n,{value:{objectID:"O"+i++,weakData:{}}})},a=e.exports={enable:function(){a.enable=function(){},r=!0;var s=J0.f,l=gr([].splice),u={};u[n]=1,s(u).length&&(J0.f=function(c){for(var h=s(c),S=0,y=h.length;S<y;S++)if(h[S]===n){l(h,S,1);break}return h},Vs({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:dle.f}))},fastKey:function(s,l){if(!pn(s))return typeof s=="symbol"?s:(typeof s=="string"?"S":"P")+s;if(!zn(s,n)){if(!Ou(s))return"F";if(!l)return"E";o(s)}return s[n].objectID},getWeakData:function(s,l){if(!zn(s,n)){if(!Ou(s))return!0;if(!l)return!1;o(s)}return s[n].weakData},onFreeze:function(s){return hle&&r&&Ou(s)&&!zn(s,n)&&o(s),s}};V0[n]=!0}),F8=gr(gr.bind),AA=function(e,t){return aA(e),t===void 0?e:F8?F8(e,t):function(){return e.apply(t,arguments)}},fle=ai("iterator"),ple=Array.prototype,gle=ai("iterator"),N8=function(e){if(e!=null)return hp(e,gle)||hp(e,"@@iterator")||Ed[ty(e)]},vle=tr.TypeError,j8=function(e,t,r){var n,i;Pi(e);try{if(!(n=hp(e,"return"))){if(t==="throw")throw r;return r}n=Wn(n,e)}catch(o){i=!0,n=o}if(t==="throw")throw r;if(i)throw n;return Pi(n),r},mle=tr.TypeError,ny=function(e,t){this.stopped=e,this.result=t},U8=ny.prototype,H8=function(e,t,r){var n,i,o,a,s,l,u,c,h=r&&r.that,S=!(!r||!r.AS_ENTRIES),y=!(!r||!r.IS_ITERATOR),W=!(!r||!r.INTERRUPTED),B=AA(t,h),N=function(D){return n&&j8(n,"normal",D),new ny(!0,D)},U=function(D){return S?(Pi(D),W?B(D[0],D[1],N):B(D[0],D[1])):W?B(D,N):B(D)};if(y)n=e;else{if(!(i=N8(e)))throw mle(oA(e)+" is not iterable");if((c=i)!==void 0&&(Ed.Array===c||ple[fle]===c)){for(o=0,a=bd(e);a>o;o++)if((s=U(e[o]))&&G0(U8,s))return s;return new ny(!1)}n=function(D,Q){var te=arguments.length<2?N8(D):Q;if(aA(te))return Pi(Wn(te,D));throw vle(oA(D)+" is not iterable")}(e,i)}for(l=n.next;!(u=Wn(l,n)).done;){try{s=U(u.value)}catch(D){j8(n,"throw",D)}if(typeof s=="object"&&s&&G0(U8,s))return s}return new ny(!1)},yle=tr.TypeError,z8=function(e,t){if(G0(t,e))return e;throw yle("Incorrect invocation")},W8=ai("iterator"),G8=!1;try{var ble=0,V8={next:function(){return{done:!!ble++}},return:function(){G8=!0}};V8[W8]=function(){return this},Array.from(V8,function(){throw 2})}catch(e){}var DA=Array.isArray||function(e){return ja(e)=="Array"},K8=function(){},Ele=[],$8=up("Reflect","construct"),OA=/^\s*(?:class|function)\b/,xle=gr(OA.exec),Sle=!OA.exec(K8),bp=function(e){if(!fn(e))return!1;try{return $8(K8,Ele,e),!0}catch(t){return!1}},wle=!$8||hn(function(){var e;return bp(bp.call)||!bp(Object)||!bp(function(){e=!0})||e})?function(e){if(!fn(e))return!1;switch(ty(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return Sle||!!xle(OA,pA(e))}:bp,Cle=ai("species"),X8=tr.Array,Y8=function(e,t){return new(function(r){var n;return DA(r)&&(n=r.constructor,(wle(n)&&(n===X8||DA(n.prototype))||pn(n)&&(n=n[Cle])===null)&&(n=void 0)),n===void 0?X8:n}(e))(t===0?0:t)},Z8=gr([].push),Ks=function(e){var t=e==1,r=e==2,n=e==3,i=e==4,o=e==6,a=e==7,s=e==5||o;return function(l,u,c,h){for(var S,y,W=lp(l),B=QF(W),N=AA(u,c),U=bd(B),D=0,Q=h||Y8,te=t?Q(l,U):r||a?Q(l,0):void 0;U>D;D++)if((s||D in B)&&(y=N(S=B[D],D,W),e))if(t)te[D]=y;else if(y)switch(e){case 3:return!0;case 5:return S;case 6:return D;case 2:Z8(te,S)}else switch(e){case 4:return!1;case 7:Z8(te,S)}return o?-1:n||i?i:te}},_A={forEach:Ks(0),map:Ks(1),filter:Ks(2),some:Ks(3),every:Ks(4),find:Ks(5),findIndex:Ks(6),filterReject:Ks(7)},iy=TA.getWeakData,Tle=sa.set,Ale=sa.getterFor,Dle=_A.find,Ole=_A.findIndex,_le=gr([].splice),Rle=0,oy=function(e){return e.frozen||(e.frozen=new J8)},J8=function(){this.entries=[]},RA=function(e,t){return Dle(e.entries,function(r){return r[0]===t})};J8.prototype={get:function(e){var t=RA(this,e);if(t)return t[1]},has:function(e){return!!RA(this,e)},set:function(e,t){var r=RA(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=Ole(this.entries,function(r){return r[0]===e});return~t&&_le(this.entries,t,1),!!~t}};var Ep,Q8={getConstructor:function(e,t,r,n){var i=e(function(l,u){z8(l,o),Tle(l,{type:t,id:Rle++,frozen:void 0}),u!=null&&H8(u,l[n],{that:l,AS_ENTRIES:r})}),o=i.prototype,a=Ale(t),s=function(l,u,c){var h=a(l),S=iy(Pi(u),!0);return S===!0?oy(h).set(u,c):S[h.id]=c,l};return CA(o,{delete:function(l){var u=a(this);if(!pn(l))return!1;var c=iy(l);return c===!0?oy(u).delete(l):c&&zn(c,u.id)&&delete c[u.id]},has:function(l){var u=a(this);if(!pn(l))return!1;var c=iy(l);return c===!0?oy(u).has(l):c&&zn(c,u.id)}}),CA(o,r?{get:function(l){var u=a(this);if(pn(l)){var c=iy(l);return c===!0?oy(u).get(l):c?c[u.id]:void 0}},set:function(l,u){return s(this,l,u)}}:{add:function(l){return s(this,l,!0)}}),i}},ay=sa.enforce,kle=!tr.ActiveXObject&&"ActiveXObject"in tr,q8=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},Lle=function(e,t,r){var n=e.indexOf("Map")!==-1,i=e.indexOf("Weak")!==-1,o=n?"set":"add",a=tr[e],s=a&&a.prototype,l=a,u={},c=function(N){var U=gr(s[N]);la(s,N,N=="add"?function(D){return U(this,D===0?0:D),this}:N=="delete"?function(D){return!(i&&!pn(D))&&U(this,D===0?0:D)}:N=="get"?function(D){return i&&!pn(D)?void 0:U(this,D===0?0:D)}:N=="has"?function(D){return!(i&&!pn(D))&&U(this,D===0?0:D)}:function(D,Q){return U(this,D===0?0:D,Q),this})};if(yA(e,!fn(a)||!(i||s.forEach&&!hn(function(){new a().entries().next()}))))l=r.getConstructor(t,e,n,o),TA.enable();else if(yA(e,!0)){var h=new l,S=h[o](i?{}:-0,1)!=h,y=hn(function(){h.has(1)}),W=function(N,U){if(!G8)return!1;var D=!1;try{var Q={};Q[W8]=function(){return{next:function(){return{done:D=!0}}}},function(te){new a(te)}(Q)}catch(te){}return D}(),B=!i&&hn(function(){for(var N=new a,U=5;U--;)N[o](U,U);return!N.has(-0)});W||((l=t(function(N,U){z8(N,s);var D=function(Q,te,he){var Ee,ve;return q0&&fn(Ee=te.constructor)&&Ee!==he&&pn(ve=Ee.prototype)&&ve!==he.prototype&&q0(Q,ve),Q}(new a,N,l);return U!=null&&H8(U,D[o],{that:D,AS_ENTRIES:n}),D})).prototype=s,s.constructor=l),(y||B)&&(c("delete"),c("has"),n&&c("get")),(B||S)&&c(o),i&&s.clear&&delete s.clear}return u[e]=l,Vs({global:!0,forced:l!=a},u),SA(l,e),i||r.setStrong(l,e,n),l}("WeakMap",q8,Q8);if(v8&&kle){Ep=Q8.getConstructor(q8,"WeakMap",!0),TA.enable();var xp=Lle.prototype,e6=gr(xp.delete),sy=gr(xp.has),t6=gr(xp.get),r6=gr(xp.set);CA(xp,{delete:function(e){if(pn(e)&&!Ou(e)){var t=ay(this);return t.frozen||(t.frozen=new Ep),e6(this,e)||t.frozen.delete(e)}return e6(this,e)},has:function(e){if(pn(e)&&!Ou(e)){var t=ay(this);return t.frozen||(t.frozen=new Ep),sy(this,e)||t.frozen.has(e)}return sy(this,e)},get:function(e){if(pn(e)&&!Ou(e)){var t=ay(this);return t.frozen||(t.frozen=new Ep),sy(this,e)?t6(this,e):t.frozen.get(e)}return t6(this,e)},set:function(e,t){if(pn(e)&&!Ou(e)){var r=ay(this);r.frozen||(r.frozen=new Ep),sy(this,e)?r6(this,e,t):r.frozen.set(e,t)}else r6(this,e,t);return this}})}var n6={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},kA=nA("span").classList,i6=kA&&kA.constructor&&kA.constructor.prototype,Ple=i6===Object.prototype?void 0:i6,LA=ai("iterator"),o6=ai("toStringTag"),PA=yp.values,a6=function(e,t){if(e){if(e[LA]!==PA)try{Gs(e,LA,PA)}catch(n){e[LA]=PA}if(e[o6]||Gs(e,o6,t),n6[t]){for(var r in yp)if(e[r]!==yp[r])try{Gs(e,r,yp[r])}catch(n){e[r]=yp[r]}}}};for(var IA in n6)a6(tr[IA]&&tr[IA].prototype,IA);a6(Ple,"DOMTokenList");var MA=new WeakMap,Ile={type:"list-item",renderElem:function(e,t,r){MA.set(e,r);var n=e,i=n.level,o=i===void 0?0:i,a=n.ordered,s={margin:"5px 0 5px "+20*o+"px"},l="";if(a!==void 0&&a){var u=function(h,S){var y=S,W=y.type,B=y.level,N=B===void 0?0:B,U=y.ordered,D=U!==void 0&&U;if(!D)return-1;var Q=1,te=S,he=Ae.findPath(h,te);if(he[0]===0)return 1;for(;he[0]>0;){var Ee=Ue.previous(he),ve=de.node(h,Ee);if(ve==null)break;var De=ve[0],Pe=De.level,qe=Pe===void 0?0:Pe,ot=De.type,et=De.ordered;if(ot!==W)break;if(qe<N)break;if(qe===N){if(et!==D)break;Q++}te=De,he=Ee}return Q}(r,e);l=u+"."}else l=function(h){h===void 0&&(h=0);var S="";switch(h){case 0:S="\u2022";break;case 1:S="\u25E6";break;default:S="\u25AA"}return S}(o);var c=function(h){var S,y=h.children||[],W=y.length;if(W===0)return"";for(var B=0;B<W&&!S;B++){var N=y[B];Rt.isText(N)&&(S=N)}return S==null?"":S.color||""}(e);return er("div",{style:s},er("span",{contentEditable:!1,style:{marginRight:"0.5em",color:c},"data-w-e-reserve":!0},l),er("span",null,t))}},BA=function(e,t){return BA=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},BA(e,t);/*! *****************************************************************************
|
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
purpose with or without fee is hereby granted.
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
|
***************************************************************************** */};function s6(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}BA(e,t),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function l6(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Sp(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function u6(e){return de.nodes(e,{at:e.selection||void 0,match:function(t){return Ae.findPath(e,t).length===1}})}var Mle=l8.includes;Vs({target:"Array",proto:!0},{includes:function(e){return Mle(this,e,arguments.length>1?arguments[1]:void 0)}}),pp("includes");var c6,FA,Ble=function(){var e=Pi(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},NA=tr.RegExp,jA=hn(function(){var e=NA("a","y");return e.lastIndex=2,e.exec("abcd")!=null}),Fle=jA||hn(function(){return!NA("a","y").sticky}),Nle={BROKEN_CARET:jA||hn(function(){var e=NA("^r","gy");return e.lastIndex=2,e.exec("str")!=null}),MISSED_STICKY:Fle,UNSUPPORTED_Y:jA},jle=tr.RegExp,Ule=hn(function(){var e=jle(".","s");return!(e.dotAll&&e.exec(`
|
|
|
`)&&e.flags==="s")}),Hle=tr.RegExp,zle=hn(function(){var e=Hle("(?<a>b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$<a>c")!=="bc"}),Wle=sa.get,Gle=ZT("native-string-replace",String.prototype.replace),ly=RegExp.prototype.exec,UA=ly,Vle=gr("".charAt),Kle=gr("".indexOf),$le=gr("".replace),HA=gr("".slice),zA=(FA=/b*/g,Wn(ly,c6=/a/,"a"),Wn(ly,FA,"a"),c6.lastIndex!==0||FA.lastIndex!==0),d6=Nle.BROKEN_CARET,WA=/()??/.exec("")[1]!==void 0;(zA||WA||d6||Ule||zle)&&(UA=function(e){var t,r,n,i,o,a,s,l=this,u=Wle(l),c=Ua(e),h=u.raw;if(h)return h.lastIndex=l.lastIndex,t=Wn(UA,h,c),l.lastIndex=h.lastIndex,t;var S=u.groups,y=d6&&l.sticky,W=Wn(Ble,l),B=l.source,N=0,U=c;if(y&&(W=$le(W,"y",""),Kle(W,"g")===-1&&(W+="g"),U=HA(c,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&Vle(c,l.lastIndex-1)!==`
|
|
|
`)&&(B="(?: "+B+")",U=" "+U,N++),r=new RegExp("^(?:"+B+")",W)),WA&&(r=new RegExp("^"+B+"$(?!\\s)",W)),zA&&(n=l.lastIndex),i=Wn(ly,y?r:l,U),y?i?(i.input=HA(i.input,N),i[0]=HA(i[0],N),i.index=l.lastIndex,l.lastIndex+=i[0].length):l.lastIndex=0:zA&&i&&(l.lastIndex=l.global?i.index+i[0].length:n),WA&&i&&i.length>1&&Wn(Gle,i[0],r,function(){for(o=1;o<arguments.length-2;o++)arguments[o]===void 0&&(i[o]=void 0)}),i&&S)for(i.groups=a=dA(null),o=0;o<S.length;o++)a[(s=S[o])[0]]=i[s[1]];return i});var uy=UA;Vs({target:"RegExp",proto:!0,forced:/./.exec!==uy},{exec:uy});var h6=function(){function e(){this.type="list-item",this.tag="button"}return e.prototype.getListNode=function(t){var r=this.type;return Ae.getSelectedNodeByType(t,r)},e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){var r=this.getListNode(t);if(r==null)return!1;var n=r.ordered;return(n!==void 0&&n)===this.ordered},e.prototype.isDisabled=function(t){return t.selection==null||!!Ae.getSelectedElems(t).some(function(r){if(de.isVoid(t,r)&&de.isBlock(t,r))return!0;var n=r.type;return!!["pre","code","table"].includes(n)||void 0})},e.prototype.exec=function(t,r){this.isActive(t)?Ve.setNodes(t,{type:"paragraph",ordered:void 0,level:void 0}):Ve.setNodes(t,{type:"list-item",ordered:this.ordered,indent:void 0})},e}(),Xle='<svg viewBox="0 0 1024 1024"><path d="M384 64h640v128H384V64z m0 384h640v128H384v-128z m0 384h640v128H384v-128zM0 128a128 128 0 1 1 256 0 128 128 0 0 1-256 0z m0 384a128 128 0 1 1 256 0 128 128 0 0 1-256 0z m0 384a128 128 0 1 1 256 0 128 128 0 0 1-256 0z"></path></svg>',Yle='<svg viewBox="0 0 1024 1024"><path d="M384 832h640v128H384z m0-384h640v128H384z m0-384h640v128H384zM192 0v256H128V64H64V0zM128 526.016v50.016h128v64H64v-146.016l128-60V384H64v-64h192v146.016zM256 704v320H64v-64h128v-64H64v-64h128v-64H64v-64z"></path></svg>',Zle=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.ordered=!1,r.title=wt("listModule.unOrderedList"),r.iconSvg=Xle,r}return s6(t,e),t}(h6),Jle=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.ordered=!0,r.title=wt("listModule.orderedList"),r.iconSvg=Yle,r}return s6(t,e),t}(h6),Qle={key:"bulletedList",factory:function(){return new Zle}},qle={key:"numberedList",factory:function(){return new Jle}},f6=[],eue={type:"list-item",elemToHtml:function(e,t){var r="",n="",i=e.ordered,o=i!==void 0&&i?"ol":"ul",a=function(u){var c=MA.get(u);if(c==null)return 0;var h=u,S=h.type,y=h.ordered,W=y!==void 0&&y,B=h.level,N=B===void 0?0:B,U=Ae.findPath(c,u);if(U[0]===0)return N+1;var D=Ue.previous(U),Q=de.node(c,D);if(!Q)return 0;var te=Sp(Q,1)[0];if(Ae.getNodeType(te)!==S)return N+1;var he=te,Ee=he.ordered,ve=Ee!==void 0&&Ee,De=he.level,Pe=De===void 0?0:De;return Pe<N?N-Pe:Pe>N?0:Pe===N?ve===W?0:1:0}(e);if(a>0)for(var s=0;s<a;s++)r+="<"+o+">",f6.push(o);var l=function(u){var c=MA.get(u);if(c==null)return 0;var h=u,S=h.type,y=h.ordered,W=y!==void 0&&y,B=h.level,N=B===void 0?0:B,U=Ae.findPath(c,u);if(U[0]===c.children.length-1)return N+1;var D=Ue.next(U),Q=de.node(c,D);if(!Q)return 0;var te=Sp(Q,1)[0];if(Ae.getNodeType(te)!==S)return N+1;var he=te,Ee=he.ordered,ve=Ee!==void 0&&Ee,De=he.level,Pe=De===void 0?0:De;return Pe<N?N-Pe:Pe>N?0:Pe===N?ve===W?0:1:0}(e);if(l>0)for(s=0;s<l;s++)n+="</"+f6.pop()+">";return{html:"<li>"+t+"</li>",prefix:r,suffix:n}}},tue=ai("species"),rue=_A.filter,nue=qT>=51||!hn(function(){var e=[];return(e.constructor={})[tue]=function(){return{foo:1}},e.filter(Boolean).foo!==1});Vs({target:"Array",proto:!0,forced:!nue},{filter:function(e){return rue(this,e,arguments.length>1?arguments[1]:void 0)}});var GA=Function.prototype,p6=GA.apply,iue=GA.bind,g6=GA.call,oue=typeof Reflect=="object"&&Reflect.apply||(iue?g6.bind(p6):function(){return g6.apply(p6,arguments)}),v6=(ai("species"),RegExp.prototype),aue=P8.charAt,sue=function(e,t,r){return t+(r?aue(e,t).length:1)},lue=Math.floor,VA=gr("".charAt),uue=gr("".replace),KA=gr("".slice),cue=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,due=/\$([$&'`]|\d{1,2})/g,hue=function(e,t,r,n,i,o){var a=r+e.length,s=n.length,l=due;return i!==void 0&&(i=lp(i),l=cue),uue(o,l,function(u,c){var h;switch(VA(c,0)){case"$":return"$";case"&":return e;case"`":return KA(t,0,r);case"'":return KA(t,a);case"<":h=i[KA(c,1,-1)];break;default:var S=+c;if(S===0)return u;if(S>s){var y=lue(S/10);return y===0?u:y<=s?n[y-1]===void 0?VA(c,1):n[y-1]+VA(c,1):u}h=n[S-1]}return h===void 0?"":h})},fue=tr.TypeError,pue=function(e,t){var r=e.exec;if(fn(r)){var n=Wn(r,e,t);return n!==null&&Pi(n),n}if(ja(e)==="RegExp")return Wn(uy,e,t);throw fue("RegExp#exec called on incompatible receiver")},$A=ai("replace"),gue=Math.max,vue=Math.min,mue=gr([].concat),XA=gr([].push),m6=gr("".indexOf),y6=gr("".slice),yue="a".replace(/./,"$0")==="$0",b6=!!/./[$A]&&/./[$A]("a","$0")==="";!function(e,t,r,n){var i=ai(e),o=!hn(function(){var u={};return u[i]=function(){return 7},""[e](u)!=7}),a=o&&!hn(function(){var u=!1,c=/a/;return c.exec=function(){return u=!0,null},c[i](""),!u});if(!o||!a||r){var s=gr(/./[i]),l=function(u,c,h){var S=b6?"$":"$0";return[function(y,W){var B=z0(this),N=y==null?void 0:hp(y,$A);return N?Wn(N,y,B,W):Wn(c,Ua(B),y,W)},function(y,W){var B=Pi(this),N=Ua(y);if(typeof W=="string"&&m6(W,S)===-1&&m6(W,"$<")===-1){var U=h(c,B,N,W);if(U.done)return U.value}var D=fn(W);D||(W=Ua(W));var Q=B.global;if(Q){var te=B.unicode;B.lastIndex=0}for(var he=[];;){var Ee=pue(B,N);if(Ee===null)break;if(XA(he,Ee),!Q)break;Ua(Ee[0])===""&&(B.lastIndex=sue(N,a8(B.lastIndex),te))}for(var ve,De="",Pe=0,qe=0;qe<he.length;qe++){for(var ot=Ua((Ee=he[qe])[0]),et=gue(vue(fp(Ee.index),N.length),0),gt=[],dt=1;dt<Ee.length;dt++)XA(gt,(ve=Ee[dt])===void 0?ve:String(ve));var ht=Ee.groups;if(D){var pt=mue([ot],gt,et,N);ht!==void 0&&XA(pt,ht);var Dt=Ua(oue(W,void 0,pt))}else Dt=hue(ot,N,et,gt,ht,W);et>=Pe&&(De+=y6(N,Pe,et)+Dt,Pe=et+ot.length)}return De+y6(N,Pe)}]}(0,""[e],function(u,c,h,S,y){var W=gr(u),B=c.exec;return B===uy||B===v6.exec?o&&!y?{done:!0,value:s(c,h,S)}:{done:!0,value:W(h,c,S)}:{done:!1}});la(String.prototype,e,l[0]),la(v6,i,l[1])}}("replace",0,!!hn(function(){var e=/./;return e.exec=function(){var t=[];return t.groups={a:"7"},t},"".replace(e,"$<a>")!=="7"})||!yue||b6);var bue=tr.TypeError,E6=function(e,t,r,n,i,o,a,s){for(var l,u,c=i,h=0,S=!!a&&AA(a,s);h<n;){if(h in r){if(l=S?S(r[h],h,t):r[h],o>0&&DA(l))u=bd(l),c=E6(e,t,l,u,c,o-1)-1;else{if(c>=9007199254740991)throw bue("Exceed the acceptable array length");e[c]=l}c++}h++}return c},Eue=E6;function YA(e){return e.length?e[0].tagName.toLowerCase():""}Vs({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,t=lp(this),r=bd(t),n=Y8(t,0);return n.length=Eue(n,t,t,r,0,e===void 0?1:fp(e)),n}}),pp("flat"),Vs({global:!0},{globalThis:tr}),io&&(_e.fn.append=io),no&&(_e.fn.attr=no),yc&&(_e.fn.parent=yc);var xue={renderElems:[Ile],editorPlugin:function(e){var t=e.deleteBackward,r=e.handleTab,n=e.normalizeNode,i=e;return i.deleteBackward=function(o){var a=i.selection;if(a!=null)if(Qe.isExpanded(a))t(o);else{var s=Ae.getSelectedNodeByType(i,"list-item");if(s!=null)if(a.focus.offset!==0)t(o);else{var l=s.level,u=l===void 0?0:l;u>0?Ve.setNodes(i,{level:u-1}):Ve.setNodes(i,{type:"paragraph",ordered:void 0,level:void 0})}else t(o)}else t(o)},i.handleTab=function(){var o,a,s,l,u=i.selection;if(u!=null){if(Qe.isCollapsed(u)){var c=Ae.getSelectedNodeByType(i,"list-item");if(c==null)return void r();if(u.focus.offset===0){var h=c.level,S=h===void 0?0:h;return void Ve.setNodes(i,{level:S+1})}}if(Qe.isExpanded(u)){var y=0,W=!1;try{for(var B=l6(u6(i)),N=B.next();!N.done;N=B.next()){var U=Sp(N.value,1)[0];Ae.getNodeType(U)==="list-item"?y++:W=!0}}catch(ve){o={error:ve}}finally{try{N&&!N.done&&(a=B.return)&&a.call(B)}finally{if(o)throw o.error}}if(W||y<=1)return void r();try{for(var D=l6(u6(i)),Q=D.next();!Q.done;Q=D.next()){var te=Sp(Q.value,2),he=(U=te[0],te[1]),Ee=U.level;S=Ee===void 0?0:Ee,Ve.setNodes(i,{level:S+1},{at:he})}}catch(ve){s={error:ve}}finally{try{Q&&!Q.done&&(l=D.return)&&l.call(D)}finally{if(s)throw s.error}}}else r()}else r()},i.normalizeNode=function(o){var a=Sp(o,2),s=a[0],l=a[1],u=Ae.getNodeType(s);return u!=="bulleted-list"&&u!=="numbered-list"||Ve.unwrapNodes(i,{at:l}),n([s,l])},i},menus:[Qle,qle],elemsToHtml:[eue],parseElemsHtml:[{selector:"ul:not([data-w-e-type]),ol:not([data-w-e-type])",parseElemHtml:function(e,t,r){return t.flat(1/0)}},{selector:"li:not([data-w-e-type])",parseElemHtml:function(e,t,r){var n=_e(e);(t=t.filter(function(a){return!!Rt.isText(a)||!!r.isInline(a)})).length===0&&(t=[{text:n.text().replace(/\s+/gm," ")}]);var i=function(a){return YA(a.parent())==="ol"}(n),o=function(a){for(var s=0,l=a.parent(),u=YA(l);u==="ul"||u==="ol";)u=YA(l=l.parent()),s++;return s-1}(n);return{type:"list-item",ordered:i,level:o,children:t}}}]},x6=ae(function(e,t){var r="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",o="[object Array]",a="[object Boolean]",s="[object Date]",l="[object Error]",u="[object Function]",c="[object Map]",h="[object Number]",S="[object Object]",y="[object Promise]",W="[object RegExp]",B="[object Set]",N="[object String]",U="[object Symbol]",D="[object WeakMap]",Q="[object ArrayBuffer]",te="[object DataView]",he=/^\[object .+?Constructor\]$/,Ee=/^(?:0|[1-9]\d*)$/,ve={};ve["[object Float32Array]"]=ve["[object Float64Array]"]=ve["[object Int8Array]"]=ve["[object Int16Array]"]=ve["[object Int32Array]"]=ve["[object Uint8Array]"]=ve["[object Uint8ClampedArray]"]=ve["[object Uint16Array]"]=ve["[object Uint32Array]"]=!0,ve[i]=ve[o]=ve[Q]=ve[a]=ve[te]=ve[s]=ve[l]=ve[u]=ve[c]=ve[h]=ve[S]=ve[W]=ve[B]=ve[N]=ve[D]=!1;var De=typeof re=="object"&&re&&re.Object===Object&&re,Pe=typeof self=="object"&&self&&self.Object===Object&&self,qe=De||Pe||Function("return this")(),ot=t&&!t.nodeType&&t,et=ot&&e&&!e.nodeType&&e,gt=et&&et.exports===ot,dt=gt&&De.process,ht=function(){try{return dt&&dt.binding&&dt.binding("util")}catch(Be){}}(),pt=ht&&ht.isTypedArray;function Dt(Be,Ze){for(var Et=-1,Kt=Be==null?0:Be.length;++Et<Kt;)if(Ze(Be[Et],Et,Be))return!0;return!1}function Ft(Be){var Ze=-1,Et=Array(Be.size);return Be.forEach(function(Kt,zr){Et[++Ze]=[zr,Kt]}),Et}function Bt(Be){var Ze=-1,Et=Array(Be.size);return Be.forEach(function(Kt){Et[++Ze]=Kt}),Et}var It=Array.prototype,Re=Function.prototype,Te=Object.prototype,Fe=qe["__core-js_shared__"],rt=Re.toString,vt=Te.hasOwnProperty,ut=function(){var Be=/[^.]+$/.exec(Fe&&Fe.keys&&Fe.keys.IE_PROTO||"");return Be?"Symbol(src)_1."+Be:""}(),kt=Te.toString,Xt=RegExp("^"+rt.call(vt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qt=gt?qe.Buffer:void 0,or=qe.Symbol,ft=qe.Uint8Array,br=Te.propertyIsEnumerable,lr=It.splice,Gt=or?or.toStringTag:void 0,ur=Object.getOwnPropertySymbols,yn=qt?qt.isBuffer:void 0,Ar=function(Be,Ze){return function(Et){return Be(Ze(Et))}}(Object.keys,Object),Hr=El(qe,"DataView"),on=El(qe,"Map"),vi=El(qe,"Promise"),Sr=El(qe,"Set"),Mi=El(qe,"WeakMap"),zo=El(Object,"create"),ma=Ya(Hr),qd=Ya(on),Yu=Ya(vi),Wo=Ya(Sr),ya=Ya(Mi),Ka=or?or.prototype:void 0,mi=Ka?Ka.valueOf:void 0;function yi(Be){var Ze=-1,Et=Be==null?0:Be.length;for(this.clear();++Ze<Et;){var Kt=Be[Ze];this.set(Kt[0],Kt[1])}}function bi(Be){var Ze=-1,Et=Be==null?0:Be.length;for(this.clear();++Ze<Et;){var Kt=Be[Ze];this.set(Kt[0],Kt[1])}}function Ci(Be){var Ze=-1,Et=Be==null?0:Be.length;for(this.clear();++Ze<Et;){var Kt=Be[Ze];this.set(Kt[0],Kt[1])}}function ti(Be){var Ze=-1,Et=Be==null?0:Be.length;for(this.__data__=new Ci;++Ze<Et;)this.add(Be[Ze])}function Co(Be){var Ze=this.__data__=new bi(Be);this.size=Ze.size}function Vg(Be,Ze){var Et=Za(Be),Kt=!Et&&Jb(Be),zr=!Et&&!Kt&&ba(Be),mr=!Et&&!Kt&&!zr&&xa(Be),Le=Et||Kt||zr||mr,tt=Le?function(xr,tn){for(var Wr=-1,_r=Array(xr);++Wr<xr;)_r[Wr]=tn(Wr);return _r}(Be.length,String):[],Ct=tt.length;for(var Mt in Be)!Ze&&!vt.call(Be,Mt)||Le&&(Mt=="length"||zr&&(Mt=="offset"||Mt=="parent")||mr&&(Mt=="buffer"||Mt=="byteLength"||Mt=="byteOffset")||Kg(Mt,Ct))||tt.push(Mt);return tt}function bl(Be,Ze){for(var Et=Be.length;Et--;)if(rh(Be[Et][0],Ze))return Et;return-1}function $a(Be){return Be==null?Be===void 0?"[object Undefined]":"[object Null]":Gt&&Gt in Object(Be)?function(Ze){var Et=vt.call(Ze,Gt),Kt=Ze[Gt];try{Ze[Gt]=void 0;var zr=!0}catch(Le){}var mr=kt.call(Ze);return zr&&(Et?Ze[Gt]=Kt:delete Ze[Gt]),mr}(Be):function(Ze){return kt.call(Ze)}(Be)}function eh(Be){return xl(Be)&&$a(Be)==i}function Zu(Be,Ze,Et,Kt,zr){return Be===Ze||(Be==null||Ze==null||!xl(Be)&&!xl(Ze)?Be!=Be&&Ze!=Ze:function(mr,Le,tt,Ct,Mt,xr){var tn=Za(mr),Wr=Za(Le),_r=tn?o:qi(mr),Vn=Wr?o:qi(Le),Ei=(_r=_r==i?S:_r)==S,Ju=(Vn=Vn==i?S:Vn)==S,Ja=_r==Vn;if(Ja&&ba(mr)){if(!ba(Le))return!1;tn=!0,Ei=!1}if(Ja&&!Ei)return xr||(xr=new Co),tn||xa(mr)?To(mr,Le,tt,Ct,Mt,xr):function(Er,Rr,kr,bn,Ti,Bi,Ko){switch(kr){case te:if(Er.byteLength!=Rr.byteLength||Er.byteOffset!=Rr.byteOffset)return!1;Er=Er.buffer,Rr=Rr.buffer;case Q:return!(Er.byteLength!=Rr.byteLength||!Bi(new ft(Er),new ft(Rr)));case a:case s:case h:return rh(+Er,+Rr);case l:return Er.name==Rr.name&&Er.message==Rr.message;case W:case N:return Er==Rr+"";case c:var wl=Ft;case B:var Xg=1&bn;if(wl||(wl=Bt),Er.size!=Rr.size&&!Xg)return!1;var e1=Ko.get(Er);if(e1)return e1==Rr;bn|=2,Ko.set(Er,Rr);var nh=To(wl(Er),wl(Rr),bn,Ti,Bi,Ko);return Ko.delete(Er),nh;case U:if(mi)return mi.call(Er)==mi.call(Rr)}return!1}(mr,Le,_r,tt,Ct,Mt,xr);if(!(1&tt)){var Sl=Ei&&vt.call(mr,"__wrapped__"),rr=Ju&&vt.call(Le,"__wrapped__");if(Sl||rr){var Mr=Sl?mr.value():mr,An=rr?Le.value():Le;return xr||(xr=new Co),Mt(Mr,An,tt,Ct,xr)}}return Ja?(xr||(xr=new Co),function(Er,Rr,kr,bn,Ti,Bi){var Ko=1&kr,wl=Xa(Er),Xg=wl.length,e1=Xa(Rr).length;if(Xg!=e1&&!Ko)return!1;for(var nh=Xg;nh--;){var Qu=wl[nh];if(!(Ko?Qu in Rr:vt.call(Rr,Qu)))return!1}var GH=Bi.get(Er);if(GH&&Bi.get(Rr))return GH==Rr;var t1=!0;Bi.set(Er,Rr),Bi.set(Rr,Er);for(var yR=Ko;++nh<Xg;){var r1=Er[Qu=wl[nh]],n1=Rr[Qu];if(bn)var VH=Ko?bn(n1,r1,Qu,Rr,Er,Bi):bn(r1,n1,Qu,Er,Rr,Bi);if(!(VH===void 0?r1===n1||Ti(r1,n1,kr,bn,Bi):VH)){t1=!1;break}yR||(yR=Qu=="constructor")}if(t1&&!yR){var i1=Er.constructor,o1=Rr.constructor;i1==o1||!("constructor"in Er)||!("constructor"in Rr)||typeof i1=="function"&&i1 instanceof i1&&typeof o1=="function"&&o1 instanceof o1||(t1=!1)}return Bi.delete(Er),Bi.delete(Rr),t1}(mr,Le,tt,Ct,Mt,xr)):!1}(Be,Ze,Et,Kt,Zu,zr))}function th(Be){return!(!Qb(Be)||function(Ze){return!!ut&&ut in Ze}(Be))&&($g(Be)?Xt:he).test(Ya(Be))}function Go(Be){if(Et=(Ze=Be)&&Ze.constructor,Kt=typeof Et=="function"&&Et.prototype||Te,Ze!==Kt)return Ar(Be);var Ze,Et,Kt,zr=[];for(var mr in Object(Be))vt.call(Be,mr)&&mr!="constructor"&&zr.push(mr);return zr}function To(Be,Ze,Et,Kt,zr,mr){var Le=1&Et,tt=Be.length,Ct=Ze.length;if(tt!=Ct&&!(Le&&Ct>tt))return!1;var Mt=mr.get(Be);if(Mt&&mr.get(Ze))return Mt==Ze;var xr=-1,tn=!0,Wr=2&Et?new ti:void 0;for(mr.set(Be,Ze),mr.set(Ze,Be);++xr<tt;){var _r=Be[xr],Vn=Ze[xr];if(Kt)var Ei=Le?Kt(Vn,_r,xr,Ze,Be,mr):Kt(_r,Vn,xr,Be,Ze,mr);if(Ei!==void 0){if(Ei)continue;tn=!1;break}if(Wr){if(!Dt(Ze,function(Ju,Ja){if(Sl=Ja,!Wr.has(Sl)&&(_r===Ju||zr(_r,Ju,Et,Kt,mr)))return Wr.push(Ja);var Sl})){tn=!1;break}}else if(_r!==Vn&&!zr(_r,Vn,Et,Kt,mr)){tn=!1;break}}return mr.delete(Be),mr.delete(Ze),tn}function Xa(Be){return function(Ze,Et,Kt){var zr=Et(Ze);return Za(Ze)?zr:function(mr,Le){for(var tt=-1,Ct=Le.length,Mt=mr.length;++tt<Ct;)mr[Mt+tt]=Le[tt];return mr}(zr,Kt(Ze))}(Be,qb,Zb)}function Vo(Be,Ze){var Et,Kt,zr=Be.__data__;return((Kt=typeof(Et=Ze))=="string"||Kt=="number"||Kt=="symbol"||Kt=="boolean"?Et!=="__proto__":Et===null)?zr[typeof Ze=="string"?"string":"hash"]:zr.map}function El(Be,Ze){var Et=function(Kt,zr){return Kt==null?void 0:Kt[zr]}(Be,Ze);return th(Et)?Et:void 0}yi.prototype.clear=function(){this.__data__=zo?zo(null):{},this.size=0},yi.prototype.delete=function(Be){var Ze=this.has(Be)&&delete this.__data__[Be];return this.size-=Ze?1:0,Ze},yi.prototype.get=function(Be){var Ze=this.__data__;if(zo){var Et=Ze[Be];return Et===r?void 0:Et}return vt.call(Ze,Be)?Ze[Be]:void 0},yi.prototype.has=function(Be){var Ze=this.__data__;return zo?Ze[Be]!==void 0:vt.call(Ze,Be)},yi.prototype.set=function(Be,Ze){var Et=this.__data__;return this.size+=this.has(Be)?0:1,Et[Be]=zo&&Ze===void 0?r:Ze,this},bi.prototype.clear=function(){this.__data__=[],this.size=0},bi.prototype.delete=function(Be){var Ze=this.__data__,Et=bl(Ze,Be);return!(Et<0)&&(Et==Ze.length-1?Ze.pop():lr.call(Ze,Et,1),--this.size,!0)},bi.prototype.get=function(Be){var Ze=this.__data__,Et=bl(Ze,Be);return Et<0?void 0:Ze[Et][1]},bi.prototype.has=function(Be){return bl(this.__data__,Be)>-1},bi.prototype.set=function(Be,Ze){var Et=this.__data__,Kt=bl(Et,Be);return Kt<0?(++this.size,Et.push([Be,Ze])):Et[Kt][1]=Ze,this},Ci.prototype.clear=function(){this.size=0,this.__data__={hash:new yi,map:new(on||bi),string:new yi}},Ci.prototype.delete=function(Be){var Ze=Vo(this,Be).delete(Be);return this.size-=Ze?1:0,Ze},Ci.prototype.get=function(Be){return Vo(this,Be).get(Be)},Ci.prototype.has=function(Be){return Vo(this,Be).has(Be)},Ci.prototype.set=function(Be,Ze){var Et=Vo(this,Be),Kt=Et.size;return Et.set(Be,Ze),this.size+=Et.size==Kt?0:1,this},ti.prototype.add=ti.prototype.push=function(Be){return this.__data__.set(Be,r),this},ti.prototype.has=function(Be){return this.__data__.has(Be)},Co.prototype.clear=function(){this.__data__=new bi,this.size=0},Co.prototype.delete=function(Be){var Ze=this.__data__,Et=Ze.delete(Be);return this.size=Ze.size,Et},Co.prototype.get=function(Be){return this.__data__.get(Be)},Co.prototype.has=function(Be){return this.__data__.has(Be)},Co.prototype.set=function(Be,Ze){var Et=this.__data__;if(Et instanceof bi){var Kt=Et.__data__;if(!on||Kt.length<199)return Kt.push([Be,Ze]),this.size=++Et.size,this;Et=this.__data__=new Ci(Kt)}return Et.set(Be,Ze),this.size=Et.size,this};var Zb=ur?function(Be){return Be==null?[]:(Be=Object(Be),function(Ze,Et){for(var Kt=-1,zr=Ze==null?0:Ze.length,mr=0,Le=[];++Kt<zr;){var tt=Ze[Kt];Et(tt,Kt,Ze)&&(Le[mr++]=tt)}return Le}(ur(Be),function(Ze){return br.call(Be,Ze)}))}:function(){return[]},qi=$a;function Kg(Be,Ze){return!!(Ze=Ze==null?n:Ze)&&(typeof Be=="number"||Ee.test(Be))&&Be>-1&&Be%1==0&&Be<Ze}function Ya(Be){if(Be!=null){try{return rt.call(Be)}catch(Ze){}try{return Be+""}catch(Ze){}}return""}function rh(Be,Ze){return Be===Ze||Be!=Be&&Ze!=Ze}(Hr&&qi(new Hr(new ArrayBuffer(1)))!=te||on&&qi(new on)!=c||vi&&qi(vi.resolve())!=y||Sr&&qi(new Sr)!=B||Mi&&qi(new Mi)!=D)&&(qi=function(Be){var Ze=$a(Be),Et=Ze==S?Be.constructor:void 0,Kt=Et?Ya(Et):"";if(Kt)switch(Kt){case ma:return te;case qd:return c;case Yu:return y;case Wo:return B;case ya:return D}return Ze});var Jb=eh(function(){return arguments}())?eh:function(Be){return xl(Be)&&vt.call(Be,"callee")&&!br.call(Be,"callee")},Za=Array.isArray,ba=yn||function(){return!1};function $g(Be){if(!Qb(Be))return!1;var Ze=$a(Be);return Ze==u||Ze=="[object GeneratorFunction]"||Ze=="[object AsyncFunction]"||Ze=="[object Proxy]"}function Ea(Be){return typeof Be=="number"&&Be>-1&&Be%1==0&&Be<=n}function Qb(Be){var Ze=typeof Be;return Be!=null&&(Ze=="object"||Ze=="function")}function xl(Be){return Be!=null&&typeof Be=="object"}var xa=pt?function(Be){return function(Ze){return Be(Ze)}}(pt):function(Be){return xl(Be)&&Ea(Be.length)&&!!ve[$a(Be)]};function qb(Be){return(Ze=Be)!=null&&Ea(Ze.length)&&!$g(Ze)?Vg(Be):Go(Be);var Ze}e.exports=function(Be,Ze){return Zu(Be,Ze)}});Ri("en",{tableModule:{deleteCol:"Delete column",deleteRow:"Delete row",deleteTable:"Delete table",widthAuto:"Width auto",insertCol:"Insert column",insertRow:"Insert row",insertTable:"Insert table",header:"Header"}}),Ri("zh-CN",{tableModule:{deleteCol:"\u5220\u9664\u5217",deleteRow:"\u5220\u9664\u884C",deleteTable:"\u5220\u9664\u8868\u683C",widthAuto:"\u5BBD\u5EA6\u81EA\u9002\u5E94",insertCol:"\u63D2\u5165\u5217",insertRow:"\u63D2\u5165\u884C",insertTable:"\u63D2\u5165\u8868\u683C",header:"\u8868\u5934"}});var S6=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof ze!="undefined"?ze:typeof self!="undefined"?self:{};function w6(e){var t={exports:{}};return e(t,t.exports),t.exports}var $s,cy,dy=function(e){return e&&e.Math==Math&&e},fr=dy(typeof globalThis=="object"&&globalThis)||dy(typeof window=="object"&&window)||dy(typeof self=="object"&&self)||dy(typeof S6=="object"&&S6)||function(){return this}()||Function("return this")(),Mn=function(e){try{return!!e()}catch(t){return!0}},Xs=!Mn(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),wp=Function.prototype.call,Bn=wp.bind?wp.bind(wp):function(){return wp.apply(wp,arguments)},C6={}.propertyIsEnumerable,T6=Object.getOwnPropertyDescriptor,Sue={f:T6&&!C6.call({1:2},1)?function(e){var t=T6(this,e);return!!t&&t.enumerable}:C6},ZA=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},A6=Function.prototype,JA=A6.bind,QA=A6.call,wue=JA&&JA.bind(QA),yr=JA?function(e){return e&&wue(QA,e)}:function(e){return e&&function(){return QA.apply(e,arguments)}},Cue=yr({}.toString),Tue=yr("".slice),Ys=function(e){return Tue(Cue(e),8,-1)},qA=fr.Object,Aue=yr("".split),D6=Mn(function(){return!qA("z").propertyIsEnumerable(0)})?function(e){return Ys(e)=="String"?Aue(e,""):qA(e)}:qA,Due=fr.TypeError,Zs=function(e){if(e==null)throw Due("Can't call method on "+e);return e},Cp=function(e){return D6(Zs(e))},si=function(e){return typeof e=="function"},yo=function(e){return typeof e=="object"?e!==null:si(e)},Oue=function(e){return si(e)?e:void 0},Tp=function(e,t){return arguments.length<2?Oue(fr[e]):fr[e]&&fr[e][t]},O6=yr({}.isPrototypeOf),e2=Tp("navigator","userAgent")||"",_6=fr.process,R6=fr.Deno,k6=_6&&_6.versions||R6&&R6.version,L6=k6&&k6.v8;L6&&(cy=($s=L6.split("."))[0]>0&&$s[0]<4?1:+($s[0]+$s[1])),!cy&&e2&&(!($s=e2.match(/Edge\/(\d+)/))||$s[1]>=74)&&($s=e2.match(/Chrome\/(\d+)/))&&(cy=+$s[1]);var t2=cy,r2=!!Object.getOwnPropertySymbols&&!Mn(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&t2&&t2<41}),n2=r2&&!Symbol.sham&&typeof Symbol.iterator=="symbol",_ue=fr.Object,i2=n2?function(e){return typeof e=="symbol"}:function(e){var t=Tp("Symbol");return si(t)&&O6(t.prototype,_ue(e))},Rue=fr.String,P6=function(e){try{return Rue(e)}catch(t){return"Object"}},kue=fr.TypeError,I6=function(e){if(si(e))return e;throw kue(P6(e)+" is not a function")},o2=function(e,t){var r=e[t];return r==null?void 0:I6(r)},Lue=fr.TypeError,Pue=Object.defineProperty,a2=function(e,t){try{Pue(fr,e,{value:t,configurable:!0,writable:!0})}catch(r){fr[e]=t}return t},Js=fr["__core-js_shared__"]||a2("__core-js_shared__",{}),s2=w6(function(e){(e.exports=function(t,r){return Js[t]||(Js[t]=r!==void 0?r:{})})("versions",[]).push({version:"3.19.3",mode:"global",copyright:"\xA9 2021 Denis Pushkarev (zloirock.ru)"})}),Iue=fr.Object,l2=function(e){return Iue(Zs(e))},Mue=yr({}.hasOwnProperty),bo=Object.hasOwn||function(e,t){return Mue(l2(e),t)},Bue=0,Fue=Math.random(),Nue=yr(1 .toString),M6=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Nue(++Bue+Fue,36)},Ap=s2("wks"),_u=fr.Symbol,B6=_u&&_u.for,jue=n2?_u:_u&&_u.withoutSetter||M6,Eo=function(e){if(!bo(Ap,e)||!r2&&typeof Ap[e]!="string"){var t="Symbol."+e;r2&&bo(_u,e)?Ap[e]=_u[e]:Ap[e]=n2&&B6?B6(t):jue(t)}return Ap[e]},Uue=fr.TypeError,Hue=Eo("toPrimitive"),u2=function(e){var t=function(r,n){if(!yo(r)||i2(r))return r;var i,o=o2(r,Hue);if(o){if(n===void 0&&(n="default"),i=Bn(o,r,n),!yo(i)||i2(i))return i;throw Uue("Can't convert object to primitive value")}return n===void 0&&(n="number"),function(a,s){var l,u;if(s==="string"&&si(l=a.toString)&&!yo(u=Bn(l,a)))return u;if(si(l=a.valueOf)&&!yo(u=Bn(l,a)))return u;if(s!=="string"&&si(l=a.toString)&&!yo(u=Bn(l,a)))return u;throw Lue("Can't convert object to primitive value")}(r,n)}(e,"string");return i2(t)?t:t+""},c2=fr.document,zue=yo(c2)&&yo(c2.createElement),d2=function(e){return zue?c2.createElement(e):{}},F6=!Xs&&!Mn(function(){return Object.defineProperty(d2("div"),"a",{get:function(){return 7}}).a!=7}),N6=Object.getOwnPropertyDescriptor,j6={f:Xs?N6:function(e,t){if(e=Cp(e),t=u2(t),F6)try{return N6(e,t)}catch(r){}if(bo(e,t))return ZA(!Bn(Sue.f,e,t),e[t])}},Wue=fr.String,Gue=fr.TypeError,xo=function(e){if(yo(e))return e;throw Gue(Wue(e)+" is not an object")},Vue=fr.TypeError,U6=Object.defineProperty,Dp={f:Xs?U6:function(e,t,r){if(xo(e),t=u2(t),xo(r),F6)try{return U6(e,t,r)}catch(n){}if("get"in r||"set"in r)throw Vue("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},Sd=Xs?function(e,t,r){return Dp.f(e,t,ZA(1,r))}:function(e,t,r){return e[t]=r,e},Kue=yr(Function.toString);si(Js.inspectSource)||(Js.inspectSource=function(e){return Kue(e)});var hy,Op,fy,h2=Js.inspectSource,H6=fr.WeakMap,$ue=si(H6)&&/native code/.test(h2(H6)),z6=s2("keys"),W6=function(e){return z6[e]||(z6[e]=M6(e))},f2={},p2=fr.TypeError,Xue=fr.WeakMap;if($ue||Js.state){var Ru=Js.state||(Js.state=new Xue),Yue=yr(Ru.get),G6=yr(Ru.has),Zue=yr(Ru.set);hy=function(e,t){if(G6(Ru,e))throw new p2("Object already initialized");return t.facade=e,Zue(Ru,e,t),t},Op=function(e){return Yue(Ru,e)||{}},fy=function(e){return G6(Ru,e)}}else{var wd=W6("state");f2[wd]=!0,hy=function(e,t){if(bo(e,wd))throw new p2("Object already initialized");return t.facade=e,Sd(e,wd,t),t},Op=function(e){return bo(e,wd)?e[wd]:{}},fy=function(e){return bo(e,wd)}}var g2={set:hy,get:Op,has:fy,enforce:function(e){return fy(e)?Op(e):hy(e,{})},getterFor:function(e){return function(t){var r;if(!yo(t)||(r=Op(t)).type!==e)throw p2("Incompatible receiver, "+e+" required");return r}}},V6=Function.prototype,Jue=Xs&&Object.getOwnPropertyDescriptor,v2=bo(V6,"name"),m2={EXISTS:v2,PROPER:v2&&function(){}.name==="something",CONFIGURABLE:v2&&(!Xs||Xs&&Jue(V6,"name").configurable)},_p=w6(function(e){var t=m2.CONFIGURABLE,r=g2.get,n=g2.enforce,i=String(String).split("String");(e.exports=function(o,a,s,l){var u,c=!!l&&!!l.unsafe,h=!!l&&!!l.enumerable,S=!!l&&!!l.noTargetGet,y=l&&l.name!==void 0?l.name:a;si(s)&&(String(y).slice(0,7)==="Symbol("&&(y="["+String(y).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!bo(s,"name")||t&&s.name!==y)&&Sd(s,"name",y),(u=n(s)).source||(u.source=i.join(typeof y=="string"?y:""))),o!==fr?(c?!S&&o[a]&&(h=!0):delete o[a],h?o[a]=s:Sd(o,a,s)):h?o[a]=s:a2(a,s)})(Function.prototype,"toString",function(){return si(this)&&r(this).source||h2(this)})}),Que=Math.ceil,que=Math.floor,py=function(e){var t=+e;return t!=t||t===0?0:(t>0?que:Que)(t)},ece=Math.max,tce=Math.min,Rp=function(e,t){var r=py(e);return r<0?ece(r+t,0):tce(r,t)},rce=Math.min,y2=function(e){return e>0?rce(py(e),9007199254740991):0},gy=function(e){return y2(e.length)},K6=function(e){return function(t,r,n){var i,o=Cp(t),a=gy(o),s=Rp(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},nce=(K6(!0),K6(!1)),$6=yr([].push),X6=function(e,t){var r,n=Cp(e),i=0,o=[];for(r in n)!bo(f2,r)&&bo(n,r)&&$6(o,r);for(;t.length>i;)bo(n,r=t[i++])&&(~nce(o,r)||$6(o,r));return o},vy=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ice=vy.concat("length","prototype"),oce={f:Object.getOwnPropertyNames||function(e){return X6(e,ice)}},ace={f:Object.getOwnPropertySymbols},sce=yr([].concat),lce=Tp("Reflect","ownKeys")||function(e){var t=oce.f(xo(e)),r=ace.f;return r?sce(t,r(e)):t},uce=function(e,t){for(var r=lce(t),n=Dp.f,i=j6.f,o=0;o<r.length;o++){var a=r[o];bo(e,a)||n(e,a,i(t,a))}},cce=/#|\.prototype\./,kp=function(e,t){var r=hce[dce(e)];return r==pce||r!=fce&&(si(t)?Mn(t):!!t)},dce=kp.normalize=function(e){return String(e).replace(cce,".").toLowerCase()},hce=kp.data={},fce=kp.NATIVE="N",pce=kp.POLYFILL="P",gce=kp,vce=j6.f,Qs=function(e,t){var r,n,i,o,a,s=e.target,l=e.global,u=e.stat;if(r=l?fr:u?fr[s]||a2(s,{}):(fr[s]||{}).prototype)for(n in t){if(o=t[n],i=e.noTargetGet?(a=vce(r,n))&&a.value:r[n],!gce(l?n:s+(u?".":"#")+n,e.forced)&&i!==void 0){if(typeof o==typeof i)continue;uce(o,i)}(e.sham||i&&i.sham)&&Sd(o,"sham",!0),_p(r,n,o,e)}},Y6={};Y6[Eo("toStringTag")]="z";var b2=String(Y6)==="[object z]",mce=Eo("toStringTag"),yce=fr.Object,bce=Ys(function(){return arguments}())=="Arguments",E2=b2?Ys:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=function(i,o){try{return i[o]}catch(a){}}(t=yce(e),mce))=="string"?r:bce?Ys(t):(n=Ys(t))=="Object"&&si(t.callee)?"Arguments":n},Ece=fr.String,pi=function(e){if(E2(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return Ece(e)},xce=/"/g,Sce=yr("".replace);Qs({target:"String",proto:!0,forced:Mn(function(){var e="".anchor('"');return e!==e.toLowerCase()||e.split('"').length>3})},{anchor:function(e){return t=e,r=pi(Zs(this)),n="<a",(n+=' name="'+Sce(pi(t),xce,""")+'"')+">"+r+"</a>";var t,r,n}});var my,Z6=function(){var e=xo(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},x2=fr.RegExp,S2=Mn(function(){var e=x2("a","y");return e.lastIndex=2,e.exec("abcd")!=null}),wce=S2||Mn(function(){return!x2("a","y").sticky}),J6={BROKEN_CARET:S2||Mn(function(){var e=x2("^r","gy");return e.lastIndex=2,e.exec("str")!=null}),MISSED_STICKY:wce,UNSUPPORTED_Y:S2},Cce=Object.keys||function(e){return X6(e,vy)},Tce=Xs?Object.defineProperties:function(e,t){xo(e);for(var r,n=Cp(t),i=Cce(t),o=i.length,a=0;o>a;)Dp.f(e,r=i[a++],n[r]);return e},Ace=Tp("document","documentElement"),Q6=W6("IE_PROTO"),w2=function(){},q6=function(e){return"<script>"+e+"</script>"},eN=function(e){e.write(q6("")),e.close();var t=e.parentWindow.Object;return e=null,t},yy=function(){try{my=new ActiveXObject("htmlfile")}catch(n){}var e,t;yy=typeof document!="undefined"?document.domain&&my?eN(my):((t=d2("iframe")).style.display="none",Ace.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(q6("document.F=Object")),e.close(),e.F):eN(my);for(var r=vy.length;r--;)delete yy.prototype[vy[r]];return yy()};f2[Q6]=!0;var tN,C2,rN=Object.create||function(e,t){var r;return e!==null?(w2.prototype=xo(e),r=new w2,w2.prototype=null,r[Q6]=e):r=yy(),t===void 0?r:Tce(r,t)},Dce=fr.RegExp,Oce=Mn(function(){var e=Dce(".","s");return!(e.dotAll&&e.exec(`
|
|
|
`)&&e.flags==="s")}),_ce=fr.RegExp,Rce=Mn(function(){var e=_ce("(?<a>b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$<a>c")!=="bc"}),kce=g2.get,Lce=s2("native-string-replace",String.prototype.replace),by=RegExp.prototype.exec,T2=by,Pce=yr("".charAt),Ice=yr("".indexOf),Mce=yr("".replace),A2=yr("".slice),D2=(C2=/b*/g,Bn(by,tN=/a/,"a"),Bn(by,C2,"a"),tN.lastIndex!==0||C2.lastIndex!==0),nN=J6.BROKEN_CARET,O2=/()??/.exec("")[1]!==void 0;(D2||O2||nN||Oce||Rce)&&(T2=function(e){var t,r,n,i,o,a,s,l=this,u=kce(l),c=pi(e),h=u.raw;if(h)return h.lastIndex=l.lastIndex,t=Bn(T2,h,c),l.lastIndex=h.lastIndex,t;var S=u.groups,y=nN&&l.sticky,W=Bn(Z6,l),B=l.source,N=0,U=c;if(y&&(W=Mce(W,"y",""),Ice(W,"g")===-1&&(W+="g"),U=A2(c,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&Pce(c,l.lastIndex-1)!==`
|
|
|
`)&&(B="(?: "+B+")",U=" "+U,N++),r=new RegExp("^(?:"+B+")",W)),O2&&(r=new RegExp("^"+B+"$(?!\\s)",W)),D2&&(n=l.lastIndex),i=Bn(by,y?r:l,U),y?i?(i.input=A2(i.input,N),i[0]=A2(i[0],N),i.index=l.lastIndex,l.lastIndex+=i[0].length):l.lastIndex=0:D2&&i&&(l.lastIndex=l.global?i.index+i[0].length:n),O2&&i&&i.length>1&&Bn(Lce,i[0],r,function(){for(o=1;o<arguments.length-2;o++)arguments[o]===void 0&&(i[o]=void 0)}),i&&S)for(i.groups=a=rN(null),o=0;o<S.length;o++)a[(s=S[o])[0]]=i[s[1]];return i});var Lp=T2;Qs({target:"RegExp",proto:!0,forced:/./.exec!==Lp},{exec:Lp});var Ey=Array.isArray||function(e){return Ys(e)=="Array"},iN=function(){},Bce=[],oN=Tp("Reflect","construct"),_2=/^\s*(?:class|function)\b/,Fce=yr(_2.exec),Nce=!_2.exec(iN),Pp=function(e){if(!si(e))return!1;try{return oN(iN,Bce,e),!0}catch(t){return!1}},R2=!oN||Mn(function(){var e;return Pp(Pp.call)||!Pp(Object)||!Pp(function(){e=!0})||e})?function(e){if(!si(e))return!1;switch(E2(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return Nce||!!Fce(_2,h2(e))}:Pp,aN=function(e,t,r){var n=u2(t);n in e?Dp.f(e,n,ZA(0,r)):e[n]=r},jce=Eo("species"),k2=function(e){return t2>=51||!Mn(function(){var t=[];return(t.constructor={})[jce]=function(){return{foo:1}},t[e](Boolean).foo!==1})},Uce=yr([].slice),Hce=k2("slice"),zce=Eo("species"),L2=fr.Array,Wce=Math.max;function No(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function sN(e){var t=e.selection;if(t==null)return!1;var r=No(de.nodes(e,{match:function(o){return Ae.checkNodeType(o,"table-cell")}}),1)[0];if(r){var n=No(r,2)[1],i=de.start(e,n);if(cr.equals(t.anchor,i))return!0}return!1}function lN(e,t){var r,n,i=de.nodes(e,{at:t,match:function(l){return Ae.getNodeType(l)==="table"}}),o=!1;try{for(var a=function(l){var u=typeof Symbol=="function"&&Symbol.iterator,c=u&&l[u],h=0;if(c)return c.call(l);if(l&&typeof l.length=="number")return{next:function(){return l&&h>=l.length&&(l=void 0),{value:l&&l[h++],done:!l}}};throw new TypeError(u?"Object is not iterable.":"Symbol.iterator is not defined.")}(i),s=a.next();!s.done;s=a.next())s.value,o=!0}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o}Qs({target:"Array",proto:!0,forced:!Hce},{slice:function(e,t){var r,n,i,o=Cp(this),a=gy(o),s=Rp(e,a),l=Rp(t===void 0?a:t,a);if(Ey(o)&&(r=o.constructor,(R2(r)&&(r===L2||Ey(r.prototype))||yo(r)&&(r=r[zce])===null)&&(r=void 0),r===L2||r===void 0))return Uce(o,s,l);for(n=new(r===void 0?L2:r)(Wce(l-s,0)),i=0;s<l;s++,i++)s in o&&aN(n,i,o[s]);return n.length=i,n}});var uN=yr(yr.bind),Gce=Eo("species"),cN=fr.Array,Vce=function(e,t){return new(function(r){var n;return Ey(r)&&(n=r.constructor,(R2(n)&&(n===cN||Ey(n.prototype))||yo(n)&&(n=n[Gce])===null)&&(n=void 0)),n===void 0?cN:n}(e))(t===0?0:t)},dN=yr([].push),qs=function(e){var t=e==1,r=e==2,n=e==3,i=e==4,o=e==6,a=e==7,s=e==5||o;return function(l,u,c,h){for(var S,y,W=l2(l),B=D6(W),N=function(he,Ee){return I6(he),Ee===void 0?he:uN?uN(he,Ee):function(){return he.apply(Ee,arguments)}}(u,c),U=gy(B),D=0,Q=h||Vce,te=t?Q(l,U):r||a?Q(l,0):void 0;U>D;D++)if((s||D in B)&&(y=N(S=B[D],D,W),e))if(t)te[D]=y;else if(y)switch(e){case 3:return!0;case 5:return S;case 6:return D;case 2:dN(te,S)}else switch(e){case 4:return!1;case 7:dN(te,S)}return o?-1:n||i?i:te}},xy={forEach:qs(0),map:qs(1),filter:qs(2),some:qs(3),every:qs(4),find:qs(5),findIndex:qs(6),filterReject:qs(7)},Kce=xy.map;Qs({target:"Array",proto:!0,forced:!k2("map")},{map:function(e){return Kce(this,e,arguments.length>1?arguments[1]:void 0)}});var $ce=b2?{}.toString:function(){return"[object "+E2(this)+"]"};function Sy(e){var t=e.children||[];return t.length===0?[]:(t[0]||{}).children||[]}function hN(e){return Sy(e).every(function(t){return!!t.isHeader})}b2||_p(Object.prototype,"toString",$ce,{unsafe:!0});var Xce=m2.PROPER,P2=RegExp.prototype,fN=P2.toString,Yce=yr(Z6),Zce=Mn(function(){return fN.call({source:"a",flags:"b"})!="/a/b"}),Jce=Xce&&fN.name!="toString";(Zce||Jce)&&_p(RegExp.prototype,"toString",function(){var e=xo(this),t=pi(e.source),r=e.flags;return"/"+t+"/"+pi(r===void 0&&O6(P2,e)&&!("flags"in P2)?Yce(e):r)},{unsafe:!0});var I2=Eo("unscopables"),M2=Array.prototype;M2[I2]==null&&Dp.f(M2,I2,{configurable:!0,value:rN(null)});var Qce=xy.find,pN=!0;"find"in[]&&Array(1).find(function(){pN=!1}),Qs({target:"Array",proto:!0,forced:pN},{find:function(e){return Qce(this,e,arguments.length>1?arguments[1]:void 0)}}),M2[I2].find=!0;var B2=Function.prototype,gN=B2.apply,qce=B2.bind,vN=B2.call,mN=typeof Reflect=="object"&&Reflect.apply||(qce?vN.bind(gN):function(){return vN.apply(gN,arguments)}),ede=Eo("species"),F2=RegExp.prototype,yN=function(e,t,r,n){var i=Eo(e),o=!Mn(function(){var u={};return u[i]=function(){return 7},""[e](u)!=7}),a=o&&!Mn(function(){var u=!1,c=/a/;return e==="split"&&((c={}).constructor={},c.constructor[ede]=function(){return c},c.flags="",c[i]=/./[i]),c.exec=function(){return u=!0,null},c[i](""),!u});if(!o||!a||r){var s=yr(/./[i]),l=t(i,""[e],function(u,c,h,S,y){var W=yr(u),B=c.exec;return B===Lp||B===F2.exec?o&&!y?{done:!0,value:s(c,h,S)}:{done:!0,value:W(h,c,S)}:{done:!1}});_p(String.prototype,e,l[0]),_p(F2,i,l[1])}n&&Sd(F2[i],"sham",!0)},tde=Eo("match"),rde=fr.TypeError,nde=Eo("species"),ide=yr("".charAt),bN=yr("".charCodeAt),ode=yr("".slice),EN=function(e){return function(t,r){var n,i,o=pi(Zs(t)),a=py(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=bN(o,a))<55296||n>56319||a+1===s||(i=bN(o,a+1))<56320||i>57343?e?ide(o,a):n:e?ode(o,a,a+2):i-56320+(n-55296<<10)+65536}},ade=(EN(!1),EN(!0)),xN=function(e,t,r){return t+(r?ade(e,t).length:1)},sde=fr.Array,lde=Math.max,SN=function(e,t,r){for(var n=gy(e),i=Rp(t,n),o=Rp(r===void 0?n:r,n),a=sde(lde(o-i,0)),s=0;i<o;i++,s++)aN(a,s,e[i]);return a.length=s,a},ude=fr.TypeError,N2=function(e,t){var r=e.exec;if(si(r)){var n=Bn(r,e,t);return n!==null&&xo(n),n}if(Ys(e)==="RegExp")return Bn(Lp,e,t);throw ude("RegExp#exec called on incompatible receiver")},Cd=J6.UNSUPPORTED_Y,cde=Math.min,wN=[].push,dde=yr(/./.exec),Td=yr(wN),Ip=yr("".slice);yN("split",function(e,t,r){var n;return n="abbc".split(/(b)*/)[1]=="c"||"test".split(/(?:)/,-1).length!=4||"ab".split(/(?:ab)*/).length!=2||".".split(/(.?)(.?)/).length!=4||".".split(/()()/).length>1||"".split(/.?/).length?function(i,o){var a,s,l=pi(Zs(this)),u=o===void 0?4294967295:o>>>0;if(u===0)return[];if(i===void 0)return[l];if(!yo(a=i)||!((s=a[tde])!==void 0?s:Ys(a)=="RegExp"))return Bn(t,l,i,u);for(var c,h,S,y=[],W=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(i.sticky?"y":""),B=0,N=new RegExp(i.source,W+"g");(c=Bn(Lp,N,l))&&!((h=N.lastIndex)>B&&(Td(y,Ip(l,B,c.index)),c.length>1&&c.index<l.length&&mN(wN,y,SN(c,1)),S=c[0].length,B=h,y.length>=u));)N.lastIndex===c.index&&N.lastIndex++;return B===l.length?!S&&dde(N,"")||Td(y,""):Td(y,Ip(l,B)),y.length>u?SN(y,0,u):y}:"0".split(void 0,0).length?function(i,o){return i===void 0&&o===0?[]:Bn(t,this,i,o)}:t,[function(i,o){var a=Zs(this),s=i==null?void 0:o2(i,e);return s?Bn(s,i,a,o):Bn(n,pi(a),i,o)},function(i,o){var a=xo(this),s=pi(i),l=r(n,a,s,o,n!==t);if(l.done)return l.value;var u=function(te,he){var Ee,ve=xo(te).constructor;return ve===void 0||(Ee=xo(ve)[nde])==null?he:function(De){if(R2(De))return De;throw rde(P6(De)+" is not a constructor")}(Ee)}(a,RegExp),c=a.unicode,h=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(Cd?"g":"y"),S=new u(Cd?"^(?:"+a.source+")":a,h),y=o===void 0?4294967295:o>>>0;if(y===0)return[];if(s.length===0)return N2(S,s)===null?[s]:[];for(var W=0,B=0,N=[];B<s.length;){S.lastIndex=Cd?0:B;var U,D=N2(S,Cd?Ip(s,B):s);if(D===null||(U=cde(y2(S.lastIndex+(Cd?B:0)),s.length))===W)B=xN(s,B,c);else{if(Td(N,Ip(s,W,B)),N.length===y)return N;for(var Q=1;Q<=D.length-1;Q++)if(Td(N,D[Q]),N.length===y)return N;B=W=U}}return Td(N,Ip(s,W)),N}]},!!Mn(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return r.length!==2||r[0]!=="a"||r[1]!=="b"}),Cd);var j2=`
|
|
|
\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`,CN=yr("".replace),wy="["+j2+"]",hde=RegExp("^"+wy+wy+"*"),fde=RegExp(wy+wy+"*$"),U2=function(e){return function(t){var r=pi(Zs(t));return 1&e&&(r=CN(r,hde,"")),2&e&&(r=CN(r,fde,"")),r}},pde={start:U2(1),end:U2(2),trim:U2(3)},gde=m2.PROPER,vde=pde.trim;function TN(e){return e.length?e[0].tagName.toLowerCase():""}Qs({target:"String",proto:!0,forced:function(e){return Mn(function(){return!!j2[e]()||"\u200B\x85\u180E"[e]()!=="\u200B\x85\u180E"||gde&&j2[e].name!==e})}("trim")},{trim:function(){return vde(this)}}),Qs({global:!0},{globalThis:fr}),io&&(_e.fn.append=io),Zo&&(_e.fn.on=Zo),cs&&(_e.fn.focus=cs),no&&(_e.fn.attr=no),Yo&&(_e.fn.val=Yo),us&&(_e.fn.html=us),vc&&(_e.fn.dataset=vc),fc&&(_e.fn.addClass=fc),pc&&(_e.fn.removeClass=pc),Ec&&(_e.fn.children=Ec),Gv&&(_e.fn.each=Gv),bc&&(_e.fn.find=bc);var Mp=!1,AN=0,DN=0,Bp=null,Fp=null,Np=_e("body");function ON(e){Mp=!1,Fp=null,Bp=null,Np.off("mousemove",_N),Np.off("mouseup",ON)}Np.on("mousedown",function(e){var t=e.target;if((t.tagName==="TH"||t.tagName==="TD")&&t.style.cursor==="col-resize"){t.style.cursor="auto",e.preventDefault(),Mp=!0;var r=e.clientX;AN=r;var n=t.getBoundingClientRect().width;DN=n,Np.on("mousemove",_N),Np.on("mouseup",ON)}});var _N=Hl(function(e){if(Mp&&Fp!=null&&Bp!=null){e.preventDefault();var t=e.clientX,r=DN+(t-AN);(r=Math.floor(100*r)/100)<30&&(r=30),Ve.setNodes(Fp,{width:r.toString()},{at:Bp})}},100),mde={type:"table",renderElem:function(e,t,r){var n=function(s,l){if(s.isDisabled())return!1;var u=s.selection;if(u==null)return!0;if(Qe.isCollapsed(u))return!0;var c=u.anchor,h=u.focus,S=Ae.findPath(s,l),y=de.start(s,S),W=de.end(s,S),B=cr.compare(c,W)<=0&&cr.compare(c,y)>=0,N=cr.compare(h,W)<=0&&cr.compare(h,y)>=0;return!!(B&&N&&Ue.equals(c.path.slice(0,3),h.path.slice(0,3)))}(r,e),i=e.width,o=i===void 0?"auto":i,a=er("div",{className:"table-container","data-selected":Ae.isNodeSelected(r,e),on:{mousedown:function(s){if(s.target.tagName==="DIV"&&s.preventDefault(),!r.isDisabled()){var l=Ae.findPath(r,e),u=de.start(r,l),c=r.selection;c!=null?c.anchor.path[0]!==l[0]&&r.select(u):r.select(u)}}}},er("table",{width:o,contentEditable:n},er("colgroup",null,Sy(e).map(function(s){var l=s.width;return er("col",{width:l===void 0?"auto":l})})),er("tbody",null,t)));return a}},yde={type:"table-row",renderElem:function(e,t,r){return er("tr",null,t)}},bde={type:"table-cell",renderElem:function(e,t,r){var n=function(S,y){var W=Ae.getParentNode(S,y);if(W==null)return!1;var B=Ae.getParentNode(S,W);return B!=null&&Sy(B).some(function(N){return N===y})}(r,e),i=e,o=i.colSpan,a=o===void 0?1:o,s=i.rowSpan,l=s===void 0?1:s,u=i.isHeader,c=u!==void 0&&u;if(!n)return er("td",{colSpan:a,rowSpan:l},t);var h=er(c?"th":"td",{colSpan:a,rowSpan:l,style:{borderRightWidth:"3px"},on:{mousemove:Hl(function(S){var y=this.elm;if(y!=null){var W=y.getBoundingClientRect(),B=W.left,N=W.width,U=W.top,D=W.height,Q=S.clientX,te=S.clientY;Mp||(Q>B+N-5&&Q<B+N&&te>U&&te<U+D?(y.style.cursor="col-resize",Fp=r,Bp=Ae.findPath(r,e)):Mp||(y.style.cursor="auto",Fp=null,Bp=null))}},100)}},t);return h}},Ede={selector:"table",preParseHtml:function(e){var t=_e(e);if(TN(t)!=="table")return e;var r=t.find("tbody");if(r.length===0)return e;var n=t.find("tr");return t.append(n),r.remove(),t[0]}},xde=xy.filter;Qs({target:"Array",proto:!0,forced:!k2("filter")},{filter:function(e){return xde(this,e,arguments.length>1?arguments[1]:void 0)}});var Sde=Math.floor,H2=yr("".charAt),wde=yr("".replace),z2=yr("".slice),Cde=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Tde=/\$([$&'`]|\d{1,2})/g,Ade=function(e,t,r,n,i,o){var a=r+e.length,s=n.length,l=Tde;return i!==void 0&&(i=l2(i),l=Cde),wde(o,l,function(u,c){var h;switch(H2(c,0)){case"$":return"$";case"&":return e;case"`":return z2(t,0,r);case"'":return z2(t,a);case"<":h=i[z2(c,1,-1)];break;default:var S=+c;if(S===0)return u;if(S>s){var y=Sde(S/10);return y===0?u:y<=s?n[y-1]===void 0?H2(c,1):n[y-1]+H2(c,1):u}h=n[S-1]}return h===void 0?"":h})},W2=Eo("replace"),Dde=Math.max,Ode=Math.min,_de=yr([].concat),G2=yr([].push),RN=yr("".indexOf),kN=yr("".slice),Rde="a".replace(/./,"$0")==="$0",LN=!!/./[W2]&&/./[W2]("a","$0")==="";yN("replace",function(e,t,r){var n=LN?"$":"$0";return[function(i,o){var a=Zs(this),s=i==null?void 0:o2(i,W2);return s?Bn(s,i,a,o):Bn(t,pi(a),i,o)},function(i,o){var a=xo(this),s=pi(i);if(typeof o=="string"&&RN(o,n)===-1&&RN(o,"$<")===-1){var l=r(t,a,s,o);if(l.done)return l.value}var u=si(o);u||(o=pi(o));var c=a.global;if(c){var h=a.unicode;a.lastIndex=0}for(var S=[];;){var y=N2(a,s);if(y===null)break;if(G2(S,y),!c)break;pi(y[0])===""&&(a.lastIndex=xN(s,y2(a.lastIndex),h))}for(var W,B="",N=0,U=0;U<S.length;U++){for(var D=pi((y=S[U])[0]),Q=Dde(Ode(py(y.index),s.length),0),te=[],he=1;he<y.length;he++)G2(te,(W=y[he])===void 0?W:String(W));var Ee=y.groups;if(u){var ve=_de([D],te,Q,s);Ee!==void 0&&G2(ve,Ee);var De=pi(mN(o,void 0,ve))}else De=Ade(D,s,Q,te,Ee,o);Q>=N&&(B+=kN(s,N,Q)+De,N=Q+D.length)}return B+kN(s,N)}]},!!Mn(function(){var e=/./;return e.exec=function(){var t=[];return t.groups={a:"7"},t},"".replace(e,"$<a>")!=="7"})||!Rde||LN);var kde={selector:"td:not([data-w-e-type]),th:not([data-w-e-type])",parseElemHtml:function(e,t,r){var n=_e(e);(t=t.filter(function(s){return!!Rt.isText(s)||!!r.isInline(s)})).length===0&&(t=[{text:n.text().replace(/\s+/gm," ")}]);var i=parseInt(n.attr("colSpan")||"1"),o=parseInt(n.attr("rowSpan")||"1"),a=n.attr("width")||"auto";return{type:"table-cell",isHeader:TN(n)==="th",colSpan:i,rowSpan:o,width:a,children:t}}},Lde={selector:"tr:not([data-w-e-type])",parseElemHtml:function(e,t,r){return{type:"table-row",children:t.filter(function(n){return Ae.getNodeType(n)==="table-cell"})}}},Pde={selector:"table:not([data-w-e-type])",parseElemHtml:function(e,t,r){var n=_e(e),i="auto";return function(o,a){for(var s="",l=(o.attr("style")||"").split(";"),u=l.length,c=0;c<u;c++){var h=l[c];if(h){var S=h.split(":");S[0].trim()==="width"&&(s=S[1].trim())}}return s}(n)==="100%"&&(i="100%"),n.attr("width")==="100%"&&(i="100%"),{type:"table",width:i,children:t.filter(function(o){return Ae.getNodeType(o)==="table-row"})}}},Ide=function(){function e(){this.title=wt("tableModule.insertTable"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0 64v896h1024V64H0z m384 576v-192h256v192h-256z m256 64v192h-256v-192h256z m0-512v192h-256V192h256zM320 192v192H64V192h256z m-256 256h256v192H64v-192z m640 0h256v192h-256v-192z m0-64V192h256v192h-256zM64 704h256v192H64v-192z m640 192v-192h256v192h-256z"></path></svg>',this.tag="button",this.showDropPanel=!0,this.$content=null}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.exec=function(t,r){},e.prototype.isDisabled=function(t){var r=t.selection;return r==null||!Qe.isCollapsed(r)||!!Ae.getSelectedElems(t).some(function(n){var i=Ae.getNodeType(n);return i==="pre"||i==="table"||i==="list-item"||!!t.isVoid(n)})},e.prototype.getPanelContentElem=function(t){var r=this;if(this.$content)return this.$content[0];for(var n=_e('<div class="w-e-panel-content-table"></div>'),i=_e("<span>0 × 0</span>"),o=_e("<table></table>"),a=0;a<10;a++){for(var s=_e("<tr></tr>"),l=0;l<10;l++){var u=_e("<td></td>");u.attr("data-x",l.toString()),u.attr("data-y",a.toString()),s.append(u),u.on("mouseenter",function(c){var h=c.target;if(h!=null){var S=_e(h).dataset(),y=S.x,W=S.y;i[0].innerHTML=y+1+" × "+(W+1),o.children().each(function(B){_e(B).children().each(function(N){var U=_e(N),D=U.dataset(),Q=D.x,te=D.y;Q<=y&&te<=W?U.addClass("active"):U.removeClass("active")})})}}),u.on("click",function(c){c.preventDefault();var h=c.target;if(h!=null){var S=_e(h).dataset(),y=S.x,W=S.y;r.insertTable(t,W+1,y+1)}})}o.append(s)}return n.append(o),n.append(i),this.$content=n,n[0]},e.prototype.insertTable=function(t,r,n){var i=parseInt(r,10),o=parseInt(n,10);if(i&&o&&!(i<=0||o<=0)){Ae.isSelectedEmptyParagraph(t)&&Ve.removeNodes(t,{mode:"highest"});var a=function(s,l){for(var u=[],c=0;c<s;c++){for(var h=[],S=0;S<l;S++){var y={type:"table-cell",children:[{text:""}]};c===0&&(y.isHeader=!0),h.push(y)}u.push({type:"table-row",children:h})}return{type:"table",width:"auto",children:u}}(i,o);Ve.insertNodes(t,a,{mode:"highest"})}},e}(),Mde=function(){function e(){this.title=wt("tableModule.deleteTable"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M826.8032 356.5312c-19.328 0-36.3776 15.6928-36.3776 35.0464v524.2624c0 19.328-16 34.56-35.328 34.56H264.9344c-19.328 0-35.5072-15.3088-35.5072-34.56V390.0416c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.6928-33.5104 35.0464V915.712c0 57.9328 44.6208 108.288 102.528 108.288H755.2c57.9328 0 108.0832-50.4576 108.0832-108.288V391.4752c-0.1024-19.2512-17.1264-34.944-36.48-34.944z" p-id="9577"></path><path d="M437.1712 775.7568V390.6048c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.616-33.5104 35.0464v385.152c0 19.328 14.1568 35.0464 33.5104 35.0464s33.5104-15.7184 33.5104-35.0464zM649.7024 775.7568V390.6048c0-19.328-17.0496-35.0464-36.3776-35.0464s-36.3776 15.616-36.3776 35.0464v385.152c0 19.328 17.0496 35.0464 36.3776 35.0464s36.3776-15.7184 36.3776-35.0464zM965.0432 217.0368h-174.6176V145.5104c0-57.9328-47.2064-101.76-104.6528-101.76h-350.976c-57.8304 0-105.3952 43.8528-105.3952 101.76v71.5264H54.784c-19.4304 0-35.0464 14.1568-35.0464 33.5104 0 19.328 15.616 33.5104 35.0464 33.5104h910.3616c19.328 0 35.0464-14.1568 35.0464-33.5104 0-19.3536-15.6928-33.5104-35.1488-33.5104z m-247.3728 0H297.3952V145.5104c0-19.328 18.2016-34.7648 37.4272-34.7648h350.976c19.1488 0 31.872 15.1296 31.872 34.7648v71.5264z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null||Ae.getSelectedNodeByType(t,"table")==null},e.prototype.exec=function(t,r){this.isDisabled(t)||Ve.removeNodes(t,{mode:"highest"})},e}(),Bde=function(){function e(){this.title=wt("tableModule.insertRow"),this.iconSvg='<svg viewBox="0 0 1048 1024"><path d="M707.7888 521.0112h-147.456v-147.456H488.2432v147.456h-147.456v68.8128h147.456v147.456h72.0896v-147.456h147.456zM0 917.504V0h1048.576v917.504H0zM327.68 65.536H65.536v196.608H327.68V65.536z m327.68 0H393.216v196.608h262.144V65.536z m327.68 0h-262.144v196.608h262.144V65.536z m0 258.8672H65.536v462.0288H983.04V324.4032z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){var r=t.selection;return r==null||!Qe.isCollapsed(r)||Ae.getSelectedNodeByType(t,"table")==null},e.prototype.exec=function(t,r){if(!this.isDisabled(t)){var n=No(de.nodes(t,{match:function(y){return Ae.checkNodeType(y,"table-cell")},universal:!0}),1),i=No(n[0],2),o=i[0],a=i[1],s=Ae.getParentNode(t,o),l=(s==null?void 0:s.children.length)||0;if(l!==0){for(var u={type:"table-row",children:[]},c=0;c<l;c++)u.children.push({type:"table-cell",children:[{text:""}]});var h=Ue.parent(a),S=Ue.next(h);Ve.insertNodes(t,u,{at:S})}}},e}(),Fde=function(){function e(){this.title=wt("tableModule.deleteRow"),this.iconSvg='<svg viewBox="0 0 1048 1024"><path d="M907.6736 586.5472L747.1104 425.984l163.84-163.84-78.6432-78.6432-163.84 163.84L507.904 186.7776 429.2608 262.144l163.84 163.84-167.1168 167.1168 78.6432 78.6432 167.1168-167.1168 160.5632 160.5632 75.3664-78.6432zM0 917.504V0h1048.576v917.504H0z m983.04-327.68h-22.9376l-65.536-65.536H983.04V327.68h-91.7504l65.536-65.536h26.2144V65.536H65.536v196.608h317.8496l65.536 65.536H65.536v196.608h380.1088l-65.536 65.536H65.536v196.608H983.04v-196.608z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){var r=t.selection;return r==null||!Qe.isCollapsed(r)||Ae.getSelectedNodeByType(t,"table-row")==null},e.prototype.exec=function(t,r){if(!this.isDisabled(t)){var n=No(de.nodes(t,{match:function(l){return Ae.checkNodeType(l,"table-row")},universal:!0}),1),i=No(n[0],2),o=i[0],a=i[1],s=Ae.getParentNode(t,o);((s==null?void 0:s.children.length)||0)<=1?Ve.removeNodes(t,{mode:"highest"}):Ve.removeNodes(t,{at:a})}},e}(),PN={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},V2=d2("span").classList,IN=V2&&V2.constructor&&V2.constructor.prototype,Nde=IN===Object.prototype?void 0:IN,jde=xy.forEach,Ude=function(e,t){var r=[].forEach;return!!r&&Mn(function(){r.call(null,function(){throw 1},1)})}(),K2=Ude?[].forEach:function(e){return jde(this,e,arguments.length>1?arguments[1]:void 0)},MN=function(e){if(e&&e.forEach!==K2)try{Sd(e,"forEach",K2)}catch(t){e.forEach=K2}};for(var $2 in PN)PN[$2]&&MN(fr[$2]&&fr[$2].prototype);MN(Nde);var Hde=function(){function e(){this.title=wt("tableModule.insertCol"),this.iconSvg='<svg viewBox="0 0 1048 1024"><path d="M327.68 193.3312v186.7776H140.9024v91.7504H327.68v186.7776h88.4736V471.8592h190.0544V380.1088H416.1536V193.3312zM0 917.504V0h1048.576v917.504H0zM655.36 65.536H65.536v720.896H655.36V65.536z m327.68 0h-262.144v196.608h262.144V65.536z m0 262.144h-262.144v196.608h262.144V327.68z m0 262.144h-262.144v196.608h262.144v-196.608z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){var r=t.selection;return r==null||!Qe.isCollapsed(r)||Ae.getSelectedNodeByType(t,"table")==null},e.prototype.exec=function(t,r){if(!this.isDisabled(t)){var n=No(de.nodes(t,{match:function(u){return Ae.checkNodeType(u,"table-cell")},universal:!0}),1),i=No(n[0],2),o=i[0],a=i[1],s=Ae.getParentNode(t,o);if(s!=null){var l=Ae.getParentNode(t,s);l!=null&&(l.children||[]).forEach(function(u,c){Ut.isElement(u)&&(u.children||[]).forEach(function(h){var S=Ae.findPath(t,h);if(S.length===a.length&&x6(S.slice(-1),a.slice(-1))){var y={type:"table-cell",children:[{text:""}]};c===0&&hN(l)&&(y.isHeader=!0),Ve.insertNodes(t,y,{at:S})}})})}}},e}(),zde=function(){function e(){this.title=wt("tableModule.deleteCol"),this.iconSvg='<svg viewBox="0 0 1048 1024"><path d="M327.68 510.976L393.216 445.44v-13.1072L327.68 366.7968V510.976z m327.68-78.4384l65.536-65.536V507.904L655.36 442.368v-9.8304z m393.216 484.9664V0H0v917.504h1048.576z m-65.536-131.072h-262.144v-52.4288l-13.1072 13.1072-52.4288-52.4288v91.7504H393.216v-91.7504l-52.4288 52.4288-13.1072-13.1072v52.4288H65.536V65.536H327.68v121.2416l36.0448-36.0448 29.4912 29.4912V62.2592h262.144V180.224l49.152-49.152 16.384 16.384V62.2592h262.144V786.432z m-294.912-108.1344l-160.5632-160.5632-167.1168 167.1168-78.6432-78.6432 167.1168-167.1168L288.3584 278.528l78.6432-78.6432 160.5632 160.5632 163.84-163.84 78.6432 78.6432-163.84 163.84 160.5632 160.5632-78.6432 78.6432z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){var r=t.selection;return r==null||!Qe.isCollapsed(r)||Ae.getSelectedNodeByType(t,"table-cell")==null},e.prototype.exec=function(t,r){if(!this.isDisabled(t)){var n=No(de.nodes(t,{match:function(c){return Ae.checkNodeType(c,"table-cell")},universal:!0}),1),i=No(n[0],2),o=i[0],a=i[1],s=Ae.getParentNode(t,o),l=(s==null?void 0:s.children.length)||0;if(!s||l<=1)Ve.removeNodes(t,{mode:"highest"});else{var u=Ae.getParentNode(t,s);u!=null&&(u.children||[]).forEach(function(c){Ut.isElement(c)&&(c.children||[]).forEach(function(h){var S=Ae.findPath(t,h);S.length===a.length&&x6(S.slice(-1),a.slice(-1))&&Ve.removeNodes(t,{at:S})})})}}},e}(),Wde=function(){function e(){this.title=wt("tableModule.header"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M704 128l-64 0L384 128 320 128 0 128l0 256 0 64 0 192 0 64 0 256 320 0 64 0 256 0 64 0 320 0 0-256 0-64L1024 448 1024 384 1024 128 704 128zM640 640 384 640 384 448l256 0L640 640zM64 448l256 0 0 192L64 640 64 448zM320 896 64 896l0-192 256 0L320 896zM640 896 384 896l0-192 256 0L640 896zM960 896l-256 0 0-192 256 0L960 896zM960 640l-256 0L704 448l256 0L960 640z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(t){var r=Ae.getSelectedNodeByType(t,"table");return r!=null&&hN(r)},e.prototype.isActive=function(t){return!!this.getValue(t)},e.prototype.isDisabled=function(t){var r=t.selection;return r==null||!Qe.isCollapsed(r)||Ae.getSelectedNodeByType(t,"table")==null},e.prototype.exec=function(t,r){if(!this.isDisabled(t)){var n=!r,i=Ae.getSelectedNodeByType(t,"table");i!=null&&Sy(i).forEach(function(o){return Ve.setNodes(t,{isHeader:n},{at:Ae.findPath(t,o)})})}},e}(),Gde=function(){function e(){this.title=wt("tableModule.widthAuto"),this.iconSvg='<svg viewBox="0 0 1228 1024"><path d="M862.514337 563.200461H404.581995v121.753478a13.311987 13.311987 0 0 1-6.655993 11.468789 10.23999 10.23999 0 0 1-12.083188-1.433599l-204.799795-179.199821a13.721586 13.721586 0 0 1 0-20.479979l204.799795-179.302221a10.23999 10.23999 0 0 1 12.185588-1.535998 13.209587 13.209587 0 0 1 6.553593 11.673588v115.097485h457.932342V319.693504a11.571188 11.571188 0 0 1 18.841582-10.239989l204.799795 179.19982a13.721586 13.721586 0 0 1 0 20.47998l-204.799795 179.199821a10.23999 10.23999 0 0 1-12.185588 1.535998 13.311987 13.311987 0 0 1-6.655994-11.571188V563.200461zM136.499064 14.951409v993.893406a15.257585 15.257585 0 0 1-15.155185 15.052785H15.155185A15.155185 15.155185 0 0 1 0 1008.844815V14.951409a15.257585 15.257585 0 0 1 15.155185-15.052785h106.086294a15.155185 15.155185 0 0 1 15.257585 15.155185zM1228.798771 14.951409v993.893406a15.257585 15.257585 0 0 1-15.155185 15.052785h-106.188693a15.155185 15.155185 0 0 1-15.155185-15.052785V14.951409a15.257585 15.257585 0 0 1 15.155185-15.052785h106.086293A15.155185 15.155185 0 0 1 1228.798771 15.053809z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(t){var r=Ae.getSelectedNodeByType(t,"table");return r!=null&&r.width==="100%"},e.prototype.isActive=function(t){return!!this.getValue(t)},e.prototype.isDisabled=function(t){var r=t.selection;return r==null||!Qe.isCollapsed(r)||Ae.getSelectedNodeByType(t,"table")==null},e.prototype.exec=function(t,r){if(!this.isDisabled(t)){var n={width:r?"auto":"100%"};Ve.setNodes(t,n,{mode:"highest"})}},e}(),Vde={renderElems:[mde,yde,bde],elemsToHtml:[{type:"table",elemToHtml:function(e,t){var r=e.width;return'<table style="width: '+(r===void 0?"auto":r)+';"><tbody>'+t+"</tbody></table>"}},{type:"table-row",elemToHtml:function(e,t){return"<tr>"+t+"</tr>"}},{type:"table-cell",elemToHtml:function(e,t){var r=e,n=r.colSpan,i=n===void 0?1:n,o=r.rowSpan,a=o===void 0?1:o,s=r.isHeader,l=s!==void 0&&s,u=r.width,c=l?"th":"td";return"<"+c+' colSpan="'+i+'" rowSpan="'+a+'" width="'+(u===void 0?"auto":u)+'">'+t+"</"+c+">"}}],preParseHtml:[Ede],parseElemsHtml:[kde,Lde,Pde],menus:[{key:"insertTable",factory:function(){return new Ide}},{key:"deleteTable",factory:function(){return new Mde}},{key:"insertTableRow",factory:function(){return new Bde}},{key:"deleteTableRow",factory:function(){return new Fde}},{key:"insertTableCol",factory:function(){return new Hde}},{key:"deleteTableCol",factory:function(){return new zde}},{key:"tableHeader",factory:function(){return new Wde}},{key:"tableFullWidth",factory:function(){return new Gde}}],editorPlugin:function(e){var t=e.insertBreak,r=e.deleteBackward,n=e.deleteForward,i=e.normalizeNode,o=e.insertData,a=e.handleTab,s=e.selectAll,l=e;return l.insertBreak=function(){Ae.getSelectedNodeByType(l,"table")==null?t():l.insertText(`
|
|
|
`)},l.deleteBackward=function(u){if(!sN(l)){var c=l.selection;if(c){var h=de.before(l,c);if(h){var S=lN(l,h),y=lN(l,c);if(S&&!y)return}}r(u)}},l.handleTab=function(){var u;if(Ae.getSelectedNodeByType(l,"table")){var c=de.above(e);Ae.checkNodeType(c[0],"table-cell")&&Ve.select(e,c[1]);var h=de.next(e);if(h)h[0]&&h[0].text&&(h=(u=de.above(e,{at:h[1]}))!==null&&u!==void 0?u:h),Ve.select(e,h[1]);else{var S=l.children||[],y=S.length;if(Ae.checkNodeType(S[y-1],"table")){var W=Ae.genEmptyParagraph();Ve.insertNodes(l,W,{at:[y]}),l.handleTab()}}}else a()},l.deleteForward=function(u){sN(l)||n(u)},l.normalizeNode=function(u){var c=No(u,2),h=c[0],S=c[1];if(Ae.getNodeType(h)!=="table")return i([h,S]);if(Ae.isLastNode(l,h)){var y=Ae.genEmptyParagraph();Ve.insertNodes(l,y,{at:[S[0]+1]})}},l.insertData=function(u){if(Ae.getSelectedNodeByType(l,"table")!=null){var c=u.getData("text/plain");c===`
|
|
|
`||/<img[^>]+>/.test(u.getData("text/html"))?o(u):de.insertText(l,c)}else o(u)},l.selectAll=function(){var u=l.selection;if(u!=null){var c=Ae.getSelectedNodeByType(l,"table-cell");if(c!=null){var h=u.anchor,S=u.focus;if(Ue.equals(h.path.slice(0,3),S.path.slice(0,3)))if(St.string(c).length!==0){var y=Ae.findPath(l,c),W={anchor:de.start(l,y),focus:de.end(l,y)};l.select(W)}else s();else s()}else s()}else s()},l}};Ri("en",{videoModule:{delete:"Delete",uploadVideo:"Upload video",insertVideo:"Insert video",videoSrc:"Video source",videoSrcPlaceHolder:"Video file url, or third-party <iframe>",videoPoster:"Video poster",videoPosterPlaceHolder:"Poster image url",ok:"Ok",editSize:"Edit size",width:"Width",height:"Height"}}),Ri("zh-CN",{videoModule:{delete:"\u5220\u9664\u89C6\u9891",uploadVideo:"\u4E0A\u4F20\u89C6\u9891",insertVideo:"\u63D2\u5165\u89C6\u9891",videoSrc:"\u89C6\u9891\u5730\u5740",videoSrcPlaceHolder:"\u89C6\u9891\u6587\u4EF6 url \u6216\u7B2C\u4E09\u65B9 <iframe>",videoPoster:"\u89C6\u9891\u5C01\u9762",videoPosterPlaceHolder:"\u5C01\u9762\u56FE\u7247 url",ok:"\u786E\u5B9A",editSize:"\u4FEE\u6539\u5C3A\u5BF8",width:"\u5BBD\u5EA6",height:"\u9AD8\u5EA6"}});/*! *****************************************************************************
|
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
purpose with or without fee is hereby granted.
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
|
***************************************************************************** */var Cy=function(){return Cy=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Cy.apply(this,arguments)};function Ty(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(u){try{l(n.next(u))}catch(c){o(c)}}function s(u){try{l(n.throw(u))}catch(c){o(c)}}function l(u){var c;u.done?i(u.value):(c=u.value,c instanceof r?c:new r(function(h){h(c)})).then(a,s)}l((n=n.apply(e,t||[])).next())})}function Ay(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(u){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||c[0]!==6&&c[0]!==2)){a=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){a.label=c[1];break}if(c[0]===6&&a.label<i[1]){a.label=i[1],i=c;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(c);break}i[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(h){c=[6,h],n=0}finally{r=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([l,u])}}}function ku(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function Kde(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=function(i){var o=typeof Symbol=="function"&&Symbol.iterator,a=o&&i[o],s=0;if(a)return a.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&s>=i.length&&(i=void 0),{value:i&&i[s++],done:!i}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=e[i]&&function(o){return new Promise(function(a,s){!function(l,u,c,h){Promise.resolve(h).then(function(S){l({value:S,done:c})},u)}(a,s,(o=e[i](o)).done,o.value)})}}}var BN=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof ze!="undefined"?ze:typeof self!="undefined"?self:{};function X2(e){var t={exports:{}};return e(t,t.exports),t.exports}var el,Dy,Oy=function(e){return e&&e.Math==Math&&e},At=Oy(typeof globalThis=="object"&&globalThis)||Oy(typeof window=="object"&&window)||Oy(typeof self=="object"&&self)||Oy(typeof BN=="object"&&BN)||function(){return this}()||Function("return this")(),Zr=function(e){try{return!!e()}catch(t){return!0}},ua=!Zr(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),jp=Function.prototype.call,Xr=jp.bind?jp.bind(jp):function(){return jp.apply(jp,arguments)},FN={}.propertyIsEnumerable,NN=Object.getOwnPropertyDescriptor,$de={f:NN&&!FN.call({1:2},1)?function(e){var t=NN(this,e);return!!t&&t.enumerable}:FN},_y=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},jN=Function.prototype,Y2=jN.bind,Z2=jN.call,Xde=Y2&&Y2.bind(Z2),ir=Y2?function(e){return e&&Xde(Z2,e)}:function(e){return e&&function(){return Z2.apply(e,arguments)}},Yde=ir({}.toString),Zde=ir("".slice),ca=function(e){return Zde(Yde(e),8,-1)},J2=At.Object,Jde=ir("".split),Q2=Zr(function(){return!J2("z").propertyIsEnumerable(0)})?function(e){return ca(e)=="String"?Jde(e,""):J2(e)}:J2,Qde=At.TypeError,Up=function(e){if(e==null)throw Qde("Can't call method on "+e);return e},tl=function(e){return Q2(Up(e))},Ur=function(e){return typeof e=="function"},qr=function(e){return typeof e=="object"?e!==null:Ur(e)},qde=function(e){return Ur(e)?e:void 0},Lu=function(e,t){return arguments.length<2?qde(At[e]):At[e]&&At[e][t]},Hp=ir({}.isPrototypeOf),Ad=Lu("navigator","userAgent")||"",UN=At.process,HN=At.Deno,zN=UN&&UN.versions||HN&&HN.version,WN=zN&&zN.v8;WN&&(Dy=(el=WN.split("."))[0]>0&&el[0]<4?1:+(el[0]+el[1])),!Dy&&Ad&&(!(el=Ad.match(/Edge\/(\d+)/))||el[1]>=74)&&(el=Ad.match(/Chrome\/(\d+)/))&&(Dy=+el[1]);var zp=Dy,q2=!!Object.getOwnPropertySymbols&&!Zr(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&zp&&zp<41}),eD=q2&&!Symbol.sham&&typeof Symbol.iterator=="symbol",ehe=At.Object,tD=eD?function(e){return typeof e=="symbol"}:function(e){var t=Lu("Symbol");return Ur(t)&&Hp(t.prototype,ehe(e))},the=At.String,Ry=function(e){try{return the(e)}catch(t){return"Object"}},rhe=At.TypeError,rl=function(e){if(Ur(e))return e;throw rhe(Ry(e)+" is not a function")},Wp=function(e,t){var r=e[t];return r==null?void 0:rl(r)},nhe=At.TypeError,ihe=Object.defineProperty,rD=function(e,t){try{ihe(At,e,{value:t,configurable:!0,writable:!0})}catch(r){At[e]=t}return t},nl=At["__core-js_shared__"]||rD("__core-js_shared__",{}),nD=X2(function(e){(e.exports=function(t,r){return nl[t]||(nl[t]=r!==void 0?r:{})})("versions",[]).push({version:"3.19.3",mode:"global",copyright:"\xA9 2021 Denis Pushkarev (zloirock.ru)"})}),ohe=At.Object,ky=function(e){return ohe(Up(e))},ahe=ir({}.hasOwnProperty),Fn=Object.hasOwn||function(e,t){return ahe(ky(e),t)},she=0,lhe=Math.random(),uhe=ir(1 .toString),iD=function(e){return"Symbol("+(e===void 0?"":e)+")_"+uhe(++she+lhe,36)},Gp=nD("wks"),Pu=At.Symbol,GN=Pu&&Pu.for,che=eD?Pu:Pu&&Pu.withoutSetter||iD,Cn=function(e){if(!Fn(Gp,e)||!q2&&typeof Gp[e]!="string"){var t="Symbol."+e;q2&&Fn(Pu,e)?Gp[e]=Pu[e]:Gp[e]=eD&&GN?GN(t):che(t)}return Gp[e]},dhe=At.TypeError,hhe=Cn("toPrimitive"),oD=function(e){var t=function(r,n){if(!qr(r)||tD(r))return r;var i,o=Wp(r,hhe);if(o){if(n===void 0&&(n="default"),i=Xr(o,r,n),!qr(i)||tD(i))return i;throw dhe("Can't convert object to primitive value")}return n===void 0&&(n="number"),function(a,s){var l,u;if(s==="string"&&Ur(l=a.toString)&&!qr(u=Xr(l,a)))return u;if(Ur(l=a.valueOf)&&!qr(u=Xr(l,a)))return u;if(s!=="string"&&Ur(l=a.toString)&&!qr(u=Xr(l,a)))return u;throw nhe("Can't convert object to primitive value")}(r,n)}(e,"string");return tD(t)?t:t+""},aD=At.document,fhe=qr(aD)&&qr(aD.createElement),Vp=function(e){return fhe?aD.createElement(e):{}},VN=!ua&&!Zr(function(){return Object.defineProperty(Vp("div"),"a",{get:function(){return 7}}).a!=7}),KN=Object.getOwnPropertyDescriptor,sD={f:ua?KN:function(e,t){if(e=tl(e),t=oD(t),VN)try{return KN(e,t)}catch(r){}if(Fn(e,t))return _y(!Xr($de.f,e,t),e[t])}},phe=At.String,ghe=At.TypeError,Jn=function(e){if(qr(e))return e;throw ghe(phe(e)+" is not an object")},vhe=At.TypeError,$N=Object.defineProperty,Ha={f:ua?$N:function(e,t,r){if(Jn(e),t=oD(t),Jn(r),VN)try{return $N(e,t,r)}catch(n){}if("get"in r||"set"in r)throw vhe("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},il=ua?function(e,t,r){return Ha.f(e,t,_y(1,r))}:function(e,t,r){return e[t]=r,e},mhe=ir(Function.toString);Ur(nl.inspectSource)||(nl.inspectSource=function(e){return mhe(e)});var Ly,Kp,Py,Iy=nl.inspectSource,XN=At.WeakMap,YN=Ur(XN)&&/native code/.test(Iy(XN)),ZN=nD("keys"),lD=function(e){return ZN[e]||(ZN[e]=iD(e))},My={},uD=At.TypeError,yhe=At.WeakMap;if(YN||nl.state){var Iu=nl.state||(nl.state=new yhe),bhe=ir(Iu.get),JN=ir(Iu.has),Ehe=ir(Iu.set);Ly=function(e,t){if(JN(Iu,e))throw new uD("Object already initialized");return t.facade=e,Ehe(Iu,e,t),t},Kp=function(e){return bhe(Iu,e)||{}},Py=function(e){return JN(Iu,e)}}else{var Dd=lD("state");My[Dd]=!0,Ly=function(e,t){if(Fn(e,Dd))throw new uD("Object already initialized");return t.facade=e,il(e,Dd,t),t},Kp=function(e){return Fn(e,Dd)?e[Dd]:{}},Py=function(e){return Fn(e,Dd)}}var Yi={set:Ly,get:Kp,has:Py,enforce:function(e){return Py(e)?Kp(e):Ly(e,{})},getterFor:function(e){return function(t){var r;if(!qr(t)||(r=Kp(t)).type!==e)throw uD("Incompatible receiver, "+e+" required");return r}}},QN=Function.prototype,xhe=ua&&Object.getOwnPropertyDescriptor,cD=Fn(QN,"name"),Od={EXISTS:cD,PROPER:cD&&function(){}.name==="something",CONFIGURABLE:cD&&(!ua||ua&&xhe(QN,"name").configurable)},Zi=X2(function(e){var t=Od.CONFIGURABLE,r=Yi.get,n=Yi.enforce,i=String(String).split("String");(e.exports=function(o,a,s,l){var u,c=!!l&&!!l.unsafe,h=!!l&&!!l.enumerable,S=!!l&&!!l.noTargetGet,y=l&&l.name!==void 0?l.name:a;Ur(s)&&(String(y).slice(0,7)==="Symbol("&&(y="["+String(y).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!Fn(s,"name")||t&&s.name!==y)&&il(s,"name",y),(u=n(s)).source||(u.source=i.join(typeof y=="string"?y:""))),o!==At?(c?!S&&o[a]&&(h=!0):delete o[a],h?o[a]=s:il(o,a,s)):h?o[a]=s:rD(a,s)})(Function.prototype,"toString",function(){return Ur(this)&&r(this).source||Iy(this)})}),She=Math.ceil,whe=Math.floor,By=function(e){var t=+e;return t!=t||t===0?0:(t>0?whe:She)(t)},Che=Math.max,The=Math.min,$p=function(e,t){var r=By(e);return r<0?Che(r+t,0):The(r,t)},Ahe=Math.min,qN=function(e){return e>0?Ahe(By(e),9007199254740991):0},Xp=function(e){return qN(e.length)},e9=function(e){return function(t,r,n){var i,o=tl(t),a=Xp(o),s=$p(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},t9={includes:e9(!0),indexOf:e9(!1)},Dhe=t9.indexOf,r9=ir([].push),n9=function(e,t){var r,n=tl(e),i=0,o=[];for(r in n)!Fn(My,r)&&Fn(n,r)&&r9(o,r);for(;t.length>i;)Fn(n,r=t[i++])&&(~Dhe(o,r)||r9(o,r));return o},Fy=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ohe=Fy.concat("length","prototype"),Ny={f:Object.getOwnPropertyNames||function(e){return n9(e,Ohe)}},_he={f:Object.getOwnPropertySymbols},Rhe=ir([].concat),khe=Lu("Reflect","ownKeys")||function(e){var t=Ny.f(Jn(e)),r=_he.f;return r?Rhe(t,r(e)):t},Lhe=function(e,t){for(var r=khe(t),n=Ha.f,i=sD.f,o=0;o<r.length;o++){var a=r[o];Fn(e,a)||n(e,a,i(t,a))}},Phe=/#|\.prototype\./,Yp=function(e,t){var r=Mhe[Ihe(e)];return r==Fhe||r!=Bhe&&(Ur(t)?Zr(t):!!t)},Ihe=Yp.normalize=function(e){return String(e).replace(Phe,".").toLowerCase()},Mhe=Yp.data={},Bhe=Yp.NATIVE="N",Fhe=Yp.POLYFILL="P",jy=Yp,Nhe=sD.f,Ii=function(e,t){var r,n,i,o,a,s=e.target,l=e.global,u=e.stat;if(r=l?At:u?At[s]||rD(s,{}):(At[s]||{}).prototype)for(n in t){if(o=t[n],i=e.noTargetGet?(a=Nhe(r,n))&&a.value:r[n],!jy(l?n:s+(u?".":"#")+n,e.forced)&&i!==void 0){if(typeof o==typeof i)continue;Lhe(o,i)}(e.sham||i&&i.sham)&&il(o,"sham",!0),Zi(r,n,o,e)}},i9={};i9[Cn("toStringTag")]="z";var dD=String(i9)==="[object z]",jhe=Cn("toStringTag"),Uhe=At.Object,Hhe=ca(function(){return arguments}())=="Arguments",Uy=dD?ca:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=function(i,o){try{return i[o]}catch(a){}}(t=Uhe(e),jhe))=="string"?r:Hhe?ca(t):(n=ca(t))=="Object"&&Ur(t.callee)?"Arguments":n},zhe=At.String,So=function(e){if(Uy(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return zhe(e)},hD=`
|
|
|
\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`,o9=ir("".replace),Hy="["+hD+"]",Whe=RegExp("^"+Hy+Hy+"*"),Ghe=RegExp(Hy+Hy+"*$"),fD=function(e){return function(t){var r=So(Up(t));return 1&e&&(r=o9(r,Whe,"")),2&e&&(r=o9(r,Ghe,"")),r}},Vhe={start:fD(1),end:fD(2),trim:fD(3)},Khe=Od.PROPER,$he=Vhe.trim;function a9(e){return e.length?e[0].tagName.toLowerCase():""}function s9(e,t,r){t===void 0&&(t="auto"),r===void 0&&(r="auto");var n=_e(e);return n.attr("width",t),n.attr("height",r),n[0].outerHTML}Ii({target:"String",proto:!0,forced:Zr(function(){return!!hD.trim()||"\u200B\x85\u180E".trim()!=="\u200B\x85\u180E"||Khe&&hD.trim.name!=="trim"})},{trim:function(){return $he(this)}}),Ii({global:!0},{globalThis:At}),io&&(_e.fn.append=io),Zo&&(_e.fn.on=Zo),cs&&(_e.fn.focus=cs),no&&(_e.fn.attr=no),Yo&&(_e.fn.val=Yo),us&&(_e.fn.html=us),yc&&(_e.fn.parent=yc),gc&&(_e.fn.hasClass=gc),Sc&&(_e.fn.empty=Sc);var zy,Xhe={type:"video",renderElem:function(e,t,r){var n,i=e,o=i.src,a=o===void 0?"":o,s=i.poster,l=s===void 0?"":s,u=i.width,c=u===void 0?"auto":u,h=i.height,S=h===void 0?"auto":h,y=Ae.isNodeSelected(r,e);if(a.trim().indexOf("<iframe ")===0)n=er("div",{className:"w-e-textarea-video-container","data-selected":y?"true":"",innerHTML:s9(a,c,S)});else{var W=er("video",{poster:l,controls:!0},er("source",{src:a,type:"video/mp4"}),`Sorry, your browser doesn't support embedded videos.
|
|
|
\u62B1\u6B49\uFF0C\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 video \u89C6\u9891`);c!=="auto"&&(W.data.width=c),S!=="auto"&&(W.data.height=S),n=er("div",{className:"w-e-textarea-video-container","data-selected":y?"true":""},W)}return wc("div",{props:{contentEditable:!1},on:{mousedown:function(B){return B.preventDefault()}}},n)}},Yhe={type:"video",elemToHtml:function(e,t){var r=e,n=r.src,i=n===void 0?"":n,o=r.poster,a=o===void 0?"":o,s=r.width,l=s===void 0?"auto":s,u=r.height,c=u===void 0?"auto":u,h=`<div data-w-e-type="video" data-w-e-is-void>
|
|
|
`;return i.trim().indexOf("<iframe ")===0?h+=s9(i,l,c):h+='<video poster="'+a+'" controls="true" width="'+l+'" height="'+c+'"><source src="'+i+'" type="video/mp4"/></video>',h+`
|
|
|
</div>`}},Zhe=Object.keys||function(e){return n9(e,Fy)},Jhe=ua?Object.defineProperties:function(e,t){Jn(e);for(var r,n=tl(t),i=Zhe(t),o=i.length,a=0;o>a;)Ha.f(e,r=i[a++],n[r]);return e},pD=Lu("document","documentElement"),l9=lD("IE_PROTO"),gD=function(){},u9=function(e){return"<script>"+e+"</script>"},c9=function(e){e.write(u9("")),e.close();var t=e.parentWindow.Object;return e=null,t},Wy=function(){try{zy=new ActiveXObject("htmlfile")}catch(n){}var e,t;Wy=typeof document!="undefined"?document.domain&&zy?c9(zy):((t=Vp("iframe")).style.display="none",pD.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(u9("document.F=Object")),e.close(),e.F):c9(zy);for(var r=Fy.length;r--;)delete Wy.prototype[Fy[r]];return Wy()};My[l9]=!0;var vD=Object.create||function(e,t){var r;return e!==null?(gD.prototype=Jn(e),r=new gD,gD.prototype=null,r[l9]=e):r=Wy(),t===void 0?r:Jhe(r,t)},mD=Cn("unscopables"),yD=Array.prototype;yD[mD]==null&&Ha.f(yD,mD,{configurable:!0,value:vD(null)});var Zp=function(e){yD[mD][e]=!0},Qhe=t9.includes;Ii({target:"Array",proto:!0},{includes:function(e){return Qhe(this,e,arguments.length>1?arguments[1]:void 0)}}),Zp("includes");var qhe={selector:"iframe,video,p",preParseHtml:function(e){var t=_e(e),r=t;if(a9(t)==="p"){var n=t.children();if(n.length===1){var i=n[0],o=i.tagName.toLowerCase();["iframe","video"].includes(o)&&(r=_e(i))}}var a=a9(r);if(a!=="iframe"&&a!=="video")return r[0];if(r.parent().attr("data-w-e-type")==="video")return r[0];var s=_e('<div data-w-e-type="video" data-w-e-is-void></div>');return s.append(r),s[0]}},d9=ir(ir.bind),Jp=function(e,t){return rl(e),t===void 0?e:d9?d9(e,t):function(){return e.apply(t,arguments)}},Gy=Array.isArray||function(e){return ca(e)=="Array"},h9=function(){},efe=[],f9=Lu("Reflect","construct"),bD=/^\s*(?:class|function)\b/,tfe=ir(bD.exec),rfe=!bD.exec(h9),Qp=function(e){if(!Ur(e))return!1;try{return f9(h9,efe,e),!0}catch(t){return!1}},ED=!f9||Zr(function(){var e;return Qp(Qp.call)||!Qp(Object)||!Qp(function(){e=!0})||e})?function(e){if(!Ur(e))return!1;switch(Uy(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return rfe||!!tfe(bD,Iy(e))}:Qp,nfe=Cn("species"),p9=At.Array,ife=function(e,t){return new(function(r){var n;return Gy(r)&&(n=r.constructor,(ED(n)&&(n===p9||Gy(n.prototype))||qr(n)&&(n=n[nfe])===null)&&(n=void 0)),n===void 0?p9:n}(e))(t===0?0:t)},g9=ir([].push),ol=function(e){var t=e==1,r=e==2,n=e==3,i=e==4,o=e==6,a=e==7,s=e==5||o;return function(l,u,c,h){for(var S,y,W=ky(l),B=Q2(W),N=Jp(u,c),U=Xp(B),D=0,Q=h||ife,te=t?Q(l,U):r||a?Q(l,0):void 0;U>D;D++)if((s||D in B)&&(y=N(S=B[D],D,W),e))if(t)te[D]=y;else if(y)switch(e){case 3:return!0;case 5:return S;case 6:return D;case 2:g9(te,S)}else switch(e){case 4:return!1;case 7:g9(te,S)}return o?-1:n||i?i:te}},xD={forEach:ol(0),map:ol(1),filter:ol(2),some:ol(3),every:ol(4),find:ol(5),findIndex:ol(6),filterReject:ol(7)},ofe=xD.find,v9=!0;"find"in[]&&Array(1).find(function(){v9=!1}),Ii({target:"Array",proto:!0,forced:v9},{find:function(e){return ofe(this,e,arguments.length>1?arguments[1]:void 0)}}),Zp("find");var afe=dD?{}.toString:function(){return"[object "+Uy(this)+"]"};function m9(e,t,r,n){return t===void 0&&(t=""),r===void 0&&(r="auto"),n===void 0&&(n="auto"),{type:"video",src:e,poster:t,width:r,height:n,children:[{text:""}]}}dD||Zi(Object.prototype,"toString",afe,{unsafe:!0});var y9,SD,sfe={selector:'div[data-w-e-type="video"]',parseElemHtml:function(e,t,r){var n=_e(e),i="",o="",a="auto",s="auto",l=n.find("iframe");if(l.length>0)return a=l.attr("width")||"auto",s=l.attr("height")||"auto",m9(i=l[0].outerHTML,o,a,s);var u=n.find("video");return(i=u.attr("src")||"")||u.length>0&&(i=u.find("source").attr("src")||""),a=u.attr("width")||"auto",s=u.attr("height")||"auto",m9(i,o=u.attr("poster")||"",a,s)}},b9=function(){var e=Jn(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},wD=At.RegExp,CD=Zr(function(){var e=wD("a","y");return e.lastIndex=2,e.exec("abcd")!=null}),lfe=CD||Zr(function(){return!wD("a","y").sticky}),ufe={BROKEN_CARET:CD||Zr(function(){var e=wD("^r","gy");return e.lastIndex=2,e.exec("str")!=null}),MISSED_STICKY:lfe,UNSUPPORTED_Y:CD},cfe=At.RegExp,dfe=Zr(function(){var e=cfe(".","s");return!(e.dotAll&&e.exec(`
|
|
|
`)&&e.flags==="s")}),hfe=At.RegExp,ffe=Zr(function(){var e=hfe("(?<a>b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$<a>c")!=="bc"}),pfe=Yi.get,gfe=nD("native-string-replace",String.prototype.replace),Vy=RegExp.prototype.exec,TD=Vy,vfe=ir("".charAt),mfe=ir("".indexOf),yfe=ir("".replace),AD=ir("".slice),DD=(SD=/b*/g,Xr(Vy,y9=/a/,"a"),Xr(Vy,SD,"a"),y9.lastIndex!==0||SD.lastIndex!==0),E9=ufe.BROKEN_CARET,OD=/()??/.exec("")[1]!==void 0;(DD||OD||E9||dfe||ffe)&&(TD=function(e){var t,r,n,i,o,a,s,l=this,u=pfe(l),c=So(e),h=u.raw;if(h)return h.lastIndex=l.lastIndex,t=Xr(TD,h,c),l.lastIndex=h.lastIndex,t;var S=u.groups,y=E9&&l.sticky,W=Xr(b9,l),B=l.source,N=0,U=c;if(y&&(W=yfe(W,"y",""),mfe(W,"g")===-1&&(W+="g"),U=AD(c,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&vfe(c,l.lastIndex-1)!==`
|
|
|
`)&&(B="(?: "+B+")",U=" "+U,N++),r=new RegExp("^(?:"+B+")",W)),OD&&(r=new RegExp("^"+B+"$(?!\\s)",W)),DD&&(n=l.lastIndex),i=Xr(Vy,y?r:l,U),y?i?(i.input=AD(i.input,N),i[0]=AD(i[0],N),i.index=l.lastIndex,l.lastIndex+=i[0].length):l.lastIndex=0:DD&&i&&(l.lastIndex=l.global?i.index+i[0].length:n),OD&&i&&i.length>1&&Xr(gfe,i[0],r,function(){for(o=1;o<arguments.length-2;o++)arguments[o]===void 0&&(i[o]=void 0)}),i&&S)for(i.groups=a=vD(null),o=0;o<S.length;o++)a[(s=S[o])[0]]=i[s[1]];return i});var Ky=TD;Ii({target:"RegExp",proto:!0,forced:/./.exec!==Ky},{exec:Ky});var _D=Function.prototype,x9=_D.apply,bfe=_D.bind,S9=_D.call,w9=typeof Reflect=="object"&&Reflect.apply||(bfe?S9.bind(x9):function(){return S9.apply(x9,arguments)}),C9=(Cn("species"),RegExp.prototype),Efe=ir("".charAt),T9=ir("".charCodeAt),xfe=ir("".slice),A9=function(e){return function(t,r){var n,i,o=So(Up(t)),a=By(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=T9(o,a))<55296||n>56319||a+1===s||(i=T9(o,a+1))<56320||i>57343?e?Efe(o,a):n:e?xfe(o,a,a+2):i-56320+(n-55296<<10)+65536}},D9={codeAt:A9(!1),charAt:A9(!0)},Sfe=D9.charAt,wfe=function(e,t,r){return t+(r?Sfe(e,t).length:1)},Cfe=Math.floor,RD=ir("".charAt),Tfe=ir("".replace),kD=ir("".slice),Afe=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Dfe=/\$([$&'`]|\d{1,2})/g,Ofe=function(e,t,r,n,i,o){var a=r+e.length,s=n.length,l=Dfe;return i!==void 0&&(i=ky(i),l=Afe),Tfe(o,l,function(u,c){var h;switch(RD(c,0)){case"$":return"$";case"&":return e;case"`":return kD(t,0,r);case"'":return kD(t,a);case"<":h=i[kD(c,1,-1)];break;default:var S=+c;if(S===0)return u;if(S>s){var y=Cfe(S/10);return y===0?u:y<=s?n[y-1]===void 0?RD(c,1):n[y-1]+RD(c,1):u}h=n[S-1]}return h===void 0?"":h})},_fe=At.TypeError,Rfe=function(e,t){var r=e.exec;if(Ur(r)){var n=Xr(r,e,t);return n!==null&&Jn(n),n}if(ca(e)==="RegExp")return Xr(Ky,e,t);throw _fe("RegExp#exec called on incompatible receiver")},LD=Cn("replace"),kfe=Math.max,Lfe=Math.min,Pfe=ir([].concat),PD=ir([].push),O9=ir("".indexOf),_9=ir("".slice),Ife="a".replace(/./,"$0")==="$0",R9=!!/./[LD]&&/./[LD]("a","$0")==="";function k9(e){return e===void 0&&(e="r"),e+"-"+SP()}!function(e,t,r,n){var i=Cn(e),o=!Zr(function(){var u={};return u[i]=function(){return 7},""[e](u)!=7}),a=o&&!Zr(function(){var u=!1,c=/a/;return c.exec=function(){return u=!0,null},c[i](""),!u});if(!o||!a||r){var s=ir(/./[i]),l=function(u,c,h){var S=R9?"$":"$0";return[function(y,W){var B=Up(this),N=y==null?void 0:Wp(y,LD);return N?Xr(N,y,B,W):Xr(c,So(B),y,W)},function(y,W){var B=Jn(this),N=So(y);if(typeof W=="string"&&O9(W,S)===-1&&O9(W,"$<")===-1){var U=h(c,B,N,W);if(U.done)return U.value}var D=Ur(W);D||(W=So(W));var Q=B.global;if(Q){var te=B.unicode;B.lastIndex=0}for(var he=[];;){var Ee=Rfe(B,N);if(Ee===null)break;if(PD(he,Ee),!Q)break;So(Ee[0])===""&&(B.lastIndex=wfe(N,qN(B.lastIndex),te))}for(var ve,De="",Pe=0,qe=0;qe<he.length;qe++){for(var ot=So((Ee=he[qe])[0]),et=kfe(Lfe(By(Ee.index),N.length),0),gt=[],dt=1;dt<Ee.length;dt++)PD(gt,(ve=Ee[dt])===void 0?ve:String(ve));var ht=Ee.groups;if(D){var pt=Pfe([ot],gt,et,N);ht!==void 0&&PD(pt,ht);var Dt=So(w9(W,void 0,pt))}else Dt=Ofe(ot,N,et,gt,ht,W);et>=Pe&&(De+=_9(N,Pe,et)+Dt,Pe=et+ot.length)}return De+_9(N,Pe)}]}(0,""[e],function(u,c,h,S,y){var W=ir(u),B=c.exec;return B===Ky||B===C9.exec?o&&!y?{done:!0,value:s(c,h,S)}:{done:!0,value:W(h,c,S)}:{done:!1}});Zi(String.prototype,e,l[0]),Zi(C9,i,l[1])}}("replace",0,!!Zr(function(){var e=/./;return e.exec=function(){var t=[];return t.groups={a:"7"},t},"".replace(e,"$<a>")!=="7"})||!Ife||R9);var $y=At.Promise,Xy=function(e,t,r){for(var n in t)Zi(e,n,t[n],r);return e},Mfe=At.String,Bfe=At.TypeError,_d=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=ir(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(n){}return function(n,i){return Jn(n),function(o){if(typeof o=="object"||Ur(o))return o;throw Bfe("Can't set "+Mfe(o)+" as a prototype")}(i),t?e(n,i):n.__proto__=i,n}}():void 0),Ffe=Ha.f,L9=Cn("toStringTag"),Yy=function(e,t,r){e&&!Fn(e=r?e:e.prototype,L9)&&Ffe(e,L9,{configurable:!0,value:t})},P9=Cn("species"),Nfe=At.TypeError,ID=function(e,t){if(Hp(t,e))return e;throw Nfe("Incorrect invocation")},Rd={},jfe=Cn("iterator"),Ufe=Array.prototype,Hfe=Cn("iterator"),I9=function(e){if(e!=null)return Wp(e,Hfe)||Wp(e,"@@iterator")||Rd[Uy(e)]},zfe=At.TypeError,M9=function(e,t,r){var n,i;Jn(e);try{if(!(n=Wp(e,"return"))){if(t==="throw")throw r;return r}n=Xr(n,e)}catch(o){i=!0,n=o}if(t==="throw")throw r;if(i)throw n;return Jn(n),r},Wfe=At.TypeError,Zy=function(e,t){this.stopped=e,this.result=t},B9=Zy.prototype,Jy=function(e,t,r){var n,i,o,a,s,l,u,c,h=r&&r.that,S=!(!r||!r.AS_ENTRIES),y=!(!r||!r.IS_ITERATOR),W=!(!r||!r.INTERRUPTED),B=Jp(t,h),N=function(D){return n&&M9(n,"normal",D),new Zy(!0,D)},U=function(D){return S?(Jn(D),W?B(D[0],D[1],N):B(D[0],D[1])):W?B(D,N):B(D)};if(y)n=e;else{if(!(i=I9(e)))throw Wfe(Ry(e)+" is not iterable");if((c=i)!==void 0&&(Rd.Array===c||Ufe[jfe]===c)){for(o=0,a=Xp(e);a>o;o++)if((s=U(e[o]))&&Hp(B9,s))return s;return new Zy(!1)}n=function(D,Q){var te=arguments.length<2?I9(D):Q;if(rl(te))return Jn(Xr(te,D));throw zfe(Ry(D)+" is not iterable")}(e,i)}for(l=n.next;!(u=Xr(l,n)).done;){try{s=U(u.value)}catch(D){M9(n,"throw",D)}if(typeof s=="object"&&s&&Hp(B9,s))return s}return new Zy(!1)},F9=Cn("iterator"),N9=!1;try{var Gfe=0,j9={next:function(){return{done:!!Gfe++}},return:function(){N9=!0}};j9[F9]=function(){return this},Array.from(j9,function(){throw 2})}catch(e){}var qp,kd,U9,MD,H9=function(e,t){if(!t&&!N9)return!1;var r=!1;try{var n={};n[F9]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(i){}return r},Vfe=At.TypeError,Kfe=Cn("species"),z9=ir([].slice),W9=/(?:ipad|iphone|ipod).*applewebkit/i.test(Ad),al=ca(At.process)=="process",BD=At.setImmediate,FD=At.clearImmediate,$fe=At.process,ND=At.Dispatch,Xfe=At.Function,G9=At.MessageChannel,Yfe=At.String,jD=0,eg={};try{qp=At.location}catch(e){}var UD=function(e){if(Fn(eg,e)){var t=eg[e];delete eg[e],t()}},HD=function(e){return function(){UD(e)}},V9=function(e){UD(e.data)},K9=function(e){At.postMessage(Yfe(e),qp.protocol+"//"+qp.host)};BD&&FD||(BD=function(e){var t=z9(arguments,1);return eg[++jD]=function(){w9(Ur(e)?e:Xfe(e),void 0,t)},kd(jD),jD},FD=function(e){delete eg[e]},al?kd=function(e){$fe.nextTick(HD(e))}:ND&&ND.now?kd=function(e){ND.now(HD(e))}:G9&&!W9?(MD=(U9=new G9).port2,U9.port1.onmessage=V9,kd=Jp(MD.postMessage,MD)):At.addEventListener&&Ur(At.postMessage)&&!At.importScripts&&qp&&qp.protocol!=="file:"&&!Zr(K9)?(kd=K9,At.addEventListener("message",V9,!1)):kd="onreadystatechange"in Vp("script")?function(e){pD.appendChild(Vp("script")).onreadystatechange=function(){pD.removeChild(this),UD(e)}}:function(e){setTimeout(HD(e),0)});var tg,Mu,rg,Ld,zD,WD,GD,$9,X9={set:BD,clear:FD},Zfe=/ipad|iphone|ipod/i.test(Ad)&&At.Pebble!==void 0,Jfe=/web0s(?!.*chrome)/i.test(Ad),Qfe=sD.f,VD=X9.set,Y9=At.MutationObserver||At.WebKitMutationObserver,Z9=At.document,J9=At.process,Qy=At.Promise,Q9=Qfe(At,"queueMicrotask"),q9=Q9&&Q9.value;q9||(tg=function(){var e,t;for(al&&(e=J9.domain)&&e.exit();Mu;){t=Mu.fn,Mu=Mu.next;try{t()}catch(r){throw Mu?Ld():rg=void 0,r}}rg=void 0,e&&e.enter()},W9||al||Jfe||!Y9||!Z9?!Zfe&&Qy&&Qy.resolve?((GD=Qy.resolve(void 0)).constructor=Qy,$9=Jp(GD.then,GD),Ld=function(){$9(tg)}):al?Ld=function(){J9.nextTick(tg)}:(VD=Jp(VD,At),Ld=function(){VD(tg)}):(zD=!0,WD=Z9.createTextNode(""),new Y9(tg).observe(WD,{characterData:!0}),Ld=function(){WD.data=zD=!zD}));var KD,e7,t7,r7,n7=q9||function(e){var t={fn:e,next:void 0};rg&&(rg.next=t),Mu||(Mu=t,Ld()),rg=t},qfe=function(e){var t,r;this.promise=new e(function(n,i){if(t!==void 0||r!==void 0)throw TypeError("Bad Promise constructor");t=n,r=i}),this.resolve=rl(t),this.reject=rl(r)},$D={f:function(e){return new qfe(e)}},XD=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},epe=typeof window=="object",i7=X9.set,tpe=Cn("species"),za="Promise",o7=Yi.getterFor(za),rpe=Yi.set,npe=Yi.getterFor(za),Bu=$y&&$y.prototype,da=$y,ng=Bu,a7=At.TypeError,YD=At.document,ZD=At.process,Pd=$D.f,ipe=Pd,ope=!!(YD&&YD.createEvent&&At.dispatchEvent),s7=Ur(At.PromiseRejectionEvent),l7=!1,ig=jy(za,function(){var e=Iy(da),t=e!==String(da);if(!t&&zp===66)return!0;if(zp>=51&&/native code/.test(e))return!1;var r=new da(function(i){i(1)}),n=function(i){i(function(){},function(){})};return(r.constructor={})[tpe]=n,!(l7=r.then(function(){})instanceof n)||!t&&epe&&!s7}),ape=ig||!H9(function(e){da.all(e).catch(function(){})}),u7=function(e){var t;return!(!qr(e)||!Ur(t=e.then))&&t},JD=function(e,t){if(!e.notified){e.notified=!0;var r=e.reactions;n7(function(){for(var n=e.value,i=e.state==1,o=0;r.length>o;){var a,s,l,u=r[o++],c=i?u.ok:u.fail,h=u.resolve,S=u.reject,y=u.domain;try{c?(i||(e.rejection===2&&lpe(e),e.rejection=1),c===!0?a=n:(y&&y.enter(),a=c(n),y&&(y.exit(),l=!0)),a===u.promise?S(a7("Promise-chain cycle")):(s=u7(a))?Xr(s,a,h,S):h(a)):S(n)}catch(W){y&&!l&&y.exit(),S(W)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&spe(e)})}},c7=function(e,t,r){var n,i;ope?((n=YD.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),At.dispatchEvent(n)):n={promise:t,reason:r},!s7&&(i=At["on"+e])?i(n):e==="unhandledrejection"&&function(o,a){var s=At.console;s&&s.error&&(arguments.length==1?s.error(o):s.error(o,a))}("Unhandled promise rejection",r)},spe=function(e){Xr(i7,At,function(){var t,r=e.facade,n=e.value;if(d7(e)&&(t=XD(function(){al?ZD.emit("unhandledRejection",n,r):c7("unhandledrejection",r,n)}),e.rejection=al||d7(e)?2:1,t.error))throw t.value})},d7=function(e){return e.rejection!==1&&!e.parent},lpe=function(e){Xr(i7,At,function(){var t=e.facade;al?ZD.emit("rejectionHandled",t):c7("rejectionhandled",t,e.value)})},Id=function(e,t,r){return function(n){e(t,n,r)}},Md=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,JD(e,!0))},QD=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw a7("Promise can't be resolved itself");var n=u7(t);n?n7(function(){var i={done:!1};try{Xr(n,t,Id(QD,i,e),Id(Md,i,e))}catch(o){Md(i,o,e)}}):(e.value=t,e.state=1,JD(e,!1))}catch(i){Md({done:!1},i,e)}}};if(ig&&(ng=(da=function(e){ID(this,ng),rl(e),Xr(KD,this);var t=o7(this);try{e(Id(QD,t),Id(Md,t))}catch(r){Md(t,r)}}).prototype,(KD=function(e){rpe(this,{type:za,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Xy(ng,{then:function(e,t){var r=npe(this),n=r.reactions,i=Pd(function(o,a){var s,l=Jn(o).constructor;return l===void 0||(s=Jn(l)[Kfe])==null?a:function(u){if(ED(u))return u;throw Vfe(Ry(u)+" is not a constructor")}(s)}(this,da));return i.ok=!Ur(e)||e,i.fail=Ur(t)&&t,i.domain=al?ZD.domain:void 0,r.parent=!0,n[n.length]=i,r.state!=0&&JD(r,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),e7=function(){var e=new KD,t=o7(e);this.promise=e,this.resolve=Id(QD,t),this.reject=Id(Md,t)},$D.f=Pd=function(e){return e===da||e===t7?new e7(e):ipe(e)},Ur($y)&&Bu!==Object.prototype)){r7=Bu.then,l7||(Zi(Bu,"then",function(e,t){var r=this;return new da(function(n,i){Xr(r7,r,n,i)}).then(e,t)},{unsafe:!0}),Zi(Bu,"catch",ng.catch,{unsafe:!0}));try{delete Bu.constructor}catch(e){}_d&&_d(Bu,ng)}function og(e,t,r){return r===void 0&&(r=""),Ty(this,void 0,void 0,function(){var n,i,o,a,s,l,u;return Ay(this,function(c){switch(c.label){case 0:return t?(e.restoreSelection(),n=e.getMenuConfig("insertVideo"),i=n.onInsertedVideo,o=n.checkVideo,a=n.parseVideoSrc,[4,o(t,r)]):[2];case 1:return typeof(s=c.sent())=="string"?(e.alert(s,"error"),[2]):s==null?[2]:[4,a(t)];case 2:return(l=c.sent()).trim().indexOf("<iframe ")!==0&&(l=l.replace(/</g,"<").replace(/>/g,">")),u={type:"video",src:l,poster:r,children:[{text:""}]},Promise.resolve().then(function(){Ve.insertNodes(e,u)}),i(u),[2]}})})}function qD(){return k9("w-e-insert-video")}Ii({global:!0,wrap:!0,forced:ig},{Promise:da}),Yy(da,za,!1),function(e){var t=Lu("Promise"),r=Ha.f;ua&&t&&!t[P9]&&r(t,P9,{configurable:!0,get:function(){return this}})}(),t7=Lu(za),Ii({target:za,stat:!0,forced:ig},{reject:function(e){var t=Pd(this);return Xr(t.reject,void 0,e),t.promise}}),Ii({target:za,stat:!0,forced:ig},{resolve:function(e){return function(t,r){if(Jn(t),qr(r)&&r.constructor===t)return r;var n=$D.f(t);return(0,n.resolve)(r),n.promise}(this,e)}}),Ii({target:za,stat:!0,forced:ape},{all:function(e){var t=this,r=Pd(t),n=r.resolve,i=r.reject,o=XD(function(){var a=rl(t.resolve),s=[],l=0,u=1;Jy(e,function(c){var h=l++,S=!1;u++,Xr(a,t,c).then(function(y){S||(S=!0,s[h]=y,--u||n(s))},i)}),--u||n(s)});return o.error&&i(o.value),r.promise},race:function(e){var t=this,r=Pd(t),n=r.reject,i=XD(function(){var o=rl(t.resolve);Jy(e,function(a){Xr(o,t,a).then(r.resolve,n)})});return i.error&&n(i.value),r.promise}});var upe=function(){function e(){this.title=wt("videoModule.insertVideo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M981.184 160.096C837.568 139.456 678.848 128 512 128S186.432 139.456 42.816 160.096C15.296 267.808 0 386.848 0 512s15.264 244.16 42.816 351.904C186.464 884.544 345.152 896 512 896s325.568-11.456 469.184-32.096C1008.704 756.192 1024 637.152 1024 512s-15.264-244.16-42.816-351.904zM384 704V320l320 192-320 192z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=320,this.$content=null,this.srcInputId=qD(),this.posterInputId=qD(),this.buttonId=qD()}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.exec=function(t,r){},e.prototype.isDisabled=function(t){var r=t.selection;return r==null||!Qe.isCollapsed(r)||!!Ae.getSelectedElems(t).some(function(n){var i=Ae.getNodeType(n);return i==="pre"||i==="list-item"||!!t.isVoid(n)})},e.prototype.getModalPositionNode=function(t){return null},e.prototype.getModalContentElem=function(t){var r=this,n=this,i=n.srcInputId,o=n.posterInputId,a=n.buttonId,s=ku(Wi(wt("videoModule.videoSrc"),i,wt("videoModule.videoSrcPlaceHolder")),2),l=s[0],u=s[1],c=ku(Wi(wt("videoModule.videoPoster"),o,wt("videoModule.videoPosterPlaceHolder")),2),h=c[0],S=c[1],y=_e(u),W=_e(S),B=ku(Zc(a,wt("videoModule.ok")),1)[0];if(this.$content==null){var N=_e("<div></div>");N.on("click","#"+a,function(D){return Ty(r,void 0,void 0,function(){var Q,te;return Ay(this,function(he){switch(he.label){case 0:return D.preventDefault(),Q=N.find("#"+i).val().trim(),te=N.find("#"+o).val().trim(),[4,og(t,Q,te)];case 1:return he.sent(),t.hidePanelOrModal(),[2]}})})}),this.$content=N}var U=this.$content;return U.empty(),U.append(l),U.append(h),U.append(B),y.val(""),W.val(""),setTimeout(function(){y.focus()}),U[0]},e}(),cpe=ir([].join),dpe=Q2!=Object,hpe=function(e,t){var r=[].join;return!!r&&Zr(function(){r.call(null,",",1)})}();Ii({target:"Array",proto:!0,forced:dpe||!hpe},{join:function(e){return cpe(tl(this),e===void 0?",":e)}});var Fu,h7,f7,fpe=!Zr(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),p7=lD("IE_PROTO"),eO=At.Object,ppe=eO.prototype,qy=fpe?eO.getPrototypeOf:function(e){var t=ky(e);if(Fn(t,p7))return t[p7];var r=t.constructor;return Ur(r)&&t instanceof r?r.prototype:t instanceof eO?ppe:null},tO=Cn("iterator"),g7=!1;[].keys&&("next"in(f7=[].keys())?(h7=qy(qy(f7)))!==Object.prototype&&(Fu=h7):g7=!0);var gpe=Fu==null||Zr(function(){var e={};return Fu[tO].call(e)!==e});gpe&&(Fu={}),Ur(Fu[tO])||Zi(Fu,tO,function(){return this});var rO={IteratorPrototype:Fu,BUGGY_SAFARI_ITERATORS:g7},vpe=rO.IteratorPrototype,mpe=function(){return this},ype=Od.PROPER,bpe=Od.CONFIGURABLE,v7=rO.IteratorPrototype,eb=rO.BUGGY_SAFARI_ITERATORS,ag=Cn("iterator"),Epe=function(){return this},m7=function(e,t,r,n,i,o,a){!function(U,D,Q,te){var he=D+" Iterator";U.prototype=vD(vpe,{next:_y(1,Q)}),Yy(U,he,!1),Rd[he]=mpe}(r,t,n);var s,l,u,c=function(U){if(U===i&&B)return B;if(!eb&&U in y)return y[U];switch(U){case"keys":case"values":case"entries":return function(){return new r(this,U)}}return function(){return new r(this)}},h=t+" Iterator",S=!1,y=e.prototype,W=y[ag]||y["@@iterator"]||i&&y[i],B=!eb&&W||c(i),N=t=="Array"&&y.entries||W;if(N&&(s=qy(N.call(new e)))!==Object.prototype&&s.next&&(qy(s)!==v7&&(_d?_d(s,v7):Ur(s[ag])||Zi(s,ag,Epe)),Yy(s,h,!0)),ype&&i=="values"&&W&&W.name!=="values"&&(bpe?il(y,"name","values"):(S=!0,B=function(){return Xr(W,this)})),i)if(l={values:c("values"),keys:o?B:c("keys"),entries:c("entries")},a)for(u in l)(eb||S||!(u in y))&&Zi(y,u,l[u]);else Ii({target:t,proto:!0,forced:eb||S},l);return y[ag]!==B&&Zi(y,ag,B,{name:i}),Rd[t]=B,l},xpe=Yi.set,Spe=Yi.getterFor("Array Iterator"),sg=m7(Array,"Array",function(e,t){xpe(this,{type:"Array Iterator",target:tl(e),index:0,kind:t})},function(){var e=Spe(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):r=="keys"?{value:n,done:!1}:r=="values"?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values");Rd.Arguments=Rd.Array,Zp("keys"),Zp("values"),Zp("entries");var wpe=D9.charAt,Cpe=Yi.set,Tpe=Yi.getterFor("String Iterator");m7(String,"String",function(e){Cpe(this,{type:"String Iterator",string:So(e),index:0})},function(){var e,t=Tpe(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=wpe(r,n),t.index+=e.length,{value:e,done:!1})});var y7=function(e,t,r){var n=oD(t);n in e?Ha.f(e,n,_y(0,r)):e[n]=r},Ape=At.Array,Dpe=Math.max,b7=Ny.f,E7=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Ope={f:function(e){return E7&&ca(e)=="Window"?function(t){try{return b7(t)}catch(r){return function(n,i,o){for(var a=Xp(n),s=$p(void 0,a),l=$p(a,a),u=Ape(Dpe(l-s,0)),c=0;s<l;s++,c++)y7(u,c,n[s]);return u.length=c,u}(E7)}}(e):b7(tl(e))}},x7=Zr(function(){if(typeof ArrayBuffer=="function"){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}),tb=Object.isExtensible,Nu=Zr(function(){tb(1)})||x7?function(e){return!!qr(e)&&(!x7||ca(e)!="ArrayBuffer")&&(!tb||tb(e))}:tb,_pe=!Zr(function(){return Object.isExtensible(Object.preventExtensions({}))}),nO=X2(function(e){var t=Ha.f,r=!1,n=iD("meta"),i=0,o=function(s){t(s,n,{value:{objectID:"O"+i++,weakData:{}}})},a=e.exports={enable:function(){a.enable=function(){},r=!0;var s=Ny.f,l=ir([].splice),u={};u[n]=1,s(u).length&&(Ny.f=function(c){for(var h=s(c),S=0,y=h.length;S<y;S++)if(h[S]===n){l(h,S,1);break}return h},Ii({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Ope.f}))},fastKey:function(s,l){if(!qr(s))return typeof s=="symbol"?s:(typeof s=="string"?"S":"P")+s;if(!Fn(s,n)){if(!Nu(s))return"F";if(!l)return"E";o(s)}return s[n].objectID},getWeakData:function(s,l){if(!Fn(s,n)){if(!Nu(s))return!0;if(!l)return!1;o(s)}return s[n].weakData},onFreeze:function(s){return _pe&&r&&Nu(s)&&!Fn(s,n)&&o(s),s}};My[n]=!0}),rb=nO.getWeakData,Rpe=Yi.set,kpe=Yi.getterFor,Lpe=xD.find,Ppe=xD.findIndex,Ipe=ir([].splice),Mpe=0,nb=function(e){return e.frozen||(e.frozen=new S7)},S7=function(){this.entries=[]},iO=function(e,t){return Lpe(e.entries,function(r){return r[0]===t})};S7.prototype={get:function(e){var t=iO(this,e);if(t)return t[1]},has:function(e){return!!iO(this,e)},set:function(e,t){var r=iO(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=Ppe(this.entries,function(r){return r[0]===e});return~t&&Ipe(this.entries,t,1),!!~t}};var lg,w7={getConstructor:function(e,t,r,n){var i=e(function(l,u){ID(l,o),Rpe(l,{type:t,id:Mpe++,frozen:void 0}),u!=null&&Jy(u,l[n],{that:l,AS_ENTRIES:r})}),o=i.prototype,a=kpe(t),s=function(l,u,c){var h=a(l),S=rb(Jn(u),!0);return S===!0?nb(h).set(u,c):S[h.id]=c,l};return Xy(o,{delete:function(l){var u=a(this);if(!qr(l))return!1;var c=rb(l);return c===!0?nb(u).delete(l):c&&Fn(c,u.id)&&delete c[u.id]},has:function(l){var u=a(this);if(!qr(l))return!1;var c=rb(l);return c===!0?nb(u).has(l):c&&Fn(c,u.id)}}),Xy(o,r?{get:function(l){var u=a(this);if(qr(l)){var c=rb(l);return c===!0?nb(u).get(l):c?c[u.id]:void 0}},set:function(l,u){return s(this,l,u)}}:{add:function(l){return s(this,l,!0)}}),i}},ib=Yi.enforce,Bpe=!At.ActiveXObject&&"ActiveXObject"in At,C7=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},Fpe=function(e,t,r){var n=e.indexOf("Map")!==-1,i=e.indexOf("Weak")!==-1,o=n?"set":"add",a=At[e],s=a&&a.prototype,l=a,u={},c=function(N){var U=ir(s[N]);Zi(s,N,N=="add"?function(D){return U(this,D===0?0:D),this}:N=="delete"?function(D){return!(i&&!qr(D))&&U(this,D===0?0:D)}:N=="get"?function(D){return i&&!qr(D)?void 0:U(this,D===0?0:D)}:N=="has"?function(D){return!(i&&!qr(D))&&U(this,D===0?0:D)}:function(D,Q){return U(this,D===0?0:D,Q),this})};if(jy(e,!Ur(a)||!(i||s.forEach&&!Zr(function(){new a().entries().next()}))))l=r.getConstructor(t,e,n,o),nO.enable();else if(jy(e,!0)){var h=new l,S=h[o](i?{}:-0,1)!=h,y=Zr(function(){h.has(1)}),W=H9(function(N){new a(N)}),B=!i&&Zr(function(){for(var N=new a,U=5;U--;)N[o](U,U);return!N.has(-0)});W||((l=t(function(N,U){ID(N,s);var D=function(Q,te,he){var Ee,ve;return _d&&Ur(Ee=te.constructor)&&Ee!==he&&qr(ve=Ee.prototype)&&ve!==he.prototype&&_d(Q,ve),Q}(new a,N,l);return U!=null&&Jy(U,D[o],{that:D,AS_ENTRIES:n}),D})).prototype=s,s.constructor=l),(y||B)&&(c("delete"),c("has"),n&&c("get")),(B||S)&&c(o),i&&s.clear&&delete s.clear}return u[e]=l,Ii({global:!0,forced:l!=a},u),Yy(l,e),i||r.setStrong(l,e,n),l}("WeakMap",C7,w7);if(YN&&Bpe){lg=w7.getConstructor(C7,"WeakMap",!0),nO.enable();var ug=Fpe.prototype,T7=ir(ug.delete),ob=ir(ug.has),A7=ir(ug.get),D7=ir(ug.set);Xy(ug,{delete:function(e){if(qr(e)&&!Nu(e)){var t=ib(this);return t.frozen||(t.frozen=new lg),T7(this,e)||t.frozen.delete(e)}return T7(this,e)},has:function(e){if(qr(e)&&!Nu(e)){var t=ib(this);return t.frozen||(t.frozen=new lg),ob(this,e)||t.frozen.has(e)}return ob(this,e)},get:function(e){if(qr(e)&&!Nu(e)){var t=ib(this);return t.frozen||(t.frozen=new lg),ob(this,e)?A7(this,e):t.frozen.get(e)}return A7(this,e)},set:function(e,t){if(qr(e)&&!Nu(e)){var r=ib(this);r.frozen||(r.frozen=new lg),ob(this,e)?D7(this,e,t):r.frozen.set(e,t)}else D7(this,e,t);return this}})}var O7={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},oO=Vp("span").classList,_7=oO&&oO.constructor&&oO.constructor.prototype,Npe=_7===Object.prototype?void 0:_7,aO=Cn("iterator"),R7=Cn("toStringTag"),sO=sg.values,k7=function(e,t){if(e){if(e[aO]!==sO)try{il(e,aO,sO)}catch(n){e[aO]=sO}if(e[R7]||il(e,R7,t),O7[t]){for(var r in sg)if(e[r]!==sg[r])try{il(e,r,sg[r])}catch(n){e[r]=sg[r]}}}};for(var lO in O7)k7(At[lO]&&At[lO].prototype,lO);k7(Npe,"DOMTokenList");var jpe=Od.EXISTS,Upe=Ha.f,L7=Function.prototype,Hpe=ir(L7.toString),P7=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,zpe=ir(P7.exec);ua&&!jpe&&Upe(L7,"name",{configurable:!0,get:function(){try{return zpe(P7,Hpe(this))[1]}catch(e){return""}}});var Wpe=Cn("species"),Gpe=zp>=51||!Zr(function(){var e=[];return(e.constructor={})[Wpe]=function(){return{foo:1}},e.slice(Boolean).foo!==1}),Vpe=Cn("species"),uO=At.Array,Kpe=Math.max;function I7(e){return e.getMenuConfig("uploadVideo")}Ii({target:"Array",proto:!0,forced:!Gpe},{slice:function(e,t){var r,n,i,o=tl(this),a=Xp(o),s=$p(e,a),l=$p(t===void 0?a:t,a);if(Gy(o)&&(r=o.constructor,(ED(r)&&(r===uO||Gy(r.prototype))||qr(r)&&(r=r[Vpe])===null)&&(r=void 0),r===uO||r===void 0))return z9(o,s,l);for(n=new(r===void 0?uO:r)(Kpe(l-s,0)),i=0;s<l;s++,i++)s in o&&y7(n,i,o[s]);return n.length=i,n}});var M7=new WeakMap;function $pe(e,t){return Ty(this,void 0,void 0,function(){var r,n,i,o;return Ay(this,function(a){switch(a.label){case 0:return r=function(s){var l=M7.get(s);if(l!=null)return l;var u=I7(s),c=u.onSuccess,h=u.onProgress,S=u.onFailed,y=u.customInsert,W=u.onError;return l=B3(Cy(Cy({},u),{onProgress:function(B){s.showProgressBar(B),h&&h(B)},onSuccess:function(B,N){if(y)return y(N,function(De,Pe){return og(s,De,Pe)}),void c(B,N);var U=N.errno,D=U===void 0?1:U,Q=N.data,te=Q===void 0?{}:Q;if(D===0){var he=te.url,Ee=he===void 0?"":he,ve=te.poster;og(s,Ee,ve===void 0?"":ve),c(B,N)}else S(B,N)},onError:function(B,N,U){W(B,N,U)}})),M7.set(s,l),l}(e),n=t.name,i=t.type,o=t.size,r.addFile({name:n,type:i,size:o,data:t}),[4,r.upload()];case 1:return a.sent(),[2]}})})}var Xpe=function(){function e(){this.title=wt("videoModule.uploadVideo"),this.iconSvg='<svg viewBox="0 0 1056 1024"><path d="M805.902261 521.819882a251.441452 251.441452 0 0 0-251.011972 246.600033 251.051015 251.051015 0 1 0 502.023944 8.823877 253.237463 253.237463 0 0 0-251.011972-255.42391z m59.463561 240.001647v129.898403h-116.701631v-129.898403h-44.041298l101.279368-103.504859 101.279368 103.504859z" p-id="6802"></path><path d="M788.254507 0.000781H99.094092A98.663439 98.663439 0 0 0 0.001171 99.093701v590.067495a98.663439 98.663439 0 0 0 99.092921 99.092921h411.7549a266.434235 266.434235 0 0 1-2.186448-41.815807 275.843767 275.843767 0 0 1 275.180024-270.729042 270.650955 270.650955 0 0 1 103.504859 19.834201V99.093701A101.51363 101.51363 0 0 0 788.254507 0.000781zM295.054441 640.747004V147.507894l394.146189 246.600033z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.exec=function(t,r){var n=this.getMenuConfig(t),i=n.allowedFileTypes,o=i===void 0?[]:i,a=n.customBrowseAndUpload;if(a)a(function(c,h){return og(t,c,h)});else{var s="";o.length>0&&(s='accept="'+o.join(", ")+'"');var l=_e("body"),u=_e('<input type="file" '+s+" multiple/>");u.hide(),l.append(u),u.click(),u.on("change",function(){var c=u[0].files;!function(h,S){var y,W;Ty(this,void 0,void 0,function(){var B,N,U,D,Q,te;return Ay(this,function(he){switch(he.label){case 0:if(S==null)return[2];B=Array.prototype.slice.call(S),N=I7(h).customUpload,he.label=1;case 1:he.trys.push([1,9,10,15]),U=Kde(B),he.label=2;case 2:return[4,U.next()];case 3:return(D=he.sent()).done?[3,8]:(Q=D.value,N?[4,N(Q,function(Ee,ve){return og(h,Ee,ve)})]:[3,5]);case 4:return he.sent(),[3,7];case 5:return[4,$pe(h,Q)];case 6:he.sent(),he.label=7;case 7:return[3,2];case 8:return[3,15];case 9:return te=he.sent(),y={error:te},[3,15];case 10:return he.trys.push([10,,13,14]),D&&!D.done&&(W=U.return)?[4,W.call(U)]:[3,12];case 11:he.sent(),he.label=12;case 12:return[3,14];case 13:if(y)throw y.error;return[7];case 14:return[7];case 15:return[2]}})})}(t,c)})}},e.prototype.isDisabled=function(t){var r=t.selection;return r==null||!Qe.isCollapsed(r)||!!Ae.getSelectedElems(t).some(function(n){var i=Ae.getNodeType(n);return i==="pre"||i==="list-item"||!!t.isVoid(n)})},e.prototype.getMenuConfig=function(t){return t.getMenuConfig("uploadVideo")},e}(),Ype=Od.PROPER,cO=RegExp.prototype,B7=cO.toString,Zpe=ir(b9),Jpe=Zr(function(){return B7.call({source:"a",flags:"b"})!="/a/b"}),Qpe=Ype&&B7.name!="toString";function dO(){return k9("w-e-insert-video")}(Jpe||Qpe)&&Zi(RegExp.prototype,"toString",function(){var e=Jn(this),t=So(e.source),r=e.flags;return"/"+t+"/"+So(r===void 0&&Hp(cO,e)&&!("flags"in cO)?Zpe(e):r)},{unsafe:!0});var qpe=function(){function e(){this.title=wt("videoModule.editSize"),this.tag="button",this.showModal=!0,this.modalWidth=320,this.$content=null,this.widthInputId=dO(),this.heightInputId=dO(),this.buttonId=dO()}return e.prototype.getSelectedVideoNode=function(t){return Ae.getSelectedNodeByType(t,"video")},e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.exec=function(t,r){},e.prototype.isDisabled=function(t){return t.selection==null||this.getSelectedVideoNode(t)==null},e.prototype.getModalPositionNode=function(t){return this.getSelectedVideoNode(t)},e.prototype.getModalContentElem=function(t){var r=this,n=r.widthInputId,i=r.heightInputId,o=r.buttonId,a=ku(Wi(wt("videoModule.width"),n,"auto"),2),s=a[0],l=_e(a[1]),u=ku(Wi(wt("videoModule.height"),i,"auto"),2),c=u[0],h=_e(u[1]),S=ku(Zc(o,wt("videoModule.ok")),1)[0];if(this.$content==null){var y=_e("<div></div>");y.on("click","#"+o,function(te){te.preventDefault();var he=y.find("#"+n).val().trim(),Ee=y.find("#"+i).val().trim(),ve=parseInt(he),De=parseInt(Ee),Pe=ve?ve.toString():"auto",qe=De?De.toString():"auto";t.restoreSelection(),Ve.setNodes(t,{width:Pe,height:qe},{match:function(ot){return Ae.checkNodeType(ot,"video")}}),t.hidePanelOrModal()}),this.$content=y}var W=this.$content;W.empty(),W.append(s),W.append(c),W.append(S);var B=this.getSelectedVideoNode(t);if(B==null)return W[0];var N=B.width,U=N===void 0?"auto":N,D=B.height,Q=D===void 0?"auto":D;return l.val(U),h.val(Q),setTimeout(function(){l.focus()}),W[0]},e}(),ege={renderElems:[Xhe],elemsToHtml:[Yhe],preParseHtml:[qhe],parseElemsHtml:[sfe],menus:[{key:"insertVideo",factory:function(){return new upe},config:{onInsertedVideo:function(e){},checkVideo:function(e,t){return!0},parseVideoSrc:function(e){return e}}},{key:"uploadVideo",factory:function(){return new Xpe},config:{server:"",fieldName:"wangeditor-uploaded-video",maxFileSize:10485760,maxNumberOfFiles:5,allowedFileTypes:["video/*"],meta:{},metaWithUrl:!1,withCredentials:!1,timeout:3e4,onBeforeUpload:function(e){return e},onProgress:function(e){},onSuccess:function(e,t){},onFailed:function(e,t){console.error("'"+e.name+"' upload failed",t)},onError:function(e,t,r){console.error("'"+e.name+" upload error",t,r)}}},{key:"editVideoSize",factory:function(){return new qpe}}],editorPlugin:function(e){var t=e.isVoid,r=e.normalizeNode,n=e;return n.isVoid=function(i){return i.type==="video"||t(i)},n.normalizeNode=function(i){var o=ku(i,2),a=o[0],s=o[1];return Ae.getNodeType(a)==="video"&&Ae.isLastNode(n,a)&&Ve.insertNodes(n,Ae.genEmptyParagraph(),{at:[s[0]+1]}),r([a,s])},n}};Ri("en",{uploadImgModule:{uploadImage:"Upload Image",uploadError:"{{fileName}} upload error"}}),Ri("zh-CN",{uploadImgModule:{uploadImage:"\u4E0A\u4F20\u56FE\u7247",uploadError:"{{fileName}} \u4E0A\u4F20\u51FA\u9519"}});var F7=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof ze!="undefined"?ze:typeof self!="undefined"?self:{};function hO(e){var t={exports:{}};return e(t,t.exports),t.exports}var sl,ab,sb=function(e){return e&&e.Math==Math&&e},Tt=sb(typeof globalThis=="object"&&globalThis)||sb(typeof window=="object"&&window)||sb(typeof self=="object"&&self)||sb(typeof F7=="object"&&F7)||function(){return this}()||Function("return this")(),en=function(e){try{return!!e()}catch(t){return!0}},ha=!en(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),cg=Function.prototype.call,Fr=cg.bind?cg.bind(cg):function(){return cg.apply(cg,arguments)},N7={}.propertyIsEnumerable,j7=Object.getOwnPropertyDescriptor,tge={f:j7&&!N7.call({1:2},1)?function(e){var t=j7(this,e);return!!t&&t.enumerable}:N7},lb=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},U7=Function.prototype,fO=U7.bind,pO=U7.call,rge=fO&&fO.bind(pO),pr=fO?function(e){return e&&rge(pO,e)}:function(e){return e&&function(){return pO.apply(e,arguments)}},nge=pr({}.toString),ige=pr("".slice),jo=function(e){return ige(nge(e),8,-1)},gO=Tt.Object,oge=pr("".split),vO=en(function(){return!gO("z").propertyIsEnumerable(0)})?function(e){return jo(e)=="String"?oge(e,""):gO(e)}:gO,age=Tt.TypeError,dg=function(e){if(e==null)throw age("Can't call method on "+e);return e},ll=function(e){return vO(dg(e))},Vr=function(e){return typeof e=="function"},Jr=function(e){return typeof e=="object"?e!==null:Vr(e)},sge=function(e){return Vr(e)?e:void 0},ju=function(e,t){return arguments.length<2?sge(Tt[e]):Tt[e]&&Tt[e][t]},hg=pr({}.isPrototypeOf),Bd=ju("navigator","userAgent")||"",H7=Tt.process,z7=Tt.Deno,W7=H7&&H7.versions||z7&&z7.version,G7=W7&&W7.v8;G7&&(ab=(sl=G7.split("."))[0]>0&&sl[0]<4?1:+(sl[0]+sl[1])),!ab&&Bd&&(!(sl=Bd.match(/Edge\/(\d+)/))||sl[1]>=74)&&(sl=Bd.match(/Chrome\/(\d+)/))&&(ab=+sl[1]);var fg=ab,mO=!!Object.getOwnPropertySymbols&&!en(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&fg&&fg<41}),yO=mO&&!Symbol.sham&&typeof Symbol.iterator=="symbol",lge=Tt.Object,bO=yO?function(e){return typeof e=="symbol"}:function(e){var t=ju("Symbol");return Vr(t)&&hg(t.prototype,lge(e))},uge=Tt.String,ub=function(e){try{return uge(e)}catch(t){return"Object"}},cge=Tt.TypeError,ul=function(e){if(Vr(e))return e;throw cge(ub(e)+" is not a function")},pg=function(e,t){var r=e[t];return r==null?void 0:ul(r)},dge=Tt.TypeError,hge=Object.defineProperty,EO=function(e,t){try{hge(Tt,e,{value:t,configurable:!0,writable:!0})}catch(r){Tt[e]=t}return t},cl=Tt["__core-js_shared__"]||EO("__core-js_shared__",{}),xO=hO(function(e){(e.exports=function(t,r){return cl[t]||(cl[t]=r!==void 0?r:{})})("versions",[]).push({version:"3.19.3",mode:"global",copyright:"\xA9 2021 Denis Pushkarev (zloirock.ru)"})}),fge=Tt.Object,SO=function(e){return fge(dg(e))},pge=pr({}.hasOwnProperty),Nn=Object.hasOwn||function(e,t){return pge(SO(e),t)},gge=0,vge=Math.random(),mge=pr(1 .toString),wO=function(e){return"Symbol("+(e===void 0?"":e)+")_"+mge(++gge+vge,36)},gg=xO("wks"),Uu=Tt.Symbol,V7=Uu&&Uu.for,yge=yO?Uu:Uu&&Uu.withoutSetter||wO,Tn=function(e){if(!Nn(gg,e)||!mO&&typeof gg[e]!="string"){var t="Symbol."+e;mO&&Nn(Uu,e)?gg[e]=Uu[e]:gg[e]=yO&&V7?V7(t):yge(t)}return gg[e]},bge=Tt.TypeError,Ege=Tn("toPrimitive"),CO=function(e){var t=function(r,n){if(!Jr(r)||bO(r))return r;var i,o=pg(r,Ege);if(o){if(n===void 0&&(n="default"),i=Fr(o,r,n),!Jr(i)||bO(i))return i;throw bge("Can't convert object to primitive value")}return n===void 0&&(n="number"),function(a,s){var l,u;if(s==="string"&&Vr(l=a.toString)&&!Jr(u=Fr(l,a)))return u;if(Vr(l=a.valueOf)&&!Jr(u=Fr(l,a)))return u;if(s!=="string"&&Vr(l=a.toString)&&!Jr(u=Fr(l,a)))return u;throw dge("Can't convert object to primitive value")}(r,n)}(e,"string");return bO(t)?t:t+""},TO=Tt.document,xge=Jr(TO)&&Jr(TO.createElement),vg=function(e){return xge?TO.createElement(e):{}},K7=!ha&&!en(function(){return Object.defineProperty(vg("div"),"a",{get:function(){return 7}}).a!=7}),$7=Object.getOwnPropertyDescriptor,AO={f:ha?$7:function(e,t){if(e=ll(e),t=CO(t),K7)try{return $7(e,t)}catch(r){}if(Nn(e,t))return lb(!Fr(tge.f,e,t),e[t])}},Sge=Tt.String,wge=Tt.TypeError,Qn=function(e){if(Jr(e))return e;throw wge(Sge(e)+" is not an object")},Cge=Tt.TypeError,X7=Object.defineProperty,Wa={f:ha?X7:function(e,t,r){if(Qn(e),t=CO(t),Qn(r),K7)try{return X7(e,t,r)}catch(n){}if("get"in r||"set"in r)throw Cge("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},fa=ha?function(e,t,r){return Wa.f(e,t,lb(1,r))}:function(e,t,r){return e[t]=r,e},Tge=pr(Function.toString);Vr(cl.inspectSource)||(cl.inspectSource=function(e){return Tge(e)});var cb,mg,db,hb=cl.inspectSource,Y7=Tt.WeakMap,Z7=Vr(Y7)&&/native code/.test(hb(Y7)),J7=xO("keys"),DO=function(e){return J7[e]||(J7[e]=wO(e))},fb={},OO=Tt.TypeError,Age=Tt.WeakMap;if(Z7||cl.state){var Hu=cl.state||(cl.state=new Age),Dge=pr(Hu.get),Q7=pr(Hu.has),Oge=pr(Hu.set);cb=function(e,t){if(Q7(Hu,e))throw new OO("Object already initialized");return t.facade=e,Oge(Hu,e,t),t},mg=function(e){return Dge(Hu,e)||{}},db=function(e){return Q7(Hu,e)}}else{var Fd=DO("state");fb[Fd]=!0,cb=function(e,t){if(Nn(e,Fd))throw new OO("Object already initialized");return t.facade=e,fa(e,Fd,t),t},mg=function(e){return Nn(e,Fd)?e[Fd]:{}},db=function(e){return Nn(e,Fd)}}var Ji={set:cb,get:mg,has:db,enforce:function(e){return db(e)?mg(e):cb(e,{})},getterFor:function(e){return function(t){var r;if(!Jr(t)||(r=mg(t)).type!==e)throw OO("Incompatible receiver, "+e+" required");return r}}},q7=Function.prototype,_ge=ha&&Object.getOwnPropertyDescriptor,_O=Nn(q7,"name"),yg={EXISTS:_O,PROPER:_O&&function(){}.name==="something",CONFIGURABLE:_O&&(!ha||ha&&_ge(q7,"name").configurable)},Qi=hO(function(e){var t=yg.CONFIGURABLE,r=Ji.get,n=Ji.enforce,i=String(String).split("String");(e.exports=function(o,a,s,l){var u,c=!!l&&!!l.unsafe,h=!!l&&!!l.enumerable,S=!!l&&!!l.noTargetGet,y=l&&l.name!==void 0?l.name:a;Vr(s)&&(String(y).slice(0,7)==="Symbol("&&(y="["+String(y).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!Nn(s,"name")||t&&s.name!==y)&&fa(s,"name",y),(u=n(s)).source||(u.source=i.join(typeof y=="string"?y:""))),o!==Tt?(c?!S&&o[a]&&(h=!0):delete o[a],h?o[a]=s:fa(o,a,s)):h?o[a]=s:EO(a,s)})(Function.prototype,"toString",function(){return Vr(this)&&r(this).source||hb(this)})}),Rge=Math.ceil,kge=Math.floor,RO=function(e){var t=+e;return t!=t||t===0?0:(t>0?kge:Rge)(t)},Lge=Math.max,Pge=Math.min,bg=function(e,t){var r=RO(e);return r<0?Lge(r+t,0):Pge(r,t)},Ige=Math.min,ej=function(e){return e>0?Ige(RO(e),9007199254740991):0},Eg=function(e){return ej(e.length)},tj=function(e){return function(t,r,n){var i,o=ll(t),a=Eg(o),s=bg(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},Mge=(tj(!0),tj(!1)),rj=pr([].push),nj=function(e,t){var r,n=ll(e),i=0,o=[];for(r in n)!Nn(fb,r)&&Nn(n,r)&&rj(o,r);for(;t.length>i;)Nn(n,r=t[i++])&&(~Mge(o,r)||rj(o,r));return o},pb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Bge=pb.concat("length","prototype"),gb={f:Object.getOwnPropertyNames||function(e){return nj(e,Bge)}},Fge={f:Object.getOwnPropertySymbols},Nge=pr([].concat),jge=ju("Reflect","ownKeys")||function(e){var t=gb.f(Qn(e)),r=Fge.f;return r?Nge(t,r(e)):t},Uge=function(e,t){for(var r=jge(t),n=Wa.f,i=AO.f,o=0;o<r.length;o++){var a=r[o];Nn(e,a)||n(e,a,i(t,a))}},Hge=/#|\.prototype\./,xg=function(e,t){var r=Wge[zge(e)];return r==Vge||r!=Gge&&(Vr(t)?en(t):!!t)},zge=xg.normalize=function(e){return String(e).replace(Hge,".").toLowerCase()},Wge=xg.data={},Gge=xg.NATIVE="N",Vge=xg.POLYFILL="P",vb=xg,Kge=AO.f,pa=function(e,t){var r,n,i,o,a,s=e.target,l=e.global,u=e.stat;if(r=l?Tt:u?Tt[s]||EO(s,{}):(Tt[s]||{}).prototype)for(n in t){if(o=t[n],i=e.noTargetGet?(a=Kge(r,n))&&a.value:r[n],!vb(l?n:s+(u?".":"#")+n,e.forced)&&i!==void 0){if(typeof o==typeof i)continue;Uge(o,i)}(e.sham||i&&i.sham)&&fa(o,"sham",!0),Qi(r,n,o,e)}},mb=Array.isArray||function(e){return jo(e)=="Array"},ij={};ij[Tn("toStringTag")]="z";var kO=String(ij)==="[object z]",$ge=Tn("toStringTag"),Xge=Tt.Object,Yge=jo(function(){return arguments}())=="Arguments",yb=kO?jo:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=function(i,o){try{return i[o]}catch(a){}}(t=Xge(e),$ge))=="string"?r:Yge?jo(t):(n=jo(t))=="Object"&&Vr(t.callee)?"Arguments":n},oj=function(){},Zge=[],aj=ju("Reflect","construct"),LO=/^\s*(?:class|function)\b/,Jge=pr(LO.exec),Qge=!LO.exec(oj),Sg=function(e){if(!Vr(e))return!1;try{return aj(oj,Zge,e),!0}catch(t){return!1}},PO=!aj||en(function(){var e;return Sg(Sg.call)||!Sg(Object)||!Sg(function(){e=!0})||e})?function(e){if(!Vr(e))return!1;switch(yb(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return Qge||!!Jge(LO,hb(e))}:Sg,sj=function(e,t,r){var n=CO(t);n in e?Wa.f(e,n,lb(0,r)):e[n]=r},qge=Tn("species"),lj=pr([].slice),eve=fg>=51||!en(function(){var e=[];return(e.constructor={})[qge]=function(){return{foo:1}},e.slice(Boolean).foo!==1}),tve=Tn("species"),IO=Tt.Array,rve=Math.max;pa({target:"Array",proto:!0,forced:!eve},{slice:function(e,t){var r,n,i,o=ll(this),a=Eg(o),s=bg(e,a),l=bg(t===void 0?a:t,a);if(mb(o)&&(r=o.constructor,(PO(r)&&(r===IO||mb(r.prototype))||Jr(r)&&(r=r[tve])===null)&&(r=void 0),r===IO||r===void 0))return lj(o,s,l);for(n=new(r===void 0?IO:r)(rve(l-s,0)),i=0;s<l;s++,i++)s in o&&sj(n,i,o[s]);return n.length=i,n}});var nve=kO?{}.toString:function(){return"[object "+yb(this)+"]"};kO||Qi(Object.prototype,"toString",nve,{unsafe:!0});var bb,ive=Tt.String,dl=function(e){if(yb(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return ive(e)},uj=function(){var e=Qn(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},MO=Tt.RegExp,BO=en(function(){var e=MO("a","y");return e.lastIndex=2,e.exec("abcd")!=null}),ove=BO||en(function(){return!MO("a","y").sticky}),cj={BROKEN_CARET:BO||en(function(){var e=MO("^r","gy");return e.lastIndex=2,e.exec("str")!=null}),MISSED_STICKY:ove,UNSUPPORTED_Y:BO},ave=Object.keys||function(e){return nj(e,pb)},sve=ha?Object.defineProperties:function(e,t){Qn(e);for(var r,n=ll(t),i=ave(t),o=i.length,a=0;o>a;)Wa.f(e,r=i[a++],n[r]);return e},FO=ju("document","documentElement"),dj=DO("IE_PROTO"),NO=function(){},hj=function(e){return"<script>"+e+"</script>"},fj=function(e){e.write(hj("")),e.close();var t=e.parentWindow.Object;return e=null,t},Eb=function(){try{bb=new ActiveXObject("htmlfile")}catch(n){}var e,t;Eb=typeof document!="undefined"?document.domain&&bb?fj(bb):((t=vg("iframe")).style.display="none",FO.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(hj("document.F=Object")),e.close(),e.F):fj(bb);for(var r=pb.length;r--;)delete Eb.prototype[pb[r]];return Eb()};fb[dj]=!0;var pj,jO,UO=Object.create||function(e,t){var r;return e!==null?(NO.prototype=Qn(e),r=new NO,NO.prototype=null,r[dj]=e):r=Eb(),t===void 0?r:sve(r,t)},lve=Tt.RegExp,uve=en(function(){var e=lve(".","s");return!(e.dotAll&&e.exec(`
|
|
|
`)&&e.flags==="s")}),cve=Tt.RegExp,dve=en(function(){var e=cve("(?<a>b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$<a>c")!=="bc"}),hve=Ji.get,fve=xO("native-string-replace",String.prototype.replace),xb=RegExp.prototype.exec,HO=xb,pve=pr("".charAt),gve=pr("".indexOf),vve=pr("".replace),zO=pr("".slice),WO=(jO=/b*/g,Fr(xb,pj=/a/,"a"),Fr(xb,jO,"a"),pj.lastIndex!==0||jO.lastIndex!==0),gj=cj.BROKEN_CARET,GO=/()??/.exec("")[1]!==void 0;(WO||GO||gj||uve||dve)&&(HO=function(e){var t,r,n,i,o,a,s,l=this,u=hve(l),c=dl(e),h=u.raw;if(h)return h.lastIndex=l.lastIndex,t=Fr(HO,h,c),l.lastIndex=h.lastIndex,t;var S=u.groups,y=gj&&l.sticky,W=Fr(uj,l),B=l.source,N=0,U=c;if(y&&(W=vve(W,"y",""),gve(W,"g")===-1&&(W+="g"),U=zO(c,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&pve(c,l.lastIndex-1)!==`
|
|
|
`)&&(B="(?: "+B+")",U=" "+U,N++),r=new RegExp("^(?:"+B+")",W)),GO&&(r=new RegExp("^"+B+"$(?!\\s)",W)),WO&&(n=l.lastIndex),i=Fr(xb,y?r:l,U),y?i?(i.input=zO(i.input,N),i[0]=zO(i[0],N),i.index=l.lastIndex,l.lastIndex+=i[0].length):l.lastIndex=0:WO&&i&&(l.lastIndex=l.global?i.index+i[0].length:n),GO&&i&&i.length>1&&Fr(fve,i[0],r,function(){for(o=1;o<arguments.length-2;o++)arguments[o]===void 0&&(i[o]=void 0)}),i&&S)for(i.groups=a=UO(null),o=0;o<S.length;o++)a[(s=S[o])[0]]=i[s[1]];return i});var wg=HO;pa({target:"RegExp",proto:!0,forced:/./.exec!==wg},{exec:wg});var VO=Function.prototype,vj=VO.apply,mve=VO.bind,mj=VO.call,yj=typeof Reflect=="object"&&Reflect.apply||(mve?mj.bind(vj):function(){return mj.apply(vj,arguments)}),yve=Tn("species"),KO=RegExp.prototype,bve=Tn("match"),Eve=Tt.TypeError,xve=Tn("species"),bj=function(e,t){var r,n=Qn(e).constructor;return n===void 0||(r=Qn(n)[xve])==null?t:function(i){if(PO(i))return i;throw Eve(ub(i)+" is not a constructor")}(r)},Sve=pr("".charAt),Ej=pr("".charCodeAt),wve=pr("".slice),xj=function(e){return function(t,r){var n,i,o=dl(dg(t)),a=RO(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=Ej(o,a))<55296||n>56319||a+1===s||(i=Ej(o,a+1))<56320||i>57343?e?Sve(o,a):n:e?wve(o,a,a+2):i-56320+(n-55296<<10)+65536}},Sj={codeAt:xj(!1),charAt:xj(!0)},Cve=Sj.charAt,Tve=function(e,t,r){return t+(r?Cve(e,t).length:1)},Ave=Tt.Array,Dve=Math.max,$O=function(e,t,r){for(var n=Eg(e),i=bg(t,n),o=bg(r===void 0?n:r,n),a=Ave(Dve(o-i,0)),s=0;i<o;i++,s++)sj(a,s,e[i]);return a.length=s,a},Ove=Tt.TypeError,wj=function(e,t){var r=e.exec;if(Vr(r)){var n=Fr(r,e,t);return n!==null&&Qn(n),n}if(jo(e)==="RegExp")return Fr(wg,e,t);throw Ove("RegExp#exec called on incompatible receiver")},Nd=cj.UNSUPPORTED_Y,_ve=Math.min,Cj=[].push,Rve=pr(/./.exec),jd=pr(Cj),Cg=pr("".slice);!function(e,t,r,n){var i=Tn(e),o=!en(function(){var u={};return u[i]=function(){return 7},""[e](u)!=7}),a=o&&!en(function(){var u=!1,c=/a/;return(c={}).constructor={},c.constructor[yve]=function(){return c},c.flags="",c[i]=/./[i],c.exec=function(){return u=!0,null},c[i](""),!u});if(!o||!a||r){var s=pr(/./[i]),l=function(u,c,h){var S;return S="abbc".split(/(b)*/)[1]=="c"||"test".split(/(?:)/,-1).length!=4||"ab".split(/(?:ab)*/).length!=2||".".split(/(.?)(.?)/).length!=4||".".split(/()()/).length>1||"".split(/.?/).length?function(y,W){var B,N,U=dl(dg(this)),D=W===void 0?4294967295:W>>>0;if(D===0)return[];if(y===void 0)return[U];if(!Jr(B=y)||!((N=B[bve])!==void 0?N:jo(B)=="RegExp"))return Fr(c,U,y,D);for(var Q,te,he,Ee=[],ve=(y.ignoreCase?"i":"")+(y.multiline?"m":"")+(y.unicode?"u":"")+(y.sticky?"y":""),De=0,Pe=new RegExp(y.source,ve+"g");(Q=Fr(wg,Pe,U))&&!((te=Pe.lastIndex)>De&&(jd(Ee,Cg(U,De,Q.index)),Q.length>1&&Q.index<U.length&&yj(Cj,Ee,$O(Q,1)),he=Q[0].length,De=te,Ee.length>=D));)Pe.lastIndex===Q.index&&Pe.lastIndex++;return De===U.length?!he&&Rve(Pe,"")||jd(Ee,""):jd(Ee,Cg(U,De)),Ee.length>D?$O(Ee,0,D):Ee}:"0".split(void 0,0).length?function(y,W){return y===void 0&&W===0?[]:Fr(c,this,y,W)}:c,[function(y,W){var B=dg(this),N=y==null?void 0:pg(y,u);return N?Fr(N,y,B,W):Fr(S,dl(B),y,W)},function(y,W){var B=Qn(this),N=dl(y),U=h(S,B,N,W,S!==c);if(U.done)return U.value;var D=bj(B,RegExp),Q=B.unicode,te=(B.ignoreCase?"i":"")+(B.multiline?"m":"")+(B.unicode?"u":"")+(Nd?"g":"y"),he=new D(Nd?"^(?:"+B.source+")":B,te),Ee=W===void 0?4294967295:W>>>0;if(Ee===0)return[];if(N.length===0)return wj(he,N)===null?[N]:[];for(var ve=0,De=0,Pe=[];De<N.length;){he.lastIndex=Nd?0:De;var qe,ot=wj(he,Nd?Cg(N,De):N);if(ot===null||(qe=_ve(ej(he.lastIndex+(Nd?De:0)),N.length))===ve)De=Tve(N,De,Q);else{if(jd(Pe,Cg(N,ve,De)),Pe.length===Ee)return Pe;for(var et=1;et<=ot.length-1;et++)if(jd(Pe,ot[et]),Pe.length===Ee)return Pe;De=ve=qe}}return jd(Pe,Cg(N,ve)),Pe}]}(i,""[e],function(u,c,h,S,y){var W=pr(u),B=c.exec;return B===wg||B===KO.exec?o&&!y?{done:!0,value:s(c,h,S)}:{done:!0,value:W(h,c,S)}:{done:!1}});Qi(String.prototype,e,l[0]),Qi(KO,i,l[1])}n&&fa(KO[i],"sham",!0)}("split",0,!!en(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return r.length!==2||r[0]!=="a"||r[1]!=="b"}),Nd);/*! *****************************************************************************
|
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
purpose with or without fee is hereby granted.
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
|
***************************************************************************** */var Sb=function(){return Sb=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Sb.apply(this,arguments)};function XO(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(u){try{l(n.next(u))}catch(c){o(c)}}function s(u){try{l(n.throw(u))}catch(c){o(c)}}function l(u){var c;u.done?i(u.value):(c=u.value,c instanceof r?c:new r(function(h){h(c)})).then(a,s)}l((n=n.apply(e,t||[])).next())})}function YO(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(u){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||c[0]!==6&&c[0]!==2)){a=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){a.label=c[1];break}if(c[0]===6&&a.label<i[1]){a.label=i[1],i=c;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(c);break}i[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(h){c=[6,h],n=0}finally{r=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([l,u])}}}function kve(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=function(i){var o=typeof Symbol=="function"&&Symbol.iterator,a=o&&i[o],s=0;if(a)return a.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&s>=i.length&&(i=void 0),{value:i&&i[s++],done:!i}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=e[i]&&function(o){return new Promise(function(a,s){!function(l,u,c,h){Promise.resolve(h).then(function(S){l({value:S,done:c})},u)}(a,s,(o=e[i](o)).done,o.value)})}}}var ZO=Tn("unscopables"),JO=Array.prototype;JO[ZO]==null&&Wa.f(JO,ZO,{configurable:!0,value:UO(null)});var zu,Tj,Aj,QO=function(e){JO[ZO][e]=!0},Ud={},Lve=!en(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Dj=DO("IE_PROTO"),qO=Tt.Object,Pve=qO.prototype,wb=Lve?qO.getPrototypeOf:function(e){var t=SO(e);if(Nn(t,Dj))return t[Dj];var r=t.constructor;return Vr(r)&&t instanceof r?r.prototype:t instanceof qO?Pve:null},e_=Tn("iterator"),Oj=!1;[].keys&&("next"in(Aj=[].keys())?(Tj=wb(wb(Aj)))!==Object.prototype&&(zu=Tj):Oj=!0);var Ive=zu==null||en(function(){var e={};return zu[e_].call(e)!==e});Ive&&(zu={}),Vr(zu[e_])||Qi(zu,e_,function(){return this});var t_={IteratorPrototype:zu,BUGGY_SAFARI_ITERATORS:Oj},Mve=Wa.f,_j=Tn("toStringTag"),Cb=function(e,t,r){e&&!Nn(e=r?e:e.prototype,_j)&&Mve(e,_j,{configurable:!0,value:t})},Bve=t_.IteratorPrototype,Fve=function(){return this},Nve=Tt.String,jve=Tt.TypeError,Hd=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=pr(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(n){}return function(n,i){return Qn(n),function(o){if(typeof o=="object"||Vr(o))return o;throw jve("Can't set "+Nve(o)+" as a prototype")}(i),t?e(n,i):n.__proto__=i,n}}():void 0),Uve=yg.PROPER,Hve=yg.CONFIGURABLE,Rj=t_.IteratorPrototype,Tb=t_.BUGGY_SAFARI_ITERATORS,Tg=Tn("iterator"),zve=function(){return this},kj=function(e,t,r,n,i,o,a){!function(U,D,Q,te){var he=D+" Iterator";U.prototype=UO(Bve,{next:lb(1,Q)}),Cb(U,he,!1),Ud[he]=Fve}(r,t,n);var s,l,u,c=function(U){if(U===i&&B)return B;if(!Tb&&U in y)return y[U];switch(U){case"keys":case"values":case"entries":return function(){return new r(this,U)}}return function(){return new r(this)}},h=t+" Iterator",S=!1,y=e.prototype,W=y[Tg]||y["@@iterator"]||i&&y[i],B=!Tb&&W||c(i),N=t=="Array"&&y.entries||W;if(N&&(s=wb(N.call(new e)))!==Object.prototype&&s.next&&(wb(s)!==Rj&&(Hd?Hd(s,Rj):Vr(s[Tg])||Qi(s,Tg,zve)),Cb(s,h,!0)),Uve&&i=="values"&&W&&W.name!=="values"&&(Hve?fa(y,"name","values"):(S=!0,B=function(){return Fr(W,this)})),i)if(l={values:c("values"),keys:o?B:c("keys"),entries:c("entries")},a)for(u in l)(Tb||S||!(u in y))&&Qi(y,u,l[u]);else pa({target:t,proto:!0,forced:Tb||S},l);return y[Tg]!==B&&Qi(y,Tg,B,{name:i}),Ud[t]=B,l},Wve=Ji.set,Gve=Ji.getterFor("Array Iterator"),Ag=kj(Array,"Array",function(e,t){Wve(this,{type:"Array Iterator",target:ll(e),index:0,kind:t})},function(){var e=Gve(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):r=="keys"?{value:n,done:!1}:r=="values"?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values");Ud.Arguments=Ud.Array,QO("keys"),QO("values"),QO("entries");var Vve=Sj.charAt,Kve=Ji.set,$ve=Ji.getterFor("String Iterator");kj(String,"String",function(e){Kve(this,{type:"String Iterator",string:dl(e),index:0})},function(){var e,t=$ve(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=Vve(r,n),t.index+=e.length,{value:e,done:!1})});var Ab=function(e,t,r){for(var n in t)Qi(e,n,t[n],r);return e},Lj=gb.f,Pj=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Xve={f:function(e){return Pj&&jo(e)=="Window"?function(t){try{return Lj(t)}catch(r){return $O(Pj)}}(e):Lj(ll(e))}},Ij=en(function(){if(typeof ArrayBuffer=="function"){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}),Db=Object.isExtensible,Wu=en(function(){Db(1)})||Ij?function(e){return!!Jr(e)&&(!Ij||jo(e)!="ArrayBuffer")&&(!Db||Db(e))}:Db,Yve=!en(function(){return Object.isExtensible(Object.preventExtensions({}))}),r_=hO(function(e){var t=Wa.f,r=!1,n=wO("meta"),i=0,o=function(s){t(s,n,{value:{objectID:"O"+i++,weakData:{}}})},a=e.exports={enable:function(){a.enable=function(){},r=!0;var s=gb.f,l=pr([].splice),u={};u[n]=1,s(u).length&&(gb.f=function(c){for(var h=s(c),S=0,y=h.length;S<y;S++)if(h[S]===n){l(h,S,1);break}return h},pa({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Xve.f}))},fastKey:function(s,l){if(!Jr(s))return typeof s=="symbol"?s:(typeof s=="string"?"S":"P")+s;if(!Nn(s,n)){if(!Wu(s))return"F";if(!l)return"E";o(s)}return s[n].objectID},getWeakData:function(s,l){if(!Nn(s,n)){if(!Wu(s))return!0;if(!l)return!1;o(s)}return s[n].weakData},onFreeze:function(s){return Yve&&r&&Wu(s)&&!Nn(s,n)&&o(s),s}};fb[n]=!0}),Mj=pr(pr.bind),Dg=function(e,t){return ul(e),t===void 0?e:Mj?Mj(e,t):function(){return e.apply(t,arguments)}},Zve=Tn("iterator"),Jve=Array.prototype,Qve=Tn("iterator"),Bj=function(e){if(e!=null)return pg(e,Qve)||pg(e,"@@iterator")||Ud[yb(e)]},qve=Tt.TypeError,Fj=function(e,t,r){var n,i;Qn(e);try{if(!(n=pg(e,"return"))){if(t==="throw")throw r;return r}n=Fr(n,e)}catch(o){i=!0,n=o}if(t==="throw")throw r;if(i)throw n;return Qn(n),r},eme=Tt.TypeError,Ob=function(e,t){this.stopped=e,this.result=t},Nj=Ob.prototype,_b=function(e,t,r){var n,i,o,a,s,l,u,c,h=r&&r.that,S=!(!r||!r.AS_ENTRIES),y=!(!r||!r.IS_ITERATOR),W=!(!r||!r.INTERRUPTED),B=Dg(t,h),N=function(D){return n&&Fj(n,"normal",D),new Ob(!0,D)},U=function(D){return S?(Qn(D),W?B(D[0],D[1],N):B(D[0],D[1])):W?B(D,N):B(D)};if(y)n=e;else{if(!(i=Bj(e)))throw eme(ub(e)+" is not iterable");if((c=i)!==void 0&&(Ud.Array===c||Jve[Zve]===c)){for(o=0,a=Eg(e);a>o;o++)if((s=U(e[o]))&&hg(Nj,s))return s;return new Ob(!1)}n=function(D,Q){var te=arguments.length<2?Bj(D):Q;if(ul(te))return Qn(Fr(te,D));throw qve(ub(D)+" is not iterable")}(e,i)}for(l=n.next;!(u=Fr(l,n)).done;){try{s=U(u.value)}catch(D){Fj(n,"throw",D)}if(typeof s=="object"&&s&&hg(Nj,s))return s}return new Ob(!1)},tme=Tt.TypeError,n_=function(e,t){if(hg(t,e))return e;throw tme("Incorrect invocation")},jj=Tn("iterator"),Uj=!1;try{var rme=0,Hj={next:function(){return{done:!!rme++}},return:function(){Uj=!0}};Hj[jj]=function(){return this},Array.from(Hj,function(){throw 2})}catch(e){}var zj=function(e,t){if(!t&&!Uj)return!1;var r=!1;try{var n={};n[jj]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(i){}return r},nme=Tn("species"),Wj=Tt.Array,ime=function(e,t){return new(function(r){var n;return mb(r)&&(n=r.constructor,(PO(n)&&(n===Wj||mb(n.prototype))||Jr(n)&&(n=n[nme])===null)&&(n=void 0)),n===void 0?Wj:n}(e))(t===0?0:t)},Gj=pr([].push),hl=function(e){var t=e==1,r=e==2,n=e==3,i=e==4,o=e==6,a=e==7,s=e==5||o;return function(l,u,c,h){for(var S,y,W=SO(l),B=vO(W),N=Dg(u,c),U=Eg(B),D=0,Q=h||ime,te=t?Q(l,U):r||a?Q(l,0):void 0;U>D;D++)if((s||D in B)&&(y=N(S=B[D],D,W),e))if(t)te[D]=y;else if(y)switch(e){case 3:return!0;case 5:return S;case 6:return D;case 2:Gj(te,S)}else switch(e){case 4:return!1;case 7:Gj(te,S)}return o?-1:n||i?i:te}},i_={forEach:hl(0),map:hl(1),filter:hl(2),some:hl(3),every:hl(4),find:hl(5),findIndex:hl(6),filterReject:hl(7)},Rb=r_.getWeakData,ome=Ji.set,ame=Ji.getterFor,sme=i_.find,lme=i_.findIndex,ume=pr([].splice),cme=0,kb=function(e){return e.frozen||(e.frozen=new Vj)},Vj=function(){this.entries=[]},o_=function(e,t){return sme(e.entries,function(r){return r[0]===t})};Vj.prototype={get:function(e){var t=o_(this,e);if(t)return t[1]},has:function(e){return!!o_(this,e)},set:function(e,t){var r=o_(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=lme(this.entries,function(r){return r[0]===e});return~t&&ume(this.entries,t,1),!!~t}};var Og,Kj={getConstructor:function(e,t,r,n){var i=e(function(l,u){n_(l,o),ome(l,{type:t,id:cme++,frozen:void 0}),u!=null&&_b(u,l[n],{that:l,AS_ENTRIES:r})}),o=i.prototype,a=ame(t),s=function(l,u,c){var h=a(l),S=Rb(Qn(u),!0);return S===!0?kb(h).set(u,c):S[h.id]=c,l};return Ab(o,{delete:function(l){var u=a(this);if(!Jr(l))return!1;var c=Rb(l);return c===!0?kb(u).delete(l):c&&Nn(c,u.id)&&delete c[u.id]},has:function(l){var u=a(this);if(!Jr(l))return!1;var c=Rb(l);return c===!0?kb(u).has(l):c&&Nn(c,u.id)}}),Ab(o,r?{get:function(l){var u=a(this);if(Jr(l)){var c=Rb(l);return c===!0?kb(u).get(l):c?c[u.id]:void 0}},set:function(l,u){return s(this,l,u)}}:{add:function(l){return s(this,l,!0)}}),i}},Lb=Ji.enforce,dme=!Tt.ActiveXObject&&"ActiveXObject"in Tt,$j=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},hme=function(e,t,r){var n=e.indexOf("Map")!==-1,i=e.indexOf("Weak")!==-1,o=n?"set":"add",a=Tt[e],s=a&&a.prototype,l=a,u={},c=function(N){var U=pr(s[N]);Qi(s,N,N=="add"?function(D){return U(this,D===0?0:D),this}:N=="delete"?function(D){return!(i&&!Jr(D))&&U(this,D===0?0:D)}:N=="get"?function(D){return i&&!Jr(D)?void 0:U(this,D===0?0:D)}:N=="has"?function(D){return!(i&&!Jr(D))&&U(this,D===0?0:D)}:function(D,Q){return U(this,D===0?0:D,Q),this})};if(vb(e,!Vr(a)||!(i||s.forEach&&!en(function(){new a().entries().next()}))))l=r.getConstructor(t,e,n,o),r_.enable();else if(vb(e,!0)){var h=new l,S=h[o](i?{}:-0,1)!=h,y=en(function(){h.has(1)}),W=zj(function(N){new a(N)}),B=!i&&en(function(){for(var N=new a,U=5;U--;)N[o](U,U);return!N.has(-0)});W||((l=t(function(N,U){n_(N,s);var D=function(Q,te,he){var Ee,ve;return Hd&&Vr(Ee=te.constructor)&&Ee!==he&&Jr(ve=Ee.prototype)&&ve!==he.prototype&&Hd(Q,ve),Q}(new a,N,l);return U!=null&&_b(U,D[o],{that:D,AS_ENTRIES:n}),D})).prototype=s,s.constructor=l),(y||B)&&(c("delete"),c("has"),n&&c("get")),(B||S)&&c(o),i&&s.clear&&delete s.clear}return u[e]=l,pa({global:!0,forced:l!=a},u),Cb(l,e),i||r.setStrong(l,e,n),l}("WeakMap",$j,Kj);if(Z7&&dme){Og=Kj.getConstructor($j,"WeakMap",!0),r_.enable();var _g=hme.prototype,Xj=pr(_g.delete),Pb=pr(_g.has),Yj=pr(_g.get),Zj=pr(_g.set);Ab(_g,{delete:function(e){if(Jr(e)&&!Wu(e)){var t=Lb(this);return t.frozen||(t.frozen=new Og),Xj(this,e)||t.frozen.delete(e)}return Xj(this,e)},has:function(e){if(Jr(e)&&!Wu(e)){var t=Lb(this);return t.frozen||(t.frozen=new Og),Pb(this,e)||t.frozen.has(e)}return Pb(this,e)},get:function(e){if(Jr(e)&&!Wu(e)){var t=Lb(this);return t.frozen||(t.frozen=new Og),Pb(this,e)?Yj(this,e):t.frozen.get(e)}return Yj(this,e)},set:function(e,t){if(Jr(e)&&!Wu(e)){var r=Lb(this);r.frozen||(r.frozen=new Og),Pb(this,e)?Zj(this,e,t):r.frozen.set(e,t)}else Zj(this,e,t);return this}})}var Ib={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},a_=vg("span").classList,Jj=a_&&a_.constructor&&a_.constructor.prototype,Qj=Jj===Object.prototype?void 0:Jj,s_=Tn("iterator"),qj=Tn("toStringTag"),l_=Ag.values,eU=function(e,t){if(e){if(e[s_]!==l_)try{fa(e,s_,l_)}catch(n){e[s_]=l_}if(e[qj]||fa(e,qj,t),Ib[t]){for(var r in Ag)if(e[r]!==Ag[r])try{fa(e,r,Ag[r])}catch(n){e[r]=Ag[r]}}}};for(var u_ in Ib)eU(Tt[u_]&&Tt[u_].prototype,u_);eU(Qj,"DOMTokenList");var tU=function(e,t){var r=[][e];return!!r&&en(function(){r.call(null,t||function(){throw 1},1)})},fme=i_.forEach,c_=tU("forEach")?[].forEach:function(e){return fme(this,e,arguments.length>1?arguments[1]:void 0)},rU=function(e){if(e&&e.forEach!==c_)try{fa(e,"forEach",c_)}catch(t){e.forEach=c_}};for(var d_ in Ib)Ib[d_]&&rU(Tt[d_]&&Tt[d_].prototype);rU(Qj);var Rg,zd,nU,h_,Mb=Tt.Promise,iU=Tn("species"),oU=/(?:ipad|iphone|ipod).*applewebkit/i.test(Bd),fl=jo(Tt.process)=="process",f_=Tt.setImmediate,p_=Tt.clearImmediate,pme=Tt.process,g_=Tt.Dispatch,gme=Tt.Function,aU=Tt.MessageChannel,vme=Tt.String,v_=0,kg={};try{Rg=Tt.location}catch(e){}var m_=function(e){if(Nn(kg,e)){var t=kg[e];delete kg[e],t()}},y_=function(e){return function(){m_(e)}},sU=function(e){m_(e.data)},lU=function(e){Tt.postMessage(vme(e),Rg.protocol+"//"+Rg.host)};f_&&p_||(f_=function(e){var t=lj(arguments,1);return kg[++v_]=function(){yj(Vr(e)?e:gme(e),void 0,t)},zd(v_),v_},p_=function(e){delete kg[e]},fl?zd=function(e){pme.nextTick(y_(e))}:g_&&g_.now?zd=function(e){g_.now(y_(e))}:aU&&!oU?(h_=(nU=new aU).port2,nU.port1.onmessage=sU,zd=Dg(h_.postMessage,h_)):Tt.addEventListener&&Vr(Tt.postMessage)&&!Tt.importScripts&&Rg&&Rg.protocol!=="file:"&&!en(lU)?(zd=lU,Tt.addEventListener("message",sU,!1)):zd="onreadystatechange"in vg("script")?function(e){FO.appendChild(vg("script")).onreadystatechange=function(){FO.removeChild(this),m_(e)}}:function(e){setTimeout(y_(e),0)});var Lg,Gu,Pg,Wd,b_,E_,x_,uU,cU={set:f_,clear:p_},mme=/ipad|iphone|ipod/i.test(Bd)&&Tt.Pebble!==void 0,yme=/web0s(?!.*chrome)/i.test(Bd),bme=AO.f,S_=cU.set,dU=Tt.MutationObserver||Tt.WebKitMutationObserver,hU=Tt.document,fU=Tt.process,Bb=Tt.Promise,pU=bme(Tt,"queueMicrotask"),gU=pU&&pU.value;gU||(Lg=function(){var e,t;for(fl&&(e=fU.domain)&&e.exit();Gu;){t=Gu.fn,Gu=Gu.next;try{t()}catch(r){throw Gu?Wd():Pg=void 0,r}}Pg=void 0,e&&e.enter()},oU||fl||yme||!dU||!hU?!mme&&Bb&&Bb.resolve?((x_=Bb.resolve(void 0)).constructor=Bb,uU=Dg(x_.then,x_),Wd=function(){uU(Lg)}):fl?Wd=function(){fU.nextTick(Lg)}:(S_=Dg(S_,Tt),Wd=function(){S_(Lg)}):(b_=!0,E_=hU.createTextNode(""),new dU(Lg).observe(E_,{characterData:!0}),Wd=function(){E_.data=b_=!b_}));var w_,vU,mU,yU,bU=gU||function(e){var t={fn:e,next:void 0};Pg&&(Pg.next=t),Gu||(Gu=t,Wd()),Pg=t},Eme=function(e){var t,r;this.promise=new e(function(n,i){if(t!==void 0||r!==void 0)throw TypeError("Bad Promise constructor");t=n,r=i}),this.resolve=ul(t),this.reject=ul(r)},C_={f:function(e){return new Eme(e)}},T_=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},xme=typeof window=="object",EU=cU.set,Sme=Tn("species"),Ga="Promise",xU=Ji.getterFor(Ga),wme=Ji.set,Cme=Ji.getterFor(Ga),Vu=Mb&&Mb.prototype,ga=Mb,Ig=Vu,SU=Tt.TypeError,A_=Tt.document,D_=Tt.process,Gd=C_.f,Tme=Gd,Ame=!!(A_&&A_.createEvent&&Tt.dispatchEvent),wU=Vr(Tt.PromiseRejectionEvent),CU=!1,Mg=vb(Ga,function(){var e=hb(ga),t=e!==String(ga);if(!t&&fg===66)return!0;if(fg>=51&&/native code/.test(e))return!1;var r=new ga(function(i){i(1)}),n=function(i){i(function(){},function(){})};return(r.constructor={})[Sme]=n,!(CU=r.then(function(){})instanceof n)||!t&&xme&&!wU}),Dme=Mg||!zj(function(e){ga.all(e).catch(function(){})}),TU=function(e){var t;return!(!Jr(e)||!Vr(t=e.then))&&t},O_=function(e,t){if(!e.notified){e.notified=!0;var r=e.reactions;bU(function(){for(var n=e.value,i=e.state==1,o=0;r.length>o;){var a,s,l,u=r[o++],c=i?u.ok:u.fail,h=u.resolve,S=u.reject,y=u.domain;try{c?(i||(e.rejection===2&&_me(e),e.rejection=1),c===!0?a=n:(y&&y.enter(),a=c(n),y&&(y.exit(),l=!0)),a===u.promise?S(SU("Promise-chain cycle")):(s=TU(a))?Fr(s,a,h,S):h(a)):S(n)}catch(W){y&&!l&&y.exit(),S(W)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&Ome(e)})}},AU=function(e,t,r){var n,i;Ame?((n=A_.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),Tt.dispatchEvent(n)):n={promise:t,reason:r},!wU&&(i=Tt["on"+e])?i(n):e==="unhandledrejection"&&function(o,a){var s=Tt.console;s&&s.error&&(arguments.length==1?s.error(o):s.error(o,a))}("Unhandled promise rejection",r)},Ome=function(e){Fr(EU,Tt,function(){var t,r=e.facade,n=e.value;if(DU(e)&&(t=T_(function(){fl?D_.emit("unhandledRejection",n,r):AU("unhandledrejection",r,n)}),e.rejection=fl||DU(e)?2:1,t.error))throw t.value})},DU=function(e){return e.rejection!==1&&!e.parent},_me=function(e){Fr(EU,Tt,function(){var t=e.facade;fl?D_.emit("rejectionHandled",t):AU("rejectionhandled",t,e.value)})},Vd=function(e,t,r){return function(n){e(t,n,r)}},Kd=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,O_(e,!0))},__=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw SU("Promise can't be resolved itself");var n=TU(t);n?bU(function(){var i={done:!1};try{Fr(n,t,Vd(__,i,e),Vd(Kd,i,e))}catch(o){Kd(i,o,e)}}):(e.value=t,e.state=1,O_(e,!1))}catch(i){Kd({done:!1},i,e)}}};if(Mg&&(Ig=(ga=function(e){n_(this,Ig),ul(e),Fr(w_,this);var t=xU(this);try{e(Vd(__,t),Vd(Kd,t))}catch(r){Kd(t,r)}}).prototype,(w_=function(e){wme(this,{type:Ga,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Ab(Ig,{then:function(e,t){var r=Cme(this),n=r.reactions,i=Gd(bj(this,ga));return i.ok=!Vr(e)||e,i.fail=Vr(t)&&t,i.domain=fl?D_.domain:void 0,r.parent=!0,n[n.length]=i,r.state!=0&&O_(r,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),vU=function(){var e=new w_,t=xU(e);this.promise=e,this.resolve=Vd(__,t),this.reject=Vd(Kd,t)},C_.f=Gd=function(e){return e===ga||e===mU?new vU(e):Tme(e)},Vr(Mb)&&Vu!==Object.prototype)){yU=Vu.then,CU||(Qi(Vu,"then",function(e,t){var r=this;return new ga(function(n,i){Fr(yU,r,n,i)}).then(e,t)},{unsafe:!0}),Qi(Vu,"catch",Ig.catch,{unsafe:!0}));try{delete Vu.constructor}catch(e){}Hd&&Hd(Vu,Ig)}pa({global:!0,wrap:!0,forced:Mg},{Promise:ga}),Cb(ga,Ga,!1),function(e){var t=ju("Promise"),r=Wa.f;ha&&t&&!t[iU]&&r(t,iU,{configurable:!0,get:function(){return this}})}(),mU=ju(Ga),pa({target:Ga,stat:!0,forced:Mg},{reject:function(e){var t=Gd(this);return Fr(t.reject,void 0,e),t.promise}}),pa({target:Ga,stat:!0,forced:Mg},{resolve:function(e){return function(t,r){if(Qn(t),Jr(r)&&r.constructor===t)return r;var n=C_.f(t);return(0,n.resolve)(r),n.promise}(this,e)}}),pa({target:Ga,stat:!0,forced:Dme},{all:function(e){var t=this,r=Gd(t),n=r.resolve,i=r.reject,o=T_(function(){var a=ul(t.resolve),s=[],l=0,u=1;_b(e,function(c){var h=l++,S=!1;u++,Fr(a,t,c).then(function(y){S||(S=!0,s[h]=y,--u||n(s))},i)}),--u||n(s)});return o.error&&i(o.value),r.promise},race:function(e){var t=this,r=Gd(t),n=r.reject,i=T_(function(){var o=ul(t.resolve);_b(e,function(a){Fr(o,t,a).then(r.resolve,n)})});return i.error&&n(i.value),r.promise}});var Rme=yg.PROPER,R_=RegExp.prototype,OU=R_.toString,kme=pr(uj),Lme=en(function(){return OU.call({source:"a",flags:"b"})!="/a/b"}),Pme=Rme&&OU.name!="toString";(Lme||Pme)&&Qi(RegExp.prototype,"toString",function(){var e=Qn(this),t=dl(e.source),r=e.flags;return"/"+t+"/"+dl(r===void 0&&hg(R_,e)&&!("flags"in R_)?kme(e):r)},{unsafe:!0});var Ime=yg.EXISTS,Mme=Wa.f,_U=Function.prototype,Bme=pr(_U.toString),RU=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,Fme=pr(RU.exec);ha&&!Ime&&Mme(_U,"name",{configurable:!0,get:function(){try{return Fme(RU,Bme(this))[1]}catch(e){return""}}});var kU=new WeakMap;function LU(e){return e.getMenuConfig("uploadImage")}function Nme(e,t){return XO(this,void 0,void 0,function(){return YO(this,function(r){return[2,new Promise(function(n){var i=new FileReader;i.readAsDataURL(t),i.onload=function(){var o=i.result;if(o){var a=o.toString(),s=a.indexOf("data:image")===0?"":a;pu(e,a,t.name,s),n("ok")}}})]})})}function jme(e,t){return XO(this,void 0,void 0,function(){var r,n,i,o;return YO(this,function(a){switch(a.label){case 0:return r=function(s){var l=kU.get(s);if(l!=null)return l;var u=LU(s),c=u.onSuccess,h=u.onProgress,S=u.onFailed,y=u.customInsert,W=u.onError;return l=B3(Sb(Sb({},u),{onProgress:function(B){s.showProgressBar(B),h&&h(B)},onSuccess:function(B,N){if(y)return y(N,function(qe,ot,et){return pu(s,qe,ot,et)}),void c(B,N);var U=N.errno,D=U===void 0?1:U,Q=N.data,te=Q===void 0?{}:Q;if(D===0){if(Array.isArray(te))te.forEach(function(qe){var ot=qe.url,et=ot===void 0?"":ot,gt=qe.alt,dt=gt===void 0?"":gt,ht=qe.href;pu(s,et,dt,ht===void 0?"":ht)});else{var he=te.url,Ee=he===void 0?"":he,ve=te.alt,De=ve===void 0?"":ve,Pe=te.href;pu(s,Ee,De,Pe===void 0?"":Pe)}c(B,N)}else S(B,N)},onError:function(B,N,U){W(B,N,U)}})),kU.set(s,l),l}(e),n=t.name,i=t.type,o=t.size,r.addFile({name:n,type:i,size:o,data:t}),[4,r.upload()];case 1:return a.sent(),[2]}})})}function PU(e,t){var r,n;return XO(this,void 0,void 0,function(){var i,o,a,s,l,u,c,h,S;return YO(this,function(y){switch(y.label){case 0:if(t==null)return[2];i=Array.prototype.slice.call(t),o=LU(e),a=o.customUpload,s=o.base64LimitSize,y.label=1;case 1:y.trys.push([1,11,12,17]),l=kve(i),y.label=2;case 2:return[4,l.next()];case 3:return(u=y.sent()).done?[3,10]:(c=u.value,h=c.size,s&&h<=s?[4,Nme(e,c)]:[3,5]);case 4:return y.sent(),[3,9];case 5:return a?[4,a(c,function(W,B,N){return pu(e,W,B,N)})]:[3,7];case 6:return y.sent(),[3,9];case 7:return[4,jme(e,c)];case 8:y.sent(),y.label=9;case 9:return[3,2];case 10:return[3,17];case 11:return S=y.sent(),r={error:S},[3,17];case 12:return y.trys.push([12,,15,16]),u&&!u.done&&(n=l.return)?[4,n.call(l)]:[3,14];case 13:y.sent(),y.label=14;case 14:return[3,16];case 15:if(r)throw r.error;return[7];case 16:return[7];case 17:return[2]}})})}var Ume=pr([].join),Hme=vO!=Object,zme=tU("join",",");pa({target:"Array",proto:!0,forced:Hme||!zme},{join:function(e){return Ume(ll(this),e===void 0?",":e)}}),io&&(_e.fn.append=io),Zo&&(_e.fn.on=Zo),xc&&(_e.fn.remove=xc),Yo&&(_e.fn.val=Yo),mP&&(_e.fn.click=mP),mc&&(_e.fn.hide=mc);var Wme=function(){function e(){this.title=wt("uploadImgModule.uploadImage"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M828.708571 585.045333a48.761905 48.761905 0 0 0-48.737523 48.761905v18.529524l-72.143238-72.167619a135.972571 135.972571 0 0 0-191.585524 0l-34.133334 34.133333-120.880762-120.953905a138.898286 138.898286 0 0 0-191.585523 0l-72.167619 72.167619V292.400762a48.786286 48.786286 0 0 1 48.761904-48.761905h341.23581a48.737524 48.737524 0 0 0 34.474667-83.285333 48.737524 48.737524 0 0 0-34.474667-14.287238H146.236952A146.212571 146.212571 0 0 0 0 292.400762v585.289143A146.358857 146.358857 0 0 0 146.236952 1024h584.996572a146.212571 146.212571 0 0 0 146.236952-146.310095V633.807238a48.786286 48.786286 0 0 0-48.761905-48.761905zM146.261333 926.45181a48.737524 48.737524 0 0 1-48.761904-48.761905v-174.128762l141.409523-141.458286a38.497524 38.497524 0 0 1 53.126096 0l154.526476 154.624 209.627428 209.724953H146.236952z m633.734096-48.761905c-0.073143 9.337905-3.145143 18.383238-8.777143 25.843809l-219.843048-220.94019 34.133333-34.133334a37.546667 37.546667 0 0 1 53.613715 0l140.873143 141.897143V877.714286zM1009.615238 160.231619L863.329524 13.897143a48.737524 48.737524 0 0 0-16.091429-10.24c-11.849143-4.87619-25.161143-4.87619-37.059047 0a48.761905 48.761905 0 0 0-16.067048 10.24l-146.236952 146.334476a49.005714 49.005714 0 0 0 69.217523 69.241905l62.902858-63.390476v272.627809a48.761905 48.761905 0 1 0 97.475047 0V166.083048l62.902857 63.390476a48.737524 48.737524 0 0 0 69.217524 0 48.761905 48.761905 0 0 0 0-69.241905z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return m0(t)},e.prototype.getMenuConfig=function(t){return t.getMenuConfig("uploadImage")},e.prototype.exec=function(t,r){var n=this.getMenuConfig(t),i=n.allowedFileTypes,o=i===void 0?[]:i,a=n.customBrowseAndUpload;if(a)a(function(c,h,S){return pu(t,c,h,S)});else{var s="";o.length>0&&(s='accept="'+o.join(", ")+'"');var l=_e("body"),u=_e('<input type="file" '+s+" multiple/>");u.hide(),l.append(u),u.click(),u.on("change",function(){var c=u[0].files;PU(t,c)})}},e}(),Gme={menus:[{key:"uploadImage",factory:function(){return new Wme},config:{server:"",fieldName:"wangeditor-uploaded-image",maxFileSize:2097152,maxNumberOfFiles:100,allowedFileTypes:["image/*"],meta:{},metaWithUrl:!1,withCredentials:!1,timeout:1e4,onBeforeUpload:function(e){return e},onProgress:function(e){},onSuccess:function(e,t){},onFailed:function(e,t){console.error("'"+e.name+"' upload failed",t)},onError:function(e,t,r){console.error("'"+e.name+"' upload error",r)},base64LimitSize:0}}],editorPlugin:function(e){var t=e.insertData,r=e;return r.insertData=function(n){if(m0(r))t(n);else if(n.getData("text/plain"))t(n);else{var i=n.files;i.length<=0?t(n):Array.prototype.slice.call(i).some(function(o){return function(a,s){var l=typeof Symbol=="function"&&a[Symbol.iterator];if(!l)return a;var u,c,h=l.call(a),S=[];try{for(;(s===void 0||s-- >0)&&!(u=h.next()).done;)S.push(u.value)}catch(y){c={error:y}}finally{try{u&&!u.done&&(l=h.return)&&l.call(h)}finally{if(c)throw c.error}}return S}(o.type.split("/"),1)[0]==="image"})?PU(e,i):t(n)}},r}};Ri("en",{highLightModule:{selectLang:"Language"}}),Ri("zh-CN",{highLightModule:{selectLang:"\u9009\u62E9\u8BED\u8A00"}});var Fb=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof ze!="undefined"?ze:typeof self!="undefined"?self:{};function k_(e){var t={exports:{}};return e(t,t.exports),t.exports}var pl,Nb,jb=function(e){return e&&e.Math==Math&&e},vr=jb(typeof globalThis=="object"&&globalThis)||jb(typeof window=="object"&&window)||jb(typeof self=="object"&&self)||jb(typeof Fb=="object"&&Fb)||function(){return this}()||Function("return this")(),Vme=Object.defineProperty,L_=function(e,t){try{Vme(vr,e,{value:t,configurable:!0,writable:!0})}catch(r){vr[e]=t}return t},gl=vr["__core-js_shared__"]||L_("__core-js_shared__",{}),P_=k_(function(e){(e.exports=function(t,r){return gl[t]||(gl[t]=r!==void 0?r:{})})("versions",[]).push({version:"3.19.3",mode:"global",copyright:"\xA9 2021 Denis Pushkarev (zloirock.ru)"})}),IU=Function.prototype,I_=IU.bind,M_=IU.call,Kme=I_&&I_.bind(M_),Nr=I_?function(e){return e&&Kme(M_,e)}:function(e){return e&&function(){return M_.apply(e,arguments)}},$me=vr.TypeError,$d=function(e){if(e==null)throw $me("Can't call method on "+e);return e},Xme=vr.Object,B_=function(e){return Xme($d(e))},Yme=Nr({}.hasOwnProperty),wo=Object.hasOwn||function(e,t){return Yme(B_(e),t)},Zme=0,Jme=Math.random(),Qme=Nr(1 .toString),MU=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Qme(++Zme+Jme,36)},gi=function(e){return typeof e=="function"},qme=function(e){return gi(e)?e:void 0},Bg=function(e,t){return arguments.length<2?qme(vr[e]):vr[e]&&vr[e][t]},F_=Bg("navigator","userAgent")||"",BU=vr.process,FU=vr.Deno,NU=BU&&BU.versions||FU&&FU.version,jU=NU&&NU.v8;jU&&(Nb=(pl=jU.split("."))[0]>0&&pl[0]<4?1:+(pl[0]+pl[1])),!Nb&&F_&&(!(pl=F_.match(/Edge\/(\d+)/))||pl[1]>=74)&&(pl=F_.match(/Chrome\/(\d+)/))&&(Nb=+pl[1]);var UU=Nb,qn=function(e){try{return!!e()}catch(t){return!0}},N_=!!Object.getOwnPropertySymbols&&!qn(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&UU&&UU<41}),j_=N_&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Fg=P_("wks"),Ku=vr.Symbol,HU=Ku&&Ku.for,e0e=j_?Ku:Ku&&Ku.withoutSetter||MU,vl=function(e){if(!wo(Fg,e)||!N_&&typeof Fg[e]!="string"){var t="Symbol."+e;N_&&wo(Ku,e)?Fg[e]=Ku[e]:Fg[e]=j_&&HU?HU(t):e0e(t)}return Fg[e]},zU={};zU[vl("toStringTag")]="z";var U_=String(zU)==="[object z]",va=!qn(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Uo=function(e){return typeof e=="object"?e!==null:gi(e)},H_=vr.document,t0e=Uo(H_)&&Uo(H_.createElement),z_=function(e){return t0e?H_.createElement(e):{}},WU=!va&&!qn(function(){return Object.defineProperty(z_("div"),"a",{get:function(){return 7}}).a!=7}),r0e=vr.String,n0e=vr.TypeError,Ho=function(e){if(Uo(e))return e;throw n0e(r0e(e)+" is not an object")},Ng=Function.prototype.call,Gn=Ng.bind?Ng.bind(Ng):function(){return Ng.apply(Ng,arguments)},GU=Nr({}.isPrototypeOf),i0e=vr.Object,W_=j_?function(e){return typeof e=="symbol"}:function(e){var t=Bg("Symbol");return gi(t)&&GU(t.prototype,i0e(e))},o0e=vr.String,VU=function(e){try{return o0e(e)}catch(t){return"Object"}},a0e=vr.TypeError,KU=function(e){if(gi(e))return e;throw a0e(VU(e)+" is not a function")},$U=function(e,t){var r=e[t];return r==null?void 0:KU(r)},s0e=vr.TypeError,l0e=vr.TypeError,u0e=vl("toPrimitive"),G_=function(e){var t=function(r,n){if(!Uo(r)||W_(r))return r;var i,o=$U(r,u0e);if(o){if(n===void 0&&(n="default"),i=Gn(o,r,n),!Uo(i)||W_(i))return i;throw l0e("Can't convert object to primitive value")}return n===void 0&&(n="number"),function(a,s){var l,u;if(s==="string"&&gi(l=a.toString)&&!Uo(u=Gn(l,a)))return u;if(gi(l=a.valueOf)&&!Uo(u=Gn(l,a)))return u;if(s!=="string"&&gi(l=a.toString)&&!Uo(u=Gn(l,a)))return u;throw s0e("Can't convert object to primitive value")}(r,n)}(e,"string");return W_(t)?t:t+""},c0e=vr.TypeError,XU=Object.defineProperty,Ub={f:va?XU:function(e,t,r){if(Ho(e),t=G_(t),Ho(r),WU)try{return XU(e,t,r)}catch(n){}if("get"in r||"set"in r)throw c0e("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},V_=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Xd=va?function(e,t,r){return Ub.f(e,t,V_(1,r))}:function(e,t,r){return e[t]=r,e},d0e=Nr(Function.toString);gi(gl.inspectSource)||(gl.inspectSource=function(e){return d0e(e)});var Hb,jg,zb,K_=gl.inspectSource,YU=vr.WeakMap,h0e=gi(YU)&&/native code/.test(K_(YU)),ZU=P_("keys"),JU=function(e){return ZU[e]||(ZU[e]=MU(e))},$_={},X_=vr.TypeError,f0e=vr.WeakMap;if(h0e||gl.state){var $u=gl.state||(gl.state=new f0e),p0e=Nr($u.get),QU=Nr($u.has),g0e=Nr($u.set);Hb=function(e,t){if(QU($u,e))throw new X_("Object already initialized");return t.facade=e,g0e($u,e,t),t},jg=function(e){return p0e($u,e)||{}},zb=function(e){return QU($u,e)}}else{var Yd=JU("state");$_[Yd]=!0,Hb=function(e,t){if(wo(e,Yd))throw new X_("Object already initialized");return t.facade=e,Xd(e,Yd,t),t},jg=function(e){return wo(e,Yd)?e[Yd]:{}},zb=function(e){return wo(e,Yd)}}var Y_={set:Hb,get:jg,has:zb,enforce:function(e){return zb(e)?jg(e):Hb(e,{})},getterFor:function(e){return function(t){var r;if(!Uo(t)||(r=jg(t)).type!==e)throw X_("Incompatible receiver, "+e+" required");return r}}},qU=Function.prototype,v0e=va&&Object.getOwnPropertyDescriptor,Z_=wo(qU,"name"),eH={EXISTS:Z_,PROPER:Z_&&function(){}.name==="something",CONFIGURABLE:Z_&&(!va||va&&v0e(qU,"name").configurable)},Ug=k_(function(e){var t=eH.CONFIGURABLE,r=Y_.get,n=Y_.enforce,i=String(String).split("String");(e.exports=function(o,a,s,l){var u,c=!!l&&!!l.unsafe,h=!!l&&!!l.enumerable,S=!!l&&!!l.noTargetGet,y=l&&l.name!==void 0?l.name:a;gi(s)&&(String(y).slice(0,7)==="Symbol("&&(y="["+String(y).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!wo(s,"name")||t&&s.name!==y)&&Xd(s,"name",y),(u=n(s)).source||(u.source=i.join(typeof y=="string"?y:""))),o!==vr?(c?!S&&o[a]&&(h=!0):delete o[a],h?o[a]=s:Xd(o,a,s)):h?o[a]=s:L_(a,s)})(Function.prototype,"toString",function(){return gi(this)&&r(this).source||K_(this)})}),m0e=Nr({}.toString),y0e=Nr("".slice),ml=function(e){return y0e(m0e(e),8,-1)},b0e=vl("toStringTag"),E0e=vr.Object,x0e=ml(function(){return arguments}())=="Arguments",J_=U_?ml:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=function(i,o){try{return i[o]}catch(a){}}(t=E0e(e),b0e))=="string"?r:x0e?ml(t):(n=ml(t))=="Object"&&gi(t.callee)?"Arguments":n},S0e=U_?{}.toString:function(){return"[object "+J_(this)+"]"};U_||Ug(Object.prototype,"toString",S0e,{unsafe:!0});var tH,rH={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Q_=z_("span").classList,nH=Q_&&Q_.constructor&&Q_.constructor.prototype,w0e=nH===Object.prototype?void 0:nH,iH=Nr(Nr.bind),q_=vr.Object,C0e=Nr("".split),eR=qn(function(){return!q_("z").propertyIsEnumerable(0)})?function(e){return ml(e)=="String"?C0e(e,""):q_(e)}:q_,T0e=Math.ceil,A0e=Math.floor,tR=function(e){var t=+e;return t!=t||t===0?0:(t>0?A0e:T0e)(t)},D0e=Math.min,oH=function(e){return e>0?D0e(tR(e),9007199254740991):0},rR=function(e){return oH(e.length)},aH=Array.isArray||function(e){return ml(e)=="Array"},sH=function(){},O0e=[],lH=Bg("Reflect","construct"),nR=/^\s*(?:class|function)\b/,_0e=Nr(nR.exec),R0e=!nR.exec(sH),Hg=function(e){if(!gi(e))return!1;try{return lH(sH,O0e,e),!0}catch(t){return!1}},uH=!lH||qn(function(){var e;return Hg(Hg.call)||!Hg(Object)||!Hg(function(){e=!0})||e})?function(e){if(!gi(e))return!1;switch(J_(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return R0e||!!_0e(nR,K_(e))}:Hg,k0e=vl("species"),cH=vr.Array,L0e=function(e,t){return new(function(r){var n;return aH(r)&&(n=r.constructor,(uH(n)&&(n===cH||aH(n.prototype))||Uo(n)&&(n=n[k0e])===null)&&(n=void 0)),n===void 0?cH:n}(e))(t===0?0:t)},dH=Nr([].push),yl=function(e){var t=e==1,r=e==2,n=e==3,i=e==4,o=e==6,a=e==7,s=e==5||o;return function(l,u,c,h){for(var S,y,W=B_(l),B=eR(W),N=function(he,Ee){return KU(he),Ee===void 0?he:iH?iH(he,Ee):function(){return he.apply(Ee,arguments)}}(u,c),U=rR(B),D=0,Q=h||L0e,te=t?Q(l,U):r||a?Q(l,0):void 0;U>D;D++)if((s||D in B)&&(y=N(S=B[D],D,W),e))if(t)te[D]=y;else if(y)switch(e){case 3:return!0;case 5:return S;case 6:return D;case 2:dH(te,S)}else switch(e){case 4:return!1;case 7:dH(te,S)}return o?-1:n||i?i:te}},P0e=[yl(0),yl(1),yl(2),yl(3),yl(4),yl(5),yl(6),yl(7)][0],iR=(tH=[].forEach)&&qn(function(){tH.call(null,function(){throw 1},1)})?[].forEach:function(e){return P0e(this,e,arguments.length>1?arguments[1]:void 0)},hH=function(e){if(e&&e.forEach!==iR)try{Xd(e,"forEach",iR)}catch(t){e.forEach=iR}};for(var oR in rH)rH[oR]&&hH(vr[oR]&&vr[oR].prototype);hH(w0e);var fH={}.propertyIsEnumerable,pH=Object.getOwnPropertyDescriptor,gH={f:pH&&!fH.call({1:2},1)?function(e){var t=pH(this,e);return!!t&&t.enumerable}:fH},Wb=function(e){return eR($d(e))},vH=Object.getOwnPropertyDescriptor,mH={f:va?vH:function(e,t){if(e=Wb(e),t=G_(t),WU)try{return vH(e,t)}catch(r){}if(wo(e,t))return V_(!Gn(gH.f,e,t),e[t])}},I0e=Math.max,M0e=Math.min,aR=function(e,t){var r=tR(e);return r<0?I0e(r+t,0):M0e(r,t)},yH=function(e){return function(t,r,n){var i,o=Wb(t),a=rR(o),s=aR(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},B0e=(yH(!0),yH(!1)),bH=Nr([].push),EH=function(e,t){var r,n=Wb(e),i=0,o=[];for(r in n)!wo($_,r)&&wo(n,r)&&bH(o,r);for(;t.length>i;)wo(n,r=t[i++])&&(~B0e(o,r)||bH(o,r));return o},Gb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],F0e=Gb.concat("length","prototype"),N0e={f:Object.getOwnPropertyNames||function(e){return EH(e,F0e)}},xH={f:Object.getOwnPropertySymbols},j0e=Nr([].concat),U0e=Bg("Reflect","ownKeys")||function(e){var t=N0e.f(Ho(e)),r=xH.f;return r?j0e(t,r(e)):t},H0e=function(e,t){for(var r=U0e(t),n=Ub.f,i=mH.f,o=0;o<r.length;o++){var a=r[o];wo(e,a)||n(e,a,i(t,a))}},z0e=/#|\.prototype\./,zg=function(e,t){var r=G0e[W0e(e)];return r==K0e||r!=V0e&&(gi(t)?qn(t):!!t)},W0e=zg.normalize=function(e){return String(e).replace(z0e,".").toLowerCase()},G0e=zg.data={},V0e=zg.NATIVE="N",K0e=zg.POLYFILL="P",$0e=zg,X0e=mH.f,Vb=function(e,t){var r,n,i,o,a,s=e.target,l=e.global,u=e.stat;if(r=l?vr:u?vr[s]||L_(s,{}):(vr[s]||{}).prototype)for(n in t){if(o=t[n],i=e.noTargetGet?(a=X0e(r,n))&&a.value:r[n],!$0e(l?n:s+(u?".":"#")+n,e.forced)&&i!==void 0){if(typeof o==typeof i)continue;H0e(o,i)}(e.sham||i&&i.sham)&&Xd(o,"sham",!0),Ug(r,n,o,e)}},Kb=Object.keys||function(e){return EH(e,Gb)},Zd=Object.assign,SH=Object.defineProperty,Y0e=Nr([].concat),wH=!Zd||qn(function(){if(va&&Zd({b:1},Zd(SH({},"a",{enumerable:!0,get:function(){SH(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(i){t[i]=i}),Zd({},e)[r]!=7||Kb(Zd({},t)).join("")!=n})?function(e,t){for(var r=B_(e),n=arguments.length,i=1,o=xH.f,a=gH.f;n>i;)for(var s,l=eR(arguments[i++]),u=o?Y0e(Kb(l),o(l)):Kb(l),c=u.length,h=0;c>h;)s=u[h++],va&&!Gn(a,l,s)||(r[s]=l[s]);return r}:Zd;Vb({target:"Object",stat:!0,forced:Object.assign!==wH},{assign:wH});var CH=k_(function(e){var t=function(r){var n=/\blang(?:uage)?-([\w-]+)\b/i,i=0,o={},a={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function N(U){return U instanceof s?new s(U.type,N(U.content),U.alias):Array.isArray(U)?U.map(N):U.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(N){return Object.prototype.toString.call(N).slice(8,-1)},objId:function(N){return N.__id||Object.defineProperty(N,"__id",{value:++i}),N.__id},clone:function N(U,D){var Q,te;switch(D=D||{},a.util.type(U)){case"Object":if(te=a.util.objId(U),D[te])return D[te];for(var he in Q={},D[te]=Q,U)U.hasOwnProperty(he)&&(Q[he]=N(U[he],D));return Q;case"Array":return te=a.util.objId(U),D[te]?D[te]:(Q=[],D[te]=Q,U.forEach(function(Ee,ve){Q[ve]=N(Ee,D)}),Q);default:return U}},getLanguage:function(N){for(;N&&!n.test(N.className);)N=N.parentElement;return N?(N.className.match(n)||[,"none"])[1].toLowerCase():"none"},currentScript:function(){if(typeof document=="undefined")return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(Q){var N=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(Q.stack)||[])[1];if(N){var U=document.getElementsByTagName("script");for(var D in U)if(U[D].src==N)return U[D]}return null}},isActive:function(N,U,D){for(var Q="no-"+U;N;){var te=N.classList;if(te.contains(U))return!0;if(te.contains(Q))return!1;N=N.parentElement}return!!D}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(N,U){var D=a.util.clone(a.languages[N]);for(var Q in U)D[Q]=U[Q];return D},insertBefore:function(N,U,D,Q){var te=(Q=Q||a.languages)[N],he={};for(var Ee in te)if(te.hasOwnProperty(Ee)){if(Ee==U)for(var ve in D)D.hasOwnProperty(ve)&&(he[ve]=D[ve]);D.hasOwnProperty(Ee)||(he[Ee]=te[Ee])}var De=Q[N];return Q[N]=he,a.languages.DFS(a.languages,function(Pe,qe){qe===De&&Pe!=N&&(this[Pe]=he)}),he},DFS:function N(U,D,Q,te){te=te||{};var he=a.util.objId;for(var Ee in U)if(U.hasOwnProperty(Ee)){D.call(U,Ee,U[Ee],Q||Ee);var ve=U[Ee],De=a.util.type(ve);De!=="Object"||te[he(ve)]?De!=="Array"||te[he(ve)]||(te[he(ve)]=!0,N(ve,D,Ee,te)):(te[he(ve)]=!0,N(ve,D,null,te))}}},plugins:{},highlightAll:function(N,U){a.highlightAllUnder(document,N,U)},highlightAllUnder:function(N,U,D){var Q={callback:D,container:N,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",Q),Q.elements=Array.prototype.slice.apply(Q.container.querySelectorAll(Q.selector)),a.hooks.run("before-all-elements-highlight",Q);for(var te,he=0;te=Q.elements[he++];)a.highlightElement(te,U===!0,Q.callback)},highlightElement:function(N,U,D){var Q=a.util.getLanguage(N),te=a.languages[Q];N.className=N.className.replace(n,"").replace(/\s+/g," ")+" language-"+Q;var he=N.parentElement;he&&he.nodeName.toLowerCase()==="pre"&&(he.className=he.className.replace(n,"").replace(/\s+/g," ")+" language-"+Q);var Ee={element:N,language:Q,grammar:te,code:N.textContent};function ve(Pe){Ee.highlightedCode=Pe,a.hooks.run("before-insert",Ee),Ee.element.innerHTML=Ee.highlightedCode,a.hooks.run("after-highlight",Ee),a.hooks.run("complete",Ee),D&&D.call(Ee.element)}if(a.hooks.run("before-sanity-check",Ee),(he=Ee.element.parentElement)&&he.nodeName.toLowerCase()==="pre"&&!he.hasAttribute("tabindex")&&he.setAttribute("tabindex","0"),!Ee.code)return a.hooks.run("complete",Ee),void(D&&D.call(Ee.element));if(a.hooks.run("before-highlight",Ee),Ee.grammar)if(U&&r.Worker){var De=new Worker(a.filename);De.onmessage=function(Pe){ve(Pe.data)},De.postMessage(JSON.stringify({language:Ee.language,code:Ee.code,immediateClose:!0}))}else ve(a.highlight(Ee.code,Ee.grammar,Ee.language));else ve(a.util.encode(Ee.code))},highlight:function(N,U,D){var Q={code:N,grammar:U,language:D};return a.hooks.run("before-tokenize",Q),Q.tokens=a.tokenize(Q.code,Q.grammar),a.hooks.run("after-tokenize",Q),s.stringify(a.util.encode(Q.tokens),Q.language)},tokenize:function(N,U){var D=U.rest;if(D){for(var Q in D)U[Q]=D[Q];delete U.rest}var te=new c;return h(te,te.head,N),u(N,te,U,te.head,0),function(he){for(var Ee=[],ve=he.head.next;ve!==he.tail;)Ee.push(ve.value),ve=ve.next;return Ee}(te)},hooks:{all:{},add:function(N,U){var D=a.hooks.all;D[N]=D[N]||[],D[N].push(U)},run:function(N,U){var D=a.hooks.all[N];if(D&&D.length)for(var Q,te=0;Q=D[te++];)Q(U)}},Token:s};function s(N,U,D,Q){this.type=N,this.content=U,this.alias=D,this.length=0|(Q||"").length}function l(N,U,D,Q){N.lastIndex=U;var te=N.exec(D);if(te&&Q&&te[1]){var he=te[1].length;te.index+=he,te[0]=te[0].slice(he)}return te}function u(N,U,D,Q,te,he){for(var Ee in D)if(D.hasOwnProperty(Ee)&&D[Ee]){var ve=D[Ee];ve=Array.isArray(ve)?ve:[ve];for(var De=0;De<ve.length;++De){if(he&&he.cause==Ee+","+De)return;var Pe=ve[De],qe=Pe.inside,ot=!!Pe.lookbehind,et=!!Pe.greedy,gt=Pe.alias;if(et&&!Pe.pattern.global){var dt=Pe.pattern.toString().match(/[imsuy]*$/)[0];Pe.pattern=RegExp(Pe.pattern.source,dt+"g")}for(var ht=Pe.pattern||Pe,pt=Q.next,Dt=te;pt!==U.tail&&!(he&&Dt>=he.reach);Dt+=pt.value.length,pt=pt.next){var Ft=pt.value;if(U.length>N.length)return;if(!(Ft instanceof s)){var Bt,It=1;if(et){if(!(Bt=l(ht,Dt,N,ot)))break;var Re=Bt.index,Te=Bt.index+Bt[0].length,Fe=Dt;for(Fe+=pt.value.length;Re>=Fe;)Fe+=(pt=pt.next).value.length;if(Dt=Fe-=pt.value.length,pt.value instanceof s)continue;for(var rt=pt;rt!==U.tail&&(Fe<Te||typeof rt.value=="string");rt=rt.next)It++,Fe+=rt.value.length;It--,Ft=N.slice(Dt,Fe),Bt.index-=Dt}else if(!(Bt=l(ht,0,Ft,ot)))continue;Re=Bt.index;var vt=Bt[0],ut=Ft.slice(0,Re),kt=Ft.slice(Re+vt.length),Xt=Dt+Ft.length;he&&Xt>he.reach&&(he.reach=Xt);var qt=pt.prev;if(ut&&(qt=h(U,qt,ut),Dt+=ut.length),S(U,qt,It),pt=h(U,qt,new s(Ee,qe?a.tokenize(vt,qe):vt,gt,vt)),kt&&h(U,pt,kt),It>1){var or={cause:Ee+","+De,reach:Xt};u(N,U,D,pt.prev,Dt,or),he&&or.reach>he.reach&&(he.reach=or.reach)}}}}}}function c(){var N={value:null,prev:null,next:null},U={value:null,prev:N,next:null};N.next=U,this.head=N,this.tail=U,this.length=0}function h(N,U,D){var Q=U.next,te={value:D,prev:U,next:Q};return U.next=te,Q.prev=te,N.length++,te}function S(N,U,D){for(var Q=U.next,te=0;te<D&&Q!==N.tail;te++)Q=Q.next;U.next=Q,Q.prev=U,N.length-=te}if(r.Prism=a,s.stringify=function N(U,D){if(typeof U=="string")return U;if(Array.isArray(U)){var Q="";return U.forEach(function(De){Q+=N(De,D)}),Q}var te={type:U.type,content:N(U.content,D),tag:"span",classes:["token",U.type],attributes:{},language:D},he=U.alias;he&&(Array.isArray(he)?Array.prototype.push.apply(te.classes,he):te.classes.push(he)),a.hooks.run("wrap",te);var Ee="";for(var ve in te.attributes)Ee+=" "+ve+'="'+(te.attributes[ve]||"").replace(/"/g,""")+'"';return"<"+te.tag+' class="'+te.classes.join(" ")+'"'+Ee+">"+te.content+"</"+te.tag+">"},!r.document)return r.addEventListener&&(a.disableWorkerMessageHandler||r.addEventListener("message",function(N){var U=JSON.parse(N.data),D=U.language,Q=U.code,te=U.immediateClose;r.postMessage(a.highlight(Q,a.languages[D],D)),te&&r.close()},!1)),a;var y=a.util.currentScript();function W(){a.manual||a.highlightAll()}if(y&&(a.filename=y.src,y.hasAttribute("data-manual")&&(a.manual=!0)),!a.manual){var B=document.readyState;B==="loading"||B==="interactive"&&y&&y.defer?document.addEventListener("DOMContentLoaded",W):window.requestAnimationFrame?window.requestAnimationFrame(W):window.setTimeout(W,16)}return a}(typeof window!="undefined"?window:typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope?self:{});/**
|
|
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
|
*
|
|
|
* @license MIT <https://opensource.org/licenses/MIT>
|
|
|
* @author Lea Verou <https://lea.verou.me>
|
|
|
* @namespace
|
|
|
* @public
|
|
|
*/e.exports&&(e.exports=t),Fb!==void 0&&(Fb.Prism=t),t.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(r,n){var i={};i["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:t.languages[n]},i.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:i}};o["language-"+n]={pattern:/[\s\S]+/,inside:t.languages[n]};var a={};a[r]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return r}),"i"),lookbehind:!0,greedy:!0,inside:o},t.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(r,n){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:t.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,function(r){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var i=r.languages.markup;i&&(i.tag.addInlined("style","css"),i.tag.addAttribute("style","css"))}(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,function(){if(t!==void 0&&typeof document!="undefined"){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},n="data-src-status",i='pre[data-src]:not([data-src-status="loaded"]):not([data-src-status="loading"])',o=/\blang(?:uage)?-([\w-]+)\b/i;t.hooks.add("before-highlightall",function(l){l.selector+=", "+i}),t.hooks.add("before-sanity-check",function(l){var u=l.element;if(u.matches(i)){l.code="",u.setAttribute(n,"loading");var c=u.appendChild(document.createElement("CODE"));c.textContent="Loading\u2026";var h=u.getAttribute("data-src"),S=l.language;if(S==="none"){var y=(/\.(\w+)$/.exec(h)||[,"none"])[1];S=r[y]||y}s(c,S),s(u,S);var W=t.plugins.autoloader;W&&W.loadLanguages(S);var B=new XMLHttpRequest;B.open("GET",h,!0),B.onreadystatechange=function(){B.readyState==4&&(B.status<400&&B.responseText?(u.setAttribute(n,"loaded"),c.textContent=B.responseText,t.highlightElement(c)):(u.setAttribute(n,"failed"),B.status>=400?c.textContent="\u2716 Error "+B.status+" while fetching file: "+B.statusText:c.textContent="\u2716 Error: File does not exist or is empty"))},B.send(null)}}),t.plugins.fileHighlight={highlight:function(l){for(var u,c=(l||document).querySelectorAll(i),h=0;u=c[h++];)t.highlightElement(u)}};var a=!1;t.fileHighlight=function(){a||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),a=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}function s(l,u){var c=l.className;c=c.replace(o," ")+" language-"+u,l.className=c.replace(/\s+/g," ").trim()}}()});!function(e){var t=e.util.clone(e.languages.javascript),r=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,n=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,i=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function o(l,u){return l=l.replace(/<S>/g,function(){return r}).replace(/<BRACES>/g,function(){return n}).replace(/<SPREAD>/g,function(){return i}),RegExp(l,u)}i=o(i).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=o(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/i,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/i,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:o(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:o(/=<BRACES>/.source),inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx},alias:"language-javascript"}},e.languages.jsx.tag);var a=function(l){return l?typeof l=="string"?l:typeof l.content=="string"?l.content:l.content.map(a).join(""):""},s=function(l){for(var u=[],c=0;c<l.length;c++){var h=l[c],S=!1;if(typeof h!="string"&&(h.type==="tag"&&h.content[0]&&h.content[0].type==="tag"?h.content[0].content[0].content==="</"?u.length>0&&u[u.length-1].tagName===a(h.content[0].content[1])&&u.pop():h.content[h.content.length-1].content==="/>"||u.push({tagName:a(h.content[0].content[1]),openedBraces:0}):u.length>0&&h.type==="punctuation"&&h.content==="{"?u[u.length-1].openedBraces++:u.length>0&&u[u.length-1].openedBraces>0&&h.type==="punctuation"&&h.content==="}"?u[u.length-1].openedBraces--:S=!0),(S||typeof h=="string")&&u.length>0&&u[u.length-1].openedBraces===0){var y=a(h);c<l.length-1&&(typeof l[c+1]=="string"||l[c+1].type==="plain-text")&&(y+=a(l[c+1]),l.splice(c+1,1)),c>0&&(typeof l[c-1]=="string"||l[c-1].type==="plain-text")&&(y=a(l[c-1])+y,l.splice(c-1,1),c--),l[c]=new e.Token("plain-text",y,null,y)}h.content&&typeof h.content!="string"&&s(h.content)}};e.hooks.add("after-tokenize",function(l){l.language!=="jsx"&&l.language!=="tsx"||s(l.tokens)})}(Prism),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|as|declare|implements|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter;var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(Prism),Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var r={};r["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var n={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};n["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:n},Prism.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml,Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|iota|nil|true|false)\b/,number:/(?:\b0x[a-f\d]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[-+]?\d+)?)i?/i,operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:bool|byte|complex(?:64|128)|error|float(?:32|64)|rune|string|u?int(?:8|16|32|64)?|uintptr|append|cap|close|complex|copy|delete|imag|len|make|new|panic|print(?:ln)?|real|recover)\b/}),delete Prism.languages.go["class-name"],function(e){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,r=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],n=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,i=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,o=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/i,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:bool|boolean|int|integer|float|string|object|array)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:bool|int|float|string|object|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*[\w|]\|\s*)(?:null|false)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?[\w|]\|\s*)(?:null|false)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|iterable|(?:null|false)(?=\s*\|))\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:null|false)\b/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|match|new|or|parent|print|private|protected|public|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s+)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:n,operator:i,punctuation:o};var a={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},s=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:a}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:a}}];e.languages.insertBefore("php","variable",{string:s,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:s,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,number:n,operator:i,punctuation:o}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),e.hooks.add("before-tokenize",function(l){/<\?/.test(l.code)&&e.languages["markup-templating"].buildPlaceholders(l,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/gi)}),e.hooks.add("after-tokenize",function(l){e.languages["markup-templating"].tokenizePlaceholders(l,"php")})}(Prism),Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:__attribute__|_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}},constant:/\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/}),delete Prism.languages.c.boolean,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},"string-interpolation":{pattern:/(?:f|rf|fr)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|rb|br)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|rb|br)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/im,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:True|False|None)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python,function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,n={pattern:RegExp(r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{"class-name":[n,{pattern:RegExp(r+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:n.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0}}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":n,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism),function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char8_t|char16_t|char32_t|class|compl|concept|const|consteval|constexpr|constinit|const_cast|continue|co_await|co_return|co_yield|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:true|false)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:module|import)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(Prism),function(e){function t(Te,Fe){return Te.replace(/<<(\d+)>>/g,function(rt,vt){return"(?:"+Fe[+vt]+")"})}function r(Te,Fe,rt){return RegExp(t(Te,Fe),rt||"")}function n(Te,Fe){for(var rt=0;rt<Fe;rt++)Te=Te.replace(/<<self>>/g,function(){return"(?:"+Te+")"});return Te.replace(/<<self>>/g,"[^\\s\\S]")}var i="bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",o="class enum interface record struct",a="add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",s="abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield";function l(Te){return"\\b(?:"+Te.trim().replace(/ /g,"|")+")\\b"}var u=l(o),c=RegExp(l(i+" "+o+" "+a+" "+s)),h=l(o+" "+a+" "+s),S=l(i+" "+o+" "+s),y=n(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),W=n(/\((?:[^()]|<<self>>)*\)/.source,2),B=/@?\b[A-Za-z_]\w*\b/.source,N=t(/<<0>>(?:\s*<<1>>)?/.source,[B,y]),U=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[h,N]),D=/\[\s*(?:,\s*)*\]/.source,Q=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[U,D]),te=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[y,W,D]),he=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[te]),Ee=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[he,U,D]),ve={keyword:c,punctuation:/[<>()?,.:[\]]/},De=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,Pe=/"(?:\\.|[^\\"\r\n])*"/.source,qe=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;e.languages.csharp=e.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[qe]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[Pe]),lookbehind:!0,greedy:!0},{pattern:RegExp(De),greedy:!0,alias:"character"}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[U]),lookbehind:!0,inside:ve},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[B,Ee]),lookbehind:!0,inside:ve},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[B]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[u,N]),lookbehind:!0,inside:ve},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[U]),lookbehind:!0,inside:ve},{pattern:r(/(\bwhere\s+)<<0>>/.source,[B]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[Q]),lookbehind:!0,inside:ve},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[Ee,S,B]),inside:ve}],keyword:c,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:ul|lu|[dflmu])?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),e.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[B]),lookbehind:!0,alias:"punctuation"}}),e.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[B]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|typeof|sizeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[W]),lookbehind:!0,alias:"class-name",inside:ve},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[Ee,U]),inside:ve,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[Ee]),lookbehind:!0,inside:ve,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[B,y]),inside:{function:r(/^<<0>>/.source,[B]),generic:{pattern:RegExp(y),alias:"class-name",inside:ve}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[u,N,B,Ee,c.source,W,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[N,W]),lookbehind:!0,greedy:!0,inside:e.languages.csharp},keyword:c,"class-name":{pattern:RegExp(Ee),greedy:!0,inside:ve},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var ot=Pe+"|"+De,et=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[ot]),gt=n(t(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[et]),2),dt=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,ht=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[U,gt]);e.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[dt,ht]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[dt]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[gt]),inside:e.languages.csharp},"class-name":{pattern:RegExp(U),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var pt=/:[^}\r\n]+/.source,Dt=n(t(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[et]),2),Ft=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Dt,pt]),Bt=n(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[ot]),2),It=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Bt,pt]);function Re(Te,Fe){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[Te]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[Fe,pt]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[Ft]),lookbehind:!0,greedy:!0,inside:Re(Ft,Dt)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[It]),lookbehind:!0,greedy:!0,inside:Re(It,Bt)}]})}(Prism),Prism.languages.dotnet=Prism.languages.cs=Prism.languages.csharp,Prism.languages["visual-basic"]={comment:{pattern:/(?:['‘’]|REM\b)(?:[^\r\n_]|_(?:\r\n?|\n)?)*/i,inside:{keyword:/^REM/i}},directive:{pattern:/#(?:Const|Else|ElseIf|End|ExternalChecksum|ExternalSource|If|Region)(?:[^\S\r\n]_[^\S\r\n]*(?:\r\n?|\n)|.)+/i,alias:"comment",greedy:!0},string:{pattern:/\$?["“”](?:["“”]{2}|[^"“”])*["“”]C?/i,greedy:!0},date:{pattern:/#[^\S\r\n]*(?:\d+([/-])\d+\1\d+(?:[^\S\r\n]+(?:\d+[^\S\r\n]*(?:AM|PM)|\d+:\d+(?::\d+)?(?:[^\S\r\n]*(?:AM|PM))?))?|\d+[^\S\r\n]*(?:AM|PM)|\d+:\d+(?::\d+)?(?:[^\S\r\n]*(?:AM|PM))?)[^\S\r\n]*#/i,alias:"builtin"},number:/(?:(?:\b\d+(?:\.\d+)?|\.\d+)(?:E[+-]?\d+)?|&[HO][\dA-F]+)(?:U?[ILS]|[FRD])?/i,boolean:/\b(?:True|False|Nothing)\b/i,keyword:/\b(?:AddHandler|AddressOf|Alias|And(?:Also)?|As|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|C(?:Bool|Byte|Char|Date|Dbl|Dec|Int|Lng|Obj|SByte|Short|Sng|Str|Type|UInt|ULng|UShort)|Char|Class|Const|Continue|Currency|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else(?:If)?|End(?:If)?|Enum|Erase|Error|Event|Exit|Finally|For|Friend|Function|Get(?:Type|XMLNamespace)?|Global|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|IsNot|Let|Lib|Like|Long|Loop|Me|Mod|Module|Must(?:Inherit|Override)|My(?:Base|Class)|Namespace|Narrowing|New|Next|Not(?:Inheritable|Overridable)?|Object|Of|On|Operator|Option(?:al)?|Or(?:Else)?|Out|Overloads|Overridable|Overrides|ParamArray|Partial|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|SByte|Select|Set|Shadows|Shared|short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|Try|TryCast|Type|TypeOf|U(?:Integer|Long|Short)|Using|Variant|Wend|When|While|Widening|With(?:Events)?|WriteOnly|Until|Xor)\b/i,operator:[/[+\-*/\\^<=>&#@$%!]/,{pattern:/([^\S\r\n])_(?=[^\S\r\n]*[\r\n])/,lookbehind:!0}],punctuation:/[{}().,:?]/},Prism.languages.vb=Prism.languages["visual-basic"],Prism.languages.vba=Prism.languages["visual-basic"],Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:S|ING)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:TRUE|FALSE|NULL)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|IN|ILIKE|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){e.languages.ruby=e.languages.extend("clike",{comment:[/#.*/,{pattern:/^=begin\s[\s\S]*?^=end/m,greedy:!0}],"class-name":{pattern:/(\b(?:class)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|protected|private|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/});var t={pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"tag"},rest:e.languages.ruby}};delete e.languages.ruby.function,e.languages.insertBefore("ruby","keyword",{regex:[{pattern:RegExp(/%r/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S])*\)/.source,/\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S])*\]/.source,/<(?:[^<>\\]|\\[\s\S])*>/.source].join("|")+")"+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:{pattern:/(^|[^:]):[a-zA-Z_]\w*(?:[?!]|\b)/,lookbehind:!0},"method-definition":{pattern:/(\bdef\s+)[\w.]+/,lookbehind:!0,inside:{function:/\w+$/,rest:e.languages.ruby}}}),e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|Fixnum|Float|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,constant:/\b[A-Z]\w*(?:[?!]|\b)/}),e.languages.ruby.string=[{pattern:RegExp(/%[qQiIwWxs]?/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S])*\)/.source,/\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S])*\]/.source,/<(?:[^<>\\]|\\[\s\S])*>/.source].join("|")+")"),greedy:!0,inside:{interpolation:t}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|[a-z_]\w*$/i,alias:"symbol",inside:{punctuation:/^<<[-~]?/}},interpolation:t}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|[a-z_]\w*$/i,alias:"symbol",inside:{punctuation:/^<<[-~]?'|'$/}}}}],e.languages.rb=e.languages.ruby}(Prism),Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:true|false)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:true|false)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=Prism.languages.swift}),function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},n={bash:r,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|x[0-9a-fA-F]{1,2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:n},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:n},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:n.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:n.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|aptitude|apt-cache|apt-get|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:if|then|else|elif|fi|for|while|in|case|esac|function|select|do|done|until)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|break|cd|continue|eval|exec|exit|export|getopts|hash|pwd|readonly|return|shift|test|times|trap|umask|unset|alias|bind|builtin|caller|command|declare|echo|enable|help|let|local|logout|mapfile|printf|read|readarray|source|type|typeset|ulimit|unalias|set|shopt)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:true|false)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=e.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=n.variable[1].inside,a=0;a<i.length;a++)o[i[a]]=e.languages.bash[i[a]];e.languages.shell=e.languages.bash}(Prism),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(u){return u=u.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+u+")")}var n=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return n}),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"font-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+o+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+o+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(n),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(n),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(u){["url","bold","italic","strike","code-snippet"].forEach(function(c){u!==c&&(e.languages.markdown[u].inside.content.inside[c]=e.languages.markdown[c])})}),e.hooks.add("after-tokenize",function(u){u.language!=="markdown"&&u.language!=="md"||function c(h){if(h&&typeof h!="string")for(var S=0,y=h.length;S<y;S++){var W=h[S];if(W.type==="code"){var B=W.content[1],N=W.content[3];if(B&&N&&B.type==="code-language"&&N.type==="code-block"&&typeof B.content=="string"){var U=B.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),D="language-"+(U=(/[a-z][\w-]*/i.exec(U)||[""])[0].toLowerCase());N.alias?typeof N.alias=="string"?N.alias=[N.alias,D]:N.alias.push(D):N.alias=[D]}}else c(W.content)}}(u.tokens)}),e.hooks.add("wrap",function(u){if(u.type==="code-block"){for(var c="",h=0,S=u.classes.length;h<S;h++){var y=u.classes[h],W=/language-(.+)/.exec(y);if(W){c=W[1];break}}var B=e.languages[c];if(B)u.content=e.highlight(function(U){var D=U.replace(a,"");return D.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(Q,te){var he;return(te=te.toLowerCase())[0]==="#"?(he=te[1]==="x"?parseInt(te.slice(2),16):Number(te.slice(1)),l(he)):s[te]||Q})}(u.content),B,c);else if(c&&c!=="none"&&e.plugins.autoloader){var N="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random());u.attributes.id=N,e.plugins.autoloader.loadLanguages(c,function(){var U=document.getElementById(N);U&&(U.innerHTML=e.highlight(U.textContent,e.languages[c],c))})}}});var a=RegExp(e.languages.markup.tag.pattern.source,"gi"),s={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(Prism),Prism.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/},Prism.languages.groovy=Prism.languages.extend("clike",{string:[{pattern:/("""|''')(?:[^\\]|\\[\s\S])*?\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/,greedy:!0},{pattern:/(["'/])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0}],keyword:/\b(?:as|def|in|abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/,number:/\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i,operator:{pattern:/(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,lookbehind:!0},punctuation:/\.+|[{}[\];(),:$]/}),Prism.languages.insertBefore("groovy","string",{shebang:{pattern:/#!.+/,alias:"comment"}}),Prism.languages.insertBefore("groovy","punctuation",{"spock-block":/\b(?:setup|given|when|then|and|cleanup|expect|where):/}),Prism.languages.insertBefore("groovy","function",{annotation:{pattern:/(^|[^.])@\w+/,lookbehind:!0,alias:"punctuation"}}),Prism.hooks.add("wrap",function(e){if(e.language==="groovy"&&e.type==="string"){var t=e.content[0];if(t!="'"){var r=/([^\\])(?:\$(?:\{.*?\}|[\w.]+))/;t==="$"&&(r=/([^\$])(?:\$(?:\{.*?\}|[\w.]+))/),e.content=e.content.replace(/</g,"<").replace(/&/g,"&"),e.content=Prism.highlight(e.content,{expression:{pattern:r,lookbehind:!0,inside:Prism.languages.groovy}}),e.classes.push(t==="/"?"regex":"gstring")}}});var Z0e=["comment","prolog","doctype","cdata","punctuation","namespace","property","tag","boolean","number","constant","symbol","deleted","selector","attr-name","string","builtin","inserted","operator","entity","url","string","atrule","attr-value","keyword","function","class-name","regex","important","variable","bold","italic","entity","char"];function TH(e){return typeof e=="string"?e.length:typeof e.content=="string"?e.content.length:e.content.reduce(function(t,r){return t+TH(r)},0)}var $b,J0e=vr.String,Va=function(e){if(J_(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return J0e(e)},AH=function(){var e=Ho(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},sR=vr.RegExp,lR=qn(function(){var e=sR("a","y");return e.lastIndex=2,e.exec("abcd")!=null}),Q0e=lR||qn(function(){return!sR("a","y").sticky}),DH={BROKEN_CARET:lR||qn(function(){var e=sR("^r","gy");return e.lastIndex=2,e.exec("str")!=null}),MISSED_STICKY:Q0e,UNSUPPORTED_Y:lR},q0e=va?Object.defineProperties:function(e,t){Ho(e);for(var r,n=Wb(t),i=Kb(t),o=i.length,a=0;o>a;)Ub.f(e,r=i[a++],n[r]);return e},eye=Bg("document","documentElement"),OH=JU("IE_PROTO"),uR=function(){},_H=function(e){return"<script>"+e+"</script>"},RH=function(e){e.write(_H("")),e.close();var t=e.parentWindow.Object;return e=null,t},Xb=function(){try{$b=new ActiveXObject("htmlfile")}catch(n){}var e,t;Xb=typeof document!="undefined"?document.domain&&$b?RH($b):((t=z_("iframe")).style.display="none",eye.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(_H("document.F=Object")),e.close(),e.F):RH($b);for(var r=Gb.length;r--;)delete Xb.prototype[Gb[r]];return Xb()};$_[OH]=!0;var kH,cR,tye=Object.create||function(e,t){var r;return e!==null?(uR.prototype=Ho(e),r=new uR,uR.prototype=null,r[OH]=e):r=Xb(),t===void 0?r:q0e(r,t)},rye=vr.RegExp,nye=qn(function(){var e=rye(".","s");return!(e.dotAll&&e.exec(`
|
|
|
`)&&e.flags==="s")}),iye=vr.RegExp,oye=qn(function(){var e=iye("(?<a>b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$<a>c")!=="bc"}),aye=Y_.get,sye=P_("native-string-replace",String.prototype.replace),Yb=RegExp.prototype.exec,dR=Yb,lye=Nr("".charAt),uye=Nr("".indexOf),cye=Nr("".replace),hR=Nr("".slice),fR=(cR=/b*/g,Gn(Yb,kH=/a/,"a"),Gn(Yb,cR,"a"),kH.lastIndex!==0||cR.lastIndex!==0),LH=DH.BROKEN_CARET,pR=/()??/.exec("")[1]!==void 0;(fR||pR||LH||nye||oye)&&(dR=function(e){var t,r,n,i,o,a,s,l=this,u=aye(l),c=Va(e),h=u.raw;if(h)return h.lastIndex=l.lastIndex,t=Gn(dR,h,c),l.lastIndex=h.lastIndex,t;var S=u.groups,y=LH&&l.sticky,W=Gn(AH,l),B=l.source,N=0,U=c;if(y&&(W=cye(W,"y",""),uye(W,"g")===-1&&(W+="g"),U=hR(c,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&lye(c,l.lastIndex-1)!==`
|
|
|
`)&&(B="(?: "+B+")",U=" "+U,N++),r=new RegExp("^(?:"+B+")",W)),pR&&(r=new RegExp("^"+B+"$(?!\\s)",W)),fR&&(n=l.lastIndex),i=Gn(Yb,y?r:l,U),y?i?(i.input=hR(i.input,N),i[0]=hR(i[0],N),i.index=l.lastIndex,l.lastIndex+=i[0].length):l.lastIndex=0:fR&&i&&(l.lastIndex=l.global?i.index+i[0].length:n),pR&&i&&i.length>1&&Gn(sye,i[0],r,function(){for(o=1;o<arguments.length-2;o++)arguments[o]===void 0&&(i[o]=void 0)}),i&&S)for(i.groups=a=tye(null),o=0;o<S.length;o++)a[(s=S[o])[0]]=i[s[1]];return i});var Wg=dR;Vb({target:"RegExp",proto:!0,forced:/./.exec!==Wg},{exec:Wg});var gR=Function.prototype,PH=gR.apply,dye=gR.bind,IH=gR.call,hye=typeof Reflect=="object"&&Reflect.apply||(dye?IH.bind(PH):function(){return IH.apply(PH,arguments)}),fye=vl("species"),vR=RegExp.prototype,pye=vl("match"),gye=vr.TypeError,vye=vl("species"),mye=Nr("".charAt),MH=Nr("".charCodeAt),yye=Nr("".slice),BH=function(e){return function(t,r){var n,i,o=Va($d(t)),a=tR(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=MH(o,a))<55296||n>56319||a+1===s||(i=MH(o,a+1))<56320||i>57343?e?mye(o,a):n:e?yye(o,a,a+2):i-56320+(n-55296<<10)+65536}},bye=(BH(!1),BH(!0)),Eye=function(e,t,r){return t+(r?bye(e,t).length:1)},xye=vr.Array,Sye=Math.max,FH=function(e,t,r){for(var n,i,o,a,s=rR(e),l=aR(t,s),u=aR(r===void 0?s:r,s),c=xye(Sye(u-l,0)),h=0;l<u;l++,h++)n=c,i=h,o=e[l],(a=G_(i))in n?Ub.f(n,a,V_(0,o)):n[a]=o;return c.length=h,c},wye=vr.TypeError,NH=function(e,t){var r=e.exec;if(gi(r)){var n=Gn(r,e,t);return n!==null&&Ho(n),n}if(ml(e)==="RegExp")return Gn(Wg,e,t);throw wye("RegExp#exec called on incompatible receiver")},Jd=DH.UNSUPPORTED_Y,Cye=Math.min,jH=[].push,Tye=Nr(/./.exec),Qd=Nr(jH),Gg=Nr("".slice);!function(e,t,r,n){var i=vl(e),o=!qn(function(){var u={};return u[i]=function(){return 7},""[e](u)!=7}),a=o&&!qn(function(){var u=!1,c=/a/;return(c={}).constructor={},c.constructor[fye]=function(){return c},c.flags="",c[i]=/./[i],c.exec=function(){return u=!0,null},c[i](""),!u});if(!o||!a||r){var s=Nr(/./[i]),l=function(u,c,h){var S;return S="abbc".split(/(b)*/)[1]=="c"||"test".split(/(?:)/,-1).length!=4||"ab".split(/(?:ab)*/).length!=2||".".split(/(.?)(.?)/).length!=4||".".split(/()()/).length>1||"".split(/.?/).length?function(y,W){var B,N,U=Va($d(this)),D=W===void 0?4294967295:W>>>0;if(D===0)return[];if(y===void 0)return[U];if(!Uo(B=y)||!((N=B[pye])!==void 0?N:ml(B)=="RegExp"))return Gn(c,U,y,D);for(var Q,te,he,Ee=[],ve=(y.ignoreCase?"i":"")+(y.multiline?"m":"")+(y.unicode?"u":"")+(y.sticky?"y":""),De=0,Pe=new RegExp(y.source,ve+"g");(Q=Gn(Wg,Pe,U))&&!((te=Pe.lastIndex)>De&&(Qd(Ee,Gg(U,De,Q.index)),Q.length>1&&Q.index<U.length&&hye(jH,Ee,FH(Q,1)),he=Q[0].length,De=te,Ee.length>=D));)Pe.lastIndex===Q.index&&Pe.lastIndex++;return De===U.length?!he&&Tye(Pe,"")||Qd(Ee,""):Qd(Ee,Gg(U,De)),Ee.length>D?FH(Ee,0,D):Ee}:"0".split(void 0,0).length?function(y,W){return y===void 0&&W===0?[]:Gn(c,this,y,W)}:c,[function(y,W){var B=$d(this),N=y==null?void 0:$U(y,u);return N?Gn(N,y,B,W):Gn(S,Va(B),y,W)},function(y,W){var B=Ho(this),N=Va(y),U=h(S,B,N,W,S!==c);if(U.done)return U.value;var D=function(gt,dt){var ht,pt=Ho(gt).constructor;return pt===void 0||(ht=Ho(pt)[vye])==null?dt:function(Dt){if(uH(Dt))return Dt;throw gye(VU(Dt)+" is not a constructor")}(ht)}(B,RegExp),Q=B.unicode,te=(B.ignoreCase?"i":"")+(B.multiline?"m":"")+(B.unicode?"u":"")+(Jd?"g":"y"),he=new D(Jd?"^(?:"+B.source+")":B,te),Ee=W===void 0?4294967295:W>>>0;if(Ee===0)return[];if(N.length===0)return NH(he,N)===null?[N]:[];for(var ve=0,De=0,Pe=[];De<N.length;){he.lastIndex=Jd?0:De;var qe,ot=NH(he,Jd?Gg(N,De):N);if(ot===null||(qe=Cye(oH(he.lastIndex+(Jd?De:0)),N.length))===ve)De=Eye(N,De,Q);else{if(Qd(Pe,Gg(N,ve,De)),Pe.length===Ee)return Pe;for(var et=1;et<=ot.length-1;et++)if(Qd(Pe,ot[et]),Pe.length===Ee)return Pe;De=ve=qe}}return Qd(Pe,Gg(N,ve)),Pe}]}(i,""[e],function(u,c,h,S,y){var W=Nr(u),B=c.exec;return B===Wg||B===vR.exec?o&&!y?{done:!0,value:s(c,h,S)}:{done:!0,value:W(h,c,S)}:{done:!1}});Ug(String.prototype,e,l[0]),Ug(vR,i,l[1])}n&&Xd(vR[i],"sham",!0)}("split",0,!!qn(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return r.length!==2||r[0]!=="a"||r[1]!=="b"}),Jd),Vb({global:!0},{globalThis:vr}),no&&(_e.fn.attr=no);var Aye=eH.PROPER,mR=RegExp.prototype,UH=mR.toString,Dye=Nr(AH),Oye=qn(function(){return UH.call({source:"a",flags:"b"})!="/a/b"}),_ye=Aye&&UH.name!="toString";(Oye||_ye)&&Ug(RegExp.prototype,"toString",function(){var e=Ho(this),t=Va(e.source),r=e.flags;return"/"+t+"/"+Va(r===void 0&&GU(mR,e)&&!("flags"in mR)?Dye(e):r)},{unsafe:!0});var Rye=function(){function e(){this.title=wt("highLightModule.selectLang"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M64 64v896h896V64H64z m487.6 698.8c0 87.2-51.2 127-125.8 127-67.4 0-106.4-34.8-126.4-77l68.6-41.4c13.2 23.4 25.2 43.2 54.2 43.2 27.6 0 45.2-10.8 45.2-53V475.4h84.2v287.4z m199.2 127c-78.2 0-128.8-37.2-153.4-86l68.6-39.6c18 29.4 41.6 51.2 83 51.2 34.8 0 57.2-17.4 57.2-41.6 0-28.8-22.8-39-61.4-56l-21-9c-60.8-25.8-101-58.4-101-127 0-63.2 48.2-111.2 123.2-111.2 53.6 0 92 18.6 119.6 67.4L800 580c-14.4-25.8-30-36-54.2-36-24.6 0-40.2 15.6-40.2 36 0 25.2 15.6 35.4 51.8 51.2l21 9c71.6 30.6 111.8 62 111.8 132.4 0 75.6-59.6 117.2-139.4 117.2z"></path></svg>',this.tag="select",this.width=95,this.selectPanelWidth=115}return e.prototype.getOptions=function(t){var r=[],n=t.getMenuConfig("codeSelectLang").codeLangs,i=n===void 0?[]:n;r.push({text:"plain text",value:""}),i.forEach(function(a){var s=a.text,l=a.value;r.push({text:s,value:l})});var o=this.getValue(t);return r.forEach(function(a){a.value===o?a.selected=!0:delete a.selected}),r},e.prototype.isActive=function(t){return!1},e.prototype.getValue=function(t){var r=this.getSelectCodeElem(t);if(r==null)return"";if(!Ut.isElement(r))return"";var n=r.language.toString(),i=t.getMenuConfig("codeSelectLang").codeLangs;return(i===void 0?[]:i).some(function(o){return o.value===n})?n:""},e.prototype.isDisabled=function(t){return t.selection==null||!this.getSelectCodeElem(t)},e.prototype.exec=function(t,r){if(this.getSelectCodeElem(t)!=null){var n={language:r.toString()};Ve.setNodes(t,n,{match:function(i){return Ae.checkNodeType(i,"code")}})}},e.prototype.getSelectCodeElem=function(t){var r=Ae.getSelectedNodeByType(t,"code");if(r==null)return null;var n=Ae.getParentNode(t,r);return Ut.isElement(n)?n.type!=="pre"?null:r:null},e}(),kye={renderStyle:function(e,t){var r=e,n=t,i="";return Z0e.forEach(function(o){r[o]&&(i=o)}),i&&function(o,a){o.data==null&&(o.data={});var s=o.data;s.props==null&&(s.props={}),Object.assign(s.props,{className:a})}(n,i="token "+i),n},parseStyleHtml:function(e,t,r){var n=_e(e);if(!Ut.isElement(t))return t;if(Ae.getNodeType(t)!=="code")return t;var i=t,o=n.attr("class")||"";return o.indexOf("language-")===0?i.language=o.split("-")[1]||"":i.language=o.toLowerCase(),i},menus:[{key:"codeSelectLang",factory:function(){return new Rye},config:{codeLangs:[{text:"CSS",value:"css"},{text:"HTML",value:"html"},{text:"XML",value:"xml"},{text:"Javascript",value:"javascript"},{text:"Typescript",value:"typescript"},{text:"JSX",value:"jsx"},{text:"Go",value:"go"},{text:"PHP",value:"php"},{text:"C",value:"c"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C++",value:"cpp"},{text:"C#",value:"csharp"},{text:"Visual Basic",value:"visual-basic"},{text:"SQL",value:"sql"},{text:"Ruby",value:"ruby"},{text:"Swift",value:"swift"},{text:"Bash",value:"bash"},{text:"Lua",value:"lua"},{text:"Groovy",value:"groovy"},{text:"Markdown",value:"markdown"}]}}],elemsToHtml:[{type:"code",elemToHtml:function(e,t){var r=e.language,n=r===void 0?"":r;return"<code "+(n?'class="language-'+n+'"':"")+">"+t+"</code>"}}]},Lye=/"/g,Pye=Nr("".replace);Vb({target:"String",proto:!0,forced:qn(function(){var e="".anchor('"');return e!==e.toLowerCase()||e.split('"').length>3})},{anchor:function(e){return t=e,r=Va($d(this)),n="<a",(n+=' name="'+Pye(Va(t),Lye,""")+'"')+">"+r+"</a>";var t,r,n}});var HH=function(e){var t,r,n,i=function(U,D){var Q=typeof Symbol=="function"&&U[Symbol.iterator];if(!Q)return U;var te,he,Ee=Q.call(U),ve=[];try{for(;(D===void 0||D-- >0)&&!(te=Ee.next()).done;)ve.push(te.value)}catch(De){he={error:De}}finally{try{te&&!te.done&&(Q=Ee.return)&&Q.call(Ee)}finally{if(he)throw he.error}}return ve}(e,2),o=i[0],a=i[1],s=[],l=function(U){if(!Rt.isText(U))return null;var D=Ae.getParentNode(null,U);if(D&&Ae.getNodeType(D)==="code"){var Q=Ae.getParentNode(null,D);if(Q&&Ae.getNodeType(Q)==="pre")return D}return null}(o);if(l==null)return s;var u=l.language,c=u===void 0?"":u;if(!c)return s;var h=function(U,D){if(!D)return[];var Q=CH.languages[D];return Q?CH.tokenize(U.text,Q):[]}(o,c),S=0;try{for(var y=function(U){var D=typeof Symbol=="function"&&Symbol.iterator,Q=D&&U[D],te=0;if(Q)return Q.call(U);if(U&&typeof U.length=="number")return{next:function(){return U&&te>=U.length&&(U=void 0),{value:U&&U[te++],done:!U}}};throw new TypeError(D?"Object is not iterable.":"Symbol.iterator is not defined.")}(h),W=y.next();!W.done;W=y.next()){var B=W.value,N=S+TH(B);typeof B!="string"&&s.push(((n={})[B.type]=!0,n.anchor={path:a,offset:S},n.focus={path:a,offset:N},n)),S=N}}catch(U){t={error:U}}finally{try{W&&!W.done&&(r=y.return)&&r.call(y)}finally{if(t)throw t.error}}return s},gn=function(){return gn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},gn.apply(this,arguments)},ei=function(){function e(){throw new Error(`\u4E0D\u80FD\u5B9E\u4F8B\u5316
|
|
|
Can not construct a instance`)}return e.setEditorConfig=function(t){t===void 0&&(t={}),this.editorConfig=gn(gn({},this.editorConfig),t)},e.setSimpleEditorConfig=function(t){t===void 0&&(t={}),this.simpleEditorConfig=gn(gn({},this.simpleEditorConfig),t)},e.setToolbarConfig=function(t){t===void 0&&(t={}),this.toolbarConfig=gn(gn({},this.toolbarConfig),t)},e.setSimpleToolbarConfig=function(t){t===void 0&&(t={}),this.simpleToolbarConfig=gn(gn({},this.simpleToolbarConfig),t)},e.registerPlugin=function(t){this.plugins.push(t)},e.registerMenu=function(t,r){!function(n,i){var o=n.key,a=n.factory,s=n.config,l=lo(lo({},s),i||{});if(bf[o]!=null)throw new Error("Duplicated key '"+o+"' in menu items");bf[o]=a,function(u,c){c!=null&&(p4[u]=c)}(o,l)}(t,r)},e.registerRenderElem=function(t){!function(r){var n=r.type,i=r.renderElem;b3[n||""]=i}(t)},e.registerRenderStyle=function(t){!function(r){Ww.push(r)}(t)},e.registerElemToHtml=function(t){!function(r){var n=r.type,i=r.elemToHtml;v4[n||""]=i}(t)},e.registerStyleToHtml=function(t){!function(r){uw.push(r)}(t)},e.registerPreParseHtml=function(t){!function(r){Z4.push(r)}(t)},e.registerParseElemHtml=function(t){!function(r){var n=r.selector,i=r.parseElemHtml;Wm[n]=i}(t)},e.registerParseStyleHtml=function(t){!function(r){_w.push(r)}(t)},e.registerModule=function(t){Xu(t)},e.editorConfig={},e.simpleEditorConfig={},e.toolbarConfig={},e.simpleToolbarConfig={},e.plugins=[],e}();/*! *****************************************************************************
|
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
purpose with or without fee is hereby granted.
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
|
***************************************************************************** */function Xu(e){var t=e.menus,r=e.renderElems,n=e.renderStyle,i=e.elemsToHtml,o=e.styleToHtml,a=e.preParseHtml,s=e.parseElemsHtml,l=e.parseStyleHtml,u=e.editorPlugin;t&&t.forEach(function(c){return ei.registerMenu(c)}),r&&r.forEach(function(c){return ei.registerRenderElem(c)}),n&&ei.registerRenderStyle(n),i&&i.forEach(function(c){return ei.registerElemToHtml(c)}),o&&ei.registerStyleToHtml(o),a&&a.forEach(function(c){return ei.registerPreParseHtml(c)}),s&&s.forEach(function(c){return ei.registerParseElemHtml(c)}),l&&ei.registerParseStyleHtml(l),u&&ei.registerPlugin(u)}Gae.forEach(function(e){return Xu(e)}),Xu(xue),Xu(Vde),Xu(ege),Xu(Gme),Xu(kye);var zH='<svg viewBox="0 0 1024 1024"><path d="M959.877 128l0.123 0.123v767.775l-0.123 0.122H64.102l-0.122-0.122V128.123l0.122-0.123h895.775zM960 64H64C28.795 64 0 92.795 0 128v768c0 35.205 28.795 64 64 64h896c35.205 0 64-28.795 64-64V128c0-35.205-28.795-64-64-64zM832 288.01c0 53.023-42.988 96.01-96.01 96.01s-96.01-42.987-96.01-96.01S682.967 192 735.99 192 832 234.988 832 288.01zM896 832H128V704l224.01-384 256 320h64l224.01-192z"></path></svg>',WH={link:{menuKeys:["editLink","unLink","viewLink"]},image:{menuKeys:["imageWidth30","imageWidth50","imageWidth100","editImage","viewImageLink","deleteImage"]},pre:{menuKeys:["enter","codeBlock","codeSelectLang"]},table:{menuKeys:["enter","tableHeader","tableFullWidth","insertTableRow","deleteTableRow","insertTableCol","deleteTableCol","deleteTable"]},divider:{menuKeys:["enter"]},video:{menuKeys:["enter","editVideoSize"]}},Iye={hoverbarKeys:gn(gn({},WH),{text:{menuKeys:["headerSelect","insertLink","bulletedList","|","bold","through","color","bgColor","clearStyle"]}})};ei.setEditorConfig(gn(gn({},Iye),{decorate:HH}));var Mye={hoverbarKeys:WH};ei.setSimpleEditorConfig(gn(gn({},Mye),{decorate:HH}));var Bye={toolbarKeys:["headerSelect","blockquote","|","bold","underline","italic",{key:"group-more-style",title:wt("editor.more"),iconSvg:'<svg viewBox="0 0 1024 1024"><path d="M204.8 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z"></path><path d="M505.6 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z"></path><path d="M806.4 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z"></path></svg>',menuKeys:["through","code","sup","sub","clearStyle"]},"color","bgColor","|","fontSize","fontFamily","lineHeight","|","bulletedList","numberedList","todo",{key:"group-justify",title:wt("editor.justify"),iconSvg:'<svg viewBox="0 0 1024 1024"><path d="M768 793.6v102.4H51.2v-102.4h716.8z m204.8-230.4v102.4H51.2v-102.4h921.6z m-204.8-230.4v102.4H51.2v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',menuKeys:["justifyLeft","justifyRight","justifyCenter","justifyJustify"]},{key:"group-indent",title:wt("editor.indent"),iconSvg:'<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m0-128V320l256 192z"></path></svg>',menuKeys:["indent","delIndent"]},"|","emotion","insertLink",{key:"group-image",title:wt("editor.image"),iconSvg:zH,menuKeys:["insertImage","uploadImage"]},{key:"group-video",title:wt("editor.video"),iconSvg:'<svg viewBox="0 0 1024 1024"><path d="M981.184 160.096C837.568 139.456 678.848 128 512 128S186.432 139.456 42.816 160.096C15.296 267.808 0 386.848 0 512s15.264 244.16 42.816 351.904C186.464 884.544 345.152 896 512 896s325.568-11.456 469.184-32.096C1008.704 756.192 1024 637.152 1024 512s-15.264-244.16-42.816-351.904zM384 704V320l320 192-320 192z"></path></svg>',menuKeys:["insertVideo","uploadVideo"]},"insertTable","codeBlock","divider","|","undo","redo","|","fullScreen"]};ei.setToolbarConfig(Bye);var Fye={toolbarKeys:["blockquote","header1","header2","header3","|","bold","underline","italic","through","color","bgColor","clearStyle","|","bulletedList","numberedList","todo","justifyLeft","justifyRight","justifyCenter","|","insertLink",{key:"group-image",title:wt("editor.image"),iconSvg:zH,menuKeys:["insertImage","uploadImage"]},"insertVideo","insertTable","codeBlock","|","undo","redo","|","fullScreen"]};function Nye(e){e===void 0&&(e={});var t=e.selector,r=t===void 0?"":t,n=e.content,i=n===void 0?[]:n,o=e.html,a=e.config,s=a===void 0?{}:a,l=e.mode,u=(l===void 0?"default":l)==="simple"?ei.simpleEditorConfig:ei.editorConfig,c=gn(gn({},u.hoverbarKeys||{}),s.hoverbarKeys||{});return Qq({selector:r,config:gn(gn(gn({},u),s),{hoverbarKeys:c}),content:i,html:o,plugins:ei.plugins})}function jye(e){var t=e.selector,r=e.editor,n=e.config,i=n===void 0?{}:n,o=e.mode,a=o===void 0?"default":o;if(!t)throw new Error("Cannot find 'selector' when create toolbar");var s=a==="simple"?ei.simpleToolbarConfig:ei.toolbarConfig,l=function(u,c){if(u==null)throw new Error("Cannot create toolbar, because editor is null");var h=c.selector,S=c.config,y=S===void 0?{}:S;if(function(N,U){return i3(N,"data-w-e-toolbar",U)}(u,h))throw new Error("Repeated create toolbar by selector '"+h+"'");var W=lo({toolbarKeys:[],excludeKeys:[],insertKeys:{index:0,keys:[]},modalAppendToBody:!1},y||{}),B=new nee(h,W);return YS.set(B,u),Im.set(u,B),B}(r,{selector:t,config:gn(gn({},s),i)});return l}ei.setSimpleToolbarConfig(Fye);var Gye={}}).call(this,He("IyRk"))}}]);
|